# PaCkAgE DaTaStReAm
LNFapr1 1 3555
# end of header
0707010001f153000081a4000017820000044e000000014b1d38cb000003840000022d0000016a00000000000000000000001000000000LNFapr1/pkginfo PKG=LNFapr1
ARCH=i386
VERSION=1.3.9
SERIALNUM=001
NAME=Apache Portable Runtime (APR) 1 libraries
CATEGORY=develop,application
EMAIL=developers@linofee.org
VENDOR=LINOFEE, http://www.linofee.org
BASEDIR=/usr
DESC=The mission of the Apache Portable Runtime (APR) project is to create and maintain software libraries that provide a predictable and consistent interface to underlying platform-specific implementations. The primary goal is to provide an API to which software developers may code and be assured of predictable if not identical behaviour regardless of the platform on which their software is built, relieving them of the need to code special-case conditions to work around or take advantage of platform-specific deficiencies or features.
LICINFO=Apache Software License, Version 2.0
LICURL=http://www.apache.org/LICENSE.txt
LICFILE=apache2.txt
PSTAMP=idev20091207181803
CLASSES=none rename
0707010001f152000081a4000017820000044e000000014b1d38cc0000194e0000022d0000016a00000000000000000000000f00000000LNFapr1/pkgmap : 1 3555
1 d none bin ? ? ?
1 f rename bin/apr-1-config 0755 bin bin 6997 13928 1260206283
1 f rename bin/apu-1-config 0755 bin bin 6488 40017 1260206283
1 i depend 167 13871 1221619129
1 i i.rename 313 24364 1169409199
1 d none include ? ? ?
1 d none include/apr-1 0755 bin bin
1 f none include/apr-1/apr.h 0644 bin bin 13964 25781 1260206279
1 f none include/apr-1/apr_allocator.h 0644 bin bin 5334 44708 1260206279
1 f none include/apr-1/apr_anylock.h 0644 bin bin 5050 35768 1260206281
1 f none include/apr-1/apr_atomic.h 0644 bin bin 4130 21620 1260206279
1 f none include/apr-1/apr_base64.h 0644 bin bin 3823 57460 1260206281
1 f none include/apr-1/apr_buckets.h 0644 bin bin 60020 64941 1260206281
1 f none include/apr-1/apr_date.h 0644 bin bin 3554 13649 1260206281
1 f none include/apr-1/apr_dbd.h 0644 bin bin 24093 4453 1260206281
1 f none include/apr-1/apr_dbm.h 0644 bin bin 8599 26734 1260206281
1 f none include/apr-1/apr_dso.h 0644 bin bin 2700 25029 1260206279
1 f none include/apr-1/apr_env.h 0644 bin bin 2105 45483 1260206279
1 f none include/apr-1/apr_errno.h 0644 bin bin 54048 30870 1260206279
1 f none include/apr-1/apr_file_info.h 0644 bin bin 17647 10354 1260206279
1 f none include/apr-1/apr_file_io.h 0644 bin bin 39225 37226 1260206279
1 f none include/apr-1/apr_fnmatch.h 0644 bin bin 6025 15290 1260206279
1 f none include/apr-1/apr_general.h 0644 bin bin 7000 42308 1260206279
1 f none include/apr-1/apr_getopt.h 0644 bin bin 5980 31908 1260206279
1 f none include/apr-1/apr_global_mutex.h 0644 bin bin 5680 14303 1260206279
1 f none include/apr-1/apr_hash.h 0644 bin bin 8224 63845 1260206279
1 f none include/apr-1/apr_hooks.h 0644 bin bin 8585 47295 1260206281
1 f none include/apr-1/apr_inherit.h 0644 bin bin 2137 47806 1260206279
1 f none include/apr-1/apr_ldap.h 0644 bin bin 5704 7249 1260206281
1 f none include/apr-1/apr_ldap_init.h 0644 bin bin 5780 10710 1260206281
1 f none include/apr-1/apr_ldap_option.h 0644 bin bin 8604 41864 1260206281
1 f none include/apr-1/apr_ldap_rebind.h 0644 bin bin 3168 62596 1260206281
1 f none include/apr-1/apr_ldap_url.h 0644 bin bin 3799 32681 1260206281
1 f none include/apr-1/apr_lib.h 0644 bin bin 8352 43447 1260206279
1 f none include/apr-1/apr_md4.h 0644 bin bin 4525 42434 1260206281
1 f none include/apr-1/apr_md5.h 0644 bin bin 5573 519 1260206281
1 f none include/apr-1/apr_memcache.h 0644 bin bin 17072 60128 1260206281
1 f none include/apr-1/apr_mmap.h 0644 bin bin 5130 5425 1260206279
1 f none include/apr-1/apr_network_io.h 0644 bin bin 32492 59421 1260206279
1 f none include/apr-1/apr_optional.h 0644 bin bin 2780 34306 1260206281
1 f none include/apr-1/apr_optional_hooks.h 0644 bin bin 3869 64111 1260206281
1 f none include/apr-1/apr_poll.h 0644 bin bin 11082 39650 1260206279
1 f none include/apr-1/apr_pools.h 0644 bin bin 29390 30340 1260206279
1 f none include/apr-1/apr_portable.h 0644 bin bin 18502 12836 1260206279
1 f none include/apr-1/apr_proc_mutex.h 0644 bin bin 6002 30406 1260206279
1 f none include/apr-1/apr_queue.h 0644 bin bin 4082 16636 1260206281
1 f none include/apr-1/apr_random.h 0644 bin bin 5036 16544 1260206279
1 f none include/apr-1/apr_reslist.h 0644 bin bin 6326 56986 1260206281
1 f none include/apr-1/apr_ring.h 0644 bin bin 18997 28278 1260206279
1 f none include/apr-1/apr_rmm.h 0644 bin bin 4778 15266 1260206281
1 f none include/apr-1/apr_sdbm.h 0644 bin bin 6113 34421 1260206281
1 f none include/apr-1/apr_sha1.h 0644 bin bin 3884 57845 1260206281
1 f none include/apr-1/apr_shm.h 0644 bin bin 5448 61315 1260206279
1 f none include/apr-1/apr_signal.h 0644 bin bin 2761 32498 1260206279
1 f none include/apr-1/apr_strings.h 0644 bin bin 13990 63026 1260206279
1 f none include/apr-1/apr_strmatch.h 0644 bin bin 2677 28267 1260206281
1 f none include/apr-1/apr_support.h 0644 bin bin 1634 3706 1260206279
1 f none include/apr-1/apr_tables.h 0644 bin bin 17241 41241 1260206279
1 f none include/apr-1/apr_thread_cond.h 0644 bin bin 5525 12317 1260206279
1 f none include/apr-1/apr_thread_mutex.h 0644 bin bin 3836 57919 1260206279
1 f none include/apr-1/apr_thread_pool.h 0644 bin bin 11104 60025 1260206282
1 f none include/apr-1/apr_thread_proc.h 0644 bin bin 34911 50154 1260206279
1 f none include/apr-1/apr_thread_rwlock.h 0644 bin bin 4766 19485 1260206279
1 f none include/apr-1/apr_time.h 0644 bin bin 7385 10745 1260206279
1 f none include/apr-1/apr_uri.h 0644 bin bin 6589 55175 1260206282
1 f none include/apr-1/apr_user.h 0644 bin bin 5307 36514 1260206279
1 f none include/apr-1/apr_uuid.h 0644 bin bin 2102 40269 1260206282
1 f none include/apr-1/apr_version.h 0644 bin bin 5239 30300 1260206280
1 f none include/apr-1/apr_want.h 0644 bin bin 3037 32157 1260206280
1 f none include/apr-1/apr_xlate.h 0644 bin bin 6408 789 1260206282
1 f none include/apr-1/apr_xml.h 0644 bin bin 12357 61173 1260206282
1 f none include/apr-1/apu.h 0644 bin bin 3560 23889 1260206282
1 f none include/apr-1/apu_version.h 0644 bin bin 4126 11796 1260206282
1 f none include/apr-1/apu_want.h 0644 bin bin 1491 50424 1260206282
1 d none lib ? ? ?
1 d none lib/amd64 ? ? ?
1 s none lib/amd64/libapr-1.so=libapr-1.so.0.3.9
1 s none lib/amd64/libapr-1.so.0=libapr-1.so.0.3.9
1 f none lib/amd64/libapr-1.so.0.3.9 0755 bin bin 566568 44383 1260206283
1 s none lib/amd64/libaprutil-1.so=libaprutil-1.so.0.3.9
1 s none lib/amd64/libaprutil-1.so.0=libaprutil-1.so.0.3.9
1 f none lib/amd64/libaprutil-1.so.0.3.9 0755 bin bin 350776 4509 1260206283
1 f none lib/apr-1.exp 0644 bin bin 8130 29934 1260206280
1 d none lib/apr-util-1 ? ? ?
1 f none lib/apr-util-1/apr_dbm_db-1.so 0755 bin bin 14160 19698 1260206280
1 s none lib/apr-util-1/apr_dbm_db.so=apr_dbm_db-1.so
1 f none lib/apr-util-1/apr_ldap-1.so 0755 bin bin 24960 26826 1260206280
1 s none lib/apr-util-1/apr_ldap.so=apr_ldap-1.so
1 f none lib/aprutil-1.exp 0644 bin bin 5442 19740 1260206283
1 d none lib/pkgconfig ? ? ?
1 f rename lib/pkgconfig/apr-1.pc 0644 bin bin 405 34447 1260206283
1 f rename lib/pkgconfig/apr-util-1.pc 0644 bin bin 406 35586 1260206283
1 i pkginfo 900 14408 1260206283
1 i postinstall 541 41457 1260206283
1 i postremove 571 42011 1260206283
1 d none share ? ? ?
1 d none share/apr 0755 bin bin
1 d none share/apr/build-1 0755 bin bin
1 f rename share/apr/build-1/apr_rules.mk 0644 bin bin 6319 37712 1260206283
1 f none share/apr/build-1/make_exports.awk 0644 bin bin 2991 16339 1260206280
1 f none share/apr/build-1/make_var_export.awk 0644 bin bin 1023 8586 1260206280
07070100000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000b00000000TRAILER!!! 0707010001f153000081a4000017820000044e000000014b1d38cb000003840000022d0000016a00000000000000000000000800000000pkginfo PKG=LNFapr1
ARCH=i386
VERSION=1.3.9
SERIALNUM=001
NAME=Apache Portable Runtime (APR) 1 libraries
CATEGORY=develop,application
EMAIL=developers@linofee.org
VENDOR=LINOFEE, http://www.linofee.org
BASEDIR=/usr
DESC=The mission of the Apache Portable Runtime (APR) project is to create and maintain software libraries that provide a predictable and consistent interface to underlying platform-specific implementations. The primary goal is to provide an API to which software developers may code and be assured of predictable if not identical behaviour regardless of the platform on which their software is built, relieving them of the need to code special-case conditions to work around or take advantage of platform-specific deficiencies or features.
LICINFO=Apache Software License, Version 2.0
LICURL=http://www.apache.org/LICENSE.txt
LICFILE=apache2.txt
PSTAMP=idev20091207181803
CLASSES=none rename
0707010001f152000081a4000017820000044e000000014b1d38cc0000194e0000022d0000016a00000000000000000000000700000000pkgmap : 1 3555
1 d none bin ? ? ?
1 f rename bin/apr-1-config 0755 bin bin 6997 13928 1260206283
1 f rename bin/apu-1-config 0755 bin bin 6488 40017 1260206283
1 i depend 167 13871 1221619129
1 i i.rename 313 24364 1169409199
1 d none include ? ? ?
1 d none include/apr-1 0755 bin bin
1 f none include/apr-1/apr.h 0644 bin bin 13964 25781 1260206279
1 f none include/apr-1/apr_allocator.h 0644 bin bin 5334 44708 1260206279
1 f none include/apr-1/apr_anylock.h 0644 bin bin 5050 35768 1260206281
1 f none include/apr-1/apr_atomic.h 0644 bin bin 4130 21620 1260206279
1 f none include/apr-1/apr_base64.h 0644 bin bin 3823 57460 1260206281
1 f none include/apr-1/apr_buckets.h 0644 bin bin 60020 64941 1260206281
1 f none include/apr-1/apr_date.h 0644 bin bin 3554 13649 1260206281
1 f none include/apr-1/apr_dbd.h 0644 bin bin 24093 4453 1260206281
1 f none include/apr-1/apr_dbm.h 0644 bin bin 8599 26734 1260206281
1 f none include/apr-1/apr_dso.h 0644 bin bin 2700 25029 1260206279
1 f none include/apr-1/apr_env.h 0644 bin bin 2105 45483 1260206279
1 f none include/apr-1/apr_errno.h 0644 bin bin 54048 30870 1260206279
1 f none include/apr-1/apr_file_info.h 0644 bin bin 17647 10354 1260206279
1 f none include/apr-1/apr_file_io.h 0644 bin bin 39225 37226 1260206279
1 f none include/apr-1/apr_fnmatch.h 0644 bin bin 6025 15290 1260206279
1 f none include/apr-1/apr_general.h 0644 bin bin 7000 42308 1260206279
1 f none include/apr-1/apr_getopt.h 0644 bin bin 5980 31908 1260206279
1 f none include/apr-1/apr_global_mutex.h 0644 bin bin 5680 14303 1260206279
1 f none include/apr-1/apr_hash.h 0644 bin bin 8224 63845 1260206279
1 f none include/apr-1/apr_hooks.h 0644 bin bin 8585 47295 1260206281
1 f none include/apr-1/apr_inherit.h 0644 bin bin 2137 47806 1260206279
1 f none include/apr-1/apr_ldap.h 0644 bin bin 5704 7249 1260206281
1 f none include/apr-1/apr_ldap_init.h 0644 bin bin 5780 10710 1260206281
1 f none include/apr-1/apr_ldap_option.h 0644 bin bin 8604 41864 1260206281
1 f none include/apr-1/apr_ldap_rebind.h 0644 bin bin 3168 62596 1260206281
1 f none include/apr-1/apr_ldap_url.h 0644 bin bin 3799 32681 1260206281
1 f none include/apr-1/apr_lib.h 0644 bin bin 8352 43447 1260206279
1 f none include/apr-1/apr_md4.h 0644 bin bin 4525 42434 1260206281
1 f none include/apr-1/apr_md5.h 0644 bin bin 5573 519 1260206281
1 f none include/apr-1/apr_memcache.h 0644 bin bin 17072 60128 1260206281
1 f none include/apr-1/apr_mmap.h 0644 bin bin 5130 5425 1260206279
1 f none include/apr-1/apr_network_io.h 0644 bin bin 32492 59421 1260206279
1 f none include/apr-1/apr_optional.h 0644 bin bin 2780 34306 1260206281
1 f none include/apr-1/apr_optional_hooks.h 0644 bin bin 3869 64111 1260206281
1 f none include/apr-1/apr_poll.h 0644 bin bin 11082 39650 1260206279
1 f none include/apr-1/apr_pools.h 0644 bin bin 29390 30340 1260206279
1 f none include/apr-1/apr_portable.h 0644 bin bin 18502 12836 1260206279
1 f none include/apr-1/apr_proc_mutex.h 0644 bin bin 6002 30406 1260206279
1 f none include/apr-1/apr_queue.h 0644 bin bin 4082 16636 1260206281
1 f none include/apr-1/apr_random.h 0644 bin bin 5036 16544 1260206279
1 f none include/apr-1/apr_reslist.h 0644 bin bin 6326 56986 1260206281
1 f none include/apr-1/apr_ring.h 0644 bin bin 18997 28278 1260206279
1 f none include/apr-1/apr_rmm.h 0644 bin bin 4778 15266 1260206281
1 f none include/apr-1/apr_sdbm.h 0644 bin bin 6113 34421 1260206281
1 f none include/apr-1/apr_sha1.h 0644 bin bin 3884 57845 1260206281
1 f none include/apr-1/apr_shm.h 0644 bin bin 5448 61315 1260206279
1 f none include/apr-1/apr_signal.h 0644 bin bin 2761 32498 1260206279
1 f none include/apr-1/apr_strings.h 0644 bin bin 13990 63026 1260206279
1 f none include/apr-1/apr_strmatch.h 0644 bin bin 2677 28267 1260206281
1 f none include/apr-1/apr_support.h 0644 bin bin 1634 3706 1260206279
1 f none include/apr-1/apr_tables.h 0644 bin bin 17241 41241 1260206279
1 f none include/apr-1/apr_thread_cond.h 0644 bin bin 5525 12317 1260206279
1 f none include/apr-1/apr_thread_mutex.h 0644 bin bin 3836 57919 1260206279
1 f none include/apr-1/apr_thread_pool.h 0644 bin bin 11104 60025 1260206282
1 f none include/apr-1/apr_thread_proc.h 0644 bin bin 34911 50154 1260206279
1 f none include/apr-1/apr_thread_rwlock.h 0644 bin bin 4766 19485 1260206279
1 f none include/apr-1/apr_time.h 0644 bin bin 7385 10745 1260206279
1 f none include/apr-1/apr_uri.h 0644 bin bin 6589 55175 1260206282
1 f none include/apr-1/apr_user.h 0644 bin bin 5307 36514 1260206279
1 f none include/apr-1/apr_uuid.h 0644 bin bin 2102 40269 1260206282
1 f none include/apr-1/apr_version.h 0644 bin bin 5239 30300 1260206280
1 f none include/apr-1/apr_want.h 0644 bin bin 3037 32157 1260206280
1 f none include/apr-1/apr_xlate.h 0644 bin bin 6408 789 1260206282
1 f none include/apr-1/apr_xml.h 0644 bin bin 12357 61173 1260206282
1 f none include/apr-1/apu.h 0644 bin bin 3560 23889 1260206282
1 f none include/apr-1/apu_version.h 0644 bin bin 4126 11796 1260206282
1 f none include/apr-1/apu_want.h 0644 bin bin 1491 50424 1260206282
1 d none lib ? ? ?
1 d none lib/amd64 ? ? ?
1 s none lib/amd64/libapr-1.so=libapr-1.so.0.3.9
1 s none lib/amd64/libapr-1.so.0=libapr-1.so.0.3.9
1 f none lib/amd64/libapr-1.so.0.3.9 0755 bin bin 566568 44383 1260206283
1 s none lib/amd64/libaprutil-1.so=libaprutil-1.so.0.3.9
1 s none lib/amd64/libaprutil-1.so.0=libaprutil-1.so.0.3.9
1 f none lib/amd64/libaprutil-1.so.0.3.9 0755 bin bin 350776 4509 1260206283
1 f none lib/apr-1.exp 0644 bin bin 8130 29934 1260206280
1 d none lib/apr-util-1 ? ? ?
1 f none lib/apr-util-1/apr_dbm_db-1.so 0755 bin bin 14160 19698 1260206280
1 s none lib/apr-util-1/apr_dbm_db.so=apr_dbm_db-1.so
1 f none lib/apr-util-1/apr_ldap-1.so 0755 bin bin 24960 26826 1260206280
1 s none lib/apr-util-1/apr_ldap.so=apr_ldap-1.so
1 f none lib/aprutil-1.exp 0644 bin bin 5442 19740 1260206283
1 d none lib/pkgconfig ? ? ?
1 f rename lib/pkgconfig/apr-1.pc 0644 bin bin 405 34447 1260206283
1 f rename lib/pkgconfig/apr-util-1.pc 0644 bin bin 406 35586 1260206283
1 i pkginfo 900 14408 1260206283
1 i postinstall 541 41457 1260206283
1 i postremove 571 42011 1260206283
1 d none share ? ? ?
1 d none share/apr 0755 bin bin
1 d none share/apr/build-1 0755 bin bin
1 f rename share/apr/build-1/apr_rules.mk 0644 bin bin 6319 37712 1260206283
1 f none share/apr/build-1/make_exports.awk 0644 bin bin 2991 16339 1260206280
1 f none share/apr/build-1/make_var_export.awk 0644 bin bin 1023 8586 1260206280
0707010001f158000041ed000017820000044e000000024b1d38cf000000000000022d0000016a00000000000000000000000800000000install 0707010001f15a000081a4000017820000044e0000000145b3c4af000001390000022d0000016a00000000000000000000001100000000install/i.rename # substitute the build path with the install path
while read src dst
do
sed -e "s#@CLIENT_BASEDIR@#$CLIENT_BASEDIR#g" $src > $dst || exit 2
# removef $PKGINST $dst
# installf -c rename $PKGINST $dst
done
#if [ "$1" = ENDOFCLASS ]; then
# removef -f -c rename $PKGINST
# installf -f -c rename $PKGINST
#fi
exit 0
0707010001f1ac000081a4000017820000044e000000014b1d38cb0000021d0000022d0000016a00000000000000000000001400000000install/postinstall
if [ "$CLIENT_BASEDIR" = "/usr" ]; then
exit 0
fi
echo " "
echo "You may add the following library[s] to the default library search path"
echo "of your system using the crle tool, so that other applications are able"
echo "to find the installed libraries automatically:"
echo " "
LP=""
for l in lib; do
if [ -n "$l" ]; then
if [ -z "$LP" ]; then
LP="$CLIENT_BASEDIR/$l"
else
LP="${LP}:$CLIENT_BASEDIR/$l"
fi
fi
done
echo " $LP"
echo " "
echo "E.g.:"
echo " crle -c /var/ld/ld.config -l /usr/lib:$LP"
echo " "
exit 0
0707010001f1ad000081a4000017820000044e000000014b1d38cb0000023b0000022d0000016a00000000000000000000001300000000install/postremove
if [ "$CLIENT_BASEDIR" = "/usr" -o "$CLIENT_BASEDIR" = "/usr/local" ]; then
exit 0
fi
LIBS=""
for l in lib ; do
_TMP=`crle | awk '/Default Library Path/ { print ":" $5 ":" }' \
| egrep ":$CLIENT_BASEDIR/$l"`
if [ -n "$_TMP" ]; then
LIBS="$LIBS \n$_TMP"
fi
done
if [ -n "$LIBS" ]; then
echo " "
echo "NOTE: The following library path[s] are still listed in the systems"
echo " default library search path (You may remove it using the crle"
echo " tool in if they are not required anymore):"
echo " "
echo "$LIBS"
echo " "
fi
exit 0
0707010001f159000081a4000017820000044e0000000148d06db9000000a70000022d0000016a00000000000000000000000f00000000install/depend P SUNWcslr Core Solaris Libraries (Root)
P SUNWcsl Core Solaris, (Shared Libs)
P SUNWlexpt libexpat - XML parser library
P LNFdb4 Berkeley DB 4
#P SUNWsqlite3 SQLite3
0707010001f154000041ed000017820000044e000000064b1d38cf000000000000022d0000016a00000000000000000000000600000000reloc 0707010001f15b000041ed000017820000044e000000034b1d38cd000000000000022d0000016a00000000000000000000000e00000000reloc/include 0707010001f15c000041ed000017820000044e000000024b1d38ce000000000000022d0000016a00000000000000000000001400000000reloc/include/apr-1 0707010001f17a000081a4000017820000044e000000014b1d38c9000042b00000022d0000016a00000000000000000000002300000000reloc/include/apr-1/apr_memcache.h /* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef APR_MEMCACHE_H
#define APR_MEMCACHE_H
/**
* @file apr_memcache.h
* @brief Client interface for memcached
* @remark To use this interface you must have a separate memcached
* server running. See the memcached website at http://www.danga.com/memcached/
* for more information.
*/
#include "apr.h"
#include "apr_pools.h"
#include "apr_time.h"
#include "apr_strings.h"
#include "apr_network_io.h"
#include "apr_ring.h"
#include "apr_buckets.h"
#include "apr_reslist.h"
#include "apr_hash.h"
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/**
* @defgroup APR_Util_MC Memcached Client Routines
* @ingroup APR_Util
* @{
*/
/** Specifies the status of a memcached server */
typedef enum
{
APR_MC_SERVER_LIVE, /**< Server is alive and responding to requests */
APR_MC_SERVER_DEAD /**< Server is not responding to requests */
} apr_memcache_server_status_t;
/** Opaque memcache client connection object */
typedef struct apr_memcache_conn_t apr_memcache_conn_t;
/** Memcache Server Info Object */
typedef struct apr_memcache_server_t apr_memcache_server_t;
struct apr_memcache_server_t
{
const char *host; /**< Hostname of this Server */
apr_port_t port; /**< Port of this Server */
apr_memcache_server_status_t status; /**< @see apr_memcache_server_status_t */
#if APR_HAS_THREADS || defined(DOXYGEN)
apr_reslist_t *conns; /**< Resource list of actual client connections */
#else
apr_memcache_conn_t *conn;
#endif
apr_pool_t *p; /** Pool to use for private allocations */
#if APR_HAS_THREADS
apr_thread_mutex_t *lock;
#endif
apr_time_t btime;
};
/* Custom hash callback function prototype, user for server selection.
* @param baton user selected baton
* @param data data to hash
* @param data_len length of data
*/
typedef apr_uint32_t (*apr_memcache_hash_func)(void *baton,
const char *data,
const apr_size_t data_len);
typedef struct apr_memcache_t apr_memcache_t;
/* Custom Server Select callback function prototype.
* @param baton user selected baton
* @param mc memcache instance, use mc->live_servers to select a node
* @param hash hash of the selected key.
*/
typedef apr_memcache_server_t* (*apr_memcache_server_func)(void *baton,
apr_memcache_t *mc,
const apr_uint32_t hash);
/** Container for a set of memcached servers */
struct apr_memcache_t
{
apr_uint32_t flags; /**< Flags, Not currently used */
apr_uint16_t nalloc; /**< Number of Servers Allocated */
apr_uint16_t ntotal; /**< Number of Servers Added */
apr_memcache_server_t **live_servers; /**< Array of Servers */
apr_pool_t *p; /** Pool to use for allocations */
void *hash_baton;
apr_memcache_hash_func hash_func;
void *server_baton;
apr_memcache_server_func server_func;
};
/** Returned Data from a multiple get */
typedef struct
{
apr_status_t status;
const char* key;
apr_size_t len;
char *data;
apr_uint16_t flags;
} apr_memcache_value_t;
/**
* Creates a crc32 hash used to split keys between servers
* @param data Data to be hashed
* @param data_len Length of the data to use
* @return crc32 hash of data
* @remark The crc32 hash is not compatible with old memcached clients.
*/
APU_DECLARE(apr_uint32_t) apr_memcache_hash(apr_memcache_t *mc,
const char *data,
const apr_size_t data_len);
/**
* Pure CRC32 Hash. Used by some clients.
*/
APU_DECLARE(apr_uint32_t) apr_memcache_hash_crc32(void *baton,
const char *data,
const apr_size_t data_len);
/**
* hash compatible with the standard Perl Client.
*/
APU_DECLARE(apr_uint32_t) apr_memcache_hash_default(void *baton,
const char *data,
const apr_size_t data_len);
/**
* Picks a server based on a hash
* @param mc The memcache client object to use
* @param hash Hashed value of a Key
* @return server that controls specified hash
* @see apr_memcache_hash
*/
APU_DECLARE(apr_memcache_server_t *) apr_memcache_find_server_hash(apr_memcache_t *mc,
const apr_uint32_t hash);
/**
* server selection compatible with the standard Perl Client.
*/
APU_DECLARE(apr_memcache_server_t *)
apr_memcache_find_server_hash_default(void *baton,
apr_memcache_t *mc,
const apr_uint32_t hash);
/**
* Adds a server to a client object
* @param mc The memcache client object to use
* @param ms Server to add
* @remark Adding servers is not thread safe, and should be done once at startup.
* @warning Changing servers after startup may cause keys to go to
* different servers.
*/
APU_DECLARE(apr_status_t) apr_memcache_add_server(apr_memcache_t *mc,
apr_memcache_server_t *server);
/**
* Finds a Server object based on a hostname/port pair
* @param mc The memcache client object to use
* @param host Hostname of the server
* @param port Port of the server
* @return Server with matching Hostname and Port, or NULL if none was found.
*/
APU_DECLARE(apr_memcache_server_t *) apr_memcache_find_server(apr_memcache_t *mc,
const char *host,
apr_port_t port);
/**
* Enables a Server for use again
* @param mc The memcache client object to use
* @param ms Server to Activate
*/
APU_DECLARE(apr_status_t) apr_memcache_enable_server(apr_memcache_t *mc,
apr_memcache_server_t *ms);
/**
* Disable a Server
* @param mc The memcache client object to use
* @param ms Server to Disable
*/
APU_DECLARE(apr_status_t) apr_memcache_disable_server(apr_memcache_t *mc,
apr_memcache_server_t *ms);
/**
* Creates a new Server Object
* @param p Pool to use
* @param host hostname of the server
* @param port port of the server
* @param min minimum number of client sockets to open
* @param smax soft maximum number of client connections to open
* @param max hard maximum number of client connections
* @param ttl time to live in microseconds of a client connection
* @param ns location of the new server object
* @see apr_reslist_create
* @remark min, smax, and max are only used when APR_HAS_THREADS
*/
APU_DECLARE(apr_status_t) apr_memcache_server_create(apr_pool_t *p,
const char *host,
apr_port_t port,
apr_uint32_t min,
apr_uint32_t smax,
apr_uint32_t max,
apr_uint32_t ttl,
apr_memcache_server_t **ns);
/**
* Creates a new memcached client object
* @param p Pool to use
* @param max_servers maximum number of servers
* @param flags Not currently used
* @param mc location of the new memcache client object
*/
APU_DECLARE(apr_status_t) apr_memcache_create(apr_pool_t *p,
apr_uint16_t max_servers,
apr_uint32_t flags,
apr_memcache_t **mc);
/**
* Gets a value from the server, allocating the value out of p
* @param mc client to use
* @param p Pool to use
* @param key null terminated string containing the key
* @param baton location of the allocated value
* @param len length of data at baton
* @param flags any flags set by the client for this key
* @return
*/
APU_DECLARE(apr_status_t) apr_memcache_getp(apr_memcache_t *mc,
apr_pool_t *p,
const char* key,
char **baton,
apr_size_t *len,
apr_uint16_t *flags);
/**
* Add a key to a hash for a multiget query
* if the hash (*value) is NULL it will be created
* @param data_pool pool from where the hash and their items are created from
* @param key null terminated string containing the key
* @param values hash of keys and values that this key will be added to
* @return
*/
APU_DECLARE(void) apr_memcache_add_multget_key(apr_pool_t *data_pool,
const char* key,
apr_hash_t **values);
/**
* Gets multiple values from the server, allocating the values out of p
* @param mc client to use
* @param temp_pool Pool used for tempoary allocations. May be cleared inside this
* call.
* @param data_pool Pool used to allocate data for the returned values.
* @param values hash of apr_memcache_value_t keyed by strings, contains the
* result of the multiget call.
* @return
*/
APU_DECLARE(apr_status_t) apr_memcache_multgetp(apr_memcache_t *mc,
apr_pool_t *temp_pool,
apr_pool_t *data_pool,
apr_hash_t *values);
/**
* Sets a value by key on the server
* @param mc client to use
* @param key null terminated string containing the key
* @param baton data to store on the server
* @param len length of data at baton
* @param timeout time in seconds for the data to live on the server
* @param flags any flags set by the client for this key
*/
APU_DECLARE(apr_status_t) apr_memcache_set(apr_memcache_t *mc,
const char *key,
char *baton,
const apr_size_t data_size,
apr_uint32_t timeout,
apr_uint16_t flags);
/**
* Adds value by key on the server
* @param mc client to use
* @param key null terminated string containing the key
* @param baton data to store on the server
* @param len length of data at baton
* @param timeout time for the data to live on the server
* @param flags any flags set by the client for this key
* @return APR_SUCCESS if the key was added, APR_EEXIST if the key
* already exists on the server.
*/
APU_DECLARE(apr_status_t) apr_memcache_add(apr_memcache_t *mc,
const char *key,
char *baton,
const apr_size_t data_size,
apr_uint32_t timeout,
apr_uint16_t flags);
/**
* Replaces value by key on the server
* @param mc client to use
* @param key null terminated string containing the key
* @param baton data to store on the server
* @param len length of data at baton
* @param timeout time for the data to live on the server
* @param flags any flags set by the client for this key
* @return APR_SUCCESS if the key was added, APR_EEXIST if the key
* did not exist on the server.
*/
APU_DECLARE(apr_status_t) apr_memcache_replace(apr_memcache_t *mc,
const char *key,
char *data,
const apr_size_t data_size,
apr_uint32_t timeout,
apr_uint16_t flags);
/**
* Deletes a key from a server
* @param mc client to use
* @param key null terminated string containing the key
* @param timeout time for the delete to stop other clients from adding
*/
APU_DECLARE(apr_status_t) apr_memcache_delete(apr_memcache_t *mc,
const char *key,
apr_uint32_t timeout);
/**
* Increments a value
* @param mc client to use
* @param key null terminated string containing the key
* @param n number to increment by
* @param nv new value after incrmenting
*/
APU_DECLARE(apr_status_t) apr_memcache_incr(apr_memcache_t *mc,
const char *key,
apr_int32_t n,
apr_uint32_t *nv);
/**
* Decrements a value
* @param mc client to use
* @param key null terminated string containing the key
* @param n number to decrement by
* @param nv new value after decrementing
*/
APU_DECLARE(apr_status_t) apr_memcache_decr(apr_memcache_t *mc,
const char *key,
apr_int32_t n,
apr_uint32_t *new_value);
/**
* Query a server's version
* @param ms server to query
* @param p Pool to allocate answer from
* @param baton location to store server version string
* @param len length of the server version string
*/
APU_DECLARE(apr_status_t) apr_memcache_version(apr_memcache_server_t *ms,
apr_pool_t *p,
char **baton);
typedef struct
{
/** Version string of this server */
const char *version;
/** Process id of this server process */
apr_uint32_t pid;
/** Number of seconds this server has been running */
apr_uint32_t uptime;
/** current UNIX time according to the server */
apr_time_t time;
/** The size of a pointer on the current machine */
apr_uint32_t pointer_size;
/** Accumulated user time for this process */
apr_time_t rusage_user;
/** Accumulated system time for this process */
apr_time_t rusage_system;
/** Current number of items stored by the server */
apr_uint32_t curr_items;
/** Total number of items stored by this server */
apr_uint32_t total_items;
/** Current number of bytes used by this server to store items */
apr_uint64_t bytes;
/** Number of open connections */
apr_uint32_t curr_connections;
/** Total number of connections opened since the server started running */
apr_uint32_t total_connections;
/** Number of connection structures allocated by the server */
apr_uint32_t connection_structures;
/** Cumulative number of retrieval requests */
apr_uint32_t cmd_get;
/** Cumulative number of storage requests */
apr_uint32_t cmd_set;
/** Number of keys that have been requested and found present */
apr_uint32_t get_hits;
/** Number of items that have been requested and not found */
apr_uint32_t get_misses;
/** Number of items removed from cache because they passed their
expiration time */
apr_uint64_t evictions;
/** Total number of bytes read by this server */
apr_uint64_t bytes_read;
/** Total number of bytes sent by this server */
apr_uint64_t bytes_written;
/** Number of bytes this server is allowed to use for storage. */
apr_uint32_t limit_maxbytes;
/** Number of threads the server is running (if built with threading) */
apr_uint32_t threads;
} apr_memcache_stats_t;
/**
* Query a server for statistics
* @param ms server to query
* @param p Pool to allocate answer from
* @param stats location of the new statistics structure
*/
APU_DECLARE(apr_status_t) apr_memcache_stats(apr_memcache_server_t *ms,
apr_pool_t *p,
apr_memcache_stats_t **stats);
/** @} */
#ifdef __cplusplus
}
#endif
#endif /* APR_MEMCACHE_H */
0707010001f170000081a4000017820000044e000000014b1d38c9000021890000022d0000016a00000000000000000000002000000000reloc/include/apr-1/apr_hooks.h /* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef APR_HOOKS_H
#define APR_HOOKS_H
#include "apu.h"
/* For apr_array_header_t */
#include "apr_tables.h"
/**
* @file apr_hooks.h
* @brief Apache hook functions
*/
#ifdef __cplusplus
extern "C" {
#endif
/**
* @defgroup APR_Util_Hook Hook Functions
* @ingroup APR_Util
* @{
*/
/** macro to return the prototype of the hook function */
#define APR_IMPLEMENT_HOOK_GET_PROTO(ns,link,name) \
link##_DECLARE(apr_array_header_t *) ns##_hook_get_##name(void)
/** macro to declare the hook correctly */
#define APR_DECLARE_EXTERNAL_HOOK(ns,link,ret,name,args) \
typedef ret ns##_HOOK_##name##_t args; \
link##_DECLARE(void) ns##_hook_##name(ns##_HOOK_##name##_t *pf, \
const char * const *aszPre, \
const char * const *aszSucc, int nOrder); \
link##_DECLARE(ret) ns##_run_##name args; \
APR_IMPLEMENT_HOOK_GET_PROTO(ns,link,name); \
typedef struct ns##_LINK_##name##_t \
{ \
ns##_HOOK_##name##_t *pFunc; \
const char *szName; \
const char * const *aszPredecessors; \
const char * const *aszSuccessors; \
int nOrder; \
} ns##_LINK_##name##_t;
/** macro to declare the hook structure */
#define APR_HOOK_STRUCT(members) \
static struct { members } _hooks;
/** macro to link the hook structure */
#define APR_HOOK_LINK(name) \
apr_array_header_t *link_##name;
/** macro to implement the hook */
#define APR_IMPLEMENT_EXTERNAL_HOOK_BASE(ns,link,name) \
link##_DECLARE(void) ns##_hook_##name(ns##_HOOK_##name##_t *pf,const char * const *aszPre, \
const char * const *aszSucc,int nOrder) \
{ \
ns##_LINK_##name##_t *pHook; \
if(!_hooks.link_##name) \
{ \
_hooks.link_##name=apr_array_make(apr_hook_global_pool,1,sizeof(ns##_LINK_##name##_t)); \
apr_hook_sort_register(#name,&_hooks.link_##name); \
} \
pHook=apr_array_push(_hooks.link_##name); \
pHook->pFunc=pf; \
pHook->aszPredecessors=aszPre; \
pHook->aszSuccessors=aszSucc; \
pHook->nOrder=nOrder; \
pHook->szName=apr_hook_debug_current; \
if(apr_hook_debug_enabled) \
apr_hook_debug_show(#name,aszPre,aszSucc); \
} \
APR_IMPLEMENT_HOOK_GET_PROTO(ns,link,name) \
{ \
return _hooks.link_##name; \
}
/**
* Implement a hook that has no return code, and therefore runs all of the
* registered functions
* @param ns The namespace prefix of the hook functions
* @param link The linkage declaration prefix of the hook
* @param name The name of the hook
* @param args_decl The declaration of the arguments for the hook
* @param args_use The names for the arguments for the hook
* @note The link prefix FOO corresponds to FOO_DECLARE() macros, which
* provide export linkage from the module that IMPLEMENTs the hook, and
* import linkage from external modules that link to the hook's module.
*/
#define APR_IMPLEMENT_EXTERNAL_HOOK_VOID(ns,link,name,args_decl,args_use) \
APR_IMPLEMENT_EXTERNAL_HOOK_BASE(ns,link,name) \
link##_DECLARE(void) ns##_run_##name args_decl \
{ \
ns##_LINK_##name##_t *pHook; \
int n; \
\
if(!_hooks.link_##name) \
return; \
\
pHook=(ns##_LINK_##name##_t *)_hooks.link_##name->elts; \
for(n=0 ; n < _hooks.link_##name->nelts ; ++n) \
pHook[n].pFunc args_use; \
}
/* FIXME: note that this returns ok when nothing is run. I suspect it should
really return decline, but that breaks Apache currently - Ben
*/
/**
* Implement a hook that runs until one of the functions returns something
* other than OK or DECLINE
* @param ns The namespace prefix of the hook functions
* @param link The linkage declaration prefix of the hook
* @param ret Type to return
* @param name The name of the hook
* @param args_decl The declaration of the arguments for the hook
* @param args_use The names for the arguments for the hook
* @param ok Success value
* @param decline Decline value
* @note The link prefix FOO corresponds to FOO_DECLARE() macros, which
* provide export linkage from the module that IMPLEMENTs the hook, and
* import linkage from external modules that link to the hook's module.
*/
#define APR_IMPLEMENT_EXTERNAL_HOOK_RUN_ALL(ns,link,ret,name,args_decl,args_use,ok,decline) \
APR_IMPLEMENT_EXTERNAL_HOOK_BASE(ns,link,name) \
link##_DECLARE(ret) ns##_run_##name args_decl \
{ \
ns##_LINK_##name##_t *pHook; \
int n; \
ret rv; \
\
if(!_hooks.link_##name) \
return ok; \
\
pHook=(ns##_LINK_##name##_t *)_hooks.link_##name->elts; \
for(n=0 ; n < _hooks.link_##name->nelts ; ++n) \
{ \
rv=pHook[n].pFunc args_use; \
\
if(rv != ok && rv != decline) \
return rv; \
} \
return ok; \
}
/**
* Implement a hook that runs until the first function returns something
* other than the value of decline
* @param ns The namespace prefix of the hook functions
* @param link The linkage declaration prefix of the hook
* @param name The name of the hook
* @param ret Type to return
* @param args_decl The declaration of the arguments for the hook
* @param args_use The names for the arguments for the hook
* @param decline Decline value
* @note The link prefix FOO corresponds to FOO_DECLARE() macros, which
* provide export linkage from the module that IMPLEMENTs the hook, and
* import linkage from external modules that link to the hook's module.
*/
#define APR_IMPLEMENT_EXTERNAL_HOOK_RUN_FIRST(ns,link,ret,name,args_decl,args_use,decline) \
APR_IMPLEMENT_EXTERNAL_HOOK_BASE(ns,link,name) \
link##_DECLARE(ret) ns##_run_##name args_decl \
{ \
ns##_LINK_##name##_t *pHook; \
int n; \
ret rv; \
\
if(!_hooks.link_##name) \
return decline; \
\
pHook=(ns##_LINK_##name##_t *)_hooks.link_##name->elts; \
for(n=0 ; n < _hooks.link_##name->nelts ; ++n) \
{ \
rv=pHook[n].pFunc args_use; \
\
if(rv != decline) \
return rv; \
} \
return decline; \
}
/* Hook orderings */
/** run this hook first, before ANYTHING */
#define APR_HOOK_REALLY_FIRST (-10)
/** run this hook first */
#define APR_HOOK_FIRST 0
/** run this hook somewhere */
#define APR_HOOK_MIDDLE 10
/** run this hook after every other hook which is defined*/
#define APR_HOOK_LAST 20
/** run this hook last, after EVERYTHING */
#define APR_HOOK_REALLY_LAST 30
/**
* The global pool used to allocate any memory needed by the hooks.
*/
APU_DECLARE_DATA extern apr_pool_t *apr_hook_global_pool;
/**
* A global variable to determine if debugging information about the
* hooks functions should be printed
*/
APU_DECLARE_DATA extern int apr_hook_debug_enabled;
/**
* The name of the module that is currently registering a function
*/
APU_DECLARE_DATA extern const char *apr_hook_debug_current;
/**
* Register a hook function to be sorted
* @param szHookName The name of the Hook the function is registered for
* @param aHooks The array which stores all of the functions for this hook
*/
APU_DECLARE(void) apr_hook_sort_register(const char *szHookName,
apr_array_header_t **aHooks);
/**
* Sort all of the registerd functions for a given hook
*/
APU_DECLARE(void) apr_hook_sort_all(void);
/**
* Print all of the information about the current hook. This is used for
* debugging purposes.
* @param szName The name of the hook
* @param aszPre All of the functions in the predecessor array
* @param aszSucc All of the functions in the successor array
*/
APU_DECLARE(void) apr_hook_debug_show(const char *szName,
const char * const *aszPre,
const char * const *aszSucc);
/**
* Remove all currently registered functions.
*/
APU_DECLARE(void) apr_hook_deregister_all(void);
/** @} */
#ifdef __cplusplus
}
#endif
#endif /* APR_HOOKS_H */
0707010001f16b000081a4000017820000044e000000014b1d38c7000017890000022d0000016a00000000000000000000002200000000reloc/include/apr-1/apr_fnmatch.h /*
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)fnmatch.h 8.1 (Berkeley) 6/2/93
*/
/* This file has been modified by the Apache Software Foundation. */
#ifndef _APR_FNMATCH_H_
#define _APR_FNMATCH_H_
/**
* @file apr_fnmatch.h
* @brief APR FNMatch Functions
*/
#include "apr_errno.h"
#include "apr_tables.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @defgroup apr_fnmatch Filename Matching Functions
* @ingroup APR
* @{
*/
#define APR_FNM_NOMATCH 1 /**< Match failed. */
#define APR_FNM_NOESCAPE 0x01 /**< Disable backslash escaping. */
#define APR_FNM_PATHNAME 0x02 /**< Slash must be matched by slash. */
#define APR_FNM_PERIOD 0x04 /**< Period must be matched by period. */
#define APR_FNM_CASE_BLIND 0x08 /**< Compare characters case-insensitively.
* @remark This flag is an Apache addition
*/
/**
* Try to match the string to the given pattern, return APR_SUCCESS if
* match, else return APR_FNM_NOMATCH. Note that there is no such thing as
* an illegal pattern.
*
* With all flags unset, a pattern is interpreted as such:
*
* PATTERN: Backslash followed by any character, including another
* backslash.
* MATCHES: That character exactly.
*
*
* PATTERN: ?
* MATCHES: Any single character.
*
* PATTERN: *
* MATCHES: Any sequence of zero or more characters. (Note that multiple
* *s in a row are equivalent to one.)
*
* PATTERN: Any character other than \?*[ or a \ at the end of the pattern
* MATCHES: That character exactly. (Case sensitive.)
*
* PATTERN: [ followed by a class description followed by ]
* MATCHES: A single character described by the class description.
* (Never matches, if the class description reaches until the
* end of the string without a ].) If the first character of
* the class description is ^ or !, the sense of the description
* is reversed. The rest of the class description is a list of
* single characters or pairs of characters separated by -. Any
* of those characters can have a backslash in front of them,
* which is ignored; this lets you use the characters ] and -
* in the character class, as well as ^ and ! at the
* beginning. The pattern matches a single character if it
* is one of the listed characters or falls into one of the
* listed ranges (inclusive, case sensitive). Ranges with
* the first character larger than the second are legal but
* never match. Edge cases: [] never matches, and [^] and [!]
* always match without consuming a character.
*
* Note that these patterns attempt to match the entire string, not
* just find a substring matching the pattern.
*
* @param pattern The pattern to match to
* @param strings The string we are trying to match
* @param flags flags to use in the match. Bitwise OR of:
*
* APR_FNM_NOESCAPE Disable backslash escaping * APR_FNM_PATHNAME Slash must be matched by slash * APR_FNM_PERIOD Period must be matched by period * APR_FNM_CASE_BLIND Compare characters case-insensitively. **/ APR_DECLARE(apr_status_t) apr_fnmatch(const char *pattern, const char *strings, int flags); /** * Determine if the given pattern is a regular expression. * @param pattern The pattern to search for glob characters. * @return non-zero if pattern has any glob characters in it */ APR_DECLARE(int) apr_fnmatch_test(const char *pattern); /** * Find all files that match a specified pattern. * @param pattern The pattern to use for finding files. * @param result Array to use when storing the results * @param p The pool to use. * @return non-zero if pattern has any glob characters in it */ APR_DECLARE(apr_status_t) apr_match_glob(const char *pattern, apr_array_header_t **result, apr_pool_t *p); /** @} */ #ifdef __cplusplus } #endif #endif /* !_APR_FNMATCH_H_ */ 0707010001f169000081a4000017820000044e000000014b1d38c7000044ef0000022d0000016a00000000000000000000002400000000reloc/include/apr-1/apr_file_info.h /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef APR_FILE_INFO_H #define APR_FILE_INFO_H /** * @file apr_file_info.h * @brief APR File Information */ #include "apr.h" #include "apr_user.h" #include "apr_pools.h" #include "apr_tables.h" #include "apr_time.h" #include "apr_errno.h" #if APR_HAVE_SYS_UIO_H #include
* APR_FILEPATH_NATIVE Use native path seperators (e.g. '\' on Win32) * APR_FILEPATH_TRUENAME Tests that the root exists, and makes it proper ** @param p the pool to allocate the new path string from * @remark on return, filepath points to the first non-root character in the * given filepath. In the simplest example, given a filepath of "/foo", * returns the rootpath of "/" and filepath points at "foo". This is far * more complex on other platforms, which will canonicalize the root form * to a consistant format, given the APR_FILEPATH_TRUENAME flag, and also * test for the validity of that root (e.g., that a drive d:/ or network * share //machine/foovol/). * The function returns APR_ERELATIVE if filepath isn't rooted (an * error), APR_EINCOMPLETE if the root path is ambigious (but potentially * legitimate, e.g. "/" on Windows is incomplete because it doesn't specify * the drive letter), or APR_EBADPATH if the root is simply invalid. * APR_SUCCESS is returned if filepath is an absolute path. */ APR_DECLARE(apr_status_t) apr_filepath_root(const char **rootpath, const char **filepath, apr_int32_t flags, apr_pool_t *p); /** * Merge additional file path onto the previously processed rootpath * @param newpath the merged paths returned * @param rootpath the root file path (NULL uses the current working path) * @param addpath the path to add to the root path * @param flags the desired APR_FILEPATH_ rules to apply when merging * @param p the pool to allocate the new path string from * @remark if the flag APR_FILEPATH_TRUENAME is given, and the addpath * contains wildcard characters ('*', '?') on platforms that don't support * such characters within filenames, the paths will be merged, but the * result code will be APR_EPATHWILD, and all further segments will not * reflect the true filenames including the wildcard and following segments. */ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, const char *rootpath, const char *addpath, apr_int32_t flags, apr_pool_t *p); /** * Split a search path into separate components * @param pathelts the returned components of the search path * @param liststr the search path (e.g., getenv("PATH")) * @param p the pool to allocate the array and path components from * @remark empty path componenta do not become part of @a pathelts. * @remark the path separator in @a liststr is system specific; * e.g., ':' on Unix, ';' on Windows, etc. */ APR_DECLARE(apr_status_t) apr_filepath_list_split(apr_array_header_t **pathelts, const char *liststr, apr_pool_t *p); /** * Merge a list of search path components into a single search path * @param liststr the returned search path; may be NULL if @a pathelts is empty * @param pathelts the components of the search path * @param p the pool to allocate the search path from * @remark emtpy strings in the source array are ignored. * @remark the path separator in @a liststr is system specific; * e.g., ':' on Unix, ';' on Windows, etc. */ APR_DECLARE(apr_status_t) apr_filepath_list_merge(char **liststr, apr_array_header_t *pathelts, apr_pool_t *p); /** * Return the default file path (for relative file names) * @param path the default path string returned * @param flags optional flag APR_FILEPATH_NATIVE to retrieve the * default file path in os-native format. * @param p the pool to allocate the default path string from */ APR_DECLARE(apr_status_t) apr_filepath_get(char **path, apr_int32_t flags, apr_pool_t *p); /** * Set the default file path (for relative file names) * @param path the default path returned * @param p the pool to allocate any working storage */ APR_DECLARE(apr_status_t) apr_filepath_set(const char *path, apr_pool_t *p); /** The FilePath character encoding is unknown */ #define APR_FILEPATH_ENCODING_UNKNOWN 0 /** The FilePath character encoding is locale-dependent */ #define APR_FILEPATH_ENCODING_LOCALE 1 /** The FilePath character encoding is UTF-8 */ #define APR_FILEPATH_ENCODING_UTF8 2 /** * Determine the encoding used internally by the FilePath functions * @param style points to a variable which receives the encoding style flag * @param p the pool to allocate any working storage * @remark Use @c apr_os_locale_encoding and/or @c apr_os_default_encoding * to get the name of the path encoding if it's not UTF-8. */ APR_DECLARE(apr_status_t) apr_filepath_encoding(int *style, apr_pool_t *p); /** @} */ /** @} */ #ifdef __cplusplus } #endif #endif /* ! APR_FILE_INFO_H */ 0707010001f18a000081a4000017820000044e000000014b1d38c7000015480000022d0000016a00000000000000000000001e00000000reloc/include/apr-1/apr_shm.h /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef APR_SHM_H #define APR_SHM_H /** * @file apr_shm.h * @brief APR Shared Memory Routines */ #include "apr.h" #include "apr_pools.h" #include "apr_errno.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** * @defgroup apr_shm Shared Memory Routines * @ingroup APR * @{ */ /** * Private, platform-specific data struture representing a shared memory * segment. */ typedef struct apr_shm_t apr_shm_t; /** * Create and make accessable a shared memory segment. * @param m The shared memory structure to create. * @param reqsize The desired size of the segment. * @param filename The file to use for shared memory on platforms that * require it. * @param pool the pool from which to allocate the shared memory * structure. * @remark A note about Anonymous vs. Named shared memory segments: * Not all plaforms support anonymous shared memory segments, but in * some cases it is prefered over other types of shared memory * implementations. Passing a NULL 'file' parameter to this function * will cause the subsystem to use anonymous shared memory segments. * If such a system is not available, APR_ENOTIMPL is returned. * @remark A note about allocation sizes: * On some platforms it is necessary to store some metainformation * about the segment within the actual segment. In order to supply * the caller with the requested size it may be necessary for the * implementation to request a slightly greater segment length * from the subsystem. In all cases, the apr_shm_baseaddr_get() * function will return the first usable byte of memory. * */ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, apr_size_t reqsize, const char *filename, apr_pool_t *pool); /** * Remove named resource associated with a shared memory segment, * preventing attachments to the resource, but not destroying it. * @param filename The filename associated with shared-memory segment which * needs to be removed * @param pool The pool used for file operations * @remark This function is only supported on platforms which support * name-based shared memory segments, and will return APR_ENOTIMPL on * platforms without such support. Removing the file while the shm * is in use is not entirely portable, caller may use this to enhance * obscurity of the resource, but be prepared for the the call to fail, * and for concurrent attempts to create a resource of the same name * to also fail. The pool cleanup of apr_shm_create (apr_shm_destroy) * also removes the named resource. */ APR_DECLARE(apr_status_t) apr_shm_remove(const char *filename, apr_pool_t *pool); /** * Destroy a shared memory segment and associated memory. * @param m The shared memory segment structure to destroy. */ APR_DECLARE(apr_status_t) apr_shm_destroy(apr_shm_t *m); /** * Attach to a shared memory segment that was created * by another process. * @param m The shared memory structure to create. * @param filename The file used to create the original segment. * (This MUST match the original filename.) * @param pool the pool from which to allocate the shared memory * structure for this process. */ APR_DECLARE(apr_status_t) apr_shm_attach(apr_shm_t **m, const char *filename, apr_pool_t *pool); /** * Detach from a shared memory segment without destroying it. * @param m The shared memory structure representing the segment * to detach from. */ APR_DECLARE(apr_status_t) apr_shm_detach(apr_shm_t *m); /** * Retrieve the base address of the shared memory segment. * NOTE: This address is only usable within the callers address * space, since this API does not guarantee that other attaching * processes will maintain the same address mapping. * @param m The shared memory segment from which to retrieve * the base address. * @return address, aligned by APR_ALIGN_DEFAULT. */ APR_DECLARE(void *) apr_shm_baseaddr_get(const apr_shm_t *m); /** * Retrieve the length of a shared memory segment in bytes. * @param m The shared memory segment from which to retrieve * the segment length. */ APR_DECLARE(apr_size_t) apr_shm_size_get(const apr_shm_t *m); /** * Get the pool used by this shared memory segment. */ APR_POOL_DECLARE_ACCESSOR(shm); /** @} */ #ifdef __cplusplus } #endif #endif /* APR_SHM_T */ 0707010001f18e000081a4000017820000044e000000014b1d38c7000006620000022d0000016a00000000000000000000002200000000reloc/include/apr-1/apr_support.h /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef APR_SUPPORT_H #define APR_SUPPORT_H /** * @file apr_support.h * @brief APR Support functions */ #include "apr.h" #include "apr_network_io.h" #include "apr_file_io.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** * @defgroup apr_support Internal APR support functions * @ingroup APR * @{ */ /** * Wait for IO to occur or timeout. * * @param f The file to wait on. * @param s The socket to wait on if @a f is @c NULL. * @param for_read If non-zero wait for data to be available to read, * otherwise wait for data to be able to be written. * @return APR_TIMEUP if we run out of time. */ apr_status_t apr_wait_for_io_or_timeout(apr_file_t *f, apr_socket_t *s, int for_read); /** @} */ #ifdef __cplusplus } #endif #endif /* ! APR_SUPPORT_H */ 0707010001f192000081a4000017820000044e000000014b1d38ca00002b600000022d0000016a00000000000000000000002600000000reloc/include/apr-1/apr_thread_pool.h /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or * implied. See the License for the specific language governing * permissions and limitations under the License. */ #ifndef APU_THREAD_POOL_H #define APU_THREAD_POOL_H #include "apu.h" #include "apr_thread_proc.h" /** * @file apr_thread_pool.h * @brief APR Thread Pool Library * @remarks This library implements a thread pool using apr_thread_t. A thread * pool is a set of threads that can be created in advance or on demand until a * maximum number. When a task is scheduled, the thread pool will find an idle * thread to handle the task. In case all existing threads are busy and the * number of tasks in the queue is higher than the adjustable threshold, the * pool will try to create a new thread to serve the task if the maximum number * has not been reached. Otherwise, the task will be put into a queue based on * priority, which can be valued from 0 to 255, with higher values being served * first. If there are tasks with the same priority, the new task might be put at * the top or at the bottom - it depends on which function is used to put the task. * * @remarks There may be the case where the thread pool can use up to the maximum * number of threads at peak load, but having those threads idle afterwards. A * maximum number of idle threads can be set so that the extra idling threads will * be terminated to save system resources. */ #if APR_HAS_THREADS #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** * @defgroup APR_Util_TP Thread Pool routines * @ingroup APR_Util * @{ */ /** Opaque Thread Pool structure. */ typedef struct apr_thread_pool apr_thread_pool_t; #define APR_THREAD_TASK_PRIORITY_LOWEST 0 #define APR_THREAD_TASK_PRIORITY_LOW 63 #define APR_THREAD_TASK_PRIORITY_NORMAL 127 #define APR_THREAD_TASK_PRIORITY_HIGH 191 #define APR_THREAD_TASK_PRIORITY_HIGHEST 255 /** * Create a thread pool * @param me The pointer in which to return the newly created apr_thread_pool * object, or NULL if thread pool creation fails. * @param init_threads The number of threads to be created initially, this number * will also be used as the initial value for the maximum number of idle threads. * @param max_threads The maximum number of threads that can be created * @param pool The pool to use * @return APR_SUCCESS if the thread pool was created successfully. Otherwise, * the error code. */ APU_DECLARE(apr_status_t) apr_thread_pool_create(apr_thread_pool_t **me, apr_size_t init_threads, apr_size_t max_threads, apr_pool_t *pool); /** * Destroy the thread pool and stop all the threads * @return APR_SUCCESS if all threads are stopped. */ APU_DECLARE(apr_status_t) apr_thread_pool_destroy(apr_thread_pool_t *me); /** * Schedule a task to the bottom of the tasks of same priority. * @param me The thread pool * @param func The task function * @param param The parameter for the task function * @param priority The priority of the task. * @param owner Owner of this task. * @return APR_SUCCESS if the task had been scheduled successfully */ APU_DECLARE(apr_status_t) apr_thread_pool_push(apr_thread_pool_t *me, apr_thread_start_t func, void *param, apr_byte_t priority, void *owner); /** * Schedule a task to be run after a delay * @param me The thread pool * @param func The task function * @param param The parameter for the task function * @param time Time in microseconds * @param owner Owner of this task. * @return APR_SUCCESS if the task had been scheduled successfully */ APU_DECLARE(apr_status_t) apr_thread_pool_schedule(apr_thread_pool_t *me, apr_thread_start_t func, void *param, apr_interval_time_t time, void *owner); /** * Schedule a task to the top of the tasks of same priority. * @param me The thread pool * @param func The task function * @param param The parameter for the task function * @param priority The priority of the task. * @param owner Owner of this task. * @return APR_SUCCESS if the task had been scheduled successfully */ APU_DECLARE(apr_status_t) apr_thread_pool_top(apr_thread_pool_t *me, apr_thread_start_t func, void *param, apr_byte_t priority, void *owner); /** * Cancel tasks submitted by the owner. If there is any task from the owner that * is currently running, the function will spin until the task finished. * @param me The thread pool * @param owner Owner of the task * @return APR_SUCCESS if the task has been cancelled successfully * @note The task function should not be calling cancel, otherwise the function * may get stuck forever. The function assert if it detect such a case. */ APU_DECLARE(apr_status_t) apr_thread_pool_tasks_cancel(apr_thread_pool_t *me, void *owner); /** * Get the current number of tasks waiting in the queue * @param me The thread pool * @return Number of tasks in the queue */ APU_DECLARE(apr_size_t) apr_thread_pool_tasks_count(apr_thread_pool_t *me); /** * Get the current number of scheduled tasks waiting in the queue * @param me The thread pool * @return Number of scheduled tasks in the queue */ APU_DECLARE(apr_size_t) apr_thread_pool_scheduled_tasks_count(apr_thread_pool_t *me); /** * Get the current number of threads * @param me The thread pool * @return Total number of threads */ APU_DECLARE(apr_size_t) apr_thread_pool_threads_count(apr_thread_pool_t *me); /** * Get the current number of busy threads * @param me The thread pool * @return Number of busy threads */ APU_DECLARE(apr_size_t) apr_thread_pool_busy_count(apr_thread_pool_t *me); /** * Get the current number of idle threads * @param me The thread pool * @return Number of idle threads */ APU_DECLARE(apr_size_t) apr_thread_pool_idle_count(apr_thread_pool_t *me); /** * Access function for the maximum number of idle threads. Number of current * idle threads will be reduced to the new limit. * @param me The thread pool * @param cnt The number * @return The number of threads that were stopped. */ APU_DECLARE(apr_size_t) apr_thread_pool_idle_max_set(apr_thread_pool_t *me, apr_size_t cnt); /** * Get number of tasks that have run * @param me The thread pool * @return Number of tasks that have run */ APU_DECLARE(apr_size_t) apr_thread_pool_tasks_run_count(apr_thread_pool_t * me); /** * Get high water mark of the number of tasks waiting to run * @param me The thread pool * @return High water mark of tasks waiting to run */ APU_DECLARE(apr_size_t) apr_thread_pool_tasks_high_count(apr_thread_pool_t * me); /** * Get high water mark of the number of threads * @param me The thread pool * @return High water mark of threads in thread pool */ APU_DECLARE(apr_size_t) apr_thread_pool_threads_high_count(apr_thread_pool_t * me); /** * Get the number of idle threads that were destroyed after timing out * @param me The thread pool * @return Number of idle threads that timed out */ APU_DECLARE(apr_size_t) apr_thread_pool_threads_idle_timeout_count(apr_thread_pool_t * me); /** * Access function for the maximum number of idle threads * @param me The thread pool * @return The current maximum number */ APU_DECLARE(apr_size_t) apr_thread_pool_idle_max_get(apr_thread_pool_t *me); /** * Access function for the maximum number of threads. * @param me The thread pool * @param cnt Number of threads * @return The original maximum number of threads */ APU_DECLARE(apr_size_t) apr_thread_pool_thread_max_set(apr_thread_pool_t *me, apr_size_t cnt); /** * Access function for the maximum wait time (in microseconds) of an * idling thread that exceeds the maximum number of idling threads. * A non-zero value allows for the reaping of idling threads to shrink * over time. Which helps reduce thrashing. * @param me The thread pool * @param timeout The number of microseconds an idle thread should wait * till it reaps itself * @return The original maximum wait time */ APU_DECLARE(apr_interval_time_t) apr_thread_pool_idle_wait_set(apr_thread_pool_t * me, apr_interval_time_t timeout); /** * Access function for the maximum wait time (in microseconds) of an * idling thread that exceeds the maximum number of idling threads * @param me The thread pool * @return The current maximum wait time */ APU_DECLARE(apr_interval_time_t) apr_thread_pool_idle_wait_get(apr_thread_pool_t * me); /** * Access function for the maximum number of threads * @param me The thread pool * @return The current maximum number */ APU_DECLARE(apr_size_t) apr_thread_pool_thread_max_get(apr_thread_pool_t *me); /** * Access function for the threshold of tasks in queue to trigger a new thread. * @param me The thread pool * @param cnt The new threshold * @return The original threshold */ APU_DECLARE(apr_size_t) apr_thread_pool_threshold_set(apr_thread_pool_t *me, apr_size_t val); /** * Access function for the threshold of tasks in queue to trigger a new thread. * @param me The thread pool * @return The current threshold */ APU_DECLARE(apr_size_t) apr_thread_pool_threshold_get(apr_thread_pool_t * me); /** * Get owner of the task currently been executed by the thread. * @param thd The thread is executing a task * @param owner Pointer to receive owner of the task. * @return APR_SUCCESS if the owner is retrieved successfully */ APU_DECLARE(apr_status_t) apr_thread_pool_task_owner_get(apr_thread_t *thd, void **owner); /** @} */ #ifdef __cplusplus } #endif #endif /* APR_HAS_THREADS */ #endif /* !APR_THREAD_POOL_H */ 0707010001f196000081a4000017820000044e000000014b1d38ca000019bd0000022d0000016a00000000000000000000001e00000000reloc/include/apr-1/apr_uri.h /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * apr_uri.h: External Interface of apr_uri.c */ /** * @file apr_uri.h * @brief APR-UTIL URI Routines */ #ifndef APR_URI_H #define APR_URI_H #include "apu.h" #include "apr_network_io.h" #ifdef __cplusplus extern "C" { #endif /** * @defgroup APR_Util_URI URI * @ingroup APR_Util * @{ */ #define APR_URI_FTP_DEFAULT_PORT 21 /**< default FTP port */ #define APR_URI_SSH_DEFAULT_PORT 22 /**< default SSH port */ #define APR_URI_TELNET_DEFAULT_PORT 23 /**< default telnet port */ #define APR_URI_GOPHER_DEFAULT_PORT 70 /**< default Gopher port */ #define APR_URI_HTTP_DEFAULT_PORT 80 /**< default HTTP port */ #define APR_URI_POP_DEFAULT_PORT 110 /**< default POP port */ #define APR_URI_NNTP_DEFAULT_PORT 119 /**< default NNTP port */ #define APR_URI_IMAP_DEFAULT_PORT 143 /**< default IMAP port */ #define APR_URI_PROSPERO_DEFAULT_PORT 191 /**< default Prospero port */ #define APR_URI_WAIS_DEFAULT_PORT 210 /**< default WAIS port */ #define APR_URI_LDAP_DEFAULT_PORT 389 /**< default LDAP port */ #define APR_URI_HTTPS_DEFAULT_PORT 443 /**< default HTTPS port */ #define APR_URI_RTSP_DEFAULT_PORT 554 /**< default RTSP port */ #define APR_URI_SNEWS_DEFAULT_PORT 563 /**< default SNEWS port */ #define APR_URI_ACAP_DEFAULT_PORT 674 /**< default ACAP port */ #define APR_URI_NFS_DEFAULT_PORT 2049 /**< default NFS port */ #define APR_URI_TIP_DEFAULT_PORT 3372 /**< default TIP port */ #define APR_URI_SIP_DEFAULT_PORT 5060 /**< default SIP port */ /** Flags passed to unparse_uri_components(): */ /** suppress "scheme://user\@site:port" */ #define APR_URI_UNP_OMITSITEPART (1U<<0) /** Just omit user */ #define APR_URI_UNP_OMITUSER (1U<<1) /** Just omit password */ #define APR_URI_UNP_OMITPASSWORD (1U<<2) /** omit "user:password\@" part */ #define APR_URI_UNP_OMITUSERINFO (APR_URI_UNP_OMITUSER | \ APR_URI_UNP_OMITPASSWORD) /** Show plain text password (default: show XXXXXXXX) */ #define APR_URI_UNP_REVEALPASSWORD (1U<<3) /** Show "scheme://user\@site:port" only */ #define APR_URI_UNP_OMITPATHINFO (1U<<4) /** Omit the "?queryarg" from the path */ #define APR_URI_UNP_OMITQUERY (1U<<5) /** @see apr_uri_t */ typedef struct apr_uri_t apr_uri_t; /** * A structure to encompass all of the fields in a uri */ struct apr_uri_t { /** scheme ("http"/"ftp"/...) */ char *scheme; /** combined [user[:password]\@]host[:port] */ char *hostinfo; /** user name, as in http://user:passwd\@host:port/ */ char *user; /** password, as in http://user:passwd\@host:port/ */ char *password; /** hostname from URI (or from Host: header) */ char *hostname; /** port string (integer representation is in "port") */ char *port_str; /** the request path (or NULL if only scheme://host was given) */ char *path; /** Everything after a '?' in the path, if present */ char *query; /** Trailing "#fragment" string, if present */ char *fragment; /** structure returned from gethostbyname() */ struct hostent *hostent; /** The port number, numeric, valid only if port_str != NULL */ apr_port_t port; /** has the structure been initialized */ unsigned is_initialized:1; /** has the DNS been looked up yet */ unsigned dns_looked_up:1; /** has the dns been resolved yet */ unsigned dns_resolved:1; }; /* apr_uri.c */ /** * Return the default port for a given scheme. The schemes recognized are * http, ftp, https, gopher, wais, nntp, snews, and prospero * @param scheme_str The string that contains the current scheme * @return The default port for this scheme */ APU_DECLARE(apr_port_t) apr_uri_port_of_scheme(const char *scheme_str); /** * Unparse a apr_uri_t structure to an URI string. Optionally * suppress the password for security reasons. * @param p The pool to allocate out of * @param uptr All of the parts of the uri * @param flags How to unparse the uri. One of: *
* APR_URI_UNP_OMITSITEPART Suppress "scheme://user\@site:port" * APR_URI_UNP_OMITUSER Just omit user * APR_URI_UNP_OMITPASSWORD Just omit password * APR_URI_UNP_OMITUSERINFO Omit "user:password\@" part * APR_URI_UNP_REVEALPASSWORD Show plain text password (default: show XXXXXXXX) * APR_URI_UNP_OMITPATHINFO Show "scheme://user\@site:port" only * APR_URI_UNP_OMITQUERY Omit "?queryarg" or "#fragment" ** @return The uri as a string */ APU_DECLARE(char *) apr_uri_unparse(apr_pool_t *p, const apr_uri_t *uptr, unsigned flags); /** * Parse a given URI, fill in all supplied fields of a apr_uri_t * structure. This eliminates the necessity of extracting host, port, * path, query info repeatedly in the modules. * @param p The pool to allocate out of * @param uri The uri to parse * @param uptr The apr_uri_t to fill out * @return APR_SUCCESS for success or error code */ APU_DECLARE(apr_status_t) apr_uri_parse(apr_pool_t *p, const char *uri, apr_uri_t *uptr); /** * Special case for CONNECT parsing: it comes with the hostinfo part only * @param p The pool to allocate out of * @param hostinfo The hostinfo string to parse * @param uptr The apr_uri_t to fill out * @return APR_SUCCESS for success or error code */ APU_DECLARE(apr_status_t) apr_uri_parse_hostinfo(apr_pool_t *p, const char *hostinfo, apr_uri_t *uptr); /** @} */ #ifdef __cplusplus } #endif #endif /* APR_URI_H */ 0707010001f176000081a4000017820000044e000000014b1d38c900000ed70000022d0000016a00000000000000000000002300000000reloc/include/apr-1/apr_ldap_url.h /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * @file apr_ldap_url.h * @brief APR-UTIL LDAP ldap_init() functions */ #ifndef APR_LDAP_URL_H #define APR_LDAP_URL_H /** * @addtogroup APR_Util_LDAP * @{ */ #if defined(DOXYGEN) #include "apr_ldap.h" #endif #if APR_HAS_LDAP #include "apu.h" #include "apr_pools.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** Structure to access an exploded LDAP URL */ typedef struct apr_ldap_url_desc_t { struct apr_ldap_url_desc_t *lud_next; char *lud_scheme; char *lud_host; int lud_port; char *lud_dn; char **lud_attrs; int lud_scope; char *lud_filter; char **lud_exts; int lud_crit_exts; } apr_ldap_url_desc_t; #ifndef APR_LDAP_URL_SUCCESS #define APR_LDAP_URL_SUCCESS 0x00 /* Success */ #define APR_LDAP_URL_ERR_MEM 0x01 /* can't allocate memory space */ #define APR_LDAP_URL_ERR_PARAM 0x02 /* parameter is bad */ #define APR_LDAP_URL_ERR_BADSCHEME 0x03 /* URL doesn't begin with "ldap[si]://" */ #define APR_LDAP_URL_ERR_BADENCLOSURE 0x04 /* URL is missing trailing ">" */ #define APR_LDAP_URL_ERR_BADURL 0x05 /* URL is bad */ #define APR_LDAP_URL_ERR_BADHOST 0x06 /* host port is bad */ #define APR_LDAP_URL_ERR_BADATTRS 0x07 /* bad (or missing) attributes */ #define APR_LDAP_URL_ERR_BADSCOPE 0x08 /* scope string is invalid (or missing) */ #define APR_LDAP_URL_ERR_BADFILTER 0x09 /* bad or missing filter */ #define APR_LDAP_URL_ERR_BADEXTS 0x0a /* bad or missing extensions */ #endif /** * Is this URL an ldap url? ldap:// * @param url The url to test */ APU_DECLARE(int) apr_ldap_is_ldap_url(const char *url); /** * Is this URL an SSL ldap url? ldaps:// * @param url The url to test */ APU_DECLARE(int) apr_ldap_is_ldaps_url(const char *url); /** * Is this URL an ldap socket url? ldapi:// * @param url The url to test */ APU_DECLARE(int) apr_ldap_is_ldapi_url(const char *url); /** * Parse an LDAP URL. * @param pool The pool to use * @param url_in The URL to parse * @param ludpp The structure to return the exploded URL * @param result_err The result structure of the operation */ APU_DECLARE(int) apr_ldap_url_parse_ext(apr_pool_t *pool, const char *url_in, apr_ldap_url_desc_t **ludpp, apr_ldap_err_t **result_err); /** * Parse an LDAP URL. * @param pool The pool to use * @param url_in The URL to parse * @param ludpp The structure to return the exploded URL * @param result_err The result structure of the operation */ APU_DECLARE(int) apr_ldap_url_parse(apr_pool_t *pool, const char *url_in, apr_ldap_url_desc_t **ludpp, apr_ldap_err_t **result_err); #ifdef __cplusplus } #endif #endif /* APR_HAS_LDAP */ /** @} */ #endif /* APR_LDAP_URL_H */ 0707010001f184000081a4000017820000044e000000014b1d38c7000013ac0000022d0000016a00000000000000000000002100000000reloc/include/apr-1/apr_random.h /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef APR_RANDOM_H #define APR_RANDOM_H /** * @file apr_random.h * @brief APR PRNG routines */ #include "apr_pools.h" #include "apr_thread_proc.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** * @defgroup apr_random PRNG Routines * @ingroup APR * @{ */ typedef struct apr_crypto_hash_t apr_crypto_hash_t; typedef void apr_crypto_hash_init_t(apr_crypto_hash_t *hash); typedef void apr_crypto_hash_add_t(apr_crypto_hash_t *hash, const void *data, apr_size_t bytes); typedef void apr_crypto_hash_finish_t(apr_crypto_hash_t *hash, unsigned char *result); /* FIXME: make this opaque */ struct apr_crypto_hash_t { apr_crypto_hash_init_t *init; apr_crypto_hash_add_t *add; apr_crypto_hash_finish_t *finish; apr_size_t size; void *data; }; /** * Allocate and initialize the SHA-256 context * @param p The pool to allocate from */ APR_DECLARE(apr_crypto_hash_t *) apr_crypto_sha256_new(apr_pool_t *p); /** Opaque PRNG structure. */ typedef struct apr_random_t apr_random_t; /** * Initialize a PRNG state * @param g The PRNG state * @param p The pool to allocate from * @param pool_hash Pool hash functions * @param key_hash Key hash functions * @param prng_hash PRNG hash functions */ APR_DECLARE(void) apr_random_init(apr_random_t *g, apr_pool_t *p, apr_crypto_hash_t *pool_hash, apr_crypto_hash_t *key_hash, apr_crypto_hash_t *prng_hash); /** * Allocate and initialize (apr_crypto_sha256_new) a new PRNG state. * @param p The pool to allocate from */ APR_DECLARE(apr_random_t *) apr_random_standard_new(apr_pool_t *p); /** * Mix the randomness pools. * @param g The PRNG state * @param entropy_ Entropy buffer * @param bytes Length of entropy_ in bytes */ APR_DECLARE(void) apr_random_add_entropy(apr_random_t *g, const void *entropy_, apr_size_t bytes); /** * Generate cryptographically insecure random bytes. * @param g The RNG state * @param random Buffer to fill with random bytes * @param bytes Length of buffer in bytes */ APR_DECLARE(apr_status_t) apr_random_insecure_bytes(apr_random_t *g, void *random, apr_size_t bytes); /** * Generate cryptographically secure random bytes. * @param g The RNG state * @param random Buffer to fill with random bytes * @param bytes Length of buffer in bytes */ APR_DECLARE(apr_status_t) apr_random_secure_bytes(apr_random_t *g, void *random, apr_size_t bytes); /** * Ensures that E bits of conditional entropy are mixed into the PRNG * before any further randomness is extracted. * @param g The RNG state */ APR_DECLARE(void) apr_random_barrier(apr_random_t *g); /** * Return APR_SUCCESS if the cryptographic PRNG has been seeded with * enough data, APR_ENOTENOUGHENTROPY otherwise. * @param r The RNG state */ APR_DECLARE(apr_status_t) apr_random_secure_ready(apr_random_t *r); /** * Return APR_SUCCESS if the PRNG has been seeded with enough data, * APR_ENOTENOUGHENTROPY otherwise. * @param r The PRNG state */ APR_DECLARE(apr_status_t) apr_random_insecure_ready(apr_random_t *r); /** * Mix the randomness pools after forking. * @param proc The resulting process handle from apr_proc_fork() * @remark Call this in the child after forking to mix the randomness * pools. Note that its generally a bad idea to fork a process with a * real PRNG in it - better to have the PRNG externally and get the * randomness from there. However, if you really must do it, then you * should supply all your entropy to all the PRNGs - don't worry, they * won't produce the same output. * @remark Note that apr_proc_fork() calls this for you, so only weird * applications need ever call it themselves. * @internal */ APR_DECLARE(void) apr_random_after_fork(apr_proc_t *proc); /** @} */ #ifdef __cplusplus } #endif #endif /* !APR_RANDOM_H */ 0707010001f187000081a4000017820000044e000000014b1d38c9000012aa0000022d0000016a00000000000000000000001e00000000reloc/include/apr-1/apr_rmm.h /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef APR_RMM_H #define APR_RMM_H /** * @file apr_rmm.h * @brief APR-UTIL Relocatable Memory Management Routines */ /** * @defgroup APR_Util_RMM Relocatable Memory Management Routines * @ingroup APR_Util * @{ */ #include "apr.h" #include "apr_pools.h" #include "apr_errno.h" #include "apu.h" #include "apr_anylock.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** Structure to access Relocatable, Managed Memory */ typedef struct apr_rmm_t apr_rmm_t; /** Fundamental allocation unit, within a specific apr_rmm_t */ typedef apr_size_t apr_rmm_off_t; /** * Initialize a relocatable memory block to be managed by the apr_rmm API. * @param rmm The relocatable memory block * @param lock An apr_anylock_t of the appropriate type of lock, or NULL * if no locking is required. * @param membuf The block of relocatable memory to be managed * @param memsize The size of relocatable memory block to be managed * @param cont The pool to use for local storage and management * @remark Both @param membuf and @param memsize must be aligned * (for instance using APR_ALIGN_DEFAULT). */ APU_DECLARE(apr_status_t) apr_rmm_init(apr_rmm_t **rmm, apr_anylock_t *lock, void *membuf, apr_size_t memsize, apr_pool_t *cont); /** * Destroy a managed memory block. * @param rmm The relocatable memory block to destroy */ APU_DECLARE(apr_status_t) apr_rmm_destroy(apr_rmm_t *rmm); /** * Attach to a relocatable memory block already managed by the apr_rmm API. * @param rmm The relocatable memory block * @param lock An apr_anylock_t of the appropriate type of lock * @param membuf The block of relocatable memory already under management * @param cont The pool to use for local storage and management */ APU_DECLARE(apr_status_t) apr_rmm_attach(apr_rmm_t **rmm, apr_anylock_t *lock, void *membuf, apr_pool_t *cont); /** * Detach from the managed block of memory. * @param rmm The relocatable memory block to detach from */ APU_DECLARE(apr_status_t) apr_rmm_detach(apr_rmm_t *rmm); /** * Allocate memory from the block of relocatable memory. * @param rmm The relocatable memory block * @param reqsize How much memory to allocate */ APU_DECLARE(apr_rmm_off_t) apr_rmm_malloc(apr_rmm_t *rmm, apr_size_t reqsize); /** * Realloc memory from the block of relocatable memory. * @param rmm The relocatable memory block * @param entity The memory allocation to realloc * @param reqsize The new size */ APU_DECLARE(apr_rmm_off_t) apr_rmm_realloc(apr_rmm_t *rmm, void *entity, apr_size_t reqsize); /** * Allocate memory from the block of relocatable memory and initialize it to zero. * @param rmm The relocatable memory block * @param reqsize How much memory to allocate */ APU_DECLARE(apr_rmm_off_t) apr_rmm_calloc(apr_rmm_t *rmm, apr_size_t reqsize); /** * Free allocation returned by apr_rmm_malloc or apr_rmm_calloc. * @param rmm The relocatable memory block * @param entity The memory allocation to free */ APU_DECLARE(apr_status_t) apr_rmm_free(apr_rmm_t *rmm, apr_rmm_off_t entity); /** * Retrieve the physical address of a relocatable allocation of memory * @param rmm The relocatable memory block * @param entity The memory allocation to free * @return address The address, aligned with APR_ALIGN_DEFAULT. */ APU_DECLARE(void *) apr_rmm_addr_get(apr_rmm_t *rmm, apr_rmm_off_t entity); /** * Compute the offset of a relocatable allocation of memory * @param rmm The relocatable memory block * @param entity The physical address to convert to an offset */ APU_DECLARE(apr_rmm_off_t) apr_rmm_offset_get(apr_rmm_t *rmm, void *entity); /** * Compute the required overallocation of memory needed to fit n allocs * @param n The number of alloc/calloc regions desired */ APU_DECLARE(apr_size_t) apr_rmm_overhead_get(int n); #ifdef __cplusplus } #endif /** @} */ #endif /* ! APR_RMM_H */ 0707010001f177000081a4000017820000044e000000014b1d38c7000020a00000022d0000016a00000000000000000000001e00000000reloc/include/apr-1/apr_lib.h /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef APR_LIB_H #define APR_LIB_H /** * @file apr_lib.h * This is collection of oddballs that didn't fit anywhere else, * and might move to more appropriate headers with the release * of APR 1.0. * @brief APR general purpose library routines */ #include "apr.h" #include "apr_errno.h" #if APR_HAVE_CTYPE_H #include
* For example: * "/foo/bar/gum" -> "gum" * "/foo/bar/gum/" -> "" * "gum" -> "gum" * "bs\\path\\stuff" -> "stuff" **/ APR_DECLARE(const char *) apr_filepath_name_get(const char *pathname); /** * apr_killpg * Small utility macros to make things easier to read. Not usually a * goal, to be sure.. */ #ifdef WIN32 #define apr_killpg(x, y) #else /* WIN32 */ #ifdef NO_KILLPG #define apr_killpg(x, y) (kill (-(x), (y))) #else /* NO_KILLPG */ #define apr_killpg(x, y) (killpg ((x), (y))) #endif /* NO_KILLPG */ #endif /* WIN32 */ /** * apr_vformatter() is a generic printf-style formatting routine * with some extensions. * @param flush_func The function to call when the buffer is full * @param c The buffer to write to * @param fmt The format string * @param ap The arguments to use to fill out the format string. * * @remark *
* The extensions are: * * %%pA takes a struct in_addr *, and prints it as a.b.c.d * %%pI takes an apr_sockaddr_t * and prints it as a.b.c.d:port or * [ipv6-address]:port * %%pT takes an apr_os_thread_t * and prints it in decimal * ('0' is printed if !APR_HAS_THREADS) * %%pt takes an apr_os_thread_t * and prints it in hexadecimal * ('0' is printed if !APR_HAS_THREADS) * %%pm takes an apr_status_t * and prints the appropriate error * string (from apr_strerror) corresponding to that error code. * %%pp takes a void * and outputs it in hex * %%pB takes a apr_uint32_t * as bytes and outputs it's apr_strfsize * %%pF same as above, but takes a apr_off_t * * %%pS same as above, but takes a apr_size_t * * * %%pt is only available from APR 1.2.0 onwards. * %%pm, %%pB, %%pF and %%pS are only available from APR 1.3.0 onwards. * * The %%p hacks are to force gcc's printf warning code to skip * over a pointer argument without complaining. This does * mean that the ANSI-style %%p (output a void * in hex format) won't * work as expected at all, but that seems to be a fair trade-off * for the increased robustness of having printf-warnings work. * * Additionally, apr_vformatter allows for arbitrary output methods * using the apr_vformatter_buff and flush_func. * * The apr_vformatter_buff has two elements curpos and endpos. * curpos is where apr_vformatter will write the next byte of output. * It proceeds writing output to curpos, and updating curpos, until * either the end of output is reached, or curpos == endpos (i.e. the * buffer is full). * * If the end of output is reached, apr_vformatter returns the * number of bytes written. * * When the buffer is full, the flush_func is called. The flush_func * can return -1 to indicate that no further output should be attempted, * and apr_vformatter will return immediately with -1. Otherwise * the flush_func should flush the buffer in whatever manner is * appropriate, re apr_pool_t nitialize curpos and endpos, and return 0. * * Note that flush_func is only invoked as a result of attempting to * write another byte at curpos when curpos >= endpos. So for * example, it's possible when the output exactly matches the buffer * space available that curpos == endpos will be true when * apr_vformatter returns. * * apr_vformatter does not call out to any other code, it is entirely * self-contained. This allows the callers to do things which are * otherwise "unsafe". For example, apr_psprintf uses the "scratch" * space at the unallocated end of a block, and doesn't actually * complete the allocation until apr_vformatter returns. apr_psprintf * would be completely broken if apr_vformatter were to call anything * that used this same pool. Similarly http_bprintf() uses the "scratch" * space at the end of its output buffer, and doesn't actually note * that the space is in use until it either has to flush the buffer * or until apr_vformatter returns. **/ APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *b), apr_vformatter_buff_t *c, const char *fmt, va_list ap); /** * Display a prompt and read in the password from stdin. * @param prompt The prompt to display * @param pwbuf Buffer to store the password * @param bufsize The length of the password buffer. * @remark If the password entered must be truncated to fit in * the provided buffer, APR_ENAMETOOLONG will be returned. * Note that the bufsize paramater is passed by reference for no * reason; its value will never be modified by the apr_password_get() * function. */ APR_DECLARE(apr_status_t) apr_password_get(const char *prompt, char *pwbuf, apr_size_t *bufsize); /** @} */ /** * @defgroup apr_ctype ctype functions * These macros allow correct support of 8-bit characters on systems which * support 8-bit characters. Pretty dumb how the cast is required, but * that's legacy libc for ya. These new macros do not support EOF like * the standard macros do. Tough. * @{ */ /** @see isalnum */ #define apr_isalnum(c) (isalnum(((unsigned char)(c)))) /** @see isalpha */ #define apr_isalpha(c) (isalpha(((unsigned char)(c)))) /** @see iscntrl */ #define apr_iscntrl(c) (iscntrl(((unsigned char)(c)))) /** @see isdigit */ #define apr_isdigit(c) (isdigit(((unsigned char)(c)))) /** @see isgraph */ #define apr_isgraph(c) (isgraph(((unsigned char)(c)))) /** @see islower*/ #define apr_islower(c) (islower(((unsigned char)(c)))) /** @see isascii */ #ifdef isascii #define apr_isascii(c) (isascii(((unsigned char)(c)))) #else #define apr_isascii(c) (((c) & ~0x7f)==0) #endif /** @see isprint */ #define apr_isprint(c) (isprint(((unsigned char)(c)))) /** @see ispunct */ #define apr_ispunct(c) (ispunct(((unsigned char)(c)))) /** @see isspace */ #define apr_isspace(c) (isspace(((unsigned char)(c)))) /** @see isupper */ #define apr_isupper(c) (isupper(((unsigned char)(c)))) /** @see isxdigit */ #define apr_isxdigit(c) (isxdigit(((unsigned char)(c)))) /** @see tolower */ #define apr_tolower(c) (tolower(((unsigned char)(c)))) /** @see toupper */ #define apr_toupper(c) (toupper(((unsigned char)(c)))) /** @} */ #ifdef __cplusplus } #endif #endif /* ! APR_LIB_H */ 0707010001f164000081a4000017820000044e000000014b1d38c900005e1d0000022d0000016a00000000000000000000001e00000000reloc/include/apr-1/apr_dbd.h /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* Overview of what this is and does: * http://www.apache.org/~niq/dbd.html */ #ifndef APR_DBD_H #define APR_DBD_H #include "apu.h" #include "apr_pools.h" #ifdef __cplusplus extern "C" { #endif /** * @file apr_dbd.h * @brief APR-UTIL DBD library */ /** * @defgroup APR_Util_DBD DBD routines * @ingroup APR_Util * @{ */ /** * Mapping of C to SQL types, used for prepared statements. * @remarks * For apr_dbd_p[v]query/select functions, in and out parameters are always * const char * (i.e. regular nul terminated strings). LOB types are passed * with four (4) arguments: payload, length, table and column, all as const * char *, where table and column are reserved for future use by Oracle. * @remarks * For apr_dbd_p[v]bquery/select functions, in and out parameters are * described next to each enumeration constant and are generally native binary * types or some APR data type. LOB types are passed with four (4) arguments: * payload (char*), length (apr_size_t*), table (char*) and column (char*). * Table and column are reserved for future use by Oracle. */ typedef enum { APR_DBD_TYPE_NONE, APR_DBD_TYPE_TINY, /**< \%hhd : in, out: char* */ APR_DBD_TYPE_UTINY, /**< \%hhu : in, out: unsigned char* */ APR_DBD_TYPE_SHORT, /**< \%hd : in, out: short* */ APR_DBD_TYPE_USHORT, /**< \%hu : in, out: unsigned short* */ APR_DBD_TYPE_INT, /**< \%d : in, out: int* */ APR_DBD_TYPE_UINT, /**< \%u : in, out: unsigned int* */ APR_DBD_TYPE_LONG, /**< \%ld : in, out: long* */ APR_DBD_TYPE_ULONG, /**< \%lu : in, out: unsigned long* */ APR_DBD_TYPE_LONGLONG, /**< \%lld : in, out: apr_int64_t* */ APR_DBD_TYPE_ULONGLONG, /**< \%llu : in, out: apr_uint64_t* */ APR_DBD_TYPE_FLOAT, /**< \%f : in, out: float* */ APR_DBD_TYPE_DOUBLE, /**< \%lf : in, out: double* */ APR_DBD_TYPE_STRING, /**< \%s : in: char*, out: char** */ APR_DBD_TYPE_TEXT, /**< \%pDt : in: char*, out: char** */ APR_DBD_TYPE_TIME, /**< \%pDi : in: char*, out: char** */ APR_DBD_TYPE_DATE, /**< \%pDd : in: char*, out: char** */ APR_DBD_TYPE_DATETIME, /**< \%pDa : in: char*, out: char** */ APR_DBD_TYPE_TIMESTAMP, /**< \%pDs : in: char*, out: char** */ APR_DBD_TYPE_ZTIMESTAMP, /**< \%pDz : in: char*, out: char** */ APR_DBD_TYPE_BLOB, /**< \%pDb : in: char* apr_size_t* char* char*, out: apr_bucket_brigade* */ APR_DBD_TYPE_CLOB, /**< \%pDc : in: char* apr_size_t* char* char*, out: apr_bucket_brigade* */ APR_DBD_TYPE_NULL /**< \%pDn : in: void*, out: void** */ } apr_dbd_type_e; /* These are opaque structs. Instantiation is up to each backend */ typedef struct apr_dbd_driver_t apr_dbd_driver_t; typedef struct apr_dbd_t apr_dbd_t; typedef struct apr_dbd_transaction_t apr_dbd_transaction_t; typedef struct apr_dbd_results_t apr_dbd_results_t; typedef struct apr_dbd_row_t apr_dbd_row_t; typedef struct apr_dbd_prepared_t apr_dbd_prepared_t; /** apr_dbd_init: perform once-only initialisation. Call once only. * * @param pool - pool to register any shutdown cleanups, etc */ APU_DECLARE(apr_status_t) apr_dbd_init(apr_pool_t *pool); /** apr_dbd_get_driver: get the driver struct for a name * * @param pool - (process) pool to register cleanup * @param name - driver name * @param driver - pointer to driver struct. * @return APR_SUCCESS for success * @return APR_ENOTIMPL for no driver (when DSO not enabled) * @return APR_EDSOOPEN if DSO driver file can't be opened * @return APR_ESYMNOTFOUND if the driver file doesn't contain a driver */ APU_DECLARE(apr_status_t) apr_dbd_get_driver(apr_pool_t *pool, const char *name, const apr_dbd_driver_t **driver); /** apr_dbd_open_ex: open a connection to a backend * * @param pool - working pool * @param params - arguments to driver (implementation-dependent) * @param handle - pointer to handle to return * @param driver - driver struct. * @param error - descriptive error. * @return APR_SUCCESS for success * @return APR_EGENERAL if driver exists but connection failed * @remarks PostgreSQL: the params is passed directly to the PQconnectdb() * function (check PostgreSQL documentation for more details on the syntax). * @remarks SQLite2: the params is split on a colon, with the first part used * as the filename and second part converted to an integer and used as file * mode. * @remarks SQLite3: the params is passed directly to the sqlite3_open() * function as a filename to be opened (check SQLite3 documentation for more * details). * @remarks Oracle: the params can have "user", "pass", "dbname" and "server" * keys, each followed by an equal sign and a value. Such key/value pairs can * be delimited by space, CR, LF, tab, semicolon, vertical bar or comma. * @remarks MySQL: the params can have "host", "port", "user", "pass", * "dbname", "sock", "flags" "fldsz", "group" and "reconnect" keys, each * followed by an equal sign and a value. Such key/value pairs can be * delimited by space, CR, LF, tab, semicolon, vertical bar or comma. For * now, "flags" can only recognise CLIENT_FOUND_ROWS (check MySQL manual for * details). The value associated with "fldsz" determines maximum amount of * memory (in bytes) for each of the fields in the result set of prepared * statements. By default, this value is 1 MB. The value associated with * "group" determines which group from configuration file to use (see * MYSQL_READ_DEFAULT_GROUP option of mysql_options() in MySQL manual). * Reconnect is set to 1 by default (i.e. true). * @remarks FreeTDS: the params can have "username", "password", "appname", * "dbname", "host", "charset", "lang" and "server" keys, each followed by an * equal sign and a value. */ APU_DECLARE(apr_status_t) apr_dbd_open_ex(const apr_dbd_driver_t *driver, apr_pool_t *pool, const char *params, apr_dbd_t **handle, const char **error); /** apr_dbd_open: open a connection to a backend * * @param pool - working pool * @param params - arguments to driver (implementation-dependent) * @param handle - pointer to handle to return * @param driver - driver struct. * @return APR_SUCCESS for success * @return APR_EGENERAL if driver exists but connection failed * @see apr_dbd_open_ex */ APU_DECLARE(apr_status_t) apr_dbd_open(const apr_dbd_driver_t *driver, apr_pool_t *pool, const char *params, apr_dbd_t **handle); /** apr_dbd_close: close a connection to a backend * * @param handle - handle to close * @param driver - driver struct. * @return APR_SUCCESS for success or error status */ APU_DECLARE(apr_status_t) apr_dbd_close(const apr_dbd_driver_t *driver, apr_dbd_t *handle); /* apr-function-shaped versions of things */ /** apr_dbd_name: get the name of the driver * * @param driver - the driver * @return - name */ APU_DECLARE(const char*) apr_dbd_name(const apr_dbd_driver_t *driver); /** apr_dbd_native_handle: get native database handle of the underlying db * * @param driver - the driver * @param handle - apr_dbd handle * @return - native handle */ APU_DECLARE(void*) apr_dbd_native_handle(const apr_dbd_driver_t *driver, apr_dbd_t *handle); /** check_conn: check status of a database connection * * @param driver - the driver * @param pool - working pool * @param handle - the connection to check * @return APR_SUCCESS or error */ APU_DECLARE(int) apr_dbd_check_conn(const apr_dbd_driver_t *driver, apr_pool_t *pool, apr_dbd_t *handle); /** apr_dbd_set_dbname: select database name. May be a no-op if not supported. * * @param driver - the driver * @param pool - working pool * @param handle - the connection * @param name - the database to select * @return 0 for success or error code */ APU_DECLARE(int) apr_dbd_set_dbname(const apr_dbd_driver_t *driver, apr_pool_t *pool, apr_dbd_t *handle, const char *name); /** apr_dbd_transaction_start: start a transaction. May be a no-op. * * @param driver - the driver * @param pool - a pool to use for error messages (if any). * @param handle - the db connection * @param trans - ptr to a transaction. May be null on entry * @return 0 for success or error code * @remarks Note that transaction modes, set by calling * apr_dbd_transaction_mode_set(), will affect all query/select calls within * a transaction. By default, any error in query/select during a transaction * will cause the transaction to inherit the error code and any further * query/select calls will fail immediately. Put transaction in "ignore * errors" mode to avoid that. Use "rollback" mode to do explicit rollback. */ APU_DECLARE(int) apr_dbd_transaction_start(const apr_dbd_driver_t *driver, apr_pool_t *pool, apr_dbd_t *handle, apr_dbd_transaction_t **trans); /** apr_dbd_transaction_end: end a transaction * (commit on success, rollback on error). * May be a no-op. * * @param driver - the driver * @param handle - the db connection * @param trans - the transaction. * @return 0 for success or error code */ APU_DECLARE(int) apr_dbd_transaction_end(const apr_dbd_driver_t *driver, apr_pool_t *pool, apr_dbd_transaction_t *trans); #define APR_DBD_TRANSACTION_COMMIT 0x00 /**< commit the transaction */ #define APR_DBD_TRANSACTION_ROLLBACK 0x01 /**< rollback the transaction */ #define APR_DBD_TRANSACTION_IGNORE_ERRORS 0x02 /**< ignore transaction errors */ /** apr_dbd_transaction_mode_get: get the mode of transaction * * @param driver - the driver * @param trans - the transaction * @return mode of transaction */ APU_DECLARE(int) apr_dbd_transaction_mode_get(const apr_dbd_driver_t *driver, apr_dbd_transaction_t *trans); /** apr_dbd_transaction_mode_set: set the mode of transaction * * @param driver - the driver * @param trans - the transaction * @param mode - new mode of the transaction * @return the mode of transaction in force after the call */ APU_DECLARE(int) apr_dbd_transaction_mode_set(const apr_dbd_driver_t *driver, apr_dbd_transaction_t *trans, int mode); /** apr_dbd_query: execute an SQL query that doesn't return a result set * * @param driver - the driver * @param handle - the connection * @param nrows - number of rows affected. * @param statement - the SQL statement to execute * @return 0 for success or error code */ APU_DECLARE(int) apr_dbd_query(const apr_dbd_driver_t *driver, apr_dbd_t *handle, int *nrows, const char *statement); /** apr_dbd_select: execute an SQL query that returns a result set * * @param driver - the driver * @param pool - pool to allocate the result set * @param handle - the connection * @param res - pointer to result set pointer. May point to NULL on entry * @param statement - the SQL statement to execute * @param random - 1 to support random access to results (seek any row); * 0 to support only looping through results in order * (async access - faster) * @return 0 for success or error code */ APU_DECLARE(int) apr_dbd_select(const apr_dbd_driver_t *driver, apr_pool_t *pool, apr_dbd_t *handle, apr_dbd_results_t **res, const char *statement, int random); /** apr_dbd_num_cols: get the number of columns in a results set * * @param driver - the driver * @param res - result set. * @return number of columns */ APU_DECLARE(int) apr_dbd_num_cols(const apr_dbd_driver_t *driver, apr_dbd_results_t *res); /** apr_dbd_num_tuples: get the number of rows in a results set * of a synchronous select * * @param driver - the driver * @param res - result set. * @return number of rows, or -1 if the results are asynchronous */ APU_DECLARE(int) apr_dbd_num_tuples(const apr_dbd_driver_t *driver, apr_dbd_results_t *res); /** apr_dbd_get_row: get a row from a result set * * @param driver - the driver * @param pool - pool to allocate the row * @param res - result set pointer * @param row - pointer to row pointer. May point to NULL on entry * @param rownum - row number (counting from 1), or -1 for "next row". * Ignored if random access is not supported. * @return 0 for success, -1 for rownum out of range or data finished */ APU_DECLARE(int) apr_dbd_get_row(const apr_dbd_driver_t *driver, apr_pool_t *pool, apr_dbd_results_t *res, apr_dbd_row_t **row, int rownum); /** apr_dbd_get_entry: get an entry from a row * * @param driver - the driver * @param row - row pointer * @param col - entry number * @return value from the row, or NULL if col is out of bounds. */ APU_DECLARE(const char*) apr_dbd_get_entry(const apr_dbd_driver_t *driver, apr_dbd_row_t *row, int col); /** apr_dbd_get_name: get an entry name from a result set * * @param driver - the driver * @param res - result set pointer * @param col - entry number * @return name of the entry, or NULL if col is out of bounds. */ APU_DECLARE(const char*) apr_dbd_get_name(const apr_dbd_driver_t *driver, apr_dbd_results_t *res, int col); /** apr_dbd_error: get current error message (if any) * * @param driver - the driver * @param handle - the connection * @param errnum - error code from operation that returned an error * @return the database current error message, or message for errnum * (implementation-dependent whether errnum is ignored) */ APU_DECLARE(const char*) apr_dbd_error(const apr_dbd_driver_t *driver, apr_dbd_t *handle, int errnum); /** apr_dbd_escape: escape a string so it is safe for use in query/select * * @param driver - the driver * @param pool - pool to alloc the result from * @param string - the string to escape * @param handle - the connection * @return the escaped, safe string */ APU_DECLARE(const char*) apr_dbd_escape(const apr_dbd_driver_t *driver, apr_pool_t *pool, const char *string, apr_dbd_t *handle); /** apr_dbd_prepare: prepare a statement * * @param driver - the driver * @param pool - pool to alloc the result from * @param handle - the connection * @param query - the SQL query * @param label - A label for the prepared statement. * use NULL for temporary prepared statements * (eg within a Request in httpd) * @param statement - statement to prepare. May point to null on entry. * @return 0 for success or error code * @remarks To specify parameters of the prepared query, use \%s, \%d etc. * (see below for full list) in place of database specific parameter syntax * (e.g. for PostgreSQL, this would be $1, $2, for SQLite3 this would be ? * etc.). For instance: "SELECT name FROM customers WHERE name=%s" would be * a query that this function understands. * @remarks Here is the full list of format specifiers that this function * understands and what they map to in SQL: \%hhd (TINY INT), \%hhu (UNSIGNED * TINY INT), \%hd (SHORT), \%hu (UNSIGNED SHORT), \%d (INT), \%u (UNSIGNED * INT), \%ld (LONG), \%lu (UNSIGNED LONG), \%lld (LONG LONG), \%llu * (UNSIGNED LONG LONG), \%f (FLOAT, REAL), \%lf (DOUBLE PRECISION), \%s * (VARCHAR), \%pDt (TEXT), \%pDi (TIME), \%pDd (DATE), \%pDa (DATETIME), * \%pDs (TIMESTAMP), \%pDz (TIMESTAMP WITH TIME ZONE), \%pDb (BLOB), \%pDc * (CLOB) and \%pDn (NULL). Not all databases have support for all these * types, so the underlying driver will attempt the "best match" where * possible. A \% followed by any letter not in the above list will be * interpreted as VARCHAR (i.e. \%s). */ APU_DECLARE(int) apr_dbd_prepare(const apr_dbd_driver_t *driver, apr_pool_t *pool, apr_dbd_t *handle, const char *query, const char *label, apr_dbd_prepared_t **statement); /** apr_dbd_pquery: query using a prepared statement + args * * @param driver - the driver * @param pool - working pool * @param handle - the connection * @param nrows - number of rows affected. * @param statement - the prepared statement to execute * @param nargs - ignored (for backward compatibility only) * @param args - args to prepared statement * @return 0 for success or error code */ APU_DECLARE(int) apr_dbd_pquery(const apr_dbd_driver_t *driver, apr_pool_t *pool, apr_dbd_t *handle, int *nrows, apr_dbd_prepared_t *statement, int nargs, const char **args); /** apr_dbd_pselect: select using a prepared statement + args * * @param driver - the driver * @param pool - working pool * @param handle - the connection * @param res - pointer to query results. May point to NULL on entry * @param statement - the prepared statement to execute * @param random - Whether to support random-access to results * @param nargs - ignored (for backward compatibility only) * @param args - args to prepared statement * @return 0 for success or error code */ APU_DECLARE(int) apr_dbd_pselect(const apr_dbd_driver_t *driver, apr_pool_t *pool, apr_dbd_t *handle, apr_dbd_results_t **res, apr_dbd_prepared_t *statement, int random, int nargs, const char **args); /** apr_dbd_pvquery: query using a prepared statement + args * * @param driver - the driver * @param pool - working pool * @param handle - the connection * @param nrows - number of rows affected. * @param statement - the prepared statement to execute * @param ... - varargs list * @return 0 for success or error code */ APU_DECLARE_NONSTD(int) apr_dbd_pvquery(const apr_dbd_driver_t *driver, apr_pool_t *pool, apr_dbd_t *handle, int *nrows, apr_dbd_prepared_t *statement, ...); /** apr_dbd_pvselect: select using a prepared statement + args * * @param driver - the driver * @param pool - working pool * @param handle - the connection * @param res - pointer to query results. May point to NULL on entry * @param statement - the prepared statement to execute * @param random - Whether to support random-access to results * @param ... - varargs list * @return 0 for success or error code */ APU_DECLARE_NONSTD(int) apr_dbd_pvselect(const apr_dbd_driver_t *driver, apr_pool_t *pool, apr_dbd_t *handle, apr_dbd_results_t **res, apr_dbd_prepared_t *statement, int random, ...); /** apr_dbd_pbquery: query using a prepared statement + binary args * * @param driver - the driver * @param pool - working pool * @param handle - the connection * @param nrows - number of rows affected. * @param statement - the prepared statement to execute * @param args - binary args to prepared statement * @return 0 for success or error code */ APU_DECLARE(int) apr_dbd_pbquery(const apr_dbd_driver_t *driver, apr_pool_t *pool, apr_dbd_t *handle, int *nrows, apr_dbd_prepared_t *statement, const void **args); /** apr_dbd_pbselect: select using a prepared statement + binary args * * @param driver - the driver * @param pool - working pool * @param handle - the connection * @param res - pointer to query results. May point to NULL on entry * @param statement - the prepared statement to execute * @param random - Whether to support random-access to results * @param args - binary args to prepared statement * @return 0 for success or error code */ APU_DECLARE(int) apr_dbd_pbselect(const apr_dbd_driver_t *driver, apr_pool_t *pool, apr_dbd_t *handle, apr_dbd_results_t **res, apr_dbd_prepared_t *statement, int random, const void **args); /** apr_dbd_pvbquery: query using a prepared statement + binary args * * @param driver - the driver * @param pool - working pool * @param handle - the connection * @param nrows - number of rows affected. * @param statement - the prepared statement to execute * @param ... - varargs list of binary args * @return 0 for success or error code */ APU_DECLARE_NONSTD(int) apr_dbd_pvbquery(const apr_dbd_driver_t *driver, apr_pool_t *pool, apr_dbd_t *handle, int *nrows, apr_dbd_prepared_t *statement, ...); /** apr_dbd_pvbselect: select using a prepared statement + binary args * * @param driver - the driver * @param pool - working pool * @param handle - the connection * @param res - pointer to query results. May point to NULL on entry * @param statement - the prepared statement to execute * @param random - Whether to support random-access to results * @param ... - varargs list of binary args * @return 0 for success or error code */ APU_DECLARE_NONSTD(int) apr_dbd_pvbselect(const apr_dbd_driver_t *driver, apr_pool_t *pool, apr_dbd_t *handle, apr_dbd_results_t **res, apr_dbd_prepared_t *statement, int random, ...); /** apr_dbd_datum_get: get a binary entry from a row * * @param driver - the driver * @param row - row pointer * @param col - entry number * @param type - type of data to get * @param data - pointer to data, allocated by the caller * @return APR_SUCCESS on success, APR_ENOENT if data is NULL or APR_EGENERAL */ APU_DECLARE(apr_status_t) apr_dbd_datum_get(const apr_dbd_driver_t *driver, apr_dbd_row_t *row, int col, apr_dbd_type_e type, void *data); /** @} */ #ifdef __cplusplus } #endif #endif 0707010001f17b000081a4000017820000044e000000014b1d38c70000140a0000022d0000016a00000000000000000000001f00000000reloc/include/apr-1/apr_mmap.h /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef APR_MMAP_H #define APR_MMAP_H /** * @file apr_mmap.h * @brief APR MMAP routines */ #include "apr.h" #include "apr_pools.h" #include "apr_errno.h" #include "apr_ring.h" #include "apr_file_io.h" /* for apr_file_t */ #ifdef BEOS #include
* APR_MMAP_READ MMap opened for reading * APR_MMAP_WRITE MMap opened for writing ** @param cntxt The pool to use when creating the mmap. */ APR_DECLARE(apr_status_t) apr_mmap_create(apr_mmap_t **newmmap, apr_file_t *file, apr_off_t offset, apr_size_t size, apr_int32_t flag, apr_pool_t *cntxt); /** * Duplicate the specified MMAP. * @param new_mmap The structure to duplicate into. * @param old_mmap The mmap to duplicate. * @param p The pool to use for new_mmap. */ APR_DECLARE(apr_status_t) apr_mmap_dup(apr_mmap_t **new_mmap, apr_mmap_t *old_mmap, apr_pool_t *p); /** * Remove a mmap'ed. * @param mm The mmap'ed file. */ APR_DECLARE(apr_status_t) apr_mmap_delete(apr_mmap_t *mm); /** * Move the pointer into the mmap'ed file to the specified offset. * @param addr The pointer to the offset specified. * @param mm The mmap'ed file. * @param offset The offset to move to. */ APR_DECLARE(apr_status_t) apr_mmap_offset(void **addr, apr_mmap_t *mm, apr_off_t offset); #endif /* APR_HAS_MMAP */ /** @} */ #ifdef __cplusplus } #endif #endif /* ! APR_MMAP_H */ 0707010001f161000081a4000017820000044e000000014b1d38c900000eef0000022d0000016a00000000000000000000002100000000reloc/include/apr-1/apr_base64.h /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * The apr_vsnprintf/apr_snprintf functions are based on, and used with the * permission of, the SIO stdio-replacement strx_* functions by Panos * Tsirigotis
* * void* APR_THREAD_FUNC my_thread_entry_fn(apr_thread_t *thd, void *data); * **/ #define APR_THREAD_FUNC /** * The public APR functions are declared with APR_DECLARE(), so they may * use the most appropriate calling convention. Public APR functions with * variable arguments must use APR_DECLARE_NONSTD(). * * @remark Both the declaration and implementations must use the same macro. * *
* APR_DECLARE(rettype) apr_func(args) ** @see APR_DECLARE_NONSTD @see APR_DECLARE_DATA * @remark Note that when APR compiles the library itself, it passes the * symbol -DAPR_DECLARE_EXPORT to the compiler on some platforms (e.g. Win32) * to export public symbols from the dynamic library build.\n * The user must define the APR_DECLARE_STATIC when compiling to target * the static APR library on some platforms (e.g. Win32.) The public symbols * are neither exported nor imported when APR_DECLARE_STATIC is defined.\n * By default, compiling an application and including the APR public * headers, without defining APR_DECLARE_STATIC, will prepare the code to be * linked to the dynamic library. */ #define APR_DECLARE(type) type /** * The public APR functions using variable arguments are declared with * APR_DECLARE_NONSTD(), as they must follow the C language calling convention. * @see APR_DECLARE @see APR_DECLARE_DATA * @remark Both the declaration and implementations must use the same macro. *
* * APR_DECLARE_NONSTD(rettype) apr_func(args, ...); * **/ #define APR_DECLARE_NONSTD(type) type /** * The public APR variables are declared with AP_MODULE_DECLARE_DATA. * This assures the appropriate indirection is invoked at compile time. * @see APR_DECLARE @see APR_DECLARE_NONSTD * @remark Note that the declaration and implementations use different forms, * but both must include the macro. * *
* * extern APR_DECLARE_DATA type apr_variable;\n * APR_DECLARE_DATA type apr_variable = value; * **/ #define APR_DECLARE_DATA /* Define APR_SSIZE_T_FMT. * If ssize_t is an integer we define it to be "d", * if ssize_t is a long int we define it to be "ld", * if ssize_t is neither we declare an error here. * I looked for a better way to define this here, but couldn't find one, so * to find the logic for this definition search for "ssize_t_fmt" in * configure.in. */ #define APR_SSIZE_T_FMT "ld" /* And APR_SIZE_T_FMT */ #define APR_SIZE_T_FMT "ld" /* And APR_OFF_T_FMT */ #define APR_OFF_T_FMT "ld" /* And APR_PID_T_FMT */ #define APR_PID_T_FMT "d" /* And APR_INT64_T_FMT */ #define APR_INT64_T_FMT "ld" /* And APR_UINT64_T_FMT */ #define APR_UINT64_T_FMT "lu" /* And APR_UINT64_T_HEX_FMT */ #define APR_UINT64_T_HEX_FMT "lx" /* Does the proc mutex lock threads too */ #define APR_PROC_MUTEX_IS_GLOBAL 0 /* Local machine definition for console and log output. */ #define APR_EOL_STR "\n" #if APR_HAVE_SYS_WAIT_H #ifdef WEXITSTATUS #define apr_wait_t int #else #define apr_wait_t union wait #define WEXITSTATUS(status) (int)((status).w_retcode) #define WTERMSIG(status) (int)((status).w_termsig) #endif /* !WEXITSTATUS */ #elif defined(__MINGW32__) typedef int apr_wait_t; #endif /* HAVE_SYS_WAIT_H */ #if defined(PATH_MAX) #define APR_PATH_MAX PATH_MAX #elif defined(_POSIX_PATH_MAX) #define APR_PATH_MAX _POSIX_PATH_MAX #else #error no decision has been made on APR_PATH_MAX for your platform #endif #define APR_DSOPATH "LD_LIBRARY_PATH" /** @} */ /* Definitions that only Win32 programs need to compile properly. */ /* XXX These simply don't belong here, perhaps in apr_portable.h * based on some APR_HAVE_PID/GID/UID? */ #ifdef __MINGW32__ #ifndef __GNUC__ typedef int pid_t; #endif typedef int uid_t; typedef int gid_t; #endif #ifdef __cplusplus } #endif #endif /* APR_H */ 0707010001f16f000081a4000017820000044e000000014b1d38c7000020200000022d0000016a00000000000000000000001f00000000reloc/include/apr-1/apr_hash.h /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef APR_HASH_H #define APR_HASH_H /** * @file apr_hash.h * @brief APR Hash Tables */ #include "apr_pools.h" #ifdef __cplusplus extern "C" { #endif /** * @defgroup apr_hash Hash Tables * @ingroup APR * @{ */ /** * When passing a key to apr_hash_set or apr_hash_get, this value can be * passed to indicate a string-valued key, and have apr_hash compute the * length automatically. * * @remark apr_hash will use strlen(key) for the length. The NUL terminator * is not included in the hash value (why throw a constant in?). * Since the hash table merely references the provided key (rather * than copying it), apr_hash_this() will return the NUL-term'd key. */ #define APR_HASH_KEY_STRING (-1) /** * Abstract type for hash tables. */ typedef struct apr_hash_t apr_hash_t; /** * Abstract type for scanning hash tables. */ typedef struct apr_hash_index_t apr_hash_index_t; /** * Callback functions for calculating hash values. * @param key The key. * @param klen The length of the key, or APR_HASH_KEY_STRING to use the string * length. If APR_HASH_KEY_STRING then returns the actual key length. */ typedef unsigned int (*apr_hashfunc_t)(const char *key, apr_ssize_t *klen); /** * The default hash function. */ APR_DECLARE_NONSTD(unsigned int) apr_hashfunc_default(const char *key, apr_ssize_t *klen); /** * Create a hash table. * @param pool The pool to allocate the hash table out of * @return The hash table just created */ APR_DECLARE(apr_hash_t *) apr_hash_make(apr_pool_t *pool); /** * Create a hash table with a custom hash function * @param pool The pool to allocate the hash table out of * @param hash_func A custom hash function. * @return The hash table just created */ APR_DECLARE(apr_hash_t *) apr_hash_make_custom(apr_pool_t *pool, apr_hashfunc_t hash_func); /** * Make a copy of a hash table * @param pool The pool from which to allocate the new hash table * @param h The hash table to clone * @return The hash table just created * @remark Makes a shallow copy */ APR_DECLARE(apr_hash_t *) apr_hash_copy(apr_pool_t *pool, const apr_hash_t *h); /** * Associate a value with a key in a hash table. * @param ht The hash table * @param key Pointer to the key * @param klen Length of the key. Can be APR_HASH_KEY_STRING to use the string length. * @param val Value to associate with the key * @remark If the value is NULL the hash entry is deleted. */ APR_DECLARE(void) apr_hash_set(apr_hash_t *ht, const void *key, apr_ssize_t klen, const void *val); /** * Look up the value associated with a key in a hash table. * @param ht The hash table * @param key Pointer to the key * @param klen Length of the key. Can be APR_HASH_KEY_STRING to use the string length. * @return Returns NULL if the key is not present. */ APR_DECLARE(void *) apr_hash_get(apr_hash_t *ht, const void *key, apr_ssize_t klen); /** * Start iterating over the entries in a hash table. * @param p The pool to allocate the apr_hash_index_t iterator. If this * pool is NULL, then an internal, non-thread-safe iterator is used. * @param ht The hash table * @remark There is no restriction on adding or deleting hash entries during * an iteration (although the results may be unpredictable unless all you do * is delete the current entry) and multiple iterations can be in * progress at the same time. */ /** * @example * *
* * int sum_values(apr_pool_t *p, apr_hash_t *ht) * { * apr_hash_index_t *hi; * void *val; * int sum = 0; * for (hi = apr_hash_first(p, ht); hi; hi = apr_hash_next(hi)) { * apr_hash_this(hi, NULL, NULL, &val); * sum += *(int *)val; * } * return sum; * } **/ APR_DECLARE(apr_hash_index_t *) apr_hash_first(apr_pool_t *p, apr_hash_t *ht); /** * Continue iterating over the entries in a hash table. * @param hi The iteration state * @return a pointer to the updated iteration state. NULL if there are no more * entries. */ APR_DECLARE(apr_hash_index_t *) apr_hash_next(apr_hash_index_t *hi); /** * Get the current entry's details from the iteration state. * @param hi The iteration state * @param key Return pointer for the pointer to the key. * @param klen Return pointer for the key length. * @param val Return pointer for the associated value. * @remark The return pointers should point to a variable that will be set to the * corresponding data, or they may be NULL if the data isn't interesting. */ APR_DECLARE(void) apr_hash_this(apr_hash_index_t *hi, const void **key, apr_ssize_t *klen, void **val); /** * Get the number of key/value pairs in the hash table. * @param ht The hash table * @return The number of key/value pairs in the hash table. */ APR_DECLARE(unsigned int) apr_hash_count(apr_hash_t *ht); /** * Clear any key/value pairs in the hash table. * @param ht The hash table */ APR_DECLARE(void) apr_hash_clear(apr_hash_t *ht); /** * Merge two hash tables into one new hash table. The values of the overlay * hash override the values of the base if both have the same key. Both * hash tables must use the same hash function. * @param p The pool to use for the new hash table * @param overlay The table to add to the initial table * @param base The table that represents the initial values of the new table * @return A new hash table containing all of the data from the two passed in */ APR_DECLARE(apr_hash_t *) apr_hash_overlay(apr_pool_t *p, const apr_hash_t *overlay, const apr_hash_t *base); /** * Merge two hash tables into one new hash table. If the same key * is present in both tables, call the supplied merge function to * produce a merged value for the key in the new table. Both * hash tables must use the same hash function. * @param p The pool to use for the new hash table * @param h1 The first of the tables to merge * @param h2 The second of the tables to merge * @param merger A callback function to merge values, or NULL to * make values from h1 override values from h2 (same semantics as * apr_hash_overlay()) * @param data Client data to pass to the merger function * @return A new hash table containing all of the data from the two passed in */ APR_DECLARE(apr_hash_t *) apr_hash_merge(apr_pool_t *p, const apr_hash_t *h1, const apr_hash_t *h2, void * (*merger)(apr_pool_t *p, const void *key, apr_ssize_t klen, const void *h1_val, const void *h2_val, const void *data), const void *data); /** * Get a pointer to the pool which the hash table was created in */ APR_POOL_DECLARE_ACCESSOR(hash); /** @} */ #ifdef __cplusplus } #endif #endif /* !APR_HASH_H */ 0707010001f17e000081a4000017820000044e000000014b1d38c900000f1d0000022d0000016a00000000000000000000002900000000reloc/include/apr-1/apr_optional_hooks.h /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * @file apr_optional_hooks.h * @brief Apache optional hook functions */ #ifndef APR_OPTIONAL_HOOK_H #define APR_OPTIONAL_HOOK_H #include "apr_tables.h" #ifdef __cplusplus extern "C" { #endif /** * @defgroup APR_Util_OPT_HOOK Optional Hook Functions * @ingroup APR_Util_Hook * @{ */ /** * Function to implemnt the APR_OPTIONAL_HOOK Macro * @internal * @see APR_OPTIONAL_HOOK * * @param name The name of the hook * @param pfn A pointer to a function that will be called * @param aszPre a NULL-terminated array of strings that name modules whose hooks should precede this one * @param aszSucc a NULL-terminated array of strings that name modules whose hooks should succeed this one * @param nOrder an integer determining order before honouring aszPre and aszSucc (for example HOOK_MIDDLE) */ APU_DECLARE(void) apr_optional_hook_add(const char *szName,void (*pfn)(void), const char * const *aszPre, const char * const *aszSucc, int nOrder); /** * Hook to an optional hook. * * @param ns The namespace prefix of the hook functions * @param name The name of the hook * @param pfn A pointer to a function that will be called * @param aszPre a NULL-terminated array of strings that name modules whose hooks should precede this one * @param aszSucc a NULL-terminated array of strings that name modules whose hooks should succeed this one * @param nOrder an integer determining order before honouring aszPre and aszSucc (for example HOOK_MIDDLE) */ #define APR_OPTIONAL_HOOK(ns,name,pfn,aszPre,aszSucc,nOrder) do { \ ns##_HOOK_##name##_t *apu__hook = pfn; \ apr_optional_hook_add(#name,(void (*)(void))apu__hook,aszPre, aszSucc, nOrder); \ } while (0) /** * @internal * @param szName - the name of the function * @return the hook structure for a given hook */ APU_DECLARE(apr_array_header_t *) apr_optional_hook_get(const char *szName); /** * Implement an optional hook that runs until one of the functions * returns something other than OK or DECLINE. * * @param ns The namespace prefix of the hook functions * @param link The linkage declaration prefix of the hook * @param ret The type of the return value of the hook * @param ret The type of the return value of the hook * @param name The name of the hook * @param args_decl The declaration of the arguments for the hook * @param args_use The names for the arguments for the hook * @param ok Success value * @param decline Decline value */ #define APR_IMPLEMENT_OPTIONAL_HOOK_RUN_ALL(ns,link,ret,name,args_decl,args_use,ok,decline) \ link##_DECLARE(ret) ns##_run_##name args_decl \ { \ ns##_LINK_##name##_t *pHook; \ int n; \ ret rv; \ apr_array_header_t *pHookArray=apr_optional_hook_get(#name); \ \ if(!pHookArray) \ return ok; \ \ pHook=(ns##_LINK_##name##_t *)pHookArray->elts; \ for(n=0 ; n < pHookArray->nelts ; ++n) \ { \ rv=(pHook[n].pFunc)args_use; \ \ if(rv != ok && rv != decline) \ return rv; \ } \ return ok; \ } /** @} */ #ifdef __cplusplus } #endif #endif /* APR_OPTIONAL_HOOK_H */ 0707010001f17f000081a4000017820000044e000000014b1d38c700002b4a0000022d0000016a00000000000000000000001f00000000reloc/include/apr-1/apr_poll.h /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef APR_POLL_H #define APR_POLL_H /** * @file apr_poll.h * @brief APR Poll interface */ #include "apr.h" #include "apr_pools.h" #include "apr_errno.h" #include "apr_inherit.h" #include "apr_file_io.h" #include "apr_network_io.h" #if APR_HAVE_NETINET_IN_H #include
* APR_POOL_DECLARE_ACCESSOR(file); * becomes: * APR_DECLARE(apr_pool_t *) apr_file_pool_get(apr_file_t *ob); ** @remark Doxygen unwraps this macro (via doxygen.conf) to provide * actual help for each specific occurance of apr_foo_pool_get. * @remark the linkage is specified for APR. It would be possible to expand * the macros to support other linkages. */ #define APR_POOL_DECLARE_ACCESSOR(type) \ APR_DECLARE(apr_pool_t *) apr_##type##_pool_get \ (const apr_##type##_t *the##type) /** * Implementation helper macro to provide apr_foo_pool_get()s. * * In the implementation, the APR_POOL_IMPLEMENT_ACCESSOR() is used to * actually define the function. It assumes the field is named "pool". */ #define APR_POOL_IMPLEMENT_ACCESSOR(type) \ APR_DECLARE(apr_pool_t *) apr_##type##_pool_get \ (const apr_##type##_t *the##type) \ { return the##type->pool; } /** * Pool debug levels * *
* | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | * --------------------------------- * | | | | | | | | x | General debug code enabled (useful in * combination with --with-efence). * * | | | | | | | x | | Verbose output on stderr (report * CREATE, CLEAR, DESTROY). * * | | | | x | | | | | Verbose output on stderr (report * PALLOC, PCALLOC). * * | | | | | | x | | | Lifetime checking. On each use of a * pool, check its lifetime. If the pool * is out of scope, abort(). * In combination with the verbose flag * above, it will output LIFE in such an * event prior to aborting. * * | | | | | x | | | | Pool owner checking. On each use of a * pool, check if the current thread is the * pools owner. If not, abort(). In * combination with the verbose flag above, * it will output OWNER in such an event * prior to aborting. Use the debug * function apr_pool_owner_set() to switch * a pools ownership. * * When no debug level was specified, assume general debug mode. * If level 0 was specified, debugging is switched off **/ #if defined(APR_POOL_DEBUG) /* If APR_POOL_DEBUG is blank, we get 1; if it is a number, we get -1. */ #if (APR_POOL_DEBUG - APR_POOL_DEBUG -1 == 1) #undef APR_POOL_DEBUG #define APR_POOL_DEBUG 1 #endif #else #define APR_POOL_DEBUG 0 #endif /** the place in the code where the particular function was called */ #define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__) /** A function that is called when allocation fails. */ typedef int (*apr_abortfunc_t)(int retcode); /* * APR memory structure manipulators (pools, tables, and arrays). */ /* * Initialization */ /** * Setup all of the internal structures required to use pools * @remark Programs do NOT need to call this directly. APR will call this * automatically from apr_initialize. * @internal */ APR_DECLARE(apr_status_t) apr_pool_initialize(void); /** * Tear down all of the internal structures required to use pools * @remark Programs do NOT need to call this directly. APR will call this * automatically from apr_terminate. * @internal */ APR_DECLARE(void) apr_pool_terminate(void); /* * Pool creation/destruction */ #include "apr_allocator.h" /** * Create a new pool. * @param newpool The pool we have just created. * @param parent The parent pool. If this is NULL, the new pool is a root * pool. If it is non-NULL, the new pool will inherit all * of its parent pool's attributes, except the apr_pool_t will * be a sub-pool. * @param abort_fn A function to use if the pool cannot allocate more memory. * @param allocator The allocator to use with the new pool. If NULL the * allocator of the parent pool will be used. * @remark This function is thread-safe, in the sense that multiple threads * can safely create subpools of the same parent pool concurrently. * Similarly, a subpool can be created by one thread at the same * time that another thread accesses the parent pool. */ APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, apr_pool_t *parent, apr_abortfunc_t abort_fn, apr_allocator_t *allocator); /** * Create a new pool. * @deprecated @see apr_pool_create_unmanaged_ex. */ APR_DECLARE(apr_status_t) apr_pool_create_core_ex(apr_pool_t **newpool, apr_abortfunc_t abort_fn, apr_allocator_t *allocator); /** * Create a new unmanaged pool. * @param newpool The pool we have just created. * @param abort_fn A function to use if the pool cannot allocate more memory. * @param allocator The allocator to use with the new pool. If NULL a * new allocator will be crated with newpool as owner. * @remark An unmanaged pool is a special pool without a parent; it will * NOT be destroyed upon apr_terminate. It must be explicitly * destroyed by calling apr_pool_destroy, to prevent memory leaks. * Use of this function is discouraged, think twice about whether * you really really need it. */ APR_DECLARE(apr_status_t) apr_pool_create_unmanaged_ex(apr_pool_t **newpool, apr_abortfunc_t abort_fn, apr_allocator_t *allocator); /** * Debug version of apr_pool_create_ex. * @param newpool @see apr_pool_create. * @param parent @see apr_pool_create. * @param abort_fn @see apr_pool_create. * @param allocator @see apr_pool_create. * @param file_line Where the function is called from. * This is usually APR_POOL__FILE_LINE__. * @remark Only available when APR_POOL_DEBUG is defined. * Call this directly if you have you apr_pool_create_ex * calls in a wrapper function and wish to override * the file_line argument to reflect the caller of * your wrapper function. If you do not have * apr_pool_create_ex in a wrapper, trust the macro * and don't call apr_pool_create_ex_debug directly. */ APR_DECLARE(apr_status_t) apr_pool_create_ex_debug(apr_pool_t **newpool, apr_pool_t *parent, apr_abortfunc_t abort_fn, apr_allocator_t *allocator, const char *file_line); #if APR_POOL_DEBUG #define apr_pool_create_ex(newpool, parent, abort_fn, allocator) \ apr_pool_create_ex_debug(newpool, parent, abort_fn, allocator, \ APR_POOL__FILE_LINE__) #endif /** * Debug version of apr_pool_create_core_ex. * @deprecated @see apr_pool_create_unmanaged_ex_debug. */ APR_DECLARE(apr_status_t) apr_pool_create_core_ex_debug(apr_pool_t **newpool, apr_abortfunc_t abort_fn, apr_allocator_t *allocator, const char *file_line); /** * Debug version of apr_pool_create_unmanaged_ex. * @param newpool @see apr_pool_create_unmanaged. * @param abort_fn @see apr_pool_create_unmanaged. * @param allocator @see apr_pool_create_unmanaged. * @param file_line Where the function is called from. * This is usually APR_POOL__FILE_LINE__. * @remark Only available when APR_POOL_DEBUG is defined. * Call this directly if you have you apr_pool_create_unmanaged_ex * calls in a wrapper function and wish to override * the file_line argument to reflect the caller of * your wrapper function. If you do not have * apr_pool_create_core_ex in a wrapper, trust the macro * and don't call apr_pool_create_core_ex_debug directly. */ APR_DECLARE(apr_status_t) apr_pool_create_unmanaged_ex_debug(apr_pool_t **newpool, apr_abortfunc_t abort_fn, apr_allocator_t *allocator, const char *file_line); #if APR_POOL_DEBUG #define apr_pool_create_core_ex(newpool, abort_fn, allocator) \ apr_pool_create_unmanaged_ex_debug(newpool, abort_fn, allocator, \ APR_POOL__FILE_LINE__) #define apr_pool_create_unmanaged_ex(newpool, abort_fn, allocator) \ apr_pool_create_unmanaged_ex_debug(newpool, abort_fn, allocator, \ APR_POOL__FILE_LINE__) #endif /** * Create a new pool. * @param newpool The pool we have just created. * @param parent The parent pool. If this is NULL, the new pool is a root * pool. If it is non-NULL, the new pool will inherit all * of its parent pool's attributes, except the apr_pool_t will * be a sub-pool. * @remark This function is thread-safe, in the sense that multiple threads * can safely create subpools of the same parent pool concurrently. * Similarly, a subpool can be created by one thread at the same * time that another thread accesses the parent pool. */ #if defined(DOXYGEN) APR_DECLARE(apr_status_t) apr_pool_create(apr_pool_t **newpool, apr_pool_t *parent); #else #if APR_POOL_DEBUG #define apr_pool_create(newpool, parent) \ apr_pool_create_ex_debug(newpool, parent, NULL, NULL, \ APR_POOL__FILE_LINE__) #else #define apr_pool_create(newpool, parent) \ apr_pool_create_ex(newpool, parent, NULL, NULL) #endif #endif /** * Create a new pool. * @param newpool The pool we have just created. */ #if defined(DOXYGEN) APR_DECLARE(apr_status_t) apr_pool_create_core(apr_pool_t **newpool); APR_DECLARE(apr_status_t) apr_pool_create_unmanaged(apr_pool_t **newpool); #else #if APR_POOL_DEBUG #define apr_pool_create_core(newpool) \ apr_pool_create_unmanaged_ex_debug(newpool, NULL, NULL, \ APR_POOL__FILE_LINE__) #define apr_pool_create_unmanaged(newpool) \ apr_pool_create_unmanaged_ex_debug(newpool, NULL, NULL, \ APR_POOL__FILE_LINE__) #else #define apr_pool_create_core(newpool) \ apr_pool_create_unmanaged_ex(newpool, NULL, NULL) #define apr_pool_create_unmanaged(newpool) \ apr_pool_create_unmanaged_ex(newpool, NULL, NULL) #endif #endif /** * Find the pool's allocator * @param pool The pool to get the allocator from. */ APR_DECLARE(apr_allocator_t *) apr_pool_allocator_get(apr_pool_t *pool); /** * Clear all memory in the pool and run all the cleanups. This also destroys all * subpools. * @param p The pool to clear * @remark This does not actually free the memory, it just allows the pool * to re-use this memory for the next allocation. * @see apr_pool_destroy() */ APR_DECLARE(void) apr_pool_clear(apr_pool_t *p); /** * Debug version of apr_pool_clear. * @param p See: apr_pool_clear. * @param file_line Where the function is called from. * This is usually APR_POOL__FILE_LINE__. * @remark Only available when APR_POOL_DEBUG is defined. * Call this directly if you have you apr_pool_clear * calls in a wrapper function and wish to override * the file_line argument to reflect the caller of * your wrapper function. If you do not have * apr_pool_clear in a wrapper, trust the macro * and don't call apr_pool_destroy_clear directly. */ APR_DECLARE(void) apr_pool_clear_debug(apr_pool_t *p, const char *file_line); #if APR_POOL_DEBUG #define apr_pool_clear(p) \ apr_pool_clear_debug(p, APR_POOL__FILE_LINE__) #endif /** * Destroy the pool. This takes similar action as apr_pool_clear() and then * frees all the memory. * @param p The pool to destroy * @remark This will actually free the memory */ APR_DECLARE(void) apr_pool_destroy(apr_pool_t *p); /** * Debug version of apr_pool_destroy. * @param p See: apr_pool_destroy. * @param file_line Where the function is called from. * This is usually APR_POOL__FILE_LINE__. * @remark Only available when APR_POOL_DEBUG is defined. * Call this directly if you have you apr_pool_destroy * calls in a wrapper function and wish to override * the file_line argument to reflect the caller of * your wrapper function. If you do not have * apr_pool_destroy in a wrapper, trust the macro * and don't call apr_pool_destroy_debug directly. */ APR_DECLARE(void) apr_pool_destroy_debug(apr_pool_t *p, const char *file_line); #if APR_POOL_DEBUG #define apr_pool_destroy(p) \ apr_pool_destroy_debug(p, APR_POOL__FILE_LINE__) #endif /* * Memory allocation */ /** * Allocate a block of memory from a pool * @param p The pool to allocate from * @param size The amount of memory to allocate * @return The allocated memory */ APR_DECLARE(void *) apr_palloc(apr_pool_t *p, apr_size_t size); /** * Debug version of apr_palloc * @param p See: apr_palloc * @param size See: apr_palloc * @param file_line Where the function is called from. * This is usually APR_POOL__FILE_LINE__. * @return See: apr_palloc */ APR_DECLARE(void *) apr_palloc_debug(apr_pool_t *p, apr_size_t size, const char *file_line); #if APR_POOL_DEBUG #define apr_palloc(p, size) \ apr_palloc_debug(p, size, APR_POOL__FILE_LINE__) #endif /** * Allocate a block of memory from a pool and set all of the memory to 0 * @param p The pool to allocate from * @param size The amount of memory to allocate * @return The allocated memory */ #if defined(DOXYGEN) APR_DECLARE(void *) apr_pcalloc(apr_pool_t *p, apr_size_t size); #elif !APR_POOL_DEBUG #define apr_pcalloc(p, size) memset(apr_palloc(p, size), 0, size) #endif /** * Debug version of apr_pcalloc * @param p See: apr_pcalloc * @param size See: apr_pcalloc * @param file_line Where the function is called from. * This is usually APR_POOL__FILE_LINE__. * @return See: apr_pcalloc */ APR_DECLARE(void *) apr_pcalloc_debug(apr_pool_t *p, apr_size_t size, const char *file_line); #if APR_POOL_DEBUG #define apr_pcalloc(p, size) \ apr_pcalloc_debug(p, size, APR_POOL__FILE_LINE__) #endif /* * Pool Properties */ /** * Set the function to be called when an allocation failure occurs. * @remark If the program wants APR to exit on a memory allocation error, * then this function can be called to set the callback to use (for * performing cleanup and then exiting). If this function is not called, * then APR will return an error and expect the calling program to * deal with the error accordingly. */ APR_DECLARE(void) apr_pool_abort_set(apr_abortfunc_t abortfunc, apr_pool_t *pool); /** * Get the abort function associated with the specified pool. * @param pool The pool for retrieving the abort function. * @return The abort function for the given pool. */ APR_DECLARE(apr_abortfunc_t) apr_pool_abort_get(apr_pool_t *pool); /** * Get the parent pool of the specified pool. * @param pool The pool for retrieving the parent pool. * @return The parent of the given pool. */ APR_DECLARE(apr_pool_t *) apr_pool_parent_get(apr_pool_t *pool); /** * Determine if pool a is an ancestor of pool b. * @param a The pool to search * @param b The pool to search for * @return True if a is an ancestor of b, NULL is considered an ancestor * of all pools. * @remark if compiled with APR_POOL_DEBUG, this function will also * return true if A is a pool which has been guaranteed by the caller * (using apr_pool_join) to have a lifetime at least as long as some * ancestor of pool B. */ APR_DECLARE(int) apr_pool_is_ancestor(apr_pool_t *a, apr_pool_t *b); /** * Tag a pool (give it a name) * @param pool The pool to tag * @param tag The tag */ APR_DECLARE(void) apr_pool_tag(apr_pool_t *pool, const char *tag); /* * User data management */ /** * Set the data associated with the current pool * @param data The user data associated with the pool. * @param key The key to use for association * @param cleanup The cleanup program to use to cleanup the data (NULL if none) * @param pool The current pool * @warning The data to be attached to the pool should have a life span * at least as long as the pool it is being attached to. * * Users of APR must take EXTREME care when choosing a key to * use for their data. It is possible to accidentally overwrite * data by choosing a key that another part of the program is using. * Therefore it is advised that steps are taken to ensure that unique * keys are used for all of the userdata objects in a particular pool * (the same key in two different pools or a pool and one of its * subpools is okay) at all times. Careful namespace prefixing of * key names is a typical way to help ensure this uniqueness. * */ APR_DECLARE(apr_status_t) apr_pool_userdata_set( const void *data, const char *key, apr_status_t (*cleanup)(void *), apr_pool_t *pool); /** * Set the data associated with the current pool * @param data The user data associated with the pool. * @param key The key to use for association * @param cleanup The cleanup program to use to cleanup the data (NULL if none) * @param pool The current pool * @note same as apr_pool_userdata_set(), except that this version doesn't * make a copy of the key (this function is useful, for example, when * the key is a string literal) * @warning This should NOT be used if the key could change addresses by * any means between the apr_pool_userdata_setn() call and a * subsequent apr_pool_userdata_get() on that key, such as if a * static string is used as a userdata key in a DSO and the DSO could * be unloaded and reloaded between the _setn() and the _get(). You * MUST use apr_pool_userdata_set() in such cases. * @warning More generally, the key and the data to be attached to the * pool should have a life span at least as long as the pool itself. * */ APR_DECLARE(apr_status_t) apr_pool_userdata_setn( const void *data, const char *key, apr_status_t (*cleanup)(void *), apr_pool_t *pool); /** * Return the data associated with the current pool. * @param data The user data associated with the pool. * @param key The key for the data to retrieve * @param pool The current pool. */ APR_DECLARE(apr_status_t) apr_pool_userdata_get(void **data, const char *key, apr_pool_t *pool); /** * @defgroup PoolCleanup Pool Cleanup Functions * * Cleanups are performed in the reverse order they were registered. That is: * Last In, First Out. A cleanup function can safely allocate memory from * the pool that is being cleaned up. It can also safely register additional * cleanups which will be run LIFO, directly after the current cleanup * terminates. Cleanups have to take caution in calling functions that * create subpools. Subpools, created during cleanup will NOT automatically * be cleaned up. In other words, cleanups are to clean up after themselves. * * @{ */ /** * Register a function to be called when a pool is cleared or destroyed * @param p The pool register the cleanup with * @param data The data to pass to the cleanup function. * @param plain_cleanup The function to call when the pool is cleared * or destroyed * @param child_cleanup The function to call when a child process is about * to exec - this function is called in the child, obviously! */ APR_DECLARE(void) apr_pool_cleanup_register( apr_pool_t *p, const void *data, apr_status_t (*plain_cleanup)(void *), apr_status_t (*child_cleanup)(void *)); /** * Register a function to be called when a pool is cleared or destroyed. * * Unlike apr_pool_cleanup_register which register a cleanup * that is called AFTER all subpools are destroyed this function register * a function that will be called before any of the subpool is destoryed. * * @param p The pool register the cleanup with * @param data The data to pass to the cleanup function. * @param plain_cleanup The function to call when the pool is cleared * or destroyed */ APR_DECLARE(void) apr_pool_pre_cleanup_register( apr_pool_t *p, const void *data, apr_status_t (*plain_cleanup)(void *)); /** * Remove a previously registered cleanup function. * * The cleanup most recently registered with @a p having the same values of * @a data and @a cleanup will be removed. * * @param p The pool to remove the cleanup from * @param data The data of the registered cleanup * @param cleanup The function to remove from cleanup * @remarks For some strange reason only the plain_cleanup is handled by this * function */ APR_DECLARE(void) apr_pool_cleanup_kill(apr_pool_t *p, const void *data, apr_status_t (*cleanup)(void *)); /** * Replace the child cleanup function of a previously registered cleanup. * * The cleanup most recently registered with @a p having the same values of * @a data and @a plain_cleanup will have the registered child cleanup * function replaced with @a child_cleanup. * * @param p The pool of the registered cleanup * @param data The data of the registered cleanup * @param plain_cleanup The plain cleanup function of the registered cleanup * @param child_cleanup The function to register as the child cleanup */ APR_DECLARE(void) apr_pool_child_cleanup_set( apr_pool_t *p, const void *data, apr_status_t (*plain_cleanup)(void *), apr_status_t (*child_cleanup)(void *)); /** * Run the specified cleanup function immediately and unregister it. * * The cleanup most recently registered with @a p having the same values of * @a data and @a cleanup will be removed and @a cleanup will be called * with @a data as the argument. * * @param p The pool to remove the cleanup from * @param data The data to remove from cleanup * @param cleanup The function to remove from cleanup */ APR_DECLARE(apr_status_t) apr_pool_cleanup_run( apr_pool_t *p, void *data, apr_status_t (*cleanup)(void *)); /** * An empty cleanup function. * * Passed to apr_pool_cleanup_register() when no cleanup is required. * * @param data The data to cleanup, will not be used by this function. */ APR_DECLARE_NONSTD(apr_status_t) apr_pool_cleanup_null(void *data); /** * Run all registered child cleanups, in preparation for an exec() * call in a forked child -- close files, etc., but *don't* flush I/O * buffers, *don't* wait for subprocesses, and *don't* free any * memory. */ APR_DECLARE(void) apr_pool_cleanup_for_exec(void); /** @} */ /** * @defgroup PoolDebug Pool Debugging functions. * * pools have nested lifetimes -- sub_pools are destroyed when the * parent pool is cleared. We allow certain liberties with operations * on things such as tables (and on other structures in a more general * sense) where we allow the caller to insert values into a table which * were not allocated from the table's pool. The table's data will * remain valid as long as all the pools from which its values are * allocated remain valid. * * For example, if B is a sub pool of A, and you build a table T in * pool B, then it's safe to insert data allocated in A or B into T * (because B lives at most as long as A does, and T is destroyed when * B is cleared/destroyed). On the other hand, if S is a table in * pool A, it is safe to insert data allocated in A into S, but it * is *not safe* to insert data allocated from B into S... because * B can be cleared/destroyed before A is (which would leave dangling * pointers in T's data structures). * * In general we say that it is safe to insert data into a table T * if the data is allocated in any ancestor of T's pool. This is the * basis on which the APR_POOL_DEBUG code works -- it tests these ancestor * relationships for all data inserted into tables. APR_POOL_DEBUG also * provides tools (apr_pool_find, and apr_pool_is_ancestor) for other * folks to implement similar restrictions for their own data * structures. * * However, sometimes this ancestor requirement is inconvenient -- * sometimes it's necessary to create a sub pool where the sub pool is * guaranteed to have the same lifetime as the parent pool. This is a * guarantee implemented by the *caller*, not by the pool code. That * is, the caller guarantees they won't destroy the sub pool * individually prior to destroying the parent pool. * * In this case the caller must call apr_pool_join() to indicate this * guarantee to the APR_POOL_DEBUG code. * * These functions are only implemented when #APR_POOL_DEBUG is set. * * @{ */ #if APR_POOL_DEBUG || defined(DOXYGEN) /** * Guarantee that a subpool has the same lifetime as the parent. * @param p The parent pool * @param sub The subpool */ APR_DECLARE(void) apr_pool_join(apr_pool_t *p, apr_pool_t *sub); /** * Find a pool from something allocated in it. * @param mem The thing allocated in the pool * @return The pool it is allocated in */ APR_DECLARE(apr_pool_t *) apr_pool_find(const void *mem); /** * Report the number of bytes currently in the pool * @param p The pool to inspect * @param recurse Recurse/include the subpools' sizes * @return The number of bytes */ APR_DECLARE(apr_size_t) apr_pool_num_bytes(apr_pool_t *p, int recurse); /** * Lock a pool * @param pool The pool to lock * @param flag The flag */ APR_DECLARE(void) apr_pool_lock(apr_pool_t *pool, int flag); /* @} */ #else /* APR_POOL_DEBUG or DOXYGEN */ #ifdef apr_pool_join #undef apr_pool_join #endif #define apr_pool_join(a,b) #ifdef apr_pool_lock #undef apr_pool_lock #endif #define apr_pool_lock(pool, lock) #endif /* APR_POOL_DEBUG or DOXYGEN */ /** @} */ #ifdef __cplusplus } #endif #endif /* !APR_POOLS_H */ 0707010001f168000081a4000017820000044e000000014b1d38c70000d3200000022d0000016a00000000000000000000002000000000reloc/include/apr-1/apr_errno.h /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef APR_ERRNO_H #define APR_ERRNO_H /** * @file apr_errno.h * @brief APR Error Codes */ #include "apr.h" #if APR_HAVE_ERRNO_H #include
* The following attempts to show the relation of the various constants * used for mapping APR Status codes. * * 0 * * 20,000 APR_OS_START_ERROR * * + APR_OS_ERRSPACE_SIZE (50,000) * * 70,000 APR_OS_START_STATUS * * + APR_OS_ERRSPACE_SIZE - APR_UTIL_ERRSPACE_SIZE (30,000) * * 100,000 APR_UTIL_START_STATUS * * + APR_UTIL_ERRSPACE_SIZE (20,000) * * 120,000 APR_OS_START_USERERR * * + 10 x APR_OS_ERRSPACE_SIZE (50,000 * 10) * * 620,000 APR_OS_START_CANONERR * * + APR_OS_ERRSPACE_SIZE (50,000) * * 670,000 APR_OS_START_EAIERR * * + APR_OS_ERRSPACE_SIZE (50,000) * * 720,000 APR_OS_START_SYSERR * **/ /** no error. */ #define APR_SUCCESS 0 /** * @defgroup APR_Error APR Error Values *
* APR ERROR VALUES * APR_ENOSTAT APR was unable to perform a stat on the file * APR_ENOPOOL APR was not provided a pool with which to allocate memory * APR_EBADDATE APR was given an invalid date * APR_EINVALSOCK APR was given an invalid socket * APR_ENOPROC APR was not given a process structure * APR_ENOTIME APR was not given a time structure * APR_ENODIR APR was not given a directory structure * APR_ENOLOCK APR was not given a lock structure * APR_ENOPOLL APR was not given a poll structure * APR_ENOSOCKET APR was not given a socket * APR_ENOTHREAD APR was not given a thread structure * APR_ENOTHDKEY APR was not given a thread key structure * APR_ENOSHMAVAIL There is no more shared memory available * APR_EDSOOPEN APR was unable to open the dso object. For more * information call apr_dso_error(). * APR_EGENERAL General failure (specific information not available) * APR_EBADIP The specified IP address is invalid * APR_EBADMASK The specified netmask is invalid * APR_ESYMNOTFOUND Could not find the requested symbol * APR_ENOTENOUGHENTROPY Not enough entropy to continue ** *
* APR STATUS VALUES * APR_INCHILD Program is currently executing in the child * APR_INPARENT Program is currently executing in the parent * APR_DETACH The thread is detached * APR_NOTDETACH The thread is not detached * APR_CHILD_DONE The child has finished executing * APR_CHILD_NOTDONE The child has not finished executing * APR_TIMEUP The operation did not finish before the timeout * APR_INCOMPLETE The operation was incomplete although some processing * was performed and the results are partially valid * APR_BADCH Getopt found an option not in the option string * APR_BADARG Getopt found an option that is missing an argument * and an argument was specified in the option string * APR_EOF APR has encountered the end of the file * APR_NOTFOUND APR was unable to find the socket in the poll structure * APR_ANONYMOUS APR is using anonymous shared memory * APR_FILEBASED APR is using a file name as the key to the shared memory * APR_KEYBASED APR is using a shared key as the key to the shared memory * APR_EINIT Ininitalizer value. If no option has been found, but * the status variable requires a value, this should be used * APR_ENOTIMPL The APR function has not been implemented on this * platform, either because nobody has gotten to it yet, * or the function is impossible on this platform. * APR_EMISMATCH Two passwords do not match. * APR_EABSOLUTE The given path was absolute. * APR_ERELATIVE The given path was relative. * APR_EINCOMPLETE The given path was neither relative nor absolute. * APR_EABOVEROOT The given path was above the root path. * APR_EBUSY The given lock was busy. * APR_EPROC_UNKNOWN The given process wasn't recognized by APR ** @{ */ /** @see APR_STATUS_IS_ENOSTAT */ #define APR_ENOSTAT (APR_OS_START_ERROR + 1) /** @see APR_STATUS_IS_ENOPOOL */ #define APR_ENOPOOL (APR_OS_START_ERROR + 2) /* empty slot: +3 */ /** @see APR_STATUS_IS_EBADDATE */ #define APR_EBADDATE (APR_OS_START_ERROR + 4) /** @see APR_STATUS_IS_EINVALSOCK */ #define APR_EINVALSOCK (APR_OS_START_ERROR + 5) /** @see APR_STATUS_IS_ENOPROC */ #define APR_ENOPROC (APR_OS_START_ERROR + 6) /** @see APR_STATUS_IS_ENOTIME */ #define APR_ENOTIME (APR_OS_START_ERROR + 7) /** @see APR_STATUS_IS_ENODIR */ #define APR_ENODIR (APR_OS_START_ERROR + 8) /** @see APR_STATUS_IS_ENOLOCK */ #define APR_ENOLOCK (APR_OS_START_ERROR + 9) /** @see APR_STATUS_IS_ENOPOLL */ #define APR_ENOPOLL (APR_OS_START_ERROR + 10) /** @see APR_STATUS_IS_ENOSOCKET */ #define APR_ENOSOCKET (APR_OS_START_ERROR + 11) /** @see APR_STATUS_IS_ENOTHREAD */ #define APR_ENOTHREAD (APR_OS_START_ERROR + 12) /** @see APR_STATUS_IS_ENOTHDKEY */ #define APR_ENOTHDKEY (APR_OS_START_ERROR + 13) /** @see APR_STATUS_IS_EGENERAL */ #define APR_EGENERAL (APR_OS_START_ERROR + 14) /** @see APR_STATUS_IS_ENOSHMAVAIL */ #define APR_ENOSHMAVAIL (APR_OS_START_ERROR + 15) /** @see APR_STATUS_IS_EBADIP */ #define APR_EBADIP (APR_OS_START_ERROR + 16) /** @see APR_STATUS_IS_EBADMASK */ #define APR_EBADMASK (APR_OS_START_ERROR + 17) /* empty slot: +18 */ /** @see APR_STATUS_IS_EDSOPEN */ #define APR_EDSOOPEN (APR_OS_START_ERROR + 19) /** @see APR_STATUS_IS_EABSOLUTE */ #define APR_EABSOLUTE (APR_OS_START_ERROR + 20) /** @see APR_STATUS_IS_ERELATIVE */ #define APR_ERELATIVE (APR_OS_START_ERROR + 21) /** @see APR_STATUS_IS_EINCOMPLETE */ #define APR_EINCOMPLETE (APR_OS_START_ERROR + 22) /** @see APR_STATUS_IS_EABOVEROOT */ #define APR_EABOVEROOT (APR_OS_START_ERROR + 23) /** @see APR_STATUS_IS_EBADPATH */ #define APR_EBADPATH (APR_OS_START_ERROR + 24) /** @see APR_STATUS_IS_EPATHWILD */ #define APR_EPATHWILD (APR_OS_START_ERROR + 25) /** @see APR_STATUS_IS_ESYMNOTFOUND */ #define APR_ESYMNOTFOUND (APR_OS_START_ERROR + 26) /** @see APR_STATUS_IS_EPROC_UNKNOWN */ #define APR_EPROC_UNKNOWN (APR_OS_START_ERROR + 27) /** @see APR_STATUS_IS_ENOTENOUGHENTROPY */ #define APR_ENOTENOUGHENTROPY (APR_OS_START_ERROR + 28) /** @} */ /** * @defgroup APR_STATUS_IS Status Value Tests * @warning For any particular error condition, more than one of these tests * may match. This is because platform-specific error codes may not * always match the semantics of the POSIX codes these tests (and the * corresponding APR error codes) are named after. A notable example * are the APR_STATUS_IS_ENOENT and APR_STATUS_IS_ENOTDIR tests on * Win32 platforms. The programmer should always be aware of this and * adjust the order of the tests accordingly. * @{ */ /** * APR was unable to perform a stat on the file * @warning always use this test, as platform-specific variances may meet this * more than one error code */ #define APR_STATUS_IS_ENOSTAT(s) ((s) == APR_ENOSTAT) /** * APR was not provided a pool with which to allocate memory * @warning always use this test, as platform-specific variances may meet this * more than one error code */ #define APR_STATUS_IS_ENOPOOL(s) ((s) == APR_ENOPOOL) /** APR was given an invalid date */ #define APR_STATUS_IS_EBADDATE(s) ((s) == APR_EBADDATE) /** APR was given an invalid socket */ #define APR_STATUS_IS_EINVALSOCK(s) ((s) == APR_EINVALSOCK) /** APR was not given a process structure */ #define APR_STATUS_IS_ENOPROC(s) ((s) == APR_ENOPROC) /** APR was not given a time structure */ #define APR_STATUS_IS_ENOTIME(s) ((s) == APR_ENOTIME) /** APR was not given a directory structure */ #define APR_STATUS_IS_ENODIR(s) ((s) == APR_ENODIR) /** APR was not given a lock structure */ #define APR_STATUS_IS_ENOLOCK(s) ((s) == APR_ENOLOCK) /** APR was not given a poll structure */ #define APR_STATUS_IS_ENOPOLL(s) ((s) == APR_ENOPOLL) /** APR was not given a socket */ #define APR_STATUS_IS_ENOSOCKET(s) ((s) == APR_ENOSOCKET) /** APR was not given a thread structure */ #define APR_STATUS_IS_ENOTHREAD(s) ((s) == APR_ENOTHREAD) /** APR was not given a thread key structure */ #define APR_STATUS_IS_ENOTHDKEY(s) ((s) == APR_ENOTHDKEY) /** Generic Error which can not be put into another spot */ #define APR_STATUS_IS_EGENERAL(s) ((s) == APR_EGENERAL) /** There is no more shared memory available */ #define APR_STATUS_IS_ENOSHMAVAIL(s) ((s) == APR_ENOSHMAVAIL) /** The specified IP address is invalid */ #define APR_STATUS_IS_EBADIP(s) ((s) == APR_EBADIP) /** The specified netmask is invalid */ #define APR_STATUS_IS_EBADMASK(s) ((s) == APR_EBADMASK) /* empty slot: +18 */ /** * APR was unable to open the dso object. * For more information call apr_dso_error(). */ #if defined(WIN32) #define APR_STATUS_IS_EDSOOPEN(s) ((s) == APR_EDSOOPEN \ || APR_TO_OS_ERROR(s) == ERROR_MOD_NOT_FOUND) #else #define APR_STATUS_IS_EDSOOPEN(s) ((s) == APR_EDSOOPEN) #endif /** The given path was absolute. */ #define APR_STATUS_IS_EABSOLUTE(s) ((s) == APR_EABSOLUTE) /** The given path was relative. */ #define APR_STATUS_IS_ERELATIVE(s) ((s) == APR_ERELATIVE) /** The given path was neither relative nor absolute. */ #define APR_STATUS_IS_EINCOMPLETE(s) ((s) == APR_EINCOMPLETE) /** The given path was above the root path. */ #define APR_STATUS_IS_EABOVEROOT(s) ((s) == APR_EABOVEROOT) /** The given path was bad. */ #define APR_STATUS_IS_EBADPATH(s) ((s) == APR_EBADPATH) /** The given path contained wildcards. */ #define APR_STATUS_IS_EPATHWILD(s) ((s) == APR_EPATHWILD) /** Could not find the requested symbol. * For more information call apr_dso_error(). */ #if defined(WIN32) #define APR_STATUS_IS_ESYMNOTFOUND(s) ((s) == APR_ESYMNOTFOUND \ || APR_TO_OS_ERROR(s) == ERROR_PROC_NOT_FOUND) #else #define APR_STATUS_IS_ESYMNOTFOUND(s) ((s) == APR_ESYMNOTFOUND) #endif /** The given process was not recognized by APR. */ #define APR_STATUS_IS_EPROC_UNKNOWN(s) ((s) == APR_EPROC_UNKNOWN) /** APR could not gather enough entropy to continue. */ #define APR_STATUS_IS_ENOTENOUGHENTROPY(s) ((s) == APR_ENOTENOUGHENTROPY) /** @} */ /** * @addtogroup APR_Error * @{ */ /** @see APR_STATUS_IS_INCHILD */ #define APR_INCHILD (APR_OS_START_STATUS + 1) /** @see APR_STATUS_IS_INPARENT */ #define APR_INPARENT (APR_OS_START_STATUS + 2) /** @see APR_STATUS_IS_DETACH */ #define APR_DETACH (APR_OS_START_STATUS + 3) /** @see APR_STATUS_IS_NOTDETACH */ #define APR_NOTDETACH (APR_OS_START_STATUS + 4) /** @see APR_STATUS_IS_CHILD_DONE */ #define APR_CHILD_DONE (APR_OS_START_STATUS + 5) /** @see APR_STATUS_IS_CHILD_NOTDONE */ #define APR_CHILD_NOTDONE (APR_OS_START_STATUS + 6) /** @see APR_STATUS_IS_TIMEUP */ #define APR_TIMEUP (APR_OS_START_STATUS + 7) /** @see APR_STATUS_IS_INCOMPLETE */ #define APR_INCOMPLETE (APR_OS_START_STATUS + 8) /* empty slot: +9 */ /* empty slot: +10 */ /* empty slot: +11 */ /** @see APR_STATUS_IS_BADCH */ #define APR_BADCH (APR_OS_START_STATUS + 12) /** @see APR_STATUS_IS_BADARG */ #define APR_BADARG (APR_OS_START_STATUS + 13) /** @see APR_STATUS_IS_EOF */ #define APR_EOF (APR_OS_START_STATUS + 14) /** @see APR_STATUS_IS_NOTFOUND */ #define APR_NOTFOUND (APR_OS_START_STATUS + 15) /* empty slot: +16 */ /* empty slot: +17 */ /* empty slot: +18 */ /** @see APR_STATUS_IS_ANONYMOUS */ #define APR_ANONYMOUS (APR_OS_START_STATUS + 19) /** @see APR_STATUS_IS_FILEBASED */ #define APR_FILEBASED (APR_OS_START_STATUS + 20) /** @see APR_STATUS_IS_KEYBASED */ #define APR_KEYBASED (APR_OS_START_STATUS + 21) /** @see APR_STATUS_IS_EINIT */ #define APR_EINIT (APR_OS_START_STATUS + 22) /** @see APR_STATUS_IS_ENOTIMPL */ #define APR_ENOTIMPL (APR_OS_START_STATUS + 23) /** @see APR_STATUS_IS_EMISMATCH */ #define APR_EMISMATCH (APR_OS_START_STATUS + 24) /** @see APR_STATUS_IS_EBUSY */ #define APR_EBUSY (APR_OS_START_STATUS + 25) /** @} */ /** * @addtogroup APR_STATUS_IS * @{ */ /** * Program is currently executing in the child * @warning * always use this test, as platform-specific variances may meet this * more than one error code */ #define APR_STATUS_IS_INCHILD(s) ((s) == APR_INCHILD) /** * Program is currently executing in the parent * @warning * always use this test, as platform-specific variances may meet this * more than one error code */ #define APR_STATUS_IS_INPARENT(s) ((s) == APR_INPARENT) /** * The thread is detached * @warning * always use this test, as platform-specific variances may meet this * more than one error code */ #define APR_STATUS_IS_DETACH(s) ((s) == APR_DETACH) /** * The thread is not detached * @warning * always use this test, as platform-specific variances may meet this * more than one error code */ #define APR_STATUS_IS_NOTDETACH(s) ((s) == APR_NOTDETACH) /** * The child has finished executing * @warning * always use this test, as platform-specific variances may meet this * more than one error code */ #define APR_STATUS_IS_CHILD_DONE(s) ((s) == APR_CHILD_DONE) /** * The child has not finished executing * @warning * always use this test, as platform-specific variances may meet this * more than one error code */ #define APR_STATUS_IS_CHILD_NOTDONE(s) ((s) == APR_CHILD_NOTDONE) /** * The operation did not finish before the timeout * @warning * always use this test, as platform-specific variances may meet this * more than one error code */ #define APR_STATUS_IS_TIMEUP(s) ((s) == APR_TIMEUP) /** * The operation was incomplete although some processing was performed * and the results are partially valid. * @warning * always use this test, as platform-specific variances may meet this * more than one error code */ #define APR_STATUS_IS_INCOMPLETE(s) ((s) == APR_INCOMPLETE) /* empty slot: +9 */ /* empty slot: +10 */ /* empty slot: +11 */ /** * Getopt found an option not in the option string * @warning * always use this test, as platform-specific variances may meet this * more than one error code */ #define APR_STATUS_IS_BADCH(s) ((s) == APR_BADCH) /** * Getopt found an option not in the option string and an argument was * specified in the option string * @warning * always use this test, as platform-specific variances may meet this * more than one error code */ #define APR_STATUS_IS_BADARG(s) ((s) == APR_BADARG) /** * APR has encountered the end of the file * @warning * always use this test, as platform-specific variances may meet this * more than one error code */ #define APR_STATUS_IS_EOF(s) ((s) == APR_EOF) /** * APR was unable to find the socket in the poll structure * @warning * always use this test, as platform-specific variances may meet this * more than one error code */ #define APR_STATUS_IS_NOTFOUND(s) ((s) == APR_NOTFOUND) /* empty slot: +16 */ /* empty slot: +17 */ /* empty slot: +18 */ /** * APR is using anonymous shared memory * @warning * always use this test, as platform-specific variances may meet this * more than one error code */ #define APR_STATUS_IS_ANONYMOUS(s) ((s) == APR_ANONYMOUS) /** * APR is using a file name as the key to the shared memory * @warning * always use this test, as platform-specific variances may meet this * more than one error code */ #define APR_STATUS_IS_FILEBASED(s) ((s) == APR_FILEBASED) /** * APR is using a shared key as the key to the shared memory * @warning * always use this test, as platform-specific variances may meet this * more than one error code */ #define APR_STATUS_IS_KEYBASED(s) ((s) == APR_KEYBASED) /** * Ininitalizer value. If no option has been found, but * the status variable requires a value, this should be used * @warning * always use this test, as platform-specific variances may meet this * more than one error code */ #define APR_STATUS_IS_EINIT(s) ((s) == APR_EINIT) /** * The APR function has not been implemented on this * platform, either because nobody has gotten to it yet, * or the function is impossible on this platform. * @warning * always use this test, as platform-specific variances may meet this * more than one error code */ #define APR_STATUS_IS_ENOTIMPL(s) ((s) == APR_ENOTIMPL) /** * Two passwords do not match. * @warning * always use this test, as platform-specific variances may meet this * more than one error code */ #define APR_STATUS_IS_EMISMATCH(s) ((s) == APR_EMISMATCH) /** * The given lock was busy * @warning always use this test, as platform-specific variances may meet this * more than one error code */ #define APR_STATUS_IS_EBUSY(s) ((s) == APR_EBUSY) /** @} */ /** * @addtogroup APR_Error APR Error Values * @{ */ /* APR CANONICAL ERROR VALUES */ /** @see APR_STATUS_IS_EACCES */ #ifdef EACCES #define APR_EACCES EACCES #else #define APR_EACCES (APR_OS_START_CANONERR + 1) #endif /** @see APR_STATUS_IS_EEXIST */ #ifdef EEXIST #define APR_EEXIST EEXIST #else #define APR_EEXIST (APR_OS_START_CANONERR + 2) #endif /** @see APR_STATUS_IS_ENAMETOOLONG */ #ifdef ENAMETOOLONG #define APR_ENAMETOOLONG ENAMETOOLONG #else #define APR_ENAMETOOLONG (APR_OS_START_CANONERR + 3) #endif /** @see APR_STATUS_IS_ENOENT */ #ifdef ENOENT #define APR_ENOENT ENOENT #else #define APR_ENOENT (APR_OS_START_CANONERR + 4) #endif /** @see APR_STATUS_IS_ENOTDIR */ #ifdef ENOTDIR #define APR_ENOTDIR ENOTDIR #else #define APR_ENOTDIR (APR_OS_START_CANONERR + 5) #endif /** @see APR_STATUS_IS_ENOSPC */ #ifdef ENOSPC #define APR_ENOSPC ENOSPC #else #define APR_ENOSPC (APR_OS_START_CANONERR + 6) #endif /** @see APR_STATUS_IS_ENOMEM */ #ifdef ENOMEM #define APR_ENOMEM ENOMEM #else #define APR_ENOMEM (APR_OS_START_CANONERR + 7) #endif /** @see APR_STATUS_IS_EMFILE */ #ifdef EMFILE #define APR_EMFILE EMFILE #else #define APR_EMFILE (APR_OS_START_CANONERR + 8) #endif /** @see APR_STATUS_IS_ENFILE */ #ifdef ENFILE #define APR_ENFILE ENFILE #else #define APR_ENFILE (APR_OS_START_CANONERR + 9) #endif /** @see APR_STATUS_IS_EBADF */ #ifdef EBADF #define APR_EBADF EBADF #else #define APR_EBADF (APR_OS_START_CANONERR + 10) #endif /** @see APR_STATUS_IS_EINVAL */ #ifdef EINVAL #define APR_EINVAL EINVAL #else #define APR_EINVAL (APR_OS_START_CANONERR + 11) #endif /** @see APR_STATUS_IS_ESPIPE */ #ifdef ESPIPE #define APR_ESPIPE ESPIPE #else #define APR_ESPIPE (APR_OS_START_CANONERR + 12) #endif /** * @see APR_STATUS_IS_EAGAIN * @warning use APR_STATUS_IS_EAGAIN instead of just testing this value */ #ifdef EAGAIN #define APR_EAGAIN EAGAIN #elif defined(EWOULDBLOCK) #define APR_EAGAIN EWOULDBLOCK #else #define APR_EAGAIN (APR_OS_START_CANONERR + 13) #endif /** @see APR_STATUS_IS_EINTR */ #ifdef EINTR #define APR_EINTR EINTR #else #define APR_EINTR (APR_OS_START_CANONERR + 14) #endif /** @see APR_STATUS_IS_ENOTSOCK */ #ifdef ENOTSOCK #define APR_ENOTSOCK ENOTSOCK #else #define APR_ENOTSOCK (APR_OS_START_CANONERR + 15) #endif /** @see APR_STATUS_IS_ECONNREFUSED */ #ifdef ECONNREFUSED #define APR_ECONNREFUSED ECONNREFUSED #else #define APR_ECONNREFUSED (APR_OS_START_CANONERR + 16) #endif /** @see APR_STATUS_IS_EINPROGRESS */ #ifdef EINPROGRESS #define APR_EINPROGRESS EINPROGRESS #else #define APR_EINPROGRESS (APR_OS_START_CANONERR + 17) #endif /** * @see APR_STATUS_IS_ECONNABORTED * @warning use APR_STATUS_IS_ECONNABORTED instead of just testing this value */ #ifdef ECONNABORTED #define APR_ECONNABORTED ECONNABORTED #else #define APR_ECONNABORTED (APR_OS_START_CANONERR + 18) #endif /** @see APR_STATUS_IS_ECONNRESET */ #ifdef ECONNRESET #define APR_ECONNRESET ECONNRESET #else #define APR_ECONNRESET (APR_OS_START_CANONERR + 19) #endif /** @see APR_STATUS_IS_ETIMEDOUT * @deprecated */ #ifdef ETIMEDOUT #define APR_ETIMEDOUT ETIMEDOUT #else #define APR_ETIMEDOUT (APR_OS_START_CANONERR + 20) #endif /** @see APR_STATUS_IS_EHOSTUNREACH */ #ifdef EHOSTUNREACH #define APR_EHOSTUNREACH EHOSTUNREACH #else #define APR_EHOSTUNREACH (APR_OS_START_CANONERR + 21) #endif /** @see APR_STATUS_IS_ENETUNREACH */ #ifdef ENETUNREACH #define APR_ENETUNREACH ENETUNREACH #else #define APR_ENETUNREACH (APR_OS_START_CANONERR + 22) #endif /** @see APR_STATUS_IS_EFTYPE */ #ifdef EFTYPE #define APR_EFTYPE EFTYPE #else #define APR_EFTYPE (APR_OS_START_CANONERR + 23) #endif /** @see APR_STATUS_IS_EPIPE */ #ifdef EPIPE #define APR_EPIPE EPIPE #else #define APR_EPIPE (APR_OS_START_CANONERR + 24) #endif /** @see APR_STATUS_IS_EXDEV */ #ifdef EXDEV #define APR_EXDEV EXDEV #else #define APR_EXDEV (APR_OS_START_CANONERR + 25) #endif /** @see APR_STATUS_IS_ENOTEMPTY */ #ifdef ENOTEMPTY #define APR_ENOTEMPTY ENOTEMPTY #else #define APR_ENOTEMPTY (APR_OS_START_CANONERR + 26) #endif /** @see APR_STATUS_IS_EAFNOSUPPORT */ #ifdef EAFNOSUPPORT #define APR_EAFNOSUPPORT EAFNOSUPPORT #else #define APR_EAFNOSUPPORT (APR_OS_START_CANONERR + 27) #endif /** @} */ #if defined(OS2) && !defined(DOXYGEN) #define APR_FROM_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e + APR_OS_START_SYSERR) #define APR_TO_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e - APR_OS_START_SYSERR) #define INCL_DOSERRORS #define INCL_DOS /* Leave these undefined. * OS2 doesn't rely on the errno concept. * The API calls always return a result codes which * should be filtered through APR_FROM_OS_ERROR(). * * #define apr_get_os_error() (APR_FROM_OS_ERROR(GetLastError())) * #define apr_set_os_error(e) (SetLastError(APR_TO_OS_ERROR(e))) */ /* A special case, only socket calls require this; */ #define apr_get_netos_error() (APR_FROM_OS_ERROR(errno)) #define apr_set_netos_error(e) (errno = APR_TO_OS_ERROR(e)) /* And this needs to be greped away for good: */ #define APR_OS2_STATUS(e) (APR_FROM_OS_ERROR(e)) /* These can't sit in a private header, so in spite of the extra size, * they need to be made available here. */ #define SOCBASEERR 10000 #define SOCEPERM (SOCBASEERR+1) /* Not owner */ #define SOCESRCH (SOCBASEERR+3) /* No such process */ #define SOCEINTR (SOCBASEERR+4) /* Interrupted system call */ #define SOCENXIO (SOCBASEERR+6) /* No such device or address */ #define SOCEBADF (SOCBASEERR+9) /* Bad file number */ #define SOCEACCES (SOCBASEERR+13) /* Permission denied */ #define SOCEFAULT (SOCBASEERR+14) /* Bad address */ #define SOCEINVAL (SOCBASEERR+22) /* Invalid argument */ #define SOCEMFILE (SOCBASEERR+24) /* Too many open files */ #define SOCEPIPE (SOCBASEERR+32) /* Broken pipe */ #define SOCEOS2ERR (SOCBASEERR+100) /* OS/2 Error */ #define SOCEWOULDBLOCK (SOCBASEERR+35) /* Operation would block */ #define SOCEINPROGRESS (SOCBASEERR+36) /* Operation now in progress */ #define SOCEALREADY (SOCBASEERR+37) /* Operation already in progress */ #define SOCENOTSOCK (SOCBASEERR+38) /* Socket operation on non-socket */ #define SOCEDESTADDRREQ (SOCBASEERR+39) /* Destination address required */ #define SOCEMSGSIZE (SOCBASEERR+40) /* Message too long */ #define SOCEPROTOTYPE (SOCBASEERR+41) /* Protocol wrong type for socket */ #define SOCENOPROTOOPT (SOCBASEERR+42) /* Protocol not available */ #define SOCEPROTONOSUPPORT (SOCBASEERR+43) /* Protocol not supported */ #define SOCESOCKTNOSUPPORT (SOCBASEERR+44) /* Socket type not supported */ #define SOCEOPNOTSUPP (SOCBASEERR+45) /* Operation not supported on socket */ #define SOCEPFNOSUPPORT (SOCBASEERR+46) /* Protocol family not supported */ #define SOCEAFNOSUPPORT (SOCBASEERR+47) /* Address family not supported by protocol family */ #define SOCEADDRINUSE (SOCBASEERR+48) /* Address already in use */ #define SOCEADDRNOTAVAIL (SOCBASEERR+49) /* Can't assign requested address */ #define SOCENETDOWN (SOCBASEERR+50) /* Network is down */ #define SOCENETUNREACH (SOCBASEERR+51) /* Network is unreachable */ #define SOCENETRESET (SOCBASEERR+52) /* Network dropped connection on reset */ #define SOCECONNABORTED (SOCBASEERR+53) /* Software caused connection abort */ #define SOCECONNRESET (SOCBASEERR+54) /* Connection reset by peer */ #define SOCENOBUFS (SOCBASEERR+55) /* No buffer space available */ #define SOCEISCONN (SOCBASEERR+56) /* Socket is already connected */ #define SOCENOTCONN (SOCBASEERR+57) /* Socket is not connected */ #define SOCESHUTDOWN (SOCBASEERR+58) /* Can't send after socket shutdown */ #define SOCETOOMANYREFS (SOCBASEERR+59) /* Too many references: can't splice */ #define SOCETIMEDOUT (SOCBASEERR+60) /* Connection timed out */ #define SOCECONNREFUSED (SOCBASEERR+61) /* Connection refused */ #define SOCELOOP (SOCBASEERR+62) /* Too many levels of symbolic links */ #define SOCENAMETOOLONG (SOCBASEERR+63) /* File name too long */ #define SOCEHOSTDOWN (SOCBASEERR+64) /* Host is down */ #define SOCEHOSTUNREACH (SOCBASEERR+65) /* No route to host */ #define SOCENOTEMPTY (SOCBASEERR+66) /* Directory not empty */ /* APR CANONICAL ERROR TESTS */ #define APR_STATUS_IS_EACCES(s) ((s) == APR_EACCES \ || (s) == APR_OS_START_SYSERR + ERROR_ACCESS_DENIED \ || (s) == APR_OS_START_SYSERR + ERROR_SHARING_VIOLATION) #define APR_STATUS_IS_EEXIST(s) ((s) == APR_EEXIST \ || (s) == APR_OS_START_SYSERR + ERROR_OPEN_FAILED \ || (s) == APR_OS_START_SYSERR + ERROR_FILE_EXISTS \ || (s) == APR_OS_START_SYSERR + ERROR_ALREADY_EXISTS \ || (s) == APR_OS_START_SYSERR + ERROR_ACCESS_DENIED) #define APR_STATUS_IS_ENAMETOOLONG(s) ((s) == APR_ENAMETOOLONG \ || (s) == APR_OS_START_SYSERR + ERROR_FILENAME_EXCED_RANGE \ || (s) == APR_OS_START_SYSERR + SOCENAMETOOLONG) #define APR_STATUS_IS_ENOENT(s) ((s) == APR_ENOENT \ || (s) == APR_OS_START_SYSERR + ERROR_FILE_NOT_FOUND \ || (s) == APR_OS_START_SYSERR + ERROR_PATH_NOT_FOUND \ || (s) == APR_OS_START_SYSERR + ERROR_NO_MORE_FILES \ || (s) == APR_OS_START_SYSERR + ERROR_OPEN_FAILED) #define APR_STATUS_IS_ENOTDIR(s) ((s) == APR_ENOTDIR) #define APR_STATUS_IS_ENOSPC(s) ((s) == APR_ENOSPC \ || (s) == APR_OS_START_SYSERR + ERROR_DISK_FULL) #define APR_STATUS_IS_ENOMEM(s) ((s) == APR_ENOMEM) #define APR_STATUS_IS_EMFILE(s) ((s) == APR_EMFILE \ || (s) == APR_OS_START_SYSERR + ERROR_TOO_MANY_OPEN_FILES) #define APR_STATUS_IS_ENFILE(s) ((s) == APR_ENFILE) #define APR_STATUS_IS_EBADF(s) ((s) == APR_EBADF \ || (s) == APR_OS_START_SYSERR + ERROR_INVALID_HANDLE) #define APR_STATUS_IS_EINVAL(s) ((s) == APR_EINVAL \ || (s) == APR_OS_START_SYSERR + ERROR_INVALID_PARAMETER \ || (s) == APR_OS_START_SYSERR + ERROR_INVALID_FUNCTION) #define APR_STATUS_IS_ESPIPE(s) ((s) == APR_ESPIPE \ || (s) == APR_OS_START_SYSERR + ERROR_NEGATIVE_SEEK) #define APR_STATUS_IS_EAGAIN(s) ((s) == APR_EAGAIN \ || (s) == APR_OS_START_SYSERR + ERROR_NO_DATA \ || (s) == APR_OS_START_SYSERR + SOCEWOULDBLOCK \ || (s) == APR_OS_START_SYSERR + ERROR_LOCK_VIOLATION) #define APR_STATUS_IS_EINTR(s) ((s) == APR_EINTR \ || (s) == APR_OS_START_SYSERR + SOCEINTR) #define APR_STATUS_IS_ENOTSOCK(s) ((s) == APR_ENOTSOCK \ || (s) == APR_OS_START_SYSERR + SOCENOTSOCK) #define APR_STATUS_IS_ECONNREFUSED(s) ((s) == APR_ECONNREFUSED \ || (s) == APR_OS_START_SYSERR + SOCECONNREFUSED) #define APR_STATUS_IS_EINPROGRESS(s) ((s) == APR_EINPROGRESS \ || (s) == APR_OS_START_SYSERR + SOCEINPROGRESS) #define APR_STATUS_IS_ECONNABORTED(s) ((s) == APR_ECONNABORTED \ || (s) == APR_OS_START_SYSERR + SOCECONNABORTED) #define APR_STATUS_IS_ECONNRESET(s) ((s) == APR_ECONNRESET \ || (s) == APR_OS_START_SYSERR + SOCECONNRESET) /* XXX deprecated */ #define APR_STATUS_IS_ETIMEDOUT(s) ((s) == APR_ETIMEDOUT \ || (s) == APR_OS_START_SYSERR + SOCETIMEDOUT) #undef APR_STATUS_IS_TIMEUP #define APR_STATUS_IS_TIMEUP(s) ((s) == APR_TIMEUP \ || (s) == APR_OS_START_SYSERR + SOCETIMEDOUT) #define APR_STATUS_IS_EHOSTUNREACH(s) ((s) == APR_EHOSTUNREACH \ || (s) == APR_OS_START_SYSERR + SOCEHOSTUNREACH) #define APR_STATUS_IS_ENETUNREACH(s) ((s) == APR_ENETUNREACH \ || (s) == APR_OS_START_SYSERR + SOCENETUNREACH) #define APR_STATUS_IS_EFTYPE(s) ((s) == APR_EFTYPE) #define APR_STATUS_IS_EPIPE(s) ((s) == APR_EPIPE \ || (s) == APR_OS_START_SYSERR + ERROR_BROKEN_PIPE \ || (s) == APR_OS_START_SYSERR + SOCEPIPE) #define APR_STATUS_IS_EXDEV(s) ((s) == APR_EXDEV \ || (s) == APR_OS_START_SYSERR + ERROR_NOT_SAME_DEVICE) #define APR_STATUS_IS_ENOTEMPTY(s) ((s) == APR_ENOTEMPTY \ || (s) == APR_OS_START_SYSERR + ERROR_DIR_NOT_EMPTY \ || (s) == APR_OS_START_SYSERR + ERROR_ACCESS_DENIED) #define APR_STATUS_IS_EAFNOSUPPORT(s) ((s) == APR_AFNOSUPPORT \ || (s) == APR_OS_START_SYSERR + SOCEAFNOSUPPORT) /* Sorry, too tired to wrap this up for OS2... feel free to fit the following into their best matches. { ERROR_NO_SIGNAL_SENT, ESRCH }, { SOCEALREADY, EALREADY }, { SOCEDESTADDRREQ, EDESTADDRREQ }, { SOCEMSGSIZE, EMSGSIZE }, { SOCEPROTOTYPE, EPROTOTYPE }, { SOCENOPROTOOPT, ENOPROTOOPT }, { SOCEPROTONOSUPPORT, EPROTONOSUPPORT }, { SOCESOCKTNOSUPPORT, ESOCKTNOSUPPORT }, { SOCEOPNOTSUPP, EOPNOTSUPP }, { SOCEPFNOSUPPORT, EPFNOSUPPORT }, { SOCEADDRINUSE, EADDRINUSE }, { SOCEADDRNOTAVAIL, EADDRNOTAVAIL }, { SOCENETDOWN, ENETDOWN }, { SOCENETRESET, ENETRESET }, { SOCENOBUFS, ENOBUFS }, { SOCEISCONN, EISCONN }, { SOCENOTCONN, ENOTCONN }, { SOCESHUTDOWN, ESHUTDOWN }, { SOCETOOMANYREFS, ETOOMANYREFS }, { SOCELOOP, ELOOP }, { SOCEHOSTDOWN, EHOSTDOWN }, { SOCENOTEMPTY, ENOTEMPTY }, { SOCEPIPE, EPIPE } */ #elif defined(WIN32) && !defined(DOXYGEN) /* !defined(OS2) */ #define APR_FROM_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e + APR_OS_START_SYSERR) #define APR_TO_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e - APR_OS_START_SYSERR) #define apr_get_os_error() (APR_FROM_OS_ERROR(GetLastError())) #define apr_set_os_error(e) (SetLastError(APR_TO_OS_ERROR(e))) /* A special case, only socket calls require this: */ #define apr_get_netos_error() (APR_FROM_OS_ERROR(WSAGetLastError())) #define apr_set_netos_error(e) (WSASetLastError(APR_TO_OS_ERROR(e))) /* APR CANONICAL ERROR TESTS */ #define APR_STATUS_IS_EACCES(s) ((s) == APR_EACCES \ || (s) == APR_OS_START_SYSERR + ERROR_ACCESS_DENIED \ || (s) == APR_OS_START_SYSERR + ERROR_CANNOT_MAKE \ || (s) == APR_OS_START_SYSERR + ERROR_CURRENT_DIRECTORY \ || (s) == APR_OS_START_SYSERR + ERROR_DRIVE_LOCKED \ || (s) == APR_OS_START_SYSERR + ERROR_FAIL_I24 \ || (s) == APR_OS_START_SYSERR + ERROR_LOCK_VIOLATION \ || (s) == APR_OS_START_SYSERR + ERROR_LOCK_FAILED \ || (s) == APR_OS_START_SYSERR + ERROR_NOT_LOCKED \ || (s) == APR_OS_START_SYSERR + ERROR_NETWORK_ACCESS_DENIED \ || (s) == APR_OS_START_SYSERR + ERROR_SHARING_VIOLATION) #define APR_STATUS_IS_EEXIST(s) ((s) == APR_EEXIST \ || (s) == APR_OS_START_SYSERR + ERROR_FILE_EXISTS \ || (s) == APR_OS_START_SYSERR + ERROR_ALREADY_EXISTS) #define APR_STATUS_IS_ENAMETOOLONG(s) ((s) == APR_ENAMETOOLONG \ || (s) == APR_OS_START_SYSERR + ERROR_FILENAME_EXCED_RANGE \ || (s) == APR_OS_START_SYSERR + WSAENAMETOOLONG) #define APR_STATUS_IS_ENOENT(s) ((s) == APR_ENOENT \ || (s) == APR_OS_START_SYSERR + ERROR_FILE_NOT_FOUND \ || (s) == APR_OS_START_SYSERR + ERROR_PATH_NOT_FOUND \ || (s) == APR_OS_START_SYSERR + ERROR_OPEN_FAILED \ || (s) == APR_OS_START_SYSERR + ERROR_NO_MORE_FILES) #define APR_STATUS_IS_ENOTDIR(s) ((s) == APR_ENOTDIR \ || (s) == APR_OS_START_SYSERR + ERROR_PATH_NOT_FOUND \ || (s) == APR_OS_START_SYSERR + ERROR_BAD_NETPATH \ || (s) == APR_OS_START_SYSERR + ERROR_BAD_NET_NAME \ || (s) == APR_OS_START_SYSERR + ERROR_BAD_PATHNAME \ || (s) == APR_OS_START_SYSERR + ERROR_INVALID_DRIVE) #define APR_STATUS_IS_ENOSPC(s) ((s) == APR_ENOSPC \ || (s) == APR_OS_START_SYSERR + ERROR_DISK_FULL) #define APR_STATUS_IS_ENOMEM(s) ((s) == APR_ENOMEM \ || (s) == APR_OS_START_SYSERR + ERROR_ARENA_TRASHED \ || (s) == APR_OS_START_SYSERR + ERROR_NOT_ENOUGH_MEMORY \ || (s) == APR_OS_START_SYSERR + ERROR_INVALID_BLOCK \ || (s) == APR_OS_START_SYSERR + ERROR_NOT_ENOUGH_QUOTA \ || (s) == APR_OS_START_SYSERR + ERROR_OUTOFMEMORY) #define APR_STATUS_IS_EMFILE(s) ((s) == APR_EMFILE \ || (s) == APR_OS_START_SYSERR + ERROR_TOO_MANY_OPEN_FILES) #define APR_STATUS_IS_ENFILE(s) ((s) == APR_ENFILE) #define APR_STATUS_IS_EBADF(s) ((s) == APR_EBADF \ || (s) == APR_OS_START_SYSERR + ERROR_INVALID_HANDLE \ || (s) == APR_OS_START_SYSERR + ERROR_INVALID_TARGET_HANDLE) #define APR_STATUS_IS_EINVAL(s) ((s) == APR_EINVAL \ || (s) == APR_OS_START_SYSERR + ERROR_INVALID_ACCESS \ || (s) == APR_OS_START_SYSERR + ERROR_INVALID_DATA \ || (s) == APR_OS_START_SYSERR + ERROR_INVALID_FUNCTION \ || (s) == APR_OS_START_SYSERR + ERROR_INVALID_HANDLE \ || (s) == APR_OS_START_SYSERR + ERROR_INVALID_PARAMETER \ || (s) == APR_OS_START_SYSERR + ERROR_NEGATIVE_SEEK) #define APR_STATUS_IS_ESPIPE(s) ((s) == APR_ESPIPE \ || (s) == APR_OS_START_SYSERR + ERROR_SEEK_ON_DEVICE \ || (s) == APR_OS_START_SYSERR + ERROR_NEGATIVE_SEEK) #define APR_STATUS_IS_EAGAIN(s) ((s) == APR_EAGAIN \ || (s) == APR_OS_START_SYSERR + ERROR_NO_DATA \ || (s) == APR_OS_START_SYSERR + ERROR_NO_PROC_SLOTS \ || (s) == APR_OS_START_SYSERR + ERROR_NESTING_NOT_ALLOWED \ || (s) == APR_OS_START_SYSERR + ERROR_MAX_THRDS_REACHED \ || (s) == APR_OS_START_SYSERR + ERROR_LOCK_VIOLATION \ || (s) == APR_OS_START_SYSERR + WSAEWOULDBLOCK) #define APR_STATUS_IS_EINTR(s) ((s) == APR_EINTR \ || (s) == APR_OS_START_SYSERR + WSAEINTR) #define APR_STATUS_IS_ENOTSOCK(s) ((s) == APR_ENOTSOCK \ || (s) == APR_OS_START_SYSERR + WSAENOTSOCK) #define APR_STATUS_IS_ECONNREFUSED(s) ((s) == APR_ECONNREFUSED \ || (s) == APR_OS_START_SYSERR + WSAECONNREFUSED) #define APR_STATUS_IS_EINPROGRESS(s) ((s) == APR_EINPROGRESS \ || (s) == APR_OS_START_SYSERR + WSAEINPROGRESS) #define APR_STATUS_IS_ECONNABORTED(s) ((s) == APR_ECONNABORTED \ || (s) == APR_OS_START_SYSERR + WSAECONNABORTED) #define APR_STATUS_IS_ECONNRESET(s) ((s) == APR_ECONNRESET \ || (s) == APR_OS_START_SYSERR + ERROR_NETNAME_DELETED \ || (s) == APR_OS_START_SYSERR + WSAECONNRESET) /* XXX deprecated */ #define APR_STATUS_IS_ETIMEDOUT(s) ((s) == APR_ETIMEDOUT \ || (s) == APR_OS_START_SYSERR + WSAETIMEDOUT \ || (s) == APR_OS_START_SYSERR + WAIT_TIMEOUT) #undef APR_STATUS_IS_TIMEUP #define APR_STATUS_IS_TIMEUP(s) ((s) == APR_TIMEUP \ || (s) == APR_OS_START_SYSERR + WSAETIMEDOUT \ || (s) == APR_OS_START_SYSERR + WAIT_TIMEOUT) #define APR_STATUS_IS_EHOSTUNREACH(s) ((s) == APR_EHOSTUNREACH \ || (s) == APR_OS_START_SYSERR + WSAEHOSTUNREACH) #define APR_STATUS_IS_ENETUNREACH(s) ((s) == APR_ENETUNREACH \ || (s) == APR_OS_START_SYSERR + WSAENETUNREACH) #define APR_STATUS_IS_EFTYPE(s) ((s) == APR_EFTYPE \ || (s) == APR_OS_START_SYSERR + ERROR_EXE_MACHINE_TYPE_MISMATCH \ || (s) == APR_OS_START_SYSERR + ERROR_INVALID_DLL \ || (s) == APR_OS_START_SYSERR + ERROR_INVALID_MODULETYPE \ || (s) == APR_OS_START_SYSERR + ERROR_BAD_EXE_FORMAT \ || (s) == APR_OS_START_SYSERR + ERROR_INVALID_EXE_SIGNATURE \ || (s) == APR_OS_START_SYSERR + ERROR_FILE_CORRUPT \ || (s) == APR_OS_START_SYSERR + ERROR_BAD_FORMAT) #define APR_STATUS_IS_EPIPE(s) ((s) == APR_EPIPE \ || (s) == APR_OS_START_SYSERR + ERROR_BROKEN_PIPE) #define APR_STATUS_IS_EXDEV(s) ((s) == APR_EXDEV \ || (s) == APR_OS_START_SYSERR + ERROR_NOT_SAME_DEVICE) #define APR_STATUS_IS_ENOTEMPTY(s) ((s) == APR_ENOTEMPTY \ || (s) == APR_OS_START_SYSERR + ERROR_DIR_NOT_EMPTY) #define APR_STATUS_IS_EAFNOSUPPORT(s) ((s) == APR_EAFNOSUPPORT \ || (s) == APR_OS_START_SYSERR + WSAEAFNOSUPPORT) #elif defined(NETWARE) && defined(USE_WINSOCK) && !defined(DOXYGEN) /* !defined(OS2) && !defined(WIN32) */ #define APR_FROM_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e + APR_OS_START_SYSERR) #define APR_TO_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e - APR_OS_START_SYSERR) #define apr_get_os_error() (errno) #define apr_set_os_error(e) (errno = (e)) /* A special case, only socket calls require this: */ #define apr_get_netos_error() (APR_FROM_OS_ERROR(WSAGetLastError())) #define apr_set_netos_error(e) (WSASetLastError(APR_TO_OS_ERROR(e))) /* APR CANONICAL ERROR TESTS */ #define APR_STATUS_IS_EACCES(s) ((s) == APR_EACCES) #define APR_STATUS_IS_EEXIST(s) ((s) == APR_EEXIST) #define APR_STATUS_IS_ENAMETOOLONG(s) ((s) == APR_ENAMETOOLONG) #define APR_STATUS_IS_ENOENT(s) ((s) == APR_ENOENT) #define APR_STATUS_IS_ENOTDIR(s) ((s) == APR_ENOTDIR) #define APR_STATUS_IS_ENOSPC(s) ((s) == APR_ENOSPC) #define APR_STATUS_IS_ENOMEM(s) ((s) == APR_ENOMEM) #define APR_STATUS_IS_EMFILE(s) ((s) == APR_EMFILE) #define APR_STATUS_IS_ENFILE(s) ((s) == APR_ENFILE) #define APR_STATUS_IS_EBADF(s) ((s) == APR_EBADF) #define APR_STATUS_IS_EINVAL(s) ((s) == APR_EINVAL) #define APR_STATUS_IS_ESPIPE(s) ((s) == APR_ESPIPE) #define APR_STATUS_IS_EAGAIN(s) ((s) == APR_EAGAIN \ || (s) == EWOULDBLOCK \ || (s) == APR_OS_START_SYSERR + WSAEWOULDBLOCK) #define APR_STATUS_IS_EINTR(s) ((s) == APR_EINTR \ || (s) == APR_OS_START_SYSERR + WSAEINTR) #define APR_STATUS_IS_ENOTSOCK(s) ((s) == APR_ENOTSOCK \ || (s) == APR_OS_START_SYSERR + WSAENOTSOCK) #define APR_STATUS_IS_ECONNREFUSED(s) ((s) == APR_ECONNREFUSED \ || (s) == APR_OS_START_SYSERR + WSAECONNREFUSED) #define APR_STATUS_IS_EINPROGRESS(s) ((s) == APR_EINPROGRESS \ || (s) == APR_OS_START_SYSERR + WSAEINPROGRESS) #define APR_STATUS_IS_ECONNABORTED(s) ((s) == APR_ECONNABORTED \ || (s) == APR_OS_START_SYSERR + WSAECONNABORTED) #define APR_STATUS_IS_ECONNRESET(s) ((s) == APR_ECONNRESET \ || (s) == APR_OS_START_SYSERR + WSAECONNRESET) /* XXX deprecated */ #define APR_STATUS_IS_ETIMEDOUT(s) ((s) == APR_ETIMEDOUT \ || (s) == APR_OS_START_SYSERR + WSAETIMEDOUT \ || (s) == APR_OS_START_SYSERR + WAIT_TIMEOUT) #undef APR_STATUS_IS_TIMEUP #define APR_STATUS_IS_TIMEUP(s) ((s) == APR_TIMEUP \ || (s) == APR_OS_START_SYSERR + WSAETIMEDOUT \ || (s) == APR_OS_START_SYSERR + WAIT_TIMEOUT) #define APR_STATUS_IS_EHOSTUNREACH(s) ((s) == APR_EHOSTUNREACH \ || (s) == APR_OS_START_SYSERR + WSAEHOSTUNREACH) #define APR_STATUS_IS_ENETUNREACH(s) ((s) == APR_ENETUNREACH \ || (s) == APR_OS_START_SYSERR + WSAENETUNREACH) #define APR_STATUS_IS_ENETDOWN(s) ((s) == APR_OS_START_SYSERR + WSAENETDOWN) #define APR_STATUS_IS_EFTYPE(s) ((s) == APR_EFTYPE) #define APR_STATUS_IS_EPIPE(s) ((s) == APR_EPIPE) #define APR_STATUS_IS_EXDEV(s) ((s) == APR_EXDEV) #define APR_STATUS_IS_ENOTEMPTY(s) ((s) == APR_ENOTEMPTY) #define APR_STATUS_IS_EAFNOSUPPORT(s) ((s) == APR_EAFNOSUPPORT \ || (s) == APR_OS_START_SYSERR + WSAEAFNOSUPPORT) #else /* !defined(NETWARE) && !defined(OS2) && !defined(WIN32) */ /* * os error codes are clib error codes */ #define APR_FROM_OS_ERROR(e) (e) #define APR_TO_OS_ERROR(e) (e) #define apr_get_os_error() (errno) #define apr_set_os_error(e) (errno = (e)) /* A special case, only socket calls require this: */ #define apr_get_netos_error() (errno) #define apr_set_netos_error(e) (errno = (e)) /** * @addtogroup APR_STATUS_IS * @{ */ /** permission denied */ #define APR_STATUS_IS_EACCES(s) ((s) == APR_EACCES) /** file exists */ #define APR_STATUS_IS_EEXIST(s) ((s) == APR_EEXIST) /** path name is too long */ #define APR_STATUS_IS_ENAMETOOLONG(s) ((s) == APR_ENAMETOOLONG) /** * no such file or directory * @remark * EMVSCATLG can be returned by the automounter on z/OS for * paths which do not exist. */ #ifdef EMVSCATLG #define APR_STATUS_IS_ENOENT(s) ((s) == APR_ENOENT \ || (s) == EMVSCATLG) #else #define APR_STATUS_IS_ENOENT(s) ((s) == APR_ENOENT) #endif /** not a directory */ #define APR_STATUS_IS_ENOTDIR(s) ((s) == APR_ENOTDIR) /** no space left on device */ #ifdef EDQUOT #define APR_STATUS_IS_ENOSPC(s) ((s) == APR_ENOSPC \ || (s) == EDQUOT) #else #define APR_STATUS_IS_ENOSPC(s) ((s) == APR_ENOSPC) #endif /** not enough memory */ #define APR_STATUS_IS_ENOMEM(s) ((s) == APR_ENOMEM) /** too many open files */ #define APR_STATUS_IS_EMFILE(s) ((s) == APR_EMFILE) /** file table overflow */ #define APR_STATUS_IS_ENFILE(s) ((s) == APR_ENFILE) /** bad file # */ #define APR_STATUS_IS_EBADF(s) ((s) == APR_EBADF) /** invalid argument */ #define APR_STATUS_IS_EINVAL(s) ((s) == APR_EINVAL) /** illegal seek */ #define APR_STATUS_IS_ESPIPE(s) ((s) == APR_ESPIPE) /** operation would block */ #if !defined(EWOULDBLOCK) || !defined(EAGAIN) #define APR_STATUS_IS_EAGAIN(s) ((s) == APR_EAGAIN) #elif (EWOULDBLOCK == EAGAIN) #define APR_STATUS_IS_EAGAIN(s) ((s) == APR_EAGAIN) #else #define APR_STATUS_IS_EAGAIN(s) ((s) == APR_EAGAIN \ || (s) == EWOULDBLOCK) #endif /** interrupted system call */ #define APR_STATUS_IS_EINTR(s) ((s) == APR_EINTR) /** socket operation on a non-socket */ #define APR_STATUS_IS_ENOTSOCK(s) ((s) == APR_ENOTSOCK) /** Connection Refused */ #define APR_STATUS_IS_ECONNREFUSED(s) ((s) == APR_ECONNREFUSED) /** operation now in progress */ #define APR_STATUS_IS_EINPROGRESS(s) ((s) == APR_EINPROGRESS) /** * Software caused connection abort * @remark * EPROTO on certain older kernels really means ECONNABORTED, so we need to * ignore it for them. See discussion in new-httpd archives nh.9701 & nh.9603 * * There is potentially a bug in Solaris 2.x x<6, and other boxes that * implement tcp sockets in userland (i.e. on top of STREAMS). On these * systems, EPROTO can actually result in a fatal loop. See PR#981 for * example. It's hard to handle both uses of EPROTO. */ #ifdef EPROTO #define APR_STATUS_IS_ECONNABORTED(s) ((s) == APR_ECONNABORTED \ || (s) == EPROTO) #else #define APR_STATUS_IS_ECONNABORTED(s) ((s) == APR_ECONNABORTED) #endif /** Connection Reset by peer */ #define APR_STATUS_IS_ECONNRESET(s) ((s) == APR_ECONNRESET) /** Operation timed out * @deprecated */ #define APR_STATUS_IS_ETIMEDOUT(s) ((s) == APR_ETIMEDOUT) /** no route to host */ #define APR_STATUS_IS_EHOSTUNREACH(s) ((s) == APR_EHOSTUNREACH) /** network is unreachable */ #define APR_STATUS_IS_ENETUNREACH(s) ((s) == APR_ENETUNREACH) /** inappropiate file type or format */ #define APR_STATUS_IS_EFTYPE(s) ((s) == APR_EFTYPE) /** broken pipe */ #define APR_STATUS_IS_EPIPE(s) ((s) == APR_EPIPE) /** cross device link */ #define APR_STATUS_IS_EXDEV(s) ((s) == APR_EXDEV) /** Directory Not Empty */ #define APR_STATUS_IS_ENOTEMPTY(s) ((s) == APR_ENOTEMPTY || \ (s) == APR_EEXIST) /** Address Family not supported */ #define APR_STATUS_IS_EAFNOSUPPORT(s) ((s) == APR_EAFNOSUPPORT) /** @} */ #endif /* !defined(NETWARE) && !defined(OS2) && !defined(WIN32) */ /** @} */ #ifdef __cplusplus } #endif #endif /* ! APR_ERRNO_H */ 0707010001f166000081a4000017820000044e000000014b1d38c700000a8c0000022d0000016a00000000000000000000001e00000000reloc/include/apr-1/apr_dso.h /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef APR_DSO_DOT_H #define APR_DSO_DOT_H /** * @file apr_dso.h * @brief APR Dynamic Object Handling Routines */ #include "apr.h" #include "apr_pools.h" #include "apr_errno.h" #ifdef __cplusplus extern "C" { #endif /** * @defgroup apr_dso Dynamic Object Handling * @ingroup APR * @{ */ #if APR_HAS_DSO || defined(DOXYGEN) /** * Structure for referencing dynamic objects */ typedef struct apr_dso_handle_t apr_dso_handle_t; /** * Structure for referencing symbols from dynamic objects */ typedef void * apr_dso_handle_sym_t; /** * Load a DSO library. * @param res_handle Location to store new handle for the DSO. * @param path Path to the DSO library * @param ctx Pool to use. * @bug We aught to provide an alternative to RTLD_GLOBAL, which * is the only supported method of loading DSOs today. */ APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, const char *path, apr_pool_t *ctx); /** * Close a DSO library. * @param handle handle to close. */ APR_DECLARE(apr_status_t) apr_dso_unload(apr_dso_handle_t *handle); /** * Load a symbol from a DSO handle. * @param ressym Location to store the loaded symbol * @param handle handle to load the symbol from. * @param symname Name of the symbol to load. */ APR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym, apr_dso_handle_t *handle, const char *symname); /** * Report more information when a DSO function fails. * @param dso The dso handle that has been opened * @param buf Location to store the dso error * @param bufsize The size of the provided buffer */ APR_DECLARE(const char *) apr_dso_error(apr_dso_handle_t *dso, char *buf, apr_size_t bufsize); #endif /* APR_HAS_DSO */ /** @} */ #ifdef __cplusplus } #endif #endif 0707010001f18b000081a4000017820000044e000000014b1d38c700000ac90000022d0000016a00000000000000000000002100000000reloc/include/apr-1/apr_signal.h /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef APR_SIGNAL_H #define APR_SIGNAL_H /** * @file apr_signal.h * @brief APR Signal Handling */ #include "apr.h" #include "apr_pools.h" #if APR_HAVE_SIGNAL_H #include
* db for Berkeley DB files * gdbm for GDBM files * ndbm for NDBM files * sdbm for SDBM files (always available) * default for the default DBM type ** @param name The dbm file name to open * @param mode The flag value *
* APR_DBM_READONLY open for read-only access * APR_DBM_READWRITE open for read-write access * APR_DBM_RWCREATE open for r/w, create if needed * APR_DBM_RWTRUNC open for r/w, truncate if already there ** @param perm Permissions to apply to if created * @param cntxt The pool to use when creating the dbm * @remark The dbm name may not be a true file name, as many dbm packages * append suffixes for seperate data and index files. * @bug In apr-util 0.9 and 1.x, the type arg was case insensitive. This * was highly inefficient, and as of 2.x the dbm name must be provided in * the correct case (lower case for all bundled providers) */ APU_DECLARE(apr_status_t) apr_dbm_open_ex(apr_dbm_t **dbm, const char* type, const char *name, apr_int32_t mode, apr_fileperms_t perm, apr_pool_t *cntxt); /** * Open a dbm file by file name * @param dbm The newly opened database * @param name The dbm file name to open * @param mode The flag value *
* APR_DBM_READONLY open for read-only access * APR_DBM_READWRITE open for read-write access * APR_DBM_RWCREATE open for r/w, create if needed * APR_DBM_RWTRUNC open for r/w, truncate if already there ** @param perm Permissions to apply to if created * @param cntxt The pool to use when creating the dbm * @remark The dbm name may not be a true file name, as many dbm packages * append suffixes for seperate data and index files. */ APU_DECLARE(apr_status_t) apr_dbm_open(apr_dbm_t **dbm, const char *name, apr_int32_t mode, apr_fileperms_t perm, apr_pool_t *cntxt); /** * Close a dbm file previously opened by apr_dbm_open * @param dbm The database to close */ APU_DECLARE(void) apr_dbm_close(apr_dbm_t *dbm); /** * Fetch a dbm record value by key * @param dbm The database * @param key The key datum to find this record * @param pvalue The value datum retrieved for this record */ APU_DECLARE(apr_status_t) apr_dbm_fetch(apr_dbm_t *dbm, apr_datum_t key, apr_datum_t *pvalue); /** * Store a dbm record value by key * @param dbm The database * @param key The key datum to store this record by * @param value The value datum to store in this record */ APU_DECLARE(apr_status_t) apr_dbm_store(apr_dbm_t *dbm, apr_datum_t key, apr_datum_t value); /** * Delete a dbm record value by key * @param dbm The database * @param key The key datum of the record to delete * @remark It is not an error to delete a non-existent record. */ APU_DECLARE(apr_status_t) apr_dbm_delete(apr_dbm_t *dbm, apr_datum_t key); /** * Search for a key within the dbm * @param dbm The database * @param key The datum describing a key to test */ APU_DECLARE(int) apr_dbm_exists(apr_dbm_t *dbm, apr_datum_t key); /** * Retrieve the first record key from a dbm * @param dbm The database * @param pkey The key datum of the first record */ APU_DECLARE(apr_status_t) apr_dbm_firstkey(apr_dbm_t *dbm, apr_datum_t *pkey); /** * Retrieve the next record key from a dbm * @param dbm The database * @param pkey The key datum of the next record */ APU_DECLARE(apr_status_t) apr_dbm_nextkey(apr_dbm_t *dbm, apr_datum_t *pkey); /** * Proactively toss any memory associated with the apr_datum_t. * @param dbm The database * @param data The datum to free. */ APU_DECLARE(void) apr_dbm_freedatum(apr_dbm_t *dbm, apr_datum_t data); /** * Report more information when an apr_dbm function fails. * @param dbm The database * @param errcode A DBM-specific value for the error (for logging). If this * isn't needed, it may be NULL. * @param errbuf Location to store the error text * @param errbufsize The size of the provided buffer * @return The errbuf parameter, for convenience. */ APU_DECLARE(char *) apr_dbm_geterror(apr_dbm_t *dbm, int *errcode, char *errbuf, apr_size_t errbufsize); /** * If the specified file/path were passed to apr_dbm_open(), return the * actual file/path names which would be (created and) used. At most, two * files may be used; used2 may be NULL if only one file is used. * @param pool The pool for allocating used1 and used2. * @param type The type of DBM you require info on @see apr_dbm_open_ex * @param pathname The path name to generate used-names from. * @param used1 The first pathname used by the apr_dbm implementation. * @param used2 The second pathname used by apr_dbm. If only one file is * used by the specific implementation, this will be set to NULL. * @return An error if the specified type is invalid. * @remark The dbm file(s) don't need to exist. This function only manipulates * the pathnames. */ APU_DECLARE(apr_status_t) apr_dbm_get_usednames_ex(apr_pool_t *pool, const char *type, const char *pathname, const char **used1, const char **used2); /** * If the specified file/path were passed to apr_dbm_open(), return the * actual file/path names which would be (created and) used. At most, two * files may be used; used2 may be NULL if only one file is used. * @param pool The pool for allocating used1 and used2. * @param pathname The path name to generate used-names from. * @param used1 The first pathname used by the apr_dbm implementation. * @param used2 The second pathname used by apr_dbm. If only one file is * used by the specific implementation, this will be set to NULL. * @remark The dbm file(s) don't need to exist. This function only manipulates * the pathnames. */ APU_DECLARE(void) apr_dbm_get_usednames(apr_pool_t *pool, const char *pathname, const char **used1, const char **used2); /** @} */ #ifdef __cplusplus } #endif #endif /* !APR_DBM_H */ 0707010001f19e000081a4000017820000044e000000014b1d38ca0000101e0000022d0000016a00000000000000000000002200000000reloc/include/apr-1/apu_version.h /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef APU_VERSION_H #define APU_VERSION_H /** * @file apu_version.h * @brief APR-util Versioning Interface * * APR-util's Version * * There are several different mechanisms for accessing the version. There * is a string form, and a set of numbers; in addition, there are constants * which can be compiled into your application, and you can query the library * being used for its actual version. * * Note that it is possible for an application to detect that it has been * compiled against a different version of APU by use of the compile-time * constants and the use of the run-time query function. * * APU version numbering follows the guidelines specified in: * * http://apr.apache.org/versioning.html */ /* The numeric compile-time version constants. These constants are the * authoritative version numbers for APU. */ /** major version * Major API changes that could cause compatibility problems for older * programs such as structure size changes. No binary compatibility is * possible across a change in the major version. */ #define APU_MAJOR_VERSION 1 /** minor version * Minor API changes that do not cause binary compatibility problems. * Reset to 0 when upgrading APU_MAJOR_VERSION */ #define APU_MINOR_VERSION 3 /** patch level * The Patch Level never includes API changes, simply bug fixes. * Reset to 0 when upgrading APR_MINOR_VERSION */ #define APU_PATCH_VERSION 9 /** * The symbol APU_IS_DEV_VERSION is only defined for internal, * "development" copies of APU. It is undefined for released versions * of APU. */ /* #undef APU_IS_DEV_VERSION */ #if defined(APU_IS_DEV_VERSION) || defined(DOXYGEN) /** Internal: string form of the "is dev" flag */ #define APU_IS_DEV_STRING "-dev" #else #define APU_IS_DEV_STRING "" #endif #ifndef APU_STRINGIFY /** Properly quote a value as a string in the C preprocessor */ #define APU_STRINGIFY(n) APU_STRINGIFY_HELPER(n) /** Helper macro for APU_STRINGIFY */ #define APU_STRINGIFY_HELPER(n) #n #endif /** The formatted string of APU's version */ #define APU_VERSION_STRING \ APU_STRINGIFY(APU_MAJOR_VERSION) "." \ APU_STRINGIFY(APU_MINOR_VERSION) "." \ APU_STRINGIFY(APU_PATCH_VERSION) \ APU_IS_DEV_STRING /** An alternative formatted string of APR's version */ /* macro for Win32 .rc files using numeric csv representation */ #define APU_VERSION_STRING_CSV APU_MAJOR_VERSION ##, \ ##APU_MINOR_VERSION ##, \ ##APU_PATCH_VERSION #ifndef APU_VERSION_ONLY /* The C language API to access the version at run time, * as opposed to compile time. APU_VERSION_ONLY may be defined * externally when preprocessing apr_version.h to obtain strictly * the C Preprocessor macro declarations. */ #include "apr_version.h" #include "apu.h" #ifdef __cplusplus extern "C" { #endif /** * Return APR-util's version information information in a numeric form. * * @param pvsn Pointer to a version structure for returning the version * information. */ APU_DECLARE(void) apu_version(apr_version_t *pvsn); /** Return APU's version information as a string. */ APU_DECLARE(const char *) apu_version_string(void); #ifdef __cplusplus } #endif #endif /* ndef APU_VERSION_ONLY */ #endif /* ndef APU_VERSION_H */ 0707010001f18c000081a4000017820000044e000000014b1d38c7000036a60000022d0000016a00000000000000000000002200000000reloc/include/apr-1/apr_strings.h /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* Portions of this file are covered by */ /* -*- mode: c; c-file-style: "k&r" -*- strnatcmp.c -- Perform 'natural order' comparisons of strings in C. Copyright (C) 2000 by Martin Pool
* Note the differences between this function and strncpy(): * 1) strncpy() doesn't always NUL terminate; apr_cpystrn() does. * 2) strncpy() pads the destination string with NULs, which is often * unnecessary; apr_cpystrn() does not. * 3) strncpy() returns a pointer to the beginning of the dst string; * apr_cpystrn() returns a pointer to the NUL terminator of dst, * to allow a check for truncation. **/ APR_DECLARE(char *) apr_cpystrn(char *dst, const char *src, apr_size_t dst_size); /** * Remove all whitespace from a string * @param dest The destination string. It is okay to modify the string * in place. Namely dest == src * @param src The string to rid the spaces from. * @return A pointer to the destination string's null terminator. */ APR_DECLARE(char *) apr_collapse_spaces(char *dest, const char *src); /** * Convert the arguments to a program from one string to an array of * strings terminated by a NULL pointer * @param arg_str The arguments to convert * @param argv_out Output location. This is a pointer to an array of strings. * @param token_context Pool to use. */ APR_DECLARE(apr_status_t) apr_tokenize_to_argv(const char *arg_str, char ***argv_out, apr_pool_t *token_context); /** * Split a string into separate null-terminated tokens. The tokens are * delimited in the string by one or more characters from the sep * argument. * @param str The string to separate; this should be specified on the * first call to apr_strtok() for a given string, and NULL * on subsequent calls. * @param sep The set of delimiters * @param last Internal state saved by apr_strtok() between calls. * @return The next token from the string */ APR_DECLARE(char *) apr_strtok(char *str, const char *sep, char **last); /** * @defgroup APR_Strings_Snprintf snprintf implementations * @warning * These are snprintf implementations based on apr_vformatter(). * * Note that various standards and implementations disagree on the return * value of snprintf, and side-effects due to %n in the formatting string. * apr_snprintf (and apr_vsnprintf) behaves as follows: * * Process the format string until the entire string is exhausted, or * the buffer fills. If the buffer fills then stop processing immediately * (so no further %n arguments are processed), and return the buffer * length. In all cases the buffer is NUL terminated. It will return the * number of characters inserted into the buffer, not including the * terminating NUL. As a special case, if len is 0, apr_snprintf will * return the number of characters that would have been inserted if * the buffer had been infinite (in this case, *buffer can be NULL) * * In no event does apr_snprintf return a negative number. * @{ */ /** * snprintf routine based on apr_vformatter. This means it understands the * same extensions. * @param buf The buffer to write to * @param len The size of the buffer * @param format The format string * @param ... The arguments to use to fill out the format string. */ APR_DECLARE_NONSTD(int) apr_snprintf(char *buf, apr_size_t len, const char *format, ...) __attribute__((format(printf,3,4))); /** * vsnprintf routine based on apr_vformatter. This means it understands the * same extensions. * @param buf The buffer to write to * @param len The size of the buffer * @param format The format string * @param ap The arguments to use to fill out the format string. */ APR_DECLARE(int) apr_vsnprintf(char *buf, apr_size_t len, const char *format, va_list ap); /** @} */ /** * create a string representation of an int, allocated from a pool * @param p The pool from which to allocate * @param n The number to format * @return The string representation of the number */ APR_DECLARE(char *) apr_itoa(apr_pool_t *p, int n); /** * create a string representation of a long, allocated from a pool * @param p The pool from which to allocate * @param n The number to format * @return The string representation of the number */ APR_DECLARE(char *) apr_ltoa(apr_pool_t *p, long n); /** * create a string representation of an apr_off_t, allocated from a pool * @param p The pool from which to allocate * @param n The number to format * @return The string representation of the number */ APR_DECLARE(char *) apr_off_t_toa(apr_pool_t *p, apr_off_t n); /** * Convert a numeric string into an apr_off_t numeric value. * @param offset The value of the parsed string. * @param buf The string to parse. It may contain optional whitespace, * followed by an optional '+' (positive, default) or '-' (negative) * character, followed by an optional '0x' prefix if base is 0 or 16, * followed by numeric digits appropriate for base. * @param end A pointer to the end of the valid character in buf. If * not NULL, it is set to the first invalid character in buf. * @param base A numeric base in the range between 2 and 36 inclusive, * or 0. If base is zero, buf will be treated as base ten unless its * digits are prefixed with '0x', in which case it will be treated as * base 16. * @bug *end breaks type safety; where *buf is const, *end needs to be * declared as const in APR 2.0 */ APR_DECLARE(apr_status_t) apr_strtoff(apr_off_t *offset, const char *buf, char **end, int base); /** * parse a numeric string into a 64-bit numeric value * @param buf The string to parse. It may contain optional whitespace, * followed by an optional '+' (positive, default) or '-' (negative) * character, followed by an optional '0x' prefix if base is 0 or 16, * followed by numeric digits appropriate for base. * @param end A pointer to the end of the valid character in buf. If * not NULL, it is set to the first invalid character in buf. * @param base A numeric base in the range between 2 and 36 inclusive, * or 0. If base is zero, buf will be treated as base ten unless its * digits are prefixed with '0x', in which case it will be treated as * base 16. * @return The numeric value of the string. On overflow, errno is set * to ERANGE. */ APR_DECLARE(apr_int64_t) apr_strtoi64(const char *buf, char **end, int base); /** * parse a base-10 numeric string into a 64-bit numeric value. * Equivalent to apr_strtoi64(buf, (char**)NULL, 10). * @param buf The string to parse * @return The numeric value of the string */ APR_DECLARE(apr_int64_t) apr_atoi64(const char *buf); /** * Format a binary size (magnitiudes are 2^10 rather than 10^3) from an apr_off_t, * as bytes, K, M, T, etc, to a four character compacted human readable string. * @param size The size to format * @param buf The 5 byte text buffer (counting the trailing null) * @return The buf passed to apr_strfsize() * @remark All negative sizes report ' - ', apr_strfsize only formats positive values. */ APR_DECLARE(char *) apr_strfsize(apr_off_t size, char *buf); /** @} */ #ifdef __cplusplus } #endif #endif /* !APR_STRINGS_H */ 0707010001f18d000081a4000017820000044e000000014b1d38c900000a750000022d0000016a00000000000000000000002300000000reloc/include/apr-1/apr_strmatch.h /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef APR_STRMATCH_H #define APR_STRMATCH_H /** * @file apr_strmatch.h * @brief APR-UTIL string matching routines */ #include "apu.h" #include "apr_pools.h" #ifdef __cplusplus extern "C" { #endif /** * @defgroup APR_Util_StrMatch String matching routines * @ingroup APR_Util * @{ */ /** @see apr_strmatch_pattern */ typedef struct apr_strmatch_pattern apr_strmatch_pattern; /** * Precompiled search pattern */ struct apr_strmatch_pattern { /** Function called to compare */ const char *(*compare)(const apr_strmatch_pattern *this_pattern, const char *s, apr_size_t slen); const char *pattern; /**< Current pattern */ apr_size_t length; /**< Current length */ void *context; /**< hook to add precomputed metadata */ }; #if defined(DOXYGEN) /** * Search for a precompiled pattern within a string * @param pattern The pattern * @param s The string in which to search for the pattern * @param slen The length of s (excluding null terminator) * @return A pointer to the first instance of the pattern in s, or * NULL if not found */ APU_DECLARE(const char *) apr_strmatch(const apr_strmatch_pattern *pattern, const char *s, apr_size_t slen); #else #define apr_strmatch(pattern, s, slen) (*((pattern)->compare))((pattern), (s), (slen)) #endif /** * Precompile a pattern for matching using the Boyer-Moore-Horspool algorithm * @param p The pool from which to allocate the pattern * @param s The pattern string * @param case_sensitive Whether the matching should be case-sensitive * @return a pointer to the compiled pattern, or NULL if compilation fails */ APU_DECLARE(const apr_strmatch_pattern *) apr_strmatch_precompile(apr_pool_t *p, const char *s, int case_sensitive); /** @} */ #ifdef __cplusplus } #endif #endif /* !APR_STRMATCH_H */ 0707010001f191000081a4000017820000044e000000014b1d38c700000efc0000022d0000016a00000000000000000000002700000000reloc/include/apr-1/apr_thread_mutex.h /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef APR_THREAD_MUTEX_H #define APR_THREAD_MUTEX_H /** * @file apr_thread_mutex.h * @brief APR Thread Mutex Routines */ #include "apr.h" #include "apr_errno.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ #if APR_HAS_THREADS || defined(DOXYGEN) /** * @defgroup apr_thread_mutex Thread Mutex Routines * @ingroup APR * @{ */ /** Opaque thread-local mutex structure */ typedef struct apr_thread_mutex_t apr_thread_mutex_t; #define APR_THREAD_MUTEX_DEFAULT 0x0 /**< platform-optimal lock behavior */ #define APR_THREAD_MUTEX_NESTED 0x1 /**< enable nested (recursive) locks */ #define APR_THREAD_MUTEX_UNNESTED 0x2 /**< disable nested locks */ /* Delayed the include to avoid a circular reference */ #include "apr_pools.h" /** * Create and initialize a mutex that can be used to synchronize threads. * @param mutex the memory address where the newly created mutex will be * stored. * @param flags Or'ed value of: *
* APR_THREAD_MUTEX_DEFAULT platform-optimal lock behavior. * APR_THREAD_MUTEX_NESTED enable nested (recursive) locks. * APR_THREAD_MUTEX_UNNESTED disable nested locks (non-recursive). ** @param pool the pool from which to allocate the mutex. * @warning Be cautious in using APR_THREAD_MUTEX_DEFAULT. While this is the * most optimial mutex based on a given platform's performance charateristics, * it will behave as either a nested or an unnested lock. */ APR_DECLARE(apr_status_t) apr_thread_mutex_create(apr_thread_mutex_t **mutex, unsigned int flags, apr_pool_t *pool); /** * Acquire the lock for the given mutex. If the mutex is already locked, * the current thread will be put to sleep until the lock becomes available. * @param mutex the mutex on which to acquire the lock. */ APR_DECLARE(apr_status_t) apr_thread_mutex_lock(apr_thread_mutex_t *mutex); /** * Attempt to acquire the lock for the given mutex. If the mutex has already * been acquired, the call returns immediately with APR_EBUSY. Note: it * is important that the APR_STATUS_IS_EBUSY(s) macro be used to determine * if the return value was APR_EBUSY, for portability reasons. * @param mutex the mutex on which to attempt the lock acquiring. */ APR_DECLARE(apr_status_t) apr_thread_mutex_trylock(apr_thread_mutex_t *mutex); /** * Release the lock for the given mutex. * @param mutex the mutex from which to release the lock. */ APR_DECLARE(apr_status_t) apr_thread_mutex_unlock(apr_thread_mutex_t *mutex); /** * Destroy the mutex and free the memory associated with the lock. * @param mutex the mutex to destroy. */ APR_DECLARE(apr_status_t) apr_thread_mutex_destroy(apr_thread_mutex_t *mutex); /** * Get the pool used by this thread_mutex. * @return apr_pool_t the pool */ APR_POOL_DECLARE_ACCESSOR(thread_mutex); #endif /* APR_HAS_THREADS */ /** @} */ #ifdef __cplusplus } #endif #endif /* ! APR_THREAD_MUTEX_H */ 0707010001f174000081a4000017820000044e000000014b1d38c90000219c0000022d0000016a00000000000000000000002600000000reloc/include/apr-1/apr_ldap_option.h /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * @file apr_ldap_option.h * @brief APR-UTIL LDAP ldap_*_option() functions */ #ifndef APR_LDAP_OPTION_H #define APR_LDAP_OPTION_H /** * @addtogroup APR_Util_LDAP * @{ */ #include "apr_ldap.h" #if APR_HAS_LDAP #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /* * The following defines handle the different TLS certificate * options available. If these options are missing, APR will try and * emulate support for this using the deprecated ldap_start_tls_s() * function. */ /** * Set SSL mode to one of APR_LDAP_NONE, APR_LDAP_SSL, APR_LDAP_STARTTLS * or APR_LDAP_STOPTLS. */ #define APR_LDAP_OPT_TLS 0x6fff /** * Set zero or more CA certificates, client certificates or private * keys globally, or per connection (where supported). */ #define APR_LDAP_OPT_TLS_CERT 0x6ffe /** * Set the LDAP library to no verify the server certificate. This means * all servers are considered trusted. */ #define APR_LDAP_OPT_VERIFY_CERT 0x6ffd /** * Set the LDAP library to indicate if referrals should be chased during * LDAP searches. */ #define APR_LDAP_OPT_REFERRALS 0x6ffc /** * Set the LDAP library to indicate a maximum number of referral hops to * chase before giving up on the search. */ #define APR_LDAP_OPT_REFHOPLIMIT 0x6ffb /** * Structures for the apr_set_option() cases */ /** * APR_LDAP_OPT_TLS_CERT * * This structure includes possible options to set certificates on * system initialisation. Different SDKs have different certificate * requirements, and to achieve this multiple certificates must be * specified at once passed as an (apr_array_header_t *). * * Netscape: * Needs the CA cert database (cert7.db), the client cert database (key3.db) * and the security module file (secmod.db) set at the system initialisation * time. Three types are supported: APR_LDAP_CERT7_DB, APR_LDAP_KEY3_DB and * APR_LDAP_SECMOD. * * To specify a client cert connection, a certificate nickname needs to be * provided with a type of APR_LDAP_CERT. * int ldapssl_enable_clientauth( LDAP *ld, char *keynickname, * char *keypasswd, char *certnickname ); * keynickname is currently not used, and should be set to "" * * Novell: * Needs CA certificates and client certificates set at system initialisation * time. Three types are supported: APR_LDAP_CA*, APR_LDAP_CERT* and * APR_LDAP_KEY*. * * Certificates cannot be specified per connection. * * The functions used are: * ldapssl_add_trusted_cert(serverTrustedRoot, serverTrustedRootEncoding); * Clients certs and keys are set at system initialisation time with * int ldapssl_set_client_cert ( * void *cert, * int type * void *password); * type can be LDAPSSL_CERT_FILETYPE_B64 or LDAPSSL_CERT_FILETYPE_DER * ldapssl_set_client_private_key(clientPrivateKey, * clientPrivateKeyEncoding, * clientPrivateKeyPassword); * * OpenSSL: * Needs one or more CA certificates to be set at system initialisation time * with a type of APR_LDAP_CA*. * * May have one or more client certificates set per connection with a type of * APR_LDAP_CERT*, and keys with APR_LDAP_KEY*. */ /** CA certificate type unknown */ #define APR_LDAP_CA_TYPE_UNKNOWN 0 /** binary DER encoded CA certificate */ #define APR_LDAP_CA_TYPE_DER 1 /** PEM encoded CA certificate */ #define APR_LDAP_CA_TYPE_BASE64 2 /** Netscape/Mozilla cert7.db CA certificate database */ #define APR_LDAP_CA_TYPE_CERT7_DB 3 /** Netscape/Mozilla secmod file */ #define APR_LDAP_CA_TYPE_SECMOD 4 /** Client certificate type unknown */ #define APR_LDAP_CERT_TYPE_UNKNOWN 5 /** binary DER encoded client certificate */ #define APR_LDAP_CERT_TYPE_DER 6 /** PEM encoded client certificate */ #define APR_LDAP_CERT_TYPE_BASE64 7 /** Netscape/Mozilla key3.db client certificate database */ #define APR_LDAP_CERT_TYPE_KEY3_DB 8 /** Netscape/Mozilla client certificate nickname */ #define APR_LDAP_CERT_TYPE_NICKNAME 9 /** Private key type unknown */ #define APR_LDAP_KEY_TYPE_UNKNOWN 10 /** binary DER encoded private key */ #define APR_LDAP_KEY_TYPE_DER 11 /** PEM encoded private key */ #define APR_LDAP_KEY_TYPE_BASE64 12 /** PKCS#12 encoded client certificate */ #define APR_LDAP_CERT_TYPE_PFX 13 /** PKCS#12 encoded private key */ #define APR_LDAP_KEY_TYPE_PFX 14 /** Openldap directory full of base64-encoded cert * authorities with hashes in corresponding .0 directory */ #define APR_LDAP_CA_TYPE_CACERTDIR_BASE64 15 /** * Certificate structure. * * This structure is used to store certificate details. An array of * these structures is passed to apr_ldap_set_option() to set CA * and client certificates. * @param type Type of certificate APR_LDAP_*_TYPE_* * @param path Path, file or nickname of the certificate * @param password Optional password, can be NULL */ typedef struct apr_ldap_opt_tls_cert_t apr_ldap_opt_tls_cert_t; struct apr_ldap_opt_tls_cert_t { int type; const char *path; const char *password; }; /** * APR_LDAP_OPT_TLS * * This sets the SSL level on the LDAP handle. * * Netscape/Mozilla: * Supports SSL, but not STARTTLS * SSL is enabled by calling ldapssl_install_routines(). * * Novell: * Supports SSL and STARTTLS. * SSL is enabled by calling ldapssl_install_routines(). Note that calling * other ldap functions before ldapssl_install_routines() may cause this * function to fail. * STARTTLS is enabled by calling ldapssl_start_tls_s() after calling * ldapssl_install_routines() (check this). * * OpenLDAP: * Supports SSL and supports STARTTLS, but none of this is documented: * http://www.openldap.org/lists/openldap-software/200409/msg00618.html * Documentation for both SSL support and STARTTLS has been deleted from * the OpenLDAP documentation and website. */ /** No encryption */ #define APR_LDAP_NONE 0 /** SSL encryption (ldaps://) */ #define APR_LDAP_SSL 1 /** TLS encryption (STARTTLS) */ #define APR_LDAP_STARTTLS 2 /** end TLS encryption (STOPTLS) */ #define APR_LDAP_STOPTLS 3 /** * APR LDAP get option function * * This function gets option values from a given LDAP session if * one was specified. It maps to the native ldap_get_option() function. * @param pool The pool to use * @param ldap The LDAP handle * @param option The LDAP_OPT_* option to return * @param outvalue The value returned (if any) * @param result_err The apr_ldap_err_t structure contained detailed results * of the operation. */ APU_DECLARE_LDAP(int) apr_ldap_get_option(apr_pool_t *pool, LDAP *ldap, int option, void *outvalue, apr_ldap_err_t **result_err); /** * APR LDAP set option function * * This function sets option values to a given LDAP session if * one was specified. It maps to the native ldap_set_option() function. * * Where an option is not supported by an LDAP toolkit, this function * will try and apply legacy functions to achieve the same effect, * depending on the platform. * @param pool The pool to use * @param ldap The LDAP handle * @param option The LDAP_OPT_* option to set * @param invalue The value to set * @param result_err The apr_ldap_err_t structure contained detailed results * of the operation. */ APU_DECLARE_LDAP(int) apr_ldap_set_option(apr_pool_t *pool, LDAP *ldap, int option, const void *invalue, apr_ldap_err_t **result_err); #ifdef __cplusplus } #endif #endif /* APR_HAS_LDAP */ /** @} */ #endif /* APR_LDAP_OPTION_H */ 0707010001f189000081a4000017820000044e000000014b1d38c900000f2c0000022d0000016a00000000000000000000001f00000000reloc/include/apr-1/apr_sha1.h /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* NIST Secure Hash Algorithm * heavily modified by Uwe Hollerbach uh@alumni.caltech edu * from Peter C. Gutmann's implementation as found in * Applied Cryptography by Bruce Schneier * This code is hereby placed in the public domain */ #ifndef APR_SHA1_H #define APR_SHA1_H #include "apu.h" #include "apr_general.h" #ifdef __cplusplus extern "C" { #endif /** * @file apr_sha1.h * @brief APR-UTIL SHA1 library */ /** size of the SHA1 DIGEST */ #define APR_SHA1_DIGESTSIZE 20 /** * Define the Magic String prefix that identifies a password as being * hashed using our algorithm. */ #define APR_SHA1PW_ID "{SHA}" /** length of the SHA Password */ #define APR_SHA1PW_IDLEN 5 /** @see apr_sha1_ctx_t */ typedef struct apr_sha1_ctx_t apr_sha1_ctx_t; /** * SHA1 context structure */ struct apr_sha1_ctx_t { /** message digest */ apr_uint32_t digest[5]; /** 64-bit bit counts */ apr_uint32_t count_lo, count_hi; /** SHA data buffer */ apr_uint32_t data[16]; /** unprocessed amount in data */ int local; }; /** * Provide a means to SHA1 crypt/encode a plaintext password in a way which * makes password file compatible with those commonly use in netscape web * and ldap installations. * @param clear The plaintext password * @param len The length of the plaintext password * @param out The encrypted/encoded password * @note SHA1 support is useful for migration purposes, but is less * secure than Apache's password format, since Apache's (MD5) * password format uses a random eight character salt to generate * one of many possible hashes for the same password. Netscape * uses plain SHA1 without a salt, so the same password * will always generate the same hash, making it easier * to break since the search space is smaller. */ APU_DECLARE(void) apr_sha1_base64(const char *clear, int len, char *out); /** * Initialize the SHA digest * @param context The SHA context to initialize */ APU_DECLARE(void) apr_sha1_init(apr_sha1_ctx_t *context); /** * Update the SHA digest * @param context The SHA1 context to update * @param input The buffer to add to the SHA digest * @param inputLen The length of the input buffer */ APU_DECLARE(void) apr_sha1_update(apr_sha1_ctx_t *context, const char *input, unsigned int inputLen); /** * Update the SHA digest with binary data * @param context The SHA1 context to update * @param input The buffer to add to the SHA digest * @param inputLen The length of the input buffer */ APU_DECLARE(void) apr_sha1_update_binary(apr_sha1_ctx_t *context, const unsigned char *input, unsigned int inputLen); /** * Finish computing the SHA digest * @param digest the output buffer in which to store the digest * @param context The context to finalize */ APU_DECLARE(void) apr_sha1_final(unsigned char digest[APR_SHA1_DIGESTSIZE], apr_sha1_ctx_t *context); #ifdef __cplusplus } #endif #endif /* APR_SHA1_H */ 0707010001f162000081a4000017820000044e000000014b1d38c90000ea740000022d0000016a00000000000000000000002200000000reloc/include/apr-1/apr_buckets.h /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * @file apr_buckets.h * @brief APR-UTIL Buckets/Bucket Brigades */ #ifndef APR_BUCKETS_H #define APR_BUCKETS_H #if defined(APR_BUCKET_DEBUG) && !defined(APR_RING_DEBUG) #define APR_RING_DEBUG #endif #include "apu.h" #include "apr_network_io.h" #include "apr_file_io.h" #include "apr_general.h" #include "apr_mmap.h" #include "apr_errno.h" #include "apr_ring.h" #include "apr.h" #if APR_HAVE_SYS_UIO_H #include
* while (e != APR_BRIGADE_SENTINEL(b)) { * ... * e = APR_BUCKET_NEXT(e); * } ** @param b The brigade * @return The magic pointer value */ #define APR_BRIGADE_SENTINEL(b) APR_RING_SENTINEL(&(b)->list, apr_bucket, link) /** * Determine if the bucket brigade is empty * @param b The brigade to check * @return true or false */ #define APR_BRIGADE_EMPTY(b) APR_RING_EMPTY(&(b)->list, apr_bucket, link) /** * Return the first bucket in a brigade * @param b The brigade to query * @return The first bucket in the brigade */ #define APR_BRIGADE_FIRST(b) APR_RING_FIRST(&(b)->list) /** * Return the last bucket in a brigade * @param b The brigade to query * @return The last bucket in the brigade */ #define APR_BRIGADE_LAST(b) APR_RING_LAST(&(b)->list) /** * Insert a list of buckets at the front of a brigade * @param b The brigade to add to * @param e The first bucket in a list of buckets to insert */ #define APR_BRIGADE_INSERT_HEAD(b, e) do { \ apr_bucket *ap__b = (e); \ APR_RING_INSERT_HEAD(&(b)->list, ap__b, apr_bucket, link); \ APR_BRIGADE_CHECK_CONSISTENCY((b)); \ } while (0) /** * Insert a list of buckets at the end of a brigade * @param b The brigade to add to * @param e The first bucket in a list of buckets to insert */ #define APR_BRIGADE_INSERT_TAIL(b, e) do { \ apr_bucket *ap__b = (e); \ APR_RING_INSERT_TAIL(&(b)->list, ap__b, apr_bucket, link); \ APR_BRIGADE_CHECK_CONSISTENCY((b)); \ } while (0) /** * Concatenate brigade b onto the end of brigade a, leaving brigade b empty * @param a The first brigade * @param b The second brigade */ #define APR_BRIGADE_CONCAT(a, b) do { \ APR_RING_CONCAT(&(a)->list, &(b)->list, apr_bucket, link); \ APR_BRIGADE_CHECK_CONSISTENCY((a)); \ } while (0) /** * Prepend brigade b onto the beginning of brigade a, leaving brigade b empty * @param a The first brigade * @param b The second brigade */ #define APR_BRIGADE_PREPEND(a, b) do { \ APR_RING_PREPEND(&(a)->list, &(b)->list, apr_bucket, link); \ APR_BRIGADE_CHECK_CONSISTENCY((a)); \ } while (0) /** * Insert a list of buckets before a specified bucket * @param a The bucket to insert before * @param b The buckets to insert */ #define APR_BUCKET_INSERT_BEFORE(a, b) do { \ apr_bucket *ap__a = (a), *ap__b = (b); \ APR_RING_INSERT_BEFORE(ap__a, ap__b, link); \ APR_BUCKET_CHECK_CONSISTENCY(ap__a); \ } while (0) /** * Insert a list of buckets after a specified bucket * @param a The bucket to insert after * @param b The buckets to insert */ #define APR_BUCKET_INSERT_AFTER(a, b) do { \ apr_bucket *ap__a = (a), *ap__b = (b); \ APR_RING_INSERT_AFTER(ap__a, ap__b, link); \ APR_BUCKET_CHECK_CONSISTENCY(ap__a); \ } while (0) /** * Get the next bucket in the list * @param e The current bucket * @return The next bucket */ #define APR_BUCKET_NEXT(e) APR_RING_NEXT((e), link) /** * Get the previous bucket in the list * @param e The current bucket * @return The previous bucket */ #define APR_BUCKET_PREV(e) APR_RING_PREV((e), link) /** * Remove a bucket from its bucket brigade * @param e The bucket to remove */ #define APR_BUCKET_REMOVE(e) APR_RING_REMOVE((e), link) /** * Initialize a new bucket's prev/next pointers * @param e The bucket to initialize */ #define APR_BUCKET_INIT(e) APR_RING_ELEM_INIT((e), link) /** * Determine if a bucket contains metadata. An empty bucket is * safe to arbitrarily remove if and only if this is false. * @param e The bucket to inspect * @return true or false */ #define APR_BUCKET_IS_METADATA(e) ((e)->type->is_metadata) /** * Determine if a bucket is a FLUSH bucket * @param e The bucket to inspect * @return true or false */ #define APR_BUCKET_IS_FLUSH(e) ((e)->type == &apr_bucket_type_flush) /** * Determine if a bucket is an EOS bucket * @param e The bucket to inspect * @return true or false */ #define APR_BUCKET_IS_EOS(e) ((e)->type == &apr_bucket_type_eos) /** * Determine if a bucket is a FILE bucket * @param e The bucket to inspect * @return true or false */ #define APR_BUCKET_IS_FILE(e) ((e)->type == &apr_bucket_type_file) /** * Determine if a bucket is a PIPE bucket * @param e The bucket to inspect * @return true or false */ #define APR_BUCKET_IS_PIPE(e) ((e)->type == &apr_bucket_type_pipe) /** * Determine if a bucket is a SOCKET bucket * @param e The bucket to inspect * @return true or false */ #define APR_BUCKET_IS_SOCKET(e) ((e)->type == &apr_bucket_type_socket) /** * Determine if a bucket is a HEAP bucket * @param e The bucket to inspect * @return true or false */ #define APR_BUCKET_IS_HEAP(e) ((e)->type == &apr_bucket_type_heap) /** * Determine if a bucket is a TRANSIENT bucket * @param e The bucket to inspect * @return true or false */ #define APR_BUCKET_IS_TRANSIENT(e) ((e)->type == &apr_bucket_type_transient) /** * Determine if a bucket is a IMMORTAL bucket * @param e The bucket to inspect * @return true or false */ #define APR_BUCKET_IS_IMMORTAL(e) ((e)->type == &apr_bucket_type_immortal) #if APR_HAS_MMAP /** * Determine if a bucket is a MMAP bucket * @param e The bucket to inspect * @return true or false */ #define APR_BUCKET_IS_MMAP(e) ((e)->type == &apr_bucket_type_mmap) #endif /** * Determine if a bucket is a POOL bucket * @param e The bucket to inspect * @return true or false */ #define APR_BUCKET_IS_POOL(e) ((e)->type == &apr_bucket_type_pool) /* * General-purpose reference counting for the various bucket types. * * Any bucket type that keeps track of the resources it uses (i.e. * most of them except for IMMORTAL, TRANSIENT, and EOS) needs to * attach a reference count to the resource so that it can be freed * when the last bucket that uses it goes away. Resource-sharing may * occur because of bucket splits or buckets that refer to globally * cached data. */ /** @see apr_bucket_refcount */ typedef struct apr_bucket_refcount apr_bucket_refcount; /** * The structure used to manage the shared resource must start with an * apr_bucket_refcount which is updated by the general-purpose refcount * code. A pointer to the bucket-type-dependent private data structure * can be cast to a pointer to an apr_bucket_refcount and vice versa. */ struct apr_bucket_refcount { /** The number of references to this bucket */ int refcount; }; /* ***** Reference-counted bucket types ***** */ /** @see apr_bucket_heap */ typedef struct apr_bucket_heap apr_bucket_heap; /** * A bucket referring to data allocated off the heap. */ struct apr_bucket_heap { /** Number of buckets using this memory */ apr_bucket_refcount refcount; /** The start of the data actually allocated. This should never be * modified, it is only used to free the bucket. */ char *base; /** how much memory was allocated */ apr_size_t alloc_len; /** function to use to delete the data */ void (*free_func)(void *data); }; /** @see apr_bucket_pool */ typedef struct apr_bucket_pool apr_bucket_pool; /** * A bucket referring to data allocated from a pool */ struct apr_bucket_pool { /** The pool bucket must be able to be easily morphed to a heap * bucket if the pool gets cleaned up before all references are * destroyed. This apr_bucket_heap structure is populated automatically * when the pool gets cleaned up, and subsequent calls to pool_read() * will result in the apr_bucket in question being morphed into a * regular heap bucket. (To avoid having to do many extra refcount * manipulations and b->data manipulations, the apr_bucket_pool * struct actually *contains* the apr_bucket_heap struct that it * will become as its first element; the two share their * apr_bucket_refcount members.) */ apr_bucket_heap heap; /** The block of data actually allocated from the pool. * Segments of this block are referenced by adjusting * the start and length of the apr_bucket accordingly. * This will be NULL after the pool gets cleaned up. */ const char *base; /** The pool the data was allocated from. When the pool * is cleaned up, this gets set to NULL as an indicator * to pool_read() that the data is now on the heap and * so it should morph the bucket into a regular heap * bucket before continuing. */ apr_pool_t *pool; /** The freelist this structure was allocated from, which is * needed in the cleanup phase in order to allocate space on the heap */ apr_bucket_alloc_t *list; }; #if APR_HAS_MMAP /** @see apr_bucket_mmap */ typedef struct apr_bucket_mmap apr_bucket_mmap; /** * A bucket referring to an mmap()ed file */ struct apr_bucket_mmap { /** Number of buckets using this memory */ apr_bucket_refcount refcount; /** The mmap this sub_bucket refers to */ apr_mmap_t *mmap; }; #endif /** @see apr_bucket_file */ typedef struct apr_bucket_file apr_bucket_file; /** * A bucket referring to an file */ struct apr_bucket_file { /** Number of buckets using this memory */ apr_bucket_refcount refcount; /** The file this bucket refers to */ apr_file_t *fd; /** The pool into which any needed structures should * be created while reading from this file bucket */ apr_pool_t *readpool; #if APR_HAS_MMAP /** Whether this bucket should be memory-mapped if * a caller tries to read from it */ int can_mmap; #endif /* APR_HAS_MMAP */ }; /** @see apr_bucket_structs */ typedef union apr_bucket_structs apr_bucket_structs; /** * A union of all bucket structures so we know what * the max size is. */ union apr_bucket_structs { apr_bucket b; /**< Bucket */ apr_bucket_heap heap; /**< Heap */ apr_bucket_pool pool; /**< Pool */ #if APR_HAS_MMAP apr_bucket_mmap mmap; /**< MMap */ #endif apr_bucket_file file; /**< File */ }; /** * The amount that apr_bucket_alloc() should allocate in the common case. * Note: this is twice as big as apr_bucket_structs to allow breathing * room for third-party bucket types. */ #define APR_BUCKET_ALLOC_SIZE APR_ALIGN_DEFAULT(2*sizeof(apr_bucket_structs)) /* ***** Bucket Brigade Functions ***** */ /** * Create a new bucket brigade. The bucket brigade is originally empty. * @param p The pool to associate with the brigade. Data is not allocated out * of the pool, but a cleanup is registered. * @param list The bucket allocator to use * @return The empty bucket brigade */ APU_DECLARE(apr_bucket_brigade *) apr_brigade_create(apr_pool_t *p, apr_bucket_alloc_t *list); /** * destroy an entire bucket brigade. This includes destroying all of the * buckets within the bucket brigade's bucket list. * @param b The bucket brigade to destroy */ APU_DECLARE(apr_status_t) apr_brigade_destroy(apr_bucket_brigade *b); /** * empty out an entire bucket brigade. This includes destroying all of the * buckets within the bucket brigade's bucket list. This is similar to * apr_brigade_destroy(), except that it does not deregister the brigade's * pool cleanup function. * @param data The bucket brigade to clean up * @remark Generally, you should use apr_brigade_destroy(). This function * can be useful in situations where you have a single brigade that * you wish to reuse many times by destroying all of the buckets in * the brigade and putting new buckets into it later. */ APU_DECLARE(apr_status_t) apr_brigade_cleanup(void *data); /** * Move the buckets from the tail end of the existing brigade @param b into * the brigade @param a. If @param a is NULL a new brigade is created. Buckets * from @param e to the last bucket (inclusively) of brigade @param b are moved * from @param b to the returned brigade @param a. * @param b The brigade to split * @param e The first bucket to move * @param a The brigade which should be used for the result or NULL if * a new brigade should be created. * @return The brigade supplied in @param a or a new one if @param a was NULL. * @warning Note that this function allocates a new brigade if @param a is * NULL so memory consumption should be carefully considered. */ APU_DECLARE(apr_bucket_brigade *) apr_brigade_split_ex(apr_bucket_brigade *b, apr_bucket *e, apr_bucket_brigade *a); /** * Create a new bucket brigade and move the buckets from the tail end * of an existing brigade into the new brigade. Buckets from * @param e to the last bucket (inclusively) of brigade @param b * are moved from @param b to the returned brigade. * @param b The brigade to split * @param e The first bucket to move * @return The new brigade * @warning Note that this function always allocates a new brigade * so memory consumption should be carefully considered. */ APU_DECLARE(apr_bucket_brigade *) apr_brigade_split(apr_bucket_brigade *b, apr_bucket *e); /** * Partition a bucket brigade at a given offset (in bytes from the start of * the brigade). This is useful whenever a filter wants to use known ranges * of bytes from the brigade; the ranges can even overlap. * @param b The brigade to partition * @param point The offset at which to partition the brigade * @param after_point Returns a pointer to the first bucket after the partition * @return APR_SUCCESS on success, APR_INCOMPLETE if the contents of the * brigade were shorter than @a point, or an error code. * @remark if APR_INCOMPLETE is returned, @a after_point will be set to * the brigade sentinel. */ APU_DECLARE(apr_status_t) apr_brigade_partition(apr_bucket_brigade *b, apr_off_t point, apr_bucket **after_point); /** * Return the total length of the brigade. * @param bb The brigade to compute the length of * @param read_all Read unknown-length buckets to force a size * @param length Returns the length of the brigade (up to the end, or up * to a bucket read error), or -1 if the brigade has buckets * of indeterminate length and read_all is 0. */ APU_DECLARE(apr_status_t) apr_brigade_length(apr_bucket_brigade *bb, int read_all, apr_off_t *length); /** * Take a bucket brigade and store the data in a flat char* * @param bb The bucket brigade to create the char* from * @param c The char* to write into * @param len The maximum length of the char array. On return, it is the * actual length of the char array. */ APU_DECLARE(apr_status_t) apr_brigade_flatten(apr_bucket_brigade *bb, char *c, apr_size_t *len); /** * Creates a pool-allocated string representing a flat bucket brigade * @param bb The bucket brigade to create the char array from * @param c On return, the allocated char array * @param len On return, the length of the char array. * @param pool The pool to allocate the string from. */ APU_DECLARE(apr_status_t) apr_brigade_pflatten(apr_bucket_brigade *bb, char **c, apr_size_t *len, apr_pool_t *pool); /** * Split a brigade to represent one LF line. * @param bbOut The bucket brigade that will have the LF line appended to. * @param bbIn The input bucket brigade to search for a LF-line. * @param block The blocking mode to be used to split the line. * @param maxbytes The maximum bytes to read. If this many bytes are seen * without a LF, the brigade will contain a partial line. */ APU_DECLARE(apr_status_t) apr_brigade_split_line(apr_bucket_brigade *bbOut, apr_bucket_brigade *bbIn, apr_read_type_e block, apr_off_t maxbytes); /** * create an iovec of the elements in a bucket_brigade... return number * of elements used. This is useful for writing to a file or to the * network efficiently. * @param b The bucket brigade to create the iovec from * @param vec The iovec to create * @param nvec The number of elements in the iovec. On return, it is the * number of iovec elements actually filled out. */ APU_DECLARE(apr_status_t) apr_brigade_to_iovec(apr_bucket_brigade *b, struct iovec *vec, int *nvec); /** * This function writes a list of strings into a bucket brigade. * @param b The bucket brigade to add to * @param flush The flush function to use if the brigade is full * @param ctx The structure to pass to the flush function * @param va A list of strings to add * @return APR_SUCCESS or error code. */ APU_DECLARE(apr_status_t) apr_brigade_vputstrs(apr_bucket_brigade *b, apr_brigade_flush flush, void *ctx, va_list va); /** * This function writes a string into a bucket brigade. * @param b The bucket brigade to add to * @param flush The flush function to use if the brigade is full * @param ctx The structure to pass to the flush function * @param str The string to add * @param nbyte The number of bytes to write * @return APR_SUCCESS or error code */ APU_DECLARE(apr_status_t) apr_brigade_write(apr_bucket_brigade *b, apr_brigade_flush flush, void *ctx, const char *str, apr_size_t nbyte); /** * This function writes multiple strings into a bucket brigade. * @param b The bucket brigade to add to * @param flush The flush function to use if the brigade is full * @param ctx The structure to pass to the flush function * @param vec The strings to add (address plus length for each) * @param nvec The number of entries in iovec * @return APR_SUCCESS or error code */ APU_DECLARE(apr_status_t) apr_brigade_writev(apr_bucket_brigade *b, apr_brigade_flush flush, void *ctx, const struct iovec *vec, apr_size_t nvec); /** * This function writes a string into a bucket brigade. * @param bb The bucket brigade to add to * @param flush The flush function to use if the brigade is full * @param ctx The structure to pass to the flush function * @param str The string to add * @return APR_SUCCESS or error code */ APU_DECLARE(apr_status_t) apr_brigade_puts(apr_bucket_brigade *bb, apr_brigade_flush flush, void *ctx, const char *str); /** * This function writes a character into a bucket brigade. * @param b The bucket brigade to add to * @param flush The flush function to use if the brigade is full * @param ctx The structure to pass to the flush function * @param c The character to add * @return APR_SUCCESS or error code */ APU_DECLARE(apr_status_t) apr_brigade_putc(apr_bucket_brigade *b, apr_brigade_flush flush, void *ctx, const char c); /** * This function writes an unspecified number of strings into a bucket brigade. * @param b The bucket brigade to add to * @param flush The flush function to use if the brigade is full * @param ctx The structure to pass to the flush function * @param ... The strings to add * @return APR_SUCCESS or error code */ APU_DECLARE_NONSTD(apr_status_t) apr_brigade_putstrs(apr_bucket_brigade *b, apr_brigade_flush flush, void *ctx, ...); /** * Evaluate a printf and put the resulting string at the end * of the bucket brigade. * @param b The brigade to write to * @param flush The flush function to use if the brigade is full * @param ctx The structure to pass to the flush function * @param fmt The format of the string to write * @param ... The arguments to fill out the format * @return APR_SUCCESS or error code */ APU_DECLARE_NONSTD(apr_status_t) apr_brigade_printf(apr_bucket_brigade *b, apr_brigade_flush flush, void *ctx, const char *fmt, ...) __attribute__((format(printf,4,5))); /** * Evaluate a printf and put the resulting string at the end * of the bucket brigade. * @param b The brigade to write to * @param flush The flush function to use if the brigade is full * @param ctx The structure to pass to the flush function * @param fmt The format of the string to write * @param va The arguments to fill out the format * @return APR_SUCCESS or error code */ APU_DECLARE(apr_status_t) apr_brigade_vprintf(apr_bucket_brigade *b, apr_brigade_flush flush, void *ctx, const char *fmt, va_list va); /** * Utility function to insert a file (or a segment of a file) onto the * end of the brigade. The file is split into multiple buckets if it * is larger than the maximum size which can be represented by a * single bucket. * @param bb the brigade to insert into * @param f the file to insert * @param start the offset of the start of the segment * @param len the length of the segment of the file to insert * @param p pool from which file buckets are allocated * @return the last bucket inserted */ APU_DECLARE(apr_bucket *) apr_brigade_insert_file(apr_bucket_brigade *bb, apr_file_t *f, apr_off_t start, apr_off_t len, apr_pool_t *p); /* ***** Bucket freelist functions ***** */ /** * Create a bucket allocator. * @param p This pool's underlying apr_allocator_t is used to allocate memory * for the bucket allocator. When the pool is destroyed, the bucket * allocator's cleanup routine will free all memory that has been * allocated from it. * @remark The reason the allocator gets its memory from the pool's * apr_allocator_t rather than from the pool itself is because * the bucket allocator will free large memory blocks back to the * allocator when it's done with them, thereby preventing memory * footprint growth that would occur if we allocated from the pool. * @warning The allocator must never be used by more than one thread at a time. */ APU_DECLARE_NONSTD(apr_bucket_alloc_t *) apr_bucket_alloc_create(apr_pool_t *p); /** * Create a bucket allocator. * @param allocator This apr_allocator_t is used to allocate both the bucket * allocator and all memory handed out by the bucket allocator. The * caller is responsible for destroying the bucket allocator and the * apr_allocator_t -- no automatic cleanups will happen. * @warning The allocator must never be used by more than one thread at a time. */ APU_DECLARE_NONSTD(apr_bucket_alloc_t *) apr_bucket_alloc_create_ex(apr_allocator_t *allocator); /** * Destroy a bucket allocator. * @param list The allocator to be destroyed */ APU_DECLARE_NONSTD(void) apr_bucket_alloc_destroy(apr_bucket_alloc_t *list); /** * Allocate memory for use by the buckets. * @param size The amount to allocate. * @param list The allocator from which to allocate the memory. */ APU_DECLARE_NONSTD(void *) apr_bucket_alloc(apr_size_t size, apr_bucket_alloc_t *list); /** * Free memory previously allocated with apr_bucket_alloc(). * @param block The block of memory to be freed. */ APU_DECLARE_NONSTD(void) apr_bucket_free(void *block); /* ***** Bucket Functions ***** */ /** * Free the resources used by a bucket. If multiple buckets refer to * the same resource it is freed when the last one goes away. * @see apr_bucket_delete() * @param e The bucket to destroy */ #define apr_bucket_destroy(e) do { \ (e)->type->destroy((e)->data); \ (e)->free(e); \ } while (0) /** * Delete a bucket by removing it from its brigade (if any) and then * destroying it. * @remark This mainly acts as an aid in avoiding code verbosity. It is * the preferred exact equivalent to: *
* APR_BUCKET_REMOVE(e); * apr_bucket_destroy(e); ** @param e The bucket to delete */ #define apr_bucket_delete(e) do { \ APR_BUCKET_REMOVE(e); \ apr_bucket_destroy(e); \ } while (0) /** * Read the data from the bucket. * * If it is not practical to return all * the data in the bucket, the current bucket is split and replaced by * two buckets, the first representing the data returned in this call, * and the second representing the rest of the data as yet unread. The * original bucket will become the first bucket after this call. * * (It is assumed that the bucket is a member of a brigade when this * function is called). * @param e The bucket to read from * @param str The location to store the data in * @param len The amount of data read * @param block Whether the read function blocks */ #define apr_bucket_read(e,str,len,block) (e)->type->read(e, str, len, block) /** * Setaside data so that stack data is not destroyed on returning from * the function * @param e The bucket to setaside * @param p The pool to setaside into */ #define apr_bucket_setaside(e,p) (e)->type->setaside(e,p) /** * Split one bucket in two at the point provided. * * Once split, the original bucket becomes the first of the two new buckets. * * (It is assumed that the bucket is a member of a brigade when this * function is called). * @param e The bucket to split * @param point The offset to split the bucket at */ #define apr_bucket_split(e,point) (e)->type->split(e, point) /** * Copy a bucket. * @param e The bucket to copy * @param c Returns a pointer to the new bucket */ #define apr_bucket_copy(e,c) (e)->type->copy(e, c) /* Bucket type handling */ /** * This function simply returns APR_SUCCESS to denote that the bucket does * not require anything to happen for its setaside() function. This is * appropriate for buckets that have "immortal" data -- the data will live * at least as long as the bucket. * @param data The bucket to setaside * @param pool The pool defining the desired lifetime of the bucket data * @return APR_SUCCESS */ APU_DECLARE_NONSTD(apr_status_t) apr_bucket_setaside_noop(apr_bucket *data, apr_pool_t *pool); /** * A place holder function that signifies that the setaside function was not * implemented for this bucket * @param data The bucket to setaside * @param pool The pool defining the desired lifetime of the bucket data * @return APR_ENOTIMPL */ APU_DECLARE_NONSTD(apr_status_t) apr_bucket_setaside_notimpl(apr_bucket *data, apr_pool_t *pool); /** * A place holder function that signifies that the split function was not * implemented for this bucket * @param data The bucket to split * @param point The location to split the bucket * @return APR_ENOTIMPL */ APU_DECLARE_NONSTD(apr_status_t) apr_bucket_split_notimpl(apr_bucket *data, apr_size_t point); /** * A place holder function that signifies that the copy function was not * implemented for this bucket * @param e The bucket to copy * @param c Returns a pointer to the new bucket * @return APR_ENOTIMPL */ APU_DECLARE_NONSTD(apr_status_t) apr_bucket_copy_notimpl(apr_bucket *e, apr_bucket **c); /** * A place holder function that signifies that this bucket does not need * to do anything special to be destroyed. That's only the case for buckets * that either have no data (metadata buckets) or buckets whose data pointer * points to something that's not a bucket-type-specific structure, as with * simple buckets where data points to a string and pipe buckets where data * points directly to the apr_file_t. * @param data The bucket data to destroy */ APU_DECLARE_NONSTD(void) apr_bucket_destroy_noop(void *data); /** * There is no apr_bucket_destroy_notimpl, because destruction is required * to be implemented (it could be a noop, but only if that makes sense for * the bucket type) */ /* There is no apr_bucket_read_notimpl, because it is a required function */ /* All of the bucket types implemented by the core */ /** * The flush bucket type. This signifies that all data should be flushed to * the next filter. The flush bucket should be sent with the other buckets. */ APU_DECLARE_DATA extern const apr_bucket_type_t apr_bucket_type_flush; /** * The EOS bucket type. This signifies that there will be no more data, ever. * All filters MUST send all data to the next filter when they receive a * bucket of this type */ APU_DECLARE_DATA extern const apr_bucket_type_t apr_bucket_type_eos; /** * The FILE bucket type. This bucket represents a file on disk */ APU_DECLARE_DATA extern const apr_bucket_type_t apr_bucket_type_file; /** * The HEAP bucket type. This bucket represents a data allocated from the * heap. */ APU_DECLARE_DATA extern const apr_bucket_type_t apr_bucket_type_heap; #if APR_HAS_MMAP /** * The MMAP bucket type. This bucket represents an MMAP'ed file */ APU_DECLARE_DATA extern const apr_bucket_type_t apr_bucket_type_mmap; #endif /** * The POOL bucket type. This bucket represents a data that was allocated * from a pool. IF this bucket is still available when the pool is cleared, * the data is copied on to the heap. */ APU_DECLARE_DATA extern const apr_bucket_type_t apr_bucket_type_pool; /** * The PIPE bucket type. This bucket represents a pipe to another program. */ APU_DECLARE_DATA extern const apr_bucket_type_t apr_bucket_type_pipe; /** * The IMMORTAL bucket type. This bucket represents a segment of data that * the creator is willing to take responsibility for. The core will do * nothing with the data in an immortal bucket */ APU_DECLARE_DATA extern const apr_bucket_type_t apr_bucket_type_immortal; /** * The TRANSIENT bucket type. This bucket represents a data allocated off * the stack. When the setaside function is called, this data is copied on * to the heap */ APU_DECLARE_DATA extern const apr_bucket_type_t apr_bucket_type_transient; /** * The SOCKET bucket type. This bucket represents a socket to another machine */ APU_DECLARE_DATA extern const apr_bucket_type_t apr_bucket_type_socket; /* ***** Simple buckets ***** */ /** * Split a simple bucket into two at the given point. Most non-reference * counting buckets that allow multiple references to the same block of * data (eg transient and immortal) will use this as their split function * without any additional type-specific handling. * @param b The bucket to be split * @param point The offset of the first byte in the new bucket * @return APR_EINVAL if the point is not within the bucket; * APR_ENOMEM if allocation failed; * or APR_SUCCESS */ APU_DECLARE_NONSTD(apr_status_t) apr_bucket_simple_split(apr_bucket *b, apr_size_t point); /** * Copy a simple bucket. Most non-reference-counting buckets that allow * multiple references to the same block of data (eg transient and immortal) * will use this as their copy function without any additional type-specific * handling. * @param a The bucket to copy * @param b Returns a pointer to the new bucket * @return APR_ENOMEM if allocation failed; * or APR_SUCCESS */ APU_DECLARE_NONSTD(apr_status_t) apr_bucket_simple_copy(apr_bucket *a, apr_bucket **b); /* ***** Shared, reference-counted buckets ***** */ /** * Initialize a bucket containing reference-counted data that may be * shared. The caller must allocate the bucket if necessary and * initialize its type-dependent fields, and allocate and initialize * its own private data structure. This function should only be called * by type-specific bucket creation functions. * @param b The bucket to initialize * @param data A pointer to the private data structure * with the reference count at the start * @param start The start of the data in the bucket * relative to the private base pointer * @param length The length of the data in the bucket * @return The new bucket, or NULL if allocation failed */ APU_DECLARE(apr_bucket *) apr_bucket_shared_make(apr_bucket *b, void *data, apr_off_t start, apr_size_t length); /** * Decrement the refcount of the data in the bucket. This function * should only be called by type-specific bucket destruction functions. * @param data The private data pointer from the bucket to be destroyed * @return TRUE or FALSE; TRUE if the reference count is now * zero, indicating that the shared resource itself can * be destroyed by the caller. */ APU_DECLARE(int) apr_bucket_shared_destroy(void *data); /** * Split a bucket into two at the given point, and adjust the refcount * to the underlying data. Most reference-counting bucket types will * be able to use this function as their split function without any * additional type-specific handling. * @param b The bucket to be split * @param point The offset of the first byte in the new bucket * @return APR_EINVAL if the point is not within the bucket; * APR_ENOMEM if allocation failed; * or APR_SUCCESS */ APU_DECLARE_NONSTD(apr_status_t) apr_bucket_shared_split(apr_bucket *b, apr_size_t point); /** * Copy a refcounted bucket, incrementing the reference count. Most * reference-counting bucket types will be able to use this function * as their copy function without any additional type-specific handling. * @param a The bucket to copy * @param b Returns a pointer to the new bucket * @return APR_ENOMEM if allocation failed; or APR_SUCCESS */ APU_DECLARE_NONSTD(apr_status_t) apr_bucket_shared_copy(apr_bucket *a, apr_bucket **b); /* ***** Functions to Create Buckets of varying types ***** */ /* * Each bucket type foo has two initialization functions: * apr_bucket_foo_make which sets up some already-allocated memory as a * bucket of type foo; and apr_bucket_foo_create which allocates memory * for the bucket, calls apr_bucket_make_foo, and initializes the * bucket's list pointers. The apr_bucket_foo_make functions are used * inside the bucket code to change the type of buckets in place; * other code should call apr_bucket_foo_create. All the initialization * functions change nothing if they fail. */ /** * Create an End of Stream bucket. This indicates that there is no more data * coming from down the filter stack. All filters should flush at this point. * @param list The freelist from which this bucket should be allocated * @return The new bucket, or NULL if allocation failed */ APU_DECLARE(apr_bucket *) apr_bucket_eos_create(apr_bucket_alloc_t *list); /** * Make the bucket passed in an EOS bucket. This indicates that there is no * more data coming from down the filter stack. All filters should flush at * this point. * @param b The bucket to make into an EOS bucket * @return The new bucket, or NULL if allocation failed */ APU_DECLARE(apr_bucket *) apr_bucket_eos_make(apr_bucket *b); /** * Create a flush bucket. This indicates that filters should flush their * data. There is no guarantee that they will flush it, but this is the * best we can do. * @param list The freelist from which this bucket should be allocated * @return The new bucket, or NULL if allocation failed */ APU_DECLARE(apr_bucket *) apr_bucket_flush_create(apr_bucket_alloc_t *list); /** * Make the bucket passed in a FLUSH bucket. This indicates that filters * should flush their data. There is no guarantee that they will flush it, * but this is the best we can do. * @param b The bucket to make into a FLUSH bucket * @return The new bucket, or NULL if allocation failed */ APU_DECLARE(apr_bucket *) apr_bucket_flush_make(apr_bucket *b); /** * Create a bucket referring to long-lived data. * @param buf The data to insert into the bucket * @param nbyte The size of the data to insert. * @param list The freelist from which this bucket should be allocated * @return The new bucket, or NULL if allocation failed */ APU_DECLARE(apr_bucket *) apr_bucket_immortal_create(const char *buf, apr_size_t nbyte, apr_bucket_alloc_t *list); /** * Make the bucket passed in a bucket refer to long-lived data * @param b The bucket to make into a IMMORTAL bucket * @param buf The data to insert into the bucket * @param nbyte The size of the data to insert. * @return The new bucket, or NULL if allocation failed */ APU_DECLARE(apr_bucket *) apr_bucket_immortal_make(apr_bucket *b, const char *buf, apr_size_t nbyte); /** * Create a bucket referring to data on the stack. * @param buf The data to insert into the bucket * @param nbyte The size of the data to insert. * @param list The freelist from which this bucket should be allocated * @return The new bucket, or NULL if allocation failed */ APU_DECLARE(apr_bucket *) apr_bucket_transient_create(const char *buf, apr_size_t nbyte, apr_bucket_alloc_t *list); /** * Make the bucket passed in a bucket refer to stack data * @param b The bucket to make into a TRANSIENT bucket * @param buf The data to insert into the bucket * @param nbyte The size of the data to insert. * @return The new bucket, or NULL if allocation failed */ APU_DECLARE(apr_bucket *) apr_bucket_transient_make(apr_bucket *b, const char *buf, apr_size_t nbyte); /** * Create a bucket referring to memory on the heap. If the caller asks * for the data to be copied, this function always allocates 4K of * memory so that more data can be added to the bucket without * requiring another allocation. Therefore not all the data may be put * into the bucket. If copying is not requested then the bucket takes * over responsibility for free()ing the memory. * @param buf The buffer to insert into the bucket * @param nbyte The size of the buffer to insert. * @param free_func Function to use to free the data; NULL indicates that the * bucket should make a copy of the data * @param list The freelist from which this bucket should be allocated * @return The new bucket, or NULL if allocation failed */ APU_DECLARE(apr_bucket *) apr_bucket_heap_create(const char *buf, apr_size_t nbyte, void (*free_func)(void *data), apr_bucket_alloc_t *list); /** * Make the bucket passed in a bucket refer to heap data * @param b The bucket to make into a HEAP bucket * @param buf The buffer to insert into the bucket * @param nbyte The size of the buffer to insert. * @param free_func Function to use to free the data; NULL indicates that the * bucket should make a copy of the data * @return The new bucket, or NULL if allocation failed */ APU_DECLARE(apr_bucket *) apr_bucket_heap_make(apr_bucket *b, const char *buf, apr_size_t nbyte, void (*free_func)(void *data)); /** * Create a bucket referring to memory allocated from a pool. * * @param buf The buffer to insert into the bucket * @param length The number of bytes referred to by this bucket * @param pool The pool the memory was allocated from * @param list The freelist from which this bucket should be allocated * @return The new bucket, or NULL if allocation failed */ APU_DECLARE(apr_bucket *) apr_bucket_pool_create(const char *buf, apr_size_t length, apr_pool_t *pool, apr_bucket_alloc_t *list); /** * Make the bucket passed in a bucket refer to pool data * @param b The bucket to make into a pool bucket * @param buf The buffer to insert into the bucket * @param length The number of bytes referred to by this bucket * @param pool The pool the memory was allocated from * @return The new bucket, or NULL if allocation failed */ APU_DECLARE(apr_bucket *) apr_bucket_pool_make(apr_bucket *b, const char *buf, apr_size_t length, apr_pool_t *pool); #if APR_HAS_MMAP /** * Create a bucket referring to mmap()ed memory. * @param mm The mmap to insert into the bucket * @param start The offset of the first byte in the mmap * that this bucket refers to * @param length The number of bytes referred to by this bucket * @param list The freelist from which this bucket should be allocated * @return The new bucket, or NULL if allocation failed */ APU_DECLARE(apr_bucket *) apr_bucket_mmap_create(apr_mmap_t *mm, apr_off_t start, apr_size_t length, apr_bucket_alloc_t *list); /** * Make the bucket passed in a bucket refer to an MMAP'ed file * @param b The bucket to make into a MMAP bucket * @param mm The mmap to insert into the bucket * @param start The offset of the first byte in the mmap * that this bucket refers to * @param length The number of bytes referred to by this bucket * @return The new bucket, or NULL if allocation failed */ APU_DECLARE(apr_bucket *) apr_bucket_mmap_make(apr_bucket *b, apr_mmap_t *mm, apr_off_t start, apr_size_t length); #endif /** * Create a bucket referring to a socket. * @param thissock The socket to put in the bucket * @param list The freelist from which this bucket should be allocated * @return The new bucket, or NULL if allocation failed */ APU_DECLARE(apr_bucket *) apr_bucket_socket_create(apr_socket_t *thissock, apr_bucket_alloc_t *list); /** * Make the bucket passed in a bucket refer to a socket * @param b The bucket to make into a SOCKET bucket * @param thissock The socket to put in the bucket * @return The new bucket, or NULL if allocation failed */ APU_DECLARE(apr_bucket *) apr_bucket_socket_make(apr_bucket *b, apr_socket_t *thissock); /** * Create a bucket referring to a pipe. * @param thispipe The pipe to put in the bucket * @param list The freelist from which this bucket should be allocated * @return The new bucket, or NULL if allocation failed */ APU_DECLARE(apr_bucket *) apr_bucket_pipe_create(apr_file_t *thispipe, apr_bucket_alloc_t *list); /** * Make the bucket passed in a bucket refer to a pipe * @param b The bucket to make into a PIPE bucket * @param thispipe The pipe to put in the bucket * @return The new bucket, or NULL if allocation failed */ APU_DECLARE(apr_bucket *) apr_bucket_pipe_make(apr_bucket *b, apr_file_t *thispipe); /** * Create a bucket referring to a file. * @param fd The file to put in the bucket * @param offset The offset where the data of interest begins in the file * @param len The amount of data in the file we are interested in * @param p The pool into which any needed structures should be created * while reading from this file bucket * @param list The freelist from which this bucket should be allocated * @return The new bucket, or NULL if allocation failed * @remark If the file is truncated such that the segment of the file * referenced by the bucket no longer exists, an attempt to read * from the bucket will fail with APR_EOF. * @remark apr_brigade_insert_file() should generally be used to * insert files into brigades, since that function can correctly * handle large file issues. */ APU_DECLARE(apr_bucket *) apr_bucket_file_create(apr_file_t *fd, apr_off_t offset, apr_size_t len, apr_pool_t *p, apr_bucket_alloc_t *list); /** * Make the bucket passed in a bucket refer to a file * @param b The bucket to make into a FILE bucket * @param fd The file to put in the bucket * @param offset The offset where the data of interest begins in the file * @param len The amount of data in the file we are interested in * @param p The pool into which any needed structures should be created * while reading from this file bucket * @return The new bucket, or NULL if allocation failed */ APU_DECLARE(apr_bucket *) apr_bucket_file_make(apr_bucket *b, apr_file_t *fd, apr_off_t offset, apr_size_t len, apr_pool_t *p); /** * Enable or disable memory-mapping for a FILE bucket (default is enabled) * @param b The bucket * @param enabled Whether memory-mapping should be enabled * @return APR_SUCCESS normally, or an error code if the operation fails */ APU_DECLARE(apr_status_t) apr_bucket_file_enable_mmap(apr_bucket *b, int enabled); /** @} */ #ifdef __cplusplus } #endif #endif /* !APR_BUCKETS_H */ 0707010001f198000081a4000017820000044e000000014b1d38ca000008360000022d0000016a00000000000000000000001f00000000reloc/include/apr-1/apr_uuid.h /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * @file apr_uuid.h * @brief APR UUID library */ #ifndef APR_UUID_H #define APR_UUID_H #include "apu.h" #include "apr_errno.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** * @defgroup APR_UUID UUID Handling * @ingroup APR * @{ */ /** * we represent a UUID as a block of 16 bytes. */ typedef struct { unsigned char data[16]; /**< the actual UUID */ } apr_uuid_t; /** UUIDs are formatted as: 00112233-4455-6677-8899-AABBCCDDEEFF */ #define APR_UUID_FORMATTED_LENGTH 36 /** * Generate and return a (new) UUID * @param uuid The resulting UUID */ APU_DECLARE(void) apr_uuid_get(apr_uuid_t *uuid); /** * Format a UUID into a string, following the standard format * @param buffer The buffer to place the formatted UUID string into. It must * be at least APR_UUID_FORMATTED_LENGTH + 1 bytes long to hold * the formatted UUID and a null terminator * @param uuid The UUID to format */ APU_DECLARE(void) apr_uuid_format(char *buffer, const apr_uuid_t *uuid); /** * Parse a standard-format string into a UUID * @param uuid The resulting UUID * @param uuid_str The formatted UUID */ APU_DECLARE(apr_status_t) apr_uuid_parse(apr_uuid_t *uuid, const char *uuid_str); /** @} */ #ifdef __cplusplus } #endif #endif /* APR_UUID_H */ 0707010001f175000081a4000017820000044e000000014b1d38c900000c600000022d0000016a00000000000000000000002600000000reloc/include/apr-1/apr_ldap_rebind.h /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * The APR LDAP rebind functions provide an implementation of * a rebind procedure that can be used to allow clients to chase referrals, * using the same credentials used to log in originally. * * Use of this implementation is optional. * * @file apr_ldap_rebind.h * @brief Apache LDAP library */ #ifndef APU_LDAP_REBIND_H #define APU_LDAP_REBIND_H /** * @addtogroup APR_Util_LDAP * @{ **/ #if defined(DOXYGEN) #include "apr_ldap.h" #endif /* * Handle the case when LDAP is enabled */ #if APR_HAS_LDAP /** * APR LDAP initialize rebind lock * * This function creates the lock for controlling access to the xref list.. * @param pool Pool to use when creating the xref_lock. */ APU_DECLARE_LDAP(apr_status_t) apr_ldap_rebind_init(apr_pool_t *pool); /** * APR LDAP rebind_add function * * This function creates a cross reference entry for the specified ldap * connection. The rebind callback function will look up this ldap * connection so it can retrieve the bindDN and bindPW for use in any * binds while referrals are being chased. * * This function will add the callback to the LDAP handle passed in. * * A cleanup is registered within the pool provided to remove this * entry when the pool is removed. Alternatively apr_ldap_rebind_remove() * can be called to explicitly remove the entry at will. * * @param pool The pool to use * @param ld The LDAP connectionhandle * @param bindDN The bind DN to be used for any binds while chasing * referrals on this ldap connection. * @param bindPW The bind Password to be used for any binds while * chasing referrals on this ldap connection. */ APU_DECLARE_LDAP(apr_status_t) apr_ldap_rebind_add(apr_pool_t *pool, LDAP *ld, const char *bindDN, const char *bindPW); /** * APR LDAP rebind_remove function * * This function removes the rebind cross reference entry for the * specified ldap connection. * * If not explicitly removed, this function will be called automatically * when the pool is cleaned up. * * @param ld The LDAP connectionhandle */ APU_DECLARE_LDAP(apr_status_t) apr_ldap_rebind_remove(LDAP *ld); #endif /* APR_HAS_LDAP */ /** @} */ #endif /* APU_LDAP_REBIND_H */ 0707010001f19a000081a4000017820000044e000000014b1d38c800000bdd0000022d0000016a00000000000000000000001f00000000reloc/include/apr-1/apr_want.h /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "apr.h" /* configuration data */ /** * @file apr_want.h * @brief APR Standard Headers Support * *
* Features: * * APR_WANT_STRFUNC: strcmp, strcat, strcpy, etc * APR_WANT_MEMFUNC: memcmp, memcpy, etc * APR_WANT_STDIO:*/ /* --------------------------------------------------------------------- */ #ifdef APR_WANT_STRFUNC #if APR_HAVE_STRING_H #includeand related bits * APR_WANT_IOVEC: struct iovec * APR_WANT_BYTEFUNC: htons, htonl, ntohl, ntohs * * Typical usage: * * #define APR_WANT_STRFUNC * #define APR_WANT_MEMFUNC * #include "apr_want.h" * * The appropriate headers will be included. * * Note: it is safe to use this in a header (it won't interfere with other * headers' or source files' use of apr_want.h) *
* APR_READ open for reading * APR_WRITE open for writing * APR_CREATE create the file if not there * APR_APPEND file ptr is set to end prior to all writes * APR_TRUNCATE set length to zero if file exists * APR_BINARY not a text file (This flag is ignored on * UNIX because it has no meaning) * APR_BUFFERED buffer the data. Default is non-buffered * APR_EXCL return error if APR_CREATE and file exists * APR_DELONCLOSE delete the file after closing. * APR_XTHREAD Platform dependent tag to open the file * for use across multiple threads * APR_SHARELOCK Platform dependent support for higher * level locked read/write access to support * writes across process/machines * APR_FILE_NOCLEANUP Do not register a cleanup with the pool * passed in on the pool argument (see below). * The apr_os_file_t handle in apr_file_t will not * be closed when the pool is destroyed. * APR_SENDFILE_ENABLED Open with appropriate platform semantics * for sendfile operations. Advisory only, * apr_socket_sendfile does not check this flag. ** @param perm Access permissions for file. * @param pool The pool to use. * @remark If perm is APR_OS_DEFAULT and the file is being created, * appropriate default permissions will be used. * @remark By default, the returned file descriptor will not be * inherited by child processes created by apr_proc_create(). This * can be changed using apr_file_inherit_set(). */ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **newf, const char *fname, apr_int32_t flag, apr_fileperms_t perm, apr_pool_t *pool); /** * Close the specified file. * @param file The file descriptor to close. */ APR_DECLARE(apr_status_t) apr_file_close(apr_file_t *file); /** * Delete the specified file. * @param path The full path to the file (using / on all systems) * @param pool The pool to use. * @remark If the file is open, it won't be removed until all * instances are closed. */ APR_DECLARE(apr_status_t) apr_file_remove(const char *path, apr_pool_t *pool); /** * Rename the specified file. * @param from_path The full path to the original file (using / on all systems) * @param to_path The full path to the new file (using / on all systems) * @param pool The pool to use. * @warning If a file exists at the new location, then it will be * overwritten. Moving files or directories across devices may not be * possible. */ APR_DECLARE(apr_status_t) apr_file_rename(const char *from_path, const char *to_path, apr_pool_t *pool); /** * Copy the specified file to another file. * @param from_path The full path to the original file (using / on all systems) * @param to_path The full path to the new file (using / on all systems) * @param perms Access permissions for the new file if it is created. * In place of the usual or'd combination of file permissions, the * value APR_FILE_SOURCE_PERMS may be given, in which case the source * file's permissions are copied. * @param pool The pool to use. * @remark The new file does not need to exist, it will be created if required. * @warning If the new file already exists, its contents will be overwritten. */ APR_DECLARE(apr_status_t) apr_file_copy(const char *from_path, const char *to_path, apr_fileperms_t perms, apr_pool_t *pool); /** * Append the specified file to another file. * @param from_path The full path to the source file (use / on all systems) * @param to_path The full path to the destination file (use / on all systems) * @param perms Access permissions for the destination file if it is created. * In place of the usual or'd combination of file permissions, the * value APR_FILE_SOURCE_PERMS may be given, in which case the source * file's permissions are copied. * @param pool The pool to use. * @remark The new file does not need to exist, it will be created if required. */ APR_DECLARE(apr_status_t) apr_file_append(const char *from_path, const char *to_path, apr_fileperms_t perms, apr_pool_t *pool); /** * Are we at the end of the file * @param fptr The apr file we are testing. * @remark Returns APR_EOF if we are at the end of file, APR_SUCCESS otherwise. */ APR_DECLARE(apr_status_t) apr_file_eof(apr_file_t *fptr); /** * Open standard error as an apr file pointer. * @param thefile The apr file to use as stderr. * @param pool The pool to allocate the file out of. * * @remark The only reason that the apr_file_open_std* functions exist * is that you may not always have a stderr/out/in on Windows. This * is generally a problem with newer versions of Windows and services. * * @remark The other problem is that the C library functions generally work * differently on Windows and Unix. So, by using apr_file_open_std* * functions, you can get a handle to an APR struct that works with * the APR functions which are supposed to work identically on all * platforms. */ APR_DECLARE(apr_status_t) apr_file_open_stderr(apr_file_t **thefile, apr_pool_t *pool); /** * open standard output as an apr file pointer. * @param thefile The apr file to use as stdout. * @param pool The pool to allocate the file out of. * * @remark See remarks for apr_file_open_stderr. */ APR_DECLARE(apr_status_t) apr_file_open_stdout(apr_file_t **thefile, apr_pool_t *pool); /** * open standard input as an apr file pointer. * @param thefile The apr file to use as stdin. * @param pool The pool to allocate the file out of. * * @remark See remarks for apr_file_open_stderr. */ APR_DECLARE(apr_status_t) apr_file_open_stdin(apr_file_t **thefile, apr_pool_t *pool); /** * open standard error as an apr file pointer, with flags. * @param thefile The apr file to use as stderr. * @param flags The flags to open the file with. Only the APR_EXCL, * APR_BUFFERED, APR_XTHREAD, APR_SHARELOCK, * APR_SENDFILE_ENABLED and APR_LARGEFILE flags should * be used. The APR_WRITE flag will be set unconditionally. * @param pool The pool to allocate the file out of. * * @remark See remarks for apr_file_open_stderr. */ APR_DECLARE(apr_status_t) apr_file_open_flags_stderr(apr_file_t **thefile, apr_int32_t flags, apr_pool_t *pool); /** * open standard output as an apr file pointer, with flags. * @param thefile The apr file to use as stdout. * @param flags The flags to open the file with. Only the APR_EXCL, * APR_BUFFERED, APR_XTHREAD, APR_SHARELOCK, * APR_SENDFILE_ENABLED and APR_LARGEFILE flags should * be used. The APR_WRITE flag will be set unconditionally. * @param pool The pool to allocate the file out of. * * @remark See remarks for apr_file_open_stderr. */ APR_DECLARE(apr_status_t) apr_file_open_flags_stdout(apr_file_t **thefile, apr_int32_t flags, apr_pool_t *pool); /** * open standard input as an apr file pointer, with flags. * @param thefile The apr file to use as stdin. * @param flags The flags to open the file with. Only the APR_EXCL, * APR_BUFFERED, APR_XTHREAD, APR_SHARELOCK, * APR_SENDFILE_ENABLED and APR_LARGEFILE flags should * be used. The APR_READ flag will be set unconditionally. * @param pool The pool to allocate the file out of. * * @remark See remarks for apr_file_open_stderr. */ APR_DECLARE(apr_status_t) apr_file_open_flags_stdin(apr_file_t **thefile, apr_int32_t flags, apr_pool_t *pool); /** * Read data from the specified file. * @param thefile The file descriptor to read from. * @param buf The buffer to store the data to. * @param nbytes On entry, the number of bytes to read; on exit, the number * of bytes read. * * @remark apr_file_read will read up to the specified number of * bytes, but never more. If there isn't enough data to fill that * number of bytes, all of the available data is read. The third * argument is modified to reflect the number of bytes read. If a * char was put back into the stream via ungetc, it will be the first * character returned. * * @remark It is not possible for both bytes to be read and an APR_EOF * or other error to be returned. APR_EINTR is never returned. */ APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, apr_size_t *nbytes); /** * Write data to the specified file. * @param thefile The file descriptor to write to. * @param buf The buffer which contains the data. * @param nbytes On entry, the number of bytes to write; on exit, the number * of bytes written. * * @remark apr_file_write will write up to the specified number of * bytes, but never more. If the OS cannot write that many bytes, it * will write as many as it can. The third argument is modified to * reflect the * number of bytes written. * * @remark It is possible for both bytes to be written and an error to * be returned. APR_EINTR is never returned. */ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, apr_size_t *nbytes); /** * Write data from iovec array to the specified file. * @param thefile The file descriptor to write to. * @param vec The array from which to get the data to write to the file. * @param nvec The number of elements in the struct iovec array. This must * be smaller than APR_MAX_IOVEC_SIZE. If it isn't, the function * will fail with APR_EINVAL. * @param nbytes The number of bytes written. * * @remark It is possible for both bytes to be written and an error to * be returned. APR_EINTR is never returned. * * @remark apr_file_writev is available even if the underlying * operating system doesn't provide writev(). */ APR_DECLARE(apr_status_t) apr_file_writev(apr_file_t *thefile, const struct iovec *vec, apr_size_t nvec, apr_size_t *nbytes); /** * Read data from the specified file, ensuring that the buffer is filled * before returning. * @param thefile The file descriptor to read from. * @param buf The buffer to store the data to. * @param nbytes The number of bytes to read. * @param bytes_read If non-NULL, this will contain the number of bytes read. * * @remark apr_file_read will read up to the specified number of * bytes, but never more. If there isn't enough data to fill that * number of bytes, then the process/thread will block until it is * available or EOF is reached. If a char was put back into the * stream via ungetc, it will be the first character returned. * * @remark It is possible for both bytes to be read and an error to be * returned. And if *bytes_read is less than nbytes, an accompanying * error is _always_ returned. * * @remark APR_EINTR is never returned. */ APR_DECLARE(apr_status_t) apr_file_read_full(apr_file_t *thefile, void *buf, apr_size_t nbytes, apr_size_t *bytes_read); /** * Write data to the specified file, ensuring that all of the data is * written before returning. * @param thefile The file descriptor to write to. * @param buf The buffer which contains the data. * @param nbytes The number of bytes to write. * @param bytes_written If non-NULL, set to the number of bytes written. * * @remark apr_file_write will write up to the specified number of * bytes, but never more. If the OS cannot write that many bytes, the * process/thread will block until they can be written. Exceptional * error such as "out of space" or "pipe closed" will terminate with * an error. * * @remark It is possible for both bytes to be written and an error to * be returned. And if *bytes_written is less than nbytes, an * accompanying error is _always_ returned. * * @remark APR_EINTR is never returned. */ APR_DECLARE(apr_status_t) apr_file_write_full(apr_file_t *thefile, const void *buf, apr_size_t nbytes, apr_size_t *bytes_written); /** * Write data from iovec array to the specified file, ensuring that all of the * data is written before returning. * @param thefile The file descriptor to write to. * @param vec The array from which to get the data to write to the file. * @param nvec The number of elements in the struct iovec array. This must * be smaller than APR_MAX_IOVEC_SIZE. If it isn't, the function * will fail with APR_EINVAL. * @param nbytes The number of bytes written. * * @remark apr_file_writev_full is available even if the underlying * operating system doesn't provide writev(). */ APR_DECLARE(apr_status_t) apr_file_writev_full(apr_file_t *thefile, const struct iovec *vec, apr_size_t nvec, apr_size_t *nbytes); /** * Write a character into the specified file. * @param ch The character to write. * @param thefile The file descriptor to write to */ APR_DECLARE(apr_status_t) apr_file_putc(char ch, apr_file_t *thefile); /** * Read a character from the specified file. * @param ch The character to read into * @param thefile The file descriptor to read from */ APR_DECLARE(apr_status_t) apr_file_getc(char *ch, apr_file_t *thefile); /** * Put a character back onto a specified stream. * @param ch The character to write. * @param thefile The file descriptor to write to */ APR_DECLARE(apr_status_t) apr_file_ungetc(char ch, apr_file_t *thefile); /** * Read a string from the specified file. * @param str The buffer to store the string in. * @param len The length of the string * @param thefile The file descriptor to read from * @remark The buffer will be NUL-terminated if any characters are stored. */ APR_DECLARE(apr_status_t) apr_file_gets(char *str, int len, apr_file_t *thefile); /** * Write the string into the specified file. * @param str The string to write. * @param thefile The file descriptor to write to */ APR_DECLARE(apr_status_t) apr_file_puts(const char *str, apr_file_t *thefile); /** * Flush the file's buffer. * @param thefile The file descriptor to flush */ APR_DECLARE(apr_status_t) apr_file_flush(apr_file_t *thefile); /** * Duplicate the specified file descriptor. * @param new_file The structure to duplicate into. * @param old_file The file to duplicate. * @param p The pool to use for the new file. * @remark *new_file must point to a valid apr_file_t, or point to NULL. */ APR_DECLARE(apr_status_t) apr_file_dup(apr_file_t **new_file, apr_file_t *old_file, apr_pool_t *p); /** * Duplicate the specified file descriptor and close the original * @param new_file The old file that is to be closed and reused * @param old_file The file to duplicate * @param p The pool to use for the new file * * @remark new_file MUST point at a valid apr_file_t. It cannot be NULL. */ APR_DECLARE(apr_status_t) apr_file_dup2(apr_file_t *new_file, apr_file_t *old_file, apr_pool_t *p); /** * Move the specified file descriptor to a new pool * @param new_file Pointer in which to return the new apr_file_t * @param old_file The file to move * @param p The pool to which the descriptor is to be moved * @remark Unlike apr_file_dup2(), this function doesn't do an * OS dup() operation on the underlying descriptor; it just * moves the descriptor's apr_file_t wrapper to a new pool. * @remark The new pool need not be an ancestor of old_file's pool. * @remark After calling this function, old_file may not be used */ APR_DECLARE(apr_status_t) apr_file_setaside(apr_file_t **new_file, apr_file_t *old_file, apr_pool_t *p); /** * Give the specified apr file handle a new buffer * @param thefile The file handle that is to be modified * @param buffer The buffer * @param bufsize The size of the buffer * @remark It is possible to add a buffer to previously unbuffered * file handles, the APR_BUFFERED flag will be added to * the file handle's flags. Likewise, with buffer=NULL and * bufsize=0 arguments it is possible to make a previously * buffered file handle unbuffered. */ APR_DECLARE(apr_status_t) apr_file_buffer_set(apr_file_t *thefile, char * buffer, apr_size_t bufsize); /** * Get the size of any buffer for the specified apr file handle * @param thefile The file handle */ APR_DECLARE(apr_size_t) apr_file_buffer_size_get(apr_file_t *thefile); /** * Move the read/write file offset to a specified byte within a file. * @param thefile The file descriptor * @param where How to move the pointer, one of: *
* APR_SET -- set the offset to offset * APR_CUR -- add the offset to the current position * APR_END -- add the offset to the current file size ** @param offset The offset to move the pointer to. * @remark The third argument is modified to be the offset the pointer was actually moved to. */ APR_DECLARE(apr_status_t) apr_file_seek(apr_file_t *thefile, apr_seek_where_t where, apr_off_t *offset); /** * Create an anonymous pipe. * @param in The newly created pipe's file for reading. * @param out The newly created pipe's file for writing. * @param pool The pool to operate on. * @remark By default, the returned file descriptors will be inherited * by child processes created using apr_proc_create(). This can be * changed using apr_file_inherit_unset(). * @bug Some platforms cannot toggle between blocking and nonblocking, * and when passing a pipe as a standard handle to an application which * does not expect it, a non-blocking stream will fluxor the client app. * @deprecated @see apr_file_pipe_create_ex */ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out, apr_pool_t *pool); /** * Create an anonymous pipe which portably supports async timeout options. * @param in The newly created pipe's file for reading. * @param out The newly created pipe's file for writing. * @param blocking one of these values defined in apr_thread_proc.h; *
* APR_FULL_BLOCK * APR_READ_BLOCK * APR_WRITE_BLOCK * APR_FULL_NONBLOCK ** @remark By default, the returned file descriptors will be inherited * by child processes created using apr_proc_create(). This can be * changed using apr_file_inherit_unset(). * @remark Some platforms cannot toggle between blocking and nonblocking, * and when passing a pipe as a standard handle to an application which * does not expect it, a non-blocking stream will fluxor the client app. * Use this function rather than apr_file_pipe_create to create pipes * where one or both ends require non-blocking semantics. */ APR_DECLARE(apr_status_t) apr_file_pipe_create_ex(apr_file_t **in, apr_file_t **out, apr_int32_t blocking, apr_pool_t *p); /** * Create a named pipe. * @param filename The filename of the named pipe * @param perm The permissions for the newly created pipe. * @param pool The pool to operate on. */ APR_DECLARE(apr_status_t) apr_file_namedpipe_create(const char *filename, apr_fileperms_t perm, apr_pool_t *pool); /** * Get the timeout value for a pipe or manipulate the blocking state. * @param thepipe The pipe we are getting a timeout for. * @param timeout The current timeout value in microseconds. */ APR_DECLARE(apr_status_t) apr_file_pipe_timeout_get(apr_file_t *thepipe, apr_interval_time_t *timeout); /** * Set the timeout value for a pipe or manipulate the blocking state. * @param thepipe The pipe we are setting a timeout on. * @param timeout The timeout value in microseconds. Values < 0 mean wait * forever, 0 means do not wait at all. */ APR_DECLARE(apr_status_t) apr_file_pipe_timeout_set(apr_file_t *thepipe, apr_interval_time_t timeout); /** file (un)locking functions. */ /** * Establish a lock on the specified, open file. The lock may be advisory * or mandatory, at the discretion of the platform. The lock applies to * the file as a whole, rather than a specific range. Locks are established * on a per-thread/process basis; a second lock by the same thread will not * block. * @param thefile The file to lock. * @param type The type of lock to establish on the file. */ APR_DECLARE(apr_status_t) apr_file_lock(apr_file_t *thefile, int type); /** * Remove any outstanding locks on the file. * @param thefile The file to unlock. */ APR_DECLARE(apr_status_t) apr_file_unlock(apr_file_t *thefile); /**accessor and general file_io functions. */ /** * return the file name of the current file. * @param new_path The path of the file. * @param thefile The currently open file. */ APR_DECLARE(apr_status_t) apr_file_name_get(const char **new_path, apr_file_t *thefile); /** * Return the data associated with the current file. * @param data The user data associated with the file. * @param key The key to use for retreiving data associated with this file. * @param file The currently open file. */ APR_DECLARE(apr_status_t) apr_file_data_get(void **data, const char *key, apr_file_t *file); /** * Set the data associated with the current file. * @param file The currently open file. * @param data The user data to associate with the file. * @param key The key to use for assocaiteing data with the file. * @param cleanup The cleanup routine to use when the file is destroyed. */ APR_DECLARE(apr_status_t) apr_file_data_set(apr_file_t *file, void *data, const char *key, apr_status_t (*cleanup)(void *)); /** * Write a string to a file using a printf format. * @param fptr The file to write to. * @param format The format string * @param ... The values to substitute in the format string * @return The number of bytes written */ APR_DECLARE_NONSTD(int) apr_file_printf(apr_file_t *fptr, const char *format, ...) __attribute__((format(printf,2,3))); /** * set the specified file's permission bits. * @param fname The file (name) to apply the permissions to. * @param perms The permission bits to apply to the file. * * @warning Some platforms may not be able to apply all of the * available permission bits; APR_INCOMPLETE will be returned if some * permissions are specified which could not be set. * * @warning Platforms which do not implement this feature will return * APR_ENOTIMPL. */ APR_DECLARE(apr_status_t) apr_file_perms_set(const char *fname, apr_fileperms_t perms); /** * Set attributes of the specified file. * @param fname The full path to the file (using / on all systems) * @param attributes Or'd combination of *
* APR_FILE_ATTR_READONLY - make the file readonly * APR_FILE_ATTR_EXECUTABLE - make the file executable * APR_FILE_ATTR_HIDDEN - make the file hidden ** @param attr_mask Mask of valid bits in attributes. * @param pool the pool to use. * @remark This function should be used in preference to explict manipulation * of the file permissions, because the operations to provide these * attributes are platform specific and may involve more than simply * setting permission bits. * @warning Platforms which do not implement this feature will return * APR_ENOTIMPL. */ APR_DECLARE(apr_status_t) apr_file_attrs_set(const char *fname, apr_fileattrs_t attributes, apr_fileattrs_t attr_mask, apr_pool_t *pool); /** * Set the mtime of the specified file. * @param fname The full path to the file (using / on all systems) * @param mtime The mtime to apply to the file. * @param pool The pool to use. * @warning Platforms which do not implement this feature will return * APR_ENOTIMPL. */ APR_DECLARE(apr_status_t) apr_file_mtime_set(const char *fname, apr_time_t mtime, apr_pool_t *pool); /** * Create a new directory on the file system. * @param path the path for the directory to be created. (use / on all systems) * @param perm Permissions for the new direcoty. * @param pool the pool to use. */ APR_DECLARE(apr_status_t) apr_dir_make(const char *path, apr_fileperms_t perm, apr_pool_t *pool); /** Creates a new directory on the file system, but behaves like * 'mkdir -p'. Creates intermediate directories as required. No error * will be reported if PATH already exists. * @param path the path for the directory to be created. (use / on all systems) * @param perm Permissions for the new direcoty. * @param pool the pool to use. */ APR_DECLARE(apr_status_t) apr_dir_make_recursive(const char *path, apr_fileperms_t perm, apr_pool_t *pool); /** * Remove directory from the file system. * @param path the path for the directory to be removed. (use / on all systems) * @param pool the pool to use. * @remark Removing a directory which is in-use (e.g., the current working * directory, or during apr_dir_read, or with an open file) is not portable. */ APR_DECLARE(apr_status_t) apr_dir_remove(const char *path, apr_pool_t *pool); /** * get the specified file's stats. * @param finfo Where to store the information about the file. * @param wanted The desired apr_finfo_t fields, as a bit flag of APR_FINFO_ values * @param thefile The file to get information about. */ APR_DECLARE(apr_status_t) apr_file_info_get(apr_finfo_t *finfo, apr_int32_t wanted, apr_file_t *thefile); /** * Truncate the file's length to the specified offset * @param fp The file to truncate * @param offset The offset to truncate to. * @remark The read/write file offset is repositioned to offset. */ APR_DECLARE(apr_status_t) apr_file_trunc(apr_file_t *fp, apr_off_t offset); /** * Retrieve the flags that were passed into apr_file_open() * when the file was opened. * @return apr_int32_t the flags */ APR_DECLARE(apr_int32_t) apr_file_flags_get(apr_file_t *f); /** * Get the pool used by the file. */ APR_POOL_DECLARE_ACCESSOR(file); /** * Set a file to be inherited by child processes. * */ APR_DECLARE_INHERIT_SET(file); /** * Unset a file from being inherited by child processes. */ APR_DECLARE_INHERIT_UNSET(file); /** * Open a temporary file * @param fp The apr file to use as a temporary file. * @param templ The template to use when creating a temp file. * @param flags The flags to open the file with. If this is zero, * the file is opened with * APR_CREATE | APR_READ | APR_WRITE | APR_EXCL | APR_DELONCLOSE * @param p The pool to allocate the file out of. * @remark * This function generates a unique temporary file name from template. * The last six characters of template must be XXXXXX and these are replaced * with a string that makes the filename unique. Since it will be modified, * template must not be a string constant, but should be declared as a character * array. * */ APR_DECLARE(apr_status_t) apr_file_mktemp(apr_file_t **fp, char *templ, apr_int32_t flags, apr_pool_t *p); /** * Find an existing directory suitable as a temporary storage location. * @param temp_dir The temp directory. * @param p The pool to use for any necessary allocations. * @remark * This function uses an algorithm to search for a directory that an * an application can use for temporary storage. * */ APR_DECLARE(apr_status_t) apr_temp_dir_get(const char **temp_dir, apr_pool_t *p); /** @} */ #ifdef __cplusplus } #endif #endif /* ! APR_FILE_IO_H */ 0707010001f185000081a4000017820000044e000000014b1d38c9000018b60000022d0000016a00000000000000000000002200000000reloc/include/apr-1/apr_reslist.h /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef APR_RESLIST_H #define APR_RESLIST_H /** * @file apr_reslist.h * @brief APR-UTIL Resource List Routines */ #include "apr.h" #include "apu.h" #include "apr_pools.h" #include "apr_errno.h" #include "apr_time.h" #if APR_HAS_THREADS /** * @defgroup APR_Util_RL Resource List Routines * @ingroup APR_Util * @{ * @warning * Resource list data types and routines are only available when * threads are enabled (i.e. APR_HAS_THREADS is not zero). */ #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** Opaque resource list object */ typedef struct apr_reslist_t apr_reslist_t; /* Generic constructor called by resource list when it needs to create a * resource. * @param resource opaque resource * @param param flags * @param pool Pool */ typedef apr_status_t (*apr_reslist_constructor)(void **resource, void *params, apr_pool_t *pool); /* Generic destructor called by resource list when it needs to destroy a * resource. * @param resource opaque resource * @param param flags * @param pool Pool */ typedef apr_status_t (*apr_reslist_destructor)(void *resource, void *params, apr_pool_t *pool); /** * Create a new resource list with the following parameters: * @param reslist An address where the pointer to the new resource * list will be stored. * @param min Allowed minimum number of available resources. Zero * creates new resources only when needed. * @param smax Resources will be destroyed to meet this maximum * restriction as they expire. * @param hmax Absolute maximum limit on the number of total resources. * @param ttl If non-zero, sets the maximum amount of time in microseconds a * resource may be available while exceeding the soft limit. * @param con Constructor routine that is called to create a new resource. * @param de Destructor routine that is called to destroy an expired resource. * @param params Passed to constructor and deconstructor * @param pool The pool from which to create this resource list. Also the * same pool that is passed to the constructor and destructor * routines. * @warning If you're creating a sub-pool of the pool passed into this * function in your constructor, you will need to follow some rules * when it comes to destruction of that sub-pool, as calling * apr_pool_destroy() outright on it in your destructor may create * double free situations. That is because by the time destructor is * called, the sub-pool may have already been destroyed. This also * means that in the destructor, memory from the sub-pool should be * treated as invalid. For examples of how to do this correctly, see * mod_dbd of Apache 2.2 and memcache support in APR Util 1.3. */ APU_DECLARE(apr_status_t) apr_reslist_create(apr_reslist_t **reslist, int min, int smax, int hmax, apr_interval_time_t ttl, apr_reslist_constructor con, apr_reslist_destructor de, void *params, apr_pool_t *pool); /** * Destroy the given resource list and all resources controlled by * this list. * FIXME: Should this block until all resources become available, * or maybe just destroy all the free ones, or maybe destroy * them even though they might be in use by something else? * Currently it will abort if there are resources that haven't * been released, so there is an assumption that all resources * have been released to the list before calling this function. * @param reslist The reslist to destroy */ APU_DECLARE(apr_status_t) apr_reslist_destroy(apr_reslist_t *reslist); /** * Retrieve a resource from the list, creating a new one if necessary. * If we have met our maximum number of resources, we will block * until one becomes available. */ APU_DECLARE(apr_status_t) apr_reslist_acquire(apr_reslist_t *reslist, void **resource); /** * Return a resource back to the list of available resources. */ APU_DECLARE(apr_status_t) apr_reslist_release(apr_reslist_t *reslist, void *resource); /** * Set the timeout the acquire will wait for a free resource * when the maximum number of resources is exceeded. * @param reslist The resource list. * @param timeout Timeout to wait. The zero waits forever. */ APU_DECLARE(void) apr_reslist_timeout_set(apr_reslist_t *reslist, apr_interval_time_t timeout); /** * Return the number of outstanding resources. * @param reslist The resource list. */ APU_DECLARE(apr_uint32_t) apr_reslist_acquired_count(apr_reslist_t *reslist); /** * Invalidate a resource in the pool - e.g. a database connection * that returns a "lost connection" error and can't be restored. * Use this instead of apr_reslist_release if the resource is bad. */ APU_DECLARE(apr_status_t) apr_reslist_invalidate(apr_reslist_t *reslist, void *resource); #ifdef __cplusplus } #endif /** @} */ #endif /* APR_HAS_THREADS */ #endif /* ! APR_RESLIST_H */ 0707010001f190000081a4000017820000044e000000014b1d38c7000015950000022d0000016a00000000000000000000002600000000reloc/include/apr-1/apr_thread_cond.h /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef APR_THREAD_COND_H #define APR_THREAD_COND_H /** * @file apr_thread_cond.h * @brief APR Condition Variable Routines */ #include "apr.h" #include "apr_pools.h" #include "apr_errno.h" #include "apr_time.h" #include "apr_thread_mutex.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ #if APR_HAS_THREADS || defined(DOXYGEN) /** * @defgroup apr_thread_cond Condition Variable Routines * @ingroup APR * @{ */ /** Opaque structure for thread condition variables */ typedef struct apr_thread_cond_t apr_thread_cond_t; /** * Note: destroying a condition variable (or likewise, destroying or * clearing the pool from which a condition variable was allocated) if * any threads are blocked waiting on it gives undefined results. */ /** * Create and initialize a condition variable that can be used to signal * and schedule threads in a single process. * @param cond the memory address where the newly created condition variable * will be stored. * @param pool the pool from which to allocate the condition. */ APR_DECLARE(apr_status_t) apr_thread_cond_create(apr_thread_cond_t **cond, apr_pool_t *pool); /** * Put the active calling thread to sleep until signaled to wake up. Each * condition variable must be associated with a mutex, and that mutex must * be locked before calling this function, or the behavior will be * undefined. As the calling thread is put to sleep, the given mutex * will be simultaneously released; and as this thread wakes up the lock * is again simultaneously acquired. * @param cond the condition variable on which to block. * @param mutex the mutex that must be locked upon entering this function, * is released while the thread is asleep, and is again acquired before * returning from this function. * @remark Spurious wakeups may occur. Before and after every call to wait on * a condition variable, the caller should test whether the condition is already * met. */ APR_DECLARE(apr_status_t) apr_thread_cond_wait(apr_thread_cond_t *cond, apr_thread_mutex_t *mutex); /** * Put the active calling thread to sleep until signaled to wake up or * the timeout is reached. Each condition variable must be associated * with a mutex, and that mutex must be locked before calling this * function, or the behavior will be undefined. As the calling thread * is put to sleep, the given mutex will be simultaneously released; * and as this thread wakes up the lock is again simultaneously acquired. * @param cond the condition variable on which to block. * @param mutex the mutex that must be locked upon entering this function, * is released while the thread is asleep, and is again acquired before * returning from this function. * @param timeout The amount of time in microseconds to wait. This is * a maximum, not a minimum. If the condition is signaled, we * will wake up before this time, otherwise the error APR_TIMEUP * is returned. */ APR_DECLARE(apr_status_t) apr_thread_cond_timedwait(apr_thread_cond_t *cond, apr_thread_mutex_t *mutex, apr_interval_time_t timeout); /** * Signals a single thread, if one exists, that is blocking on the given * condition variable. That thread is then scheduled to wake up and acquire * the associated mutex. Although it is not required, if predictable scheduling * is desired, that mutex must be locked while calling this function. * @param cond the condition variable on which to produce the signal. * @remark If no threads are waiting on the condition variable, nothing happens. */ APR_DECLARE(apr_status_t) apr_thread_cond_signal(apr_thread_cond_t *cond); /** * Signals all threads blocking on the given condition variable. * Each thread that was signaled is then scheduled to wake up and acquire * the associated mutex. This will happen in a serialized manner. * @param cond the condition variable on which to produce the broadcast. * @remark If no threads are waiting on the condition variable, nothing happens. */ APR_DECLARE(apr_status_t) apr_thread_cond_broadcast(apr_thread_cond_t *cond); /** * Destroy the condition variable and free the associated memory. * @param cond the condition variable to destroy. */ APR_DECLARE(apr_status_t) apr_thread_cond_destroy(apr_thread_cond_t *cond); /** * Get the pool used by this thread_cond. * @return apr_pool_t the pool */ APR_POOL_DECLARE_ACCESSOR(thread_cond); #endif /* APR_HAS_THREADS */ /** @} */ #ifdef __cplusplus } #endif #endif /* ! APR_THREAD_COND_H */ 0707010001f15f000081a4000017820000044e000000014b1d38c9000013ba0000022d0000016a00000000000000000000002200000000reloc/include/apr-1/apr_anylock.h /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * @file apr_anylock.h * @brief APR-Util transparent any lock flavor wrapper */ #ifndef APR_ANYLOCK_H #define APR_ANYLOCK_H #include "apr_proc_mutex.h" #include "apr_thread_mutex.h" #include "apr_thread_rwlock.h" /** Structure that may contain any APR lock type */ typedef struct apr_anylock_t { /** Indicates what type of lock is in lock */ enum tm_lock { apr_anylock_none, /**< None */ apr_anylock_procmutex, /**< Process-based */ apr_anylock_threadmutex, /**< Thread-based */ apr_anylock_readlock, /**< Read lock */ apr_anylock_writelock /**< Write lock */ } type; /** Union of all possible APR locks */ union apr_anylock_u_t { apr_proc_mutex_t *pm; /**< Process mutex */ #if APR_HAS_THREADS apr_thread_mutex_t *tm; /**< Thread mutex */ apr_thread_rwlock_t *rw; /**< Read-write lock */ #endif } lock; } apr_anylock_t; #if APR_HAS_THREADS /** Lock an apr_anylock_t structure */ #define APR_ANYLOCK_LOCK(lck) \ (((lck)->type == apr_anylock_none) \ ? APR_SUCCESS \ : (((lck)->type == apr_anylock_threadmutex) \ ? apr_thread_mutex_lock((lck)->lock.tm) \ : (((lck)->type == apr_anylock_procmutex) \ ? apr_proc_mutex_lock((lck)->lock.pm) \ : (((lck)->type == apr_anylock_readlock) \ ? apr_thread_rwlock_rdlock((lck)->lock.rw) \ : (((lck)->type == apr_anylock_writelock) \ ? apr_thread_rwlock_wrlock((lck)->lock.rw) \ : APR_EINVAL))))) #else /* APR_HAS_THREADS */ #define APR_ANYLOCK_LOCK(lck) \ (((lck)->type == apr_anylock_none) \ ? APR_SUCCESS \ : (((lck)->type == apr_anylock_procmutex) \ ? apr_proc_mutex_lock((lck)->lock.pm) \ : APR_EINVAL)) #endif /* APR_HAS_THREADS */ #if APR_HAS_THREADS /** Try to lock an apr_anylock_t structure */ #define APR_ANYLOCK_TRYLOCK(lck) \ (((lck)->type == apr_anylock_none) \ ? APR_SUCCESS \ : (((lck)->type == apr_anylock_threadmutex) \ ? apr_thread_mutex_trylock((lck)->lock.tm) \ : (((lck)->type == apr_anylock_procmutex) \ ? apr_proc_mutex_trylock((lck)->lock.pm) \ : (((lck)->type == apr_anylock_readlock) \ ? apr_thread_rwlock_tryrdlock((lck)->lock.rw) \ : (((lck)->type == apr_anylock_writelock) \ ? apr_thread_rwlock_trywrlock((lck)->lock.rw) \ : APR_EINVAL))))) #else /* APR_HAS_THREADS */ #define APR_ANYLOCK_TRYLOCK(lck) \ (((lck)->type == apr_anylock_none) \ ? APR_SUCCESS \ : (((lck)->type == apr_anylock_procmutex) \ ? apr_proc_mutex_trylock((lck)->lock.pm) \ : APR_EINVAL)) #endif /* APR_HAS_THREADS */ #if APR_HAS_THREADS /** Unlock an apr_anylock_t structure */ #define APR_ANYLOCK_UNLOCK(lck) \ (((lck)->type == apr_anylock_none) \ ? APR_SUCCESS \ : (((lck)->type == apr_anylock_threadmutex) \ ? apr_thread_mutex_unlock((lck)->lock.tm) \ : (((lck)->type == apr_anylock_procmutex) \ ? apr_proc_mutex_unlock((lck)->lock.pm) \ : ((((lck)->type == apr_anylock_readlock) || \ ((lck)->type == apr_anylock_writelock)) \ ? apr_thread_rwlock_unlock((lck)->lock.rw) \ : APR_EINVAL)))) #else /* APR_HAS_THREADS */ #define APR_ANYLOCK_UNLOCK(lck) \ (((lck)->type == apr_anylock_none) \ ? APR_SUCCESS \ : (((lck)->type == apr_anylock_procmutex) \ ? apr_proc_mutex_unlock((lck)->lock.pm) \ : APR_EINVAL)) #endif /* APR_HAS_THREADS */ #endif /* !APR_ANYLOCK_H */ 0707010001f193000081a4000017820000044e000000014b1d38c70000885f0000022d0000016a00000000000000000000002600000000reloc/include/apr-1/apr_thread_proc.h /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef APR_THREAD_PROC_H #define APR_THREAD_PROC_H /** * @file apr_thread_proc.h * @brief APR Thread and Process Library */ #include "apr.h" #include "apr_file_io.h" #include "apr_pools.h" #include "apr_errno.h" #if APR_HAVE_STRUCT_RLIMIT #include
* APR_SHELLCMD -- Anything that the shell can handle * APR_PROGRAM -- Executable program (default) * APR_PROGRAM_ENV -- Executable program, copy environment * APR_PROGRAM_PATH -- Executable program on PATH, copy env **/ APR_DECLARE(apr_status_t) apr_procattr_cmdtype_set(apr_procattr_t *attr, apr_cmdtype_e cmd); /** * Determine if the child should start in detached state. * @param attr The procattr we care about. * @param detach Should the child start in detached state? Default is no. */ APR_DECLARE(apr_status_t) apr_procattr_detach_set(apr_procattr_t *attr, apr_int32_t detach); #if APR_HAVE_STRUCT_RLIMIT /** * Set the Resource Utilization limits when starting a new process. * @param attr The procattr we care about. * @param what Which limit to set, one of: *
* APR_LIMIT_CPU * APR_LIMIT_MEM * APR_LIMIT_NPROC * APR_LIMIT_NOFILE ** @param limit Value to set the limit to. */ APR_DECLARE(apr_status_t) apr_procattr_limit_set(apr_procattr_t *attr, apr_int32_t what, struct rlimit *limit); #endif /** * Specify an error function to be called in the child process if APR * encounters an error in the child prior to running the specified program. * @param attr The procattr describing the child process to be created. * @param errfn The function to call in the child process. * @remark At the present time, it will only be called from apr_proc_create() * on platforms where fork() is used. It will never be called on other * platforms, on those platforms apr_proc_create() will return the error * in the parent process rather than invoke the callback in the now-forked * child process. */ APR_DECLARE(apr_status_t) apr_procattr_child_errfn_set(apr_procattr_t *attr, apr_child_errfn_t *errfn); /** * Specify that apr_proc_create() should do whatever it can to report * failures to the caller of apr_proc_create(), rather than find out in * the child. * @param attr The procattr describing the child process to be created. * @param chk Flag to indicate whether or not extra work should be done * to try to report failures to the caller. * @remark This flag only affects apr_proc_create() on platforms where * fork() is used. This leads to extra overhead in the calling * process, but that may help the application handle such * errors more gracefully. */ APR_DECLARE(apr_status_t) apr_procattr_error_check_set(apr_procattr_t *attr, apr_int32_t chk); /** * Determine if the child should start in its own address space or using the * current one from its parent * @param attr The procattr we care about. * @param addrspace Should the child start in its own address space? Default * is no on NetWare and yes on other platforms. */ APR_DECLARE(apr_status_t) apr_procattr_addrspace_set(apr_procattr_t *attr, apr_int32_t addrspace); /** * Set the username used for running process * @param attr The procattr we care about. * @param username The username used * @param password User password if needed. Password is needed on WIN32 * or any other platform having * APR_PROCATTR_USER_SET_REQUIRES_PASSWORD set. */ APR_DECLARE(apr_status_t) apr_procattr_user_set(apr_procattr_t *attr, const char *username, const char *password); /** * Set the group used for running process * @param attr The procattr we care about. * @param groupname The group name used */ APR_DECLARE(apr_status_t) apr_procattr_group_set(apr_procattr_t *attr, const char *groupname); #if APR_HAS_FORK /** * This is currently the only non-portable call in APR. This executes * a standard unix fork. * @param proc The resulting process handle. * @param cont The pool to use. * @remark returns APR_INCHILD for the child, and APR_INPARENT for the parent * or an error. */ APR_DECLARE(apr_status_t) apr_proc_fork(apr_proc_t *proc, apr_pool_t *cont); #endif /** * Create a new process and execute a new program within that process. * @param new_proc The resulting process handle. * @param progname The program to run * @param args the arguments to pass to the new program. The first * one should be the program name. * @param env The new environment table for the new process. This * should be a list of NULL-terminated strings. This argument * is ignored for APR_PROGRAM_ENV, APR_PROGRAM_PATH, and * APR_SHELLCMD_ENV types of commands. * @param attr the procattr we should use to determine how to create the new * process * @param pool The pool to use. * @note This function returns without waiting for the new process to terminate; * use apr_proc_wait for that. */ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new_proc, const char *progname, const char * const *args, const char * const *env, apr_procattr_t *attr, apr_pool_t *pool); /** * Wait for a child process to die * @param proc The process handle that corresponds to the desired child process * @param exitcode The returned exit status of the child, if a child process * dies, or the signal that caused the child to die. * On platforms that don't support obtaining this information, * the status parameter will be returned as APR_ENOTIMPL. * @param exitwhy Why the child died, the bitwise or of: *
* APR_PROC_EXIT -- process terminated normally * APR_PROC_SIGNAL -- process was killed by a signal * APR_PROC_SIGNAL_CORE -- process was killed by a signal, and * generated a core dump. ** @param waithow How should we wait. One of: *
* APR_WAIT -- block until the child process dies. * APR_NOWAIT -- return immediately regardless of if the * child is dead or not. ** @remark The childs status is in the return code to this process. It is one of: *
* APR_CHILD_DONE -- child is no longer running. * APR_CHILD_NOTDONE -- child is still running. **/ APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc, int *exitcode, apr_exit_why_e *exitwhy, apr_wait_how_e waithow); /** * Wait for any current child process to die and return information * about that child. * @param proc Pointer to NULL on entry, will be filled out with child's * information * @param exitcode The returned exit status of the child, if a child process * dies, or the signal that caused the child to die. * On platforms that don't support obtaining this information, * the status parameter will be returned as APR_ENOTIMPL. * @param exitwhy Why the child died, the bitwise or of: *
* APR_PROC_EXIT -- process terminated normally * APR_PROC_SIGNAL -- process was killed by a signal * APR_PROC_SIGNAL_CORE -- process was killed by a signal, and * generated a core dump. ** @param waithow How should we wait. One of: *
* APR_WAIT -- block until the child process dies. * APR_NOWAIT -- return immediately regardless of if the * child is dead or not. ** @param p Pool to allocate child information out of. * @bug Passing proc as a *proc rather than **proc was an odd choice * for some platforms... this should be revisited in 1.0 */ APR_DECLARE(apr_status_t) apr_proc_wait_all_procs(apr_proc_t *proc, int *exitcode, apr_exit_why_e *exitwhy, apr_wait_how_e waithow, apr_pool_t *p); #define APR_PROC_DETACH_FOREGROUND 0 /**< Do not detach */ #define APR_PROC_DETACH_DAEMONIZE 1 /**< Detach */ /** * Detach the process from the controlling terminal. * @param daemonize set to non-zero if the process should daemonize * and become a background process, else it will * stay in the foreground. */ APR_DECLARE(apr_status_t) apr_proc_detach(int daemonize); /** * Register an other_child -- a child associated to its registered * maintence callback. This callback is invoked when the process * dies, is disconnected or disappears. * @param proc The child process to register. * @param maintenance maintenance is a function that is invoked with a * reason and the data pointer passed here. * @param data Opaque context data passed to the maintenance function. * @param write_fd An fd that is probed for writing. If it is ever unwritable * then the maintenance is invoked with reason * OC_REASON_UNWRITABLE. * @param p The pool to use for allocating memory. * @bug write_fd duplicates the proc->out stream, it's really redundant * and should be replaced in the APR 1.0 API with a bitflag of which * proc->in/out/err handles should be health checked. * @bug no platform currently tests the pipes health. */ APR_DECLARE(void) apr_proc_other_child_register(apr_proc_t *proc, void (*maintenance) (int reason, void *, int status), void *data, apr_file_t *write_fd, apr_pool_t *p); /** * Stop watching the specified other child. * @param data The data to pass to the maintenance function. This is * used to find the process to unregister. * @warning Since this can be called by a maintenance function while we're * scanning the other_children list, all scanners should protect * themself by loading ocr->next before calling any maintenance * function. */ APR_DECLARE(void) apr_proc_other_child_unregister(void *data); /** * Notify the maintenance callback of a registered other child process * that application has detected an event, such as death. * @param proc The process to check * @param reason The reason code to pass to the maintenance function * @param status The status to pass to the maintenance function * @remark An example of code using this behavior; *
* rv = apr_proc_wait_all_procs(&proc, &exitcode, &status, APR_WAIT, p); * if (APR_STATUS_IS_CHILD_DONE(rv)) { * #if APR_HAS_OTHER_CHILD * if (apr_proc_other_child_alert(&proc, APR_OC_REASON_DEATH, status) * == APR_SUCCESS) { * ; (already handled) * } * else * #endif * [... handling non-otherchild processes death ...] **/ APR_DECLARE(apr_status_t) apr_proc_other_child_alert(apr_proc_t *proc, int reason, int status); /** * Test one specific other child processes and invoke the maintenance callback * with the appropriate reason code, if still running, or the appropriate reason * code if the process is no longer healthy. * @param ocr The registered other child * @param reason The reason code (e.g. APR_OC_REASON_RESTART) if still running */ APR_DECLARE(void) apr_proc_other_child_refresh(apr_other_child_rec_t *ocr, int reason); /** * Test all registered other child processes and invoke the maintenance callback * with the appropriate reason code, if still running, or the appropriate reason * code if the process is no longer healthy. * @param reason The reason code (e.g. APR_OC_REASON_RESTART) to running processes */ APR_DECLARE(void) apr_proc_other_child_refresh_all(int reason); /** * Terminate a process. * @param proc The process to terminate. * @param sig How to kill the process. */ APR_DECLARE(apr_status_t) apr_proc_kill(apr_proc_t *proc, int sig); /** * Register a process to be killed when a pool dies. * @param a The pool to use to define the processes lifetime * @param proc The process to register * @param how How to kill the process, one of: *
* APR_KILL_NEVER -- process is never sent any signals * APR_KILL_ALWAYS -- process is sent SIGKILL on apr_pool_t cleanup * APR_KILL_AFTER_TIMEOUT -- SIGTERM, wait 3 seconds, SIGKILL * APR_JUST_WAIT -- wait forever for the process to complete * APR_KILL_ONLY_ONCE -- send SIGTERM and then wait **/ APR_DECLARE(void) apr_pool_note_subprocess(apr_pool_t *a, apr_proc_t *proc, apr_kill_conditions_e how); #if APR_HAS_THREADS #if (APR_HAVE_SIGWAIT || APR_HAVE_SIGSUSPEND) && !defined(OS2) /** * Setup the process for a single thread to be used for all signal handling. * @warning This must be called before any threads are created */ APR_DECLARE(apr_status_t) apr_setup_signal_thread(void); /** * Make the current thread listen for signals. This thread will loop * forever, calling a provided function whenever it receives a signal. That * functions should return 1 if the signal has been handled, 0 otherwise. * @param signal_handler The function to call when a signal is received * apr_status_t apr_signal_thread((int)(*signal_handler)(int signum)) */ APR_DECLARE(apr_status_t) apr_signal_thread(int(*signal_handler)(int signum)); #endif /* (APR_HAVE_SIGWAIT || APR_HAVE_SIGSUSPEND) && !defined(OS2) */ /** * Get the child-pool used by the thread from the thread info. * @return apr_pool_t the pool */ APR_POOL_DECLARE_ACCESSOR(thread); #endif /* APR_HAS_THREADS */ /** @} */ #ifdef __cplusplus } #endif #endif /* ! APR_THREAD_PROC_H */ 0707010001f15e000081a4000017820000044e000000014b1d38c7000014d60000022d0000016a00000000000000000000002400000000reloc/include/apr-1/apr_allocator.h /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef APR_ALLOCATOR_H #define APR_ALLOCATOR_H /** * @file apr_allocator.h * @brief APR Internal Memory Allocation */ #include "apr.h" #include "apr_errno.h" #define APR_WANT_MEMFUNC /**< For no good reason? */ #include "apr_want.h" #ifdef __cplusplus extern "C" { #endif /** * @defgroup apr_allocator Internal Memory Allocation * @ingroup APR * @{ */ /** the allocator structure */ typedef struct apr_allocator_t apr_allocator_t; /** the structure which holds information about the allocation */ typedef struct apr_memnode_t apr_memnode_t; /** basic memory node structure * @note The next, ref and first_avail fields are available for use by the * caller of apr_allocator_alloc(), the remaining fields are read-only. * The next field has to be used with caution and sensibly set when the * memnode is passed back to apr_allocator_free(). See apr_allocator_free() * for details. * The ref and first_avail fields will be properly restored by * apr_allocator_free(). */ struct apr_memnode_t { apr_memnode_t *next; /**< next memnode */ apr_memnode_t **ref; /**< reference to self */ apr_uint32_t index; /**< size */ apr_uint32_t free_index; /**< how much free */ char *first_avail; /**< pointer to first free memory */ char *endp; /**< pointer to end of free memory */ }; /** The base size of a memory node - aligned. */ #define APR_MEMNODE_T_SIZE APR_ALIGN_DEFAULT(sizeof(apr_memnode_t)) /** Symbolic constants */ #define APR_ALLOCATOR_MAX_FREE_UNLIMITED 0 /** * Create a new allocator * @param allocator The allocator we have just created. * */ APR_DECLARE(apr_status_t) apr_allocator_create(apr_allocator_t **allocator); /** * Destroy an allocator * @param allocator The allocator to be destroyed * @remark Any memnodes not given back to the allocator prior to destroying * will _not_ be free()d. */ APR_DECLARE(void) apr_allocator_destroy(apr_allocator_t *allocator); /** * Allocate a block of mem from the allocator * @param allocator The allocator to allocate from * @param size The size of the mem to allocate (excluding the * memnode structure) */ APR_DECLARE(apr_memnode_t *) apr_allocator_alloc(apr_allocator_t *allocator, apr_size_t size); /** * Free a list of blocks of mem, giving them back to the allocator. * The list is typically terminated by a memnode with its next field * set to NULL. * @param allocator The allocator to give the mem back to * @param memnode The memory node to return */ APR_DECLARE(void) apr_allocator_free(apr_allocator_t *allocator, apr_memnode_t *memnode); #include "apr_pools.h" /** * Set the owner of the allocator * @param allocator The allocator to set the owner for * @param pool The pool that is to own the allocator * @remark Typically pool is the highest level pool using the allocator */ /* * XXX: see if we can come up with something a bit better. Currently * you can make a pool an owner, but if the pool doesn't use the allocator * the allocator will never be destroyed. */ APR_DECLARE(void) apr_allocator_owner_set(apr_allocator_t *allocator, apr_pool_t *pool); /** * Get the current owner of the allocator * @param allocator The allocator to get the owner from */ APR_DECLARE(apr_pool_t *) apr_allocator_owner_get(apr_allocator_t *allocator); /** * Set the current threshold at which the allocator should start * giving blocks back to the system. * @param allocator The allocator the set the threshold on * @param size The threshold. 0 == unlimited. */ APR_DECLARE(void) apr_allocator_max_free_set(apr_allocator_t *allocator, apr_size_t size); #include "apr_thread_mutex.h" #if APR_HAS_THREADS /** * Set a mutex for the allocator to use * @param allocator The allocator to set the mutex for * @param mutex The mutex */ APR_DECLARE(void) apr_allocator_mutex_set(apr_allocator_t *allocator, apr_thread_mutex_t *mutex); /** * Get the mutex currently set for the allocator * @param allocator The allocator */ APR_DECLARE(apr_thread_mutex_t *) apr_allocator_mutex_get( apr_allocator_t *allocator); #endif /* APR_HAS_THREADS */ /** @} */ #ifdef __cplusplus } #endif #endif /* !APR_ALLOCATOR_H */ 0707010001f18f000081a4000017820000044e000000014b1d38c7000043590000022d0000016a00000000000000000000002100000000reloc/include/apr-1/apr_tables.h /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef APR_TABLES_H #define APR_TABLES_H /** * @file apr_tables.h * @brief APR Table library */ #include "apr.h" #include "apr_pools.h" #if APR_HAVE_STDARG_H #include
* apr_array_header_t *barr = apr_table_elts(b); * apr_table_entry_t *belt = (apr_table_entry_t *)barr->elts; * int i; * * for (i = 0; i < barr->nelts; ++i) { * if (flags & APR_OVERLAP_TABLES_MERGE) { * apr_table_mergen(a, belt[i].key, belt[i].val); * } * else { * apr_table_setn(a, belt[i].key, belt[i].val); * } * } ** * Except that it is more efficient (less space and cpu-time) especially * when b has many elements. * * Notice the assumptions on the keys and values in b -- they must be * in an ancestor of a's pool. In practice b and a are usually from * the same pool. */ APR_DECLARE(void) apr_table_overlap(apr_table_t *a, const apr_table_t *b, unsigned flags); /** * Eliminate redundant entries in a table by either overwriting * or merging duplicates * * @param t Table. * @param flags APR_OVERLAP_TABLES_MERGE to merge, or * APR_OVERLAP_TABLES_SET to overwrite */ APR_DECLARE(void) apr_table_compress(apr_table_t *t, unsigned flags); /** @} */ #ifdef __cplusplus } #endif #endif /* ! APR_TABLES_H */ 0707010001f182000081a4000017820000044e000000014b1d38c7000017720000022d0000016a00000000000000000000002500000000reloc/include/apr-1/apr_proc_mutex.h /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef APR_PROC_MUTEX_H #define APR_PROC_MUTEX_H /** * @file apr_proc_mutex.h * @brief APR Process Locking Routines */ #include "apr.h" #include "apr_pools.h" #include "apr_errno.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** * @defgroup apr_proc_mutex Process Locking Routines * @ingroup APR * @{ */ /** * Enumerated potential types for APR process locking methods * @warning Check APR_HAS_foo_SERIALIZE defines to see if the platform supports * APR_LOCK_foo. Only APR_LOCK_DEFAULT is portable. */ typedef enum { APR_LOCK_FCNTL, /**< fcntl() */ APR_LOCK_FLOCK, /**< flock() */ APR_LOCK_SYSVSEM, /**< System V Semaphores */ APR_LOCK_PROC_PTHREAD, /**< POSIX pthread process-based locking */ APR_LOCK_POSIXSEM, /**< POSIX semaphore process-based locking */ APR_LOCK_DEFAULT /**< Use the default process lock */ } apr_lockmech_e; /** Opaque structure representing a process mutex. */ typedef struct apr_proc_mutex_t apr_proc_mutex_t; /* Function definitions */ /** * Create and initialize a mutex that can be used to synchronize processes. * @param mutex the memory address where the newly created mutex will be * stored. * @param fname A file name to use if the lock mechanism requires one. This * argument should always be provided. The lock code itself will * determine if it should be used. * @param mech The mechanism to use for the interprocess lock, if any; one of *
* APR_LOCK_FCNTL * APR_LOCK_FLOCK * APR_LOCK_SYSVSEM * APR_LOCK_POSIXSEM * APR_LOCK_PROC_PTHREAD * APR_LOCK_DEFAULT pick the default mechanism for the platform ** @param pool the pool from which to allocate the mutex. * @see apr_lockmech_e * @warning Check APR_HAS_foo_SERIALIZE defines to see if the platform supports * APR_LOCK_foo. Only APR_LOCK_DEFAULT is portable. */ APR_DECLARE(apr_status_t) apr_proc_mutex_create(apr_proc_mutex_t **mutex, const char *fname, apr_lockmech_e mech, apr_pool_t *pool); /** * Re-open a mutex in a child process. * @param mutex The newly re-opened mutex structure. * @param fname A file name to use if the mutex mechanism requires one. This * argument should always be provided. The mutex code itself will * determine if it should be used. This filename should be the * same one that was passed to apr_proc_mutex_create(). * @param pool The pool to operate on. * @remark This function must be called to maintain portability, even * if the underlying lock mechanism does not require it. */ APR_DECLARE(apr_status_t) apr_proc_mutex_child_init(apr_proc_mutex_t **mutex, const char *fname, apr_pool_t *pool); /** * Acquire the lock for the given mutex. If the mutex is already locked, * the current thread will be put to sleep until the lock becomes available. * @param mutex the mutex on which to acquire the lock. */ APR_DECLARE(apr_status_t) apr_proc_mutex_lock(apr_proc_mutex_t *mutex); /** * Attempt to acquire the lock for the given mutex. If the mutex has already * been acquired, the call returns immediately with APR_EBUSY. Note: it * is important that the APR_STATUS_IS_EBUSY(s) macro be used to determine * if the return value was APR_EBUSY, for portability reasons. * @param mutex the mutex on which to attempt the lock acquiring. */ APR_DECLARE(apr_status_t) apr_proc_mutex_trylock(apr_proc_mutex_t *mutex); /** * Release the lock for the given mutex. * @param mutex the mutex from which to release the lock. */ APR_DECLARE(apr_status_t) apr_proc_mutex_unlock(apr_proc_mutex_t *mutex); /** * Destroy the mutex and free the memory associated with the lock. * @param mutex the mutex to destroy. */ APR_DECLARE(apr_status_t) apr_proc_mutex_destroy(apr_proc_mutex_t *mutex); /** * Destroy the mutex and free the memory associated with the lock. * @param mutex the mutex to destroy. * @note This function is generally used to kill a cleanup on an already * created mutex */ APR_DECLARE(apr_status_t) apr_proc_mutex_cleanup(void *mutex); /** * Return the name of the lockfile for the mutex, or NULL * if the mutex doesn't use a lock file */ APR_DECLARE(const char *) apr_proc_mutex_lockfile(apr_proc_mutex_t *mutex); /** * Display the name of the mutex, as it relates to the actual method used. * This matches the valid options for Apache's AcceptMutex directive * @param mutex the name of the mutex */ APR_DECLARE(const char *) apr_proc_mutex_name(apr_proc_mutex_t *mutex); /** * Display the name of the default mutex: APR_LOCK_DEFAULT */ APR_DECLARE(const char *) apr_proc_mutex_defname(void); /** * Get the pool used by this proc_mutex. * @return apr_pool_t the pool */ APR_POOL_DECLARE_ACCESSOR(proc_mutex); /** @} */ #ifdef __cplusplus } #endif #endif /* ! APR_PROC_MUTEX_H */ 0707010001f186000081a4000017820000044e000000014b1d38c700004a350000022d0000016a00000000000000000000001f00000000reloc/include/apr-1/apr_ring.h /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * This code draws heavily from the 4.4BSD
* struct my_element_t { * APR_RING_ENTRY(my_element_t) link; * int foo; * char *bar; * }; ** * An element struct may be put on more than one ring if it has more * than one APR_RING_ENTRY field. Each APR_RING_ENTRY has a corresponding * APR_RING_HEAD declaration. * * @warning For strict C standards compliance you should put the APR_RING_ENTRY * first in the element struct unless the head is always part of a larger * object with enough earlier fields to accommodate the offsetof() used * to compute the ring sentinel below. You can usually ignore this caveat. */ #define APR_RING_ENTRY(elem) \ struct { \ struct elem * volatile next; \ struct elem * volatile prev; \ } /** * The Ring Head * * Each ring is managed via its head, which is a struct declared like this: *
* APR_RING_HEAD(my_ring_t, my_element_t); * struct my_ring_t ring, *ringp; ** * This struct looks just like the element link struct so that we can * be sure that the typecasting games will work as expected. * * The first element in the ring is next after the head, and the last * element is just before the head. */ #define APR_RING_HEAD(head, elem) \ struct head { \ struct elem *next; \ struct elem *prev; \ } /** * The Ring Sentinel * * This is the magic pointer value that occurs before the first and * after the last elements in the ring, computed from the address of * the ring's head. The head itself isn't an element, but in order to * get rid of all the special cases when dealing with the ends of the * ring, we play typecasting games to make it look like one. * * Here is a diagram to illustrate the arrangements of the next and * prev pointers of each element in a single ring. Note that they point * to the start of each element, not to the APR_RING_ENTRY structure. * *
* +->+------+<-+ +->+------+<-+ +->+------+<-+ * | |struct| | | |struct| | | |struct| | * / | elem | \/ | elem | \/ | elem | \ * ... | | /\ | | /\ | | ... * +------+ | | +------+ | | +------+ * ...--|prev | | +--|ring | | +--|prev | * | next|--+ | entry|--+ | next|--... * +------+ +------+ +------+ * | etc. | | etc. | | etc. | * : : : : : : ** * The APR_RING_HEAD is nothing but a bare APR_RING_ENTRY. The prev * and next pointers in the first and last elements don't actually * point to the head, they point to a phantom place called the * sentinel. Its value is such that last->next->next == first because * the offset from the sentinel to the head's next pointer is the same * as the offset from the start of an element to its next pointer. * This also works in the opposite direction. * *
* last first * +->+------+<-+ +->sentinel<-+ +->+------+<-+ * | |struct| | | | | |struct| | * / | elem | \/ \/ | elem | \ * ... | | /\ /\ | | ... * +------+ | | +------+ | | +------+ * ...--|prev | | +--|ring | | +--|prev | * | next|--+ | head|--+ | next|--... * +------+ +------+ +------+ * | etc. | | etc. | * : : : : ** * Note that the offset mentioned above is different for each kind of * ring that the element may be on, and each kind of ring has a unique * name for its APR_RING_ENTRY in each element, and has its own type * for its APR_RING_HEAD. * * Note also that if the offset is non-zero (which is required if an * element has more than one APR_RING_ENTRY), the unreality of the * sentinel may have bad implications on very perverse implementations * of C -- see the warning in APR_RING_ENTRY. * * @param hp The head of the ring * @param elem The name of the element struct * @param link The name of the APR_RING_ENTRY in the element struct */ #define APR_RING_SENTINEL(hp, elem, link) \ (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link)) /** * The first element of the ring * @param hp The head of the ring */ #define APR_RING_FIRST(hp) (hp)->next /** * The last element of the ring * @param hp The head of the ring */ #define APR_RING_LAST(hp) (hp)->prev /** * The next element in the ring * @param ep The current element * @param link The name of the APR_RING_ENTRY in the element struct */ #define APR_RING_NEXT(ep, link) (ep)->link.next /** * The previous element in the ring * @param ep The current element * @param link The name of the APR_RING_ENTRY in the element struct */ #define APR_RING_PREV(ep, link) (ep)->link.prev /** * Initialize a ring * @param hp The head of the ring * @param elem The name of the element struct * @param link The name of the APR_RING_ENTRY in the element struct */ #define APR_RING_INIT(hp, elem, link) do { \ APR_RING_FIRST((hp)) = APR_RING_SENTINEL((hp), elem, link); \ APR_RING_LAST((hp)) = APR_RING_SENTINEL((hp), elem, link); \ } while (0) /** * Determine if a ring is empty * @param hp The head of the ring * @param elem The name of the element struct * @param link The name of the APR_RING_ENTRY in the element struct * @return true or false */ #define APR_RING_EMPTY(hp, elem, link) \ (APR_RING_FIRST((hp)) == APR_RING_SENTINEL((hp), elem, link)) /** * Initialize a singleton element * @param ep The element * @param link The name of the APR_RING_ENTRY in the element struct */ #define APR_RING_ELEM_INIT(ep, link) do { \ APR_RING_NEXT((ep), link) = (ep); \ APR_RING_PREV((ep), link) = (ep); \ } while (0) /** * Splice the sequence ep1..epN into the ring before element lep * (..lep.. becomes ..ep1..epN..lep..) * @warning This doesn't work for splicing before the first element or on * empty rings... see APR_RING_SPLICE_HEAD for one that does * @param lep Element in the ring to splice before * @param ep1 First element in the sequence to splice in * @param epN Last element in the sequence to splice in * @param link The name of the APR_RING_ENTRY in the element struct */ #define APR_RING_SPLICE_BEFORE(lep, ep1, epN, link) do { \ APR_RING_NEXT((epN), link) = (lep); \ APR_RING_PREV((ep1), link) = APR_RING_PREV((lep), link); \ APR_RING_NEXT(APR_RING_PREV((lep), link), link) = (ep1); \ APR_RING_PREV((lep), link) = (epN); \ } while (0) /** * Splice the sequence ep1..epN into the ring after element lep * (..lep.. becomes ..lep..ep1..epN..) * @warning This doesn't work for splicing after the last element or on * empty rings... see APR_RING_SPLICE_TAIL for one that does * @param lep Element in the ring to splice after * @param ep1 First element in the sequence to splice in * @param epN Last element in the sequence to splice in * @param link The name of the APR_RING_ENTRY in the element struct */ #define APR_RING_SPLICE_AFTER(lep, ep1, epN, link) do { \ APR_RING_PREV((ep1), link) = (lep); \ APR_RING_NEXT((epN), link) = APR_RING_NEXT((lep), link); \ APR_RING_PREV(APR_RING_NEXT((lep), link), link) = (epN); \ APR_RING_NEXT((lep), link) = (ep1); \ } while (0) /** * Insert the element nep into the ring before element lep * (..lep.. becomes ..nep..lep..) * @warning This doesn't work for inserting before the first element or on * empty rings... see APR_RING_INSERT_HEAD for one that does * @param lep Element in the ring to insert before * @param nep Element to insert * @param link The name of the APR_RING_ENTRY in the element struct */ #define APR_RING_INSERT_BEFORE(lep, nep, link) \ APR_RING_SPLICE_BEFORE((lep), (nep), (nep), link) /** * Insert the element nep into the ring after element lep * (..lep.. becomes ..lep..nep..) * @warning This doesn't work for inserting after the last element or on * empty rings... see APR_RING_INSERT_TAIL for one that does * @param lep Element in the ring to insert after * @param nep Element to insert * @param link The name of the APR_RING_ENTRY in the element struct */ #define APR_RING_INSERT_AFTER(lep, nep, link) \ APR_RING_SPLICE_AFTER((lep), (nep), (nep), link) /** * Splice the sequence ep1..epN into the ring before the first element * (..hp.. becomes ..hp..ep1..epN..) * @param hp Head of the ring * @param ep1 First element in the sequence to splice in * @param epN Last element in the sequence to splice in * @param elem The name of the element struct * @param link The name of the APR_RING_ENTRY in the element struct */ #define APR_RING_SPLICE_HEAD(hp, ep1, epN, elem, link) \ APR_RING_SPLICE_AFTER(APR_RING_SENTINEL((hp), elem, link), \ (ep1), (epN), link) /** * Splice the sequence ep1..epN into the ring after the last element * (..hp.. becomes ..ep1..epN..hp..) * @param hp Head of the ring * @param ep1 First element in the sequence to splice in * @param epN Last element in the sequence to splice in * @param elem The name of the element struct * @param link The name of the APR_RING_ENTRY in the element struct */ #define APR_RING_SPLICE_TAIL(hp, ep1, epN, elem, link) \ APR_RING_SPLICE_BEFORE(APR_RING_SENTINEL((hp), elem, link), \ (ep1), (epN), link) /** * Insert the element nep into the ring before the first element * (..hp.. becomes ..hp..nep..) * @param hp Head of the ring * @param nep Element to insert * @param elem The name of the element struct * @param link The name of the APR_RING_ENTRY in the element struct */ #define APR_RING_INSERT_HEAD(hp, nep, elem, link) \ APR_RING_SPLICE_HEAD((hp), (nep), (nep), elem, link) /** * Insert the element nep into the ring after the last element * (..hp.. becomes ..nep..hp..) * @param hp Head of the ring * @param nep Element to insert * @param elem The name of the element struct * @param link The name of the APR_RING_ENTRY in the element struct */ #define APR_RING_INSERT_TAIL(hp, nep, elem, link) \ APR_RING_SPLICE_TAIL((hp), (nep), (nep), elem, link) /** * Concatenate ring h2 onto the end of ring h1, leaving h2 empty. * @param h1 Head of the ring to concatenate onto * @param h2 Head of the ring to concatenate * @param elem The name of the element struct * @param link The name of the APR_RING_ENTRY in the element struct */ #define APR_RING_CONCAT(h1, h2, elem, link) do { \ if (!APR_RING_EMPTY((h2), elem, link)) { \ APR_RING_SPLICE_BEFORE(APR_RING_SENTINEL((h1), elem, link), \ APR_RING_FIRST((h2)), \ APR_RING_LAST((h2)), link); \ APR_RING_INIT((h2), elem, link); \ } \ } while (0) /** * Prepend ring h2 onto the beginning of ring h1, leaving h2 empty. * @param h1 Head of the ring to prepend onto * @param h2 Head of the ring to prepend * @param elem The name of the element struct * @param link The name of the APR_RING_ENTRY in the element struct */ #define APR_RING_PREPEND(h1, h2, elem, link) do { \ if (!APR_RING_EMPTY((h2), elem, link)) { \ APR_RING_SPLICE_AFTER(APR_RING_SENTINEL((h1), elem, link), \ APR_RING_FIRST((h2)), \ APR_RING_LAST((h2)), link); \ APR_RING_INIT((h2), elem, link); \ } \ } while (0) /** * Unsplice a sequence of elements from a ring * @warning The unspliced sequence is left with dangling pointers at either end * @param ep1 First element in the sequence to unsplice * @param epN Last element in the sequence to unsplice * @param link The name of the APR_RING_ENTRY in the element struct */ #define APR_RING_UNSPLICE(ep1, epN, link) do { \ APR_RING_NEXT(APR_RING_PREV((ep1), link), link) = \ APR_RING_NEXT((epN), link); \ APR_RING_PREV(APR_RING_NEXT((epN), link), link) = \ APR_RING_PREV((ep1), link); \ } while (0) /** * Remove a single element from a ring * @warning The unspliced element is left with dangling pointers at either end * @param ep Element to remove * @param link The name of the APR_RING_ENTRY in the element struct */ #define APR_RING_REMOVE(ep, link) \ APR_RING_UNSPLICE((ep), (ep), link) /** * Iterate over a ring * @param ep The current element * @param head The head of the ring * @param elem The name of the element struct * @param link The name of the APR_RING_ENTRY in the element struct */ #define APR_RING_FOREACH(ep, head, elem, link) \ for (ep = APR_RING_FIRST(head); \ ep != APR_RING_SENTINEL(head, elem, link); \ ep = APR_RING_NEXT(ep, link)) /** * Iterate over a ring safe against removal of the current element * @param ep1 The current element * @param ep2 Iteration cursor * @param head The head of the ring * @param elem The name of the element struct * @param link The name of the APR_RING_ENTRY in the element struct */ #define APR_RING_FOREACH_SAFE(ep1, ep2, head, elem, link) \ for (ep1 = APR_RING_FIRST(head), ep2 = APR_RING_NEXT(ep1, link); \ ep1 != APR_RING_SENTINEL(head, elem, link); \ ep1 = ep2, ep2 = APR_RING_NEXT(ep1, link)) /* Debugging tools: */ #ifdef APR_RING_DEBUG #include
* Features: * * APU_WANT_DB:*/ /* --------------------------------------------------------------------- */ #ifdef APU_WANT_DB #if APU_HAVE_DB #include* * Typical usage: * * #define APU_WANT_DB * #include "apu_want.h" * * The appropriate headers will be included. * * Note: it is safe to use this in a header (it won't interfere with other * headers' or source files' use of apu_want.h) *
* APR_WRITE open for read-write access * APR_CREATE create the sdbm if it does not exist * APR_TRUNCATE empty the contents of the sdbm * APR_EXCL fail for APR_CREATE if the file exists * APR_DELONCLOSE delete the sdbm when closed * APR_SHARELOCK support locking across process/machines ** @param perms Permissions to apply to if created * @param p The pool to use when creating the sdbm * @remark The sdbm name is not a true file name, as sdbm appends suffixes * for seperate data and index files. */ APU_DECLARE(apr_status_t) apr_sdbm_open(apr_sdbm_t **db, const char *name, apr_int32_t mode, apr_fileperms_t perms, apr_pool_t *p); /** * Close an sdbm file previously opened by apr_sdbm_open * @param db The database to close */ APU_DECLARE(apr_status_t) apr_sdbm_close(apr_sdbm_t *db); /** * Lock an sdbm database for concurency of multiple operations * @param db The database to lock * @param type The lock type *
* APR_FLOCK_SHARED * APR_FLOCK_EXCLUSIVE ** @remark Calls to apr_sdbm_lock may be nested. All apr_sdbm functions * perform implicit locking. Since an APR_FLOCK_SHARED lock cannot be * portably promoted to an APR_FLOCK_EXCLUSIVE lock, apr_sdbm_store and * apr_sdbm_delete calls will fail if an APR_FLOCK_SHARED lock is held. * The apr_sdbm_lock call requires the database to be opened with the * APR_SHARELOCK mode value. */ APU_DECLARE(apr_status_t) apr_sdbm_lock(apr_sdbm_t *db, int type); /** * Release an sdbm lock previously aquired by apr_sdbm_lock * @param db The database to unlock */ APU_DECLARE(apr_status_t) apr_sdbm_unlock(apr_sdbm_t *db); /** * Fetch an sdbm record value by key * @param db The database * @param value The value datum retrieved for this record * @param key The key datum to find this record */ APU_DECLARE(apr_status_t) apr_sdbm_fetch(apr_sdbm_t *db, apr_sdbm_datum_t *value, apr_sdbm_datum_t key); /** * Store an sdbm record value by key * @param db The database * @param key The key datum to store this record by * @param value The value datum to store in this record * @param opt The method used to store the record *
* APR_SDBM_INSERT return an error if the record exists * APR_SDBM_REPLACE overwrite any existing record for key **/ APU_DECLARE(apr_status_t) apr_sdbm_store(apr_sdbm_t *db, apr_sdbm_datum_t key, apr_sdbm_datum_t value, int opt); /** * Delete an sdbm record value by key * @param db The database * @param key The key datum of the record to delete * @remark It is not an error to delete a non-existent record. */ APU_DECLARE(apr_status_t) apr_sdbm_delete(apr_sdbm_t *db, const apr_sdbm_datum_t key); /** * Retrieve the first record key from a dbm * @param db The database * @param key The key datum of the first record * @remark The keys returned are not ordered. To traverse the list of keys * for an sdbm opened with APR_SHARELOCK, the caller must use apr_sdbm_lock * prior to retrieving the first record, and hold the lock until after the * last call to apr_sdbm_nextkey. */ APU_DECLARE(apr_status_t) apr_sdbm_firstkey(apr_sdbm_t *db, apr_sdbm_datum_t *key); /** * Retrieve the next record key from an sdbm * @param db The database * @param key The key datum of the next record */ APU_DECLARE(apr_status_t) apr_sdbm_nextkey(apr_sdbm_t *db, apr_sdbm_datum_t *key); /** * Returns true if the sdbm database opened for read-only access * @param db The database to test */ APU_DECLARE(int) apr_sdbm_rdonly(apr_sdbm_t *db); /** @} */ #endif /* APR_SDBM_H */ 0707010001f171000081a4000017820000044e000000014b1d38c7000008590000022d0000016a00000000000000000000002200000000reloc/include/apr-1/apr_inherit.h /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef APR_INHERIT_H #define APR_INHERIT_H /** * @file apr_inherit.h * @brief APR File Handle Inheritance Helpers * @remark This internal header includes internal declaration helpers * for other headers to declare apr_foo_inherit_[un]set functions. */ /** * Prototype for type-specific declarations of apr_foo_inherit_set * functions. * @remark Doxygen unwraps this macro (via doxygen.conf) to provide * actual help for each specific occurance of apr_foo_inherit_set. * @remark the linkage is specified for APR. It would be possible to expand * the macros to support other linkages. */ #define APR_DECLARE_INHERIT_SET(type) \ APR_DECLARE(apr_status_t) apr_##type##_inherit_set( \ apr_##type##_t *the##type) /** * Prototype for type-specific declarations of apr_foo_inherit_unset * functions. * @remark Doxygen unwraps this macro (via doxygen.conf) to provide * actual help for each specific occurance of apr_foo_inherit_unset. * @remark the linkage is specified for APR. It would be possible to expand * the macros to support other linkages. */ #define APR_DECLARE_INHERIT_UNSET(type) \ APR_DECLARE(apr_status_t) apr_##type##_inherit_unset( \ apr_##type##_t *the##type) #endif /* ! APR_INHERIT_H */ 0707010001f178000081a4000017820000044e000000014b1d38c9000011ad0000022d0000016a00000000000000000000001e00000000reloc/include/apr-1/apr_md4.h /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* This is derived from material copyright RSA Data Security, Inc. * Their notice is reproduced below in its entirety. * * Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All * rights reserved. * * License to copy and use this software is granted provided that it * is identified as the "RSA Data Security, Inc. MD4 Message-Digest * Algorithm" in all material mentioning or referencing this software * or this function. * * License is also granted to make and use derivative works provided * that such works are identified as "derived from the RSA Data * Security, Inc. MD4 Message-Digest Algorithm" in all material * mentioning or referencing the derived work. * * RSA Data Security, Inc. makes no representations concerning either * the merchantability of this software or the suitability of this * software for any particular purpose. It is provided "as is" * without express or implied warranty of any kind. * * These notices must be retained in any copies of any part of this * documentation and/or software. */ #ifndef APR_MD4_H #define APR_MD4_H #include "apu.h" #include "apr_xlate.h" /** * @file apr_md4.h * @brief APR-UTIL MD4 Library */ #ifdef __cplusplus extern "C" { #endif /** * @defgroup APR_Util_MD4 MD4 Library * @ingroup APR_Util * @{ */ /** The digestsize for MD4 */ #define APR_MD4_DIGESTSIZE 16 /** @see apr_md4_ctx_t */ typedef struct apr_md4_ctx_t apr_md4_ctx_t; /** MD4 context. */ struct apr_md4_ctx_t { /** state (ABCD) */ apr_uint32_t state[4]; /** number of bits, modulo 2^64 (lsb first) */ apr_uint32_t count[2]; /** input buffer */ unsigned char buffer[64]; #if APR_HAS_XLATE /** translation handle */ apr_xlate_t *xlate; #endif }; /** * MD4 Initialize. Begins an MD4 operation, writing a new context. * @param context The MD4 context to initialize. */ APU_DECLARE(apr_status_t) apr_md4_init(apr_md4_ctx_t *context); #if APR_HAS_XLATE /** * MDr4 translation setup. Provides the APR translation handle to be used * for translating the content before calculating the digest. * @param context The MD4 content to set the translation for. * @param xlate The translation handle to use for this MD4 context */ APU_DECLARE(apr_status_t) apr_md4_set_xlate(apr_md4_ctx_t *context, apr_xlate_t *xlate); #else #define apr_md4_set_xlate(context, xlate) APR_ENOTIMPL #endif /** * MD4 block update operation. Continue an MD4 message-digest operation, * processing another message block, and updating the context. * @param context The MD4 content to update. * @param input next message block to update * @param inputLen The length of the next message block */ APU_DECLARE(apr_status_t) apr_md4_update(apr_md4_ctx_t *context, const unsigned char *input, apr_size_t inputLen); /** * MD4 finalization. Ends an MD4 message-digest operation, writing the * message digest and zeroing the context * @param digest The final MD4 digest * @param context The MD4 content we are finalizing. */ APU_DECLARE(apr_status_t) apr_md4_final( unsigned char digest[APR_MD4_DIGESTSIZE], apr_md4_ctx_t *context); /** * MD4 digest computation * @param digest The MD4 digest * @param input message block to use * @param inputLen The length of the message block */ APU_DECLARE(apr_status_t) apr_md4(unsigned char digest[APR_MD4_DIGESTSIZE], const unsigned char *input, apr_size_t inputLen); /** @} */ #ifdef __cplusplus } #endif #endif /* !APR_MD4_H */ 0707010001f183000081a4000017820000044e000000014b1d38c900000ff20000022d0000016a00000000000000000000002000000000reloc/include/apr-1/apr_queue.h /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef APR_QUEUE_H #define APR_QUEUE_H /** * @file apr_queue.h * @brief Thread Safe FIFO bounded queue * @note Since most implementations of the queue are backed by a condition * variable implementation, it isn't available on systems without threads. * Although condition variables are some times available without threads. */ #include "apu.h" #include "apr_errno.h" #include "apr_pools.h" #if APR_HAS_THREADS #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** * @defgroup APR_Util_FIFO Thread Safe FIFO bounded queue * @ingroup APR_Util * @{ */ /** * opaque structure */ typedef struct apr_queue_t apr_queue_t; /** * create a FIFO queue * @param queue The new queue * @param queue_capacity maximum size of the queue * @param a pool to allocate queue from */ APU_DECLARE(apr_status_t) apr_queue_create(apr_queue_t **queue, unsigned int queue_capacity, apr_pool_t *a); /** * push/add an object to the queue, blocking if the queue is already full * * @param queue the queue * @param data the data * @returns APR_EINTR the blocking was interrupted (try again) * @returns APR_EOF the queue has been terminated * @returns APR_SUCCESS on a successful push */ APU_DECLARE(apr_status_t) apr_queue_push(apr_queue_t *queue, void *data); /** * pop/get an object from the queue, blocking if the queue is already empty * * @param queue the queue * @param data the data * @returns APR_EINTR the blocking was interrupted (try again) * @returns APR_EOF if the queue has been terminated * @returns APR_SUCCESS on a successful pop */ APU_DECLARE(apr_status_t) apr_queue_pop(apr_queue_t *queue, void **data); /** * push/add an object to the queue, returning immediately if the queue is full * * @param queue the queue * @param data the data * @returns APR_EINTR the blocking operation was interrupted (try again) * @returns APR_EAGAIN the queue is full * @returns APR_EOF the queue has been terminated * @returns APR_SUCCESS on a successful push */ APU_DECLARE(apr_status_t) apr_queue_trypush(apr_queue_t *queue, void *data); /** * pop/get an object to the queue, returning immediately if the queue is empty * * @param queue the queue * @param data the data * @returns APR_EINTR the blocking operation was interrupted (try again) * @returns APR_EAGAIN the queue is empty * @returns APR_EOF the queue has been terminated * @returns APR_SUCCESS on a successful push */ APU_DECLARE(apr_status_t) apr_queue_trypop(apr_queue_t *queue, void **data); /** * returns the size of the queue. * * @warning this is not threadsafe, and is intended for reporting/monitoring * of the queue. * @param queue the queue * @returns the size of the queue */ APU_DECLARE(unsigned int) apr_queue_size(apr_queue_t *queue); /** * interrupt all the threads blocking on this queue. * * @param queue the queue */ APU_DECLARE(apr_status_t) apr_queue_interrupt_all(apr_queue_t *queue); /** * terminate the queue, sending an interrupt to all the * blocking threads * * @param queue the queue */ APU_DECLARE(apr_status_t) apr_queue_term(apr_queue_t *queue); #ifdef __cplusplus } #endif /** @} */ #endif /* APR_HAS_THREADS */ #endif /* APRQUEUE_H */ 0707010001f17c000081a4000017820000044e000000014b1d38c700007eec0000022d0000016a00000000000000000000002500000000reloc/include/apr-1/apr_network_io.h /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef APR_NETWORK_IO_H #define APR_NETWORK_IO_H /** * @file apr_network_io.h * @brief APR Network library */ #include "apr.h" #include "apr_pools.h" #include "apr_file_io.h" #include "apr_errno.h" #include "apr_inherit.h" #if APR_HAVE_NETINET_IN_H #include
* APR_SHUTDOWN_READ no longer allow read requests * APR_SHUTDOWN_WRITE no longer allow write requests * APR_SHUTDOWN_READWRITE no longer allow read or write requests ** @see apr_shutdown_how_e * @remark This does not actually close the socket descriptor, it just * controls which calls are still valid on the socket. */ APR_DECLARE(apr_status_t) apr_socket_shutdown(apr_socket_t *thesocket, apr_shutdown_how_e how); /** * Close a socket. * @param thesocket The socket to close */ APR_DECLARE(apr_status_t) apr_socket_close(apr_socket_t *thesocket); /** * Bind the socket to its associated port * @param sock The socket to bind * @param sa The socket address to bind to * @remark This may be where we will find out if there is any other process * using the selected port. */ APR_DECLARE(apr_status_t) apr_socket_bind(apr_socket_t *sock, apr_sockaddr_t *sa); /** * Listen to a bound socket for connections. * @param sock The socket to listen on * @param backlog The number of outstanding connections allowed in the sockets * listen queue. If this value is less than zero, the listen * queue size is set to zero. */ APR_DECLARE(apr_status_t) apr_socket_listen(apr_socket_t *sock, apr_int32_t backlog); /** * Accept a new connection request * @param new_sock A copy of the socket that is connected to the socket that * made the connection request. This is the socket which should * be used for all future communication. * @param sock The socket we are listening on. * @param connection_pool The pool for the new socket. */ APR_DECLARE(apr_status_t) apr_socket_accept(apr_socket_t **new_sock, apr_socket_t *sock, apr_pool_t *connection_pool); /** * Issue a connection request to a socket either on the same machine * or a different one. * @param sock The socket we wish to use for our side of the connection * @param sa The address of the machine we wish to connect to. */ APR_DECLARE(apr_status_t) apr_socket_connect(apr_socket_t *sock, apr_sockaddr_t *sa); /** * Create apr_sockaddr_t from hostname, address family, and port. * @param sa The new apr_sockaddr_t. * @param hostname The hostname or numeric address string to resolve/parse, or * NULL to build an address that corresponds to 0.0.0.0 or :: * @param family The address family to use, or APR_UNSPEC if the system should * decide. * @param port The port number. * @param flags Special processing flags: *
* APR_IPV4_ADDR_OK first query for IPv4 addresses; only look * for IPv6 addresses if the first query failed; * only valid if family is APR_UNSPEC and hostname * isn't NULL; mutually exclusive with * APR_IPV6_ADDR_OK * APR_IPV6_ADDR_OK first query for IPv6 addresses; only look * for IPv4 addresses if the first query failed; * only valid if family is APR_UNSPEC and hostname * isn't NULL and APR_HAVE_IPV6; mutually exclusive * with APR_IPV4_ADDR_OK ** @param p The pool for the apr_sockaddr_t and associated storage. */ APR_DECLARE(apr_status_t) apr_sockaddr_info_get(apr_sockaddr_t **sa, const char *hostname, apr_int32_t family, apr_port_t port, apr_int32_t flags, apr_pool_t *p); /** * Look up the host name from an apr_sockaddr_t. * @param hostname The hostname. * @param sa The apr_sockaddr_t. * @param flags Special processing flags. */ APR_DECLARE(apr_status_t) apr_getnameinfo(char **hostname, apr_sockaddr_t *sa, apr_int32_t flags); /** * Parse hostname/IP address with scope id and port. * * Any of the following strings are accepted: * 8080 (just the port number) * www.apache.org (just the hostname) * www.apache.org:8080 (hostname and port number) * [fe80::1]:80 (IPv6 numeric address string only) * [fe80::1%eth0] (IPv6 numeric address string and scope id) * * Invalid strings: * (empty string) * [abc] (not valid IPv6 numeric address string) * abc:65536 (invalid port number) * * @param addr The new buffer containing just the hostname. On output, *addr * will be NULL if no hostname/IP address was specfied. * @param scope_id The new buffer containing just the scope id. On output, * *scope_id will be NULL if no scope id was specified. * @param port The port number. On output, *port will be 0 if no port was * specified. * ### FIXME: 0 is a legal port (per RFC 1700). this should * ### return something besides zero if the port is missing. * @param str The input string to be parsed. * @param p The pool from which *addr and *scope_id are allocated. * @remark If scope id shouldn't be allowed, check for scope_id != NULL in * addition to checking the return code. If addr/hostname should be * required, check for addr == NULL in addition to checking the * return code. */ APR_DECLARE(apr_status_t) apr_parse_addr_port(char **addr, char **scope_id, apr_port_t *port, const char *str, apr_pool_t *p); /** * Get name of the current machine * @param buf A buffer to store the hostname in. * @param len The maximum length of the hostname that can be stored in the * buffer provided. The suggested length is APRMAXHOSTLEN + 1. * @param cont The pool to use. * @remark If the buffer was not large enough, an error will be returned. */ APR_DECLARE(apr_status_t) apr_gethostname(char *buf, int len, apr_pool_t *cont); /** * Return the data associated with the current socket * @param data The user data associated with the socket. * @param key The key to associate with the user data. * @param sock The currently open socket. */ APR_DECLARE(apr_status_t) apr_socket_data_get(void **data, const char *key, apr_socket_t *sock); /** * Set the data associated with the current socket. * @param sock The currently open socket. * @param data The user data to associate with the socket. * @param key The key to associate with the data. * @param cleanup The cleanup to call when the socket is destroyed. */ APR_DECLARE(apr_status_t) apr_socket_data_set(apr_socket_t *sock, void *data, const char *key, apr_status_t (*cleanup)(void*)); /** * Send data over a network. * @param sock The socket to send the data over. * @param buf The buffer which contains the data to be sent. * @param len On entry, the number of bytes to send; on exit, the number * of bytes sent. * @remark *
* This functions acts like a blocking write by default. To change * this behavior, use apr_socket_timeout_set() or the APR_SO_NONBLOCK * socket option. * * It is possible for both bytes to be sent and an error to be returned. * * APR_EINTR is never returned. **/ APR_DECLARE(apr_status_t) apr_socket_send(apr_socket_t *sock, const char *buf, apr_size_t *len); /** * Send multiple packets of data over a network. * @param sock The socket to send the data over. * @param vec The array of iovec structs containing the data to send * @param nvec The number of iovec structs in the array * @param len Receives the number of bytes actually written * @remark *
* This functions acts like a blocking write by default. To change * this behavior, use apr_socket_timeout_set() or the APR_SO_NONBLOCK * socket option. * The number of bytes actually sent is stored in argument 3. * * It is possible for both bytes to be sent and an error to be returned. * * APR_EINTR is never returned. **/ APR_DECLARE(apr_status_t) apr_socket_sendv(apr_socket_t *sock, const struct iovec *vec, apr_int32_t nvec, apr_size_t *len); /** * @param sock The socket to send from * @param where The apr_sockaddr_t describing where to send the data * @param flags The flags to use * @param buf The data to send * @param len The length of the data to send */ APR_DECLARE(apr_status_t) apr_socket_sendto(apr_socket_t *sock, apr_sockaddr_t *where, apr_int32_t flags, const char *buf, apr_size_t *len); /** * Read data from a socket. On success, the address of the peer from * which the data was sent is copied into the @param from parameter, * and the @param len parameter is updated to give the number of bytes * written to @param buf. * @param from Updated with the address from which the data was received * @param sock The socket to use * @param flags The flags to use * @param buf The buffer to use * @param len The length of the available buffer */ APR_DECLARE(apr_status_t) apr_socket_recvfrom(apr_sockaddr_t *from, apr_socket_t *sock, apr_int32_t flags, char *buf, apr_size_t *len); #if APR_HAS_SENDFILE || defined(DOXYGEN) /** * Send a file from an open file descriptor to a socket, along with * optional headers and trailers * @param sock The socket to which we're writing * @param file The open file from which to read * @param hdtr A structure containing the headers and trailers to send * @param offset Offset into the file where we should begin writing * @param len (input) - Number of bytes to send from the file * (output) - Number of bytes actually sent, * including headers, file, and trailers * @param flags APR flags that are mapped to OS specific flags * @remark This functions acts like a blocking write by default. To change * this behavior, use apr_socket_timeout_set() or the * APR_SO_NONBLOCK socket option. * The number of bytes actually sent is stored in the len parameter. * The offset parameter is passed by reference for no reason; its * value will never be modified by the apr_socket_sendfile() function. */ APR_DECLARE(apr_status_t) apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, apr_hdtr_t *hdtr, apr_off_t *offset, apr_size_t *len, apr_int32_t flags); #endif /* APR_HAS_SENDFILE */ /** * Read data from a network. * @param sock The socket to read the data from. * @param buf The buffer to store the data in. * @param len On entry, the number of bytes to receive; on exit, the number * of bytes received. * @remark *
* This functions acts like a blocking read by default. To change * this behavior, use apr_socket_timeout_set() or the APR_SO_NONBLOCK * socket option. * The number of bytes actually received is stored in argument 3. * * It is possible for both bytes to be received and an APR_EOF or * other error to be returned. * * APR_EINTR is never returned. **/ APR_DECLARE(apr_status_t) apr_socket_recv(apr_socket_t *sock, char *buf, apr_size_t *len); /** * Setup socket options for the specified socket * @param sock The socket to set up. * @param opt The option we would like to configure. One of: *
* APR_SO_DEBUG -- turn on debugging information * APR_SO_KEEPALIVE -- keep connections active * APR_SO_LINGER -- lingers on close if data is present * APR_SO_NONBLOCK -- Turns blocking on/off for socket * When this option is enabled, use * the APR_STATUS_IS_EAGAIN() macro to * see if a send or receive function * could not transfer data without * blocking. * APR_SO_REUSEADDR -- The rules used in validating addresses * supplied to bind should allow reuse * of local addresses. * APR_SO_SNDBUF -- Set the SendBufferSize * APR_SO_RCVBUF -- Set the ReceiveBufferSize ** @param on Value for the option. */ APR_DECLARE(apr_status_t) apr_socket_opt_set(apr_socket_t *sock, apr_int32_t opt, apr_int32_t on); /** * Setup socket timeout for the specified socket * @param sock The socket to set up. * @param t Value for the timeout. *
* t > 0 -- read and write calls return APR_TIMEUP if specified time * elapsess with no data read or written * t == 0 -- read and write calls never block * t < 0 -- read and write calls block **/ APR_DECLARE(apr_status_t) apr_socket_timeout_set(apr_socket_t *sock, apr_interval_time_t t); /** * Query socket options for the specified socket * @param sock The socket to query * @param opt The option we would like to query. One of: *
* APR_SO_DEBUG -- turn on debugging information * APR_SO_KEEPALIVE -- keep connections active * APR_SO_LINGER -- lingers on close if data is present * APR_SO_NONBLOCK -- Turns blocking on/off for socket * APR_SO_REUSEADDR -- The rules used in validating addresses * supplied to bind should allow reuse * of local addresses. * APR_SO_SNDBUF -- Set the SendBufferSize * APR_SO_RCVBUF -- Set the ReceiveBufferSize * APR_SO_DISCONNECTED -- Query the disconnected state of the socket. * (Currently only used on Windows) ** @param on Socket option returned on the call. */ APR_DECLARE(apr_status_t) apr_socket_opt_get(apr_socket_t *sock, apr_int32_t opt, apr_int32_t *on); /** * Query socket timeout for the specified socket * @param sock The socket to query * @param t Socket timeout returned from the query. */ APR_DECLARE(apr_status_t) apr_socket_timeout_get(apr_socket_t *sock, apr_interval_time_t *t); /** * Query the specified socket if at the OOB/Urgent data mark * @param sock The socket to query * @param atmark Is set to true if socket is at the OOB/urgent mark, * otherwise is set to false. */ APR_DECLARE(apr_status_t) apr_socket_atmark(apr_socket_t *sock, int *atmark); /** * Return an address associated with a socket; either the address to * which the socket is bound locally or the the address of the peer * to which the socket is connected. * @param sa The returned apr_sockaddr_t. * @param which Whether to retrieve the local or remote address * @param sock The socket to use */ APR_DECLARE(apr_status_t) apr_socket_addr_get(apr_sockaddr_t **sa, apr_interface_e which, apr_socket_t *sock); /** * Return the IP address (in numeric address string format) in * an APR socket address. APR will allocate storage for the IP address * string from the pool of the apr_sockaddr_t. * @param addr The IP address. * @param sockaddr The socket address to reference. */ APR_DECLARE(apr_status_t) apr_sockaddr_ip_get(char **addr, apr_sockaddr_t *sockaddr); /** * Write the IP address (in numeric address string format) of the APR * socket address @a sockaddr into the buffer @a buf (of size @a buflen). * @param sockaddr The socket address to reference. */ APR_DECLARE(apr_status_t) apr_sockaddr_ip_getbuf(char *buf, apr_size_t buflen, apr_sockaddr_t *sockaddr); /** * See if the IP addresses in two APR socket addresses are * equivalent. Appropriate logic is present for comparing * IPv4-mapped IPv6 addresses with IPv4 addresses. * * @param addr1 One of the APR socket addresses. * @param addr2 The other APR socket address. * @remark The return value will be non-zero if the addresses * are equivalent. */ APR_DECLARE(int) apr_sockaddr_equal(const apr_sockaddr_t *addr1, const apr_sockaddr_t *addr2); /** * Return the type of the socket. * @param sock The socket to query. * @param type The returned type (e.g., SOCK_STREAM). */ APR_DECLARE(apr_status_t) apr_socket_type_get(apr_socket_t *sock, int *type); /** * Given an apr_sockaddr_t and a service name, set the port for the service * @param sockaddr The apr_sockaddr_t that will have its port set * @param servname The name of the service you wish to use */ APR_DECLARE(apr_status_t) apr_getservbyname(apr_sockaddr_t *sockaddr, const char *servname); /** * Build an ip-subnet representation from an IP address and optional netmask or * number-of-bits. * @param ipsub The new ip-subnet representation * @param ipstr The input IP address string * @param mask_or_numbits The input netmask or number-of-bits string, or NULL * @param p The pool to allocate from */ APR_DECLARE(apr_status_t) apr_ipsubnet_create(apr_ipsubnet_t **ipsub, const char *ipstr, const char *mask_or_numbits, apr_pool_t *p); /** * Test the IP address in an apr_sockaddr_t against a pre-built ip-subnet * representation. * @param ipsub The ip-subnet representation * @param sa The socket address to test * @return non-zero if the socket address is within the subnet, 0 otherwise */ APR_DECLARE(int) apr_ipsubnet_test(apr_ipsubnet_t *ipsub, apr_sockaddr_t *sa); #if APR_HAS_SO_ACCEPTFILTER || defined(DOXYGEN) /** * Set an OS level accept filter. * @param sock The socket to put the accept filter on. * @param name The accept filter * @param args Any extra args to the accept filter. Passing NULL here removes * the accept filter. */ apr_status_t apr_socket_accept_filter(apr_socket_t *sock, char *name, char *args); #endif /** * Return the protocol of the socket. * @param sock The socket to query. * @param protocol The returned protocol (e.g., APR_PROTO_TCP). */ APR_DECLARE(apr_status_t) apr_socket_protocol_get(apr_socket_t *sock, int *protocol); /** * Get the pool used by the socket. */ APR_POOL_DECLARE_ACCESSOR(socket); /** * Set a socket to be inherited by child processes. */ APR_DECLARE_INHERIT_SET(socket); /** * Unset a socket from being inherited by child processes. */ APR_DECLARE_INHERIT_UNSET(socket); /** * @defgroup apr_mcast IP Multicast * @{ */ /** * Join a Multicast Group * @param sock The socket to join a multicast group * @param join The address of the multicast group to join * @param iface Address of the interface to use. If NULL is passed, the * default multicast interface will be used. (OS Dependent) * @param source Source Address to accept transmissions from (non-NULL * implies Source-Specific Multicast) */ APR_DECLARE(apr_status_t) apr_mcast_join(apr_socket_t *sock, apr_sockaddr_t *join, apr_sockaddr_t *iface, apr_sockaddr_t *source); /** * Leave a Multicast Group. All arguments must be the same as * apr_mcast_join. * @param sock The socket to leave a multicast group * @param addr The address of the multicast group to leave * @param iface Address of the interface to use. If NULL is passed, the * default multicast interface will be used. (OS Dependent) * @param source Source Address to accept transmissions from (non-NULL * implies Source-Specific Multicast) */ APR_DECLARE(apr_status_t) apr_mcast_leave(apr_socket_t *sock, apr_sockaddr_t *addr, apr_sockaddr_t *iface, apr_sockaddr_t *source); /** * Set the Multicast Time to Live (ttl) for a multicast transmission. * @param sock The socket to set the multicast ttl * @param ttl Time to live to Assign. 0-255, default=1 * @remark If the TTL is 0, packets will only be seen by sockets on * the local machine, and only when multicast loopback is enabled. */ APR_DECLARE(apr_status_t) apr_mcast_hops(apr_socket_t *sock, apr_byte_t ttl); /** * Toggle IP Multicast Loopback * @param sock The socket to set multicast loopback * @param opt 0=disable, 1=enable */ APR_DECLARE(apr_status_t) apr_mcast_loopback(apr_socket_t *sock, apr_byte_t opt); /** * Set the Interface to be used for outgoing Multicast Transmissions. * @param sock The socket to set the multicast interface on * @param iface Address of the interface to use for Multicast */ APR_DECLARE(apr_status_t) apr_mcast_interface(apr_socket_t *sock, apr_sockaddr_t *iface); /** @} */ /** @} */ #ifdef __cplusplus } #endif #endif /* ! APR_NETWORK_IO_H */ 0707010001f16c000081a4000017820000044e000000014b1d38c700001b580000022d0000016a00000000000000000000002200000000reloc/include/apr-1/apr_general.h /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef APR_GENERAL_H #define APR_GENERAL_H /** * @file apr_general.h * This is collection of oddballs that didn't fit anywhere else, * and might move to more appropriate headers with the release * of APR 1.0. * @brief APR Miscellaneous library routines */ #include "apr.h" #include "apr_pools.h" #include "apr_errno.h" #if APR_HAVE_SIGNAL_H #include
* APR_EOF -- No more options to parse * APR_BADCH -- Found a bad option character * APR_BADARG -- No argument followed the option flag * APR_SUCCESS -- The next option was found. **/ APR_DECLARE(apr_status_t) apr_getopt(apr_getopt_t *os, const char *opts, char *option_ch, const char **option_arg); /** * Parse the options initialized by apr_getopt_init(), accepting long * options beginning with "--" in addition to single-character * options beginning with "-". * @param os The apr_getopt_t structure created by apr_getopt_init() * @param opts A pointer to a list of apr_getopt_option_t structures, which * can be initialized with { "name", optch, has_args }. has_args * is nonzero if the option requires an argument. A structure * with an optch value of 0 terminates the list. * @param option_ch Receives the value of "optch" from the apr_getopt_option_t * structure corresponding to the next option matched. * @param option_arg Receives the argument following the option, if any. * @return There are four potential status values on exit. They are: *
* APR_EOF -- No more options to parse * APR_BADCH -- Found a bad option character * APR_BADARG -- No argument followed the option flag * APR_SUCCESS -- The next option was found. ** When APR_SUCCESS is returned, os->ind gives the index of the first * non-option argument. On error, a message will be printed to stdout unless * os->err is set to 0. If os->interleave is set to nonzero, options can come * after arguments, and os->argv will be permuted to leave non-option arguments * at the end (the original argv is unaffected). */ APR_DECLARE(apr_status_t) apr_getopt_long(apr_getopt_t *os, const apr_getopt_option_t *opts, int *option_ch, const char **option_arg); /** @} */ #ifdef __cplusplus } #endif #endif /* ! APR_GETOPT_H */ 0707010001f181000081a4000017820000044e000000014b1d38c7000048460000022d0000016a00000000000000000000002300000000reloc/include/apr-1/apr_portable.h /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* This header file is where you should put ANY platform specific information. * This should be the only header file that programs need to include that * actually has platform dependant code which refers to the . */ #ifndef APR_PORTABLE_H #define APR_PORTABLE_H /** * @file apr_portable.h * @brief APR Portability Routines */ #include "apr.h" #include "apr_pools.h" #include "apr_thread_proc.h" #include "apr_file_io.h" #include "apr_network_io.h" #include "apr_errno.h" #include "apr_global_mutex.h" #include "apr_proc_mutex.h" #include "apr_time.h" #include "apr_dso.h" #include "apr_shm.h" #if APR_HAVE_DIRENT_H #include
* APR_LOCK_FCNTL * APR_LOCK_FLOCK * APR_LOCK_SYSVSEM * APR_LOCK_POSIXSEM * APR_LOCK_PROC_PTHREAD * APR_LOCK_DEFAULT pick the default mechanism for the platform ** @param pool the pool from which to allocate the mutex. * @warning Check APR_HAS_foo_SERIALIZE defines to see if the platform supports * APR_LOCK_foo. Only APR_LOCK_DEFAULT is portable. */ APR_DECLARE(apr_status_t) apr_global_mutex_create(apr_global_mutex_t **mutex, const char *fname, apr_lockmech_e mech, apr_pool_t *pool); /** * Re-open a mutex in a child process. * @param mutex The newly re-opened mutex structure. * @param fname A file name to use if the mutex mechanism requires one. This * argument should always be provided. The mutex code itself will * determine if it should be used. This filename should be the * same one that was passed to apr_global_mutex_create(). * @param pool The pool to operate on. * @remark This function must be called to maintain portability, even * if the underlying lock mechanism does not require it. */ APR_DECLARE(apr_status_t) apr_global_mutex_child_init( apr_global_mutex_t **mutex, const char *fname, apr_pool_t *pool); /** * Acquire the lock for the given mutex. If the mutex is already locked, * the current thread will be put to sleep until the lock becomes available. * @param mutex the mutex on which to acquire the lock. */ APR_DECLARE(apr_status_t) apr_global_mutex_lock(apr_global_mutex_t *mutex); /** * Attempt to acquire the lock for the given mutex. If the mutex has already * been acquired, the call returns immediately with APR_EBUSY. Note: it * is important that the APR_STATUS_IS_EBUSY(s) macro be used to determine * if the return value was APR_EBUSY, for portability reasons. * @param mutex the mutex on which to attempt the lock acquiring. */ APR_DECLARE(apr_status_t) apr_global_mutex_trylock(apr_global_mutex_t *mutex); /** * Release the lock for the given mutex. * @param mutex the mutex from which to release the lock. */ APR_DECLARE(apr_status_t) apr_global_mutex_unlock(apr_global_mutex_t *mutex); /** * Destroy the mutex and free the memory associated with the lock. * @param mutex the mutex to destroy. */ APR_DECLARE(apr_status_t) apr_global_mutex_destroy(apr_global_mutex_t *mutex); /** * Get the pool used by this global_mutex. * @return apr_pool_t the pool */ APR_POOL_DECLARE_ACCESSOR(global_mutex); #else /* APR_PROC_MUTEX_IS_GLOBAL */ /* Some platforms [e.g. Win32] have cross process locks that are truly * global locks, since there isn't the concept of cross-process locks. * Define these platforms in terms of an apr_proc_mutex_t. */ #define apr_global_mutex_t apr_proc_mutex_t #define apr_global_mutex_create apr_proc_mutex_create #define apr_global_mutex_child_init apr_proc_mutex_child_init #define apr_global_mutex_lock apr_proc_mutex_lock #define apr_global_mutex_trylock apr_proc_mutex_trylock #define apr_global_mutex_unlock apr_proc_mutex_unlock #define apr_global_mutex_destroy apr_proc_mutex_destroy #define apr_global_mutex_pool_get apr_proc_mutex_pool_get #endif /** @} */ #ifdef __cplusplus } #endif #endif /* ndef APR_GLOBAL_MUTEX_H */ 0707010001f173000081a4000017820000044e000000014b1d38c9000016940000022d0000016a00000000000000000000002400000000reloc/include/apr-1/apr_ldap_init.h /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * @file apr_ldap_init.h * @brief APR-UTIL LDAP ldap_init() functions */ #ifndef APR_LDAP_INIT_H #define APR_LDAP_INIT_H /** * @addtogroup APR_Util_LDAP * @{ */ #include "apr_ldap.h" #if APR_HAS_LDAP #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** * Macro to detect security related return values. */ #if defined(LDAP_INSUFFICIENT_ACCESS) #define APU_LDAP_INSUFFICIENT_ACCESS LDAP_INSUFFICIENT_ACCESS #elif defined(LDAP_INSUFFICIENT_RIGHTS) #define APU_LDAP_INSUFFICIENT_ACCESS LDAP_INSUFFICIENT_RIGHTS #elif defined(APR_HAS_MICROSOFT_LDAPSDK) /* The macros above fail to contemplate that LDAP_RETCODE values * may be represented by an enum. autoconf tests would be much * more robust. */ #define APU_LDAP_INSUFFICIENT_ACCESS LDAP_INSUFFICIENT_RIGHTS #else #error The security return codes must be added to support this LDAP toolkit. #endif #if defined(LDAP_SECURITY_ERROR) #define APU_LDAP_SECURITY_ERROR LDAP_SECURITY_ERROR #else #define APU_LDAP_SECURITY_ERROR(n) \ (LDAP_INAPPROPRIATE_AUTH == n) ? 1 \ : (LDAP_INVALID_CREDENTIALS == n) ? 1 \ : (APU_LDAP_INSUFFICIENT_ACCESS == n) ? 1 \ : 0 #endif /** * APR LDAP SSL Initialise function * * This function initialises SSL on the underlying LDAP toolkit * if this is necessary. * * If a CA certificate is provided, this is set, however the setting * of certificates via this method has been deprecated and will be removed in * APR v2.0. * * The apr_ldap_set_option() function with the APR_LDAP_OPT_TLS_CERT option * should be used instead to set certificates. * * If SSL support is not available on this platform, or a problem * was encountered while trying to set the certificate, the function * will return APR_EGENERAL. Further LDAP specific error information * can be found in result_err. * @param pool The pool to use * @param cert_auth_file The name of the certificate to use, can be NULL * @param cert_file_type The type of certificate specified. See the * apr_ldap_set_option() APR_LDAP_OPT_TLS_CERT option for details. * @param result_err The returned result */ APU_DECLARE_LDAP(int) apr_ldap_ssl_init(apr_pool_t *pool, const char *cert_auth_file, int cert_file_type, apr_ldap_err_t **result_err); /** * APR LDAP SSL De-Initialise function * * This function tears down any SSL certificate setup previously * set using apr_ldap_ssl_init(). It should be called to clean * up if a graceful restart of a service is attempted. * @todo currently we do not check whether apr_ldap_ssl_init() * has been called first - we probably should. */ APU_DECLARE_LDAP(int) apr_ldap_ssl_deinit(void); /** * APR LDAP initialise function * * This function is responsible for initialising an LDAP * connection in a toolkit independant way. It does the * job of ldap_init() from the C api. * * It handles both the SSL and non-SSL case, and attempts * to hide the complexity setup from the user. This function * assumes that any certificate setup necessary has already * been done. * * If SSL or STARTTLS needs to be enabled, and the underlying * toolkit supports it, the following values are accepted for * secure: * * APR_LDAP_NONE: No encryption * APR_LDAP_SSL: SSL encryption (ldaps://) * APR_LDAP_STARTTLS: Force STARTTLS on ldap:// * @remark The Novell toolkit is only able to set the SSL mode via this * function. To work around this limitation, set the SSL mode here if no * per connection client certificates are present, otherwise set secure * APR_LDAP_NONE here, then set the per connection client certificates, * followed by setting the SSL mode via apr_ldap_set_option(). As Novell * does not support per connection client certificates, this problem is * worked around while still being compatible with other LDAP toolkits. * @param pool The pool to use * @param ldap The LDAP handle * @param hostname The name of the host to connect to. This can be either a * DNS name, or an IP address. * @param portno The port to connect to * @param secure The security mode to set * @param result_err The returned result */ APU_DECLARE_LDAP(int) apr_ldap_init(apr_pool_t *pool, LDAP **ldap, const char *hostname, int portno, int secure, apr_ldap_err_t **result_err); /** * APR LDAP info function * * This function returns a string describing the LDAP toolkit * currently in use. The string is placed inside result_err->reason. * @param pool The pool to use * @param result_err The returned result */ APU_DECLARE_LDAP(int) apr_ldap_info(apr_pool_t *pool, apr_ldap_err_t **result_err); #ifdef __cplusplus } #endif #endif /* APR_HAS_LDAP */ /** @} */ #endif /* APR_LDAP_URL_H */ 0707010001f19c000081a4000017820000044e000000014b1d38ca000030450000022d0000016a00000000000000000000001e00000000reloc/include/apr-1/apr_xml.h /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * @file apr_xml.h * @brief APR-UTIL XML Library */ #ifndef APR_XML_H #define APR_XML_H /** * @defgroup APR_Util_XML XML * @ingroup APR_Util * @{ */ #include "apr_pools.h" #include "apr_tables.h" #include "apr_file_io.h" #include "apu.h" #if APR_CHARSET_EBCDIC #include "apr_xlate.h" #endif #ifdef __cplusplus extern "C" { #endif /** * @package Apache XML library */ /* -------------------------------------------------------------------- */ /* ### these will need to move at some point to a more logical spot */ /** @see apr_text */ typedef struct apr_text apr_text; /** Structure to keep a linked list of pieces of text */ struct apr_text { /** The current piece of text */ const char *text; /** a pointer to the next piece of text */ struct apr_text *next; }; /** @see apr_text_header */ typedef struct apr_text_header apr_text_header; /** A list of pieces of text */ struct apr_text_header { /** The first piece of text in the list */ apr_text *first; /** The last piece of text in the list */ apr_text *last; }; /** * Append a piece of text to the end of a list * @param p The pool to allocate out of * @param hdr The text header to append to * @param text The new text to append */ APU_DECLARE(void) apr_text_append(apr_pool_t *p, apr_text_header *hdr, const char *text); /* -------------------------------------------------------------------- ** ** XML PARSING */ /* ** Qualified namespace values ** ** APR_XML_NS_DAV_ID ** We always insert the "DAV:" namespace URI at the head of the ** namespace array. This means that it will always be at ID==0, ** making it much easier to test for. ** ** APR_XML_NS_NONE ** This special ID is used for two situations: ** ** 1) The namespace prefix begins with "xml" (and we do not know ** what it means). Namespace prefixes with "xml" (any case) as ** their first three characters are reserved by the XML Namespaces ** specification for future use. mod_dav will pass these through ** unchanged. When this identifier is used, the prefix is LEFT in ** the element/attribute name. Downstream processing should not ** prepend another prefix. ** ** 2) The element/attribute does not have a namespace. ** ** a) No prefix was used, and a default namespace has not been ** defined. ** b) No prefix was used, and the default namespace was specified ** to mean "no namespace". This is done with a namespace ** declaration of: xmlns="" ** (this declaration is typically used to override a previous ** specification for the default namespace) ** ** In these cases, we need to record that the elem/attr has no ** namespace so that we will not attempt to prepend a prefix. ** All namespaces that are used will have a prefix assigned to ** them -- mod_dav will never set or use the default namespace ** when generating XML. This means that "no prefix" will always ** mean "no namespace". ** ** In both cases, the XML generation will avoid prepending a prefix. ** For the first case, this means the original prefix/name will be ** inserted into the output stream. For the latter case, it means ** the name will have no prefix, and since we never define a default ** namespace, this means it will have no namespace. ** ** Note: currently, mod_dav understands the "xmlns" prefix and the ** "xml:lang" attribute. These are handled specially (they aren't ** left within the XML tree), so the APR_XML_NS_NONE value won't ever ** really apply to these values. */ #define APR_XML_NS_DAV_ID 0 /**< namespace ID for "DAV:" */ #define APR_XML_NS_NONE -10 /**< no namespace for this elem/attr */ #define APR_XML_NS_ERROR_BASE -100 /**< used only during processing */ /** Is this namespace an error? */ #define APR_XML_NS_IS_ERROR(e) ((e) <= APR_XML_NS_ERROR_BASE) /** @see apr_xml_attr */ typedef struct apr_xml_attr apr_xml_attr; /** @see apr_xml_elem */ typedef struct apr_xml_elem apr_xml_elem; /** @see apr_xml_doc */ typedef struct apr_xml_doc apr_xml_doc; /** apr_xml_attr: holds a parsed XML attribute */ struct apr_xml_attr { /** attribute name */ const char *name; /** index into namespace array */ int ns; /** attribute value */ const char *value; /** next attribute */ struct apr_xml_attr *next; }; /** apr_xml_elem: holds a parsed XML element */ struct apr_xml_elem { /** element name */ const char *name; /** index into namespace array */ int ns; /** xml:lang for attrs/contents */ const char *lang; /** cdata right after start tag */ apr_text_header first_cdata; /** cdata after MY end tag */ apr_text_header following_cdata; /** parent element */ struct apr_xml_elem *parent; /** next (sibling) element */ struct apr_xml_elem *next; /** first child element */ struct apr_xml_elem *first_child; /** first attribute */ struct apr_xml_attr *attr; /* used only during parsing */ /** last child element */ struct apr_xml_elem *last_child; /** namespaces scoped by this elem */ struct apr_xml_ns_scope *ns_scope; /* used by modules during request processing */ /** Place for modules to store private data */ void *priv; }; /** Is this XML element empty? */ #define APR_XML_ELEM_IS_EMPTY(e) ((e)->first_child == NULL && \ (e)->first_cdata.first == NULL) /** apr_xml_doc: holds a parsed XML document */ struct apr_xml_doc { /** root element */ apr_xml_elem *root; /** array of namespaces used */ apr_array_header_t *namespaces; }; /** Opaque XML parser structure */ typedef struct apr_xml_parser apr_xml_parser; /** * Create an XML parser * @param pool The pool for allocating the parser and the parse results. * @return The new parser. */ APU_DECLARE(apr_xml_parser *) apr_xml_parser_create(apr_pool_t *pool); /** * Parse a File, producing a xml_doc * @param p The pool for allocating the parse results. * @param parser A pointer to *parser (needed so calling function can get * errors), will be set to NULL on successfull completion. * @param ppdoc A pointer to *apr_xml_doc (which has the parsed results in it) * @param xmlfd A file to read from. * @param buffer_length Buffer length which would be suitable * @return Any errors found during parsing. */ APU_DECLARE(apr_status_t) apr_xml_parse_file(apr_pool_t *p, apr_xml_parser **parser, apr_xml_doc **ppdoc, apr_file_t *xmlfd, apr_size_t buffer_length); /** * Feed input into the parser * @param parser The XML parser for parsing this data. * @param data The data to parse. * @param len The length of the data. * @return Any errors found during parsing. * @remark Use apr_xml_parser_geterror() to get more error information. */ APU_DECLARE(apr_status_t) apr_xml_parser_feed(apr_xml_parser *parser, const char *data, apr_size_t len); /** * Terminate the parsing and return the result * @param parser The XML parser for parsing this data. * @param pdoc The resulting parse information. May be NULL to simply * terminate the parsing without fetching the info. * @return Any errors found during the final stage of parsing. * @remark Use apr_xml_parser_geterror() to get more error information. */ APU_DECLARE(apr_status_t) apr_xml_parser_done(apr_xml_parser *parser, apr_xml_doc **pdoc); /** * Fetch additional error information from the parser. * @param parser The XML parser to query for errors. * @param errbuf A buffer for storing error text. * @param errbufsize The length of the error text buffer. * @return The error buffer */ APU_DECLARE(char *) apr_xml_parser_geterror(apr_xml_parser *parser, char *errbuf, apr_size_t errbufsize); /** * Converts an XML element tree to flat text * @param p The pool to allocate out of * @param elem The XML element to convert * @param style How to covert the XML. One of: *
* APR_XML_X2T_FULL start tag, contents, end tag * APR_XML_X2T_INNER contents only * APR_XML_X2T_LANG_INNER xml:lang + inner contents * APR_XML_X2T_FULL_NS_LANG FULL + ns defns + xml:lang ** @param namespaces The namespace of the current XML element * @param ns_map Namespace mapping * @param pbuf Buffer to put the converted text into * @param psize Size of the converted text */ APU_DECLARE(void) apr_xml_to_text(apr_pool_t *p, const apr_xml_elem *elem, int style, apr_array_header_t *namespaces, int *ns_map, const char **pbuf, apr_size_t *psize); /* style argument values: */ #define APR_XML_X2T_FULL 0 /**< start tag, contents, end tag */ #define APR_XML_X2T_INNER 1 /**< contents only */ #define APR_XML_X2T_LANG_INNER 2 /**< xml:lang + inner contents */ #define APR_XML_X2T_FULL_NS_LANG 3 /**< FULL + ns defns + xml:lang */ /** * empty XML element * @param p The pool to allocate out of * @param elem The XML element to empty * @return the string that was stored in the XML element */ APU_DECLARE(const char *) apr_xml_empty_elem(apr_pool_t *p, const apr_xml_elem *elem); /** * quote an XML string * Replace '<', '>', and '&' with '<', '>', and '&'. * @param p The pool to allocate out of * @param s The string to quote * @param quotes If quotes is true, then replace '"' with '"'. * @return The quoted string * @note If the string does not contain special characters, it is not * duplicated into the pool and the original string is returned. */ APU_DECLARE(const char *) apr_xml_quote_string(apr_pool_t *p, const char *s, int quotes); /** * Quote an XML element * @param p The pool to allocate out of * @param elem The element to quote */ APU_DECLARE(void) apr_xml_quote_elem(apr_pool_t *p, apr_xml_elem *elem); /* manage an array of unique URIs: apr_xml_insert_uri() and APR_XML_URI_ITEM() */ /** * return the URI's (existing) index, or insert it and return a new index * @param uri_array array to insert into * @param uri The uri to insert * @return int The uri's index */ APU_DECLARE(int) apr_xml_insert_uri(apr_array_header_t *uri_array, const char *uri); /** Get the URI item for this XML element */ #define APR_XML_GET_URI_ITEM(ary, i) (((const char * const *)(ary)->elts)[i]) #if APR_CHARSET_EBCDIC /** * Convert parsed tree in EBCDIC * @param p The pool to allocate out of * @param pdoc The apr_xml_doc to convert. * @param xlate The translation handle to use. * @return Any errors found during conversion. */ APU_DECLARE(apr_status_t) apr_xml_parser_convert_doc(apr_pool_t *p, apr_xml_doc *pdoc, apr_xlate_t *convset); #endif #ifdef __cplusplus } #endif /** @} */ #endif /* APR_XML_H */ 0707010001f163000081a4000017820000044e000000014b1d38c900000de20000022d0000016a00000000000000000000001f00000000reloc/include/apr-1/apr_date.h /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef APR_DATE_H #define APR_DATE_H /** * @file apr_date.h * @brief APR-UTIL date routines */ /** * @defgroup APR_Util_Date Date routines * @ingroup APR_Util * @{ */ /* * apr_date.h: prototypes for date parsing utility routines */ #include "apu.h" #include "apr_time.h" #ifdef __cplusplus extern "C" { #endif /** A bad date. */ #define APR_DATE_BAD ((apr_time_t)0) /** * Compare a string to a mask * @param data The string to compare * @param mask Mask characters (arbitrary maximum is 256 characters): *
* '\@' - uppercase letter * '\$' - lowercase letter * '\&' - hex digit * '#' - digit * '~' - digit or space * '*' - swallow remaining characters ** @remark The mask tests for an exact match for any other character * @return 1 if the string matches, 0 otherwise */ APU_DECLARE(int) apr_date_checkmask(const char *data, const char *mask); /** * Parses an HTTP date in one of three standard forms: *
* Sun, 06 Nov 1994 08:49:37 GMT ; RFC 822, updated by RFC 1123 * Sunday, 06-Nov-94 08:49:37 GMT ; RFC 850, obsoleted by RFC 1036 * Sun Nov 6 08:49:37 1994 ; ANSI C's asctime() format ** @param date The date in one of the three formats above * @return the apr_time_t number of microseconds since 1 Jan 1970 GMT, or * 0 if this would be out of range or if the date is invalid. */ APU_DECLARE(apr_time_t) apr_date_parse_http(const char *date); /** * Parses a string resembling an RFC 822 date. This is meant to be * leinent in its parsing of dates. Hence, this will parse a wider * range of dates than apr_date_parse_http. * * The prominent mailer (or poster, if mailer is unknown) that has * been seen in the wild is included for the unknown formats. *
* Sun, 06 Nov 1994 08:49:37 GMT ; RFC 822, updated by RFC 1123 * Sunday, 06-Nov-94 08:49:37 GMT ; RFC 850, obsoleted by RFC 1036 * Sun Nov 6 08:49:37 1994 ; ANSI C's asctime() format * Sun, 6 Nov 1994 08:49:37 GMT ; RFC 822, updated by RFC 1123 * Sun, 06 Nov 94 08:49:37 GMT ; RFC 822 * Sun, 6 Nov 94 08:49:37 GMT ; RFC 822 * Sun, 06 Nov 94 08:49 GMT ; Unknown [drtr\@ast.cam.ac.uk] * Sun, 6 Nov 94 08:49 GMT ; Unknown [drtr\@ast.cam.ac.uk] * Sun, 06 Nov 94 8:49:37 GMT ; Unknown [Elm 70.85] * Sun, 6 Nov 94 8:49:37 GMT ; Unknown [Elm 70.85] ** * @param date The date in one of the formats above * @return the apr_time_t number of microseconds since 1 Jan 1970 GMT, or * 0 if this would be out of range or if the date is invalid. */ APU_DECLARE(apr_time_t) apr_date_parse_rfc(const char *date); /** @} */ #ifdef __cplusplus } #endif #endif /* !APR_DATE_H */ 0707010001f1a0000041ed000017820000044e000000054b1d38cf000000000000022d0000016a00000000000000000000000a00000000reloc/lib 0707010001f1a9000041ed000017820000044e000000024b1d38cf000000000000022d0000016a00000000000000000000001400000000reloc/lib/pkgconfig 0707010001f1aa000081a4000017820000044e000000014b1d38cb000001950000022d0000016a00000000000000000000001d00000000reloc/lib/pkgconfig/apr-1.pc prefix=@CLIENT_BASEDIR@ exec_prefix=${prefix} libdir=${exec_prefix}/lib/amd64 APR_MAJOR_VERSION=1 includedir=${exec_prefix}/include/apr-${APR_MAJOR_VERSION} Name: APR Description: The Apache Portable Runtime library Version: 1.3.9 Libs: -L${libdir} -lapr-${APR_MAJOR_VERSION} -luuid -lsendfile -lrt -lsocket -lnsl -lpthread Cflags: -DSOLARIS2=10 -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT -I${includedir} 0707010001f1ab000081a4000017820000044e000000014b1d38cb000001960000022d0000016a00000000000000000000002200000000reloc/lib/pkgconfig/apr-util-1.pc prefix=@CLIENT_BASEDIR@ exec_prefix=${prefix} libdir=${exec_prefix}/lib/amd64 APRUTIL_MAJOR_VERSION=1 includedir=${exec_prefix}/include/apr-${APRUTIL_MAJOR_VERSION} Name: APR Utils Description: Companion library for APR Version: 1.3.9 # assume that apr-util requires libapr of same major version Requires: apr-1 Libs: -L${libdir} -laprutil-${APRUTIL_MAJOR_VERSION} -lldap -lexpat Cflags: -I${includedir} 0707010001f1a1000041ed000017820000044e000000024b1d38ce000000000000022d0000016a00000000000000000000001000000000reloc/lib/amd64 0707010001f1a2000081ed000017820000044e000000014b1d38cb0008a5280000022d0000016a00000000000000000000002200000000reloc/lib/amd64/libapr-1.so.0.3.9 ELF > @ @ 8 @ o X X a` a` h` h` 8p 8p Pdd x x ; " 0 " x ,# & & 0' - H x- h . X8 p9 h: X; @ ; ` G lG H Pg \g lh 0 h p $i i i j l 8 n ` `n n n Ho o hp 0 q p `t v w ( $x H x p x dy y { t| } 8 ~ ` d ( 8 D X ̅ ܅ 8 8 x X 0 < X Ћ 8 X ` h D X H l H 0 p l 8 | ` 0 @ | 0 4 P | p X d @ 4 ` L l , 4 0 H P | p < L @ X ` ! (! P! 8 ! ! ! ! | " @" `" " " # p 8# T `# # # # @ $ T @$ , $ $ $ % x h% % < % % % 0 &