Compare commits
620 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e1308bfa21 | |||
| ed1d1f5b44 | |||
| aff871baaa | |||
| 0608e7048d | |||
| 0875e55c1d | |||
| 3508bcc42e | |||
| e59bfb2e12 | |||
| 3bb4039c78 | |||
| bd49e19c9e | |||
| 73bcd75b78 | |||
| a0578fa35d | |||
| 7de08d9f24 | |||
| d047f5e6d2 | |||
| 71071f817c | |||
| c7c864b8c0 | |||
| 67d4862f6b | |||
| 6a16327c30 | |||
| 060b1b8f41 | |||
| da2e228293 | |||
| ab7397bf55 | |||
| f79547f781 | |||
| 2152f1c90e | |||
| 503fb4d246 | |||
| 2befefa752 | |||
| 85e64c5076 | |||
| 60523dc994 | |||
| 6d780bf350 | |||
| eec02a1f84 | |||
| ace2fe6fe3 | |||
| 188794af8d | |||
| 92a941a944 | |||
| 0e1ddf2b11 | |||
| b57fa010d1 | |||
| f816452b78 | |||
| 120083bb31 | |||
| a5bb5c4686 | |||
| e5e2729f0a | |||
| ba8b902f48 | |||
| 2d67815ae6 | |||
| ec0c9066d2 | |||
| 58ae858077 | |||
| 613e7938b3 | |||
| e07ff1a445 | |||
| de7dd34ea2 | |||
| 0552f695f9 | |||
| b8d4f3d946 | |||
| fa112a70b1 | |||
| 97309ebb88 | |||
| 556ddc0b6f | |||
| a0dde690ea | |||
| a76dab5be6 | |||
| 2d10bc5bbf | |||
| 4042632e0b | |||
| 7ccf83e1a4 | |||
| 019cd0756f | |||
| 0e5f9f80be | |||
| fc6767860a | |||
| 5b5b4be7b2 | |||
| 45351d082e | |||
| 22ccd07491 | |||
| 2cf9ee647b | |||
| efb567824b | |||
| f0aac39486 | |||
| f278055805 | |||
| 6f2e36fd11 | |||
| 119d80ffc8 | |||
| 771c3df864 | |||
| 7d1963e458 | |||
| dde85972b3 | |||
| 5e061da910 | |||
| 46bea345de | |||
| bc53462ad6 | |||
| 884df40a1d | |||
| b23168c067 | |||
| 5568212f15 | |||
| 79db79d799 | |||
| 18a4008efd | |||
| 83e4abd1ee | |||
| 243bcfba72 | |||
| af2c8c560f | |||
| 6a37f3871c | |||
| 759a388448 | |||
| 360e89d7ce | |||
| 64655a3284 | |||
| c58356bde8 | |||
| f74117632d | |||
| 5f2b8b8e2b | |||
| f0ce7481fd | |||
| 6e7a5c6140 | |||
| 079c18ee19 | |||
| 26ef6a3815 | |||
| cf6dcefe6c | |||
| 35590eb979 | |||
| 583a8b8a76 | |||
| c6e8a664de | |||
| 24a5e0a579 | |||
| a242c197fb | |||
| 08bdd23149 | |||
| c5b35b2d98 | |||
| 5407fecd1f | |||
| 12d2821d26 | |||
| 2e6d58e6a3 | |||
| 0f0c0fd5ae | |||
| ef9ec1c223 | |||
| f4387bae30 | |||
| 49b238a23a | |||
| 4b75c01b28 | |||
| e7f641046b | |||
| 9aaabe0fab | |||
| b6e4b711bf | |||
| 58fcfd210b | |||
| 5868b9c234 | |||
| 0dc6d9cf9d | |||
| 67f50cf2fd | |||
| 8b26a4d49a | |||
| a1d0bb0aa1 | |||
| bfe08560b1 | |||
| ac3ac24272 | |||
| 03e7191d0e | |||
| b3a42f8723 | |||
| 9c4b740300 | |||
| 2a12bdadf2 | |||
| c90e8ad4d2 | |||
| 4a52c51c86 | |||
| 0efc817ddc | |||
| fee54fc98c | |||
| 210f751396 | |||
| 2e2bc3fe29 | |||
| a6f05f86d1 | |||
| fc144e4848 | |||
| cef9531428 | |||
| abd4faefbf | |||
| 966f7aaed5 | |||
| 51b59fa995 | |||
| 0b713736bd | |||
| 9e33581c66 | |||
| b97792b596 | |||
| c0746f8eff | |||
| a826a9d692 | |||
| 6d04203d37 | |||
| 33b2ed8a94 | |||
| 4f16da7ad0 | |||
| 36f92c7655 | |||
| 1d4f5a759e | |||
| 28af9bc811 | |||
| cf04cd4094 | |||
| 23e9efb28a | |||
| 57322df29c | |||
| fff82d34c6 | |||
| 7211860c21 | |||
| 9fc69044f8 | |||
| 76467c3e81 | |||
| 4cfc04e2f3 | |||
| 6bfc7771d0 | |||
| 7055135257 | |||
| 85312cf20d | |||
| 4051cae5b0 | |||
| c64bb6dedf | |||
| 7bb17ae0db | |||
| 3244eb9b15 | |||
| 6e173847ba | |||
| 8cbc1f763d | |||
| 2d45abeb28 | |||
| 2fd0ad77bc | |||
| 53c1167831 | |||
| 48d4a1d7bb | |||
| 4bbbba6e89 | |||
| 0a13575325 | |||
| d6075209df | |||
| 9d1b39422b | |||
| 38e297d32b | |||
| 459ef3c9f1 | |||
| 3bb12487ba | |||
| 8b2428c60d | |||
| f9befd9051 | |||
| 1020a9bd5d | |||
| 2844c4ea86 | |||
| 3344188fee | |||
| 67138c2f78 | |||
| f59d19ef21 | |||
| d0fa7e638f | |||
| 63011e466e | |||
| 92d1976300 | |||
| a0cdc9fa07 | |||
| 60f0006597 | |||
| 67a3c62a08 | |||
| 21d5dc1e0b | |||
| 0d810f59f9 | |||
| dba60b700f | |||
| ad9a56bd20 | |||
| 82585e9104 | |||
| dfbb241b0b | |||
| f69ea91f45 | |||
| 768d916092 | |||
| c0acecae10 | |||
| f741d1c7e4 | |||
| d25c70f1d1 | |||
| 6f954467ef | |||
| 867987a5f5 | |||
| 61e0a6351c | |||
| 558264c23b | |||
| cf7aa371af | |||
| ffedaf6a73 | |||
| d9ae272b36 | |||
| 3c5d1f5c9e | |||
| b69b8b7585 | |||
| 8c7e498fb2 | |||
| 359413a296 | |||
| cef7d894c4 | |||
| 7d9cc1aacc | |||
| a6780a756b | |||
| 4e37d17b42 | |||
| 793923348f | |||
| 700db1788d | |||
| 68a5a44702 | |||
| 464891f5a1 | |||
| d2e5db2680 | |||
| a9c41d0545 | |||
| 0bc458d307 | |||
| 36c7cc285e | |||
| f9fbd31a0f | |||
| 8789c1f855 | |||
| f65073480a | |||
| 157ed831a7 | |||
| 0799a59a15 | |||
| 60ea3e83e1 | |||
| 4b874deb50 | |||
| 6726b9ad50 | |||
| 75e6fe609e | |||
| b40d1ccf7d | |||
| 4f7ba23904 | |||
| 49084706f2 | |||
| 1852e5f6bf | |||
| be0ed5428a | |||
| f428efde6a | |||
| e79f04f33e | |||
| 04db8c281f | |||
| 2681698186 | |||
| 1682c66da6 | |||
| 38bc1032d8 | |||
| ba37eef9ca | |||
| 3db179882a | |||
| ba8f25a807 | |||
| eac3d3089b | |||
| 0454a9e147 | |||
| f390cd1c68 | |||
| aaa1ba5aa9 | |||
| fb9556abd9 | |||
| 3cfb3b1f84 | |||
| b071bab137 | |||
| 5dbc68ea76 | |||
| e76fbc3b77 | |||
| 09ca0514d1 | |||
| faec32a5bb | |||
| 1f5793ab79 | |||
| df22bd1cec | |||
| 61dba4e78d | |||
| bb678117f8 | |||
| 2dc08e71b7 | |||
| df2f844e74 | |||
| 621c602fc0 | |||
| f809169757 | |||
| 848b135612 | |||
| db6af66705 | |||
| 728e1f5a86 | |||
| d02d95bc9e | |||
| c1180c5373 | |||
| 4e01fb64e6 | |||
| d0fcb1da34 | |||
| 48352d06b3 | |||
| d995652569 | |||
| 5a958fa51c | |||
| cfb9e2cacd | |||
| 7932fc1cab | |||
| e0fc1715b5 | |||
| 1cfd6caa64 | |||
| 54bf18888d | |||
| 6b60fc4259 | |||
| 216af8697c | |||
| d97e7314d0 | |||
| 67d9dda143 | |||
| 5c60e303cb | |||
| e36b8f3a56 | |||
| 1e7a19b463 | |||
| 8004249a29 | |||
| 6cd800e4ef | |||
| e182bc7ed2 | |||
| c338d51c9d | |||
| c1912250df | |||
| 994c41980e | |||
| 385b7a514d | |||
| 3aaade9228 | |||
| b4dd19b711 | |||
| 9e9b83b4ba | |||
| 5ff5114669 | |||
| f63039f3fb | |||
| b39399463d | |||
| 8217ef7fbb | |||
| b4851c34e1 | |||
| 8e39832d3e | |||
| ce7ac6da16 | |||
| 57879a57cd | |||
| 6f5b367028 | |||
| 291948c1ef | |||
| 0ca6888fb1 | |||
| 5e92236396 | |||
| 28db40112b | |||
| b2153883ef | |||
| 807cbeb75d | |||
| 4730aebdc6 | |||
| c2279eec87 | |||
| f5567ae9ad | |||
| 2fcba04cf5 | |||
| 0eefd1605f | |||
| 7b88ea022d | |||
| 7a922114ab | |||
| f717c270fd | |||
| ee5ed468c3 | |||
| a9ded445a7 | |||
| 9ecad52df2 | |||
| 8c500985bf | |||
| 3567f9ba5d | |||
| 852bfb716c | |||
| 473956aa3c | |||
| b22fc19400 | |||
| f6a8ece992 | |||
| afc0c21aae | |||
| 08e6106c1f | |||
| 1f9f654e3d | |||
| 501e923760 | |||
| 37b716cfc5 | |||
| 8584db0ab5 | |||
| 5aff3e9692 | |||
| 5d8f03cbc3 | |||
| b6c85ac15a | |||
| c2af757f4e | |||
| 26252c55ac | |||
| 3ce547bcea | |||
| e0492f589e | |||
| 4931288ffd | |||
| 52e0f77a3c | |||
| 20c016f1bf | |||
| 00a271cbba | |||
| 3a6b69634d | |||
| 78cf7f42e3 | |||
| 2b52454c00 | |||
| e032e4561b | |||
| 23ce1e0476 | |||
| 825b7b98d7 | |||
| 3de3128a2a | |||
| 92d70ccc8b | |||
| f8c5154457 | |||
| 3a3874e9f1 | |||
| 61b94c519b | |||
| ac0f46ca66 | |||
| e538cdb509 | |||
| df8a63c5f5 | |||
| 6827a61bf8 | |||
| 20e56c05b3 | |||
| 5494139319 | |||
| c491ba087a | |||
| 5cf045c941 | |||
| 55fea5f077 | |||
| 3a9cb73950 | |||
| d99f613b79 | |||
| 68db8ddff3 | |||
| c7490b264b | |||
| a8e84cfad3 | |||
| 5ec4f7e4e8 | |||
| b019ce2f2e | |||
| dd90e41610 | |||
| bdf78e374d | |||
| 163197f583 | |||
| 8e13bba44a | |||
| e4478b86a5 | |||
| 1b1ae59ed7 | |||
| a54f44d22a | |||
| d2394274eb | |||
| 0eedb0b397 | |||
| 782e9db1f6 | |||
| 2977472c56 | |||
| 8f3a8bfa91 | |||
| 914f6e9516 | |||
| fa6f65cb7c | |||
| dafbe6f995 | |||
| 4a8ac6377b | |||
| c91fac4ec4 | |||
| 00d23b084e | |||
| e0a3b82cea | |||
| e49036d8c4 | |||
| 4a8356692b | |||
| adfb7bc63a | |||
| 3f41cefa88 | |||
| 2074ff1987 | |||
| 65fe189421 | |||
| bb7590eab4 | |||
| 6a04457219 | |||
| 7f8b1d9586 | |||
| 4362cc53bb | |||
| 959e6b2a12 | |||
| 2d91070e5a | |||
| cc038ece32 | |||
| 7af1292f29 | |||
| 2c3fd7a84f | |||
| d36f70dbc7 | |||
| 77f5f29c90 | |||
| ead45ed843 | |||
| a6259bb7eb | |||
| 0249ebeb95 | |||
| 1c3a35a137 | |||
| c12319b417 | |||
| 90ac00a628 | |||
| e5c71cb3a4 | |||
| ebf0681574 | |||
| 642643f412 | |||
| 8dd65ac255 | |||
| 8df58f226b | |||
| 58b4f2ce14 | |||
| 65f0c836fe | |||
| 2aa16085a5 | |||
| 25f05a69c6 | |||
| 5c2a94da16 | |||
| 162325e90e | |||
| b022a8c608 | |||
| 1e404f5e6b | |||
| 8ef7780332 | |||
| 51b4f7b3f7 | |||
| 9b3fa33e50 | |||
| 9349d0813d | |||
| 8d9bc500a1 | |||
| cae7b6e29f | |||
| 0b4ac732b2 | |||
| acacbb91e3 | |||
| fd6d3d9a2f | |||
| 3b531e30b1 | |||
| 0c78085b2e | |||
| 4ab53308f7 | |||
| 06ae161793 | |||
| 94e005d2f8 | |||
| 717072c3a5 | |||
| 02b4bde92a | |||
| a397d1e233 | |||
| d2198c0765 | |||
| 549bf63198 | |||
| 8b824f5342 | |||
| d052d5e8a1 | |||
| 610c22dd02 | |||
| a5496ab6a9 | |||
| c29c8f009c | |||
| fb7e9f2a6c | |||
| 62c2bbb9fa | |||
| 7656772194 | |||
| f22ff050e0 | |||
| 708f0b44fd | |||
| 2ee4581f17 | |||
| e337fb869f | |||
| 4a8b0147e1 | |||
| c95a1c7e1f | |||
| a07cd5c3f5 | |||
| 4d1473582e | |||
| 3bc9f4c452 | |||
| 11377038a0 | |||
| 6053d3eac1 | |||
| 529830f36b | |||
| 505cf6265c | |||
| 8cd9673eec | |||
| ac9cb28558 | |||
| 6eefe0698c | |||
| d0113532b6 | |||
| 5a1d2ad5f4 | |||
| dfe02f4c74 | |||
| 5349d556b9 | |||
| 7f7d8a501b | |||
| cbee0e465b | |||
| faf00f0b0d | |||
| fa97da5781 | |||
| e7bab546db | |||
| e2f4a30b5b | |||
| ccff1df041 | |||
| 2037cfc25a | |||
| 268a091d8a | |||
| 6b52dfab3e | |||
| 839999851f | |||
| a87470b7b5 | |||
| e76aeb80fd | |||
| 28292e59e2 | |||
| 25dda481b2 | |||
| bbda233fd8 | |||
| 349218f0b5 | |||
| f18d00a69d | |||
| 25ea6504de | |||
| 43081c70e2 | |||
| 0fde1c2026 | |||
| b35383571e | |||
| 45a84847a2 | |||
| 70d92f26d6 | |||
| 737ed86e69 | |||
| 3865057b7a | |||
| 42a84dcd86 | |||
| e2d819c59d | |||
| bfee6a88dc | |||
| 68f3be17df | |||
| 929c97ff5e | |||
| 4b66a2e4d0 | |||
| 46e740154e | |||
| 05e89f49da | |||
| 358e9071e3 | |||
| e37b6a1cc0 | |||
| 266721973b | |||
| 7c27ac85cb | |||
| 4b79732e38 | |||
| 2ceeea5298 | |||
| 3ec659a59b | |||
| 4309056851 | |||
| b768f20f7a | |||
| b3a71bcf53 | |||
| 50c199bc03 | |||
| d6302ac128 | |||
| 6a5d9e1394 | |||
| ac5fc3e6ea | |||
| aa6cbceeb9 | |||
| 46a7395382 | |||
| a782811dad | |||
| d22039bc96 | |||
| 15539c258e | |||
| f9ca4acf16 | |||
| 66d2a9b7fe | |||
| 6dff8c3221 | |||
| f13c65e083 | |||
| 56a7d5cb86 | |||
| c63c0675d5 | |||
| 22bc4b8c9e | |||
| ead17b8906 | |||
| 1a211daac2 | |||
| c7e502da4e | |||
| 70df5e6cec | |||
| 793f287c35 | |||
| 8e8b1c60b8 | |||
| ba2cd51852 | |||
| 3986a4ef60 | |||
| c99d89fb11 | |||
| 0a9c33de91 | |||
| 88c940fc53 | |||
| 88c861cbde | |||
| cd071ca144 | |||
| 9970b8ec36 | |||
| ffc564becd | |||
| 6289fd5941 | |||
| 7f44fe76c7 | |||
| ea86dc6785 | |||
| 754f9e1ed1 | |||
| 9a1a02e664 | |||
| 1e92195355 | |||
| bb63c1c990 | |||
| 5af494de76 | |||
| 5bcac73a45 | |||
| 7a709e48d7 | |||
| d2d9fe010e | |||
| 4b6b129934 | |||
| 7645146d77 | |||
| 9b8cca38ae | |||
| e872fda3f2 | |||
| 6ccb03c557 | |||
| b8237b1be7 | |||
| 68e19cf8e4 | |||
| 91fba729b8 | |||
| 0af0e09b6e | |||
| 1276d56627 | |||
| bd2773f9c1 | |||
| b8b1b8ef36 | |||
| 0f98d72e30 | |||
| 44ec7734d4 | |||
| c5adb063ca | |||
| 83ef8f9789 | |||
| b8a803a641 | |||
| 31c0effebe | |||
| e90c4b3eb5 | |||
| ae6efcc27d | |||
| 7922ac127b | |||
| 559f0443af | |||
| 4e3faf1573 | |||
| e3039bd2d8 | |||
| e668cba839 | |||
| fcc47c0b7f | |||
| 2f189bc2ff | |||
| ee9d134f0e | |||
| c1fad7cc02 | |||
| 3a48b4ee4f | |||
| ec626f9741 | |||
| 90906cdc0e | |||
| a694527645 | |||
| bd68b20d31 | |||
| 080d976400 | |||
| e200a8525b | |||
| 5bdf7abc2b | |||
| 9faa1d2e1e | |||
| f586353cdb | |||
| 2c9f2ee5cf | |||
| d8bd45bf54 | |||
| 9341e0b500 | |||
| eebf303f3e | |||
| df487d5488 | |||
| 7b66da5823 | |||
| 3a929c2a03 | |||
| a8ac3c4771 | |||
| 8d223786b9 | |||
| 068c6a6ea0 | |||
| 0db677121a | |||
| 7591170bca | |||
| 7272541826 | |||
| 2460912532 | |||
| c1e4c22e3f | |||
| 17bd17fa3c | |||
| 05da3ccb66 | |||
| 578044884c | |||
| 226148d04f | |||
| c44c7516ff | |||
| c3c0749222 | |||
| b7e63b0e54 | |||
| 60cd2cb0f9 |
+184
-25
@@ -26,49 +26,186 @@ jobs:
|
||||
build-connector: # Reusable job for basic connectors
|
||||
executor:
|
||||
name: win/default # comes with python 3.7.3
|
||||
shell: cmd.exe
|
||||
shell: powershell.exe
|
||||
parameters:
|
||||
slug:
|
||||
type: string
|
||||
default: ""
|
||||
environment:
|
||||
SSM: 'C:\Program Files\DigiCert\DigiCert One Signing Manager Tools'
|
||||
steps:
|
||||
- checkout
|
||||
- attach_workspace:
|
||||
at: ./
|
||||
- run:
|
||||
name: Set Environment Variable
|
||||
shell: powershell.exe
|
||||
command: |
|
||||
$tag = if([string]::IsNullOrEmpty($env:CIRCLE_TAG)) { "2.0.999" } else { $env:CIRCLE_TAG }
|
||||
$semver = if($tag.Contains('/')) {$tag.Split("/")[0] } else { $tag }
|
||||
$ver = if($semver.Contains('-')) {$semver.Split("-")[0] } else { $semver }
|
||||
$version = "$($ver).$($env:WORKFLOW_NUM)"
|
||||
python patch_version.py $semver
|
||||
environment:
|
||||
WORKFLOW_NUM: << pipeline.number >>
|
||||
- unless: # Build installers unsigned on non-tagged builds
|
||||
condition: << pipeline.git.tag >>
|
||||
steps:
|
||||
- run:
|
||||
name: Build Installer
|
||||
command: speckle-sharp-ci-tools\InnoSetup\ISCC.exe speckle-sharp-ci-tools\sketchup.iss /Sbyparam=$p
|
||||
shell: cmd.exe # does not work in powershell
|
||||
- when: # Setup certificates and build installers signed for tagged builds
|
||||
condition: << pipeline.git.tag >>
|
||||
steps:
|
||||
- run:
|
||||
name: "Digicert Signing Manager Setup"
|
||||
command: |
|
||||
cd C:\
|
||||
curl.exe -X GET https://one.digicert.com/signingmanager/api-ui/v1/releases/smtools-windows-x64.msi/download -H "x-api-key:$env:SM_API_KEY" -o smtools-windows-x64.msi
|
||||
msiexec.exe /i smtools-windows-x64.msi /quiet /qn | Wait-Process
|
||||
- run:
|
||||
name: "Create Auth & OV Signing Cert"
|
||||
command: |
|
||||
cd C:\
|
||||
echo $env:SM_CLIENT_CERT_FILE_B64 > certificate.txt
|
||||
certutil -decode certificate.txt certificate.p12
|
||||
- run:
|
||||
name: "Sync Certs"
|
||||
command: |
|
||||
& $env:SSM\smksp_cert_sync.exe
|
||||
- run:
|
||||
name: "Build Installer"
|
||||
command: speckle-sharp-ci-tools\InnoSetup\ISCC.exe speckle-sharp-ci-tools\sketchup.iss /Sbyparam=$p /DSIGN_INSTALLER /DCODE_SIGNING_CERT_FINGERPRINT=%SM_CODE_SIGNING_CERT_SHA1_HASH%
|
||||
shell: cmd.exe
|
||||
- persist_to_workspace:
|
||||
root: ./
|
||||
paths:
|
||||
- speckle-sharp-ci-tools/Installers
|
||||
|
||||
build-connector-mac:
|
||||
macos:
|
||||
xcode: 13.4.1
|
||||
parameters:
|
||||
projname:
|
||||
type: string
|
||||
default: ""
|
||||
slug:
|
||||
type: string
|
||||
default: ""
|
||||
installer:
|
||||
type: boolean
|
||||
default: false
|
||||
converter-files:
|
||||
type: string
|
||||
default: ""
|
||||
installername:
|
||||
type: string
|
||||
default: ""
|
||||
build-config:
|
||||
type: string
|
||||
default: Release
|
||||
bundlename:
|
||||
type: string
|
||||
default: ""
|
||||
steps:
|
||||
- checkout
|
||||
- attach_workspace:
|
||||
at: ./
|
||||
- run:
|
||||
name: Patch
|
||||
shell: powershell.exe
|
||||
command:
|
||||
| # If no tag, use 0.0.0.1 and don't make any YML (for testing only!)
|
||||
$tag = if([string]::IsNullOrEmpty($env:CIRCLE_TAG)) { "0.0.0" } else { $env:CIRCLE_TAG }
|
||||
$semver = if($tag.Contains('/')) {$tag.Split("/")[1] } else { $tag }
|
||||
$ver = if($semver.Contains('-')) {$semver.Split("-")[0] } else { $semver }
|
||||
$channel = if($semver.Contains('-')) {$semver.Split("-")[1] } else { "latest" }
|
||||
$version = "$($ver).$($env:CIRCLE_BUILD_NUM)"
|
||||
New-Item -Force "speckle-sharp-ci-tools/Installers/sketchup/$channel.yml" -ItemType File -Value "version: $semver"
|
||||
echo $version
|
||||
python patch_version.py $semver
|
||||
speckle-sharp-ci-tools\InnoSetup\ISCC.exe speckle-sharp-ci-tools\sketchup.iss
|
||||
- persist_to_workspace:
|
||||
root: ./
|
||||
paths:
|
||||
- speckle-sharp-ci-tools/Installers
|
||||
name: Install dotnet
|
||||
command: |
|
||||
curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --channel Current
|
||||
|
||||
$HOME/.dotnet/dotnet --version
|
||||
$HOME/.dotnet/dotnet --list-runtimes
|
||||
$HOME/.dotnet/dotnet --list-sdks
|
||||
- run:
|
||||
name: Create installer target dir
|
||||
command: |
|
||||
mkdir -p speckle-sharp-ci-tools/Installers/<< parameters.slug >>
|
||||
- run:
|
||||
name: Set Environment Variable
|
||||
command: |
|
||||
TAG=$(if [ "${CIRCLE_TAG}" ]; then echo $CIRCLE_TAG; else echo "2.0.999"; fi;)
|
||||
SEMVER=$(echo "$TAG" | sed -e 's/\/[a-zA-Z-]*//')
|
||||
VER=$(echo "$SEMVER" | sed -e 's/-.*//')
|
||||
VERSION=$(echo $VER.$WORKFLOW_NUM)
|
||||
python3 patch_version.py $SEMVER
|
||||
environment:
|
||||
WORKFLOW_NUM: << pipeline.number >>
|
||||
- run:
|
||||
name: Zip Connector files
|
||||
command: |
|
||||
zip -r << parameters.slug >>-mac.zip "./speckle_connector" "./speckle_connector.rb"
|
||||
# Copy installer files
|
||||
- run:
|
||||
name: Copy files to installer
|
||||
command: |
|
||||
mkdir -p speckle-sharp-ci-tools/Mac/<< parameters.installername >>/.installationFiles/
|
||||
cp << parameters.slug >>-mac.zip speckle-sharp-ci-tools/Mac/<<parameters.installername>>/.installationFiles
|
||||
# Create installer
|
||||
- run:
|
||||
name: Exit if External PR
|
||||
command: if [ "$CIRCLE_PR_REPONAME" ]; then circleci-agent step halt; fi
|
||||
- run:
|
||||
name: Build Mac installer
|
||||
command: ~/.dotnet/dotnet publish speckle-sharp-ci-tools/Mac/<<parameters.installername>>/<<parameters.installername>>.sln -r osx-x64 -c Release
|
||||
- run:
|
||||
name: Zip installer
|
||||
command: |
|
||||
cd speckle-sharp-ci-tools/Mac/<<parameters.installername>>/bin/Release/net6.0/osx-x64/publish/
|
||||
zip -r <<parameters.slug>>.zip ./
|
||||
- store_artifacts:
|
||||
path: speckle-sharp-ci-tools/Mac/<<parameters.installername>>/bin/Release/net6.0/osx-x64/publish/<<parameters.slug>>.zip
|
||||
- run:
|
||||
name: Copy to installer location
|
||||
command: |
|
||||
TAG=$(if [ "${CIRCLE_TAG}" ]; then echo $CIRCLE_TAG; else echo "2.0.999"; fi;)
|
||||
SEMVER=$(echo "$TAG" | sed -e 's/\/[a-zA-Z-]*//')
|
||||
VER=$(echo "$SEMVER" | sed -e 's/-.*//')
|
||||
VERSION=$(echo $VER.$WORKFLOW_NUM)
|
||||
cp speckle-sharp-ci-tools/Mac/<<parameters.installername>>/bin/Release/net6.0/osx-x64/publish/<<parameters.slug>>.zip speckle-sharp-ci-tools/Installers/<< parameters.slug >>/<<parameters.slug>>-$SEMVER.zip
|
||||
environment:
|
||||
WORKFLOW_NUM: << pipeline.number >>
|
||||
- when:
|
||||
condition: << pipeline.git.tag >>
|
||||
steps:
|
||||
- persist_to_workspace:
|
||||
root: ./
|
||||
paths:
|
||||
- speckle-sharp-ci-tools/Installers
|
||||
|
||||
get-ci-tools: # Clones our ci tools and persists them to the workspace
|
||||
docker:
|
||||
- image: cimg/base:2021.01
|
||||
steps:
|
||||
- add_ssh_keys:
|
||||
fingerprints:
|
||||
- "03:2e:ee:4f:14:67:2b:88:32:e8:cc:f0:cb:df:92:29"
|
||||
- run:
|
||||
name: I know Github as a host
|
||||
command: |
|
||||
mkdir ~/.ssh
|
||||
ssh-keyscan github.com >> ~/.ssh/known_hosts
|
||||
- run:
|
||||
name: Clone
|
||||
command: git clone https://$GITHUB_TOKEN@github.com/specklesystems/speckle-sharp-ci-tools.git speckle-sharp-ci-tools
|
||||
- persist_to_workspace:
|
||||
root: ./
|
||||
paths:
|
||||
- speckle-sharp-ci-tools
|
||||
command: git clone git@github.com:specklesystems/speckle-sharp-ci-tools.git speckle-sharp-ci-tools
|
||||
- run:
|
||||
name: Checkout branch
|
||||
command: |
|
||||
cd speckle-sharp-ci-tools
|
||||
if [ -z "$CIRCLE_TAG" ]
|
||||
then
|
||||
git checkout ${CIRCLE_BRANCH} || git checkout main
|
||||
else
|
||||
git checkout ${CIRCLE_TAG} || git checkout main
|
||||
fi
|
||||
- persist_to_workspace:
|
||||
root: ./
|
||||
paths:
|
||||
- speckle-sharp-ci-tools
|
||||
|
||||
deploy-manager2:
|
||||
docker:
|
||||
- image: mcr.microsoft.com/dotnet/sdk:6.0
|
||||
@@ -114,17 +251,39 @@ workflows:
|
||||
filters:
|
||||
tags:
|
||||
only: /.*/
|
||||
context: digicert-keylocker
|
||||
|
||||
- build-connector-mac:
|
||||
slug: sketchup
|
||||
requires:
|
||||
- get-ci-tools
|
||||
- build-ui
|
||||
filters:
|
||||
tags:
|
||||
only: /.*/
|
||||
installername: SpeckleSketchUpInstall
|
||||
|
||||
- deploy-manager2:
|
||||
context: do-spaces-speckle-releases
|
||||
slug: sketchup
|
||||
os: Win
|
||||
extension: exe
|
||||
requires:
|
||||
- get-ci-tools
|
||||
- build-ui
|
||||
- build-connector
|
||||
filters:
|
||||
tags:
|
||||
only: /([0-9]+)\.([0-9]+)\.([0-9]+)(?:-\w+)?$/
|
||||
branches:
|
||||
ignore: /.*/ # For testing only! /ci\/.*/
|
||||
- deploy-manager2:
|
||||
context: do-spaces-speckle-releases
|
||||
slug: sketchup
|
||||
os: OSX
|
||||
extension: zip
|
||||
requires:
|
||||
- build-connector-mac
|
||||
filters:
|
||||
tags:
|
||||
only: /([0-9]+)\.([0-9]+)\.([0-9]+)(?:-\w+)?$/
|
||||
branches:
|
||||
ignore: /.*/ # For testing only! /ci\/.*/
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
[submodule "_sqlite3"]
|
||||
path = _sqlite3
|
||||
url = https://github.com/specklesystems/sketchup-sqlite3.git
|
||||
+2
-2
@@ -23,7 +23,7 @@ AllCops:
|
||||
- 'tests/**/*.rb'
|
||||
SketchUp:
|
||||
SourcePath: .
|
||||
TargetSketchUpVersion: 2017
|
||||
TargetSketchUpVersion: 2021
|
||||
Exclude: # Exclude common folders.
|
||||
- 'tests/**/*'
|
||||
- 'benchmarks/**/*'
|
||||
@@ -83,7 +83,7 @@ Minitest/MultipleAssertions:
|
||||
Max: 5
|
||||
|
||||
Naming/MethodParameterName:
|
||||
AllowedNames: [x, y, z]
|
||||
AllowedNames: [x, y, z, id]
|
||||
|
||||
Naming/VariableNumber:
|
||||
EnforcedStyle: snake_case
|
||||
|
||||
+3
-4
@@ -1,7 +1,7 @@
|
||||
GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
addressable (2.8.1)
|
||||
addressable (2.8.4)
|
||||
public_suffix (>= 2.0.2, < 6.0)
|
||||
ast (2.4.2)
|
||||
axiom-types (0.1.1)
|
||||
@@ -26,7 +26,7 @@ GEM
|
||||
path_expander (~> 1.0)
|
||||
ruby_parser (~> 3.1, > 3.1.0)
|
||||
sexp_processor (~> 4.8)
|
||||
git (1.12.0)
|
||||
git (1.18.0)
|
||||
addressable (~> 2.8)
|
||||
rchardet (~> 1.8)
|
||||
ice_nine (0.11.2)
|
||||
@@ -48,8 +48,7 @@ GEM
|
||||
pry (0.14.1)
|
||||
coderay (~> 1.1)
|
||||
method_source (~> 1.0)
|
||||
psych (3.3.4)
|
||||
public_suffix (5.0.0)
|
||||
public_suffix (5.0.1)
|
||||
rainbow (3.1.1)
|
||||
rake (13.0.6)
|
||||
rchardet (1.8.0)
|
||||
|
||||
@@ -2,66 +2,60 @@
|
||||
<img src="https://user-images.githubusercontent.com/2679513/131189167-18ea5fe1-c578-47f6-9785-3748178e4312.png" width="150px"/><br/>
|
||||
Speckle | SketchUp
|
||||
</h1>
|
||||
|
||||
<p align="center"><a href="https://twitter.com/SpeckleSystems"><img src="https://img.shields.io/twitter/follow/SpeckleSystems?style=social" alt="Twitter Follow"></a> <a href="https://speckle.community"><img src="https://img.shields.io/discourse/users?server=https%3A%2F%2Fspeckle.community&style=flat-square&logo=discourse&logoColor=white" alt="Community forum users"></a> <a href="https://speckle.systems"><img src="https://img.shields.io/badge/https://-speckle.systems-royalblue?style=flat-square" alt="website"></a> <a href="https://speckle.guide/dev/"><img src="https://img.shields.io/badge/docs-speckle.guide-orange?style=flat-square&logo=read-the-docs&logoColor=white" alt="docs"></a></p>
|
||||
|
||||
> Speckle is the first AEC data hub that connects with your favorite AEC tools. Speckle exists to overcome the challenges of working in a fragmented industry where communication, creative workflows, and the exchange of data are often hindered by siloed software and processes. It is here to make the industry better.
|
||||
|
||||
<h3 align="center">
|
||||
Connector for SketchUp
|
||||
</h3>
|
||||
<p align="center"><b>Speckle</b> is the data infrastructure for the AEC industry.</p><br/>
|
||||
|
||||
<p align="center"><a href="https://twitter.com/SpeckleSystems"><img src="https://img.shields.io/twitter/follow/SpeckleSystems?style=social" alt="Twitter Follow"></a> <a href="https://speckle.community"><img src="https://img.shields.io/discourse/users?server=https%3A%2F%2Fspeckle.community&style=flat-square&logo=discourse&logoColor=white" alt="Community forum users"></a> <a href="https://speckle.systems"><img src="https://img.shields.io/badge/https://-speckle.systems-royalblue?style=flat-square" alt="website"></a> <a href="https://speckle.guide/dev/"><img src="https://img.shields.io/badge/docs-speckle.guide-orange?style=flat-square&logo=read-the-docs&logoColor=white" alt="docs"></a></p>
|
||||
<p align="center"><a href="https://github.com/specklesystems/speckle-blender/"><img src="https://circleci.com/gh/specklesystems/speckle-blender.svg?style=svg&circle-token=76eabd350ea243575cbb258b746ed3f471f7ac29" alt="Speckle-Next"></a> </p>
|
||||
|
||||
# About Speckle
|
||||
|
||||
What is Speckle? Check our 
|
||||
|
||||
### Features
|
||||
|
||||
- **Object-based:** say goodbye to files! Speckle is the first object based platform for the AEC industry
|
||||
- **Version control:** Speckle is the Git & Hub for geometry and BIM data
|
||||
- **Collaboration:** share your designs collaborate with others
|
||||
- **3D Viewer:** see your CAD and BIM models online, share and embed them anywhere
|
||||
- **Interoperability:** get your CAD and BIM models into other software without exporting or importing
|
||||
- **Real time:** get real time updates and notifications and changes
|
||||
- **GraphQL API:** get what you need anywhere you want it
|
||||
- **Webhooks:** the base for a automation and next-gen pipelines
|
||||
- **Built for developers:** we are building Speckle with developers in mind and got tools for every stack
|
||||
- **Built for the AEC industry:** Speckle connectors are plugins for the most common software used in the industry such as Revit, Rhino, Grasshopper, AutoCAD, Civil 3D, Excel, Unreal Engine, Unity, QGIS, Blender and more!
|
||||
|
||||
### Try Speckle now!
|
||||
|
||||
Give Speckle a try in no time by:
|
||||
|
||||
- [](https://speckle.xyz) ⇒ creating an account at our public server
|
||||
- [](https://marketplace.digitalocean.com/apps/speckle-server?refcode=947a2b5d7dc1) ⇒ deploying an instance in 1 click
|
||||
|
||||
### Resources
|
||||
|
||||
- [](https://speckle.community) for help, feature requests or just to hang with other speckle enthusiasts, check out our community forum!
|
||||
- [](https://speckle.systems) our tutorials portal is full of resources to get you started using Speckle
|
||||
- [](https://speckle.guide/user/blender.html) reference on almost any end-user and developer functionality
|
||||
|
||||
|
||||
# Repo structure
|
||||
# Repo structure
|
||||
|
||||
This is the beginning of the Speckle SketchUp Connector. It is still in very early development and is not ready for general use.
|
||||
This repo is split into three parts:
|
||||
|
||||
This repo is split into two parts: `speckle_connector` which is the Ruby SketchUp plugin and `ui` which is the Vue frontend.
|
||||
### 1. **Speckle Connector extension**
|
||||
|
||||
Includes the `ruby` source files to run extension on SketchUp environment. SketchUp Extensions are composed of
|
||||
a **.rb** file as entry and **folder** that .rb file refers to. In our case entry file is `speckle_connector.rb`
|
||||
that responsible to register Speckle Connector extension to SketchUp and also it shows address to where extension
|
||||
will start to read extension. Source folder is `speckle_connector`.
|
||||
|
||||
## Usage
|
||||
### 2. **User Interface**
|
||||
|
||||
> NOTE: this connector is still in early development and isn't ready for general use.
|
||||
Includes the `Vue` frontend lives in the `ui` folder.
|
||||
|
||||
Copy the whole `speckle_connector` folder to you SketchUp Plugins folder. You will likely find this at:
|
||||
### 3. **SketchUp Sqlite3 extension** [submodule](https://github.com/specklesystems/sketchup-sqlite3)
|
||||
|
||||
C:\Users\{YOU}\AppData\Roaming\SketchUp\SketchUp 2021\SketchUp\Plugins
|
||||
Includes source codes of base `SQLite3` C/C++ library and `ruby` compiler files to be able to run SQLite3
|
||||
functionality on SketchUp in the same ruby module like `SpeckleConnector::Sqlite3::Database`. By this way
|
||||
we use extensions as native part of the source `ruby` code.
|
||||
|
||||
After building `sqlite3.sln` file, compiled `sqlite3.so` (for Windows) and `sqlite3.bundle` (for OSX) dynamic library files are created
|
||||
by solution to place them into source code into `speckle_connector/src/ext`. Building this project should be only
|
||||
happen when SketchUp starts to support newer Ruby versions (currently it is `2.7`).
|
||||
|
||||
### Other repos
|
||||
|
||||
You'll need to serve the ui before launching the connector:
|
||||
Make sure to also check and ⭐️ these other Speckle next generation repositories:
|
||||
|
||||
cd ui
|
||||
npm install
|
||||
npm run serve
|
||||
- [`speckle-sharp-connectors`](https://github.com/specklesystems/speckle-sharp-connectors): .NET connectors and desktop UI
|
||||
- [`speckle-sharp-sdk`](https://github.com/specklesystems/speckle-sharp-sdk): our .NET SDK for next gen connectors and development
|
||||
- [`speckle-powerbi`](https://github.com/specklesystems/speckle-powerbi): PowerBi connector
|
||||
- and more [connectors & tooling](https://github.com/specklesystems/)!
|
||||
|
||||
## Contribution Guide
|
||||
|
||||
Before start to contribute, it is better to understand how align with other contributors. It will make easier job
|
||||
of reviewer when you submit an issue or PR. If it is your first repo to contribute Speckle environment make sure that you read
|
||||
[Contribution Guideline](https://github.com/specklesystems/speckle-sharp/blob/main/.github/CONTRIBUTING.md).
|
||||
|
||||
Additionally as mentioned on [Repo Structure](#3-sketchup-sqlite3-extension-submodulehttpsgithubcomspecklesystemssketchup-sqlite3),
|
||||
this repo includes a submodule. Contributions on this source files should be done on the [sketchup-sqlite](https://github.com/specklesystems/sketchup-sqlite3)
|
||||
by creating issues and PRs on it. If it is your first time works with submodules, please read [git docs](https://git-scm.com/book/en/v2/Git-Tools-Submodules)
|
||||
briefly to get some insight about it.
|
||||
|
||||
## Development
|
||||
|
||||
@@ -96,19 +90,9 @@ directory:
|
||||
|
||||
C:\Program Files\SketchUp\SketchUp 20XX\
|
||||
|
||||
You can now open up the repo in VS Code.
|
||||
You can now open up the repo in VS Code or you can use JetBrains' tools RubyMine and Webstorm.
|
||||
|
||||
Make sure you've installed the Ruby extension for VS Code.
|
||||
|
||||
### Concept to load plugins into SketchUp environment
|
||||
|
||||
To tell SketchUp to load the plugin from wherever you happen to be developing,
|
||||
you'll need to create a ruby file with the following contents:
|
||||
|
||||
```ruby
|
||||
$LOAD_PATH << 'C:\YOUR\PATH\TO\THE\sketchup_connector'
|
||||
require 'speckle_connector.rb'
|
||||
```
|
||||
If you will use VS Code, make sure you've installed the Ruby extension for VS Code.
|
||||
|
||||
### Loading the Speckle Connector Plugin
|
||||
|
||||
@@ -189,4 +173,4 @@ To track your code quality locally,
|
||||
2. To check overall state of repository by RubyCritic, run below
|
||||
```ruby
|
||||
rake rubycritic
|
||||
```
|
||||
```
|
||||
|
||||
Submodule
+1
Submodule _sqlite3 added at 800dd5e366
@@ -1,32 +0,0 @@
|
||||
# This file should be required by a file that has defined `RELEASE` to be the
|
||||
# name of the build folder where the binaries are located.
|
||||
|
||||
configuration, platform = ARGV[0].split(':')
|
||||
|
||||
if SKETCHUP_CONSOLE.respond_to?(:show)
|
||||
SKETCHUP_CONSOLE.show
|
||||
else
|
||||
Sketchup.send_action("showRubyPanel:")
|
||||
end
|
||||
|
||||
pro_status = Sketchup.is_pro? ? "Pro" : ""
|
||||
puts "SketchUp #{pro_status} #{Sketchup.version}"
|
||||
puts "Loading '#{configuration}' (#{platform}) build..."
|
||||
|
||||
ruby_path = File.dirname(__FILE__)
|
||||
project_path = File.expand_path( File.join(ruby_path, '..') )
|
||||
if platform == 'x64'
|
||||
binary_path = File.join(project_path, configuration, platform)
|
||||
else
|
||||
binary_path = File.join(project_path, configuration)
|
||||
end
|
||||
|
||||
puts ruby_path
|
||||
puts project_path
|
||||
puts binary_path
|
||||
|
||||
pattern = File.join(binary_path, "*.{so,bundle}")
|
||||
Dir.glob(pattern).each { |library|
|
||||
puts "Requiring #{library}"
|
||||
require library
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
# This file should be required by a file that has defined `RELEASE` to be the
|
||||
# name of the build folder where the binaries are located.
|
||||
|
||||
if SKETCHUP_CONSOLE.respond_to?(:show)
|
||||
SKETCHUP_CONSOLE.show
|
||||
else
|
||||
Sketchup.send_action("showRubyPanel:")
|
||||
end
|
||||
|
||||
prostatus = Sketchup.is_pro? ? "Pro" : ""
|
||||
puts "SketchUp #{prostatus} #{Sketchup.version}"
|
||||
puts "Loading '#{RELEASE}' build..."
|
||||
|
||||
ruby_path = File.dirname(__FILE__)
|
||||
project_path = File.expand_path( File.join(ruby_path, '..') )
|
||||
binary_path = File.join(project_path, RELEASE)
|
||||
|
||||
pattern = File.join(binary_path, "*.{so,bundle}")
|
||||
Dir.glob(pattern).each { |library|
|
||||
puts "Requiring #{library}"
|
||||
require library
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
LIBRARY
|
||||
|
||||
EXPORTS
|
||||
Init_sqlite3
|
||||
Init_sqlite3_20
|
||||
Init_sqlite3_22
|
||||
Init_sqlite3_25
|
||||
Init_sqlite3_27
|
||||
-35
@@ -1,35 +0,0 @@
|
||||
/**********************************************************************
|
||||
|
||||
ruby.h -
|
||||
|
||||
$Author$
|
||||
created at: Sun 10 12:06:15 Jun JST 2007
|
||||
|
||||
Copyright (C) 2007-2008 Yukihiro Matsumoto
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef RUBY_H
|
||||
#define RUBY_H 1
|
||||
|
||||
#define HAVE_RUBY_DEFINES_H 1
|
||||
#define HAVE_RUBY_ENCODING_H 1
|
||||
#define HAVE_RUBY_INTERN_H 1
|
||||
#define HAVE_RUBY_IO_H 1
|
||||
#define HAVE_RUBY_MISSING_H 1
|
||||
#define HAVE_RUBY_ONIGURUMA_H 1
|
||||
#define HAVE_RUBY_RE_H 1
|
||||
#define HAVE_RUBY_REGEX_H 1
|
||||
#define HAVE_RUBY_RUBY_H 1
|
||||
#define HAVE_RUBY_ST_H 1
|
||||
#define HAVE_RUBY_THREAD_H 1
|
||||
#define HAVE_RUBY_UTIL_H 1
|
||||
#define HAVE_RUBY_VERSION_H 1
|
||||
#define HAVE_RUBY_VM_H 1
|
||||
#ifdef _WIN32
|
||||
#define HAVE_RUBY_WIN32_H 1
|
||||
#endif
|
||||
|
||||
#include "ruby/ruby.h"
|
||||
|
||||
#endif /* RUBY_H */
|
||||
@@ -1,18 +0,0 @@
|
||||
#if defined __GNUC__
|
||||
#warning use of RClass internals is deprecated
|
||||
#elif defined _MSC_VER || defined __BORLANDC__
|
||||
#pragma message("warning: use of RClass internals is deprecated")
|
||||
#endif
|
||||
|
||||
#ifndef RUBY_BACKWARD_CLASSEXT_H
|
||||
#define RUBY_BACKWARD_CLASSEXT_H 1
|
||||
|
||||
typedef struct rb_deprecated_classext_struct {
|
||||
VALUE super;
|
||||
} rb_deprecated_classext_t;
|
||||
|
||||
#undef RCLASS_SUPER(c)
|
||||
#define RCLASS_EXT(c) ((rb_deprecated_classext_t *)RCLASS(c)->ptr)
|
||||
#define RCLASS_SUPER(c) (RCLASS_EXT(c)->super)
|
||||
|
||||
#endif /* RUBY_BACKWARD_CLASSEXT_H */
|
||||
@@ -1,6 +0,0 @@
|
||||
#if defined __GNUC__
|
||||
#warning use "ruby/io.h" instead of "rubyio.h"
|
||||
#elif defined _MSC_VER || defined __BORLANDC__
|
||||
#pragma message("warning: use \"ruby/io.h\" instead of \"rubyio.h\"")
|
||||
#endif
|
||||
#include "ruby/io.h"
|
||||
@@ -1,56 +0,0 @@
|
||||
/**********************************************************************
|
||||
|
||||
rubysig.h -
|
||||
|
||||
$Author: nobu $
|
||||
$Date: 2012-06-19 18:43:53 +0900 (Tue, 19 Jun 2012) $
|
||||
created at: Wed Aug 16 01:15:38 JST 1995
|
||||
|
||||
Copyright (C) 1993-2008 Yukihiro Matsumoto
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#if defined __GNUC__
|
||||
#warning rubysig.h is obsolete
|
||||
#elif defined _MSC_VER || defined __BORLANDC__
|
||||
#pragma message("warning: rubysig.h is obsolete")
|
||||
#endif
|
||||
|
||||
#ifndef RUBYSIG_H
|
||||
#define RUBYSIG_H
|
||||
#include "ruby/ruby.h"
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#if 0
|
||||
} /* satisfy cc-mode */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility push(default)
|
||||
#endif
|
||||
|
||||
struct rb_blocking_region_buffer;
|
||||
DEPRECATED(RUBY_EXTERN struct rb_blocking_region_buffer *rb_thread_blocking_region_begin(void));
|
||||
DEPRECATED(RUBY_EXTERN void rb_thread_blocking_region_end(struct rb_blocking_region_buffer *));
|
||||
#define TRAP_BEG do {struct rb_blocking_region_buffer *__region = rb_thread_blocking_region_begin();
|
||||
#define TRAP_END rb_thread_blocking_region_end(__region);} while (0)
|
||||
#define RUBY_CRITICAL(statements) do {statements;} while (0)
|
||||
#define DEFER_INTS (0)
|
||||
#define ENABLE_INTS (1)
|
||||
#define ALLOW_INTS do {CHECK_INTS;} while (0)
|
||||
#define CHECK_INTS rb_thread_check_ints()
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility pop
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
#if 0
|
||||
{ /* satisfy cc-mode */
|
||||
#endif
|
||||
} /* extern "C" { */
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -1,6 +0,0 @@
|
||||
#if defined __GNUC__
|
||||
#warning use "ruby/st.h" instead of bare "st.h"
|
||||
#elif defined _MSC_VER || defined __BORLANDC__
|
||||
#pragma message("warning: use \"ruby/st.h\" instead of bare \"st.h\"")
|
||||
#endif
|
||||
#include "ruby/st.h"
|
||||
@@ -1,6 +0,0 @@
|
||||
#if defined __GNUC__
|
||||
#warning use "ruby/util.h" instead of bare "util.h"
|
||||
#elif defined _MSC_VER || defined __BORLANDC__
|
||||
#pragma message("warning: use \"ruby/util.h\" instead of bare \"util.h\"")
|
||||
#endif
|
||||
#include "ruby/util.h"
|
||||
@@ -1,93 +0,0 @@
|
||||
/**********************************************************************
|
||||
|
||||
ruby/debug.h -
|
||||
|
||||
$Author: ko1 $
|
||||
created at: Tue Nov 20 20:35:08 2012
|
||||
|
||||
Copyright (C) 2012 Yukihiro Matsumoto
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef RB_DEBUG_H
|
||||
#define RB_DEBUG_H 1
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#if 0
|
||||
} /* satisfy cc-mode */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility push(default)
|
||||
#endif
|
||||
|
||||
/* Note: This file contains experimental APIs. */
|
||||
/* APIs can be replaced at Ruby 2.0.1 or later */
|
||||
|
||||
/* debug inspector APIs */
|
||||
typedef struct rb_debug_inspector_struct rb_debug_inspector_t;
|
||||
typedef VALUE (*rb_debug_inspector_func_t)(const rb_debug_inspector_t *, void *);
|
||||
|
||||
VALUE rb_debug_inspector_open(rb_debug_inspector_func_t func, void *data);
|
||||
VALUE rb_debug_inspector_frame_self_get(const rb_debug_inspector_t *dc, long index);
|
||||
VALUE rb_debug_inspector_frame_class_get(const rb_debug_inspector_t *dc, long index);
|
||||
VALUE rb_debug_inspector_frame_binding_get(const rb_debug_inspector_t *dc, long index);
|
||||
VALUE rb_debug_inspector_frame_iseq_get(const rb_debug_inspector_t *dc, long index);
|
||||
VALUE rb_debug_inspector_backtrace_locations(const rb_debug_inspector_t *dc);
|
||||
|
||||
/* Old style set_trace_func APIs */
|
||||
|
||||
/* duplicated def of include/ruby/ruby.h */
|
||||
void rb_add_event_hook(rb_event_hook_func_t func, rb_event_flag_t events, VALUE data);
|
||||
int rb_remove_event_hook(rb_event_hook_func_t func);
|
||||
|
||||
int rb_remove_event_hook_with_data(rb_event_hook_func_t func, VALUE data);
|
||||
void rb_thread_add_event_hook(VALUE thval, rb_event_hook_func_t func, rb_event_flag_t events, VALUE data);
|
||||
int rb_thread_remove_event_hook(VALUE thval, rb_event_hook_func_t func);
|
||||
int rb_thread_remove_event_hook_with_data(VALUE thval, rb_event_hook_func_t func, VALUE data);
|
||||
|
||||
/* TracePoint APIs */
|
||||
|
||||
VALUE rb_tracepoint_new(VALUE target_thread_not_supported_yet, rb_event_flag_t events, void (*func)(VALUE, void *), void *data);
|
||||
VALUE rb_tracepoint_enable(VALUE tpval);
|
||||
VALUE rb_tracepoint_disable(VALUE tpval);
|
||||
VALUE rb_tracepoint_enabled_p(VALUE tpval);
|
||||
|
||||
typedef struct rb_trace_arg_struct rb_trace_arg_t;
|
||||
rb_trace_arg_t *rb_tracearg_from_tracepoint(VALUE tpval);
|
||||
|
||||
VALUE rb_tracearg_event(rb_trace_arg_t *trace_arg);
|
||||
VALUE rb_tracearg_lineno(rb_trace_arg_t *trace_arg);
|
||||
VALUE rb_tracearg_path(rb_trace_arg_t *trace_arg);
|
||||
VALUE rb_tracearg_method_id(rb_trace_arg_t *trace_arg);
|
||||
VALUE rb_tracearg_defined_class(rb_trace_arg_t *trace_arg);
|
||||
VALUE rb_tracearg_binding(rb_trace_arg_t *trace_arg);
|
||||
VALUE rb_tracearg_self(rb_trace_arg_t *trace_arg);
|
||||
VALUE rb_tracearg_return_value(rb_trace_arg_t *trace_arg);
|
||||
VALUE rb_tracearg_raised_exception(rb_trace_arg_t *trace_arg);
|
||||
|
||||
/* undocumented advanced tracing APIs */
|
||||
|
||||
typedef enum {
|
||||
RUBY_EVENT_HOOK_FLAG_SAFE = 0x01,
|
||||
RUBY_EVENT_HOOK_FLAG_DELETED = 0x02,
|
||||
RUBY_EVENT_HOOK_FLAG_RAW_ARG = 0x04
|
||||
} rb_event_hook_flag_t;
|
||||
|
||||
void rb_add_event_hook2(rb_event_hook_func_t func, rb_event_flag_t events, VALUE data, rb_event_hook_flag_t hook_flag);
|
||||
void rb_thread_add_event_hook2(VALUE thval, rb_event_hook_func_t func, rb_event_flag_t events, VALUE data, rb_event_hook_flag_t hook_flag);
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility pop
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
#if 0
|
||||
{ /* satisfy cc-mode */
|
||||
#endif
|
||||
} /* extern "C" { */
|
||||
#endif
|
||||
|
||||
#endif /* RUBY_DEBUG_H */
|
||||
@@ -1,264 +0,0 @@
|
||||
/************************************************
|
||||
|
||||
defines.h -
|
||||
|
||||
$Author: ngoto $
|
||||
created at: Wed May 18 00:21:44 JST 1994
|
||||
|
||||
************************************************/
|
||||
|
||||
#ifndef RUBY_DEFINES_H
|
||||
#define RUBY_DEFINES_H 1
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#if 0
|
||||
} /* satisfy cc-mode */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "ruby/config.h"
|
||||
#ifdef RUBY_EXTCONF_H
|
||||
#include RUBY_EXTCONF_H
|
||||
#endif
|
||||
|
||||
#define RUBY
|
||||
|
||||
# include <stddef.h>
|
||||
#ifdef HAVE_STDLIB_H
|
||||
# include <stdlib.h>
|
||||
#endif
|
||||
#ifdef __cplusplus
|
||||
# ifndef HAVE_PROTOTYPES
|
||||
# define HAVE_PROTOTYPES 1
|
||||
# endif
|
||||
# ifndef HAVE_STDARG_PROTOTYPES
|
||||
# define HAVE_STDARG_PROTOTYPES 1
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#undef _
|
||||
#ifdef HAVE_PROTOTYPES
|
||||
# define _(args) args
|
||||
#else
|
||||
# define _(args) ()
|
||||
#endif
|
||||
|
||||
#undef __
|
||||
#ifdef HAVE_STDARG_PROTOTYPES
|
||||
# define __(args) args
|
||||
#else
|
||||
# define __(args) ()
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define ANYARGS ...
|
||||
#else
|
||||
#define ANYARGS
|
||||
#endif
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility push(default)
|
||||
#endif
|
||||
|
||||
#define xmalloc ruby_xmalloc
|
||||
#define xmalloc2 ruby_xmalloc2
|
||||
#define xcalloc ruby_xcalloc
|
||||
#define xrealloc ruby_xrealloc
|
||||
#define xrealloc2 ruby_xrealloc2
|
||||
#define xfree ruby_xfree
|
||||
|
||||
void *xmalloc(size_t);
|
||||
void *xmalloc2(size_t,size_t);
|
||||
void *xcalloc(size_t,size_t);
|
||||
void *xrealloc(void*,size_t);
|
||||
void *xrealloc2(void*,size_t,size_t);
|
||||
void xfree(void*);
|
||||
|
||||
#define STRINGIZE(expr) STRINGIZE0(expr)
|
||||
#ifndef STRINGIZE0
|
||||
#define STRINGIZE0(expr) #expr
|
||||
#endif
|
||||
|
||||
#if SIZEOF_LONG_LONG > 0
|
||||
# define LONG_LONG long long
|
||||
#elif SIZEOF___INT64 > 0
|
||||
# define HAVE_LONG_LONG 1
|
||||
# define LONG_LONG __int64
|
||||
# undef SIZEOF_LONG_LONG
|
||||
# define SIZEOF_LONG_LONG SIZEOF___INT64
|
||||
#endif
|
||||
|
||||
#if SIZEOF_INT*2 <= SIZEOF_LONG_LONG
|
||||
# define BDIGIT unsigned int
|
||||
# define SIZEOF_BDIGITS SIZEOF_INT
|
||||
# define BDIGIT_DBL unsigned LONG_LONG
|
||||
# define BDIGIT_DBL_SIGNED LONG_LONG
|
||||
# define PRI_BDIGIT_PREFIX ""
|
||||
# define PRI_BDIGIT_DBL_PREFIX PRI_LL_PREFIX
|
||||
#elif SIZEOF_INT*2 <= SIZEOF_LONG
|
||||
# define BDIGIT unsigned int
|
||||
# define SIZEOF_BDIGITS SIZEOF_INT
|
||||
# define BDIGIT_DBL unsigned long
|
||||
# define BDIGIT_DBL_SIGNED long
|
||||
# define PRI_BDIGIT_PREFIX ""
|
||||
# define PRI_BDIGIT_DBL_PREFIX "l"
|
||||
#elif SIZEOF_SHORT*2 <= SIZEOF_LONG
|
||||
# define BDIGIT unsigned short
|
||||
# define SIZEOF_BDIGITS SIZEOF_SHORT
|
||||
# define BDIGIT_DBL unsigned long
|
||||
# define BDIGIT_DBL_SIGNED long
|
||||
# define PRI_BDIGIT_PREFIX "h"
|
||||
# define PRI_BDIGIT_DBL_PREFIX "l"
|
||||
#else
|
||||
# define BDIGIT unsigned short
|
||||
# define SIZEOF_BDIGITS (SIZEOF_LONG/2)
|
||||
# define BDIGIT_DBL unsigned long
|
||||
# define BDIGIT_DBL_SIGNED long
|
||||
# define PRI_BDIGIT_PREFIX "h"
|
||||
# define PRI_BDIGIT_DBL_PREFIX "l"
|
||||
#endif
|
||||
|
||||
#define PRIdBDIGIT PRI_BDIGIT_PREFIX"d"
|
||||
#define PRIiBDIGIT PRI_BDIGIT_PREFIX"i"
|
||||
#define PRIoBDIGIT PRI_BDIGIT_PREFIX"o"
|
||||
#define PRIuBDIGIT PRI_BDIGIT_PREFIX"u"
|
||||
#define PRIxBDIGIT PRI_BDIGIT_PREFIX"x"
|
||||
#define PRIXBDIGIT PRI_BDIGIT_PREFIX"X"
|
||||
|
||||
#define PRIdBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"d"
|
||||
#define PRIiBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"i"
|
||||
#define PRIoBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"o"
|
||||
#define PRIuBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"u"
|
||||
#define PRIxBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"x"
|
||||
#define PRIXBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"X"
|
||||
|
||||
#ifdef __CYGWIN__
|
||||
#undef _WIN32
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32) || defined(__EMX__)
|
||||
#define DOSISH 1
|
||||
# define DOSISH_DRIVE_LETTER
|
||||
#endif
|
||||
|
||||
#ifdef AC_APPLE_UNIVERSAL_BUILD
|
||||
#undef WORDS_BIGENDIAN
|
||||
#ifdef __BIG_ENDIAN__
|
||||
#define WORDS_BIGENDIAN
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
#include "ruby/win32.h"
|
||||
#endif
|
||||
|
||||
#if defined(__BEOS__) && !defined(__HAIKU__) && !defined(BONE)
|
||||
#include <net/socket.h> /* intern.h needs fd_set definition */
|
||||
#elif defined (__SYMBIAN32__) && defined (HAVE_SYS_SELECT_H)
|
||||
# include <sys/select.h>
|
||||
#endif
|
||||
|
||||
#ifdef __SYMBIAN32__
|
||||
# define FALSE 0
|
||||
# define TRUE 1
|
||||
#endif
|
||||
|
||||
#ifdef RUBY_EXPORT
|
||||
#undef RUBY_EXTERN
|
||||
|
||||
#ifndef FALSE
|
||||
# define FALSE 0
|
||||
#elif FALSE
|
||||
# error FALSE must be false
|
||||
#endif
|
||||
#ifndef TRUE
|
||||
# define TRUE 1
|
||||
#elif !TRUE
|
||||
# error TRUE must be true
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef RUBY_FUNC_EXPORTED
|
||||
#define RUBY_FUNC_EXPORTED
|
||||
#endif
|
||||
|
||||
#ifndef RUBY_EXTERN
|
||||
#define RUBY_EXTERN extern
|
||||
#endif
|
||||
|
||||
#ifndef EXTERN
|
||||
#define EXTERN RUBY_EXTERN /* deprecated */
|
||||
#endif
|
||||
|
||||
#ifndef RUBY_MBCHAR_MAXSIZE
|
||||
#define RUBY_MBCHAR_MAXSIZE INT_MAX
|
||||
/* MB_CUR_MAX will not work well in C locale */
|
||||
#endif
|
||||
|
||||
#if defined(__sparc)
|
||||
void rb_sparc_flush_register_windows(void);
|
||||
# define FLUSH_REGISTER_WINDOWS rb_sparc_flush_register_windows()
|
||||
#elif defined(__ia64)
|
||||
void *rb_ia64_bsp(void);
|
||||
void rb_ia64_flushrs(void);
|
||||
# define FLUSH_REGISTER_WINDOWS rb_ia64_flushrs()
|
||||
#else
|
||||
# define FLUSH_REGISTER_WINDOWS ((void)0)
|
||||
#endif
|
||||
|
||||
#if defined(DOSISH)
|
||||
#define PATH_SEP ";"
|
||||
#else
|
||||
#define PATH_SEP ":"
|
||||
#endif
|
||||
#define PATH_SEP_CHAR PATH_SEP[0]
|
||||
|
||||
#define PATH_ENV "PATH"
|
||||
|
||||
#if defined(DOSISH) && !defined(__EMX__)
|
||||
#define ENV_IGNORECASE
|
||||
#endif
|
||||
|
||||
#ifndef CASEFOLD_FILESYSTEM
|
||||
# if defined DOSISH
|
||||
# define CASEFOLD_FILESYSTEM 1
|
||||
# else
|
||||
# define CASEFOLD_FILESYSTEM 0
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef DLEXT_MAXLEN
|
||||
#define DLEXT_MAXLEN 4
|
||||
#endif
|
||||
|
||||
#ifndef RUBY_PLATFORM
|
||||
#define RUBY_PLATFORM "unknown-unknown"
|
||||
#endif
|
||||
|
||||
#ifndef RUBY_ALIAS_FUNCTION_TYPE
|
||||
#define RUBY_ALIAS_FUNCTION_TYPE(type, prot, name, args) \
|
||||
type prot {return name args;}
|
||||
#endif
|
||||
#ifndef RUBY_ALIAS_FUNCTION_VOID
|
||||
#define RUBY_ALIAS_FUNCTION_VOID(prot, name, args) \
|
||||
void prot {name args;}
|
||||
#endif
|
||||
#ifndef RUBY_ALIAS_FUNCTION
|
||||
#define RUBY_ALIAS_FUNCTION(prot, name, args) \
|
||||
RUBY_ALIAS_FUNCTION_TYPE(VALUE, prot, name, args)
|
||||
#endif
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility pop
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
#if 0
|
||||
{ /* satisfy cc-mode */
|
||||
#endif
|
||||
} /* extern "C" { */
|
||||
#endif
|
||||
|
||||
#endif /* RUBY_DEFINES_H */
|
||||
@@ -1,32 +0,0 @@
|
||||
/************************************************
|
||||
|
||||
digest.h - header file for ruby digest modules
|
||||
|
||||
$Author: akr $
|
||||
created at: Fri May 25 08:54:56 JST 2001
|
||||
|
||||
|
||||
Copyright (C) 2001-2006 Akinori MUSHA
|
||||
|
||||
$RoughId: digest.h,v 1.3 2001/07/13 15:38:27 knu Exp $
|
||||
$Id: digest.h 25189 2009-10-02 12:04:37Z akr $
|
||||
|
||||
************************************************/
|
||||
|
||||
#include "ruby.h"
|
||||
|
||||
#define RUBY_DIGEST_API_VERSION 2
|
||||
|
||||
typedef void (*rb_digest_hash_init_func_t)(void *);
|
||||
typedef void (*rb_digest_hash_update_func_t)(void *, unsigned char *, size_t);
|
||||
typedef void (*rb_digest_hash_finish_func_t)(void *, unsigned char *);
|
||||
|
||||
typedef struct {
|
||||
int api_version;
|
||||
size_t digest_len;
|
||||
size_t block_len;
|
||||
size_t ctx_size;
|
||||
rb_digest_hash_init_func_t init_func;
|
||||
rb_digest_hash_update_func_t update_func;
|
||||
rb_digest_hash_finish_func_t finish_func;
|
||||
} rb_digest_metadata_t;
|
||||
-217
@@ -1,217 +0,0 @@
|
||||
#ifndef RUBY_DL_H
|
||||
#define RUBY_DL_H
|
||||
|
||||
#include <ruby.h>
|
||||
|
||||
#if !defined(FUNC_CDECL)
|
||||
# define FUNC_CDECL(x) x
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_DLFCN_H)
|
||||
# include <dlfcn.h>
|
||||
# /* some stranger systems may not define all of these */
|
||||
#ifndef RTLD_LAZY
|
||||
#define RTLD_LAZY 0
|
||||
#endif
|
||||
#ifndef RTLD_GLOBAL
|
||||
#define RTLD_GLOBAL 0
|
||||
#endif
|
||||
#ifndef RTLD_NOW
|
||||
#define RTLD_NOW 0
|
||||
#endif
|
||||
#else
|
||||
# if defined(_WIN32)
|
||||
# include <windows.h>
|
||||
# define dlopen(name,flag) ((void*)LoadLibrary(name))
|
||||
# define dlerror() strerror(rb_w32_map_errno(GetLastError()))
|
||||
# define dlsym(handle,name) ((void*)GetProcAddress((handle),(name)))
|
||||
# define RTLD_LAZY -1
|
||||
# define RTLD_NOW -1
|
||||
# define RTLD_GLOBAL -1
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#define MAX_CALLBACK 5
|
||||
#define DLSTACK_TYPE SIGNED_VALUE
|
||||
#define DLSTACK_SIZE (20)
|
||||
#define DLSTACK_PROTO \
|
||||
DLSTACK_TYPE,DLSTACK_TYPE,DLSTACK_TYPE,DLSTACK_TYPE,DLSTACK_TYPE,\
|
||||
DLSTACK_TYPE,DLSTACK_TYPE,DLSTACK_TYPE,DLSTACK_TYPE,DLSTACK_TYPE,\
|
||||
DLSTACK_TYPE,DLSTACK_TYPE,DLSTACK_TYPE,DLSTACK_TYPE,DLSTACK_TYPE,\
|
||||
DLSTACK_TYPE,DLSTACK_TYPE,DLSTACK_TYPE,DLSTACK_TYPE,DLSTACK_TYPE
|
||||
#define DLSTACK_ARGS(stack) \
|
||||
(stack)[0],(stack)[1],(stack)[2],(stack)[3],(stack)[4],\
|
||||
(stack)[5],(stack)[6],(stack)[7],(stack)[8],(stack)[9],\
|
||||
(stack)[10],(stack)[11],(stack)[12],(stack)[13],(stack)[14],\
|
||||
(stack)[15],(stack)[16],(stack)[17],(stack)[18],(stack)[19]
|
||||
|
||||
#define DLSTACK_PROTO0_ void
|
||||
#define DLSTACK_PROTO1_ DLSTACK_TYPE
|
||||
#define DLSTACK_PROTO2_ DLSTACK_PROTO1_, DLSTACK_TYPE
|
||||
#define DLSTACK_PROTO3_ DLSTACK_PROTO2_, DLSTACK_TYPE
|
||||
#define DLSTACK_PROTO4_ DLSTACK_PROTO3_, DLSTACK_TYPE
|
||||
#define DLSTACK_PROTO4_ DLSTACK_PROTO3_, DLSTACK_TYPE
|
||||
#define DLSTACK_PROTO5_ DLSTACK_PROTO4_, DLSTACK_TYPE
|
||||
#define DLSTACK_PROTO6_ DLSTACK_PROTO5_, DLSTACK_TYPE
|
||||
#define DLSTACK_PROTO7_ DLSTACK_PROTO6_, DLSTACK_TYPE
|
||||
#define DLSTACK_PROTO8_ DLSTACK_PROTO7_, DLSTACK_TYPE
|
||||
#define DLSTACK_PROTO9_ DLSTACK_PROTO8_, DLSTACK_TYPE
|
||||
#define DLSTACK_PROTO10_ DLSTACK_PROTO9_, DLSTACK_TYPE
|
||||
#define DLSTACK_PROTO11_ DLSTACK_PROTO10_, DLSTACK_TYPE
|
||||
#define DLSTACK_PROTO12_ DLSTACK_PROTO11_, DLSTACK_TYPE
|
||||
#define DLSTACK_PROTO13_ DLSTACK_PROTO12_, DLSTACK_TYPE
|
||||
#define DLSTACK_PROTO14_ DLSTACK_PROTO13_, DLSTACK_TYPE
|
||||
#define DLSTACK_PROTO14_ DLSTACK_PROTO13_, DLSTACK_TYPE
|
||||
#define DLSTACK_PROTO15_ DLSTACK_PROTO14_, DLSTACK_TYPE
|
||||
#define DLSTACK_PROTO16_ DLSTACK_PROTO15_, DLSTACK_TYPE
|
||||
#define DLSTACK_PROTO17_ DLSTACK_PROTO16_, DLSTACK_TYPE
|
||||
#define DLSTACK_PROTO18_ DLSTACK_PROTO17_, DLSTACK_TYPE
|
||||
#define DLSTACK_PROTO19_ DLSTACK_PROTO18_, DLSTACK_TYPE
|
||||
#define DLSTACK_PROTO20_ DLSTACK_PROTO19_, DLSTACK_TYPE
|
||||
|
||||
/*
|
||||
* Add ",..." as the last argument.
|
||||
* This is required for variable argument functions such
|
||||
* as fprintf() on x86_64-linux.
|
||||
*
|
||||
* http://refspecs.linuxfoundation.org/elf/x86_64-abi-0.95.pdf
|
||||
* page 19:
|
||||
*
|
||||
* For calls that may call functions that use varargs or stdargs
|
||||
* (prototype-less calls or calls to functions containing ellipsis
|
||||
* (...) in the declaration) %al is used as hidden argument to
|
||||
* specify the number of SSE registers used.
|
||||
*/
|
||||
#define DLSTACK_PROTO0 void
|
||||
#define DLSTACK_PROTO1 DLSTACK_PROTO1_, ...
|
||||
#define DLSTACK_PROTO2 DLSTACK_PROTO2_, ...
|
||||
#define DLSTACK_PROTO3 DLSTACK_PROTO3_, ...
|
||||
#define DLSTACK_PROTO4 DLSTACK_PROTO4_, ...
|
||||
#define DLSTACK_PROTO4 DLSTACK_PROTO4_, ...
|
||||
#define DLSTACK_PROTO5 DLSTACK_PROTO5_, ...
|
||||
#define DLSTACK_PROTO6 DLSTACK_PROTO6_, ...
|
||||
#define DLSTACK_PROTO7 DLSTACK_PROTO7_, ...
|
||||
#define DLSTACK_PROTO8 DLSTACK_PROTO8_, ...
|
||||
#define DLSTACK_PROTO9 DLSTACK_PROTO9_, ...
|
||||
#define DLSTACK_PROTO10 DLSTACK_PROTO10_, ...
|
||||
#define DLSTACK_PROTO11 DLSTACK_PROTO11_, ...
|
||||
#define DLSTACK_PROTO12 DLSTACK_PROTO12_, ...
|
||||
#define DLSTACK_PROTO13 DLSTACK_PROTO13_, ...
|
||||
#define DLSTACK_PROTO14 DLSTACK_PROTO14_, ...
|
||||
#define DLSTACK_PROTO14 DLSTACK_PROTO14_, ...
|
||||
#define DLSTACK_PROTO15 DLSTACK_PROTO15_, ...
|
||||
#define DLSTACK_PROTO16 DLSTACK_PROTO16_, ...
|
||||
#define DLSTACK_PROTO17 DLSTACK_PROTO17_, ...
|
||||
#define DLSTACK_PROTO18 DLSTACK_PROTO18_, ...
|
||||
#define DLSTACK_PROTO19 DLSTACK_PROTO19_, ...
|
||||
#define DLSTACK_PROTO20 DLSTACK_PROTO20_, ...
|
||||
|
||||
#define DLSTACK_ARGS0(stack)
|
||||
#define DLSTACK_ARGS1(stack) (stack)[0]
|
||||
#define DLSTACK_ARGS2(stack) DLSTACK_ARGS1(stack), (stack)[1]
|
||||
#define DLSTACK_ARGS3(stack) DLSTACK_ARGS2(stack), (stack)[2]
|
||||
#define DLSTACK_ARGS4(stack) DLSTACK_ARGS3(stack), (stack)[3]
|
||||
#define DLSTACK_ARGS5(stack) DLSTACK_ARGS4(stack), (stack)[4]
|
||||
#define DLSTACK_ARGS6(stack) DLSTACK_ARGS5(stack), (stack)[5]
|
||||
#define DLSTACK_ARGS7(stack) DLSTACK_ARGS6(stack), (stack)[6]
|
||||
#define DLSTACK_ARGS8(stack) DLSTACK_ARGS7(stack), (stack)[7]
|
||||
#define DLSTACK_ARGS9(stack) DLSTACK_ARGS8(stack), (stack)[8]
|
||||
#define DLSTACK_ARGS10(stack) DLSTACK_ARGS9(stack), (stack)[9]
|
||||
#define DLSTACK_ARGS11(stack) DLSTACK_ARGS10(stack), (stack)[10]
|
||||
#define DLSTACK_ARGS12(stack) DLSTACK_ARGS11(stack), (stack)[11]
|
||||
#define DLSTACK_ARGS13(stack) DLSTACK_ARGS12(stack), (stack)[12]
|
||||
#define DLSTACK_ARGS14(stack) DLSTACK_ARGS13(stack), (stack)[13]
|
||||
#define DLSTACK_ARGS15(stack) DLSTACK_ARGS14(stack), (stack)[14]
|
||||
#define DLSTACK_ARGS16(stack) DLSTACK_ARGS15(stack), (stack)[15]
|
||||
#define DLSTACK_ARGS17(stack) DLSTACK_ARGS16(stack), (stack)[16]
|
||||
#define DLSTACK_ARGS18(stack) DLSTACK_ARGS17(stack), (stack)[17]
|
||||
#define DLSTACK_ARGS19(stack) DLSTACK_ARGS18(stack), (stack)[18]
|
||||
#define DLSTACK_ARGS20(stack) DLSTACK_ARGS19(stack), (stack)[19]
|
||||
|
||||
extern VALUE rb_mDL;
|
||||
extern VALUE rb_cDLHandle;
|
||||
extern VALUE rb_cDLSymbol;
|
||||
extern VALUE rb_eDLError;
|
||||
extern VALUE rb_eDLTypeError;
|
||||
|
||||
#define ALIGN_OF(type) offsetof(struct {char align_c; type align_x;}, align_x)
|
||||
|
||||
#define ALIGN_VOIDP ALIGN_OF(void*)
|
||||
#define ALIGN_SHORT ALIGN_OF(short)
|
||||
#define ALIGN_CHAR ALIGN_OF(char)
|
||||
#define ALIGN_INT ALIGN_OF(int)
|
||||
#define ALIGN_LONG ALIGN_OF(long)
|
||||
#if HAVE_LONG_LONG
|
||||
#define ALIGN_LONG_LONG ALIGN_OF(LONG_LONG)
|
||||
#endif
|
||||
#define ALIGN_FLOAT ALIGN_OF(float)
|
||||
#define ALIGN_DOUBLE ALIGN_OF(double)
|
||||
|
||||
#define DLALIGN(ptr,offset,align) \
|
||||
((offset) += ((align) - ((uintptr_t)((char *)(ptr) + (offset))) % (align)) % (align))
|
||||
|
||||
|
||||
#define DLTYPE_VOID 0
|
||||
#define DLTYPE_VOIDP 1
|
||||
#define DLTYPE_CHAR 2
|
||||
#define DLTYPE_SHORT 3
|
||||
#define DLTYPE_INT 4
|
||||
#define DLTYPE_LONG 5
|
||||
#if HAVE_LONG_LONG
|
||||
#define DLTYPE_LONG_LONG 6
|
||||
#endif
|
||||
#define DLTYPE_FLOAT 7
|
||||
#define DLTYPE_DOUBLE 8
|
||||
#define MAX_DLTYPE 9
|
||||
|
||||
#if SIZEOF_VOIDP == SIZEOF_LONG
|
||||
# define PTR2NUM(x) (ULONG2NUM((unsigned long)(x)))
|
||||
# define NUM2PTR(x) ((void*)(NUM2ULONG(x)))
|
||||
#else
|
||||
/* # error --->> Ruby/DL2 requires sizeof(void*) == sizeof(long) to be compiled. <<--- */
|
||||
# define PTR2NUM(x) (ULL2NUM((unsigned long long)(x)))
|
||||
# define NUM2PTR(x) ((void*)(NUM2ULL(x)))
|
||||
#endif
|
||||
|
||||
#define BOOL2INT(x) (((x) == Qtrue)?1:0)
|
||||
#define INT2BOOL(x) ((x)?Qtrue:Qfalse)
|
||||
|
||||
typedef void (*freefunc_t)(void*);
|
||||
|
||||
struct dl_handle {
|
||||
void *ptr;
|
||||
int open;
|
||||
int enable_close;
|
||||
};
|
||||
|
||||
|
||||
struct cfunc_data {
|
||||
void *ptr;
|
||||
char *name;
|
||||
int type;
|
||||
ID calltype;
|
||||
VALUE wrap;
|
||||
};
|
||||
extern ID rbdl_id_cdecl;
|
||||
extern ID rbdl_id_stdcall;
|
||||
#define CFUNC_CDECL (rbdl_id_cdecl)
|
||||
#define CFUNC_STDCALL (rbdl_id_stdcall)
|
||||
|
||||
struct ptr_data {
|
||||
void *ptr;
|
||||
long size;
|
||||
freefunc_t free;
|
||||
VALUE wrap[2];
|
||||
};
|
||||
|
||||
#define RDL_HANDLE(obj) ((struct dl_handle *)(DATA_PTR(obj)))
|
||||
#define RCFUNC_DATA(obj) ((struct cfunc_data *)(DATA_PTR(obj)))
|
||||
#define RPTR_DATA(obj) ((struct ptr_data *)(DATA_PTR(obj)))
|
||||
|
||||
VALUE rb_dlcfunc_new(void (*func)(), int dltype, const char * name, ID calltype);
|
||||
int rb_dlcfunc_kind_p(VALUE func);
|
||||
VALUE rb_dlptr_new(void *ptr, long size, freefunc_t func);
|
||||
VALUE rb_dlptr_new2(VALUE klass, void *ptr, long size, freefunc_t func);
|
||||
VALUE rb_dlptr_malloc(long size, freefunc_t func);
|
||||
|
||||
#endif
|
||||
@@ -1,354 +0,0 @@
|
||||
/**********************************************************************
|
||||
|
||||
encoding.h -
|
||||
|
||||
$Author: matz $
|
||||
created at: Thu May 24 11:49:41 JST 2007
|
||||
|
||||
Copyright (C) 2007 Yukihiro Matsumoto
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef RUBY_ENCODING_H
|
||||
#define RUBY_ENCODING_H 1
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#if 0
|
||||
} /* satisfy cc-mode */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <stdarg.h>
|
||||
#include "ruby/oniguruma.h"
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility push(default)
|
||||
#endif
|
||||
|
||||
#define ENCODING_INLINE_MAX 1023
|
||||
#define ENCODING_SHIFT (FL_USHIFT+10)
|
||||
#define ENCODING_MASK (((VALUE)ENCODING_INLINE_MAX)<<ENCODING_SHIFT)
|
||||
|
||||
#define ENCODING_SET_INLINED(obj,i) do {\
|
||||
RBASIC(obj)->flags &= ~ENCODING_MASK;\
|
||||
RBASIC(obj)->flags |= (VALUE)(i) << ENCODING_SHIFT;\
|
||||
} while (0)
|
||||
#define ENCODING_SET(obj,i) do {\
|
||||
VALUE rb_encoding_set_obj = (obj); \
|
||||
int encoding_set_enc_index = (i); \
|
||||
if (encoding_set_enc_index < ENCODING_INLINE_MAX) \
|
||||
ENCODING_SET_INLINED(rb_encoding_set_obj, encoding_set_enc_index); \
|
||||
else \
|
||||
rb_enc_set_index(rb_encoding_set_obj, encoding_set_enc_index); \
|
||||
} while (0)
|
||||
|
||||
#define ENCODING_GET_INLINED(obj) (int)((RBASIC(obj)->flags & ENCODING_MASK)>>ENCODING_SHIFT)
|
||||
#define ENCODING_GET(obj) \
|
||||
(ENCODING_GET_INLINED(obj) != ENCODING_INLINE_MAX ? \
|
||||
ENCODING_GET_INLINED(obj) : \
|
||||
rb_enc_get_index(obj))
|
||||
|
||||
#define ENCODING_IS_ASCII8BIT(obj) (ENCODING_GET_INLINED(obj) == 0)
|
||||
|
||||
#define ENCODING_MAXNAMELEN 42
|
||||
|
||||
#define ENC_CODERANGE_MASK ((int)(FL_USER8|FL_USER9))
|
||||
#define ENC_CODERANGE_UNKNOWN 0
|
||||
#define ENC_CODERANGE_7BIT ((int)FL_USER8)
|
||||
#define ENC_CODERANGE_VALID ((int)FL_USER9)
|
||||
#define ENC_CODERANGE_BROKEN ((int)(FL_USER8|FL_USER9))
|
||||
#define ENC_CODERANGE(obj) ((int)RBASIC(obj)->flags & ENC_CODERANGE_MASK)
|
||||
#define ENC_CODERANGE_ASCIIONLY(obj) (ENC_CODERANGE(obj) == ENC_CODERANGE_7BIT)
|
||||
#define ENC_CODERANGE_SET(obj,cr) (RBASIC(obj)->flags = \
|
||||
(RBASIC(obj)->flags & ~ENC_CODERANGE_MASK) | (cr))
|
||||
#define ENC_CODERANGE_CLEAR(obj) ENC_CODERANGE_SET((obj),0)
|
||||
|
||||
/* assumed ASCII compatibility */
|
||||
#define ENC_CODERANGE_AND(a, b) \
|
||||
((a) == ENC_CODERANGE_7BIT ? (b) : \
|
||||
(a) == ENC_CODERANGE_VALID ? ((b) == ENC_CODERANGE_7BIT ? ENC_CODERANGE_VALID : (b)) : \
|
||||
ENC_CODERANGE_UNKNOWN)
|
||||
|
||||
#define ENCODING_CODERANGE_SET(obj, encindex, cr) \
|
||||
do { \
|
||||
VALUE rb_encoding_coderange_obj = (obj); \
|
||||
ENCODING_SET(rb_encoding_coderange_obj, (encindex)); \
|
||||
ENC_CODERANGE_SET(rb_encoding_coderange_obj, (cr)); \
|
||||
} while (0)
|
||||
|
||||
typedef OnigEncodingType rb_encoding;
|
||||
|
||||
int rb_char_to_option_kcode(int c, int *option, int *kcode);
|
||||
|
||||
int rb_enc_replicate(const char *, rb_encoding *);
|
||||
int rb_define_dummy_encoding(const char *);
|
||||
#define rb_enc_to_index(enc) ((enc) ? ENC_TO_ENCINDEX(enc) : 0)
|
||||
int rb_enc_get_index(VALUE obj);
|
||||
void rb_enc_set_index(VALUE obj, int encindex);
|
||||
int rb_enc_find_index(const char *name);
|
||||
int rb_to_encoding_index(VALUE);
|
||||
rb_encoding* rb_to_encoding(VALUE);
|
||||
rb_encoding* rb_find_encoding(VALUE);
|
||||
rb_encoding* rb_enc_get(VALUE);
|
||||
rb_encoding* rb_enc_compatible(VALUE,VALUE);
|
||||
rb_encoding* rb_enc_check(VALUE,VALUE);
|
||||
VALUE rb_enc_associate_index(VALUE, int);
|
||||
VALUE rb_enc_associate(VALUE, rb_encoding*);
|
||||
void rb_enc_copy(VALUE dst, VALUE src);
|
||||
|
||||
VALUE rb_enc_str_new(const char*, long, rb_encoding*);
|
||||
VALUE rb_enc_reg_new(const char*, long, rb_encoding*, int);
|
||||
PRINTF_ARGS(VALUE rb_enc_sprintf(rb_encoding *, const char*, ...), 2, 3);
|
||||
VALUE rb_enc_vsprintf(rb_encoding *, const char*, va_list);
|
||||
long rb_enc_strlen(const char*, const char*, rb_encoding*);
|
||||
char* rb_enc_nth(const char*, const char*, long, rb_encoding*);
|
||||
VALUE rb_obj_encoding(VALUE);
|
||||
VALUE rb_enc_str_buf_cat(VALUE str, const char *ptr, long len, rb_encoding *enc);
|
||||
VALUE rb_enc_uint_chr(unsigned int code, rb_encoding *enc);
|
||||
|
||||
VALUE rb_external_str_new_with_enc(const char *ptr, long len, rb_encoding *);
|
||||
VALUE rb_str_export_to_enc(VALUE, rb_encoding *);
|
||||
VALUE rb_str_conv_enc(VALUE str, rb_encoding *from, rb_encoding *to);
|
||||
VALUE rb_str_conv_enc_opts(VALUE str, rb_encoding *from, rb_encoding *to, int ecflags, VALUE ecopts);
|
||||
|
||||
PRINTF_ARGS(NORETURN(void rb_enc_raise(rb_encoding *, VALUE, const char*, ...)), 3, 4);
|
||||
|
||||
/* index -> rb_encoding */
|
||||
rb_encoding* rb_enc_from_index(int idx);
|
||||
|
||||
/* name -> rb_encoding */
|
||||
rb_encoding * rb_enc_find(const char *name);
|
||||
|
||||
/* rb_encoding * -> name */
|
||||
#define rb_enc_name(enc) (enc)->name
|
||||
|
||||
/* rb_encoding * -> minlen/maxlen */
|
||||
#define rb_enc_mbminlen(enc) (enc)->min_enc_len
|
||||
#define rb_enc_mbmaxlen(enc) (enc)->max_enc_len
|
||||
|
||||
/* -> mbclen (no error notification: 0 < ret <= e-p, no exception) */
|
||||
int rb_enc_mbclen(const char *p, const char *e, rb_encoding *enc);
|
||||
|
||||
/* -> mbclen (only for valid encoding) */
|
||||
int rb_enc_fast_mbclen(const char *p, const char *e, rb_encoding *enc);
|
||||
|
||||
/* -> chlen, invalid or needmore */
|
||||
int rb_enc_precise_mbclen(const char *p, const char *e, rb_encoding *enc);
|
||||
#define MBCLEN_CHARFOUND_P(ret) ONIGENC_MBCLEN_CHARFOUND_P(ret)
|
||||
#define MBCLEN_CHARFOUND_LEN(ret) ONIGENC_MBCLEN_CHARFOUND_LEN(ret)
|
||||
#define MBCLEN_INVALID_P(ret) ONIGENC_MBCLEN_INVALID_P(ret)
|
||||
#define MBCLEN_NEEDMORE_P(ret) ONIGENC_MBCLEN_NEEDMORE_P(ret)
|
||||
#define MBCLEN_NEEDMORE_LEN(ret) ONIGENC_MBCLEN_NEEDMORE_LEN(ret)
|
||||
|
||||
/* -> 0x00..0x7f, -1 */
|
||||
int rb_enc_ascget(const char *p, const char *e, int *len, rb_encoding *enc);
|
||||
|
||||
|
||||
/* -> code (and len) or raise exception */
|
||||
unsigned int rb_enc_codepoint_len(const char *p, const char *e, int *len, rb_encoding *enc);
|
||||
|
||||
/* prototype for obsolete function */
|
||||
unsigned int rb_enc_codepoint(const char *p, const char *e, rb_encoding *enc);
|
||||
/* overriding macro */
|
||||
#define rb_enc_codepoint(p,e,enc) rb_enc_codepoint_len((p),(e),0,(enc))
|
||||
#define rb_enc_mbc_to_codepoint(p, e, enc) ONIGENC_MBC_TO_CODE((enc),(UChar*)(p),(UChar*)(e))
|
||||
|
||||
/* -> codelen>0 or raise exception */
|
||||
int rb_enc_codelen(int code, rb_encoding *enc);
|
||||
|
||||
/* code,ptr,encoding -> write buf */
|
||||
#define rb_enc_mbcput(c,buf,enc) ONIGENC_CODE_TO_MBC((enc),(c),(UChar*)(buf))
|
||||
|
||||
/* start, ptr, end, encoding -> prev_char */
|
||||
#define rb_enc_prev_char(s,p,e,enc) ((char *)onigenc_get_prev_char_head((enc),(UChar*)(s),(UChar*)(p),(UChar*)(e)))
|
||||
/* start, ptr, end, encoding -> next_char */
|
||||
#define rb_enc_left_char_head(s,p,e,enc) ((char *)onigenc_get_left_adjust_char_head((enc),(UChar*)(s),(UChar*)(p),(UChar*)(e)))
|
||||
#define rb_enc_right_char_head(s,p,e,enc) ((char *)onigenc_get_right_adjust_char_head((enc),(UChar*)(s),(UChar*)(p),(UChar*)(e)))
|
||||
#define rb_enc_step_back(s,p,e,n,enc) ((char *)onigenc_step_back((enc),(UChar*)(s),(UChar*)(p),(UChar*)(e),(int)(n)))
|
||||
|
||||
/* ptr, ptr, encoding -> newline_or_not */
|
||||
#define rb_enc_is_newline(p,end,enc) ONIGENC_IS_MBC_NEWLINE((enc),(UChar*)(p),(UChar*)(end))
|
||||
|
||||
#define rb_enc_isctype(c,t,enc) ONIGENC_IS_CODE_CTYPE((enc),(c),(t))
|
||||
#define rb_enc_isascii(c,enc) ONIGENC_IS_CODE_ASCII(c)
|
||||
#define rb_enc_isalpha(c,enc) ONIGENC_IS_CODE_ALPHA((enc),(c))
|
||||
#define rb_enc_islower(c,enc) ONIGENC_IS_CODE_LOWER((enc),(c))
|
||||
#define rb_enc_isupper(c,enc) ONIGENC_IS_CODE_UPPER((enc),(c))
|
||||
#define rb_enc_ispunct(c,enc) ONIGENC_IS_CODE_PUNCT((enc),(c))
|
||||
#define rb_enc_isalnum(c,enc) ONIGENC_IS_CODE_ALNUM((enc),(c))
|
||||
#define rb_enc_isprint(c,enc) ONIGENC_IS_CODE_PRINT((enc),(c))
|
||||
#define rb_enc_isspace(c,enc) ONIGENC_IS_CODE_SPACE((enc),(c))
|
||||
#define rb_enc_isdigit(c,enc) ONIGENC_IS_CODE_DIGIT((enc),(c))
|
||||
|
||||
#define rb_enc_asciicompat(enc) (rb_enc_mbminlen(enc)==1 && !rb_enc_dummy_p(enc))
|
||||
|
||||
int rb_enc_casefold(char *to, const char *p, const char *e, rb_encoding *enc);
|
||||
int rb_enc_toupper(int c, rb_encoding *enc);
|
||||
int rb_enc_tolower(int c, rb_encoding *enc);
|
||||
ID rb_intern3(const char*, long, rb_encoding*);
|
||||
ID rb_interned_id_p(const char *, long, rb_encoding *);
|
||||
int rb_enc_symname_p(const char*, rb_encoding*);
|
||||
int rb_enc_symname2_p(const char*, long, rb_encoding*);
|
||||
int rb_enc_str_coderange(VALUE);
|
||||
long rb_str_coderange_scan_restartable(const char*, const char*, rb_encoding*, int*);
|
||||
int rb_enc_str_asciionly_p(VALUE);
|
||||
#define rb_enc_str_asciicompat_p(str) rb_enc_asciicompat(rb_enc_get(str))
|
||||
VALUE rb_enc_from_encoding(rb_encoding *enc);
|
||||
int rb_enc_unicode_p(rb_encoding *enc);
|
||||
rb_encoding *rb_ascii8bit_encoding(void);
|
||||
rb_encoding *rb_utf8_encoding(void);
|
||||
rb_encoding *rb_usascii_encoding(void);
|
||||
rb_encoding *rb_locale_encoding(void);
|
||||
rb_encoding *rb_filesystem_encoding(void);
|
||||
rb_encoding *rb_default_external_encoding(void);
|
||||
rb_encoding *rb_default_internal_encoding(void);
|
||||
int rb_ascii8bit_encindex(void);
|
||||
int rb_utf8_encindex(void);
|
||||
int rb_usascii_encindex(void);
|
||||
int rb_locale_encindex(void);
|
||||
int rb_filesystem_encindex(void);
|
||||
VALUE rb_enc_default_external(void);
|
||||
VALUE rb_enc_default_internal(void);
|
||||
void rb_enc_set_default_external(VALUE encoding);
|
||||
void rb_enc_set_default_internal(VALUE encoding);
|
||||
VALUE rb_locale_charmap(VALUE klass);
|
||||
long rb_memsearch(const void*,long,const void*,long,rb_encoding*);
|
||||
char *rb_enc_path_next(const char *,const char *,rb_encoding*);
|
||||
char *rb_enc_path_skip_prefix(const char *,const char *,rb_encoding*);
|
||||
char *rb_enc_path_last_separator(const char *,const char *,rb_encoding*);
|
||||
char *rb_enc_path_end(const char *,const char *,rb_encoding*);
|
||||
const char *ruby_enc_find_basename(const char *name, long *baselen, long *alllen, rb_encoding *enc);
|
||||
const char *ruby_enc_find_extname(const char *name, long *len, rb_encoding *enc);
|
||||
ID rb_check_id_cstr(const char *ptr, long len, rb_encoding *enc);
|
||||
|
||||
RUBY_EXTERN VALUE rb_cEncoding;
|
||||
#define ENC_DUMMY_FLAG (1<<24)
|
||||
#define ENC_INDEX_MASK (~(~0U<<24))
|
||||
|
||||
#define ENC_TO_ENCINDEX(enc) (int)((enc)->ruby_encoding_index & ENC_INDEX_MASK)
|
||||
|
||||
#define ENC_DUMMY_P(enc) ((enc)->ruby_encoding_index & ENC_DUMMY_FLAG)
|
||||
#define ENC_SET_DUMMY(enc) ((enc)->ruby_encoding_index |= ENC_DUMMY_FLAG)
|
||||
|
||||
static inline int
|
||||
rb_enc_dummy_p(rb_encoding *enc)
|
||||
{
|
||||
return ENC_DUMMY_P(enc) != 0;
|
||||
}
|
||||
|
||||
/* econv stuff */
|
||||
|
||||
typedef enum {
|
||||
econv_invalid_byte_sequence,
|
||||
econv_undefined_conversion,
|
||||
econv_destination_buffer_full,
|
||||
econv_source_buffer_empty,
|
||||
econv_finished,
|
||||
econv_after_output,
|
||||
econv_incomplete_input
|
||||
} rb_econv_result_t;
|
||||
|
||||
typedef struct rb_econv_t rb_econv_t;
|
||||
|
||||
VALUE rb_str_encode(VALUE str, VALUE to, int ecflags, VALUE ecopts);
|
||||
int rb_econv_has_convpath_p(const char* from_encoding, const char* to_encoding);
|
||||
|
||||
int rb_econv_prepare_options(VALUE opthash, VALUE *ecopts, int ecflags);
|
||||
int rb_econv_prepare_opts(VALUE opthash, VALUE *ecopts);
|
||||
|
||||
rb_econv_t *rb_econv_open(const char *source_encoding, const char *destination_encoding, int ecflags);
|
||||
rb_econv_t *rb_econv_open_opts(const char *source_encoding, const char *destination_encoding, int ecflags, VALUE ecopts);
|
||||
|
||||
rb_econv_result_t rb_econv_convert(rb_econv_t *ec,
|
||||
const unsigned char **source_buffer_ptr, const unsigned char *source_buffer_end,
|
||||
unsigned char **destination_buffer_ptr, unsigned char *destination_buffer_end,
|
||||
int flags);
|
||||
void rb_econv_close(rb_econv_t *ec);
|
||||
|
||||
/* result: 0:success -1:failure */
|
||||
int rb_econv_set_replacement(rb_econv_t *ec, const unsigned char *str, size_t len, const char *encname);
|
||||
|
||||
/* result: 0:success -1:failure */
|
||||
int rb_econv_decorate_at_first(rb_econv_t *ec, const char *decorator_name);
|
||||
int rb_econv_decorate_at_last(rb_econv_t *ec, const char *decorator_name);
|
||||
|
||||
VALUE rb_econv_open_exc(const char *senc, const char *denc, int ecflags);
|
||||
|
||||
/* result: 0:success -1:failure */
|
||||
int rb_econv_insert_output(rb_econv_t *ec,
|
||||
const unsigned char *str, size_t len, const char *str_encoding);
|
||||
|
||||
/* encoding that rb_econv_insert_output doesn't need conversion */
|
||||
const char *rb_econv_encoding_to_insert_output(rb_econv_t *ec);
|
||||
|
||||
/* raise an error if the last rb_econv_convert is error */
|
||||
void rb_econv_check_error(rb_econv_t *ec);
|
||||
|
||||
/* returns an exception object or nil */
|
||||
VALUE rb_econv_make_exception(rb_econv_t *ec);
|
||||
|
||||
int rb_econv_putbackable(rb_econv_t *ec);
|
||||
void rb_econv_putback(rb_econv_t *ec, unsigned char *p, int n);
|
||||
|
||||
/* returns the corresponding ASCII compatible encoding for encname,
|
||||
* or NULL if encname is not ASCII incompatible encoding. */
|
||||
const char *rb_econv_asciicompat_encoding(const char *encname);
|
||||
|
||||
VALUE rb_econv_str_convert(rb_econv_t *ec, VALUE src, int flags);
|
||||
VALUE rb_econv_substr_convert(rb_econv_t *ec, VALUE src, long byteoff, long bytesize, int flags);
|
||||
VALUE rb_econv_str_append(rb_econv_t *ec, VALUE src, VALUE dst, int flags);
|
||||
VALUE rb_econv_substr_append(rb_econv_t *ec, VALUE src, long byteoff, long bytesize, VALUE dst, int flags);
|
||||
|
||||
void rb_econv_binmode(rb_econv_t *ec);
|
||||
|
||||
/* flags for rb_econv_open */
|
||||
|
||||
#define ECONV_ERROR_HANDLER_MASK 0x000000ff
|
||||
|
||||
#define ECONV_INVALID_MASK 0x0000000f
|
||||
#define ECONV_INVALID_REPLACE 0x00000002
|
||||
|
||||
#define ECONV_UNDEF_MASK 0x000000f0
|
||||
#define ECONV_UNDEF_REPLACE 0x00000020
|
||||
#define ECONV_UNDEF_HEX_CHARREF 0x00000030
|
||||
|
||||
#define ECONV_DECORATOR_MASK 0x0000ff00
|
||||
#define ECONV_NEWLINE_DECORATOR_MASK 0x00003f00
|
||||
#define ECONV_NEWLINE_DECORATOR_READ_MASK 0x00000f00
|
||||
#define ECONV_NEWLINE_DECORATOR_WRITE_MASK 0x00003000
|
||||
|
||||
#define ECONV_UNIVERSAL_NEWLINE_DECORATOR 0x00000100
|
||||
#define ECONV_CRLF_NEWLINE_DECORATOR 0x00001000
|
||||
#define ECONV_CR_NEWLINE_DECORATOR 0x00002000
|
||||
#define ECONV_XML_TEXT_DECORATOR 0x00004000
|
||||
#define ECONV_XML_ATTR_CONTENT_DECORATOR 0x00008000
|
||||
|
||||
#define ECONV_STATEFUL_DECORATOR_MASK 0x00f00000
|
||||
#define ECONV_XML_ATTR_QUOTE_DECORATOR 0x00100000
|
||||
|
||||
#if defined(RUBY_TEST_CRLF_ENVIRONMENT) || defined(_WIN32)
|
||||
#define ECONV_DEFAULT_NEWLINE_DECORATOR ECONV_CRLF_NEWLINE_DECORATOR
|
||||
#else
|
||||
#define ECONV_DEFAULT_NEWLINE_DECORATOR 0
|
||||
#endif
|
||||
|
||||
/* end of flags for rb_econv_open */
|
||||
|
||||
/* flags for rb_econv_convert */
|
||||
#define ECONV_PARTIAL_INPUT 0x00010000
|
||||
#define ECONV_AFTER_OUTPUT 0x00020000
|
||||
/* end of flags for rb_econv_convert */
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility pop
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
#if 0
|
||||
{ /* satisfy cc-mode */
|
||||
#endif
|
||||
} /* extern "C" { */
|
||||
#endif
|
||||
|
||||
#endif /* RUBY_ENCODING_H */
|
||||
@@ -1,929 +0,0 @@
|
||||
/**********************************************************************
|
||||
|
||||
intern.h -
|
||||
|
||||
$Author: nagachika $
|
||||
created at: Thu Jun 10 14:22:17 JST 1993
|
||||
|
||||
Copyright (C) 1993-2007 Yukihiro Matsumoto
|
||||
Copyright (C) 2000 Network Applied Communication Laboratory, Inc.
|
||||
Copyright (C) 2000 Information-technology Promotion Agency, Japan
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef RUBY_INTERN_H
|
||||
#define RUBY_INTERN_H 1
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#if 0
|
||||
} /* satisfy cc-mode */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "ruby/defines.h"
|
||||
#ifdef RUBY_EXTCONF_H
|
||||
#include RUBY_EXTCONF_H
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STDARG_PROTOTYPES
|
||||
# include <stdarg.h>
|
||||
#else
|
||||
# include <varargs.h>
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_SYS_TYPES_H)
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_SYS_TIME_H)
|
||||
#include <sys/time.h>
|
||||
#endif
|
||||
|
||||
#include "ruby/st.h"
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility push(default)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Functions and variables that are used by more than one source file of
|
||||
* the kernel.
|
||||
*/
|
||||
|
||||
#define UNLIMITED_ARGUMENTS (-1)
|
||||
|
||||
/* array.c */
|
||||
void rb_mem_clear(register VALUE*, register long);
|
||||
VALUE rb_assoc_new(VALUE, VALUE);
|
||||
VALUE rb_check_array_type(VALUE);
|
||||
VALUE rb_ary_new(void);
|
||||
VALUE rb_ary_new2(long);
|
||||
VALUE rb_ary_new3(long,...);
|
||||
VALUE rb_ary_new4(long, const VALUE *);
|
||||
VALUE rb_ary_tmp_new(long);
|
||||
void rb_ary_free(VALUE);
|
||||
void rb_ary_modify(VALUE);
|
||||
VALUE rb_ary_freeze(VALUE);
|
||||
VALUE rb_ary_shared_with_p(VALUE, VALUE);
|
||||
VALUE rb_ary_aref(int, VALUE*, VALUE);
|
||||
VALUE rb_ary_subseq(VALUE, long, long);
|
||||
void rb_ary_store(VALUE, long, VALUE);
|
||||
VALUE rb_ary_dup(VALUE);
|
||||
VALUE rb_ary_resurrect(VALUE ary);
|
||||
VALUE rb_ary_to_ary(VALUE);
|
||||
VALUE rb_ary_to_s(VALUE);
|
||||
VALUE rb_ary_push(VALUE, VALUE);
|
||||
VALUE rb_ary_pop(VALUE);
|
||||
VALUE rb_ary_shift(VALUE);
|
||||
VALUE rb_ary_unshift(VALUE, VALUE);
|
||||
VALUE rb_ary_entry(VALUE, long);
|
||||
VALUE rb_ary_each(VALUE);
|
||||
VALUE rb_ary_join(VALUE, VALUE);
|
||||
VALUE rb_ary_reverse(VALUE);
|
||||
VALUE rb_ary_rotate(VALUE, long);
|
||||
VALUE rb_ary_sort(VALUE);
|
||||
VALUE rb_ary_sort_bang(VALUE);
|
||||
VALUE rb_ary_delete(VALUE, VALUE);
|
||||
VALUE rb_ary_delete_at(VALUE, long);
|
||||
VALUE rb_ary_clear(VALUE);
|
||||
VALUE rb_ary_plus(VALUE, VALUE);
|
||||
VALUE rb_ary_concat(VALUE, VALUE);
|
||||
VALUE rb_ary_assoc(VALUE, VALUE);
|
||||
VALUE rb_ary_rassoc(VALUE, VALUE);
|
||||
VALUE rb_ary_includes(VALUE, VALUE);
|
||||
VALUE rb_ary_cmp(VALUE, VALUE);
|
||||
VALUE rb_ary_replace(VALUE copy, VALUE orig);
|
||||
VALUE rb_get_values_at(VALUE, long, int, VALUE*, VALUE(*)(VALUE,long));
|
||||
VALUE rb_ary_resize(VALUE ary, long len);
|
||||
/* bignum.c */
|
||||
VALUE rb_big_new(long, int);
|
||||
int rb_bigzero_p(VALUE x);
|
||||
VALUE rb_big_clone(VALUE);
|
||||
void rb_big_2comp(VALUE);
|
||||
VALUE rb_big_norm(VALUE);
|
||||
void rb_big_resize(VALUE big, long len);
|
||||
VALUE rb_uint2big(VALUE);
|
||||
VALUE rb_int2big(SIGNED_VALUE);
|
||||
VALUE rb_uint2inum(VALUE);
|
||||
VALUE rb_int2inum(SIGNED_VALUE);
|
||||
VALUE rb_cstr_to_inum(const char*, int, int);
|
||||
VALUE rb_str_to_inum(VALUE, int, int);
|
||||
VALUE rb_cstr2inum(const char*, int);
|
||||
VALUE rb_str2inum(VALUE, int);
|
||||
VALUE rb_big2str(VALUE, int);
|
||||
VALUE rb_big2str0(VALUE, int, int);
|
||||
SIGNED_VALUE rb_big2long(VALUE);
|
||||
#define rb_big2int(x) rb_big2long(x)
|
||||
VALUE rb_big2ulong(VALUE);
|
||||
#define rb_big2uint(x) rb_big2ulong(x)
|
||||
VALUE rb_big2ulong_pack(VALUE x);
|
||||
#if HAVE_LONG_LONG
|
||||
VALUE rb_ll2inum(LONG_LONG);
|
||||
VALUE rb_ull2inum(unsigned LONG_LONG);
|
||||
LONG_LONG rb_big2ll(VALUE);
|
||||
unsigned LONG_LONG rb_big2ull(VALUE);
|
||||
#endif /* HAVE_LONG_LONG */
|
||||
DEPRECATED(void rb_quad_pack(char*,VALUE));
|
||||
DEPRECATED(VALUE rb_quad_unpack(const char*,int));
|
||||
void rb_big_pack(VALUE val, unsigned long *buf, long num_longs);
|
||||
VALUE rb_big_unpack(unsigned long *buf, long num_longs);
|
||||
int rb_uv_to_utf8(char[6],unsigned long);
|
||||
VALUE rb_dbl2big(double);
|
||||
double rb_big2dbl(VALUE);
|
||||
VALUE rb_big_cmp(VALUE, VALUE);
|
||||
VALUE rb_big_eq(VALUE, VALUE);
|
||||
VALUE rb_big_eql(VALUE, VALUE);
|
||||
VALUE rb_big_plus(VALUE, VALUE);
|
||||
VALUE rb_big_minus(VALUE, VALUE);
|
||||
VALUE rb_big_mul(VALUE, VALUE);
|
||||
VALUE rb_big_div(VALUE, VALUE);
|
||||
VALUE rb_big_idiv(VALUE, VALUE);
|
||||
VALUE rb_big_modulo(VALUE, VALUE);
|
||||
VALUE rb_big_divmod(VALUE, VALUE);
|
||||
VALUE rb_big_pow(VALUE, VALUE);
|
||||
VALUE rb_big_and(VALUE, VALUE);
|
||||
VALUE rb_big_or(VALUE, VALUE);
|
||||
VALUE rb_big_xor(VALUE, VALUE);
|
||||
VALUE rb_big_lshift(VALUE, VALUE);
|
||||
VALUE rb_big_rshift(VALUE, VALUE);
|
||||
/* rational.c */
|
||||
VALUE rb_rational_raw(VALUE, VALUE);
|
||||
#define rb_rational_raw1(x) rb_rational_raw((x), INT2FIX(1))
|
||||
#define rb_rational_raw2(x,y) rb_rational_raw((x), (y))
|
||||
VALUE rb_rational_new(VALUE, VALUE);
|
||||
#define rb_rational_new1(x) rb_rational_new((x), INT2FIX(1))
|
||||
#define rb_rational_new2(x,y) rb_rational_new((x), (y))
|
||||
VALUE rb_Rational(VALUE, VALUE);
|
||||
#define rb_Rational1(x) rb_Rational((x), INT2FIX(1))
|
||||
#define rb_Rational2(x,y) rb_Rational((x), (y))
|
||||
/* complex.c */
|
||||
VALUE rb_complex_raw(VALUE, VALUE);
|
||||
#define rb_complex_raw1(x) rb_complex_raw((x), INT2FIX(0))
|
||||
#define rb_complex_raw2(x,y) rb_complex_raw((x), (y))
|
||||
VALUE rb_complex_new(VALUE, VALUE);
|
||||
#define rb_complex_new1(x) rb_complex_new((x), INT2FIX(0))
|
||||
#define rb_complex_new2(x,y) rb_complex_new((x), (y))
|
||||
VALUE rb_complex_polar(VALUE, VALUE);
|
||||
VALUE rb_Complex(VALUE, VALUE);
|
||||
#define rb_Complex1(x) rb_Complex((x), INT2FIX(0))
|
||||
#define rb_Complex2(x,y) rb_Complex((x), (y))
|
||||
/* class.c */
|
||||
VALUE rb_class_boot(VALUE);
|
||||
VALUE rb_class_new(VALUE);
|
||||
VALUE rb_mod_init_copy(VALUE, VALUE);
|
||||
VALUE rb_singleton_class_clone(VALUE);
|
||||
void rb_singleton_class_attached(VALUE,VALUE);
|
||||
VALUE rb_make_metaclass(VALUE, VALUE);
|
||||
void rb_check_inheritable(VALUE);
|
||||
VALUE rb_class_inherited(VALUE, VALUE);
|
||||
VALUE rb_define_class_id(ID, VALUE);
|
||||
VALUE rb_define_class_id_under(VALUE, ID, VALUE);
|
||||
VALUE rb_module_new(void);
|
||||
VALUE rb_define_module_id(ID);
|
||||
VALUE rb_define_module_id_under(VALUE, ID);
|
||||
VALUE rb_include_class_new(VALUE, VALUE);
|
||||
VALUE rb_mod_included_modules(VALUE);
|
||||
VALUE rb_mod_include_p(VALUE, VALUE);
|
||||
VALUE rb_mod_ancestors(VALUE);
|
||||
VALUE rb_class_instance_methods(int, VALUE*, VALUE);
|
||||
VALUE rb_class_public_instance_methods(int, VALUE*, VALUE);
|
||||
VALUE rb_class_protected_instance_methods(int, VALUE*, VALUE);
|
||||
VALUE rb_class_private_instance_methods(int, VALUE*, VALUE);
|
||||
VALUE rb_obj_singleton_methods(int, VALUE*, VALUE);
|
||||
void rb_define_method_id(VALUE, ID, VALUE (*)(ANYARGS), int);
|
||||
void rb_frozen_class_p(VALUE);
|
||||
void rb_undef(VALUE, ID);
|
||||
void rb_define_protected_method(VALUE, const char*, VALUE (*)(ANYARGS), int);
|
||||
void rb_define_private_method(VALUE, const char*, VALUE (*)(ANYARGS), int);
|
||||
void rb_define_singleton_method(VALUE, const char*, VALUE(*)(ANYARGS), int);
|
||||
VALUE rb_singleton_class(VALUE);
|
||||
/* compar.c */
|
||||
int rb_cmpint(VALUE, VALUE, VALUE);
|
||||
NORETURN(void rb_cmperr(VALUE, VALUE));
|
||||
/* cont.c */
|
||||
VALUE rb_fiber_new(VALUE (*)(ANYARGS), VALUE);
|
||||
VALUE rb_fiber_resume(VALUE fib, int argc, VALUE *args);
|
||||
VALUE rb_fiber_yield(int argc, VALUE *args);
|
||||
VALUE rb_fiber_current(void);
|
||||
VALUE rb_fiber_alive_p(VALUE);
|
||||
/* enum.c */
|
||||
VALUE rb_enum_values_pack(int, VALUE*);
|
||||
/* enumerator.c */
|
||||
VALUE rb_enumeratorize(VALUE, VALUE, int, VALUE *);
|
||||
VALUE rb_enumeratorize_with_size(VALUE, VALUE, int, VALUE *, VALUE (*)(ANYARGS));
|
||||
#define RETURN_SIZED_ENUMERATOR(obj, argc, argv, size_fn) do { \
|
||||
if (!rb_block_given_p()) \
|
||||
return rb_enumeratorize_with_size((obj), ID2SYM(rb_frame_this_func()),\
|
||||
(argc), (argv), (size_fn)); \
|
||||
} while (0)
|
||||
#define RETURN_ENUMERATOR(obj, argc, argv) RETURN_SIZED_ENUMERATOR(obj, argc, argv, 0)
|
||||
/* error.c */
|
||||
VALUE rb_exc_new(VALUE, const char*, long);
|
||||
VALUE rb_exc_new2(VALUE, const char*);
|
||||
VALUE rb_exc_new3(VALUE, VALUE);
|
||||
PRINTF_ARGS(NORETURN(void rb_loaderror(const char*, ...)), 1, 2);
|
||||
PRINTF_ARGS(NORETURN(void rb_loaderror_with_path(VALUE path, const char*, ...)), 2, 3);
|
||||
PRINTF_ARGS(NORETURN(void rb_name_error(ID, const char*, ...)), 2, 3);
|
||||
PRINTF_ARGS(NORETURN(void rb_name_error_str(VALUE, const char*, ...)), 2, 3);
|
||||
NORETURN(void rb_invalid_str(const char*, const char*));
|
||||
PRINTF_ARGS(void rb_compile_error(const char*, int, const char*, ...), 3, 4);
|
||||
PRINTF_ARGS(void rb_compile_error_with_enc(const char*, int, void *, const char*, ...), 4, 5);
|
||||
PRINTF_ARGS(void rb_compile_error_append(const char*, ...), 1, 2);
|
||||
NORETURN(void rb_error_frozen(const char*));
|
||||
void rb_error_untrusted(VALUE);
|
||||
void rb_check_frozen(VALUE);
|
||||
void rb_check_trusted(VALUE);
|
||||
#define rb_check_frozen_internal(obj) do { \
|
||||
VALUE frozen_obj = (obj); \
|
||||
if (OBJ_FROZEN(frozen_obj)) { \
|
||||
rb_error_frozen(rb_obj_classname(frozen_obj)); \
|
||||
} \
|
||||
} while (0)
|
||||
#define rb_check_trusted_internal(obj) do { \
|
||||
VALUE untrusted_obj = (obj); \
|
||||
if (!OBJ_UNTRUSTED(untrusted_obj)) { \
|
||||
rb_error_untrusted(untrusted_obj); \
|
||||
} \
|
||||
} while (0)
|
||||
#ifdef __GNUC__
|
||||
#define rb_check_frozen(obj) __extension__({rb_check_frozen_internal(obj);})
|
||||
#define rb_check_trusted(obj) __extension__({rb_check_trusted_internal(obj);})
|
||||
#else
|
||||
static inline void
|
||||
rb_check_frozen_inline(VALUE obj)
|
||||
{
|
||||
rb_check_frozen_internal(obj);
|
||||
}
|
||||
#define rb_check_frozen(obj) rb_check_frozen_inline(obj)
|
||||
static inline void
|
||||
rb_check_trusted_inline(VALUE obj)
|
||||
{
|
||||
rb_check_trusted_internal(obj);
|
||||
}
|
||||
#define rb_check_trusted(obj) rb_check_trusted_inline(obj)
|
||||
#endif
|
||||
void rb_check_copyable(VALUE obj, VALUE orig);
|
||||
|
||||
#define OBJ_INIT_COPY(obj, orig) \
|
||||
((obj) != (orig) && (rb_obj_init_copy((obj), (orig)), 1))
|
||||
|
||||
/* eval.c */
|
||||
int rb_sourceline(void);
|
||||
const char *rb_sourcefile(void);
|
||||
VALUE rb_check_funcall(VALUE, ID, int, VALUE*);
|
||||
|
||||
NORETURN(void rb_error_arity(int, int, int));
|
||||
#define rb_check_arity(argc, min, max) do { \
|
||||
if (((argc) < (min)) || ((argc) > (max) && (max) != UNLIMITED_ARGUMENTS)) \
|
||||
rb_error_arity(argc, min, max); \
|
||||
} while(0)
|
||||
|
||||
#if defined(NFDBITS) && defined(HAVE_RB_FD_INIT)
|
||||
typedef struct {
|
||||
int maxfd;
|
||||
fd_set *fdset;
|
||||
} rb_fdset_t;
|
||||
|
||||
void rb_fd_init(rb_fdset_t *);
|
||||
void rb_fd_term(rb_fdset_t *);
|
||||
void rb_fd_zero(rb_fdset_t *);
|
||||
void rb_fd_set(int, rb_fdset_t *);
|
||||
void rb_fd_clr(int, rb_fdset_t *);
|
||||
int rb_fd_isset(int, const rb_fdset_t *);
|
||||
void rb_fd_copy(rb_fdset_t *, const fd_set *, int);
|
||||
void rb_fd_dup(rb_fdset_t *dst, const rb_fdset_t *src);
|
||||
int rb_fd_select(int, rb_fdset_t *, rb_fdset_t *, rb_fdset_t *, struct timeval *);
|
||||
|
||||
#define rb_fd_ptr(f) ((f)->fdset)
|
||||
#define rb_fd_max(f) ((f)->maxfd)
|
||||
|
||||
#elif defined(_WIN32)
|
||||
|
||||
typedef struct {
|
||||
int capa;
|
||||
fd_set *fdset;
|
||||
} rb_fdset_t;
|
||||
|
||||
void rb_fd_init(rb_fdset_t *);
|
||||
void rb_fd_term(rb_fdset_t *);
|
||||
#define rb_fd_zero(f) ((f)->fdset->fd_count = 0)
|
||||
void rb_fd_set(int, rb_fdset_t *);
|
||||
#define rb_fd_clr(n, f) rb_w32_fdclr((n), (f)->fdset)
|
||||
#define rb_fd_isset(n, f) rb_w32_fdisset((n), (f)->fdset)
|
||||
#define rb_fd_copy(d, s, n) rb_w32_fd_copy((d), (s), (n))
|
||||
void rb_w32_fd_copy(rb_fdset_t *, const fd_set *, int);
|
||||
#define rb_fd_dup(d, s) rb_w32_fd_dup((d), (s))
|
||||
void rb_w32_fd_dup(rb_fdset_t *dst, const rb_fdset_t *src);
|
||||
#define rb_fd_select(n, rfds, wfds, efds, timeout) rb_w32_select((n), (rfds) ? ((rb_fdset_t*)(rfds))->fdset : NULL, (wfds) ? ((rb_fdset_t*)(wfds))->fdset : NULL, (efds) ? ((rb_fdset_t*)(efds))->fdset: NULL, (timeout))
|
||||
#define rb_fd_resize(n, f) ((void)(f))
|
||||
|
||||
#define rb_fd_ptr(f) ((f)->fdset)
|
||||
#define rb_fd_max(f) ((f)->fdset->fd_count)
|
||||
|
||||
#else
|
||||
|
||||
typedef fd_set rb_fdset_t;
|
||||
#define rb_fd_zero(f) FD_ZERO(f)
|
||||
#define rb_fd_set(n, f) FD_SET((n), (f))
|
||||
#define rb_fd_clr(n, f) FD_CLR((n), (f))
|
||||
#define rb_fd_isset(n, f) FD_ISSET((n), (f))
|
||||
#define rb_fd_copy(d, s, n) (*(d) = *(s))
|
||||
#define rb_fd_dup(d, s) (*(d) = *(s))
|
||||
#define rb_fd_resize(n, f) ((void)(f))
|
||||
#define rb_fd_ptr(f) (f)
|
||||
#define rb_fd_init(f) FD_ZERO(f)
|
||||
#define rb_fd_init_copy(d, s) (*(d) = *(s))
|
||||
#define rb_fd_term(f) ((void)(f))
|
||||
#define rb_fd_max(f) FD_SETSIZE
|
||||
#define rb_fd_select(n, rfds, wfds, efds, timeout) select((n), (rfds), (wfds), (efds), (timeout))
|
||||
|
||||
#endif
|
||||
|
||||
NORETURN(void rb_exc_raise(VALUE));
|
||||
NORETURN(void rb_exc_fatal(VALUE));
|
||||
VALUE rb_f_exit(int,VALUE*);
|
||||
VALUE rb_f_abort(int,VALUE*);
|
||||
void rb_remove_method(VALUE, const char*);
|
||||
void rb_remove_method_id(VALUE, ID);
|
||||
#define rb_disable_super(klass, name) ((void)0)
|
||||
#define rb_enable_super(klass, name) ((void)0)
|
||||
#define HAVE_RB_DEFINE_ALLOC_FUNC 1
|
||||
typedef VALUE (*rb_alloc_func_t)(VALUE);
|
||||
void rb_define_alloc_func(VALUE, rb_alloc_func_t);
|
||||
void rb_undef_alloc_func(VALUE);
|
||||
rb_alloc_func_t rb_get_alloc_func(VALUE);
|
||||
void rb_clear_cache(void);
|
||||
void rb_clear_cache_by_class(VALUE);
|
||||
void rb_alias(VALUE, ID, ID);
|
||||
void rb_attr(VALUE,ID,int,int,int);
|
||||
int rb_method_boundp(VALUE, ID, int);
|
||||
int rb_method_basic_definition_p(VALUE, ID);
|
||||
VALUE rb_eval_cmd(VALUE, VALUE, int);
|
||||
int rb_obj_respond_to(VALUE, ID, int);
|
||||
int rb_respond_to(VALUE, ID);
|
||||
VALUE rb_f_notimplement(int argc, VALUE *argv, VALUE obj);
|
||||
void rb_interrupt(void);
|
||||
VALUE rb_apply(VALUE, ID, VALUE);
|
||||
void rb_backtrace(void);
|
||||
ID rb_frame_this_func(void);
|
||||
VALUE rb_obj_instance_eval(int, VALUE*, VALUE);
|
||||
VALUE rb_obj_instance_exec(int, VALUE*, VALUE);
|
||||
VALUE rb_mod_module_eval(int, VALUE*, VALUE);
|
||||
VALUE rb_mod_module_exec(int, VALUE*, VALUE);
|
||||
void rb_load(VALUE, int);
|
||||
void rb_load_protect(VALUE, int, int*);
|
||||
NORETURN(void rb_jump_tag(int));
|
||||
int rb_provided(const char*);
|
||||
int rb_feature_provided(const char *, const char **);
|
||||
void rb_provide(const char*);
|
||||
VALUE rb_f_require(VALUE, VALUE);
|
||||
VALUE rb_require_safe(VALUE, int);
|
||||
void rb_obj_call_init(VALUE, int, VALUE*);
|
||||
VALUE rb_class_new_instance(int, VALUE*, VALUE);
|
||||
VALUE rb_block_proc(void);
|
||||
VALUE rb_block_lambda(void);
|
||||
VALUE rb_proc_new(VALUE (*)(ANYARGS/* VALUE yieldarg[, VALUE procarg] */), VALUE);
|
||||
VALUE rb_obj_is_proc(VALUE);
|
||||
VALUE rb_proc_call(VALUE, VALUE);
|
||||
VALUE rb_proc_call_with_block(VALUE, int argc, VALUE *argv, VALUE);
|
||||
int rb_proc_arity(VALUE);
|
||||
VALUE rb_proc_lambda_p(VALUE);
|
||||
VALUE rb_binding_new(void);
|
||||
VALUE rb_obj_method(VALUE, VALUE);
|
||||
VALUE rb_obj_is_method(VALUE);
|
||||
VALUE rb_method_call(int, VALUE*, VALUE);
|
||||
VALUE rb_method_call_with_block(int, VALUE *, VALUE, VALUE);
|
||||
int rb_mod_method_arity(VALUE, ID);
|
||||
int rb_obj_method_arity(VALUE, ID);
|
||||
VALUE rb_protect(VALUE (*)(VALUE), VALUE, int*);
|
||||
void rb_set_end_proc(void (*)(VALUE), VALUE);
|
||||
void rb_exec_end_proc(void);
|
||||
void rb_thread_schedule(void);
|
||||
void rb_thread_wait_fd(int);
|
||||
int rb_thread_fd_writable(int);
|
||||
void rb_thread_fd_close(int);
|
||||
int rb_thread_alone(void);
|
||||
DEPRECATED(void rb_thread_polling(void));
|
||||
void rb_thread_sleep(int);
|
||||
void rb_thread_sleep_forever(void);
|
||||
VALUE rb_thread_stop(void);
|
||||
VALUE rb_thread_wakeup(VALUE);
|
||||
VALUE rb_thread_wakeup_alive(VALUE);
|
||||
VALUE rb_thread_run(VALUE);
|
||||
VALUE rb_thread_kill(VALUE);
|
||||
VALUE rb_thread_create(VALUE (*)(ANYARGS), void*);
|
||||
DEPRECATED(int rb_thread_select(int, fd_set *, fd_set *, fd_set *, struct timeval *));
|
||||
int rb_thread_fd_select(int, rb_fdset_t *, rb_fdset_t *, rb_fdset_t *, struct timeval *);
|
||||
void rb_thread_wait_for(struct timeval);
|
||||
VALUE rb_thread_current(void);
|
||||
VALUE rb_thread_main(void);
|
||||
VALUE rb_thread_local_aref(VALUE, ID);
|
||||
VALUE rb_thread_local_aset(VALUE, ID, VALUE);
|
||||
void rb_thread_atfork(void);
|
||||
void rb_thread_atfork_before_exec(void);
|
||||
VALUE rb_exec_recursive(VALUE(*)(VALUE, VALUE, int),VALUE,VALUE);
|
||||
VALUE rb_exec_recursive_paired(VALUE(*)(VALUE, VALUE, int),VALUE,VALUE,VALUE);
|
||||
VALUE rb_exec_recursive_outer(VALUE(*)(VALUE, VALUE, int),VALUE,VALUE);
|
||||
/* dir.c */
|
||||
VALUE rb_dir_getwd(void);
|
||||
/* file.c */
|
||||
VALUE rb_file_s_expand_path(int, VALUE *);
|
||||
VALUE rb_file_expand_path(VALUE, VALUE);
|
||||
VALUE rb_file_s_absolute_path(int, VALUE *);
|
||||
VALUE rb_file_absolute_path(VALUE, VALUE);
|
||||
VALUE rb_file_dirname(VALUE fname);
|
||||
int rb_find_file_ext_safe(VALUE*, const char* const*, int);
|
||||
VALUE rb_find_file_safe(VALUE, int);
|
||||
int rb_find_file_ext(VALUE*, const char* const*);
|
||||
VALUE rb_find_file(VALUE);
|
||||
VALUE rb_file_directory_p(VALUE,VALUE);
|
||||
VALUE rb_str_encode_ospath(VALUE);
|
||||
int rb_is_absolute_path(const char *);
|
||||
/* gc.c */
|
||||
NORETURN(void rb_memerror(void));
|
||||
int rb_during_gc(void);
|
||||
void rb_gc_mark_locations(VALUE*, VALUE*);
|
||||
void rb_mark_tbl(struct st_table*);
|
||||
void rb_mark_set(struct st_table*);
|
||||
void rb_mark_hash(struct st_table*);
|
||||
void rb_gc_mark_maybe(VALUE);
|
||||
void rb_gc_mark(VALUE);
|
||||
void rb_gc_force_recycle(VALUE);
|
||||
void rb_gc(void);
|
||||
void rb_gc_copy_finalizer(VALUE,VALUE);
|
||||
void rb_gc_finalize_deferred(void);
|
||||
void rb_gc_call_finalizer_at_exit(void);
|
||||
VALUE rb_gc_enable(void);
|
||||
VALUE rb_gc_disable(void);
|
||||
VALUE rb_gc_start(void);
|
||||
void rb_gc_set_params(void);
|
||||
/* hash.c */
|
||||
void st_foreach_safe(struct st_table *, int (*)(ANYARGS), st_data_t);
|
||||
VALUE rb_check_hash_type(VALUE);
|
||||
void rb_hash_foreach(VALUE, int (*)(ANYARGS), VALUE);
|
||||
VALUE rb_hash(VALUE);
|
||||
VALUE rb_hash_new(void);
|
||||
VALUE rb_hash_dup(VALUE);
|
||||
VALUE rb_hash_freeze(VALUE);
|
||||
VALUE rb_hash_aref(VALUE, VALUE);
|
||||
VALUE rb_hash_lookup(VALUE, VALUE);
|
||||
VALUE rb_hash_lookup2(VALUE, VALUE, VALUE);
|
||||
VALUE rb_hash_fetch(VALUE, VALUE);
|
||||
VALUE rb_hash_aset(VALUE, VALUE, VALUE);
|
||||
VALUE rb_hash_clear(VALUE);
|
||||
VALUE rb_hash_delete_if(VALUE);
|
||||
VALUE rb_hash_delete(VALUE,VALUE);
|
||||
typedef VALUE rb_hash_update_func(VALUE newkey, VALUE oldkey, VALUE value);
|
||||
VALUE rb_hash_update_by(VALUE hash1, VALUE hash2, rb_hash_update_func *func);
|
||||
struct st_table *rb_hash_tbl(VALUE);
|
||||
int rb_path_check(const char*);
|
||||
int rb_env_path_tainted(void);
|
||||
VALUE rb_env_clear(void);
|
||||
/* io.c */
|
||||
#define rb_defout rb_stdout
|
||||
RUBY_EXTERN VALUE rb_fs;
|
||||
RUBY_EXTERN VALUE rb_output_fs;
|
||||
RUBY_EXTERN VALUE rb_rs;
|
||||
RUBY_EXTERN VALUE rb_default_rs;
|
||||
RUBY_EXTERN VALUE rb_output_rs;
|
||||
VALUE rb_io_write(VALUE, VALUE);
|
||||
VALUE rb_io_gets(VALUE);
|
||||
VALUE rb_io_getbyte(VALUE);
|
||||
VALUE rb_io_ungetc(VALUE, VALUE);
|
||||
VALUE rb_io_ungetbyte(VALUE, VALUE);
|
||||
VALUE rb_io_close(VALUE);
|
||||
VALUE rb_io_flush(VALUE);
|
||||
VALUE rb_io_eof(VALUE);
|
||||
VALUE rb_io_binmode(VALUE);
|
||||
VALUE rb_io_ascii8bit_binmode(VALUE);
|
||||
VALUE rb_io_addstr(VALUE, VALUE);
|
||||
VALUE rb_io_printf(int, VALUE*, VALUE);
|
||||
VALUE rb_io_print(int, VALUE*, VALUE);
|
||||
VALUE rb_io_puts(int, VALUE*, VALUE);
|
||||
VALUE rb_io_fdopen(int, int, const char*);
|
||||
VALUE rb_io_get_io(VALUE);
|
||||
VALUE rb_file_open(const char*, const char*);
|
||||
VALUE rb_file_open_str(VALUE, const char*);
|
||||
VALUE rb_gets(void);
|
||||
void rb_write_error(const char*);
|
||||
void rb_write_error2(const char*, long);
|
||||
void rb_close_before_exec(int lowfd, int maxhint, VALUE noclose_fds);
|
||||
int rb_pipe(int *pipes);
|
||||
int rb_reserved_fd_p(int fd);
|
||||
int rb_cloexec_open(const char *pathname, int flags, mode_t mode);
|
||||
int rb_cloexec_dup(int oldfd);
|
||||
int rb_cloexec_dup2(int oldfd, int newfd);
|
||||
int rb_cloexec_pipe(int fildes[2]);
|
||||
int rb_cloexec_fcntl_dupfd(int fd, int minfd);
|
||||
#define RB_RESERVED_FD_P(fd) rb_reserved_fd_p(fd)
|
||||
void rb_update_max_fd(int fd);
|
||||
void rb_fd_fix_cloexec(int fd);
|
||||
/* marshal.c */
|
||||
VALUE rb_marshal_dump(VALUE, VALUE);
|
||||
VALUE rb_marshal_load(VALUE);
|
||||
void rb_marshal_define_compat(VALUE newclass, VALUE oldclass, VALUE (*dumper)(VALUE), VALUE (*loader)(VALUE, VALUE));
|
||||
/* numeric.c */
|
||||
NORETURN(void rb_num_zerodiv(void));
|
||||
#define RB_NUM_COERCE_FUNCS_NEED_OPID 1
|
||||
VALUE rb_num_coerce_bin(VALUE, VALUE, ID);
|
||||
VALUE rb_num_coerce_cmp(VALUE, VALUE, ID);
|
||||
VALUE rb_num_coerce_relop(VALUE, VALUE, ID);
|
||||
VALUE rb_num_coerce_bit(VALUE, VALUE, ID);
|
||||
VALUE rb_num2fix(VALUE);
|
||||
VALUE rb_fix2str(VALUE, int);
|
||||
VALUE rb_dbl_cmp(double, double);
|
||||
/* object.c */
|
||||
int rb_eql(VALUE, VALUE);
|
||||
VALUE rb_any_to_s(VALUE);
|
||||
VALUE rb_inspect(VALUE);
|
||||
VALUE rb_obj_is_instance_of(VALUE, VALUE);
|
||||
VALUE rb_obj_is_kind_of(VALUE, VALUE);
|
||||
VALUE rb_obj_alloc(VALUE);
|
||||
VALUE rb_obj_clone(VALUE);
|
||||
VALUE rb_obj_dup(VALUE);
|
||||
VALUE rb_obj_init_copy(VALUE,VALUE);
|
||||
VALUE rb_obj_taint(VALUE);
|
||||
VALUE rb_obj_tainted(VALUE);
|
||||
VALUE rb_obj_untaint(VALUE);
|
||||
VALUE rb_obj_untrust(VALUE);
|
||||
VALUE rb_obj_untrusted(VALUE);
|
||||
VALUE rb_obj_trust(VALUE);
|
||||
VALUE rb_obj_freeze(VALUE);
|
||||
VALUE rb_obj_frozen_p(VALUE);
|
||||
VALUE rb_obj_id(VALUE);
|
||||
VALUE rb_obj_class(VALUE);
|
||||
VALUE rb_class_real(VALUE);
|
||||
VALUE rb_class_inherited_p(VALUE, VALUE);
|
||||
VALUE rb_class_superclass(VALUE);
|
||||
VALUE rb_class_get_superclass(VALUE);
|
||||
VALUE rb_convert_type(VALUE,int,const char*,const char*);
|
||||
VALUE rb_check_convert_type(VALUE,int,const char*,const char*);
|
||||
VALUE rb_check_to_integer(VALUE, const char *);
|
||||
VALUE rb_check_to_float(VALUE);
|
||||
VALUE rb_to_int(VALUE);
|
||||
VALUE rb_check_to_int(VALUE);
|
||||
VALUE rb_Integer(VALUE);
|
||||
VALUE rb_to_float(VALUE);
|
||||
VALUE rb_Float(VALUE);
|
||||
VALUE rb_String(VALUE);
|
||||
VALUE rb_Array(VALUE);
|
||||
VALUE rb_Hash(VALUE);
|
||||
double rb_cstr_to_dbl(const char*, int);
|
||||
double rb_str_to_dbl(VALUE, int);
|
||||
/* parse.y */
|
||||
RUBY_EXTERN int ruby_sourceline;
|
||||
RUBY_EXTERN char *ruby_sourcefile;
|
||||
ID rb_id_attrset(ID);
|
||||
int rb_is_const_id(ID);
|
||||
int rb_is_global_id(ID);
|
||||
int rb_is_instance_id(ID);
|
||||
int rb_is_attrset_id(ID);
|
||||
int rb_is_class_id(ID);
|
||||
int rb_is_local_id(ID);
|
||||
int rb_is_junk_id(ID);
|
||||
int rb_symname_p(const char*);
|
||||
int rb_sym_interned_p(VALUE);
|
||||
VALUE rb_backref_get(void);
|
||||
void rb_backref_set(VALUE);
|
||||
VALUE rb_lastline_get(void);
|
||||
void rb_lastline_set(VALUE);
|
||||
VALUE rb_sym_all_symbols(void);
|
||||
/* process.c */
|
||||
void rb_last_status_set(int status, rb_pid_t pid);
|
||||
VALUE rb_last_status_get(void);
|
||||
struct rb_exec_arg {
|
||||
VALUE execarg_obj;
|
||||
};
|
||||
DEPRECATED(int rb_proc_exec_n(int, VALUE*, const char*));
|
||||
int rb_proc_exec(const char*);
|
||||
DEPRECATED(VALUE rb_exec_arg_init(int argc, VALUE *argv, int accept_shell, struct rb_exec_arg *e));
|
||||
DEPRECATED(int rb_exec_arg_addopt(struct rb_exec_arg *e, VALUE key, VALUE val));
|
||||
DEPRECATED(void rb_exec_arg_fixup(struct rb_exec_arg *e));
|
||||
DEPRECATED(int rb_run_exec_options(const struct rb_exec_arg *e, struct rb_exec_arg *s));
|
||||
DEPRECATED(int rb_run_exec_options_err(const struct rb_exec_arg *e, struct rb_exec_arg *s, char*, size_t));
|
||||
DEPRECATED(int rb_exec(const struct rb_exec_arg*));
|
||||
DEPRECATED(int rb_exec_err(const struct rb_exec_arg*, char*, size_t));
|
||||
DEPRECATED(rb_pid_t rb_fork(int*, int (*)(void*), void*, VALUE));
|
||||
DEPRECATED(rb_pid_t rb_fork_err(int*, int (*)(void*, char*, size_t), void*, VALUE, char*, size_t));
|
||||
VALUE rb_f_exec(int,VALUE*);
|
||||
rb_pid_t rb_waitpid(rb_pid_t pid, int *status, int flags);
|
||||
void rb_syswait(rb_pid_t pid);
|
||||
rb_pid_t rb_spawn(int, VALUE*);
|
||||
rb_pid_t rb_spawn_err(int, VALUE*, char*, size_t);
|
||||
VALUE rb_proc_times(VALUE);
|
||||
VALUE rb_detach_process(rb_pid_t pid);
|
||||
/* range.c */
|
||||
VALUE rb_range_new(VALUE, VALUE, int);
|
||||
VALUE rb_range_beg_len(VALUE, long*, long*, long, int);
|
||||
int rb_range_values(VALUE range, VALUE *begp, VALUE *endp, int *exclp);
|
||||
/* random.c */
|
||||
unsigned int rb_genrand_int32(void);
|
||||
double rb_genrand_real(void);
|
||||
void rb_reset_random_seed(void);
|
||||
VALUE rb_random_bytes(VALUE rnd, long n);
|
||||
VALUE rb_random_int(VALUE rnd, VALUE max);
|
||||
unsigned int rb_random_int32(VALUE rnd);
|
||||
double rb_random_real(VALUE rnd);
|
||||
unsigned long rb_random_ulong_limited(VALUE rnd, unsigned long limit);
|
||||
unsigned long rb_genrand_ulong_limited(unsigned long i);
|
||||
/* re.c */
|
||||
#define rb_memcmp memcmp
|
||||
int rb_memcicmp(const void*,const void*,long);
|
||||
void rb_match_busy(VALUE);
|
||||
VALUE rb_reg_nth_defined(int, VALUE);
|
||||
VALUE rb_reg_nth_match(int, VALUE);
|
||||
int rb_reg_backref_number(VALUE match, VALUE backref);
|
||||
VALUE rb_reg_last_match(VALUE);
|
||||
VALUE rb_reg_match_pre(VALUE);
|
||||
VALUE rb_reg_match_post(VALUE);
|
||||
VALUE rb_reg_match_last(VALUE);
|
||||
#define HAVE_RB_REG_NEW_STR 1
|
||||
VALUE rb_reg_new_str(VALUE, int);
|
||||
VALUE rb_reg_new(const char *, long, int);
|
||||
VALUE rb_reg_alloc(void);
|
||||
VALUE rb_reg_init_str(VALUE re, VALUE s, int options);
|
||||
VALUE rb_reg_match(VALUE, VALUE);
|
||||
VALUE rb_reg_match2(VALUE);
|
||||
int rb_reg_options(VALUE);
|
||||
/* ruby.c */
|
||||
#define rb_argv rb_get_argv()
|
||||
RUBY_EXTERN VALUE rb_argv0;
|
||||
VALUE rb_get_argv(void);
|
||||
void *rb_load_file(const char*);
|
||||
void *rb_load_file_str(VALUE);
|
||||
/* signal.c */
|
||||
VALUE rb_f_kill(int, VALUE*);
|
||||
#ifdef POSIX_SIGNAL
|
||||
#define posix_signal ruby_posix_signal
|
||||
RETSIGTYPE (*posix_signal(int, RETSIGTYPE (*)(int)))(int);
|
||||
#endif
|
||||
void rb_trap_exit(void);
|
||||
void rb_trap_exec(void);
|
||||
const char *ruby_signal_name(int);
|
||||
void ruby_default_signal(int);
|
||||
/* sprintf.c */
|
||||
VALUE rb_f_sprintf(int, const VALUE*);
|
||||
PRINTF_ARGS(VALUE rb_sprintf(const char*, ...), 1, 2);
|
||||
VALUE rb_vsprintf(const char*, va_list);
|
||||
PRINTF_ARGS(VALUE rb_str_catf(VALUE, const char*, ...), 2, 3);
|
||||
VALUE rb_str_vcatf(VALUE, const char*, va_list);
|
||||
VALUE rb_str_format(int, const VALUE *, VALUE);
|
||||
/* string.c */
|
||||
VALUE rb_str_new(const char*, long);
|
||||
VALUE rb_str_new_cstr(const char*);
|
||||
VALUE rb_str_new2(const char*);
|
||||
VALUE rb_str_new_shared(VALUE);
|
||||
VALUE rb_str_new3(VALUE);
|
||||
VALUE rb_str_new_frozen(VALUE);
|
||||
VALUE rb_str_new4(VALUE);
|
||||
VALUE rb_str_new_with_class(VALUE, const char*, long);
|
||||
VALUE rb_str_new5(VALUE, const char*, long);
|
||||
VALUE rb_tainted_str_new_cstr(const char*);
|
||||
VALUE rb_tainted_str_new(const char*, long);
|
||||
VALUE rb_tainted_str_new2(const char*);
|
||||
VALUE rb_external_str_new(const char*, long);
|
||||
VALUE rb_external_str_new_cstr(const char*);
|
||||
VALUE rb_locale_str_new(const char*, long);
|
||||
VALUE rb_locale_str_new_cstr(const char*);
|
||||
VALUE rb_filesystem_str_new(const char*, long);
|
||||
VALUE rb_filesystem_str_new_cstr(const char*);
|
||||
VALUE rb_str_buf_new(long);
|
||||
VALUE rb_str_buf_new_cstr(const char*);
|
||||
VALUE rb_str_buf_new2(const char*);
|
||||
VALUE rb_str_tmp_new(long);
|
||||
VALUE rb_usascii_str_new(const char*, long);
|
||||
VALUE rb_usascii_str_new_cstr(const char*);
|
||||
VALUE rb_usascii_str_new2(const char*);
|
||||
void rb_str_free(VALUE);
|
||||
void rb_str_shared_replace(VALUE, VALUE);
|
||||
VALUE rb_str_buf_append(VALUE, VALUE);
|
||||
VALUE rb_str_buf_cat(VALUE, const char*, long);
|
||||
VALUE rb_str_buf_cat2(VALUE, const char*);
|
||||
VALUE rb_str_buf_cat_ascii(VALUE, const char*);
|
||||
VALUE rb_obj_as_string(VALUE);
|
||||
VALUE rb_check_string_type(VALUE);
|
||||
void rb_must_asciicompat(VALUE);
|
||||
VALUE rb_str_dup(VALUE);
|
||||
VALUE rb_str_resurrect(VALUE str);
|
||||
VALUE rb_str_locktmp(VALUE);
|
||||
VALUE rb_str_unlocktmp(VALUE);
|
||||
VALUE rb_str_dup_frozen(VALUE);
|
||||
#define rb_str_dup_frozen rb_str_new_frozen
|
||||
VALUE rb_str_plus(VALUE, VALUE);
|
||||
VALUE rb_str_times(VALUE, VALUE);
|
||||
long rb_str_sublen(VALUE, long);
|
||||
VALUE rb_str_substr(VALUE, long, long);
|
||||
VALUE rb_str_subseq(VALUE, long, long);
|
||||
void rb_str_modify(VALUE);
|
||||
void rb_str_modify_expand(VALUE, long);
|
||||
VALUE rb_str_freeze(VALUE);
|
||||
void rb_str_set_len(VALUE, long);
|
||||
VALUE rb_str_resize(VALUE, long);
|
||||
VALUE rb_str_cat(VALUE, const char*, long);
|
||||
VALUE rb_str_cat2(VALUE, const char*);
|
||||
VALUE rb_str_append(VALUE, VALUE);
|
||||
VALUE rb_str_concat(VALUE, VALUE);
|
||||
st_index_t rb_memhash(const void *ptr, long len);
|
||||
st_index_t rb_hash_start(st_index_t);
|
||||
st_index_t rb_hash_uint32(st_index_t, uint32_t);
|
||||
st_index_t rb_hash_uint(st_index_t, st_index_t);
|
||||
st_index_t rb_hash_end(st_index_t);
|
||||
#define rb_hash_uint32(h, i) st_hash_uint32((h), (i))
|
||||
#define rb_hash_uint(h, i) st_hash_uint((h), (i))
|
||||
#define rb_hash_end(h) st_hash_end(h)
|
||||
st_index_t rb_str_hash(VALUE);
|
||||
int rb_str_hash_cmp(VALUE,VALUE);
|
||||
int rb_str_comparable(VALUE, VALUE);
|
||||
int rb_str_cmp(VALUE, VALUE);
|
||||
VALUE rb_str_equal(VALUE str1, VALUE str2);
|
||||
VALUE rb_str_drop_bytes(VALUE, long);
|
||||
void rb_str_update(VALUE, long, long, VALUE);
|
||||
VALUE rb_str_replace(VALUE, VALUE);
|
||||
VALUE rb_str_inspect(VALUE);
|
||||
VALUE rb_str_dump(VALUE);
|
||||
VALUE rb_str_split(VALUE, const char*);
|
||||
void rb_str_associate(VALUE, VALUE);
|
||||
VALUE rb_str_associated(VALUE);
|
||||
void rb_str_setter(VALUE, ID, VALUE*);
|
||||
VALUE rb_str_intern(VALUE);
|
||||
VALUE rb_sym_to_s(VALUE);
|
||||
long rb_str_strlen(VALUE);
|
||||
VALUE rb_str_length(VALUE);
|
||||
long rb_str_offset(VALUE, long);
|
||||
size_t rb_str_capacity(VALUE);
|
||||
VALUE rb_str_ellipsize(VALUE, long);
|
||||
#if defined(__GNUC__) && !defined(__PCC__)
|
||||
#define rb_str_new_cstr(str) __extension__ ( \
|
||||
{ \
|
||||
(__builtin_constant_p(str)) ? \
|
||||
rb_str_new((str), (long)strlen(str)) : \
|
||||
rb_str_new_cstr(str); \
|
||||
})
|
||||
#define rb_tainted_str_new_cstr(str) __extension__ ( \
|
||||
{ \
|
||||
(__builtin_constant_p(str)) ? \
|
||||
rb_tainted_str_new((str), (long)strlen(str)) : \
|
||||
rb_tainted_str_new_cstr(str); \
|
||||
})
|
||||
#define rb_usascii_str_new_cstr(str) __extension__ ( \
|
||||
{ \
|
||||
(__builtin_constant_p(str)) ? \
|
||||
rb_usascii_str_new((str), (long)strlen(str)) : \
|
||||
rb_usascii_str_new_cstr(str); \
|
||||
})
|
||||
#define rb_external_str_new_cstr(str) __extension__ ( \
|
||||
{ \
|
||||
(__builtin_constant_p(str)) ? \
|
||||
rb_external_str_new((str), (long)strlen(str)) : \
|
||||
rb_external_str_new_cstr(str); \
|
||||
})
|
||||
#define rb_locale_str_new_cstr(str) __extension__ ( \
|
||||
{ \
|
||||
(__builtin_constant_p(str)) ? \
|
||||
rb_locale_str_new((str), (long)strlen(str)) : \
|
||||
rb_locale_str_new_cstr(str); \
|
||||
})
|
||||
#define rb_str_buf_new_cstr(str) __extension__ ( \
|
||||
{ \
|
||||
(__builtin_constant_p(str)) ? \
|
||||
rb_str_buf_cat(rb_str_buf_new((long)strlen(str)), \
|
||||
(str), (long)strlen(str)) : \
|
||||
rb_str_buf_new_cstr(str); \
|
||||
})
|
||||
#define rb_str_buf_cat2(str, ptr) __extension__ ( \
|
||||
{ \
|
||||
(__builtin_constant_p(ptr)) ? \
|
||||
rb_str_buf_cat((str), (ptr), (long)strlen(ptr)) : \
|
||||
rb_str_buf_cat2((str), (ptr)); \
|
||||
})
|
||||
#define rb_str_cat2(str, ptr) __extension__ ( \
|
||||
{ \
|
||||
(__builtin_constant_p(ptr)) ? \
|
||||
rb_str_cat((str), (ptr), (long)strlen(ptr)) : \
|
||||
rb_str_cat2((str), (ptr)); \
|
||||
})
|
||||
#define rb_exc_new2(klass, ptr) __extension__ ( \
|
||||
{ \
|
||||
(__builtin_constant_p(ptr)) ? \
|
||||
rb_exc_new((klass), (ptr), (long)strlen(ptr)) : \
|
||||
rb_exc_new2((klass), (ptr)); \
|
||||
})
|
||||
#endif
|
||||
#define rb_str_new2 rb_str_new_cstr
|
||||
#define rb_str_new3 rb_str_new_shared
|
||||
#define rb_str_new4 rb_str_new_frozen
|
||||
#define rb_str_new5 rb_str_new_with_class
|
||||
#define rb_tainted_str_new2 rb_tainted_str_new_cstr
|
||||
#define rb_str_buf_new2 rb_str_buf_new_cstr
|
||||
#define rb_usascii_str_new2 rb_usascii_str_new_cstr
|
||||
/* struct.c */
|
||||
VALUE rb_struct_new(VALUE, ...);
|
||||
VALUE rb_struct_define(const char*, ...);
|
||||
VALUE rb_struct_alloc(VALUE, VALUE);
|
||||
VALUE rb_struct_initialize(VALUE, VALUE);
|
||||
VALUE rb_struct_aref(VALUE, VALUE);
|
||||
VALUE rb_struct_aset(VALUE, VALUE, VALUE);
|
||||
VALUE rb_struct_getmember(VALUE, ID);
|
||||
DEPRECATED(VALUE rb_struct_iv_get(VALUE, const char*));
|
||||
VALUE rb_struct_s_members(VALUE);
|
||||
VALUE rb_struct_members(VALUE);
|
||||
VALUE rb_struct_alloc_noinit(VALUE);
|
||||
VALUE rb_struct_define_without_accessor(const char *, VALUE, rb_alloc_func_t, ...);
|
||||
/* thread.c */
|
||||
typedef void rb_unblock_function_t(void *);
|
||||
typedef VALUE rb_blocking_function_t(void *);
|
||||
void rb_thread_check_ints(void);
|
||||
int rb_thread_interrupted(VALUE thval);
|
||||
|
||||
/* Use rb_thread_call_without_gvl family instead. */
|
||||
DEPRECATED(VALUE rb_thread_blocking_region(rb_blocking_function_t *func, void *data1,
|
||||
rb_unblock_function_t *ubf, void *data2));
|
||||
#define RUBY_UBF_IO ((rb_unblock_function_t *)-1)
|
||||
#define RUBY_UBF_PROCESS ((rb_unblock_function_t *)-1)
|
||||
VALUE rb_mutex_new(void);
|
||||
VALUE rb_mutex_locked_p(VALUE mutex);
|
||||
VALUE rb_mutex_trylock(VALUE mutex);
|
||||
VALUE rb_mutex_lock(VALUE mutex);
|
||||
VALUE rb_mutex_unlock(VALUE mutex);
|
||||
VALUE rb_mutex_sleep(VALUE self, VALUE timeout);
|
||||
VALUE rb_mutex_synchronize(VALUE mutex, VALUE (*func)(VALUE arg), VALUE arg);
|
||||
/* time.c */
|
||||
VALUE rb_time_new(time_t, long);
|
||||
VALUE rb_time_nano_new(time_t, long);
|
||||
VALUE rb_time_num_new(VALUE, VALUE);
|
||||
struct timeval rb_time_interval(VALUE num);
|
||||
struct timeval rb_time_timeval(VALUE time);
|
||||
struct timespec rb_time_timespec(VALUE time);
|
||||
/* variable.c */
|
||||
VALUE rb_mod_name(VALUE);
|
||||
VALUE rb_class_path(VALUE);
|
||||
void rb_set_class_path(VALUE, VALUE, const char*);
|
||||
void rb_set_class_path_string(VALUE, VALUE, VALUE);
|
||||
VALUE rb_path_to_class(VALUE);
|
||||
VALUE rb_path2class(const char*);
|
||||
void rb_name_class(VALUE, ID);
|
||||
VALUE rb_class_name(VALUE);
|
||||
void rb_autoload(VALUE, ID, const char*);
|
||||
VALUE rb_autoload_load(VALUE, ID);
|
||||
VALUE rb_autoload_p(VALUE, ID);
|
||||
VALUE rb_f_trace_var(int, VALUE*);
|
||||
VALUE rb_f_untrace_var(int, VALUE*);
|
||||
VALUE rb_f_global_variables(void);
|
||||
void rb_alias_variable(ID, ID);
|
||||
struct st_table* rb_generic_ivar_table(VALUE);
|
||||
void rb_copy_generic_ivar(VALUE,VALUE);
|
||||
void rb_free_generic_ivar(VALUE);
|
||||
VALUE rb_ivar_get(VALUE, ID);
|
||||
VALUE rb_ivar_set(VALUE, ID, VALUE);
|
||||
VALUE rb_ivar_defined(VALUE, ID);
|
||||
void rb_ivar_foreach(VALUE, int (*)(ANYARGS), st_data_t);
|
||||
st_index_t rb_ivar_count(VALUE);
|
||||
VALUE rb_iv_set(VALUE, const char*, VALUE);
|
||||
VALUE rb_iv_get(VALUE, const char*);
|
||||
VALUE rb_attr_get(VALUE, ID);
|
||||
VALUE rb_obj_instance_variables(VALUE);
|
||||
VALUE rb_obj_remove_instance_variable(VALUE, VALUE);
|
||||
void *rb_mod_const_at(VALUE, void*);
|
||||
void *rb_mod_const_of(VALUE, void*);
|
||||
VALUE rb_const_list(void*);
|
||||
VALUE rb_mod_constants(int, VALUE *, VALUE);
|
||||
VALUE rb_mod_remove_const(VALUE, VALUE);
|
||||
int rb_const_defined(VALUE, ID);
|
||||
int rb_const_defined_at(VALUE, ID);
|
||||
int rb_const_defined_from(VALUE, ID);
|
||||
VALUE rb_const_get(VALUE, ID);
|
||||
VALUE rb_const_get_at(VALUE, ID);
|
||||
VALUE rb_const_get_from(VALUE, ID);
|
||||
void rb_const_set(VALUE, ID, VALUE);
|
||||
VALUE rb_const_remove(VALUE, ID);
|
||||
VALUE rb_mod_const_missing(VALUE,VALUE);
|
||||
VALUE rb_cvar_defined(VALUE, ID);
|
||||
void rb_cvar_set(VALUE, ID, VALUE);
|
||||
VALUE rb_cvar_get(VALUE, ID);
|
||||
void rb_cv_set(VALUE, const char*, VALUE);
|
||||
VALUE rb_cv_get(VALUE, const char*);
|
||||
void rb_define_class_variable(VALUE, const char*, VALUE);
|
||||
VALUE rb_mod_class_variables(int, VALUE*, VALUE);
|
||||
VALUE rb_mod_remove_cvar(VALUE, VALUE);
|
||||
|
||||
ID rb_frame_callee(void);
|
||||
VALUE rb_str_succ(VALUE);
|
||||
VALUE rb_time_succ(VALUE);
|
||||
void rb_frame_pop(void);
|
||||
int rb_frame_method_id_and_class(ID *idp, VALUE *klassp);
|
||||
VALUE rb_make_backtrace(void);
|
||||
VALUE rb_make_exception(int, VALUE*);
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility pop
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
#if 0
|
||||
{ /* satisfy cc-mode */
|
||||
#endif
|
||||
} /* extern "C" { */
|
||||
#endif
|
||||
|
||||
#endif /* RUBY_INTERN_H */
|
||||
-213
@@ -1,213 +0,0 @@
|
||||
/**********************************************************************
|
||||
|
||||
rubyio.h -
|
||||
|
||||
$Author: nagachika $
|
||||
created at: Fri Nov 12 16:47:09 JST 1993
|
||||
|
||||
Copyright (C) 1993-2007 Yukihiro Matsumoto
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef RUBY_IO_H
|
||||
#define RUBY_IO_H 1
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#if 0
|
||||
} /* satisfy cc-mode */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include "ruby/encoding.h"
|
||||
|
||||
#if defined(HAVE_STDIO_EXT_H)
|
||||
#include <stdio_ext.h>
|
||||
#endif
|
||||
|
||||
#include "ruby/config.h"
|
||||
#if defined(HAVE_POLL)
|
||||
# ifdef _AIX
|
||||
# define reqevents events
|
||||
# define rtnevents revents
|
||||
# endif
|
||||
# include <poll.h>
|
||||
# ifdef _AIX
|
||||
# undef reqevents
|
||||
# undef rtnevents
|
||||
# undef events
|
||||
# undef revents
|
||||
# endif
|
||||
# define RB_WAITFD_IN POLLIN
|
||||
# define RB_WAITFD_PRI POLLPRI
|
||||
# define RB_WAITFD_OUT POLLOUT
|
||||
#else
|
||||
# define RB_WAITFD_IN 0x001
|
||||
# define RB_WAITFD_PRI 0x002
|
||||
# define RB_WAITFD_OUT 0x004
|
||||
#endif
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility push(default)
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
char *ptr; /* off + len <= capa */
|
||||
int off;
|
||||
int len;
|
||||
int capa;
|
||||
} rb_io_buffer_t;
|
||||
|
||||
typedef struct rb_io_t {
|
||||
int fd; /* file descriptor */
|
||||
FILE *stdio_file; /* stdio ptr for read/write if available */
|
||||
int mode; /* mode flags: FMODE_XXXs */
|
||||
rb_pid_t pid; /* child's pid (for pipes) */
|
||||
int lineno; /* number of lines read */
|
||||
VALUE pathv; /* pathname for file */
|
||||
void (*finalize)(struct rb_io_t*,int); /* finalize proc */
|
||||
|
||||
rb_io_buffer_t wbuf, rbuf;
|
||||
|
||||
VALUE tied_io_for_writing;
|
||||
|
||||
/*
|
||||
* enc enc2 read action write action
|
||||
* NULL NULL force_encoding(default_external) write the byte sequence of str
|
||||
* e1 NULL force_encoding(e1) convert str.encoding to e1
|
||||
* e1 e2 convert from e2 to e1 convert str.encoding to e2
|
||||
*/
|
||||
struct rb_io_enc_t {
|
||||
rb_encoding *enc;
|
||||
rb_encoding *enc2;
|
||||
int ecflags;
|
||||
VALUE ecopts;
|
||||
} encs;
|
||||
|
||||
rb_econv_t *readconv;
|
||||
rb_io_buffer_t cbuf;
|
||||
|
||||
rb_econv_t *writeconv;
|
||||
VALUE writeconv_asciicompat;
|
||||
int writeconv_pre_ecflags;
|
||||
VALUE writeconv_pre_ecopts;
|
||||
int writeconv_initialized;
|
||||
|
||||
VALUE write_lock;
|
||||
} rb_io_t;
|
||||
|
||||
#define HAVE_RB_IO_T 1
|
||||
|
||||
#define FMODE_READABLE 0x00000001
|
||||
#define FMODE_WRITABLE 0x00000002
|
||||
#define FMODE_READWRITE (FMODE_READABLE|FMODE_WRITABLE)
|
||||
#define FMODE_BINMODE 0x00000004
|
||||
#define FMODE_SYNC 0x00000008
|
||||
#define FMODE_TTY 0x00000010
|
||||
#define FMODE_DUPLEX 0x00000020
|
||||
#define FMODE_APPEND 0x00000040
|
||||
#define FMODE_CREATE 0x00000080
|
||||
/* #define FMODE_NOREVLOOKUP 0x00000100 */
|
||||
#define FMODE_WSPLIT 0x00000200
|
||||
#define FMODE_WSPLIT_INITIALIZED 0x00000400
|
||||
#define FMODE_TRUNC 0x00000800
|
||||
#define FMODE_TEXTMODE 0x00001000
|
||||
/* #define FMODE_PREP 0x00010000 */
|
||||
#define FMODE_SETENC_BY_BOM 0x00100000
|
||||
|
||||
#define GetOpenFile(obj,fp) rb_io_check_closed((fp) = RFILE(rb_io_taint_check(obj))->fptr)
|
||||
|
||||
#define RB_IO_BUFFER_INIT(buf) do {\
|
||||
(buf).ptr = NULL;\
|
||||
(buf).off = 0;\
|
||||
(buf).len = 0;\
|
||||
(buf).capa = 0;\
|
||||
} while (0)
|
||||
|
||||
#define MakeOpenFile(obj, fp) do {\
|
||||
if (RFILE(obj)->fptr) {\
|
||||
rb_io_close(obj);\
|
||||
rb_io_fptr_finalize(RFILE(obj)->fptr);\
|
||||
RFILE(obj)->fptr = 0;\
|
||||
}\
|
||||
(fp) = 0;\
|
||||
RB_IO_FPTR_NEW(fp);\
|
||||
RFILE(obj)->fptr = (fp);\
|
||||
} while (0)
|
||||
|
||||
#define RB_IO_FPTR_NEW(fp) do {\
|
||||
(fp) = ALLOC(rb_io_t);\
|
||||
(fp)->fd = -1;\
|
||||
(fp)->stdio_file = NULL;\
|
||||
(fp)->mode = 0;\
|
||||
(fp)->pid = 0;\
|
||||
(fp)->lineno = 0;\
|
||||
(fp)->pathv = Qnil;\
|
||||
(fp)->finalize = 0;\
|
||||
RB_IO_BUFFER_INIT((fp)->wbuf);\
|
||||
RB_IO_BUFFER_INIT((fp)->rbuf);\
|
||||
RB_IO_BUFFER_INIT((fp)->cbuf);\
|
||||
(fp)->readconv = NULL;\
|
||||
(fp)->writeconv = NULL;\
|
||||
(fp)->writeconv_asciicompat = Qnil;\
|
||||
(fp)->writeconv_pre_ecflags = 0;\
|
||||
(fp)->writeconv_pre_ecopts = Qnil;\
|
||||
(fp)->writeconv_initialized = 0;\
|
||||
(fp)->tied_io_for_writing = 0;\
|
||||
(fp)->encs.enc = NULL;\
|
||||
(fp)->encs.enc2 = NULL;\
|
||||
(fp)->encs.ecflags = 0;\
|
||||
(fp)->encs.ecopts = Qnil;\
|
||||
(fp)->write_lock = 0;\
|
||||
} while (0)
|
||||
|
||||
FILE *rb_io_stdio_file(rb_io_t *fptr);
|
||||
|
||||
FILE *rb_fdopen(int, const char*);
|
||||
int rb_io_modestr_fmode(const char *modestr);
|
||||
int rb_io_modestr_oflags(const char *modestr);
|
||||
int rb_io_oflags_fmode(int oflags);
|
||||
void rb_io_check_writable(rb_io_t*);
|
||||
void rb_io_check_readable(rb_io_t*);
|
||||
void rb_io_check_char_readable(rb_io_t *fptr);
|
||||
void rb_io_check_byte_readable(rb_io_t *fptr);
|
||||
int rb_io_fptr_finalize(rb_io_t*);
|
||||
void rb_io_synchronized(rb_io_t*);
|
||||
void rb_io_check_initialized(rb_io_t*);
|
||||
void rb_io_check_closed(rb_io_t*);
|
||||
VALUE rb_io_get_io(VALUE io);
|
||||
VALUE rb_io_check_io(VALUE io);
|
||||
VALUE rb_io_get_write_io(VALUE io);
|
||||
VALUE rb_io_set_write_io(VALUE io, VALUE w);
|
||||
int rb_io_wait_readable(int);
|
||||
int rb_io_wait_writable(int);
|
||||
int rb_wait_for_single_fd(int fd, int events, struct timeval *tv);
|
||||
void rb_io_set_nonblock(rb_io_t *fptr);
|
||||
int rb_io_extract_encoding_option(VALUE opt, rb_encoding **enc_p, rb_encoding **enc2_p, int *fmode_p);
|
||||
ssize_t rb_io_bufwrite(VALUE io, const void *buf, size_t size);
|
||||
|
||||
/* compatibility for ruby 1.8 and older */
|
||||
#define rb_io_mode_flags(modestr) rb_io_modestr_fmode(modestr)
|
||||
#define rb_io_modenum_flags(oflags) rb_io_oflags_fmode(oflags)
|
||||
|
||||
VALUE rb_io_taint_check(VALUE);
|
||||
NORETURN(void rb_eof_error(void));
|
||||
|
||||
void rb_io_read_check(rb_io_t*);
|
||||
int rb_io_read_pending(rb_io_t*);
|
||||
DEPRECATED(void rb_read_check(FILE*));
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility pop
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
#if 0
|
||||
{ /* satisfy cc-mode */
|
||||
#endif
|
||||
} /* extern "C" { */
|
||||
#endif
|
||||
|
||||
#endif /* RUBY_IO_H */
|
||||
@@ -1,243 +0,0 @@
|
||||
/************************************************
|
||||
|
||||
missing.h - prototype for *.c in ./missing, and
|
||||
for missing timeval struct
|
||||
|
||||
$Author: nagachika $
|
||||
created at: Sat May 11 23:46:03 JST 2002
|
||||
|
||||
************************************************/
|
||||
|
||||
#ifndef RUBY_MISSING_H
|
||||
#define RUBY_MISSING_H 1
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#if 0
|
||||
} /* satisfy cc-mode */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "ruby/config.h"
|
||||
#include <stddef.h>
|
||||
#include <math.h> /* for INFINITY and NAN */
|
||||
#ifdef RUBY_EXTCONF_H
|
||||
#include RUBY_EXTCONF_H
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_STRUCT_TIMEVAL) || !defined(HAVE_STRUCT_TIMESPEC)
|
||||
#if defined(HAVE_TIME_H)
|
||||
# include <time.h>
|
||||
#endif
|
||||
#if defined(HAVE_SYS_TIME_H)
|
||||
# include <sys/time.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_STRUCT_TIMEVAL)
|
||||
struct timeval {
|
||||
time_t tv_sec; /* seconds */
|
||||
long tv_usec; /* microseconds */
|
||||
};
|
||||
#endif /* HAVE_STRUCT_TIMEVAL */
|
||||
|
||||
#if !defined(HAVE_STRUCT_TIMESPEC)
|
||||
struct timespec {
|
||||
time_t tv_sec; /* seconds */
|
||||
long tv_nsec; /* nanoseconds */
|
||||
};
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_STRUCT_TIMEZONE)
|
||||
struct timezone {
|
||||
int tz_minuteswest;
|
||||
int tz_dsttime;
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef RUBY_EXPORT
|
||||
#undef RUBY_EXTERN
|
||||
#endif
|
||||
#ifndef RUBY_EXTERN
|
||||
#define RUBY_EXTERN extern
|
||||
#endif
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility push(default)
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_ACOSH
|
||||
RUBY_EXTERN double acosh(double);
|
||||
RUBY_EXTERN double asinh(double);
|
||||
RUBY_EXTERN double atanh(double);
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_CRYPT
|
||||
RUBY_EXTERN char *crypt(const char *, const char *);
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_DUP2
|
||||
RUBY_EXTERN int dup2(int, int);
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_EACCESS
|
||||
RUBY_EXTERN int eaccess(const char*, int);
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_ROUND
|
||||
RUBY_EXTERN double round(double); /* numeric.c */
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_FINITE
|
||||
RUBY_EXTERN int finite(double);
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_FLOCK
|
||||
RUBY_EXTERN int flock(int, int);
|
||||
#endif
|
||||
|
||||
/*
|
||||
#ifndef HAVE_FREXP
|
||||
RUBY_EXTERN double frexp(double, int *);
|
||||
#endif
|
||||
*/
|
||||
|
||||
#ifndef HAVE_HYPOT
|
||||
RUBY_EXTERN double hypot(double, double);
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_ERF
|
||||
RUBY_EXTERN double erf(double);
|
||||
RUBY_EXTERN double erfc(double);
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_TGAMMA
|
||||
RUBY_EXTERN double tgamma(double);
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_LGAMMA_R
|
||||
RUBY_EXTERN double lgamma_r(double, int *);
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_CBRT
|
||||
RUBY_EXTERN double cbrt(double);
|
||||
#endif
|
||||
|
||||
#if !defined(INFINITY) || !defined(NAN)
|
||||
union bytesequence4_or_float {
|
||||
unsigned char bytesequence[4];
|
||||
float float_value;
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef INFINITY
|
||||
# define HAVE_INFINITY
|
||||
#else
|
||||
/** @internal */
|
||||
RUBY_EXTERN const union bytesequence4_or_float rb_infinity;
|
||||
# define INFINITY (rb_infinity.float_value)
|
||||
#endif
|
||||
|
||||
#ifdef NAN
|
||||
# define HAVE_NAN
|
||||
#else
|
||||
/** @internal */
|
||||
RUBY_EXTERN const union bytesequence4_or_float rb_nan;
|
||||
# define NAN (rb_nan.float_value)
|
||||
#endif
|
||||
|
||||
#ifndef isinf
|
||||
# ifndef HAVE_ISINF
|
||||
# if defined(HAVE_FINITE) && defined(HAVE_ISNAN)
|
||||
# ifdef HAVE_IEEEFP_H
|
||||
# include <ieeefp.h>
|
||||
# endif
|
||||
# define isinf(x) (!finite(x) && !isnan(x))
|
||||
# else
|
||||
RUBY_EXTERN int isinf(double);
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef isnan
|
||||
# ifndef HAVE_ISNAN
|
||||
RUBY_EXTERN int isnan(double);
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
#ifndef HAVE_MEMCMP
|
||||
RUBY_EXTERN int memcmp(const void *, const void *, size_t);
|
||||
#endif
|
||||
*/
|
||||
|
||||
#ifndef HAVE_MEMMOVE
|
||||
RUBY_EXTERN void *memmove(void *, const void *, size_t);
|
||||
#endif
|
||||
|
||||
/*
|
||||
#ifndef HAVE_MODF
|
||||
RUBY_EXTERN double modf(double, double *);
|
||||
#endif
|
||||
*/
|
||||
|
||||
#ifndef HAVE_STRCHR
|
||||
RUBY_EXTERN char *strchr(const char *, int);
|
||||
RUBY_EXTERN char *strrchr(const char *, int);
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_STRERROR
|
||||
RUBY_EXTERN char *strerror(int);
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_STRSTR
|
||||
RUBY_EXTERN char *strstr(const char *, const char *);
|
||||
#endif
|
||||
|
||||
/*
|
||||
#ifndef HAVE_STRTOL
|
||||
RUBY_EXTERN long strtol(const char *, char **, int);
|
||||
#endif
|
||||
*/
|
||||
|
||||
#ifndef HAVE_STRLCPY
|
||||
RUBY_EXTERN size_t strlcpy(char *, const char*, size_t);
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_STRLCAT
|
||||
RUBY_EXTERN size_t strlcat(char *, const char*, size_t);
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_SIGNBIT
|
||||
RUBY_EXTERN int signbit(double x);
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_FFS
|
||||
RUBY_EXTERN int ffs(int);
|
||||
#endif
|
||||
|
||||
#ifdef BROKEN_CLOSE
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
RUBY_EXTERN int ruby_getpeername(int, struct sockaddr *, socklen_t *);
|
||||
RUBY_EXTERN int ruby_getsockname(int, struct sockaddr *, socklen_t *);
|
||||
RUBY_EXTERN int ruby_shutdown(int, int);
|
||||
RUBY_EXTERN int ruby_close(int);
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_SETPROCTITLE
|
||||
RUBY_EXTERN void setproctitle(const char *fmt, ...);
|
||||
#endif
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility pop
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
#if 0
|
||||
{ /* satisfy cc-mode */
|
||||
#endif
|
||||
} /* extern "C" { */
|
||||
#endif
|
||||
|
||||
#endif /* RUBY_MISSING_H */
|
||||
@@ -1,839 +0,0 @@
|
||||
#ifndef ONIGURUMA_H
|
||||
#define ONIGURUMA_H
|
||||
/**********************************************************************
|
||||
oniguruma.h - Onigmo (Oniguruma-mod) (regular expression library)
|
||||
**********************************************************************/
|
||||
/*-
|
||||
* Copyright (c) 2002-2009 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
|
||||
* Copyright (c) 2011-2013 K.Takata <kentkt AT csc DOT jp>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#if 0
|
||||
} /* satisfy cc-mode */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define ONIGURUMA
|
||||
#define ONIGURUMA_VERSION_MAJOR 5
|
||||
#define ONIGURUMA_VERSION_MINOR 13
|
||||
#define ONIGURUMA_VERSION_TEENY 4
|
||||
|
||||
#ifdef __cplusplus
|
||||
# ifndef HAVE_PROTOTYPES
|
||||
# define HAVE_PROTOTYPES 1
|
||||
# endif
|
||||
# ifndef HAVE_STDARG_PROTOTYPES
|
||||
# define HAVE_STDARG_PROTOTYPES 1
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* escape Mac OS X/Xcode 2.4/gcc 4.0.1 problem */
|
||||
#if defined(__APPLE__) && defined(__GNUC__) && __GNUC__ >= 4
|
||||
# ifndef HAVE_STDARG_PROTOTYPES
|
||||
# define HAVE_STDARG_PROTOTYPES 1
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STDARG_H
|
||||
# ifndef HAVE_STDARG_PROTOTYPES
|
||||
# define HAVE_STDARG_PROTOTYPES 1
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef P_
|
||||
#if defined(__STDC__) || defined(_WIN32)
|
||||
# define P_(args) args
|
||||
#else
|
||||
# define P_(args) ()
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef PV_
|
||||
#ifdef HAVE_STDARG_PROTOTYPES
|
||||
# define PV_(args) args
|
||||
#else
|
||||
# define PV_(args) ()
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef ONIG_EXTERN
|
||||
#ifdef RUBY_EXTERN
|
||||
#define ONIG_EXTERN RUBY_EXTERN
|
||||
#else
|
||||
#if defined(_WIN32) && !defined(__GNUC__)
|
||||
#if defined(EXPORT) || defined(RUBY_EXPORT)
|
||||
#define ONIG_EXTERN extern __declspec(dllexport)
|
||||
#else
|
||||
#define ONIG_EXTERN extern __declspec(dllimport)
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef ONIG_EXTERN
|
||||
#define ONIG_EXTERN extern
|
||||
#endif
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility push(default)
|
||||
#endif
|
||||
|
||||
#include <stddef.h> /* for size_t */
|
||||
|
||||
/* PART: character encoding */
|
||||
|
||||
#ifndef ONIG_ESCAPE_UCHAR_COLLISION
|
||||
#define UChar OnigUChar
|
||||
#endif
|
||||
|
||||
typedef unsigned char OnigUChar;
|
||||
typedef unsigned int OnigCodePoint;
|
||||
typedef unsigned int OnigCtype;
|
||||
typedef size_t OnigDistance;
|
||||
typedef ptrdiff_t OnigPosition;
|
||||
|
||||
#define ONIG_INFINITE_DISTANCE ~((OnigDistance )0)
|
||||
|
||||
typedef unsigned int OnigCaseFoldType; /* case fold flag */
|
||||
|
||||
ONIG_EXTERN OnigCaseFoldType OnigDefaultCaseFoldFlag;
|
||||
|
||||
/* #define ONIGENC_CASE_FOLD_HIRAGANA_KATAKANA (1<<1) */
|
||||
/* #define ONIGENC_CASE_FOLD_KATAKANA_WIDTH (1<<2) */
|
||||
#define ONIGENC_CASE_FOLD_TURKISH_AZERI (1<<20)
|
||||
#define INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR (1<<30)
|
||||
|
||||
#define ONIGENC_CASE_FOLD_MIN INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR
|
||||
#define ONIGENC_CASE_FOLD_DEFAULT OnigDefaultCaseFoldFlag
|
||||
|
||||
|
||||
#define ONIGENC_MAX_COMP_CASE_FOLD_CODE_LEN 3
|
||||
#define ONIGENC_GET_CASE_FOLD_CODES_MAX_NUM 13
|
||||
/* 13 => Unicode:0x1ffc */
|
||||
|
||||
/* code range */
|
||||
#define ONIGENC_CODE_RANGE_NUM(range) ((int )range[0])
|
||||
#define ONIGENC_CODE_RANGE_FROM(range,i) range[((i)*2) + 1]
|
||||
#define ONIGENC_CODE_RANGE_TO(range,i) range[((i)*2) + 2]
|
||||
|
||||
typedef struct {
|
||||
int byte_len; /* argument(original) character(s) byte length */
|
||||
int code_len; /* number of code */
|
||||
OnigCodePoint code[ONIGENC_MAX_COMP_CASE_FOLD_CODE_LEN];
|
||||
} OnigCaseFoldCodeItem;
|
||||
|
||||
typedef struct {
|
||||
OnigCodePoint esc;
|
||||
OnigCodePoint anychar;
|
||||
OnigCodePoint anytime;
|
||||
OnigCodePoint zero_or_one_time;
|
||||
OnigCodePoint one_or_more_time;
|
||||
OnigCodePoint anychar_anytime;
|
||||
} OnigMetaCharTableType;
|
||||
|
||||
typedef int (*OnigApplyAllCaseFoldFunc)(OnigCodePoint from, OnigCodePoint* to, int to_len, void* arg);
|
||||
|
||||
typedef struct OnigEncodingTypeST {
|
||||
int (*precise_mbc_enc_len)(const OnigUChar* p,const OnigUChar* e, struct OnigEncodingTypeST* enc);
|
||||
const char* name;
|
||||
int max_enc_len;
|
||||
int min_enc_len;
|
||||
int (*is_mbc_newline)(const OnigUChar* p, const OnigUChar* end, struct OnigEncodingTypeST* enc);
|
||||
OnigCodePoint (*mbc_to_code)(const OnigUChar* p, const OnigUChar* end, struct OnigEncodingTypeST* enc);
|
||||
int (*code_to_mbclen)(OnigCodePoint code, struct OnigEncodingTypeST* enc);
|
||||
int (*code_to_mbc)(OnigCodePoint code, OnigUChar *buf, struct OnigEncodingTypeST* enc);
|
||||
int (*mbc_case_fold)(OnigCaseFoldType flag, const OnigUChar** pp, const OnigUChar* end, OnigUChar* to, struct OnigEncodingTypeST* enc);
|
||||
int (*apply_all_case_fold)(OnigCaseFoldType flag, OnigApplyAllCaseFoldFunc f, void* arg, struct OnigEncodingTypeST* enc);
|
||||
int (*get_case_fold_codes_by_str)(OnigCaseFoldType flag, const OnigUChar* p, const OnigUChar* end, OnigCaseFoldCodeItem acs[], struct OnigEncodingTypeST* enc);
|
||||
int (*property_name_to_ctype)(struct OnigEncodingTypeST* enc, OnigUChar* p, OnigUChar* end);
|
||||
int (*is_code_ctype)(OnigCodePoint code, OnigCtype ctype, struct OnigEncodingTypeST* enc);
|
||||
int (*get_ctype_code_range)(OnigCtype ctype, OnigCodePoint* sb_out, const OnigCodePoint* ranges[], struct OnigEncodingTypeST* enc);
|
||||
OnigUChar* (*left_adjust_char_head)(const OnigUChar* start, const OnigUChar* p, const OnigUChar* end, struct OnigEncodingTypeST* enc);
|
||||
int (*is_allowed_reverse_match)(const OnigUChar* p, const OnigUChar* end, struct OnigEncodingTypeST* enc);
|
||||
int ruby_encoding_index;
|
||||
unsigned int flags;
|
||||
} OnigEncodingType;
|
||||
|
||||
typedef OnigEncodingType* OnigEncoding;
|
||||
|
||||
ONIG_EXTERN OnigEncodingType OnigEncodingASCII;
|
||||
|
||||
#define ONIG_ENCODING_ASCII (&OnigEncodingASCII)
|
||||
|
||||
#define ONIG_ENCODING_UNDEF ((OnigEncoding )0)
|
||||
|
||||
|
||||
/* work size */
|
||||
#define ONIGENC_CODE_TO_MBC_MAXLEN 7
|
||||
#define ONIGENC_MBC_CASE_FOLD_MAXLEN 18
|
||||
/* 18: 6(max-byte) * 3(case-fold chars) */
|
||||
|
||||
/* character types */
|
||||
#define ONIGENC_CTYPE_NEWLINE 0
|
||||
#define ONIGENC_CTYPE_ALPHA 1
|
||||
#define ONIGENC_CTYPE_BLANK 2
|
||||
#define ONIGENC_CTYPE_CNTRL 3
|
||||
#define ONIGENC_CTYPE_DIGIT 4
|
||||
#define ONIGENC_CTYPE_GRAPH 5
|
||||
#define ONIGENC_CTYPE_LOWER 6
|
||||
#define ONIGENC_CTYPE_PRINT 7
|
||||
#define ONIGENC_CTYPE_PUNCT 8
|
||||
#define ONIGENC_CTYPE_SPACE 9
|
||||
#define ONIGENC_CTYPE_UPPER 10
|
||||
#define ONIGENC_CTYPE_XDIGIT 11
|
||||
#define ONIGENC_CTYPE_WORD 12
|
||||
#define ONIGENC_CTYPE_ALNUM 13 /* alpha || digit */
|
||||
#define ONIGENC_CTYPE_ASCII 14
|
||||
#define ONIGENC_MAX_STD_CTYPE ONIGENC_CTYPE_ASCII
|
||||
|
||||
/* flags */
|
||||
#define ONIGENC_FLAG_NONE 0U
|
||||
#define ONIGENC_FLAG_UNICODE 1U
|
||||
|
||||
#define onig_enc_len(enc,p,e) ONIGENC_MBC_ENC_LEN(enc, p, e)
|
||||
|
||||
#define ONIGENC_IS_UNDEF(enc) ((enc) == ONIG_ENCODING_UNDEF)
|
||||
#define ONIGENC_IS_SINGLEBYTE(enc) (ONIGENC_MBC_MAXLEN(enc) == 1)
|
||||
#define ONIGENC_IS_MBC_HEAD(enc,p,e) (ONIGENC_MBC_ENC_LEN(enc,p,e) != 1)
|
||||
#define ONIGENC_IS_MBC_ASCII(p) (*(p) < 128)
|
||||
#define ONIGENC_IS_CODE_ASCII(code) ((code) < 128)
|
||||
#define ONIGENC_IS_MBC_WORD(enc,s,end) \
|
||||
ONIGENC_IS_CODE_WORD(enc,ONIGENC_MBC_TO_CODE(enc,s,end))
|
||||
#define ONIGENC_IS_MBC_ASCII_WORD(enc,s,end) \
|
||||
onigenc_ascii_is_code_ctype( \
|
||||
ONIGENC_MBC_TO_CODE(enc,s,end),ONIGENC_CTYPE_WORD,enc)
|
||||
#define ONIGENC_IS_UNICODE(enc) ((enc)->flags & ONIGENC_FLAG_UNICODE)
|
||||
|
||||
|
||||
#define ONIGENC_NAME(enc) ((enc)->name)
|
||||
|
||||
#define ONIGENC_MBC_CASE_FOLD(enc,flag,pp,end,buf) \
|
||||
(enc)->mbc_case_fold(flag,(const OnigUChar** )pp,end,buf,enc)
|
||||
#define ONIGENC_IS_ALLOWED_REVERSE_MATCH(enc,s,end) \
|
||||
(enc)->is_allowed_reverse_match(s,end,enc)
|
||||
#define ONIGENC_LEFT_ADJUST_CHAR_HEAD(enc,start,s,end) \
|
||||
(enc)->left_adjust_char_head(start, s, end, enc)
|
||||
#define ONIGENC_APPLY_ALL_CASE_FOLD(enc,case_fold_flag,f,arg) \
|
||||
(enc)->apply_all_case_fold(case_fold_flag,f,arg,enc)
|
||||
#define ONIGENC_GET_CASE_FOLD_CODES_BY_STR(enc,case_fold_flag,p,end,acs) \
|
||||
(enc)->get_case_fold_codes_by_str(case_fold_flag,p,end,acs,enc)
|
||||
#define ONIGENC_STEP_BACK(enc,start,s,end,n) \
|
||||
onigenc_step_back((enc),(start),(s),(end),(n))
|
||||
|
||||
#define ONIGENC_CONSTRUCT_MBCLEN_CHARFOUND(n) (n)
|
||||
#define ONIGENC_MBCLEN_CHARFOUND_P(r) (0 < (r))
|
||||
#define ONIGENC_MBCLEN_CHARFOUND_LEN(r) (r)
|
||||
|
||||
#define ONIGENC_CONSTRUCT_MBCLEN_INVALID() (-1)
|
||||
#define ONIGENC_MBCLEN_INVALID_P(r) ((r) == -1)
|
||||
|
||||
#define ONIGENC_CONSTRUCT_MBCLEN_NEEDMORE(n) (-1-(n))
|
||||
#define ONIGENC_MBCLEN_NEEDMORE_P(r) ((r) < -1)
|
||||
#define ONIGENC_MBCLEN_NEEDMORE_LEN(r) (-1-(r))
|
||||
|
||||
#define ONIGENC_PRECISE_MBC_ENC_LEN(enc,p,e) (enc)->precise_mbc_enc_len(p,e,enc)
|
||||
|
||||
ONIG_EXTERN
|
||||
int onigenc_mbclen_approximate P_((const OnigUChar* p,const OnigUChar* e, struct OnigEncodingTypeST* enc));
|
||||
|
||||
#define ONIGENC_MBC_ENC_LEN(enc,p,e) onigenc_mbclen_approximate(p,e,enc)
|
||||
#define ONIGENC_MBC_MAXLEN(enc) ((enc)->max_enc_len)
|
||||
#define ONIGENC_MBC_MAXLEN_DIST(enc) ONIGENC_MBC_MAXLEN(enc)
|
||||
#define ONIGENC_MBC_MINLEN(enc) ((enc)->min_enc_len)
|
||||
#define ONIGENC_IS_MBC_NEWLINE(enc,p,end) (enc)->is_mbc_newline((p),(end),enc)
|
||||
#define ONIGENC_MBC_TO_CODE(enc,p,end) (enc)->mbc_to_code((p),(end),enc)
|
||||
#define ONIGENC_CODE_TO_MBCLEN(enc,code) (enc)->code_to_mbclen(code,enc)
|
||||
#define ONIGENC_CODE_TO_MBC(enc,code,buf) (enc)->code_to_mbc(code,buf,enc)
|
||||
#define ONIGENC_PROPERTY_NAME_TO_CTYPE(enc,p,end) \
|
||||
(enc)->property_name_to_ctype(enc,p,end)
|
||||
|
||||
#define ONIGENC_IS_CODE_CTYPE(enc,code,ctype) (enc)->is_code_ctype(code,ctype,enc)
|
||||
|
||||
#define ONIGENC_IS_CODE_NEWLINE(enc,code) \
|
||||
ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_NEWLINE)
|
||||
#define ONIGENC_IS_CODE_GRAPH(enc,code) \
|
||||
ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_GRAPH)
|
||||
#define ONIGENC_IS_CODE_PRINT(enc,code) \
|
||||
ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_PRINT)
|
||||
#define ONIGENC_IS_CODE_ALNUM(enc,code) \
|
||||
ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_ALNUM)
|
||||
#define ONIGENC_IS_CODE_ALPHA(enc,code) \
|
||||
ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_ALPHA)
|
||||
#define ONIGENC_IS_CODE_LOWER(enc,code) \
|
||||
ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_LOWER)
|
||||
#define ONIGENC_IS_CODE_UPPER(enc,code) \
|
||||
ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_UPPER)
|
||||
#define ONIGENC_IS_CODE_CNTRL(enc,code) \
|
||||
ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_CNTRL)
|
||||
#define ONIGENC_IS_CODE_PUNCT(enc,code) \
|
||||
ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_PUNCT)
|
||||
#define ONIGENC_IS_CODE_SPACE(enc,code) \
|
||||
ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_SPACE)
|
||||
#define ONIGENC_IS_CODE_BLANK(enc,code) \
|
||||
ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_BLANK)
|
||||
#define ONIGENC_IS_CODE_DIGIT(enc,code) \
|
||||
ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_DIGIT)
|
||||
#define ONIGENC_IS_CODE_XDIGIT(enc,code) \
|
||||
ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_XDIGIT)
|
||||
#define ONIGENC_IS_CODE_WORD(enc,code) \
|
||||
ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_WORD)
|
||||
|
||||
#define ONIGENC_GET_CTYPE_CODE_RANGE(enc,ctype,sbout,ranges) \
|
||||
(enc)->get_ctype_code_range(ctype,sbout,ranges,enc)
|
||||
|
||||
ONIG_EXTERN
|
||||
OnigUChar* onigenc_step_back P_((OnigEncoding enc, const OnigUChar* start, const OnigUChar* s, const OnigUChar* end, int n));
|
||||
|
||||
|
||||
/* encoding API */
|
||||
ONIG_EXTERN
|
||||
int onigenc_init P_((void));
|
||||
ONIG_EXTERN
|
||||
int onigenc_set_default_encoding P_((OnigEncoding enc));
|
||||
ONIG_EXTERN
|
||||
OnigEncoding onigenc_get_default_encoding P_((void));
|
||||
ONIG_EXTERN
|
||||
void onigenc_set_default_caseconv_table P_((const OnigUChar* table));
|
||||
ONIG_EXTERN
|
||||
OnigUChar* onigenc_get_right_adjust_char_head_with_prev P_((OnigEncoding enc, const OnigUChar* start, const OnigUChar* s, const OnigUChar* end, const OnigUChar** prev));
|
||||
ONIG_EXTERN
|
||||
OnigUChar* onigenc_get_prev_char_head P_((OnigEncoding enc, const OnigUChar* start, const OnigUChar* s, const OnigUChar* end));
|
||||
ONIG_EXTERN
|
||||
OnigUChar* onigenc_get_left_adjust_char_head P_((OnigEncoding enc, const OnigUChar* start, const OnigUChar* s, const OnigUChar* end));
|
||||
ONIG_EXTERN
|
||||
OnigUChar* onigenc_get_right_adjust_char_head P_((OnigEncoding enc, const OnigUChar* start, const OnigUChar* s, const OnigUChar* end));
|
||||
ONIG_EXTERN
|
||||
int onigenc_strlen P_((OnigEncoding enc, const OnigUChar* p, const OnigUChar* end));
|
||||
ONIG_EXTERN
|
||||
int onigenc_strlen_null P_((OnigEncoding enc, const OnigUChar* p));
|
||||
ONIG_EXTERN
|
||||
int onigenc_str_bytelen_null P_((OnigEncoding enc, const OnigUChar* p));
|
||||
|
||||
|
||||
|
||||
/* PART: regular expression */
|
||||
|
||||
/* config parameters */
|
||||
#define ONIG_NREGION 10
|
||||
#define ONIG_MAX_BACKREF_NUM 1000
|
||||
#define ONIG_MAX_REPEAT_NUM 100000
|
||||
#define ONIG_MAX_MULTI_BYTE_RANGES_NUM 10000
|
||||
/* constants */
|
||||
#define ONIG_MAX_ERROR_MESSAGE_LEN 90
|
||||
|
||||
typedef unsigned int OnigOptionType;
|
||||
|
||||
#define ONIG_OPTION_DEFAULT ONIG_OPTION_NONE
|
||||
|
||||
/* options */
|
||||
#define ONIG_OPTION_NONE 0U
|
||||
#define ONIG_OPTION_IGNORECASE 1U
|
||||
#define ONIG_OPTION_EXTEND (ONIG_OPTION_IGNORECASE << 1)
|
||||
#define ONIG_OPTION_MULTILINE (ONIG_OPTION_EXTEND << 1)
|
||||
#define ONIG_OPTION_DOTALL ONIG_OPTION_MULTILINE
|
||||
#define ONIG_OPTION_SINGLELINE (ONIG_OPTION_MULTILINE << 1)
|
||||
#define ONIG_OPTION_FIND_LONGEST (ONIG_OPTION_SINGLELINE << 1)
|
||||
#define ONIG_OPTION_FIND_NOT_EMPTY (ONIG_OPTION_FIND_LONGEST << 1)
|
||||
#define ONIG_OPTION_NEGATE_SINGLELINE (ONIG_OPTION_FIND_NOT_EMPTY << 1)
|
||||
#define ONIG_OPTION_DONT_CAPTURE_GROUP (ONIG_OPTION_NEGATE_SINGLELINE << 1)
|
||||
#define ONIG_OPTION_CAPTURE_GROUP (ONIG_OPTION_DONT_CAPTURE_GROUP << 1)
|
||||
/* options (search time) */
|
||||
#define ONIG_OPTION_NOTBOL (ONIG_OPTION_CAPTURE_GROUP << 1)
|
||||
#define ONIG_OPTION_NOTEOL (ONIG_OPTION_NOTBOL << 1)
|
||||
#define ONIG_OPTION_POSIX_REGION (ONIG_OPTION_NOTEOL << 1)
|
||||
/* options (ctype range) */
|
||||
#define ONIG_OPTION_ASCII_RANGE (ONIG_OPTION_POSIX_REGION << 1)
|
||||
#define ONIG_OPTION_POSIX_BRACKET_ALL_RANGE (ONIG_OPTION_ASCII_RANGE << 1)
|
||||
#define ONIG_OPTION_WORD_BOUND_ALL_RANGE (ONIG_OPTION_POSIX_BRACKET_ALL_RANGE << 1)
|
||||
/* options (newline) */
|
||||
#define ONIG_OPTION_NEWLINE_CRLF (ONIG_OPTION_WORD_BOUND_ALL_RANGE << 1)
|
||||
#define ONIG_OPTION_MAXBIT ONIG_OPTION_NEWLINE_CRLF /* limit */
|
||||
|
||||
#define ONIG_OPTION_ON(options,regopt) ((options) |= (regopt))
|
||||
#define ONIG_OPTION_OFF(options,regopt) ((options) &= ~(regopt))
|
||||
#define ONIG_IS_OPTION_ON(options,option) ((options) & (option))
|
||||
|
||||
/* syntax */
|
||||
typedef struct {
|
||||
unsigned int op;
|
||||
unsigned int op2;
|
||||
unsigned int behavior;
|
||||
OnigOptionType options; /* default option */
|
||||
OnigMetaCharTableType meta_char_table;
|
||||
} OnigSyntaxType;
|
||||
|
||||
ONIG_EXTERN const OnigSyntaxType OnigSyntaxASIS;
|
||||
ONIG_EXTERN const OnigSyntaxType OnigSyntaxPosixBasic;
|
||||
ONIG_EXTERN const OnigSyntaxType OnigSyntaxPosixExtended;
|
||||
ONIG_EXTERN const OnigSyntaxType OnigSyntaxEmacs;
|
||||
ONIG_EXTERN const OnigSyntaxType OnigSyntaxGrep;
|
||||
ONIG_EXTERN const OnigSyntaxType OnigSyntaxGnuRegex;
|
||||
ONIG_EXTERN const OnigSyntaxType OnigSyntaxJava;
|
||||
ONIG_EXTERN const OnigSyntaxType OnigSyntaxPerl58;
|
||||
ONIG_EXTERN const OnigSyntaxType OnigSyntaxPerl58_NG;
|
||||
ONIG_EXTERN const OnigSyntaxType OnigSyntaxPerl;
|
||||
ONIG_EXTERN const OnigSyntaxType OnigSyntaxRuby;
|
||||
ONIG_EXTERN const OnigSyntaxType OnigSyntaxPython;
|
||||
|
||||
/* predefined syntaxes (see regsyntax.c) */
|
||||
#define ONIG_SYNTAX_ASIS (&OnigSyntaxASIS)
|
||||
#define ONIG_SYNTAX_POSIX_BASIC (&OnigSyntaxPosixBasic)
|
||||
#define ONIG_SYNTAX_POSIX_EXTENDED (&OnigSyntaxPosixExtended)
|
||||
#define ONIG_SYNTAX_EMACS (&OnigSyntaxEmacs)
|
||||
#define ONIG_SYNTAX_GREP (&OnigSyntaxGrep)
|
||||
#define ONIG_SYNTAX_GNU_REGEX (&OnigSyntaxGnuRegex)
|
||||
#define ONIG_SYNTAX_JAVA (&OnigSyntaxJava)
|
||||
#define ONIG_SYNTAX_PERL58 (&OnigSyntaxPerl58)
|
||||
#define ONIG_SYNTAX_PERL58_NG (&OnigSyntaxPerl58_NG)
|
||||
#define ONIG_SYNTAX_PERL (&OnigSyntaxPerl)
|
||||
#define ONIG_SYNTAX_RUBY (&OnigSyntaxRuby)
|
||||
#define ONIG_SYNTAX_PYTHON (&OnigSyntaxPython)
|
||||
|
||||
/* default syntax */
|
||||
ONIG_EXTERN const OnigSyntaxType* OnigDefaultSyntax;
|
||||
#define ONIG_SYNTAX_DEFAULT OnigDefaultSyntax
|
||||
|
||||
/* syntax (operators) */
|
||||
#define ONIG_SYN_OP_VARIABLE_META_CHARACTERS (1U<<0)
|
||||
#define ONIG_SYN_OP_DOT_ANYCHAR (1U<<1) /* . */
|
||||
#define ONIG_SYN_OP_ASTERISK_ZERO_INF (1U<<2) /* * */
|
||||
#define ONIG_SYN_OP_ESC_ASTERISK_ZERO_INF (1U<<3)
|
||||
#define ONIG_SYN_OP_PLUS_ONE_INF (1U<<4) /* + */
|
||||
#define ONIG_SYN_OP_ESC_PLUS_ONE_INF (1U<<5)
|
||||
#define ONIG_SYN_OP_QMARK_ZERO_ONE (1U<<6) /* ? */
|
||||
#define ONIG_SYN_OP_ESC_QMARK_ZERO_ONE (1U<<7)
|
||||
#define ONIG_SYN_OP_BRACE_INTERVAL (1U<<8) /* {lower,upper} */
|
||||
#define ONIG_SYN_OP_ESC_BRACE_INTERVAL (1U<<9) /* \{lower,upper\} */
|
||||
#define ONIG_SYN_OP_VBAR_ALT (1U<<10) /* | */
|
||||
#define ONIG_SYN_OP_ESC_VBAR_ALT (1U<<11) /* \| */
|
||||
#define ONIG_SYN_OP_LPAREN_SUBEXP (1U<<12) /* (...) */
|
||||
#define ONIG_SYN_OP_ESC_LPAREN_SUBEXP (1U<<13) /* \(...\) */
|
||||
#define ONIG_SYN_OP_ESC_AZ_BUF_ANCHOR (1U<<14) /* \A, \Z, \z */
|
||||
#define ONIG_SYN_OP_ESC_CAPITAL_G_BEGIN_ANCHOR (1U<<15) /* \G */
|
||||
#define ONIG_SYN_OP_DECIMAL_BACKREF (1U<<16) /* \num */
|
||||
#define ONIG_SYN_OP_BRACKET_CC (1U<<17) /* [...] */
|
||||
#define ONIG_SYN_OP_ESC_W_WORD (1U<<18) /* \w, \W */
|
||||
#define ONIG_SYN_OP_ESC_LTGT_WORD_BEGIN_END (1U<<19) /* \<. \> */
|
||||
#define ONIG_SYN_OP_ESC_B_WORD_BOUND (1U<<20) /* \b, \B */
|
||||
#define ONIG_SYN_OP_ESC_S_WHITE_SPACE (1U<<21) /* \s, \S */
|
||||
#define ONIG_SYN_OP_ESC_D_DIGIT (1U<<22) /* \d, \D */
|
||||
#define ONIG_SYN_OP_LINE_ANCHOR (1U<<23) /* ^, $ */
|
||||
#define ONIG_SYN_OP_POSIX_BRACKET (1U<<24) /* [:xxxx:] */
|
||||
#define ONIG_SYN_OP_QMARK_NON_GREEDY (1U<<25) /* ??,*?,+?,{n,m}? */
|
||||
#define ONIG_SYN_OP_ESC_CONTROL_CHARS (1U<<26) /* \n,\r,\t,\a ... */
|
||||
#define ONIG_SYN_OP_ESC_C_CONTROL (1U<<27) /* \cx */
|
||||
#define ONIG_SYN_OP_ESC_OCTAL3 (1U<<28) /* \OOO */
|
||||
#define ONIG_SYN_OP_ESC_X_HEX2 (1U<<29) /* \xHH */
|
||||
#define ONIG_SYN_OP_ESC_X_BRACE_HEX8 (1U<<30) /* \x{7HHHHHHH} */
|
||||
#define ONIG_SYN_OP_ESC_O_BRACE_OCTAL (1U<<31) /* \o{OOO} */ /* NOTIMPL */
|
||||
|
||||
#define ONIG_SYN_OP2_ESC_CAPITAL_Q_QUOTE (1U<<0) /* \Q...\E */
|
||||
#define ONIG_SYN_OP2_QMARK_GROUP_EFFECT (1U<<1) /* (?...) */
|
||||
#define ONIG_SYN_OP2_OPTION_PERL (1U<<2) /* (?imsxadlu), (?-imsx), (?^imsxalu) */
|
||||
#define ONIG_SYN_OP2_OPTION_RUBY (1U<<3) /* (?imxadu), (?-imx) */
|
||||
#define ONIG_SYN_OP2_PLUS_POSSESSIVE_REPEAT (1U<<4) /* ?+,*+,++ */
|
||||
#define ONIG_SYN_OP2_PLUS_POSSESSIVE_INTERVAL (1U<<5) /* {n,m}+ */
|
||||
#define ONIG_SYN_OP2_CCLASS_SET_OP (1U<<6) /* [...&&..[..]..] */
|
||||
#define ONIG_SYN_OP2_QMARK_LT_NAMED_GROUP (1U<<7) /* (?<name>...) */
|
||||
#define ONIG_SYN_OP2_ESC_K_NAMED_BACKREF (1U<<8) /* \k<name> */
|
||||
#define ONIG_SYN_OP2_ESC_G_SUBEXP_CALL (1U<<9) /* \g<name>, \g<n> */
|
||||
#define ONIG_SYN_OP2_ATMARK_CAPTURE_HISTORY (1U<<10) /* (?@..),(?@<x>..) */
|
||||
#define ONIG_SYN_OP2_ESC_CAPITAL_C_BAR_CONTROL (1U<<11) /* \C-x */
|
||||
#define ONIG_SYN_OP2_ESC_CAPITAL_M_BAR_META (1U<<12) /* \M-x */
|
||||
#define ONIG_SYN_OP2_ESC_V_VTAB (1U<<13) /* \v as VTAB */
|
||||
#define ONIG_SYN_OP2_ESC_U_HEX4 (1U<<14) /* \uHHHH */
|
||||
#define ONIG_SYN_OP2_ESC_GNU_BUF_ANCHOR (1U<<15) /* \`, \' */
|
||||
#define ONIG_SYN_OP2_ESC_P_BRACE_CHAR_PROPERTY (1U<<16) /* \p{...}, \P{...} */
|
||||
#define ONIG_SYN_OP2_ESC_P_BRACE_CIRCUMFLEX_NOT (1U<<17) /* \p{^..}, \P{^..} */
|
||||
/* #define ONIG_SYN_OP2_CHAR_PROPERTY_PREFIX_IS (1U<<18) */
|
||||
#define ONIG_SYN_OP2_ESC_H_XDIGIT (1U<<19) /* \h, \H */
|
||||
#define ONIG_SYN_OP2_INEFFECTIVE_ESCAPE (1U<<20) /* \ */
|
||||
#define ONIG_SYN_OP2_ESC_CAPITAL_R_LINEBREAK (1U<<21) /* \R as (?>\x0D\x0A|[\x0A-\x0D\x{85}\x{2028}\x{2029}]) */
|
||||
#define ONIG_SYN_OP2_ESC_CAPITAL_X_EXTENDED_GRAPHEME_CLUSTER (1U<<22) /* \X as (?>\P{M}\p{M}*) */
|
||||
#define ONIG_SYN_OP2_ESC_V_VERTICAL_WHITESPACE (1U<<23) /* \v, \V -- Perl */ /* NOTIMPL */
|
||||
#define ONIG_SYN_OP2_ESC_H_HORIZONTAL_WHITESPACE (1U<<24) /* \h, \H -- Perl */ /* NOTIMPL */
|
||||
#define ONIG_SYN_OP2_ESC_CAPITAL_K_KEEP (1U<<25) /* \K */
|
||||
#define ONIG_SYN_OP2_ESC_G_BRACE_BACKREF (1U<<26) /* \g{name}, \g{n} */
|
||||
#define ONIG_SYN_OP2_QMARK_SUBEXP_CALL (1U<<27) /* (?&name), (?n), (?R), (?0) */
|
||||
#define ONIG_SYN_OP2_QMARK_VBAR_BRANCH_RESET (1U<<28) /* (?|...) */ /* NOTIMPL */
|
||||
#define ONIG_SYN_OP2_QMARK_LPAREN_CONDITION (1U<<29) /* (?(cond)yes...|no...) */
|
||||
#define ONIG_SYN_OP2_QMARK_CAPITAL_P_NAMED_GROUP (1U<<30) /* (?P<name>...), (?P=name), (?P>name) -- Python/PCRE */
|
||||
#define ONIG_SYN_OP2_OPTION_JAVA (1U<<31) /* (?idmsux), (?-idmsux) */ /* NOTIMPL */
|
||||
|
||||
/* syntax (behavior) */
|
||||
#define ONIG_SYN_CONTEXT_INDEP_ANCHORS (1U<<31) /* not implemented */
|
||||
#define ONIG_SYN_CONTEXT_INDEP_REPEAT_OPS (1U<<0) /* ?, *, +, {n,m} */
|
||||
#define ONIG_SYN_CONTEXT_INVALID_REPEAT_OPS (1U<<1) /* error or ignore */
|
||||
#define ONIG_SYN_ALLOW_UNMATCHED_CLOSE_SUBEXP (1U<<2) /* ...)... */
|
||||
#define ONIG_SYN_ALLOW_INVALID_INTERVAL (1U<<3) /* {??? */
|
||||
#define ONIG_SYN_ALLOW_INTERVAL_LOW_ABBREV (1U<<4) /* {,n} => {0,n} */
|
||||
#define ONIG_SYN_STRICT_CHECK_BACKREF (1U<<5) /* /(\1)/,/\1()/ ..*/
|
||||
#define ONIG_SYN_DIFFERENT_LEN_ALT_LOOK_BEHIND (1U<<6) /* (?<=a|bc) */
|
||||
#define ONIG_SYN_CAPTURE_ONLY_NAMED_GROUP (1U<<7) /* see doc/RE */
|
||||
#define ONIG_SYN_ALLOW_MULTIPLEX_DEFINITION_NAME (1U<<8) /* (?<x>)(?<x>) */
|
||||
#define ONIG_SYN_FIXED_INTERVAL_IS_GREEDY_ONLY (1U<<9) /* a{n}?=(?:a{n})? */
|
||||
#define ONIG_SYN_ALLOW_MULTIPLEX_DEFINITION_NAME_CALL (1U<<10) /* (?<x>)(?<x>)(?&x) */
|
||||
|
||||
/* syntax (behavior) in char class [...] */
|
||||
#define ONIG_SYN_NOT_NEWLINE_IN_NEGATIVE_CC (1U<<20) /* [^...] */
|
||||
#define ONIG_SYN_BACKSLASH_ESCAPE_IN_CC (1U<<21) /* [..\w..] etc.. */
|
||||
#define ONIG_SYN_ALLOW_EMPTY_RANGE_IN_CC (1U<<22)
|
||||
#define ONIG_SYN_ALLOW_DOUBLE_RANGE_OP_IN_CC (1U<<23) /* [0-9-a]=[0-9\-a] */
|
||||
/* syntax (behavior) warning */
|
||||
#define ONIG_SYN_WARN_CC_OP_NOT_ESCAPED (1U<<24) /* [,-,] */
|
||||
#define ONIG_SYN_WARN_REDUNDANT_NESTED_REPEAT (1U<<25) /* (?:a*)+ */
|
||||
#define ONIG_SYN_WARN_CC_DUP (1U<<26) /* [aa] */
|
||||
|
||||
/* meta character specifiers (onig_set_meta_char()) */
|
||||
#define ONIG_META_CHAR_ESCAPE 0
|
||||
#define ONIG_META_CHAR_ANYCHAR 1
|
||||
#define ONIG_META_CHAR_ANYTIME 2
|
||||
#define ONIG_META_CHAR_ZERO_OR_ONE_TIME 3
|
||||
#define ONIG_META_CHAR_ONE_OR_MORE_TIME 4
|
||||
#define ONIG_META_CHAR_ANYCHAR_ANYTIME 5
|
||||
|
||||
#define ONIG_INEFFECTIVE_META_CHAR 0
|
||||
|
||||
/* error codes */
|
||||
#define ONIG_IS_PATTERN_ERROR(ecode) ((ecode) <= -100 && (ecode) > -1000)
|
||||
/* normal return */
|
||||
#define ONIG_NORMAL 0
|
||||
#define ONIG_MISMATCH -1
|
||||
#define ONIG_NO_SUPPORT_CONFIG -2
|
||||
|
||||
/* internal error */
|
||||
#define ONIGERR_MEMORY -5
|
||||
#define ONIGERR_TYPE_BUG -6
|
||||
#define ONIGERR_PARSER_BUG -11
|
||||
#define ONIGERR_STACK_BUG -12
|
||||
#define ONIGERR_UNDEFINED_BYTECODE -13
|
||||
#define ONIGERR_UNEXPECTED_BYTECODE -14
|
||||
#define ONIGERR_MATCH_STACK_LIMIT_OVER -15
|
||||
#define ONIGERR_DEFAULT_ENCODING_IS_NOT_SET -21
|
||||
#define ONIGERR_SPECIFIED_ENCODING_CANT_CONVERT_TO_WIDE_CHAR -22
|
||||
/* general error */
|
||||
#define ONIGERR_INVALID_ARGUMENT -30
|
||||
/* syntax error */
|
||||
#define ONIGERR_END_PATTERN_AT_LEFT_BRACE -100
|
||||
#define ONIGERR_END_PATTERN_AT_LEFT_BRACKET -101
|
||||
#define ONIGERR_EMPTY_CHAR_CLASS -102
|
||||
#define ONIGERR_PREMATURE_END_OF_CHAR_CLASS -103
|
||||
#define ONIGERR_END_PATTERN_AT_ESCAPE -104
|
||||
#define ONIGERR_END_PATTERN_AT_META -105
|
||||
#define ONIGERR_END_PATTERN_AT_CONTROL -106
|
||||
#define ONIGERR_META_CODE_SYNTAX -108
|
||||
#define ONIGERR_CONTROL_CODE_SYNTAX -109
|
||||
#define ONIGERR_CHAR_CLASS_VALUE_AT_END_OF_RANGE -110
|
||||
#define ONIGERR_CHAR_CLASS_VALUE_AT_START_OF_RANGE -111
|
||||
#define ONIGERR_UNMATCHED_RANGE_SPECIFIER_IN_CHAR_CLASS -112
|
||||
#define ONIGERR_TARGET_OF_REPEAT_OPERATOR_NOT_SPECIFIED -113
|
||||
#define ONIGERR_TARGET_OF_REPEAT_OPERATOR_INVALID -114
|
||||
#define ONIGERR_NESTED_REPEAT_OPERATOR -115
|
||||
#define ONIGERR_UNMATCHED_CLOSE_PARENTHESIS -116
|
||||
#define ONIGERR_END_PATTERN_WITH_UNMATCHED_PARENTHESIS -117
|
||||
#define ONIGERR_END_PATTERN_IN_GROUP -118
|
||||
#define ONIGERR_UNDEFINED_GROUP_OPTION -119
|
||||
#define ONIGERR_INVALID_POSIX_BRACKET_TYPE -121
|
||||
#define ONIGERR_INVALID_LOOK_BEHIND_PATTERN -122
|
||||
#define ONIGERR_INVALID_REPEAT_RANGE_PATTERN -123
|
||||
#define ONIGERR_INVALID_CONDITION_PATTERN -124
|
||||
/* values error (syntax error) */
|
||||
#define ONIGERR_TOO_BIG_NUMBER -200
|
||||
#define ONIGERR_TOO_BIG_NUMBER_FOR_REPEAT_RANGE -201
|
||||
#define ONIGERR_UPPER_SMALLER_THAN_LOWER_IN_REPEAT_RANGE -202
|
||||
#define ONIGERR_EMPTY_RANGE_IN_CHAR_CLASS -203
|
||||
#define ONIGERR_MISMATCH_CODE_LENGTH_IN_CLASS_RANGE -204
|
||||
#define ONIGERR_TOO_MANY_MULTI_BYTE_RANGES -205
|
||||
#define ONIGERR_TOO_SHORT_MULTI_BYTE_STRING -206
|
||||
#define ONIGERR_TOO_BIG_BACKREF_NUMBER -207
|
||||
#define ONIGERR_INVALID_BACKREF -208
|
||||
#define ONIGERR_NUMBERED_BACKREF_OR_CALL_NOT_ALLOWED -209
|
||||
#define ONIGERR_TOO_SHORT_DIGITS -210
|
||||
#define ONIGERR_TOO_LONG_WIDE_CHAR_VALUE -212
|
||||
#define ONIGERR_EMPTY_GROUP_NAME -214
|
||||
#define ONIGERR_INVALID_GROUP_NAME -215
|
||||
#define ONIGERR_INVALID_CHAR_IN_GROUP_NAME -216
|
||||
#define ONIGERR_UNDEFINED_NAME_REFERENCE -217
|
||||
#define ONIGERR_UNDEFINED_GROUP_REFERENCE -218
|
||||
#define ONIGERR_MULTIPLEX_DEFINED_NAME -219
|
||||
#define ONIGERR_MULTIPLEX_DEFINITION_NAME_CALL -220
|
||||
#define ONIGERR_NEVER_ENDING_RECURSION -221
|
||||
#define ONIGERR_GROUP_NUMBER_OVER_FOR_CAPTURE_HISTORY -222
|
||||
#define ONIGERR_INVALID_CHAR_PROPERTY_NAME -223
|
||||
#define ONIGERR_INVALID_CODE_POINT_VALUE -400
|
||||
#define ONIGERR_INVALID_WIDE_CHAR_VALUE -400
|
||||
#define ONIGERR_TOO_BIG_WIDE_CHAR_VALUE -401
|
||||
#define ONIGERR_NOT_SUPPORTED_ENCODING_COMBINATION -402
|
||||
#define ONIGERR_INVALID_COMBINATION_OF_OPTIONS -403
|
||||
|
||||
/* errors related to thread */
|
||||
#define ONIGERR_OVER_THREAD_PASS_LIMIT_COUNT -1001
|
||||
|
||||
|
||||
/* must be smaller than BIT_STATUS_BITS_NUM (unsigned int * 8) */
|
||||
#define ONIG_MAX_CAPTURE_HISTORY_GROUP 31
|
||||
#define ONIG_IS_CAPTURE_HISTORY_GROUP(r, i) \
|
||||
((i) <= ONIG_MAX_CAPTURE_HISTORY_GROUP && (r)->list && (r)->list[i])
|
||||
|
||||
typedef struct OnigCaptureTreeNodeStruct {
|
||||
int group; /* group number */
|
||||
OnigPosition beg;
|
||||
OnigPosition end;
|
||||
int allocated;
|
||||
int num_childs;
|
||||
struct OnigCaptureTreeNodeStruct** childs;
|
||||
} OnigCaptureTreeNode;
|
||||
|
||||
/* match result region type */
|
||||
struct re_registers {
|
||||
int allocated;
|
||||
int num_regs;
|
||||
OnigPosition* beg;
|
||||
OnigPosition* end;
|
||||
/* extended */
|
||||
OnigCaptureTreeNode* history_root; /* capture history tree root */
|
||||
};
|
||||
|
||||
/* capture tree traverse */
|
||||
#define ONIG_TRAVERSE_CALLBACK_AT_FIRST 1
|
||||
#define ONIG_TRAVERSE_CALLBACK_AT_LAST 2
|
||||
#define ONIG_TRAVERSE_CALLBACK_AT_BOTH \
|
||||
( ONIG_TRAVERSE_CALLBACK_AT_FIRST | ONIG_TRAVERSE_CALLBACK_AT_LAST )
|
||||
|
||||
|
||||
#define ONIG_REGION_NOTPOS -1
|
||||
|
||||
typedef struct re_registers OnigRegion;
|
||||
|
||||
typedef struct {
|
||||
OnigEncoding enc;
|
||||
OnigUChar* par;
|
||||
OnigUChar* par_end;
|
||||
} OnigErrorInfo;
|
||||
|
||||
typedef struct {
|
||||
int lower;
|
||||
int upper;
|
||||
} OnigRepeatRange;
|
||||
|
||||
typedef void (*OnigWarnFunc) P_((const char* s));
|
||||
extern void onig_null_warn P_((const char* s));
|
||||
#define ONIG_NULL_WARN onig_null_warn
|
||||
|
||||
#define ONIG_CHAR_TABLE_SIZE 256
|
||||
|
||||
/* regex_t state */
|
||||
#define ONIG_STATE_NORMAL 0
|
||||
#define ONIG_STATE_SEARCHING 1
|
||||
#define ONIG_STATE_COMPILING -1
|
||||
#define ONIG_STATE_MODIFY -2
|
||||
|
||||
#define ONIG_STATE(reg) \
|
||||
((reg)->state > 0 ? ONIG_STATE_SEARCHING : (reg)->state)
|
||||
|
||||
typedef struct re_pattern_buffer {
|
||||
/* common members of BBuf(bytes-buffer) */
|
||||
unsigned char* p; /* compiled pattern */
|
||||
unsigned int used; /* used space for p */
|
||||
unsigned int alloc; /* allocated space for p */
|
||||
|
||||
int state; /* normal, searching, compiling */
|
||||
int num_mem; /* used memory(...) num counted from 1 */
|
||||
int num_repeat; /* OP_REPEAT/OP_REPEAT_NG id-counter */
|
||||
int num_null_check; /* OP_NULL_CHECK_START/END id counter */
|
||||
int num_comb_exp_check; /* combination explosion check */
|
||||
int num_call; /* number of subexp call */
|
||||
unsigned int capture_history; /* (?@...) flag (1-31) */
|
||||
unsigned int bt_mem_start; /* need backtrack flag */
|
||||
unsigned int bt_mem_end; /* need backtrack flag */
|
||||
int stack_pop_level;
|
||||
int repeat_range_alloc;
|
||||
OnigRepeatRange* repeat_range;
|
||||
|
||||
OnigEncoding enc;
|
||||
OnigOptionType options;
|
||||
const OnigSyntaxType* syntax;
|
||||
OnigCaseFoldType case_fold_flag;
|
||||
void* name_table;
|
||||
|
||||
/* optimization info (string search, char-map and anchors) */
|
||||
int optimize; /* optimize flag */
|
||||
int threshold_len; /* search str-length for apply optimize */
|
||||
int anchor; /* BEGIN_BUF, BEGIN_POS, (SEMI_)END_BUF */
|
||||
OnigDistance anchor_dmin; /* (SEMI_)END_BUF anchor distance */
|
||||
OnigDistance anchor_dmax; /* (SEMI_)END_BUF anchor distance */
|
||||
int sub_anchor; /* start-anchor for exact or map */
|
||||
unsigned char *exact;
|
||||
unsigned char *exact_end;
|
||||
unsigned char map[ONIG_CHAR_TABLE_SIZE]; /* used as BM skip or char-map */
|
||||
int *int_map; /* BM skip for exact_len > 255 */
|
||||
int *int_map_backward; /* BM skip for backward search */
|
||||
OnigDistance dmin; /* min-distance of exact or map */
|
||||
OnigDistance dmax; /* max-distance of exact or map */
|
||||
|
||||
/* regex_t link chain */
|
||||
struct re_pattern_buffer* chain; /* escape compile-conflict */
|
||||
} OnigRegexType;
|
||||
|
||||
typedef OnigRegexType* OnigRegex;
|
||||
|
||||
#ifndef ONIG_ESCAPE_REGEX_T_COLLISION
|
||||
typedef OnigRegexType regex_t;
|
||||
#endif
|
||||
|
||||
|
||||
typedef struct {
|
||||
int num_of_elements;
|
||||
OnigEncoding pattern_enc;
|
||||
OnigEncoding target_enc;
|
||||
OnigSyntaxType* syntax;
|
||||
OnigOptionType option;
|
||||
OnigCaseFoldType case_fold_flag;
|
||||
} OnigCompileInfo;
|
||||
|
||||
/* Oniguruma Native API */
|
||||
ONIG_EXTERN
|
||||
int onig_init P_((void));
|
||||
ONIG_EXTERN
|
||||
int onig_error_code_to_str PV_((OnigUChar* s, OnigPosition err_code, ...));
|
||||
ONIG_EXTERN
|
||||
void onig_set_warn_func P_((OnigWarnFunc f));
|
||||
ONIG_EXTERN
|
||||
void onig_set_verb_warn_func P_((OnigWarnFunc f));
|
||||
ONIG_EXTERN
|
||||
int onig_new P_((OnigRegex*, const OnigUChar* pattern, const OnigUChar* pattern_end, OnigOptionType option, OnigEncoding enc, const OnigSyntaxType* syntax, OnigErrorInfo* einfo));
|
||||
ONIG_EXTERN
|
||||
int onig_reg_init P_((OnigRegex reg, OnigOptionType option, OnigCaseFoldType case_fold_flag, OnigEncoding enc, const OnigSyntaxType* syntax));
|
||||
ONIG_EXTERN
|
||||
int onig_new_without_alloc P_((OnigRegex, const OnigUChar* pattern, const OnigUChar* pattern_end, OnigOptionType option, OnigEncoding enc, OnigSyntaxType* syntax, OnigErrorInfo* einfo));
|
||||
ONIG_EXTERN
|
||||
int onig_new_deluxe P_((OnigRegex* reg, const OnigUChar* pattern, const OnigUChar* pattern_end, OnigCompileInfo* ci, OnigErrorInfo* einfo));
|
||||
ONIG_EXTERN
|
||||
void onig_free P_((OnigRegex));
|
||||
ONIG_EXTERN
|
||||
void onig_free_body P_((OnigRegex));
|
||||
ONIG_EXTERN
|
||||
int onig_recompile P_((OnigRegex, const OnigUChar* pattern, const OnigUChar* pattern_end, OnigOptionType option, OnigEncoding enc, OnigSyntaxType* syntax, OnigErrorInfo* einfo));
|
||||
ONIG_EXTERN
|
||||
int onig_recompile_deluxe P_((OnigRegex reg, const OnigUChar* pattern, const OnigUChar* pattern_end, OnigCompileInfo* ci, OnigErrorInfo* einfo));
|
||||
ONIG_EXTERN
|
||||
OnigPosition onig_search P_((OnigRegex, const OnigUChar* str, const OnigUChar* end, const OnigUChar* start, const OnigUChar* range, OnigRegion* region, OnigOptionType option));
|
||||
ONIG_EXTERN
|
||||
OnigPosition onig_search_gpos P_((OnigRegex, const OnigUChar* str, const OnigUChar* end, const OnigUChar* global_pos, const OnigUChar* start, const OnigUChar* range, OnigRegion* region, OnigOptionType option));
|
||||
ONIG_EXTERN
|
||||
OnigPosition onig_match P_((OnigRegex, const OnigUChar* str, const OnigUChar* end, const OnigUChar* at, OnigRegion* region, OnigOptionType option));
|
||||
ONIG_EXTERN
|
||||
OnigRegion* onig_region_new P_((void));
|
||||
ONIG_EXTERN
|
||||
void onig_region_init P_((OnigRegion* region));
|
||||
ONIG_EXTERN
|
||||
void onig_region_free P_((OnigRegion* region, int free_self));
|
||||
ONIG_EXTERN
|
||||
void onig_region_copy P_((OnigRegion* to, OnigRegion* from));
|
||||
ONIG_EXTERN
|
||||
void onig_region_clear P_((OnigRegion* region));
|
||||
ONIG_EXTERN
|
||||
int onig_region_resize P_((OnigRegion* region, int n));
|
||||
ONIG_EXTERN
|
||||
int onig_region_set P_((OnigRegion* region, int at, int beg, int end));
|
||||
ONIG_EXTERN
|
||||
int onig_name_to_group_numbers P_((OnigRegex reg, const OnigUChar* name, const OnigUChar* name_end, int** nums));
|
||||
ONIG_EXTERN
|
||||
int onig_name_to_backref_number P_((OnigRegex reg, const OnigUChar* name, const OnigUChar* name_end, OnigRegion *region));
|
||||
ONIG_EXTERN
|
||||
int onig_foreach_name P_((OnigRegex reg, int (*func)(const OnigUChar*, const OnigUChar*,int,int*,OnigRegex,void*), void* arg));
|
||||
ONIG_EXTERN
|
||||
int onig_number_of_names P_((OnigRegex reg));
|
||||
ONIG_EXTERN
|
||||
int onig_number_of_captures P_((OnigRegex reg));
|
||||
ONIG_EXTERN
|
||||
int onig_number_of_capture_histories P_((OnigRegex reg));
|
||||
ONIG_EXTERN
|
||||
OnigCaptureTreeNode* onig_get_capture_tree P_((OnigRegion* region));
|
||||
ONIG_EXTERN
|
||||
int onig_capture_tree_traverse P_((OnigRegion* region, int at, int(*callback_func)(int,OnigPosition,OnigPosition,int,int,void*), void* arg));
|
||||
ONIG_EXTERN
|
||||
int onig_noname_group_capture_is_active P_((OnigRegex reg));
|
||||
ONIG_EXTERN
|
||||
OnigEncoding onig_get_encoding P_((OnigRegex reg));
|
||||
ONIG_EXTERN
|
||||
OnigOptionType onig_get_options P_((OnigRegex reg));
|
||||
ONIG_EXTERN
|
||||
OnigCaseFoldType onig_get_case_fold_flag P_((OnigRegex reg));
|
||||
ONIG_EXTERN
|
||||
const OnigSyntaxType* onig_get_syntax P_((OnigRegex reg));
|
||||
ONIG_EXTERN
|
||||
int onig_set_default_syntax P_((const OnigSyntaxType* syntax));
|
||||
ONIG_EXTERN
|
||||
void onig_copy_syntax P_((OnigSyntaxType* to, const OnigSyntaxType* from));
|
||||
ONIG_EXTERN
|
||||
unsigned int onig_get_syntax_op P_((OnigSyntaxType* syntax));
|
||||
ONIG_EXTERN
|
||||
unsigned int onig_get_syntax_op2 P_((OnigSyntaxType* syntax));
|
||||
ONIG_EXTERN
|
||||
unsigned int onig_get_syntax_behavior P_((OnigSyntaxType* syntax));
|
||||
ONIG_EXTERN
|
||||
OnigOptionType onig_get_syntax_options P_((OnigSyntaxType* syntax));
|
||||
ONIG_EXTERN
|
||||
void onig_set_syntax_op P_((OnigSyntaxType* syntax, unsigned int op));
|
||||
ONIG_EXTERN
|
||||
void onig_set_syntax_op2 P_((OnigSyntaxType* syntax, unsigned int op2));
|
||||
ONIG_EXTERN
|
||||
void onig_set_syntax_behavior P_((OnigSyntaxType* syntax, unsigned int behavior));
|
||||
ONIG_EXTERN
|
||||
void onig_set_syntax_options P_((OnigSyntaxType* syntax, OnigOptionType options));
|
||||
ONIG_EXTERN
|
||||
int onig_set_meta_char P_((OnigSyntaxType* syntax, unsigned int what, OnigCodePoint code));
|
||||
ONIG_EXTERN
|
||||
void onig_copy_encoding P_((OnigEncoding to, OnigEncoding from));
|
||||
ONIG_EXTERN
|
||||
OnigCaseFoldType onig_get_default_case_fold_flag P_((void));
|
||||
ONIG_EXTERN
|
||||
int onig_set_default_case_fold_flag P_((OnigCaseFoldType case_fold_flag));
|
||||
ONIG_EXTERN
|
||||
unsigned int onig_get_match_stack_limit_size P_((void));
|
||||
ONIG_EXTERN
|
||||
int onig_set_match_stack_limit_size P_((unsigned int size));
|
||||
ONIG_EXTERN
|
||||
int onig_end P_((void));
|
||||
ONIG_EXTERN
|
||||
const char* onig_version P_((void));
|
||||
ONIG_EXTERN
|
||||
const char* onig_copyright P_((void));
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility pop
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if 0
|
||||
{ /* satisfy cc-mode */
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ONIGURUMA_H */
|
||||
@@ -1,75 +0,0 @@
|
||||
/**********************************************************************
|
||||
|
||||
re.h -
|
||||
|
||||
$Author: nobu $
|
||||
created at: Thu Sep 30 14:18:32 JST 1993
|
||||
|
||||
Copyright (C) 1993-2007 Yukihiro Matsumoto
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef RUBY_RE_H
|
||||
#define RUBY_RE_H 1
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#if 0
|
||||
} /* satisfy cc-mode */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "ruby/regex.h"
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility push(default)
|
||||
#endif
|
||||
|
||||
typedef struct re_pattern_buffer Regexp;
|
||||
|
||||
struct rmatch_offset {
|
||||
long beg;
|
||||
long end;
|
||||
};
|
||||
|
||||
struct rmatch {
|
||||
struct re_registers regs;
|
||||
|
||||
int char_offset_updated;
|
||||
int char_offset_num_allocated;
|
||||
struct rmatch_offset *char_offset;
|
||||
};
|
||||
|
||||
struct RMatch {
|
||||
struct RBasic basic;
|
||||
VALUE str;
|
||||
struct rmatch *rmatch;
|
||||
VALUE regexp; /* RRegexp */
|
||||
};
|
||||
|
||||
#define RMATCH(obj) (R_CAST(RMatch)(obj))
|
||||
#define RMATCH_REGS(obj) (&(R_CAST(RMatch)(obj))->rmatch->regs)
|
||||
|
||||
VALUE rb_reg_regcomp(VALUE);
|
||||
long rb_reg_search(VALUE, VALUE, long, int);
|
||||
VALUE rb_reg_regsub(VALUE, VALUE, struct re_registers *, VALUE);
|
||||
long rb_reg_adjust_startpos(VALUE, VALUE, long, int);
|
||||
void rb_match_busy(VALUE);
|
||||
VALUE rb_reg_quote(VALUE);
|
||||
regex_t *rb_reg_prepare_re(VALUE re, VALUE str);
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility pop
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
#if 0
|
||||
{ /* satisfy cc-mode */
|
||||
#endif
|
||||
} /* extern "C" { */
|
||||
#endif
|
||||
|
||||
#endif /* RUBY_RE_H */
|
||||
@@ -1,50 +0,0 @@
|
||||
/**********************************************************************
|
||||
|
||||
regex.h -
|
||||
|
||||
$Author: nobu $
|
||||
|
||||
Copyright (C) 1993-2007 Yukihiro Matsumoto
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef ONIGURUMA_REGEX_H
|
||||
#define ONIGURUMA_REGEX_H 1
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#if 0
|
||||
} /* satisfy cc-mode */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef RUBY
|
||||
#include "ruby/oniguruma.h"
|
||||
#else
|
||||
#include "oniguruma.h"
|
||||
#endif
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility push(default)
|
||||
#endif
|
||||
|
||||
#ifndef ONIG_RUBY_M17N
|
||||
|
||||
ONIG_EXTERN OnigEncoding OnigEncDefaultCharEncoding;
|
||||
|
||||
#define mbclen(p,e,enc) rb_enc_mbclen((p),(e),(enc))
|
||||
|
||||
#endif /* ifndef ONIG_RUBY_M17N */
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility pop
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
#if 0
|
||||
{ /* satisfy cc-mode */
|
||||
#endif
|
||||
} /* extern "C" { */
|
||||
#endif
|
||||
|
||||
#endif /* ONIGURUMA_REGEX_H */
|
||||
-1736
File diff suppressed because it is too large
Load Diff
-157
@@ -1,157 +0,0 @@
|
||||
/* This is a public domain general purpose hash table package written by Peter Moore @ UCB. */
|
||||
|
||||
/* @(#) st.h 5.1 89/12/14 */
|
||||
|
||||
#ifndef RUBY_ST_H
|
||||
#define RUBY_ST_H 1
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#if 0
|
||||
} /* satisfy cc-mode */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "ruby/defines.h"
|
||||
|
||||
#if defined STDC_HEADERS
|
||||
#include <stddef.h>
|
||||
#elif defined HAVE_STDLIB_H
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STDINT_H
|
||||
# include <stdint.h>
|
||||
#endif
|
||||
#ifdef HAVE_INTTYPES_H
|
||||
# include <inttypes.h>
|
||||
#endif
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility push(default)
|
||||
#endif
|
||||
|
||||
#if SIZEOF_LONG == SIZEOF_VOIDP
|
||||
typedef unsigned long st_data_t;
|
||||
#elif SIZEOF_LONG_LONG == SIZEOF_VOIDP
|
||||
typedef unsigned LONG_LONG st_data_t;
|
||||
#else
|
||||
# error ---->> st.c requires sizeof(void*) == sizeof(long) or sizeof(LONG_LONG) to be compiled. <<----
|
||||
#endif
|
||||
#define ST_DATA_T_DEFINED
|
||||
|
||||
#ifndef CHAR_BIT
|
||||
# ifdef HAVE_LIMITS_H
|
||||
# include <limits.h>
|
||||
# else
|
||||
# define CHAR_BIT 8
|
||||
# endif
|
||||
#endif
|
||||
#ifndef _
|
||||
# define _(args) args
|
||||
#endif
|
||||
#ifndef ANYARGS
|
||||
# ifdef __cplusplus
|
||||
# define ANYARGS ...
|
||||
# else
|
||||
# define ANYARGS
|
||||
# endif
|
||||
#endif
|
||||
|
||||
typedef struct st_table st_table;
|
||||
|
||||
typedef st_data_t st_index_t;
|
||||
typedef int st_compare_func(st_data_t, st_data_t);
|
||||
typedef st_index_t st_hash_func(st_data_t);
|
||||
|
||||
typedef char st_check_for_sizeof_st_index_t[SIZEOF_VOIDP == (int)sizeof(st_index_t) ? 1 : -1];
|
||||
#define SIZEOF_ST_INDEX_T SIZEOF_VOIDP
|
||||
|
||||
struct st_hash_type {
|
||||
int (*compare)(ANYARGS /*st_data_t, st_data_t*/); /* st_compare_func* */
|
||||
st_index_t (*hash)(ANYARGS /*st_data_t*/); /* st_hash_func* */
|
||||
};
|
||||
|
||||
#define ST_INDEX_BITS (sizeof(st_index_t) * CHAR_BIT)
|
||||
|
||||
struct st_table {
|
||||
const struct st_hash_type *type;
|
||||
st_index_t num_bins;
|
||||
unsigned int entries_packed : 1;
|
||||
#ifdef __GNUC__
|
||||
/*
|
||||
* C spec says,
|
||||
* A bit-field shall have a type that is a qualified or unqualified
|
||||
* version of _Bool, signed int, unsigned int, or some other
|
||||
* implementation-defined type. It is implementation-defined whether
|
||||
* atomic types are permitted.
|
||||
* In short, long and long long bit-field are implementation-defined
|
||||
* feature. Therefore we want to supress a warning explicitly.
|
||||
*/
|
||||
__extension__
|
||||
#endif
|
||||
st_index_t num_entries : ST_INDEX_BITS - 1;
|
||||
union {
|
||||
struct {
|
||||
struct st_table_entry **bins;
|
||||
struct st_table_entry *head, *tail;
|
||||
} big;
|
||||
struct {
|
||||
struct st_packed_entry *entries;
|
||||
st_index_t real_entries;
|
||||
} packed;
|
||||
} as;
|
||||
};
|
||||
|
||||
#define st_is_member(table,key) st_lookup((table),(key),(st_data_t *)0)
|
||||
|
||||
enum st_retval {ST_CONTINUE, ST_STOP, ST_DELETE, ST_CHECK};
|
||||
|
||||
st_table *st_init_table(const struct st_hash_type *);
|
||||
st_table *st_init_table_with_size(const struct st_hash_type *, st_index_t);
|
||||
st_table *st_init_numtable(void);
|
||||
st_table *st_init_numtable_with_size(st_index_t);
|
||||
st_table *st_init_strtable(void);
|
||||
st_table *st_init_strtable_with_size(st_index_t);
|
||||
st_table *st_init_strcasetable(void);
|
||||
st_table *st_init_strcasetable_with_size(st_index_t);
|
||||
int st_delete(st_table *, st_data_t *, st_data_t *); /* returns 0:notfound 1:deleted */
|
||||
int st_delete_safe(st_table *, st_data_t *, st_data_t *, st_data_t);
|
||||
int st_insert(st_table *, st_data_t, st_data_t);
|
||||
int st_insert2(st_table *, st_data_t, st_data_t, st_data_t (*)(st_data_t));
|
||||
int st_lookup(st_table *, st_data_t, st_data_t *);
|
||||
int st_get_key(st_table *, st_data_t, st_data_t *);
|
||||
typedef int st_update_callback_func(st_data_t *key, st_data_t *value, st_data_t arg, int existing);
|
||||
int st_update(st_table *table, st_data_t key, st_update_callback_func *func, st_data_t arg);
|
||||
int st_foreach(st_table *, int (*)(ANYARGS), st_data_t);
|
||||
int st_foreach_check(st_table *, int (*)(ANYARGS), st_data_t, st_data_t);
|
||||
int st_reverse_foreach(st_table *, int (*)(ANYARGS), st_data_t);
|
||||
void st_add_direct(st_table *, st_data_t, st_data_t);
|
||||
void st_free_table(st_table *);
|
||||
void st_cleanup_safe(st_table *, st_data_t);
|
||||
void st_clear(st_table *);
|
||||
st_table *st_copy(st_table *);
|
||||
int st_numcmp(st_data_t, st_data_t);
|
||||
st_index_t st_numhash(st_data_t);
|
||||
int st_strcasecmp(const char *s1, const char *s2);
|
||||
int st_strncasecmp(const char *s1, const char *s2, size_t n);
|
||||
size_t st_memsize(const st_table *);
|
||||
st_index_t st_hash(const void *ptr, size_t len, st_index_t h);
|
||||
st_index_t st_hash_uint32(st_index_t h, uint32_t i);
|
||||
st_index_t st_hash_uint(st_index_t h, st_index_t i);
|
||||
st_index_t st_hash_end(st_index_t h);
|
||||
st_index_t st_hash_start(st_index_t h);
|
||||
#define st_hash_start(h) ((st_index_t)(h))
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility pop
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
#if 0
|
||||
{ /* satisfy cc-mode */
|
||||
#endif
|
||||
} /* extern "C" { */
|
||||
#endif
|
||||
|
||||
#endif /* RUBY_ST_H */
|
||||
@@ -1,19 +0,0 @@
|
||||
#ifndef RUBY_SUBST_H
|
||||
#define RUBY_SUBST_H 1
|
||||
|
||||
#undef snprintf
|
||||
#undef vsnprintf
|
||||
#define snprintf ruby_snprintf
|
||||
#define vsnprintf ruby_vsnprintf
|
||||
|
||||
#ifdef BROKEN_CLOSE
|
||||
#undef getpeername
|
||||
#define getpeername ruby_getpeername
|
||||
#undef getsockname
|
||||
#define getsockname ruby_getsockname
|
||||
#undef shutdown
|
||||
#define shutdown ruby_shutdown
|
||||
#undef close
|
||||
#define close ruby_close
|
||||
#endif
|
||||
#endif
|
||||
@@ -1,49 +0,0 @@
|
||||
/**********************************************************************
|
||||
|
||||
thread.h -
|
||||
|
||||
$Author: matz $
|
||||
created at: Tue Jul 10 17:35:43 JST 2012
|
||||
|
||||
Copyright (C) 2007 Yukihiro Matsumoto
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef RUBY_THREAD_H
|
||||
#define RUBY_THREAD_H 1
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#if 0
|
||||
} /* satisfy cc-mode */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "ruby/intern.h"
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility push(default)
|
||||
#endif
|
||||
|
||||
void *rb_thread_call_with_gvl(void *(*func)(void *), void *data1);
|
||||
|
||||
void *rb_thread_call_without_gvl(void *(*func)(void *), void *data1,
|
||||
rb_unblock_function_t *ubf, void *data2);
|
||||
void *rb_thread_call_without_gvl2(void *(*func)(void *), void *data1,
|
||||
rb_unblock_function_t *ubf, void *data2);
|
||||
|
||||
#define RUBY_CALL_WO_GVL_FLAG_SKIP_CHECK_INTS_AFTER 0x01
|
||||
#define RUBY_CALL_WO_GVL_FLAG_SKIP_CHECK_INTS_
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility pop
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
#if 0
|
||||
{ /* satisfy cc-mode */
|
||||
#endif
|
||||
} /* extern "C" { */
|
||||
#endif
|
||||
|
||||
#endif /* RUBY_THREAD_H */
|
||||
@@ -1,99 +0,0 @@
|
||||
/**********************************************************************
|
||||
|
||||
util.h -
|
||||
|
||||
$Author: tadf $
|
||||
created at: Thu Mar 9 11:55:53 JST 1995
|
||||
|
||||
Copyright (C) 1993-2007 Yukihiro Matsumoto
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef RUBY_UTIL_H
|
||||
#define RUBY_UTIL_H 1
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#if 0
|
||||
} /* satisfy cc-mode */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "ruby/defines.h"
|
||||
#ifdef RUBY_EXTCONF_H
|
||||
#include RUBY_EXTCONF_H
|
||||
#endif
|
||||
|
||||
#ifndef _
|
||||
#ifdef __cplusplus
|
||||
# ifndef HAVE_PROTOTYPES
|
||||
# define HAVE_PROTOTYPES 1
|
||||
# endif
|
||||
# ifndef HAVE_STDARG_PROTOTYPES
|
||||
# define HAVE_STDARG_PROTOTYPES 1
|
||||
# endif
|
||||
#endif
|
||||
#ifdef HAVE_PROTOTYPES
|
||||
# define _(args) args
|
||||
#else
|
||||
# define _(args) ()
|
||||
#endif
|
||||
#ifdef HAVE_STDARG_PROTOTYPES
|
||||
# define __(args) args
|
||||
#else
|
||||
# define __(args) ()
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility push(default)
|
||||
#endif
|
||||
|
||||
#define scan_oct(s,l,e) ((int)ruby_scan_oct((s),(l),(e)))
|
||||
unsigned long ruby_scan_oct(const char *, size_t, size_t *);
|
||||
#define scan_hex(s,l,e) ((int)ruby_scan_hex((s),(l),(e)))
|
||||
unsigned long ruby_scan_hex(const char *, size_t, size_t *);
|
||||
|
||||
void ruby_qsort(void *, const size_t, const size_t,
|
||||
int (*)(const void *, const void *, void *), void *);
|
||||
|
||||
void ruby_setenv(const char *, const char *);
|
||||
void ruby_unsetenv(const char *);
|
||||
#undef setenv
|
||||
#undef unsetenv
|
||||
#define setenv(name,val) ruby_setenv((name),(val))
|
||||
#define unsetenv(name,val) ruby_unsetenv(name)
|
||||
|
||||
char *ruby_strdup(const char *);
|
||||
#undef strdup
|
||||
#define strdup(s) ruby_strdup(s)
|
||||
|
||||
char *ruby_getcwd(void);
|
||||
#define my_getcwd() ruby_getcwd()
|
||||
|
||||
double ruby_strtod(const char *, char **);
|
||||
#undef strtod
|
||||
#define strtod(s,e) ruby_strtod((s),(e))
|
||||
|
||||
#if defined _MSC_VER && _MSC_VER >= 1300
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable:4723)
|
||||
#endif
|
||||
#if defined _MSC_VER && _MSC_VER >= 1300
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
||||
void ruby_each_words(const char *, void (*)(const char*, int, void*), void *);
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility pop
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
#if 0
|
||||
{ /* satisfy cc-mode */
|
||||
#endif
|
||||
} /* extern "C" { */
|
||||
#endif
|
||||
|
||||
#endif /* RUBY_UTIL_H */
|
||||
@@ -1,78 +0,0 @@
|
||||
/**********************************************************************
|
||||
|
||||
ruby/version.h -
|
||||
|
||||
$Author: ayumin $
|
||||
created at: Wed May 13 12:56:56 JST 2009
|
||||
|
||||
Copyright (C) 1993-2009 Yukihiro Matsumoto
|
||||
Copyright (C) 2000 Network Applied Communication Laboratory, Inc.
|
||||
Copyright (C) 2000 Information-technology Promotion Agency, Japan
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
/*
|
||||
* This file contains only
|
||||
* - never-changable informations, and
|
||||
* - interfaces accessible from extension libraries.
|
||||
*
|
||||
* Never try to check RUBY_VERSION_CODE etc in extension libraries,
|
||||
* check the features with mkmf.rb instead.
|
||||
*/
|
||||
|
||||
#ifndef RUBY_VERSION_H
|
||||
#define RUBY_VERSION_H 1
|
||||
|
||||
/* The origin. */
|
||||
#define RUBY_AUTHOR "Yukihiro Matsumoto"
|
||||
#define RUBY_BIRTH_YEAR 1993
|
||||
#define RUBY_BIRTH_MONTH 2
|
||||
#define RUBY_BIRTH_DAY 24
|
||||
|
||||
/* API version */
|
||||
#define RUBY_API_VERSION_MAJOR 2
|
||||
#define RUBY_API_VERSION_MINOR 0
|
||||
#define RUBY_API_VERSION_TEENY 0
|
||||
#define RUBY_API_VERSION_CODE (RUBY_API_VERSION_MAJOR*10000+RUBY_API_VERSION_MINOR*100+RUBY_API_VERSION_TEENY)
|
||||
|
||||
#ifdef RUBY_EXTERN
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#if 0
|
||||
} /* satisfy cc-mode */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility push(default)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Interfaces from extension libraries.
|
||||
*
|
||||
* Before using these infos, think thrice whether they are really
|
||||
* necessary or not, and if the answer was yes, think twice a week
|
||||
* later again.
|
||||
*/
|
||||
RUBY_EXTERN const int ruby_api_version[3];
|
||||
RUBY_EXTERN const char ruby_version[];
|
||||
RUBY_EXTERN const char ruby_release_date[];
|
||||
RUBY_EXTERN const char ruby_platform[];
|
||||
RUBY_EXTERN const int ruby_patchlevel;
|
||||
RUBY_EXTERN const char ruby_description[];
|
||||
RUBY_EXTERN const char ruby_copyright[];
|
||||
RUBY_EXTERN const char ruby_engine[];
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility pop
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
#if 0
|
||||
{ /* satisfy cc-mode */
|
||||
#endif
|
||||
} /* extern "C" { */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -1,68 +0,0 @@
|
||||
/**********************************************************************
|
||||
|
||||
ruby/vm.h -
|
||||
|
||||
$Author: shyouhei $
|
||||
created at: Sat May 31 15:17:36 2008
|
||||
|
||||
Copyright (C) 2008 Yukihiro Matsumoto
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef RUBY_VM_H
|
||||
#define RUBY_VM_H 1
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#if 0
|
||||
} /* satisfy cc-mode */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility push(default)
|
||||
#endif
|
||||
|
||||
/* Place holder.
|
||||
*
|
||||
* We will prepare VM creation/control APIs on 1.9.2 or later.
|
||||
* If you have an interest about it, please see mvm branch.
|
||||
* http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/mvm/
|
||||
*/
|
||||
|
||||
/* VM type declaration */
|
||||
typedef struct rb_vm_struct ruby_vm_t;
|
||||
|
||||
/* core API */
|
||||
int ruby_vm_destruct(ruby_vm_t *vm);
|
||||
|
||||
/**
|
||||
* ruby_vm_at_exit registers a function _func_ to be invoked when a VM
|
||||
* passed away. Functions registered this way runs in reverse order
|
||||
* of registration, just like END {} block does. The difference is
|
||||
* its timing to be triggered. ruby_vm_at_exit functions runs when a
|
||||
* VM _passed_ _away_, while END {} blocks runs just _before_ a VM
|
||||
* _is_ _passing_ _away_.
|
||||
*
|
||||
* You cannot register a function to another VM than where you are in.
|
||||
* So where to register is intuitive, omitted. OTOH the argument
|
||||
* _func_ cannot know which VM it is in because at the time of
|
||||
* invocation, the VM has already died and there is no execution
|
||||
* context. The VM itself is passed as the first argument to it.
|
||||
*
|
||||
* @param[in] func the function to register.
|
||||
*/
|
||||
void ruby_vm_at_exit(void(*func)(ruby_vm_t *));
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility pop
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
#if 0
|
||||
{ /* satisfy cc-mode */
|
||||
#endif
|
||||
} /* extern "C" { */
|
||||
#endif
|
||||
|
||||
#endif /* RUBY_VM_H */
|
||||
-307
@@ -1,307 +0,0 @@
|
||||
#ifndef INCLUDE_RUBY_CONFIG_H
|
||||
#define INCLUDE_RUBY_CONFIG_H 1
|
||||
/* confdefs.h */
|
||||
#define CANONICALIZATION_FOR_MATHN 1
|
||||
#define STDC_HEADERS 1
|
||||
#define HAVE_SYS_TYPES_H 1
|
||||
#define HAVE_SYS_STAT_H 1
|
||||
#define HAVE_STDLIB_H 1
|
||||
#define HAVE_STRING_H 1
|
||||
#define HAVE_MEMORY_H 1
|
||||
#define HAVE_STRINGS_H 1
|
||||
#define HAVE_INTTYPES_H 1
|
||||
#define HAVE_STDINT_H 1
|
||||
#define HAVE_UNISTD_H 1
|
||||
#define __EXTENSIONS__ 1
|
||||
#define _ALL_SOURCE 1
|
||||
#define _GNU_SOURCE 1
|
||||
#define _POSIX_PTHREAD_SEMANTICS 1
|
||||
#define _TANDEM_SOURCE 1
|
||||
#define HAVE_CRT_EXTERNS_H 1
|
||||
#define HAVE_DIRENT_H 1
|
||||
#define HAVE__BOOL 1
|
||||
#define HAVE_STDBOOL_H 1
|
||||
#define HAVE_SYS_WAIT_H 1
|
||||
#define HAVE_LIMITS_H 1
|
||||
#define HAVE_SYS_FILE_H 1
|
||||
#define HAVE_SYS_IOCTL_H 1
|
||||
#define HAVE_SYS_SYSCALL_H 1
|
||||
#define HAVE_FCNTL_H 1
|
||||
#define HAVE_SYS_FCNTL_H 1
|
||||
#define HAVE_SYS_SELECT_H 1
|
||||
#define HAVE_SYS_TIME_H 1
|
||||
#define HAVE_SYS_TIMES_H 1
|
||||
#define HAVE_SYS_PARAM_H 1
|
||||
#define HAVE_PWD_H 1
|
||||
#define HAVE_GRP_H 1
|
||||
#define HAVE_UTIME_H 1
|
||||
#define HAVE_SYS_RESOURCE_H 1
|
||||
#define HAVE_NETINET_IN_SYSTM_H 1
|
||||
#define HAVE_FLOAT_H 1
|
||||
#define HAVE_LANGINFO_H 1
|
||||
#define HAVE_LOCALE_H 1
|
||||
#define HAVE_TIME_H 1
|
||||
#define HAVE_SYS_SOCKET_H 1
|
||||
#define AC_APPLE_UNIVERSAL_BUILD 1
|
||||
#define HAVE_LONG_LONG 1
|
||||
#define HAVE_OFF_T 1
|
||||
#define SIZEOF_INT 4
|
||||
#define SIZEOF_SHORT 2
|
||||
#if defined(__LP64__) || defined(__LP64) || defined(_LP64) || defined(LP64)
|
||||
#define SIZEOF_LONG 8
|
||||
#else
|
||||
#define SIZEOF_LONG 4
|
||||
#endif
|
||||
#define SIZEOF_LONG_LONG 8
|
||||
#define SIZEOF___INT64 0
|
||||
#define SIZEOF_OFF_T 8
|
||||
#define SIZEOF_VOIDP SIZEOF_LONG
|
||||
#define SIZEOF_FLOAT 4
|
||||
#define SIZEOF_DOUBLE 8
|
||||
#define SIZEOF_TIME_T SIZEOF_LONG
|
||||
#define PRI_LL_PREFIX "ll"
|
||||
#define rb_pid_t pid_t
|
||||
#define PIDT2NUM(v) INT2NUM(v)
|
||||
#define NUM2PIDT(v) NUM2INT(v)
|
||||
#define PRI_PIDT_PREFIX PRI_INT_PREFIX
|
||||
#define rb_uid_t uid_t
|
||||
#define UIDT2NUM(v) UINT2NUM(v)
|
||||
#define NUM2UIDT(v) NUM2UINT(v)
|
||||
#define PRI_UIDT_PREFIX PRI_INT_PREFIX
|
||||
#define rb_gid_t gid_t
|
||||
#define GIDT2NUM(v) UINT2NUM(v)
|
||||
#define NUM2GIDT(v) NUM2UINT(v)
|
||||
#define PRI_GIDT_PREFIX PRI_INT_PREFIX
|
||||
#define rb_time_t time_t
|
||||
#define TIMET2NUM(v) LONG2NUM(v)
|
||||
#define NUM2TIMET(v) NUM2LONG(v)
|
||||
#define PRI_TIMET_PREFIX PRI_LONG_PREFIX
|
||||
#define rb_dev_t dev_t
|
||||
#define DEVT2NUM(v) INT2NUM(v)
|
||||
#define NUM2DEVT(v) NUM2INT(v)
|
||||
#define PRI_DEVT_PREFIX PRI_INT_PREFIX
|
||||
#define rb_mode_t mode_t
|
||||
#define MODET2NUM(v) UINT2NUM(v)
|
||||
#define NUM2MODET(v) NUM2UINT(v)
|
||||
#define PRI_MODET_PREFIX PRI_INT_PREFIX
|
||||
#define rb_rlim_t rlim_t
|
||||
#define RLIM2NUM(v) ULL2NUM(v)
|
||||
#define NUM2RLIM(v) NUM2ULL(v)
|
||||
#define PRI_RLIM_PREFIX PRI_LL_PREFIX
|
||||
#define HAVE_PROTOTYPES 1
|
||||
#define TOKEN_PASTE(x,y) x##y
|
||||
#define STRINGIZE(expr) STRINGIZE0(expr)
|
||||
#define HAVE_STDARG_PROTOTYPES 1
|
||||
#define HAVE_VA_ARGS_MACRO 1
|
||||
#define NORETURN(x) __attribute__ ((noreturn)) x
|
||||
#define DEPRECATED(x) __attribute__ ((deprecated)) x
|
||||
#define NOINLINE(x) __attribute__ ((noinline)) x
|
||||
#if defined __i386__
|
||||
#define FUNC_STDCALL(x) __attribute__ ((stdcall)) x /* only if defined __i386__ */
|
||||
#endif /* defined __i386__ */
|
||||
#if defined __i386__
|
||||
#define FUNC_CDECL(x) __attribute__ ((cdecl)) x /* only if defined __i386__ */
|
||||
#endif /* defined __i386__ */
|
||||
#if defined __i386__
|
||||
#define FUNC_FASTCALL(x) __attribute__ ((fastcall)) x /* only if defined __i386__ */
|
||||
#endif /* defined __i386__ */
|
||||
#define HAVE_GCC_ATOMIC_BUILTINS 1
|
||||
#define UNREACHABLE __builtin_unreachable()
|
||||
#define RUBY_FUNC_EXPORTED __attribute__ ((visibility("default"))) extern
|
||||
#define HAVE_DECL_SYS_NERR 1
|
||||
#define HAVE_LIBDL 1
|
||||
#define SIZEOF_SIZE_T SIZEOF_LONG
|
||||
#define SIZEOF_PTRDIFF_T SIZEOF_SIZE_T
|
||||
#define PRI_SIZE_PREFIX "z"
|
||||
#define PRI_PTRDIFF_PREFIX "t"
|
||||
#define HAVE_STRUCT_STAT_ST_BLKSIZE 1
|
||||
#define HAVE_ST_BLKSIZE 1
|
||||
#define HAVE_STRUCT_STAT_ST_BLOCKS 1
|
||||
#define HAVE_ST_BLOCKS 1
|
||||
#define HAVE_STRUCT_STAT_ST_RDEV 1
|
||||
#define HAVE_ST_RDEV 1
|
||||
#define SIZEOF_STRUCT_STAT_ST_SIZE SIZEOF_LONG_LONG
|
||||
#define SIZEOF_STRUCT_STAT_ST_BLOCKS SIZEOF_LONG_LONG
|
||||
#define HAVE_STRUCT_STAT_ST_ATIMESPEC 1
|
||||
#define HAVE_STRUCT_STAT_ST_MTIMESPEC 1
|
||||
#define HAVE_STRUCT_STAT_ST_CTIMESPEC 1
|
||||
#define HAVE_STRUCT_TIMEVAL 1
|
||||
#define HAVE_STRUCT_TIMESPEC 1
|
||||
#define HAVE_STRUCT_TIMEZONE 1
|
||||
#define HAVE_RB_FD_INIT 1
|
||||
#define HAVE_INT8_T 1
|
||||
#define SIZEOF_INT8_T 1
|
||||
#define HAVE_UINT8_T 1
|
||||
#define SIZEOF_UINT8_T 1
|
||||
#define HAVE_INT16_T 1
|
||||
#define SIZEOF_INT16_T 2
|
||||
#define HAVE_UINT16_T 1
|
||||
#define SIZEOF_UINT16_T 2
|
||||
#define HAVE_INT32_T 1
|
||||
#define SIZEOF_INT32_T 4
|
||||
#define HAVE_UINT32_T 1
|
||||
#define SIZEOF_UINT32_T 4
|
||||
#define HAVE_INT64_T 1
|
||||
#define SIZEOF_INT64_T 8
|
||||
#define HAVE_UINT64_T 1
|
||||
#define SIZEOF_UINT64_T 8
|
||||
#define HAVE_INTPTR_T 1
|
||||
#define SIZEOF_INTPTR_T SIZEOF_VOIDP
|
||||
#define HAVE_UINTPTR_T 1
|
||||
#define SIZEOF_UINTPTR_T SIZEOF_VOIDP
|
||||
#define HAVE_SSIZE_T 1
|
||||
#define SIZEOF_SSIZE_T SIZEOF_SIZE_T
|
||||
#define GETGROUPS_T gid_t
|
||||
#define RETSIGTYPE void
|
||||
#define HAVE_ALLOCA_H 1
|
||||
#define HAVE_ALLOCA 1
|
||||
#define HAVE_DUP2 1
|
||||
#define HAVE_MEMMOVE 1
|
||||
#define HAVE_STRERROR 1
|
||||
#define HAVE_STRCHR 1
|
||||
#define HAVE_STRSTR 1
|
||||
#define HAVE_CRYPT 1
|
||||
#define HAVE_FLOCK 1
|
||||
#define HAVE_ISNAN 1
|
||||
#define HAVE_FINITE 1
|
||||
#define HAVE_ISINF 1
|
||||
#define HAVE_HYPOT 1
|
||||
#define HAVE_ACOSH 1
|
||||
#define HAVE_ERF 1
|
||||
#define HAVE_TGAMMA 1
|
||||
#define HAVE_LGAMMA_R 1
|
||||
#define HAVE_CBRT 1
|
||||
#define HAVE_STRLCPY 1
|
||||
#define HAVE_STRLCAT 1
|
||||
#define HAVE_FFS 1
|
||||
#define SPT_TYPE SPT_REUSEARGV
|
||||
#define HAVE_SIGNBIT 1
|
||||
#define HAVE_FMOD 1
|
||||
#define HAVE_KILLPG 1
|
||||
#define HAVE_WAIT4 1
|
||||
#define HAVE_WAITPID 1
|
||||
#define HAVE_FORK 1
|
||||
#define HAVE_SYSCALL 1
|
||||
#define HAVE___SYSCALL 1
|
||||
#define HAVE_CHROOT 1
|
||||
#define HAVE_GETCWD 1
|
||||
#define HAVE_TRUNCATE 1
|
||||
#define HAVE_FTRUNCATE 1
|
||||
#define HAVE_FTELLO 1
|
||||
#define HAVE_TIMES 1
|
||||
#define HAVE_UTIMES 1
|
||||
#define HAVE_FCNTL 1
|
||||
#define HAVE_LOCKF 1
|
||||
#define HAVE_LSTAT 1
|
||||
#define HAVE_FSEEKO 1
|
||||
#define HAVE_LINK 1
|
||||
#define HAVE_SYMLINK 1
|
||||
#define HAVE_READLINK 1
|
||||
#define HAVE_READDIR_R 1
|
||||
#define HAVE_FSYNC 1
|
||||
#define HAVE_FCHOWN 1
|
||||
#define HAVE_SETITIMER 1
|
||||
#define HAVE_SETRUID 1
|
||||
#define HAVE_SETEUID 1
|
||||
#define HAVE_SETREUID 1
|
||||
#define HAVE_SOCKETPAIR 1
|
||||
#define HAVE_SETRGID 1
|
||||
#define HAVE_SETEGID 1
|
||||
#define HAVE_SETREGID 1
|
||||
#define HAVE_ISSETUGID 1
|
||||
#define HAVE_PAUSE 1
|
||||
#define HAVE_LCHOWN 1
|
||||
#define HAVE_LCHMOD 1
|
||||
#define HAVE_GETPGRP 1
|
||||
#define HAVE_SETPGRP 1
|
||||
#define HAVE_GETPGID 1
|
||||
#define HAVE_SETPGID 1
|
||||
#define HAVE_INITGROUPS 1
|
||||
#define HAVE_GETGROUPS 1
|
||||
#define HAVE_SETGROUPS 1
|
||||
#define HAVE_GETPRIORITY 1
|
||||
#define HAVE_GETRLIMIT 1
|
||||
#define HAVE_SETRLIMIT 1
|
||||
#define HAVE_SYSCONF 1
|
||||
#define HAVE_CLOSE 1
|
||||
#define HAVE_GETPWNAM_R 1
|
||||
#define HAVE_GETGRNAM_R 1
|
||||
#define HAVE_DLOPEN 1
|
||||
#define HAVE_SIGPROCMASK 1
|
||||
#define HAVE_SIGACTION 1
|
||||
#define HAVE_SIGSETJMP 1
|
||||
#define HAVE__SETJMP 1
|
||||
#define HAVE__LONGJMP 1
|
||||
#define HAVE_GETSID 1
|
||||
#define HAVE_SETSID 1
|
||||
#define HAVE_TELLDIR 1
|
||||
#define HAVE_SEEKDIR 1
|
||||
#define HAVE_FCHMOD 1
|
||||
#define HAVE_COSH 1
|
||||
#define HAVE_SINH 1
|
||||
#define HAVE_TANH 1
|
||||
#define HAVE_LOG2 1
|
||||
#define HAVE_ROUND 1
|
||||
#define HAVE_LLABS 1
|
||||
#define HAVE_SETUID 1
|
||||
#define HAVE_SETGID 1
|
||||
#define HAVE_SETENV 1
|
||||
#define HAVE_UNSETENV 1
|
||||
#define HAVE_MKTIME 1
|
||||
#define HAVE_TIMEGM 1
|
||||
#define HAVE_GMTIME_R 1
|
||||
#define HAVE_GETTIMEOFDAY 1
|
||||
#define HAVE_POLL 1
|
||||
#define HAVE_PREAD 1
|
||||
#define HAVE_SENDFILE 1
|
||||
#define HAVE_SHUTDOWN 1
|
||||
#define HAVE_SIGALTSTACK 1
|
||||
#define HAVE_DUP 1
|
||||
#define HAVE_POSIX_MEMALIGN 1
|
||||
#define HAVE_IOCTL 1
|
||||
#define RUBY_SETJMP(env) _setjmp(env)
|
||||
#define RUBY_LONGJMP(env,val) _longjmp(env,val)
|
||||
#define RUBY_JMP_BUF jmp_buf
|
||||
#define HAVE_STRUCT_TM_TM_ZONE 1
|
||||
#define HAVE_TM_ZONE 1
|
||||
#define HAVE_STRUCT_TM_TM_GMTOFF 1
|
||||
#define HAVE_DAYLIGHT 1
|
||||
#define HAVE_VAR_TIMEZONE 1
|
||||
#define TYPEOF_VAR_TIMEZONE long
|
||||
#define HAVE_TIMEZONE 1
|
||||
#define TIMEZONE_VOID 1
|
||||
#define NEGATIVE_TIME_T 1
|
||||
#define POSIX_SIGNAL 1
|
||||
#define RSHIFT(x,y) ((x)>>(int)(y))
|
||||
#define FILE_COUNT _r
|
||||
#define FILE_READPTR _p
|
||||
#define SIZEOF_STRUCT_STAT_ST_INO SIZEOF_LONG_LONG
|
||||
#define HAVE__SC_CLK_TCK 1
|
||||
#define STACK_GROW_DIRECTION -1
|
||||
#define _REENTRANT 1
|
||||
#define _THREAD_SAFE 1
|
||||
#define HAVE_LIBPTHREAD 1
|
||||
#define HAVE_SCHED_YIELD 1
|
||||
#define HAVE_PTHREAD_ATTR_SETINHERITSCHED 1
|
||||
#define HAVE_PTHREAD_ATTR_GETSTACK 1
|
||||
#define HAVE_PTHREAD_GET_STACKADDR_NP 1
|
||||
#define HAVE_PTHREAD_GET_STACKSIZE_NP 1
|
||||
#define HAVE_PTHREAD_COND_INIT 1
|
||||
#define HAVE_PTHREAD_CONDATTR_INIT 1
|
||||
#define HAVE_PTHREAD_SIGMASK 1
|
||||
#define HAVE_PTHREAD_ATTR_INIT 1
|
||||
#define HAVE_BACKTRACE 1
|
||||
#define HAVE_DLADDR 1
|
||||
#define DLEXT_MAXLEN 7
|
||||
#define DLEXT ".bundle"
|
||||
#define LIBDIR_BASENAME "lib"
|
||||
#define HAVE_PTHREAD_H 1
|
||||
#define LOAD_RELATIVE 1
|
||||
#define RUBY_EXEC_PREFIX ""
|
||||
#if defined __x86_64__
|
||||
#define RUBY_PLATFORM_CPU "x86_64"
|
||||
#endif /* defined __x86_64__ */
|
||||
#if defined __i386__
|
||||
#define RUBY_PLATFORM_CPU "i386"
|
||||
#endif /* defined __i386__ */
|
||||
#endif /* INCLUDE_RUBY_CONFIG_H */
|
||||
@@ -1,145 +0,0 @@
|
||||
#ifndef INCLUDE_RUBY_CONFIG_H
|
||||
#define INCLUDE_RUBY_CONFIG_H 1
|
||||
//#if _MSC_VER != 1600
|
||||
//#error MSC version unmatch: _MSC_VER: 1600 is expected.
|
||||
//#endif
|
||||
#define RUBY_MSVCRT_VERSION 100
|
||||
#define STDC_HEADERS 1
|
||||
#define HAVE_SYS_TYPES_H 1
|
||||
#define HAVE_SYS_STAT_H 1
|
||||
#define HAVE_STDLIB_H 1
|
||||
#define HAVE_STDDEF_H 1
|
||||
#define HAVE_STRING_H 1
|
||||
#define HAVE_MEMORY_H 1
|
||||
#define HAVE_LONG_LONG 1
|
||||
#define HAVE_OFF_T 1
|
||||
#define SIZEOF_INT 4
|
||||
#define SIZEOF_SHORT 2
|
||||
#define SIZEOF_LONG 4
|
||||
#define SIZEOF_LONG_LONG 8
|
||||
#define SIZEOF___INT64 8
|
||||
#define _INTEGRAL_MAX_BITS 64
|
||||
#define SIZEOF_OFF_T 8
|
||||
#define SIZEOF_VOIDP 4
|
||||
#define SIZEOF_FLOAT 4
|
||||
#define SIZEOF_DOUBLE 8
|
||||
#define SIZEOF_TIME_T 8
|
||||
#define TIMET2NUM(v) LL2NUM(v)
|
||||
#define NUM2TIMET(v) NUM2LL(v)
|
||||
#define SIZEOF_RLIM_T 0
|
||||
#define SIZEOF_SIZE_T 4
|
||||
#define SIZEOF_PTRDIFF_T 4
|
||||
#define SIZEOF_INTPTR_T 4
|
||||
#define SIZEOF_UINTPTR_T 4
|
||||
#define HAVE_PROTOTYPES 1
|
||||
#define TOKEN_PASTE(x,y) x##y
|
||||
#define HAVE_STDARG_PROTOTYPES 1
|
||||
#define NORETURN(x) __declspec(noreturn) x
|
||||
#define DEPRECATED(x) __declspec(deprecated) x
|
||||
#define NOINLINE(x) __declspec(noinline) x
|
||||
#define FUNC_STDCALL(x) __stdcall x
|
||||
#define FUNC_CDECL(x) __cdecl x
|
||||
#define FUNC_FASTCALL(x) __fastcall x
|
||||
#define RUBY_EXTERN extern __declspec(dllimport)
|
||||
#define HAVE_DECL_SYS_NERR 1
|
||||
#define HAVE_LIMITS_H 1
|
||||
#define HAVE_FCNTL_H 1
|
||||
#define HAVE_SYS_UTIME_H 1
|
||||
#define HAVE_FLOAT_H 1
|
||||
#define HAVE_TIME_H 1
|
||||
#define rb_pid_t int
|
||||
#define rb_gid_t int
|
||||
#define rb_uid_t int
|
||||
#define HAVE_STRUCT_STAT_ST_RDEV 1
|
||||
#define HAVE_ST_RDEV 1
|
||||
#define HAVE_STRUCT_TIMEVAL 1
|
||||
#define HAVE_STDINT_H 1
|
||||
#define HAVE_INT8_T 1
|
||||
#define HAVE_UINT8_T 1
|
||||
#define SIZEOF_INT8_T 1
|
||||
#define SIZEOF_UINT8_T 1
|
||||
#define HAVE_INT16_T 1
|
||||
#define HAVE_UINT16_T 1
|
||||
#define SIZEOF_INT16_T 2
|
||||
#define SIZEOF_UINT16_T 2
|
||||
#define HAVE_INT32_T 1
|
||||
#define HAVE_UINT32_T 1
|
||||
#define SIZEOF_INT32_T 4
|
||||
#define SIZEOF_UINT32_T 4
|
||||
#define HAVE_INT64_T 1
|
||||
#define HAVE_UINT64_T 1
|
||||
#define SIZEOF_INT64_T 8
|
||||
#define SIZEOF_UINT64_T 8
|
||||
#define HAVE_INTPTR_T 1
|
||||
#define HAVE_UINTPTR_T 1
|
||||
#define HAVE_SSIZE_T 1
|
||||
#define ssize_t int
|
||||
#define PRI_LL_PREFIX "I64"
|
||||
#define PRI_PIDT_PREFIX PRI_INT_PREFIX
|
||||
#define GETGROUPS_T int
|
||||
#define RETSIGTYPE void
|
||||
#define TYPEOF_TIMEVAL_TV_SEC long
|
||||
#define HAVE_ALLOCA 1
|
||||
#define HAVE_DUP2 1
|
||||
#define HAVE_MEMCMP 1
|
||||
#define HAVE_MEMMOVE 1
|
||||
#define HAVE_MKDIR 1
|
||||
#define HAVE_STRCASECMP 1
|
||||
#define HAVE_STRNCASECMP 1
|
||||
#define HAVE_STRERROR 1
|
||||
#define HAVE_STRFTIME 1
|
||||
#define HAVE_STRCHR 1
|
||||
#define HAVE_STRSTR 1
|
||||
#define HAVE_STRTOD 1
|
||||
#define HAVE_STRTOL 1
|
||||
#define HAVE_STRTOUL 1
|
||||
#define HAVE_FLOCK 1
|
||||
#define HAVE_ISNAN 1
|
||||
#define HAVE_FINITE 1
|
||||
#define HAVE_HYPOT 1
|
||||
#define HAVE_FMOD 1
|
||||
#define HAVE_FREXP 1
|
||||
#define HAVE_MODF 1
|
||||
#define HAVE_WAITPID 1
|
||||
#define HAVE_FSYNC 1
|
||||
#define HAVE_GETCWD 1
|
||||
#define HAVE_TRUNCATE 1
|
||||
#define HAVE_FTRUNCATE 1
|
||||
#define HAVE_FSEEKO 1
|
||||
#define HAVE_FTELLO 1
|
||||
#define HAVE_TIMES 1
|
||||
#define HAVE_FCNTL 1
|
||||
#define HAVE_LINK 1
|
||||
#define HAVE__SETJMP 1
|
||||
#define HAVE_TELLDIR 1
|
||||
#define HAVE_SEEKDIR 1
|
||||
#define HAVE_MKTIME 1
|
||||
#define HAVE_COSH 1
|
||||
#define HAVE_SINH 1
|
||||
#define HAVE_TANH 1
|
||||
#define HAVE_SIGNBIT 1
|
||||
#define HAVE_TZNAME 1
|
||||
#define HAVE_DAYLIGHT 1
|
||||
#define HAVE_GMTIME_R 1
|
||||
#define SETPGRP_VOID 1
|
||||
#define RSHIFT(x,y) ((x)>>(int)y)
|
||||
#define HAVE_RB_FD_INIT 1
|
||||
#define RUBY_SETJMP(env) _setjmp(env)
|
||||
#define RUBY_LONGJMP(env,val) longjmp(env,val)
|
||||
#define RUBY_JMP_BUF jmp_buf
|
||||
//#define inline __inline
|
||||
#define NEED_IO_SEEK_BETWEEN_RW 1
|
||||
#define STACK_GROW_DIRECTION -1
|
||||
#define CANONICALIZATION_FOR_MATHN 1
|
||||
#define DEFAULT_KCODE KCODE_NONE
|
||||
#define LOAD_RELATIVE 1
|
||||
#define DLEXT ".so"
|
||||
#define EXECUTABLE_EXTS ".exe",".com",".cmd",".bat"
|
||||
#define RUBY_COREDLL "msvcr100"
|
||||
#define LIBRUBY_SO "msvcrt-ruby200.dll"
|
||||
#if 0
|
||||
!if "msvcrt-ruby200"!="$(RUBY_SO_NAME)" || "i386-mswin32_100"!="$(ARCH)-$(PLATFORM)"
|
||||
config.h: nul
|
||||
!endif
|
||||
#endif
|
||||
#endif /* INCLUDE_RUBY_CONFIG_H */
|
||||
@@ -1,35 +0,0 @@
|
||||
/**********************************************************************
|
||||
|
||||
ruby.h -
|
||||
|
||||
$Author$
|
||||
created at: Sun 10 12:06:15 Jun JST 2007
|
||||
|
||||
Copyright (C) 2007-2008 Yukihiro Matsumoto
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef RUBY_H
|
||||
#define RUBY_H 1
|
||||
|
||||
#define HAVE_RUBY_DEFINES_H 1
|
||||
#define HAVE_RUBY_ENCODING_H 1
|
||||
#define HAVE_RUBY_INTERN_H 1
|
||||
#define HAVE_RUBY_IO_H 1
|
||||
#define HAVE_RUBY_MISSING_H 1
|
||||
#define HAVE_RUBY_ONIGURUMA_H 1
|
||||
#define HAVE_RUBY_RE_H 1
|
||||
#define HAVE_RUBY_REGEX_H 1
|
||||
#define HAVE_RUBY_RUBY_H 1
|
||||
#define HAVE_RUBY_ST_H 1
|
||||
#define HAVE_RUBY_THREAD_H 1
|
||||
#define HAVE_RUBY_UTIL_H 1
|
||||
#define HAVE_RUBY_VERSION_H 1
|
||||
#define HAVE_RUBY_VM_H 1
|
||||
#ifdef _WIN32
|
||||
#define HAVE_RUBY_WIN32_H 1
|
||||
#endif
|
||||
|
||||
#include "ruby/ruby.h"
|
||||
|
||||
#endif /* RUBY_H */
|
||||
@@ -1,18 +0,0 @@
|
||||
#if defined __GNUC__
|
||||
#warning use of RClass internals is deprecated
|
||||
#elif defined _MSC_VER || defined __BORLANDC__
|
||||
#pragma message("warning: use of RClass internals is deprecated")
|
||||
#endif
|
||||
|
||||
#ifndef RUBY_BACKWARD_CLASSEXT_H
|
||||
#define RUBY_BACKWARD_CLASSEXT_H 1
|
||||
|
||||
typedef struct rb_deprecated_classext_struct {
|
||||
VALUE super;
|
||||
} rb_deprecated_classext_t;
|
||||
|
||||
#undef RCLASS_SUPER(c)
|
||||
#define RCLASS_EXT(c) ((rb_deprecated_classext_t *)RCLASS(c)->ptr)
|
||||
#define RCLASS_SUPER(c) (RCLASS_EXT(c)->super)
|
||||
|
||||
#endif /* RUBY_BACKWARD_CLASSEXT_H */
|
||||
@@ -1,6 +0,0 @@
|
||||
#if defined __GNUC__
|
||||
#warning use "ruby/io.h" instead of "rubyio.h"
|
||||
#elif defined _MSC_VER || defined __BORLANDC__
|
||||
#pragma message("warning: use \"ruby/io.h\" instead of \"rubyio.h\"")
|
||||
#endif
|
||||
#include "ruby/io.h"
|
||||
@@ -1,56 +0,0 @@
|
||||
/**********************************************************************
|
||||
|
||||
rubysig.h -
|
||||
|
||||
$Author: nobu $
|
||||
$Date: 2012-06-19 18:43:53 +0900 (Tue, 19 Jun 2012) $
|
||||
created at: Wed Aug 16 01:15:38 JST 1995
|
||||
|
||||
Copyright (C) 1993-2008 Yukihiro Matsumoto
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#if defined __GNUC__
|
||||
#warning rubysig.h is obsolete
|
||||
#elif defined _MSC_VER || defined __BORLANDC__
|
||||
#pragma message("warning: rubysig.h is obsolete")
|
||||
#endif
|
||||
|
||||
#ifndef RUBYSIG_H
|
||||
#define RUBYSIG_H
|
||||
#include "ruby/ruby.h"
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#if 0
|
||||
} /* satisfy cc-mode */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility push(default)
|
||||
#endif
|
||||
|
||||
struct rb_blocking_region_buffer;
|
||||
DEPRECATED(RUBY_EXTERN struct rb_blocking_region_buffer *rb_thread_blocking_region_begin(void));
|
||||
DEPRECATED(RUBY_EXTERN void rb_thread_blocking_region_end(struct rb_blocking_region_buffer *));
|
||||
#define TRAP_BEG do {struct rb_blocking_region_buffer *__region = rb_thread_blocking_region_begin();
|
||||
#define TRAP_END rb_thread_blocking_region_end(__region);} while (0)
|
||||
#define RUBY_CRITICAL(statements) do {statements;} while (0)
|
||||
#define DEFER_INTS (0)
|
||||
#define ENABLE_INTS (1)
|
||||
#define ALLOW_INTS do {CHECK_INTS;} while (0)
|
||||
#define CHECK_INTS rb_thread_check_ints()
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility pop
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
#if 0
|
||||
{ /* satisfy cc-mode */
|
||||
#endif
|
||||
} /* extern "C" { */
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -1,6 +0,0 @@
|
||||
#if defined __GNUC__
|
||||
#warning use "ruby/st.h" instead of bare "st.h"
|
||||
#elif defined _MSC_VER || defined __BORLANDC__
|
||||
#pragma message("warning: use \"ruby/st.h\" instead of bare \"st.h\"")
|
||||
#endif
|
||||
#include "ruby/st.h"
|
||||
@@ -1,6 +0,0 @@
|
||||
#if defined __GNUC__
|
||||
#warning use "ruby/util.h" instead of bare "util.h"
|
||||
#elif defined _MSC_VER || defined __BORLANDC__
|
||||
#pragma message("warning: use \"ruby/util.h\" instead of bare \"util.h\"")
|
||||
#endif
|
||||
#include "ruby/util.h"
|
||||
@@ -1,93 +0,0 @@
|
||||
/**********************************************************************
|
||||
|
||||
ruby/debug.h -
|
||||
|
||||
$Author: ko1 $
|
||||
created at: Tue Nov 20 20:35:08 2012
|
||||
|
||||
Copyright (C) 2012 Yukihiro Matsumoto
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef RB_DEBUG_H
|
||||
#define RB_DEBUG_H 1
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#if 0
|
||||
} /* satisfy cc-mode */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility push(default)
|
||||
#endif
|
||||
|
||||
/* Note: This file contains experimental APIs. */
|
||||
/* APIs can be replaced at Ruby 2.0.1 or later */
|
||||
|
||||
/* debug inspector APIs */
|
||||
typedef struct rb_debug_inspector_struct rb_debug_inspector_t;
|
||||
typedef VALUE (*rb_debug_inspector_func_t)(const rb_debug_inspector_t *, void *);
|
||||
|
||||
VALUE rb_debug_inspector_open(rb_debug_inspector_func_t func, void *data);
|
||||
VALUE rb_debug_inspector_frame_self_get(const rb_debug_inspector_t *dc, long index);
|
||||
VALUE rb_debug_inspector_frame_class_get(const rb_debug_inspector_t *dc, long index);
|
||||
VALUE rb_debug_inspector_frame_binding_get(const rb_debug_inspector_t *dc, long index);
|
||||
VALUE rb_debug_inspector_frame_iseq_get(const rb_debug_inspector_t *dc, long index);
|
||||
VALUE rb_debug_inspector_backtrace_locations(const rb_debug_inspector_t *dc);
|
||||
|
||||
/* Old style set_trace_func APIs */
|
||||
|
||||
/* duplicated def of include/ruby/ruby.h */
|
||||
void rb_add_event_hook(rb_event_hook_func_t func, rb_event_flag_t events, VALUE data);
|
||||
int rb_remove_event_hook(rb_event_hook_func_t func);
|
||||
|
||||
int rb_remove_event_hook_with_data(rb_event_hook_func_t func, VALUE data);
|
||||
void rb_thread_add_event_hook(VALUE thval, rb_event_hook_func_t func, rb_event_flag_t events, VALUE data);
|
||||
int rb_thread_remove_event_hook(VALUE thval, rb_event_hook_func_t func);
|
||||
int rb_thread_remove_event_hook_with_data(VALUE thval, rb_event_hook_func_t func, VALUE data);
|
||||
|
||||
/* TracePoint APIs */
|
||||
|
||||
VALUE rb_tracepoint_new(VALUE target_thread_not_supported_yet, rb_event_flag_t events, void (*func)(VALUE, void *), void *data);
|
||||
VALUE rb_tracepoint_enable(VALUE tpval);
|
||||
VALUE rb_tracepoint_disable(VALUE tpval);
|
||||
VALUE rb_tracepoint_enabled_p(VALUE tpval);
|
||||
|
||||
typedef struct rb_trace_arg_struct rb_trace_arg_t;
|
||||
rb_trace_arg_t *rb_tracearg_from_tracepoint(VALUE tpval);
|
||||
|
||||
VALUE rb_tracearg_event(rb_trace_arg_t *trace_arg);
|
||||
VALUE rb_tracearg_lineno(rb_trace_arg_t *trace_arg);
|
||||
VALUE rb_tracearg_path(rb_trace_arg_t *trace_arg);
|
||||
VALUE rb_tracearg_method_id(rb_trace_arg_t *trace_arg);
|
||||
VALUE rb_tracearg_defined_class(rb_trace_arg_t *trace_arg);
|
||||
VALUE rb_tracearg_binding(rb_trace_arg_t *trace_arg);
|
||||
VALUE rb_tracearg_self(rb_trace_arg_t *trace_arg);
|
||||
VALUE rb_tracearg_return_value(rb_trace_arg_t *trace_arg);
|
||||
VALUE rb_tracearg_raised_exception(rb_trace_arg_t *trace_arg);
|
||||
|
||||
/* undocumented advanced tracing APIs */
|
||||
|
||||
typedef enum {
|
||||
RUBY_EVENT_HOOK_FLAG_SAFE = 0x01,
|
||||
RUBY_EVENT_HOOK_FLAG_DELETED = 0x02,
|
||||
RUBY_EVENT_HOOK_FLAG_RAW_ARG = 0x04
|
||||
} rb_event_hook_flag_t;
|
||||
|
||||
void rb_add_event_hook2(rb_event_hook_func_t func, rb_event_flag_t events, VALUE data, rb_event_hook_flag_t hook_flag);
|
||||
void rb_thread_add_event_hook2(VALUE thval, rb_event_hook_func_t func, rb_event_flag_t events, VALUE data, rb_event_hook_flag_t hook_flag);
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility pop
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
#if 0
|
||||
{ /* satisfy cc-mode */
|
||||
#endif
|
||||
} /* extern "C" { */
|
||||
#endif
|
||||
|
||||
#endif /* RUBY_DEBUG_H */
|
||||
@@ -1,264 +0,0 @@
|
||||
/************************************************
|
||||
|
||||
defines.h -
|
||||
|
||||
$Author: ngoto $
|
||||
created at: Wed May 18 00:21:44 JST 1994
|
||||
|
||||
************************************************/
|
||||
|
||||
#ifndef RUBY_DEFINES_H
|
||||
#define RUBY_DEFINES_H 1
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#if 0
|
||||
} /* satisfy cc-mode */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "ruby/config.h"
|
||||
#ifdef RUBY_EXTCONF_H
|
||||
#include RUBY_EXTCONF_H
|
||||
#endif
|
||||
|
||||
#define RUBY
|
||||
|
||||
# include <stddef.h>
|
||||
#ifdef HAVE_STDLIB_H
|
||||
# include <stdlib.h>
|
||||
#endif
|
||||
#ifdef __cplusplus
|
||||
# ifndef HAVE_PROTOTYPES
|
||||
# define HAVE_PROTOTYPES 1
|
||||
# endif
|
||||
# ifndef HAVE_STDARG_PROTOTYPES
|
||||
# define HAVE_STDARG_PROTOTYPES 1
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#undef _
|
||||
#ifdef HAVE_PROTOTYPES
|
||||
# define _(args) args
|
||||
#else
|
||||
# define _(args) ()
|
||||
#endif
|
||||
|
||||
#undef __
|
||||
#ifdef HAVE_STDARG_PROTOTYPES
|
||||
# define __(args) args
|
||||
#else
|
||||
# define __(args) ()
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define ANYARGS ...
|
||||
#else
|
||||
#define ANYARGS
|
||||
#endif
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility push(default)
|
||||
#endif
|
||||
|
||||
#define xmalloc ruby_xmalloc
|
||||
#define xmalloc2 ruby_xmalloc2
|
||||
#define xcalloc ruby_xcalloc
|
||||
#define xrealloc ruby_xrealloc
|
||||
#define xrealloc2 ruby_xrealloc2
|
||||
#define xfree ruby_xfree
|
||||
|
||||
void *xmalloc(size_t);
|
||||
void *xmalloc2(size_t,size_t);
|
||||
void *xcalloc(size_t,size_t);
|
||||
void *xrealloc(void*,size_t);
|
||||
void *xrealloc2(void*,size_t,size_t);
|
||||
void xfree(void*);
|
||||
|
||||
#define STRINGIZE(expr) STRINGIZE0(expr)
|
||||
#ifndef STRINGIZE0
|
||||
#define STRINGIZE0(expr) #expr
|
||||
#endif
|
||||
|
||||
#if SIZEOF_LONG_LONG > 0
|
||||
# define LONG_LONG long long
|
||||
#elif SIZEOF___INT64 > 0
|
||||
# define HAVE_LONG_LONG 1
|
||||
# define LONG_LONG __int64
|
||||
# undef SIZEOF_LONG_LONG
|
||||
# define SIZEOF_LONG_LONG SIZEOF___INT64
|
||||
#endif
|
||||
|
||||
#if SIZEOF_INT*2 <= SIZEOF_LONG_LONG
|
||||
# define BDIGIT unsigned int
|
||||
# define SIZEOF_BDIGITS SIZEOF_INT
|
||||
# define BDIGIT_DBL unsigned LONG_LONG
|
||||
# define BDIGIT_DBL_SIGNED LONG_LONG
|
||||
# define PRI_BDIGIT_PREFIX ""
|
||||
# define PRI_BDIGIT_DBL_PREFIX PRI_LL_PREFIX
|
||||
#elif SIZEOF_INT*2 <= SIZEOF_LONG
|
||||
# define BDIGIT unsigned int
|
||||
# define SIZEOF_BDIGITS SIZEOF_INT
|
||||
# define BDIGIT_DBL unsigned long
|
||||
# define BDIGIT_DBL_SIGNED long
|
||||
# define PRI_BDIGIT_PREFIX ""
|
||||
# define PRI_BDIGIT_DBL_PREFIX "l"
|
||||
#elif SIZEOF_SHORT*2 <= SIZEOF_LONG
|
||||
# define BDIGIT unsigned short
|
||||
# define SIZEOF_BDIGITS SIZEOF_SHORT
|
||||
# define BDIGIT_DBL unsigned long
|
||||
# define BDIGIT_DBL_SIGNED long
|
||||
# define PRI_BDIGIT_PREFIX "h"
|
||||
# define PRI_BDIGIT_DBL_PREFIX "l"
|
||||
#else
|
||||
# define BDIGIT unsigned short
|
||||
# define SIZEOF_BDIGITS (SIZEOF_LONG/2)
|
||||
# define BDIGIT_DBL unsigned long
|
||||
# define BDIGIT_DBL_SIGNED long
|
||||
# define PRI_BDIGIT_PREFIX "h"
|
||||
# define PRI_BDIGIT_DBL_PREFIX "l"
|
||||
#endif
|
||||
|
||||
#define PRIdBDIGIT PRI_BDIGIT_PREFIX"d"
|
||||
#define PRIiBDIGIT PRI_BDIGIT_PREFIX"i"
|
||||
#define PRIoBDIGIT PRI_BDIGIT_PREFIX"o"
|
||||
#define PRIuBDIGIT PRI_BDIGIT_PREFIX"u"
|
||||
#define PRIxBDIGIT PRI_BDIGIT_PREFIX"x"
|
||||
#define PRIXBDIGIT PRI_BDIGIT_PREFIX"X"
|
||||
|
||||
#define PRIdBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"d"
|
||||
#define PRIiBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"i"
|
||||
#define PRIoBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"o"
|
||||
#define PRIuBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"u"
|
||||
#define PRIxBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"x"
|
||||
#define PRIXBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"X"
|
||||
|
||||
#ifdef __CYGWIN__
|
||||
#undef _WIN32
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32) || defined(__EMX__)
|
||||
#define DOSISH 1
|
||||
# define DOSISH_DRIVE_LETTER
|
||||
#endif
|
||||
|
||||
#ifdef AC_APPLE_UNIVERSAL_BUILD
|
||||
#undef WORDS_BIGENDIAN
|
||||
#ifdef __BIG_ENDIAN__
|
||||
#define WORDS_BIGENDIAN
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
#include "ruby/win32.h"
|
||||
#endif
|
||||
|
||||
#if defined(__BEOS__) && !defined(__HAIKU__) && !defined(BONE)
|
||||
#include <net/socket.h> /* intern.h needs fd_set definition */
|
||||
#elif defined (__SYMBIAN32__) && defined (HAVE_SYS_SELECT_H)
|
||||
# include <sys/select.h>
|
||||
#endif
|
||||
|
||||
#ifdef __SYMBIAN32__
|
||||
# define FALSE 0
|
||||
# define TRUE 1
|
||||
#endif
|
||||
|
||||
#ifdef RUBY_EXPORT
|
||||
#undef RUBY_EXTERN
|
||||
|
||||
#ifndef FALSE
|
||||
# define FALSE 0
|
||||
#elif FALSE
|
||||
# error FALSE must be false
|
||||
#endif
|
||||
#ifndef TRUE
|
||||
# define TRUE 1
|
||||
#elif !TRUE
|
||||
# error TRUE must be true
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef RUBY_FUNC_EXPORTED
|
||||
#define RUBY_FUNC_EXPORTED
|
||||
#endif
|
||||
|
||||
#ifndef RUBY_EXTERN
|
||||
#define RUBY_EXTERN extern
|
||||
#endif
|
||||
|
||||
#ifndef EXTERN
|
||||
#define EXTERN RUBY_EXTERN /* deprecated */
|
||||
#endif
|
||||
|
||||
#ifndef RUBY_MBCHAR_MAXSIZE
|
||||
#define RUBY_MBCHAR_MAXSIZE INT_MAX
|
||||
/* MB_CUR_MAX will not work well in C locale */
|
||||
#endif
|
||||
|
||||
#if defined(__sparc)
|
||||
void rb_sparc_flush_register_windows(void);
|
||||
# define FLUSH_REGISTER_WINDOWS rb_sparc_flush_register_windows()
|
||||
#elif defined(__ia64)
|
||||
void *rb_ia64_bsp(void);
|
||||
void rb_ia64_flushrs(void);
|
||||
# define FLUSH_REGISTER_WINDOWS rb_ia64_flushrs()
|
||||
#else
|
||||
# define FLUSH_REGISTER_WINDOWS ((void)0)
|
||||
#endif
|
||||
|
||||
#if defined(DOSISH)
|
||||
#define PATH_SEP ";"
|
||||
#else
|
||||
#define PATH_SEP ":"
|
||||
#endif
|
||||
#define PATH_SEP_CHAR PATH_SEP[0]
|
||||
|
||||
#define PATH_ENV "PATH"
|
||||
|
||||
#if defined(DOSISH) && !defined(__EMX__)
|
||||
#define ENV_IGNORECASE
|
||||
#endif
|
||||
|
||||
#ifndef CASEFOLD_FILESYSTEM
|
||||
# if defined DOSISH
|
||||
# define CASEFOLD_FILESYSTEM 1
|
||||
# else
|
||||
# define CASEFOLD_FILESYSTEM 0
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef DLEXT_MAXLEN
|
||||
#define DLEXT_MAXLEN 4
|
||||
#endif
|
||||
|
||||
#ifndef RUBY_PLATFORM
|
||||
#define RUBY_PLATFORM "unknown-unknown"
|
||||
#endif
|
||||
|
||||
#ifndef RUBY_ALIAS_FUNCTION_TYPE
|
||||
#define RUBY_ALIAS_FUNCTION_TYPE(type, prot, name, args) \
|
||||
type prot {return name args;}
|
||||
#endif
|
||||
#ifndef RUBY_ALIAS_FUNCTION_VOID
|
||||
#define RUBY_ALIAS_FUNCTION_VOID(prot, name, args) \
|
||||
void prot {name args;}
|
||||
#endif
|
||||
#ifndef RUBY_ALIAS_FUNCTION
|
||||
#define RUBY_ALIAS_FUNCTION(prot, name, args) \
|
||||
RUBY_ALIAS_FUNCTION_TYPE(VALUE, prot, name, args)
|
||||
#endif
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility pop
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
#if 0
|
||||
{ /* satisfy cc-mode */
|
||||
#endif
|
||||
} /* extern "C" { */
|
||||
#endif
|
||||
|
||||
#endif /* RUBY_DEFINES_H */
|
||||
@@ -1,32 +0,0 @@
|
||||
/************************************************
|
||||
|
||||
digest.h - header file for ruby digest modules
|
||||
|
||||
$Author: akr $
|
||||
created at: Fri May 25 08:54:56 JST 2001
|
||||
|
||||
|
||||
Copyright (C) 2001-2006 Akinori MUSHA
|
||||
|
||||
$RoughId: digest.h,v 1.3 2001/07/13 15:38:27 knu Exp $
|
||||
$Id: digest.h 25189 2009-10-02 12:04:37Z akr $
|
||||
|
||||
************************************************/
|
||||
|
||||
#include "ruby.h"
|
||||
|
||||
#define RUBY_DIGEST_API_VERSION 2
|
||||
|
||||
typedef void (*rb_digest_hash_init_func_t)(void *);
|
||||
typedef void (*rb_digest_hash_update_func_t)(void *, unsigned char *, size_t);
|
||||
typedef void (*rb_digest_hash_finish_func_t)(void *, unsigned char *);
|
||||
|
||||
typedef struct {
|
||||
int api_version;
|
||||
size_t digest_len;
|
||||
size_t block_len;
|
||||
size_t ctx_size;
|
||||
rb_digest_hash_init_func_t init_func;
|
||||
rb_digest_hash_update_func_t update_func;
|
||||
rb_digest_hash_finish_func_t finish_func;
|
||||
} rb_digest_metadata_t;
|
||||
@@ -1,217 +0,0 @@
|
||||
#ifndef RUBY_DL_H
|
||||
#define RUBY_DL_H
|
||||
|
||||
#include <ruby.h>
|
||||
|
||||
#if !defined(FUNC_CDECL)
|
||||
# define FUNC_CDECL(x) x
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_DLFCN_H)
|
||||
# include <dlfcn.h>
|
||||
# /* some stranger systems may not define all of these */
|
||||
#ifndef RTLD_LAZY
|
||||
#define RTLD_LAZY 0
|
||||
#endif
|
||||
#ifndef RTLD_GLOBAL
|
||||
#define RTLD_GLOBAL 0
|
||||
#endif
|
||||
#ifndef RTLD_NOW
|
||||
#define RTLD_NOW 0
|
||||
#endif
|
||||
#else
|
||||
# if defined(_WIN32)
|
||||
# include <windows.h>
|
||||
# define dlopen(name,flag) ((void*)LoadLibrary(name))
|
||||
# define dlerror() strerror(rb_w32_map_errno(GetLastError()))
|
||||
# define dlsym(handle,name) ((void*)GetProcAddress((handle),(name)))
|
||||
# define RTLD_LAZY -1
|
||||
# define RTLD_NOW -1
|
||||
# define RTLD_GLOBAL -1
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#define MAX_CALLBACK 5
|
||||
#define DLSTACK_TYPE SIGNED_VALUE
|
||||
#define DLSTACK_SIZE (20)
|
||||
#define DLSTACK_PROTO \
|
||||
DLSTACK_TYPE,DLSTACK_TYPE,DLSTACK_TYPE,DLSTACK_TYPE,DLSTACK_TYPE,\
|
||||
DLSTACK_TYPE,DLSTACK_TYPE,DLSTACK_TYPE,DLSTACK_TYPE,DLSTACK_TYPE,\
|
||||
DLSTACK_TYPE,DLSTACK_TYPE,DLSTACK_TYPE,DLSTACK_TYPE,DLSTACK_TYPE,\
|
||||
DLSTACK_TYPE,DLSTACK_TYPE,DLSTACK_TYPE,DLSTACK_TYPE,DLSTACK_TYPE
|
||||
#define DLSTACK_ARGS(stack) \
|
||||
(stack)[0],(stack)[1],(stack)[2],(stack)[3],(stack)[4],\
|
||||
(stack)[5],(stack)[6],(stack)[7],(stack)[8],(stack)[9],\
|
||||
(stack)[10],(stack)[11],(stack)[12],(stack)[13],(stack)[14],\
|
||||
(stack)[15],(stack)[16],(stack)[17],(stack)[18],(stack)[19]
|
||||
|
||||
#define DLSTACK_PROTO0_ void
|
||||
#define DLSTACK_PROTO1_ DLSTACK_TYPE
|
||||
#define DLSTACK_PROTO2_ DLSTACK_PROTO1_, DLSTACK_TYPE
|
||||
#define DLSTACK_PROTO3_ DLSTACK_PROTO2_, DLSTACK_TYPE
|
||||
#define DLSTACK_PROTO4_ DLSTACK_PROTO3_, DLSTACK_TYPE
|
||||
#define DLSTACK_PROTO4_ DLSTACK_PROTO3_, DLSTACK_TYPE
|
||||
#define DLSTACK_PROTO5_ DLSTACK_PROTO4_, DLSTACK_TYPE
|
||||
#define DLSTACK_PROTO6_ DLSTACK_PROTO5_, DLSTACK_TYPE
|
||||
#define DLSTACK_PROTO7_ DLSTACK_PROTO6_, DLSTACK_TYPE
|
||||
#define DLSTACK_PROTO8_ DLSTACK_PROTO7_, DLSTACK_TYPE
|
||||
#define DLSTACK_PROTO9_ DLSTACK_PROTO8_, DLSTACK_TYPE
|
||||
#define DLSTACK_PROTO10_ DLSTACK_PROTO9_, DLSTACK_TYPE
|
||||
#define DLSTACK_PROTO11_ DLSTACK_PROTO10_, DLSTACK_TYPE
|
||||
#define DLSTACK_PROTO12_ DLSTACK_PROTO11_, DLSTACK_TYPE
|
||||
#define DLSTACK_PROTO13_ DLSTACK_PROTO12_, DLSTACK_TYPE
|
||||
#define DLSTACK_PROTO14_ DLSTACK_PROTO13_, DLSTACK_TYPE
|
||||
#define DLSTACK_PROTO14_ DLSTACK_PROTO13_, DLSTACK_TYPE
|
||||
#define DLSTACK_PROTO15_ DLSTACK_PROTO14_, DLSTACK_TYPE
|
||||
#define DLSTACK_PROTO16_ DLSTACK_PROTO15_, DLSTACK_TYPE
|
||||
#define DLSTACK_PROTO17_ DLSTACK_PROTO16_, DLSTACK_TYPE
|
||||
#define DLSTACK_PROTO18_ DLSTACK_PROTO17_, DLSTACK_TYPE
|
||||
#define DLSTACK_PROTO19_ DLSTACK_PROTO18_, DLSTACK_TYPE
|
||||
#define DLSTACK_PROTO20_ DLSTACK_PROTO19_, DLSTACK_TYPE
|
||||
|
||||
/*
|
||||
* Add ",..." as the last argument.
|
||||
* This is required for variable argument functions such
|
||||
* as fprintf() on x86_64-linux.
|
||||
*
|
||||
* http://refspecs.linuxfoundation.org/elf/x86_64-abi-0.95.pdf
|
||||
* page 19:
|
||||
*
|
||||
* For calls that may call functions that use varargs or stdargs
|
||||
* (prototype-less calls or calls to functions containing ellipsis
|
||||
* (...) in the declaration) %al is used as hidden argument to
|
||||
* specify the number of SSE registers used.
|
||||
*/
|
||||
#define DLSTACK_PROTO0 void
|
||||
#define DLSTACK_PROTO1 DLSTACK_PROTO1_, ...
|
||||
#define DLSTACK_PROTO2 DLSTACK_PROTO2_, ...
|
||||
#define DLSTACK_PROTO3 DLSTACK_PROTO3_, ...
|
||||
#define DLSTACK_PROTO4 DLSTACK_PROTO4_, ...
|
||||
#define DLSTACK_PROTO4 DLSTACK_PROTO4_, ...
|
||||
#define DLSTACK_PROTO5 DLSTACK_PROTO5_, ...
|
||||
#define DLSTACK_PROTO6 DLSTACK_PROTO6_, ...
|
||||
#define DLSTACK_PROTO7 DLSTACK_PROTO7_, ...
|
||||
#define DLSTACK_PROTO8 DLSTACK_PROTO8_, ...
|
||||
#define DLSTACK_PROTO9 DLSTACK_PROTO9_, ...
|
||||
#define DLSTACK_PROTO10 DLSTACK_PROTO10_, ...
|
||||
#define DLSTACK_PROTO11 DLSTACK_PROTO11_, ...
|
||||
#define DLSTACK_PROTO12 DLSTACK_PROTO12_, ...
|
||||
#define DLSTACK_PROTO13 DLSTACK_PROTO13_, ...
|
||||
#define DLSTACK_PROTO14 DLSTACK_PROTO14_, ...
|
||||
#define DLSTACK_PROTO14 DLSTACK_PROTO14_, ...
|
||||
#define DLSTACK_PROTO15 DLSTACK_PROTO15_, ...
|
||||
#define DLSTACK_PROTO16 DLSTACK_PROTO16_, ...
|
||||
#define DLSTACK_PROTO17 DLSTACK_PROTO17_, ...
|
||||
#define DLSTACK_PROTO18 DLSTACK_PROTO18_, ...
|
||||
#define DLSTACK_PROTO19 DLSTACK_PROTO19_, ...
|
||||
#define DLSTACK_PROTO20 DLSTACK_PROTO20_, ...
|
||||
|
||||
#define DLSTACK_ARGS0(stack)
|
||||
#define DLSTACK_ARGS1(stack) (stack)[0]
|
||||
#define DLSTACK_ARGS2(stack) DLSTACK_ARGS1(stack), (stack)[1]
|
||||
#define DLSTACK_ARGS3(stack) DLSTACK_ARGS2(stack), (stack)[2]
|
||||
#define DLSTACK_ARGS4(stack) DLSTACK_ARGS3(stack), (stack)[3]
|
||||
#define DLSTACK_ARGS5(stack) DLSTACK_ARGS4(stack), (stack)[4]
|
||||
#define DLSTACK_ARGS6(stack) DLSTACK_ARGS5(stack), (stack)[5]
|
||||
#define DLSTACK_ARGS7(stack) DLSTACK_ARGS6(stack), (stack)[6]
|
||||
#define DLSTACK_ARGS8(stack) DLSTACK_ARGS7(stack), (stack)[7]
|
||||
#define DLSTACK_ARGS9(stack) DLSTACK_ARGS8(stack), (stack)[8]
|
||||
#define DLSTACK_ARGS10(stack) DLSTACK_ARGS9(stack), (stack)[9]
|
||||
#define DLSTACK_ARGS11(stack) DLSTACK_ARGS10(stack), (stack)[10]
|
||||
#define DLSTACK_ARGS12(stack) DLSTACK_ARGS11(stack), (stack)[11]
|
||||
#define DLSTACK_ARGS13(stack) DLSTACK_ARGS12(stack), (stack)[12]
|
||||
#define DLSTACK_ARGS14(stack) DLSTACK_ARGS13(stack), (stack)[13]
|
||||
#define DLSTACK_ARGS15(stack) DLSTACK_ARGS14(stack), (stack)[14]
|
||||
#define DLSTACK_ARGS16(stack) DLSTACK_ARGS15(stack), (stack)[15]
|
||||
#define DLSTACK_ARGS17(stack) DLSTACK_ARGS16(stack), (stack)[16]
|
||||
#define DLSTACK_ARGS18(stack) DLSTACK_ARGS17(stack), (stack)[17]
|
||||
#define DLSTACK_ARGS19(stack) DLSTACK_ARGS18(stack), (stack)[18]
|
||||
#define DLSTACK_ARGS20(stack) DLSTACK_ARGS19(stack), (stack)[19]
|
||||
|
||||
extern VALUE rb_mDL;
|
||||
extern VALUE rb_cDLHandle;
|
||||
extern VALUE rb_cDLSymbol;
|
||||
extern VALUE rb_eDLError;
|
||||
extern VALUE rb_eDLTypeError;
|
||||
|
||||
#define ALIGN_OF(type) offsetof(struct {char align_c; type align_x;}, align_x)
|
||||
|
||||
#define ALIGN_VOIDP ALIGN_OF(void*)
|
||||
#define ALIGN_SHORT ALIGN_OF(short)
|
||||
#define ALIGN_CHAR ALIGN_OF(char)
|
||||
#define ALIGN_INT ALIGN_OF(int)
|
||||
#define ALIGN_LONG ALIGN_OF(long)
|
||||
#if HAVE_LONG_LONG
|
||||
#define ALIGN_LONG_LONG ALIGN_OF(LONG_LONG)
|
||||
#endif
|
||||
#define ALIGN_FLOAT ALIGN_OF(float)
|
||||
#define ALIGN_DOUBLE ALIGN_OF(double)
|
||||
|
||||
#define DLALIGN(ptr,offset,align) \
|
||||
((offset) += ((align) - ((uintptr_t)((char *)(ptr) + (offset))) % (align)) % (align))
|
||||
|
||||
|
||||
#define DLTYPE_VOID 0
|
||||
#define DLTYPE_VOIDP 1
|
||||
#define DLTYPE_CHAR 2
|
||||
#define DLTYPE_SHORT 3
|
||||
#define DLTYPE_INT 4
|
||||
#define DLTYPE_LONG 5
|
||||
#if HAVE_LONG_LONG
|
||||
#define DLTYPE_LONG_LONG 6
|
||||
#endif
|
||||
#define DLTYPE_FLOAT 7
|
||||
#define DLTYPE_DOUBLE 8
|
||||
#define MAX_DLTYPE 9
|
||||
|
||||
#if SIZEOF_VOIDP == SIZEOF_LONG
|
||||
# define PTR2NUM(x) (ULONG2NUM((unsigned long)(x)))
|
||||
# define NUM2PTR(x) ((void*)(NUM2ULONG(x)))
|
||||
#else
|
||||
/* # error --->> Ruby/DL2 requires sizeof(void*) == sizeof(long) to be compiled. <<--- */
|
||||
# define PTR2NUM(x) (ULL2NUM((unsigned long long)(x)))
|
||||
# define NUM2PTR(x) ((void*)(NUM2ULL(x)))
|
||||
#endif
|
||||
|
||||
#define BOOL2INT(x) (((x) == Qtrue)?1:0)
|
||||
#define INT2BOOL(x) ((x)?Qtrue:Qfalse)
|
||||
|
||||
typedef void (*freefunc_t)(void*);
|
||||
|
||||
struct dl_handle {
|
||||
void *ptr;
|
||||
int open;
|
||||
int enable_close;
|
||||
};
|
||||
|
||||
|
||||
struct cfunc_data {
|
||||
void *ptr;
|
||||
char *name;
|
||||
int type;
|
||||
ID calltype;
|
||||
VALUE wrap;
|
||||
};
|
||||
extern ID rbdl_id_cdecl;
|
||||
extern ID rbdl_id_stdcall;
|
||||
#define CFUNC_CDECL (rbdl_id_cdecl)
|
||||
#define CFUNC_STDCALL (rbdl_id_stdcall)
|
||||
|
||||
struct ptr_data {
|
||||
void *ptr;
|
||||
long size;
|
||||
freefunc_t free;
|
||||
VALUE wrap[2];
|
||||
};
|
||||
|
||||
#define RDL_HANDLE(obj) ((struct dl_handle *)(DATA_PTR(obj)))
|
||||
#define RCFUNC_DATA(obj) ((struct cfunc_data *)(DATA_PTR(obj)))
|
||||
#define RPTR_DATA(obj) ((struct ptr_data *)(DATA_PTR(obj)))
|
||||
|
||||
VALUE rb_dlcfunc_new(void (*func)(), int dltype, const char * name, ID calltype);
|
||||
int rb_dlcfunc_kind_p(VALUE func);
|
||||
VALUE rb_dlptr_new(void *ptr, long size, freefunc_t func);
|
||||
VALUE rb_dlptr_new2(VALUE klass, void *ptr, long size, freefunc_t func);
|
||||
VALUE rb_dlptr_malloc(long size, freefunc_t func);
|
||||
|
||||
#endif
|
||||
@@ -1,354 +0,0 @@
|
||||
/**********************************************************************
|
||||
|
||||
encoding.h -
|
||||
|
||||
$Author: matz $
|
||||
created at: Thu May 24 11:49:41 JST 2007
|
||||
|
||||
Copyright (C) 2007 Yukihiro Matsumoto
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef RUBY_ENCODING_H
|
||||
#define RUBY_ENCODING_H 1
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#if 0
|
||||
} /* satisfy cc-mode */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <stdarg.h>
|
||||
#include "ruby/oniguruma.h"
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility push(default)
|
||||
#endif
|
||||
|
||||
#define ENCODING_INLINE_MAX 1023
|
||||
#define ENCODING_SHIFT (FL_USHIFT+10)
|
||||
#define ENCODING_MASK (((VALUE)ENCODING_INLINE_MAX)<<ENCODING_SHIFT)
|
||||
|
||||
#define ENCODING_SET_INLINED(obj,i) do {\
|
||||
RBASIC(obj)->flags &= ~ENCODING_MASK;\
|
||||
RBASIC(obj)->flags |= (VALUE)(i) << ENCODING_SHIFT;\
|
||||
} while (0)
|
||||
#define ENCODING_SET(obj,i) do {\
|
||||
VALUE rb_encoding_set_obj = (obj); \
|
||||
int encoding_set_enc_index = (i); \
|
||||
if (encoding_set_enc_index < ENCODING_INLINE_MAX) \
|
||||
ENCODING_SET_INLINED(rb_encoding_set_obj, encoding_set_enc_index); \
|
||||
else \
|
||||
rb_enc_set_index(rb_encoding_set_obj, encoding_set_enc_index); \
|
||||
} while (0)
|
||||
|
||||
#define ENCODING_GET_INLINED(obj) (int)((RBASIC(obj)->flags & ENCODING_MASK)>>ENCODING_SHIFT)
|
||||
#define ENCODING_GET(obj) \
|
||||
(ENCODING_GET_INLINED(obj) != ENCODING_INLINE_MAX ? \
|
||||
ENCODING_GET_INLINED(obj) : \
|
||||
rb_enc_get_index(obj))
|
||||
|
||||
#define ENCODING_IS_ASCII8BIT(obj) (ENCODING_GET_INLINED(obj) == 0)
|
||||
|
||||
#define ENCODING_MAXNAMELEN 42
|
||||
|
||||
#define ENC_CODERANGE_MASK ((int)(FL_USER8|FL_USER9))
|
||||
#define ENC_CODERANGE_UNKNOWN 0
|
||||
#define ENC_CODERANGE_7BIT ((int)FL_USER8)
|
||||
#define ENC_CODERANGE_VALID ((int)FL_USER9)
|
||||
#define ENC_CODERANGE_BROKEN ((int)(FL_USER8|FL_USER9))
|
||||
#define ENC_CODERANGE(obj) ((int)RBASIC(obj)->flags & ENC_CODERANGE_MASK)
|
||||
#define ENC_CODERANGE_ASCIIONLY(obj) (ENC_CODERANGE(obj) == ENC_CODERANGE_7BIT)
|
||||
#define ENC_CODERANGE_SET(obj,cr) (RBASIC(obj)->flags = \
|
||||
(RBASIC(obj)->flags & ~ENC_CODERANGE_MASK) | (cr))
|
||||
#define ENC_CODERANGE_CLEAR(obj) ENC_CODERANGE_SET((obj),0)
|
||||
|
||||
/* assumed ASCII compatibility */
|
||||
#define ENC_CODERANGE_AND(a, b) \
|
||||
((a) == ENC_CODERANGE_7BIT ? (b) : \
|
||||
(a) == ENC_CODERANGE_VALID ? ((b) == ENC_CODERANGE_7BIT ? ENC_CODERANGE_VALID : (b)) : \
|
||||
ENC_CODERANGE_UNKNOWN)
|
||||
|
||||
#define ENCODING_CODERANGE_SET(obj, encindex, cr) \
|
||||
do { \
|
||||
VALUE rb_encoding_coderange_obj = (obj); \
|
||||
ENCODING_SET(rb_encoding_coderange_obj, (encindex)); \
|
||||
ENC_CODERANGE_SET(rb_encoding_coderange_obj, (cr)); \
|
||||
} while (0)
|
||||
|
||||
typedef OnigEncodingType rb_encoding;
|
||||
|
||||
int rb_char_to_option_kcode(int c, int *option, int *kcode);
|
||||
|
||||
int rb_enc_replicate(const char *, rb_encoding *);
|
||||
int rb_define_dummy_encoding(const char *);
|
||||
#define rb_enc_to_index(enc) ((enc) ? ENC_TO_ENCINDEX(enc) : 0)
|
||||
int rb_enc_get_index(VALUE obj);
|
||||
void rb_enc_set_index(VALUE obj, int encindex);
|
||||
int rb_enc_find_index(const char *name);
|
||||
int rb_to_encoding_index(VALUE);
|
||||
rb_encoding* rb_to_encoding(VALUE);
|
||||
rb_encoding* rb_find_encoding(VALUE);
|
||||
rb_encoding* rb_enc_get(VALUE);
|
||||
rb_encoding* rb_enc_compatible(VALUE,VALUE);
|
||||
rb_encoding* rb_enc_check(VALUE,VALUE);
|
||||
VALUE rb_enc_associate_index(VALUE, int);
|
||||
VALUE rb_enc_associate(VALUE, rb_encoding*);
|
||||
void rb_enc_copy(VALUE dst, VALUE src);
|
||||
|
||||
VALUE rb_enc_str_new(const char*, long, rb_encoding*);
|
||||
VALUE rb_enc_reg_new(const char*, long, rb_encoding*, int);
|
||||
PRINTF_ARGS(VALUE rb_enc_sprintf(rb_encoding *, const char*, ...), 2, 3);
|
||||
VALUE rb_enc_vsprintf(rb_encoding *, const char*, va_list);
|
||||
long rb_enc_strlen(const char*, const char*, rb_encoding*);
|
||||
char* rb_enc_nth(const char*, const char*, long, rb_encoding*);
|
||||
VALUE rb_obj_encoding(VALUE);
|
||||
VALUE rb_enc_str_buf_cat(VALUE str, const char *ptr, long len, rb_encoding *enc);
|
||||
VALUE rb_enc_uint_chr(unsigned int code, rb_encoding *enc);
|
||||
|
||||
VALUE rb_external_str_new_with_enc(const char *ptr, long len, rb_encoding *);
|
||||
VALUE rb_str_export_to_enc(VALUE, rb_encoding *);
|
||||
VALUE rb_str_conv_enc(VALUE str, rb_encoding *from, rb_encoding *to);
|
||||
VALUE rb_str_conv_enc_opts(VALUE str, rb_encoding *from, rb_encoding *to, int ecflags, VALUE ecopts);
|
||||
|
||||
PRINTF_ARGS(NORETURN(void rb_enc_raise(rb_encoding *, VALUE, const char*, ...)), 3, 4);
|
||||
|
||||
/* index -> rb_encoding */
|
||||
rb_encoding* rb_enc_from_index(int idx);
|
||||
|
||||
/* name -> rb_encoding */
|
||||
rb_encoding * rb_enc_find(const char *name);
|
||||
|
||||
/* rb_encoding * -> name */
|
||||
#define rb_enc_name(enc) (enc)->name
|
||||
|
||||
/* rb_encoding * -> minlen/maxlen */
|
||||
#define rb_enc_mbminlen(enc) (enc)->min_enc_len
|
||||
#define rb_enc_mbmaxlen(enc) (enc)->max_enc_len
|
||||
|
||||
/* -> mbclen (no error notification: 0 < ret <= e-p, no exception) */
|
||||
int rb_enc_mbclen(const char *p, const char *e, rb_encoding *enc);
|
||||
|
||||
/* -> mbclen (only for valid encoding) */
|
||||
int rb_enc_fast_mbclen(const char *p, const char *e, rb_encoding *enc);
|
||||
|
||||
/* -> chlen, invalid or needmore */
|
||||
int rb_enc_precise_mbclen(const char *p, const char *e, rb_encoding *enc);
|
||||
#define MBCLEN_CHARFOUND_P(ret) ONIGENC_MBCLEN_CHARFOUND_P(ret)
|
||||
#define MBCLEN_CHARFOUND_LEN(ret) ONIGENC_MBCLEN_CHARFOUND_LEN(ret)
|
||||
#define MBCLEN_INVALID_P(ret) ONIGENC_MBCLEN_INVALID_P(ret)
|
||||
#define MBCLEN_NEEDMORE_P(ret) ONIGENC_MBCLEN_NEEDMORE_P(ret)
|
||||
#define MBCLEN_NEEDMORE_LEN(ret) ONIGENC_MBCLEN_NEEDMORE_LEN(ret)
|
||||
|
||||
/* -> 0x00..0x7f, -1 */
|
||||
int rb_enc_ascget(const char *p, const char *e, int *len, rb_encoding *enc);
|
||||
|
||||
|
||||
/* -> code (and len) or raise exception */
|
||||
unsigned int rb_enc_codepoint_len(const char *p, const char *e, int *len, rb_encoding *enc);
|
||||
|
||||
/* prototype for obsolete function */
|
||||
unsigned int rb_enc_codepoint(const char *p, const char *e, rb_encoding *enc);
|
||||
/* overriding macro */
|
||||
#define rb_enc_codepoint(p,e,enc) rb_enc_codepoint_len((p),(e),0,(enc))
|
||||
#define rb_enc_mbc_to_codepoint(p, e, enc) ONIGENC_MBC_TO_CODE((enc),(UChar*)(p),(UChar*)(e))
|
||||
|
||||
/* -> codelen>0 or raise exception */
|
||||
int rb_enc_codelen(int code, rb_encoding *enc);
|
||||
|
||||
/* code,ptr,encoding -> write buf */
|
||||
#define rb_enc_mbcput(c,buf,enc) ONIGENC_CODE_TO_MBC((enc),(c),(UChar*)(buf))
|
||||
|
||||
/* start, ptr, end, encoding -> prev_char */
|
||||
#define rb_enc_prev_char(s,p,e,enc) ((char *)onigenc_get_prev_char_head((enc),(UChar*)(s),(UChar*)(p),(UChar*)(e)))
|
||||
/* start, ptr, end, encoding -> next_char */
|
||||
#define rb_enc_left_char_head(s,p,e,enc) ((char *)onigenc_get_left_adjust_char_head((enc),(UChar*)(s),(UChar*)(p),(UChar*)(e)))
|
||||
#define rb_enc_right_char_head(s,p,e,enc) ((char *)onigenc_get_right_adjust_char_head((enc),(UChar*)(s),(UChar*)(p),(UChar*)(e)))
|
||||
#define rb_enc_step_back(s,p,e,n,enc) ((char *)onigenc_step_back((enc),(UChar*)(s),(UChar*)(p),(UChar*)(e),(int)(n)))
|
||||
|
||||
/* ptr, ptr, encoding -> newline_or_not */
|
||||
#define rb_enc_is_newline(p,end,enc) ONIGENC_IS_MBC_NEWLINE((enc),(UChar*)(p),(UChar*)(end))
|
||||
|
||||
#define rb_enc_isctype(c,t,enc) ONIGENC_IS_CODE_CTYPE((enc),(c),(t))
|
||||
#define rb_enc_isascii(c,enc) ONIGENC_IS_CODE_ASCII(c)
|
||||
#define rb_enc_isalpha(c,enc) ONIGENC_IS_CODE_ALPHA((enc),(c))
|
||||
#define rb_enc_islower(c,enc) ONIGENC_IS_CODE_LOWER((enc),(c))
|
||||
#define rb_enc_isupper(c,enc) ONIGENC_IS_CODE_UPPER((enc),(c))
|
||||
#define rb_enc_ispunct(c,enc) ONIGENC_IS_CODE_PUNCT((enc),(c))
|
||||
#define rb_enc_isalnum(c,enc) ONIGENC_IS_CODE_ALNUM((enc),(c))
|
||||
#define rb_enc_isprint(c,enc) ONIGENC_IS_CODE_PRINT((enc),(c))
|
||||
#define rb_enc_isspace(c,enc) ONIGENC_IS_CODE_SPACE((enc),(c))
|
||||
#define rb_enc_isdigit(c,enc) ONIGENC_IS_CODE_DIGIT((enc),(c))
|
||||
|
||||
#define rb_enc_asciicompat(enc) (rb_enc_mbminlen(enc)==1 && !rb_enc_dummy_p(enc))
|
||||
|
||||
int rb_enc_casefold(char *to, const char *p, const char *e, rb_encoding *enc);
|
||||
int rb_enc_toupper(int c, rb_encoding *enc);
|
||||
int rb_enc_tolower(int c, rb_encoding *enc);
|
||||
ID rb_intern3(const char*, long, rb_encoding*);
|
||||
ID rb_interned_id_p(const char *, long, rb_encoding *);
|
||||
int rb_enc_symname_p(const char*, rb_encoding*);
|
||||
int rb_enc_symname2_p(const char*, long, rb_encoding*);
|
||||
int rb_enc_str_coderange(VALUE);
|
||||
long rb_str_coderange_scan_restartable(const char*, const char*, rb_encoding*, int*);
|
||||
int rb_enc_str_asciionly_p(VALUE);
|
||||
#define rb_enc_str_asciicompat_p(str) rb_enc_asciicompat(rb_enc_get(str))
|
||||
VALUE rb_enc_from_encoding(rb_encoding *enc);
|
||||
int rb_enc_unicode_p(rb_encoding *enc);
|
||||
rb_encoding *rb_ascii8bit_encoding(void);
|
||||
rb_encoding *rb_utf8_encoding(void);
|
||||
rb_encoding *rb_usascii_encoding(void);
|
||||
rb_encoding *rb_locale_encoding(void);
|
||||
rb_encoding *rb_filesystem_encoding(void);
|
||||
rb_encoding *rb_default_external_encoding(void);
|
||||
rb_encoding *rb_default_internal_encoding(void);
|
||||
int rb_ascii8bit_encindex(void);
|
||||
int rb_utf8_encindex(void);
|
||||
int rb_usascii_encindex(void);
|
||||
int rb_locale_encindex(void);
|
||||
int rb_filesystem_encindex(void);
|
||||
VALUE rb_enc_default_external(void);
|
||||
VALUE rb_enc_default_internal(void);
|
||||
void rb_enc_set_default_external(VALUE encoding);
|
||||
void rb_enc_set_default_internal(VALUE encoding);
|
||||
VALUE rb_locale_charmap(VALUE klass);
|
||||
long rb_memsearch(const void*,long,const void*,long,rb_encoding*);
|
||||
char *rb_enc_path_next(const char *,const char *,rb_encoding*);
|
||||
char *rb_enc_path_skip_prefix(const char *,const char *,rb_encoding*);
|
||||
char *rb_enc_path_last_separator(const char *,const char *,rb_encoding*);
|
||||
char *rb_enc_path_end(const char *,const char *,rb_encoding*);
|
||||
const char *ruby_enc_find_basename(const char *name, long *baselen, long *alllen, rb_encoding *enc);
|
||||
const char *ruby_enc_find_extname(const char *name, long *len, rb_encoding *enc);
|
||||
ID rb_check_id_cstr(const char *ptr, long len, rb_encoding *enc);
|
||||
|
||||
RUBY_EXTERN VALUE rb_cEncoding;
|
||||
#define ENC_DUMMY_FLAG (1<<24)
|
||||
#define ENC_INDEX_MASK (~(~0U<<24))
|
||||
|
||||
#define ENC_TO_ENCINDEX(enc) (int)((enc)->ruby_encoding_index & ENC_INDEX_MASK)
|
||||
|
||||
#define ENC_DUMMY_P(enc) ((enc)->ruby_encoding_index & ENC_DUMMY_FLAG)
|
||||
#define ENC_SET_DUMMY(enc) ((enc)->ruby_encoding_index |= ENC_DUMMY_FLAG)
|
||||
|
||||
static inline int
|
||||
rb_enc_dummy_p(rb_encoding *enc)
|
||||
{
|
||||
return ENC_DUMMY_P(enc) != 0;
|
||||
}
|
||||
|
||||
/* econv stuff */
|
||||
|
||||
typedef enum {
|
||||
econv_invalid_byte_sequence,
|
||||
econv_undefined_conversion,
|
||||
econv_destination_buffer_full,
|
||||
econv_source_buffer_empty,
|
||||
econv_finished,
|
||||
econv_after_output,
|
||||
econv_incomplete_input
|
||||
} rb_econv_result_t;
|
||||
|
||||
typedef struct rb_econv_t rb_econv_t;
|
||||
|
||||
VALUE rb_str_encode(VALUE str, VALUE to, int ecflags, VALUE ecopts);
|
||||
int rb_econv_has_convpath_p(const char* from_encoding, const char* to_encoding);
|
||||
|
||||
int rb_econv_prepare_options(VALUE opthash, VALUE *ecopts, int ecflags);
|
||||
int rb_econv_prepare_opts(VALUE opthash, VALUE *ecopts);
|
||||
|
||||
rb_econv_t *rb_econv_open(const char *source_encoding, const char *destination_encoding, int ecflags);
|
||||
rb_econv_t *rb_econv_open_opts(const char *source_encoding, const char *destination_encoding, int ecflags, VALUE ecopts);
|
||||
|
||||
rb_econv_result_t rb_econv_convert(rb_econv_t *ec,
|
||||
const unsigned char **source_buffer_ptr, const unsigned char *source_buffer_end,
|
||||
unsigned char **destination_buffer_ptr, unsigned char *destination_buffer_end,
|
||||
int flags);
|
||||
void rb_econv_close(rb_econv_t *ec);
|
||||
|
||||
/* result: 0:success -1:failure */
|
||||
int rb_econv_set_replacement(rb_econv_t *ec, const unsigned char *str, size_t len, const char *encname);
|
||||
|
||||
/* result: 0:success -1:failure */
|
||||
int rb_econv_decorate_at_first(rb_econv_t *ec, const char *decorator_name);
|
||||
int rb_econv_decorate_at_last(rb_econv_t *ec, const char *decorator_name);
|
||||
|
||||
VALUE rb_econv_open_exc(const char *senc, const char *denc, int ecflags);
|
||||
|
||||
/* result: 0:success -1:failure */
|
||||
int rb_econv_insert_output(rb_econv_t *ec,
|
||||
const unsigned char *str, size_t len, const char *str_encoding);
|
||||
|
||||
/* encoding that rb_econv_insert_output doesn't need conversion */
|
||||
const char *rb_econv_encoding_to_insert_output(rb_econv_t *ec);
|
||||
|
||||
/* raise an error if the last rb_econv_convert is error */
|
||||
void rb_econv_check_error(rb_econv_t *ec);
|
||||
|
||||
/* returns an exception object or nil */
|
||||
VALUE rb_econv_make_exception(rb_econv_t *ec);
|
||||
|
||||
int rb_econv_putbackable(rb_econv_t *ec);
|
||||
void rb_econv_putback(rb_econv_t *ec, unsigned char *p, int n);
|
||||
|
||||
/* returns the corresponding ASCII compatible encoding for encname,
|
||||
* or NULL if encname is not ASCII incompatible encoding. */
|
||||
const char *rb_econv_asciicompat_encoding(const char *encname);
|
||||
|
||||
VALUE rb_econv_str_convert(rb_econv_t *ec, VALUE src, int flags);
|
||||
VALUE rb_econv_substr_convert(rb_econv_t *ec, VALUE src, long byteoff, long bytesize, int flags);
|
||||
VALUE rb_econv_str_append(rb_econv_t *ec, VALUE src, VALUE dst, int flags);
|
||||
VALUE rb_econv_substr_append(rb_econv_t *ec, VALUE src, long byteoff, long bytesize, VALUE dst, int flags);
|
||||
|
||||
void rb_econv_binmode(rb_econv_t *ec);
|
||||
|
||||
/* flags for rb_econv_open */
|
||||
|
||||
#define ECONV_ERROR_HANDLER_MASK 0x000000ff
|
||||
|
||||
#define ECONV_INVALID_MASK 0x0000000f
|
||||
#define ECONV_INVALID_REPLACE 0x00000002
|
||||
|
||||
#define ECONV_UNDEF_MASK 0x000000f0
|
||||
#define ECONV_UNDEF_REPLACE 0x00000020
|
||||
#define ECONV_UNDEF_HEX_CHARREF 0x00000030
|
||||
|
||||
#define ECONV_DECORATOR_MASK 0x0000ff00
|
||||
#define ECONV_NEWLINE_DECORATOR_MASK 0x00003f00
|
||||
#define ECONV_NEWLINE_DECORATOR_READ_MASK 0x00000f00
|
||||
#define ECONV_NEWLINE_DECORATOR_WRITE_MASK 0x00003000
|
||||
|
||||
#define ECONV_UNIVERSAL_NEWLINE_DECORATOR 0x00000100
|
||||
#define ECONV_CRLF_NEWLINE_DECORATOR 0x00001000
|
||||
#define ECONV_CR_NEWLINE_DECORATOR 0x00002000
|
||||
#define ECONV_XML_TEXT_DECORATOR 0x00004000
|
||||
#define ECONV_XML_ATTR_CONTENT_DECORATOR 0x00008000
|
||||
|
||||
#define ECONV_STATEFUL_DECORATOR_MASK 0x00f00000
|
||||
#define ECONV_XML_ATTR_QUOTE_DECORATOR 0x00100000
|
||||
|
||||
#if defined(RUBY_TEST_CRLF_ENVIRONMENT) || defined(_WIN32)
|
||||
#define ECONV_DEFAULT_NEWLINE_DECORATOR ECONV_CRLF_NEWLINE_DECORATOR
|
||||
#else
|
||||
#define ECONV_DEFAULT_NEWLINE_DECORATOR 0
|
||||
#endif
|
||||
|
||||
/* end of flags for rb_econv_open */
|
||||
|
||||
/* flags for rb_econv_convert */
|
||||
#define ECONV_PARTIAL_INPUT 0x00010000
|
||||
#define ECONV_AFTER_OUTPUT 0x00020000
|
||||
/* end of flags for rb_econv_convert */
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility pop
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
#if 0
|
||||
{ /* satisfy cc-mode */
|
||||
#endif
|
||||
} /* extern "C" { */
|
||||
#endif
|
||||
|
||||
#endif /* RUBY_ENCODING_H */
|
||||
@@ -1,929 +0,0 @@
|
||||
/**********************************************************************
|
||||
|
||||
intern.h -
|
||||
|
||||
$Author: nagachika $
|
||||
created at: Thu Jun 10 14:22:17 JST 1993
|
||||
|
||||
Copyright (C) 1993-2007 Yukihiro Matsumoto
|
||||
Copyright (C) 2000 Network Applied Communication Laboratory, Inc.
|
||||
Copyright (C) 2000 Information-technology Promotion Agency, Japan
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef RUBY_INTERN_H
|
||||
#define RUBY_INTERN_H 1
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#if 0
|
||||
} /* satisfy cc-mode */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "ruby/defines.h"
|
||||
#ifdef RUBY_EXTCONF_H
|
||||
#include RUBY_EXTCONF_H
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STDARG_PROTOTYPES
|
||||
# include <stdarg.h>
|
||||
#else
|
||||
# include <varargs.h>
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_SYS_TYPES_H)
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_SYS_TIME_H)
|
||||
#include <sys/time.h>
|
||||
#endif
|
||||
|
||||
#include "ruby/st.h"
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility push(default)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Functions and variables that are used by more than one source file of
|
||||
* the kernel.
|
||||
*/
|
||||
|
||||
#define UNLIMITED_ARGUMENTS (-1)
|
||||
|
||||
/* array.c */
|
||||
void rb_mem_clear(register VALUE*, register long);
|
||||
VALUE rb_assoc_new(VALUE, VALUE);
|
||||
VALUE rb_check_array_type(VALUE);
|
||||
VALUE rb_ary_new(void);
|
||||
VALUE rb_ary_new2(long);
|
||||
VALUE rb_ary_new3(long,...);
|
||||
VALUE rb_ary_new4(long, const VALUE *);
|
||||
VALUE rb_ary_tmp_new(long);
|
||||
void rb_ary_free(VALUE);
|
||||
void rb_ary_modify(VALUE);
|
||||
VALUE rb_ary_freeze(VALUE);
|
||||
VALUE rb_ary_shared_with_p(VALUE, VALUE);
|
||||
VALUE rb_ary_aref(int, VALUE*, VALUE);
|
||||
VALUE rb_ary_subseq(VALUE, long, long);
|
||||
void rb_ary_store(VALUE, long, VALUE);
|
||||
VALUE rb_ary_dup(VALUE);
|
||||
VALUE rb_ary_resurrect(VALUE ary);
|
||||
VALUE rb_ary_to_ary(VALUE);
|
||||
VALUE rb_ary_to_s(VALUE);
|
||||
VALUE rb_ary_push(VALUE, VALUE);
|
||||
VALUE rb_ary_pop(VALUE);
|
||||
VALUE rb_ary_shift(VALUE);
|
||||
VALUE rb_ary_unshift(VALUE, VALUE);
|
||||
VALUE rb_ary_entry(VALUE, long);
|
||||
VALUE rb_ary_each(VALUE);
|
||||
VALUE rb_ary_join(VALUE, VALUE);
|
||||
VALUE rb_ary_reverse(VALUE);
|
||||
VALUE rb_ary_rotate(VALUE, long);
|
||||
VALUE rb_ary_sort(VALUE);
|
||||
VALUE rb_ary_sort_bang(VALUE);
|
||||
VALUE rb_ary_delete(VALUE, VALUE);
|
||||
VALUE rb_ary_delete_at(VALUE, long);
|
||||
VALUE rb_ary_clear(VALUE);
|
||||
VALUE rb_ary_plus(VALUE, VALUE);
|
||||
VALUE rb_ary_concat(VALUE, VALUE);
|
||||
VALUE rb_ary_assoc(VALUE, VALUE);
|
||||
VALUE rb_ary_rassoc(VALUE, VALUE);
|
||||
VALUE rb_ary_includes(VALUE, VALUE);
|
||||
VALUE rb_ary_cmp(VALUE, VALUE);
|
||||
VALUE rb_ary_replace(VALUE copy, VALUE orig);
|
||||
VALUE rb_get_values_at(VALUE, long, int, VALUE*, VALUE(*)(VALUE,long));
|
||||
VALUE rb_ary_resize(VALUE ary, long len);
|
||||
/* bignum.c */
|
||||
VALUE rb_big_new(long, int);
|
||||
int rb_bigzero_p(VALUE x);
|
||||
VALUE rb_big_clone(VALUE);
|
||||
void rb_big_2comp(VALUE);
|
||||
VALUE rb_big_norm(VALUE);
|
||||
void rb_big_resize(VALUE big, long len);
|
||||
VALUE rb_uint2big(VALUE);
|
||||
VALUE rb_int2big(SIGNED_VALUE);
|
||||
VALUE rb_uint2inum(VALUE);
|
||||
VALUE rb_int2inum(SIGNED_VALUE);
|
||||
VALUE rb_cstr_to_inum(const char*, int, int);
|
||||
VALUE rb_str_to_inum(VALUE, int, int);
|
||||
VALUE rb_cstr2inum(const char*, int);
|
||||
VALUE rb_str2inum(VALUE, int);
|
||||
VALUE rb_big2str(VALUE, int);
|
||||
VALUE rb_big2str0(VALUE, int, int);
|
||||
SIGNED_VALUE rb_big2long(VALUE);
|
||||
#define rb_big2int(x) rb_big2long(x)
|
||||
VALUE rb_big2ulong(VALUE);
|
||||
#define rb_big2uint(x) rb_big2ulong(x)
|
||||
VALUE rb_big2ulong_pack(VALUE x);
|
||||
#if HAVE_LONG_LONG
|
||||
VALUE rb_ll2inum(LONG_LONG);
|
||||
VALUE rb_ull2inum(unsigned LONG_LONG);
|
||||
LONG_LONG rb_big2ll(VALUE);
|
||||
unsigned LONG_LONG rb_big2ull(VALUE);
|
||||
#endif /* HAVE_LONG_LONG */
|
||||
DEPRECATED(void rb_quad_pack(char*,VALUE));
|
||||
DEPRECATED(VALUE rb_quad_unpack(const char*,int));
|
||||
void rb_big_pack(VALUE val, unsigned long *buf, long num_longs);
|
||||
VALUE rb_big_unpack(unsigned long *buf, long num_longs);
|
||||
int rb_uv_to_utf8(char[6],unsigned long);
|
||||
VALUE rb_dbl2big(double);
|
||||
double rb_big2dbl(VALUE);
|
||||
VALUE rb_big_cmp(VALUE, VALUE);
|
||||
VALUE rb_big_eq(VALUE, VALUE);
|
||||
VALUE rb_big_eql(VALUE, VALUE);
|
||||
VALUE rb_big_plus(VALUE, VALUE);
|
||||
VALUE rb_big_minus(VALUE, VALUE);
|
||||
VALUE rb_big_mul(VALUE, VALUE);
|
||||
VALUE rb_big_div(VALUE, VALUE);
|
||||
VALUE rb_big_idiv(VALUE, VALUE);
|
||||
VALUE rb_big_modulo(VALUE, VALUE);
|
||||
VALUE rb_big_divmod(VALUE, VALUE);
|
||||
VALUE rb_big_pow(VALUE, VALUE);
|
||||
VALUE rb_big_and(VALUE, VALUE);
|
||||
VALUE rb_big_or(VALUE, VALUE);
|
||||
VALUE rb_big_xor(VALUE, VALUE);
|
||||
VALUE rb_big_lshift(VALUE, VALUE);
|
||||
VALUE rb_big_rshift(VALUE, VALUE);
|
||||
/* rational.c */
|
||||
VALUE rb_rational_raw(VALUE, VALUE);
|
||||
#define rb_rational_raw1(x) rb_rational_raw((x), INT2FIX(1))
|
||||
#define rb_rational_raw2(x,y) rb_rational_raw((x), (y))
|
||||
VALUE rb_rational_new(VALUE, VALUE);
|
||||
#define rb_rational_new1(x) rb_rational_new((x), INT2FIX(1))
|
||||
#define rb_rational_new2(x,y) rb_rational_new((x), (y))
|
||||
VALUE rb_Rational(VALUE, VALUE);
|
||||
#define rb_Rational1(x) rb_Rational((x), INT2FIX(1))
|
||||
#define rb_Rational2(x,y) rb_Rational((x), (y))
|
||||
/* complex.c */
|
||||
VALUE rb_complex_raw(VALUE, VALUE);
|
||||
#define rb_complex_raw1(x) rb_complex_raw((x), INT2FIX(0))
|
||||
#define rb_complex_raw2(x,y) rb_complex_raw((x), (y))
|
||||
VALUE rb_complex_new(VALUE, VALUE);
|
||||
#define rb_complex_new1(x) rb_complex_new((x), INT2FIX(0))
|
||||
#define rb_complex_new2(x,y) rb_complex_new((x), (y))
|
||||
VALUE rb_complex_polar(VALUE, VALUE);
|
||||
VALUE rb_Complex(VALUE, VALUE);
|
||||
#define rb_Complex1(x) rb_Complex((x), INT2FIX(0))
|
||||
#define rb_Complex2(x,y) rb_Complex((x), (y))
|
||||
/* class.c */
|
||||
VALUE rb_class_boot(VALUE);
|
||||
VALUE rb_class_new(VALUE);
|
||||
VALUE rb_mod_init_copy(VALUE, VALUE);
|
||||
VALUE rb_singleton_class_clone(VALUE);
|
||||
void rb_singleton_class_attached(VALUE,VALUE);
|
||||
VALUE rb_make_metaclass(VALUE, VALUE);
|
||||
void rb_check_inheritable(VALUE);
|
||||
VALUE rb_class_inherited(VALUE, VALUE);
|
||||
VALUE rb_define_class_id(ID, VALUE);
|
||||
VALUE rb_define_class_id_under(VALUE, ID, VALUE);
|
||||
VALUE rb_module_new(void);
|
||||
VALUE rb_define_module_id(ID);
|
||||
VALUE rb_define_module_id_under(VALUE, ID);
|
||||
VALUE rb_include_class_new(VALUE, VALUE);
|
||||
VALUE rb_mod_included_modules(VALUE);
|
||||
VALUE rb_mod_include_p(VALUE, VALUE);
|
||||
VALUE rb_mod_ancestors(VALUE);
|
||||
VALUE rb_class_instance_methods(int, VALUE*, VALUE);
|
||||
VALUE rb_class_public_instance_methods(int, VALUE*, VALUE);
|
||||
VALUE rb_class_protected_instance_methods(int, VALUE*, VALUE);
|
||||
VALUE rb_class_private_instance_methods(int, VALUE*, VALUE);
|
||||
VALUE rb_obj_singleton_methods(int, VALUE*, VALUE);
|
||||
void rb_define_method_id(VALUE, ID, VALUE (*)(ANYARGS), int);
|
||||
void rb_frozen_class_p(VALUE);
|
||||
void rb_undef(VALUE, ID);
|
||||
void rb_define_protected_method(VALUE, const char*, VALUE (*)(ANYARGS), int);
|
||||
void rb_define_private_method(VALUE, const char*, VALUE (*)(ANYARGS), int);
|
||||
void rb_define_singleton_method(VALUE, const char*, VALUE(*)(ANYARGS), int);
|
||||
VALUE rb_singleton_class(VALUE);
|
||||
/* compar.c */
|
||||
int rb_cmpint(VALUE, VALUE, VALUE);
|
||||
NORETURN(void rb_cmperr(VALUE, VALUE));
|
||||
/* cont.c */
|
||||
VALUE rb_fiber_new(VALUE (*)(ANYARGS), VALUE);
|
||||
VALUE rb_fiber_resume(VALUE fib, int argc, VALUE *args);
|
||||
VALUE rb_fiber_yield(int argc, VALUE *args);
|
||||
VALUE rb_fiber_current(void);
|
||||
VALUE rb_fiber_alive_p(VALUE);
|
||||
/* enum.c */
|
||||
VALUE rb_enum_values_pack(int, VALUE*);
|
||||
/* enumerator.c */
|
||||
VALUE rb_enumeratorize(VALUE, VALUE, int, VALUE *);
|
||||
VALUE rb_enumeratorize_with_size(VALUE, VALUE, int, VALUE *, VALUE (*)(ANYARGS));
|
||||
#define RETURN_SIZED_ENUMERATOR(obj, argc, argv, size_fn) do { \
|
||||
if (!rb_block_given_p()) \
|
||||
return rb_enumeratorize_with_size((obj), ID2SYM(rb_frame_this_func()),\
|
||||
(argc), (argv), (size_fn)); \
|
||||
} while (0)
|
||||
#define RETURN_ENUMERATOR(obj, argc, argv) RETURN_SIZED_ENUMERATOR(obj, argc, argv, 0)
|
||||
/* error.c */
|
||||
VALUE rb_exc_new(VALUE, const char*, long);
|
||||
VALUE rb_exc_new2(VALUE, const char*);
|
||||
VALUE rb_exc_new3(VALUE, VALUE);
|
||||
PRINTF_ARGS(NORETURN(void rb_loaderror(const char*, ...)), 1, 2);
|
||||
PRINTF_ARGS(NORETURN(void rb_loaderror_with_path(VALUE path, const char*, ...)), 2, 3);
|
||||
PRINTF_ARGS(NORETURN(void rb_name_error(ID, const char*, ...)), 2, 3);
|
||||
PRINTF_ARGS(NORETURN(void rb_name_error_str(VALUE, const char*, ...)), 2, 3);
|
||||
NORETURN(void rb_invalid_str(const char*, const char*));
|
||||
PRINTF_ARGS(void rb_compile_error(const char*, int, const char*, ...), 3, 4);
|
||||
PRINTF_ARGS(void rb_compile_error_with_enc(const char*, int, void *, const char*, ...), 4, 5);
|
||||
PRINTF_ARGS(void rb_compile_error_append(const char*, ...), 1, 2);
|
||||
NORETURN(void rb_error_frozen(const char*));
|
||||
void rb_error_untrusted(VALUE);
|
||||
void rb_check_frozen(VALUE);
|
||||
void rb_check_trusted(VALUE);
|
||||
#define rb_check_frozen_internal(obj) do { \
|
||||
VALUE frozen_obj = (obj); \
|
||||
if (OBJ_FROZEN(frozen_obj)) { \
|
||||
rb_error_frozen(rb_obj_classname(frozen_obj)); \
|
||||
} \
|
||||
} while (0)
|
||||
#define rb_check_trusted_internal(obj) do { \
|
||||
VALUE untrusted_obj = (obj); \
|
||||
if (!OBJ_UNTRUSTED(untrusted_obj)) { \
|
||||
rb_error_untrusted(untrusted_obj); \
|
||||
} \
|
||||
} while (0)
|
||||
#ifdef __GNUC__
|
||||
#define rb_check_frozen(obj) __extension__({rb_check_frozen_internal(obj);})
|
||||
#define rb_check_trusted(obj) __extension__({rb_check_trusted_internal(obj);})
|
||||
#else
|
||||
static inline void
|
||||
rb_check_frozen_inline(VALUE obj)
|
||||
{
|
||||
rb_check_frozen_internal(obj);
|
||||
}
|
||||
#define rb_check_frozen(obj) rb_check_frozen_inline(obj)
|
||||
static inline void
|
||||
rb_check_trusted_inline(VALUE obj)
|
||||
{
|
||||
rb_check_trusted_internal(obj);
|
||||
}
|
||||
#define rb_check_trusted(obj) rb_check_trusted_inline(obj)
|
||||
#endif
|
||||
void rb_check_copyable(VALUE obj, VALUE orig);
|
||||
|
||||
#define OBJ_INIT_COPY(obj, orig) \
|
||||
((obj) != (orig) && (rb_obj_init_copy((obj), (orig)), 1))
|
||||
|
||||
/* eval.c */
|
||||
int rb_sourceline(void);
|
||||
const char *rb_sourcefile(void);
|
||||
VALUE rb_check_funcall(VALUE, ID, int, VALUE*);
|
||||
|
||||
NORETURN(void rb_error_arity(int, int, int));
|
||||
#define rb_check_arity(argc, min, max) do { \
|
||||
if (((argc) < (min)) || ((argc) > (max) && (max) != UNLIMITED_ARGUMENTS)) \
|
||||
rb_error_arity(argc, min, max); \
|
||||
} while(0)
|
||||
|
||||
#if defined(NFDBITS) && defined(HAVE_RB_FD_INIT)
|
||||
typedef struct {
|
||||
int maxfd;
|
||||
fd_set *fdset;
|
||||
} rb_fdset_t;
|
||||
|
||||
void rb_fd_init(rb_fdset_t *);
|
||||
void rb_fd_term(rb_fdset_t *);
|
||||
void rb_fd_zero(rb_fdset_t *);
|
||||
void rb_fd_set(int, rb_fdset_t *);
|
||||
void rb_fd_clr(int, rb_fdset_t *);
|
||||
int rb_fd_isset(int, const rb_fdset_t *);
|
||||
void rb_fd_copy(rb_fdset_t *, const fd_set *, int);
|
||||
void rb_fd_dup(rb_fdset_t *dst, const rb_fdset_t *src);
|
||||
int rb_fd_select(int, rb_fdset_t *, rb_fdset_t *, rb_fdset_t *, struct timeval *);
|
||||
|
||||
#define rb_fd_ptr(f) ((f)->fdset)
|
||||
#define rb_fd_max(f) ((f)->maxfd)
|
||||
|
||||
#elif defined(_WIN32)
|
||||
|
||||
typedef struct {
|
||||
int capa;
|
||||
fd_set *fdset;
|
||||
} rb_fdset_t;
|
||||
|
||||
void rb_fd_init(rb_fdset_t *);
|
||||
void rb_fd_term(rb_fdset_t *);
|
||||
#define rb_fd_zero(f) ((f)->fdset->fd_count = 0)
|
||||
void rb_fd_set(int, rb_fdset_t *);
|
||||
#define rb_fd_clr(n, f) rb_w32_fdclr((n), (f)->fdset)
|
||||
#define rb_fd_isset(n, f) rb_w32_fdisset((n), (f)->fdset)
|
||||
#define rb_fd_copy(d, s, n) rb_w32_fd_copy((d), (s), (n))
|
||||
void rb_w32_fd_copy(rb_fdset_t *, const fd_set *, int);
|
||||
#define rb_fd_dup(d, s) rb_w32_fd_dup((d), (s))
|
||||
void rb_w32_fd_dup(rb_fdset_t *dst, const rb_fdset_t *src);
|
||||
#define rb_fd_select(n, rfds, wfds, efds, timeout) rb_w32_select((n), (rfds) ? ((rb_fdset_t*)(rfds))->fdset : NULL, (wfds) ? ((rb_fdset_t*)(wfds))->fdset : NULL, (efds) ? ((rb_fdset_t*)(efds))->fdset: NULL, (timeout))
|
||||
#define rb_fd_resize(n, f) ((void)(f))
|
||||
|
||||
#define rb_fd_ptr(f) ((f)->fdset)
|
||||
#define rb_fd_max(f) ((f)->fdset->fd_count)
|
||||
|
||||
#else
|
||||
|
||||
typedef fd_set rb_fdset_t;
|
||||
#define rb_fd_zero(f) FD_ZERO(f)
|
||||
#define rb_fd_set(n, f) FD_SET((n), (f))
|
||||
#define rb_fd_clr(n, f) FD_CLR((n), (f))
|
||||
#define rb_fd_isset(n, f) FD_ISSET((n), (f))
|
||||
#define rb_fd_copy(d, s, n) (*(d) = *(s))
|
||||
#define rb_fd_dup(d, s) (*(d) = *(s))
|
||||
#define rb_fd_resize(n, f) ((void)(f))
|
||||
#define rb_fd_ptr(f) (f)
|
||||
#define rb_fd_init(f) FD_ZERO(f)
|
||||
#define rb_fd_init_copy(d, s) (*(d) = *(s))
|
||||
#define rb_fd_term(f) ((void)(f))
|
||||
#define rb_fd_max(f) FD_SETSIZE
|
||||
#define rb_fd_select(n, rfds, wfds, efds, timeout) select((n), (rfds), (wfds), (efds), (timeout))
|
||||
|
||||
#endif
|
||||
|
||||
NORETURN(void rb_exc_raise(VALUE));
|
||||
NORETURN(void rb_exc_fatal(VALUE));
|
||||
VALUE rb_f_exit(int,VALUE*);
|
||||
VALUE rb_f_abort(int,VALUE*);
|
||||
void rb_remove_method(VALUE, const char*);
|
||||
void rb_remove_method_id(VALUE, ID);
|
||||
#define rb_disable_super(klass, name) ((void)0)
|
||||
#define rb_enable_super(klass, name) ((void)0)
|
||||
#define HAVE_RB_DEFINE_ALLOC_FUNC 1
|
||||
typedef VALUE (*rb_alloc_func_t)(VALUE);
|
||||
void rb_define_alloc_func(VALUE, rb_alloc_func_t);
|
||||
void rb_undef_alloc_func(VALUE);
|
||||
rb_alloc_func_t rb_get_alloc_func(VALUE);
|
||||
void rb_clear_cache(void);
|
||||
void rb_clear_cache_by_class(VALUE);
|
||||
void rb_alias(VALUE, ID, ID);
|
||||
void rb_attr(VALUE,ID,int,int,int);
|
||||
int rb_method_boundp(VALUE, ID, int);
|
||||
int rb_method_basic_definition_p(VALUE, ID);
|
||||
VALUE rb_eval_cmd(VALUE, VALUE, int);
|
||||
int rb_obj_respond_to(VALUE, ID, int);
|
||||
int rb_respond_to(VALUE, ID);
|
||||
VALUE rb_f_notimplement(int argc, VALUE *argv, VALUE obj);
|
||||
void rb_interrupt(void);
|
||||
VALUE rb_apply(VALUE, ID, VALUE);
|
||||
void rb_backtrace(void);
|
||||
ID rb_frame_this_func(void);
|
||||
VALUE rb_obj_instance_eval(int, VALUE*, VALUE);
|
||||
VALUE rb_obj_instance_exec(int, VALUE*, VALUE);
|
||||
VALUE rb_mod_module_eval(int, VALUE*, VALUE);
|
||||
VALUE rb_mod_module_exec(int, VALUE*, VALUE);
|
||||
void rb_load(VALUE, int);
|
||||
void rb_load_protect(VALUE, int, int*);
|
||||
NORETURN(void rb_jump_tag(int));
|
||||
int rb_provided(const char*);
|
||||
int rb_feature_provided(const char *, const char **);
|
||||
void rb_provide(const char*);
|
||||
VALUE rb_f_require(VALUE, VALUE);
|
||||
VALUE rb_require_safe(VALUE, int);
|
||||
void rb_obj_call_init(VALUE, int, VALUE*);
|
||||
VALUE rb_class_new_instance(int, VALUE*, VALUE);
|
||||
VALUE rb_block_proc(void);
|
||||
VALUE rb_block_lambda(void);
|
||||
VALUE rb_proc_new(VALUE (*)(ANYARGS/* VALUE yieldarg[, VALUE procarg] */), VALUE);
|
||||
VALUE rb_obj_is_proc(VALUE);
|
||||
VALUE rb_proc_call(VALUE, VALUE);
|
||||
VALUE rb_proc_call_with_block(VALUE, int argc, VALUE *argv, VALUE);
|
||||
int rb_proc_arity(VALUE);
|
||||
VALUE rb_proc_lambda_p(VALUE);
|
||||
VALUE rb_binding_new(void);
|
||||
VALUE rb_obj_method(VALUE, VALUE);
|
||||
VALUE rb_obj_is_method(VALUE);
|
||||
VALUE rb_method_call(int, VALUE*, VALUE);
|
||||
VALUE rb_method_call_with_block(int, VALUE *, VALUE, VALUE);
|
||||
int rb_mod_method_arity(VALUE, ID);
|
||||
int rb_obj_method_arity(VALUE, ID);
|
||||
VALUE rb_protect(VALUE (*)(VALUE), VALUE, int*);
|
||||
void rb_set_end_proc(void (*)(VALUE), VALUE);
|
||||
void rb_exec_end_proc(void);
|
||||
void rb_thread_schedule(void);
|
||||
void rb_thread_wait_fd(int);
|
||||
int rb_thread_fd_writable(int);
|
||||
void rb_thread_fd_close(int);
|
||||
int rb_thread_alone(void);
|
||||
DEPRECATED(void rb_thread_polling(void));
|
||||
void rb_thread_sleep(int);
|
||||
void rb_thread_sleep_forever(void);
|
||||
VALUE rb_thread_stop(void);
|
||||
VALUE rb_thread_wakeup(VALUE);
|
||||
VALUE rb_thread_wakeup_alive(VALUE);
|
||||
VALUE rb_thread_run(VALUE);
|
||||
VALUE rb_thread_kill(VALUE);
|
||||
VALUE rb_thread_create(VALUE (*)(ANYARGS), void*);
|
||||
DEPRECATED(int rb_thread_select(int, fd_set *, fd_set *, fd_set *, struct timeval *));
|
||||
int rb_thread_fd_select(int, rb_fdset_t *, rb_fdset_t *, rb_fdset_t *, struct timeval *);
|
||||
void rb_thread_wait_for(struct timeval);
|
||||
VALUE rb_thread_current(void);
|
||||
VALUE rb_thread_main(void);
|
||||
VALUE rb_thread_local_aref(VALUE, ID);
|
||||
VALUE rb_thread_local_aset(VALUE, ID, VALUE);
|
||||
void rb_thread_atfork(void);
|
||||
void rb_thread_atfork_before_exec(void);
|
||||
VALUE rb_exec_recursive(VALUE(*)(VALUE, VALUE, int),VALUE,VALUE);
|
||||
VALUE rb_exec_recursive_paired(VALUE(*)(VALUE, VALUE, int),VALUE,VALUE,VALUE);
|
||||
VALUE rb_exec_recursive_outer(VALUE(*)(VALUE, VALUE, int),VALUE,VALUE);
|
||||
/* dir.c */
|
||||
VALUE rb_dir_getwd(void);
|
||||
/* file.c */
|
||||
VALUE rb_file_s_expand_path(int, VALUE *);
|
||||
VALUE rb_file_expand_path(VALUE, VALUE);
|
||||
VALUE rb_file_s_absolute_path(int, VALUE *);
|
||||
VALUE rb_file_absolute_path(VALUE, VALUE);
|
||||
VALUE rb_file_dirname(VALUE fname);
|
||||
int rb_find_file_ext_safe(VALUE*, const char* const*, int);
|
||||
VALUE rb_find_file_safe(VALUE, int);
|
||||
int rb_find_file_ext(VALUE*, const char* const*);
|
||||
VALUE rb_find_file(VALUE);
|
||||
VALUE rb_file_directory_p(VALUE,VALUE);
|
||||
VALUE rb_str_encode_ospath(VALUE);
|
||||
int rb_is_absolute_path(const char *);
|
||||
/* gc.c */
|
||||
NORETURN(void rb_memerror(void));
|
||||
int rb_during_gc(void);
|
||||
void rb_gc_mark_locations(VALUE*, VALUE*);
|
||||
void rb_mark_tbl(struct st_table*);
|
||||
void rb_mark_set(struct st_table*);
|
||||
void rb_mark_hash(struct st_table*);
|
||||
void rb_gc_mark_maybe(VALUE);
|
||||
void rb_gc_mark(VALUE);
|
||||
void rb_gc_force_recycle(VALUE);
|
||||
void rb_gc(void);
|
||||
void rb_gc_copy_finalizer(VALUE,VALUE);
|
||||
void rb_gc_finalize_deferred(void);
|
||||
void rb_gc_call_finalizer_at_exit(void);
|
||||
VALUE rb_gc_enable(void);
|
||||
VALUE rb_gc_disable(void);
|
||||
VALUE rb_gc_start(void);
|
||||
void rb_gc_set_params(void);
|
||||
/* hash.c */
|
||||
void st_foreach_safe(struct st_table *, int (*)(ANYARGS), st_data_t);
|
||||
VALUE rb_check_hash_type(VALUE);
|
||||
void rb_hash_foreach(VALUE, int (*)(ANYARGS), VALUE);
|
||||
VALUE rb_hash(VALUE);
|
||||
VALUE rb_hash_new(void);
|
||||
VALUE rb_hash_dup(VALUE);
|
||||
VALUE rb_hash_freeze(VALUE);
|
||||
VALUE rb_hash_aref(VALUE, VALUE);
|
||||
VALUE rb_hash_lookup(VALUE, VALUE);
|
||||
VALUE rb_hash_lookup2(VALUE, VALUE, VALUE);
|
||||
VALUE rb_hash_fetch(VALUE, VALUE);
|
||||
VALUE rb_hash_aset(VALUE, VALUE, VALUE);
|
||||
VALUE rb_hash_clear(VALUE);
|
||||
VALUE rb_hash_delete_if(VALUE);
|
||||
VALUE rb_hash_delete(VALUE,VALUE);
|
||||
typedef VALUE rb_hash_update_func(VALUE newkey, VALUE oldkey, VALUE value);
|
||||
VALUE rb_hash_update_by(VALUE hash1, VALUE hash2, rb_hash_update_func *func);
|
||||
struct st_table *rb_hash_tbl(VALUE);
|
||||
int rb_path_check(const char*);
|
||||
int rb_env_path_tainted(void);
|
||||
VALUE rb_env_clear(void);
|
||||
/* io.c */
|
||||
#define rb_defout rb_stdout
|
||||
RUBY_EXTERN VALUE rb_fs;
|
||||
RUBY_EXTERN VALUE rb_output_fs;
|
||||
RUBY_EXTERN VALUE rb_rs;
|
||||
RUBY_EXTERN VALUE rb_default_rs;
|
||||
RUBY_EXTERN VALUE rb_output_rs;
|
||||
VALUE rb_io_write(VALUE, VALUE);
|
||||
VALUE rb_io_gets(VALUE);
|
||||
VALUE rb_io_getbyte(VALUE);
|
||||
VALUE rb_io_ungetc(VALUE, VALUE);
|
||||
VALUE rb_io_ungetbyte(VALUE, VALUE);
|
||||
VALUE rb_io_close(VALUE);
|
||||
VALUE rb_io_flush(VALUE);
|
||||
VALUE rb_io_eof(VALUE);
|
||||
VALUE rb_io_binmode(VALUE);
|
||||
VALUE rb_io_ascii8bit_binmode(VALUE);
|
||||
VALUE rb_io_addstr(VALUE, VALUE);
|
||||
VALUE rb_io_printf(int, VALUE*, VALUE);
|
||||
VALUE rb_io_print(int, VALUE*, VALUE);
|
||||
VALUE rb_io_puts(int, VALUE*, VALUE);
|
||||
VALUE rb_io_fdopen(int, int, const char*);
|
||||
VALUE rb_io_get_io(VALUE);
|
||||
VALUE rb_file_open(const char*, const char*);
|
||||
VALUE rb_file_open_str(VALUE, const char*);
|
||||
VALUE rb_gets(void);
|
||||
void rb_write_error(const char*);
|
||||
void rb_write_error2(const char*, long);
|
||||
void rb_close_before_exec(int lowfd, int maxhint, VALUE noclose_fds);
|
||||
int rb_pipe(int *pipes);
|
||||
int rb_reserved_fd_p(int fd);
|
||||
int rb_cloexec_open(const char *pathname, int flags, mode_t mode);
|
||||
int rb_cloexec_dup(int oldfd);
|
||||
int rb_cloexec_dup2(int oldfd, int newfd);
|
||||
int rb_cloexec_pipe(int fildes[2]);
|
||||
int rb_cloexec_fcntl_dupfd(int fd, int minfd);
|
||||
#define RB_RESERVED_FD_P(fd) rb_reserved_fd_p(fd)
|
||||
void rb_update_max_fd(int fd);
|
||||
void rb_fd_fix_cloexec(int fd);
|
||||
/* marshal.c */
|
||||
VALUE rb_marshal_dump(VALUE, VALUE);
|
||||
VALUE rb_marshal_load(VALUE);
|
||||
void rb_marshal_define_compat(VALUE newclass, VALUE oldclass, VALUE (*dumper)(VALUE), VALUE (*loader)(VALUE, VALUE));
|
||||
/* numeric.c */
|
||||
NORETURN(void rb_num_zerodiv(void));
|
||||
#define RB_NUM_COERCE_FUNCS_NEED_OPID 1
|
||||
VALUE rb_num_coerce_bin(VALUE, VALUE, ID);
|
||||
VALUE rb_num_coerce_cmp(VALUE, VALUE, ID);
|
||||
VALUE rb_num_coerce_relop(VALUE, VALUE, ID);
|
||||
VALUE rb_num_coerce_bit(VALUE, VALUE, ID);
|
||||
VALUE rb_num2fix(VALUE);
|
||||
VALUE rb_fix2str(VALUE, int);
|
||||
VALUE rb_dbl_cmp(double, double);
|
||||
/* object.c */
|
||||
int rb_eql(VALUE, VALUE);
|
||||
VALUE rb_any_to_s(VALUE);
|
||||
VALUE rb_inspect(VALUE);
|
||||
VALUE rb_obj_is_instance_of(VALUE, VALUE);
|
||||
VALUE rb_obj_is_kind_of(VALUE, VALUE);
|
||||
VALUE rb_obj_alloc(VALUE);
|
||||
VALUE rb_obj_clone(VALUE);
|
||||
VALUE rb_obj_dup(VALUE);
|
||||
VALUE rb_obj_init_copy(VALUE,VALUE);
|
||||
VALUE rb_obj_taint(VALUE);
|
||||
VALUE rb_obj_tainted(VALUE);
|
||||
VALUE rb_obj_untaint(VALUE);
|
||||
VALUE rb_obj_untrust(VALUE);
|
||||
VALUE rb_obj_untrusted(VALUE);
|
||||
VALUE rb_obj_trust(VALUE);
|
||||
VALUE rb_obj_freeze(VALUE);
|
||||
VALUE rb_obj_frozen_p(VALUE);
|
||||
VALUE rb_obj_id(VALUE);
|
||||
VALUE rb_obj_class(VALUE);
|
||||
VALUE rb_class_real(VALUE);
|
||||
VALUE rb_class_inherited_p(VALUE, VALUE);
|
||||
VALUE rb_class_superclass(VALUE);
|
||||
VALUE rb_class_get_superclass(VALUE);
|
||||
VALUE rb_convert_type(VALUE,int,const char*,const char*);
|
||||
VALUE rb_check_convert_type(VALUE,int,const char*,const char*);
|
||||
VALUE rb_check_to_integer(VALUE, const char *);
|
||||
VALUE rb_check_to_float(VALUE);
|
||||
VALUE rb_to_int(VALUE);
|
||||
VALUE rb_check_to_int(VALUE);
|
||||
VALUE rb_Integer(VALUE);
|
||||
VALUE rb_to_float(VALUE);
|
||||
VALUE rb_Float(VALUE);
|
||||
VALUE rb_String(VALUE);
|
||||
VALUE rb_Array(VALUE);
|
||||
VALUE rb_Hash(VALUE);
|
||||
double rb_cstr_to_dbl(const char*, int);
|
||||
double rb_str_to_dbl(VALUE, int);
|
||||
/* parse.y */
|
||||
RUBY_EXTERN int ruby_sourceline;
|
||||
RUBY_EXTERN char *ruby_sourcefile;
|
||||
ID rb_id_attrset(ID);
|
||||
int rb_is_const_id(ID);
|
||||
int rb_is_global_id(ID);
|
||||
int rb_is_instance_id(ID);
|
||||
int rb_is_attrset_id(ID);
|
||||
int rb_is_class_id(ID);
|
||||
int rb_is_local_id(ID);
|
||||
int rb_is_junk_id(ID);
|
||||
int rb_symname_p(const char*);
|
||||
int rb_sym_interned_p(VALUE);
|
||||
VALUE rb_backref_get(void);
|
||||
void rb_backref_set(VALUE);
|
||||
VALUE rb_lastline_get(void);
|
||||
void rb_lastline_set(VALUE);
|
||||
VALUE rb_sym_all_symbols(void);
|
||||
/* process.c */
|
||||
void rb_last_status_set(int status, rb_pid_t pid);
|
||||
VALUE rb_last_status_get(void);
|
||||
struct rb_exec_arg {
|
||||
VALUE execarg_obj;
|
||||
};
|
||||
DEPRECATED(int rb_proc_exec_n(int, VALUE*, const char*));
|
||||
int rb_proc_exec(const char*);
|
||||
DEPRECATED(VALUE rb_exec_arg_init(int argc, VALUE *argv, int accept_shell, struct rb_exec_arg *e));
|
||||
DEPRECATED(int rb_exec_arg_addopt(struct rb_exec_arg *e, VALUE key, VALUE val));
|
||||
DEPRECATED(void rb_exec_arg_fixup(struct rb_exec_arg *e));
|
||||
DEPRECATED(int rb_run_exec_options(const struct rb_exec_arg *e, struct rb_exec_arg *s));
|
||||
DEPRECATED(int rb_run_exec_options_err(const struct rb_exec_arg *e, struct rb_exec_arg *s, char*, size_t));
|
||||
DEPRECATED(int rb_exec(const struct rb_exec_arg*));
|
||||
DEPRECATED(int rb_exec_err(const struct rb_exec_arg*, char*, size_t));
|
||||
DEPRECATED(rb_pid_t rb_fork(int*, int (*)(void*), void*, VALUE));
|
||||
DEPRECATED(rb_pid_t rb_fork_err(int*, int (*)(void*, char*, size_t), void*, VALUE, char*, size_t));
|
||||
VALUE rb_f_exec(int,VALUE*);
|
||||
rb_pid_t rb_waitpid(rb_pid_t pid, int *status, int flags);
|
||||
void rb_syswait(rb_pid_t pid);
|
||||
rb_pid_t rb_spawn(int, VALUE*);
|
||||
rb_pid_t rb_spawn_err(int, VALUE*, char*, size_t);
|
||||
VALUE rb_proc_times(VALUE);
|
||||
VALUE rb_detach_process(rb_pid_t pid);
|
||||
/* range.c */
|
||||
VALUE rb_range_new(VALUE, VALUE, int);
|
||||
VALUE rb_range_beg_len(VALUE, long*, long*, long, int);
|
||||
int rb_range_values(VALUE range, VALUE *begp, VALUE *endp, int *exclp);
|
||||
/* random.c */
|
||||
unsigned int rb_genrand_int32(void);
|
||||
double rb_genrand_real(void);
|
||||
void rb_reset_random_seed(void);
|
||||
VALUE rb_random_bytes(VALUE rnd, long n);
|
||||
VALUE rb_random_int(VALUE rnd, VALUE max);
|
||||
unsigned int rb_random_int32(VALUE rnd);
|
||||
double rb_random_real(VALUE rnd);
|
||||
unsigned long rb_random_ulong_limited(VALUE rnd, unsigned long limit);
|
||||
unsigned long rb_genrand_ulong_limited(unsigned long i);
|
||||
/* re.c */
|
||||
#define rb_memcmp memcmp
|
||||
int rb_memcicmp(const void*,const void*,long);
|
||||
void rb_match_busy(VALUE);
|
||||
VALUE rb_reg_nth_defined(int, VALUE);
|
||||
VALUE rb_reg_nth_match(int, VALUE);
|
||||
int rb_reg_backref_number(VALUE match, VALUE backref);
|
||||
VALUE rb_reg_last_match(VALUE);
|
||||
VALUE rb_reg_match_pre(VALUE);
|
||||
VALUE rb_reg_match_post(VALUE);
|
||||
VALUE rb_reg_match_last(VALUE);
|
||||
#define HAVE_RB_REG_NEW_STR 1
|
||||
VALUE rb_reg_new_str(VALUE, int);
|
||||
VALUE rb_reg_new(const char *, long, int);
|
||||
VALUE rb_reg_alloc(void);
|
||||
VALUE rb_reg_init_str(VALUE re, VALUE s, int options);
|
||||
VALUE rb_reg_match(VALUE, VALUE);
|
||||
VALUE rb_reg_match2(VALUE);
|
||||
int rb_reg_options(VALUE);
|
||||
/* ruby.c */
|
||||
#define rb_argv rb_get_argv()
|
||||
RUBY_EXTERN VALUE rb_argv0;
|
||||
VALUE rb_get_argv(void);
|
||||
void *rb_load_file(const char*);
|
||||
void *rb_load_file_str(VALUE);
|
||||
/* signal.c */
|
||||
VALUE rb_f_kill(int, VALUE*);
|
||||
#ifdef POSIX_SIGNAL
|
||||
#define posix_signal ruby_posix_signal
|
||||
RETSIGTYPE (*posix_signal(int, RETSIGTYPE (*)(int)))(int);
|
||||
#endif
|
||||
void rb_trap_exit(void);
|
||||
void rb_trap_exec(void);
|
||||
const char *ruby_signal_name(int);
|
||||
void ruby_default_signal(int);
|
||||
/* sprintf.c */
|
||||
VALUE rb_f_sprintf(int, const VALUE*);
|
||||
PRINTF_ARGS(VALUE rb_sprintf(const char*, ...), 1, 2);
|
||||
VALUE rb_vsprintf(const char*, va_list);
|
||||
PRINTF_ARGS(VALUE rb_str_catf(VALUE, const char*, ...), 2, 3);
|
||||
VALUE rb_str_vcatf(VALUE, const char*, va_list);
|
||||
VALUE rb_str_format(int, const VALUE *, VALUE);
|
||||
/* string.c */
|
||||
VALUE rb_str_new(const char*, long);
|
||||
VALUE rb_str_new_cstr(const char*);
|
||||
VALUE rb_str_new2(const char*);
|
||||
VALUE rb_str_new_shared(VALUE);
|
||||
VALUE rb_str_new3(VALUE);
|
||||
VALUE rb_str_new_frozen(VALUE);
|
||||
VALUE rb_str_new4(VALUE);
|
||||
VALUE rb_str_new_with_class(VALUE, const char*, long);
|
||||
VALUE rb_str_new5(VALUE, const char*, long);
|
||||
VALUE rb_tainted_str_new_cstr(const char*);
|
||||
VALUE rb_tainted_str_new(const char*, long);
|
||||
VALUE rb_tainted_str_new2(const char*);
|
||||
VALUE rb_external_str_new(const char*, long);
|
||||
VALUE rb_external_str_new_cstr(const char*);
|
||||
VALUE rb_locale_str_new(const char*, long);
|
||||
VALUE rb_locale_str_new_cstr(const char*);
|
||||
VALUE rb_filesystem_str_new(const char*, long);
|
||||
VALUE rb_filesystem_str_new_cstr(const char*);
|
||||
VALUE rb_str_buf_new(long);
|
||||
VALUE rb_str_buf_new_cstr(const char*);
|
||||
VALUE rb_str_buf_new2(const char*);
|
||||
VALUE rb_str_tmp_new(long);
|
||||
VALUE rb_usascii_str_new(const char*, long);
|
||||
VALUE rb_usascii_str_new_cstr(const char*);
|
||||
VALUE rb_usascii_str_new2(const char*);
|
||||
void rb_str_free(VALUE);
|
||||
void rb_str_shared_replace(VALUE, VALUE);
|
||||
VALUE rb_str_buf_append(VALUE, VALUE);
|
||||
VALUE rb_str_buf_cat(VALUE, const char*, long);
|
||||
VALUE rb_str_buf_cat2(VALUE, const char*);
|
||||
VALUE rb_str_buf_cat_ascii(VALUE, const char*);
|
||||
VALUE rb_obj_as_string(VALUE);
|
||||
VALUE rb_check_string_type(VALUE);
|
||||
void rb_must_asciicompat(VALUE);
|
||||
VALUE rb_str_dup(VALUE);
|
||||
VALUE rb_str_resurrect(VALUE str);
|
||||
VALUE rb_str_locktmp(VALUE);
|
||||
VALUE rb_str_unlocktmp(VALUE);
|
||||
VALUE rb_str_dup_frozen(VALUE);
|
||||
#define rb_str_dup_frozen rb_str_new_frozen
|
||||
VALUE rb_str_plus(VALUE, VALUE);
|
||||
VALUE rb_str_times(VALUE, VALUE);
|
||||
long rb_str_sublen(VALUE, long);
|
||||
VALUE rb_str_substr(VALUE, long, long);
|
||||
VALUE rb_str_subseq(VALUE, long, long);
|
||||
void rb_str_modify(VALUE);
|
||||
void rb_str_modify_expand(VALUE, long);
|
||||
VALUE rb_str_freeze(VALUE);
|
||||
void rb_str_set_len(VALUE, long);
|
||||
VALUE rb_str_resize(VALUE, long);
|
||||
VALUE rb_str_cat(VALUE, const char*, long);
|
||||
VALUE rb_str_cat2(VALUE, const char*);
|
||||
VALUE rb_str_append(VALUE, VALUE);
|
||||
VALUE rb_str_concat(VALUE, VALUE);
|
||||
st_index_t rb_memhash(const void *ptr, long len);
|
||||
st_index_t rb_hash_start(st_index_t);
|
||||
st_index_t rb_hash_uint32(st_index_t, uint32_t);
|
||||
st_index_t rb_hash_uint(st_index_t, st_index_t);
|
||||
st_index_t rb_hash_end(st_index_t);
|
||||
#define rb_hash_uint32(h, i) st_hash_uint32((h), (i))
|
||||
#define rb_hash_uint(h, i) st_hash_uint((h), (i))
|
||||
#define rb_hash_end(h) st_hash_end(h)
|
||||
st_index_t rb_str_hash(VALUE);
|
||||
int rb_str_hash_cmp(VALUE,VALUE);
|
||||
int rb_str_comparable(VALUE, VALUE);
|
||||
int rb_str_cmp(VALUE, VALUE);
|
||||
VALUE rb_str_equal(VALUE str1, VALUE str2);
|
||||
VALUE rb_str_drop_bytes(VALUE, long);
|
||||
void rb_str_update(VALUE, long, long, VALUE);
|
||||
VALUE rb_str_replace(VALUE, VALUE);
|
||||
VALUE rb_str_inspect(VALUE);
|
||||
VALUE rb_str_dump(VALUE);
|
||||
VALUE rb_str_split(VALUE, const char*);
|
||||
void rb_str_associate(VALUE, VALUE);
|
||||
VALUE rb_str_associated(VALUE);
|
||||
void rb_str_setter(VALUE, ID, VALUE*);
|
||||
VALUE rb_str_intern(VALUE);
|
||||
VALUE rb_sym_to_s(VALUE);
|
||||
long rb_str_strlen(VALUE);
|
||||
VALUE rb_str_length(VALUE);
|
||||
long rb_str_offset(VALUE, long);
|
||||
size_t rb_str_capacity(VALUE);
|
||||
VALUE rb_str_ellipsize(VALUE, long);
|
||||
#if defined(__GNUC__) && !defined(__PCC__)
|
||||
#define rb_str_new_cstr(str) __extension__ ( \
|
||||
{ \
|
||||
(__builtin_constant_p(str)) ? \
|
||||
rb_str_new((str), (long)strlen(str)) : \
|
||||
rb_str_new_cstr(str); \
|
||||
})
|
||||
#define rb_tainted_str_new_cstr(str) __extension__ ( \
|
||||
{ \
|
||||
(__builtin_constant_p(str)) ? \
|
||||
rb_tainted_str_new((str), (long)strlen(str)) : \
|
||||
rb_tainted_str_new_cstr(str); \
|
||||
})
|
||||
#define rb_usascii_str_new_cstr(str) __extension__ ( \
|
||||
{ \
|
||||
(__builtin_constant_p(str)) ? \
|
||||
rb_usascii_str_new((str), (long)strlen(str)) : \
|
||||
rb_usascii_str_new_cstr(str); \
|
||||
})
|
||||
#define rb_external_str_new_cstr(str) __extension__ ( \
|
||||
{ \
|
||||
(__builtin_constant_p(str)) ? \
|
||||
rb_external_str_new((str), (long)strlen(str)) : \
|
||||
rb_external_str_new_cstr(str); \
|
||||
})
|
||||
#define rb_locale_str_new_cstr(str) __extension__ ( \
|
||||
{ \
|
||||
(__builtin_constant_p(str)) ? \
|
||||
rb_locale_str_new((str), (long)strlen(str)) : \
|
||||
rb_locale_str_new_cstr(str); \
|
||||
})
|
||||
#define rb_str_buf_new_cstr(str) __extension__ ( \
|
||||
{ \
|
||||
(__builtin_constant_p(str)) ? \
|
||||
rb_str_buf_cat(rb_str_buf_new((long)strlen(str)), \
|
||||
(str), (long)strlen(str)) : \
|
||||
rb_str_buf_new_cstr(str); \
|
||||
})
|
||||
#define rb_str_buf_cat2(str, ptr) __extension__ ( \
|
||||
{ \
|
||||
(__builtin_constant_p(ptr)) ? \
|
||||
rb_str_buf_cat((str), (ptr), (long)strlen(ptr)) : \
|
||||
rb_str_buf_cat2((str), (ptr)); \
|
||||
})
|
||||
#define rb_str_cat2(str, ptr) __extension__ ( \
|
||||
{ \
|
||||
(__builtin_constant_p(ptr)) ? \
|
||||
rb_str_cat((str), (ptr), (long)strlen(ptr)) : \
|
||||
rb_str_cat2((str), (ptr)); \
|
||||
})
|
||||
#define rb_exc_new2(klass, ptr) __extension__ ( \
|
||||
{ \
|
||||
(__builtin_constant_p(ptr)) ? \
|
||||
rb_exc_new((klass), (ptr), (long)strlen(ptr)) : \
|
||||
rb_exc_new2((klass), (ptr)); \
|
||||
})
|
||||
#endif
|
||||
#define rb_str_new2 rb_str_new_cstr
|
||||
#define rb_str_new3 rb_str_new_shared
|
||||
#define rb_str_new4 rb_str_new_frozen
|
||||
#define rb_str_new5 rb_str_new_with_class
|
||||
#define rb_tainted_str_new2 rb_tainted_str_new_cstr
|
||||
#define rb_str_buf_new2 rb_str_buf_new_cstr
|
||||
#define rb_usascii_str_new2 rb_usascii_str_new_cstr
|
||||
/* struct.c */
|
||||
VALUE rb_struct_new(VALUE, ...);
|
||||
VALUE rb_struct_define(const char*, ...);
|
||||
VALUE rb_struct_alloc(VALUE, VALUE);
|
||||
VALUE rb_struct_initialize(VALUE, VALUE);
|
||||
VALUE rb_struct_aref(VALUE, VALUE);
|
||||
VALUE rb_struct_aset(VALUE, VALUE, VALUE);
|
||||
VALUE rb_struct_getmember(VALUE, ID);
|
||||
DEPRECATED(VALUE rb_struct_iv_get(VALUE, const char*));
|
||||
VALUE rb_struct_s_members(VALUE);
|
||||
VALUE rb_struct_members(VALUE);
|
||||
VALUE rb_struct_alloc_noinit(VALUE);
|
||||
VALUE rb_struct_define_without_accessor(const char *, VALUE, rb_alloc_func_t, ...);
|
||||
/* thread.c */
|
||||
typedef void rb_unblock_function_t(void *);
|
||||
typedef VALUE rb_blocking_function_t(void *);
|
||||
void rb_thread_check_ints(void);
|
||||
int rb_thread_interrupted(VALUE thval);
|
||||
|
||||
/* Use rb_thread_call_without_gvl family instead. */
|
||||
DEPRECATED(VALUE rb_thread_blocking_region(rb_blocking_function_t *func, void *data1,
|
||||
rb_unblock_function_t *ubf, void *data2));
|
||||
#define RUBY_UBF_IO ((rb_unblock_function_t *)-1)
|
||||
#define RUBY_UBF_PROCESS ((rb_unblock_function_t *)-1)
|
||||
VALUE rb_mutex_new(void);
|
||||
VALUE rb_mutex_locked_p(VALUE mutex);
|
||||
VALUE rb_mutex_trylock(VALUE mutex);
|
||||
VALUE rb_mutex_lock(VALUE mutex);
|
||||
VALUE rb_mutex_unlock(VALUE mutex);
|
||||
VALUE rb_mutex_sleep(VALUE self, VALUE timeout);
|
||||
VALUE rb_mutex_synchronize(VALUE mutex, VALUE (*func)(VALUE arg), VALUE arg);
|
||||
/* time.c */
|
||||
VALUE rb_time_new(time_t, long);
|
||||
VALUE rb_time_nano_new(time_t, long);
|
||||
VALUE rb_time_num_new(VALUE, VALUE);
|
||||
struct timeval rb_time_interval(VALUE num);
|
||||
struct timeval rb_time_timeval(VALUE time);
|
||||
struct timespec rb_time_timespec(VALUE time);
|
||||
/* variable.c */
|
||||
VALUE rb_mod_name(VALUE);
|
||||
VALUE rb_class_path(VALUE);
|
||||
void rb_set_class_path(VALUE, VALUE, const char*);
|
||||
void rb_set_class_path_string(VALUE, VALUE, VALUE);
|
||||
VALUE rb_path_to_class(VALUE);
|
||||
VALUE rb_path2class(const char*);
|
||||
void rb_name_class(VALUE, ID);
|
||||
VALUE rb_class_name(VALUE);
|
||||
void rb_autoload(VALUE, ID, const char*);
|
||||
VALUE rb_autoload_load(VALUE, ID);
|
||||
VALUE rb_autoload_p(VALUE, ID);
|
||||
VALUE rb_f_trace_var(int, VALUE*);
|
||||
VALUE rb_f_untrace_var(int, VALUE*);
|
||||
VALUE rb_f_global_variables(void);
|
||||
void rb_alias_variable(ID, ID);
|
||||
struct st_table* rb_generic_ivar_table(VALUE);
|
||||
void rb_copy_generic_ivar(VALUE,VALUE);
|
||||
void rb_free_generic_ivar(VALUE);
|
||||
VALUE rb_ivar_get(VALUE, ID);
|
||||
VALUE rb_ivar_set(VALUE, ID, VALUE);
|
||||
VALUE rb_ivar_defined(VALUE, ID);
|
||||
void rb_ivar_foreach(VALUE, int (*)(ANYARGS), st_data_t);
|
||||
st_index_t rb_ivar_count(VALUE);
|
||||
VALUE rb_iv_set(VALUE, const char*, VALUE);
|
||||
VALUE rb_iv_get(VALUE, const char*);
|
||||
VALUE rb_attr_get(VALUE, ID);
|
||||
VALUE rb_obj_instance_variables(VALUE);
|
||||
VALUE rb_obj_remove_instance_variable(VALUE, VALUE);
|
||||
void *rb_mod_const_at(VALUE, void*);
|
||||
void *rb_mod_const_of(VALUE, void*);
|
||||
VALUE rb_const_list(void*);
|
||||
VALUE rb_mod_constants(int, VALUE *, VALUE);
|
||||
VALUE rb_mod_remove_const(VALUE, VALUE);
|
||||
int rb_const_defined(VALUE, ID);
|
||||
int rb_const_defined_at(VALUE, ID);
|
||||
int rb_const_defined_from(VALUE, ID);
|
||||
VALUE rb_const_get(VALUE, ID);
|
||||
VALUE rb_const_get_at(VALUE, ID);
|
||||
VALUE rb_const_get_from(VALUE, ID);
|
||||
void rb_const_set(VALUE, ID, VALUE);
|
||||
VALUE rb_const_remove(VALUE, ID);
|
||||
VALUE rb_mod_const_missing(VALUE,VALUE);
|
||||
VALUE rb_cvar_defined(VALUE, ID);
|
||||
void rb_cvar_set(VALUE, ID, VALUE);
|
||||
VALUE rb_cvar_get(VALUE, ID);
|
||||
void rb_cv_set(VALUE, const char*, VALUE);
|
||||
VALUE rb_cv_get(VALUE, const char*);
|
||||
void rb_define_class_variable(VALUE, const char*, VALUE);
|
||||
VALUE rb_mod_class_variables(int, VALUE*, VALUE);
|
||||
VALUE rb_mod_remove_cvar(VALUE, VALUE);
|
||||
|
||||
ID rb_frame_callee(void);
|
||||
VALUE rb_str_succ(VALUE);
|
||||
VALUE rb_time_succ(VALUE);
|
||||
void rb_frame_pop(void);
|
||||
int rb_frame_method_id_and_class(ID *idp, VALUE *klassp);
|
||||
VALUE rb_make_backtrace(void);
|
||||
VALUE rb_make_exception(int, VALUE*);
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility pop
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
#if 0
|
||||
{ /* satisfy cc-mode */
|
||||
#endif
|
||||
} /* extern "C" { */
|
||||
#endif
|
||||
|
||||
#endif /* RUBY_INTERN_H */
|
||||
@@ -1,213 +0,0 @@
|
||||
/**********************************************************************
|
||||
|
||||
rubyio.h -
|
||||
|
||||
$Author: nagachika $
|
||||
created at: Fri Nov 12 16:47:09 JST 1993
|
||||
|
||||
Copyright (C) 1993-2007 Yukihiro Matsumoto
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef RUBY_IO_H
|
||||
#define RUBY_IO_H 1
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#if 0
|
||||
} /* satisfy cc-mode */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include "ruby/encoding.h"
|
||||
|
||||
#if defined(HAVE_STDIO_EXT_H)
|
||||
#include <stdio_ext.h>
|
||||
#endif
|
||||
|
||||
#include "ruby/config.h"
|
||||
#if defined(HAVE_POLL)
|
||||
# ifdef _AIX
|
||||
# define reqevents events
|
||||
# define rtnevents revents
|
||||
# endif
|
||||
# include <poll.h>
|
||||
# ifdef _AIX
|
||||
# undef reqevents
|
||||
# undef rtnevents
|
||||
# undef events
|
||||
# undef revents
|
||||
# endif
|
||||
# define RB_WAITFD_IN POLLIN
|
||||
# define RB_WAITFD_PRI POLLPRI
|
||||
# define RB_WAITFD_OUT POLLOUT
|
||||
#else
|
||||
# define RB_WAITFD_IN 0x001
|
||||
# define RB_WAITFD_PRI 0x002
|
||||
# define RB_WAITFD_OUT 0x004
|
||||
#endif
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility push(default)
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
char *ptr; /* off + len <= capa */
|
||||
int off;
|
||||
int len;
|
||||
int capa;
|
||||
} rb_io_buffer_t;
|
||||
|
||||
typedef struct rb_io_t {
|
||||
int fd; /* file descriptor */
|
||||
FILE *stdio_file; /* stdio ptr for read/write if available */
|
||||
int mode; /* mode flags: FMODE_XXXs */
|
||||
rb_pid_t pid; /* child's pid (for pipes) */
|
||||
int lineno; /* number of lines read */
|
||||
VALUE pathv; /* pathname for file */
|
||||
void (*finalize)(struct rb_io_t*,int); /* finalize proc */
|
||||
|
||||
rb_io_buffer_t wbuf, rbuf;
|
||||
|
||||
VALUE tied_io_for_writing;
|
||||
|
||||
/*
|
||||
* enc enc2 read action write action
|
||||
* NULL NULL force_encoding(default_external) write the byte sequence of str
|
||||
* e1 NULL force_encoding(e1) convert str.encoding to e1
|
||||
* e1 e2 convert from e2 to e1 convert str.encoding to e2
|
||||
*/
|
||||
struct rb_io_enc_t {
|
||||
rb_encoding *enc;
|
||||
rb_encoding *enc2;
|
||||
int ecflags;
|
||||
VALUE ecopts;
|
||||
} encs;
|
||||
|
||||
rb_econv_t *readconv;
|
||||
rb_io_buffer_t cbuf;
|
||||
|
||||
rb_econv_t *writeconv;
|
||||
VALUE writeconv_asciicompat;
|
||||
int writeconv_pre_ecflags;
|
||||
VALUE writeconv_pre_ecopts;
|
||||
int writeconv_initialized;
|
||||
|
||||
VALUE write_lock;
|
||||
} rb_io_t;
|
||||
|
||||
#define HAVE_RB_IO_T 1
|
||||
|
||||
#define FMODE_READABLE 0x00000001
|
||||
#define FMODE_WRITABLE 0x00000002
|
||||
#define FMODE_READWRITE (FMODE_READABLE|FMODE_WRITABLE)
|
||||
#define FMODE_BINMODE 0x00000004
|
||||
#define FMODE_SYNC 0x00000008
|
||||
#define FMODE_TTY 0x00000010
|
||||
#define FMODE_DUPLEX 0x00000020
|
||||
#define FMODE_APPEND 0x00000040
|
||||
#define FMODE_CREATE 0x00000080
|
||||
/* #define FMODE_NOREVLOOKUP 0x00000100 */
|
||||
#define FMODE_WSPLIT 0x00000200
|
||||
#define FMODE_WSPLIT_INITIALIZED 0x00000400
|
||||
#define FMODE_TRUNC 0x00000800
|
||||
#define FMODE_TEXTMODE 0x00001000
|
||||
/* #define FMODE_PREP 0x00010000 */
|
||||
#define FMODE_SETENC_BY_BOM 0x00100000
|
||||
|
||||
#define GetOpenFile(obj,fp) rb_io_check_closed((fp) = RFILE(rb_io_taint_check(obj))->fptr)
|
||||
|
||||
#define RB_IO_BUFFER_INIT(buf) do {\
|
||||
(buf).ptr = NULL;\
|
||||
(buf).off = 0;\
|
||||
(buf).len = 0;\
|
||||
(buf).capa = 0;\
|
||||
} while (0)
|
||||
|
||||
#define MakeOpenFile(obj, fp) do {\
|
||||
if (RFILE(obj)->fptr) {\
|
||||
rb_io_close(obj);\
|
||||
rb_io_fptr_finalize(RFILE(obj)->fptr);\
|
||||
RFILE(obj)->fptr = 0;\
|
||||
}\
|
||||
(fp) = 0;\
|
||||
RB_IO_FPTR_NEW(fp);\
|
||||
RFILE(obj)->fptr = (fp);\
|
||||
} while (0)
|
||||
|
||||
#define RB_IO_FPTR_NEW(fp) do {\
|
||||
(fp) = ALLOC(rb_io_t);\
|
||||
(fp)->fd = -1;\
|
||||
(fp)->stdio_file = NULL;\
|
||||
(fp)->mode = 0;\
|
||||
(fp)->pid = 0;\
|
||||
(fp)->lineno = 0;\
|
||||
(fp)->pathv = Qnil;\
|
||||
(fp)->finalize = 0;\
|
||||
RB_IO_BUFFER_INIT((fp)->wbuf);\
|
||||
RB_IO_BUFFER_INIT((fp)->rbuf);\
|
||||
RB_IO_BUFFER_INIT((fp)->cbuf);\
|
||||
(fp)->readconv = NULL;\
|
||||
(fp)->writeconv = NULL;\
|
||||
(fp)->writeconv_asciicompat = Qnil;\
|
||||
(fp)->writeconv_pre_ecflags = 0;\
|
||||
(fp)->writeconv_pre_ecopts = Qnil;\
|
||||
(fp)->writeconv_initialized = 0;\
|
||||
(fp)->tied_io_for_writing = 0;\
|
||||
(fp)->encs.enc = NULL;\
|
||||
(fp)->encs.enc2 = NULL;\
|
||||
(fp)->encs.ecflags = 0;\
|
||||
(fp)->encs.ecopts = Qnil;\
|
||||
(fp)->write_lock = 0;\
|
||||
} while (0)
|
||||
|
||||
FILE *rb_io_stdio_file(rb_io_t *fptr);
|
||||
|
||||
FILE *rb_fdopen(int, const char*);
|
||||
int rb_io_modestr_fmode(const char *modestr);
|
||||
int rb_io_modestr_oflags(const char *modestr);
|
||||
int rb_io_oflags_fmode(int oflags);
|
||||
void rb_io_check_writable(rb_io_t*);
|
||||
void rb_io_check_readable(rb_io_t*);
|
||||
void rb_io_check_char_readable(rb_io_t *fptr);
|
||||
void rb_io_check_byte_readable(rb_io_t *fptr);
|
||||
int rb_io_fptr_finalize(rb_io_t*);
|
||||
void rb_io_synchronized(rb_io_t*);
|
||||
void rb_io_check_initialized(rb_io_t*);
|
||||
void rb_io_check_closed(rb_io_t*);
|
||||
VALUE rb_io_get_io(VALUE io);
|
||||
VALUE rb_io_check_io(VALUE io);
|
||||
VALUE rb_io_get_write_io(VALUE io);
|
||||
VALUE rb_io_set_write_io(VALUE io, VALUE w);
|
||||
int rb_io_wait_readable(int);
|
||||
int rb_io_wait_writable(int);
|
||||
int rb_wait_for_single_fd(int fd, int events, struct timeval *tv);
|
||||
void rb_io_set_nonblock(rb_io_t *fptr);
|
||||
int rb_io_extract_encoding_option(VALUE opt, rb_encoding **enc_p, rb_encoding **enc2_p, int *fmode_p);
|
||||
ssize_t rb_io_bufwrite(VALUE io, const void *buf, size_t size);
|
||||
|
||||
/* compatibility for ruby 1.8 and older */
|
||||
#define rb_io_mode_flags(modestr) rb_io_modestr_fmode(modestr)
|
||||
#define rb_io_modenum_flags(oflags) rb_io_oflags_fmode(oflags)
|
||||
|
||||
VALUE rb_io_taint_check(VALUE);
|
||||
NORETURN(void rb_eof_error(void));
|
||||
|
||||
void rb_io_read_check(rb_io_t*);
|
||||
int rb_io_read_pending(rb_io_t*);
|
||||
DEPRECATED(void rb_read_check(FILE*));
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility pop
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
#if 0
|
||||
{ /* satisfy cc-mode */
|
||||
#endif
|
||||
} /* extern "C" { */
|
||||
#endif
|
||||
|
||||
#endif /* RUBY_IO_H */
|
||||
@@ -1,243 +0,0 @@
|
||||
/************************************************
|
||||
|
||||
missing.h - prototype for *.c in ./missing, and
|
||||
for missing timeval struct
|
||||
|
||||
$Author: nagachika $
|
||||
created at: Sat May 11 23:46:03 JST 2002
|
||||
|
||||
************************************************/
|
||||
|
||||
#ifndef RUBY_MISSING_H
|
||||
#define RUBY_MISSING_H 1
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#if 0
|
||||
} /* satisfy cc-mode */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "ruby/config.h"
|
||||
#include <stddef.h>
|
||||
#include <math.h> /* for INFINITY and NAN */
|
||||
#ifdef RUBY_EXTCONF_H
|
||||
#include RUBY_EXTCONF_H
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_STRUCT_TIMEVAL) || !defined(HAVE_STRUCT_TIMESPEC)
|
||||
#if defined(HAVE_TIME_H)
|
||||
# include <time.h>
|
||||
#endif
|
||||
#if defined(HAVE_SYS_TIME_H)
|
||||
# include <sys/time.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_STRUCT_TIMEVAL)
|
||||
struct timeval {
|
||||
time_t tv_sec; /* seconds */
|
||||
long tv_usec; /* microseconds */
|
||||
};
|
||||
#endif /* HAVE_STRUCT_TIMEVAL */
|
||||
|
||||
#if !defined(HAVE_STRUCT_TIMESPEC)
|
||||
struct timespec {
|
||||
time_t tv_sec; /* seconds */
|
||||
long tv_nsec; /* nanoseconds */
|
||||
};
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_STRUCT_TIMEZONE)
|
||||
struct timezone {
|
||||
int tz_minuteswest;
|
||||
int tz_dsttime;
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef RUBY_EXPORT
|
||||
#undef RUBY_EXTERN
|
||||
#endif
|
||||
#ifndef RUBY_EXTERN
|
||||
#define RUBY_EXTERN extern
|
||||
#endif
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility push(default)
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_ACOSH
|
||||
RUBY_EXTERN double acosh(double);
|
||||
RUBY_EXTERN double asinh(double);
|
||||
RUBY_EXTERN double atanh(double);
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_CRYPT
|
||||
RUBY_EXTERN char *crypt(const char *, const char *);
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_DUP2
|
||||
RUBY_EXTERN int dup2(int, int);
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_EACCESS
|
||||
RUBY_EXTERN int eaccess(const char*, int);
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_ROUND
|
||||
RUBY_EXTERN double round(double); /* numeric.c */
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_FINITE
|
||||
RUBY_EXTERN int finite(double);
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_FLOCK
|
||||
RUBY_EXTERN int flock(int, int);
|
||||
#endif
|
||||
|
||||
/*
|
||||
#ifndef HAVE_FREXP
|
||||
RUBY_EXTERN double frexp(double, int *);
|
||||
#endif
|
||||
*/
|
||||
|
||||
#ifndef HAVE_HYPOT
|
||||
RUBY_EXTERN double hypot(double, double);
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_ERF
|
||||
RUBY_EXTERN double erf(double);
|
||||
RUBY_EXTERN double erfc(double);
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_TGAMMA
|
||||
RUBY_EXTERN double tgamma(double);
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_LGAMMA_R
|
||||
RUBY_EXTERN double lgamma_r(double, int *);
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_CBRT
|
||||
RUBY_EXTERN double cbrt(double);
|
||||
#endif
|
||||
|
||||
#if !defined(INFINITY) || !defined(NAN)
|
||||
union bytesequence4_or_float {
|
||||
unsigned char bytesequence[4];
|
||||
float float_value;
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef INFINITY
|
||||
# define HAVE_INFINITY
|
||||
#else
|
||||
/** @internal */
|
||||
RUBY_EXTERN const union bytesequence4_or_float rb_infinity;
|
||||
# define INFINITY (rb_infinity.float_value)
|
||||
#endif
|
||||
|
||||
#ifdef NAN
|
||||
# define HAVE_NAN
|
||||
#else
|
||||
/** @internal */
|
||||
RUBY_EXTERN const union bytesequence4_or_float rb_nan;
|
||||
# define NAN (rb_nan.float_value)
|
||||
#endif
|
||||
|
||||
#ifndef isinf
|
||||
# ifndef HAVE_ISINF
|
||||
# if defined(HAVE_FINITE) && defined(HAVE_ISNAN)
|
||||
# ifdef HAVE_IEEEFP_H
|
||||
# include <ieeefp.h>
|
||||
# endif
|
||||
# define isinf(x) (!finite(x) && !isnan(x))
|
||||
# else
|
||||
RUBY_EXTERN int isinf(double);
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef isnan
|
||||
# ifndef HAVE_ISNAN
|
||||
RUBY_EXTERN int isnan(double);
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
#ifndef HAVE_MEMCMP
|
||||
RUBY_EXTERN int memcmp(const void *, const void *, size_t);
|
||||
#endif
|
||||
*/
|
||||
|
||||
#ifndef HAVE_MEMMOVE
|
||||
RUBY_EXTERN void *memmove(void *, const void *, size_t);
|
||||
#endif
|
||||
|
||||
/*
|
||||
#ifndef HAVE_MODF
|
||||
RUBY_EXTERN double modf(double, double *);
|
||||
#endif
|
||||
*/
|
||||
|
||||
#ifndef HAVE_STRCHR
|
||||
RUBY_EXTERN char *strchr(const char *, int);
|
||||
RUBY_EXTERN char *strrchr(const char *, int);
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_STRERROR
|
||||
RUBY_EXTERN char *strerror(int);
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_STRSTR
|
||||
RUBY_EXTERN char *strstr(const char *, const char *);
|
||||
#endif
|
||||
|
||||
/*
|
||||
#ifndef HAVE_STRTOL
|
||||
RUBY_EXTERN long strtol(const char *, char **, int);
|
||||
#endif
|
||||
*/
|
||||
|
||||
#ifndef HAVE_STRLCPY
|
||||
RUBY_EXTERN size_t strlcpy(char *, const char*, size_t);
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_STRLCAT
|
||||
RUBY_EXTERN size_t strlcat(char *, const char*, size_t);
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_SIGNBIT
|
||||
RUBY_EXTERN int signbit(double x);
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_FFS
|
||||
RUBY_EXTERN int ffs(int);
|
||||
#endif
|
||||
|
||||
#ifdef BROKEN_CLOSE
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
RUBY_EXTERN int ruby_getpeername(int, struct sockaddr *, socklen_t *);
|
||||
RUBY_EXTERN int ruby_getsockname(int, struct sockaddr *, socklen_t *);
|
||||
RUBY_EXTERN int ruby_shutdown(int, int);
|
||||
RUBY_EXTERN int ruby_close(int);
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_SETPROCTITLE
|
||||
RUBY_EXTERN void setproctitle(const char *fmt, ...);
|
||||
#endif
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility pop
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
#if 0
|
||||
{ /* satisfy cc-mode */
|
||||
#endif
|
||||
} /* extern "C" { */
|
||||
#endif
|
||||
|
||||
#endif /* RUBY_MISSING_H */
|
||||
@@ -1,839 +0,0 @@
|
||||
#ifndef ONIGURUMA_H
|
||||
#define ONIGURUMA_H
|
||||
/**********************************************************************
|
||||
oniguruma.h - Onigmo (Oniguruma-mod) (regular expression library)
|
||||
**********************************************************************/
|
||||
/*-
|
||||
* Copyright (c) 2002-2009 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
|
||||
* Copyright (c) 2011-2013 K.Takata <kentkt AT csc DOT jp>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#if 0
|
||||
} /* satisfy cc-mode */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define ONIGURUMA
|
||||
#define ONIGURUMA_VERSION_MAJOR 5
|
||||
#define ONIGURUMA_VERSION_MINOR 13
|
||||
#define ONIGURUMA_VERSION_TEENY 4
|
||||
|
||||
#ifdef __cplusplus
|
||||
# ifndef HAVE_PROTOTYPES
|
||||
# define HAVE_PROTOTYPES 1
|
||||
# endif
|
||||
# ifndef HAVE_STDARG_PROTOTYPES
|
||||
# define HAVE_STDARG_PROTOTYPES 1
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* escape Mac OS X/Xcode 2.4/gcc 4.0.1 problem */
|
||||
#if defined(__APPLE__) && defined(__GNUC__) && __GNUC__ >= 4
|
||||
# ifndef HAVE_STDARG_PROTOTYPES
|
||||
# define HAVE_STDARG_PROTOTYPES 1
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STDARG_H
|
||||
# ifndef HAVE_STDARG_PROTOTYPES
|
||||
# define HAVE_STDARG_PROTOTYPES 1
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef P_
|
||||
#if defined(__STDC__) || defined(_WIN32)
|
||||
# define P_(args) args
|
||||
#else
|
||||
# define P_(args) ()
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef PV_
|
||||
#ifdef HAVE_STDARG_PROTOTYPES
|
||||
# define PV_(args) args
|
||||
#else
|
||||
# define PV_(args) ()
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef ONIG_EXTERN
|
||||
#ifdef RUBY_EXTERN
|
||||
#define ONIG_EXTERN RUBY_EXTERN
|
||||
#else
|
||||
#if defined(_WIN32) && !defined(__GNUC__)
|
||||
#if defined(EXPORT) || defined(RUBY_EXPORT)
|
||||
#define ONIG_EXTERN extern __declspec(dllexport)
|
||||
#else
|
||||
#define ONIG_EXTERN extern __declspec(dllimport)
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef ONIG_EXTERN
|
||||
#define ONIG_EXTERN extern
|
||||
#endif
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility push(default)
|
||||
#endif
|
||||
|
||||
#include <stddef.h> /* for size_t */
|
||||
|
||||
/* PART: character encoding */
|
||||
|
||||
#ifndef ONIG_ESCAPE_UCHAR_COLLISION
|
||||
#define UChar OnigUChar
|
||||
#endif
|
||||
|
||||
typedef unsigned char OnigUChar;
|
||||
typedef unsigned int OnigCodePoint;
|
||||
typedef unsigned int OnigCtype;
|
||||
typedef size_t OnigDistance;
|
||||
typedef ptrdiff_t OnigPosition;
|
||||
|
||||
#define ONIG_INFINITE_DISTANCE ~((OnigDistance )0)
|
||||
|
||||
typedef unsigned int OnigCaseFoldType; /* case fold flag */
|
||||
|
||||
ONIG_EXTERN OnigCaseFoldType OnigDefaultCaseFoldFlag;
|
||||
|
||||
/* #define ONIGENC_CASE_FOLD_HIRAGANA_KATAKANA (1<<1) */
|
||||
/* #define ONIGENC_CASE_FOLD_KATAKANA_WIDTH (1<<2) */
|
||||
#define ONIGENC_CASE_FOLD_TURKISH_AZERI (1<<20)
|
||||
#define INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR (1<<30)
|
||||
|
||||
#define ONIGENC_CASE_FOLD_MIN INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR
|
||||
#define ONIGENC_CASE_FOLD_DEFAULT OnigDefaultCaseFoldFlag
|
||||
|
||||
|
||||
#define ONIGENC_MAX_COMP_CASE_FOLD_CODE_LEN 3
|
||||
#define ONIGENC_GET_CASE_FOLD_CODES_MAX_NUM 13
|
||||
/* 13 => Unicode:0x1ffc */
|
||||
|
||||
/* code range */
|
||||
#define ONIGENC_CODE_RANGE_NUM(range) ((int )range[0])
|
||||
#define ONIGENC_CODE_RANGE_FROM(range,i) range[((i)*2) + 1]
|
||||
#define ONIGENC_CODE_RANGE_TO(range,i) range[((i)*2) + 2]
|
||||
|
||||
typedef struct {
|
||||
int byte_len; /* argument(original) character(s) byte length */
|
||||
int code_len; /* number of code */
|
||||
OnigCodePoint code[ONIGENC_MAX_COMP_CASE_FOLD_CODE_LEN];
|
||||
} OnigCaseFoldCodeItem;
|
||||
|
||||
typedef struct {
|
||||
OnigCodePoint esc;
|
||||
OnigCodePoint anychar;
|
||||
OnigCodePoint anytime;
|
||||
OnigCodePoint zero_or_one_time;
|
||||
OnigCodePoint one_or_more_time;
|
||||
OnigCodePoint anychar_anytime;
|
||||
} OnigMetaCharTableType;
|
||||
|
||||
typedef int (*OnigApplyAllCaseFoldFunc)(OnigCodePoint from, OnigCodePoint* to, int to_len, void* arg);
|
||||
|
||||
typedef struct OnigEncodingTypeST {
|
||||
int (*precise_mbc_enc_len)(const OnigUChar* p,const OnigUChar* e, struct OnigEncodingTypeST* enc);
|
||||
const char* name;
|
||||
int max_enc_len;
|
||||
int min_enc_len;
|
||||
int (*is_mbc_newline)(const OnigUChar* p, const OnigUChar* end, struct OnigEncodingTypeST* enc);
|
||||
OnigCodePoint (*mbc_to_code)(const OnigUChar* p, const OnigUChar* end, struct OnigEncodingTypeST* enc);
|
||||
int (*code_to_mbclen)(OnigCodePoint code, struct OnigEncodingTypeST* enc);
|
||||
int (*code_to_mbc)(OnigCodePoint code, OnigUChar *buf, struct OnigEncodingTypeST* enc);
|
||||
int (*mbc_case_fold)(OnigCaseFoldType flag, const OnigUChar** pp, const OnigUChar* end, OnigUChar* to, struct OnigEncodingTypeST* enc);
|
||||
int (*apply_all_case_fold)(OnigCaseFoldType flag, OnigApplyAllCaseFoldFunc f, void* arg, struct OnigEncodingTypeST* enc);
|
||||
int (*get_case_fold_codes_by_str)(OnigCaseFoldType flag, const OnigUChar* p, const OnigUChar* end, OnigCaseFoldCodeItem acs[], struct OnigEncodingTypeST* enc);
|
||||
int (*property_name_to_ctype)(struct OnigEncodingTypeST* enc, OnigUChar* p, OnigUChar* end);
|
||||
int (*is_code_ctype)(OnigCodePoint code, OnigCtype ctype, struct OnigEncodingTypeST* enc);
|
||||
int (*get_ctype_code_range)(OnigCtype ctype, OnigCodePoint* sb_out, const OnigCodePoint* ranges[], struct OnigEncodingTypeST* enc);
|
||||
OnigUChar* (*left_adjust_char_head)(const OnigUChar* start, const OnigUChar* p, const OnigUChar* end, struct OnigEncodingTypeST* enc);
|
||||
int (*is_allowed_reverse_match)(const OnigUChar* p, const OnigUChar* end, struct OnigEncodingTypeST* enc);
|
||||
int ruby_encoding_index;
|
||||
unsigned int flags;
|
||||
} OnigEncodingType;
|
||||
|
||||
typedef OnigEncodingType* OnigEncoding;
|
||||
|
||||
ONIG_EXTERN OnigEncodingType OnigEncodingASCII;
|
||||
|
||||
#define ONIG_ENCODING_ASCII (&OnigEncodingASCII)
|
||||
|
||||
#define ONIG_ENCODING_UNDEF ((OnigEncoding )0)
|
||||
|
||||
|
||||
/* work size */
|
||||
#define ONIGENC_CODE_TO_MBC_MAXLEN 7
|
||||
#define ONIGENC_MBC_CASE_FOLD_MAXLEN 18
|
||||
/* 18: 6(max-byte) * 3(case-fold chars) */
|
||||
|
||||
/* character types */
|
||||
#define ONIGENC_CTYPE_NEWLINE 0
|
||||
#define ONIGENC_CTYPE_ALPHA 1
|
||||
#define ONIGENC_CTYPE_BLANK 2
|
||||
#define ONIGENC_CTYPE_CNTRL 3
|
||||
#define ONIGENC_CTYPE_DIGIT 4
|
||||
#define ONIGENC_CTYPE_GRAPH 5
|
||||
#define ONIGENC_CTYPE_LOWER 6
|
||||
#define ONIGENC_CTYPE_PRINT 7
|
||||
#define ONIGENC_CTYPE_PUNCT 8
|
||||
#define ONIGENC_CTYPE_SPACE 9
|
||||
#define ONIGENC_CTYPE_UPPER 10
|
||||
#define ONIGENC_CTYPE_XDIGIT 11
|
||||
#define ONIGENC_CTYPE_WORD 12
|
||||
#define ONIGENC_CTYPE_ALNUM 13 /* alpha || digit */
|
||||
#define ONIGENC_CTYPE_ASCII 14
|
||||
#define ONIGENC_MAX_STD_CTYPE ONIGENC_CTYPE_ASCII
|
||||
|
||||
/* flags */
|
||||
#define ONIGENC_FLAG_NONE 0U
|
||||
#define ONIGENC_FLAG_UNICODE 1U
|
||||
|
||||
#define onig_enc_len(enc,p,e) ONIGENC_MBC_ENC_LEN(enc, p, e)
|
||||
|
||||
#define ONIGENC_IS_UNDEF(enc) ((enc) == ONIG_ENCODING_UNDEF)
|
||||
#define ONIGENC_IS_SINGLEBYTE(enc) (ONIGENC_MBC_MAXLEN(enc) == 1)
|
||||
#define ONIGENC_IS_MBC_HEAD(enc,p,e) (ONIGENC_MBC_ENC_LEN(enc,p,e) != 1)
|
||||
#define ONIGENC_IS_MBC_ASCII(p) (*(p) < 128)
|
||||
#define ONIGENC_IS_CODE_ASCII(code) ((code) < 128)
|
||||
#define ONIGENC_IS_MBC_WORD(enc,s,end) \
|
||||
ONIGENC_IS_CODE_WORD(enc,ONIGENC_MBC_TO_CODE(enc,s,end))
|
||||
#define ONIGENC_IS_MBC_ASCII_WORD(enc,s,end) \
|
||||
onigenc_ascii_is_code_ctype( \
|
||||
ONIGENC_MBC_TO_CODE(enc,s,end),ONIGENC_CTYPE_WORD,enc)
|
||||
#define ONIGENC_IS_UNICODE(enc) ((enc)->flags & ONIGENC_FLAG_UNICODE)
|
||||
|
||||
|
||||
#define ONIGENC_NAME(enc) ((enc)->name)
|
||||
|
||||
#define ONIGENC_MBC_CASE_FOLD(enc,flag,pp,end,buf) \
|
||||
(enc)->mbc_case_fold(flag,(const OnigUChar** )pp,end,buf,enc)
|
||||
#define ONIGENC_IS_ALLOWED_REVERSE_MATCH(enc,s,end) \
|
||||
(enc)->is_allowed_reverse_match(s,end,enc)
|
||||
#define ONIGENC_LEFT_ADJUST_CHAR_HEAD(enc,start,s,end) \
|
||||
(enc)->left_adjust_char_head(start, s, end, enc)
|
||||
#define ONIGENC_APPLY_ALL_CASE_FOLD(enc,case_fold_flag,f,arg) \
|
||||
(enc)->apply_all_case_fold(case_fold_flag,f,arg,enc)
|
||||
#define ONIGENC_GET_CASE_FOLD_CODES_BY_STR(enc,case_fold_flag,p,end,acs) \
|
||||
(enc)->get_case_fold_codes_by_str(case_fold_flag,p,end,acs,enc)
|
||||
#define ONIGENC_STEP_BACK(enc,start,s,end,n) \
|
||||
onigenc_step_back((enc),(start),(s),(end),(n))
|
||||
|
||||
#define ONIGENC_CONSTRUCT_MBCLEN_CHARFOUND(n) (n)
|
||||
#define ONIGENC_MBCLEN_CHARFOUND_P(r) (0 < (r))
|
||||
#define ONIGENC_MBCLEN_CHARFOUND_LEN(r) (r)
|
||||
|
||||
#define ONIGENC_CONSTRUCT_MBCLEN_INVALID() (-1)
|
||||
#define ONIGENC_MBCLEN_INVALID_P(r) ((r) == -1)
|
||||
|
||||
#define ONIGENC_CONSTRUCT_MBCLEN_NEEDMORE(n) (-1-(n))
|
||||
#define ONIGENC_MBCLEN_NEEDMORE_P(r) ((r) < -1)
|
||||
#define ONIGENC_MBCLEN_NEEDMORE_LEN(r) (-1-(r))
|
||||
|
||||
#define ONIGENC_PRECISE_MBC_ENC_LEN(enc,p,e) (enc)->precise_mbc_enc_len(p,e,enc)
|
||||
|
||||
ONIG_EXTERN
|
||||
int onigenc_mbclen_approximate P_((const OnigUChar* p,const OnigUChar* e, struct OnigEncodingTypeST* enc));
|
||||
|
||||
#define ONIGENC_MBC_ENC_LEN(enc,p,e) onigenc_mbclen_approximate(p,e,enc)
|
||||
#define ONIGENC_MBC_MAXLEN(enc) ((enc)->max_enc_len)
|
||||
#define ONIGENC_MBC_MAXLEN_DIST(enc) ONIGENC_MBC_MAXLEN(enc)
|
||||
#define ONIGENC_MBC_MINLEN(enc) ((enc)->min_enc_len)
|
||||
#define ONIGENC_IS_MBC_NEWLINE(enc,p,end) (enc)->is_mbc_newline((p),(end),enc)
|
||||
#define ONIGENC_MBC_TO_CODE(enc,p,end) (enc)->mbc_to_code((p),(end),enc)
|
||||
#define ONIGENC_CODE_TO_MBCLEN(enc,code) (enc)->code_to_mbclen(code,enc)
|
||||
#define ONIGENC_CODE_TO_MBC(enc,code,buf) (enc)->code_to_mbc(code,buf,enc)
|
||||
#define ONIGENC_PROPERTY_NAME_TO_CTYPE(enc,p,end) \
|
||||
(enc)->property_name_to_ctype(enc,p,end)
|
||||
|
||||
#define ONIGENC_IS_CODE_CTYPE(enc,code,ctype) (enc)->is_code_ctype(code,ctype,enc)
|
||||
|
||||
#define ONIGENC_IS_CODE_NEWLINE(enc,code) \
|
||||
ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_NEWLINE)
|
||||
#define ONIGENC_IS_CODE_GRAPH(enc,code) \
|
||||
ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_GRAPH)
|
||||
#define ONIGENC_IS_CODE_PRINT(enc,code) \
|
||||
ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_PRINT)
|
||||
#define ONIGENC_IS_CODE_ALNUM(enc,code) \
|
||||
ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_ALNUM)
|
||||
#define ONIGENC_IS_CODE_ALPHA(enc,code) \
|
||||
ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_ALPHA)
|
||||
#define ONIGENC_IS_CODE_LOWER(enc,code) \
|
||||
ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_LOWER)
|
||||
#define ONIGENC_IS_CODE_UPPER(enc,code) \
|
||||
ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_UPPER)
|
||||
#define ONIGENC_IS_CODE_CNTRL(enc,code) \
|
||||
ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_CNTRL)
|
||||
#define ONIGENC_IS_CODE_PUNCT(enc,code) \
|
||||
ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_PUNCT)
|
||||
#define ONIGENC_IS_CODE_SPACE(enc,code) \
|
||||
ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_SPACE)
|
||||
#define ONIGENC_IS_CODE_BLANK(enc,code) \
|
||||
ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_BLANK)
|
||||
#define ONIGENC_IS_CODE_DIGIT(enc,code) \
|
||||
ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_DIGIT)
|
||||
#define ONIGENC_IS_CODE_XDIGIT(enc,code) \
|
||||
ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_XDIGIT)
|
||||
#define ONIGENC_IS_CODE_WORD(enc,code) \
|
||||
ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_WORD)
|
||||
|
||||
#define ONIGENC_GET_CTYPE_CODE_RANGE(enc,ctype,sbout,ranges) \
|
||||
(enc)->get_ctype_code_range(ctype,sbout,ranges,enc)
|
||||
|
||||
ONIG_EXTERN
|
||||
OnigUChar* onigenc_step_back P_((OnigEncoding enc, const OnigUChar* start, const OnigUChar* s, const OnigUChar* end, int n));
|
||||
|
||||
|
||||
/* encoding API */
|
||||
ONIG_EXTERN
|
||||
int onigenc_init P_((void));
|
||||
ONIG_EXTERN
|
||||
int onigenc_set_default_encoding P_((OnigEncoding enc));
|
||||
ONIG_EXTERN
|
||||
OnigEncoding onigenc_get_default_encoding P_((void));
|
||||
ONIG_EXTERN
|
||||
void onigenc_set_default_caseconv_table P_((const OnigUChar* table));
|
||||
ONIG_EXTERN
|
||||
OnigUChar* onigenc_get_right_adjust_char_head_with_prev P_((OnigEncoding enc, const OnigUChar* start, const OnigUChar* s, const OnigUChar* end, const OnigUChar** prev));
|
||||
ONIG_EXTERN
|
||||
OnigUChar* onigenc_get_prev_char_head P_((OnigEncoding enc, const OnigUChar* start, const OnigUChar* s, const OnigUChar* end));
|
||||
ONIG_EXTERN
|
||||
OnigUChar* onigenc_get_left_adjust_char_head P_((OnigEncoding enc, const OnigUChar* start, const OnigUChar* s, const OnigUChar* end));
|
||||
ONIG_EXTERN
|
||||
OnigUChar* onigenc_get_right_adjust_char_head P_((OnigEncoding enc, const OnigUChar* start, const OnigUChar* s, const OnigUChar* end));
|
||||
ONIG_EXTERN
|
||||
int onigenc_strlen P_((OnigEncoding enc, const OnigUChar* p, const OnigUChar* end));
|
||||
ONIG_EXTERN
|
||||
int onigenc_strlen_null P_((OnigEncoding enc, const OnigUChar* p));
|
||||
ONIG_EXTERN
|
||||
int onigenc_str_bytelen_null P_((OnigEncoding enc, const OnigUChar* p));
|
||||
|
||||
|
||||
|
||||
/* PART: regular expression */
|
||||
|
||||
/* config parameters */
|
||||
#define ONIG_NREGION 10
|
||||
#define ONIG_MAX_BACKREF_NUM 1000
|
||||
#define ONIG_MAX_REPEAT_NUM 100000
|
||||
#define ONIG_MAX_MULTI_BYTE_RANGES_NUM 10000
|
||||
/* constants */
|
||||
#define ONIG_MAX_ERROR_MESSAGE_LEN 90
|
||||
|
||||
typedef unsigned int OnigOptionType;
|
||||
|
||||
#define ONIG_OPTION_DEFAULT ONIG_OPTION_NONE
|
||||
|
||||
/* options */
|
||||
#define ONIG_OPTION_NONE 0U
|
||||
#define ONIG_OPTION_IGNORECASE 1U
|
||||
#define ONIG_OPTION_EXTEND (ONIG_OPTION_IGNORECASE << 1)
|
||||
#define ONIG_OPTION_MULTILINE (ONIG_OPTION_EXTEND << 1)
|
||||
#define ONIG_OPTION_DOTALL ONIG_OPTION_MULTILINE
|
||||
#define ONIG_OPTION_SINGLELINE (ONIG_OPTION_MULTILINE << 1)
|
||||
#define ONIG_OPTION_FIND_LONGEST (ONIG_OPTION_SINGLELINE << 1)
|
||||
#define ONIG_OPTION_FIND_NOT_EMPTY (ONIG_OPTION_FIND_LONGEST << 1)
|
||||
#define ONIG_OPTION_NEGATE_SINGLELINE (ONIG_OPTION_FIND_NOT_EMPTY << 1)
|
||||
#define ONIG_OPTION_DONT_CAPTURE_GROUP (ONIG_OPTION_NEGATE_SINGLELINE << 1)
|
||||
#define ONIG_OPTION_CAPTURE_GROUP (ONIG_OPTION_DONT_CAPTURE_GROUP << 1)
|
||||
/* options (search time) */
|
||||
#define ONIG_OPTION_NOTBOL (ONIG_OPTION_CAPTURE_GROUP << 1)
|
||||
#define ONIG_OPTION_NOTEOL (ONIG_OPTION_NOTBOL << 1)
|
||||
#define ONIG_OPTION_POSIX_REGION (ONIG_OPTION_NOTEOL << 1)
|
||||
/* options (ctype range) */
|
||||
#define ONIG_OPTION_ASCII_RANGE (ONIG_OPTION_POSIX_REGION << 1)
|
||||
#define ONIG_OPTION_POSIX_BRACKET_ALL_RANGE (ONIG_OPTION_ASCII_RANGE << 1)
|
||||
#define ONIG_OPTION_WORD_BOUND_ALL_RANGE (ONIG_OPTION_POSIX_BRACKET_ALL_RANGE << 1)
|
||||
/* options (newline) */
|
||||
#define ONIG_OPTION_NEWLINE_CRLF (ONIG_OPTION_WORD_BOUND_ALL_RANGE << 1)
|
||||
#define ONIG_OPTION_MAXBIT ONIG_OPTION_NEWLINE_CRLF /* limit */
|
||||
|
||||
#define ONIG_OPTION_ON(options,regopt) ((options) |= (regopt))
|
||||
#define ONIG_OPTION_OFF(options,regopt) ((options) &= ~(regopt))
|
||||
#define ONIG_IS_OPTION_ON(options,option) ((options) & (option))
|
||||
|
||||
/* syntax */
|
||||
typedef struct {
|
||||
unsigned int op;
|
||||
unsigned int op2;
|
||||
unsigned int behavior;
|
||||
OnigOptionType options; /* default option */
|
||||
OnigMetaCharTableType meta_char_table;
|
||||
} OnigSyntaxType;
|
||||
|
||||
ONIG_EXTERN const OnigSyntaxType OnigSyntaxASIS;
|
||||
ONIG_EXTERN const OnigSyntaxType OnigSyntaxPosixBasic;
|
||||
ONIG_EXTERN const OnigSyntaxType OnigSyntaxPosixExtended;
|
||||
ONIG_EXTERN const OnigSyntaxType OnigSyntaxEmacs;
|
||||
ONIG_EXTERN const OnigSyntaxType OnigSyntaxGrep;
|
||||
ONIG_EXTERN const OnigSyntaxType OnigSyntaxGnuRegex;
|
||||
ONIG_EXTERN const OnigSyntaxType OnigSyntaxJava;
|
||||
ONIG_EXTERN const OnigSyntaxType OnigSyntaxPerl58;
|
||||
ONIG_EXTERN const OnigSyntaxType OnigSyntaxPerl58_NG;
|
||||
ONIG_EXTERN const OnigSyntaxType OnigSyntaxPerl;
|
||||
ONIG_EXTERN const OnigSyntaxType OnigSyntaxRuby;
|
||||
ONIG_EXTERN const OnigSyntaxType OnigSyntaxPython;
|
||||
|
||||
/* predefined syntaxes (see regsyntax.c) */
|
||||
#define ONIG_SYNTAX_ASIS (&OnigSyntaxASIS)
|
||||
#define ONIG_SYNTAX_POSIX_BASIC (&OnigSyntaxPosixBasic)
|
||||
#define ONIG_SYNTAX_POSIX_EXTENDED (&OnigSyntaxPosixExtended)
|
||||
#define ONIG_SYNTAX_EMACS (&OnigSyntaxEmacs)
|
||||
#define ONIG_SYNTAX_GREP (&OnigSyntaxGrep)
|
||||
#define ONIG_SYNTAX_GNU_REGEX (&OnigSyntaxGnuRegex)
|
||||
#define ONIG_SYNTAX_JAVA (&OnigSyntaxJava)
|
||||
#define ONIG_SYNTAX_PERL58 (&OnigSyntaxPerl58)
|
||||
#define ONIG_SYNTAX_PERL58_NG (&OnigSyntaxPerl58_NG)
|
||||
#define ONIG_SYNTAX_PERL (&OnigSyntaxPerl)
|
||||
#define ONIG_SYNTAX_RUBY (&OnigSyntaxRuby)
|
||||
#define ONIG_SYNTAX_PYTHON (&OnigSyntaxPython)
|
||||
|
||||
/* default syntax */
|
||||
ONIG_EXTERN const OnigSyntaxType* OnigDefaultSyntax;
|
||||
#define ONIG_SYNTAX_DEFAULT OnigDefaultSyntax
|
||||
|
||||
/* syntax (operators) */
|
||||
#define ONIG_SYN_OP_VARIABLE_META_CHARACTERS (1U<<0)
|
||||
#define ONIG_SYN_OP_DOT_ANYCHAR (1U<<1) /* . */
|
||||
#define ONIG_SYN_OP_ASTERISK_ZERO_INF (1U<<2) /* * */
|
||||
#define ONIG_SYN_OP_ESC_ASTERISK_ZERO_INF (1U<<3)
|
||||
#define ONIG_SYN_OP_PLUS_ONE_INF (1U<<4) /* + */
|
||||
#define ONIG_SYN_OP_ESC_PLUS_ONE_INF (1U<<5)
|
||||
#define ONIG_SYN_OP_QMARK_ZERO_ONE (1U<<6) /* ? */
|
||||
#define ONIG_SYN_OP_ESC_QMARK_ZERO_ONE (1U<<7)
|
||||
#define ONIG_SYN_OP_BRACE_INTERVAL (1U<<8) /* {lower,upper} */
|
||||
#define ONIG_SYN_OP_ESC_BRACE_INTERVAL (1U<<9) /* \{lower,upper\} */
|
||||
#define ONIG_SYN_OP_VBAR_ALT (1U<<10) /* | */
|
||||
#define ONIG_SYN_OP_ESC_VBAR_ALT (1U<<11) /* \| */
|
||||
#define ONIG_SYN_OP_LPAREN_SUBEXP (1U<<12) /* (...) */
|
||||
#define ONIG_SYN_OP_ESC_LPAREN_SUBEXP (1U<<13) /* \(...\) */
|
||||
#define ONIG_SYN_OP_ESC_AZ_BUF_ANCHOR (1U<<14) /* \A, \Z, \z */
|
||||
#define ONIG_SYN_OP_ESC_CAPITAL_G_BEGIN_ANCHOR (1U<<15) /* \G */
|
||||
#define ONIG_SYN_OP_DECIMAL_BACKREF (1U<<16) /* \num */
|
||||
#define ONIG_SYN_OP_BRACKET_CC (1U<<17) /* [...] */
|
||||
#define ONIG_SYN_OP_ESC_W_WORD (1U<<18) /* \w, \W */
|
||||
#define ONIG_SYN_OP_ESC_LTGT_WORD_BEGIN_END (1U<<19) /* \<. \> */
|
||||
#define ONIG_SYN_OP_ESC_B_WORD_BOUND (1U<<20) /* \b, \B */
|
||||
#define ONIG_SYN_OP_ESC_S_WHITE_SPACE (1U<<21) /* \s, \S */
|
||||
#define ONIG_SYN_OP_ESC_D_DIGIT (1U<<22) /* \d, \D */
|
||||
#define ONIG_SYN_OP_LINE_ANCHOR (1U<<23) /* ^, $ */
|
||||
#define ONIG_SYN_OP_POSIX_BRACKET (1U<<24) /* [:xxxx:] */
|
||||
#define ONIG_SYN_OP_QMARK_NON_GREEDY (1U<<25) /* ??,*?,+?,{n,m}? */
|
||||
#define ONIG_SYN_OP_ESC_CONTROL_CHARS (1U<<26) /* \n,\r,\t,\a ... */
|
||||
#define ONIG_SYN_OP_ESC_C_CONTROL (1U<<27) /* \cx */
|
||||
#define ONIG_SYN_OP_ESC_OCTAL3 (1U<<28) /* \OOO */
|
||||
#define ONIG_SYN_OP_ESC_X_HEX2 (1U<<29) /* \xHH */
|
||||
#define ONIG_SYN_OP_ESC_X_BRACE_HEX8 (1U<<30) /* \x{7HHHHHHH} */
|
||||
#define ONIG_SYN_OP_ESC_O_BRACE_OCTAL (1U<<31) /* \o{OOO} */ /* NOTIMPL */
|
||||
|
||||
#define ONIG_SYN_OP2_ESC_CAPITAL_Q_QUOTE (1U<<0) /* \Q...\E */
|
||||
#define ONIG_SYN_OP2_QMARK_GROUP_EFFECT (1U<<1) /* (?...) */
|
||||
#define ONIG_SYN_OP2_OPTION_PERL (1U<<2) /* (?imsxadlu), (?-imsx), (?^imsxalu) */
|
||||
#define ONIG_SYN_OP2_OPTION_RUBY (1U<<3) /* (?imxadu), (?-imx) */
|
||||
#define ONIG_SYN_OP2_PLUS_POSSESSIVE_REPEAT (1U<<4) /* ?+,*+,++ */
|
||||
#define ONIG_SYN_OP2_PLUS_POSSESSIVE_INTERVAL (1U<<5) /* {n,m}+ */
|
||||
#define ONIG_SYN_OP2_CCLASS_SET_OP (1U<<6) /* [...&&..[..]..] */
|
||||
#define ONIG_SYN_OP2_QMARK_LT_NAMED_GROUP (1U<<7) /* (?<name>...) */
|
||||
#define ONIG_SYN_OP2_ESC_K_NAMED_BACKREF (1U<<8) /* \k<name> */
|
||||
#define ONIG_SYN_OP2_ESC_G_SUBEXP_CALL (1U<<9) /* \g<name>, \g<n> */
|
||||
#define ONIG_SYN_OP2_ATMARK_CAPTURE_HISTORY (1U<<10) /* (?@..),(?@<x>..) */
|
||||
#define ONIG_SYN_OP2_ESC_CAPITAL_C_BAR_CONTROL (1U<<11) /* \C-x */
|
||||
#define ONIG_SYN_OP2_ESC_CAPITAL_M_BAR_META (1U<<12) /* \M-x */
|
||||
#define ONIG_SYN_OP2_ESC_V_VTAB (1U<<13) /* \v as VTAB */
|
||||
#define ONIG_SYN_OP2_ESC_U_HEX4 (1U<<14) /* \uHHHH */
|
||||
#define ONIG_SYN_OP2_ESC_GNU_BUF_ANCHOR (1U<<15) /* \`, \' */
|
||||
#define ONIG_SYN_OP2_ESC_P_BRACE_CHAR_PROPERTY (1U<<16) /* \p{...}, \P{...} */
|
||||
#define ONIG_SYN_OP2_ESC_P_BRACE_CIRCUMFLEX_NOT (1U<<17) /* \p{^..}, \P{^..} */
|
||||
/* #define ONIG_SYN_OP2_CHAR_PROPERTY_PREFIX_IS (1U<<18) */
|
||||
#define ONIG_SYN_OP2_ESC_H_XDIGIT (1U<<19) /* \h, \H */
|
||||
#define ONIG_SYN_OP2_INEFFECTIVE_ESCAPE (1U<<20) /* \ */
|
||||
#define ONIG_SYN_OP2_ESC_CAPITAL_R_LINEBREAK (1U<<21) /* \R as (?>\x0D\x0A|[\x0A-\x0D\x{85}\x{2028}\x{2029}]) */
|
||||
#define ONIG_SYN_OP2_ESC_CAPITAL_X_EXTENDED_GRAPHEME_CLUSTER (1U<<22) /* \X as (?>\P{M}\p{M}*) */
|
||||
#define ONIG_SYN_OP2_ESC_V_VERTICAL_WHITESPACE (1U<<23) /* \v, \V -- Perl */ /* NOTIMPL */
|
||||
#define ONIG_SYN_OP2_ESC_H_HORIZONTAL_WHITESPACE (1U<<24) /* \h, \H -- Perl */ /* NOTIMPL */
|
||||
#define ONIG_SYN_OP2_ESC_CAPITAL_K_KEEP (1U<<25) /* \K */
|
||||
#define ONIG_SYN_OP2_ESC_G_BRACE_BACKREF (1U<<26) /* \g{name}, \g{n} */
|
||||
#define ONIG_SYN_OP2_QMARK_SUBEXP_CALL (1U<<27) /* (?&name), (?n), (?R), (?0) */
|
||||
#define ONIG_SYN_OP2_QMARK_VBAR_BRANCH_RESET (1U<<28) /* (?|...) */ /* NOTIMPL */
|
||||
#define ONIG_SYN_OP2_QMARK_LPAREN_CONDITION (1U<<29) /* (?(cond)yes...|no...) */
|
||||
#define ONIG_SYN_OP2_QMARK_CAPITAL_P_NAMED_GROUP (1U<<30) /* (?P<name>...), (?P=name), (?P>name) -- Python/PCRE */
|
||||
#define ONIG_SYN_OP2_OPTION_JAVA (1U<<31) /* (?idmsux), (?-idmsux) */ /* NOTIMPL */
|
||||
|
||||
/* syntax (behavior) */
|
||||
#define ONIG_SYN_CONTEXT_INDEP_ANCHORS (1U<<31) /* not implemented */
|
||||
#define ONIG_SYN_CONTEXT_INDEP_REPEAT_OPS (1U<<0) /* ?, *, +, {n,m} */
|
||||
#define ONIG_SYN_CONTEXT_INVALID_REPEAT_OPS (1U<<1) /* error or ignore */
|
||||
#define ONIG_SYN_ALLOW_UNMATCHED_CLOSE_SUBEXP (1U<<2) /* ...)... */
|
||||
#define ONIG_SYN_ALLOW_INVALID_INTERVAL (1U<<3) /* {??? */
|
||||
#define ONIG_SYN_ALLOW_INTERVAL_LOW_ABBREV (1U<<4) /* {,n} => {0,n} */
|
||||
#define ONIG_SYN_STRICT_CHECK_BACKREF (1U<<5) /* /(\1)/,/\1()/ ..*/
|
||||
#define ONIG_SYN_DIFFERENT_LEN_ALT_LOOK_BEHIND (1U<<6) /* (?<=a|bc) */
|
||||
#define ONIG_SYN_CAPTURE_ONLY_NAMED_GROUP (1U<<7) /* see doc/RE */
|
||||
#define ONIG_SYN_ALLOW_MULTIPLEX_DEFINITION_NAME (1U<<8) /* (?<x>)(?<x>) */
|
||||
#define ONIG_SYN_FIXED_INTERVAL_IS_GREEDY_ONLY (1U<<9) /* a{n}?=(?:a{n})? */
|
||||
#define ONIG_SYN_ALLOW_MULTIPLEX_DEFINITION_NAME_CALL (1U<<10) /* (?<x>)(?<x>)(?&x) */
|
||||
|
||||
/* syntax (behavior) in char class [...] */
|
||||
#define ONIG_SYN_NOT_NEWLINE_IN_NEGATIVE_CC (1U<<20) /* [^...] */
|
||||
#define ONIG_SYN_BACKSLASH_ESCAPE_IN_CC (1U<<21) /* [..\w..] etc.. */
|
||||
#define ONIG_SYN_ALLOW_EMPTY_RANGE_IN_CC (1U<<22)
|
||||
#define ONIG_SYN_ALLOW_DOUBLE_RANGE_OP_IN_CC (1U<<23) /* [0-9-a]=[0-9\-a] */
|
||||
/* syntax (behavior) warning */
|
||||
#define ONIG_SYN_WARN_CC_OP_NOT_ESCAPED (1U<<24) /* [,-,] */
|
||||
#define ONIG_SYN_WARN_REDUNDANT_NESTED_REPEAT (1U<<25) /* (?:a*)+ */
|
||||
#define ONIG_SYN_WARN_CC_DUP (1U<<26) /* [aa] */
|
||||
|
||||
/* meta character specifiers (onig_set_meta_char()) */
|
||||
#define ONIG_META_CHAR_ESCAPE 0
|
||||
#define ONIG_META_CHAR_ANYCHAR 1
|
||||
#define ONIG_META_CHAR_ANYTIME 2
|
||||
#define ONIG_META_CHAR_ZERO_OR_ONE_TIME 3
|
||||
#define ONIG_META_CHAR_ONE_OR_MORE_TIME 4
|
||||
#define ONIG_META_CHAR_ANYCHAR_ANYTIME 5
|
||||
|
||||
#define ONIG_INEFFECTIVE_META_CHAR 0
|
||||
|
||||
/* error codes */
|
||||
#define ONIG_IS_PATTERN_ERROR(ecode) ((ecode) <= -100 && (ecode) > -1000)
|
||||
/* normal return */
|
||||
#define ONIG_NORMAL 0
|
||||
#define ONIG_MISMATCH -1
|
||||
#define ONIG_NO_SUPPORT_CONFIG -2
|
||||
|
||||
/* internal error */
|
||||
#define ONIGERR_MEMORY -5
|
||||
#define ONIGERR_TYPE_BUG -6
|
||||
#define ONIGERR_PARSER_BUG -11
|
||||
#define ONIGERR_STACK_BUG -12
|
||||
#define ONIGERR_UNDEFINED_BYTECODE -13
|
||||
#define ONIGERR_UNEXPECTED_BYTECODE -14
|
||||
#define ONIGERR_MATCH_STACK_LIMIT_OVER -15
|
||||
#define ONIGERR_DEFAULT_ENCODING_IS_NOT_SET -21
|
||||
#define ONIGERR_SPECIFIED_ENCODING_CANT_CONVERT_TO_WIDE_CHAR -22
|
||||
/* general error */
|
||||
#define ONIGERR_INVALID_ARGUMENT -30
|
||||
/* syntax error */
|
||||
#define ONIGERR_END_PATTERN_AT_LEFT_BRACE -100
|
||||
#define ONIGERR_END_PATTERN_AT_LEFT_BRACKET -101
|
||||
#define ONIGERR_EMPTY_CHAR_CLASS -102
|
||||
#define ONIGERR_PREMATURE_END_OF_CHAR_CLASS -103
|
||||
#define ONIGERR_END_PATTERN_AT_ESCAPE -104
|
||||
#define ONIGERR_END_PATTERN_AT_META -105
|
||||
#define ONIGERR_END_PATTERN_AT_CONTROL -106
|
||||
#define ONIGERR_META_CODE_SYNTAX -108
|
||||
#define ONIGERR_CONTROL_CODE_SYNTAX -109
|
||||
#define ONIGERR_CHAR_CLASS_VALUE_AT_END_OF_RANGE -110
|
||||
#define ONIGERR_CHAR_CLASS_VALUE_AT_START_OF_RANGE -111
|
||||
#define ONIGERR_UNMATCHED_RANGE_SPECIFIER_IN_CHAR_CLASS -112
|
||||
#define ONIGERR_TARGET_OF_REPEAT_OPERATOR_NOT_SPECIFIED -113
|
||||
#define ONIGERR_TARGET_OF_REPEAT_OPERATOR_INVALID -114
|
||||
#define ONIGERR_NESTED_REPEAT_OPERATOR -115
|
||||
#define ONIGERR_UNMATCHED_CLOSE_PARENTHESIS -116
|
||||
#define ONIGERR_END_PATTERN_WITH_UNMATCHED_PARENTHESIS -117
|
||||
#define ONIGERR_END_PATTERN_IN_GROUP -118
|
||||
#define ONIGERR_UNDEFINED_GROUP_OPTION -119
|
||||
#define ONIGERR_INVALID_POSIX_BRACKET_TYPE -121
|
||||
#define ONIGERR_INVALID_LOOK_BEHIND_PATTERN -122
|
||||
#define ONIGERR_INVALID_REPEAT_RANGE_PATTERN -123
|
||||
#define ONIGERR_INVALID_CONDITION_PATTERN -124
|
||||
/* values error (syntax error) */
|
||||
#define ONIGERR_TOO_BIG_NUMBER -200
|
||||
#define ONIGERR_TOO_BIG_NUMBER_FOR_REPEAT_RANGE -201
|
||||
#define ONIGERR_UPPER_SMALLER_THAN_LOWER_IN_REPEAT_RANGE -202
|
||||
#define ONIGERR_EMPTY_RANGE_IN_CHAR_CLASS -203
|
||||
#define ONIGERR_MISMATCH_CODE_LENGTH_IN_CLASS_RANGE -204
|
||||
#define ONIGERR_TOO_MANY_MULTI_BYTE_RANGES -205
|
||||
#define ONIGERR_TOO_SHORT_MULTI_BYTE_STRING -206
|
||||
#define ONIGERR_TOO_BIG_BACKREF_NUMBER -207
|
||||
#define ONIGERR_INVALID_BACKREF -208
|
||||
#define ONIGERR_NUMBERED_BACKREF_OR_CALL_NOT_ALLOWED -209
|
||||
#define ONIGERR_TOO_SHORT_DIGITS -210
|
||||
#define ONIGERR_TOO_LONG_WIDE_CHAR_VALUE -212
|
||||
#define ONIGERR_EMPTY_GROUP_NAME -214
|
||||
#define ONIGERR_INVALID_GROUP_NAME -215
|
||||
#define ONIGERR_INVALID_CHAR_IN_GROUP_NAME -216
|
||||
#define ONIGERR_UNDEFINED_NAME_REFERENCE -217
|
||||
#define ONIGERR_UNDEFINED_GROUP_REFERENCE -218
|
||||
#define ONIGERR_MULTIPLEX_DEFINED_NAME -219
|
||||
#define ONIGERR_MULTIPLEX_DEFINITION_NAME_CALL -220
|
||||
#define ONIGERR_NEVER_ENDING_RECURSION -221
|
||||
#define ONIGERR_GROUP_NUMBER_OVER_FOR_CAPTURE_HISTORY -222
|
||||
#define ONIGERR_INVALID_CHAR_PROPERTY_NAME -223
|
||||
#define ONIGERR_INVALID_CODE_POINT_VALUE -400
|
||||
#define ONIGERR_INVALID_WIDE_CHAR_VALUE -400
|
||||
#define ONIGERR_TOO_BIG_WIDE_CHAR_VALUE -401
|
||||
#define ONIGERR_NOT_SUPPORTED_ENCODING_COMBINATION -402
|
||||
#define ONIGERR_INVALID_COMBINATION_OF_OPTIONS -403
|
||||
|
||||
/* errors related to thread */
|
||||
#define ONIGERR_OVER_THREAD_PASS_LIMIT_COUNT -1001
|
||||
|
||||
|
||||
/* must be smaller than BIT_STATUS_BITS_NUM (unsigned int * 8) */
|
||||
#define ONIG_MAX_CAPTURE_HISTORY_GROUP 31
|
||||
#define ONIG_IS_CAPTURE_HISTORY_GROUP(r, i) \
|
||||
((i) <= ONIG_MAX_CAPTURE_HISTORY_GROUP && (r)->list && (r)->list[i])
|
||||
|
||||
typedef struct OnigCaptureTreeNodeStruct {
|
||||
int group; /* group number */
|
||||
OnigPosition beg;
|
||||
OnigPosition end;
|
||||
int allocated;
|
||||
int num_childs;
|
||||
struct OnigCaptureTreeNodeStruct** childs;
|
||||
} OnigCaptureTreeNode;
|
||||
|
||||
/* match result region type */
|
||||
struct re_registers {
|
||||
int allocated;
|
||||
int num_regs;
|
||||
OnigPosition* beg;
|
||||
OnigPosition* end;
|
||||
/* extended */
|
||||
OnigCaptureTreeNode* history_root; /* capture history tree root */
|
||||
};
|
||||
|
||||
/* capture tree traverse */
|
||||
#define ONIG_TRAVERSE_CALLBACK_AT_FIRST 1
|
||||
#define ONIG_TRAVERSE_CALLBACK_AT_LAST 2
|
||||
#define ONIG_TRAVERSE_CALLBACK_AT_BOTH \
|
||||
( ONIG_TRAVERSE_CALLBACK_AT_FIRST | ONIG_TRAVERSE_CALLBACK_AT_LAST )
|
||||
|
||||
|
||||
#define ONIG_REGION_NOTPOS -1
|
||||
|
||||
typedef struct re_registers OnigRegion;
|
||||
|
||||
typedef struct {
|
||||
OnigEncoding enc;
|
||||
OnigUChar* par;
|
||||
OnigUChar* par_end;
|
||||
} OnigErrorInfo;
|
||||
|
||||
typedef struct {
|
||||
int lower;
|
||||
int upper;
|
||||
} OnigRepeatRange;
|
||||
|
||||
typedef void (*OnigWarnFunc) P_((const char* s));
|
||||
extern void onig_null_warn P_((const char* s));
|
||||
#define ONIG_NULL_WARN onig_null_warn
|
||||
|
||||
#define ONIG_CHAR_TABLE_SIZE 256
|
||||
|
||||
/* regex_t state */
|
||||
#define ONIG_STATE_NORMAL 0
|
||||
#define ONIG_STATE_SEARCHING 1
|
||||
#define ONIG_STATE_COMPILING -1
|
||||
#define ONIG_STATE_MODIFY -2
|
||||
|
||||
#define ONIG_STATE(reg) \
|
||||
((reg)->state > 0 ? ONIG_STATE_SEARCHING : (reg)->state)
|
||||
|
||||
typedef struct re_pattern_buffer {
|
||||
/* common members of BBuf(bytes-buffer) */
|
||||
unsigned char* p; /* compiled pattern */
|
||||
unsigned int used; /* used space for p */
|
||||
unsigned int alloc; /* allocated space for p */
|
||||
|
||||
int state; /* normal, searching, compiling */
|
||||
int num_mem; /* used memory(...) num counted from 1 */
|
||||
int num_repeat; /* OP_REPEAT/OP_REPEAT_NG id-counter */
|
||||
int num_null_check; /* OP_NULL_CHECK_START/END id counter */
|
||||
int num_comb_exp_check; /* combination explosion check */
|
||||
int num_call; /* number of subexp call */
|
||||
unsigned int capture_history; /* (?@...) flag (1-31) */
|
||||
unsigned int bt_mem_start; /* need backtrack flag */
|
||||
unsigned int bt_mem_end; /* need backtrack flag */
|
||||
int stack_pop_level;
|
||||
int repeat_range_alloc;
|
||||
OnigRepeatRange* repeat_range;
|
||||
|
||||
OnigEncoding enc;
|
||||
OnigOptionType options;
|
||||
const OnigSyntaxType* syntax;
|
||||
OnigCaseFoldType case_fold_flag;
|
||||
void* name_table;
|
||||
|
||||
/* optimization info (string search, char-map and anchors) */
|
||||
int optimize; /* optimize flag */
|
||||
int threshold_len; /* search str-length for apply optimize */
|
||||
int anchor; /* BEGIN_BUF, BEGIN_POS, (SEMI_)END_BUF */
|
||||
OnigDistance anchor_dmin; /* (SEMI_)END_BUF anchor distance */
|
||||
OnigDistance anchor_dmax; /* (SEMI_)END_BUF anchor distance */
|
||||
int sub_anchor; /* start-anchor for exact or map */
|
||||
unsigned char *exact;
|
||||
unsigned char *exact_end;
|
||||
unsigned char map[ONIG_CHAR_TABLE_SIZE]; /* used as BM skip or char-map */
|
||||
int *int_map; /* BM skip for exact_len > 255 */
|
||||
int *int_map_backward; /* BM skip for backward search */
|
||||
OnigDistance dmin; /* min-distance of exact or map */
|
||||
OnigDistance dmax; /* max-distance of exact or map */
|
||||
|
||||
/* regex_t link chain */
|
||||
struct re_pattern_buffer* chain; /* escape compile-conflict */
|
||||
} OnigRegexType;
|
||||
|
||||
typedef OnigRegexType* OnigRegex;
|
||||
|
||||
#ifndef ONIG_ESCAPE_REGEX_T_COLLISION
|
||||
typedef OnigRegexType regex_t;
|
||||
#endif
|
||||
|
||||
|
||||
typedef struct {
|
||||
int num_of_elements;
|
||||
OnigEncoding pattern_enc;
|
||||
OnigEncoding target_enc;
|
||||
OnigSyntaxType* syntax;
|
||||
OnigOptionType option;
|
||||
OnigCaseFoldType case_fold_flag;
|
||||
} OnigCompileInfo;
|
||||
|
||||
/* Oniguruma Native API */
|
||||
ONIG_EXTERN
|
||||
int onig_init P_((void));
|
||||
ONIG_EXTERN
|
||||
int onig_error_code_to_str PV_((OnigUChar* s, OnigPosition err_code, ...));
|
||||
ONIG_EXTERN
|
||||
void onig_set_warn_func P_((OnigWarnFunc f));
|
||||
ONIG_EXTERN
|
||||
void onig_set_verb_warn_func P_((OnigWarnFunc f));
|
||||
ONIG_EXTERN
|
||||
int onig_new P_((OnigRegex*, const OnigUChar* pattern, const OnigUChar* pattern_end, OnigOptionType option, OnigEncoding enc, const OnigSyntaxType* syntax, OnigErrorInfo* einfo));
|
||||
ONIG_EXTERN
|
||||
int onig_reg_init P_((OnigRegex reg, OnigOptionType option, OnigCaseFoldType case_fold_flag, OnigEncoding enc, const OnigSyntaxType* syntax));
|
||||
ONIG_EXTERN
|
||||
int onig_new_without_alloc P_((OnigRegex, const OnigUChar* pattern, const OnigUChar* pattern_end, OnigOptionType option, OnigEncoding enc, OnigSyntaxType* syntax, OnigErrorInfo* einfo));
|
||||
ONIG_EXTERN
|
||||
int onig_new_deluxe P_((OnigRegex* reg, const OnigUChar* pattern, const OnigUChar* pattern_end, OnigCompileInfo* ci, OnigErrorInfo* einfo));
|
||||
ONIG_EXTERN
|
||||
void onig_free P_((OnigRegex));
|
||||
ONIG_EXTERN
|
||||
void onig_free_body P_((OnigRegex));
|
||||
ONIG_EXTERN
|
||||
int onig_recompile P_((OnigRegex, const OnigUChar* pattern, const OnigUChar* pattern_end, OnigOptionType option, OnigEncoding enc, OnigSyntaxType* syntax, OnigErrorInfo* einfo));
|
||||
ONIG_EXTERN
|
||||
int onig_recompile_deluxe P_((OnigRegex reg, const OnigUChar* pattern, const OnigUChar* pattern_end, OnigCompileInfo* ci, OnigErrorInfo* einfo));
|
||||
ONIG_EXTERN
|
||||
OnigPosition onig_search P_((OnigRegex, const OnigUChar* str, const OnigUChar* end, const OnigUChar* start, const OnigUChar* range, OnigRegion* region, OnigOptionType option));
|
||||
ONIG_EXTERN
|
||||
OnigPosition onig_search_gpos P_((OnigRegex, const OnigUChar* str, const OnigUChar* end, const OnigUChar* global_pos, const OnigUChar* start, const OnigUChar* range, OnigRegion* region, OnigOptionType option));
|
||||
ONIG_EXTERN
|
||||
OnigPosition onig_match P_((OnigRegex, const OnigUChar* str, const OnigUChar* end, const OnigUChar* at, OnigRegion* region, OnigOptionType option));
|
||||
ONIG_EXTERN
|
||||
OnigRegion* onig_region_new P_((void));
|
||||
ONIG_EXTERN
|
||||
void onig_region_init P_((OnigRegion* region));
|
||||
ONIG_EXTERN
|
||||
void onig_region_free P_((OnigRegion* region, int free_self));
|
||||
ONIG_EXTERN
|
||||
void onig_region_copy P_((OnigRegion* to, OnigRegion* from));
|
||||
ONIG_EXTERN
|
||||
void onig_region_clear P_((OnigRegion* region));
|
||||
ONIG_EXTERN
|
||||
int onig_region_resize P_((OnigRegion* region, int n));
|
||||
ONIG_EXTERN
|
||||
int onig_region_set P_((OnigRegion* region, int at, int beg, int end));
|
||||
ONIG_EXTERN
|
||||
int onig_name_to_group_numbers P_((OnigRegex reg, const OnigUChar* name, const OnigUChar* name_end, int** nums));
|
||||
ONIG_EXTERN
|
||||
int onig_name_to_backref_number P_((OnigRegex reg, const OnigUChar* name, const OnigUChar* name_end, OnigRegion *region));
|
||||
ONIG_EXTERN
|
||||
int onig_foreach_name P_((OnigRegex reg, int (*func)(const OnigUChar*, const OnigUChar*,int,int*,OnigRegex,void*), void* arg));
|
||||
ONIG_EXTERN
|
||||
int onig_number_of_names P_((OnigRegex reg));
|
||||
ONIG_EXTERN
|
||||
int onig_number_of_captures P_((OnigRegex reg));
|
||||
ONIG_EXTERN
|
||||
int onig_number_of_capture_histories P_((OnigRegex reg));
|
||||
ONIG_EXTERN
|
||||
OnigCaptureTreeNode* onig_get_capture_tree P_((OnigRegion* region));
|
||||
ONIG_EXTERN
|
||||
int onig_capture_tree_traverse P_((OnigRegion* region, int at, int(*callback_func)(int,OnigPosition,OnigPosition,int,int,void*), void* arg));
|
||||
ONIG_EXTERN
|
||||
int onig_noname_group_capture_is_active P_((OnigRegex reg));
|
||||
ONIG_EXTERN
|
||||
OnigEncoding onig_get_encoding P_((OnigRegex reg));
|
||||
ONIG_EXTERN
|
||||
OnigOptionType onig_get_options P_((OnigRegex reg));
|
||||
ONIG_EXTERN
|
||||
OnigCaseFoldType onig_get_case_fold_flag P_((OnigRegex reg));
|
||||
ONIG_EXTERN
|
||||
const OnigSyntaxType* onig_get_syntax P_((OnigRegex reg));
|
||||
ONIG_EXTERN
|
||||
int onig_set_default_syntax P_((const OnigSyntaxType* syntax));
|
||||
ONIG_EXTERN
|
||||
void onig_copy_syntax P_((OnigSyntaxType* to, const OnigSyntaxType* from));
|
||||
ONIG_EXTERN
|
||||
unsigned int onig_get_syntax_op P_((OnigSyntaxType* syntax));
|
||||
ONIG_EXTERN
|
||||
unsigned int onig_get_syntax_op2 P_((OnigSyntaxType* syntax));
|
||||
ONIG_EXTERN
|
||||
unsigned int onig_get_syntax_behavior P_((OnigSyntaxType* syntax));
|
||||
ONIG_EXTERN
|
||||
OnigOptionType onig_get_syntax_options P_((OnigSyntaxType* syntax));
|
||||
ONIG_EXTERN
|
||||
void onig_set_syntax_op P_((OnigSyntaxType* syntax, unsigned int op));
|
||||
ONIG_EXTERN
|
||||
void onig_set_syntax_op2 P_((OnigSyntaxType* syntax, unsigned int op2));
|
||||
ONIG_EXTERN
|
||||
void onig_set_syntax_behavior P_((OnigSyntaxType* syntax, unsigned int behavior));
|
||||
ONIG_EXTERN
|
||||
void onig_set_syntax_options P_((OnigSyntaxType* syntax, OnigOptionType options));
|
||||
ONIG_EXTERN
|
||||
int onig_set_meta_char P_((OnigSyntaxType* syntax, unsigned int what, OnigCodePoint code));
|
||||
ONIG_EXTERN
|
||||
void onig_copy_encoding P_((OnigEncoding to, OnigEncoding from));
|
||||
ONIG_EXTERN
|
||||
OnigCaseFoldType onig_get_default_case_fold_flag P_((void));
|
||||
ONIG_EXTERN
|
||||
int onig_set_default_case_fold_flag P_((OnigCaseFoldType case_fold_flag));
|
||||
ONIG_EXTERN
|
||||
unsigned int onig_get_match_stack_limit_size P_((void));
|
||||
ONIG_EXTERN
|
||||
int onig_set_match_stack_limit_size P_((unsigned int size));
|
||||
ONIG_EXTERN
|
||||
int onig_end P_((void));
|
||||
ONIG_EXTERN
|
||||
const char* onig_version P_((void));
|
||||
ONIG_EXTERN
|
||||
const char* onig_copyright P_((void));
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility pop
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if 0
|
||||
{ /* satisfy cc-mode */
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ONIGURUMA_H */
|
||||
@@ -1,75 +0,0 @@
|
||||
/**********************************************************************
|
||||
|
||||
re.h -
|
||||
|
||||
$Author: nobu $
|
||||
created at: Thu Sep 30 14:18:32 JST 1993
|
||||
|
||||
Copyright (C) 1993-2007 Yukihiro Matsumoto
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef RUBY_RE_H
|
||||
#define RUBY_RE_H 1
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#if 0
|
||||
} /* satisfy cc-mode */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "ruby/regex.h"
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility push(default)
|
||||
#endif
|
||||
|
||||
typedef struct re_pattern_buffer Regexp;
|
||||
|
||||
struct rmatch_offset {
|
||||
long beg;
|
||||
long end;
|
||||
};
|
||||
|
||||
struct rmatch {
|
||||
struct re_registers regs;
|
||||
|
||||
int char_offset_updated;
|
||||
int char_offset_num_allocated;
|
||||
struct rmatch_offset *char_offset;
|
||||
};
|
||||
|
||||
struct RMatch {
|
||||
struct RBasic basic;
|
||||
VALUE str;
|
||||
struct rmatch *rmatch;
|
||||
VALUE regexp; /* RRegexp */
|
||||
};
|
||||
|
||||
#define RMATCH(obj) (R_CAST(RMatch)(obj))
|
||||
#define RMATCH_REGS(obj) (&(R_CAST(RMatch)(obj))->rmatch->regs)
|
||||
|
||||
VALUE rb_reg_regcomp(VALUE);
|
||||
long rb_reg_search(VALUE, VALUE, long, int);
|
||||
VALUE rb_reg_regsub(VALUE, VALUE, struct re_registers *, VALUE);
|
||||
long rb_reg_adjust_startpos(VALUE, VALUE, long, int);
|
||||
void rb_match_busy(VALUE);
|
||||
VALUE rb_reg_quote(VALUE);
|
||||
regex_t *rb_reg_prepare_re(VALUE re, VALUE str);
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility pop
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
#if 0
|
||||
{ /* satisfy cc-mode */
|
||||
#endif
|
||||
} /* extern "C" { */
|
||||
#endif
|
||||
|
||||
#endif /* RUBY_RE_H */
|
||||
@@ -1,50 +0,0 @@
|
||||
/**********************************************************************
|
||||
|
||||
regex.h -
|
||||
|
||||
$Author: nobu $
|
||||
|
||||
Copyright (C) 1993-2007 Yukihiro Matsumoto
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef ONIGURUMA_REGEX_H
|
||||
#define ONIGURUMA_REGEX_H 1
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#if 0
|
||||
} /* satisfy cc-mode */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef RUBY
|
||||
#include "ruby/oniguruma.h"
|
||||
#else
|
||||
#include "oniguruma.h"
|
||||
#endif
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility push(default)
|
||||
#endif
|
||||
|
||||
#ifndef ONIG_RUBY_M17N
|
||||
|
||||
ONIG_EXTERN OnigEncoding OnigEncDefaultCharEncoding;
|
||||
|
||||
#define mbclen(p,e,enc) rb_enc_mbclen((p),(e),(enc))
|
||||
|
||||
#endif /* ifndef ONIG_RUBY_M17N */
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility pop
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
#if 0
|
||||
{ /* satisfy cc-mode */
|
||||
#endif
|
||||
} /* extern "C" { */
|
||||
#endif
|
||||
|
||||
#endif /* ONIGURUMA_REGEX_H */
|
||||
-1736
File diff suppressed because it is too large
Load Diff
@@ -1,157 +0,0 @@
|
||||
/* This is a public domain general purpose hash table package written by Peter Moore @ UCB. */
|
||||
|
||||
/* @(#) st.h 5.1 89/12/14 */
|
||||
|
||||
#ifndef RUBY_ST_H
|
||||
#define RUBY_ST_H 1
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#if 0
|
||||
} /* satisfy cc-mode */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "ruby/defines.h"
|
||||
|
||||
#if defined STDC_HEADERS
|
||||
#include <stddef.h>
|
||||
#elif defined HAVE_STDLIB_H
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STDINT_H
|
||||
# include <stdint.h>
|
||||
#endif
|
||||
#ifdef HAVE_INTTYPES_H
|
||||
# include <inttypes.h>
|
||||
#endif
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility push(default)
|
||||
#endif
|
||||
|
||||
#if SIZEOF_LONG == SIZEOF_VOIDP
|
||||
typedef unsigned long st_data_t;
|
||||
#elif SIZEOF_LONG_LONG == SIZEOF_VOIDP
|
||||
typedef unsigned LONG_LONG st_data_t;
|
||||
#else
|
||||
# error ---->> st.c requires sizeof(void*) == sizeof(long) or sizeof(LONG_LONG) to be compiled. <<----
|
||||
#endif
|
||||
#define ST_DATA_T_DEFINED
|
||||
|
||||
#ifndef CHAR_BIT
|
||||
# ifdef HAVE_LIMITS_H
|
||||
# include <limits.h>
|
||||
# else
|
||||
# define CHAR_BIT 8
|
||||
# endif
|
||||
#endif
|
||||
#ifndef _
|
||||
# define _(args) args
|
||||
#endif
|
||||
#ifndef ANYARGS
|
||||
# ifdef __cplusplus
|
||||
# define ANYARGS ...
|
||||
# else
|
||||
# define ANYARGS
|
||||
# endif
|
||||
#endif
|
||||
|
||||
typedef struct st_table st_table;
|
||||
|
||||
typedef st_data_t st_index_t;
|
||||
typedef int st_compare_func(st_data_t, st_data_t);
|
||||
typedef st_index_t st_hash_func(st_data_t);
|
||||
|
||||
typedef char st_check_for_sizeof_st_index_t[SIZEOF_VOIDP == (int)sizeof(st_index_t) ? 1 : -1];
|
||||
#define SIZEOF_ST_INDEX_T SIZEOF_VOIDP
|
||||
|
||||
struct st_hash_type {
|
||||
int (*compare)(ANYARGS /*st_data_t, st_data_t*/); /* st_compare_func* */
|
||||
st_index_t (*hash)(ANYARGS /*st_data_t*/); /* st_hash_func* */
|
||||
};
|
||||
|
||||
#define ST_INDEX_BITS (sizeof(st_index_t) * CHAR_BIT)
|
||||
|
||||
struct st_table {
|
||||
const struct st_hash_type *type;
|
||||
st_index_t num_bins;
|
||||
unsigned int entries_packed : 1;
|
||||
#ifdef __GNUC__
|
||||
/*
|
||||
* C spec says,
|
||||
* A bit-field shall have a type that is a qualified or unqualified
|
||||
* version of _Bool, signed int, unsigned int, or some other
|
||||
* implementation-defined type. It is implementation-defined whether
|
||||
* atomic types are permitted.
|
||||
* In short, long and long long bit-field are implementation-defined
|
||||
* feature. Therefore we want to supress a warning explicitly.
|
||||
*/
|
||||
__extension__
|
||||
#endif
|
||||
st_index_t num_entries : ST_INDEX_BITS - 1;
|
||||
union {
|
||||
struct {
|
||||
struct st_table_entry **bins;
|
||||
struct st_table_entry *head, *tail;
|
||||
} big;
|
||||
struct {
|
||||
struct st_packed_entry *entries;
|
||||
st_index_t real_entries;
|
||||
} packed;
|
||||
} as;
|
||||
};
|
||||
|
||||
#define st_is_member(table,key) st_lookup((table),(key),(st_data_t *)0)
|
||||
|
||||
enum st_retval {ST_CONTINUE, ST_STOP, ST_DELETE, ST_CHECK};
|
||||
|
||||
st_table *st_init_table(const struct st_hash_type *);
|
||||
st_table *st_init_table_with_size(const struct st_hash_type *, st_index_t);
|
||||
st_table *st_init_numtable(void);
|
||||
st_table *st_init_numtable_with_size(st_index_t);
|
||||
st_table *st_init_strtable(void);
|
||||
st_table *st_init_strtable_with_size(st_index_t);
|
||||
st_table *st_init_strcasetable(void);
|
||||
st_table *st_init_strcasetable_with_size(st_index_t);
|
||||
int st_delete(st_table *, st_data_t *, st_data_t *); /* returns 0:notfound 1:deleted */
|
||||
int st_delete_safe(st_table *, st_data_t *, st_data_t *, st_data_t);
|
||||
int st_insert(st_table *, st_data_t, st_data_t);
|
||||
int st_insert2(st_table *, st_data_t, st_data_t, st_data_t (*)(st_data_t));
|
||||
int st_lookup(st_table *, st_data_t, st_data_t *);
|
||||
int st_get_key(st_table *, st_data_t, st_data_t *);
|
||||
typedef int st_update_callback_func(st_data_t *key, st_data_t *value, st_data_t arg, int existing);
|
||||
int st_update(st_table *table, st_data_t key, st_update_callback_func *func, st_data_t arg);
|
||||
int st_foreach(st_table *, int (*)(ANYARGS), st_data_t);
|
||||
int st_foreach_check(st_table *, int (*)(ANYARGS), st_data_t, st_data_t);
|
||||
int st_reverse_foreach(st_table *, int (*)(ANYARGS), st_data_t);
|
||||
void st_add_direct(st_table *, st_data_t, st_data_t);
|
||||
void st_free_table(st_table *);
|
||||
void st_cleanup_safe(st_table *, st_data_t);
|
||||
void st_clear(st_table *);
|
||||
st_table *st_copy(st_table *);
|
||||
int st_numcmp(st_data_t, st_data_t);
|
||||
st_index_t st_numhash(st_data_t);
|
||||
int st_strcasecmp(const char *s1, const char *s2);
|
||||
int st_strncasecmp(const char *s1, const char *s2, size_t n);
|
||||
size_t st_memsize(const st_table *);
|
||||
st_index_t st_hash(const void *ptr, size_t len, st_index_t h);
|
||||
st_index_t st_hash_uint32(st_index_t h, uint32_t i);
|
||||
st_index_t st_hash_uint(st_index_t h, st_index_t i);
|
||||
st_index_t st_hash_end(st_index_t h);
|
||||
st_index_t st_hash_start(st_index_t h);
|
||||
#define st_hash_start(h) ((st_index_t)(h))
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility pop
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
#if 0
|
||||
{ /* satisfy cc-mode */
|
||||
#endif
|
||||
} /* extern "C" { */
|
||||
#endif
|
||||
|
||||
#endif /* RUBY_ST_H */
|
||||
@@ -1,19 +0,0 @@
|
||||
#ifndef RUBY_SUBST_H
|
||||
#define RUBY_SUBST_H 1
|
||||
|
||||
#undef snprintf
|
||||
#undef vsnprintf
|
||||
#define snprintf ruby_snprintf
|
||||
#define vsnprintf ruby_vsnprintf
|
||||
|
||||
#ifdef BROKEN_CLOSE
|
||||
#undef getpeername
|
||||
#define getpeername ruby_getpeername
|
||||
#undef getsockname
|
||||
#define getsockname ruby_getsockname
|
||||
#undef shutdown
|
||||
#define shutdown ruby_shutdown
|
||||
#undef close
|
||||
#define close ruby_close
|
||||
#endif
|
||||
#endif
|
||||
@@ -1,49 +0,0 @@
|
||||
/**********************************************************************
|
||||
|
||||
thread.h -
|
||||
|
||||
$Author: matz $
|
||||
created at: Tue Jul 10 17:35:43 JST 2012
|
||||
|
||||
Copyright (C) 2007 Yukihiro Matsumoto
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef RUBY_THREAD_H
|
||||
#define RUBY_THREAD_H 1
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#if 0
|
||||
} /* satisfy cc-mode */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "ruby/intern.h"
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility push(default)
|
||||
#endif
|
||||
|
||||
void *rb_thread_call_with_gvl(void *(*func)(void *), void *data1);
|
||||
|
||||
void *rb_thread_call_without_gvl(void *(*func)(void *), void *data1,
|
||||
rb_unblock_function_t *ubf, void *data2);
|
||||
void *rb_thread_call_without_gvl2(void *(*func)(void *), void *data1,
|
||||
rb_unblock_function_t *ubf, void *data2);
|
||||
|
||||
#define RUBY_CALL_WO_GVL_FLAG_SKIP_CHECK_INTS_AFTER 0x01
|
||||
#define RUBY_CALL_WO_GVL_FLAG_SKIP_CHECK_INTS_
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility pop
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
#if 0
|
||||
{ /* satisfy cc-mode */
|
||||
#endif
|
||||
} /* extern "C" { */
|
||||
#endif
|
||||
|
||||
#endif /* RUBY_THREAD_H */
|
||||
@@ -1,99 +0,0 @@
|
||||
/**********************************************************************
|
||||
|
||||
util.h -
|
||||
|
||||
$Author: tadf $
|
||||
created at: Thu Mar 9 11:55:53 JST 1995
|
||||
|
||||
Copyright (C) 1993-2007 Yukihiro Matsumoto
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef RUBY_UTIL_H
|
||||
#define RUBY_UTIL_H 1
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#if 0
|
||||
} /* satisfy cc-mode */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "ruby/defines.h"
|
||||
#ifdef RUBY_EXTCONF_H
|
||||
#include RUBY_EXTCONF_H
|
||||
#endif
|
||||
|
||||
#ifndef _
|
||||
#ifdef __cplusplus
|
||||
# ifndef HAVE_PROTOTYPES
|
||||
# define HAVE_PROTOTYPES 1
|
||||
# endif
|
||||
# ifndef HAVE_STDARG_PROTOTYPES
|
||||
# define HAVE_STDARG_PROTOTYPES 1
|
||||
# endif
|
||||
#endif
|
||||
#ifdef HAVE_PROTOTYPES
|
||||
# define _(args) args
|
||||
#else
|
||||
# define _(args) ()
|
||||
#endif
|
||||
#ifdef HAVE_STDARG_PROTOTYPES
|
||||
# define __(args) args
|
||||
#else
|
||||
# define __(args) ()
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility push(default)
|
||||
#endif
|
||||
|
||||
#define scan_oct(s,l,e) ((int)ruby_scan_oct((s),(l),(e)))
|
||||
unsigned long ruby_scan_oct(const char *, size_t, size_t *);
|
||||
#define scan_hex(s,l,e) ((int)ruby_scan_hex((s),(l),(e)))
|
||||
unsigned long ruby_scan_hex(const char *, size_t, size_t *);
|
||||
|
||||
void ruby_qsort(void *, const size_t, const size_t,
|
||||
int (*)(const void *, const void *, void *), void *);
|
||||
|
||||
void ruby_setenv(const char *, const char *);
|
||||
void ruby_unsetenv(const char *);
|
||||
#undef setenv
|
||||
#undef unsetenv
|
||||
#define setenv(name,val) ruby_setenv((name),(val))
|
||||
#define unsetenv(name,val) ruby_unsetenv(name)
|
||||
|
||||
char *ruby_strdup(const char *);
|
||||
#undef strdup
|
||||
#define strdup(s) ruby_strdup(s)
|
||||
|
||||
char *ruby_getcwd(void);
|
||||
#define my_getcwd() ruby_getcwd()
|
||||
|
||||
double ruby_strtod(const char *, char **);
|
||||
#undef strtod
|
||||
#define strtod(s,e) ruby_strtod((s),(e))
|
||||
|
||||
#if defined _MSC_VER && _MSC_VER >= 1300
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable:4723)
|
||||
#endif
|
||||
#if defined _MSC_VER && _MSC_VER >= 1300
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
||||
void ruby_each_words(const char *, void (*)(const char*, int, void*), void *);
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility pop
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
#if 0
|
||||
{ /* satisfy cc-mode */
|
||||
#endif
|
||||
} /* extern "C" { */
|
||||
#endif
|
||||
|
||||
#endif /* RUBY_UTIL_H */
|
||||
@@ -1,78 +0,0 @@
|
||||
/**********************************************************************
|
||||
|
||||
ruby/version.h -
|
||||
|
||||
$Author: ayumin $
|
||||
created at: Wed May 13 12:56:56 JST 2009
|
||||
|
||||
Copyright (C) 1993-2009 Yukihiro Matsumoto
|
||||
Copyright (C) 2000 Network Applied Communication Laboratory, Inc.
|
||||
Copyright (C) 2000 Information-technology Promotion Agency, Japan
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
/*
|
||||
* This file contains only
|
||||
* - never-changable informations, and
|
||||
* - interfaces accessible from extension libraries.
|
||||
*
|
||||
* Never try to check RUBY_VERSION_CODE etc in extension libraries,
|
||||
* check the features with mkmf.rb instead.
|
||||
*/
|
||||
|
||||
#ifndef RUBY_VERSION_H
|
||||
#define RUBY_VERSION_H 1
|
||||
|
||||
/* The origin. */
|
||||
#define RUBY_AUTHOR "Yukihiro Matsumoto"
|
||||
#define RUBY_BIRTH_YEAR 1993
|
||||
#define RUBY_BIRTH_MONTH 2
|
||||
#define RUBY_BIRTH_DAY 24
|
||||
|
||||
/* API version */
|
||||
#define RUBY_API_VERSION_MAJOR 2
|
||||
#define RUBY_API_VERSION_MINOR 0
|
||||
#define RUBY_API_VERSION_TEENY 0
|
||||
#define RUBY_API_VERSION_CODE (RUBY_API_VERSION_MAJOR*10000+RUBY_API_VERSION_MINOR*100+RUBY_API_VERSION_TEENY)
|
||||
|
||||
#ifdef RUBY_EXTERN
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#if 0
|
||||
} /* satisfy cc-mode */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility push(default)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Interfaces from extension libraries.
|
||||
*
|
||||
* Before using these infos, think thrice whether they are really
|
||||
* necessary or not, and if the answer was yes, think twice a week
|
||||
* later again.
|
||||
*/
|
||||
RUBY_EXTERN const int ruby_api_version[3];
|
||||
RUBY_EXTERN const char ruby_version[];
|
||||
RUBY_EXTERN const char ruby_release_date[];
|
||||
RUBY_EXTERN const char ruby_platform[];
|
||||
RUBY_EXTERN const int ruby_patchlevel;
|
||||
RUBY_EXTERN const char ruby_description[];
|
||||
RUBY_EXTERN const char ruby_copyright[];
|
||||
RUBY_EXTERN const char ruby_engine[];
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility pop
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
#if 0
|
||||
{ /* satisfy cc-mode */
|
||||
#endif
|
||||
} /* extern "C" { */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -1,68 +0,0 @@
|
||||
/**********************************************************************
|
||||
|
||||
ruby/vm.h -
|
||||
|
||||
$Author: shyouhei $
|
||||
created at: Sat May 31 15:17:36 2008
|
||||
|
||||
Copyright (C) 2008 Yukihiro Matsumoto
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef RUBY_VM_H
|
||||
#define RUBY_VM_H 1
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#if 0
|
||||
} /* satisfy cc-mode */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility push(default)
|
||||
#endif
|
||||
|
||||
/* Place holder.
|
||||
*
|
||||
* We will prepare VM creation/control APIs on 1.9.2 or later.
|
||||
* If you have an interest about it, please see mvm branch.
|
||||
* http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/mvm/
|
||||
*/
|
||||
|
||||
/* VM type declaration */
|
||||
typedef struct rb_vm_struct ruby_vm_t;
|
||||
|
||||
/* core API */
|
||||
int ruby_vm_destruct(ruby_vm_t *vm);
|
||||
|
||||
/**
|
||||
* ruby_vm_at_exit registers a function _func_ to be invoked when a VM
|
||||
* passed away. Functions registered this way runs in reverse order
|
||||
* of registration, just like END {} block does. The difference is
|
||||
* its timing to be triggered. ruby_vm_at_exit functions runs when a
|
||||
* VM _passed_ _away_, while END {} blocks runs just _before_ a VM
|
||||
* _is_ _passing_ _away_.
|
||||
*
|
||||
* You cannot register a function to another VM than where you are in.
|
||||
* So where to register is intuitive, omitted. OTOH the argument
|
||||
* _func_ cannot know which VM it is in because at the time of
|
||||
* invocation, the VM has already died and there is no execution
|
||||
* context. The VM itself is passed as the first argument to it.
|
||||
*
|
||||
* @param[in] func the function to register.
|
||||
*/
|
||||
void ruby_vm_at_exit(void(*func)(ruby_vm_t *));
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility pop
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
#if 0
|
||||
{ /* satisfy cc-mode */
|
||||
#endif
|
||||
} /* extern "C" { */
|
||||
#endif
|
||||
|
||||
#endif /* RUBY_VM_H */
|
||||
@@ -1,799 +0,0 @@
|
||||
#ifndef RUBY_WIN32_H
|
||||
#define RUBY_WIN32_H 1
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#if 0
|
||||
} /* satisfy cc-mode */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility push(default)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Copyright (c) 1993, Intergraph Corporation
|
||||
*
|
||||
* You may distribute under the terms of either the GNU General Public
|
||||
* License or the Artistic License, as specified in the perl README file.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Definitions for NT port of Perl
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* Ok now we can include the normal include files.
|
||||
*/
|
||||
|
||||
/* #include <stdarg.h> conflict with varargs.h? */
|
||||
#if !defined(WSAAPI)
|
||||
#if defined(__cplusplus) && defined(_MSC_VER)
|
||||
extern "C++" { /* template without extern "C++" */
|
||||
#endif
|
||||
#if !defined(_WIN64) && !defined(WIN32)
|
||||
#define WIN32
|
||||
#endif
|
||||
#include <winsock2.h>
|
||||
#include <ws2tcpip.h>
|
||||
#if defined(__cplusplus) && defined(_MSC_VER)
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* We're not using Microsoft's "extensions" to C for
|
||||
* Structured Exception Handling (SEH) so we can nuke these
|
||||
*/
|
||||
#undef try
|
||||
#undef except
|
||||
#undef finally
|
||||
#undef leave
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <direct.h>
|
||||
#include <process.h>
|
||||
#include <time.h>
|
||||
#if defined(__cplusplus) && defined(_MSC_VER) && _MSC_VER == 1200
|
||||
extern "C++" { /* template without extern "C++" */
|
||||
#endif
|
||||
#include <math.h>
|
||||
#if defined(__cplusplus) && defined(_MSC_VER) && _MSC_VER == 1200
|
||||
}
|
||||
#endif
|
||||
#include <signal.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
#ifdef HAVE_SYS_UTIME_H
|
||||
# include <sys/utime.h>
|
||||
#else
|
||||
# include <utime.h>
|
||||
#endif
|
||||
#include <io.h>
|
||||
#include <malloc.h>
|
||||
#if defined __MINGW32__ || __BORLANDC__ >= 0x0580
|
||||
# include <stdint.h>
|
||||
#else
|
||||
# if !defined(_INTPTR_T_DEFINED)
|
||||
# ifdef _WIN64
|
||||
typedef __int64 intptr_t;
|
||||
# else
|
||||
typedef int intptr_t;
|
||||
# endif
|
||||
# define _INTPTR_T_DEFINED
|
||||
# endif
|
||||
# if !defined(_UINTPTR_T_DEFINED)
|
||||
# ifdef _WIN64
|
||||
typedef unsigned __int64 uintptr_t;
|
||||
# else
|
||||
typedef unsigned int uintptr_t;
|
||||
# endif
|
||||
# define _UINTPTR_T_DEFINED
|
||||
# endif
|
||||
#endif
|
||||
#ifndef __MINGW32__
|
||||
# define mode_t int
|
||||
#endif
|
||||
#ifdef HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
#define rb_w32_iswinnt() TRUE
|
||||
#define rb_w32_iswin95() FALSE
|
||||
|
||||
#define WNOHANG -1
|
||||
|
||||
#undef getc
|
||||
#undef putc
|
||||
#undef fgetc
|
||||
#undef fputc
|
||||
#undef getchar
|
||||
#undef putchar
|
||||
#undef fgetchar
|
||||
#undef fputchar
|
||||
#undef utime
|
||||
#undef lseek
|
||||
#undef stat
|
||||
#undef fstat
|
||||
#define getc(_stream) rb_w32_getc(_stream)
|
||||
#define getchar() rb_w32_getc(stdin)
|
||||
#define putc(_c, _stream) rb_w32_putc(_c, _stream)
|
||||
#define putchar(_c) rb_w32_putc(_c, stdout)
|
||||
#ifdef RUBY_EXPORT
|
||||
#define fgetc(_stream) getc(_stream)
|
||||
#define fputc(_c, _stream) putc(_c, _stream)
|
||||
#define fgetchar() getchar()
|
||||
#define fputchar(_c) putchar(_c)
|
||||
#define utime(_p, _t) rb_w32_utime(_p, _t)
|
||||
#define lseek(_f, _o, _w) _lseeki64(_f, _o, _w)
|
||||
|
||||
#define pipe(p) rb_w32_pipe(p)
|
||||
#define open rb_w32_open
|
||||
#define close(h) rb_w32_close(h)
|
||||
#define fclose(f) rb_w32_fclose(f)
|
||||
#define read(f, b, s) rb_w32_read(f, b, s)
|
||||
#define write(f, b, s) rb_w32_write(f, b, s)
|
||||
#define getpid() rb_w32_getpid()
|
||||
#define getppid() rb_w32_getppid()
|
||||
#define sleep(x) rb_w32_Sleep((x)*1000)
|
||||
#define Sleep(msec) (void)rb_w32_Sleep(msec)
|
||||
#define fstati64(fd,st) rb_w32_fstati64(fd,st)
|
||||
#ifdef __BORLANDC__
|
||||
#define creat(p, m) _creat(p, m)
|
||||
#define eof() _eof()
|
||||
#define filelength(h) _filelength(h)
|
||||
#define mktemp(t) _mktemp(t)
|
||||
#define tell(h) _tell(h)
|
||||
#define _open _sopen
|
||||
#define sopen _sopen
|
||||
#undef fopen
|
||||
#define fopen(p, m) rb_w32_fopen(p, m)
|
||||
#undef fdopen
|
||||
#define fdopen(h, m) rb_w32_fdopen(h, m)
|
||||
#undef fsopen
|
||||
#define fsopen(p, m, sh) rb_w32_fsopen(p, m, sh)
|
||||
#endif /* __BORLANDC__ */
|
||||
|
||||
#undef execv
|
||||
#define execv(path,argv) rb_w32_aspawn(P_OVERLAY,path,argv)
|
||||
#if !defined(__BORLANDC__)
|
||||
#undef isatty
|
||||
#define isatty(h) rb_w32_isatty(h)
|
||||
#endif /* __BORLANDC__ */
|
||||
|
||||
#undef mkdir
|
||||
#define mkdir(p, m) rb_w32_mkdir(p, m)
|
||||
#undef rmdir
|
||||
#define rmdir(p) rb_w32_rmdir(p)
|
||||
#undef unlink
|
||||
#define unlink(p) rb_w32_unlink(p)
|
||||
#endif /* RUBY_EXPORT */
|
||||
|
||||
#if SIZEOF_OFF_T == 8
|
||||
#define off_t __int64
|
||||
#define stat stati64
|
||||
#define fstat(fd,st) fstati64(fd,st)
|
||||
#if defined(__BORLANDC__)
|
||||
#define stati64(path, st) rb_w32_stati64(path, st)
|
||||
#elif !defined(_MSC_VER) || RT_VER < 80
|
||||
#define stati64 _stati64
|
||||
#ifndef _stati64
|
||||
#define _stati64(path, st) rb_w32_stati64(path, st)
|
||||
#endif
|
||||
#else
|
||||
#define stati64 _stat64
|
||||
#define _stat64(path, st) rb_w32_stati64(path, st)
|
||||
#endif
|
||||
#else
|
||||
#define stat(path,st) rb_w32_stat(path,st)
|
||||
#define fstat(fd,st) rb_w32_fstat(fd,st)
|
||||
extern int rb_w32_stat(const char *, struct stat *);
|
||||
extern int rb_w32_fstat(int, struct stat *);
|
||||
#endif
|
||||
#define access(path,mode) rb_w32_access(path,mode)
|
||||
|
||||
#define strcasecmp _stricmp
|
||||
#define strncasecmp _strnicmp
|
||||
#define fsync _commit
|
||||
|
||||
struct timezone;
|
||||
|
||||
#ifdef __MINGW32__
|
||||
#undef isascii
|
||||
#define isascii __isascii
|
||||
#endif
|
||||
|
||||
struct iovec {
|
||||
void *iov_base;
|
||||
size_t iov_len;
|
||||
};
|
||||
struct msghdr {
|
||||
void *msg_name;
|
||||
int msg_namelen;
|
||||
struct iovec *msg_iov;
|
||||
int msg_iovlen;
|
||||
void *msg_control;
|
||||
int msg_controllen;
|
||||
int msg_flags;
|
||||
};
|
||||
|
||||
extern DWORD rb_w32_osid(void);
|
||||
extern int rb_w32_cmdvector(const char *, char ***);
|
||||
extern rb_pid_t rb_w32_pipe_exec(const char *, const char *, int, int *, int *);
|
||||
extern int flock(int fd, int oper);
|
||||
extern int rb_w32_io_cancelable_p(int);
|
||||
extern int rb_w32_is_socket(int);
|
||||
extern int WSAAPI rb_w32_accept(int, struct sockaddr *, int *);
|
||||
extern int WSAAPI rb_w32_bind(int, const struct sockaddr *, int);
|
||||
extern int WSAAPI rb_w32_connect(int, const struct sockaddr *, int);
|
||||
extern void rb_w32_fdset(int, fd_set*);
|
||||
extern void rb_w32_fdclr(int, fd_set*);
|
||||
extern int rb_w32_fdisset(int, fd_set*);
|
||||
extern int WSAAPI rb_w32_select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
|
||||
extern int WSAAPI rb_w32_getpeername(int, struct sockaddr *, int *);
|
||||
extern int WSAAPI rb_w32_getsockname(int, struct sockaddr *, int *);
|
||||
extern int WSAAPI rb_w32_getsockopt(int, int, int, char *, int *);
|
||||
extern int WSAAPI rb_w32_ioctlsocket(int, long, u_long *);
|
||||
extern int WSAAPI rb_w32_listen(int, int);
|
||||
extern int WSAAPI rb_w32_recv(int, char *, int, int);
|
||||
extern int WSAAPI rb_w32_recvfrom(int, char *, int, int, struct sockaddr *, int *);
|
||||
extern int WSAAPI rb_w32_send(int, const char *, int, int);
|
||||
extern int WSAAPI rb_w32_sendto(int, const char *, int, int, const struct sockaddr *, int);
|
||||
extern int recvmsg(int, struct msghdr *, int);
|
||||
extern int sendmsg(int, const struct msghdr *, int);
|
||||
extern int WSAAPI rb_w32_setsockopt(int, int, int, const char *, int);
|
||||
extern int WSAAPI rb_w32_shutdown(int, int);
|
||||
extern int WSAAPI rb_w32_socket(int, int, int);
|
||||
extern SOCKET rb_w32_get_osfhandle(int);
|
||||
extern struct hostent *WSAAPI rb_w32_gethostbyaddr(const char *, int, int);
|
||||
extern struct hostent *WSAAPI rb_w32_gethostbyname(const char *);
|
||||
extern int WSAAPI rb_w32_gethostname(char *, int);
|
||||
extern struct protoent *WSAAPI rb_w32_getprotobyname(const char *);
|
||||
extern struct protoent *WSAAPI rb_w32_getprotobynumber(int);
|
||||
extern struct servent *WSAAPI rb_w32_getservbyname(const char *, const char *);
|
||||
extern struct servent *WSAAPI rb_w32_getservbyport(int, const char *);
|
||||
extern int rb_w32_socketpair(int, int, int, int *);
|
||||
extern char * rb_w32_getcwd(char *, int);
|
||||
extern char * rb_w32_ugetenv(const char *);
|
||||
extern char * rb_w32_getenv(const char *);
|
||||
extern int rb_w32_rename(const char *, const char *);
|
||||
extern int rb_w32_urename(const char *, const char *);
|
||||
extern char **rb_w32_get_environ(void);
|
||||
extern void rb_w32_free_environ(char **);
|
||||
extern int rb_w32_map_errno(DWORD);
|
||||
extern const char *WSAAPI rb_w32_inet_ntop(int,const void *,char *,size_t);
|
||||
extern DWORD rb_w32_osver(void);
|
||||
|
||||
extern int chown(const char *, int, int);
|
||||
extern int rb_w32_uchown(const char *, int, int);
|
||||
extern int link(const char *, const char *);
|
||||
extern int rb_w32_ulink(const char *, const char *);
|
||||
extern int gettimeofday(struct timeval *, struct timezone *);
|
||||
extern rb_pid_t waitpid (rb_pid_t, int *, int);
|
||||
extern rb_pid_t rb_w32_spawn(int, const char *, const char*);
|
||||
extern rb_pid_t rb_w32_aspawn(int, const char *, char *const *);
|
||||
extern rb_pid_t rb_w32_aspawn_flags(int, const char *, char *const *, DWORD);
|
||||
extern int kill(int, int);
|
||||
extern int fcntl(int, int, ...);
|
||||
extern rb_pid_t rb_w32_getpid(void);
|
||||
extern rb_pid_t rb_w32_getppid(void);
|
||||
#if !defined(__BORLANDC__)
|
||||
extern int rb_w32_isatty(int);
|
||||
#endif
|
||||
extern int rb_w32_uchdir(const char *);
|
||||
extern int rb_w32_mkdir(const char *, int);
|
||||
extern int rb_w32_umkdir(const char *, int);
|
||||
extern int rb_w32_rmdir(const char *);
|
||||
extern int rb_w32_urmdir(const char *);
|
||||
extern int rb_w32_unlink(const char *);
|
||||
extern int rb_w32_uunlink(const char *);
|
||||
extern int rb_w32_uchmod(const char *, int);
|
||||
extern int rb_w32_stati64(const char *, struct stati64 *);
|
||||
extern int rb_w32_ustati64(const char *, struct stati64 *);
|
||||
extern int rb_w32_access(const char *, int);
|
||||
extern int rb_w32_uaccess(const char *, int);
|
||||
extern char rb_w32_fd_is_text(int);
|
||||
extern int rb_w32_fstati64(int, struct stati64 *);
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
extern off_t _lseeki64(int, off_t, int);
|
||||
extern FILE *rb_w32_fopen(const char *, const char *);
|
||||
extern FILE *rb_w32_fdopen(int, const char *);
|
||||
extern FILE *rb_w32_fsopen(const char *, const char *, int);
|
||||
#endif
|
||||
|
||||
#include <float.h>
|
||||
#if !defined __MINGW32__ || defined __NO_ISOCEXT
|
||||
#ifndef isnan
|
||||
#define isnan(x) _isnan(x)
|
||||
#endif
|
||||
static inline int
|
||||
finite(double x)
|
||||
{
|
||||
return _finite(x);
|
||||
}
|
||||
#ifndef copysign
|
||||
#define copysign(a, b) _copysign(a, b)
|
||||
#endif
|
||||
static inline double
|
||||
scalb(double a, long b)
|
||||
{
|
||||
return _scalb(a, b);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !defined S_IFIFO && defined _S_IFIFO
|
||||
#define S_IFIFO _S_IFIFO
|
||||
#endif
|
||||
|
||||
#if 0 && defined __BORLANDC__
|
||||
#undef S_ISDIR
|
||||
#undef S_ISFIFO
|
||||
#undef S_ISBLK
|
||||
#undef S_ISCHR
|
||||
#undef S_ISREG
|
||||
#define S_ISDIR(m) (((unsigned short)(m) & S_IFMT) == S_IFDIR)
|
||||
#define S_ISFIFO(m) (((unsigned short)(m) & S_IFMT) == S_IFIFO)
|
||||
#define S_ISBLK(m) (((unsigned short)(m) & S_IFMT) == S_IFBLK)
|
||||
#define S_ISCHR(m) (((unsigned short)(m) & S_IFMT) == S_IFCHR)
|
||||
#define S_ISREG(m) (((unsigned short)(m) & S_IFMT) == S_IFREG)
|
||||
#endif
|
||||
|
||||
#if !defined S_IRUSR && !defined __MINGW32__
|
||||
#define S_IRUSR 0400
|
||||
#endif
|
||||
#ifndef S_IRGRP
|
||||
#define S_IRGRP 0040
|
||||
#endif
|
||||
#ifndef S_IROTH
|
||||
#define S_IROTH 0004
|
||||
#endif
|
||||
|
||||
#if !defined S_IWUSR && !defined __MINGW32__
|
||||
#define S_IWUSR 0200
|
||||
#endif
|
||||
#ifndef S_IWGRP
|
||||
#define S_IWGRP 0020
|
||||
#endif
|
||||
#ifndef S_IWOTH
|
||||
#define S_IWOTH 0002
|
||||
#endif
|
||||
|
||||
#if !defined S_IXUSR && !defined __MINGW32__
|
||||
#define S_IXUSR 0100
|
||||
#endif
|
||||
#ifndef S_IXGRP
|
||||
#define S_IXGRP 0010
|
||||
#endif
|
||||
#ifndef S_IXOTH
|
||||
#define S_IXOTH 0001
|
||||
#endif
|
||||
|
||||
/*
|
||||
* define this so we can do inplace editing
|
||||
*/
|
||||
|
||||
#define SUFFIX
|
||||
|
||||
extern int rb_w32_ftruncate(int fd, off_t length);
|
||||
extern int rb_w32_truncate(const char *path, off_t length);
|
||||
extern off_t rb_w32_ftello(FILE *stream);
|
||||
extern int rb_w32_fseeko(FILE *stream, off_t offset, int whence);
|
||||
|
||||
#undef HAVE_FTRUNCATE
|
||||
#define HAVE_FTRUNCATE 1
|
||||
#if defined HAVE_FTRUNCATE64
|
||||
#define ftruncate ftruncate64
|
||||
#else
|
||||
#define ftruncate rb_w32_ftruncate
|
||||
#endif
|
||||
|
||||
#undef HAVE_TRUNCATE
|
||||
#define HAVE_TRUNCATE 1
|
||||
#if defined HAVE_TRUNCATE64
|
||||
#define truncate truncate64
|
||||
#else
|
||||
#define truncate rb_w32_truncate
|
||||
#endif
|
||||
|
||||
#undef HAVE_FSEEKO
|
||||
#define HAVE_FSEEKO 1
|
||||
#if defined HAVE_FSEEKO64
|
||||
#define fseeko fseeko64
|
||||
#else
|
||||
#define fseeko rb_w32_fseeko
|
||||
#endif
|
||||
|
||||
#undef HAVE_FTELLO
|
||||
#define HAVE_FTELLO 1
|
||||
#if defined HAVE_FTELLO64
|
||||
#define ftello ftello64
|
||||
#else
|
||||
#define ftello rb_w32_ftello
|
||||
#endif
|
||||
|
||||
/*
|
||||
* stubs
|
||||
*/
|
||||
extern int ioctl (int, int, ...);
|
||||
extern rb_uid_t getuid (void);
|
||||
extern rb_uid_t geteuid (void);
|
||||
extern rb_gid_t getgid (void);
|
||||
extern rb_gid_t getegid (void);
|
||||
extern int setuid (rb_uid_t);
|
||||
extern int setgid (rb_gid_t);
|
||||
|
||||
extern char *rb_w32_strerror(int);
|
||||
|
||||
#ifdef RUBY_EXPORT
|
||||
#define strerror(e) rb_w32_strerror(e)
|
||||
#endif
|
||||
|
||||
#define PIPE_BUF 1024
|
||||
|
||||
#define LOCK_SH 1
|
||||
#define LOCK_EX 2
|
||||
#define LOCK_NB 4
|
||||
#define LOCK_UN 8
|
||||
|
||||
|
||||
#ifndef SIGINT
|
||||
#define SIGINT 2
|
||||
#endif
|
||||
#ifndef SIGKILL
|
||||
#define SIGKILL 9
|
||||
#endif
|
||||
|
||||
|
||||
/* #undef va_start */
|
||||
/* #undef va_end */
|
||||
|
||||
/* winsock error map */
|
||||
#include <errno.h>
|
||||
|
||||
#ifndef EWOULDBLOCK
|
||||
# define EWOULDBLOCK WSAEWOULDBLOCK
|
||||
#endif
|
||||
#ifndef EINPROGRESS
|
||||
# define EINPROGRESS WSAEINPROGRESS
|
||||
#endif
|
||||
#ifndef EALREADY
|
||||
# define EALREADY WSAEALREADY
|
||||
#endif
|
||||
#ifndef ENOTSOCK
|
||||
# define ENOTSOCK WSAENOTSOCK
|
||||
#endif
|
||||
#ifndef EDESTADDRREQ
|
||||
# define EDESTADDRREQ WSAEDESTADDRREQ
|
||||
#endif
|
||||
#ifndef EMSGSIZE
|
||||
# define EMSGSIZE WSAEMSGSIZE
|
||||
#endif
|
||||
#ifndef EPROTOTYPE
|
||||
# define EPROTOTYPE WSAEPROTOTYPE
|
||||
#endif
|
||||
#ifndef ENOPROTOOPT
|
||||
# define ENOPROTOOPT WSAENOPROTOOPT
|
||||
#endif
|
||||
#ifndef EPROTONOSUPPORT
|
||||
# define EPROTONOSUPPORT WSAEPROTONOSUPPORT
|
||||
#endif
|
||||
#ifndef ESOCKTNOSUPPORT
|
||||
# define ESOCKTNOSUPPORT WSAESOCKTNOSUPPORT
|
||||
#endif
|
||||
#ifndef EOPNOTSUPP
|
||||
# define EOPNOTSUPP WSAEOPNOTSUPP
|
||||
#endif
|
||||
#ifndef EPFNOSUPPORT
|
||||
# define EPFNOSUPPORT WSAEPFNOSUPPORT
|
||||
#endif
|
||||
#ifndef EAFNOSUPPORT
|
||||
# define EAFNOSUPPORT WSAEAFNOSUPPORT
|
||||
#endif
|
||||
#ifndef EADDRINUSE
|
||||
# define EADDRINUSE WSAEADDRINUSE
|
||||
#endif
|
||||
#ifndef EADDRNOTAVAIL
|
||||
# define EADDRNOTAVAIL WSAEADDRNOTAVAIL
|
||||
#endif
|
||||
#ifndef ENETDOWN
|
||||
# define ENETDOWN WSAENETDOWN
|
||||
#endif
|
||||
#ifndef ENETUNREACH
|
||||
# define ENETUNREACH WSAENETUNREACH
|
||||
#endif
|
||||
#ifndef ENETRESET
|
||||
# define ENETRESET WSAENETRESET
|
||||
#endif
|
||||
#ifndef ECONNABORTED
|
||||
# define ECONNABORTED WSAECONNABORTED
|
||||
#endif
|
||||
#ifndef ECONNRESET
|
||||
# define ECONNRESET WSAECONNRESET
|
||||
#endif
|
||||
#ifndef ENOBUFS
|
||||
# define ENOBUFS WSAENOBUFS
|
||||
#endif
|
||||
#ifndef EISCONN
|
||||
# define EISCONN WSAEISCONN
|
||||
#endif
|
||||
#ifndef ENOTCONN
|
||||
# define ENOTCONN WSAENOTCONN
|
||||
#endif
|
||||
#ifndef ESHUTDOWN
|
||||
# define ESHUTDOWN WSAESHUTDOWN
|
||||
#endif
|
||||
#ifndef ETOOMANYREFS
|
||||
# define ETOOMANYREFS WSAETOOMANYREFS
|
||||
#endif
|
||||
#ifndef ETIMEDOUT
|
||||
# define ETIMEDOUT WSAETIMEDOUT
|
||||
#endif
|
||||
#ifndef ECONNREFUSED
|
||||
# define ECONNREFUSED WSAECONNREFUSED
|
||||
#endif
|
||||
#ifndef ELOOP
|
||||
# define ELOOP WSAELOOP
|
||||
#endif
|
||||
/*#define ENAMETOOLONG WSAENAMETOOLONG*/
|
||||
#ifndef EHOSTDOWN
|
||||
# define EHOSTDOWN WSAEHOSTDOWN
|
||||
#endif
|
||||
#ifndef EHOSTUNREACH
|
||||
# define EHOSTUNREACH WSAEHOSTUNREACH
|
||||
#endif
|
||||
/*#define ENOTEMPTY WSAENOTEMPTY*/
|
||||
#ifndef EPROCLIM
|
||||
# define EPROCLIM WSAEPROCLIM
|
||||
#endif
|
||||
#ifndef EUSERS
|
||||
# define EUSERS WSAEUSERS
|
||||
#endif
|
||||
#ifndef EDQUOT
|
||||
# define EDQUOT WSAEDQUOT
|
||||
#endif
|
||||
#ifndef ESTALE
|
||||
# define ESTALE WSAESTALE
|
||||
#endif
|
||||
#ifndef EREMOTE
|
||||
# define EREMOTE WSAEREMOTE
|
||||
#endif
|
||||
|
||||
#define F_DUPFD 0
|
||||
#if 0
|
||||
#define F_GETFD 1
|
||||
#define F_SETFD 2
|
||||
#define F_GETFL 3
|
||||
#endif
|
||||
#define F_SETFL 4
|
||||
#if 0
|
||||
#define FD_CLOEXEC 1 /* F_GETFD, F_SETFD */
|
||||
#endif
|
||||
#define O_NONBLOCK 1
|
||||
|
||||
#undef FD_SET
|
||||
#define FD_SET(fd, set) do {\
|
||||
unsigned int i;\
|
||||
SOCKET s = _get_osfhandle(fd);\
|
||||
\
|
||||
for (i = 0; i < (set)->fd_count; i++) {\
|
||||
if ((set)->fd_array[i] == s) {\
|
||||
break;\
|
||||
}\
|
||||
}\
|
||||
if (i == (set)->fd_count) {\
|
||||
if ((set)->fd_count < FD_SETSIZE) {\
|
||||
(set)->fd_array[i] = s;\
|
||||
(set)->fd_count++;\
|
||||
}\
|
||||
}\
|
||||
} while(0)
|
||||
|
||||
#undef FD_CLR
|
||||
#define FD_CLR(f, s) rb_w32_fdclr(f, s)
|
||||
|
||||
#undef FD_ISSET
|
||||
#define FD_ISSET(f, s) rb_w32_fdisset(f, s)
|
||||
|
||||
#ifdef RUBY_EXPORT
|
||||
#undef inet_ntop
|
||||
#define inet_ntop(f,a,n,l) rb_w32_inet_ntop(f,a,n,l)
|
||||
|
||||
#undef accept
|
||||
#define accept(s, a, l) rb_w32_accept(s, a, l)
|
||||
|
||||
#undef bind
|
||||
#define bind(s, a, l) rb_w32_bind(s, a, l)
|
||||
|
||||
#undef connect
|
||||
#define connect(s, a, l) rb_w32_connect(s, a, l)
|
||||
|
||||
#undef select
|
||||
#define select(n, r, w, e, t) rb_w32_select(n, r, w, e, t)
|
||||
|
||||
#undef getpeername
|
||||
#define getpeername(s, a, l) rb_w32_getpeername(s, a, l)
|
||||
|
||||
#undef getsockname
|
||||
#define getsockname(s, a, l) rb_w32_getsockname(s, a, l)
|
||||
|
||||
#undef getsockopt
|
||||
#define getsockopt(s, v, n, o, l) rb_w32_getsockopt(s, v, n, o, l)
|
||||
|
||||
#undef ioctlsocket
|
||||
#define ioctlsocket(s, c, a) rb_w32_ioctlsocket(s, c, a)
|
||||
|
||||
#undef listen
|
||||
#define listen(s, b) rb_w32_listen(s, b)
|
||||
|
||||
#undef recv
|
||||
#define recv(s, b, l, f) rb_w32_recv(s, b, l, f)
|
||||
|
||||
#undef recvfrom
|
||||
#define recvfrom(s, b, l, f, fr, frl) rb_w32_recvfrom(s, b, l, f, fr, frl)
|
||||
|
||||
#undef send
|
||||
#define send(s, b, l, f) rb_w32_send(s, b, l, f)
|
||||
|
||||
#undef sendto
|
||||
#define sendto(s, b, l, f, t, tl) rb_w32_sendto(s, b, l, f, t, tl)
|
||||
|
||||
#undef setsockopt
|
||||
#define setsockopt(s, v, n, o, l) rb_w32_setsockopt(s, v, n, o, l)
|
||||
|
||||
#undef shutdown
|
||||
#define shutdown(s, h) rb_w32_shutdown(s, h)
|
||||
|
||||
#undef socket
|
||||
#define socket(s, t, p) rb_w32_socket(s, t, p)
|
||||
|
||||
#undef gethostbyaddr
|
||||
#define gethostbyaddr(a, l, t) rb_w32_gethostbyaddr(a, l, t)
|
||||
|
||||
#undef gethostbyname
|
||||
#define gethostbyname(n) rb_w32_gethostbyname(n)
|
||||
|
||||
#undef gethostname
|
||||
#define gethostname(n, l) rb_w32_gethostname(n, l)
|
||||
|
||||
#undef getprotobyname
|
||||
#define getprotobyname(n) rb_w32_getprotobyname(n)
|
||||
|
||||
#undef getprotobynumber
|
||||
#define getprotobynumber(n) rb_w32_getprotobynumber(n)
|
||||
|
||||
#undef getservbyname
|
||||
#define getservbyname(n, p) rb_w32_getservbyname(n, p)
|
||||
|
||||
#undef getservbyport
|
||||
#define getservbyport(p, pr) rb_w32_getservbyport(p, pr)
|
||||
|
||||
#undef socketpair
|
||||
#define socketpair(a, t, p, s) rb_w32_socketpair(a, t, p, s)
|
||||
|
||||
#undef get_osfhandle
|
||||
#define get_osfhandle(h) rb_w32_get_osfhandle(h)
|
||||
|
||||
#undef getcwd
|
||||
#define getcwd(b, s) rb_w32_getcwd(b, s)
|
||||
|
||||
#undef getenv
|
||||
#define getenv(n) rb_w32_getenv(n)
|
||||
|
||||
#undef rename
|
||||
#define rename(o, n) rb_w32_rename(o, n)
|
||||
|
||||
#undef times
|
||||
#define times(t) rb_w32_times(t)
|
||||
#endif
|
||||
|
||||
struct tms {
|
||||
long tms_utime;
|
||||
long tms_stime;
|
||||
long tms_cutime;
|
||||
long tms_cstime;
|
||||
};
|
||||
|
||||
int rb_w32_times(struct tms *);
|
||||
|
||||
struct tm *gmtime_r(const time_t *, struct tm *);
|
||||
struct tm *localtime_r(const time_t *, struct tm *);
|
||||
|
||||
/* thread stuff */
|
||||
int rb_w32_sleep(unsigned long msec);
|
||||
int rb_w32_putc(int, FILE*);
|
||||
int rb_w32_getc(FILE*);
|
||||
int rb_w32_open(const char *, int, ...);
|
||||
int rb_w32_uopen(const char *, int, ...);
|
||||
int rb_w32_wopen(const WCHAR *, int, ...);
|
||||
int rb_w32_close(int);
|
||||
int rb_w32_fclose(FILE*);
|
||||
int rb_w32_pipe(int[2]);
|
||||
ssize_t rb_w32_read(int, void *, size_t);
|
||||
ssize_t rb_w32_write(int, const void *, size_t);
|
||||
int rb_w32_utime(const char *, const struct utimbuf *);
|
||||
int rb_w32_uutime(const char *, const struct utimbuf *);
|
||||
long rb_w32_write_console(uintptr_t, int); /* use uintptr_t instead of VALUE because it's not defined yet here */
|
||||
int WINAPI rb_w32_Sleep(unsigned long msec);
|
||||
int rb_w32_wait_events_blocking(HANDLE *events, int num, DWORD timeout);
|
||||
int rb_w32_time_subtract(struct timeval *rest, const struct timeval *wait);
|
||||
int rb_w32_wrap_io_handle(HANDLE, int);
|
||||
int rb_w32_unwrap_io_handle(int);
|
||||
|
||||
/*
|
||||
== ***CAUTION***
|
||||
Since this function is very dangerous, ((*NEVER*))
|
||||
* lock any HANDLEs(i.e. Mutex, Semaphore, CriticalSection and so on) or,
|
||||
* use anything like TRAP_BEG...TRAP_END block structure,
|
||||
in asynchronous_func_t.
|
||||
*/
|
||||
typedef uintptr_t (*asynchronous_func_t)(uintptr_t self, int argc, uintptr_t* argv);
|
||||
uintptr_t rb_w32_asynchronize(asynchronous_func_t func, uintptr_t self, int argc, uintptr_t* argv, uintptr_t intrval);
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility pop
|
||||
#endif
|
||||
|
||||
#ifdef __MINGW_ATTRIB_PURE
|
||||
/* License: Ruby's */
|
||||
/* get rid of bugs in math.h of mingw */
|
||||
#define frexp(_X, _Y) __extension__ ({\
|
||||
int intpart_frexp_bug = intpart_frexp_bug;\
|
||||
double result_frexp_bug = frexp((_X), &intpart_frexp_bug);\
|
||||
*(_Y) = intpart_frexp_bug;\
|
||||
result_frexp_bug;\
|
||||
})
|
||||
/* License: Ruby's */
|
||||
#define modf(_X, _Y) __extension__ ({\
|
||||
double intpart_modf_bug = intpart_modf_bug;\
|
||||
double result_modf_bug = modf((_X), &intpart_modf_bug);\
|
||||
*(_Y) = intpart_modf_bug;\
|
||||
result_modf_bug;\
|
||||
})
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
#if 0
|
||||
{ /* satisfy cc-mode */
|
||||
#endif
|
||||
} /* extern "C" { */
|
||||
#endif
|
||||
|
||||
#if defined(__MINGW64__)
|
||||
/*
|
||||
* Use powl() instead of broken pow() of x86_64-w64-mingw32.
|
||||
* This workaround will fix test failures in test_bignum.rb,
|
||||
* test_fixnum.rb and test_float.rb etc.
|
||||
*/
|
||||
static inline double
|
||||
rb_w32_pow(double x, double y)
|
||||
{
|
||||
return powl(x, y);
|
||||
}
|
||||
#elif defined(__MINGW64_VERSION_MAJOR)
|
||||
/*
|
||||
* Set floating point precision for pow() of mingw-w64 x86.
|
||||
* With default precision the result is not proper on WinXP.
|
||||
*/
|
||||
static inline double
|
||||
rb_w32_pow(double x, double y)
|
||||
{
|
||||
double r;
|
||||
unsigned int default_control = _controlfp(0, 0);
|
||||
_controlfp(_PC_64, _MCW_PC);
|
||||
r = pow(x, y);
|
||||
/* Restore setting */
|
||||
_controlfp(default_control, _MCW_PC);
|
||||
return r;
|
||||
}
|
||||
#endif
|
||||
#if defined(__MINGW64_VERSION_MAJOR) || defined(__MINGW64__)
|
||||
#define pow rb_w32_pow
|
||||
#endif
|
||||
|
||||
#endif /* RUBY_WIN32_H */
|
||||
@@ -1,35 +0,0 @@
|
||||
/**********************************************************************
|
||||
|
||||
ruby.h -
|
||||
|
||||
$Author$
|
||||
created at: Sun 10 12:06:15 Jun JST 2007
|
||||
|
||||
Copyright (C) 2007-2008 Yukihiro Matsumoto
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef RUBY_H
|
||||
#define RUBY_H 1
|
||||
|
||||
#define HAVE_RUBY_DEFINES_H 1
|
||||
#define HAVE_RUBY_ENCODING_H 1
|
||||
#define HAVE_RUBY_INTERN_H 1
|
||||
#define HAVE_RUBY_IO_H 1
|
||||
#define HAVE_RUBY_MISSING_H 1
|
||||
#define HAVE_RUBY_ONIGURUMA_H 1
|
||||
#define HAVE_RUBY_RE_H 1
|
||||
#define HAVE_RUBY_REGEX_H 1
|
||||
#define HAVE_RUBY_RUBY_H 1
|
||||
#define HAVE_RUBY_ST_H 1
|
||||
#define HAVE_RUBY_THREAD_H 1
|
||||
#define HAVE_RUBY_UTIL_H 1
|
||||
#define HAVE_RUBY_VERSION_H 1
|
||||
#define HAVE_RUBY_VM_H 1
|
||||
#ifdef _WIN32
|
||||
#define HAVE_RUBY_WIN32_H 1
|
||||
#endif
|
||||
|
||||
#include "ruby/ruby.h"
|
||||
|
||||
#endif /* RUBY_H */
|
||||
@@ -1,18 +0,0 @@
|
||||
#if defined __GNUC__
|
||||
#warning use of RClass internals is deprecated
|
||||
#elif defined _MSC_VER || defined __BORLANDC__
|
||||
#pragma message("warning: use of RClass internals is deprecated")
|
||||
#endif
|
||||
|
||||
#ifndef RUBY_BACKWARD_CLASSEXT_H
|
||||
#define RUBY_BACKWARD_CLASSEXT_H 1
|
||||
|
||||
typedef struct rb_deprecated_classext_struct {
|
||||
VALUE super;
|
||||
} rb_deprecated_classext_t;
|
||||
|
||||
#undef RCLASS_SUPER(c)
|
||||
#define RCLASS_EXT(c) ((rb_deprecated_classext_t *)RCLASS(c)->ptr)
|
||||
#define RCLASS_SUPER(c) (RCLASS_EXT(c)->super)
|
||||
|
||||
#endif /* RUBY_BACKWARD_CLASSEXT_H */
|
||||
@@ -1,6 +0,0 @@
|
||||
#if defined __GNUC__
|
||||
#warning use "ruby/io.h" instead of "rubyio.h"
|
||||
#elif defined _MSC_VER || defined __BORLANDC__
|
||||
#pragma message("warning: use \"ruby/io.h\" instead of \"rubyio.h\"")
|
||||
#endif
|
||||
#include "ruby/io.h"
|
||||
@@ -1,56 +0,0 @@
|
||||
/**********************************************************************
|
||||
|
||||
rubysig.h -
|
||||
|
||||
$Author: nobu $
|
||||
$Date: 2012-06-19 18:43:53 +0900 (Tue, 19 Jun 2012) $
|
||||
created at: Wed Aug 16 01:15:38 JST 1995
|
||||
|
||||
Copyright (C) 1993-2008 Yukihiro Matsumoto
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#if defined __GNUC__
|
||||
#warning rubysig.h is obsolete
|
||||
#elif defined _MSC_VER || defined __BORLANDC__
|
||||
#pragma message("warning: rubysig.h is obsolete")
|
||||
#endif
|
||||
|
||||
#ifndef RUBYSIG_H
|
||||
#define RUBYSIG_H
|
||||
#include "ruby/ruby.h"
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#if 0
|
||||
} /* satisfy cc-mode */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility push(default)
|
||||
#endif
|
||||
|
||||
struct rb_blocking_region_buffer;
|
||||
DEPRECATED(RUBY_EXTERN struct rb_blocking_region_buffer *rb_thread_blocking_region_begin(void));
|
||||
DEPRECATED(RUBY_EXTERN void rb_thread_blocking_region_end(struct rb_blocking_region_buffer *));
|
||||
#define TRAP_BEG do {struct rb_blocking_region_buffer *__region = rb_thread_blocking_region_begin();
|
||||
#define TRAP_END rb_thread_blocking_region_end(__region);} while (0)
|
||||
#define RUBY_CRITICAL(statements) do {statements;} while (0)
|
||||
#define DEFER_INTS (0)
|
||||
#define ENABLE_INTS (1)
|
||||
#define ALLOW_INTS do {CHECK_INTS;} while (0)
|
||||
#define CHECK_INTS rb_thread_check_ints()
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility pop
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
#if 0
|
||||
{ /* satisfy cc-mode */
|
||||
#endif
|
||||
} /* extern "C" { */
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -1,6 +0,0 @@
|
||||
#if defined __GNUC__
|
||||
#warning use "ruby/st.h" instead of bare "st.h"
|
||||
#elif defined _MSC_VER || defined __BORLANDC__
|
||||
#pragma message("warning: use \"ruby/st.h\" instead of bare \"st.h\"")
|
||||
#endif
|
||||
#include "ruby/st.h"
|
||||
@@ -1,6 +0,0 @@
|
||||
#if defined __GNUC__
|
||||
#warning use "ruby/util.h" instead of bare "util.h"
|
||||
#elif defined _MSC_VER || defined __BORLANDC__
|
||||
#pragma message("warning: use \"ruby/util.h\" instead of bare \"util.h\"")
|
||||
#endif
|
||||
#include "ruby/util.h"
|
||||
@@ -1,93 +0,0 @@
|
||||
/**********************************************************************
|
||||
|
||||
ruby/debug.h -
|
||||
|
||||
$Author: ko1 $
|
||||
created at: Tue Nov 20 20:35:08 2012
|
||||
|
||||
Copyright (C) 2012 Yukihiro Matsumoto
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef RB_DEBUG_H
|
||||
#define RB_DEBUG_H 1
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#if 0
|
||||
} /* satisfy cc-mode */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility push(default)
|
||||
#endif
|
||||
|
||||
/* Note: This file contains experimental APIs. */
|
||||
/* APIs can be replaced at Ruby 2.0.1 or later */
|
||||
|
||||
/* debug inspector APIs */
|
||||
typedef struct rb_debug_inspector_struct rb_debug_inspector_t;
|
||||
typedef VALUE (*rb_debug_inspector_func_t)(const rb_debug_inspector_t *, void *);
|
||||
|
||||
VALUE rb_debug_inspector_open(rb_debug_inspector_func_t func, void *data);
|
||||
VALUE rb_debug_inspector_frame_self_get(const rb_debug_inspector_t *dc, long index);
|
||||
VALUE rb_debug_inspector_frame_class_get(const rb_debug_inspector_t *dc, long index);
|
||||
VALUE rb_debug_inspector_frame_binding_get(const rb_debug_inspector_t *dc, long index);
|
||||
VALUE rb_debug_inspector_frame_iseq_get(const rb_debug_inspector_t *dc, long index);
|
||||
VALUE rb_debug_inspector_backtrace_locations(const rb_debug_inspector_t *dc);
|
||||
|
||||
/* Old style set_trace_func APIs */
|
||||
|
||||
/* duplicated def of include/ruby/ruby.h */
|
||||
void rb_add_event_hook(rb_event_hook_func_t func, rb_event_flag_t events, VALUE data);
|
||||
int rb_remove_event_hook(rb_event_hook_func_t func);
|
||||
|
||||
int rb_remove_event_hook_with_data(rb_event_hook_func_t func, VALUE data);
|
||||
void rb_thread_add_event_hook(VALUE thval, rb_event_hook_func_t func, rb_event_flag_t events, VALUE data);
|
||||
int rb_thread_remove_event_hook(VALUE thval, rb_event_hook_func_t func);
|
||||
int rb_thread_remove_event_hook_with_data(VALUE thval, rb_event_hook_func_t func, VALUE data);
|
||||
|
||||
/* TracePoint APIs */
|
||||
|
||||
VALUE rb_tracepoint_new(VALUE target_thread_not_supported_yet, rb_event_flag_t events, void (*func)(VALUE, void *), void *data);
|
||||
VALUE rb_tracepoint_enable(VALUE tpval);
|
||||
VALUE rb_tracepoint_disable(VALUE tpval);
|
||||
VALUE rb_tracepoint_enabled_p(VALUE tpval);
|
||||
|
||||
typedef struct rb_trace_arg_struct rb_trace_arg_t;
|
||||
rb_trace_arg_t *rb_tracearg_from_tracepoint(VALUE tpval);
|
||||
|
||||
VALUE rb_tracearg_event(rb_trace_arg_t *trace_arg);
|
||||
VALUE rb_tracearg_lineno(rb_trace_arg_t *trace_arg);
|
||||
VALUE rb_tracearg_path(rb_trace_arg_t *trace_arg);
|
||||
VALUE rb_tracearg_method_id(rb_trace_arg_t *trace_arg);
|
||||
VALUE rb_tracearg_defined_class(rb_trace_arg_t *trace_arg);
|
||||
VALUE rb_tracearg_binding(rb_trace_arg_t *trace_arg);
|
||||
VALUE rb_tracearg_self(rb_trace_arg_t *trace_arg);
|
||||
VALUE rb_tracearg_return_value(rb_trace_arg_t *trace_arg);
|
||||
VALUE rb_tracearg_raised_exception(rb_trace_arg_t *trace_arg);
|
||||
|
||||
/* undocumented advanced tracing APIs */
|
||||
|
||||
typedef enum {
|
||||
RUBY_EVENT_HOOK_FLAG_SAFE = 0x01,
|
||||
RUBY_EVENT_HOOK_FLAG_DELETED = 0x02,
|
||||
RUBY_EVENT_HOOK_FLAG_RAW_ARG = 0x04
|
||||
} rb_event_hook_flag_t;
|
||||
|
||||
void rb_add_event_hook2(rb_event_hook_func_t func, rb_event_flag_t events, VALUE data, rb_event_hook_flag_t hook_flag);
|
||||
void rb_thread_add_event_hook2(VALUE thval, rb_event_hook_func_t func, rb_event_flag_t events, VALUE data, rb_event_hook_flag_t hook_flag);
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility pop
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
#if 0
|
||||
{ /* satisfy cc-mode */
|
||||
#endif
|
||||
} /* extern "C" { */
|
||||
#endif
|
||||
|
||||
#endif /* RUBY_DEBUG_H */
|
||||
@@ -1,264 +0,0 @@
|
||||
/************************************************
|
||||
|
||||
defines.h -
|
||||
|
||||
$Author: ngoto $
|
||||
created at: Wed May 18 00:21:44 JST 1994
|
||||
|
||||
************************************************/
|
||||
|
||||
#ifndef RUBY_DEFINES_H
|
||||
#define RUBY_DEFINES_H 1
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#if 0
|
||||
} /* satisfy cc-mode */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "ruby/config.h"
|
||||
#ifdef RUBY_EXTCONF_H
|
||||
#include RUBY_EXTCONF_H
|
||||
#endif
|
||||
|
||||
#define RUBY
|
||||
|
||||
# include <stddef.h>
|
||||
#ifdef HAVE_STDLIB_H
|
||||
# include <stdlib.h>
|
||||
#endif
|
||||
#ifdef __cplusplus
|
||||
# ifndef HAVE_PROTOTYPES
|
||||
# define HAVE_PROTOTYPES 1
|
||||
# endif
|
||||
# ifndef HAVE_STDARG_PROTOTYPES
|
||||
# define HAVE_STDARG_PROTOTYPES 1
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#undef _
|
||||
#ifdef HAVE_PROTOTYPES
|
||||
# define _(args) args
|
||||
#else
|
||||
# define _(args) ()
|
||||
#endif
|
||||
|
||||
#undef __
|
||||
#ifdef HAVE_STDARG_PROTOTYPES
|
||||
# define __(args) args
|
||||
#else
|
||||
# define __(args) ()
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define ANYARGS ...
|
||||
#else
|
||||
#define ANYARGS
|
||||
#endif
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility push(default)
|
||||
#endif
|
||||
|
||||
#define xmalloc ruby_xmalloc
|
||||
#define xmalloc2 ruby_xmalloc2
|
||||
#define xcalloc ruby_xcalloc
|
||||
#define xrealloc ruby_xrealloc
|
||||
#define xrealloc2 ruby_xrealloc2
|
||||
#define xfree ruby_xfree
|
||||
|
||||
void *xmalloc(size_t);
|
||||
void *xmalloc2(size_t,size_t);
|
||||
void *xcalloc(size_t,size_t);
|
||||
void *xrealloc(void*,size_t);
|
||||
void *xrealloc2(void*,size_t,size_t);
|
||||
void xfree(void*);
|
||||
|
||||
#define STRINGIZE(expr) STRINGIZE0(expr)
|
||||
#ifndef STRINGIZE0
|
||||
#define STRINGIZE0(expr) #expr
|
||||
#endif
|
||||
|
||||
#if SIZEOF_LONG_LONG > 0
|
||||
# define LONG_LONG long long
|
||||
#elif SIZEOF___INT64 > 0
|
||||
# define HAVE_LONG_LONG 1
|
||||
# define LONG_LONG __int64
|
||||
# undef SIZEOF_LONG_LONG
|
||||
# define SIZEOF_LONG_LONG SIZEOF___INT64
|
||||
#endif
|
||||
|
||||
#if SIZEOF_INT*2 <= SIZEOF_LONG_LONG
|
||||
# define BDIGIT unsigned int
|
||||
# define SIZEOF_BDIGITS SIZEOF_INT
|
||||
# define BDIGIT_DBL unsigned LONG_LONG
|
||||
# define BDIGIT_DBL_SIGNED LONG_LONG
|
||||
# define PRI_BDIGIT_PREFIX ""
|
||||
# define PRI_BDIGIT_DBL_PREFIX PRI_LL_PREFIX
|
||||
#elif SIZEOF_INT*2 <= SIZEOF_LONG
|
||||
# define BDIGIT unsigned int
|
||||
# define SIZEOF_BDIGITS SIZEOF_INT
|
||||
# define BDIGIT_DBL unsigned long
|
||||
# define BDIGIT_DBL_SIGNED long
|
||||
# define PRI_BDIGIT_PREFIX ""
|
||||
# define PRI_BDIGIT_DBL_PREFIX "l"
|
||||
#elif SIZEOF_SHORT*2 <= SIZEOF_LONG
|
||||
# define BDIGIT unsigned short
|
||||
# define SIZEOF_BDIGITS SIZEOF_SHORT
|
||||
# define BDIGIT_DBL unsigned long
|
||||
# define BDIGIT_DBL_SIGNED long
|
||||
# define PRI_BDIGIT_PREFIX "h"
|
||||
# define PRI_BDIGIT_DBL_PREFIX "l"
|
||||
#else
|
||||
# define BDIGIT unsigned short
|
||||
# define SIZEOF_BDIGITS (SIZEOF_LONG/2)
|
||||
# define BDIGIT_DBL unsigned long
|
||||
# define BDIGIT_DBL_SIGNED long
|
||||
# define PRI_BDIGIT_PREFIX "h"
|
||||
# define PRI_BDIGIT_DBL_PREFIX "l"
|
||||
#endif
|
||||
|
||||
#define PRIdBDIGIT PRI_BDIGIT_PREFIX"d"
|
||||
#define PRIiBDIGIT PRI_BDIGIT_PREFIX"i"
|
||||
#define PRIoBDIGIT PRI_BDIGIT_PREFIX"o"
|
||||
#define PRIuBDIGIT PRI_BDIGIT_PREFIX"u"
|
||||
#define PRIxBDIGIT PRI_BDIGIT_PREFIX"x"
|
||||
#define PRIXBDIGIT PRI_BDIGIT_PREFIX"X"
|
||||
|
||||
#define PRIdBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"d"
|
||||
#define PRIiBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"i"
|
||||
#define PRIoBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"o"
|
||||
#define PRIuBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"u"
|
||||
#define PRIxBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"x"
|
||||
#define PRIXBDIGIT_DBL PRI_BDIGIT_DBL_PREFIX"X"
|
||||
|
||||
#ifdef __CYGWIN__
|
||||
#undef _WIN32
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32) || defined(__EMX__)
|
||||
#define DOSISH 1
|
||||
# define DOSISH_DRIVE_LETTER
|
||||
#endif
|
||||
|
||||
#ifdef AC_APPLE_UNIVERSAL_BUILD
|
||||
#undef WORDS_BIGENDIAN
|
||||
#ifdef __BIG_ENDIAN__
|
||||
#define WORDS_BIGENDIAN
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
#include "ruby/win32.h"
|
||||
#endif
|
||||
|
||||
#if defined(__BEOS__) && !defined(__HAIKU__) && !defined(BONE)
|
||||
#include <net/socket.h> /* intern.h needs fd_set definition */
|
||||
#elif defined (__SYMBIAN32__) && defined (HAVE_SYS_SELECT_H)
|
||||
# include <sys/select.h>
|
||||
#endif
|
||||
|
||||
#ifdef __SYMBIAN32__
|
||||
# define FALSE 0
|
||||
# define TRUE 1
|
||||
#endif
|
||||
|
||||
#ifdef RUBY_EXPORT
|
||||
#undef RUBY_EXTERN
|
||||
|
||||
#ifndef FALSE
|
||||
# define FALSE 0
|
||||
#elif FALSE
|
||||
# error FALSE must be false
|
||||
#endif
|
||||
#ifndef TRUE
|
||||
# define TRUE 1
|
||||
#elif !TRUE
|
||||
# error TRUE must be true
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef RUBY_FUNC_EXPORTED
|
||||
#define RUBY_FUNC_EXPORTED
|
||||
#endif
|
||||
|
||||
#ifndef RUBY_EXTERN
|
||||
#define RUBY_EXTERN extern
|
||||
#endif
|
||||
|
||||
#ifndef EXTERN
|
||||
#define EXTERN RUBY_EXTERN /* deprecated */
|
||||
#endif
|
||||
|
||||
#ifndef RUBY_MBCHAR_MAXSIZE
|
||||
#define RUBY_MBCHAR_MAXSIZE INT_MAX
|
||||
/* MB_CUR_MAX will not work well in C locale */
|
||||
#endif
|
||||
|
||||
#if defined(__sparc)
|
||||
void rb_sparc_flush_register_windows(void);
|
||||
# define FLUSH_REGISTER_WINDOWS rb_sparc_flush_register_windows()
|
||||
#elif defined(__ia64)
|
||||
void *rb_ia64_bsp(void);
|
||||
void rb_ia64_flushrs(void);
|
||||
# define FLUSH_REGISTER_WINDOWS rb_ia64_flushrs()
|
||||
#else
|
||||
# define FLUSH_REGISTER_WINDOWS ((void)0)
|
||||
#endif
|
||||
|
||||
#if defined(DOSISH)
|
||||
#define PATH_SEP ";"
|
||||
#else
|
||||
#define PATH_SEP ":"
|
||||
#endif
|
||||
#define PATH_SEP_CHAR PATH_SEP[0]
|
||||
|
||||
#define PATH_ENV "PATH"
|
||||
|
||||
#if defined(DOSISH) && !defined(__EMX__)
|
||||
#define ENV_IGNORECASE
|
||||
#endif
|
||||
|
||||
#ifndef CASEFOLD_FILESYSTEM
|
||||
# if defined DOSISH
|
||||
# define CASEFOLD_FILESYSTEM 1
|
||||
# else
|
||||
# define CASEFOLD_FILESYSTEM 0
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef DLEXT_MAXLEN
|
||||
#define DLEXT_MAXLEN 4
|
||||
#endif
|
||||
|
||||
#ifndef RUBY_PLATFORM
|
||||
#define RUBY_PLATFORM "unknown-unknown"
|
||||
#endif
|
||||
|
||||
#ifndef RUBY_ALIAS_FUNCTION_TYPE
|
||||
#define RUBY_ALIAS_FUNCTION_TYPE(type, prot, name, args) \
|
||||
type prot {return name args;}
|
||||
#endif
|
||||
#ifndef RUBY_ALIAS_FUNCTION_VOID
|
||||
#define RUBY_ALIAS_FUNCTION_VOID(prot, name, args) \
|
||||
void prot {name args;}
|
||||
#endif
|
||||
#ifndef RUBY_ALIAS_FUNCTION
|
||||
#define RUBY_ALIAS_FUNCTION(prot, name, args) \
|
||||
RUBY_ALIAS_FUNCTION_TYPE(VALUE, prot, name, args)
|
||||
#endif
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility pop
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
#if 0
|
||||
{ /* satisfy cc-mode */
|
||||
#endif
|
||||
} /* extern "C" { */
|
||||
#endif
|
||||
|
||||
#endif /* RUBY_DEFINES_H */
|
||||
@@ -1,32 +0,0 @@
|
||||
/************************************************
|
||||
|
||||
digest.h - header file for ruby digest modules
|
||||
|
||||
$Author: akr $
|
||||
created at: Fri May 25 08:54:56 JST 2001
|
||||
|
||||
|
||||
Copyright (C) 2001-2006 Akinori MUSHA
|
||||
|
||||
$RoughId: digest.h,v 1.3 2001/07/13 15:38:27 knu Exp $
|
||||
$Id: digest.h 25189 2009-10-02 12:04:37Z akr $
|
||||
|
||||
************************************************/
|
||||
|
||||
#include "ruby.h"
|
||||
|
||||
#define RUBY_DIGEST_API_VERSION 2
|
||||
|
||||
typedef void (*rb_digest_hash_init_func_t)(void *);
|
||||
typedef void (*rb_digest_hash_update_func_t)(void *, unsigned char *, size_t);
|
||||
typedef void (*rb_digest_hash_finish_func_t)(void *, unsigned char *);
|
||||
|
||||
typedef struct {
|
||||
int api_version;
|
||||
size_t digest_len;
|
||||
size_t block_len;
|
||||
size_t ctx_size;
|
||||
rb_digest_hash_init_func_t init_func;
|
||||
rb_digest_hash_update_func_t update_func;
|
||||
rb_digest_hash_finish_func_t finish_func;
|
||||
} rb_digest_metadata_t;
|
||||
@@ -1,217 +0,0 @@
|
||||
#ifndef RUBY_DL_H
|
||||
#define RUBY_DL_H
|
||||
|
||||
#include <ruby.h>
|
||||
|
||||
#if !defined(FUNC_CDECL)
|
||||
# define FUNC_CDECL(x) x
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_DLFCN_H)
|
||||
# include <dlfcn.h>
|
||||
# /* some stranger systems may not define all of these */
|
||||
#ifndef RTLD_LAZY
|
||||
#define RTLD_LAZY 0
|
||||
#endif
|
||||
#ifndef RTLD_GLOBAL
|
||||
#define RTLD_GLOBAL 0
|
||||
#endif
|
||||
#ifndef RTLD_NOW
|
||||
#define RTLD_NOW 0
|
||||
#endif
|
||||
#else
|
||||
# if defined(_WIN32)
|
||||
# include <windows.h>
|
||||
# define dlopen(name,flag) ((void*)LoadLibrary(name))
|
||||
# define dlerror() strerror(rb_w32_map_errno(GetLastError()))
|
||||
# define dlsym(handle,name) ((void*)GetProcAddress((handle),(name)))
|
||||
# define RTLD_LAZY -1
|
||||
# define RTLD_NOW -1
|
||||
# define RTLD_GLOBAL -1
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#define MAX_CALLBACK 5
|
||||
#define DLSTACK_TYPE SIGNED_VALUE
|
||||
#define DLSTACK_SIZE (20)
|
||||
#define DLSTACK_PROTO \
|
||||
DLSTACK_TYPE,DLSTACK_TYPE,DLSTACK_TYPE,DLSTACK_TYPE,DLSTACK_TYPE,\
|
||||
DLSTACK_TYPE,DLSTACK_TYPE,DLSTACK_TYPE,DLSTACK_TYPE,DLSTACK_TYPE,\
|
||||
DLSTACK_TYPE,DLSTACK_TYPE,DLSTACK_TYPE,DLSTACK_TYPE,DLSTACK_TYPE,\
|
||||
DLSTACK_TYPE,DLSTACK_TYPE,DLSTACK_TYPE,DLSTACK_TYPE,DLSTACK_TYPE
|
||||
#define DLSTACK_ARGS(stack) \
|
||||
(stack)[0],(stack)[1],(stack)[2],(stack)[3],(stack)[4],\
|
||||
(stack)[5],(stack)[6],(stack)[7],(stack)[8],(stack)[9],\
|
||||
(stack)[10],(stack)[11],(stack)[12],(stack)[13],(stack)[14],\
|
||||
(stack)[15],(stack)[16],(stack)[17],(stack)[18],(stack)[19]
|
||||
|
||||
#define DLSTACK_PROTO0_ void
|
||||
#define DLSTACK_PROTO1_ DLSTACK_TYPE
|
||||
#define DLSTACK_PROTO2_ DLSTACK_PROTO1_, DLSTACK_TYPE
|
||||
#define DLSTACK_PROTO3_ DLSTACK_PROTO2_, DLSTACK_TYPE
|
||||
#define DLSTACK_PROTO4_ DLSTACK_PROTO3_, DLSTACK_TYPE
|
||||
#define DLSTACK_PROTO4_ DLSTACK_PROTO3_, DLSTACK_TYPE
|
||||
#define DLSTACK_PROTO5_ DLSTACK_PROTO4_, DLSTACK_TYPE
|
||||
#define DLSTACK_PROTO6_ DLSTACK_PROTO5_, DLSTACK_TYPE
|
||||
#define DLSTACK_PROTO7_ DLSTACK_PROTO6_, DLSTACK_TYPE
|
||||
#define DLSTACK_PROTO8_ DLSTACK_PROTO7_, DLSTACK_TYPE
|
||||
#define DLSTACK_PROTO9_ DLSTACK_PROTO8_, DLSTACK_TYPE
|
||||
#define DLSTACK_PROTO10_ DLSTACK_PROTO9_, DLSTACK_TYPE
|
||||
#define DLSTACK_PROTO11_ DLSTACK_PROTO10_, DLSTACK_TYPE
|
||||
#define DLSTACK_PROTO12_ DLSTACK_PROTO11_, DLSTACK_TYPE
|
||||
#define DLSTACK_PROTO13_ DLSTACK_PROTO12_, DLSTACK_TYPE
|
||||
#define DLSTACK_PROTO14_ DLSTACK_PROTO13_, DLSTACK_TYPE
|
||||
#define DLSTACK_PROTO14_ DLSTACK_PROTO13_, DLSTACK_TYPE
|
||||
#define DLSTACK_PROTO15_ DLSTACK_PROTO14_, DLSTACK_TYPE
|
||||
#define DLSTACK_PROTO16_ DLSTACK_PROTO15_, DLSTACK_TYPE
|
||||
#define DLSTACK_PROTO17_ DLSTACK_PROTO16_, DLSTACK_TYPE
|
||||
#define DLSTACK_PROTO18_ DLSTACK_PROTO17_, DLSTACK_TYPE
|
||||
#define DLSTACK_PROTO19_ DLSTACK_PROTO18_, DLSTACK_TYPE
|
||||
#define DLSTACK_PROTO20_ DLSTACK_PROTO19_, DLSTACK_TYPE
|
||||
|
||||
/*
|
||||
* Add ",..." as the last argument.
|
||||
* This is required for variable argument functions such
|
||||
* as fprintf() on x86_64-linux.
|
||||
*
|
||||
* http://refspecs.linuxfoundation.org/elf/x86_64-abi-0.95.pdf
|
||||
* page 19:
|
||||
*
|
||||
* For calls that may call functions that use varargs or stdargs
|
||||
* (prototype-less calls or calls to functions containing ellipsis
|
||||
* (...) in the declaration) %al is used as hidden argument to
|
||||
* specify the number of SSE registers used.
|
||||
*/
|
||||
#define DLSTACK_PROTO0 void
|
||||
#define DLSTACK_PROTO1 DLSTACK_PROTO1_, ...
|
||||
#define DLSTACK_PROTO2 DLSTACK_PROTO2_, ...
|
||||
#define DLSTACK_PROTO3 DLSTACK_PROTO3_, ...
|
||||
#define DLSTACK_PROTO4 DLSTACK_PROTO4_, ...
|
||||
#define DLSTACK_PROTO4 DLSTACK_PROTO4_, ...
|
||||
#define DLSTACK_PROTO5 DLSTACK_PROTO5_, ...
|
||||
#define DLSTACK_PROTO6 DLSTACK_PROTO6_, ...
|
||||
#define DLSTACK_PROTO7 DLSTACK_PROTO7_, ...
|
||||
#define DLSTACK_PROTO8 DLSTACK_PROTO8_, ...
|
||||
#define DLSTACK_PROTO9 DLSTACK_PROTO9_, ...
|
||||
#define DLSTACK_PROTO10 DLSTACK_PROTO10_, ...
|
||||
#define DLSTACK_PROTO11 DLSTACK_PROTO11_, ...
|
||||
#define DLSTACK_PROTO12 DLSTACK_PROTO12_, ...
|
||||
#define DLSTACK_PROTO13 DLSTACK_PROTO13_, ...
|
||||
#define DLSTACK_PROTO14 DLSTACK_PROTO14_, ...
|
||||
#define DLSTACK_PROTO14 DLSTACK_PROTO14_, ...
|
||||
#define DLSTACK_PROTO15 DLSTACK_PROTO15_, ...
|
||||
#define DLSTACK_PROTO16 DLSTACK_PROTO16_, ...
|
||||
#define DLSTACK_PROTO17 DLSTACK_PROTO17_, ...
|
||||
#define DLSTACK_PROTO18 DLSTACK_PROTO18_, ...
|
||||
#define DLSTACK_PROTO19 DLSTACK_PROTO19_, ...
|
||||
#define DLSTACK_PROTO20 DLSTACK_PROTO20_, ...
|
||||
|
||||
#define DLSTACK_ARGS0(stack)
|
||||
#define DLSTACK_ARGS1(stack) (stack)[0]
|
||||
#define DLSTACK_ARGS2(stack) DLSTACK_ARGS1(stack), (stack)[1]
|
||||
#define DLSTACK_ARGS3(stack) DLSTACK_ARGS2(stack), (stack)[2]
|
||||
#define DLSTACK_ARGS4(stack) DLSTACK_ARGS3(stack), (stack)[3]
|
||||
#define DLSTACK_ARGS5(stack) DLSTACK_ARGS4(stack), (stack)[4]
|
||||
#define DLSTACK_ARGS6(stack) DLSTACK_ARGS5(stack), (stack)[5]
|
||||
#define DLSTACK_ARGS7(stack) DLSTACK_ARGS6(stack), (stack)[6]
|
||||
#define DLSTACK_ARGS8(stack) DLSTACK_ARGS7(stack), (stack)[7]
|
||||
#define DLSTACK_ARGS9(stack) DLSTACK_ARGS8(stack), (stack)[8]
|
||||
#define DLSTACK_ARGS10(stack) DLSTACK_ARGS9(stack), (stack)[9]
|
||||
#define DLSTACK_ARGS11(stack) DLSTACK_ARGS10(stack), (stack)[10]
|
||||
#define DLSTACK_ARGS12(stack) DLSTACK_ARGS11(stack), (stack)[11]
|
||||
#define DLSTACK_ARGS13(stack) DLSTACK_ARGS12(stack), (stack)[12]
|
||||
#define DLSTACK_ARGS14(stack) DLSTACK_ARGS13(stack), (stack)[13]
|
||||
#define DLSTACK_ARGS15(stack) DLSTACK_ARGS14(stack), (stack)[14]
|
||||
#define DLSTACK_ARGS16(stack) DLSTACK_ARGS15(stack), (stack)[15]
|
||||
#define DLSTACK_ARGS17(stack) DLSTACK_ARGS16(stack), (stack)[16]
|
||||
#define DLSTACK_ARGS18(stack) DLSTACK_ARGS17(stack), (stack)[17]
|
||||
#define DLSTACK_ARGS19(stack) DLSTACK_ARGS18(stack), (stack)[18]
|
||||
#define DLSTACK_ARGS20(stack) DLSTACK_ARGS19(stack), (stack)[19]
|
||||
|
||||
extern VALUE rb_mDL;
|
||||
extern VALUE rb_cDLHandle;
|
||||
extern VALUE rb_cDLSymbol;
|
||||
extern VALUE rb_eDLError;
|
||||
extern VALUE rb_eDLTypeError;
|
||||
|
||||
#define ALIGN_OF(type) offsetof(struct {char align_c; type align_x;}, align_x)
|
||||
|
||||
#define ALIGN_VOIDP ALIGN_OF(void*)
|
||||
#define ALIGN_SHORT ALIGN_OF(short)
|
||||
#define ALIGN_CHAR ALIGN_OF(char)
|
||||
#define ALIGN_INT ALIGN_OF(int)
|
||||
#define ALIGN_LONG ALIGN_OF(long)
|
||||
#if HAVE_LONG_LONG
|
||||
#define ALIGN_LONG_LONG ALIGN_OF(LONG_LONG)
|
||||
#endif
|
||||
#define ALIGN_FLOAT ALIGN_OF(float)
|
||||
#define ALIGN_DOUBLE ALIGN_OF(double)
|
||||
|
||||
#define DLALIGN(ptr,offset,align) \
|
||||
((offset) += ((align) - ((uintptr_t)((char *)(ptr) + (offset))) % (align)) % (align))
|
||||
|
||||
|
||||
#define DLTYPE_VOID 0
|
||||
#define DLTYPE_VOIDP 1
|
||||
#define DLTYPE_CHAR 2
|
||||
#define DLTYPE_SHORT 3
|
||||
#define DLTYPE_INT 4
|
||||
#define DLTYPE_LONG 5
|
||||
#if HAVE_LONG_LONG
|
||||
#define DLTYPE_LONG_LONG 6
|
||||
#endif
|
||||
#define DLTYPE_FLOAT 7
|
||||
#define DLTYPE_DOUBLE 8
|
||||
#define MAX_DLTYPE 9
|
||||
|
||||
#if SIZEOF_VOIDP == SIZEOF_LONG
|
||||
# define PTR2NUM(x) (ULONG2NUM((unsigned long)(x)))
|
||||
# define NUM2PTR(x) ((void*)(NUM2ULONG(x)))
|
||||
#else
|
||||
/* # error --->> Ruby/DL2 requires sizeof(void*) == sizeof(long) to be compiled. <<--- */
|
||||
# define PTR2NUM(x) (ULL2NUM((unsigned long long)(x)))
|
||||
# define NUM2PTR(x) ((void*)(NUM2ULL(x)))
|
||||
#endif
|
||||
|
||||
#define BOOL2INT(x) (((x) == Qtrue)?1:0)
|
||||
#define INT2BOOL(x) ((x)?Qtrue:Qfalse)
|
||||
|
||||
typedef void (*freefunc_t)(void*);
|
||||
|
||||
struct dl_handle {
|
||||
void *ptr;
|
||||
int open;
|
||||
int enable_close;
|
||||
};
|
||||
|
||||
|
||||
struct cfunc_data {
|
||||
void *ptr;
|
||||
char *name;
|
||||
int type;
|
||||
ID calltype;
|
||||
VALUE wrap;
|
||||
};
|
||||
extern ID rbdl_id_cdecl;
|
||||
extern ID rbdl_id_stdcall;
|
||||
#define CFUNC_CDECL (rbdl_id_cdecl)
|
||||
#define CFUNC_STDCALL (rbdl_id_stdcall)
|
||||
|
||||
struct ptr_data {
|
||||
void *ptr;
|
||||
long size;
|
||||
freefunc_t free;
|
||||
VALUE wrap[2];
|
||||
};
|
||||
|
||||
#define RDL_HANDLE(obj) ((struct dl_handle *)(DATA_PTR(obj)))
|
||||
#define RCFUNC_DATA(obj) ((struct cfunc_data *)(DATA_PTR(obj)))
|
||||
#define RPTR_DATA(obj) ((struct ptr_data *)(DATA_PTR(obj)))
|
||||
|
||||
VALUE rb_dlcfunc_new(void (*func)(), int dltype, const char * name, ID calltype);
|
||||
int rb_dlcfunc_kind_p(VALUE func);
|
||||
VALUE rb_dlptr_new(void *ptr, long size, freefunc_t func);
|
||||
VALUE rb_dlptr_new2(VALUE klass, void *ptr, long size, freefunc_t func);
|
||||
VALUE rb_dlptr_malloc(long size, freefunc_t func);
|
||||
|
||||
#endif
|
||||
@@ -1,354 +0,0 @@
|
||||
/**********************************************************************
|
||||
|
||||
encoding.h -
|
||||
|
||||
$Author: matz $
|
||||
created at: Thu May 24 11:49:41 JST 2007
|
||||
|
||||
Copyright (C) 2007 Yukihiro Matsumoto
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef RUBY_ENCODING_H
|
||||
#define RUBY_ENCODING_H 1
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#if 0
|
||||
} /* satisfy cc-mode */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <stdarg.h>
|
||||
#include "ruby/oniguruma.h"
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility push(default)
|
||||
#endif
|
||||
|
||||
#define ENCODING_INLINE_MAX 1023
|
||||
#define ENCODING_SHIFT (FL_USHIFT+10)
|
||||
#define ENCODING_MASK (((VALUE)ENCODING_INLINE_MAX)<<ENCODING_SHIFT)
|
||||
|
||||
#define ENCODING_SET_INLINED(obj,i) do {\
|
||||
RBASIC(obj)->flags &= ~ENCODING_MASK;\
|
||||
RBASIC(obj)->flags |= (VALUE)(i) << ENCODING_SHIFT;\
|
||||
} while (0)
|
||||
#define ENCODING_SET(obj,i) do {\
|
||||
VALUE rb_encoding_set_obj = (obj); \
|
||||
int encoding_set_enc_index = (i); \
|
||||
if (encoding_set_enc_index < ENCODING_INLINE_MAX) \
|
||||
ENCODING_SET_INLINED(rb_encoding_set_obj, encoding_set_enc_index); \
|
||||
else \
|
||||
rb_enc_set_index(rb_encoding_set_obj, encoding_set_enc_index); \
|
||||
} while (0)
|
||||
|
||||
#define ENCODING_GET_INLINED(obj) (int)((RBASIC(obj)->flags & ENCODING_MASK)>>ENCODING_SHIFT)
|
||||
#define ENCODING_GET(obj) \
|
||||
(ENCODING_GET_INLINED(obj) != ENCODING_INLINE_MAX ? \
|
||||
ENCODING_GET_INLINED(obj) : \
|
||||
rb_enc_get_index(obj))
|
||||
|
||||
#define ENCODING_IS_ASCII8BIT(obj) (ENCODING_GET_INLINED(obj) == 0)
|
||||
|
||||
#define ENCODING_MAXNAMELEN 42
|
||||
|
||||
#define ENC_CODERANGE_MASK ((int)(FL_USER8|FL_USER9))
|
||||
#define ENC_CODERANGE_UNKNOWN 0
|
||||
#define ENC_CODERANGE_7BIT ((int)FL_USER8)
|
||||
#define ENC_CODERANGE_VALID ((int)FL_USER9)
|
||||
#define ENC_CODERANGE_BROKEN ((int)(FL_USER8|FL_USER9))
|
||||
#define ENC_CODERANGE(obj) ((int)RBASIC(obj)->flags & ENC_CODERANGE_MASK)
|
||||
#define ENC_CODERANGE_ASCIIONLY(obj) (ENC_CODERANGE(obj) == ENC_CODERANGE_7BIT)
|
||||
#define ENC_CODERANGE_SET(obj,cr) (RBASIC(obj)->flags = \
|
||||
(RBASIC(obj)->flags & ~ENC_CODERANGE_MASK) | (cr))
|
||||
#define ENC_CODERANGE_CLEAR(obj) ENC_CODERANGE_SET((obj),0)
|
||||
|
||||
/* assumed ASCII compatibility */
|
||||
#define ENC_CODERANGE_AND(a, b) \
|
||||
((a) == ENC_CODERANGE_7BIT ? (b) : \
|
||||
(a) == ENC_CODERANGE_VALID ? ((b) == ENC_CODERANGE_7BIT ? ENC_CODERANGE_VALID : (b)) : \
|
||||
ENC_CODERANGE_UNKNOWN)
|
||||
|
||||
#define ENCODING_CODERANGE_SET(obj, encindex, cr) \
|
||||
do { \
|
||||
VALUE rb_encoding_coderange_obj = (obj); \
|
||||
ENCODING_SET(rb_encoding_coderange_obj, (encindex)); \
|
||||
ENC_CODERANGE_SET(rb_encoding_coderange_obj, (cr)); \
|
||||
} while (0)
|
||||
|
||||
typedef OnigEncodingType rb_encoding;
|
||||
|
||||
int rb_char_to_option_kcode(int c, int *option, int *kcode);
|
||||
|
||||
int rb_enc_replicate(const char *, rb_encoding *);
|
||||
int rb_define_dummy_encoding(const char *);
|
||||
#define rb_enc_to_index(enc) ((enc) ? ENC_TO_ENCINDEX(enc) : 0)
|
||||
int rb_enc_get_index(VALUE obj);
|
||||
void rb_enc_set_index(VALUE obj, int encindex);
|
||||
int rb_enc_find_index(const char *name);
|
||||
int rb_to_encoding_index(VALUE);
|
||||
rb_encoding* rb_to_encoding(VALUE);
|
||||
rb_encoding* rb_find_encoding(VALUE);
|
||||
rb_encoding* rb_enc_get(VALUE);
|
||||
rb_encoding* rb_enc_compatible(VALUE,VALUE);
|
||||
rb_encoding* rb_enc_check(VALUE,VALUE);
|
||||
VALUE rb_enc_associate_index(VALUE, int);
|
||||
VALUE rb_enc_associate(VALUE, rb_encoding*);
|
||||
void rb_enc_copy(VALUE dst, VALUE src);
|
||||
|
||||
VALUE rb_enc_str_new(const char*, long, rb_encoding*);
|
||||
VALUE rb_enc_reg_new(const char*, long, rb_encoding*, int);
|
||||
PRINTF_ARGS(VALUE rb_enc_sprintf(rb_encoding *, const char*, ...), 2, 3);
|
||||
VALUE rb_enc_vsprintf(rb_encoding *, const char*, va_list);
|
||||
long rb_enc_strlen(const char*, const char*, rb_encoding*);
|
||||
char* rb_enc_nth(const char*, const char*, long, rb_encoding*);
|
||||
VALUE rb_obj_encoding(VALUE);
|
||||
VALUE rb_enc_str_buf_cat(VALUE str, const char *ptr, long len, rb_encoding *enc);
|
||||
VALUE rb_enc_uint_chr(unsigned int code, rb_encoding *enc);
|
||||
|
||||
VALUE rb_external_str_new_with_enc(const char *ptr, long len, rb_encoding *);
|
||||
VALUE rb_str_export_to_enc(VALUE, rb_encoding *);
|
||||
VALUE rb_str_conv_enc(VALUE str, rb_encoding *from, rb_encoding *to);
|
||||
VALUE rb_str_conv_enc_opts(VALUE str, rb_encoding *from, rb_encoding *to, int ecflags, VALUE ecopts);
|
||||
|
||||
PRINTF_ARGS(NORETURN(void rb_enc_raise(rb_encoding *, VALUE, const char*, ...)), 3, 4);
|
||||
|
||||
/* index -> rb_encoding */
|
||||
rb_encoding* rb_enc_from_index(int idx);
|
||||
|
||||
/* name -> rb_encoding */
|
||||
rb_encoding * rb_enc_find(const char *name);
|
||||
|
||||
/* rb_encoding * -> name */
|
||||
#define rb_enc_name(enc) (enc)->name
|
||||
|
||||
/* rb_encoding * -> minlen/maxlen */
|
||||
#define rb_enc_mbminlen(enc) (enc)->min_enc_len
|
||||
#define rb_enc_mbmaxlen(enc) (enc)->max_enc_len
|
||||
|
||||
/* -> mbclen (no error notification: 0 < ret <= e-p, no exception) */
|
||||
int rb_enc_mbclen(const char *p, const char *e, rb_encoding *enc);
|
||||
|
||||
/* -> mbclen (only for valid encoding) */
|
||||
int rb_enc_fast_mbclen(const char *p, const char *e, rb_encoding *enc);
|
||||
|
||||
/* -> chlen, invalid or needmore */
|
||||
int rb_enc_precise_mbclen(const char *p, const char *e, rb_encoding *enc);
|
||||
#define MBCLEN_CHARFOUND_P(ret) ONIGENC_MBCLEN_CHARFOUND_P(ret)
|
||||
#define MBCLEN_CHARFOUND_LEN(ret) ONIGENC_MBCLEN_CHARFOUND_LEN(ret)
|
||||
#define MBCLEN_INVALID_P(ret) ONIGENC_MBCLEN_INVALID_P(ret)
|
||||
#define MBCLEN_NEEDMORE_P(ret) ONIGENC_MBCLEN_NEEDMORE_P(ret)
|
||||
#define MBCLEN_NEEDMORE_LEN(ret) ONIGENC_MBCLEN_NEEDMORE_LEN(ret)
|
||||
|
||||
/* -> 0x00..0x7f, -1 */
|
||||
int rb_enc_ascget(const char *p, const char *e, int *len, rb_encoding *enc);
|
||||
|
||||
|
||||
/* -> code (and len) or raise exception */
|
||||
unsigned int rb_enc_codepoint_len(const char *p, const char *e, int *len, rb_encoding *enc);
|
||||
|
||||
/* prototype for obsolete function */
|
||||
unsigned int rb_enc_codepoint(const char *p, const char *e, rb_encoding *enc);
|
||||
/* overriding macro */
|
||||
#define rb_enc_codepoint(p,e,enc) rb_enc_codepoint_len((p),(e),0,(enc))
|
||||
#define rb_enc_mbc_to_codepoint(p, e, enc) ONIGENC_MBC_TO_CODE((enc),(UChar*)(p),(UChar*)(e))
|
||||
|
||||
/* -> codelen>0 or raise exception */
|
||||
int rb_enc_codelen(int code, rb_encoding *enc);
|
||||
|
||||
/* code,ptr,encoding -> write buf */
|
||||
#define rb_enc_mbcput(c,buf,enc) ONIGENC_CODE_TO_MBC((enc),(c),(UChar*)(buf))
|
||||
|
||||
/* start, ptr, end, encoding -> prev_char */
|
||||
#define rb_enc_prev_char(s,p,e,enc) ((char *)onigenc_get_prev_char_head((enc),(UChar*)(s),(UChar*)(p),(UChar*)(e)))
|
||||
/* start, ptr, end, encoding -> next_char */
|
||||
#define rb_enc_left_char_head(s,p,e,enc) ((char *)onigenc_get_left_adjust_char_head((enc),(UChar*)(s),(UChar*)(p),(UChar*)(e)))
|
||||
#define rb_enc_right_char_head(s,p,e,enc) ((char *)onigenc_get_right_adjust_char_head((enc),(UChar*)(s),(UChar*)(p),(UChar*)(e)))
|
||||
#define rb_enc_step_back(s,p,e,n,enc) ((char *)onigenc_step_back((enc),(UChar*)(s),(UChar*)(p),(UChar*)(e),(int)(n)))
|
||||
|
||||
/* ptr, ptr, encoding -> newline_or_not */
|
||||
#define rb_enc_is_newline(p,end,enc) ONIGENC_IS_MBC_NEWLINE((enc),(UChar*)(p),(UChar*)(end))
|
||||
|
||||
#define rb_enc_isctype(c,t,enc) ONIGENC_IS_CODE_CTYPE((enc),(c),(t))
|
||||
#define rb_enc_isascii(c,enc) ONIGENC_IS_CODE_ASCII(c)
|
||||
#define rb_enc_isalpha(c,enc) ONIGENC_IS_CODE_ALPHA((enc),(c))
|
||||
#define rb_enc_islower(c,enc) ONIGENC_IS_CODE_LOWER((enc),(c))
|
||||
#define rb_enc_isupper(c,enc) ONIGENC_IS_CODE_UPPER((enc),(c))
|
||||
#define rb_enc_ispunct(c,enc) ONIGENC_IS_CODE_PUNCT((enc),(c))
|
||||
#define rb_enc_isalnum(c,enc) ONIGENC_IS_CODE_ALNUM((enc),(c))
|
||||
#define rb_enc_isprint(c,enc) ONIGENC_IS_CODE_PRINT((enc),(c))
|
||||
#define rb_enc_isspace(c,enc) ONIGENC_IS_CODE_SPACE((enc),(c))
|
||||
#define rb_enc_isdigit(c,enc) ONIGENC_IS_CODE_DIGIT((enc),(c))
|
||||
|
||||
#define rb_enc_asciicompat(enc) (rb_enc_mbminlen(enc)==1 && !rb_enc_dummy_p(enc))
|
||||
|
||||
int rb_enc_casefold(char *to, const char *p, const char *e, rb_encoding *enc);
|
||||
int rb_enc_toupper(int c, rb_encoding *enc);
|
||||
int rb_enc_tolower(int c, rb_encoding *enc);
|
||||
ID rb_intern3(const char*, long, rb_encoding*);
|
||||
ID rb_interned_id_p(const char *, long, rb_encoding *);
|
||||
int rb_enc_symname_p(const char*, rb_encoding*);
|
||||
int rb_enc_symname2_p(const char*, long, rb_encoding*);
|
||||
int rb_enc_str_coderange(VALUE);
|
||||
long rb_str_coderange_scan_restartable(const char*, const char*, rb_encoding*, int*);
|
||||
int rb_enc_str_asciionly_p(VALUE);
|
||||
#define rb_enc_str_asciicompat_p(str) rb_enc_asciicompat(rb_enc_get(str))
|
||||
VALUE rb_enc_from_encoding(rb_encoding *enc);
|
||||
int rb_enc_unicode_p(rb_encoding *enc);
|
||||
rb_encoding *rb_ascii8bit_encoding(void);
|
||||
rb_encoding *rb_utf8_encoding(void);
|
||||
rb_encoding *rb_usascii_encoding(void);
|
||||
rb_encoding *rb_locale_encoding(void);
|
||||
rb_encoding *rb_filesystem_encoding(void);
|
||||
rb_encoding *rb_default_external_encoding(void);
|
||||
rb_encoding *rb_default_internal_encoding(void);
|
||||
int rb_ascii8bit_encindex(void);
|
||||
int rb_utf8_encindex(void);
|
||||
int rb_usascii_encindex(void);
|
||||
int rb_locale_encindex(void);
|
||||
int rb_filesystem_encindex(void);
|
||||
VALUE rb_enc_default_external(void);
|
||||
VALUE rb_enc_default_internal(void);
|
||||
void rb_enc_set_default_external(VALUE encoding);
|
||||
void rb_enc_set_default_internal(VALUE encoding);
|
||||
VALUE rb_locale_charmap(VALUE klass);
|
||||
long rb_memsearch(const void*,long,const void*,long,rb_encoding*);
|
||||
char *rb_enc_path_next(const char *,const char *,rb_encoding*);
|
||||
char *rb_enc_path_skip_prefix(const char *,const char *,rb_encoding*);
|
||||
char *rb_enc_path_last_separator(const char *,const char *,rb_encoding*);
|
||||
char *rb_enc_path_end(const char *,const char *,rb_encoding*);
|
||||
const char *ruby_enc_find_basename(const char *name, long *baselen, long *alllen, rb_encoding *enc);
|
||||
const char *ruby_enc_find_extname(const char *name, long *len, rb_encoding *enc);
|
||||
ID rb_check_id_cstr(const char *ptr, long len, rb_encoding *enc);
|
||||
|
||||
RUBY_EXTERN VALUE rb_cEncoding;
|
||||
#define ENC_DUMMY_FLAG (1<<24)
|
||||
#define ENC_INDEX_MASK (~(~0U<<24))
|
||||
|
||||
#define ENC_TO_ENCINDEX(enc) (int)((enc)->ruby_encoding_index & ENC_INDEX_MASK)
|
||||
|
||||
#define ENC_DUMMY_P(enc) ((enc)->ruby_encoding_index & ENC_DUMMY_FLAG)
|
||||
#define ENC_SET_DUMMY(enc) ((enc)->ruby_encoding_index |= ENC_DUMMY_FLAG)
|
||||
|
||||
static inline int
|
||||
rb_enc_dummy_p(rb_encoding *enc)
|
||||
{
|
||||
return ENC_DUMMY_P(enc) != 0;
|
||||
}
|
||||
|
||||
/* econv stuff */
|
||||
|
||||
typedef enum {
|
||||
econv_invalid_byte_sequence,
|
||||
econv_undefined_conversion,
|
||||
econv_destination_buffer_full,
|
||||
econv_source_buffer_empty,
|
||||
econv_finished,
|
||||
econv_after_output,
|
||||
econv_incomplete_input
|
||||
} rb_econv_result_t;
|
||||
|
||||
typedef struct rb_econv_t rb_econv_t;
|
||||
|
||||
VALUE rb_str_encode(VALUE str, VALUE to, int ecflags, VALUE ecopts);
|
||||
int rb_econv_has_convpath_p(const char* from_encoding, const char* to_encoding);
|
||||
|
||||
int rb_econv_prepare_options(VALUE opthash, VALUE *ecopts, int ecflags);
|
||||
int rb_econv_prepare_opts(VALUE opthash, VALUE *ecopts);
|
||||
|
||||
rb_econv_t *rb_econv_open(const char *source_encoding, const char *destination_encoding, int ecflags);
|
||||
rb_econv_t *rb_econv_open_opts(const char *source_encoding, const char *destination_encoding, int ecflags, VALUE ecopts);
|
||||
|
||||
rb_econv_result_t rb_econv_convert(rb_econv_t *ec,
|
||||
const unsigned char **source_buffer_ptr, const unsigned char *source_buffer_end,
|
||||
unsigned char **destination_buffer_ptr, unsigned char *destination_buffer_end,
|
||||
int flags);
|
||||
void rb_econv_close(rb_econv_t *ec);
|
||||
|
||||
/* result: 0:success -1:failure */
|
||||
int rb_econv_set_replacement(rb_econv_t *ec, const unsigned char *str, size_t len, const char *encname);
|
||||
|
||||
/* result: 0:success -1:failure */
|
||||
int rb_econv_decorate_at_first(rb_econv_t *ec, const char *decorator_name);
|
||||
int rb_econv_decorate_at_last(rb_econv_t *ec, const char *decorator_name);
|
||||
|
||||
VALUE rb_econv_open_exc(const char *senc, const char *denc, int ecflags);
|
||||
|
||||
/* result: 0:success -1:failure */
|
||||
int rb_econv_insert_output(rb_econv_t *ec,
|
||||
const unsigned char *str, size_t len, const char *str_encoding);
|
||||
|
||||
/* encoding that rb_econv_insert_output doesn't need conversion */
|
||||
const char *rb_econv_encoding_to_insert_output(rb_econv_t *ec);
|
||||
|
||||
/* raise an error if the last rb_econv_convert is error */
|
||||
void rb_econv_check_error(rb_econv_t *ec);
|
||||
|
||||
/* returns an exception object or nil */
|
||||
VALUE rb_econv_make_exception(rb_econv_t *ec);
|
||||
|
||||
int rb_econv_putbackable(rb_econv_t *ec);
|
||||
void rb_econv_putback(rb_econv_t *ec, unsigned char *p, int n);
|
||||
|
||||
/* returns the corresponding ASCII compatible encoding for encname,
|
||||
* or NULL if encname is not ASCII incompatible encoding. */
|
||||
const char *rb_econv_asciicompat_encoding(const char *encname);
|
||||
|
||||
VALUE rb_econv_str_convert(rb_econv_t *ec, VALUE src, int flags);
|
||||
VALUE rb_econv_substr_convert(rb_econv_t *ec, VALUE src, long byteoff, long bytesize, int flags);
|
||||
VALUE rb_econv_str_append(rb_econv_t *ec, VALUE src, VALUE dst, int flags);
|
||||
VALUE rb_econv_substr_append(rb_econv_t *ec, VALUE src, long byteoff, long bytesize, VALUE dst, int flags);
|
||||
|
||||
void rb_econv_binmode(rb_econv_t *ec);
|
||||
|
||||
/* flags for rb_econv_open */
|
||||
|
||||
#define ECONV_ERROR_HANDLER_MASK 0x000000ff
|
||||
|
||||
#define ECONV_INVALID_MASK 0x0000000f
|
||||
#define ECONV_INVALID_REPLACE 0x00000002
|
||||
|
||||
#define ECONV_UNDEF_MASK 0x000000f0
|
||||
#define ECONV_UNDEF_REPLACE 0x00000020
|
||||
#define ECONV_UNDEF_HEX_CHARREF 0x00000030
|
||||
|
||||
#define ECONV_DECORATOR_MASK 0x0000ff00
|
||||
#define ECONV_NEWLINE_DECORATOR_MASK 0x00003f00
|
||||
#define ECONV_NEWLINE_DECORATOR_READ_MASK 0x00000f00
|
||||
#define ECONV_NEWLINE_DECORATOR_WRITE_MASK 0x00003000
|
||||
|
||||
#define ECONV_UNIVERSAL_NEWLINE_DECORATOR 0x00000100
|
||||
#define ECONV_CRLF_NEWLINE_DECORATOR 0x00001000
|
||||
#define ECONV_CR_NEWLINE_DECORATOR 0x00002000
|
||||
#define ECONV_XML_TEXT_DECORATOR 0x00004000
|
||||
#define ECONV_XML_ATTR_CONTENT_DECORATOR 0x00008000
|
||||
|
||||
#define ECONV_STATEFUL_DECORATOR_MASK 0x00f00000
|
||||
#define ECONV_XML_ATTR_QUOTE_DECORATOR 0x00100000
|
||||
|
||||
#if defined(RUBY_TEST_CRLF_ENVIRONMENT) || defined(_WIN32)
|
||||
#define ECONV_DEFAULT_NEWLINE_DECORATOR ECONV_CRLF_NEWLINE_DECORATOR
|
||||
#else
|
||||
#define ECONV_DEFAULT_NEWLINE_DECORATOR 0
|
||||
#endif
|
||||
|
||||
/* end of flags for rb_econv_open */
|
||||
|
||||
/* flags for rb_econv_convert */
|
||||
#define ECONV_PARTIAL_INPUT 0x00010000
|
||||
#define ECONV_AFTER_OUTPUT 0x00020000
|
||||
/* end of flags for rb_econv_convert */
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility pop
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
#if 0
|
||||
{ /* satisfy cc-mode */
|
||||
#endif
|
||||
} /* extern "C" { */
|
||||
#endif
|
||||
|
||||
#endif /* RUBY_ENCODING_H */
|
||||
@@ -1,929 +0,0 @@
|
||||
/**********************************************************************
|
||||
|
||||
intern.h -
|
||||
|
||||
$Author: nagachika $
|
||||
created at: Thu Jun 10 14:22:17 JST 1993
|
||||
|
||||
Copyright (C) 1993-2007 Yukihiro Matsumoto
|
||||
Copyright (C) 2000 Network Applied Communication Laboratory, Inc.
|
||||
Copyright (C) 2000 Information-technology Promotion Agency, Japan
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef RUBY_INTERN_H
|
||||
#define RUBY_INTERN_H 1
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#if 0
|
||||
} /* satisfy cc-mode */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "ruby/defines.h"
|
||||
#ifdef RUBY_EXTCONF_H
|
||||
#include RUBY_EXTCONF_H
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STDARG_PROTOTYPES
|
||||
# include <stdarg.h>
|
||||
#else
|
||||
# include <varargs.h>
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_SYS_TYPES_H)
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_SYS_TIME_H)
|
||||
#include <sys/time.h>
|
||||
#endif
|
||||
|
||||
#include "ruby/st.h"
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility push(default)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Functions and variables that are used by more than one source file of
|
||||
* the kernel.
|
||||
*/
|
||||
|
||||
#define UNLIMITED_ARGUMENTS (-1)
|
||||
|
||||
/* array.c */
|
||||
void rb_mem_clear(register VALUE*, register long);
|
||||
VALUE rb_assoc_new(VALUE, VALUE);
|
||||
VALUE rb_check_array_type(VALUE);
|
||||
VALUE rb_ary_new(void);
|
||||
VALUE rb_ary_new2(long);
|
||||
VALUE rb_ary_new3(long,...);
|
||||
VALUE rb_ary_new4(long, const VALUE *);
|
||||
VALUE rb_ary_tmp_new(long);
|
||||
void rb_ary_free(VALUE);
|
||||
void rb_ary_modify(VALUE);
|
||||
VALUE rb_ary_freeze(VALUE);
|
||||
VALUE rb_ary_shared_with_p(VALUE, VALUE);
|
||||
VALUE rb_ary_aref(int, VALUE*, VALUE);
|
||||
VALUE rb_ary_subseq(VALUE, long, long);
|
||||
void rb_ary_store(VALUE, long, VALUE);
|
||||
VALUE rb_ary_dup(VALUE);
|
||||
VALUE rb_ary_resurrect(VALUE ary);
|
||||
VALUE rb_ary_to_ary(VALUE);
|
||||
VALUE rb_ary_to_s(VALUE);
|
||||
VALUE rb_ary_push(VALUE, VALUE);
|
||||
VALUE rb_ary_pop(VALUE);
|
||||
VALUE rb_ary_shift(VALUE);
|
||||
VALUE rb_ary_unshift(VALUE, VALUE);
|
||||
VALUE rb_ary_entry(VALUE, long);
|
||||
VALUE rb_ary_each(VALUE);
|
||||
VALUE rb_ary_join(VALUE, VALUE);
|
||||
VALUE rb_ary_reverse(VALUE);
|
||||
VALUE rb_ary_rotate(VALUE, long);
|
||||
VALUE rb_ary_sort(VALUE);
|
||||
VALUE rb_ary_sort_bang(VALUE);
|
||||
VALUE rb_ary_delete(VALUE, VALUE);
|
||||
VALUE rb_ary_delete_at(VALUE, long);
|
||||
VALUE rb_ary_clear(VALUE);
|
||||
VALUE rb_ary_plus(VALUE, VALUE);
|
||||
VALUE rb_ary_concat(VALUE, VALUE);
|
||||
VALUE rb_ary_assoc(VALUE, VALUE);
|
||||
VALUE rb_ary_rassoc(VALUE, VALUE);
|
||||
VALUE rb_ary_includes(VALUE, VALUE);
|
||||
VALUE rb_ary_cmp(VALUE, VALUE);
|
||||
VALUE rb_ary_replace(VALUE copy, VALUE orig);
|
||||
VALUE rb_get_values_at(VALUE, long, int, VALUE*, VALUE(*)(VALUE,long));
|
||||
VALUE rb_ary_resize(VALUE ary, long len);
|
||||
/* bignum.c */
|
||||
VALUE rb_big_new(long, int);
|
||||
int rb_bigzero_p(VALUE x);
|
||||
VALUE rb_big_clone(VALUE);
|
||||
void rb_big_2comp(VALUE);
|
||||
VALUE rb_big_norm(VALUE);
|
||||
void rb_big_resize(VALUE big, long len);
|
||||
VALUE rb_uint2big(VALUE);
|
||||
VALUE rb_int2big(SIGNED_VALUE);
|
||||
VALUE rb_uint2inum(VALUE);
|
||||
VALUE rb_int2inum(SIGNED_VALUE);
|
||||
VALUE rb_cstr_to_inum(const char*, int, int);
|
||||
VALUE rb_str_to_inum(VALUE, int, int);
|
||||
VALUE rb_cstr2inum(const char*, int);
|
||||
VALUE rb_str2inum(VALUE, int);
|
||||
VALUE rb_big2str(VALUE, int);
|
||||
VALUE rb_big2str0(VALUE, int, int);
|
||||
SIGNED_VALUE rb_big2long(VALUE);
|
||||
#define rb_big2int(x) rb_big2long(x)
|
||||
VALUE rb_big2ulong(VALUE);
|
||||
#define rb_big2uint(x) rb_big2ulong(x)
|
||||
VALUE rb_big2ulong_pack(VALUE x);
|
||||
#if HAVE_LONG_LONG
|
||||
VALUE rb_ll2inum(LONG_LONG);
|
||||
VALUE rb_ull2inum(unsigned LONG_LONG);
|
||||
LONG_LONG rb_big2ll(VALUE);
|
||||
unsigned LONG_LONG rb_big2ull(VALUE);
|
||||
#endif /* HAVE_LONG_LONG */
|
||||
DEPRECATED(void rb_quad_pack(char*,VALUE));
|
||||
DEPRECATED(VALUE rb_quad_unpack(const char*,int));
|
||||
void rb_big_pack(VALUE val, unsigned long *buf, long num_longs);
|
||||
VALUE rb_big_unpack(unsigned long *buf, long num_longs);
|
||||
int rb_uv_to_utf8(char[6],unsigned long);
|
||||
VALUE rb_dbl2big(double);
|
||||
double rb_big2dbl(VALUE);
|
||||
VALUE rb_big_cmp(VALUE, VALUE);
|
||||
VALUE rb_big_eq(VALUE, VALUE);
|
||||
VALUE rb_big_eql(VALUE, VALUE);
|
||||
VALUE rb_big_plus(VALUE, VALUE);
|
||||
VALUE rb_big_minus(VALUE, VALUE);
|
||||
VALUE rb_big_mul(VALUE, VALUE);
|
||||
VALUE rb_big_div(VALUE, VALUE);
|
||||
VALUE rb_big_idiv(VALUE, VALUE);
|
||||
VALUE rb_big_modulo(VALUE, VALUE);
|
||||
VALUE rb_big_divmod(VALUE, VALUE);
|
||||
VALUE rb_big_pow(VALUE, VALUE);
|
||||
VALUE rb_big_and(VALUE, VALUE);
|
||||
VALUE rb_big_or(VALUE, VALUE);
|
||||
VALUE rb_big_xor(VALUE, VALUE);
|
||||
VALUE rb_big_lshift(VALUE, VALUE);
|
||||
VALUE rb_big_rshift(VALUE, VALUE);
|
||||
/* rational.c */
|
||||
VALUE rb_rational_raw(VALUE, VALUE);
|
||||
#define rb_rational_raw1(x) rb_rational_raw((x), INT2FIX(1))
|
||||
#define rb_rational_raw2(x,y) rb_rational_raw((x), (y))
|
||||
VALUE rb_rational_new(VALUE, VALUE);
|
||||
#define rb_rational_new1(x) rb_rational_new((x), INT2FIX(1))
|
||||
#define rb_rational_new2(x,y) rb_rational_new((x), (y))
|
||||
VALUE rb_Rational(VALUE, VALUE);
|
||||
#define rb_Rational1(x) rb_Rational((x), INT2FIX(1))
|
||||
#define rb_Rational2(x,y) rb_Rational((x), (y))
|
||||
/* complex.c */
|
||||
VALUE rb_complex_raw(VALUE, VALUE);
|
||||
#define rb_complex_raw1(x) rb_complex_raw((x), INT2FIX(0))
|
||||
#define rb_complex_raw2(x,y) rb_complex_raw((x), (y))
|
||||
VALUE rb_complex_new(VALUE, VALUE);
|
||||
#define rb_complex_new1(x) rb_complex_new((x), INT2FIX(0))
|
||||
#define rb_complex_new2(x,y) rb_complex_new((x), (y))
|
||||
VALUE rb_complex_polar(VALUE, VALUE);
|
||||
VALUE rb_Complex(VALUE, VALUE);
|
||||
#define rb_Complex1(x) rb_Complex((x), INT2FIX(0))
|
||||
#define rb_Complex2(x,y) rb_Complex((x), (y))
|
||||
/* class.c */
|
||||
VALUE rb_class_boot(VALUE);
|
||||
VALUE rb_class_new(VALUE);
|
||||
VALUE rb_mod_init_copy(VALUE, VALUE);
|
||||
VALUE rb_singleton_class_clone(VALUE);
|
||||
void rb_singleton_class_attached(VALUE,VALUE);
|
||||
VALUE rb_make_metaclass(VALUE, VALUE);
|
||||
void rb_check_inheritable(VALUE);
|
||||
VALUE rb_class_inherited(VALUE, VALUE);
|
||||
VALUE rb_define_class_id(ID, VALUE);
|
||||
VALUE rb_define_class_id_under(VALUE, ID, VALUE);
|
||||
VALUE rb_module_new(void);
|
||||
VALUE rb_define_module_id(ID);
|
||||
VALUE rb_define_module_id_under(VALUE, ID);
|
||||
VALUE rb_include_class_new(VALUE, VALUE);
|
||||
VALUE rb_mod_included_modules(VALUE);
|
||||
VALUE rb_mod_include_p(VALUE, VALUE);
|
||||
VALUE rb_mod_ancestors(VALUE);
|
||||
VALUE rb_class_instance_methods(int, VALUE*, VALUE);
|
||||
VALUE rb_class_public_instance_methods(int, VALUE*, VALUE);
|
||||
VALUE rb_class_protected_instance_methods(int, VALUE*, VALUE);
|
||||
VALUE rb_class_private_instance_methods(int, VALUE*, VALUE);
|
||||
VALUE rb_obj_singleton_methods(int, VALUE*, VALUE);
|
||||
void rb_define_method_id(VALUE, ID, VALUE (*)(ANYARGS), int);
|
||||
void rb_frozen_class_p(VALUE);
|
||||
void rb_undef(VALUE, ID);
|
||||
void rb_define_protected_method(VALUE, const char*, VALUE (*)(ANYARGS), int);
|
||||
void rb_define_private_method(VALUE, const char*, VALUE (*)(ANYARGS), int);
|
||||
void rb_define_singleton_method(VALUE, const char*, VALUE(*)(ANYARGS), int);
|
||||
VALUE rb_singleton_class(VALUE);
|
||||
/* compar.c */
|
||||
int rb_cmpint(VALUE, VALUE, VALUE);
|
||||
NORETURN(void rb_cmperr(VALUE, VALUE));
|
||||
/* cont.c */
|
||||
VALUE rb_fiber_new(VALUE (*)(ANYARGS), VALUE);
|
||||
VALUE rb_fiber_resume(VALUE fib, int argc, VALUE *args);
|
||||
VALUE rb_fiber_yield(int argc, VALUE *args);
|
||||
VALUE rb_fiber_current(void);
|
||||
VALUE rb_fiber_alive_p(VALUE);
|
||||
/* enum.c */
|
||||
VALUE rb_enum_values_pack(int, VALUE*);
|
||||
/* enumerator.c */
|
||||
VALUE rb_enumeratorize(VALUE, VALUE, int, VALUE *);
|
||||
VALUE rb_enumeratorize_with_size(VALUE, VALUE, int, VALUE *, VALUE (*)(ANYARGS));
|
||||
#define RETURN_SIZED_ENUMERATOR(obj, argc, argv, size_fn) do { \
|
||||
if (!rb_block_given_p()) \
|
||||
return rb_enumeratorize_with_size((obj), ID2SYM(rb_frame_this_func()),\
|
||||
(argc), (argv), (size_fn)); \
|
||||
} while (0)
|
||||
#define RETURN_ENUMERATOR(obj, argc, argv) RETURN_SIZED_ENUMERATOR(obj, argc, argv, 0)
|
||||
/* error.c */
|
||||
VALUE rb_exc_new(VALUE, const char*, long);
|
||||
VALUE rb_exc_new2(VALUE, const char*);
|
||||
VALUE rb_exc_new3(VALUE, VALUE);
|
||||
PRINTF_ARGS(NORETURN(void rb_loaderror(const char*, ...)), 1, 2);
|
||||
PRINTF_ARGS(NORETURN(void rb_loaderror_with_path(VALUE path, const char*, ...)), 2, 3);
|
||||
PRINTF_ARGS(NORETURN(void rb_name_error(ID, const char*, ...)), 2, 3);
|
||||
PRINTF_ARGS(NORETURN(void rb_name_error_str(VALUE, const char*, ...)), 2, 3);
|
||||
NORETURN(void rb_invalid_str(const char*, const char*));
|
||||
PRINTF_ARGS(void rb_compile_error(const char*, int, const char*, ...), 3, 4);
|
||||
PRINTF_ARGS(void rb_compile_error_with_enc(const char*, int, void *, const char*, ...), 4, 5);
|
||||
PRINTF_ARGS(void rb_compile_error_append(const char*, ...), 1, 2);
|
||||
NORETURN(void rb_error_frozen(const char*));
|
||||
void rb_error_untrusted(VALUE);
|
||||
void rb_check_frozen(VALUE);
|
||||
void rb_check_trusted(VALUE);
|
||||
#define rb_check_frozen_internal(obj) do { \
|
||||
VALUE frozen_obj = (obj); \
|
||||
if (OBJ_FROZEN(frozen_obj)) { \
|
||||
rb_error_frozen(rb_obj_classname(frozen_obj)); \
|
||||
} \
|
||||
} while (0)
|
||||
#define rb_check_trusted_internal(obj) do { \
|
||||
VALUE untrusted_obj = (obj); \
|
||||
if (!OBJ_UNTRUSTED(untrusted_obj)) { \
|
||||
rb_error_untrusted(untrusted_obj); \
|
||||
} \
|
||||
} while (0)
|
||||
#ifdef __GNUC__
|
||||
#define rb_check_frozen(obj) __extension__({rb_check_frozen_internal(obj);})
|
||||
#define rb_check_trusted(obj) __extension__({rb_check_trusted_internal(obj);})
|
||||
#else
|
||||
static inline void
|
||||
rb_check_frozen_inline(VALUE obj)
|
||||
{
|
||||
rb_check_frozen_internal(obj);
|
||||
}
|
||||
#define rb_check_frozen(obj) rb_check_frozen_inline(obj)
|
||||
static inline void
|
||||
rb_check_trusted_inline(VALUE obj)
|
||||
{
|
||||
rb_check_trusted_internal(obj);
|
||||
}
|
||||
#define rb_check_trusted(obj) rb_check_trusted_inline(obj)
|
||||
#endif
|
||||
void rb_check_copyable(VALUE obj, VALUE orig);
|
||||
|
||||
#define OBJ_INIT_COPY(obj, orig) \
|
||||
((obj) != (orig) && (rb_obj_init_copy((obj), (orig)), 1))
|
||||
|
||||
/* eval.c */
|
||||
int rb_sourceline(void);
|
||||
const char *rb_sourcefile(void);
|
||||
VALUE rb_check_funcall(VALUE, ID, int, VALUE*);
|
||||
|
||||
NORETURN(void rb_error_arity(int, int, int));
|
||||
#define rb_check_arity(argc, min, max) do { \
|
||||
if (((argc) < (min)) || ((argc) > (max) && (max) != UNLIMITED_ARGUMENTS)) \
|
||||
rb_error_arity(argc, min, max); \
|
||||
} while(0)
|
||||
|
||||
#if defined(NFDBITS) && defined(HAVE_RB_FD_INIT)
|
||||
typedef struct {
|
||||
int maxfd;
|
||||
fd_set *fdset;
|
||||
} rb_fdset_t;
|
||||
|
||||
void rb_fd_init(rb_fdset_t *);
|
||||
void rb_fd_term(rb_fdset_t *);
|
||||
void rb_fd_zero(rb_fdset_t *);
|
||||
void rb_fd_set(int, rb_fdset_t *);
|
||||
void rb_fd_clr(int, rb_fdset_t *);
|
||||
int rb_fd_isset(int, const rb_fdset_t *);
|
||||
void rb_fd_copy(rb_fdset_t *, const fd_set *, int);
|
||||
void rb_fd_dup(rb_fdset_t *dst, const rb_fdset_t *src);
|
||||
int rb_fd_select(int, rb_fdset_t *, rb_fdset_t *, rb_fdset_t *, struct timeval *);
|
||||
|
||||
#define rb_fd_ptr(f) ((f)->fdset)
|
||||
#define rb_fd_max(f) ((f)->maxfd)
|
||||
|
||||
#elif defined(_WIN32)
|
||||
|
||||
typedef struct {
|
||||
int capa;
|
||||
fd_set *fdset;
|
||||
} rb_fdset_t;
|
||||
|
||||
void rb_fd_init(rb_fdset_t *);
|
||||
void rb_fd_term(rb_fdset_t *);
|
||||
#define rb_fd_zero(f) ((f)->fdset->fd_count = 0)
|
||||
void rb_fd_set(int, rb_fdset_t *);
|
||||
#define rb_fd_clr(n, f) rb_w32_fdclr((n), (f)->fdset)
|
||||
#define rb_fd_isset(n, f) rb_w32_fdisset((n), (f)->fdset)
|
||||
#define rb_fd_copy(d, s, n) rb_w32_fd_copy((d), (s), (n))
|
||||
void rb_w32_fd_copy(rb_fdset_t *, const fd_set *, int);
|
||||
#define rb_fd_dup(d, s) rb_w32_fd_dup((d), (s))
|
||||
void rb_w32_fd_dup(rb_fdset_t *dst, const rb_fdset_t *src);
|
||||
#define rb_fd_select(n, rfds, wfds, efds, timeout) rb_w32_select((n), (rfds) ? ((rb_fdset_t*)(rfds))->fdset : NULL, (wfds) ? ((rb_fdset_t*)(wfds))->fdset : NULL, (efds) ? ((rb_fdset_t*)(efds))->fdset: NULL, (timeout))
|
||||
#define rb_fd_resize(n, f) ((void)(f))
|
||||
|
||||
#define rb_fd_ptr(f) ((f)->fdset)
|
||||
#define rb_fd_max(f) ((f)->fdset->fd_count)
|
||||
|
||||
#else
|
||||
|
||||
typedef fd_set rb_fdset_t;
|
||||
#define rb_fd_zero(f) FD_ZERO(f)
|
||||
#define rb_fd_set(n, f) FD_SET((n), (f))
|
||||
#define rb_fd_clr(n, f) FD_CLR((n), (f))
|
||||
#define rb_fd_isset(n, f) FD_ISSET((n), (f))
|
||||
#define rb_fd_copy(d, s, n) (*(d) = *(s))
|
||||
#define rb_fd_dup(d, s) (*(d) = *(s))
|
||||
#define rb_fd_resize(n, f) ((void)(f))
|
||||
#define rb_fd_ptr(f) (f)
|
||||
#define rb_fd_init(f) FD_ZERO(f)
|
||||
#define rb_fd_init_copy(d, s) (*(d) = *(s))
|
||||
#define rb_fd_term(f) ((void)(f))
|
||||
#define rb_fd_max(f) FD_SETSIZE
|
||||
#define rb_fd_select(n, rfds, wfds, efds, timeout) select((n), (rfds), (wfds), (efds), (timeout))
|
||||
|
||||
#endif
|
||||
|
||||
NORETURN(void rb_exc_raise(VALUE));
|
||||
NORETURN(void rb_exc_fatal(VALUE));
|
||||
VALUE rb_f_exit(int,VALUE*);
|
||||
VALUE rb_f_abort(int,VALUE*);
|
||||
void rb_remove_method(VALUE, const char*);
|
||||
void rb_remove_method_id(VALUE, ID);
|
||||
#define rb_disable_super(klass, name) ((void)0)
|
||||
#define rb_enable_super(klass, name) ((void)0)
|
||||
#define HAVE_RB_DEFINE_ALLOC_FUNC 1
|
||||
typedef VALUE (*rb_alloc_func_t)(VALUE);
|
||||
void rb_define_alloc_func(VALUE, rb_alloc_func_t);
|
||||
void rb_undef_alloc_func(VALUE);
|
||||
rb_alloc_func_t rb_get_alloc_func(VALUE);
|
||||
void rb_clear_cache(void);
|
||||
void rb_clear_cache_by_class(VALUE);
|
||||
void rb_alias(VALUE, ID, ID);
|
||||
void rb_attr(VALUE,ID,int,int,int);
|
||||
int rb_method_boundp(VALUE, ID, int);
|
||||
int rb_method_basic_definition_p(VALUE, ID);
|
||||
VALUE rb_eval_cmd(VALUE, VALUE, int);
|
||||
int rb_obj_respond_to(VALUE, ID, int);
|
||||
int rb_respond_to(VALUE, ID);
|
||||
VALUE rb_f_notimplement(int argc, VALUE *argv, VALUE obj);
|
||||
void rb_interrupt(void);
|
||||
VALUE rb_apply(VALUE, ID, VALUE);
|
||||
void rb_backtrace(void);
|
||||
ID rb_frame_this_func(void);
|
||||
VALUE rb_obj_instance_eval(int, VALUE*, VALUE);
|
||||
VALUE rb_obj_instance_exec(int, VALUE*, VALUE);
|
||||
VALUE rb_mod_module_eval(int, VALUE*, VALUE);
|
||||
VALUE rb_mod_module_exec(int, VALUE*, VALUE);
|
||||
void rb_load(VALUE, int);
|
||||
void rb_load_protect(VALUE, int, int*);
|
||||
NORETURN(void rb_jump_tag(int));
|
||||
int rb_provided(const char*);
|
||||
int rb_feature_provided(const char *, const char **);
|
||||
void rb_provide(const char*);
|
||||
VALUE rb_f_require(VALUE, VALUE);
|
||||
VALUE rb_require_safe(VALUE, int);
|
||||
void rb_obj_call_init(VALUE, int, VALUE*);
|
||||
VALUE rb_class_new_instance(int, VALUE*, VALUE);
|
||||
VALUE rb_block_proc(void);
|
||||
VALUE rb_block_lambda(void);
|
||||
VALUE rb_proc_new(VALUE (*)(ANYARGS/* VALUE yieldarg[, VALUE procarg] */), VALUE);
|
||||
VALUE rb_obj_is_proc(VALUE);
|
||||
VALUE rb_proc_call(VALUE, VALUE);
|
||||
VALUE rb_proc_call_with_block(VALUE, int argc, VALUE *argv, VALUE);
|
||||
int rb_proc_arity(VALUE);
|
||||
VALUE rb_proc_lambda_p(VALUE);
|
||||
VALUE rb_binding_new(void);
|
||||
VALUE rb_obj_method(VALUE, VALUE);
|
||||
VALUE rb_obj_is_method(VALUE);
|
||||
VALUE rb_method_call(int, VALUE*, VALUE);
|
||||
VALUE rb_method_call_with_block(int, VALUE *, VALUE, VALUE);
|
||||
int rb_mod_method_arity(VALUE, ID);
|
||||
int rb_obj_method_arity(VALUE, ID);
|
||||
VALUE rb_protect(VALUE (*)(VALUE), VALUE, int*);
|
||||
void rb_set_end_proc(void (*)(VALUE), VALUE);
|
||||
void rb_exec_end_proc(void);
|
||||
void rb_thread_schedule(void);
|
||||
void rb_thread_wait_fd(int);
|
||||
int rb_thread_fd_writable(int);
|
||||
void rb_thread_fd_close(int);
|
||||
int rb_thread_alone(void);
|
||||
DEPRECATED(void rb_thread_polling(void));
|
||||
void rb_thread_sleep(int);
|
||||
void rb_thread_sleep_forever(void);
|
||||
VALUE rb_thread_stop(void);
|
||||
VALUE rb_thread_wakeup(VALUE);
|
||||
VALUE rb_thread_wakeup_alive(VALUE);
|
||||
VALUE rb_thread_run(VALUE);
|
||||
VALUE rb_thread_kill(VALUE);
|
||||
VALUE rb_thread_create(VALUE (*)(ANYARGS), void*);
|
||||
DEPRECATED(int rb_thread_select(int, fd_set *, fd_set *, fd_set *, struct timeval *));
|
||||
int rb_thread_fd_select(int, rb_fdset_t *, rb_fdset_t *, rb_fdset_t *, struct timeval *);
|
||||
void rb_thread_wait_for(struct timeval);
|
||||
VALUE rb_thread_current(void);
|
||||
VALUE rb_thread_main(void);
|
||||
VALUE rb_thread_local_aref(VALUE, ID);
|
||||
VALUE rb_thread_local_aset(VALUE, ID, VALUE);
|
||||
void rb_thread_atfork(void);
|
||||
void rb_thread_atfork_before_exec(void);
|
||||
VALUE rb_exec_recursive(VALUE(*)(VALUE, VALUE, int),VALUE,VALUE);
|
||||
VALUE rb_exec_recursive_paired(VALUE(*)(VALUE, VALUE, int),VALUE,VALUE,VALUE);
|
||||
VALUE rb_exec_recursive_outer(VALUE(*)(VALUE, VALUE, int),VALUE,VALUE);
|
||||
/* dir.c */
|
||||
VALUE rb_dir_getwd(void);
|
||||
/* file.c */
|
||||
VALUE rb_file_s_expand_path(int, VALUE *);
|
||||
VALUE rb_file_expand_path(VALUE, VALUE);
|
||||
VALUE rb_file_s_absolute_path(int, VALUE *);
|
||||
VALUE rb_file_absolute_path(VALUE, VALUE);
|
||||
VALUE rb_file_dirname(VALUE fname);
|
||||
int rb_find_file_ext_safe(VALUE*, const char* const*, int);
|
||||
VALUE rb_find_file_safe(VALUE, int);
|
||||
int rb_find_file_ext(VALUE*, const char* const*);
|
||||
VALUE rb_find_file(VALUE);
|
||||
VALUE rb_file_directory_p(VALUE,VALUE);
|
||||
VALUE rb_str_encode_ospath(VALUE);
|
||||
int rb_is_absolute_path(const char *);
|
||||
/* gc.c */
|
||||
NORETURN(void rb_memerror(void));
|
||||
int rb_during_gc(void);
|
||||
void rb_gc_mark_locations(VALUE*, VALUE*);
|
||||
void rb_mark_tbl(struct st_table*);
|
||||
void rb_mark_set(struct st_table*);
|
||||
void rb_mark_hash(struct st_table*);
|
||||
void rb_gc_mark_maybe(VALUE);
|
||||
void rb_gc_mark(VALUE);
|
||||
void rb_gc_force_recycle(VALUE);
|
||||
void rb_gc(void);
|
||||
void rb_gc_copy_finalizer(VALUE,VALUE);
|
||||
void rb_gc_finalize_deferred(void);
|
||||
void rb_gc_call_finalizer_at_exit(void);
|
||||
VALUE rb_gc_enable(void);
|
||||
VALUE rb_gc_disable(void);
|
||||
VALUE rb_gc_start(void);
|
||||
void rb_gc_set_params(void);
|
||||
/* hash.c */
|
||||
void st_foreach_safe(struct st_table *, int (*)(ANYARGS), st_data_t);
|
||||
VALUE rb_check_hash_type(VALUE);
|
||||
void rb_hash_foreach(VALUE, int (*)(ANYARGS), VALUE);
|
||||
VALUE rb_hash(VALUE);
|
||||
VALUE rb_hash_new(void);
|
||||
VALUE rb_hash_dup(VALUE);
|
||||
VALUE rb_hash_freeze(VALUE);
|
||||
VALUE rb_hash_aref(VALUE, VALUE);
|
||||
VALUE rb_hash_lookup(VALUE, VALUE);
|
||||
VALUE rb_hash_lookup2(VALUE, VALUE, VALUE);
|
||||
VALUE rb_hash_fetch(VALUE, VALUE);
|
||||
VALUE rb_hash_aset(VALUE, VALUE, VALUE);
|
||||
VALUE rb_hash_clear(VALUE);
|
||||
VALUE rb_hash_delete_if(VALUE);
|
||||
VALUE rb_hash_delete(VALUE,VALUE);
|
||||
typedef VALUE rb_hash_update_func(VALUE newkey, VALUE oldkey, VALUE value);
|
||||
VALUE rb_hash_update_by(VALUE hash1, VALUE hash2, rb_hash_update_func *func);
|
||||
struct st_table *rb_hash_tbl(VALUE);
|
||||
int rb_path_check(const char*);
|
||||
int rb_env_path_tainted(void);
|
||||
VALUE rb_env_clear(void);
|
||||
/* io.c */
|
||||
#define rb_defout rb_stdout
|
||||
RUBY_EXTERN VALUE rb_fs;
|
||||
RUBY_EXTERN VALUE rb_output_fs;
|
||||
RUBY_EXTERN VALUE rb_rs;
|
||||
RUBY_EXTERN VALUE rb_default_rs;
|
||||
RUBY_EXTERN VALUE rb_output_rs;
|
||||
VALUE rb_io_write(VALUE, VALUE);
|
||||
VALUE rb_io_gets(VALUE);
|
||||
VALUE rb_io_getbyte(VALUE);
|
||||
VALUE rb_io_ungetc(VALUE, VALUE);
|
||||
VALUE rb_io_ungetbyte(VALUE, VALUE);
|
||||
VALUE rb_io_close(VALUE);
|
||||
VALUE rb_io_flush(VALUE);
|
||||
VALUE rb_io_eof(VALUE);
|
||||
VALUE rb_io_binmode(VALUE);
|
||||
VALUE rb_io_ascii8bit_binmode(VALUE);
|
||||
VALUE rb_io_addstr(VALUE, VALUE);
|
||||
VALUE rb_io_printf(int, VALUE*, VALUE);
|
||||
VALUE rb_io_print(int, VALUE*, VALUE);
|
||||
VALUE rb_io_puts(int, VALUE*, VALUE);
|
||||
VALUE rb_io_fdopen(int, int, const char*);
|
||||
VALUE rb_io_get_io(VALUE);
|
||||
VALUE rb_file_open(const char*, const char*);
|
||||
VALUE rb_file_open_str(VALUE, const char*);
|
||||
VALUE rb_gets(void);
|
||||
void rb_write_error(const char*);
|
||||
void rb_write_error2(const char*, long);
|
||||
void rb_close_before_exec(int lowfd, int maxhint, VALUE noclose_fds);
|
||||
int rb_pipe(int *pipes);
|
||||
int rb_reserved_fd_p(int fd);
|
||||
int rb_cloexec_open(const char *pathname, int flags, mode_t mode);
|
||||
int rb_cloexec_dup(int oldfd);
|
||||
int rb_cloexec_dup2(int oldfd, int newfd);
|
||||
int rb_cloexec_pipe(int fildes[2]);
|
||||
int rb_cloexec_fcntl_dupfd(int fd, int minfd);
|
||||
#define RB_RESERVED_FD_P(fd) rb_reserved_fd_p(fd)
|
||||
void rb_update_max_fd(int fd);
|
||||
void rb_fd_fix_cloexec(int fd);
|
||||
/* marshal.c */
|
||||
VALUE rb_marshal_dump(VALUE, VALUE);
|
||||
VALUE rb_marshal_load(VALUE);
|
||||
void rb_marshal_define_compat(VALUE newclass, VALUE oldclass, VALUE (*dumper)(VALUE), VALUE (*loader)(VALUE, VALUE));
|
||||
/* numeric.c */
|
||||
NORETURN(void rb_num_zerodiv(void));
|
||||
#define RB_NUM_COERCE_FUNCS_NEED_OPID 1
|
||||
VALUE rb_num_coerce_bin(VALUE, VALUE, ID);
|
||||
VALUE rb_num_coerce_cmp(VALUE, VALUE, ID);
|
||||
VALUE rb_num_coerce_relop(VALUE, VALUE, ID);
|
||||
VALUE rb_num_coerce_bit(VALUE, VALUE, ID);
|
||||
VALUE rb_num2fix(VALUE);
|
||||
VALUE rb_fix2str(VALUE, int);
|
||||
VALUE rb_dbl_cmp(double, double);
|
||||
/* object.c */
|
||||
int rb_eql(VALUE, VALUE);
|
||||
VALUE rb_any_to_s(VALUE);
|
||||
VALUE rb_inspect(VALUE);
|
||||
VALUE rb_obj_is_instance_of(VALUE, VALUE);
|
||||
VALUE rb_obj_is_kind_of(VALUE, VALUE);
|
||||
VALUE rb_obj_alloc(VALUE);
|
||||
VALUE rb_obj_clone(VALUE);
|
||||
VALUE rb_obj_dup(VALUE);
|
||||
VALUE rb_obj_init_copy(VALUE,VALUE);
|
||||
VALUE rb_obj_taint(VALUE);
|
||||
VALUE rb_obj_tainted(VALUE);
|
||||
VALUE rb_obj_untaint(VALUE);
|
||||
VALUE rb_obj_untrust(VALUE);
|
||||
VALUE rb_obj_untrusted(VALUE);
|
||||
VALUE rb_obj_trust(VALUE);
|
||||
VALUE rb_obj_freeze(VALUE);
|
||||
VALUE rb_obj_frozen_p(VALUE);
|
||||
VALUE rb_obj_id(VALUE);
|
||||
VALUE rb_obj_class(VALUE);
|
||||
VALUE rb_class_real(VALUE);
|
||||
VALUE rb_class_inherited_p(VALUE, VALUE);
|
||||
VALUE rb_class_superclass(VALUE);
|
||||
VALUE rb_class_get_superclass(VALUE);
|
||||
VALUE rb_convert_type(VALUE,int,const char*,const char*);
|
||||
VALUE rb_check_convert_type(VALUE,int,const char*,const char*);
|
||||
VALUE rb_check_to_integer(VALUE, const char *);
|
||||
VALUE rb_check_to_float(VALUE);
|
||||
VALUE rb_to_int(VALUE);
|
||||
VALUE rb_check_to_int(VALUE);
|
||||
VALUE rb_Integer(VALUE);
|
||||
VALUE rb_to_float(VALUE);
|
||||
VALUE rb_Float(VALUE);
|
||||
VALUE rb_String(VALUE);
|
||||
VALUE rb_Array(VALUE);
|
||||
VALUE rb_Hash(VALUE);
|
||||
double rb_cstr_to_dbl(const char*, int);
|
||||
double rb_str_to_dbl(VALUE, int);
|
||||
/* parse.y */
|
||||
RUBY_EXTERN int ruby_sourceline;
|
||||
RUBY_EXTERN char *ruby_sourcefile;
|
||||
ID rb_id_attrset(ID);
|
||||
int rb_is_const_id(ID);
|
||||
int rb_is_global_id(ID);
|
||||
int rb_is_instance_id(ID);
|
||||
int rb_is_attrset_id(ID);
|
||||
int rb_is_class_id(ID);
|
||||
int rb_is_local_id(ID);
|
||||
int rb_is_junk_id(ID);
|
||||
int rb_symname_p(const char*);
|
||||
int rb_sym_interned_p(VALUE);
|
||||
VALUE rb_backref_get(void);
|
||||
void rb_backref_set(VALUE);
|
||||
VALUE rb_lastline_get(void);
|
||||
void rb_lastline_set(VALUE);
|
||||
VALUE rb_sym_all_symbols(void);
|
||||
/* process.c */
|
||||
void rb_last_status_set(int status, rb_pid_t pid);
|
||||
VALUE rb_last_status_get(void);
|
||||
struct rb_exec_arg {
|
||||
VALUE execarg_obj;
|
||||
};
|
||||
DEPRECATED(int rb_proc_exec_n(int, VALUE*, const char*));
|
||||
int rb_proc_exec(const char*);
|
||||
DEPRECATED(VALUE rb_exec_arg_init(int argc, VALUE *argv, int accept_shell, struct rb_exec_arg *e));
|
||||
DEPRECATED(int rb_exec_arg_addopt(struct rb_exec_arg *e, VALUE key, VALUE val));
|
||||
DEPRECATED(void rb_exec_arg_fixup(struct rb_exec_arg *e));
|
||||
DEPRECATED(int rb_run_exec_options(const struct rb_exec_arg *e, struct rb_exec_arg *s));
|
||||
DEPRECATED(int rb_run_exec_options_err(const struct rb_exec_arg *e, struct rb_exec_arg *s, char*, size_t));
|
||||
DEPRECATED(int rb_exec(const struct rb_exec_arg*));
|
||||
DEPRECATED(int rb_exec_err(const struct rb_exec_arg*, char*, size_t));
|
||||
DEPRECATED(rb_pid_t rb_fork(int*, int (*)(void*), void*, VALUE));
|
||||
DEPRECATED(rb_pid_t rb_fork_err(int*, int (*)(void*, char*, size_t), void*, VALUE, char*, size_t));
|
||||
VALUE rb_f_exec(int,VALUE*);
|
||||
rb_pid_t rb_waitpid(rb_pid_t pid, int *status, int flags);
|
||||
void rb_syswait(rb_pid_t pid);
|
||||
rb_pid_t rb_spawn(int, VALUE*);
|
||||
rb_pid_t rb_spawn_err(int, VALUE*, char*, size_t);
|
||||
VALUE rb_proc_times(VALUE);
|
||||
VALUE rb_detach_process(rb_pid_t pid);
|
||||
/* range.c */
|
||||
VALUE rb_range_new(VALUE, VALUE, int);
|
||||
VALUE rb_range_beg_len(VALUE, long*, long*, long, int);
|
||||
int rb_range_values(VALUE range, VALUE *begp, VALUE *endp, int *exclp);
|
||||
/* random.c */
|
||||
unsigned int rb_genrand_int32(void);
|
||||
double rb_genrand_real(void);
|
||||
void rb_reset_random_seed(void);
|
||||
VALUE rb_random_bytes(VALUE rnd, long n);
|
||||
VALUE rb_random_int(VALUE rnd, VALUE max);
|
||||
unsigned int rb_random_int32(VALUE rnd);
|
||||
double rb_random_real(VALUE rnd);
|
||||
unsigned long rb_random_ulong_limited(VALUE rnd, unsigned long limit);
|
||||
unsigned long rb_genrand_ulong_limited(unsigned long i);
|
||||
/* re.c */
|
||||
#define rb_memcmp memcmp
|
||||
int rb_memcicmp(const void*,const void*,long);
|
||||
void rb_match_busy(VALUE);
|
||||
VALUE rb_reg_nth_defined(int, VALUE);
|
||||
VALUE rb_reg_nth_match(int, VALUE);
|
||||
int rb_reg_backref_number(VALUE match, VALUE backref);
|
||||
VALUE rb_reg_last_match(VALUE);
|
||||
VALUE rb_reg_match_pre(VALUE);
|
||||
VALUE rb_reg_match_post(VALUE);
|
||||
VALUE rb_reg_match_last(VALUE);
|
||||
#define HAVE_RB_REG_NEW_STR 1
|
||||
VALUE rb_reg_new_str(VALUE, int);
|
||||
VALUE rb_reg_new(const char *, long, int);
|
||||
VALUE rb_reg_alloc(void);
|
||||
VALUE rb_reg_init_str(VALUE re, VALUE s, int options);
|
||||
VALUE rb_reg_match(VALUE, VALUE);
|
||||
VALUE rb_reg_match2(VALUE);
|
||||
int rb_reg_options(VALUE);
|
||||
/* ruby.c */
|
||||
#define rb_argv rb_get_argv()
|
||||
RUBY_EXTERN VALUE rb_argv0;
|
||||
VALUE rb_get_argv(void);
|
||||
void *rb_load_file(const char*);
|
||||
void *rb_load_file_str(VALUE);
|
||||
/* signal.c */
|
||||
VALUE rb_f_kill(int, VALUE*);
|
||||
#ifdef POSIX_SIGNAL
|
||||
#define posix_signal ruby_posix_signal
|
||||
RETSIGTYPE (*posix_signal(int, RETSIGTYPE (*)(int)))(int);
|
||||
#endif
|
||||
void rb_trap_exit(void);
|
||||
void rb_trap_exec(void);
|
||||
const char *ruby_signal_name(int);
|
||||
void ruby_default_signal(int);
|
||||
/* sprintf.c */
|
||||
VALUE rb_f_sprintf(int, const VALUE*);
|
||||
PRINTF_ARGS(VALUE rb_sprintf(const char*, ...), 1, 2);
|
||||
VALUE rb_vsprintf(const char*, va_list);
|
||||
PRINTF_ARGS(VALUE rb_str_catf(VALUE, const char*, ...), 2, 3);
|
||||
VALUE rb_str_vcatf(VALUE, const char*, va_list);
|
||||
VALUE rb_str_format(int, const VALUE *, VALUE);
|
||||
/* string.c */
|
||||
VALUE rb_str_new(const char*, long);
|
||||
VALUE rb_str_new_cstr(const char*);
|
||||
VALUE rb_str_new2(const char*);
|
||||
VALUE rb_str_new_shared(VALUE);
|
||||
VALUE rb_str_new3(VALUE);
|
||||
VALUE rb_str_new_frozen(VALUE);
|
||||
VALUE rb_str_new4(VALUE);
|
||||
VALUE rb_str_new_with_class(VALUE, const char*, long);
|
||||
VALUE rb_str_new5(VALUE, const char*, long);
|
||||
VALUE rb_tainted_str_new_cstr(const char*);
|
||||
VALUE rb_tainted_str_new(const char*, long);
|
||||
VALUE rb_tainted_str_new2(const char*);
|
||||
VALUE rb_external_str_new(const char*, long);
|
||||
VALUE rb_external_str_new_cstr(const char*);
|
||||
VALUE rb_locale_str_new(const char*, long);
|
||||
VALUE rb_locale_str_new_cstr(const char*);
|
||||
VALUE rb_filesystem_str_new(const char*, long);
|
||||
VALUE rb_filesystem_str_new_cstr(const char*);
|
||||
VALUE rb_str_buf_new(long);
|
||||
VALUE rb_str_buf_new_cstr(const char*);
|
||||
VALUE rb_str_buf_new2(const char*);
|
||||
VALUE rb_str_tmp_new(long);
|
||||
VALUE rb_usascii_str_new(const char*, long);
|
||||
VALUE rb_usascii_str_new_cstr(const char*);
|
||||
VALUE rb_usascii_str_new2(const char*);
|
||||
void rb_str_free(VALUE);
|
||||
void rb_str_shared_replace(VALUE, VALUE);
|
||||
VALUE rb_str_buf_append(VALUE, VALUE);
|
||||
VALUE rb_str_buf_cat(VALUE, const char*, long);
|
||||
VALUE rb_str_buf_cat2(VALUE, const char*);
|
||||
VALUE rb_str_buf_cat_ascii(VALUE, const char*);
|
||||
VALUE rb_obj_as_string(VALUE);
|
||||
VALUE rb_check_string_type(VALUE);
|
||||
void rb_must_asciicompat(VALUE);
|
||||
VALUE rb_str_dup(VALUE);
|
||||
VALUE rb_str_resurrect(VALUE str);
|
||||
VALUE rb_str_locktmp(VALUE);
|
||||
VALUE rb_str_unlocktmp(VALUE);
|
||||
VALUE rb_str_dup_frozen(VALUE);
|
||||
#define rb_str_dup_frozen rb_str_new_frozen
|
||||
VALUE rb_str_plus(VALUE, VALUE);
|
||||
VALUE rb_str_times(VALUE, VALUE);
|
||||
long rb_str_sublen(VALUE, long);
|
||||
VALUE rb_str_substr(VALUE, long, long);
|
||||
VALUE rb_str_subseq(VALUE, long, long);
|
||||
void rb_str_modify(VALUE);
|
||||
void rb_str_modify_expand(VALUE, long);
|
||||
VALUE rb_str_freeze(VALUE);
|
||||
void rb_str_set_len(VALUE, long);
|
||||
VALUE rb_str_resize(VALUE, long);
|
||||
VALUE rb_str_cat(VALUE, const char*, long);
|
||||
VALUE rb_str_cat2(VALUE, const char*);
|
||||
VALUE rb_str_append(VALUE, VALUE);
|
||||
VALUE rb_str_concat(VALUE, VALUE);
|
||||
st_index_t rb_memhash(const void *ptr, long len);
|
||||
st_index_t rb_hash_start(st_index_t);
|
||||
st_index_t rb_hash_uint32(st_index_t, uint32_t);
|
||||
st_index_t rb_hash_uint(st_index_t, st_index_t);
|
||||
st_index_t rb_hash_end(st_index_t);
|
||||
#define rb_hash_uint32(h, i) st_hash_uint32((h), (i))
|
||||
#define rb_hash_uint(h, i) st_hash_uint((h), (i))
|
||||
#define rb_hash_end(h) st_hash_end(h)
|
||||
st_index_t rb_str_hash(VALUE);
|
||||
int rb_str_hash_cmp(VALUE,VALUE);
|
||||
int rb_str_comparable(VALUE, VALUE);
|
||||
int rb_str_cmp(VALUE, VALUE);
|
||||
VALUE rb_str_equal(VALUE str1, VALUE str2);
|
||||
VALUE rb_str_drop_bytes(VALUE, long);
|
||||
void rb_str_update(VALUE, long, long, VALUE);
|
||||
VALUE rb_str_replace(VALUE, VALUE);
|
||||
VALUE rb_str_inspect(VALUE);
|
||||
VALUE rb_str_dump(VALUE);
|
||||
VALUE rb_str_split(VALUE, const char*);
|
||||
void rb_str_associate(VALUE, VALUE);
|
||||
VALUE rb_str_associated(VALUE);
|
||||
void rb_str_setter(VALUE, ID, VALUE*);
|
||||
VALUE rb_str_intern(VALUE);
|
||||
VALUE rb_sym_to_s(VALUE);
|
||||
long rb_str_strlen(VALUE);
|
||||
VALUE rb_str_length(VALUE);
|
||||
long rb_str_offset(VALUE, long);
|
||||
size_t rb_str_capacity(VALUE);
|
||||
VALUE rb_str_ellipsize(VALUE, long);
|
||||
#if defined(__GNUC__) && !defined(__PCC__)
|
||||
#define rb_str_new_cstr(str) __extension__ ( \
|
||||
{ \
|
||||
(__builtin_constant_p(str)) ? \
|
||||
rb_str_new((str), (long)strlen(str)) : \
|
||||
rb_str_new_cstr(str); \
|
||||
})
|
||||
#define rb_tainted_str_new_cstr(str) __extension__ ( \
|
||||
{ \
|
||||
(__builtin_constant_p(str)) ? \
|
||||
rb_tainted_str_new((str), (long)strlen(str)) : \
|
||||
rb_tainted_str_new_cstr(str); \
|
||||
})
|
||||
#define rb_usascii_str_new_cstr(str) __extension__ ( \
|
||||
{ \
|
||||
(__builtin_constant_p(str)) ? \
|
||||
rb_usascii_str_new((str), (long)strlen(str)) : \
|
||||
rb_usascii_str_new_cstr(str); \
|
||||
})
|
||||
#define rb_external_str_new_cstr(str) __extension__ ( \
|
||||
{ \
|
||||
(__builtin_constant_p(str)) ? \
|
||||
rb_external_str_new((str), (long)strlen(str)) : \
|
||||
rb_external_str_new_cstr(str); \
|
||||
})
|
||||
#define rb_locale_str_new_cstr(str) __extension__ ( \
|
||||
{ \
|
||||
(__builtin_constant_p(str)) ? \
|
||||
rb_locale_str_new((str), (long)strlen(str)) : \
|
||||
rb_locale_str_new_cstr(str); \
|
||||
})
|
||||
#define rb_str_buf_new_cstr(str) __extension__ ( \
|
||||
{ \
|
||||
(__builtin_constant_p(str)) ? \
|
||||
rb_str_buf_cat(rb_str_buf_new((long)strlen(str)), \
|
||||
(str), (long)strlen(str)) : \
|
||||
rb_str_buf_new_cstr(str); \
|
||||
})
|
||||
#define rb_str_buf_cat2(str, ptr) __extension__ ( \
|
||||
{ \
|
||||
(__builtin_constant_p(ptr)) ? \
|
||||
rb_str_buf_cat((str), (ptr), (long)strlen(ptr)) : \
|
||||
rb_str_buf_cat2((str), (ptr)); \
|
||||
})
|
||||
#define rb_str_cat2(str, ptr) __extension__ ( \
|
||||
{ \
|
||||
(__builtin_constant_p(ptr)) ? \
|
||||
rb_str_cat((str), (ptr), (long)strlen(ptr)) : \
|
||||
rb_str_cat2((str), (ptr)); \
|
||||
})
|
||||
#define rb_exc_new2(klass, ptr) __extension__ ( \
|
||||
{ \
|
||||
(__builtin_constant_p(ptr)) ? \
|
||||
rb_exc_new((klass), (ptr), (long)strlen(ptr)) : \
|
||||
rb_exc_new2((klass), (ptr)); \
|
||||
})
|
||||
#endif
|
||||
#define rb_str_new2 rb_str_new_cstr
|
||||
#define rb_str_new3 rb_str_new_shared
|
||||
#define rb_str_new4 rb_str_new_frozen
|
||||
#define rb_str_new5 rb_str_new_with_class
|
||||
#define rb_tainted_str_new2 rb_tainted_str_new_cstr
|
||||
#define rb_str_buf_new2 rb_str_buf_new_cstr
|
||||
#define rb_usascii_str_new2 rb_usascii_str_new_cstr
|
||||
/* struct.c */
|
||||
VALUE rb_struct_new(VALUE, ...);
|
||||
VALUE rb_struct_define(const char*, ...);
|
||||
VALUE rb_struct_alloc(VALUE, VALUE);
|
||||
VALUE rb_struct_initialize(VALUE, VALUE);
|
||||
VALUE rb_struct_aref(VALUE, VALUE);
|
||||
VALUE rb_struct_aset(VALUE, VALUE, VALUE);
|
||||
VALUE rb_struct_getmember(VALUE, ID);
|
||||
DEPRECATED(VALUE rb_struct_iv_get(VALUE, const char*));
|
||||
VALUE rb_struct_s_members(VALUE);
|
||||
VALUE rb_struct_members(VALUE);
|
||||
VALUE rb_struct_alloc_noinit(VALUE);
|
||||
VALUE rb_struct_define_without_accessor(const char *, VALUE, rb_alloc_func_t, ...);
|
||||
/* thread.c */
|
||||
typedef void rb_unblock_function_t(void *);
|
||||
typedef VALUE rb_blocking_function_t(void *);
|
||||
void rb_thread_check_ints(void);
|
||||
int rb_thread_interrupted(VALUE thval);
|
||||
|
||||
/* Use rb_thread_call_without_gvl family instead. */
|
||||
DEPRECATED(VALUE rb_thread_blocking_region(rb_blocking_function_t *func, void *data1,
|
||||
rb_unblock_function_t *ubf, void *data2));
|
||||
#define RUBY_UBF_IO ((rb_unblock_function_t *)-1)
|
||||
#define RUBY_UBF_PROCESS ((rb_unblock_function_t *)-1)
|
||||
VALUE rb_mutex_new(void);
|
||||
VALUE rb_mutex_locked_p(VALUE mutex);
|
||||
VALUE rb_mutex_trylock(VALUE mutex);
|
||||
VALUE rb_mutex_lock(VALUE mutex);
|
||||
VALUE rb_mutex_unlock(VALUE mutex);
|
||||
VALUE rb_mutex_sleep(VALUE self, VALUE timeout);
|
||||
VALUE rb_mutex_synchronize(VALUE mutex, VALUE (*func)(VALUE arg), VALUE arg);
|
||||
/* time.c */
|
||||
VALUE rb_time_new(time_t, long);
|
||||
VALUE rb_time_nano_new(time_t, long);
|
||||
VALUE rb_time_num_new(VALUE, VALUE);
|
||||
struct timeval rb_time_interval(VALUE num);
|
||||
struct timeval rb_time_timeval(VALUE time);
|
||||
struct timespec rb_time_timespec(VALUE time);
|
||||
/* variable.c */
|
||||
VALUE rb_mod_name(VALUE);
|
||||
VALUE rb_class_path(VALUE);
|
||||
void rb_set_class_path(VALUE, VALUE, const char*);
|
||||
void rb_set_class_path_string(VALUE, VALUE, VALUE);
|
||||
VALUE rb_path_to_class(VALUE);
|
||||
VALUE rb_path2class(const char*);
|
||||
void rb_name_class(VALUE, ID);
|
||||
VALUE rb_class_name(VALUE);
|
||||
void rb_autoload(VALUE, ID, const char*);
|
||||
VALUE rb_autoload_load(VALUE, ID);
|
||||
VALUE rb_autoload_p(VALUE, ID);
|
||||
VALUE rb_f_trace_var(int, VALUE*);
|
||||
VALUE rb_f_untrace_var(int, VALUE*);
|
||||
VALUE rb_f_global_variables(void);
|
||||
void rb_alias_variable(ID, ID);
|
||||
struct st_table* rb_generic_ivar_table(VALUE);
|
||||
void rb_copy_generic_ivar(VALUE,VALUE);
|
||||
void rb_free_generic_ivar(VALUE);
|
||||
VALUE rb_ivar_get(VALUE, ID);
|
||||
VALUE rb_ivar_set(VALUE, ID, VALUE);
|
||||
VALUE rb_ivar_defined(VALUE, ID);
|
||||
void rb_ivar_foreach(VALUE, int (*)(ANYARGS), st_data_t);
|
||||
st_index_t rb_ivar_count(VALUE);
|
||||
VALUE rb_iv_set(VALUE, const char*, VALUE);
|
||||
VALUE rb_iv_get(VALUE, const char*);
|
||||
VALUE rb_attr_get(VALUE, ID);
|
||||
VALUE rb_obj_instance_variables(VALUE);
|
||||
VALUE rb_obj_remove_instance_variable(VALUE, VALUE);
|
||||
void *rb_mod_const_at(VALUE, void*);
|
||||
void *rb_mod_const_of(VALUE, void*);
|
||||
VALUE rb_const_list(void*);
|
||||
VALUE rb_mod_constants(int, VALUE *, VALUE);
|
||||
VALUE rb_mod_remove_const(VALUE, VALUE);
|
||||
int rb_const_defined(VALUE, ID);
|
||||
int rb_const_defined_at(VALUE, ID);
|
||||
int rb_const_defined_from(VALUE, ID);
|
||||
VALUE rb_const_get(VALUE, ID);
|
||||
VALUE rb_const_get_at(VALUE, ID);
|
||||
VALUE rb_const_get_from(VALUE, ID);
|
||||
void rb_const_set(VALUE, ID, VALUE);
|
||||
VALUE rb_const_remove(VALUE, ID);
|
||||
VALUE rb_mod_const_missing(VALUE,VALUE);
|
||||
VALUE rb_cvar_defined(VALUE, ID);
|
||||
void rb_cvar_set(VALUE, ID, VALUE);
|
||||
VALUE rb_cvar_get(VALUE, ID);
|
||||
void rb_cv_set(VALUE, const char*, VALUE);
|
||||
VALUE rb_cv_get(VALUE, const char*);
|
||||
void rb_define_class_variable(VALUE, const char*, VALUE);
|
||||
VALUE rb_mod_class_variables(int, VALUE*, VALUE);
|
||||
VALUE rb_mod_remove_cvar(VALUE, VALUE);
|
||||
|
||||
ID rb_frame_callee(void);
|
||||
VALUE rb_str_succ(VALUE);
|
||||
VALUE rb_time_succ(VALUE);
|
||||
void rb_frame_pop(void);
|
||||
int rb_frame_method_id_and_class(ID *idp, VALUE *klassp);
|
||||
VALUE rb_make_backtrace(void);
|
||||
VALUE rb_make_exception(int, VALUE*);
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility pop
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
#if 0
|
||||
{ /* satisfy cc-mode */
|
||||
#endif
|
||||
} /* extern "C" { */
|
||||
#endif
|
||||
|
||||
#endif /* RUBY_INTERN_H */
|
||||
@@ -1,213 +0,0 @@
|
||||
/**********************************************************************
|
||||
|
||||
rubyio.h -
|
||||
|
||||
$Author: nagachika $
|
||||
created at: Fri Nov 12 16:47:09 JST 1993
|
||||
|
||||
Copyright (C) 1993-2007 Yukihiro Matsumoto
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef RUBY_IO_H
|
||||
#define RUBY_IO_H 1
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#if 0
|
||||
} /* satisfy cc-mode */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include "ruby/encoding.h"
|
||||
|
||||
#if defined(HAVE_STDIO_EXT_H)
|
||||
#include <stdio_ext.h>
|
||||
#endif
|
||||
|
||||
#include "ruby/config.h"
|
||||
#if defined(HAVE_POLL)
|
||||
# ifdef _AIX
|
||||
# define reqevents events
|
||||
# define rtnevents revents
|
||||
# endif
|
||||
# include <poll.h>
|
||||
# ifdef _AIX
|
||||
# undef reqevents
|
||||
# undef rtnevents
|
||||
# undef events
|
||||
# undef revents
|
||||
# endif
|
||||
# define RB_WAITFD_IN POLLIN
|
||||
# define RB_WAITFD_PRI POLLPRI
|
||||
# define RB_WAITFD_OUT POLLOUT
|
||||
#else
|
||||
# define RB_WAITFD_IN 0x001
|
||||
# define RB_WAITFD_PRI 0x002
|
||||
# define RB_WAITFD_OUT 0x004
|
||||
#endif
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility push(default)
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
char *ptr; /* off + len <= capa */
|
||||
int off;
|
||||
int len;
|
||||
int capa;
|
||||
} rb_io_buffer_t;
|
||||
|
||||
typedef struct rb_io_t {
|
||||
int fd; /* file descriptor */
|
||||
FILE *stdio_file; /* stdio ptr for read/write if available */
|
||||
int mode; /* mode flags: FMODE_XXXs */
|
||||
rb_pid_t pid; /* child's pid (for pipes) */
|
||||
int lineno; /* number of lines read */
|
||||
VALUE pathv; /* pathname for file */
|
||||
void (*finalize)(struct rb_io_t*,int); /* finalize proc */
|
||||
|
||||
rb_io_buffer_t wbuf, rbuf;
|
||||
|
||||
VALUE tied_io_for_writing;
|
||||
|
||||
/*
|
||||
* enc enc2 read action write action
|
||||
* NULL NULL force_encoding(default_external) write the byte sequence of str
|
||||
* e1 NULL force_encoding(e1) convert str.encoding to e1
|
||||
* e1 e2 convert from e2 to e1 convert str.encoding to e2
|
||||
*/
|
||||
struct rb_io_enc_t {
|
||||
rb_encoding *enc;
|
||||
rb_encoding *enc2;
|
||||
int ecflags;
|
||||
VALUE ecopts;
|
||||
} encs;
|
||||
|
||||
rb_econv_t *readconv;
|
||||
rb_io_buffer_t cbuf;
|
||||
|
||||
rb_econv_t *writeconv;
|
||||
VALUE writeconv_asciicompat;
|
||||
int writeconv_pre_ecflags;
|
||||
VALUE writeconv_pre_ecopts;
|
||||
int writeconv_initialized;
|
||||
|
||||
VALUE write_lock;
|
||||
} rb_io_t;
|
||||
|
||||
#define HAVE_RB_IO_T 1
|
||||
|
||||
#define FMODE_READABLE 0x00000001
|
||||
#define FMODE_WRITABLE 0x00000002
|
||||
#define FMODE_READWRITE (FMODE_READABLE|FMODE_WRITABLE)
|
||||
#define FMODE_BINMODE 0x00000004
|
||||
#define FMODE_SYNC 0x00000008
|
||||
#define FMODE_TTY 0x00000010
|
||||
#define FMODE_DUPLEX 0x00000020
|
||||
#define FMODE_APPEND 0x00000040
|
||||
#define FMODE_CREATE 0x00000080
|
||||
/* #define FMODE_NOREVLOOKUP 0x00000100 */
|
||||
#define FMODE_WSPLIT 0x00000200
|
||||
#define FMODE_WSPLIT_INITIALIZED 0x00000400
|
||||
#define FMODE_TRUNC 0x00000800
|
||||
#define FMODE_TEXTMODE 0x00001000
|
||||
/* #define FMODE_PREP 0x00010000 */
|
||||
#define FMODE_SETENC_BY_BOM 0x00100000
|
||||
|
||||
#define GetOpenFile(obj,fp) rb_io_check_closed((fp) = RFILE(rb_io_taint_check(obj))->fptr)
|
||||
|
||||
#define RB_IO_BUFFER_INIT(buf) do {\
|
||||
(buf).ptr = NULL;\
|
||||
(buf).off = 0;\
|
||||
(buf).len = 0;\
|
||||
(buf).capa = 0;\
|
||||
} while (0)
|
||||
|
||||
#define MakeOpenFile(obj, fp) do {\
|
||||
if (RFILE(obj)->fptr) {\
|
||||
rb_io_close(obj);\
|
||||
rb_io_fptr_finalize(RFILE(obj)->fptr);\
|
||||
RFILE(obj)->fptr = 0;\
|
||||
}\
|
||||
(fp) = 0;\
|
||||
RB_IO_FPTR_NEW(fp);\
|
||||
RFILE(obj)->fptr = (fp);\
|
||||
} while (0)
|
||||
|
||||
#define RB_IO_FPTR_NEW(fp) do {\
|
||||
(fp) = ALLOC(rb_io_t);\
|
||||
(fp)->fd = -1;\
|
||||
(fp)->stdio_file = NULL;\
|
||||
(fp)->mode = 0;\
|
||||
(fp)->pid = 0;\
|
||||
(fp)->lineno = 0;\
|
||||
(fp)->pathv = Qnil;\
|
||||
(fp)->finalize = 0;\
|
||||
RB_IO_BUFFER_INIT((fp)->wbuf);\
|
||||
RB_IO_BUFFER_INIT((fp)->rbuf);\
|
||||
RB_IO_BUFFER_INIT((fp)->cbuf);\
|
||||
(fp)->readconv = NULL;\
|
||||
(fp)->writeconv = NULL;\
|
||||
(fp)->writeconv_asciicompat = Qnil;\
|
||||
(fp)->writeconv_pre_ecflags = 0;\
|
||||
(fp)->writeconv_pre_ecopts = Qnil;\
|
||||
(fp)->writeconv_initialized = 0;\
|
||||
(fp)->tied_io_for_writing = 0;\
|
||||
(fp)->encs.enc = NULL;\
|
||||
(fp)->encs.enc2 = NULL;\
|
||||
(fp)->encs.ecflags = 0;\
|
||||
(fp)->encs.ecopts = Qnil;\
|
||||
(fp)->write_lock = 0;\
|
||||
} while (0)
|
||||
|
||||
FILE *rb_io_stdio_file(rb_io_t *fptr);
|
||||
|
||||
FILE *rb_fdopen(int, const char*);
|
||||
int rb_io_modestr_fmode(const char *modestr);
|
||||
int rb_io_modestr_oflags(const char *modestr);
|
||||
int rb_io_oflags_fmode(int oflags);
|
||||
void rb_io_check_writable(rb_io_t*);
|
||||
void rb_io_check_readable(rb_io_t*);
|
||||
void rb_io_check_char_readable(rb_io_t *fptr);
|
||||
void rb_io_check_byte_readable(rb_io_t *fptr);
|
||||
int rb_io_fptr_finalize(rb_io_t*);
|
||||
void rb_io_synchronized(rb_io_t*);
|
||||
void rb_io_check_initialized(rb_io_t*);
|
||||
void rb_io_check_closed(rb_io_t*);
|
||||
VALUE rb_io_get_io(VALUE io);
|
||||
VALUE rb_io_check_io(VALUE io);
|
||||
VALUE rb_io_get_write_io(VALUE io);
|
||||
VALUE rb_io_set_write_io(VALUE io, VALUE w);
|
||||
int rb_io_wait_readable(int);
|
||||
int rb_io_wait_writable(int);
|
||||
int rb_wait_for_single_fd(int fd, int events, struct timeval *tv);
|
||||
void rb_io_set_nonblock(rb_io_t *fptr);
|
||||
int rb_io_extract_encoding_option(VALUE opt, rb_encoding **enc_p, rb_encoding **enc2_p, int *fmode_p);
|
||||
ssize_t rb_io_bufwrite(VALUE io, const void *buf, size_t size);
|
||||
|
||||
/* compatibility for ruby 1.8 and older */
|
||||
#define rb_io_mode_flags(modestr) rb_io_modestr_fmode(modestr)
|
||||
#define rb_io_modenum_flags(oflags) rb_io_oflags_fmode(oflags)
|
||||
|
||||
VALUE rb_io_taint_check(VALUE);
|
||||
NORETURN(void rb_eof_error(void));
|
||||
|
||||
void rb_io_read_check(rb_io_t*);
|
||||
int rb_io_read_pending(rb_io_t*);
|
||||
DEPRECATED(void rb_read_check(FILE*));
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility pop
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
#if 0
|
||||
{ /* satisfy cc-mode */
|
||||
#endif
|
||||
} /* extern "C" { */
|
||||
#endif
|
||||
|
||||
#endif /* RUBY_IO_H */
|
||||
@@ -1,243 +0,0 @@
|
||||
/************************************************
|
||||
|
||||
missing.h - prototype for *.c in ./missing, and
|
||||
for missing timeval struct
|
||||
|
||||
$Author: nagachika $
|
||||
created at: Sat May 11 23:46:03 JST 2002
|
||||
|
||||
************************************************/
|
||||
|
||||
#ifndef RUBY_MISSING_H
|
||||
#define RUBY_MISSING_H 1
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#if 0
|
||||
} /* satisfy cc-mode */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "ruby/config.h"
|
||||
#include <stddef.h>
|
||||
#include <math.h> /* for INFINITY and NAN */
|
||||
#ifdef RUBY_EXTCONF_H
|
||||
#include RUBY_EXTCONF_H
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_STRUCT_TIMEVAL) || !defined(HAVE_STRUCT_TIMESPEC)
|
||||
#if defined(HAVE_TIME_H)
|
||||
# include <time.h>
|
||||
#endif
|
||||
#if defined(HAVE_SYS_TIME_H)
|
||||
# include <sys/time.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_STRUCT_TIMEVAL)
|
||||
struct timeval {
|
||||
time_t tv_sec; /* seconds */
|
||||
long tv_usec; /* microseconds */
|
||||
};
|
||||
#endif /* HAVE_STRUCT_TIMEVAL */
|
||||
|
||||
#if !defined(HAVE_STRUCT_TIMESPEC)
|
||||
struct timespec {
|
||||
time_t tv_sec; /* seconds */
|
||||
long tv_nsec; /* nanoseconds */
|
||||
};
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_STRUCT_TIMEZONE)
|
||||
struct timezone {
|
||||
int tz_minuteswest;
|
||||
int tz_dsttime;
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef RUBY_EXPORT
|
||||
#undef RUBY_EXTERN
|
||||
#endif
|
||||
#ifndef RUBY_EXTERN
|
||||
#define RUBY_EXTERN extern
|
||||
#endif
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility push(default)
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_ACOSH
|
||||
RUBY_EXTERN double acosh(double);
|
||||
RUBY_EXTERN double asinh(double);
|
||||
RUBY_EXTERN double atanh(double);
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_CRYPT
|
||||
RUBY_EXTERN char *crypt(const char *, const char *);
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_DUP2
|
||||
RUBY_EXTERN int dup2(int, int);
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_EACCESS
|
||||
RUBY_EXTERN int eaccess(const char*, int);
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_ROUND
|
||||
RUBY_EXTERN double round(double); /* numeric.c */
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_FINITE
|
||||
RUBY_EXTERN int finite(double);
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_FLOCK
|
||||
RUBY_EXTERN int flock(int, int);
|
||||
#endif
|
||||
|
||||
/*
|
||||
#ifndef HAVE_FREXP
|
||||
RUBY_EXTERN double frexp(double, int *);
|
||||
#endif
|
||||
*/
|
||||
|
||||
#ifndef HAVE_HYPOT
|
||||
RUBY_EXTERN double hypot(double, double);
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_ERF
|
||||
RUBY_EXTERN double erf(double);
|
||||
RUBY_EXTERN double erfc(double);
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_TGAMMA
|
||||
RUBY_EXTERN double tgamma(double);
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_LGAMMA_R
|
||||
RUBY_EXTERN double lgamma_r(double, int *);
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_CBRT
|
||||
RUBY_EXTERN double cbrt(double);
|
||||
#endif
|
||||
|
||||
#if !defined(INFINITY) || !defined(NAN)
|
||||
union bytesequence4_or_float {
|
||||
unsigned char bytesequence[4];
|
||||
float float_value;
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef INFINITY
|
||||
# define HAVE_INFINITY
|
||||
#else
|
||||
/** @internal */
|
||||
RUBY_EXTERN const union bytesequence4_or_float rb_infinity;
|
||||
# define INFINITY (rb_infinity.float_value)
|
||||
#endif
|
||||
|
||||
#ifdef NAN
|
||||
# define HAVE_NAN
|
||||
#else
|
||||
/** @internal */
|
||||
RUBY_EXTERN const union bytesequence4_or_float rb_nan;
|
||||
# define NAN (rb_nan.float_value)
|
||||
#endif
|
||||
|
||||
#ifndef isinf
|
||||
# ifndef HAVE_ISINF
|
||||
# if defined(HAVE_FINITE) && defined(HAVE_ISNAN)
|
||||
# ifdef HAVE_IEEEFP_H
|
||||
# include <ieeefp.h>
|
||||
# endif
|
||||
# define isinf(x) (!finite(x) && !isnan(x))
|
||||
# else
|
||||
RUBY_EXTERN int isinf(double);
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef isnan
|
||||
# ifndef HAVE_ISNAN
|
||||
RUBY_EXTERN int isnan(double);
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
#ifndef HAVE_MEMCMP
|
||||
RUBY_EXTERN int memcmp(const void *, const void *, size_t);
|
||||
#endif
|
||||
*/
|
||||
|
||||
#ifndef HAVE_MEMMOVE
|
||||
RUBY_EXTERN void *memmove(void *, const void *, size_t);
|
||||
#endif
|
||||
|
||||
/*
|
||||
#ifndef HAVE_MODF
|
||||
RUBY_EXTERN double modf(double, double *);
|
||||
#endif
|
||||
*/
|
||||
|
||||
#ifndef HAVE_STRCHR
|
||||
RUBY_EXTERN char *strchr(const char *, int);
|
||||
RUBY_EXTERN char *strrchr(const char *, int);
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_STRERROR
|
||||
RUBY_EXTERN char *strerror(int);
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_STRSTR
|
||||
RUBY_EXTERN char *strstr(const char *, const char *);
|
||||
#endif
|
||||
|
||||
/*
|
||||
#ifndef HAVE_STRTOL
|
||||
RUBY_EXTERN long strtol(const char *, char **, int);
|
||||
#endif
|
||||
*/
|
||||
|
||||
#ifndef HAVE_STRLCPY
|
||||
RUBY_EXTERN size_t strlcpy(char *, const char*, size_t);
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_STRLCAT
|
||||
RUBY_EXTERN size_t strlcat(char *, const char*, size_t);
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_SIGNBIT
|
||||
RUBY_EXTERN int signbit(double x);
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_FFS
|
||||
RUBY_EXTERN int ffs(int);
|
||||
#endif
|
||||
|
||||
#ifdef BROKEN_CLOSE
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
RUBY_EXTERN int ruby_getpeername(int, struct sockaddr *, socklen_t *);
|
||||
RUBY_EXTERN int ruby_getsockname(int, struct sockaddr *, socklen_t *);
|
||||
RUBY_EXTERN int ruby_shutdown(int, int);
|
||||
RUBY_EXTERN int ruby_close(int);
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_SETPROCTITLE
|
||||
RUBY_EXTERN void setproctitle(const char *fmt, ...);
|
||||
#endif
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility pop
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
#if 0
|
||||
{ /* satisfy cc-mode */
|
||||
#endif
|
||||
} /* extern "C" { */
|
||||
#endif
|
||||
|
||||
#endif /* RUBY_MISSING_H */
|
||||
@@ -1,839 +0,0 @@
|
||||
#ifndef ONIGURUMA_H
|
||||
#define ONIGURUMA_H
|
||||
/**********************************************************************
|
||||
oniguruma.h - Onigmo (Oniguruma-mod) (regular expression library)
|
||||
**********************************************************************/
|
||||
/*-
|
||||
* Copyright (c) 2002-2009 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
|
||||
* Copyright (c) 2011-2013 K.Takata <kentkt AT csc DOT jp>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#if 0
|
||||
} /* satisfy cc-mode */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define ONIGURUMA
|
||||
#define ONIGURUMA_VERSION_MAJOR 5
|
||||
#define ONIGURUMA_VERSION_MINOR 13
|
||||
#define ONIGURUMA_VERSION_TEENY 4
|
||||
|
||||
#ifdef __cplusplus
|
||||
# ifndef HAVE_PROTOTYPES
|
||||
# define HAVE_PROTOTYPES 1
|
||||
# endif
|
||||
# ifndef HAVE_STDARG_PROTOTYPES
|
||||
# define HAVE_STDARG_PROTOTYPES 1
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* escape Mac OS X/Xcode 2.4/gcc 4.0.1 problem */
|
||||
#if defined(__APPLE__) && defined(__GNUC__) && __GNUC__ >= 4
|
||||
# ifndef HAVE_STDARG_PROTOTYPES
|
||||
# define HAVE_STDARG_PROTOTYPES 1
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STDARG_H
|
||||
# ifndef HAVE_STDARG_PROTOTYPES
|
||||
# define HAVE_STDARG_PROTOTYPES 1
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef P_
|
||||
#if defined(__STDC__) || defined(_WIN32)
|
||||
# define P_(args) args
|
||||
#else
|
||||
# define P_(args) ()
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef PV_
|
||||
#ifdef HAVE_STDARG_PROTOTYPES
|
||||
# define PV_(args) args
|
||||
#else
|
||||
# define PV_(args) ()
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef ONIG_EXTERN
|
||||
#ifdef RUBY_EXTERN
|
||||
#define ONIG_EXTERN RUBY_EXTERN
|
||||
#else
|
||||
#if defined(_WIN32) && !defined(__GNUC__)
|
||||
#if defined(EXPORT) || defined(RUBY_EXPORT)
|
||||
#define ONIG_EXTERN extern __declspec(dllexport)
|
||||
#else
|
||||
#define ONIG_EXTERN extern __declspec(dllimport)
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef ONIG_EXTERN
|
||||
#define ONIG_EXTERN extern
|
||||
#endif
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility push(default)
|
||||
#endif
|
||||
|
||||
#include <stddef.h> /* for size_t */
|
||||
|
||||
/* PART: character encoding */
|
||||
|
||||
#ifndef ONIG_ESCAPE_UCHAR_COLLISION
|
||||
#define UChar OnigUChar
|
||||
#endif
|
||||
|
||||
typedef unsigned char OnigUChar;
|
||||
typedef unsigned int OnigCodePoint;
|
||||
typedef unsigned int OnigCtype;
|
||||
typedef size_t OnigDistance;
|
||||
typedef ptrdiff_t OnigPosition;
|
||||
|
||||
#define ONIG_INFINITE_DISTANCE ~((OnigDistance )0)
|
||||
|
||||
typedef unsigned int OnigCaseFoldType; /* case fold flag */
|
||||
|
||||
ONIG_EXTERN OnigCaseFoldType OnigDefaultCaseFoldFlag;
|
||||
|
||||
/* #define ONIGENC_CASE_FOLD_HIRAGANA_KATAKANA (1<<1) */
|
||||
/* #define ONIGENC_CASE_FOLD_KATAKANA_WIDTH (1<<2) */
|
||||
#define ONIGENC_CASE_FOLD_TURKISH_AZERI (1<<20)
|
||||
#define INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR (1<<30)
|
||||
|
||||
#define ONIGENC_CASE_FOLD_MIN INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR
|
||||
#define ONIGENC_CASE_FOLD_DEFAULT OnigDefaultCaseFoldFlag
|
||||
|
||||
|
||||
#define ONIGENC_MAX_COMP_CASE_FOLD_CODE_LEN 3
|
||||
#define ONIGENC_GET_CASE_FOLD_CODES_MAX_NUM 13
|
||||
/* 13 => Unicode:0x1ffc */
|
||||
|
||||
/* code range */
|
||||
#define ONIGENC_CODE_RANGE_NUM(range) ((int )range[0])
|
||||
#define ONIGENC_CODE_RANGE_FROM(range,i) range[((i)*2) + 1]
|
||||
#define ONIGENC_CODE_RANGE_TO(range,i) range[((i)*2) + 2]
|
||||
|
||||
typedef struct {
|
||||
int byte_len; /* argument(original) character(s) byte length */
|
||||
int code_len; /* number of code */
|
||||
OnigCodePoint code[ONIGENC_MAX_COMP_CASE_FOLD_CODE_LEN];
|
||||
} OnigCaseFoldCodeItem;
|
||||
|
||||
typedef struct {
|
||||
OnigCodePoint esc;
|
||||
OnigCodePoint anychar;
|
||||
OnigCodePoint anytime;
|
||||
OnigCodePoint zero_or_one_time;
|
||||
OnigCodePoint one_or_more_time;
|
||||
OnigCodePoint anychar_anytime;
|
||||
} OnigMetaCharTableType;
|
||||
|
||||
typedef int (*OnigApplyAllCaseFoldFunc)(OnigCodePoint from, OnigCodePoint* to, int to_len, void* arg);
|
||||
|
||||
typedef struct OnigEncodingTypeST {
|
||||
int (*precise_mbc_enc_len)(const OnigUChar* p,const OnigUChar* e, struct OnigEncodingTypeST* enc);
|
||||
const char* name;
|
||||
int max_enc_len;
|
||||
int min_enc_len;
|
||||
int (*is_mbc_newline)(const OnigUChar* p, const OnigUChar* end, struct OnigEncodingTypeST* enc);
|
||||
OnigCodePoint (*mbc_to_code)(const OnigUChar* p, const OnigUChar* end, struct OnigEncodingTypeST* enc);
|
||||
int (*code_to_mbclen)(OnigCodePoint code, struct OnigEncodingTypeST* enc);
|
||||
int (*code_to_mbc)(OnigCodePoint code, OnigUChar *buf, struct OnigEncodingTypeST* enc);
|
||||
int (*mbc_case_fold)(OnigCaseFoldType flag, const OnigUChar** pp, const OnigUChar* end, OnigUChar* to, struct OnigEncodingTypeST* enc);
|
||||
int (*apply_all_case_fold)(OnigCaseFoldType flag, OnigApplyAllCaseFoldFunc f, void* arg, struct OnigEncodingTypeST* enc);
|
||||
int (*get_case_fold_codes_by_str)(OnigCaseFoldType flag, const OnigUChar* p, const OnigUChar* end, OnigCaseFoldCodeItem acs[], struct OnigEncodingTypeST* enc);
|
||||
int (*property_name_to_ctype)(struct OnigEncodingTypeST* enc, OnigUChar* p, OnigUChar* end);
|
||||
int (*is_code_ctype)(OnigCodePoint code, OnigCtype ctype, struct OnigEncodingTypeST* enc);
|
||||
int (*get_ctype_code_range)(OnigCtype ctype, OnigCodePoint* sb_out, const OnigCodePoint* ranges[], struct OnigEncodingTypeST* enc);
|
||||
OnigUChar* (*left_adjust_char_head)(const OnigUChar* start, const OnigUChar* p, const OnigUChar* end, struct OnigEncodingTypeST* enc);
|
||||
int (*is_allowed_reverse_match)(const OnigUChar* p, const OnigUChar* end, struct OnigEncodingTypeST* enc);
|
||||
int ruby_encoding_index;
|
||||
unsigned int flags;
|
||||
} OnigEncodingType;
|
||||
|
||||
typedef OnigEncodingType* OnigEncoding;
|
||||
|
||||
ONIG_EXTERN OnigEncodingType OnigEncodingASCII;
|
||||
|
||||
#define ONIG_ENCODING_ASCII (&OnigEncodingASCII)
|
||||
|
||||
#define ONIG_ENCODING_UNDEF ((OnigEncoding )0)
|
||||
|
||||
|
||||
/* work size */
|
||||
#define ONIGENC_CODE_TO_MBC_MAXLEN 7
|
||||
#define ONIGENC_MBC_CASE_FOLD_MAXLEN 18
|
||||
/* 18: 6(max-byte) * 3(case-fold chars) */
|
||||
|
||||
/* character types */
|
||||
#define ONIGENC_CTYPE_NEWLINE 0
|
||||
#define ONIGENC_CTYPE_ALPHA 1
|
||||
#define ONIGENC_CTYPE_BLANK 2
|
||||
#define ONIGENC_CTYPE_CNTRL 3
|
||||
#define ONIGENC_CTYPE_DIGIT 4
|
||||
#define ONIGENC_CTYPE_GRAPH 5
|
||||
#define ONIGENC_CTYPE_LOWER 6
|
||||
#define ONIGENC_CTYPE_PRINT 7
|
||||
#define ONIGENC_CTYPE_PUNCT 8
|
||||
#define ONIGENC_CTYPE_SPACE 9
|
||||
#define ONIGENC_CTYPE_UPPER 10
|
||||
#define ONIGENC_CTYPE_XDIGIT 11
|
||||
#define ONIGENC_CTYPE_WORD 12
|
||||
#define ONIGENC_CTYPE_ALNUM 13 /* alpha || digit */
|
||||
#define ONIGENC_CTYPE_ASCII 14
|
||||
#define ONIGENC_MAX_STD_CTYPE ONIGENC_CTYPE_ASCII
|
||||
|
||||
/* flags */
|
||||
#define ONIGENC_FLAG_NONE 0U
|
||||
#define ONIGENC_FLAG_UNICODE 1U
|
||||
|
||||
#define onig_enc_len(enc,p,e) ONIGENC_MBC_ENC_LEN(enc, p, e)
|
||||
|
||||
#define ONIGENC_IS_UNDEF(enc) ((enc) == ONIG_ENCODING_UNDEF)
|
||||
#define ONIGENC_IS_SINGLEBYTE(enc) (ONIGENC_MBC_MAXLEN(enc) == 1)
|
||||
#define ONIGENC_IS_MBC_HEAD(enc,p,e) (ONIGENC_MBC_ENC_LEN(enc,p,e) != 1)
|
||||
#define ONIGENC_IS_MBC_ASCII(p) (*(p) < 128)
|
||||
#define ONIGENC_IS_CODE_ASCII(code) ((code) < 128)
|
||||
#define ONIGENC_IS_MBC_WORD(enc,s,end) \
|
||||
ONIGENC_IS_CODE_WORD(enc,ONIGENC_MBC_TO_CODE(enc,s,end))
|
||||
#define ONIGENC_IS_MBC_ASCII_WORD(enc,s,end) \
|
||||
onigenc_ascii_is_code_ctype( \
|
||||
ONIGENC_MBC_TO_CODE(enc,s,end),ONIGENC_CTYPE_WORD,enc)
|
||||
#define ONIGENC_IS_UNICODE(enc) ((enc)->flags & ONIGENC_FLAG_UNICODE)
|
||||
|
||||
|
||||
#define ONIGENC_NAME(enc) ((enc)->name)
|
||||
|
||||
#define ONIGENC_MBC_CASE_FOLD(enc,flag,pp,end,buf) \
|
||||
(enc)->mbc_case_fold(flag,(const OnigUChar** )pp,end,buf,enc)
|
||||
#define ONIGENC_IS_ALLOWED_REVERSE_MATCH(enc,s,end) \
|
||||
(enc)->is_allowed_reverse_match(s,end,enc)
|
||||
#define ONIGENC_LEFT_ADJUST_CHAR_HEAD(enc,start,s,end) \
|
||||
(enc)->left_adjust_char_head(start, s, end, enc)
|
||||
#define ONIGENC_APPLY_ALL_CASE_FOLD(enc,case_fold_flag,f,arg) \
|
||||
(enc)->apply_all_case_fold(case_fold_flag,f,arg,enc)
|
||||
#define ONIGENC_GET_CASE_FOLD_CODES_BY_STR(enc,case_fold_flag,p,end,acs) \
|
||||
(enc)->get_case_fold_codes_by_str(case_fold_flag,p,end,acs,enc)
|
||||
#define ONIGENC_STEP_BACK(enc,start,s,end,n) \
|
||||
onigenc_step_back((enc),(start),(s),(end),(n))
|
||||
|
||||
#define ONIGENC_CONSTRUCT_MBCLEN_CHARFOUND(n) (n)
|
||||
#define ONIGENC_MBCLEN_CHARFOUND_P(r) (0 < (r))
|
||||
#define ONIGENC_MBCLEN_CHARFOUND_LEN(r) (r)
|
||||
|
||||
#define ONIGENC_CONSTRUCT_MBCLEN_INVALID() (-1)
|
||||
#define ONIGENC_MBCLEN_INVALID_P(r) ((r) == -1)
|
||||
|
||||
#define ONIGENC_CONSTRUCT_MBCLEN_NEEDMORE(n) (-1-(n))
|
||||
#define ONIGENC_MBCLEN_NEEDMORE_P(r) ((r) < -1)
|
||||
#define ONIGENC_MBCLEN_NEEDMORE_LEN(r) (-1-(r))
|
||||
|
||||
#define ONIGENC_PRECISE_MBC_ENC_LEN(enc,p,e) (enc)->precise_mbc_enc_len(p,e,enc)
|
||||
|
||||
ONIG_EXTERN
|
||||
int onigenc_mbclen_approximate P_((const OnigUChar* p,const OnigUChar* e, struct OnigEncodingTypeST* enc));
|
||||
|
||||
#define ONIGENC_MBC_ENC_LEN(enc,p,e) onigenc_mbclen_approximate(p,e,enc)
|
||||
#define ONIGENC_MBC_MAXLEN(enc) ((enc)->max_enc_len)
|
||||
#define ONIGENC_MBC_MAXLEN_DIST(enc) ONIGENC_MBC_MAXLEN(enc)
|
||||
#define ONIGENC_MBC_MINLEN(enc) ((enc)->min_enc_len)
|
||||
#define ONIGENC_IS_MBC_NEWLINE(enc,p,end) (enc)->is_mbc_newline((p),(end),enc)
|
||||
#define ONIGENC_MBC_TO_CODE(enc,p,end) (enc)->mbc_to_code((p),(end),enc)
|
||||
#define ONIGENC_CODE_TO_MBCLEN(enc,code) (enc)->code_to_mbclen(code,enc)
|
||||
#define ONIGENC_CODE_TO_MBC(enc,code,buf) (enc)->code_to_mbc(code,buf,enc)
|
||||
#define ONIGENC_PROPERTY_NAME_TO_CTYPE(enc,p,end) \
|
||||
(enc)->property_name_to_ctype(enc,p,end)
|
||||
|
||||
#define ONIGENC_IS_CODE_CTYPE(enc,code,ctype) (enc)->is_code_ctype(code,ctype,enc)
|
||||
|
||||
#define ONIGENC_IS_CODE_NEWLINE(enc,code) \
|
||||
ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_NEWLINE)
|
||||
#define ONIGENC_IS_CODE_GRAPH(enc,code) \
|
||||
ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_GRAPH)
|
||||
#define ONIGENC_IS_CODE_PRINT(enc,code) \
|
||||
ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_PRINT)
|
||||
#define ONIGENC_IS_CODE_ALNUM(enc,code) \
|
||||
ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_ALNUM)
|
||||
#define ONIGENC_IS_CODE_ALPHA(enc,code) \
|
||||
ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_ALPHA)
|
||||
#define ONIGENC_IS_CODE_LOWER(enc,code) \
|
||||
ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_LOWER)
|
||||
#define ONIGENC_IS_CODE_UPPER(enc,code) \
|
||||
ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_UPPER)
|
||||
#define ONIGENC_IS_CODE_CNTRL(enc,code) \
|
||||
ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_CNTRL)
|
||||
#define ONIGENC_IS_CODE_PUNCT(enc,code) \
|
||||
ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_PUNCT)
|
||||
#define ONIGENC_IS_CODE_SPACE(enc,code) \
|
||||
ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_SPACE)
|
||||
#define ONIGENC_IS_CODE_BLANK(enc,code) \
|
||||
ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_BLANK)
|
||||
#define ONIGENC_IS_CODE_DIGIT(enc,code) \
|
||||
ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_DIGIT)
|
||||
#define ONIGENC_IS_CODE_XDIGIT(enc,code) \
|
||||
ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_XDIGIT)
|
||||
#define ONIGENC_IS_CODE_WORD(enc,code) \
|
||||
ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_WORD)
|
||||
|
||||
#define ONIGENC_GET_CTYPE_CODE_RANGE(enc,ctype,sbout,ranges) \
|
||||
(enc)->get_ctype_code_range(ctype,sbout,ranges,enc)
|
||||
|
||||
ONIG_EXTERN
|
||||
OnigUChar* onigenc_step_back P_((OnigEncoding enc, const OnigUChar* start, const OnigUChar* s, const OnigUChar* end, int n));
|
||||
|
||||
|
||||
/* encoding API */
|
||||
ONIG_EXTERN
|
||||
int onigenc_init P_((void));
|
||||
ONIG_EXTERN
|
||||
int onigenc_set_default_encoding P_((OnigEncoding enc));
|
||||
ONIG_EXTERN
|
||||
OnigEncoding onigenc_get_default_encoding P_((void));
|
||||
ONIG_EXTERN
|
||||
void onigenc_set_default_caseconv_table P_((const OnigUChar* table));
|
||||
ONIG_EXTERN
|
||||
OnigUChar* onigenc_get_right_adjust_char_head_with_prev P_((OnigEncoding enc, const OnigUChar* start, const OnigUChar* s, const OnigUChar* end, const OnigUChar** prev));
|
||||
ONIG_EXTERN
|
||||
OnigUChar* onigenc_get_prev_char_head P_((OnigEncoding enc, const OnigUChar* start, const OnigUChar* s, const OnigUChar* end));
|
||||
ONIG_EXTERN
|
||||
OnigUChar* onigenc_get_left_adjust_char_head P_((OnigEncoding enc, const OnigUChar* start, const OnigUChar* s, const OnigUChar* end));
|
||||
ONIG_EXTERN
|
||||
OnigUChar* onigenc_get_right_adjust_char_head P_((OnigEncoding enc, const OnigUChar* start, const OnigUChar* s, const OnigUChar* end));
|
||||
ONIG_EXTERN
|
||||
int onigenc_strlen P_((OnigEncoding enc, const OnigUChar* p, const OnigUChar* end));
|
||||
ONIG_EXTERN
|
||||
int onigenc_strlen_null P_((OnigEncoding enc, const OnigUChar* p));
|
||||
ONIG_EXTERN
|
||||
int onigenc_str_bytelen_null P_((OnigEncoding enc, const OnigUChar* p));
|
||||
|
||||
|
||||
|
||||
/* PART: regular expression */
|
||||
|
||||
/* config parameters */
|
||||
#define ONIG_NREGION 10
|
||||
#define ONIG_MAX_BACKREF_NUM 1000
|
||||
#define ONIG_MAX_REPEAT_NUM 100000
|
||||
#define ONIG_MAX_MULTI_BYTE_RANGES_NUM 10000
|
||||
/* constants */
|
||||
#define ONIG_MAX_ERROR_MESSAGE_LEN 90
|
||||
|
||||
typedef unsigned int OnigOptionType;
|
||||
|
||||
#define ONIG_OPTION_DEFAULT ONIG_OPTION_NONE
|
||||
|
||||
/* options */
|
||||
#define ONIG_OPTION_NONE 0U
|
||||
#define ONIG_OPTION_IGNORECASE 1U
|
||||
#define ONIG_OPTION_EXTEND (ONIG_OPTION_IGNORECASE << 1)
|
||||
#define ONIG_OPTION_MULTILINE (ONIG_OPTION_EXTEND << 1)
|
||||
#define ONIG_OPTION_DOTALL ONIG_OPTION_MULTILINE
|
||||
#define ONIG_OPTION_SINGLELINE (ONIG_OPTION_MULTILINE << 1)
|
||||
#define ONIG_OPTION_FIND_LONGEST (ONIG_OPTION_SINGLELINE << 1)
|
||||
#define ONIG_OPTION_FIND_NOT_EMPTY (ONIG_OPTION_FIND_LONGEST << 1)
|
||||
#define ONIG_OPTION_NEGATE_SINGLELINE (ONIG_OPTION_FIND_NOT_EMPTY << 1)
|
||||
#define ONIG_OPTION_DONT_CAPTURE_GROUP (ONIG_OPTION_NEGATE_SINGLELINE << 1)
|
||||
#define ONIG_OPTION_CAPTURE_GROUP (ONIG_OPTION_DONT_CAPTURE_GROUP << 1)
|
||||
/* options (search time) */
|
||||
#define ONIG_OPTION_NOTBOL (ONIG_OPTION_CAPTURE_GROUP << 1)
|
||||
#define ONIG_OPTION_NOTEOL (ONIG_OPTION_NOTBOL << 1)
|
||||
#define ONIG_OPTION_POSIX_REGION (ONIG_OPTION_NOTEOL << 1)
|
||||
/* options (ctype range) */
|
||||
#define ONIG_OPTION_ASCII_RANGE (ONIG_OPTION_POSIX_REGION << 1)
|
||||
#define ONIG_OPTION_POSIX_BRACKET_ALL_RANGE (ONIG_OPTION_ASCII_RANGE << 1)
|
||||
#define ONIG_OPTION_WORD_BOUND_ALL_RANGE (ONIG_OPTION_POSIX_BRACKET_ALL_RANGE << 1)
|
||||
/* options (newline) */
|
||||
#define ONIG_OPTION_NEWLINE_CRLF (ONIG_OPTION_WORD_BOUND_ALL_RANGE << 1)
|
||||
#define ONIG_OPTION_MAXBIT ONIG_OPTION_NEWLINE_CRLF /* limit */
|
||||
|
||||
#define ONIG_OPTION_ON(options,regopt) ((options) |= (regopt))
|
||||
#define ONIG_OPTION_OFF(options,regopt) ((options) &= ~(regopt))
|
||||
#define ONIG_IS_OPTION_ON(options,option) ((options) & (option))
|
||||
|
||||
/* syntax */
|
||||
typedef struct {
|
||||
unsigned int op;
|
||||
unsigned int op2;
|
||||
unsigned int behavior;
|
||||
OnigOptionType options; /* default option */
|
||||
OnigMetaCharTableType meta_char_table;
|
||||
} OnigSyntaxType;
|
||||
|
||||
ONIG_EXTERN const OnigSyntaxType OnigSyntaxASIS;
|
||||
ONIG_EXTERN const OnigSyntaxType OnigSyntaxPosixBasic;
|
||||
ONIG_EXTERN const OnigSyntaxType OnigSyntaxPosixExtended;
|
||||
ONIG_EXTERN const OnigSyntaxType OnigSyntaxEmacs;
|
||||
ONIG_EXTERN const OnigSyntaxType OnigSyntaxGrep;
|
||||
ONIG_EXTERN const OnigSyntaxType OnigSyntaxGnuRegex;
|
||||
ONIG_EXTERN const OnigSyntaxType OnigSyntaxJava;
|
||||
ONIG_EXTERN const OnigSyntaxType OnigSyntaxPerl58;
|
||||
ONIG_EXTERN const OnigSyntaxType OnigSyntaxPerl58_NG;
|
||||
ONIG_EXTERN const OnigSyntaxType OnigSyntaxPerl;
|
||||
ONIG_EXTERN const OnigSyntaxType OnigSyntaxRuby;
|
||||
ONIG_EXTERN const OnigSyntaxType OnigSyntaxPython;
|
||||
|
||||
/* predefined syntaxes (see regsyntax.c) */
|
||||
#define ONIG_SYNTAX_ASIS (&OnigSyntaxASIS)
|
||||
#define ONIG_SYNTAX_POSIX_BASIC (&OnigSyntaxPosixBasic)
|
||||
#define ONIG_SYNTAX_POSIX_EXTENDED (&OnigSyntaxPosixExtended)
|
||||
#define ONIG_SYNTAX_EMACS (&OnigSyntaxEmacs)
|
||||
#define ONIG_SYNTAX_GREP (&OnigSyntaxGrep)
|
||||
#define ONIG_SYNTAX_GNU_REGEX (&OnigSyntaxGnuRegex)
|
||||
#define ONIG_SYNTAX_JAVA (&OnigSyntaxJava)
|
||||
#define ONIG_SYNTAX_PERL58 (&OnigSyntaxPerl58)
|
||||
#define ONIG_SYNTAX_PERL58_NG (&OnigSyntaxPerl58_NG)
|
||||
#define ONIG_SYNTAX_PERL (&OnigSyntaxPerl)
|
||||
#define ONIG_SYNTAX_RUBY (&OnigSyntaxRuby)
|
||||
#define ONIG_SYNTAX_PYTHON (&OnigSyntaxPython)
|
||||
|
||||
/* default syntax */
|
||||
ONIG_EXTERN const OnigSyntaxType* OnigDefaultSyntax;
|
||||
#define ONIG_SYNTAX_DEFAULT OnigDefaultSyntax
|
||||
|
||||
/* syntax (operators) */
|
||||
#define ONIG_SYN_OP_VARIABLE_META_CHARACTERS (1U<<0)
|
||||
#define ONIG_SYN_OP_DOT_ANYCHAR (1U<<1) /* . */
|
||||
#define ONIG_SYN_OP_ASTERISK_ZERO_INF (1U<<2) /* * */
|
||||
#define ONIG_SYN_OP_ESC_ASTERISK_ZERO_INF (1U<<3)
|
||||
#define ONIG_SYN_OP_PLUS_ONE_INF (1U<<4) /* + */
|
||||
#define ONIG_SYN_OP_ESC_PLUS_ONE_INF (1U<<5)
|
||||
#define ONIG_SYN_OP_QMARK_ZERO_ONE (1U<<6) /* ? */
|
||||
#define ONIG_SYN_OP_ESC_QMARK_ZERO_ONE (1U<<7)
|
||||
#define ONIG_SYN_OP_BRACE_INTERVAL (1U<<8) /* {lower,upper} */
|
||||
#define ONIG_SYN_OP_ESC_BRACE_INTERVAL (1U<<9) /* \{lower,upper\} */
|
||||
#define ONIG_SYN_OP_VBAR_ALT (1U<<10) /* | */
|
||||
#define ONIG_SYN_OP_ESC_VBAR_ALT (1U<<11) /* \| */
|
||||
#define ONIG_SYN_OP_LPAREN_SUBEXP (1U<<12) /* (...) */
|
||||
#define ONIG_SYN_OP_ESC_LPAREN_SUBEXP (1U<<13) /* \(...\) */
|
||||
#define ONIG_SYN_OP_ESC_AZ_BUF_ANCHOR (1U<<14) /* \A, \Z, \z */
|
||||
#define ONIG_SYN_OP_ESC_CAPITAL_G_BEGIN_ANCHOR (1U<<15) /* \G */
|
||||
#define ONIG_SYN_OP_DECIMAL_BACKREF (1U<<16) /* \num */
|
||||
#define ONIG_SYN_OP_BRACKET_CC (1U<<17) /* [...] */
|
||||
#define ONIG_SYN_OP_ESC_W_WORD (1U<<18) /* \w, \W */
|
||||
#define ONIG_SYN_OP_ESC_LTGT_WORD_BEGIN_END (1U<<19) /* \<. \> */
|
||||
#define ONIG_SYN_OP_ESC_B_WORD_BOUND (1U<<20) /* \b, \B */
|
||||
#define ONIG_SYN_OP_ESC_S_WHITE_SPACE (1U<<21) /* \s, \S */
|
||||
#define ONIG_SYN_OP_ESC_D_DIGIT (1U<<22) /* \d, \D */
|
||||
#define ONIG_SYN_OP_LINE_ANCHOR (1U<<23) /* ^, $ */
|
||||
#define ONIG_SYN_OP_POSIX_BRACKET (1U<<24) /* [:xxxx:] */
|
||||
#define ONIG_SYN_OP_QMARK_NON_GREEDY (1U<<25) /* ??,*?,+?,{n,m}? */
|
||||
#define ONIG_SYN_OP_ESC_CONTROL_CHARS (1U<<26) /* \n,\r,\t,\a ... */
|
||||
#define ONIG_SYN_OP_ESC_C_CONTROL (1U<<27) /* \cx */
|
||||
#define ONIG_SYN_OP_ESC_OCTAL3 (1U<<28) /* \OOO */
|
||||
#define ONIG_SYN_OP_ESC_X_HEX2 (1U<<29) /* \xHH */
|
||||
#define ONIG_SYN_OP_ESC_X_BRACE_HEX8 (1U<<30) /* \x{7HHHHHHH} */
|
||||
#define ONIG_SYN_OP_ESC_O_BRACE_OCTAL (1U<<31) /* \o{OOO} */ /* NOTIMPL */
|
||||
|
||||
#define ONIG_SYN_OP2_ESC_CAPITAL_Q_QUOTE (1U<<0) /* \Q...\E */
|
||||
#define ONIG_SYN_OP2_QMARK_GROUP_EFFECT (1U<<1) /* (?...) */
|
||||
#define ONIG_SYN_OP2_OPTION_PERL (1U<<2) /* (?imsxadlu), (?-imsx), (?^imsxalu) */
|
||||
#define ONIG_SYN_OP2_OPTION_RUBY (1U<<3) /* (?imxadu), (?-imx) */
|
||||
#define ONIG_SYN_OP2_PLUS_POSSESSIVE_REPEAT (1U<<4) /* ?+,*+,++ */
|
||||
#define ONIG_SYN_OP2_PLUS_POSSESSIVE_INTERVAL (1U<<5) /* {n,m}+ */
|
||||
#define ONIG_SYN_OP2_CCLASS_SET_OP (1U<<6) /* [...&&..[..]..] */
|
||||
#define ONIG_SYN_OP2_QMARK_LT_NAMED_GROUP (1U<<7) /* (?<name>...) */
|
||||
#define ONIG_SYN_OP2_ESC_K_NAMED_BACKREF (1U<<8) /* \k<name> */
|
||||
#define ONIG_SYN_OP2_ESC_G_SUBEXP_CALL (1U<<9) /* \g<name>, \g<n> */
|
||||
#define ONIG_SYN_OP2_ATMARK_CAPTURE_HISTORY (1U<<10) /* (?@..),(?@<x>..) */
|
||||
#define ONIG_SYN_OP2_ESC_CAPITAL_C_BAR_CONTROL (1U<<11) /* \C-x */
|
||||
#define ONIG_SYN_OP2_ESC_CAPITAL_M_BAR_META (1U<<12) /* \M-x */
|
||||
#define ONIG_SYN_OP2_ESC_V_VTAB (1U<<13) /* \v as VTAB */
|
||||
#define ONIG_SYN_OP2_ESC_U_HEX4 (1U<<14) /* \uHHHH */
|
||||
#define ONIG_SYN_OP2_ESC_GNU_BUF_ANCHOR (1U<<15) /* \`, \' */
|
||||
#define ONIG_SYN_OP2_ESC_P_BRACE_CHAR_PROPERTY (1U<<16) /* \p{...}, \P{...} */
|
||||
#define ONIG_SYN_OP2_ESC_P_BRACE_CIRCUMFLEX_NOT (1U<<17) /* \p{^..}, \P{^..} */
|
||||
/* #define ONIG_SYN_OP2_CHAR_PROPERTY_PREFIX_IS (1U<<18) */
|
||||
#define ONIG_SYN_OP2_ESC_H_XDIGIT (1U<<19) /* \h, \H */
|
||||
#define ONIG_SYN_OP2_INEFFECTIVE_ESCAPE (1U<<20) /* \ */
|
||||
#define ONIG_SYN_OP2_ESC_CAPITAL_R_LINEBREAK (1U<<21) /* \R as (?>\x0D\x0A|[\x0A-\x0D\x{85}\x{2028}\x{2029}]) */
|
||||
#define ONIG_SYN_OP2_ESC_CAPITAL_X_EXTENDED_GRAPHEME_CLUSTER (1U<<22) /* \X as (?>\P{M}\p{M}*) */
|
||||
#define ONIG_SYN_OP2_ESC_V_VERTICAL_WHITESPACE (1U<<23) /* \v, \V -- Perl */ /* NOTIMPL */
|
||||
#define ONIG_SYN_OP2_ESC_H_HORIZONTAL_WHITESPACE (1U<<24) /* \h, \H -- Perl */ /* NOTIMPL */
|
||||
#define ONIG_SYN_OP2_ESC_CAPITAL_K_KEEP (1U<<25) /* \K */
|
||||
#define ONIG_SYN_OP2_ESC_G_BRACE_BACKREF (1U<<26) /* \g{name}, \g{n} */
|
||||
#define ONIG_SYN_OP2_QMARK_SUBEXP_CALL (1U<<27) /* (?&name), (?n), (?R), (?0) */
|
||||
#define ONIG_SYN_OP2_QMARK_VBAR_BRANCH_RESET (1U<<28) /* (?|...) */ /* NOTIMPL */
|
||||
#define ONIG_SYN_OP2_QMARK_LPAREN_CONDITION (1U<<29) /* (?(cond)yes...|no...) */
|
||||
#define ONIG_SYN_OP2_QMARK_CAPITAL_P_NAMED_GROUP (1U<<30) /* (?P<name>...), (?P=name), (?P>name) -- Python/PCRE */
|
||||
#define ONIG_SYN_OP2_OPTION_JAVA (1U<<31) /* (?idmsux), (?-idmsux) */ /* NOTIMPL */
|
||||
|
||||
/* syntax (behavior) */
|
||||
#define ONIG_SYN_CONTEXT_INDEP_ANCHORS (1U<<31) /* not implemented */
|
||||
#define ONIG_SYN_CONTEXT_INDEP_REPEAT_OPS (1U<<0) /* ?, *, +, {n,m} */
|
||||
#define ONIG_SYN_CONTEXT_INVALID_REPEAT_OPS (1U<<1) /* error or ignore */
|
||||
#define ONIG_SYN_ALLOW_UNMATCHED_CLOSE_SUBEXP (1U<<2) /* ...)... */
|
||||
#define ONIG_SYN_ALLOW_INVALID_INTERVAL (1U<<3) /* {??? */
|
||||
#define ONIG_SYN_ALLOW_INTERVAL_LOW_ABBREV (1U<<4) /* {,n} => {0,n} */
|
||||
#define ONIG_SYN_STRICT_CHECK_BACKREF (1U<<5) /* /(\1)/,/\1()/ ..*/
|
||||
#define ONIG_SYN_DIFFERENT_LEN_ALT_LOOK_BEHIND (1U<<6) /* (?<=a|bc) */
|
||||
#define ONIG_SYN_CAPTURE_ONLY_NAMED_GROUP (1U<<7) /* see doc/RE */
|
||||
#define ONIG_SYN_ALLOW_MULTIPLEX_DEFINITION_NAME (1U<<8) /* (?<x>)(?<x>) */
|
||||
#define ONIG_SYN_FIXED_INTERVAL_IS_GREEDY_ONLY (1U<<9) /* a{n}?=(?:a{n})? */
|
||||
#define ONIG_SYN_ALLOW_MULTIPLEX_DEFINITION_NAME_CALL (1U<<10) /* (?<x>)(?<x>)(?&x) */
|
||||
|
||||
/* syntax (behavior) in char class [...] */
|
||||
#define ONIG_SYN_NOT_NEWLINE_IN_NEGATIVE_CC (1U<<20) /* [^...] */
|
||||
#define ONIG_SYN_BACKSLASH_ESCAPE_IN_CC (1U<<21) /* [..\w..] etc.. */
|
||||
#define ONIG_SYN_ALLOW_EMPTY_RANGE_IN_CC (1U<<22)
|
||||
#define ONIG_SYN_ALLOW_DOUBLE_RANGE_OP_IN_CC (1U<<23) /* [0-9-a]=[0-9\-a] */
|
||||
/* syntax (behavior) warning */
|
||||
#define ONIG_SYN_WARN_CC_OP_NOT_ESCAPED (1U<<24) /* [,-,] */
|
||||
#define ONIG_SYN_WARN_REDUNDANT_NESTED_REPEAT (1U<<25) /* (?:a*)+ */
|
||||
#define ONIG_SYN_WARN_CC_DUP (1U<<26) /* [aa] */
|
||||
|
||||
/* meta character specifiers (onig_set_meta_char()) */
|
||||
#define ONIG_META_CHAR_ESCAPE 0
|
||||
#define ONIG_META_CHAR_ANYCHAR 1
|
||||
#define ONIG_META_CHAR_ANYTIME 2
|
||||
#define ONIG_META_CHAR_ZERO_OR_ONE_TIME 3
|
||||
#define ONIG_META_CHAR_ONE_OR_MORE_TIME 4
|
||||
#define ONIG_META_CHAR_ANYCHAR_ANYTIME 5
|
||||
|
||||
#define ONIG_INEFFECTIVE_META_CHAR 0
|
||||
|
||||
/* error codes */
|
||||
#define ONIG_IS_PATTERN_ERROR(ecode) ((ecode) <= -100 && (ecode) > -1000)
|
||||
/* normal return */
|
||||
#define ONIG_NORMAL 0
|
||||
#define ONIG_MISMATCH -1
|
||||
#define ONIG_NO_SUPPORT_CONFIG -2
|
||||
|
||||
/* internal error */
|
||||
#define ONIGERR_MEMORY -5
|
||||
#define ONIGERR_TYPE_BUG -6
|
||||
#define ONIGERR_PARSER_BUG -11
|
||||
#define ONIGERR_STACK_BUG -12
|
||||
#define ONIGERR_UNDEFINED_BYTECODE -13
|
||||
#define ONIGERR_UNEXPECTED_BYTECODE -14
|
||||
#define ONIGERR_MATCH_STACK_LIMIT_OVER -15
|
||||
#define ONIGERR_DEFAULT_ENCODING_IS_NOT_SET -21
|
||||
#define ONIGERR_SPECIFIED_ENCODING_CANT_CONVERT_TO_WIDE_CHAR -22
|
||||
/* general error */
|
||||
#define ONIGERR_INVALID_ARGUMENT -30
|
||||
/* syntax error */
|
||||
#define ONIGERR_END_PATTERN_AT_LEFT_BRACE -100
|
||||
#define ONIGERR_END_PATTERN_AT_LEFT_BRACKET -101
|
||||
#define ONIGERR_EMPTY_CHAR_CLASS -102
|
||||
#define ONIGERR_PREMATURE_END_OF_CHAR_CLASS -103
|
||||
#define ONIGERR_END_PATTERN_AT_ESCAPE -104
|
||||
#define ONIGERR_END_PATTERN_AT_META -105
|
||||
#define ONIGERR_END_PATTERN_AT_CONTROL -106
|
||||
#define ONIGERR_META_CODE_SYNTAX -108
|
||||
#define ONIGERR_CONTROL_CODE_SYNTAX -109
|
||||
#define ONIGERR_CHAR_CLASS_VALUE_AT_END_OF_RANGE -110
|
||||
#define ONIGERR_CHAR_CLASS_VALUE_AT_START_OF_RANGE -111
|
||||
#define ONIGERR_UNMATCHED_RANGE_SPECIFIER_IN_CHAR_CLASS -112
|
||||
#define ONIGERR_TARGET_OF_REPEAT_OPERATOR_NOT_SPECIFIED -113
|
||||
#define ONIGERR_TARGET_OF_REPEAT_OPERATOR_INVALID -114
|
||||
#define ONIGERR_NESTED_REPEAT_OPERATOR -115
|
||||
#define ONIGERR_UNMATCHED_CLOSE_PARENTHESIS -116
|
||||
#define ONIGERR_END_PATTERN_WITH_UNMATCHED_PARENTHESIS -117
|
||||
#define ONIGERR_END_PATTERN_IN_GROUP -118
|
||||
#define ONIGERR_UNDEFINED_GROUP_OPTION -119
|
||||
#define ONIGERR_INVALID_POSIX_BRACKET_TYPE -121
|
||||
#define ONIGERR_INVALID_LOOK_BEHIND_PATTERN -122
|
||||
#define ONIGERR_INVALID_REPEAT_RANGE_PATTERN -123
|
||||
#define ONIGERR_INVALID_CONDITION_PATTERN -124
|
||||
/* values error (syntax error) */
|
||||
#define ONIGERR_TOO_BIG_NUMBER -200
|
||||
#define ONIGERR_TOO_BIG_NUMBER_FOR_REPEAT_RANGE -201
|
||||
#define ONIGERR_UPPER_SMALLER_THAN_LOWER_IN_REPEAT_RANGE -202
|
||||
#define ONIGERR_EMPTY_RANGE_IN_CHAR_CLASS -203
|
||||
#define ONIGERR_MISMATCH_CODE_LENGTH_IN_CLASS_RANGE -204
|
||||
#define ONIGERR_TOO_MANY_MULTI_BYTE_RANGES -205
|
||||
#define ONIGERR_TOO_SHORT_MULTI_BYTE_STRING -206
|
||||
#define ONIGERR_TOO_BIG_BACKREF_NUMBER -207
|
||||
#define ONIGERR_INVALID_BACKREF -208
|
||||
#define ONIGERR_NUMBERED_BACKREF_OR_CALL_NOT_ALLOWED -209
|
||||
#define ONIGERR_TOO_SHORT_DIGITS -210
|
||||
#define ONIGERR_TOO_LONG_WIDE_CHAR_VALUE -212
|
||||
#define ONIGERR_EMPTY_GROUP_NAME -214
|
||||
#define ONIGERR_INVALID_GROUP_NAME -215
|
||||
#define ONIGERR_INVALID_CHAR_IN_GROUP_NAME -216
|
||||
#define ONIGERR_UNDEFINED_NAME_REFERENCE -217
|
||||
#define ONIGERR_UNDEFINED_GROUP_REFERENCE -218
|
||||
#define ONIGERR_MULTIPLEX_DEFINED_NAME -219
|
||||
#define ONIGERR_MULTIPLEX_DEFINITION_NAME_CALL -220
|
||||
#define ONIGERR_NEVER_ENDING_RECURSION -221
|
||||
#define ONIGERR_GROUP_NUMBER_OVER_FOR_CAPTURE_HISTORY -222
|
||||
#define ONIGERR_INVALID_CHAR_PROPERTY_NAME -223
|
||||
#define ONIGERR_INVALID_CODE_POINT_VALUE -400
|
||||
#define ONIGERR_INVALID_WIDE_CHAR_VALUE -400
|
||||
#define ONIGERR_TOO_BIG_WIDE_CHAR_VALUE -401
|
||||
#define ONIGERR_NOT_SUPPORTED_ENCODING_COMBINATION -402
|
||||
#define ONIGERR_INVALID_COMBINATION_OF_OPTIONS -403
|
||||
|
||||
/* errors related to thread */
|
||||
#define ONIGERR_OVER_THREAD_PASS_LIMIT_COUNT -1001
|
||||
|
||||
|
||||
/* must be smaller than BIT_STATUS_BITS_NUM (unsigned int * 8) */
|
||||
#define ONIG_MAX_CAPTURE_HISTORY_GROUP 31
|
||||
#define ONIG_IS_CAPTURE_HISTORY_GROUP(r, i) \
|
||||
((i) <= ONIG_MAX_CAPTURE_HISTORY_GROUP && (r)->list && (r)->list[i])
|
||||
|
||||
typedef struct OnigCaptureTreeNodeStruct {
|
||||
int group; /* group number */
|
||||
OnigPosition beg;
|
||||
OnigPosition end;
|
||||
int allocated;
|
||||
int num_childs;
|
||||
struct OnigCaptureTreeNodeStruct** childs;
|
||||
} OnigCaptureTreeNode;
|
||||
|
||||
/* match result region type */
|
||||
struct re_registers {
|
||||
int allocated;
|
||||
int num_regs;
|
||||
OnigPosition* beg;
|
||||
OnigPosition* end;
|
||||
/* extended */
|
||||
OnigCaptureTreeNode* history_root; /* capture history tree root */
|
||||
};
|
||||
|
||||
/* capture tree traverse */
|
||||
#define ONIG_TRAVERSE_CALLBACK_AT_FIRST 1
|
||||
#define ONIG_TRAVERSE_CALLBACK_AT_LAST 2
|
||||
#define ONIG_TRAVERSE_CALLBACK_AT_BOTH \
|
||||
( ONIG_TRAVERSE_CALLBACK_AT_FIRST | ONIG_TRAVERSE_CALLBACK_AT_LAST )
|
||||
|
||||
|
||||
#define ONIG_REGION_NOTPOS -1
|
||||
|
||||
typedef struct re_registers OnigRegion;
|
||||
|
||||
typedef struct {
|
||||
OnigEncoding enc;
|
||||
OnigUChar* par;
|
||||
OnigUChar* par_end;
|
||||
} OnigErrorInfo;
|
||||
|
||||
typedef struct {
|
||||
int lower;
|
||||
int upper;
|
||||
} OnigRepeatRange;
|
||||
|
||||
typedef void (*OnigWarnFunc) P_((const char* s));
|
||||
extern void onig_null_warn P_((const char* s));
|
||||
#define ONIG_NULL_WARN onig_null_warn
|
||||
|
||||
#define ONIG_CHAR_TABLE_SIZE 256
|
||||
|
||||
/* regex_t state */
|
||||
#define ONIG_STATE_NORMAL 0
|
||||
#define ONIG_STATE_SEARCHING 1
|
||||
#define ONIG_STATE_COMPILING -1
|
||||
#define ONIG_STATE_MODIFY -2
|
||||
|
||||
#define ONIG_STATE(reg) \
|
||||
((reg)->state > 0 ? ONIG_STATE_SEARCHING : (reg)->state)
|
||||
|
||||
typedef struct re_pattern_buffer {
|
||||
/* common members of BBuf(bytes-buffer) */
|
||||
unsigned char* p; /* compiled pattern */
|
||||
unsigned int used; /* used space for p */
|
||||
unsigned int alloc; /* allocated space for p */
|
||||
|
||||
int state; /* normal, searching, compiling */
|
||||
int num_mem; /* used memory(...) num counted from 1 */
|
||||
int num_repeat; /* OP_REPEAT/OP_REPEAT_NG id-counter */
|
||||
int num_null_check; /* OP_NULL_CHECK_START/END id counter */
|
||||
int num_comb_exp_check; /* combination explosion check */
|
||||
int num_call; /* number of subexp call */
|
||||
unsigned int capture_history; /* (?@...) flag (1-31) */
|
||||
unsigned int bt_mem_start; /* need backtrack flag */
|
||||
unsigned int bt_mem_end; /* need backtrack flag */
|
||||
int stack_pop_level;
|
||||
int repeat_range_alloc;
|
||||
OnigRepeatRange* repeat_range;
|
||||
|
||||
OnigEncoding enc;
|
||||
OnigOptionType options;
|
||||
const OnigSyntaxType* syntax;
|
||||
OnigCaseFoldType case_fold_flag;
|
||||
void* name_table;
|
||||
|
||||
/* optimization info (string search, char-map and anchors) */
|
||||
int optimize; /* optimize flag */
|
||||
int threshold_len; /* search str-length for apply optimize */
|
||||
int anchor; /* BEGIN_BUF, BEGIN_POS, (SEMI_)END_BUF */
|
||||
OnigDistance anchor_dmin; /* (SEMI_)END_BUF anchor distance */
|
||||
OnigDistance anchor_dmax; /* (SEMI_)END_BUF anchor distance */
|
||||
int sub_anchor; /* start-anchor for exact or map */
|
||||
unsigned char *exact;
|
||||
unsigned char *exact_end;
|
||||
unsigned char map[ONIG_CHAR_TABLE_SIZE]; /* used as BM skip or char-map */
|
||||
int *int_map; /* BM skip for exact_len > 255 */
|
||||
int *int_map_backward; /* BM skip for backward search */
|
||||
OnigDistance dmin; /* min-distance of exact or map */
|
||||
OnigDistance dmax; /* max-distance of exact or map */
|
||||
|
||||
/* regex_t link chain */
|
||||
struct re_pattern_buffer* chain; /* escape compile-conflict */
|
||||
} OnigRegexType;
|
||||
|
||||
typedef OnigRegexType* OnigRegex;
|
||||
|
||||
#ifndef ONIG_ESCAPE_REGEX_T_COLLISION
|
||||
typedef OnigRegexType regex_t;
|
||||
#endif
|
||||
|
||||
|
||||
typedef struct {
|
||||
int num_of_elements;
|
||||
OnigEncoding pattern_enc;
|
||||
OnigEncoding target_enc;
|
||||
OnigSyntaxType* syntax;
|
||||
OnigOptionType option;
|
||||
OnigCaseFoldType case_fold_flag;
|
||||
} OnigCompileInfo;
|
||||
|
||||
/* Oniguruma Native API */
|
||||
ONIG_EXTERN
|
||||
int onig_init P_((void));
|
||||
ONIG_EXTERN
|
||||
int onig_error_code_to_str PV_((OnigUChar* s, OnigPosition err_code, ...));
|
||||
ONIG_EXTERN
|
||||
void onig_set_warn_func P_((OnigWarnFunc f));
|
||||
ONIG_EXTERN
|
||||
void onig_set_verb_warn_func P_((OnigWarnFunc f));
|
||||
ONIG_EXTERN
|
||||
int onig_new P_((OnigRegex*, const OnigUChar* pattern, const OnigUChar* pattern_end, OnigOptionType option, OnigEncoding enc, const OnigSyntaxType* syntax, OnigErrorInfo* einfo));
|
||||
ONIG_EXTERN
|
||||
int onig_reg_init P_((OnigRegex reg, OnigOptionType option, OnigCaseFoldType case_fold_flag, OnigEncoding enc, const OnigSyntaxType* syntax));
|
||||
ONIG_EXTERN
|
||||
int onig_new_without_alloc P_((OnigRegex, const OnigUChar* pattern, const OnigUChar* pattern_end, OnigOptionType option, OnigEncoding enc, OnigSyntaxType* syntax, OnigErrorInfo* einfo));
|
||||
ONIG_EXTERN
|
||||
int onig_new_deluxe P_((OnigRegex* reg, const OnigUChar* pattern, const OnigUChar* pattern_end, OnigCompileInfo* ci, OnigErrorInfo* einfo));
|
||||
ONIG_EXTERN
|
||||
void onig_free P_((OnigRegex));
|
||||
ONIG_EXTERN
|
||||
void onig_free_body P_((OnigRegex));
|
||||
ONIG_EXTERN
|
||||
int onig_recompile P_((OnigRegex, const OnigUChar* pattern, const OnigUChar* pattern_end, OnigOptionType option, OnigEncoding enc, OnigSyntaxType* syntax, OnigErrorInfo* einfo));
|
||||
ONIG_EXTERN
|
||||
int onig_recompile_deluxe P_((OnigRegex reg, const OnigUChar* pattern, const OnigUChar* pattern_end, OnigCompileInfo* ci, OnigErrorInfo* einfo));
|
||||
ONIG_EXTERN
|
||||
OnigPosition onig_search P_((OnigRegex, const OnigUChar* str, const OnigUChar* end, const OnigUChar* start, const OnigUChar* range, OnigRegion* region, OnigOptionType option));
|
||||
ONIG_EXTERN
|
||||
OnigPosition onig_search_gpos P_((OnigRegex, const OnigUChar* str, const OnigUChar* end, const OnigUChar* global_pos, const OnigUChar* start, const OnigUChar* range, OnigRegion* region, OnigOptionType option));
|
||||
ONIG_EXTERN
|
||||
OnigPosition onig_match P_((OnigRegex, const OnigUChar* str, const OnigUChar* end, const OnigUChar* at, OnigRegion* region, OnigOptionType option));
|
||||
ONIG_EXTERN
|
||||
OnigRegion* onig_region_new P_((void));
|
||||
ONIG_EXTERN
|
||||
void onig_region_init P_((OnigRegion* region));
|
||||
ONIG_EXTERN
|
||||
void onig_region_free P_((OnigRegion* region, int free_self));
|
||||
ONIG_EXTERN
|
||||
void onig_region_copy P_((OnigRegion* to, OnigRegion* from));
|
||||
ONIG_EXTERN
|
||||
void onig_region_clear P_((OnigRegion* region));
|
||||
ONIG_EXTERN
|
||||
int onig_region_resize P_((OnigRegion* region, int n));
|
||||
ONIG_EXTERN
|
||||
int onig_region_set P_((OnigRegion* region, int at, int beg, int end));
|
||||
ONIG_EXTERN
|
||||
int onig_name_to_group_numbers P_((OnigRegex reg, const OnigUChar* name, const OnigUChar* name_end, int** nums));
|
||||
ONIG_EXTERN
|
||||
int onig_name_to_backref_number P_((OnigRegex reg, const OnigUChar* name, const OnigUChar* name_end, OnigRegion *region));
|
||||
ONIG_EXTERN
|
||||
int onig_foreach_name P_((OnigRegex reg, int (*func)(const OnigUChar*, const OnigUChar*,int,int*,OnigRegex,void*), void* arg));
|
||||
ONIG_EXTERN
|
||||
int onig_number_of_names P_((OnigRegex reg));
|
||||
ONIG_EXTERN
|
||||
int onig_number_of_captures P_((OnigRegex reg));
|
||||
ONIG_EXTERN
|
||||
int onig_number_of_capture_histories P_((OnigRegex reg));
|
||||
ONIG_EXTERN
|
||||
OnigCaptureTreeNode* onig_get_capture_tree P_((OnigRegion* region));
|
||||
ONIG_EXTERN
|
||||
int onig_capture_tree_traverse P_((OnigRegion* region, int at, int(*callback_func)(int,OnigPosition,OnigPosition,int,int,void*), void* arg));
|
||||
ONIG_EXTERN
|
||||
int onig_noname_group_capture_is_active P_((OnigRegex reg));
|
||||
ONIG_EXTERN
|
||||
OnigEncoding onig_get_encoding P_((OnigRegex reg));
|
||||
ONIG_EXTERN
|
||||
OnigOptionType onig_get_options P_((OnigRegex reg));
|
||||
ONIG_EXTERN
|
||||
OnigCaseFoldType onig_get_case_fold_flag P_((OnigRegex reg));
|
||||
ONIG_EXTERN
|
||||
const OnigSyntaxType* onig_get_syntax P_((OnigRegex reg));
|
||||
ONIG_EXTERN
|
||||
int onig_set_default_syntax P_((const OnigSyntaxType* syntax));
|
||||
ONIG_EXTERN
|
||||
void onig_copy_syntax P_((OnigSyntaxType* to, const OnigSyntaxType* from));
|
||||
ONIG_EXTERN
|
||||
unsigned int onig_get_syntax_op P_((OnigSyntaxType* syntax));
|
||||
ONIG_EXTERN
|
||||
unsigned int onig_get_syntax_op2 P_((OnigSyntaxType* syntax));
|
||||
ONIG_EXTERN
|
||||
unsigned int onig_get_syntax_behavior P_((OnigSyntaxType* syntax));
|
||||
ONIG_EXTERN
|
||||
OnigOptionType onig_get_syntax_options P_((OnigSyntaxType* syntax));
|
||||
ONIG_EXTERN
|
||||
void onig_set_syntax_op P_((OnigSyntaxType* syntax, unsigned int op));
|
||||
ONIG_EXTERN
|
||||
void onig_set_syntax_op2 P_((OnigSyntaxType* syntax, unsigned int op2));
|
||||
ONIG_EXTERN
|
||||
void onig_set_syntax_behavior P_((OnigSyntaxType* syntax, unsigned int behavior));
|
||||
ONIG_EXTERN
|
||||
void onig_set_syntax_options P_((OnigSyntaxType* syntax, OnigOptionType options));
|
||||
ONIG_EXTERN
|
||||
int onig_set_meta_char P_((OnigSyntaxType* syntax, unsigned int what, OnigCodePoint code));
|
||||
ONIG_EXTERN
|
||||
void onig_copy_encoding P_((OnigEncoding to, OnigEncoding from));
|
||||
ONIG_EXTERN
|
||||
OnigCaseFoldType onig_get_default_case_fold_flag P_((void));
|
||||
ONIG_EXTERN
|
||||
int onig_set_default_case_fold_flag P_((OnigCaseFoldType case_fold_flag));
|
||||
ONIG_EXTERN
|
||||
unsigned int onig_get_match_stack_limit_size P_((void));
|
||||
ONIG_EXTERN
|
||||
int onig_set_match_stack_limit_size P_((unsigned int size));
|
||||
ONIG_EXTERN
|
||||
int onig_end P_((void));
|
||||
ONIG_EXTERN
|
||||
const char* onig_version P_((void));
|
||||
ONIG_EXTERN
|
||||
const char* onig_copyright P_((void));
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility pop
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if 0
|
||||
{ /* satisfy cc-mode */
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ONIGURUMA_H */
|
||||
@@ -1,75 +0,0 @@
|
||||
/**********************************************************************
|
||||
|
||||
re.h -
|
||||
|
||||
$Author: nobu $
|
||||
created at: Thu Sep 30 14:18:32 JST 1993
|
||||
|
||||
Copyright (C) 1993-2007 Yukihiro Matsumoto
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef RUBY_RE_H
|
||||
#define RUBY_RE_H 1
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#if 0
|
||||
} /* satisfy cc-mode */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "ruby/regex.h"
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility push(default)
|
||||
#endif
|
||||
|
||||
typedef struct re_pattern_buffer Regexp;
|
||||
|
||||
struct rmatch_offset {
|
||||
long beg;
|
||||
long end;
|
||||
};
|
||||
|
||||
struct rmatch {
|
||||
struct re_registers regs;
|
||||
|
||||
int char_offset_updated;
|
||||
int char_offset_num_allocated;
|
||||
struct rmatch_offset *char_offset;
|
||||
};
|
||||
|
||||
struct RMatch {
|
||||
struct RBasic basic;
|
||||
VALUE str;
|
||||
struct rmatch *rmatch;
|
||||
VALUE regexp; /* RRegexp */
|
||||
};
|
||||
|
||||
#define RMATCH(obj) (R_CAST(RMatch)(obj))
|
||||
#define RMATCH_REGS(obj) (&(R_CAST(RMatch)(obj))->rmatch->regs)
|
||||
|
||||
VALUE rb_reg_regcomp(VALUE);
|
||||
long rb_reg_search(VALUE, VALUE, long, int);
|
||||
VALUE rb_reg_regsub(VALUE, VALUE, struct re_registers *, VALUE);
|
||||
long rb_reg_adjust_startpos(VALUE, VALUE, long, int);
|
||||
void rb_match_busy(VALUE);
|
||||
VALUE rb_reg_quote(VALUE);
|
||||
regex_t *rb_reg_prepare_re(VALUE re, VALUE str);
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility pop
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
#if 0
|
||||
{ /* satisfy cc-mode */
|
||||
#endif
|
||||
} /* extern "C" { */
|
||||
#endif
|
||||
|
||||
#endif /* RUBY_RE_H */
|
||||
@@ -1,50 +0,0 @@
|
||||
/**********************************************************************
|
||||
|
||||
regex.h -
|
||||
|
||||
$Author: nobu $
|
||||
|
||||
Copyright (C) 1993-2007 Yukihiro Matsumoto
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef ONIGURUMA_REGEX_H
|
||||
#define ONIGURUMA_REGEX_H 1
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#if 0
|
||||
} /* satisfy cc-mode */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef RUBY
|
||||
#include "ruby/oniguruma.h"
|
||||
#else
|
||||
#include "oniguruma.h"
|
||||
#endif
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility push(default)
|
||||
#endif
|
||||
|
||||
#ifndef ONIG_RUBY_M17N
|
||||
|
||||
ONIG_EXTERN OnigEncoding OnigEncDefaultCharEncoding;
|
||||
|
||||
#define mbclen(p,e,enc) rb_enc_mbclen((p),(e),(enc))
|
||||
|
||||
#endif /* ifndef ONIG_RUBY_M17N */
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility pop
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
#if 0
|
||||
{ /* satisfy cc-mode */
|
||||
#endif
|
||||
} /* extern "C" { */
|
||||
#endif
|
||||
|
||||
#endif /* ONIGURUMA_REGEX_H */
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,157 +0,0 @@
|
||||
/* This is a public domain general purpose hash table package written by Peter Moore @ UCB. */
|
||||
|
||||
/* @(#) st.h 5.1 89/12/14 */
|
||||
|
||||
#ifndef RUBY_ST_H
|
||||
#define RUBY_ST_H 1
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#if 0
|
||||
} /* satisfy cc-mode */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "ruby/defines.h"
|
||||
|
||||
#if defined STDC_HEADERS
|
||||
#include <stddef.h>
|
||||
#elif defined HAVE_STDLIB_H
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STDINT_H
|
||||
# include <stdint.h>
|
||||
#endif
|
||||
#ifdef HAVE_INTTYPES_H
|
||||
# include <inttypes.h>
|
||||
#endif
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility push(default)
|
||||
#endif
|
||||
|
||||
#if SIZEOF_LONG == SIZEOF_VOIDP
|
||||
typedef unsigned long st_data_t;
|
||||
#elif SIZEOF_LONG_LONG == SIZEOF_VOIDP
|
||||
typedef unsigned LONG_LONG st_data_t;
|
||||
#else
|
||||
# error ---->> st.c requires sizeof(void*) == sizeof(long) or sizeof(LONG_LONG) to be compiled. <<----
|
||||
#endif
|
||||
#define ST_DATA_T_DEFINED
|
||||
|
||||
#ifndef CHAR_BIT
|
||||
# ifdef HAVE_LIMITS_H
|
||||
# include <limits.h>
|
||||
# else
|
||||
# define CHAR_BIT 8
|
||||
# endif
|
||||
#endif
|
||||
#ifndef _
|
||||
# define _(args) args
|
||||
#endif
|
||||
#ifndef ANYARGS
|
||||
# ifdef __cplusplus
|
||||
# define ANYARGS ...
|
||||
# else
|
||||
# define ANYARGS
|
||||
# endif
|
||||
#endif
|
||||
|
||||
typedef struct st_table st_table;
|
||||
|
||||
typedef st_data_t st_index_t;
|
||||
typedef int st_compare_func(st_data_t, st_data_t);
|
||||
typedef st_index_t st_hash_func(st_data_t);
|
||||
|
||||
typedef char st_check_for_sizeof_st_index_t[SIZEOF_VOIDP == (int)sizeof(st_index_t) ? 1 : -1];
|
||||
#define SIZEOF_ST_INDEX_T SIZEOF_VOIDP
|
||||
|
||||
struct st_hash_type {
|
||||
int (*compare)(ANYARGS /*st_data_t, st_data_t*/); /* st_compare_func* */
|
||||
st_index_t (*hash)(ANYARGS /*st_data_t*/); /* st_hash_func* */
|
||||
};
|
||||
|
||||
#define ST_INDEX_BITS (sizeof(st_index_t) * CHAR_BIT)
|
||||
|
||||
struct st_table {
|
||||
const struct st_hash_type *type;
|
||||
st_index_t num_bins;
|
||||
unsigned int entries_packed : 1;
|
||||
#ifdef __GNUC__
|
||||
/*
|
||||
* C spec says,
|
||||
* A bit-field shall have a type that is a qualified or unqualified
|
||||
* version of _Bool, signed int, unsigned int, or some other
|
||||
* implementation-defined type. It is implementation-defined whether
|
||||
* atomic types are permitted.
|
||||
* In short, long and long long bit-field are implementation-defined
|
||||
* feature. Therefore we want to supress a warning explicitly.
|
||||
*/
|
||||
__extension__
|
||||
#endif
|
||||
st_index_t num_entries : ST_INDEX_BITS - 1;
|
||||
union {
|
||||
struct {
|
||||
struct st_table_entry **bins;
|
||||
struct st_table_entry *head, *tail;
|
||||
} big;
|
||||
struct {
|
||||
struct st_packed_entry *entries;
|
||||
st_index_t real_entries;
|
||||
} packed;
|
||||
} as;
|
||||
};
|
||||
|
||||
#define st_is_member(table,key) st_lookup((table),(key),(st_data_t *)0)
|
||||
|
||||
enum st_retval {ST_CONTINUE, ST_STOP, ST_DELETE, ST_CHECK};
|
||||
|
||||
st_table *st_init_table(const struct st_hash_type *);
|
||||
st_table *st_init_table_with_size(const struct st_hash_type *, st_index_t);
|
||||
st_table *st_init_numtable(void);
|
||||
st_table *st_init_numtable_with_size(st_index_t);
|
||||
st_table *st_init_strtable(void);
|
||||
st_table *st_init_strtable_with_size(st_index_t);
|
||||
st_table *st_init_strcasetable(void);
|
||||
st_table *st_init_strcasetable_with_size(st_index_t);
|
||||
int st_delete(st_table *, st_data_t *, st_data_t *); /* returns 0:notfound 1:deleted */
|
||||
int st_delete_safe(st_table *, st_data_t *, st_data_t *, st_data_t);
|
||||
int st_insert(st_table *, st_data_t, st_data_t);
|
||||
int st_insert2(st_table *, st_data_t, st_data_t, st_data_t (*)(st_data_t));
|
||||
int st_lookup(st_table *, st_data_t, st_data_t *);
|
||||
int st_get_key(st_table *, st_data_t, st_data_t *);
|
||||
typedef int st_update_callback_func(st_data_t *key, st_data_t *value, st_data_t arg, int existing);
|
||||
int st_update(st_table *table, st_data_t key, st_update_callback_func *func, st_data_t arg);
|
||||
int st_foreach(st_table *, int (*)(ANYARGS), st_data_t);
|
||||
int st_foreach_check(st_table *, int (*)(ANYARGS), st_data_t, st_data_t);
|
||||
int st_reverse_foreach(st_table *, int (*)(ANYARGS), st_data_t);
|
||||
void st_add_direct(st_table *, st_data_t, st_data_t);
|
||||
void st_free_table(st_table *);
|
||||
void st_cleanup_safe(st_table *, st_data_t);
|
||||
void st_clear(st_table *);
|
||||
st_table *st_copy(st_table *);
|
||||
int st_numcmp(st_data_t, st_data_t);
|
||||
st_index_t st_numhash(st_data_t);
|
||||
int st_strcasecmp(const char *s1, const char *s2);
|
||||
int st_strncasecmp(const char *s1, const char *s2, size_t n);
|
||||
size_t st_memsize(const st_table *);
|
||||
st_index_t st_hash(const void *ptr, size_t len, st_index_t h);
|
||||
st_index_t st_hash_uint32(st_index_t h, uint32_t i);
|
||||
st_index_t st_hash_uint(st_index_t h, st_index_t i);
|
||||
st_index_t st_hash_end(st_index_t h);
|
||||
st_index_t st_hash_start(st_index_t h);
|
||||
#define st_hash_start(h) ((st_index_t)(h))
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility pop
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
#if 0
|
||||
{ /* satisfy cc-mode */
|
||||
#endif
|
||||
} /* extern "C" { */
|
||||
#endif
|
||||
|
||||
#endif /* RUBY_ST_H */
|
||||
@@ -1,19 +0,0 @@
|
||||
#ifndef RUBY_SUBST_H
|
||||
#define RUBY_SUBST_H 1
|
||||
|
||||
#undef snprintf
|
||||
#undef vsnprintf
|
||||
#define snprintf ruby_snprintf
|
||||
#define vsnprintf ruby_vsnprintf
|
||||
|
||||
#ifdef BROKEN_CLOSE
|
||||
#undef getpeername
|
||||
#define getpeername ruby_getpeername
|
||||
#undef getsockname
|
||||
#define getsockname ruby_getsockname
|
||||
#undef shutdown
|
||||
#define shutdown ruby_shutdown
|
||||
#undef close
|
||||
#define close ruby_close
|
||||
#endif
|
||||
#endif
|
||||
@@ -1,49 +0,0 @@
|
||||
/**********************************************************************
|
||||
|
||||
thread.h -
|
||||
|
||||
$Author: matz $
|
||||
created at: Tue Jul 10 17:35:43 JST 2012
|
||||
|
||||
Copyright (C) 2007 Yukihiro Matsumoto
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef RUBY_THREAD_H
|
||||
#define RUBY_THREAD_H 1
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#if 0
|
||||
} /* satisfy cc-mode */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "ruby/intern.h"
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility push(default)
|
||||
#endif
|
||||
|
||||
void *rb_thread_call_with_gvl(void *(*func)(void *), void *data1);
|
||||
|
||||
void *rb_thread_call_without_gvl(void *(*func)(void *), void *data1,
|
||||
rb_unblock_function_t *ubf, void *data2);
|
||||
void *rb_thread_call_without_gvl2(void *(*func)(void *), void *data1,
|
||||
rb_unblock_function_t *ubf, void *data2);
|
||||
|
||||
#define RUBY_CALL_WO_GVL_FLAG_SKIP_CHECK_INTS_AFTER 0x01
|
||||
#define RUBY_CALL_WO_GVL_FLAG_SKIP_CHECK_INTS_
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility pop
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
#if 0
|
||||
{ /* satisfy cc-mode */
|
||||
#endif
|
||||
} /* extern "C" { */
|
||||
#endif
|
||||
|
||||
#endif /* RUBY_THREAD_H */
|
||||
@@ -1,99 +0,0 @@
|
||||
/**********************************************************************
|
||||
|
||||
util.h -
|
||||
|
||||
$Author: tadf $
|
||||
created at: Thu Mar 9 11:55:53 JST 1995
|
||||
|
||||
Copyright (C) 1993-2007 Yukihiro Matsumoto
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef RUBY_UTIL_H
|
||||
#define RUBY_UTIL_H 1
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#if 0
|
||||
} /* satisfy cc-mode */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "ruby/defines.h"
|
||||
#ifdef RUBY_EXTCONF_H
|
||||
#include RUBY_EXTCONF_H
|
||||
#endif
|
||||
|
||||
#ifndef _
|
||||
#ifdef __cplusplus
|
||||
# ifndef HAVE_PROTOTYPES
|
||||
# define HAVE_PROTOTYPES 1
|
||||
# endif
|
||||
# ifndef HAVE_STDARG_PROTOTYPES
|
||||
# define HAVE_STDARG_PROTOTYPES 1
|
||||
# endif
|
||||
#endif
|
||||
#ifdef HAVE_PROTOTYPES
|
||||
# define _(args) args
|
||||
#else
|
||||
# define _(args) ()
|
||||
#endif
|
||||
#ifdef HAVE_STDARG_PROTOTYPES
|
||||
# define __(args) args
|
||||
#else
|
||||
# define __(args) ()
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility push(default)
|
||||
#endif
|
||||
|
||||
#define scan_oct(s,l,e) ((int)ruby_scan_oct((s),(l),(e)))
|
||||
unsigned long ruby_scan_oct(const char *, size_t, size_t *);
|
||||
#define scan_hex(s,l,e) ((int)ruby_scan_hex((s),(l),(e)))
|
||||
unsigned long ruby_scan_hex(const char *, size_t, size_t *);
|
||||
|
||||
void ruby_qsort(void *, const size_t, const size_t,
|
||||
int (*)(const void *, const void *, void *), void *);
|
||||
|
||||
void ruby_setenv(const char *, const char *);
|
||||
void ruby_unsetenv(const char *);
|
||||
#undef setenv
|
||||
#undef unsetenv
|
||||
#define setenv(name,val) ruby_setenv((name),(val))
|
||||
#define unsetenv(name,val) ruby_unsetenv(name)
|
||||
|
||||
char *ruby_strdup(const char *);
|
||||
#undef strdup
|
||||
#define strdup(s) ruby_strdup(s)
|
||||
|
||||
char *ruby_getcwd(void);
|
||||
#define my_getcwd() ruby_getcwd()
|
||||
|
||||
double ruby_strtod(const char *, char **);
|
||||
#undef strtod
|
||||
#define strtod(s,e) ruby_strtod((s),(e))
|
||||
|
||||
#if defined _MSC_VER && _MSC_VER >= 1300
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable:4723)
|
||||
#endif
|
||||
#if defined _MSC_VER && _MSC_VER >= 1300
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
||||
void ruby_each_words(const char *, void (*)(const char*, int, void*), void *);
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility pop
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
#if 0
|
||||
{ /* satisfy cc-mode */
|
||||
#endif
|
||||
} /* extern "C" { */
|
||||
#endif
|
||||
|
||||
#endif /* RUBY_UTIL_H */
|
||||
@@ -1,78 +0,0 @@
|
||||
/**********************************************************************
|
||||
|
||||
ruby/version.h -
|
||||
|
||||
$Author: ayumin $
|
||||
created at: Wed May 13 12:56:56 JST 2009
|
||||
|
||||
Copyright (C) 1993-2009 Yukihiro Matsumoto
|
||||
Copyright (C) 2000 Network Applied Communication Laboratory, Inc.
|
||||
Copyright (C) 2000 Information-technology Promotion Agency, Japan
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
/*
|
||||
* This file contains only
|
||||
* - never-changable informations, and
|
||||
* - interfaces accessible from extension libraries.
|
||||
*
|
||||
* Never try to check RUBY_VERSION_CODE etc in extension libraries,
|
||||
* check the features with mkmf.rb instead.
|
||||
*/
|
||||
|
||||
#ifndef RUBY_VERSION_H
|
||||
#define RUBY_VERSION_H 1
|
||||
|
||||
/* The origin. */
|
||||
#define RUBY_AUTHOR "Yukihiro Matsumoto"
|
||||
#define RUBY_BIRTH_YEAR 1993
|
||||
#define RUBY_BIRTH_MONTH 2
|
||||
#define RUBY_BIRTH_DAY 24
|
||||
|
||||
/* API version */
|
||||
#define RUBY_API_VERSION_MAJOR 2
|
||||
#define RUBY_API_VERSION_MINOR 0
|
||||
#define RUBY_API_VERSION_TEENY 0
|
||||
#define RUBY_API_VERSION_CODE (RUBY_API_VERSION_MAJOR*10000+RUBY_API_VERSION_MINOR*100+RUBY_API_VERSION_TEENY)
|
||||
|
||||
#ifdef RUBY_EXTERN
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#if 0
|
||||
} /* satisfy cc-mode */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility push(default)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Interfaces from extension libraries.
|
||||
*
|
||||
* Before using these infos, think thrice whether they are really
|
||||
* necessary or not, and if the answer was yes, think twice a week
|
||||
* later again.
|
||||
*/
|
||||
RUBY_EXTERN const int ruby_api_version[3];
|
||||
RUBY_EXTERN const char ruby_version[];
|
||||
RUBY_EXTERN const char ruby_release_date[];
|
||||
RUBY_EXTERN const char ruby_platform[];
|
||||
RUBY_EXTERN const int ruby_patchlevel;
|
||||
RUBY_EXTERN const char ruby_description[];
|
||||
RUBY_EXTERN const char ruby_copyright[];
|
||||
RUBY_EXTERN const char ruby_engine[];
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility pop
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
#if 0
|
||||
{ /* satisfy cc-mode */
|
||||
#endif
|
||||
} /* extern "C" { */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -1,68 +0,0 @@
|
||||
/**********************************************************************
|
||||
|
||||
ruby/vm.h -
|
||||
|
||||
$Author: shyouhei $
|
||||
created at: Sat May 31 15:17:36 2008
|
||||
|
||||
Copyright (C) 2008 Yukihiro Matsumoto
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef RUBY_VM_H
|
||||
#define RUBY_VM_H 1
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#if 0
|
||||
} /* satisfy cc-mode */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility push(default)
|
||||
#endif
|
||||
|
||||
/* Place holder.
|
||||
*
|
||||
* We will prepare VM creation/control APIs on 1.9.2 or later.
|
||||
* If you have an interest about it, please see mvm branch.
|
||||
* http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/mvm/
|
||||
*/
|
||||
|
||||
/* VM type declaration */
|
||||
typedef struct rb_vm_struct ruby_vm_t;
|
||||
|
||||
/* core API */
|
||||
int ruby_vm_destruct(ruby_vm_t *vm);
|
||||
|
||||
/**
|
||||
* ruby_vm_at_exit registers a function _func_ to be invoked when a VM
|
||||
* passed away. Functions registered this way runs in reverse order
|
||||
* of registration, just like END {} block does. The difference is
|
||||
* its timing to be triggered. ruby_vm_at_exit functions runs when a
|
||||
* VM _passed_ _away_, while END {} blocks runs just _before_ a VM
|
||||
* _is_ _passing_ _away_.
|
||||
*
|
||||
* You cannot register a function to another VM than where you are in.
|
||||
* So where to register is intuitive, omitted. OTOH the argument
|
||||
* _func_ cannot know which VM it is in because at the time of
|
||||
* invocation, the VM has already died and there is no execution
|
||||
* context. The VM itself is passed as the first argument to it.
|
||||
*
|
||||
* @param[in] func the function to register.
|
||||
*/
|
||||
void ruby_vm_at_exit(void(*func)(ruby_vm_t *));
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility pop
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
#if 0
|
||||
{ /* satisfy cc-mode */
|
||||
#endif
|
||||
} /* extern "C" { */
|
||||
#endif
|
||||
|
||||
#endif /* RUBY_VM_H */
|
||||
@@ -1,799 +0,0 @@
|
||||
#ifndef RUBY_WIN32_H
|
||||
#define RUBY_WIN32_H 1
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#if 0
|
||||
} /* satisfy cc-mode */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility push(default)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Copyright (c) 1993, Intergraph Corporation
|
||||
*
|
||||
* You may distribute under the terms of either the GNU General Public
|
||||
* License or the Artistic License, as specified in the perl README file.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Definitions for NT port of Perl
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* Ok now we can include the normal include files.
|
||||
*/
|
||||
|
||||
/* #include <stdarg.h> conflict with varargs.h? */
|
||||
#if !defined(WSAAPI)
|
||||
#if defined(__cplusplus) && defined(_MSC_VER)
|
||||
extern "C++" { /* template without extern "C++" */
|
||||
#endif
|
||||
#if !defined(_WIN64) && !defined(WIN32)
|
||||
#define WIN32
|
||||
#endif
|
||||
#include <winsock2.h>
|
||||
#include <ws2tcpip.h>
|
||||
#if defined(__cplusplus) && defined(_MSC_VER)
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* We're not using Microsoft's "extensions" to C for
|
||||
* Structured Exception Handling (SEH) so we can nuke these
|
||||
*/
|
||||
#undef try
|
||||
#undef except
|
||||
#undef finally
|
||||
#undef leave
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <direct.h>
|
||||
#include <process.h>
|
||||
#include <time.h>
|
||||
#if defined(__cplusplus) && defined(_MSC_VER) && _MSC_VER == 1200
|
||||
extern "C++" { /* template without extern "C++" */
|
||||
#endif
|
||||
#include <math.h>
|
||||
#if defined(__cplusplus) && defined(_MSC_VER) && _MSC_VER == 1200
|
||||
}
|
||||
#endif
|
||||
#include <signal.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
#ifdef HAVE_SYS_UTIME_H
|
||||
# include <sys/utime.h>
|
||||
#else
|
||||
# include <utime.h>
|
||||
#endif
|
||||
#include <io.h>
|
||||
#include <malloc.h>
|
||||
#if defined __MINGW32__ || __BORLANDC__ >= 0x0580
|
||||
# include <stdint.h>
|
||||
#else
|
||||
# if !defined(_INTPTR_T_DEFINED)
|
||||
# ifdef _WIN64
|
||||
typedef __int64 intptr_t;
|
||||
# else
|
||||
typedef int intptr_t;
|
||||
# endif
|
||||
# define _INTPTR_T_DEFINED
|
||||
# endif
|
||||
# if !defined(_UINTPTR_T_DEFINED)
|
||||
# ifdef _WIN64
|
||||
typedef unsigned __int64 uintptr_t;
|
||||
# else
|
||||
typedef unsigned int uintptr_t;
|
||||
# endif
|
||||
# define _UINTPTR_T_DEFINED
|
||||
# endif
|
||||
#endif
|
||||
#ifndef __MINGW32__
|
||||
# define mode_t int
|
||||
#endif
|
||||
#ifdef HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
#define rb_w32_iswinnt() TRUE
|
||||
#define rb_w32_iswin95() FALSE
|
||||
|
||||
#define WNOHANG -1
|
||||
|
||||
#undef getc
|
||||
#undef putc
|
||||
#undef fgetc
|
||||
#undef fputc
|
||||
#undef getchar
|
||||
#undef putchar
|
||||
#undef fgetchar
|
||||
#undef fputchar
|
||||
#undef utime
|
||||
#undef lseek
|
||||
#undef stat
|
||||
#undef fstat
|
||||
#define getc(_stream) rb_w32_getc(_stream)
|
||||
#define getchar() rb_w32_getc(stdin)
|
||||
#define putc(_c, _stream) rb_w32_putc(_c, _stream)
|
||||
#define putchar(_c) rb_w32_putc(_c, stdout)
|
||||
#ifdef RUBY_EXPORT
|
||||
#define fgetc(_stream) getc(_stream)
|
||||
#define fputc(_c, _stream) putc(_c, _stream)
|
||||
#define fgetchar() getchar()
|
||||
#define fputchar(_c) putchar(_c)
|
||||
#define utime(_p, _t) rb_w32_utime(_p, _t)
|
||||
#define lseek(_f, _o, _w) _lseeki64(_f, _o, _w)
|
||||
|
||||
#define pipe(p) rb_w32_pipe(p)
|
||||
#define open rb_w32_open
|
||||
#define close(h) rb_w32_close(h)
|
||||
#define fclose(f) rb_w32_fclose(f)
|
||||
#define read(f, b, s) rb_w32_read(f, b, s)
|
||||
#define write(f, b, s) rb_w32_write(f, b, s)
|
||||
#define getpid() rb_w32_getpid()
|
||||
#define getppid() rb_w32_getppid()
|
||||
#define sleep(x) rb_w32_Sleep((x)*1000)
|
||||
#define Sleep(msec) (void)rb_w32_Sleep(msec)
|
||||
#define fstati64(fd,st) rb_w32_fstati64(fd,st)
|
||||
#ifdef __BORLANDC__
|
||||
#define creat(p, m) _creat(p, m)
|
||||
#define eof() _eof()
|
||||
#define filelength(h) _filelength(h)
|
||||
#define mktemp(t) _mktemp(t)
|
||||
#define tell(h) _tell(h)
|
||||
#define _open _sopen
|
||||
#define sopen _sopen
|
||||
#undef fopen
|
||||
#define fopen(p, m) rb_w32_fopen(p, m)
|
||||
#undef fdopen
|
||||
#define fdopen(h, m) rb_w32_fdopen(h, m)
|
||||
#undef fsopen
|
||||
#define fsopen(p, m, sh) rb_w32_fsopen(p, m, sh)
|
||||
#endif /* __BORLANDC__ */
|
||||
|
||||
#undef execv
|
||||
#define execv(path,argv) rb_w32_aspawn(P_OVERLAY,path,argv)
|
||||
#if !defined(__BORLANDC__)
|
||||
#undef isatty
|
||||
#define isatty(h) rb_w32_isatty(h)
|
||||
#endif /* __BORLANDC__ */
|
||||
|
||||
#undef mkdir
|
||||
#define mkdir(p, m) rb_w32_mkdir(p, m)
|
||||
#undef rmdir
|
||||
#define rmdir(p) rb_w32_rmdir(p)
|
||||
#undef unlink
|
||||
#define unlink(p) rb_w32_unlink(p)
|
||||
#endif /* RUBY_EXPORT */
|
||||
|
||||
#if SIZEOF_OFF_T == 8
|
||||
#define off_t __int64
|
||||
#define stat stati64
|
||||
#define fstat(fd,st) fstati64(fd,st)
|
||||
#if defined(__BORLANDC__)
|
||||
#define stati64(path, st) rb_w32_stati64(path, st)
|
||||
#elif !defined(_MSC_VER) || RT_VER < 80
|
||||
#define stati64 _stati64
|
||||
#ifndef _stati64
|
||||
#define _stati64(path, st) rb_w32_stati64(path, st)
|
||||
#endif
|
||||
#else
|
||||
#define stati64 _stat64
|
||||
#define _stat64(path, st) rb_w32_stati64(path, st)
|
||||
#endif
|
||||
#else
|
||||
#define stat(path,st) rb_w32_stat(path,st)
|
||||
#define fstat(fd,st) rb_w32_fstat(fd,st)
|
||||
extern int rb_w32_stat(const char *, struct stat *);
|
||||
extern int rb_w32_fstat(int, struct stat *);
|
||||
#endif
|
||||
#define access(path,mode) rb_w32_access(path,mode)
|
||||
|
||||
#define strcasecmp _stricmp
|
||||
#define strncasecmp _strnicmp
|
||||
#define fsync _commit
|
||||
|
||||
struct timezone;
|
||||
|
||||
#ifdef __MINGW32__
|
||||
#undef isascii
|
||||
#define isascii __isascii
|
||||
#endif
|
||||
|
||||
struct iovec {
|
||||
void *iov_base;
|
||||
size_t iov_len;
|
||||
};
|
||||
struct msghdr {
|
||||
void *msg_name;
|
||||
int msg_namelen;
|
||||
struct iovec *msg_iov;
|
||||
int msg_iovlen;
|
||||
void *msg_control;
|
||||
int msg_controllen;
|
||||
int msg_flags;
|
||||
};
|
||||
|
||||
extern DWORD rb_w32_osid(void);
|
||||
extern int rb_w32_cmdvector(const char *, char ***);
|
||||
extern rb_pid_t rb_w32_pipe_exec(const char *, const char *, int, int *, int *);
|
||||
extern int flock(int fd, int oper);
|
||||
extern int rb_w32_io_cancelable_p(int);
|
||||
extern int rb_w32_is_socket(int);
|
||||
extern int WSAAPI rb_w32_accept(int, struct sockaddr *, int *);
|
||||
extern int WSAAPI rb_w32_bind(int, const struct sockaddr *, int);
|
||||
extern int WSAAPI rb_w32_connect(int, const struct sockaddr *, int);
|
||||
extern void rb_w32_fdset(int, fd_set*);
|
||||
extern void rb_w32_fdclr(int, fd_set*);
|
||||
extern int rb_w32_fdisset(int, fd_set*);
|
||||
extern int WSAAPI rb_w32_select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
|
||||
extern int WSAAPI rb_w32_getpeername(int, struct sockaddr *, int *);
|
||||
extern int WSAAPI rb_w32_getsockname(int, struct sockaddr *, int *);
|
||||
extern int WSAAPI rb_w32_getsockopt(int, int, int, char *, int *);
|
||||
extern int WSAAPI rb_w32_ioctlsocket(int, long, u_long *);
|
||||
extern int WSAAPI rb_w32_listen(int, int);
|
||||
extern int WSAAPI rb_w32_recv(int, char *, int, int);
|
||||
extern int WSAAPI rb_w32_recvfrom(int, char *, int, int, struct sockaddr *, int *);
|
||||
extern int WSAAPI rb_w32_send(int, const char *, int, int);
|
||||
extern int WSAAPI rb_w32_sendto(int, const char *, int, int, const struct sockaddr *, int);
|
||||
extern int recvmsg(int, struct msghdr *, int);
|
||||
extern int sendmsg(int, const struct msghdr *, int);
|
||||
extern int WSAAPI rb_w32_setsockopt(int, int, int, const char *, int);
|
||||
extern int WSAAPI rb_w32_shutdown(int, int);
|
||||
extern int WSAAPI rb_w32_socket(int, int, int);
|
||||
extern SOCKET rb_w32_get_osfhandle(int);
|
||||
extern struct hostent *WSAAPI rb_w32_gethostbyaddr(const char *, int, int);
|
||||
extern struct hostent *WSAAPI rb_w32_gethostbyname(const char *);
|
||||
extern int WSAAPI rb_w32_gethostname(char *, int);
|
||||
extern struct protoent *WSAAPI rb_w32_getprotobyname(const char *);
|
||||
extern struct protoent *WSAAPI rb_w32_getprotobynumber(int);
|
||||
extern struct servent *WSAAPI rb_w32_getservbyname(const char *, const char *);
|
||||
extern struct servent *WSAAPI rb_w32_getservbyport(int, const char *);
|
||||
extern int rb_w32_socketpair(int, int, int, int *);
|
||||
extern char * rb_w32_getcwd(char *, int);
|
||||
extern char * rb_w32_ugetenv(const char *);
|
||||
extern char * rb_w32_getenv(const char *);
|
||||
extern int rb_w32_rename(const char *, const char *);
|
||||
extern int rb_w32_urename(const char *, const char *);
|
||||
extern char **rb_w32_get_environ(void);
|
||||
extern void rb_w32_free_environ(char **);
|
||||
extern int rb_w32_map_errno(DWORD);
|
||||
extern const char *WSAAPI rb_w32_inet_ntop(int,const void *,char *,size_t);
|
||||
extern DWORD rb_w32_osver(void);
|
||||
|
||||
extern int chown(const char *, int, int);
|
||||
extern int rb_w32_uchown(const char *, int, int);
|
||||
extern int link(const char *, const char *);
|
||||
extern int rb_w32_ulink(const char *, const char *);
|
||||
extern int gettimeofday(struct timeval *, struct timezone *);
|
||||
extern rb_pid_t waitpid (rb_pid_t, int *, int);
|
||||
extern rb_pid_t rb_w32_spawn(int, const char *, const char*);
|
||||
extern rb_pid_t rb_w32_aspawn(int, const char *, char *const *);
|
||||
extern rb_pid_t rb_w32_aspawn_flags(int, const char *, char *const *, DWORD);
|
||||
extern int kill(int, int);
|
||||
extern int fcntl(int, int, ...);
|
||||
extern rb_pid_t rb_w32_getpid(void);
|
||||
extern rb_pid_t rb_w32_getppid(void);
|
||||
#if !defined(__BORLANDC__)
|
||||
extern int rb_w32_isatty(int);
|
||||
#endif
|
||||
extern int rb_w32_uchdir(const char *);
|
||||
extern int rb_w32_mkdir(const char *, int);
|
||||
extern int rb_w32_umkdir(const char *, int);
|
||||
extern int rb_w32_rmdir(const char *);
|
||||
extern int rb_w32_urmdir(const char *);
|
||||
extern int rb_w32_unlink(const char *);
|
||||
extern int rb_w32_uunlink(const char *);
|
||||
extern int rb_w32_uchmod(const char *, int);
|
||||
extern int rb_w32_stati64(const char *, struct stati64 *);
|
||||
extern int rb_w32_ustati64(const char *, struct stati64 *);
|
||||
extern int rb_w32_access(const char *, int);
|
||||
extern int rb_w32_uaccess(const char *, int);
|
||||
extern char rb_w32_fd_is_text(int);
|
||||
extern int rb_w32_fstati64(int, struct stati64 *);
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
extern off_t _lseeki64(int, off_t, int);
|
||||
extern FILE *rb_w32_fopen(const char *, const char *);
|
||||
extern FILE *rb_w32_fdopen(int, const char *);
|
||||
extern FILE *rb_w32_fsopen(const char *, const char *, int);
|
||||
#endif
|
||||
|
||||
#include <float.h>
|
||||
#if !defined __MINGW32__ || defined __NO_ISOCEXT
|
||||
#ifndef isnan
|
||||
#define isnan(x) _isnan(x)
|
||||
#endif
|
||||
static inline int
|
||||
finite(double x)
|
||||
{
|
||||
return _finite(x);
|
||||
}
|
||||
#ifndef copysign
|
||||
#define copysign(a, b) _copysign(a, b)
|
||||
#endif
|
||||
static inline double
|
||||
scalb(double a, long b)
|
||||
{
|
||||
return _scalb(a, b);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !defined S_IFIFO && defined _S_IFIFO
|
||||
#define S_IFIFO _S_IFIFO
|
||||
#endif
|
||||
|
||||
#if 0 && defined __BORLANDC__
|
||||
#undef S_ISDIR
|
||||
#undef S_ISFIFO
|
||||
#undef S_ISBLK
|
||||
#undef S_ISCHR
|
||||
#undef S_ISREG
|
||||
#define S_ISDIR(m) (((unsigned short)(m) & S_IFMT) == S_IFDIR)
|
||||
#define S_ISFIFO(m) (((unsigned short)(m) & S_IFMT) == S_IFIFO)
|
||||
#define S_ISBLK(m) (((unsigned short)(m) & S_IFMT) == S_IFBLK)
|
||||
#define S_ISCHR(m) (((unsigned short)(m) & S_IFMT) == S_IFCHR)
|
||||
#define S_ISREG(m) (((unsigned short)(m) & S_IFMT) == S_IFREG)
|
||||
#endif
|
||||
|
||||
#if !defined S_IRUSR && !defined __MINGW32__
|
||||
#define S_IRUSR 0400
|
||||
#endif
|
||||
#ifndef S_IRGRP
|
||||
#define S_IRGRP 0040
|
||||
#endif
|
||||
#ifndef S_IROTH
|
||||
#define S_IROTH 0004
|
||||
#endif
|
||||
|
||||
#if !defined S_IWUSR && !defined __MINGW32__
|
||||
#define S_IWUSR 0200
|
||||
#endif
|
||||
#ifndef S_IWGRP
|
||||
#define S_IWGRP 0020
|
||||
#endif
|
||||
#ifndef S_IWOTH
|
||||
#define S_IWOTH 0002
|
||||
#endif
|
||||
|
||||
#if !defined S_IXUSR && !defined __MINGW32__
|
||||
#define S_IXUSR 0100
|
||||
#endif
|
||||
#ifndef S_IXGRP
|
||||
#define S_IXGRP 0010
|
||||
#endif
|
||||
#ifndef S_IXOTH
|
||||
#define S_IXOTH 0001
|
||||
#endif
|
||||
|
||||
/*
|
||||
* define this so we can do inplace editing
|
||||
*/
|
||||
|
||||
#define SUFFIX
|
||||
|
||||
extern int rb_w32_ftruncate(int fd, off_t length);
|
||||
extern int rb_w32_truncate(const char *path, off_t length);
|
||||
extern off_t rb_w32_ftello(FILE *stream);
|
||||
extern int rb_w32_fseeko(FILE *stream, off_t offset, int whence);
|
||||
|
||||
#undef HAVE_FTRUNCATE
|
||||
#define HAVE_FTRUNCATE 1
|
||||
#if defined HAVE_FTRUNCATE64
|
||||
#define ftruncate ftruncate64
|
||||
#else
|
||||
#define ftruncate rb_w32_ftruncate
|
||||
#endif
|
||||
|
||||
#undef HAVE_TRUNCATE
|
||||
#define HAVE_TRUNCATE 1
|
||||
#if defined HAVE_TRUNCATE64
|
||||
#define truncate truncate64
|
||||
#else
|
||||
#define truncate rb_w32_truncate
|
||||
#endif
|
||||
|
||||
#undef HAVE_FSEEKO
|
||||
#define HAVE_FSEEKO 1
|
||||
#if defined HAVE_FSEEKO64
|
||||
#define fseeko fseeko64
|
||||
#else
|
||||
#define fseeko rb_w32_fseeko
|
||||
#endif
|
||||
|
||||
#undef HAVE_FTELLO
|
||||
#define HAVE_FTELLO 1
|
||||
#if defined HAVE_FTELLO64
|
||||
#define ftello ftello64
|
||||
#else
|
||||
#define ftello rb_w32_ftello
|
||||
#endif
|
||||
|
||||
/*
|
||||
* stubs
|
||||
*/
|
||||
extern int ioctl (int, int, ...);
|
||||
extern rb_uid_t getuid (void);
|
||||
extern rb_uid_t geteuid (void);
|
||||
extern rb_gid_t getgid (void);
|
||||
extern rb_gid_t getegid (void);
|
||||
extern int setuid (rb_uid_t);
|
||||
extern int setgid (rb_gid_t);
|
||||
|
||||
extern char *rb_w32_strerror(int);
|
||||
|
||||
#ifdef RUBY_EXPORT
|
||||
#define strerror(e) rb_w32_strerror(e)
|
||||
#endif
|
||||
|
||||
#define PIPE_BUF 1024
|
||||
|
||||
#define LOCK_SH 1
|
||||
#define LOCK_EX 2
|
||||
#define LOCK_NB 4
|
||||
#define LOCK_UN 8
|
||||
|
||||
|
||||
#ifndef SIGINT
|
||||
#define SIGINT 2
|
||||
#endif
|
||||
#ifndef SIGKILL
|
||||
#define SIGKILL 9
|
||||
#endif
|
||||
|
||||
|
||||
/* #undef va_start */
|
||||
/* #undef va_end */
|
||||
|
||||
/* winsock error map */
|
||||
#include <errno.h>
|
||||
|
||||
#ifndef EWOULDBLOCK
|
||||
# define EWOULDBLOCK WSAEWOULDBLOCK
|
||||
#endif
|
||||
#ifndef EINPROGRESS
|
||||
# define EINPROGRESS WSAEINPROGRESS
|
||||
#endif
|
||||
#ifndef EALREADY
|
||||
# define EALREADY WSAEALREADY
|
||||
#endif
|
||||
#ifndef ENOTSOCK
|
||||
# define ENOTSOCK WSAENOTSOCK
|
||||
#endif
|
||||
#ifndef EDESTADDRREQ
|
||||
# define EDESTADDRREQ WSAEDESTADDRREQ
|
||||
#endif
|
||||
#ifndef EMSGSIZE
|
||||
# define EMSGSIZE WSAEMSGSIZE
|
||||
#endif
|
||||
#ifndef EPROTOTYPE
|
||||
# define EPROTOTYPE WSAEPROTOTYPE
|
||||
#endif
|
||||
#ifndef ENOPROTOOPT
|
||||
# define ENOPROTOOPT WSAENOPROTOOPT
|
||||
#endif
|
||||
#ifndef EPROTONOSUPPORT
|
||||
# define EPROTONOSUPPORT WSAEPROTONOSUPPORT
|
||||
#endif
|
||||
#ifndef ESOCKTNOSUPPORT
|
||||
# define ESOCKTNOSUPPORT WSAESOCKTNOSUPPORT
|
||||
#endif
|
||||
#ifndef EOPNOTSUPP
|
||||
# define EOPNOTSUPP WSAEOPNOTSUPP
|
||||
#endif
|
||||
#ifndef EPFNOSUPPORT
|
||||
# define EPFNOSUPPORT WSAEPFNOSUPPORT
|
||||
#endif
|
||||
#ifndef EAFNOSUPPORT
|
||||
# define EAFNOSUPPORT WSAEAFNOSUPPORT
|
||||
#endif
|
||||
#ifndef EADDRINUSE
|
||||
# define EADDRINUSE WSAEADDRINUSE
|
||||
#endif
|
||||
#ifndef EADDRNOTAVAIL
|
||||
# define EADDRNOTAVAIL WSAEADDRNOTAVAIL
|
||||
#endif
|
||||
#ifndef ENETDOWN
|
||||
# define ENETDOWN WSAENETDOWN
|
||||
#endif
|
||||
#ifndef ENETUNREACH
|
||||
# define ENETUNREACH WSAENETUNREACH
|
||||
#endif
|
||||
#ifndef ENETRESET
|
||||
# define ENETRESET WSAENETRESET
|
||||
#endif
|
||||
#ifndef ECONNABORTED
|
||||
# define ECONNABORTED WSAECONNABORTED
|
||||
#endif
|
||||
#ifndef ECONNRESET
|
||||
# define ECONNRESET WSAECONNRESET
|
||||
#endif
|
||||
#ifndef ENOBUFS
|
||||
# define ENOBUFS WSAENOBUFS
|
||||
#endif
|
||||
#ifndef EISCONN
|
||||
# define EISCONN WSAEISCONN
|
||||
#endif
|
||||
#ifndef ENOTCONN
|
||||
# define ENOTCONN WSAENOTCONN
|
||||
#endif
|
||||
#ifndef ESHUTDOWN
|
||||
# define ESHUTDOWN WSAESHUTDOWN
|
||||
#endif
|
||||
#ifndef ETOOMANYREFS
|
||||
# define ETOOMANYREFS WSAETOOMANYREFS
|
||||
#endif
|
||||
#ifndef ETIMEDOUT
|
||||
# define ETIMEDOUT WSAETIMEDOUT
|
||||
#endif
|
||||
#ifndef ECONNREFUSED
|
||||
# define ECONNREFUSED WSAECONNREFUSED
|
||||
#endif
|
||||
#ifndef ELOOP
|
||||
# define ELOOP WSAELOOP
|
||||
#endif
|
||||
/*#define ENAMETOOLONG WSAENAMETOOLONG*/
|
||||
#ifndef EHOSTDOWN
|
||||
# define EHOSTDOWN WSAEHOSTDOWN
|
||||
#endif
|
||||
#ifndef EHOSTUNREACH
|
||||
# define EHOSTUNREACH WSAEHOSTUNREACH
|
||||
#endif
|
||||
/*#define ENOTEMPTY WSAENOTEMPTY*/
|
||||
#ifndef EPROCLIM
|
||||
# define EPROCLIM WSAEPROCLIM
|
||||
#endif
|
||||
#ifndef EUSERS
|
||||
# define EUSERS WSAEUSERS
|
||||
#endif
|
||||
#ifndef EDQUOT
|
||||
# define EDQUOT WSAEDQUOT
|
||||
#endif
|
||||
#ifndef ESTALE
|
||||
# define ESTALE WSAESTALE
|
||||
#endif
|
||||
#ifndef EREMOTE
|
||||
# define EREMOTE WSAEREMOTE
|
||||
#endif
|
||||
|
||||
#define F_DUPFD 0
|
||||
#if 0
|
||||
#define F_GETFD 1
|
||||
#define F_SETFD 2
|
||||
#define F_GETFL 3
|
||||
#endif
|
||||
#define F_SETFL 4
|
||||
#if 0
|
||||
#define FD_CLOEXEC 1 /* F_GETFD, F_SETFD */
|
||||
#endif
|
||||
#define O_NONBLOCK 1
|
||||
|
||||
#undef FD_SET
|
||||
#define FD_SET(fd, set) do {\
|
||||
unsigned int i;\
|
||||
SOCKET s = _get_osfhandle(fd);\
|
||||
\
|
||||
for (i = 0; i < (set)->fd_count; i++) {\
|
||||
if ((set)->fd_array[i] == s) {\
|
||||
break;\
|
||||
}\
|
||||
}\
|
||||
if (i == (set)->fd_count) {\
|
||||
if ((set)->fd_count < FD_SETSIZE) {\
|
||||
(set)->fd_array[i] = s;\
|
||||
(set)->fd_count++;\
|
||||
}\
|
||||
}\
|
||||
} while(0)
|
||||
|
||||
#undef FD_CLR
|
||||
#define FD_CLR(f, s) rb_w32_fdclr(f, s)
|
||||
|
||||
#undef FD_ISSET
|
||||
#define FD_ISSET(f, s) rb_w32_fdisset(f, s)
|
||||
|
||||
#ifdef RUBY_EXPORT
|
||||
#undef inet_ntop
|
||||
#define inet_ntop(f,a,n,l) rb_w32_inet_ntop(f,a,n,l)
|
||||
|
||||
#undef accept
|
||||
#define accept(s, a, l) rb_w32_accept(s, a, l)
|
||||
|
||||
#undef bind
|
||||
#define bind(s, a, l) rb_w32_bind(s, a, l)
|
||||
|
||||
#undef connect
|
||||
#define connect(s, a, l) rb_w32_connect(s, a, l)
|
||||
|
||||
#undef select
|
||||
#define select(n, r, w, e, t) rb_w32_select(n, r, w, e, t)
|
||||
|
||||
#undef getpeername
|
||||
#define getpeername(s, a, l) rb_w32_getpeername(s, a, l)
|
||||
|
||||
#undef getsockname
|
||||
#define getsockname(s, a, l) rb_w32_getsockname(s, a, l)
|
||||
|
||||
#undef getsockopt
|
||||
#define getsockopt(s, v, n, o, l) rb_w32_getsockopt(s, v, n, o, l)
|
||||
|
||||
#undef ioctlsocket
|
||||
#define ioctlsocket(s, c, a) rb_w32_ioctlsocket(s, c, a)
|
||||
|
||||
#undef listen
|
||||
#define listen(s, b) rb_w32_listen(s, b)
|
||||
|
||||
#undef recv
|
||||
#define recv(s, b, l, f) rb_w32_recv(s, b, l, f)
|
||||
|
||||
#undef recvfrom
|
||||
#define recvfrom(s, b, l, f, fr, frl) rb_w32_recvfrom(s, b, l, f, fr, frl)
|
||||
|
||||
#undef send
|
||||
#define send(s, b, l, f) rb_w32_send(s, b, l, f)
|
||||
|
||||
#undef sendto
|
||||
#define sendto(s, b, l, f, t, tl) rb_w32_sendto(s, b, l, f, t, tl)
|
||||
|
||||
#undef setsockopt
|
||||
#define setsockopt(s, v, n, o, l) rb_w32_setsockopt(s, v, n, o, l)
|
||||
|
||||
#undef shutdown
|
||||
#define shutdown(s, h) rb_w32_shutdown(s, h)
|
||||
|
||||
#undef socket
|
||||
#define socket(s, t, p) rb_w32_socket(s, t, p)
|
||||
|
||||
#undef gethostbyaddr
|
||||
#define gethostbyaddr(a, l, t) rb_w32_gethostbyaddr(a, l, t)
|
||||
|
||||
#undef gethostbyname
|
||||
#define gethostbyname(n) rb_w32_gethostbyname(n)
|
||||
|
||||
#undef gethostname
|
||||
#define gethostname(n, l) rb_w32_gethostname(n, l)
|
||||
|
||||
#undef getprotobyname
|
||||
#define getprotobyname(n) rb_w32_getprotobyname(n)
|
||||
|
||||
#undef getprotobynumber
|
||||
#define getprotobynumber(n) rb_w32_getprotobynumber(n)
|
||||
|
||||
#undef getservbyname
|
||||
#define getservbyname(n, p) rb_w32_getservbyname(n, p)
|
||||
|
||||
#undef getservbyport
|
||||
#define getservbyport(p, pr) rb_w32_getservbyport(p, pr)
|
||||
|
||||
#undef socketpair
|
||||
#define socketpair(a, t, p, s) rb_w32_socketpair(a, t, p, s)
|
||||
|
||||
#undef get_osfhandle
|
||||
#define get_osfhandle(h) rb_w32_get_osfhandle(h)
|
||||
|
||||
#undef getcwd
|
||||
#define getcwd(b, s) rb_w32_getcwd(b, s)
|
||||
|
||||
#undef getenv
|
||||
#define getenv(n) rb_w32_getenv(n)
|
||||
|
||||
#undef rename
|
||||
#define rename(o, n) rb_w32_rename(o, n)
|
||||
|
||||
#undef times
|
||||
#define times(t) rb_w32_times(t)
|
||||
#endif
|
||||
|
||||
struct tms {
|
||||
long tms_utime;
|
||||
long tms_stime;
|
||||
long tms_cutime;
|
||||
long tms_cstime;
|
||||
};
|
||||
|
||||
int rb_w32_times(struct tms *);
|
||||
|
||||
struct tm *gmtime_r(const time_t *, struct tm *);
|
||||
struct tm *localtime_r(const time_t *, struct tm *);
|
||||
|
||||
/* thread stuff */
|
||||
int rb_w32_sleep(unsigned long msec);
|
||||
int rb_w32_putc(int, FILE*);
|
||||
int rb_w32_getc(FILE*);
|
||||
int rb_w32_open(const char *, int, ...);
|
||||
int rb_w32_uopen(const char *, int, ...);
|
||||
int rb_w32_wopen(const WCHAR *, int, ...);
|
||||
int rb_w32_close(int);
|
||||
int rb_w32_fclose(FILE*);
|
||||
int rb_w32_pipe(int[2]);
|
||||
ssize_t rb_w32_read(int, void *, size_t);
|
||||
ssize_t rb_w32_write(int, const void *, size_t);
|
||||
int rb_w32_utime(const char *, const struct utimbuf *);
|
||||
int rb_w32_uutime(const char *, const struct utimbuf *);
|
||||
long rb_w32_write_console(uintptr_t, int); /* use uintptr_t instead of VALUE because it's not defined yet here */
|
||||
int WINAPI rb_w32_Sleep(unsigned long msec);
|
||||
int rb_w32_wait_events_blocking(HANDLE *events, int num, DWORD timeout);
|
||||
int rb_w32_time_subtract(struct timeval *rest, const struct timeval *wait);
|
||||
int rb_w32_wrap_io_handle(HANDLE, int);
|
||||
int rb_w32_unwrap_io_handle(int);
|
||||
|
||||
/*
|
||||
== ***CAUTION***
|
||||
Since this function is very dangerous, ((*NEVER*))
|
||||
* lock any HANDLEs(i.e. Mutex, Semaphore, CriticalSection and so on) or,
|
||||
* use anything like TRAP_BEG...TRAP_END block structure,
|
||||
in asynchronous_func_t.
|
||||
*/
|
||||
typedef uintptr_t (*asynchronous_func_t)(uintptr_t self, int argc, uintptr_t* argv);
|
||||
uintptr_t rb_w32_asynchronize(asynchronous_func_t func, uintptr_t self, int argc, uintptr_t* argv, uintptr_t intrval);
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility pop
|
||||
#endif
|
||||
|
||||
#ifdef __MINGW_ATTRIB_PURE
|
||||
/* License: Ruby's */
|
||||
/* get rid of bugs in math.h of mingw */
|
||||
#define frexp(_X, _Y) __extension__ ({\
|
||||
int intpart_frexp_bug = intpart_frexp_bug;\
|
||||
double result_frexp_bug = frexp((_X), &intpart_frexp_bug);\
|
||||
*(_Y) = intpart_frexp_bug;\
|
||||
result_frexp_bug;\
|
||||
})
|
||||
/* License: Ruby's */
|
||||
#define modf(_X, _Y) __extension__ ({\
|
||||
double intpart_modf_bug = intpart_modf_bug;\
|
||||
double result_modf_bug = modf((_X), &intpart_modf_bug);\
|
||||
*(_Y) = intpart_modf_bug;\
|
||||
result_modf_bug;\
|
||||
})
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
#if 0
|
||||
{ /* satisfy cc-mode */
|
||||
#endif
|
||||
} /* extern "C" { */
|
||||
#endif
|
||||
|
||||
#if defined(__MINGW64__)
|
||||
/*
|
||||
* Use powl() instead of broken pow() of x86_64-w64-mingw32.
|
||||
* This workaround will fix test failures in test_bignum.rb,
|
||||
* test_fixnum.rb and test_float.rb etc.
|
||||
*/
|
||||
static inline double
|
||||
rb_w32_pow(double x, double y)
|
||||
{
|
||||
return powl(x, y);
|
||||
}
|
||||
#elif defined(__MINGW64_VERSION_MAJOR)
|
||||
/*
|
||||
* Set floating point precision for pow() of mingw-w64 x86.
|
||||
* With default precision the result is not proper on WinXP.
|
||||
*/
|
||||
static inline double
|
||||
rb_w32_pow(double x, double y)
|
||||
{
|
||||
double r;
|
||||
unsigned int default_control = _controlfp(0, 0);
|
||||
_controlfp(_PC_64, _MCW_PC);
|
||||
r = pow(x, y);
|
||||
/* Restore setting */
|
||||
_controlfp(default_control, _MCW_PC);
|
||||
return r;
|
||||
}
|
||||
#endif
|
||||
#if defined(__MINGW64_VERSION_MAJOR) || defined(__MINGW64__)
|
||||
#define pow rb_w32_pow
|
||||
#endif
|
||||
|
||||
#endif /* RUBY_WIN32_H */
|
||||
-145
@@ -1,145 +0,0 @@
|
||||
#ifndef INCLUDE_RUBY_CONFIG_H
|
||||
#define INCLUDE_RUBY_CONFIG_H 1
|
||||
//#if _MSC_VER != 1600
|
||||
//#error MSC version unmatch: _MSC_VER: 1600 is expected.
|
||||
//#endif
|
||||
#define RUBY_MSVCRT_VERSION 100
|
||||
#define STDC_HEADERS 1
|
||||
#define HAVE_SYS_TYPES_H 1
|
||||
#define HAVE_SYS_STAT_H 1
|
||||
#define HAVE_STDLIB_H 1
|
||||
#define HAVE_STDDEF_H 1
|
||||
#define HAVE_STRING_H 1
|
||||
#define HAVE_MEMORY_H 1
|
||||
#define HAVE_LONG_LONG 1
|
||||
#define HAVE_OFF_T 1
|
||||
#define SIZEOF_INT 4
|
||||
#define SIZEOF_SHORT 2
|
||||
#define SIZEOF_LONG 4
|
||||
#define SIZEOF_LONG_LONG 8
|
||||
#define SIZEOF___INT64 8
|
||||
#define _INTEGRAL_MAX_BITS 64
|
||||
#define SIZEOF_OFF_T 8
|
||||
#define SIZEOF_VOIDP 8
|
||||
#define SIZEOF_FLOAT 4
|
||||
#define SIZEOF_DOUBLE 8
|
||||
#define SIZEOF_TIME_T 8
|
||||
#define TIMET2NUM(v) LL2NUM(v)
|
||||
#define NUM2TIMET(v) NUM2LL(v)
|
||||
#define SIZEOF_RLIM_T 0
|
||||
#define SIZEOF_SIZE_T 8
|
||||
#define SIZEOF_PTRDIFF_T 8
|
||||
#define SIZEOF_INTPTR_T 8
|
||||
#define SIZEOF_UINTPTR_T 8
|
||||
#define HAVE_PROTOTYPES 1
|
||||
#define TOKEN_PASTE(x,y) x##y
|
||||
#define HAVE_STDARG_PROTOTYPES 1
|
||||
#define NORETURN(x) __declspec(noreturn) x
|
||||
#define DEPRECATED(x) __declspec(deprecated) x
|
||||
#define NOINLINE(x) __declspec(noinline) x
|
||||
#define FUNC_STDCALL(x) __stdcall x
|
||||
#define FUNC_CDECL(x) __cdecl x
|
||||
#define FUNC_FASTCALL(x) __fastcall x
|
||||
#define RUBY_EXTERN extern __declspec(dllimport)
|
||||
#define HAVE_DECL_SYS_NERR 1
|
||||
#define HAVE_LIMITS_H 1
|
||||
#define HAVE_FCNTL_H 1
|
||||
#define HAVE_SYS_UTIME_H 1
|
||||
#define HAVE_FLOAT_H 1
|
||||
#define HAVE_TIME_H 1
|
||||
#define rb_pid_t int
|
||||
#define rb_gid_t int
|
||||
#define rb_uid_t int
|
||||
#define HAVE_STRUCT_STAT_ST_RDEV 1
|
||||
#define HAVE_ST_RDEV 1
|
||||
#define HAVE_STRUCT_TIMEVAL 1
|
||||
#define HAVE_STDINT_H 1
|
||||
#define HAVE_INT8_T 1
|
||||
#define HAVE_UINT8_T 1
|
||||
#define SIZEOF_INT8_T 1
|
||||
#define SIZEOF_UINT8_T 1
|
||||
#define HAVE_INT16_T 1
|
||||
#define HAVE_UINT16_T 1
|
||||
#define SIZEOF_INT16_T 2
|
||||
#define SIZEOF_UINT16_T 2
|
||||
#define HAVE_INT32_T 1
|
||||
#define HAVE_UINT32_T 1
|
||||
#define SIZEOF_INT32_T 4
|
||||
#define SIZEOF_UINT32_T 4
|
||||
#define HAVE_INT64_T 1
|
||||
#define HAVE_UINT64_T 1
|
||||
#define SIZEOF_INT64_T 8
|
||||
#define SIZEOF_UINT64_T 8
|
||||
#define HAVE_INTPTR_T 1
|
||||
#define HAVE_UINTPTR_T 1
|
||||
#define HAVE_SSIZE_T 1
|
||||
#define ssize_t __int64
|
||||
#define PRI_LL_PREFIX "I64"
|
||||
#define PRI_PIDT_PREFIX PRI_INT_PREFIX
|
||||
#define GETGROUPS_T int
|
||||
#define RETSIGTYPE void
|
||||
#define TYPEOF_TIMEVAL_TV_SEC long
|
||||
#define HAVE_ALLOCA 1
|
||||
#define HAVE_DUP2 1
|
||||
#define HAVE_MEMCMP 1
|
||||
#define HAVE_MEMMOVE 1
|
||||
#define HAVE_MKDIR 1
|
||||
#define HAVE_STRCASECMP 1
|
||||
#define HAVE_STRNCASECMP 1
|
||||
#define HAVE_STRERROR 1
|
||||
#define HAVE_STRFTIME 1
|
||||
#define HAVE_STRCHR 1
|
||||
#define HAVE_STRSTR 1
|
||||
#define HAVE_STRTOD 1
|
||||
#define HAVE_STRTOL 1
|
||||
#define HAVE_STRTOUL 1
|
||||
#define HAVE_FLOCK 1
|
||||
#define HAVE_ISNAN 1
|
||||
#define HAVE_FINITE 1
|
||||
#define HAVE_HYPOT 1
|
||||
#define HAVE_FMOD 1
|
||||
#define HAVE_FREXP 1
|
||||
#define HAVE_MODF 1
|
||||
#define HAVE_WAITPID 1
|
||||
#define HAVE_FSYNC 1
|
||||
#define HAVE_GETCWD 1
|
||||
#define HAVE_TRUNCATE 1
|
||||
#define HAVE_FTRUNCATE 1
|
||||
#define HAVE_FSEEKO 1
|
||||
#define HAVE_FTELLO 1
|
||||
#define HAVE_TIMES 1
|
||||
#define HAVE_FCNTL 1
|
||||
#define HAVE_LINK 1
|
||||
#define HAVE__SETJMP 1
|
||||
#define HAVE_TELLDIR 1
|
||||
#define HAVE_SEEKDIR 1
|
||||
#define HAVE_MKTIME 1
|
||||
#define HAVE_COSH 1
|
||||
#define HAVE_SINH 1
|
||||
#define HAVE_TANH 1
|
||||
#define HAVE_SIGNBIT 1
|
||||
#define HAVE_TZNAME 1
|
||||
#define HAVE_DAYLIGHT 1
|
||||
#define HAVE_GMTIME_R 1
|
||||
#define SETPGRP_VOID 1
|
||||
#define RSHIFT(x,y) ((x)>>(int)y)
|
||||
#define HAVE_RB_FD_INIT 1
|
||||
#define RUBY_SETJMP(env) _setjmp(env)
|
||||
#define RUBY_LONGJMP(env,val) longjmp(env,val)
|
||||
#define RUBY_JMP_BUF jmp_buf
|
||||
//#define inline __inline
|
||||
#define NEED_IO_SEEK_BETWEEN_RW 1
|
||||
#define STACK_GROW_DIRECTION -1
|
||||
#define CANONICALIZATION_FOR_MATHN 1
|
||||
#define DEFAULT_KCODE KCODE_NONE
|
||||
#define LOAD_RELATIVE 1
|
||||
#define DLEXT ".so"
|
||||
#define EXECUTABLE_EXTS ".exe",".com",".cmd",".bat"
|
||||
#define RUBY_COREDLL "msvcr100"
|
||||
#define LIBRUBY_SO "msvcrt-ruby200.dll"
|
||||
#if 0
|
||||
!if "msvcrt-ruby200"!="$(RUBY_SO_NAME)" || "x64-mswin64_100"!="$(ARCH)-$(PLATFORM)"
|
||||
config.h: nul
|
||||
!endif
|
||||
#endif
|
||||
#endif /* INCLUDE_RUBY_CONFIG_H */
|
||||
-35
@@ -1,35 +0,0 @@
|
||||
/**********************************************************************
|
||||
|
||||
ruby.h -
|
||||
|
||||
$Author$
|
||||
created at: Sun 10 12:06:15 Jun JST 2007
|
||||
|
||||
Copyright (C) 2007-2008 Yukihiro Matsumoto
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef RUBY_H
|
||||
#define RUBY_H 1
|
||||
|
||||
#define HAVE_RUBY_DEFINES_H 1
|
||||
#define HAVE_RUBY_ENCODING_H 1
|
||||
#define HAVE_RUBY_INTERN_H 1
|
||||
#define HAVE_RUBY_IO_H 1
|
||||
#define HAVE_RUBY_MISSING_H 1
|
||||
#define HAVE_RUBY_ONIGURUMA_H 1
|
||||
#define HAVE_RUBY_RE_H 1
|
||||
#define HAVE_RUBY_REGEX_H 1
|
||||
#define HAVE_RUBY_RUBY_H 1
|
||||
#define HAVE_RUBY_ST_H 1
|
||||
#define HAVE_RUBY_THREAD_H 1
|
||||
#define HAVE_RUBY_UTIL_H 1
|
||||
#define HAVE_RUBY_VERSION_H 1
|
||||
#define HAVE_RUBY_VM_H 1
|
||||
#ifdef _WIN32
|
||||
#define HAVE_RUBY_WIN32_H 1
|
||||
#endif
|
||||
|
||||
#include "ruby/ruby.h"
|
||||
|
||||
#endif /* RUBY_H */
|
||||
@@ -1,18 +0,0 @@
|
||||
#if defined __GNUC__
|
||||
#warning use of RClass internals is deprecated
|
||||
#elif defined _MSC_VER || defined __BORLANDC__
|
||||
#pragma message("warning: use of RClass internals is deprecated")
|
||||
#endif
|
||||
|
||||
#ifndef RUBY_BACKWARD_CLASSEXT_H
|
||||
#define RUBY_BACKWARD_CLASSEXT_H 1
|
||||
|
||||
typedef struct rb_deprecated_classext_struct {
|
||||
VALUE super;
|
||||
} rb_deprecated_classext_t;
|
||||
|
||||
#undef RCLASS_SUPER(c)
|
||||
#define RCLASS_EXT(c) ((rb_deprecated_classext_t *)RCLASS(c)->ptr)
|
||||
#define RCLASS_SUPER(c) (RCLASS(c)->super)
|
||||
|
||||
#endif /* RUBY_BACKWARD_CLASSEXT_H */
|
||||
@@ -1,6 +0,0 @@
|
||||
#if defined __GNUC__
|
||||
#warning use "ruby/io.h" instead of "rubyio.h"
|
||||
#elif defined _MSC_VER || defined __BORLANDC__
|
||||
#pragma message("warning: use \"ruby/io.h\" instead of \"rubyio.h\"")
|
||||
#endif
|
||||
#include "ruby/io.h"
|
||||
@@ -1,47 +0,0 @@
|
||||
/**********************************************************************
|
||||
|
||||
rubysig.h -
|
||||
|
||||
$Author: akr $
|
||||
$Date: 2014-02-15 00:16:31 +0900 (Sat, 15 Feb 2014) $
|
||||
created at: Wed Aug 16 01:15:38 JST 1995
|
||||
|
||||
Copyright (C) 1993-2008 Yukihiro Matsumoto
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#if defined __GNUC__
|
||||
#warning rubysig.h is obsolete
|
||||
#elif defined _MSC_VER || defined __BORLANDC__
|
||||
#pragma message("warning: rubysig.h is obsolete")
|
||||
#endif
|
||||
|
||||
#ifndef RUBYSIG_H
|
||||
#define RUBYSIG_H
|
||||
#include "ruby/ruby.h"
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#if 0
|
||||
} /* satisfy cc-mode */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
RUBY_SYMBOL_EXPORT_BEGIN
|
||||
|
||||
#define RUBY_CRITICAL(statements) do {statements;} while (0)
|
||||
#define DEFER_INTS (0)
|
||||
#define ENABLE_INTS (1)
|
||||
#define ALLOW_INTS do {CHECK_INTS;} while (0)
|
||||
#define CHECK_INTS rb_thread_check_ints()
|
||||
|
||||
RUBY_SYMBOL_EXPORT_END
|
||||
|
||||
#if defined(__cplusplus)
|
||||
#if 0
|
||||
{ /* satisfy cc-mode */
|
||||
#endif
|
||||
} /* extern "C" { */
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -1,6 +0,0 @@
|
||||
#if defined __GNUC__
|
||||
#warning use "ruby/st.h" instead of bare "st.h"
|
||||
#elif defined _MSC_VER || defined __BORLANDC__
|
||||
#pragma message("warning: use \"ruby/st.h\" instead of bare \"st.h\"")
|
||||
#endif
|
||||
#include "ruby/st.h"
|
||||
@@ -1,6 +0,0 @@
|
||||
#if defined __GNUC__
|
||||
#warning use "ruby/util.h" instead of bare "util.h"
|
||||
#elif defined _MSC_VER || defined __BORLANDC__
|
||||
#pragma message("warning: use \"ruby/util.h\" instead of bare \"util.h\"")
|
||||
#endif
|
||||
#include "ruby/util.h"
|
||||
@@ -1,14 +0,0 @@
|
||||
// Copyright 2013 Trimble Navigation Ltd. All Rights Reserved
|
||||
// Author: bugra@sketchup.com (Bugra Barin)
|
||||
#ifndef INCLUDE_RUBY_CONFIG_WRAPPER_H
|
||||
#define INCLUDE_RUBY_CONFIG_WRAPPER_H
|
||||
|
||||
// Ruby build places the actual config.h into a platform-specific directory but
|
||||
// expects to find it under ruby. Apparently the assumption is that the
|
||||
// platform-specific directory will be added to C++ include paths of every
|
||||
// project that uses Ruby. This is inconvenient and I chose to create this
|
||||
// wrapper that simply includes the platform-specific config header.
|
||||
|
||||
#include "x86_64-darwin14/ruby/config.h"
|
||||
|
||||
#endif /* INCLUDE_RUBY_CONFIG_WRAPPER_H */
|
||||
@@ -1,110 +0,0 @@
|
||||
/**********************************************************************
|
||||
|
||||
ruby/debug.h -
|
||||
|
||||
$Author: ko1 $
|
||||
created at: Tue Nov 20 20:35:08 2012
|
||||
|
||||
Copyright (C) 2012 Yukihiro Matsumoto
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef RB_DEBUG_H
|
||||
#define RB_DEBUG_H 1
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#if 0
|
||||
} /* satisfy cc-mode */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
RUBY_SYMBOL_EXPORT_BEGIN
|
||||
|
||||
/* Note: This file contains experimental APIs. */
|
||||
/* APIs can be replaced at Ruby 2.0.1 or later */
|
||||
|
||||
|
||||
/* profile frames APIs */
|
||||
int rb_profile_frames(int start, int limit, VALUE *buff, int *lines);
|
||||
VALUE rb_profile_frame_path(VALUE frame);
|
||||
VALUE rb_profile_frame_absolute_path(VALUE frame);
|
||||
VALUE rb_profile_frame_label(VALUE frame);
|
||||
VALUE rb_profile_frame_base_label(VALUE frame);
|
||||
VALUE rb_profile_frame_full_label(VALUE frame);
|
||||
VALUE rb_profile_frame_first_lineno(VALUE frame);
|
||||
VALUE rb_profile_frame_classpath(VALUE frame);
|
||||
VALUE rb_profile_frame_singleton_method_p(VALUE frame);
|
||||
VALUE rb_profile_frame_method_name(VALUE frame);
|
||||
VALUE rb_profile_frame_qualified_method_name(VALUE frame);
|
||||
|
||||
/* debug inspector APIs */
|
||||
typedef struct rb_debug_inspector_struct rb_debug_inspector_t;
|
||||
typedef VALUE (*rb_debug_inspector_func_t)(const rb_debug_inspector_t *, void *);
|
||||
|
||||
VALUE rb_debug_inspector_open(rb_debug_inspector_func_t func, void *data);
|
||||
VALUE rb_debug_inspector_frame_self_get(const rb_debug_inspector_t *dc, long index);
|
||||
VALUE rb_debug_inspector_frame_class_get(const rb_debug_inspector_t *dc, long index);
|
||||
VALUE rb_debug_inspector_frame_binding_get(const rb_debug_inspector_t *dc, long index);
|
||||
VALUE rb_debug_inspector_frame_iseq_get(const rb_debug_inspector_t *dc, long index);
|
||||
VALUE rb_debug_inspector_backtrace_locations(const rb_debug_inspector_t *dc);
|
||||
|
||||
/* Old style set_trace_func APIs */
|
||||
|
||||
/* duplicated def of include/ruby/ruby.h */
|
||||
void rb_add_event_hook(rb_event_hook_func_t func, rb_event_flag_t events, VALUE data);
|
||||
int rb_remove_event_hook(rb_event_hook_func_t func);
|
||||
|
||||
int rb_remove_event_hook_with_data(rb_event_hook_func_t func, VALUE data);
|
||||
void rb_thread_add_event_hook(VALUE thval, rb_event_hook_func_t func, rb_event_flag_t events, VALUE data);
|
||||
int rb_thread_remove_event_hook(VALUE thval, rb_event_hook_func_t func);
|
||||
int rb_thread_remove_event_hook_with_data(VALUE thval, rb_event_hook_func_t func, VALUE data);
|
||||
|
||||
/* TracePoint APIs */
|
||||
|
||||
VALUE rb_tracepoint_new(VALUE target_thread_not_supported_yet, rb_event_flag_t events, void (*func)(VALUE, void *), void *data);
|
||||
VALUE rb_tracepoint_enable(VALUE tpval);
|
||||
VALUE rb_tracepoint_disable(VALUE tpval);
|
||||
VALUE rb_tracepoint_enabled_p(VALUE tpval);
|
||||
|
||||
typedef struct rb_trace_arg_struct rb_trace_arg_t;
|
||||
rb_trace_arg_t *rb_tracearg_from_tracepoint(VALUE tpval);
|
||||
|
||||
rb_event_flag_t rb_tracearg_event_flag(rb_trace_arg_t *trace_arg);
|
||||
VALUE rb_tracearg_event(rb_trace_arg_t *trace_arg);
|
||||
VALUE rb_tracearg_lineno(rb_trace_arg_t *trace_arg);
|
||||
VALUE rb_tracearg_path(rb_trace_arg_t *trace_arg);
|
||||
VALUE rb_tracearg_method_id(rb_trace_arg_t *trace_arg);
|
||||
VALUE rb_tracearg_defined_class(rb_trace_arg_t *trace_arg);
|
||||
VALUE rb_tracearg_binding(rb_trace_arg_t *trace_arg);
|
||||
VALUE rb_tracearg_self(rb_trace_arg_t *trace_arg);
|
||||
VALUE rb_tracearg_return_value(rb_trace_arg_t *trace_arg);
|
||||
VALUE rb_tracearg_raised_exception(rb_trace_arg_t *trace_arg);
|
||||
VALUE rb_tracearg_object(rb_trace_arg_t *trace_arg);
|
||||
|
||||
/* Postponed Job API */
|
||||
typedef void (*rb_postponed_job_func_t)(void *arg);
|
||||
int rb_postponed_job_register(unsigned int flags, rb_postponed_job_func_t func, void *data);
|
||||
int rb_postponed_job_register_one(unsigned int flags, rb_postponed_job_func_t func, void *data);
|
||||
|
||||
/* undocumented advanced tracing APIs */
|
||||
|
||||
typedef enum {
|
||||
RUBY_EVENT_HOOK_FLAG_SAFE = 0x01,
|
||||
RUBY_EVENT_HOOK_FLAG_DELETED = 0x02,
|
||||
RUBY_EVENT_HOOK_FLAG_RAW_ARG = 0x04
|
||||
} rb_event_hook_flag_t;
|
||||
|
||||
void rb_add_event_hook2(rb_event_hook_func_t func, rb_event_flag_t events, VALUE data, rb_event_hook_flag_t hook_flag);
|
||||
void rb_thread_add_event_hook2(VALUE thval, rb_event_hook_func_t func, rb_event_flag_t events, VALUE data, rb_event_hook_flag_t hook_flag);
|
||||
|
||||
RUBY_SYMBOL_EXPORT_END
|
||||
|
||||
#if defined(__cplusplus)
|
||||
#if 0
|
||||
{ /* satisfy cc-mode */
|
||||
#endif
|
||||
} /* extern "C" { */
|
||||
#endif
|
||||
|
||||
#endif /* RUBY_DEBUG_H */
|
||||
@@ -1,289 +0,0 @@
|
||||
/************************************************
|
||||
|
||||
defines.h -
|
||||
|
||||
$Author: hsbt $
|
||||
created at: Wed May 18 00:21:44 JST 1994
|
||||
|
||||
************************************************/
|
||||
|
||||
#ifndef RUBY_DEFINES_H
|
||||
#define RUBY_DEFINES_H 1
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#if 0
|
||||
} /* satisfy cc-mode */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "ruby/config.h"
|
||||
#ifdef RUBY_EXTCONF_H
|
||||
#include RUBY_EXTCONF_H
|
||||
#endif
|
||||
|
||||
/* AC_INCLUDES_DEFAULT */
|
||||
#include <stdio.h>
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
# include <sys/types.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_STAT_H
|
||||
# include <sys/stat.h>
|
||||
#endif
|
||||
#ifdef STDC_HEADERS
|
||||
# include <stdlib.h>
|
||||
# include <stddef.h>
|
||||
#else
|
||||
# ifdef HAVE_STDLIB_H
|
||||
# include <stdlib.h>
|
||||
# endif
|
||||
#endif
|
||||
#ifdef HAVE_STRING_H
|
||||
# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
|
||||
# include <memory.h>
|
||||
# endif
|
||||
# include <string.h>
|
||||
#endif
|
||||
#ifdef HAVE_STRINGS_H
|
||||
# include <strings.h>
|
||||
#endif
|
||||
#ifdef HAVE_INTTYPES_H
|
||||
# include <inttypes.h>
|
||||
#endif
|
||||
#ifdef HAVE_STDINT_H
|
||||
# include <stdint.h>
|
||||
#endif
|
||||
#ifdef HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_SELECT_H
|
||||
# include <sys/select.h>
|
||||
#endif
|
||||
|
||||
#if defined HAVE_SETJMPEX_H && defined HAVE__SETJMPEX
|
||||
#include <setjmpex.h>
|
||||
#endif
|
||||
|
||||
#include "ruby/missing.h"
|
||||
|
||||
#define RUBY
|
||||
|
||||
#ifdef __cplusplus
|
||||
# ifndef HAVE_PROTOTYPES
|
||||
# define HAVE_PROTOTYPES 1
|
||||
# endif
|
||||
# ifndef HAVE_STDARG_PROTOTYPES
|
||||
# define HAVE_STDARG_PROTOTYPES 1
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#undef _
|
||||
#ifdef HAVE_PROTOTYPES
|
||||
# define _(args) args
|
||||
#else
|
||||
# define _(args) ()
|
||||
#endif
|
||||
|
||||
#undef __
|
||||
#ifdef HAVE_STDARG_PROTOTYPES
|
||||
# define __(args) args
|
||||
#else
|
||||
# define __(args) ()
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define ANYARGS ...
|
||||
#else
|
||||
#define ANYARGS
|
||||
#endif
|
||||
|
||||
#ifndef RUBY_SYMBOL_EXPORT_BEGIN
|
||||
# define RUBY_SYMBOL_EXPORT_BEGIN /* begin */
|
||||
# define RUBY_SYMBOL_EXPORT_END /* end */
|
||||
#endif
|
||||
|
||||
RUBY_SYMBOL_EXPORT_BEGIN
|
||||
|
||||
#define xmalloc ruby_xmalloc
|
||||
#define xmalloc2 ruby_xmalloc2
|
||||
#define xcalloc ruby_xcalloc
|
||||
#define xrealloc ruby_xrealloc
|
||||
#define xrealloc2 ruby_xrealloc2
|
||||
#define xfree ruby_xfree
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 3
|
||||
# define RUBY_ATTR_ALLOC_SIZE(params) __attribute__ ((__alloc_size__ params))
|
||||
#else
|
||||
# define RUBY_ATTR_ALLOC_SIZE(params)
|
||||
#endif
|
||||
|
||||
void *xmalloc(size_t) RUBY_ATTR_ALLOC_SIZE((1));
|
||||
void *xmalloc2(size_t,size_t) RUBY_ATTR_ALLOC_SIZE((1,2));
|
||||
void *xcalloc(size_t,size_t) RUBY_ATTR_ALLOC_SIZE((1,2));
|
||||
void *xrealloc(void*,size_t) RUBY_ATTR_ALLOC_SIZE((2));
|
||||
void *xrealloc2(void*,size_t,size_t) RUBY_ATTR_ALLOC_SIZE((2,3));
|
||||
void xfree(void*);
|
||||
|
||||
#define STRINGIZE(expr) STRINGIZE0(expr)
|
||||
#ifndef STRINGIZE0
|
||||
#define STRINGIZE0(expr) #expr
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LONG_LONG
|
||||
# define HAVE_TRUE_LONG_LONG 1
|
||||
#endif
|
||||
|
||||
#if SIZEOF_LONG_LONG > 0
|
||||
# define LONG_LONG long long
|
||||
#elif SIZEOF___INT64 > 0
|
||||
# define HAVE_LONG_LONG 1
|
||||
# define LONG_LONG __int64
|
||||
# undef SIZEOF_LONG_LONG
|
||||
# define SIZEOF_LONG_LONG SIZEOF___INT64
|
||||
#endif
|
||||
|
||||
#ifdef __CYGWIN__
|
||||
#undef _WIN32
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32) || defined(__EMX__)
|
||||
#define DOSISH 1
|
||||
# define DOSISH_DRIVE_LETTER
|
||||
#endif
|
||||
|
||||
#ifdef AC_APPLE_UNIVERSAL_BUILD
|
||||
#undef WORDS_BIGENDIAN
|
||||
#ifdef __BIG_ENDIAN__
|
||||
#define WORDS_BIGENDIAN
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
#include "ruby/win32.h"
|
||||
#endif
|
||||
|
||||
#if defined(__BEOS__) && !defined(__HAIKU__) && !defined(BONE)
|
||||
#include <net/socket.h> /* intern.h needs fd_set definition */
|
||||
#endif
|
||||
|
||||
#ifdef RUBY_EXPORT
|
||||
#undef RUBY_EXTERN
|
||||
|
||||
#ifndef FALSE
|
||||
# define FALSE 0
|
||||
#elif FALSE
|
||||
# error FALSE must be false
|
||||
#endif
|
||||
#ifndef TRUE
|
||||
# define TRUE 1
|
||||
#elif !TRUE
|
||||
# error TRUE must be true
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef RUBY_FUNC_EXPORTED
|
||||
#define RUBY_FUNC_EXPORTED
|
||||
#endif
|
||||
|
||||
#ifndef RUBY_EXTERN
|
||||
#define RUBY_EXTERN extern
|
||||
#endif
|
||||
|
||||
#ifndef EXTERN
|
||||
#define EXTERN RUBY_EXTERN /* deprecated */
|
||||
#endif
|
||||
|
||||
#ifndef RUBY_MBCHAR_MAXSIZE
|
||||
#define RUBY_MBCHAR_MAXSIZE INT_MAX
|
||||
/* MB_CUR_MAX will not work well in C locale */
|
||||
#endif
|
||||
|
||||
#if defined(__sparc)
|
||||
void rb_sparc_flush_register_windows(void);
|
||||
# define FLUSH_REGISTER_WINDOWS rb_sparc_flush_register_windows()
|
||||
#elif defined(__ia64)
|
||||
void *rb_ia64_bsp(void);
|
||||
void rb_ia64_flushrs(void);
|
||||
# define FLUSH_REGISTER_WINDOWS rb_ia64_flushrs()
|
||||
#else
|
||||
# define FLUSH_REGISTER_WINDOWS ((void)0)
|
||||
#endif
|
||||
|
||||
#if defined(DOSISH)
|
||||
#define PATH_SEP ";"
|
||||
#else
|
||||
#define PATH_SEP ":"
|
||||
#endif
|
||||
#define PATH_SEP_CHAR PATH_SEP[0]
|
||||
|
||||
#define PATH_ENV "PATH"
|
||||
|
||||
#if defined(DOSISH) && !defined(__EMX__)
|
||||
#define ENV_IGNORECASE
|
||||
#endif
|
||||
|
||||
#ifndef CASEFOLD_FILESYSTEM
|
||||
# if defined DOSISH
|
||||
# define CASEFOLD_FILESYSTEM 1
|
||||
# else
|
||||
# define CASEFOLD_FILESYSTEM 0
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef DLEXT_MAXLEN
|
||||
#define DLEXT_MAXLEN 4
|
||||
#endif
|
||||
|
||||
#ifndef RUBY_PLATFORM
|
||||
#define RUBY_PLATFORM "unknown-unknown"
|
||||
#endif
|
||||
|
||||
#ifndef FUNC_MINIMIZED
|
||||
#define FUNC_MINIMIZED(x) x
|
||||
#endif
|
||||
#ifndef RUBY_ALIAS_FUNCTION_TYPE
|
||||
#define RUBY_ALIAS_FUNCTION_TYPE(type, prot, name, args) \
|
||||
FUNC_MINIMIZED(type prot) {return name args;}
|
||||
#endif
|
||||
#ifndef RUBY_ALIAS_FUNCTION_VOID
|
||||
#define RUBY_ALIAS_FUNCTION_VOID(prot, name, args) \
|
||||
void prot {name args;}
|
||||
#endif
|
||||
#ifndef RUBY_ALIAS_FUNCTION
|
||||
#define RUBY_ALIAS_FUNCTION(prot, name, args) \
|
||||
RUBY_ALIAS_FUNCTION_TYPE(VALUE, prot, name, args)
|
||||
#endif
|
||||
|
||||
#ifndef UNALIGNED_WORD_ACCESS
|
||||
# if defined(__i386) || defined(__i386__) || defined(_M_IX86) || \
|
||||
defined(__x86_64) || defined(__x86_64__) || defined(_M_AMD64) || \
|
||||
defined(__powerpc64__) || \
|
||||
defined(__mc68020__)
|
||||
# define UNALIGNED_WORD_ACCESS 1
|
||||
# else
|
||||
# define UNALIGNED_WORD_ACCESS 0
|
||||
# endif
|
||||
#endif
|
||||
#ifndef PACKED_STRUCT
|
||||
# define PACKED_STRUCT(x) x
|
||||
#endif
|
||||
#ifndef PACKED_STRUCT_UNALIGNED
|
||||
# if UNALIGNED_WORD_ACCESS
|
||||
# define PACKED_STRUCT_UNALIGNED(x) PACKED_STRUCT(x)
|
||||
# else
|
||||
# define PACKED_STRUCT_UNALIGNED(x) x
|
||||
# endif
|
||||
#endif
|
||||
|
||||
RUBY_SYMBOL_EXPORT_END
|
||||
|
||||
#if defined(__cplusplus)
|
||||
#if 0
|
||||
{ /* satisfy cc-mode */
|
||||
#endif
|
||||
} /* extern "C" { */
|
||||
#endif
|
||||
|
||||
#endif /* RUBY_DEFINES_H */
|
||||
@@ -1,32 +0,0 @@
|
||||
/************************************************
|
||||
|
||||
digest.h - header file for ruby digest modules
|
||||
|
||||
$Author: nobu $
|
||||
created at: Fri May 25 08:54:56 JST 2001
|
||||
|
||||
|
||||
Copyright (C) 2001-2006 Akinori MUSHA
|
||||
|
||||
$RoughId: digest.h,v 1.3 2001/07/13 15:38:27 knu Exp $
|
||||
$Id: digest.h 46826 2014-07-15 14:58:53Z nobu $
|
||||
|
||||
************************************************/
|
||||
|
||||
#include "ruby.h"
|
||||
|
||||
#define RUBY_DIGEST_API_VERSION 3
|
||||
|
||||
typedef int (*rb_digest_hash_init_func_t)(void *);
|
||||
typedef void (*rb_digest_hash_update_func_t)(void *, unsigned char *, size_t);
|
||||
typedef int (*rb_digest_hash_finish_func_t)(void *, unsigned char *);
|
||||
|
||||
typedef struct {
|
||||
int api_version;
|
||||
size_t digest_len;
|
||||
size_t block_len;
|
||||
size_t ctx_size;
|
||||
rb_digest_hash_init_func_t init_func;
|
||||
rb_digest_hash_update_func_t update_func;
|
||||
rb_digest_hash_finish_func_t finish_func;
|
||||
} rb_digest_metadata_t;
|
||||
@@ -1,359 +0,0 @@
|
||||
/**********************************************************************
|
||||
|
||||
encoding.h -
|
||||
|
||||
$Author: matz $
|
||||
created at: Thu May 24 11:49:41 JST 2007
|
||||
|
||||
Copyright (C) 2007 Yukihiro Matsumoto
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef RUBY_ENCODING_H
|
||||
#define RUBY_ENCODING_H 1
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#if 0
|
||||
} /* satisfy cc-mode */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <stdarg.h>
|
||||
#include "ruby/oniguruma.h"
|
||||
|
||||
RUBY_SYMBOL_EXPORT_BEGIN
|
||||
|
||||
#define ENCODING_INLINE_MAX 127
|
||||
#define ENCODING_SHIFT (FL_USHIFT+10)
|
||||
#define ENCODING_MASK (((VALUE)ENCODING_INLINE_MAX)<<ENCODING_SHIFT) /* FL_USER10|FL_USER11|FL_USER12|FL_USER13|FL_USER14|FL_USER15|FL_USER16 */
|
||||
|
||||
#define ENCODING_SET_INLINED(obj,i) do {\
|
||||
RBASIC(obj)->flags &= ~ENCODING_MASK;\
|
||||
RBASIC(obj)->flags |= (VALUE)(i) << ENCODING_SHIFT;\
|
||||
} while (0)
|
||||
#define ENCODING_SET(obj,i) rb_enc_set_index((obj), (i))
|
||||
|
||||
#define ENCODING_GET_INLINED(obj) (int)((RBASIC(obj)->flags & ENCODING_MASK)>>ENCODING_SHIFT)
|
||||
#define ENCODING_GET(obj) \
|
||||
(ENCODING_GET_INLINED(obj) != ENCODING_INLINE_MAX ? \
|
||||
ENCODING_GET_INLINED(obj) : \
|
||||
rb_enc_get_index(obj))
|
||||
|
||||
#define ENCODING_IS_ASCII8BIT(obj) (ENCODING_GET_INLINED(obj) == 0)
|
||||
|
||||
#define ENCODING_MAXNAMELEN 42
|
||||
|
||||
#define ENC_CODERANGE_MASK ((int)(FL_USER8|FL_USER9))
|
||||
#define ENC_CODERANGE_UNKNOWN 0
|
||||
#define ENC_CODERANGE_7BIT ((int)FL_USER8)
|
||||
#define ENC_CODERANGE_VALID ((int)FL_USER9)
|
||||
#define ENC_CODERANGE_BROKEN ((int)(FL_USER8|FL_USER9))
|
||||
#define ENC_CODERANGE(obj) ((int)RBASIC(obj)->flags & ENC_CODERANGE_MASK)
|
||||
#define ENC_CODERANGE_ASCIIONLY(obj) (ENC_CODERANGE(obj) == ENC_CODERANGE_7BIT)
|
||||
#define ENC_CODERANGE_SET(obj,cr) (RBASIC(obj)->flags = \
|
||||
(RBASIC(obj)->flags & ~ENC_CODERANGE_MASK) | (cr))
|
||||
#define ENC_CODERANGE_CLEAR(obj) ENC_CODERANGE_SET((obj),0)
|
||||
|
||||
/* assumed ASCII compatibility */
|
||||
#define ENC_CODERANGE_AND(a, b) \
|
||||
((a) == ENC_CODERANGE_7BIT ? (b) : \
|
||||
(a) == ENC_CODERANGE_VALID ? ((b) == ENC_CODERANGE_7BIT ? ENC_CODERANGE_VALID : (b)) : \
|
||||
ENC_CODERANGE_UNKNOWN)
|
||||
|
||||
#define ENCODING_CODERANGE_SET(obj, encindex, cr) \
|
||||
do { \
|
||||
VALUE rb_encoding_coderange_obj = (obj); \
|
||||
ENCODING_SET(rb_encoding_coderange_obj, (encindex)); \
|
||||
ENC_CODERANGE_SET(rb_encoding_coderange_obj, (cr)); \
|
||||
} while (0)
|
||||
|
||||
typedef const OnigEncodingType rb_encoding;
|
||||
|
||||
int rb_char_to_option_kcode(int c, int *option, int *kcode);
|
||||
|
||||
int rb_enc_replicate(const char *, rb_encoding *);
|
||||
int rb_define_dummy_encoding(const char *);
|
||||
int rb_enc_dummy_p(rb_encoding *enc);
|
||||
int rb_enc_to_index(rb_encoding *enc);
|
||||
int rb_enc_get_index(VALUE obj);
|
||||
void rb_enc_set_index(VALUE obj, int encindex);
|
||||
int rb_enc_find_index(const char *name);
|
||||
int rb_to_encoding_index(VALUE);
|
||||
rb_encoding *rb_to_encoding(VALUE);
|
||||
rb_encoding *rb_find_encoding(VALUE);
|
||||
rb_encoding *rb_enc_get(VALUE);
|
||||
rb_encoding *rb_enc_compatible(VALUE,VALUE);
|
||||
rb_encoding *rb_enc_check(VALUE,VALUE);
|
||||
VALUE rb_enc_associate_index(VALUE, int);
|
||||
VALUE rb_enc_associate(VALUE, rb_encoding*);
|
||||
void rb_enc_copy(VALUE dst, VALUE src);
|
||||
|
||||
VALUE rb_enc_str_new(const char*, long, rb_encoding*);
|
||||
VALUE rb_enc_str_new_cstr(const char*, rb_encoding*);
|
||||
VALUE rb_enc_str_new_static(const char*, long, rb_encoding*);
|
||||
VALUE rb_enc_reg_new(const char*, long, rb_encoding*, int);
|
||||
PRINTF_ARGS(VALUE rb_enc_sprintf(rb_encoding *, const char*, ...), 2, 3);
|
||||
VALUE rb_enc_vsprintf(rb_encoding *, const char*, va_list);
|
||||
long rb_enc_strlen(const char*, const char*, rb_encoding*);
|
||||
char* rb_enc_nth(const char*, const char*, long, rb_encoding*);
|
||||
VALUE rb_obj_encoding(VALUE);
|
||||
VALUE rb_enc_str_buf_cat(VALUE str, const char *ptr, long len, rb_encoding *enc);
|
||||
VALUE rb_enc_uint_chr(unsigned int code, rb_encoding *enc);
|
||||
|
||||
VALUE rb_external_str_new_with_enc(const char *ptr, long len, rb_encoding *);
|
||||
VALUE rb_str_export_to_enc(VALUE, rb_encoding *);
|
||||
VALUE rb_str_conv_enc(VALUE str, rb_encoding *from, rb_encoding *to);
|
||||
VALUE rb_str_conv_enc_opts(VALUE str, rb_encoding *from, rb_encoding *to, int ecflags, VALUE ecopts);
|
||||
|
||||
#if defined(__GNUC__) && !defined(__PCC__)
|
||||
#define rb_enc_str_new(str, len, enc) __extension__ ( \
|
||||
{ \
|
||||
(__builtin_constant_p(str) && __builtin_constant_p(len)) ? \
|
||||
rb_enc_str_new_static((str), (len), (enc)) : \
|
||||
rb_enc_str_new((str), (len), (enc)); \
|
||||
})
|
||||
#define rb_enc_str_new_cstr(str, enc) __extension__ ( \
|
||||
{ \
|
||||
(__builtin_constant_p(str)) ? \
|
||||
rb_enc_str_new_static((str), (long)strlen(str), (enc)) : \
|
||||
rb_enc_str_new_cstr((str), (enc)); \
|
||||
})
|
||||
#endif
|
||||
|
||||
PRINTF_ARGS(NORETURN(void rb_enc_raise(rb_encoding *, VALUE, const char*, ...)), 3, 4);
|
||||
|
||||
/* index -> rb_encoding */
|
||||
rb_encoding *rb_enc_from_index(int idx);
|
||||
|
||||
/* name -> rb_encoding */
|
||||
rb_encoding *rb_enc_find(const char *name);
|
||||
|
||||
/* rb_encoding * -> name */
|
||||
#define rb_enc_name(enc) (enc)->name
|
||||
|
||||
/* rb_encoding * -> minlen/maxlen */
|
||||
#define rb_enc_mbminlen(enc) (enc)->min_enc_len
|
||||
#define rb_enc_mbmaxlen(enc) (enc)->max_enc_len
|
||||
|
||||
/* -> mbclen (no error notification: 0 < ret <= e-p, no exception) */
|
||||
int rb_enc_mbclen(const char *p, const char *e, rb_encoding *enc);
|
||||
|
||||
/* -> mbclen (only for valid encoding) */
|
||||
int rb_enc_fast_mbclen(const char *p, const char *e, rb_encoding *enc);
|
||||
|
||||
/* -> chlen, invalid or needmore */
|
||||
int rb_enc_precise_mbclen(const char *p, const char *e, rb_encoding *enc);
|
||||
#define MBCLEN_CHARFOUND_P(ret) ONIGENC_MBCLEN_CHARFOUND_P(ret)
|
||||
#define MBCLEN_CHARFOUND_LEN(ret) ONIGENC_MBCLEN_CHARFOUND_LEN(ret)
|
||||
#define MBCLEN_INVALID_P(ret) ONIGENC_MBCLEN_INVALID_P(ret)
|
||||
#define MBCLEN_NEEDMORE_P(ret) ONIGENC_MBCLEN_NEEDMORE_P(ret)
|
||||
#define MBCLEN_NEEDMORE_LEN(ret) ONIGENC_MBCLEN_NEEDMORE_LEN(ret)
|
||||
|
||||
/* -> 0x00..0x7f, -1 */
|
||||
int rb_enc_ascget(const char *p, const char *e, int *len, rb_encoding *enc);
|
||||
|
||||
|
||||
/* -> code (and len) or raise exception */
|
||||
unsigned int rb_enc_codepoint_len(const char *p, const char *e, int *len, rb_encoding *enc);
|
||||
|
||||
/* prototype for obsolete function */
|
||||
unsigned int rb_enc_codepoint(const char *p, const char *e, rb_encoding *enc);
|
||||
/* overriding macro */
|
||||
#define rb_enc_codepoint(p,e,enc) rb_enc_codepoint_len((p),(e),0,(enc))
|
||||
#define rb_enc_mbc_to_codepoint(p, e, enc) ONIGENC_MBC_TO_CODE((enc),(UChar*)(p),(UChar*)(e))
|
||||
|
||||
/* -> codelen>0 or raise exception */
|
||||
int rb_enc_codelen(int code, rb_encoding *enc);
|
||||
/* -> 0 for invalid codepoint */
|
||||
int rb_enc_code_to_mbclen(int code, rb_encoding *enc);
|
||||
#define rb_enc_code_to_mbclen(c, enc) ONIGENC_CODE_TO_MBCLEN((enc), (c));
|
||||
|
||||
/* code,ptr,encoding -> write buf */
|
||||
#define rb_enc_mbcput(c,buf,enc) ONIGENC_CODE_TO_MBC((enc),(c),(UChar*)(buf))
|
||||
|
||||
/* start, ptr, end, encoding -> prev_char */
|
||||
#define rb_enc_prev_char(s,p,e,enc) ((char *)onigenc_get_prev_char_head((enc),(UChar*)(s),(UChar*)(p),(UChar*)(e)))
|
||||
/* start, ptr, end, encoding -> next_char */
|
||||
#define rb_enc_left_char_head(s,p,e,enc) ((char *)onigenc_get_left_adjust_char_head((enc),(UChar*)(s),(UChar*)(p),(UChar*)(e)))
|
||||
#define rb_enc_right_char_head(s,p,e,enc) ((char *)onigenc_get_right_adjust_char_head((enc),(UChar*)(s),(UChar*)(p),(UChar*)(e)))
|
||||
#define rb_enc_step_back(s,p,e,n,enc) ((char *)onigenc_step_back((enc),(UChar*)(s),(UChar*)(p),(UChar*)(e),(int)(n)))
|
||||
|
||||
/* ptr, ptr, encoding -> newline_or_not */
|
||||
#define rb_enc_is_newline(p,end,enc) ONIGENC_IS_MBC_NEWLINE((enc),(UChar*)(p),(UChar*)(end))
|
||||
|
||||
#define rb_enc_isctype(c,t,enc) ONIGENC_IS_CODE_CTYPE((enc),(c),(t))
|
||||
#define rb_enc_isascii(c,enc) ONIGENC_IS_CODE_ASCII(c)
|
||||
#define rb_enc_isalpha(c,enc) ONIGENC_IS_CODE_ALPHA((enc),(c))
|
||||
#define rb_enc_islower(c,enc) ONIGENC_IS_CODE_LOWER((enc),(c))
|
||||
#define rb_enc_isupper(c,enc) ONIGENC_IS_CODE_UPPER((enc),(c))
|
||||
#define rb_enc_ispunct(c,enc) ONIGENC_IS_CODE_PUNCT((enc),(c))
|
||||
#define rb_enc_isalnum(c,enc) ONIGENC_IS_CODE_ALNUM((enc),(c))
|
||||
#define rb_enc_isprint(c,enc) ONIGENC_IS_CODE_PRINT((enc),(c))
|
||||
#define rb_enc_isspace(c,enc) ONIGENC_IS_CODE_SPACE((enc),(c))
|
||||
#define rb_enc_isdigit(c,enc) ONIGENC_IS_CODE_DIGIT((enc),(c))
|
||||
|
||||
#define rb_enc_asciicompat(enc) (rb_enc_mbminlen(enc)==1 && !rb_enc_dummy_p(enc))
|
||||
|
||||
int rb_enc_casefold(char *to, const char *p, const char *e, rb_encoding *enc);
|
||||
int rb_enc_toupper(int c, rb_encoding *enc);
|
||||
int rb_enc_tolower(int c, rb_encoding *enc);
|
||||
ID rb_intern3(const char*, long, rb_encoding*);
|
||||
ID rb_interned_id_p(const char *, long, rb_encoding *);
|
||||
int rb_enc_symname_p(const char*, rb_encoding*);
|
||||
int rb_enc_symname2_p(const char*, long, rb_encoding*);
|
||||
int rb_enc_str_coderange(VALUE);
|
||||
long rb_str_coderange_scan_restartable(const char*, const char*, rb_encoding*, int*);
|
||||
int rb_enc_str_asciionly_p(VALUE);
|
||||
#define rb_enc_str_asciicompat_p(str) rb_enc_asciicompat(rb_enc_get(str))
|
||||
VALUE rb_enc_from_encoding(rb_encoding *enc);
|
||||
int rb_enc_unicode_p(rb_encoding *enc);
|
||||
rb_encoding *rb_ascii8bit_encoding(void);
|
||||
rb_encoding *rb_utf8_encoding(void);
|
||||
rb_encoding *rb_usascii_encoding(void);
|
||||
rb_encoding *rb_locale_encoding(void);
|
||||
rb_encoding *rb_filesystem_encoding(void);
|
||||
rb_encoding *rb_default_external_encoding(void);
|
||||
rb_encoding *rb_default_internal_encoding(void);
|
||||
#ifndef rb_ascii8bit_encindex
|
||||
int rb_ascii8bit_encindex(void);
|
||||
#endif
|
||||
#ifndef rb_utf8_encindex
|
||||
int rb_utf8_encindex(void);
|
||||
#endif
|
||||
#ifndef rb_usascii_encindex
|
||||
int rb_usascii_encindex(void);
|
||||
#endif
|
||||
int rb_locale_encindex(void);
|
||||
int rb_filesystem_encindex(void);
|
||||
VALUE rb_enc_default_external(void);
|
||||
VALUE rb_enc_default_internal(void);
|
||||
void rb_enc_set_default_external(VALUE encoding);
|
||||
void rb_enc_set_default_internal(VALUE encoding);
|
||||
VALUE rb_locale_charmap(VALUE klass);
|
||||
long rb_memsearch(const void*,long,const void*,long,rb_encoding*);
|
||||
char *rb_enc_path_next(const char *,const char *,rb_encoding*);
|
||||
char *rb_enc_path_skip_prefix(const char *,const char *,rb_encoding*);
|
||||
char *rb_enc_path_last_separator(const char *,const char *,rb_encoding*);
|
||||
char *rb_enc_path_end(const char *,const char *,rb_encoding*);
|
||||
const char *ruby_enc_find_basename(const char *name, long *baselen, long *alllen, rb_encoding *enc);
|
||||
const char *ruby_enc_find_extname(const char *name, long *len, rb_encoding *enc);
|
||||
ID rb_check_id_cstr(const char *ptr, long len, rb_encoding *enc);
|
||||
VALUE rb_check_symbol_cstr(const char *ptr, long len, rb_encoding *enc);
|
||||
|
||||
RUBY_EXTERN VALUE rb_cEncoding;
|
||||
|
||||
/* econv stuff */
|
||||
|
||||
typedef enum {
|
||||
econv_invalid_byte_sequence,
|
||||
econv_undefined_conversion,
|
||||
econv_destination_buffer_full,
|
||||
econv_source_buffer_empty,
|
||||
econv_finished,
|
||||
econv_after_output,
|
||||
econv_incomplete_input
|
||||
} rb_econv_result_t;
|
||||
|
||||
typedef struct rb_econv_t rb_econv_t;
|
||||
|
||||
VALUE rb_str_encode(VALUE str, VALUE to, int ecflags, VALUE ecopts);
|
||||
int rb_econv_has_convpath_p(const char* from_encoding, const char* to_encoding);
|
||||
|
||||
int rb_econv_prepare_options(VALUE opthash, VALUE *ecopts, int ecflags);
|
||||
int rb_econv_prepare_opts(VALUE opthash, VALUE *ecopts);
|
||||
|
||||
rb_econv_t *rb_econv_open(const char *source_encoding, const char *destination_encoding, int ecflags);
|
||||
rb_econv_t *rb_econv_open_opts(const char *source_encoding, const char *destination_encoding, int ecflags, VALUE ecopts);
|
||||
|
||||
rb_econv_result_t rb_econv_convert(rb_econv_t *ec,
|
||||
const unsigned char **source_buffer_ptr, const unsigned char *source_buffer_end,
|
||||
unsigned char **destination_buffer_ptr, unsigned char *destination_buffer_end,
|
||||
int flags);
|
||||
void rb_econv_close(rb_econv_t *ec);
|
||||
|
||||
/* result: 0:success -1:failure */
|
||||
int rb_econv_set_replacement(rb_econv_t *ec, const unsigned char *str, size_t len, const char *encname);
|
||||
|
||||
/* result: 0:success -1:failure */
|
||||
int rb_econv_decorate_at_first(rb_econv_t *ec, const char *decorator_name);
|
||||
int rb_econv_decorate_at_last(rb_econv_t *ec, const char *decorator_name);
|
||||
|
||||
VALUE rb_econv_open_exc(const char *senc, const char *denc, int ecflags);
|
||||
|
||||
/* result: 0:success -1:failure */
|
||||
int rb_econv_insert_output(rb_econv_t *ec,
|
||||
const unsigned char *str, size_t len, const char *str_encoding);
|
||||
|
||||
/* encoding that rb_econv_insert_output doesn't need conversion */
|
||||
const char *rb_econv_encoding_to_insert_output(rb_econv_t *ec);
|
||||
|
||||
/* raise an error if the last rb_econv_convert is error */
|
||||
void rb_econv_check_error(rb_econv_t *ec);
|
||||
|
||||
/* returns an exception object or nil */
|
||||
VALUE rb_econv_make_exception(rb_econv_t *ec);
|
||||
|
||||
int rb_econv_putbackable(rb_econv_t *ec);
|
||||
void rb_econv_putback(rb_econv_t *ec, unsigned char *p, int n);
|
||||
|
||||
/* returns the corresponding ASCII compatible encoding for encname,
|
||||
* or NULL if encname is not ASCII incompatible encoding. */
|
||||
const char *rb_econv_asciicompat_encoding(const char *encname);
|
||||
|
||||
VALUE rb_econv_str_convert(rb_econv_t *ec, VALUE src, int flags);
|
||||
VALUE rb_econv_substr_convert(rb_econv_t *ec, VALUE src, long byteoff, long bytesize, int flags);
|
||||
VALUE rb_econv_str_append(rb_econv_t *ec, VALUE src, VALUE dst, int flags);
|
||||
VALUE rb_econv_substr_append(rb_econv_t *ec, VALUE src, long byteoff, long bytesize, VALUE dst, int flags);
|
||||
VALUE rb_econv_append(rb_econv_t *ec, const char *bytesrc, long bytesize, VALUE dst, int flags);
|
||||
|
||||
void rb_econv_binmode(rb_econv_t *ec);
|
||||
|
||||
/* flags for rb_econv_open */
|
||||
|
||||
#define ECONV_ERROR_HANDLER_MASK 0x000000ff
|
||||
|
||||
#define ECONV_INVALID_MASK 0x0000000f
|
||||
#define ECONV_INVALID_REPLACE 0x00000002
|
||||
|
||||
#define ECONV_UNDEF_MASK 0x000000f0
|
||||
#define ECONV_UNDEF_REPLACE 0x00000020
|
||||
#define ECONV_UNDEF_HEX_CHARREF 0x00000030
|
||||
|
||||
#define ECONV_DECORATOR_MASK 0x0000ff00
|
||||
#define ECONV_NEWLINE_DECORATOR_MASK 0x00003f00
|
||||
#define ECONV_NEWLINE_DECORATOR_READ_MASK 0x00000f00
|
||||
#define ECONV_NEWLINE_DECORATOR_WRITE_MASK 0x00003000
|
||||
|
||||
#define ECONV_UNIVERSAL_NEWLINE_DECORATOR 0x00000100
|
||||
#define ECONV_CRLF_NEWLINE_DECORATOR 0x00001000
|
||||
#define ECONV_CR_NEWLINE_DECORATOR 0x00002000
|
||||
#define ECONV_XML_TEXT_DECORATOR 0x00004000
|
||||
#define ECONV_XML_ATTR_CONTENT_DECORATOR 0x00008000
|
||||
|
||||
#define ECONV_STATEFUL_DECORATOR_MASK 0x00f00000
|
||||
#define ECONV_XML_ATTR_QUOTE_DECORATOR 0x00100000
|
||||
|
||||
#if defined(RUBY_TEST_CRLF_ENVIRONMENT) || defined(_WIN32)
|
||||
#define ECONV_DEFAULT_NEWLINE_DECORATOR ECONV_CRLF_NEWLINE_DECORATOR
|
||||
#else
|
||||
#define ECONV_DEFAULT_NEWLINE_DECORATOR 0
|
||||
#endif
|
||||
|
||||
/* end of flags for rb_econv_open */
|
||||
|
||||
/* flags for rb_econv_convert */
|
||||
#define ECONV_PARTIAL_INPUT 0x00010000
|
||||
#define ECONV_AFTER_OUTPUT 0x00020000
|
||||
/* end of flags for rb_econv_convert */
|
||||
|
||||
RUBY_SYMBOL_EXPORT_END
|
||||
|
||||
#if defined(__cplusplus)
|
||||
#if 0
|
||||
{ /* satisfy cc-mode */
|
||||
#endif
|
||||
} /* extern "C" { */
|
||||
#endif
|
||||
|
||||
#endif /* RUBY_ENCODING_H */
|
||||
@@ -1,989 +0,0 @@
|
||||
/**********************************************************************
|
||||
|
||||
intern.h -
|
||||
|
||||
$Author: nobu $
|
||||
created at: Thu Jun 10 14:22:17 JST 1993
|
||||
|
||||
Copyright (C) 1993-2007 Yukihiro Matsumoto
|
||||
Copyright (C) 2000 Network Applied Communication Laboratory, Inc.
|
||||
Copyright (C) 2000 Information-technology Promotion Agency, Japan
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef RUBY_INTERN_H
|
||||
#define RUBY_INTERN_H 1
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#if 0
|
||||
} /* satisfy cc-mode */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "ruby/defines.h"
|
||||
#ifdef RUBY_EXTCONF_H
|
||||
#include RUBY_EXTCONF_H
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STDARG_PROTOTYPES
|
||||
# include <stdarg.h>
|
||||
#else
|
||||
# include <varargs.h>
|
||||
#endif
|
||||
|
||||
#include "ruby/st.h"
|
||||
|
||||
RUBY_SYMBOL_EXPORT_BEGIN
|
||||
|
||||
/*
|
||||
* Functions and variables that are used by more than one source file of
|
||||
* the kernel.
|
||||
*/
|
||||
|
||||
#define UNLIMITED_ARGUMENTS (-1)
|
||||
|
||||
/* array.c */
|
||||
void rb_mem_clear(register VALUE*, register long);
|
||||
VALUE rb_assoc_new(VALUE, VALUE);
|
||||
VALUE rb_check_array_type(VALUE);
|
||||
VALUE rb_ary_new(void);
|
||||
VALUE rb_ary_new_capa(long capa);
|
||||
VALUE rb_ary_new_from_args(long n, ...);
|
||||
VALUE rb_ary_new_from_values(long n, const VALUE *elts);
|
||||
VALUE rb_ary_tmp_new(long);
|
||||
void rb_ary_free(VALUE);
|
||||
void rb_ary_modify(VALUE);
|
||||
VALUE rb_ary_freeze(VALUE);
|
||||
VALUE rb_ary_shared_with_p(VALUE, VALUE);
|
||||
VALUE rb_ary_aref(int, const VALUE*, VALUE);
|
||||
VALUE rb_ary_subseq(VALUE, long, long);
|
||||
void rb_ary_store(VALUE, long, VALUE);
|
||||
VALUE rb_ary_dup(VALUE);
|
||||
VALUE rb_ary_resurrect(VALUE ary);
|
||||
VALUE rb_ary_to_ary(VALUE);
|
||||
VALUE rb_ary_to_s(VALUE);
|
||||
VALUE rb_ary_cat(VALUE, const VALUE *, long);
|
||||
VALUE rb_ary_push(VALUE, VALUE);
|
||||
VALUE rb_ary_pop(VALUE);
|
||||
VALUE rb_ary_shift(VALUE);
|
||||
VALUE rb_ary_unshift(VALUE, VALUE);
|
||||
VALUE rb_ary_entry(VALUE, long);
|
||||
VALUE rb_ary_each(VALUE);
|
||||
VALUE rb_ary_join(VALUE, VALUE);
|
||||
VALUE rb_ary_reverse(VALUE);
|
||||
VALUE rb_ary_rotate(VALUE, long);
|
||||
VALUE rb_ary_sort(VALUE);
|
||||
VALUE rb_ary_sort_bang(VALUE);
|
||||
VALUE rb_ary_delete(VALUE, VALUE);
|
||||
VALUE rb_ary_delete_at(VALUE, long);
|
||||
VALUE rb_ary_clear(VALUE);
|
||||
VALUE rb_ary_plus(VALUE, VALUE);
|
||||
VALUE rb_ary_concat(VALUE, VALUE);
|
||||
VALUE rb_ary_assoc(VALUE, VALUE);
|
||||
VALUE rb_ary_rassoc(VALUE, VALUE);
|
||||
VALUE rb_ary_includes(VALUE, VALUE);
|
||||
VALUE rb_ary_cmp(VALUE, VALUE);
|
||||
VALUE rb_ary_replace(VALUE copy, VALUE orig);
|
||||
VALUE rb_get_values_at(VALUE, long, int, const VALUE*, VALUE(*)(VALUE,long));
|
||||
VALUE rb_ary_resize(VALUE ary, long len);
|
||||
#define rb_ary_new2 rb_ary_new_capa
|
||||
#define rb_ary_new3 rb_ary_new_from_args
|
||||
#define rb_ary_new4 rb_ary_new_from_values
|
||||
/* bignum.c */
|
||||
VALUE rb_big_new(size_t, int);
|
||||
int rb_bigzero_p(VALUE x);
|
||||
VALUE rb_big_clone(VALUE);
|
||||
void rb_big_2comp(VALUE);
|
||||
VALUE rb_big_norm(VALUE);
|
||||
void rb_big_resize(VALUE big, size_t len);
|
||||
VALUE rb_cstr_to_inum(const char*, int, int);
|
||||
VALUE rb_str_to_inum(VALUE, int, int);
|
||||
VALUE rb_cstr2inum(const char*, int);
|
||||
VALUE rb_str2inum(VALUE, int);
|
||||
VALUE rb_big2str(VALUE, int);
|
||||
long rb_big2long(VALUE);
|
||||
#define rb_big2int(x) rb_big2long(x)
|
||||
unsigned long rb_big2ulong(VALUE);
|
||||
#define rb_big2uint(x) rb_big2ulong(x)
|
||||
#if HAVE_LONG_LONG
|
||||
LONG_LONG rb_big2ll(VALUE);
|
||||
unsigned LONG_LONG rb_big2ull(VALUE);
|
||||
#endif /* HAVE_LONG_LONG */
|
||||
void rb_big_pack(VALUE val, unsigned long *buf, long num_longs);
|
||||
VALUE rb_big_unpack(unsigned long *buf, long num_longs);
|
||||
int rb_uv_to_utf8(char[6],unsigned long);
|
||||
VALUE rb_dbl2big(double);
|
||||
double rb_big2dbl(VALUE);
|
||||
VALUE rb_big_cmp(VALUE, VALUE);
|
||||
VALUE rb_big_eq(VALUE, VALUE);
|
||||
VALUE rb_big_eql(VALUE, VALUE);
|
||||
VALUE rb_big_plus(VALUE, VALUE);
|
||||
VALUE rb_big_minus(VALUE, VALUE);
|
||||
VALUE rb_big_mul(VALUE, VALUE);
|
||||
VALUE rb_big_div(VALUE, VALUE);
|
||||
VALUE rb_big_idiv(VALUE, VALUE);
|
||||
VALUE rb_big_modulo(VALUE, VALUE);
|
||||
VALUE rb_big_divmod(VALUE, VALUE);
|
||||
VALUE rb_big_pow(VALUE, VALUE);
|
||||
VALUE rb_big_and(VALUE, VALUE);
|
||||
VALUE rb_big_or(VALUE, VALUE);
|
||||
VALUE rb_big_xor(VALUE, VALUE);
|
||||
VALUE rb_big_lshift(VALUE, VALUE);
|
||||
VALUE rb_big_rshift(VALUE, VALUE);
|
||||
|
||||
/* For rb_integer_pack and rb_integer_unpack: */
|
||||
/* "MS" in MSWORD and MSBYTE means "most significant" */
|
||||
/* "LS" in LSWORD and LSBYTE means "least significant" */
|
||||
#define INTEGER_PACK_MSWORD_FIRST 0x01
|
||||
#define INTEGER_PACK_LSWORD_FIRST 0x02
|
||||
#define INTEGER_PACK_MSBYTE_FIRST 0x10
|
||||
#define INTEGER_PACK_LSBYTE_FIRST 0x20
|
||||
#define INTEGER_PACK_NATIVE_BYTE_ORDER 0x40
|
||||
#define INTEGER_PACK_2COMP 0x80
|
||||
#define INTEGER_PACK_FORCE_GENERIC_IMPLEMENTATION 0x400
|
||||
/* For rb_integer_unpack: */
|
||||
#define INTEGER_PACK_FORCE_BIGNUM 0x100
|
||||
#define INTEGER_PACK_NEGATIVE 0x200
|
||||
/* Combinations: */
|
||||
#define INTEGER_PACK_LITTLE_ENDIAN \
|
||||
(INTEGER_PACK_LSWORD_FIRST | \
|
||||
INTEGER_PACK_LSBYTE_FIRST)
|
||||
#define INTEGER_PACK_BIG_ENDIAN \
|
||||
(INTEGER_PACK_MSWORD_FIRST | \
|
||||
INTEGER_PACK_MSBYTE_FIRST)
|
||||
int rb_integer_pack(VALUE val, void *words, size_t numwords, size_t wordsize, size_t nails, int flags);
|
||||
VALUE rb_integer_unpack(const void *words, size_t numwords, size_t wordsize, size_t nails, int flags);
|
||||
size_t rb_absint_size(VALUE val, int *nlz_bits_ret);
|
||||
size_t rb_absint_numwords(VALUE val, size_t word_numbits, size_t *nlz_bits_ret);
|
||||
int rb_absint_singlebit_p(VALUE val);
|
||||
|
||||
/* rational.c */
|
||||
VALUE rb_rational_raw(VALUE, VALUE);
|
||||
#define rb_rational_raw1(x) rb_rational_raw((x), INT2FIX(1))
|
||||
#define rb_rational_raw2(x,y) rb_rational_raw((x), (y))
|
||||
VALUE rb_rational_new(VALUE, VALUE);
|
||||
#define rb_rational_new1(x) rb_rational_new((x), INT2FIX(1))
|
||||
#define rb_rational_new2(x,y) rb_rational_new((x), (y))
|
||||
VALUE rb_Rational(VALUE, VALUE);
|
||||
#define rb_Rational1(x) rb_Rational((x), INT2FIX(1))
|
||||
#define rb_Rational2(x,y) rb_Rational((x), (y))
|
||||
VALUE rb_rational_num(VALUE rat);
|
||||
VALUE rb_rational_den(VALUE rat);
|
||||
VALUE rb_flt_rationalize_with_prec(VALUE, VALUE);
|
||||
VALUE rb_flt_rationalize(VALUE);
|
||||
/* complex.c */
|
||||
VALUE rb_complex_raw(VALUE, VALUE);
|
||||
#define rb_complex_raw1(x) rb_complex_raw((x), INT2FIX(0))
|
||||
#define rb_complex_raw2(x,y) rb_complex_raw((x), (y))
|
||||
VALUE rb_complex_new(VALUE, VALUE);
|
||||
#define rb_complex_new1(x) rb_complex_new((x), INT2FIX(0))
|
||||
#define rb_complex_new2(x,y) rb_complex_new((x), (y))
|
||||
VALUE rb_complex_polar(VALUE, VALUE);
|
||||
VALUE rb_Complex(VALUE, VALUE);
|
||||
#define rb_Complex1(x) rb_Complex((x), INT2FIX(0))
|
||||
#define rb_Complex2(x,y) rb_Complex((x), (y))
|
||||
DEPRECATED(VALUE rb_complex_set_real(VALUE, VALUE));
|
||||
DEPRECATED(VALUE rb_complex_set_imag(VALUE, VALUE));
|
||||
/* class.c */
|
||||
VALUE rb_class_boot(VALUE);
|
||||
VALUE rb_class_new(VALUE);
|
||||
VALUE rb_mod_init_copy(VALUE, VALUE);
|
||||
VALUE rb_singleton_class_clone(VALUE);
|
||||
void rb_singleton_class_attached(VALUE,VALUE);
|
||||
VALUE rb_make_metaclass(VALUE, VALUE);
|
||||
void rb_check_inheritable(VALUE);
|
||||
VALUE rb_class_inherited(VALUE, VALUE);
|
||||
VALUE rb_define_class_id(ID, VALUE);
|
||||
VALUE rb_define_class_id_under(VALUE, ID, VALUE);
|
||||
VALUE rb_module_new(void);
|
||||
VALUE rb_define_module_id(ID);
|
||||
VALUE rb_define_module_id_under(VALUE, ID);
|
||||
VALUE rb_include_class_new(VALUE, VALUE);
|
||||
VALUE rb_mod_included_modules(VALUE);
|
||||
VALUE rb_mod_include_p(VALUE, VALUE);
|
||||
VALUE rb_mod_ancestors(VALUE);
|
||||
VALUE rb_class_instance_methods(int, const VALUE*, VALUE);
|
||||
VALUE rb_class_public_instance_methods(int, const VALUE*, VALUE);
|
||||
VALUE rb_class_protected_instance_methods(int, const VALUE*, VALUE);
|
||||
VALUE rb_class_private_instance_methods(int, const VALUE*, VALUE);
|
||||
VALUE rb_obj_singleton_methods(int, const VALUE*, VALUE);
|
||||
void rb_define_method_id(VALUE, ID, VALUE (*)(ANYARGS), int);
|
||||
void rb_frozen_class_p(VALUE);
|
||||
void rb_undef(VALUE, ID);
|
||||
void rb_define_protected_method(VALUE, const char*, VALUE (*)(ANYARGS), int);
|
||||
void rb_define_private_method(VALUE, const char*, VALUE (*)(ANYARGS), int);
|
||||
void rb_define_singleton_method(VALUE, const char*, VALUE(*)(ANYARGS), int);
|
||||
VALUE rb_singleton_class(VALUE);
|
||||
/* compar.c */
|
||||
int rb_cmpint(VALUE, VALUE, VALUE);
|
||||
NORETURN(void rb_cmperr(VALUE, VALUE));
|
||||
/* cont.c */
|
||||
VALUE rb_fiber_new(VALUE (*)(ANYARGS), VALUE);
|
||||
VALUE rb_fiber_resume(VALUE fib, int argc, const VALUE *argv);
|
||||
VALUE rb_fiber_yield(int argc, const VALUE *argv);
|
||||
VALUE rb_fiber_current(void);
|
||||
VALUE rb_fiber_alive_p(VALUE);
|
||||
/* enum.c */
|
||||
VALUE rb_enum_values_pack(int, const VALUE*);
|
||||
/* enumerator.c */
|
||||
VALUE rb_enumeratorize(VALUE, VALUE, int, const VALUE *);
|
||||
typedef VALUE rb_enumerator_size_func(VALUE, VALUE, VALUE);
|
||||
VALUE rb_enumeratorize_with_size(VALUE, VALUE, int, const VALUE *, rb_enumerator_size_func *);
|
||||
#ifndef RUBY_EXPORT
|
||||
#define rb_enumeratorize_with_size(obj, id, argc, argv, size_fn) \
|
||||
rb_enumeratorize_with_size(obj, id, argc, argv, (rb_enumerator_size_func *)(size_fn))
|
||||
#endif
|
||||
#define SIZED_ENUMERATOR(obj, argc, argv, size_fn) \
|
||||
rb_enumeratorize_with_size((obj), ID2SYM(rb_frame_this_func()), \
|
||||
(argc), (argv), (size_fn))
|
||||
#define RETURN_SIZED_ENUMERATOR(obj, argc, argv, size_fn) do { \
|
||||
if (!rb_block_given_p()) \
|
||||
return SIZED_ENUMERATOR(obj, argc, argv, size_fn); \
|
||||
} while (0)
|
||||
#define RETURN_ENUMERATOR(obj, argc, argv) RETURN_SIZED_ENUMERATOR(obj, argc, argv, 0)
|
||||
/* error.c */
|
||||
VALUE rb_exc_new(VALUE, const char*, long);
|
||||
VALUE rb_exc_new_cstr(VALUE, const char*);
|
||||
VALUE rb_exc_new_str(VALUE, VALUE);
|
||||
#define rb_exc_new2 rb_exc_new_cstr
|
||||
#define rb_exc_new3 rb_exc_new_str
|
||||
PRINTF_ARGS(NORETURN(void rb_loaderror(const char*, ...)), 1, 2);
|
||||
PRINTF_ARGS(NORETURN(void rb_loaderror_with_path(VALUE path, const char*, ...)), 2, 3);
|
||||
PRINTF_ARGS(NORETURN(void rb_name_error(ID, const char*, ...)), 2, 3);
|
||||
PRINTF_ARGS(NORETURN(void rb_name_error_str(VALUE, const char*, ...)), 2, 3);
|
||||
NORETURN(void rb_invalid_str(const char*, const char*));
|
||||
PRINTF_ARGS(void rb_compile_error(const char*, int, const char*, ...), 3, 4);
|
||||
PRINTF_ARGS(void rb_compile_error_with_enc(const char*, int, void *, const char*, ...), 4, 5);
|
||||
PRINTF_ARGS(void rb_compile_error_append(const char*, ...), 1, 2);
|
||||
NORETURN(void rb_error_frozen(const char*));
|
||||
NORETURN(void rb_error_frozen_object(VALUE));
|
||||
void rb_error_untrusted(VALUE);
|
||||
void rb_check_frozen(VALUE);
|
||||
void rb_check_trusted(VALUE);
|
||||
#define rb_check_frozen_internal(obj) do { \
|
||||
VALUE frozen_obj = (obj); \
|
||||
if (OBJ_FROZEN(frozen_obj)) { \
|
||||
rb_error_frozen_object(frozen_obj); \
|
||||
} \
|
||||
} while (0)
|
||||
#define rb_check_trusted_internal(obj) ((void) 0)
|
||||
#ifdef __GNUC__
|
||||
#define rb_check_frozen(obj) __extension__({rb_check_frozen_internal(obj);})
|
||||
#define rb_check_trusted(obj) __extension__({rb_check_trusted_internal(obj);})
|
||||
#else
|
||||
static inline void
|
||||
rb_check_frozen_inline(VALUE obj)
|
||||
{
|
||||
rb_check_frozen_internal(obj);
|
||||
}
|
||||
#define rb_check_frozen(obj) rb_check_frozen_inline(obj)
|
||||
static inline void
|
||||
rb_check_trusted_inline(VALUE obj)
|
||||
{
|
||||
rb_check_trusted_internal(obj);
|
||||
}
|
||||
#define rb_check_trusted(obj) rb_check_trusted_inline(obj)
|
||||
#endif
|
||||
void rb_check_copyable(VALUE obj, VALUE orig);
|
||||
|
||||
#define OBJ_INIT_COPY(obj, orig) \
|
||||
((obj) != (orig) && (rb_obj_init_copy((obj), (orig)), 1))
|
||||
|
||||
/* eval.c */
|
||||
int rb_sourceline(void);
|
||||
const char *rb_sourcefile(void);
|
||||
VALUE rb_check_funcall(VALUE, ID, int, const VALUE*);
|
||||
|
||||
NORETURN(void rb_error_arity(int, int, int));
|
||||
#define rb_check_arity rb_check_arity /* for ifdef */
|
||||
static inline void
|
||||
rb_check_arity(int argc, int min, int max)
|
||||
{
|
||||
if ((argc < min) || (max != UNLIMITED_ARGUMENTS && argc > max))
|
||||
rb_error_arity(argc, min, max);
|
||||
}
|
||||
|
||||
#if defined(NFDBITS) && defined(HAVE_RB_FD_INIT)
|
||||
typedef struct {
|
||||
int maxfd;
|
||||
fd_set *fdset;
|
||||
} rb_fdset_t;
|
||||
|
||||
void rb_fd_init(rb_fdset_t *);
|
||||
void rb_fd_term(rb_fdset_t *);
|
||||
void rb_fd_zero(rb_fdset_t *);
|
||||
void rb_fd_set(int, rb_fdset_t *);
|
||||
void rb_fd_clr(int, rb_fdset_t *);
|
||||
int rb_fd_isset(int, const rb_fdset_t *);
|
||||
void rb_fd_copy(rb_fdset_t *, const fd_set *, int);
|
||||
void rb_fd_dup(rb_fdset_t *dst, const rb_fdset_t *src);
|
||||
|
||||
struct timeval;
|
||||
int rb_fd_select(int, rb_fdset_t *, rb_fdset_t *, rb_fdset_t *, struct timeval *);
|
||||
|
||||
#define rb_fd_ptr(f) ((f)->fdset)
|
||||
#define rb_fd_max(f) ((f)->maxfd)
|
||||
|
||||
#elif defined(_WIN32)
|
||||
|
||||
typedef struct {
|
||||
int capa;
|
||||
fd_set *fdset;
|
||||
} rb_fdset_t;
|
||||
|
||||
void rb_fd_init(rb_fdset_t *);
|
||||
void rb_fd_term(rb_fdset_t *);
|
||||
#define rb_fd_zero(f) ((f)->fdset->fd_count = 0)
|
||||
void rb_fd_set(int, rb_fdset_t *);
|
||||
#define rb_fd_clr(n, f) rb_w32_fdclr((n), (f)->fdset)
|
||||
#define rb_fd_isset(n, f) rb_w32_fdisset((n), (f)->fdset)
|
||||
#define rb_fd_copy(d, s, n) rb_w32_fd_copy((d), (s), (n))
|
||||
void rb_w32_fd_copy(rb_fdset_t *, const fd_set *, int);
|
||||
#define rb_fd_dup(d, s) rb_w32_fd_dup((d), (s))
|
||||
void rb_w32_fd_dup(rb_fdset_t *dst, const rb_fdset_t *src);
|
||||
#define rb_fd_select(n, rfds, wfds, efds, timeout) rb_w32_select((n), (rfds) ? ((rb_fdset_t*)(rfds))->fdset : NULL, (wfds) ? ((rb_fdset_t*)(wfds))->fdset : NULL, (efds) ? ((rb_fdset_t*)(efds))->fdset: NULL, (timeout))
|
||||
#define rb_fd_resize(n, f) ((void)(f))
|
||||
|
||||
#define rb_fd_ptr(f) ((f)->fdset)
|
||||
#define rb_fd_max(f) ((f)->fdset->fd_count)
|
||||
|
||||
#else
|
||||
|
||||
typedef fd_set rb_fdset_t;
|
||||
#define rb_fd_zero(f) FD_ZERO(f)
|
||||
#define rb_fd_set(n, f) FD_SET((n), (f))
|
||||
#define rb_fd_clr(n, f) FD_CLR((n), (f))
|
||||
#define rb_fd_isset(n, f) FD_ISSET((n), (f))
|
||||
#define rb_fd_copy(d, s, n) (*(d) = *(s))
|
||||
#define rb_fd_dup(d, s) (*(d) = *(s))
|
||||
#define rb_fd_resize(n, f) ((void)(f))
|
||||
#define rb_fd_ptr(f) (f)
|
||||
#define rb_fd_init(f) FD_ZERO(f)
|
||||
#define rb_fd_init_copy(d, s) (*(d) = *(s))
|
||||
#define rb_fd_term(f) ((void)(f))
|
||||
#define rb_fd_max(f) FD_SETSIZE
|
||||
#define rb_fd_select(n, rfds, wfds, efds, timeout) select((n), (rfds), (wfds), (efds), (timeout))
|
||||
|
||||
#endif
|
||||
|
||||
NORETURN(void rb_exc_raise(VALUE));
|
||||
NORETURN(void rb_exc_fatal(VALUE));
|
||||
VALUE rb_f_exit(int, const VALUE*);
|
||||
VALUE rb_f_abort(int, const VALUE*);
|
||||
void rb_remove_method(VALUE, const char*);
|
||||
void rb_remove_method_id(VALUE, ID);
|
||||
DEPRECATED(static inline void rb_disable_super(void));
|
||||
DEPRECATED(static inline void rb_enable_super(void));
|
||||
static inline void rb_disable_super(void)
|
||||
{
|
||||
/* obsolete - no use */
|
||||
}
|
||||
static inline void rb_enable_super(void)
|
||||
{
|
||||
rb_warning("rb_enable_super() is obsolete");
|
||||
}
|
||||
#define rb_disable_super(klass, name) rb_disable_super()
|
||||
#define rb_enable_super(klass, name) rb_enable_super()
|
||||
#define HAVE_RB_DEFINE_ALLOC_FUNC 1
|
||||
typedef VALUE (*rb_alloc_func_t)(VALUE);
|
||||
void rb_define_alloc_func(VALUE, rb_alloc_func_t);
|
||||
void rb_undef_alloc_func(VALUE);
|
||||
rb_alloc_func_t rb_get_alloc_func(VALUE);
|
||||
DEPRECATED(void rb_clear_cache(void));
|
||||
void rb_clear_constant_cache(void);
|
||||
void rb_clear_method_cache_by_class(VALUE);
|
||||
void rb_alias(VALUE, ID, ID);
|
||||
void rb_attr(VALUE,ID,int,int,int);
|
||||
int rb_method_boundp(VALUE, ID, int);
|
||||
int rb_method_basic_definition_p(VALUE, ID);
|
||||
VALUE rb_eval_cmd(VALUE, VALUE, int);
|
||||
int rb_obj_respond_to(VALUE, ID, int);
|
||||
int rb_respond_to(VALUE, ID);
|
||||
VALUE rb_f_notimplement(int argc, const VALUE *argv, VALUE obj);
|
||||
void rb_interrupt(void);
|
||||
VALUE rb_apply(VALUE, ID, VALUE);
|
||||
void rb_backtrace(void);
|
||||
ID rb_frame_this_func(void);
|
||||
VALUE rb_obj_instance_eval(int, const VALUE*, VALUE);
|
||||
VALUE rb_obj_instance_exec(int, const VALUE*, VALUE);
|
||||
VALUE rb_mod_module_eval(int, const VALUE*, VALUE);
|
||||
VALUE rb_mod_module_exec(int, const VALUE*, VALUE);
|
||||
void rb_load(VALUE, int);
|
||||
void rb_load_protect(VALUE, int, int*);
|
||||
NORETURN(void rb_jump_tag(int));
|
||||
int rb_provided(const char*);
|
||||
int rb_feature_provided(const char *, const char **);
|
||||
void rb_provide(const char*);
|
||||
VALUE rb_f_require(VALUE, VALUE);
|
||||
VALUE rb_require_safe(VALUE, int);
|
||||
void rb_obj_call_init(VALUE, int, const VALUE*);
|
||||
VALUE rb_class_new_instance(int, const VALUE*, VALUE);
|
||||
VALUE rb_block_proc(void);
|
||||
VALUE rb_block_lambda(void);
|
||||
VALUE rb_proc_new(VALUE (*)(ANYARGS/* VALUE yieldarg[, VALUE procarg] */), VALUE);
|
||||
VALUE rb_obj_is_proc(VALUE);
|
||||
VALUE rb_proc_call(VALUE, VALUE);
|
||||
VALUE rb_proc_call_with_block(VALUE, int argc, const VALUE *argv, VALUE);
|
||||
int rb_proc_arity(VALUE);
|
||||
VALUE rb_proc_lambda_p(VALUE);
|
||||
VALUE rb_binding_new(void);
|
||||
VALUE rb_obj_method(VALUE, VALUE);
|
||||
VALUE rb_obj_is_method(VALUE);
|
||||
VALUE rb_method_call(int, const VALUE*, VALUE);
|
||||
VALUE rb_method_call_with_block(int, const VALUE *, VALUE, VALUE);
|
||||
int rb_mod_method_arity(VALUE, ID);
|
||||
int rb_obj_method_arity(VALUE, ID);
|
||||
VALUE rb_protect(VALUE (*)(VALUE), VALUE, int*);
|
||||
void rb_set_end_proc(void (*)(VALUE), VALUE);
|
||||
void rb_exec_end_proc(void);
|
||||
void rb_thread_schedule(void);
|
||||
void rb_thread_wait_fd(int);
|
||||
int rb_thread_fd_writable(int);
|
||||
void rb_thread_fd_close(int);
|
||||
int rb_thread_alone(void);
|
||||
void rb_thread_sleep(int);
|
||||
void rb_thread_sleep_forever(void);
|
||||
void rb_thread_sleep_deadly(void);
|
||||
VALUE rb_thread_stop(void);
|
||||
VALUE rb_thread_wakeup(VALUE);
|
||||
VALUE rb_thread_wakeup_alive(VALUE);
|
||||
VALUE rb_thread_run(VALUE);
|
||||
VALUE rb_thread_kill(VALUE);
|
||||
VALUE rb_thread_create(VALUE (*)(ANYARGS), void*);
|
||||
int rb_thread_fd_select(int, rb_fdset_t *, rb_fdset_t *, rb_fdset_t *, struct timeval *);
|
||||
void rb_thread_wait_for(struct timeval);
|
||||
VALUE rb_thread_current(void);
|
||||
VALUE rb_thread_main(void);
|
||||
VALUE rb_thread_local_aref(VALUE, ID);
|
||||
VALUE rb_thread_local_aset(VALUE, ID, VALUE);
|
||||
void rb_thread_atfork(void);
|
||||
void rb_thread_atfork_before_exec(void);
|
||||
VALUE rb_exec_recursive(VALUE(*)(VALUE, VALUE, int),VALUE,VALUE);
|
||||
VALUE rb_exec_recursive_paired(VALUE(*)(VALUE, VALUE, int),VALUE,VALUE,VALUE);
|
||||
VALUE rb_exec_recursive_outer(VALUE(*)(VALUE, VALUE, int),VALUE,VALUE);
|
||||
VALUE rb_exec_recursive_paired_outer(VALUE(*)(VALUE, VALUE, int),VALUE,VALUE,VALUE);
|
||||
/* dir.c */
|
||||
VALUE rb_dir_getwd(void);
|
||||
/* file.c */
|
||||
VALUE rb_file_s_expand_path(int, const VALUE *);
|
||||
VALUE rb_file_expand_path(VALUE, VALUE);
|
||||
VALUE rb_file_s_absolute_path(int, const VALUE *);
|
||||
VALUE rb_file_absolute_path(VALUE, VALUE);
|
||||
VALUE rb_file_dirname(VALUE fname);
|
||||
int rb_find_file_ext_safe(VALUE*, const char* const*, int);
|
||||
VALUE rb_find_file_safe(VALUE, int);
|
||||
int rb_find_file_ext(VALUE*, const char* const*);
|
||||
VALUE rb_find_file(VALUE);
|
||||
VALUE rb_file_directory_p(VALUE,VALUE);
|
||||
VALUE rb_str_encode_ospath(VALUE);
|
||||
int rb_is_absolute_path(const char *);
|
||||
/* gc.c */
|
||||
NORETURN(void rb_memerror(void));
|
||||
int rb_during_gc(void);
|
||||
void rb_gc_mark_locations(const VALUE*, const VALUE*);
|
||||
void rb_mark_tbl(struct st_table*);
|
||||
void rb_mark_set(struct st_table*);
|
||||
void rb_mark_hash(struct st_table*);
|
||||
void rb_gc_mark_maybe(VALUE);
|
||||
void rb_gc_mark(VALUE);
|
||||
void rb_gc_force_recycle(VALUE);
|
||||
void rb_gc(void);
|
||||
void rb_gc_copy_finalizer(VALUE,VALUE);
|
||||
void rb_gc_finalize_deferred(void);
|
||||
void rb_gc_call_finalizer_at_exit(void);
|
||||
VALUE rb_gc_enable(void);
|
||||
VALUE rb_gc_disable(void);
|
||||
VALUE rb_gc_start(void);
|
||||
VALUE rb_define_finalizer(VALUE, VALUE);
|
||||
VALUE rb_undefine_finalizer(VALUE);
|
||||
size_t rb_gc_count(void);
|
||||
size_t rb_gc_stat(VALUE);
|
||||
VALUE rb_gc_latest_gc_info(VALUE);
|
||||
/* hash.c */
|
||||
void st_foreach_safe(struct st_table *, int (*)(ANYARGS), st_data_t);
|
||||
VALUE rb_check_hash_type(VALUE);
|
||||
void rb_hash_foreach(VALUE, int (*)(ANYARGS), VALUE);
|
||||
VALUE rb_hash(VALUE);
|
||||
VALUE rb_hash_new(void);
|
||||
VALUE rb_hash_dup(VALUE);
|
||||
VALUE rb_hash_freeze(VALUE);
|
||||
VALUE rb_hash_aref(VALUE, VALUE);
|
||||
VALUE rb_hash_lookup(VALUE, VALUE);
|
||||
VALUE rb_hash_lookup2(VALUE, VALUE, VALUE);
|
||||
VALUE rb_hash_fetch(VALUE, VALUE);
|
||||
VALUE rb_hash_aset(VALUE, VALUE, VALUE);
|
||||
VALUE rb_hash_clear(VALUE);
|
||||
VALUE rb_hash_delete_if(VALUE);
|
||||
VALUE rb_hash_delete(VALUE,VALUE);
|
||||
VALUE rb_hash_set_ifnone(VALUE hash, VALUE ifnone);
|
||||
typedef VALUE rb_hash_update_func(VALUE newkey, VALUE oldkey, VALUE value);
|
||||
VALUE rb_hash_update_by(VALUE hash1, VALUE hash2, rb_hash_update_func *func);
|
||||
struct st_table *rb_hash_tbl(VALUE);
|
||||
int rb_path_check(const char*);
|
||||
int rb_env_path_tainted(void);
|
||||
VALUE rb_env_clear(void);
|
||||
VALUE rb_hash_size(VALUE);
|
||||
DEPRECATED(int rb_hash_iter_lev(VALUE));
|
||||
DEPRECATED(VALUE rb_hash_ifnone(VALUE));
|
||||
/* io.c */
|
||||
#define rb_defout rb_stdout
|
||||
RUBY_EXTERN VALUE rb_fs;
|
||||
RUBY_EXTERN VALUE rb_output_fs;
|
||||
RUBY_EXTERN VALUE rb_rs;
|
||||
RUBY_EXTERN VALUE rb_default_rs;
|
||||
RUBY_EXTERN VALUE rb_output_rs;
|
||||
VALUE rb_io_write(VALUE, VALUE);
|
||||
VALUE rb_io_gets(VALUE);
|
||||
VALUE rb_io_getbyte(VALUE);
|
||||
VALUE rb_io_ungetc(VALUE, VALUE);
|
||||
VALUE rb_io_ungetbyte(VALUE, VALUE);
|
||||
VALUE rb_io_close(VALUE);
|
||||
VALUE rb_io_flush(VALUE);
|
||||
VALUE rb_io_eof(VALUE);
|
||||
VALUE rb_io_binmode(VALUE);
|
||||
VALUE rb_io_ascii8bit_binmode(VALUE);
|
||||
VALUE rb_io_addstr(VALUE, VALUE);
|
||||
VALUE rb_io_printf(int, const VALUE*, VALUE);
|
||||
VALUE rb_io_print(int, const VALUE*, VALUE);
|
||||
VALUE rb_io_puts(int, const VALUE*, VALUE);
|
||||
VALUE rb_io_fdopen(int, int, const char*);
|
||||
VALUE rb_io_get_io(VALUE);
|
||||
VALUE rb_file_open(const char*, const char*);
|
||||
VALUE rb_file_open_str(VALUE, const char*);
|
||||
VALUE rb_gets(void);
|
||||
void rb_write_error(const char*);
|
||||
void rb_write_error2(const char*, long);
|
||||
void rb_close_before_exec(int lowfd, int maxhint, VALUE noclose_fds);
|
||||
int rb_pipe(int *pipes);
|
||||
int rb_reserved_fd_p(int fd);
|
||||
int rb_cloexec_open(const char *pathname, int flags, mode_t mode);
|
||||
int rb_cloexec_dup(int oldfd);
|
||||
int rb_cloexec_dup2(int oldfd, int newfd);
|
||||
int rb_cloexec_pipe(int fildes[2]);
|
||||
int rb_cloexec_fcntl_dupfd(int fd, int minfd);
|
||||
#define RB_RESERVED_FD_P(fd) rb_reserved_fd_p(fd)
|
||||
void rb_update_max_fd(int fd);
|
||||
void rb_fd_fix_cloexec(int fd);
|
||||
/* marshal.c */
|
||||
VALUE rb_marshal_dump(VALUE, VALUE);
|
||||
VALUE rb_marshal_load(VALUE);
|
||||
void rb_marshal_define_compat(VALUE newclass, VALUE oldclass, VALUE (*dumper)(VALUE), VALUE (*loader)(VALUE, VALUE));
|
||||
/* numeric.c */
|
||||
NORETURN(void rb_num_zerodiv(void));
|
||||
#define RB_NUM_COERCE_FUNCS_NEED_OPID 1
|
||||
VALUE rb_num_coerce_bin(VALUE, VALUE, ID);
|
||||
VALUE rb_num_coerce_cmp(VALUE, VALUE, ID);
|
||||
VALUE rb_num_coerce_relop(VALUE, VALUE, ID);
|
||||
VALUE rb_num_coerce_bit(VALUE, VALUE, ID);
|
||||
VALUE rb_num2fix(VALUE);
|
||||
VALUE rb_fix2str(VALUE, int);
|
||||
VALUE rb_dbl_cmp(double, double);
|
||||
/* object.c */
|
||||
int rb_eql(VALUE, VALUE);
|
||||
VALUE rb_any_to_s(VALUE);
|
||||
VALUE rb_inspect(VALUE);
|
||||
VALUE rb_obj_is_instance_of(VALUE, VALUE);
|
||||
VALUE rb_obj_is_kind_of(VALUE, VALUE);
|
||||
VALUE rb_obj_alloc(VALUE);
|
||||
VALUE rb_obj_clone(VALUE);
|
||||
VALUE rb_obj_dup(VALUE);
|
||||
VALUE rb_obj_init_copy(VALUE,VALUE);
|
||||
VALUE rb_obj_taint(VALUE);
|
||||
VALUE rb_obj_tainted(VALUE);
|
||||
VALUE rb_obj_untaint(VALUE);
|
||||
VALUE rb_obj_untrust(VALUE);
|
||||
VALUE rb_obj_untrusted(VALUE);
|
||||
VALUE rb_obj_trust(VALUE);
|
||||
VALUE rb_obj_freeze(VALUE);
|
||||
VALUE rb_obj_frozen_p(VALUE);
|
||||
VALUE rb_obj_id(VALUE);
|
||||
VALUE rb_obj_class(VALUE);
|
||||
VALUE rb_class_real(VALUE);
|
||||
VALUE rb_class_inherited_p(VALUE, VALUE);
|
||||
VALUE rb_class_superclass(VALUE);
|
||||
VALUE rb_class_get_superclass(VALUE);
|
||||
VALUE rb_convert_type(VALUE,int,const char*,const char*);
|
||||
VALUE rb_check_convert_type(VALUE,int,const char*,const char*);
|
||||
VALUE rb_check_to_integer(VALUE, const char *);
|
||||
VALUE rb_check_to_float(VALUE);
|
||||
VALUE rb_to_int(VALUE);
|
||||
VALUE rb_check_to_int(VALUE);
|
||||
VALUE rb_Integer(VALUE);
|
||||
VALUE rb_to_float(VALUE);
|
||||
VALUE rb_Float(VALUE);
|
||||
VALUE rb_String(VALUE);
|
||||
VALUE rb_Array(VALUE);
|
||||
VALUE rb_Hash(VALUE);
|
||||
double rb_cstr_to_dbl(const char*, int);
|
||||
double rb_str_to_dbl(VALUE, int);
|
||||
/* parse.y */
|
||||
RUBY_EXTERN int ruby_sourceline;
|
||||
RUBY_EXTERN char *ruby_sourcefile;
|
||||
ID rb_id_attrset(ID);
|
||||
int rb_is_const_id(ID);
|
||||
int rb_is_global_id(ID);
|
||||
int rb_is_instance_id(ID);
|
||||
int rb_is_attrset_id(ID);
|
||||
int rb_is_class_id(ID);
|
||||
int rb_is_local_id(ID);
|
||||
int rb_is_junk_id(ID);
|
||||
int rb_symname_p(const char*);
|
||||
int rb_sym_interned_p(VALUE);
|
||||
VALUE rb_backref_get(void);
|
||||
void rb_backref_set(VALUE);
|
||||
VALUE rb_lastline_get(void);
|
||||
void rb_lastline_set(VALUE);
|
||||
VALUE rb_sym_all_symbols(void);
|
||||
/* process.c */
|
||||
void rb_last_status_set(int status, rb_pid_t pid);
|
||||
VALUE rb_last_status_get(void);
|
||||
int rb_proc_exec(const char*);
|
||||
VALUE rb_f_exec(int, const VALUE*);
|
||||
rb_pid_t rb_waitpid(rb_pid_t pid, int *status, int flags);
|
||||
void rb_syswait(rb_pid_t pid);
|
||||
rb_pid_t rb_spawn(int, const VALUE*);
|
||||
rb_pid_t rb_spawn_err(int, const VALUE*, char*, size_t);
|
||||
VALUE rb_proc_times(VALUE);
|
||||
VALUE rb_detach_process(rb_pid_t pid);
|
||||
/* range.c */
|
||||
VALUE rb_range_new(VALUE, VALUE, int);
|
||||
VALUE rb_range_beg_len(VALUE, long*, long*, long, int);
|
||||
int rb_range_values(VALUE range, VALUE *begp, VALUE *endp, int *exclp);
|
||||
/* random.c */
|
||||
unsigned int rb_genrand_int32(void);
|
||||
double rb_genrand_real(void);
|
||||
void rb_reset_random_seed(void);
|
||||
VALUE rb_random_bytes(VALUE rnd, long n);
|
||||
VALUE rb_random_int(VALUE rnd, VALUE max);
|
||||
unsigned int rb_random_int32(VALUE rnd);
|
||||
double rb_random_real(VALUE rnd);
|
||||
unsigned long rb_random_ulong_limited(VALUE rnd, unsigned long limit);
|
||||
unsigned long rb_genrand_ulong_limited(unsigned long i);
|
||||
/* re.c */
|
||||
#define rb_memcmp memcmp
|
||||
int rb_memcicmp(const void*,const void*,long);
|
||||
void rb_match_busy(VALUE);
|
||||
VALUE rb_reg_nth_defined(int, VALUE);
|
||||
VALUE rb_reg_nth_match(int, VALUE);
|
||||
int rb_reg_backref_number(VALUE match, VALUE backref);
|
||||
VALUE rb_reg_last_match(VALUE);
|
||||
VALUE rb_reg_match_pre(VALUE);
|
||||
VALUE rb_reg_match_post(VALUE);
|
||||
VALUE rb_reg_match_last(VALUE);
|
||||
#define HAVE_RB_REG_NEW_STR 1
|
||||
VALUE rb_reg_new_str(VALUE, int);
|
||||
VALUE rb_reg_new(const char *, long, int);
|
||||
VALUE rb_reg_alloc(void);
|
||||
VALUE rb_reg_init_str(VALUE re, VALUE s, int options);
|
||||
VALUE rb_reg_match(VALUE, VALUE);
|
||||
VALUE rb_reg_match2(VALUE);
|
||||
int rb_reg_options(VALUE);
|
||||
/* ruby.c */
|
||||
#define rb_argv rb_get_argv()
|
||||
RUBY_EXTERN VALUE rb_argv0;
|
||||
VALUE rb_get_argv(void);
|
||||
void *rb_load_file(const char*);
|
||||
void *rb_load_file_str(VALUE);
|
||||
/* signal.c */
|
||||
VALUE rb_f_kill(int, const VALUE*);
|
||||
#ifdef POSIX_SIGNAL
|
||||
#define posix_signal ruby_posix_signal
|
||||
RETSIGTYPE (*posix_signal(int, RETSIGTYPE (*)(int)))(int);
|
||||
#endif
|
||||
void rb_trap_exit(void);
|
||||
void rb_trap_exec(void);
|
||||
const char *ruby_signal_name(int);
|
||||
void ruby_default_signal(int);
|
||||
/* sprintf.c */
|
||||
VALUE rb_f_sprintf(int, const VALUE*);
|
||||
PRINTF_ARGS(VALUE rb_sprintf(const char*, ...), 1, 2);
|
||||
VALUE rb_vsprintf(const char*, va_list);
|
||||
PRINTF_ARGS(VALUE rb_str_catf(VALUE, const char*, ...), 2, 3);
|
||||
VALUE rb_str_vcatf(VALUE, const char*, va_list);
|
||||
VALUE rb_str_format(int, const VALUE *, VALUE);
|
||||
/* string.c */
|
||||
VALUE rb_str_new(const char*, long);
|
||||
VALUE rb_str_new_cstr(const char*);
|
||||
VALUE rb_str_new_shared(VALUE);
|
||||
VALUE rb_str_new_frozen(VALUE);
|
||||
VALUE rb_str_new_with_class(VALUE, const char*, long);
|
||||
VALUE rb_tainted_str_new_cstr(const char*);
|
||||
VALUE rb_tainted_str_new(const char*, long);
|
||||
VALUE rb_external_str_new(const char*, long);
|
||||
VALUE rb_external_str_new_cstr(const char*);
|
||||
VALUE rb_locale_str_new(const char*, long);
|
||||
VALUE rb_locale_str_new_cstr(const char*);
|
||||
VALUE rb_filesystem_str_new(const char*, long);
|
||||
VALUE rb_filesystem_str_new_cstr(const char*);
|
||||
VALUE rb_str_buf_new(long);
|
||||
VALUE rb_str_buf_new_cstr(const char*);
|
||||
VALUE rb_str_buf_new2(const char*);
|
||||
VALUE rb_str_tmp_new(long);
|
||||
VALUE rb_usascii_str_new(const char*, long);
|
||||
VALUE rb_usascii_str_new_cstr(const char*);
|
||||
VALUE rb_utf8_str_new(const char*, long);
|
||||
VALUE rb_utf8_str_new_cstr(const char*);
|
||||
VALUE rb_str_new_static(const char *, long);
|
||||
VALUE rb_usascii_str_new_static(const char *, long);
|
||||
VALUE rb_utf8_str_new_static(const char *, long);
|
||||
void rb_str_free(VALUE);
|
||||
void rb_str_shared_replace(VALUE, VALUE);
|
||||
VALUE rb_str_buf_append(VALUE, VALUE);
|
||||
VALUE rb_str_buf_cat(VALUE, const char*, long);
|
||||
VALUE rb_str_buf_cat2(VALUE, const char*);
|
||||
VALUE rb_str_buf_cat_ascii(VALUE, const char*);
|
||||
VALUE rb_obj_as_string(VALUE);
|
||||
VALUE rb_check_string_type(VALUE);
|
||||
void rb_must_asciicompat(VALUE);
|
||||
VALUE rb_str_dup(VALUE);
|
||||
VALUE rb_str_resurrect(VALUE str);
|
||||
VALUE rb_str_locktmp(VALUE);
|
||||
VALUE rb_str_unlocktmp(VALUE);
|
||||
VALUE rb_str_dup_frozen(VALUE);
|
||||
#define rb_str_dup_frozen rb_str_new_frozen
|
||||
VALUE rb_str_plus(VALUE, VALUE);
|
||||
VALUE rb_str_times(VALUE, VALUE);
|
||||
long rb_str_sublen(VALUE, long);
|
||||
VALUE rb_str_substr(VALUE, long, long);
|
||||
VALUE rb_str_subseq(VALUE, long, long);
|
||||
char *rb_str_subpos(VALUE, long, long*);
|
||||
void rb_str_modify(VALUE);
|
||||
void rb_str_modify_expand(VALUE, long);
|
||||
VALUE rb_str_freeze(VALUE);
|
||||
void rb_str_set_len(VALUE, long);
|
||||
VALUE rb_str_resize(VALUE, long);
|
||||
VALUE rb_str_cat(VALUE, const char*, long);
|
||||
VALUE rb_str_cat_cstr(VALUE, const char*);
|
||||
VALUE rb_str_cat2(VALUE, const char*);
|
||||
VALUE rb_str_append(VALUE, VALUE);
|
||||
VALUE rb_str_concat(VALUE, VALUE);
|
||||
st_index_t rb_memhash(const void *ptr, long len);
|
||||
st_index_t rb_hash_start(st_index_t);
|
||||
st_index_t rb_hash_uint32(st_index_t, uint32_t);
|
||||
st_index_t rb_hash_uint(st_index_t, st_index_t);
|
||||
st_index_t rb_hash_end(st_index_t);
|
||||
#define rb_hash_uint32(h, i) st_hash_uint32((h), (i))
|
||||
#define rb_hash_uint(h, i) st_hash_uint((h), (i))
|
||||
#define rb_hash_end(h) st_hash_end(h)
|
||||
st_index_t rb_str_hash(VALUE);
|
||||
int rb_str_hash_cmp(VALUE,VALUE);
|
||||
int rb_str_comparable(VALUE, VALUE);
|
||||
int rb_str_cmp(VALUE, VALUE);
|
||||
VALUE rb_str_equal(VALUE str1, VALUE str2);
|
||||
VALUE rb_str_drop_bytes(VALUE, long);
|
||||
void rb_str_update(VALUE, long, long, VALUE);
|
||||
VALUE rb_str_replace(VALUE, VALUE);
|
||||
VALUE rb_str_inspect(VALUE);
|
||||
VALUE rb_str_dump(VALUE);
|
||||
VALUE rb_str_split(VALUE, const char*);
|
||||
DEPRECATED(void rb_str_associate(VALUE, VALUE));
|
||||
DEPRECATED(VALUE rb_str_associated(VALUE));
|
||||
void rb_str_setter(VALUE, ID, VALUE*);
|
||||
VALUE rb_str_intern(VALUE);
|
||||
VALUE rb_sym_to_s(VALUE);
|
||||
long rb_str_strlen(VALUE);
|
||||
VALUE rb_str_length(VALUE);
|
||||
long rb_str_offset(VALUE, long);
|
||||
size_t rb_str_capacity(VALUE);
|
||||
VALUE rb_str_ellipsize(VALUE, long);
|
||||
VALUE rb_str_scrub(VALUE, VALUE);
|
||||
|
||||
#if defined(__GNUC__) && !defined(__PCC__)
|
||||
#define rb_str_new(str, len) __extension__ ( \
|
||||
{ \
|
||||
(__builtin_constant_p(str) && __builtin_constant_p(len)) ? \
|
||||
rb_str_new_static((str), (len)) : \
|
||||
rb_str_new((str), (len)); \
|
||||
})
|
||||
#define rb_str_new_cstr(str) __extension__ ( \
|
||||
{ \
|
||||
(__builtin_constant_p(str)) ? \
|
||||
rb_str_new_static((str), (long)strlen(str)) : \
|
||||
rb_str_new_cstr(str); \
|
||||
})
|
||||
#define rb_usascii_str_new(str, len) __extension__ ( \
|
||||
{ \
|
||||
(__builtin_constant_p(str) && __builtin_constant_p(len)) ? \
|
||||
rb_usascii_str_new_static((str), (len)) : \
|
||||
rb_usascii_str_new((str), (len)); \
|
||||
})
|
||||
#define rb_utf8_str_new(str, len) __extension__ ( \
|
||||
{ \
|
||||
(__builtin_constant_p(str) && __builtin_constant_p(len)) ? \
|
||||
rb_utf8_str_new_static((str), (len)) : \
|
||||
rb_utf8_str_new((str), (len)); \
|
||||
})
|
||||
#define rb_tainted_str_new_cstr(str) __extension__ ( \
|
||||
{ \
|
||||
(__builtin_constant_p(str)) ? \
|
||||
rb_tainted_str_new((str), (long)strlen(str)) : \
|
||||
rb_tainted_str_new_cstr(str); \
|
||||
})
|
||||
#define rb_usascii_str_new_cstr(str) __extension__ ( \
|
||||
{ \
|
||||
(__builtin_constant_p(str)) ? \
|
||||
rb_usascii_str_new_static((str), (long)strlen(str)) : \
|
||||
rb_usascii_str_new_cstr(str); \
|
||||
})
|
||||
#define rb_utf8_str_new_cstr(str) __extension__ ( \
|
||||
{ \
|
||||
(__builtin_constant_p(str)) ? \
|
||||
rb_utf8_str_new_static((str), (long)strlen(str)) : \
|
||||
rb_utf8_str_new_cstr(str); \
|
||||
})
|
||||
#define rb_str_new_literal(str) rb_str_new_static((str), sizeof(str)-1)
|
||||
#define rb_usascii_str_new_literal(str) rb_usascii_str_new_static((str), sizeof(str)-1)
|
||||
#define rb_utf8_str_new_literal(str) rb_utf8_str_new_static((str), sizeof(str)-1)
|
||||
#define rb_enc_str_new_literal(str, enc) rb_enc_str_new_static((str), sizeof(str)-1, (enc))
|
||||
#define rb_external_str_new_cstr(str) __extension__ ( \
|
||||
{ \
|
||||
(__builtin_constant_p(str)) ? \
|
||||
rb_external_str_new((str), (long)strlen(str)) : \
|
||||
rb_external_str_new_cstr(str); \
|
||||
})
|
||||
#define rb_locale_str_new_cstr(str) __extension__ ( \
|
||||
{ \
|
||||
(__builtin_constant_p(str)) ? \
|
||||
rb_locale_str_new((str), (long)strlen(str)) : \
|
||||
rb_locale_str_new_cstr(str); \
|
||||
})
|
||||
#define rb_str_buf_new_cstr(str) __extension__ ( \
|
||||
{ \
|
||||
(__builtin_constant_p(str)) ? \
|
||||
rb_str_buf_cat(rb_str_buf_new((long)strlen(str)), \
|
||||
(str), (long)strlen(str)) : \
|
||||
rb_str_buf_new_cstr(str); \
|
||||
})
|
||||
#define rb_str_cat_cstr(str, ptr) __extension__ ( \
|
||||
{ \
|
||||
(__builtin_constant_p(ptr)) ? \
|
||||
rb_str_cat((str), (ptr), (long)strlen(ptr)) : \
|
||||
rb_str_cat_cstr((str), (ptr)); \
|
||||
})
|
||||
#define rb_exc_new_cstr(klass, ptr) __extension__ ( \
|
||||
{ \
|
||||
(__builtin_constant_p(ptr)) ? \
|
||||
rb_exc_new((klass), (ptr), (long)strlen(ptr)) : \
|
||||
rb_exc_new_cstr((klass), (ptr)); \
|
||||
})
|
||||
#endif
|
||||
#define rb_str_new2 rb_str_new_cstr
|
||||
#define rb_str_new3 rb_str_new_shared
|
||||
#define rb_str_new4 rb_str_new_frozen
|
||||
#define rb_str_new5 rb_str_new_with_class
|
||||
#define rb_tainted_str_new2 rb_tainted_str_new_cstr
|
||||
#define rb_str_buf_new2 rb_str_buf_new_cstr
|
||||
#define rb_usascii_str_new2 rb_usascii_str_new_cstr
|
||||
#define rb_str_buf_cat rb_str_cat
|
||||
#define rb_str_buf_cat2 rb_str_cat_cstr
|
||||
#define rb_str_cat2 rb_str_cat_cstr
|
||||
/* struct.c */
|
||||
VALUE rb_struct_new(VALUE, ...);
|
||||
VALUE rb_struct_define(const char*, ...);
|
||||
VALUE rb_struct_define_under(VALUE, const char*, ...);
|
||||
VALUE rb_struct_alloc(VALUE, VALUE);
|
||||
VALUE rb_struct_initialize(VALUE, VALUE);
|
||||
VALUE rb_struct_aref(VALUE, VALUE);
|
||||
VALUE rb_struct_aset(VALUE, VALUE, VALUE);
|
||||
VALUE rb_struct_getmember(VALUE, ID);
|
||||
VALUE rb_struct_s_members(VALUE);
|
||||
VALUE rb_struct_members(VALUE);
|
||||
VALUE rb_struct_alloc_noinit(VALUE);
|
||||
VALUE rb_struct_define_without_accessor(const char *, VALUE, rb_alloc_func_t, ...);
|
||||
VALUE rb_struct_define_without_accessor_under(VALUE outer, const char *class_name, VALUE super, rb_alloc_func_t alloc, ...);
|
||||
|
||||
/* thread.c */
|
||||
typedef void rb_unblock_function_t(void *);
|
||||
typedef VALUE rb_blocking_function_t(void *);
|
||||
void rb_thread_check_ints(void);
|
||||
int rb_thread_interrupted(VALUE thval);
|
||||
|
||||
#define RUBY_UBF_IO ((rb_unblock_function_t *)-1)
|
||||
#define RUBY_UBF_PROCESS ((rb_unblock_function_t *)-1)
|
||||
VALUE rb_mutex_new(void);
|
||||
VALUE rb_mutex_locked_p(VALUE mutex);
|
||||
VALUE rb_mutex_trylock(VALUE mutex);
|
||||
VALUE rb_mutex_lock(VALUE mutex);
|
||||
VALUE rb_mutex_unlock(VALUE mutex);
|
||||
VALUE rb_mutex_sleep(VALUE self, VALUE timeout);
|
||||
VALUE rb_mutex_synchronize(VALUE mutex, VALUE (*func)(VALUE arg), VALUE arg);
|
||||
/* time.c */
|
||||
VALUE rb_time_new(time_t, long);
|
||||
VALUE rb_time_nano_new(time_t, long);
|
||||
VALUE rb_time_num_new(VALUE, VALUE);
|
||||
struct timeval rb_time_interval(VALUE num);
|
||||
struct timeval rb_time_timeval(VALUE time);
|
||||
struct timespec rb_time_timespec(VALUE time);
|
||||
/* variable.c */
|
||||
VALUE rb_mod_name(VALUE);
|
||||
VALUE rb_class_path(VALUE);
|
||||
VALUE rb_class_path_cached(VALUE);
|
||||
void rb_set_class_path(VALUE, VALUE, const char*);
|
||||
void rb_set_class_path_string(VALUE, VALUE, VALUE);
|
||||
VALUE rb_path_to_class(VALUE);
|
||||
VALUE rb_path2class(const char*);
|
||||
void rb_name_class(VALUE, ID);
|
||||
VALUE rb_class_name(VALUE);
|
||||
void rb_autoload(VALUE, ID, const char*);
|
||||
VALUE rb_autoload_load(VALUE, ID);
|
||||
VALUE rb_autoload_p(VALUE, ID);
|
||||
VALUE rb_f_trace_var(int, const VALUE*);
|
||||
VALUE rb_f_untrace_var(int, const VALUE*);
|
||||
VALUE rb_f_global_variables(void);
|
||||
void rb_alias_variable(ID, ID);
|
||||
struct st_table* rb_generic_ivar_table(VALUE);
|
||||
void rb_copy_generic_ivar(VALUE,VALUE);
|
||||
void rb_free_generic_ivar(VALUE);
|
||||
VALUE rb_ivar_get(VALUE, ID);
|
||||
VALUE rb_ivar_set(VALUE, ID, VALUE);
|
||||
VALUE rb_ivar_defined(VALUE, ID);
|
||||
void rb_ivar_foreach(VALUE, int (*)(ANYARGS), st_data_t);
|
||||
st_index_t rb_ivar_count(VALUE);
|
||||
VALUE rb_attr_get(VALUE, ID);
|
||||
VALUE rb_obj_instance_variables(VALUE);
|
||||
VALUE rb_obj_remove_instance_variable(VALUE, VALUE);
|
||||
void *rb_mod_const_at(VALUE, void*);
|
||||
void *rb_mod_const_of(VALUE, void*);
|
||||
VALUE rb_const_list(void*);
|
||||
VALUE rb_mod_constants(int, const VALUE *, VALUE);
|
||||
VALUE rb_mod_remove_const(VALUE, VALUE);
|
||||
int rb_const_defined(VALUE, ID);
|
||||
int rb_const_defined_at(VALUE, ID);
|
||||
int rb_const_defined_from(VALUE, ID);
|
||||
VALUE rb_const_get(VALUE, ID);
|
||||
VALUE rb_const_get_at(VALUE, ID);
|
||||
VALUE rb_const_get_from(VALUE, ID);
|
||||
void rb_const_set(VALUE, ID, VALUE);
|
||||
VALUE rb_const_remove(VALUE, ID);
|
||||
VALUE rb_mod_const_missing(VALUE,VALUE);
|
||||
VALUE rb_cvar_defined(VALUE, ID);
|
||||
void rb_cvar_set(VALUE, ID, VALUE);
|
||||
VALUE rb_cvar_get(VALUE, ID);
|
||||
void rb_cv_set(VALUE, const char*, VALUE);
|
||||
VALUE rb_cv_get(VALUE, const char*);
|
||||
void rb_define_class_variable(VALUE, const char*, VALUE);
|
||||
VALUE rb_mod_class_variables(int, const VALUE*, VALUE);
|
||||
VALUE rb_mod_remove_cvar(VALUE, VALUE);
|
||||
|
||||
ID rb_frame_callee(void);
|
||||
VALUE rb_str_succ(VALUE);
|
||||
VALUE rb_time_succ(VALUE);
|
||||
int rb_frame_method_id_and_class(ID *idp, VALUE *klassp);
|
||||
VALUE rb_make_backtrace(void);
|
||||
VALUE rb_make_exception(int, const VALUE*);
|
||||
|
||||
/* deprecated */
|
||||
DEPRECATED(void rb_frame_pop(void));
|
||||
|
||||
|
||||
RUBY_SYMBOL_EXPORT_END
|
||||
|
||||
#if defined(__cplusplus)
|
||||
#if 0
|
||||
{ /* satisfy cc-mode */
|
||||
#endif
|
||||
} /* extern "C" { */
|
||||
#endif
|
||||
|
||||
#endif /* RUBY_INTERN_H */
|
||||
-182
@@ -1,182 +0,0 @@
|
||||
/**********************************************************************
|
||||
|
||||
rubyio.h -
|
||||
|
||||
$Author: akr $
|
||||
created at: Fri Nov 12 16:47:09 JST 1993
|
||||
|
||||
Copyright (C) 1993-2007 Yukihiro Matsumoto
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef RUBY_IO_H
|
||||
#define RUBY_IO_H 1
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#if 0
|
||||
} /* satisfy cc-mode */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include "ruby/encoding.h"
|
||||
|
||||
#if defined(HAVE_STDIO_EXT_H)
|
||||
#include <stdio_ext.h>
|
||||
#endif
|
||||
|
||||
#include "ruby/config.h"
|
||||
#if defined(HAVE_POLL)
|
||||
# ifdef _AIX
|
||||
# define reqevents events
|
||||
# define rtnevents revents
|
||||
# endif
|
||||
# include <poll.h>
|
||||
# ifdef _AIX
|
||||
# undef reqevents
|
||||
# undef rtnevents
|
||||
# undef events
|
||||
# undef revents
|
||||
# endif
|
||||
# define RB_WAITFD_IN POLLIN
|
||||
# define RB_WAITFD_PRI POLLPRI
|
||||
# define RB_WAITFD_OUT POLLOUT
|
||||
#else
|
||||
# define RB_WAITFD_IN 0x001
|
||||
# define RB_WAITFD_PRI 0x002
|
||||
# define RB_WAITFD_OUT 0x004
|
||||
#endif
|
||||
|
||||
RUBY_SYMBOL_EXPORT_BEGIN
|
||||
|
||||
PACKED_STRUCT_UNALIGNED(struct rb_io_buffer_t {
|
||||
char *ptr; /* off + len <= capa */
|
||||
int off;
|
||||
int len;
|
||||
int capa;
|
||||
});
|
||||
typedef struct rb_io_buffer_t rb_io_buffer_t;
|
||||
|
||||
typedef struct rb_io_t {
|
||||
FILE *stdio_file; /* stdio ptr for read/write if available */
|
||||
int fd; /* file descriptor */
|
||||
int mode; /* mode flags: FMODE_XXXs */
|
||||
rb_pid_t pid; /* child's pid (for pipes) */
|
||||
int lineno; /* number of lines read */
|
||||
VALUE pathv; /* pathname for file */
|
||||
void (*finalize)(struct rb_io_t*,int); /* finalize proc */
|
||||
|
||||
rb_io_buffer_t wbuf, rbuf;
|
||||
|
||||
VALUE tied_io_for_writing;
|
||||
|
||||
/*
|
||||
* enc enc2 read action write action
|
||||
* NULL NULL force_encoding(default_external) write the byte sequence of str
|
||||
* e1 NULL force_encoding(e1) convert str.encoding to e1
|
||||
* e1 e2 convert from e2 to e1 convert str.encoding to e2
|
||||
*/
|
||||
struct rb_io_enc_t {
|
||||
rb_encoding *enc;
|
||||
rb_encoding *enc2;
|
||||
int ecflags;
|
||||
VALUE ecopts;
|
||||
} encs;
|
||||
|
||||
rb_econv_t *readconv;
|
||||
rb_io_buffer_t cbuf;
|
||||
|
||||
rb_econv_t *writeconv;
|
||||
VALUE writeconv_asciicompat;
|
||||
int writeconv_initialized;
|
||||
int writeconv_pre_ecflags;
|
||||
VALUE writeconv_pre_ecopts;
|
||||
|
||||
VALUE write_lock;
|
||||
} rb_io_t;
|
||||
|
||||
#define HAVE_RB_IO_T 1
|
||||
|
||||
#define FMODE_READABLE 0x00000001
|
||||
#define FMODE_WRITABLE 0x00000002
|
||||
#define FMODE_READWRITE (FMODE_READABLE|FMODE_WRITABLE)
|
||||
#define FMODE_BINMODE 0x00000004
|
||||
#define FMODE_SYNC 0x00000008
|
||||
#define FMODE_TTY 0x00000010
|
||||
#define FMODE_DUPLEX 0x00000020
|
||||
#define FMODE_APPEND 0x00000040
|
||||
#define FMODE_CREATE 0x00000080
|
||||
/* #define FMODE_NOREVLOOKUP 0x00000100 */
|
||||
#define FMODE_TRUNC 0x00000800
|
||||
#define FMODE_TEXTMODE 0x00001000
|
||||
/* #define FMODE_PREP 0x00010000 */
|
||||
#define FMODE_SETENC_BY_BOM 0x00100000
|
||||
|
||||
#define GetOpenFile(obj,fp) rb_io_check_closed((fp) = RFILE(rb_io_taint_check(obj))->fptr)
|
||||
|
||||
#define RB_IO_BUFFER_INIT(buf) do {\
|
||||
[<"internal macro RB_IO_BUFFER_INIT() is used">];\
|
||||
} while (0)
|
||||
|
||||
#define MakeOpenFile(obj, fp) do {\
|
||||
(fp) = rb_io_make_open_file(obj);\
|
||||
} while (0)
|
||||
|
||||
#define RB_IO_FPTR_NEW(fp) do {\
|
||||
[<"internal macro RB_IO_FPTR_NEW() is used">];\
|
||||
} while (0)
|
||||
|
||||
rb_io_t *rb_io_make_open_file(VALUE obj);
|
||||
|
||||
FILE *rb_io_stdio_file(rb_io_t *fptr);
|
||||
|
||||
FILE *rb_fdopen(int, const char*);
|
||||
int rb_io_modestr_fmode(const char *modestr);
|
||||
int rb_io_modestr_oflags(const char *modestr);
|
||||
int rb_io_oflags_fmode(int oflags);
|
||||
void rb_io_check_writable(rb_io_t*);
|
||||
void rb_io_check_readable(rb_io_t*);
|
||||
void rb_io_check_char_readable(rb_io_t *fptr);
|
||||
void rb_io_check_byte_readable(rb_io_t *fptr);
|
||||
int rb_io_fptr_finalize(rb_io_t*);
|
||||
void rb_io_synchronized(rb_io_t*);
|
||||
void rb_io_check_initialized(rb_io_t*);
|
||||
void rb_io_check_closed(rb_io_t*);
|
||||
VALUE rb_io_get_io(VALUE io);
|
||||
VALUE rb_io_check_io(VALUE io);
|
||||
VALUE rb_io_get_write_io(VALUE io);
|
||||
VALUE rb_io_set_write_io(VALUE io, VALUE w);
|
||||
int rb_io_wait_readable(int);
|
||||
int rb_io_wait_writable(int);
|
||||
int rb_wait_for_single_fd(int fd, int events, struct timeval *tv);
|
||||
void rb_io_set_nonblock(rb_io_t *fptr);
|
||||
int rb_io_extract_encoding_option(VALUE opt, rb_encoding **enc_p, rb_encoding **enc2_p, int *fmode_p);
|
||||
ssize_t rb_io_bufwrite(VALUE io, const void *buf, size_t size);
|
||||
|
||||
/* compatibility for ruby 1.8 and older */
|
||||
#define rb_io_mode_flags(modestr) [<"rb_io_mode_flags() is obsolete; use rb_io_modestr_fmode()">]
|
||||
#define rb_io_modenum_flags(oflags) [<"rb_io_modenum_flags() is obsolete; use rb_io_oflags_fmode()">]
|
||||
|
||||
VALUE rb_io_taint_check(VALUE);
|
||||
NORETURN(void rb_eof_error(void));
|
||||
|
||||
void rb_io_read_check(rb_io_t*);
|
||||
int rb_io_read_pending(rb_io_t*);
|
||||
|
||||
struct stat;
|
||||
VALUE rb_stat_new(const struct stat *);
|
||||
|
||||
/* gc.c */
|
||||
|
||||
RUBY_SYMBOL_EXPORT_END
|
||||
|
||||
#if defined(__cplusplus)
|
||||
#if 0
|
||||
{ /* satisfy cc-mode */
|
||||
#endif
|
||||
} /* extern "C" { */
|
||||
#endif
|
||||
|
||||
#endif /* RUBY_IO_H */
|
||||
@@ -1,251 +0,0 @@
|
||||
/************************************************
|
||||
|
||||
missing.h - prototype for *.c in ./missing, and
|
||||
for missing timeval struct
|
||||
|
||||
$Author: nobu $
|
||||
created at: Sat May 11 23:46:03 JST 2002
|
||||
|
||||
************************************************/
|
||||
|
||||
#ifndef RUBY_MISSING_H
|
||||
#define RUBY_MISSING_H 1
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#if 0
|
||||
} /* satisfy cc-mode */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "ruby/config.h"
|
||||
#include <stddef.h>
|
||||
#include <math.h> /* for INFINITY and NAN */
|
||||
#ifdef RUBY_ALTERNATIVE_MALLOC_HEADER
|
||||
# include RUBY_ALTERNATIVE_MALLOC_HEADER
|
||||
#endif
|
||||
#ifdef RUBY_EXTCONF_H
|
||||
#include RUBY_EXTCONF_H
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_STRUCT_TIMEVAL) || !defined(HAVE_STRUCT_TIMESPEC)
|
||||
#if defined(HAVE_TIME_H)
|
||||
# include <time.h>
|
||||
#endif
|
||||
#if defined(HAVE_SYS_TIME_H)
|
||||
# include <sys/time.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef RUBY_SYMBOL_EXPORT_BEGIN
|
||||
# define RUBY_SYMBOL_EXPORT_BEGIN /* begin */
|
||||
# define RUBY_SYMBOL_EXPORT_END /* end */
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_STRUCT_TIMEVAL)
|
||||
struct timeval {
|
||||
time_t tv_sec; /* seconds */
|
||||
long tv_usec; /* microseconds */
|
||||
};
|
||||
#endif /* HAVE_STRUCT_TIMEVAL */
|
||||
|
||||
#if !defined(HAVE_STRUCT_TIMESPEC)
|
||||
struct timespec {
|
||||
time_t tv_sec; /* seconds */
|
||||
long tv_nsec; /* nanoseconds */
|
||||
};
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_STRUCT_TIMEZONE)
|
||||
struct timezone {
|
||||
int tz_minuteswest;
|
||||
int tz_dsttime;
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef RUBY_EXPORT
|
||||
#undef RUBY_EXTERN
|
||||
#endif
|
||||
#ifndef RUBY_EXTERN
|
||||
#define RUBY_EXTERN extern
|
||||
#endif
|
||||
|
||||
RUBY_SYMBOL_EXPORT_BEGIN
|
||||
|
||||
#ifndef HAVE_ACOSH
|
||||
RUBY_EXTERN double acosh(double);
|
||||
RUBY_EXTERN double asinh(double);
|
||||
RUBY_EXTERN double atanh(double);
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_CRYPT
|
||||
RUBY_EXTERN char *crypt(const char *, const char *);
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_DUP2
|
||||
RUBY_EXTERN int dup2(int, int);
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_EACCESS
|
||||
RUBY_EXTERN int eaccess(const char*, int);
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_ROUND
|
||||
RUBY_EXTERN double round(double); /* numeric.c */
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_FINITE
|
||||
RUBY_EXTERN int finite(double);
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_FLOCK
|
||||
RUBY_EXTERN int flock(int, int);
|
||||
#endif
|
||||
|
||||
/*
|
||||
#ifndef HAVE_FREXP
|
||||
RUBY_EXTERN double frexp(double, int *);
|
||||
#endif
|
||||
*/
|
||||
|
||||
#ifndef HAVE_HYPOT
|
||||
RUBY_EXTERN double hypot(double, double);
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_ERF
|
||||
RUBY_EXTERN double erf(double);
|
||||
RUBY_EXTERN double erfc(double);
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_TGAMMA
|
||||
RUBY_EXTERN double tgamma(double);
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_LGAMMA_R
|
||||
RUBY_EXTERN double lgamma_r(double, int *);
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_CBRT
|
||||
RUBY_EXTERN double cbrt(double);
|
||||
#endif
|
||||
|
||||
#if !defined(INFINITY) || !defined(NAN)
|
||||
union bytesequence4_or_float {
|
||||
unsigned char bytesequence[4];
|
||||
float float_value;
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef INFINITY
|
||||
# define HAVE_INFINITY
|
||||
#else
|
||||
/** @internal */
|
||||
RUBY_EXTERN const union bytesequence4_or_float rb_infinity;
|
||||
# define INFINITY (rb_infinity.float_value)
|
||||
#endif
|
||||
|
||||
#ifdef NAN
|
||||
# define HAVE_NAN
|
||||
#else
|
||||
/** @internal */
|
||||
RUBY_EXTERN const union bytesequence4_or_float rb_nan;
|
||||
# define NAN (rb_nan.float_value)
|
||||
#endif
|
||||
|
||||
#ifndef isinf
|
||||
# ifndef HAVE_ISINF
|
||||
# if defined(HAVE_FINITE) && defined(HAVE_ISNAN)
|
||||
# ifdef HAVE_IEEEFP_H
|
||||
# include <ieeefp.h>
|
||||
# endif
|
||||
# define isinf(x) (!finite(x) && !isnan(x))
|
||||
# else
|
||||
RUBY_EXTERN int isinf(double);
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef isnan
|
||||
# ifndef HAVE_ISNAN
|
||||
RUBY_EXTERN int isnan(double);
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_NEXTAFTER
|
||||
RUBY_EXTERN double nextafter(double x, double y);
|
||||
#endif
|
||||
|
||||
/*
|
||||
#ifndef HAVE_MEMCMP
|
||||
RUBY_EXTERN int memcmp(const void *, const void *, size_t);
|
||||
#endif
|
||||
*/
|
||||
|
||||
#ifndef HAVE_MEMMOVE
|
||||
RUBY_EXTERN void *memmove(void *, const void *, size_t);
|
||||
#endif
|
||||
|
||||
/*
|
||||
#ifndef HAVE_MODF
|
||||
RUBY_EXTERN double modf(double, double *);
|
||||
#endif
|
||||
*/
|
||||
|
||||
#ifndef HAVE_STRCHR
|
||||
RUBY_EXTERN char *strchr(const char *, int);
|
||||
RUBY_EXTERN char *strrchr(const char *, int);
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_STRERROR
|
||||
RUBY_EXTERN char *strerror(int);
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_STRSTR
|
||||
RUBY_EXTERN char *strstr(const char *, const char *);
|
||||
#endif
|
||||
|
||||
/*
|
||||
#ifndef HAVE_STRTOL
|
||||
RUBY_EXTERN long strtol(const char *, char **, int);
|
||||
#endif
|
||||
*/
|
||||
|
||||
#ifndef HAVE_STRLCPY
|
||||
RUBY_EXTERN size_t strlcpy(char *, const char*, size_t);
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_STRLCAT
|
||||
RUBY_EXTERN size_t strlcat(char *, const char*, size_t);
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_SIGNBIT
|
||||
RUBY_EXTERN int signbit(double x);
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_FFS
|
||||
RUBY_EXTERN int ffs(int);
|
||||
#endif
|
||||
|
||||
#ifdef BROKEN_CLOSE
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
RUBY_EXTERN int ruby_getpeername(int, struct sockaddr *, socklen_t *);
|
||||
RUBY_EXTERN int ruby_getsockname(int, struct sockaddr *, socklen_t *);
|
||||
RUBY_EXTERN int ruby_shutdown(int, int);
|
||||
RUBY_EXTERN int ruby_close(int);
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_SETPROCTITLE
|
||||
RUBY_EXTERN void setproctitle(const char *fmt, ...);
|
||||
#endif
|
||||
|
||||
RUBY_SYMBOL_EXPORT_END
|
||||
|
||||
#if defined(__cplusplus)
|
||||
#if 0
|
||||
{ /* satisfy cc-mode */
|
||||
#endif
|
||||
} /* extern "C" { */
|
||||
#endif
|
||||
|
||||
#endif /* RUBY_MISSING_H */
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user