From 4be475f1111660473a1f5e116b925822e305b561 Mon Sep 17 00:00:00 2001 From: d1str4ught <> Date: Mon, 18 Aug 2025 19:46:48 +0200 Subject: [PATCH] init --- .gitattributes | 1 + .gitignore | 1 + CMakeLists.txt | 55 + buildtool/Utils.cmake | 25 + extern/CMakeLists.txt | 1 + extern/include/MSS.H | 4855 ++++ extern/include/Python-2.7/Python-ast.h | 535 + extern/include/Python-2.7/Python.h | 178 + extern/include/Python-2.7/abstract.h | 1396 ++ extern/include/Python-2.7/asdl.h | 45 + extern/include/Python-2.7/ast.h | 13 + extern/include/Python-2.7/bitset.h | 30 + extern/include/Python-2.7/boolobject.h | 36 + extern/include/Python-2.7/bufferobject.h | 33 + extern/include/Python-2.7/bytearrayobject.h | 57 + extern/include/Python-2.7/bytes_methods.h | 75 + extern/include/Python-2.7/bytesobject.h | 27 + extern/include/Python-2.7/cStringIO.h | 73 + extern/include/Python-2.7/cellobject.h | 28 + extern/include/Python-2.7/ceval.h | 153 + extern/include/Python-2.7/classobject.h | 83 + extern/include/Python-2.7/cobject.h | 89 + extern/include/Python-2.7/code.h | 107 + extern/include/Python-2.7/codecs.h | 167 + extern/include/Python-2.7/compile.h | 40 + extern/include/Python-2.7/complexobject.h | 66 + extern/include/Python-2.7/datetime.h | 239 + extern/include/Python-2.7/descrobject.h | 94 + extern/include/Python-2.7/dictobject.h | 156 + extern/include/Python-2.7/dtoa.h | 15 + extern/include/Python-2.7/enumobject.h | 17 + extern/include/Python-2.7/errcode.h | 36 + extern/include/Python-2.7/eval.h | 25 + extern/include/Python-2.7/fileobject.h | 97 + extern/include/Python-2.7/floatobject.h | 140 + extern/include/Python-2.7/frameobject.h | 89 + extern/include/Python-2.7/funcobject.h | 76 + extern/include/Python-2.7/genobject.h | 40 + extern/include/Python-2.7/graminit.h | 87 + extern/include/Python-2.7/grammar.h | 93 + extern/include/Python-2.7/import.h | 71 + extern/include/Python-2.7/intobject.h | 81 + extern/include/Python-2.7/intrcheck.h | 15 + extern/include/Python-2.7/iterobject.h | 23 + extern/include/Python-2.7/listobject.h | 68 + extern/include/Python-2.7/longintrepr.h | 103 + extern/include/Python-2.7/longobject.h | 135 + extern/include/Python-2.7/marshal.h | 25 + extern/include/Python-2.7/memoryobject.h | 74 + extern/include/Python-2.7/metagrammar.h | 18 + extern/include/Python-2.7/methodobject.h | 93 + extern/include/Python-2.7/modsupport.h | 134 + extern/include/Python-2.7/moduleobject.h | 24 + extern/include/Python-2.7/node.h | 43 + extern/include/Python-2.7/object.h | 1011 + extern/include/Python-2.7/objimpl.h | 354 + extern/include/Python-2.7/opcode.h | 162 + extern/include/Python-2.7/osdefs.h | 63 + extern/include/Python-2.7/parsetok.h | 64 + extern/include/Python-2.7/patchlevel.h | 43 + extern/include/Python-2.7/pgen.h | 18 + extern/include/Python-2.7/pgenheaders.h | 42 + extern/include/Python-2.7/py_curses.h | 176 + extern/include/Python-2.7/pyarena.h | 62 + extern/include/Python-2.7/pycapsule.h | 56 + extern/include/Python-2.7/pyconfig.h | 759 + extern/include/Python-2.7/pyctype.h | 31 + extern/include/Python-2.7/pydebug.h | 41 + extern/include/Python-2.7/pyerrors.h | 328 + extern/include/Python-2.7/pyexpat.h | 48 + extern/include/Python-2.7/pyfpe.h | 176 + extern/include/Python-2.7/pygetopt.h | 18 + extern/include/Python-2.7/pymacconfig.h | 102 + extern/include/Python-2.7/pymactoolbox.h | 217 + extern/include/Python-2.7/pymath.h | 192 + extern/include/Python-2.7/pymem.h | 122 + extern/include/Python-2.7/pyport.h | 941 + extern/include/Python-2.7/pystate.h | 200 + extern/include/Python-2.7/pystrcmp.h | 23 + extern/include/Python-2.7/pystrtod.h | 45 + extern/include/Python-2.7/pythonrun.h | 181 + extern/include/Python-2.7/pythread.h | 41 + extern/include/Python-2.7/rangeobject.h | 28 + extern/include/Python-2.7/setobject.h | 99 + extern/include/Python-2.7/sliceobject.h | 44 + extern/include/Python-2.7/stringobject.h | 210 + extern/include/Python-2.7/structmember.h | 99 + extern/include/Python-2.7/structseq.h | 41 + extern/include/Python-2.7/symtable.h | 98 + extern/include/Python-2.7/sysmodule.h | 29 + extern/include/Python-2.7/timefuncs.h | 26 + extern/include/Python-2.7/token.h | 85 + extern/include/Python-2.7/traceback.h | 31 + extern/include/Python-2.7/tupleobject.h | 61 + extern/include/Python-2.7/ucnhash.h | 33 + extern/include/Python-2.7/unicodeobject.h | 1413 ++ extern/include/Python-2.7/warnings.h | 23 + extern/include/Python-2.7/weakrefobject.h | 82 + extern/include/SpeedTreeRT.h | 548 + extern/include/cryptopp/3way.cpp | 143 + extern/include/cryptopp/3way.h | 63 + extern/include/cryptopp/Doxyfile | 2429 ++ extern/include/cryptopp/Filelist.txt | 639 + extern/include/cryptopp/GNUmakefile | 1711 ++ extern/include/cryptopp/GNUmakefile-cross | 987 + extern/include/cryptopp/History.txt | 538 + extern/include/cryptopp/Install.txt | 222 + extern/include/cryptopp/License.txt | 83 + extern/include/cryptopp/Readme.txt | 406 + extern/include/cryptopp/adhoc.cpp | 42 + extern/include/cryptopp/adhoc.cpp.copied | 2 + extern/include/cryptopp/adhoc.cpp.proto | 42 + extern/include/cryptopp/adler32.cpp | 82 + extern/include/cryptopp/adler32.h | 33 + extern/include/cryptopp/adv_simd.h | 1281 + extern/include/cryptopp/aes.h | 30 + extern/include/cryptopp/aes_armv4.S | 1215 + extern/include/cryptopp/aes_armv4.h | 30 + extern/include/cryptopp/algebra.cpp | 341 + extern/include/cryptopp/algebra.h | 453 + extern/include/cryptopp/algparam.cpp | 75 + extern/include/cryptopp/algparam.h | 520 + extern/include/cryptopp/allocate.cpp | 107 + extern/include/cryptopp/allocate.h | 74 + extern/include/cryptopp/arc4.cpp | 122 + extern/include/cryptopp/arc4.h | 89 + extern/include/cryptopp/argnames.h | 99 + extern/include/cryptopp/aria.cpp | 343 + extern/include/cryptopp/aria.h | 71 + extern/include/cryptopp/aria_simd.cpp | 198 + extern/include/cryptopp/ariatab.cpp | 166 + extern/include/cryptopp/arm_simd.h | 188 + extern/include/cryptopp/asn.cpp | 717 + extern/include/cryptopp/asn.h | 965 + extern/include/cryptopp/authenc.cpp | 188 + extern/include/cryptopp/authenc.h | 87 + extern/include/cryptopp/base32.cpp | 97 + extern/include/cryptopp/base32.h | 158 + extern/include/cryptopp/base64.cpp | 111 + extern/include/cryptopp/base64.h | 158 + extern/include/cryptopp/basecode.cpp | 247 + extern/include/cryptopp/basecode.h | 146 + extern/include/cryptopp/bds10.zip | Bin 0 -> 6812 bytes extern/include/cryptopp/bench.h | 105 + extern/include/cryptopp/bench1.cpp | 518 + extern/include/cryptopp/bench2.cpp | 267 + extern/include/cryptopp/bench3.cpp | 480 + extern/include/cryptopp/bfinit.cpp | 277 + extern/include/cryptopp/blake2.cpp | 797 + extern/include/cryptopp/blake2.h | 444 + extern/include/cryptopp/blake2b_simd.cpp | 1276 + extern/include/cryptopp/blake2s_simd.cpp | 1091 + extern/include/cryptopp/blowfish.cpp | 99 + extern/include/cryptopp/blowfish.h | 54 + extern/include/cryptopp/blumshub.cpp | 64 + extern/include/cryptopp/blumshub.h | 70 + extern/include/cryptopp/camellia.cpp | 539 + extern/include/cryptopp/camellia.h | 49 + extern/include/cryptopp/cast.cpp | 292 + extern/include/cryptopp/cast.h | 109 + extern/include/cryptopp/casts.cpp | 545 + extern/include/cryptopp/cbcmac.cpp | 62 + extern/include/cryptopp/cbcmac.h | 59 + extern/include/cryptopp/ccm.cpp | 139 + extern/include/cryptopp/ccm.h | 123 + extern/include/cryptopp/chacha.cpp | 568 + extern/include/cryptopp/chacha.h | 223 + extern/include/cryptopp/chacha_avx.cpp | 421 + extern/include/cryptopp/chacha_simd.cpp | 1109 + extern/include/cryptopp/chachapoly.cpp | 211 + extern/include/cryptopp/chachapoly.h | 322 + extern/include/cryptopp/cham.cpp | 365 + extern/include/cryptopp/cham.h | 179 + extern/include/cryptopp/cham_simd.cpp | 478 + extern/include/cryptopp/channels.cpp | 316 + extern/include/cryptopp/channels.h | 142 + extern/include/cryptopp/cmac.cpp | 162 + extern/include/cryptopp/cmac.h | 76 + extern/include/cryptopp/config.h | 33 + extern/include/cryptopp/config_align.h | 72 + extern/include/cryptopp/config_asm.h | 470 + extern/include/cryptopp/config_cpu.h | 211 + extern/include/cryptopp/config_cxx.h | 259 + extern/include/cryptopp/config_dll.h | 178 + extern/include/cryptopp/config_int.h | 253 + extern/include/cryptopp/config_misc.h | 191 + extern/include/cryptopp/config_ns.h | 76 + extern/include/cryptopp/config_os.h | 168 + extern/include/cryptopp/config_ver.h | 79 + extern/include/cryptopp/cpu.cpp | 1292 + extern/include/cryptopp/cpu.h | 1083 + extern/include/cryptopp/crc.cpp | 367 + extern/include/cryptopp/crc.h | 78 + extern/include/cryptopp/crc_simd.cpp | 161 + extern/include/cryptopp/cryptdll.vcxproj | 334 + .../include/cryptopp/cryptdll.vcxproj.filters | 450 + extern/include/cryptopp/cryptest.nmake | 370 + extern/include/cryptopp/cryptest.sln | 89 + extern/include/cryptopp/cryptest.vcxproj | 381 + .../include/cryptopp/cryptest.vcxproj.filters | 524 + extern/include/cryptopp/cryptest.vcxproj.user | 6 + extern/include/cryptopp/cryptlib.cpp | 1054 + extern/include/cryptopp/cryptlib.h | 3362 +++ extern/include/cryptopp/cryptlib.vcxproj | 578 + .../include/cryptopp/cryptlib.vcxproj.filters | 1086 + extern/include/cryptopp/cryptopp.rc | 104 + extern/include/cryptopp/cryptopp.supp | 8 + extern/include/cryptopp/cryptoppLibLink.h | 22 + extern/include/cryptopp/darn.cpp | 236 + extern/include/cryptopp/darn.h | 95 + extern/include/cryptopp/datatest.cpp | 1012 + extern/include/cryptopp/default.cpp | 307 + extern/include/cryptopp/default.h | 310 + extern/include/cryptopp/des.cpp | 465 + extern/include/cryptopp/des.h | 163 + extern/include/cryptopp/dessp.cpp | 88 + extern/include/cryptopp/dh.cpp | 21 + extern/include/cryptopp/dh.h | 275 + extern/include/cryptopp/dh2.cpp | 69 + extern/include/cryptopp/dh2.h | 70 + extern/include/cryptopp/dll.cpp | 169 + extern/include/cryptopp/dll.h | 71 + extern/include/cryptopp/dlltest.cpp | 212 + extern/include/cryptopp/dlltest.vcxproj | 135 + .../include/cryptopp/dlltest.vcxproj.filters | 14 + extern/include/cryptopp/dmac.h | 114 + extern/include/cryptopp/donna.h | 178 + extern/include/cryptopp/donna_32.cpp | 2102 ++ extern/include/cryptopp/donna_32.h | 411 + extern/include/cryptopp/donna_64.cpp | 1815 ++ extern/include/cryptopp/donna_64.h | 457 + extern/include/cryptopp/donna_sse.cpp | 1123 + extern/include/cryptopp/donna_sse.h | 86 + extern/include/cryptopp/drbg.h | 718 + extern/include/cryptopp/dsa.cpp | 66 + extern/include/cryptopp/dsa.h | 53 + extern/include/cryptopp/eax.cpp | 59 + extern/include/cryptopp/eax.h | 112 + extern/include/cryptopp/ec2n.cpp | 320 + extern/include/cryptopp/ec2n.h | 136 + extern/include/cryptopp/eccrypto.cpp | 840 + extern/include/cryptopp/eccrypto.h | 667 + extern/include/cryptopp/ecp.cpp | 506 + extern/include/cryptopp/ecp.h | 167 + extern/include/cryptopp/ecpoint.h | 146 + extern/include/cryptopp/elgamal.cpp | 22 + extern/include/cryptopp/elgamal.h | 304 + extern/include/cryptopp/emsa2.cpp | 44 + extern/include/cryptopp/emsa2.h | 101 + extern/include/cryptopp/eprecomp.cpp | 114 + extern/include/cryptopp/eprecomp.h | 162 + extern/include/cryptopp/esign.cpp | 233 + extern/include/cryptopp/esign.h | 169 + extern/include/cryptopp/factory.h | 179 + extern/include/cryptopp/fhmqv.h | 408 + extern/include/cryptopp/files.cpp | 302 + extern/include/cryptopp/files.h | 181 + extern/include/cryptopp/filters.cpp | 1270 + extern/include/cryptopp/filters.h | 1529 ++ extern/include/cryptopp/fips140.cpp | 84 + extern/include/cryptopp/fips140.h | 112 + extern/include/cryptopp/fipsalgt.cpp | 1293 + extern/include/cryptopp/fipstest.cpp | 652 + extern/include/cryptopp/fltrimpl.h | 87 + extern/include/cryptopp/gcm.cpp | 856 + extern/include/cryptopp/gcm.h | 139 + extern/include/cryptopp/gcm_simd.cpp | 742 + extern/include/cryptopp/gf256.cpp | 34 + extern/include/cryptopp/gf256.h | 72 + extern/include/cryptopp/gf2_32.cpp | 99 + extern/include/cryptopp/gf2_32.h | 73 + extern/include/cryptopp/gf2n.cpp | 1070 + extern/include/cryptopp/gf2n.h | 404 + extern/include/cryptopp/gf2n_simd.cpp | 614 + extern/include/cryptopp/gfpcrypt.cpp | 334 + extern/include/cryptopp/gfpcrypt.h | 996 + extern/include/cryptopp/gost.cpp | 123 + extern/include/cryptopp/gost.h | 66 + extern/include/cryptopp/gzip.cpp | 208 + extern/include/cryptopp/gzip.h | 144 + extern/include/cryptopp/hashfwd.h | 38 + extern/include/cryptopp/hc128.cpp | 279 + extern/include/cryptopp/hc128.h | 67 + extern/include/cryptopp/hc256.cpp | 158 + extern/include/cryptopp/hc256.h | 67 + extern/include/cryptopp/hex.cpp | 58 + extern/include/cryptopp/hex.h | 50 + extern/include/cryptopp/hight.cpp | 271 + extern/include/cryptopp/hight.h | 81 + extern/include/cryptopp/hkdf.h | 179 + extern/include/cryptopp/hmac.cpp | 90 + extern/include/cryptopp/hmac.h | 80 + extern/include/cryptopp/hmqv.h | 417 + extern/include/cryptopp/hrtimer.cpp | 174 + extern/include/cryptopp/hrtimer.h | 134 + extern/include/cryptopp/ida.cpp | 418 + extern/include/cryptopp/ida.h | 182 + extern/include/cryptopp/idea.cpp | 191 + extern/include/cryptopp/idea.h | 66 + extern/include/cryptopp/integer.cpp | 4894 ++++ extern/include/cryptopp/integer.h | 837 + extern/include/cryptopp/iterhash.cpp | 200 + extern/include/cryptopp/iterhash.h | 217 + extern/include/cryptopp/kalyna.cpp | 1362 ++ extern/include/cryptopp/kalyna.h | 218 + extern/include/cryptopp/kalynatab.cpp | 1232 + extern/include/cryptopp/keccak.cpp | 67 + extern/include/cryptopp/keccak.h | 118 + extern/include/cryptopp/keccak_core.cpp | 261 + extern/include/cryptopp/keccak_simd.cpp | 2685 +++ extern/include/cryptopp/lea.cpp | 899 + extern/include/cryptopp/lea.h | 108 + extern/include/cryptopp/lea_simd.cpp | 1072 + extern/include/cryptopp/lubyrack.h | 137 + extern/include/cryptopp/luc.cpp | 231 + extern/include/cryptopp/luc.h | 338 + extern/include/cryptopp/mars.cpp | 154 + extern/include/cryptopp/mars.h | 60 + extern/include/cryptopp/marss.cpp | 140 + extern/include/cryptopp/md2.cpp | 120 + extern/include/cryptopp/md2.h | 54 + extern/include/cryptopp/md4.cpp | 110 + extern/include/cryptopp/md4.h | 35 + extern/include/cryptopp/md5.cpp | 124 + extern/include/cryptopp/md5.h | 35 + extern/include/cryptopp/mdc.h | 84 + extern/include/cryptopp/mersenne.h | 233 + extern/include/cryptopp/misc.cpp | 284 + extern/include/cryptopp/misc.h | 2756 +++ extern/include/cryptopp/modarith.h | 344 + extern/include/cryptopp/modes.cpp | 306 + extern/include/cryptopp/modes.h | 609 + extern/include/cryptopp/modexppc.h | 48 + extern/include/cryptopp/mqueue.cpp | 175 + extern/include/cryptopp/mqueue.h | 105 + extern/include/cryptopp/mqv.cpp | 46 + extern/include/cryptopp/mqv.h | 268 + extern/include/cryptopp/naclite.h | 438 + extern/include/cryptopp/nbtheory.cpp | 1141 + extern/include/cryptopp/nbtheory.h | 317 + extern/include/cryptopp/neon_simd.cpp | 197 + extern/include/cryptopp/nr.h | 11 + extern/include/cryptopp/oaep.cpp | 98 + extern/include/cryptopp/oaep.h | 54 + extern/include/cryptopp/oids.h | 194 + extern/include/cryptopp/osrng.cpp | 300 + extern/include/cryptopp/osrng.h | 304 + extern/include/cryptopp/ossig.h | 128 + extern/include/cryptopp/padlkrng.cpp | 105 + extern/include/cryptopp/padlkrng.h | 138 + extern/include/cryptopp/panama.cpp | 533 + extern/include/cryptopp/panama.h | 169 + extern/include/cryptopp/pch.cpp | 1 + extern/include/cryptopp/pch.h | 31 + extern/include/cryptopp/pkcspad.cpp | 160 + extern/include/cryptopp/pkcspad.h | 123 + extern/include/cryptopp/poly1305.cpp | 403 + extern/include/cryptopp/poly1305.h | 241 + extern/include/cryptopp/polynomi.cpp | 577 + extern/include/cryptopp/polynomi.h | 463 + extern/include/cryptopp/ppc_power7.cpp | 93 + extern/include/cryptopp/ppc_power8.cpp | 246 + extern/include/cryptopp/ppc_power9.cpp | 136 + extern/include/cryptopp/ppc_simd.cpp | 96 + extern/include/cryptopp/ppc_simd.h | 2764 +++ extern/include/cryptopp/pssr.cpp | 163 + extern/include/cryptopp/pssr.h | 105 + extern/include/cryptopp/pubkey.cpp | 170 + extern/include/cryptopp/pubkey.h | 2368 ++ extern/include/cryptopp/pwdbased.h | 481 + extern/include/cryptopp/queue.cpp | 600 + extern/include/cryptopp/queue.h | 158 + extern/include/cryptopp/rabbit.cpp | 259 + extern/include/cryptopp/rabbit.h | 112 + extern/include/cryptopp/rabin.cpp | 241 + extern/include/cryptopp/rabin.h | 135 + extern/include/cryptopp/randpool.cpp | 152 + extern/include/cryptopp/randpool.h | 100 + extern/include/cryptopp/rc2.cpp | 118 + extern/include/cryptopp/rc2.h | 90 + extern/include/cryptopp/rc5.cpp | 80 + extern/include/cryptopp/rc5.h | 59 + extern/include/cryptopp/rc6.cpp | 96 + extern/include/cryptopp/rc6.h | 60 + extern/include/cryptopp/rdrand.asm | 230 + extern/include/cryptopp/rdrand.cpp | 327 + extern/include/cryptopp/rdrand.h | 145 + extern/include/cryptopp/rdseed.asm | 230 + extern/include/cryptopp/rdtables.cpp | 166 + extern/include/cryptopp/regtest1.cpp | 154 + extern/include/cryptopp/regtest2.cpp | 105 + extern/include/cryptopp/regtest3.cpp | 155 + extern/include/cryptopp/regtest4.cpp | 58 + extern/include/cryptopp/resource.h | 15 + extern/include/cryptopp/rijndael.cpp | 1334 ++ extern/include/cryptopp/rijndael.h | 109 + extern/include/cryptopp/rijndael_simd.cpp | 737 + extern/include/cryptopp/ripemd.cpp | 803 + extern/include/cryptopp/ripemd.h | 65 + extern/include/cryptopp/rng.cpp | 166 + extern/include/cryptopp/rng.h | 111 + extern/include/cryptopp/rsa.cpp | 330 + extern/include/cryptopp/rsa.h | 263 + extern/include/cryptopp/rw.cpp | 314 + extern/include/cryptopp/rw.h | 146 + extern/include/cryptopp/safer.cpp | 157 + extern/include/cryptopp/safer.h | 98 + extern/include/cryptopp/salsa.cpp | 759 + extern/include/cryptopp/salsa.h | 95 + extern/include/cryptopp/scrypt.cpp | 329 + extern/include/cryptopp/scrypt.h | 103 + extern/include/cryptopp/seal.cpp | 222 + extern/include/cryptopp/seal.h | 59 + extern/include/cryptopp/secblock.h | 1198 + extern/include/cryptopp/secblockfwd.h | 29 + extern/include/cryptopp/seckey.h | 444 + extern/include/cryptopp/seed.cpp | 113 + extern/include/cryptopp/seed.h | 44 + extern/include/cryptopp/serpent.cpp | 125 + extern/include/cryptopp/serpent.h | 72 + extern/include/cryptopp/serpentp.h | 439 + extern/include/cryptopp/sha.cpp | 1414 ++ extern/include/cryptopp/sha.h | 210 + extern/include/cryptopp/sha1_armv4.S | 1410 ++ extern/include/cryptopp/sha1_armv4.h | 23 + extern/include/cryptopp/sha256_armv4.S | 2670 +++ extern/include/cryptopp/sha256_armv4.h | 23 + extern/include/cryptopp/sha3.cpp | 71 + extern/include/cryptopp/sha3.h | 106 + extern/include/cryptopp/sha512_armv4.S | 1861 ++ extern/include/cryptopp/sha512_armv4.h | 23 + extern/include/cryptopp/sha_simd.cpp | 1508 ++ extern/include/cryptopp/shacal2.cpp | 172 + extern/include/cryptopp/shacal2.h | 66 + extern/include/cryptopp/shacal2_simd.cpp | 98 + extern/include/cryptopp/shake.cpp | 85 + extern/include/cryptopp/shake.h | 161 + extern/include/cryptopp/shark.cpp | 163 + extern/include/cryptopp/shark.h | 77 + extern/include/cryptopp/sharkbox.cpp | 4166 ++++ extern/include/cryptopp/simeck.cpp | 154 + extern/include/cryptopp/simeck.h | 162 + extern/include/cryptopp/simon.cpp | 505 + extern/include/cryptopp/simon.h | 206 + extern/include/cryptopp/simon128_simd.cpp | 870 + extern/include/cryptopp/simple.cpp | 13 + extern/include/cryptopp/simple.h | 506 + extern/include/cryptopp/siphash.h | 313 + extern/include/cryptopp/skipjack.cpp | 202 + extern/include/cryptopp/skipjack.h | 80 + extern/include/cryptopp/sm3.cpp | 255 + extern/include/cryptopp/sm3.h | 61 + extern/include/cryptopp/sm4.cpp | 212 + extern/include/cryptopp/sm4.h | 96 + extern/include/cryptopp/sm4_simd.cpp | 323 + extern/include/cryptopp/smartptr.h | 257 + extern/include/cryptopp/sosemanuk.cpp | 728 + extern/include/cryptopp/sosemanuk.h | 62 + extern/include/cryptopp/speck.cpp | 487 + extern/include/cryptopp/speck.h | 206 + extern/include/cryptopp/speck128_simd.cpp | 762 + extern/include/cryptopp/square.cpp | 187 + extern/include/cryptopp/square.h | 63 + extern/include/cryptopp/squaretb.cpp | 582 + extern/include/cryptopp/sse_simd.cpp | 115 + extern/include/cryptopp/stdcpp.h | 101 + extern/include/cryptopp/strciphr.cpp | 286 + extern/include/cryptopp/strciphr.h | 724 + extern/include/cryptopp/tea.cpp | 165 + extern/include/cryptopp/tea.h | 161 + extern/include/cryptopp/test.cpp | 1093 + extern/include/cryptopp/tftables.cpp | 323 + extern/include/cryptopp/threefish.cpp | 503 + extern/include/cryptopp/threefish.h | 201 + extern/include/cryptopp/tiger.cpp | 282 + extern/include/cryptopp/tiger.h | 61 + extern/include/cryptopp/tigertab.cpp | 525 + extern/include/cryptopp/trap.h | 163 + extern/include/cryptopp/trunhash.h | 63 + extern/include/cryptopp/ttmac.cpp | 348 + extern/include/cryptopp/ttmac.h | 44 + extern/include/cryptopp/tweetnacl.cpp | 924 + extern/include/cryptopp/tweetnacl.h | 281 + extern/include/cryptopp/twofish.cpp | 171 + extern/include/cryptopp/twofish.h | 64 + extern/include/cryptopp/validat0.cpp | 1576 ++ extern/include/cryptopp/validat1.cpp | 1225 + extern/include/cryptopp/validat10.cpp | 535 + extern/include/cryptopp/validat2.cpp | 1270 + extern/include/cryptopp/validat3.cpp | 1322 + extern/include/cryptopp/validat4.cpp | 1813 ++ extern/include/cryptopp/validat5.cpp | 2216 ++ extern/include/cryptopp/validat6.cpp | 408 + extern/include/cryptopp/validat7.cpp | 562 + extern/include/cryptopp/validat8.cpp | 369 + extern/include/cryptopp/validat9.cpp | 704 + extern/include/cryptopp/validate.h | 393 + extern/include/cryptopp/vmac.cpp | 894 + extern/include/cryptopp/vmac.h | 91 + extern/include/cryptopp/vs2005.zip | Bin 0 -> 12596 bytes extern/include/cryptopp/wake.cpp | 111 + extern/include/cryptopp/wake.h | 59 + extern/include/cryptopp/whrlpool.cpp | 730 + extern/include/cryptopp/whrlpool.h | 42 + extern/include/cryptopp/words.h | 225 + extern/include/cryptopp/x64dll.asm | 2021 ++ extern/include/cryptopp/x64masm.asm | 1565 ++ extern/include/cryptopp/xed25519.cpp | 881 + extern/include/cryptopp/xed25519.h | 807 + extern/include/cryptopp/xtr.cpp | 120 + extern/include/cryptopp/xtr.h | 219 + extern/include/cryptopp/xtrcrypt.cpp | 122 + extern/include/cryptopp/xtrcrypt.h | 55 + extern/include/cryptopp/xts.cpp | 516 + extern/include/cryptopp/xts.h | 224 + extern/include/cryptopp/zdeflate.cpp | 821 + extern/include/cryptopp/zdeflate.h | 174 + extern/include/cryptopp/zinflate.cpp | 662 + extern/include/cryptopp/zinflate.h | 164 + extern/include/cryptopp/zlib.cpp | 93 + extern/include/cryptopp/zlib.h | 65 + extern/include/d3d.h | 1688 ++ extern/include/d3d8.h | 1279 + extern/include/d3d8caps.h | 362 + extern/include/d3d8types.h | 1675 ++ extern/include/d3dcaps.h | 599 + extern/include/d3drm.h | 342 + extern/include/d3dtypes.h | 2117 ++ extern/include/d3dx8.h | 45 + extern/include/d3dx8core.h | 563 + extern/include/d3dx8effect.h | 226 + extern/include/d3dx8math.h | 1215 + extern/include/d3dx8math.inl | 1757 ++ extern/include/d3dx8mesh.h | 760 + extern/include/d3dx8shape.h | 220 + extern/include/d3dx8tex.h | 1592 ++ extern/include/discord_register.h | 26 + extern/include/discord_rpc.h | 87 + extern/include/dxfile.h | 239 + extern/include/dxtrans.h | 5362 +++++ extern/include/granny.h | 5812 +++++ extern/include/granny2_spu_samplemodel.h | 51 + extern/include/il/config.h | 15 + extern/include/il/devil_internal_exports.h | 118 + extern/include/il/il.h | 572 + extern/include/il/il_wrap.h | 205 + extern/include/il/ilu.h | 182 + extern/include/il/ilut.h | 245 + extern/include/libjpeg-9a/cderror.h | 134 + extern/include/libjpeg-9a/cdjpeg.h | 187 + extern/include/libjpeg-9a/jconfig.h | 51 + extern/include/libjpeg-9a/jdct.h | 393 + extern/include/libjpeg-9a/jerror.h | 304 + extern/include/libjpeg-9a/jinclude.h | 91 + extern/include/libjpeg-9a/jmemsys.h | 198 + extern/include/libjpeg-9a/jmorecfg.h | 446 + extern/include/libjpeg-9a/jpegLibLink.h | 37 + extern/include/libjpeg-9a/jpegint.h | 426 + extern/include/libjpeg-9a/jpeglib.h | 1180 + extern/include/libjpeg-9a/jversion.h | 14 + extern/include/libjpeg-9a/transupp.h | 219 + extern/include/lzo/lzo1.h | 84 + extern/include/lzo/lzo1a.h | 84 + extern/include/lzo/lzo1b.h | 148 + extern/include/lzo/lzo1c.h | 148 + extern/include/lzo/lzo1f.h | 96 + extern/include/lzo/lzo1x.h | 165 + extern/include/lzo/lzo1y.h | 133 + extern/include/lzo/lzo1z.h | 109 + extern/include/lzo/lzo2a.h | 80 + extern/include/lzo/lzoLibLink.h | 35 + extern/include/lzo/lzo_asm.h | 140 + extern/include/lzo/lzoconf.h | 453 + extern/include/lzo/lzodefs.h | 3268 +++ extern/include/lzo/lzoutil.h | 62 + extern/include/qedit.h | 19878 ++++++++++++++++ extern/include/radtypes.h | 709 + extern/include/rapidjson/allocators.h | 271 + extern/include/rapidjson/document.h | 2575 ++ extern/include/rapidjson/encodedstream.h | 299 + extern/include/rapidjson/encodings.h | 716 + extern/include/rapidjson/error/en.h | 74 + extern/include/rapidjson/error/error.h | 155 + extern/include/rapidjson/filereadstream.h | 99 + extern/include/rapidjson/filewritestream.h | 104 + extern/include/rapidjson/fwd.h | 151 + .../include/rapidjson/internal/biginteger.h | 290 + extern/include/rapidjson/internal/diyfp.h | 258 + extern/include/rapidjson/internal/dtoa.h | 245 + extern/include/rapidjson/internal/ieee754.h | 78 + extern/include/rapidjson/internal/itoa.h | 304 + extern/include/rapidjson/internal/meta.h | 181 + extern/include/rapidjson/internal/pow10.h | 55 + extern/include/rapidjson/internal/regex.h | 701 + extern/include/rapidjson/internal/stack.h | 230 + extern/include/rapidjson/internal/strfunc.h | 55 + extern/include/rapidjson/internal/strtod.h | 269 + extern/include/rapidjson/internal/swap.h | 46 + extern/include/rapidjson/istreamwrapper.h | 115 + extern/include/rapidjson/memorybuffer.h | 70 + extern/include/rapidjson/memorystream.h | 71 + .../include/rapidjson/msinttypes/inttypes.h | 316 + extern/include/rapidjson/msinttypes/stdint.h | 300 + extern/include/rapidjson/ostreamwrapper.h | 81 + extern/include/rapidjson/pointer.h | 1358 ++ extern/include/rapidjson/prettywriter.h | 255 + extern/include/rapidjson/rapidjson.h | 615 + extern/include/rapidjson/reader.h | 1879 ++ extern/include/rapidjson/schema.h | 2006 ++ extern/include/rapidjson/stream.h | 179 + extern/include/rapidjson/stringbuffer.h | 117 + extern/include/rapidjson/writer.h | 610 + extern/library/CMakeLists.txt | 1 + extern/library/Cryptopp_lib_debug.lib | 3 + extern/library/Cryptopp_lib_release.lib | 3 + extern/library/DevIL.lib | 3 + extern/library/ILU.lib | 3 + extern/library/ILUT.lib | 3 + extern/library/SecureEngineSDK32.lib | 3 + extern/library/SpeedTreeRT.lib | 3 + extern/library/d3d8.lib | 3 + extern/library/d3dx8.lib | 3 + extern/library/ddraw.lib | 3 + extern/library/dmoguids.lib | 3 + extern/library/dxguid.lib | 3 + extern/library/dxtrans.lib | 3 + extern/library/glut.lib | 3 + extern/library/glut32.lib | 3 + extern/library/granny2.lib | 3 + extern/library/granny2_static.lib | 3 + extern/library/granny_inspector2.lib | 3 + extern/library/grn2gr2.lib | 3 + extern/library/gstate.lib | 3 + extern/library/il_wrap.lib | 3 + extern/library/libjpeg-9aMT.lib | 3 + extern/library/libjpeg-9aMTd.lib | 3 + extern/library/lzo-2.03MT.lib | 3 + extern/library/lzo-2.03MTd.lib | 3 + extern/library/lzo.lib | 3 + extern/library/lzo2.lib | 3 + extern/library/lzo2MT.lib | 3 + extern/library/lzo2MTd.lib | 3 + extern/library/mmap.lib | 3 + extern/library/mss32.lib | 3 + extern/library/python22.lib | 3 + extern/library/python27.lib | 3 + extern/library/python27_d.lib | 3 + extern/library/strmiids.lib | 3 + src/CMakeLists.txt | 18 + src/CWebBrowser/CMakeLists.txt | 8 + src/CWebBrowser/CWebBrowser.c | 1717 ++ src/CWebBrowser/CWebBrowser.h | 19 + src/Discord/CMakeLists.txt | 8 + src/Discord/backoff.h | 40 + src/Discord/connection.h | 19 + src/Discord/connection_win.cpp | 128 + src/Discord/discord_register_win.cpp | 186 + src/Discord/discord_rpc.cpp | 504 + src/Discord/dllmain.cpp | 8 + src/Discord/msg_queue.h | 36 + src/Discord/rpc_connection.cpp | 137 + src/Discord/rpc_connection.h | 59 + src/Discord/serialization.cpp | 245 + src/Discord/serialization.h | 215 + src/EffectLib/CMakeLists.txt | 8 + src/EffectLib/EffectData.cpp | 221 + src/EffectLib/EffectData.h | 69 + src/EffectLib/EffectElementBase.cpp | 168 + src/EffectLib/EffectElementBase.h | 37 + src/EffectLib/EffectElementBaseInstance.cpp | 97 + src/EffectLib/EffectElementBaseInstance.h | 46 + src/EffectLib/EffectInstance.cpp | 288 + src/EffectLib/EffectInstance.h | 90 + src/EffectLib/EffectManager.cpp | 468 + src/EffectLib/EffectManager.h | 86 + src/EffectLib/EffectMesh.cpp | 699 + src/EffectLib/EffectMesh.h | 157 + src/EffectLib/EffectMeshInstance.cpp | 271 + src/EffectLib/EffectMeshInstance.h | 50 + src/EffectLib/EffectUpdateDecorator.cpp | 39 + src/EffectLib/EffectUpdateDecorator.h | 282 + src/EffectLib/EmitterProperty.cpp | 102 + src/EffectLib/EmitterProperty.h | 95 + src/EffectLib/FrameController.cpp | 106 + src/EffectLib/FrameController.h | 38 + src/EffectLib/ParticleInstance.cpp | 516 + src/EffectLib/ParticleInstance.h | 91 + src/EffectLib/ParticleProperty.cpp | 121 + src/EffectLib/ParticleProperty.h | 96 + src/EffectLib/ParticleSystemData.cpp | 424 + src/EffectLib/ParticleSystemData.h | 41 + src/EffectLib/ParticleSystemInstance.cpp | 528 + src/EffectLib/ParticleSystemInstance.h | 85 + src/EffectLib/SimpleLightData.cpp | 164 + src/EffectLib/SimpleLightData.h | 57 + src/EffectLib/SimpleLightInstance.cpp | 138 + src/EffectLib/SimpleLightInstance.h | 39 + src/EffectLib/StdAfx.cpp | 2 + src/EffectLib/StdAfx.h | 40 + src/EffectLib/Type.cpp | 38 + src/EffectLib/Type.h | 283 + src/EterBase/CMakeLists.txt | 8 + src/EterBase/CPostIt.cpp | 299 + src/EterBase/CPostIt.h | 80 + src/EterBase/CRC32.cpp | 211 + src/EterBase/CRC32.h | 12 + src/EterBase/Debug.cpp | 326 + src/EterBase/Debug.h | 40 + src/EterBase/FileBase.cpp | 115 + src/EterBase/FileBase.h | 40 + src/EterBase/FileDir.cpp | 105 + src/EterBase/FileDir.h | 30 + src/EterBase/FileLoader.cpp | 288 + src/EterBase/FileLoader.h | 71 + src/EterBase/Filename.h | 254 + src/EterBase/MappedFile.cpp | 259 + src/EterBase/MappedFile.h | 59 + src/EterBase/Poly/Base.cpp | 27 + src/EterBase/Poly/Base.h | 25 + src/EterBase/Poly/Poly.cpp | 622 + src/EterBase/Poly/Poly.h | 106 + src/EterBase/Poly/StdAfx.h | 2 + src/EterBase/Poly/SymTable.cpp | 11 + src/EterBase/Poly/SymTable.h | 17 + src/EterBase/Poly/Symbol.cpp | 50 + src/EterBase/Poly/Symbol.h | 39 + src/EterBase/Random.cpp | 48 + src/EterBase/Random.h | 9 + src/EterBase/ServiceDefs.h | 6 + src/EterBase/Singleton.h | 85 + src/EterBase/StdAfx.cpp | 6 + src/EterBase/StdAfx.h | 56 + src/EterBase/Stl.cpp | 92 + src/EterBase/Stl.h | 444 + src/EterBase/TempFile.cpp | 21 + src/EterBase/TempFile.h | 16 + src/EterBase/Timer.cpp | 156 + src/EterBase/Timer.h | 41 + src/EterBase/Utils.cpp | 676 + src/EterBase/Utils.h | 218 + src/EterBase/cipher.cpp | 448 + src/EterBase/cipher.h | 62 + src/EterBase/error.cpp | 208 + src/EterBase/error.h | 2 + src/EterBase/lzo.cpp | 411 + src/EterBase/lzo.h | 74 + src/EterBase/tea.cpp | 101 + src/EterBase/tea.h | 19 + src/EterBase/vk.h | 45 + src/EterGrnLib/CMakeLists.txt | 8 + src/EterGrnLib/LODController.cpp | 695 + src/EterGrnLib/LODController.h | 304 + src/EterGrnLib/Material.cpp | 560 + src/EterGrnLib/Material.h | 120 + src/EterGrnLib/Mesh.cpp | 311 + src/EterGrnLib/Mesh.h | 98 + src/EterGrnLib/Model.cpp | 419 + src/EterGrnLib/Model.h | 98 + src/EterGrnLib/ModelInstance.cpp | 140 + src/EterGrnLib/ModelInstance.h | 202 + .../ModelInstanceCollisionDetection.cpp | 267 + src/EterGrnLib/ModelInstanceModel.cpp | 300 + src/EterGrnLib/ModelInstanceMotion.cpp | 148 + src/EterGrnLib/ModelInstanceRender.cpp | 407 + src/EterGrnLib/ModelInstanceUpdate.cpp | 208 + src/EterGrnLib/Motion.cpp | 70 + src/EterGrnLib/Motion.h | 25 + src/EterGrnLib/StdAfx.cpp | 2 + src/EterGrnLib/StdAfx.h | 23 + src/EterGrnLib/Thing.cpp | 242 + src/EterGrnLib/Thing.h | 49 + src/EterGrnLib/ThingInstance.cpp | 967 + src/EterGrnLib/ThingInstance.h | 158 + src/EterGrnLib/Util.cpp | 55 + src/EterGrnLib/Util.h | 16 + src/EterImageLib/CMakeLists.txt | 8 + src/EterImageLib/DXTCImage.cpp | 1645 ++ src/EterImageLib/DXTCImage.h | 143 + src/EterImageLib/Image.cpp | 143 + src/EterImageLib/Image.h | 71 + src/EterImageLib/StdAfx.cpp | 6 + src/EterImageLib/StdAfx.h | 48 + src/EterImageLib/TGAImage.cpp | 364 + src/EterImageLib/TGAImage.h | 37 + src/EterLib/AttributeData.cpp | 200 + src/EterLib/AttributeData.h | 71 + src/EterLib/AttributeInstance.cpp | 222 + src/EterLib/AttributeInstance.h | 66 + src/EterLib/BlockTexture.cpp | 183 + src/EterLib/BlockTexture.h | 26 + src/EterLib/CMakeLists.txt | 8 + src/EterLib/Camera.cpp | 633 + src/EterLib/Camera.h | 285 + src/EterLib/CollisionData.cpp | 840 + src/EterLib/CollisionData.h | 206 + src/EterLib/ColorTransitionHelper.cpp | 104 + src/EterLib/ColorTransitionHelper.h | 39 + src/EterLib/CullingManager.cpp | 176 + src/EterLib/CullingManager.h | 149 + src/EterLib/Decal.cpp | 287 + src/EterLib/Decal.h | 103 + src/EterLib/DibBar.cpp | 163 + src/EterLib/DibBar.h | 33 + src/EterLib/Dimm.h | 6579 +++++ src/EterLib/Dynamic.h | 75 + src/EterLib/EnvironmentMap.cpp | 20 + src/EterLib/EnvironmentMap.h | 22 + src/EterLib/Event.h | 69 + src/EterLib/FileLoaderThread.cpp | 180 + src/EterLib/FileLoaderThread.h | 63 + src/EterLib/FuncObject.h | 49 + src/EterLib/GrpBase.cpp | 512 + src/EterLib/GrpBase.h | 312 + src/EterLib/GrpCollisionObject.cpp | 240 + src/EterLib/GrpCollisionObject.h | 25 + src/EterLib/GrpColor.cpp | 77 + src/EterLib/GrpColor.h | 28 + src/EterLib/GrpColorInstance.cpp | 65 + src/EterLib/GrpColorInstance.h | 33 + src/EterLib/GrpD3DXBuffer.cpp | 41 + src/EterLib/GrpD3DXBuffer.h | 18 + src/EterLib/GrpDIB.cpp | 114 + src/EterLib/GrpDIB.h | 35 + src/EterLib/GrpDetector.cpp | 647 + src/EterLib/GrpDetector.h | 166 + src/EterLib/GrpDevice.cpp | 764 + src/EterLib/GrpDevice.h | 74 + src/EterLib/GrpExpandedImageInstance.cpp | 236 + src/EterLib/GrpExpandedImageInstance.h | 61 + src/EterLib/GrpFontTexture.cpp | 314 + src/EterLib/GrpFontTexture.h | 81 + src/EterLib/GrpImage.cpp | 92 + src/EterLib/GrpImage.h | 44 + src/EterLib/GrpImageInstance.cpp | 222 + src/EterLib/GrpImageInstance.h | 60 + src/EterLib/GrpImageTexture.cpp | 329 + src/EterLib/GrpImageTexture.h | 34 + src/EterLib/GrpIndexBuffer.cpp | 139 + src/EterLib/GrpIndexBuffer.h | 40 + src/EterLib/GrpLightManager.cpp | 345 + src/EterLib/GrpLightManager.h | 127 + src/EterLib/GrpMarkInstance.cpp | 256 + src/EterLib/GrpMarkInstance.h | 77 + src/EterLib/GrpMath.cpp | 136 + src/EterLib/GrpMath.h | 122 + src/EterLib/GrpObjectInstance.cpp | 441 + src/EterLib/GrpObjectInstance.h | 161 + src/EterLib/GrpPixelShader.cpp | 55 + src/EterLib/GrpPixelShader.h | 21 + src/EterLib/GrpRatioInstance.cpp | 67 + src/EterLib/GrpRatioInstance.h | 28 + src/EterLib/GrpScreen.cpp | 859 + src/EterLib/GrpScreen.h | 82 + src/EterLib/GrpShadowTexture.cpp | 191 + src/EterLib/GrpShadowTexture.h | 35 + src/EterLib/GrpSubImage.cpp | 156 + src/EterLib/GrpSubImage.h | 38 + src/EterLib/GrpText.cpp | 101 + src/EterLib/GrpText.h | 32 + src/EterLib/GrpTextInstance.cpp | 1150 + src/EterLib/GrpTextInstance.h | 134 + src/EterLib/GrpTexture.cpp | 59 + src/EterLib/GrpTexture.h | 32 + src/EterLib/GrpVertexBuffer.cpp | 179 + src/EterLib/GrpVertexBuffer.h | 50 + src/EterLib/GrpVertexBufferDynamic.cpp | 29 + src/EterLib/GrpVertexBufferDynamic.h | 19 + src/EterLib/GrpVertexBufferStatic.cpp | 16 + src/EterLib/GrpVertexBufferStatic.h | 13 + src/EterLib/GrpVertexShader.cpp | 57 + src/EterLib/GrpVertexShader.h | 21 + src/EterLib/IME.cpp | 2302 ++ src/EterLib/IME.h | 208 + src/EterLib/Input.cpp | 134 + src/EterLib/Input.h | 41 + src/EterLib/JpegFile.cpp | 312 + src/EterLib/JpegFile.h | 9 + src/EterLib/LensFlare.cpp | 599 + src/EterLib/LensFlare.h | 125 + src/EterLib/MSApplication.cpp | 56 + src/EterLib/MSApplication.h | 22 + src/EterLib/MSWindow.cpp | 249 + src/EterLib/MSWindow.h | 59 + src/EterLib/Mutex.cpp | 22 + src/EterLib/Mutex.h | 18 + src/EterLib/NetAddress.cpp | 107 + src/EterLib/NetAddress.h | 42 + src/EterLib/NetDatagram.cpp | 99 + src/EterLib/NetDatagram.h | 28 + src/EterLib/NetDatagramReceiver.cpp | 105 + src/EterLib/NetDatagramReceiver.h | 36 + src/EterLib/NetDatagramSender.cpp | 58 + src/EterLib/NetDatagramSender.h | 27 + src/EterLib/NetDevice.cpp | 41 + src/EterLib/NetDevice.h | 17 + src/EterLib/NetPacketHeaderMap.cpp | 26 + src/EterLib/NetPacketHeaderMap.h | 29 + src/EterLib/NetStream.cpp | 3011 +++ src/EterLib/NetStream.h | 113 + src/EterLib/PathStack.cpp | 59 + src/EterLib/PathStack.h | 26 + src/EterLib/Pool.h | 684 + src/EterLib/Profiler.h | 264 + src/EterLib/Ray.h | 65 + src/EterLib/Ref.h | 104 + src/EterLib/ReferenceObject.cpp | 61 + src/EterLib/ReferenceObject.h | 24 + src/EterLib/Resource.cpp | 181 + src/EterLib/Resource.h | 69 + src/EterLib/ResourceManager.cpp | 525 + src/EterLib/ResourceManager.h | 73 + src/EterLib/ScreenFilter.cpp | 52 + src/EterLib/ScreenFilter.h | 22 + src/EterLib/SkyBox.cpp | 927 + src/EterLib/SkyBox.h | 188 + src/EterLib/StateManager.cpp | 769 + src/EterLib/StateManager.h | 341 + src/EterLib/StdAfx.cpp | 8 + src/EterLib/StdAfx.h | 142 + src/EterLib/TargaResource.cpp | 55 + src/EterLib/TargaResource.h | 32 + src/EterLib/TextBar.cpp | 76 + src/EterLib/TextBar.h | 26 + src/EterLib/TextFileLoader.cpp | 696 + src/EterLib/TextFileLoader.h | 132 + src/EterLib/TextTag.cpp | 209 + src/EterLib/TextTag.h | 16 + src/EterLib/Thread.cpp | 33 + src/EterLib/Thread.h | 28 + src/EterLib/Util.cpp | 390 + src/EterLib/Util.h | 113 + src/EterLib/lineintersect_utils.cpp | 849 + src/EterLib/lineintersect_utils.h | 80 + src/EterLib/msctf.h | 12206 ++++++++++ src/EterLib/parser.cpp | 443 + src/EterLib/parser.h | 94 + src/EterLocale/Arabic.cpp | 366 + src/EterLocale/Arabic.h | 11 + src/EterLocale/CMakeLists.txt | 8 + src/EterLocale/CodePageId.h | 46 + src/EterLocale/Japanese.cpp | 71 + src/EterLocale/Japanese.h | 5 + src/EterLocale/StdAfx.cpp | 6 + src/EterLocale/StdAfx.h | 13 + src/EterLocale/StringCodec.cpp | 43 + src/EterLocale/StringCodec.h | 21 + src/EterLocale/StringCodec_Vietnamese.cpp | 554 + src/EterLocale/StringCodec_Vietnamese.h | 4 + src/EterPack/CMakeLists.txt | 8 + src/EterPack/EterPack.cpp | 1615 ++ src/EterPack/EterPack.h | 248 + src/EterPack/EterPackCursor.cpp | 59 + src/EterPack/EterPackCursor.h | 25 + src/EterPack/EterPackManager.cpp | 621 + src/EterPack/EterPackManager.h | 96 + src/EterPack/EterPackPolicy_CSHybridCrypt.cpp | 503 + src/EterPack/EterPackPolicy_CSHybridCrypt.h | 94 + src/EterPack/Inline.h | 34 + src/EterPack/StdAfx.cpp | 2 + src/EterPack/StdAfx.h | 9 + src/EterPack/md5.c | 1033 + src/EterPack/md5.h | 128 + src/EterPythonLib/CMakeLists.txt | 8 + src/EterPythonLib/PythonGraphic.cpp | 624 + src/EterPythonLib/PythonGraphic.h | 68 + .../PythonGraphicImageModule.cpp | 310 + src/EterPythonLib/PythonGraphicModule.cpp | 1005 + src/EterPythonLib/PythonGraphicTextModule.cpp | 426 + .../PythonGraphicThingModule.cpp | 164 + src/EterPythonLib/PythonGridSlotWindow.cpp | 400 + src/EterPythonLib/PythonGridSlotWindow.h | 40 + src/EterPythonLib/PythonSlotWindow.cpp | 1442 ++ src/EterPythonLib/PythonSlotWindow.h | 211 + src/EterPythonLib/PythonWindow.cpp | 2024 ++ src/EterPythonLib/PythonWindow.h | 525 + src/EterPythonLib/PythonWindowManager.cpp | 1255 + src/EterPythonLib/PythonWindowManager.h | 187 + .../PythonWindowManagerModule.cpp | 2522 ++ src/EterPythonLib/StdAfx.cpp | 6 + src/EterPythonLib/StdAfx.h | 17 + src/GameLib/ActorInstance.cpp | 979 + src/GameLib/ActorInstance.h | 889 + src/GameLib/ActorInstanceAttach.cpp | 606 + src/GameLib/ActorInstanceBattle.cpp | 967 + src/GameLib/ActorInstanceBlend.cpp | 83 + .../ActorInstanceCollisionDetection.cpp | 744 + src/GameLib/ActorInstanceData.cpp | 358 + src/GameLib/ActorInstanceEvent.cpp | 180 + src/GameLib/ActorInstanceFly.cpp | 117 + src/GameLib/ActorInstanceInterface.h | 18 + src/GameLib/ActorInstanceMotion.cpp | 911 + src/GameLib/ActorInstanceMotionEvent.cpp | 331 + src/GameLib/ActorInstancePosition.cpp | 119 + src/GameLib/ActorInstanceRender.cpp | 385 + src/GameLib/ActorInstanceRotation.cpp | 128 + src/GameLib/ActorInstanceSync.cpp | 76 + src/GameLib/ActorInstanceWeaponTrace.cpp | 40 + src/GameLib/Area.cpp | 1446 ++ src/GameLib/Area.h | 310 + src/GameLib/AreaLoaderThread.cpp | 340 + src/GameLib/AreaLoaderThread.h | 73 + src/GameLib/AreaTerrain.cpp | 1193 + src/GameLib/AreaTerrain.h | 160 + src/GameLib/CMakeLists.txt | 8 + src/GameLib/DungeonBlock.cpp | 265 + src/GameLib/DungeonBlock.h | 56 + src/GameLib/FlyHandler.h | 21 + src/GameLib/FlyTarget.cpp | 114 + src/GameLib/FlyTarget.h | 80 + src/GameLib/FlyTrace.cpp | 291 + src/GameLib/FlyTrace.h | 42 + src/GameLib/FlyingData.cpp | 353 + src/GameLib/FlyingData.h | 111 + src/GameLib/FlyingInstance.cpp | 598 + src/GameLib/FlyingInstance.h | 111 + src/GameLib/FlyingObjectManager.cpp | 214 + src/GameLib/FlyingObjectManager.h | 66 + src/GameLib/GameEventManager.cpp | 36 + src/GameLib/GameEventManager.h | 28 + src/GameLib/GameType.cpp | 362 + src/GameLib/GameType.h | 195 + src/GameLib/GameUtil.cpp | 434 + src/GameLib/GameUtil.h | 41 + src/GameLib/Interface.h | 11 + src/GameLib/ItemData.cpp | 464 + src/GameLib/ItemData.h | 524 + src/GameLib/ItemManager.cpp | 404 + src/GameLib/ItemManager.h | 42 + src/GameLib/MapBase.cpp | 101 + src/GameLib/MapBase.h | 64 + src/GameLib/MapManager.cpp | 638 + src/GameLib/MapManager.h | 169 + src/GameLib/MapOutdoor.cpp | 1595 ++ src/GameLib/MapOutdoor.h | 779 + src/GameLib/MapOutdoorCharacterShadow.cpp | 165 + src/GameLib/MapOutdoorIndexBuffer.cpp | 529 + src/GameLib/MapOutdoorLoad.cpp | 544 + src/GameLib/MapOutdoorQuadtree.cpp | 168 + src/GameLib/MapOutdoorRender.cpp | 964 + src/GameLib/MapOutdoorRenderHTP.cpp | 696 + src/GameLib/MapOutdoorRenderSTP.cpp | 806 + src/GameLib/MapOutdoorUpdate.cpp | 1133 + src/GameLib/MapOutdoorWater.cpp | 170 + src/GameLib/MapType.cpp | 299 + src/GameLib/MapType.h | 222 + src/GameLib/MapUtil.cpp | 306 + src/GameLib/MapUtil.h | 38 + src/GameLib/MonsterAreaInfo.cpp | 148 + src/GameLib/MonsterAreaInfo.h | 125 + src/GameLib/PhysicsObject.cpp | 177 + src/GameLib/PhysicsObject.h | 99 + src/GameLib/Property.cpp | 269 + src/GameLib/Property.h | 34 + src/GameLib/PropertyLoader.cpp | 68 + src/GameLib/PropertyLoader.h | 21 + src/GameLib/PropertyManager.cpp | 255 + src/GameLib/PropertyManager.h | 43 + src/GameLib/RaceData.cpp | 598 + src/GameLib/RaceData.h | 238 + src/GameLib/RaceDataFile.cpp | 186 + src/GameLib/RaceManager.cpp | 451 + src/GameLib/RaceManager.h | 49 + src/GameLib/RaceMotionData.cpp | 617 + src/GameLib/RaceMotionData.h | 301 + src/GameLib/RaceMotionDataEvent.h | 290 + src/GameLib/SnowEnvironment.cpp | 353 + src/GameLib/SnowEnvironment.h | 55 + src/GameLib/SnowParticle.cpp | 103 + src/GameLib/SnowParticle.h | 59 + src/GameLib/StdAfx.cpp | 6 + src/GameLib/StdAfx.h | 70 + src/GameLib/TerrainDecal.cpp | 180 + src/GameLib/TerrainDecal.h | 46 + src/GameLib/TerrainPatch.cpp | 240 + src/GameLib/TerrainPatch.h | 250 + src/GameLib/TerrainQuadtree.cpp | 46 + src/GameLib/TerrainQuadtree.h | 32 + src/GameLib/WeaponTrace.cpp | 490 + src/GameLib/WeaponTrace.h | 86 + src/MilesLib/CMakeLists.txt | 8 + src/MilesLib/SoundBase.cpp | 70 + src/MilesLib/SoundBase.h | 37 + src/MilesLib/SoundData.cpp | 212 + src/MilesLib/SoundData.h | 59 + src/MilesLib/SoundInstance.h | 118 + src/MilesLib/SoundInstance2D.cpp | 121 + src/MilesLib/SoundInstance3D.cpp | 137 + src/MilesLib/SoundInstanceStream.cpp | 114 + src/MilesLib/SoundManager.cpp | 646 + src/MilesLib/SoundManager.h | 111 + src/MilesLib/SoundManager2D.cpp | 79 + src/MilesLib/SoundManager2D.h | 27 + src/MilesLib/SoundManager3D.cpp | 205 + src/MilesLib/SoundManager3D.h | 45 + src/MilesLib/SoundManagerStream.cpp | 64 + src/MilesLib/SoundManagerStream.h | 32 + src/MilesLib/Stdafx.cpp | 2 + src/MilesLib/Stdafx.h | 35 + src/MilesLib/Type.cpp | 136 + src/MilesLib/Type.h | 28 + src/PRTerrainLib/CMakeLists.txt | 8 + src/PRTerrainLib/StdAfx.cpp | 10 + src/PRTerrainLib/StdAfx.h | 31 + src/PRTerrainLib/Terrain.cpp | 324 + src/PRTerrainLib/Terrain.h | 156 + src/PRTerrainLib/TerrainType.h | 95 + src/PRTerrainLib/TextureSet.cpp | 275 + src/PRTerrainLib/TextureSet.h | 90 + src/ScriptLib/CMakeLists.txt | 8 + src/ScriptLib/PythonDebugModule.cpp | 77 + src/ScriptLib/PythonDebugModule.h | 3 + src/ScriptLib/PythonLauncher.cpp | 282 + src/ScriptLib/PythonLauncher.h | 25 + src/ScriptLib/PythonMarshal.cpp | 478 + src/ScriptLib/PythonMarshal.h | 8 + src/ScriptLib/PythonUtils.cpp | 425 + src/ScriptLib/PythonUtils.h | 28 + src/ScriptLib/Resource.cpp | 105 + src/ScriptLib/Resource.h | 24 + src/ScriptLib/StdAfx.cpp | 10 + src/ScriptLib/StdAfx.h | 54 + src/SpeedTreeLib/BoundaryShapeManager.cpp | 213 + src/SpeedTreeLib/BoundaryShapeManager.h | 67 + src/SpeedTreeLib/CMakeLists.txt | 8 + src/SpeedTreeLib/Constants.h | 162 + src/SpeedTreeLib/SpeedGrassRT.cpp | 769 + src/SpeedTreeLib/SpeedGrassRT.h | 180 + src/SpeedTreeLib/SpeedGrassWrapper.cpp | 322 + src/SpeedTreeLib/SpeedGrassWrapper.h | 64 + src/SpeedTreeLib/SpeedTreeConfig.h | 120 + src/SpeedTreeLib/SpeedTreeForest.cpp | 316 + src/SpeedTreeLib/SpeedTreeForest.h | 108 + src/SpeedTreeLib/SpeedTreeForestDirectX8.cpp | 344 + src/SpeedTreeLib/SpeedTreeForestDirectX8.h | 64 + src/SpeedTreeLib/SpeedTreeMaterial.h | 79 + src/SpeedTreeLib/SpeedTreeWrapper.cpp | 1485 ++ src/SpeedTreeLib/SpeedTreeWrapper.h | 203 + src/SpeedTreeLib/StdAfx.cpp | 6 + src/SpeedTreeLib/StdAfx.h | 20 + src/SpeedTreeLib/VertexShaders.h | 332 + src/SphereLib/CMakeLists.txt | 8 + src/SphereLib/StdAfx.cpp | 6 + src/SphereLib/StdAfx.h | 16 + src/SphereLib/frustum.cpp | 93 + src/SphereLib/frustum.h | 41 + src/SphereLib/pool.h | 247 + src/SphereLib/sphere.cpp | 248 + src/SphereLib/sphere.h | 106 + src/SphereLib/spherepack.cpp | 878 + src/SphereLib/spherepack.h | 492 + src/SphereLib/vector.h | 225 + src/UserInterface/AbstractApplication.h | 56 + src/UserInterface/AbstractCharacterManager.h | 15 + src/UserInterface/AbstractChat.h | 12 + src/UserInterface/AbstractPlayer.h | 65 + src/UserInterface/AbstractSingleton.h | 29 + src/UserInterface/AccountConnector.cpp | 745 + src/UserInterface/AccountConnector.h | 93 + src/UserInterface/AffectFlagContainer.cpp | 92 + src/UserInterface/AffectFlagContainer.h | 29 + src/UserInterface/CMakeLists.txt | 36 + src/UserInterface/CameraProcedure.cpp | 354 + src/UserInterface/CheckLatestFiles.cpp | 64 + src/UserInterface/CheckLatestFiles.h | 6 + src/UserInterface/Cursors/cursor.cur | Bin 0 -> 2238 bytes src/UserInterface/Cursors/cursor_attack.cur | Bin 0 -> 2238 bytes src/UserInterface/Cursors/cursor_buy.cur | Bin 0 -> 3262 bytes .../Cursors/cursor_camera_rotate.cur | Bin 0 -> 2238 bytes src/UserInterface/Cursors/cursor_chair.cur | Bin 0 -> 2238 bytes src/UserInterface/Cursors/cursor_door.cur | Bin 0 -> 2238 bytes src/UserInterface/Cursors/cursor_hsize.cur | Bin 0 -> 3262 bytes src/UserInterface/Cursors/cursor_hvsize.cur | Bin 0 -> 3262 bytes src/UserInterface/Cursors/cursor_no.cur | Bin 0 -> 2238 bytes src/UserInterface/Cursors/cursor_pick.cur | Bin 0 -> 2238 bytes src/UserInterface/Cursors/cursor_sell.cur | Bin 0 -> 3262 bytes src/UserInterface/Cursors/cursor_talk.cur | Bin 0 -> 2238 bytes src/UserInterface/Cursors/cursor_vsize.cur | Bin 0 -> 3262 bytes src/UserInterface/Discord.h | 104 + src/UserInterface/GameType.cpp | 112 + src/UserInterface/GameType.h | 360 + src/UserInterface/GuildMarkDownloader.cpp | 546 + src/UserInterface/GuildMarkDownloader.h | 79 + src/UserInterface/GuildMarkUploader.cpp | 482 + src/UserInterface/GuildMarkUploader.h | 118 + src/UserInterface/HackShield.cpp | 380 + src/UserInterface/Hackshield.h | 23 + src/UserInterface/HackshieldLicense.h | 0 src/UserInterface/HackshieldLicense_metin2.h | 5 + .../HackshieldLicense_metin2client.h | 5 + src/UserInterface/InstanceBase.cpp | 3119 +++ src/UserInterface/InstanceBase.h | 1132 + src/UserInterface/InstanceBaseBattle.cpp | 719 + src/UserInterface/InstanceBaseEffect.cpp | 1138 + src/UserInterface/InstanceBaseEvent.cpp | 17 + src/UserInterface/InstanceBaseMotion.cpp | 165 + src/UserInterface/InstanceBaseMovement.cpp | 356 + src/UserInterface/InstanceBaseTransform.cpp | 93 + src/UserInterface/InsultChecker.cpp | 97 + src/UserInterface/InsultChecker.h | 24 + src/UserInterface/Locale.cpp | 441 + src/UserInterface/Locale.h | 36 + src/UserInterface/Locale_inc.h | 6 + src/UserInterface/Locale_inc_BR.h | 7 + src/UserInterface/Locale_inc_CA.h | 6 + src/UserInterface/Locale_inc_EU.h | 5 + src/UserInterface/Locale_inc_EU2.h | 15 + src/UserInterface/Locale_inc_GB.h | 3 + src/UserInterface/Locale_inc_HK.h | 2 + src/UserInterface/Locale_inc_JP.h | 13 + src/UserInterface/Locale_inc_KO.h | 9 + src/UserInterface/Locale_inc_KO_DEV.h | 5 + src/UserInterface/Locale_inc_NEWCIBN.h | 6 + src/UserInterface/Locale_inc_SG.h | 3 + src/UserInterface/Locale_inc_VI.h | 1 + src/UserInterface/Locale_inc_dev.h | 9 + src/UserInterface/MarkImage.cpp | 313 + src/UserInterface/MarkImage.h | 110 + src/UserInterface/MarkManager.cpp | 488 + src/UserInterface/MarkManager.h | 82 + src/UserInterface/MovieMan.cpp | 686 + src/UserInterface/MovieMan.h | 78 + src/UserInterface/NProtectGameGuard.cpp | 261 + src/UserInterface/NProtectGameGuard.h | 10 + src/UserInterface/NetworkActorManager.cpp | 582 + src/UserInterface/NetworkActorManager.h | 164 + src/UserInterface/Packet.h | 2813 +++ src/UserInterface/ProcessCRC.cpp | 130 + src/UserInterface/ProcessCRC.h | 6 + src/UserInterface/ProcessScanner.cpp | 142 + src/UserInterface/ProcessScanner.h | 9 + src/UserInterface/PythonApplication.cpp | 1459 ++ src/UserInterface/PythonApplication.h | 440 + src/UserInterface/PythonApplicationCamera.cpp | 415 + src/UserInterface/PythonApplicationCursor.cpp | 165 + src/UserInterface/PythonApplicationEvent.cpp | 231 + src/UserInterface/PythonApplicationLogo.cpp | 242 + src/UserInterface/PythonApplicationModule.cpp | 1530 ++ .../PythonApplicationProcedure.cpp | 281 + .../PythonApplicationWebPage.cpp | 46 + src/UserInterface/PythonBackground.cpp | 921 + src/UserInterface/PythonBackground.h | 183 + src/UserInterface/PythonBackgroundModule.cpp | 619 + src/UserInterface/PythonCharacterManager.cpp | 965 + src/UserInterface/PythonCharacterManager.h | 168 + .../PythonCharacterManagerModule.cpp | 844 + src/UserInterface/PythonCharacterModule.cpp | 1491 ++ src/UserInterface/PythonChat.cpp | 833 + src/UserInterface/PythonChat.h | 234 + src/UserInterface/PythonChatModule.cpp | 520 + src/UserInterface/PythonEffectModule.cpp | 150 + src/UserInterface/PythonEventManager.cpp | 1211 + src/UserInterface/PythonEventManager.h | 212 + .../PythonEventManagerMoudle.cpp | 315 + src/UserInterface/PythonExceptionSender.cpp | 67 + src/UserInterface/PythonExceptionSender.h | 13 + src/UserInterface/PythonExchange.cpp | 248 + src/UserInterface/PythonExchange.h | 92 + src/UserInterface/PythonExchangeModule.cpp | 191 + src/UserInterface/PythonFlyModule.cpp | 26 + .../PythonGameEventManagerModule.cpp | 30 + src/UserInterface/PythonGuild.cpp | 799 + src/UserInterface/PythonGuild.h | 130 + src/UserInterface/PythonIME.cpp | 119 + src/UserInterface/PythonIME.h | 36 + src/UserInterface/PythonIMEModule.cpp | 289 + src/UserInterface/PythonItem.cpp | 763 + src/UserInterface/PythonItem.h | 136 + src/UserInterface/PythonItemModule.cpp | 840 + src/UserInterface/PythonMessenger.cpp | 168 + src/UserInterface/PythonMessenger.h | 45 + src/UserInterface/PythonMiniMap.cpp | 1497 ++ src/UserInterface/PythonMiniMap.h | 253 + src/UserInterface/PythonMiniMapModule.cpp | 357 + src/UserInterface/PythonNetworkDatagram.cpp | 213 + src/UserInterface/PythonNetworkDatagram.h | 58 + .../PythonNetworkDatagramModule.cpp | 29 + src/UserInterface/PythonNetworkStream.cpp | 911 + src/UserInterface/PythonNetworkStream.h | 738 + .../PythonNetworkStreamCommand.cpp | 557 + .../PythonNetworkStreamEvent.cpp | 18 + .../PythonNetworkStreamModule.cpp | 1932 ++ .../PythonNetworkStreamPhaseGame.cpp | 4508 ++++ .../PythonNetworkStreamPhaseGameActor.cpp | 454 + .../PythonNetworkStreamPhaseGameItem.cpp | 940 + .../PythonNetworkStreamPhaseHandShake.cpp | 331 + .../PythonNetworkStreamPhaseLoading.cpp | 361 + .../PythonNetworkStreamPhaseLogin.cpp | 416 + .../PythonNetworkStreamPhaseOffline.cpp | 22 + .../PythonNetworkStreamPhaseSelect.cpp | 308 + src/UserInterface/PythonNonPlayer.cpp | 197 + src/UserInterface/PythonNonPlayer.h | 142 + src/UserInterface/PythonNonPlayerModule.cpp | 119 + src/UserInterface/PythonPackModule.cpp | 87 + src/UserInterface/PythonPlayer.cpp | 1731 ++ src/UserInterface/PythonPlayer.h | 689 + .../PythonPlayerEventHandler.cpp | 280 + src/UserInterface/PythonPlayerEventHandler.h | 89 + src/UserInterface/PythonPlayerInput.cpp | 1011 + .../PythonPlayerInputKeyboard.cpp | 134 + src/UserInterface/PythonPlayerInputMouse.cpp | 394 + src/UserInterface/PythonPlayerModule.cpp | 2572 ++ src/UserInterface/PythonPlayerSkill.cpp | 991 + src/UserInterface/PythonProfilerModule.cpp | 33 + src/UserInterface/PythonQuest.cpp | 270 + src/UserInterface/PythonQuest.h | 59 + src/UserInterface/PythonSafeBox.cpp | 338 + src/UserInterface/PythonSafeBox.h | 42 + src/UserInterface/PythonShop.cpp | 434 + src/UserInterface/PythonShop.h | 82 + src/UserInterface/PythonSkill.cpp | 2256 ++ src/UserInterface/PythonSkill.h | 299 + .../PythonSoundManagerModule.cpp | 176 + src/UserInterface/PythonSystem.cpp | 681 + src/UserInterface/PythonSystem.h | 162 + src/UserInterface/PythonSystemModule.cpp | 445 + src/UserInterface/PythonTextTail.cpp | 1029 + src/UserInterface/PythonTextTail.h | 113 + src/UserInterface/PythonTextTailModule.cpp | 235 + src/UserInterface/ServerStateChecker.cpp | 105 + src/UserInterface/ServerStateChecker.h | 31 + .../ServerStateCheckerModule.cpp | 64 + src/UserInterface/StdAfx.cpp | 6 + src/UserInterface/StdAfx.h | 90 + src/UserInterface/Test.h | 3 + src/UserInterface/UserInterface.aps | Bin 0 -> 69976 bytes src/UserInterface/UserInterface.cpp | 725 + src/UserInterface/UserInterface.rc | 258 + src/UserInterface/Version.h | 3 + src/UserInterface/Version.py | 23 + src/UserInterface/WiseLogicXTrap.cpp | 81 + src/UserInterface/WiseLogicXTrap.h | 8 + src/UserInterface/metin2.ico | Bin 0 -> 7406 bytes src/UserInterface/resource.h | 66 + vendor/CMakeLists.txt | 0 1334 files changed, 456590 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 CMakeLists.txt create mode 100644 buildtool/Utils.cmake create mode 100644 extern/CMakeLists.txt create mode 100644 extern/include/MSS.H create mode 100644 extern/include/Python-2.7/Python-ast.h create mode 100644 extern/include/Python-2.7/Python.h create mode 100644 extern/include/Python-2.7/abstract.h create mode 100644 extern/include/Python-2.7/asdl.h create mode 100644 extern/include/Python-2.7/ast.h create mode 100644 extern/include/Python-2.7/bitset.h create mode 100644 extern/include/Python-2.7/boolobject.h create mode 100644 extern/include/Python-2.7/bufferobject.h create mode 100644 extern/include/Python-2.7/bytearrayobject.h create mode 100644 extern/include/Python-2.7/bytes_methods.h create mode 100644 extern/include/Python-2.7/bytesobject.h create mode 100644 extern/include/Python-2.7/cStringIO.h create mode 100644 extern/include/Python-2.7/cellobject.h create mode 100644 extern/include/Python-2.7/ceval.h create mode 100644 extern/include/Python-2.7/classobject.h create mode 100644 extern/include/Python-2.7/cobject.h create mode 100644 extern/include/Python-2.7/code.h create mode 100644 extern/include/Python-2.7/codecs.h create mode 100644 extern/include/Python-2.7/compile.h create mode 100644 extern/include/Python-2.7/complexobject.h create mode 100644 extern/include/Python-2.7/datetime.h create mode 100644 extern/include/Python-2.7/descrobject.h create mode 100644 extern/include/Python-2.7/dictobject.h create mode 100644 extern/include/Python-2.7/dtoa.h create mode 100644 extern/include/Python-2.7/enumobject.h create mode 100644 extern/include/Python-2.7/errcode.h create mode 100644 extern/include/Python-2.7/eval.h create mode 100644 extern/include/Python-2.7/fileobject.h create mode 100644 extern/include/Python-2.7/floatobject.h create mode 100644 extern/include/Python-2.7/frameobject.h create mode 100644 extern/include/Python-2.7/funcobject.h create mode 100644 extern/include/Python-2.7/genobject.h create mode 100644 extern/include/Python-2.7/graminit.h create mode 100644 extern/include/Python-2.7/grammar.h create mode 100644 extern/include/Python-2.7/import.h create mode 100644 extern/include/Python-2.7/intobject.h create mode 100644 extern/include/Python-2.7/intrcheck.h create mode 100644 extern/include/Python-2.7/iterobject.h create mode 100644 extern/include/Python-2.7/listobject.h create mode 100644 extern/include/Python-2.7/longintrepr.h create mode 100644 extern/include/Python-2.7/longobject.h create mode 100644 extern/include/Python-2.7/marshal.h create mode 100644 extern/include/Python-2.7/memoryobject.h create mode 100644 extern/include/Python-2.7/metagrammar.h create mode 100644 extern/include/Python-2.7/methodobject.h create mode 100644 extern/include/Python-2.7/modsupport.h create mode 100644 extern/include/Python-2.7/moduleobject.h create mode 100644 extern/include/Python-2.7/node.h create mode 100644 extern/include/Python-2.7/object.h create mode 100644 extern/include/Python-2.7/objimpl.h create mode 100644 extern/include/Python-2.7/opcode.h create mode 100644 extern/include/Python-2.7/osdefs.h create mode 100644 extern/include/Python-2.7/parsetok.h create mode 100644 extern/include/Python-2.7/patchlevel.h create mode 100644 extern/include/Python-2.7/pgen.h create mode 100644 extern/include/Python-2.7/pgenheaders.h create mode 100644 extern/include/Python-2.7/py_curses.h create mode 100644 extern/include/Python-2.7/pyarena.h create mode 100644 extern/include/Python-2.7/pycapsule.h create mode 100644 extern/include/Python-2.7/pyconfig.h create mode 100644 extern/include/Python-2.7/pyctype.h create mode 100644 extern/include/Python-2.7/pydebug.h create mode 100644 extern/include/Python-2.7/pyerrors.h create mode 100644 extern/include/Python-2.7/pyexpat.h create mode 100644 extern/include/Python-2.7/pyfpe.h create mode 100644 extern/include/Python-2.7/pygetopt.h create mode 100644 extern/include/Python-2.7/pymacconfig.h create mode 100644 extern/include/Python-2.7/pymactoolbox.h create mode 100644 extern/include/Python-2.7/pymath.h create mode 100644 extern/include/Python-2.7/pymem.h create mode 100644 extern/include/Python-2.7/pyport.h create mode 100644 extern/include/Python-2.7/pystate.h create mode 100644 extern/include/Python-2.7/pystrcmp.h create mode 100644 extern/include/Python-2.7/pystrtod.h create mode 100644 extern/include/Python-2.7/pythonrun.h create mode 100644 extern/include/Python-2.7/pythread.h create mode 100644 extern/include/Python-2.7/rangeobject.h create mode 100644 extern/include/Python-2.7/setobject.h create mode 100644 extern/include/Python-2.7/sliceobject.h create mode 100644 extern/include/Python-2.7/stringobject.h create mode 100644 extern/include/Python-2.7/structmember.h create mode 100644 extern/include/Python-2.7/structseq.h create mode 100644 extern/include/Python-2.7/symtable.h create mode 100644 extern/include/Python-2.7/sysmodule.h create mode 100644 extern/include/Python-2.7/timefuncs.h create mode 100644 extern/include/Python-2.7/token.h create mode 100644 extern/include/Python-2.7/traceback.h create mode 100644 extern/include/Python-2.7/tupleobject.h create mode 100644 extern/include/Python-2.7/ucnhash.h create mode 100644 extern/include/Python-2.7/unicodeobject.h create mode 100644 extern/include/Python-2.7/warnings.h create mode 100644 extern/include/Python-2.7/weakrefobject.h create mode 100644 extern/include/SpeedTreeRT.h create mode 100644 extern/include/cryptopp/3way.cpp create mode 100644 extern/include/cryptopp/3way.h create mode 100644 extern/include/cryptopp/Doxyfile create mode 100644 extern/include/cryptopp/Filelist.txt create mode 100644 extern/include/cryptopp/GNUmakefile create mode 100644 extern/include/cryptopp/GNUmakefile-cross create mode 100644 extern/include/cryptopp/History.txt create mode 100644 extern/include/cryptopp/Install.txt create mode 100644 extern/include/cryptopp/License.txt create mode 100644 extern/include/cryptopp/Readme.txt create mode 100644 extern/include/cryptopp/adhoc.cpp create mode 100644 extern/include/cryptopp/adhoc.cpp.copied create mode 100644 extern/include/cryptopp/adhoc.cpp.proto create mode 100644 extern/include/cryptopp/adler32.cpp create mode 100644 extern/include/cryptopp/adler32.h create mode 100644 extern/include/cryptopp/adv_simd.h create mode 100644 extern/include/cryptopp/aes.h create mode 100644 extern/include/cryptopp/aes_armv4.S create mode 100644 extern/include/cryptopp/aes_armv4.h create mode 100644 extern/include/cryptopp/algebra.cpp create mode 100644 extern/include/cryptopp/algebra.h create mode 100644 extern/include/cryptopp/algparam.cpp create mode 100644 extern/include/cryptopp/algparam.h create mode 100644 extern/include/cryptopp/allocate.cpp create mode 100644 extern/include/cryptopp/allocate.h create mode 100644 extern/include/cryptopp/arc4.cpp create mode 100644 extern/include/cryptopp/arc4.h create mode 100644 extern/include/cryptopp/argnames.h create mode 100644 extern/include/cryptopp/aria.cpp create mode 100644 extern/include/cryptopp/aria.h create mode 100644 extern/include/cryptopp/aria_simd.cpp create mode 100644 extern/include/cryptopp/ariatab.cpp create mode 100644 extern/include/cryptopp/arm_simd.h create mode 100644 extern/include/cryptopp/asn.cpp create mode 100644 extern/include/cryptopp/asn.h create mode 100644 extern/include/cryptopp/authenc.cpp create mode 100644 extern/include/cryptopp/authenc.h create mode 100644 extern/include/cryptopp/base32.cpp create mode 100644 extern/include/cryptopp/base32.h create mode 100644 extern/include/cryptopp/base64.cpp create mode 100644 extern/include/cryptopp/base64.h create mode 100644 extern/include/cryptopp/basecode.cpp create mode 100644 extern/include/cryptopp/basecode.h create mode 100644 extern/include/cryptopp/bds10.zip create mode 100644 extern/include/cryptopp/bench.h create mode 100644 extern/include/cryptopp/bench1.cpp create mode 100644 extern/include/cryptopp/bench2.cpp create mode 100644 extern/include/cryptopp/bench3.cpp create mode 100644 extern/include/cryptopp/bfinit.cpp create mode 100644 extern/include/cryptopp/blake2.cpp create mode 100644 extern/include/cryptopp/blake2.h create mode 100644 extern/include/cryptopp/blake2b_simd.cpp create mode 100644 extern/include/cryptopp/blake2s_simd.cpp create mode 100644 extern/include/cryptopp/blowfish.cpp create mode 100644 extern/include/cryptopp/blowfish.h create mode 100644 extern/include/cryptopp/blumshub.cpp create mode 100644 extern/include/cryptopp/blumshub.h create mode 100644 extern/include/cryptopp/camellia.cpp create mode 100644 extern/include/cryptopp/camellia.h create mode 100644 extern/include/cryptopp/cast.cpp create mode 100644 extern/include/cryptopp/cast.h create mode 100644 extern/include/cryptopp/casts.cpp create mode 100644 extern/include/cryptopp/cbcmac.cpp create mode 100644 extern/include/cryptopp/cbcmac.h create mode 100644 extern/include/cryptopp/ccm.cpp create mode 100644 extern/include/cryptopp/ccm.h create mode 100644 extern/include/cryptopp/chacha.cpp create mode 100644 extern/include/cryptopp/chacha.h create mode 100644 extern/include/cryptopp/chacha_avx.cpp create mode 100644 extern/include/cryptopp/chacha_simd.cpp create mode 100644 extern/include/cryptopp/chachapoly.cpp create mode 100644 extern/include/cryptopp/chachapoly.h create mode 100644 extern/include/cryptopp/cham.cpp create mode 100644 extern/include/cryptopp/cham.h create mode 100644 extern/include/cryptopp/cham_simd.cpp create mode 100644 extern/include/cryptopp/channels.cpp create mode 100644 extern/include/cryptopp/channels.h create mode 100644 extern/include/cryptopp/cmac.cpp create mode 100644 extern/include/cryptopp/cmac.h create mode 100644 extern/include/cryptopp/config.h create mode 100644 extern/include/cryptopp/config_align.h create mode 100644 extern/include/cryptopp/config_asm.h create mode 100644 extern/include/cryptopp/config_cpu.h create mode 100644 extern/include/cryptopp/config_cxx.h create mode 100644 extern/include/cryptopp/config_dll.h create mode 100644 extern/include/cryptopp/config_int.h create mode 100644 extern/include/cryptopp/config_misc.h create mode 100644 extern/include/cryptopp/config_ns.h create mode 100644 extern/include/cryptopp/config_os.h create mode 100644 extern/include/cryptopp/config_ver.h create mode 100644 extern/include/cryptopp/cpu.cpp create mode 100644 extern/include/cryptopp/cpu.h create mode 100644 extern/include/cryptopp/crc.cpp create mode 100644 extern/include/cryptopp/crc.h create mode 100644 extern/include/cryptopp/crc_simd.cpp create mode 100644 extern/include/cryptopp/cryptdll.vcxproj create mode 100644 extern/include/cryptopp/cryptdll.vcxproj.filters create mode 100644 extern/include/cryptopp/cryptest.nmake create mode 100644 extern/include/cryptopp/cryptest.sln create mode 100644 extern/include/cryptopp/cryptest.vcxproj create mode 100644 extern/include/cryptopp/cryptest.vcxproj.filters create mode 100644 extern/include/cryptopp/cryptest.vcxproj.user create mode 100644 extern/include/cryptopp/cryptlib.cpp create mode 100644 extern/include/cryptopp/cryptlib.h create mode 100644 extern/include/cryptopp/cryptlib.vcxproj create mode 100644 extern/include/cryptopp/cryptlib.vcxproj.filters create mode 100644 extern/include/cryptopp/cryptopp.rc create mode 100644 extern/include/cryptopp/cryptopp.supp create mode 100644 extern/include/cryptopp/cryptoppLibLink.h create mode 100644 extern/include/cryptopp/darn.cpp create mode 100644 extern/include/cryptopp/darn.h create mode 100644 extern/include/cryptopp/datatest.cpp create mode 100644 extern/include/cryptopp/default.cpp create mode 100644 extern/include/cryptopp/default.h create mode 100644 extern/include/cryptopp/des.cpp create mode 100644 extern/include/cryptopp/des.h create mode 100644 extern/include/cryptopp/dessp.cpp create mode 100644 extern/include/cryptopp/dh.cpp create mode 100644 extern/include/cryptopp/dh.h create mode 100644 extern/include/cryptopp/dh2.cpp create mode 100644 extern/include/cryptopp/dh2.h create mode 100644 extern/include/cryptopp/dll.cpp create mode 100644 extern/include/cryptopp/dll.h create mode 100644 extern/include/cryptopp/dlltest.cpp create mode 100644 extern/include/cryptopp/dlltest.vcxproj create mode 100644 extern/include/cryptopp/dlltest.vcxproj.filters create mode 100644 extern/include/cryptopp/dmac.h create mode 100644 extern/include/cryptopp/donna.h create mode 100644 extern/include/cryptopp/donna_32.cpp create mode 100644 extern/include/cryptopp/donna_32.h create mode 100644 extern/include/cryptopp/donna_64.cpp create mode 100644 extern/include/cryptopp/donna_64.h create mode 100644 extern/include/cryptopp/donna_sse.cpp create mode 100644 extern/include/cryptopp/donna_sse.h create mode 100644 extern/include/cryptopp/drbg.h create mode 100644 extern/include/cryptopp/dsa.cpp create mode 100644 extern/include/cryptopp/dsa.h create mode 100644 extern/include/cryptopp/eax.cpp create mode 100644 extern/include/cryptopp/eax.h create mode 100644 extern/include/cryptopp/ec2n.cpp create mode 100644 extern/include/cryptopp/ec2n.h create mode 100644 extern/include/cryptopp/eccrypto.cpp create mode 100644 extern/include/cryptopp/eccrypto.h create mode 100644 extern/include/cryptopp/ecp.cpp create mode 100644 extern/include/cryptopp/ecp.h create mode 100644 extern/include/cryptopp/ecpoint.h create mode 100644 extern/include/cryptopp/elgamal.cpp create mode 100644 extern/include/cryptopp/elgamal.h create mode 100644 extern/include/cryptopp/emsa2.cpp create mode 100644 extern/include/cryptopp/emsa2.h create mode 100644 extern/include/cryptopp/eprecomp.cpp create mode 100644 extern/include/cryptopp/eprecomp.h create mode 100644 extern/include/cryptopp/esign.cpp create mode 100644 extern/include/cryptopp/esign.h create mode 100644 extern/include/cryptopp/factory.h create mode 100644 extern/include/cryptopp/fhmqv.h create mode 100644 extern/include/cryptopp/files.cpp create mode 100644 extern/include/cryptopp/files.h create mode 100644 extern/include/cryptopp/filters.cpp create mode 100644 extern/include/cryptopp/filters.h create mode 100644 extern/include/cryptopp/fips140.cpp create mode 100644 extern/include/cryptopp/fips140.h create mode 100644 extern/include/cryptopp/fipsalgt.cpp create mode 100644 extern/include/cryptopp/fipstest.cpp create mode 100644 extern/include/cryptopp/fltrimpl.h create mode 100644 extern/include/cryptopp/gcm.cpp create mode 100644 extern/include/cryptopp/gcm.h create mode 100644 extern/include/cryptopp/gcm_simd.cpp create mode 100644 extern/include/cryptopp/gf256.cpp create mode 100644 extern/include/cryptopp/gf256.h create mode 100644 extern/include/cryptopp/gf2_32.cpp create mode 100644 extern/include/cryptopp/gf2_32.h create mode 100644 extern/include/cryptopp/gf2n.cpp create mode 100644 extern/include/cryptopp/gf2n.h create mode 100644 extern/include/cryptopp/gf2n_simd.cpp create mode 100644 extern/include/cryptopp/gfpcrypt.cpp create mode 100644 extern/include/cryptopp/gfpcrypt.h create mode 100644 extern/include/cryptopp/gost.cpp create mode 100644 extern/include/cryptopp/gost.h create mode 100644 extern/include/cryptopp/gzip.cpp create mode 100644 extern/include/cryptopp/gzip.h create mode 100644 extern/include/cryptopp/hashfwd.h create mode 100644 extern/include/cryptopp/hc128.cpp create mode 100644 extern/include/cryptopp/hc128.h create mode 100644 extern/include/cryptopp/hc256.cpp create mode 100644 extern/include/cryptopp/hc256.h create mode 100644 extern/include/cryptopp/hex.cpp create mode 100644 extern/include/cryptopp/hex.h create mode 100644 extern/include/cryptopp/hight.cpp create mode 100644 extern/include/cryptopp/hight.h create mode 100644 extern/include/cryptopp/hkdf.h create mode 100644 extern/include/cryptopp/hmac.cpp create mode 100644 extern/include/cryptopp/hmac.h create mode 100644 extern/include/cryptopp/hmqv.h create mode 100644 extern/include/cryptopp/hrtimer.cpp create mode 100644 extern/include/cryptopp/hrtimer.h create mode 100644 extern/include/cryptopp/ida.cpp create mode 100644 extern/include/cryptopp/ida.h create mode 100644 extern/include/cryptopp/idea.cpp create mode 100644 extern/include/cryptopp/idea.h create mode 100644 extern/include/cryptopp/integer.cpp create mode 100644 extern/include/cryptopp/integer.h create mode 100644 extern/include/cryptopp/iterhash.cpp create mode 100644 extern/include/cryptopp/iterhash.h create mode 100644 extern/include/cryptopp/kalyna.cpp create mode 100644 extern/include/cryptopp/kalyna.h create mode 100644 extern/include/cryptopp/kalynatab.cpp create mode 100644 extern/include/cryptopp/keccak.cpp create mode 100644 extern/include/cryptopp/keccak.h create mode 100644 extern/include/cryptopp/keccak_core.cpp create mode 100644 extern/include/cryptopp/keccak_simd.cpp create mode 100644 extern/include/cryptopp/lea.cpp create mode 100644 extern/include/cryptopp/lea.h create mode 100644 extern/include/cryptopp/lea_simd.cpp create mode 100644 extern/include/cryptopp/lubyrack.h create mode 100644 extern/include/cryptopp/luc.cpp create mode 100644 extern/include/cryptopp/luc.h create mode 100644 extern/include/cryptopp/mars.cpp create mode 100644 extern/include/cryptopp/mars.h create mode 100644 extern/include/cryptopp/marss.cpp create mode 100644 extern/include/cryptopp/md2.cpp create mode 100644 extern/include/cryptopp/md2.h create mode 100644 extern/include/cryptopp/md4.cpp create mode 100644 extern/include/cryptopp/md4.h create mode 100644 extern/include/cryptopp/md5.cpp create mode 100644 extern/include/cryptopp/md5.h create mode 100644 extern/include/cryptopp/mdc.h create mode 100644 extern/include/cryptopp/mersenne.h create mode 100644 extern/include/cryptopp/misc.cpp create mode 100644 extern/include/cryptopp/misc.h create mode 100644 extern/include/cryptopp/modarith.h create mode 100644 extern/include/cryptopp/modes.cpp create mode 100644 extern/include/cryptopp/modes.h create mode 100644 extern/include/cryptopp/modexppc.h create mode 100644 extern/include/cryptopp/mqueue.cpp create mode 100644 extern/include/cryptopp/mqueue.h create mode 100644 extern/include/cryptopp/mqv.cpp create mode 100644 extern/include/cryptopp/mqv.h create mode 100644 extern/include/cryptopp/naclite.h create mode 100644 extern/include/cryptopp/nbtheory.cpp create mode 100644 extern/include/cryptopp/nbtheory.h create mode 100644 extern/include/cryptopp/neon_simd.cpp create mode 100644 extern/include/cryptopp/nr.h create mode 100644 extern/include/cryptopp/oaep.cpp create mode 100644 extern/include/cryptopp/oaep.h create mode 100644 extern/include/cryptopp/oids.h create mode 100644 extern/include/cryptopp/osrng.cpp create mode 100644 extern/include/cryptopp/osrng.h create mode 100644 extern/include/cryptopp/ossig.h create mode 100644 extern/include/cryptopp/padlkrng.cpp create mode 100644 extern/include/cryptopp/padlkrng.h create mode 100644 extern/include/cryptopp/panama.cpp create mode 100644 extern/include/cryptopp/panama.h create mode 100644 extern/include/cryptopp/pch.cpp create mode 100644 extern/include/cryptopp/pch.h create mode 100644 extern/include/cryptopp/pkcspad.cpp create mode 100644 extern/include/cryptopp/pkcspad.h create mode 100644 extern/include/cryptopp/poly1305.cpp create mode 100644 extern/include/cryptopp/poly1305.h create mode 100644 extern/include/cryptopp/polynomi.cpp create mode 100644 extern/include/cryptopp/polynomi.h create mode 100644 extern/include/cryptopp/ppc_power7.cpp create mode 100644 extern/include/cryptopp/ppc_power8.cpp create mode 100644 extern/include/cryptopp/ppc_power9.cpp create mode 100644 extern/include/cryptopp/ppc_simd.cpp create mode 100644 extern/include/cryptopp/ppc_simd.h create mode 100644 extern/include/cryptopp/pssr.cpp create mode 100644 extern/include/cryptopp/pssr.h create mode 100644 extern/include/cryptopp/pubkey.cpp create mode 100644 extern/include/cryptopp/pubkey.h create mode 100644 extern/include/cryptopp/pwdbased.h create mode 100644 extern/include/cryptopp/queue.cpp create mode 100644 extern/include/cryptopp/queue.h create mode 100644 extern/include/cryptopp/rabbit.cpp create mode 100644 extern/include/cryptopp/rabbit.h create mode 100644 extern/include/cryptopp/rabin.cpp create mode 100644 extern/include/cryptopp/rabin.h create mode 100644 extern/include/cryptopp/randpool.cpp create mode 100644 extern/include/cryptopp/randpool.h create mode 100644 extern/include/cryptopp/rc2.cpp create mode 100644 extern/include/cryptopp/rc2.h create mode 100644 extern/include/cryptopp/rc5.cpp create mode 100644 extern/include/cryptopp/rc5.h create mode 100644 extern/include/cryptopp/rc6.cpp create mode 100644 extern/include/cryptopp/rc6.h create mode 100644 extern/include/cryptopp/rdrand.asm create mode 100644 extern/include/cryptopp/rdrand.cpp create mode 100644 extern/include/cryptopp/rdrand.h create mode 100644 extern/include/cryptopp/rdseed.asm create mode 100644 extern/include/cryptopp/rdtables.cpp create mode 100644 extern/include/cryptopp/regtest1.cpp create mode 100644 extern/include/cryptopp/regtest2.cpp create mode 100644 extern/include/cryptopp/regtest3.cpp create mode 100644 extern/include/cryptopp/regtest4.cpp create mode 100644 extern/include/cryptopp/resource.h create mode 100644 extern/include/cryptopp/rijndael.cpp create mode 100644 extern/include/cryptopp/rijndael.h create mode 100644 extern/include/cryptopp/rijndael_simd.cpp create mode 100644 extern/include/cryptopp/ripemd.cpp create mode 100644 extern/include/cryptopp/ripemd.h create mode 100644 extern/include/cryptopp/rng.cpp create mode 100644 extern/include/cryptopp/rng.h create mode 100644 extern/include/cryptopp/rsa.cpp create mode 100644 extern/include/cryptopp/rsa.h create mode 100644 extern/include/cryptopp/rw.cpp create mode 100644 extern/include/cryptopp/rw.h create mode 100644 extern/include/cryptopp/safer.cpp create mode 100644 extern/include/cryptopp/safer.h create mode 100644 extern/include/cryptopp/salsa.cpp create mode 100644 extern/include/cryptopp/salsa.h create mode 100644 extern/include/cryptopp/scrypt.cpp create mode 100644 extern/include/cryptopp/scrypt.h create mode 100644 extern/include/cryptopp/seal.cpp create mode 100644 extern/include/cryptopp/seal.h create mode 100644 extern/include/cryptopp/secblock.h create mode 100644 extern/include/cryptopp/secblockfwd.h create mode 100644 extern/include/cryptopp/seckey.h create mode 100644 extern/include/cryptopp/seed.cpp create mode 100644 extern/include/cryptopp/seed.h create mode 100644 extern/include/cryptopp/serpent.cpp create mode 100644 extern/include/cryptopp/serpent.h create mode 100644 extern/include/cryptopp/serpentp.h create mode 100644 extern/include/cryptopp/sha.cpp create mode 100644 extern/include/cryptopp/sha.h create mode 100644 extern/include/cryptopp/sha1_armv4.S create mode 100644 extern/include/cryptopp/sha1_armv4.h create mode 100644 extern/include/cryptopp/sha256_armv4.S create mode 100644 extern/include/cryptopp/sha256_armv4.h create mode 100644 extern/include/cryptopp/sha3.cpp create mode 100644 extern/include/cryptopp/sha3.h create mode 100644 extern/include/cryptopp/sha512_armv4.S create mode 100644 extern/include/cryptopp/sha512_armv4.h create mode 100644 extern/include/cryptopp/sha_simd.cpp create mode 100644 extern/include/cryptopp/shacal2.cpp create mode 100644 extern/include/cryptopp/shacal2.h create mode 100644 extern/include/cryptopp/shacal2_simd.cpp create mode 100644 extern/include/cryptopp/shake.cpp create mode 100644 extern/include/cryptopp/shake.h create mode 100644 extern/include/cryptopp/shark.cpp create mode 100644 extern/include/cryptopp/shark.h create mode 100644 extern/include/cryptopp/sharkbox.cpp create mode 100644 extern/include/cryptopp/simeck.cpp create mode 100644 extern/include/cryptopp/simeck.h create mode 100644 extern/include/cryptopp/simon.cpp create mode 100644 extern/include/cryptopp/simon.h create mode 100644 extern/include/cryptopp/simon128_simd.cpp create mode 100644 extern/include/cryptopp/simple.cpp create mode 100644 extern/include/cryptopp/simple.h create mode 100644 extern/include/cryptopp/siphash.h create mode 100644 extern/include/cryptopp/skipjack.cpp create mode 100644 extern/include/cryptopp/skipjack.h create mode 100644 extern/include/cryptopp/sm3.cpp create mode 100644 extern/include/cryptopp/sm3.h create mode 100644 extern/include/cryptopp/sm4.cpp create mode 100644 extern/include/cryptopp/sm4.h create mode 100644 extern/include/cryptopp/sm4_simd.cpp create mode 100644 extern/include/cryptopp/smartptr.h create mode 100644 extern/include/cryptopp/sosemanuk.cpp create mode 100644 extern/include/cryptopp/sosemanuk.h create mode 100644 extern/include/cryptopp/speck.cpp create mode 100644 extern/include/cryptopp/speck.h create mode 100644 extern/include/cryptopp/speck128_simd.cpp create mode 100644 extern/include/cryptopp/square.cpp create mode 100644 extern/include/cryptopp/square.h create mode 100644 extern/include/cryptopp/squaretb.cpp create mode 100644 extern/include/cryptopp/sse_simd.cpp create mode 100644 extern/include/cryptopp/stdcpp.h create mode 100644 extern/include/cryptopp/strciphr.cpp create mode 100644 extern/include/cryptopp/strciphr.h create mode 100644 extern/include/cryptopp/tea.cpp create mode 100644 extern/include/cryptopp/tea.h create mode 100644 extern/include/cryptopp/test.cpp create mode 100644 extern/include/cryptopp/tftables.cpp create mode 100644 extern/include/cryptopp/threefish.cpp create mode 100644 extern/include/cryptopp/threefish.h create mode 100644 extern/include/cryptopp/tiger.cpp create mode 100644 extern/include/cryptopp/tiger.h create mode 100644 extern/include/cryptopp/tigertab.cpp create mode 100644 extern/include/cryptopp/trap.h create mode 100644 extern/include/cryptopp/trunhash.h create mode 100644 extern/include/cryptopp/ttmac.cpp create mode 100644 extern/include/cryptopp/ttmac.h create mode 100644 extern/include/cryptopp/tweetnacl.cpp create mode 100644 extern/include/cryptopp/tweetnacl.h create mode 100644 extern/include/cryptopp/twofish.cpp create mode 100644 extern/include/cryptopp/twofish.h create mode 100644 extern/include/cryptopp/validat0.cpp create mode 100644 extern/include/cryptopp/validat1.cpp create mode 100644 extern/include/cryptopp/validat10.cpp create mode 100644 extern/include/cryptopp/validat2.cpp create mode 100644 extern/include/cryptopp/validat3.cpp create mode 100644 extern/include/cryptopp/validat4.cpp create mode 100644 extern/include/cryptopp/validat5.cpp create mode 100644 extern/include/cryptopp/validat6.cpp create mode 100644 extern/include/cryptopp/validat7.cpp create mode 100644 extern/include/cryptopp/validat8.cpp create mode 100644 extern/include/cryptopp/validat9.cpp create mode 100644 extern/include/cryptopp/validate.h create mode 100644 extern/include/cryptopp/vmac.cpp create mode 100644 extern/include/cryptopp/vmac.h create mode 100644 extern/include/cryptopp/vs2005.zip create mode 100644 extern/include/cryptopp/wake.cpp create mode 100644 extern/include/cryptopp/wake.h create mode 100644 extern/include/cryptopp/whrlpool.cpp create mode 100644 extern/include/cryptopp/whrlpool.h create mode 100644 extern/include/cryptopp/words.h create mode 100644 extern/include/cryptopp/x64dll.asm create mode 100644 extern/include/cryptopp/x64masm.asm create mode 100644 extern/include/cryptopp/xed25519.cpp create mode 100644 extern/include/cryptopp/xed25519.h create mode 100644 extern/include/cryptopp/xtr.cpp create mode 100644 extern/include/cryptopp/xtr.h create mode 100644 extern/include/cryptopp/xtrcrypt.cpp create mode 100644 extern/include/cryptopp/xtrcrypt.h create mode 100644 extern/include/cryptopp/xts.cpp create mode 100644 extern/include/cryptopp/xts.h create mode 100644 extern/include/cryptopp/zdeflate.cpp create mode 100644 extern/include/cryptopp/zdeflate.h create mode 100644 extern/include/cryptopp/zinflate.cpp create mode 100644 extern/include/cryptopp/zinflate.h create mode 100644 extern/include/cryptopp/zlib.cpp create mode 100644 extern/include/cryptopp/zlib.h create mode 100644 extern/include/d3d.h create mode 100644 extern/include/d3d8.h create mode 100644 extern/include/d3d8caps.h create mode 100644 extern/include/d3d8types.h create mode 100644 extern/include/d3dcaps.h create mode 100644 extern/include/d3drm.h create mode 100644 extern/include/d3dtypes.h create mode 100644 extern/include/d3dx8.h create mode 100644 extern/include/d3dx8core.h create mode 100644 extern/include/d3dx8effect.h create mode 100644 extern/include/d3dx8math.h create mode 100644 extern/include/d3dx8math.inl create mode 100644 extern/include/d3dx8mesh.h create mode 100644 extern/include/d3dx8shape.h create mode 100644 extern/include/d3dx8tex.h create mode 100644 extern/include/discord_register.h create mode 100644 extern/include/discord_rpc.h create mode 100644 extern/include/dxfile.h create mode 100644 extern/include/dxtrans.h create mode 100644 extern/include/granny.h create mode 100644 extern/include/granny2_spu_samplemodel.h create mode 100644 extern/include/il/config.h create mode 100644 extern/include/il/devil_internal_exports.h create mode 100644 extern/include/il/il.h create mode 100644 extern/include/il/il_wrap.h create mode 100644 extern/include/il/ilu.h create mode 100644 extern/include/il/ilut.h create mode 100644 extern/include/libjpeg-9a/cderror.h create mode 100644 extern/include/libjpeg-9a/cdjpeg.h create mode 100644 extern/include/libjpeg-9a/jconfig.h create mode 100644 extern/include/libjpeg-9a/jdct.h create mode 100644 extern/include/libjpeg-9a/jerror.h create mode 100644 extern/include/libjpeg-9a/jinclude.h create mode 100644 extern/include/libjpeg-9a/jmemsys.h create mode 100644 extern/include/libjpeg-9a/jmorecfg.h create mode 100644 extern/include/libjpeg-9a/jpegLibLink.h create mode 100644 extern/include/libjpeg-9a/jpegint.h create mode 100644 extern/include/libjpeg-9a/jpeglib.h create mode 100644 extern/include/libjpeg-9a/jversion.h create mode 100644 extern/include/libjpeg-9a/transupp.h create mode 100644 extern/include/lzo/lzo1.h create mode 100644 extern/include/lzo/lzo1a.h create mode 100644 extern/include/lzo/lzo1b.h create mode 100644 extern/include/lzo/lzo1c.h create mode 100644 extern/include/lzo/lzo1f.h create mode 100644 extern/include/lzo/lzo1x.h create mode 100644 extern/include/lzo/lzo1y.h create mode 100644 extern/include/lzo/lzo1z.h create mode 100644 extern/include/lzo/lzo2a.h create mode 100644 extern/include/lzo/lzoLibLink.h create mode 100644 extern/include/lzo/lzo_asm.h create mode 100644 extern/include/lzo/lzoconf.h create mode 100644 extern/include/lzo/lzodefs.h create mode 100644 extern/include/lzo/lzoutil.h create mode 100644 extern/include/qedit.h create mode 100644 extern/include/radtypes.h create mode 100644 extern/include/rapidjson/allocators.h create mode 100644 extern/include/rapidjson/document.h create mode 100644 extern/include/rapidjson/encodedstream.h create mode 100644 extern/include/rapidjson/encodings.h create mode 100644 extern/include/rapidjson/error/en.h create mode 100644 extern/include/rapidjson/error/error.h create mode 100644 extern/include/rapidjson/filereadstream.h create mode 100644 extern/include/rapidjson/filewritestream.h create mode 100644 extern/include/rapidjson/fwd.h create mode 100644 extern/include/rapidjson/internal/biginteger.h create mode 100644 extern/include/rapidjson/internal/diyfp.h create mode 100644 extern/include/rapidjson/internal/dtoa.h create mode 100644 extern/include/rapidjson/internal/ieee754.h create mode 100644 extern/include/rapidjson/internal/itoa.h create mode 100644 extern/include/rapidjson/internal/meta.h create mode 100644 extern/include/rapidjson/internal/pow10.h create mode 100644 extern/include/rapidjson/internal/regex.h create mode 100644 extern/include/rapidjson/internal/stack.h create mode 100644 extern/include/rapidjson/internal/strfunc.h create mode 100644 extern/include/rapidjson/internal/strtod.h create mode 100644 extern/include/rapidjson/internal/swap.h create mode 100644 extern/include/rapidjson/istreamwrapper.h create mode 100644 extern/include/rapidjson/memorybuffer.h create mode 100644 extern/include/rapidjson/memorystream.h create mode 100644 extern/include/rapidjson/msinttypes/inttypes.h create mode 100644 extern/include/rapidjson/msinttypes/stdint.h create mode 100644 extern/include/rapidjson/ostreamwrapper.h create mode 100644 extern/include/rapidjson/pointer.h create mode 100644 extern/include/rapidjson/prettywriter.h create mode 100644 extern/include/rapidjson/rapidjson.h create mode 100644 extern/include/rapidjson/reader.h create mode 100644 extern/include/rapidjson/schema.h create mode 100644 extern/include/rapidjson/stream.h create mode 100644 extern/include/rapidjson/stringbuffer.h create mode 100644 extern/include/rapidjson/writer.h create mode 100644 extern/library/CMakeLists.txt create mode 100644 extern/library/Cryptopp_lib_debug.lib create mode 100644 extern/library/Cryptopp_lib_release.lib create mode 100644 extern/library/DevIL.lib create mode 100644 extern/library/ILU.lib create mode 100644 extern/library/ILUT.lib create mode 100644 extern/library/SecureEngineSDK32.lib create mode 100644 extern/library/SpeedTreeRT.lib create mode 100644 extern/library/d3d8.lib create mode 100644 extern/library/d3dx8.lib create mode 100644 extern/library/ddraw.lib create mode 100644 extern/library/dmoguids.lib create mode 100644 extern/library/dxguid.lib create mode 100644 extern/library/dxtrans.lib create mode 100644 extern/library/glut.lib create mode 100644 extern/library/glut32.lib create mode 100644 extern/library/granny2.lib create mode 100644 extern/library/granny2_static.lib create mode 100644 extern/library/granny_inspector2.lib create mode 100644 extern/library/grn2gr2.lib create mode 100644 extern/library/gstate.lib create mode 100644 extern/library/il_wrap.lib create mode 100644 extern/library/libjpeg-9aMT.lib create mode 100644 extern/library/libjpeg-9aMTd.lib create mode 100644 extern/library/lzo-2.03MT.lib create mode 100644 extern/library/lzo-2.03MTd.lib create mode 100644 extern/library/lzo.lib create mode 100644 extern/library/lzo2.lib create mode 100644 extern/library/lzo2MT.lib create mode 100644 extern/library/lzo2MTd.lib create mode 100644 extern/library/mmap.lib create mode 100644 extern/library/mss32.lib create mode 100644 extern/library/python22.lib create mode 100644 extern/library/python27.lib create mode 100644 extern/library/python27_d.lib create mode 100644 extern/library/strmiids.lib create mode 100644 src/CMakeLists.txt create mode 100644 src/CWebBrowser/CMakeLists.txt create mode 100644 src/CWebBrowser/CWebBrowser.c create mode 100644 src/CWebBrowser/CWebBrowser.h create mode 100644 src/Discord/CMakeLists.txt create mode 100644 src/Discord/backoff.h create mode 100644 src/Discord/connection.h create mode 100644 src/Discord/connection_win.cpp create mode 100644 src/Discord/discord_register_win.cpp create mode 100644 src/Discord/discord_rpc.cpp create mode 100644 src/Discord/dllmain.cpp create mode 100644 src/Discord/msg_queue.h create mode 100644 src/Discord/rpc_connection.cpp create mode 100644 src/Discord/rpc_connection.h create mode 100644 src/Discord/serialization.cpp create mode 100644 src/Discord/serialization.h create mode 100644 src/EffectLib/CMakeLists.txt create mode 100644 src/EffectLib/EffectData.cpp create mode 100644 src/EffectLib/EffectData.h create mode 100644 src/EffectLib/EffectElementBase.cpp create mode 100644 src/EffectLib/EffectElementBase.h create mode 100644 src/EffectLib/EffectElementBaseInstance.cpp create mode 100644 src/EffectLib/EffectElementBaseInstance.h create mode 100644 src/EffectLib/EffectInstance.cpp create mode 100644 src/EffectLib/EffectInstance.h create mode 100644 src/EffectLib/EffectManager.cpp create mode 100644 src/EffectLib/EffectManager.h create mode 100644 src/EffectLib/EffectMesh.cpp create mode 100644 src/EffectLib/EffectMesh.h create mode 100644 src/EffectLib/EffectMeshInstance.cpp create mode 100644 src/EffectLib/EffectMeshInstance.h create mode 100644 src/EffectLib/EffectUpdateDecorator.cpp create mode 100644 src/EffectLib/EffectUpdateDecorator.h create mode 100644 src/EffectLib/EmitterProperty.cpp create mode 100644 src/EffectLib/EmitterProperty.h create mode 100644 src/EffectLib/FrameController.cpp create mode 100644 src/EffectLib/FrameController.h create mode 100644 src/EffectLib/ParticleInstance.cpp create mode 100644 src/EffectLib/ParticleInstance.h create mode 100644 src/EffectLib/ParticleProperty.cpp create mode 100644 src/EffectLib/ParticleProperty.h create mode 100644 src/EffectLib/ParticleSystemData.cpp create mode 100644 src/EffectLib/ParticleSystemData.h create mode 100644 src/EffectLib/ParticleSystemInstance.cpp create mode 100644 src/EffectLib/ParticleSystemInstance.h create mode 100644 src/EffectLib/SimpleLightData.cpp create mode 100644 src/EffectLib/SimpleLightData.h create mode 100644 src/EffectLib/SimpleLightInstance.cpp create mode 100644 src/EffectLib/SimpleLightInstance.h create mode 100644 src/EffectLib/StdAfx.cpp create mode 100644 src/EffectLib/StdAfx.h create mode 100644 src/EffectLib/Type.cpp create mode 100644 src/EffectLib/Type.h create mode 100644 src/EterBase/CMakeLists.txt create mode 100644 src/EterBase/CPostIt.cpp create mode 100644 src/EterBase/CPostIt.h create mode 100644 src/EterBase/CRC32.cpp create mode 100644 src/EterBase/CRC32.h create mode 100644 src/EterBase/Debug.cpp create mode 100644 src/EterBase/Debug.h create mode 100644 src/EterBase/FileBase.cpp create mode 100644 src/EterBase/FileBase.h create mode 100644 src/EterBase/FileDir.cpp create mode 100644 src/EterBase/FileDir.h create mode 100644 src/EterBase/FileLoader.cpp create mode 100644 src/EterBase/FileLoader.h create mode 100644 src/EterBase/Filename.h create mode 100644 src/EterBase/MappedFile.cpp create mode 100644 src/EterBase/MappedFile.h create mode 100644 src/EterBase/Poly/Base.cpp create mode 100644 src/EterBase/Poly/Base.h create mode 100644 src/EterBase/Poly/Poly.cpp create mode 100644 src/EterBase/Poly/Poly.h create mode 100644 src/EterBase/Poly/StdAfx.h create mode 100644 src/EterBase/Poly/SymTable.cpp create mode 100644 src/EterBase/Poly/SymTable.h create mode 100644 src/EterBase/Poly/Symbol.cpp create mode 100644 src/EterBase/Poly/Symbol.h create mode 100644 src/EterBase/Random.cpp create mode 100644 src/EterBase/Random.h create mode 100644 src/EterBase/ServiceDefs.h create mode 100644 src/EterBase/Singleton.h create mode 100644 src/EterBase/StdAfx.cpp create mode 100644 src/EterBase/StdAfx.h create mode 100644 src/EterBase/Stl.cpp create mode 100644 src/EterBase/Stl.h create mode 100644 src/EterBase/TempFile.cpp create mode 100644 src/EterBase/TempFile.h create mode 100644 src/EterBase/Timer.cpp create mode 100644 src/EterBase/Timer.h create mode 100644 src/EterBase/Utils.cpp create mode 100644 src/EterBase/Utils.h create mode 100644 src/EterBase/cipher.cpp create mode 100644 src/EterBase/cipher.h create mode 100644 src/EterBase/error.cpp create mode 100644 src/EterBase/error.h create mode 100644 src/EterBase/lzo.cpp create mode 100644 src/EterBase/lzo.h create mode 100644 src/EterBase/tea.cpp create mode 100644 src/EterBase/tea.h create mode 100644 src/EterBase/vk.h create mode 100644 src/EterGrnLib/CMakeLists.txt create mode 100644 src/EterGrnLib/LODController.cpp create mode 100644 src/EterGrnLib/LODController.h create mode 100644 src/EterGrnLib/Material.cpp create mode 100644 src/EterGrnLib/Material.h create mode 100644 src/EterGrnLib/Mesh.cpp create mode 100644 src/EterGrnLib/Mesh.h create mode 100644 src/EterGrnLib/Model.cpp create mode 100644 src/EterGrnLib/Model.h create mode 100644 src/EterGrnLib/ModelInstance.cpp create mode 100644 src/EterGrnLib/ModelInstance.h create mode 100644 src/EterGrnLib/ModelInstanceCollisionDetection.cpp create mode 100644 src/EterGrnLib/ModelInstanceModel.cpp create mode 100644 src/EterGrnLib/ModelInstanceMotion.cpp create mode 100644 src/EterGrnLib/ModelInstanceRender.cpp create mode 100644 src/EterGrnLib/ModelInstanceUpdate.cpp create mode 100644 src/EterGrnLib/Motion.cpp create mode 100644 src/EterGrnLib/Motion.h create mode 100644 src/EterGrnLib/StdAfx.cpp create mode 100644 src/EterGrnLib/StdAfx.h create mode 100644 src/EterGrnLib/Thing.cpp create mode 100644 src/EterGrnLib/Thing.h create mode 100644 src/EterGrnLib/ThingInstance.cpp create mode 100644 src/EterGrnLib/ThingInstance.h create mode 100644 src/EterGrnLib/Util.cpp create mode 100644 src/EterGrnLib/Util.h create mode 100644 src/EterImageLib/CMakeLists.txt create mode 100644 src/EterImageLib/DXTCImage.cpp create mode 100644 src/EterImageLib/DXTCImage.h create mode 100644 src/EterImageLib/Image.cpp create mode 100644 src/EterImageLib/Image.h create mode 100644 src/EterImageLib/StdAfx.cpp create mode 100644 src/EterImageLib/StdAfx.h create mode 100644 src/EterImageLib/TGAImage.cpp create mode 100644 src/EterImageLib/TGAImage.h create mode 100644 src/EterLib/AttributeData.cpp create mode 100644 src/EterLib/AttributeData.h create mode 100644 src/EterLib/AttributeInstance.cpp create mode 100644 src/EterLib/AttributeInstance.h create mode 100644 src/EterLib/BlockTexture.cpp create mode 100644 src/EterLib/BlockTexture.h create mode 100644 src/EterLib/CMakeLists.txt create mode 100644 src/EterLib/Camera.cpp create mode 100644 src/EterLib/Camera.h create mode 100644 src/EterLib/CollisionData.cpp create mode 100644 src/EterLib/CollisionData.h create mode 100644 src/EterLib/ColorTransitionHelper.cpp create mode 100644 src/EterLib/ColorTransitionHelper.h create mode 100644 src/EterLib/CullingManager.cpp create mode 100644 src/EterLib/CullingManager.h create mode 100644 src/EterLib/Decal.cpp create mode 100644 src/EterLib/Decal.h create mode 100644 src/EterLib/DibBar.cpp create mode 100644 src/EterLib/DibBar.h create mode 100644 src/EterLib/Dimm.h create mode 100644 src/EterLib/Dynamic.h create mode 100644 src/EterLib/EnvironmentMap.cpp create mode 100644 src/EterLib/EnvironmentMap.h create mode 100644 src/EterLib/Event.h create mode 100644 src/EterLib/FileLoaderThread.cpp create mode 100644 src/EterLib/FileLoaderThread.h create mode 100644 src/EterLib/FuncObject.h create mode 100644 src/EterLib/GrpBase.cpp create mode 100644 src/EterLib/GrpBase.h create mode 100644 src/EterLib/GrpCollisionObject.cpp create mode 100644 src/EterLib/GrpCollisionObject.h create mode 100644 src/EterLib/GrpColor.cpp create mode 100644 src/EterLib/GrpColor.h create mode 100644 src/EterLib/GrpColorInstance.cpp create mode 100644 src/EterLib/GrpColorInstance.h create mode 100644 src/EterLib/GrpD3DXBuffer.cpp create mode 100644 src/EterLib/GrpD3DXBuffer.h create mode 100644 src/EterLib/GrpDIB.cpp create mode 100644 src/EterLib/GrpDIB.h create mode 100644 src/EterLib/GrpDetector.cpp create mode 100644 src/EterLib/GrpDetector.h create mode 100644 src/EterLib/GrpDevice.cpp create mode 100644 src/EterLib/GrpDevice.h create mode 100644 src/EterLib/GrpExpandedImageInstance.cpp create mode 100644 src/EterLib/GrpExpandedImageInstance.h create mode 100644 src/EterLib/GrpFontTexture.cpp create mode 100644 src/EterLib/GrpFontTexture.h create mode 100644 src/EterLib/GrpImage.cpp create mode 100644 src/EterLib/GrpImage.h create mode 100644 src/EterLib/GrpImageInstance.cpp create mode 100644 src/EterLib/GrpImageInstance.h create mode 100644 src/EterLib/GrpImageTexture.cpp create mode 100644 src/EterLib/GrpImageTexture.h create mode 100644 src/EterLib/GrpIndexBuffer.cpp create mode 100644 src/EterLib/GrpIndexBuffer.h create mode 100644 src/EterLib/GrpLightManager.cpp create mode 100644 src/EterLib/GrpLightManager.h create mode 100644 src/EterLib/GrpMarkInstance.cpp create mode 100644 src/EterLib/GrpMarkInstance.h create mode 100644 src/EterLib/GrpMath.cpp create mode 100644 src/EterLib/GrpMath.h create mode 100644 src/EterLib/GrpObjectInstance.cpp create mode 100644 src/EterLib/GrpObjectInstance.h create mode 100644 src/EterLib/GrpPixelShader.cpp create mode 100644 src/EterLib/GrpPixelShader.h create mode 100644 src/EterLib/GrpRatioInstance.cpp create mode 100644 src/EterLib/GrpRatioInstance.h create mode 100644 src/EterLib/GrpScreen.cpp create mode 100644 src/EterLib/GrpScreen.h create mode 100644 src/EterLib/GrpShadowTexture.cpp create mode 100644 src/EterLib/GrpShadowTexture.h create mode 100644 src/EterLib/GrpSubImage.cpp create mode 100644 src/EterLib/GrpSubImage.h create mode 100644 src/EterLib/GrpText.cpp create mode 100644 src/EterLib/GrpText.h create mode 100644 src/EterLib/GrpTextInstance.cpp create mode 100644 src/EterLib/GrpTextInstance.h create mode 100644 src/EterLib/GrpTexture.cpp create mode 100644 src/EterLib/GrpTexture.h create mode 100644 src/EterLib/GrpVertexBuffer.cpp create mode 100644 src/EterLib/GrpVertexBuffer.h create mode 100644 src/EterLib/GrpVertexBufferDynamic.cpp create mode 100644 src/EterLib/GrpVertexBufferDynamic.h create mode 100644 src/EterLib/GrpVertexBufferStatic.cpp create mode 100644 src/EterLib/GrpVertexBufferStatic.h create mode 100644 src/EterLib/GrpVertexShader.cpp create mode 100644 src/EterLib/GrpVertexShader.h create mode 100644 src/EterLib/IME.cpp create mode 100644 src/EterLib/IME.h create mode 100644 src/EterLib/Input.cpp create mode 100644 src/EterLib/Input.h create mode 100644 src/EterLib/JpegFile.cpp create mode 100644 src/EterLib/JpegFile.h create mode 100644 src/EterLib/LensFlare.cpp create mode 100644 src/EterLib/LensFlare.h create mode 100644 src/EterLib/MSApplication.cpp create mode 100644 src/EterLib/MSApplication.h create mode 100644 src/EterLib/MSWindow.cpp create mode 100644 src/EterLib/MSWindow.h create mode 100644 src/EterLib/Mutex.cpp create mode 100644 src/EterLib/Mutex.h create mode 100644 src/EterLib/NetAddress.cpp create mode 100644 src/EterLib/NetAddress.h create mode 100644 src/EterLib/NetDatagram.cpp create mode 100644 src/EterLib/NetDatagram.h create mode 100644 src/EterLib/NetDatagramReceiver.cpp create mode 100644 src/EterLib/NetDatagramReceiver.h create mode 100644 src/EterLib/NetDatagramSender.cpp create mode 100644 src/EterLib/NetDatagramSender.h create mode 100644 src/EterLib/NetDevice.cpp create mode 100644 src/EterLib/NetDevice.h create mode 100644 src/EterLib/NetPacketHeaderMap.cpp create mode 100644 src/EterLib/NetPacketHeaderMap.h create mode 100644 src/EterLib/NetStream.cpp create mode 100644 src/EterLib/NetStream.h create mode 100644 src/EterLib/PathStack.cpp create mode 100644 src/EterLib/PathStack.h create mode 100644 src/EterLib/Pool.h create mode 100644 src/EterLib/Profiler.h create mode 100644 src/EterLib/Ray.h create mode 100644 src/EterLib/Ref.h create mode 100644 src/EterLib/ReferenceObject.cpp create mode 100644 src/EterLib/ReferenceObject.h create mode 100644 src/EterLib/Resource.cpp create mode 100644 src/EterLib/Resource.h create mode 100644 src/EterLib/ResourceManager.cpp create mode 100644 src/EterLib/ResourceManager.h create mode 100644 src/EterLib/ScreenFilter.cpp create mode 100644 src/EterLib/ScreenFilter.h create mode 100644 src/EterLib/SkyBox.cpp create mode 100644 src/EterLib/SkyBox.h create mode 100644 src/EterLib/StateManager.cpp create mode 100644 src/EterLib/StateManager.h create mode 100644 src/EterLib/StdAfx.cpp create mode 100644 src/EterLib/StdAfx.h create mode 100644 src/EterLib/TargaResource.cpp create mode 100644 src/EterLib/TargaResource.h create mode 100644 src/EterLib/TextBar.cpp create mode 100644 src/EterLib/TextBar.h create mode 100644 src/EterLib/TextFileLoader.cpp create mode 100644 src/EterLib/TextFileLoader.h create mode 100644 src/EterLib/TextTag.cpp create mode 100644 src/EterLib/TextTag.h create mode 100644 src/EterLib/Thread.cpp create mode 100644 src/EterLib/Thread.h create mode 100644 src/EterLib/Util.cpp create mode 100644 src/EterLib/Util.h create mode 100644 src/EterLib/lineintersect_utils.cpp create mode 100644 src/EterLib/lineintersect_utils.h create mode 100644 src/EterLib/msctf.h create mode 100644 src/EterLib/parser.cpp create mode 100644 src/EterLib/parser.h create mode 100644 src/EterLocale/Arabic.cpp create mode 100644 src/EterLocale/Arabic.h create mode 100644 src/EterLocale/CMakeLists.txt create mode 100644 src/EterLocale/CodePageId.h create mode 100644 src/EterLocale/Japanese.cpp create mode 100644 src/EterLocale/Japanese.h create mode 100644 src/EterLocale/StdAfx.cpp create mode 100644 src/EterLocale/StdAfx.h create mode 100644 src/EterLocale/StringCodec.cpp create mode 100644 src/EterLocale/StringCodec.h create mode 100644 src/EterLocale/StringCodec_Vietnamese.cpp create mode 100644 src/EterLocale/StringCodec_Vietnamese.h create mode 100644 src/EterPack/CMakeLists.txt create mode 100644 src/EterPack/EterPack.cpp create mode 100644 src/EterPack/EterPack.h create mode 100644 src/EterPack/EterPackCursor.cpp create mode 100644 src/EterPack/EterPackCursor.h create mode 100644 src/EterPack/EterPackManager.cpp create mode 100644 src/EterPack/EterPackManager.h create mode 100644 src/EterPack/EterPackPolicy_CSHybridCrypt.cpp create mode 100644 src/EterPack/EterPackPolicy_CSHybridCrypt.h create mode 100644 src/EterPack/Inline.h create mode 100644 src/EterPack/StdAfx.cpp create mode 100644 src/EterPack/StdAfx.h create mode 100644 src/EterPack/md5.c create mode 100644 src/EterPack/md5.h create mode 100644 src/EterPythonLib/CMakeLists.txt create mode 100644 src/EterPythonLib/PythonGraphic.cpp create mode 100644 src/EterPythonLib/PythonGraphic.h create mode 100644 src/EterPythonLib/PythonGraphicImageModule.cpp create mode 100644 src/EterPythonLib/PythonGraphicModule.cpp create mode 100644 src/EterPythonLib/PythonGraphicTextModule.cpp create mode 100644 src/EterPythonLib/PythonGraphicThingModule.cpp create mode 100644 src/EterPythonLib/PythonGridSlotWindow.cpp create mode 100644 src/EterPythonLib/PythonGridSlotWindow.h create mode 100644 src/EterPythonLib/PythonSlotWindow.cpp create mode 100644 src/EterPythonLib/PythonSlotWindow.h create mode 100644 src/EterPythonLib/PythonWindow.cpp create mode 100644 src/EterPythonLib/PythonWindow.h create mode 100644 src/EterPythonLib/PythonWindowManager.cpp create mode 100644 src/EterPythonLib/PythonWindowManager.h create mode 100644 src/EterPythonLib/PythonWindowManagerModule.cpp create mode 100644 src/EterPythonLib/StdAfx.cpp create mode 100644 src/EterPythonLib/StdAfx.h create mode 100644 src/GameLib/ActorInstance.cpp create mode 100644 src/GameLib/ActorInstance.h create mode 100644 src/GameLib/ActorInstanceAttach.cpp create mode 100644 src/GameLib/ActorInstanceBattle.cpp create mode 100644 src/GameLib/ActorInstanceBlend.cpp create mode 100644 src/GameLib/ActorInstanceCollisionDetection.cpp create mode 100644 src/GameLib/ActorInstanceData.cpp create mode 100644 src/GameLib/ActorInstanceEvent.cpp create mode 100644 src/GameLib/ActorInstanceFly.cpp create mode 100644 src/GameLib/ActorInstanceInterface.h create mode 100644 src/GameLib/ActorInstanceMotion.cpp create mode 100644 src/GameLib/ActorInstanceMotionEvent.cpp create mode 100644 src/GameLib/ActorInstancePosition.cpp create mode 100644 src/GameLib/ActorInstanceRender.cpp create mode 100644 src/GameLib/ActorInstanceRotation.cpp create mode 100644 src/GameLib/ActorInstanceSync.cpp create mode 100644 src/GameLib/ActorInstanceWeaponTrace.cpp create mode 100644 src/GameLib/Area.cpp create mode 100644 src/GameLib/Area.h create mode 100644 src/GameLib/AreaLoaderThread.cpp create mode 100644 src/GameLib/AreaLoaderThread.h create mode 100644 src/GameLib/AreaTerrain.cpp create mode 100644 src/GameLib/AreaTerrain.h create mode 100644 src/GameLib/CMakeLists.txt create mode 100644 src/GameLib/DungeonBlock.cpp create mode 100644 src/GameLib/DungeonBlock.h create mode 100644 src/GameLib/FlyHandler.h create mode 100644 src/GameLib/FlyTarget.cpp create mode 100644 src/GameLib/FlyTarget.h create mode 100644 src/GameLib/FlyTrace.cpp create mode 100644 src/GameLib/FlyTrace.h create mode 100644 src/GameLib/FlyingData.cpp create mode 100644 src/GameLib/FlyingData.h create mode 100644 src/GameLib/FlyingInstance.cpp create mode 100644 src/GameLib/FlyingInstance.h create mode 100644 src/GameLib/FlyingObjectManager.cpp create mode 100644 src/GameLib/FlyingObjectManager.h create mode 100644 src/GameLib/GameEventManager.cpp create mode 100644 src/GameLib/GameEventManager.h create mode 100644 src/GameLib/GameType.cpp create mode 100644 src/GameLib/GameType.h create mode 100644 src/GameLib/GameUtil.cpp create mode 100644 src/GameLib/GameUtil.h create mode 100644 src/GameLib/Interface.h create mode 100644 src/GameLib/ItemData.cpp create mode 100644 src/GameLib/ItemData.h create mode 100644 src/GameLib/ItemManager.cpp create mode 100644 src/GameLib/ItemManager.h create mode 100644 src/GameLib/MapBase.cpp create mode 100644 src/GameLib/MapBase.h create mode 100644 src/GameLib/MapManager.cpp create mode 100644 src/GameLib/MapManager.h create mode 100644 src/GameLib/MapOutdoor.cpp create mode 100644 src/GameLib/MapOutdoor.h create mode 100644 src/GameLib/MapOutdoorCharacterShadow.cpp create mode 100644 src/GameLib/MapOutdoorIndexBuffer.cpp create mode 100644 src/GameLib/MapOutdoorLoad.cpp create mode 100644 src/GameLib/MapOutdoorQuadtree.cpp create mode 100644 src/GameLib/MapOutdoorRender.cpp create mode 100644 src/GameLib/MapOutdoorRenderHTP.cpp create mode 100644 src/GameLib/MapOutdoorRenderSTP.cpp create mode 100644 src/GameLib/MapOutdoorUpdate.cpp create mode 100644 src/GameLib/MapOutdoorWater.cpp create mode 100644 src/GameLib/MapType.cpp create mode 100644 src/GameLib/MapType.h create mode 100644 src/GameLib/MapUtil.cpp create mode 100644 src/GameLib/MapUtil.h create mode 100644 src/GameLib/MonsterAreaInfo.cpp create mode 100644 src/GameLib/MonsterAreaInfo.h create mode 100644 src/GameLib/PhysicsObject.cpp create mode 100644 src/GameLib/PhysicsObject.h create mode 100644 src/GameLib/Property.cpp create mode 100644 src/GameLib/Property.h create mode 100644 src/GameLib/PropertyLoader.cpp create mode 100644 src/GameLib/PropertyLoader.h create mode 100644 src/GameLib/PropertyManager.cpp create mode 100644 src/GameLib/PropertyManager.h create mode 100644 src/GameLib/RaceData.cpp create mode 100644 src/GameLib/RaceData.h create mode 100644 src/GameLib/RaceDataFile.cpp create mode 100644 src/GameLib/RaceManager.cpp create mode 100644 src/GameLib/RaceManager.h create mode 100644 src/GameLib/RaceMotionData.cpp create mode 100644 src/GameLib/RaceMotionData.h create mode 100644 src/GameLib/RaceMotionDataEvent.h create mode 100644 src/GameLib/SnowEnvironment.cpp create mode 100644 src/GameLib/SnowEnvironment.h create mode 100644 src/GameLib/SnowParticle.cpp create mode 100644 src/GameLib/SnowParticle.h create mode 100644 src/GameLib/StdAfx.cpp create mode 100644 src/GameLib/StdAfx.h create mode 100644 src/GameLib/TerrainDecal.cpp create mode 100644 src/GameLib/TerrainDecal.h create mode 100644 src/GameLib/TerrainPatch.cpp create mode 100644 src/GameLib/TerrainPatch.h create mode 100644 src/GameLib/TerrainQuadtree.cpp create mode 100644 src/GameLib/TerrainQuadtree.h create mode 100644 src/GameLib/WeaponTrace.cpp create mode 100644 src/GameLib/WeaponTrace.h create mode 100644 src/MilesLib/CMakeLists.txt create mode 100644 src/MilesLib/SoundBase.cpp create mode 100644 src/MilesLib/SoundBase.h create mode 100644 src/MilesLib/SoundData.cpp create mode 100644 src/MilesLib/SoundData.h create mode 100644 src/MilesLib/SoundInstance.h create mode 100644 src/MilesLib/SoundInstance2D.cpp create mode 100644 src/MilesLib/SoundInstance3D.cpp create mode 100644 src/MilesLib/SoundInstanceStream.cpp create mode 100644 src/MilesLib/SoundManager.cpp create mode 100644 src/MilesLib/SoundManager.h create mode 100644 src/MilesLib/SoundManager2D.cpp create mode 100644 src/MilesLib/SoundManager2D.h create mode 100644 src/MilesLib/SoundManager3D.cpp create mode 100644 src/MilesLib/SoundManager3D.h create mode 100644 src/MilesLib/SoundManagerStream.cpp create mode 100644 src/MilesLib/SoundManagerStream.h create mode 100644 src/MilesLib/Stdafx.cpp create mode 100644 src/MilesLib/Stdafx.h create mode 100644 src/MilesLib/Type.cpp create mode 100644 src/MilesLib/Type.h create mode 100644 src/PRTerrainLib/CMakeLists.txt create mode 100644 src/PRTerrainLib/StdAfx.cpp create mode 100644 src/PRTerrainLib/StdAfx.h create mode 100644 src/PRTerrainLib/Terrain.cpp create mode 100644 src/PRTerrainLib/Terrain.h create mode 100644 src/PRTerrainLib/TerrainType.h create mode 100644 src/PRTerrainLib/TextureSet.cpp create mode 100644 src/PRTerrainLib/TextureSet.h create mode 100644 src/ScriptLib/CMakeLists.txt create mode 100644 src/ScriptLib/PythonDebugModule.cpp create mode 100644 src/ScriptLib/PythonDebugModule.h create mode 100644 src/ScriptLib/PythonLauncher.cpp create mode 100644 src/ScriptLib/PythonLauncher.h create mode 100644 src/ScriptLib/PythonMarshal.cpp create mode 100644 src/ScriptLib/PythonMarshal.h create mode 100644 src/ScriptLib/PythonUtils.cpp create mode 100644 src/ScriptLib/PythonUtils.h create mode 100644 src/ScriptLib/Resource.cpp create mode 100644 src/ScriptLib/Resource.h create mode 100644 src/ScriptLib/StdAfx.cpp create mode 100644 src/ScriptLib/StdAfx.h create mode 100644 src/SpeedTreeLib/BoundaryShapeManager.cpp create mode 100644 src/SpeedTreeLib/BoundaryShapeManager.h create mode 100644 src/SpeedTreeLib/CMakeLists.txt create mode 100644 src/SpeedTreeLib/Constants.h create mode 100644 src/SpeedTreeLib/SpeedGrassRT.cpp create mode 100644 src/SpeedTreeLib/SpeedGrassRT.h create mode 100644 src/SpeedTreeLib/SpeedGrassWrapper.cpp create mode 100644 src/SpeedTreeLib/SpeedGrassWrapper.h create mode 100644 src/SpeedTreeLib/SpeedTreeConfig.h create mode 100644 src/SpeedTreeLib/SpeedTreeForest.cpp create mode 100644 src/SpeedTreeLib/SpeedTreeForest.h create mode 100644 src/SpeedTreeLib/SpeedTreeForestDirectX8.cpp create mode 100644 src/SpeedTreeLib/SpeedTreeForestDirectX8.h create mode 100644 src/SpeedTreeLib/SpeedTreeMaterial.h create mode 100644 src/SpeedTreeLib/SpeedTreeWrapper.cpp create mode 100644 src/SpeedTreeLib/SpeedTreeWrapper.h create mode 100644 src/SpeedTreeLib/StdAfx.cpp create mode 100644 src/SpeedTreeLib/StdAfx.h create mode 100644 src/SpeedTreeLib/VertexShaders.h create mode 100644 src/SphereLib/CMakeLists.txt create mode 100644 src/SphereLib/StdAfx.cpp create mode 100644 src/SphereLib/StdAfx.h create mode 100644 src/SphereLib/frustum.cpp create mode 100644 src/SphereLib/frustum.h create mode 100644 src/SphereLib/pool.h create mode 100644 src/SphereLib/sphere.cpp create mode 100644 src/SphereLib/sphere.h create mode 100644 src/SphereLib/spherepack.cpp create mode 100644 src/SphereLib/spherepack.h create mode 100644 src/SphereLib/vector.h create mode 100644 src/UserInterface/AbstractApplication.h create mode 100644 src/UserInterface/AbstractCharacterManager.h create mode 100644 src/UserInterface/AbstractChat.h create mode 100644 src/UserInterface/AbstractPlayer.h create mode 100644 src/UserInterface/AbstractSingleton.h create mode 100644 src/UserInterface/AccountConnector.cpp create mode 100644 src/UserInterface/AccountConnector.h create mode 100644 src/UserInterface/AffectFlagContainer.cpp create mode 100644 src/UserInterface/AffectFlagContainer.h create mode 100644 src/UserInterface/CMakeLists.txt create mode 100644 src/UserInterface/CameraProcedure.cpp create mode 100644 src/UserInterface/CheckLatestFiles.cpp create mode 100644 src/UserInterface/CheckLatestFiles.h create mode 100644 src/UserInterface/Cursors/cursor.cur create mode 100644 src/UserInterface/Cursors/cursor_attack.cur create mode 100644 src/UserInterface/Cursors/cursor_buy.cur create mode 100644 src/UserInterface/Cursors/cursor_camera_rotate.cur create mode 100644 src/UserInterface/Cursors/cursor_chair.cur create mode 100644 src/UserInterface/Cursors/cursor_door.cur create mode 100644 src/UserInterface/Cursors/cursor_hsize.cur create mode 100644 src/UserInterface/Cursors/cursor_hvsize.cur create mode 100644 src/UserInterface/Cursors/cursor_no.cur create mode 100644 src/UserInterface/Cursors/cursor_pick.cur create mode 100644 src/UserInterface/Cursors/cursor_sell.cur create mode 100644 src/UserInterface/Cursors/cursor_talk.cur create mode 100644 src/UserInterface/Cursors/cursor_vsize.cur create mode 100644 src/UserInterface/Discord.h create mode 100644 src/UserInterface/GameType.cpp create mode 100644 src/UserInterface/GameType.h create mode 100644 src/UserInterface/GuildMarkDownloader.cpp create mode 100644 src/UserInterface/GuildMarkDownloader.h create mode 100644 src/UserInterface/GuildMarkUploader.cpp create mode 100644 src/UserInterface/GuildMarkUploader.h create mode 100644 src/UserInterface/HackShield.cpp create mode 100644 src/UserInterface/Hackshield.h create mode 100644 src/UserInterface/HackshieldLicense.h create mode 100644 src/UserInterface/HackshieldLicense_metin2.h create mode 100644 src/UserInterface/HackshieldLicense_metin2client.h create mode 100644 src/UserInterface/InstanceBase.cpp create mode 100644 src/UserInterface/InstanceBase.h create mode 100644 src/UserInterface/InstanceBaseBattle.cpp create mode 100644 src/UserInterface/InstanceBaseEffect.cpp create mode 100644 src/UserInterface/InstanceBaseEvent.cpp create mode 100644 src/UserInterface/InstanceBaseMotion.cpp create mode 100644 src/UserInterface/InstanceBaseMovement.cpp create mode 100644 src/UserInterface/InstanceBaseTransform.cpp create mode 100644 src/UserInterface/InsultChecker.cpp create mode 100644 src/UserInterface/InsultChecker.h create mode 100644 src/UserInterface/Locale.cpp create mode 100644 src/UserInterface/Locale.h create mode 100644 src/UserInterface/Locale_inc.h create mode 100644 src/UserInterface/Locale_inc_BR.h create mode 100644 src/UserInterface/Locale_inc_CA.h create mode 100644 src/UserInterface/Locale_inc_EU.h create mode 100644 src/UserInterface/Locale_inc_EU2.h create mode 100644 src/UserInterface/Locale_inc_GB.h create mode 100644 src/UserInterface/Locale_inc_HK.h create mode 100644 src/UserInterface/Locale_inc_JP.h create mode 100644 src/UserInterface/Locale_inc_KO.h create mode 100644 src/UserInterface/Locale_inc_KO_DEV.h create mode 100644 src/UserInterface/Locale_inc_NEWCIBN.h create mode 100644 src/UserInterface/Locale_inc_SG.h create mode 100644 src/UserInterface/Locale_inc_VI.h create mode 100644 src/UserInterface/Locale_inc_dev.h create mode 100644 src/UserInterface/MarkImage.cpp create mode 100644 src/UserInterface/MarkImage.h create mode 100644 src/UserInterface/MarkManager.cpp create mode 100644 src/UserInterface/MarkManager.h create mode 100644 src/UserInterface/MovieMan.cpp create mode 100644 src/UserInterface/MovieMan.h create mode 100644 src/UserInterface/NProtectGameGuard.cpp create mode 100644 src/UserInterface/NProtectGameGuard.h create mode 100644 src/UserInterface/NetworkActorManager.cpp create mode 100644 src/UserInterface/NetworkActorManager.h create mode 100644 src/UserInterface/Packet.h create mode 100644 src/UserInterface/ProcessCRC.cpp create mode 100644 src/UserInterface/ProcessCRC.h create mode 100644 src/UserInterface/ProcessScanner.cpp create mode 100644 src/UserInterface/ProcessScanner.h create mode 100644 src/UserInterface/PythonApplication.cpp create mode 100644 src/UserInterface/PythonApplication.h create mode 100644 src/UserInterface/PythonApplicationCamera.cpp create mode 100644 src/UserInterface/PythonApplicationCursor.cpp create mode 100644 src/UserInterface/PythonApplicationEvent.cpp create mode 100644 src/UserInterface/PythonApplicationLogo.cpp create mode 100644 src/UserInterface/PythonApplicationModule.cpp create mode 100644 src/UserInterface/PythonApplicationProcedure.cpp create mode 100644 src/UserInterface/PythonApplicationWebPage.cpp create mode 100644 src/UserInterface/PythonBackground.cpp create mode 100644 src/UserInterface/PythonBackground.h create mode 100644 src/UserInterface/PythonBackgroundModule.cpp create mode 100644 src/UserInterface/PythonCharacterManager.cpp create mode 100644 src/UserInterface/PythonCharacterManager.h create mode 100644 src/UserInterface/PythonCharacterManagerModule.cpp create mode 100644 src/UserInterface/PythonCharacterModule.cpp create mode 100644 src/UserInterface/PythonChat.cpp create mode 100644 src/UserInterface/PythonChat.h create mode 100644 src/UserInterface/PythonChatModule.cpp create mode 100644 src/UserInterface/PythonEffectModule.cpp create mode 100644 src/UserInterface/PythonEventManager.cpp create mode 100644 src/UserInterface/PythonEventManager.h create mode 100644 src/UserInterface/PythonEventManagerMoudle.cpp create mode 100644 src/UserInterface/PythonExceptionSender.cpp create mode 100644 src/UserInterface/PythonExceptionSender.h create mode 100644 src/UserInterface/PythonExchange.cpp create mode 100644 src/UserInterface/PythonExchange.h create mode 100644 src/UserInterface/PythonExchangeModule.cpp create mode 100644 src/UserInterface/PythonFlyModule.cpp create mode 100644 src/UserInterface/PythonGameEventManagerModule.cpp create mode 100644 src/UserInterface/PythonGuild.cpp create mode 100644 src/UserInterface/PythonGuild.h create mode 100644 src/UserInterface/PythonIME.cpp create mode 100644 src/UserInterface/PythonIME.h create mode 100644 src/UserInterface/PythonIMEModule.cpp create mode 100644 src/UserInterface/PythonItem.cpp create mode 100644 src/UserInterface/PythonItem.h create mode 100644 src/UserInterface/PythonItemModule.cpp create mode 100644 src/UserInterface/PythonMessenger.cpp create mode 100644 src/UserInterface/PythonMessenger.h create mode 100644 src/UserInterface/PythonMiniMap.cpp create mode 100644 src/UserInterface/PythonMiniMap.h create mode 100644 src/UserInterface/PythonMiniMapModule.cpp create mode 100644 src/UserInterface/PythonNetworkDatagram.cpp create mode 100644 src/UserInterface/PythonNetworkDatagram.h create mode 100644 src/UserInterface/PythonNetworkDatagramModule.cpp create mode 100644 src/UserInterface/PythonNetworkStream.cpp create mode 100644 src/UserInterface/PythonNetworkStream.h create mode 100644 src/UserInterface/PythonNetworkStreamCommand.cpp create mode 100644 src/UserInterface/PythonNetworkStreamEvent.cpp create mode 100644 src/UserInterface/PythonNetworkStreamModule.cpp create mode 100644 src/UserInterface/PythonNetworkStreamPhaseGame.cpp create mode 100644 src/UserInterface/PythonNetworkStreamPhaseGameActor.cpp create mode 100644 src/UserInterface/PythonNetworkStreamPhaseGameItem.cpp create mode 100644 src/UserInterface/PythonNetworkStreamPhaseHandShake.cpp create mode 100644 src/UserInterface/PythonNetworkStreamPhaseLoading.cpp create mode 100644 src/UserInterface/PythonNetworkStreamPhaseLogin.cpp create mode 100644 src/UserInterface/PythonNetworkStreamPhaseOffline.cpp create mode 100644 src/UserInterface/PythonNetworkStreamPhaseSelect.cpp create mode 100644 src/UserInterface/PythonNonPlayer.cpp create mode 100644 src/UserInterface/PythonNonPlayer.h create mode 100644 src/UserInterface/PythonNonPlayerModule.cpp create mode 100644 src/UserInterface/PythonPackModule.cpp create mode 100644 src/UserInterface/PythonPlayer.cpp create mode 100644 src/UserInterface/PythonPlayer.h create mode 100644 src/UserInterface/PythonPlayerEventHandler.cpp create mode 100644 src/UserInterface/PythonPlayerEventHandler.h create mode 100644 src/UserInterface/PythonPlayerInput.cpp create mode 100644 src/UserInterface/PythonPlayerInputKeyboard.cpp create mode 100644 src/UserInterface/PythonPlayerInputMouse.cpp create mode 100644 src/UserInterface/PythonPlayerModule.cpp create mode 100644 src/UserInterface/PythonPlayerSkill.cpp create mode 100644 src/UserInterface/PythonProfilerModule.cpp create mode 100644 src/UserInterface/PythonQuest.cpp create mode 100644 src/UserInterface/PythonQuest.h create mode 100644 src/UserInterface/PythonSafeBox.cpp create mode 100644 src/UserInterface/PythonSafeBox.h create mode 100644 src/UserInterface/PythonShop.cpp create mode 100644 src/UserInterface/PythonShop.h create mode 100644 src/UserInterface/PythonSkill.cpp create mode 100644 src/UserInterface/PythonSkill.h create mode 100644 src/UserInterface/PythonSoundManagerModule.cpp create mode 100644 src/UserInterface/PythonSystem.cpp create mode 100644 src/UserInterface/PythonSystem.h create mode 100644 src/UserInterface/PythonSystemModule.cpp create mode 100644 src/UserInterface/PythonTextTail.cpp create mode 100644 src/UserInterface/PythonTextTail.h create mode 100644 src/UserInterface/PythonTextTailModule.cpp create mode 100644 src/UserInterface/ServerStateChecker.cpp create mode 100644 src/UserInterface/ServerStateChecker.h create mode 100644 src/UserInterface/ServerStateCheckerModule.cpp create mode 100644 src/UserInterface/StdAfx.cpp create mode 100644 src/UserInterface/StdAfx.h create mode 100644 src/UserInterface/Test.h create mode 100644 src/UserInterface/UserInterface.aps create mode 100644 src/UserInterface/UserInterface.cpp create mode 100644 src/UserInterface/UserInterface.rc create mode 100644 src/UserInterface/Version.h create mode 100644 src/UserInterface/Version.py create mode 100644 src/UserInterface/WiseLogicXTrap.cpp create mode 100644 src/UserInterface/WiseLogicXTrap.h create mode 100644 src/UserInterface/metin2.ico create mode 100644 src/UserInterface/resource.h create mode 100644 vendor/CMakeLists.txt diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..5c4bd94 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +*.lib filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4fcb459 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +build diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..a0b8038 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,55 @@ +cmake_minimum_required(VERSION 3.19) + +project(m2dev-client-src) + +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +if (MSVC) + add_compile_options("/Zc:__cplusplus") + add_compile_options("/Zc:preprocessor") +endif() + +set(CMAKE_MODULE_PATH + ${CMAKE_MODULE_PATH} + "${CMAKE_CURRENT_SOURCE_DIR}/buildtool" +) + +include(Utils) + +set(CMAKE_CONFIGURATION_TYPES "Debug;RelWithDebInfo;Release" CACHE STRING "Configurations" FORCE) +set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$<$:ProgramDatabase>") + +set_property(GLOBAL PROPERTY USE_FOLDERS ON) +set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") +set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Zi") +set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /DEBUG") + +add_compile_options("$<$:/utf-8>") +add_compile_options(/MP) + +add_compile_options( + $<$:/wd4828> + $<$:/wd4996> +) + +add_definitions(-DNOMINMAX) +add_definitions(-D_CRT_SECURE_NO_WARNINGS) +add_definitions(-DWINDOWS_IGNORE_PACKING_MISMATCH) + +add_definitions(-DUSE_LOD) +add_definitions(-DDUNGEON_WORK) +add_definitions(-DBUILDING_GRANNY_STATIC) +add_definitions(-DGRANNY_THREADED) + +add_compile_definitions("$<$:DEBUG>") +add_compile_definitions("$<$:_DISTRIBUTE>") +add_compile_definitions("$<$:_DISTRIBUTE>") + +include_directories("src") +include_directories("extern/include") + +# Add subdirectories for libraries and executables +add_subdirectory(vendor) +add_subdirectory(src) +add_subdirectory(extern) \ No newline at end of file diff --git a/buildtool/Utils.cmake b/buildtool/Utils.cmake new file mode 100644 index 0000000..589072f --- /dev/null +++ b/buildtool/Utils.cmake @@ -0,0 +1,25 @@ +function(GroupSourcesByFolder target) + set(SOURCE_GROUP_DELIMITER "/") + set(last_dir "") + set(files "") + + get_target_property(sources ${target} SOURCES) + + foreach(file ${sources}) + # Get the relative path of the file from the current CMake source directory + file(RELATIVE_PATH relative_file "${CMAKE_CURRENT_SOURCE_DIR}" ${file}) + get_filename_component(dir "${relative_file}" PATH) + if(NOT "${dir}" STREQUAL "${last_dir}") + if(files) + source_group("${last_dir}" FILES ${files}) + endif() + set(files "") + endif() + set(files ${files} ${file}) + set(last_dir "${dir}") + endforeach() + + if(files) + source_group("${last_dir}" FILES ${files}) + endif() +endfunction() \ No newline at end of file diff --git a/extern/CMakeLists.txt b/extern/CMakeLists.txt new file mode 100644 index 0000000..b2a6737 --- /dev/null +++ b/extern/CMakeLists.txt @@ -0,0 +1 @@ +add_subdirectory(library) \ No newline at end of file diff --git a/extern/include/MSS.H b/extern/include/MSS.H new file mode 100644 index 0000000..2bcab93 --- /dev/null +++ b/extern/include/MSS.H @@ -0,0 +1,4855 @@ +//############################################################################ +//## ## +//## Miles Sound System ## +//## ## +//## MSS.H: Miles Sound System main header file ## +//## ## +//## Version 1.00 of 15-Feb-95: Initial, derived from AIL.H V3.02 ## +//## 1.01 of 19-Jun-95: Added various functions for V3.03 release ## +//## 1.02 of 22-Nov-95: C++ typedef problem fixed, declspecs added ## +//## 1.03 of 15-Feb-96: Changes for 16 bit callbacks and multiple ## +//## 16 bit DLL loads (JKR) ## +//## 1.04 of 2-Nov-97: Changes made to handle DLS in future ## +//## versions ## +//## 1.05 of 1-Jan-98: Massive changes for version 4.0 ## +//## 1.06 of 17-Sep-98: Massive changes for version 5.0 ## +//## 1.07 of 2-Feb-99: Changes for new input API ## +//## 1.08 of 8-Feb-99: Changes for new filter helper functions ## +//## ## +//## Author: John Miles ## +//## ## +//############################################################################ +//## ## +//## Contact RAD Game Tools at 425-893-4300 for technical support. ## +//## ## +//############################################################################ + +#ifndef MSS_VERSION + +#define MSS_VERSION "6.5c" +#define MSS_MAJOR_VERSION 6 +#define MSS_MINOR_VERSION 5 +#define MSS_SUB_VERSION 2 +#define MSS_VERSION_DATE "19-Jul-02" + +#define MSS_COPYRIGHT "Copyright (C) 1991-2002, RAD Game Tools, Inc." + +#endif + +#ifndef MSS_H +#define MSS_H + +// IS_DOS for DOS +// IS_WINDOWS for Windows or Win32 +// IS_WIN32 for Win32 +// IS_WIN16 for Windows +// IS_32 for 32-bit DOS or Win32 +// IS_16 for 16-bit Windows +// IS_LE for little endian (PCs) +// IS_BE for big endian (Macs) +// IS_X86 for Intel +// IS_MAC for Mac +// IS_PPC for PPC Mac +// IS_68K for 68K Mac + + +#ifdef IS_DOS +#undef IS_DOS +#endif + +#ifdef IS_WINDOWS +#undef IS_WINDOWS +#endif + +#ifdef IS_WIN32 +#undef IS_WIN32 +#endif + +#ifdef IS_WIN16 +#undef IS_WIN16 +#endif + +#ifdef IS_32 +#undef IS_32 +#endif + +#ifdef IS_16 +#undef IS_16 +#endif + +#ifdef IS_LE +#undef IS_LE +#endif + +#ifdef IS_BE +#undef IS_BE +#endif + +#ifdef IS_X86 +#undef IS_X86 +#endif + +#ifdef IS_MAC +#undef IS_MAC +#endif + +#ifdef IS_PPC +#undef IS_PPC +#endif + +#ifdef IS_68K +#undef IS_68K +#endif + +#ifdef __DOS__ + #define IS_DOS + #define IS_32 + #define IS_LE + #define IS_X86 +#else + #ifdef _WIN32 + #define IS_WINDOWS + #define IS_WIN32 + #define IS_32 + #define IS_LE + #define IS_X86 + #else + #ifdef WIN32 + #define IS_WINDOWS + #define IS_WIN32 + #define IS_32 + #define IS_LE + #define IS_X86 + #else + #ifdef __NT__ + #define IS_WINDOWS + #define IS_WIN32 + #define IS_32 + #define IS_LE + #define IS_X86 + #else + #ifdef __WIN32__ + #define IS_WINDOWS + #define IS_WIN32 + #define IS_32 + #define IS_LE + #define IS_X86 + #else + #ifdef _WINDOWS + #define IS_WINDOWS + #define IS_WIN16 + #define IS_16 + #define IS_LE + #define IS_X86 + #else + #ifdef _WINDLL + #define IS_WINDOWS + #define IS_WIN16 + #define IS_16 + #define IS_LE + #define IS_X86 + #else + #ifdef WINDOWS + #define IS_WINDOWS + #define IS_WIN16 + #define IS_16 + #define IS_LE + #define IS_X86 + #else + #ifdef __WINDOWS__ + #define IS_WINDOWS + #define IS_WIN16 + #define IS_16 + #define IS_LE + #define IS_X86 + #else + #ifdef _Windows + #define IS_WINDOWS + #define IS_WIN16 + #define IS_16 + #define IS_LE + #define IS_X86 + #else + #if defined(macintosh) || defined(__powerc) || defined(powerc) || defined(__POWERPC__) || defined(__MC68K__) + #define IS_MAC + #ifdef TARGET_API_MAC_CARBON + #define IS_CARBON + #endif + #define IS_32 + #define IS_BE + #if defined(__powerc) || defined(powerc) || defined(__POWERPC__) + #define IS_PPC + #else + #if defined(__MC68K__) + #define IS_68K + #endif + #endif + #endif + #endif + #endif + #endif + #endif + #endif + #endif + #endif + #endif + #endif +#endif + +#if (!defined(IS_LE) && !defined(IS_BE)) + #error MSS.H did not detect your platform. Define __DOS__, _WINDOWS, WIN32, or macintosh. +#endif + + +#if defined(_PUSHPOP_SUPPORTED) || PRAGMA_STRUCT_PACKPUSH + #pragma pack(push,1) +#else + #pragma pack(1) +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef IS_DOS + +#define AILCALLBACK __pascal +#define AILEXPORT cdecl +#define DXDEC extern +#define DXDEF +#define AILCALL cdecl +#define FAR +#define HIWORD(ptr) (((U32)ptr)>>16) +#define LOWORD(ptr) ((U16)((U32)ptr)) + +#define FOURCC U32 + +#define MAKEFOURCC(ch0, ch1, ch2, ch3) \ + ((U32)(U8)(ch0) | ((U32)(U8)(ch1) << 8) | \ + ((U32)(U8)(ch2) << 16) | ((U32)(U8)(ch3) << 24 )) + +#define mmioFOURCC(w,x,y,z) MAKEFOURCC(w,x,y,z) + +#define AILLIBCALLBACK __pascal + +#define MSS_MAIN_DEF + +#define MSS_REDIST_DIR_NAME "DOS" + +#define MSS_DIR_SEP "\\" +#define MSS_DIR_UP ".." MSS_DIR_SEP +#define MSS_DIR_UP_TWO MSS_DIR_UP MSS_DIR_UP + +#else + +#ifdef IS_WINDOWS + +#define AILLIBCALLBACK WINAPI + +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN +#endif + +#ifndef WIN32_EXTRA_LEAN +#define WIN32_EXTRA_LEAN +#endif + +#ifndef STRICT +#define STRICT +#endif + +#include +#include + +#define MSS_MAIN_DEF __cdecl + +// +// If compiling MSS DLL, use __declspec(dllexport) for both +// declarations and definitions +// +// If compiling MSS16 library or application, use "extern" in declarations +// and nothing in definitions +// + +#ifdef IS_WIN32 + + #define AILEXPORT WINAPI + + #ifdef BUILD_MSS + #define DXDEC __declspec(dllexport) + #define DXDEF __declspec(dllexport) + #else + + #ifdef __BORLANDC__ + #define DXDEC extern + #else + #define DXDEC __declspec(dllimport) + #endif + + #endif + + #define MSSDLLNAME "MSS32.DLL" + #define MSS_REDIST_DIR_NAME "WIN32" + + #define MSS_DIR_SEP "\\" + #define MSS_DIR_UP ".." MSS_DIR_SEP + #define MSS_DIR_UP_TWO MSS_DIR_UP MSS_DIR_UP + +#else + + #define AILEXPORT __export WINAPI + + #define DXDEC extern + #define DXDEF + + #define MSSDLLNAME "MSS16.DLL" + #define MSS_REDIST_DIR_NAME "WIN16" + + #define MSS_DIR_SEP "\\" + #define MSS_DIR_UP ".." MSS_DIR_SEP + #define MSS_DIR_UP_TWO MSS_DIR_UP MSS_DIR_UP + +#endif + +#define AILCALL WINAPI +#define AILCALLBACK AILEXPORT + +typedef LPVOID AILLPDIRECTSOUND; +typedef LPVOID AILLPDIRECTSOUNDBUFFER; + +#else + +#ifdef IS_MAC + + #ifdef IS_CARBON + #include + #else + #include + #include + #include // needed for GetResource, ReleaseResource + #endif + +#define FAR + +#define AILLIBCALLBACK //pascal +#define AILCALL //pascal +#define AILEXPORT //pascal +#define AILCALLBACK //pascal + +#ifdef BUILD_MSS + #define DXDEC __declspec(export) + #define DXDEF +#else + #define DXDEC extern + #define DXDEF +#endif + +#ifdef IS_CARBON +#define MSS_REDIST_DIR_NAME "CARBON" +#define MSSDLLNAME "Miles Carbon Library" +#else +#define MSS_REDIST_DIR_NAME "MAC" +#define MSSDLLNAME "Miles Shared Library" +#endif + +#define MSS_DIR_SEP ":" +#define MSS_DIR_UP ":" MSS_DIR_SEP +#define MSS_DIR_UP_TWO MSS_DIR_UP MSS_DIR_SEP + +#define HIWORD(ptr) (((U32)ptr)>>16) +#define LOWORD(ptr) ((U16)((U32)ptr)) + +#define FOURCC U32 + +#ifndef MAKEFOURCC +#define MAKEFOURCC(ch0, ch1, ch2, ch3) \ + (((U32)(U8)(ch0) << 24) | ((U32)(U8)(ch1) << 16) | \ + ((U32)(U8)(ch2) << 8) | ((U32)(U8)(ch3) )) +#endif + +#define mmioFOURCC(w,x,y,z) MAKEFOURCC(w,x,y,z) + +#define MSS_MAIN_DEF + +#endif + +#endif + +#endif + +#ifndef NULL +#define NULL 0 +#endif + +// +// Misc. constant definitions +// + +#define MAX_DRVRS 16 // Max. # of simultaneous drivers +#define MAX_TIMERS 16 // Max. # of simultaneous timers +#define MAX_NOTES 32 // Max # of notes "on" +#define FOR_NEST 4 // # of nested XMIDI FOR loops +#define NUM_CHANS 16 // # of possible MIDI channels +#define MAX_W_VOICES 16 // Max virtual wave synth voice cnt +#define MAX_W_ENTRIES 512 // 512 wave library entries max. +#ifdef IS_MAC +#define MAX_INSTR 150 // Max # of instruments 128 + 32 +#endif + +#define MIN_CHAN ( 1-1) // Min channel recognized (0-based) +#define MAX_CHAN (16-1) // Max channel recognized +#define MIN_LOCK_CHAN ( 2-1) // Min channel available for locking +#define MAX_LOCK_CHAN ( 9-1) // Max channel available for locking +#define PERCUSS_CHAN (10-1) // Percussion channel (no locking) + +#define AIL_MAX_FILE_HEADER_SIZE 4096 // AIL_set_named_sample_file() requires at least 4K + // of data or the entire file image, whichever is less, + // to determine sample format +#define DIG_F_16BITS_MASK 1 +#define DIG_F_STEREO_MASK 2 +#define DIG_F_ADPCM_MASK 4 + +#define DIG_F_MONO_8 0 // PCM data formats +#define DIG_F_MONO_16 (DIG_F_16BITS_MASK) +#define DIG_F_STEREO_8 (DIG_F_STEREO_MASK) +#define DIG_F_STEREO_16 (DIG_F_STEREO_MASK|DIG_F_16BITS_MASK) +#define DIG_F_ADPCM_MONO_16 (DIG_F_ADPCM_MASK |DIG_F_16BITS_MASK) +#define DIG_F_ADPCM_STEREO_16 (DIG_F_ADPCM_MASK |DIG_F_16BITS_MASK|DIG_F_STEREO_MASK) +#define DIG_F_USING_ASI 16 + +#define DIG_PCM_SIGN 0x0001 // (obsolete) +#define DIG_PCM_ORDER 0x0002 + +#define DIG_PCM_POLARITY 0x0004 // PCM flags used by driver hardware +#define DIG_PCM_SPLIT 0x0008 +#define DIG_BUFFER_SERVICE 0x0010 +#define DIG_DUAL_DMA 0x0020 +#define DIG_RECORDING_SUPPORTED 0x8000 + +#define WAVE_FORMAT_PCM 1 +#define WAVE_FORMAT_IMA_ADPCM 0x0011 + +#ifdef IS_DOS + +#define AIL3DIG 0 // .DIG driver +#define AIL3MDI 1 // .MDI driver + +#define DIG_DETECT_8_BIT_ONLY 0x0001 // Detect 8-bit DMA only +#define DIG_DETECT_16_BIT_ONLY 0x0002 // Detect 16-bit DMA only +#define DIG_DETECT_8_AND_16_BITS 0x0003 // Detect both 8- and 16-bit DMA + +#define DRV_INIT 0x300 // Functions common to .MDI and .DIG +#define DRV_GET_INFO 0x301 // drivers +#define DRV_SERVE 0x302 +#define DRV_PARSE_ENV 0x303 +#define DRV_VERIFY_IO 0x304 +#define DRV_INIT_DEV 0x305 +#define DRV_SHUTDOWN_DEV 0x306 + +#define DIG_HW_VOLUME 0x400 // .DIG driver functions +#define DIG_START_P_CMD 0x401 +#define DIG_STOP_P_REQ 0x402 +#define DIG_START_R_CMD 0x403 +#define DIG_STOP_R_REQ 0x404 +#define DIG_VSE 0x405 + +#define MDI_HW_VOLUME 0x500 // .MDI driver functions +#define MDI_INIT_INS_MGR 0x501 +#define MDI_MIDI_XMIT 0x502 +#define MDI_INSTALL_T_SET 0x503 +#define MDI_GET_T_STATUS 0x504 +#define MDI_PROT_UNPROT_T 0x505 +#define MDI_VSE 0x506 + +#else + +// +// Pass to AIL_midiOutOpen for NULL MIDI driver +// + +#define MIDI_NULL_DRIVER ((U32)(S32)-2) + +#endif + + +// +// Non-specific XMIDI/MIDI controllers and event types +// + +#define SYSEX_BYTE 105 +#define PB_RANGE 106 +#define CHAN_MUTE 107 +#define CALLBACK_PFX 108 +#define SEQ_BRANCH 109 +#define CHAN_LOCK 110 +#define CHAN_PROTECT 111 +#define VOICE_PROTECT 112 +#define TIMBRE_PROTECT 113 +#define PATCH_BANK_SEL 114 +#define INDIRECT_C_PFX 115 +#define FOR_LOOP 116 +#define NEXT_LOOP 117 +#define CLEAR_BEAT_BAR 118 +#define CALLBACK_TRIG 119 +#define SEQ_INDEX 120 + +#define GM_BANK_MSB 0 +#define MODULATION 1 +#define DATA_MSB 6 +#define PART_VOLUME 7 +#define PANPOT 10 +#define EXPRESSION 11 +#define GM_BANK_LSB 32 +#define DATA_LSB 38 +#define SUSTAIN 64 +#define REVERB 91 +#define CHORUS 93 +#define RPN_LSB 100 +#define RPN_MSB 101 +#define RESET_ALL_CTRLS 121 +#define ALL_NOTES_OFF 123 + +#define EV_NOTE_OFF 0x80 +#define EV_NOTE_ON 0x90 +#define EV_POLY_PRESS 0xa0 +#define EV_CONTROL 0xb0 +#define EV_PROGRAM 0xc0 +#define EV_CHAN_PRESS 0xd0 +#define EV_PITCH 0xe0 +#define EV_SYSEX 0xf0 +#define EV_ESC 0xf7 +#define EV_META 0xff + +#define META_EOT 0x2f +#define META_TEMPO 0x51 +#define META_TIME_SIG 0x58 + +// +// SAMPLE.system_data[] usage +// + +#define SSD_EOD_CALLBACK 0 // Application end-of-data callback if not NULL +#define VOC_BLK_PTR 1 // Pointer to current block +#define VOC_REP_BLK 2 // Pointer to beginning of repeat loop block +#define VOC_N_REPS 3 // # of iterations left in repeat loop +#define VOC_MARKER 4 // Marker to search for, or -1 if all +#define VOC_MARKER_FOUND 5 // Desired marker found if 1, else 0 +#define SSD_RELEASE 6 // Release sample handle upon termination if >0 +#define SSD_TEMP 7 // Temporary storage location for general use + +// +// Timer status values +// + +#define AILT_FREE 0 // Timer handle is free for allocation +#define AILT_STOPPED 1 // Timer is stopped +#define AILT_RUNNING 2 // Timer is running + +// +// SAMPLE.status flag values +// + +#define SMP_FREE 0x0001 // Sample is available for allocation + +#define SMP_DONE 0x0002 // Sample has finished playing, or has + // never been started + +#define SMP_PLAYING 0x0004 // Sample is playing + +#define SMP_STOPPED 0x0008 // Sample has been stopped + +#define SMP_PLAYINGBUTRELEASED 0x0010 // Sample is playing, but digital handle + // has been temporarily released + + + +// +// SEQUENCE.status flag values +// + +#define SEQ_FREE 0x0001 // Sequence is available for allocation + +#define SEQ_DONE 0x0002 // Sequence has finished playing, or has + // never been started + +#define SEQ_PLAYING 0x0004 // Sequence is playing + +#define SEQ_STOPPED 0x0008 // Sequence has been stopped + +#define SEQ_PLAYINGBUTRELEASED 0x0010 // Sequence is playing, but MIDI handle + // has been temporarily released + +#ifdef IS_DOS + +// +// MIDI driver types +// + +#define MDIDRVRTYPE_GM 0 // General MIDI driver (Roland-compatible) +#define MDIDRVRTYPE_FM_2 1 // 2-operator FM MIDI driver (OPL2) +#define MDIDRVRTYPE_FM_4 2 // 4-operator FM MIDI driver (OPL3) +#define MDIDRVRTYPE_SPKR 3 // Tandy or PC speaker "beep" driver + +// +// .INI installation result codes +// + +#define AIL_INIT_SUCCESS 0 // Driver installed successfully +#define AIL_NO_INI_FILE 1 // No MDI.INI or DIG.INI file exists +#define AIL_INIT_FAILURE 2 // Driver could not be initialized + +#ifdef __BORLANDC__ + + #ifndef REALPTR + #define REALPTR(x) ((void *) (U32) ((((U32) (x))>>16<<4) + ((x) & 0xffff) \ + - AIL_sel_base(_DS))) + #endif + +#else + + #ifndef REALPTR + #define REALPTR(x) ((void *) (U32) ((((U32) (x))>>16<<4) + ((x) & 0xffff))) + #endif + +#endif + +#else + +#ifdef IS_WINDOWS + +// +// AIL_set_direct_buffer_control() command values +// + +#define AILDS_RELINQUISH 0 // App returns control of secondary buffer +#define AILDS_SEIZE 1 // App takes control of secondary buffer +#define AILDS_SEIZE_LOOP 2 // App wishes to loop the secondary buffer + +#endif + +#endif + +// +// General type definitions for portability +// + +#ifndef C8 +#define C8 char +#endif + +#ifndef U8 +#define U8 unsigned char +#endif + +#ifndef S8 +#define S8 signed char +#endif + +#ifndef U16 +#define U16 unsigned short +#endif + +#ifndef S16 +#define S16 signed short +#endif + +#ifndef U32 +#define U32 unsigned long +#endif + +#ifndef S32 +#define S32 signed long +#endif + +#ifndef F32 +#define F32 float +#endif + +#ifndef F64 +#define F64 double +#endif + + +#ifndef REALFAR +#define REALFAR unsigned long +#endif + +#ifndef FILE_ERRS +#define FILE_ERRS + +#define AIL_NO_ERROR 0 +#define AIL_IO_ERROR 1 +#define AIL_OUT_OF_MEMORY 2 +#define AIL_FILE_NOT_FOUND 3 +#define AIL_CANT_WRITE_FILE 4 +#define AIL_CANT_READ_FILE 5 +#define AIL_DISK_FULL 6 + +#endif + +#define MIN_VAL 0 +#define NOM_VAL 1 +#define MAX_VAL 2 + +#ifndef YES +#define YES 1 +#endif + +#ifndef NO +#define NO 0 +#endif + +#ifndef TRUE +#define TRUE 1 +#endif + +#ifndef FALSE +#define FALSE 0 +#endif + +// +// Preference names and default values +// + +#define DIG_RESAMPLING_TOLERANCE 0 +#define DEFAULT_DRT 131 // Resampling triggered at +/- 0.2% + +#define DIG_MIXER_CHANNELS 1 +#define DEFAULT_DMC 64 // 64 allocatable SAMPLE structures + +#define DIG_MAX_PREDELAY_MS 2 +#define DEFAULT_MPDMS 500 // Max predelay reverb time in ms + +#define MDI_SERVICE_RATE 3 +#define DEFAULT_MSR 120 // XMIDI sequencer timing = 120 Hz + +#define MDI_SEQUENCES 4 +#define DEFAULT_MS 8 // 8 sequence handles/driver + +#define MDI_DEFAULT_VOLUME 5 +#define DEFAULT_MDV 127 // Default sequence volume = 127 (0-127) + +#define MDI_QUANT_ADVANCE 6 +#define DEFAULT_MQA 1 // Beat/bar count +1 interval + +#define MDI_ALLOW_LOOP_BRANCHING 7 +#define DEFAULT_ALB NO // Branches cancel XMIDI FOR loops + +#define MDI_DEFAULT_BEND_RANGE 8 +#define DEFAULT_MDBR 2 // Default pitch-bend range = 2 + +#ifdef IS_X86 + +#define MDI_DOUBLE_NOTE_OFF 9 +#define DEFAULT_MDNO NO // For stuck notes on SB daughterboards + +#endif + +#define DIG_ENABLE_RESAMPLE_FILTER 31 // Enable resampling filter by +#define DEFAULT_DERF YES // default + +#if defined(IS_WINDOWS) || defined(IS_MAC) + +#define MDI_SYSEX_BUFFER_SIZE 10 +#define DEFAULT_MSBS 1536 // Default sysex buffer = 1536 bytes + +#define DIG_OUTPUT_BUFFER_SIZE 11 +#define DEFAULT_DOBS 49152 // 48K output buffer size + +#define AIL_MM_PERIOD 12 +#define DEFAULT_AMP 5 // Default MM timer period = 5 msec. + +#endif + +#ifdef IS_MAC + +#define DIG_SM_FRAGMENT_SIZE 34 +#define DEFAULT_DSFS 20 // Use 20 millisecond buffer fragments with Sound Manager + +#define DIG_SM_MIX_FRAGMENT_CNT 42 +#define DEFAULT_DSMFC 2 // Buffer two fragments ahead + +#define DIG_SM_FRAGMENT_CNT 35 +#define DEFAULT_DSFC 16 // Use 16 buffer fragments with Sound Manager + +#endif + +#ifdef IS_WINDOWS + +#define DIG_DS_FRAGMENT_SIZE 34 +#define DEFAULT_DDFS 8 // Use 8 millisecond buffer fragments with DirectSound if MSS mixer in use + +#define DIG_DS_FRAGMENT_CNT 35 +#define DEFAULT_DDFC 96 // Use 96 buffer fragments with DirectSound if MSS mixer in use + +#define DIG_DS_MIX_FRAGMENT_CNT 42 +#define DEFAULT_DDMFC 8 // Mix ahead 8 buffer fragments + +#define DIG_DS_USE_PRIMARY 36 +#define DEFAULT_DDUP NO // Mix into secondary DirectSound buffer by default + +#define DIG_DS_DSBCAPS_CTRL3D 37 +#define DEFAULT_DDDC NO // Do not use DSBCAPS_CTRL3D by default + +#define DIG_DS_CREATION_HANDLER 38 +#define DEFAULT_DDCH NULL // Use DirectSoundCreate() by default + +#define AIL_TIMERS 13 +#define DEFAULT_AT 16 // 16 allocatable HTIMER handles + +#define DIG_MAX_CHAIN_ELEMENT_SIZE 14 +#define DEFAULT_MCES 8192 // max of 8192 bytes/waveOut buffer + +#define DIG_MIN_CHAIN_ELEMENT_TIME 45 +#define DEFAULT_MCET 100 // 100 milliseconds buffers + +#define DIG_USE_WAVEOUT 15 +#define DEFAULT_DUW NO // Use DirectSound by default + +#define DIG_DS_SECONDARY_SIZE 16 +#define DEFAULT_DDSS (32*1024L) // Must be 2^n -- use 32K by default + +#define DIG_DS_SAMPLE_CEILING 17 +#define DEFAULT_DDSC 44100 // Allow up to 44 kHz samples + +#define AIL_LOCK_PROTECTION 18 +#define DEFAULT_ALP NO // Don't suspend foreground thread by default + +#define AIL_MUTEX_PROTECTION 44 +#define DEFAULT_AMPR YES // Lock each call into Miles with a mutex + +#else + +#ifdef IS_DOS + +#define DIG_SERVICE_RATE 10 +#define DEFAULT_DSR 200 // DMA buffer-polling rate = 200 Hz + +#define DIG_HARDWARE_SAMPLE_RATE 11 +#define DEFAULT_DHSR NOM_VAL // Use nominal sample rate by default + +#define DIG_DMA_RESERVE 12 +#define DEFAULT_DDR 32768 // Reserve 32K real-mode mem for DMA + +#define DIG_LATENCY 13 +#define DEFAULT_DL 100 // Half-buffer size in ms = 100 + +#define DIG_USE_STEREO 14 +#define DEFAULT_DUS NO // Use mono output only + +#define DIG_USE_16_BITS 15 +#define DEFAULT_DU16 NO // Use 8-bit output by default + +#define DIG_ALLOW_16_BIT_DMA 16 +#define DEFAULT_DA16DMA YES // OK to use 16-bit DMA if necessary + +#define DIG_SS_LOCK 17 +#define DEFAULT_DSL NO // Don't disable IRQs while mixing + +#define AIL_SCAN_FOR_HARDWARE 18 +#define DEFAULT_ASH YES // Scan for I/O settings if necessary + +#define AIL_ALLOW_VDM_EXECUTION 19 +#define DEFAULT_AVE YES // Allow Windows "DOS box" execution + +#endif + +#endif + +// ---------------------------------- +// DLS Preference names and default values +// Unless otherwise specified, values must be established +// BEFORE calling DLSMSSOpen()! +// ---------------------------------- + +#define DLS_TIMEBASE 20 +#define DEFAULT_DTB 120 // 120 intervals/second by default + +#define DLS_VOICE_LIMIT 21 +#define DEFAULT_DVL 32 // 32 voices supported + +#define DLS_BANK_SELECT_ALIAS 22 +#define DEFAULT_DBSA NO // Do not treat controller 114 as bank + +#define DLS_STREAM_BOOTSTRAP 23 // Don't submit first stream buffer +#define DEFAULT_DSB YES // until at least 2 available + +#define DLS_VOLUME_BOOST 24 +#define DEFAULT_DVB 0 // Boost final volume by 0 dB + +#define DLS_ENABLE_FILTERING 25 // Filtering = on by default +#define DEFAULT_DEF YES // (may be changed at any time) + +#ifdef IS_X86 + +#define AIL_ENABLE_MMX_SUPPORT 27 // Enable MMX support if present +#define DEFAULT_AEMS YES // (may be changed at any time) + +#endif + +#define DLS_GM_PASSTHROUGH 28 // Pass unrecognized traffic on to +#define DEFAULT_DGP YES // default GM driver layer + // (may be changed at any time) + +#define DLS_ADPCM_TO_ASI_THRESHOLD 39 // Size in samples to switch to ASI +#define DEFAULT_DATAT 32768 + +// +// Add'l platform-independent prefs +// + +#define DIG_INPUT_LATENCY 41 // Use >= 250-millisecond input buffers if +#define DEFAULT_DIL 250 // explicit size request cannot be satisfied + +#ifdef IS_WINDOWS + +#define DIG_USE_WAVEIN 43 +#define DEFAULT_DUWI YES // Use waveIn for input by default + +#endif + +#define N_PREFS 46 // # of preference types + +typedef struct _AILSOUNDINFO { + S32 format; + void const FAR* data_ptr; + U32 data_len; + U32 rate; + S32 bits; + S32 channels; + U32 samples; + U32 block_size; + void const FAR* initial_ptr; +} AILSOUNDINFO; + + +#ifndef RIB_H // RIB.H contents included if RIB.H not already included + +// #include "rib.h" + +#define RIB_H +#define ARY_CNT(x) (sizeof((x)) / sizeof((x)[0])) + +// ---------------------------------- +// RIB data types +// ---------------------------------- + +typedef S32 RIBRESULT; + +#define RIB_NOERR 0 // Success -- no error +#define RIB_NOT_ALL_AVAILABLE 1 // Some requested functions/attribs not available +#define RIB_NOT_FOUND 2 // Resource not found +#define RIB_OUT_OF_MEM 3 // Out of system RAM + +// +// Handle to interface provider +// + +typedef U32 HPROVIDER; + +// +// Handle representing token used to obtain attribute or preference +// data from RIB provider +// + +typedef U32 HATTRIB; + +// +// Handle representing an enumerated interface entry +// +// RIB_enumerate_interface() returns 1 if valid next entry found, else +// 0 if end of list reached +// + +typedef U32 HINTENUM; +#define HINTENUM_FIRST 0 + +// +// Handle representing an enumerated provider entry +// +// RIB_enumerate_providers() returns 1 if valid next entry found, else +// 0 if end of list reached +// + +typedef U32 HPROENUM; +#define HPROENUM_FIRST 0 + +// +// Data types for RIB attributes and preferences +// + +typedef enum +{ + RIB_NONE = 0, // No type + RIB_CUSTOM, // Used for pointers to application-specific structures + RIB_DEC, // Used for 32-bit integer values to be reported in decimal + RIB_HEX, // Used for 32-bit integer values to be reported in hex + RIB_FLOAT, // Used for 32-bit single-precision FP values + RIB_PERCENT, // Used for 32-bit single-precision FP values to be reported as percentages + RIB_BOOL, // Used for Boolean-constrained integer values to be reported as TRUE or FALSE + RIB_STRING // Used for pointers to null-terminated ASCII strings +} +RIB_DATA_SUBTYPE; + +// +// RIB_ENTRY_TYPE structure, used to register an interface or request one +// + +typedef enum +{ + RIB_FUNCTION = 0, + RIB_ATTRIBUTE, // Attribute: read-only data type used for status/info communication + RIB_PREFERENCE // Preference: read/write data type used to control behavior +} +RIB_ENTRY_TYPE; + +// +// RIB_INTERFACE_ENTRY, used to represent a function or data entry in an +// interface +// + +typedef struct +{ + RIB_ENTRY_TYPE type; // See list above + C8 FAR *entry_name; // Name of desired function or attribute + U32 token; // Function pointer or attribute token + RIB_DATA_SUBTYPE subtype; // Data (attrib or preference) subtype +} +RIB_INTERFACE_ENTRY; + +// +// Standard RAD Interface Broker provider identification attributes +// + +#define PROVIDER_NAME (-100) // RIB_STRING name of decoder +#define PROVIDER_VERSION (-101) // RIB_HEX BCD version number + +// +// Standard function to obtain provider attributes (see PROVIDER_ defines +// above) +// +// Each provider of a searchable interface must export this function +// + +typedef U32 (AILCALL FAR *PROVIDER_QUERY_ATTRIBUTE) (HATTRIB index); + +// +// Macros to simplify interface registrations/requests for functions, +// attributes, and preferences +// + +#define FN(entry_name) { RIB_FUNCTION, #entry_name, (U32) &(entry_name), RIB_NONE } +#define REG_FN(entry_name) { RIB_FUNCTION, #entry_name, (U32) &(entry_name), RIB_NONE } + +#define AT(entry_name,ID) { RIB_ATTRIBUTE, (entry_name), (U32) &(ID), RIB_NONE } +#define REG_AT(entry_name,ID,subtype) { RIB_ATTRIBUTE, (entry_name), (U32) (ID), subtype } + +#define PR(entry_name,ID) { RIB_PREFERENCE, (entry_name), (U32) &(ID), RIB_NONE } +#define REG_PR(entry_name,ID,subtype) { RIB_PREFERENCE, (entry_name), (U32) (ID), subtype } + +#define RIB_register(x,y,z) RIB_register_interface (HPROVIDER(x), y, ARY_CNT(z), z) +#define RIB_unregister(x,y,z) RIB_unregister_interface(HPROVIDER(x), y, ARY_CNT(z), z) +#define RIB_unregister_all(x) RIB_unregister_interface(HPROVIDER(x), NULL, 0, NULL) +#define RIB_free_libraries() RIB_free_provider_library(HPROVIDER(NULL)); +#define RIB_request(x,y,z) RIB_request_interface (x, y, ARY_CNT(z), z) + +// ---------------------------------- +// Standard RIB API prototypes +// ---------------------------------- + +DXDEC HPROVIDER AILCALL RIB_alloc_provider_handle (U32 module); +DXDEC void AILCALL RIB_free_provider_handle (HPROVIDER provider); + +DXDEC HPROVIDER AILCALL RIB_load_provider_library (C8 const FAR *filename); +DXDEC void AILCALL RIB_free_provider_library (HPROVIDER provider); + +DXDEC HPROVIDER AILCALL RIB_provider_library_handle (void); + +DXDEC RIBRESULT AILCALL RIB_register_interface (HPROVIDER provider, + C8 const FAR *interface_name, + S32 entry_count, + RIB_INTERFACE_ENTRY const FAR *rlist); + +DXDEC RIBRESULT AILCALL RIB_unregister_interface (HPROVIDER provider, + C8 const FAR *interface_name, + S32 entry_count, + RIB_INTERFACE_ENTRY const FAR *rlist); + +DXDEC RIBRESULT AILCALL RIB_request_interface (HPROVIDER provider, + C8 const FAR *interface_name, + S32 entry_count, + RIB_INTERFACE_ENTRY FAR *rlist); + +DXDEC RIBRESULT AILCALL RIB_request_interface_entry (HPROVIDER provider, + C8 const FAR *interface_name, + RIB_ENTRY_TYPE entry_type, + C8 const FAR *entry_name, + U32 FAR *token); + +DXDEC S32 AILCALL RIB_enumerate_interface (HPROVIDER provider, + C8 FAR *interface_name, + RIB_ENTRY_TYPE type, + HINTENUM FAR *next, + RIB_INTERFACE_ENTRY FAR *dest); + +DXDEC S32 AILCALL RIB_enumerate_providers (C8 FAR *interface_name, + HPROENUM FAR *next, + HPROVIDER FAR *dest); + +DXDEC C8 FAR * AILCALL RIB_type_string (U32 data, + RIB_DATA_SUBTYPE subtype); + +DXDEC HPROVIDER AILCALL RIB_find_file_provider (C8 const FAR *interface_name, + C8 const FAR *attribute_name, + C8 const FAR *file_suffix); + +DXDEC HPROVIDER AILCALL RIB_find_provider (C8 const FAR *interface_name, + C8 const FAR *attribute_name, + C8 const FAR *attribute_value); + +DXDEC HPROVIDER AILCALL RIB_find_files_provider (C8 const FAR *interface_name, + C8 const FAR *attribute_name_1, + C8 const FAR *file_suffix_1, + C8 const FAR *attribute_name_2, + C8 const FAR *file_suffix_2); + +DXDEC HPROVIDER AILCALL RIB_find_file_dec_provider (C8 const FAR *interface_name, + C8 const FAR *attribute_name_1, + U32 attribute_value_1, + C8 const FAR *attribute_name_2, + C8 const FAR *file_suffix_2); + +DXDEC S32 AILCALL RIB_load_application_providers + (C8 const FAR *filespec); + +DXDEC void AILCALL RIB_set_provider_user_data (HPROVIDER provider, + U32 index, + S32 value); + +DXDEC S32 AILCALL RIB_provider_user_data (HPROVIDER provider, + U32 index); + +DXDEC void AILCALL RIB_set_provider_system_data + (HPROVIDER provider, + U32 index, + S32 value); + +DXDEC S32 AILCALL RIB_provider_system_data (HPROVIDER provider, + U32 index); + +DXDEC C8 FAR * AILCALL RIB_error (void); + +#endif + +#ifndef MSS_ASI_VERSION // MSSASI.H contents included if MSSASI.H not already included + +// #include "mssasi.h" + +#define AIL_ASI_VERSION 1 +#define AIL_ASI_REVISION 0 + +// +// Handle to stream being managed by ASI codec +// + +typedef S32 HASISTREAM; + +// +// ASI result codes +// + +typedef S32 ASIRESULT; + +#define ASI_NOERR 0 // Success -- no error +#define ASI_NOT_ENABLED 1 // ASI not enabled +#define ASI_ALREADY_STARTED 2 // ASI already started +#define ASI_INVALID_PARAM 3 // Invalid parameters used +#define ASI_INTERNAL_ERR 4 // Internal error in ASI driver +#define ASI_OUT_OF_MEM 5 // Out of system RAM +#define ASI_ERR_NOT_IMPLEMENTED 6 // Feature not implemented +#define ASI_NOT_FOUND 7 // ASI supported device not found +#define ASI_NOT_INIT 8 // ASI not initialized +#define ASI_CLOSE_ERR 9 // ASI not closed correctly + +// ---------------------------------- +// Application-provided ASI callbacks +// ---------------------------------- + +// +// AILASIFETCHCB: Called by ASI to obtain data from stream source +// +// offset normally will be either 0 at the first call made by the codec +// or -1 to specify a continuous stream, except when ASI_stream_seek() +// is called to restart the stream codec at a new stream offset. In this +// case, the application must execute the seek operation on the ASI codec's +// behalf. +// +// In response to this callback, the application should read the requested +// data and copy it to the specified destination buffer, returning the number +// of bytes copied (which can be less than bytes_requested if the end of +// the stream is reached). +// + +typedef S32 (AILCALLBACK FAR * AILASIFETCHCB) (U32 user, // User value passed to ASI_open_stream() + void FAR *dest, // Location to which stream data should be copied by app + S32 bytes_requested, // # of bytes requested by ASI codec + S32 offset); // If not -1, application should seek to this point in stream + +//############################################################################ +//## ## +//## Interface "ASI codec" ## +//## ## +//############################################################################ + +// +// Initialize ASI stream codec +// +// No other ASI functions may be called outside an ASI_startup() / +// ASI_shutdown() pair, except for the standard RIB function +// PROVIDER_query_attribute(). All provider attributes must be accessible +// without starting up the codec. +// + +typedef ASIRESULT (AILCALL FAR *ASI_STARTUP)(void); + +// +// Shut down ASI codec +// + +typedef ASIRESULT (AILCALL FAR * ASI_SHUTDOWN)(void); + +// +// Return codec error message, or NULL if no errors have occurred since +// last call +// +// The ASI error text state is global to all streams +// + +typedef C8 FAR * (AILCALL FAR * ASI_ERROR)(void); + +//############################################################################ +//## ## +//## Interface "ASI stream" ## +//## ## +//############################################################################ + +// +// Open a stream, returning handle to stream +// + +typedef HASISTREAM (AILCALL FAR *ASI_STREAM_OPEN) (U32 user, // User value passed to fetch callback + AILASIFETCHCB fetch_CB, // Source data fetch handler + U32 total_size); // Total size for %-done calculations (0=unknown) + +// +// Translate data in stream, returning # of bytes actually decoded or encoded +// +// Any number of bytes may be requested. Requesting more data than is +// available in the codec's internal buffer will cause the AILASIFETCHCB +// handler to be called to fetch more data from the stream. +// + +typedef S32 (AILCALL FAR *ASI_STREAM_PROCESS) (HASISTREAM stream, // Handle of stream + void FAR *buffer, // Destination for processed data + S32 buffer_size); // # of bytes to return in buffer + +// +// Restart stream decoding process at new offset +// +// Relevant for decoders only +// +// Seek destination is given as offset in bytes from beginning of stream +// +// At next ASI_stream_process() call, decoder will seek to the closest possible +// point in the stream which occurs at or after the specified position +// +// This function has no effect for decoders which do not support random +// seeks on a given stream type +// +// Warning: some decoders may need to implement seeking by reparsing +// the entire stream up to the specified offset, through multiple calls +// to the data-fetch callback. This operation may be extremely +// time-consuming on large files or slow network connections. +// +// A stream_offset value of -1 may be used to inform the decoder that the +// application has changed the input stream offset on its own, e.g. for a +// double-buffering application where the ASI decoder is not accessing the +// stream directly. ASI decoders should respond to this by flushing all +// internal buffers and resynchronizing themselves to the data stream. +// + +typedef ASIRESULT (AILCALL FAR *ASI_STREAM_SEEK) (HASISTREAM stream, + S32 stream_offset); + +// +// Retrieve an ASI stream attribute or preference value by index +// + +typedef S32 (AILCALL FAR *ASI_STREAM_ATTRIBUTE) (HASISTREAM stream, + HATTRIB attrib); + +// +// Set an ASI stream preference value by index +// + +typedef S32 (AILCALL FAR *ASI_STREAM_SET_PREFERENCE) (HASISTREAM stream, + HATTRIB preference, + void const FAR * value); + +// +// Close stream, freeing handle and all internally-allocated resources +// + +typedef ASIRESULT (AILCALL FAR *ASI_STREAM_CLOSE) (HASISTREAM stream); + +#endif + +//############################################################################ +//## ## +//## Interface "MSS 3D audio services" ## +//## ## +//############################################################################ + +// +// 3D positioning services +// + + +typedef struct h3DPOBJECT +{ + U32 junk; +} h3DPOBJECT; + +typedef h3DPOBJECT FAR * H3DPOBJECT; +typedef H3DPOBJECT H3DSAMPLE; + +// +// M3D result codes +// + +typedef S32 M3DRESULT; + +#define M3D_NOERR 0 // Success -- no error +#define M3D_NOT_ENABLED 1 // M3D not enabled +#define M3D_ALREADY_STARTED 2 // M3D already started +#define M3D_INVALID_PARAM 3 // Invalid parameters used +#define M3D_INTERNAL_ERR 4 // Internal error in M3D driver +#define M3D_OUT_OF_MEM 5 // Out of system RAM +#define M3D_ERR_NOT_IMPLEMENTED 6 // Feature not implemented +#define M3D_NOT_FOUND 7 // M3D supported device not found +#define M3D_NOT_INIT 8 // M3D not initialized +#define M3D_CLOSE_ERR 9 // M3D not closed correctly + + +typedef void (AILCALLBACK FAR* AIL3DSAMPLECB) (H3DSAMPLE sample); + +typedef M3DRESULT (AILCALL FAR *M3D_STARTUP)(void); + +typedef M3DRESULT (AILCALL FAR *M3D_SHUTDOWN)(void); + +typedef C8 FAR * (AILCALL FAR *M3D_ERROR)(void); + +typedef S32 (AILCALL FAR *M3D_SET_PROVIDER_PREFERENCE)(HATTRIB preference, + void const FAR * value); + +typedef M3DRESULT (AILCALL FAR * M3D_ACTIVATE)(S32 enable); + +typedef H3DSAMPLE (AILCALL FAR * M3D_ALLOCATE_3D_SAMPLE_HANDLE)(void); + + +typedef void (AILCALL FAR * M3D_RELEASE_3D_SAMPLE_HANDLE)(H3DSAMPLE samp); + + +typedef void (AILCALL FAR * M3D_START_3D_SAMPLE)(H3DSAMPLE samp); + + +typedef void (AILCALL FAR * M3D_STOP_3D_SAMPLE)(H3DSAMPLE samp); + + +typedef void (AILCALL FAR * M3D_RESUME_3D_SAMPLE)(H3DSAMPLE samp); + +typedef void (AILCALL FAR * M3D_END_3D_SAMPLE)(H3DSAMPLE samp); + +typedef S32 (AILCALL FAR * M3D_SET_3D_SAMPLE_DATA)(H3DSAMPLE samp, + AILSOUNDINFO const FAR *info); + +typedef void (AILCALL FAR * M3D_SET_3D_SAMPLE_VOLUME)(H3DSAMPLE samp, + F32 volume); + +typedef void (AILCALL FAR * M3D_SET_3D_SAMPLE_PLAYBACK_RATE)(H3DSAMPLE samp, + S32 playback_rate); + +typedef void (AILCALL FAR * M3D_SET_3D_SAMPLE_OFFSET)(H3DSAMPLE samp, + U32 offset); + + +typedef void (AILCALL FAR * M3D_SET_3D_SAMPLE_LOOP_COUNT)(H3DSAMPLE samp, + U32 loops); + +typedef void (AILCALL FAR * M3D_SET_3D_SAMPLE_LOOP_BLOCK)(H3DSAMPLE S, + S32 loop_start_offset, + S32 loop_end_offset); + +typedef U32 (AILCALL FAR * M3D_3D_SAMPLE_STATUS)(H3DSAMPLE samp); + +typedef U32 (AILCALL FAR * M3D_3D_SAMPLE_ATTRIBUTE)(H3DSAMPLE samp, HATTRIB index); + +typedef S32 (AILCALL FAR * M3D_3D_SET_SAMPLE_PREFERENCE)(H3DSAMPLE samp, HATTRIB preference, void const FAR * value); + +typedef F32 (AILCALL FAR * M3D_3D_SAMPLE_VOLUME)(H3DSAMPLE samp); + +typedef S32 (AILCALL FAR * M3D_3D_SAMPLE_PLAYBACK_RATE)(H3DSAMPLE samp); + +typedef U32 (AILCALL FAR * M3D_3D_SAMPLE_OFFSET)(H3DSAMPLE samp); + +typedef U32 (AILCALL FAR * M3D_3D_SAMPLE_LENGTH)(H3DSAMPLE samp); + +typedef U32 (AILCALL FAR * M3D_3D_SAMPLE_LOOP_COUNT)(H3DSAMPLE samp); + +typedef void (AILCALL FAR * M3D_SET_3D_SAMPLE_DISTANCES)(H3DSAMPLE samp, + F32 max_dist, + F32 min_dist); + + +typedef void (AILCALL FAR * M3D_3D_SAMPLE_DISTANCES)(H3DSAMPLE samp, + F32 FAR * max_dist, + F32 FAR * min_dist); + +typedef S32 (AILCALL FAR * M3D_ACTIVE_3D_SAMPLE_COUNT)(void); + +typedef H3DPOBJECT (AILCALL FAR * M3D_3D_OPEN_LISTENER)(void); + +typedef void (AILCALL FAR * M3D_3D_CLOSE_LISTENER)(H3DPOBJECT listener); + +typedef H3DPOBJECT (AILCALL FAR * M3D_3D_OPEN_OBJECT)(void); + +typedef void (AILCALL FAR * M3D_3D_CLOSE_OBJECT)(H3DPOBJECT obj); + +typedef void (AILCALL FAR * M3D_SET_3D_POSITION)(H3DPOBJECT obj, + F32 X, + F32 Y, + F32 Z); + +typedef void (AILCALL FAR * M3D_SET_3D_VELOCITY)(H3DPOBJECT obj, + F32 dX_per_ms, + F32 dY_per_ms, + F32 dZ_per_ms, + F32 magnitude); + +typedef void (AILCALL FAR * M3D_SET_3D_VELOCITY_VECTOR)(H3DPOBJECT obj, + F32 dX_per_ms, + F32 dY_per_ms, + F32 dZ_per_ms); + +typedef void (AILCALL FAR * M3D_SET_3D_ORIENTATION)(H3DPOBJECT obj, + F32 X_face, + F32 Y_face, + F32 Z_face, + F32 X_up, + F32 Y_up, + F32 Z_up); + +typedef void (AILCALL FAR * M3D_3D_POSITION)(H3DPOBJECT obj, + F32 FAR *X, + F32 FAR *Y, + F32 FAR *Z); + +typedef void (AILCALL FAR * M3D_3D_VELOCITY)(H3DPOBJECT obj, + F32 FAR *dX_per_ms, + F32 FAR *dY_per_ms, + F32 FAR *dZ_per_ms); + +typedef void (AILCALL FAR * M3D_3D_ORIENTATION)(H3DPOBJECT obj, + F32 FAR *X_face, + F32 FAR *Y_face, + F32 FAR *Z_face, + F32 FAR *X_up, + F32 FAR *Y_up, + F32 FAR *Z_up); + +typedef void (AILCALL FAR * M3D_3D_UPDATE_POSITION)(H3DPOBJECT obj, + F32 dt_milliseconds); + +typedef void (AILCALL FAR * M3D_3D_AUTO_UPDATE_POSITION)(H3DPOBJECT obj, + S32 enable); + +typedef S32 (AILCALL FAR * M3D_3D_ROOM_TYPE)(void); +typedef void (AILCALL FAR * M3D_SET_3D_ROOM_TYPE)(S32 EAX_room_type); +typedef S32 (AILCALL FAR * M3D_3D_SPEAKER_TYPE)(void); +typedef void (AILCALL FAR * M3D_SET_3D_SPEAKER_TYPE)(S32 speaker_type); +typedef void (AILCALL FAR * M3D_SET_3D_SAMPLE_OBSTRUCTION)(H3DSAMPLE samp, F32 obstruction); +typedef void (AILCALL FAR * M3D_SET_3D_SAMPLE_OCCLUSION)(H3DSAMPLE samp, F32 occlusion); +typedef void (AILCALL FAR * M3D_SET_3D_SAMPLE_EXCLUSION)(H3DSAMPLE samp, F32 exclusion); +typedef void (AILCALL FAR * M3D_SET_3D_SAMPLE_EFFECTS_LEVEL)(H3DSAMPLE samp, F32 effects_level); +typedef F32 (AILCALL FAR * M3D_3D_SAMPLE_OBSTRUCTION)(H3DSAMPLE samp); +typedef F32 (AILCALL FAR * M3D_3D_SAMPLE_OCCLUSION)(H3DSAMPLE samp); +typedef F32 (AILCALL FAR * M3D_3D_SAMPLE_EXCLUSION)(H3DSAMPLE samp); +typedef F32 (AILCALL FAR * M3D_3D_SAMPLE_EFFECTS_LEVEL)(H3DSAMPLE samp); + +typedef F32 (AILCALL FAR * M3D_3D_ROLLOFF_FACTOR)(void); +typedef void (AILCALL FAR * M3D_SET_3D_ROLLOFF_FACTOR)(F32 factor); +typedef F32 (AILCALL FAR * M3D_3D_DOPPLER_FACTOR)(void); +typedef void (AILCALL FAR * M3D_SET_3D_DOPPLER_FACTOR)(F32 factor); +typedef F32 (AILCALL FAR * M3D_3D_DISTANCE_FACTOR)(void); +typedef void (AILCALL FAR * M3D_SET_3D_DISTANCE_FACTOR)(F32 factor); + +typedef AIL3DSAMPLECB (AILCALL FAR * M3D_SET_3D_EOS)(H3DSAMPLE client,H3DSAMPLE samp,AIL3DSAMPLECB cb); + +typedef void (AILCALL FAR * M3D_SET_3D_SAMPLE_CONE)(H3DSAMPLE samp, F32 inner_angle, F32 outer_angle, F32 outer_volume); +typedef void (AILCALL FAR * M3D_3D_SAMPLE_CONE)(H3DSAMPLE samp, F32 FAR* inner_angle, F32 FAR* outer_angle, F32 FAR* outer_volume); + +//############################################################################ +//## ## +//## Interface "MSS mixer services" ## +//## ## +//############################################################################ + +// +// Operation flags used by mixer module +// + +#define M_DEST_STEREO 1 // Set to enable stereo mixer output +#define M_SRC_16 2 // Set to enable mixing of 16-bit samples +#define M_FILTER 4 // Set to enable filtering when resampling +#define M_SRC_STEREO 8 // Set to enable mixing of stereo input samples +#define M_VOL_SCALING 16 // Set to enable volume scalars other than 2048 +#define M_RESAMPLE 32 // Set to enable playback ratios other than 65536 +#define M_ORDER 64 // Set to reverse L/R stereo order for sample + +#ifdef IS_32 + +// +// Initialize mixer +// +// No other mixer functions may be called outside a MIXER_startup() / +// MIXER_shutdown() pair, except for the standard RIB function +// PROVIDER_query_attribute(). All provider attributes must be accessible +// without starting up the module. +// + +typedef void (AILCALL FAR *MIXER_STARTUP)(void); + +// +// Shut down mixer +// + +typedef void (AILCALL FAR *MIXER_SHUTDOWN)(void); + +// +// Flush mixer buffer +// + +typedef void (AILCALL FAR *MIXER_FLUSH) (S32 FAR *dest, + S32 len +#ifdef IS_X86 + ,U32 MMX_available +#endif + ); + +// +// Perform audio mixing operation +// + +typedef void (AILCALL FAR *MIXER_MERGE) (void const FAR * FAR *src, + U32 FAR *src_fract, + void const FAR *src_end, + S32 FAR * FAR *dest, + void FAR *dest_end, + S32 FAR *left_val, + S32 FAR *right_val, + S32 playback_ratio, + S32 scale_left, + S32 scale_right, + U32 operation +#ifdef IS_X86 + ,U32 MMX_available +#endif + ); + +// +// Translate mixer buffer contents to final output format +// + +#ifdef IS_MAC + +typedef void (AILCALL FAR *MIXER_COPY) (void const FAR *src, + S32 src_len, + void FAR *dest, + U32 operation, + U32 big_endian_output); +#else + +typedef void (AILCALL FAR *MIXER_COPY) (void const FAR *src, + S32 src_len, + void FAR *dest, + U32 operation, + U32 MMX_available); +#endif +#else + +// +// Initialize mixer +// +// No other mixer functions may be called outside a MIXER_startup() / +// MIXER_shutdown() pair, except for the standard RIB function +// PROVIDER_query_attribute(). All provider attributes must be accessible +// without starting up the module. +// + +typedef void (AILCALL FAR *MIXER_STARTUP)(void); + +// +// Shut down mixer +// + +typedef void (AILCALL FAR *MIXER_SHUTDOWN)(void); + +// +// Flush mixer buffer +// + +typedef void (AILCALL FAR *MIXER_FLUSH) (S32 FAR *dest, + S32 len, + U32 MMX_available); + +// +// Perform audio mixing operation +// + +typedef void (AILCALL FAR *MIXER_MERGE) (U32 src_sel, + U32 dest_sel, + U32 FAR *src_fract, + U32 FAR *src_offset, + U32 FAR *dest_offset, + U32 src_end_offset, + U32 dest_end_offset, + S32 FAR *left_val, + S32 FAR *right_val, + S32 playback_ratio, + S32 scale_both, + U32 operation); + +// +// Translate mixer buffer contents to final output format +// + +typedef void (AILCALL FAR *MIXER_COPY) (void const FAR *src, + S32 src_len, + void FAR *dest, + U32 operation, + U32 MMX_available); +#endif + +// +// Type definitions +// + +struct _DIG_DRIVER; + +struct _MDI_DRIVER; + +typedef struct _DIG_DRIVER FAR * HDIGDRIVER; // Handle to digital driver + +typedef struct _MDI_DRIVER FAR * HMDIDRIVER; // Handle to XMIDI driver + +typedef struct _SAMPLE FAR * HSAMPLE; // Handle to sample + +typedef struct _SEQUENCE FAR * HSEQUENCE; // Handle to sequence + +typedef S32 HTIMER; // Handle to timer + + +#ifdef IS_DOS + +// +// Type definitions +// + +typedef struct // I/O parameters structure +{ + S16 IO; + S16 IRQ; + S16 DMA_8_bit; + S16 DMA_16_bit; + S32 IO_reserved[4]; +} +IO_PARMS; + +typedef struct // Standard MSS 3.X VDI driver header +{ + S8 ID[8]; // "AIL3xxx" ID string, followed by ^Z + + U32 driver_version; + + REALFAR common_IO_configurations; + U16 num_IO_configurations; + + REALFAR environment_string; + + IO_PARMS IO; + + S16 service_rate; + + U16 busy; + + U16 driver_num; // Driver number + + U16 this_ISR; // Offset of INT 66H dispatcher + REALFAR prev_ISR; // Pointer to previous INT 66H ISR + + S8 scratch[128]; // Shared scratch workspace + + S8 dev_name[80]; // Device name (VDI version >= 1.12 only) +} +VDI_HDR; + +typedef struct +{ + U16 minimum_physical_sample_rate; + U16 nominal_physical_sample_rate; + U16 maximum_physical_sample_rate; + + U16 minimum_DMA_half_buffer_size; + U16 maximum_DMA_half_buffer_size; + + U32 flags; +} +DIG_MODE; + +typedef struct +{ + U8 format_supported[16]; + DIG_MODE format_data[16]; +} +DIG_DDT; + +typedef struct +{ + REALFAR DMA_buffer_A; + REALFAR DMA_buffer_B; + S16 active_buffer; +} +DIG_DST; + +typedef struct +{ + REALFAR library_environment; + REALFAR GTL_suffix; + + U16 num_voices; + + U16 max_melodic_channel; + U16 min_melodic_channel; + U16 percussion_channel; +} +MDI_DDT; + +typedef struct +{ + S8 library_directory[128]; + S8 GTL_filename[128]; + + S8 MIDI_data[512]; +} +MDI_DST; + +typedef struct // Initialization file structure +{ + char device_name[128]; // Device name + char driver_name[128]; // Driver filename + IO_PARMS IO; // I/O parameters for driver +} +AIL_INI; + +typedef struct // Handle to driver +{ + REALFAR seg; // Seg:off pointer to driver (off=0) + U32 sel; // Selector for driver (off=0) + void *buf; // Protected-mode pointer to driver + U32 size; // Size of driver image + VDI_HDR *VHDR; // Pointer to driver header (same as buf) + S32 type; // AIL3DIG or AIL3MDI (see below) + + S32 initialized; // 1 if hardware successfully init'd, else 0 + + S32 PM_ISR; // -1 if no PM ISR hooked, else IRQ # + + HTIMER server; // DRV_SERVE periodic timer, if requested + + // Vector to high-level destructor, if any + + void (AILCALL *destructor)(HDIGDRIVER); + + // High-level descriptor (DIG_ or MDI_DRIVER) + void *descriptor; +} +AIL_DRIVER; + +typedef struct // VDI interface register structure +{ + S16 AX; + S16 BX; + S16 CX; + S16 DX; + S16 SI; + S16 DI; +} +VDI_CALL; + +#endif + +// +// Function pointer types +// + +typedef void (AILCALLBACK FAR* AILINCB) (void const FAR *data, S32 len, U32 user_data); + +typedef void (AILCALLBACK FAR* AILTIMERCB) (U32 user); + +typedef void (AILCALLBACK FAR* AILSAMPLECB) (HSAMPLE sample); + +typedef S32 (AILCALLBACK FAR* AILEVENTCB) (HMDIDRIVER hmi,HSEQUENCE seq,S32 status,S32 data_1,S32 data_2); + +typedef S32 (AILCALLBACK FAR* AILTIMBRECB) (HMDIDRIVER hmi,S32 bank,S32 patch); + +typedef S32 (AILCALLBACK FAR* AILPREFIXCB) (HSEQUENCE seq,S32 log,S32 data); + +typedef void (AILCALLBACK FAR* AILTRIGGERCB) (HSEQUENCE seq,S32 log,S32 data); + +typedef void (AILCALLBACK FAR* AILBEATCB) (HMDIDRIVER hmi,HSEQUENCE seq,S32 beat,S32 measure); + +typedef void (AILCALLBACK FAR* AILSEQUENCECB) (HSEQUENCE seq); + +// +// Handle to sample and driver being managed by pipeline filter +// + +typedef S32 HSAMPLESTATE; +typedef S32 HDRIVERSTATE; + +// +// Digital pipeline stages +// +// These are the points at which external modules may be installed into +// a given HSAMPLE or HDIGDRIVER's processing pipeline +// + +typedef enum +{ + DP_ASI_DECODER=0, // Must be "ASI codec stream" provider + DP_FILTER, // Must be "MSS pipeline filter" provider + DP_MERGE, // Must be "MSS mixer" provider + N_SAMPLE_STAGES, // Placeholder for end of list (= # of valid stages) + SAMPLE_ALL_STAGES // Used to signify all pipeline stages, for shutdown +} +SAMPLESTAGE; + +typedef enum +{ + DP_FLUSH = 0, // Must be "MSS mixer" provider + DP_DEFAULT_FILTER, // Must be "MSS pipeline filter" provider (sets the default) + DP_DEFAULT_MERGE, // Must be "MSS mixer" provider (sets the default) + DP_COPY, // Must be "MSS mixer" provider + N_DIGDRV_STAGES, // Placeholder for end of list (= # of valid stages) + DIGDRV_ALL_STAGES // Used to signify all pipeline stages, for shutdown +} +DIGDRVSTAGE; + +typedef struct + { + ASI_STREAM_OPEN ASI_stream_open; + ASI_STREAM_PROCESS ASI_stream_process; + ASI_STREAM_SEEK ASI_stream_seek; + ASI_STREAM_CLOSE ASI_stream_close; + ASI_STREAM_ATTRIBUTE ASI_stream_attribute; + ASI_STREAM_SET_PREFERENCE ASI_stream_set_preference; + + HATTRIB INPUT_BIT_RATE; + HATTRIB INPUT_SAMPLE_RATE; + HATTRIB INPUT_BITS; + HATTRIB INPUT_CHANNELS; + HATTRIB OUTPUT_BIT_RATE; + HATTRIB OUTPUT_SAMPLE_RATE; + HATTRIB OUTPUT_BITS; + HATTRIB OUTPUT_CHANNELS; + HATTRIB POSITION; + HATTRIB PERCENT_DONE; + HATTRIB MIN_INPUT_BLOCK_SIZE; + HATTRIB RAW_RATE; + HATTRIB RAW_BITS; + HATTRIB RAW_CHANNELS; + HATTRIB REQUESTED_RATE; + HATTRIB REQUESTED_BITS; + HATTRIB REQUESTED_CHANS; + + HASISTREAM stream; + } +ASISTAGE; + +typedef struct + { + MIXER_FLUSH MSS_mixer_flush; + MIXER_MERGE MSS_mixer_merge; + MIXER_COPY MSS_mixer_copy; + } +MIXSTAGE; + +typedef struct + { + struct _FLTPROVIDER FAR *provider; + HSAMPLESTATE sample_state; + } +FLTSTAGE; + +typedef struct +{ + S32 active; // Pass-through if 0, active if 1 + HPROVIDER provider; + + union + { + ASISTAGE ASI; + MIXSTAGE MIX; + FLTSTAGE FLT; + } + TYPE; +} +DPINFO; + +// +// Other data types +// + +typedef struct _AIL_INPUT_INFO // Input descriptor type +{ + U32 device_ID; // DS LPGUID or wave device ID + U32 hardware_format; // e.g., DIG_F_STEREO_16 + U32 hardware_rate; // e.g., 22050 + AILINCB callback; // Callback function to receive incoming data + S32 buffer_size; // Maximum # of bytes to be passed to callback (-1 to use DIG_INPUT_LATENCY) + U32 user_data; // this is a user defined value +} +AIL_INPUT_INFO; + +typedef struct _AILTIMER // Timer instance +{ + U32 status; + AILTIMERCB callback; + U32 user; + + S32 elapsed; + S32 value; + S32 callingCT; // Calling EXE's task number (16 bit only) + S32 callingDS; // Calling EXE's DS (used in 16 bit only) +} AILTIMERSTR; + +typedef struct _ADPCMDATATAG +{ + U32 blocksize; + U32 extrasamples; + U32 blockleft; + U32 step; + U32 savesrc; + U32 sample; + U32 destend; + U32 srcend; + U32 samplesL; + U32 samplesR; + U16 moresamples[16]; +} ADPCMDATA; + +typedef struct LOWPASS_CONSTANT_INFO +{ + S32 A; + S32 B0, B1; +} LOWPASS_CONSTANT_INFO; + +typedef struct LOWPASS_UPDATED_INFO +{ + S32 XL0, XL1; + S32 YL0, YL1; + S32 XR0, XR1; + S32 YR0, YR1; +} LOWPASS_UPDATED_INFO; + +typedef struct LOWPASS_INFO +{ + LOWPASS_UPDATED_INFO u; + LOWPASS_CONSTANT_INFO c; + F32 cutoff; + S32 on; +} LOWPASS_INFO; + +typedef struct _SAMPLE // Sample instance +{ + char tag[4]; // HSAM + + HDIGDRIVER driver; // Driver for playback + + U32 status; // SMP_ flags: _FREE, _DONE, _PLAYING + + void const FAR *start[2]; // Sample buffer address (W) + U32 len [2]; // Sample buffer size in bytes (W) + U32 pos [2]; // Index to next byte (R/W) + U32 done [2]; // Nonzero if buffer with len=0 sent by app + S32 reset_ASI [2]; // Reset the ASI decoder at the end of the buffer + + U32 src_fract; // Fractional part of source address + S32 left_val; // Mixer source value from end of last buffer + S32 right_val; // Mixer source value from end of last buffer + + S32 current_buffer; // Buffer # active (0/1) + S32 last_buffer; // Last active buffer (for double-buffering) + S32 starved; // Buffer stream has run out of data + + S32 loop_count; // # of cycles-1 (1=one-shot, 0=indefinite) + S32 loop_start; // Starting offset of loop block (0=SOF) + S32 loop_end; // End offset of loop block (-1=EOF) + + S32 format; // DIG_F format (8/16 bits, mono/stereo) + U32 flags; // DIG_PCM_SIGN / DIG_PCM_ORDER (stereo only) + + S32 playback_rate; // Playback rate in hertz + + F32 save_volume; // Sample volume 0-1.0 + F32 save_pan; // Mono panpot/stereo balance (0=L ... 1.0=R) + + F32 left_volume; // Left/mono volume 0 to 1.0 + F32 right_volume; // Right volume 0 to 1.0 + + F32 wet_level; // reverb level 0 to 1.0 + F32 dry_level; // non-reverb level 0 to 1.0 + + LOWPASS_INFO lp; // low pass info + S32 service_type; // 1 if single-buffered; 2 if streamed + + AILSAMPLECB SOB; // Start-of-block callback function + AILSAMPLECB EOB; // End-of-buffer callback function + AILSAMPLECB EOS; // End-of-sample callback function + + S32 user_data [8]; // Miscellaneous user data + S32 system_data[8]; // Miscellaneous system data + + ADPCMDATA adpcm; + +#ifdef IS_WINDOWS + + // + // DirectSound-specific data + // + + S32 secondary_buffer; // Secondary buffer index + + S32 service_interval; // Service sample every n ms + S32 service_tick; // Current service countdown value + S32 buffer_segment_size; // Buffer segment size to fill + + S32 prev_segment; // Previous segment # (0...n) + S32 prev_cursor; // Previous play cursor location + + S32 bytes_remaining; // # of bytes left to play (if not -1) + + S32 direct_control; // 1 if app controls buffer, 0 if MSS + +#endif + + S32 doeob; // Flags to trigger callbacks + S32 dosob; + S32 doeos; + + // + // Sample pipeline stages + // + + DPINFO pipeline[N_SAMPLE_STAGES]; +} +SAMPLE; + +#if defined(IS_WINDOWS) || defined(IS_MAC) + +DXDEC U32 AILCALL AIL_get_timer_highest_delay (void); + +DXDEC void AILCALL AIL_serve(void); + +#ifdef IS_MAC + +typedef void * LPSTR; + +#define WHDR_DONE 0 + +typedef struct _WAVEIN +{ + long temp; +} * HWAVEIN; + +typedef struct _WAVEHDR +{ + S32 dwFlags; + S32 dwBytesRecorded; + S32 dwUser; + S32 temp; + void * lpData; + S32 dwBufferLength; + S32 longdwLoops; + S32 dwLoops; + void * lpNext; + U32 * reserved; + +} WAVEHDR, * LPWAVEHDR; + +#endif + +typedef struct _DIG_INPUT_DRIVER FAR *HDIGINPUT; // Handle to digital input driver + +typedef struct _DIG_INPUT_DRIVER // Handle to digital input driver +{ + C8 tag[4]; // HDIN + + HTIMER background_timer; // Background timer handle + + AIL_INPUT_INFO info; // Input device descriptor + + S32 input_enabled; // 1 if enabled, 0 if not + +#ifndef IS_MAC + + U32 callback_user; // Callback user value + + // + // Provider-independent data + // + + U32 DMA_size; // Size of each DMA sub-buffer in bytes + void FAR *DMA[2]; // Simulated DMA buffers + + U8 silence; // Silence value for current format (0 or 128) + + S32 device_active; // 1 if buffers submittable, 0 if not + + // + // waveOut-specific data + // + + HWAVEIN hWaveIn; // Handle to wave input device + volatile WAVEHDR wavehdr[2]; // Handles to wave headers + +#else + Boolean timer_started; + Boolean locked; + Boolean enter_lock; + U32 saved_period; + + void* my_vars; + + // + // Input related + // + + U32 input_buffer_size; + char * input_buffers[2]; + + // + // Mix related + // + + char * build_buffer; + U32 build_buffer_size; + + // + // Output related + // + struct + { + S8 * buffer; + S8 * buffer_end; + + U32 size; + S8 * right_margine; + S8 * current_head; + S8 * current_tail; + } output_buffer; + + S32 mix_operation; + S32 playback_ratio; + U32 src_fract; + S8 * current_head; + S32 left_val; + S32 right_val; + + U32 stored_sample_size; + U32 stored_number_of_channels; + + U32 last_rw_delta; + U32 period; + +#endif +} +DIG_INPUT_DRIVER; + +#endif + +typedef struct REVERB_CONSTANT_INFO +{ + F32 FAR* start0, FAR* start1, FAR* start2, FAR* start3, FAR* start4, FAR* start5; + F32 FAR* end0, FAR* end1, FAR* end2, FAR* end3, FAR* end4, FAR* end5; + F32 C0, C1, C2, C3, C4, C5; + F32 A; + F32 B0, B1; +} REVERB_CONSTANT_INFO; + +typedef struct REVERB_UPDATED_INFO +{ + F32 FAR * address0, FAR * address1, FAR * address2, FAR * address3, FAR * address4, FAR * address5; + F32 X0, X1, Y0, Y1; +} REVERB_UPDATED_INFO; + +typedef struct REVERB_INFO +{ + REVERB_UPDATED_INFO u; + REVERB_CONSTANT_INFO c; +} REVERB_INFO; + +typedef struct _DIG_DRIVER // Handle to digital audio driver +{ + char tag[4]; // HDIG + + HTIMER backgroundtimer; // Background timer handle + + S32 quiet; // # of consecutive quiet sample periods + + S32 n_active_samples; // # of samples being processed + + F32 master_volume; // Master sample volume 0-1.0 + + S32 DMA_rate; // Hardware sample rate + S32 hw_format; // DIG_F code in use + U32 hw_mode_flags; // DIG_PCM_ flags for mode in use + + S32 channels_per_sample; // # of channels per sample (1 or 2) + S32 bytes_per_channel; // # of bytes per channel (1 or 2) + S32 channels_per_buffer; // # of channels per half-buffer + S32 samples_per_buffer; // # of samples per half-buffer + + S32 playing; // Playback active if non-zero + +#ifdef IS_MAC + U32 n_samples_allocated; + U32 n_samples_used; + U32 n_samples_played; + SAMPLE *samples; // Pointer to SAMPLEs + U32 total_buffer_size; + + HDIGDRIVER next; // Pointer to next HDIGDRIVER in use + U32 reset_works; // TRUE if OK to do waveOutReset + U32 request_reset; // If nonzero, do waveOutReset ASAP + S32 released; // has the sound manager been released? + + ExtSoundHeader sound_header; + SndChannelPtr sound_channel; + SndCallBackUPP global_callback; + Ptr buffers[2]; + U32 loaded[2]; + U32 work_buffer; + U32 play_buffer; +#else + HSAMPLE samples; // Pointer to list of SAMPLEs +#endif + + S32 n_samples; // # of SAMPLEs + + S32 build_size; // # of bytes in build buffer + S32 FAR *build_buffer; // Build buffer (4 * samples_per_buffer) + + S32 system_data[8]; // Miscellaneous system data + + S32 buffer_size; // Size of each output buffer + +#ifdef IS_WINDOWS + + // + // waveOut-specific interface data + // + + HWAVEOUT hWaveOut; // Wave output driver + + U32 reset_works; // TRUE if OK to do waveOutReset + U32 request_reset; // If nonzero, do waveOutReset ASAP + + LPWAVEHDR first; // Pointer to first WAVEHDR in chain + S32 n_buffers; // # of output WAVEHDRs in chain + + LPWAVEHDR volatile FAR *return_list; // Circular list of returned WAVEHDRs + S32 volatile return_head; // Head of WAVEHDR list (insertion point) + S32 volatile return_tail; // Tail of WAVEHDR list (retrieval point) + + + U32 deviceid; // id from waveout open + PCMWAVEFORMAT wformat; // format from waveout open + + // + // DirectSound-specific interface data + // + + U32 guid; // The guid id of the ds driver + AILLPDIRECTSOUND pDS; // DirectSound output driver (don't + // use with Smacker directly anymore!) + + U32 ds_priority; // priority opened with + + S32 emulated_ds; // is ds emulated or not? + AILLPDIRECTSOUNDBUFFER lppdsb; // primary buffer or null + + U32 dsHwnd; // HWND used with DirectSound + + AILLPDIRECTSOUNDBUFFER FAR * lpbufflist; // List of pointers to secondary buffers + HSAMPLE FAR *samp_list; // HSAMPLE associated with each buffer + S32 FAR *sec_format; // DIG_F_ format for secondary buffer + S32 max_buffs; // Max. allowable # of secondary buffers + + // + // Misc. data + // + + S32 released; // has the sound manager been released? + + U32 foreground_timer; // Foreground timer handle + + HDIGDRIVER next; // Pointer to next HDIGDRIVER in use + S32 callingCT; // Calling EXE's task number (16 bit only) + S32 callingDS; // Calling EXE's DS (used in 16 bit only) + + // + // Vars for waveOut emulation + // + + S32 DS_initialized; + + AILLPDIRECTSOUNDBUFFER DS_sec_buff; // Secondary buffer (or NULL if none) + AILLPDIRECTSOUNDBUFFER DS_out_buff; // Output buffer (may be sec or prim) + S32 DS_buffer_size; // Size of entire output buffer + + S32 DS_frag_cnt; // Total fragment count and size, and + S32 DS_frag_size; // last fragment occupied by play cursor + S32 DS_last_frag; + S32 DS_last_write; + S32 DS_last_timer; + S32 DS_skip_time; + + S32 DS_use_default_format; // 1 to force use of default DS primary buffer format + +#else + + #ifdef IS_DOS + + // must be first in the DOS section + void *DMA[2]; // Protected-mode pointers to half-buffers + // (note that DMA[0] may != DMA_buf) + + + REALFAR DMA_seg; // Seg:off pointer to DMA buffers (off=0) + U32 DMA_sel; // Selector for DMA buffers (off=0) + void *DMA_buf; // Protected-mode pointer to DMA buffers + + S16 *buffer_flag; // Protected-mode pointer to buffer flag + S32 last_buffer; // Last active buffer flag value in driver + + AIL_DRIVER *drvr; // Base driver descriptor + + DIG_DDT *DDT; // Protected-mode pointer to DDT + DIG_DST *DST; // Protected-mode pointer to DST + + #endif + +#endif + + F32 master_wet; // Master reverb level 0-1.0 + F32 master_dry; // Master non-reverb level 0-1.0 + +#ifdef IS_X86 + S32 use_MMX; // Use MMX with this driver if TRUE +#endif + + U32 us_count; + U32 ms_count; + U32 last_ms_polled; + U32 last_percent; + + // + // Digital driver pipeline stages + // + + DPINFO pipeline[N_DIGDRV_STAGES]; + + // + // Reverb buffer + // + + REVERB_INFO ri; + + S32 FAR *reverb_build_buffer; + S32 reverb_build_size; + S32 reverb_buffer_size; + S32 reverb_on; + U32 reverb_off_time; + + U32 reverb_duration; + + F32 reverb_time; + F32 reverb_damping; + F32 reverb_predelay; + + U32 reverb_into; + U32 reverb_outof; + +#ifdef IS_WINDOWS + S32 no_wom_done; // don't process WOM_DONEs on this driver + U32 wom_done_buffers; +#endif +} +DIG_DRIVER; + +typedef struct // MIDI status log structure + { + S32 program [NUM_CHANS]; // Program Change + S32 pitch_l [NUM_CHANS]; // Pitch Bend LSB + S32 pitch_h [NUM_CHANS]; // Pitch Bend MSB + + S32 c_lock [NUM_CHANS]; // Channel Lock + S32 c_prot [NUM_CHANS]; // Channel Lock Protection + S32 c_mute [NUM_CHANS]; // Channel Mute + S32 c_v_prot [NUM_CHANS]; // Voice Protection + S32 bank [NUM_CHANS]; // Patch Bank Select + S32 gm_bank_l [NUM_CHANS]; // GM Bank Select + S32 gm_bank_m [NUM_CHANS]; // GM Bank Select + S32 indirect [NUM_CHANS]; // ICA indirect controller value + S32 callback [NUM_CHANS]; // Callback Trigger + + S32 mod [NUM_CHANS]; // Modulation + S32 vol [NUM_CHANS]; // Volume + S32 pan [NUM_CHANS]; // Panpot + S32 exp [NUM_CHANS]; // Expression + S32 sus [NUM_CHANS]; // Sustain + S32 reverb [NUM_CHANS]; // Reverb + S32 chorus [NUM_CHANS]; // Chorus + + S32 bend_range[NUM_CHANS]; // Bender Range (data MSB, RPN 0 assumed) + + S32 RPN_L [NUM_CHANS]; // RPN # LSB + S32 RPN_M [NUM_CHANS]; // RPN # MSB + } +CTRL_LOG; + +typedef struct _SEQUENCE // XMIDI sequence state table +{ + char tag[4]; // HSEQ + + HMDIDRIVER driver; // Driver for playback + + U32 status; // SEQ_ flags + + void const FAR *TIMB; // XMIDI IFF chunk pointers + void const FAR *RBRN; + void const FAR *EVNT; + + U8 const FAR *EVNT_ptr; // Current event pointer + + U8 FAR *ICA; // Indirect Controller Array + + AILPREFIXCB prefix_callback; // XMIDI Callback Prefix handler + AILTRIGGERCB trigger_callback; // XMIDI Callback Trigger handler + AILBEATCB beat_callback; // XMIDI beat/bar change handler + AILSEQUENCECB EOS; // End-of-sequence callback function + + S32 loop_count; // 0=one-shot, -1=indefinite, ... + + S32 interval_count; // # of intervals until next event + S32 interval_num; // # of intervals since start + + S32 volume; // Sequence volume 0-127 + S32 volume_target; // Target sequence volume 0-127 + S32 volume_accum; // Accumulated volume period + S32 volume_period; // Period for volume stepping + + S32 tempo_percent; // Relative tempo percentage 0-100 + S32 tempo_target; // Target tempo 0-100 + S32 tempo_accum; // Accumulated tempo period + S32 tempo_period; // Period for tempo stepping + S32 tempo_error; // Error counter for tempo DDA + + S32 beat_count; // Sequence playback position + S32 measure_count; + + S32 time_numerator; // Sequence timing data + S32 time_fraction; + S32 beat_fraction; + S32 time_per_beat; + + void const FAR *FOR_ptrs[FOR_NEST]; // Loop stack + S32 FOR_loop_count [FOR_NEST]; + + S32 chan_map [NUM_CHANS]; // Physical channel map for sequence + + CTRL_LOG shadow; // Controller values for sequence + + S32 note_count; // # of notes "on" + + S32 note_chan [MAX_NOTES]; // Channel for queued note (-1=free) + S32 note_num [MAX_NOTES]; // Note # for queued note + S32 note_time [MAX_NOTES]; // Remaining duration in intervals + + S32 user_data [8]; // Miscellaneous user data + S32 system_data[8]; // Miscellaneous system data + +} SEQUENCE; + +#ifdef IS_MAC + +struct MIDIHDR; +struct MIDIOUT; +typedef struct MIDIOUT* HMIDIOUT; + +#endif + +typedef struct _MDI_DRIVER // Handle to XMIDI driver +{ + char tag[4]; // HMDI + + HTIMER timer; // XMIDI quantization timer + S32 interval_time; // XMIDI quantization timer interval in uS + + S32 disable; // > 0 to disable XMIDI service + + HSEQUENCE sequences; // Pointer to list of SEQUENCEs + S32 n_sequences; // # of SEQUENCEs + + S32 lock [NUM_CHANS]; // 1 if locked, 2 if protected, else 0 + HSEQUENCE locker[NUM_CHANS]; // HSEQUENCE which locked channel + HSEQUENCE owner [NUM_CHANS]; // HSEQUENCE which owned locked channel + HSEQUENCE user [NUM_CHANS]; // Last sequence to use channel + S32 state [NUM_CHANS]; // Lock state prior to being locked + + S32 notes [NUM_CHANS]; // # of active notes in channel + + AILEVENTCB event_trap; // MIDI event trap callback function + AILTIMBRECB timbre_trap; // Timbre request callback function + + S32 master_volume; // Master XMIDI note volume 0-127 + + S32 system_data[8]; // Miscellaneous system data + +#if defined(IS_WINDOWS) || defined(IS_MAC) + + S32 released; // has the hmidiout handle been released + U32 deviceid; // ID of the MIDI device + U8 FAR *sysdata; // SysEx buffer + +#endif + +#ifdef IS_WINDOWS + + MIDIHDR FAR *mhdr; // SysEx header + + HMDIDRIVER next; // Pointer to next HMDIDRIVER in use + S32 callingCT; // Calling EXE's task number (16 bit only) + S32 callingDS; // Calling EXE's DS (used in 16 bit only) + + HMIDIOUT hMidiOut; // MIDI output driver + +#else + + #ifdef IS_DOS + + S32 message_count; // MIDI message count + S32 offset; // MIDI buffer offset + + AIL_DRIVER *drvr; // Base driver descriptor + + MDI_DDT *DDT; // Protected-mode pointer to DDT + MDI_DST *DST; // Protected-mode pointer to DST + #else + #ifdef IS_MAC + struct MIDIHDR FAR *mhdr; // SysEx header + HMDIDRIVER next; // Pointer to next HMDIDRIVER in use + HMIDIOUT hMidiOut; // MIDI output driver + U32 last_us_time; + long period_counter; + long current_period_sum; + #endif + #endif + +#endif + +} +MDI_DRIVER; + +typedef struct // XMIDI TIMB IFF chunk + { + S8 name[4]; + + U8 msb; + U8 lsb; + U8 lsb2; + U8 lsb3; + + U16 n_entries; + + U16 timbre[1]; + } +TIMB_chunk; + +typedef struct // XMIDI RBRN IFF entry + { + S16 bnum; + U32 offset; + } +RBRN_entry; + +typedef struct // Wave library entry +{ + S32 bank; // XMIDI bank, MIDI patch for sample + S32 patch; + + S32 root_key; // Root MIDI note # for sample (or -1) + + U32 file_offset; // Offset of wave data from start-of-file + U32 size; // Size of wave sample in bytes + + S32 format; // DIG_F format (8/16 bits, mono/stereo) + U32 flags; // DIG_PCM_SIGN / DIG_PCM_ORDER (stereo) + S32 playback_rate; // Playback rate in hertz +} +WAVE_ENTRY; + +typedef struct // Virtual "wave synthesizer" descriptor +{ + HMDIDRIVER mdi; // MIDI driver for use with synthesizer + HDIGDRIVER dig; // Digital driver for use with synthesizer + + WAVE_ENTRY FAR *library; // Pointer to wave library + + AILEVENTCB prev_event_fn; // Previous MIDI event trap function + AILTIMBRECB prev_timb_fn; // Previous timbre request trap function + + CTRL_LOG controls; // MIDI controller states + + WAVE_ENTRY FAR *wave [NUM_CHANS];// Pointer to WAVE_ENTRY for each channel + + HSAMPLE S [MAX_W_VOICES]; // List of HSAMPLE voices + S32 n_voices; // Actual # of voices allocated to synth + + S32 chan [MAX_W_VOICES]; // MIDI channel for each voice, or -1 + S32 note [MAX_W_VOICES]; // MIDI note number for voice + S32 root [MAX_W_VOICES]; // MIDI root note for voice + S32 rate [MAX_W_VOICES]; // Playback rate for voice + S32 vel [MAX_W_VOICES]; // MIDI note velocity for voice + U32 time [MAX_W_VOICES]; // Timestamp for voice + + U32 event; // Event counter for LRU timestamps +} +WAVE_SYNTH; + +typedef WAVE_SYNTH FAR * HWAVESYNTH;// Handle to virtual wave synthesizer + +// +// Handle to thread which called AIL_startup() +// +// This thread is suspended by MSS callback threads, to simulate DOS-style +// interrupt handler behavior +// + +#ifdef IS_WIN32 + +extern HANDLE hAppThread; + +#endif + +// +// Background flag for timers +// + +extern volatile S32 AIL_bkgnd_flag; + +// +// Global preference array +// + +extern S32 AIL_preference [N_PREFS]; + +// +// DIG_DRIVER list +// + +extern HDIGDRIVER DIG_first; + +// +// MDI_DRIVER list +// + +extern HMDIDRIVER MDI_first; + +// +// Miscellaneous system services +// + +#define FILE_READ_WITH_SIZE ((void FAR*)(S32)-1) + +#ifndef NO_OLD_SYS_FUNCTIONS + +#define MEM_alloc_lock AIL_mem_alloc_lock +#define MEM_free_lock AIL_mem_free_lock +#define FILE_error AIL_file_error +#define FILE_size AIL_file_size +#define FILE_read AIL_file_read +#define FILE_write AIL_file_write + +#ifdef IS_DOS + +#define MEM_alloc AIL_mem_alloc +#define MEM_free AIL_mem_free +#define MEM_use_malloc AIL_mem_use_malloc +#define MEM_use_free AIL_mem_use_free +#define MEM_alloc_DOS AIL_mem_alloc_DOS +#define MEM_free_DOS AIL_mem_free_DOS +#define VMM_lock_range AIL_vmm_lock_range +#define VMM_unlock_range AIL_vmm_unlock_range +#define VMM_lock AIL_vmm_lock +#define VMM_unlock AIL_vmm_unlock + +#endif + +#endif + +extern S32 AILCALLBACK DP_ASI_DECODER_callback(U32 user, + void FAR *dest, + S32 bytes_requested, + S32 offset); + +DXDEC void FAR * AILCALL AIL_mem_alloc_lock(U32 size); +DXDEC void AILCALL AIL_mem_free_lock (void FAR *ptr); + +DXDEC S32 AILCALL AIL_file_error (void); + +DXDEC S32 AILCALL AIL_file_size (char const FAR *filename); + +DXDEC void FAR * AILCALL AIL_file_read (char const FAR *filename, + void FAR *dest); + +DXDEC S32 AILCALL AIL_file_write (char const FAR *filename, + void const FAR *buf, + U32 len); + +DXDEC S32 AILCALL AIL_WAV_file_write + (char const FAR *filename, + void const FAR *buf, + U32 len, + S32 rate, + S32 format); + +DXDEC S32 AILCALL AIL_file_append (char const FAR *filename, + void const FAR *buf, U32 len); + +#ifndef IS_DOS + +typedef void FAR * (AILCALLBACK FAR *AILMEMALLOCCB)(U32 size); +typedef void (AILCALLBACK FAR *AILMEMFREECB)(void FAR *); + +DXDEC void FAR * AILCALL AIL_mem_use_malloc(AILMEMALLOCCB fn); +DXDEC void FAR * AILCALL AIL_mem_use_free (AILMEMFREECB fn); + +#endif + +#ifdef IS_MAC + + +DXDEC S32 AILCALL AIL_file_fss_size(FSSpec const FAR *filename); + +DXDEC void FAR * AILCALL AIL_file_fss_read(FSSpec const FAR *filename, + void FAR *dest); + +DXDEC S32 AILCALL AIL_file_fss_write(FSSpec const FAR *filename, + void const FAR *buf, + U32 len); + +DXDEC S32 AILCALL AIL_file_fss_attrib_write + (FSSpec const FAR *filename, + void const FAR *buf, + U32 len, + U32 type, + U32 creator ); + +DXDEC S32 AILCALL AIL_WAV_file_fss_write + (FSSpec const FAR *filename, + void const FAR *buf, + U32 len, + S32 rate, + S32 format); + +#endif + +#ifdef IS_DOS + +extern void * AILCALLBACK (*AIL_mem_alloc) (U32); +extern void AILCALLBACK (*AIL_mem_free) (void *); + +void * cdecl AIL_mem_use_malloc(void * AILCALLBACK (*fn)(U32)); +void * cdecl AIL_mem_use_free (void AILCALLBACK (*fn)(void *)); + +// +// Other memory-management functions +// + +DXDEC S32 AILCALL AIL_mem_alloc_DOS (U32 n_paras, + void **protected_ptr, + U32 *segment_far_ptr, + U32 *selector); + +DXDEC void AILCALL AIL_mem_free_DOS (void *protected_ptr, + U32 segment_far_ptr, + U32 selector); + +DXDEC S32 AILCALL AIL_vmm_lock_range (void *p1, void *p2); +DXDEC S32 AILCALL AIL_vmm_unlock_range (void *p1, void *p2); + +DXDEC S32 AILCALL AIL_vmm_lock (void *start, U32 size); +DXDEC S32 AILCALL AIL_vmm_unlock (void *start, U32 size); + +DXDEC U32 AILCALL AIL_sel_base (U32 sel); + +DXDEC void AILCALL AIL_sel_set_limit (U32 sel, + U32 limit); +// +// Last IO_PARMS structure used to attempt device detection +// + +extern IO_PARMS AIL_last_IO_attempt; + +// +// Low-level support services +// + +DXDEC REALFAR AILCALL AIL_get_real_vect (U32 vectnum); + +DXDEC void AILCALL AIL_set_real_vect (U32 vectnum, + REALFAR real_ptr); + +DXDEC void AILCALL AIL_set_USE16_ISR (S32 IRQ, + REALFAR real_base, + U32 ISR_offset); + +DXDEC void AILCALL AIL_restore_USE16_ISR (S32 IRQ); + +DXDEC U32 AILCALL AIL_disable_interrupts (void); +DXDEC void AILCALL AIL_restore_interrupts (U32 FD_register); + +DXDEC void AILCALL AIL_switch_stack (void *stack, + U32 size, + U32 *SS, + void **ESP, + void **EBP); + +DXDEC void AILCALL AIL_restore_stack (U32 SS, + void *ESP, + void *EBP); + +DXDEC S32 AILCALL AIL_call_driver (AIL_DRIVER *drvr, + S32 fn, + VDI_CALL *in, + VDI_CALL *out); + +DXDEC S32 AILCALL AIL_read_INI (AIL_INI *INI, + char *filename); + +DXDEC U32 AILCALL AIL_interrupt_divisor (void); + +#endif + + +#ifdef __WATCOMC__ + +void MSSBreakPoint(); +#pragma aux MSSBreakPoint = "int 3"; + +#else + +#define MSSBreakPoint() __asm {int 3} + +#endif + + +// +// High-level support services +// + +#ifdef IS_MAC + +#if !defined(max) +#define max(a,b) (((a) > (b)) ? (a) : (b)) +#endif +#if !defined(min) +#define min(a,b) (((a) < (b)) ? (a) : (b)) +#endif + +#endif + +#ifdef IS_DOS + +#ifdef IS_WATCOM + +#if !defined(max) // Watcom stdlib.h doesn't define these for C++ +#define max(a,b) (((a) > (b)) ? (a) : (b)) +#endif +#if !defined(min) +#define min(a,b) (((a) < (b)) ? (a) : (b)) +#endif + +#endif + +#ifdef __SW_3R +extern S32 AILCALL AIL_startup_reg (void); +#define AIL_startup AIL_startup_reg +#else +extern S32 AILCALL AIL_startup_stack (void); +#define AIL_startup AIL_startup_stack +#endif + +#define AIL_quick_startup(ud,um,opr,opb,ops) AIL_quick_startup_with_start(&AIL_startup,ud,um,opr,opb,ops) + +#define AIL_get_preference(number) (AIL_preference[number]) + +#else + +DXDEC S32 AILCALL AIL_startup (void); + +DXDEC S32 AILCALL AIL_get_preference (U32 number); + +#endif + +DXDEC void AILCALL AIL_shutdown (void); + +DXDEC S32 AILCALL AIL_set_preference (U32 number, + S32 value); + +DXDEC char FAR *AILCALL AIL_last_error (void); + +DXDEC void AILCALL AIL_set_error (char const FAR * error_msg); + +// +// Low-level support services +// + +DXDEC void +#ifndef IS_MAC +__cdecl +#endif +AIL_debug_printf (C8 const FAR *fmt, ...); + +#ifdef IS_X86 + +DXDEC U32 AILCALL AIL_MMX_available (void); + +#endif + +DXDEC void AILCALL AIL_lock (void); +DXDEC void AILCALL AIL_unlock (void); + +#if defined(IS_WIN32) || defined(IS_MAC) + +DXDEC void AILCALL AIL_lock_mutex (void); +DXDEC void AILCALL AIL_unlock_mutex (void); + +#endif + +DXDEC void AILCALL AIL_delay (S32 intervals); + +DXDEC S32 AILCALL AIL_background (void); + +// +// Process services +// + +DXDEC HTIMER AILCALL AIL_register_timer (AILTIMERCB fn); + +DXDEC U32 AILCALL AIL_set_timer_user (HTIMER timer, + U32 user); + +DXDEC void AILCALL AIL_set_timer_period (HTIMER timer, + U32 microseconds); + +DXDEC void AILCALL AIL_set_timer_frequency (HTIMER timer, + U32 hertz); + +DXDEC void AILCALL AIL_set_timer_divisor (HTIMER timer, + U32 PIT_divisor); + +DXDEC void AILCALL AIL_start_timer (HTIMER timer); +DXDEC void AILCALL AIL_start_all_timers (void); + +DXDEC void AILCALL AIL_stop_timer (HTIMER timer); +DXDEC void AILCALL AIL_stop_all_timers (void); + +DXDEC void AILCALL AIL_release_timer_handle (HTIMER timer); +DXDEC void AILCALL AIL_release_all_timers (void); + +#ifdef IS_WIN32 + +#ifndef BUILD_MSS + +// static function that handles shutdown +int __cdecl MSS_auto_cleanup(void); + +#ifdef _MSC_VER +// on MSVC, automatically register a cleanup function +#define AIL_startup() (MSS_auto_cleanup(),AIL_startup()) +#endif + +#endif + +DXDEC HWND AILCALL AIL_HWND (void); + +#else + #ifdef IS_MAC + DXDEC ProcessSerialNumber AIL_Process(void); + #endif +#endif + +// +// high-level digital services +// + +DXDEC HDIGDRIVER AILCALL AIL_open_digital_driver( U32 frequency, + S32 bits, + S32 channel, + U32 flags ); + +#define AIL_OPEN_DIGITAL_FORCE_PREFERENCE 1 + +DXDEC void AILCALL AIL_close_digital_driver( HDIGDRIVER dig ); + +#ifdef IS_WINDOWS + +#define AIL_MSS_version(str,len) \ +{ \ + HINSTANCE l=LoadLibrary(MSSDLLNAME); \ + if ((U32)l<=32) \ + *(str)=0; \ + else { \ + LoadString(l,1,str,len); \ + FreeLibrary(l); \ + } \ +} + +DXDEC S32 AILCALL AIL_waveOutOpen (HDIGDRIVER FAR *drvr, + LPHWAVEOUT FAR *lphWaveOut, + S32 wDeviceID, + LPWAVEFORMAT lpFormat); + +DXDEC void AILCALL AIL_waveOutClose (HDIGDRIVER drvr); + +DXDEC S32 AILCALL AIL_digital_handle_release(HDIGDRIVER drvr); + +DXDEC S32 AILCALL AIL_digital_handle_reacquire + (HDIGDRIVER drvr); + +#else + +#ifdef IS_MAC + +typedef struct MSS_VersionType_ +{ + Str255 version_name; +} MSS_VersionType; + +#define AIL_MSS_version(str,len) \ +{ \ + long _res = HOpenResFile(0,0,"\p" MSSDLLNAME,fsRdPerm); \ + if (_res==-1) \ + { \ + str[0]=0; \ + } \ + else \ + { \ + Handle _H; \ + short _Err; \ + long _cur= CurResFile(); \ + UseResFile(_res); \ + _H = GetResource('vers', 2); \ + _Err = ResError(); \ + if((_Err != noErr) || (_H==0)) \ + { \ + str[0]=0; \ + UseResFile(_cur); \ + CloseResFile(_res); \ + } \ + else \ + { \ + if (GetHandleSize(_H)==0) \ + { \ + str[0]=0; \ + UseResFile(_cur); \ + CloseResFile(_res); \ + } \ + else \ + { \ + MSS_VersionType * _vt = (MSS_VersionType*)*_H; \ + if ((U32)_vt->version_name[6]>4) \ + _vt->version_name[6]-=4; \ + else \ + _vt->version_name[6]=0; \ + if (((U32)len) <= ((U32)_vt->version_name[6])) \ + _vt->version_name[6] = (U8)len-1; \ + memcpy( str, _vt->version_name+11, _vt->version_name[6] ); \ + str[_vt->version_name[6]]=0; \ + UseResFile(_cur); \ + CloseResFile(_res); \ + } \ + ReleaseResource(_H); \ + } \ + } \ +} + +DXDEC S32 AILCALL AIL_digital_handle_release(HDIGDRIVER drvr); + +DXDEC S32 AILCALL AIL_digital_handle_reacquire + (HDIGDRIVER drvr); + +#else + +// +// DOS installation services +// + +DXDEC IO_PARMS * AILCALL AIL_get_IO_environment (AIL_DRIVER *drvr); + +DXDEC AIL_DRIVER* AILCALL AIL_install_driver (U8 const *driver_image, + U32 n_bytes); + +DXDEC void AILCALL AIL_uninstall_driver (AIL_DRIVER *drvr); + +DXDEC S32 AILCALL AIL_install_DIG_INI (HDIGDRIVER *dig); + +DXDEC HDIGDRIVER AILCALL AIL_install_DIG_driver_file + (char const *filename, + IO_PARMS *IO); + +DXDEC void AILCALL AIL_uninstall_DIG_driver (HDIGDRIVER dig); + + +DXDEC HDIGDRIVER AILCALL AIL_install_DIG_driver_image + (void const *driver_image, + U32 size, + IO_PARMS *IO); +#endif +#endif + +DXDEC char FAR* AILCALL AIL_set_redist_directory(char const FAR*dir); + +DXDEC S32 AILCALL AIL_digital_CPU_percent (HDIGDRIVER dig); + +DXDEC S32 AILCALL AIL_digital_latency (HDIGDRIVER dig); + +DXDEC HSAMPLE AILCALL AIL_allocate_sample_handle + (HDIGDRIVER dig); + +DXDEC HSAMPLE AILCALL AIL_allocate_file_sample (HDIGDRIVER dig, + void const FAR *file_image, + S32 block); + +DXDEC void AILCALL AIL_release_sample_handle (HSAMPLE S); + +DXDEC void AILCALL AIL_init_sample (HSAMPLE S); + +DXDEC S32 AILCALL AIL_set_sample_file (HSAMPLE S, + void const FAR *file_image, + S32 block); + +DXDEC S32 AILCALL AIL_set_named_sample_file (HSAMPLE S, + C8 const FAR *file_type_suffix, + void const FAR *file_image, + S32 file_size, + S32 block); + +DXDEC HPROVIDER AILCALL AIL_set_sample_processor (HSAMPLE S, + SAMPLESTAGE pipeline_stage, + HPROVIDER provider); + +DXDEC HPROVIDER AILCALL AIL_set_digital_driver_processor + (HDIGDRIVER dig, + DIGDRVSTAGE pipeline_stage, + HPROVIDER provider); + +DXDEC void AILCALL AIL_set_sample_adpcm_block_size + (HSAMPLE S, + U32 blocksize); + +DXDEC void AILCALL AIL_set_sample_address (HSAMPLE S, + void const FAR *start, + U32 len); + +DXDEC void AILCALL AIL_set_sample_type (HSAMPLE S, + S32 format, + U32 flags); + +DXDEC void AILCALL AIL_start_sample (HSAMPLE S); + +DXDEC void AILCALL AIL_stop_sample (HSAMPLE S); + +DXDEC void AILCALL AIL_resume_sample (HSAMPLE S); + +DXDEC void AILCALL AIL_end_sample (HSAMPLE S); + +DXDEC void AILCALL AIL_set_sample_playback_rate + (HSAMPLE S, + S32 playback_rate); + +DXDEC void AILCALL AIL_set_sample_volume_pan (HSAMPLE S, + F32 volume, + F32 pan); + +DXDEC void AILCALL AIL_set_sample_volume_levels(HSAMPLE S, + F32 left_level, + F32 right_level); + +DXDEC void AILCALL AIL_set_sample_reverb_levels(HSAMPLE S, + F32 dry_level, + F32 wet_level); + +DXDEC void AILCALL AIL_set_sample_low_pass_cut_off(HSAMPLE S, + F32 cut_off); + +DXDEC void AILCALL AIL_set_sample_loop_count (HSAMPLE S, + S32 loop_count); + +DXDEC void AILCALL AIL_set_sample_loop_block (HSAMPLE S, + S32 loop_start_offset, + S32 loop_end_offset); + +DXDEC U32 AILCALL AIL_sample_status (HSAMPLE S); + +DXDEC S32 AILCALL AIL_sample_playback_rate (HSAMPLE S); + +DXDEC void AILCALL AIL_sample_volume_pan (HSAMPLE S, F32 FAR* volume, F32 FAR* pan); + +DXDEC void AILCALL AIL_sample_volume_levels (HSAMPLE S, + F32 FAR * left_level, + F32 FAR * right_level); + +DXDEC void AILCALL AIL_sample_reverb_levels (HSAMPLE S, + F32 FAR * dry_level, + F32 FAR * wet_level); + +DXDEC F32 AILCALL AIL_sample_low_pass_cut_off(HSAMPLE S); + +DXDEC S32 AILCALL AIL_sample_loop_count (HSAMPLE S); + +DXDEC void AILCALL AIL_set_digital_master_volume_level + (HDIGDRIVER dig, + F32 master_volume); + +DXDEC F32 AILCALL AIL_digital_master_volume_level (HDIGDRIVER dig); + +DXDEC void AILCALL AIL_set_digital_master_room_type + (HDIGDRIVER dig, + S32 room_type); + +DXDEC void AILCALL AIL_set_digital_master_reverb + (HDIGDRIVER dig, + F32 reverb_time, + F32 reverb_predelay, + F32 reverb_damping); + +DXDEC void AILCALL AIL_digital_master_reverb + (HDIGDRIVER dig, + F32 FAR* reverb_time, + F32 FAR* reverb_predelay, + F32 FAR* reverb_damping); + +DXDEC void AILCALL AIL_set_digital_master_reverb_levels + (HDIGDRIVER dig, + F32 dry_level, + F32 wet_level); + +DXDEC void AILCALL AIL_digital_master_reverb_levels + (HDIGDRIVER dig, + F32 FAR * dry_level, + F32 FAR * wet_level); + + +// +// low-level digital services +// + +DXDEC S32 AILCALL AIL_minimum_sample_buffer_size(HDIGDRIVER dig, + S32 playback_rate, + S32 format); + +DXDEC S32 AILCALL AIL_sample_buffer_ready (HSAMPLE S); + +DXDEC void AILCALL AIL_load_sample_buffer (HSAMPLE S, + U32 buff_num, + void const FAR *buffer, + U32 len); + +DXDEC void AILCALL AIL_request_EOB_ASI_reset (HSAMPLE S, + U32 buff_num); + +DXDEC S32 AILCALL AIL_sample_buffer_info (HSAMPLE S, //) + U32 FAR *pos0, + U32 FAR *len0, + U32 FAR *pos1, + U32 FAR *len1); + +DXDEC U32 AILCALL AIL_sample_granularity (HSAMPLE S); + +DXDEC void AILCALL AIL_set_sample_position (HSAMPLE S, + U32 pos); + +DXDEC U32 AILCALL AIL_sample_position (HSAMPLE S); + +DXDEC AILSAMPLECB AILCALL AIL_register_SOB_callback + (HSAMPLE S, + AILSAMPLECB SOB); + +DXDEC AILSAMPLECB AILCALL AIL_register_EOB_callback + (HSAMPLE S, + AILSAMPLECB EOB); + +DXDEC AILSAMPLECB AILCALL AIL_register_EOS_callback + (HSAMPLE S, + AILSAMPLECB EOS); + +DXDEC AILSAMPLECB AILCALL AIL_register_EOF_callback + (HSAMPLE S, + AILSAMPLECB EOFILE); + +DXDEC void AILCALL AIL_set_sample_user_data (HSAMPLE S, + U32 index, + S32 value); + +DXDEC S32 AILCALL AIL_sample_user_data (HSAMPLE S, + U32 index); + +DXDEC S32 AILCALL AIL_active_sample_count (HDIGDRIVER dig); + +DXDEC void AILCALL AIL_digital_configuration (HDIGDRIVER dig, + S32 FAR *rate, + S32 FAR *format, + char FAR *string); +#ifdef IS_WIN32 + +DXDEC S32 AILCALL AIL_set_direct_buffer_control (HSAMPLE S, + U32 command); + +DXDEC void AILCALL AIL_get_DirectSound_info (HSAMPLE S, + AILLPDIRECTSOUND *lplpDS, + AILLPDIRECTSOUNDBUFFER *lplpDSB); + +DXDEC S32 AILCALL AIL_set_DirectSound_HWND(HDIGDRIVER dig, HWND wnd); + +#endif + +DXDEC void AILCALL AIL_set_sample_ms_position (HSAMPLE S, //) + S32 milliseconds); + +DXDEC void AILCALL AIL_sample_ms_position (HSAMPLE S, //) + S32 FAR * total_milliseconds, + S32 FAR * current_milliseconds); + + +// +// Digital input services +// + +#if defined(IS_WINDOWS) || defined (IS_MAC) + +DXDEC HDIGINPUT AILCALL AIL_open_input (AIL_INPUT_INFO FAR *info); + +DXDEC void AILCALL AIL_close_input (HDIGINPUT dig); + +DXDEC AIL_INPUT_INFO FAR * + AILCALL AIL_get_input_info (HDIGINPUT dig); + +DXDEC S32 AILCALL AIL_set_input_state (HDIGINPUT dig, + S32 enable); +#endif + + +// +// High-level XMIDI services +// + +DXDEC HMDIDRIVER AILCALL AIL_open_XMIDI_driver( U32 flags ); + +#define AIL_OPEN_XMIDI_NULL_DRIVER 1 + +DXDEC void AILCALL AIL_close_XMIDI_driver( HMDIDRIVER mdi ); + +#ifdef IS_MAC + +DXDEC S32 AILCALL AIL_MIDI_handle_release + (HMDIDRIVER mdi); + +DXDEC S32 AILCALL AIL_MIDI_handle_reacquire + (HMDIDRIVER mdi); + +#else + +#ifdef IS_WINDOWS + +DXDEC S32 AILCALL AIL_midiOutOpen(HMDIDRIVER FAR *drvr, + LPHMIDIOUT FAR *lphMidiOut, + S32 dwDeviceID); + +DXDEC void AILCALL AIL_midiOutClose (HMDIDRIVER mdi); + +DXDEC S32 AILCALL AIL_MIDI_handle_release + (HMDIDRIVER mdi); + +DXDEC S32 AILCALL AIL_MIDI_handle_reacquire + (HMDIDRIVER mdi); + +#else + +#ifdef IS_DOS + +DXDEC S32 AILCALL AIL_install_MDI_INI (HMDIDRIVER *mdi); + +DXDEC HMDIDRIVER AILCALL AIL_install_MDI_driver_file + (char const *filename, + IO_PARMS *IO); + +DXDEC void AILCALL AIL_uninstall_MDI_driver (HMDIDRIVER mdi); + + +DXDEC HMDIDRIVER AILCALL AIL_install_MDI_driver_image + (void const *driver_image, + U32 size, + IO_PARMS *IO); + +DXDEC S32 AILCALL AIL_MDI_driver_type (HMDIDRIVER mdi); + +DXDEC void AILCALL AIL_set_GTL_filename_prefix (char const*prefix); + +DXDEC S32 AILCALL AIL_timbre_status (HMDIDRIVER mdi, + S32 bank, + S32 patch); + +DXDEC S32 AILCALL AIL_install_timbre (HMDIDRIVER mdi, + S32 bank, + S32 patch); + +DXDEC void AILCALL AIL_protect_timbre (HMDIDRIVER mdi, + S32 bank, + S32 patch); + +DXDEC void AILCALL AIL_unprotect_timbre (HMDIDRIVER mdi, + S32 bank, + S32 patch); + +#endif + +#endif + +#endif + +DXDEC HSEQUENCE AILCALL AIL_allocate_sequence_handle + (HMDIDRIVER mdi); + +DXDEC void AILCALL AIL_release_sequence_handle + (HSEQUENCE S); + +DXDEC S32 AILCALL AIL_init_sequence (HSEQUENCE S, + void const FAR *start, + S32 sequence_num); + +DXDEC void AILCALL AIL_start_sequence (HSEQUENCE S); + +DXDEC void AILCALL AIL_stop_sequence (HSEQUENCE S); + +DXDEC void AILCALL AIL_resume_sequence (HSEQUENCE S); + +DXDEC void AILCALL AIL_end_sequence (HSEQUENCE S); + +DXDEC void AILCALL AIL_set_sequence_tempo (HSEQUENCE S, + S32 tempo, + S32 milliseconds); + +DXDEC void AILCALL AIL_set_sequence_volume (HSEQUENCE S, + S32 volume, + S32 milliseconds); + +DXDEC void AILCALL AIL_set_sequence_loop_count + (HSEQUENCE S, + S32 loop_count); + +DXDEC U32 AILCALL AIL_sequence_status (HSEQUENCE S); + +DXDEC S32 AILCALL AIL_sequence_tempo (HSEQUENCE S); + +DXDEC S32 AILCALL AIL_sequence_volume (HSEQUENCE S); + +DXDEC S32 AILCALL AIL_sequence_loop_count (HSEQUENCE S); + +DXDEC void AILCALL AIL_set_XMIDI_master_volume + (HMDIDRIVER mdi, + S32 master_volume); + +DXDEC S32 AILCALL AIL_XMIDI_master_volume (HMDIDRIVER mdi); + + +// +// Low-level XMIDI services +// + +DXDEC S32 AILCALL AIL_active_sequence_count (HMDIDRIVER mdi); + +DXDEC S32 AILCALL AIL_controller_value (HSEQUENCE S, + S32 channel, + S32 controller_num); + +DXDEC S32 AILCALL AIL_channel_notes (HSEQUENCE S, + S32 channel); + +DXDEC void AILCALL AIL_sequence_position (HSEQUENCE S, + S32 FAR *beat, + S32 FAR *measure); + +DXDEC void AILCALL AIL_branch_index (HSEQUENCE S, + U32 marker); + +DXDEC AILPREFIXCB AILCALL AIL_register_prefix_callback + (HSEQUENCE S, + AILPREFIXCB callback); + +DXDEC AILTRIGGERCB AILCALL AIL_register_trigger_callback + (HSEQUENCE S, + AILTRIGGERCB callback); + +DXDEC AILSEQUENCECB AILCALL AIL_register_sequence_callback + (HSEQUENCE S, + AILSEQUENCECB callback); + +DXDEC AILBEATCB AILCALL AIL_register_beat_callback (HSEQUENCE S, + AILBEATCB callback); + +DXDEC AILEVENTCB AILCALL AIL_register_event_callback (HMDIDRIVER mdi, + AILEVENTCB callback); + +DXDEC AILTIMBRECB AILCALL AIL_register_timbre_callback + (HMDIDRIVER mdi, + AILTIMBRECB callback); + +DXDEC void AILCALL AIL_set_sequence_user_data (HSEQUENCE S, + U32 index, + S32 value); + +DXDEC S32 AILCALL AIL_sequence_user_data (HSEQUENCE S, + U32 index); + +DXDEC void AILCALL AIL_register_ICA_array (HSEQUENCE S, + U8 FAR *array); + +DXDEC S32 AILCALL AIL_lock_channel (HMDIDRIVER mdi); + +DXDEC void AILCALL AIL_release_channel (HMDIDRIVER mdi, + S32 channel); + +DXDEC void AILCALL AIL_map_sequence_channel (HSEQUENCE S, + S32 seq_channel, + S32 new_channel); + +DXDEC S32 AILCALL AIL_true_sequence_channel (HSEQUENCE S, + S32 seq_channel); + +DXDEC void AILCALL AIL_send_channel_voice_message + (HMDIDRIVER mdi, + HSEQUENCE S, + S32 status, + S32 data_1, + S32 data_2); + +DXDEC void AILCALL AIL_send_sysex_message (HMDIDRIVER mdi, + void const FAR *buffer); + +DXDEC HWAVESYNTH + AILCALL AIL_create_wave_synthesizer (HDIGDRIVER dig, + HMDIDRIVER mdi, + void const FAR *wave_lib, + S32 polyphony); + +DXDEC void AILCALL AIL_destroy_wave_synthesizer (HWAVESYNTH W); + +DXDEC void AILCALL AIL_set_sequence_ms_position (HSEQUENCE S, //) + S32 milliseconds); + +DXDEC void AILCALL AIL_sequence_ms_position(HSEQUENCE S, //) + S32 FAR *total_milliseconds, + S32 FAR *current_milliseconds); + + + +// +// red book functions +// + +#ifdef IS_DOS +typedef struct _REDBOOKTRACKINFO { + U32 tracks; + U32 trackstarts[100]; +} REDBOOKTRACKINFO; +#endif + +typedef struct _REDBOOK { + U32 DeviceID; + U32 paused; + U32 pausedsec; + U32 lastendsec; +#ifdef IS_DOS + U32 readcontents; + REDBOOKTRACKINFO info; +#endif +#ifdef IS_MAC + short vDRefNum; +#endif +} REDBOOK; + +typedef struct _REDBOOK FAR* HREDBOOK; + +#define REDBOOK_ERROR 0 +#define REDBOOK_PLAYING 1 +#define REDBOOK_PAUSED 2 +#define REDBOOK_STOPPED 3 + + +DXDEC HREDBOOK AILCALL AIL_redbook_open(U32 which); + +#ifdef IS_MAC +DXDEC HREDBOOK AILCALL AIL_redbook_open_volume(char const * drive); +#else +DXDEC HREDBOOK AILCALL AIL_redbook_open_drive(S32 drive); +#endif + +DXDEC void AILCALL AIL_redbook_close(HREDBOOK hand); + +DXDEC void AILCALL AIL_redbook_eject(HREDBOOK hand); + +DXDEC void AILCALL AIL_redbook_retract(HREDBOOK hand); + +DXDEC U32 AILCALL AIL_redbook_status(HREDBOOK hand); + +DXDEC U32 AILCALL AIL_redbook_tracks(HREDBOOK hand); + +DXDEC U32 AILCALL AIL_redbook_track(HREDBOOK hand); + +DXDEC void AILCALL AIL_redbook_track_info(HREDBOOK hand,U32 tracknum, + U32 FAR* startmsec,U32 FAR* endmsec); + +DXDEC U32 AILCALL AIL_redbook_id(HREDBOOK hand); + +DXDEC U32 AILCALL AIL_redbook_position(HREDBOOK hand); + +DXDEC U32 AILCALL AIL_redbook_play(HREDBOOK hand,U32 startmsec, U32 endmsec); + +DXDEC U32 AILCALL AIL_redbook_stop(HREDBOOK hand); + +DXDEC U32 AILCALL AIL_redbook_pause(HREDBOOK hand); + +DXDEC U32 AILCALL AIL_redbook_resume(HREDBOOK hand); + +DXDEC F32 AILCALL AIL_redbook_volume_level(HREDBOOK hand); + +DXDEC F32 AILCALL AIL_redbook_set_volume_level(HREDBOOK hand, F32 volume); + +#ifdef IS_WIN16 + #define AIL_ms_count timeGetTime + DXDEC U32 AILCALL AIL_us_count(void); +#else + DXDEC U32 AILCALL AIL_ms_count(void); + DXDEC U32 AILCALL AIL_us_count(void); +#endif + + +typedef struct _STREAM FAR* HSTREAM; // Handle to stream + +typedef void (AILCALLBACK FAR* AILSTREAMCB) (HSTREAM stream); + +typedef struct _STREAM { + + S32 block_oriented; // 1 if this is an ADPCM or ASI-compressed stream + S32 using_ASI; // 1 if using ASI decoder to uncompress stream data + ASISTAGE FAR *ASI; // handy pointer to our ASI coded + + HSAMPLE samp; // the sample handle + + U32 fileh; // the open file handle + + U8 FAR* bufs[3]; // the data buffers + U32 bufsizes[3]; // the size of each buffer + S32 reset_ASI[3]; // should we reset the ASI at the end of the buffer? + S32 bufstart[3]; // offset of where this buffer started + void FAR* asyncs[3];// async read structures + + S32 loadedbufstart[2]; // offset of where the loaded buffer started + S32 loadedorder[2]; // order of the buffers as they were loaded + S32 loadorder; // incremented as each buffer is loaded + + S32 bufsize; // size of each buffer + S32 readsize; // size of each read block + + U32 buf1; // 0,1,2 (current buffer that we are reading into) + S32 size1; // holds the current amount of data read + + U32 buf2; // 0,1,2 (the next buffer that we are reading into) + S32 size2; // next buffer loaded up to + + U32 buf3; // 0,1,2 (the next buffer that we are reading into) + S32 size3; // next buffer loaded up to + + U32 datarate; // datarate in bytes per second + S32 filerate; // original datarate of the file + S32 filetype; // file format type + U32 fileflags; // file format flags (signed or unsigned) + S32 totallen; // total length of the sound data + + S32 substart; // subblock loop start + S32 sublen; // subblock loop len + S32 subpadding; // amount to pad the final block + + U32 blocksize; // ADPCM block size + S32 padding; // padding to be done + S32 padded; // padding done + + S32 loadedsome; // have we done any loads? + + U32 startpos; // point that the sound data begins + U32 totalread; // total bytes read from the disk + + U32 loopsleft; // how many loops are left + + U32 error; // read error has occurred + + S32 preload; // preload the file into the first buffer + U32 preloadpos; // position to use in preload + S32 noback; // no background processing + S32 alldone; // alldone + S32 primeamount; // amount to load after a seek + S32 readatleast; // forced amount to read on next service + + S32 playcontrol; // control: 0=stopped, 1=started, |8=paused, |16=sample paused + + AILSTREAMCB callback; // end of stream callback + + S32 user_data[8]; // Miscellaneous user data + void FAR* next; // pointer to next stream + +#if defined(IS_WINDOWS) || defined(IS_MAC) + S32 autostreaming; // are we autostreaming this stream +#endif + + S32 docallback; // set when it time to poll for a callback +} MSTREAM_TYPE; + + +DXDEC HSTREAM AILCALL AIL_open_stream(HDIGDRIVER dig, char const FAR * filename, S32 stream_mem); + +DXDEC void AILCALL AIL_close_stream(HSTREAM stream); + +DXDEC S32 AILCALL AIL_service_stream(HSTREAM stream, S32 fillup); + +DXDEC void AILCALL AIL_start_stream(HSTREAM stream); + +DXDEC void AILCALL AIL_pause_stream(HSTREAM stream, S32 onoff); + +DXDEC void AILCALL AIL_set_stream_volume_pan(HSTREAM stream,F32 volume,F32 pan); + +DXDEC void AILCALL AIL_set_stream_volume_levels(HSTREAM S, + F32 left_level, + F32 right_level); + +DXDEC void AILCALL AIL_set_stream_reverb_levels(HSTREAM S, + F32 dry_level, + F32 wet_level); + +DXDEC void AILCALL AIL_set_stream_low_pass_cut_off(HSTREAM S, + F32 cut_off); + +DXDEC void AILCALL AIL_stream_volume_pan(HSTREAM stream,F32 FAR* volume, F32 FAR* pan); + +DXDEC void AILCALL AIL_stream_volume_levels(HSTREAM S, + F32 FAR * left_level, + F32 FAR * right_level); + +DXDEC void AILCALL AIL_stream_reverb_levels(HSTREAM S, + F32 FAR * dry_level, + F32 FAR * wet_level); + +DXDEC F32 AILCALL AIL_stream_low_pass_cut_off(HSTREAM S); + +DXDEC void AILCALL AIL_set_stream_playback_rate(HSTREAM stream, S32 rate); + +DXDEC S32 AILCALL AIL_stream_playback_rate(HSTREAM stream); + +DXDEC S32 AILCALL AIL_stream_loop_count(HSTREAM stream); + +DXDEC void AILCALL AIL_set_stream_loop_count(HSTREAM stream, S32 count); + +DXDEC void AILCALL AIL_set_stream_loop_block (HSTREAM S, + S32 loop_start_offset, + S32 loop_end_offset); + +DXDEC S32 AILCALL AIL_stream_status(HSTREAM stream); + +DXDEC void AILCALL AIL_set_stream_position(HSTREAM stream,S32 offset); + +DXDEC S32 AILCALL AIL_stream_position(HSTREAM stream); + +DXDEC void AILCALL AIL_stream_info(HSTREAM stream, S32 FAR* datarate, S32 FAR* sndtype, S32 FAR* length, S32 FAR* memory); + +DXDEC AILSTREAMCB AILCALL AIL_register_stream_callback(HSTREAM stream, AILSTREAMCB callback); + +DXDEC void AILCALL AIL_auto_service_stream(HSTREAM stream, S32 onoff); + +DXDEC void AILCALL AIL_set_stream_user_data (HSTREAM S, + U32 index, + S32 value); + +DXDEC S32 AILCALL AIL_stream_user_data (HSTREAM S, + U32 index); + +DXDEC void AILCALL AIL_set_stream_ms_position (HSTREAM S, + S32 milliseconds); + +DXDEC void AILCALL AIL_stream_ms_position (HSTREAM S, //) + S32 FAR * total_milliseconds, + S32 FAR * current_milliseconds); + +DXDEC HPROVIDER AILCALL AIL_set_stream_processor (HSTREAM S, + SAMPLESTAGE pipeline_stage, + HPROVIDER provider); + +#ifdef IS_MAC +typedef struct MSS_FILE +{ + S32 file_type; // 0 = char*, 1 = FSSpec* + void const FAR* file; +} MSS_FILE; +#else +typedef char MSS_FILE; +#endif + +typedef U32 (AILCALLBACK FAR*AIL_file_open_callback) (MSS_FILE const FAR* Filename, + U32 FAR* FileHandle); + +typedef void (AILCALLBACK FAR*AIL_file_close_callback) (U32 FileHandle); + +#define AIL_FILE_SEEK_BEGIN 0 +#define AIL_FILE_SEEK_CURRENT 1 +#define AIL_FILE_SEEK_END 2 + +typedef S32 (AILCALLBACK FAR*AIL_file_seek_callback) (U32 FileHandle, + S32 Offset, + U32 Type); + +typedef U32 (AILCALLBACK FAR*AIL_file_read_callback) (U32 FileHandle, + void FAR* Buffer, + U32 Bytes); + +DXDEC void AILCALL AIL_set_file_callbacks (AIL_file_open_callback opencb, + AIL_file_close_callback closecb, + AIL_file_seek_callback seekcb, + AIL_file_read_callback readcb); + +#ifdef IS_32 + +typedef void FAR* (AILCALLBACK FAR*AIL_file_async_read_callback) (U32 FileHandle, + void FAR* Buffer, + U32 Bytes); + +typedef S32 (AILCALLBACK FAR*AIL_file_async_status_callback) (void FAR* async, + S32 wait, + U32 FAR* BytesRead); + +DXDEC void AILCALL AIL_set_file_async_callbacks (AIL_file_open_callback opencb, + AIL_file_close_callback closecb, + AIL_file_seek_callback seekcb, + AIL_file_async_read_callback areadcb, + AIL_file_async_status_callback statuscb); + +#endif + +// +// High-level DLS functions +// + +typedef struct _DLSFILEID { + S32 id; + struct _DLSFILEID FAR* next; +} DLSFILEID; + +typedef struct _DLSFILEID FAR* HDLSFILEID; + +typedef struct _DLSDEVICE { + void FAR* pGetPref; + void FAR* pSetPref; + void FAR* pMSSOpen; + void FAR* pOpen; + void FAR* pClose; + void FAR* pLoadFile; + void FAR* pLoadMem; + void FAR* pUnloadFile; + void FAR* pUnloadAll; + void FAR* pGetInfo; + void FAR* pCompact; + void FAR* pSetAttr; + S32 DLSHandle; + U32 format; + U32 buffer_size; + void FAR* buffer[2]; + HSAMPLE sample; + HMDIDRIVER mdi; + HDIGDRIVER dig; + HDLSFILEID first; +#ifdef IS_WINDOWS + HMODULE lib; +#else + #ifdef IS_DOS + char FAR* DOSname; + #endif +#endif +} DLSDEVICE; + +typedef struct _DLSDEVICE FAR* HDLSDEVICE; + +typedef struct _AILDLSINFO { + char Description[128]; + S32 MaxDLSMemory; + S32 CurrentDLSMemory; + S32 LargestSize; + S32 GMAvailable; + S32 GMBankSize; +} AILDLSINFO; + +#ifdef IS_DOS + +typedef struct _AILDOSDLS { + char FAR* description; + void FAR* pDLSOpen; + void FAR* pMSSOpen; + void FAR* pOpen; + void FAR* pClose; + void FAR* pLoadFile; + void FAR* pLoadMem; + void FAR* pUnloadFile; + void FAR* pUnloadAll; + void FAR* pGetInfo; + void FAR* pCompact; + void FAR* pSetAttr; +} AILDOSDLS; + +#endif + + +DXDEC HDLSDEVICE AILCALL AIL_DLS_open(HMDIDRIVER mdi, HDIGDRIVER dig, +#if defined(IS_WINDOWS) || defined(IS_MAC) + char const FAR * libname, +#else + AILDOSDLS const FAR * dosdls, +#endif + U32 flags, U32 rate, S32 bits, S32 channels); + +// +// Parameters for the dwFlag used in DLSClose() and flags in AIL_DLS_close +// + +#define RETAIN_DLS_COLLECTION 0x00000001 +#define RETURN_TO_BOOTUP_STATE 0x00000002 +#define RETURN_TO_GM_ONLY_STATE 0x00000004 +#define DLS_COMPACT_MEMORY 0x00000008 + +DXDEC void AILCALL AIL_DLS_close(HDLSDEVICE dls, U32 flags); + +DXDEC HDLSFILEID AILCALL AIL_DLS_load_file(HDLSDEVICE dls, char const FAR* filename, U32 flags); + +DXDEC HDLSFILEID AILCALL AIL_DLS_load_memory(HDLSDEVICE dls, void const FAR* memfile, U32 flags); + +// +// other parameters for AIL_DLS_unload +// + +#define AIL_DLS_UNLOAD_MINE 0 +#define AIL_DLS_UNLOAD_ALL ((HDLSFILEID)(U32)(S32)-1) + +DXDEC void AILCALL AIL_DLS_unload(HDLSDEVICE dls, HDLSFILEID dlsid); + +DXDEC void AILCALL AIL_DLS_compact(HDLSDEVICE dls); + +DXDEC void AILCALL AIL_DLS_get_info(HDLSDEVICE dls, AILDLSINFO FAR* info, S32 FAR* PercentCPU); + +DXDEC void AILCALL AIL_DLS_set_reverb_levels(HDLSDEVICE dls, + F32 dry_level, + F32 wet_level); + +DXDEC void AILCALL AIL_DLS_get_reverb_levels(HDLSDEVICE dls, + F32 FAR* dry_level, + F32 FAR* wet_level); + +DXDEC HPROVIDER AILCALL AIL_set_DLS_processor (HDLSDEVICE dev, + SAMPLESTAGE pipeline_stage, + HPROVIDER provider); + + +// +// Quick-integration service functions and data types +// + +typedef struct +{ + U32 const FAR *data; + S32 size; + S32 type; + void FAR *handle; + S32 status; + void FAR* next; + S32 speed; + F32 volume; + F32 extravol; + F32 dry; + F32 wet; + F32 cutoff; + HDLSFILEID dlsid; + void FAR* dlsmem; + void FAR* dlsmemunc; + S32 milliseconds; + S32 length; + S32 userdata; +} +AUDIO_TYPE; + + +#define QSTAT_DONE 1 // Data has finished playing +#define QSTAT_LOADED 2 // Data has been loaded, but not yet played +#define QSTAT_PLAYING 3 // Data is currently playing + +typedef AUDIO_TYPE FAR * HAUDIO; // Generic handle to any audio data type + +#define AIL_QUICK_USE_WAVEOUT 2 +#define AIL_QUICK_MIDI_AND_DLS 2 +#define AIL_QUICK_DLS_ONLY 3 +#define AIL_QUICK_MIDI_AND_VORTEX_DLS 4 +#define AIL_QUICK_MIDI_AND_SONICVIBES_DLS 5 + +DXDEC S32 AILCALL +#if defined(IS_WINDOWS) || defined(IS_MAC) + AIL_quick_startup ( +#else + AIL_quick_startup_with_start(void* startup, +#endif + S32 use_digital, + S32 use_MIDI, + U32 output_rate, + S32 output_bits, + S32 output_channels); + +DXDEC void AILCALL AIL_quick_shutdown (void); + +DXDEC void AILCALL AIL_quick_handles (HDIGDRIVER FAR* pdig, + HMDIDRIVER FAR* pmdi, + HDLSDEVICE FAR* pdls ); + +DXDEC HAUDIO AILCALL AIL_quick_load (char const FAR *filename); + +#ifdef IS_MAC +DXDEC HAUDIO AILCALL AIL_quick_fss_load (FSSpec const FAR *filename); +#endif + +DXDEC HAUDIO AILCALL AIL_quick_load_mem (void const FAR *mem, + U32 size); + +DXDEC HAUDIO AILCALL AIL_quick_copy (HAUDIO audio); + +DXDEC void AILCALL AIL_quick_unload (HAUDIO audio); + +DXDEC S32 AILCALL AIL_quick_play (HAUDIO audio, + U32 loop_count); + +DXDEC void AILCALL AIL_quick_halt (HAUDIO audio); + +DXDEC S32 AILCALL AIL_quick_status (HAUDIO audio); + +DXDEC HAUDIO AILCALL AIL_quick_load_and_play (char const FAR *filename, + U32 loop_count, + S32 wait_request); + +#ifdef IS_MAC +DXDEC HAUDIO AILCALL AIL_quick_fss_load_and_play (FSSpec const FAR *filename, + U32 loop_count, + S32 wait_request); +#endif + +DXDEC void AILCALL AIL_quick_set_speed (HAUDIO audio, S32 speed); + +DXDEC void AILCALL AIL_quick_set_volume (HAUDIO audio, F32 volume, F32 extravol); + +DXDEC void AILCALL AIL_quick_set_reverb_levels (HAUDIO audio, + F32 dry_level, + F32 wet_level); + +DXDEC void AILCALL AIL_quick_set_low_pass_cut_off(HAUDIO S, + F32 cut_off); + +DXDEC void AILCALL AIL_quick_set_ms_position(HAUDIO audio,S32 milliseconds); + +DXDEC S32 AILCALL AIL_quick_ms_position(HAUDIO audio); + +DXDEC S32 AILCALL AIL_quick_ms_length(HAUDIO audio); + + +#define AIL_QUICK_XMIDI_TYPE 1 +#define AIL_QUICK_DIGITAL_TYPE 2 +#define AIL_QUICK_DLS_XMIDI_TYPE 3 +#define AIL_QUICK_MPEG_DIGITAL_TYPE 4 + +DXDEC S32 AILCALL AIL_quick_type(HAUDIO audio); + +// +// used for AIL_process +// + +typedef struct _AILMIXINFO { + AILSOUNDINFO Info; + ADPCMDATA mss_adpcm; + U32 src_fract; + S32 left_val; + S32 right_val; +} AILMIXINFO; + + + +DXDEC S32 AILCALL AIL_WAV_info(void const FAR* data, AILSOUNDINFO FAR* info); + +DXDEC S32 AILCALL AIL_size_processed_digital_audio( + U32 dest_rate, + U32 dest_format, + S32 num_srcs, + AILMIXINFO const FAR* src); + +DXDEC S32 AILCALL AIL_process_digital_audio( + void FAR *dest_buffer, + S32 dest_buffer_size, + U32 dest_rate, + U32 dest_format, + S32 num_srcs, + AILMIXINFO FAR* src); + +#define AIL_LENGTHY_INIT 0 +#define AIL_LENGTHY_SET_PREFERENCE 1 +#define AIL_LENGTHY_UPDATE 2 +#define AIL_LENGTHY_DONE 3 + +typedef S32 (AILCALLBACK FAR* AILLENGTHYCB)(U32 state,U32 user); + +typedef S32 (AILCALLBACK FAR* AILCODECSETPREF)(char const FAR* preference,U32 value); + +DXDEC S32 AILCALL AIL_compress_ASI(AILSOUNDINFO const FAR * info, //) + char const FAR* filename_ext, + void FAR* FAR* outdata, + U32 FAR* outsize, + AILLENGTHYCB callback); + +DXDEC S32 AILCALL AIL_decompress_ASI(void const FAR* indata, //) + U32 insize, + char const FAR* filename_ext, + void FAR* FAR* wav, + U32 FAR* wavsize, + AILLENGTHYCB callback); + +DXDEC S32 AILCALL AIL_compress_ADPCM(AILSOUNDINFO const FAR * info, + void FAR* FAR* outdata, U32 FAR* outsize); + +DXDEC S32 AILCALL AIL_decompress_ADPCM(AILSOUNDINFO const FAR * info, + void FAR* FAR* outdata, U32 FAR* outsize); + +DXDEC S32 AILCALL AIL_compress_DLS(void const FAR* dls, + char const FAR* compression_extension, + void FAR* FAR* mls, U32 FAR* mlssize, + AILLENGTHYCB callback); + +DXDEC S32 AILCALL AIL_merge_DLS_with_XMI(void const FAR* xmi, void const FAR* dls, + void FAR* FAR* mss, U32 FAR* msssize); + +DXDEC S32 AILCALL AIL_extract_DLS( void const FAR *source_image, //) + U32 source_size, + void FAR * FAR *XMI_output_data, + U32 FAR *XMI_output_size, + void FAR * FAR *DLS_output_data, + U32 FAR *DLS_output_size, + AILLENGTHYCB callback); + +#define AILFILTERDLS_USINGLIST 1 + +DXDEC S32 AILCALL AIL_filter_DLS_with_XMI(void const FAR* xmi, void const FAR* dls, + void FAR* FAR* dlsout, U32 FAR* dlssize, + S32 flags, AILLENGTHYCB callback); + +#define AILMIDITOXMI_USINGLIST 1 +#define AILMIDITOXMI_TOLERANT 2 + +DXDEC S32 AILCALL AIL_MIDI_to_XMI (void const FAR* MIDI, + U32 MIDI_size, + void FAR* FAR*XMIDI, + U32 FAR* XMIDI_size, + S32 flags); + +#define AILMIDILIST_ROLANDSYSEX 1 +#define AILMIDILIST_ROLANDUN 2 +#define AILMIDILIST_ROLANDAB 4 + +DXDEC S32 AILCALL AIL_list_MIDI (void const FAR* MIDI, + U32 MIDI_size, + char FAR* FAR* lst, + U32 FAR* lst_size, + S32 flags); +#define AILDLSLIST_ARTICULATION 1 +#define AILDLSLIST_DUMP_WAVS 2 + +DXDEC S32 AILCALL AIL_list_DLS (void const FAR* DLS, + char FAR* FAR* lst, + U32 FAR* lst_size, + S32 flags, + C8 FAR* title); + +#define AILFILETYPE_UNKNOWN 0 +#define AILFILETYPE_PCM_WAV 1 +#define AILFILETYPE_ADPCM_WAV 2 +#define AILFILETYPE_OTHER_WAV 3 +#define AILFILETYPE_VOC 4 +#define AILFILETYPE_MIDI 5 +#define AILFILETYPE_XMIDI 6 +#define AILFILETYPE_XMIDI_DLS 7 +#define AILFILETYPE_XMIDI_MLS 8 +#define AILFILETYPE_DLS 9 +#define AILFILETYPE_MLS 10 +#define AILFILETYPE_MPEG_L1_AUDIO 11 +#define AILFILETYPE_MPEG_L2_AUDIO 12 +#define AILFILETYPE_MPEG_L3_AUDIO 13 +#define AILFILETYPE_OTHER_ASI_WAV 14 + + +DXDEC S32 AILCALL AIL_file_type(void const FAR* data, U32 size); + +DXDEC S32 AILCALL AIL_find_DLS (void const FAR* data, U32 size, + void FAR* FAR* xmi, U32 FAR* xmisize, + void FAR* FAR* dls, U32 FAR* dlssize); + + +// +// RAD room types - currently the same as EAX +// + +enum +{ + ENVIRONMENT_GENERIC, // factory default + ENVIRONMENT_PADDEDCELL, + ENVIRONMENT_ROOM, // standard environments + ENVIRONMENT_BATHROOM, + ENVIRONMENT_LIVINGROOM, + ENVIRONMENT_STONEROOM, + ENVIRONMENT_AUDITORIUM, + ENVIRONMENT_CONCERTHALL, + ENVIRONMENT_CAVE, + ENVIRONMENT_ARENA, + ENVIRONMENT_HANGAR, + ENVIRONMENT_CARPETEDHALLWAY, + ENVIRONMENT_HALLWAY, + ENVIRONMENT_STONECORRIDOR, + ENVIRONMENT_ALLEY, + ENVIRONMENT_FOREST, + ENVIRONMENT_CITY, + ENVIRONMENT_MOUNTAINS, + ENVIRONMENT_QUARRY, + ENVIRONMENT_PLAIN, + ENVIRONMENT_PARKINGLOT, + ENVIRONMENT_SEWERPIPE, + ENVIRONMENT_UNDERWATER, + ENVIRONMENT_DRUGGED, + ENVIRONMENT_DIZZY, + ENVIRONMENT_PSYCHOTIC, + + ENVIRONMENT_COUNT // total number of environments +}; + +// +// enumerated values for EAX +// + +#ifndef EAX_H_INCLUDED + +enum +{ + EAX_ENVIRONMENT_GENERIC, // factory default + EAX_ENVIRONMENT_PADDEDCELL, + EAX_ENVIRONMENT_ROOM, // standard environments + EAX_ENVIRONMENT_BATHROOM, + EAX_ENVIRONMENT_LIVINGROOM, + EAX_ENVIRONMENT_STONEROOM, + EAX_ENVIRONMENT_AUDITORIUM, + EAX_ENVIRONMENT_CONCERTHALL, + EAX_ENVIRONMENT_CAVE, + EAX_ENVIRONMENT_ARENA, + EAX_ENVIRONMENT_HANGAR, + EAX_ENVIRONMENT_CARPETEDHALLWAY, + EAX_ENVIRONMENT_HALLWAY, + EAX_ENVIRONMENT_STONECORRIDOR, + EAX_ENVIRONMENT_ALLEY, + EAX_ENVIRONMENT_FOREST, + EAX_ENVIRONMENT_CITY, + EAX_ENVIRONMENT_MOUNTAINS, + EAX_ENVIRONMENT_QUARRY, + EAX_ENVIRONMENT_PLAIN, + EAX_ENVIRONMENT_PARKINGLOT, + EAX_ENVIRONMENT_SEWERPIPE, + EAX_ENVIRONMENT_UNDERWATER, + EAX_ENVIRONMENT_DRUGGED, + EAX_ENVIRONMENT_DIZZY, + EAX_ENVIRONMENT_PSYCHOTIC, + + EAX_ENVIRONMENT_COUNT // total number of environments +}; + +#define EAX_REVERBMIX_USEDISTANCE (-1.0F) + +#endif + + +#if defined(IS_WIN32) || defined(IS_MAC) + +// +// Auxiliary 2D interface calls +// + +DXDEC HDIGDRIVER AILCALL AIL_primary_digital_driver (HDIGDRIVER new_primary); + +// +// Filter result codes +// + +typedef S32 FLTRESULT; + +#define FLT_NOERR 0 // Success -- no error +#define FLT_NOT_ENABLED 1 // FLT not enabled +#define FLT_ALREADY_STARTED 2 // FLT already started +#define FLT_INVALID_PARAM 3 // Invalid parameters used +#define FLT_INTERNAL_ERR 4 // Internal error in FLT driver +#define FLT_OUT_OF_MEM 5 // Out of system RAM +#define FLT_ERR_NOT_IMPLEMENTED 6 // Feature not implemented +#define FLT_NOT_FOUND 7 // FLT supported device not found +#define FLT_NOT_INIT 8 // FLT not initialized +#define FLT_CLOSE_ERR 9 // FLT not closed correctly + +//############################################################################ +//## ## +//## Interface "MSS pipeline filter" ## +//## ## +//############################################################################ + +typedef FLTRESULT (AILCALL FAR *FLT_STARTUP)(void); + +typedef FLTRESULT (AILCALL FAR *FLT_SHUTDOWN)(void); + +typedef C8 FAR * (AILCALL FAR *FLT_ERROR)(void); + +typedef S32 (AILCALL FAR *FLT_SET_PROVIDER_PREFERENCE)(HATTRIB preference, + void const FAR* value); + +typedef HDRIVERSTATE (AILCALL FAR *FLT_OPEN_DRIVER) (HDIGDRIVER dig, + S32 FAR *build_buffer, + S32 build_buffer_size); + +typedef FLTRESULT (AILCALL FAR *FLT_CLOSE_DRIVER) (HDRIVERSTATE state); + +typedef void (AILCALL FAR *FLT_PREMIX_PROCESS) (HDRIVERSTATE driver); + +typedef void (AILCALL FAR *FLT_POSTMIX_PROCESS) (HDRIVERSTATE driver); + +//############################################################################ +//## ## +//## Interface "Pipeline filter sample services" ## +//## ## +//############################################################################ + +typedef HSAMPLESTATE (AILCALL FAR * FLTSMP_OPEN_SAMPLE) (HDRIVERSTATE driver, + HSAMPLE S); + +typedef FLTRESULT (AILCALL FAR * FLTSMP_CLOSE_SAMPLE) (HSAMPLESTATE state); + +typedef S32 (AILCALL FAR * FLTSMP_SAMPLE_PROCESS) (HSAMPLESTATE state, + void const FAR * FAR *orig_src, + U32 FAR * orig_src_fract, + void FAR * orig_src_end, + S32 FAR * FAR *build_dest, + void FAR * build_dest_end, + S32 FAR * left_val, + S32 FAR * right_val, + S32 playback_ratio, + S32 left_scale, + S32 right_scale, + MIXSTAGE FAR * mixer_provider, + U32 mixer_operation); + +typedef S32 (AILCALL FAR * FLTSMP_SAMPLE_ATTRIBUTE) (HSAMPLESTATE state, + HATTRIB attribute); + +typedef S32 (AILCALL FAR * FLTSMP_SET_SAMPLE_PREFERENCE) (HSAMPLESTATE state, + HATTRIB preference, + void const FAR* value); + +// +// Pipeline filter calls +// + +DXDEC S32 AILCALL AIL_enumerate_filters (HPROENUM FAR *next, + HPROVIDER FAR *dest, + C8 FAR * FAR *name); + +DXDEC HDRIVERSTATE + AILCALL AIL_open_filter (HPROVIDER lib, + HDIGDRIVER dig); + +DXDEC void AILCALL AIL_close_filter (HDRIVERSTATE filter); + +DXDEC S32 AILCALL AIL_enumerate_filter_attributes + (HPROVIDER lib, + HINTENUM FAR * next, + RIB_INTERFACE_ENTRY FAR * dest); + +DXDEC void AILCALL AIL_filter_attribute (HPROVIDER lib, + C8 const FAR* name, + void FAR * val); + +DXDEC void AILCALL AIL_set_filter_preference + (HPROVIDER lib, + C8 const FAR* name, + void const FAR* val); + +DXDEC S32 AILCALL AIL_enumerate_filter_sample_attributes + (HPROVIDER lib, + HINTENUM FAR * next, + RIB_INTERFACE_ENTRY FAR * dest); + +DXDEC void AILCALL AIL_filter_sample_attribute + (HSAMPLE S, + C8 const FAR* name, + void FAR * val); + +DXDEC void AILCALL AIL_filter_stream_attribute + (HSTREAM S, + C8 const FAR* name, + void FAR* val); + +DXDEC void AILCALL AIL_filter_DLS_attribute + (HDLSDEVICE dls, + C8 const FAR* name, + void FAR * val); + +DXDEC void AILCALL AIL_set_filter_sample_preference + (HSAMPLE S, + C8 const FAR * name, + void const FAR * val); + +DXDEC void AILCALL AIL_set_filter_stream_preference + (HSTREAM S, + C8 const FAR * name, + void const FAR * val); + +DXDEC void AILCALL AIL_set_filter_DLS_preference + (HDLSDEVICE dls, + C8 const FAR * name, + void const FAR * val); + +typedef struct _FLTPROVIDER +{ + PROVIDER_QUERY_ATTRIBUTE PROVIDER_query_attribute; + + FLT_STARTUP startup; + FLT_ERROR error; + FLT_SHUTDOWN shutdown; + FLT_SET_PROVIDER_PREFERENCE set_provider_preference; + FLT_OPEN_DRIVER open_driver; + FLT_CLOSE_DRIVER close_driver; + FLT_PREMIX_PROCESS premix_process; + FLT_POSTMIX_PROCESS postmix_process; + + FLTSMP_OPEN_SAMPLE open_sample; + FLTSMP_CLOSE_SAMPLE close_sample; + FLTSMP_SAMPLE_PROCESS sample_process; + FLTSMP_SAMPLE_ATTRIBUTE sample_attribute; + FLTSMP_SET_SAMPLE_PREFERENCE set_sample_preference; + + HDIGDRIVER dig; + HPROVIDER provider; + HDRIVERSTATE driver_state; + + struct _FLTPROVIDER FAR *next; +} +FLTPROVIDER; + +// +// 3D provider calls +// + +DXDEC S32 AILCALL AIL_enumerate_3D_providers (HPROENUM FAR *next, + HPROVIDER FAR *dest, + C8 FAR * FAR *name); + +DXDEC M3DRESULT AILCALL AIL_open_3D_provider (HPROVIDER lib); + +DXDEC void AILCALL AIL_close_3D_provider (HPROVIDER lib); + +DXDEC S32 AILCALL AIL_enumerate_3D_provider_attributes + (HPROVIDER lib, + HINTENUM FAR * next, + RIB_INTERFACE_ENTRY FAR * dest); + +DXDEC void AILCALL AIL_3D_provider_attribute (HPROVIDER lib, + C8 const FAR* name, + void FAR * val); + +DXDEC void AILCALL AIL_set_3D_provider_preference(HPROVIDER lib, + C8 const FAR* name, + void const FAR* val); + +struct H3D +{ + H3DPOBJECT actual; + HPROVIDER owner; + S32 user_data[8]; +}; + +typedef struct _M3DPROVIDER +{ + PROVIDER_QUERY_ATTRIBUTE PROVIDER_query_attribute; + M3D_STARTUP startup; + M3D_ERROR error; + M3D_SHUTDOWN shutdown; + M3D_SET_PROVIDER_PREFERENCE set_provider_preference; + M3D_ACTIVATE activate; + M3D_ALLOCATE_3D_SAMPLE_HANDLE allocate_3D_sample_handle; + M3D_RELEASE_3D_SAMPLE_HANDLE release_3D_sample_handle; + M3D_START_3D_SAMPLE start_3D_sample; + M3D_STOP_3D_SAMPLE stop_3D_sample; + M3D_RESUME_3D_SAMPLE resume_3D_sample; + M3D_END_3D_SAMPLE end_3D_sample; + M3D_SET_3D_SAMPLE_DATA set_3D_sample_data; + M3D_SET_3D_SAMPLE_VOLUME set_3D_sample_volume; + M3D_SET_3D_SAMPLE_PLAYBACK_RATE set_3D_sample_playback_rate; + M3D_SET_3D_SAMPLE_OFFSET set_3D_sample_offset; + M3D_SET_3D_SAMPLE_LOOP_COUNT set_3D_sample_loop_count; + M3D_SET_3D_SAMPLE_LOOP_BLOCK set_3D_sample_loop_block; + M3D_3D_SAMPLE_STATUS sample_status; + M3D_3D_SAMPLE_VOLUME sample_volume; + M3D_3D_SAMPLE_PLAYBACK_RATE sample_playback_rate; + M3D_3D_SAMPLE_OFFSET sample_offset; + M3D_3D_SAMPLE_LENGTH sample_length; + M3D_3D_SAMPLE_LOOP_COUNT sample_loop_count; + M3D_SET_3D_SAMPLE_DISTANCES set_3D_sample_distances; + M3D_3D_SAMPLE_DISTANCES sample_distances; + M3D_ACTIVE_3D_SAMPLE_COUNT active_3D_sample_count; + M3D_3D_OPEN_LISTENER open_listener; + M3D_3D_CLOSE_LISTENER close_listener; + M3D_3D_OPEN_OBJECT open_object; + M3D_3D_CLOSE_OBJECT close_object; + M3D_SET_3D_POSITION set_3D_position; + M3D_SET_3D_VELOCITY set_3D_velocity; + M3D_SET_3D_VELOCITY_VECTOR set_3D_velocity_vector; + M3D_SET_3D_ORIENTATION set_3D_orientation; + M3D_3D_POSITION position; + M3D_3D_VELOCITY velocity; + M3D_3D_ORIENTATION orientation; + M3D_3D_UPDATE_POSITION update_position; + M3D_3D_AUTO_UPDATE_POSITION auto_update_position; + M3D_3D_SAMPLE_ATTRIBUTE sample_query_attribute; + M3D_3D_SET_SAMPLE_PREFERENCE set_sample_preference; + M3D_3D_ROOM_TYPE room_type; + M3D_SET_3D_ROOM_TYPE set_3D_room_type; + M3D_3D_SPEAKER_TYPE speaker_type; + M3D_SET_3D_SPEAKER_TYPE set_3D_speaker_type; + M3D_SET_3D_SAMPLE_OBSTRUCTION set_3D_sample_obstruction; + M3D_SET_3D_SAMPLE_OCCLUSION set_3D_sample_occlusion; + M3D_SET_3D_SAMPLE_EXCLUSION set_3D_sample_exclusion; + M3D_SET_3D_SAMPLE_CONE set_3D_sample_cone; + M3D_SET_3D_SAMPLE_EFFECTS_LEVEL set_3D_sample_effects_level; + M3D_3D_SAMPLE_OBSTRUCTION sample_obstruction; + M3D_3D_SAMPLE_OCCLUSION sample_occlusion; + M3D_3D_SAMPLE_EXCLUSION sample_exclusion; + M3D_3D_SAMPLE_CONE sample_cone; + M3D_3D_SAMPLE_EFFECTS_LEVEL sample_effects_level; + M3D_SET_3D_EOS set_3D_EOS; + M3D_3D_ROLLOFF_FACTOR rolloff_factor; + M3D_SET_3D_ROLLOFF_FACTOR set_3D_rolloff_factor; + M3D_3D_DOPPLER_FACTOR doppler_factor; + M3D_SET_3D_DOPPLER_FACTOR set_3D_doppler_factor; + M3D_3D_DISTANCE_FACTOR distance_factor; + M3D_SET_3D_DISTANCE_FACTOR set_3D_distance_factor; +} M3DPROVIDER; + +// +// Sample calls +// + +DXDEC H3DSAMPLE AILCALL AIL_allocate_3D_sample_handle + (HPROVIDER lib); + + +DXDEC void AILCALL AIL_release_3D_sample_handle + (H3DSAMPLE S); + + +DXDEC void AILCALL AIL_start_3D_sample (H3DSAMPLE S); + + +DXDEC void AILCALL AIL_stop_3D_sample (H3DSAMPLE S); + + +DXDEC void AILCALL AIL_resume_3D_sample (H3DSAMPLE S); + +DXDEC void AILCALL AIL_end_3D_sample (H3DSAMPLE S); + +DXDEC S32 AILCALL AIL_set_3D_sample_file (H3DSAMPLE S, + void const FAR*file_image); + +DXDEC S32 AILCALL AIL_set_3D_sample_info (H3DSAMPLE S, + AILSOUNDINFO const FAR*info); + +DXDEC void AILCALL AIL_set_3D_sample_volume (H3DSAMPLE S, + F32 volume); + +DXDEC void AILCALL AIL_set_3D_sample_offset (H3DSAMPLE S, + U32 offset); + +DXDEC void AILCALL AIL_set_3D_sample_playback_rate + (H3DSAMPLE S, + S32 playback_rate); + +DXDEC void AILCALL AIL_set_3D_sample_loop_count(H3DSAMPLE S, + U32 loops); + +DXDEC void AILCALL AIL_set_3D_sample_loop_block(H3DSAMPLE S, + S32 loop_start_offset, + S32 loop_end_offset); + +DXDEC U32 AILCALL AIL_3D_sample_status (H3DSAMPLE S); + +DXDEC F32 AILCALL AIL_3D_sample_volume (H3DSAMPLE S); + +DXDEC U32 AILCALL AIL_3D_sample_offset (H3DSAMPLE S); + +DXDEC S32 AILCALL AIL_3D_sample_playback_rate (H3DSAMPLE S); + +DXDEC U32 AILCALL AIL_3D_sample_length (H3DSAMPLE S); + +DXDEC U32 AILCALL AIL_3D_sample_loop_count (H3DSAMPLE S); + + +DXDEC S32 AILCALL AIL_3D_room_type (HPROVIDER lib); + +DXDEC void AILCALL AIL_set_3D_room_type (HPROVIDER lib, + S32 room_type); + +#define AIL_3D_2_SPEAKER 0 +#define AIL_3D_HEADPHONE 1 +#define AIL_3D_SURROUND 2 +#define AIL_3D_4_SPEAKER 3 +#define AIL_3D_51_SPEAKER 4 +#define AIL_3D_71_SPEAKER 5 + + +DXDEC S32 AILCALL AIL_3D_speaker_type (HPROVIDER lib); + +DXDEC void AILCALL AIL_set_3D_speaker_type (HPROVIDER lib, + S32 speaker_type); + +DXDEC F32 AILCALL AIL_3D_rolloff_factor (HPROVIDER lib); + +DXDEC void AILCALL AIL_set_3D_rolloff_factor (HPROVIDER lib, + F32 factor); + +DXDEC F32 AILCALL AIL_3D_doppler_factor (HPROVIDER lib); + +DXDEC void AILCALL AIL_set_3D_doppler_factor (HPROVIDER lib, + F32 factor); + +DXDEC F32 AILCALL AIL_3D_distance_factor (HPROVIDER lib); + +DXDEC void AILCALL AIL_set_3D_distance_factor (HPROVIDER lib, + F32 factor); + + +// +// Changed the definition of distances to only be max and min, vs. front +// min/max and back min/max. Only RSX supported the concept of different +// front and distances, so we changed the API to make it more orthogonal +// to most of the 3D providers. Sorry in advance. +// + +DXDEC void AILCALL AIL_set_3D_sample_distances (H3DSAMPLE S, + F32 max_dist, + F32 min_dist); + + +DXDEC void AILCALL AIL_3D_sample_distances (H3DSAMPLE S, + F32 FAR * max_dist, + F32 FAR * min_dist); + +DXDEC S32 AILCALL AIL_active_3D_sample_count (HPROVIDER lib); + +DXDEC S32 AILCALL AIL_enumerate_3D_sample_attributes + (HPROVIDER lib, + HINTENUM FAR * next, + RIB_INTERFACE_ENTRY FAR * dest); + +DXDEC void AILCALL AIL_3D_sample_attribute (H3DSAMPLE samp, + C8 const FAR* name, + void FAR * val); + + +DXDEC void AILCALL AIL_set_3D_sample_preference (H3DSAMPLE samp, + C8 const FAR* name, + void const FAR* val); + +DXDEC void AILCALL AIL_set_3D_sample_obstruction (H3DSAMPLE S, + F32 obstruction); + +DXDEC void AILCALL AIL_set_3D_sample_occlusion (H3DSAMPLE S, + F32 occlusion); + +DXDEC void AILCALL AIL_set_3D_sample_exclusion (H3DSAMPLE S, + F32 exclusion); + +DXDEC void AILCALL AIL_set_3D_sample_cone (H3DSAMPLE S, + F32 inner_angle, + F32 outer_angle, + F32 outer_volume_level); + +DXDEC void AILCALL AIL_set_3D_sample_effects_level + (H3DSAMPLE S, + F32 effects_level); + +DXDEC F32 AILCALL AIL_3D_sample_obstruction (H3DSAMPLE S); + +DXDEC F32 AILCALL AIL_3D_sample_occlusion (H3DSAMPLE S); + +DXDEC F32 AILCALL AIL_3D_sample_exclusion (H3DSAMPLE S); + +DXDEC void AILCALL AIL_3D_sample_cone (H3DSAMPLE S, + F32 FAR* inner_angle, + F32 FAR* outer_angle, + F32 FAR* outer_volume_level); + +DXDEC F32 AILCALL AIL_3D_sample_effects_level (H3DSAMPLE S); + + +DXDEC AIL3DSAMPLECB AILCALL AIL_register_3D_EOS_callback + (H3DSAMPLE S, + AIL3DSAMPLECB EOS); + + +// +// Positioning-object allocation calls +// + +DXDEC H3DPOBJECT AILCALL AIL_open_3D_listener (HPROVIDER lib); + +DXDEC void AILCALL AIL_close_3D_listener (H3DPOBJECT listener); + +DXDEC H3DPOBJECT AILCALL AIL_open_3D_object (HPROVIDER lib); + +DXDEC void AILCALL AIL_close_3D_object (H3DPOBJECT obj); + +// +// 3D object calls +// + +DXDEC void AILCALL AIL_set_3D_position (H3DPOBJECT obj, + F32 X, + F32 Y, + F32 Z); + +DXDEC void AILCALL AIL_set_3D_velocity (H3DPOBJECT obj, + F32 dX_per_ms, + F32 dY_per_ms, + F32 dZ_per_ms, + F32 magnitude); + +DXDEC void AILCALL AIL_set_3D_velocity_vector (H3DPOBJECT obj, + F32 dX_per_ms, + F32 dY_per_ms, + F32 dZ_per_ms); + +DXDEC void AILCALL AIL_set_3D_orientation (H3DPOBJECT obj, + F32 X_face, + F32 Y_face, + F32 Z_face, + F32 X_up, + F32 Y_up, + F32 Z_up); + +DXDEC void AILCALL AIL_3D_position (H3DPOBJECT obj, + F32 FAR *X, + F32 FAR *Y, + F32 FAR *Z); + +DXDEC void AILCALL AIL_3D_velocity (H3DPOBJECT obj, + F32 FAR *dX_per_ms, + F32 FAR *dY_per_ms, + F32 FAR *dZ_per_ms); + +DXDEC void AILCALL AIL_3D_orientation (H3DPOBJECT obj, + F32 FAR *X_face, + F32 FAR *Y_face, + F32 FAR *Z_face, + F32 FAR *X_up, + F32 FAR *Y_up, + F32 FAR *Z_up); + +DXDEC void AILCALL AIL_update_3D_position (H3DPOBJECT obj, + F32 dt_milliseconds); + +DXDEC void AILCALL AIL_auto_update_3D_position (H3DPOBJECT obj, + S32 enable); + +DXDEC void AILCALL AIL_set_3D_user_data (H3DPOBJECT obj, + U32 index, + S32 value); + +DXDEC S32 AILCALL AIL_3D_user_data (H3DPOBJECT obj, + U32 index); + +// Obsolete 3D function names: +#define AIL_set_3D_object_user_data AIL_set_3D_user_data +#define AIL_3D_object_user_data AIL_3D_user_data +#define AIL_3D_open_listener AIL_open_3D_listener +#define AIL_3D_close_listener AIL_close_3D_listener +#define AIL_3D_open_object AIL_open_3D_object +#define AIL_3D_close_object AIL_close_3D_object + +#else + +typedef struct _FLTPROVIDER +{ + U32 junk; +} FLTPROVIDER; + +#endif + +#ifdef __cplusplus +} +#endif + + +#if defined(_PUSHPOP_SUPPORTED) || PRAGMA_STRUCT_PACKPUSH + #pragma pack(pop) +#else + #pragma pack() +#endif + + +#endif diff --git a/extern/include/Python-2.7/Python-ast.h b/extern/include/Python-2.7/Python-ast.h new file mode 100644 index 0000000..3f35bbb --- /dev/null +++ b/extern/include/Python-2.7/Python-ast.h @@ -0,0 +1,535 @@ +/* File automatically generated by Parser/asdl_c.py. */ + +#include "asdl.h" + +typedef struct _mod *mod_ty; + +typedef struct _stmt *stmt_ty; + +typedef struct _expr *expr_ty; + +typedef enum _expr_context { Load=1, Store=2, Del=3, AugLoad=4, AugStore=5, + Param=6 } expr_context_ty; + +typedef struct _slice *slice_ty; + +typedef enum _boolop { And=1, Or=2 } boolop_ty; + +typedef enum _operator { Add=1, Sub=2, Mult=3, Div=4, Mod=5, Pow=6, LShift=7, + RShift=8, BitOr=9, BitXor=10, BitAnd=11, FloorDiv=12 } + operator_ty; + +typedef enum _unaryop { Invert=1, Not=2, UAdd=3, USub=4 } unaryop_ty; + +typedef enum _cmpop { Eq=1, NotEq=2, Lt=3, LtE=4, Gt=5, GtE=6, Is=7, IsNot=8, + In=9, NotIn=10 } cmpop_ty; + +typedef struct _comprehension *comprehension_ty; + +typedef struct _excepthandler *excepthandler_ty; + +typedef struct _arguments *arguments_ty; + +typedef struct _keyword *keyword_ty; + +typedef struct _alias *alias_ty; + + +enum _mod_kind {Module_kind=1, Interactive_kind=2, Expression_kind=3, + Suite_kind=4}; +struct _mod { + enum _mod_kind kind; + union { + struct { + asdl_seq *body; + } Module; + + struct { + asdl_seq *body; + } Interactive; + + struct { + expr_ty body; + } Expression; + + struct { + asdl_seq *body; + } Suite; + + } v; +}; + +enum _stmt_kind {FunctionDef_kind=1, ClassDef_kind=2, Return_kind=3, + Delete_kind=4, Assign_kind=5, AugAssign_kind=6, Print_kind=7, + For_kind=8, While_kind=9, If_kind=10, With_kind=11, + Raise_kind=12, TryExcept_kind=13, TryFinally_kind=14, + Assert_kind=15, Import_kind=16, ImportFrom_kind=17, + Exec_kind=18, Global_kind=19, Expr_kind=20, Pass_kind=21, + Break_kind=22, Continue_kind=23}; +struct _stmt { + enum _stmt_kind kind; + union { + struct { + identifier name; + arguments_ty args; + asdl_seq *body; + asdl_seq *decorator_list; + } FunctionDef; + + struct { + identifier name; + asdl_seq *bases; + asdl_seq *body; + asdl_seq *decorator_list; + } ClassDef; + + struct { + expr_ty value; + } Return; + + struct { + asdl_seq *targets; + } Delete; + + struct { + asdl_seq *targets; + expr_ty value; + } Assign; + + struct { + expr_ty target; + operator_ty op; + expr_ty value; + } AugAssign; + + struct { + expr_ty dest; + asdl_seq *values; + bool nl; + } Print; + + struct { + expr_ty target; + expr_ty iter; + asdl_seq *body; + asdl_seq *orelse; + } For; + + struct { + expr_ty test; + asdl_seq *body; + asdl_seq *orelse; + } While; + + struct { + expr_ty test; + asdl_seq *body; + asdl_seq *orelse; + } If; + + struct { + expr_ty context_expr; + expr_ty optional_vars; + asdl_seq *body; + } With; + + struct { + expr_ty type; + expr_ty inst; + expr_ty tback; + } Raise; + + struct { + asdl_seq *body; + asdl_seq *handlers; + asdl_seq *orelse; + } TryExcept; + + struct { + asdl_seq *body; + asdl_seq *finalbody; + } TryFinally; + + struct { + expr_ty test; + expr_ty msg; + } Assert; + + struct { + asdl_seq *names; + } Import; + + struct { + identifier module; + asdl_seq *names; + int level; + } ImportFrom; + + struct { + expr_ty body; + expr_ty globals; + expr_ty locals; + } Exec; + + struct { + asdl_seq *names; + } Global; + + struct { + expr_ty value; + } Expr; + + } v; + int lineno; + int col_offset; +}; + +enum _expr_kind {BoolOp_kind=1, BinOp_kind=2, UnaryOp_kind=3, Lambda_kind=4, + IfExp_kind=5, Dict_kind=6, Set_kind=7, ListComp_kind=8, + SetComp_kind=9, DictComp_kind=10, GeneratorExp_kind=11, + Yield_kind=12, Compare_kind=13, Call_kind=14, Repr_kind=15, + Num_kind=16, Str_kind=17, Attribute_kind=18, + Subscript_kind=19, Name_kind=20, List_kind=21, Tuple_kind=22}; +struct _expr { + enum _expr_kind kind; + union { + struct { + boolop_ty op; + asdl_seq *values; + } BoolOp; + + struct { + expr_ty left; + operator_ty op; + expr_ty right; + } BinOp; + + struct { + unaryop_ty op; + expr_ty operand; + } UnaryOp; + + struct { + arguments_ty args; + expr_ty body; + } Lambda; + + struct { + expr_ty test; + expr_ty body; + expr_ty orelse; + } IfExp; + + struct { + asdl_seq *keys; + asdl_seq *values; + } Dict; + + struct { + asdl_seq *elts; + } Set; + + struct { + expr_ty elt; + asdl_seq *generators; + } ListComp; + + struct { + expr_ty elt; + asdl_seq *generators; + } SetComp; + + struct { + expr_ty key; + expr_ty value; + asdl_seq *generators; + } DictComp; + + struct { + expr_ty elt; + asdl_seq *generators; + } GeneratorExp; + + struct { + expr_ty value; + } Yield; + + struct { + expr_ty left; + asdl_int_seq *ops; + asdl_seq *comparators; + } Compare; + + struct { + expr_ty func; + asdl_seq *args; + asdl_seq *keywords; + expr_ty starargs; + expr_ty kwargs; + } Call; + + struct { + expr_ty value; + } Repr; + + struct { + object n; + } Num; + + struct { + string s; + } Str; + + struct { + expr_ty value; + identifier attr; + expr_context_ty ctx; + } Attribute; + + struct { + expr_ty value; + slice_ty slice; + expr_context_ty ctx; + } Subscript; + + struct { + identifier id; + expr_context_ty ctx; + } Name; + + struct { + asdl_seq *elts; + expr_context_ty ctx; + } List; + + struct { + asdl_seq *elts; + expr_context_ty ctx; + } Tuple; + + } v; + int lineno; + int col_offset; +}; + +enum _slice_kind {Ellipsis_kind=1, Slice_kind=2, ExtSlice_kind=3, Index_kind=4}; +struct _slice { + enum _slice_kind kind; + union { + struct { + expr_ty lower; + expr_ty upper; + expr_ty step; + } Slice; + + struct { + asdl_seq *dims; + } ExtSlice; + + struct { + expr_ty value; + } Index; + + } v; +}; + +struct _comprehension { + expr_ty target; + expr_ty iter; + asdl_seq *ifs; +}; + +enum _excepthandler_kind {ExceptHandler_kind=1}; +struct _excepthandler { + enum _excepthandler_kind kind; + union { + struct { + expr_ty type; + expr_ty name; + asdl_seq *body; + } ExceptHandler; + + } v; + int lineno; + int col_offset; +}; + +struct _arguments { + asdl_seq *args; + identifier vararg; + identifier kwarg; + asdl_seq *defaults; +}; + +struct _keyword { + identifier arg; + expr_ty value; +}; + +struct _alias { + identifier name; + identifier asname; +}; + + +#define Module(a0, a1) _Py_Module(a0, a1) +mod_ty _Py_Module(asdl_seq * body, PyArena *arena); +#define Interactive(a0, a1) _Py_Interactive(a0, a1) +mod_ty _Py_Interactive(asdl_seq * body, PyArena *arena); +#define Expression(a0, a1) _Py_Expression(a0, a1) +mod_ty _Py_Expression(expr_ty body, PyArena *arena); +#define Suite(a0, a1) _Py_Suite(a0, a1) +mod_ty _Py_Suite(asdl_seq * body, PyArena *arena); +#define FunctionDef(a0, a1, a2, a3, a4, a5, a6) _Py_FunctionDef(a0, a1, a2, a3, a4, a5, a6) +stmt_ty _Py_FunctionDef(identifier name, arguments_ty args, asdl_seq * body, + asdl_seq * decorator_list, int lineno, int col_offset, + PyArena *arena); +#define ClassDef(a0, a1, a2, a3, a4, a5, a6) _Py_ClassDef(a0, a1, a2, a3, a4, a5, a6) +stmt_ty _Py_ClassDef(identifier name, asdl_seq * bases, asdl_seq * body, + asdl_seq * decorator_list, int lineno, int col_offset, + PyArena *arena); +#define Return(a0, a1, a2, a3) _Py_Return(a0, a1, a2, a3) +stmt_ty _Py_Return(expr_ty value, int lineno, int col_offset, PyArena *arena); +#define Delete(a0, a1, a2, a3) _Py_Delete(a0, a1, a2, a3) +stmt_ty _Py_Delete(asdl_seq * targets, int lineno, int col_offset, PyArena + *arena); +#define Assign(a0, a1, a2, a3, a4) _Py_Assign(a0, a1, a2, a3, a4) +stmt_ty _Py_Assign(asdl_seq * targets, expr_ty value, int lineno, int + col_offset, PyArena *arena); +#define AugAssign(a0, a1, a2, a3, a4, a5) _Py_AugAssign(a0, a1, a2, a3, a4, a5) +stmt_ty _Py_AugAssign(expr_ty target, operator_ty op, expr_ty value, int + lineno, int col_offset, PyArena *arena); +#define Print(a0, a1, a2, a3, a4, a5) _Py_Print(a0, a1, a2, a3, a4, a5) +stmt_ty _Py_Print(expr_ty dest, asdl_seq * values, bool nl, int lineno, int + col_offset, PyArena *arena); +#define For(a0, a1, a2, a3, a4, a5, a6) _Py_For(a0, a1, a2, a3, a4, a5, a6) +stmt_ty _Py_For(expr_ty target, expr_ty iter, asdl_seq * body, asdl_seq * + orelse, int lineno, int col_offset, PyArena *arena); +#define While(a0, a1, a2, a3, a4, a5) _Py_While(a0, a1, a2, a3, a4, a5) +stmt_ty _Py_While(expr_ty test, asdl_seq * body, asdl_seq * orelse, int lineno, + int col_offset, PyArena *arena); +#define If(a0, a1, a2, a3, a4, a5) _Py_If(a0, a1, a2, a3, a4, a5) +stmt_ty _Py_If(expr_ty test, asdl_seq * body, asdl_seq * orelse, int lineno, + int col_offset, PyArena *arena); +#define With(a0, a1, a2, a3, a4, a5) _Py_With(a0, a1, a2, a3, a4, a5) +stmt_ty _Py_With(expr_ty context_expr, expr_ty optional_vars, asdl_seq * body, + int lineno, int col_offset, PyArena *arena); +#define Raise(a0, a1, a2, a3, a4, a5) _Py_Raise(a0, a1, a2, a3, a4, a5) +stmt_ty _Py_Raise(expr_ty type, expr_ty inst, expr_ty tback, int lineno, int + col_offset, PyArena *arena); +#define TryExcept(a0, a1, a2, a3, a4, a5) _Py_TryExcept(a0, a1, a2, a3, a4, a5) +stmt_ty _Py_TryExcept(asdl_seq * body, asdl_seq * handlers, asdl_seq * orelse, + int lineno, int col_offset, PyArena *arena); +#define TryFinally(a0, a1, a2, a3, a4) _Py_TryFinally(a0, a1, a2, a3, a4) +stmt_ty _Py_TryFinally(asdl_seq * body, asdl_seq * finalbody, int lineno, int + col_offset, PyArena *arena); +#define Assert(a0, a1, a2, a3, a4) _Py_Assert(a0, a1, a2, a3, a4) +stmt_ty _Py_Assert(expr_ty test, expr_ty msg, int lineno, int col_offset, + PyArena *arena); +#define Import(a0, a1, a2, a3) _Py_Import(a0, a1, a2, a3) +stmt_ty _Py_Import(asdl_seq * names, int lineno, int col_offset, PyArena + *arena); +#define ImportFrom(a0, a1, a2, a3, a4, a5) _Py_ImportFrom(a0, a1, a2, a3, a4, a5) +stmt_ty _Py_ImportFrom(identifier module, asdl_seq * names, int level, int + lineno, int col_offset, PyArena *arena); +#define Exec(a0, a1, a2, a3, a4, a5) _Py_Exec(a0, a1, a2, a3, a4, a5) +stmt_ty _Py_Exec(expr_ty body, expr_ty globals, expr_ty locals, int lineno, int + col_offset, PyArena *arena); +#define Global(a0, a1, a2, a3) _Py_Global(a0, a1, a2, a3) +stmt_ty _Py_Global(asdl_seq * names, int lineno, int col_offset, PyArena + *arena); +#define Expr(a0, a1, a2, a3) _Py_Expr(a0, a1, a2, a3) +stmt_ty _Py_Expr(expr_ty value, int lineno, int col_offset, PyArena *arena); +#define Pass(a0, a1, a2) _Py_Pass(a0, a1, a2) +stmt_ty _Py_Pass(int lineno, int col_offset, PyArena *arena); +#define Break(a0, a1, a2) _Py_Break(a0, a1, a2) +stmt_ty _Py_Break(int lineno, int col_offset, PyArena *arena); +#define Continue(a0, a1, a2) _Py_Continue(a0, a1, a2) +stmt_ty _Py_Continue(int lineno, int col_offset, PyArena *arena); +#define BoolOp(a0, a1, a2, a3, a4) _Py_BoolOp(a0, a1, a2, a3, a4) +expr_ty _Py_BoolOp(boolop_ty op, asdl_seq * values, int lineno, int col_offset, + PyArena *arena); +#define BinOp(a0, a1, a2, a3, a4, a5) _Py_BinOp(a0, a1, a2, a3, a4, a5) +expr_ty _Py_BinOp(expr_ty left, operator_ty op, expr_ty right, int lineno, int + col_offset, PyArena *arena); +#define UnaryOp(a0, a1, a2, a3, a4) _Py_UnaryOp(a0, a1, a2, a3, a4) +expr_ty _Py_UnaryOp(unaryop_ty op, expr_ty operand, int lineno, int col_offset, + PyArena *arena); +#define Lambda(a0, a1, a2, a3, a4) _Py_Lambda(a0, a1, a2, a3, a4) +expr_ty _Py_Lambda(arguments_ty args, expr_ty body, int lineno, int col_offset, + PyArena *arena); +#define IfExp(a0, a1, a2, a3, a4, a5) _Py_IfExp(a0, a1, a2, a3, a4, a5) +expr_ty _Py_IfExp(expr_ty test, expr_ty body, expr_ty orelse, int lineno, int + col_offset, PyArena *arena); +#define Dict(a0, a1, a2, a3, a4) _Py_Dict(a0, a1, a2, a3, a4) +expr_ty _Py_Dict(asdl_seq * keys, asdl_seq * values, int lineno, int + col_offset, PyArena *arena); +#define Set(a0, a1, a2, a3) _Py_Set(a0, a1, a2, a3) +expr_ty _Py_Set(asdl_seq * elts, int lineno, int col_offset, PyArena *arena); +#define ListComp(a0, a1, a2, a3, a4) _Py_ListComp(a0, a1, a2, a3, a4) +expr_ty _Py_ListComp(expr_ty elt, asdl_seq * generators, int lineno, int + col_offset, PyArena *arena); +#define SetComp(a0, a1, a2, a3, a4) _Py_SetComp(a0, a1, a2, a3, a4) +expr_ty _Py_SetComp(expr_ty elt, asdl_seq * generators, int lineno, int + col_offset, PyArena *arena); +#define DictComp(a0, a1, a2, a3, a4, a5) _Py_DictComp(a0, a1, a2, a3, a4, a5) +expr_ty _Py_DictComp(expr_ty key, expr_ty value, asdl_seq * generators, int + lineno, int col_offset, PyArena *arena); +#define GeneratorExp(a0, a1, a2, a3, a4) _Py_GeneratorExp(a0, a1, a2, a3, a4) +expr_ty _Py_GeneratorExp(expr_ty elt, asdl_seq * generators, int lineno, int + col_offset, PyArena *arena); +#define Yield(a0, a1, a2, a3) _Py_Yield(a0, a1, a2, a3) +expr_ty _Py_Yield(expr_ty value, int lineno, int col_offset, PyArena *arena); +#define Compare(a0, a1, a2, a3, a4, a5) _Py_Compare(a0, a1, a2, a3, a4, a5) +expr_ty _Py_Compare(expr_ty left, asdl_int_seq * ops, asdl_seq * comparators, + int lineno, int col_offset, PyArena *arena); +#define Call(a0, a1, a2, a3, a4, a5, a6, a7) _Py_Call(a0, a1, a2, a3, a4, a5, a6, a7) +expr_ty _Py_Call(expr_ty func, asdl_seq * args, asdl_seq * keywords, expr_ty + starargs, expr_ty kwargs, int lineno, int col_offset, PyArena + *arena); +#define Repr(a0, a1, a2, a3) _Py_Repr(a0, a1, a2, a3) +expr_ty _Py_Repr(expr_ty value, int lineno, int col_offset, PyArena *arena); +#define Num(a0, a1, a2, a3) _Py_Num(a0, a1, a2, a3) +expr_ty _Py_Num(object n, int lineno, int col_offset, PyArena *arena); +#define Str(a0, a1, a2, a3) _Py_Str(a0, a1, a2, a3) +expr_ty _Py_Str(string s, int lineno, int col_offset, PyArena *arena); +#define Attribute(a0, a1, a2, a3, a4, a5) _Py_Attribute(a0, a1, a2, a3, a4, a5) +expr_ty _Py_Attribute(expr_ty value, identifier attr, expr_context_ty ctx, int + lineno, int col_offset, PyArena *arena); +#define Subscript(a0, a1, a2, a3, a4, a5) _Py_Subscript(a0, a1, a2, a3, a4, a5) +expr_ty _Py_Subscript(expr_ty value, slice_ty slice, expr_context_ty ctx, int + lineno, int col_offset, PyArena *arena); +#define Name(a0, a1, a2, a3, a4) _Py_Name(a0, a1, a2, a3, a4) +expr_ty _Py_Name(identifier id, expr_context_ty ctx, int lineno, int + col_offset, PyArena *arena); +#define List(a0, a1, a2, a3, a4) _Py_List(a0, a1, a2, a3, a4) +expr_ty _Py_List(asdl_seq * elts, expr_context_ty ctx, int lineno, int + col_offset, PyArena *arena); +#define Tuple(a0, a1, a2, a3, a4) _Py_Tuple(a0, a1, a2, a3, a4) +expr_ty _Py_Tuple(asdl_seq * elts, expr_context_ty ctx, int lineno, int + col_offset, PyArena *arena); +#define Ellipsis(a0) _Py_Ellipsis(a0) +slice_ty _Py_Ellipsis(PyArena *arena); +#define Slice(a0, a1, a2, a3) _Py_Slice(a0, a1, a2, a3) +slice_ty _Py_Slice(expr_ty lower, expr_ty upper, expr_ty step, PyArena *arena); +#define ExtSlice(a0, a1) _Py_ExtSlice(a0, a1) +slice_ty _Py_ExtSlice(asdl_seq * dims, PyArena *arena); +#define Index(a0, a1) _Py_Index(a0, a1) +slice_ty _Py_Index(expr_ty value, PyArena *arena); +#define comprehension(a0, a1, a2, a3) _Py_comprehension(a0, a1, a2, a3) +comprehension_ty _Py_comprehension(expr_ty target, expr_ty iter, asdl_seq * + ifs, PyArena *arena); +#define ExceptHandler(a0, a1, a2, a3, a4, a5) _Py_ExceptHandler(a0, a1, a2, a3, a4, a5) +excepthandler_ty _Py_ExceptHandler(expr_ty type, expr_ty name, asdl_seq * body, + int lineno, int col_offset, PyArena *arena); +#define arguments(a0, a1, a2, a3, a4) _Py_arguments(a0, a1, a2, a3, a4) +arguments_ty _Py_arguments(asdl_seq * args, identifier vararg, identifier + kwarg, asdl_seq * defaults, PyArena *arena); +#define keyword(a0, a1, a2) _Py_keyword(a0, a1, a2) +keyword_ty _Py_keyword(identifier arg, expr_ty value, PyArena *arena); +#define alias(a0, a1, a2) _Py_alias(a0, a1, a2) +alias_ty _Py_alias(identifier name, identifier asname, PyArena *arena); + +PyObject* PyAST_mod2obj(mod_ty t); +mod_ty PyAST_obj2mod(PyObject* ast, PyArena* arena, int mode); +int PyAST_Check(PyObject* obj); diff --git a/extern/include/Python-2.7/Python.h b/extern/include/Python-2.7/Python.h new file mode 100644 index 0000000..775412b --- /dev/null +++ b/extern/include/Python-2.7/Python.h @@ -0,0 +1,178 @@ +#ifndef Py_PYTHON_H +#define Py_PYTHON_H +/* Since this is a "meta-include" file, no #ifdef __cplusplus / extern "C" { */ + +/* Include nearly all Python header files */ + +#include "patchlevel.h" +#include "pyconfig.h" +#include "pymacconfig.h" + +/* Cyclic gc is always enabled, starting with release 2.3a1. Supply the + * old symbol for the benefit of extension modules written before then + * that may be conditionalizing on it. The core doesn't use it anymore. + */ +#ifndef WITH_CYCLE_GC +#define WITH_CYCLE_GC 1 +#endif + +#include + +#ifndef UCHAR_MAX +#error "Something's broken. UCHAR_MAX should be defined in limits.h." +#endif + +#if UCHAR_MAX != 255 +#error "Python's source code assumes C's unsigned char is an 8-bit type." +#endif + +#if defined(__sgi) && defined(WITH_THREAD) && !defined(_SGI_MP_SOURCE) +#define _SGI_MP_SOURCE +#endif + +#include +#ifndef NULL +# error "Python.h requires that stdio.h define NULL." +#endif + +#include +#ifdef HAVE_ERRNO_H +#include +#endif +#include +#ifdef HAVE_UNISTD_H +#include +#endif + +/* For size_t? */ +#ifdef HAVE_STDDEF_H +#include +#endif + +/* CAUTION: Build setups should ensure that NDEBUG is defined on the + * compiler command line when building Python in release mode; else + * assert() calls won't be removed. + */ +#include + +#include "pyport.h" + +/* pyconfig.h or pyport.h may or may not define DL_IMPORT */ +#ifndef DL_IMPORT /* declarations for DLL import/export */ +#define DL_IMPORT(RTYPE) RTYPE +#endif +#ifndef DL_EXPORT /* declarations for DLL import/export */ +#define DL_EXPORT(RTYPE) RTYPE +#endif + +/* Debug-mode build with pymalloc implies PYMALLOC_DEBUG. + * PYMALLOC_DEBUG is in error if pymalloc is not in use. + */ +#if defined(Py_DEBUG) && defined(WITH_PYMALLOC) && !defined(PYMALLOC_DEBUG) +#define PYMALLOC_DEBUG +#endif +#if defined(PYMALLOC_DEBUG) && !defined(WITH_PYMALLOC) +#error "PYMALLOC_DEBUG requires WITH_PYMALLOC" +#endif +#include "pymath.h" +#include "pymem.h" + +#include "object.h" +#include "objimpl.h" + +#include "pydebug.h" + +#include "unicodeobject.h" +#include "intobject.h" +#include "boolobject.h" +#include "longobject.h" +#include "floatobject.h" +#ifndef WITHOUT_COMPLEX +#include "complexobject.h" +#endif +#include "rangeobject.h" +#include "stringobject.h" +#include "memoryobject.h" +#include "bufferobject.h" +#include "bytesobject.h" +#include "bytearrayobject.h" +#include "tupleobject.h" +#include "listobject.h" +#include "dictobject.h" +#include "enumobject.h" +#include "setobject.h" +#include "methodobject.h" +#include "moduleobject.h" +#include "funcobject.h" +#include "classobject.h" +#include "fileobject.h" +#include "cobject.h" +#include "pycapsule.h" +#include "traceback.h" +#include "sliceobject.h" +#include "cellobject.h" +#include "iterobject.h" +#include "genobject.h" +#include "descrobject.h" +#include "warnings.h" +#include "weakrefobject.h" + +#include "codecs.h" +#include "pyerrors.h" + +#include "pystate.h" + +#include "pyarena.h" +#include "modsupport.h" +#include "pythonrun.h" +#include "ceval.h" +#include "sysmodule.h" +#include "intrcheck.h" +#include "import.h" + +#include "abstract.h" + +#include "compile.h" +#include "eval.h" + +#include "pyctype.h" +#include "pystrtod.h" +#include "pystrcmp.h" +#include "dtoa.h" + +/* _Py_Mangle is defined in compile.c */ +PyAPI_FUNC(PyObject*) _Py_Mangle(PyObject *p, PyObject *name); + +/* PyArg_GetInt is deprecated and should not be used, use PyArg_Parse(). */ +#define PyArg_GetInt(v, a) PyArg_Parse((v), "i", (a)) + +/* PyArg_NoArgs should not be necessary. + Set ml_flags in the PyMethodDef to METH_NOARGS. */ +#define PyArg_NoArgs(v) PyArg_Parse(v, "") + +/* Argument must be a char or an int in [-128, 127] or [0, 255]. */ +#define Py_CHARMASK(c) ((unsigned char)((c) & 0xff)) + +#include "pyfpe.h" + +/* These definitions must match corresponding definitions in graminit.h. + There's code in compile.c that checks that they are the same. */ +#define Py_single_input 256 +#define Py_file_input 257 +#define Py_eval_input 258 + +#ifdef HAVE_PTH +/* GNU pth user-space thread support */ +#include +#endif + +/* Define macros for inline documentation. */ +#define PyDoc_VAR(name) static char name[] +#define PyDoc_STRVAR(name,str) PyDoc_VAR(name) = PyDoc_STR(str) +#ifdef WITH_DOC_STRINGS +#define PyDoc_STR(str) str +#else +#define PyDoc_STR(str) "" +#endif + +#endif /* !Py_PYTHON_H */ diff --git a/extern/include/Python-2.7/abstract.h b/extern/include/Python-2.7/abstract.h new file mode 100644 index 0000000..a377423 --- /dev/null +++ b/extern/include/Python-2.7/abstract.h @@ -0,0 +1,1396 @@ +#ifndef Py_ABSTRACTOBJECT_H +#define Py_ABSTRACTOBJECT_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef PY_SSIZE_T_CLEAN +#define PyObject_CallFunction _PyObject_CallFunction_SizeT +#define PyObject_CallMethod _PyObject_CallMethod_SizeT +#endif + +/* Abstract Object Interface (many thanks to Jim Fulton) */ + +/* + PROPOSAL: A Generic Python Object Interface for Python C Modules + +Problem + + Python modules written in C that must access Python objects must do + so through routines whose interfaces are described by a set of + include files. Unfortunately, these routines vary according to the + object accessed. To use these routines, the C programmer must check + the type of the object being used and must call a routine based on + the object type. For example, to access an element of a sequence, + the programmer must determine whether the sequence is a list or a + tuple: + + if(is_tupleobject(o)) + e=gettupleitem(o,i) + else if(is_listitem(o)) + e=getlistitem(o,i) + + If the programmer wants to get an item from another type of object + that provides sequence behavior, there is no clear way to do it + correctly. + + The persistent programmer may peruse object.h and find that the + _typeobject structure provides a means of invoking up to (currently + about) 41 special operators. So, for example, a routine can get an + item from any object that provides sequence behavior. However, to + use this mechanism, the programmer must make their code dependent on + the current Python implementation. + + Also, certain semantics, especially memory management semantics, may + differ by the type of object being used. Unfortunately, these + semantics are not clearly described in the current include files. + An abstract interface providing more consistent semantics is needed. + +Proposal + + I propose the creation of a standard interface (with an associated + library of routines and/or macros) for generically obtaining the + services of Python objects. This proposal can be viewed as one + components of a Python C interface consisting of several components. + + From the viewpoint of C access to Python services, we have (as + suggested by Guido in off-line discussions): + + - "Very high level layer": two or three functions that let you exec or + eval arbitrary Python code given as a string in a module whose name is + given, passing C values in and getting C values out using + mkvalue/getargs style format strings. This does not require the user + to declare any variables of type "PyObject *". This should be enough + to write a simple application that gets Python code from the user, + execs it, and returns the output or errors. (Error handling must also + be part of this API.) + + - "Abstract objects layer": which is the subject of this proposal. + It has many functions operating on objects, and lest you do many + things from C that you can also write in Python, without going + through the Python parser. + + - "Concrete objects layer": This is the public type-dependent + interface provided by the standard built-in types, such as floats, + strings, and lists. This interface exists and is currently + documented by the collection of include files provided with the + Python distributions. + + From the point of view of Python accessing services provided by C + modules: + + - "Python module interface": this interface consist of the basic + routines used to define modules and their members. Most of the + current extensions-writing guide deals with this interface. + + - "Built-in object interface": this is the interface that a new + built-in type must provide and the mechanisms and rules that a + developer of a new built-in type must use and follow. + + This proposal is a "first-cut" that is intended to spur + discussion. See especially the lists of notes. + + The Python C object interface will provide four protocols: object, + numeric, sequence, and mapping. Each protocol consists of a + collection of related operations. If an operation that is not + provided by a particular type is invoked, then a standard exception, + NotImplementedError is raised with a operation name as an argument. + In addition, for convenience this interface defines a set of + constructors for building objects of built-in types. This is needed + so new objects can be returned from C functions that otherwise treat + objects generically. + +Memory Management + + For all of the functions described in this proposal, if a function + retains a reference to a Python object passed as an argument, then the + function will increase the reference count of the object. It is + unnecessary for the caller to increase the reference count of an + argument in anticipation of the object's retention. + + All Python objects returned from functions should be treated as new + objects. Functions that return objects assume that the caller will + retain a reference and the reference count of the object has already + been incremented to account for this fact. A caller that does not + retain a reference to an object that is returned from a function + must decrement the reference count of the object (using + DECREF(object)) to prevent memory leaks. + + Note that the behavior mentioned here is different from the current + behavior for some objects (e.g. lists and tuples) when certain + type-specific routines are called directly (e.g. setlistitem). The + proposed abstraction layer will provide a consistent memory + management interface, correcting for inconsistent behavior for some + built-in types. + +Protocols + +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/ + +/* Object Protocol: */ + + /* Implemented elsewhere: + + int PyObject_Print(PyObject *o, FILE *fp, int flags); + + Print an object, o, on file, fp. Returns -1 on + error. The flags argument is used to enable certain printing + options. The only option currently supported is Py_Print_RAW. + + (What should be said about Py_Print_RAW?) + + */ + + /* Implemented elsewhere: + + int PyObject_HasAttrString(PyObject *o, char *attr_name); + + Returns 1 if o has the attribute attr_name, and 0 otherwise. + This is equivalent to the Python expression: + hasattr(o,attr_name). + + This function always succeeds. + + */ + + /* Implemented elsewhere: + + PyObject* PyObject_GetAttrString(PyObject *o, char *attr_name); + + Retrieve an attributed named attr_name form object o. + Returns the attribute value on success, or NULL on failure. + This is the equivalent of the Python expression: o.attr_name. + + */ + + /* Implemented elsewhere: + + int PyObject_HasAttr(PyObject *o, PyObject *attr_name); + + Returns 1 if o has the attribute attr_name, and 0 otherwise. + This is equivalent to the Python expression: + hasattr(o,attr_name). + + This function always succeeds. + + */ + + /* Implemented elsewhere: + + PyObject* PyObject_GetAttr(PyObject *o, PyObject *attr_name); + + Retrieve an attributed named attr_name form object o. + Returns the attribute value on success, or NULL on failure. + This is the equivalent of the Python expression: o.attr_name. + + */ + + + /* Implemented elsewhere: + + int PyObject_SetAttrString(PyObject *o, char *attr_name, PyObject *v); + + Set the value of the attribute named attr_name, for object o, + to the value, v. Returns -1 on failure. This is + the equivalent of the Python statement: o.attr_name=v. + + */ + + /* Implemented elsewhere: + + int PyObject_SetAttr(PyObject *o, PyObject *attr_name, PyObject *v); + + Set the value of the attribute named attr_name, for object o, + to the value, v. Returns -1 on failure. This is + the equivalent of the Python statement: o.attr_name=v. + + */ + + /* implemented as a macro: + + int PyObject_DelAttrString(PyObject *o, char *attr_name); + + Delete attribute named attr_name, for object o. Returns + -1 on failure. This is the equivalent of the Python + statement: del o.attr_name. + + */ +#define PyObject_DelAttrString(O,A) PyObject_SetAttrString((O),(A),NULL) + + /* implemented as a macro: + + int PyObject_DelAttr(PyObject *o, PyObject *attr_name); + + Delete attribute named attr_name, for object o. Returns -1 + on failure. This is the equivalent of the Python + statement: del o.attr_name. + + */ +#define PyObject_DelAttr(O,A) PyObject_SetAttr((O),(A),NULL) + + PyAPI_FUNC(int) PyObject_Cmp(PyObject *o1, PyObject *o2, int *result); + + /* + Compare the values of o1 and o2 using a routine provided by + o1, if one exists, otherwise with a routine provided by o2. + The result of the comparison is returned in result. Returns + -1 on failure. This is the equivalent of the Python + statement: result=cmp(o1,o2). + + */ + + /* Implemented elsewhere: + + int PyObject_Compare(PyObject *o1, PyObject *o2); + + Compare the values of o1 and o2 using a routine provided by + o1, if one exists, otherwise with a routine provided by o2. + Returns the result of the comparison on success. On error, + the value returned is undefined. This is equivalent to the + Python expression: cmp(o1,o2). + + */ + + /* Implemented elsewhere: + + PyObject *PyObject_Repr(PyObject *o); + + Compute the string representation of object, o. Returns the + string representation on success, NULL on failure. This is + the equivalent of the Python expression: repr(o). + + Called by the repr() built-in function and by reverse quotes. + + */ + + /* Implemented elsewhere: + + PyObject *PyObject_Str(PyObject *o); + + Compute the string representation of object, o. Returns the + string representation on success, NULL on failure. This is + the equivalent of the Python expression: str(o).) + + Called by the str() built-in function and by the print + statement. + + */ + + /* Implemented elsewhere: + + PyObject *PyObject_Unicode(PyObject *o); + + Compute the unicode representation of object, o. Returns the + unicode representation on success, NULL on failure. This is + the equivalent of the Python expression: unistr(o).) + + Called by the unistr() built-in function. + + */ + + /* Declared elsewhere + + PyAPI_FUNC(int) PyCallable_Check(PyObject *o); + + Determine if the object, o, is callable. Return 1 if the + object is callable and 0 otherwise. + + This function always succeeds. + + */ + + + + PyAPI_FUNC(PyObject *) PyObject_Call(PyObject *callable_object, + PyObject *args, PyObject *kw); + + /* + Call a callable Python object, callable_object, with + arguments and keywords arguments. The 'args' argument can not be + NULL, but the 'kw' argument can be NULL. + + */ + + PyAPI_FUNC(PyObject *) PyObject_CallObject(PyObject *callable_object, + PyObject *args); + + /* + Call a callable Python object, callable_object, with + arguments given by the tuple, args. If no arguments are + needed, then args may be NULL. Returns the result of the + call on success, or NULL on failure. This is the equivalent + of the Python expression: apply(o,args). + + */ + + PyAPI_FUNC(PyObject *) PyObject_CallFunction(PyObject *callable_object, + char *format, ...); + + /* + Call a callable Python object, callable_object, with a + variable number of C arguments. The C arguments are described + using a mkvalue-style format string. The format may be NULL, + indicating that no arguments are provided. Returns the + result of the call on success, or NULL on failure. This is + the equivalent of the Python expression: apply(o,args). + + */ + + + PyAPI_FUNC(PyObject *) PyObject_CallMethod(PyObject *o, char *m, + char *format, ...); + + /* + Call the method named m of object o with a variable number of + C arguments. The C arguments are described by a mkvalue + format string. The format may be NULL, indicating that no + arguments are provided. Returns the result of the call on + success, or NULL on failure. This is the equivalent of the + Python expression: o.method(args). + */ + + PyAPI_FUNC(PyObject *) _PyObject_CallFunction_SizeT(PyObject *callable, + char *format, ...); + PyAPI_FUNC(PyObject *) _PyObject_CallMethod_SizeT(PyObject *o, + char *name, + char *format, ...); + + PyAPI_FUNC(PyObject *) PyObject_CallFunctionObjArgs(PyObject *callable, + ...); + + /* + Call a callable Python object, callable_object, with a + variable number of C arguments. The C arguments are provided + as PyObject * values, terminated by a NULL. Returns the + result of the call on success, or NULL on failure. This is + the equivalent of the Python expression: apply(o,args). + */ + + + PyAPI_FUNC(PyObject *) PyObject_CallMethodObjArgs(PyObject *o, + PyObject *m, ...); + + /* + Call the method named m of object o with a variable number of + C arguments. The C arguments are provided as PyObject * + values, terminated by NULL. Returns the result of the call + on success, or NULL on failure. This is the equivalent of + the Python expression: o.method(args). + */ + + + /* Implemented elsewhere: + + long PyObject_Hash(PyObject *o); + + Compute and return the hash, hash_value, of an object, o. On + failure, return -1. This is the equivalent of the Python + expression: hash(o). + + */ + + + /* Implemented elsewhere: + + int PyObject_IsTrue(PyObject *o); + + Returns 1 if the object, o, is considered to be true, 0 if o is + considered to be false and -1 on failure. This is equivalent to the + Python expression: not not o + + */ + + /* Implemented elsewhere: + + int PyObject_Not(PyObject *o); + + Returns 0 if the object, o, is considered to be true, 1 if o is + considered to be false and -1 on failure. This is equivalent to the + Python expression: not o + + */ + + PyAPI_FUNC(PyObject *) PyObject_Type(PyObject *o); + + /* + On success, returns a type object corresponding to the object + type of object o. On failure, returns NULL. This is + equivalent to the Python expression: type(o). + */ + + PyAPI_FUNC(Py_ssize_t) PyObject_Size(PyObject *o); + + /* + Return the size of object o. If the object, o, provides + both sequence and mapping protocols, the sequence size is + returned. On error, -1 is returned. This is the equivalent + to the Python expression: len(o). + + */ + + /* For DLL compatibility */ +#undef PyObject_Length + PyAPI_FUNC(Py_ssize_t) PyObject_Length(PyObject *o); +#define PyObject_Length PyObject_Size + + PyAPI_FUNC(Py_ssize_t) _PyObject_LengthHint(PyObject *o, Py_ssize_t); + + /* + Guess the size of object o using len(o) or o.__length_hint__(). + If neither of those return a non-negative value, then return the + default value. If one of the calls fails, this function returns -1. + */ + + PyAPI_FUNC(PyObject *) PyObject_GetItem(PyObject *o, PyObject *key); + + /* + Return element of o corresponding to the object, key, or NULL + on failure. This is the equivalent of the Python expression: + o[key]. + + */ + + PyAPI_FUNC(int) PyObject_SetItem(PyObject *o, PyObject *key, PyObject *v); + + /* + Map the object, key, to the value, v. Returns + -1 on failure. This is the equivalent of the Python + statement: o[key]=v. + */ + + PyAPI_FUNC(int) PyObject_DelItemString(PyObject *o, char *key); + + /* + Remove the mapping for object, key, from the object *o. + Returns -1 on failure. This is equivalent to + the Python statement: del o[key]. + */ + + PyAPI_FUNC(int) PyObject_DelItem(PyObject *o, PyObject *key); + + /* + Delete the mapping for key from *o. Returns -1 on failure. + This is the equivalent of the Python statement: del o[key]. + */ + + PyAPI_FUNC(int) PyObject_AsCharBuffer(PyObject *obj, + const char **buffer, + Py_ssize_t *buffer_len); + + /* + Takes an arbitrary object which must support the (character, + single segment) buffer interface and returns a pointer to a + read-only memory location useable as character based input + for subsequent processing. + + 0 is returned on success. buffer and buffer_len are only + set in case no error occurs. Otherwise, -1 is returned and + an exception set. + + */ + + PyAPI_FUNC(int) PyObject_CheckReadBuffer(PyObject *obj); + + /* + Checks whether an arbitrary object supports the (character, + single segment) buffer interface. Returns 1 on success, 0 + on failure. + + */ + + PyAPI_FUNC(int) PyObject_AsReadBuffer(PyObject *obj, + const void **buffer, + Py_ssize_t *buffer_len); + + /* + Same as PyObject_AsCharBuffer() except that this API expects + (readable, single segment) buffer interface and returns a + pointer to a read-only memory location which can contain + arbitrary data. + + 0 is returned on success. buffer and buffer_len are only + set in case no error occurs. Otherwise, -1 is returned and + an exception set. + + */ + + PyAPI_FUNC(int) PyObject_AsWriteBuffer(PyObject *obj, + void **buffer, + Py_ssize_t *buffer_len); + + /* + Takes an arbitrary object which must support the (writeable, + single segment) buffer interface and returns a pointer to a + writeable memory location in buffer of size buffer_len. + + 0 is returned on success. buffer and buffer_len are only + set in case no error occurs. Otherwise, -1 is returned and + an exception set. + + */ + + /* new buffer API */ + +#define PyObject_CheckBuffer(obj) \ + (((obj)->ob_type->tp_as_buffer != NULL) && \ + (PyType_HasFeature((obj)->ob_type, Py_TPFLAGS_HAVE_NEWBUFFER)) && \ + ((obj)->ob_type->tp_as_buffer->bf_getbuffer != NULL)) + + /* Return 1 if the getbuffer function is available, otherwise + return 0 */ + + PyAPI_FUNC(int) PyObject_GetBuffer(PyObject *obj, Py_buffer *view, + int flags); + + /* This is a C-API version of the getbuffer function call. It checks + to make sure object has the required function pointer and issues the + call. Returns -1 and raises an error on failure and returns 0 on + success + */ + + + PyAPI_FUNC(void *) PyBuffer_GetPointer(Py_buffer *view, Py_ssize_t *indices); + + /* Get the memory area pointed to by the indices for the buffer given. + Note that view->ndim is the assumed size of indices + */ + + PyAPI_FUNC(int) PyBuffer_SizeFromFormat(const char *); + + /* Return the implied itemsize of the data-format area from a + struct-style description */ + + + + PyAPI_FUNC(int) PyBuffer_ToContiguous(void *buf, Py_buffer *view, + Py_ssize_t len, char fort); + + PyAPI_FUNC(int) PyBuffer_FromContiguous(Py_buffer *view, void *buf, + Py_ssize_t len, char fort); + + + /* Copy len bytes of data from the contiguous chunk of memory + pointed to by buf into the buffer exported by obj. Return + 0 on success and return -1 and raise a PyBuffer_Error on + error (i.e. the object does not have a buffer interface or + it is not working). + + If fort is 'F' and the object is multi-dimensional, + then the data will be copied into the array in + Fortran-style (first dimension varies the fastest). If + fort is 'C', then the data will be copied into the array + in C-style (last dimension varies the fastest). If fort + is 'A', then it does not matter and the copy will be made + in whatever way is more efficient. + + */ + + PyAPI_FUNC(int) PyObject_CopyData(PyObject *dest, PyObject *src); + + /* Copy the data from the src buffer to the buffer of destination + */ + + PyAPI_FUNC(int) PyBuffer_IsContiguous(Py_buffer *view, char fort); + + + PyAPI_FUNC(void) PyBuffer_FillContiguousStrides(int ndims, + Py_ssize_t *shape, + Py_ssize_t *strides, + int itemsize, + char fort); + + /* Fill the strides array with byte-strides of a contiguous + (Fortran-style if fort is 'F' or C-style otherwise) + array of the given shape with the given number of bytes + per element. + */ + + PyAPI_FUNC(int) PyBuffer_FillInfo(Py_buffer *view, PyObject *o, void *buf, + Py_ssize_t len, int readonly, + int flags); + + /* Fills in a buffer-info structure correctly for an exporter + that can only share a contiguous chunk of memory of + "unsigned bytes" of the given length. Returns 0 on success + and -1 (with raising an error) on error. + */ + + PyAPI_FUNC(void) PyBuffer_Release(Py_buffer *view); + + /* Releases a Py_buffer obtained from getbuffer ParseTuple's s*. + */ + + PyAPI_FUNC(PyObject *) PyObject_Format(PyObject* obj, + PyObject *format_spec); + /* + Takes an arbitrary object and returns the result of + calling obj.__format__(format_spec). + */ + +/* Iterators */ + + PyAPI_FUNC(PyObject *) PyObject_GetIter(PyObject *); + /* Takes an object and returns an iterator for it. + This is typically a new iterator but if the argument + is an iterator, this returns itself. */ + +#define PyIter_Check(obj) \ + (PyType_HasFeature((obj)->ob_type, Py_TPFLAGS_HAVE_ITER) && \ + (obj)->ob_type->tp_iternext != NULL && \ + (obj)->ob_type->tp_iternext != &_PyObject_NextNotImplemented) + + PyAPI_FUNC(PyObject *) PyIter_Next(PyObject *); + /* Takes an iterator object and calls its tp_iternext slot, + returning the next value. If the iterator is exhausted, + this returns NULL without setting an exception. + NULL with an exception means an error occurred. */ + +/* Number Protocol:*/ + + PyAPI_FUNC(int) PyNumber_Check(PyObject *o); + + /* + Returns 1 if the object, o, provides numeric protocols, and + false otherwise. + + This function always succeeds. + + */ + + PyAPI_FUNC(PyObject *) PyNumber_Add(PyObject *o1, PyObject *o2); + + /* + Returns the result of adding o1 and o2, or null on failure. + This is the equivalent of the Python expression: o1+o2. + + + */ + + PyAPI_FUNC(PyObject *) PyNumber_Subtract(PyObject *o1, PyObject *o2); + + /* + Returns the result of subtracting o2 from o1, or null on + failure. This is the equivalent of the Python expression: + o1-o2. + + */ + + PyAPI_FUNC(PyObject *) PyNumber_Multiply(PyObject *o1, PyObject *o2); + + /* + Returns the result of multiplying o1 and o2, or null on + failure. This is the equivalent of the Python expression: + o1*o2. + + + */ + + PyAPI_FUNC(PyObject *) PyNumber_Divide(PyObject *o1, PyObject *o2); + + /* + Returns the result of dividing o1 by o2, or null on failure. + This is the equivalent of the Python expression: o1/o2. + + + */ + + PyAPI_FUNC(PyObject *) PyNumber_FloorDivide(PyObject *o1, PyObject *o2); + + /* + Returns the result of dividing o1 by o2 giving an integral result, + or null on failure. + This is the equivalent of the Python expression: o1//o2. + + + */ + + PyAPI_FUNC(PyObject *) PyNumber_TrueDivide(PyObject *o1, PyObject *o2); + + /* + Returns the result of dividing o1 by o2 giving a float result, + or null on failure. + This is the equivalent of the Python expression: o1/o2. + + + */ + + PyAPI_FUNC(PyObject *) PyNumber_Remainder(PyObject *o1, PyObject *o2); + + /* + Returns the remainder of dividing o1 by o2, or null on + failure. This is the equivalent of the Python expression: + o1%o2. + + + */ + + PyAPI_FUNC(PyObject *) PyNumber_Divmod(PyObject *o1, PyObject *o2); + + /* + See the built-in function divmod. Returns NULL on failure. + This is the equivalent of the Python expression: + divmod(o1,o2). + + + */ + + PyAPI_FUNC(PyObject *) PyNumber_Power(PyObject *o1, PyObject *o2, + PyObject *o3); + + /* + See the built-in function pow. Returns NULL on failure. + This is the equivalent of the Python expression: + pow(o1,o2,o3), where o3 is optional. + + */ + + PyAPI_FUNC(PyObject *) PyNumber_Negative(PyObject *o); + + /* + Returns the negation of o on success, or null on failure. + This is the equivalent of the Python expression: -o. + + */ + + PyAPI_FUNC(PyObject *) PyNumber_Positive(PyObject *o); + + /* + Returns the (what?) of o on success, or NULL on failure. + This is the equivalent of the Python expression: +o. + + */ + + PyAPI_FUNC(PyObject *) PyNumber_Absolute(PyObject *o); + + /* + Returns the absolute value of o, or null on failure. This is + the equivalent of the Python expression: abs(o). + + */ + + PyAPI_FUNC(PyObject *) PyNumber_Invert(PyObject *o); + + /* + Returns the bitwise negation of o on success, or NULL on + failure. This is the equivalent of the Python expression: + ~o. + + + */ + + PyAPI_FUNC(PyObject *) PyNumber_Lshift(PyObject *o1, PyObject *o2); + + /* + Returns the result of left shifting o1 by o2 on success, or + NULL on failure. This is the equivalent of the Python + expression: o1 << o2. + + + */ + + PyAPI_FUNC(PyObject *) PyNumber_Rshift(PyObject *o1, PyObject *o2); + + /* + Returns the result of right shifting o1 by o2 on success, or + NULL on failure. This is the equivalent of the Python + expression: o1 >> o2. + + */ + + PyAPI_FUNC(PyObject *) PyNumber_And(PyObject *o1, PyObject *o2); + + /* + Returns the result of bitwise and of o1 and o2 on success, or + NULL on failure. This is the equivalent of the Python + expression: o1&o2. + + + */ + + PyAPI_FUNC(PyObject *) PyNumber_Xor(PyObject *o1, PyObject *o2); + + /* + Returns the bitwise exclusive or of o1 by o2 on success, or + NULL on failure. This is the equivalent of the Python + expression: o1^o2. + + + */ + + PyAPI_FUNC(PyObject *) PyNumber_Or(PyObject *o1, PyObject *o2); + + /* + Returns the result of bitwise or on o1 and o2 on success, or + NULL on failure. This is the equivalent of the Python + expression: o1|o2. + + */ + + /* Implemented elsewhere: + + int PyNumber_Coerce(PyObject **p1, PyObject **p2); + + This function takes the addresses of two variables of type + PyObject*. + + If the objects pointed to by *p1 and *p2 have the same type, + increment their reference count and return 0 (success). + If the objects can be converted to a common numeric type, + replace *p1 and *p2 by their converted value (with 'new' + reference counts), and return 0. + If no conversion is possible, or if some other error occurs, + return -1 (failure) and don't increment the reference counts. + The call PyNumber_Coerce(&o1, &o2) is equivalent to the Python + statement o1, o2 = coerce(o1, o2). + + */ + +#define PyIndex_Check(obj) \ + ((obj)->ob_type->tp_as_number != NULL && \ + PyType_HasFeature((obj)->ob_type, Py_TPFLAGS_HAVE_INDEX) && \ + (obj)->ob_type->tp_as_number->nb_index != NULL) + + PyAPI_FUNC(PyObject *) PyNumber_Index(PyObject *o); + + /* + Returns the object converted to a Python long or int + or NULL with an error raised on failure. + */ + + PyAPI_FUNC(Py_ssize_t) PyNumber_AsSsize_t(PyObject *o, PyObject *exc); + + /* + Returns the Integral instance converted to an int. The + instance is expected to be int or long or have an __int__ + method. Steals integral's reference. error_format will be + used to create the TypeError if integral isn't actually an + Integral instance. error_format should be a format string + that can accept a char* naming integral's type. + */ + + PyAPI_FUNC(PyObject *) _PyNumber_ConvertIntegralToInt( + PyObject *integral, + const char* error_format); + + /* + Returns the object converted to Py_ssize_t by going through + PyNumber_Index first. If an overflow error occurs while + converting the int-or-long to Py_ssize_t, then the second argument + is the error-type to return. If it is NULL, then the overflow error + is cleared and the value is clipped. + */ + + PyAPI_FUNC(PyObject *) PyNumber_Int(PyObject *o); + + /* + Returns the o converted to an integer object on success, or + NULL on failure. This is the equivalent of the Python + expression: int(o). + + */ + + PyAPI_FUNC(PyObject *) PyNumber_Long(PyObject *o); + + /* + Returns the o converted to a long integer object on success, + or NULL on failure. This is the equivalent of the Python + expression: long(o). + + */ + + PyAPI_FUNC(PyObject *) PyNumber_Float(PyObject *o); + + /* + Returns the o converted to a float object on success, or NULL + on failure. This is the equivalent of the Python expression: + float(o). + */ + +/* In-place variants of (some of) the above number protocol functions */ + + PyAPI_FUNC(PyObject *) PyNumber_InPlaceAdd(PyObject *o1, PyObject *o2); + + /* + Returns the result of adding o2 to o1, possibly in-place, or null + on failure. This is the equivalent of the Python expression: + o1 += o2. + + */ + + PyAPI_FUNC(PyObject *) PyNumber_InPlaceSubtract(PyObject *o1, PyObject *o2); + + /* + Returns the result of subtracting o2 from o1, possibly in-place or + null on failure. This is the equivalent of the Python expression: + o1 -= o2. + + */ + + PyAPI_FUNC(PyObject *) PyNumber_InPlaceMultiply(PyObject *o1, PyObject *o2); + + /* + Returns the result of multiplying o1 by o2, possibly in-place, or + null on failure. This is the equivalent of the Python expression: + o1 *= o2. + + */ + + PyAPI_FUNC(PyObject *) PyNumber_InPlaceDivide(PyObject *o1, PyObject *o2); + + /* + Returns the result of dividing o1 by o2, possibly in-place, or null + on failure. This is the equivalent of the Python expression: + o1 /= o2. + + */ + + PyAPI_FUNC(PyObject *) PyNumber_InPlaceFloorDivide(PyObject *o1, + PyObject *o2); + + /* + Returns the result of dividing o1 by o2 giving an integral result, + possibly in-place, or null on failure. + This is the equivalent of the Python expression: + o1 /= o2. + + */ + + PyAPI_FUNC(PyObject *) PyNumber_InPlaceTrueDivide(PyObject *o1, + PyObject *o2); + + /* + Returns the result of dividing o1 by o2 giving a float result, + possibly in-place, or null on failure. + This is the equivalent of the Python expression: + o1 /= o2. + + */ + + PyAPI_FUNC(PyObject *) PyNumber_InPlaceRemainder(PyObject *o1, PyObject *o2); + + /* + Returns the remainder of dividing o1 by o2, possibly in-place, or + null on failure. This is the equivalent of the Python expression: + o1 %= o2. + + */ + + PyAPI_FUNC(PyObject *) PyNumber_InPlacePower(PyObject *o1, PyObject *o2, + PyObject *o3); + + /* + Returns the result of raising o1 to the power of o2, possibly + in-place, or null on failure. This is the equivalent of the Python + expression: o1 **= o2, or pow(o1, o2, o3) if o3 is present. + + */ + + PyAPI_FUNC(PyObject *) PyNumber_InPlaceLshift(PyObject *o1, PyObject *o2); + + /* + Returns the result of left shifting o1 by o2, possibly in-place, or + null on failure. This is the equivalent of the Python expression: + o1 <<= o2. + + */ + + PyAPI_FUNC(PyObject *) PyNumber_InPlaceRshift(PyObject *o1, PyObject *o2); + + /* + Returns the result of right shifting o1 by o2, possibly in-place or + null on failure. This is the equivalent of the Python expression: + o1 >>= o2. + + */ + + PyAPI_FUNC(PyObject *) PyNumber_InPlaceAnd(PyObject *o1, PyObject *o2); + + /* + Returns the result of bitwise and of o1 and o2, possibly in-place, + or null on failure. This is the equivalent of the Python + expression: o1 &= o2. + + */ + + PyAPI_FUNC(PyObject *) PyNumber_InPlaceXor(PyObject *o1, PyObject *o2); + + /* + Returns the bitwise exclusive or of o1 by o2, possibly in-place, or + null on failure. This is the equivalent of the Python expression: + o1 ^= o2. + + */ + + PyAPI_FUNC(PyObject *) PyNumber_InPlaceOr(PyObject *o1, PyObject *o2); + + /* + Returns the result of bitwise or of o1 and o2, possibly in-place, + or null on failure. This is the equivalent of the Python + expression: o1 |= o2. + + */ + + + PyAPI_FUNC(PyObject *) PyNumber_ToBase(PyObject *n, int base); + + /* + Returns the integer n converted to a string with a base, with a base + marker of 0b, 0o or 0x prefixed if applicable. + If n is not an int object, it is converted with PyNumber_Index first. + */ + + +/* Sequence protocol:*/ + + PyAPI_FUNC(int) PySequence_Check(PyObject *o); + + /* + Return 1 if the object provides sequence protocol, and zero + otherwise. + + This function always succeeds. + + */ + + PyAPI_FUNC(Py_ssize_t) PySequence_Size(PyObject *o); + + /* + Return the size of sequence object o, or -1 on failure. + + */ + + /* For DLL compatibility */ +#undef PySequence_Length + PyAPI_FUNC(Py_ssize_t) PySequence_Length(PyObject *o); +#define PySequence_Length PySequence_Size + + + PyAPI_FUNC(PyObject *) PySequence_Concat(PyObject *o1, PyObject *o2); + + /* + Return the concatenation of o1 and o2 on success, and NULL on + failure. This is the equivalent of the Python + expression: o1+o2. + + */ + + PyAPI_FUNC(PyObject *) PySequence_Repeat(PyObject *o, Py_ssize_t count); + + /* + Return the result of repeating sequence object o count times, + or NULL on failure. This is the equivalent of the Python + expression: o1*count. + + */ + + PyAPI_FUNC(PyObject *) PySequence_GetItem(PyObject *o, Py_ssize_t i); + + /* + Return the ith element of o, or NULL on failure. This is the + equivalent of the Python expression: o[i]. + */ + + PyAPI_FUNC(PyObject *) PySequence_GetSlice(PyObject *o, Py_ssize_t i1, Py_ssize_t i2); + + /* + Return the slice of sequence object o between i1 and i2, or + NULL on failure. This is the equivalent of the Python + expression: o[i1:i2]. + + */ + + PyAPI_FUNC(int) PySequence_SetItem(PyObject *o, Py_ssize_t i, PyObject *v); + + /* + Assign object v to the ith element of o. Returns + -1 on failure. This is the equivalent of the Python + statement: o[i]=v. + + */ + + PyAPI_FUNC(int) PySequence_DelItem(PyObject *o, Py_ssize_t i); + + /* + Delete the ith element of object v. Returns + -1 on failure. This is the equivalent of the Python + statement: del o[i]. + */ + + PyAPI_FUNC(int) PySequence_SetSlice(PyObject *o, Py_ssize_t i1, Py_ssize_t i2, + PyObject *v); + + /* + Assign the sequence object, v, to the slice in sequence + object, o, from i1 to i2. Returns -1 on failure. This is the + equivalent of the Python statement: o[i1:i2]=v. + */ + + PyAPI_FUNC(int) PySequence_DelSlice(PyObject *o, Py_ssize_t i1, Py_ssize_t i2); + + /* + Delete the slice in sequence object, o, from i1 to i2. + Returns -1 on failure. This is the equivalent of the Python + statement: del o[i1:i2]. + */ + + PyAPI_FUNC(PyObject *) PySequence_Tuple(PyObject *o); + + /* + Returns the sequence, o, as a tuple on success, and NULL on failure. + This is equivalent to the Python expression: tuple(o) + */ + + + PyAPI_FUNC(PyObject *) PySequence_List(PyObject *o); + /* + Returns the sequence, o, as a list on success, and NULL on failure. + This is equivalent to the Python expression: list(o) + */ + + PyAPI_FUNC(PyObject *) PySequence_Fast(PyObject *o, const char* m); + /* + Returns the sequence, o, as a tuple, unless it's already a + tuple or list. Use PySequence_Fast_GET_ITEM to access the + members of this list, and PySequence_Fast_GET_SIZE to get its length. + + Returns NULL on failure. If the object does not support iteration, + raises a TypeError exception with m as the message text. + */ + +#define PySequence_Fast_GET_SIZE(o) \ + (PyList_Check(o) ? PyList_GET_SIZE(o) : PyTuple_GET_SIZE(o)) + /* + Return the size of o, assuming that o was returned by + PySequence_Fast and is not NULL. + */ + +#define PySequence_Fast_GET_ITEM(o, i)\ + (PyList_Check(o) ? PyList_GET_ITEM(o, i) : PyTuple_GET_ITEM(o, i)) + /* + Return the ith element of o, assuming that o was returned by + PySequence_Fast, and that i is within bounds. + */ + +#define PySequence_ITEM(o, i)\ + ( Py_TYPE(o)->tp_as_sequence->sq_item(o, i) ) + /* Assume tp_as_sequence and sq_item exist and that i does not + need to be corrected for a negative index + */ + +#define PySequence_Fast_ITEMS(sf) \ + (PyList_Check(sf) ? ((PyListObject *)(sf))->ob_item \ + : ((PyTupleObject *)(sf))->ob_item) + /* Return a pointer to the underlying item array for + an object retured by PySequence_Fast */ + + PyAPI_FUNC(Py_ssize_t) PySequence_Count(PyObject *o, PyObject *value); + + /* + Return the number of occurrences on value on o, that is, + return the number of keys for which o[key]==value. On + failure, return -1. This is equivalent to the Python + expression: o.count(value). + */ + + PyAPI_FUNC(int) PySequence_Contains(PyObject *seq, PyObject *ob); + /* + Return -1 if error; 1 if ob in seq; 0 if ob not in seq. + Use __contains__ if possible, else _PySequence_IterSearch(). + */ + +#define PY_ITERSEARCH_COUNT 1 +#define PY_ITERSEARCH_INDEX 2 +#define PY_ITERSEARCH_CONTAINS 3 + PyAPI_FUNC(Py_ssize_t) _PySequence_IterSearch(PyObject *seq, + PyObject *obj, int operation); + /* + Iterate over seq. Result depends on the operation: + PY_ITERSEARCH_COUNT: return # of times obj appears in seq; -1 if + error. + PY_ITERSEARCH_INDEX: return 0-based index of first occurrence of + obj in seq; set ValueError and return -1 if none found; + also return -1 on error. + PY_ITERSEARCH_CONTAINS: return 1 if obj in seq, else 0; -1 on + error. + */ + +/* For DLL-level backwards compatibility */ +#undef PySequence_In + PyAPI_FUNC(int) PySequence_In(PyObject *o, PyObject *value); + +/* For source-level backwards compatibility */ +#define PySequence_In PySequence_Contains + + /* + Determine if o contains value. If an item in o is equal to + X, return 1, otherwise return 0. On error, return -1. This + is equivalent to the Python expression: value in o. + */ + + PyAPI_FUNC(Py_ssize_t) PySequence_Index(PyObject *o, PyObject *value); + + /* + Return the first index for which o[i]=value. On error, + return -1. This is equivalent to the Python + expression: o.index(value). + */ + +/* In-place versions of some of the above Sequence functions. */ + + PyAPI_FUNC(PyObject *) PySequence_InPlaceConcat(PyObject *o1, PyObject *o2); + + /* + Append o2 to o1, in-place when possible. Return the resulting + object, which could be o1, or NULL on failure. This is the + equivalent of the Python expression: o1 += o2. + + */ + + PyAPI_FUNC(PyObject *) PySequence_InPlaceRepeat(PyObject *o, Py_ssize_t count); + + /* + Repeat o1 by count, in-place when possible. Return the resulting + object, which could be o1, or NULL on failure. This is the + equivalent of the Python expression: o1 *= count. + + */ + +/* Mapping protocol:*/ + + PyAPI_FUNC(int) PyMapping_Check(PyObject *o); + + /* + Return 1 if the object provides mapping protocol, and zero + otherwise. + + This function always succeeds. + */ + + PyAPI_FUNC(Py_ssize_t) PyMapping_Size(PyObject *o); + + /* + Returns the number of keys in object o on success, and -1 on + failure. For objects that do not provide sequence protocol, + this is equivalent to the Python expression: len(o). + */ + + /* For DLL compatibility */ +#undef PyMapping_Length + PyAPI_FUNC(Py_ssize_t) PyMapping_Length(PyObject *o); +#define PyMapping_Length PyMapping_Size + + + /* implemented as a macro: + + int PyMapping_DelItemString(PyObject *o, char *key); + + Remove the mapping for object, key, from the object *o. + Returns -1 on failure. This is equivalent to + the Python statement: del o[key]. + */ +#define PyMapping_DelItemString(O,K) PyObject_DelItemString((O),(K)) + + /* implemented as a macro: + + int PyMapping_DelItem(PyObject *o, PyObject *key); + + Remove the mapping for object, key, from the object *o. + Returns -1 on failure. This is equivalent to + the Python statement: del o[key]. + */ +#define PyMapping_DelItem(O,K) PyObject_DelItem((O),(K)) + + PyAPI_FUNC(int) PyMapping_HasKeyString(PyObject *o, char *key); + + /* + On success, return 1 if the mapping object has the key, key, + and 0 otherwise. This is equivalent to the Python expression: + o.has_key(key). + + This function always succeeds. + */ + + PyAPI_FUNC(int) PyMapping_HasKey(PyObject *o, PyObject *key); + + /* + Return 1 if the mapping object has the key, key, + and 0 otherwise. This is equivalent to the Python expression: + o.has_key(key). + + This function always succeeds. + + */ + + /* Implemented as macro: + + PyObject *PyMapping_Keys(PyObject *o); + + On success, return a list of the keys in object o. On + failure, return NULL. This is equivalent to the Python + expression: o.keys(). + */ +#define PyMapping_Keys(O) PyObject_CallMethod(O,"keys",NULL) + + /* Implemented as macro: + + PyObject *PyMapping_Values(PyObject *o); + + On success, return a list of the values in object o. On + failure, return NULL. This is equivalent to the Python + expression: o.values(). + */ +#define PyMapping_Values(O) PyObject_CallMethod(O,"values",NULL) + + /* Implemented as macro: + + PyObject *PyMapping_Items(PyObject *o); + + On success, return a list of the items in object o, where + each item is a tuple containing a key-value pair. On + failure, return NULL. This is equivalent to the Python + expression: o.items(). + + */ +#define PyMapping_Items(O) PyObject_CallMethod(O,"items",NULL) + + PyAPI_FUNC(PyObject *) PyMapping_GetItemString(PyObject *o, char *key); + + /* + Return element of o corresponding to the object, key, or NULL + on failure. This is the equivalent of the Python expression: + o[key]. + */ + + PyAPI_FUNC(int) PyMapping_SetItemString(PyObject *o, char *key, + PyObject *value); + + /* + Map the object, key, to the value, v. Returns + -1 on failure. This is the equivalent of the Python + statement: o[key]=v. + */ + + +PyAPI_FUNC(int) PyObject_IsInstance(PyObject *object, PyObject *typeorclass); + /* isinstance(object, typeorclass) */ + +PyAPI_FUNC(int) PyObject_IsSubclass(PyObject *object, PyObject *typeorclass); + /* issubclass(object, typeorclass) */ + + +PyAPI_FUNC(int) _PyObject_RealIsInstance(PyObject *inst, PyObject *cls); + +PyAPI_FUNC(int) _PyObject_RealIsSubclass(PyObject *derived, PyObject *cls); + + +/* For internal use by buffer API functions */ +PyAPI_FUNC(void) _Py_add_one_to_index_F(int nd, Py_ssize_t *index, + const Py_ssize_t *shape); +PyAPI_FUNC(void) _Py_add_one_to_index_C(int nd, Py_ssize_t *index, + const Py_ssize_t *shape); + + +#ifdef __cplusplus +} +#endif +#endif /* Py_ABSTRACTOBJECT_H */ diff --git a/extern/include/Python-2.7/asdl.h b/extern/include/Python-2.7/asdl.h new file mode 100644 index 0000000..84e837e --- /dev/null +++ b/extern/include/Python-2.7/asdl.h @@ -0,0 +1,45 @@ +#ifndef Py_ASDL_H +#define Py_ASDL_H + +typedef PyObject * identifier; +typedef PyObject * string; +typedef PyObject * object; + +#ifndef __cplusplus +typedef enum {false, true} bool; +#endif + +/* It would be nice if the code generated by asdl_c.py was completely + independent of Python, but it is a goal the requires too much work + at this stage. So, for example, I'll represent identifiers as + interned Python strings. +*/ + +/* XXX A sequence should be typed so that its use can be typechecked. */ + +typedef struct { + int size; + void *elements[1]; +} asdl_seq; + +typedef struct { + int size; + int elements[1]; +} asdl_int_seq; + +asdl_seq *asdl_seq_new(int size, PyArena *arena); +asdl_int_seq *asdl_int_seq_new(int size, PyArena *arena); + +#define asdl_seq_GET(S, I) (S)->elements[(I)] +#define asdl_seq_LEN(S) ((S) == NULL ? 0 : (S)->size) +#ifdef Py_DEBUG +#define asdl_seq_SET(S, I, V) { \ + int _asdl_i = (I); \ + assert((S) && _asdl_i < (S)->size); \ + (S)->elements[_asdl_i] = (V); \ +} +#else +#define asdl_seq_SET(S, I, V) (S)->elements[I] = (V) +#endif + +#endif /* !Py_ASDL_H */ diff --git a/extern/include/Python-2.7/ast.h b/extern/include/Python-2.7/ast.h new file mode 100644 index 0000000..cc14b7f --- /dev/null +++ b/extern/include/Python-2.7/ast.h @@ -0,0 +1,13 @@ +#ifndef Py_AST_H +#define Py_AST_H +#ifdef __cplusplus +extern "C" { +#endif + +PyAPI_FUNC(mod_ty) PyAST_FromNode(const node *, PyCompilerFlags *flags, + const char *, PyArena *); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_AST_H */ diff --git a/extern/include/Python-2.7/bitset.h b/extern/include/Python-2.7/bitset.h new file mode 100644 index 0000000..991296c --- /dev/null +++ b/extern/include/Python-2.7/bitset.h @@ -0,0 +1,30 @@ + +#ifndef Py_BITSET_H +#define Py_BITSET_H +#ifdef __cplusplus +extern "C" { +#endif + +/* Bitset interface */ + +typedef char *bitset; + +bitset newbitset(int nbits); +void delbitset(bitset bs); +#define testbit(ss, ibit) (((ss)[BIT2BYTE(ibit)] & BIT2MASK(ibit)) != 0) +int addbit(bitset bs, int ibit); /* Returns 0 if already set */ +int samebitset(bitset bs1, bitset bs2, int nbits); +void mergebitset(bitset bs1, bitset bs2, int nbits); + +#define BITSPERBYTE (8*sizeof(BYTE)) +#define NBYTES(nbits) (((nbits) + BITSPERBYTE - 1) / BITSPERBYTE) + +#define BIT2BYTE(ibit) ((ibit) / BITSPERBYTE) +#define BIT2SHIFT(ibit) ((ibit) % BITSPERBYTE) +#define BIT2MASK(ibit) (1 << BIT2SHIFT(ibit)) +#define BYTE2BIT(ibyte) ((ibyte) * BITSPERBYTE) + +#ifdef __cplusplus +} +#endif +#endif /* !Py_BITSET_H */ diff --git a/extern/include/Python-2.7/boolobject.h b/extern/include/Python-2.7/boolobject.h new file mode 100644 index 0000000..74e854f --- /dev/null +++ b/extern/include/Python-2.7/boolobject.h @@ -0,0 +1,36 @@ +/* Boolean object interface */ + +#ifndef Py_BOOLOBJECT_H +#define Py_BOOLOBJECT_H +#ifdef __cplusplus +extern "C" { +#endif + + +typedef PyIntObject PyBoolObject; + +PyAPI_DATA(PyTypeObject) PyBool_Type; + +#define PyBool_Check(x) (Py_TYPE(x) == &PyBool_Type) + +/* Py_False and Py_True are the only two bools in existence. +Don't forget to apply Py_INCREF() when returning either!!! */ + +/* Don't use these directly */ +PyAPI_DATA(PyIntObject) _Py_ZeroStruct, _Py_TrueStruct; + +/* Use these macros */ +#define Py_False ((PyObject *) &_Py_ZeroStruct) +#define Py_True ((PyObject *) &_Py_TrueStruct) + +/* Macros for returning Py_True or Py_False, respectively */ +#define Py_RETURN_TRUE return Py_INCREF(Py_True), Py_True +#define Py_RETURN_FALSE return Py_INCREF(Py_False), Py_False + +/* Function to return a bool from a C long */ +PyAPI_FUNC(PyObject *) PyBool_FromLong(long); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_BOOLOBJECT_H */ diff --git a/extern/include/Python-2.7/bufferobject.h b/extern/include/Python-2.7/bufferobject.h new file mode 100644 index 0000000..6dd8345 --- /dev/null +++ b/extern/include/Python-2.7/bufferobject.h @@ -0,0 +1,33 @@ + +/* Buffer object interface */ + +/* Note: the object's structure is private */ + +#ifndef Py_BUFFEROBJECT_H +#define Py_BUFFEROBJECT_H +#ifdef __cplusplus +extern "C" { +#endif + + +PyAPI_DATA(PyTypeObject) PyBuffer_Type; + +#define PyBuffer_Check(op) (Py_TYPE(op) == &PyBuffer_Type) + +#define Py_END_OF_BUFFER (-1) + +PyAPI_FUNC(PyObject *) PyBuffer_FromObject(PyObject *base, + Py_ssize_t offset, Py_ssize_t size); +PyAPI_FUNC(PyObject *) PyBuffer_FromReadWriteObject(PyObject *base, + Py_ssize_t offset, + Py_ssize_t size); + +PyAPI_FUNC(PyObject *) PyBuffer_FromMemory(void *ptr, Py_ssize_t size); +PyAPI_FUNC(PyObject *) PyBuffer_FromReadWriteMemory(void *ptr, Py_ssize_t size); + +PyAPI_FUNC(PyObject *) PyBuffer_New(Py_ssize_t size); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_BUFFEROBJECT_H */ diff --git a/extern/include/Python-2.7/bytearrayobject.h b/extern/include/Python-2.7/bytearrayobject.h new file mode 100644 index 0000000..e1281a6 --- /dev/null +++ b/extern/include/Python-2.7/bytearrayobject.h @@ -0,0 +1,57 @@ +/* ByteArray object interface */ + +#ifndef Py_BYTEARRAYOBJECT_H +#define Py_BYTEARRAYOBJECT_H +#ifdef __cplusplus +extern "C" { +#endif + +#include + +/* Type PyByteArrayObject represents a mutable array of bytes. + * The Python API is that of a sequence; + * the bytes are mapped to ints in [0, 256). + * Bytes are not characters; they may be used to encode characters. + * The only way to go between bytes and str/unicode is via encoding + * and decoding. + * For the convenience of C programmers, the bytes type is considered + * to contain a char pointer, not an unsigned char pointer. + */ + +/* Object layout */ +typedef struct { + PyObject_VAR_HEAD + /* XXX(nnorwitz): should ob_exports be Py_ssize_t? */ + int ob_exports; /* how many buffer exports */ + Py_ssize_t ob_alloc; /* How many bytes allocated */ + char *ob_bytes; +} PyByteArrayObject; + +/* Type object */ +PyAPI_DATA(PyTypeObject) PyByteArray_Type; +PyAPI_DATA(PyTypeObject) PyByteArrayIter_Type; + +/* Type check macros */ +#define PyByteArray_Check(self) PyObject_TypeCheck(self, &PyByteArray_Type) +#define PyByteArray_CheckExact(self) (Py_TYPE(self) == &PyByteArray_Type) + +/* Direct API functions */ +PyAPI_FUNC(PyObject *) PyByteArray_FromObject(PyObject *); +PyAPI_FUNC(PyObject *) PyByteArray_Concat(PyObject *, PyObject *); +PyAPI_FUNC(PyObject *) PyByteArray_FromStringAndSize(const char *, Py_ssize_t); +PyAPI_FUNC(Py_ssize_t) PyByteArray_Size(PyObject *); +PyAPI_FUNC(char *) PyByteArray_AsString(PyObject *); +PyAPI_FUNC(int) PyByteArray_Resize(PyObject *, Py_ssize_t); + +/* Macros, trading safety for speed */ +#define PyByteArray_AS_STRING(self) \ + (assert(PyByteArray_Check(self)), \ + Py_SIZE(self) ? ((PyByteArrayObject *)(self))->ob_bytes : _PyByteArray_empty_string) +#define PyByteArray_GET_SIZE(self) (assert(PyByteArray_Check(self)),Py_SIZE(self)) + +PyAPI_DATA(char) _PyByteArray_empty_string[]; + +#ifdef __cplusplus +} +#endif +#endif /* !Py_BYTEARRAYOBJECT_H */ diff --git a/extern/include/Python-2.7/bytes_methods.h b/extern/include/Python-2.7/bytes_methods.h new file mode 100644 index 0000000..4125666 --- /dev/null +++ b/extern/include/Python-2.7/bytes_methods.h @@ -0,0 +1,75 @@ +#ifndef Py_BYTES_CTYPE_H +#define Py_BYTES_CTYPE_H + +/* + * The internal implementation behind PyString (bytes) and PyBytes (buffer) + * methods of the given names, they operate on ASCII byte strings. + */ +extern PyObject* _Py_bytes_isspace(const char *cptr, Py_ssize_t len); +extern PyObject* _Py_bytes_isalpha(const char *cptr, Py_ssize_t len); +extern PyObject* _Py_bytes_isalnum(const char *cptr, Py_ssize_t len); +extern PyObject* _Py_bytes_isdigit(const char *cptr, Py_ssize_t len); +extern PyObject* _Py_bytes_islower(const char *cptr, Py_ssize_t len); +extern PyObject* _Py_bytes_isupper(const char *cptr, Py_ssize_t len); +extern PyObject* _Py_bytes_istitle(const char *cptr, Py_ssize_t len); + +/* These store their len sized answer in the given preallocated *result arg. */ +extern void _Py_bytes_lower(char *result, const char *cptr, Py_ssize_t len); +extern void _Py_bytes_upper(char *result, const char *cptr, Py_ssize_t len); +extern void _Py_bytes_title(char *result, char *s, Py_ssize_t len); +extern void _Py_bytes_capitalize(char *result, char *s, Py_ssize_t len); +extern void _Py_bytes_swapcase(char *result, char *s, Py_ssize_t len); + +/* Shared __doc__ strings. */ +extern const char _Py_isspace__doc__[]; +extern const char _Py_isalpha__doc__[]; +extern const char _Py_isalnum__doc__[]; +extern const char _Py_isdigit__doc__[]; +extern const char _Py_islower__doc__[]; +extern const char _Py_isupper__doc__[]; +extern const char _Py_istitle__doc__[]; +extern const char _Py_lower__doc__[]; +extern const char _Py_upper__doc__[]; +extern const char _Py_title__doc__[]; +extern const char _Py_capitalize__doc__[]; +extern const char _Py_swapcase__doc__[]; + +/* These are left in for backward compatibility and will be removed + in 2.8/3.2 */ +#define ISLOWER(c) Py_ISLOWER(c) +#define ISUPPER(c) Py_ISUPPER(c) +#define ISALPHA(c) Py_ISALPHA(c) +#define ISDIGIT(c) Py_ISDIGIT(c) +#define ISXDIGIT(c) Py_ISXDIGIT(c) +#define ISALNUM(c) Py_ISALNUM(c) +#define ISSPACE(c) Py_ISSPACE(c) + +#undef islower +#define islower(c) undefined_islower(c) +#undef isupper +#define isupper(c) undefined_isupper(c) +#undef isalpha +#define isalpha(c) undefined_isalpha(c) +#undef isdigit +#define isdigit(c) undefined_isdigit(c) +#undef isxdigit +#define isxdigit(c) undefined_isxdigit(c) +#undef isalnum +#define isalnum(c) undefined_isalnum(c) +#undef isspace +#define isspace(c) undefined_isspace(c) + +/* These are left in for backward compatibility and will be removed + in 2.8/3.2 */ +#define TOLOWER(c) Py_TOLOWER(c) +#define TOUPPER(c) Py_TOUPPER(c) + +#undef tolower +#define tolower(c) undefined_tolower(c) +#undef toupper +#define toupper(c) undefined_toupper(c) + +/* this is needed because some docs are shared from the .o, not static */ +#define PyDoc_STRVAR_shared(name,str) const char name[] = PyDoc_STR(str) + +#endif /* !Py_BYTES_CTYPE_H */ diff --git a/extern/include/Python-2.7/bytesobject.h b/extern/include/Python-2.7/bytesobject.h new file mode 100644 index 0000000..1083da9 --- /dev/null +++ b/extern/include/Python-2.7/bytesobject.h @@ -0,0 +1,27 @@ +#define PyBytesObject PyStringObject +#define PyBytes_Type PyString_Type + +#define PyBytes_Check PyString_Check +#define PyBytes_CheckExact PyString_CheckExact +#define PyBytes_CHECK_INTERNED PyString_CHECK_INTERNED +#define PyBytes_AS_STRING PyString_AS_STRING +#define PyBytes_GET_SIZE PyString_GET_SIZE +#define Py_TPFLAGS_BYTES_SUBCLASS Py_TPFLAGS_STRING_SUBCLASS + +#define PyBytes_FromStringAndSize PyString_FromStringAndSize +#define PyBytes_FromString PyString_FromString +#define PyBytes_FromFormatV PyString_FromFormatV +#define PyBytes_FromFormat PyString_FromFormat +#define PyBytes_Size PyString_Size +#define PyBytes_AsString PyString_AsString +#define PyBytes_Repr PyString_Repr +#define PyBytes_Concat PyString_Concat +#define PyBytes_ConcatAndDel PyString_ConcatAndDel +#define _PyBytes_Resize _PyString_Resize +#define _PyBytes_Eq _PyString_Eq +#define PyBytes_Format PyString_Format +#define _PyBytes_FormatLong _PyString_FormatLong +#define PyBytes_DecodeEscape PyString_DecodeEscape +#define _PyBytes_Join _PyString_Join +#define PyBytes_AsStringAndSize PyString_AsStringAndSize +#define _PyBytes_InsertThousandsGrouping _PyString_InsertThousandsGrouping diff --git a/extern/include/Python-2.7/cStringIO.h b/extern/include/Python-2.7/cStringIO.h new file mode 100644 index 0000000..973a471 --- /dev/null +++ b/extern/include/Python-2.7/cStringIO.h @@ -0,0 +1,73 @@ +#ifndef Py_CSTRINGIO_H +#define Py_CSTRINGIO_H +#ifdef __cplusplus +extern "C" { +#endif +/* + + This header provides access to cStringIO objects from C. + Functions are provided for calling cStringIO objects and + macros are provided for testing whether you have cStringIO + objects. + + Before calling any of the functions or macros, you must initialize + the routines with: + + PycString_IMPORT + + This would typically be done in your init function. + +*/ + +#define PycStringIO_CAPSULE_NAME "cStringIO.cStringIO_CAPI" + +#define PycString_IMPORT \ + PycStringIO = ((struct PycStringIO_CAPI*)PyCapsule_Import(\ + PycStringIO_CAPSULE_NAME, 0)) + +/* Basic functions to manipulate cStringIO objects from C */ + +static struct PycStringIO_CAPI { + + /* Read a string from an input object. If the last argument + is -1, the remainder will be read. + */ + int(*cread)(PyObject *, char **, Py_ssize_t); + + /* Read a line from an input object. Returns the length of the read + line as an int and a pointer inside the object buffer as char** (so + the caller doesn't have to provide its own buffer as destination). + */ + int(*creadline)(PyObject *, char **); + + /* Write a string to an output object*/ + int(*cwrite)(PyObject *, const char *, Py_ssize_t); + + /* Get the output object as a Python string (returns new reference). */ + PyObject *(*cgetvalue)(PyObject *); + + /* Create a new output object */ + PyObject *(*NewOutput)(int); + + /* Create an input object from a Python string + (copies the Python string reference). + */ + PyObject *(*NewInput)(PyObject *); + + /* The Python types for cStringIO input and output objects. + Note that you can do input on an output object. + */ + PyTypeObject *InputType, *OutputType; + +} *PycStringIO; + +/* These can be used to test if you have one */ +#define PycStringIO_InputCheck(O) \ + (Py_TYPE(O)==PycStringIO->InputType) +#define PycStringIO_OutputCheck(O) \ + (Py_TYPE(O)==PycStringIO->OutputType) + +#ifdef __cplusplus +} +#endif +#endif /* !Py_CSTRINGIO_H */ diff --git a/extern/include/Python-2.7/cellobject.h b/extern/include/Python-2.7/cellobject.h new file mode 100644 index 0000000..c927ee5 --- /dev/null +++ b/extern/include/Python-2.7/cellobject.h @@ -0,0 +1,28 @@ +/* Cell object interface */ + +#ifndef Py_CELLOBJECT_H +#define Py_CELLOBJECT_H +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct { + PyObject_HEAD + PyObject *ob_ref; /* Content of the cell or NULL when empty */ +} PyCellObject; + +PyAPI_DATA(PyTypeObject) PyCell_Type; + +#define PyCell_Check(op) (Py_TYPE(op) == &PyCell_Type) + +PyAPI_FUNC(PyObject *) PyCell_New(PyObject *); +PyAPI_FUNC(PyObject *) PyCell_Get(PyObject *); +PyAPI_FUNC(int) PyCell_Set(PyObject *, PyObject *); + +#define PyCell_GET(op) (((PyCellObject *)(op))->ob_ref) +#define PyCell_SET(op, v) (((PyCellObject *)(op))->ob_ref = v) + +#ifdef __cplusplus +} +#endif +#endif /* !Py_TUPLEOBJECT_H */ diff --git a/extern/include/Python-2.7/ceval.h b/extern/include/Python-2.7/ceval.h new file mode 100644 index 0000000..0e8bd2a --- /dev/null +++ b/extern/include/Python-2.7/ceval.h @@ -0,0 +1,153 @@ +#ifndef Py_CEVAL_H +#define Py_CEVAL_H +#ifdef __cplusplus +extern "C" { +#endif + + +/* Interface to random parts in ceval.c */ + +PyAPI_FUNC(PyObject *) PyEval_CallObjectWithKeywords( + PyObject *, PyObject *, PyObject *); + +/* Inline this */ +#define PyEval_CallObject(func,arg) \ + PyEval_CallObjectWithKeywords(func, arg, (PyObject *)NULL) + +PyAPI_FUNC(PyObject *) PyEval_CallFunction(PyObject *obj, + const char *format, ...); +PyAPI_FUNC(PyObject *) PyEval_CallMethod(PyObject *obj, + const char *methodname, + const char *format, ...); + +PyAPI_FUNC(void) PyEval_SetProfile(Py_tracefunc, PyObject *); +PyAPI_FUNC(void) PyEval_SetTrace(Py_tracefunc, PyObject *); + +struct _frame; /* Avoid including frameobject.h */ + +PyAPI_FUNC(PyObject *) PyEval_GetBuiltins(void); +PyAPI_FUNC(PyObject *) PyEval_GetGlobals(void); +PyAPI_FUNC(PyObject *) PyEval_GetLocals(void); +PyAPI_FUNC(struct _frame *) PyEval_GetFrame(void); +PyAPI_FUNC(int) PyEval_GetRestricted(void); + +/* Look at the current frame's (if any) code's co_flags, and turn on + the corresponding compiler flags in cf->cf_flags. Return 1 if any + flag was set, else return 0. */ +PyAPI_FUNC(int) PyEval_MergeCompilerFlags(PyCompilerFlags *cf); + +PyAPI_FUNC(int) Py_FlushLine(void); + +PyAPI_FUNC(int) Py_AddPendingCall(int (*func)(void *), void *arg); +PyAPI_FUNC(int) Py_MakePendingCalls(void); + +/* Protection against deeply nested recursive calls */ +PyAPI_FUNC(void) Py_SetRecursionLimit(int); +PyAPI_FUNC(int) Py_GetRecursionLimit(void); + +#define Py_EnterRecursiveCall(where) \ + (_Py_MakeRecCheck(PyThreadState_GET()->recursion_depth) && \ + _Py_CheckRecursiveCall(where)) +#define Py_LeaveRecursiveCall() \ + (--PyThreadState_GET()->recursion_depth) +PyAPI_FUNC(int) _Py_CheckRecursiveCall(char *where); +PyAPI_DATA(int) _Py_CheckRecursionLimit; +#ifdef USE_STACKCHECK +# define _Py_MakeRecCheck(x) (++(x) > --_Py_CheckRecursionLimit) +#else +# define _Py_MakeRecCheck(x) (++(x) > _Py_CheckRecursionLimit) +#endif + +PyAPI_FUNC(const char *) PyEval_GetFuncName(PyObject *); +PyAPI_FUNC(const char *) PyEval_GetFuncDesc(PyObject *); + +PyAPI_FUNC(PyObject *) PyEval_GetCallStats(PyObject *); +PyAPI_FUNC(PyObject *) PyEval_EvalFrame(struct _frame *); +PyAPI_FUNC(PyObject *) PyEval_EvalFrameEx(struct _frame *f, int exc); + +/* this used to be handled on a per-thread basis - now just two globals */ +PyAPI_DATA(volatile int) _Py_Ticker; +PyAPI_DATA(int) _Py_CheckInterval; + +/* Interface for threads. + + A module that plans to do a blocking system call (or something else + that lasts a long time and doesn't touch Python data) can allow other + threads to run as follows: + + ...preparations here... + Py_BEGIN_ALLOW_THREADS + ...blocking system call here... + Py_END_ALLOW_THREADS + ...interpret result here... + + The Py_BEGIN_ALLOW_THREADS/Py_END_ALLOW_THREADS pair expands to a + {}-surrounded block. + To leave the block in the middle (e.g., with return), you must insert + a line containing Py_BLOCK_THREADS before the return, e.g. + + if (...premature_exit...) { + Py_BLOCK_THREADS + PyErr_SetFromErrno(PyExc_IOError); + return NULL; + } + + An alternative is: + + Py_BLOCK_THREADS + if (...premature_exit...) { + PyErr_SetFromErrno(PyExc_IOError); + return NULL; + } + Py_UNBLOCK_THREADS + + For convenience, that the value of 'errno' is restored across + Py_END_ALLOW_THREADS and Py_BLOCK_THREADS. + + WARNING: NEVER NEST CALLS TO Py_BEGIN_ALLOW_THREADS AND + Py_END_ALLOW_THREADS!!! + + The function PyEval_InitThreads() should be called only from + initthread() in "threadmodule.c". + + Note that not yet all candidates have been converted to use this + mechanism! +*/ + +PyAPI_FUNC(PyThreadState *) PyEval_SaveThread(void); +PyAPI_FUNC(void) PyEval_RestoreThread(PyThreadState *); + +#ifdef WITH_THREAD + +PyAPI_FUNC(int) PyEval_ThreadsInitialized(void); +PyAPI_FUNC(void) PyEval_InitThreads(void); +PyAPI_FUNC(void) PyEval_AcquireLock(void); +PyAPI_FUNC(void) PyEval_ReleaseLock(void); +PyAPI_FUNC(void) PyEval_AcquireThread(PyThreadState *tstate); +PyAPI_FUNC(void) PyEval_ReleaseThread(PyThreadState *tstate); +PyAPI_FUNC(void) PyEval_ReInitThreads(void); + +#define Py_BEGIN_ALLOW_THREADS { \ + PyThreadState *_save; \ + _save = PyEval_SaveThread(); +#define Py_BLOCK_THREADS PyEval_RestoreThread(_save); +#define Py_UNBLOCK_THREADS _save = PyEval_SaveThread(); +#define Py_END_ALLOW_THREADS PyEval_RestoreThread(_save); \ + } + +#else /* !WITH_THREAD */ + +#define Py_BEGIN_ALLOW_THREADS { +#define Py_BLOCK_THREADS +#define Py_UNBLOCK_THREADS +#define Py_END_ALLOW_THREADS } + +#endif /* !WITH_THREAD */ + +PyAPI_FUNC(int) _PyEval_SliceIndex(PyObject *, Py_ssize_t *); + + +#ifdef __cplusplus +} +#endif +#endif /* !Py_CEVAL_H */ diff --git a/extern/include/Python-2.7/classobject.h b/extern/include/Python-2.7/classobject.h new file mode 100644 index 0000000..bc03e0d --- /dev/null +++ b/extern/include/Python-2.7/classobject.h @@ -0,0 +1,83 @@ + +/* Class object interface */ + +/* Revealing some structures (not for general use) */ + +#ifndef Py_CLASSOBJECT_H +#define Py_CLASSOBJECT_H +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct { + PyObject_HEAD + PyObject *cl_bases; /* A tuple of class objects */ + PyObject *cl_dict; /* A dictionary */ + PyObject *cl_name; /* A string */ + /* The following three are functions or NULL */ + PyObject *cl_getattr; + PyObject *cl_setattr; + PyObject *cl_delattr; + PyObject *cl_weakreflist; /* List of weak references */ +} PyClassObject; + +typedef struct { + PyObject_HEAD + PyClassObject *in_class; /* The class object */ + PyObject *in_dict; /* A dictionary */ + PyObject *in_weakreflist; /* List of weak references */ +} PyInstanceObject; + +typedef struct { + PyObject_HEAD + PyObject *im_func; /* The callable object implementing the method */ + PyObject *im_self; /* The instance it is bound to, or NULL */ + PyObject *im_class; /* The class that asked for the method */ + PyObject *im_weakreflist; /* List of weak references */ +} PyMethodObject; + +PyAPI_DATA(PyTypeObject) PyClass_Type, PyInstance_Type, PyMethod_Type; + +#define PyClass_Check(op) ((op)->ob_type == &PyClass_Type) +#define PyInstance_Check(op) ((op)->ob_type == &PyInstance_Type) +#define PyMethod_Check(op) ((op)->ob_type == &PyMethod_Type) + +PyAPI_FUNC(PyObject *) PyClass_New(PyObject *, PyObject *, PyObject *); +PyAPI_FUNC(PyObject *) PyInstance_New(PyObject *, PyObject *, + PyObject *); +PyAPI_FUNC(PyObject *) PyInstance_NewRaw(PyObject *, PyObject *); +PyAPI_FUNC(PyObject *) PyMethod_New(PyObject *, PyObject *, PyObject *); + +PyAPI_FUNC(PyObject *) PyMethod_Function(PyObject *); +PyAPI_FUNC(PyObject *) PyMethod_Self(PyObject *); +PyAPI_FUNC(PyObject *) PyMethod_Class(PyObject *); + +/* Look up attribute with name (a string) on instance object pinst, using + * only the instance and base class dicts. If a descriptor is found in + * a class dict, the descriptor is returned without calling it. + * Returns NULL if nothing found, else a borrowed reference to the + * value associated with name in the dict in which name was found. + * The point of this routine is that it never calls arbitrary Python + * code, so is always "safe": all it does is dict lookups. The function + * can't fail, never sets an exception, and NULL is not an error (it just + * means "not found"). + */ +PyAPI_FUNC(PyObject *) _PyInstance_Lookup(PyObject *pinst, PyObject *name); + +/* Macros for direct access to these values. Type checks are *not* + done, so use with care. */ +#define PyMethod_GET_FUNCTION(meth) \ + (((PyMethodObject *)meth) -> im_func) +#define PyMethod_GET_SELF(meth) \ + (((PyMethodObject *)meth) -> im_self) +#define PyMethod_GET_CLASS(meth) \ + (((PyMethodObject *)meth) -> im_class) + +PyAPI_FUNC(int) PyClass_IsSubclass(PyObject *, PyObject *); + +PyAPI_FUNC(int) PyMethod_ClearFreeList(void); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_CLASSOBJECT_H */ diff --git a/extern/include/Python-2.7/cobject.h b/extern/include/Python-2.7/cobject.h new file mode 100644 index 0000000..ad3cd9c --- /dev/null +++ b/extern/include/Python-2.7/cobject.h @@ -0,0 +1,89 @@ +/* + CObjects are marked Pending Deprecation as of Python 2.7. + The full schedule for 2.x is as follows: + - CObjects are marked Pending Deprecation in Python 2.7. + - CObjects will be marked Deprecated in Python 2.8 + (if there is one). + - CObjects will be removed in Python 2.9 (if there is one). + + Additionally, for the Python 3.x series: + - CObjects were marked Deprecated in Python 3.1. + - CObjects will be removed in Python 3.2. + + You should switch all use of CObjects to capsules. Capsules + have a safer and more consistent API. For more information, + see Include/pycapsule.h, or read the "Capsules" topic in + the "Python/C API Reference Manual". + + Python 2.7 no longer uses CObjects itself; all objects which + were formerly CObjects are now capsules. Note that this change + does not by itself break binary compatibility with extensions + built for previous versions of Python--PyCObject_AsVoidPtr() + has been changed to also understand capsules. + +*/ + +/* original file header comment follows: */ + +/* C objects to be exported from one extension module to another. + + C objects are used for communication between extension modules. + They provide a way for an extension module to export a C interface + to other extension modules, so that extension modules can use the + Python import mechanism to link to one another. + +*/ + +#ifndef Py_COBJECT_H +#define Py_COBJECT_H +#ifdef __cplusplus +extern "C" { +#endif + +PyAPI_DATA(PyTypeObject) PyCObject_Type; + +#define PyCObject_Check(op) (Py_TYPE(op) == &PyCObject_Type) + +/* Create a PyCObject from a pointer to a C object and an optional + destructor function. If the second argument is non-null, then it + will be called with the first argument if and when the PyCObject is + destroyed. + +*/ +PyAPI_FUNC(PyObject *) PyCObject_FromVoidPtr( + void *cobj, void (*destruct)(void*)); + + +/* Create a PyCObject from a pointer to a C object, a description object, + and an optional destructor function. If the third argument is non-null, + then it will be called with the first and second arguments if and when + the PyCObject is destroyed. +*/ +PyAPI_FUNC(PyObject *) PyCObject_FromVoidPtrAndDesc( + void *cobj, void *desc, void (*destruct)(void*,void*)); + +/* Retrieve a pointer to a C object from a PyCObject. */ +PyAPI_FUNC(void *) PyCObject_AsVoidPtr(PyObject *); + +/* Retrieve a pointer to a description object from a PyCObject. */ +PyAPI_FUNC(void *) PyCObject_GetDesc(PyObject *); + +/* Import a pointer to a C object from a module using a PyCObject. */ +PyAPI_FUNC(void *) PyCObject_Import(char *module_name, char *cobject_name); + +/* Modify a C object. Fails (==0) if object has a destructor. */ +PyAPI_FUNC(int) PyCObject_SetVoidPtr(PyObject *self, void *cobj); + + +typedef struct { + PyObject_HEAD + void *cobject; + void *desc; + void (*destructor)(void *); +} PyCObject; + + +#ifdef __cplusplus +} +#endif +#endif /* !Py_COBJECT_H */ diff --git a/extern/include/Python-2.7/code.h b/extern/include/Python-2.7/code.h new file mode 100644 index 0000000..38b2958 --- /dev/null +++ b/extern/include/Python-2.7/code.h @@ -0,0 +1,107 @@ +/* Definitions for bytecode */ + +#ifndef Py_CODE_H +#define Py_CODE_H +#ifdef __cplusplus +extern "C" { +#endif + +/* Bytecode object */ +typedef struct { + PyObject_HEAD + int co_argcount; /* #arguments, except *args */ + int co_nlocals; /* #local variables */ + int co_stacksize; /* #entries needed for evaluation stack */ + int co_flags; /* CO_..., see below */ + PyObject *co_code; /* instruction opcodes */ + PyObject *co_consts; /* list (constants used) */ + PyObject *co_names; /* list of strings (names used) */ + PyObject *co_varnames; /* tuple of strings (local variable names) */ + PyObject *co_freevars; /* tuple of strings (free variable names) */ + PyObject *co_cellvars; /* tuple of strings (cell variable names) */ + /* The rest doesn't count for hash/cmp */ + PyObject *co_filename; /* string (where it was loaded from) */ + PyObject *co_name; /* string (name, for reference) */ + int co_firstlineno; /* first source line number */ + PyObject *co_lnotab; /* string (encoding addr<->lineno mapping) See + Objects/lnotab_notes.txt for details. */ + void *co_zombieframe; /* for optimization only (see frameobject.c) */ + PyObject *co_weakreflist; /* to support weakrefs to code objects */ +} PyCodeObject; + +/* Masks for co_flags above */ +#define CO_OPTIMIZED 0x0001 +#define CO_NEWLOCALS 0x0002 +#define CO_VARARGS 0x0004 +#define CO_VARKEYWORDS 0x0008 +#define CO_NESTED 0x0010 +#define CO_GENERATOR 0x0020 +/* The CO_NOFREE flag is set if there are no free or cell variables. + This information is redundant, but it allows a single flag test + to determine whether there is any extra work to be done when the + call frame it setup. +*/ +#define CO_NOFREE 0x0040 + +#if 0 +/* This is no longer used. Stopped defining in 2.5, do not re-use. */ +#define CO_GENERATOR_ALLOWED 0x1000 +#endif +#define CO_FUTURE_DIVISION 0x2000 +#define CO_FUTURE_ABSOLUTE_IMPORT 0x4000 /* do absolute imports by default */ +#define CO_FUTURE_WITH_STATEMENT 0x8000 +#define CO_FUTURE_PRINT_FUNCTION 0x10000 +#define CO_FUTURE_UNICODE_LITERALS 0x20000 + +/* This should be defined if a future statement modifies the syntax. + For example, when a keyword is added. +*/ +#if 1 +#define PY_PARSER_REQUIRES_FUTURE_KEYWORD +#endif + +#define CO_MAXBLOCKS 20 /* Max static block nesting within a function */ + +PyAPI_DATA(PyTypeObject) PyCode_Type; + +#define PyCode_Check(op) (Py_TYPE(op) == &PyCode_Type) +#define PyCode_GetNumFree(op) (PyTuple_GET_SIZE((op)->co_freevars)) + +/* Public interface */ +PyAPI_FUNC(PyCodeObject *) PyCode_New( + int, int, int, int, PyObject *, PyObject *, PyObject *, PyObject *, + PyObject *, PyObject *, PyObject *, PyObject *, int, PyObject *); + /* same as struct above */ + +/* Creates a new empty code object with the specified source location. */ +PyAPI_FUNC(PyCodeObject *) +PyCode_NewEmpty(const char *filename, const char *funcname, int firstlineno); + +/* Return the line number associated with the specified bytecode index + in this code object. If you just need the line number of a frame, + use PyFrame_GetLineNumber() instead. */ +PyAPI_FUNC(int) PyCode_Addr2Line(PyCodeObject *, int); + +/* for internal use only */ +#define _PyCode_GETCODEPTR(co, pp) \ + ((*Py_TYPE((co)->co_code)->tp_as_buffer->bf_getreadbuffer) \ + ((co)->co_code, 0, (void **)(pp))) + +typedef struct _addr_pair { + int ap_lower; + int ap_upper; +} PyAddrPair; + +/* Update *bounds to describe the first and one-past-the-last instructions in the + same line as lasti. Return the number of that line. +*/ +PyAPI_FUNC(int) _PyCode_CheckLineNumber(PyCodeObject* co, + int lasti, PyAddrPair *bounds); + +PyAPI_FUNC(PyObject*) PyCode_Optimize(PyObject *code, PyObject* consts, + PyObject *names, PyObject *lineno_obj); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_CODE_H */ diff --git a/extern/include/Python-2.7/codecs.h b/extern/include/Python-2.7/codecs.h new file mode 100644 index 0000000..c038c6a --- /dev/null +++ b/extern/include/Python-2.7/codecs.h @@ -0,0 +1,167 @@ +#ifndef Py_CODECREGISTRY_H +#define Py_CODECREGISTRY_H +#ifdef __cplusplus +extern "C" { +#endif + +/* ------------------------------------------------------------------------ + + Python Codec Registry and support functions + + +Written by Marc-Andre Lemburg (mal@lemburg.com). + +Copyright (c) Corporation for National Research Initiatives. + + ------------------------------------------------------------------------ */ + +/* Register a new codec search function. + + As side effect, this tries to load the encodings package, if not + yet done, to make sure that it is always first in the list of + search functions. + + The search_function's refcount is incremented by this function. */ + +PyAPI_FUNC(int) PyCodec_Register( + PyObject *search_function + ); + +/* Codec register lookup API. + + Looks up the given encoding and returns a CodecInfo object with + function attributes which implement the different aspects of + processing the encoding. + + The encoding string is looked up converted to all lower-case + characters. This makes encodings looked up through this mechanism + effectively case-insensitive. + + If no codec is found, a KeyError is set and NULL returned. + + As side effect, this tries to load the encodings package, if not + yet done. This is part of the lazy load strategy for the encodings + package. + + */ + +PyAPI_FUNC(PyObject *) _PyCodec_Lookup( + const char *encoding + ); + +/* Generic codec based encoding API. + + object is passed through the encoder function found for the given + encoding using the error handling method defined by errors. errors + may be NULL to use the default method defined for the codec. + + Raises a LookupError in case no encoder can be found. + + */ + +PyAPI_FUNC(PyObject *) PyCodec_Encode( + PyObject *object, + const char *encoding, + const char *errors + ); + +/* Generic codec based decoding API. + + object is passed through the decoder function found for the given + encoding using the error handling method defined by errors. errors + may be NULL to use the default method defined for the codec. + + Raises a LookupError in case no encoder can be found. + + */ + +PyAPI_FUNC(PyObject *) PyCodec_Decode( + PyObject *object, + const char *encoding, + const char *errors + ); + +/* --- Codec Lookup APIs -------------------------------------------------- + + All APIs return a codec object with incremented refcount and are + based on _PyCodec_Lookup(). The same comments w/r to the encoding + name also apply to these APIs. + +*/ + +/* Get an encoder function for the given encoding. */ + +PyAPI_FUNC(PyObject *) PyCodec_Encoder( + const char *encoding + ); + +/* Get a decoder function for the given encoding. */ + +PyAPI_FUNC(PyObject *) PyCodec_Decoder( + const char *encoding + ); + +/* Get a IncrementalEncoder object for the given encoding. */ + +PyAPI_FUNC(PyObject *) PyCodec_IncrementalEncoder( + const char *encoding, + const char *errors + ); + +/* Get a IncrementalDecoder object function for the given encoding. */ + +PyAPI_FUNC(PyObject *) PyCodec_IncrementalDecoder( + const char *encoding, + const char *errors + ); + +/* Get a StreamReader factory function for the given encoding. */ + +PyAPI_FUNC(PyObject *) PyCodec_StreamReader( + const char *encoding, + PyObject *stream, + const char *errors + ); + +/* Get a StreamWriter factory function for the given encoding. */ + +PyAPI_FUNC(PyObject *) PyCodec_StreamWriter( + const char *encoding, + PyObject *stream, + const char *errors + ); + +/* Unicode encoding error handling callback registry API */ + +/* Register the error handling callback function error under the given + name. This function will be called by the codec when it encounters + unencodable characters/undecodable bytes and doesn't know the + callback name, when name is specified as the error parameter + in the call to the encode/decode function. + Return 0 on success, -1 on error */ +PyAPI_FUNC(int) PyCodec_RegisterError(const char *name, PyObject *error); + +/* Lookup the error handling callback function registered under the given + name. As a special case NULL can be passed, in which case + the error handling callback for "strict" will be returned. */ +PyAPI_FUNC(PyObject *) PyCodec_LookupError(const char *name); + +/* raise exc as an exception */ +PyAPI_FUNC(PyObject *) PyCodec_StrictErrors(PyObject *exc); + +/* ignore the unicode error, skipping the faulty input */ +PyAPI_FUNC(PyObject *) PyCodec_IgnoreErrors(PyObject *exc); + +/* replace the unicode encode error with ? or U+FFFD */ +PyAPI_FUNC(PyObject *) PyCodec_ReplaceErrors(PyObject *exc); + +/* replace the unicode encode error with XML character references */ +PyAPI_FUNC(PyObject *) PyCodec_XMLCharRefReplaceErrors(PyObject *exc); + +/* replace the unicode encode error with backslash escapes (\x, \u and \U) */ +PyAPI_FUNC(PyObject *) PyCodec_BackslashReplaceErrors(PyObject *exc); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_CODECREGISTRY_H */ diff --git a/extern/include/Python-2.7/compile.h b/extern/include/Python-2.7/compile.h new file mode 100644 index 0000000..6100101 --- /dev/null +++ b/extern/include/Python-2.7/compile.h @@ -0,0 +1,40 @@ + +#ifndef Py_COMPILE_H +#define Py_COMPILE_H + +#include "code.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* Public interface */ +struct _node; /* Declare the existence of this type */ +PyAPI_FUNC(PyCodeObject *) PyNode_Compile(struct _node *, const char *); + +/* Future feature support */ + +typedef struct { + int ff_features; /* flags set by future statements */ + int ff_lineno; /* line number of last future statement */ +} PyFutureFeatures; + +#define FUTURE_NESTED_SCOPES "nested_scopes" +#define FUTURE_GENERATORS "generators" +#define FUTURE_DIVISION "division" +#define FUTURE_ABSOLUTE_IMPORT "absolute_import" +#define FUTURE_WITH_STATEMENT "with_statement" +#define FUTURE_PRINT_FUNCTION "print_function" +#define FUTURE_UNICODE_LITERALS "unicode_literals" + + +struct _mod; /* Declare the existence of this type */ +PyAPI_FUNC(PyCodeObject *) PyAST_Compile(struct _mod *, const char *, + PyCompilerFlags *, PyArena *); +PyAPI_FUNC(PyFutureFeatures *) PyFuture_FromAST(struct _mod *, const char *); + + +#ifdef __cplusplus +} +#endif +#endif /* !Py_COMPILE_H */ diff --git a/extern/include/Python-2.7/complexobject.h b/extern/include/Python-2.7/complexobject.h new file mode 100644 index 0000000..c9a9500 --- /dev/null +++ b/extern/include/Python-2.7/complexobject.h @@ -0,0 +1,66 @@ +/* Complex number structure */ + +#ifndef Py_COMPLEXOBJECT_H +#define Py_COMPLEXOBJECT_H +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct { + double real; + double imag; +} Py_complex; + +/* Operations on complex numbers from complexmodule.c */ + +#define c_sum _Py_c_sum +#define c_diff _Py_c_diff +#define c_neg _Py_c_neg +#define c_prod _Py_c_prod +#define c_quot _Py_c_quot +#define c_pow _Py_c_pow +#define c_abs _Py_c_abs + +PyAPI_FUNC(Py_complex) c_sum(Py_complex, Py_complex); +PyAPI_FUNC(Py_complex) c_diff(Py_complex, Py_complex); +PyAPI_FUNC(Py_complex) c_neg(Py_complex); +PyAPI_FUNC(Py_complex) c_prod(Py_complex, Py_complex); +PyAPI_FUNC(Py_complex) c_quot(Py_complex, Py_complex); +PyAPI_FUNC(Py_complex) c_pow(Py_complex, Py_complex); +PyAPI_FUNC(double) c_abs(Py_complex); + + +/* Complex object interface */ + +/* +PyComplexObject represents a complex number with double-precision +real and imaginary parts. +*/ + +typedef struct { + PyObject_HEAD + Py_complex cval; +} PyComplexObject; + +PyAPI_DATA(PyTypeObject) PyComplex_Type; + +#define PyComplex_Check(op) PyObject_TypeCheck(op, &PyComplex_Type) +#define PyComplex_CheckExact(op) (Py_TYPE(op) == &PyComplex_Type) + +PyAPI_FUNC(PyObject *) PyComplex_FromCComplex(Py_complex); +PyAPI_FUNC(PyObject *) PyComplex_FromDoubles(double real, double imag); + +PyAPI_FUNC(double) PyComplex_RealAsDouble(PyObject *op); +PyAPI_FUNC(double) PyComplex_ImagAsDouble(PyObject *op); +PyAPI_FUNC(Py_complex) PyComplex_AsCComplex(PyObject *op); + +/* Format the object based on the format_spec, as defined in PEP 3101 + (Advanced String Formatting). */ +PyAPI_FUNC(PyObject *) _PyComplex_FormatAdvanced(PyObject *obj, + char *format_spec, + Py_ssize_t format_spec_len); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_COMPLEXOBJECT_H */ diff --git a/extern/include/Python-2.7/datetime.h b/extern/include/Python-2.7/datetime.h new file mode 100644 index 0000000..c0e7ffd --- /dev/null +++ b/extern/include/Python-2.7/datetime.h @@ -0,0 +1,239 @@ +/* datetime.h + */ + +#ifndef DATETIME_H +#define DATETIME_H +#ifdef __cplusplus +extern "C" { +#endif + +/* Fields are packed into successive bytes, each viewed as unsigned and + * big-endian, unless otherwise noted: + * + * byte offset + * 0 year 2 bytes, 1-9999 + * 2 month 1 byte, 1-12 + * 3 day 1 byte, 1-31 + * 4 hour 1 byte, 0-23 + * 5 minute 1 byte, 0-59 + * 6 second 1 byte, 0-59 + * 7 usecond 3 bytes, 0-999999 + * 10 + */ + +/* # of bytes for year, month, and day. */ +#define _PyDateTime_DATE_DATASIZE 4 + +/* # of bytes for hour, minute, second, and usecond. */ +#define _PyDateTime_TIME_DATASIZE 6 + +/* # of bytes for year, month, day, hour, minute, second, and usecond. */ +#define _PyDateTime_DATETIME_DATASIZE 10 + + +typedef struct +{ + PyObject_HEAD + long hashcode; /* -1 when unknown */ + int days; /* -MAX_DELTA_DAYS <= days <= MAX_DELTA_DAYS */ + int seconds; /* 0 <= seconds < 24*3600 is invariant */ + int microseconds; /* 0 <= microseconds < 1000000 is invariant */ +} PyDateTime_Delta; + +typedef struct +{ + PyObject_HEAD /* a pure abstract base class */ +} PyDateTime_TZInfo; + + +/* The datetime and time types have hashcodes, and an optional tzinfo member, + * present if and only if hastzinfo is true. + */ +#define _PyTZINFO_HEAD \ + PyObject_HEAD \ + long hashcode; \ + char hastzinfo; /* boolean flag */ + +/* No _PyDateTime_BaseTZInfo is allocated; it's just to have something + * convenient to cast to, when getting at the hastzinfo member of objects + * starting with _PyTZINFO_HEAD. + */ +typedef struct +{ + _PyTZINFO_HEAD +} _PyDateTime_BaseTZInfo; + +/* All time objects are of PyDateTime_TimeType, but that can be allocated + * in two ways, with or without a tzinfo member. Without is the same as + * tzinfo == None, but consumes less memory. _PyDateTime_BaseTime is an + * internal struct used to allocate the right amount of space for the + * "without" case. + */ +#define _PyDateTime_TIMEHEAD \ + _PyTZINFO_HEAD \ + unsigned char data[_PyDateTime_TIME_DATASIZE]; + +typedef struct +{ + _PyDateTime_TIMEHEAD +} _PyDateTime_BaseTime; /* hastzinfo false */ + +typedef struct +{ + _PyDateTime_TIMEHEAD + PyObject *tzinfo; +} PyDateTime_Time; /* hastzinfo true */ + + +/* All datetime objects are of PyDateTime_DateTimeType, but that can be + * allocated in two ways too, just like for time objects above. In addition, + * the plain date type is a base class for datetime, so it must also have + * a hastzinfo member (although it's unused there). + */ +typedef struct +{ + _PyTZINFO_HEAD + unsigned char data[_PyDateTime_DATE_DATASIZE]; +} PyDateTime_Date; + +#define _PyDateTime_DATETIMEHEAD \ + _PyTZINFO_HEAD \ + unsigned char data[_PyDateTime_DATETIME_DATASIZE]; + +typedef struct +{ + _PyDateTime_DATETIMEHEAD +} _PyDateTime_BaseDateTime; /* hastzinfo false */ + +typedef struct +{ + _PyDateTime_DATETIMEHEAD + PyObject *tzinfo; +} PyDateTime_DateTime; /* hastzinfo true */ + + +/* Apply for date and datetime instances. */ +#define PyDateTime_GET_YEAR(o) ((((PyDateTime_Date*)o)->data[0] << 8) | \ + ((PyDateTime_Date*)o)->data[1]) +#define PyDateTime_GET_MONTH(o) (((PyDateTime_Date*)o)->data[2]) +#define PyDateTime_GET_DAY(o) (((PyDateTime_Date*)o)->data[3]) + +#define PyDateTime_DATE_GET_HOUR(o) (((PyDateTime_DateTime*)o)->data[4]) +#define PyDateTime_DATE_GET_MINUTE(o) (((PyDateTime_DateTime*)o)->data[5]) +#define PyDateTime_DATE_GET_SECOND(o) (((PyDateTime_DateTime*)o)->data[6]) +#define PyDateTime_DATE_GET_MICROSECOND(o) \ + ((((PyDateTime_DateTime*)o)->data[7] << 16) | \ + (((PyDateTime_DateTime*)o)->data[8] << 8) | \ + ((PyDateTime_DateTime*)o)->data[9]) + +/* Apply for time instances. */ +#define PyDateTime_TIME_GET_HOUR(o) (((PyDateTime_Time*)o)->data[0]) +#define PyDateTime_TIME_GET_MINUTE(o) (((PyDateTime_Time*)o)->data[1]) +#define PyDateTime_TIME_GET_SECOND(o) (((PyDateTime_Time*)o)->data[2]) +#define PyDateTime_TIME_GET_MICROSECOND(o) \ + ((((PyDateTime_Time*)o)->data[3] << 16) | \ + (((PyDateTime_Time*)o)->data[4] << 8) | \ + ((PyDateTime_Time*)o)->data[5]) + + +/* Define structure for C API. */ +typedef struct { + /* type objects */ + PyTypeObject *DateType; + PyTypeObject *DateTimeType; + PyTypeObject *TimeType; + PyTypeObject *DeltaType; + PyTypeObject *TZInfoType; + + /* constructors */ + PyObject *(*Date_FromDate)(int, int, int, PyTypeObject*); + PyObject *(*DateTime_FromDateAndTime)(int, int, int, int, int, int, int, + PyObject*, PyTypeObject*); + PyObject *(*Time_FromTime)(int, int, int, int, PyObject*, PyTypeObject*); + PyObject *(*Delta_FromDelta)(int, int, int, int, PyTypeObject*); + + /* constructors for the DB API */ + PyObject *(*DateTime_FromTimestamp)(PyObject*, PyObject*, PyObject*); + PyObject *(*Date_FromTimestamp)(PyObject*, PyObject*); + +} PyDateTime_CAPI; + +#define PyDateTime_CAPSULE_NAME "datetime.datetime_CAPI" + + +/* "magic" constant used to partially protect against developer mistakes. */ +#define DATETIME_API_MAGIC 0x414548d5 + +#ifdef Py_BUILD_CORE + +/* Macros for type checking when building the Python core. */ +#define PyDate_Check(op) PyObject_TypeCheck(op, &PyDateTime_DateType) +#define PyDate_CheckExact(op) (Py_TYPE(op) == &PyDateTime_DateType) + +#define PyDateTime_Check(op) PyObject_TypeCheck(op, &PyDateTime_DateTimeType) +#define PyDateTime_CheckExact(op) (Py_TYPE(op) == &PyDateTime_DateTimeType) + +#define PyTime_Check(op) PyObject_TypeCheck(op, &PyDateTime_TimeType) +#define PyTime_CheckExact(op) (Py_TYPE(op) == &PyDateTime_TimeType) + +#define PyDelta_Check(op) PyObject_TypeCheck(op, &PyDateTime_DeltaType) +#define PyDelta_CheckExact(op) (Py_TYPE(op) == &PyDateTime_DeltaType) + +#define PyTZInfo_Check(op) PyObject_TypeCheck(op, &PyDateTime_TZInfoType) +#define PyTZInfo_CheckExact(op) (Py_TYPE(op) == &PyDateTime_TZInfoType) + +#else + +/* Define global variable for the C API and a macro for setting it. */ +static PyDateTime_CAPI *PyDateTimeAPI = NULL; + +#define PyDateTime_IMPORT \ + PyDateTimeAPI = (PyDateTime_CAPI *)PyCapsule_Import(PyDateTime_CAPSULE_NAME, 0) + +/* Macros for type checking when not building the Python core. */ +#define PyDate_Check(op) PyObject_TypeCheck(op, PyDateTimeAPI->DateType) +#define PyDate_CheckExact(op) (Py_TYPE(op) == PyDateTimeAPI->DateType) + +#define PyDateTime_Check(op) PyObject_TypeCheck(op, PyDateTimeAPI->DateTimeType) +#define PyDateTime_CheckExact(op) (Py_TYPE(op) == PyDateTimeAPI->DateTimeType) + +#define PyTime_Check(op) PyObject_TypeCheck(op, PyDateTimeAPI->TimeType) +#define PyTime_CheckExact(op) (Py_TYPE(op) == PyDateTimeAPI->TimeType) + +#define PyDelta_Check(op) PyObject_TypeCheck(op, PyDateTimeAPI->DeltaType) +#define PyDelta_CheckExact(op) (Py_TYPE(op) == PyDateTimeAPI->DeltaType) + +#define PyTZInfo_Check(op) PyObject_TypeCheck(op, PyDateTimeAPI->TZInfoType) +#define PyTZInfo_CheckExact(op) (Py_TYPE(op) == PyDateTimeAPI->TZInfoType) + +/* Macros for accessing constructors in a simplified fashion. */ +#define PyDate_FromDate(year, month, day) \ + PyDateTimeAPI->Date_FromDate(year, month, day, PyDateTimeAPI->DateType) + +#define PyDateTime_FromDateAndTime(year, month, day, hour, min, sec, usec) \ + PyDateTimeAPI->DateTime_FromDateAndTime(year, month, day, hour, \ + min, sec, usec, Py_None, PyDateTimeAPI->DateTimeType) + +#define PyTime_FromTime(hour, minute, second, usecond) \ + PyDateTimeAPI->Time_FromTime(hour, minute, second, usecond, \ + Py_None, PyDateTimeAPI->TimeType) + +#define PyDelta_FromDSU(days, seconds, useconds) \ + PyDateTimeAPI->Delta_FromDelta(days, seconds, useconds, 1, \ + PyDateTimeAPI->DeltaType) + +/* Macros supporting the DB API. */ +#define PyDateTime_FromTimestamp(args) \ + PyDateTimeAPI->DateTime_FromTimestamp( \ + (PyObject*) (PyDateTimeAPI->DateTimeType), args, NULL) + +#define PyDate_FromTimestamp(args) \ + PyDateTimeAPI->Date_FromTimestamp( \ + (PyObject*) (PyDateTimeAPI->DateType), args) + +#endif /* Py_BUILD_CORE */ + +#ifdef __cplusplus +} +#endif +#endif diff --git a/extern/include/Python-2.7/descrobject.h b/extern/include/Python-2.7/descrobject.h new file mode 100644 index 0000000..b542732 --- /dev/null +++ b/extern/include/Python-2.7/descrobject.h @@ -0,0 +1,94 @@ +/* Descriptors */ +#ifndef Py_DESCROBJECT_H +#define Py_DESCROBJECT_H +#ifdef __cplusplus +extern "C" { +#endif + +typedef PyObject *(*getter)(PyObject *, void *); +typedef int (*setter)(PyObject *, PyObject *, void *); + +typedef struct PyGetSetDef { + char *name; + getter get; + setter set; + char *doc; + void *closure; +} PyGetSetDef; + +typedef PyObject *(*wrapperfunc)(PyObject *self, PyObject *args, + void *wrapped); + +typedef PyObject *(*wrapperfunc_kwds)(PyObject *self, PyObject *args, + void *wrapped, PyObject *kwds); + +struct wrapperbase { + char *name; + int offset; + void *function; + wrapperfunc wrapper; + char *doc; + int flags; + PyObject *name_strobj; +}; + +/* Flags for above struct */ +#define PyWrapperFlag_KEYWORDS 1 /* wrapper function takes keyword args */ + +/* Various kinds of descriptor objects */ + +#define PyDescr_COMMON \ + PyObject_HEAD \ + PyTypeObject *d_type; \ + PyObject *d_name + +typedef struct { + PyDescr_COMMON; +} PyDescrObject; + +typedef struct { + PyDescr_COMMON; + PyMethodDef *d_method; +} PyMethodDescrObject; + +typedef struct { + PyDescr_COMMON; + struct PyMemberDef *d_member; +} PyMemberDescrObject; + +typedef struct { + PyDescr_COMMON; + PyGetSetDef *d_getset; +} PyGetSetDescrObject; + +typedef struct { + PyDescr_COMMON; + struct wrapperbase *d_base; + void *d_wrapped; /* This can be any function pointer */ +} PyWrapperDescrObject; + +PyAPI_DATA(PyTypeObject) PyWrapperDescr_Type; +PyAPI_DATA(PyTypeObject) PyDictProxy_Type; +PyAPI_DATA(PyTypeObject) PyGetSetDescr_Type; +PyAPI_DATA(PyTypeObject) PyMemberDescr_Type; + +PyAPI_FUNC(PyObject *) PyDescr_NewMethod(PyTypeObject *, PyMethodDef *); +PyAPI_FUNC(PyObject *) PyDescr_NewClassMethod(PyTypeObject *, PyMethodDef *); +PyAPI_FUNC(PyObject *) PyDescr_NewMember(PyTypeObject *, + struct PyMemberDef *); +PyAPI_FUNC(PyObject *) PyDescr_NewGetSet(PyTypeObject *, + struct PyGetSetDef *); +PyAPI_FUNC(PyObject *) PyDescr_NewWrapper(PyTypeObject *, + struct wrapperbase *, void *); +#define PyDescr_IsData(d) (Py_TYPE(d)->tp_descr_set != NULL) + +PyAPI_FUNC(PyObject *) PyDictProxy_New(PyObject *); +PyAPI_FUNC(PyObject *) PyWrapper_New(PyObject *, PyObject *); + + +PyAPI_DATA(PyTypeObject) PyProperty_Type; +#ifdef __cplusplus +} +#endif +#endif /* !Py_DESCROBJECT_H */ + diff --git a/extern/include/Python-2.7/dictobject.h b/extern/include/Python-2.7/dictobject.h new file mode 100644 index 0000000..ece01c6 --- /dev/null +++ b/extern/include/Python-2.7/dictobject.h @@ -0,0 +1,156 @@ +#ifndef Py_DICTOBJECT_H +#define Py_DICTOBJECT_H +#ifdef __cplusplus +extern "C" { +#endif + + +/* Dictionary object type -- mapping from hashable object to object */ + +/* The distribution includes a separate file, Objects/dictnotes.txt, + describing explorations into dictionary design and optimization. + It covers typical dictionary use patterns, the parameters for + tuning dictionaries, and several ideas for possible optimizations. +*/ + +/* +There are three kinds of slots in the table: + +1. Unused. me_key == me_value == NULL + Does not hold an active (key, value) pair now and never did. Unused can + transition to Active upon key insertion. This is the only case in which + me_key is NULL, and is each slot's initial state. + +2. Active. me_key != NULL and me_key != dummy and me_value != NULL + Holds an active (key, value) pair. Active can transition to Dummy upon + key deletion. This is the only case in which me_value != NULL. + +3. Dummy. me_key == dummy and me_value == NULL + Previously held an active (key, value) pair, but that was deleted and an + active pair has not yet overwritten the slot. Dummy can transition to + Active upon key insertion. Dummy slots cannot be made Unused again + (cannot have me_key set to NULL), else the probe sequence in case of + collision would have no way to know they were once active. + +Note: .popitem() abuses the me_hash field of an Unused or Dummy slot to +hold a search finger. The me_hash field of Unused or Dummy slots has no +meaning otherwise. +*/ + +/* PyDict_MINSIZE is the minimum size of a dictionary. This many slots are + * allocated directly in the dict object (in the ma_smalltable member). + * It must be a power of 2, and at least 4. 8 allows dicts with no more + * than 5 active entries to live in ma_smalltable (and so avoid an + * additional malloc); instrumentation suggested this suffices for the + * majority of dicts (consisting mostly of usually-small instance dicts and + * usually-small dicts created to pass keyword arguments). + */ +#define PyDict_MINSIZE 8 + +typedef struct { + /* Cached hash code of me_key. Note that hash codes are C longs. + * We have to use Py_ssize_t instead because dict_popitem() abuses + * me_hash to hold a search finger. + */ + Py_ssize_t me_hash; + PyObject *me_key; + PyObject *me_value; +} PyDictEntry; + +/* +To ensure the lookup algorithm terminates, there must be at least one Unused +slot (NULL key) in the table. +The value ma_fill is the number of non-NULL keys (sum of Active and Dummy); +ma_used is the number of non-NULL, non-dummy keys (== the number of non-NULL +values == the number of Active items). +To avoid slowing down lookups on a near-full table, we resize the table when +it's two-thirds full. +*/ +typedef struct _dictobject PyDictObject; +struct _dictobject { + PyObject_HEAD + Py_ssize_t ma_fill; /* # Active + # Dummy */ + Py_ssize_t ma_used; /* # Active */ + + /* The table contains ma_mask + 1 slots, and that's a power of 2. + * We store the mask instead of the size because the mask is more + * frequently needed. + */ + Py_ssize_t ma_mask; + + /* ma_table points to ma_smalltable for small tables, else to + * additional malloc'ed memory. ma_table is never NULL! This rule + * saves repeated runtime null-tests in the workhorse getitem and + * setitem calls. + */ + PyDictEntry *ma_table; + PyDictEntry *(*ma_lookup)(PyDictObject *mp, PyObject *key, long hash); + PyDictEntry ma_smalltable[PyDict_MINSIZE]; +}; + +PyAPI_DATA(PyTypeObject) PyDict_Type; +PyAPI_DATA(PyTypeObject) PyDictIterKey_Type; +PyAPI_DATA(PyTypeObject) PyDictIterValue_Type; +PyAPI_DATA(PyTypeObject) PyDictIterItem_Type; +PyAPI_DATA(PyTypeObject) PyDictKeys_Type; +PyAPI_DATA(PyTypeObject) PyDictItems_Type; +PyAPI_DATA(PyTypeObject) PyDictValues_Type; + +#define PyDict_Check(op) \ + PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_DICT_SUBCLASS) +#define PyDict_CheckExact(op) (Py_TYPE(op) == &PyDict_Type) +#define PyDictKeys_Check(op) (Py_TYPE(op) == &PyDictKeys_Type) +#define PyDictItems_Check(op) (Py_TYPE(op) == &PyDictItems_Type) +#define PyDictValues_Check(op) (Py_TYPE(op) == &PyDictValues_Type) +/* This excludes Values, since they are not sets. */ +# define PyDictViewSet_Check(op) \ + (PyDictKeys_Check(op) || PyDictItems_Check(op)) + +PyAPI_FUNC(PyObject *) PyDict_New(void); +PyAPI_FUNC(PyObject *) PyDict_GetItem(PyObject *mp, PyObject *key); +PyAPI_FUNC(int) PyDict_SetItem(PyObject *mp, PyObject *key, PyObject *item); +PyAPI_FUNC(int) PyDict_DelItem(PyObject *mp, PyObject *key); +PyAPI_FUNC(void) PyDict_Clear(PyObject *mp); +PyAPI_FUNC(int) PyDict_Next( + PyObject *mp, Py_ssize_t *pos, PyObject **key, PyObject **value); +PyAPI_FUNC(int) _PyDict_Next( + PyObject *mp, Py_ssize_t *pos, PyObject **key, PyObject **value, long *hash); +PyAPI_FUNC(PyObject *) PyDict_Keys(PyObject *mp); +PyAPI_FUNC(PyObject *) PyDict_Values(PyObject *mp); +PyAPI_FUNC(PyObject *) PyDict_Items(PyObject *mp); +PyAPI_FUNC(Py_ssize_t) PyDict_Size(PyObject *mp); +PyAPI_FUNC(PyObject *) PyDict_Copy(PyObject *mp); +PyAPI_FUNC(int) PyDict_Contains(PyObject *mp, PyObject *key); +PyAPI_FUNC(int) _PyDict_Contains(PyObject *mp, PyObject *key, long hash); +PyAPI_FUNC(PyObject *) _PyDict_NewPresized(Py_ssize_t minused); +PyAPI_FUNC(void) _PyDict_MaybeUntrack(PyObject *mp); + +/* PyDict_Update(mp, other) is equivalent to PyDict_Merge(mp, other, 1). */ +PyAPI_FUNC(int) PyDict_Update(PyObject *mp, PyObject *other); + +/* PyDict_Merge updates/merges from a mapping object (an object that + supports PyMapping_Keys() and PyObject_GetItem()). If override is true, + the last occurrence of a key wins, else the first. The Python + dict.update(other) is equivalent to PyDict_Merge(dict, other, 1). +*/ +PyAPI_FUNC(int) PyDict_Merge(PyObject *mp, + PyObject *other, + int override); + +/* PyDict_MergeFromSeq2 updates/merges from an iterable object producing + iterable objects of length 2. If override is true, the last occurrence + of a key wins, else the first. The Python dict constructor dict(seq2) + is equivalent to dict={}; PyDict_MergeFromSeq(dict, seq2, 1). +*/ +PyAPI_FUNC(int) PyDict_MergeFromSeq2(PyObject *d, + PyObject *seq2, + int override); + +PyAPI_FUNC(PyObject *) PyDict_GetItemString(PyObject *dp, const char *key); +PyAPI_FUNC(int) PyDict_SetItemString(PyObject *dp, const char *key, PyObject *item); +PyAPI_FUNC(int) PyDict_DelItemString(PyObject *dp, const char *key); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_DICTOBJECT_H */ diff --git a/extern/include/Python-2.7/dtoa.h b/extern/include/Python-2.7/dtoa.h new file mode 100644 index 0000000..9b434b7 --- /dev/null +++ b/extern/include/Python-2.7/dtoa.h @@ -0,0 +1,15 @@ +#ifndef PY_NO_SHORT_FLOAT_REPR +#ifdef __cplusplus +extern "C" { +#endif + +PyAPI_FUNC(double) _Py_dg_strtod(const char *str, char **ptr); +PyAPI_FUNC(char *) _Py_dg_dtoa(double d, int mode, int ndigits, + int *decpt, int *sign, char **rve); +PyAPI_FUNC(void) _Py_dg_freedtoa(char *s); + + +#ifdef __cplusplus +} +#endif +#endif diff --git a/extern/include/Python-2.7/enumobject.h b/extern/include/Python-2.7/enumobject.h new file mode 100644 index 0000000..c14dbfc --- /dev/null +++ b/extern/include/Python-2.7/enumobject.h @@ -0,0 +1,17 @@ +#ifndef Py_ENUMOBJECT_H +#define Py_ENUMOBJECT_H + +/* Enumerate Object */ + +#ifdef __cplusplus +extern "C" { +#endif + +PyAPI_DATA(PyTypeObject) PyEnum_Type; +PyAPI_DATA(PyTypeObject) PyReversed_Type; + +#ifdef __cplusplus +} +#endif + +#endif /* !Py_ENUMOBJECT_H */ diff --git a/extern/include/Python-2.7/errcode.h b/extern/include/Python-2.7/errcode.h new file mode 100644 index 0000000..becec80 --- /dev/null +++ b/extern/include/Python-2.7/errcode.h @@ -0,0 +1,36 @@ +#ifndef Py_ERRCODE_H +#define Py_ERRCODE_H +#ifdef __cplusplus +extern "C" { +#endif + + +/* Error codes passed around between file input, tokenizer, parser and + interpreter. This is necessary so we can turn them into Python + exceptions at a higher level. Note that some errors have a + slightly different meaning when passed from the tokenizer to the + parser than when passed from the parser to the interpreter; e.g. + the parser only returns E_EOF when it hits EOF immediately, and it + never returns E_OK. */ + +#define E_OK 10 /* No error */ +#define E_EOF 11 /* End Of File */ +#define E_INTR 12 /* Interrupted */ +#define E_TOKEN 13 /* Bad token */ +#define E_SYNTAX 14 /* Syntax error */ +#define E_NOMEM 15 /* Ran out of memory */ +#define E_DONE 16 /* Parsing complete */ +#define E_ERROR 17 /* Execution error */ +#define E_TABSPACE 18 /* Inconsistent mixing of tabs and spaces */ +#define E_OVERFLOW 19 /* Node had too many children */ +#define E_TOODEEP 20 /* Too many indentation levels */ +#define E_DEDENT 21 /* No matching outer block for dedent */ +#define E_DECODE 22 /* Error in decoding into Unicode */ +#define E_EOFS 23 /* EOF in triple-quoted string */ +#define E_EOLS 24 /* EOL in single-quoted string */ +#define E_LINECONT 25 /* Unexpected characters after a line continuation */ + +#ifdef __cplusplus +} +#endif +#endif /* !Py_ERRCODE_H */ diff --git a/extern/include/Python-2.7/eval.h b/extern/include/Python-2.7/eval.h new file mode 100644 index 0000000..b78dfe0 --- /dev/null +++ b/extern/include/Python-2.7/eval.h @@ -0,0 +1,25 @@ + +/* Interface to execute compiled code */ + +#ifndef Py_EVAL_H +#define Py_EVAL_H +#ifdef __cplusplus +extern "C" { +#endif + +PyAPI_FUNC(PyObject *) PyEval_EvalCode(PyCodeObject *, PyObject *, PyObject *); + +PyAPI_FUNC(PyObject *) PyEval_EvalCodeEx(PyCodeObject *co, + PyObject *globals, + PyObject *locals, + PyObject **args, int argc, + PyObject **kwds, int kwdc, + PyObject **defs, int defc, + PyObject *closure); + +PyAPI_FUNC(PyObject *) _PyEval_CallTracing(PyObject *func, PyObject *args); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_EVAL_H */ diff --git a/extern/include/Python-2.7/fileobject.h b/extern/include/Python-2.7/fileobject.h new file mode 100644 index 0000000..1b540f9 --- /dev/null +++ b/extern/include/Python-2.7/fileobject.h @@ -0,0 +1,97 @@ + +/* File object interface */ + +#ifndef Py_FILEOBJECT_H +#define Py_FILEOBJECT_H +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct { + PyObject_HEAD + FILE *f_fp; + PyObject *f_name; + PyObject *f_mode; + int (*f_close)(FILE *); + int f_softspace; /* Flag used by 'print' command */ + int f_binary; /* Flag which indicates whether the file is + open in binary (1) or text (0) mode */ + char* f_buf; /* Allocated readahead buffer */ + char* f_bufend; /* Points after last occupied position */ + char* f_bufptr; /* Current buffer position */ + char *f_setbuf; /* Buffer for setbuf(3) and setvbuf(3) */ + int f_univ_newline; /* Handle any newline convention */ + int f_newlinetypes; /* Types of newlines seen */ + int f_skipnextlf; /* Skip next \n */ + PyObject *f_encoding; + PyObject *f_errors; + PyObject *weakreflist; /* List of weak references */ + int unlocked_count; /* Num. currently running sections of code + using f_fp with the GIL released. */ + int readable; + int writable; +} PyFileObject; + +PyAPI_DATA(PyTypeObject) PyFile_Type; + +#define PyFile_Check(op) PyObject_TypeCheck(op, &PyFile_Type) +#define PyFile_CheckExact(op) (Py_TYPE(op) == &PyFile_Type) + +PyAPI_FUNC(PyObject *) PyFile_FromString(char *, char *); +PyAPI_FUNC(void) PyFile_SetBufSize(PyObject *, int); +PyAPI_FUNC(int) PyFile_SetEncoding(PyObject *, const char *); +PyAPI_FUNC(int) PyFile_SetEncodingAndErrors(PyObject *, const char *, char *errors); +PyAPI_FUNC(PyObject *) PyFile_FromFile(FILE *, char *, char *, + int (*)(FILE *)); +PyAPI_FUNC(FILE *) PyFile_AsFile(PyObject *); +PyAPI_FUNC(void) PyFile_IncUseCount(PyFileObject *); +PyAPI_FUNC(void) PyFile_DecUseCount(PyFileObject *); +PyAPI_FUNC(PyObject *) PyFile_Name(PyObject *); +PyAPI_FUNC(PyObject *) PyFile_GetLine(PyObject *, int); +PyAPI_FUNC(int) PyFile_WriteObject(PyObject *, PyObject *, int); +PyAPI_FUNC(int) PyFile_SoftSpace(PyObject *, int); +PyAPI_FUNC(int) PyFile_WriteString(const char *, PyObject *); +PyAPI_FUNC(int) PyObject_AsFileDescriptor(PyObject *); + +/* The default encoding used by the platform file system APIs + If non-NULL, this is different than the default encoding for strings +*/ +PyAPI_DATA(const char *) Py_FileSystemDefaultEncoding; + +/* Routines to replace fread() and fgets() which accept any of \r, \n + or \r\n as line terminators. +*/ +#define PY_STDIOTEXTMODE "b" +char *Py_UniversalNewlineFgets(char *, int, FILE*, PyObject *); +size_t Py_UniversalNewlineFread(char *, size_t, FILE *, PyObject *); + +/* A routine to do sanity checking on the file mode string. returns + non-zero on if an exception occurred +*/ +int _PyFile_SanitizeMode(char *mode); + +#if defined _MSC_VER && _MSC_VER >= 1400 +/* A routine to check if a file descriptor is valid on Windows. Returns 0 + * and sets errno to EBADF if it isn't. This is to avoid Assertions + * from various functions in the Windows CRT beginning with + * Visual Studio 2005 + */ +int _PyVerify_fd(int fd); +#elif defined _MSC_VER && _MSC_VER >= 1200 +/* fdopen doesn't set errno EBADF and crashes for large fd on debug build */ +#define _PyVerify_fd(fd) (_get_osfhandle(fd) >= 0) +#else +#define _PyVerify_fd(A) (1) /* dummy */ +#endif + +/* A routine to check if a file descriptor can be select()-ed. */ +#ifdef HAVE_SELECT + #define _PyIsSelectable_fd(FD) (((FD) >= 0) && ((FD) < FD_SETSIZE)) +#else + #define _PyIsSelectable_fd(FD) (1) +#endif /* HAVE_SELECT */ + +#ifdef __cplusplus +} +#endif +#endif /* !Py_FILEOBJECT_H */ diff --git a/extern/include/Python-2.7/floatobject.h b/extern/include/Python-2.7/floatobject.h new file mode 100644 index 0000000..54e8825 --- /dev/null +++ b/extern/include/Python-2.7/floatobject.h @@ -0,0 +1,140 @@ + +/* Float object interface */ + +/* +PyFloatObject represents a (double precision) floating point number. +*/ + +#ifndef Py_FLOATOBJECT_H +#define Py_FLOATOBJECT_H +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct { + PyObject_HEAD + double ob_fval; +} PyFloatObject; + +PyAPI_DATA(PyTypeObject) PyFloat_Type; + +#define PyFloat_Check(op) PyObject_TypeCheck(op, &PyFloat_Type) +#define PyFloat_CheckExact(op) (Py_TYPE(op) == &PyFloat_Type) + +/* The str() precision PyFloat_STR_PRECISION is chosen so that in most cases, + the rounding noise created by various operations is suppressed, while + giving plenty of precision for practical use. */ + +#define PyFloat_STR_PRECISION 12 + +#ifdef Py_NAN +#define Py_RETURN_NAN return PyFloat_FromDouble(Py_NAN) +#endif + +#define Py_RETURN_INF(sign) do \ + if (copysign(1., sign) == 1.) { \ + return PyFloat_FromDouble(Py_HUGE_VAL); \ + } else { \ + return PyFloat_FromDouble(-Py_HUGE_VAL); \ + } while(0) + +PyAPI_FUNC(double) PyFloat_GetMax(void); +PyAPI_FUNC(double) PyFloat_GetMin(void); +PyAPI_FUNC(PyObject *) PyFloat_GetInfo(void); + +/* Return Python float from string PyObject. Second argument ignored on + input, and, if non-NULL, NULL is stored into *junk (this tried to serve a + purpose once but can't be made to work as intended). */ +PyAPI_FUNC(PyObject *) PyFloat_FromString(PyObject*, char** junk); + +/* Return Python float from C double. */ +PyAPI_FUNC(PyObject *) PyFloat_FromDouble(double); + +/* Extract C double from Python float. The macro version trades safety for + speed. */ +PyAPI_FUNC(double) PyFloat_AsDouble(PyObject *); +#define PyFloat_AS_DOUBLE(op) (((PyFloatObject *)(op))->ob_fval) + +/* Write repr(v) into the char buffer argument, followed by null byte. The + buffer must be "big enough"; >= 100 is very safe. + PyFloat_AsReprString(buf, x) strives to print enough digits so that + PyFloat_FromString(buf) then reproduces x exactly. */ +PyAPI_FUNC(void) PyFloat_AsReprString(char*, PyFloatObject *v); + +/* Write str(v) into the char buffer argument, followed by null byte. The + buffer must be "big enough"; >= 100 is very safe. Note that it's + unusual to be able to get back the float you started with from + PyFloat_AsString's result -- use PyFloat_AsReprString() if you want to + preserve precision across conversions. */ +PyAPI_FUNC(void) PyFloat_AsString(char*, PyFloatObject *v); + +/* _PyFloat_{Pack,Unpack}{4,8} + * + * The struct and pickle (at least) modules need an efficient platform- + * independent way to store floating-point values as byte strings. + * The Pack routines produce a string from a C double, and the Unpack + * routines produce a C double from such a string. The suffix (4 or 8) + * specifies the number of bytes in the string. + * + * On platforms that appear to use (see _PyFloat_Init()) IEEE-754 formats + * these functions work by copying bits. On other platforms, the formats the + * 4- byte format is identical to the IEEE-754 single precision format, and + * the 8-byte format to the IEEE-754 double precision format, although the + * packing of INFs and NaNs (if such things exist on the platform) isn't + * handled correctly, and attempting to unpack a string containing an IEEE + * INF or NaN will raise an exception. + * + * On non-IEEE platforms with more precision, or larger dynamic range, than + * 754 supports, not all values can be packed; on non-IEEE platforms with less + * precision, or smaller dynamic range, not all values can be unpacked. What + * happens in such cases is partly accidental (alas). + */ + +/* The pack routines write 4 or 8 bytes, starting at p. le is a bool + * argument, true if you want the string in little-endian format (exponent + * last, at p+3 or p+7), false if you want big-endian format (exponent + * first, at p). + * Return value: 0 if all is OK, -1 if error (and an exception is + * set, most likely OverflowError). + * There are two problems on non-IEEE platforms: + * 1): What this does is undefined if x is a NaN or infinity. + * 2): -0.0 and +0.0 produce the same string. + */ +PyAPI_FUNC(int) _PyFloat_Pack4(double x, unsigned char *p, int le); +PyAPI_FUNC(int) _PyFloat_Pack8(double x, unsigned char *p, int le); + +/* Used to get the important decimal digits of a double */ +PyAPI_FUNC(int) _PyFloat_Digits(char *buf, double v, int *signum); +PyAPI_FUNC(void) _PyFloat_DigitsInit(void); + +/* The unpack routines read 4 or 8 bytes, starting at p. le is a bool + * argument, true if the string is in little-endian format (exponent + * last, at p+3 or p+7), false if big-endian (exponent first, at p). + * Return value: The unpacked double. On error, this is -1.0 and + * PyErr_Occurred() is true (and an exception is set, most likely + * OverflowError). Note that on a non-IEEE platform this will refuse + * to unpack a string that represents a NaN or infinity. + */ +PyAPI_FUNC(double) _PyFloat_Unpack4(const unsigned char *p, int le); +PyAPI_FUNC(double) _PyFloat_Unpack8(const unsigned char *p, int le); + +/* free list api */ +PyAPI_FUNC(int) PyFloat_ClearFreeList(void); + +/* Format the object based on the format_spec, as defined in PEP 3101 + (Advanced String Formatting). */ +PyAPI_FUNC(PyObject *) _PyFloat_FormatAdvanced(PyObject *obj, + char *format_spec, + Py_ssize_t format_spec_len); + +/* Round a C double x to the closest multiple of 10**-ndigits. Returns a + Python float on success, or NULL (with an appropriate exception set) on + failure. Used in builtin_round in bltinmodule.c. */ +PyAPI_FUNC(PyObject *) _Py_double_round(double x, int ndigits); + + + +#ifdef __cplusplus +} +#endif +#endif /* !Py_FLOATOBJECT_H */ diff --git a/extern/include/Python-2.7/frameobject.h b/extern/include/Python-2.7/frameobject.h new file mode 100644 index 0000000..17e7679 --- /dev/null +++ b/extern/include/Python-2.7/frameobject.h @@ -0,0 +1,89 @@ + +/* Frame object interface */ + +#ifndef Py_FRAMEOBJECT_H +#define Py_FRAMEOBJECT_H +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct { + int b_type; /* what kind of block this is */ + int b_handler; /* where to jump to find handler */ + int b_level; /* value stack level to pop to */ +} PyTryBlock; + +typedef struct _frame { + PyObject_VAR_HEAD + struct _frame *f_back; /* previous frame, or NULL */ + PyCodeObject *f_code; /* code segment */ + PyObject *f_builtins; /* builtin symbol table (PyDictObject) */ + PyObject *f_globals; /* global symbol table (PyDictObject) */ + PyObject *f_locals; /* local symbol table (any mapping) */ + PyObject **f_valuestack; /* points after the last local */ + /* Next free slot in f_valuestack. Frame creation sets to f_valuestack. + Frame evaluation usually NULLs it, but a frame that yields sets it + to the current stack top. */ + PyObject **f_stacktop; + PyObject *f_trace; /* Trace function */ + + /* If an exception is raised in this frame, the next three are used to + * record the exception info (if any) originally in the thread state. See + * comments before set_exc_info() -- it's not obvious. + * Invariant: if _type is NULL, then so are _value and _traceback. + * Desired invariant: all three are NULL, or all three are non-NULL. That + * one isn't currently true, but "should be". + */ + PyObject *f_exc_type, *f_exc_value, *f_exc_traceback; + + PyThreadState *f_tstate; + int f_lasti; /* Last instruction if called */ + /* Call PyFrame_GetLineNumber() instead of reading this field + directly. As of 2.3 f_lineno is only valid when tracing is + active (i.e. when f_trace is set). At other times we use + PyCode_Addr2Line to calculate the line from the current + bytecode index. */ + int f_lineno; /* Current line number */ + int f_iblock; /* index in f_blockstack */ + PyTryBlock f_blockstack[CO_MAXBLOCKS]; /* for try and loop blocks */ + PyObject *f_localsplus[1]; /* locals+stack, dynamically sized */ +} PyFrameObject; + + +/* Standard object interface */ + +PyAPI_DATA(PyTypeObject) PyFrame_Type; + +#define PyFrame_Check(op) ((op)->ob_type == &PyFrame_Type) +#define PyFrame_IsRestricted(f) \ + ((f)->f_builtins != (f)->f_tstate->interp->builtins) + +PyAPI_FUNC(PyFrameObject *) PyFrame_New(PyThreadState *, PyCodeObject *, + PyObject *, PyObject *); + + +/* The rest of the interface is specific for frame objects */ + +/* Block management functions */ + +PyAPI_FUNC(void) PyFrame_BlockSetup(PyFrameObject *, int, int, int); +PyAPI_FUNC(PyTryBlock *) PyFrame_BlockPop(PyFrameObject *); + +/* Extend the value stack */ + +PyAPI_FUNC(PyObject **) PyFrame_ExtendStack(PyFrameObject *, int, int); + +/* Conversions between "fast locals" and locals in dictionary */ + +PyAPI_FUNC(void) PyFrame_LocalsToFast(PyFrameObject *, int); +PyAPI_FUNC(void) PyFrame_FastToLocals(PyFrameObject *); + +PyAPI_FUNC(int) PyFrame_ClearFreeList(void); + +/* Return the line of code the frame is currently executing. */ +PyAPI_FUNC(int) PyFrame_GetLineNumber(PyFrameObject *); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_FRAMEOBJECT_H */ diff --git a/extern/include/Python-2.7/funcobject.h b/extern/include/Python-2.7/funcobject.h new file mode 100644 index 0000000..eb19f4c --- /dev/null +++ b/extern/include/Python-2.7/funcobject.h @@ -0,0 +1,76 @@ + +/* Function object interface */ + +#ifndef Py_FUNCOBJECT_H +#define Py_FUNCOBJECT_H +#ifdef __cplusplus +extern "C" { +#endif + +/* Function objects and code objects should not be confused with each other: + * + * Function objects are created by the execution of the 'def' statement. + * They reference a code object in their func_code attribute, which is a + * purely syntactic object, i.e. nothing more than a compiled version of some + * source code lines. There is one code object per source code "fragment", + * but each code object can be referenced by zero or many function objects + * depending only on how many times the 'def' statement in the source was + * executed so far. + */ + +typedef struct { + PyObject_HEAD + PyObject *func_code; /* A code object */ + PyObject *func_globals; /* A dictionary (other mappings won't do) */ + PyObject *func_defaults; /* NULL or a tuple */ + PyObject *func_closure; /* NULL or a tuple of cell objects */ + PyObject *func_doc; /* The __doc__ attribute, can be anything */ + PyObject *func_name; /* The __name__ attribute, a string object */ + PyObject *func_dict; /* The __dict__ attribute, a dict or NULL */ + PyObject *func_weakreflist; /* List of weak references */ + PyObject *func_module; /* The __module__ attribute, can be anything */ + + /* Invariant: + * func_closure contains the bindings for func_code->co_freevars, so + * PyTuple_Size(func_closure) == PyCode_GetNumFree(func_code) + * (func_closure may be NULL if PyCode_GetNumFree(func_code) == 0). + */ +} PyFunctionObject; + +PyAPI_DATA(PyTypeObject) PyFunction_Type; + +#define PyFunction_Check(op) (Py_TYPE(op) == &PyFunction_Type) + +PyAPI_FUNC(PyObject *) PyFunction_New(PyObject *, PyObject *); +PyAPI_FUNC(PyObject *) PyFunction_GetCode(PyObject *); +PyAPI_FUNC(PyObject *) PyFunction_GetGlobals(PyObject *); +PyAPI_FUNC(PyObject *) PyFunction_GetModule(PyObject *); +PyAPI_FUNC(PyObject *) PyFunction_GetDefaults(PyObject *); +PyAPI_FUNC(int) PyFunction_SetDefaults(PyObject *, PyObject *); +PyAPI_FUNC(PyObject *) PyFunction_GetClosure(PyObject *); +PyAPI_FUNC(int) PyFunction_SetClosure(PyObject *, PyObject *); + +/* Macros for direct access to these values. Type checks are *not* + done, so use with care. */ +#define PyFunction_GET_CODE(func) \ + (((PyFunctionObject *)func) -> func_code) +#define PyFunction_GET_GLOBALS(func) \ + (((PyFunctionObject *)func) -> func_globals) +#define PyFunction_GET_MODULE(func) \ + (((PyFunctionObject *)func) -> func_module) +#define PyFunction_GET_DEFAULTS(func) \ + (((PyFunctionObject *)func) -> func_defaults) +#define PyFunction_GET_CLOSURE(func) \ + (((PyFunctionObject *)func) -> func_closure) + +/* The classmethod and staticmethod types lives here, too */ +PyAPI_DATA(PyTypeObject) PyClassMethod_Type; +PyAPI_DATA(PyTypeObject) PyStaticMethod_Type; + +PyAPI_FUNC(PyObject *) PyClassMethod_New(PyObject *); +PyAPI_FUNC(PyObject *) PyStaticMethod_New(PyObject *); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_FUNCOBJECT_H */ diff --git a/extern/include/Python-2.7/genobject.h b/extern/include/Python-2.7/genobject.h new file mode 100644 index 0000000..135561b --- /dev/null +++ b/extern/include/Python-2.7/genobject.h @@ -0,0 +1,40 @@ + +/* Generator object interface */ + +#ifndef Py_GENOBJECT_H +#define Py_GENOBJECT_H +#ifdef __cplusplus +extern "C" { +#endif + +struct _frame; /* Avoid including frameobject.h */ + +typedef struct { + PyObject_HEAD + /* The gi_ prefix is intended to remind of generator-iterator. */ + + /* Note: gi_frame can be NULL if the generator is "finished" */ + struct _frame *gi_frame; + + /* True if generator is being executed. */ + int gi_running; + + /* The code object backing the generator */ + PyObject *gi_code; + + /* List of weak reference. */ + PyObject *gi_weakreflist; +} PyGenObject; + +PyAPI_DATA(PyTypeObject) PyGen_Type; + +#define PyGen_Check(op) PyObject_TypeCheck(op, &PyGen_Type) +#define PyGen_CheckExact(op) (Py_TYPE(op) == &PyGen_Type) + +PyAPI_FUNC(PyObject *) PyGen_New(struct _frame *); +PyAPI_FUNC(int) PyGen_NeedsFinalizing(PyGenObject *); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_GENOBJECT_H */ diff --git a/extern/include/Python-2.7/graminit.h b/extern/include/Python-2.7/graminit.h new file mode 100644 index 0000000..40d531e --- /dev/null +++ b/extern/include/Python-2.7/graminit.h @@ -0,0 +1,87 @@ +/* Generated by Parser/pgen */ + +#define single_input 256 +#define file_input 257 +#define eval_input 258 +#define decorator 259 +#define decorators 260 +#define decorated 261 +#define funcdef 262 +#define parameters 263 +#define varargslist 264 +#define fpdef 265 +#define fplist 266 +#define stmt 267 +#define simple_stmt 268 +#define small_stmt 269 +#define expr_stmt 270 +#define augassign 271 +#define print_stmt 272 +#define del_stmt 273 +#define pass_stmt 274 +#define flow_stmt 275 +#define break_stmt 276 +#define continue_stmt 277 +#define return_stmt 278 +#define yield_stmt 279 +#define raise_stmt 280 +#define import_stmt 281 +#define import_name 282 +#define import_from 283 +#define import_as_name 284 +#define dotted_as_name 285 +#define import_as_names 286 +#define dotted_as_names 287 +#define dotted_name 288 +#define global_stmt 289 +#define exec_stmt 290 +#define assert_stmt 291 +#define compound_stmt 292 +#define if_stmt 293 +#define while_stmt 294 +#define for_stmt 295 +#define try_stmt 296 +#define with_stmt 297 +#define with_item 298 +#define except_clause 299 +#define suite 300 +#define testlist_safe 301 +#define old_test 302 +#define old_lambdef 303 +#define test 304 +#define or_test 305 +#define and_test 306 +#define not_test 307 +#define comparison 308 +#define comp_op 309 +#define expr 310 +#define xor_expr 311 +#define and_expr 312 +#define shift_expr 313 +#define arith_expr 314 +#define term 315 +#define factor 316 +#define power 317 +#define atom 318 +#define listmaker 319 +#define testlist_comp 320 +#define lambdef 321 +#define trailer 322 +#define subscriptlist 323 +#define subscript 324 +#define sliceop 325 +#define exprlist 326 +#define testlist 327 +#define dictorsetmaker 328 +#define classdef 329 +#define arglist 330 +#define argument 331 +#define list_iter 332 +#define list_for 333 +#define list_if 334 +#define comp_iter 335 +#define comp_for 336 +#define comp_if 337 +#define testlist1 338 +#define encoding_decl 339 +#define yield_expr 340 diff --git a/extern/include/Python-2.7/grammar.h b/extern/include/Python-2.7/grammar.h new file mode 100644 index 0000000..8426da3 --- /dev/null +++ b/extern/include/Python-2.7/grammar.h @@ -0,0 +1,93 @@ + +/* Grammar interface */ + +#ifndef Py_GRAMMAR_H +#define Py_GRAMMAR_H +#ifdef __cplusplus +extern "C" { +#endif + +#include "bitset.h" /* Sigh... */ + +/* A label of an arc */ + +typedef struct { + int lb_type; + char *lb_str; +} label; + +#define EMPTY 0 /* Label number 0 is by definition the empty label */ + +/* A list of labels */ + +typedef struct { + int ll_nlabels; + label *ll_label; +} labellist; + +/* An arc from one state to another */ + +typedef struct { + short a_lbl; /* Label of this arc */ + short a_arrow; /* State where this arc goes to */ +} arc; + +/* A state in a DFA */ + +typedef struct { + int s_narcs; + arc *s_arc; /* Array of arcs */ + + /* Optional accelerators */ + int s_lower; /* Lowest label index */ + int s_upper; /* Highest label index */ + int *s_accel; /* Accelerator */ + int s_accept; /* Nonzero for accepting state */ +} state; + +/* A DFA */ + +typedef struct { + int d_type; /* Non-terminal this represents */ + char *d_name; /* For printing */ + int d_initial; /* Initial state */ + int d_nstates; + state *d_state; /* Array of states */ + bitset d_first; +} dfa; + +/* A grammar */ + +typedef struct { + int g_ndfas; + dfa *g_dfa; /* Array of DFAs */ + labellist g_ll; + int g_start; /* Start symbol of the grammar */ + int g_accel; /* Set if accelerators present */ +} grammar; + +/* FUNCTIONS */ + +grammar *newgrammar(int start); +dfa *adddfa(grammar *g, int type, char *name); +int addstate(dfa *d); +void addarc(dfa *d, int from, int to, int lbl); +dfa *PyGrammar_FindDFA(grammar *g, int type); + +int addlabel(labellist *ll, int type, char *str); +int findlabel(labellist *ll, int type, char *str); +char *PyGrammar_LabelRepr(label *lb); +void translatelabels(grammar *g); + +void addfirstsets(grammar *g); + +void PyGrammar_AddAccelerators(grammar *g); +void PyGrammar_RemoveAccelerators(grammar *); + +void printgrammar(grammar *g, FILE *fp); +void printnonterminals(grammar *g, FILE *fp); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_GRAMMAR_H */ diff --git a/extern/include/Python-2.7/import.h b/extern/include/Python-2.7/import.h new file mode 100644 index 0000000..1b7fe0a --- /dev/null +++ b/extern/include/Python-2.7/import.h @@ -0,0 +1,71 @@ + +/* Module definition and import interface */ + +#ifndef Py_IMPORT_H +#define Py_IMPORT_H +#ifdef __cplusplus +extern "C" { +#endif + +PyAPI_FUNC(long) PyImport_GetMagicNumber(void); +PyAPI_FUNC(PyObject *) PyImport_ExecCodeModule(char *name, PyObject *co); +PyAPI_FUNC(PyObject *) PyImport_ExecCodeModuleEx( + char *name, PyObject *co, char *pathname); +PyAPI_FUNC(PyObject *) PyImport_GetModuleDict(void); +PyAPI_FUNC(PyObject *) PyImport_AddModule(const char *name); +PyAPI_FUNC(PyObject *) PyImport_ImportModule(const char *name); +PyAPI_FUNC(PyObject *) PyImport_ImportModuleNoBlock(const char *); +PyAPI_FUNC(PyObject *) PyImport_ImportModuleLevel(char *name, + PyObject *globals, PyObject *locals, PyObject *fromlist, int level); + +#define PyImport_ImportModuleEx(n, g, l, f) \ + PyImport_ImportModuleLevel(n, g, l, f, -1) + +PyAPI_FUNC(PyObject *) PyImport_GetImporter(PyObject *path); +PyAPI_FUNC(PyObject *) PyImport_Import(PyObject *name); +PyAPI_FUNC(PyObject *) PyImport_ReloadModule(PyObject *m); +PyAPI_FUNC(void) PyImport_Cleanup(void); +PyAPI_FUNC(int) PyImport_ImportFrozenModule(char *); + +#ifdef WITH_THREAD +PyAPI_FUNC(void) _PyImport_AcquireLock(void); +PyAPI_FUNC(int) _PyImport_ReleaseLock(void); +#else +#define _PyImport_AcquireLock() +#define _PyImport_ReleaseLock() 1 +#endif + +PyAPI_FUNC(struct filedescr *) _PyImport_FindModule( + const char *, PyObject *, char *, size_t, FILE **, PyObject **); +PyAPI_FUNC(int) _PyImport_IsScript(struct filedescr *); +PyAPI_FUNC(void) _PyImport_ReInitLock(void); + +PyAPI_FUNC(PyObject *)_PyImport_FindExtension(char *, char *); +PyAPI_FUNC(PyObject *)_PyImport_FixupExtension(char *, char *); + +struct _inittab { + char *name; + void (*initfunc)(void); +}; + +PyAPI_DATA(PyTypeObject) PyNullImporter_Type; +PyAPI_DATA(struct _inittab *) PyImport_Inittab; + +PyAPI_FUNC(int) PyImport_AppendInittab(const char *name, void (*initfunc)(void)); +PyAPI_FUNC(int) PyImport_ExtendInittab(struct _inittab *newtab); + +struct _frozen { + char *name; + unsigned char *code; + int size; +}; + +/* Embedding apps may change this pointer to point to their favorite + collection of frozen modules: */ + +PyAPI_DATA(struct _frozen *) PyImport_FrozenModules; + +#ifdef __cplusplus +} +#endif +#endif /* !Py_IMPORT_H */ diff --git a/extern/include/Python-2.7/intobject.h b/extern/include/Python-2.7/intobject.h new file mode 100644 index 0000000..252eea9 --- /dev/null +++ b/extern/include/Python-2.7/intobject.h @@ -0,0 +1,81 @@ + +/* Integer object interface */ + +/* +PyIntObject represents a (long) integer. This is an immutable object; +an integer cannot change its value after creation. + +There are functions to create new integer objects, to test an object +for integer-ness, and to get the integer value. The latter functions +returns -1 and sets errno to EBADF if the object is not an PyIntObject. +None of the functions should be applied to nil objects. + +The type PyIntObject is (unfortunately) exposed here so we can declare +_Py_TrueStruct and _Py_ZeroStruct in boolobject.h; don't use this. +*/ + +#ifndef Py_INTOBJECT_H +#define Py_INTOBJECT_H +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct { + PyObject_HEAD + long ob_ival; +} PyIntObject; + +PyAPI_DATA(PyTypeObject) PyInt_Type; + +#define PyInt_Check(op) \ + PyType_FastSubclass((op)->ob_type, Py_TPFLAGS_INT_SUBCLASS) +#define PyInt_CheckExact(op) ((op)->ob_type == &PyInt_Type) + +PyAPI_FUNC(PyObject *) PyInt_FromString(char*, char**, int); +#ifdef Py_USING_UNICODE +PyAPI_FUNC(PyObject *) PyInt_FromUnicode(Py_UNICODE*, Py_ssize_t, int); +#endif +PyAPI_FUNC(PyObject *) PyInt_FromLong(long); +PyAPI_FUNC(PyObject *) PyInt_FromSize_t(size_t); +PyAPI_FUNC(PyObject *) PyInt_FromSsize_t(Py_ssize_t); +PyAPI_FUNC(long) PyInt_AsLong(PyObject *); +PyAPI_FUNC(Py_ssize_t) PyInt_AsSsize_t(PyObject *); +PyAPI_FUNC(int) _PyInt_AsInt(PyObject *); +PyAPI_FUNC(unsigned long) PyInt_AsUnsignedLongMask(PyObject *); +#ifdef HAVE_LONG_LONG +PyAPI_FUNC(unsigned PY_LONG_LONG) PyInt_AsUnsignedLongLongMask(PyObject *); +#endif + +PyAPI_FUNC(long) PyInt_GetMax(void); + +/* Macro, trading safety for speed */ +#define PyInt_AS_LONG(op) (((PyIntObject *)(op))->ob_ival) + +/* These aren't really part of the Int object, but they're handy; the protos + * are necessary for systems that need the magic of PyAPI_FUNC and that want + * to have stropmodule as a dynamically loaded module instead of building it + * into the main Python shared library/DLL. Guido thinks I'm weird for + * building it this way. :-) [cjh] + */ +PyAPI_FUNC(unsigned long) PyOS_strtoul(char *, char **, int); +PyAPI_FUNC(long) PyOS_strtol(char *, char **, int); + +/* free list api */ +PyAPI_FUNC(int) PyInt_ClearFreeList(void); + +/* Convert an integer to the given base. Returns a string. + If base is 2, 8 or 16, add the proper prefix '0b', '0o' or '0x'. + If newstyle is zero, then use the pre-2.6 behavior of octal having + a leading "0" */ +PyAPI_FUNC(PyObject*) _PyInt_Format(PyIntObject* v, int base, int newstyle); + +/* Format the object based on the format_spec, as defined in PEP 3101 + (Advanced String Formatting). */ +PyAPI_FUNC(PyObject *) _PyInt_FormatAdvanced(PyObject *obj, + char *format_spec, + Py_ssize_t format_spec_len); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTOBJECT_H */ diff --git a/extern/include/Python-2.7/intrcheck.h b/extern/include/Python-2.7/intrcheck.h new file mode 100644 index 0000000..3b67ed0 --- /dev/null +++ b/extern/include/Python-2.7/intrcheck.h @@ -0,0 +1,15 @@ + +#ifndef Py_INTRCHECK_H +#define Py_INTRCHECK_H +#ifdef __cplusplus +extern "C" { +#endif + +PyAPI_FUNC(int) PyOS_InterruptOccurred(void); +PyAPI_FUNC(void) PyOS_InitInterrupts(void); +PyAPI_FUNC(void) PyOS_AfterFork(void); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTRCHECK_H */ diff --git a/extern/include/Python-2.7/iterobject.h b/extern/include/Python-2.7/iterobject.h new file mode 100644 index 0000000..4bd19c2 --- /dev/null +++ b/extern/include/Python-2.7/iterobject.h @@ -0,0 +1,23 @@ +#ifndef Py_ITEROBJECT_H +#define Py_ITEROBJECT_H +/* Iterators (the basic kind, over a sequence) */ +#ifdef __cplusplus +extern "C" { +#endif + +PyAPI_DATA(PyTypeObject) PySeqIter_Type; + +#define PySeqIter_Check(op) (Py_TYPE(op) == &PySeqIter_Type) + +PyAPI_FUNC(PyObject *) PySeqIter_New(PyObject *); + +PyAPI_DATA(PyTypeObject) PyCallIter_Type; + +#define PyCallIter_Check(op) (Py_TYPE(op) == &PyCallIter_Type) + +PyAPI_FUNC(PyObject *) PyCallIter_New(PyObject *, PyObject *); +#ifdef __cplusplus +} +#endif +#endif /* !Py_ITEROBJECT_H */ + diff --git a/extern/include/Python-2.7/listobject.h b/extern/include/Python-2.7/listobject.h new file mode 100644 index 0000000..c445873 --- /dev/null +++ b/extern/include/Python-2.7/listobject.h @@ -0,0 +1,68 @@ + +/* List object interface */ + +/* +Another generally useful object type is an list of object pointers. +This is a mutable type: the list items can be changed, and items can be +added or removed. Out-of-range indices or non-list objects are ignored. + +*** WARNING *** PyList_SetItem does not increment the new item's reference +count, but does decrement the reference count of the item it replaces, +if not nil. It does *decrement* the reference count if it is *not* +inserted in the list. Similarly, PyList_GetItem does not increment the +returned item's reference count. +*/ + +#ifndef Py_LISTOBJECT_H +#define Py_LISTOBJECT_H +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct { + PyObject_VAR_HEAD + /* Vector of pointers to list elements. list[0] is ob_item[0], etc. */ + PyObject **ob_item; + + /* ob_item contains space for 'allocated' elements. The number + * currently in use is ob_size. + * Invariants: + * 0 <= ob_size <= allocated + * len(list) == ob_size + * ob_item == NULL implies ob_size == allocated == 0 + * list.sort() temporarily sets allocated to -1 to detect mutations. + * + * Items must normally not be NULL, except during construction when + * the list is not yet visible outside the function that builds it. + */ + Py_ssize_t allocated; +} PyListObject; + +PyAPI_DATA(PyTypeObject) PyList_Type; + +#define PyList_Check(op) \ + PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_LIST_SUBCLASS) +#define PyList_CheckExact(op) (Py_TYPE(op) == &PyList_Type) + +PyAPI_FUNC(PyObject *) PyList_New(Py_ssize_t size); +PyAPI_FUNC(Py_ssize_t) PyList_Size(PyObject *); +PyAPI_FUNC(PyObject *) PyList_GetItem(PyObject *, Py_ssize_t); +PyAPI_FUNC(int) PyList_SetItem(PyObject *, Py_ssize_t, PyObject *); +PyAPI_FUNC(int) PyList_Insert(PyObject *, Py_ssize_t, PyObject *); +PyAPI_FUNC(int) PyList_Append(PyObject *, PyObject *); +PyAPI_FUNC(PyObject *) PyList_GetSlice(PyObject *, Py_ssize_t, Py_ssize_t); +PyAPI_FUNC(int) PyList_SetSlice(PyObject *, Py_ssize_t, Py_ssize_t, PyObject *); +PyAPI_FUNC(int) PyList_Sort(PyObject *); +PyAPI_FUNC(int) PyList_Reverse(PyObject *); +PyAPI_FUNC(PyObject *) PyList_AsTuple(PyObject *); +PyAPI_FUNC(PyObject *) _PyList_Extend(PyListObject *, PyObject *); + +/* Macro, trading safety for speed */ +#define PyList_GET_ITEM(op, i) (((PyListObject *)(op))->ob_item[i]) +#define PyList_SET_ITEM(op, i, v) (((PyListObject *)(op))->ob_item[i] = (v)) +#define PyList_GET_SIZE(op) Py_SIZE(op) + +#ifdef __cplusplus +} +#endif +#endif /* !Py_LISTOBJECT_H */ diff --git a/extern/include/Python-2.7/longintrepr.h b/extern/include/Python-2.7/longintrepr.h new file mode 100644 index 0000000..6425c30 --- /dev/null +++ b/extern/include/Python-2.7/longintrepr.h @@ -0,0 +1,103 @@ +#ifndef Py_LONGINTREPR_H +#define Py_LONGINTREPR_H +#ifdef __cplusplus +extern "C" { +#endif + + +/* This is published for the benefit of "friend" marshal.c only. */ + +/* Parameters of the long integer representation. There are two different + sets of parameters: one set for 30-bit digits, stored in an unsigned 32-bit + integer type, and one set for 15-bit digits with each digit stored in an + unsigned short. The value of PYLONG_BITS_IN_DIGIT, defined either at + configure time or in pyport.h, is used to decide which digit size to use. + + Type 'digit' should be able to hold 2*PyLong_BASE-1, and type 'twodigits' + should be an unsigned integer type able to hold all integers up to + PyLong_BASE*PyLong_BASE-1. x_sub assumes that 'digit' is an unsigned type, + and that overflow is handled by taking the result modulo 2**N for some N > + PyLong_SHIFT. The majority of the code doesn't care about the precise + value of PyLong_SHIFT, but there are some notable exceptions: + + - long_pow() requires that PyLong_SHIFT be divisible by 5 + + - PyLong_{As,From}ByteArray require that PyLong_SHIFT be at least 8 + + - long_hash() requires that PyLong_SHIFT is *strictly* less than the number + of bits in an unsigned long, as do the PyLong <-> long (or unsigned long) + conversion functions + + - the long <-> size_t/Py_ssize_t conversion functions expect that + PyLong_SHIFT is strictly less than the number of bits in a size_t + + - the marshal code currently expects that PyLong_SHIFT is a multiple of 15 + + The values 15 and 30 should fit all of the above requirements, on any + platform. +*/ + +#if PYLONG_BITS_IN_DIGIT == 30 +#if !(defined HAVE_UINT64_T && defined HAVE_UINT32_T && \ + defined HAVE_INT64_T && defined HAVE_INT32_T) +#error "30-bit long digits requested, but the necessary types are not available on this platform" +#endif +typedef PY_UINT32_T digit; +typedef PY_INT32_T sdigit; /* signed variant of digit */ +typedef PY_UINT64_T twodigits; +typedef PY_INT64_T stwodigits; /* signed variant of twodigits */ +#define PyLong_SHIFT 30 +#define _PyLong_DECIMAL_SHIFT 9 /* max(e such that 10**e fits in a digit) */ +#define _PyLong_DECIMAL_BASE ((digit)1000000000) /* 10 ** DECIMAL_SHIFT */ +#elif PYLONG_BITS_IN_DIGIT == 15 +typedef unsigned short digit; +typedef short sdigit; /* signed variant of digit */ +typedef unsigned long twodigits; +typedef long stwodigits; /* signed variant of twodigits */ +#define PyLong_SHIFT 15 +#define _PyLong_DECIMAL_SHIFT 4 /* max(e such that 10**e fits in a digit) */ +#define _PyLong_DECIMAL_BASE ((digit)10000) /* 10 ** DECIMAL_SHIFT */ +#else +#error "PYLONG_BITS_IN_DIGIT should be 15 or 30" +#endif +#define PyLong_BASE ((digit)1 << PyLong_SHIFT) +#define PyLong_MASK ((digit)(PyLong_BASE - 1)) + +/* b/w compatibility with Python 2.5 */ +#define SHIFT PyLong_SHIFT +#define BASE PyLong_BASE +#define MASK PyLong_MASK + +#if PyLong_SHIFT % 5 != 0 +#error "longobject.c requires that PyLong_SHIFT be divisible by 5" +#endif + +/* Long integer representation. + The absolute value of a number is equal to + SUM(for i=0 through abs(ob_size)-1) ob_digit[i] * 2**(SHIFT*i) + Negative numbers are represented with ob_size < 0; + zero is represented by ob_size == 0. + In a normalized number, ob_digit[abs(ob_size)-1] (the most significant + digit) is never zero. Also, in all cases, for all valid i, + 0 <= ob_digit[i] <= MASK. + The allocation function takes care of allocating extra memory + so that ob_digit[0] ... ob_digit[abs(ob_size)-1] are actually available. + + CAUTION: Generic code manipulating subtypes of PyVarObject has to + aware that longs abuse ob_size's sign bit. +*/ + +struct _longobject { + PyObject_VAR_HEAD + digit ob_digit[1]; +}; + +PyAPI_FUNC(PyLongObject *) _PyLong_New(Py_ssize_t); + +/* Return a copy of src. */ +PyAPI_FUNC(PyObject *) _PyLong_Copy(PyLongObject *src); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_LONGINTREPR_H */ diff --git a/extern/include/Python-2.7/longobject.h b/extern/include/Python-2.7/longobject.h new file mode 100644 index 0000000..8be2345 --- /dev/null +++ b/extern/include/Python-2.7/longobject.h @@ -0,0 +1,135 @@ +#ifndef Py_LONGOBJECT_H +#define Py_LONGOBJECT_H +#ifdef __cplusplus +extern "C" { +#endif + + +/* Long (arbitrary precision) integer object interface */ + +typedef struct _longobject PyLongObject; /* Revealed in longintrepr.h */ + +PyAPI_DATA(PyTypeObject) PyLong_Type; + +#define PyLong_Check(op) \ + PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_LONG_SUBCLASS) +#define PyLong_CheckExact(op) (Py_TYPE(op) == &PyLong_Type) + +PyAPI_FUNC(PyObject *) PyLong_FromLong(long); +PyAPI_FUNC(PyObject *) PyLong_FromUnsignedLong(unsigned long); +PyAPI_FUNC(PyObject *) PyLong_FromDouble(double); +PyAPI_FUNC(PyObject *) PyLong_FromSize_t(size_t); +PyAPI_FUNC(PyObject *) PyLong_FromSsize_t(Py_ssize_t); +PyAPI_FUNC(long) PyLong_AsLong(PyObject *); +PyAPI_FUNC(long) PyLong_AsLongAndOverflow(PyObject *, int *); +PyAPI_FUNC(unsigned long) PyLong_AsUnsignedLong(PyObject *); +PyAPI_FUNC(unsigned long) PyLong_AsUnsignedLongMask(PyObject *); +PyAPI_FUNC(Py_ssize_t) PyLong_AsSsize_t(PyObject *); +PyAPI_FUNC(int) _PyLong_AsInt(PyObject *); +PyAPI_FUNC(PyObject *) PyLong_GetInfo(void); + +/* For use by intobject.c only */ +#define _PyLong_AsSsize_t PyLong_AsSsize_t +#define _PyLong_FromSize_t PyLong_FromSize_t +#define _PyLong_FromSsize_t PyLong_FromSsize_t +PyAPI_DATA(int) _PyLong_DigitValue[256]; + +/* _PyLong_Frexp returns a double x and an exponent e such that the + true value is approximately equal to x * 2**e. e is >= 0. x is + 0.0 if and only if the input is 0 (in which case, e and x are both + zeroes); otherwise, 0.5 <= abs(x) < 1.0. On overflow, which is + possible if the number of bits doesn't fit into a Py_ssize_t, sets + OverflowError and returns -1.0 for x, 0 for e. */ +PyAPI_FUNC(double) _PyLong_Frexp(PyLongObject *a, Py_ssize_t *e); + +PyAPI_FUNC(double) PyLong_AsDouble(PyObject *); +PyAPI_FUNC(PyObject *) PyLong_FromVoidPtr(void *); +PyAPI_FUNC(void *) PyLong_AsVoidPtr(PyObject *); + +#ifdef HAVE_LONG_LONG +PyAPI_FUNC(PyObject *) PyLong_FromLongLong(PY_LONG_LONG); +PyAPI_FUNC(PyObject *) PyLong_FromUnsignedLongLong(unsigned PY_LONG_LONG); +PyAPI_FUNC(PY_LONG_LONG) PyLong_AsLongLong(PyObject *); +PyAPI_FUNC(unsigned PY_LONG_LONG) PyLong_AsUnsignedLongLong(PyObject *); +PyAPI_FUNC(unsigned PY_LONG_LONG) PyLong_AsUnsignedLongLongMask(PyObject *); +PyAPI_FUNC(PY_LONG_LONG) PyLong_AsLongLongAndOverflow(PyObject *, int *); +#endif /* HAVE_LONG_LONG */ + +PyAPI_FUNC(PyObject *) PyLong_FromString(char *, char **, int); +#ifdef Py_USING_UNICODE +PyAPI_FUNC(PyObject *) PyLong_FromUnicode(Py_UNICODE*, Py_ssize_t, int); +#endif + +/* _PyLong_Sign. Return 0 if v is 0, -1 if v < 0, +1 if v > 0. + v must not be NULL, and must be a normalized long. + There are no error cases. +*/ +PyAPI_FUNC(int) _PyLong_Sign(PyObject *v); + + +/* _PyLong_NumBits. Return the number of bits needed to represent the + absolute value of a long. For example, this returns 1 for 1 and -1, 2 + for 2 and -2, and 2 for 3 and -3. It returns 0 for 0. + v must not be NULL, and must be a normalized long. + (size_t)-1 is returned and OverflowError set if the true result doesn't + fit in a size_t. +*/ +PyAPI_FUNC(size_t) _PyLong_NumBits(PyObject *v); + +/* _PyLong_FromByteArray: View the n unsigned bytes as a binary integer in + base 256, and return a Python long with the same numeric value. + If n is 0, the integer is 0. Else: + If little_endian is 1/true, bytes[n-1] is the MSB and bytes[0] the LSB; + else (little_endian is 0/false) bytes[0] is the MSB and bytes[n-1] the + LSB. + If is_signed is 0/false, view the bytes as a non-negative integer. + If is_signed is 1/true, view the bytes as a 2's-complement integer, + non-negative if bit 0x80 of the MSB is clear, negative if set. + Error returns: + + Return NULL with the appropriate exception set if there's not + enough memory to create the Python long. +*/ +PyAPI_FUNC(PyObject *) _PyLong_FromByteArray( + const unsigned char* bytes, size_t n, + int little_endian, int is_signed); + +/* _PyLong_AsByteArray: Convert the least-significant 8*n bits of long + v to a base-256 integer, stored in array bytes. Normally return 0, + return -1 on error. + If little_endian is 1/true, store the MSB at bytes[n-1] and the LSB at + bytes[0]; else (little_endian is 0/false) store the MSB at bytes[0] and + the LSB at bytes[n-1]. + If is_signed is 0/false, it's an error if v < 0; else (v >= 0) n bytes + are filled and there's nothing special about bit 0x80 of the MSB. + If is_signed is 1/true, bytes is filled with the 2's-complement + representation of v's value. Bit 0x80 of the MSB is the sign bit. + Error returns (-1): + + is_signed is 0 and v < 0. TypeError is set in this case, and bytes + isn't altered. + + n isn't big enough to hold the full mathematical value of v. For + example, if is_signed is 0 and there are more digits in the v than + fit in n; or if is_signed is 1, v < 0, and n is just 1 bit shy of + being large enough to hold a sign bit. OverflowError is set in this + case, but bytes holds the least-signficant n bytes of the true value. +*/ +PyAPI_FUNC(int) _PyLong_AsByteArray(PyLongObject* v, + unsigned char* bytes, size_t n, + int little_endian, int is_signed); + +/* _PyLong_Format: Convert the long to a string object with given base, + appending a base prefix of 0[box] if base is 2, 8 or 16. + Add a trailing "L" if addL is non-zero. + If newstyle is zero, then use the pre-2.6 behavior of octal having + a leading "0", instead of the prefix "0o" */ +PyAPI_FUNC(PyObject *) _PyLong_Format(PyObject *aa, int base, int addL, int newstyle); + +/* Format the object based on the format_spec, as defined in PEP 3101 + (Advanced String Formatting). */ +PyAPI_FUNC(PyObject *) _PyLong_FormatAdvanced(PyObject *obj, + char *format_spec, + Py_ssize_t format_spec_len); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_LONGOBJECT_H */ diff --git a/extern/include/Python-2.7/marshal.h b/extern/include/Python-2.7/marshal.h new file mode 100644 index 0000000..411fdca --- /dev/null +++ b/extern/include/Python-2.7/marshal.h @@ -0,0 +1,25 @@ + +/* Interface for marshal.c */ + +#ifndef Py_MARSHAL_H +#define Py_MARSHAL_H +#ifdef __cplusplus +extern "C" { +#endif + +#define Py_MARSHAL_VERSION 2 + +PyAPI_FUNC(void) PyMarshal_WriteLongToFile(long, FILE *, int); +PyAPI_FUNC(void) PyMarshal_WriteObjectToFile(PyObject *, FILE *, int); +PyAPI_FUNC(PyObject *) PyMarshal_WriteObjectToString(PyObject *, int); + +PyAPI_FUNC(long) PyMarshal_ReadLongFromFile(FILE *); +PyAPI_FUNC(int) PyMarshal_ReadShortFromFile(FILE *); +PyAPI_FUNC(PyObject *) PyMarshal_ReadObjectFromFile(FILE *); +PyAPI_FUNC(PyObject *) PyMarshal_ReadLastObjectFromFile(FILE *); +PyAPI_FUNC(PyObject *) PyMarshal_ReadObjectFromString(char *, Py_ssize_t); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_MARSHAL_H */ diff --git a/extern/include/Python-2.7/memoryobject.h b/extern/include/Python-2.7/memoryobject.h new file mode 100644 index 0000000..bf0b621 --- /dev/null +++ b/extern/include/Python-2.7/memoryobject.h @@ -0,0 +1,74 @@ +/* Memory view object. In Python this is available as "memoryview". */ + +#ifndef Py_MEMORYOBJECT_H +#define Py_MEMORYOBJECT_H +#ifdef __cplusplus +extern "C" { +#endif + +PyAPI_DATA(PyTypeObject) PyMemoryView_Type; + +#define PyMemoryView_Check(op) (Py_TYPE(op) == &PyMemoryView_Type) + +/* Get a pointer to the underlying Py_buffer of a memoryview object. */ +#define PyMemoryView_GET_BUFFER(op) (&((PyMemoryViewObject *)(op))->view) +/* Get a pointer to the PyObject from which originates a memoryview object. */ +#define PyMemoryView_GET_BASE(op) (((PyMemoryViewObject *)(op))->view.obj) + + +PyAPI_FUNC(PyObject *) PyMemoryView_GetContiguous(PyObject *base, + int buffertype, + char fort); + + /* Return a contiguous chunk of memory representing the buffer + from an object in a memory view object. If a copy is made then the + base object for the memory view will be a *new* bytes object. + + Otherwise, the base-object will be the object itself and no + data-copying will be done. + + The buffertype argument can be PyBUF_READ, PyBUF_WRITE, + PyBUF_SHADOW to determine whether the returned buffer + should be READONLY, WRITABLE, or set to update the + original buffer if a copy must be made. If buffertype is + PyBUF_WRITE and the buffer is not contiguous an error will + be raised. In this circumstance, the user can use + PyBUF_SHADOW to ensure that a a writable temporary + contiguous buffer is returned. The contents of this + contiguous buffer will be copied back into the original + object after the memoryview object is deleted as long as + the original object is writable and allows setting an + exclusive write lock. If this is not allowed by the + original object, then a BufferError is raised. + + If the object is multi-dimensional and if fortran is 'F', + the first dimension of the underlying array will vary the + fastest in the buffer. If fortran is 'C', then the last + dimension will vary the fastest (C-style contiguous). If + fortran is 'A', then it does not matter and you will get + whatever the object decides is more efficient. + + A new reference is returned that must be DECREF'd when finished. + */ + +PyAPI_FUNC(PyObject *) PyMemoryView_FromObject(PyObject *base); + +PyAPI_FUNC(PyObject *) PyMemoryView_FromBuffer(Py_buffer *info); + /* create new if bufptr is NULL + will be a new bytesobject in base */ + + +/* The struct is declared here so that macros can work, but it shouldn't + be considered public. Don't access those fields directly, use the macros + and functions instead! */ +typedef struct { + PyObject_HEAD + PyObject *base; + Py_buffer view; +} PyMemoryViewObject; + + +#ifdef __cplusplus +} +#endif +#endif /* !Py_MEMORYOBJECT_H */ diff --git a/extern/include/Python-2.7/metagrammar.h b/extern/include/Python-2.7/metagrammar.h new file mode 100644 index 0000000..15c8ef8 --- /dev/null +++ b/extern/include/Python-2.7/metagrammar.h @@ -0,0 +1,18 @@ +#ifndef Py_METAGRAMMAR_H +#define Py_METAGRAMMAR_H +#ifdef __cplusplus +extern "C" { +#endif + + +#define MSTART 256 +#define RULE 257 +#define RHS 258 +#define ALT 259 +#define ITEM 260 +#define ATOM 261 + +#ifdef __cplusplus +} +#endif +#endif /* !Py_METAGRAMMAR_H */ diff --git a/extern/include/Python-2.7/methodobject.h b/extern/include/Python-2.7/methodobject.h new file mode 100644 index 0000000..6e160b6 --- /dev/null +++ b/extern/include/Python-2.7/methodobject.h @@ -0,0 +1,93 @@ + +/* Method object interface */ + +#ifndef Py_METHODOBJECT_H +#define Py_METHODOBJECT_H +#ifdef __cplusplus +extern "C" { +#endif + +/* This is about the type 'builtin_function_or_method', + not Python methods in user-defined classes. See classobject.h + for the latter. */ + +PyAPI_DATA(PyTypeObject) PyCFunction_Type; + +#define PyCFunction_Check(op) (Py_TYPE(op) == &PyCFunction_Type) + +typedef PyObject *(*PyCFunction)(PyObject *, PyObject *); +typedef PyObject *(*PyCFunctionWithKeywords)(PyObject *, PyObject *, + PyObject *); +typedef PyObject *(*PyNoArgsFunction)(PyObject *); + +PyAPI_FUNC(PyCFunction) PyCFunction_GetFunction(PyObject *); +PyAPI_FUNC(PyObject *) PyCFunction_GetSelf(PyObject *); +PyAPI_FUNC(int) PyCFunction_GetFlags(PyObject *); + +/* Macros for direct access to these values. Type checks are *not* + done, so use with care. */ +#define PyCFunction_GET_FUNCTION(func) \ + (((PyCFunctionObject *)func) -> m_ml -> ml_meth) +#define PyCFunction_GET_SELF(func) \ + (((PyCFunctionObject *)func) -> m_self) +#define PyCFunction_GET_FLAGS(func) \ + (((PyCFunctionObject *)func) -> m_ml -> ml_flags) +PyAPI_FUNC(PyObject *) PyCFunction_Call(PyObject *, PyObject *, PyObject *); + +struct PyMethodDef { + const char *ml_name; /* The name of the built-in function/method */ + PyCFunction ml_meth; /* The C function that implements it */ + int ml_flags; /* Combination of METH_xxx flags, which mostly + describe the args expected by the C func */ + const char *ml_doc; /* The __doc__ attribute, or NULL */ +}; +typedef struct PyMethodDef PyMethodDef; + +PyAPI_FUNC(PyObject *) Py_FindMethod(PyMethodDef[], PyObject *, const char *); + +#define PyCFunction_New(ML, SELF) PyCFunction_NewEx((ML), (SELF), NULL) +PyAPI_FUNC(PyObject *) PyCFunction_NewEx(PyMethodDef *, PyObject *, + PyObject *); + +/* Flag passed to newmethodobject */ +#define METH_OLDARGS 0x0000 +#define METH_VARARGS 0x0001 +#define METH_KEYWORDS 0x0002 +/* METH_NOARGS and METH_O must not be combined with the flags above. */ +#define METH_NOARGS 0x0004 +#define METH_O 0x0008 + +/* METH_CLASS and METH_STATIC are a little different; these control + the construction of methods for a class. These cannot be used for + functions in modules. */ +#define METH_CLASS 0x0010 +#define METH_STATIC 0x0020 + +/* METH_COEXIST allows a method to be entered eventhough a slot has + already filled the entry. When defined, the flag allows a separate + method, "__contains__" for example, to coexist with a defined + slot like sq_contains. */ + +#define METH_COEXIST 0x0040 + +typedef struct PyMethodChain { + PyMethodDef *methods; /* Methods of this type */ + struct PyMethodChain *link; /* NULL or base type */ +} PyMethodChain; + +PyAPI_FUNC(PyObject *) Py_FindMethodInChain(PyMethodChain *, PyObject *, + const char *); + +typedef struct { + PyObject_HEAD + PyMethodDef *m_ml; /* Description of the C function to call */ + PyObject *m_self; /* Passed as 'self' arg to the C func, can be NULL */ + PyObject *m_module; /* The __module__ attribute, can be anything */ +} PyCFunctionObject; + +PyAPI_FUNC(int) PyCFunction_ClearFreeList(void); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_METHODOBJECT_H */ diff --git a/extern/include/Python-2.7/modsupport.h b/extern/include/Python-2.7/modsupport.h new file mode 100644 index 0000000..d4dddef --- /dev/null +++ b/extern/include/Python-2.7/modsupport.h @@ -0,0 +1,134 @@ + +#ifndef Py_MODSUPPORT_H +#define Py_MODSUPPORT_H +#ifdef __cplusplus +extern "C" { +#endif + +/* Module support interface */ + +#include + +/* If PY_SSIZE_T_CLEAN is defined, each functions treats #-specifier + to mean Py_ssize_t */ +#ifdef PY_SSIZE_T_CLEAN +#define PyArg_Parse _PyArg_Parse_SizeT +#define PyArg_ParseTuple _PyArg_ParseTuple_SizeT +#define PyArg_ParseTupleAndKeywords _PyArg_ParseTupleAndKeywords_SizeT +#define PyArg_VaParse _PyArg_VaParse_SizeT +#define PyArg_VaParseTupleAndKeywords _PyArg_VaParseTupleAndKeywords_SizeT +#define Py_BuildValue _Py_BuildValue_SizeT +#define Py_VaBuildValue _Py_VaBuildValue_SizeT +#else +PyAPI_FUNC(PyObject *) _Py_VaBuildValue_SizeT(const char *, va_list); +#endif + +PyAPI_FUNC(int) PyArg_Parse(PyObject *, const char *, ...); +PyAPI_FUNC(int) PyArg_ParseTuple(PyObject *, const char *, ...) Py_FORMAT_PARSETUPLE(PyArg_ParseTuple, 2, 3); +PyAPI_FUNC(int) PyArg_ParseTupleAndKeywords(PyObject *, PyObject *, + const char *, char **, ...); +PyAPI_FUNC(int) PyArg_UnpackTuple(PyObject *, const char *, Py_ssize_t, Py_ssize_t, ...); +PyAPI_FUNC(PyObject *) Py_BuildValue(const char *, ...); +PyAPI_FUNC(PyObject *) _Py_BuildValue_SizeT(const char *, ...); +PyAPI_FUNC(int) _PyArg_NoKeywords(const char *funcname, PyObject *kw); + +PyAPI_FUNC(int) PyArg_VaParse(PyObject *, const char *, va_list); +PyAPI_FUNC(int) PyArg_VaParseTupleAndKeywords(PyObject *, PyObject *, + const char *, char **, va_list); +PyAPI_FUNC(PyObject *) Py_VaBuildValue(const char *, va_list); + +PyAPI_FUNC(int) PyModule_AddObject(PyObject *, const char *, PyObject *); +PyAPI_FUNC(int) PyModule_AddIntConstant(PyObject *, const char *, long); +PyAPI_FUNC(int) PyModule_AddStringConstant(PyObject *, const char *, const char *); +#define PyModule_AddIntMacro(m, c) PyModule_AddIntConstant(m, #c, c) +#define PyModule_AddStringMacro(m, c) PyModule_AddStringConstant(m, #c, c) + +#define PYTHON_API_VERSION 1013 +#define PYTHON_API_STRING "1013" +/* The API version is maintained (independently from the Python version) + so we can detect mismatches between the interpreter and dynamically + loaded modules. These are diagnosed by an error message but + the module is still loaded (because the mismatch can only be tested + after loading the module). The error message is intended to + explain the core dump a few seconds later. + + The symbol PYTHON_API_STRING defines the same value as a string + literal. *** PLEASE MAKE SURE THE DEFINITIONS MATCH. *** + + Please add a line or two to the top of this log for each API + version change: + + 22-Feb-2006 MvL 1013 PEP 353 - long indices for sequence lengths + + 19-Aug-2002 GvR 1012 Changes to string object struct for + interning changes, saving 3 bytes. + + 17-Jul-2001 GvR 1011 Descr-branch, just to be on the safe side + + 25-Jan-2001 FLD 1010 Parameters added to PyCode_New() and + PyFrame_New(); Python 2.1a2 + + 14-Mar-2000 GvR 1009 Unicode API added + + 3-Jan-1999 GvR 1007 Decided to change back! (Don't reuse 1008!) + + 3-Dec-1998 GvR 1008 Python 1.5.2b1 + + 18-Jan-1997 GvR 1007 string interning and other speedups + + 11-Oct-1996 GvR renamed Py_Ellipses to Py_Ellipsis :-( + + 30-Jul-1996 GvR Slice and ellipses syntax added + + 23-Jul-1996 GvR For 1.4 -- better safe than sorry this time :-) + + 7-Nov-1995 GvR Keyword arguments (should've been done at 1.3 :-( ) + + 10-Jan-1995 GvR Renamed globals to new naming scheme + + 9-Jan-1995 GvR Initial version (incompatible with older API) +*/ + +#ifdef MS_WINDOWS +/* Special defines for Windows versions used to live here. Things + have changed, and the "Version" is now in a global string variable. + Reason for this is that this for easier branding of a "custom DLL" + without actually needing a recompile. */ +#endif /* MS_WINDOWS */ + +#if SIZEOF_SIZE_T != SIZEOF_INT +/* On a 64-bit system, rename the Py_InitModule4 so that 2.4 + modules cannot get loaded into a 2.5 interpreter */ +#define Py_InitModule4 Py_InitModule4_64 +#endif + +#ifdef Py_TRACE_REFS + /* When we are tracing reference counts, rename Py_InitModule4 so + modules compiled with incompatible settings will generate a + link-time error. */ + #if SIZEOF_SIZE_T != SIZEOF_INT + #undef Py_InitModule4 + #define Py_InitModule4 Py_InitModule4TraceRefs_64 + #else + #define Py_InitModule4 Py_InitModule4TraceRefs + #endif +#endif + +PyAPI_FUNC(PyObject *) Py_InitModule4(const char *name, PyMethodDef *methods, + const char *doc, PyObject *self, + int apiver); + +#define Py_InitModule(name, methods) \ + Py_InitModule4(name, methods, (char *)NULL, (PyObject *)NULL, \ + PYTHON_API_VERSION) + +#define Py_InitModule3(name, methods, doc) \ + Py_InitModule4(name, methods, doc, (PyObject *)NULL, \ + PYTHON_API_VERSION) + +PyAPI_DATA(char *) _Py_PackageContext; + +#ifdef __cplusplus +} +#endif +#endif /* !Py_MODSUPPORT_H */ diff --git a/extern/include/Python-2.7/moduleobject.h b/extern/include/Python-2.7/moduleobject.h new file mode 100644 index 0000000..b387f5b --- /dev/null +++ b/extern/include/Python-2.7/moduleobject.h @@ -0,0 +1,24 @@ + +/* Module object interface */ + +#ifndef Py_MODULEOBJECT_H +#define Py_MODULEOBJECT_H +#ifdef __cplusplus +extern "C" { +#endif + +PyAPI_DATA(PyTypeObject) PyModule_Type; + +#define PyModule_Check(op) PyObject_TypeCheck(op, &PyModule_Type) +#define PyModule_CheckExact(op) (Py_TYPE(op) == &PyModule_Type) + +PyAPI_FUNC(PyObject *) PyModule_New(const char *); +PyAPI_FUNC(PyObject *) PyModule_GetDict(PyObject *); +PyAPI_FUNC(char *) PyModule_GetName(PyObject *); +PyAPI_FUNC(char *) PyModule_GetFilename(PyObject *); +PyAPI_FUNC(void) _PyModule_Clear(PyObject *); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_MODULEOBJECT_H */ diff --git a/extern/include/Python-2.7/node.h b/extern/include/Python-2.7/node.h new file mode 100644 index 0000000..9f6760c --- /dev/null +++ b/extern/include/Python-2.7/node.h @@ -0,0 +1,43 @@ + +/* Parse tree node interface */ + +#ifndef Py_NODE_H +#define Py_NODE_H +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct _node { + short n_type; + char *n_str; + int n_lineno; + int n_col_offset; + int n_nchildren; + struct _node *n_child; +} node; + +PyAPI_FUNC(node *) PyNode_New(int type); +PyAPI_FUNC(int) PyNode_AddChild(node *n, int type, + char *str, int lineno, int col_offset); +PyAPI_FUNC(void) PyNode_Free(node *n); +#ifndef Py_LIMITED_API +Py_ssize_t _PyNode_SizeOf(node *n); +#endif + +/* Node access functions */ +#define NCH(n) ((n)->n_nchildren) + +#define CHILD(n, i) (&(n)->n_child[i]) +#define RCHILD(n, i) (CHILD(n, NCH(n) + i)) +#define TYPE(n) ((n)->n_type) +#define STR(n) ((n)->n_str) + +/* Assert that the type of a node is what we expect */ +#define REQ(n, type) assert(TYPE(n) == (type)) + +PyAPI_FUNC(void) PyNode_ListTree(node *); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_NODE_H */ diff --git a/extern/include/Python-2.7/object.h b/extern/include/Python-2.7/object.h new file mode 100644 index 0000000..afbc68d --- /dev/null +++ b/extern/include/Python-2.7/object.h @@ -0,0 +1,1011 @@ +#ifndef Py_OBJECT_H +#define Py_OBJECT_H +#ifdef __cplusplus +extern "C" { +#endif + + +/* Object and type object interface */ + +/* +Objects are structures allocated on the heap. Special rules apply to +the use of objects to ensure they are properly garbage-collected. +Objects are never allocated statically or on the stack; they must be +accessed through special macros and functions only. (Type objects are +exceptions to the first rule; the standard types are represented by +statically initialized type objects, although work on type/class unification +for Python 2.2 made it possible to have heap-allocated type objects too). + +An object has a 'reference count' that is increased or decreased when a +pointer to the object is copied or deleted; when the reference count +reaches zero there are no references to the object left and it can be +removed from the heap. + +An object has a 'type' that determines what it represents and what kind +of data it contains. An object's type is fixed when it is created. +Types themselves are represented as objects; an object contains a +pointer to the corresponding type object. The type itself has a type +pointer pointing to the object representing the type 'type', which +contains a pointer to itself!). + +Objects do not float around in memory; once allocated an object keeps +the same size and address. Objects that must hold variable-size data +can contain pointers to variable-size parts of the object. Not all +objects of the same type have the same size; but the size cannot change +after allocation. (These restrictions are made so a reference to an +object can be simply a pointer -- moving an object would require +updating all the pointers, and changing an object's size would require +moving it if there was another object right next to it.) + +Objects are always accessed through pointers of the type 'PyObject *'. +The type 'PyObject' is a structure that only contains the reference count +and the type pointer. The actual memory allocated for an object +contains other data that can only be accessed after casting the pointer +to a pointer to a longer structure type. This longer type must start +with the reference count and type fields; the macro PyObject_HEAD should be +used for this (to accommodate for future changes). The implementation +of a particular object type can cast the object pointer to the proper +type and back. + +A standard interface exists for objects that contain an array of items +whose size is determined when the object is allocated. +*/ + +/* Py_DEBUG implies Py_TRACE_REFS. */ +#if defined(Py_DEBUG) && !defined(Py_TRACE_REFS) +#define Py_TRACE_REFS +#endif + +/* Py_TRACE_REFS implies Py_REF_DEBUG. */ +#if defined(Py_TRACE_REFS) && !defined(Py_REF_DEBUG) +#define Py_REF_DEBUG +#endif + +#ifdef Py_TRACE_REFS +/* Define pointers to support a doubly-linked list of all live heap objects. */ +#define _PyObject_HEAD_EXTRA \ + struct _object *_ob_next; \ + struct _object *_ob_prev; + +#define _PyObject_EXTRA_INIT 0, 0, + +#else +#define _PyObject_HEAD_EXTRA +#define _PyObject_EXTRA_INIT +#endif + +/* PyObject_HEAD defines the initial segment of every PyObject. */ +#define PyObject_HEAD \ + _PyObject_HEAD_EXTRA \ + Py_ssize_t ob_refcnt; \ + struct _typeobject *ob_type; + +#define PyObject_HEAD_INIT(type) \ + _PyObject_EXTRA_INIT \ + 1, type, + +#define PyVarObject_HEAD_INIT(type, size) \ + PyObject_HEAD_INIT(type) size, + +/* PyObject_VAR_HEAD defines the initial segment of all variable-size + * container objects. These end with a declaration of an array with 1 + * element, but enough space is malloc'ed so that the array actually + * has room for ob_size elements. Note that ob_size is an element count, + * not necessarily a byte count. + */ +#define PyObject_VAR_HEAD \ + PyObject_HEAD \ + Py_ssize_t ob_size; /* Number of items in variable part */ +#define Py_INVALID_SIZE (Py_ssize_t)-1 + +/* Nothing is actually declared to be a PyObject, but every pointer to + * a Python object can be cast to a PyObject*. This is inheritance built + * by hand. Similarly every pointer to a variable-size Python object can, + * in addition, be cast to PyVarObject*. + */ +typedef struct _object { + PyObject_HEAD +} PyObject; + +typedef struct { + PyObject_VAR_HEAD +} PyVarObject; + +#define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt) +#define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) +#define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size) + +/* +Type objects contain a string containing the type name (to help somewhat +in debugging), the allocation parameters (see PyObject_New() and +PyObject_NewVar()), +and methods for accessing objects of the type. Methods are optional, a +nil pointer meaning that particular kind of access is not available for +this type. The Py_DECREF() macro uses the tp_dealloc method without +checking for a nil pointer; it should always be implemented except if +the implementation can guarantee that the reference count will never +reach zero (e.g., for statically allocated type objects). + +NB: the methods for certain type groups are now contained in separate +method blocks. +*/ + +typedef PyObject * (*unaryfunc)(PyObject *); +typedef PyObject * (*binaryfunc)(PyObject *, PyObject *); +typedef PyObject * (*ternaryfunc)(PyObject *, PyObject *, PyObject *); +typedef int (*inquiry)(PyObject *); +typedef Py_ssize_t (*lenfunc)(PyObject *); +typedef int (*coercion)(PyObject **, PyObject **); +typedef PyObject *(*intargfunc)(PyObject *, int) Py_DEPRECATED(2.5); +typedef PyObject *(*intintargfunc)(PyObject *, int, int) Py_DEPRECATED(2.5); +typedef PyObject *(*ssizeargfunc)(PyObject *, Py_ssize_t); +typedef PyObject *(*ssizessizeargfunc)(PyObject *, Py_ssize_t, Py_ssize_t); +typedef int(*intobjargproc)(PyObject *, int, PyObject *); +typedef int(*intintobjargproc)(PyObject *, int, int, PyObject *); +typedef int(*ssizeobjargproc)(PyObject *, Py_ssize_t, PyObject *); +typedef int(*ssizessizeobjargproc)(PyObject *, Py_ssize_t, Py_ssize_t, PyObject *); +typedef int(*objobjargproc)(PyObject *, PyObject *, PyObject *); + + + +/* int-based buffer interface */ +typedef int (*getreadbufferproc)(PyObject *, int, void **); +typedef int (*getwritebufferproc)(PyObject *, int, void **); +typedef int (*getsegcountproc)(PyObject *, int *); +typedef int (*getcharbufferproc)(PyObject *, int, char **); +/* ssize_t-based buffer interface */ +typedef Py_ssize_t (*readbufferproc)(PyObject *, Py_ssize_t, void **); +typedef Py_ssize_t (*writebufferproc)(PyObject *, Py_ssize_t, void **); +typedef Py_ssize_t (*segcountproc)(PyObject *, Py_ssize_t *); +typedef Py_ssize_t (*charbufferproc)(PyObject *, Py_ssize_t, char **); + + +/* Py3k buffer interface */ +typedef struct bufferinfo { + void *buf; + PyObject *obj; /* owned reference */ + Py_ssize_t len; + Py_ssize_t itemsize; /* This is Py_ssize_t so it can be + pointed to by strides in simple case.*/ + int readonly; + int ndim; + char *format; + Py_ssize_t *shape; + Py_ssize_t *strides; + Py_ssize_t *suboffsets; + Py_ssize_t smalltable[2]; /* static store for shape and strides of + mono-dimensional buffers. */ + void *internal; +} Py_buffer; + +typedef int (*getbufferproc)(PyObject *, Py_buffer *, int); +typedef void (*releasebufferproc)(PyObject *, Py_buffer *); + + /* Flags for getting buffers */ +#define PyBUF_SIMPLE 0 +#define PyBUF_WRITABLE 0x0001 +/* we used to include an E, backwards compatible alias */ +#define PyBUF_WRITEABLE PyBUF_WRITABLE +#define PyBUF_FORMAT 0x0004 +#define PyBUF_ND 0x0008 +#define PyBUF_STRIDES (0x0010 | PyBUF_ND) +#define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES) +#define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES) +#define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES) +#define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES) + +#define PyBUF_CONTIG (PyBUF_ND | PyBUF_WRITABLE) +#define PyBUF_CONTIG_RO (PyBUF_ND) + +#define PyBUF_STRIDED (PyBUF_STRIDES | PyBUF_WRITABLE) +#define PyBUF_STRIDED_RO (PyBUF_STRIDES) + +#define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_WRITABLE | PyBUF_FORMAT) +#define PyBUF_RECORDS_RO (PyBUF_STRIDES | PyBUF_FORMAT) + +#define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_WRITABLE | PyBUF_FORMAT) +#define PyBUF_FULL_RO (PyBUF_INDIRECT | PyBUF_FORMAT) + + +#define PyBUF_READ 0x100 +#define PyBUF_WRITE 0x200 +#define PyBUF_SHADOW 0x400 +/* end Py3k buffer interface */ + +typedef int (*objobjproc)(PyObject *, PyObject *); +typedef int (*visitproc)(PyObject *, void *); +typedef int (*traverseproc)(PyObject *, visitproc, void *); + +typedef struct { + /* For numbers without flag bit Py_TPFLAGS_CHECKTYPES set, all + arguments are guaranteed to be of the object's type (modulo + coercion hacks -- i.e. if the type's coercion function + returns other types, then these are allowed as well). Numbers that + have the Py_TPFLAGS_CHECKTYPES flag bit set should check *both* + arguments for proper type and implement the necessary conversions + in the slot functions themselves. */ + + binaryfunc nb_add; + binaryfunc nb_subtract; + binaryfunc nb_multiply; + binaryfunc nb_divide; + binaryfunc nb_remainder; + binaryfunc nb_divmod; + ternaryfunc nb_power; + unaryfunc nb_negative; + unaryfunc nb_positive; + unaryfunc nb_absolute; + inquiry nb_nonzero; + unaryfunc nb_invert; + binaryfunc nb_lshift; + binaryfunc nb_rshift; + binaryfunc nb_and; + binaryfunc nb_xor; + binaryfunc nb_or; + coercion nb_coerce; + unaryfunc nb_int; + unaryfunc nb_long; + unaryfunc nb_float; + unaryfunc nb_oct; + unaryfunc nb_hex; + /* Added in release 2.0 */ + binaryfunc nb_inplace_add; + binaryfunc nb_inplace_subtract; + binaryfunc nb_inplace_multiply; + binaryfunc nb_inplace_divide; + binaryfunc nb_inplace_remainder; + ternaryfunc nb_inplace_power; + binaryfunc nb_inplace_lshift; + binaryfunc nb_inplace_rshift; + binaryfunc nb_inplace_and; + binaryfunc nb_inplace_xor; + binaryfunc nb_inplace_or; + + /* Added in release 2.2 */ + /* The following require the Py_TPFLAGS_HAVE_CLASS flag */ + binaryfunc nb_floor_divide; + binaryfunc nb_true_divide; + binaryfunc nb_inplace_floor_divide; + binaryfunc nb_inplace_true_divide; + + /* Added in release 2.5 */ + unaryfunc nb_index; +} PyNumberMethods; + +typedef struct { + lenfunc sq_length; + binaryfunc sq_concat; + ssizeargfunc sq_repeat; + ssizeargfunc sq_item; + ssizessizeargfunc sq_slice; + ssizeobjargproc sq_ass_item; + ssizessizeobjargproc sq_ass_slice; + objobjproc sq_contains; + /* Added in release 2.0 */ + binaryfunc sq_inplace_concat; + ssizeargfunc sq_inplace_repeat; +} PySequenceMethods; + +typedef struct { + lenfunc mp_length; + binaryfunc mp_subscript; + objobjargproc mp_ass_subscript; +} PyMappingMethods; + +typedef struct { + readbufferproc bf_getreadbuffer; + writebufferproc bf_getwritebuffer; + segcountproc bf_getsegcount; + charbufferproc bf_getcharbuffer; + getbufferproc bf_getbuffer; + releasebufferproc bf_releasebuffer; +} PyBufferProcs; + + +typedef void (*freefunc)(void *); +typedef void (*destructor)(PyObject *); +typedef int (*printfunc)(PyObject *, FILE *, int); +typedef PyObject *(*getattrfunc)(PyObject *, char *); +typedef PyObject *(*getattrofunc)(PyObject *, PyObject *); +typedef int (*setattrfunc)(PyObject *, char *, PyObject *); +typedef int (*setattrofunc)(PyObject *, PyObject *, PyObject *); +typedef int (*cmpfunc)(PyObject *, PyObject *); +typedef PyObject *(*reprfunc)(PyObject *); +typedef long (*hashfunc)(PyObject *); +typedef PyObject *(*richcmpfunc) (PyObject *, PyObject *, int); +typedef PyObject *(*getiterfunc) (PyObject *); +typedef PyObject *(*iternextfunc) (PyObject *); +typedef PyObject *(*descrgetfunc) (PyObject *, PyObject *, PyObject *); +typedef int (*descrsetfunc) (PyObject *, PyObject *, PyObject *); +typedef int (*initproc)(PyObject *, PyObject *, PyObject *); +typedef PyObject *(*newfunc)(struct _typeobject *, PyObject *, PyObject *); +typedef PyObject *(*allocfunc)(struct _typeobject *, Py_ssize_t); + +typedef struct _typeobject { + PyObject_VAR_HEAD + const char *tp_name; /* For printing, in format "." */ + Py_ssize_t tp_basicsize, tp_itemsize; /* For allocation */ + + /* Methods to implement standard operations */ + + destructor tp_dealloc; + printfunc tp_print; + getattrfunc tp_getattr; + setattrfunc tp_setattr; + cmpfunc tp_compare; + reprfunc tp_repr; + + /* Method suites for standard classes */ + + PyNumberMethods *tp_as_number; + PySequenceMethods *tp_as_sequence; + PyMappingMethods *tp_as_mapping; + + /* More standard operations (here for binary compatibility) */ + + hashfunc tp_hash; + ternaryfunc tp_call; + reprfunc tp_str; + getattrofunc tp_getattro; + setattrofunc tp_setattro; + + /* Functions to access object as input/output buffer */ + PyBufferProcs *tp_as_buffer; + + /* Flags to define presence of optional/expanded features */ + long tp_flags; + + const char *tp_doc; /* Documentation string */ + + /* Assigned meaning in release 2.0 */ + /* call function for all accessible objects */ + traverseproc tp_traverse; + + /* delete references to contained objects */ + inquiry tp_clear; + + /* Assigned meaning in release 2.1 */ + /* rich comparisons */ + richcmpfunc tp_richcompare; + + /* weak reference enabler */ + Py_ssize_t tp_weaklistoffset; + + /* Added in release 2.2 */ + /* Iterators */ + getiterfunc tp_iter; + iternextfunc tp_iternext; + + /* Attribute descriptor and subclassing stuff */ + struct PyMethodDef *tp_methods; + struct PyMemberDef *tp_members; + struct PyGetSetDef *tp_getset; + struct _typeobject *tp_base; + PyObject *tp_dict; + descrgetfunc tp_descr_get; + descrsetfunc tp_descr_set; + Py_ssize_t tp_dictoffset; + initproc tp_init; + allocfunc tp_alloc; + newfunc tp_new; + freefunc tp_free; /* Low-level free-memory routine */ + inquiry tp_is_gc; /* For PyObject_IS_GC */ + PyObject *tp_bases; + PyObject *tp_mro; /* method resolution order */ + PyObject *tp_cache; + PyObject *tp_subclasses; + PyObject *tp_weaklist; + destructor tp_del; + + /* Type attribute cache version tag. Added in version 2.6 */ + unsigned int tp_version_tag; + +#ifdef COUNT_ALLOCS + /* these must be last and never explicitly initialized */ + Py_ssize_t tp_allocs; + Py_ssize_t tp_frees; + Py_ssize_t tp_maxalloc; + struct _typeobject *tp_prev; + struct _typeobject *tp_next; +#endif +} PyTypeObject; + + +/* The *real* layout of a type object when allocated on the heap */ +typedef struct _heaptypeobject { + /* Note: there's a dependency on the order of these members + in slotptr() in typeobject.c . */ + PyTypeObject ht_type; + PyNumberMethods as_number; + PyMappingMethods as_mapping; + PySequenceMethods as_sequence; /* as_sequence comes after as_mapping, + so that the mapping wins when both + the mapping and the sequence define + a given operator (e.g. __getitem__). + see add_operators() in typeobject.c . */ + PyBufferProcs as_buffer; + PyObject *ht_name, *ht_slots; + /* here are optional user slots, followed by the members. */ +} PyHeapTypeObject; + +/* access macro to the members which are floating "behind" the object */ +#define PyHeapType_GET_MEMBERS(etype) \ + ((PyMemberDef *)(((char *)etype) + Py_TYPE(etype)->tp_basicsize)) + + +/* Generic type check */ +PyAPI_FUNC(int) PyType_IsSubtype(PyTypeObject *, PyTypeObject *); +#define PyObject_TypeCheck(ob, tp) \ + (Py_TYPE(ob) == (tp) || PyType_IsSubtype(Py_TYPE(ob), (tp))) + +PyAPI_DATA(PyTypeObject) PyType_Type; /* built-in 'type' */ +PyAPI_DATA(PyTypeObject) PyBaseObject_Type; /* built-in 'object' */ +PyAPI_DATA(PyTypeObject) PySuper_Type; /* built-in 'super' */ + +#define PyType_Check(op) \ + PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_TYPE_SUBCLASS) +#define PyType_CheckExact(op) (Py_TYPE(op) == &PyType_Type) + +PyAPI_FUNC(int) PyType_Ready(PyTypeObject *); +PyAPI_FUNC(PyObject *) PyType_GenericAlloc(PyTypeObject *, Py_ssize_t); +PyAPI_FUNC(PyObject *) PyType_GenericNew(PyTypeObject *, + PyObject *, PyObject *); +PyAPI_FUNC(PyObject *) _PyType_Lookup(PyTypeObject *, PyObject *); +PyAPI_FUNC(PyObject *) _PyObject_LookupSpecial(PyObject *, char *, PyObject **); +PyAPI_FUNC(unsigned int) PyType_ClearCache(void); +PyAPI_FUNC(void) PyType_Modified(PyTypeObject *); + +/* Generic operations on objects */ +PyAPI_FUNC(int) PyObject_Print(PyObject *, FILE *, int); +PyAPI_FUNC(void) _PyObject_Dump(PyObject *); +PyAPI_FUNC(PyObject *) PyObject_Repr(PyObject *); +PyAPI_FUNC(PyObject *) _PyObject_Str(PyObject *); +PyAPI_FUNC(PyObject *) PyObject_Str(PyObject *); +#define PyObject_Bytes PyObject_Str +#ifdef Py_USING_UNICODE +PyAPI_FUNC(PyObject *) PyObject_Unicode(PyObject *); +#endif +PyAPI_FUNC(int) PyObject_Compare(PyObject *, PyObject *); +PyAPI_FUNC(PyObject *) PyObject_RichCompare(PyObject *, PyObject *, int); +PyAPI_FUNC(int) PyObject_RichCompareBool(PyObject *, PyObject *, int); +PyAPI_FUNC(PyObject *) PyObject_GetAttrString(PyObject *, const char *); +PyAPI_FUNC(int) PyObject_SetAttrString(PyObject *, const char *, PyObject *); +PyAPI_FUNC(int) PyObject_HasAttrString(PyObject *, const char *); +PyAPI_FUNC(PyObject *) PyObject_GetAttr(PyObject *, PyObject *); +PyAPI_FUNC(int) PyObject_SetAttr(PyObject *, PyObject *, PyObject *); +PyAPI_FUNC(int) PyObject_HasAttr(PyObject *, PyObject *); +PyAPI_FUNC(PyObject **) _PyObject_GetDictPtr(PyObject *); +PyAPI_FUNC(PyObject *) PyObject_SelfIter(PyObject *); +PyAPI_FUNC(PyObject *) _PyObject_NextNotImplemented(PyObject *); +PyAPI_FUNC(PyObject *) PyObject_GenericGetAttr(PyObject *, PyObject *); +PyAPI_FUNC(int) PyObject_GenericSetAttr(PyObject *, + PyObject *, PyObject *); +PyAPI_FUNC(long) PyObject_Hash(PyObject *); +PyAPI_FUNC(long) PyObject_HashNotImplemented(PyObject *); +PyAPI_FUNC(int) PyObject_IsTrue(PyObject *); +PyAPI_FUNC(int) PyObject_Not(PyObject *); +PyAPI_FUNC(int) PyCallable_Check(PyObject *); +PyAPI_FUNC(int) PyNumber_Coerce(PyObject **, PyObject **); +PyAPI_FUNC(int) PyNumber_CoerceEx(PyObject **, PyObject **); + +PyAPI_FUNC(void) PyObject_ClearWeakRefs(PyObject *); + +/* A slot function whose address we need to compare */ +extern int _PyObject_SlotCompare(PyObject *, PyObject *); +/* Same as PyObject_Generic{Get,Set}Attr, but passing the attributes + dict as the last parameter. */ +PyAPI_FUNC(PyObject *) +_PyObject_GenericGetAttrWithDict(PyObject *, PyObject *, PyObject *); +PyAPI_FUNC(int) +_PyObject_GenericSetAttrWithDict(PyObject *, PyObject *, + PyObject *, PyObject *); + + +/* PyObject_Dir(obj) acts like Python __builtin__.dir(obj), returning a + list of strings. PyObject_Dir(NULL) is like __builtin__.dir(), + returning the names of the current locals. In this case, if there are + no current locals, NULL is returned, and PyErr_Occurred() is false. +*/ +PyAPI_FUNC(PyObject *) PyObject_Dir(PyObject *); + + +/* Helpers for printing recursive container types */ +PyAPI_FUNC(int) Py_ReprEnter(PyObject *); +PyAPI_FUNC(void) Py_ReprLeave(PyObject *); + +/* Helpers for hash functions */ +PyAPI_FUNC(long) _Py_HashDouble(double); +PyAPI_FUNC(long) _Py_HashPointer(void*); + +typedef struct { + long prefix; + long suffix; +} _Py_HashSecret_t; +PyAPI_DATA(_Py_HashSecret_t) _Py_HashSecret; + +#ifdef Py_DEBUG +PyAPI_DATA(int) _Py_HashSecret_Initialized; +#endif + +/* Helper for passing objects to printf and the like */ +#define PyObject_REPR(obj) PyString_AS_STRING(PyObject_Repr(obj)) + +/* Flag bits for printing: */ +#define Py_PRINT_RAW 1 /* No string quotes etc. */ + +/* +`Type flags (tp_flags) + +These flags are used to extend the type structure in a backwards-compatible +fashion. Extensions can use the flags to indicate (and test) when a given +type structure contains a new feature. The Python core will use these when +introducing new functionality between major revisions (to avoid mid-version +changes in the PYTHON_API_VERSION). + +Arbitration of the flag bit positions will need to be coordinated among +all extension writers who publically release their extensions (this will +be fewer than you might expect!).. + +Python 1.5.2 introduced the bf_getcharbuffer slot into PyBufferProcs. + +Type definitions should use Py_TPFLAGS_DEFAULT for their tp_flags value. + +Code can use PyType_HasFeature(type_ob, flag_value) to test whether the +given type object has a specified feature. + +NOTE: when building the core, Py_TPFLAGS_DEFAULT includes +Py_TPFLAGS_HAVE_VERSION_TAG; outside the core, it doesn't. This is so +that extensions that modify tp_dict of their own types directly don't +break, since this was allowed in 2.5. In 3.0 they will have to +manually remove this flag though! +*/ + +/* PyBufferProcs contains bf_getcharbuffer */ +#define Py_TPFLAGS_HAVE_GETCHARBUFFER (1L<<0) + +/* PySequenceMethods contains sq_contains */ +#define Py_TPFLAGS_HAVE_SEQUENCE_IN (1L<<1) + +/* This is here for backwards compatibility. Extensions that use the old GC + * API will still compile but the objects will not be tracked by the GC. */ +#define Py_TPFLAGS_GC 0 /* used to be (1L<<2) */ + +/* PySequenceMethods and PyNumberMethods contain in-place operators */ +#define Py_TPFLAGS_HAVE_INPLACEOPS (1L<<3) + +/* PyNumberMethods do their own coercion */ +#define Py_TPFLAGS_CHECKTYPES (1L<<4) + +/* tp_richcompare is defined */ +#define Py_TPFLAGS_HAVE_RICHCOMPARE (1L<<5) + +/* Objects which are weakly referencable if their tp_weaklistoffset is >0 */ +#define Py_TPFLAGS_HAVE_WEAKREFS (1L<<6) + +/* tp_iter is defined */ +#define Py_TPFLAGS_HAVE_ITER (1L<<7) + +/* New members introduced by Python 2.2 exist */ +#define Py_TPFLAGS_HAVE_CLASS (1L<<8) + +/* Set if the type object is dynamically allocated */ +#define Py_TPFLAGS_HEAPTYPE (1L<<9) + +/* Set if the type allows subclassing */ +#define Py_TPFLAGS_BASETYPE (1L<<10) + +/* Set if the type is 'ready' -- fully initialized */ +#define Py_TPFLAGS_READY (1L<<12) + +/* Set while the type is being 'readied', to prevent recursive ready calls */ +#define Py_TPFLAGS_READYING (1L<<13) + +/* Objects support garbage collection (see objimp.h) */ +#define Py_TPFLAGS_HAVE_GC (1L<<14) + +/* These two bits are preserved for Stackless Python, next after this is 17 */ +#ifdef STACKLESS +#define Py_TPFLAGS_HAVE_STACKLESS_EXTENSION (3L<<15) +#else +#define Py_TPFLAGS_HAVE_STACKLESS_EXTENSION 0 +#endif + +/* Objects support nb_index in PyNumberMethods */ +#define Py_TPFLAGS_HAVE_INDEX (1L<<17) + +/* Objects support type attribute cache */ +#define Py_TPFLAGS_HAVE_VERSION_TAG (1L<<18) +#define Py_TPFLAGS_VALID_VERSION_TAG (1L<<19) + +/* Type is abstract and cannot be instantiated */ +#define Py_TPFLAGS_IS_ABSTRACT (1L<<20) + +/* Has the new buffer protocol */ +#define Py_TPFLAGS_HAVE_NEWBUFFER (1L<<21) + +/* These flags are used to determine if a type is a subclass. */ +#define Py_TPFLAGS_INT_SUBCLASS (1L<<23) +#define Py_TPFLAGS_LONG_SUBCLASS (1L<<24) +#define Py_TPFLAGS_LIST_SUBCLASS (1L<<25) +#define Py_TPFLAGS_TUPLE_SUBCLASS (1L<<26) +#define Py_TPFLAGS_STRING_SUBCLASS (1L<<27) +#define Py_TPFLAGS_UNICODE_SUBCLASS (1L<<28) +#define Py_TPFLAGS_DICT_SUBCLASS (1L<<29) +#define Py_TPFLAGS_BASE_EXC_SUBCLASS (1L<<30) +#define Py_TPFLAGS_TYPE_SUBCLASS (1L<<31) + +#define Py_TPFLAGS_DEFAULT_EXTERNAL ( \ + Py_TPFLAGS_HAVE_GETCHARBUFFER | \ + Py_TPFLAGS_HAVE_SEQUENCE_IN | \ + Py_TPFLAGS_HAVE_INPLACEOPS | \ + Py_TPFLAGS_HAVE_RICHCOMPARE | \ + Py_TPFLAGS_HAVE_WEAKREFS | \ + Py_TPFLAGS_HAVE_ITER | \ + Py_TPFLAGS_HAVE_CLASS | \ + Py_TPFLAGS_HAVE_STACKLESS_EXTENSION | \ + Py_TPFLAGS_HAVE_INDEX | \ + 0) +#define Py_TPFLAGS_DEFAULT_CORE (Py_TPFLAGS_DEFAULT_EXTERNAL | \ + Py_TPFLAGS_HAVE_VERSION_TAG) + +#ifdef Py_BUILD_CORE +#define Py_TPFLAGS_DEFAULT Py_TPFLAGS_DEFAULT_CORE +#else +#define Py_TPFLAGS_DEFAULT Py_TPFLAGS_DEFAULT_EXTERNAL +#endif + +#define PyType_HasFeature(t,f) (((t)->tp_flags & (f)) != 0) +#define PyType_FastSubclass(t,f) PyType_HasFeature(t,f) + + +/* +The macros Py_INCREF(op) and Py_DECREF(op) are used to increment or decrement +reference counts. Py_DECREF calls the object's deallocator function when +the refcount falls to 0; for +objects that don't contain references to other objects or heap memory +this can be the standard function free(). Both macros can be used +wherever a void expression is allowed. The argument must not be a +NULL pointer. If it may be NULL, use Py_XINCREF/Py_XDECREF instead. +The macro _Py_NewReference(op) initialize reference counts to 1, and +in special builds (Py_REF_DEBUG, Py_TRACE_REFS) performs additional +bookkeeping appropriate to the special build. + +We assume that the reference count field can never overflow; this can +be proven when the size of the field is the same as the pointer size, so +we ignore the possibility. Provided a C int is at least 32 bits (which +is implicitly assumed in many parts of this code), that's enough for +about 2**31 references to an object. + +XXX The following became out of date in Python 2.2, but I'm not sure +XXX what the full truth is now. Certainly, heap-allocated type objects +XXX can and should be deallocated. +Type objects should never be deallocated; the type pointer in an object +is not considered to be a reference to the type object, to save +complications in the deallocation function. (This is actually a +decision that's up to the implementer of each new type so if you want, +you can count such references to the type object.) + +*** WARNING*** The Py_DECREF macro must have a side-effect-free argument +since it may evaluate its argument multiple times. (The alternative +would be to mace it a proper function or assign it to a global temporary +variable first, both of which are slower; and in a multi-threaded +environment the global variable trick is not safe.) +*/ + +/* First define a pile of simple helper macros, one set per special + * build symbol. These either expand to the obvious things, or to + * nothing at all when the special mode isn't in effect. The main + * macros can later be defined just once then, yet expand to different + * things depending on which special build options are and aren't in effect. + * Trust me : while painful, this is 20x easier to understand than, + * e.g, defining _Py_NewReference five different times in a maze of nested + * #ifdefs (we used to do that -- it was impenetrable). + */ +#ifdef Py_REF_DEBUG +PyAPI_DATA(Py_ssize_t) _Py_RefTotal; +PyAPI_FUNC(void) _Py_NegativeRefcount(const char *fname, + int lineno, PyObject *op); +PyAPI_FUNC(PyObject *) _PyDict_Dummy(void); +PyAPI_FUNC(PyObject *) _PySet_Dummy(void); +PyAPI_FUNC(Py_ssize_t) _Py_GetRefTotal(void); +#define _Py_INC_REFTOTAL _Py_RefTotal++ +#define _Py_DEC_REFTOTAL _Py_RefTotal-- +#define _Py_REF_DEBUG_COMMA , +#define _Py_CHECK_REFCNT(OP) \ +{ if (((PyObject*)OP)->ob_refcnt < 0) \ + _Py_NegativeRefcount(__FILE__, __LINE__, \ + (PyObject *)(OP)); \ +} +#else +#define _Py_INC_REFTOTAL +#define _Py_DEC_REFTOTAL +#define _Py_REF_DEBUG_COMMA +#define _Py_CHECK_REFCNT(OP) /* a semicolon */; +#endif /* Py_REF_DEBUG */ + +#ifdef COUNT_ALLOCS +PyAPI_FUNC(void) inc_count(PyTypeObject *); +PyAPI_FUNC(void) dec_count(PyTypeObject *); +#define _Py_INC_TPALLOCS(OP) inc_count(Py_TYPE(OP)) +#define _Py_INC_TPFREES(OP) dec_count(Py_TYPE(OP)) +#define _Py_DEC_TPFREES(OP) Py_TYPE(OP)->tp_frees-- +#define _Py_COUNT_ALLOCS_COMMA , +#else +#define _Py_INC_TPALLOCS(OP) +#define _Py_INC_TPFREES(OP) +#define _Py_DEC_TPFREES(OP) +#define _Py_COUNT_ALLOCS_COMMA +#endif /* COUNT_ALLOCS */ + +#ifdef Py_TRACE_REFS +/* Py_TRACE_REFS is such major surgery that we call external routines. */ +PyAPI_FUNC(void) _Py_NewReference(PyObject *); +PyAPI_FUNC(void) _Py_ForgetReference(PyObject *); +PyAPI_FUNC(void) _Py_Dealloc(PyObject *); +PyAPI_FUNC(void) _Py_PrintReferences(FILE *); +PyAPI_FUNC(void) _Py_PrintReferenceAddresses(FILE *); +PyAPI_FUNC(void) _Py_AddToAllObjects(PyObject *, int force); + +#else +/* Without Py_TRACE_REFS, there's little enough to do that we expand code + * inline. + */ +#define _Py_NewReference(op) ( \ + _Py_INC_TPALLOCS(op) _Py_COUNT_ALLOCS_COMMA \ + _Py_INC_REFTOTAL _Py_REF_DEBUG_COMMA \ + Py_REFCNT(op) = 1) + +#define _Py_ForgetReference(op) _Py_INC_TPFREES(op) + +#define _Py_Dealloc(op) ( \ + _Py_INC_TPFREES(op) _Py_COUNT_ALLOCS_COMMA \ + (*Py_TYPE(op)->tp_dealloc)((PyObject *)(op))) +#endif /* !Py_TRACE_REFS */ + +#define Py_INCREF(op) ( \ + _Py_INC_REFTOTAL _Py_REF_DEBUG_COMMA \ + ((PyObject*)(op))->ob_refcnt++) + +#define Py_DECREF(op) \ + do { \ + if (_Py_DEC_REFTOTAL _Py_REF_DEBUG_COMMA \ + --((PyObject*)(op))->ob_refcnt != 0) \ + _Py_CHECK_REFCNT(op) \ + else \ + _Py_Dealloc((PyObject *)(op)); \ + } while (0) + +/* Safely decref `op` and set `op` to NULL, especially useful in tp_clear + * and tp_dealloc implementatons. + * + * Note that "the obvious" code can be deadly: + * + * Py_XDECREF(op); + * op = NULL; + * + * Typically, `op` is something like self->containee, and `self` is done + * using its `containee` member. In the code sequence above, suppose + * `containee` is non-NULL with a refcount of 1. Its refcount falls to + * 0 on the first line, which can trigger an arbitrary amount of code, + * possibly including finalizers (like __del__ methods or weakref callbacks) + * coded in Python, which in turn can release the GIL and allow other threads + * to run, etc. Such code may even invoke methods of `self` again, or cause + * cyclic gc to trigger, but-- oops! --self->containee still points to the + * object being torn down, and it may be in an insane state while being torn + * down. This has in fact been a rich historic source of miserable (rare & + * hard-to-diagnose) segfaulting (and other) bugs. + * + * The safe way is: + * + * Py_CLEAR(op); + * + * That arranges to set `op` to NULL _before_ decref'ing, so that any code + * triggered as a side-effect of `op` getting torn down no longer believes + * `op` points to a valid object. + * + * There are cases where it's safe to use the naive code, but they're brittle. + * For example, if `op` points to a Python integer, you know that destroying + * one of those can't cause problems -- but in part that relies on that + * Python integers aren't currently weakly referencable. Best practice is + * to use Py_CLEAR() even if you can't think of a reason for why you need to. + */ +#define Py_CLEAR(op) \ + do { \ + if (op) { \ + PyObject *_py_tmp = (PyObject *)(op); \ + (op) = NULL; \ + Py_DECREF(_py_tmp); \ + } \ + } while (0) + +/* Macros to use in case the object pointer may be NULL: */ +#define Py_XINCREF(op) do { if ((op) == NULL) ; else Py_INCREF(op); } while (0) +#define Py_XDECREF(op) do { if ((op) == NULL) ; else Py_DECREF(op); } while (0) + +/* +These are provided as conveniences to Python runtime embedders, so that +they can have object code that is not dependent on Python compilation flags. +*/ +PyAPI_FUNC(void) Py_IncRef(PyObject *); +PyAPI_FUNC(void) Py_DecRef(PyObject *); + +/* +_Py_NoneStruct is an object of undefined type which can be used in contexts +where NULL (nil) is not suitable (since NULL often means 'error'). + +Don't forget to apply Py_INCREF() when returning this value!!! +*/ +PyAPI_DATA(PyObject) _Py_NoneStruct; /* Don't use this directly */ +#define Py_None (&_Py_NoneStruct) + +/* Macro for returning Py_None from a function */ +#define Py_RETURN_NONE return Py_INCREF(Py_None), Py_None + +/* +Py_NotImplemented is a singleton used to signal that an operation is +not implemented for a given type combination. +*/ +PyAPI_DATA(PyObject) _Py_NotImplementedStruct; /* Don't use this directly */ +#define Py_NotImplemented (&_Py_NotImplementedStruct) + +/* Rich comparison opcodes */ +#define Py_LT 0 +#define Py_LE 1 +#define Py_EQ 2 +#define Py_NE 3 +#define Py_GT 4 +#define Py_GE 5 + +/* Maps Py_LT to Py_GT, ..., Py_GE to Py_LE. + * Defined in object.c. + */ +PyAPI_DATA(int) _Py_SwappedOp[]; + +/* +Define staticforward and statichere for source compatibility with old +C extensions. + +The staticforward define was needed to support certain broken C +compilers (notably SCO ODT 3.0, perhaps early AIX as well) botched the +static keyword when it was used with a forward declaration of a static +initialized structure. Standard C allows the forward declaration with +static, and we've decided to stop catering to broken C compilers. +(In fact, we expect that the compilers are all fixed eight years later.) +*/ + +#define staticforward static +#define statichere static + + +/* +More conventions +================ + +Argument Checking +----------------- + +Functions that take objects as arguments normally don't check for nil +arguments, but they do check the type of the argument, and return an +error if the function doesn't apply to the type. + +Failure Modes +------------- + +Functions may fail for a variety of reasons, including running out of +memory. This is communicated to the caller in two ways: an error string +is set (see errors.h), and the function result differs: functions that +normally return a pointer return NULL for failure, functions returning +an integer return -1 (which could be a legal return value too!), and +other functions return 0 for success and -1 for failure. +Callers should always check for errors before using the result. If +an error was set, the caller must either explicitly clear it, or pass +the error on to its caller. + +Reference Counts +---------------- + +It takes a while to get used to the proper usage of reference counts. + +Functions that create an object set the reference count to 1; such new +objects must be stored somewhere or destroyed again with Py_DECREF(). +Some functions that 'store' objects, such as PyTuple_SetItem() and +PyList_SetItem(), +don't increment the reference count of the object, since the most +frequent use is to store a fresh object. Functions that 'retrieve' +objects, such as PyTuple_GetItem() and PyDict_GetItemString(), also +don't increment +the reference count, since most frequently the object is only looked at +quickly. Thus, to retrieve an object and store it again, the caller +must call Py_INCREF() explicitly. + +NOTE: functions that 'consume' a reference count, like +PyList_SetItem(), consume the reference even if the object wasn't +successfully stored, to simplify error handling. + +It seems attractive to make other functions that take an object as +argument consume a reference count; however, this may quickly get +confusing (even the current practice is already confusing). Consider +it carefully, it may save lots of calls to Py_INCREF() and Py_DECREF() at +times. +*/ + + +/* Trashcan mechanism, thanks to Christian Tismer. + +When deallocating a container object, it's possible to trigger an unbounded +chain of deallocations, as each Py_DECREF in turn drops the refcount on "the +next" object in the chain to 0. This can easily lead to stack faults, and +especially in threads (which typically have less stack space to work with). + +A container object that participates in cyclic gc can avoid this by +bracketing the body of its tp_dealloc function with a pair of macros: + +static void +mytype_dealloc(mytype *p) +{ + ... declarations go here ... + + PyObject_GC_UnTrack(p); // must untrack first + Py_TRASHCAN_SAFE_BEGIN(p) + ... The body of the deallocator goes here, including all calls ... + ... to Py_DECREF on contained objects. ... + Py_TRASHCAN_SAFE_END(p) +} + +CAUTION: Never return from the middle of the body! If the body needs to +"get out early", put a label immediately before the Py_TRASHCAN_SAFE_END +call, and goto it. Else the call-depth counter (see below) will stay +above 0 forever, and the trashcan will never get emptied. + +How it works: The BEGIN macro increments a call-depth counter. So long +as this counter is small, the body of the deallocator is run directly without +further ado. But if the counter gets large, it instead adds p to a list of +objects to be deallocated later, skips the body of the deallocator, and +resumes execution after the END macro. The tp_dealloc routine then returns +without deallocating anything (and so unbounded call-stack depth is avoided). + +When the call stack finishes unwinding again, code generated by the END macro +notices this, and calls another routine to deallocate all the objects that +may have been added to the list of deferred deallocations. In effect, a +chain of N deallocations is broken into N / PyTrash_UNWIND_LEVEL pieces, +with the call stack never exceeding a depth of PyTrash_UNWIND_LEVEL. +*/ + +/* This is the old private API, invoked by the macros before 2.7.4. + Kept for binary compatibility of extensions. */ +PyAPI_FUNC(void) _PyTrash_deposit_object(PyObject*); +PyAPI_FUNC(void) _PyTrash_destroy_chain(void); +PyAPI_DATA(int) _PyTrash_delete_nesting; +PyAPI_DATA(PyObject *) _PyTrash_delete_later; + +/* The new thread-safe private API, invoked by the macros below. */ +PyAPI_FUNC(void) _PyTrash_thread_deposit_object(PyObject*); +PyAPI_FUNC(void) _PyTrash_thread_destroy_chain(void); + +#define PyTrash_UNWIND_LEVEL 50 + +/* Note the workaround for when the thread state is NULL (issue #17703) */ +#define Py_TRASHCAN_SAFE_BEGIN(op) \ + do { \ + PyThreadState *_tstate = PyThreadState_GET(); \ + if (!_tstate || \ + _tstate->trash_delete_nesting < PyTrash_UNWIND_LEVEL) { \ + if (_tstate) \ + ++_tstate->trash_delete_nesting; + /* The body of the deallocator is here. */ +#define Py_TRASHCAN_SAFE_END(op) \ + if (_tstate) { \ + --_tstate->trash_delete_nesting; \ + if (_tstate->trash_delete_later \ + && _tstate->trash_delete_nesting <= 0) \ + _PyTrash_thread_destroy_chain(); \ + } \ + } \ + else \ + _PyTrash_thread_deposit_object((PyObject*)op); \ + } while (0); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_OBJECT_H */ diff --git a/extern/include/Python-2.7/objimpl.h b/extern/include/Python-2.7/objimpl.h new file mode 100644 index 0000000..55e83ec --- /dev/null +++ b/extern/include/Python-2.7/objimpl.h @@ -0,0 +1,354 @@ +/* The PyObject_ memory family: high-level object memory interfaces. + See pymem.h for the low-level PyMem_ family. +*/ + +#ifndef Py_OBJIMPL_H +#define Py_OBJIMPL_H + +#include "pymem.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* BEWARE: + + Each interface exports both functions and macros. Extension modules should + use the functions, to ensure binary compatibility across Python versions. + Because the Python implementation is free to change internal details, and + the macros may (or may not) expose details for speed, if you do use the + macros you must recompile your extensions with each Python release. + + Never mix calls to PyObject_ memory functions with calls to the platform + malloc/realloc/ calloc/free, or with calls to PyMem_. +*/ + +/* +Functions and macros for modules that implement new object types. + + - PyObject_New(type, typeobj) allocates memory for a new object of the given + type, and initializes part of it. 'type' must be the C structure type used + to represent the object, and 'typeobj' the address of the corresponding + type object. Reference count and type pointer are filled in; the rest of + the bytes of the object are *undefined*! The resulting expression type is + 'type *'. The size of the object is determined by the tp_basicsize field + of the type object. + + - PyObject_NewVar(type, typeobj, n) is similar but allocates a variable-size + object with room for n items. In addition to the refcount and type pointer + fields, this also fills in the ob_size field. + + - PyObject_Del(op) releases the memory allocated for an object. It does not + run a destructor -- it only frees the memory. PyObject_Free is identical. + + - PyObject_Init(op, typeobj) and PyObject_InitVar(op, typeobj, n) don't + allocate memory. Instead of a 'type' parameter, they take a pointer to a + new object (allocated by an arbitrary allocator), and initialize its object + header fields. + +Note that objects created with PyObject_{New, NewVar} are allocated using the +specialized Python allocator (implemented in obmalloc.c), if WITH_PYMALLOC is +enabled. In addition, a special debugging allocator is used if PYMALLOC_DEBUG +is also #defined. + +In case a specific form of memory management is needed (for example, if you +must use the platform malloc heap(s), or shared memory, or C++ local storage or +operator new), you must first allocate the object with your custom allocator, +then pass its pointer to PyObject_{Init, InitVar} for filling in its Python- +specific fields: reference count, type pointer, possibly others. You should +be aware that Python no control over these objects because they don't +cooperate with the Python memory manager. Such objects may not be eligible +for automatic garbage collection and you have to make sure that they are +released accordingly whenever their destructor gets called (cf. the specific +form of memory management you're using). + +Unless you have specific memory management requirements, use +PyObject_{New, NewVar, Del}. +*/ + +/* + * Raw object memory interface + * =========================== + */ + +/* Functions to call the same malloc/realloc/free as used by Python's + object allocator. If WITH_PYMALLOC is enabled, these may differ from + the platform malloc/realloc/free. The Python object allocator is + designed for fast, cache-conscious allocation of many "small" objects, + and with low hidden memory overhead. + + PyObject_Malloc(0) returns a unique non-NULL pointer if possible. + + PyObject_Realloc(NULL, n) acts like PyObject_Malloc(n). + PyObject_Realloc(p != NULL, 0) does not return NULL, or free the memory + at p. + + Returned pointers must be checked for NULL explicitly; no action is + performed on failure other than to return NULL (no warning it printed, no + exception is set, etc). + + For allocating objects, use PyObject_{New, NewVar} instead whenever + possible. The PyObject_{Malloc, Realloc, Free} family is exposed + so that you can exploit Python's small-block allocator for non-object + uses. If you must use these routines to allocate object memory, make sure + the object gets initialized via PyObject_{Init, InitVar} after obtaining + the raw memory. +*/ +PyAPI_FUNC(void *) PyObject_Malloc(size_t); +PyAPI_FUNC(void *) PyObject_Realloc(void *, size_t); +PyAPI_FUNC(void) PyObject_Free(void *); + + +/* Macros */ +#ifdef WITH_PYMALLOC +#ifdef PYMALLOC_DEBUG /* WITH_PYMALLOC && PYMALLOC_DEBUG */ +PyAPI_FUNC(void *) _PyObject_DebugMalloc(size_t nbytes); +PyAPI_FUNC(void *) _PyObject_DebugRealloc(void *p, size_t nbytes); +PyAPI_FUNC(void) _PyObject_DebugFree(void *p); +PyAPI_FUNC(void) _PyObject_DebugDumpAddress(const void *p); +PyAPI_FUNC(void) _PyObject_DebugCheckAddress(const void *p); +PyAPI_FUNC(void) _PyObject_DebugMallocStats(void); +PyAPI_FUNC(void *) _PyObject_DebugMallocApi(char api, size_t nbytes); +PyAPI_FUNC(void *) _PyObject_DebugReallocApi(char api, void *p, size_t nbytes); +PyAPI_FUNC(void) _PyObject_DebugFreeApi(char api, void *p); +PyAPI_FUNC(void) _PyObject_DebugCheckAddressApi(char api, const void *p); +PyAPI_FUNC(void *) _PyMem_DebugMalloc(size_t nbytes); +PyAPI_FUNC(void *) _PyMem_DebugRealloc(void *p, size_t nbytes); +PyAPI_FUNC(void) _PyMem_DebugFree(void *p); +#define PyObject_MALLOC _PyObject_DebugMalloc +#define PyObject_Malloc _PyObject_DebugMalloc +#define PyObject_REALLOC _PyObject_DebugRealloc +#define PyObject_Realloc _PyObject_DebugRealloc +#define PyObject_FREE _PyObject_DebugFree +#define PyObject_Free _PyObject_DebugFree + +#else /* WITH_PYMALLOC && ! PYMALLOC_DEBUG */ +#define PyObject_MALLOC PyObject_Malloc +#define PyObject_REALLOC PyObject_Realloc +#define PyObject_FREE PyObject_Free +#endif + +#else /* ! WITH_PYMALLOC */ +#define PyObject_MALLOC PyMem_MALLOC +#define PyObject_REALLOC PyMem_REALLOC +#define PyObject_FREE PyMem_FREE + +#endif /* WITH_PYMALLOC */ + +#define PyObject_Del PyObject_Free +#define PyObject_DEL PyObject_FREE + +/* for source compatibility with 2.2 */ +#define _PyObject_Del PyObject_Free + +/* + * Generic object allocator interface + * ================================== + */ + +/* Functions */ +PyAPI_FUNC(PyObject *) PyObject_Init(PyObject *, PyTypeObject *); +PyAPI_FUNC(PyVarObject *) PyObject_InitVar(PyVarObject *, + PyTypeObject *, Py_ssize_t); +PyAPI_FUNC(PyObject *) _PyObject_New(PyTypeObject *); +PyAPI_FUNC(PyVarObject *) _PyObject_NewVar(PyTypeObject *, Py_ssize_t); + +#define PyObject_New(type, typeobj) \ + ( (type *) _PyObject_New(typeobj) ) +#define PyObject_NewVar(type, typeobj, n) \ + ( (type *) _PyObject_NewVar((typeobj), (n)) ) + +/* Macros trading binary compatibility for speed. See also pymem.h. + Note that these macros expect non-NULL object pointers.*/ +#define PyObject_INIT(op, typeobj) \ + ( Py_TYPE(op) = (typeobj), _Py_NewReference((PyObject *)(op)), (op) ) +#define PyObject_INIT_VAR(op, typeobj, size) \ + ( Py_SIZE(op) = (size), PyObject_INIT((op), (typeobj)) ) + +#define _PyObject_SIZE(typeobj) ( (typeobj)->tp_basicsize ) + +/* _PyObject_VAR_SIZE returns the number of bytes (as size_t) allocated for a + vrbl-size object with nitems items, exclusive of gc overhead (if any). The + value is rounded up to the closest multiple of sizeof(void *), in order to + ensure that pointer fields at the end of the object are correctly aligned + for the platform (this is of special importance for subclasses of, e.g., + str or long, so that pointers can be stored after the embedded data). + + Note that there's no memory wastage in doing this, as malloc has to + return (at worst) pointer-aligned memory anyway. +*/ +#if ((SIZEOF_VOID_P - 1) & SIZEOF_VOID_P) != 0 +# error "_PyObject_VAR_SIZE requires SIZEOF_VOID_P be a power of 2" +#endif + +#define _PyObject_VAR_SIZE(typeobj, nitems) \ + (size_t) \ + ( ( (typeobj)->tp_basicsize + \ + (nitems)*(typeobj)->tp_itemsize + \ + (SIZEOF_VOID_P - 1) \ + ) & ~(SIZEOF_VOID_P - 1) \ + ) + +#define PyObject_NEW(type, typeobj) \ +( (type *) PyObject_Init( \ + (PyObject *) PyObject_MALLOC( _PyObject_SIZE(typeobj) ), (typeobj)) ) + +#define PyObject_NEW_VAR(type, typeobj, n) \ +( (type *) PyObject_InitVar( \ + (PyVarObject *) PyObject_MALLOC(_PyObject_VAR_SIZE((typeobj),(n)) ),\ + (typeobj), (n)) ) + +/* This example code implements an object constructor with a custom + allocator, where PyObject_New is inlined, and shows the important + distinction between two steps (at least): + 1) the actual allocation of the object storage; + 2) the initialization of the Python specific fields + in this storage with PyObject_{Init, InitVar}. + + PyObject * + YourObject_New(...) + { + PyObject *op; + + op = (PyObject *) Your_Allocator(_PyObject_SIZE(YourTypeStruct)); + if (op == NULL) + return PyErr_NoMemory(); + + PyObject_Init(op, &YourTypeStruct); + + op->ob_field = value; + ... + return op; + } + + Note that in C++, the use of the new operator usually implies that + the 1st step is performed automatically for you, so in a C++ class + constructor you would start directly with PyObject_Init/InitVar +*/ + +/* + * Garbage Collection Support + * ========================== + */ + +/* C equivalent of gc.collect(). */ +PyAPI_FUNC(Py_ssize_t) PyGC_Collect(void); + +/* Test if a type has a GC head */ +#define PyType_IS_GC(t) PyType_HasFeature((t), Py_TPFLAGS_HAVE_GC) + +/* Test if an object has a GC head */ +#define PyObject_IS_GC(o) (PyType_IS_GC(Py_TYPE(o)) && \ + (Py_TYPE(o)->tp_is_gc == NULL || Py_TYPE(o)->tp_is_gc(o))) + +PyAPI_FUNC(PyVarObject *) _PyObject_GC_Resize(PyVarObject *, Py_ssize_t); +#define PyObject_GC_Resize(type, op, n) \ + ( (type *) _PyObject_GC_Resize((PyVarObject *)(op), (n)) ) + +/* for source compatibility with 2.2 */ +#define _PyObject_GC_Del PyObject_GC_Del + +/* GC information is stored BEFORE the object structure. */ +typedef union _gc_head { + struct { + union _gc_head *gc_next; + union _gc_head *gc_prev; + Py_ssize_t gc_refs; + } gc; + long double dummy; /* force worst-case alignment */ +} PyGC_Head; + +extern PyGC_Head *_PyGC_generation0; + +#define _Py_AS_GC(o) ((PyGC_Head *)(o)-1) + +#define _PyGC_REFS_UNTRACKED (-2) +#define _PyGC_REFS_REACHABLE (-3) +#define _PyGC_REFS_TENTATIVELY_UNREACHABLE (-4) + +/* Tell the GC to track this object. NB: While the object is tracked the + * collector it must be safe to call the ob_traverse method. */ +#define _PyObject_GC_TRACK(o) do { \ + PyGC_Head *g = _Py_AS_GC(o); \ + if (g->gc.gc_refs != _PyGC_REFS_UNTRACKED) \ + Py_FatalError("GC object already tracked"); \ + g->gc.gc_refs = _PyGC_REFS_REACHABLE; \ + g->gc.gc_next = _PyGC_generation0; \ + g->gc.gc_prev = _PyGC_generation0->gc.gc_prev; \ + g->gc.gc_prev->gc.gc_next = g; \ + _PyGC_generation0->gc.gc_prev = g; \ + } while (0); + +/* Tell the GC to stop tracking this object. + * gc_next doesn't need to be set to NULL, but doing so is a good + * way to provoke memory errors if calling code is confused. + */ +#define _PyObject_GC_UNTRACK(o) do { \ + PyGC_Head *g = _Py_AS_GC(o); \ + assert(g->gc.gc_refs != _PyGC_REFS_UNTRACKED); \ + g->gc.gc_refs = _PyGC_REFS_UNTRACKED; \ + g->gc.gc_prev->gc.gc_next = g->gc.gc_next; \ + g->gc.gc_next->gc.gc_prev = g->gc.gc_prev; \ + g->gc.gc_next = NULL; \ + } while (0); + +/* True if the object is currently tracked by the GC. */ +#define _PyObject_GC_IS_TRACKED(o) \ + ((_Py_AS_GC(o))->gc.gc_refs != _PyGC_REFS_UNTRACKED) + +/* True if the object may be tracked by the GC in the future, or already is. + This can be useful to implement some optimizations. */ +#define _PyObject_GC_MAY_BE_TRACKED(obj) \ + (PyObject_IS_GC(obj) && \ + (!PyTuple_CheckExact(obj) || _PyObject_GC_IS_TRACKED(obj))) + + +PyAPI_FUNC(PyObject *) _PyObject_GC_Malloc(size_t); +PyAPI_FUNC(PyObject *) _PyObject_GC_New(PyTypeObject *); +PyAPI_FUNC(PyVarObject *) _PyObject_GC_NewVar(PyTypeObject *, Py_ssize_t); +PyAPI_FUNC(void) PyObject_GC_Track(void *); +PyAPI_FUNC(void) PyObject_GC_UnTrack(void *); +PyAPI_FUNC(void) PyObject_GC_Del(void *); + +#define PyObject_GC_New(type, typeobj) \ + ( (type *) _PyObject_GC_New(typeobj) ) +#define PyObject_GC_NewVar(type, typeobj, n) \ + ( (type *) _PyObject_GC_NewVar((typeobj), (n)) ) + + +/* Utility macro to help write tp_traverse functions. + * To use this macro, the tp_traverse function must name its arguments + * "visit" and "arg". This is intended to keep tp_traverse functions + * looking as much alike as possible. + */ +#define Py_VISIT(op) \ + do { \ + if (op) { \ + int vret = visit((PyObject *)(op), arg); \ + if (vret) \ + return vret; \ + } \ + } while (0) + +/* This is here for the sake of backwards compatibility. Extensions that + * use the old GC API will still compile but the objects will not be + * tracked by the GC. */ +#define PyGC_HEAD_SIZE 0 +#define PyObject_GC_Init(op) +#define PyObject_GC_Fini(op) +#define PyObject_AS_GC(op) (op) +#define PyObject_FROM_GC(op) (op) + + +/* Test if a type supports weak references */ +#define PyType_SUPPORTS_WEAKREFS(t) \ + (PyType_HasFeature((t), Py_TPFLAGS_HAVE_WEAKREFS) \ + && ((t)->tp_weaklistoffset > 0)) + +#define PyObject_GET_WEAKREFS_LISTPTR(o) \ + ((PyObject **) (((char *) (o)) + Py_TYPE(o)->tp_weaklistoffset)) + +#ifdef __cplusplus +} +#endif +#endif /* !Py_OBJIMPL_H */ diff --git a/extern/include/Python-2.7/opcode.h b/extern/include/Python-2.7/opcode.h new file mode 100644 index 0000000..9764109 --- /dev/null +++ b/extern/include/Python-2.7/opcode.h @@ -0,0 +1,162 @@ +#ifndef Py_OPCODE_H +#define Py_OPCODE_H +#ifdef __cplusplus +extern "C" { +#endif + + +/* Instruction opcodes for compiled code */ + +#define STOP_CODE 0 +#define POP_TOP 1 +#define ROT_TWO 2 +#define ROT_THREE 3 +#define DUP_TOP 4 +#define ROT_FOUR 5 +#define NOP 9 + +#define UNARY_POSITIVE 10 +#define UNARY_NEGATIVE 11 +#define UNARY_NOT 12 +#define UNARY_CONVERT 13 + +#define UNARY_INVERT 15 + +#define BINARY_POWER 19 + +#define BINARY_MULTIPLY 20 +#define BINARY_DIVIDE 21 +#define BINARY_MODULO 22 +#define BINARY_ADD 23 +#define BINARY_SUBTRACT 24 +#define BINARY_SUBSCR 25 +#define BINARY_FLOOR_DIVIDE 26 +#define BINARY_TRUE_DIVIDE 27 +#define INPLACE_FLOOR_DIVIDE 28 +#define INPLACE_TRUE_DIVIDE 29 + +#define SLICE 30 +/* Also uses 31-33 */ + +#define STORE_SLICE 40 +/* Also uses 41-43 */ + +#define DELETE_SLICE 50 +/* Also uses 51-53 */ + +#define STORE_MAP 54 +#define INPLACE_ADD 55 +#define INPLACE_SUBTRACT 56 +#define INPLACE_MULTIPLY 57 +#define INPLACE_DIVIDE 58 +#define INPLACE_MODULO 59 +#define STORE_SUBSCR 60 +#define DELETE_SUBSCR 61 + +#define BINARY_LSHIFT 62 +#define BINARY_RSHIFT 63 +#define BINARY_AND 64 +#define BINARY_XOR 65 +#define BINARY_OR 66 +#define INPLACE_POWER 67 +#define GET_ITER 68 + +#define PRINT_EXPR 70 +#define PRINT_ITEM 71 +#define PRINT_NEWLINE 72 +#define PRINT_ITEM_TO 73 +#define PRINT_NEWLINE_TO 74 +#define INPLACE_LSHIFT 75 +#define INPLACE_RSHIFT 76 +#define INPLACE_AND 77 +#define INPLACE_XOR 78 +#define INPLACE_OR 79 +#define BREAK_LOOP 80 +#define WITH_CLEANUP 81 +#define LOAD_LOCALS 82 +#define RETURN_VALUE 83 +#define IMPORT_STAR 84 +#define EXEC_STMT 85 +#define YIELD_VALUE 86 +#define POP_BLOCK 87 +#define END_FINALLY 88 +#define BUILD_CLASS 89 + +#define HAVE_ARGUMENT 90 /* Opcodes from here have an argument: */ + +#define STORE_NAME 90 /* Index in name list */ +#define DELETE_NAME 91 /* "" */ +#define UNPACK_SEQUENCE 92 /* Number of sequence items */ +#define FOR_ITER 93 +#define LIST_APPEND 94 + +#define STORE_ATTR 95 /* Index in name list */ +#define DELETE_ATTR 96 /* "" */ +#define STORE_GLOBAL 97 /* "" */ +#define DELETE_GLOBAL 98 /* "" */ +#define DUP_TOPX 99 /* number of items to duplicate */ +#define LOAD_CONST 100 /* Index in const list */ +#define LOAD_NAME 101 /* Index in name list */ +#define BUILD_TUPLE 102 /* Number of tuple items */ +#define BUILD_LIST 103 /* Number of list items */ +#define BUILD_SET 104 /* Number of set items */ +#define BUILD_MAP 105 /* Always zero for now */ +#define LOAD_ATTR 106 /* Index in name list */ +#define COMPARE_OP 107 /* Comparison operator */ +#define IMPORT_NAME 108 /* Index in name list */ +#define IMPORT_FROM 109 /* Index in name list */ +#define JUMP_FORWARD 110 /* Number of bytes to skip */ + +#define JUMP_IF_FALSE_OR_POP 111 /* Target byte offset from beginning + of code */ +#define JUMP_IF_TRUE_OR_POP 112 /* "" */ +#define JUMP_ABSOLUTE 113 /* "" */ +#define POP_JUMP_IF_FALSE 114 /* "" */ +#define POP_JUMP_IF_TRUE 115 /* "" */ + +#define LOAD_GLOBAL 116 /* Index in name list */ + +#define CONTINUE_LOOP 119 /* Start of loop (absolute) */ +#define SETUP_LOOP 120 /* Target address (relative) */ +#define SETUP_EXCEPT 121 /* "" */ +#define SETUP_FINALLY 122 /* "" */ + +#define LOAD_FAST 124 /* Local variable number */ +#define STORE_FAST 125 /* Local variable number */ +#define DELETE_FAST 126 /* Local variable number */ + +#define RAISE_VARARGS 130 /* Number of raise arguments (1, 2 or 3) */ +/* CALL_FUNCTION_XXX opcodes defined below depend on this definition */ +#define CALL_FUNCTION 131 /* #args + (#kwargs<<8) */ +#define MAKE_FUNCTION 132 /* #defaults */ +#define BUILD_SLICE 133 /* Number of items */ + +#define MAKE_CLOSURE 134 /* #free vars */ +#define LOAD_CLOSURE 135 /* Load free variable from closure */ +#define LOAD_DEREF 136 /* Load and dereference from closure cell */ +#define STORE_DEREF 137 /* Store into cell */ + +/* The next 3 opcodes must be contiguous and satisfy + (CALL_FUNCTION_VAR - CALL_FUNCTION) & 3 == 1 */ +#define CALL_FUNCTION_VAR 140 /* #args + (#kwargs<<8) */ +#define CALL_FUNCTION_KW 141 /* #args + (#kwargs<<8) */ +#define CALL_FUNCTION_VAR_KW 142 /* #args + (#kwargs<<8) */ + +#define SETUP_WITH 143 + +/* Support for opargs more than 16 bits long */ +#define EXTENDED_ARG 145 + +#define SET_ADD 146 +#define MAP_ADD 147 + + +enum cmp_op {PyCmp_LT=Py_LT, PyCmp_LE=Py_LE, PyCmp_EQ=Py_EQ, PyCmp_NE=Py_NE, PyCmp_GT=Py_GT, PyCmp_GE=Py_GE, + PyCmp_IN, PyCmp_NOT_IN, PyCmp_IS, PyCmp_IS_NOT, PyCmp_EXC_MATCH, PyCmp_BAD}; + +#define HAS_ARG(op) ((op) >= HAVE_ARGUMENT) + +#ifdef __cplusplus +} +#endif +#endif /* !Py_OPCODE_H */ diff --git a/extern/include/Python-2.7/osdefs.h b/extern/include/Python-2.7/osdefs.h new file mode 100644 index 0000000..77af923 --- /dev/null +++ b/extern/include/Python-2.7/osdefs.h @@ -0,0 +1,63 @@ +#ifndef Py_OSDEFS_H +#define Py_OSDEFS_H +#ifdef __cplusplus +extern "C" { +#endif + + +/* Operating system dependencies */ + +/* Mod by chrish: QNX has WATCOM, but isn't DOS */ +#if !defined(__QNX__) +#if defined(MS_WINDOWS) || defined(__BORLANDC__) || defined(__WATCOMC__) || defined(__DJGPP__) || defined(PYOS_OS2) +#if defined(PYOS_OS2) && defined(PYCC_GCC) +#define MAXPATHLEN 260 +#define SEP '/' +#define ALTSEP '\\' +#else +#define SEP '\\' +#define ALTSEP '/' +#define MAXPATHLEN 256 +#endif +#define DELIM ';' +#endif +#endif + +#ifdef RISCOS +#define SEP '.' +#define MAXPATHLEN 256 +#define DELIM ',' +#endif + + +/* Filename separator */ +#ifndef SEP +#define SEP '/' +#endif + +/* Max pathname length */ +#ifdef __hpux +#include +#include +#ifndef PATH_MAX +#define PATH_MAX MAXPATHLEN +#endif +#endif + +#ifndef MAXPATHLEN +#if defined(PATH_MAX) && PATH_MAX > 1024 +#define MAXPATHLEN PATH_MAX +#else +#define MAXPATHLEN 1024 +#endif +#endif + +/* Search path entry delimiter */ +#ifndef DELIM +#define DELIM ':' +#endif + +#ifdef __cplusplus +} +#endif +#endif /* !Py_OSDEFS_H */ diff --git a/extern/include/Python-2.7/parsetok.h b/extern/include/Python-2.7/parsetok.h new file mode 100644 index 0000000..ec1eb6f --- /dev/null +++ b/extern/include/Python-2.7/parsetok.h @@ -0,0 +1,64 @@ + +/* Parser-tokenizer link interface */ + +#ifndef Py_PARSETOK_H +#define Py_PARSETOK_H +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct { + int error; + const char *filename; + int lineno; + int offset; + char *text; + int token; + int expected; +} perrdetail; + +#if 0 +#define PyPARSE_YIELD_IS_KEYWORD 0x0001 +#endif + +#define PyPARSE_DONT_IMPLY_DEDENT 0x0002 + +#if 0 +#define PyPARSE_WITH_IS_KEYWORD 0x0003 +#endif + +#define PyPARSE_PRINT_IS_FUNCTION 0x0004 +#define PyPARSE_UNICODE_LITERALS 0x0008 + + + +PyAPI_FUNC(node *) PyParser_ParseString(const char *, grammar *, int, + perrdetail *); +PyAPI_FUNC(node *) PyParser_ParseFile (FILE *, const char *, grammar *, int, + char *, char *, perrdetail *); + +PyAPI_FUNC(node *) PyParser_ParseStringFlags(const char *, grammar *, int, + perrdetail *, int); +PyAPI_FUNC(node *) PyParser_ParseFileFlags(FILE *, const char *, grammar *, + int, char *, char *, + perrdetail *, int); +PyAPI_FUNC(node *) PyParser_ParseFileFlagsEx(FILE *, const char *, grammar *, + int, char *, char *, + perrdetail *, int *); + +PyAPI_FUNC(node *) PyParser_ParseStringFlagsFilename(const char *, + const char *, + grammar *, int, + perrdetail *, int); +PyAPI_FUNC(node *) PyParser_ParseStringFlagsFilenameEx(const char *, + const char *, + grammar *, int, + perrdetail *, int *); + +/* Note that he following function is defined in pythonrun.c not parsetok.c. */ +PyAPI_FUNC(void) PyParser_SetError(perrdetail *); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_PARSETOK_H */ diff --git a/extern/include/Python-2.7/patchlevel.h b/extern/include/Python-2.7/patchlevel.h new file mode 100644 index 0000000..a94f3cb --- /dev/null +++ b/extern/include/Python-2.7/patchlevel.h @@ -0,0 +1,43 @@ + +/* Newfangled version identification scheme. + + This scheme was added in Python 1.5.2b2; before that time, only PATCHLEVEL + was available. To test for presence of the scheme, test for + defined(PY_MAJOR_VERSION). + + When the major or minor version changes, the VERSION variable in + configure.ac must also be changed. + + There is also (independent) API version information in modsupport.h. +*/ + +/* Values for PY_RELEASE_LEVEL */ +#define PY_RELEASE_LEVEL_ALPHA 0xA +#define PY_RELEASE_LEVEL_BETA 0xB +#define PY_RELEASE_LEVEL_GAMMA 0xC /* For release candidates */ +#define PY_RELEASE_LEVEL_FINAL 0xF /* Serial should be 0 here */ + /* Higher for patch releases */ + +/* Version parsed out into numeric values */ +/*--start constants--*/ +#define PY_MAJOR_VERSION 2 +#define PY_MINOR_VERSION 7 +#define PY_MICRO_VERSION 6 +#define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_FINAL +#define PY_RELEASE_SERIAL 0 + +/* Version as a string */ +#define PY_VERSION "2.7.6" +/*--end constants--*/ + +/* Subversion Revision number of this file (not of the repository). Empty + since Mercurial migration. */ +#define PY_PATCHLEVEL_REVISION "" + +/* Version as a single 4-byte hex number, e.g. 0x010502B2 == 1.5.2b2. + Use this for numeric comparisons, e.g. #if PY_VERSION_HEX >= ... */ +#define PY_VERSION_HEX ((PY_MAJOR_VERSION << 24) | \ + (PY_MINOR_VERSION << 16) | \ + (PY_MICRO_VERSION << 8) | \ + (PY_RELEASE_LEVEL << 4) | \ + (PY_RELEASE_SERIAL << 0)) diff --git a/extern/include/Python-2.7/pgen.h b/extern/include/Python-2.7/pgen.h new file mode 100644 index 0000000..8a325ed --- /dev/null +++ b/extern/include/Python-2.7/pgen.h @@ -0,0 +1,18 @@ +#ifndef Py_PGEN_H +#define Py_PGEN_H +#ifdef __cplusplus +extern "C" { +#endif + + +/* Parser generator interface */ + +extern grammar *meta_grammar(void); + +struct _node; +extern grammar *pgen(struct _node *); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_PGEN_H */ diff --git a/extern/include/Python-2.7/pgenheaders.h b/extern/include/Python-2.7/pgenheaders.h new file mode 100644 index 0000000..2049ae3 --- /dev/null +++ b/extern/include/Python-2.7/pgenheaders.h @@ -0,0 +1,42 @@ +#ifndef Py_PGENHEADERS_H +#define Py_PGENHEADERS_H +#ifdef __cplusplus +extern "C" { +#endif + + +/* Include files and extern declarations used by most of the parser. */ + +#include "Python.h" + +PyAPI_FUNC(void) PySys_WriteStdout(const char *format, ...) + Py_GCC_ATTRIBUTE((format(printf, 1, 2))); +PyAPI_FUNC(void) PySys_WriteStderr(const char *format, ...) + Py_GCC_ATTRIBUTE((format(printf, 1, 2))); + +#define addarc _Py_addarc +#define addbit _Py_addbit +#define adddfa _Py_adddfa +#define addfirstsets _Py_addfirstsets +#define addlabel _Py_addlabel +#define addstate _Py_addstate +#define delbitset _Py_delbitset +#define dumptree _Py_dumptree +#define findlabel _Py_findlabel +#define mergebitset _Py_mergebitset +#define meta_grammar _Py_meta_grammar +#define newbitset _Py_newbitset +#define newgrammar _Py_newgrammar +#define pgen _Py_pgen +#define printgrammar _Py_printgrammar +#define printnonterminals _Py_printnonterminals +#define printtree _Py_printtree +#define samebitset _Py_samebitset +#define showtree _Py_showtree +#define tok_dump _Py_tok_dump +#define translatelabels _Py_translatelabels + +#ifdef __cplusplus +} +#endif +#endif /* !Py_PGENHEADERS_H */ diff --git a/extern/include/Python-2.7/py_curses.h b/extern/include/Python-2.7/py_curses.h new file mode 100644 index 0000000..657816c --- /dev/null +++ b/extern/include/Python-2.7/py_curses.h @@ -0,0 +1,176 @@ + +#ifndef Py_CURSES_H +#define Py_CURSES_H + +#ifdef __APPLE__ +/* +** On Mac OS X 10.2 [n]curses.h and stdlib.h use different guards +** against multiple definition of wchar_t. +*/ +#ifdef _BSD_WCHAR_T_DEFINED_ +#define _WCHAR_T +#endif + +/* the following define is necessary for OS X 10.6; without it, the + Apple-supplied ncurses.h sets NCURSES_OPAQUE to 1, and then Python + can't get at the WINDOW flags field. */ +#define NCURSES_OPAQUE 0 +#endif /* __APPLE__ */ + +#ifdef __FreeBSD__ +/* +** On FreeBSD, [n]curses.h and stdlib.h/wchar.h use different guards +** against multiple definition of wchar_t and wint_t. +*/ +#ifdef _XOPEN_SOURCE_EXTENDED +#ifndef __FreeBSD_version +#include +#endif +#if __FreeBSD_version >= 500000 +#ifndef __wchar_t +#define __wchar_t +#endif +#ifndef __wint_t +#define __wint_t +#endif +#else +#ifndef _WCHAR_T +#define _WCHAR_T +#endif +#ifndef _WINT_T +#define _WINT_T +#endif +#endif +#endif +#endif + +#ifdef HAVE_NCURSES_H +#include +#else +#include +#ifdef HAVE_TERM_H +/* for tigetstr, which is not declared in SysV curses */ +#include +#endif +#endif + +#ifdef HAVE_NCURSES_H +/* configure was checking , but we will + use , which has all these features. */ +#ifndef WINDOW_HAS_FLAGS +#define WINDOW_HAS_FLAGS 1 +#endif +#ifndef MVWDELCH_IS_EXPRESSION +#define MVWDELCH_IS_EXPRESSION 1 +#endif +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#define PyCurses_API_pointers 4 + +/* Type declarations */ + +typedef struct { + PyObject_HEAD + WINDOW *win; +} PyCursesWindowObject; + +#define PyCursesWindow_Check(v) (Py_TYPE(v) == &PyCursesWindow_Type) + +#define PyCurses_CAPSULE_NAME "_curses._C_API" + + +#ifdef CURSES_MODULE +/* This section is used when compiling _cursesmodule.c */ + +#else +/* This section is used in modules that use the _cursesmodule API */ + +static void **PyCurses_API; + +#define PyCursesWindow_Type (*(PyTypeObject *) PyCurses_API[0]) +#define PyCursesSetupTermCalled {if (! ((int (*)(void))PyCurses_API[1]) () ) return NULL;} +#define PyCursesInitialised {if (! ((int (*)(void))PyCurses_API[2]) () ) return NULL;} +#define PyCursesInitialisedColor {if (! ((int (*)(void))PyCurses_API[3]) () ) return NULL;} + +#define import_curses() \ + PyCurses_API = (void **)PyCapsule_Import(PyCurses_CAPSULE_NAME, 1); + +#endif + +/* general error messages */ +static char *catchall_ERR = "curses function returned ERR"; +static char *catchall_NULL = "curses function returned NULL"; + +/* Function Prototype Macros - They are ugly but very, very useful. ;-) + + X - function name + TYPE - parameter Type + ERGSTR - format string for construction of the return value + PARSESTR - format string for argument parsing + */ + +#define NoArgNoReturnFunction(X) \ +static PyObject *PyCurses_ ## X (PyObject *self) \ +{ \ + PyCursesInitialised \ + return PyCursesCheckERR(X(), # X); } + +#define NoArgOrFlagNoReturnFunction(X) \ +static PyObject *PyCurses_ ## X (PyObject *self, PyObject *args) \ +{ \ + int flag = 0; \ + PyCursesInitialised \ + switch(PyTuple_Size(args)) { \ + case 0: \ + return PyCursesCheckERR(X(), # X); \ + case 1: \ + if (!PyArg_ParseTuple(args, "i;True(1) or False(0)", &flag)) return NULL; \ + if (flag) return PyCursesCheckERR(X(), # X); \ + else return PyCursesCheckERR(no ## X (), # X); \ + default: \ + PyErr_SetString(PyExc_TypeError, # X " requires 0 or 1 arguments"); \ + return NULL; } } + +#define NoArgReturnIntFunction(X) \ +static PyObject *PyCurses_ ## X (PyObject *self) \ +{ \ + PyCursesInitialised \ + return PyInt_FromLong((long) X()); } + + +#define NoArgReturnStringFunction(X) \ +static PyObject *PyCurses_ ## X (PyObject *self) \ +{ \ + PyCursesInitialised \ + return PyString_FromString(X()); } + +#define NoArgTrueFalseFunction(X) \ +static PyObject *PyCurses_ ## X (PyObject *self) \ +{ \ + PyCursesInitialised \ + if (X () == FALSE) { \ + Py_INCREF(Py_False); \ + return Py_False; \ + } \ + Py_INCREF(Py_True); \ + return Py_True; } + +#define NoArgNoReturnVoidFunction(X) \ +static PyObject *PyCurses_ ## X (PyObject *self) \ +{ \ + PyCursesInitialised \ + X(); \ + Py_INCREF(Py_None); \ + return Py_None; } + +#ifdef __cplusplus +} +#endif + +#endif /* !defined(Py_CURSES_H) */ + + diff --git a/extern/include/Python-2.7/pyarena.h b/extern/include/Python-2.7/pyarena.h new file mode 100644 index 0000000..5f193fe --- /dev/null +++ b/extern/include/Python-2.7/pyarena.h @@ -0,0 +1,62 @@ +/* An arena-like memory interface for the compiler. + */ + +#ifndef Py_PYARENA_H +#define Py_PYARENA_H + +#ifdef __cplusplus +extern "C" { +#endif + + typedef struct _arena PyArena; + + /* PyArena_New() and PyArena_Free() create a new arena and free it, + respectively. Once an arena has been created, it can be used + to allocate memory via PyArena_Malloc(). Pointers to PyObject can + also be registered with the arena via PyArena_AddPyObject(), and the + arena will ensure that the PyObjects stay alive at least until + PyArena_Free() is called. When an arena is freed, all the memory it + allocated is freed, the arena releases internal references to registered + PyObject*, and none of its pointers are valid. + XXX (tim) What does "none of its pointers are valid" mean? Does it + XXX mean that pointers previously obtained via PyArena_Malloc() are + XXX no longer valid? (That's clearly true, but not sure that's what + XXX the text is trying to say.) + + PyArena_New() returns an arena pointer. On error, it + returns a negative number and sets an exception. + XXX (tim): Not true. On error, PyArena_New() actually returns NULL, + XXX and looks like it may or may not set an exception (e.g., if the + XXX internal PyList_New(0) returns NULL, PyArena_New() passes that on + XXX and an exception is set; OTOH, if the internal + XXX block_new(DEFAULT_BLOCK_SIZE) returns NULL, that's passed on but + XXX an exception is not set in that case). + */ + PyAPI_FUNC(PyArena *) PyArena_New(void); + PyAPI_FUNC(void) PyArena_Free(PyArena *); + + /* Mostly like malloc(), return the address of a block of memory spanning + * `size` bytes, or return NULL (without setting an exception) if enough + * new memory can't be obtained. Unlike malloc(0), PyArena_Malloc() with + * size=0 does not guarantee to return a unique pointer (the pointer + * returned may equal one or more other pointers obtained from + * PyArena_Malloc()). + * Note that pointers obtained via PyArena_Malloc() must never be passed to + * the system free() or realloc(), or to any of Python's similar memory- + * management functions. PyArena_Malloc()-obtained pointers remain valid + * until PyArena_Free(ar) is called, at which point all pointers obtained + * from the arena `ar` become invalid simultaneously. + */ + PyAPI_FUNC(void *) PyArena_Malloc(PyArena *, size_t size); + + /* This routine isn't a proper arena allocation routine. It takes + * a PyObject* and records it so that it can be DECREFed when the + * arena is freed. + */ + PyAPI_FUNC(int) PyArena_AddPyObject(PyArena *, PyObject *); + +#ifdef __cplusplus +} +#endif + +#endif /* !Py_PYARENA_H */ diff --git a/extern/include/Python-2.7/pycapsule.h b/extern/include/Python-2.7/pycapsule.h new file mode 100644 index 0000000..cd682fc --- /dev/null +++ b/extern/include/Python-2.7/pycapsule.h @@ -0,0 +1,56 @@ + +/* Capsule objects let you wrap a C "void *" pointer in a Python + object. They're a way of passing data through the Python interpreter + without creating your own custom type. + + Capsules are used for communication between extension modules. + They provide a way for an extension module to export a C interface + to other extension modules, so that extension modules can use the + Python import mechanism to link to one another. + + For more information, please see "c-api/capsule.html" in the + documentation. +*/ + +#ifndef Py_CAPSULE_H +#define Py_CAPSULE_H +#ifdef __cplusplus +extern "C" { +#endif + +PyAPI_DATA(PyTypeObject) PyCapsule_Type; + +typedef void (*PyCapsule_Destructor)(PyObject *); + +#define PyCapsule_CheckExact(op) (Py_TYPE(op) == &PyCapsule_Type) + + +PyAPI_FUNC(PyObject *) PyCapsule_New( + void *pointer, + const char *name, + PyCapsule_Destructor destructor); + +PyAPI_FUNC(void *) PyCapsule_GetPointer(PyObject *capsule, const char *name); + +PyAPI_FUNC(PyCapsule_Destructor) PyCapsule_GetDestructor(PyObject *capsule); + +PyAPI_FUNC(const char *) PyCapsule_GetName(PyObject *capsule); + +PyAPI_FUNC(void *) PyCapsule_GetContext(PyObject *capsule); + +PyAPI_FUNC(int) PyCapsule_IsValid(PyObject *capsule, const char *name); + +PyAPI_FUNC(int) PyCapsule_SetPointer(PyObject *capsule, void *pointer); + +PyAPI_FUNC(int) PyCapsule_SetDestructor(PyObject *capsule, PyCapsule_Destructor destructor); + +PyAPI_FUNC(int) PyCapsule_SetName(PyObject *capsule, const char *name); + +PyAPI_FUNC(int) PyCapsule_SetContext(PyObject *capsule, void *context); + +PyAPI_FUNC(void *) PyCapsule_Import(const char *name, int no_block); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_CAPSULE_H */ diff --git a/extern/include/Python-2.7/pyconfig.h b/extern/include/Python-2.7/pyconfig.h new file mode 100644 index 0000000..2b16665 --- /dev/null +++ b/extern/include/Python-2.7/pyconfig.h @@ -0,0 +1,759 @@ +#ifndef Py_CONFIG_H +#define Py_CONFIG_H + +/* pyconfig.h. NOT Generated automatically by configure. + +This is a manually maintained version used for the Watcom, +Borland and Microsoft Visual C++ compilers. It is a +standard part of the Python distribution. + +WINDOWS DEFINES: +The code specific to Windows should be wrapped around one of +the following #defines + +MS_WIN64 - Code specific to the MS Win64 API +MS_WIN32 - Code specific to the MS Win32 (and Win64) API (obsolete, this covers all supported APIs) +MS_WINDOWS - Code specific to Windows, but all versions. +MS_WINCE - Code specific to Windows CE +Py_ENABLE_SHARED - Code if the Python core is built as a DLL. + +Also note that neither "_M_IX86" or "_MSC_VER" should be used for +any purpose other than "Windows Intel x86 specific" and "Microsoft +compiler specific". Therefore, these should be very rare. + + +NOTE: The following symbols are deprecated: +NT, USE_DL_EXPORT, USE_DL_IMPORT, DL_EXPORT, DL_IMPORT +MS_CORE_DLL. + +WIN32 is still required for the locale module. + +*/ + +#ifdef _WIN32_WCE +#define MS_WINCE +#endif + +/* Deprecated USE_DL_EXPORT macro - please use Py_BUILD_CORE */ +#ifdef USE_DL_EXPORT +# define Py_BUILD_CORE +#endif /* USE_DL_EXPORT */ + +/* Visual Studio 2005 introduces deprecation warnings for + "insecure" and POSIX functions. The insecure functions should + be replaced by *_s versions (according to Microsoft); the + POSIX functions by _* versions (which, according to Microsoft, + would be ISO C conforming). Neither renaming is feasible, so + we just silence the warnings. */ + +#ifndef _CRT_SECURE_NO_DEPRECATE +#define _CRT_SECURE_NO_DEPRECATE 1 +#endif +#ifndef _CRT_NONSTDC_NO_DEPRECATE +#define _CRT_NONSTDC_NO_DEPRECATE 1 +#endif + +/* Windows CE does not have these */ +#ifndef MS_WINCE +#define HAVE_IO_H +#define HAVE_SYS_UTIME_H +#define HAVE_TEMPNAM +#define HAVE_TMPFILE +#define HAVE_TMPNAM +#define HAVE_CLOCK +#define HAVE_STRERROR +#endif + +#ifdef HAVE_IO_H +#include +#endif + +#define HAVE_HYPOT +#define HAVE_STRFTIME +#define DONT_HAVE_SIG_ALARM +#define DONT_HAVE_SIG_PAUSE +#define LONG_BIT 32 +#define WORD_BIT 32 +#define PREFIX "" +#define EXEC_PREFIX "" + +#define MS_WIN32 /* only support win32 and greater. */ +#define MS_WINDOWS +#ifndef PYTHONPATH +# define PYTHONPATH ".\\DLLs;.\\lib;.\\lib\\plat-win;.\\lib\\lib-tk" +#endif +#define NT_THREADS +#define WITH_THREAD +#ifndef NETSCAPE_PI +#define USE_SOCKET +#endif + +/* CE6 doesn't have strdup() but _strdup(). Assume the same for earlier versions. */ +#if defined(MS_WINCE) +# include +# define strdup _strdup +#endif + +#ifdef MS_WINCE +/* Windows CE does not support environment variables */ +#define getenv(v) (NULL) +#define environ (NULL) +#endif + +/* Compiler specific defines */ + +/* ------------------------------------------------------------------------*/ +/* Microsoft C defines _MSC_VER */ +#ifdef _MSC_VER + +/* We want COMPILER to expand to a string containing _MSC_VER's *value*. + * This is horridly tricky, because the stringization operator only works + * on macro arguments, and doesn't evaluate macros passed *as* arguments. + * Attempts simpler than the following appear doomed to produce "_MSC_VER" + * literally in the string. + */ +#define _Py_PASTE_VERSION(SUFFIX) \ + ("[MSC v." _Py_STRINGIZE(_MSC_VER) " " SUFFIX "]") +/* e.g., this produces, after compile-time string catenation, + * ("[MSC v.1200 32 bit (Intel)]") + * + * _Py_STRINGIZE(_MSC_VER) expands to + * _Py_STRINGIZE1((_MSC_VER)) expands to + * _Py_STRINGIZE2(_MSC_VER) but as this call is the result of token-pasting + * it's scanned again for macros and so further expands to (under MSVC 6) + * _Py_STRINGIZE2(1200) which then expands to + * "1200" + */ +#define _Py_STRINGIZE(X) _Py_STRINGIZE1((X)) +#define _Py_STRINGIZE1(X) _Py_STRINGIZE2 ## X +#define _Py_STRINGIZE2(X) #X + +/* MSVC defines _WINxx to differentiate the windows platform types + + Note that for compatibility reasons _WIN32 is defined on Win32 + *and* on Win64. For the same reasons, in Python, MS_WIN32 is + defined on Win32 *and* Win64. Win32 only code must therefore be + guarded as follows: + #if defined(MS_WIN32) && !defined(MS_WIN64) + Some modules are disabled on Itanium processors, therefore we + have MS_WINI64 set for those targets, otherwise MS_WINX64 +*/ +#ifdef _WIN64 +#define MS_WIN64 +#endif + +/* set the COMPILER */ +#ifdef MS_WIN64 +#if defined(_M_IA64) +#define COMPILER _Py_PASTE_VERSION("64 bit (Itanium)") +#define MS_WINI64 +#elif defined(_M_X64) || defined(_M_AMD64) +#define COMPILER _Py_PASTE_VERSION("64 bit (AMD64)") +#define MS_WINX64 +#else +#define COMPILER _Py_PASTE_VERSION("64 bit (Unknown)") +#endif +#endif /* MS_WIN64 */ + +/* set the version macros for the windows headers */ +#ifdef MS_WINX64 +/* 64 bit only runs on XP or greater */ +#define Py_WINVER _WIN32_WINNT_WINXP +#define Py_NTDDI NTDDI_WINXP +#else +/* Python 2.6+ requires Windows 2000 or greater */ +#ifdef _WIN32_WINNT_WIN2K +#define Py_WINVER _WIN32_WINNT_WIN2K +#else +#define Py_WINVER 0x0500 +#endif +#define Py_NTDDI NTDDI_WIN2KSP4 +#endif + +/* We only set these values when building Python - we don't want to force + these values on extensions, as that will affect the prototypes and + structures exposed in the Windows headers. Even when building Python, we + allow a single source file to override this - they may need access to + structures etc so it can optionally use new Windows features if it + determines at runtime they are available. +*/ +#if defined(Py_BUILD_CORE) || defined(Py_BUILD_CORE_MODULE) +#ifndef NTDDI_VERSION +#define NTDDI_VERSION Py_NTDDI +#endif +#ifndef WINVER +#define WINVER Py_WINVER +#endif +#ifndef _WIN32_WINNT +#define _WIN32_WINNT Py_WINVER +#endif +#endif + +/* _W64 is not defined for VC6 or eVC4 */ +#ifndef _W64 +#define _W64 +#endif + +/* Define like size_t, omitting the "unsigned" */ +#ifdef MS_WIN64 +typedef __int64 ssize_t; +#else +typedef _W64 int ssize_t; +#endif +#define HAVE_SSIZE_T 1 + +#if defined(MS_WIN32) && !defined(MS_WIN64) +#ifdef _M_IX86 +#define COMPILER _Py_PASTE_VERSION("32 bit (Intel)") +#else +#define COMPILER _Py_PASTE_VERSION("32 bit (Unknown)") +#endif +#endif /* MS_WIN32 && !MS_WIN64 */ + +typedef int pid_t; + +#include +#define Py_IS_NAN _isnan +#define Py_IS_INFINITY(X) (!_finite(X) && !_isnan(X)) +#define Py_IS_FINITE(X) _finite(X) +#define copysign _copysign +#define hypot _hypot + +#endif /* _MSC_VER */ + +/* define some ANSI types that are not defined in earlier Win headers */ +#if defined(_MSC_VER) && _MSC_VER >= 1200 +/* This file only exists in VC 6.0 or higher */ +#include +#endif + +/* ------------------------------------------------------------------------*/ +/* The Borland compiler defines __BORLANDC__ */ +/* XXX These defines are likely incomplete, but should be easy to fix. */ +#ifdef __BORLANDC__ +#define COMPILER "[Borland]" + +#ifdef _WIN32 +/* tested with BCC 5.5 (__BORLANDC__ >= 0x0550) + */ + +typedef int pid_t; +/* BCC55 seems to understand __declspec(dllimport), it is used in its + own header files (winnt.h, ...) - so we can do nothing and get the default*/ + +#undef HAVE_SYS_UTIME_H +#define HAVE_UTIME_H +#define HAVE_DIRENT_H + +/* rename a few functions for the Borland compiler */ +#include +#define _chsize chsize +#define _setmode setmode + +#else /* !_WIN32 */ +#error "Only Win32 and later are supported" +#endif /* !_WIN32 */ + +#endif /* BORLANDC */ + +/* ------------------------------------------------------------------------*/ +/* egcs/gnu-win32 defines __GNUC__ and _WIN32 */ +#if defined(__GNUC__) && defined(_WIN32) +/* XXX These defines are likely incomplete, but should be easy to fix. + They should be complete enough to build extension modules. */ +/* Suggested by Rene Liebscher to avoid a GCC 2.91.* + bug that requires structure imports. More recent versions of the + compiler don't exhibit this bug. +*/ +#if (__GNUC__==2) && (__GNUC_MINOR__<=91) +#warning "Please use an up-to-date version of gcc! (>2.91 recommended)" +#endif + +#define COMPILER "[gcc]" +#define hypot _hypot +#define PY_LONG_LONG long long +#define PY_LLONG_MIN LLONG_MIN +#define PY_LLONG_MAX LLONG_MAX +#define PY_ULLONG_MAX ULLONG_MAX +#endif /* GNUC */ + +/* ------------------------------------------------------------------------*/ +/* lcc-win32 defines __LCC__ */ +#if defined(__LCC__) +/* XXX These defines are likely incomplete, but should be easy to fix. + They should be complete enough to build extension modules. */ + +#define COMPILER "[lcc-win32]" +typedef int pid_t; +/* __declspec() is supported here too - do nothing to get the defaults */ + +#endif /* LCC */ + +/* ------------------------------------------------------------------------*/ +/* End of compilers - finish up */ + +#ifndef NO_STDIO_H +# include +#endif + +/* 64 bit ints are usually spelt __int64 unless compiler has overridden */ +#define HAVE_LONG_LONG 1 +#ifndef PY_LONG_LONG +# define PY_LONG_LONG __int64 +# define PY_LLONG_MAX _I64_MAX +# define PY_LLONG_MIN _I64_MIN +# define PY_ULLONG_MAX _UI64_MAX +#endif + +/* For Windows the Python core is in a DLL by default. Test +Py_NO_ENABLE_SHARED to find out. Also support MS_NO_COREDLL for b/w compat */ +#if !defined(MS_NO_COREDLL) && !defined(Py_NO_ENABLE_SHARED) +# define Py_ENABLE_SHARED 1 /* standard symbol for shared library */ +# define MS_COREDLL /* deprecated old symbol */ +#endif /* !MS_NO_COREDLL && ... */ + +/* All windows compilers that use this header support __declspec */ +#define HAVE_DECLSPEC_DLL + +/* For an MSVC DLL, we can nominate the .lib files used by extensions */ +#ifdef MS_COREDLL +# ifndef Py_BUILD_CORE /* not building the core - must be an ext */ +# if defined(_MSC_VER) + /* So MSVC users need not specify the .lib file in + their Makefile (other compilers are generally + taken care of by distutils.) */ +# ifdef _DEBUG +# pragma comment(lib,"python27_d.lib") +# else +# pragma comment(lib,"python27.lib") +# endif /* _DEBUG */ +# endif /* _MSC_VER */ +# endif /* Py_BUILD_CORE */ +#endif /* MS_COREDLL */ + +#if defined(MS_WIN64) +/* maintain "win32" sys.platform for backward compatibility of Python code, + the Win64 API should be close enough to the Win32 API to make this + preferable */ +# define PLATFORM "win32" +# define SIZEOF_VOID_P 8 +# define SIZEOF_TIME_T 8 +# define SIZEOF_OFF_T 4 +# define SIZEOF_FPOS_T 8 +# define SIZEOF_HKEY 8 +# define SIZEOF_SIZE_T 8 +/* configure.ac defines HAVE_LARGEFILE_SUPPORT iff HAVE_LONG_LONG, + sizeof(off_t) > sizeof(long), and sizeof(PY_LONG_LONG) >= sizeof(off_t). + On Win64 the second condition is not true, but if fpos_t replaces off_t + then this is true. The uses of HAVE_LARGEFILE_SUPPORT imply that Win64 + should define this. */ +# define HAVE_LARGEFILE_SUPPORT +#elif defined(MS_WIN32) +# define PLATFORM "win32" +# define HAVE_LARGEFILE_SUPPORT +# define SIZEOF_VOID_P 4 +# define SIZEOF_OFF_T 4 +# define SIZEOF_FPOS_T 8 +# define SIZEOF_HKEY 4 +# define SIZEOF_SIZE_T 4 + /* MS VS2005 changes time_t to an 64-bit type on all platforms */ +# if defined(_MSC_VER) && _MSC_VER >= 1400 +# define SIZEOF_TIME_T 8 +# else +# define SIZEOF_TIME_T 4 +# endif +#endif + +#ifdef _DEBUG +# define Py_DEBUG +#endif + + +#ifdef MS_WIN32 + +#define SIZEOF_SHORT 2 +#define SIZEOF_INT 4 +#define SIZEOF_LONG 4 +#define SIZEOF_LONG_LONG 8 +#define SIZEOF_DOUBLE 8 +#define SIZEOF_FLOAT 4 + +/* VC 7.1 has them and VC 6.0 does not. VC 6.0 has a version number of 1200. + Microsoft eMbedded Visual C++ 4.0 has a version number of 1201 and doesn't + define these. + If some compiler does not provide them, modify the #if appropriately. */ +#if defined(_MSC_VER) +#if _MSC_VER > 1300 +#define HAVE_UINTPTR_T 1 +#define HAVE_INTPTR_T 1 +#else +/* VC6, VS 2002 and eVC4 don't support the C99 LL suffix for 64-bit integer literals */ +#define Py_LL(x) x##I64 +#endif /* _MSC_VER > 1200 */ +#endif /* _MSC_VER */ + +#endif + +/* define signed and unsigned exact-width 32-bit and 64-bit types, used in the + implementation of Python long integers. */ +#ifndef PY_UINT32_T +#if SIZEOF_INT == 4 +#define HAVE_UINT32_T 1 +#define PY_UINT32_T unsigned int +#elif SIZEOF_LONG == 4 +#define HAVE_UINT32_T 1 +#define PY_UINT32_T unsigned long +#endif +#endif + +#ifndef PY_UINT64_T +#if SIZEOF_LONG_LONG == 8 +#define HAVE_UINT64_T 1 +#define PY_UINT64_T unsigned PY_LONG_LONG +#endif +#endif + +#ifndef PY_INT32_T +#if SIZEOF_INT == 4 +#define HAVE_INT32_T 1 +#define PY_INT32_T int +#elif SIZEOF_LONG == 4 +#define HAVE_INT32_T 1 +#define PY_INT32_T long +#endif +#endif + +#ifndef PY_INT64_T +#if SIZEOF_LONG_LONG == 8 +#define HAVE_INT64_T 1 +#define PY_INT64_T PY_LONG_LONG +#endif +#endif + +/* Fairly standard from here! */ + +/* Define to 1 if you have the `copysign' function. */ +#define HAVE_COPYSIGN 1 + +/* Define to 1 if you have the `isinf' macro. */ +#define HAVE_DECL_ISINF 1 + +/* Define to 1 if you have the `isnan' function. */ +#define HAVE_DECL_ISNAN 1 + +/* Define if on AIX 3. + System headers sometimes define this. + We just want to avoid a redefinition error message. */ +#ifndef _ALL_SOURCE +/* #undef _ALL_SOURCE */ +#endif + +/* Define to empty if the keyword does not work. */ +/* #define const */ + +/* Define to 1 if you have the header file. */ +#ifndef MS_WINCE +#define HAVE_CONIO_H 1 +#endif + +/* Define to 1 if you have the header file. */ +#ifndef MS_WINCE +#define HAVE_DIRECT_H 1 +#endif + +/* Define if you have dirent.h. */ +/* #define DIRENT 1 */ + +/* Define to the type of elements in the array set by `getgroups'. + Usually this is either `int' or `gid_t'. */ +/* #undef GETGROUPS_T */ + +/* Define to `int' if doesn't define. */ +/* #undef gid_t */ + +/* Define if your struct tm has tm_zone. */ +/* #undef HAVE_TM_ZONE */ + +/* Define if you don't have tm_zone but do have the external array + tzname. */ +#define HAVE_TZNAME + +/* Define to `int' if doesn't define. */ +/* #undef mode_t */ + +/* Define if you don't have dirent.h, but have ndir.h. */ +/* #undef NDIR */ + +/* Define to `long' if doesn't define. */ +/* #undef off_t */ + +/* Define to `int' if doesn't define. */ +/* #undef pid_t */ + +/* Define if the system does not provide POSIX.1 features except + with this defined. */ +/* #undef _POSIX_1_SOURCE */ + +/* Define if you need to in order for stat and other things to work. */ +/* #undef _POSIX_SOURCE */ + +/* Define as the return type of signal handlers (int or void). */ +#define RETSIGTYPE void + +/* Define to `unsigned' if doesn't define. */ +/* #undef size_t */ + +/* Define if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Define if you don't have dirent.h, but have sys/dir.h. */ +/* #undef SYSDIR */ + +/* Define if you don't have dirent.h, but have sys/ndir.h. */ +/* #undef SYSNDIR */ + +/* Define if you can safely include both and . */ +/* #undef TIME_WITH_SYS_TIME */ + +/* Define if your declares struct tm. */ +/* #define TM_IN_SYS_TIME 1 */ + +/* Define to `int' if doesn't define. */ +/* #undef uid_t */ + +/* Define if the closedir function returns void instead of int. */ +/* #undef VOID_CLOSEDIR */ + +/* Define if getpgrp() must be called as getpgrp(0) + and (consequently) setpgrp() as setpgrp(0, 0). */ +/* #undef GETPGRP_HAVE_ARGS */ + +/* Define this if your time.h defines altzone */ +/* #define HAVE_ALTZONE */ + +/* Define if you have the putenv function. */ +#ifndef MS_WINCE +#define HAVE_PUTENV +#endif + +/* Define if your compiler supports function prototypes */ +#define HAVE_PROTOTYPES + +/* Define if you can safely include both and + (which you can't on SCO ODT 3.0). */ +/* #undef SYS_SELECT_WITH_SYS_TIME */ + +/* Define if you want documentation strings in extension modules */ +#define WITH_DOC_STRINGS 1 + +/* Define if you want to compile in rudimentary thread support */ +/* #undef WITH_THREAD */ + +/* Define if you want to use the GNU readline library */ +/* #define WITH_READLINE 1 */ + +/* Define if you want to have a Unicode type. */ +#define Py_USING_UNICODE + +/* Define as the size of the unicode type. */ +/* This is enough for unicodeobject.h to do the "right thing" on Windows. */ +#define Py_UNICODE_SIZE 2 + +/* Use Python's own small-block memory-allocator. */ +#define WITH_PYMALLOC 1 + +/* Define if you have clock. */ +/* #define HAVE_CLOCK */ + +/* Define when any dynamic module loading is enabled */ +#define HAVE_DYNAMIC_LOADING + +/* Define if you have ftime. */ +#ifndef MS_WINCE +#define HAVE_FTIME +#endif + +/* Define if you have getpeername. */ +#define HAVE_GETPEERNAME + +/* Define if you have getpgrp. */ +/* #undef HAVE_GETPGRP */ + +/* Define if you have getpid. */ +#ifndef MS_WINCE +#define HAVE_GETPID +#endif + +/* Define if you have gettimeofday. */ +/* #undef HAVE_GETTIMEOFDAY */ + +/* Define if you have getwd. */ +/* #undef HAVE_GETWD */ + +/* Define if you have lstat. */ +/* #undef HAVE_LSTAT */ + +/* Define if you have the mktime function. */ +#define HAVE_MKTIME + +/* Define if you have nice. */ +/* #undef HAVE_NICE */ + +/* Define if you have readlink. */ +/* #undef HAVE_READLINK */ + +/* Define if you have select. */ +/* #undef HAVE_SELECT */ + +/* Define if you have setpgid. */ +/* #undef HAVE_SETPGID */ + +/* Define if you have setpgrp. */ +/* #undef HAVE_SETPGRP */ + +/* Define if you have setsid. */ +/* #undef HAVE_SETSID */ + +/* Define if you have setvbuf. */ +#define HAVE_SETVBUF + +/* Define if you have siginterrupt. */ +/* #undef HAVE_SIGINTERRUPT */ + +/* Define if you have symlink. */ +/* #undef HAVE_SYMLINK */ + +/* Define if you have tcgetpgrp. */ +/* #undef HAVE_TCGETPGRP */ + +/* Define if you have tcsetpgrp. */ +/* #undef HAVE_TCSETPGRP */ + +/* Define if you have times. */ +/* #undef HAVE_TIMES */ + +/* Define if you have uname. */ +/* #undef HAVE_UNAME */ + +/* Define if you have waitpid. */ +/* #undef HAVE_WAITPID */ + +/* Define to 1 if you have the `wcscoll' function. */ +#ifndef MS_WINCE +#define HAVE_WCSCOLL 1 +#endif + +/* Define if the zlib library has inflateCopy */ +#define HAVE_ZLIB_COPY 1 + +/* Define if you have the header file. */ +/* #undef HAVE_DLFCN_H */ + +/* Define to 1 if you have the header file. */ +#ifndef MS_WINCE +#define HAVE_ERRNO_H 1 +#endif + +/* Define if you have the header file. */ +#ifndef MS_WINCE +#define HAVE_FCNTL_H 1 +#endif + +/* Define to 1 if you have the header file. */ +#ifndef MS_WINCE +#define HAVE_PROCESS_H 1 +#endif + +/* Define to 1 if you have the header file. */ +#ifndef MS_WINCE +#define HAVE_SIGNAL_H 1 +#endif + +/* Define if you have the prototypes. */ +#define HAVE_STDARG_PROTOTYPES + +/* Define if you have the header file. */ +#define HAVE_STDDEF_H 1 + +/* Define if you have the header file. */ +/* #undef HAVE_SYS_AUDIOIO_H */ + +/* Define if you have the header file. */ +/* #define HAVE_SYS_PARAM_H 1 */ + +/* Define if you have the header file. */ +/* #define HAVE_SYS_SELECT_H 1 */ + +/* Define to 1 if you have the header file. */ +#ifndef MS_WINCE +#define HAVE_SYS_STAT_H 1 +#endif + +/* Define if you have the header file. */ +/* #define HAVE_SYS_TIME_H 1 */ + +/* Define if you have the header file. */ +/* #define HAVE_SYS_TIMES_H 1 */ + +/* Define to 1 if you have the header file. */ +#ifndef MS_WINCE +#define HAVE_SYS_TYPES_H 1 +#endif + +/* Define if you have the header file. */ +/* #define HAVE_SYS_UN_H 1 */ + +/* Define if you have the header file. */ +/* #define HAVE_SYS_UTIME_H 1 */ + +/* Define if you have the header file. */ +/* #define HAVE_SYS_UTSNAME_H 1 */ + +/* Define if you have the header file. */ +/* #undef HAVE_THREAD_H */ + +/* Define if you have the header file. */ +/* #define HAVE_UNISTD_H 1 */ + +/* Define if you have the header file. */ +/* #define HAVE_UTIME_H 1 */ + +/* Define if the compiler provides a wchar.h header file. */ +#define HAVE_WCHAR_H 1 + +/* Define if you have the dl library (-ldl). */ +/* #undef HAVE_LIBDL */ + +/* Define if you have the mpc library (-lmpc). */ +/* #undef HAVE_LIBMPC */ + +/* Define if you have the nsl library (-lnsl). */ +#define HAVE_LIBNSL 1 + +/* Define if you have the seq library (-lseq). */ +/* #undef HAVE_LIBSEQ */ + +/* Define if you have the socket library (-lsocket). */ +#define HAVE_LIBSOCKET 1 + +/* Define if you have the sun library (-lsun). */ +/* #undef HAVE_LIBSUN */ + +/* Define if you have the termcap library (-ltermcap). */ +/* #undef HAVE_LIBTERMCAP */ + +/* Define if you have the termlib library (-ltermlib). */ +/* #undef HAVE_LIBTERMLIB */ + +/* Define if you have the thread library (-lthread). */ +/* #undef HAVE_LIBTHREAD */ + +/* WinSock does not use a bitmask in select, and uses + socket handles greater than FD_SETSIZE */ +#define Py_SOCKET_FD_CAN_BE_GE_FD_SETSIZE + +/* Define if C doubles are 64-bit IEEE 754 binary format, stored with the + least significant byte first */ +#define DOUBLE_IS_LITTLE_ENDIAN_IEEE754 1 + +#endif /* !Py_CONFIG_H */ diff --git a/extern/include/Python-2.7/pyctype.h b/extern/include/Python-2.7/pyctype.h new file mode 100644 index 0000000..673cf2e --- /dev/null +++ b/extern/include/Python-2.7/pyctype.h @@ -0,0 +1,31 @@ +#ifndef PYCTYPE_H +#define PYCTYPE_H + +#define PY_CTF_LOWER 0x01 +#define PY_CTF_UPPER 0x02 +#define PY_CTF_ALPHA (PY_CTF_LOWER|PY_CTF_UPPER) +#define PY_CTF_DIGIT 0x04 +#define PY_CTF_ALNUM (PY_CTF_ALPHA|PY_CTF_DIGIT) +#define PY_CTF_SPACE 0x08 +#define PY_CTF_XDIGIT 0x10 + +PyAPI_DATA(const unsigned int) _Py_ctype_table[256]; + +/* Unlike their C counterparts, the following macros are not meant to + * handle an int with any of the values [EOF, 0-UCHAR_MAX]. The argument + * must be a signed/unsigned char. */ +#define Py_ISLOWER(c) (_Py_ctype_table[Py_CHARMASK(c)] & PY_CTF_LOWER) +#define Py_ISUPPER(c) (_Py_ctype_table[Py_CHARMASK(c)] & PY_CTF_UPPER) +#define Py_ISALPHA(c) (_Py_ctype_table[Py_CHARMASK(c)] & PY_CTF_ALPHA) +#define Py_ISDIGIT(c) (_Py_ctype_table[Py_CHARMASK(c)] & PY_CTF_DIGIT) +#define Py_ISXDIGIT(c) (_Py_ctype_table[Py_CHARMASK(c)] & PY_CTF_XDIGIT) +#define Py_ISALNUM(c) (_Py_ctype_table[Py_CHARMASK(c)] & PY_CTF_ALNUM) +#define Py_ISSPACE(c) (_Py_ctype_table[Py_CHARMASK(c)] & PY_CTF_SPACE) + +PyAPI_DATA(const unsigned char) _Py_ctype_tolower[256]; +PyAPI_DATA(const unsigned char) _Py_ctype_toupper[256]; + +#define Py_TOLOWER(c) (_Py_ctype_tolower[Py_CHARMASK(c)]) +#define Py_TOUPPER(c) (_Py_ctype_toupper[Py_CHARMASK(c)]) + +#endif /* !PYCTYPE_H */ diff --git a/extern/include/Python-2.7/pydebug.h b/extern/include/Python-2.7/pydebug.h new file mode 100644 index 0000000..0f45960 --- /dev/null +++ b/extern/include/Python-2.7/pydebug.h @@ -0,0 +1,41 @@ + +#ifndef Py_PYDEBUG_H +#define Py_PYDEBUG_H +#ifdef __cplusplus +extern "C" { +#endif + +PyAPI_DATA(int) Py_DebugFlag; +PyAPI_DATA(int) Py_VerboseFlag; +PyAPI_DATA(int) Py_InteractiveFlag; +PyAPI_DATA(int) Py_InspectFlag; +PyAPI_DATA(int) Py_OptimizeFlag; +PyAPI_DATA(int) Py_NoSiteFlag; +PyAPI_DATA(int) Py_BytesWarningFlag; +PyAPI_DATA(int) Py_UseClassExceptionsFlag; +PyAPI_DATA(int) Py_FrozenFlag; +PyAPI_DATA(int) Py_TabcheckFlag; +PyAPI_DATA(int) Py_UnicodeFlag; +PyAPI_DATA(int) Py_IgnoreEnvironmentFlag; +PyAPI_DATA(int) Py_DivisionWarningFlag; +PyAPI_DATA(int) Py_DontWriteBytecodeFlag; +PyAPI_DATA(int) Py_NoUserSiteDirectory; +/* _XXX Py_QnewFlag should go away in 3.0. It's true iff -Qnew is passed, + on the command line, and is used in 2.2 by ceval.c to make all "/" divisions + true divisions (which they will be in 3.0). */ +PyAPI_DATA(int) _Py_QnewFlag; +/* Warn about 3.x issues */ +PyAPI_DATA(int) Py_Py3kWarningFlag; +PyAPI_DATA(int) Py_HashRandomizationFlag; + +/* this is a wrapper around getenv() that pays attention to + Py_IgnoreEnvironmentFlag. It should be used for getting variables like + PYTHONPATH and PYTHONHOME from the environment */ +#define Py_GETENV(s) (Py_IgnoreEnvironmentFlag ? NULL : getenv(s)) + +PyAPI_FUNC(void) Py_FatalError(const char *message); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_PYDEBUG_H */ diff --git a/extern/include/Python-2.7/pyerrors.h b/extern/include/Python-2.7/pyerrors.h new file mode 100644 index 0000000..dbe3bfa --- /dev/null +++ b/extern/include/Python-2.7/pyerrors.h @@ -0,0 +1,328 @@ +#ifndef Py_ERRORS_H +#define Py_ERRORS_H +#ifdef __cplusplus +extern "C" { +#endif + +/* Error objects */ + +typedef struct { + PyObject_HEAD + PyObject *dict; + PyObject *args; + PyObject *message; +} PyBaseExceptionObject; + +typedef struct { + PyObject_HEAD + PyObject *dict; + PyObject *args; + PyObject *message; + PyObject *msg; + PyObject *filename; + PyObject *lineno; + PyObject *offset; + PyObject *text; + PyObject *print_file_and_line; +} PySyntaxErrorObject; + +#ifdef Py_USING_UNICODE +typedef struct { + PyObject_HEAD + PyObject *dict; + PyObject *args; + PyObject *message; + PyObject *encoding; + PyObject *object; + Py_ssize_t start; + Py_ssize_t end; + PyObject *reason; +} PyUnicodeErrorObject; +#endif + +typedef struct { + PyObject_HEAD + PyObject *dict; + PyObject *args; + PyObject *message; + PyObject *code; +} PySystemExitObject; + +typedef struct { + PyObject_HEAD + PyObject *dict; + PyObject *args; + PyObject *message; + PyObject *myerrno; + PyObject *strerror; + PyObject *filename; +} PyEnvironmentErrorObject; + +#ifdef MS_WINDOWS +typedef struct { + PyObject_HEAD + PyObject *dict; + PyObject *args; + PyObject *message; + PyObject *myerrno; + PyObject *strerror; + PyObject *filename; + PyObject *winerror; +} PyWindowsErrorObject; +#endif + +/* Error handling definitions */ + +PyAPI_FUNC(void) PyErr_SetNone(PyObject *); +PyAPI_FUNC(void) PyErr_SetObject(PyObject *, PyObject *); +PyAPI_FUNC(void) PyErr_SetString(PyObject *, const char *); +PyAPI_FUNC(PyObject *) PyErr_Occurred(void); +PyAPI_FUNC(void) PyErr_Clear(void); +PyAPI_FUNC(void) PyErr_Fetch(PyObject **, PyObject **, PyObject **); +PyAPI_FUNC(void) PyErr_Restore(PyObject *, PyObject *, PyObject *); + +#ifdef Py_DEBUG +#define _PyErr_OCCURRED() PyErr_Occurred() +#else +#define _PyErr_OCCURRED() (_PyThreadState_Current->curexc_type) +#endif + +/* Error testing and normalization */ +PyAPI_FUNC(int) PyErr_GivenExceptionMatches(PyObject *, PyObject *); +PyAPI_FUNC(int) PyErr_ExceptionMatches(PyObject *); +PyAPI_FUNC(void) PyErr_NormalizeException(PyObject**, PyObject**, PyObject**); + +/* */ + +#define PyExceptionClass_Check(x) \ + (PyClass_Check((x)) || (PyType_Check((x)) && \ + PyType_FastSubclass((PyTypeObject*)(x), Py_TPFLAGS_BASE_EXC_SUBCLASS))) + +#define PyExceptionInstance_Check(x) \ + (PyInstance_Check((x)) || \ + PyType_FastSubclass((x)->ob_type, Py_TPFLAGS_BASE_EXC_SUBCLASS)) + +#define PyExceptionClass_Name(x) \ + (PyClass_Check((x)) \ + ? PyString_AS_STRING(((PyClassObject*)(x))->cl_name) \ + : (char *)(((PyTypeObject*)(x))->tp_name)) + +#define PyExceptionInstance_Class(x) \ + ((PyInstance_Check((x)) \ + ? (PyObject*)((PyInstanceObject*)(x))->in_class \ + : (PyObject*)((x)->ob_type))) + + +/* Predefined exceptions */ + +PyAPI_DATA(PyObject *) PyExc_BaseException; +PyAPI_DATA(PyObject *) PyExc_Exception; +PyAPI_DATA(PyObject *) PyExc_StopIteration; +PyAPI_DATA(PyObject *) PyExc_GeneratorExit; +PyAPI_DATA(PyObject *) PyExc_StandardError; +PyAPI_DATA(PyObject *) PyExc_ArithmeticError; +PyAPI_DATA(PyObject *) PyExc_LookupError; + +PyAPI_DATA(PyObject *) PyExc_AssertionError; +PyAPI_DATA(PyObject *) PyExc_AttributeError; +PyAPI_DATA(PyObject *) PyExc_EOFError; +PyAPI_DATA(PyObject *) PyExc_FloatingPointError; +PyAPI_DATA(PyObject *) PyExc_EnvironmentError; +PyAPI_DATA(PyObject *) PyExc_IOError; +PyAPI_DATA(PyObject *) PyExc_OSError; +PyAPI_DATA(PyObject *) PyExc_ImportError; +PyAPI_DATA(PyObject *) PyExc_IndexError; +PyAPI_DATA(PyObject *) PyExc_KeyError; +PyAPI_DATA(PyObject *) PyExc_KeyboardInterrupt; +PyAPI_DATA(PyObject *) PyExc_MemoryError; +PyAPI_DATA(PyObject *) PyExc_NameError; +PyAPI_DATA(PyObject *) PyExc_OverflowError; +PyAPI_DATA(PyObject *) PyExc_RuntimeError; +PyAPI_DATA(PyObject *) PyExc_NotImplementedError; +PyAPI_DATA(PyObject *) PyExc_SyntaxError; +PyAPI_DATA(PyObject *) PyExc_IndentationError; +PyAPI_DATA(PyObject *) PyExc_TabError; +PyAPI_DATA(PyObject *) PyExc_ReferenceError; +PyAPI_DATA(PyObject *) PyExc_SystemError; +PyAPI_DATA(PyObject *) PyExc_SystemExit; +PyAPI_DATA(PyObject *) PyExc_TypeError; +PyAPI_DATA(PyObject *) PyExc_UnboundLocalError; +PyAPI_DATA(PyObject *) PyExc_UnicodeError; +PyAPI_DATA(PyObject *) PyExc_UnicodeEncodeError; +PyAPI_DATA(PyObject *) PyExc_UnicodeDecodeError; +PyAPI_DATA(PyObject *) PyExc_UnicodeTranslateError; +PyAPI_DATA(PyObject *) PyExc_ValueError; +PyAPI_DATA(PyObject *) PyExc_ZeroDivisionError; +#ifdef MS_WINDOWS +PyAPI_DATA(PyObject *) PyExc_WindowsError; +#endif +#ifdef __VMS +PyAPI_DATA(PyObject *) PyExc_VMSError; +#endif + +PyAPI_DATA(PyObject *) PyExc_BufferError; + +PyAPI_DATA(PyObject *) PyExc_MemoryErrorInst; +PyAPI_DATA(PyObject *) PyExc_RecursionErrorInst; + +/* Predefined warning categories */ +PyAPI_DATA(PyObject *) PyExc_Warning; +PyAPI_DATA(PyObject *) PyExc_UserWarning; +PyAPI_DATA(PyObject *) PyExc_DeprecationWarning; +PyAPI_DATA(PyObject *) PyExc_PendingDeprecationWarning; +PyAPI_DATA(PyObject *) PyExc_SyntaxWarning; +PyAPI_DATA(PyObject *) PyExc_RuntimeWarning; +PyAPI_DATA(PyObject *) PyExc_FutureWarning; +PyAPI_DATA(PyObject *) PyExc_ImportWarning; +PyAPI_DATA(PyObject *) PyExc_UnicodeWarning; +PyAPI_DATA(PyObject *) PyExc_BytesWarning; + + +/* Convenience functions */ + +PyAPI_FUNC(int) PyErr_BadArgument(void); +PyAPI_FUNC(PyObject *) PyErr_NoMemory(void); +PyAPI_FUNC(PyObject *) PyErr_SetFromErrno(PyObject *); +PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithFilenameObject( + PyObject *, PyObject *); +PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithFilename( + PyObject *, const char *); +#ifdef MS_WINDOWS +PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithUnicodeFilename( + PyObject *, const Py_UNICODE *); +#endif /* MS_WINDOWS */ + +PyAPI_FUNC(PyObject *) PyErr_Format(PyObject *, const char *, ...) + Py_GCC_ATTRIBUTE((format(printf, 2, 3))); + +#ifdef MS_WINDOWS +PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErrWithFilenameObject( + int, const char *); +PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErrWithFilename( + int, const char *); +PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErrWithUnicodeFilename( + int, const Py_UNICODE *); +PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErr(int); +PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErrWithFilenameObject( + PyObject *,int, PyObject *); +PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErrWithFilename( + PyObject *,int, const char *); +PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErrWithUnicodeFilename( + PyObject *,int, const Py_UNICODE *); +PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErr(PyObject *, int); +#endif /* MS_WINDOWS */ + +/* Export the old function so that the existing API remains available: */ +PyAPI_FUNC(void) PyErr_BadInternalCall(void); +PyAPI_FUNC(void) _PyErr_BadInternalCall(char *filename, int lineno); +/* Mask the old API with a call to the new API for code compiled under + Python 2.0: */ +#define PyErr_BadInternalCall() _PyErr_BadInternalCall(__FILE__, __LINE__) + +/* Function to create a new exception */ +PyAPI_FUNC(PyObject *) PyErr_NewException( + char *name, PyObject *base, PyObject *dict); +PyAPI_FUNC(PyObject *) PyErr_NewExceptionWithDoc( + char *name, char *doc, PyObject *base, PyObject *dict); +PyAPI_FUNC(void) PyErr_WriteUnraisable(PyObject *); + +/* In sigcheck.c or signalmodule.c */ +PyAPI_FUNC(int) PyErr_CheckSignals(void); +PyAPI_FUNC(void) PyErr_SetInterrupt(void); + +/* In signalmodule.c */ +int PySignal_SetWakeupFd(int fd); + +/* Support for adding program text to SyntaxErrors */ +PyAPI_FUNC(void) PyErr_SyntaxLocation(const char *, int); +PyAPI_FUNC(PyObject *) PyErr_ProgramText(const char *, int); + +#ifdef Py_USING_UNICODE +/* The following functions are used to create and modify unicode + exceptions from C */ + +/* create a UnicodeDecodeError object */ +PyAPI_FUNC(PyObject *) PyUnicodeDecodeError_Create( + const char *, const char *, Py_ssize_t, Py_ssize_t, Py_ssize_t, const char *); + +/* create a UnicodeEncodeError object */ +PyAPI_FUNC(PyObject *) PyUnicodeEncodeError_Create( + const char *, const Py_UNICODE *, Py_ssize_t, Py_ssize_t, Py_ssize_t, const char *); + +/* create a UnicodeTranslateError object */ +PyAPI_FUNC(PyObject *) PyUnicodeTranslateError_Create( + const Py_UNICODE *, Py_ssize_t, Py_ssize_t, Py_ssize_t, const char *); + +/* get the encoding attribute */ +PyAPI_FUNC(PyObject *) PyUnicodeEncodeError_GetEncoding(PyObject *); +PyAPI_FUNC(PyObject *) PyUnicodeDecodeError_GetEncoding(PyObject *); + +/* get the object attribute */ +PyAPI_FUNC(PyObject *) PyUnicodeEncodeError_GetObject(PyObject *); +PyAPI_FUNC(PyObject *) PyUnicodeDecodeError_GetObject(PyObject *); +PyAPI_FUNC(PyObject *) PyUnicodeTranslateError_GetObject(PyObject *); + +/* get the value of the start attribute (the int * may not be NULL) + return 0 on success, -1 on failure */ +PyAPI_FUNC(int) PyUnicodeEncodeError_GetStart(PyObject *, Py_ssize_t *); +PyAPI_FUNC(int) PyUnicodeDecodeError_GetStart(PyObject *, Py_ssize_t *); +PyAPI_FUNC(int) PyUnicodeTranslateError_GetStart(PyObject *, Py_ssize_t *); + +/* assign a new value to the start attribute + return 0 on success, -1 on failure */ +PyAPI_FUNC(int) PyUnicodeEncodeError_SetStart(PyObject *, Py_ssize_t); +PyAPI_FUNC(int) PyUnicodeDecodeError_SetStart(PyObject *, Py_ssize_t); +PyAPI_FUNC(int) PyUnicodeTranslateError_SetStart(PyObject *, Py_ssize_t); + +/* get the value of the end attribute (the int *may not be NULL) + return 0 on success, -1 on failure */ +PyAPI_FUNC(int) PyUnicodeEncodeError_GetEnd(PyObject *, Py_ssize_t *); +PyAPI_FUNC(int) PyUnicodeDecodeError_GetEnd(PyObject *, Py_ssize_t *); +PyAPI_FUNC(int) PyUnicodeTranslateError_GetEnd(PyObject *, Py_ssize_t *); + +/* assign a new value to the end attribute + return 0 on success, -1 on failure */ +PyAPI_FUNC(int) PyUnicodeEncodeError_SetEnd(PyObject *, Py_ssize_t); +PyAPI_FUNC(int) PyUnicodeDecodeError_SetEnd(PyObject *, Py_ssize_t); +PyAPI_FUNC(int) PyUnicodeTranslateError_SetEnd(PyObject *, Py_ssize_t); + +/* get the value of the reason attribute */ +PyAPI_FUNC(PyObject *) PyUnicodeEncodeError_GetReason(PyObject *); +PyAPI_FUNC(PyObject *) PyUnicodeDecodeError_GetReason(PyObject *); +PyAPI_FUNC(PyObject *) PyUnicodeTranslateError_GetReason(PyObject *); + +/* assign a new value to the reason attribute + return 0 on success, -1 on failure */ +PyAPI_FUNC(int) PyUnicodeEncodeError_SetReason( + PyObject *, const char *); +PyAPI_FUNC(int) PyUnicodeDecodeError_SetReason( + PyObject *, const char *); +PyAPI_FUNC(int) PyUnicodeTranslateError_SetReason( + PyObject *, const char *); +#endif + + +/* These APIs aren't really part of the error implementation, but + often needed to format error messages; the native C lib APIs are + not available on all platforms, which is why we provide emulations + for those platforms in Python/mysnprintf.c, + WARNING: The return value of snprintf varies across platforms; do + not rely on any particular behavior; eventually the C99 defn may + be reliable. +*/ +#if defined(MS_WIN32) && !defined(HAVE_SNPRINTF) +# define HAVE_SNPRINTF +# define snprintf _snprintf +# define vsnprintf _vsnprintf +#endif + +#include +PyAPI_FUNC(int) PyOS_snprintf(char *str, size_t size, const char *format, ...) + Py_GCC_ATTRIBUTE((format(printf, 3, 4))); +PyAPI_FUNC(int) PyOS_vsnprintf(char *str, size_t size, const char *format, va_list va) + Py_GCC_ATTRIBUTE((format(printf, 3, 0))); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_ERRORS_H */ diff --git a/extern/include/Python-2.7/pyexpat.h b/extern/include/Python-2.7/pyexpat.h new file mode 100644 index 0000000..5340ef5 --- /dev/null +++ b/extern/include/Python-2.7/pyexpat.h @@ -0,0 +1,48 @@ +/* Stuff to export relevant 'expat' entry points from pyexpat to other + * parser modules, such as cElementTree. */ + +/* note: you must import expat.h before importing this module! */ + +#define PyExpat_CAPI_MAGIC "pyexpat.expat_CAPI 1.0" +#define PyExpat_CAPSULE_NAME "pyexpat.expat_CAPI" + +struct PyExpat_CAPI +{ + char* magic; /* set to PyExpat_CAPI_MAGIC */ + int size; /* set to sizeof(struct PyExpat_CAPI) */ + int MAJOR_VERSION; + int MINOR_VERSION; + int MICRO_VERSION; + /* pointers to selected expat functions. add new functions at + the end, if needed */ + const XML_LChar * (*ErrorString)(enum XML_Error code); + enum XML_Error (*GetErrorCode)(XML_Parser parser); + XML_Size (*GetErrorColumnNumber)(XML_Parser parser); + XML_Size (*GetErrorLineNumber)(XML_Parser parser); + enum XML_Status (*Parse)( + XML_Parser parser, const char *s, int len, int isFinal); + XML_Parser (*ParserCreate_MM)( + const XML_Char *encoding, const XML_Memory_Handling_Suite *memsuite, + const XML_Char *namespaceSeparator); + void (*ParserFree)(XML_Parser parser); + void (*SetCharacterDataHandler)( + XML_Parser parser, XML_CharacterDataHandler handler); + void (*SetCommentHandler)( + XML_Parser parser, XML_CommentHandler handler); + void (*SetDefaultHandlerExpand)( + XML_Parser parser, XML_DefaultHandler handler); + void (*SetElementHandler)( + XML_Parser parser, XML_StartElementHandler start, + XML_EndElementHandler end); + void (*SetNamespaceDeclHandler)( + XML_Parser parser, XML_StartNamespaceDeclHandler start, + XML_EndNamespaceDeclHandler end); + void (*SetProcessingInstructionHandler)( + XML_Parser parser, XML_ProcessingInstructionHandler handler); + void (*SetUnknownEncodingHandler)( + XML_Parser parser, XML_UnknownEncodingHandler handler, + void *encodingHandlerData); + void (*SetUserData)(XML_Parser parser, void *userData); + /* always add new stuff to the end! */ +}; + diff --git a/extern/include/Python-2.7/pyfpe.h b/extern/include/Python-2.7/pyfpe.h new file mode 100644 index 0000000..e957119 --- /dev/null +++ b/extern/include/Python-2.7/pyfpe.h @@ -0,0 +1,176 @@ +#ifndef Py_PYFPE_H +#define Py_PYFPE_H +#ifdef __cplusplus +extern "C" { +#endif +/* + --------------------------------------------------------------------- + / Copyright (c) 1996. \ + | The Regents of the University of California. | + | All rights reserved. | + | | + | Permission to use, copy, modify, and distribute this software for | + | any purpose without fee is hereby granted, provided that this en- | + | tire notice is included in all copies of any software which is or | + | includes a copy or modification of this software and in all | + | copies of the supporting documentation for such software. | + | | + | This work was produced at the University of California, Lawrence | + | Livermore National Laboratory under contract no. W-7405-ENG-48 | + | between the U.S. Department of Energy and The Regents of the | + | University of California for the operation of UC LLNL. | + | | + | DISCLAIMER | + | | + | This software was prepared as an account of work sponsored by an | + | agency of the United States Government. Neither the United States | + | Government nor the University of California nor any of their em- | + | ployees, makes any warranty, express or implied, or assumes any | + | liability or responsibility for the accuracy, completeness, or | + | usefulness of any information, apparatus, product, or process | + | disclosed, or represents that its use would not infringe | + | privately-owned rights. Reference herein to any specific commer- | + | cial products, process, or service by trade name, trademark, | + | manufacturer, or otherwise, does not necessarily constitute or | + | imply its endorsement, recommendation, or favoring by the United | + | States Government or the University of California. The views and | + | opinions of authors expressed herein do not necessarily state or | + | reflect those of the United States Government or the University | + | of California, and shall not be used for advertising or product | + \ endorsement purposes. / + --------------------------------------------------------------------- +*/ + +/* + * Define macros for handling SIGFPE. + * Lee Busby, LLNL, November, 1996 + * busby1@llnl.gov + * + ********************************************* + * Overview of the system for handling SIGFPE: + * + * This file (Include/pyfpe.h) defines a couple of "wrapper" macros for + * insertion into your Python C code of choice. Their proper use is + * discussed below. The file Python/pyfpe.c defines a pair of global + * variables PyFPE_jbuf and PyFPE_counter which are used by the signal + * handler for SIGFPE to decide if a particular exception was protected + * by the macros. The signal handler itself, and code for enabling the + * generation of SIGFPE in the first place, is in a (new) Python module + * named fpectl. This module is standard in every respect. It can be loaded + * either statically or dynamically as you choose, and like any other + * Python module, has no effect until you import it. + * + * In the general case, there are three steps toward handling SIGFPE in any + * Python code: + * + * 1) Add the *_PROTECT macros to your C code as required to protect + * dangerous floating point sections. + * + * 2) Turn on the inclusion of the code by adding the ``--with-fpectl'' + * flag at the time you run configure. If the fpectl or other modules + * which use the *_PROTECT macros are to be dynamically loaded, be + * sure they are compiled with WANT_SIGFPE_HANDLER defined. + * + * 3) When python is built and running, import fpectl, and execute + * fpectl.turnon_sigfpe(). This sets up the signal handler and enables + * generation of SIGFPE whenever an exception occurs. From this point + * on, any properly trapped SIGFPE should result in the Python + * FloatingPointError exception. + * + * Step 1 has been done already for the Python kernel code, and should be + * done soon for the NumPy array package. Step 2 is usually done once at + * python install time. Python's behavior with respect to SIGFPE is not + * changed unless you also do step 3. Thus you can control this new + * facility at compile time, or run time, or both. + * + ******************************** + * Using the macros in your code: + * + * static PyObject *foobar(PyObject *self,PyObject *args) + * { + * .... + * PyFPE_START_PROTECT("Error in foobar", return 0) + * result = dangerous_op(somearg1, somearg2, ...); + * PyFPE_END_PROTECT(result) + * .... + * } + * + * If a floating point error occurs in dangerous_op, foobar returns 0 (NULL), + * after setting the associated value of the FloatingPointError exception to + * "Error in foobar". ``Dangerous_op'' can be a single operation, or a block + * of code, function calls, or any combination, so long as no alternate + * return is possible before the PyFPE_END_PROTECT macro is reached. + * + * The macros can only be used in a function context where an error return + * can be recognized as signaling a Python exception. (Generally, most + * functions that return a PyObject * will qualify.) + * + * Guido's original design suggestion for PyFPE_START_PROTECT and + * PyFPE_END_PROTECT had them open and close a local block, with a locally + * defined jmp_buf and jmp_buf pointer. This would allow recursive nesting + * of the macros. The Ansi C standard makes it clear that such local + * variables need to be declared with the "volatile" type qualifier to keep + * setjmp from corrupting their values. Some current implementations seem + * to be more restrictive. For example, the HPUX man page for setjmp says + * + * Upon the return from a setjmp() call caused by a longjmp(), the + * values of any non-static local variables belonging to the routine + * from which setjmp() was called are undefined. Code which depends on + * such values is not guaranteed to be portable. + * + * I therefore decided on a more limited form of nesting, using a counter + * variable (PyFPE_counter) to keep track of any recursion. If an exception + * occurs in an ``inner'' pair of macros, the return will apparently + * come from the outermost level. + * + */ + +#ifdef WANT_SIGFPE_HANDLER +#include +#include +#include +extern jmp_buf PyFPE_jbuf; +extern int PyFPE_counter; +extern double PyFPE_dummy(void *); + +#define PyFPE_START_PROTECT(err_string, leave_stmt) \ +if (!PyFPE_counter++ && setjmp(PyFPE_jbuf)) { \ + PyErr_SetString(PyExc_FloatingPointError, err_string); \ + PyFPE_counter = 0; \ + leave_stmt; \ +} + +/* + * This (following) is a heck of a way to decrement a counter. However, + * unless the macro argument is provided, code optimizers will sometimes move + * this statement so that it gets executed *before* the unsafe expression + * which we're trying to protect. That pretty well messes things up, + * of course. + * + * If the expression(s) you're trying to protect don't happen to return a + * value, you will need to manufacture a dummy result just to preserve the + * correct ordering of statements. Note that the macro passes the address + * of its argument (so you need to give it something which is addressable). + * If your expression returns multiple results, pass the last such result + * to PyFPE_END_PROTECT. + * + * Note that PyFPE_dummy returns a double, which is cast to int. + * This seeming insanity is to tickle the Floating Point Unit (FPU). + * If an exception has occurred in a preceding floating point operation, + * some architectures (notably Intel 80x86) will not deliver the interrupt + * until the *next* floating point operation. This is painful if you've + * already decremented PyFPE_counter. + */ +#define PyFPE_END_PROTECT(v) PyFPE_counter -= (int)PyFPE_dummy(&(v)); + +#else + +#define PyFPE_START_PROTECT(err_string, leave_stmt) +#define PyFPE_END_PROTECT(v) + +#endif + +#ifdef __cplusplus +} +#endif +#endif /* !Py_PYFPE_H */ diff --git a/extern/include/Python-2.7/pygetopt.h b/extern/include/Python-2.7/pygetopt.h new file mode 100644 index 0000000..9860d36 --- /dev/null +++ b/extern/include/Python-2.7/pygetopt.h @@ -0,0 +1,18 @@ + +#ifndef Py_PYGETOPT_H +#define Py_PYGETOPT_H +#ifdef __cplusplus +extern "C" { +#endif + +PyAPI_DATA(int) _PyOS_opterr; +PyAPI_DATA(int) _PyOS_optind; +PyAPI_DATA(char *) _PyOS_optarg; + +PyAPI_FUNC(void) _PyOS_ResetGetOpt(void); +PyAPI_FUNC(int) _PyOS_GetOpt(int argc, char **argv, char *optstring); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_PYGETOPT_H */ diff --git a/extern/include/Python-2.7/pymacconfig.h b/extern/include/Python-2.7/pymacconfig.h new file mode 100644 index 0000000..24e7b8d --- /dev/null +++ b/extern/include/Python-2.7/pymacconfig.h @@ -0,0 +1,102 @@ +#ifndef PYMACCONFIG_H +#define PYMACCONFIG_H + /* + * This file moves some of the autoconf magic to compile-time + * when building on MacOSX. This is needed for building 4-way + * universal binaries and for 64-bit universal binaries because + * the values redefined below aren't configure-time constant but + * only compile-time constant in these scenarios. + */ + +#if defined(__APPLE__) + +# undef SIZEOF_LONG +# undef SIZEOF_PTHREAD_T +# undef SIZEOF_SIZE_T +# undef SIZEOF_TIME_T +# undef SIZEOF_VOID_P +# undef SIZEOF__BOOL +# undef SIZEOF_UINTPTR_T +# undef SIZEOF_PTHREAD_T +# undef WORDS_BIGENDIAN +# undef DOUBLE_IS_ARM_MIXED_ENDIAN_IEEE754 +# undef DOUBLE_IS_BIG_ENDIAN_IEEE754 +# undef DOUBLE_IS_LITTLE_ENDIAN_IEEE754 +# undef HAVE_GCC_ASM_FOR_X87 + +# undef VA_LIST_IS_ARRAY +# if defined(__LP64__) && defined(__x86_64__) +# define VA_LIST_IS_ARRAY 1 +# endif + +# undef HAVE_LARGEFILE_SUPPORT +# ifndef __LP64__ +# define HAVE_LARGEFILE_SUPPORT 1 +# endif + +# undef SIZEOF_LONG +# ifdef __LP64__ +# define SIZEOF__BOOL 1 +# define SIZEOF__BOOL 1 +# define SIZEOF_LONG 8 +# define SIZEOF_PTHREAD_T 8 +# define SIZEOF_SIZE_T 8 +# define SIZEOF_TIME_T 8 +# define SIZEOF_VOID_P 8 +# define SIZEOF_UINTPTR_T 8 +# define SIZEOF_PTHREAD_T 8 +# else +# ifdef __ppc__ +# define SIZEOF__BOOL 4 +# else +# define SIZEOF__BOOL 1 +# endif +# define SIZEOF_LONG 4 +# define SIZEOF_PTHREAD_T 4 +# define SIZEOF_SIZE_T 4 +# define SIZEOF_TIME_T 4 +# define SIZEOF_VOID_P 4 +# define SIZEOF_UINTPTR_T 4 +# define SIZEOF_PTHREAD_T 4 +# endif + +# if defined(__LP64__) + /* MacOSX 10.4 (the first release to support 64-bit code + * at all) only supports 64-bit in the UNIX layer. + * Therefore surpress the toolbox-glue in 64-bit mode. + */ + + /* In 64-bit mode setpgrp always has no argments, in 32-bit + * mode that depends on the compilation environment + */ +# undef SETPGRP_HAVE_ARG + +# endif + +#ifdef __BIG_ENDIAN__ +#define WORDS_BIGENDIAN 1 +#define DOUBLE_IS_BIG_ENDIAN_IEEE754 +#else +#define DOUBLE_IS_LITTLE_ENDIAN_IEEE754 +#endif /* __BIG_ENDIAN */ + +#ifdef __i386__ +# define HAVE_GCC_ASM_FOR_X87 +#endif + + /* + * The definition in pyconfig.h is only valid on the OS release + * where configure ran on and not necessarily for all systems where + * the executable can be used on. + * + * Specifically: OSX 10.4 has limited supported for '%zd', while + * 10.5 has full support for '%zd'. A binary built on 10.5 won't + * work properly on 10.4 unless we surpress the definition + * of PY_FORMAT_SIZE_T + */ +#undef PY_FORMAT_SIZE_T + + +#endif /* defined(_APPLE__) */ + +#endif /* PYMACCONFIG_H */ diff --git a/extern/include/Python-2.7/pymactoolbox.h b/extern/include/Python-2.7/pymactoolbox.h new file mode 100644 index 0000000..fd15975 --- /dev/null +++ b/extern/include/Python-2.7/pymactoolbox.h @@ -0,0 +1,217 @@ +/* +** pymactoolbox.h - globals defined in mactoolboxglue.c +*/ +#ifndef Py_PYMACTOOLBOX_H +#define Py_PYMACTOOLBOX_H +#ifdef __cplusplus + extern "C" { +#endif + +#include + +#ifndef __LP64__ +#include +#endif /* !__LP64__ */ + +/* +** Helper routines for error codes and such. +*/ +char *PyMac_StrError(int); /* strerror with mac errors */ +extern PyObject *PyMac_OSErrException; /* Exception for OSErr */ +PyObject *PyMac_GetOSErrException(void); /* Initialize & return it */ +PyObject *PyErr_Mac(PyObject *, int); /* Exception with a mac error */ +PyObject *PyMac_Error(OSErr); /* Uses PyMac_GetOSErrException */ +#ifndef __LP64__ +extern OSErr PyMac_GetFullPathname(FSSpec *, char *, int); /* convert + fsspec->path */ +#endif /* __LP64__ */ + +/* +** These conversion routines are defined in mactoolboxglue.c itself. +*/ +int PyMac_GetOSType(PyObject *, OSType *); /* argument parser for OSType */ +PyObject *PyMac_BuildOSType(OSType); /* Convert OSType to PyObject */ + +PyObject *PyMac_BuildNumVersion(NumVersion);/* Convert NumVersion to PyObject */ + +int PyMac_GetStr255(PyObject *, Str255); /* argument parser for Str255 */ +PyObject *PyMac_BuildStr255(Str255); /* Convert Str255 to PyObject */ +PyObject *PyMac_BuildOptStr255(Str255); /* Convert Str255 to PyObject, + NULL to None */ + +int PyMac_GetRect(PyObject *, Rect *); /* argument parser for Rect */ +PyObject *PyMac_BuildRect(Rect *); /* Convert Rect to PyObject */ + +int PyMac_GetPoint(PyObject *, Point *); /* argument parser for Point */ +PyObject *PyMac_BuildPoint(Point); /* Convert Point to PyObject */ + +int PyMac_GetEventRecord(PyObject *, EventRecord *); /* argument parser for + EventRecord */ +PyObject *PyMac_BuildEventRecord(EventRecord *); /* Convert EventRecord to + PyObject */ + +int PyMac_GetFixed(PyObject *, Fixed *); /* argument parser for Fixed */ +PyObject *PyMac_BuildFixed(Fixed); /* Convert Fixed to PyObject */ +int PyMac_Getwide(PyObject *, wide *); /* argument parser for wide */ +PyObject *PyMac_Buildwide(wide *); /* Convert wide to PyObject */ + +/* +** The rest of the routines are implemented by extension modules. If they are +** dynamically loaded mactoolboxglue will contain a stub implementation of the +** routine, which imports the module, whereupon the module's init routine will +** communicate the routine pointer back to the stub. +** If USE_TOOLBOX_OBJECT_GLUE is not defined there is no glue code, and the +** extension modules simply declare the routine. This is the case for static +** builds (and could be the case for MacPython CFM builds, because CFM extension +** modules can reference each other without problems). +*/ + +#ifdef USE_TOOLBOX_OBJECT_GLUE +/* +** These macros are used in the module init code. If we use toolbox object glue +** it sets the function pointer to point to the real function. +*/ +#define PyMac_INIT_TOOLBOX_OBJECT_NEW(object, rtn) { \ + extern PyObject *(*PyMacGluePtr_##rtn)(object); \ + PyMacGluePtr_##rtn = _##rtn; \ +} +#define PyMac_INIT_TOOLBOX_OBJECT_CONVERT(object, rtn) { \ + extern int (*PyMacGluePtr_##rtn)(PyObject *, object *); \ + PyMacGluePtr_##rtn = _##rtn; \ +} +#else +/* +** If we don't use toolbox object glue the init macros are empty. Moreover, we define +** _xxx_New to be the same as xxx_New, and the code in mactoolboxglue isn't included. +*/ +#define PyMac_INIT_TOOLBOX_OBJECT_NEW(object, rtn) +#define PyMac_INIT_TOOLBOX_OBJECT_CONVERT(object, rtn) +#endif /* USE_TOOLBOX_OBJECT_GLUE */ + +/* macfs exports */ +#ifndef __LP64__ +int PyMac_GetFSSpec(PyObject *, FSSpec *); /* argument parser for FSSpec */ +PyObject *PyMac_BuildFSSpec(FSSpec *); /* Convert FSSpec to PyObject */ +#endif /* !__LP64__ */ + +int PyMac_GetFSRef(PyObject *, FSRef *); /* argument parser for FSRef */ +PyObject *PyMac_BuildFSRef(FSRef *); /* Convert FSRef to PyObject */ + +/* AE exports */ +extern PyObject *AEDesc_New(AppleEvent *); /* XXXX Why passed by address?? */ +extern PyObject *AEDesc_NewBorrowed(AppleEvent *); +extern int AEDesc_Convert(PyObject *, AppleEvent *); + +/* Cm exports */ +extern PyObject *CmpObj_New(Component); +extern int CmpObj_Convert(PyObject *, Component *); +extern PyObject *CmpInstObj_New(ComponentInstance); +extern int CmpInstObj_Convert(PyObject *, ComponentInstance *); + +/* Ctl exports */ +#ifndef __LP64__ +extern PyObject *CtlObj_New(ControlHandle); +extern int CtlObj_Convert(PyObject *, ControlHandle *); +#endif /* !__LP64__ */ + +/* Dlg exports */ +#ifndef __LP64__ +extern PyObject *DlgObj_New(DialogPtr); +extern int DlgObj_Convert(PyObject *, DialogPtr *); +extern PyObject *DlgObj_WhichDialog(DialogPtr); +#endif /* !__LP64__ */ + +/* Drag exports */ +#ifndef __LP64__ +extern PyObject *DragObj_New(DragReference); +extern int DragObj_Convert(PyObject *, DragReference *); +#endif /* !__LP64__ */ + +/* List exports */ +#ifndef __LP64__ +extern PyObject *ListObj_New(ListHandle); +extern int ListObj_Convert(PyObject *, ListHandle *); +#endif /* !__LP64__ */ + +/* Menu exports */ +#ifndef __LP64__ +extern PyObject *MenuObj_New(MenuHandle); +extern int MenuObj_Convert(PyObject *, MenuHandle *); +#endif /* !__LP64__ */ + +/* Qd exports */ +#ifndef __LP64__ +extern PyObject *GrafObj_New(GrafPtr); +extern int GrafObj_Convert(PyObject *, GrafPtr *); +extern PyObject *BMObj_New(BitMapPtr); +extern int BMObj_Convert(PyObject *, BitMapPtr *); +extern PyObject *QdRGB_New(RGBColor *); +extern int QdRGB_Convert(PyObject *, RGBColor *); +#endif /* !__LP64__ */ + +/* Qdoffs exports */ +#ifndef __LP64__ +extern PyObject *GWorldObj_New(GWorldPtr); +extern int GWorldObj_Convert(PyObject *, GWorldPtr *); +#endif /* !__LP64__ */ + +/* Qt exports */ +#ifndef __LP64__ +extern PyObject *TrackObj_New(Track); +extern int TrackObj_Convert(PyObject *, Track *); +extern PyObject *MovieObj_New(Movie); +extern int MovieObj_Convert(PyObject *, Movie *); +extern PyObject *MovieCtlObj_New(MovieController); +extern int MovieCtlObj_Convert(PyObject *, MovieController *); +extern PyObject *TimeBaseObj_New(TimeBase); +extern int TimeBaseObj_Convert(PyObject *, TimeBase *); +extern PyObject *UserDataObj_New(UserData); +extern int UserDataObj_Convert(PyObject *, UserData *); +extern PyObject *MediaObj_New(Media); +extern int MediaObj_Convert(PyObject *, Media *); +#endif /* !__LP64__ */ + +/* Res exports */ +extern PyObject *ResObj_New(Handle); +extern int ResObj_Convert(PyObject *, Handle *); +extern PyObject *OptResObj_New(Handle); +extern int OptResObj_Convert(PyObject *, Handle *); + +/* TE exports */ +#ifndef __LP64__ +extern PyObject *TEObj_New(TEHandle); +extern int TEObj_Convert(PyObject *, TEHandle *); +#endif /* !__LP64__ */ + +/* Win exports */ +#ifndef __LP64__ +extern PyObject *WinObj_New(WindowPtr); +extern int WinObj_Convert(PyObject *, WindowPtr *); +extern PyObject *WinObj_WhichWindow(WindowPtr); +#endif /* !__LP64__ */ + +/* CF exports */ +extern PyObject *CFObj_New(CFTypeRef); +extern int CFObj_Convert(PyObject *, CFTypeRef *); +extern PyObject *CFTypeRefObj_New(CFTypeRef); +extern int CFTypeRefObj_Convert(PyObject *, CFTypeRef *); +extern PyObject *CFStringRefObj_New(CFStringRef); +extern int CFStringRefObj_Convert(PyObject *, CFStringRef *); +extern PyObject *CFMutableStringRefObj_New(CFMutableStringRef); +extern int CFMutableStringRefObj_Convert(PyObject *, CFMutableStringRef *); +extern PyObject *CFArrayRefObj_New(CFArrayRef); +extern int CFArrayRefObj_Convert(PyObject *, CFArrayRef *); +extern PyObject *CFMutableArrayRefObj_New(CFMutableArrayRef); +extern int CFMutableArrayRefObj_Convert(PyObject *, CFMutableArrayRef *); +extern PyObject *CFDictionaryRefObj_New(CFDictionaryRef); +extern int CFDictionaryRefObj_Convert(PyObject *, CFDictionaryRef *); +extern PyObject *CFMutableDictionaryRefObj_New(CFMutableDictionaryRef); +extern int CFMutableDictionaryRefObj_Convert(PyObject *, CFMutableDictionaryRef *); +extern PyObject *CFURLRefObj_New(CFURLRef); +extern int CFURLRefObj_Convert(PyObject *, CFURLRef *); +extern int OptionalCFURLRefObj_Convert(PyObject *, CFURLRef *); + +#ifdef __cplusplus + } +#endif +#endif diff --git a/extern/include/Python-2.7/pymath.h b/extern/include/Python-2.7/pymath.h new file mode 100644 index 0000000..e3cf22b --- /dev/null +++ b/extern/include/Python-2.7/pymath.h @@ -0,0 +1,192 @@ +#ifndef Py_PYMATH_H +#define Py_PYMATH_H + +#include "pyconfig.h" /* include for defines */ + +/************************************************************************** +Symbols and macros to supply platform-independent interfaces to mathematical +functions and constants +**************************************************************************/ + +/* Python provides implementations for copysign, round and hypot in + * Python/pymath.c just in case your math library doesn't provide the + * functions. + * + *Note: PC/pyconfig.h defines copysign as _copysign + */ +#ifndef HAVE_COPYSIGN +extern double copysign(double, double); +#endif + +#ifndef HAVE_ROUND +extern double round(double); +#endif + +#ifndef HAVE_HYPOT +extern double hypot(double, double); +#endif + +/* extra declarations */ +#ifndef _MSC_VER +#ifndef __STDC__ +extern double fmod (double, double); +extern double frexp (double, int *); +extern double ldexp (double, int); +extern double modf (double, double *); +extern double pow(double, double); +#endif /* __STDC__ */ +#endif /* _MSC_VER */ + +#ifdef _OSF_SOURCE +/* OSF1 5.1 doesn't make these available with XOPEN_SOURCE_EXTENDED defined */ +extern int finite(double); +extern double copysign(double, double); +#endif + +/* High precision defintion of pi and e (Euler) + * The values are taken from libc6's math.h. + */ +#ifndef Py_MATH_PIl +#define Py_MATH_PIl 3.1415926535897932384626433832795029L +#endif +#ifndef Py_MATH_PI +#define Py_MATH_PI 3.14159265358979323846 +#endif + +#ifndef Py_MATH_El +#define Py_MATH_El 2.7182818284590452353602874713526625L +#endif + +#ifndef Py_MATH_E +#define Py_MATH_E 2.7182818284590452354 +#endif + +/* On x86, Py_FORCE_DOUBLE forces a floating-point number out of an x87 FPU + register and into a 64-bit memory location, rounding from extended + precision to double precision in the process. On other platforms it does + nothing. */ + +/* we take double rounding as evidence of x87 usage */ +#ifndef Py_FORCE_DOUBLE +# ifdef X87_DOUBLE_ROUNDING +PyAPI_FUNC(double) _Py_force_double(double); +# define Py_FORCE_DOUBLE(X) (_Py_force_double(X)) +# else +# define Py_FORCE_DOUBLE(X) (X) +# endif +#endif + +#ifdef HAVE_GCC_ASM_FOR_X87 +PyAPI_FUNC(unsigned short) _Py_get_387controlword(void); +PyAPI_FUNC(void) _Py_set_387controlword(unsigned short); +#endif + +/* Py_IS_NAN(X) + * Return 1 if float or double arg is a NaN, else 0. + * Caution: + * X is evaluated more than once. + * This may not work on all platforms. Each platform has *some* + * way to spell this, though -- override in pyconfig.h if you have + * a platform where it doesn't work. + * Note: PC/pyconfig.h defines Py_IS_NAN as _isnan + */ +#ifndef Py_IS_NAN +#if defined HAVE_DECL_ISNAN && HAVE_DECL_ISNAN == 1 +#define Py_IS_NAN(X) isnan(X) +#else +#define Py_IS_NAN(X) ((X) != (X)) +#endif +#endif + +/* Py_IS_INFINITY(X) + * Return 1 if float or double arg is an infinity, else 0. + * Caution: + * X is evaluated more than once. + * This implementation may set the underflow flag if |X| is very small; + * it really can't be implemented correctly (& easily) before C99. + * Override in pyconfig.h if you have a better spelling on your platform. + * Py_FORCE_DOUBLE is used to avoid getting false negatives from a + * non-infinite value v sitting in an 80-bit x87 register such that + * v becomes infinite when spilled from the register to 64-bit memory. + * Note: PC/pyconfig.h defines Py_IS_INFINITY as _isinf + */ +#ifndef Py_IS_INFINITY +# if defined HAVE_DECL_ISINF && HAVE_DECL_ISINF == 1 +# define Py_IS_INFINITY(X) isinf(X) +# else +# define Py_IS_INFINITY(X) ((X) && \ + (Py_FORCE_DOUBLE(X)*0.5 == Py_FORCE_DOUBLE(X))) +# endif +#endif + +/* Py_IS_FINITE(X) + * Return 1 if float or double arg is neither infinite nor NAN, else 0. + * Some compilers (e.g. VisualStudio) have intrisics for this, so a special + * macro for this particular test is useful + * Note: PC/pyconfig.h defines Py_IS_FINITE as _finite + */ +#ifndef Py_IS_FINITE +#if defined HAVE_DECL_ISFINITE && HAVE_DECL_ISFINITE == 1 +#define Py_IS_FINITE(X) isfinite(X) +#elif defined HAVE_FINITE +#define Py_IS_FINITE(X) finite(X) +#else +#define Py_IS_FINITE(X) (!Py_IS_INFINITY(X) && !Py_IS_NAN(X)) +#endif +#endif + +/* HUGE_VAL is supposed to expand to a positive double infinity. Python + * uses Py_HUGE_VAL instead because some platforms are broken in this + * respect. We used to embed code in pyport.h to try to worm around that, + * but different platforms are broken in conflicting ways. If you're on + * a platform where HUGE_VAL is defined incorrectly, fiddle your Python + * config to #define Py_HUGE_VAL to something that works on your platform. + */ +#ifndef Py_HUGE_VAL +#define Py_HUGE_VAL HUGE_VAL +#endif + +/* Py_NAN + * A value that evaluates to a NaN. On IEEE 754 platforms INF*0 or + * INF/INF works. Define Py_NO_NAN in pyconfig.h if your platform + * doesn't support NaNs. + */ +#if !defined(Py_NAN) && !defined(Py_NO_NAN) +#define Py_NAN (Py_HUGE_VAL * 0.) +#endif + +/* Py_OVERFLOWED(X) + * Return 1 iff a libm function overflowed. Set errno to 0 before calling + * a libm function, and invoke this macro after, passing the function + * result. + * Caution: + * This isn't reliable. C99 no longer requires libm to set errno under + * any exceptional condition, but does require +- HUGE_VAL return + * values on overflow. A 754 box *probably* maps HUGE_VAL to a + * double infinity, and we're cool if that's so, unless the input + * was an infinity and an infinity is the expected result. A C89 + * system sets errno to ERANGE, so we check for that too. We're + * out of luck if a C99 754 box doesn't map HUGE_VAL to +Inf, or + * if the returned result is a NaN, or if a C89 box returns HUGE_VAL + * in non-overflow cases. + * X is evaluated more than once. + * Some platforms have better way to spell this, so expect some #ifdef'ery. + * + * OpenBSD uses 'isinf()' because a compiler bug on that platform causes + * the longer macro version to be mis-compiled. This isn't optimal, and + * should be removed once a newer compiler is available on that platform. + * The system that had the failure was running OpenBSD 3.2 on Intel, with + * gcc 2.95.3. + * + * According to Tim's checkin, the FreeBSD systems use isinf() to work + * around a FPE bug on that platform. + */ +#if defined(__FreeBSD__) || defined(__OpenBSD__) +#define Py_OVERFLOWED(X) isinf(X) +#else +#define Py_OVERFLOWED(X) ((X) != 0.0 && (errno == ERANGE || \ + (X) == Py_HUGE_VAL || \ + (X) == -Py_HUGE_VAL)) +#endif + +#endif /* Py_PYMATH_H */ diff --git a/extern/include/Python-2.7/pymem.h b/extern/include/Python-2.7/pymem.h new file mode 100644 index 0000000..10b5bea --- /dev/null +++ b/extern/include/Python-2.7/pymem.h @@ -0,0 +1,122 @@ +/* The PyMem_ family: low-level memory allocation interfaces. + See objimpl.h for the PyObject_ memory family. +*/ + +#ifndef Py_PYMEM_H +#define Py_PYMEM_H + +#include "pyport.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* BEWARE: + + Each interface exports both functions and macros. Extension modules should + use the functions, to ensure binary compatibility across Python versions. + Because the Python implementation is free to change internal details, and + the macros may (or may not) expose details for speed, if you do use the + macros you must recompile your extensions with each Python release. + + Never mix calls to PyMem_ with calls to the platform malloc/realloc/ + calloc/free. For example, on Windows different DLLs may end up using + different heaps, and if you use PyMem_Malloc you'll get the memory from the + heap used by the Python DLL; it could be a disaster if you free()'ed that + directly in your own extension. Using PyMem_Free instead ensures Python + can return the memory to the proper heap. As another example, in + PYMALLOC_DEBUG mode, Python wraps all calls to all PyMem_ and PyObject_ + memory functions in special debugging wrappers that add additional + debugging info to dynamic memory blocks. The system routines have no idea + what to do with that stuff, and the Python wrappers have no idea what to do + with raw blocks obtained directly by the system routines then. + + The GIL must be held when using these APIs. +*/ + +/* + * Raw memory interface + * ==================== + */ + +/* Functions + + Functions supplying platform-independent semantics for malloc/realloc/ + free. These functions make sure that allocating 0 bytes returns a distinct + non-NULL pointer (whenever possible -- if we're flat out of memory, NULL + may be returned), even if the platform malloc and realloc don't. + Returned pointers must be checked for NULL explicitly. No action is + performed on failure (no exception is set, no warning is printed, etc). +*/ + +PyAPI_FUNC(void *) PyMem_Malloc(size_t); +PyAPI_FUNC(void *) PyMem_Realloc(void *, size_t); +PyAPI_FUNC(void) PyMem_Free(void *); + +/* Starting from Python 1.6, the wrappers Py_{Malloc,Realloc,Free} are + no longer supported. They used to call PyErr_NoMemory() on failure. */ + +/* Macros. */ +#ifdef PYMALLOC_DEBUG +/* Redirect all memory operations to Python's debugging allocator. */ +#define PyMem_MALLOC _PyMem_DebugMalloc +#define PyMem_REALLOC _PyMem_DebugRealloc +#define PyMem_FREE _PyMem_DebugFree + +#else /* ! PYMALLOC_DEBUG */ + +/* PyMem_MALLOC(0) means malloc(1). Some systems would return NULL + for malloc(0), which would be treated as an error. Some platforms + would return a pointer with no memory behind it, which would break + pymalloc. To solve these problems, allocate an extra byte. */ +/* Returns NULL to indicate error if a negative size or size larger than + Py_ssize_t can represent is supplied. Helps prevents security holes. */ +#define PyMem_MALLOC(n) ((size_t)(n) > (size_t)PY_SSIZE_T_MAX ? NULL \ + : malloc((n) ? (n) : 1)) +#define PyMem_REALLOC(p, n) ((size_t)(n) > (size_t)PY_SSIZE_T_MAX ? NULL \ + : realloc((p), (n) ? (n) : 1)) +#define PyMem_FREE free + +#endif /* PYMALLOC_DEBUG */ + +/* + * Type-oriented memory interface + * ============================== + * + * Allocate memory for n objects of the given type. Returns a new pointer + * or NULL if the request was too large or memory allocation failed. Use + * these macros rather than doing the multiplication yourself so that proper + * overflow checking is always done. + */ + +#define PyMem_New(type, n) \ + ( ((size_t)(n) > PY_SSIZE_T_MAX / sizeof(type)) ? NULL : \ + ( (type *) PyMem_Malloc((n) * sizeof(type)) ) ) +#define PyMem_NEW(type, n) \ + ( ((size_t)(n) > PY_SSIZE_T_MAX / sizeof(type)) ? NULL : \ + ( (type *) PyMem_MALLOC((n) * sizeof(type)) ) ) + +/* + * The value of (p) is always clobbered by this macro regardless of success. + * The caller MUST check if (p) is NULL afterwards and deal with the memory + * error if so. This means the original value of (p) MUST be saved for the + * caller's memory error handler to not lose track of it. + */ +#define PyMem_Resize(p, type, n) \ + ( (p) = ((size_t)(n) > PY_SSIZE_T_MAX / sizeof(type)) ? NULL : \ + (type *) PyMem_Realloc((p), (n) * sizeof(type)) ) +#define PyMem_RESIZE(p, type, n) \ + ( (p) = ((size_t)(n) > PY_SSIZE_T_MAX / sizeof(type)) ? NULL : \ + (type *) PyMem_REALLOC((p), (n) * sizeof(type)) ) + +/* PyMem{Del,DEL} are left over from ancient days, and shouldn't be used + * anymore. They're just confusing aliases for PyMem_{Free,FREE} now. + */ +#define PyMem_Del PyMem_Free +#define PyMem_DEL PyMem_FREE + +#ifdef __cplusplus +} +#endif + +#endif /* !Py_PYMEM_H */ diff --git a/extern/include/Python-2.7/pyport.h b/extern/include/Python-2.7/pyport.h new file mode 100644 index 0000000..85e852f --- /dev/null +++ b/extern/include/Python-2.7/pyport.h @@ -0,0 +1,941 @@ +#ifndef Py_PYPORT_H +#define Py_PYPORT_H + +#include "pyconfig.h" /* include for defines */ + +/* Some versions of HP-UX & Solaris need inttypes.h for int32_t, + INT32_MAX, etc. */ +#ifdef HAVE_INTTYPES_H +#include +#endif + +#ifdef HAVE_STDINT_H +#include +#endif + +/************************************************************************** +Symbols and macros to supply platform-independent interfaces to basic +C language & library operations whose spellings vary across platforms. + +Please try to make documentation here as clear as possible: by definition, +the stuff here is trying to illuminate C's darkest corners. + +Config #defines referenced here: + +SIGNED_RIGHT_SHIFT_ZERO_FILLS +Meaning: To be defined iff i>>j does not extend the sign bit when i is a + signed integral type and i < 0. +Used in: Py_ARITHMETIC_RIGHT_SHIFT + +Py_DEBUG +Meaning: Extra checks compiled in for debug mode. +Used in: Py_SAFE_DOWNCAST + +HAVE_UINTPTR_T +Meaning: The C9X type uintptr_t is supported by the compiler +Used in: Py_uintptr_t + +HAVE_LONG_LONG +Meaning: The compiler supports the C type "long long" +Used in: PY_LONG_LONG + +**************************************************************************/ + + +/* For backward compatibility only. Obsolete, do not use. */ +#ifdef HAVE_PROTOTYPES +#define Py_PROTO(x) x +#else +#define Py_PROTO(x) () +#endif +#ifndef Py_FPROTO +#define Py_FPROTO(x) Py_PROTO(x) +#endif + +/* typedefs for some C9X-defined synonyms for integral types. + * + * The names in Python are exactly the same as the C9X names, except with a + * Py_ prefix. Until C9X is universally implemented, this is the only way + * to ensure that Python gets reliable names that don't conflict with names + * in non-Python code that are playing their own tricks to define the C9X + * names. + * + * NOTE: don't go nuts here! Python has no use for *most* of the C9X + * integral synonyms. Only define the ones we actually need. + */ + +#ifdef HAVE_LONG_LONG +#ifndef PY_LONG_LONG +#define PY_LONG_LONG long long +#if defined(LLONG_MAX) +/* If LLONG_MAX is defined in limits.h, use that. */ +#define PY_LLONG_MIN LLONG_MIN +#define PY_LLONG_MAX LLONG_MAX +#define PY_ULLONG_MAX ULLONG_MAX +#elif defined(__LONG_LONG_MAX__) +/* Otherwise, if GCC has a builtin define, use that. */ +#define PY_LLONG_MAX __LONG_LONG_MAX__ +#define PY_LLONG_MIN (-PY_LLONG_MAX-1) +#define PY_ULLONG_MAX (__LONG_LONG_MAX__*2ULL + 1ULL) +#else +/* Otherwise, rely on two's complement. */ +#define PY_ULLONG_MAX (~0ULL) +#define PY_LLONG_MAX ((long long)(PY_ULLONG_MAX>>1)) +#define PY_LLONG_MIN (-PY_LLONG_MAX-1) +#endif /* LLONG_MAX */ +#endif +#endif /* HAVE_LONG_LONG */ + +/* a build with 30-bit digits for Python long integers needs an exact-width + * 32-bit unsigned integer type to store those digits. (We could just use + * type 'unsigned long', but that would be wasteful on a system where longs + * are 64-bits.) On Unix systems, the autoconf macro AC_TYPE_UINT32_T defines + * uint32_t to be such a type unless stdint.h or inttypes.h defines uint32_t. + * However, it doesn't set HAVE_UINT32_T, so we do that here. + */ +#ifdef uint32_t +#define HAVE_UINT32_T 1 +#endif + +#ifdef HAVE_UINT32_T +#ifndef PY_UINT32_T +#define PY_UINT32_T uint32_t +#endif +#endif + +/* Macros for a 64-bit unsigned integer type; used for type 'twodigits' in the + * long integer implementation, when 30-bit digits are enabled. + */ +#ifdef uint64_t +#define HAVE_UINT64_T 1 +#endif + +#ifdef HAVE_UINT64_T +#ifndef PY_UINT64_T +#define PY_UINT64_T uint64_t +#endif +#endif + +/* Signed variants of the above */ +#ifdef int32_t +#define HAVE_INT32_T 1 +#endif + +#ifdef HAVE_INT32_T +#ifndef PY_INT32_T +#define PY_INT32_T int32_t +#endif +#endif + +#ifdef int64_t +#define HAVE_INT64_T 1 +#endif + +#ifdef HAVE_INT64_T +#ifndef PY_INT64_T +#define PY_INT64_T int64_t +#endif +#endif + +/* If PYLONG_BITS_IN_DIGIT is not defined then we'll use 30-bit digits if all + the necessary integer types are available, and we're on a 64-bit platform + (as determined by SIZEOF_VOID_P); otherwise we use 15-bit digits. */ + +#ifndef PYLONG_BITS_IN_DIGIT +#if (defined HAVE_UINT64_T && defined HAVE_INT64_T && \ + defined HAVE_UINT32_T && defined HAVE_INT32_T && SIZEOF_VOID_P >= 8) +#define PYLONG_BITS_IN_DIGIT 30 +#else +#define PYLONG_BITS_IN_DIGIT 15 +#endif +#endif + +/* uintptr_t is the C9X name for an unsigned integral type such that a + * legitimate void* can be cast to uintptr_t and then back to void* again + * without loss of information. Similarly for intptr_t, wrt a signed + * integral type. + */ +#ifdef HAVE_UINTPTR_T +typedef uintptr_t Py_uintptr_t; +typedef intptr_t Py_intptr_t; + +#elif SIZEOF_VOID_P <= SIZEOF_INT +typedef unsigned int Py_uintptr_t; +typedef int Py_intptr_t; + +#elif SIZEOF_VOID_P <= SIZEOF_LONG +typedef unsigned long Py_uintptr_t; +typedef long Py_intptr_t; + +#elif defined(HAVE_LONG_LONG) && (SIZEOF_VOID_P <= SIZEOF_LONG_LONG) +typedef unsigned PY_LONG_LONG Py_uintptr_t; +typedef PY_LONG_LONG Py_intptr_t; + +#else +# error "Python needs a typedef for Py_uintptr_t in pyport.h." +#endif /* HAVE_UINTPTR_T */ + +/* Py_ssize_t is a signed integral type such that sizeof(Py_ssize_t) == + * sizeof(size_t). C99 doesn't define such a thing directly (size_t is an + * unsigned integral type). See PEP 353 for details. + */ +#ifdef HAVE_SSIZE_T +typedef ssize_t Py_ssize_t; +#elif SIZEOF_VOID_P == SIZEOF_SIZE_T +typedef Py_intptr_t Py_ssize_t; +#else +# error "Python needs a typedef for Py_ssize_t in pyport.h." +#endif + +/* Largest possible value of size_t. + SIZE_MAX is part of C99, so it might be defined on some + platforms. If it is not defined, (size_t)-1 is a portable + definition for C89, due to the way signed->unsigned + conversion is defined. */ +#ifdef SIZE_MAX +#define PY_SIZE_MAX SIZE_MAX +#else +#define PY_SIZE_MAX ((size_t)-1) +#endif + +/* Largest positive value of type Py_ssize_t. */ +#define PY_SSIZE_T_MAX ((Py_ssize_t)(((size_t)-1)>>1)) +/* Smallest negative value of type Py_ssize_t. */ +#define PY_SSIZE_T_MIN (-PY_SSIZE_T_MAX-1) + +#if SIZEOF_PID_T > SIZEOF_LONG +# error "Python doesn't support sizeof(pid_t) > sizeof(long)" +#endif + +/* PY_FORMAT_SIZE_T is a platform-specific modifier for use in a printf + * format to convert an argument with the width of a size_t or Py_ssize_t. + * C99 introduced "z" for this purpose, but not all platforms support that; + * e.g., MS compilers use "I" instead. + * + * These "high level" Python format functions interpret "z" correctly on + * all platforms (Python interprets the format string itself, and does whatever + * the platform C requires to convert a size_t/Py_ssize_t argument): + * + * PyString_FromFormat + * PyErr_Format + * PyString_FromFormatV + * + * Lower-level uses require that you interpolate the correct format modifier + * yourself (e.g., calling printf, fprintf, sprintf, PyOS_snprintf); for + * example, + * + * Py_ssize_t index; + * fprintf(stderr, "index %" PY_FORMAT_SIZE_T "d sucks\n", index); + * + * That will expand to %ld, or %Id, or to something else correct for a + * Py_ssize_t on the platform. + */ +#ifndef PY_FORMAT_SIZE_T +# if SIZEOF_SIZE_T == SIZEOF_INT && !defined(__APPLE__) +# define PY_FORMAT_SIZE_T "" +# elif SIZEOF_SIZE_T == SIZEOF_LONG +# define PY_FORMAT_SIZE_T "l" +# elif defined(MS_WINDOWS) +# define PY_FORMAT_SIZE_T "I" +# else +# error "This platform's pyconfig.h needs to define PY_FORMAT_SIZE_T" +# endif +#endif + +/* PY_FORMAT_LONG_LONG is analogous to PY_FORMAT_SIZE_T above, but for + * the long long type instead of the size_t type. It's only available + * when HAVE_LONG_LONG is defined. The "high level" Python format + * functions listed above will interpret "lld" or "llu" correctly on + * all platforms. + */ +#ifdef HAVE_LONG_LONG +# ifndef PY_FORMAT_LONG_LONG +# if defined(MS_WIN64) || defined(MS_WINDOWS) +# define PY_FORMAT_LONG_LONG "I64" +# else +# error "This platform's pyconfig.h needs to define PY_FORMAT_LONG_LONG" +# endif +# endif +#endif + +/* Py_LOCAL can be used instead of static to get the fastest possible calling + * convention for functions that are local to a given module. + * + * Py_LOCAL_INLINE does the same thing, and also explicitly requests inlining, + * for platforms that support that. + * + * If PY_LOCAL_AGGRESSIVE is defined before python.h is included, more + * "aggressive" inlining/optimizaion is enabled for the entire module. This + * may lead to code bloat, and may slow things down for those reasons. It may + * also lead to errors, if the code relies on pointer aliasing. Use with + * care. + * + * NOTE: You can only use this for functions that are entirely local to a + * module; functions that are exported via method tables, callbacks, etc, + * should keep using static. + */ + +#undef USE_INLINE /* XXX - set via configure? */ + +#if defined(_MSC_VER) +#if defined(PY_LOCAL_AGGRESSIVE) +/* enable more aggressive optimization for visual studio */ +#pragma optimize("agtw", on) +#endif +/* ignore warnings if the compiler decides not to inline a function */ +#pragma warning(disable: 4710) +/* fastest possible local call under MSVC */ +#define Py_LOCAL(type) static type __fastcall +#define Py_LOCAL_INLINE(type) static __inline type __fastcall +#elif defined(USE_INLINE) +#define Py_LOCAL(type) static type +#define Py_LOCAL_INLINE(type) static inline type +#else +#define Py_LOCAL(type) static type +#define Py_LOCAL_INLINE(type) static type +#endif + +/* Py_MEMCPY can be used instead of memcpy in cases where the copied blocks + * are often very short. While most platforms have highly optimized code for + * large transfers, the setup costs for memcpy are often quite high. MEMCPY + * solves this by doing short copies "in line". + */ + +#if defined(_MSC_VER) +#define Py_MEMCPY(target, source, length) do { \ + size_t i_, n_ = (length); \ + char *t_ = (void*) (target); \ + const char *s_ = (void*) (source); \ + if (n_ >= 16) \ + memcpy(t_, s_, n_); \ + else \ + for (i_ = 0; i_ < n_; i_++) \ + t_[i_] = s_[i_]; \ + } while (0) +#else +#define Py_MEMCPY memcpy +#endif + +#include + +#ifdef HAVE_IEEEFP_H +#include /* needed for 'finite' declaration on some platforms */ +#endif + +#include /* Moved here from the math section, before extern "C" */ + +/******************************************** + * WRAPPER FOR and/or * + ********************************************/ + +#ifdef TIME_WITH_SYS_TIME +#include +#include +#else /* !TIME_WITH_SYS_TIME */ +#ifdef HAVE_SYS_TIME_H +#include +#else /* !HAVE_SYS_TIME_H */ +#include +#endif /* !HAVE_SYS_TIME_H */ +#endif /* !TIME_WITH_SYS_TIME */ + + +/****************************** + * WRAPPER FOR * + ******************************/ + +/* NB caller must include */ + +#ifdef HAVE_SYS_SELECT_H + +#include + +#endif /* !HAVE_SYS_SELECT_H */ + +/******************************* + * stat() and fstat() fiddling * + *******************************/ + +/* We expect that stat and fstat exist on most systems. + * It's confirmed on Unix, Mac and Windows. + * If you don't have them, add + * #define DONT_HAVE_STAT + * and/or + * #define DONT_HAVE_FSTAT + * to your pyconfig.h. Python code beyond this should check HAVE_STAT and + * HAVE_FSTAT instead. + * Also + * #define HAVE_SYS_STAT_H + * if exists on your platform, and + * #define HAVE_STAT_H + * if does. + */ +#ifndef DONT_HAVE_STAT +#define HAVE_STAT +#endif + +#ifndef DONT_HAVE_FSTAT +#define HAVE_FSTAT +#endif + +#ifdef RISCOS +#include +#include "unixstuff.h" +#endif + +#ifdef HAVE_SYS_STAT_H +#if defined(PYOS_OS2) && defined(PYCC_GCC) +#include +#endif +#include +#elif defined(HAVE_STAT_H) +#include +#endif + +#if defined(PYCC_VACPP) +/* VisualAge C/C++ Failed to Define MountType Field in sys/stat.h */ +#define S_IFMT (S_IFDIR|S_IFCHR|S_IFREG) +#endif + +#ifndef S_ISREG +#define S_ISREG(x) (((x) & S_IFMT) == S_IFREG) +#endif + +#ifndef S_ISDIR +#define S_ISDIR(x) (((x) & S_IFMT) == S_IFDIR) +#endif + + +#ifdef __cplusplus +/* Move this down here since some C++ #include's don't like to be included + inside an extern "C" */ +extern "C" { +#endif + + +/* Py_ARITHMETIC_RIGHT_SHIFT + * C doesn't define whether a right-shift of a signed integer sign-extends + * or zero-fills. Here a macro to force sign extension: + * Py_ARITHMETIC_RIGHT_SHIFT(TYPE, I, J) + * Return I >> J, forcing sign extension. Arithmetically, return the + * floor of I/2**J. + * Requirements: + * I should have signed integer type. In the terminology of C99, this can + * be either one of the five standard signed integer types (signed char, + * short, int, long, long long) or an extended signed integer type. + * J is an integer >= 0 and strictly less than the number of bits in the + * type of I (because C doesn't define what happens for J outside that + * range either). + * TYPE used to specify the type of I, but is now ignored. It's been left + * in for backwards compatibility with versions <= 2.6 or 3.0. + * Caution: + * I may be evaluated more than once. + */ +#ifdef SIGNED_RIGHT_SHIFT_ZERO_FILLS +#define Py_ARITHMETIC_RIGHT_SHIFT(TYPE, I, J) \ + ((I) < 0 ? -1-((-1-(I)) >> (J)) : (I) >> (J)) +#else +#define Py_ARITHMETIC_RIGHT_SHIFT(TYPE, I, J) ((I) >> (J)) +#endif + +/* Py_FORCE_EXPANSION(X) + * "Simply" returns its argument. However, macro expansions within the + * argument are evaluated. This unfortunate trickery is needed to get + * token-pasting to work as desired in some cases. + */ +#define Py_FORCE_EXPANSION(X) X + +/* Py_SAFE_DOWNCAST(VALUE, WIDE, NARROW) + * Cast VALUE to type NARROW from type WIDE. In Py_DEBUG mode, this + * assert-fails if any information is lost. + * Caution: + * VALUE may be evaluated more than once. + */ +#ifdef Py_DEBUG +#define Py_SAFE_DOWNCAST(VALUE, WIDE, NARROW) \ + (assert((WIDE)(NARROW)(VALUE) == (VALUE)), (NARROW)(VALUE)) +#else +#define Py_SAFE_DOWNCAST(VALUE, WIDE, NARROW) (NARROW)(VALUE) +#endif + +/* Py_SET_ERRNO_ON_MATH_ERROR(x) + * If a libm function did not set errno, but it looks like the result + * overflowed or not-a-number, set errno to ERANGE or EDOM. Set errno + * to 0 before calling a libm function, and invoke this macro after, + * passing the function result. + * Caution: + * This isn't reliable. See Py_OVERFLOWED comments. + * X is evaluated more than once. + */ +#if defined(__FreeBSD__) || defined(__OpenBSD__) || (defined(__hpux) && defined(__ia64)) +#define _Py_SET_EDOM_FOR_NAN(X) if (isnan(X)) errno = EDOM; +#else +#define _Py_SET_EDOM_FOR_NAN(X) ; +#endif +#define Py_SET_ERRNO_ON_MATH_ERROR(X) \ + do { \ + if (errno == 0) { \ + if ((X) == Py_HUGE_VAL || (X) == -Py_HUGE_VAL) \ + errno = ERANGE; \ + else _Py_SET_EDOM_FOR_NAN(X) \ + } \ + } while(0) + +/* Py_SET_ERANGE_ON_OVERFLOW(x) + * An alias of Py_SET_ERRNO_ON_MATH_ERROR for backward-compatibility. + */ +#define Py_SET_ERANGE_IF_OVERFLOW(X) Py_SET_ERRNO_ON_MATH_ERROR(X) + +/* Py_ADJUST_ERANGE1(x) + * Py_ADJUST_ERANGE2(x, y) + * Set errno to 0 before calling a libm function, and invoke one of these + * macros after, passing the function result(s) (Py_ADJUST_ERANGE2 is useful + * for functions returning complex results). This makes two kinds of + * adjustments to errno: (A) If it looks like the platform libm set + * errno=ERANGE due to underflow, clear errno. (B) If it looks like the + * platform libm overflowed but didn't set errno, force errno to ERANGE. In + * effect, we're trying to force a useful implementation of C89 errno + * behavior. + * Caution: + * This isn't reliable. See Py_OVERFLOWED comments. + * X and Y may be evaluated more than once. + */ +#define Py_ADJUST_ERANGE1(X) \ + do { \ + if (errno == 0) { \ + if ((X) == Py_HUGE_VAL || (X) == -Py_HUGE_VAL) \ + errno = ERANGE; \ + } \ + else if (errno == ERANGE && (X) == 0.0) \ + errno = 0; \ + } while(0) + +#define Py_ADJUST_ERANGE2(X, Y) \ + do { \ + if ((X) == Py_HUGE_VAL || (X) == -Py_HUGE_VAL || \ + (Y) == Py_HUGE_VAL || (Y) == -Py_HUGE_VAL) { \ + if (errno == 0) \ + errno = ERANGE; \ + } \ + else if (errno == ERANGE) \ + errno = 0; \ + } while(0) + +/* The functions _Py_dg_strtod and _Py_dg_dtoa in Python/dtoa.c (which are + * required to support the short float repr introduced in Python 3.1) require + * that the floating-point unit that's being used for arithmetic operations + * on C doubles is set to use 53-bit precision. It also requires that the + * FPU rounding mode is round-half-to-even, but that's less often an issue. + * + * If your FPU isn't already set to 53-bit precision/round-half-to-even, and + * you want to make use of _Py_dg_strtod and _Py_dg_dtoa, then you should + * + * #define HAVE_PY_SET_53BIT_PRECISION 1 + * + * and also give appropriate definitions for the following three macros: + * + * _PY_SET_53BIT_PRECISION_START : store original FPU settings, and + * set FPU to 53-bit precision/round-half-to-even + * _PY_SET_53BIT_PRECISION_END : restore original FPU settings + * _PY_SET_53BIT_PRECISION_HEADER : any variable declarations needed to + * use the two macros above. + * + * The macros are designed to be used within a single C function: see + * Python/pystrtod.c for an example of their use. + */ + +/* get and set x87 control word for gcc/x86 */ +#ifdef HAVE_GCC_ASM_FOR_X87 +#define HAVE_PY_SET_53BIT_PRECISION 1 +/* _Py_get/set_387controlword functions are defined in Python/pymath.c */ +#define _Py_SET_53BIT_PRECISION_HEADER \ + unsigned short old_387controlword, new_387controlword +#define _Py_SET_53BIT_PRECISION_START \ + do { \ + old_387controlword = _Py_get_387controlword(); \ + new_387controlword = (old_387controlword & ~0x0f00) | 0x0200; \ + if (new_387controlword != old_387controlword) \ + _Py_set_387controlword(new_387controlword); \ + } while (0) +#define _Py_SET_53BIT_PRECISION_END \ + if (new_387controlword != old_387controlword) \ + _Py_set_387controlword(old_387controlword) +#endif + +/* get and set x87 control word for VisualStudio/x86 */ +#if defined(_MSC_VER) && !defined(_WIN64) /* x87 not supported in 64-bit */ +#define HAVE_PY_SET_53BIT_PRECISION 1 +#define _Py_SET_53BIT_PRECISION_HEADER \ + unsigned int old_387controlword, new_387controlword, out_387controlword +/* We use the __control87_2 function to set only the x87 control word. + The SSE control word is unaffected. */ +#define _Py_SET_53BIT_PRECISION_START \ + do { \ + __control87_2(0, 0, &old_387controlword, NULL); \ + new_387controlword = \ + (old_387controlword & ~(_MCW_PC | _MCW_RC)) | (_PC_53 | _RC_NEAR); \ + if (new_387controlword != old_387controlword) \ + __control87_2(new_387controlword, _MCW_PC | _MCW_RC, \ + &out_387controlword, NULL); \ + } while (0) +#define _Py_SET_53BIT_PRECISION_END \ + do { \ + if (new_387controlword != old_387controlword) \ + __control87_2(old_387controlword, _MCW_PC | _MCW_RC, \ + &out_387controlword, NULL); \ + } while (0) +#endif + +/* default definitions are empty */ +#ifndef HAVE_PY_SET_53BIT_PRECISION +#define _Py_SET_53BIT_PRECISION_HEADER +#define _Py_SET_53BIT_PRECISION_START +#define _Py_SET_53BIT_PRECISION_END +#endif + +/* If we can't guarantee 53-bit precision, don't use the code + in Python/dtoa.c, but fall back to standard code. This + means that repr of a float will be long (17 sig digits). + + Realistically, there are two things that could go wrong: + + (1) doubles aren't IEEE 754 doubles, or + (2) we're on x86 with the rounding precision set to 64-bits + (extended precision), and we don't know how to change + the rounding precision. + */ + +#if !defined(DOUBLE_IS_LITTLE_ENDIAN_IEEE754) && \ + !defined(DOUBLE_IS_BIG_ENDIAN_IEEE754) && \ + !defined(DOUBLE_IS_ARM_MIXED_ENDIAN_IEEE754) +#define PY_NO_SHORT_FLOAT_REPR +#endif + +/* double rounding is symptomatic of use of extended precision on x86. If + we're seeing double rounding, and we don't have any mechanism available for + changing the FPU rounding precision, then don't use Python/dtoa.c. */ +#if defined(X87_DOUBLE_ROUNDING) && !defined(HAVE_PY_SET_53BIT_PRECISION) +#define PY_NO_SHORT_FLOAT_REPR +#endif + +/* Py_DEPRECATED(version) + * Declare a variable, type, or function deprecated. + * Usage: + * extern int old_var Py_DEPRECATED(2.3); + * typedef int T1 Py_DEPRECATED(2.4); + * extern int x() Py_DEPRECATED(2.5); + */ +#if defined(__GNUC__) && ((__GNUC__ >= 4) || \ + (__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)) +#define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__)) +#else +#define Py_DEPRECATED(VERSION_UNUSED) +#endif + +/************************************************************************** +Prototypes that are missing from the standard include files on some systems +(and possibly only some versions of such systems.) + +Please be conservative with adding new ones, document them and enclose them +in platform-specific #ifdefs. +**************************************************************************/ + +#ifdef SOLARIS +/* Unchecked */ +extern int gethostname(char *, int); +#endif + +#ifdef __BEOS__ +/* Unchecked */ +/* It's in the libs, but not the headers... - [cjh] */ +int shutdown( int, int ); +#endif + +#ifdef HAVE__GETPTY +#include /* we need to import mode_t */ +extern char * _getpty(int *, int, mode_t, int); +#endif + +/* On QNX 6, struct termio must be declared by including sys/termio.h + if TCGETA, TCSETA, TCSETAW, or TCSETAF are used. sys/termio.h must + be included before termios.h or it will generate an error. */ +#if defined(HAVE_SYS_TERMIO_H) && !defined(__hpux) +#include +#endif + +#if defined(HAVE_OPENPTY) || defined(HAVE_FORKPTY) +#if !defined(HAVE_PTY_H) && !defined(HAVE_LIBUTIL_H) && !defined(HAVE_UTIL_H) +/* BSDI does not supply a prototype for the 'openpty' and 'forkpty' + functions, even though they are included in libutil. */ +#include +extern int openpty(int *, int *, char *, struct termios *, struct winsize *); +extern pid_t forkpty(int *, char *, struct termios *, struct winsize *); +#endif /* !defined(HAVE_PTY_H) && !defined(HAVE_LIBUTIL_H) */ +#endif /* defined(HAVE_OPENPTY) || defined(HAVE_FORKPTY) */ + + +/* These are pulled from various places. It isn't obvious on what platforms + they are necessary, nor what the exact prototype should look like (which + is likely to vary between platforms!) If you find you need one of these + declarations, please move them to a platform-specific block and include + proper prototypes. */ +#if 0 + +/* From Modules/resource.c */ +extern int getrusage(); +extern int getpagesize(); + +/* From Python/sysmodule.c and Modules/posixmodule.c */ +extern int fclose(FILE *); + +/* From Modules/posixmodule.c */ +extern int fdatasync(int); +#endif /* 0 */ + + +/* On 4.4BSD-descendants, ctype functions serves the whole range of + * wchar_t character set rather than single byte code points only. + * This characteristic can break some operations of string object + * including str.upper() and str.split() on UTF-8 locales. This + * workaround was provided by Tim Robbins of FreeBSD project. + */ + +#ifdef __FreeBSD__ +#include +#if __FreeBSD_version > 500039 +# define _PY_PORT_CTYPE_UTF8_ISSUE +#endif +#endif + + +#if defined(__APPLE__) +# define _PY_PORT_CTYPE_UTF8_ISSUE +#endif + +#ifdef _PY_PORT_CTYPE_UTF8_ISSUE +#include +#include +#undef isalnum +#define isalnum(c) iswalnum(btowc(c)) +#undef isalpha +#define isalpha(c) iswalpha(btowc(c)) +#undef islower +#define islower(c) iswlower(btowc(c)) +#undef isspace +#define isspace(c) iswspace(btowc(c)) +#undef isupper +#define isupper(c) iswupper(btowc(c)) +#undef tolower +#define tolower(c) towlower(btowc(c)) +#undef toupper +#define toupper(c) towupper(btowc(c)) +#endif + + +/* Declarations for symbol visibility. + + PyAPI_FUNC(type): Declares a public Python API function and return type + PyAPI_DATA(type): Declares public Python data and its type + PyMODINIT_FUNC: A Python module init function. If these functions are + inside the Python core, they are private to the core. + If in an extension module, it may be declared with + external linkage depending on the platform. + + As a number of platforms support/require "__declspec(dllimport/dllexport)", + we support a HAVE_DECLSPEC_DLL macro to save duplication. +*/ + +/* + All windows ports, except cygwin, are handled in PC/pyconfig.h. + + BeOS and cygwin are the only other autoconf platform requiring special + linkage handling and both of these use __declspec(). +*/ +#if defined(__CYGWIN__) || defined(__BEOS__) +# define HAVE_DECLSPEC_DLL +#endif + +/* only get special linkage if built as shared or platform is Cygwin */ +#if defined(Py_ENABLE_SHARED) || defined(__CYGWIN__) +# if defined(HAVE_DECLSPEC_DLL) +# ifdef Py_BUILD_CORE +# define PyAPI_FUNC(RTYPE) __declspec(dllexport) RTYPE +# define PyAPI_DATA(RTYPE) extern __declspec(dllexport) RTYPE + /* module init functions inside the core need no external linkage */ + /* except for Cygwin to handle embedding (FIXME: BeOS too?) */ +# if defined(__CYGWIN__) +# define PyMODINIT_FUNC __declspec(dllexport) void +# else /* __CYGWIN__ */ +# define PyMODINIT_FUNC void +# endif /* __CYGWIN__ */ +# else /* Py_BUILD_CORE */ + /* Building an extension module, or an embedded situation */ + /* public Python functions and data are imported */ + /* Under Cygwin, auto-import functions to prevent compilation */ + /* failures similar to those described at the bottom of 4.1: */ + /* http://docs.python.org/extending/windows.html#a-cookbook-approach */ +# if !defined(__CYGWIN__) +# define PyAPI_FUNC(RTYPE) __declspec(dllimport) RTYPE +# endif /* !__CYGWIN__ */ +# define PyAPI_DATA(RTYPE) extern __declspec(dllimport) RTYPE + /* module init functions outside the core must be exported */ +# if defined(__cplusplus) +# define PyMODINIT_FUNC extern "C" __declspec(dllexport) void +# else /* __cplusplus */ +# define PyMODINIT_FUNC __declspec(dllexport) void +# endif /* __cplusplus */ +# endif /* Py_BUILD_CORE */ +# endif /* HAVE_DECLSPEC */ +#endif /* Py_ENABLE_SHARED */ + +/* If no external linkage macros defined by now, create defaults */ +#ifndef PyAPI_FUNC +# define PyAPI_FUNC(RTYPE) RTYPE +#endif +#ifndef PyAPI_DATA +# define PyAPI_DATA(RTYPE) extern RTYPE +#endif +#ifndef PyMODINIT_FUNC +# if defined(__cplusplus) +# define PyMODINIT_FUNC extern "C" void +# else /* __cplusplus */ +# define PyMODINIT_FUNC void +# endif /* __cplusplus */ +#endif + +/* Deprecated DL_IMPORT and DL_EXPORT macros */ +#if defined(Py_ENABLE_SHARED) && defined (HAVE_DECLSPEC_DLL) +# if defined(Py_BUILD_CORE) +# define DL_IMPORT(RTYPE) __declspec(dllexport) RTYPE +# define DL_EXPORT(RTYPE) __declspec(dllexport) RTYPE +# else +# define DL_IMPORT(RTYPE) __declspec(dllimport) RTYPE +# define DL_EXPORT(RTYPE) __declspec(dllexport) RTYPE +# endif +#endif +#ifndef DL_EXPORT +# define DL_EXPORT(RTYPE) RTYPE +#endif +#ifndef DL_IMPORT +# define DL_IMPORT(RTYPE) RTYPE +#endif +/* End of deprecated DL_* macros */ + +/* If the fd manipulation macros aren't defined, + here is a set that should do the job */ + +#if 0 /* disabled and probably obsolete */ + +#ifndef FD_SETSIZE +#define FD_SETSIZE 256 +#endif + +#ifndef FD_SET + +typedef long fd_mask; + +#define NFDBITS (sizeof(fd_mask) * NBBY) /* bits per mask */ +#ifndef howmany +#define howmany(x, y) (((x)+((y)-1))/(y)) +#endif /* howmany */ + +typedef struct fd_set { + fd_mask fds_bits[howmany(FD_SETSIZE, NFDBITS)]; +} fd_set; + +#define FD_SET(n, p) ((p)->fds_bits[(n)/NFDBITS] |= (1 << ((n) % NFDBITS))) +#define FD_CLR(n, p) ((p)->fds_bits[(n)/NFDBITS] &= ~(1 << ((n) % NFDBITS))) +#define FD_ISSET(n, p) ((p)->fds_bits[(n)/NFDBITS] & (1 << ((n) % NFDBITS))) +#define FD_ZERO(p) memset((char *)(p), '\0', sizeof(*(p))) + +#endif /* FD_SET */ + +#endif /* fd manipulation macros */ + + +/* limits.h constants that may be missing */ + +#ifndef INT_MAX +#define INT_MAX 2147483647 +#endif + +#ifndef LONG_MAX +#if SIZEOF_LONG == 4 +#define LONG_MAX 0X7FFFFFFFL +#elif SIZEOF_LONG == 8 +#define LONG_MAX 0X7FFFFFFFFFFFFFFFL +#else +#error "could not set LONG_MAX in pyport.h" +#endif +#endif + +#ifndef LONG_MIN +#define LONG_MIN (-LONG_MAX-1) +#endif + +#ifndef LONG_BIT +#define LONG_BIT (8 * SIZEOF_LONG) +#endif + +#if LONG_BIT != 8 * SIZEOF_LONG +/* 04-Oct-2000 LONG_BIT is apparently (mis)defined as 64 on some recent + * 32-bit platforms using gcc. We try to catch that here at compile-time + * rather than waiting for integer multiplication to trigger bogus + * overflows. + */ +#error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)." +#endif + +#ifdef __cplusplus +} +#endif + +/* + * Hide GCC attributes from compilers that don't support them. + */ +#if (!defined(__GNUC__) || __GNUC__ < 2 || \ + (__GNUC__ == 2 && __GNUC_MINOR__ < 7) ) && \ + !defined(RISCOS) +#define Py_GCC_ATTRIBUTE(x) +#else +#define Py_GCC_ATTRIBUTE(x) __attribute__(x) +#endif + +/* + * Add PyArg_ParseTuple format where available. + */ +#ifdef HAVE_ATTRIBUTE_FORMAT_PARSETUPLE +#define Py_FORMAT_PARSETUPLE(func,p1,p2) __attribute__((format(func,p1,p2))) +#else +#define Py_FORMAT_PARSETUPLE(func,p1,p2) +#endif + +/* + * Specify alignment on compilers that support it. + */ +#if defined(__GNUC__) && __GNUC__ >= 3 +#define Py_ALIGNED(x) __attribute__((aligned(x))) +#else +#define Py_ALIGNED(x) +#endif + +/* Eliminate end-of-loop code not reached warnings from SunPro C + * when using do{...}while(0) macros + */ +#ifdef __SUNPRO_C +#pragma error_messages (off,E_END_OF_LOOP_CODE_NOT_REACHED) +#endif + +/* + * Older Microsoft compilers don't support the C99 long long literal suffixes, + * so these will be defined in PC/pyconfig.h for those compilers. + */ +#ifndef Py_LL +#define Py_LL(x) x##LL +#endif + +#ifndef Py_ULL +#define Py_ULL(x) Py_LL(x##U) +#endif + +#endif /* Py_PYPORT_H */ diff --git a/extern/include/Python-2.7/pystate.h b/extern/include/Python-2.7/pystate.h new file mode 100644 index 0000000..f2cfc30 --- /dev/null +++ b/extern/include/Python-2.7/pystate.h @@ -0,0 +1,200 @@ + +/* Thread and interpreter state structures and their interfaces */ + + +#ifndef Py_PYSTATE_H +#define Py_PYSTATE_H +#ifdef __cplusplus +extern "C" { +#endif + +/* State shared between threads */ + +struct _ts; /* Forward */ +struct _is; /* Forward */ + +typedef struct _is { + + struct _is *next; + struct _ts *tstate_head; + + PyObject *modules; + PyObject *sysdict; + PyObject *builtins; + PyObject *modules_reloading; + + PyObject *codec_search_path; + PyObject *codec_search_cache; + PyObject *codec_error_registry; + +#ifdef HAVE_DLOPEN + int dlopenflags; +#endif +#ifdef WITH_TSC + int tscdump; +#endif + +} PyInterpreterState; + + +/* State unique per thread */ + +struct _frame; /* Avoid including frameobject.h */ + +/* Py_tracefunc return -1 when raising an exception, or 0 for success. */ +typedef int (*Py_tracefunc)(PyObject *, struct _frame *, int, PyObject *); + +/* The following values are used for 'what' for tracefunc functions: */ +#define PyTrace_CALL 0 +#define PyTrace_EXCEPTION 1 +#define PyTrace_LINE 2 +#define PyTrace_RETURN 3 +#define PyTrace_C_CALL 4 +#define PyTrace_C_EXCEPTION 5 +#define PyTrace_C_RETURN 6 + +typedef struct _ts { + /* See Python/ceval.c for comments explaining most fields */ + + struct _ts *next; + PyInterpreterState *interp; + + struct _frame *frame; + int recursion_depth; + /* 'tracing' keeps track of the execution depth when tracing/profiling. + This is to prevent the actual trace/profile code from being recorded in + the trace/profile. */ + int tracing; + int use_tracing; + + Py_tracefunc c_profilefunc; + Py_tracefunc c_tracefunc; + PyObject *c_profileobj; + PyObject *c_traceobj; + + PyObject *curexc_type; + PyObject *curexc_value; + PyObject *curexc_traceback; + + PyObject *exc_type; + PyObject *exc_value; + PyObject *exc_traceback; + + PyObject *dict; /* Stores per-thread state */ + + /* tick_counter is incremented whenever the check_interval ticker + * reaches zero. The purpose is to give a useful measure of the number + * of interpreted bytecode instructions in a given thread. This + * extremely lightweight statistic collector may be of interest to + * profilers (like psyco.jit()), although nothing in the core uses it. + */ + int tick_counter; + + int gilstate_counter; + + PyObject *async_exc; /* Asynchronous exception to raise */ + long thread_id; /* Thread id where this tstate was created */ + + int trash_delete_nesting; + PyObject *trash_delete_later; + + /* XXX signal handlers should also be here */ + +} PyThreadState; + + +PyAPI_FUNC(PyInterpreterState *) PyInterpreterState_New(void); +PyAPI_FUNC(void) PyInterpreterState_Clear(PyInterpreterState *); +PyAPI_FUNC(void) PyInterpreterState_Delete(PyInterpreterState *); + +PyAPI_FUNC(PyThreadState *) PyThreadState_New(PyInterpreterState *); +PyAPI_FUNC(PyThreadState *) _PyThreadState_Prealloc(PyInterpreterState *); +PyAPI_FUNC(void) _PyThreadState_Init(PyThreadState *); +PyAPI_FUNC(void) PyThreadState_Clear(PyThreadState *); +PyAPI_FUNC(void) PyThreadState_Delete(PyThreadState *); +#ifdef WITH_THREAD +PyAPI_FUNC(void) PyThreadState_DeleteCurrent(void); +#endif + +PyAPI_FUNC(PyThreadState *) PyThreadState_Get(void); +PyAPI_FUNC(PyThreadState *) PyThreadState_Swap(PyThreadState *); +PyAPI_FUNC(PyObject *) PyThreadState_GetDict(void); +PyAPI_FUNC(int) PyThreadState_SetAsyncExc(long, PyObject *); + + +/* Variable and macro for in-line access to current thread state */ + +PyAPI_DATA(PyThreadState *) _PyThreadState_Current; + +#ifdef Py_DEBUG +#define PyThreadState_GET() PyThreadState_Get() +#else +#define PyThreadState_GET() (_PyThreadState_Current) +#endif + +typedef + enum {PyGILState_LOCKED, PyGILState_UNLOCKED} + PyGILState_STATE; + +/* Ensure that the current thread is ready to call the Python + C API, regardless of the current state of Python, or of its + thread lock. This may be called as many times as desired + by a thread so long as each call is matched with a call to + PyGILState_Release(). In general, other thread-state APIs may + be used between _Ensure() and _Release() calls, so long as the + thread-state is restored to its previous state before the Release(). + For example, normal use of the Py_BEGIN_ALLOW_THREADS/ + Py_END_ALLOW_THREADS macros are acceptable. + + The return value is an opaque "handle" to the thread state when + PyGILState_Ensure() was called, and must be passed to + PyGILState_Release() to ensure Python is left in the same state. Even + though recursive calls are allowed, these handles can *not* be shared - + each unique call to PyGILState_Ensure must save the handle for its + call to PyGILState_Release. + + When the function returns, the current thread will hold the GIL. + + Failure is a fatal error. +*/ +PyAPI_FUNC(PyGILState_STATE) PyGILState_Ensure(void); + +/* Release any resources previously acquired. After this call, Python's + state will be the same as it was prior to the corresponding + PyGILState_Ensure() call (but generally this state will be unknown to + the caller, hence the use of the GILState API.) + + Every call to PyGILState_Ensure must be matched by a call to + PyGILState_Release on the same thread. +*/ +PyAPI_FUNC(void) PyGILState_Release(PyGILState_STATE); + +/* Helper/diagnostic function - get the current thread state for + this thread. May return NULL if no GILState API has been used + on the current thread. Note that the main thread always has such a + thread-state, even if no auto-thread-state call has been made + on the main thread. +*/ +PyAPI_FUNC(PyThreadState *) PyGILState_GetThisThreadState(void); + +/* The implementation of sys._current_frames() Returns a dict mapping + thread id to that thread's current frame. +*/ +PyAPI_FUNC(PyObject *) _PyThread_CurrentFrames(void); + +/* Routines for advanced debuggers, requested by David Beazley. + Don't use unless you know what you are doing! */ +PyAPI_FUNC(PyInterpreterState *) PyInterpreterState_Head(void); +PyAPI_FUNC(PyInterpreterState *) PyInterpreterState_Next(PyInterpreterState *); +PyAPI_FUNC(PyThreadState *) PyInterpreterState_ThreadHead(PyInterpreterState *); +PyAPI_FUNC(PyThreadState *) PyThreadState_Next(PyThreadState *); + +typedef struct _frame *(*PyThreadFrameGetter)(PyThreadState *self_); + +/* hook for PyEval_GetFrame(), requested for Psyco */ +PyAPI_DATA(PyThreadFrameGetter) _PyThreadState_GetFrame; + +#ifdef __cplusplus +} +#endif +#endif /* !Py_PYSTATE_H */ diff --git a/extern/include/Python-2.7/pystrcmp.h b/extern/include/Python-2.7/pystrcmp.h new file mode 100644 index 0000000..369c7e7 --- /dev/null +++ b/extern/include/Python-2.7/pystrcmp.h @@ -0,0 +1,23 @@ +#ifndef Py_STRCMP_H +#define Py_STRCMP_H + +#ifdef __cplusplus +extern "C" { +#endif + +PyAPI_FUNC(int) PyOS_mystrnicmp(const char *, const char *, Py_ssize_t); +PyAPI_FUNC(int) PyOS_mystricmp(const char *, const char *); + +#if defined(MS_WINDOWS) || defined(PYOS_OS2) +#define PyOS_strnicmp strnicmp +#define PyOS_stricmp stricmp +#else +#define PyOS_strnicmp PyOS_mystrnicmp +#define PyOS_stricmp PyOS_mystricmp +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* !Py_STRCMP_H */ diff --git a/extern/include/Python-2.7/pystrtod.h b/extern/include/Python-2.7/pystrtod.h new file mode 100644 index 0000000..eec434f --- /dev/null +++ b/extern/include/Python-2.7/pystrtod.h @@ -0,0 +1,45 @@ +#ifndef Py_STRTOD_H +#define Py_STRTOD_H + +#ifdef __cplusplus +extern "C" { +#endif + + +PyAPI_FUNC(double) PyOS_ascii_strtod(const char *str, char **ptr); +PyAPI_FUNC(double) PyOS_ascii_atof(const char *str); + +/* Deprecated in 2.7 and 3.1. Will disappear in 2.8 (if it exists) and 3.2 */ +PyAPI_FUNC(char *) PyOS_ascii_formatd(char *buffer, size_t buf_len, + const char *format, double d); +PyAPI_FUNC(double) PyOS_string_to_double(const char *str, + char **endptr, + PyObject *overflow_exception); + +/* The caller is responsible for calling PyMem_Free to free the buffer + that's is returned. */ +PyAPI_FUNC(char *) PyOS_double_to_string(double val, + char format_code, + int precision, + int flags, + int *type); + +PyAPI_FUNC(double) _Py_parse_inf_or_nan(const char *p, char **endptr); + + +/* PyOS_double_to_string's "flags" parameter can be set to 0 or more of: */ +#define Py_DTSF_SIGN 0x01 /* always add the sign */ +#define Py_DTSF_ADD_DOT_0 0x02 /* if the result is an integer add ".0" */ +#define Py_DTSF_ALT 0x04 /* "alternate" formatting. it's format_code + specific */ + +/* PyOS_double_to_string's "type", if non-NULL, will be set to one of: */ +#define Py_DTST_FINITE 0 +#define Py_DTST_INFINITE 1 +#define Py_DTST_NAN 2 + +#ifdef __cplusplus +} +#endif + +#endif /* !Py_STRTOD_H */ diff --git a/extern/include/Python-2.7/pythonrun.h b/extern/include/Python-2.7/pythonrun.h new file mode 100644 index 0000000..6bfc175 --- /dev/null +++ b/extern/include/Python-2.7/pythonrun.h @@ -0,0 +1,181 @@ + +/* Interfaces to parse and execute pieces of python code */ + +#ifndef Py_PYTHONRUN_H +#define Py_PYTHONRUN_H +#ifdef __cplusplus +extern "C" { +#endif + +#define PyCF_MASK (CO_FUTURE_DIVISION | CO_FUTURE_ABSOLUTE_IMPORT | \ + CO_FUTURE_WITH_STATEMENT | CO_FUTURE_PRINT_FUNCTION | \ + CO_FUTURE_UNICODE_LITERALS) +#define PyCF_MASK_OBSOLETE (CO_NESTED) +#define PyCF_SOURCE_IS_UTF8 0x0100 +#define PyCF_DONT_IMPLY_DEDENT 0x0200 +#define PyCF_ONLY_AST 0x0400 + +typedef struct { + int cf_flags; /* bitmask of CO_xxx flags relevant to future */ +} PyCompilerFlags; + +PyAPI_FUNC(void) Py_SetProgramName(char *); +PyAPI_FUNC(char *) Py_GetProgramName(void); + +PyAPI_FUNC(void) Py_SetPythonHome(char *); +PyAPI_FUNC(char *) Py_GetPythonHome(void); + +PyAPI_FUNC(void) Py_Initialize(void); +PyAPI_FUNC(void) Py_InitializeEx(int); +PyAPI_FUNC(void) Py_Finalize(void); +PyAPI_FUNC(int) Py_IsInitialized(void); +PyAPI_FUNC(PyThreadState *) Py_NewInterpreter(void); +PyAPI_FUNC(void) Py_EndInterpreter(PyThreadState *); + +PyAPI_FUNC(int) PyRun_AnyFileFlags(FILE *, const char *, PyCompilerFlags *); +PyAPI_FUNC(int) PyRun_AnyFileExFlags(FILE *, const char *, int, PyCompilerFlags *); +PyAPI_FUNC(int) PyRun_SimpleStringFlags(const char *, PyCompilerFlags *); +PyAPI_FUNC(int) PyRun_SimpleFileExFlags(FILE *, const char *, int, PyCompilerFlags *); +PyAPI_FUNC(int) PyRun_InteractiveOneFlags(FILE *, const char *, PyCompilerFlags *); +PyAPI_FUNC(int) PyRun_InteractiveLoopFlags(FILE *, const char *, PyCompilerFlags *); + +PyAPI_FUNC(struct _mod *) PyParser_ASTFromString(const char *, const char *, + int, PyCompilerFlags *flags, + PyArena *); +PyAPI_FUNC(struct _mod *) PyParser_ASTFromFile(FILE *, const char *, int, + char *, char *, + PyCompilerFlags *, int *, + PyArena *); +#define PyParser_SimpleParseString(S, B) \ + PyParser_SimpleParseStringFlags(S, B, 0) +#define PyParser_SimpleParseFile(FP, S, B) \ + PyParser_SimpleParseFileFlags(FP, S, B, 0) +PyAPI_FUNC(struct _node *) PyParser_SimpleParseStringFlags(const char *, int, + int); +PyAPI_FUNC(struct _node *) PyParser_SimpleParseFileFlags(FILE *, const char *, + int, int); + +PyAPI_FUNC(PyObject *) PyRun_StringFlags(const char *, int, PyObject *, + PyObject *, PyCompilerFlags *); + +PyAPI_FUNC(PyObject *) PyRun_FileExFlags(FILE *, const char *, int, + PyObject *, PyObject *, int, + PyCompilerFlags *); + +#define Py_CompileString(str, p, s) Py_CompileStringFlags(str, p, s, NULL) +PyAPI_FUNC(PyObject *) Py_CompileStringFlags(const char *, const char *, int, + PyCompilerFlags *); +PyAPI_FUNC(struct symtable *) Py_SymtableString(const char *, const char *, int); + +PyAPI_FUNC(void) PyErr_Print(void); +PyAPI_FUNC(void) PyErr_PrintEx(int); +PyAPI_FUNC(void) PyErr_Display(PyObject *, PyObject *, PyObject *); + +PyAPI_FUNC(int) Py_AtExit(void (*func)(void)); + +PyAPI_FUNC(void) Py_Exit(int); + +PyAPI_FUNC(int) Py_FdIsInteractive(FILE *, const char *); + +/* Bootstrap */ +PyAPI_FUNC(int) Py_Main(int argc, char **argv); + +/* Use macros for a bunch of old variants */ +#define PyRun_String(str, s, g, l) PyRun_StringFlags(str, s, g, l, NULL) +#define PyRun_AnyFile(fp, name) PyRun_AnyFileExFlags(fp, name, 0, NULL) +#define PyRun_AnyFileEx(fp, name, closeit) \ + PyRun_AnyFileExFlags(fp, name, closeit, NULL) +#define PyRun_AnyFileFlags(fp, name, flags) \ + PyRun_AnyFileExFlags(fp, name, 0, flags) +#define PyRun_SimpleString(s) PyRun_SimpleStringFlags(s, NULL) +#define PyRun_SimpleFile(f, p) PyRun_SimpleFileExFlags(f, p, 0, NULL) +#define PyRun_SimpleFileEx(f, p, c) PyRun_SimpleFileExFlags(f, p, c, NULL) +#define PyRun_InteractiveOne(f, p) PyRun_InteractiveOneFlags(f, p, NULL) +#define PyRun_InteractiveLoop(f, p) PyRun_InteractiveLoopFlags(f, p, NULL) +#define PyRun_File(fp, p, s, g, l) \ + PyRun_FileExFlags(fp, p, s, g, l, 0, NULL) +#define PyRun_FileEx(fp, p, s, g, l, c) \ + PyRun_FileExFlags(fp, p, s, g, l, c, NULL) +#define PyRun_FileFlags(fp, p, s, g, l, flags) \ + PyRun_FileExFlags(fp, p, s, g, l, 0, flags) + +/* In getpath.c */ +PyAPI_FUNC(char *) Py_GetProgramFullPath(void); +PyAPI_FUNC(char *) Py_GetPrefix(void); +PyAPI_FUNC(char *) Py_GetExecPrefix(void); +PyAPI_FUNC(char *) Py_GetPath(void); + +/* In their own files */ +PyAPI_FUNC(const char *) Py_GetVersion(void); +PyAPI_FUNC(const char *) Py_GetPlatform(void); +PyAPI_FUNC(const char *) Py_GetCopyright(void); +PyAPI_FUNC(const char *) Py_GetCompiler(void); +PyAPI_FUNC(const char *) Py_GetBuildInfo(void); +PyAPI_FUNC(const char *) _Py_svnversion(void); +PyAPI_FUNC(const char *) Py_SubversionRevision(void); +PyAPI_FUNC(const char *) Py_SubversionShortBranch(void); +PyAPI_FUNC(const char *) _Py_hgidentifier(void); +PyAPI_FUNC(const char *) _Py_hgversion(void); + +/* Internal -- various one-time initializations */ +PyAPI_FUNC(PyObject *) _PyBuiltin_Init(void); +PyAPI_FUNC(PyObject *) _PySys_Init(void); +PyAPI_FUNC(void) _PyImport_Init(void); +PyAPI_FUNC(void) _PyExc_Init(void); +PyAPI_FUNC(void) _PyImportHooks_Init(void); +PyAPI_FUNC(int) _PyFrame_Init(void); +PyAPI_FUNC(int) _PyInt_Init(void); +PyAPI_FUNC(int) _PyLong_Init(void); +PyAPI_FUNC(void) _PyFloat_Init(void); +PyAPI_FUNC(int) PyByteArray_Init(void); +PyAPI_FUNC(void) _PyRandom_Init(void); + +/* Various internal finalizers */ +PyAPI_FUNC(void) _PyExc_Fini(void); +PyAPI_FUNC(void) _PyImport_Fini(void); +PyAPI_FUNC(void) PyMethod_Fini(void); +PyAPI_FUNC(void) PyFrame_Fini(void); +PyAPI_FUNC(void) PyCFunction_Fini(void); +PyAPI_FUNC(void) PyDict_Fini(void); +PyAPI_FUNC(void) PyTuple_Fini(void); +PyAPI_FUNC(void) PyList_Fini(void); +PyAPI_FUNC(void) PySet_Fini(void); +PyAPI_FUNC(void) PyString_Fini(void); +PyAPI_FUNC(void) PyInt_Fini(void); +PyAPI_FUNC(void) PyFloat_Fini(void); +PyAPI_FUNC(void) PyOS_FiniInterrupts(void); +PyAPI_FUNC(void) PyByteArray_Fini(void); + +/* Stuff with no proper home (yet) */ +PyAPI_FUNC(char *) PyOS_Readline(FILE *, FILE *, char *); +PyAPI_DATA(int) (*PyOS_InputHook)(void); +PyAPI_DATA(char) *(*PyOS_ReadlineFunctionPointer)(FILE *, FILE *, char *); +PyAPI_DATA(PyThreadState*) _PyOS_ReadlineTState; + +/* Stack size, in "pointers" (so we get extra safety margins + on 64-bit platforms). On a 32-bit platform, this translates + to a 8k margin. */ +#define PYOS_STACK_MARGIN 2048 + +#if defined(WIN32) && !defined(MS_WIN64) && defined(_MSC_VER) && _MSC_VER >= 1300 +/* Enable stack checking under Microsoft C */ +#define USE_STACKCHECK +#endif + +#ifdef USE_STACKCHECK +/* Check that we aren't overflowing our stack */ +PyAPI_FUNC(int) PyOS_CheckStack(void); +#endif + +/* Signals */ +typedef void (*PyOS_sighandler_t)(int); +PyAPI_FUNC(PyOS_sighandler_t) PyOS_getsig(int); +PyAPI_FUNC(PyOS_sighandler_t) PyOS_setsig(int, PyOS_sighandler_t); + +/* Random */ +PyAPI_FUNC(int) _PyOS_URandom (void *buffer, Py_ssize_t size); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_PYTHONRUN_H */ diff --git a/extern/include/Python-2.7/pythread.h b/extern/include/Python-2.7/pythread.h new file mode 100644 index 0000000..dfd6157 --- /dev/null +++ b/extern/include/Python-2.7/pythread.h @@ -0,0 +1,41 @@ + +#ifndef Py_PYTHREAD_H +#define Py_PYTHREAD_H + +typedef void *PyThread_type_lock; +typedef void *PyThread_type_sema; + +#ifdef __cplusplus +extern "C" { +#endif + +PyAPI_FUNC(void) PyThread_init_thread(void); +PyAPI_FUNC(long) PyThread_start_new_thread(void (*)(void *), void *); +PyAPI_FUNC(void) PyThread_exit_thread(void); +PyAPI_FUNC(long) PyThread_get_thread_ident(void); + +PyAPI_FUNC(PyThread_type_lock) PyThread_allocate_lock(void); +PyAPI_FUNC(void) PyThread_free_lock(PyThread_type_lock); +PyAPI_FUNC(int) PyThread_acquire_lock(PyThread_type_lock, int); +#define WAIT_LOCK 1 +#define NOWAIT_LOCK 0 +PyAPI_FUNC(void) PyThread_release_lock(PyThread_type_lock); + +PyAPI_FUNC(size_t) PyThread_get_stacksize(void); +PyAPI_FUNC(int) PyThread_set_stacksize(size_t); + +/* Thread Local Storage (TLS) API */ +PyAPI_FUNC(int) PyThread_create_key(void); +PyAPI_FUNC(void) PyThread_delete_key(int); +PyAPI_FUNC(int) PyThread_set_key_value(int, void *); +PyAPI_FUNC(void *) PyThread_get_key_value(int); +PyAPI_FUNC(void) PyThread_delete_key_value(int key); + +/* Cleanup after a fork */ +PyAPI_FUNC(void) PyThread_ReInitTLS(void); + +#ifdef __cplusplus +} +#endif + +#endif /* !Py_PYTHREAD_H */ diff --git a/extern/include/Python-2.7/rangeobject.h b/extern/include/Python-2.7/rangeobject.h new file mode 100644 index 0000000..36c9cee --- /dev/null +++ b/extern/include/Python-2.7/rangeobject.h @@ -0,0 +1,28 @@ + +/* Range object interface */ + +#ifndef Py_RANGEOBJECT_H +#define Py_RANGEOBJECT_H +#ifdef __cplusplus +extern "C" { +#endif + +/* This is about the type 'xrange', not the built-in function range(), which + returns regular lists. */ + +/* +A range object represents an integer range. This is an immutable object; +a range cannot change its value after creation. + +Range objects behave like the corresponding tuple objects except that +they are represented by a start, stop, and step datamembers. +*/ + +PyAPI_DATA(PyTypeObject) PyRange_Type; + +#define PyRange_Check(op) (Py_TYPE(op) == &PyRange_Type) + +#ifdef __cplusplus +} +#endif +#endif /* !Py_RANGEOBJECT_H */ diff --git a/extern/include/Python-2.7/setobject.h b/extern/include/Python-2.7/setobject.h new file mode 100644 index 0000000..52b07d5 --- /dev/null +++ b/extern/include/Python-2.7/setobject.h @@ -0,0 +1,99 @@ +/* Set object interface */ + +#ifndef Py_SETOBJECT_H +#define Py_SETOBJECT_H +#ifdef __cplusplus +extern "C" { +#endif + + +/* +There are three kinds of slots in the table: + +1. Unused: key == NULL +2. Active: key != NULL and key != dummy +3. Dummy: key == dummy + +Note: .pop() abuses the hash field of an Unused or Dummy slot to +hold a search finger. The hash field of Unused or Dummy slots has +no meaning otherwise. +*/ + +#define PySet_MINSIZE 8 + +typedef struct { + long hash; /* cached hash code for the entry key */ + PyObject *key; +} setentry; + + +/* +This data structure is shared by set and frozenset objects. +*/ + +typedef struct _setobject PySetObject; +struct _setobject { + PyObject_HEAD + + Py_ssize_t fill; /* # Active + # Dummy */ + Py_ssize_t used; /* # Active */ + + /* The table contains mask + 1 slots, and that's a power of 2. + * We store the mask instead of the size because the mask is more + * frequently needed. + */ + Py_ssize_t mask; + + /* table points to smalltable for small tables, else to + * additional malloc'ed memory. table is never NULL! This rule + * saves repeated runtime null-tests. + */ + setentry *table; + setentry *(*lookup)(PySetObject *so, PyObject *key, long hash); + setentry smalltable[PySet_MINSIZE]; + + long hash; /* only used by frozenset objects */ + PyObject *weakreflist; /* List of weak references */ +}; + +PyAPI_DATA(PyTypeObject) PySet_Type; +PyAPI_DATA(PyTypeObject) PyFrozenSet_Type; + +/* Invariants for frozensets: + * data is immutable. + * hash is the hash of the frozenset or -1 if not computed yet. + * Invariants for sets: + * hash is -1 + */ + +#define PyFrozenSet_CheckExact(ob) (Py_TYPE(ob) == &PyFrozenSet_Type) +#define PyAnySet_CheckExact(ob) \ + (Py_TYPE(ob) == &PySet_Type || Py_TYPE(ob) == &PyFrozenSet_Type) +#define PyAnySet_Check(ob) \ + (Py_TYPE(ob) == &PySet_Type || Py_TYPE(ob) == &PyFrozenSet_Type || \ + PyType_IsSubtype(Py_TYPE(ob), &PySet_Type) || \ + PyType_IsSubtype(Py_TYPE(ob), &PyFrozenSet_Type)) +#define PySet_Check(ob) \ + (Py_TYPE(ob) == &PySet_Type || \ + PyType_IsSubtype(Py_TYPE(ob), &PySet_Type)) +#define PyFrozenSet_Check(ob) \ + (Py_TYPE(ob) == &PyFrozenSet_Type || \ + PyType_IsSubtype(Py_TYPE(ob), &PyFrozenSet_Type)) + +PyAPI_FUNC(PyObject *) PySet_New(PyObject *); +PyAPI_FUNC(PyObject *) PyFrozenSet_New(PyObject *); +PyAPI_FUNC(Py_ssize_t) PySet_Size(PyObject *anyset); +#define PySet_GET_SIZE(so) (((PySetObject *)(so))->used) +PyAPI_FUNC(int) PySet_Clear(PyObject *set); +PyAPI_FUNC(int) PySet_Contains(PyObject *anyset, PyObject *key); +PyAPI_FUNC(int) PySet_Discard(PyObject *set, PyObject *key); +PyAPI_FUNC(int) PySet_Add(PyObject *set, PyObject *key); +PyAPI_FUNC(int) _PySet_Next(PyObject *set, Py_ssize_t *pos, PyObject **key); +PyAPI_FUNC(int) _PySet_NextEntry(PyObject *set, Py_ssize_t *pos, PyObject **key, long *hash); +PyAPI_FUNC(PyObject *) PySet_Pop(PyObject *set); +PyAPI_FUNC(int) _PySet_Update(PyObject *set, PyObject *iterable); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_SETOBJECT_H */ diff --git a/extern/include/Python-2.7/sliceobject.h b/extern/include/Python-2.7/sliceobject.h new file mode 100644 index 0000000..8ab62dd --- /dev/null +++ b/extern/include/Python-2.7/sliceobject.h @@ -0,0 +1,44 @@ +#ifndef Py_SLICEOBJECT_H +#define Py_SLICEOBJECT_H +#ifdef __cplusplus +extern "C" { +#endif + +/* The unique ellipsis object "..." */ + +PyAPI_DATA(PyObject) _Py_EllipsisObject; /* Don't use this directly */ + +#define Py_Ellipsis (&_Py_EllipsisObject) + +/* Slice object interface */ + +/* + +A slice object containing start, stop, and step data members (the +names are from range). After much talk with Guido, it was decided to +let these be any arbitrary python type. Py_None stands for omitted values. +*/ + +typedef struct { + PyObject_HEAD + PyObject *start, *stop, *step; /* not NULL */ +} PySliceObject; + +PyAPI_DATA(PyTypeObject) PySlice_Type; +PyAPI_DATA(PyTypeObject) PyEllipsis_Type; + +#define PySlice_Check(op) (Py_TYPE(op) == &PySlice_Type) + +PyAPI_FUNC(PyObject *) PySlice_New(PyObject* start, PyObject* stop, + PyObject* step); +PyAPI_FUNC(PyObject *) _PySlice_FromIndices(Py_ssize_t start, Py_ssize_t stop); +PyAPI_FUNC(int) PySlice_GetIndices(PySliceObject *r, Py_ssize_t length, + Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step); +PyAPI_FUNC(int) PySlice_GetIndicesEx(PySliceObject *r, Py_ssize_t length, + Py_ssize_t *start, Py_ssize_t *stop, + Py_ssize_t *step, Py_ssize_t *slicelength); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_SLICEOBJECT_H */ diff --git a/extern/include/Python-2.7/stringobject.h b/extern/include/Python-2.7/stringobject.h new file mode 100644 index 0000000..8e2d8e7 --- /dev/null +++ b/extern/include/Python-2.7/stringobject.h @@ -0,0 +1,210 @@ + +/* String (str/bytes) object interface */ + +#ifndef Py_STRINGOBJECT_H +#define Py_STRINGOBJECT_H +#ifdef __cplusplus +extern "C" { +#endif + +#include + +/* +Type PyStringObject represents a character string. An extra zero byte is +reserved at the end to ensure it is zero-terminated, but a size is +present so strings with null bytes in them can be represented. This +is an immutable object type. + +There are functions to create new string objects, to test +an object for string-ness, and to get the +string value. The latter function returns a null pointer +if the object is not of the proper type. +There is a variant that takes an explicit size as well as a +variant that assumes a zero-terminated string. Note that none of the +functions should be applied to nil objects. +*/ + +/* Caching the hash (ob_shash) saves recalculation of a string's hash value. + Interning strings (ob_sstate) tries to ensure that only one string + object with a given value exists, so equality tests can be one pointer + comparison. This is generally restricted to strings that "look like" + Python identifiers, although the intern() builtin can be used to force + interning of any string. + Together, these sped the interpreter by up to 20%. */ + +typedef struct { + PyObject_VAR_HEAD + long ob_shash; + int ob_sstate; + char ob_sval[1]; + + /* Invariants: + * ob_sval contains space for 'ob_size+1' elements. + * ob_sval[ob_size] == 0. + * ob_shash is the hash of the string or -1 if not computed yet. + * ob_sstate != 0 iff the string object is in stringobject.c's + * 'interned' dictionary; in this case the two references + * from 'interned' to this object are *not counted* in ob_refcnt. + */ +} PyStringObject; + +#define SSTATE_NOT_INTERNED 0 +#define SSTATE_INTERNED_MORTAL 1 +#define SSTATE_INTERNED_IMMORTAL 2 + +PyAPI_DATA(PyTypeObject) PyBaseString_Type; +PyAPI_DATA(PyTypeObject) PyString_Type; + +#define PyString_Check(op) \ + PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_STRING_SUBCLASS) +#define PyString_CheckExact(op) (Py_TYPE(op) == &PyString_Type) + +PyAPI_FUNC(PyObject *) PyString_FromStringAndSize(const char *, Py_ssize_t); +PyAPI_FUNC(PyObject *) PyString_FromString(const char *); +PyAPI_FUNC(PyObject *) PyString_FromFormatV(const char*, va_list) + Py_GCC_ATTRIBUTE((format(printf, 1, 0))); +PyAPI_FUNC(PyObject *) PyString_FromFormat(const char*, ...) + Py_GCC_ATTRIBUTE((format(printf, 1, 2))); +PyAPI_FUNC(Py_ssize_t) PyString_Size(PyObject *); +PyAPI_FUNC(char *) PyString_AsString(PyObject *); +PyAPI_FUNC(PyObject *) PyString_Repr(PyObject *, int); +PyAPI_FUNC(void) PyString_Concat(PyObject **, PyObject *); +PyAPI_FUNC(void) PyString_ConcatAndDel(PyObject **, PyObject *); +PyAPI_FUNC(int) _PyString_Resize(PyObject **, Py_ssize_t); +PyAPI_FUNC(int) _PyString_Eq(PyObject *, PyObject*); +PyAPI_FUNC(PyObject *) PyString_Format(PyObject *, PyObject *); +PyAPI_FUNC(PyObject *) _PyString_FormatLong(PyObject*, int, int, + int, char**, int*); +PyAPI_FUNC(PyObject *) PyString_DecodeEscape(const char *, Py_ssize_t, + const char *, Py_ssize_t, + const char *); + +PyAPI_FUNC(void) PyString_InternInPlace(PyObject **); +PyAPI_FUNC(void) PyString_InternImmortal(PyObject **); +PyAPI_FUNC(PyObject *) PyString_InternFromString(const char *); +PyAPI_FUNC(void) _Py_ReleaseInternedStrings(void); + +/* Use only if you know it's a string */ +#define PyString_CHECK_INTERNED(op) (((PyStringObject *)(op))->ob_sstate) + +/* Macro, trading safety for speed */ +#define PyString_AS_STRING(op) (((PyStringObject *)(op))->ob_sval) +#define PyString_GET_SIZE(op) Py_SIZE(op) + +/* _PyString_Join(sep, x) is like sep.join(x). sep must be PyStringObject*, + x must be an iterable object. */ +PyAPI_FUNC(PyObject *) _PyString_Join(PyObject *sep, PyObject *x); + +/* --- Generic Codecs ----------------------------------------------------- */ + +/* Create an object by decoding the encoded string s of the + given size. */ + +PyAPI_FUNC(PyObject*) PyString_Decode( + const char *s, /* encoded string */ + Py_ssize_t size, /* size of buffer */ + const char *encoding, /* encoding */ + const char *errors /* error handling */ + ); + +/* Encodes a char buffer of the given size and returns a + Python object. */ + +PyAPI_FUNC(PyObject*) PyString_Encode( + const char *s, /* string char buffer */ + Py_ssize_t size, /* number of chars to encode */ + const char *encoding, /* encoding */ + const char *errors /* error handling */ + ); + +/* Encodes a string object and returns the result as Python + object. */ + +PyAPI_FUNC(PyObject*) PyString_AsEncodedObject( + PyObject *str, /* string object */ + const char *encoding, /* encoding */ + const char *errors /* error handling */ + ); + +/* Encodes a string object and returns the result as Python string + object. + + If the codec returns an Unicode object, the object is converted + back to a string using the default encoding. + + DEPRECATED - use PyString_AsEncodedObject() instead. */ + +PyAPI_FUNC(PyObject*) PyString_AsEncodedString( + PyObject *str, /* string object */ + const char *encoding, /* encoding */ + const char *errors /* error handling */ + ); + +/* Decodes a string object and returns the result as Python + object. */ + +PyAPI_FUNC(PyObject*) PyString_AsDecodedObject( + PyObject *str, /* string object */ + const char *encoding, /* encoding */ + const char *errors /* error handling */ + ); + +/* Decodes a string object and returns the result as Python string + object. + + If the codec returns an Unicode object, the object is converted + back to a string using the default encoding. + + DEPRECATED - use PyString_AsDecodedObject() instead. */ + +PyAPI_FUNC(PyObject*) PyString_AsDecodedString( + PyObject *str, /* string object */ + const char *encoding, /* encoding */ + const char *errors /* error handling */ + ); + +/* Provides access to the internal data buffer and size of a string + object or the default encoded version of an Unicode object. Passing + NULL as *len parameter will force the string buffer to be + 0-terminated (passing a string with embedded NULL characters will + cause an exception). */ + +PyAPI_FUNC(int) PyString_AsStringAndSize( + PyObject *obj, /* string or Unicode object */ + char **s, /* pointer to buffer variable */ + Py_ssize_t *len /* pointer to length variable or NULL + (only possible for 0-terminated + strings) */ + ); + + +/* Using the current locale, insert the thousands grouping + into the string pointed to by buffer. For the argument descriptions, + see Objects/stringlib/localeutil.h */ +PyAPI_FUNC(Py_ssize_t) _PyString_InsertThousandsGroupingLocale(char *buffer, + Py_ssize_t n_buffer, + char *digits, + Py_ssize_t n_digits, + Py_ssize_t min_width); + +/* Using explicit passed-in values, insert the thousands grouping + into the string pointed to by buffer. For the argument descriptions, + see Objects/stringlib/localeutil.h */ +PyAPI_FUNC(Py_ssize_t) _PyString_InsertThousandsGrouping(char *buffer, + Py_ssize_t n_buffer, + char *digits, + Py_ssize_t n_digits, + Py_ssize_t min_width, + const char *grouping, + const char *thousands_sep); + +/* Format the object based on the format_spec, as defined in PEP 3101 + (Advanced String Formatting). */ +PyAPI_FUNC(PyObject *) _PyBytes_FormatAdvanced(PyObject *obj, + char *format_spec, + Py_ssize_t format_spec_len); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_STRINGOBJECT_H */ diff --git a/extern/include/Python-2.7/structmember.h b/extern/include/Python-2.7/structmember.h new file mode 100644 index 0000000..fe5b44e --- /dev/null +++ b/extern/include/Python-2.7/structmember.h @@ -0,0 +1,99 @@ +#ifndef Py_STRUCTMEMBER_H +#define Py_STRUCTMEMBER_H +#ifdef __cplusplus +extern "C" { +#endif + + +/* Interface to map C struct members to Python object attributes */ + +#include /* For offsetof */ + +/* The offsetof() macro calculates the offset of a structure member + in its structure. Unfortunately this cannot be written down + portably, hence it is provided by a Standard C header file. + For pre-Standard C compilers, here is a version that usually works + (but watch out!): */ + +#ifndef offsetof +#define offsetof(type, member) ( (int) & ((type*)0) -> member ) +#endif + +/* An array of memberlist structures defines the name, type and offset + of selected members of a C structure. These can be read by + PyMember_Get() and set by PyMember_Set() (except if their READONLY flag + is set). The array must be terminated with an entry whose name + pointer is NULL. */ + +struct memberlist { + /* Obsolete version, for binary backwards compatibility */ + char *name; + int type; + int offset; + int flags; +}; + +typedef struct PyMemberDef { + /* Current version, use this */ + char *name; + int type; + Py_ssize_t offset; + int flags; + char *doc; +} PyMemberDef; + +/* Types */ +#define T_SHORT 0 +#define T_INT 1 +#define T_LONG 2 +#define T_FLOAT 3 +#define T_DOUBLE 4 +#define T_STRING 5 +#define T_OBJECT 6 +/* XXX the ordering here is weird for binary compatibility */ +#define T_CHAR 7 /* 1-character string */ +#define T_BYTE 8 /* 8-bit signed int */ +/* unsigned variants: */ +#define T_UBYTE 9 +#define T_USHORT 10 +#define T_UINT 11 +#define T_ULONG 12 + +/* Added by Jack: strings contained in the structure */ +#define T_STRING_INPLACE 13 + +/* Added by Lillo: bools contained in the structure (assumed char) */ +#define T_BOOL 14 + +#define T_OBJECT_EX 16 /* Like T_OBJECT, but raises AttributeError + when the value is NULL, instead of + converting to None. */ +#ifdef HAVE_LONG_LONG +#define T_LONGLONG 17 +#define T_ULONGLONG 18 +#endif /* HAVE_LONG_LONG */ + +#define T_PYSSIZET 19 /* Py_ssize_t */ + + +/* Flags */ +#define READONLY 1 +#define RO READONLY /* Shorthand */ +#define READ_RESTRICTED 2 +#define PY_WRITE_RESTRICTED 4 +#define RESTRICTED (READ_RESTRICTED | PY_WRITE_RESTRICTED) + + +/* Obsolete API, for binary backwards compatibility */ +PyAPI_FUNC(PyObject *) PyMember_Get(const char *, struct memberlist *, const char *); +PyAPI_FUNC(int) PyMember_Set(char *, struct memberlist *, const char *, PyObject *); + +/* Current API, use this */ +PyAPI_FUNC(PyObject *) PyMember_GetOne(const char *, struct PyMemberDef *); +PyAPI_FUNC(int) PyMember_SetOne(char *, struct PyMemberDef *, PyObject *); + + +#ifdef __cplusplus +} +#endif +#endif /* !Py_STRUCTMEMBER_H */ diff --git a/extern/include/Python-2.7/structseq.h b/extern/include/Python-2.7/structseq.h new file mode 100644 index 0000000..e662916 --- /dev/null +++ b/extern/include/Python-2.7/structseq.h @@ -0,0 +1,41 @@ + +/* Tuple object interface */ + +#ifndef Py_STRUCTSEQ_H +#define Py_STRUCTSEQ_H +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct PyStructSequence_Field { + char *name; + char *doc; +} PyStructSequence_Field; + +typedef struct PyStructSequence_Desc { + char *name; + char *doc; + struct PyStructSequence_Field *fields; + int n_in_sequence; +} PyStructSequence_Desc; + +extern char* PyStructSequence_UnnamedField; + +PyAPI_FUNC(void) PyStructSequence_InitType(PyTypeObject *type, + PyStructSequence_Desc *desc); + +PyAPI_FUNC(PyObject *) PyStructSequence_New(PyTypeObject* type); + +typedef struct { + PyObject_VAR_HEAD + PyObject *ob_item[1]; +} PyStructSequence; + +/* Macro, *only* to be used to fill in brand new objects */ +#define PyStructSequence_SET_ITEM(op, i, v) \ + (((PyStructSequence *)(op))->ob_item[i] = v) + +#ifdef __cplusplus +} +#endif +#endif /* !Py_STRUCTSEQ_H */ diff --git a/extern/include/Python-2.7/symtable.h b/extern/include/Python-2.7/symtable.h new file mode 100644 index 0000000..abf6840 --- /dev/null +++ b/extern/include/Python-2.7/symtable.h @@ -0,0 +1,98 @@ +#ifndef Py_SYMTABLE_H +#define Py_SYMTABLE_H + +#ifdef __cplusplus +extern "C" { +#endif + +typedef enum _block_type { FunctionBlock, ClassBlock, ModuleBlock } + _Py_block_ty; + +struct _symtable_entry; + +struct symtable { + const char *st_filename; /* name of file being compiled */ + struct _symtable_entry *st_cur; /* current symbol table entry */ + struct _symtable_entry *st_top; /* module entry */ + PyObject *st_symbols; /* dictionary of symbol table entries */ + PyObject *st_stack; /* stack of namespace info */ + PyObject *st_global; /* borrowed ref to MODULE in st_symbols */ + int st_nblocks; /* number of blocks */ + PyObject *st_private; /* name of current class or NULL */ + PyFutureFeatures *st_future; /* module's future features */ +}; + +typedef struct _symtable_entry { + PyObject_HEAD + PyObject *ste_id; /* int: key in st_symbols */ + PyObject *ste_symbols; /* dict: name to flags */ + PyObject *ste_name; /* string: name of block */ + PyObject *ste_varnames; /* list of variable names */ + PyObject *ste_children; /* list of child ids */ + _Py_block_ty ste_type; /* module, class, or function */ + int ste_unoptimized; /* false if namespace is optimized */ + int ste_nested; /* true if block is nested */ + unsigned ste_free : 1; /* true if block has free variables */ + unsigned ste_child_free : 1; /* true if a child block has free vars, + including free refs to globals */ + unsigned ste_generator : 1; /* true if namespace is a generator */ + unsigned ste_varargs : 1; /* true if block has varargs */ + unsigned ste_varkeywords : 1; /* true if block has varkeywords */ + unsigned ste_returns_value : 1; /* true if namespace uses return with + an argument */ + int ste_lineno; /* first line of block */ + int ste_opt_lineno; /* lineno of last exec or import * */ + int ste_tmpname; /* counter for listcomp temp vars */ + struct symtable *ste_table; +} PySTEntryObject; + +PyAPI_DATA(PyTypeObject) PySTEntry_Type; + +#define PySTEntry_Check(op) (Py_TYPE(op) == &PySTEntry_Type) + +PyAPI_FUNC(int) PyST_GetScope(PySTEntryObject *, PyObject *); + +//PyAPI_FUNC(struct symtable *) PySymtable_Build(mod_ty, const char *, +// PyFutureFeatures *); +PyAPI_FUNC(PySTEntryObject *) PySymtable_Lookup(struct symtable *, void *); + +PyAPI_FUNC(void) PySymtable_Free(struct symtable *); + +/* Flags for def-use information */ + +#define DEF_GLOBAL 1 /* global stmt */ +#define DEF_LOCAL 2 /* assignment in code block */ +#define DEF_PARAM 2<<1 /* formal parameter */ +#define USE 2<<2 /* name is used */ +#define DEF_FREE 2<<3 /* name used but not defined in nested block */ +#define DEF_FREE_CLASS 2<<4 /* free variable from class's method */ +#define DEF_IMPORT 2<<5 /* assignment occurred via import */ + +#define DEF_BOUND (DEF_LOCAL | DEF_PARAM | DEF_IMPORT) + +/* GLOBAL_EXPLICIT and GLOBAL_IMPLICIT are used internally by the symbol + table. GLOBAL is returned from PyST_GetScope() for either of them. + It is stored in ste_symbols at bits 12-14. +*/ +#define SCOPE_OFF 11 +#define SCOPE_MASK 7 + +#define LOCAL 1 +#define GLOBAL_EXPLICIT 2 +#define GLOBAL_IMPLICIT 3 +#define FREE 4 +#define CELL 5 + +/* The following three names are used for the ste_unoptimized bit field */ +#define OPT_IMPORT_STAR 1 +#define OPT_EXEC 2 +#define OPT_BARE_EXEC 4 +#define OPT_TOPLEVEL 8 /* top-level names, including eval and exec */ + +#define GENERATOR 1 +#define GENERATOR_EXPRESSION 2 + +#ifdef __cplusplus +} +#endif +#endif /* !Py_SYMTABLE_H */ diff --git a/extern/include/Python-2.7/sysmodule.h b/extern/include/Python-2.7/sysmodule.h new file mode 100644 index 0000000..bf962b5 --- /dev/null +++ b/extern/include/Python-2.7/sysmodule.h @@ -0,0 +1,29 @@ + +/* System module interface */ + +#ifndef Py_SYSMODULE_H +#define Py_SYSMODULE_H +#ifdef __cplusplus +extern "C" { +#endif + +PyAPI_FUNC(PyObject *) PySys_GetObject(char *); +PyAPI_FUNC(int) PySys_SetObject(char *, PyObject *); +PyAPI_FUNC(FILE *) PySys_GetFile(char *, FILE *); +PyAPI_FUNC(void) PySys_SetArgv(int, char **); +PyAPI_FUNC(void) PySys_SetArgvEx(int, char **, int); +PyAPI_FUNC(void) PySys_SetPath(char *); + +PyAPI_FUNC(void) PySys_WriteStdout(const char *format, ...) + Py_GCC_ATTRIBUTE((format(printf, 1, 2))); +PyAPI_FUNC(void) PySys_WriteStderr(const char *format, ...) + Py_GCC_ATTRIBUTE((format(printf, 1, 2))); + +PyAPI_FUNC(void) PySys_ResetWarnOptions(void); +PyAPI_FUNC(void) PySys_AddWarnOption(char *); +PyAPI_FUNC(int) PySys_HasWarnOptions(void); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_SYSMODULE_H */ diff --git a/extern/include/Python-2.7/timefuncs.h b/extern/include/Python-2.7/timefuncs.h new file mode 100644 index 0000000..a9d26a7 --- /dev/null +++ b/extern/include/Python-2.7/timefuncs.h @@ -0,0 +1,26 @@ +/* timefuncs.h + */ + +/* Utility function related to timemodule.c. */ + +#ifndef TIMEFUNCS_H +#define TIMEFUNCS_H +#ifdef __cplusplus +extern "C" { +#endif + + +/* Cast double x to time_t, but raise ValueError if x is too large + * to fit in a time_t. ValueError is set on return iff the return + * value is (time_t)-1 and PyErr_Occurred(). + */ +PyAPI_FUNC(time_t) _PyTime_DoubleToTimet(double x); + +/* Get the current time since the epoch in seconds */ +PyAPI_FUNC(double) _PyTime_FloatTime(void); + + +#ifdef __cplusplus +} +#endif +#endif /* TIMEFUNCS_H */ diff --git a/extern/include/Python-2.7/token.h b/extern/include/Python-2.7/token.h new file mode 100644 index 0000000..86c48e1 --- /dev/null +++ b/extern/include/Python-2.7/token.h @@ -0,0 +1,85 @@ + +/* Token types */ + +#ifndef Py_TOKEN_H +#define Py_TOKEN_H +#ifdef __cplusplus +extern "C" { +#endif + +#undef TILDE /* Prevent clash of our definition with system macro. Ex AIX, ioctl.h */ + +#define ENDMARKER 0 +#define NAME 1 +#define NUMBER 2 +#define STRING 3 +#define NEWLINE 4 +#define INDENT 5 +#define DEDENT 6 +#define LPAR 7 +#define RPAR 8 +#define LSQB 9 +#define RSQB 10 +#define COLON 11 +#define COMMA 12 +#define SEMI 13 +#define PLUS 14 +#define MINUS 15 +#define STAR 16 +#define SLASH 17 +#define VBAR 18 +#define AMPER 19 +#define LESS 20 +#define GREATER 21 +#define EQUAL 22 +#define DOT 23 +#define PERCENT 24 +#define BACKQUOTE 25 +#define LBRACE 26 +#define RBRACE 27 +#define EQEQUAL 28 +#define NOTEQUAL 29 +#define LESSEQUAL 30 +#define GREATEREQUAL 31 +#define TILDE 32 +#define CIRCUMFLEX 33 +#define LEFTSHIFT 34 +#define RIGHTSHIFT 35 +#define DOUBLESTAR 36 +#define PLUSEQUAL 37 +#define MINEQUAL 38 +#define STAREQUAL 39 +#define SLASHEQUAL 40 +#define PERCENTEQUAL 41 +#define AMPEREQUAL 42 +#define VBAREQUAL 43 +#define CIRCUMFLEXEQUAL 44 +#define LEFTSHIFTEQUAL 45 +#define RIGHTSHIFTEQUAL 46 +#define DOUBLESTAREQUAL 47 +#define DOUBLESLASH 48 +#define DOUBLESLASHEQUAL 49 +//#define AT 50 +/* Don't forget to update the table _PyParser_TokenNames in tokenizer.c! */ +#define OP 51 +#define ERRORTOKEN 52 +#define N_TOKENS 53 + +/* Special definitions for cooperation with parser */ + +#define NT_OFFSET 256 + +#define ISTERMINAL(x) ((x) < NT_OFFSET) +#define ISNONTERMINAL(x) ((x) >= NT_OFFSET) +#define ISEOF(x) ((x) == ENDMARKER) + + +PyAPI_DATA(char *) _PyParser_TokenNames[]; /* Token names */ +PyAPI_FUNC(int) PyToken_OneChar(int); +PyAPI_FUNC(int) PyToken_TwoChars(int, int); +PyAPI_FUNC(int) PyToken_ThreeChars(int, int, int); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_TOKEN_H */ diff --git a/extern/include/Python-2.7/traceback.h b/extern/include/Python-2.7/traceback.h new file mode 100644 index 0000000..e7943da --- /dev/null +++ b/extern/include/Python-2.7/traceback.h @@ -0,0 +1,31 @@ + +#ifndef Py_TRACEBACK_H +#define Py_TRACEBACK_H +#ifdef __cplusplus +extern "C" { +#endif + +struct _frame; + +/* Traceback interface */ + +typedef struct _traceback { + PyObject_HEAD + struct _traceback *tb_next; + struct _frame *tb_frame; + int tb_lasti; + int tb_lineno; +} PyTracebackObject; + +PyAPI_FUNC(int) PyTraceBack_Here(struct _frame *); +PyAPI_FUNC(int) PyTraceBack_Print(PyObject *, PyObject *); +PyAPI_FUNC(int) _Py_DisplaySourceLine(PyObject *, const char *, int, int); + +/* Reveal traceback type so we can typecheck traceback objects */ +PyAPI_DATA(PyTypeObject) PyTraceBack_Type; +#define PyTraceBack_Check(v) (Py_TYPE(v) == &PyTraceBack_Type) + +#ifdef __cplusplus +} +#endif +#endif /* !Py_TRACEBACK_H */ diff --git a/extern/include/Python-2.7/tupleobject.h b/extern/include/Python-2.7/tupleobject.h new file mode 100644 index 0000000..a5ab733 --- /dev/null +++ b/extern/include/Python-2.7/tupleobject.h @@ -0,0 +1,61 @@ + +/* Tuple object interface */ + +#ifndef Py_TUPLEOBJECT_H +#define Py_TUPLEOBJECT_H +#ifdef __cplusplus +extern "C" { +#endif + +/* +Another generally useful object type is a tuple of object pointers. +For Python, this is an immutable type. C code can change the tuple items +(but not their number), and even use tuples are general-purpose arrays of +object references, but in general only brand new tuples should be mutated, +not ones that might already have been exposed to Python code. + +*** WARNING *** PyTuple_SetItem does not increment the new item's reference +count, but does decrement the reference count of the item it replaces, +if not nil. It does *decrement* the reference count if it is *not* +inserted in the tuple. Similarly, PyTuple_GetItem does not increment the +returned item's reference count. +*/ + +typedef struct { + PyObject_VAR_HEAD + PyObject *ob_item[1]; + + /* ob_item contains space for 'ob_size' elements. + * Items must normally not be NULL, except during construction when + * the tuple is not yet visible outside the function that builds it. + */ +} PyTupleObject; + +PyAPI_DATA(PyTypeObject) PyTuple_Type; + +#define PyTuple_Check(op) \ + PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_TUPLE_SUBCLASS) +#define PyTuple_CheckExact(op) (Py_TYPE(op) == &PyTuple_Type) + +PyAPI_FUNC(PyObject *) PyTuple_New(Py_ssize_t size); +PyAPI_FUNC(Py_ssize_t) PyTuple_Size(PyObject *); +PyAPI_FUNC(PyObject *) PyTuple_GetItem(PyObject *, Py_ssize_t); +PyAPI_FUNC(int) PyTuple_SetItem(PyObject *, Py_ssize_t, PyObject *); +PyAPI_FUNC(PyObject *) PyTuple_GetSlice(PyObject *, Py_ssize_t, Py_ssize_t); +PyAPI_FUNC(int) _PyTuple_Resize(PyObject **, Py_ssize_t); +PyAPI_FUNC(PyObject *) PyTuple_Pack(Py_ssize_t, ...); +PyAPI_FUNC(void) _PyTuple_MaybeUntrack(PyObject *); + +/* Macro, trading safety for speed */ +#define PyTuple_GET_ITEM(op, i) (((PyTupleObject *)(op))->ob_item[i]) +#define PyTuple_GET_SIZE(op) Py_SIZE(op) + +/* Macro, *only* to be used to fill in brand new tuples */ +#define PyTuple_SET_ITEM(op, i, v) (((PyTupleObject *)(op))->ob_item[i] = v) + +PyAPI_FUNC(int) PyTuple_ClearFreeList(void); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_TUPLEOBJECT_H */ diff --git a/extern/include/Python-2.7/ucnhash.h b/extern/include/Python-2.7/ucnhash.h new file mode 100644 index 0000000..69b7774 --- /dev/null +++ b/extern/include/Python-2.7/ucnhash.h @@ -0,0 +1,33 @@ +/* Unicode name database interface */ + +#ifndef Py_UCNHASH_H +#define Py_UCNHASH_H +#ifdef __cplusplus +extern "C" { +#endif + +/* revised ucnhash CAPI interface (exported through a "wrapper") */ + +#define PyUnicodeData_CAPSULE_NAME "unicodedata.ucnhash_CAPI" + +typedef struct { + + /* Size of this struct */ + int size; + + /* Get name for a given character code. Returns non-zero if + success, zero if not. Does not set Python exceptions. + If self is NULL, data come from the default version of the database. + If it is not NULL, it should be a unicodedata.ucd_X_Y_Z object */ + int (*getname)(PyObject *self, Py_UCS4 code, char* buffer, int buflen); + + /* Get character code for a given name. Same error handling + as for getname. */ + int (*getcode)(PyObject *self, const char* name, int namelen, Py_UCS4* code); + +} _PyUnicode_Name_CAPI; + +#ifdef __cplusplus +} +#endif +#endif /* !Py_UCNHASH_H */ diff --git a/extern/include/Python-2.7/unicodeobject.h b/extern/include/Python-2.7/unicodeobject.h new file mode 100644 index 0000000..ceffb09 --- /dev/null +++ b/extern/include/Python-2.7/unicodeobject.h @@ -0,0 +1,1413 @@ +#ifndef Py_UNICODEOBJECT_H +#define Py_UNICODEOBJECT_H + +#include + +/* + +Unicode implementation based on original code by Fredrik Lundh, +modified by Marc-Andre Lemburg (mal@lemburg.com) according to the +Unicode Integration Proposal (see file Misc/unicode.txt). + +Copyright (c) Corporation for National Research Initiatives. + + + Original header: + -------------------------------------------------------------------- + + * Yet another Unicode string type for Python. This type supports the + * 16-bit Basic Multilingual Plane (BMP) only. + * + * Written by Fredrik Lundh, January 1999. + * + * Copyright (c) 1999 by Secret Labs AB. + * Copyright (c) 1999 by Fredrik Lundh. + * + * fredrik@pythonware.com + * http://www.pythonware.com + * + * -------------------------------------------------------------------- + * This Unicode String Type is + * + * Copyright (c) 1999 by Secret Labs AB + * Copyright (c) 1999 by Fredrik Lundh + * + * By obtaining, using, and/or copying this software and/or its + * associated documentation, you agree that you have read, understood, + * and will comply with the following terms and conditions: + * + * Permission to use, copy, modify, and distribute this software and its + * associated documentation for any purpose and without fee is hereby + * granted, provided that the above copyright notice appears in all + * copies, and that both that copyright notice and this permission notice + * appear in supporting documentation, and that the name of Secret Labs + * AB or the author not be used in advertising or publicity pertaining to + * distribution of the software without specific, written prior + * permission. + * + * SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO + * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS. IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT + * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * -------------------------------------------------------------------- */ + +#include + +/* === Internal API ======================================================= */ + +/* --- Internal Unicode Format -------------------------------------------- */ + +#ifndef Py_USING_UNICODE + +#define PyUnicode_Check(op) 0 +#define PyUnicode_CheckExact(op) 0 + +#else + +/* FIXME: MvL's new implementation assumes that Py_UNICODE_SIZE is + properly set, but the default rules below doesn't set it. I'll + sort this out some other day -- fredrik@pythonware.com */ + +#ifndef Py_UNICODE_SIZE +#error Must define Py_UNICODE_SIZE +#endif + +/* Setting Py_UNICODE_WIDE enables UCS-4 storage. Otherwise, Unicode + strings are stored as UCS-2 (with limited support for UTF-16) */ + +#if Py_UNICODE_SIZE >= 4 +#define Py_UNICODE_WIDE +#endif + +/* Set these flags if the platform has "wchar.h", "wctype.h" and the + wchar_t type is a 16-bit unsigned type */ +/* #define HAVE_WCHAR_H */ +/* #define HAVE_USABLE_WCHAR_T */ + +/* Defaults for various platforms */ +#ifndef PY_UNICODE_TYPE + +/* Windows has a usable wchar_t type (unless we're using UCS-4) */ +# if defined(MS_WIN32) && Py_UNICODE_SIZE == 2 +# define HAVE_USABLE_WCHAR_T +# define PY_UNICODE_TYPE wchar_t +# endif + +# if defined(Py_UNICODE_WIDE) +# define PY_UNICODE_TYPE Py_UCS4 +# endif + +#endif + +/* If the compiler provides a wchar_t type we try to support it + through the interface functions PyUnicode_FromWideChar() and + PyUnicode_AsWideChar(). */ + +#ifdef HAVE_USABLE_WCHAR_T +# ifndef HAVE_WCHAR_H +# define HAVE_WCHAR_H +# endif +#endif + +#ifdef HAVE_WCHAR_H +/* Work around a cosmetic bug in BSDI 4.x wchar.h; thanks to Thomas Wouters */ +# ifdef _HAVE_BSDI +# include +# endif +# include +#endif + +/* + * Use this typedef when you need to represent a UTF-16 surrogate pair + * as single unsigned integer. + */ +#if SIZEOF_INT >= 4 +typedef unsigned int Py_UCS4; +#elif SIZEOF_LONG >= 4 +typedef unsigned long Py_UCS4; +#endif + +/* Py_UNICODE is the native Unicode storage format (code unit) used by + Python and represents a single Unicode element in the Unicode + type. */ + +typedef PY_UNICODE_TYPE Py_UNICODE; + +/* --- UCS-2/UCS-4 Name Mangling ------------------------------------------ */ + +/* Unicode API names are mangled to assure that UCS-2 and UCS-4 builds + produce different external names and thus cause import errors in + case Python interpreters and extensions with mixed compiled in + Unicode width assumptions are combined. */ + +#ifndef Py_UNICODE_WIDE + +# define PyUnicode_AsASCIIString PyUnicodeUCS2_AsASCIIString +# define PyUnicode_AsCharmapString PyUnicodeUCS2_AsCharmapString +# define PyUnicode_AsEncodedObject PyUnicodeUCS2_AsEncodedObject +# define PyUnicode_AsEncodedString PyUnicodeUCS2_AsEncodedString +# define PyUnicode_AsLatin1String PyUnicodeUCS2_AsLatin1String +# define PyUnicode_AsRawUnicodeEscapeString PyUnicodeUCS2_AsRawUnicodeEscapeString +# define PyUnicode_AsUTF32String PyUnicodeUCS2_AsUTF32String +# define PyUnicode_AsUTF16String PyUnicodeUCS2_AsUTF16String +# define PyUnicode_AsUTF8String PyUnicodeUCS2_AsUTF8String +# define PyUnicode_AsUnicode PyUnicodeUCS2_AsUnicode +# define PyUnicode_AsUnicodeEscapeString PyUnicodeUCS2_AsUnicodeEscapeString +# define PyUnicode_AsWideChar PyUnicodeUCS2_AsWideChar +# define PyUnicode_ClearFreeList PyUnicodeUCS2_ClearFreelist +# define PyUnicode_Compare PyUnicodeUCS2_Compare +# define PyUnicode_Concat PyUnicodeUCS2_Concat +# define PyUnicode_Contains PyUnicodeUCS2_Contains +# define PyUnicode_Count PyUnicodeUCS2_Count +# define PyUnicode_Decode PyUnicodeUCS2_Decode +# define PyUnicode_DecodeASCII PyUnicodeUCS2_DecodeASCII +# define PyUnicode_DecodeCharmap PyUnicodeUCS2_DecodeCharmap +# define PyUnicode_DecodeLatin1 PyUnicodeUCS2_DecodeLatin1 +# define PyUnicode_DecodeRawUnicodeEscape PyUnicodeUCS2_DecodeRawUnicodeEscape +# define PyUnicode_DecodeUTF32 PyUnicodeUCS2_DecodeUTF32 +# define PyUnicode_DecodeUTF32Stateful PyUnicodeUCS2_DecodeUTF32Stateful +# define PyUnicode_DecodeUTF16 PyUnicodeUCS2_DecodeUTF16 +# define PyUnicode_DecodeUTF16Stateful PyUnicodeUCS2_DecodeUTF16Stateful +# define PyUnicode_DecodeUTF8 PyUnicodeUCS2_DecodeUTF8 +# define PyUnicode_DecodeUTF8Stateful PyUnicodeUCS2_DecodeUTF8Stateful +# define PyUnicode_DecodeUnicodeEscape PyUnicodeUCS2_DecodeUnicodeEscape +# define PyUnicode_Encode PyUnicodeUCS2_Encode +# define PyUnicode_EncodeASCII PyUnicodeUCS2_EncodeASCII +# define PyUnicode_EncodeCharmap PyUnicodeUCS2_EncodeCharmap +# define PyUnicode_EncodeDecimal PyUnicodeUCS2_EncodeDecimal +# define PyUnicode_EncodeLatin1 PyUnicodeUCS2_EncodeLatin1 +# define PyUnicode_EncodeRawUnicodeEscape PyUnicodeUCS2_EncodeRawUnicodeEscape +# define PyUnicode_EncodeUTF32 PyUnicodeUCS2_EncodeUTF32 +# define PyUnicode_EncodeUTF16 PyUnicodeUCS2_EncodeUTF16 +# define PyUnicode_EncodeUTF8 PyUnicodeUCS2_EncodeUTF8 +# define PyUnicode_EncodeUnicodeEscape PyUnicodeUCS2_EncodeUnicodeEscape +# define PyUnicode_Find PyUnicodeUCS2_Find +# define PyUnicode_Format PyUnicodeUCS2_Format +# define PyUnicode_FromEncodedObject PyUnicodeUCS2_FromEncodedObject +# define PyUnicode_FromFormat PyUnicodeUCS2_FromFormat +# define PyUnicode_FromFormatV PyUnicodeUCS2_FromFormatV +# define PyUnicode_FromObject PyUnicodeUCS2_FromObject +# define PyUnicode_FromOrdinal PyUnicodeUCS2_FromOrdinal +# define PyUnicode_FromString PyUnicodeUCS2_FromString +# define PyUnicode_FromStringAndSize PyUnicodeUCS2_FromStringAndSize +# define PyUnicode_FromUnicode PyUnicodeUCS2_FromUnicode +# define PyUnicode_FromWideChar PyUnicodeUCS2_FromWideChar +# define PyUnicode_GetDefaultEncoding PyUnicodeUCS2_GetDefaultEncoding +# define PyUnicode_GetMax PyUnicodeUCS2_GetMax +# define PyUnicode_GetSize PyUnicodeUCS2_GetSize +# define PyUnicode_Join PyUnicodeUCS2_Join +# define PyUnicode_Partition PyUnicodeUCS2_Partition +# define PyUnicode_RPartition PyUnicodeUCS2_RPartition +# define PyUnicode_RSplit PyUnicodeUCS2_RSplit +# define PyUnicode_Replace PyUnicodeUCS2_Replace +# define PyUnicode_Resize PyUnicodeUCS2_Resize +# define PyUnicode_RichCompare PyUnicodeUCS2_RichCompare +# define PyUnicode_SetDefaultEncoding PyUnicodeUCS2_SetDefaultEncoding +# define PyUnicode_Split PyUnicodeUCS2_Split +# define PyUnicode_Splitlines PyUnicodeUCS2_Splitlines +# define PyUnicode_Tailmatch PyUnicodeUCS2_Tailmatch +# define PyUnicode_Translate PyUnicodeUCS2_Translate +# define PyUnicode_TranslateCharmap PyUnicodeUCS2_TranslateCharmap +# define _PyUnicode_AsDefaultEncodedString _PyUnicodeUCS2_AsDefaultEncodedString +# define _PyUnicode_Fini _PyUnicodeUCS2_Fini +# define _PyUnicode_Init _PyUnicodeUCS2_Init +# define _PyUnicode_IsAlpha _PyUnicodeUCS2_IsAlpha +# define _PyUnicode_IsDecimalDigit _PyUnicodeUCS2_IsDecimalDigit +# define _PyUnicode_IsDigit _PyUnicodeUCS2_IsDigit +# define _PyUnicode_IsLinebreak _PyUnicodeUCS2_IsLinebreak +# define _PyUnicode_IsLowercase _PyUnicodeUCS2_IsLowercase +# define _PyUnicode_IsNumeric _PyUnicodeUCS2_IsNumeric +# define _PyUnicode_IsTitlecase _PyUnicodeUCS2_IsTitlecase +# define _PyUnicode_IsUppercase _PyUnicodeUCS2_IsUppercase +# define _PyUnicode_IsWhitespace _PyUnicodeUCS2_IsWhitespace +# define _PyUnicode_ToDecimalDigit _PyUnicodeUCS2_ToDecimalDigit +# define _PyUnicode_ToDigit _PyUnicodeUCS2_ToDigit +# define _PyUnicode_ToLowercase _PyUnicodeUCS2_ToLowercase +# define _PyUnicode_ToNumeric _PyUnicodeUCS2_ToNumeric +# define _PyUnicode_ToTitlecase _PyUnicodeUCS2_ToTitlecase +# define _PyUnicode_ToUppercase _PyUnicodeUCS2_ToUppercase + +#else + +# define PyUnicode_AsASCIIString PyUnicodeUCS4_AsASCIIString +# define PyUnicode_AsCharmapString PyUnicodeUCS4_AsCharmapString +# define PyUnicode_AsEncodedObject PyUnicodeUCS4_AsEncodedObject +# define PyUnicode_AsEncodedString PyUnicodeUCS4_AsEncodedString +# define PyUnicode_AsLatin1String PyUnicodeUCS4_AsLatin1String +# define PyUnicode_AsRawUnicodeEscapeString PyUnicodeUCS4_AsRawUnicodeEscapeString +# define PyUnicode_AsUTF32String PyUnicodeUCS4_AsUTF32String +# define PyUnicode_AsUTF16String PyUnicodeUCS4_AsUTF16String +# define PyUnicode_AsUTF8String PyUnicodeUCS4_AsUTF8String +# define PyUnicode_AsUnicode PyUnicodeUCS4_AsUnicode +# define PyUnicode_AsUnicodeEscapeString PyUnicodeUCS4_AsUnicodeEscapeString +# define PyUnicode_AsWideChar PyUnicodeUCS4_AsWideChar +# define PyUnicode_ClearFreeList PyUnicodeUCS4_ClearFreelist +# define PyUnicode_Compare PyUnicodeUCS4_Compare +# define PyUnicode_Concat PyUnicodeUCS4_Concat +# define PyUnicode_Contains PyUnicodeUCS4_Contains +# define PyUnicode_Count PyUnicodeUCS4_Count +# define PyUnicode_Decode PyUnicodeUCS4_Decode +# define PyUnicode_DecodeASCII PyUnicodeUCS4_DecodeASCII +# define PyUnicode_DecodeCharmap PyUnicodeUCS4_DecodeCharmap +# define PyUnicode_DecodeLatin1 PyUnicodeUCS4_DecodeLatin1 +# define PyUnicode_DecodeRawUnicodeEscape PyUnicodeUCS4_DecodeRawUnicodeEscape +# define PyUnicode_DecodeUTF32 PyUnicodeUCS4_DecodeUTF32 +# define PyUnicode_DecodeUTF32Stateful PyUnicodeUCS4_DecodeUTF32Stateful +# define PyUnicode_DecodeUTF16 PyUnicodeUCS4_DecodeUTF16 +# define PyUnicode_DecodeUTF16Stateful PyUnicodeUCS4_DecodeUTF16Stateful +# define PyUnicode_DecodeUTF8 PyUnicodeUCS4_DecodeUTF8 +# define PyUnicode_DecodeUTF8Stateful PyUnicodeUCS4_DecodeUTF8Stateful +# define PyUnicode_DecodeUnicodeEscape PyUnicodeUCS4_DecodeUnicodeEscape +# define PyUnicode_Encode PyUnicodeUCS4_Encode +# define PyUnicode_EncodeASCII PyUnicodeUCS4_EncodeASCII +# define PyUnicode_EncodeCharmap PyUnicodeUCS4_EncodeCharmap +# define PyUnicode_EncodeDecimal PyUnicodeUCS4_EncodeDecimal +# define PyUnicode_EncodeLatin1 PyUnicodeUCS4_EncodeLatin1 +# define PyUnicode_EncodeRawUnicodeEscape PyUnicodeUCS4_EncodeRawUnicodeEscape +# define PyUnicode_EncodeUTF32 PyUnicodeUCS4_EncodeUTF32 +# define PyUnicode_EncodeUTF16 PyUnicodeUCS4_EncodeUTF16 +# define PyUnicode_EncodeUTF8 PyUnicodeUCS4_EncodeUTF8 +# define PyUnicode_EncodeUnicodeEscape PyUnicodeUCS4_EncodeUnicodeEscape +# define PyUnicode_Find PyUnicodeUCS4_Find +# define PyUnicode_Format PyUnicodeUCS4_Format +# define PyUnicode_FromEncodedObject PyUnicodeUCS4_FromEncodedObject +# define PyUnicode_FromFormat PyUnicodeUCS4_FromFormat +# define PyUnicode_FromFormatV PyUnicodeUCS4_FromFormatV +# define PyUnicode_FromObject PyUnicodeUCS4_FromObject +# define PyUnicode_FromOrdinal PyUnicodeUCS4_FromOrdinal +# define PyUnicode_FromString PyUnicodeUCS4_FromString +# define PyUnicode_FromStringAndSize PyUnicodeUCS4_FromStringAndSize +# define PyUnicode_FromUnicode PyUnicodeUCS4_FromUnicode +# define PyUnicode_FromWideChar PyUnicodeUCS4_FromWideChar +# define PyUnicode_GetDefaultEncoding PyUnicodeUCS4_GetDefaultEncoding +# define PyUnicode_GetMax PyUnicodeUCS4_GetMax +# define PyUnicode_GetSize PyUnicodeUCS4_GetSize +# define PyUnicode_Join PyUnicodeUCS4_Join +# define PyUnicode_Partition PyUnicodeUCS4_Partition +# define PyUnicode_RPartition PyUnicodeUCS4_RPartition +# define PyUnicode_RSplit PyUnicodeUCS4_RSplit +# define PyUnicode_Replace PyUnicodeUCS4_Replace +# define PyUnicode_Resize PyUnicodeUCS4_Resize +# define PyUnicode_RichCompare PyUnicodeUCS4_RichCompare +# define PyUnicode_SetDefaultEncoding PyUnicodeUCS4_SetDefaultEncoding +# define PyUnicode_Split PyUnicodeUCS4_Split +# define PyUnicode_Splitlines PyUnicodeUCS4_Splitlines +# define PyUnicode_Tailmatch PyUnicodeUCS4_Tailmatch +# define PyUnicode_Translate PyUnicodeUCS4_Translate +# define PyUnicode_TranslateCharmap PyUnicodeUCS4_TranslateCharmap +# define _PyUnicode_AsDefaultEncodedString _PyUnicodeUCS4_AsDefaultEncodedString +# define _PyUnicode_Fini _PyUnicodeUCS4_Fini +# define _PyUnicode_Init _PyUnicodeUCS4_Init +# define _PyUnicode_IsAlpha _PyUnicodeUCS4_IsAlpha +# define _PyUnicode_IsDecimalDigit _PyUnicodeUCS4_IsDecimalDigit +# define _PyUnicode_IsDigit _PyUnicodeUCS4_IsDigit +# define _PyUnicode_IsLinebreak _PyUnicodeUCS4_IsLinebreak +# define _PyUnicode_IsLowercase _PyUnicodeUCS4_IsLowercase +# define _PyUnicode_IsNumeric _PyUnicodeUCS4_IsNumeric +# define _PyUnicode_IsTitlecase _PyUnicodeUCS4_IsTitlecase +# define _PyUnicode_IsUppercase _PyUnicodeUCS4_IsUppercase +# define _PyUnicode_IsWhitespace _PyUnicodeUCS4_IsWhitespace +# define _PyUnicode_ToDecimalDigit _PyUnicodeUCS4_ToDecimalDigit +# define _PyUnicode_ToDigit _PyUnicodeUCS4_ToDigit +# define _PyUnicode_ToLowercase _PyUnicodeUCS4_ToLowercase +# define _PyUnicode_ToNumeric _PyUnicodeUCS4_ToNumeric +# define _PyUnicode_ToTitlecase _PyUnicodeUCS4_ToTitlecase +# define _PyUnicode_ToUppercase _PyUnicodeUCS4_ToUppercase + + +#endif + +/* --- Internal Unicode Operations ---------------------------------------- */ + +/* If you want Python to use the compiler's wctype.h functions instead + of the ones supplied with Python, define WANT_WCTYPE_FUNCTIONS or + configure Python using --with-wctype-functions. This reduces the + interpreter's code size. */ + +#if defined(HAVE_USABLE_WCHAR_T) && defined(WANT_WCTYPE_FUNCTIONS) + +#include + +#define Py_UNICODE_ISSPACE(ch) iswspace(ch) + +#define Py_UNICODE_ISLOWER(ch) iswlower(ch) +#define Py_UNICODE_ISUPPER(ch) iswupper(ch) +#define Py_UNICODE_ISTITLE(ch) _PyUnicode_IsTitlecase(ch) +#define Py_UNICODE_ISLINEBREAK(ch) _PyUnicode_IsLinebreak(ch) + +#define Py_UNICODE_TOLOWER(ch) towlower(ch) +#define Py_UNICODE_TOUPPER(ch) towupper(ch) +#define Py_UNICODE_TOTITLE(ch) _PyUnicode_ToTitlecase(ch) + +#define Py_UNICODE_ISDECIMAL(ch) _PyUnicode_IsDecimalDigit(ch) +#define Py_UNICODE_ISDIGIT(ch) _PyUnicode_IsDigit(ch) +#define Py_UNICODE_ISNUMERIC(ch) _PyUnicode_IsNumeric(ch) + +#define Py_UNICODE_TODECIMAL(ch) _PyUnicode_ToDecimalDigit(ch) +#define Py_UNICODE_TODIGIT(ch) _PyUnicode_ToDigit(ch) +#define Py_UNICODE_TONUMERIC(ch) _PyUnicode_ToNumeric(ch) + +#define Py_UNICODE_ISALPHA(ch) iswalpha(ch) + +#else + +/* Since splitting on whitespace is an important use case, and + whitespace in most situations is solely ASCII whitespace, we + optimize for the common case by using a quick look-up table + _Py_ascii_whitespace (see below) with an inlined check. + + */ +#define Py_UNICODE_ISSPACE(ch) \ + ((ch) < 128U ? _Py_ascii_whitespace[(ch)] : _PyUnicode_IsWhitespace(ch)) + +#define Py_UNICODE_ISLOWER(ch) _PyUnicode_IsLowercase(ch) +#define Py_UNICODE_ISUPPER(ch) _PyUnicode_IsUppercase(ch) +#define Py_UNICODE_ISTITLE(ch) _PyUnicode_IsTitlecase(ch) +#define Py_UNICODE_ISLINEBREAK(ch) _PyUnicode_IsLinebreak(ch) + +#define Py_UNICODE_TOLOWER(ch) _PyUnicode_ToLowercase(ch) +#define Py_UNICODE_TOUPPER(ch) _PyUnicode_ToUppercase(ch) +#define Py_UNICODE_TOTITLE(ch) _PyUnicode_ToTitlecase(ch) + +#define Py_UNICODE_ISDECIMAL(ch) _PyUnicode_IsDecimalDigit(ch) +#define Py_UNICODE_ISDIGIT(ch) _PyUnicode_IsDigit(ch) +#define Py_UNICODE_ISNUMERIC(ch) _PyUnicode_IsNumeric(ch) + +#define Py_UNICODE_TODECIMAL(ch) _PyUnicode_ToDecimalDigit(ch) +#define Py_UNICODE_TODIGIT(ch) _PyUnicode_ToDigit(ch) +#define Py_UNICODE_TONUMERIC(ch) _PyUnicode_ToNumeric(ch) + +#define Py_UNICODE_ISALPHA(ch) _PyUnicode_IsAlpha(ch) + +#endif + +#define Py_UNICODE_ISALNUM(ch) \ + (Py_UNICODE_ISALPHA(ch) || \ + Py_UNICODE_ISDECIMAL(ch) || \ + Py_UNICODE_ISDIGIT(ch) || \ + Py_UNICODE_ISNUMERIC(ch)) + +#define Py_UNICODE_COPY(target, source, length) \ + Py_MEMCPY((target), (source), (length)*sizeof(Py_UNICODE)) + +#define Py_UNICODE_FILL(target, value, length) \ + do {Py_ssize_t i_; Py_UNICODE *t_ = (target); Py_UNICODE v_ = (value);\ + for (i_ = 0; i_ < (length); i_++) t_[i_] = v_;\ + } while (0) + +/* Check if substring matches at given offset. the offset must be + valid, and the substring must not be empty */ + +#define Py_UNICODE_MATCH(string, offset, substring) \ + ((*((string)->str + (offset)) == *((substring)->str)) && \ + ((*((string)->str + (offset) + (substring)->length-1) == *((substring)->str + (substring)->length-1))) && \ + !memcmp((string)->str + (offset), (substring)->str, (substring)->length*sizeof(Py_UNICODE))) + +#ifdef __cplusplus +extern "C" { +#endif + +/* --- Unicode Type ------------------------------------------------------- */ + +typedef struct { + PyObject_HEAD + Py_ssize_t length; /* Length of raw Unicode data in buffer */ + Py_UNICODE *str; /* Raw Unicode buffer */ + long hash; /* Hash value; -1 if not set */ + PyObject *defenc; /* (Default) Encoded version as Python + string, or NULL; this is used for + implementing the buffer protocol */ +} PyUnicodeObject; + +PyAPI_DATA(PyTypeObject) PyUnicode_Type; + +#define PyUnicode_Check(op) \ + PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_UNICODE_SUBCLASS) +#define PyUnicode_CheckExact(op) (Py_TYPE(op) == &PyUnicode_Type) + +/* Fast access macros */ +#define PyUnicode_GET_SIZE(op) \ + (((PyUnicodeObject *)(op))->length) +#define PyUnicode_GET_DATA_SIZE(op) \ + (((PyUnicodeObject *)(op))->length * sizeof(Py_UNICODE)) +#define PyUnicode_AS_UNICODE(op) \ + (((PyUnicodeObject *)(op))->str) +#define PyUnicode_AS_DATA(op) \ + ((const char *)((PyUnicodeObject *)(op))->str) + +/* --- Constants ---------------------------------------------------------- */ + +/* This Unicode character will be used as replacement character during + decoding if the errors argument is set to "replace". Note: the + Unicode character U+FFFD is the official REPLACEMENT CHARACTER in + Unicode 3.0. */ + +#define Py_UNICODE_REPLACEMENT_CHARACTER ((Py_UNICODE) 0xFFFD) + +/* === Public API ========================================================= */ + +/* --- Plain Py_UNICODE --------------------------------------------------- */ + +/* Create a Unicode Object from the Py_UNICODE buffer u of the given + size. + + u may be NULL which causes the contents to be undefined. It is the + user's responsibility to fill in the needed data afterwards. Note + that modifying the Unicode object contents after construction is + only allowed if u was set to NULL. + + The buffer is copied into the new object. */ + +PyAPI_FUNC(PyObject*) PyUnicode_FromUnicode( + const Py_UNICODE *u, /* Unicode buffer */ + Py_ssize_t size /* size of buffer */ + ); + +/* Similar to PyUnicode_FromUnicode(), but u points to Latin-1 encoded bytes */ +PyAPI_FUNC(PyObject*) PyUnicode_FromStringAndSize( + const char *u, /* char buffer */ + Py_ssize_t size /* size of buffer */ + ); + +/* Similar to PyUnicode_FromUnicode(), but u points to null-terminated + Latin-1 encoded bytes */ +PyAPI_FUNC(PyObject*) PyUnicode_FromString( + const char *u /* string */ + ); + +/* Return a read-only pointer to the Unicode object's internal + Py_UNICODE buffer. */ + +PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode( + PyObject *unicode /* Unicode object */ + ); + +/* Get the length of the Unicode object. */ + +PyAPI_FUNC(Py_ssize_t) PyUnicode_GetSize( + PyObject *unicode /* Unicode object */ + ); + +/* Get the maximum ordinal for a Unicode character. */ +PyAPI_FUNC(Py_UNICODE) PyUnicode_GetMax(void); + +/* Resize an already allocated Unicode object to the new size length. + + *unicode is modified to point to the new (resized) object and 0 + returned on success. + + This API may only be called by the function which also called the + Unicode constructor. The refcount on the object must be 1. Otherwise, + an error is returned. + + Error handling is implemented as follows: an exception is set, -1 + is returned and *unicode left untouched. + +*/ + +PyAPI_FUNC(int) PyUnicode_Resize( + PyObject **unicode, /* Pointer to the Unicode object */ + Py_ssize_t length /* New length */ + ); + +/* Coerce obj to an Unicode object and return a reference with + *incremented* refcount. + + Coercion is done in the following way: + + 1. String and other char buffer compatible objects are decoded + under the assumptions that they contain data using the current + default encoding. Decoding is done in "strict" mode. + + 2. All other objects (including Unicode objects) raise an + exception. + + The API returns NULL in case of an error. The caller is responsible + for decref'ing the returned objects. + +*/ + +PyAPI_FUNC(PyObject*) PyUnicode_FromEncodedObject( + PyObject *obj, /* Object */ + const char *encoding, /* encoding */ + const char *errors /* error handling */ + ); + +/* Coerce obj to an Unicode object and return a reference with + *incremented* refcount. + + Unicode objects are passed back as-is (subclasses are converted to + true Unicode objects), all other objects are delegated to + PyUnicode_FromEncodedObject(obj, NULL, "strict") which results in + using the default encoding as basis for decoding the object. + + The API returns NULL in case of an error. The caller is responsible + for decref'ing the returned objects. + +*/ + +PyAPI_FUNC(PyObject*) PyUnicode_FromObject( + PyObject *obj /* Object */ + ); + +PyAPI_FUNC(PyObject *) PyUnicode_FromFormatV(const char*, va_list); +PyAPI_FUNC(PyObject *) PyUnicode_FromFormat(const char*, ...); + +/* Format the object based on the format_spec, as defined in PEP 3101 + (Advanced String Formatting). */ +PyAPI_FUNC(PyObject *) _PyUnicode_FormatAdvanced(PyObject *obj, + Py_UNICODE *format_spec, + Py_ssize_t format_spec_len); + +/* --- wchar_t support for platforms which support it --------------------- */ + +#ifdef HAVE_WCHAR_H + +/* Create a Unicode Object from the whcar_t buffer w of the given + size. + + The buffer is copied into the new object. */ + +PyAPI_FUNC(PyObject*) PyUnicode_FromWideChar( + const wchar_t *w, /* wchar_t buffer */ + Py_ssize_t size /* size of buffer */ + ); + +/* Copies the Unicode Object contents into the wchar_t buffer w. At + most size wchar_t characters are copied. + + Note that the resulting wchar_t string may or may not be + 0-terminated. It is the responsibility of the caller to make sure + that the wchar_t string is 0-terminated in case this is required by + the application. + + Returns the number of wchar_t characters copied (excluding a + possibly trailing 0-termination character) or -1 in case of an + error. */ + +PyAPI_FUNC(Py_ssize_t) PyUnicode_AsWideChar( + PyUnicodeObject *unicode, /* Unicode object */ + wchar_t *w, /* wchar_t buffer */ + Py_ssize_t size /* size of buffer */ + ); + +#endif + +/* --- Unicode ordinals --------------------------------------------------- */ + +/* Create a Unicode Object from the given Unicode code point ordinal. + + The ordinal must be in range(0x10000) on narrow Python builds + (UCS2), and range(0x110000) on wide builds (UCS4). A ValueError is + raised in case it is not. + +*/ + +PyAPI_FUNC(PyObject*) PyUnicode_FromOrdinal(int ordinal); + +/* --- Free-list management ----------------------------------------------- */ + +/* Clear the free list used by the Unicode implementation. + + This can be used to release memory used for objects on the free + list back to the Python memory allocator. + +*/ + +PyAPI_FUNC(int) PyUnicode_ClearFreeList(void); + +/* === Builtin Codecs ===================================================== + + Many of these APIs take two arguments encoding and errors. These + parameters encoding and errors have the same semantics as the ones + of the builtin unicode() API. + + Setting encoding to NULL causes the default encoding to be used. + + Error handling is set by errors which may also be set to NULL + meaning to use the default handling defined for the codec. Default + error handling for all builtin codecs is "strict" (ValueErrors are + raised). + + The codecs all use a similar interface. Only deviation from the + generic ones are documented. + +*/ + +/* --- Manage the default encoding ---------------------------------------- */ + +/* Return a Python string holding the default encoded value of the + Unicode object. + + The resulting string is cached in the Unicode object for subsequent + usage by this function. The cached version is needed to implement + the character buffer interface and will live (at least) as long as + the Unicode object itself. + + The refcount of the string is *not* incremented. + + *** Exported for internal use by the interpreter only !!! *** + +*/ + +PyAPI_FUNC(PyObject *) _PyUnicode_AsDefaultEncodedString( + PyObject *, const char *); + +/* Returns the currently active default encoding. + + The default encoding is currently implemented as run-time settable + process global. This may change in future versions of the + interpreter to become a parameter which is managed on a per-thread + basis. + + */ + +PyAPI_FUNC(const char*) PyUnicode_GetDefaultEncoding(void); + +/* Sets the currently active default encoding. + + Returns 0 on success, -1 in case of an error. + + */ + +PyAPI_FUNC(int) PyUnicode_SetDefaultEncoding( + const char *encoding /* Encoding name in standard form */ + ); + +/* --- Generic Codecs ----------------------------------------------------- */ + +/* Create a Unicode object by decoding the encoded string s of the + given size. */ + +PyAPI_FUNC(PyObject*) PyUnicode_Decode( + const char *s, /* encoded string */ + Py_ssize_t size, /* size of buffer */ + const char *encoding, /* encoding */ + const char *errors /* error handling */ + ); + +/* Encodes a Py_UNICODE buffer of the given size and returns a + Python string object. */ + +PyAPI_FUNC(PyObject*) PyUnicode_Encode( + const Py_UNICODE *s, /* Unicode char buffer */ + Py_ssize_t size, /* number of Py_UNICODE chars to encode */ + const char *encoding, /* encoding */ + const char *errors /* error handling */ + ); + +/* Encodes a Unicode object and returns the result as Python + object. */ + +PyAPI_FUNC(PyObject*) PyUnicode_AsEncodedObject( + PyObject *unicode, /* Unicode object */ + const char *encoding, /* encoding */ + const char *errors /* error handling */ + ); + +/* Encodes a Unicode object and returns the result as Python string + object. */ + +PyAPI_FUNC(PyObject*) PyUnicode_AsEncodedString( + PyObject *unicode, /* Unicode object */ + const char *encoding, /* encoding */ + const char *errors /* error handling */ + ); + +PyAPI_FUNC(PyObject*) PyUnicode_BuildEncodingMap( + PyObject* string /* 256 character map */ + ); + + +/* --- UTF-7 Codecs ------------------------------------------------------- */ + +PyAPI_FUNC(PyObject*) PyUnicode_DecodeUTF7( + const char *string, /* UTF-7 encoded string */ + Py_ssize_t length, /* size of string */ + const char *errors /* error handling */ + ); + +PyAPI_FUNC(PyObject*) PyUnicode_DecodeUTF7Stateful( + const char *string, /* UTF-7 encoded string */ + Py_ssize_t length, /* size of string */ + const char *errors, /* error handling */ + Py_ssize_t *consumed /* bytes consumed */ + ); + +PyAPI_FUNC(PyObject*) PyUnicode_EncodeUTF7( + const Py_UNICODE *data, /* Unicode char buffer */ + Py_ssize_t length, /* number of Py_UNICODE chars to encode */ + int base64SetO, /* Encode RFC2152 Set O characters in base64 */ + int base64WhiteSpace, /* Encode whitespace (sp, ht, nl, cr) in base64 */ + const char *errors /* error handling */ + ); + +/* --- UTF-8 Codecs ------------------------------------------------------- */ + +PyAPI_FUNC(PyObject*) PyUnicode_DecodeUTF8( + const char *string, /* UTF-8 encoded string */ + Py_ssize_t length, /* size of string */ + const char *errors /* error handling */ + ); + +PyAPI_FUNC(PyObject*) PyUnicode_DecodeUTF8Stateful( + const char *string, /* UTF-8 encoded string */ + Py_ssize_t length, /* size of string */ + const char *errors, /* error handling */ + Py_ssize_t *consumed /* bytes consumed */ + ); + +PyAPI_FUNC(PyObject*) PyUnicode_AsUTF8String( + PyObject *unicode /* Unicode object */ + ); + +PyAPI_FUNC(PyObject*) PyUnicode_EncodeUTF8( + const Py_UNICODE *data, /* Unicode char buffer */ + Py_ssize_t length, /* number of Py_UNICODE chars to encode */ + const char *errors /* error handling */ + ); + +/* --- UTF-32 Codecs ------------------------------------------------------ */ + +/* Decodes length bytes from a UTF-32 encoded buffer string and returns + the corresponding Unicode object. + + errors (if non-NULL) defines the error handling. It defaults + to "strict". + + If byteorder is non-NULL, the decoder starts decoding using the + given byte order: + + *byteorder == -1: little endian + *byteorder == 0: native order + *byteorder == 1: big endian + + In native mode, the first four bytes of the stream are checked for a + BOM mark. If found, the BOM mark is analysed, the byte order + adjusted and the BOM skipped. In the other modes, no BOM mark + interpretation is done. After completion, *byteorder is set to the + current byte order at the end of input data. + + If byteorder is NULL, the codec starts in native order mode. + +*/ + +PyAPI_FUNC(PyObject*) PyUnicode_DecodeUTF32( + const char *string, /* UTF-32 encoded string */ + Py_ssize_t length, /* size of string */ + const char *errors, /* error handling */ + int *byteorder /* pointer to byteorder to use + 0=native;-1=LE,1=BE; updated on + exit */ + ); + +PyAPI_FUNC(PyObject*) PyUnicode_DecodeUTF32Stateful( + const char *string, /* UTF-32 encoded string */ + Py_ssize_t length, /* size of string */ + const char *errors, /* error handling */ + int *byteorder, /* pointer to byteorder to use + 0=native;-1=LE,1=BE; updated on + exit */ + Py_ssize_t *consumed /* bytes consumed */ + ); + +/* Returns a Python string using the UTF-32 encoding in native byte + order. The string always starts with a BOM mark. */ + +PyAPI_FUNC(PyObject*) PyUnicode_AsUTF32String( + PyObject *unicode /* Unicode object */ + ); + +/* Returns a Python string object holding the UTF-32 encoded value of + the Unicode data. + + If byteorder is not 0, output is written according to the following + byte order: + + byteorder == -1: little endian + byteorder == 0: native byte order (writes a BOM mark) + byteorder == 1: big endian + + If byteorder is 0, the output string will always start with the + Unicode BOM mark (U+FEFF). In the other two modes, no BOM mark is + prepended. + +*/ + +PyAPI_FUNC(PyObject*) PyUnicode_EncodeUTF32( + const Py_UNICODE *data, /* Unicode char buffer */ + Py_ssize_t length, /* number of Py_UNICODE chars to encode */ + const char *errors, /* error handling */ + int byteorder /* byteorder to use 0=BOM+native;-1=LE,1=BE */ + ); + +/* --- UTF-16 Codecs ------------------------------------------------------ */ + +/* Decodes length bytes from a UTF-16 encoded buffer string and returns + the corresponding Unicode object. + + errors (if non-NULL) defines the error handling. It defaults + to "strict". + + If byteorder is non-NULL, the decoder starts decoding using the + given byte order: + + *byteorder == -1: little endian + *byteorder == 0: native order + *byteorder == 1: big endian + + In native mode, the first two bytes of the stream are checked for a + BOM mark. If found, the BOM mark is analysed, the byte order + adjusted and the BOM skipped. In the other modes, no BOM mark + interpretation is done. After completion, *byteorder is set to the + current byte order at the end of input data. + + If byteorder is NULL, the codec starts in native order mode. + +*/ + +PyAPI_FUNC(PyObject*) PyUnicode_DecodeUTF16( + const char *string, /* UTF-16 encoded string */ + Py_ssize_t length, /* size of string */ + const char *errors, /* error handling */ + int *byteorder /* pointer to byteorder to use + 0=native;-1=LE,1=BE; updated on + exit */ + ); + +PyAPI_FUNC(PyObject*) PyUnicode_DecodeUTF16Stateful( + const char *string, /* UTF-16 encoded string */ + Py_ssize_t length, /* size of string */ + const char *errors, /* error handling */ + int *byteorder, /* pointer to byteorder to use + 0=native;-1=LE,1=BE; updated on + exit */ + Py_ssize_t *consumed /* bytes consumed */ + ); + +/* Returns a Python string using the UTF-16 encoding in native byte + order. The string always starts with a BOM mark. */ + +PyAPI_FUNC(PyObject*) PyUnicode_AsUTF16String( + PyObject *unicode /* Unicode object */ + ); + +/* Returns a Python string object holding the UTF-16 encoded value of + the Unicode data. + + If byteorder is not 0, output is written according to the following + byte order: + + byteorder == -1: little endian + byteorder == 0: native byte order (writes a BOM mark) + byteorder == 1: big endian + + If byteorder is 0, the output string will always start with the + Unicode BOM mark (U+FEFF). In the other two modes, no BOM mark is + prepended. + + Note that Py_UNICODE data is being interpreted as UTF-16 reduced to + UCS-2. This trick makes it possible to add full UTF-16 capabilities + at a later point without compromising the APIs. + +*/ + +PyAPI_FUNC(PyObject*) PyUnicode_EncodeUTF16( + const Py_UNICODE *data, /* Unicode char buffer */ + Py_ssize_t length, /* number of Py_UNICODE chars to encode */ + const char *errors, /* error handling */ + int byteorder /* byteorder to use 0=BOM+native;-1=LE,1=BE */ + ); + +/* --- Unicode-Escape Codecs ---------------------------------------------- */ + +PyAPI_FUNC(PyObject*) PyUnicode_DecodeUnicodeEscape( + const char *string, /* Unicode-Escape encoded string */ + Py_ssize_t length, /* size of string */ + const char *errors /* error handling */ + ); + +PyAPI_FUNC(PyObject*) PyUnicode_AsUnicodeEscapeString( + PyObject *unicode /* Unicode object */ + ); + +PyAPI_FUNC(PyObject*) PyUnicode_EncodeUnicodeEscape( + const Py_UNICODE *data, /* Unicode char buffer */ + Py_ssize_t length /* Number of Py_UNICODE chars to encode */ + ); + +/* --- Raw-Unicode-Escape Codecs ------------------------------------------ */ + +PyAPI_FUNC(PyObject*) PyUnicode_DecodeRawUnicodeEscape( + const char *string, /* Raw-Unicode-Escape encoded string */ + Py_ssize_t length, /* size of string */ + const char *errors /* error handling */ + ); + +PyAPI_FUNC(PyObject*) PyUnicode_AsRawUnicodeEscapeString( + PyObject *unicode /* Unicode object */ + ); + +PyAPI_FUNC(PyObject*) PyUnicode_EncodeRawUnicodeEscape( + const Py_UNICODE *data, /* Unicode char buffer */ + Py_ssize_t length /* Number of Py_UNICODE chars to encode */ + ); + +/* --- Unicode Internal Codec --------------------------------------------- + + Only for internal use in _codecsmodule.c */ + +PyObject *_PyUnicode_DecodeUnicodeInternal( + const char *string, + Py_ssize_t length, + const char *errors + ); + +/* --- Latin-1 Codecs ----------------------------------------------------- + + Note: Latin-1 corresponds to the first 256 Unicode ordinals. + +*/ + +PyAPI_FUNC(PyObject*) PyUnicode_DecodeLatin1( + const char *string, /* Latin-1 encoded string */ + Py_ssize_t length, /* size of string */ + const char *errors /* error handling */ + ); + +PyAPI_FUNC(PyObject*) PyUnicode_AsLatin1String( + PyObject *unicode /* Unicode object */ + ); + +PyAPI_FUNC(PyObject*) PyUnicode_EncodeLatin1( + const Py_UNICODE *data, /* Unicode char buffer */ + Py_ssize_t length, /* Number of Py_UNICODE chars to encode */ + const char *errors /* error handling */ + ); + +/* --- ASCII Codecs ------------------------------------------------------- + + Only 7-bit ASCII data is excepted. All other codes generate errors. + +*/ + +PyAPI_FUNC(PyObject*) PyUnicode_DecodeASCII( + const char *string, /* ASCII encoded string */ + Py_ssize_t length, /* size of string */ + const char *errors /* error handling */ + ); + +PyAPI_FUNC(PyObject*) PyUnicode_AsASCIIString( + PyObject *unicode /* Unicode object */ + ); + +PyAPI_FUNC(PyObject*) PyUnicode_EncodeASCII( + const Py_UNICODE *data, /* Unicode char buffer */ + Py_ssize_t length, /* Number of Py_UNICODE chars to encode */ + const char *errors /* error handling */ + ); + +/* --- Character Map Codecs ----------------------------------------------- + + This codec uses mappings to encode and decode characters. + + Decoding mappings must map single string characters to single + Unicode characters, integers (which are then interpreted as Unicode + ordinals) or None (meaning "undefined mapping" and causing an + error). + + Encoding mappings must map single Unicode characters to single + string characters, integers (which are then interpreted as Latin-1 + ordinals) or None (meaning "undefined mapping" and causing an + error). + + If a character lookup fails with a LookupError, the character is + copied as-is meaning that its ordinal value will be interpreted as + Unicode or Latin-1 ordinal resp. Because of this mappings only need + to contain those mappings which map characters to different code + points. + +*/ + +PyAPI_FUNC(PyObject*) PyUnicode_DecodeCharmap( + const char *string, /* Encoded string */ + Py_ssize_t length, /* size of string */ + PyObject *mapping, /* character mapping + (char ordinal -> unicode ordinal) */ + const char *errors /* error handling */ + ); + +PyAPI_FUNC(PyObject*) PyUnicode_AsCharmapString( + PyObject *unicode, /* Unicode object */ + PyObject *mapping /* character mapping + (unicode ordinal -> char ordinal) */ + ); + +PyAPI_FUNC(PyObject*) PyUnicode_EncodeCharmap( + const Py_UNICODE *data, /* Unicode char buffer */ + Py_ssize_t length, /* Number of Py_UNICODE chars to encode */ + PyObject *mapping, /* character mapping + (unicode ordinal -> char ordinal) */ + const char *errors /* error handling */ + ); + +/* Translate a Py_UNICODE buffer of the given length by applying a + character mapping table to it and return the resulting Unicode + object. + + The mapping table must map Unicode ordinal integers to Unicode + ordinal integers or None (causing deletion of the character). + + Mapping tables may be dictionaries or sequences. Unmapped character + ordinals (ones which cause a LookupError) are left untouched and + are copied as-is. + +*/ + +PyAPI_FUNC(PyObject *) PyUnicode_TranslateCharmap( + const Py_UNICODE *data, /* Unicode char buffer */ + Py_ssize_t length, /* Number of Py_UNICODE chars to encode */ + PyObject *table, /* Translate table */ + const char *errors /* error handling */ + ); + +#ifdef MS_WIN32 + +/* --- MBCS codecs for Windows -------------------------------------------- */ + +PyAPI_FUNC(PyObject*) PyUnicode_DecodeMBCS( + const char *string, /* MBCS encoded string */ + Py_ssize_t length, /* size of string */ + const char *errors /* error handling */ + ); + +PyAPI_FUNC(PyObject*) PyUnicode_DecodeMBCSStateful( + const char *string, /* MBCS encoded string */ + Py_ssize_t length, /* size of string */ + const char *errors, /* error handling */ + Py_ssize_t *consumed /* bytes consumed */ + ); + +PyAPI_FUNC(PyObject*) PyUnicode_AsMBCSString( + PyObject *unicode /* Unicode object */ + ); + +PyAPI_FUNC(PyObject*) PyUnicode_EncodeMBCS( + const Py_UNICODE *data, /* Unicode char buffer */ + Py_ssize_t length, /* Number of Py_UNICODE chars to encode */ + const char *errors /* error handling */ + ); + +#endif /* MS_WIN32 */ + +/* --- Decimal Encoder ---------------------------------------------------- */ + +/* Takes a Unicode string holding a decimal value and writes it into + an output buffer using standard ASCII digit codes. + + The output buffer has to provide at least length+1 bytes of storage + area. The output string is 0-terminated. + + The encoder converts whitespace to ' ', decimal characters to their + corresponding ASCII digit and all other Latin-1 characters except + \0 as-is. Characters outside this range (Unicode ordinals 1-256) + are treated as errors. This includes embedded NULL bytes. + + Error handling is defined by the errors argument: + + NULL or "strict": raise a ValueError + "ignore": ignore the wrong characters (these are not copied to the + output buffer) + "replace": replaces illegal characters with '?' + + Returns 0 on success, -1 on failure. + +*/ + +PyAPI_FUNC(int) PyUnicode_EncodeDecimal( + Py_UNICODE *s, /* Unicode buffer */ + Py_ssize_t length, /* Number of Py_UNICODE chars to encode */ + char *output, /* Output buffer; must have size >= length */ + const char *errors /* error handling */ + ); + +/* --- Methods & Slots ---------------------------------------------------- + + These are capable of handling Unicode objects and strings on input + (we refer to them as strings in the descriptions) and return + Unicode objects or integers as apporpriate. */ + +/* Concat two strings giving a new Unicode string. */ + +PyAPI_FUNC(PyObject*) PyUnicode_Concat( + PyObject *left, /* Left string */ + PyObject *right /* Right string */ + ); + +/* Split a string giving a list of Unicode strings. + + If sep is NULL, splitting will be done at all whitespace + substrings. Otherwise, splits occur at the given separator. + + At most maxsplit splits will be done. If negative, no limit is set. + + Separators are not included in the resulting list. + +*/ + +PyAPI_FUNC(PyObject*) PyUnicode_Split( + PyObject *s, /* String to split */ + PyObject *sep, /* String separator */ + Py_ssize_t maxsplit /* Maxsplit count */ + ); + +/* Dito, but split at line breaks. + + CRLF is considered to be one line break. Line breaks are not + included in the resulting list. */ + +PyAPI_FUNC(PyObject*) PyUnicode_Splitlines( + PyObject *s, /* String to split */ + int keepends /* If true, line end markers are included */ + ); + +/* Partition a string using a given separator. */ + +PyAPI_FUNC(PyObject*) PyUnicode_Partition( + PyObject *s, /* String to partition */ + PyObject *sep /* String separator */ + ); + +/* Partition a string using a given separator, searching from the end of the + string. */ + +PyAPI_FUNC(PyObject*) PyUnicode_RPartition( + PyObject *s, /* String to partition */ + PyObject *sep /* String separator */ + ); + +/* Split a string giving a list of Unicode strings. + + If sep is NULL, splitting will be done at all whitespace + substrings. Otherwise, splits occur at the given separator. + + At most maxsplit splits will be done. But unlike PyUnicode_Split + PyUnicode_RSplit splits from the end of the string. If negative, + no limit is set. + + Separators are not included in the resulting list. + +*/ + +PyAPI_FUNC(PyObject*) PyUnicode_RSplit( + PyObject *s, /* String to split */ + PyObject *sep, /* String separator */ + Py_ssize_t maxsplit /* Maxsplit count */ + ); + +/* Translate a string by applying a character mapping table to it and + return the resulting Unicode object. + + The mapping table must map Unicode ordinal integers to Unicode + ordinal integers or None (causing deletion of the character). + + Mapping tables may be dictionaries or sequences. Unmapped character + ordinals (ones which cause a LookupError) are left untouched and + are copied as-is. + +*/ + +PyAPI_FUNC(PyObject *) PyUnicode_Translate( + PyObject *str, /* String */ + PyObject *table, /* Translate table */ + const char *errors /* error handling */ + ); + +/* Join a sequence of strings using the given separator and return + the resulting Unicode string. */ + +PyAPI_FUNC(PyObject*) PyUnicode_Join( + PyObject *separator, /* Separator string */ + PyObject *seq /* Sequence object */ + ); + +/* Return 1 if substr matches str[start:end] at the given tail end, 0 + otherwise. */ + +PyAPI_FUNC(Py_ssize_t) PyUnicode_Tailmatch( + PyObject *str, /* String */ + PyObject *substr, /* Prefix or Suffix string */ + Py_ssize_t start, /* Start index */ + Py_ssize_t end, /* Stop index */ + int direction /* Tail end: -1 prefix, +1 suffix */ + ); + +/* Return the first position of substr in str[start:end] using the + given search direction or -1 if not found. -2 is returned in case + an error occurred and an exception is set. */ + +PyAPI_FUNC(Py_ssize_t) PyUnicode_Find( + PyObject *str, /* String */ + PyObject *substr, /* Substring to find */ + Py_ssize_t start, /* Start index */ + Py_ssize_t end, /* Stop index */ + int direction /* Find direction: +1 forward, -1 backward */ + ); + +/* Count the number of occurrences of substr in str[start:end]. */ + +PyAPI_FUNC(Py_ssize_t) PyUnicode_Count( + PyObject *str, /* String */ + PyObject *substr, /* Substring to count */ + Py_ssize_t start, /* Start index */ + Py_ssize_t end /* Stop index */ + ); + +/* Replace at most maxcount occurrences of substr in str with replstr + and return the resulting Unicode object. */ + +PyAPI_FUNC(PyObject *) PyUnicode_Replace( + PyObject *str, /* String */ + PyObject *substr, /* Substring to find */ + PyObject *replstr, /* Substring to replace */ + Py_ssize_t maxcount /* Max. number of replacements to apply; + -1 = all */ + ); + +/* Compare two strings and return -1, 0, 1 for less than, equal, + greater than resp. */ + +PyAPI_FUNC(int) PyUnicode_Compare( + PyObject *left, /* Left string */ + PyObject *right /* Right string */ + ); + +/* Rich compare two strings and return one of the following: + + - NULL in case an exception was raised + - Py_True or Py_False for successfuly comparisons + - Py_NotImplemented in case the type combination is unknown + + Note that Py_EQ and Py_NE comparisons can cause a UnicodeWarning in + case the conversion of the arguments to Unicode fails with a + UnicodeDecodeError. + + Possible values for op: + + Py_GT, Py_GE, Py_EQ, Py_NE, Py_LT, Py_LE + +*/ + +PyAPI_FUNC(PyObject *) PyUnicode_RichCompare( + PyObject *left, /* Left string */ + PyObject *right, /* Right string */ + int op /* Operation: Py_EQ, Py_NE, Py_GT, etc. */ + ); + +/* Apply a argument tuple or dictionary to a format string and return + the resulting Unicode string. */ + +PyAPI_FUNC(PyObject *) PyUnicode_Format( + PyObject *format, /* Format string */ + PyObject *args /* Argument tuple or dictionary */ + ); + +/* Checks whether element is contained in container and return 1/0 + accordingly. + + element has to coerce to an one element Unicode string. -1 is + returned in case of an error. */ + +PyAPI_FUNC(int) PyUnicode_Contains( + PyObject *container, /* Container string */ + PyObject *element /* Element string */ + ); + +/* Externally visible for str.strip(unicode) */ +PyAPI_FUNC(PyObject *) _PyUnicode_XStrip( + PyUnicodeObject *self, + int striptype, + PyObject *sepobj + ); + +/* === Characters Type APIs =============================================== */ + +/* Helper array used by Py_UNICODE_ISSPACE(). */ + +PyAPI_DATA(const unsigned char) _Py_ascii_whitespace[]; + +/* These should not be used directly. Use the Py_UNICODE_IS* and + Py_UNICODE_TO* macros instead. + + These APIs are implemented in Objects/unicodectype.c. + +*/ + +PyAPI_FUNC(int) _PyUnicode_IsLowercase( + Py_UNICODE ch /* Unicode character */ + ); + +PyAPI_FUNC(int) _PyUnicode_IsUppercase( + Py_UNICODE ch /* Unicode character */ + ); + +PyAPI_FUNC(int) _PyUnicode_IsTitlecase( + Py_UNICODE ch /* Unicode character */ + ); + +PyAPI_FUNC(int) _PyUnicode_IsWhitespace( + const Py_UNICODE ch /* Unicode character */ + ); + +PyAPI_FUNC(int) _PyUnicode_IsLinebreak( + const Py_UNICODE ch /* Unicode character */ + ); + +PyAPI_FUNC(Py_UNICODE) _PyUnicode_ToLowercase( + Py_UNICODE ch /* Unicode character */ + ); + +PyAPI_FUNC(Py_UNICODE) _PyUnicode_ToUppercase( + Py_UNICODE ch /* Unicode character */ + ); + +PyAPI_FUNC(Py_UNICODE) _PyUnicode_ToTitlecase( + Py_UNICODE ch /* Unicode character */ + ); + +PyAPI_FUNC(int) _PyUnicode_ToDecimalDigit( + Py_UNICODE ch /* Unicode character */ + ); + +PyAPI_FUNC(int) _PyUnicode_ToDigit( + Py_UNICODE ch /* Unicode character */ + ); + +PyAPI_FUNC(double) _PyUnicode_ToNumeric( + Py_UNICODE ch /* Unicode character */ + ); + +PyAPI_FUNC(int) _PyUnicode_IsDecimalDigit( + Py_UNICODE ch /* Unicode character */ + ); + +PyAPI_FUNC(int) _PyUnicode_IsDigit( + Py_UNICODE ch /* Unicode character */ + ); + +PyAPI_FUNC(int) _PyUnicode_IsNumeric( + Py_UNICODE ch /* Unicode character */ + ); + +PyAPI_FUNC(int) _PyUnicode_IsAlpha( + Py_UNICODE ch /* Unicode character */ + ); + +#ifdef __cplusplus +} +#endif +#endif /* Py_USING_UNICODE */ +#endif /* !Py_UNICODEOBJECT_H */ diff --git a/extern/include/Python-2.7/warnings.h b/extern/include/Python-2.7/warnings.h new file mode 100644 index 0000000..0818d7a --- /dev/null +++ b/extern/include/Python-2.7/warnings.h @@ -0,0 +1,23 @@ +#ifndef Py_WARNINGS_H +#define Py_WARNINGS_H +#ifdef __cplusplus +extern "C" { +#endif + +PyAPI_FUNC(void) _PyWarnings_Init(void); + +PyAPI_FUNC(int) PyErr_WarnEx(PyObject *, const char *, Py_ssize_t); +PyAPI_FUNC(int) PyErr_WarnExplicit(PyObject *, const char *, const char *, int, + const char *, PyObject *); + +#define PyErr_WarnPy3k(msg, stacklevel) \ + (Py_Py3kWarningFlag ? PyErr_WarnEx(PyExc_DeprecationWarning, msg, stacklevel) : 0) + +/* DEPRECATED: Use PyErr_WarnEx() instead. */ +#define PyErr_Warn(category, msg) PyErr_WarnEx(category, msg, 1) + +#ifdef __cplusplus +} +#endif +#endif /* !Py_WARNINGS_H */ + diff --git a/extern/include/Python-2.7/weakrefobject.h b/extern/include/Python-2.7/weakrefobject.h new file mode 100644 index 0000000..e7c0eae --- /dev/null +++ b/extern/include/Python-2.7/weakrefobject.h @@ -0,0 +1,82 @@ +/* Weak references objects for Python. */ + +#ifndef Py_WEAKREFOBJECT_H +#define Py_WEAKREFOBJECT_H +#ifdef __cplusplus +extern "C" { +#endif + + +typedef struct _PyWeakReference PyWeakReference; + +/* PyWeakReference is the base struct for the Python ReferenceType, ProxyType, + * and CallableProxyType. + */ +struct _PyWeakReference { + PyObject_HEAD + + /* The object to which this is a weak reference, or Py_None if none. + * Note that this is a stealth reference: wr_object's refcount is + * not incremented to reflect this pointer. + */ + PyObject *wr_object; + + /* A callable to invoke when wr_object dies, or NULL if none. */ + PyObject *wr_callback; + + /* A cache for wr_object's hash code. As usual for hashes, this is -1 + * if the hash code isn't known yet. + */ + long hash; + + /* If wr_object is weakly referenced, wr_object has a doubly-linked NULL- + * terminated list of weak references to it. These are the list pointers. + * If wr_object goes away, wr_object is set to Py_None, and these pointers + * have no meaning then. + */ + PyWeakReference *wr_prev; + PyWeakReference *wr_next; +}; + +PyAPI_DATA(PyTypeObject) _PyWeakref_RefType; +PyAPI_DATA(PyTypeObject) _PyWeakref_ProxyType; +PyAPI_DATA(PyTypeObject) _PyWeakref_CallableProxyType; + +#define PyWeakref_CheckRef(op) PyObject_TypeCheck(op, &_PyWeakref_RefType) +#define PyWeakref_CheckRefExact(op) \ + (Py_TYPE(op) == &_PyWeakref_RefType) +#define PyWeakref_CheckProxy(op) \ + ((Py_TYPE(op) == &_PyWeakref_ProxyType) || \ + (Py_TYPE(op) == &_PyWeakref_CallableProxyType)) + +#define PyWeakref_Check(op) \ + (PyWeakref_CheckRef(op) || PyWeakref_CheckProxy(op)) + + +PyAPI_FUNC(PyObject *) PyWeakref_NewRef(PyObject *ob, + PyObject *callback); +PyAPI_FUNC(PyObject *) PyWeakref_NewProxy(PyObject *ob, + PyObject *callback); +PyAPI_FUNC(PyObject *) PyWeakref_GetObject(PyObject *ref); + +PyAPI_FUNC(Py_ssize_t) _PyWeakref_GetWeakrefCount(PyWeakReference *head); + +PyAPI_FUNC(void) _PyWeakref_ClearRef(PyWeakReference *self); + +/* Explanation for the Py_REFCNT() check: when a weakref's target is part + of a long chain of deallocations which triggers the trashcan mechanism, + clearing the weakrefs can be delayed long after the target's refcount + has dropped to zero. In the meantime, code accessing the weakref will + be able to "see" the target object even though it is supposed to be + unreachable. See issue #16602. */ + +#define PyWeakref_GET_OBJECT(ref) \ + (Py_REFCNT(((PyWeakReference *)(ref))->wr_object) > 0 \ + ? ((PyWeakReference *)(ref))->wr_object \ + : Py_None) + + +#ifdef __cplusplus +} +#endif +#endif /* !Py_WEAKREFOBJECT_H */ diff --git a/extern/include/SpeedTreeRT.h b/extern/include/SpeedTreeRT.h new file mode 100644 index 0000000..301c504 --- /dev/null +++ b/extern/include/SpeedTreeRT.h @@ -0,0 +1,548 @@ +/////////////////////////////////////////////////////////////////////// +// Name: SpeedTreeRT.h +// +// *** INTERACTIVE DATA VISUALIZATION (IDV) PROPRIETARY INFORMATION *** +// +// Copyright (c) 2001-2003 IDV, Inc. +// All Rights Reserved. +// +// IDV, Inc. +// 1233 Washington St. Suite 610 +// Columbia, SC 29201 +// Voice: (803) 799-1699 +// Fax: (803) 931-0320 +// Web: http://www.idvinc.com +// +// This software is supplied under the terms of a license agreement or +// nondisclosure agreement with Interactive Data Visualization and may not +// be copied or disclosed except in accordance with the terms of that +// agreement. +// +// Release version 1.6.0 (December 19, 2003) + +#pragma once + +// define static or dynamic library build +#ifdef SPEEDTREERT_DYNAMIC_LIB + #ifdef IDV_SPEEDTREERT_EXPORTS + #define BUILD_SPEED_TREE_RT_SET __declspec(dllexport) + #else + #define BUILD_SPEED_TREE_RT_SET __declspec(dllimport) + #endif +#else + #define BUILD_SPEED_TREE_RT_SET +#endif + +// big or little endian system +#ifdef __ppc__ + #define ST_BIG_ENDIAN +#else + #define ST_LITTLE_ENDIAN +#endif + +// Macintosh-specific +#ifdef __ppc__ +#pragma export on +#endif + +// forward refernces +class CIndexedGeometry; +class CTreeEngine; +class CLeafGeometry; +class CLightingEngine; +class CWindEngine; +class CTreeFileAccess; +class CSimpleBillboard; +class CFrondEngine; +struct STreeInstanceData; +struct SInstanceList; +struct SEmbeddedTexCoords; +struct SCollisionObjects; +class CProjectedShadow; + + +/////////////////////////////////////////////////////////////////////// +// class SpeedTreeRT +// +// In an effort to make the SpeedTreeRT.h header file dependency free +// and easy to include into almost any project, a number of steps have +// been taken: +// +// 1. No external header files need to be included by SpeedTreeRT.h +// or by the application before including it. +// +// 2. Most of the implementation of the class is hidden by pointers +// to the major sections of the library (the internal classes +// can then just be forward-referenced) +// +// 3. Where possible, basic C++ datatypes are used to define the +// member functions' parameters. +// +// Because almost all of the implementation details are hidden, none of +// the functions for CSpeedTreeRT are inlined. However, inlined functions +// were copiously used within the library. + +class BUILD_SPEED_TREE_RT_SET CSpeedTreeRT +{ +public: + /////////////////////////////////////////////////////////////////////// + // Enumerations + + enum EWindMethod + { + WIND_GPU, WIND_CPU, WIND_NONE + }; + + enum ELodMethod + { + LOD_POP, LOD_SMOOTH, LOD_NONE = 3 + }; + + enum ELightingMethod + { + LIGHT_DYNAMIC, LIGHT_STATIC + }; + + enum EStaticLightingStyle + { + SLS_BASIC, SLS_USE_LIGHT_SOURCES, SLS_SIMULATE_SHADOWS + }; + + enum ECollisionObjectType + { + CO_SPHERE, CO_CYLINDER, CO_BOX + }; + + + /////////////////////////////////////////////////////////////////////// + // SGeometry bit vectors + // + // Passed into GetGeometry() in order to mask out unneeded geometric elements + + #define SpeedTree_BranchGeometry (1 << 0) + #define SpeedTree_FrondGeometry (1 << 1) + #define SpeedTree_LeafGeometry (1 << 2) + #define SpeedTree_BillboardGeometry (1 << 3) + #define SpeedTree_SimpleBillboardOverride (1 << 4) + #define SpeedTree_AllGeometry SpeedTree_BranchGeometry + SpeedTree_FrondGeometry + SpeedTree_LeafGeometry + SpeedTree_BillboardGeometry + + + /////////////////////////////////////////////////////////////////////// + // struct SGeometry declaration + + struct BUILD_SPEED_TREE_RT_SET SGeometry + { + SGeometry( ); + ~SGeometry( ); + + /////////////////////////////////////////////////////////////////////// + // struct SGeometry::SIndexed declaration + + struct BUILD_SPEED_TREE_RT_SET SIndexed + { + SIndexed( ); + ~SIndexed( ); + + // these values change depending on the active discrete LOD level + int m_nDiscreteLodLevel; // range: [0, GetNumBranch/FrondLodLevels( ) - 1], -1 if inactive + unsigned short m_usNumStrips; // total number of strips in current LOD + const unsigned short* m_pStripLengths; // lengths of strips in current LOD (m_usNumStrips in length) + const unsigned short** m_pStrips; // triangle strip indices (m_usNumStrips in length) + + // these values are shared across all discete LOD levels + unsigned short m_usVertexCount; // total vertex count in tables, referenced by all LOD levels + const unsigned long* m_pColors; // RGBA values for each leaf - static lighting only (m_usVertexCount in length) + const float* m_pNormals; // normals for each vertex (3 * m_usVertexCount in length) + const float* m_pBinormals; // binormals (bump mapping) for each vertex (3 * m_usVertexCount in length) + const float* m_pTangents; // tangents (bump mapping) for each vertex (3 * m_usVertexCount in length) + const float* m_pCoords; // coordinates for each vertex (3 * m_usVertexCount in length) + const float* m_pTexCoords0; // 1st layer (s,t) texcoords for each vertex (2 * m_usVertexCount in length) + const float* m_pTexCoords1; // 2nd layer (s,t) texcoords for each vertex (2 * m_usVertexCount in length) + const float* m_pWindWeights; // values from from 0.0 for rigid to 1.0 for flexible (m_usVertexCount in length) + const unsigned char* m_pWindMatrixIndices; // table of wind matrix indices (m_usVertexCount in length) + }; + + + /////////////////////////////////////////////////////////////////////// + // struct SGeometry::SLeaf declaration + + struct BUILD_SPEED_TREE_RT_SET SLeaf + { + SLeaf( ); + ~SLeaf( ); + + // active LOD level data + bool m_bIsActive; // flag indicating visibility + float m_fAlphaTestValue; // 0.0 to 255.0 alpha testing value, used for fading + int m_nDiscreteLodLevel; // range: [0, GetNumLeafLodLevels( ) - 1] + unsigned short m_usLeafCount; // number of leaves stored in this structure + + // tables for referencing the leaf cluster table + const unsigned char* m_pLeafMapIndices; // references which leaf texture map used for each leaf (m_usLeafCount in length) + const unsigned char* m_pLeafClusterIndices; // references which leaf cluster used for each leaf (m_usLeafCount in length) + const float* m_pCenterCoords; // (x,y,z) values for the centers of leaf clusters (3 * m_usLeafCount in length) + const float** m_pLeafMapTexCoords; // table of unique leaf cluster texcoords (m_usLeafCount in length) - each entry + // points to 4 pairs of (s,t) texcoords stored in one contiguous array + const float** m_pLeafMapCoords; // table of unique leaf cluster coordinates (m_usLeafCount in length) - each entry + // points to 4 sets of (x,y,z,0) coordinates stored in one contiguous array + // remaining vertex attributes + const unsigned long* m_pColors; // RGBA values for each leaf (m_usLeafCount in length) + const float* m_pNormals; // normals for each leaf (3 * m_usLeafCount in length) + const float* m_pBinormals; // binormals (bump mapping) for each leaf (3 * m_usLeafCount in length) + const float* m_pTangents; // tangents (bump mapping) for each leaf (3 * m_usLeafCount in length) + const float* m_pWindWeights; // values from from 0.0 for rigid to 1.0 for flexible (m_usLeafCount in length) + const unsigned char* m_pWindMatrixIndices; // table of wind matrix indices (m_usLeafCount in length) + }; + + + /////////////////////////////////////////////////////////////////////// + // struct SGeometry::SBillboard declaration + + struct BUILD_SPEED_TREE_RT_SET SBillboard + { + SBillboard( ); + ~SBillboard( ); + + bool m_bIsActive; // flag indicating visibility + const float* m_pTexCoords; // 4 pairs of (s,t) texcoords stored in one contiguous array + const float* m_pCoords; // 4 sets of (x,y,z) coordindates stored in one contiguous array + float m_fAlphaTestValue; // 0.0 to 255.0 alpha testing value, used for fading + }; + + /////////////////////////////////////////////////////////////////////// + // branch geometry + + SIndexed m_sBranches; // holds the branch vertices and index buffers for all + // of the discrete LOD levels + float m_fBranchAlphaTestValue; // 0.0 to 255.0 alpha testing value, used for fading + + /////////////////////////////////////////////////////////////////////// + // frond geometry + + SIndexed m_sFronds; // holds the frond vertices and index buffers for all + // of the discrete LOD levels + float m_fFrondAlphaTestValue; // 0.0 to 255.0 alpha testing value, used for fading + + /////////////////////////////////////////////////////////////////////// + // leaf geometry + + SLeaf m_sLeaves0; // holds the primary leaf geometry, alpha fades into + SLeaf m_sLeaves1; // m_sLeaves1 during LOD transitions + + /////////////////////////////////////////////////////////////////////// + // billboard geometry + + SBillboard m_sBillboard0; // holds the main simple billboard geometry, alpha fades + SBillboard m_sBillboard1; // into m_sBillboard1 in 360 degree mode + SBillboard m_sHorizontalBillboard; // optional horizontal billboard used for aerial views + }; + + + /////////////////////////////////////////////////////////////////////// + // struct SGeometry::STextures declaration + + struct BUILD_SPEED_TREE_RT_SET STextures + { + STextures( ); + ~STextures( ); + + // branches + const char* m_pBranchTextureFilename; // null-terminated string + + // leaves + unsigned int m_uiLeafTextureCount; // the number of char* elements in m_pLeafTextureFilenames + const char** m_pLeafTextureFilenames; // array of null-terminated strings m_uiLeafTextureCount in size + + // fronds + unsigned int m_uiFrondTextureCount; // the number of char* elements in m_pFrondTextureFilenames + const char** m_pFrondTextureFilenames; // array of null-terminated strings m_uiFrondTextureCount in size + + // composite + const char* m_pCompositeFilename; // null-terminated string + + // self-shadow + const char* m_pSelfShadowFilename; // null-terminated string + }; + + + /////////////////////////////////////////////////////////////////////// + // Constructor/Destructor + + CSpeedTreeRT( ); + ~CSpeedTreeRT( ); + + + /////////////////////////////////////////////////////////////////////// + // Memory allocation + +static void* operator new(size_t nSize); +static void* operator new[](size_t nSize); +static void operator delete(void* pRawMemory); +static void operator delete[](void* pRawMemory); + + + /////////////////////////////////////////////////////////////////////// + // Specifying a tree model + + bool Compute(const float* pTransform = 0, unsigned int nSeed = 1, bool bCompositeStrips = true); + CSpeedTreeRT* Clone(float x = 0.0f, float y = 0.0f, float z = 0.0f, unsigned int nSeed = 0) const; + const CSpeedTreeRT* InstanceOf(void) const; + CSpeedTreeRT* MakeInstance(void); + void DeleteTransientData(void); + + bool LoadTree(const char* pFilename); + bool LoadTree(const unsigned char* pBlock, unsigned int nNumBytes); + unsigned char* SaveTree(unsigned int& nNumBytes, bool bSaveLeaves = false) const; + + void GetTreeSize(float& fSize, float& fVariance) const; + void SetTreeSize(float fNewSize, float fNewVariance = 0.0f); + unsigned int GetSeed( ) const; + + const float* GetTreePosition(void) const; + void SetTreePosition(float x, float y, float z); + + void SetLeafTargetAlphaMask(unsigned char ucMask = 0x54); + + + /////////////////////////////////////////////////////////////////////// + // Lighting + + // lighting style + ELightingMethod GetBranchLightingMethod(void) const; + void SetBranchLightingMethod(ELightingMethod eMethod); + ELightingMethod GetLeafLightingMethod(void) const; + void SetLeafLightingMethod(ELightingMethod eMethod); + ELightingMethod GetFrondLightingMethod(void) const; + void SetFrondLightingMethod(ELightingMethod eMethod); + + EStaticLightingStyle GetStaticLightingStyle(void) const; + void SetStaticLightingStyle(EStaticLightingStyle eStyle); + float GetLeafLightingAdjustment( ) const; + void SetLeafLightingAdjustment(float fScalar); + + // global lighting state +static bool GetLightState(unsigned int nLightIndex); +static void SetLightState(unsigned int nLightIndex, bool bLightOn); +static const float* GetLightAttributes(unsigned int nLightIndex); +static void SetLightAttributes(unsigned int nLightIndex, const float* pLightAttributes); + + // branch material + const float* GetBranchMaterial(void) const; + void SetBranchMaterial(const float* pMaterial); + + // leaf material + const float* GetLeafMaterial(void) const; + void SetLeafMaterial(const float* pMaterial); + + // frond material + const float* GetFrondMaterial(void) const; + void SetFrondMaterial(const float* pMaterial); + + + /////////////////////////////////////////////////////////////////////// + // Camera + +static void GetCamera(float* pPosition, float* pDirection); +static void SetCamera(const float* pPosition, const float* pDirection); + + + /////////////////////////////////////////////////////////////////////// + // Wind + +static void SetTime(float fTime); + void ComputeWindEffects(bool bBranches, bool bLeaves, bool bFronds = true); + void ResetLeafWindState(void); + + bool GetLeafRockingState(void) const; + void SetLeafRockingState(bool bFlag); + void SetNumLeafRockingGroups(unsigned int nRockingGroups); + + EWindMethod GetLeafWindMethod(void) const; + void SetLeafWindMethod(EWindMethod eMethod); + EWindMethod GetBranchWindMethod(void) const; + void SetBranchWindMethod(EWindMethod eMethod); + EWindMethod GetFrondWindMethod(void) const; + void SetFrondWindMethod(EWindMethod eMethod); + + float GetWindStrength(void) const; + float SetWindStrength(float fNewStrength, float fOldStrength = -1.0f, float fFrequencyTimeOffset = -1.0f); + +static void SetNumWindMatrices(unsigned int nNumMatrices); +static void SetWindMatrix(unsigned int nMatrixIndex, const float* pMatrix); + void GetLocalMatrices(unsigned int& nStartingIndex, unsigned int& nMatrixSpan); + void SetLocalMatrices(unsigned int nStartingMatrix, unsigned int nMatrixSpan); + + + /////////////////////////////////////////////////////////////////////// + // LOD + + void ComputeLodLevel(void); + float GetLodLevel(void) const; + void SetLodLevel(float fLodLevel); +static void SetDropToBillboard(bool bFlag); + + void GetLodLimits(float& fNear, float& fFar) const; + void SetLodLimits(float fNear, float fFar); + + short GetDiscreteBranchLodLevel(float fLodLevel = -1.0f) const; + unsigned short GetDiscreteLeafLodLevel(float fLodLevel = -1.0f) const; + short GetDiscreteFrondLodLevel(float fLodLevel = -1.0f) const; + + unsigned short GetNumBranchLodLevels(void) const; + unsigned short GetNumLeafLodLevels(void) const; + unsigned short GetNumFrondLodLevels(void) const; + + + /////////////////////////////////////////////////////////////////////// + // Geometry + + void DeleteBranchGeometry(void); + void DeleteFrondGeometry(void); + unsigned char* GetFrondGeometryMapIndexes(int nLodLevel) const; + const float* GetLeafBillboardTable(unsigned int& nEntryCount) const; + const float* GetLeafLodSizeAdjustments(void); + void GetGeometry(SGeometry& sGeometry, unsigned long ulBitVector = SpeedTree_AllGeometry, short sOverrideBranchLodValue = -1, short sOverrideFrondLodValue = -1, short sOverrideLeafLodValue = -1); + + + /////////////////////////////////////////////////////////////////////// + // Textures + + void GetTextures(STextures& sTextures) const; + void SetLeafTextureCoords(unsigned int nLeafMapIndex, const float* pTexCoords); + void SetFrondTextureCoords(unsigned int nFrondMapIndex, const float* pTexCoords); +static bool GetTextureFlip(void); +static void SetTextureFlip(bool bFlag); + void SetBranchTextureFilename(const char* pFilename); + void SetLeafTextureFilename(unsigned int nLeafMapIndex, const char* pFilename); + void SetFrondTextureFilename(unsigned int nFrondMapIndex, const char* pFilename); + + + /////////////////////////////////////////////////////////////////////// + // Statistics & information + +static void Authorize(const char* pKey); +static bool IsAuthorized(void); +static const char* GetCurrentError(void); +static void ResetError(void); + + void GetBoundingBox(float* pBounds) const; + unsigned int GetLeafTriangleCount(float fLodLevel = -1.0f) const; + unsigned int GetBranchTriangleCount(float fLodLevel = -1.0f) const; + unsigned int GetFrondTriangleCount(float fLodLevel = -1.0f) const; + + + /////////////////////////////////////////////////////////////////////// + // Collision objects + + unsigned int GetCollisionObjectCount(void); + void GetCollisionObject(unsigned int nIndex, ECollisionObjectType& eType, float* pPosition, float* pDimensions); + + + /////////////////////////////////////////////////////////////////////// + // User Data + + const char* GetUserData(void) const; + +private: + CSpeedTreeRT(const CSpeedTreeRT* pOrig); + + void ComputeLeafStaticLighting(void); + void ComputeSelfShadowTexCoords(void); +static void ComputeUnitBillboard(void); +static void NotifyAllTreesOfEvent(int nMessage); +static void SetError(const char* pError); + + + /////////////////////////////////////////////////////////////////////// + // File I/O + + void ParseLodInfo(CTreeFileAccess* pFile); + void ParseWindInfo(CTreeFileAccess* pFile); + void ParseTextureCoordInfo(CTreeFileAccess* pFile); + void ParseCollisionObjects(CTreeFileAccess* pFile); + void SaveTextureCoords(CTreeFileAccess* pFile) const; + void SaveCollisionObjects(CTreeFileAccess* pFile) const; + void ParseShadowProjectionInfo(CTreeFileAccess* pFile); + void SaveUserData(CTreeFileAccess* pFile) const; + void ParseUserData(CTreeFileAccess* pFile); + void SaveSupplementalTexCoordInfo(CTreeFileAccess* pFile) const; + void ParseSupplementalTexCoordInfo(CTreeFileAccess* pFile); +static char* CopyUserData(const char* pData); + + /////////////////////////////////////////////////////////////////////// + // Geometry + + void GetBranchGeometry(SGeometry& sGeometry, short sOverrideLodValue = -1); + void GetFrondGeometry(SGeometry& sGeometry, short sOverrideLodValue = -1); + void GetLeafGeometry(SGeometry& sGeometry, unsigned long ulBitVector, short sOverrideLodValue = -1); + void Get360BillboardGeometry(SGeometry& sGeometry); + void GetSimpleBillboardGeometry(SGeometry& sGeometry); + void GetHorizontalBillboardGeometry(SGeometry& sGeometry); +static void GetTransitionValues(float fLodLevel, unsigned short usLodCount, float fOverlapRadius, + float fTransitionFactor, float fCurveExponent, float fTargetAlphaValue, + float& fHighValue, float& fLowValue, short& sHighLod, short& sLowLod); + void SetupHorizontalBillboard( ); + + /////////////////////////////////////////////////////////////////////// + // Member variables + + // general + CTreeEngine* m_pEngine; // core tree-generating engine + CIndexedGeometry* m_pBranchGeometry; // abstraction mechanism for branch geometry + CLeafGeometry* m_pLeafGeometry; // abstraction mechanism for leaf geometry + CLightingEngine* m_pLightingEngine; // engine for computing static/dynamic lighting data + CWindEngine* m_pWindEngine; // engine for computing CPU/GPU wind effects + CSimpleBillboard* m_pSimpleBillboard; + + // leaf lod + ELodMethod m_eLeafLodMethod; // which leaf wind method is currently being used + float m_fLeafLodTransitionRadius; // determines how much blending occurs between two separate leaf LOD levels + float m_fLeafLodCurveExponent; // exponent value used in the leaf LOD blending equation + float m_fLeafSizeIncreaseFactor; // value that controls how much larger leaf clusters get as LOD decreases + float m_fLeafTransitionFactor; // value that controls the intersection point of SMOOTH_1 transitions + float* m_pLeafLodSizeFactors; // array, GetNumLeafLodLevels()'s in size, containing leaf LOD scale factors + + // instancing + unsigned int* m_pRefCount; // single value shared among instances - number of active instances + STreeInstanceData* m_pInstanceData; // if instance, differntiating data is stored here + SInstanceList* m_pInstanceList; // each tree contains a list of its instances + + // other + int m_nFrondLevel; // from SpeedTreeCAD - branch level where fronds begin + float* m_pTreeSizes; // contains all tree extents, including billboard sizes + unsigned char m_ucTargetAlphaValue; // value used for leaf alpha mask function + bool m_bTreeComputed; // some operations are not valid once the geometry has been computed + int m_nBranchWindLevel; // from SpeedTreeCAD - branch level where wind effects are active + + // texture coords + SEmbeddedTexCoords* m_pEmbeddedTexCoords; // embedded leaf and billboard texture coords +static bool m_bTextureFlip; // used to flip coordinates for DirectX, Gamebryo, etc. + + // shadow projection + CProjectedShadow* m_pProjectedShadow; // self-shadow projection + + // billboard +static bool m_bDropToBillboard; // flag specifying if last LOD will be simple single billboard + + // collision objects + SCollisionObjects* m_pCollisionObjects; // collision objects + + // fronds + CFrondEngine* m_pFrondEngine; // engine for computing fronds based on branch geometry + CIndexedGeometry* m_pFrondGeometry; // abstraction mechanism for frond geometry + unsigned short m_usNumFrondLodLevels; // place to store LOD count after m_pFrondGeometry is deleted + + // user data + char* m_pUserData; // user specified data + + // horizontal billboard + bool m_b360Billboard; // indicates that a 360 degree billboard sequence is present + bool m_bHorizontalBillboard; // indicates that a horizontal billboard is present in the embedded tex coords + float m_afHorizontalCoords[12]; // vertices of the horizontal billboard +}; + + +// Macintosh-specific +#ifdef __ppc__ +#pragma export off +#endif diff --git a/extern/include/cryptopp/3way.cpp b/extern/include/cryptopp/3way.cpp new file mode 100644 index 0000000..4228e5e --- /dev/null +++ b/extern/include/cryptopp/3way.cpp @@ -0,0 +1,143 @@ +// 3way.cpp - modified by Wei Dai from Joan Daemen's 3way.c +// The original code and all modifications are in the public domain. + +#include "pch.h" +#include "3way.h" +#include "misc.h" + +NAMESPACE_BEGIN(CryptoPP) + +#if defined(CRYPTOPP_DEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING) +void ThreeWay_TestInstantiations() +{ + ThreeWay::Encryption x1; + ThreeWay::Decryption x2; +} +#endif + +namespace +{ + const word32 START_E = 0x0b0b; // round constant of first encryption round + const word32 START_D = 0xb1b1; // round constant of first decryption round +} + +static inline word32 reverseBits(word32 a) +{ + a = ((a & 0xAAAAAAAA) >> 1) | ((a & 0x55555555) << 1); + a = ((a & 0xCCCCCCCC) >> 2) | ((a & 0x33333333) << 2); + return ((a & 0xF0F0F0F0) >> 4) | ((a & 0x0F0F0F0F) << 4); +} + +#define mu(a0, a1, a2) \ +{ \ + a1 = reverseBits(a1); \ + word32 t = reverseBits(a0); \ + a0 = reverseBits(a2); \ + a2 = t; \ +} + +#define pi_gamma_pi(a0, a1, a2) \ +{ \ + word32 b0, b2; \ + b2 = rotlConstant<1>(a2); \ + b0 = rotlConstant<22>(a0); \ + a0 = rotlConstant<1>(b0 ^ (a1|(~b2))); \ + a2 = rotlConstant<22>(b2 ^ (b0|(~a1))); \ + a1 ^= (b2|(~b0)); \ +} + +// thanks to Paulo Barreto for this optimized theta() +#define theta(a0, a1, a2) \ +{ \ + word32 b0, b1, c; \ + c = a0 ^ a1 ^ a2; \ + c = rotlConstant<16>(c) ^ rotlConstant<8>(c); \ + b0 = (a0 << 24) ^ (a2 >> 8) ^ (a1 << 8) ^ (a0 >> 24); \ + b1 = (a1 << 24) ^ (a0 >> 8) ^ (a2 << 8) ^ (a1 >> 24); \ + a0 ^= c ^ b0; \ + a1 ^= c ^ b1; \ + a2 ^= c ^ (b0 >> 16) ^ (b1 << 16); \ +} + +#define rho(a0, a1, a2) \ +{ \ + theta(a0, a1, a2); \ + pi_gamma_pi(a0, a1, a2); \ +} + +void ThreeWay::Base::UncheckedSetKey(const byte *uk, unsigned int length, const NameValuePairs ¶ms) +{ + AssertValidKeyLength(length); + + m_rounds = GetRoundsAndThrowIfInvalid(params, this); + + for (unsigned int i=0; i<3; i++) + m_k[i] = (word32)uk[4*i+3] | ((word32)uk[4*i+2]<<8) | ((word32)uk[4*i+1]<<16) | ((word32)uk[4*i]<<24); + + if (!IsForwardTransformation()) + { + theta(m_k[0], m_k[1], m_k[2]); + mu(m_k[0], m_k[1], m_k[2]); + m_k[0] = ByteReverse(m_k[0]); + m_k[1] = ByteReverse(m_k[1]); + m_k[2] = ByteReverse(m_k[2]); + } +} + +void ThreeWay::Enc::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const +{ + typedef BlockGetAndPut Block; + + word32 a0, a1, a2; + Block::Get(inBlock)(a0)(a1)(a2); + + word32 rc = START_E; + + for(unsigned i=0; i Block; + + word32 a0, a1, a2; + Block::Get(inBlock)(a0)(a1)(a2); + + word32 rc = START_D; + + mu(a0, a1, a2); + for(unsigned i=0; i, public FixedKeyLength<12>, public VariableRounds<11> +{ + CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "3-Way";} +}; + +/// \brief ThreeWay block cipher +/// \sa 3-Way +class ThreeWay : public ThreeWay_Info, public BlockCipherDocumentation +{ + /// \brief Class specific implementation and overrides used to operate the cipher. + /// \details Implementations and overrides in \p Base apply to both \p ENCRYPTION and \p DECRYPTION directions + class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl + { + public: + void UncheckedSetKey(const byte *key, unsigned int length, const NameValuePairs ¶ms); + + protected: + unsigned int m_rounds; + FixedSizeSecBlock m_k; + }; + + /// \brief Class specific methods used to operate the cipher in the forward direction. + /// \details Implementations and overrides in \p Enc apply to \p ENCRYPTION. + class CRYPTOPP_NO_VTABLE Enc : public Base + { + public: + void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; + }; + + /// \brief Class specific methods used to operate the cipher in the reverse direction. + /// \details Implementations and overrides in \p Dec apply to \p DECRYPTION. + class CRYPTOPP_NO_VTABLE Dec : public Base + { + public: + void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; + }; + +public: + typedef BlockCipherFinal Encryption; + typedef BlockCipherFinal Decryption; +}; + +typedef ThreeWay::Encryption ThreeWayEncryption; +typedef ThreeWay::Decryption ThreeWayDecryption; + +NAMESPACE_END + +#endif diff --git a/extern/include/cryptopp/Doxyfile b/extern/include/cryptopp/Doxyfile new file mode 100644 index 0000000..6e09c8c --- /dev/null +++ b/extern/include/cryptopp/Doxyfile @@ -0,0 +1,2429 @@ +# Doxyfile 1.8.13 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project. +# +# All text after a double hash (##) is considered a comment and is placed in +# front of the TAG it is preceding. +# +# All text after a single hash (#) is considered a comment and will be ignored. +# The format is: +# TAG = value [value, ...] +# For lists, items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (\" \"). + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the config file +# that follow. The default is UTF-8 which is also the encoding used for all text +# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv +# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv +# for the list of possible encodings. +# The default value is: UTF-8. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by +# double-quotes, unless you are using Doxywizard) that should identify the +# project for which the documentation is generated. This name is used in the +# title of most generated pages and in a few other places. +# The default value is: My Project. + +PROJECT_NAME = Crypto++ + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. This +# could be handy for archiving the generated documentation or if some version +# control system is used. + +PROJECT_NUMBER = 8.4 + +# Using the PROJECT_BRIEF tag one can provide an optional one line description +# for a project that appears at the top of each page and should give viewer a +# quick idea about the purpose of the project. Keep the description short. + +PROJECT_BRIEF = "Free C++ class library of cryptographic schemes" + +# With the PROJECT_LOGO tag one can specify a logo or an icon that is included +# in the documentation. The maximum height of the logo should not exceed 55 +# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy +# the logo to the output directory. + +# The logo looks really bad here. Don't use it. +# PROJECT_LOGO = Logo-Steel.png + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path +# into which the generated documentation will be written. If a relative path is +# entered, it will be relative to the location where doxygen was started. If +# left blank the current directory will be used. + +OUTPUT_DIRECTORY = html-docs + +# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- +# directories (in 2 levels) under the output directory of each output format and +# will distribute the generated files over these directories. Enabling this +# option can be useful when feeding doxygen a huge amount of source files, where +# putting all generated files in the same directory would otherwise causes +# performance problems for the file system. +# The default value is: NO. + +CREATE_SUBDIRS = NO + +# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII +# characters to appear in the names of generated files. If set to NO, non-ASCII +# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode +# U+3044. +# The default value is: NO. + +ALLOW_UNICODE_NAMES = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese, +# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States), +# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian, +# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages), +# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian, +# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian, +# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish, +# Ukrainian and Vietnamese. +# The default value is: English. + +OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member +# descriptions after the members that are listed in the file and class +# documentation (similar to Javadoc). Set to NO to disable this. +# The default value is: YES. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief +# description of a member or function before the detailed description +# +# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. +# The default value is: YES. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator that is +# used to form the text in various listings. Each string in this list, if found +# as the leading text of the brief description, will be stripped from the text +# and the result, after processing the whole list, is used as the annotated +# text. Otherwise, the brief description is used as-is. If left blank, the +# following values are used ($name is automatically replaced with the name of +# the entity):The $name class, The $name widget, The $name file, is, provides, +# specifies, contains, represents, a, an and the. + +ABBREVIATE_BRIEF = + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# doxygen will generate a detailed section even if there is only a brief +# description. +# The default value is: NO. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. +# The default value is: NO. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path +# before files name in the file list and in the header files. If set to NO the +# shortest path that makes the file name unique will be used +# The default value is: YES. + +FULL_PATH_NAMES = NO + +# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. +# Stripping is only done if one of the specified strings matches the left-hand +# part of the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the path to +# strip. +# +# Note that you can specify absolute paths here, but also relative paths, which +# will be relative from the directory where doxygen is started. +# This tag requires that the tag FULL_PATH_NAMES is set to YES. + +STRIP_FROM_PATH = + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the +# path mentioned in the documentation of a class, which tells the reader which +# header file to include in order to use a class. If left blank only the name of +# the header file containing the class definition is used. Otherwise one should +# specify the list of include paths that are normally passed to the compiler +# using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but +# less readable) file names. This can be useful is your file systems doesn't +# support long names like on DOS, Mac, or CD-ROM. +# The default value is: NO. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the +# first line (until the first dot) of a Javadoc-style comment as the brief +# description. If set to NO, the Javadoc-style will behave just like regular Qt- +# style comments (thus requiring an explicit @brief command for a brief +# description.) +# The default value is: NO. + +JAVADOC_AUTOBRIEF = YES + +# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first +# line (until the first dot) of a Qt-style comment as the brief description. If +# set to NO, the Qt-style will behave just like regular Qt-style comments (thus +# requiring an explicit \brief command for a brief description.) +# The default value is: NO. + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a +# multi-line C++ special comment block (i.e. a block of //! or /// comments) as +# a brief description. This used to be the default behavior. The new default is +# to treat a multi-line C++ comment block as a detailed description. Set this +# tag to YES if you prefer the old behavior instead. +# +# Note that setting this tag to YES also means that rational rose comments are +# not recognized any more. +# The default value is: NO. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the +# documentation from any documented member that it re-implements. +# The default value is: YES. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new +# page for each member. If set to NO, the documentation of a member will be part +# of the file/class/namespace that contains it. +# The default value is: NO. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen +# uses this value to replace tabs by spaces in code fragments. +# Minimum value: 1, maximum value: 16, default value: 4. + +TAB_SIZE = 4 + +# This tag can be used to specify a number of aliases that act as commands in +# the documentation. An alias has the form: +# name=value +# For example adding +# "sideeffect=@par Side Effects:\n" +# will allow you to put the command \sideeffect (or @sideeffect) in the +# documentation, which will result in a user-defined paragraph with heading +# "Side Effects:". You can put \n's in the value part of an alias to insert +# newlines. + +ALIASES = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources +# only. Doxygen will then generate output that is more tailored for C. For +# instance, some of the names that are used will be different. The list of all +# members will be omitted, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_FOR_C = NO + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or +# Python sources only. Doxygen will then generate output that is more tailored +# for that language. For instance, namespaces will be presented as packages, +# qualified scopes will look different, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources. Doxygen will then generate output that is tailored for Fortran. +# The default value is: NO. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for VHDL. +# The default value is: NO. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Doxygen selects the parser to use depending on the extension of the files it +# parses. With this tag you can assign which parser to use for a given +# extension. Doxygen has a built-in mapping, but you can override or extend it +# using this tag. The format is ext=language, where ext is a file extension, and +# language is one of the parsers supported by doxygen: IDL, Java, Javascript, +# C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran: +# FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran: +# Fortran. In the later case the parser tries to guess whether the code is fixed +# or free formatted code, this is the default for Fortran type files), VHDL. For +# instance to make doxygen treat .inc files as Fortran files (default is PHP), +# and .f files as C (default is Fortran), use: inc=Fortran f=C. +# +# Note: For files without extension you can use no_extension as a placeholder. +# +# Note that for custom extensions you also need to set FILE_PATTERNS otherwise +# the files are not read by doxygen. + +EXTENSION_MAPPING = + +# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments +# according to the Markdown format, which allows for more readable +# documentation. See http://daringfireball.net/projects/markdown/ for details. +# The output of markdown processing is further processed by doxygen, so you can +# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in +# case of backward compatibilities issues. +# The default value is: YES. + +MARKDOWN_SUPPORT = NO + +# When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up +# to that level are automatically included in the table of contents, even if +# they do not have an id attribute. +# Note: This feature currently applies only to Markdown headings. +# Minimum value: 0, maximum value: 99, default value: 0. +# This tag requires that the tag MARKDOWN_SUPPORT is set to YES. + +TOC_INCLUDE_HEADINGS = 0 + +# When enabled doxygen tries to link words that correspond to documented +# classes, or namespaces to their corresponding documentation. Such a link can +# be prevented in individual cases by putting a % sign in front of the word or +# globally by setting AUTOLINK_SUPPORT to NO. +# The default value is: YES. + +AUTOLINK_SUPPORT = YES + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should set this +# tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); +# versus func(std::string) {}). This also make the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. +# The default value is: NO. + +BUILTIN_STL_SUPPORT = YES + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. +# The default value is: NO. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip (see: +# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen +# will parse them like normal C++ but will assume all classes use public instead +# of private inheritance when no explicit protection keyword is present. +# The default value is: NO. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate +# getter and setter methods for a property. Setting this option to YES will make +# doxygen to replace the get and set methods by a property in the documentation. +# This will only work if the methods are indeed getting or setting a simple +# type. If this is not the case, or you want to show the methods anyway, you +# should set this option to NO. +# The default value is: YES. + +IDL_PROPERTY_SUPPORT = NO + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. +# The default value is: NO. + +DISTRIBUTE_GROUP_DOC = NO + +# If one adds a struct or class to a group and this option is enabled, then also +# any nested class or struct is added to the same group. By default this option +# is disabled and one has to add nested compounds explicitly via \ingroup. +# The default value is: NO. + +GROUP_NESTED_COMPOUNDS = NO + +# Set the SUBGROUPING tag to YES to allow class member groups of the same type +# (for instance a group of public functions) to be put as a subgroup of that +# type (e.g. under the Public Functions section). Set it to NO to prevent +# subgrouping. Alternatively, this can be done per class using the +# \nosubgrouping command. +# The default value is: YES. + +SUBGROUPING = YES + +# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions +# are shown inside the group in which they are included (e.g. using \ingroup) +# instead of on a separate page (for HTML and Man pages) or section (for LaTeX +# and RTF). +# +# Note that this feature does not work in combination with +# SEPARATE_MEMBER_PAGES. +# The default value is: NO. + +INLINE_GROUPED_CLASSES = NO + +# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions +# with only public data fields or simple typedef fields will be shown inline in +# the documentation of the scope in which they are defined (i.e. file, +# namespace, or group documentation), provided this scope is documented. If set +# to NO, structs, classes, and unions are shown on a separate page (for HTML and +# Man pages) or section (for LaTeX and RTF). +# The default value is: NO. + +INLINE_SIMPLE_STRUCTS = NO + +# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or +# enum is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically be +# useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. +# The default value is: NO. + +TYPEDEF_HIDES_STRUCT = NO + +# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This +# cache is used to resolve symbols given their name and scope. Since this can be +# an expensive process and often the same symbol appears multiple times in the +# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small +# doxygen will become slower. If the cache is too large, memory is wasted. The +# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range +# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536 +# symbols. At the end of a run doxygen will report the cache usage and suggest +# the optimal cache size from a speed point of view. +# Minimum value: 0, maximum value: 9, default value: 0. + +LOOKUP_CACHE_SIZE = 0 + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in +# documentation are documented, even if no documentation was available. Private +# class members and static file members will be hidden unless the +# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. +# Note: This will also disable the warnings about undocumented members that are +# normally produced when WARNINGS is set to YES. +# The default value is: NO. + +EXTRACT_ALL = NO + +# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will +# be included in the documentation. +# The default value is: NO. + +EXTRACT_PRIVATE = NO + +# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal +# scope will be included in the documentation. +# The default value is: NO. + +EXTRACT_PACKAGE = NO + +# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be +# included in the documentation. +# The default value is: NO. + +EXTRACT_STATIC = NO + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined +# locally in source files will be included in the documentation. If set to NO, +# only classes defined in header files are included. Does not have any effect +# for Java sources. +# The default value is: YES. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. If set to YES, local methods, +# which are defined in the implementation section but not in the interface are +# included in the documentation. If set to NO, only methods in the interface are +# included. +# The default value is: NO. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base name of +# the file that contains the anonymous namespace. By default anonymous namespace +# are hidden. +# The default value is: NO. + +EXTRACT_ANON_NSPACES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all +# undocumented members inside documented classes or files. If set to NO these +# members will be included in the various overviews, but no documentation +# section is generated. This option has no effect if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. If set +# to NO, these classes will be included in the various overviews. This option +# has no effect if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend +# (class|struct|union) declarations. If set to NO, these declarations will be +# included in the documentation. +# The default value is: NO. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any +# documentation blocks found inside the body of a function. If set to NO, these +# blocks will be appended to the function's detailed documentation block. +# The default value is: NO. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation that is typed after a +# \internal command is included. If the tag is set to NO then the documentation +# will be excluded. Set it to YES to include the internal documentation. +# The default value is: NO. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file +# names in lower-case letters. If set to YES, upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. +# The default value is: system dependent. + +CASE_SENSE_NAMES = NO + +# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with +# their full class and namespace scopes in the documentation. If set to YES, the +# scope will be hidden. +# The default value is: NO. + +HIDE_SCOPE_NAMES = NO + +# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will +# append additional text to a page's title, such as Class Reference. If set to +# YES the compound reference will be hidden. +# The default value is: NO. + +HIDE_COMPOUND_REFERENCE= NO + +# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of +# the files that are included by a file in the documentation of that file. +# The default value is: YES. + +SHOW_INCLUDE_FILES = NO + +# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each +# grouped member an include statement to the documentation, telling the reader +# which file to include in order to use the member. +# The default value is: NO. + +SHOW_GROUPED_MEMB_INC = NO + +# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include +# files with double quotes in the documentation rather than with sharp brackets. +# The default value is: NO. + +FORCE_LOCAL_INCLUDES = NO + +# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the +# documentation for inline members. +# The default value is: YES. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the +# (detailed) documentation of file and class members alphabetically by member +# name. If set to NO, the members will appear in declaration order. +# The default value is: YES. + +SORT_MEMBER_DOCS = NO + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief +# descriptions of file, namespace and class members alphabetically by member +# name. If set to NO, the members will appear in declaration order. Note that +# this will also influence the order of the classes in the class list. +# The default value is: NO. + +SORT_BRIEF_DOCS = NO + +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the +# (brief and detailed) documentation of class members so that constructors and +# destructors are listed first. If set to NO the constructors will appear in the +# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS. +# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief +# member documentation. +# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting +# detailed member documentation. +# The default value is: NO. + +SORT_MEMBERS_CTORS_1ST = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy +# of group names into alphabetical order. If set to NO the group names will +# appear in their defined order. +# The default value is: NO. + +SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by +# fully-qualified names, including namespaces. If set to NO, the class list will +# be sorted only by class name, not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the alphabetical +# list. +# The default value is: NO. + +SORT_BY_SCOPE_NAME = NO + +# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper +# type resolution of all parameters of a function it will reject a match between +# the prototype and the implementation of a member function even if there is +# only one candidate or it is obvious which candidate to choose by doing a +# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still +# accept a match between prototype and implementation in such cases. +# The default value is: NO. + +STRICT_PROTO_MATCHING = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo +# list. This list is created by putting \todo commands in the documentation. +# The default value is: YES. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test +# list. This list is created by putting \test commands in the documentation. +# The default value is: YES. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug +# list. This list is created by putting \bug commands in the documentation. +# The default value is: YES. + +GENERATE_BUGLIST = NO + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO) +# the deprecated list. This list is created by putting \deprecated commands in +# the documentation. +# The default value is: YES. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional documentation +# sections, marked by \if ... \endif and \cond +# ... \endcond blocks. + +ENABLED_SECTIONS = NO + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the +# initial value of a variable or macro / define can have for it to appear in the +# documentation. If the initializer consists of more lines than specified here +# it will be hidden. Use a value of 0 to hide initializers completely. The +# appearance of the value of individual variables and macros / defines can be +# controlled using \showinitializer or \hideinitializer command in the +# documentation regardless of this setting. +# Minimum value: 0, maximum value: 10000, default value: 30. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at +# the bottom of the documentation of classes and structs. If set to YES, the +# list will mention the files that were used to generate the documentation. +# The default value is: YES. + +SHOW_USED_FILES = YES + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This +# will remove the Files entry from the Quick Index and from the Folder Tree View +# (if specified). +# The default value is: YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces +# page. This will remove the Namespaces entry from the Quick Index and from the +# Folder Tree View (if specified). +# The default value is: YES. + +SHOW_NAMESPACES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command command input-file, where command is the value of the +# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided +# by doxygen. Whatever the program writes to standard output is used as the file +# version. For an example see the documentation. + +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed +# by doxygen. The layout file controls the global structure of the generated +# output files in an output format independent way. To create the layout file +# that represents doxygen's defaults, run doxygen with the -l option. You can +# optionally specify a file name after the option, if omitted DoxygenLayout.xml +# will be used as the name of the layout file. +# +# Note that if you run doxygen from a directory containing a file called +# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE +# tag is left empty. + +LAYOUT_FILE = + +# The CITE_BIB_FILES tag can be used to specify one or more bib files containing +# the reference definitions. This must be a list of .bib files. The .bib +# extension is automatically appended if omitted. This requires the bibtex tool +# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info. +# For LaTeX the style of the bibliography can be controlled using +# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the +# search path. See also \cite for info how to create references. + +CITE_BIB_FILES = + +#--------------------------------------------------------------------------- +# Configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated to +# standard output by doxygen. If QUIET is set to YES this implies that the +# messages are off. +# The default value is: NO. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES +# this implies that the warnings are on. +# +# Tip: Turn warnings on while writing the documentation. +# The default value is: YES. + +WARNINGS = NO + +# If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate +# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag +# will automatically be disabled. +# The default value is: YES. + +WARN_IF_UNDOCUMENTED = NO + +# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some parameters +# in a documented function, or documenting parameters that don't exist or using +# markup commands wrongly. +# The default value is: YES. + +WARN_IF_DOC_ERROR = YES + +# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that +# are documented, but have no documentation for their parameters or return +# value. If set to NO, doxygen will only warn about wrong or incomplete +# parameter documentation, but not about the absence of documentation. +# The default value is: NO. + +WARN_NO_PARAMDOC = NO + +# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when +# a warning is encountered. +# The default value is: NO. + +WARN_AS_ERROR = NO + +# The WARN_FORMAT tag determines the format of the warning messages that doxygen +# can produce. The string should contain the $file, $line, and $text tags, which +# will be replaced by the file and line number from which the warning originated +# and the warning text. Optionally the format may contain $version, which will +# be replaced by the version of the file (if it could be obtained via +# FILE_VERSION_FILTER) +# The default value is: $file:$line: $text. + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning and error +# messages should be written. If left blank the output is written to standard +# error (stderr). + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# Configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag is used to specify the files and/or directories that contain +# documented source files. You may enter file names like myfile.cpp or +# directories like /usr/src/myproject. Separate the files or directories with +# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING +# Note: If this tag is empty the current directory is searched. + +INPUT = . \ + GNUmakefile \ + GNUmakefile-cross \ + rdrand.asm + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses +# libiconv (or the iconv built into libc) for the transcoding. See the libiconv +# documentation (see: http://www.gnu.org/software/libiconv) for the list of +# possible encodings. +# The default value is: UTF-8. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and +# *.h) to filter out the source-files in the directories. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# read by doxygen. +# +# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp, +# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, +# *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, +# *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, +# *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf and *.qsf. + +FILE_PATTERNS = *.h \ + *.cpp + +# The RECURSIVE tag can be used to specify whether or not subdirectories should +# be searched for input files as well. +# The default value is: NO. + +RECURSIVE = NO + +# The EXCLUDE tag can be used to specify files and/or directories that should be +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. +# +# Note that relative paths are relative to the directory from which doxygen is +# run. + +EXCLUDE = adhoc.cpp + +# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or +# directories that are symbolic links (a Unix file system feature) are excluded +# from the input. +# The default value is: NO. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories for example use the pattern */test/* + +EXCLUDE_PATTERNS = *test* \ + *validat* + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# AClass::ANamespace, ANamespace::*Test +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories use the pattern */test/* + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or directories +# that contain example code fragments that are included (see the \include +# command). + +EXAMPLE_PATH = . + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and +# *.h) to filter out the source-files in the directories. If left blank all +# files are included. + +EXAMPLE_PATTERNS = + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude commands +# irrespective of the value of the RECURSIVE tag. +# The default value is: NO. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or directories +# that contain images that are to be included in the documentation (see the +# \image command). + +IMAGE_PATH = + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command: +# +# +# +# where is the value of the INPUT_FILTER tag, and is the +# name of an input file. Doxygen will then use the output that the filter +# program writes to standard output. If FILTER_PATTERNS is specified, this tag +# will be ignored. +# +# Note that the filter must not add or remove lines; it is applied before the +# code is scanned, but not when the output code is generated. If lines are added +# or removed, the anchors will not be placed correctly. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. The filters are a list of the form: pattern=filter +# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how +# filters are used. If the FILTER_PATTERNS tag is empty or if none of the +# patterns match the file name, INPUT_FILTER is applied. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will also be used to filter the input files that are used for +# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). +# The default value is: NO. + +FILTER_SOURCE_FILES = NO + +# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file +# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and +# it is also possible to disable source filtering for a specific pattern using +# *.ext= (so without naming a filter). +# This tag requires that the tag FILTER_SOURCE_FILES is set to YES. + +FILTER_SOURCE_PATTERNS = + +# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that +# is part of the input, its contents will be placed on the main page +# (index.html). This can be useful if you have a project on for instance GitHub +# and want to reuse the introduction page also for the doxygen output. + +USE_MDFILE_AS_MAINPAGE = + +#--------------------------------------------------------------------------- +# Configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will be +# generated. Documented entities will be cross-referenced with these sources. +# +# Note: To get rid of all source code in the generated output, make sure that +# also VERBATIM_HEADERS is set to NO. +# The default value is: NO. + +SOURCE_BROWSER = YES + +# Setting the INLINE_SOURCES tag to YES will include the body of functions, +# classes and enums directly into the documentation. +# The default value is: NO. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any +# special comment blocks from generated source code fragments. Normal C, C++ and +# Fortran comments will always remain visible. +# The default value is: YES. + +STRIP_CODE_COMMENTS = NO + +# If the REFERENCED_BY_RELATION tag is set to YES then for each documented +# function all documented functions referencing it will be listed. +# The default value is: NO. + +REFERENCED_BY_RELATION = NO + +# If the REFERENCES_RELATION tag is set to YES then for each documented function +# all documented entities called/used by that function will be listed. +# The default value is: NO. + +REFERENCES_RELATION = NO + +# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set +# to YES then the hyperlinks from functions in REFERENCES_RELATION and +# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will +# link to the documentation. +# The default value is: YES. + +REFERENCES_LINK_SOURCE = YES + +# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the +# source code will show a tooltip with additional information such as prototype, +# brief description and links to the definition and documentation. Since this +# will make the HTML file larger and loading of large files a bit slower, you +# can opt to disable this feature. +# The default value is: YES. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +SOURCE_TOOLTIPS = YES + +# If the USE_HTAGS tag is set to YES then the references to source code will +# point to the HTML generated by the htags(1) tool instead of doxygen built-in +# source browser. The htags tool is part of GNU's global source tagging system +# (see http://www.gnu.org/software/global/global.html). You will need version +# 4.8.6 or higher. +# +# To use it do the following: +# - Install the latest version of global +# - Enable SOURCE_BROWSER and USE_HTAGS in the config file +# - Make sure the INPUT points to the root of the source tree +# - Run doxygen as normal +# +# Doxygen will invoke htags (and that will in turn invoke gtags), so these +# tools must be available from the command line (i.e. in the search path). +# +# The result: instead of the source browser generated by doxygen, the links to +# source code will now point to the output of htags. +# The default value is: NO. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a +# verbatim copy of the header file for each class for which an include is +# specified. Set to NO to disable this. +# See also: Section \class. +# The default value is: YES. + +VERBATIM_HEADERS = YES + +# If the CLANG_ASSISTED_PARSING tag is set to YES then doxygen will use the +# clang parser (see: http://clang.llvm.org/) for more accurate parsing at the +# cost of reduced performance. This can be particularly helpful with template +# rich C++ code for which doxygen's built-in parser lacks the necessary type +# information. +# Note: The availability of this option depends on whether or not doxygen was +# generated with the -Duse-libclang=ON option for CMake. +# The default value is: NO. + +CLANG_ASSISTED_PARSING = NO + +# If clang assisted parsing is enabled you can provide the compiler with command +# line options that you would normally use when invoking the compiler. Note that +# the include paths will already be set by doxygen for the files and directories +# specified with INPUT and INCLUDE_PATH. +# This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES. + +CLANG_OPTIONS = + +#--------------------------------------------------------------------------- +# Configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all +# compounds will be generated. Enable this if the project contains a lot of +# classes, structs, unions or interfaces. +# The default value is: YES. + +ALPHABETICAL_INDEX = YES + +# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in +# which the alphabetical index list will be split. +# Minimum value: 1, maximum value: 20, default value: 5. +# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. + +COLS_IN_ALPHA_INDEX = 3 + +# In case all classes in a project start with a common prefix, all classes will +# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag +# can be used to specify a prefix (or a list of prefixes) that should be ignored +# while generating the index headers. +# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output +# The default value is: YES. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a +# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of +# it. +# The default directory is: html. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_OUTPUT = . + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each +# generated HTML page (for example: .htm, .php, .asp). +# The default value is: .html. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a user-defined HTML header file for +# each generated HTML page. If the tag is left blank doxygen will generate a +# standard header. +# +# To get valid HTML the header file that includes any scripts and style sheets +# that doxygen needs, which is dependent on the configuration options used (e.g. +# the setting GENERATE_TREEVIEW). It is highly recommended to start with a +# default header using +# doxygen -w html new_header.html new_footer.html new_stylesheet.css +# YourConfigFile +# and then modify the file new_header.html. See also section "Doxygen usage" +# for information on how to generate the default header that doxygen normally +# uses. +# Note: The header is subject to change so you typically have to regenerate the +# default header when upgrading to a newer version of doxygen. For a description +# of the possible markers and block names see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each +# generated HTML page. If the tag is left blank doxygen will generate a standard +# footer. See HTML_HEADER for more information on how to generate a default +# footer and what special commands can be used inside the footer. See also +# section "Doxygen usage" for information on how to generate the default footer +# that doxygen normally uses. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FOOTER = + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style +# sheet that is used by each HTML page. It can be used to fine-tune the look of +# the HTML output. If left blank doxygen will generate a default style sheet. +# See also section "Doxygen usage" for information on how to generate the style +# sheet that doxygen normally uses. +# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as +# it is more robust and this tag (HTML_STYLESHEET) will in the future become +# obsolete. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_STYLESHEET = + +# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined +# cascading style sheets that are included after the standard style sheets +# created by doxygen. Using this option one can overrule certain style aspects. +# This is preferred over using HTML_STYLESHEET since it does not replace the +# standard style sheet and is therefore more robust against future updates. +# Doxygen will copy the style sheet files to the output directory. +# Note: The order of the extra style sheet files is of importance (e.g. the last +# style sheet in the list overrules the setting of the previous ones in the +# list). For an example see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_STYLESHEET = + +# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or +# other source files which should be copied to the HTML output directory. Note +# that these files will be copied to the base HTML output directory. Use the +# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these +# files. In the HTML_STYLESHEET file, use the file name only. Also note that the +# files will be copied as-is; there are no commands or markers available. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_FILES = + +# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen +# will adjust the colors in the style sheet and background images according to +# this color. Hue is specified as an angle on a colorwheel, see +# http://en.wikipedia.org/wiki/Hue for more information. For instance the value +# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 +# purple, and 360 is red again. +# Minimum value: 0, maximum value: 359, default value: 220. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_HUE = 220 + +# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors +# in the HTML output. For a value of 0 the output will use grayscales only. A +# value of 255 will produce the most vivid colors. +# Minimum value: 0, maximum value: 255, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_SAT = 100 + +# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the +# luminance component of the colors in the HTML output. Values below 100 +# gradually make the output lighter, whereas values above 100 make the output +# darker. The value divided by 100 is the actual gamma applied, so 80 represents +# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not +# change the gamma. +# Minimum value: 40, maximum value: 240, default value: 80. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_GAMMA = 80 + +# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML +# page will contain the date and time when the page was generated. Setting this +# to YES can help to show when doxygen was last run and thus if the +# documentation is up to date. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_TIMESTAMP = YES + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_DYNAMIC_SECTIONS = YES + +# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries +# shown in the various tree structured indices initially; the user can expand +# and collapse entries dynamically later on. Doxygen will expand the tree to +# such a level that at most the specified number of entries are visible (unless +# a fully collapsed tree already exceeds this amount). So setting the number of +# entries 1 will produce a full collapsed tree by default. 0 is a special value +# representing an infinite number of entries and will result in a full expanded +# tree by default. +# Minimum value: 0, maximum value: 9999, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_INDEX_NUM_ENTRIES = 100 + +# If the GENERATE_DOCSET tag is set to YES, additional index files will be +# generated that can be used as input for Apple's Xcode 3 integrated development +# environment (see: http://developer.apple.com/tools/xcode/), introduced with +# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a +# Makefile in the HTML output directory. Running make will produce the docset in +# that directory and running make install will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at +# startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html +# for more information. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_DOCSET = NO + +# This tag determines the name of the docset feed. A documentation feed provides +# an umbrella under which multiple documentation sets from a single provider +# (such as a company or product suite) can be grouped. +# The default value is: Doxygen generated docs. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# This tag specifies a string that should uniquely identify the documentation +# set bundle. This should be a reverse domain-name style string, e.g. +# com.mycompany.MyDocSet. Doxygen will append .docset to the name. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_BUNDLE_ID = com.cryptopp.Project + +# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify +# the documentation publisher. This should be a reverse domain-name style +# string, e.g. com.mycompany.MyDocSet.documentation. +# The default value is: org.doxygen.Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_ID = com.cryptopp.Publisher + +# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. +# The default value is: Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_NAME = Crypto++ + +# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three +# additional HTML index files: index.hhp, index.hhc, and index.hhk. The +# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop +# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on +# Windows. +# +# The HTML Help Workshop contains a compiler that can convert all HTML output +# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML +# files are now used as the Windows 98 help format, and will replace the old +# Windows help format (.hlp) on all Windows platforms in the future. Compressed +# HTML files also contain an index, a table of contents, and you can search for +# words in the documentation. The HTML workshop also contains a viewer for +# compressed HTML files. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_HTMLHELP = NO + +# The CHM_FILE tag can be used to specify the file name of the resulting .chm +# file. You can add a path in front of the file if the result should not be +# written to the html output directory. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_FILE = + +# The HHC_LOCATION tag can be used to specify the location (absolute path +# including file name) of the HTML help compiler (hhc.exe). If non-empty, +# doxygen will try to run the HTML help compiler on the generated index.hhp. +# The file has to be specified with full path. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +HHC_LOCATION = + +# The GENERATE_CHI flag controls if a separate .chi index file is generated +# (YES) or that it should be included in the master .chm file (NO). +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +GENERATE_CHI = NO + +# The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc) +# and project file content. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_INDEX_ENCODING = + +# The BINARY_TOC flag controls whether a binary table of contents is generated +# (YES) or a normal table of contents (NO) in the .chm file. Furthermore it +# enables the Previous and Next buttons. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members to +# the table of contents of the HTML help documentation and to the tree view. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +TOC_EXPAND = YES + +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and +# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that +# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help +# (.qch) of the generated HTML documentation. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify +# the file name of the resulting .qch file. The path specified is relative to +# the HTML output folder. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help +# Project output. For more information please see Qt Help Project / Namespace +# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace). +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_NAMESPACE = org.doxygen.Project + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt +# Help Project output. For more information please see Qt Help Project / Virtual +# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual- +# folders). +# The default value is: doc. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_VIRTUAL_FOLDER = doc + +# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom +# filter to add. For more information please see Qt Help Project / Custom +# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- +# filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_NAME = + +# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the +# custom filter to add. For more information please see Qt Help Project / Custom +# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- +# filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_ATTRS = + +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this +# project's filter section matches. Qt Help Project / Filter Attributes (see: +# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_SECT_FILTER_ATTRS = + +# The QHG_LOCATION tag can be used to specify the location of Qt's +# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the +# generated .qhp file. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHG_LOCATION = + +# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be +# generated, together with the HTML files, they form an Eclipse help plugin. To +# install this plugin and make it available under the help contents menu in +# Eclipse, the contents of the directory containing the HTML and XML files needs +# to be copied into the plugins directory of eclipse. The name of the directory +# within the plugins directory should be the same as the ECLIPSE_DOC_ID value. +# After copying Eclipse needs to be restarted before the help appears. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_ECLIPSEHELP = NO + +# A unique identifier for the Eclipse help plugin. When installing the plugin +# the directory name containing the HTML and XML files should also have this +# name. Each documentation set should have its own identifier. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES. + +ECLIPSE_DOC_ID = org.doxygen.Project + +# If you want full control over the layout of the generated HTML pages it might +# be necessary to disable the index and replace it with your own. The +# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top +# of each HTML page. A value of NO enables the index and the value YES disables +# it. Since the tabs in the index contain the same information as the navigation +# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +DISABLE_INDEX = NO + +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. If the tag +# value is set to YES, a side panel will be generated containing a tree-like +# index structure (just like the one that is generated for HTML Help). For this +# to work a browser that supports JavaScript, DHTML, CSS and frames is required +# (i.e. any modern browser). Windows users are probably better off using the +# HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can +# further fine-tune the look of the index. As an example, the default style +# sheet generated by doxygen has an example that shows how to put an image at +# the root of the tree instead of the PROJECT_NAME. Since the tree basically has +# the same information as the tab index, you could consider setting +# DISABLE_INDEX to YES when enabling this option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_TREEVIEW = NO + +# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that +# doxygen will group on one line in the generated HTML documentation. +# +# Note that a value of 0 will completely suppress the enum values from appearing +# in the overview section. +# Minimum value: 0, maximum value: 20, default value: 4. +# This tag requires that the tag GENERATE_HTML is set to YES. + +ENUM_VALUES_PER_LINE = 4 + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used +# to set the initial width (in pixels) of the frame in which the tree is shown. +# Minimum value: 0, maximum value: 1500, default value: 250. +# This tag requires that the tag GENERATE_HTML is set to YES. + +TREEVIEW_WIDTH = 250 + +# If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to +# external symbols imported via tag files in a separate window. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +EXT_LINKS_IN_WINDOW = NO + +# Use this tag to change the font size of LaTeX formulas included as images in +# the HTML documentation. When you change the font size after a successful +# doxygen run you need to manually remove any form_*.png images from the HTML +# output directory to force them to be regenerated. +# Minimum value: 8, maximum value: 50, default value: 10. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FORMULA_FONTSIZE = 10 + +# Use the FORMULA_TRANPARENT tag to determine whether or not the images +# generated for formulas are transparent PNGs. Transparent PNGs are not +# supported properly for IE 6.0, but are supported on all modern browsers. +# +# Note that when changing this option you need to delete any form_*.png files in +# the HTML output directory before the changes have effect. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FORMULA_TRANSPARENT = YES + +# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see +# http://www.mathjax.org) which uses client side Javascript for the rendering +# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX +# installed or if you want to formulas look prettier in the HTML output. When +# enabled you may also need to install MathJax separately and configure the path +# to it using the MATHJAX_RELPATH option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +USE_MATHJAX = NO + +# When MathJax is enabled you can set the default output format to be used for +# the MathJax output. See the MathJax site (see: +# http://docs.mathjax.org/en/latest/output.html) for more details. +# Possible values are: HTML-CSS (which is slower, but has the best +# compatibility), NativeMML (i.e. MathML) and SVG. +# The default value is: HTML-CSS. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_FORMAT = HTML-CSS + +# When MathJax is enabled you need to specify the location relative to the HTML +# output directory using the MATHJAX_RELPATH option. The destination directory +# should contain the MathJax.js script. For instance, if the mathjax directory +# is located at the same level as the HTML output directory, then +# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax +# Content Delivery Network so you can quickly see the result without installing +# MathJax. However, it is strongly recommended to install a local copy of +# MathJax from http://www.mathjax.org before deployment. +# The default value is: http://cdn.mathjax.org/mathjax/latest. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest + +# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax +# extension names that should be enabled during MathJax rendering. For example +# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_EXTENSIONS = + +# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces +# of code that will be used on startup of the MathJax code. See the MathJax site +# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an +# example see the documentation. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_CODEFILE = + +# When the SEARCHENGINE tag is enabled doxygen will generate a search box for +# the HTML output. The underlying search engine uses javascript and DHTML and +# should work on any modern browser. Note that when using HTML help +# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) +# there is already a search function so this one should typically be disabled. +# For large projects the javascript based search engine can be slow, then +# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to +# search using the keyboard; to jump to the search box use + S +# (what the is depends on the OS and browser, but it is typically +# , /