mirror of
https://github.com/opencv/opencv.git
synced 2026-07-22 03:43:03 +04:00
Compare commits
4520 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a1fe8f754f | |||
| dd3398416b | |||
| cf86af96ea | |||
| 780ae864a0 | |||
| 96c99c716a | |||
| 73a17baeec | |||
| c26dd5d7aa | |||
| 954969dd74 | |||
| 43002c0c1d | |||
| e580061b74 | |||
| 53af811530 | |||
| b58a8729c2 | |||
| ee417048e5 | |||
| a4b21d9e2e | |||
| b321851e53 | |||
| 1d5a528107 | |||
| a68835f7f1 | |||
| f2bec05e6d | |||
| c371df4aa2 | |||
| 9ea8c775f8 | |||
| e8e2197032 | |||
| c4c31f5bba | |||
| ce6acd3ecd | |||
| 1c04a5ec47 | |||
| 2fa9bd221d | |||
| 9ca82caeb7 | |||
| 5cf84c3765 | |||
| 3d68b5baa1 | |||
| 8792bddb0a | |||
| e5afa62c3d | |||
| 33e824f5de | |||
| 6820abd67f | |||
| b5c54e447c | |||
| 96c71dd3d2 | |||
| 02d2cc58d7 | |||
| 452f0bb2ab | |||
| 10b482ff1e | |||
| 42742727d6 | |||
| 47cb94e634 | |||
| 80265a0815 | |||
| 70ac734263 | |||
| b24a815ac1 | |||
| cae2992af1 | |||
| 265cb58750 | |||
| b5610e77a7 | |||
| 48cf103441 | |||
| 82c2aa6e65 | |||
| c54676d625 | |||
| 6c76c8f881 | |||
| 93d1785820 | |||
| 801c943009 | |||
| 96ee83898d | |||
| 56eebb926d | |||
| 57a30a1dd8 | |||
| 142a07cbbf | |||
| 0e9ac7265d | |||
| 858a7da5c0 | |||
| 82e8657a6d | |||
| 8675a8c743 | |||
| 533bfba75c | |||
| afa0f80c61 | |||
| 2dd98e7cc6 | |||
| 596ada51f3 | |||
| 28fd967148 | |||
| 8396ae6e4f | |||
| 5059523937 | |||
| 2da56d5af6 | |||
| b74b05d1b3 | |||
| 0c261acf3a | |||
| 4b298a7460 | |||
| 6adbbcdde1 | |||
| 92a58a0eae | |||
| bb7cfcbcdb | |||
| 467eb4d240 | |||
| cfb30572cb | |||
| f30eafc9ac | |||
| 13ede34516 | |||
| e5d7f446d6 | |||
| c72b6b3be8 | |||
| 028ecc6c02 | |||
| 92a015b8bd | |||
| cdaca22511 | |||
| fb96b7da60 | |||
| dc9e6d3af8 | |||
| eebf0dd7c9 | |||
| 6b3469268e | |||
| e75576e1ab | |||
| d9be552bbc | |||
| 18c44b2ce8 | |||
| 4531f9f2f4 | |||
| 30b16e0a5a | |||
| fa91e4ff27 | |||
| d4e3405db2 | |||
| 857b64efef | |||
| 572af7640f | |||
| cceeca3052 | |||
| d9d8ad20a0 | |||
| eaee63d96b | |||
| cae2a53563 | |||
| 5132102863 | |||
| 4395c1b9f8 | |||
| 79dc0ed175 | |||
| b3d201f148 | |||
| 2007e1d8a3 | |||
| c6d2f0399a | |||
| ce00d38bd9 | |||
| 877de883b0 | |||
| d9b8a9d90e | |||
| 30bf4a5e34 | |||
| 0fda551dbc | |||
| a724525c00 | |||
| 36d00f0200 | |||
| dbc6fe3a0f | |||
| fbe41703e4 | |||
| 0cd14e3fb4 | |||
| a1816e8c77 | |||
| e6c41f0de6 | |||
| b4398d62b2 | |||
| fc21b15d6e | |||
| 733fec020b | |||
| a6f9170f10 | |||
| 4d0ed5c13c | |||
| fcb56a5460 | |||
| 98a73de526 | |||
| b669e9f648 | |||
| ebdc870296 | |||
| 850053f9ca | |||
| 8cb8ba7caf | |||
| fa91d621fa | |||
| 2268ed1b6e | |||
| 93ffebc273 | |||
| 76b6f6b017 | |||
| 7a884ab6a5 | |||
| 792079ad33 | |||
| a9d77b5c64 | |||
| 7767352572 | |||
| aba66352dd | |||
| 6c444ced08 | |||
| 4e633d1f78 | |||
| 012f36e47d | |||
| 1196eb33fc | |||
| 4bea70a64a | |||
| d37164bab6 | |||
| cc2f8f1778 | |||
| daff6e6484 | |||
| eea0f7fd76 | |||
| 3e0c72ea84 | |||
| 3972c526ce | |||
| 75f67ed207 | |||
| 644846c702 | |||
| defeda2f70 | |||
| 4102855edd | |||
| 602989ae9e | |||
| 88f60113a5 | |||
| f50b58b509 | |||
| 223d7cfb38 | |||
| 7e2c65ce3c | |||
| b184b19970 | |||
| 55676b7173 | |||
| 92f754c675 | |||
| aa6e296236 | |||
| 7f608db244 | |||
| d61ad04f11 | |||
| 28a14df26c | |||
| d305fd4fca | |||
| 8486f1b8f0 | |||
| a1bd39441f | |||
| 9a12aa45ad | |||
| 2c029aae46 | |||
| 3523e0a56c | |||
| 2933b58a2f | |||
| 1c1d653f3a | |||
| e397434cb6 | |||
| ad356e3239 | |||
| c8fc8d210b | |||
| 7a3cb2280b | |||
| 8b26906d6d | |||
| 9a76322ef9 | |||
| 0f07edded6 | |||
| d3f75df0a6 | |||
| 971c4ca10b | |||
| 73f65b1ccf | |||
| 1fbaa48cec | |||
| 6974fce183 | |||
| d6a8e08acc | |||
| d8ffddd075 | |||
| a692d87cfb | |||
| e7015f6ae8 | |||
| 9c9fb1c6d0 | |||
| 80c64fce11 | |||
| 237b867721 | |||
| a7dfa261d8 | |||
| 4d1f0ef2d9 | |||
| df6728e64c | |||
| 7a73941f22 | |||
| 6d9e66eca1 | |||
| 365451dab0 | |||
| c09a3cf098 | |||
| 842341fc16 | |||
| 32a5e5fae1 | |||
| 85b9960f62 | |||
| 5640b36f6d | |||
| c8e6ce304f | |||
| 1c468add20 | |||
| 24ced3d657 | |||
| c5a5d7eb51 | |||
| ab2c16b2e5 | |||
| 113793fee7 | |||
| b54a70a538 | |||
| a66fd527b0 | |||
| 6d2cfac303 | |||
| f8a27d2603 | |||
| f185640eda | |||
| 72eccb7694 | |||
| 803f86b9ca | |||
| 7bac615d8f | |||
| dc3406eed9 | |||
| 1cc3f7abbb | |||
| 70177143a7 | |||
| 43d9256096 | |||
| 803ff64b14 | |||
| 824241ad5c | |||
| 5677a683a5 | |||
| c813ad5533 | |||
| 0b77600718 | |||
| 429a643f42 | |||
| d2a66d3c99 | |||
| 0f41daeba5 | |||
| 1be75437b7 | |||
| 978ad4981e | |||
| 8c4f886f5f | |||
| 0d63c4c28e | |||
| 6843d368b2 | |||
| 24af70c7e0 | |||
| 9dc1d388af | |||
| 28cb714a09 | |||
| 91c6d36ff8 | |||
| be76b451cb | |||
| 53785b6ac6 | |||
| 2332fb852d | |||
| 8edff1065a | |||
| 41398987c3 | |||
| de8024ce4a | |||
| 7b9b876726 | |||
| 944710de4e | |||
| 2b3c7490d5 | |||
| 8965f3ae06 | |||
| 5771fd693d | |||
| 1ff11c84ab | |||
| 5faaa28870 | |||
| 761c269e47 | |||
| 131d199ae3 | |||
| 4e62900009 | |||
| 7813eef92b | |||
| cc10e6b344 | |||
| 11e2a216c5 | |||
| 404893810c | |||
| 53ec8f286b | |||
| 70f2ee917e | |||
| ad93ed720d | |||
| cc3ec5d453 | |||
| 288251e672 | |||
| 421fdc0e94 | |||
| c4d434fd6f | |||
| b8aa0cddab | |||
| 50811e04f2 | |||
| 449826288b | |||
| 68fe37b008 | |||
| 26ba4f3c1d | |||
| e19b422854 | |||
| 913c4151bf | |||
| 78a802baae | |||
| 9d602f2752 | |||
| 7649e537b7 | |||
| 2faa4cd933 | |||
| 0492301e76 | |||
| 18bf91a08b | |||
| 09ef4c9cff | |||
| 634dd656d5 | |||
| 9d02d42afe | |||
| c716e374c1 | |||
| aeec6e43eb | |||
| 630a94b8b7 | |||
| ceca139f7f | |||
| da5e0ef461 | |||
| 4fa6734320 | |||
| 0926a84a45 | |||
| 0101fa789c | |||
| 12b3d157a5 | |||
| 60c26f8f1e | |||
| 7294ae0f17 | |||
| 0ffc186680 | |||
| 50beef605b | |||
| 068ebe8b4d | |||
| ffaf58349c | |||
| eec468fa13 | |||
| 81c94357e8 | |||
| 042c486b68 | |||
| 6921f967a1 | |||
| 83a0c12144 | |||
| fa8684b5c8 | |||
| 283348afc3 | |||
| ee0c985491 | |||
| b41f38ecc7 | |||
| 682180e0cd | |||
| 1385db48f5 | |||
| 94201b7cf9 | |||
| 15632c6305 | |||
| 6b84990620 | |||
| c9b6b2cf04 | |||
| 617fe2545c | |||
| 93663dc57a | |||
| 28e55dc5f3 | |||
| 9253e8bda2 | |||
| 0f031b6680 | |||
| 255b20f6de | |||
| ac9ec55b37 | |||
| df4139d373 | |||
| 1059735bfb | |||
| 8f2eb60719 | |||
| a1ffc00ba8 | |||
| 1a81a97e9f | |||
| e6ef9221cb | |||
| ee84ae0551 | |||
| bd04568baf | |||
| 8ecdd215b6 | |||
| 5a3bca8d5c | |||
| 9b9f38afc8 | |||
| 4fea6179a0 | |||
| 055f177a6a | |||
| 3c5a6be835 | |||
| 4b895a4d1f | |||
| e9f99063c7 | |||
| 9f0ff03da5 | |||
| 9ba659af84 | |||
| be989b3b60 | |||
| 0706bd72b8 | |||
| f6dc396a0f | |||
| 48e8e76a34 | |||
| fae329a0ca | |||
| 52f52f6786 | |||
| fe56bdeeb9 | |||
| b34d86ca24 | |||
| 24ab751547 | |||
| c8f3579f93 | |||
| 962dc21f2b | |||
| 43e66e7ff9 | |||
| ad5898224d | |||
| f8398d80bc | |||
| 9faacfbc0d | |||
| a610be6335 | |||
| 6a5266df79 | |||
| 238a3806b0 | |||
| a07a4cefe1 | |||
| a0211a1c2f | |||
| 47bb09bc4b | |||
| 93b0b03447 | |||
| 0a23c1bf11 | |||
| ecef7f7930 | |||
| 5db13fe2a7 | |||
| 9932612373 | |||
| 6203c95d31 | |||
| d5d19a9f67 | |||
| f33f236ab6 | |||
| 95b1fe0776 | |||
| 35bee663eb | |||
| 98f6ea0785 | |||
| e0a5824028 | |||
| 87b1835cb6 | |||
| ec9c53eeff | |||
| d3eed2cf23 | |||
| 51f7eb3a3c | |||
| b35fbff675 | |||
| 15e9e3304c | |||
| 3961b214f0 | |||
| 8ac7b21716 | |||
| de54d45afd | |||
| 3cab9e7a9c | |||
| b0ad7f759a | |||
| 30597e5c98 | |||
| 70f38b4dfa | |||
| d389edd843 | |||
| 27a4e370f9 | |||
| b4fd3e8674 | |||
| 43f889ae1f | |||
| 7d75526373 | |||
| ecc9bd0925 | |||
| d259eb28bb | |||
| 76d4aa0c06 | |||
| 2113818f19 | |||
| 29bee6f07e | |||
| a7b3d2581f | |||
| 3512cb2226 | |||
| 96a50d5eb0 | |||
| 79db32bcd9 | |||
| 14b438317e | |||
| 6d5f7b72c0 | |||
| cecb878915 | |||
| 29c10b6792 | |||
| 92ec971453 | |||
| 95502242c9 | |||
| 1f88a1af9c | |||
| 65e2961fee | |||
| c5687caf1a | |||
| 5d54def264 | |||
| dbfeb8892d | |||
| 949d7d7d25 | |||
| 451340fd3d | |||
| fdaeb20253 | |||
| 29770e13e8 | |||
| e51d7cb3d8 | |||
| d66f3efd36 | |||
| f512bf7004 | |||
| 63affb2be9 | |||
| 87b1100027 | |||
| 78c500e97a | |||
| a4f53988c4 | |||
| 347e09cd07 | |||
| 095b0d3272 | |||
| b7b82c1cef | |||
| cb5da8983f | |||
| 796795ac89 | |||
| 3e8934dec0 | |||
| 58ac3e09da | |||
| 09fa758725 | |||
| 57ae3ac7a2 | |||
| 6fc855865f | |||
| f4b9acb4db | |||
| acbfd85737 | |||
| 03b3be0f51 | |||
| 38f8fc6c82 | |||
| 7828854c9d | |||
| d7ac4495c3 | |||
| 492ef14550 | |||
| be2ccdbf0b | |||
| 88b04c3cd4 | |||
| 1fb7ee0e16 | |||
| 8f78a1123b | |||
| d7885ed819 | |||
| b9fd5f8186 | |||
| 0c8590027f | |||
| 0a5bd0ac8b | |||
| 2f929376ec | |||
| 30a4e2f7ac | |||
| 8e0781648b | |||
| c331a214d0 | |||
| c35c5a47df | |||
| 17cc21c9d6 | |||
| 5e241e7c36 | |||
| 92517fa359 | |||
| 95dd4b3f27 | |||
| 87ed12b8f3 | |||
| 53bbed89ae | |||
| 286c2c236b | |||
| 875de75327 | |||
| a39e0daacf | |||
| f3fae0dae0 | |||
| f90aea22b1 | |||
| bd98ed46bd | |||
| 8b48c2a10c | |||
| f1f15841d7 | |||
| 80b62a41c6 | |||
| 54279523a3 | |||
| 24e72e151a | |||
| 8a3c394d6a | |||
| ad146e5a6b | |||
| 66d15e89df | |||
| d486204a0d | |||
| 07c6b0a8df | |||
| 8e8315abfd | |||
| a18da0c55e | |||
| d621a99e73 | |||
| 107660c7ba | |||
| b33cb2e3f2 | |||
| e70526625f | |||
| 8a328e393d | |||
| 9fae8070dc | |||
| 6ec230480d | |||
| c441ad36c8 | |||
| 59cd636ad7 | |||
| 3f3d805663 | |||
| 351ee2e3a5 | |||
| 7f7f30a08b | |||
| fda99c1c6c | |||
| 71c8de8fa1 | |||
| 27a6be8763 | |||
| acce95f446 | |||
| a78e5344df | |||
| e5236cecd6 | |||
| 6aff916aa5 | |||
| 4f9db2c03a | |||
| 9988e1b6ee | |||
| afb81ba6e6 | |||
| 0f0a82b619 | |||
| 2cf34c0fe5 | |||
| 49a1328046 | |||
| 2877f17372 | |||
| 00cbb894ec | |||
| a0f86479e0 | |||
| f9a5c4d181 | |||
| d71812425a | |||
| aa5c45339c | |||
| 1e362ff5c3 | |||
| fc71316690 | |||
| cb7ee27cd9 | |||
| c7cf8fb35c | |||
| 8b0e1c7fcb | |||
| e3af72bb68 | |||
| ec3492a22a | |||
| 07808c8d5d | |||
| 436e330642 | |||
| a11d944f51 | |||
| c85e44697e | |||
| af883e88e1 | |||
| 3dddf703a9 | |||
| f7ccc74e09 | |||
| 546fcd990e | |||
| 5eb295adf3 | |||
| 20bf7b6a79 | |||
| af769e4ec8 | |||
| 70a27c7dd6 | |||
| 701760dbeb | |||
| 0f9f2696be | |||
| 65a0587ce8 | |||
| f9c8bb40b1 | |||
| 7d3a1657c9 | |||
| f36790d521 | |||
| 0f2b535fcc | |||
| e345cb03d5 | |||
| f33cbe94dd | |||
| e13f6ded7f | |||
| 4b03a4a841 | |||
| bab4f4f5d8 | |||
| a08c6e49b3 | |||
| 50bceea038 | |||
| 9e42204e67 | |||
| c557193b8c | |||
| 3e6b3a6856 | |||
| d52cef1719 | |||
| 0d4fd20a73 | |||
| 0515f930e8 | |||
| 32a02544de | |||
| fc1dee685e | |||
| c894fc5bae | |||
| e1ee744e15 | |||
| e86287d8ae | |||
| 4c7d521413 | |||
| ade57c8bd0 | |||
| ea43e28a37 | |||
| 258a769567 | |||
| 7845f6d95c | |||
| be48cdc747 | |||
| 8ef2d19337 | |||
| cecf84410c | |||
| 596a0125ed | |||
| 8a8d07fb17 | |||
| 72f422c7dc | |||
| ca51bbb7ff | |||
| 4062ef5fcb | |||
| 1ae477a46d | |||
| 087e9308ec | |||
| d13db35f31 | |||
| b38c50b3d0 | |||
| dd06540e1f | |||
| 50b61668e2 | |||
| 1df84f7246 | |||
| bdc34984f1 | |||
| af0c930e77 | |||
| bb45bf9695 | |||
| 4e0d2a3e6c | |||
| da6d8961fc | |||
| 3e027df583 | |||
| bed388bafb | |||
| 6477262e63 | |||
| f79599f949 | |||
| c94d75874b | |||
| 21f3987d53 | |||
| d10a219833 | |||
| bd7bf39b4b | |||
| 472b71ecef | |||
| 4f360f8b1a | |||
| e8d45a9cdd | |||
| ff2eface19 | |||
| 29ce348c4d | |||
| b2a4069f55 | |||
| 4d78342919 | |||
| 1272332ae3 | |||
| b47c9ac643 | |||
| 1c20a7f008 | |||
| 6700fdb81f | |||
| 096366738b | |||
| 6a6506b02d | |||
| 59ccf2c9e0 | |||
| 2c42361ecd | |||
| 18833d5121 | |||
| f25450791b | |||
| c9faa09d55 | |||
| 1deeca985f | |||
| 6acabd1fd8 | |||
| 5ac9a2a7d0 | |||
| 808c89adc1 | |||
| a527e8cc73 | |||
| 10c570b558 | |||
| 76f47548b3 | |||
| 67d46dfc6c | |||
| 3c03fb56e0 | |||
| 378cf2ab63 | |||
| c6f5b013ec | |||
| e593d5bbc5 | |||
| 3f5c3ddd27 | |||
| ab8ba047a5 | |||
| cecc19381f | |||
| 6e84abc746 | |||
| 322c6b1ba4 | |||
| 73d44c7881 | |||
| 31fef14d76 | |||
| 7ee69740e8 | |||
| c61bc3a0cb | |||
| b24fc6954d | |||
| 828cb4286d | |||
| ee5e0e16d9 | |||
| b907bfe3e7 | |||
| f84eb3dde6 | |||
| b996b618e0 | |||
| 98c5ce9347 | |||
| f89defad5d | |||
| 96f92c6705 | |||
| f0c46a4c74 | |||
| 9752d45c87 | |||
| 860ae77ec9 | |||
| 1567a65475 | |||
| d2e08a524e | |||
| eff0f9d3f8 | |||
| c1df9ad456 | |||
| 8b197c58e6 | |||
| 781721ca50 | |||
| 603eadfe51 | |||
| b9b66ca437 | |||
| 22cb65ada9 | |||
| 90b8a03a89 | |||
| f056c0f137 | |||
| 49e0126b8e | |||
| a24a829490 | |||
| 615883977f | |||
| 216cd7dc61 | |||
| 4910f16f16 | |||
| f2d363feb2 | |||
| 8b2122e12f | |||
| f16f818f5f | |||
| 5b3ac112fe | |||
| a0cff0be94 | |||
| 509de3fa2c | |||
| b00758babe | |||
| 9f2edc1135 | |||
| a56b221559 | |||
| fb2b26c419 | |||
| 377e51df83 | |||
| 7453a6938a | |||
| 39f5e57321 | |||
| f49f6d52b4 | |||
| 715f23127c | |||
| f0f652f9e9 | |||
| 731aa963bd | |||
| 7e353a1ec5 | |||
| 4fe900c399 | |||
| 5c3880d302 | |||
| 9eaa583bfb | |||
| 6500700d6f | |||
| f95a411ba3 | |||
| 7c8ab271fc | |||
| 70b893333d | |||
| 449696f1e5 | |||
| e0c93bcf6c | |||
| 23022f3ffb | |||
| ac4a6aad15 | |||
| 7d7767ba42 | |||
| 183cfd3a2e | |||
| 9cb3e9abf0 | |||
| b4cea8d6d1 | |||
| 8f57fc93ec | |||
| 9ff4475695 | |||
| 1c73e66edf | |||
| 061149cbbd | |||
| a2daf0c83c | |||
| 2dbb5871e0 | |||
| be08730cd6 | |||
| 3082ea82f9 | |||
| 5131619a1a | |||
| b056ce33aa | |||
| df9efbbd1f | |||
| f2e1710dd5 | |||
| 05830874d7 | |||
| 4fb086d6c3 | |||
| 3ea2586a5a | |||
| 2df0345985 | |||
| 47e3e89e30 | |||
| 3f302cabb8 | |||
| 8e034053af | |||
| 67f79aabdd | |||
| 5aceee5a36 | |||
| 1e1a1855ae | |||
| 2003eb1b9b | |||
| 17196bb4fa | |||
| 7e71b1079e | |||
| 814ebe39ae | |||
| 61c870ae09 | |||
| 6949bc9ef9 | |||
| 7cf52de47e | |||
| 9433784e47 | |||
| ed0e79cb61 | |||
| bb82cdc928 | |||
| db8585701d | |||
| 28d0e97c09 | |||
| 5d12c070ea | |||
| 5bde800ee3 | |||
| 29a1dc5719 | |||
| dbf3362c4d | |||
| c4e0f4b2b5 | |||
| e90e398e7a | |||
| 4937eeddb5 | |||
| 2988260107 | |||
| 83039c8752 | |||
| 6499263b41 | |||
| 80cab4a163 | |||
| 47202b3349 | |||
| 9076bb6089 | |||
| 89528d7c3a | |||
| 0bef42ba12 | |||
| b41bc0ae59 | |||
| fb1f12021b | |||
| dd8e990451 | |||
| e031bada7d | |||
| 2b7ff90e63 | |||
| b597c87bed | |||
| 0aded5aae6 | |||
| a8e9a3a88d | |||
| 2f0fc920dd | |||
| 9137e2d635 | |||
| c37d1a53b5 | |||
| 1165fdd0f5 | |||
| 597db69151 | |||
| 9eb79926df | |||
| fa466b022d | |||
| 43820d89b4 | |||
| faa6c4e1e1 | |||
| dd8701c1a0 | |||
| 74cf48b5d7 | |||
| 45b5b3c13a | |||
| 5336b9ad19 | |||
| a16254de2b | |||
| 8a2ce75d96 | |||
| 9c7040802c | |||
| cbb1e867e5 | |||
| 8de08e0463 | |||
| 236f383969 | |||
| 93abdbf25e | |||
| 8f80565d9c | |||
| 391b9586ac | |||
| 4283309daa | |||
| 6e767e2376 | |||
| 0c4d5ffecd | |||
| 28e08ae0bd | |||
| e0603bb45f | |||
| 7d40fcead5 | |||
| 8c7555523b | |||
| b117302bca | |||
| e1205d046a | |||
| dadde75ef0 | |||
| ee743afebe | |||
| 767b31cfbf | |||
| 18abe54497 | |||
| 05f0cb16de | |||
| a4060e15a4 | |||
| 7198b9e461 | |||
| ab9b6e806c | |||
| 270cc3bcbc | |||
| c213a3823e | |||
| 51074b9743 | |||
| 070393dfda | |||
| f4df537e27 | |||
| 905da2994a | |||
| e526c4bfe4 | |||
| fe806878be | |||
| a2a9a01e05 | |||
| 6c4f618db5 | |||
| f3ee07ca11 | |||
| 7cc84ce8ab | |||
| 40b8ca2eed | |||
| 4dcef28023 | |||
| 0a41b3df45 | |||
| f086fc5b18 | |||
| c473718bc2 | |||
| 1da46fe6fb | |||
| 5b72e83687 | |||
| 78d07e841d | |||
| f38808a39f | |||
| 540415dc5e | |||
| f0cadaa6e3 | |||
| f058b5fb1e | |||
| 481829a81b | |||
| c9439476da | |||
| 60994389a6 | |||
| b0ee5d9023 | |||
| 84f2f37680 | |||
| d5951bc033 | |||
| a5e8ae2183 | |||
| 1dec480974 | |||
| d6c669f5cf | |||
| 014ae55379 | |||
| 53eb27f508 | |||
| 4a3dfffd46 | |||
| 50751ae6ff | |||
| 10676f86d5 | |||
| dee5f9a67b | |||
| 2b6aa50b81 | |||
| 3c74fde349 | |||
| 6eb8faea85 | |||
| 23fc96e98f | |||
| abceae1ac0 | |||
| eed1130327 | |||
| 41b95cae38 | |||
| de6f0a537d | |||
| 4dc7e617a4 | |||
| 0155851929 | |||
| 71c6cb9c22 | |||
| 2170811e48 | |||
| 9d8495f8b3 | |||
| 5385086fef | |||
| dcc1beb1f8 | |||
| e38ea3a888 | |||
| 33b7028be2 | |||
| 850a8577b2 | |||
| e79c729b20 | |||
| 625d20b9b4 | |||
| 1c75f3d037 | |||
| 9c3ec05825 | |||
| 875f23881f | |||
| d0a3686812 | |||
| c9fe6f1afe | |||
| 2508f7f971 | |||
| 8b5f061dae | |||
| 999aba3807 | |||
| 82c7ab0231 | |||
| 4c5a86828a | |||
| a7b502f04a | |||
| e4b5e9b9c9 | |||
| e9bb26267e | |||
| d7bd662c95 | |||
| 452fa3011c | |||
| d57e5406f0 | |||
| 7fe0727930 | |||
| 529d38613b | |||
| 88d56dc700 | |||
| 7ba66a1682 | |||
| b6255ab9e7 | |||
| 924ff903ad | |||
| e2b5d11290 | |||
| e41f19d2f3 | |||
| 52b151dceb | |||
| 362d4f5395 | |||
| a29d11240e | |||
| 61d8719b8d | |||
| 0fd74fa177 | |||
| 45677819e8 | |||
| e14b2ba43c | |||
| 81325a3fa0 | |||
| aa0c6ddb4c | |||
| 5e6a3f1f6c | |||
| 523b6f32ba | |||
| fc59498b2b | |||
| 3b01777c98 | |||
| aa10cdbfa2 | |||
| 06fc77610b | |||
| 019c2f2115 | |||
| 4bc080dc50 | |||
| c7fc563dc0 | |||
| 0bb2c115aa | |||
| ccd2370bb7 | |||
| c0d0cf5e74 | |||
| b09a4a98d4 | |||
| 135ea264ef | |||
| f25a01bb5a | |||
| 6309e28dd0 | |||
| bd8c8e720e | |||
| 9e1b1e5389 | |||
| 36288eebe7 | |||
| a0baae8a55 | |||
| 9a66331984 | |||
| c9fab28214 | |||
| e93e1ba2c9 | |||
| f545aee66d | |||
| 203f95d3be | |||
| b3578710cf | |||
| 117e97adac | |||
| 0c4328fbf3 | |||
| 7ed5d85f25 | |||
| c52b4cf450 | |||
| 481af5c469 | |||
| 74da80dbda | |||
| f73eff7517 | |||
| 5557474467 | |||
| 8e24a8b7c0 | |||
| 5a27f7c81f | |||
| 6ce26b72b1 | |||
| 86885c5ed0 | |||
| 2dbaba077a | |||
| 7a2448672c | |||
| 9be3f7d41a | |||
| f40231af5d | |||
| c3a90ccbad | |||
| 145eae321e | |||
| d971678add | |||
| 6c196d3066 | |||
| 346871e27f | |||
| e4b51fa8ad | |||
| 67259d7082 | |||
| 7469981d1a | |||
| db48f7b5d1 | |||
| 75ee536d6d | |||
| 0081dc478f | |||
| 5dc0e51682 | |||
| ba1a6ad4cc | |||
| 34ad9b8a42 | |||
| dbeb4a11be | |||
| b11e22c25b | |||
| 53a475d63c | |||
| e87425f047 | |||
| 67b67003c5 | |||
| 9510551c63 | |||
| b80c7bca0d | |||
| dc27d52221 | |||
| 715f40a48d | |||
| ab8022f74e | |||
| a2bc075924 | |||
| e3dc7e5ec9 | |||
| 18bc2a1a93 | |||
| df38624e10 | |||
| 70d6b8774d | |||
| fa813d02fa | |||
| ffb9ce8287 | |||
| 8b5e29c234 | |||
| e8e9d1d021 | |||
| e324d2e534 | |||
| 1894f1a37f | |||
| 50c607d206 | |||
| 443670262d | |||
| 4626246087 | |||
| fe20fa8326 | |||
| 86c1114463 | |||
| 40b85c1cd9 | |||
| 8f7a3b15b2 | |||
| eed43a231b | |||
| 8622b1254e | |||
| 5e2c112697 | |||
| ecf4b639e1 | |||
| db1550a410 | |||
| 9629af1aa9 | |||
| 30d4e0261a | |||
| 001f5faa0d | |||
| a6ad44a7c7 | |||
| bd87eb6e66 | |||
| 2bb5d1bca3 | |||
| 693a7663e7 | |||
| 8f24db048c | |||
| 13a4700084 | |||
| 018eab7040 | |||
| 5fd7cfbcad | |||
| 54e8487f56 | |||
| 1c2ee8a5f1 | |||
| 09c63e4f00 | |||
| f040282bf8 | |||
| 4fe648b15c | |||
| aef16d51ec | |||
| ff3d4d8b7f | |||
| a11ef2650e | |||
| 8c4e0dfd13 | |||
| 49886ebae3 | |||
| d69a327d6d | |||
| ab11b17d4b | |||
| 7d727ac2fb | |||
| 0d249c7448 | |||
| 93f2fd396b | |||
| d068ec3a3d | |||
| 2c291bc2fb | |||
| 95360a5539 | |||
| 8221f57c26 | |||
| c198a35368 | |||
| c0feea50a9 | |||
| 34fc8e9260 | |||
| 390f0a5dcd | |||
| e8a520ed96 | |||
| 0614ee3f95 | |||
| 929d39f69a | |||
| f72633b9f5 | |||
| 486f31fae9 | |||
| c05180ccce | |||
| afa5b0cc93 | |||
| cb4b6bb2dc | |||
| d3696f3ad2 | |||
| c64f6b3c22 | |||
| 40765c5f8d | |||
| 9a7f426b7b | |||
| f5ddbbf659 | |||
| a7047dd4b6 | |||
| b46fef327e | |||
| 8620bd5a84 | |||
| 1187a7fa34 | |||
| 7175f257b5 | |||
| 60fa6bea70 | |||
| dd7f88bd68 | |||
| 5e5d997dff | |||
| e0d28aa893 | |||
| 8542887257 | |||
| 749530978c | |||
| 828f33311f | |||
| f3a6ae5f00 | |||
| f581992a62 | |||
| 2e22f8e790 | |||
| 9b0bafb82c | |||
| caa6915b83 | |||
| 7c3090ddcf | |||
| 3cbd2e2764 | |||
| afaf5f940e | |||
| 31a1df0fae | |||
| b0ae357cfb | |||
| 95f948a9e4 | |||
| 4091ced5ab | |||
| 03d3966d15 | |||
| 9492f46d77 | |||
| 6816495bee | |||
| 277e9279cc | |||
| d041b0a599 | |||
| b2cff44084 | |||
| 9c2b924dfc | |||
| 2628662586 | |||
| b781ac7346 | |||
| 15130f4f43 | |||
| dcb9bc2544 | |||
| ec30b1294f | |||
| 0560747d3d | |||
| fc35c77f00 | |||
| 04802e41e9 | |||
| ccbc0b91ea | |||
| 3030594665 | |||
| e5991e91f9 | |||
| 1ef3a84cd8 | |||
| 055f33ec46 | |||
| c7183775db | |||
| 0ddc49c313 | |||
| 9ae28415ec | |||
| ec42d87204 | |||
| 40a61ec64e | |||
| e657e170eb | |||
| be8f5bb420 | |||
| 6912c20380 | |||
| 993981428f | |||
| b229107f8e | |||
| 4ec9afac57 | |||
| 1a872b2f61 | |||
| ab389142af | |||
| bd7bad02a0 | |||
| 90ba69a403 | |||
| 03edddba47 | |||
| dbab7ecac8 | |||
| 1822e85f4a | |||
| d734e83af0 | |||
| 0349e8c9af | |||
| 7d19bd6c19 | |||
| da75e463a8 | |||
| 1bc96e3ed0 | |||
| f185802489 | |||
| 46c508b84f | |||
| 5d68c8dbe7 | |||
| b934702c7f | |||
| 58d47ae9c8 | |||
| 9d91c63502 | |||
| 229e8b1b18 | |||
| 799b4f48e7 | |||
| 9ba9358ecb | |||
| 32bab45f81 | |||
| c94fe0c7e7 | |||
| 83d915eca1 | |||
| 22f435ff4d | |||
| 49321a233c | |||
| 1b27351f45 | |||
| c58cc4c2ff | |||
| ddba772297 | |||
| f96f934426 | |||
| 80770aacd7 | |||
| 133e9f2012 | |||
| 5c80763a71 | |||
| c2d40b465d | |||
| 1207300e01 | |||
| bf87a43185 | |||
| 44572fac44 | |||
| c27b1d93e3 | |||
| 8f28817373 | |||
| d738f56d83 | |||
| c90e65ce4b | |||
| d70e01b635 | |||
| 83ec0f526c | |||
| cd9e43704e | |||
| 5128c1ff1f | |||
| 2e9e71ab9e | |||
| 085be6a445 | |||
| ade21f142e | |||
| 06c1890639 | |||
| 89230fa45b | |||
| 2c3c59d018 | |||
| 549b5df225 | |||
| 58d28061a4 | |||
| faae5edf72 | |||
| 29421d7def | |||
| 3c24e76018 | |||
| 4384036108 | |||
| adef31097d | |||
| f3cbb0f941 | |||
| ad57750d25 | |||
| 1dfc742f27 | |||
| 0a6d190095 | |||
| 8a17ae29b9 | |||
| 6e4f82d9da | |||
| 4c1c3147d9 | |||
| 2db12e8986 | |||
| ed207d79e7 | |||
| 2d5d98ec0f | |||
| 1923916929 | |||
| 3654fb10d7 | |||
| cf4f6d412e | |||
| e8cb67572a | |||
| 5a706eee8a | |||
| 9b173d317f | |||
| 9622ca0e37 | |||
| 3346a7ac0a | |||
| 39b60f9b17 | |||
| 8307e06c1a | |||
| b3ff29fcf5 | |||
| 895e10c317 | |||
| 6c06fcee61 | |||
| 1a15136536 | |||
| 79af0bfccf | |||
| 2f9b4439af | |||
| 099eb40ba1 | |||
| 84584002f2 | |||
| 573e790107 | |||
| 2fc713bb94 | |||
| 471c17321f | |||
| e1b96b6d82 | |||
| af5f40a80e | |||
| 53a68783a5 | |||
| 020ad1ac76 | |||
| 35a4551609 | |||
| 76ac7ab4ef | |||
| a00182db8e | |||
| 58c8aefe03 | |||
| d4a8a9ee96 | |||
| 085b27fc3d | |||
| 86e1f63193 | |||
| e21c01708a | |||
| 0bebe553a8 | |||
| 59fc909d48 | |||
| faafb3152a | |||
| b83bc8b3b0 | |||
| e2c787884d | |||
| 72d3e14e8f | |||
| 9f6108ae7a | |||
| 07dc6d2b45 | |||
| ab2c21e7c1 | |||
| 949067cfbe | |||
| eaf70c7bb3 | |||
| 9fc0cabdf5 | |||
| d6279bfff8 | |||
| 1ba25c5569 | |||
| 45b92aebe5 | |||
| 491e3627b6 | |||
| ba6b9fd261 | |||
| f0a4ec90b1 | |||
| 1983991d2f | |||
| 1b517a45ae | |||
| ba5e8befa9 | |||
| 3dd916882a | |||
| 329abb5b64 | |||
| aeed43ec90 | |||
| bb8ff2c463 | |||
| 7e3490959a | |||
| f3e166c58b | |||
| 336841fa1b | |||
| 3f5347dd7a | |||
| 85668cf5a4 | |||
| ea75e7f00b | |||
| 2c1ce8c0e9 | |||
| ed63c43cda | |||
| f42fca9f49 | |||
| 703f79b757 | |||
| 6582afcdbb | |||
| 9573644387 | |||
| 3104d2f738 | |||
| 9bd5739125 | |||
| e0dbe5cfcc | |||
| c6a9de812b | |||
| b7a9d966d7 | |||
| f175a04014 | |||
| d02ecff881 | |||
| f8252702a8 | |||
| 777953923e | |||
| f8b75ce455 | |||
| 43177b1f6f | |||
| 78f205ffa5 | |||
| df02fe0615 | |||
| 24bb7b7679 | |||
| b5423f3c7f | |||
| 8356a6b6ab | |||
| 8488f2e265 | |||
| d1d7408a20 | |||
| 9b0ef7bb17 | |||
| 314246d396 | |||
| ed150bd97a | |||
| d9ddca04c1 | |||
| e98da758cc | |||
| c99c3e761e | |||
| 9e3b6a228a | |||
| 566cb5e3d8 | |||
| 6f24b81079 | |||
| d2bc7b5a95 | |||
| 9dc2005251 | |||
| ed86bd34b1 | |||
| 352510cc19 | |||
| 959a12cbac | |||
| 1b3e0783f4 | |||
| 70455a959d | |||
| 2025650d50 | |||
| f7ea6b12ea | |||
| ba000bf8ea | |||
| 107b3f328b | |||
| a58c9d4d63 | |||
| 8a767689cf | |||
| 60e5e213fd | |||
| 527696ddf0 | |||
| 4fd17f8b54 | |||
| 115b10ed32 | |||
| f2fbfd7a10 | |||
| a31aff452a | |||
| ed19da21ab | |||
| 777d77848c | |||
| 9ffe4694db | |||
| d381948cee | |||
| e00a58a05f | |||
| ecb4ea8f76 | |||
| a5f68e98f4 | |||
| 9fa01a7b70 | |||
| 4ff6a1bc7b | |||
| 8a79b167b8 | |||
| de99f53e94 | |||
| d4a966c7c4 | |||
| 05c1a3d160 | |||
| 788d6a7105 | |||
| 684cf43360 | |||
| 083b08742d | |||
| 80934dc488 | |||
| c67613e0fe | |||
| 65b0b319eb | |||
| 4934f7c5a4 | |||
| e7adce851c | |||
| 7e43a0c2b7 | |||
| 8c349ff8ff | |||
| 8d7ccd29fe | |||
| 87a4f4ab3a | |||
| 71d406b40c | |||
| e785afd356 | |||
| 856a07711b | |||
| 058299cc66 | |||
| 1031dfe4e8 | |||
| 79d41aad64 | |||
| 33212633c0 | |||
| 39e2d64b84 | |||
| 56222f35bb | |||
| 1dc73281f8 | |||
| bf552fdb88 | |||
| 2a330e3006 | |||
| ad3186edb3 | |||
| 8e15c6fd78 | |||
| f708a11f0f | |||
| 677dc802ae | |||
| 57dad685d1 | |||
| dfa04a11bb | |||
| 331af82e6d | |||
| d5b9563263 | |||
| 637d6b4e36 | |||
| 9166e6052b | |||
| 469dc6ac42 | |||
| 0bd33c8d1c | |||
| ca1975cada | |||
| d72494d09d | |||
| 7773b2b4d6 | |||
| 84db82a329 | |||
| ef2548778c | |||
| 6b581c4e51 | |||
| 576d2dbac0 | |||
| 4ec456f0a0 | |||
| 909a25571e | |||
| 5c57e6bdb0 | |||
| 9be80d7b12 | |||
| 80600e5cdc | |||
| a2d6fc7ac0 | |||
| 916f094ce6 | |||
| b0b2d8de44 | |||
| 62513bf20d | |||
| 5ae550c622 | |||
| 1367a58b54 | |||
| ff6ce6cd01 | |||
| 4001e310f5 | |||
| e82af627ed | |||
| 44848d3241 | |||
| 65c46d0cc6 | |||
| 643e4f37ba | |||
| 4cbec82ac1 | |||
| 10c9227136 | |||
| 5309832308 | |||
| 65726e4244 | |||
| 9615f8c994 | |||
| b8a6bfb54e | |||
| a312380367 | |||
| dca9ca1cac | |||
| 29b4fd2774 | |||
| f659f80c7f | |||
| a42789f330 | |||
| abce51fb7b | |||
| 7973a2ca1f | |||
| d89fb163c6 | |||
| 7b36e57551 | |||
| 6f675ae75b | |||
| c8b515ea69 | |||
| 52172e6f92 | |||
| d959d7b9f0 | |||
| 705464258e | |||
| 2b4b946689 | |||
| 4e063be421 | |||
| a9bdf75c5b | |||
| d76b41b50e | |||
| 2f9cbc2e57 | |||
| bd77d100e1 | |||
| 12e8e33144 | |||
| 21026bf7cd | |||
| 647eb243ae | |||
| 7ea5029ae5 | |||
| 64a6b12114 | |||
| 4e31015715 | |||
| ad2127765f | |||
| 98d9369a38 | |||
| 3b4a292ca9 | |||
| fa3cb03f62 | |||
| 0477284b0a | |||
| b290bdafb9 | |||
| 97882d03cc | |||
| 29dd115e9e | |||
| 28d4157ea7 | |||
| 5b867b6f1f | |||
| 66ce8cd7ea | |||
| b8b7ca7302 | |||
| b3755ae670 | |||
| 97fec07d96 | |||
| e0fef2bca1 | |||
| 16d6502920 | |||
| ee90a6cbde | |||
| 59b413c8a1 | |||
| 225c75e4a1 | |||
| cfaca4327b | |||
| a2d6ee2d31 | |||
| a82e70cd40 | |||
| 670ef403b0 | |||
| 46d85fb558 | |||
| a40354d16f | |||
| b92c3182ab | |||
| 2129db6e91 | |||
| 56ec10bfa2 | |||
| 0b9d075958 | |||
| 59221296c0 | |||
| 533bb89800 | |||
| c80a168d9d | |||
| 62cf71002e | |||
| 30175594e9 | |||
| 47134fa1b4 | |||
| 512632e574 | |||
| 4ef6c91583 | |||
| 070ec313f2 | |||
| 73f4907dc0 | |||
| 333973b846 | |||
| d2d9fd6945 | |||
| fa4b9e80e2 | |||
| 5e03011496 | |||
| a68ffc81da | |||
| 1ba72ca0d3 | |||
| 68db42e9be | |||
| 567ae61e78 | |||
| 86488ac1bc | |||
| c0d6f3d23e | |||
| b76ce0e0a4 | |||
| b82bec88d9 | |||
| 784c8436fd | |||
| 7dc162cb42 | |||
| 474a23bda5 | |||
| a2c7afad77 | |||
| e172935658 | |||
| 709cf5d038 | |||
| 72cb06abf0 | |||
| fa5a6bfa02 | |||
| 0d9c63744e | |||
| 20334e3f09 | |||
| 19de675a4e | |||
| 8ceb6f2279 | |||
| a22ee76b45 | |||
| 854ab48de0 | |||
| 8dacbe7584 | |||
| 6a15910f0f | |||
| 29869c5b91 | |||
| b6d45b9743 | |||
| 569011a121 | |||
| 4617758053 | |||
| f0d22dabea | |||
| 26a8ab5719 | |||
| d2cff38db6 | |||
| 3c936ddcf9 | |||
| 47e476c9cd | |||
| 814b78dad8 | |||
| 02eab9ed72 | |||
| 6b4fcd5f73 | |||
| fbdcc0e8e4 | |||
| ade29fc6c9 | |||
| 15837b43ca | |||
| 73ca194313 | |||
| 23d866ad40 | |||
| 24bd44f088 | |||
| b88609a921 | |||
| c17ce1a0af | |||
| 875b4e212a | |||
| a87a5dfdb3 | |||
| e20fb7f429 | |||
| e27ae6483a | |||
| 5b79e5b130 | |||
| 0093eb4768 | |||
| dd243067e5 | |||
| 4990506948 | |||
| 6abfc6761e | |||
| 7818071ba2 | |||
| 82ba3ac894 | |||
| f93c1b942a | |||
| 628f04ae96 | |||
| c2fb4debc5 | |||
| 9ca3dec127 | |||
| 8f7e7cd343 | |||
| 4668836071 | |||
| 9d589379ec | |||
| 3870891d2d | |||
| d294e9d62a | |||
| d57e5c31c0 | |||
| 45a69ebec8 | |||
| eb2c9f1519 | |||
| ccd16f107d | |||
| 65d816c3b5 | |||
| ef1aaf12c9 | |||
| 7bc980edaf | |||
| 8c1d8eccdd | |||
| f95e91e2bc | |||
| 3c4f1b0a8f | |||
| 4cd21a26f6 | |||
| 82d2a0873d | |||
| 53944cbebb | |||
| 9558a35cde | |||
| f6e299b58b | |||
| eae3ed0c08 | |||
| 8d8f3bca6f | |||
| d5afa8943b | |||
| 619e4c94d5 | |||
| 099a16bd86 | |||
| 818a91f4f7 | |||
| 598039c0ed | |||
| dbcb454917 | |||
| 6f69800d0c | |||
| e8a67de0d2 | |||
| 82fd00af99 | |||
| 8fce25d788 | |||
| 2fb4812f6d | |||
| 0d646490f5 | |||
| 7252319966 | |||
| 5195a738ac | |||
| a885480c9e | |||
| d3aeb45400 | |||
| 1b7aa92eb6 | |||
| 8c4b5b6a70 | |||
| 177be2adda | |||
| 6d83a80385 | |||
| e28cc973bf | |||
| 3b15f3e3b9 | |||
| 439072a2a6 | |||
| 7f63b31ca8 | |||
| 7dc88f26f2 | |||
| 87498bc6d4 | |||
| 8a0cc5009e | |||
| 0ede1b5b22 | |||
| d800a0bd32 | |||
| cfdffdd519 | |||
| 25be4186bc | |||
| 39f15be59e | |||
| 6c8014e7d1 | |||
| d7e9201434 | |||
| 2bd4f2c3a6 | |||
| a8eb3e1b29 | |||
| 4a0fa57614 | |||
| 4df4a37b11 | |||
| 1ca7ae9630 | |||
| e741b71dac | |||
| 225bae1387 | |||
| 4d0dd3e509 | |||
| 3314966acb | |||
| 1060c0f439 | |||
| bdbd0129af | |||
| 0854dc3320 | |||
| 8f0669c300 | |||
| a91953b15c | |||
| 5d36ee2fe7 | |||
| 9111538bfb | |||
| 0587f92d96 | |||
| 773877cd12 | |||
| 6bd80ba71b | |||
| 84980741a8 | |||
| 167034fb04 | |||
| e039fc3a63 | |||
| 2f3a9ba1d4 | |||
| 1097d0e810 | |||
| 284e5231c5 | |||
| 6b041c8aeb | |||
| 8388b630ac | |||
| 03eb463f1c | |||
| 75b5e3fa64 | |||
| c37d9573fc | |||
| 3a5f431236 | |||
| f87a0dd6a7 | |||
| c14578649d | |||
| 687ccdf8db | |||
| a4b9ce764c | |||
| e9b033ef3a | |||
| 5da7805623 | |||
| 7d8f1dde26 | |||
| 24e2e0d3f9 | |||
| 017c217bb0 | |||
| f4c4b01455 | |||
| 08941b7890 | |||
| 7ee217285b | |||
| 9e0dee1259 | |||
| d1311518a3 | |||
| 6e13ffe162 | |||
| 00fff3a85d | |||
| f441515357 | |||
| 333e53eee8 | |||
| 7f9253ea0a | |||
| 24acbecd33 | |||
| 70607ce311 | |||
| 7972f47ed4 | |||
| a8f86af633 | |||
| 38d73123c1 | |||
| e06d1e8083 | |||
| 300797d4a3 | |||
| c6cf7f8080 | |||
| cd4b748b44 | |||
| fdd83e5027 | |||
| d9f720a679 | |||
| e8fe6ee4e3 | |||
| ddf6bc86a7 | |||
| 4378e8fcc0 | |||
| 06babf90a5 | |||
| f4e5d777e8 | |||
| 6c25351049 | |||
| e1b66ffd01 | |||
| 2dff9f4c6d | |||
| b390e86b12 | |||
| 08e0c69dbf | |||
| 91c35a7d01 | |||
| 0366c1b093 | |||
| fed22f2f5c | |||
| 9fd32ca5ac | |||
| 176fe6e50e | |||
| 6c051a55e5 | |||
| 90e1e41f5a | |||
| 22ecdd16ef | |||
| 2dac35a97d | |||
| 069f9add80 | |||
| 74c2f8cecf | |||
| 70b6c1f29e | |||
| b6d3657f82 | |||
| 1949412979 | |||
| 4f597f6c06 | |||
| 47dea29e4e | |||
| 41f8e788b2 | |||
| 7afaaef0eb | |||
| dd259503c1 | |||
| 5a79b90ade | |||
| 182b52d23d | |||
| 85db11b70d | |||
| 1e808a495d | |||
| 64916d3d83 | |||
| c727e8a4d0 | |||
| c11eaeec49 | |||
| 8a8523d4f3 | |||
| 9749afb116 | |||
| d68466bb6a | |||
| ab110c0ad1 | |||
| 8781ee971c | |||
| cc06935a10 | |||
| f3a9f13cb4 | |||
| eb3969e244 | |||
| ee1ac1140d | |||
| 94c8e59bbe | |||
| 7e9578789b | |||
| 2f0060e399 | |||
| 7fd53f6ca2 | |||
| 538fd42363 | |||
| 0792ef8789 | |||
| 5bf7f09ac1 | |||
| 2244f1722c | |||
| ab20d2a3fc | |||
| 69a8f110b6 | |||
| 9457bf10ab | |||
| d810c73396 | |||
| 5b868ccd82 | |||
| 687394fa07 | |||
| 5b6ee79cd6 | |||
| 8bb787cdf8 | |||
| 130546e1d9 | |||
| f8061ba3c8 | |||
| bf5f7380cf | |||
| 0f01b40dd5 | |||
| 8edc2e5aaf | |||
| 21d9c47bd0 | |||
| c790299906 | |||
| 514f4193db | |||
| 0a61ebdd66 | |||
| 640d77be25 | |||
| 49dd0305f2 | |||
| 1393fd9e8e | |||
| 3202062e77 | |||
| 265f335dae | |||
| e283a75a19 | |||
| 7bbe002a2f | |||
| 09f0ecdf7a | |||
| 1ae02c0cc4 | |||
| 9079d9ce17 | |||
| dc1d9ae973 | |||
| c219f97f48 | |||
| e1c3237532 | |||
| ee180d5b41 | |||
| a9f3a7de39 | |||
| 5e1a656bbb | |||
| f2440ceae6 | |||
| 8e4fe30db6 | |||
| e8d94ea87c | |||
| 667f5b655a | |||
| 0d2cee45e8 | |||
| d1cecb0f0f | |||
| f2ec7eeb37 | |||
| e869bb6b05 | |||
| fe97dc67dc | |||
| 560ca8c5aa | |||
| d59a520c9a | |||
| 97c1f09961 | |||
| ec0bb66e5e | |||
| fda7bb95d0 | |||
| 546f1d9f15 | |||
| 90ff900387 | |||
| ed96279920 | |||
| b1fc7d46a5 | |||
| e79be78ef4 | |||
| 4a6d582f2e | |||
| e969f184e1 | |||
| a9ebc61f2a | |||
| 1b83bc48a1 | |||
| 5c66ce7f29 | |||
| da6dc6774b | |||
| 20f5fa8e3e | |||
| 76c40e8f0d | |||
| a838a97092 | |||
| ef937dd676 | |||
| 586625f8ba | |||
| 0b4428e92f | |||
| 8fd1bbde76 | |||
| ca9af20179 | |||
| 0f1e193193 | |||
| 7c855aa3e1 | |||
| 24bed38c2b | |||
| f0c0e0c6fa | |||
| 6ffc48769a | |||
| 4a74408eee | |||
| c729fbd652 | |||
| 608968aa83 | |||
| 5caf6244a3 | |||
| eaaba6462e | |||
| 92e9d4ec3a | |||
| fbb2cabe77 | |||
| 3fd2384b81 | |||
| e851a41d78 | |||
| 5e0f95b948 | |||
| f7aa2e0d44 | |||
| a11b7a8293 | |||
| e6062532fa | |||
| e7d35d51fa | |||
| c524f669c7 | |||
| 203ac0f818 | |||
| eab556e1e0 | |||
| 9819ebc095 | |||
| fb6db3dcfc | |||
| 7601c21612 | |||
| cb9b08eca1 | |||
| 48b8aa51cd | |||
| 6e8241b78d | |||
| f61076a5d8 | |||
| 5f5fcef962 | |||
| 12ce6b5c15 | |||
| 27b1f8f446 | |||
| c6e1e3acdc | |||
| 53661d55ae | |||
| 120b7a61c3 | |||
| 470d34ddbb | |||
| a0c2718adb | |||
| a836892edb | |||
| 25518a12f1 | |||
| 2aa15ab3ff | |||
| 807ec00b85 | |||
| 53305d4a7e | |||
| 2863f950d6 | |||
| 12d2bd4adb | |||
| 24ee7b5080 | |||
| aab390c51d | |||
| 8b4871a28d | |||
| cf31243c74 | |||
| 88b689bcf1 | |||
| f589237e23 | |||
| 7da6e9086c | |||
| 68043f4de9 | |||
| c0eaff3608 | |||
| bcce25900b | |||
| 34ba32ff27 | |||
| 857007372d | |||
| 6a661e1e28 | |||
| cc5a6f3b86 | |||
| aa7a964139 | |||
| 73a8369631 | |||
| 6a8f57e5d7 | |||
| eb94dfb442 | |||
| 7be0c78533 | |||
| 97d9ea00fe | |||
| 491502a349 | |||
| 0e4eed0ba1 | |||
| 8ffcc76011 | |||
| c020a7bb67 | |||
| e268fdc0ed | |||
| bb925fe488 | |||
| 1dbdb1cfc9 | |||
| 30b33a4413 | |||
| 945ad277ea | |||
| 6f4e35cc0e | |||
| df8f61877e | |||
| ddb482b14a | |||
| f378f1d585 | |||
| 36f11a54e1 | |||
| f8d0d6365e | |||
| cff79609c8 | |||
| c434198ee5 | |||
| ef70b0baa4 | |||
| b4ddf3d8c5 | |||
| 42b25d747b | |||
| a66b5e2c13 | |||
| 8f0b72be9e | |||
| 15dc6f70dc | |||
| 95014f311d | |||
| 6dfd7e3da2 | |||
| cfe84b953c | |||
| f78b9468dd | |||
| 034dc3b0dd | |||
| 80d1f2ddfa | |||
| d05714995c | |||
| 252e871a8b | |||
| 59b91d6c31 | |||
| 5992c46606 | |||
| 00d2f34888 | |||
| a91a11e533 | |||
| 2423cddb00 | |||
| eb54e5c55c | |||
| 514e6df460 | |||
| 94253e8b83 | |||
| a6baedd02c | |||
| c63092781a | |||
| 2d1350a9d6 | |||
| 2200e13c71 | |||
| 633b0e56a5 | |||
| 8393d755f6 | |||
| 7474ad81d9 | |||
| e805a55a5b | |||
| 14032c6653 | |||
| 17233c687e | |||
| 57cbde3393 | |||
| 579781e35e | |||
| 66f3c1ae79 | |||
| 1ad814a191 | |||
| 221342fb25 | |||
| 5718d09e39 | |||
| b67523550f | |||
| 5a791e6e06 | |||
| 61e76e767d | |||
| 51b5fdba25 | |||
| 379ea15d16 | |||
| 4437e0c3b9 | |||
| fad3a6bf15 | |||
| ab0f0f26a1 | |||
| b7ad95beaa | |||
| 2c8da29f3a | |||
| efd3fafa25 | |||
| d61528b2d5 | |||
| e8b2c5682e | |||
| ce2a65db85 | |||
| 2f3d4df2f2 | |||
| 6205981235 | |||
| 28a78003f0 | |||
| e2a99d24ec | |||
| 601e3aaf98 | |||
| dd2fd39c05 | |||
| 84887d3011 | |||
| 9e298ea1bb | |||
| 65ba2e0adf | |||
| 42e1fe301c | |||
| 7fe97376c2 | |||
| 03407a9da0 | |||
| d56b2b56fb | |||
| d47b1f3b70 | |||
| 090ee46f4a | |||
| dbb57cd0ae | |||
| 0c07836fba | |||
| 835acd3f31 | |||
| f8b03d4a4b | |||
| 413fba14ab | |||
| 44d7435a48 | |||
| f77f2876ff | |||
| 914f57f28d | |||
| ed94136548 | |||
| c973aaabc5 | |||
| 3267fb90c6 | |||
| b10fedde56 | |||
| 8817907647 | |||
| 398ebbac98 | |||
| c43498c6ad | |||
| 389fa5d38e | |||
| 2a1f46c42d | |||
| e225850cc6 | |||
| 10e1de74d2 | |||
| 292dfc2d72 | |||
| b085158d59 | |||
| 904640c9ae | |||
| 06455fc0cd | |||
| 3b191bf2dd | |||
| 56bcdfd7d9 | |||
| 14089b1e7c | |||
| 5f6077bc62 | |||
| 19a914be16 | |||
| f1c91a8d34 | |||
| 5a71f4a0ca | |||
| a449731a57 | |||
| e801e336ed | |||
| 0d01b97b75 | |||
| 7fedfa0380 | |||
| 4a297a2443 | |||
| 108d07c655 | |||
| 34a9ce6eb3 | |||
| f1e50ecab3 | |||
| a0ce12f8ba | |||
| 3d6659112f | |||
| 1055f9d208 | |||
| 403c3c3d03 | |||
| 877b175565 | |||
| 82f889d9b8 | |||
| 7eb37bd1dd | |||
| 384fa95680 | |||
| 2266a8c85f | |||
| 83761d5f8e | |||
| ecbd5b0574 | |||
| c8d8b1fbcd | |||
| 92fb3fb33f | |||
| 02bc17be6f | |||
| 534dcbe017 | |||
| 12cd3b55ec | |||
| bbfa239036 | |||
| c96630c9f0 | |||
| 60f1c9dcdf | |||
| 82aff110b7 | |||
| 26321795f7 | |||
| f780ee12a0 | |||
| e56d6054aa | |||
| 36222c9eed | |||
| 8436dac090 | |||
| 713ec7be45 | |||
| 42569cfd61 | |||
| 7c8a3da0ac | |||
| 9d25bd583f | |||
| 85af8735ab | |||
| ccea0a831a | |||
| 65a6674c6e | |||
| 9698b93d10 | |||
| 78ce5b815d | |||
| 6aec71d7ee | |||
| 83b16ab7b7 | |||
| 54c81cbde4 | |||
| 3cf535926a | |||
| 35738bcadd | |||
| 184862582c | |||
| c4f9ff0285 | |||
| a75840d19c | |||
| f06c44f1f1 | |||
| 844f1d0281 | |||
| a2e9bfbaf4 | |||
| 2e45095e8d | |||
| 027da35c33 | |||
| 2c1161a6f9 | |||
| 5f4b48da34 | |||
| 4e1d396ce1 | |||
| 98bd0a06dc | |||
| f57630d92b | |||
| ae2e4af4a1 | |||
| cb66f82c1d | |||
| 1389fd67ab | |||
| 7a4c5e9421 | |||
| cf1ba0c4e1 | |||
| ebdb0eb0c1 | |||
| 4d80419f29 | |||
| 32d71cf85f | |||
| 2876670de3 | |||
| 36d4c29b11 | |||
| c8930cc279 | |||
| 01f4a173ab | |||
| daf3368d2e | |||
| f6fd3abd31 | |||
| f1c52e426b | |||
| 203dc3bb48 | |||
| 7b8ab4e5c6 | |||
| 73891d619a | |||
| fe4fbc2c3b | |||
| 2ebf4e084a | |||
| df22bafe6d | |||
| c49d5d5252 | |||
| 104502c5be | |||
| 7d6cf66303 | |||
| d1b08486ae | |||
| 205022ceee | |||
| 47998c03f8 | |||
| 27cddfb8e9 | |||
| 3f116468c6 | |||
| 8c2563be41 | |||
| 2493083935 | |||
| e15928b49e | |||
| df434298b8 | |||
| c401168bea | |||
| 0b1f626efd | |||
| 74367093c8 | |||
| 7a472d85ef | |||
| 81c5fae56f | |||
| 9e9926a2f0 | |||
| 6e5da9dbe3 | |||
| b97b650ab3 | |||
| a1d2258ac3 | |||
| 8f04c8b16c | |||
| 2d674fc151 | |||
| 479179638e | |||
| a3d74704e5 | |||
| 90aac764dd | |||
| 46470d92a0 | |||
| a5cd62f7bf | |||
| 12ea8477a3 | |||
| 87db636c61 | |||
| c5c620bab0 | |||
| d84c7e5143 | |||
| 8ba88892d7 | |||
| eb2901bd69 | |||
| c89ae6e537 | |||
| 25c36fb05f | |||
| 71ba54b2f4 | |||
| 18ce529256 | |||
| 26e0f408f0 | |||
| fe494297e4 | |||
| c3569211d5 | |||
| dcc5a2cb22 | |||
| 67842df9e2 | |||
| 8226bd25c4 | |||
| 8efe7bafaa | |||
| 2124361ff7 | |||
| 42459cad02 | |||
| 0def2dbb73 | |||
| 1b0ff57562 | |||
| 95ce21d407 | |||
| ec353dbdda | |||
| f056e713c3 | |||
| 4046d9f850 | |||
| aa55cdb735 | |||
| ec8d39d059 | |||
| d1a3b530be | |||
| a55aed5f42 | |||
| b067e0ca5d | |||
| 85e133a051 | |||
| 4a086cf517 | |||
| fb22028be3 | |||
| 6728b40ad3 | |||
| e77af4ae33 | |||
| 7bc017601f | |||
| decf6cab5e | |||
| 2b635edce6 | |||
| 2aa18ca3e9 | |||
| 4dc788ff84 | |||
| cec700525c | |||
| 20b3261204 | |||
| ab8cf31ae9 | |||
| c0ae812aa2 | |||
| 8b87c4b96a | |||
| cbb21f3cf2 | |||
| 4189214d04 | |||
| e6ed853905 | |||
| 59915a3fc9 | |||
| 22816a4c43 | |||
| 4d84999452 | |||
| 6d4b778303 | |||
| df0b83332d | |||
| be1207e5e4 | |||
| 1255bd8d4b | |||
| f5d9a2a9c1 | |||
| edcbbee979 | |||
| 70ff4af4fa | |||
| 6a395d88ff | |||
| 1f4fdfd599 | |||
| 0c00652f6b | |||
| 91e10a3105 | |||
| 08086178bd | |||
| 839cffdefe | |||
| a362fd80df | |||
| 1237faef80 | |||
| a0d9d6db5b | |||
| 8533b45ce9 | |||
| dcd4f8f5db | |||
| 0cad2d2a83 | |||
| 73316e10a0 | |||
| 69cd9cc1a6 | |||
| 594a93316c | |||
| c6d9ce8fd3 | |||
| 9deaddcdff | |||
| 98b6e1d5fe | |||
| 57dc28fe99 | |||
| c8794c89c7 | |||
| 18edd917e3 | |||
| 6032d86e23 | |||
| 64a9e92390 | |||
| b6075e11b8 | |||
| c19764e557 | |||
| 71768de939 | |||
| f943261847 | |||
| 7763b58a60 | |||
| 6f8be3f693 | |||
| 6113dc1b99 | |||
| 4d4f291553 | |||
| 29faf164b9 | |||
| 435a3e337b | |||
| f92e880d3d | |||
| 8a76fadaa3 | |||
| be5247921d | |||
| e3b42bf93b | |||
| f34a0a874a | |||
| c71dc78cd4 | |||
| f3dde79ed6 | |||
| da0904df2d | |||
| c08a0edea1 | |||
| 27b55ea761 | |||
| 8943441115 | |||
| 6674a024fc | |||
| ee35263e48 | |||
| 84596bff09 | |||
| e3a6d74945 | |||
| dd3c1d3b8c | |||
| 3a5cd12dee | |||
| 2d2499f610 | |||
| c11895f529 | |||
| 004a1cd64a | |||
| d0b2e60edc | |||
| 8e1f31f543 | |||
| a2869109f0 | |||
| 431b3b4323 | |||
| 9966903ae1 | |||
| 8a67858068 | |||
| f5862dacb6 | |||
| 67f9406cbe | |||
| f99a135eda | |||
| e1ec45c948 | |||
| 8acd05f12a | |||
| be01ea734d | |||
| d01a2038ae | |||
| 0e6dd32858 | |||
| bc7923e382 | |||
| c608c232a2 | |||
| 5f9bb6249e | |||
| b76a691bcf | |||
| bc6a355370 | |||
| 37911e60d8 | |||
| c92aa95726 | |||
| 59c6661db0 | |||
| f0453bd853 | |||
| 116c8d0ddf | |||
| 16821b877c | |||
| 45c5f0a549 | |||
| f46eff4eb0 | |||
| 1073175c77 | |||
| 34bfd7ef51 | |||
| 94b236872c | |||
| 7abaae39ec | |||
| 940a90130d | |||
| a42ca2eeb3 | |||
| bf80c94125 | |||
| d0580df339 | |||
| ea5a3e557f | |||
| 22576f4dfe | |||
| 4ca89db22d | |||
| dc88a2bcf2 | |||
| 71f4281080 | |||
| 4bd1e3dcbd | |||
| 30373d2566 | |||
| 914d9662d3 | |||
| ad23c10600 | |||
| a50a355e63 | |||
| 7d67d60fb1 | |||
| fc1d85bf59 | |||
| 125f9f0be1 | |||
| 8e7af7f089 | |||
| a65b5df5da | |||
| 2370c8a058 | |||
| 2b3c140f04 | |||
| ec32022bdf | |||
| 898ca38257 | |||
| 5aac909046 | |||
| 592f8d8c1b | |||
| a9807d8f54 | |||
| d9c0231475 | |||
| f0b606ff77 | |||
| 3542c98d45 | |||
| 00f03c5739 | |||
| 4f6c493b87 | |||
| 73c2a12449 | |||
| 99a9c10b57 | |||
| 9b131b5f7e | |||
| 5232ea1ee6 | |||
| d8d4ea857a | |||
| f3880c60a6 | |||
| 6045608330 | |||
| 0a4b1b8d68 | |||
| 25c17b107e | |||
| 2938860b3f | |||
| 2e33844f0d | |||
| 1e4395a8e1 | |||
| 70c605a03d | |||
| 84e2fa79a0 | |||
| a8844de7b5 | |||
| 0369431ebd | |||
| 50e8f91064 | |||
| fd0ac962fb | |||
| fc8e848a54 | |||
| 26d288bd11 | |||
| adf43e7d2a | |||
| 047764f476 | |||
| 6d4f66472e | |||
| eba176c299 | |||
| 00e43a9022 | |||
| 9148a37624 | |||
| 019b7c5a66 | |||
| 59e825ee02 | |||
| bcc669f3f7 | |||
| e5313246a7 | |||
| 97af608030 | |||
| 181b448c4d | |||
| 289a8da39e | |||
| b85c77283b | |||
| 0742e12f0b | |||
| 9b659736da | |||
| 69a6765bf7 | |||
| 3f68d6d8a7 | |||
| 83b8cd0152 | |||
| 4e542a65a3 | |||
| aa46e31c6d | |||
| ddbd074678 | |||
| 5fdb42a7c9 | |||
| 6c252d8cdc | |||
| 636b7ec0c4 | |||
| 534645a12f | |||
| 09c84a0164 | |||
| cd1c8693d8 | |||
| 325cbd7c84 | |||
| b19cd93738 | |||
| 602b08d9c7 | |||
| 019162486c | |||
| fe7b3f1228 | |||
| 1bc1f3d311 | |||
| a8a51db42b | |||
| 70d49446e9 | |||
| a2620f72c7 | |||
| 50d44e06e3 | |||
| c5fc8e03ff | |||
| 0aa5e43a14 | |||
| 235889ddbb | |||
| c67e75b68f | |||
| 047ad4ff71 | |||
| ae8bb718cd | |||
| 7bbe1a53cf | |||
| b6fe4cc807 | |||
| eecb64a973 | |||
| e72a053cca | |||
| e43997dbb5 | |||
| 813ff37967 | |||
| b8a24b36ce | |||
| d2f13a8259 | |||
| 94d84c5fad | |||
| 1eb2fa9efb | |||
| 7e48fa58eb | |||
| 59ec224009 | |||
| 0ed2cbc931 | |||
| 1ff33e6e4d | |||
| b450811e4b | |||
| 87160cb297 | |||
| dcdd6af5a8 | |||
| badc3bd312 | |||
| b1ed8bc0d1 | |||
| 3b84acfc48 | |||
| 436d7e4eaf | |||
| 910d7dab1f | |||
| b0e9d76ced | |||
| 05b259fe2e | |||
| 6aabd6cc7a | |||
| 19c914db51 | |||
| c057d29192 | |||
| e29de5dd2b | |||
| 1654dfe3a9 | |||
| d3a124c820 | |||
| 86cc4f3aa4 | |||
| 9de87d96cc | |||
| 65f502bc99 | |||
| fcb537bacd | |||
| 3dbf392d48 | |||
| 2b43d4f477 | |||
| cac4a7e5b5 | |||
| 3fddce67c6 | |||
| a5c04baec1 | |||
| 361bb1197f | |||
| 0b33eb0929 | |||
| 8ed1a274e1 | |||
| 70e1b4ddf0 | |||
| bab86d65cb | |||
| aef3019152 | |||
| 28b19d6e3e | |||
| e728ffd5bf | |||
| 4b1455579f | |||
| 1033f2b1bd | |||
| 0a439570a0 | |||
| 50365b7741 | |||
| 62359f70ff | |||
| c5ed507737 | |||
| 7d4a67f2a8 | |||
| d5f152494b | |||
| 1b8acd662f | |||
| 7ad308ea47 | |||
| 6df8ac0342 | |||
| 08112f3821 | |||
| 18ff806d5b | |||
| d0684ac139 | |||
| a8ae9cab08 | |||
| 84535a60f2 | |||
| ca1a0a1108 | |||
| 7d18f49a49 | |||
| 0da947e6b3 | |||
| 6cedc82799 | |||
| b417fb0939 | |||
| cd4176104d | |||
| 5c709f4aaa | |||
| ae5e1f8ece | |||
| a9de6900e5 | |||
| 83b5b86f7d | |||
| ca46171246 | |||
| d4e2e6279c | |||
| 197078e331 | |||
| d0d2faf551 | |||
| a4b5eabccf | |||
| 7b701fee60 | |||
| 99183e98d3 | |||
| c231472ad6 | |||
| 9930076dc5 | |||
| ecb6bcf2e0 | |||
| 74f1295756 | |||
| 3966595f9a | |||
| 0fcc6f5d60 | |||
| 3e45795232 | |||
| 51cb56ef2c | |||
| f39ee9c6a1 | |||
| 84ee4d701a | |||
| 267c5a747b | |||
| edadcfa7d9 | |||
| 62ed6cdc74 | |||
| ce20efb8e7 | |||
| 825b14278e | |||
| 8d4777c81d | |||
| c0b6061a5e | |||
| 2324674dfb | |||
| 53b5afbba9 | |||
| d48d2d7fe2 | |||
| b0bce60c16 | |||
| eff42f6387 | |||
| 5404930112 | |||
| e49febb70f | |||
| 7e680bd9ff | |||
| 766a0c0f25 | |||
| 9fa505027a | |||
| 61c2f094b9 | |||
| 558b17dede | |||
| 86b128dbb3 | |||
| 5560db73bf | |||
| 7349b8f5ce | |||
| 88507fa051 | |||
| 9665dde678 | |||
| 768f4cb7bc | |||
| b15bc194ef | |||
| be4fa03fac | |||
| 164a77e7ad | |||
| 6174f62710 | |||
| d715badbde | |||
| 912de363f4 | |||
| 66e09bc9a4 | |||
| cd7526c973 | |||
| c24f10d647 | |||
| 4bee238cf8 | |||
| f503515082 | |||
| e307065c8e | |||
| 6185f7209e | |||
| a2811d93dd | |||
| 9c5b231b2d | |||
| f2070c9f5d | |||
| 34e414dc31 | |||
| 92d23fb1a8 | |||
| f8b14a1612 | |||
| 8f1345091e | |||
| 17dcf0e82d | |||
| d329674f68 | |||
| cadd1a0074 | |||
| 1625ffa2cf | |||
| 72de03d749 | |||
| 0be1bf551b | |||
| ef0650179b | |||
| 38c62f6461 | |||
| 6fb9d42c3f | |||
| ef04ca9e0f | |||
| 6074f92d48 | |||
| 0b688cd23f | |||
| 59cbaca4d3 | |||
| 66feea6cac | |||
| 7707c9bfba | |||
| 85b1c4060c | |||
| 07bec6bdcd | |||
| 159ea22b6b | |||
| 682bd2eedf | |||
| d8a737b4b0 | |||
| af1ea1f7ac | |||
| 3a8a73ef6c | |||
| 4781f0a337 | |||
| 4b8275061e | |||
| 7933fff0dd | |||
| 2c4d3d92c7 | |||
| 15b909e80b | |||
| a82d2363f4 | |||
| 13c4a02157 | |||
| 0042bacd88 | |||
| ffe49bdebe | |||
| 4d721e368a | |||
| 7b7033ac60 | |||
| 552c3ba869 | |||
| 5b41599911 | |||
| b833d512ec | |||
| 5ce38e516e | |||
| 611cf8d86f | |||
| df5ec54fb8 | |||
| a3ec2ac3c5 | |||
| 69830b1851 | |||
| bbbec300a6 | |||
| 6d06fcb414 | |||
| 2aa380752c | |||
| 03850008b9 | |||
| fc9e031454 | |||
| 74d321d901 | |||
| 7bfb38055c | |||
| 81519537ae | |||
| 0f12351a41 | |||
| 7aadbc9607 | |||
| ce65975625 | |||
| a25c443d1f | |||
| c2c7333107 | |||
| cb9e110adb | |||
| 0595ab3eef | |||
| 800294ad4b | |||
| ac58405a71 | |||
| 9bf6ec6fe1 | |||
| 7ae19467b5 | |||
| fe95d5a720 | |||
| 0105518422 | |||
| 22c0bb7dc9 | |||
| b19f81b35b | |||
| 28717d0437 | |||
| 5ea50d1e8d | |||
| e703c3090a | |||
| a79d0e19ad | |||
| 872500c4a5 | |||
| 7eb1065944 | |||
| cdc2aca2cc | |||
| cc2ee923e4 | |||
| f5dba12762 | |||
| 86ff4a1ccf | |||
| 614e254331 | |||
| 6fe6436162 | |||
| 29e4a4940d | |||
| f7913e2c84 | |||
| 73ac5321f5 | |||
| 2e56a47f8c | |||
| 666fc0ba69 | |||
| cfd845ac07 | |||
| 2a8344f75b | |||
| 762138e77e | |||
| d381e499ea | |||
| 0ed3209b00 | |||
| bc547c4290 | |||
| 9e4a8a31e1 | |||
| b900496c40 | |||
| abad8977b6 | |||
| 6c135261b2 | |||
| a44573c43b | |||
| cd689c640d | |||
| 378e05c16b | |||
| 486cfd1040 | |||
| 3c795a0dab | |||
| 6fbf0758bc | |||
| 89d855c0b7 | |||
| 1f465a0ef9 | |||
| a47fbd2610 | |||
| 99ed085752 | |||
| c95bc0c7fd | |||
| 11ddb9332c | |||
| 606a5fd537 | |||
| c4b158ff91 | |||
| ec076bfba3 | |||
| 92be112388 | |||
| a83c12c3d5 | |||
| 7f554f3cc4 | |||
| 92b35e6758 | |||
| 91c1d7697f | |||
| 5b27fb506a | |||
| f2b3e5f517 | |||
| 807f5e33ad | |||
| 11330b9253 | |||
| 2af6f68452 | |||
| c38620e966 | |||
| 8254169cf5 | |||
| b6abf0d3f9 | |||
| bd6a6690f2 | |||
| cdbbccbef8 | |||
| cbf2b51e40 | |||
| 13f374660f | |||
| e34b64c979 | |||
| c180047bc1 | |||
| f071a48ec7 | |||
| a1479cc2c1 | |||
| 2feb0c2f61 | |||
| 107582c767 | |||
| 636d6368ee | |||
| 04edc8fe3a | |||
| 559235ac74 | |||
| 5d369afe27 | |||
| 49a5280198 | |||
| e5d1790b7b | |||
| 5b17410f7c | |||
| fed2a277e0 | |||
| d59472bf40 | |||
| 6f48dc2482 | |||
| 8082011546 | |||
| 7628c143f4 | |||
| 5d0a8d2aaf | |||
| 019de554a0 | |||
| 3ee8079f35 | |||
| e4aa2ccd66 | |||
| f37f4cf3b4 | |||
| e7d62d6ef3 | |||
| b29893b938 | |||
| 1c88a566e0 | |||
| 3f37be5a30 | |||
| 9db5cbf9a4 | |||
| 8e6280fc8e | |||
| f8ad289311 | |||
| a9b5233f67 | |||
| e57f22a386 | |||
| 12662e064b | |||
| 1c46034166 | |||
| 2178c5e95e | |||
| b3018ba89e | |||
| e75056a084 | |||
| 51fc891a5c | |||
| 0f34628af7 | |||
| c3cced0f89 | |||
| 397b57dd72 | |||
| 01b581048d | |||
| 438e456ce9 | |||
| b389c1cfe7 | |||
| f19f2bbcde | |||
| f6d927ef3b | |||
| 75b980ac64 | |||
| f723cede2e | |||
| 6c5dd5cf6d | |||
| 3a09da71d8 | |||
| 3cbe60cca2 | |||
| 2674c6b5e0 | |||
| 45d11dde57 | |||
| c7f1843584 | |||
| b1d208891b | |||
| 017a38a54e | |||
| b45403ed75 | |||
| f50ec229de | |||
| 3e33820ee5 | |||
| 73d4f12c14 | |||
| 20c08eab73 | |||
| eb136ebba6 | |||
| 1a9d8e9447 | |||
| 0eb1bfa874 | |||
| 5ebb234746 | |||
| 394101d6ed | |||
| 3c6983a2bd | |||
| 56bda8917d | |||
| 6936ec7dbd | |||
| e730048f69 | |||
| 751cee8e67 | |||
| 0608227e10 | |||
| 2210ed4fdd | |||
| 65061948af | |||
| 55dabd2858 | |||
| 88e6daa315 | |||
| baff521b63 | |||
| bbba9ac121 | |||
| 1fbdca83f5 | |||
| 3a0039d204 | |||
| aa70199ce1 | |||
| fcdd833059 | |||
| ba940dec38 | |||
| 42f449880c | |||
| 2610a47c89 | |||
| 55260a8d3c | |||
| 43e4e1b624 | |||
| e89501a3ad | |||
| 992a81dcaa | |||
| 2e772510ea | |||
| c6fb99357c | |||
| 7190028b23 | |||
| bafdc44d37 | |||
| 1af16afb89 | |||
| b9cf65e905 | |||
| 8a3a75cc16 | |||
| fbe18e80f6 | |||
| 06bda58a2c | |||
| e89ae986fa | |||
| 8f99083726 | |||
| 51cef2651e | |||
| 0205238dca | |||
| a0c658b012 | |||
| 22dfc1daf1 | |||
| e51a8e047c | |||
| 0a7c60b439 | |||
| a0e1def83b | |||
| 2fc1edfc96 | |||
| 3921fab285 | |||
| 48ed769b18 | |||
| bffe254a81 | |||
| 63fb79b519 | |||
| c51567ae45 | |||
| 97181a90ba | |||
| 981009ac1f | |||
| 96aebbe7f9 | |||
| ed71f62181 | |||
| 888d0cda40 | |||
| 4085bbf758 | |||
| 49f214b275 | |||
| 8e21f808be | |||
| ac22d3c817 | |||
| afa633b7bc | |||
| 62737c777c | |||
| 42d942e19c | |||
| 7267e94be7 | |||
| 184daa155f | |||
| d7a1d2230f | |||
| 9c4f0a984f | |||
| 8fb48c09f7 | |||
| 6e4f9433d0 | |||
| c624967049 | |||
| 20a2dc6ac5 | |||
| b1b2528e50 | |||
| 1bd865120c | |||
| bacc96f4e8 | |||
| cc3f9323bb | |||
| c964aa3333 | |||
| f9ac1665b6 | |||
| 942672ad91 | |||
| 9cceccd645 | |||
| 47ae5197a9 | |||
| c9c759f700 | |||
| 7db612a545 | |||
| 18a4ced07a | |||
| b9b553b8bc | |||
| 0c79f4a00f | |||
| cc626a3b5a | |||
| 14af2a0c0c | |||
| bc348eb8ab | |||
| 6e4dacc0b3 | |||
| e1ebc4e991 | |||
| 67acfc6e25 | |||
| 87984f2c6a | |||
| 15df161b22 | |||
| 988a5626f6 | |||
| 22496742b4 | |||
| bc9c9abab0 | |||
| c6fc7ccb5e | |||
| 93813fec6e | |||
| 7809c4156f | |||
| 37d99201ca | |||
| 5feb1c94a7 | |||
| fd1eb63fee | |||
| cd428fb798 | |||
| 476c513447 | |||
| 639b800787 | |||
| 712689e81a | |||
| 03cefa7bfe | |||
| 2dc76d5009 | |||
| def444d99f | |||
| 5f80e42dac | |||
| 7b0d2d189f | |||
| e0e40405ed | |||
| ff037ebe5f | |||
| 91c0b13743 | |||
| eb9fcf4f08 | |||
| 1f214d232d | |||
| ede39b85f6 | |||
| ff190b1ef4 | |||
| 1a495a5817 | |||
| 09d283a39d | |||
| 8b1b126e3e | |||
| 5384d2f090 | |||
| b4813e6bdf | |||
| 4b52b8df34 | |||
| 60cbc46da1 | |||
| 9e6ef99422 | |||
| 58a83e99c0 | |||
| cc9ab7e582 | |||
| bc93775385 | |||
| b4367c92f3 | |||
| 825c0ffdb4 | |||
| 69f2590359 | |||
| 7060ee4d00 | |||
| 390be6d5b5 | |||
| a385fff3bf | |||
| 7b8fb64f21 | |||
| 0c291c7768 | |||
| 5bf39ceb5d | |||
| 48e07437f0 | |||
| e5766513a4 | |||
| 9cdeb6dfbf | |||
| f9aa411c92 | |||
| 436a1f72a5 | |||
| 7e3e9144de | |||
| c704942b8a | |||
| acedb4a579 | |||
| db0a159229 | |||
| 2eb61a4a99 | |||
| 868ad16041 | |||
| 21c8e6d02d | |||
| a871f9e4f7 | |||
| fb5cd42c6b | |||
| a36ebaecdc | |||
| bf418ba342 | |||
| be9767e014 | |||
| ab5e09e428 | |||
| 607231641f | |||
| 91323549f4 | |||
| 9e9881aacc | |||
| 734ea77c9a | |||
| d96cac1341 | |||
| 0622146a93 | |||
| db980b0eca | |||
| d1c5e79ec3 | |||
| cca99bf824 | |||
| dcaad315e7 | |||
| 08a5fe3661 | |||
| c95f3eff6e | |||
| 9ae86a922c | |||
| 276459e57e | |||
| 223830a5ee | |||
| 410d44d67d | |||
| d7cbe6e947 | |||
| ad051cdd99 | |||
| b1fe298764 | |||
| a6c02af099 | |||
| c97c1a2454 | |||
| 9b1b281c7b | |||
| 185faf99bd | |||
| b903ff8992 | |||
| face2ea612 | |||
| 3fd03964a3 | |||
| ccea108806 | |||
| 8d5a5d5ceb | |||
| a3a446c197 | |||
| c63b4433f4 | |||
| 505c90e104 | |||
| 97b8a089c7 | |||
| 69e5ac6f02 | |||
| 3da9598add | |||
| 437da0a3d9 | |||
| d026d7dcfb | |||
| 110af09bf9 | |||
| 73af899b7c | |||
| 2d8f2c2aea | |||
| b066dd36ff | |||
| 1563300197 | |||
| 2914443685 | |||
| fef1f9b0a7 | |||
| 2808bea7fa | |||
| d30a0c6f03 | |||
| 0246cffc34 | |||
| 22dece8146 | |||
| 4566105578 | |||
| fee2049642 | |||
| e2499e5b2f | |||
| 60bcb16ca8 | |||
| 2a781bb616 | |||
| 4eb9f175a4 | |||
| b2b56b6896 | |||
| 5ed354221c | |||
| 827c7515c9 | |||
| 23f26fb4a8 | |||
| d4ef5bc16a | |||
| 26fe8bd4f2 | |||
| 4857cae6ed | |||
| 1ba29cc95d | |||
| df5b2224d7 | |||
| f1fe873375 | |||
| b0c6bd0a5b | |||
| 4ae30ecdd9 | |||
| 937b8e4277 | |||
| e356ca2369 | |||
| e955bcb872 | |||
| 88225eb65e | |||
| ec24091578 | |||
| 024be9b8c9 | |||
| af9c8377eb | |||
| 29c186a022 | |||
| baf9e32af3 | |||
| 8b168175ec | |||
| 83655ba9be | |||
| 0873ebb9b0 | |||
| 5e82c98a9f | |||
| babd21c764 | |||
| 47e1133e71 | |||
| a972f0d4ea | |||
| f7175f5050 | |||
| 1ea1ff197d | |||
| 5ea8ea440b | |||
| 050916fd6b | |||
| ada753a54c | |||
| a96c5b5d90 | |||
| b2d8e8c508 | |||
| b2673a19cf | |||
| 905a9dada2 | |||
| 3935e13603 | |||
| af8ed9d09f | |||
| 638a91f92f | |||
| 3562a05d90 | |||
| 6c1247b38c | |||
| b7ff9ddcdd | |||
| 25161fc56f | |||
| 0739f28e56 | |||
| 046045239c | |||
| 7d55c09a9f | |||
| 0be1f4a573 | |||
| af4d6f34d8 | |||
| bd6fb497bc | |||
| 949ec486c5 | |||
| 556768ead1 | |||
| 2cfe29276e | |||
| 752f232335 | |||
| 92a0808379 | |||
| 3ae7515955 | |||
| ecc34dc521 | |||
| eabf728682 | |||
| 29b0ef44aa | |||
| 3010cc5971 | |||
| bfb12acde6 | |||
| 44699c59b3 | |||
| fee87ea3f7 | |||
| 6a80834ed4 | |||
| 593329401a | |||
| ef332dc550 | |||
| 746d5f5021 | |||
| cb5bc1832b | |||
| 5a22d81fe5 | |||
| 0a19b07055 | |||
| dbe9ee0924 | |||
| 4b968d1fe2 | |||
| d077778074 | |||
| e615fafe2d | |||
| e4aa39f9e5 | |||
| 8ac2c5d620 | |||
| 6be25727ec | |||
| 04b4495493 | |||
| 9661d60f74 | |||
| 8a05c195f7 | |||
| 2c1b4f5711 | |||
| ffb9554787 | |||
| b638aa74d7 | |||
| fdc4344acb | |||
| 421c5dee12 | |||
| d25ee8a273 | |||
| 6c6900a6cd | |||
| 21bd834a59 | |||
| b969d86415 | |||
| fe58b58937 | |||
| 87595a6b3a | |||
| b9f94c9315 | |||
| 56fe2dc1ed | |||
| e268606e26 | |||
| 0d979a741b | |||
| 9a2317e063 | |||
| d99ced6ec8 | |||
| 9ff33dacfc | |||
| a6f5e1f0ca | |||
| 08515281b9 | |||
| f7d85bfed8 | |||
| 3250f11f0c | |||
| d068e27420 | |||
| 18bc4db75c | |||
| bc18fb481f | |||
| 5f6ce6f4b0 | |||
| 558e4d9c2d | |||
| 440e8d4efa | |||
| bc7f649d68 | |||
| ad8bbaf008 | |||
| ed397cfbea | |||
| 5669ee815b | |||
| 2a21c10837 | |||
| 800da724a3 | |||
| 0136711cf4 | |||
| 2a2537725a | |||
| 49afb28738 | |||
| ab748188b1 | |||
| e340ff9c3a | |||
| 629a06d9b6 | |||
| f646f61dad | |||
| ca9a3af704 | |||
| eca5906a75 | |||
| b872d14376 | |||
| d3e3d0996c | |||
| 20c11d3b7b | |||
| 089aac61f3 | |||
| 1f18282f04 | |||
| 529632f8d0 | |||
| a13cbced2e | |||
| a9effeeb35 | |||
| 69103a9fab | |||
| a729f985fd | |||
| d43087cafe | |||
| 0bf823e1eb | |||
| 39ee07b8f6 | |||
| e187219699 | |||
| a56d7592f0 | |||
| 5e93c82023 | |||
| a6d634b5b8 | |||
| af8fc3e209 | |||
| 22467599c4 | |||
| 68cc2e292d | |||
| 45365e4df1 | |||
| 139b32734e | |||
| 488d4df520 | |||
| 5f6fb16fda | |||
| 06d22af2bf | |||
| 6e593cd1f0 | |||
| 386f402e0c | |||
| 9efb24943e | |||
| 55b7073aae | |||
| bf6548dc1a | |||
| 0f0f5652fb | |||
| d4c905bf77 | |||
| 7ff294dbe6 | |||
| 332588fcee | |||
| 2fd0229493 | |||
| 18c1e32047 | |||
| 315dac4878 | |||
| c58152d94b | |||
| a0d7cf89f2 | |||
| 7475d23fec | |||
| 3dee92ec50 | |||
| 587df6d942 | |||
| 513c2b92a4 | |||
| 84cec17913 | |||
| e8ee284710 | |||
| ea2c13c91e | |||
| f57106b00a | |||
| ef8c919e3f | |||
| d9107601c3 | |||
| a08044d6f2 | |||
| aea25e7f90 | |||
| 89b6e68e1e | |||
| 62c4cf3ac6 | |||
| 945706a8e8 | |||
| 78788e1efb | |||
| b143f7100a | |||
| 5a9461056b | |||
| 08b5dc64af | |||
| 8f05af8d05 | |||
| e932160a8d | |||
| 39e742765a | |||
| 50aa4f8887 | |||
| c67ad49378 | |||
| b8af7c5f86 | |||
| 3f794cd951 | |||
| 222149b9c6 | |||
| 22fcbaed64 | |||
| a0d3d11470 | |||
| f1695bdc38 | |||
| c39b4b8be1 | |||
| 242cf538b4 | |||
| 4059f8b3a3 | |||
| 9a70fd0123 | |||
| 17a85b16fc | |||
| 50b651655d | |||
| cc547e8260 | |||
| bb679f978d | |||
| 2ad27f5757 | |||
| 8a31a37434 | |||
| bf718b0865 | |||
| 2d813910de | |||
| 3b993431be | |||
| c57aef75de | |||
| e70b75b51a | |||
| 8755a19e02 | |||
| bdd8cc697a | |||
| 2c7a123ed8 | |||
| a936ec325b | |||
| e5890fc92a | |||
| 1283d62e49 | |||
| d9ab31490c | |||
| 6a5298a532 | |||
| 8129f5378f | |||
| fb8143d55d | |||
| fd20529686 | |||
| 92deccbf41 | |||
| 48c4bea57c | |||
| 2e68f89225 | |||
| 2d0611bc01 | |||
| fa109b94d9 | |||
| ca245e995a | |||
| 0624411875 | |||
| 63584bc4d0 | |||
| f7df5dd32c | |||
| 70c5d69640 | |||
| e012ccda4a | |||
| f4136679ea | |||
| 3358b8910b | |||
| 73298ea875 | |||
| bd8e6b7e14 | |||
| 6757101f55 | |||
| 37ba1d6f2d | |||
| 7ec59fc097 | |||
| 0e44ad5543 | |||
| 4196543cd5 | |||
| 6da62f56fa | |||
| 99fae8146f | |||
| 2f0036c918 | |||
| 9dea296241 | |||
| 2566ef3515 | |||
| d891e9b1d8 | |||
| 8646d5fb84 | |||
| d343a58580 | |||
| ed3d2cd122 | |||
| 6bf8fe815d | |||
| a391871cce | |||
| 41b23fde9f | |||
| 48cc1b351d | |||
| 5707304777 | |||
| cb0d695984 | |||
| d60de63fa0 | |||
| a90a93b454 | |||
| 6857870412 | |||
| 3c229aa2eb | |||
| 62df5e8c8b | |||
| 4435ec5f26 | |||
| b421ebef86 | |||
| 701c7e5685 | |||
| 0ce7c33bc8 | |||
| 7dc6b1d7d4 | |||
| 58b890b9f7 | |||
| 6639348c5e | |||
| 9640bbe76d | |||
| 7d168d3d6f | |||
| 32bb71d686 | |||
| 822d33d64b | |||
| d547c6b1a2 | |||
| 31348f8c30 | |||
| bc09d1ba3b | |||
| f1aa180a40 | |||
| 8c7f19850f | |||
| da257f3397 | |||
| 622318aeae | |||
| b8b5d83ad0 | |||
| 93c3f20deb | |||
| 258b13f2e0 | |||
| 42cd061af0 | |||
| f6daaccccf | |||
| 18ca3d1e62 | |||
| 2457bfc1e3 | |||
| f6a165d10f | |||
| 92093a6e6c | |||
| f1e8aa70a0 | |||
| d25344c257 | |||
| 62ee92e3e2 | |||
| 375ec5ed7e | |||
| 758f914249 | |||
| 121fa04906 | |||
| 5ea1c72291 | |||
| f5dff87242 | |||
| f0ef7bd149 | |||
| 0e6c335077 | |||
| ce41a15437 | |||
| d9e364f31f | |||
| 32bf712102 | |||
| 98e0d13f99 | |||
| c9d3c0f206 | |||
| 9e381d0782 | |||
| 169add5aa6 | |||
| 597b3f4456 | |||
| 26ad229bd6 | |||
| 45afd29b72 | |||
| 954e2f9b9c | |||
| 13317bdfda | |||
| c4c1e94088 | |||
| 30ff197f78 | |||
| 8877e3aedb | |||
| 9c973144d8 | |||
| 576a85368d | |||
| 2d34443834 | |||
| f8598e173b | |||
| d63f698cbe | |||
| 44b75eb116 | |||
| 248e2c7d47 | |||
| 37ab318657 | |||
| cad7c4d51d | |||
| fda1e76776 | |||
| eeba5c3603 | |||
| 3eb9a655c7 | |||
| d25cbaaba8 | |||
| 4970a56341 | |||
| f080d9390a | |||
| f4265d251a | |||
| f2105419fa | |||
| 89bb028bfc | |||
| c92c99ed0b | |||
| 570083fb9f | |||
| b32685c714 | |||
| 2ac57a2b1f | |||
| b05789ff0b | |||
| 572a7bf6ce | |||
| 200c8a0d3a | |||
| 4832c24ef7 | |||
| 8b094755fa | |||
| 1caca2112b | |||
| 42fbbfecc6 | |||
| 46a668c565 | |||
| 164a41b399 | |||
| 791a11f949 | |||
| 334241d82e | |||
| 7791839f22 | |||
| 2f94637899 | |||
| 936234d5b1 | |||
| e1b102e9a6 | |||
| 72001dc13c | |||
| 3df41b3263 | |||
| 7b4f323b8b | |||
| ee6aacee9c | |||
| 62c6656130 | |||
| 4acdcfd008 | |||
| 273add5d5d | |||
| f7a273cfb3 | |||
| d57321f7c1 | |||
| 146be78390 | |||
| cc17400849 | |||
| 1114cbf671 | |||
| 82ad0749af | |||
| 0451629e22 | |||
| 86b55b3923 | |||
| 01519313d7 | |||
| 7e12c879c2 | |||
| d0f902053f | |||
| da208216ee | |||
| 235b00b6ee | |||
| e8caa9b5c0 | |||
| 05b99a4dde | |||
| e6ee800fde | |||
| 72f789bf34 | |||
| f6265500fb | |||
| b1f46b6d69 | |||
| d991054202 | |||
| 0c4e294504 | |||
| 5c572ffa1f | |||
| cae467cda0 | |||
| 3e9a659f4c | |||
| 33ba7867f6 | |||
| 80519a0278 | |||
| d743a4c969 | |||
| 02d98d3242 | |||
| efa0e75eac | |||
| e1ab227b6d | |||
| 7067c1597d | |||
| a0e26817e2 | |||
| dde04d5d3e | |||
| 91ef0b9537 | |||
| 964dda2ef2 | |||
| e3b12bdb59 | |||
| 3571e8f263 | |||
| 91e56abcf1 | |||
| 4ee3034496 | |||
| 034aaa7a70 | |||
| 8f05126619 | |||
| 6531fd142c | |||
| 518c6ae8c6 | |||
| 048feeb3f0 | |||
| b00dff83de | |||
| 4a81492b68 | |||
| d861c03366 | |||
| 52a60526f1 | |||
| ee26889205 | |||
| 537ab13842 | |||
| 01acb08c7b | |||
| 11fa0094ff | |||
| 5c43a394c5 | |||
| 183081ccd3 | |||
| 897b071b97 | |||
| 6258ff36bc | |||
| c7516b840a | |||
| 8ffa29473f | |||
| e0ff5106d3 | |||
| 603fa03ac6 | |||
| 8a094a5f54 | |||
| ef7833a271 | |||
| da3da84a20 | |||
| b18983a005 | |||
| bee5cb504b | |||
| 717b2f496f | |||
| a2f7132648 | |||
| 7555ab194f | |||
| 91f680aff6 | |||
| 3202bbe17c | |||
| bc3280d64d | |||
| 8e7e24ac80 | |||
| cc5da83474 | |||
| c515e878ab | |||
| d195f2775a | |||
| b7fa6d84bc | |||
| 9c14a2f0aa | |||
| e80766abf0 | |||
| 25a4559565 | |||
| dcfc1fe17e | |||
| 63cd581d75 | |||
| c48807c383 | |||
| d0509f6702 | |||
| 1fc9425bb1 | |||
| 8285924cf3 | |||
| 97aaaf50b8 | |||
| c5f2170ce8 | |||
| 6fc5697950 | |||
| aacae20657 | |||
| c9fe702671 | |||
| 7123d9c376 | |||
| a893b147dc | |||
| a57718e1ac | |||
| 8b1146deb2 | |||
| 97ec91ad67 | |||
| f6deaf5f2a | |||
| 1e3052d3cd | |||
| b67c64e2c8 | |||
| 301ab43897 | |||
| a710317aa0 | |||
| 8f301151e4 | |||
| 688fcf14f3 | |||
| f0fb665407 | |||
| e74c475162 | |||
| cc5b99c236 | |||
| af09cb2834 | |||
| 5adc0bf3a7 | |||
| 58dc58aa51 | |||
| 2eb3c02059 | |||
| 179ef0a975 | |||
| ea6fe71a50 | |||
| 76f7fb5231 | |||
| 54f0616a13 | |||
| f694192878 | |||
| ea4bcadb38 | |||
| 9b173e2db1 | |||
| 89172c08a2 | |||
| 336996152a | |||
| 588ca5d126 | |||
| a2120263de | |||
| 8c84763ed3 | |||
| 87a98e4562 | |||
| e63d3dd25f | |||
| b6949c5088 | |||
| 870d9502bb | |||
| d5e64f4eb2 | |||
| 3b38eeaccf | |||
| 2b8f888ea4 | |||
| 316fb26f5b | |||
| a835517049 | |||
| 5c325466e0 | |||
| 98db804541 | |||
| 71e1889825 | |||
| 4e28c00e7b | |||
| a5b5684670 | |||
| 78a310630f | |||
| 999f41fb4f | |||
| 3a8dbebd37 | |||
| 0d854db361 | |||
| fdb3d4ff60 | |||
| 9e5c9dad55 | |||
| e7b9cfa8f2 | |||
| 1d4a29f149 | |||
| e5f129424c | |||
| 66b0651607 | |||
| 803274e207 | |||
| b7ff13b603 | |||
| 9e239c7a1e | |||
| 19270103ec | |||
| 7f1114d935 | |||
| bdcb81e81e | |||
| d1e7a7e06b | |||
| 6b2510d312 | |||
| a048cb9f0d | |||
| 87598c8749 | |||
| ca9a88785e | |||
| 2072168a1c | |||
| 6ff9fc67bb | |||
| 800f656402 | |||
| e2bfd1a036 | |||
| 7f9fe6f1f2 | |||
| ef2b73043d | |||
| 7a10369f4b | |||
| 14b76a5bca | |||
| 8bb3863f52 | |||
| fa288af58b | |||
| 0e7edca7e3 | |||
| 9e5a8ba9f5 | |||
| c9fb1434c0 | |||
| a5ea5888b8 | |||
| 2c7a15b195 | |||
| 0ebabe17df | |||
| 5ada462773 | |||
| 69e19b88c2 | |||
| 41519d3ac0 | |||
| 9a10bdbae5 | |||
| 4bbe67451d | |||
| 651a1d2869 | |||
| 7c334f45c6 | |||
| 0f8faa3441 | |||
| 5e68b28ad3 | |||
| aa54acd54d | |||
| 87c27a074d | |||
| 4af3ca4e4d | |||
| 953160ddd6 | |||
| 5c961169cc | |||
| 94dbc35d92 | |||
| ad2e864a9a | |||
| e0489cb4a6 | |||
| 922ac1a1ec | |||
| c95a97389d | |||
| 2a8322ddbb | |||
| cfb964834c | |||
| 73c3d14a66 | |||
| f6ceeaa2e5 | |||
| 6847cc9f1c | |||
| 411d36ff13 | |||
| 63ae5f00b1 | |||
| 43e0912516 | |||
| 64533009b3 | |||
| 8aca8d90d6 | |||
| 9ca39821c8 | |||
| 2e608b1c97 | |||
| dcc63d7408 | |||
| 5e32de8173 | |||
| 5375a77f84 | |||
| 2f4a3e40eb | |||
| 15aa0df23c | |||
| 3166d0c667 | |||
| 339793143c | |||
| 8be1ba708e | |||
| 0bd357e7ec | |||
| cfe849bd43 | |||
| d8c70e2e73 | |||
| 03bf0a89b5 | |||
| 1ce9ffcc7f | |||
| b1ef44b1ac | |||
| da0a36c323 | |||
| 8d6b8b45b6 | |||
| 5d699e9ba5 | |||
| 321c0ec533 | |||
| 4ad45af53f | |||
| 37a7e08b38 | |||
| bab4bc0968 | |||
| f6c4901b8f | |||
| bb6496d9e5 | |||
| c2de5cf735 | |||
| 2959e7aba9 | |||
| ce1cc352d9 | |||
| 350d483a70 | |||
| d34eec3ab3 | |||
| 2be955a0ef | |||
| 830bff1241 | |||
| 16fb74425e | |||
| 3786d30320 | |||
| adb62403ec | |||
| 50b9a5afa9 | |||
| 230f22b1cd | |||
| 06a9c16961 | |||
| d22506092e | |||
| 728bd68977 | |||
| 65519ab786 | |||
| 886b1f39d9 | |||
| cbced23de4 | |||
| e58a778bd5 | |||
| 1c49796e8e | |||
| 6b0661cca1 | |||
| 46f05f2db6 | |||
| 15a6586062 | |||
| bdb6b45c91 | |||
| 1170d74868 | |||
| 6ae5a9f07a | |||
| cc1a95d161 | |||
| fffd0f5b68 | |||
| 89480801b8 | |||
| 9deb206e74 | |||
| 27cf941284 | |||
| 04cd09a30a | |||
| 3ea889050b | |||
| b46e741c95 | |||
| 34f9c039c5 | |||
| d35422b523 | |||
| d61f5d160d | |||
| 68ef903a7c | |||
| 06407b4d14 | |||
| 12213f9985 | |||
| caa5e3b4c5 | |||
| 2e17251160 | |||
| 3f102e5d3a | |||
| aad6d28e13 | |||
| 1650c664bc | |||
| d17b099994 | |||
| 1516103a15 | |||
| bf0173bf38 | |||
| b4e300b78b | |||
| 402a77e7f7 | |||
| 2ca561f104 | |||
| 174cb06a7a | |||
| 583b327523 | |||
| 1081cee35f | |||
| 69fd57bc96 | |||
| 8e6e05ed3f | |||
| c512bf6c66 | |||
| bcff9fd067 | |||
| 0d7aeacc34 | |||
| 3515f6ec33 | |||
| 602f047fe8 | |||
| 7f3eea6325 | |||
| 878a6906cc | |||
| 0194d5a2d5 | |||
| d219709cfa | |||
| c2e281f8cf | |||
| 07334bc25c | |||
| 94fdd45b75 | |||
| 70ff3804e9 | |||
| 8741d97a4f | |||
| 432d0fd707 | |||
| e45d5446f2 | |||
| 0f91faddae | |||
| 5e6e12600f | |||
| 92f182bc3b | |||
| bc3c7e80a6 | |||
| 32683ee6e0 | |||
| 544eb4be1f | |||
| d9e092325b | |||
| ec7ce81401 | |||
| 5bc291937f | |||
| 9313978f61 | |||
| ce6b06efb9 | |||
| f01c029446 | |||
| 928552ac9e | |||
| ab58cac236 | |||
| 71496e3be4 | |||
| e63d628677 | |||
| dcb3c4ff1e | |||
| 488b5d95dc | |||
| 22f12dc93c | |||
| ad183481c0 | |||
| 08c94aa5c0 | |||
| 1989bc33a7 | |||
| 46bee83005 | |||
| 2360291c3e | |||
| 12ed7ca63e | |||
| e8357c0544 | |||
| ca479c3f5b | |||
| 02829f73e0 | |||
| a44c0fd51f | |||
| 773365405f | |||
| cb0a61b9ba | |||
| 8a9a9403a3 | |||
| 7d1140340e | |||
| 862242aa8d | |||
| 1ff6c758ec | |||
| 6ba22dea46 | |||
| 70b984434d | |||
| e5ed9cc612 | |||
| 1fbf914348 | |||
| 09436df1ad | |||
| 4bb4a349c9 | |||
| b4716b1d92 | |||
| acc8589083 | |||
| c0dc2f2bb3 | |||
| 66ab4e15db | |||
| c10d08f795 | |||
| 4b75be801e | |||
| ac64713881 | |||
| c455fc0334 | |||
| 42c0914382 | |||
| 49e1f6b161 | |||
| 1a4c22fc46 | |||
| 5f4c7372c0 | |||
| d07eb9ad60 | |||
| 5a54acef4e | |||
| e5fbb4f5d2 | |||
| 11626fe32c | |||
| 63e89bc326 | |||
| 96a3c7954d | |||
| 25af743902 | |||
| 6d1cdcf601 | |||
| dc59476c34 | |||
| 4e39d0371d | |||
| 11feae6631 | |||
| eef78f5664 | |||
| 9ef742bbf4 | |||
| 928bfe0b93 | |||
| 86e8a105a5 | |||
| a586ef725c | |||
| fe7fd4c312 | |||
| 0488d9bdb2 | |||
| 431e2e6d68 | |||
| 9439872a62 | |||
| f6dd549e58 | |||
| 454bc7a674 | |||
| 8f4b534937 | |||
| e251ed7773 | |||
| 0e6ebafdb3 | |||
| 7d17d20dce | |||
| 1d2baf0bd3 | |||
| 10e6491c22 | |||
| 95a438d233 | |||
| 4238add35b | |||
| f448d75aa8 | |||
| 19c9174543 | |||
| 4784c7be5f | |||
| c3e6de293f | |||
| 544908d06c | |||
| 520da7aaaf | |||
| bb0f9d6bc4 | |||
| df7fb00c21 | |||
| fa17267e05 | |||
| ed4de20fd1 | |||
| 9b9e685dbc | |||
| 49bb0bf9c8 | |||
| d6c5e18e24 | |||
| 617e6b4cc9 | |||
| a683a496ea | |||
| 5ebfb52a4a | |||
| 6dd9e18b2e | |||
| 5b833db558 | |||
| fce018e7a9 | |||
| e7cc2eea1d | |||
| 7c65f7ef11 | |||
| 9365817bfd | |||
| d656d39ba2 | |||
| 02db592014 | |||
| 3203635765 | |||
| a4a47b538c | |||
| d098048aba | |||
| 309c962169 | |||
| cddf868572 | |||
| da8dbf6cf5 | |||
| e7d5dbfec0 | |||
| 34046ec682 | |||
| ed9564106c | |||
| 600b7a30e6 | |||
| b32d914aab | |||
| daee982106 | |||
| 526d1d6db1 | |||
| aa621d6f3c | |||
| 704c688225 | |||
| 6c71988c54 | |||
| 82811d0706 | |||
| c5b5d5c8d3 | |||
| cc862e996e | |||
| 635342ab73 | |||
| 98c78e0acd | |||
| 6833b46a05 | |||
| 0ef5c8c541 | |||
| 359bd21bd7 | |||
| f670a99270 | |||
| fadf25acd6 | |||
| 77264dcca9 | |||
| eed5cfba7d | |||
| 5448d9186a | |||
| 2a2a1dc5b4 | |||
| 4d0f789e0a | |||
| d3c14ce3ea | |||
| 42936d3227 | |||
| 7b8e6307f8 | |||
| 823353d3ac | |||
| 639e7367a7 | |||
| 2863c9fe19 | |||
| 37c8f217a7 | |||
| c8783f3e23 | |||
| 9aaf6a66a3 | |||
| ced9d2357c | |||
| 9611aa81b2 | |||
| b10bd4b65d | |||
| 8aa3011f2d | |||
| 7bb9237d99 | |||
| 11a726ceb3 | |||
| c3586b8534 | |||
| 7621cc19dc | |||
| 4f01ad8517 | |||
| 5590aea411 | |||
| 3681dcef1a | |||
| 8b7cb8a3f1 | |||
| 1b8d363231 | |||
| 3f02f569af | |||
| 108188e42f | |||
| 2a33f452b0 | |||
| f42b7d03b4 | |||
| 267fdc4c91 | |||
| 32d1eb36df | |||
| d5323ce848 | |||
| b3f5e3bf94 | |||
| b66c349bba | |||
| c45d3568ae | |||
| 6a6222d21c | |||
| 880052d3f3 | |||
| 85afbd409b | |||
| 03c3e0edcf | |||
| 4f558e8b89 | |||
| 34c0ab5878 | |||
| 8f7181429f | |||
| 921f06eb6f | |||
| d06619ab15 | |||
| 425e92e5ca | |||
| 5ca7dcc6e7 | |||
| 1f23202ad8 | |||
| 6512a4b7e3 | |||
| 40e1f2fc03 | |||
| 582bb3c311 | |||
| e5aa213554 | |||
| cdf2a59afa | |||
| 6320ede98e | |||
| c235bbfcb4 | |||
| c5a6846866 | |||
| 36b00e69ab | |||
| 3ce1bca670 | |||
| 444593014f | |||
| 6ea6e4bceb | |||
| d53a5210a8 | |||
| 2db45c8a85 | |||
| a84a5e8f1a | |||
| 8bd2e9816a | |||
| 638a01a014 | |||
| 90d2f8b5fe | |||
| a6d88b4d1f | |||
| e0393f8557 | |||
| 3f72ff215e | |||
| 64b483c65b | |||
| 0c08094536 | |||
| fab4f4b9d5 | |||
| 72a765d766 | |||
| 1ed9a58b64 | |||
| 2ac819018d | |||
| 5f1b6ee889 | |||
| 27c7ef28a7 | |||
| ac49a17a82 | |||
| fb1dcdd17d | |||
| b84cbeec8c | |||
| f6a33c4826 | |||
| f1a56cb4b7 | |||
| 9087778b06 | |||
| ace0701a46 | |||
| ca9622145e | |||
| 9d4cd352af | |||
| aa75b6067c | |||
| 511e50c19c | |||
| 324851882a | |||
| da0960321b | |||
| b9a2d7b600 | |||
| a769d69a9d | |||
| b46f5b1b38 | |||
| 08db55fb62 | |||
| 3c748ccf10 | |||
| 20f603a217 | |||
| 8088d6785a | |||
| b8b8047448 | |||
| 35a1ecef2a | |||
| ed10383359 | |||
| dcf3d988d5 | |||
| 7567eb8433 | |||
| c5faa9aefa | |||
| 98849151a2 | |||
| bbb14d3746 | |||
| ec321e651f | |||
| 2ae849091c | |||
| 8b3d6603d5 | |||
| 00dd433368 | |||
| 82ec76c123 | |||
| 1c4fb418cf | |||
| 58c5be0002 | |||
| 9e9f57c139 | |||
| f8a75c4361 | |||
| a87d6b098f | |||
| 22d2207d41 | |||
| 9ee60dbff2 | |||
| 121789f78e | |||
| 32d4af36e2 | |||
| b991665b5d | |||
| eff47b1260 | |||
| 04f8194327 | |||
| 16d1bbf2ea | |||
| 650830b9d6 | |||
| 45cbc512bf | |||
| fd91072990 | |||
| 3611396c0b | |||
| ef2e5a9f82 | |||
| 48924cd874 | |||
| 986d27e49c | |||
| b4f1102455 | |||
| e63feba8e2 | |||
| 93091ba203 | |||
| 623de337e8 | |||
| b500ae2d21 | |||
| 006966e629 | |||
| 07aff8e85f | |||
| e49c429162 | |||
| 3d7fd4132b | |||
| ee54bafe6b | |||
| e03569f3a8 | |||
| 382e38941c | |||
| 14de8ac951 | |||
| 6031c79197 | |||
| 7f12836df9 | |||
| 4f9871817a | |||
| 93729784bb | |||
| ef692350e0 | |||
| 09db01af5b | |||
| 8c27ceb9de | |||
| b3cd2448cd | |||
| c60b7d76c5 | |||
| 6b7a1d4dde | |||
| d7597a8610 | |||
| 460e9bf0af | |||
| 23f4bff742 | |||
| cc021e555b | |||
| a084501ecf | |||
| 35a2f2fef9 | |||
| 51e16bbe81 | |||
| 25020f2672 | |||
| fa7e7e0ff9 | |||
| 259147e32c | |||
| d649d1388e | |||
| 1c4c58d1b5 | |||
| 63b30554ad | |||
| d27009c775 | |||
| 4eb5242e16 | |||
| 5770b961a1 | |||
| 0303fa0a19 | |||
| 74127d44d0 | |||
| d0ab595f52 | |||
| 92c0709c49 | |||
| e74fed5c84 | |||
| d29c299cdb | |||
| f0e3431bc7 | |||
| 16368a275b | |||
| 5f20e802d2 | |||
| 437ca0b62a | |||
| 05acf40aff | |||
| 3e3e2dd512 | |||
| 2c30f358dc | |||
| 6f3d881d74 | |||
| d3ebe665e0 | |||
| 9067310166 | |||
| 9496fe40ec | |||
| 87b569d812 | |||
| 8b664d6122 | |||
| 43b03b6517 | |||
| a9cc87636f | |||
| db35e13b46 | |||
| 594652cac1 | |||
| c06f3d63e8 | |||
| 68d01972fe | |||
| 8bf3f6bfcb | |||
| 1f4067112f | |||
| f1c16f42b4 | |||
| 037d8fbdcd | |||
| 3ea02e4fcc | |||
| b21b694444 | |||
| 7580db09ad | |||
| 939c8e8a99 | |||
| 5ad3ddc1b6 | |||
| bd215fbf33 | |||
| 26e9b42a44 | |||
| 4f35a592a1 | |||
| 9b902adea6 | |||
| 29593635ed | |||
| 2ad612f475 | |||
| cf86f88c71 | |||
| 234ad8fbee | |||
| e23b59da5c | |||
| 12a1c127a9 | |||
| 078b4cc971 | |||
| 9fa90c8851 | |||
| cc52523375 | |||
| f49f056d29 | |||
| bd1334a83f | |||
| e72e34ec36 | |||
| c0e456dee2 | |||
| d121d1c528 | |||
| 3a5e036feb | |||
| 2de1aac665 | |||
| fbafc700ea | |||
| 2ddbcc3c4f | |||
| 94848a3e1f | |||
| a3189e36c0 | |||
| f0c2da32f2 | |||
| 3dee87b697 | |||
| c3bea59a76 | |||
| 60f3ca458a | |||
| 772a8188c0 | |||
| 47c9bb7ba8 | |||
| 5b63399197 | |||
| daf3fabe0d | |||
| e665be1d70 | |||
| 0213b508dc | |||
| ea93bcc347 | |||
| e3c0d11b55 | |||
| f71ea4dfe9 | |||
| 5c0a287ce8 | |||
| 781515c514 | |||
| 515e01e649 | |||
| 1887dcb397 | |||
| fc84c48bd7 | |||
| fd7e516b65 | |||
| 71517a910a | |||
| 1961bb1857 | |||
| 31c79668c8 | |||
| cc47ee3b43 | |||
| 7b8d107384 | |||
| 59798b3f7c | |||
| 0e1d65d3b1 | |||
| 125abe2fe4 | |||
| e269ef96cb | |||
| a426a65b41 | |||
| a113e8f088 | |||
| ebd98eaf3a | |||
| 3933958b34 | |||
| 9bb17caa24 | |||
| bad149d77d | |||
| 59373a1ae1 | |||
| 79bb920dee | |||
| f935a16ef2 | |||
| f743603b0a | |||
| d22fb5f949 | |||
| 0d86681b88 | |||
| 0f42031b10 | |||
| c4a3278bab | |||
| fdba548858 | |||
| 89af053aed | |||
| c397361aa6 | |||
| c6a3a18894 | |||
| d54b1ad88a | |||
| 36918b3bb8 | |||
| 35de1c9fdf | |||
| 542cdb2c39 | |||
| 0f51155e79 | |||
| f4e18125b4 | |||
| 5a4f2b5d27 | |||
| 6e00c7651b | |||
| 89fcd6d8af | |||
| c26fd68236 | |||
| a0aee9d765 | |||
| f241a371b3 | |||
| ee257ffe9e | |||
| d962b3f499 | |||
| 6c164d86b9 | |||
| cc3fdd005e | |||
| 1d62a025b3 | |||
| 11af7b7e55 | |||
| ec49eb813c | |||
| f6b6fbf136 | |||
| 2a5e12ccb5 | |||
| ea8be57871 | |||
| 6473018d69 | |||
| affb60093d | |||
| 4a4d94f266 | |||
| bf8415283a | |||
| 2e056fbe8a | |||
| 9734ee13e5 | |||
| 057c10baac | |||
| 7bd3ccd929 | |||
| 37b1bc9d58 | |||
| 27649de50b | |||
| cf4e9e5ce2 | |||
| d72ddc8255 | |||
| 9ea2f5211e | |||
| 9f0bbdada2 | |||
| 4ac5f37d49 | |||
| d9ffc4c83e | |||
| 2ddaaf69fa | |||
| 19464a3ed8 | |||
| 246f47fe96 | |||
| 7c3577f7ae | |||
| 883d925f59 | |||
| 15a2c7724d | |||
| 1ce61f3129 | |||
| 4eda8efd42 | |||
| 7cefb52fda | |||
| a065e4b9aa | |||
| 55ee8b2917 | |||
| 0448260ed7 | |||
| 8ee8710c02 | |||
| 715b88c4cb | |||
| d81cdb8e1c | |||
| b59df66709 | |||
| c3762fb2c3 | |||
| 2a791ea676 | |||
| f23b6ba652 | |||
| b04ed5956e | |||
| c5e9d1adae | |||
| 2c2b1405a3 | |||
| 003745432f | |||
| 0e60b26513 | |||
| 6fd9edc50f | |||
| 17b89b2a35 | |||
| 0831b43654 | |||
| 16ea72e6b9 | |||
| 900c406541 | |||
| 235f2cc73c | |||
| 39954cc6af | |||
| 0bc30d382d | |||
| 2186ec7665 | |||
| aea846ad96 | |||
| 2af63c2bf1 | |||
| 7763a86634 | |||
| bb3a416320 | |||
| ba39bb8da8 | |||
| 7faf8cd06e | |||
| 913a2dbdaa | |||
| 31aa69f556 | |||
| 0d60c0e8c4 | |||
| 03aa69da99 | |||
| 78815133df | |||
| 01f773b803 | |||
| 67fe820c75 | |||
| bfc4eb31cb | |||
| 5e74547b4f | |||
| fe4555ec74 | |||
| 9edcd9b4ef | |||
| 17eef4d8a9 | |||
| 42a2454f1a | |||
| e60535d3ce | |||
| b87a8a5719 | |||
| e4cb8a6f09 | |||
| 2055bcc807 | |||
| 3b669149d2 | |||
| aaabb07bee | |||
| 7b05d52f7b | |||
| 0e64e68d31 | |||
| dcd8589b67 | |||
| ee5b5a6b2f | |||
| fa4fd48072 | |||
| 06b0fe35d2 | |||
| 65be9e1978 | |||
| 833832ac91 | |||
| e00d0528a4 | |||
| b683e68223 | |||
| 256b6bb3db | |||
| 925594d1e3 | |||
| dd81c29834 | |||
| dea5eaca30 | |||
| 5950431e73 | |||
| 05387b3921 | |||
| 986d57c7b2 | |||
| fe2416575b | |||
| ea49d7b7c5 | |||
| b92bbffa1a | |||
| f77e9bc995 | |||
| 8a16997b1e | |||
| 374c5ce471 | |||
| 58f19b4f4c | |||
| 40d61e5c5b | |||
| 2a5a143f0f | |||
| f71f76add9 | |||
| 96f1ef1347 | |||
| 4f6238aa04 | |||
| 70e6391f38 | |||
| bf62be7f63 | |||
| bbb785e43c | |||
| 369bfbfd23 | |||
| 04573615c5 | |||
| 14ae679971 | |||
| 7885ef2ac8 | |||
| a740a4ca38 | |||
| 39874d7254 | |||
| 21fff4dfb6 | |||
| 11cd884c7c | |||
| bfe4e1fed4 | |||
| cdc7f10767 | |||
| e04d663acd | |||
| 8f5ea7deda | |||
| 9405c6d206 | |||
| d6bc6895a6 | |||
| 2492c299f3 | |||
| 930611dfa8 | |||
| 4c2858fd61 | |||
| c5c3ec46ad | |||
| 62e9bed17a | |||
| 75f28245a8 | |||
| c757d2863e | |||
| 133b91a026 | |||
| 26be2402a3 | |||
| 6ffab80169 | |||
| f3eff00bf7 | |||
| 21be2aa677 | |||
| 3db496f677 | |||
| 11c2ffaf1c | |||
| 41d55c5095 | |||
| 3fe18392ef | |||
| 56a0a50da3 | |||
| c744eff30d | |||
| a7e80f7c10 | |||
| c4d4248e49 | |||
| 96aaac186d | |||
| d363e2789f | |||
| 40dc0bcd63 | |||
| 8952863b9c | |||
| cbda9b332b | |||
| fe21487f91 | |||
| 7ccdf801dd | |||
| 566630595d | |||
| 4c095a76c0 | |||
| a4c70aebd0 | |||
| 7ffa49e02c | |||
| 8eade61ec7 | |||
| 0f5aaade61 | |||
| b4f22803cd | |||
| f1c8094f5f | |||
| b0519368ce | |||
| ad7cf58450 | |||
| fc8f1890c0 | |||
| 35c7216846 | |||
| dd54f7a22a | |||
| 636ab095b0 | |||
| 2922738b6d | |||
| dd304dbe05 | |||
| a8a1838615 | |||
| cea0e94376 | |||
| ebf13b39e5 | |||
| bacc210606 | |||
| b993b9b7c7 | |||
| 2be4f2c4dc | |||
| 0d10eb5173 | |||
| 7ce6895a2c | |||
| 62c17dc3cf | |||
| 3d52661400 | |||
| 20036b82d3 | |||
| a07d8a89b6 | |||
| 10787c68d0 | |||
| 9e054d3880 | |||
| 26ccc09c46 | |||
| b37f0c5ac2 | |||
| 2d05db6f22 | |||
| 9dc36a1ece | |||
| 1fc60e6d64 | |||
| d873fe66ab | |||
| 1c728258e0 | |||
| 6b432b4011 | |||
| c90dee668f | |||
| 85321807dd | |||
| c145f28c71 | |||
| 4d3cef35c2 | |||
| ab9bbf645c | |||
| 550ca10ec6 | |||
| 21e698053f | |||
| 0330934c8b | |||
| 3cee54cd27 | |||
| 4c0d833dec | |||
| 8ba95cd498 | |||
| 87bb74312b | |||
| 4e31eef77d | |||
| a2af1d4f71 | |||
| c1ade083d9 | |||
| c839a2ccb1 | |||
| ccc8767b55 | |||
| 6c07b446f8 | |||
| b9c2d88e69 | |||
| e0fe3cce71 | |||
| fce7469961 | |||
| 9cd42650dc | |||
| 4065778255 | |||
| 0f1a56da7c | |||
| ff31d069d0 | |||
| 8f19363c07 | |||
| 0a63ab36bb | |||
| 2561c59698 | |||
| 24e8cd1a78 | |||
| bf62dca45a | |||
| bf5b7843e8 | |||
| 62fab57c3e | |||
| 9620cb550d | |||
| 9210cefb36 | |||
| 4d62f1de1e | |||
| 8b455e8bb3 | |||
| fd93ae08b6 | |||
| ce50df564c | |||
| bd786f3bea | |||
| 731b5b206f | |||
| 739f87da6d | |||
| bd5a6f8af2 | |||
| e5d9b608c4 | |||
| 1f86d8564f | |||
| d15d9f558d | |||
| d92d82d194 | |||
| e93aa158cf | |||
| 297ba85323 | |||
| ef033be59d | |||
| 36e8017580 | |||
| 4aa51f6a32 | |||
| a973d93dcb | |||
| 2409924dbc | |||
| 8bfc3845e2 | |||
| 63d3fdcf58 | |||
| 8bee226d79 | |||
| c049275512 | |||
| bbdd8ba078 | |||
| 4f31759965 | |||
| 45e866f0e1 | |||
| 6ab10fc3ac | |||
| dd576c89a3 | |||
| 89088937a7 | |||
| 6a856d677c | |||
| 94d63d4281 | |||
| 0ae297ad95 | |||
| c75b589f89 | |||
| b67382cbeb | |||
| 98b8c32f30 | |||
| 507071cc6f | |||
| 1c53595817 | |||
| a7de4aca6a | |||
| 3e0b63f65b | |||
| f34b2f7b8d | |||
| b2524f4571 | |||
| 7cc97fd96c | |||
| de52887c49 | |||
| 106413a3ea | |||
| 75a489b75b | |||
| 4709b9d2d8 | |||
| dd3655f6a6 | |||
| 35f66340d7 | |||
| f109c0134f | |||
| 005c4777c7 | |||
| 84a0a91d16 | |||
| 13540bf7f4 | |||
| 49e16a3c9f | |||
| e7cad594c1 | |||
| 46af07575e | |||
| 30d26acee0 | |||
| e72d353b45 | |||
| c4ae5c0ee5 | |||
| d0c64fca2b | |||
| cf9a01970f | |||
| 2271b9af1b | |||
| b45e784beb | |||
| c5eb3dfecb | |||
| 69df0eee77 | |||
| da94d85789 | |||
| f82d64c6e5 | |||
| 1e6ce1d2f8 | |||
| 17e5e4cd5a | |||
| f70cc29edb | |||
| 1857aa22b3 | |||
| b069646494 | |||
| 9ac34bd2c4 | |||
| a321cce5e4 | |||
| de7018539d | |||
| 874fb7ae78 | |||
| 94521629ab | |||
| 03c4c37969 | |||
| eae1ebfd29 | |||
| bcac7bd6d2 | |||
| 0b3d13645f | |||
| 5ebf066dd5 | |||
| a56bd1fbba | |||
| ba104b61bf | |||
| 8abd163464 | |||
| e5dbd2c3a5 | |||
| a57d144076 | |||
| 2918c3d75a | |||
| 29680100ac | |||
| 8bce760174 | |||
| b3d128bb39 | |||
| 741e51396b | |||
| 00f3ad7217 | |||
| cdcf44b3ef | |||
| 1389cc9600 | |||
| e77a5d5f13 | |||
| 3fbe1f8d64 | |||
| 11f3c0741e | |||
| 0b31eca9c2 | |||
| d9231afa29 | |||
| 9eecb5a9fe | |||
| c370cc10e9 | |||
| 05476d6604 | |||
| 9a29fc2ce1 | |||
| c1007c7276 | |||
| dcdd5d64b6 | |||
| 9333f82be0 | |||
| 246d3761ce | |||
| 27cf6e549e | |||
| a8763c1fec | |||
| a83a1cafa7 | |||
| 7295dd7dec | |||
| 3bf5d34544 | |||
| b6e8de23f8 | |||
| 73e9c44377 | |||
| 661f3e2160 | |||
| 6fcb07d41e | |||
| 54f7ebdec9 | |||
| 873b2cabb8 | |||
| c5781afa47 | |||
| 171e705ba4 | |||
| 3ad6d13ff3 | |||
| 207218e920 | |||
| 31cc519cd3 | |||
| 3c15913f53 | |||
| 502aa1f053 | |||
| fdda19cb0c | |||
| 5ea5d08892 | |||
| 95468b72f3 | |||
| debc1c4c95 | |||
| be7d4608fb | |||
| 3c5d87cbae | |||
| 08c6ffaa8d | |||
| 2a30d8c9f9 | |||
| da0188acc0 | |||
| db52841544 | |||
| 8c7d29e526 | |||
| 94c58e7347 | |||
| 583e3a6875 | |||
| e4377e7c51 | |||
| 0a1767a6b5 | |||
| 8ef23d64a1 | |||
| e685dcef0b | |||
| 24efb02d93 | |||
| e832870288 | |||
| 195c12f2db | |||
| cd7f0a5177 | |||
| 6b1d9971f4 | |||
| f9f013e264 | |||
| 9d593e7779 | |||
| bfd800342b | |||
| 6fe1898ab6 | |||
| 990e87effb | |||
| 55ff28ed93 | |||
| 2375e58705 | |||
| 50bda8adfe | |||
| 8a679128fa | |||
| f743c82bdd | |||
| 3e2b05b096 | |||
| aa5204958e | |||
| 459a2bbc9e | |||
| 8c93b61e2c | |||
| 92c4b6ae4c | |||
| eb6279d6ff | |||
| 5d03262b00 | |||
| 6cf4371eb4 | |||
| ba8a6e3533 | |||
| ec38ef9b10 | |||
| 10651d491f | |||
| 6f39f9a6a0 | |||
| 931b32d102 | |||
| 89ce2dc405 | |||
| 27cfe31b64 | |||
| 9a92777fc1 | |||
| db7922b9ee | |||
| 5d31d6ebbb | |||
| 2d20aa4ed0 | |||
| 74abbd0898 | |||
| aa1b031274 | |||
| 8e8da3f5b0 | |||
| d00561d396 | |||
| b46364e436 | |||
| e0ee2f769a | |||
| e65c6270bf | |||
| 147f3ebf0a | |||
| 53e685461e | |||
| 11b24eb49f | |||
| 92a3dbe18f | |||
| f46fa6e096 | |||
| 408ef5c65b | |||
| 38abc61de5 | |||
| c7049ca627 | |||
| 5f990566c4 | |||
| ddfe688be6 | |||
| bc7f6fc44c | |||
| da0b1d8821 | |||
| 69f1d1ddff | |||
| 47c4dcc8a3 | |||
| c321d025c4 | |||
| 34c70e7a1c | |||
| 0c1bcf354c | |||
| 1de10f9f86 | |||
| d8425d8881 | |||
| 649bb7ac04 | |||
| ebdd74105a | |||
| b28fd79fdc | |||
| 78784040aa | |||
| 2570a5af38 | |||
| 17ece5861a | |||
| 6e12391c91 | |||
| 5169c79978 | |||
| 220d1f0b3e | |||
| ed9c924102 | |||
| 710506e9e2 | |||
| c4c1c4c9bb | |||
| 61404dd2ac | |||
| 276e47afae | |||
| d69b3e385e | |||
| 0d7666a012 | |||
| 0aadab0941 | |||
| dcbed8d676 | |||
| eee638fd81 | |||
| c624d82383 | |||
| 0c00242f7a | |||
| 12d7429ff0 | |||
| 822c67fdee | |||
| 56cedfc4d2 | |||
| e03c81d90a | |||
| aec59aba34 | |||
| 28cfb07445 | |||
| 9cb13435a1 | |||
| 29eda007bb | |||
| ee9c0f5f9c | |||
| a9e33fe54e | |||
| e192c6842e | |||
| 595437bdd1 | |||
| 14451f3f06 | |||
| 9fbce6c8c8 | |||
| a41d877fe6 | |||
| 88a338a3eb | |||
| d7240d1a28 | |||
| 9a4b5a4545 | |||
| ec7f74f7b4 | |||
| afbcc07184 | |||
| 91a0270432 | |||
| eaba0e6358 | |||
| f1c8e04268 | |||
| a78d143c98 | |||
| 789dc0a3b7 | |||
| 526220a171 | |||
| 5bfaf9931b | |||
| 007354ebaf | |||
| 232d6b87f4 | |||
| b1851e2f16 | |||
| 64cf206fb5 | |||
| b2da9df82d | |||
| 8638bba670 | |||
| e827a5bd9e | |||
| 9053839282 | |||
| 3240f2a6b7 | |||
| 57ed0e57f0 | |||
| ca0b6fbb95 | |||
| 0af3638c5a | |||
| f710d96602 | |||
| bc8a91ed83 | |||
| bb8be523c5 | |||
| 236815ec40 | |||
| e720427b53 | |||
| a8a208e0fe | |||
| 3fbaabc866 | |||
| 5e4dfb9546 | |||
| 13b0fd993c | |||
| 05248a3dea | |||
| 46fe74177d | |||
| df86f0752a | |||
| 4c7aa8645a | |||
| 1304ad1e12 | |||
| e16227b53c | |||
| 47ae5f14f5 | |||
| 156d736e75 | |||
| b7945827f9 | |||
| 1e11657ba4 | |||
| ca5e0f53b8 | |||
| bbe0f2cef5 | |||
| c2a880d7c9 | |||
| 9552206a4c | |||
| 2722133206 | |||
| b76e88354c | |||
| 88e54ca1c0 | |||
| 642e4d97a4 | |||
| 16a9407fbf | |||
| e19000a56f | |||
| 7521bcc32c | |||
| d3a15c625a | |||
| af746a9269 | |||
| 37be9ddeec | |||
| 28f9ce4e33 | |||
| 8633ef451e | |||
| a347569350 | |||
| 1b842c4762 | |||
| 7c3b415d6a | |||
| 03fb85f179 | |||
| 9ac9e9e29a | |||
| 0689b43a7c | |||
| 3450528fad | |||
| fb3298f076 | |||
| e9017fb71e | |||
| 476d2e1eea | |||
| 4950f542d1 | |||
| 22d8a81a57 | |||
| 976ee44682 | |||
| 3b5f1f767d | |||
| b3c1bd788a | |||
| fa4d32f7dd | |||
| 91e06e7c05 | |||
| 072f873df6 | |||
| 88f5e2f3f7 | |||
| f0637e5e91 | |||
| 519e452e1a | |||
| 89eca83f5b | |||
| 48f7cbec75 | |||
| bfb18d29a6 | |||
| 678e114e5f | |||
| 18dbed0e0d | |||
| 488eb11ba8 | |||
| b6561ce57d | |||
| a2fed4c790 | |||
| 9a1835ce66 | |||
| ece3fac7ef | |||
| 607ff2e189 | |||
| a47b7a34be | |||
| 3476440ec3 | |||
| b333b1f6e8 | |||
| 6501d54267 | |||
| 9228a8bee6 | |||
| f3cb5084cf | |||
| dfb348ef0b | |||
| 50d350bcd1 | |||
| 0aab7c6fc3 | |||
| 13dffa0017 | |||
| b417b4dbee | |||
| fd711219a2 | |||
| a789c08588 | |||
| 75533fcd06 | |||
| 82902b6fd5 | |||
| 124c4825a7 | |||
| 11470077e1 | |||
| 67e24dd347 | |||
| 519fbdb8ab | |||
| d22df8c41f | |||
| a8aff6f643 | |||
| 48e2d38be7 | |||
| 4ee25c7e95 | |||
| 9408a5ef5d | |||
| 67f163892e | |||
| d0bdf99501 | |||
| 156871d888 | |||
| eb768514c3 | |||
| ec47a0a6de | |||
| 74defefd61 | |||
| 4e0351bafd | |||
| 820fdbff23 | |||
| 776c8c5c87 | |||
| c1dec72fb6 | |||
| aa5caf83f6 | |||
| 993ff7ad12 | |||
| 3413c23b34 | |||
| 383559c228 | |||
| 07979b02c3 | |||
| ddca982c09 | |||
| 6f848b8520 | |||
| 9e9fd281b9 | |||
| 5c13ffb73e | |||
| a446cb271f | |||
| 6eed6a8e9f | |||
| 576d43d1c2 | |||
| 3e708e015c | |||
| c6c519166e | |||
| 2bac66a181 | |||
| ff5eaadfdf | |||
| c10283b2b6 | |||
| b34ebc8cfe | |||
| a50efda49d | |||
| 4b7c0b9c76 | |||
| 68e50661a2 | |||
| f1adc32765 | |||
| a5d16f09e6 | |||
| 36b34465a4 | |||
| 9bb5d6cab0 | |||
| 205ccddff8 | |||
| 533d399dab | |||
| 1d01e435ca | |||
| c659f94dca | |||
| dc1502ad71 | |||
| bb5c40d944 | |||
| e71ff78f7f | |||
| 062d2179eb | |||
| 73b5ef48ef | |||
| a46adbfcbc | |||
| c25f587584 | |||
| e3ec3566d9 | |||
| f9828cd0c9 | |||
| 203b398caa | |||
| a22f03e749 | |||
| 8f96b15e2a | |||
| 7c91700cc6 | |||
| 6f93a3ac5b | |||
| 85ef02bc5c | |||
| 66cdc10010 | |||
| a2b6b595c2 | |||
| 474e5f4cdf | |||
| 00d2e279d7 | |||
| e357e2c1b7 | |||
| 1989d94ef5 | |||
| 896c34fab3 | |||
| 3668a01fca | |||
| 2b44c0b649 | |||
| 89a740a62f | |||
| a8e5d1d9fd | |||
| 256aa53326 | |||
| 5b363df2ae | |||
| 10e639cdb9 | |||
| 8c66531c42 | |||
| b7630a088b | |||
| c9cedf3c5b | |||
| f94e64a0ae | |||
| 8b22099da2 | |||
| 0c8e069640 | |||
| 587e9a554e | |||
| 7e99911c82 | |||
| ec5038f2a7 | |||
| 97f5d05d1f | |||
| f4fdd94cf5 | |||
| 7cc0b0f93e | |||
| e16e141c38 | |||
| 65598e4075 | |||
| b345c6e552 | |||
| c0cde75d54 | |||
| 85474f581d | |||
| e6d7989b20 | |||
| 406fe899d5 | |||
| b3c77e664d | |||
| 5e08d588f8 | |||
| e6f27240d5 | |||
| 46fa9a6bd4 | |||
| f1aae52daf | |||
| 45f0cf0d41 | |||
| a891caa755 | |||
| d33d37ffd9 | |||
| 1c3b9d7591 | |||
| 9be630466f | |||
| fa36b9d345 | |||
| 3650ec02be | |||
| a85b4b5805 | |||
| c3a8db6d6c | |||
| 23e53a32e5 | |||
| d1f727191f | |||
| 579ffbf97e | |||
| 3153450756 | |||
| 8a6fabed83 | |||
| c6f666a02b | |||
| 5fad2a3f24 | |||
| d015b55e6b | |||
| a2f3692bff | |||
| b7a053b0e5 | |||
| 7dd3723abe | |||
| c3e409f950 | |||
| fdbc598e4c | |||
| 40686b5e87 | |||
| 7a95e654eb | |||
| 05d187ec90 | |||
| 8415b907bb | |||
| f92c9ddb43 | |||
| 1f724e2e8a | |||
| 5ad02d7a9a | |||
| d8fdf9321d | |||
| 4826d976d6 | |||
| 61b9484155 | |||
| 89a0a46a69 | |||
| 4b7fc59332 | |||
| 5b23c0b176 | |||
| 0bc9a0db18 | |||
| 3f3e6ba739 |
@@ -0,0 +1,31 @@
|
||||
# https://editorconfig.org/
|
||||
|
||||
root = true
|
||||
|
||||
[*]
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
|
||||
[{CMakeLists.*,*.cmake}]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
[Makefile]
|
||||
indent_style = tab
|
||||
|
||||
[*.{bat,cmd,cmd.*}]
|
||||
end_of_line = crlf
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
[*.{ps1,ps1.*}]
|
||||
end_of_line = crlf
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
|
||||
[*.{md,markdown}]
|
||||
indent_size = 2
|
||||
@@ -31,6 +31,8 @@
|
||||
*.py text
|
||||
*.qrc text
|
||||
*.qss text
|
||||
*.rc text
|
||||
*.rc.in text
|
||||
*.S text
|
||||
*.sbt text
|
||||
*.scala text
|
||||
@@ -41,6 +43,8 @@
|
||||
|
||||
# reST underlines/overlines can look like conflict markers
|
||||
*.rst text conflict-marker-size=80
|
||||
# Markdown heading markers can look like conflict markers
|
||||
*.md text conflict-marker-size=200
|
||||
|
||||
*.cmake text whitespace=tabwidth=2
|
||||
*.cmakein text whitespace=tabwidth=2
|
||||
@@ -77,6 +81,8 @@ org.eclipse.jdt.core.prefs -text whitespace=cr-at-eol merge=union
|
||||
*.cmd text eol=crlf
|
||||
*.cmd.tmpl text eol=crlf
|
||||
*.dsp text eol=crlf -whitespace
|
||||
*.ps1 text eol=crlf
|
||||
*.ps1.in text eol=crlf
|
||||
*.sln text eol=crlf -whitespace
|
||||
*.vcproj text eol=crlf -whitespace merge=union
|
||||
*.vcxproj text eol=crlf -whitespace merge=union
|
||||
|
||||
+4
-5
@@ -1,10 +1,11 @@
|
||||
# ignore dot files/directories
|
||||
.*
|
||||
!.gitignore
|
||||
|
||||
*.autosave
|
||||
*.pyc
|
||||
*.user
|
||||
*~
|
||||
.*.swp
|
||||
.DS_Store
|
||||
.sw[a-z]
|
||||
Thumbs.db
|
||||
tags
|
||||
tegra/
|
||||
@@ -17,8 +18,6 @@ bin/
|
||||
*.rule
|
||||
*.tmp
|
||||
*/debug
|
||||
*/CMakeFiles
|
||||
CMakeCache.txt
|
||||
*.suo
|
||||
*.log
|
||||
*.tlog
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
[tgit]
|
||||
icon = doc/opencv.ico
|
||||
Vendored
-2
@@ -37,6 +37,4 @@ if(WITH_NEON)
|
||||
target_compile_definitions(carotene_objs PRIVATE "-DWITH_NEON")
|
||||
endif()
|
||||
|
||||
set_target_properties(carotene_objs PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
|
||||
|
||||
add_library(carotene STATIC EXCLUDE_FROM_ALL "$<TARGET_OBJECTS:carotene_objs>")
|
||||
|
||||
Vendored
+6
-9
@@ -3,8 +3,6 @@ cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)
|
||||
include(CheckCCompilerFlag)
|
||||
include(CheckCXXCompilerFlag)
|
||||
|
||||
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||
|
||||
set(TEGRA_HAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
set(CAROTENE_DIR "${TEGRA_HAL_DIR}/../")
|
||||
|
||||
@@ -16,16 +14,16 @@ endif()
|
||||
|
||||
set(TEGRA_COMPILER_FLAGS "")
|
||||
|
||||
if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
if(CV_GCC OR CV_CLANG)
|
||||
# Generate unwind information even for functions that can't throw/propagate exceptions.
|
||||
# This lets debuggers and such get non-broken backtraces for such functions, even without debugging symbols.
|
||||
list(APPEND TEGRA_COMPILER_FLAGS -funwind-tables)
|
||||
endif()
|
||||
|
||||
if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
if(CV_GCC OR CV_CLANG)
|
||||
if(X86 OR ARMEABI_V6 OR (MIPS AND ANDROID_COMPILER_VERSION VERSION_LESS "4.6"))
|
||||
list(APPEND TEGRA_COMPILER_FLAGS -fweb -fwrapv -frename-registers -fsched-stalled-insns-dep=100 -fsched-stalled-insns=2)
|
||||
elseif(CMAKE_COMPILER_IS_CLANGCXX)
|
||||
elseif(CV_CLANG)
|
||||
list(APPEND TEGRA_COMPILER_FLAGS -fwrapv)
|
||||
else()
|
||||
list(APPEND TEGRA_COMPILER_FLAGS -fweb -fwrapv -frename-registers -fsched2-use-superblocks -fsched2-use-traces
|
||||
@@ -42,7 +40,7 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${TEGRA_COMPILER_FLAGS}")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TEGRA_COMPILER_FLAGS}")
|
||||
|
||||
if(ARMEABI_V7A)
|
||||
if (CMAKE_COMPILER_IS_GNUCXX)
|
||||
if(CV_GCC OR CV_CLANG)
|
||||
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-tree-vectorize" )
|
||||
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-tree-vectorize" )
|
||||
endif()
|
||||
@@ -67,7 +65,7 @@ function(compile_carotene)
|
||||
endif()
|
||||
check_cxx_compiler_flag("-mfpu=neon" CXX_HAS_MFPU_NEON)
|
||||
check_c_compiler_flag("-mfpu=neon" C_HAS_MFPU_NEON)
|
||||
if(${CXX_HAS_MFPU_NEON} AND ${C_HAS_MFPU_NEON})
|
||||
if(${CXX_HAS_MFPU_NEON} AND ${C_HAS_MFPU_NEON} AND NOT "${CMAKE_CXX_FLAGS} " MATCHES "-mfpu=neon[^ ]*")
|
||||
get_target_property(old_flags "carotene_objs" COMPILE_FLAGS)
|
||||
if(old_flags)
|
||||
set_target_properties("carotene_objs" PROPERTIES COMPILE_FLAGS "${old_flags} -mfpu=neon")
|
||||
@@ -85,7 +83,7 @@ include_directories("${CAROTENE_DIR}/include")
|
||||
get_target_property(carotene_defs carotene_objs INTERFACE_COMPILE_DEFINITIONS)
|
||||
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS ${carotene_defs})
|
||||
|
||||
if (CMAKE_COMPILER_IS_GNUCXX)
|
||||
if(CV_GCC)
|
||||
# allow more inlines - these parameters improve performance for:
|
||||
# matchTemplate about 5-10%
|
||||
# goodFeaturesToTrack 10-20%
|
||||
@@ -95,7 +93,6 @@ set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS ${carotene_defs})
|
||||
endif()
|
||||
|
||||
add_library(tegra_hal STATIC $<TARGET_OBJECTS:carotene_objs>)
|
||||
set_target_properties(tegra_hal PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
|
||||
set_target_properties(tegra_hal PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${3P_LIBRARY_OUTPUT_PATH})
|
||||
set(OPENCV_SRC_DIR "${CMAKE_SOURCE_DIR}")
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
|
||||
Vendored
+10
-10
@@ -67,7 +67,7 @@
|
||||
size_t src2_step;
|
||||
|
||||
#define DST_ARG1 DT * dst1_data_, size_t dst1_step_,
|
||||
#define DST_STORE1 dst1_data(dst1_data_), dst1_step(dst1_step_),
|
||||
#define DST_STORE1 dst1_data(dst1_data_), dst1_step(dst1_step_),
|
||||
#define DST_VAR1 DT * dst1_data; \
|
||||
size_t dst1_step;
|
||||
|
||||
@@ -1073,7 +1073,7 @@ struct FilterCtx
|
||||
inline int TEGRA_FILTERINIT(cvhalFilter2D **context, uchar *kernel_data, size_t kernel_step, int kernel_type, int kernel_width, int kernel_height,
|
||||
int max_width, int max_height, int src_type, int dst_type, int borderType, double delta, int anchor_x, int anchor_y, bool allowSubmatrix, bool allowInplace)
|
||||
{
|
||||
if(!context || !kernel_data || allowSubmatrix || allowInplace ||
|
||||
if(!context || !kernel_data || allowSubmatrix || allowInplace ||
|
||||
src_type != CV_8UC1 || dst_type != CV_8UC1 ||
|
||||
delta != 0 || anchor_x != kernel_width / 2 || anchor_y != kernel_height / 2 )
|
||||
return CV_HAL_ERROR_NOT_IMPLEMENTED;
|
||||
@@ -1105,7 +1105,7 @@ inline int TEGRA_FILTERINIT(cvhalFilter2D **context, uchar *kernel_data, size_t
|
||||
return CV_HAL_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
if(!CAROTENE_NS::isConvolutionSupported(CAROTENE_NS::Size2D(max_width, max_height), ctx->ksize, ctx->border))
|
||||
if(!CAROTENE_NS::isConvolutionSupported(CAROTENE_NS::Size2D(max_width, max_height), ctx->ksize, ctx->border))
|
||||
{
|
||||
delete ctx;
|
||||
return CV_HAL_ERROR_NOT_IMPLEMENTED;
|
||||
@@ -1212,7 +1212,7 @@ inline int TEGRA_SEPFILTERINIT(cvhalFilter2D **context, int src_type, int dst_ty
|
||||
return CV_HAL_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
if(!CAROTENE_NS::isSeparableFilter3x3Supported(CAROTENE_NS::Size2D(16, 16), ctx->border, 3, 3))
|
||||
if(!CAROTENE_NS::isSeparableFilter3x3Supported(CAROTENE_NS::Size2D(16, 16), ctx->border, 3, 3))
|
||||
{
|
||||
delete ctx;
|
||||
return CV_HAL_ERROR_NOT_IMPLEMENTED;
|
||||
@@ -1341,8 +1341,8 @@ inline int TEGRA_MORPHINIT(cvhalFilter2D **context, int operation, int src_type,
|
||||
ctx->anchor_y = anchor_y;
|
||||
switch(operation)
|
||||
{
|
||||
case MORPH_ERODE:
|
||||
case MORPH_DILATE:
|
||||
case CV_HAL_MORPH_ERODE:
|
||||
case CV_HAL_MORPH_DILATE:
|
||||
ctx->operation = operation;
|
||||
break;
|
||||
default:
|
||||
@@ -1355,7 +1355,7 @@ inline int TEGRA_MORPHINIT(cvhalFilter2D **context, int operation, int src_type,
|
||||
ctx->border = CAROTENE_NS::BORDER_MODE_CONSTANT;
|
||||
if( borderValue[0] == DBL_MAX && borderValue[1] == DBL_MAX && borderValue[2] == DBL_MAX && borderValue[3] == DBL_MAX )
|
||||
{
|
||||
if( operation == MORPH_ERODE )
|
||||
if( operation == CV_HAL_MORPH_ERODE )
|
||||
for(int i = 0; i < ctx->channels; ++i)
|
||||
ctx->borderValues[i] = (CAROTENE_NS::u8)UCHAR_MAX;
|
||||
else
|
||||
@@ -1404,14 +1404,14 @@ inline int TEGRA_MORPHFREE(cvhalFilter2D *context)
|
||||
( \
|
||||
(void)dst_full_width, (void)dst_full_height, (void)dst_roi_x, (void)dst_roi_y, \
|
||||
context && CAROTENE_NS::isSupportedConfiguration() ? \
|
||||
((MorphCtx*)context)->operation == MORPH_ERODE ? \
|
||||
((MorphCtx*)context)->operation == CV_HAL_MORPH_ERODE ? \
|
||||
CAROTENE_NS::erode(CAROTENE_NS::Size2D(width, height), ((MorphCtx*)context)->channels, \
|
||||
src_data, src_step, dst_data, dst_step, \
|
||||
((MorphCtx*)context)->ksize, ((MorphCtx*)context)->anchor_x, ((MorphCtx*)context)->anchor_y, \
|
||||
((MorphCtx*)context)->border, ((MorphCtx*)context)->border, ((MorphCtx*)context)->borderValues, \
|
||||
CAROTENE_NS::Margin(src_roi_x, src_full_width - width - src_roi_x, src_roi_y, src_full_height - height - src_roi_y)), \
|
||||
CV_HAL_ERROR_OK : \
|
||||
((MorphCtx*)context)->operation == MORPH_DILATE ? \
|
||||
((MorphCtx*)context)->operation == CV_HAL_MORPH_DILATE ? \
|
||||
CAROTENE_NS::dilate(CAROTENE_NS::Size2D(width, height), ((MorphCtx*)context)->channels, \
|
||||
src_data, src_step, dst_data, dst_step, \
|
||||
((MorphCtx*)context)->ksize, ((MorphCtx*)context)->anchor_x, ((MorphCtx*)context)->anchor_y, \
|
||||
@@ -1531,7 +1531,7 @@ class TegraCvtColor_##name##_Invoker : public cv::ParallelLoopBody \
|
||||
public: \
|
||||
TegraCvtColor_##name##_Invoker(const uchar * src_data_, size_t src_step_, uchar * dst_data_, size_t dst_step_, int width_, int height_) : \
|
||||
cv::ParallelLoopBody(), src_data(src_data_), src_step(src_step_), dst_data(dst_data_), dst_step(dst_step_), width(width_), height(height_) {} \
|
||||
virtual void operator()(const cv::Range& range) const \
|
||||
virtual void operator()(const cv::Range& range) const CV_OVERRIDE \
|
||||
{ \
|
||||
CAROTENE_NS::func(CAROTENE_NS::Size2D(width, range.end-range.start), __VA_ARGS__); \
|
||||
} \
|
||||
|
||||
+10
-10
@@ -49,7 +49,7 @@ void extract2(const Size2D &size,
|
||||
{
|
||||
internal::assertSupportedConfiguration();
|
||||
#ifdef CAROTENE_NEON
|
||||
#ifndef ANDROID
|
||||
#ifndef __ANDROID__
|
||||
size_t roiw32 = size.width >= 31 ? size.width - 31 : 0;
|
||||
#endif
|
||||
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
|
||||
@@ -60,7 +60,7 @@ void extract2(const Size2D &size,
|
||||
u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
|
||||
size_t sj = 0u, dj = 0u;
|
||||
|
||||
#ifndef ANDROID
|
||||
#ifndef __ANDROID__
|
||||
for (; dj < roiw32; sj += 64, dj += 32)
|
||||
{
|
||||
internal::prefetch(src + sj);
|
||||
@@ -101,7 +101,7 @@ void extract3(const Size2D &size,
|
||||
{
|
||||
internal::assertSupportedConfiguration();
|
||||
#ifdef CAROTENE_NEON
|
||||
#ifndef ANDROID
|
||||
#ifndef __ANDROID__
|
||||
size_t roiw32 = size.width >= 31 ? size.width - 31 : 0;
|
||||
#endif
|
||||
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
|
||||
@@ -112,7 +112,7 @@ void extract3(const Size2D &size,
|
||||
u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
|
||||
size_t sj = 0u, dj = 0u;
|
||||
|
||||
#ifndef ANDROID
|
||||
#ifndef __ANDROID__
|
||||
for (; dj < roiw32; sj += 96, dj += 32)
|
||||
{
|
||||
internal::prefetch(src + sj);
|
||||
@@ -153,7 +153,7 @@ void extract4(const Size2D &size,
|
||||
{
|
||||
internal::assertSupportedConfiguration();
|
||||
#ifdef CAROTENE_NEON
|
||||
#ifndef ANDROID
|
||||
#ifndef __ANDROID__
|
||||
size_t roiw32 = size.width >= 31 ? size.width - 31 : 0;
|
||||
#endif
|
||||
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
|
||||
@@ -164,7 +164,7 @@ void extract4(const Size2D &size,
|
||||
u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
|
||||
size_t sj = 0u, dj = 0u;
|
||||
|
||||
#ifndef ANDROID
|
||||
#ifndef __ANDROID__
|
||||
for (; dj < roiw32; sj += 128, dj += 32)
|
||||
{
|
||||
internal::prefetch(src + sj);
|
||||
@@ -231,7 +231,7 @@ void extract4(const Size2D &size,
|
||||
srcStride == dst2Stride && \
|
||||
srcStride == dst3Stride &&
|
||||
|
||||
#if __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
|
||||
#define SPLIT_ASM2(sgn, bits) __asm__ ( \
|
||||
"vld2." #bits " {d0, d2}, [%[in0]] \n\t" \
|
||||
@@ -280,7 +280,7 @@ void extract4(const Size2D &size,
|
||||
FILL_LINES##n(VST1Q, sgn##bits) \
|
||||
}
|
||||
|
||||
#endif // __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
||||
#endif
|
||||
|
||||
#define SPLIT(sgn,bits,n) void split##n(const Size2D &_size, \
|
||||
const sgn##bits * srcBase, ptrdiff_t srcStride \
|
||||
@@ -351,7 +351,7 @@ void extract4(const Size2D &size,
|
||||
} \
|
||||
}
|
||||
|
||||
#if __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
|
||||
#define ALPHA_QUAD(sgn, bits) { \
|
||||
internal::prefetch(src + sj); \
|
||||
@@ -378,7 +378,7 @@ void extract4(const Size2D &size,
|
||||
vst1q_##sgn##bits(dst1 + d1j, vals.v4.val[3]); \
|
||||
}
|
||||
|
||||
#endif // __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
||||
#endif
|
||||
|
||||
#define SPLIT4ALPHA(sgn,bits) void split4(const Size2D &_size, \
|
||||
const sgn##bits * srcBase, ptrdiff_t srcStride, \
|
||||
|
||||
+6
-6
@@ -77,7 +77,7 @@ namespace CAROTENE_NS {
|
||||
dstStride == src2Stride && \
|
||||
dstStride == src3Stride &&
|
||||
|
||||
#if __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
|
||||
#define MERGE_ASM2(sgn, bits) __asm__ ( \
|
||||
"vld1." #bits " {d0-d1}, [%[in0]] \n\t" \
|
||||
@@ -128,7 +128,7 @@ namespace CAROTENE_NS {
|
||||
vst##n##q_##sgn##bits(dst + dj, v_dst); \
|
||||
}
|
||||
|
||||
#endif // __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
||||
#endif
|
||||
|
||||
#define COMBINE(sgn,bits,n) void combine##n(const Size2D &_size \
|
||||
FILL_LINES##n(FARG, sgn##bits), \
|
||||
@@ -240,7 +240,7 @@ void combineYUYV(const Size2D &size,
|
||||
{
|
||||
internal::assertSupportedConfiguration();
|
||||
#ifdef CAROTENE_NEON
|
||||
#ifndef ANDROID
|
||||
#ifndef __ANDROID__
|
||||
size_t roiw32 = size.width >= 31 ? size.width - 31 : 0;
|
||||
#endif
|
||||
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
|
||||
@@ -253,7 +253,7 @@ void combineYUYV(const Size2D &size,
|
||||
u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
|
||||
size_t syj = 0u, sj = 0u, dj = 0u;
|
||||
|
||||
#ifndef ANDROID
|
||||
#ifndef __ANDROID__
|
||||
for (; sj < roiw32; sj += 32, syj += 64, dj += 128)
|
||||
{
|
||||
internal::prefetch(srcy + syj);
|
||||
@@ -317,7 +317,7 @@ void combineUYVY(const Size2D &size,
|
||||
{
|
||||
internal::assertSupportedConfiguration();
|
||||
#ifdef CAROTENE_NEON
|
||||
#ifndef ANDROID
|
||||
#ifndef __ANDROID__
|
||||
size_t roiw32 = size.width >= 31 ? size.width - 31 : 0;
|
||||
#endif
|
||||
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
|
||||
@@ -330,7 +330,7 @@ void combineUYVY(const Size2D &size,
|
||||
u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
|
||||
size_t syj = 0u, sj = 0u, dj = 0u;
|
||||
|
||||
#ifndef ANDROID
|
||||
#ifndef __ANDROID__
|
||||
for (; sj < roiw32; sj += 32, syj += 64, dj += 128)
|
||||
{
|
||||
internal::prefetch(srcy + syj);
|
||||
|
||||
+60
-60
@@ -97,7 +97,7 @@ void rgb2gray(const Size2D &size, COLOR_SPACE color_space,
|
||||
const u32 G2Y = color_space == COLOR_SPACE_BT601 ? G2Y_BT601 : G2Y_BT709;
|
||||
const u32 B2Y = color_space == COLOR_SPACE_BT601 ? B2Y_BT601 : B2Y_BT709;
|
||||
|
||||
#if defined(__GNUC__) && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
register int16x4_t v_r2y asm ("d31") = vmov_n_s16(R2Y);
|
||||
register int16x4_t v_g2y asm ("d30") = vmov_n_s16(G2Y);
|
||||
register int16x4_t v_b2y asm ("d29") = vmov_n_s16(B2Y);
|
||||
@@ -116,7 +116,7 @@ void rgb2gray(const Size2D &size, COLOR_SPACE color_space,
|
||||
u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
|
||||
size_t sj = 0u, dj = 0u;
|
||||
|
||||
#if defined(__GNUC__) && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
for (; dj < roiw8; sj += 24, dj += 8)
|
||||
{
|
||||
internal::prefetch(src + sj);
|
||||
@@ -198,7 +198,7 @@ void rgbx2gray(const Size2D &size, COLOR_SPACE color_space,
|
||||
const u32 G2Y = color_space == COLOR_SPACE_BT601 ? G2Y_BT601 : G2Y_BT709;
|
||||
const u32 B2Y = color_space == COLOR_SPACE_BT601 ? B2Y_BT601 : B2Y_BT709;
|
||||
|
||||
#if defined(__GNUC__) && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
register int16x4_t v_r2y asm ("d31") = vmov_n_s16(R2Y);
|
||||
register int16x4_t v_g2y asm ("d30") = vmov_n_s16(G2Y);
|
||||
register int16x4_t v_b2y asm ("d29") = vmov_n_s16(B2Y);
|
||||
@@ -217,7 +217,7 @@ void rgbx2gray(const Size2D &size, COLOR_SPACE color_space,
|
||||
u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
|
||||
size_t sj = 0u, dj = 0u;
|
||||
|
||||
#if defined(__GNUC__) && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
for (; dj < roiw8; sj += 32, dj += 8)
|
||||
{
|
||||
internal::prefetch(src + sj);
|
||||
@@ -300,7 +300,7 @@ void bgr2gray(const Size2D &size, COLOR_SPACE color_space,
|
||||
const u32 G2Y = color_space == COLOR_SPACE_BT601 ? G2Y_BT601 : G2Y_BT709;
|
||||
const u32 B2Y = color_space == COLOR_SPACE_BT601 ? B2Y_BT601 : B2Y_BT709;
|
||||
|
||||
#if defined(__GNUC__) && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
register int16x4_t v_r2y asm ("d31") = vmov_n_s16(R2Y);
|
||||
register int16x4_t v_g2y asm ("d30") = vmov_n_s16(G2Y);
|
||||
register int16x4_t v_b2y asm ("d29") = vmov_n_s16(B2Y);
|
||||
@@ -319,7 +319,7 @@ void bgr2gray(const Size2D &size, COLOR_SPACE color_space,
|
||||
u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
|
||||
size_t sj = 0u, dj = 0u;
|
||||
|
||||
#if defined(__GNUC__) && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
for (; dj < roiw8; sj += 24, dj += 8)
|
||||
{
|
||||
internal::prefetch(src + sj);
|
||||
@@ -402,7 +402,7 @@ void bgrx2gray(const Size2D &size, COLOR_SPACE color_space,
|
||||
const u32 G2Y = color_space == COLOR_SPACE_BT601 ? G2Y_BT601 : G2Y_BT709;
|
||||
const u32 B2Y = color_space == COLOR_SPACE_BT601 ? B2Y_BT601 : B2Y_BT709;
|
||||
|
||||
#if defined(__GNUC__) && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
register int16x4_t v_r2y asm ("d31") = vmov_n_s16(R2Y);
|
||||
register int16x4_t v_g2y asm ("d30") = vmov_n_s16(G2Y);
|
||||
register int16x4_t v_b2y asm ("d29") = vmov_n_s16(B2Y);
|
||||
@@ -421,7 +421,7 @@ void bgrx2gray(const Size2D &size, COLOR_SPACE color_space,
|
||||
u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
|
||||
size_t sj = 0u, dj = 0u;
|
||||
|
||||
#if defined(__GNUC__) && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
for (; dj < roiw8; sj += 32, dj += 8)
|
||||
{
|
||||
internal::prefetch(src + sj);
|
||||
@@ -512,7 +512,7 @@ void gray2rgb(const Size2D &size,
|
||||
for (; sj < roiw16; sj += 16, dj += 48)
|
||||
{
|
||||
internal::prefetch(src + sj);
|
||||
#if defined(__GNUC__) && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
__asm__ (
|
||||
"vld1.8 {d0-d1}, [%[in0]] \n\t"
|
||||
"vmov.8 q1, q0 \n\t"
|
||||
@@ -538,7 +538,7 @@ void gray2rgb(const Size2D &size,
|
||||
|
||||
if (sj < roiw8)
|
||||
{
|
||||
#if defined(__GNUC__) && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
__asm__ (
|
||||
"vld1.8 {d0}, [%[in]] \n\t"
|
||||
"vmov.8 d1, d0 \n\t"
|
||||
@@ -584,7 +584,7 @@ void gray2rgbx(const Size2D &size,
|
||||
size_t roiw16 = size.width >= 15 ? size.width - 15 : 0;
|
||||
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
|
||||
|
||||
#if defined(__GNUC__) && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
register uint8x16_t vc255 asm ("q4") = vmovq_n_u8(255);
|
||||
#else
|
||||
uint8x16x4_t vRgba;
|
||||
@@ -602,7 +602,7 @@ void gray2rgbx(const Size2D &size,
|
||||
for (; sj < roiw16; sj += 16, dj += 64)
|
||||
{
|
||||
internal::prefetch(src + sj);
|
||||
#if defined(__GNUC__) && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
__asm__ (
|
||||
"vld1.8 {d0-d1}, [%[in0]] \n\t"
|
||||
"vmov.8 q1, q0 \n\t"
|
||||
@@ -628,7 +628,7 @@ void gray2rgbx(const Size2D &size,
|
||||
|
||||
if (sj < roiw8)
|
||||
{
|
||||
#if defined(__GNUC__) && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
__asm__ (
|
||||
"vld1.8 {d5}, [%[in]] \n\t"
|
||||
"vmov.8 d6, d5 \n\t"
|
||||
@@ -672,7 +672,7 @@ void rgb2rgbx(const Size2D &size,
|
||||
internal::assertSupportedConfiguration();
|
||||
#ifdef CAROTENE_NEON
|
||||
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
|
||||
#if defined(__GNUC__) && defined(__arm__)
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
|
||||
register uint8x8_t vc255_0 asm ("d3") = vmov_n_u8(255);
|
||||
#else
|
||||
size_t roiw16 = size.width >= 15 ? size.width - 15 : 0;
|
||||
@@ -688,7 +688,7 @@ void rgb2rgbx(const Size2D &size,
|
||||
u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
|
||||
size_t sj = 0u, dj = 0u, j = 0u;
|
||||
|
||||
#if defined(__GNUC__) && defined(__arm__)
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
|
||||
for (; j < roiw8; sj += 24, dj += 32, j += 8)
|
||||
{
|
||||
internal::prefetch(src + sj);
|
||||
@@ -742,7 +742,7 @@ void rgbx2rgb(const Size2D &size,
|
||||
internal::assertSupportedConfiguration();
|
||||
#ifdef CAROTENE_NEON
|
||||
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
|
||||
#if !defined(__GNUC__) || !defined(__arm__)
|
||||
#if !(!defined(__aarch64__) && defined(__GNUC__) && defined(__arm__))
|
||||
size_t roiw16 = size.width >= 15 ? size.width - 15 : 0;
|
||||
union { uint8x16x4_t v4; uint8x16x3_t v3; } v_dst0;
|
||||
union { uint8x8x4_t v4; uint8x8x3_t v3; } v_dst;
|
||||
@@ -754,7 +754,7 @@ void rgbx2rgb(const Size2D &size,
|
||||
u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
|
||||
size_t sj = 0u, dj = 0u, j = 0u;
|
||||
|
||||
#if defined(__GNUC__) && defined(__arm__)
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
|
||||
for (; j < roiw8; sj += 32, dj += 24, j += 8)
|
||||
{
|
||||
internal::prefetch(src + sj);
|
||||
@@ -805,7 +805,7 @@ void rgb2bgr(const Size2D &size,
|
||||
{
|
||||
internal::assertSupportedConfiguration();
|
||||
#ifdef CAROTENE_NEON
|
||||
#if !defined(__GNUC__) || !defined(__arm__)
|
||||
#if !(!defined(__aarch64__) && defined(__GNUC__) && defined(__arm__))
|
||||
size_t roiw16 = size.width >= 15 ? size.width - 15 : 0;
|
||||
#endif
|
||||
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
|
||||
@@ -817,7 +817,7 @@ void rgb2bgr(const Size2D &size,
|
||||
size_t sj = 0u, dj = 0u, j = 0u;
|
||||
|
||||
|
||||
#if defined(__GNUC__) && defined(__arm__)
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
|
||||
for (; j < roiw8; sj += 24, dj += 24, j += 8)
|
||||
{
|
||||
internal::prefetch(src + sj);
|
||||
@@ -874,7 +874,7 @@ void rgbx2bgrx(const Size2D &size,
|
||||
{
|
||||
internal::assertSupportedConfiguration();
|
||||
#ifdef CAROTENE_NEON
|
||||
#if !defined(__GNUC__) || !defined(__arm__)
|
||||
#if !(!defined(__aarch64__) && defined(__GNUC__) && defined(__arm__))
|
||||
size_t roiw16 = size.width >= 15 ? size.width - 15 : 0;
|
||||
#endif
|
||||
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
|
||||
@@ -885,7 +885,7 @@ void rgbx2bgrx(const Size2D &size,
|
||||
u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
|
||||
size_t sj = 0u, dj = 0u, j = 0u;
|
||||
|
||||
#if defined(__GNUC__) && defined(__arm__)
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
|
||||
for (; j < roiw8; sj += 32, dj += 32, j += 8)
|
||||
{
|
||||
internal::prefetch(src + sj);
|
||||
@@ -943,7 +943,7 @@ void rgbx2bgr(const Size2D &size,
|
||||
{
|
||||
internal::assertSupportedConfiguration();
|
||||
#ifdef CAROTENE_NEON
|
||||
#if !defined(__GNUC__) || !defined(__arm__)
|
||||
#if !(!defined(__aarch64__) && defined(__GNUC__) && defined(__arm__))
|
||||
size_t roiw16 = size.width >= 15 ? size.width - 15 : 0;
|
||||
#endif
|
||||
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
|
||||
@@ -954,7 +954,7 @@ void rgbx2bgr(const Size2D &size,
|
||||
u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
|
||||
size_t sj = 0u, dj = 0u, j = 0u;
|
||||
|
||||
#if defined(__GNUC__) && defined(__arm__)
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
|
||||
for (; j < roiw8; sj += 32, dj += 24, j += 8)
|
||||
{
|
||||
internal::prefetch(src + sj);
|
||||
@@ -1010,7 +1010,7 @@ void rgb2bgrx(const Size2D &size,
|
||||
{
|
||||
internal::assertSupportedConfiguration();
|
||||
#ifdef CAROTENE_NEON
|
||||
#if defined(__GNUC__) && defined(__arm__)
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
|
||||
register uint8x8_t vc255 asm ("d3") = vmov_n_u8(255);
|
||||
#else
|
||||
union { uint8x16x4_t v4; uint8x16x3_t v3; } vals0;
|
||||
@@ -1019,7 +1019,7 @@ void rgb2bgrx(const Size2D &size,
|
||||
vals8.v4.val[3] = vmov_n_u8(255);
|
||||
#endif
|
||||
|
||||
#if !defined(__GNUC__) || !defined(__arm__)
|
||||
#if !(!defined(__aarch64__) && defined(__GNUC__) && defined(__arm__))
|
||||
size_t roiw16 = size.width >= 15 ? size.width - 15 : 0;
|
||||
#endif
|
||||
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
|
||||
@@ -1030,7 +1030,7 @@ void rgb2bgrx(const Size2D &size,
|
||||
u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
|
||||
size_t sj = 0u, dj = 0u, j = 0u;
|
||||
|
||||
#if defined(__GNUC__) && defined(__arm__)
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
|
||||
for (; j < roiw8; sj += 24, dj += 32, j += 8)
|
||||
{
|
||||
internal::prefetch(src + sj);
|
||||
@@ -1087,12 +1087,12 @@ inline uint8x8x3_t convertToHSV(const uint8x8_t vR, const uint8x8_t vG, const ui
|
||||
const s32 hrange )
|
||||
{
|
||||
const s32 hsv_shift = 12;
|
||||
register const f32 vsdiv_table = f32(255 << hsv_shift);
|
||||
register f32 vhdiv_table = f32(hrange << hsv_shift);
|
||||
register const s32 vhrange = hrange;
|
||||
register const s32 v0 = s32(0);
|
||||
register const s32 vshift = s32(1 << (hsv_shift-1));
|
||||
register const s32 v6 = s32(6);
|
||||
const f32 vsdiv_table = f32(255 << hsv_shift);
|
||||
f32 vhdiv_table = f32(hrange << hsv_shift);
|
||||
const s32 vhrange = hrange;
|
||||
const s32 v0 = s32(0);
|
||||
const s32 vshift = s32(1 << (hsv_shift-1));
|
||||
const s32 v6 = s32(6);
|
||||
|
||||
uint8x8_t vMin = vmin_u8(vR, vG);
|
||||
uint8x8_t vMax = vmax_u8(vR, vG);
|
||||
@@ -1409,7 +1409,7 @@ inline void convertToHSV(const s32 r, const s32 g, const s32 b,
|
||||
"d24","d25","d26","d27","d28","d29","d30","d31" \
|
||||
);
|
||||
|
||||
#if __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
|
||||
#define YCRCB_CONSTS \
|
||||
register int16x4_t vcYR asm ("d31") = vmov_n_s16(4899); \
|
||||
@@ -1555,7 +1555,7 @@ inline uint8x8x3_t convertToYCrCb( const int16x8_t& vR, const int16x8_t& vG, con
|
||||
#define COEFF_G ( 8663)
|
||||
#define COEFF_B (-17705)
|
||||
|
||||
#if defined(__GNUC__) && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
#define YUV420ALPHA3_CONST
|
||||
#define YUV420ALPHA4_CONST register uint8x16_t c255 asm ("q13") = vmovq_n_u8(255);
|
||||
#define YUV420ALPHA3_CONVERT
|
||||
@@ -1852,7 +1852,7 @@ void rgb2hsv(const Size2D &size,
|
||||
#ifdef CAROTENE_NEON
|
||||
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
|
||||
const s32 hsv_shift = 12;
|
||||
#if defined(__GNUC__) && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
register const f32 vsdiv_table = f32(255 << hsv_shift);
|
||||
register f32 vhdiv_table = f32(hrange << hsv_shift);
|
||||
register const s32 vhrange = hrange;
|
||||
@@ -1871,7 +1871,7 @@ void rgb2hsv(const Size2D &size,
|
||||
for (; j < roiw8; sj += 24, dj += 24, j += 8)
|
||||
{
|
||||
internal::prefetch(src + sj);
|
||||
#if defined(__GNUC__) && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CONVERT_TO_HSV_ASM(vld3.8 {d0-d2}, d0, d2)
|
||||
#else
|
||||
uint8x8x3_t vRgb = vld3_u8(src + sj);
|
||||
@@ -1904,7 +1904,7 @@ void rgbx2hsv(const Size2D &size,
|
||||
#ifdef CAROTENE_NEON
|
||||
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
|
||||
const s32 hsv_shift = 12;
|
||||
#if defined(__GNUC__) && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
register const f32 vsdiv_table = f32(255 << hsv_shift);
|
||||
register f32 vhdiv_table = f32(hrange << hsv_shift);
|
||||
register const s32 vhrange = hrange;
|
||||
@@ -1923,7 +1923,7 @@ void rgbx2hsv(const Size2D &size,
|
||||
for (; j < roiw8; sj += 32, dj += 24, j += 8)
|
||||
{
|
||||
internal::prefetch(src + sj);
|
||||
#if defined(__GNUC__) && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CONVERT_TO_HSV_ASM(vld4.8 {d0-d3}, d0, d2)
|
||||
#else
|
||||
uint8x8x4_t vRgb = vld4_u8(src + sj);
|
||||
@@ -1956,7 +1956,7 @@ void bgr2hsv(const Size2D &size,
|
||||
#ifdef CAROTENE_NEON
|
||||
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
|
||||
const s32 hsv_shift = 12;
|
||||
#if defined(__GNUC__) && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
register const f32 vsdiv_table = f32(255 << hsv_shift);
|
||||
register f32 vhdiv_table = f32(hrange << hsv_shift);
|
||||
register const s32 vhrange = hrange;
|
||||
@@ -1975,7 +1975,7 @@ void bgr2hsv(const Size2D &size,
|
||||
for (; j < roiw8; sj += 24, dj += 24, j += 8)
|
||||
{
|
||||
internal::prefetch(src + sj);
|
||||
#if defined(__GNUC__) && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CONVERT_TO_HSV_ASM(vld3.8 {d0-d2}, d2, d0)
|
||||
#else
|
||||
uint8x8x3_t vRgb = vld3_u8(src + sj);
|
||||
@@ -2008,7 +2008,7 @@ void bgrx2hsv(const Size2D &size,
|
||||
#ifdef CAROTENE_NEON
|
||||
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
|
||||
const s32 hsv_shift = 12;
|
||||
#if defined(__GNUC__) && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
register const f32 vsdiv_table = f32(255 << hsv_shift);
|
||||
register f32 vhdiv_table = f32(hrange << hsv_shift);
|
||||
register const s32 vhrange = hrange;
|
||||
@@ -2027,7 +2027,7 @@ void bgrx2hsv(const Size2D &size,
|
||||
for (; j < roiw8; sj += 32, dj += 24, j += 8)
|
||||
{
|
||||
internal::prefetch(src + sj);
|
||||
#if defined(__GNUC__) && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CONVERT_TO_HSV_ASM(vld4.8 {d0-d3}, d2, d0)
|
||||
#else
|
||||
uint8x8x4_t vRgb = vld4_u8(src + sj);
|
||||
@@ -2068,7 +2068,7 @@ void rgbx2bgr565(const Size2D &size,
|
||||
for (; j < roiw16; sj += 64, dj += 32, j += 16)
|
||||
{
|
||||
internal::prefetch(src + sj);
|
||||
#if defined(__GNUC__) && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
__asm__ (
|
||||
"vld4.8 {d2, d4, d6, d8}, [%[in0]] @ q0 q1 q2 q3 q4 \n\t"
|
||||
"vld4.8 {d3, d5, d7, d9}, [%[in1]] @ xxxxxxxx rrrrRRRR ggggGGGG bbbbBBBB xxxxxxxx \n\t"
|
||||
@@ -2122,7 +2122,7 @@ void rgb2bgr565(const Size2D &size,
|
||||
for (; j < roiw16; sj += 48, dj += 32, j += 16)
|
||||
{
|
||||
internal::prefetch(src + sj);
|
||||
#if defined(__GNUC__) && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
__asm__ (
|
||||
"vld3.8 {d2, d4, d6}, [%[in0]] @ q0 q1 q2 q3 q4 \n\t"
|
||||
"vld3.8 {d3, d5, d7}, [%[in1]] @ xxxxxxxx rrrrRRRR ggggGGGG bbbbBBBB xxxxxxxx \n\t"
|
||||
@@ -2176,7 +2176,7 @@ void rgbx2rgb565(const Size2D &size,
|
||||
for (; j < roiw16; sj += 64, dj += 32, j += 16)
|
||||
{
|
||||
internal::prefetch(src + sj);
|
||||
#if defined(__GNUC__) && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
__asm__ (
|
||||
"vld4.8 {d0, d2, d4, d6}, [%[in0]] @ q0 q1 q2 q3 \n\t"
|
||||
"vld4.8 {d1, d3, d5, d7}, [%[in1]] @ rrrrRRRR ggggGGGG bbbbBBBB aaaaAAAA \n\t"
|
||||
@@ -2230,7 +2230,7 @@ void rgb2rgb565(const Size2D &size,
|
||||
for (; j < roiw16; sj += 48, dj += 32, j += 16)
|
||||
{
|
||||
internal::prefetch(src + sj);
|
||||
#if defined(__GNUC__) && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
__asm__ (
|
||||
"vld3.8 {d0, d2, d4}, [%[in0]] @ q0 q1 q2 q3 \n\t"
|
||||
"vld3.8 {d1, d3, d5}, [%[in1]] @ rrrrRRRR ggggGGGG bbbbBBBB xxxxxxxx \n\t"
|
||||
@@ -2285,7 +2285,7 @@ void rgb2ycrcb(const Size2D &size,
|
||||
for (; j < roiw8; sj += 24, dj += 24, j += 8)
|
||||
{
|
||||
internal::prefetch(src + sj);
|
||||
#if defined(__GNUC__) && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CONVERTTOYCRCB(vld3.8 {d0-d2}, d0, d1, d2)
|
||||
#else
|
||||
uint8x8x3_t vRgb = vld3_u8(src + sj);
|
||||
@@ -2329,7 +2329,7 @@ void rgbx2ycrcb(const Size2D &size,
|
||||
for (; j < roiw8; sj += 32, dj += 24, j += 8)
|
||||
{
|
||||
internal::prefetch(src + sj);
|
||||
#if defined(__GNUC__) && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CONVERTTOYCRCB(vld4.8 {d0-d3}, d0, d1, d2)
|
||||
#else
|
||||
uint8x8x4_t vRgba = vld4_u8(src + sj);
|
||||
@@ -2373,7 +2373,7 @@ void bgr2ycrcb(const Size2D &size,
|
||||
for (; j < roiw8; sj += 24, dj += 24, j += 8)
|
||||
{
|
||||
internal::prefetch(src + sj);
|
||||
#if defined(__GNUC__) && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CONVERTTOYCRCB(vld3.8 {d0-d2}, d2, d1, d0)
|
||||
#else
|
||||
uint8x8x3_t vBgr = vld3_u8(src + sj);
|
||||
@@ -2417,7 +2417,7 @@ void bgrx2ycrcb(const Size2D &size,
|
||||
for (; j < roiw8; sj += 32, dj += 24, j += 8)
|
||||
{
|
||||
internal::prefetch(src + sj);
|
||||
#if defined(__GNUC__) && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CONVERTTOYCRCB(vld4.8 {d0-d3}, d2, d1, d0)
|
||||
#else
|
||||
uint8x8x4_t vBgra = vld4_u8(src + sj);
|
||||
@@ -2466,9 +2466,9 @@ void yuv420sp2rgb(const Size2D &size,
|
||||
// B = [((149*y)/2 + (-17705+129*u) )/2]/32
|
||||
|
||||
// error estimation:
|
||||
//Rerr = 0.0000625 * y − 0.00225 * v − 0.287
|
||||
//Rerr = 0.0000625 * y - 0.00225 * v - 0.287
|
||||
//Gerr = 0.0000625 * y + 0.0005 * v + 0.000375 * u + 0.128625
|
||||
//Berr = 0.0000625 * y − 0.002375 * u - 0.287375
|
||||
//Berr = 0.0000625 * y - 0.002375 * u - 0.287375
|
||||
|
||||
//real error test:
|
||||
//=================
|
||||
@@ -2499,7 +2499,7 @@ void yuv420sp2rgb(const Size2D &size,
|
||||
internal::prefetch(uv + j);
|
||||
internal::prefetch(y1 + j);
|
||||
internal::prefetch(y2 + j);
|
||||
#if defined(__GNUC__) && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CONVERTYUV420TORGB(3, d1, d0, q5, q6)
|
||||
#else
|
||||
convertYUV420.ToRGB(y1 + j, y2 + j, uv + j, dst1 + dj, dst2 + dj);
|
||||
@@ -2545,7 +2545,7 @@ void yuv420sp2rgbx(const Size2D &size,
|
||||
internal::prefetch(uv + j);
|
||||
internal::prefetch(y1 + j);
|
||||
internal::prefetch(y2 + j);
|
||||
#if defined(__GNUC__) && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CONVERTYUV420TORGB(4, d1, d0, q5, q6)
|
||||
#else
|
||||
convertYUV420.ToRGB(y1 + j, y2 + j, uv + j, dst1 + dj, dst2 + dj);
|
||||
@@ -2591,7 +2591,7 @@ void yuv420i2rgb(const Size2D &size,
|
||||
internal::prefetch(uv + j);
|
||||
internal::prefetch(y1 + j);
|
||||
internal::prefetch(y2 + j);
|
||||
#if defined(__GNUC__) && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CONVERTYUV420TORGB(3, d0, d1, q5, q6)
|
||||
#else
|
||||
convertYUV420.ToRGB(y1 + j, y2 + j, uv + j, dst1 + dj, dst2 + dj);
|
||||
@@ -2637,7 +2637,7 @@ void yuv420i2rgbx(const Size2D &size,
|
||||
internal::prefetch(uv + j);
|
||||
internal::prefetch(y1 + j);
|
||||
internal::prefetch(y2 + j);
|
||||
#if defined(__GNUC__) && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CONVERTYUV420TORGB(4, d0, d1, q5, q6)
|
||||
#else
|
||||
convertYUV420.ToRGB(y1 + j, y2 + j, uv + j, dst1 + dj, dst2 + dj);
|
||||
@@ -2683,7 +2683,7 @@ void yuv420sp2bgr(const Size2D &size,
|
||||
internal::prefetch(uv + j);
|
||||
internal::prefetch(y1 + j);
|
||||
internal::prefetch(y2 + j);
|
||||
#if defined(__GNUC__) && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CONVERTYUV420TORGB(3, d1, d0, q6, q5)
|
||||
#else
|
||||
convertYUV420.ToRGB(y1 + j, y2 + j, uv + j, dst1 + dj, dst2 + dj);
|
||||
@@ -2729,7 +2729,7 @@ void yuv420sp2bgrx(const Size2D &size,
|
||||
internal::prefetch(uv + j);
|
||||
internal::prefetch(y1 + j);
|
||||
internal::prefetch(y2 + j);
|
||||
#if defined(__GNUC__) && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CONVERTYUV420TORGB(4, d1, d0, q6, q5)
|
||||
#else
|
||||
convertYUV420.ToRGB(y1 + j, y2 + j, uv + j, dst1 + dj, dst2 + dj);
|
||||
@@ -2775,7 +2775,7 @@ void yuv420i2bgr(const Size2D &size,
|
||||
internal::prefetch(uv + j);
|
||||
internal::prefetch(y1 + j);
|
||||
internal::prefetch(y2 + j);
|
||||
#if defined(__GNUC__) && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CONVERTYUV420TORGB(3, d0, d1, q6, q5)
|
||||
#else
|
||||
convertYUV420.ToRGB(y1 + j, y2 + j, uv + j, dst1 + dj, dst2 + dj);
|
||||
@@ -2821,7 +2821,7 @@ void yuv420i2bgrx(const Size2D &size,
|
||||
internal::prefetch(uv + j);
|
||||
internal::prefetch(y1 + j);
|
||||
internal::prefetch(y2 + j);
|
||||
#if defined(__GNUC__) && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CONVERTYUV420TORGB(4, d0, d1, q6, q5)
|
||||
#else
|
||||
convertYUV420.ToRGB(y1 + j, y2 + j, uv + j, dst1 + dj, dst2 + dj);
|
||||
|
||||
Vendored
+27
-27
@@ -101,7 +101,7 @@ CVT_FUNC(u8, s8, 16,
|
||||
}
|
||||
})
|
||||
|
||||
#if __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CVT_FUNC(u8, u16, 16,
|
||||
register uint8x16_t zero0 asm ("q1") = vmovq_n_u8(0);,
|
||||
{
|
||||
@@ -135,7 +135,7 @@ CVT_FUNC(u8, u16, 16,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CVT_FUNC(u8, s32, 16,
|
||||
register uint8x16_t zero0 asm ("q1") = vmovq_n_u8(0);
|
||||
register uint8x16_t zero1 asm ("q2") = vmovq_n_u8(0);
|
||||
@@ -173,7 +173,7 @@ CVT_FUNC(u8, s32, 16,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if __GNUC_MINOR__ < 6
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
|
||||
CVT_FUNC(u8, f32, 16,
|
||||
,
|
||||
{
|
||||
@@ -248,7 +248,7 @@ CVT_FUNC(s8, u8, 16,
|
||||
}
|
||||
})
|
||||
|
||||
#if __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CVT_FUNC(s8, u16, 16,
|
||||
register uint8x16_t zero0 asm ("q1") = vmovq_n_u8(0);,
|
||||
{
|
||||
@@ -284,7 +284,7 @@ CVT_FUNC(s8, u16, 16,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if __GNUC_MINOR__ < 6
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
|
||||
CVT_FUNC(s8, s16, 16,
|
||||
,
|
||||
{
|
||||
@@ -323,7 +323,7 @@ CVT_FUNC(s8, s16, 16,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CVT_FUNC(s8, s32, 16,
|
||||
,
|
||||
{
|
||||
@@ -377,7 +377,7 @@ CVT_FUNC(s8, s32, 16,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if __GNUC_MINOR__ < 6
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
|
||||
CVT_FUNC(s8, f32, 16,
|
||||
,
|
||||
{
|
||||
@@ -440,7 +440,7 @@ CVT_FUNC(s8, f32, 16,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if __GNUC_MINOR__ < 6
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
|
||||
CVT_FUNC(u16, u8, 16,
|
||||
,
|
||||
{
|
||||
@@ -479,7 +479,7 @@ CVT_FUNC(u16, u8, 16,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if __GNUC_MINOR__ < 6
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
|
||||
CVT_FUNC(u16, s8, 16,
|
||||
register uint8x16_t v127 asm ("q4") = vmovq_n_u8(127);,
|
||||
{
|
||||
@@ -522,7 +522,7 @@ CVT_FUNC(u16, s8, 16,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CVT_FUNC(u16, s16, 8,
|
||||
register uint16x8_t v32767 asm ("q4") = vmovq_n_u16(0x7FFF);,
|
||||
{
|
||||
@@ -555,7 +555,7 @@ CVT_FUNC(u16, s16, 8,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CVT_FUNC(u16, s32, 8,
|
||||
register uint16x8_t zero0 asm ("q1") = vmovq_n_u16(0);,
|
||||
{
|
||||
@@ -589,7 +589,7 @@ CVT_FUNC(u16, s32, 8,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if __GNUC_MINOR__ < 6
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
|
||||
CVT_FUNC(u16, f32, 8,
|
||||
,
|
||||
{
|
||||
@@ -633,7 +633,7 @@ CVT_FUNC(u16, f32, 8,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if __GNUC_MINOR__ < 6
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
|
||||
CVT_FUNC(s16, u8, 16,
|
||||
,
|
||||
{
|
||||
@@ -672,7 +672,7 @@ CVT_FUNC(s16, u8, 16,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if __GNUC_MINOR__ < 6
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
|
||||
CVT_FUNC(s16, s8, 16,
|
||||
,
|
||||
{
|
||||
@@ -711,7 +711,7 @@ CVT_FUNC(s16, s8, 16,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CVT_FUNC(s16, u16, 8,
|
||||
register int16x8_t vZero asm ("q4") = vmovq_n_s16(0);,
|
||||
{
|
||||
@@ -747,7 +747,7 @@ CVT_FUNC(s16, u16, 8,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if __GNUC_MINOR__ < 6
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
|
||||
CVT_FUNC(s16, s32, 8,
|
||||
,
|
||||
{
|
||||
@@ -786,7 +786,7 @@ CVT_FUNC(s16, s32, 8,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if __GNUC_MINOR__ < 6
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
|
||||
CVT_FUNC(s16, f32, 8,
|
||||
,
|
||||
{
|
||||
@@ -829,7 +829,7 @@ CVT_FUNC(s16, f32, 8,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if __GNUC_MINOR__ < 6
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
|
||||
CVT_FUNC(s32, u8, 8,
|
||||
,
|
||||
{
|
||||
@@ -870,7 +870,7 @@ CVT_FUNC(s32, u8, 8,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if __GNUC_MINOR__ < 6
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
|
||||
CVT_FUNC(s32, s8, 8,
|
||||
,
|
||||
{
|
||||
@@ -911,7 +911,7 @@ CVT_FUNC(s32, s8, 8,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if __GNUC_MINOR__ < 6
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
|
||||
CVT_FUNC(s32, u16, 8,
|
||||
,
|
||||
{
|
||||
@@ -950,7 +950,7 @@ CVT_FUNC(s32, u16, 8,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if __GNUC_MINOR__ < 6
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
|
||||
CVT_FUNC(s32, s16, 8,
|
||||
,
|
||||
{
|
||||
@@ -989,7 +989,7 @@ CVT_FUNC(s32, s16, 8,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if __GNUC_MINOR__ < 6
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
|
||||
CVT_FUNC(s32, f32, 8,
|
||||
,
|
||||
{
|
||||
@@ -1034,7 +1034,7 @@ CVT_FUNC(s32, f32, 8,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if __GNUC_MINOR__ < 6
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
|
||||
CVT_FUNC(f32, u8, 8,
|
||||
register float32x4_t vmult asm ("q0") = vdupq_n_f32((float)(1 << 16));
|
||||
register uint32x4_t vmask asm ("q1") = vdupq_n_u32(1<<16);,
|
||||
@@ -1101,7 +1101,7 @@ CVT_FUNC(f32, u8, 8,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if __GNUC_MINOR__ < 6
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
|
||||
CVT_FUNC(f32, s8, 8,
|
||||
register float32x4_t vhalf asm ("q0") = vdupq_n_f32(0.5f);,
|
||||
{
|
||||
@@ -1153,7 +1153,7 @@ CVT_FUNC(f32, s8, 8,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if __GNUC_MINOR__ < 6
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
|
||||
CVT_FUNC(f32, u16, 8,
|
||||
register float32x4_t vhalf asm ("q0") = vdupq_n_f32(0.5f);,
|
||||
{
|
||||
@@ -1212,7 +1212,7 @@ CVT_FUNC(f32, u16, 8,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if __GNUC_MINOR__ < 6
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
|
||||
CVT_FUNC(f32, s16, 8,
|
||||
register float32x4_t vhalf asm ("q0") = vdupq_n_f32(0.5f);,
|
||||
{
|
||||
@@ -1271,7 +1271,7 @@ CVT_FUNC(f32, s16, 8,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if __GNUC_MINOR__ < 6
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
|
||||
CVT_FUNC(f32, s32, 8,
|
||||
register float32x4_t vhalf asm ("q0") = vdupq_n_f32(0.5f);,
|
||||
{
|
||||
|
||||
+36
-36
@@ -135,7 +135,7 @@ namespace CAROTENE_NS {
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && defined(__arm__)
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
|
||||
CVTS_FUNC1(u8, 16,
|
||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
||||
@@ -220,7 +220,7 @@ CVTS_FUNC1(u8, 16,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && defined(__arm__)
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
|
||||
CVTS_FUNC(u8, s8, 16,
|
||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
||||
@@ -305,7 +305,7 @@ CVTS_FUNC(u8, s8, 16,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && defined(__arm__)
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
|
||||
CVTS_FUNC(u8, u16, 16,
|
||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
||||
@@ -389,7 +389,7 @@ CVTS_FUNC(u8, u16, 16,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && defined(__arm__)
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
|
||||
CVTS_FUNC(u8, s16, 16,
|
||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
||||
@@ -473,7 +473,7 @@ CVTS_FUNC(u8, s16, 16,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CVTS_FUNC(u8, s32, 16,
|
||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
||||
@@ -562,7 +562,7 @@ CVTS_FUNC(u8, s32, 16,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CVTS_FUNC(u8, f32, 16,
|
||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta);,
|
||||
@@ -643,7 +643,7 @@ CVTS_FUNC(u8, f32, 16,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && defined(__arm__)
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
|
||||
CVTS_FUNC(s8, u8, 16,
|
||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
||||
@@ -728,7 +728,7 @@ CVTS_FUNC(s8, u8, 16,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && defined(__arm__)
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
|
||||
CVTS_FUNC1(s8, 16,
|
||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
||||
@@ -813,7 +813,7 @@ CVTS_FUNC1(s8, 16,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && defined(__arm__)
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
|
||||
CVTS_FUNC(s8, u16, 16,
|
||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
||||
@@ -899,7 +899,7 @@ CVTS_FUNC(s8, u16, 16,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && defined(__arm__)
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
|
||||
CVTS_FUNC(s8, s16, 16,
|
||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
||||
@@ -985,7 +985,7 @@ CVTS_FUNC(s8, s16, 16,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CVTS_FUNC(s8, s32, 16,
|
||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
||||
@@ -1074,7 +1074,7 @@ CVTS_FUNC(s8, s32, 16,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CVTS_FUNC(s8, f32, 16,
|
||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta);,
|
||||
@@ -1155,7 +1155,7 @@ CVTS_FUNC(s8, f32, 16,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CVTS_FUNC(u16, u8, 16,
|
||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
||||
@@ -1214,7 +1214,7 @@ CVTS_FUNC(u16, u8, 16,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CVTS_FUNC(u16, s8, 16,
|
||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
||||
@@ -1273,7 +1273,7 @@ CVTS_FUNC(u16, s8, 16,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CVTS_FUNC1(u16, 16,
|
||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
||||
@@ -1330,7 +1330,7 @@ CVTS_FUNC1(u16, 16,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CVTS_FUNC(u16, s16, 8,
|
||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
||||
@@ -1387,7 +1387,7 @@ CVTS_FUNC(u16, s16, 8,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CVTS_FUNC(u16, s32, 8,
|
||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
||||
@@ -1443,7 +1443,7 @@ CVTS_FUNC(u16, s32, 8,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CVTS_FUNC(u16, f32, 8,
|
||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta);,
|
||||
@@ -1495,7 +1495,7 @@ CVTS_FUNC(u16, f32, 8,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CVTS_FUNC(s16, u8, 16,
|
||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
||||
@@ -1554,7 +1554,7 @@ CVTS_FUNC(s16, u8, 16,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CVTS_FUNC(s16, s8, 16,
|
||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
||||
@@ -1613,7 +1613,7 @@ CVTS_FUNC(s16, s8, 16,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CVTS_FUNC(s16, u16, 8,
|
||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
||||
@@ -1670,7 +1670,7 @@ CVTS_FUNC(s16, u16, 8,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CVTS_FUNC1(s16, 16,
|
||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
||||
@@ -1727,7 +1727,7 @@ CVTS_FUNC1(s16, 16,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CVTS_FUNC(s16, s32, 8,
|
||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
||||
@@ -1783,7 +1783,7 @@ CVTS_FUNC(s16, s32, 8,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CVTS_FUNC(s16, f32, 8,
|
||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta);,
|
||||
@@ -1835,7 +1835,7 @@ CVTS_FUNC(s16, f32, 8,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CVTS_FUNC(s32, u8, 8,
|
||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
||||
@@ -1893,7 +1893,7 @@ CVTS_FUNC(s32, u8, 8,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CVTS_FUNC(s32, s8, 8,
|
||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
||||
@@ -1951,7 +1951,7 @@ CVTS_FUNC(s32, s8, 8,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CVTS_FUNC(s32, u16, 8,
|
||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
||||
@@ -2007,7 +2007,7 @@ CVTS_FUNC(s32, u16, 8,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CVTS_FUNC(s32, s16, 8,
|
||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
||||
@@ -2063,7 +2063,7 @@ CVTS_FUNC(s32, s16, 8,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CVTS_FUNC1(s32, 8,
|
||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
||||
@@ -2118,7 +2118,7 @@ CVTS_FUNC1(s32, 8,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CVTS_FUNC(s32, f32, 8,
|
||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta);,
|
||||
@@ -2169,7 +2169,7 @@ CVTS_FUNC(s32, f32, 8,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CVTS_FUNC(f32, u8, 8,
|
||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)((1 << 16)*alpha));
|
||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)((1 << 16)*beta));
|
||||
@@ -2239,7 +2239,7 @@ CVTS_FUNC(f32, u8, 8,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CVTS_FUNC(f32, s8, 8,
|
||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
||||
@@ -2293,7 +2293,7 @@ CVTS_FUNC(f32, s8, 8,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CVTS_FUNC(f32, u16, 8,
|
||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
||||
@@ -2345,7 +2345,7 @@ CVTS_FUNC(f32, u16, 8,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CVTS_FUNC(f32, s16, 8,
|
||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
||||
@@ -2397,7 +2397,7 @@ CVTS_FUNC(f32, s16, 8,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CVTS_FUNC(f32, s32, 8,
|
||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
||||
@@ -2448,7 +2448,7 @@ CVTS_FUNC(f32, s32, 8,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CVTS_FUNC1(f32, 8,
|
||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta);,
|
||||
|
||||
Vendored
+4
-4
@@ -105,12 +105,12 @@ void flip3(const Size2D & size,
|
||||
{
|
||||
using namespace internal;
|
||||
|
||||
#ifndef ANDROID
|
||||
#ifndef __ANDROID__
|
||||
typedef typename VecTraits<T, 3>::vec128 vec128;
|
||||
#endif
|
||||
typedef typename VecTraits<T, 3>::vec64 vec64;
|
||||
|
||||
#ifndef ANDROID
|
||||
#ifndef __ANDROID__
|
||||
u32 step_base = 16 / sizeof(T), step_base3 = step_base * 3;
|
||||
size_t roiw_base = size.width >= (step_base - 1) ? size.width - step_base + 1 : 0;
|
||||
#endif
|
||||
@@ -123,7 +123,7 @@ void flip3(const Size2D & size,
|
||||
T * dst = getRowPtr((T *)dstBase, dstStride, (flipMode & FLIP_VERTICAL_MODE) != 0 ? size.height - i - 1 : i);
|
||||
size_t j = 0, js = 0, jd = size.width * 3;
|
||||
|
||||
#ifndef ANDROID
|
||||
#ifndef __ANDROID__
|
||||
for (; j < roiw_base; j += step_base, js += step_base3, jd -= step_base3)
|
||||
{
|
||||
prefetch(src + js);
|
||||
@@ -139,7 +139,7 @@ void flip3(const Size2D & size,
|
||||
|
||||
vst3q(dst + jd - step_base3, v_dst);
|
||||
}
|
||||
#endif // ANDROID
|
||||
#endif // __ANDROID__
|
||||
|
||||
for (; j < roiw_tail; j += step_tail, js += step_tail3, jd -= step_tail3)
|
||||
{
|
||||
|
||||
+3
-3
@@ -327,7 +327,7 @@ void gaussianBlur5x5(const Size2D &size, s32 cn,
|
||||
u16* lidx1 = lane + x - 1*2;
|
||||
u16* lidx3 = lane + x + 1*2;
|
||||
u16* lidx4 = lane + x + 2*2;
|
||||
#if __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
__asm__ __volatile__ (
|
||||
"vld2.16 {d0, d2}, [%[in0]]! \n\t"
|
||||
"vld2.16 {d1, d3}, [%[in0]] \n\t"
|
||||
@@ -398,7 +398,7 @@ void gaussianBlur5x5(const Size2D &size, s32 cn,
|
||||
u16* lidx1 = lane + x - 1*3;
|
||||
u16* lidx3 = lane + x + 1*3;
|
||||
u16* lidx4 = lane + x + 2*3;
|
||||
#if defined(__GNUC__) && defined(__arm__)
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
|
||||
__asm__ __volatile__ (
|
||||
"vld3.16 {d0, d2, d4}, [%[in0]]! \n\t"
|
||||
"vld3.16 {d1, d3, d5}, [%[in0]] \n\t"
|
||||
@@ -482,7 +482,7 @@ void gaussianBlur5x5(const Size2D &size, s32 cn,
|
||||
u16* lidx1 = lane + x - 1*4;
|
||||
u16* lidx3 = lane + x + 1*4;
|
||||
u16* lidx4 = lane + x + 2*4;
|
||||
#if defined(__GNUC__) && defined(__arm__)
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
|
||||
__asm__ __volatile__ (
|
||||
"vld4.16 {d0, d2, d4, d6}, [%[in0]]! \n\t"
|
||||
"vld4.16 {d1, d3, d5, d7}, [%[in0]] \n\t"
|
||||
|
||||
+1
-1
@@ -210,7 +210,7 @@ void pyrLKOptFlowLevel(const Size2D &size, s32 cn,
|
||||
internal::prefetch(dsrc + dstep * 2, 0);
|
||||
for(x = 0; x <= wwcn - 4; x += 4, dsrc += 4*2, dIptr += 4*2 )
|
||||
{
|
||||
#if __GNUC_MINOR__ < 0
|
||||
#if 0
|
||||
__asm__ (
|
||||
"vld2.16 {d0-d1}, [%[dsrc00]] \n\t"
|
||||
"vld2.16 {d2-d3}, [%[dsrc10]] \n\t"
|
||||
|
||||
Vendored
+15
-15
@@ -331,7 +331,7 @@ void gaussianPyramidDown(const Size2D &srcSize,
|
||||
for (; x < roiw8; x += 8)
|
||||
{
|
||||
internal::prefetch(lane + 2 * x);
|
||||
#if __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
__asm__ (
|
||||
"vld2.16 {d0-d3}, [%[in0]] \n\t"
|
||||
"vld2.16 {d4-d7}, [%[in4]] \n\t"
|
||||
@@ -538,7 +538,7 @@ void gaussianPyramidDown(const Size2D &srcSize,
|
||||
for (; x < roiw4; x += 4)
|
||||
{
|
||||
internal::prefetch(lane + 2 * x);
|
||||
#if __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
__asm__ (
|
||||
"vld2.32 {d0-d3}, [%[in0]] \n\t"
|
||||
"vld2.32 {d4-d7}, [%[in4]] \n\t"
|
||||
@@ -672,7 +672,7 @@ void gaussianPyramidDown(const Size2D &srcSize,
|
||||
std::vector<f32> _buf(cn*(srcSize.width + 4) + 32/sizeof(f32));
|
||||
f32* lane = internal::alignPtr(&_buf[2*cn], 32);
|
||||
|
||||
#if __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
register float32x4_t vc6d4f32 asm ("q11") = vmovq_n_f32(1.5f); // 6/4
|
||||
register float32x4_t vc1d4f32 asm ("q12") = vmovq_n_f32(0.25f); // 1/4
|
||||
|
||||
@@ -680,12 +680,12 @@ void gaussianPyramidDown(const Size2D &srcSize,
|
||||
register float32x4_t vc4d64f32 asm ("q14") = vmovq_n_f32(0.0625f); //4/4/16
|
||||
register float32x4_t vc6d64f32 asm ("q15") = vmovq_n_f32(0.09375f); //6/4/16
|
||||
#else
|
||||
register float32x4_t vc6d4f32 = vmovq_n_f32(1.5f); // 6/4
|
||||
register float32x4_t vc1d4f32 = vmovq_n_f32(0.25f); // 1/4
|
||||
float32x4_t vc6d4f32 = vmovq_n_f32(1.5f); // 6/4
|
||||
float32x4_t vc1d4f32 = vmovq_n_f32(0.25f); // 1/4
|
||||
|
||||
register float32x4_t vc1d64f32 = vmovq_n_f32(0.015625f); //1/4/16
|
||||
register float32x4_t vc4d64f32 = vmovq_n_f32(0.0625f); //4/4/16
|
||||
register float32x4_t vc6d64f32 = vmovq_n_f32(0.09375f); //6/4/16
|
||||
float32x4_t vc1d64f32 = vmovq_n_f32(0.015625f); //1/4/16
|
||||
float32x4_t vc4d64f32 = vmovq_n_f32(0.0625f); //4/4/16
|
||||
float32x4_t vc6d64f32 = vmovq_n_f32(0.09375f); //6/4/16
|
||||
#endif
|
||||
|
||||
for (size_t i = 0; i < dstSize.height; ++i)
|
||||
@@ -739,7 +739,7 @@ void gaussianPyramidDown(const Size2D &srcSize,
|
||||
for (; x < roiw4; x += 4)
|
||||
{
|
||||
internal::prefetch(lane + 2 * x);
|
||||
#if __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
__asm__ __volatile__ (
|
||||
"vld2.32 {d0-d3}, [%[in0]] \n\t"
|
||||
"vld2.32 {d8-d11}, [%[in4]] \n\t"
|
||||
@@ -932,7 +932,7 @@ pyrUp8uHorizontalConvolution:
|
||||
for (; x < lim; x += 8)
|
||||
{
|
||||
internal::prefetch(lane + x);
|
||||
#if defined(__GNUC__) && defined(__arm__)
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
|
||||
__asm__ (
|
||||
"vld1.16 {d0-d1}, [%[in0]] /*q0 = v0*/ \n\t"
|
||||
"vld1.16 {d2-d3}, [%[in2]] /*q1 = v2*/ \n\t"
|
||||
@@ -973,7 +973,7 @@ pyrUp8uHorizontalConvolution:
|
||||
for (; x < lim; x += 24)
|
||||
{
|
||||
internal::prefetch(lane + x);
|
||||
#if defined(__GNUC__) && defined(__arm__)
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
|
||||
__asm__ (
|
||||
"vmov.u16 q9, #6 \n\t"
|
||||
"vld3.16 {d0, d2, d4}, [%[in0]] /*v0*/ \n\t"
|
||||
@@ -1064,7 +1064,7 @@ pyrUp8uHorizontalConvolution:
|
||||
for (; x < lim; x += 8)
|
||||
{
|
||||
internal::prefetch(lane + x);
|
||||
#if defined(__GNUC__) && defined(__arm__)
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
|
||||
__asm__ (
|
||||
"vld1.16 {d0-d1}, [%[in0]] /*q0 = v0*/ \n\t"
|
||||
"vld1.16 {d2-d3}, [%[in2]] /*q1 = v2*/ \n\t"
|
||||
@@ -1210,7 +1210,7 @@ pyrUp16sHorizontalConvolution:
|
||||
for (; x < lim; x += 4)
|
||||
{
|
||||
internal::prefetch(lane + x);
|
||||
#if defined(__GNUC__) && defined(__arm__)
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
|
||||
__asm__ (
|
||||
"vld1.32 {d0-d1}, [%[in0]] /*q0 = v0*/ \n\t"
|
||||
"vld1.32 {d2-d3}, [%[in2]] /*q1 = v2*/ \n\t"
|
||||
@@ -1251,7 +1251,7 @@ pyrUp16sHorizontalConvolution:
|
||||
for (; x < lim; x += 12)
|
||||
{
|
||||
internal::prefetch(lane + x + 3);
|
||||
#if defined(__GNUC__) && defined(__arm__)
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
|
||||
__asm__ (
|
||||
"vmov.s32 q9, #6 \n\t"
|
||||
"vld3.32 {d0, d2, d4}, [%[in0]] /*v0*/ \n\t"
|
||||
@@ -1343,7 +1343,7 @@ pyrUp16sHorizontalConvolution:
|
||||
for (; x < lim; x += 4)
|
||||
{
|
||||
internal::prefetch(lane + x);
|
||||
#if defined(__GNUC__) && defined(__arm__)
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
|
||||
__asm__ (
|
||||
"vld1.32 {d0-d1}, [%[in0]] /*q0 = v0*/ \n\t"
|
||||
"vld1.32 {d2-d3}, [%[in2]] /*q1 = v2*/ \n\t"
|
||||
|
||||
Vendored
+14
-13
@@ -106,7 +106,8 @@ bool isResizeLinearOpenCVSupported(const Size2D &ssize, const Size2D &dsize, u32
|
||||
&& !(ssize.width > 0xffffFFFF || ssize.height > 0xffffFFFF)// Restrict image size since internal index evaluation
|
||||
// is performed with u32
|
||||
#endif
|
||||
&& dsize.width >= 2 && dsize.height >= 8)
|
||||
&& dsize.width >= 2 && dsize.height >= 8
|
||||
&& (2*dsize.width != ssize.width || 2*dsize.height != ssize.height)) // 2x downscaling is performed as area in OpenCV which differs from this implementation
|
||||
return isSupportedConfiguration();
|
||||
default:
|
||||
return false;
|
||||
@@ -359,7 +360,7 @@ inline void resizeAreaRounding(const Size2D &ssize, const Size2D &dsize,
|
||||
}
|
||||
else //if ((wr == 4.0f) && (hr == 4.0f)) //the only scale that lasts after isSupported check
|
||||
{
|
||||
#ifndef ANDROID
|
||||
#ifndef __ANDROID__
|
||||
size_t roiw16 = dsize.width >= 15 ? dsize.width - 15 : 0;
|
||||
#endif
|
||||
size_t roiw8 = dsize.width >= 7 ? dsize.width - 7 : 0;
|
||||
@@ -373,7 +374,7 @@ inline void resizeAreaRounding(const Size2D &ssize, const Size2D &dsize,
|
||||
u8 * dst_row = internal::getRowPtr(dstBase, dstStride, i);
|
||||
size_t sj = 0, dj = 0;
|
||||
|
||||
#ifndef ANDROID
|
||||
#ifndef __ANDROID__
|
||||
for ( ; dj < roiw16; dj += 16, sj += 64)
|
||||
{
|
||||
internal::prefetch(src0_row + sj);
|
||||
@@ -450,7 +451,7 @@ inline void resizeAreaRounding(const Size2D &ssize, const Size2D &dsize,
|
||||
{
|
||||
if ((wr == 2.0f) && (hr == 2.0f))
|
||||
{
|
||||
#ifndef ANDROID
|
||||
#ifndef __ANDROID__
|
||||
size_t roiw4 = dsize.width >= 3 ? (dsize.width - 3) << 2 : 0;
|
||||
#endif
|
||||
size_t roiw2 = dsize.width >= 1 ? (dsize.width - 1) << 2 : 0;
|
||||
@@ -462,7 +463,7 @@ inline void resizeAreaRounding(const Size2D &ssize, const Size2D &dsize,
|
||||
u8 * dst_row = internal::getRowPtr(dstBase, dstStride, i);
|
||||
size_t sj = 0, dj = 0;
|
||||
|
||||
#ifndef ANDROID
|
||||
#ifndef __ANDROID__
|
||||
for ( ; dj < roiw4; dj += 16, sj += 32)
|
||||
{
|
||||
internal::prefetch(src0_row + sj);
|
||||
@@ -537,7 +538,7 @@ inline void resizeAreaRounding(const Size2D &ssize, const Size2D &dsize,
|
||||
}
|
||||
else if ((wr == 0.5f) && (hr == 0.5f))
|
||||
{
|
||||
#ifndef ANDROID
|
||||
#ifndef __ANDROID__
|
||||
size_t roiw32 = dsize.width >= 31 ? (dsize.width - 31) << 2 : 0;
|
||||
#endif
|
||||
size_t roiw16 = dsize.width >= 15 ? (dsize.width - 15) << 2 : 0;
|
||||
@@ -549,7 +550,7 @@ inline void resizeAreaRounding(const Size2D &ssize, const Size2D &dsize,
|
||||
u8 * dst1_row = internal::getRowPtr(dstBase, dstStride, std::min(i + 1, dsize.height - 1));
|
||||
size_t sj = 0, dj = 0;
|
||||
|
||||
#ifndef ANDROID
|
||||
#ifndef __ANDROID__
|
||||
for ( ; dj < roiw32; dj += 128, sj += 64)
|
||||
{
|
||||
internal::prefetch(src_row + sj);
|
||||
@@ -758,7 +759,7 @@ inline void resizeAreaRounding(const Size2D &ssize, const Size2D &dsize,
|
||||
{
|
||||
if ((wr == 2.0f) && (wr == 2.0f))
|
||||
{
|
||||
#ifndef ANDROID
|
||||
#ifndef __ANDROID__
|
||||
size_t roiw16 = dsize.width >= 15 ? (dsize.width - 15) * 3 : 0;
|
||||
#endif
|
||||
size_t roiw8 = dsize.width >= 7 ? (dsize.width - 7) * 3 : 0;
|
||||
@@ -770,7 +771,7 @@ inline void resizeAreaRounding(const Size2D &ssize, const Size2D &dsize,
|
||||
u8 * dst_row = internal::getRowPtr(dstBase, dstStride, i);
|
||||
size_t sj = 0, dj = 0;
|
||||
|
||||
#ifndef ANDROID
|
||||
#ifndef __ANDROID__
|
||||
for ( ; dj < roiw16; dj += 48, sj += 96)
|
||||
{
|
||||
internal::prefetch(src0_row + sj);
|
||||
@@ -856,7 +857,7 @@ inline void resizeAreaRounding(const Size2D &ssize, const Size2D &dsize,
|
||||
}
|
||||
else if ((wr == 0.5f) && (hr == 0.5f))
|
||||
{
|
||||
#ifndef ANDROID
|
||||
#ifndef __ANDROID__
|
||||
size_t roiw32 = dsize.width >= 31 ? (dsize.width - 31) * 3 : 0;
|
||||
#endif
|
||||
size_t roiw16 = dsize.width >= 15 ? (dsize.width - 15) * 3 : 0;
|
||||
@@ -868,7 +869,7 @@ inline void resizeAreaRounding(const Size2D &ssize, const Size2D &dsize,
|
||||
u8 * dst1_row = internal::getRowPtr(dstBase, dstStride, std::min(i + 1, dsize.height - 1));
|
||||
size_t sj = 0, dj = 0;
|
||||
|
||||
#ifndef ANDROID
|
||||
#ifndef __ANDROID__
|
||||
for ( ; dj < roiw32; dj += 96, sj += 48)
|
||||
{
|
||||
internal::prefetch(src_row + sj);
|
||||
@@ -928,7 +929,7 @@ inline void resizeAreaRounding(const Size2D &ssize, const Size2D &dsize,
|
||||
}
|
||||
else //if ((hr == 4.0f) && (wr == 4.0f)) //the only scale that lasts after isSupported check
|
||||
{
|
||||
#ifndef ANDROID
|
||||
#ifndef __ANDROID__
|
||||
size_t roiw8 = dsize.width >= 7 ? (dsize.width - 7) * 3 : 0;
|
||||
#endif
|
||||
|
||||
@@ -941,7 +942,7 @@ inline void resizeAreaRounding(const Size2D &ssize, const Size2D &dsize,
|
||||
u8 * dst_row = internal::getRowPtr(dstBase, dstStride, i);
|
||||
size_t sj = 0, dj = 0;
|
||||
|
||||
#ifndef ANDROID
|
||||
#ifndef __ANDROID__
|
||||
for ( ; dj < roiw8; dj += 24, sj += 96)
|
||||
{
|
||||
internal::prefetch(src0_row + sj);
|
||||
|
||||
+2
-2
@@ -72,11 +72,11 @@ __declspec(naked) static void vcvtr_s32_f64_imp(f64 d)
|
||||
|
||||
# if defined(__VFP_FP__) && !defined(__SOFTFP__) && !(defined _DEBUG || defined DEBUG) && !defined(__CUDACC__)
|
||||
# define CAROTENE_ROUND_FLT(value) { \
|
||||
register union { f32 f; s32 i; } result; \
|
||||
union { f32 f; s32 i; } result; \
|
||||
asm ("ftosis %0, %1 \n" : "=w" (result.f) : "w" (value) ); \
|
||||
return result.i; }
|
||||
# define CAROTENE_ROUND_DBL(value) { \
|
||||
register union {f32 f; s32 i;} __tegra_result; \
|
||||
union {f32 f; s32 i;} __tegra_result; \
|
||||
asm ( \
|
||||
"ftosid %0, %P1\n" \
|
||||
: "=w" (__tegra_result.f) \
|
||||
|
||||
Vendored
+3
-3
@@ -109,7 +109,7 @@ void ScharrDeriv(const Size2D &size, s32 cn,
|
||||
internal::prefetch(srow0 + x);
|
||||
internal::prefetch(srow1 + x);
|
||||
internal::prefetch(srow2 + x);
|
||||
#if __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
__asm__ (
|
||||
"vld1.8 {d0}, [%[src0]] \n\t"
|
||||
"vld1.8 {d2}, [%[src2]] \n\t"
|
||||
@@ -161,7 +161,7 @@ void ScharrDeriv(const Size2D &size, s32 cn,
|
||||
x = 0;
|
||||
for( ; x < roiw8; x += 8 )
|
||||
{
|
||||
#if __GNUC_MINOR__ < 6
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
|
||||
__asm__ (
|
||||
"vld1.16 {d4-d5}, [%[s2ptr]] \n\t"
|
||||
"vld1.16 {d8-d9}, [%[s4ptr]] \n\t"
|
||||
@@ -198,7 +198,7 @@ void ScharrDeriv(const Size2D &size, s32 cn,
|
||||
vr.val[1] = vmlaq_s16(s3x10, s24, vc3);
|
||||
|
||||
vst2q_s16(drow + x*2, vr);
|
||||
#endif //__GNUC_MINOR__ < 6
|
||||
#endif
|
||||
}
|
||||
for( ; x < colsn; x++ )
|
||||
{
|
||||
|
||||
Vendored
+35
@@ -0,0 +1,35 @@
|
||||
if(NOT ANDROID)
|
||||
message("cpufeatures is ANDROID project")
|
||||
endif()
|
||||
|
||||
ocv_update(OPENCV_CPUFEATURES_TARGET_NAME libcpufeatures)
|
||||
|
||||
set(CPUFEATURES_ROOT "${CMAKE_CURRENT_SOURCE_DIR}" CACHE PATH "Android cpufeatures project sources (for example, <android-ndk>/sources/android/cpufeatures)")
|
||||
|
||||
set(CPUFEATURES_INCLUDE_DIRS ${CPUFEATURES_ROOT} CACHE INTERNAL "")
|
||||
set(CPUFEATURES_LIBRARIES "${OPENCV_CPUFEATURES_TARGET_NAME}" CACHE INTERNAL "")
|
||||
|
||||
if(NOT DEFINED CPUFEATURES_SOURCES)
|
||||
set(CPUFEATURES_SOURCES ${CPUFEATURES_ROOT}/cpu-features.c ${CPUFEATURES_ROOT}/cpu-features.h)
|
||||
endif()
|
||||
|
||||
include_directories(${CPUFEATURES_INCLUDE_DIRS})
|
||||
add_library(${OPENCV_CPUFEATURES_TARGET_NAME} STATIC ${CPUFEATURES_SOURCES})
|
||||
|
||||
set_target_properties(${OPENCV_CPUFEATURES_TARGET_NAME}
|
||||
PROPERTIES OUTPUT_NAME cpufeatures
|
||||
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
|
||||
COMPILE_PDB_NAME cpufeatures
|
||||
COMPILE_PDB_NAME_DEBUG "cpufeatures${OPENCV_DEBUG_POSTFIX}"
|
||||
ARCHIVE_OUTPUT_DIRECTORY ${3P_LIBRARY_OUTPUT_PATH}
|
||||
)
|
||||
|
||||
if(ENABLE_SOLUTION_FOLDERS)
|
||||
set_target_properties(${OPENCV_CPUFEATURES_TARGET_NAME} PROPERTIES FOLDER "3rdparty")
|
||||
endif()
|
||||
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
ocv_install_target(${OPENCV_CPUFEATURES_TARGET_NAME} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev)
|
||||
endif()
|
||||
|
||||
ocv_install_3rdparty_licenses(cpufeatures LICENSE README.md)
|
||||
Vendored
+13
@@ -0,0 +1,13 @@
|
||||
Copyright (C) 2016 The Android Open Source Project
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
Vendored
+4
@@ -0,0 +1,4 @@
|
||||
The Android NDK provides a small library named cpufeatures that your app can use at runtime to detect the target device's CPU family and the optional features it supports.
|
||||
It is designed to work as-is on all official Android platform versions.
|
||||
|
||||
https://developer.android.com/ndk/guides/cpu-features.html
|
||||
+430
-69
@@ -27,6 +27,10 @@
|
||||
*/
|
||||
|
||||
/* ChangeLog for this library:
|
||||
*
|
||||
* NDK r10e?: Add MIPS MSA feature.
|
||||
*
|
||||
* NDK r10: Support for 64-bit CPUs (Intel, ARM & MIPS).
|
||||
*
|
||||
* NDK r8d: Add android_setCpu().
|
||||
*
|
||||
@@ -56,16 +60,17 @@
|
||||
*
|
||||
* NDK r4: Initial release
|
||||
*/
|
||||
#include <sys/system_properties.h>
|
||||
#ifdef __arm__
|
||||
#include <machine/cpu-features.h>
|
||||
#endif
|
||||
#include <pthread.h>
|
||||
|
||||
#include "cpu-features.h"
|
||||
|
||||
#include <dlfcn.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <pthread.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
#include <sys/system_properties.h>
|
||||
#include <unistd.h>
|
||||
|
||||
static pthread_once_t g_once;
|
||||
static int g_inited;
|
||||
@@ -73,16 +78,12 @@ static AndroidCpuFamily g_cpuFamily;
|
||||
static uint64_t g_cpuFeatures;
|
||||
static int g_cpuCount;
|
||||
|
||||
static const int android_cpufeatures_debug = 0;
|
||||
|
||||
#ifdef __arm__
|
||||
# define DEFAULT_CPU_FAMILY ANDROID_CPU_FAMILY_ARM
|
||||
#elif defined __i386__
|
||||
# define DEFAULT_CPU_FAMILY ANDROID_CPU_FAMILY_X86
|
||||
#else
|
||||
# define DEFAULT_CPU_FAMILY ANDROID_CPU_FAMILY_UNKNOWN
|
||||
static uint32_t g_cpuIdArm;
|
||||
#endif
|
||||
|
||||
static const int android_cpufeatures_debug = 0;
|
||||
|
||||
#define D(...) \
|
||||
do { \
|
||||
if (android_cpufeatures_debug) { \
|
||||
@@ -109,6 +110,25 @@ static __inline__ void x86_cpuid(int func, int values[4])
|
||||
values[2] = c;
|
||||
values[3] = d;
|
||||
}
|
||||
#elif defined(__x86_64__)
|
||||
static __inline__ void x86_cpuid(int func, int values[4])
|
||||
{
|
||||
int64_t a, b, c, d;
|
||||
/* We need to preserve ebx since we're compiling PIC code */
|
||||
/* this means we can't use "=b" for the second output register */
|
||||
__asm__ __volatile__ ( \
|
||||
"push %%rbx\n"
|
||||
"cpuid\n" \
|
||||
"mov %%rbx, %1\n"
|
||||
"pop %%rbx\n"
|
||||
: "=a" (a), "=r" (b), "=c" (c), "=d" (d) \
|
||||
: "a" (func) \
|
||||
);
|
||||
values[0] = a;
|
||||
values[1] = b;
|
||||
values[2] = c;
|
||||
values[3] = d;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Get the size of a file by reading it until the end. This is needed
|
||||
@@ -118,7 +138,8 @@ static __inline__ void x86_cpuid(int func, int values[4])
|
||||
static int
|
||||
get_file_size(const char* pathname)
|
||||
{
|
||||
int fd, ret, result = 0;
|
||||
|
||||
int fd, result = 0;
|
||||
char buffer[256];
|
||||
|
||||
fd = open(pathname, O_RDONLY);
|
||||
@@ -178,6 +199,7 @@ read_file(const char* pathname, char* buffer, size_t buffsize)
|
||||
return count;
|
||||
}
|
||||
|
||||
#ifdef __arm__
|
||||
/* Extract the content of a the first occurence of a given field in
|
||||
* the content of /proc/cpuinfo and return it as a heap-allocated
|
||||
* string that must be freed by the caller.
|
||||
@@ -190,12 +212,11 @@ extract_cpuinfo_field(const char* buffer, int buflen, const char* field)
|
||||
int fieldlen = strlen(field);
|
||||
const char* bufend = buffer + buflen;
|
||||
char* result = NULL;
|
||||
int len, ignore;
|
||||
int len;
|
||||
const char *p, *q;
|
||||
|
||||
/* Look for first field occurence, and ensures it starts the line. */
|
||||
p = buffer;
|
||||
bufend = buffer + buflen;
|
||||
for (;;) {
|
||||
p = memmem(p, bufend-p, field, fieldlen);
|
||||
if (p == NULL)
|
||||
@@ -232,10 +253,6 @@ EXIT:
|
||||
return result;
|
||||
}
|
||||
|
||||
/* Like strlen(), but for constant string literals */
|
||||
#define STRLEN_CONST(x) ((sizeof(x)-1)
|
||||
|
||||
|
||||
/* Checks that a space-separated list of items contains one given 'item'.
|
||||
* Returns 1 if found, 0 otherwise.
|
||||
*/
|
||||
@@ -268,8 +285,9 @@ has_list_item(const char* list, const char* item)
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#endif /* __arm__ */
|
||||
|
||||
/* Parse an decimal integer starting from 'input', but not going further
|
||||
/* Parse a number starting from 'input', but not going further
|
||||
* than 'limit'. Return the value into '*result'.
|
||||
*
|
||||
* NOTE: Does not skip over leading spaces, or deal with sign characters.
|
||||
@@ -280,15 +298,23 @@ has_list_item(const char* list, const char* item)
|
||||
* be <= 'limit').
|
||||
*/
|
||||
static const char*
|
||||
parse_decimal(const char* input, const char* limit, int* result)
|
||||
parse_number(const char* input, const char* limit, int base, int* result)
|
||||
{
|
||||
const char* p = input;
|
||||
int val = 0;
|
||||
while (p < limit) {
|
||||
int d = (*p - '0');
|
||||
if ((unsigned)d >= 10U)
|
||||
break;
|
||||
val = val*10 + d;
|
||||
if ((unsigned)d >= 10U) {
|
||||
d = (*p - 'a');
|
||||
if ((unsigned)d >= 6U)
|
||||
d = (*p - 'A');
|
||||
if ((unsigned)d >= 6U)
|
||||
break;
|
||||
d += 10;
|
||||
}
|
||||
if (d >= base)
|
||||
break;
|
||||
val = val*base + d;
|
||||
p++;
|
||||
}
|
||||
if (p == input)
|
||||
@@ -298,6 +324,20 @@ parse_decimal(const char* input, const char* limit, int* result)
|
||||
return p;
|
||||
}
|
||||
|
||||
static const char*
|
||||
parse_decimal(const char* input, const char* limit, int* result)
|
||||
{
|
||||
return parse_number(input, limit, 10, result);
|
||||
}
|
||||
|
||||
#ifdef __arm__
|
||||
static const char*
|
||||
parse_hexadecimal(const char* input, const char* limit, int* result)
|
||||
{
|
||||
return parse_number(input, limit, 16, result);
|
||||
}
|
||||
#endif /* __arm__ */
|
||||
|
||||
/* This small data type is used to represent a CPU list / mask, as read
|
||||
* from sysfs on Linux. See http://www.kernel.org/doc/Documentation/cputopology.txt
|
||||
*
|
||||
@@ -408,6 +448,18 @@ cpulist_read_from(CpuList* list, const char* filename)
|
||||
|
||||
cpulist_parse(list, file, filelen);
|
||||
}
|
||||
#if defined(__aarch64__)
|
||||
// see <uapi/asm/hwcap.h> kernel header
|
||||
#define HWCAP_FP (1 << 0)
|
||||
#define HWCAP_ASIMD (1 << 1)
|
||||
#define HWCAP_AES (1 << 3)
|
||||
#define HWCAP_PMULL (1 << 4)
|
||||
#define HWCAP_SHA1 (1 << 5)
|
||||
#define HWCAP_SHA2 (1 << 6)
|
||||
#define HWCAP_CRC32 (1 << 7)
|
||||
#endif
|
||||
|
||||
#if defined(__arm__)
|
||||
|
||||
// See <asm/hwcap.h> kernel header.
|
||||
#define HWCAP_VFP (1 << 6)
|
||||
@@ -419,27 +471,104 @@ cpulist_read_from(CpuList* list, const char* filename)
|
||||
#define HWCAP_IDIVA (1 << 17)
|
||||
#define HWCAP_IDIVT (1 << 18)
|
||||
|
||||
// see <uapi/asm/hwcap.h> kernel header
|
||||
#define HWCAP2_AES (1 << 0)
|
||||
#define HWCAP2_PMULL (1 << 1)
|
||||
#define HWCAP2_SHA1 (1 << 2)
|
||||
#define HWCAP2_SHA2 (1 << 3)
|
||||
#define HWCAP2_CRC32 (1 << 4)
|
||||
|
||||
// This is the list of 32-bit ARMv7 optional features that are _always_
|
||||
// supported by ARMv8 CPUs, as mandated by the ARM Architecture Reference
|
||||
// Manual.
|
||||
#define HWCAP_SET_FOR_ARMV8 \
|
||||
( HWCAP_VFP | \
|
||||
HWCAP_NEON | \
|
||||
HWCAP_VFPv3 | \
|
||||
HWCAP_VFPv4 | \
|
||||
HWCAP_IDIVA | \
|
||||
HWCAP_IDIVT )
|
||||
#endif
|
||||
|
||||
#if defined(__mips__)
|
||||
// see <uapi/asm/hwcap.h> kernel header
|
||||
#define HWCAP_MIPS_R6 (1 << 0)
|
||||
#define HWCAP_MIPS_MSA (1 << 1)
|
||||
#endif
|
||||
|
||||
#if defined(__arm__) || defined(__aarch64__) || defined(__mips__)
|
||||
|
||||
#define AT_HWCAP 16
|
||||
#define AT_HWCAP2 26
|
||||
|
||||
// Probe the system's C library for a 'getauxval' function and call it if
|
||||
// it exits, or return 0 for failure. This function is available since API
|
||||
// level 20.
|
||||
//
|
||||
// This code does *NOT* check for '__ANDROID_API__ >= 20' to support the
|
||||
// edge case where some NDK developers use headers for a platform that is
|
||||
// newer than the one really targetted by their application.
|
||||
// This is typically done to use newer native APIs only when running on more
|
||||
// recent Android versions, and requires careful symbol management.
|
||||
//
|
||||
// Note that getauxval() can't really be re-implemented here, because
|
||||
// its implementation does not parse /proc/self/auxv. Instead it depends
|
||||
// on values that are passed by the kernel at process-init time to the
|
||||
// C runtime initialization layer.
|
||||
#if 1
|
||||
// OpenCV calls CPU features check during library initialization stage
|
||||
// (under other dlopen() call).
|
||||
// Unfortunatelly, calling dlopen() recursively is not supported on some old
|
||||
// Android versions. Android fix is here:
|
||||
// - https://android-review.googlesource.com/#/c/32951/
|
||||
// - GitHub mirror: https://github.com/android/platform_bionic/commit/e19d702b8e330cef87e0983733c427b5f7842144
|
||||
__attribute__((weak)) unsigned long getauxval(unsigned long); // Lets linker to handle this symbol
|
||||
static uint32_t
|
||||
get_elf_hwcap_from_getauxval(int hwcap_type) {
|
||||
uint32_t ret = 0;
|
||||
if(getauxval != 0) {
|
||||
ret = (uint32_t)getauxval(hwcap_type);
|
||||
} else {
|
||||
D("getauxval() is not available\n");
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
#else
|
||||
static uint32_t
|
||||
get_elf_hwcap_from_getauxval(int hwcap_type) {
|
||||
typedef unsigned long getauxval_func_t(unsigned long);
|
||||
|
||||
dlerror();
|
||||
void* libc_handle = dlopen("libc.so", RTLD_NOW);
|
||||
if (!libc_handle) {
|
||||
D("Could not dlopen() C library: %s\n", dlerror());
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t ret = 0;
|
||||
getauxval_func_t* func = (getauxval_func_t*)
|
||||
dlsym(libc_handle, "getauxval");
|
||||
if (!func) {
|
||||
D("Could not find getauxval() in C library\n");
|
||||
} else {
|
||||
// Note: getauxval() returns 0 on failure. Doesn't touch errno.
|
||||
ret = (uint32_t)(*func)(hwcap_type);
|
||||
}
|
||||
dlclose(libc_handle);
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(__arm__)
|
||||
/* Compute the ELF HWCAP flags.
|
||||
*/
|
||||
// Parse /proc/self/auxv to extract the ELF HW capabilities bitmap for the
|
||||
// current CPU. Note that this file is not accessible from regular
|
||||
// application processes on some Android platform releases.
|
||||
// On success, return new ELF hwcaps, or 0 on failure.
|
||||
static uint32_t
|
||||
get_elf_hwcap(const char* cpuinfo, int cpuinfo_len)
|
||||
{
|
||||
/* IMPORTANT:
|
||||
* Accessing /proc/self/auxv doesn't work anymore on all
|
||||
* platform versions. More specifically, when running inside
|
||||
* a regular application process, most of /proc/self/ will be
|
||||
* non-readable, including /proc/self/auxv. This doesn't
|
||||
* happen however if the application is debuggable, or when
|
||||
* running under the "shell" UID, which is why this was not
|
||||
* detected appropriately.
|
||||
*/
|
||||
#if 0
|
||||
uint32_t result = 0;
|
||||
get_elf_hwcap_from_proc_self_auxv(void) {
|
||||
const char filepath[] = "/proc/self/auxv";
|
||||
int fd = open(filepath, O_RDONLY);
|
||||
int fd = TEMP_FAILURE_RETRY(open(filepath, O_RDONLY));
|
||||
if (fd < 0) {
|
||||
D("Could not open %s: %s\n", filepath, strerror(errno));
|
||||
return 0;
|
||||
@@ -447,11 +576,10 @@ get_elf_hwcap(const char* cpuinfo, int cpuinfo_len)
|
||||
|
||||
struct { uint32_t tag; uint32_t value; } entry;
|
||||
|
||||
uint32_t result = 0;
|
||||
for (;;) {
|
||||
int ret = read(fd, (char*)&entry, sizeof entry);
|
||||
int ret = TEMP_FAILURE_RETRY(read(fd, (char*)&entry, sizeof entry));
|
||||
if (ret < 0) {
|
||||
if (errno == EINTR)
|
||||
continue;
|
||||
D("Error while reading %s: %s\n", filepath, strerror(errno));
|
||||
break;
|
||||
}
|
||||
@@ -465,12 +593,33 @@ get_elf_hwcap(const char* cpuinfo, int cpuinfo_len)
|
||||
}
|
||||
close(fd);
|
||||
return result;
|
||||
#else
|
||||
// Recreate ELF hwcaps by parsing /proc/cpuinfo Features tag.
|
||||
}
|
||||
|
||||
/* Compute the ELF HWCAP flags from the content of /proc/cpuinfo.
|
||||
* This works by parsing the 'Features' line, which lists which optional
|
||||
* features the device's CPU supports, on top of its reference
|
||||
* architecture.
|
||||
*/
|
||||
static uint32_t
|
||||
get_elf_hwcap_from_proc_cpuinfo(const char* cpuinfo, int cpuinfo_len) {
|
||||
uint32_t hwcaps = 0;
|
||||
long architecture = 0;
|
||||
char* cpuArch = extract_cpuinfo_field(cpuinfo, cpuinfo_len, "CPU architecture");
|
||||
if (cpuArch) {
|
||||
architecture = strtol(cpuArch, NULL, 10);
|
||||
free(cpuArch);
|
||||
|
||||
if (architecture >= 8L) {
|
||||
// This is a 32-bit ARM binary running on a 64-bit ARM64 kernel.
|
||||
// The 'Features' line only lists the optional features that the
|
||||
// device's CPU supports, compared to its reference architecture
|
||||
// which are of no use for this process.
|
||||
D("Faking 32-bit ARM HWCaps on ARMv%ld CPU\n", architecture);
|
||||
return HWCAP_SET_FOR_ARMV8;
|
||||
}
|
||||
}
|
||||
|
||||
char* cpuFeatures = extract_cpuinfo_field(cpuinfo, cpuinfo_len, "Features");
|
||||
|
||||
if (cpuFeatures != NULL) {
|
||||
D("Found cpuFeatures = '%s'\n", cpuFeatures);
|
||||
|
||||
@@ -496,7 +645,6 @@ get_elf_hwcap(const char* cpuinfo, int cpuinfo_len)
|
||||
free(cpuFeatures);
|
||||
}
|
||||
return hwcaps;
|
||||
#endif
|
||||
}
|
||||
#endif /* __arm__ */
|
||||
|
||||
@@ -526,12 +674,19 @@ get_cpu_count(void)
|
||||
static void
|
||||
android_cpuInitFamily(void)
|
||||
{
|
||||
#if defined(__ARM_ARCH__)
|
||||
#if defined(__arm__)
|
||||
g_cpuFamily = ANDROID_CPU_FAMILY_ARM;
|
||||
#elif defined(__i386__)
|
||||
g_cpuFamily = ANDROID_CPU_FAMILY_X86;
|
||||
#elif defined(_MIPS_ARCH)
|
||||
#elif defined(__mips64)
|
||||
/* Needs to be before __mips__ since the compiler defines both */
|
||||
g_cpuFamily = ANDROID_CPU_FAMILY_MIPS64;
|
||||
#elif defined(__mips__)
|
||||
g_cpuFamily = ANDROID_CPU_FAMILY_MIPS;
|
||||
#elif defined(__aarch64__)
|
||||
g_cpuFamily = ANDROID_CPU_FAMILY_ARM64;
|
||||
#elif defined(__x86_64__)
|
||||
g_cpuFamily = ANDROID_CPU_FAMILY_X86_64;
|
||||
#else
|
||||
g_cpuFamily = ANDROID_CPU_FAMILY_UNKNOWN;
|
||||
#endif
|
||||
@@ -576,11 +731,8 @@ android_cpuInit(void)
|
||||
|
||||
D("found cpuCount = %d\n", g_cpuCount);
|
||||
|
||||
#ifdef __ARM_ARCH__
|
||||
#ifdef __arm__
|
||||
{
|
||||
char* features = NULL;
|
||||
char* architecture = NULL;
|
||||
|
||||
/* Extract architecture from the "CPU Architecture" field.
|
||||
* The list is well-known, unlike the the output of
|
||||
* the 'Processor' field which can vary greatly.
|
||||
@@ -601,10 +753,7 @@ android_cpuInit(void)
|
||||
/* read the initial decimal number, ignore the rest */
|
||||
archNumber = strtol(cpuArch, &end, 10);
|
||||
|
||||
/* Here we assume that ARMv8 will be upwards compatible with v7
|
||||
* in the future. Unfortunately, there is no 'Features' field to
|
||||
* indicate that Thumb-2 is supported.
|
||||
*/
|
||||
/* Note that ARMv8 is upwards compatible with ARMv7. */
|
||||
if (end > cpuArch && archNumber >= 7) {
|
||||
hasARMv7 = 1;
|
||||
}
|
||||
@@ -645,7 +794,19 @@ android_cpuInit(void)
|
||||
}
|
||||
|
||||
/* Extract the list of CPU features from ELF hwcaps */
|
||||
uint32_t hwcaps = get_elf_hwcap(cpuinfo, cpuinfo_len);
|
||||
uint32_t hwcaps = 0;
|
||||
hwcaps = get_elf_hwcap_from_getauxval(AT_HWCAP);
|
||||
if (!hwcaps) {
|
||||
D("Parsing /proc/self/auxv to extract ELF hwcaps!\n");
|
||||
hwcaps = get_elf_hwcap_from_proc_self_auxv();
|
||||
}
|
||||
if (!hwcaps) {
|
||||
// Parsing /proc/self/auxv will fail from regular application
|
||||
// processes on some Android platform versions, when this happens
|
||||
// parse proc/cpuinfo instead.
|
||||
D("Parsing /proc/cpuinfo to extract ELF hwcaps!\n");
|
||||
hwcaps = get_elf_hwcap_from_proc_cpuinfo(cpuinfo, cpuinfo_len);
|
||||
}
|
||||
|
||||
if (hwcaps != 0) {
|
||||
int has_vfp = (hwcaps & HWCAP_VFP);
|
||||
@@ -697,22 +858,163 @@ android_cpuInit(void)
|
||||
g_cpuFeatures |= ANDROID_CPU_ARM_FEATURE_VFPv2 |
|
||||
ANDROID_CPU_ARM_FEATURE_ARMv7;
|
||||
|
||||
// Note that some buggy kernels do not report these even when
|
||||
// the CPU actually support the division instructions. However,
|
||||
// assume that if 'vfpv4' is detected, then the CPU supports
|
||||
// sdiv/udiv properly.
|
||||
if (has_idiva || has_vfpv4)
|
||||
if (has_idiva)
|
||||
g_cpuFeatures |= ANDROID_CPU_ARM_FEATURE_IDIV_ARM;
|
||||
if (has_idivt || has_vfpv4)
|
||||
if (has_idivt)
|
||||
g_cpuFeatures |= ANDROID_CPU_ARM_FEATURE_IDIV_THUMB2;
|
||||
|
||||
if (has_iwmmxt)
|
||||
g_cpuFeatures |= ANDROID_CPU_ARM_FEATURE_iWMMXt;
|
||||
}
|
||||
}
|
||||
#endif /* __ARM_ARCH__ */
|
||||
|
||||
#ifdef __i386__
|
||||
/* Extract the list of CPU features from ELF hwcaps2 */
|
||||
uint32_t hwcaps2 = 0;
|
||||
hwcaps2 = get_elf_hwcap_from_getauxval(AT_HWCAP2);
|
||||
if (hwcaps2 != 0) {
|
||||
int has_aes = (hwcaps2 & HWCAP2_AES);
|
||||
int has_pmull = (hwcaps2 & HWCAP2_PMULL);
|
||||
int has_sha1 = (hwcaps2 & HWCAP2_SHA1);
|
||||
int has_sha2 = (hwcaps2 & HWCAP2_SHA2);
|
||||
int has_crc32 = (hwcaps2 & HWCAP2_CRC32);
|
||||
|
||||
if (has_aes)
|
||||
g_cpuFeatures |= ANDROID_CPU_ARM_FEATURE_AES;
|
||||
if (has_pmull)
|
||||
g_cpuFeatures |= ANDROID_CPU_ARM_FEATURE_PMULL;
|
||||
if (has_sha1)
|
||||
g_cpuFeatures |= ANDROID_CPU_ARM_FEATURE_SHA1;
|
||||
if (has_sha2)
|
||||
g_cpuFeatures |= ANDROID_CPU_ARM_FEATURE_SHA2;
|
||||
if (has_crc32)
|
||||
g_cpuFeatures |= ANDROID_CPU_ARM_FEATURE_CRC32;
|
||||
}
|
||||
/* Extract the cpuid value from various fields */
|
||||
// The CPUID value is broken up in several entries in /proc/cpuinfo.
|
||||
// This table is used to rebuild it from the entries.
|
||||
static const struct CpuIdEntry {
|
||||
const char* field;
|
||||
char format;
|
||||
char bit_lshift;
|
||||
char bit_length;
|
||||
} cpu_id_entries[] = {
|
||||
{ "CPU implementer", 'x', 24, 8 },
|
||||
{ "CPU variant", 'x', 20, 4 },
|
||||
{ "CPU part", 'x', 4, 12 },
|
||||
{ "CPU revision", 'd', 0, 4 },
|
||||
};
|
||||
size_t i;
|
||||
D("Parsing /proc/cpuinfo to recover CPUID\n");
|
||||
for (i = 0;
|
||||
i < sizeof(cpu_id_entries)/sizeof(cpu_id_entries[0]);
|
||||
++i) {
|
||||
const struct CpuIdEntry* entry = &cpu_id_entries[i];
|
||||
char* value = extract_cpuinfo_field(cpuinfo,
|
||||
cpuinfo_len,
|
||||
entry->field);
|
||||
if (value == NULL)
|
||||
continue;
|
||||
|
||||
D("field=%s value='%s'\n", entry->field, value);
|
||||
char* value_end = value + strlen(value);
|
||||
int val = 0;
|
||||
const char* start = value;
|
||||
const char* p;
|
||||
if (value[0] == '0' && (value[1] == 'x' || value[1] == 'X')) {
|
||||
start += 2;
|
||||
p = parse_hexadecimal(start, value_end, &val);
|
||||
} else if (entry->format == 'x')
|
||||
p = parse_hexadecimal(value, value_end, &val);
|
||||
else
|
||||
p = parse_decimal(value, value_end, &val);
|
||||
|
||||
if (p > (const char*)start) {
|
||||
val &= ((1 << entry->bit_length)-1);
|
||||
val <<= entry->bit_lshift;
|
||||
g_cpuIdArm |= (uint32_t) val;
|
||||
}
|
||||
|
||||
free(value);
|
||||
}
|
||||
|
||||
// Handle kernel configuration bugs that prevent the correct
|
||||
// reporting of CPU features.
|
||||
static const struct CpuFix {
|
||||
uint32_t cpuid;
|
||||
uint64_t or_flags;
|
||||
} cpu_fixes[] = {
|
||||
/* The Nexus 4 (Qualcomm Krait) kernel configuration
|
||||
* forgets to report IDIV support. */
|
||||
{ 0x510006f2, ANDROID_CPU_ARM_FEATURE_IDIV_ARM |
|
||||
ANDROID_CPU_ARM_FEATURE_IDIV_THUMB2 },
|
||||
{ 0x510006f3, ANDROID_CPU_ARM_FEATURE_IDIV_ARM |
|
||||
ANDROID_CPU_ARM_FEATURE_IDIV_THUMB2 },
|
||||
};
|
||||
size_t n;
|
||||
for (n = 0; n < sizeof(cpu_fixes)/sizeof(cpu_fixes[0]); ++n) {
|
||||
const struct CpuFix* entry = &cpu_fixes[n];
|
||||
|
||||
if (g_cpuIdArm == entry->cpuid)
|
||||
g_cpuFeatures |= entry->or_flags;
|
||||
}
|
||||
|
||||
// Special case: The emulator-specific Android 4.2 kernel fails
|
||||
// to report support for the 32-bit ARM IDIV instruction.
|
||||
// Technically, this is a feature of the virtual CPU implemented
|
||||
// by the emulator. Note that it could also support Thumb IDIV
|
||||
// in the future, and this will have to be slightly updated.
|
||||
char* hardware = extract_cpuinfo_field(cpuinfo,
|
||||
cpuinfo_len,
|
||||
"Hardware");
|
||||
if (hardware) {
|
||||
if (!strcmp(hardware, "Goldfish") &&
|
||||
g_cpuIdArm == 0x4100c080 &&
|
||||
(g_cpuFamily & ANDROID_CPU_ARM_FEATURE_ARMv7) != 0) {
|
||||
g_cpuFeatures |= ANDROID_CPU_ARM_FEATURE_IDIV_ARM;
|
||||
}
|
||||
free(hardware);
|
||||
}
|
||||
}
|
||||
#endif /* __arm__ */
|
||||
#ifdef __aarch64__
|
||||
{
|
||||
/* Extract the list of CPU features from ELF hwcaps */
|
||||
uint32_t hwcaps = 0;
|
||||
hwcaps = get_elf_hwcap_from_getauxval(AT_HWCAP);
|
||||
if (hwcaps != 0) {
|
||||
int has_fp = (hwcaps & HWCAP_FP);
|
||||
int has_asimd = (hwcaps & HWCAP_ASIMD);
|
||||
int has_aes = (hwcaps & HWCAP_AES);
|
||||
int has_pmull = (hwcaps & HWCAP_PMULL);
|
||||
int has_sha1 = (hwcaps & HWCAP_SHA1);
|
||||
int has_sha2 = (hwcaps & HWCAP_SHA2);
|
||||
int has_crc32 = (hwcaps & HWCAP_CRC32);
|
||||
|
||||
if(has_fp == 0) {
|
||||
D("ERROR: Floating-point unit missing, but is required by Android on AArch64 CPUs\n");
|
||||
}
|
||||
if(has_asimd == 0) {
|
||||
D("ERROR: ASIMD unit missing, but is required by Android on AArch64 CPUs\n");
|
||||
}
|
||||
|
||||
if (has_fp)
|
||||
g_cpuFeatures |= ANDROID_CPU_ARM64_FEATURE_FP;
|
||||
if (has_asimd)
|
||||
g_cpuFeatures |= ANDROID_CPU_ARM64_FEATURE_ASIMD;
|
||||
if (has_aes)
|
||||
g_cpuFeatures |= ANDROID_CPU_ARM64_FEATURE_AES;
|
||||
if (has_pmull)
|
||||
g_cpuFeatures |= ANDROID_CPU_ARM64_FEATURE_PMULL;
|
||||
if (has_sha1)
|
||||
g_cpuFeatures |= ANDROID_CPU_ARM64_FEATURE_SHA1;
|
||||
if (has_sha2)
|
||||
g_cpuFeatures |= ANDROID_CPU_ARM64_FEATURE_SHA2;
|
||||
if (has_crc32)
|
||||
g_cpuFeatures |= ANDROID_CPU_ARM64_FEATURE_CRC32;
|
||||
}
|
||||
}
|
||||
#endif /* __aarch64__ */
|
||||
|
||||
#if defined(__i386__) || defined(__x86_64__)
|
||||
int regs[4];
|
||||
|
||||
/* According to http://en.wikipedia.org/wiki/CPUID */
|
||||
@@ -732,10 +1034,50 @@ android_cpuInit(void)
|
||||
if ((regs[2] & (1 << 23)) != 0) {
|
||||
g_cpuFeatures |= ANDROID_CPU_X86_FEATURE_POPCNT;
|
||||
}
|
||||
if ((regs[2] & (1 << 19)) != 0) {
|
||||
g_cpuFeatures |= ANDROID_CPU_X86_FEATURE_SSE4_1;
|
||||
}
|
||||
if ((regs[2] & (1 << 20)) != 0) {
|
||||
g_cpuFeatures |= ANDROID_CPU_X86_FEATURE_SSE4_2;
|
||||
}
|
||||
if (vendorIsIntel && (regs[2] & (1 << 22)) != 0) {
|
||||
g_cpuFeatures |= ANDROID_CPU_X86_FEATURE_MOVBE;
|
||||
}
|
||||
if ((regs[2] & (1 << 25)) != 0) {
|
||||
g_cpuFeatures |= ANDROID_CPU_X86_FEATURE_AES_NI;
|
||||
}
|
||||
if ((regs[2] & (1 << 28)) != 0) {
|
||||
g_cpuFeatures |= ANDROID_CPU_X86_FEATURE_AVX;
|
||||
}
|
||||
if ((regs[2] & (1 << 30)) != 0) {
|
||||
g_cpuFeatures |= ANDROID_CPU_X86_FEATURE_RDRAND;
|
||||
}
|
||||
|
||||
x86_cpuid(7, regs);
|
||||
if ((regs[1] & (1 << 5)) != 0) {
|
||||
g_cpuFeatures |= ANDROID_CPU_X86_FEATURE_AVX2;
|
||||
}
|
||||
if ((regs[1] & (1 << 29)) != 0) {
|
||||
g_cpuFeatures |= ANDROID_CPU_X86_FEATURE_SHA_NI;
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
#if defined( __mips__)
|
||||
{ /* MIPS and MIPS64 */
|
||||
/* Extract the list of CPU features from ELF hwcaps */
|
||||
uint32_t hwcaps = 0;
|
||||
hwcaps = get_elf_hwcap_from_getauxval(AT_HWCAP);
|
||||
if (hwcaps != 0) {
|
||||
int has_r6 = (hwcaps & HWCAP_MIPS_R6);
|
||||
int has_msa = (hwcaps & HWCAP_MIPS_MSA);
|
||||
if (has_r6)
|
||||
g_cpuFeatures |= ANDROID_CPU_MIPS_FEATURE_R6;
|
||||
if (has_msa)
|
||||
g_cpuFeatures |= ANDROID_CPU_MIPS_FEATURE_MSA;
|
||||
}
|
||||
}
|
||||
#endif /* __mips__ */
|
||||
|
||||
free(cpuinfo);
|
||||
}
|
||||
@@ -785,6 +1127,25 @@ android_setCpu(int cpu_count, uint64_t cpu_features)
|
||||
return 1;
|
||||
}
|
||||
|
||||
#ifdef __arm__
|
||||
uint32_t
|
||||
android_getCpuIdArm(void)
|
||||
{
|
||||
pthread_once(&g_once, android_cpuInit);
|
||||
return g_cpuIdArm;
|
||||
}
|
||||
|
||||
int
|
||||
android_setCpuArm(int cpu_count, uint64_t cpu_features, uint32_t cpu_id)
|
||||
{
|
||||
if (!android_setCpu(cpu_count, cpu_features))
|
||||
return 0;
|
||||
|
||||
g_cpuIdArm = cpu_id;
|
||||
return 1;
|
||||
}
|
||||
#endif /* __arm__ */
|
||||
|
||||
/*
|
||||
* Technical note: Making sense of ARM's FPU architecture versions.
|
||||
*
|
||||
+134
-6
@@ -33,21 +33,40 @@
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* A list of valid values returned by android_getCpuFamily().
|
||||
* They describe the CPU Architecture of the current process.
|
||||
*/
|
||||
typedef enum {
|
||||
ANDROID_CPU_FAMILY_UNKNOWN = 0,
|
||||
ANDROID_CPU_FAMILY_ARM,
|
||||
ANDROID_CPU_FAMILY_X86,
|
||||
ANDROID_CPU_FAMILY_MIPS,
|
||||
ANDROID_CPU_FAMILY_ARM64,
|
||||
ANDROID_CPU_FAMILY_X86_64,
|
||||
ANDROID_CPU_FAMILY_MIPS64,
|
||||
|
||||
ANDROID_CPU_FAMILY_MAX /* do not remove */
|
||||
|
||||
} AndroidCpuFamily;
|
||||
|
||||
/* Return family of the device's CPU */
|
||||
extern AndroidCpuFamily android_getCpuFamily(void);
|
||||
/* Return the CPU family of the current process.
|
||||
*
|
||||
* Note that this matches the bitness of the current process. I.e. when
|
||||
* running a 32-bit binary on a 64-bit capable CPU, this will return the
|
||||
* 32-bit CPU family value.
|
||||
*/
|
||||
extern AndroidCpuFamily android_getCpuFamily(void);
|
||||
|
||||
/* The list of feature flags for ARM CPUs that can be recognized by the
|
||||
* library. Value details are:
|
||||
/* Return a bitmap describing a set of optional CPU features that are
|
||||
* supported by the current device's CPU. The exact bit-flags returned
|
||||
* depend on the value returned by android_getCpuFamily(). See the
|
||||
* documentation for the ANDROID_CPU_*_FEATURE_* flags below for details.
|
||||
*/
|
||||
extern uint64_t android_getCpuFeatures(void);
|
||||
|
||||
/* The list of feature flags for ANDROID_CPU_FAMILY_ARM that can be
|
||||
* recognized by the library (see note below for 64-bit ARM). Value details
|
||||
* are:
|
||||
*
|
||||
* VFPv2:
|
||||
* CPU supports the VFPv2 instruction set. Many, but not all, ARMv6 CPUs
|
||||
@@ -103,6 +122,27 @@ extern AndroidCpuFamily android_getCpuFamily(void);
|
||||
* ARM CPU. This is only available on a few XScale-based CPU designs
|
||||
* sold by Marvell. Pretty rare in practice.
|
||||
*
|
||||
* AES:
|
||||
* CPU supports AES instructions. These instructions are only
|
||||
* available for 32-bit applications running on ARMv8 CPU.
|
||||
*
|
||||
* CRC32:
|
||||
* CPU supports CRC32 instructions. These instructions are only
|
||||
* available for 32-bit applications running on ARMv8 CPU.
|
||||
*
|
||||
* SHA2:
|
||||
* CPU supports SHA2 instructions. These instructions are only
|
||||
* available for 32-bit applications running on ARMv8 CPU.
|
||||
*
|
||||
* SHA1:
|
||||
* CPU supports SHA1 instructions. These instructions are only
|
||||
* available for 32-bit applications running on ARMv8 CPU.
|
||||
*
|
||||
* PMULL:
|
||||
* CPU supports 64-bit PMULL and PMULL2 instructions. These
|
||||
* instructions are only available for 32-bit applications
|
||||
* running on ARMv8 CPU.
|
||||
*
|
||||
* If you want to tell the compiler to generate code that targets one of
|
||||
* the feature set above, you should probably use one of the following
|
||||
* flags (for more details, see technical note at the end of this file):
|
||||
@@ -150,6 +190,13 @@ extern AndroidCpuFamily android_getCpuFamily(void);
|
||||
*
|
||||
* -mcpu=iwmmxt
|
||||
* Allows the use of iWMMXt instrinsics with GCC.
|
||||
*
|
||||
* IMPORTANT NOTE: These flags should only be tested when
|
||||
* android_getCpuFamily() returns ANDROID_CPU_FAMILY_ARM, i.e. this is a
|
||||
* 32-bit process.
|
||||
*
|
||||
* When running a 64-bit ARM process on an ARMv8 CPU,
|
||||
* android_getCpuFeatures() will return a different set of bitflags
|
||||
*/
|
||||
enum {
|
||||
ANDROID_CPU_ARM_FEATURE_ARMv7 = (1 << 0),
|
||||
@@ -164,18 +211,84 @@ enum {
|
||||
ANDROID_CPU_ARM_FEATURE_IDIV_ARM = (1 << 9),
|
||||
ANDROID_CPU_ARM_FEATURE_IDIV_THUMB2 = (1 << 10),
|
||||
ANDROID_CPU_ARM_FEATURE_iWMMXt = (1 << 11),
|
||||
ANDROID_CPU_ARM_FEATURE_AES = (1 << 12),
|
||||
ANDROID_CPU_ARM_FEATURE_PMULL = (1 << 13),
|
||||
ANDROID_CPU_ARM_FEATURE_SHA1 = (1 << 14),
|
||||
ANDROID_CPU_ARM_FEATURE_SHA2 = (1 << 15),
|
||||
ANDROID_CPU_ARM_FEATURE_CRC32 = (1 << 16),
|
||||
};
|
||||
|
||||
/* The bit flags corresponding to the output of android_getCpuFeatures()
|
||||
* when android_getCpuFamily() returns ANDROID_CPU_FAMILY_ARM64. Value details
|
||||
* are:
|
||||
*
|
||||
* FP:
|
||||
* CPU has Floating-point unit.
|
||||
*
|
||||
* ASIMD:
|
||||
* CPU has Advanced SIMD unit.
|
||||
*
|
||||
* AES:
|
||||
* CPU supports AES instructions.
|
||||
*
|
||||
* CRC32:
|
||||
* CPU supports CRC32 instructions.
|
||||
*
|
||||
* SHA2:
|
||||
* CPU supports SHA2 instructions.
|
||||
*
|
||||
* SHA1:
|
||||
* CPU supports SHA1 instructions.
|
||||
*
|
||||
* PMULL:
|
||||
* CPU supports 64-bit PMULL and PMULL2 instructions.
|
||||
*/
|
||||
enum {
|
||||
ANDROID_CPU_ARM64_FEATURE_FP = (1 << 0),
|
||||
ANDROID_CPU_ARM64_FEATURE_ASIMD = (1 << 1),
|
||||
ANDROID_CPU_ARM64_FEATURE_AES = (1 << 2),
|
||||
ANDROID_CPU_ARM64_FEATURE_PMULL = (1 << 3),
|
||||
ANDROID_CPU_ARM64_FEATURE_SHA1 = (1 << 4),
|
||||
ANDROID_CPU_ARM64_FEATURE_SHA2 = (1 << 5),
|
||||
ANDROID_CPU_ARM64_FEATURE_CRC32 = (1 << 6),
|
||||
};
|
||||
|
||||
/* The bit flags corresponding to the output of android_getCpuFeatures()
|
||||
* when android_getCpuFamily() returns ANDROID_CPU_FAMILY_X86 or
|
||||
* ANDROID_CPU_FAMILY_X86_64.
|
||||
*/
|
||||
enum {
|
||||
ANDROID_CPU_X86_FEATURE_SSSE3 = (1 << 0),
|
||||
ANDROID_CPU_X86_FEATURE_POPCNT = (1 << 1),
|
||||
ANDROID_CPU_X86_FEATURE_MOVBE = (1 << 2),
|
||||
ANDROID_CPU_X86_FEATURE_SSE4_1 = (1 << 3),
|
||||
ANDROID_CPU_X86_FEATURE_SSE4_2 = (1 << 4),
|
||||
ANDROID_CPU_X86_FEATURE_AES_NI = (1 << 5),
|
||||
ANDROID_CPU_X86_FEATURE_AVX = (1 << 6),
|
||||
ANDROID_CPU_X86_FEATURE_RDRAND = (1 << 7),
|
||||
ANDROID_CPU_X86_FEATURE_AVX2 = (1 << 8),
|
||||
ANDROID_CPU_X86_FEATURE_SHA_NI = (1 << 9),
|
||||
};
|
||||
|
||||
/* The bit flags corresponding to the output of android_getCpuFeatures()
|
||||
* when android_getCpuFamily() returns ANDROID_CPU_FAMILY_MIPS
|
||||
* or ANDROID_CPU_FAMILY_MIPS64. Values are:
|
||||
*
|
||||
* R6:
|
||||
* CPU executes MIPS Release 6 instructions natively, and
|
||||
* supports obsoleted R1..R5 instructions only via kernel traps.
|
||||
*
|
||||
* MSA:
|
||||
* CPU supports Mips SIMD Architecture instructions.
|
||||
*/
|
||||
enum {
|
||||
ANDROID_CPU_MIPS_FEATURE_R6 = (1 << 0),
|
||||
ANDROID_CPU_MIPS_FEATURE_MSA = (1 << 1),
|
||||
};
|
||||
|
||||
extern uint64_t android_getCpuFeatures(void);
|
||||
|
||||
/* Return the number of CPU cores detected on this device. */
|
||||
extern int android_getCpuCount(void);
|
||||
extern int android_getCpuCount(void);
|
||||
|
||||
/* The following is used to force the CPU count and features
|
||||
* mask in sandboxed processes. Under 4.1 and higher, these processes
|
||||
@@ -190,6 +303,21 @@ extern int android_getCpuCount(void);
|
||||
extern int android_setCpu(int cpu_count,
|
||||
uint64_t cpu_features);
|
||||
|
||||
#ifdef __arm__
|
||||
/* Retrieve the ARM 32-bit CPUID value from the kernel.
|
||||
* Note that this cannot work on sandboxed processes under 4.1 and
|
||||
* higher, unless you called android_setCpuArm() before.
|
||||
*/
|
||||
extern uint32_t android_getCpuIdArm(void);
|
||||
|
||||
/* An ARM-specific variant of android_setCpu() that also allows you
|
||||
* to set the ARM CPUID field.
|
||||
*/
|
||||
extern int android_setCpuArm(int cpu_count,
|
||||
uint64_t cpu_features,
|
||||
uint32_t cpu_id);
|
||||
#endif
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* CPU_FEATURES_H */
|
||||
+63
@@ -0,0 +1,63 @@
|
||||
$url = "https://raw.githubusercontent.com/opencv/opencv_3rdparty/@FFMPEG_BINARIES_COMMIT@/ffmpeg/opencv_ffmpeg_64.dll"
|
||||
$expected_md5 = "@FFMPEG_FILE_HASH_BIN64@"
|
||||
$output = "$PSScriptRoot\@OPENCV_BIN_INSTALL_PATH@\opencv_ffmpeg@OPENCV_DLLVERSION@_64.dll"
|
||||
|
||||
Write-Output ("=" * 120)
|
||||
try {
|
||||
Get-content -Path "$PSScriptRoot\@OPENCV_LICENSES_INSTALL_PATH@\ffmpeg-readme.txt" -ErrorAction 'Stop'
|
||||
} catch {
|
||||
Write-Output "Refer to OpenCV FFmpeg wrapper readme notes about library usage / licensing details."
|
||||
}
|
||||
Write-Output ("=" * 120)
|
||||
Write-Output ""
|
||||
|
||||
if(![System.IO.File]::Exists($output)) {
|
||||
try {
|
||||
Write-Output ("Downloading: " + $output)
|
||||
Import-Module BitsTransfer
|
||||
$start_time = Get-Date
|
||||
Start-BitsTransfer -Source $url -Destination $output -ErrorAction 'Stop'
|
||||
Write-Output "Downloaded in $((Get-Date).Subtract($start_time).Seconds) seconds"
|
||||
} catch {
|
||||
$_ # Dump error
|
||||
try {
|
||||
Write-Output ("Downloading (second attempt): " + $output)
|
||||
$start_time = Get-Date
|
||||
Invoke-WebRequest -Uri $url -OutFile $output
|
||||
Write-Output "Downloaded in $((Get-Date).Subtract($start_time).Seconds) seconds"
|
||||
} catch {
|
||||
Write-Output ("Can't download file: " + $output)
|
||||
Write-Output ("URL: " + $url)
|
||||
Write-Output "You need to download this file manually. Stop"
|
||||
Pause
|
||||
Exit
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Write-Output ("File exists: " + $output)
|
||||
Write-Output ("Downloading is skipped. Remove this file and re-run this script to force downloading.")
|
||||
}
|
||||
|
||||
if(![System.IO.File]::Exists($output)) {
|
||||
Write-Output ("Destination file not found: " + $output)
|
||||
Write-Output "Stop"
|
||||
Pause
|
||||
Exit
|
||||
}
|
||||
|
||||
try {
|
||||
$hash = Get-FileHash $output -Algorithm MD5 -ErrorAction 'Stop'
|
||||
|
||||
if($hash.Hash -eq $expected_md5) {
|
||||
Write-Output "MD5 check passed"
|
||||
} else {
|
||||
Write-Output ("MD5 : " + $hash.Hash.toLower())
|
||||
Write-Output ("Expected: " + $expected_md5)
|
||||
Write-Output "MD5 hash mismatch"
|
||||
}
|
||||
} catch {
|
||||
$_ # Dump error
|
||||
Write-Output "Can't check MD5 hash (requires PowerShell 4+)"
|
||||
}
|
||||
Pause
|
||||
Write-Output "Exit"
|
||||
Vendored
+39
-20
@@ -1,25 +1,44 @@
|
||||
# Binary branch name: ffmpeg/master_20161202
|
||||
# Binaries were created for OpenCV: 594c136d1fcbb5816c57516e50f9cbeffbd90835
|
||||
set(FFMPEG_BINARIES_COMMIT "2a19d0006415955c79431116e4634f04d5eb5a74")
|
||||
set(FFMPEG_FILE_HASH_BIN32 "f081abd9d6ca7e425d340ce586f9c090")
|
||||
set(FFMPEG_FILE_HASH_BIN64 "a423363a6eb76d362ca6c406c96c8db6")
|
||||
set(FFMPEG_FILE_HASH_CMAKE "5346ae1854fc7aa569a722e85af480ec")
|
||||
# Binaries branch name: ffmpeg/3.4_20181103
|
||||
# Binaries were created for OpenCV: c6d2f0399a706028f476f3d08358ea787503020d
|
||||
ocv_update(FFMPEG_BINARIES_COMMIT "fe71c0ad807fdc33c2178e48e488f1e9b177c39a")
|
||||
ocv_update(FFMPEG_FILE_HASH_BIN32 "41b81bb9a50cabd4bea385f7b50a069a")
|
||||
ocv_update(FFMPEG_FILE_HASH_BIN64 "a9ea7dbbc8e5afd08e00e223a831b578")
|
||||
ocv_update(FFMPEG_FILE_HASH_CMAKE "3b90f67f4b429e77d3da36698cef700c")
|
||||
|
||||
set(FFMPEG_DOWNLOAD_URL ${OPENCV_FFMPEG_URL};$ENV{OPENCV_FFMPEG_URL};https://raw.githubusercontent.com/opencv/opencv_3rdparty/${FFMPEG_BINARIES_COMMIT}/ffmpeg/)
|
||||
function(download_win_ffmpeg script_var)
|
||||
set(${script_var} "" PARENT_SCOPE)
|
||||
|
||||
ocv_download(PACKAGE opencv_ffmpeg.dll
|
||||
HASH ${FFMPEG_FILE_HASH_BIN32}
|
||||
URL ${FFMPEG_DOWNLOAD_URL}
|
||||
DESTINATION_DIR ${CMAKE_CURRENT_LIST_DIR})
|
||||
set(ids BIN32 BIN64 CMAKE)
|
||||
set(name_BIN32 "opencv_ffmpeg.dll")
|
||||
set(name_BIN64 "opencv_ffmpeg_64.dll")
|
||||
set(name_CMAKE "ffmpeg_version.cmake")
|
||||
|
||||
ocv_download(PACKAGE opencv_ffmpeg_64.dll
|
||||
HASH ${FFMPEG_FILE_HASH_BIN64}
|
||||
URL ${FFMPEG_DOWNLOAD_URL}
|
||||
DESTINATION_DIR ${CMAKE_CURRENT_LIST_DIR})
|
||||
set(FFMPEG_DOWNLOAD_DIR "${OpenCV_BINARY_DIR}/3rdparty/ffmpeg")
|
||||
|
||||
ocv_download(PACKAGE ffmpeg_version.cmake
|
||||
HASH ${FFMPEG_FILE_HASH_CMAKE}
|
||||
URL ${FFMPEG_DOWNLOAD_URL}
|
||||
DESTINATION_DIR ${CMAKE_CURRENT_LIST_DIR})
|
||||
set(status TRUE)
|
||||
foreach(id ${ids})
|
||||
ocv_download(FILENAME ${name_${id}}
|
||||
HASH ${FFMPEG_FILE_HASH_${id}}
|
||||
URL
|
||||
"$ENV{OPENCV_FFMPEG_URL}"
|
||||
"${OPENCV_FFMPEG_URL}"
|
||||
"https://raw.githubusercontent.com/opencv/opencv_3rdparty/${FFMPEG_BINARIES_COMMIT}/ffmpeg/"
|
||||
DESTINATION_DIR ${FFMPEG_DOWNLOAD_DIR}
|
||||
ID FFMPEG
|
||||
RELATIVE_URL
|
||||
STATUS res)
|
||||
if(NOT res)
|
||||
set(status FALSE)
|
||||
endif()
|
||||
endforeach()
|
||||
if(status)
|
||||
set(${script_var} "${FFMPEG_DOWNLOAD_DIR}/ffmpeg_version.cmake" PARENT_SCOPE)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/ffmpeg_version.cmake)
|
||||
if(OPENCV_INSTALL_FFMPEG_DOWNLOAD_SCRIPT)
|
||||
configure_file("${CMAKE_CURRENT_LIST_DIR}/ffmpeg-download.ps1.in" "${CMAKE_BINARY_DIR}/win-install/ffmpeg-download.ps1" @ONLY)
|
||||
install(FILES "${CMAKE_BINARY_DIR}/win-install/ffmpeg-download.ps1" DESTINATION "." COMPONENT libs)
|
||||
endif()
|
||||
|
||||
ocv_install_3rdparty_licenses(ffmpeg license.txt readme.txt)
|
||||
|
||||
Vendored
+4
-5
@@ -16,19 +16,18 @@
|
||||
The binaries are opencv_ffmpeg.dll (version for 32-bit Windows) and
|
||||
opencv_ffmpeg_64.dll (version for 64-bit Windows).
|
||||
|
||||
See build_win32.txt for the build instructions, if you want to rebuild opencv_ffmpeg*.dll from scratch.
|
||||
|
||||
The pre-built opencv_ffmpeg*.dll is:
|
||||
* LGPL library, not BSD libraries.
|
||||
* Loaded at runtime by opencv_videoio module.
|
||||
If it succeeds, ffmpeg can be used to decode/encode videos;
|
||||
otherwise, other API is used.
|
||||
|
||||
FFMPEG build contains H264 encoder based on the OpenH264 library, that should be installed separatelly.
|
||||
FFMPEG build includes support for H264 encoder based on the OpenH264 library.
|
||||
OpenH264 Video Codec provided by Cisco Systems, Inc.
|
||||
See https://github.com/cisco/openh264/releases for details and OpenH264 license.
|
||||
Downloaded binary file can be placed into global system path (System32 or SysWOW64) or near application binaries.
|
||||
You can also specify location of binary file via OPENH264_LIBRARY_PATH environment variable.
|
||||
OpenH264 library should be installed separatelly. Downloaded binary file can be placed into global system path
|
||||
(System32 or SysWOW64) or near application binaries (check documentation of "LoadLibrary" Win32 function from MSDN).
|
||||
Or you can specify location of binary file via OPENH264_LIBRARY environment variable.
|
||||
|
||||
If LGPL/GPL software can not be supplied with your OpenCV-based product, simply exclude
|
||||
opencv_ffmpeg*.dll from your distribution; OpenCV will stay fully functional except for the ability to
|
||||
|
||||
-110
@@ -1,110 +0,0 @@
|
||||
/**
|
||||
* This file has no copyright assigned and is placed in the Public Domain.
|
||||
* This file is part of the w64 mingw-runtime package.
|
||||
* No warranty is given; refer to the file DISCLAIMER within this package.
|
||||
*/
|
||||
|
||||
#if defined(_MSC_VER) && !defined(_MSC_EXTENSIONS)
|
||||
#define NONAMELESSUNION 1
|
||||
#endif
|
||||
#if defined(NONAMELESSSTRUCT) && \
|
||||
!defined(NONAMELESSUNION)
|
||||
#define NONAMELESSUNION 1
|
||||
#endif
|
||||
#if defined(NONAMELESSUNION) && \
|
||||
!defined(NONAMELESSSTRUCT)
|
||||
#define NONAMELESSSTRUCT 1
|
||||
#endif
|
||||
|
||||
#ifndef __ANONYMOUS_DEFINED
|
||||
#define __ANONYMOUS_DEFINED
|
||||
#if defined(__GNUC__) || defined(__GNUG__)
|
||||
#define _ANONYMOUS_UNION __extension__
|
||||
#define _ANONYMOUS_STRUCT __extension__
|
||||
#else
|
||||
#define _ANONYMOUS_UNION
|
||||
#define _ANONYMOUS_STRUCT
|
||||
#endif
|
||||
#ifndef NONAMELESSUNION
|
||||
#define _UNION_NAME(x)
|
||||
#define _STRUCT_NAME(x)
|
||||
#else /* NONAMELESSUNION */
|
||||
#define _UNION_NAME(x) x
|
||||
#define _STRUCT_NAME(x) x
|
||||
#endif
|
||||
#endif /* __ANONYMOUS_DEFINED */
|
||||
|
||||
#ifndef DUMMYUNIONNAME
|
||||
# ifdef NONAMELESSUNION
|
||||
# define DUMMYUNIONNAME u
|
||||
# define DUMMYUNIONNAME1 u1 /* Wine uses this variant */
|
||||
# define DUMMYUNIONNAME2 u2
|
||||
# define DUMMYUNIONNAME3 u3
|
||||
# define DUMMYUNIONNAME4 u4
|
||||
# define DUMMYUNIONNAME5 u5
|
||||
# define DUMMYUNIONNAME6 u6
|
||||
# define DUMMYUNIONNAME7 u7
|
||||
# define DUMMYUNIONNAME8 u8
|
||||
# define DUMMYUNIONNAME9 u9
|
||||
# else /* NONAMELESSUNION */
|
||||
# define DUMMYUNIONNAME
|
||||
# define DUMMYUNIONNAME1 /* Wine uses this variant */
|
||||
# define DUMMYUNIONNAME2
|
||||
# define DUMMYUNIONNAME3
|
||||
# define DUMMYUNIONNAME4
|
||||
# define DUMMYUNIONNAME5
|
||||
# define DUMMYUNIONNAME6
|
||||
# define DUMMYUNIONNAME7
|
||||
# define DUMMYUNIONNAME8
|
||||
# define DUMMYUNIONNAME9
|
||||
# endif
|
||||
#endif /* DUMMYUNIONNAME */
|
||||
|
||||
#if !defined(DUMMYUNIONNAME1) /* MinGW does not define this one */
|
||||
# ifdef NONAMELESSUNION
|
||||
# define DUMMYUNIONNAME1 u1 /* Wine uses this variant */
|
||||
# else
|
||||
# define DUMMYUNIONNAME1 /* Wine uses this variant */
|
||||
# endif
|
||||
#endif /* DUMMYUNIONNAME1 */
|
||||
|
||||
#ifndef DUMMYSTRUCTNAME
|
||||
# ifdef NONAMELESSUNION
|
||||
# define DUMMYSTRUCTNAME s
|
||||
# define DUMMYSTRUCTNAME1 s1 /* Wine uses this variant */
|
||||
# define DUMMYSTRUCTNAME2 s2
|
||||
# define DUMMYSTRUCTNAME3 s3
|
||||
# define DUMMYSTRUCTNAME4 s4
|
||||
# define DUMMYSTRUCTNAME5 s5
|
||||
# else
|
||||
# define DUMMYSTRUCTNAME
|
||||
# define DUMMYSTRUCTNAME1 /* Wine uses this variant */
|
||||
# define DUMMYSTRUCTNAME2
|
||||
# define DUMMYSTRUCTNAME3
|
||||
# define DUMMYSTRUCTNAME4
|
||||
# define DUMMYSTRUCTNAME5
|
||||
# endif
|
||||
#endif /* DUMMYSTRUCTNAME */
|
||||
|
||||
/* These are for compatibility with the Wine source tree */
|
||||
|
||||
#ifndef WINELIB_NAME_AW
|
||||
# ifdef __MINGW_NAME_AW
|
||||
# define WINELIB_NAME_AW __MINGW_NAME_AW
|
||||
# else
|
||||
# ifdef UNICODE
|
||||
# define WINELIB_NAME_AW(func) func##W
|
||||
# else
|
||||
# define WINELIB_NAME_AW(func) func##A
|
||||
# endif
|
||||
# endif
|
||||
#endif /* WINELIB_NAME_AW */
|
||||
|
||||
#ifndef DECL_WINELIB_TYPE_AW
|
||||
# ifdef __MINGW_TYPEDEF_AW
|
||||
# define DECL_WINELIB_TYPE_AW __MINGW_TYPEDEF_AW
|
||||
# else
|
||||
# define DECL_WINELIB_TYPE_AW(type) typedef WINELIB_NAME_AW(type) type;
|
||||
# endif
|
||||
#endif /* DECL_WINELIB_TYPE_AW */
|
||||
|
||||
-33
@@ -1,33 +0,0 @@
|
||||
/**
|
||||
* This file has no copyright assigned and is placed in the Public Domain.
|
||||
* This file is part of the w64 mingw-runtime package.
|
||||
* No warranty is given; refer to the file DISCLAIMER.PD within this package.
|
||||
*/
|
||||
|
||||
#if !defined(_INC_CRT_UNICODE_MACROS)
|
||||
/* _INC_CRT_UNICODE_MACROS defined based on UNICODE flag */
|
||||
|
||||
#if defined(UNICODE)
|
||||
# define _INC_CRT_UNICODE_MACROS 1
|
||||
# define __MINGW_NAME_AW(func) func##W
|
||||
# define __MINGW_NAME_AW_EXT(func,ext) func##W##ext
|
||||
# define __MINGW_NAME_UAW(func) func##_W
|
||||
# define __MINGW_NAME_UAW_EXT(func,ext) func##_W_##ext
|
||||
# define __MINGW_STRING_AW(str) L##str /* same as TEXT() from winnt.h */
|
||||
# define __MINGW_PROCNAMEEXT_AW "W"
|
||||
#else
|
||||
# define _INC_CRT_UNICODE_MACROS 2
|
||||
# define __MINGW_NAME_AW(func) func##A
|
||||
# define __MINGW_NAME_AW_EXT(func,ext) func##A##ext
|
||||
# define __MINGW_NAME_UAW(func) func##_A
|
||||
# define __MINGW_NAME_UAW_EXT(func,ext) func##_A_##ext
|
||||
# define __MINGW_STRING_AW(str) str /* same as TEXT() from winnt.h */
|
||||
# define __MINGW_PROCNAMEEXT_AW "A"
|
||||
#endif
|
||||
|
||||
#define __MINGW_TYPEDEF_AW(type) \
|
||||
typedef __MINGW_NAME_AW(type) type;
|
||||
#define __MINGW_TYPEDEF_UAW(type) \
|
||||
typedef __MINGW_NAME_UAW(type) type;
|
||||
|
||||
#endif /* !defined(_INC_CRT_UNICODE_MACROS) */
|
||||
Vendored
-1290
File diff suppressed because it is too large
Load Diff
Vendored
-31
@@ -1,31 +0,0 @@
|
||||
#ifndef _AUDEVCOD_H
|
||||
#define _AUDEVCOD_H
|
||||
#if __GNUC__ >=3
|
||||
#pragma GCC system_header
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef enum _tagSND_DEVICE_ERROR {
|
||||
SNDDEV_ERROR_Open = 1,
|
||||
SNDDEV_ERROR_Close = 2,
|
||||
SNDDEV_ERROR_GetCaps = 3,
|
||||
SNDDEV_ERROR_PrepareHeader = 4,
|
||||
SNDDEV_ERROR_UnprepareHeader = 5,
|
||||
SNDDEV_ERROR_Reset = 6,
|
||||
SNDDEV_ERROR_Restart = 7,
|
||||
SNDDEV_ERROR_GetPosition = 8,
|
||||
SNDDEV_ERROR_Write = 9,
|
||||
SNDDEV_ERROR_Pause = 10,
|
||||
SNDDEV_ERROR_Stop = 11,
|
||||
SNDDEV_ERROR_Start = 12,
|
||||
SNDDEV_ERROR_AddBuffer = 13,
|
||||
SNDDEV_ERROR_Query = 14
|
||||
} SNDDEV_ERR;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
Vendored
-32
@@ -1,32 +0,0 @@
|
||||
#ifndef _BDATYPES_H
|
||||
#define _BDATYPES_H
|
||||
#if __GNUC__ >= 3
|
||||
#pragma GCC system_header
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*--- DirectShow Reference - DirectShow Enumerated Types */
|
||||
typedef enum {
|
||||
MEDIA_TRANSPORT_PACKET,
|
||||
MEDIA_ELEMENTARY_STREAM,
|
||||
MEDIA_MPEG2_PSI,
|
||||
MEDIA_TRANSPORT_PAYLOAD
|
||||
} MEDIA_SAMPLE_CONTENT;
|
||||
/*--- DirectShow Reference - DirectShow Structures */
|
||||
typedef struct {
|
||||
DWORD dwOffset;
|
||||
DWORD dwPacketLength;
|
||||
DWORD dwStride;
|
||||
} MPEG2_TRANSPORT_STRIDE;
|
||||
typedef struct {
|
||||
ULONG ulPID;
|
||||
MEDIA_SAMPLE_CONTENT MediaSampleContent ;
|
||||
} PID_MAP;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
Vendored
-1467
File diff suppressed because it is too large
Load Diff
Vendored
-2712
File diff suppressed because it is too large
Load Diff
Vendored
-61
@@ -1,61 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2002 Alexandre Julliard
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#ifndef __DSHOW_INCLUDED__
|
||||
#define __DSHOW_INCLUDED__
|
||||
|
||||
#define AM_NOVTABLE
|
||||
|
||||
#ifndef __WINESRC__
|
||||
# include <windows.h>
|
||||
# include <windowsx.h>
|
||||
#else
|
||||
# include <windef.h>
|
||||
# include <wingdi.h>
|
||||
# include <objbase.h>
|
||||
#endif
|
||||
#include <olectl.h>
|
||||
#include <dshow/ddraw.h>
|
||||
#include <mmsystem.h>
|
||||
/* FIXME: #include <strsafe.h>*/
|
||||
|
||||
#ifndef NUMELMS
|
||||
#define NUMELMS(array) (sizeof(array)/sizeof((array)[0]))
|
||||
#endif
|
||||
|
||||
#include <dshow/strmif.h>
|
||||
#include <dshow/amvideo.h>
|
||||
#ifdef DSHOW_USE_AMAUDIO
|
||||
/* FIXME: #include <amaudio.h>*/
|
||||
#endif
|
||||
#include <dshow/control.h>
|
||||
#include <dshow/evcode.h>
|
||||
#include <dshow/uuids.h>
|
||||
#include <dshow/errors.h>
|
||||
/* FIXME: #include <edevdefs.h> */
|
||||
#include <dshow/audevcod.h>
|
||||
/* FIXME: #include <dvdevcod.h> */
|
||||
|
||||
#ifndef OATRUE
|
||||
#define OATRUE (-1)
|
||||
#endif
|
||||
#ifndef OAFALSE
|
||||
#define OAFALSE (0)
|
||||
#endif
|
||||
|
||||
#endif /* __DSHOW_INCLUDED__ */
|
||||
Vendored
-1199
File diff suppressed because it is too large
Load Diff
Vendored
-75
@@ -1,75 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2008 Maarten Lankhorst
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#ifndef __DVDMEDIA_H__
|
||||
#define __DVDMEDIA_H__
|
||||
|
||||
#define AMCONTROL_USED 0x00000001
|
||||
#define AMCONTROL_PAD_TO_4x3 0x00000002
|
||||
#define AMCONTROL_PAD_TO_16x9 0x00000004
|
||||
|
||||
enum AM_MPEG2Level {
|
||||
AM_MPEG2Level_Low = 1,
|
||||
AM_MPEG2Level_Main,
|
||||
AM_MPEG2Level_High1440,
|
||||
AM_MPEG2Level_High
|
||||
};
|
||||
enum AM_MPEG2Profile {
|
||||
AM_MPEG2Profile_Simple = 1,
|
||||
AM_MPEG2Profile_Main,
|
||||
AM_MPEG2Profile_SNRScalable,
|
||||
AM_MPEG2Profile_SpatiallyScalable,
|
||||
AM_MPEG2Profile_High
|
||||
};
|
||||
typedef enum {
|
||||
AM_RATE_ChangeRate = 1,
|
||||
AM_RATE_FullDataRateMax = 2,
|
||||
AM_RATE_ReverseDecode = 3,
|
||||
AM_RATE_DecoderPosition = 4,
|
||||
AM_RATE_DecoderVersion = 5
|
||||
} AM_PROPERTY_DVD_RATE_CHANGE;
|
||||
|
||||
typedef struct tagVIDEOINFOHEADER2 {
|
||||
RECT rcSource;
|
||||
RECT rcTarget;
|
||||
DWORD dwBitRate;
|
||||
DWORD dwBitErrorRate;
|
||||
REFERENCE_TIME AvgTimePerFrame;
|
||||
DWORD dwInterlaceFlags;
|
||||
DWORD dwCopyProtectFlags;
|
||||
DWORD dwPictAspectRatioX;
|
||||
DWORD dwPictAspectRatioY;
|
||||
union {
|
||||
DWORD dwControlFlags;
|
||||
DWORD dwReserved1;
|
||||
} DUMMYUNIONNAME;
|
||||
DWORD dwReserved2;
|
||||
BITMAPINFOHEADER bmiHeader;
|
||||
} VIDEOINFOHEADER2;
|
||||
|
||||
typedef struct tagMPEG2VIDEOINFO {
|
||||
VIDEOINFOHEADER2 hdr;
|
||||
DWORD dwStartTimeCode;
|
||||
DWORD cbSequenceHeader;
|
||||
DWORD dwProfile;
|
||||
DWORD dwLevel;
|
||||
DWORD dwFlags;
|
||||
DWORD dwSequenceHeader[1];
|
||||
} MPEG2VIDEOINFO;
|
||||
|
||||
#endif /* __DVDMEDIA_H__ */
|
||||
Vendored
-169
@@ -1,169 +0,0 @@
|
||||
#ifndef _ERRORS_H
|
||||
#define _ERRORS_H
|
||||
#if __GNUC__ >=3
|
||||
#pragma GCC system_header
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*--- DirectShow Reference - Constants and GUIDs - Error and Success Codes */
|
||||
#define VFW_S_NO_MORE_ITEMS 0x00040103
|
||||
#define VFW_S_DUPLICATE_NAME 0x0004022D
|
||||
#define VFW_S_STATE_INTERMEDIATE 0x00040237
|
||||
#define VFW_S_PARTIAL_RENDER 0x00040242
|
||||
#define VFW_S_SOME_DATA_IGNORED 0x00040245
|
||||
#define VFW_S_CONNECTIONS_DEFERRED 0x00040246
|
||||
#define VFW_S_RESOURCE_NOT_NEEDED 0x00040250
|
||||
#define VFW_S_MEDIA_TYPE_IGNORED 0x00040254
|
||||
#define VFW_S_VIDEO_NOT_RENDERED 0x00040257
|
||||
#define VFW_S_AUDIO_NOT_RENDERED 0x00040258
|
||||
#define VFW_S_RPZA 0x0004025A
|
||||
#define VFW_S_ESTIMATED 0x00040260
|
||||
#define VFW_S_RESERVED 0x00040263
|
||||
#define VFW_S_STREAM_OFF 0x00040267
|
||||
#define VFW_S_CANT_CUE 0x00040268
|
||||
#define VFW_S_NOPREVIEWPIN 0x0004027E
|
||||
#define VFW_S_DVD_NON_ONE_SEQUENTIAL 0x00040280
|
||||
#define VFW_S_DVD_CHANNEL_CONTENTS_NOT_AVAILABLE 0x0004028C
|
||||
#define VFW_S_DVD_NOT_ACCURATE 0x0004028D
|
||||
#define VFW_E_INVALIDMEDIATYPE 0x80040200
|
||||
#define VFW_E_INVALIDSUBTYPE 0x80040201
|
||||
#define VFW_E_NEED_OWNER 0x80040202
|
||||
#define VFW_E_ENUM_OUT_OF_SYNC 0x80040203
|
||||
#define VFW_E_ALREADY_CONNECTED 0x80040204
|
||||
#define VFW_E_FILTER_ACTIVE 0x80040205
|
||||
#define VFW_E_NO_TYPES 0x80040206
|
||||
#define VFW_E_NO_ACCEPTABLE_TYPES 0x80040207
|
||||
#define VFW_E_INVALID_DIRECTION 0x80040208
|
||||
#define VFW_E_NOT_CONNECTED 0x80040209
|
||||
#define VFW_E_NO_ALLOCATOR 0x8004020A
|
||||
#define VFW_E_RUNTIME_ERROR 0x8004020B
|
||||
#define VFW_E_BUFFER_NOTSET 0x8004020C
|
||||
#define VFW_E_BUFFER_OVERFLOW 0x8004020D
|
||||
#define VFW_E_BADALIGN 0x8004020E
|
||||
#define VFW_E_ALREADY_COMMITTED 0x8004020F
|
||||
#define VFW_E_BUFFERS_OUTSTANDING 0x80040210
|
||||
#define VFW_E_NOT_COMMITTED 0x80040211
|
||||
#define VFW_E_SIZENOTSET 0x80040212
|
||||
#define VFW_E_NO_CLOCK 0x80040213
|
||||
#define VFW_E_NO_SINK 0x80040214
|
||||
#define VFW_E_NO_INTERFACE 0x80040215
|
||||
#define VFW_E_NOT_FOUND 0x80040216
|
||||
#define VFW_E_CANNOT_CONNECT 0x80040217
|
||||
#define VFW_E_CANNOT_RENDER 0x80040218
|
||||
#define VFW_E_CHANGING_FORMAT 0x80040219
|
||||
#define VFW_E_NO_COLOR_KEY_SET 0x8004021A
|
||||
#define VFW_E_NOT_OVERLAY_CONNECTION 0x8004021B
|
||||
#define VFW_E_NOT_SAMPLE_CONNECTION 0x8004021C
|
||||
#define VFW_E_PALETTE_SET 0x8004021D
|
||||
#define VFW_E_COLOR_KEY_SET 0x8004021E
|
||||
#define VFW_E_NO_COLOR_KEY_FOUND 0x8004021F
|
||||
#define VFW_E_NO_PALETTE_AVAILABLE 0x80040220
|
||||
#define VFW_E_NO_DISPLAY_PALETTE 0x80040221
|
||||
#define VFW_E_TOO_MANY_COLORS 0x80040222
|
||||
#define VFW_E_STATE_CHANGED 0x80040223
|
||||
#define VFW_E_NOT_STOPPED 0x80040224
|
||||
#define VFW_E_NOT_PAUSED 0x80040225
|
||||
#define VFW_E_NOT_RUNNING 0x80040226
|
||||
#define VFW_E_WRONG_STATE 0x80040227
|
||||
#define VFW_E_START_TIME_AFTER_END 0x80040228
|
||||
#define VFW_E_INVALID_RECT 0x80040229
|
||||
#define VFW_E_TYPE_NOT_ACCEPTED 0x8004022A
|
||||
#define VFW_E_SAMPLE_REJECTED 0x8004022B
|
||||
#define VFW_E_SAMPLE_REJECTED_EOS 0x8004022C
|
||||
#define VFW_E_DUPLICATE_NAME 0x8004022D
|
||||
#define VFW_E_TIMEOUT 0x8004022E
|
||||
#define VFW_E_INVALID_FILE_FORMAT 0x8004022F
|
||||
#define VFW_E_ENUM_OUT_OF_RANGE 0x80040230
|
||||
#define VFW_E_CIRCULAR_GRAPH 0x80040231
|
||||
#define VFW_E_NOT_ALLOWED_TO_SAVE 0x80040232
|
||||
#define VFW_E_TIME_ALREADY_PASSED 0x80040233
|
||||
#define VFW_E_ALREADY_CANCELLED 0x80040234
|
||||
#define VFW_E_CORRUPT_GRAPH_FILE 0x80040235
|
||||
#define VFW_E_ADVISE_ALREADY_SET 0x80040236
|
||||
#define VFW_E_NO_MODEX_AVAILABLE 0x80040238
|
||||
#define VFW_E_NO_ADVISE_SET 0x80040239
|
||||
#define VFW_E_NO_FULLSCREEN 0x8004023A
|
||||
#define VFW_E_IN_FULLSCREEN_MODE 0x8004023B
|
||||
#define VFW_E_UNKNOWN_FILE_TYPE 0x80040240
|
||||
#define VFW_E_CANNOT_LOAD_SOURCE_FILTER 0x80040241
|
||||
#define VFW_E_FILE_TOO_SHORT 0x80040243
|
||||
#define VFW_E_INVALID_FILE_VERSION 0x80040244
|
||||
#define VFW_E_INVALID_CLSID 0x80040247
|
||||
#define VFW_E_INVALID_MEDIA_TYPE 0x80040248
|
||||
#define VFW_E_SAMPLE_TIME_NOT_SET 0x80040249
|
||||
#define VFW_E_MEDIA_TIME_NOT_SET 0x80040251
|
||||
#define VFW_E_NO_TIME_FORMAT_SET 0x80040252
|
||||
#define VFW_E_MONO_AUDIO_HW 0x80040253
|
||||
#define VFW_E_NO_DECOMPRESSOR 0x80040255
|
||||
#define VFW_E_NO_AUDIO_HARDWARE 0x80040256
|
||||
#define VFW_E_RPZA 0x80040259
|
||||
#define VFW_E_PROCESSOR_NOT_SUITABLE 0x8004025B
|
||||
#define VFW_E_UNSUPPORTED_AUDIO 0x8004025C
|
||||
#define VFW_E_UNSUPPORTED_VIDEO 0x8004025D
|
||||
#define VFW_E_MPEG_NOT_CONSTRAINED 0x8004025E
|
||||
#define VFW_E_NOT_IN_GRAPH 0x8004025F
|
||||
#define VFW_E_NO_TIME_FORMAT 0x80040261
|
||||
#define VFW_E_READ_ONLY 0x80040262
|
||||
#define VFW_E_BUFFER_UNDERFLOW 0x80040264
|
||||
#define VFW_E_UNSUPPORTED_STREAM 0x80040265
|
||||
#define VFW_E_NO_TRANSPORT 0x80040266
|
||||
#define VFW_E_BAD_VIDEOCD 0x80040269
|
||||
#define VFW_S_NO_STOP_TIME 0x80040270
|
||||
#define VFW_E_OUT_OF_VIDEO_MEMORY 0x80040271
|
||||
#define VFW_E_VP_NEGOTIATION_FAILED 0x80040272
|
||||
#define VFW_E_DDRAW_CAPS_NOT_SUITABLE 0x80040273
|
||||
#define VFW_E_NO_VP_HARDWARE 0x80040274
|
||||
#define VFW_E_NO_CAPTURE_HARDWARE 0x80040275
|
||||
#define VFW_E_DVD_OPERATION_INHIBITED 0x80040276
|
||||
#define VFW_E_DVD_INVALIDDOMAIN 0x80040277
|
||||
#define VFW_E_DVD_NO_BUTTON 0x80040278
|
||||
#define VFW_E_DVD_GRAPHNOTREADY 0x80040279
|
||||
#define VFW_E_DVD_RENDERFAIL 0x8004027A
|
||||
#define VFW_E_DVD_DECNOTENOUGH 0x8004027B
|
||||
#define VFW_E_DDRAW_VERSION_NOT_SUITABLE 0x8004027C
|
||||
#define VFW_E_COPYPROT_FAILED 0x8004027D
|
||||
#define VFW_E_TIME_EXPIRED 0x8004027F
|
||||
#define VFW_E_DVD_WRONG_SPEED 0x80040281
|
||||
#define VFW_E_DVD_MENU_DOES_NOT_EXIST 0x80040282
|
||||
#define VFW_E_DVD_CMD_CANCELLED 0x80040283
|
||||
#define VFW_E_DVD_STATE_WRONG_VERSION 0x80040284
|
||||
#define VFW_E_DVD_STATE_CORRUPT 0x80040285
|
||||
#define VFW_E_DVD_STATE_WRONG_DISC 0x80040286
|
||||
#define VFW_E_DVD_INCOMPATIBLE_REGION 0x80040287
|
||||
#define VFW_E_DVD_NO_ATTRIBUTES 0x80040288
|
||||
#define VFW_E_DVD_NO_GOUP_PGC 0x80040289
|
||||
#define VFW_E_DVD_LOW_PARENTAL_LEVEL 0x8004028A
|
||||
#define VFW_E_DVD_NOT_IN_KARAOKE_MODE 0x8004028B
|
||||
#define VFW_E_FRAME_STEP_UNSUPPORTED 0x8004028E
|
||||
#define VFW_E_DVD_STREAM_DISABLED 0x8004028F
|
||||
#define VFW_E_DVD_TITLE_UNKNOWN 0x80040290
|
||||
#define VFW_E_DVD_INVALID_DISC 0x80040291
|
||||
#define VFW_E_DVD_NO_RESUME_INFORMATION 0x80040292
|
||||
#define VFW_E_PIN_ALREADY_BLOCKED_ON_THIS_THREAD 0x80040293
|
||||
#define VFW_E_PIN_ALREADY_BLOCKED 0x80040294
|
||||
#define VFW_E_CERTIFICATION_FAILURE 0x80040295
|
||||
#define VFW_E_VMR_NOT_IN_MIXER_MODE 0x80040296
|
||||
#define VFW_E_VMR_NO_AP_SUPPLIED 0x80040297
|
||||
#define VFW_E_VMR_NO_DEINTERLACE_HW 0x80040298
|
||||
#define VFW_E_VMR_NO_PROCAMP_HW 0x80040299
|
||||
#define VFW_E_DVD_VMR9_INCOMPATIBLEDEC 0x8004029A
|
||||
#define VFW_E_NO_COPP_HW 0x8004029B
|
||||
#define VFW_E_BAD_KEY 0x800403F2
|
||||
/*--- DirectShow Reference - Functions */
|
||||
#define MAX_ERROR_TEXT_LEN 160
|
||||
/*--- DirectShow Reference - Functions */
|
||||
DWORD WINAPI AMGetErrorTextA(HRESULT,CHAR*,DWORD);
|
||||
DWORD WINAPI AMGetErrorTextW(HRESULT,WCHAR*,DWORD);
|
||||
#ifdef UNICODE
|
||||
#define AMGetErrorText AMGetErrorTextW
|
||||
#else
|
||||
#define AMGetErrorText AMGetErrorTextA
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
Vendored
-68
@@ -1,68 +0,0 @@
|
||||
#ifndef _EVCODE_H
|
||||
#define _EVCODE_H
|
||||
#if __GNUC__ >=3
|
||||
#pragma GCC system_header
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*--- DirectShow Reference - Constants and GUIDs - Event Notification Codes */
|
||||
#define EC_ACTIVATE 0x0013
|
||||
#define EC_BUFFERING_DATA 0x0011
|
||||
#define EC_BUILT 0x0300
|
||||
#define EC_CLOCK_CHANGED 0x000D
|
||||
#define EC_CLOCK_UNSET 0x0051
|
||||
#define EC_CODECAPI_EVENT 0x0057
|
||||
#define EC_COMPLETE 0x0001
|
||||
#define EC_DEVICE_LOST 0x001F
|
||||
#define EC_DISPLAY_CHANGED 0x0016
|
||||
#define EC_END_OF_SEGMENT 0x001C
|
||||
#define EC_ERROR_STILLPLAYING 0x0008
|
||||
#define EC_ERRORABORT 0x0003
|
||||
#define EC_EXTDEVICE_MODE_CHANGE 0x0031
|
||||
#define EC_FULLSCREEN_LOST 0x0012
|
||||
#define EC_GRAPH_CHANGED 0x0050
|
||||
#define EC_LENGTH_CHANGED 0x001E
|
||||
#define EC_NEED_RESTART 0x0014
|
||||
#define EC_NOTIFY_WINDOW 0x0019
|
||||
#define EC_OLE_EVENT 0x0018
|
||||
#define EC_OPENING_FILE 0x0010
|
||||
#define EC_PALETTE_CHANGED 0x0009
|
||||
#define EC_PAUSED 0x000E
|
||||
#define EC_PREPROCESS_COMPLETE 0x0056
|
||||
#define EC_QUALITY_CHANGE 0x000B
|
||||
#define EC_REPAINT 0x0005
|
||||
#define EC_SEGMENT_STARTED 0x001D
|
||||
#define EC_SHUTTING_DOWN 0x000C
|
||||
#define EC_SNDDEV_IN_ERROR 0x0200
|
||||
#define EC_SNDDEV_OUT_ERROR 0x0201
|
||||
#define EC_STARVATION 0x0017
|
||||
#define EC_STATE_CHANGE 0x0032
|
||||
#define EC_STEP_COMPLETE 0x0024
|
||||
#define EC_STREAM_CONTROL_STARTED 0x001B
|
||||
#define EC_STREAM_CONTROL_STOPPED 0x001A
|
||||
#define EC_STREAM_ERROR_STILLPLAYING 0x0007
|
||||
#define EC_STREAM_ERROR_STOPPED 0x0006
|
||||
#define EC_TIMECODE_AVAILABLE 0x0030
|
||||
#define EC_UNBUILT 0x0301
|
||||
#define EC_USERABORT 0x0002
|
||||
#define EC_VIDEO_SIZE_CHANGED 0x000A
|
||||
#define EC_VMR_RENDERDEVICE_SET 0x0053
|
||||
#define EC_VMR_SURFACE_FLIPPED 0x0054
|
||||
#define EC_VMR_RECONNECTION_FAILED 0x0055
|
||||
#define EC_WINDOW_DESTROYED 0x0015
|
||||
#define EC_WMT_EVENT 0x0252
|
||||
#define EC_WMT_INDEX_EVENT 0x0251
|
||||
#define EC_USER 0x8000
|
||||
/*--- DirectShow Reference - DirectShow Structures */
|
||||
typedef struct {
|
||||
HRESULT hrStatus;
|
||||
void *pData;
|
||||
} AM_WMT_EVENT_DATA;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
Vendored
-191
@@ -1,191 +0,0 @@
|
||||
/**
|
||||
* This file has no copyright assigned and is placed in the Public Domain.
|
||||
* This file is part of the w64 mingw-runtime package.
|
||||
* No warranty is given; refer to the file DISCLAIMER.PD within this package.
|
||||
*/
|
||||
|
||||
OUR_GUID_ENTRY(MEDIATYPE_MPEG2_PACK,
|
||||
0x36523B13,0x8EE5,0x11d1,0x8C,0xA3,0x00,0x60,0xB0,0x57,0x66,0x4A)
|
||||
|
||||
OUR_GUID_ENTRY(MEDIATYPE_MPEG2_PES,
|
||||
0xe06d8020,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x5f,0x6c,0xbb,0xea)
|
||||
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG2_WMDRM_TRANSPORT,
|
||||
0x18BEC4EA,0x4676,0x450e,0xB4,0x78,0x0C,0xD8,0x4C,0x54,0xB3,0x27)
|
||||
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG2_VIDEO,
|
||||
0xe06d8026,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x5f,0x6c,0xbb,0xea)
|
||||
|
||||
OUR_GUID_ENTRY(FORMAT_MPEG2_VIDEO,
|
||||
0xe06d80e3,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x5f,0x6c,0xbb,0xea)
|
||||
|
||||
OUR_GUID_ENTRY(FORMAT_VIDEOINFO2,
|
||||
0xf72a76A0L,0xeb0a,0x11d0,0xac,0xe4,0x0,0x0,0xc0,0xcc,0x16,0xba)
|
||||
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG2_PROGRAM,
|
||||
0xe06d8022,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x05f,0x6c,0xbb,0xea)
|
||||
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG2_TRANSPORT,
|
||||
0xe06d8023,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x05f,0x6c,0xbb,0xea)
|
||||
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG2_AUDIO,
|
||||
0xe06d802b,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x05f,0x6c,0xbb,0xea)
|
||||
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_DOLBY_AC3,
|
||||
0xe06d802c,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x05f,0x6c,0xbb,0xea)
|
||||
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_DVD_SUBPICTURE,
|
||||
0xe06d802d,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x05f,0x6c,0xbb,0xea)
|
||||
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_DVD_LPCM_AUDIO,
|
||||
0xe06d8032,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x05f,0x6c,0xbb,0xea)
|
||||
|
||||
OUR_GUID_ENTRY(MEDIATYPE_DVD_ENCRYPTED_PACK,
|
||||
0xed0b916a,0x044d,0x11d1,0xaa,0x78,0x00,0xc0,0x04f,0xc3,0x1d,0x60)
|
||||
|
||||
OUR_GUID_ENTRY(MEDIATYPE_DVD_NAVIGATION,
|
||||
0xe06d802e,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x05f,0x6c,0xbb,0xea)
|
||||
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_DVD_NAVIGATION_PCI,
|
||||
0xe06d802f,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x05f,0x6c,0xbb,0xea)
|
||||
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_DVD_NAVIGATION_DSI,
|
||||
0xe06d8030,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x05f,0x6c,0xbb,0xea)
|
||||
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_DVD_NAVIGATION_PROVIDER,
|
||||
0xe06d8031,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x05f,0x6c,0xbb,0xea)
|
||||
|
||||
OUR_GUID_ENTRY(FORMAT_MPEG2Video,
|
||||
0xe06d80e3,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x05f,0x6c,0xbb,0xea)
|
||||
|
||||
OUR_GUID_ENTRY(FORMAT_DolbyAC3,
|
||||
0xe06d80e4,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x05f,0x6c,0xbb,0xea)
|
||||
|
||||
OUR_GUID_ENTRY(FORMAT_MPEG2Audio,
|
||||
0xe06d80e5,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x05f,0x6c,0xbb,0xea)
|
||||
|
||||
OUR_GUID_ENTRY(FORMAT_DVD_LPCMAudio,
|
||||
0xe06d80e6,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x05f,0x6c,0xbb,0xea)
|
||||
|
||||
OUR_GUID_ENTRY(AM_KSPROPSETID_AC3,
|
||||
0xBFABE720,0x6E1F,0x11D0,0xBC,0xF2,0x44,0x45,0x53,0x54,0x00,0x00)
|
||||
|
||||
OUR_GUID_ENTRY(AM_KSPROPSETID_DvdSubPic,
|
||||
0xac390460,0x43af,0x11d0,0xbd,0x6a,0x00,0x35,0x05,0xc1,0x03,0xa9)
|
||||
|
||||
OUR_GUID_ENTRY(AM_KSPROPSETID_CopyProt,
|
||||
0x0E8A0A40,0x6AEF,0x11D0,0x9E,0xD0,0x00,0xA0,0x24,0xCA,0x19,0xB3)
|
||||
|
||||
OUR_GUID_ENTRY(AM_KSPROPSETID_TSRateChange,
|
||||
0xa503c5c0,0x1d1d,0x11d1,0xad,0x80,0x44,0x45,0x53,0x54,0x0,0x0)
|
||||
|
||||
OUR_GUID_ENTRY(AM_KSPROPSETID_MPEG4_MediaType_Attributes,
|
||||
0xff6c4bfa,0x7a9,0x4c7b,0xa2,0x37,0x67,0x2f,0x9d,0x68,0x6,0x5f)
|
||||
|
||||
OUR_GUID_ENTRY(AM_KSCATEGORY_CAPTURE,
|
||||
0x65E8773DL,0x8F56,0x11D0,0xA3,0xB9,0x00,0xA0,0xC9,0x22,0x31,0x96)
|
||||
|
||||
OUR_GUID_ENTRY(AM_KSCATEGORY_RENDER,
|
||||
0x65E8773EL,0x8F56,0x11D0,0xA3,0xB9,0x00,0xA0,0xC9,0x22,0x31,0x96)
|
||||
|
||||
OUR_GUID_ENTRY(AM_KSCATEGORY_DATACOMPRESSOR,
|
||||
0x1E84C900L,0x7E70,0x11D0,0xA5,0xD6,0x28,0xDB,0x04,0xC1,0x00,0x00)
|
||||
|
||||
OUR_GUID_ENTRY(AM_KSCATEGORY_AUDIO,
|
||||
0x6994AD04L,0x93EF,0x11D0,0xA3,0xCC,0x00,0xA0,0xC9,0x22,0x31,0x96)
|
||||
|
||||
OUR_GUID_ENTRY(AM_KSCATEGORY_VIDEO,
|
||||
0x6994AD05L,0x93EF,0x11D0,0xA3,0xCC,0x00,0xA0,0xC9,0x22,0x31,0x96)
|
||||
|
||||
OUR_GUID_ENTRY(AM_KSCATEGORY_TVTUNER,
|
||||
0xa799a800L,0xa46d,0x11d0,0xa1,0x8c,0x00,0xa0,0x24,0x01,0xdc,0xd4)
|
||||
|
||||
OUR_GUID_ENTRY(AM_KSCATEGORY_CROSSBAR,
|
||||
0xa799a801L,0xa46d,0x11d0,0xa1,0x8c,0x00,0xa0,0x24,0x01,0xdc,0xd4)
|
||||
|
||||
OUR_GUID_ENTRY(AM_KSCATEGORY_TVAUDIO,
|
||||
0xa799a802L,0xa46d,0x11d0,0xa1,0x8c,0x00,0xa0,0x24,0x01,0xdc,0xd4)
|
||||
|
||||
OUR_GUID_ENTRY(AM_KSCATEGORY_VBICODEC,
|
||||
0x07dad660L,0x22f1,0x11d1,0xa9,0xf4,0x00,0xc0,0x4f,0xbb,0xde,0x8f)
|
||||
|
||||
OUR_GUID_ENTRY(AM_KSCATEGORY_SPLITTER,
|
||||
0x0A4252A0L,0x7E70,0x11D0,0xA5,0xD6,0x28,0xDB,0x04,0xC1,0x00,0x00)
|
||||
|
||||
OUR_GUID_ENTRY(IID_IKsInterfaceHandler,
|
||||
0xD3ABC7E0L,0x9A61,0x11D0,0xA4,0x0D,0x00,0xA0,0xC9,0x22,0x31,0x96)
|
||||
|
||||
OUR_GUID_ENTRY(IID_IKsDataTypeHandler,
|
||||
0x5FFBAA02L,0x49A3,0x11D0,0x9F,0x36,0x00,0xAA,0x00,0xA2,0x16,0xA1)
|
||||
|
||||
OUR_GUID_ENTRY(IID_IKsPin,
|
||||
0xb61178d1L,0xa2d9,0x11cf,0x9e,0x53,0x00,0xaa,0x00,0xa2,0x16,0xa1)
|
||||
|
||||
OUR_GUID_ENTRY(IID_IKsControl,
|
||||
0x28F54685L,0x06FD,0x11D2,0xB2,0x7A,0x00,0xA0,0xC9,0x22,0x31,0x96)
|
||||
|
||||
OUR_GUID_ENTRY(IID_IKsPinFactory,
|
||||
0xCD5EBE6BL,0x8B6E,0x11D1,0x8A,0xE0,0x00,0xA0,0xC9,0x22,0x31,0x96)
|
||||
|
||||
OUR_GUID_ENTRY(AM_INTERFACESETID_Standard,
|
||||
0x1A8766A0L,0x62CE,0x11CF,0xA5,0xD6,0x28,0xDB,0x04,0xC1,0x00,0x00)
|
||||
|
||||
#if ( (NTDDI_VERSION >= NTDDI_WINXPSP2) && (NTDDI_VERSION < NTDDI_WS03) ) || (NTDDI_VERSION >= NTDDI_WS03SP1)
|
||||
OUR_GUID_ENTRY(MEDIATYPE_MPEG2_SECTIONS,
|
||||
0x455f176c,0x4b06,0x47ce,0x9a,0xef,0x8c,0xae,0xf7,0x3d,0xf7,0xb5)
|
||||
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG2_VERSIONED_TABLES,
|
||||
0x1ed988b0,0x3ffc,0x4523,0x87,0x25,0x34,0x7b,0xee,0xc1,0xa8,0xa0)
|
||||
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_ATSC_SI,
|
||||
0xb3c7397c,0xd303,0x414d,0xb3,0x3c,0x4e,0xd2,0xc9,0xd2,0x97,0x33)
|
||||
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_DVB_SI,
|
||||
0xe9dd31a3,0x221d,0x4adb,0x85,0x32,0x9a,0xf3,0x9,0xc1,0xa4,0x8)
|
||||
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_ISDB_SI,
|
||||
0xe89ad298,0x3601,0x4b06,0xaa,0xec,0x9d,0xde,0xed,0xcc,0x5b,0xd0)
|
||||
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_TIF_SI,
|
||||
0xec232eb2,0xcb96,0x4191,0xb2,0x26,0xe,0xa1,0x29,0xf3,0x82,0x50)
|
||||
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG2DATA,
|
||||
0xc892e55b,0x252d,0x42b5,0xa3,0x16,0xd9,0x97,0xe7,0xa5,0xd9,0x95)
|
||||
#endif
|
||||
/* ( (NTDDI_VERSION >= NTDDI_WINXPSP2) && (NTDDI_VERSION < NTDDI_WS03) ) ||
|
||||
(NTDDI_VERSION >= NTDDI_WS03SP1) */
|
||||
|
||||
#if (NTDDI_VERSION >= NTDDI_WINXP)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG2_TRANSPORT_STRIDE,
|
||||
0x138aa9a4,0x1ee2,0x4c5b,0x98,0x8e,0x19,0xab,0xfd,0xbc,0x8a,0x11)
|
||||
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG2_UDCR_TRANSPORT,
|
||||
0x18BEC4EA,0x4676,0x450e,0xB4,0x78,0x0C,0xD8,0x4C,0x54,0xB3,0x27)
|
||||
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG2_PBDA_TRANSPORT_RAW,
|
||||
0x0d7aed42,0xcb9a,0x11db,0x97,0x5,0x0,0x50,0x56,0xc0,0x0,0x8)
|
||||
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG2_PBDA_TRANSPORT_PROCESSED,
|
||||
0xaf748dd4,0xd80,0x11db,0x97,0x5,0x0,0x50,0x56,0xc0,0x0,0x8)
|
||||
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_DTS,
|
||||
0xe06d8033,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x05f,0x6c,0xbb,0xea)
|
||||
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_SDDS,
|
||||
0xe06d8034,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x05f,0x6c,0xbb,0xea)
|
||||
|
||||
OUR_GUID_ENTRY(AM_KSPROPSETID_DVD_RateChange,
|
||||
0x3577eb09,0x9582,0x477f,0xb2,0x9c,0xb0,0xc4,0x52,0xa4,0xff,0x9a)
|
||||
|
||||
OUR_GUID_ENTRY(AM_KSPROPSETID_DvdKaraoke,
|
||||
0xae4720ae,0xaa71,0x42d8,0xb8,0x2a,0xff,0xfd,0xf5,0x8b,0x76,0xfd)
|
||||
|
||||
OUR_GUID_ENTRY(AM_KSPROPSETID_FrameStep,
|
||||
0xc830acbd,0xab07,0x492f,0x88,0x52,0x45,0xb6,0x98,0x7c,0x29,0x79)
|
||||
#endif /* NTDDI_VERSION >= NTDDI_WINXP */
|
||||
|
||||
#if (NTDDI_VERSION >= NTDDI_WS03SP1)
|
||||
OUR_GUID_ENTRY(AM_KSCATEGORY_VBICODEC_MI,
|
||||
0x9c24a977,0x951,0x451a,0x80,0x6,0xe,0x49,0xbd,0x28,0xcd,0x5f)
|
||||
#endif /* NTDDI_VERSION >= NTDDI_WS03SP1 */
|
||||
|
||||
Vendored
-9392
File diff suppressed because it is too large
Load Diff
Vendored
-368
@@ -1,368 +0,0 @@
|
||||
/**
|
||||
* This file has no copyright assigned and is placed in the Public Domain.
|
||||
* This file is part of the w64 mingw-runtime package.
|
||||
* No warranty is given; refer to the file DISCLAIMER.PD within this package.
|
||||
*/
|
||||
#ifndef OUR_GUID_ENTRY
|
||||
#define OUR_GUID_ENTRY(name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) DEFINE_GUID(name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8);
|
||||
#endif
|
||||
|
||||
#define MEDIATYPE_NULL GUID_NULL
|
||||
#define MEDIASUBTYPE_NULL GUID_NULL
|
||||
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_None,0xe436eb8e,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
||||
OUR_GUID_ENTRY(MEDIATYPE_Video,0x73646976,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIATYPE_Audio,0x73647561,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIATYPE_Text,0x73747874,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIATYPE_Midi,0x7364696D,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIATYPE_Stream,0xe436eb83,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
||||
OUR_GUID_ENTRY(MEDIATYPE_Interleaved,0x73766169,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIATYPE_File,0x656c6966,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIATYPE_ScriptCommand,0x73636d64,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIATYPE_AUXLine21Data,0x670aea80,0x3a82,0x11d0,0xb7,0x9b,0x0,0xaa,0x0,0x37,0x67,0xa7)
|
||||
OUR_GUID_ENTRY(MEDIATYPE_VBI,0xf72a76e1,0xeb0a,0x11d0,0xac,0xe4,0x00,0x00,0xc0,0xcc,0x16,0xba)
|
||||
OUR_GUID_ENTRY(MEDIATYPE_Timecode,0x482dee3,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
|
||||
OUR_GUID_ENTRY(MEDIATYPE_LMRT,0x74726c6d,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIATYPE_URL_STREAM,0x736c7275,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_CLPL,0x4C504C43,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_YUYV,0x56595559,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_IYUV,0x56555949,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_YVU9,0x39555659,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_Y411,0x31313459,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_Y41P,0x50313459,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_YUY2,0x32595559,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_YVYU,0x55595659,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_UYVY,0x59565955,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_Y211,0x31313259,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_CLJR,0x524a4c43,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_IF09,0x39304649,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_CPLA,0x414c5043,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_MJPG,0x47504A4D,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_TVMJ,0x4A4D5654,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_WAKE,0x454B4157,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_CFCC,0x43434643,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_IJPG,0x47504A49,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_Plum,0x6D756C50,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_DVCS,0x53435644,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_DVSD,0x44535644,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_MDVF,0x4656444D,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_RGB1,0xe436eb78,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_RGB4,0xe436eb79,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_RGB8,0xe436eb7a,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_RGB565,0xe436eb7b,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_RGB555,0xe436eb7c,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_RGB24,0xe436eb7d,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_RGB32,0xe436eb7e,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_ARGB1555,0x297c55af,0xe209,0x4cb3,0xb7,0x57,0xc7,0x6d,0x6b,0x9c,0x88,0xa8)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_ARGB4444,0x6e6415e6,0x5c24,0x425f,0x93,0xcd,0x80,0x10,0x2b,0x3d,0x1c,0xca)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_ARGB32,0x773c9ac0,0x3274,0x11d0,0xb7,0x24,0x0,0xaa,0x0,0x6c,0x1a,0x1)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_A2R10G10B10,0x2f8bb76d,0xb644,0x4550,0xac,0xf3,0xd3,0x0c,0xaa,0x65,0xd5,0xc5)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_A2B10G10R10,0x576f7893,0xbdf6,0x48c4,0x87,0x5f,0xae,0x7b,0x81,0x83,0x45,0x67)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_AYUV,0x56555941,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_AI44,0x34344941,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_IA44,0x34344149,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_RGB32_D3D_DX7_RT,0x32335237,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_RGB16_D3D_DX7_RT,0x36315237,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_ARGB32_D3D_DX7_RT,0x38384137,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_ARGB4444_D3D_DX7_RT,0x34344137,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_ARGB1555_D3D_DX7_RT,0x35314137,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_RGB32_D3D_DX9_RT,0x32335239,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_RGB16_D3D_DX9_RT,0x36315239,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_ARGB32_D3D_DX9_RT,0x38384139,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_ARGB4444_D3D_DX9_RT,0x34344139,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_ARGB1555_D3D_DX9_RT,0x35314139,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
|
||||
#define MEDIASUBTYPE_HASALPHA(mt) (((mt).subtype==MEDIASUBTYPE_ARGB4444) || ((mt).subtype==MEDIASUBTYPE_ARGB32) || ((mt).subtype==MEDIASUBTYPE_AYUV) || ((mt).subtype==MEDIASUBTYPE_AI44) || ((mt).subtype==MEDIASUBTYPE_IA44) || ((mt).subtype==MEDIASUBTYPE_ARGB1555) || ((mt).subtype==MEDIASUBTYPE_ARGB32_D3D_DX7_RT) || ((mt).subtype==MEDIASUBTYPE_ARGB4444_D3D_DX7_RT) || ((mt).subtype==MEDIASUBTYPE_ARGB1555_D3D_DX7_RT) || ((mt).subtype==MEDIASUBTYPE_ARGB32_D3D_DX9_RT) || ((mt).subtype==MEDIASUBTYPE_ARGB4444_D3D_DX9_RT) || ((mt).subtype==MEDIASUBTYPE_ARGB1555_D3D_DX9_RT))
|
||||
#define MEDIASUBTYPE_HASALPHA7(mt) (((mt).subtype==MEDIASUBTYPE_ARGB32_D3D_DX7_RT) || ((mt).subtype==MEDIASUBTYPE_ARGB4444_D3D_DX7_RT) || ((mt).subtype==MEDIASUBTYPE_ARGB1555_D3D_DX7_RT))
|
||||
#define MEDIASUBTYPE_D3D_DX7_RT(mt) (((mt).subtype==MEDIASUBTYPE_ARGB32_D3D_DX7_RT) || ((mt).subtype==MEDIASUBTYPE_ARGB4444_D3D_DX7_RT) || ((mt).subtype==MEDIASUBTYPE_ARGB1555_D3D_DX7_RT) || ((mt).subtype==MEDIASUBTYPE_RGB32_D3D_DX7_RT) || ((mt).subtype==MEDIASUBTYPE_RGB16_D3D_DX7_RT))
|
||||
#define MEDIASUBTYPE_HASALPHA9(mt) (((mt).subtype==MEDIASUBTYPE_ARGB32_D3D_DX9_RT) || ((mt).subtype==MEDIASUBTYPE_ARGB4444_D3D_DX9_RT) || ((mt).subtype==MEDIASUBTYPE_ARGB1555_D3D_DX9_RT))
|
||||
#define MEDIASUBTYPE_D3D_DX9_RT(mt) (((mt).subtype==MEDIASUBTYPE_ARGB32_D3D_DX9_RT) || ((mt).subtype==MEDIASUBTYPE_ARGB4444_D3D_DX9_RT) || ((mt).subtype==MEDIASUBTYPE_ARGB1555_D3D_DX9_RT) || ((mt).subtype==MEDIASUBTYPE_RGB32_D3D_DX9_RT) || ((mt).subtype==MEDIASUBTYPE_RGB16_D3D_DX9_RT))
|
||||
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_YV12,0x32315659,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_NV12,0x3231564E,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_IMC1,0x31434D49,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_IMC2,0x32434D49,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_IMC3,0x33434D49,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_IMC4,0x34434D49,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_S340,0x30343353,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_S342,0x32343353,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_Overlay,0xe436eb7f,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG1Packet,0xe436eb80,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG1Payload,0xe436eb81,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG1AudioPayload,0x00000050,0x0000,0x0010,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71)
|
||||
OUR_GUID_ENTRY(MEDIATYPE_MPEG1SystemStream,0xe436eb82,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG1System,0xe436eb84,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG1VideoCD,0xe436eb85,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG1Video,0xe436eb86,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG1Audio,0xe436eb87,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_Avi,0xe436eb88,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_Asf,0x3db80f90,0x9412,0x11d1,0xad,0xed,0x0,0x0,0xf8,0x75,0x4b,0x99)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_QTMovie,0xe436eb89,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_QTRpza,0x617a7072,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_QTSmc,0x20636d73,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_QTRle,0x20656c72,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_QTJpeg,0x6765706a,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_PCMAudio_Obsolete,0xe436eb8a,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_PCM,0x00000001,0x0000,0x0010,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_WAVE,0xe436eb8b,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_AU,0xe436eb8c,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_AIFF,0xe436eb8d,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_dvsd,0x64737664,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_dvhd,0x64687664,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_dvsl,0x6c737664,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_dv25,0x35327664,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_dv50,0x30357664,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_dvh1,0x31687664,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_Line21_BytePair,0x6e8d4a22,0x310c,0x11d0,0xb7,0x9a,0x0,0xaa,0x0,0x37,0x67,0xa7)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_Line21_GOPPacket,0x6e8d4a23,0x310c,0x11d0,0xb7,0x9a,0x0,0xaa,0x0,0x37,0x67,0xa7)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_Line21_VBIRawData,0x6e8d4a24,0x310c,0x11d0,0xb7,0x9a,0x0,0xaa,0x0,0x37,0x67,0xa7)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_TELETEXT,0xf72a76e3,0xeb0a,0x11d0,0xac,0xe4,0x00,0x00,0xc0,0xcc,0x16,0xba)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_WSS,0x2791D576,0x8E7A,0x466F,0x9E,0x90,0x5D,0x3F,0x30,0x83,0x73,0x8B)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_VPS,0xa1b3f620,0x9792,0x4d8d,0x81,0xa4,0x86,0xaf,0x25,0x77,0x20,0x90)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_DRM_Audio,0x00000009,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_IEEE_FLOAT,0x00000003,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_DOLBY_AC3_SPDIF,0x00000092,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_RAW_SPORT,0x00000240,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_SPDIF_TAG_241h,0x00000241,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_DssVideo,0xa0af4f81,0xe163,0x11d0,0xba,0xd9,0x0,0x60,0x97,0x44,0x11,0x1a)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_DssAudio,0xa0af4f82,0xe163,0x11d0,0xba,0xd9,0x0,0x60,0x97,0x44,0x11,0x1a)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_VPVideo,0x5a9b6a40,0x1a22,0x11d1,0xba,0xd9,0x0,0x60,0x97,0x44,0x11,0x1a)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_VPVBI,0x5a9b6a41,0x1a22,0x11d1,0xba,0xd9,0x0,0x60,0x97,0x44,0x11,0x1a)
|
||||
OUR_GUID_ENTRY(CLSID_CaptureGraphBuilder,0xBF87B6E0,0x8C27,0x11d0,0xB3,0xF0,0x0,0xAA,0x00,0x37,0x61,0xC5)
|
||||
OUR_GUID_ENTRY(CLSID_CaptureGraphBuilder2,0xBF87B6E1,0x8C27,0x11d0,0xB3,0xF0,0x0,0xAA,0x00,0x37,0x61,0xC5)
|
||||
OUR_GUID_ENTRY(CLSID_ProtoFilterGraph,0xe436ebb0,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
||||
OUR_GUID_ENTRY(CLSID_SystemClock,0xe436ebb1,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
||||
OUR_GUID_ENTRY(CLSID_FilterMapper,0xe436ebb2,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
||||
OUR_GUID_ENTRY(CLSID_FilterGraph,0xe436ebb3,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
||||
OUR_GUID_ENTRY(CLSID_FilterGraphNoThread,0xe436ebb8,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
||||
OUR_GUID_ENTRY(CLSID_MPEG1Doc,0xe4bbd160,0x4269,0x11ce,0x83,0x8d,0x0,0xaa,0x0,0x55,0x59,0x5a)
|
||||
OUR_GUID_ENTRY(CLSID_FileSource,0x701722e0,0x8ae3,0x11ce,0xa8,0x5c,0x00,0xaa,0x00,0x2f,0xea,0xb5)
|
||||
OUR_GUID_ENTRY(CLSID_MPEG1PacketPlayer,0x26c25940,0x4ca9,0x11ce,0xa8,0x28,0x0,0xaa,0x0,0x2f,0xea,0xb5)
|
||||
OUR_GUID_ENTRY(CLSID_MPEG1Splitter,0x336475d0,0x942a,0x11ce,0xa8,0x70,0x00,0xaa,0x00,0x2f,0xea,0xb5)
|
||||
OUR_GUID_ENTRY(CLSID_CMpegVideoCodec,0xfeb50740,0x7bef,0x11ce,0x9b,0xd9,0x0,0x0,0xe2,0x2,0x59,0x9c)
|
||||
OUR_GUID_ENTRY(CLSID_CMpegAudioCodec,0x4a2286e0,0x7bef,0x11ce,0x9b,0xd9,0x0,0x0,0xe2,0x2,0x59,0x9c)
|
||||
OUR_GUID_ENTRY(CLSID_TextRender,0xe30629d3,0x27e5,0x11ce,0x87,0x5d,0x0,0x60,0x8c,0xb7,0x80,0x66)
|
||||
OUR_GUID_ENTRY(CLSID_InfTee,0xf8388a40,0xd5bb,0x11d0,0xbe,0x5a,0x0,0x80,0xc7,0x6,0x56,0x8e)
|
||||
OUR_GUID_ENTRY(CLSID_AviSplitter,0x1b544c20,0xfd0b,0x11ce,0x8c,0x63,0x0,0xaa,0x00,0x44,0xb5,0x1e)
|
||||
OUR_GUID_ENTRY(CLSID_AviReader,0x1b544c21,0xfd0b,0x11ce,0x8c,0x63,0x0,0xaa,0x00,0x44,0xb5,0x1e)
|
||||
OUR_GUID_ENTRY(CLSID_VfwCapture,0x1b544c22,0xfd0b,0x11ce,0x8c,0x63,0x0,0xaa,0x00,0x44,0xb5,0x1e)
|
||||
OUR_GUID_ENTRY(CLSID_CaptureProperties,0x1B544c22,0xFD0B,0x11ce,0x8C,0x63,0x00,0xAA,0x00,0x44,0xB5,0x1F)
|
||||
OUR_GUID_ENTRY(CLSID_FGControl,0xe436ebb4,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
||||
OUR_GUID_ENTRY(CLSID_MOVReader,0x44584800,0xf8ee,0x11ce,0xb2,0xd4,0x00,0xdd,0x1,0x10,0x1b,0x85)
|
||||
OUR_GUID_ENTRY(CLSID_QuickTimeParser,0xd51bd5a0,0x7548,0x11cf,0xa5,0x20,0x0,0x80,0xc7,0x7e,0xf5,0x8a)
|
||||
OUR_GUID_ENTRY(CLSID_QTDec,0xfdfe9681,0x74a3,0x11d0,0xaf,0xa7,0x0,0xaa,0x0,0xb6,0x7a,0x42)
|
||||
OUR_GUID_ENTRY(CLSID_AVIDoc,0xd3588ab0,0x0781,0x11ce,0xb0,0x3a,0x00,0x20,0xaf,0xb,0xa7,0x70)
|
||||
OUR_GUID_ENTRY(CLSID_VideoRenderer,0x70e102b0,0x5556,0x11ce,0x97,0xc0,0x00,0xaa,0x00,0x55,0x59,0x5a)
|
||||
OUR_GUID_ENTRY(CLSID_Colour,0x1643e180,0x90f5,0x11ce,0x97,0xd5,0x00,0xaa,0x00,0x55,0x59,0x5a)
|
||||
OUR_GUID_ENTRY(CLSID_Dither,0x1da08500,0x9edc,0x11cf,0xbc,0x10,0x00,0xaa,0x00,0xac,0x74,0xf6)
|
||||
OUR_GUID_ENTRY(CLSID_ModexRenderer,0x7167665,0x5011,0x11cf,0xbf,0x33,0x0,0xaa,0x0,0x55,0x59,0x5a)
|
||||
OUR_GUID_ENTRY(CLSID_AudioRender,0xe30629d1,0x27e5,0x11ce,0x87,0x5d,0x0,0x60,0x8c,0xb7,0x80,0x66)
|
||||
OUR_GUID_ENTRY(CLSID_AudioProperties,0x05589faf,0xc356,0x11ce,0xbf,0x01,0x0,0xaa,0x0,0x55,0x59,0x5a)
|
||||
OUR_GUID_ENTRY(CLSID_DSoundRender,0x79376820,0x07D0,0x11CF,0xA2,0x4D,0x0,0x20,0xAF,0xD7,0x97,0x67)
|
||||
OUR_GUID_ENTRY(CLSID_AudioRecord,0xe30629d2,0x27e5,0x11ce,0x87,0x5d,0x0,0x60,0x8c,0xb7,0x80,0x66)
|
||||
OUR_GUID_ENTRY(CLSID_AudioInputMixerProperties,0x2ca8ca52,0x3c3f,0x11d2,0xb7,0x3d,0x0,0xc0,0x4f,0xb6,0xbd,0x3d)
|
||||
OUR_GUID_ENTRY(CLSID_AVIDec,0xcf49d4e0,0x1115,0x11ce,0xb0,0x3a,0x0,0x20,0xaf,0xb,0xa7,0x70)
|
||||
OUR_GUID_ENTRY(CLSID_AVIDraw,0xa888df60,0x1e90,0x11cf,0xac,0x98,0x0,0xaa,0x0,0x4c,0xf,0xa9)
|
||||
OUR_GUID_ENTRY(CLSID_ACMWrapper,0x6a08cf80,0x0e18,0x11cf,0xa2,0x4d,0x0,0x20,0xaf,0xd7,0x97,0x67)
|
||||
OUR_GUID_ENTRY(CLSID_AsyncReader,0xe436ebb5,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
||||
OUR_GUID_ENTRY(CLSID_URLReader,0xe436ebb6,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
||||
OUR_GUID_ENTRY(CLSID_PersistMonikerPID,0xe436ebb7,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
||||
OUR_GUID_ENTRY(CLSID_AVICo,0xd76e2820,0x1563,0x11cf,0xac,0x98,0x0,0xaa,0x0,0x4c,0xf,0xa9)
|
||||
OUR_GUID_ENTRY(CLSID_FileWriter,0x8596e5f0,0xda5,0x11d0,0xbd,0x21,0x0,0xa0,0xc9,0x11,0xce,0x86)
|
||||
OUR_GUID_ENTRY(CLSID_AviDest,0xe2510970,0xf137,0x11ce,0x8b,0x67,0x0,0xaa,0x0,0xa3,0xf1,0xa6)
|
||||
OUR_GUID_ENTRY(CLSID_AviMuxProptyPage,0xc647b5c0,0x157c,0x11d0,0xbd,0x23,0x0,0xa0,0xc9,0x11,0xce,0x86)
|
||||
OUR_GUID_ENTRY(CLSID_AviMuxProptyPage1,0xa9ae910,0x85c0,0x11d0,0xbd,0x42,0x0,0xa0,0xc9,0x11,0xce,0x86)
|
||||
OUR_GUID_ENTRY(CLSID_AVIMIDIRender,0x07b65360,0xc445,0x11ce,0xaf,0xde,0x00,0xaa,0x00,0x6c,0x14,0xf4)
|
||||
OUR_GUID_ENTRY(CLSID_WMAsfReader,0x187463a0,0x5bb7,0x11d3,0xac,0xbe,0x0,0x80,0xc7,0x5e,0x24,0x6e)
|
||||
OUR_GUID_ENTRY(CLSID_WMAsfWriter,0x7c23220e,0x55bb,0x11d3,0x8b,0x16,0x0,0xc0,0x4f,0xb6,0xbd,0x3d)
|
||||
OUR_GUID_ENTRY(CLSID_MPEG2Demultiplexer,0xafb6c280,0x2c41,0x11d3,0x8a,0x60,0x00,0x00,0xf8,0x1e,0x0e,0x4a)
|
||||
OUR_GUID_ENTRY(CLSID_MMSPLITTER,0x3ae86b20,0x7be8,0x11d1,0xab,0xe6,0x00,0xa0,0xc9,0x05,0xf3,0x75)
|
||||
OUR_GUID_ENTRY(CLSID_StreamBufferSink,0x2db47ae5,0xcf39,0x43c2,0xb4,0xd6,0xc,0xd8,0xd9,0x9,0x46,0xf4)
|
||||
OUR_GUID_ENTRY(CLSID_StreamBufferSource,0xc9f5fe02,0xf851,0x4eb5,0x99,0xee,0xad,0x60,0x2a,0xf1,0xe6,0x19)
|
||||
OUR_GUID_ENTRY(CLSID_StreamBufferConfig,0xfa8a68b2,0xc864,0x4ba2,0xad,0x53,0xd3,0x87,0x6a,0x87,0x49,0x4b)
|
||||
OUR_GUID_ENTRY(CLSID_Mpeg2VideoStreamAnalyzer,0x6cfad761,0x735d,0x4aa5,0x8a,0xfc,0xaf,0x91,0xa7,0xd6,0x1e,0xba)
|
||||
OUR_GUID_ENTRY(CLSID_StreamBufferRecordingAttributes,0xccaa63ac,0x1057,0x4778,0xae,0x92,0x12,0x6,0xab,0x9a,0xce,0xe6)
|
||||
OUR_GUID_ENTRY(CLSID_StreamBufferComposeRecording,0xd682c4ba,0xa90a,0x42fe,0xb9,0xe1,0x3,0x10,0x98,0x49,0xc4,0x23)
|
||||
OUR_GUID_ENTRY(CLSID_DVVideoCodec,0xb1b77c00,0xc3e4,0x11cf,0xaf,0x79,0x0,0xaa,0x0,0xb6,0x7a,0x42)
|
||||
OUR_GUID_ENTRY(CLSID_DVVideoEnc,0x13aa3650,0xbb6f,0x11d0,0xaf,0xb9,0x0,0xaa,0x0,0xb6,0x7a,0x42)
|
||||
OUR_GUID_ENTRY(CLSID_DVSplitter,0x4eb31670,0x9fc6,0x11cf,0xaf,0x6e,0x0,0xaa,0x0,0xb6,0x7a,0x42)
|
||||
OUR_GUID_ENTRY(CLSID_DVMux,0x129d7e40,0xc10d,0x11d0,0xaf,0xb9,0x0,0xaa,0x0,0xb6,0x7a,0x42)
|
||||
OUR_GUID_ENTRY(CLSID_SeekingPassThru,0x60af76c,0x68dd,0x11d0,0x8f,0xc1,0x0,0xc0,0x4f,0xd9,0x18,0x9d)
|
||||
OUR_GUID_ENTRY(CLSID_Line21Decoder,0x6e8d4a20,0x310c,0x11d0,0xb7,0x9a,0x0,0xaa,0x0,0x37,0x67,0xa7)
|
||||
OUR_GUID_ENTRY(CLSID_Line21Decoder2,0xe4206432,0x01a1,0x4bee,0xb3,0xe1,0x37,0x02,0xc8,0xed,0xc5,0x74)
|
||||
OUR_GUID_ENTRY(CLSID_OverlayMixer,0xcd8743a1,0x3736,0x11d0,0x9e,0x69,0x0,0xc0,0x4f,0xd7,0xc1,0x5b)
|
||||
OUR_GUID_ENTRY(CLSID_VBISurfaces,0x814b9800,0x1c88,0x11d1,0xba,0xd9,0x0,0x60,0x97,0x44,0x11,0x1a)
|
||||
OUR_GUID_ENTRY(CLSID_WSTDecoder,0x70bc06e0,0x5666,0x11d3,0xa1,0x84,0x0,0x10,0x5a,0xef,0x9f,0x33)
|
||||
OUR_GUID_ENTRY(CLSID_MjpegDec,0x301056d0,0x6dff,0x11d2,0x9e,0xeb,0x0,0x60,0x8,0x3,0x9e,0x37)
|
||||
OUR_GUID_ENTRY(CLSID_MJPGEnc,0xb80ab0a0,0x7416,0x11d2,0x9e,0xeb,0x0,0x60,0x8,0x3,0x9e,0x37)
|
||||
OUR_GUID_ENTRY(CLSID_SystemDeviceEnum,0x62BE5D10,0x60EB,0x11d0,0xBD,0x3B,0x00,0xA0,0xC9,0x11,0xCE,0x86)
|
||||
OUR_GUID_ENTRY(CLSID_CDeviceMoniker,0x4315D437,0x5B8C,0x11d0,0xBD,0x3B,0x00,0xA0,0xC9,0x11,0xCE,0x86)
|
||||
OUR_GUID_ENTRY(CLSID_VideoInputDeviceCategory,0x860BB310,0x5D01,0x11d0,0xBD,0x3B,0x00,0xA0,0xC9,0x11,0xCE,0x86)
|
||||
OUR_GUID_ENTRY(CLSID_CVidCapClassManager,0x860BB310,0x5D01,0x11d0,0xBD,0x3B,0x00,0xA0,0xC9,0x11,0xCE,0x86)
|
||||
OUR_GUID_ENTRY(CLSID_LegacyAmFilterCategory,0x083863F1,0x70DE,0x11d0,0xBD,0x40,0x00,0xA0,0xC9,0x11,0xCE,0x86)
|
||||
OUR_GUID_ENTRY(CLSID_CQzFilterClassManager,0x083863F1,0x70DE,0x11d0,0xBD,0x40,0x00,0xA0,0xC9,0x11,0xCE,0x86)
|
||||
OUR_GUID_ENTRY(CLSID_VideoCompressorCategory,0x33d9a760,0x90c8,0x11d0,0xbd,0x43,0x0,0xa0,0xc9,0x11,0xce,0x86)
|
||||
OUR_GUID_ENTRY(CLSID_CIcmCoClassManager,0x33d9a760,0x90c8,0x11d0,0xbd,0x43,0x0,0xa0,0xc9,0x11,0xce,0x86)
|
||||
OUR_GUID_ENTRY(CLSID_AudioCompressorCategory,0x33d9a761,0x90c8,0x11d0,0xbd,0x43,0x0,0xa0,0xc9,0x11,0xce,0x86)
|
||||
OUR_GUID_ENTRY(CLSID_CAcmCoClassManager,0x33d9a761,0x90c8,0x11d0,0xbd,0x43,0x0,0xa0,0xc9,0x11,0xce,0x86)
|
||||
OUR_GUID_ENTRY(CLSID_AudioInputDeviceCategory,0x33d9a762,0x90c8,0x11d0,0xbd,0x43,0x0,0xa0,0xc9,0x11,0xce,0x86)
|
||||
OUR_GUID_ENTRY(CLSID_CWaveinClassManager,0x33d9a762,0x90c8,0x11d0,0xbd,0x43,0x0,0xa0,0xc9,0x11,0xce,0x86)
|
||||
OUR_GUID_ENTRY(CLSID_AudioRendererCategory,0xe0f158e1,0xcb04,0x11d0,0xbd,0x4e,0x0,0xa0,0xc9,0x11,0xce,0x86)
|
||||
OUR_GUID_ENTRY(CLSID_CWaveOutClassManager,0xe0f158e1,0xcb04,0x11d0,0xbd,0x4e,0x0,0xa0,0xc9,0x11,0xce,0x86)
|
||||
OUR_GUID_ENTRY(CLSID_MidiRendererCategory,0x4EfE2452,0x168A,0x11d1,0xBC,0x76,0x0,0xc0,0x4F,0xB9,0x45,0x3B)
|
||||
OUR_GUID_ENTRY(CLSID_CMidiOutClassManager,0x4EfE2452,0x168A,0x11d1,0xBC,0x76,0x0,0xc0,0x4F,0xB9,0x45,0x3B)
|
||||
OUR_GUID_ENTRY(CLSID_TransmitCategory,0xcc7bfb41,0xf175,0x11d1,0xa3,0x92,0x0,0xe0,0x29,0x1f,0x39,0x59)
|
||||
OUR_GUID_ENTRY(CLSID_DeviceControlCategory,0xcc7bfb46,0xf175,0x11d1,0xa3,0x92,0x0,0xe0,0x29,0x1f,0x39,0x59)
|
||||
OUR_GUID_ENTRY(CLSID_ActiveMovieCategories,0xda4e3da0,0xd07d,0x11d0,0xbd,0x50,0x0,0xa0,0xc9,0x11,0xce,0x86)
|
||||
OUR_GUID_ENTRY(CLSID_DVDHWDecodersCategory,0x2721AE20,0x7E70,0x11D0,0xA5,0xD6,0x28,0xDB,0x04,0xC1,0x00,0x00)
|
||||
OUR_GUID_ENTRY(CLSID_MediaEncoderCategory,0x7D22E920,0x5CA9,0x4787,0x8C,0x2B,0xA6,0x77,0x9B,0xD1,0x17,0x81)
|
||||
OUR_GUID_ENTRY(CLSID_MediaMultiplexerCategory,0x236C9559,0xADCE,0x4736,0xBF,0x72,0xBA,0xB3,0x4E,0x39,0x21,0x96)
|
||||
OUR_GUID_ENTRY(CLSID_FilterMapper2,0xcda42200,0xbd88,0x11d0,0xbd,0x4e,0x0,0xa0,0xc9,0x11,0xce,0x86)
|
||||
OUR_GUID_ENTRY(CLSID_MemoryAllocator,0x1e651cc0,0xb199,0x11d0,0x82,0x12,0x00,0xc0,0x4f,0xc3,0x2c,0x45)
|
||||
OUR_GUID_ENTRY(CLSID_MediaPropertyBag,0xcdbd8d00,0xc193,0x11d0,0xbd,0x4e,0x0,0xa0,0xc9,0x11,0xce,0x86)
|
||||
OUR_GUID_ENTRY(CLSID_DvdGraphBuilder,0xFCC152B7,0xF372,0x11d0,0x8E,0x00,0x00,0xC0,0x4F,0xD7,0xC0,0x8B)
|
||||
OUR_GUID_ENTRY(CLSID_DVDNavigator,0x9b8c4620,0x2c1a,0x11d0,0x84,0x93,0x0,0xa0,0x24,0x38,0xad,0x48)
|
||||
OUR_GUID_ENTRY(CLSID_DVDState,0xf963c5cf,0xa659,0x4a93,0x96,0x38,0xca,0xf3,0xcd,0x27,0x7d,0x13)
|
||||
OUR_GUID_ENTRY(CLSID_SmartTee,0xcc58e280,0x8aa1,0x11d1,0xb3,0xf1,0x0,0xaa,0x0,0x37,0x61,0xc5)
|
||||
OUR_GUID_ENTRY(FORMAT_None,0x0F6417D6,0xc318,0x11d0,0xa4,0x3f,0x00,0xa0,0xc9,0x22,0x31,0x96)
|
||||
OUR_GUID_ENTRY(FORMAT_VideoInfo,0x05589f80,0xc356,0x11ce,0xbf,0x01,0x00,0xaa,0x00,0x55,0x59,0x5a)
|
||||
OUR_GUID_ENTRY(FORMAT_VideoInfo2,0xf72a76A0,0xeb0a,0x11d0,0xac,0xe4,0x00,0x00,0xc0,0xcc,0x16,0xba)
|
||||
OUR_GUID_ENTRY(FORMAT_WaveFormatEx,0x05589f81,0xc356,0x11ce,0xbf,0x01,0x00,0xaa,0x00,0x55,0x59,0x5a)
|
||||
OUR_GUID_ENTRY(FORMAT_MPEGVideo,0x05589f82,0xc356,0x11ce,0xbf,0x01,0x00,0xaa,0x00,0x55,0x59,0x5a)
|
||||
OUR_GUID_ENTRY(FORMAT_MPEGStreams,0x05589f83,0xc356,0x11ce,0xbf,0x01,0x00,0xaa,0x00,0x55,0x59,0x5a)
|
||||
OUR_GUID_ENTRY(FORMAT_DvInfo,0x05589f84,0xc356,0x11ce,0xbf,0x01,0x00,0xaa,0x00,0x55,0x59,0x5a)
|
||||
OUR_GUID_ENTRY(CLSID_DirectDrawProperties,0x944d4c00,0xdd52,0x11ce,0xbf,0x0e,0x00,0xaa,0x00,0x55,0x59,0x5a)
|
||||
OUR_GUID_ENTRY(CLSID_PerformanceProperties,0x59ce6880,0xacf8,0x11cf,0xb5,0x6e,0x00,0x80,0xc7,0xc4,0xb6,0x8a)
|
||||
OUR_GUID_ENTRY(CLSID_QualityProperties,0x418afb70,0xf8b8,0x11ce,0xaa,0xc6,0x00,0x20,0xaf,0x0b,0x99,0xa3)
|
||||
OUR_GUID_ENTRY(IID_IBaseVideoMixer,0x61ded640,0xe912,0x11ce,0xa0,0x99,0x00,0xaa,0x00,0x47,0x9a,0x58)
|
||||
OUR_GUID_ENTRY(IID_IDirectDrawVideo,0x36d39eb0,0xdd75,0x11ce,0xbf,0x0e,0x00,0xaa,0x00,0x55,0x59,0x5a)
|
||||
OUR_GUID_ENTRY(IID_IQualProp,0x1bd0ecb0,0xf8e2,0x11ce,0xaa,0xc6,0x00,0x20,0xaf,0x0b,0x99,0xa3)
|
||||
OUR_GUID_ENTRY(CLSID_VPObject,0xce292861,0xfc88,0x11d0,0x9e,0x69,0x0,0xc0,0x4f,0xd7,0xc1,0x5b)
|
||||
OUR_GUID_ENTRY(IID_IVPObject,0xce292862,0xfc88,0x11d0,0x9e,0x69,0x0,0xc0,0x4f,0xd7,0xc1,0x5b)
|
||||
OUR_GUID_ENTRY(IID_IVPControl,0x25df12c1,0x3de0,0x11d1,0x9e,0x69,0x0,0xc0,0x4f,0xd7,0xc1,0x5b)
|
||||
OUR_GUID_ENTRY(CLSID_VPVBIObject,0x814b9801,0x1c88,0x11d1,0xba,0xd9,0x0,0x60,0x97,0x44,0x11,0x1a)
|
||||
OUR_GUID_ENTRY(IID_IVPVBIObject,0x814b9802,0x1c88,0x11d1,0xba,0xd9,0x0,0x60,0x97,0x44,0x11,0x1a)
|
||||
OUR_GUID_ENTRY(IID_IVPConfig,0xbc29a660,0x30e3,0x11d0,0x9e,0x69,0x0,0xc0,0x4f,0xd7,0xc1,0x5b)
|
||||
OUR_GUID_ENTRY(IID_IVPNotify,0xc76794a1,0xd6c5,0x11d0,0x9e,0x69,0x0,0xc0,0x4f,0xd7,0xc1,0x5b)
|
||||
OUR_GUID_ENTRY(IID_IVPNotify2,0xebf47183,0x8764,0x11d1,0x9e,0x69,0x0,0xc0,0x4f,0xd7,0xc1,0x5b)
|
||||
OUR_GUID_ENTRY(IID_IVPVBIConfig,0xec529b00,0x1a1f,0x11d1,0xba,0xd9,0x0,0x60,0x97,0x44,0x11,0x1a)
|
||||
OUR_GUID_ENTRY(IID_IVPVBINotify,0xec529b01,0x1a1f,0x11d1,0xba,0xd9,0x0,0x60,0x97,0x44,0x11,0x1a)
|
||||
OUR_GUID_ENTRY(IID_IMixerPinConfig,0x593cdde1,0x759,0x11d1,0x9e,0x69,0x0,0xc0,0x4f,0xd7,0xc1,0x5b)
|
||||
OUR_GUID_ENTRY(IID_IMixerPinConfig2,0xebf47182,0x8764,0x11d1,0x9e,0x69,0x0,0xc0,0x4f,0xd7,0xc1,0x5b)
|
||||
#ifndef __DDRAW_INCLUDED__
|
||||
OUR_GUID_ENTRY(CLSID_DirectDraw,0xD7B70EE0,0x4340,0x11CF,0xB0,0x63,0x00,0x20,0xAF,0xC2,0xCD,0x35)
|
||||
OUR_GUID_ENTRY(CLSID_DirectDrawClipper,0x593817A0,0x7DB3,0x11CF,0xA2,0xDE,0x00,0xAA,0x00,0xb9,0x33,0x56)
|
||||
OUR_GUID_ENTRY(IID_IDirectDraw,0x6C14DB80,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60)
|
||||
OUR_GUID_ENTRY(IID_IDirectDraw2,0xB3A6F3E0,0x2B43,0x11CF,0xA2,0xDE,0x00,0xAA,0x00,0xB9,0x33,0x56)
|
||||
OUR_GUID_ENTRY(IID_IDirectDrawSurface,0x6C14DB81,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60)
|
||||
OUR_GUID_ENTRY(IID_IDirectDrawSurface2,0x57805885,0x6eec,0x11cf,0x94,0x41,0xa8,0x23,0x03,0xc1,0x0e,0x27)
|
||||
OUR_GUID_ENTRY(IID_IDirectDrawSurface3,0xDA044E00,0x69B2,0x11D0,0xA1,0xD5,0x00,0xAA,0x00,0xB8,0xDF,0xBB)
|
||||
OUR_GUID_ENTRY(IID_IDirectDrawSurface4,0x0B2B8630,0xAD35,0x11D0,0x8E,0xA6,0x00,0x60,0x97,0x97,0xEA,0x5B)
|
||||
OUR_GUID_ENTRY(IID_IDirectDrawSurface7,0x06675a80,0x3b9b,0x11d2,0xb9,0x2f,0x00,0x60,0x97,0x97,0xea,0x5b)
|
||||
OUR_GUID_ENTRY(IID_IDirectDrawPalette,0x6C14DB84,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60)
|
||||
OUR_GUID_ENTRY(IID_IDirectDrawClipper,0x6C14DB85,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60)
|
||||
OUR_GUID_ENTRY(IID_IDirectDrawColorControl,0x4B9F0EE0,0x0D7E,0x11D0,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8)
|
||||
#endif
|
||||
#ifndef __DVP_INCLUDED__
|
||||
OUR_GUID_ENTRY(IID_IDDVideoPortContainer,0x6C142760,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60)
|
||||
#endif
|
||||
#ifndef __DDKM_INCLUDED__
|
||||
OUR_GUID_ENTRY(IID_IDirectDrawKernel,0x8D56C120,0x6A08,0x11D0,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8)
|
||||
OUR_GUID_ENTRY(IID_IDirectDrawSurfaceKernel,0x60755DA0,0x6A40,0x11D0,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8)
|
||||
#endif
|
||||
OUR_GUID_ENTRY(CLSID_ModexProperties,0x0618aa30,0x6bc4,0x11cf,0xbf,0x36,0x00,0xaa,0x00,0x55,0x59,0x5a)
|
||||
OUR_GUID_ENTRY(IID_IFullScreenVideo,0xdd1d7110,0x7836,0x11cf,0xbf,0x47,0x00,0xaa,0x00,0x55,0x59,0x5a)
|
||||
OUR_GUID_ENTRY(IID_IFullScreenVideoEx,0x53479470,0xf1dd,0x11cf,0xbc,0x42,0x00,0xaa,0x00,0xac,0x74,0xf6)
|
||||
OUR_GUID_ENTRY(CLSID_DVDecPropertiesPage,0x101193c0,0xbfe,0x11d0,0xaf,0x91,0x0,0xaa,0x0,0xb6,0x7a,0x42)
|
||||
OUR_GUID_ENTRY(CLSID_DVEncPropertiesPage,0x4150f050,0xbb6f,0x11d0,0xaf,0xb9,0x0,0xaa,0x0,0xb6,0x7a,0x42)
|
||||
OUR_GUID_ENTRY(CLSID_DVMuxPropertyPage,0x4db880e0,0xc10d,0x11d0,0xaf,0xb9,0x0,0xaa,0x0,0xb6,0x7a,0x42)
|
||||
OUR_GUID_ENTRY(IID_IAMDirectSound,0x546f4260,0xd53e,0x11cf,0xb3,0xf0,0x0,0xaa,0x0,0x37,0x61,0xc5)
|
||||
OUR_GUID_ENTRY(IID_IMpegAudioDecoder,0xb45dd570,0x3c77,0x11d1,0xab,0xe1,0x00,0xa0,0xc9,0x05,0xf3,0x75)
|
||||
OUR_GUID_ENTRY(IID_IAMLine21Decoder,0x6e8d4a21,0x310c,0x11d0,0xb7,0x9a,0x0,0xaa,0x0,0x37,0x67,0xa7)
|
||||
OUR_GUID_ENTRY(IID_IAMWstDecoder,0xc056de21,0x75c2,0x11d3,0xa1,0x84,0x0,0x10,0x5a,0xef,0x9f,0x33)
|
||||
OUR_GUID_ENTRY(CLSID_WstDecoderPropertyPage,0x4e27f80,0x91e4,0x11d3,0xa1,0x84,0x0,0x10,0x5a,0xef,0x9f,0x33)
|
||||
OUR_GUID_ENTRY(FORMAT_AnalogVideo,0x482dde0,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
|
||||
OUR_GUID_ENTRY(MEDIATYPE_AnalogVideo,0x482dde1,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_NTSC_M,0x482dde2,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_PAL_B,0x482dde5,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_PAL_D,0x482dde6,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_PAL_G,0x482dde7,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_PAL_H,0x482dde8,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_PAL_I,0x482dde9,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_PAL_M,0x482ddea,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_PAL_N,0x482ddeb,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_PAL_N_COMBO,0x482ddec,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_SECAM_B,0x482ddf0,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_SECAM_D,0x482ddf1,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_SECAM_G,0x482ddf2,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_SECAM_H,0x482ddf3,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_SECAM_K,0x482ddf4,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_SECAM_K1,0x482ddf5,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_SECAM_L,0x482ddf6,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
|
||||
OUR_GUID_ENTRY(MEDIATYPE_AnalogAudio,0x482dee1,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
|
||||
|
||||
#include "dshow/ksuuids.h"
|
||||
|
||||
OUR_GUID_ENTRY(TIME_FORMAT_NONE,0L,0,0,0,0,0,0,0,0,0,0)
|
||||
OUR_GUID_ENTRY(TIME_FORMAT_FRAME,0x7b785570,0x8c82,0x11cf,0xbc,0xc,0x0,0xaa,0x0,0xac,0x74,0xf6)
|
||||
OUR_GUID_ENTRY(TIME_FORMAT_BYTE,0x7b785571,0x8c82,0x11cf,0xbc,0xc,0x0,0xaa,0x0,0xac,0x74,0xf6)
|
||||
OUR_GUID_ENTRY(TIME_FORMAT_SAMPLE,0x7b785572,0x8c82,0x11cf,0xbc,0xc,0x0,0xaa,0x0,0xac,0x74,0xf6)
|
||||
OUR_GUID_ENTRY(TIME_FORMAT_FIELD,0x7b785573,0x8c82,0x11cf,0xbc,0xc,0x0,0xaa,0x0,0xac,0x74,0xf6)
|
||||
OUR_GUID_ENTRY(TIME_FORMAT_MEDIA_TIME,0x7b785574,0x8c82,0x11cf,0xbc,0xc,0x0,0xaa,0x0,0xac,0x74,0xf6)
|
||||
OUR_GUID_ENTRY(AMPROPSETID_Pin,0x9b00f101,0x1567,0x11d1,0xb3,0xf1,0x0,0xaa,0x0,0x37,0x61,0xc5)
|
||||
OUR_GUID_ENTRY(PIN_CATEGORY_CAPTURE,0xfb6c4281,0x0353,0x11d1,0x90,0x5f,0x00,0x00,0xc0,0xcc,0x16,0xba)
|
||||
OUR_GUID_ENTRY(PIN_CATEGORY_PREVIEW,0xfb6c4282,0x0353,0x11d1,0x90,0x5f,0x00,0x00,0xc0,0xcc,0x16,0xba)
|
||||
OUR_GUID_ENTRY(PIN_CATEGORY_ANALOGVIDEOIN,0xfb6c4283,0x0353,0x11d1,0x90,0x5f,0x00,0x00,0xc0,0xcc,0x16,0xba)
|
||||
OUR_GUID_ENTRY(PIN_CATEGORY_VBI,0xfb6c4284,0x0353,0x11d1,0x90,0x5f,0x00,0x00,0xc0,0xcc,0x16,0xba)
|
||||
OUR_GUID_ENTRY(PIN_CATEGORY_VIDEOPORT,0xfb6c4285,0x0353,0x11d1,0x90,0x5f,0x00,0x00,0xc0,0xcc,0x16,0xba)
|
||||
OUR_GUID_ENTRY(PIN_CATEGORY_NABTS,0xfb6c4286,0x0353,0x11d1,0x90,0x5f,0x00,0x00,0xc0,0xcc,0x16,0xba)
|
||||
OUR_GUID_ENTRY(PIN_CATEGORY_EDS,0xfb6c4287,0x0353,0x11d1,0x90,0x5f,0x00,0x00,0xc0,0xcc,0x16,0xba)
|
||||
OUR_GUID_ENTRY(PIN_CATEGORY_TELETEXT,0xfb6c4288,0x0353,0x11d1,0x90,0x5f,0x00,0x00,0xc0,0xcc,0x16,0xba)
|
||||
OUR_GUID_ENTRY(PIN_CATEGORY_CC,0xfb6c4289,0x0353,0x11d1,0x90,0x5f,0x00,0x00,0xc0,0xcc,0x16,0xba)
|
||||
OUR_GUID_ENTRY(PIN_CATEGORY_STILL,0xfb6c428a,0x0353,0x11d1,0x90,0x5f,0x00,0x00,0xc0,0xcc,0x16,0xba)
|
||||
OUR_GUID_ENTRY(PIN_CATEGORY_TIMECODE,0xfb6c428b,0x0353,0x11d1,0x90,0x5f,0x00,0x00,0xc0,0xcc,0x16,0xba)
|
||||
OUR_GUID_ENTRY(PIN_CATEGORY_VIDEOPORT_VBI,0xfb6c428c,0x0353,0x11d1,0x90,0x5f,0x00,0x00,0xc0,0xcc,0x16,0xba)
|
||||
OUR_GUID_ENTRY(LOOK_UPSTREAM_ONLY,0xac798be0,0x98e3,0x11d1,0xb3,0xf1,0x0,0xaa,0x0,0x37,0x61,0xc5)
|
||||
OUR_GUID_ENTRY(LOOK_DOWNSTREAM_ONLY,0xac798be1,0x98e3,0x11d1,0xb3,0xf1,0x0,0xaa,0x0,0x37,0x61,0xc5)
|
||||
OUR_GUID_ENTRY(CLSID_TVTunerFilterPropertyPage,0x266eee41,0x6c63,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
|
||||
OUR_GUID_ENTRY(CLSID_CrossbarFilterPropertyPage,0x71f96461,0x78f3,0x11d0,0xa1,0x8c,0x0,0xa0,0xc9,0x11,0x89,0x56)
|
||||
OUR_GUID_ENTRY(CLSID_TVAudioFilterPropertyPage,0x71f96463,0x78f3,0x11d0,0xa1,0x8c,0x0,0xa0,0xc9,0x11,0x89,0x56)
|
||||
OUR_GUID_ENTRY(CLSID_VideoProcAmpPropertyPage,0x71f96464,0x78f3,0x11d0,0xa1,0x8c,0x0,0xa0,0xc9,0x11,0x89,0x56)
|
||||
OUR_GUID_ENTRY(CLSID_CameraControlPropertyPage,0x71f96465,0x78f3,0x11d0,0xa1,0x8c,0x0,0xa0,0xc9,0x11,0x89,0x56)
|
||||
OUR_GUID_ENTRY(CLSID_AnalogVideoDecoderPropertyPage,0x71f96466,0x78f3,0x11d0,0xa1,0x8c,0x0,0xa0,0xc9,0x11,0x89,0x56)
|
||||
OUR_GUID_ENTRY(CLSID_VideoStreamConfigPropertyPage,0x71f96467,0x78f3,0x11d0,0xa1,0x8c,0x0,0xa0,0xc9,0x11,0x89,0x56)
|
||||
OUR_GUID_ENTRY(CLSID_AudioRendererAdvancedProperties,0x37e92a92,0xd9aa,0x11d2,0xbf,0x84,0x8e,0xf2,0xb1,0x55,0x5a,0xed)
|
||||
OUR_GUID_ENTRY(CLSID_VideoMixingRenderer,0xB87BEB7B,0x8D29,0x423f,0xAE,0x4D,0x65,0x82,0xC1,0x01,0x75,0xAC)
|
||||
OUR_GUID_ENTRY(CLSID_VideoRendererDefault,0x6BC1CFFA,0x8FC1,0x4261,0xAC,0x22,0xCF,0xB4,0xCC,0x38,0xDB,0x50)
|
||||
OUR_GUID_ENTRY(CLSID_AllocPresenter,0x99d54f63,0x1a69,0x41ae,0xaa,0x4d,0xc9,0x76,0xeb,0x3f,0x07,0x13)
|
||||
OUR_GUID_ENTRY(CLSID_AllocPresenterDDXclMode,0x4444ac9e,0x242e,0x471b,0xa3,0xc7,0x45,0xdc,0xd4,0x63,0x52,0xbc)
|
||||
OUR_GUID_ENTRY(CLSID_VideoPortManager,0x6f26a6cd,0x967b,0x47fd,0x87,0x4a,0x7a,0xed,0x2c,0x9d,0x25,0xa2)
|
||||
OUR_GUID_ENTRY(CLSID_VideoMixingRenderer9,0x51b4abf3,0x748f,0x4e3b,0xa2,0x76,0xc8,0x28,0x33,0x0e,0x92,0x6a)
|
||||
OUR_GUID_ENTRY(CLSID_ATSCNetworkProvider,0x0dad2fdd,0x5fd7,0x11d3,0x8f,0x50,0x00,0xc0,0x4f,0x79,0x71,0xe2)
|
||||
OUR_GUID_ENTRY(CLSID_ATSCNetworkPropertyPage,0xe3444d16,0x5ac4,0x4386,0x88,0xdf,0x13,0xfd,0x23,0x0e,0x1d,0xda)
|
||||
OUR_GUID_ENTRY(CLSID_DVBSNetworkProvider,0xfa4b375a,0x45b4,0x4d45,0x84,0x40,0x26,0x39,0x57,0xb1,0x16,0x23)
|
||||
OUR_GUID_ENTRY(CLSID_DVBTNetworkProvider,0x216c62df,0x6d7f,0x4e9a,0x85,0x71,0x5,0xf1,0x4e,0xdb,0x76,0x6a)
|
||||
OUR_GUID_ENTRY(CLSID_DVBCNetworkProvider,0xdc0c0fe7,0x485,0x4266,0xb9,0x3f,0x68,0xfb,0xf8,0xe,0xd8,0x34)
|
||||
OUR_GUID_ENTRY(CLSID_DShowTVEFilter,0x05500280,0xFAA5,0x4DF9,0x82,0x46,0xBF,0xC2,0x3A,0xC5,0xCE,0xA8)
|
||||
OUR_GUID_ENTRY(CLSID_TVEFilterTuneProperties,0x05500281,0xFAA5,0x4DF9,0x82,0x46,0xBF,0xC2,0x3A,0xC5,0xCE,0xA8)
|
||||
OUR_GUID_ENTRY(CLSID_TVEFilterCCProperties,0x05500282,0xFAA5,0x4DF9,0x82,0x46,0xBF,0xC2,0x3A,0xC5,0xCE,0xA8)
|
||||
OUR_GUID_ENTRY(CLSID_TVEFilterStatsProperties,0x05500283,0xFAA5,0x4DF9,0x82,0x46,0xBF,0xC2,0x3A,0xC5,0xCE,0xA8)
|
||||
OUR_GUID_ENTRY(CLSID_IVideoEncoderProxy,0xb43c4eec,0x8c32,0x4791,0x91,0x2,0x50,0x8a,0xda,0x5e,0xe8,0xe7)
|
||||
OUR_GUID_ENTRY(CLSID_ICodecAPIProxy,0x7ff0997a,0x1999,0x4286,0xa7,0x3c,0x62,0x2b,0x88,0x14,0xe7,0xeb)
|
||||
OUR_GUID_ENTRY(CLSID_IVideoEncoderCodecAPIProxy,0xb05dabd9,0x56e5,0x4fdc,0xaf,0xa4,0x8a,0x47,0xe9,0x1f,0x1c,0x9c)
|
||||
|
||||
#ifndef __ENCODER_API_GUIDS__
|
||||
#define __ENCODER_API_GUIDS__
|
||||
OUR_GUID_ENTRY(ENCAPIPARAM_BITRATE,0x49cc4c43,0xca83,0x4ad4,0xa9,0xaf,0xf3,0x69,0x6a,0xf6,0x66,0xdf)
|
||||
OUR_GUID_ENTRY(ENCAPIPARAM_PEAK_BITRATE,0x703f16a9,0x3d48,0x44a1,0xb0,0x77,0x1,0x8d,0xff,0x91,0x5d,0x19)
|
||||
OUR_GUID_ENTRY(ENCAPIPARAM_BITRATE_MODE,0xee5fb25c,0xc713,0x40d1,0x9d,0x58,0xc0,0xd7,0x24,0x1e,0x25,0xf)
|
||||
OUR_GUID_ENTRY(CODECAPI_CHANGELISTS,0x62b12acf,0xf6b0,0x47d9,0x94,0x56,0x96,0xf2,0x2c,0x4e,0x0b,0x9d)
|
||||
OUR_GUID_ENTRY(CODECAPI_VIDEO_ENCODER,0x7112e8e1,0x3d03,0x47ef,0x8e,0x60,0x03,0xf1,0xcf,0x53,0x73,0x01)
|
||||
OUR_GUID_ENTRY(CODECAPI_AUDIO_ENCODER,0xb9d19a3e,0xf897,0x429c,0xbc,0x46,0x81,0x38,0xb7,0x27,0x2b,0x2d)
|
||||
OUR_GUID_ENTRY(CODECAPI_SETALLDEFAULTS,0x6c5e6a7c,0xacf8,0x4f55,0xa9,0x99,0x1a,0x62,0x81,0x09,0x05,0x1b)
|
||||
OUR_GUID_ENTRY(CODECAPI_ALLSETTINGS,0x6a577e92,0x83e1,0x4113,0xad,0xc2,0x4f,0xce,0xc3,0x2f,0x83,0xa1)
|
||||
OUR_GUID_ENTRY(CODECAPI_SUPPORTSEVENTS,0x0581af97,0x7693,0x4dbd,0x9d,0xca,0x3f,0x9e,0xbd,0x65,0x85,0xa1)
|
||||
OUR_GUID_ENTRY(CODECAPI_CURRENTCHANGELIST,0x1cb14e83,0x7d72,0x4657,0x83,0xfd,0x47,0xa2,0xc5,0xb9,0xd1,0x3d)
|
||||
#endif
|
||||
|
||||
#undef OUR_GUID_ENTRY
|
||||
Vendored
-301
@@ -1,301 +0,0 @@
|
||||
// ISO C9x compliant inttypes.h for Microsoft Visual Studio
|
||||
// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124
|
||||
//
|
||||
// Copyright (c) 2006 Alexander Chemeris
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are met:
|
||||
//
|
||||
// 1. Redistributions of source code must retain the above copyright notice,
|
||||
// this list of conditions and the following disclaimer.
|
||||
//
|
||||
// 2. Redistributions in binary form must reproduce the above copyright
|
||||
// notice, this list of conditions and the following disclaimer in the
|
||||
// documentation and/or other materials provided with the distribution.
|
||||
//
|
||||
// 3. The name of the author may be used to endorse or promote products
|
||||
// derived from this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 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.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _MSC_VER // [
|
||||
#error "Use this header only with Microsoft Visual C++ compilers!"
|
||||
#endif // _MSC_VER ]
|
||||
|
||||
#ifndef _MSC_INTTYPES_H_ // [
|
||||
#define _MSC_INTTYPES_H_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include <msc_stdint.h>
|
||||
|
||||
// 7.8 Format conversion of integer types
|
||||
|
||||
typedef struct {
|
||||
intmax_t quot;
|
||||
intmax_t rem;
|
||||
} imaxdiv_t;
|
||||
|
||||
// 7.8.1 Macros for format specifiers
|
||||
|
||||
// The fprintf macros for signed integers are:
|
||||
#define PRId8 "d"
|
||||
#define PRIi8 "i"
|
||||
#define PRIdLEAST8 "d"
|
||||
#define PRIiLEAST8 "i"
|
||||
#define PRIdFAST8 "d"
|
||||
#define PRIiFAST8 "i"
|
||||
|
||||
#define PRId16 "hd"
|
||||
#define PRIi16 "hi"
|
||||
#define PRIdLEAST16 "hd"
|
||||
#define PRIiLEAST16 "hi"
|
||||
#define PRIdFAST16 "hd"
|
||||
#define PRIiFAST16 "hi"
|
||||
|
||||
#define PRId32 "I32d"
|
||||
#define PRIi32 "I32i"
|
||||
#define PRIdLEAST32 "I32d"
|
||||
#define PRIiLEAST32 "I32i"
|
||||
#define PRIdFAST32 "I32d"
|
||||
#define PRIiFAST32 "I32i"
|
||||
|
||||
#define PRId64 "I64d"
|
||||
#define PRIi64 "I64i"
|
||||
#define PRIdLEAST64 "I64d"
|
||||
#define PRIiLEAST64 "I64i"
|
||||
#define PRIdFAST64 "I64d"
|
||||
#define PRIiFAST64 "I64i"
|
||||
|
||||
#define PRIdMAX "I64d"
|
||||
#define PRIiMAX "I64i"
|
||||
|
||||
#define PRIdPTR "Id"
|
||||
#define PRIiPTR "Ii"
|
||||
|
||||
// The fprintf macros for unsigned integers are:
|
||||
#define PRIo8 "o"
|
||||
#define PRIu8 "u"
|
||||
#define PRIx8 "x"
|
||||
#define PRIX8 "X"
|
||||
#define PRIoLEAST8 "o"
|
||||
#define PRIuLEAST8 "u"
|
||||
#define PRIxLEAST8 "x"
|
||||
#define PRIXLEAST8 "X"
|
||||
#define PRIoFAST8 "o"
|
||||
#define PRIuFAST8 "u"
|
||||
#define PRIxFAST8 "x"
|
||||
#define PRIXFAST8 "X"
|
||||
|
||||
#define PRIo16 "ho"
|
||||
#define PRIu16 "hu"
|
||||
#define PRIx16 "hx"
|
||||
#define PRIX16 "hX"
|
||||
#define PRIoLEAST16 "ho"
|
||||
#define PRIuLEAST16 "hu"
|
||||
#define PRIxLEAST16 "hx"
|
||||
#define PRIXLEAST16 "hX"
|
||||
#define PRIoFAST16 "ho"
|
||||
#define PRIuFAST16 "hu"
|
||||
#define PRIxFAST16 "hx"
|
||||
#define PRIXFAST16 "hX"
|
||||
|
||||
#define PRIo32 "I32o"
|
||||
#define PRIu32 "I32u"
|
||||
#define PRIx32 "I32x"
|
||||
#define PRIX32 "I32X"
|
||||
#define PRIoLEAST32 "I32o"
|
||||
#define PRIuLEAST32 "I32u"
|
||||
#define PRIxLEAST32 "I32x"
|
||||
#define PRIXLEAST32 "I32X"
|
||||
#define PRIoFAST32 "I32o"
|
||||
#define PRIuFAST32 "I32u"
|
||||
#define PRIxFAST32 "I32x"
|
||||
#define PRIXFAST32 "I32X"
|
||||
|
||||
#define PRIo64 "I64o"
|
||||
#define PRIu64 "I64u"
|
||||
#define PRIx64 "I64x"
|
||||
#define PRIX64 "I64X"
|
||||
#define PRIoLEAST64 "I64o"
|
||||
#define PRIuLEAST64 "I64u"
|
||||
#define PRIxLEAST64 "I64x"
|
||||
#define PRIXLEAST64 "I64X"
|
||||
#define PRIoFAST64 "I64o"
|
||||
#define PRIuFAST64 "I64u"
|
||||
#define PRIxFAST64 "I64x"
|
||||
#define PRIXFAST64 "I64X"
|
||||
|
||||
#define PRIoMAX "I64o"
|
||||
#define PRIuMAX "I64u"
|
||||
#define PRIxMAX "I64x"
|
||||
#define PRIXMAX "I64X"
|
||||
|
||||
#define PRIoPTR "Io"
|
||||
#define PRIuPTR "Iu"
|
||||
#define PRIxPTR "Ix"
|
||||
#define PRIXPTR "IX"
|
||||
|
||||
// The fscanf macros for signed integers are:
|
||||
#define SCNd8 "d"
|
||||
#define SCNi8 "i"
|
||||
#define SCNdLEAST8 "d"
|
||||
#define SCNiLEAST8 "i"
|
||||
#define SCNdFAST8 "d"
|
||||
#define SCNiFAST8 "i"
|
||||
|
||||
#define SCNd16 "hd"
|
||||
#define SCNi16 "hi"
|
||||
#define SCNdLEAST16 "hd"
|
||||
#define SCNiLEAST16 "hi"
|
||||
#define SCNdFAST16 "hd"
|
||||
#define SCNiFAST16 "hi"
|
||||
|
||||
#define SCNd32 "ld"
|
||||
#define SCNi32 "li"
|
||||
#define SCNdLEAST32 "ld"
|
||||
#define SCNiLEAST32 "li"
|
||||
#define SCNdFAST32 "ld"
|
||||
#define SCNiFAST32 "li"
|
||||
|
||||
#define SCNd64 "I64d"
|
||||
#define SCNi64 "I64i"
|
||||
#define SCNdLEAST64 "I64d"
|
||||
#define SCNiLEAST64 "I64i"
|
||||
#define SCNdFAST64 "I64d"
|
||||
#define SCNiFAST64 "I64i"
|
||||
|
||||
#define SCNdMAX "I64d"
|
||||
#define SCNiMAX "I64i"
|
||||
|
||||
#ifdef _WIN64 // [
|
||||
# define SCNdPTR "I64d"
|
||||
# define SCNiPTR "I64i"
|
||||
#else // _WIN64 ][
|
||||
# define SCNdPTR "ld"
|
||||
# define SCNiPTR "li"
|
||||
#endif // _WIN64 ]
|
||||
|
||||
// The fscanf macros for unsigned integers are:
|
||||
#define SCNo8 "o"
|
||||
#define SCNu8 "u"
|
||||
#define SCNx8 "x"
|
||||
#define SCNX8 "X"
|
||||
#define SCNoLEAST8 "o"
|
||||
#define SCNuLEAST8 "u"
|
||||
#define SCNxLEAST8 "x"
|
||||
#define SCNXLEAST8 "X"
|
||||
#define SCNoFAST8 "o"
|
||||
#define SCNuFAST8 "u"
|
||||
#define SCNxFAST8 "x"
|
||||
#define SCNXFAST8 "X"
|
||||
|
||||
#define SCNo16 "ho"
|
||||
#define SCNu16 "hu"
|
||||
#define SCNx16 "hx"
|
||||
#define SCNX16 "hX"
|
||||
#define SCNoLEAST16 "ho"
|
||||
#define SCNuLEAST16 "hu"
|
||||
#define SCNxLEAST16 "hx"
|
||||
#define SCNXLEAST16 "hX"
|
||||
#define SCNoFAST16 "ho"
|
||||
#define SCNuFAST16 "hu"
|
||||
#define SCNxFAST16 "hx"
|
||||
#define SCNXFAST16 "hX"
|
||||
|
||||
#define SCNo32 "lo"
|
||||
#define SCNu32 "lu"
|
||||
#define SCNx32 "lx"
|
||||
#define SCNX32 "lX"
|
||||
#define SCNoLEAST32 "lo"
|
||||
#define SCNuLEAST32 "lu"
|
||||
#define SCNxLEAST32 "lx"
|
||||
#define SCNXLEAST32 "lX"
|
||||
#define SCNoFAST32 "lo"
|
||||
#define SCNuFAST32 "lu"
|
||||
#define SCNxFAST32 "lx"
|
||||
#define SCNXFAST32 "lX"
|
||||
|
||||
#define SCNo64 "I64o"
|
||||
#define SCNu64 "I64u"
|
||||
#define SCNx64 "I64x"
|
||||
#define SCNX64 "I64X"
|
||||
#define SCNoLEAST64 "I64o"
|
||||
#define SCNuLEAST64 "I64u"
|
||||
#define SCNxLEAST64 "I64x"
|
||||
#define SCNXLEAST64 "I64X"
|
||||
#define SCNoFAST64 "I64o"
|
||||
#define SCNuFAST64 "I64u"
|
||||
#define SCNxFAST64 "I64x"
|
||||
#define SCNXFAST64 "I64X"
|
||||
|
||||
#define SCNoMAX "I64o"
|
||||
#define SCNuMAX "I64u"
|
||||
#define SCNxMAX "I64x"
|
||||
#define SCNXMAX "I64X"
|
||||
|
||||
#ifdef _WIN64 // [
|
||||
# define SCNoPTR "I64o"
|
||||
# define SCNuPTR "I64u"
|
||||
# define SCNxPTR "I64x"
|
||||
# define SCNXPTR "I64X"
|
||||
#else // _WIN64 ][
|
||||
# define SCNoPTR "lo"
|
||||
# define SCNuPTR "lu"
|
||||
# define SCNxPTR "lx"
|
||||
# define SCNXPTR "lX"
|
||||
#endif // _WIN64 ]
|
||||
|
||||
// 7.8.2 Functions for greatest-width integer types
|
||||
|
||||
// 7.8.2.1 The imaxabs function
|
||||
#define imaxabs _abs64
|
||||
|
||||
// 7.8.2.2 The imaxdiv function
|
||||
|
||||
// This is modified version of div() function from Microsoft's div.c found
|
||||
// in %MSVC.NET%\crt\src\div.c
|
||||
#ifdef STATIC_IMAXDIV // [
|
||||
static
|
||||
#else // STATIC_IMAXDIV ][
|
||||
_inline
|
||||
#endif // STATIC_IMAXDIV ]
|
||||
imaxdiv_t __cdecl imaxdiv(intmax_t numer, intmax_t denom)
|
||||
{
|
||||
imaxdiv_t result;
|
||||
|
||||
result.quot = numer / denom;
|
||||
result.rem = numer % denom;
|
||||
|
||||
if (numer < 0 && result.rem > 0) {
|
||||
// did division wrong; must fix up
|
||||
++result.quot;
|
||||
result.rem -= denom;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
// 7.8.2.3 The strtoimax and strtoumax functions
|
||||
#define strtoimax _strtoi64
|
||||
#define strtoumax _strtoui64
|
||||
|
||||
// 7.8.2.4 The wcstoimax and wcstoumax functions
|
||||
#define wcstoimax _wcstoi64
|
||||
#define wcstoumax _wcstoui64
|
||||
|
||||
|
||||
#endif // _MSC_INTTYPES_H_ ]
|
||||
Vendored
-219
@@ -1,219 +0,0 @@
|
||||
// ISO C9x compliant stdint.h for Microsoft Visual Studio
|
||||
// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124
|
||||
//
|
||||
// Copyright (c) 2006 Alexander Chemeris
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are met:
|
||||
//
|
||||
// 1. Redistributions of source code must retain the above copyright notice,
|
||||
// this list of conditions and the following disclaimer.
|
||||
//
|
||||
// 2. Redistributions in binary form must reproduce the above copyright
|
||||
// notice, this list of conditions and the following disclaimer in the
|
||||
// documentation and/or other materials provided with the distribution.
|
||||
//
|
||||
// 3. The name of the author may be used to endorse or promote products
|
||||
// derived from this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 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.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _MSC_STDINT_H_ // [
|
||||
#define _MSC_STDINT_H_
|
||||
|
||||
#include <limits.h>
|
||||
|
||||
// For Visual Studio 6 in C++ mode wrap <wchar.h> include with 'extern "C++" {}'
|
||||
// or compiler give many errors like this:
|
||||
// error C2733: second C linkage of overloaded function 'wmemchr' not allowed
|
||||
#if (_MSC_VER < 1300) && defined(__cplusplus)
|
||||
extern "C++" {
|
||||
#endif
|
||||
# include <wchar.h>
|
||||
#if (_MSC_VER < 1300) && defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined __GNUC__ || _MSC_VER >= 1600
|
||||
#include "stdint.h"
|
||||
#else
|
||||
|
||||
// 7.18.1 Integer types
|
||||
|
||||
// 7.18.1.1 Exact-width integer types
|
||||
typedef __int8 int8_t;
|
||||
typedef __int16 int16_t;
|
||||
typedef __int32 int32_t;
|
||||
typedef __int64 int64_t;
|
||||
typedef unsigned __int8 uint8_t;
|
||||
typedef unsigned __int16 uint16_t;
|
||||
typedef unsigned __int32 uint32_t;
|
||||
typedef unsigned __int64 uint64_t;
|
||||
|
||||
// 7.18.1.2 Minimum-width integer types
|
||||
typedef int8_t int_least8_t;
|
||||
typedef int16_t int_least16_t;
|
||||
typedef int32_t int_least32_t;
|
||||
typedef int64_t int_least64_t;
|
||||
typedef uint8_t uint_least8_t;
|
||||
typedef uint16_t uint_least16_t;
|
||||
typedef uint32_t uint_least32_t;
|
||||
typedef uint64_t uint_least64_t;
|
||||
|
||||
// 7.18.1.3 Fastest minimum-width integer types
|
||||
typedef int8_t int_fast8_t;
|
||||
typedef int16_t int_fast16_t;
|
||||
typedef int32_t int_fast32_t;
|
||||
typedef int64_t int_fast64_t;
|
||||
typedef uint8_t uint_fast8_t;
|
||||
typedef uint16_t uint_fast16_t;
|
||||
typedef uint32_t uint_fast32_t;
|
||||
typedef uint64_t uint_fast64_t;
|
||||
|
||||
// 7.18.1.4 Integer types capable of holding object pointers
|
||||
#ifdef _WIN64 // [
|
||||
typedef __int64 intptr_t;
|
||||
typedef unsigned __int64 uintptr_t;
|
||||
#else // _WIN64 ][
|
||||
typedef int intptr_t;
|
||||
typedef unsigned int uintptr_t;
|
||||
#endif // _WIN64 ]
|
||||
|
||||
// 7.18.1.5 Greatest-width integer types
|
||||
typedef int64_t intmax_t;
|
||||
typedef uint64_t uintmax_t;
|
||||
|
||||
|
||||
// 7.18.2 Limits of specified-width integer types
|
||||
|
||||
#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) // [ See footnote 220 at page 257 and footnote 221 at page 259
|
||||
|
||||
// 7.18.2.1 Limits of exact-width integer types
|
||||
#define INT8_MIN _I8_MIN
|
||||
#define INT8_MAX _I8_MAX
|
||||
#define INT16_MIN _I16_MIN
|
||||
#define INT16_MAX _I16_MAX
|
||||
#define INT32_MIN _I32_MIN
|
||||
#define INT32_MAX _I32_MAX
|
||||
#define INT64_MIN _I64_MIN
|
||||
#define INT64_MAX _I64_MAX
|
||||
#define UINT8_MAX _UI8_MAX
|
||||
#define UINT16_MAX _UI16_MAX
|
||||
#define UINT32_MAX _UI32_MAX
|
||||
#define UINT64_MAX _UI64_MAX
|
||||
|
||||
// 7.18.2.2 Limits of minimum-width integer types
|
||||
#define INT_LEAST8_MIN INT8_MIN
|
||||
#define INT_LEAST8_MAX INT8_MAX
|
||||
#define INT_LEAST16_MIN INT16_MIN
|
||||
#define INT_LEAST16_MAX INT16_MAX
|
||||
#define INT_LEAST32_MIN INT32_MIN
|
||||
#define INT_LEAST32_MAX INT32_MAX
|
||||
#define INT_LEAST64_MIN INT64_MIN
|
||||
#define INT_LEAST64_MAX INT64_MAX
|
||||
#define UINT_LEAST8_MAX UINT8_MAX
|
||||
#define UINT_LEAST16_MAX UINT16_MAX
|
||||
#define UINT_LEAST32_MAX UINT32_MAX
|
||||
#define UINT_LEAST64_MAX UINT64_MAX
|
||||
|
||||
// 7.18.2.3 Limits of fastest minimum-width integer types
|
||||
#define INT_FAST8_MIN INT8_MIN
|
||||
#define INT_FAST8_MAX INT8_MAX
|
||||
#define INT_FAST16_MIN INT16_MIN
|
||||
#define INT_FAST16_MAX INT16_MAX
|
||||
#define INT_FAST32_MIN INT32_MIN
|
||||
#define INT_FAST32_MAX INT32_MAX
|
||||
#define INT_FAST64_MIN INT64_MIN
|
||||
#define INT_FAST64_MAX INT64_MAX
|
||||
#define UINT_FAST8_MAX UINT8_MAX
|
||||
#define UINT_FAST16_MAX UINT16_MAX
|
||||
#define UINT_FAST32_MAX UINT32_MAX
|
||||
#define UINT_FAST64_MAX UINT64_MAX
|
||||
|
||||
// 7.18.2.4 Limits of integer types capable of holding object pointers
|
||||
#ifdef _WIN64 // [
|
||||
# define INTPTR_MIN INT64_MIN
|
||||
# define INTPTR_MAX INT64_MAX
|
||||
# define UINTPTR_MAX UINT64_MAX
|
||||
#else // _WIN64 ][
|
||||
# define INTPTR_MIN INT32_MIN
|
||||
# define INTPTR_MAX INT32_MAX
|
||||
# define UINTPTR_MAX UINT32_MAX
|
||||
#endif // _WIN64 ]
|
||||
|
||||
// 7.18.2.5 Limits of greatest-width integer types
|
||||
#define INTMAX_MIN INT64_MIN
|
||||
#define INTMAX_MAX INT64_MAX
|
||||
#define UINTMAX_MAX UINT64_MAX
|
||||
|
||||
// 7.18.3 Limits of other integer types
|
||||
|
||||
#ifdef _WIN64 // [
|
||||
# define PTRDIFF_MIN _I64_MIN
|
||||
# define PTRDIFF_MAX _I64_MAX
|
||||
#else // _WIN64 ][
|
||||
# define PTRDIFF_MIN _I32_MIN
|
||||
# define PTRDIFF_MAX _I32_MAX
|
||||
#endif // _WIN64 ]
|
||||
|
||||
#define SIG_ATOMIC_MIN INT_MIN
|
||||
#define SIG_ATOMIC_MAX INT_MAX
|
||||
|
||||
#ifndef SIZE_MAX // [
|
||||
# ifdef _WIN64 // [
|
||||
# define SIZE_MAX _UI64_MAX
|
||||
# else // _WIN64 ][
|
||||
# define SIZE_MAX _UI32_MAX
|
||||
# endif // _WIN64 ]
|
||||
#endif // SIZE_MAX ]
|
||||
|
||||
// WCHAR_MIN and WCHAR_MAX are also defined in <wchar.h>
|
||||
#ifndef WCHAR_MIN // [
|
||||
# define WCHAR_MIN 0
|
||||
#endif // WCHAR_MIN ]
|
||||
#ifndef WCHAR_MAX // [
|
||||
# define WCHAR_MAX _UI16_MAX
|
||||
#endif // WCHAR_MAX ]
|
||||
|
||||
#define WINT_MIN 0
|
||||
#define WINT_MAX _UI16_MAX
|
||||
|
||||
#endif // __STDC_LIMIT_MACROS ]
|
||||
|
||||
|
||||
// 7.18.4 Limits of other integer types
|
||||
|
||||
#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) // [ See footnote 224 at page 260
|
||||
|
||||
// 7.18.4.1 Macros for minimum-width integer constants
|
||||
|
||||
#define INT8_C(val) val
|
||||
#define INT16_C(val) val
|
||||
#define INT32_C(val) val##L
|
||||
#define INT64_C(val) val##i64
|
||||
|
||||
#define UINT8_C(val) val
|
||||
#define UINT16_C(val) val
|
||||
#define UINT32_C(val) val##UL
|
||||
#define UINT64_C(val) val##Ui64
|
||||
|
||||
// 7.18.4.2 Macros for greatest-width integer constants
|
||||
#define INTMAX_C INT64_C
|
||||
#define UINTMAX_C UINT64_C
|
||||
|
||||
#endif // __STDC_CONSTANT_MACROS ]
|
||||
|
||||
#endif
|
||||
|
||||
#endif // _MSC_STDINT_H_ ]
|
||||
Vendored
+25
@@ -0,0 +1,25 @@
|
||||
Copyright (c) 2008-2015 The Khronos Group Inc.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a
|
||||
copy of this software and/or associated documentation files (the
|
||||
"Materials"), to deal in the Materials without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Materials, and to
|
||||
permit persons to whom the Materials are furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included
|
||||
in all copies or substantial portions of the Materials.
|
||||
|
||||
MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS
|
||||
KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS
|
||||
SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT
|
||||
https://www.khronos.org/registry/
|
||||
|
||||
THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
|
||||
@@ -1,2 +0,0 @@
|
||||
downloads/
|
||||
unpack/
|
||||
Vendored
+45
@@ -0,0 +1,45 @@
|
||||
# ----------------------------------------------------------------------------
|
||||
# CMake file for IPP IW. See root CMakeLists.txt
|
||||
#
|
||||
# ----------------------------------------------------------------------------
|
||||
project(${IPP_IW_LIBRARY})
|
||||
|
||||
ocv_include_directories(${IPP_INCLUDE_DIRS} ${IPP_IW_PATH}/include)
|
||||
add_definitions(-DIW_BUILD)
|
||||
if(HAVE_IPP_ICV)
|
||||
add_definitions(-DICV_BASE)
|
||||
endif()
|
||||
|
||||
file(GLOB lib_srcs ${IPP_IW_PATH}/src/*.c)
|
||||
file(GLOB lib_hdrs ${IPP_IW_PATH}/include/*.h ${IPP_IW_PATH}/include/iw/*.h ${IPP_IW_PATH}/include/iw++/*.hpp)
|
||||
|
||||
# ----------------------------------------------------------------------------------
|
||||
# Define the library target:
|
||||
# ----------------------------------------------------------------------------------
|
||||
|
||||
add_library(${IPP_IW_LIBRARY} STATIC ${lib_srcs} ${lib_hdrs})
|
||||
|
||||
if(UNIX)
|
||||
if(CV_GCC OR CV_CLANG OR CV_ICC)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-function -Wno-missing-braces -Wno-missing-field-initializers")
|
||||
endif()
|
||||
if(CV_CLANG)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-self-assign")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set_target_properties(${IPP_IW_LIBRARY}
|
||||
PROPERTIES OUTPUT_NAME ${IPP_IW_LIBRARY}
|
||||
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
|
||||
COMPILE_PDB_NAME ${IPP_IW_LIBRARY}
|
||||
COMPILE_PDB_NAME_DEBUG "${IPP_IW_LIBRARY}${OPENCV_DEBUG_POSTFIX}"
|
||||
ARCHIVE_OUTPUT_DIRECTORY ${3P_LIBRARY_OUTPUT_PATH}
|
||||
)
|
||||
|
||||
if(ENABLE_SOLUTION_FOLDERS)
|
||||
set_target_properties(${IPP_IW_LIBRARY} PROPERTIES FOLDER "3rdparty")
|
||||
endif()
|
||||
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
ocv_install_target(${IPP_IW_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev)
|
||||
endif()
|
||||
Vendored
-110
@@ -1,110 +0,0 @@
|
||||
#
|
||||
# The script downloads ICV package
|
||||
#
|
||||
# On return this will define:
|
||||
# OPENCV_ICV_PATH - path to unpacked downloaded package
|
||||
#
|
||||
|
||||
function(_icv_downloader)
|
||||
# Commit SHA in the opencv_3rdparty repo
|
||||
set(IPPICV_BINARIES_COMMIT "81a676001ca8075ada498583e4166079e5744668")
|
||||
# Define actual ICV versions
|
||||
if(APPLE)
|
||||
set(OPENCV_ICV_PACKAGE_NAME "ippicv_macosx_20151201.tgz")
|
||||
set(OPENCV_ICV_PACKAGE_HASH "4ff1fde9a7cfdfe7250bfcd8334e0f2f")
|
||||
set(OPENCV_ICV_PLATFORM "macosx")
|
||||
set(OPENCV_ICV_PACKAGE_SUBDIR "/ippicv_osx")
|
||||
elseif(UNIX)
|
||||
if(ANDROID AND NOT (ANDROID_ABI STREQUAL x86 OR ANDROID_ABI STREQUAL x86_64))
|
||||
return()
|
||||
endif()
|
||||
set(OPENCV_ICV_PACKAGE_NAME "ippicv_linux_20151201.tgz")
|
||||
set(OPENCV_ICV_PACKAGE_HASH "808b791a6eac9ed78d32a7666804320e")
|
||||
set(OPENCV_ICV_PLATFORM "linux")
|
||||
set(OPENCV_ICV_PACKAGE_SUBDIR "/ippicv_lnx")
|
||||
elseif(WIN32 AND NOT ARM)
|
||||
set(OPENCV_ICV_PACKAGE_NAME "ippicv_windows_20151201.zip")
|
||||
set(OPENCV_ICV_PACKAGE_HASH "04e81ce5d0e329c3fbc606ae32cad44d")
|
||||
set(OPENCV_ICV_PLATFORM "windows")
|
||||
set(OPENCV_ICV_PACKAGE_SUBDIR "/ippicv_win")
|
||||
else()
|
||||
return() # Not supported
|
||||
endif()
|
||||
|
||||
set(OPENCV_ICV_UNPACK_PATH "${CMAKE_BINARY_DIR}/3rdparty/ippicv")
|
||||
set(OPENCV_ICV_PATH "${OPENCV_ICV_UNPACK_PATH}${OPENCV_ICV_PACKAGE_SUBDIR}")
|
||||
|
||||
if(DEFINED OPENCV_ICV_PACKAGE_DOWNLOADED
|
||||
AND OPENCV_ICV_PACKAGE_DOWNLOADED STREQUAL OPENCV_ICV_PACKAGE_HASH
|
||||
AND EXISTS ${OPENCV_ICV_PATH})
|
||||
# Package has been downloaded and checked by the previous build
|
||||
set(OPENCV_ICV_PATH "${OPENCV_ICV_PATH}" PARENT_SCOPE)
|
||||
return()
|
||||
else()
|
||||
if(EXISTS ${OPENCV_ICV_UNPACK_PATH})
|
||||
message(STATUS "ICV: Removing previous unpacked package: ${OPENCV_ICV_UNPACK_PATH}")
|
||||
file(REMOVE_RECURSE ${OPENCV_ICV_UNPACK_PATH})
|
||||
endif()
|
||||
endif()
|
||||
unset(OPENCV_ICV_PACKAGE_DOWNLOADED CACHE)
|
||||
|
||||
set(OPENCV_ICV_PACKAGE_ARCHIVE "${CMAKE_CURRENT_LIST_DIR}/downloads/${OPENCV_ICV_PLATFORM}-${OPENCV_ICV_PACKAGE_HASH}/${OPENCV_ICV_PACKAGE_NAME}")
|
||||
get_filename_component(OPENCV_ICV_PACKAGE_ARCHIVE_DIR "${OPENCV_ICV_PACKAGE_ARCHIVE}" PATH)
|
||||
if(EXISTS "${OPENCV_ICV_PACKAGE_ARCHIVE}")
|
||||
file(MD5 "${OPENCV_ICV_PACKAGE_ARCHIVE}" archive_md5)
|
||||
if(NOT archive_md5 STREQUAL OPENCV_ICV_PACKAGE_HASH)
|
||||
message(WARNING "ICV: Local copy of ICV package has invalid MD5 hash: ${archive_md5} (expected: ${OPENCV_ICV_PACKAGE_HASH})")
|
||||
file(REMOVE "${OPENCV_ICV_PACKAGE_ARCHIVE}")
|
||||
file(REMOVE_RECURSE "${OPENCV_ICV_PACKAGE_ARCHIVE_DIR}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT EXISTS "${OPENCV_ICV_PACKAGE_ARCHIVE}")
|
||||
if(NOT DEFINED OPENCV_ICV_URL)
|
||||
if(DEFINED ENV{OPENCV_ICV_URL})
|
||||
set(OPENCV_ICV_URL $ENV{OPENCV_ICV_URL})
|
||||
else()
|
||||
set(OPENCV_ICV_URL "https://raw.githubusercontent.com/opencv/opencv_3rdparty/${IPPICV_BINARIES_COMMIT}/ippicv")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
file(MAKE_DIRECTORY ${OPENCV_ICV_PACKAGE_ARCHIVE_DIR})
|
||||
message(STATUS "ICV: Downloading ${OPENCV_ICV_PACKAGE_NAME}...")
|
||||
file(DOWNLOAD "${OPENCV_ICV_URL}/${OPENCV_ICV_PACKAGE_NAME}" "${OPENCV_ICV_PACKAGE_ARCHIVE}"
|
||||
TIMEOUT 600 STATUS __status
|
||||
EXPECTED_MD5 ${OPENCV_ICV_PACKAGE_HASH})
|
||||
if(NOT __status EQUAL 0)
|
||||
message(FATAL_ERROR "ICV: Failed to download ICV package: ${OPENCV_ICV_PACKAGE_NAME}. Status=${__status}")
|
||||
else()
|
||||
# Don't remove this code, because EXPECTED_MD5 parameter doesn't fail "file(DOWNLOAD)" step
|
||||
# on wrong hash
|
||||
file(MD5 "${OPENCV_ICV_PACKAGE_ARCHIVE}" archive_md5)
|
||||
if(NOT archive_md5 STREQUAL OPENCV_ICV_PACKAGE_HASH)
|
||||
message(FATAL_ERROR "ICV: Downloaded copy of ICV package has invalid MD5 hash: ${archive_md5} (expected: ${OPENCV_ICV_PACKAGE_HASH})")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
ocv_assert(EXISTS "${OPENCV_ICV_PACKAGE_ARCHIVE}")
|
||||
ocv_assert(NOT EXISTS "${OPENCV_ICV_UNPACK_PATH}")
|
||||
file(MAKE_DIRECTORY ${OPENCV_ICV_UNPACK_PATH})
|
||||
ocv_assert(EXISTS "${OPENCV_ICV_UNPACK_PATH}")
|
||||
|
||||
message(STATUS "ICV: Unpacking ${OPENCV_ICV_PACKAGE_NAME} to ${OPENCV_ICV_UNPACK_PATH}...")
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xz "${OPENCV_ICV_PACKAGE_ARCHIVE}"
|
||||
WORKING_DIRECTORY "${OPENCV_ICV_UNPACK_PATH}"
|
||||
RESULT_VARIABLE __result)
|
||||
|
||||
if(NOT __result EQUAL 0)
|
||||
message(FATAL_ERROR "ICV: Failed to unpack ICV package from ${OPENCV_ICV_PACKAGE_ARCHIVE} to ${OPENCV_ICV_UNPACK_PATH} with error ${__result}")
|
||||
endif()
|
||||
|
||||
ocv_assert(EXISTS "${OPENCV_ICV_PATH}")
|
||||
|
||||
set(OPENCV_ICV_PACKAGE_DOWNLOADED "${OPENCV_ICV_PACKAGE_HASH}" CACHE INTERNAL "ICV package hash")
|
||||
|
||||
message(STATUS "ICV: Package successfully downloaded")
|
||||
set(OPENCV_ICV_PATH "${OPENCV_ICV_PATH}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
_icv_downloader()
|
||||
Vendored
+56
@@ -0,0 +1,56 @@
|
||||
function(download_ippicv root_var)
|
||||
set(${root_var} "" PARENT_SCOPE)
|
||||
|
||||
# Commit SHA in the opencv_3rdparty repo
|
||||
set(IPPICV_COMMIT "32e315a5b106a7b89dbed51c28f8120a48b368b4")
|
||||
# Define actual ICV versions
|
||||
if(APPLE)
|
||||
set(OPENCV_ICV_PLATFORM "macosx")
|
||||
set(OPENCV_ICV_PACKAGE_SUBDIR "ippicv_mac")
|
||||
if(X86_64)
|
||||
set(OPENCV_ICV_NAME "ippicv_2019_mac_intel64_general_20180723.tgz")
|
||||
set(OPENCV_ICV_HASH "fe6b2bb75ae0e3f19ad3ae1a31dfa4a2")
|
||||
else()
|
||||
set(OPENCV_ICV_NAME "ippicv_2019_mac_ia32_general_20180723.tgz")
|
||||
set(OPENCV_ICV_HASH "b5dfa78c87eb75c64470cbe5ec876f4f")
|
||||
endif()
|
||||
elseif((UNIX AND NOT ANDROID) OR (UNIX AND ANDROID_ABI MATCHES "x86"))
|
||||
set(OPENCV_ICV_PLATFORM "linux")
|
||||
set(OPENCV_ICV_PACKAGE_SUBDIR "ippicv_lnx")
|
||||
if(X86_64)
|
||||
set(OPENCV_ICV_NAME "ippicv_2019_lnx_intel64_general_20180723.tgz")
|
||||
set(OPENCV_ICV_HASH "c0bd78adb4156bbf552c1dfe90599607")
|
||||
else()
|
||||
set(OPENCV_ICV_NAME "ippicv_2019_lnx_ia32_general_20180723.tgz")
|
||||
set(OPENCV_ICV_HASH "4f38432c30bfd6423164b7a24bbc98a0")
|
||||
endif()
|
||||
elseif(WIN32 AND NOT ARM)
|
||||
set(OPENCV_ICV_PLATFORM "windows")
|
||||
set(OPENCV_ICV_PACKAGE_SUBDIR "ippicv_win")
|
||||
if(X86_64)
|
||||
set(OPENCV_ICV_NAME "ippicv_2019_win_intel64_20180723_general.zip")
|
||||
set(OPENCV_ICV_HASH "1d222685246896fe089f88b8858e4b2f")
|
||||
else()
|
||||
set(OPENCV_ICV_NAME "ippicv_2019_win_ia32_20180723_general.zip")
|
||||
set(OPENCV_ICV_HASH "0157251a2eb9cd63a3ebc7eed0f3e59e")
|
||||
endif()
|
||||
else()
|
||||
return()
|
||||
endif()
|
||||
|
||||
set(THE_ROOT "${OpenCV_BINARY_DIR}/3rdparty/ippicv")
|
||||
ocv_download(FILENAME ${OPENCV_ICV_NAME}
|
||||
HASH ${OPENCV_ICV_HASH}
|
||||
URL
|
||||
"${OPENCV_IPPICV_URL}"
|
||||
"$ENV{OPENCV_IPPICV_URL}"
|
||||
"https://raw.githubusercontent.com/opencv/opencv_3rdparty/${IPPICV_COMMIT}/ippicv/"
|
||||
DESTINATION_DIR "${THE_ROOT}"
|
||||
ID IPPICV
|
||||
STATUS res
|
||||
UNPACK RELATIVE_URL)
|
||||
|
||||
if(res)
|
||||
set(${root_var} "${THE_ROOT}/${OPENCV_ICV_PACKAGE_SUBDIR}" PARENT_SCOPE)
|
||||
endif()
|
||||
endfunction()
|
||||
Vendored
+66
@@ -0,0 +1,66 @@
|
||||
# ----------------------------------------------------------------------------
|
||||
# CMake file for Intel ITT API. See root CMakeLists.txt
|
||||
#
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
if(NOT ITT_LIBRARY)
|
||||
set(ITT_LIBRARY "ittnotify")
|
||||
endif()
|
||||
project(${ITT_LIBRARY} C)
|
||||
|
||||
if(NOT WIN32)
|
||||
include(CheckLibraryExists)
|
||||
if(COMMAND CHECK_LIBRARY_EXISTS)
|
||||
CHECK_LIBRARY_EXISTS(dl dlerror "" HAVE_DL_LIBRARY)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
ocv_warnings_disable(CMAKE_C_FLAGS -Wimplicit-fallthrough)
|
||||
|
||||
ocv_include_directories("${CMAKE_CURRENT_SOURCE_DIR}/include")
|
||||
set(ITT_INCLUDE_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/include")
|
||||
|
||||
set(ITT_PUBLIC_HDRS
|
||||
include/ittnotify.h
|
||||
include/jitprofiling.h
|
||||
include/libittnotify.h
|
||||
include/llvm_jit_event_listener.hpp
|
||||
)
|
||||
set(ITT_PRIVATE_HDRS
|
||||
src/ittnotify/disable_warnings.h
|
||||
src/ittnotify/ittnotify_config.h
|
||||
src/ittnotify/ittnotify_static.h
|
||||
src/ittnotify/ittnotify_types.h
|
||||
)
|
||||
set(ITT_SRCS
|
||||
src/ittnotify/ittnotify_static.c
|
||||
src/ittnotify/jitprofiling.c
|
||||
)
|
||||
|
||||
add_library(${ITT_LIBRARY} STATIC ${ITT_SRCS} ${ITT_PUBLIC_HDRS} ${ITT_PRIVATE_HDRS})
|
||||
|
||||
if(NOT WIN32)
|
||||
if(HAVE_DL_LIBRARY)
|
||||
target_link_libraries(${ITT_LIBRARY} dl)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set_target_properties(${ITT_LIBRARY} PROPERTIES
|
||||
OUTPUT_NAME ${ITT_LIBRARY}
|
||||
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
|
||||
COMPILE_PDB_NAME ${ITT_LIBRARY}
|
||||
COMPILE_PDB_NAME_DEBUG "${ITT_LIBRARY}${OPENCV_DEBUG_POSTFIX}"
|
||||
ARCHIVE_OUTPUT_DIRECTORY ${3P_LIBRARY_OUTPUT_PATH}
|
||||
)
|
||||
|
||||
ocv_warnings_disable(CMAKE_C_FLAGS -Wundef -Wsign-compare)
|
||||
|
||||
if(ENABLE_SOLUTION_FOLDERS)
|
||||
set_target_properties(${ITT_LIBRARY} PROPERTIES FOLDER "3rdparty")
|
||||
endif()
|
||||
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
ocv_install_target(${ITT_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev)
|
||||
endif()
|
||||
|
||||
ocv_install_3rdparty_licenses(ittnotify src/ittnotify/LICENSE.BSD src/ittnotify/LICENSE.GPL)
|
||||
+4123
File diff suppressed because it is too large
Load Diff
+694
@@ -0,0 +1,694 @@
|
||||
/* <copyright>
|
||||
This file is provided under a dual BSD/GPLv2 license. When using or
|
||||
redistributing this file, you may do so under either license.
|
||||
|
||||
GPL LICENSE SUMMARY
|
||||
|
||||
Copyright (c) 2005-2014 Intel Corporation. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of version 2 of the GNU General Public License as
|
||||
published by the Free Software Foundation.
|
||||
|
||||
This program is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
The full GNU General Public License is included in this distribution
|
||||
in the file called LICENSE.GPL.
|
||||
|
||||
Contact Information:
|
||||
http://software.intel.com/en-us/articles/intel-vtune-amplifier-xe/
|
||||
|
||||
BSD LICENSE
|
||||
|
||||
Copyright (c) 2005-2014 Intel Corporation. All rights reserved.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in
|
||||
the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
</copyright> */
|
||||
|
||||
#ifndef __JITPROFILING_H__
|
||||
#define __JITPROFILING_H__
|
||||
|
||||
/**
|
||||
* @brief JIT Profiling APIs
|
||||
*
|
||||
* The JIT Profiling API is used to report information about just-in-time
|
||||
* generated code that can be used by performance tools. The user inserts
|
||||
* calls in the code generator to report information before JIT-compiled
|
||||
* code goes to execution. This information is collected at runtime and used
|
||||
* by tools like Intel(R) VTune(TM) Amplifier to display performance metrics
|
||||
* associated with JIT-compiled code.
|
||||
*
|
||||
* These APIs can be used to\n
|
||||
* - **Profile trace-based and method-based JIT-compiled
|
||||
* code**. Some examples of environments that you can profile with these APIs:
|
||||
* dynamic JIT compilation of JavaScript code traces, JIT execution in OpenCL(TM)
|
||||
* software technology, Java/.NET managed execution environments, and custom
|
||||
* ISV JIT engines.
|
||||
* @code
|
||||
* #include <jitprofiling.h>
|
||||
*
|
||||
* if (iJIT_IsProfilingActive != iJIT_SAMPLING_ON) {
|
||||
* return;
|
||||
* }
|
||||
*
|
||||
* iJIT_Method_Load jmethod = {0};
|
||||
* jmethod.method_id = iJIT_GetNewMethodID();
|
||||
* jmethod.method_name = "method_name";
|
||||
* jmethod.class_file_name = "class_name";
|
||||
* jmethod.source_file_name = "source_file_name";
|
||||
* jmethod.method_load_address = code_addr;
|
||||
* jmethod.method_size = code_size;
|
||||
*
|
||||
* iJIT_NotifyEvent(iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED, (void*)&jmethod);
|
||||
* iJIT_NotifyEvent(iJVM_EVENT_TYPE_SHUTDOWN, NULL);
|
||||
* @endcode
|
||||
*
|
||||
* * Expected behavior:
|
||||
* * If any iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED event overwrites an
|
||||
* already reported method, then such a method becomes invalid and its
|
||||
* memory region is treated as unloaded. VTune Amplifier displays the metrics
|
||||
* collected by the method until it is overwritten.
|
||||
* * If supplied line number information contains multiple source lines for
|
||||
* the same assembly instruction (code location), then VTune Amplifier picks up
|
||||
* the first line number.
|
||||
* * Dynamically generated code can be associated with a module name.
|
||||
* Use the iJIT_Method_Load_V2 structure.\n
|
||||
* Clarification of some cases:
|
||||
* * If you register a function with the same method ID multiple times,
|
||||
* specifying different module names, then the VTune Amplifier picks up
|
||||
* the module name registered first. If you want to distinguish the same
|
||||
* function between different JIT engines, supply different method IDs for
|
||||
* each function. Other symbolic information (for example, source file)
|
||||
* can be identical.
|
||||
*
|
||||
* - **Analyze split functions** (multiple joint or disjoint code regions
|
||||
* belonging to the same function) **including re-JIT**
|
||||
* with potential overlapping of code regions in time, which is common in
|
||||
* resource-limited environments.
|
||||
* @code
|
||||
* #include <jitprofiling.h>
|
||||
*
|
||||
* unsigned int method_id = iJIT_GetNewMethodID();
|
||||
*
|
||||
* iJIT_Method_Load a = {0};
|
||||
* a.method_id = method_id;
|
||||
* a.method_load_address = 0x100;
|
||||
* a.method_size = 0x20;
|
||||
*
|
||||
* iJIT_Method_Load b = {0};
|
||||
* b.method_id = method_id;
|
||||
* b.method_load_address = 0x200;
|
||||
* b.method_size = 0x30;
|
||||
*
|
||||
* iJIT_NotifyEvent(iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED, (void*)&a);
|
||||
* iJIT_NotifyEvent(iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED, (void*)&b);
|
||||
* @endcode
|
||||
*
|
||||
* * Expected behaviour:
|
||||
* * If a iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED event overwrites an
|
||||
* already reported method, then such a method becomes invalid and
|
||||
* its memory region is treated as unloaded.
|
||||
* * All code regions reported with the same method ID are considered as
|
||||
* belonging to the same method. Symbolic information (method name,
|
||||
* source file name) will be taken from the first notification, and all
|
||||
* subsequent notifications with the same method ID will be processed
|
||||
* only for line number table information. So, the VTune Amplifier will map
|
||||
* samples to a source line using the line number table from the current
|
||||
* notification while taking the source file name from the very first one.\n
|
||||
* Clarification of some cases:\n
|
||||
* * If you register a second code region with a different source file
|
||||
* name and the same method ID, then this information will be saved and
|
||||
* will not be considered as an extension of the first code region, but
|
||||
* VTune Amplifier will use the source file of the first code region and map
|
||||
* performance metrics incorrectly.
|
||||
* * If you register a second code region with the same source file as
|
||||
* for the first region and the same method ID, then the source file will be
|
||||
* discarded but VTune Amplifier will map metrics to the source file correctly.
|
||||
* * If you register a second code region with a null source file and
|
||||
* the same method ID, then provided line number info will be associated
|
||||
* with the source file of the first code region.
|
||||
*
|
||||
* - **Explore inline functions** including multi-level hierarchy of
|
||||
* nested inline methods which shows how performance metrics are distributed through them.
|
||||
* @code
|
||||
* #include <jitprofiling.h>
|
||||
*
|
||||
* // method_id parent_id
|
||||
* // [-- c --] 3000 2000
|
||||
* // [---- d -----] 2001 1000
|
||||
* // [---- b ----] 2000 1000
|
||||
* // [------------ a ----------------] 1000 n/a
|
||||
*
|
||||
* iJIT_Method_Load a = {0};
|
||||
* a.method_id = 1000;
|
||||
*
|
||||
* iJIT_Method_Inline_Load b = {0};
|
||||
* b.method_id = 2000;
|
||||
* b.parent_method_id = 1000;
|
||||
*
|
||||
* iJIT_Method_Inline_Load c = {0};
|
||||
* c.method_id = 3000;
|
||||
* c.parent_method_id = 2000;
|
||||
*
|
||||
* iJIT_Method_Inline_Load d = {0};
|
||||
* d.method_id = 2001;
|
||||
* d.parent_method_id = 1000;
|
||||
*
|
||||
* iJIT_NotifyEvent(iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED, (void*)&a);
|
||||
* iJIT_NotifyEvent(iJVM_EVENT_TYPE_METHOD_INLINE_LOAD_FINISHED, (void*)&b);
|
||||
* iJIT_NotifyEvent(iJVM_EVENT_TYPE_METHOD_INLINE_LOAD_FINISHED, (void*)&c);
|
||||
* iJIT_NotifyEvent(iJVM_EVENT_TYPE_METHOD_INLINE_LOAD_FINISHED, (void*)&d);
|
||||
* @endcode
|
||||
*
|
||||
* * Requirements:
|
||||
* * Each inline (iJIT_Method_Inline_Load) method should be associated
|
||||
* with two method IDs: one for itself; one for its immediate parent.
|
||||
* * Address regions of inline methods of the same parent method cannot
|
||||
* overlap each other.
|
||||
* * Execution of the parent method must not be started until it and all
|
||||
* its inline methods are reported.
|
||||
* * Expected behaviour:
|
||||
* * In case of nested inline methods an order of
|
||||
* iJVM_EVENT_TYPE_METHOD_INLINE_LOAD_FINISHED events is not important.
|
||||
* * If any event overwrites either inline method or top parent method,
|
||||
* then the parent, including inline methods, becomes invalid and its memory
|
||||
* region is treated as unloaded.
|
||||
*
|
||||
* **Life time of allocated data**\n
|
||||
* The client sends an event notification to the agent with event-specific
|
||||
* data, which is a structure. The pointers in the structure refer to memory
|
||||
* allocated by the client, which responsible for releasing it. The pointers are
|
||||
* used by the iJIT_NotifyEvent method to copy client's data in a trace file,
|
||||
* and they are not used after the iJIT_NotifyEvent method returns.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @defgroup jitapi JIT Profiling
|
||||
* @ingroup internal
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Enumerator for the types of notifications
|
||||
*/
|
||||
typedef enum iJIT_jvm_event
|
||||
{
|
||||
iJVM_EVENT_TYPE_SHUTDOWN = 2, /**<\brief Send this to shutdown the agent.
|
||||
* Use NULL for event data. */
|
||||
|
||||
iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED = 13, /**<\brief Send when dynamic code is
|
||||
* JIT compiled and loaded into
|
||||
* memory by the JIT engine, but
|
||||
* before the code is executed.
|
||||
* Use iJIT_Method_Load as event
|
||||
* data. */
|
||||
/** @cond exclude_from_documentation */
|
||||
iJVM_EVENT_TYPE_METHOD_UNLOAD_START, /**<\brief Send when compiled dynamic
|
||||
* code is being unloaded from memory.
|
||||
* Use iJIT_Method_Load as event data.*/
|
||||
/** @endcond */
|
||||
|
||||
iJVM_EVENT_TYPE_METHOD_UPDATE, /**<\brief Send to provide new content for
|
||||
* a previously reported dynamic code.
|
||||
* The previous content will be invalidated
|
||||
* starting from the time of the notification.
|
||||
* Use iJIT_Method_Load as event data but
|
||||
* required fields are following:
|
||||
* - method_id identify the code to update.
|
||||
* - method_load_address specify start address
|
||||
* within identified code range
|
||||
* where update should be started.
|
||||
* - method_size specify length of updated code
|
||||
* range. */
|
||||
|
||||
|
||||
iJVM_EVENT_TYPE_METHOD_INLINE_LOAD_FINISHED, /**<\brief Send when an inline dynamic
|
||||
* code is JIT compiled and loaded
|
||||
* into memory by the JIT engine,
|
||||
* but before the parent code region
|
||||
* starts executing.
|
||||
* Use iJIT_Method_Inline_Load as event data.*/
|
||||
|
||||
/** @cond exclude_from_documentation */
|
||||
iJVM_EVENT_TYPE_METHOD_UPDATE_V2,
|
||||
/** @endcond */
|
||||
|
||||
iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED_V2 = 21, /**<\brief Send when a dynamic code is
|
||||
* JIT compiled and loaded into
|
||||
* memory by the JIT engine, but
|
||||
* before the code is executed.
|
||||
* Use iJIT_Method_Load_V2 as event data. */
|
||||
|
||||
iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED_V3 /**<\brief Send when a dynamic code is
|
||||
* JIT compiled and loaded into
|
||||
* memory by the JIT engine, but
|
||||
* before the code is executed.
|
||||
* Use iJIT_Method_Load_V3 as event data. */
|
||||
} iJIT_JVM_EVENT;
|
||||
|
||||
/**
|
||||
* @brief Enumerator for the agent's mode
|
||||
*/
|
||||
typedef enum _iJIT_IsProfilingActiveFlags
|
||||
{
|
||||
iJIT_NOTHING_RUNNING = 0x0000, /**<\brief The agent is not running;
|
||||
* iJIT_NotifyEvent calls will
|
||||
* not be processed. */
|
||||
iJIT_SAMPLING_ON = 0x0001, /**<\brief The agent is running and
|
||||
* ready to process notifications. */
|
||||
} iJIT_IsProfilingActiveFlags;
|
||||
|
||||
/**
|
||||
* @brief Description of a single entry in the line number information of a code region.
|
||||
* @details A table of line number entries gives information about how the reported code region
|
||||
* is mapped to source file.
|
||||
* Intel(R) VTune(TM) Amplifier uses line number information to attribute
|
||||
* the samples (virtual address) to a line number. \n
|
||||
* It is acceptable to report different code addresses for the same source line:
|
||||
* @code
|
||||
* Offset LineNumber
|
||||
* 1 2
|
||||
* 12 4
|
||||
* 15 2
|
||||
* 18 1
|
||||
* 21 30
|
||||
*
|
||||
* VTune Amplifier constructs the following table using the client data
|
||||
*
|
||||
* Code subrange Line number
|
||||
* 0-1 2
|
||||
* 1-12 4
|
||||
* 12-15 2
|
||||
* 15-18 1
|
||||
* 18-21 30
|
||||
* @endcode
|
||||
*/
|
||||
typedef struct _LineNumberInfo
|
||||
{
|
||||
unsigned int Offset; /**<\brief Offset from the begining of the code region. */
|
||||
unsigned int LineNumber; /**<\brief Matching source line number offset (from beginning of source file). */
|
||||
|
||||
} *pLineNumberInfo, LineNumberInfo;
|
||||
|
||||
/**
|
||||
* @brief Enumerator for the code architecture.
|
||||
*/
|
||||
typedef enum _iJIT_CodeArchitecture
|
||||
{
|
||||
iJIT_CA_NATIVE = 0, /**<\brief Native to the process architecture that is calling it. */
|
||||
|
||||
iJIT_CA_32, /**<\brief 32-bit machine code. */
|
||||
|
||||
iJIT_CA_64 /**<\brief 64-bit machine code. */
|
||||
|
||||
} iJIT_CodeArchitecture;
|
||||
|
||||
#pragma pack(push, 8)
|
||||
|
||||
/**
|
||||
* @brief Description of a JIT-compiled method
|
||||
* @details When you use the iJIT_Method_Load structure to describe
|
||||
* the JIT compiled method, use iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED
|
||||
* as an event type to report it.
|
||||
*/
|
||||
typedef struct _iJIT_Method_Load
|
||||
{
|
||||
unsigned int method_id; /**<\brief Unique method ID. Cannot be 0.
|
||||
* You must either use the API function
|
||||
* iJIT_GetNewMethodID to get a valid and unique
|
||||
* method ID, or else manage ID uniqueness
|
||||
* and correct range by yourself.\n
|
||||
* You must use the same method ID for all code
|
||||
* regions of the same method, otherwise different
|
||||
* method IDs specify different methods. */
|
||||
|
||||
char* method_name; /**<\brief The name of the method. It can be optionally
|
||||
* prefixed with its class name and appended with
|
||||
* its complete signature. Can't be NULL. */
|
||||
|
||||
void* method_load_address; /**<\brief The start virtual address of the method code
|
||||
* region. If NULL, data provided with
|
||||
* event are not accepted. */
|
||||
|
||||
unsigned int method_size; /**<\brief The code size of the method in memory.
|
||||
* If 0, then data provided with the event are not
|
||||
* accepted. */
|
||||
|
||||
unsigned int line_number_size; /**<\brief The number of entries in the line number
|
||||
* table.0 if none. */
|
||||
|
||||
pLineNumberInfo line_number_table; /**<\brief Pointer to the line numbers info
|
||||
* array. Can be NULL if
|
||||
* line_number_size is 0. See
|
||||
* LineNumberInfo Structure for a
|
||||
* description of a single entry in
|
||||
* the line number info array */
|
||||
|
||||
unsigned int class_id; /**<\brief This field is obsolete. */
|
||||
|
||||
char* class_file_name; /**<\brief Class name. Can be NULL.*/
|
||||
|
||||
char* source_file_name; /**<\brief Source file name. Can be NULL.*/
|
||||
|
||||
} *piJIT_Method_Load, iJIT_Method_Load;
|
||||
|
||||
/**
|
||||
* @brief Description of a JIT-compiled method
|
||||
* @details When you use the iJIT_Method_Load_V2 structure to describe
|
||||
* the JIT compiled method, use iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED_V2
|
||||
* as an event type to report it.
|
||||
*/
|
||||
typedef struct _iJIT_Method_Load_V2
|
||||
{
|
||||
unsigned int method_id; /**<\brief Unique method ID. Cannot be 0.
|
||||
* You must either use the API function
|
||||
* iJIT_GetNewMethodID to get a valid and unique
|
||||
* method ID, or else manage ID uniqueness
|
||||
* and correct range by yourself.\n
|
||||
* You must use the same method ID for all code
|
||||
* regions of the same method, otherwise different
|
||||
* method IDs specify different methods. */
|
||||
|
||||
char* method_name; /**<\brief The name of the method. It can be optionally
|
||||
* prefixed with its class name and appended with
|
||||
* its complete signature. Can't be NULL. */
|
||||
|
||||
void* method_load_address; /**<\brief The start virtual address of the method code
|
||||
* region. If NULL, then data provided with the
|
||||
* event are not accepted. */
|
||||
|
||||
unsigned int method_size; /**<\brief The code size of the method in memory.
|
||||
* If 0, then data provided with the event are not
|
||||
* accepted. */
|
||||
|
||||
unsigned int line_number_size; /**<\brief The number of entries in the line number
|
||||
* table. 0 if none. */
|
||||
|
||||
pLineNumberInfo line_number_table; /**<\brief Pointer to the line numbers info
|
||||
* array. Can be NULL if
|
||||
* line_number_size is 0. See
|
||||
* LineNumberInfo Structure for a
|
||||
* description of a single entry in
|
||||
* the line number info array. */
|
||||
|
||||
char* class_file_name; /**<\brief Class name. Can be NULL. */
|
||||
|
||||
char* source_file_name; /**<\brief Source file name. Can be NULL. */
|
||||
|
||||
char* module_name; /**<\brief Module name. Can be NULL.
|
||||
The module name can be useful for distinguishing among
|
||||
different JIT engines. VTune Amplifier will display
|
||||
reported methods grouped by specific module. */
|
||||
|
||||
} *piJIT_Method_Load_V2, iJIT_Method_Load_V2;
|
||||
|
||||
/**
|
||||
* @brief Description of a JIT-compiled method
|
||||
* @details The iJIT_Method_Load_V3 structure is the same as iJIT_Method_Load_V2
|
||||
* with a newly introduced 'arch' field that specifies architecture of the code region.
|
||||
* When you use the iJIT_Method_Load_V3 structure to describe
|
||||
* the JIT compiled method, use iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED_V3
|
||||
* as an event type to report it.
|
||||
*/
|
||||
typedef struct _iJIT_Method_Load_V3
|
||||
{
|
||||
unsigned int method_id; /**<\brief Unique method ID. Cannot be 0.
|
||||
* You must either use the API function
|
||||
* iJIT_GetNewMethodID to get a valid and unique
|
||||
* method ID, or manage ID uniqueness
|
||||
* and correct range by yourself.\n
|
||||
* You must use the same method ID for all code
|
||||
* regions of the same method, otherwise they are
|
||||
* treated as regions of different methods. */
|
||||
|
||||
char* method_name; /**<\brief The name of the method. It can be optionally
|
||||
* prefixed with its class name and appended with
|
||||
* its complete signature. Cannot be NULL. */
|
||||
|
||||
void* method_load_address; /**<\brief The start virtual address of the method code
|
||||
* region. If NULL, then data provided with the
|
||||
* event are not accepted. */
|
||||
|
||||
unsigned int method_size; /**<\brief The code size of the method in memory.
|
||||
* If 0, then data provided with the event are not
|
||||
* accepted. */
|
||||
|
||||
unsigned int line_number_size; /**<\brief The number of entries in the line number
|
||||
* table. 0 if none. */
|
||||
|
||||
pLineNumberInfo line_number_table; /**<\brief Pointer to the line numbers info
|
||||
* array. Can be NULL if
|
||||
* line_number_size is 0. See
|
||||
* LineNumberInfo Structure for a
|
||||
* description of a single entry in
|
||||
* the line number info array. */
|
||||
|
||||
char* class_file_name; /**<\brief Class name. Can be NULL. */
|
||||
|
||||
char* source_file_name; /**<\brief Source file name. Can be NULL. */
|
||||
|
||||
char* module_name; /**<\brief Module name. Can be NULL.
|
||||
* The module name can be useful for distinguishing among
|
||||
* different JIT engines. VTune Amplifier will display
|
||||
* reported methods grouped by specific module. */
|
||||
|
||||
iJIT_CodeArchitecture module_arch; /**<\brief Architecture of the method's code region.
|
||||
* By default, it is the same as the process
|
||||
* architecture that is calling it.
|
||||
* For example, you can use it if your 32-bit JIT
|
||||
* engine generates 64-bit code.
|
||||
*
|
||||
* If JIT engine reports both 32-bit and 64-bit types
|
||||
* of methods then VTune Amplifier splits the methods
|
||||
* with the same module name but with different
|
||||
* architectures in two different modules. VTune Amplifier
|
||||
* modifies the original name provided with a 64-bit method
|
||||
* version by ending it with '(64)' */
|
||||
|
||||
} *piJIT_Method_Load_V3, iJIT_Method_Load_V3;
|
||||
|
||||
/**
|
||||
* @brief Description of an inline JIT-compiled method
|
||||
* @details When you use the_iJIT_Method_Inline_Load structure to describe
|
||||
* the JIT compiled method, use iJVM_EVENT_TYPE_METHOD_INLINE_LOAD_FINISHED
|
||||
* as an event type to report it.
|
||||
*/
|
||||
typedef struct _iJIT_Method_Inline_Load
|
||||
{
|
||||
unsigned int method_id; /**<\brief Unique method ID. Cannot be 0.
|
||||
* You must either use the API function
|
||||
* iJIT_GetNewMethodID to get a valid and unique
|
||||
* method ID, or else manage ID uniqueness
|
||||
* and correct range by yourself. */
|
||||
|
||||
unsigned int parent_method_id; /**<\brief Unique immediate parent's method ID.
|
||||
* Cannot be 0.
|
||||
* You must either use the API function
|
||||
* iJIT_GetNewMethodID to get a valid and unique
|
||||
* method ID, or else manage ID uniqueness
|
||||
* and correct range by yourself. */
|
||||
|
||||
char* method_name; /**<\brief The name of the method. It can be optionally
|
||||
* prefixed with its class name and appended with
|
||||
* its complete signature. Can't be NULL. */
|
||||
|
||||
void* method_load_address; /** <\brief The virtual address on which the method
|
||||
* is inlined. If NULL, then data provided with
|
||||
* the event are not accepted. */
|
||||
|
||||
unsigned int method_size; /**<\brief The code size of the method in memory.
|
||||
* If 0, then data provided with the event are not
|
||||
* accepted. */
|
||||
|
||||
unsigned int line_number_size; /**<\brief The number of entries in the line number
|
||||
* table. 0 if none. */
|
||||
|
||||
pLineNumberInfo line_number_table; /**<\brief Pointer to the line numbers info
|
||||
* array. Can be NULL if
|
||||
* line_number_size is 0. See
|
||||
* LineNumberInfo Structure for a
|
||||
* description of a single entry in
|
||||
* the line number info array */
|
||||
|
||||
char* class_file_name; /**<\brief Class name. Can be NULL.*/
|
||||
|
||||
char* source_file_name; /**<\brief Source file name. Can be NULL.*/
|
||||
|
||||
} *piJIT_Method_Inline_Load, iJIT_Method_Inline_Load;
|
||||
|
||||
/** @cond exclude_from_documentation */
|
||||
/**
|
||||
* @brief Description of a segment type
|
||||
* @details Use the segment type to specify a type of data supplied
|
||||
* with the iJVM_EVENT_TYPE_METHOD_UPDATE_V2 event to be applied to
|
||||
* a certain code trace.
|
||||
*/
|
||||
typedef enum _iJIT_SegmentType
|
||||
{
|
||||
iJIT_CT_UNKNOWN = 0,
|
||||
|
||||
iJIT_CT_CODE, /**<\brief Executable code. */
|
||||
|
||||
iJIT_CT_DATA, /**<\brief Data (not executable code).
|
||||
* VTune Amplifier uses the format string
|
||||
* (see iJIT_Method_Update) to represent
|
||||
* this data in the VTune Amplifier GUI */
|
||||
|
||||
iJIT_CT_KEEP, /**<\brief Use the previous markup for the trace.
|
||||
* Can be used for the following
|
||||
* iJVM_EVENT_TYPE_METHOD_UPDATE_V2 events,
|
||||
* if the type of the previously reported segment
|
||||
* type is the same. */
|
||||
iJIT_CT_EOF
|
||||
} iJIT_SegmentType;
|
||||
|
||||
/**
|
||||
* @brief Description of a dynamic update of the content within JIT-compiled method
|
||||
* @details The JIT engine may generate the methods that are updated at runtime
|
||||
* partially by mixed (data + executable code) content. When you use the iJIT_Method_Update
|
||||
* structure to describe the update of the content within a JIT-compiled method,
|
||||
* use iJVM_EVENT_TYPE_METHOD_UPDATE_V2 as an event type to report it.
|
||||
*
|
||||
* On the first Update event, VTune Amplifier copies the original code range reported by
|
||||
* the iJVM_EVENT_TYPE_METHOD_LOAD event, then modifies it with the supplied bytes and
|
||||
* adds the modified range to the original method. For next update events, VTune Amplifier
|
||||
* does the same but it uses the latest modified version of a code region for update.
|
||||
* Eventually, VTune Amplifier GUI displays multiple code ranges for the method reported by
|
||||
* the iJVM_EVENT_TYPE_METHOD_LOAD event.
|
||||
* Notes:
|
||||
* - Multiple update events with different types for the same trace are allowed
|
||||
* but they must be reported for the same code ranges.
|
||||
* Example,
|
||||
* @code
|
||||
* [-- data---] Allowed
|
||||
* [-- code --] Allowed
|
||||
* [code] Ignored
|
||||
* [-- data---] Allowed
|
||||
* [-- code --] Allowed
|
||||
* [------------ trace ---------]
|
||||
* @endcode
|
||||
* - The types of previously reported events can be changed but they must be reported
|
||||
* for the same code ranges.
|
||||
* Example,
|
||||
* @code
|
||||
* [-- data---] Allowed
|
||||
* [-- code --] Allowed
|
||||
* [-- data---] Allowed
|
||||
* [-- code --] Allowed
|
||||
* [------------ trace ---------]
|
||||
* @endcode
|
||||
*/
|
||||
|
||||
typedef struct _iJIT_Method_Update
|
||||
{
|
||||
void* load_address; /**<\brief Start address of the update within a method */
|
||||
|
||||
unsigned int size; /**<\brief The update size */
|
||||
|
||||
iJIT_SegmentType type; /**<\brief Type of the update */
|
||||
|
||||
const char* data_format; /**<\brief C string that contains a format string
|
||||
* that follows the same specifications as format in printf.
|
||||
* The format string is used for iJIT_CT_CODE only
|
||||
* and cannot be NULL.
|
||||
* Format can be changed on the fly. */
|
||||
} *piJIT_Method_Update, iJIT_Method_Update;
|
||||
|
||||
/** @endcond */
|
||||
|
||||
#pragma pack(pop)
|
||||
|
||||
/** @cond exclude_from_documentation */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#ifndef JITAPI_CDECL
|
||||
# if defined WIN32 || defined _WIN32
|
||||
# define JITAPI_CDECL __cdecl
|
||||
# else /* defined WIN32 || defined _WIN32 */
|
||||
# if defined _M_IX86 || defined __i386__
|
||||
# define JITAPI_CDECL __attribute__ ((cdecl))
|
||||
# else /* _M_IX86 || __i386__ */
|
||||
# define JITAPI_CDECL /* actual only on x86_64 platform */
|
||||
# endif /* _M_IX86 || __i386__ */
|
||||
# endif /* defined WIN32 || defined _WIN32 */
|
||||
#endif /* JITAPI_CDECL */
|
||||
|
||||
#define JITAPI JITAPI_CDECL
|
||||
/** @endcond */
|
||||
|
||||
/**
|
||||
* @brief Generates a new unique method ID.
|
||||
*
|
||||
* You must use this API to obtain unique and valid method IDs for methods or
|
||||
* traces reported to the agent if you don't have your own mechanism to generate
|
||||
* unique method IDs.
|
||||
*
|
||||
* @return a new unique method ID. When out of unique method IDs, this API
|
||||
* returns 0, which is not an accepted value.
|
||||
*/
|
||||
unsigned int JITAPI iJIT_GetNewMethodID(void);
|
||||
|
||||
/**
|
||||
* @brief Returns the current mode of the agent.
|
||||
*
|
||||
* @return iJIT_SAMPLING_ON, indicating that agent is running, or
|
||||
* iJIT_NOTHING_RUNNING if no agent is running.
|
||||
*/
|
||||
iJIT_IsProfilingActiveFlags JITAPI iJIT_IsProfilingActive(void);
|
||||
|
||||
/**
|
||||
* @brief Reports infomation about JIT-compiled code to the agent.
|
||||
*
|
||||
* The reported information is used to attribute samples obtained from any
|
||||
* Intel(R) VTune(TM) Amplifier collector. This API needs to be called
|
||||
* after JIT compilation and before the first entry into the JIT-compiled
|
||||
* code.
|
||||
*
|
||||
* @param[in] event_type - type of the data sent to the agent
|
||||
* @param[in] EventSpecificData - pointer to event-specific data
|
||||
*
|
||||
* @returns 1 on success, otherwise 0.
|
||||
*/
|
||||
int JITAPI iJIT_NotifyEvent(iJIT_JVM_EVENT event_type, void *EventSpecificData);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
/** @endcond */
|
||||
|
||||
/** @} jitapi group */
|
||||
|
||||
#endif /* __JITPROFILING_H__ */
|
||||
+1039
File diff suppressed because it is too large
Load Diff
+71
@@ -0,0 +1,71 @@
|
||||
/* <copyright>
|
||||
This file is provided under a dual BSD/GPLv2 license. When using or
|
||||
redistributing this file, you may do so under either license.
|
||||
|
||||
GPL LICENSE SUMMARY
|
||||
|
||||
Copyright (c) 2005-2014 Intel Corporation. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of version 2 of the GNU General Public License as
|
||||
published by the Free Software Foundation.
|
||||
|
||||
This program is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
The full GNU General Public License is included in this distribution
|
||||
in the file called LICENSE.GPL.
|
||||
|
||||
Contact Information:
|
||||
http://software.intel.com/en-us/articles/intel-vtune-amplifier-xe/
|
||||
|
||||
BSD LICENSE
|
||||
|
||||
Copyright (c) 2005-2014 Intel Corporation. All rights reserved.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in
|
||||
the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
</copyright> */
|
||||
|
||||
#ifndef _LIBITTNOTIFY_H_
|
||||
#define _LIBITTNOTIFY_H_
|
||||
|
||||
#ifndef __ITT_INTERNAL_INCLUDE
|
||||
# if defined WIN32 || defined _WIN32
|
||||
# pragma message("WARNING!!! Include file libittnotify.h is deprecated and should not be included anymore")
|
||||
# else /* WIN32 */
|
||||
# warning "Include file libittnotify.h is deprecated and should not be included anymore"
|
||||
# endif /* WIN32 */
|
||||
#endif /* __ITT_INTERNAL_INCLUDE */
|
||||
#include "legacy/ittnotify.h"
|
||||
|
||||
#endif /* _LIBITTNOTIFY_H_ */
|
||||
@@ -0,0 +1,241 @@
|
||||
/* <copyright>
|
||||
This file is provided under a dual BSD/GPLv2 license. When using or
|
||||
redistributing this file, you may do so under either license.
|
||||
|
||||
GPL LICENSE SUMMARY
|
||||
|
||||
Copyright (c) 2005-2014 Intel Corporation. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of version 2 of the GNU General Public License as
|
||||
published by the Free Software Foundation.
|
||||
|
||||
This program is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
The full GNU General Public License is included in this distribution
|
||||
in the file called LICENSE.GPL.
|
||||
|
||||
Contact Information:
|
||||
http://software.intel.com/en-us/articles/intel-vtune-amplifier-xe/
|
||||
|
||||
BSD LICENSE
|
||||
|
||||
Copyright (c) 2005-2014 Intel Corporation. All rights reserved.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in
|
||||
the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
</copyright> */
|
||||
|
||||
/*
|
||||
* This file implements an interface bridge from Low-Level Virtual Machine
|
||||
* llvm::JITEventListener to Intel JIT Profiling API. It passes the function
|
||||
* and line information to the appropriate functions in the JIT profiling
|
||||
* interface so that any LLVM-based JIT engine can emit the JIT code
|
||||
* notifications that the profiler will receive.
|
||||
*
|
||||
* Usage model:
|
||||
*
|
||||
* 1. Register the listener implementation instance with the execution engine:
|
||||
*
|
||||
* #include <llvm_jit_event_listener.hpp>
|
||||
* ...
|
||||
* ExecutionEngine *TheExecutionEngine;
|
||||
* ...
|
||||
* TheExecutionEngine = EngineBuilder(TheModule).create();
|
||||
* ...
|
||||
* __itt_llvm_jit_event_listener jitListener;
|
||||
* TheExecutionEngine->RegisterJITEventListener(&jitListener);
|
||||
* ...
|
||||
*
|
||||
* 2. When compiling make sure to add the ITT API include directory to the
|
||||
* compiler include directories, ITT API library directory to the linker
|
||||
* library directories and link with jitprofling static library.
|
||||
*/
|
||||
|
||||
#ifndef __ITT_LLVM_JIT_EVENT_LISTENER_HPP__
|
||||
#define __ITT_LLVM_JIT_EVENT_LISTENER_HPP__
|
||||
|
||||
#include "jitprofiling.h"
|
||||
|
||||
#include <llvm/Function.h>
|
||||
#include <llvm/ExecutionEngine/JITEventListener.h>
|
||||
#include <llvm/ADT/StringRef.h>
|
||||
#include <llvm/Analysis/DebugInfo.h>
|
||||
|
||||
#include <map>
|
||||
#include <cassert>
|
||||
|
||||
// Uncomment the line below to turn on logging to stderr
|
||||
#define JITPROFILING_DEBUG_ENABLE
|
||||
|
||||
// Some elementary logging support
|
||||
#ifdef JITPROFILING_DEBUG_ENABLE
|
||||
#include <cstdio>
|
||||
#include <cstdarg>
|
||||
static void _jit_debug(const char* format, ...)
|
||||
{
|
||||
va_list args;
|
||||
va_start(args, format);
|
||||
vfprintf(stderr, format, args);
|
||||
va_end(args);
|
||||
}
|
||||
// Use the macro as JITDEBUG(("foo: %d", foo_val));
|
||||
#define JITDEBUG(x) \
|
||||
do { \
|
||||
_jit_debug("jit-listener: "); \
|
||||
_jit_debug x; \
|
||||
} \
|
||||
while (0)
|
||||
#else
|
||||
#define JITDEBUG(x)
|
||||
#endif
|
||||
|
||||
// LLVM JIT event listener, translates the notifications to the JIT profiling
|
||||
// API information.
|
||||
class __itt_llvm_jit_event_listener : public llvm::JITEventListener
|
||||
{
|
||||
public:
|
||||
__itt_llvm_jit_event_listener() {}
|
||||
|
||||
public:
|
||||
virtual void NotifyFunctionEmitted(const llvm::Function &F,
|
||||
void *Code, size_t Size, const EmittedFunctionDetails &Details)
|
||||
{
|
||||
std::string name = F.getName().str();
|
||||
JITDEBUG(("function jitted:\n"));
|
||||
JITDEBUG((" addr=0x%08x\n", (int)Code));
|
||||
JITDEBUG((" name=`%s'\n", name.c_str()));
|
||||
JITDEBUG((" code-size=%d\n", (int)Size));
|
||||
JITDEBUG((" line-infos-count=%d\n", Details.LineStarts.size()));
|
||||
|
||||
// The method must not be in the map - the entry must have been cleared
|
||||
// from the map in NotifyFreeingMachineCode in case of rejitting.
|
||||
assert(m_addr2MethodId.find(Code) == m_addr2MethodId.end());
|
||||
|
||||
int mid = iJIT_GetNewMethodID();
|
||||
m_addr2MethodId[Code] = mid;
|
||||
|
||||
iJIT_Method_Load mload;
|
||||
memset(&mload, 0, sizeof mload);
|
||||
mload.method_id = mid;
|
||||
|
||||
// Populate the method size and name information
|
||||
// TODO: The JIT profiling API should have members as const char pointers.
|
||||
mload.method_name = (char*)name.c_str();
|
||||
mload.method_load_address = Code;
|
||||
mload.method_size = (unsigned int)Size;
|
||||
|
||||
// Populate line information now.
|
||||
// From the JIT API documentation it is not quite clear whether the
|
||||
// line information can be given in ranges, so we'll populate it for
|
||||
// every byte of the function, hmm.
|
||||
std::string srcFilePath;
|
||||
std::vector<LineNumberInfo> lineInfos;
|
||||
char *addr = (char*)Code;
|
||||
char *lineAddr = addr; // Exclusive end point at which current
|
||||
// line info changes.
|
||||
const llvm::DebugLoc* loc = 0; // Current line info
|
||||
int lineIndex = -1; // Current index into the line info table
|
||||
for (int i = 0; i < Size; ++i, ++addr) {
|
||||
while (addr >= lineAddr) {
|
||||
if (lineIndex >= 0 && lineIndex < Details.LineStarts.size()) {
|
||||
loc = &Details.LineStarts[lineIndex].Loc;
|
||||
std::string p = getSrcFilePath(F.getContext(), *loc);
|
||||
assert(srcFilePath.empty() || p == srcFilePath);
|
||||
srcFilePath = p;
|
||||
} else {
|
||||
loc = NULL;
|
||||
}
|
||||
lineIndex++;
|
||||
if (lineIndex >= 0 && lineIndex < Details.LineStarts.size()) {
|
||||
lineAddr = (char*)Details.LineStarts[lineIndex].Address;
|
||||
} else {
|
||||
lineAddr = addr + Size;
|
||||
}
|
||||
}
|
||||
if (loc) {
|
||||
int line = loc->getLine();
|
||||
LineNumberInfo info = { i, line };
|
||||
lineInfos.push_back(info);
|
||||
JITDEBUG((" addr 0x%08x -> line %d\n", addr, line));
|
||||
}
|
||||
}
|
||||
if (!lineInfos.empty()) {
|
||||
mload.line_number_size = lineInfos.size();
|
||||
JITDEBUG((" translated to %d line infos to JIT", (int)lineInfos.size()));
|
||||
mload.line_number_table = &lineInfos[0];
|
||||
mload.source_file_name = (char*)srcFilePath.c_str();
|
||||
}
|
||||
|
||||
iJIT_NotifyEvent(iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED, &mload);
|
||||
}
|
||||
|
||||
virtual void NotifyFreeingMachineCode(void *OldPtr)
|
||||
{
|
||||
JITDEBUG(("function unjitted\n"));
|
||||
JITDEBUG((" addr=0x%08x\n", (int)OldPtr));
|
||||
Addr2MethodId::iterator it = m_addr2MethodId.find(OldPtr);
|
||||
assert(it != m_addr2MethodId.end());
|
||||
iJIT_Method_Id mid = { it->second };
|
||||
iJIT_NotifyEvent(iJVM_EVENT_TYPE_METHOD_UNLOAD_START, &mid);
|
||||
m_addr2MethodId.erase(it);
|
||||
}
|
||||
|
||||
private:
|
||||
std::string getSrcFilePath(const llvm::LLVMContext& ctx, const llvm::DebugLoc& loc)
|
||||
{
|
||||
llvm::MDNode* node = loc.getAsMDNode(ctx);
|
||||
llvm::DILocation srcLoc(node);
|
||||
return srcLoc.getDirectory().str() + "/" + srcLoc.getFilename().str();
|
||||
}
|
||||
|
||||
private:
|
||||
/// Don't copy
|
||||
__itt_llvm_jit_event_listener(const __itt_llvm_jit_event_listener&);
|
||||
__itt_llvm_jit_event_listener& operator=(const __itt_llvm_jit_event_listener&);
|
||||
|
||||
private:
|
||||
typedef std::vector<LineNumberInfo> LineInfoList;
|
||||
|
||||
// The method unload notification in VTune JIT profiling API takes the
|
||||
// method ID, not method address so have to maintain the mapping. Is
|
||||
// there a more efficient and simple way to do this like attaching the
|
||||
// method ID information somehow to the LLVM function instance?
|
||||
//
|
||||
// TODO: It would be more convenient for the JIT API to take the method
|
||||
// address, not method ID.
|
||||
typedef std::map<const void*, int> Addr2MethodId;
|
||||
Addr2MethodId m_addr2MethodId;
|
||||
};
|
||||
|
||||
#endif // Header guard
|
||||
@@ -0,0 +1,7 @@
|
||||
Copyright (c) 2011, Intel Corporation
|
||||
All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||
• Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||
• Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
• Neither the name of the Intel Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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.
|
||||
+65
@@ -0,0 +1,65 @@
|
||||
The GNU General Public License (GPL)
|
||||
Version 2, June 1991
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
Preamble
|
||||
The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too.
|
||||
When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things.
|
||||
To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it.
|
||||
For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.
|
||||
We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software.
|
||||
Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations.
|
||||
Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all.
|
||||
The precise terms and conditions for copying, distribution and modification follow.
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you".
|
||||
Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does.
|
||||
1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program.
|
||||
You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.
|
||||
2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:
|
||||
a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change.
|
||||
b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License.
|
||||
c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.)
|
||||
These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.
|
||||
Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program.
|
||||
In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.
|
||||
3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following:
|
||||
a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
|
||||
b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
|
||||
c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.)
|
||||
The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.
|
||||
If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code.
|
||||
4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.
|
||||
5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it.
|
||||
6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License.
|
||||
7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program.
|
||||
If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances.
|
||||
It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.
|
||||
This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.
|
||||
8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.
|
||||
9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
|
||||
Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation.
|
||||
10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.
|
||||
NO WARRANTY
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
END OF TERMS AND CONDITIONS
|
||||
How to Apply These Terms to Your New Programs
|
||||
If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.
|
||||
To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found.
|
||||
One line to give the program's name and a brief idea of what it does.
|
||||
Copyright (C) <year> <name of author>
|
||||
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
|
||||
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
If the program is interactive, make it output a short notice like this when it starts in an interactive mode:
|
||||
Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details.
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program.
|
||||
You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names:
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
signature of Ty Coon, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License.
|
||||
@@ -0,0 +1,77 @@
|
||||
/* <copyright>
|
||||
This file is provided under a dual BSD/GPLv2 license. When using or
|
||||
redistributing this file, you may do so under either license.
|
||||
|
||||
GPL LICENSE SUMMARY
|
||||
|
||||
Copyright (c) 2005-2014 Intel Corporation. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of version 2 of the GNU General Public License as
|
||||
published by the Free Software Foundation.
|
||||
|
||||
This program is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
The full GNU General Public License is included in this distribution
|
||||
in the file called LICENSE.GPL.
|
||||
|
||||
Contact Information:
|
||||
http://software.intel.com/en-us/articles/intel-vtune-amplifier-xe/
|
||||
|
||||
BSD LICENSE
|
||||
|
||||
Copyright (c) 2005-2014 Intel Corporation. All rights reserved.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in
|
||||
the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
</copyright> */
|
||||
|
||||
#include "ittnotify_config.h"
|
||||
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
|
||||
#pragma warning (disable: 593) /* parameter "XXXX" was set but never used */
|
||||
#pragma warning (disable: 344) /* typedef name has already been declared (with same type) */
|
||||
#pragma warning (disable: 174) /* expression has no effect */
|
||||
#pragma warning (disable: 4127) /* conditional expression is constant */
|
||||
#pragma warning (disable: 4306) /* conversion from '?' to '?' of greater size */
|
||||
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
|
||||
#if defined __INTEL_COMPILER
|
||||
|
||||
#pragma warning (disable: 869) /* parameter "XXXXX" was never referenced */
|
||||
#pragma warning (disable: 1418) /* external function definition with no prior declaration */
|
||||
#pragma warning (disable: 1419) /* external declaration in primary source file */
|
||||
|
||||
#endif /* __INTEL_COMPILER */
|
||||
+616
@@ -0,0 +1,616 @@
|
||||
/* <copyright>
|
||||
This file is provided under a dual BSD/GPLv2 license. When using or
|
||||
redistributing this file, you may do so under either license.
|
||||
|
||||
GPL LICENSE SUMMARY
|
||||
|
||||
Copyright (c) 2005-2014 Intel Corporation. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of version 2 of the GNU General Public License as
|
||||
published by the Free Software Foundation.
|
||||
|
||||
This program is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
The full GNU General Public License is included in this distribution
|
||||
in the file called LICENSE.GPL.
|
||||
|
||||
Contact Information:
|
||||
http://software.intel.com/en-us/articles/intel-vtune-amplifier-xe/
|
||||
|
||||
BSD LICENSE
|
||||
|
||||
Copyright (c) 2005-2014 Intel Corporation. All rights reserved.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in
|
||||
the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
</copyright> */
|
||||
#ifndef _ITTNOTIFY_CONFIG_H_
|
||||
#define _ITTNOTIFY_CONFIG_H_
|
||||
|
||||
/** @cond exclude_from_documentation */
|
||||
#ifndef ITT_OS_WIN
|
||||
# define ITT_OS_WIN 1
|
||||
#endif /* ITT_OS_WIN */
|
||||
|
||||
#ifndef ITT_OS_LINUX
|
||||
# define ITT_OS_LINUX 2
|
||||
#endif /* ITT_OS_LINUX */
|
||||
|
||||
#ifndef ITT_OS_MAC
|
||||
# define ITT_OS_MAC 3
|
||||
#endif /* ITT_OS_MAC */
|
||||
|
||||
#ifndef ITT_OS_FREEBSD
|
||||
# define ITT_OS_FREEBSD 4
|
||||
#endif /* ITT_OS_FREEBSD */
|
||||
|
||||
#ifndef ITT_OS
|
||||
# if defined WIN32 || defined _WIN32
|
||||
# define ITT_OS ITT_OS_WIN
|
||||
# elif defined( __APPLE__ ) && defined( __MACH__ )
|
||||
# define ITT_OS ITT_OS_MAC
|
||||
# elif defined( __FreeBSD__ )
|
||||
# define ITT_OS ITT_OS_FREEBSD
|
||||
# else
|
||||
# define ITT_OS ITT_OS_LINUX
|
||||
# endif
|
||||
#endif /* ITT_OS */
|
||||
|
||||
#ifndef ITT_PLATFORM_WIN
|
||||
# define ITT_PLATFORM_WIN 1
|
||||
#endif /* ITT_PLATFORM_WIN */
|
||||
|
||||
#ifndef ITT_PLATFORM_POSIX
|
||||
# define ITT_PLATFORM_POSIX 2
|
||||
#endif /* ITT_PLATFORM_POSIX */
|
||||
|
||||
#ifndef ITT_PLATFORM_MAC
|
||||
# define ITT_PLATFORM_MAC 3
|
||||
#endif /* ITT_PLATFORM_MAC */
|
||||
|
||||
#ifndef ITT_PLATFORM_FREEBSD
|
||||
# define ITT_PLATFORM_FREEBSD 4
|
||||
#endif /* ITT_PLATFORM_FREEBSD */
|
||||
|
||||
#ifndef ITT_PLATFORM
|
||||
# if ITT_OS==ITT_OS_WIN
|
||||
# define ITT_PLATFORM ITT_PLATFORM_WIN
|
||||
# elif ITT_OS==ITT_OS_MAC
|
||||
# define ITT_PLATFORM ITT_PLATFORM_MAC
|
||||
# elif ITT_OS==ITT_OS_FREEBSD
|
||||
# define ITT_PLATFORM ITT_PLATFORM_FREEBSD
|
||||
# else
|
||||
# define ITT_PLATFORM ITT_PLATFORM_POSIX
|
||||
# endif
|
||||
#endif /* ITT_PLATFORM */
|
||||
|
||||
#if defined(_UNICODE) && !defined(UNICODE)
|
||||
#define UNICODE
|
||||
#endif
|
||||
|
||||
#include <stddef.h>
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
#include <tchar.h>
|
||||
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
#include <stdint.h>
|
||||
#if defined(UNICODE) || defined(_UNICODE)
|
||||
#include <wchar.h>
|
||||
#endif /* UNICODE || _UNICODE */
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
|
||||
#ifndef ITTAPI_CDECL
|
||||
# if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
# define ITTAPI_CDECL __cdecl
|
||||
# else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
# if defined _M_IX86 || defined __i386__
|
||||
# define ITTAPI_CDECL __attribute__ ((cdecl))
|
||||
# else /* _M_IX86 || __i386__ */
|
||||
# define ITTAPI_CDECL /* actual only on x86 platform */
|
||||
# endif /* _M_IX86 || __i386__ */
|
||||
# endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
#endif /* ITTAPI_CDECL */
|
||||
|
||||
#ifndef STDCALL
|
||||
# if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
# define STDCALL __stdcall
|
||||
# else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
# if defined _M_IX86 || defined __i386__
|
||||
# define STDCALL __attribute__ ((stdcall))
|
||||
# else /* _M_IX86 || __i386__ */
|
||||
# define STDCALL /* supported only on x86 platform */
|
||||
# endif /* _M_IX86 || __i386__ */
|
||||
# endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
#endif /* STDCALL */
|
||||
|
||||
#define ITTAPI ITTAPI_CDECL
|
||||
#define LIBITTAPI ITTAPI_CDECL
|
||||
|
||||
/* TODO: Temporary for compatibility! */
|
||||
#define ITTAPI_CALL ITTAPI_CDECL
|
||||
#define LIBITTAPI_CALL ITTAPI_CDECL
|
||||
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
/* use __forceinline (VC++ specific) */
|
||||
#define ITT_INLINE __forceinline
|
||||
#define ITT_INLINE_ATTRIBUTE /* nothing */
|
||||
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
/*
|
||||
* Generally, functions are not inlined unless optimization is specified.
|
||||
* For functions declared inline, this attribute inlines the function even
|
||||
* if no optimization level was specified.
|
||||
*/
|
||||
#ifdef __STRICT_ANSI__
|
||||
#define ITT_INLINE static
|
||||
#define ITT_INLINE_ATTRIBUTE __attribute__((unused))
|
||||
#else /* __STRICT_ANSI__ */
|
||||
#define ITT_INLINE static inline
|
||||
#define ITT_INLINE_ATTRIBUTE __attribute__((always_inline, unused))
|
||||
#endif /* __STRICT_ANSI__ */
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
/** @endcond */
|
||||
|
||||
#ifndef ITT_ARCH_IA32
|
||||
# define ITT_ARCH_IA32 1
|
||||
#endif /* ITT_ARCH_IA32 */
|
||||
|
||||
#ifndef ITT_ARCH_IA32E
|
||||
# define ITT_ARCH_IA32E 2
|
||||
#endif /* ITT_ARCH_IA32E */
|
||||
|
||||
#ifndef ITT_ARCH_ARM
|
||||
# define ITT_ARCH_ARM 4
|
||||
#endif /* ITT_ARCH_ARM */
|
||||
|
||||
#ifndef ITT_ARCH_PPC64
|
||||
# define ITT_ARCH_PPC64 5
|
||||
#endif /* ITT_ARCH_PPC64 */
|
||||
|
||||
#ifndef ITT_ARCH
|
||||
# if defined _M_IX86 || defined __i386__
|
||||
# define ITT_ARCH ITT_ARCH_IA32
|
||||
# elif defined _M_X64 || defined _M_AMD64 || defined __x86_64__
|
||||
# define ITT_ARCH ITT_ARCH_IA32E
|
||||
# elif defined _M_IA64 || defined __ia64__
|
||||
# define ITT_ARCH ITT_ARCH_IA64
|
||||
# elif defined _M_ARM || defined __arm__
|
||||
# define ITT_ARCH ITT_ARCH_ARM
|
||||
# elif defined __powerpc64__
|
||||
# define ITT_ARCH ITT_ARCH_PPC64
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
# define ITT_EXTERN_C extern "C"
|
||||
# define ITT_EXTERN_C_BEGIN extern "C" {
|
||||
# define ITT_EXTERN_C_END }
|
||||
#else
|
||||
# define ITT_EXTERN_C /* nothing */
|
||||
# define ITT_EXTERN_C_BEGIN /* nothing */
|
||||
# define ITT_EXTERN_C_END /* nothing */
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#define ITT_TO_STR_AUX(x) #x
|
||||
#define ITT_TO_STR(x) ITT_TO_STR_AUX(x)
|
||||
|
||||
#define __ITT_BUILD_ASSERT(expr, suffix) do { \
|
||||
static char __itt_build_check_##suffix[(expr) ? 1 : -1]; \
|
||||
__itt_build_check_##suffix[0] = 0; \
|
||||
} while(0)
|
||||
#define _ITT_BUILD_ASSERT(expr, suffix) __ITT_BUILD_ASSERT((expr), suffix)
|
||||
#define ITT_BUILD_ASSERT(expr) _ITT_BUILD_ASSERT((expr), __LINE__)
|
||||
|
||||
#define ITT_MAGIC { 0xED, 0xAB, 0xAB, 0xEC, 0x0D, 0xEE, 0xDA, 0x30 }
|
||||
|
||||
/* Replace with snapshot date YYYYMMDD for promotion build. */
|
||||
#define API_VERSION_BUILD 20151119
|
||||
|
||||
#ifndef API_VERSION_NUM
|
||||
#define API_VERSION_NUM 0.0.0
|
||||
#endif /* API_VERSION_NUM */
|
||||
|
||||
#define API_VERSION "ITT-API-Version " ITT_TO_STR(API_VERSION_NUM) \
|
||||
" (" ITT_TO_STR(API_VERSION_BUILD) ")"
|
||||
|
||||
/* OS communication functions */
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
#include <windows.h>
|
||||
typedef HMODULE lib_t;
|
||||
typedef DWORD TIDT;
|
||||
typedef CRITICAL_SECTION mutex_t;
|
||||
#define MUTEX_INITIALIZER { 0 }
|
||||
#define strong_alias(name, aliasname) /* empty for Windows */
|
||||
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
#include <dlfcn.h>
|
||||
#if defined(UNICODE) || defined(_UNICODE)
|
||||
#include <wchar.h>
|
||||
#endif /* UNICODE */
|
||||
#ifndef _GNU_SOURCE
|
||||
#define _GNU_SOURCE 1 /* need for PTHREAD_MUTEX_RECURSIVE */
|
||||
#endif /* _GNU_SOURCE */
|
||||
#ifndef __USE_UNIX98
|
||||
#define __USE_UNIX98 1 /* need for PTHREAD_MUTEX_RECURSIVE, on SLES11.1 with gcc 4.3.4 wherein pthread.h missing dependency on __USE_XOPEN2K8 */
|
||||
#endif /*__USE_UNIX98*/
|
||||
#include <pthread.h>
|
||||
typedef void* lib_t;
|
||||
typedef pthread_t TIDT;
|
||||
typedef pthread_mutex_t mutex_t;
|
||||
#define MUTEX_INITIALIZER PTHREAD_MUTEX_INITIALIZER
|
||||
#define _strong_alias(name, aliasname) \
|
||||
extern __typeof (name) aliasname __attribute__ ((alias (#name)));
|
||||
#define strong_alias(name, aliasname) _strong_alias(name, aliasname)
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
#define __itt_get_proc(lib, name) GetProcAddress(lib, name)
|
||||
#define __itt_mutex_init(mutex) InitializeCriticalSection(mutex)
|
||||
#define __itt_mutex_lock(mutex) EnterCriticalSection(mutex)
|
||||
#define __itt_mutex_unlock(mutex) LeaveCriticalSection(mutex)
|
||||
#define __itt_load_lib(name) LoadLibraryA(name)
|
||||
#define __itt_unload_lib(handle) FreeLibrary(handle)
|
||||
#define __itt_system_error() (int)GetLastError()
|
||||
#define __itt_fstrcmp(s1, s2) lstrcmpA(s1, s2)
|
||||
#define __itt_fstrnlen(s, l) strnlen_s(s, l)
|
||||
#define __itt_fstrcpyn(s1, b, s2, l) strncpy_s(s1, b, s2, l)
|
||||
#define __itt_fstrdup(s) _strdup(s)
|
||||
#define __itt_thread_id() GetCurrentThreadId()
|
||||
#define __itt_thread_yield() SwitchToThread()
|
||||
#ifndef ITT_SIMPLE_INIT
|
||||
ITT_INLINE long
|
||||
__itt_interlocked_increment(volatile long* ptr) ITT_INLINE_ATTRIBUTE;
|
||||
ITT_INLINE long __itt_interlocked_increment(volatile long* ptr)
|
||||
{
|
||||
return InterlockedIncrement(ptr);
|
||||
}
|
||||
#endif /* ITT_SIMPLE_INIT */
|
||||
|
||||
#define DL_SYMBOLS (1)
|
||||
#define PTHREAD_SYMBOLS (1)
|
||||
|
||||
#else /* ITT_PLATFORM!=ITT_PLATFORM_WIN */
|
||||
#define __itt_get_proc(lib, name) dlsym(lib, name)
|
||||
#define __itt_mutex_init(mutex) {\
|
||||
pthread_mutexattr_t mutex_attr; \
|
||||
int error_code = pthread_mutexattr_init(&mutex_attr); \
|
||||
if (error_code) \
|
||||
__itt_report_error(__itt_error_system, "pthread_mutexattr_init", \
|
||||
error_code); \
|
||||
error_code = pthread_mutexattr_settype(&mutex_attr, \
|
||||
PTHREAD_MUTEX_RECURSIVE); \
|
||||
if (error_code) \
|
||||
__itt_report_error(__itt_error_system, "pthread_mutexattr_settype", \
|
||||
error_code); \
|
||||
error_code = pthread_mutex_init(mutex, &mutex_attr); \
|
||||
if (error_code) \
|
||||
__itt_report_error(__itt_error_system, "pthread_mutex_init", \
|
||||
error_code); \
|
||||
error_code = pthread_mutexattr_destroy(&mutex_attr); \
|
||||
if (error_code) \
|
||||
__itt_report_error(__itt_error_system, "pthread_mutexattr_destroy", \
|
||||
error_code); \
|
||||
}
|
||||
#define __itt_mutex_lock(mutex) pthread_mutex_lock(mutex)
|
||||
#define __itt_mutex_unlock(mutex) pthread_mutex_unlock(mutex)
|
||||
#define __itt_load_lib(name) dlopen(name, RTLD_LAZY)
|
||||
#define __itt_unload_lib(handle) dlclose(handle)
|
||||
#define __itt_system_error() errno
|
||||
#define __itt_fstrcmp(s1, s2) strcmp(s1, s2)
|
||||
|
||||
/* makes customer code define safe APIs for SDL_STRNLEN_S and SDL_STRNCPY_S */
|
||||
#ifdef SDL_STRNLEN_S
|
||||
#define __itt_fstrnlen(s, l) SDL_STRNLEN_S(s, l)
|
||||
#else
|
||||
#define __itt_fstrnlen(s, l) strlen(s)
|
||||
#endif /* SDL_STRNLEN_S */
|
||||
#ifdef SDL_STRNCPY_S
|
||||
#define __itt_fstrcpyn(s1, b, s2, l) SDL_STRNCPY_S(s1, b, s2, l)
|
||||
#else
|
||||
#define __itt_fstrcpyn(s1, b, s2, l) strncpy(s1, s2, b)
|
||||
#endif /* SDL_STRNCPY_S */
|
||||
|
||||
#define __itt_fstrdup(s) strdup(s)
|
||||
#define __itt_thread_id() pthread_self()
|
||||
#define __itt_thread_yield() sched_yield()
|
||||
#if ITT_ARCH==ITT_ARCH_IA64
|
||||
#ifdef __INTEL_COMPILER
|
||||
#define __TBB_machine_fetchadd4(addr, val) __fetchadd4_acq((void *)addr, val)
|
||||
#else /* __INTEL_COMPILER */
|
||||
/* TODO: Add Support for not Intel compilers for IA-64 architecture */
|
||||
#endif /* __INTEL_COMPILER */
|
||||
#elif ITT_ARCH==ITT_ARCH_IA32 || ITT_ARCH==ITT_ARCH_IA32E /* ITT_ARCH!=ITT_ARCH_IA64 */
|
||||
ITT_INLINE long
|
||||
__TBB_machine_fetchadd4(volatile void* ptr, long addend) ITT_INLINE_ATTRIBUTE;
|
||||
ITT_INLINE long __TBB_machine_fetchadd4(volatile void* ptr, long addend)
|
||||
{
|
||||
long result;
|
||||
__asm__ __volatile__("lock\nxadd %0,%1"
|
||||
: "=r"(result),"=m"(*(int*)ptr)
|
||||
: "0"(addend), "m"(*(int*)ptr)
|
||||
: "memory");
|
||||
return result;
|
||||
}
|
||||
#elif ITT_ARCH==ITT_ARCH_ARM || ITT_ARCH==ITT_ARCH_PPC64
|
||||
#define __TBB_machine_fetchadd4(addr, val) __sync_fetch_and_add(addr, val)
|
||||
#endif /* ITT_ARCH==ITT_ARCH_IA64 */
|
||||
#ifndef ITT_SIMPLE_INIT
|
||||
ITT_INLINE long
|
||||
__itt_interlocked_increment(volatile long* ptr) ITT_INLINE_ATTRIBUTE;
|
||||
ITT_INLINE long __itt_interlocked_increment(volatile long* ptr)
|
||||
{
|
||||
return __TBB_machine_fetchadd4(ptr, 1) + 1L;
|
||||
}
|
||||
#endif /* ITT_SIMPLE_INIT */
|
||||
|
||||
void* dlopen(const char*, int) __attribute__((weak));
|
||||
void* dlsym(void*, const char*) __attribute__((weak));
|
||||
int dlclose(void*) __attribute__((weak));
|
||||
#define DL_SYMBOLS (dlopen && dlsym && dlclose)
|
||||
|
||||
int pthread_mutex_init(pthread_mutex_t*, const pthread_mutexattr_t*) __attribute__((weak));
|
||||
int pthread_mutex_lock(pthread_mutex_t*) __attribute__((weak));
|
||||
int pthread_mutex_unlock(pthread_mutex_t*) __attribute__((weak));
|
||||
int pthread_mutex_destroy(pthread_mutex_t*) __attribute__((weak));
|
||||
int pthread_mutexattr_init(pthread_mutexattr_t*) __attribute__((weak));
|
||||
int pthread_mutexattr_settype(pthread_mutexattr_t*, int) __attribute__((weak));
|
||||
int pthread_mutexattr_destroy(pthread_mutexattr_t*) __attribute__((weak));
|
||||
pthread_t pthread_self(void) __attribute__((weak));
|
||||
#define PTHREAD_SYMBOLS (pthread_mutex_init && pthread_mutex_lock && pthread_mutex_unlock && pthread_mutex_destroy && pthread_mutexattr_init && pthread_mutexattr_settype && pthread_mutexattr_destroy && pthread_self)
|
||||
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
|
||||
typedef enum {
|
||||
__itt_collection_normal = 0,
|
||||
__itt_collection_paused = 1
|
||||
} __itt_collection_state;
|
||||
|
||||
typedef enum {
|
||||
__itt_thread_normal = 0,
|
||||
__itt_thread_ignored = 1
|
||||
} __itt_thread_state;
|
||||
|
||||
#pragma pack(push, 8)
|
||||
|
||||
typedef struct ___itt_thread_info
|
||||
{
|
||||
const char* nameA; /*!< Copy of original name in ASCII. */
|
||||
#if defined(UNICODE) || defined(_UNICODE)
|
||||
const wchar_t* nameW; /*!< Copy of original name in UNICODE. */
|
||||
#else /* UNICODE || _UNICODE */
|
||||
void* nameW;
|
||||
#endif /* UNICODE || _UNICODE */
|
||||
TIDT tid;
|
||||
__itt_thread_state state; /*!< Thread state (paused or normal) */
|
||||
int extra1; /*!< Reserved to the runtime */
|
||||
void* extra2; /*!< Reserved to the runtime */
|
||||
struct ___itt_thread_info* next;
|
||||
} __itt_thread_info;
|
||||
|
||||
#include "ittnotify_types.h" /* For __itt_group_id definition */
|
||||
|
||||
typedef struct ___itt_api_info_20101001
|
||||
{
|
||||
const char* name;
|
||||
void** func_ptr;
|
||||
void* init_func;
|
||||
__itt_group_id group;
|
||||
} __itt_api_info_20101001;
|
||||
|
||||
typedef struct ___itt_api_info
|
||||
{
|
||||
const char* name;
|
||||
void** func_ptr;
|
||||
void* init_func;
|
||||
void* null_func;
|
||||
__itt_group_id group;
|
||||
} __itt_api_info;
|
||||
|
||||
typedef struct __itt_counter_info
|
||||
{
|
||||
const char* nameA; /*!< Copy of original name in ASCII. */
|
||||
#if defined(UNICODE) || defined(_UNICODE)
|
||||
const wchar_t* nameW; /*!< Copy of original name in UNICODE. */
|
||||
#else /* UNICODE || _UNICODE */
|
||||
void* nameW;
|
||||
#endif /* UNICODE || _UNICODE */
|
||||
const char* domainA; /*!< Copy of original name in ASCII. */
|
||||
#if defined(UNICODE) || defined(_UNICODE)
|
||||
const wchar_t* domainW; /*!< Copy of original name in UNICODE. */
|
||||
#else /* UNICODE || _UNICODE */
|
||||
void* domainW;
|
||||
#endif /* UNICODE || _UNICODE */
|
||||
int type;
|
||||
long index;
|
||||
int extra1; /*!< Reserved to the runtime */
|
||||
void* extra2; /*!< Reserved to the runtime */
|
||||
struct __itt_counter_info* next;
|
||||
} __itt_counter_info_t;
|
||||
|
||||
struct ___itt_domain;
|
||||
struct ___itt_string_handle;
|
||||
|
||||
typedef struct ___itt_global
|
||||
{
|
||||
unsigned char magic[8];
|
||||
unsigned long version_major;
|
||||
unsigned long version_minor;
|
||||
unsigned long version_build;
|
||||
volatile long api_initialized;
|
||||
volatile long mutex_initialized;
|
||||
volatile long atomic_counter;
|
||||
mutex_t mutex;
|
||||
lib_t lib;
|
||||
void* error_handler;
|
||||
const char** dll_path_ptr;
|
||||
__itt_api_info* api_list_ptr;
|
||||
struct ___itt_global* next;
|
||||
/* Joinable structures below */
|
||||
__itt_thread_info* thread_list;
|
||||
struct ___itt_domain* domain_list;
|
||||
struct ___itt_string_handle* string_list;
|
||||
__itt_collection_state state;
|
||||
__itt_counter_info_t* counter_list;
|
||||
} __itt_global;
|
||||
|
||||
#pragma pack(pop)
|
||||
|
||||
#define NEW_THREAD_INFO_W(gptr,h,h_tail,t,s,n) { \
|
||||
h = (__itt_thread_info*)malloc(sizeof(__itt_thread_info)); \
|
||||
if (h != NULL) { \
|
||||
h->tid = t; \
|
||||
h->nameA = NULL; \
|
||||
h->nameW = n ? _wcsdup(n) : NULL; \
|
||||
h->state = s; \
|
||||
h->extra1 = 0; /* reserved */ \
|
||||
h->extra2 = NULL; /* reserved */ \
|
||||
h->next = NULL; \
|
||||
if (h_tail == NULL) \
|
||||
(gptr)->thread_list = h; \
|
||||
else \
|
||||
h_tail->next = h; \
|
||||
} \
|
||||
}
|
||||
|
||||
#define NEW_THREAD_INFO_A(gptr,h,h_tail,t,s,n) { \
|
||||
h = (__itt_thread_info*)malloc(sizeof(__itt_thread_info)); \
|
||||
if (h != NULL) { \
|
||||
h->tid = t; \
|
||||
h->nameA = n ? __itt_fstrdup(n) : NULL; \
|
||||
h->nameW = NULL; \
|
||||
h->state = s; \
|
||||
h->extra1 = 0; /* reserved */ \
|
||||
h->extra2 = NULL; /* reserved */ \
|
||||
h->next = NULL; \
|
||||
if (h_tail == NULL) \
|
||||
(gptr)->thread_list = h; \
|
||||
else \
|
||||
h_tail->next = h; \
|
||||
} \
|
||||
}
|
||||
|
||||
#define NEW_DOMAIN_W(gptr,h,h_tail,name) { \
|
||||
h = (__itt_domain*)malloc(sizeof(__itt_domain)); \
|
||||
if (h != NULL) { \
|
||||
h->flags = 1; /* domain is enabled by default */ \
|
||||
h->nameA = NULL; \
|
||||
h->nameW = name ? _wcsdup(name) : NULL; \
|
||||
h->extra1 = 0; /* reserved */ \
|
||||
h->extra2 = NULL; /* reserved */ \
|
||||
h->next = NULL; \
|
||||
if (h_tail == NULL) \
|
||||
(gptr)->domain_list = h; \
|
||||
else \
|
||||
h_tail->next = h; \
|
||||
} \
|
||||
}
|
||||
|
||||
#define NEW_DOMAIN_A(gptr,h,h_tail,name) { \
|
||||
h = (__itt_domain*)malloc(sizeof(__itt_domain)); \
|
||||
if (h != NULL) { \
|
||||
h->flags = 1; /* domain is enabled by default */ \
|
||||
h->nameA = name ? __itt_fstrdup(name) : NULL; \
|
||||
h->nameW = NULL; \
|
||||
h->extra1 = 0; /* reserved */ \
|
||||
h->extra2 = NULL; /* reserved */ \
|
||||
h->next = NULL; \
|
||||
if (h_tail == NULL) \
|
||||
(gptr)->domain_list = h; \
|
||||
else \
|
||||
h_tail->next = h; \
|
||||
} \
|
||||
}
|
||||
|
||||
#define NEW_STRING_HANDLE_W(gptr,h,h_tail,name) { \
|
||||
h = (__itt_string_handle*)malloc(sizeof(__itt_string_handle)); \
|
||||
if (h != NULL) { \
|
||||
h->strA = NULL; \
|
||||
h->strW = name ? _wcsdup(name) : NULL; \
|
||||
h->extra1 = 0; /* reserved */ \
|
||||
h->extra2 = NULL; /* reserved */ \
|
||||
h->next = NULL; \
|
||||
if (h_tail == NULL) \
|
||||
(gptr)->string_list = h; \
|
||||
else \
|
||||
h_tail->next = h; \
|
||||
} \
|
||||
}
|
||||
|
||||
#define NEW_STRING_HANDLE_A(gptr,h,h_tail,name) { \
|
||||
h = (__itt_string_handle*)malloc(sizeof(__itt_string_handle)); \
|
||||
if (h != NULL) { \
|
||||
h->strA = name ? __itt_fstrdup(name) : NULL; \
|
||||
h->strW = NULL; \
|
||||
h->extra1 = 0; /* reserved */ \
|
||||
h->extra2 = NULL; /* reserved */ \
|
||||
h->next = NULL; \
|
||||
if (h_tail == NULL) \
|
||||
(gptr)->string_list = h; \
|
||||
else \
|
||||
h_tail->next = h; \
|
||||
} \
|
||||
}
|
||||
|
||||
#define NEW_COUNTER_W(gptr,h,h_tail,name,domain,type) { \
|
||||
h = (__itt_counter_info_t*)malloc(sizeof(__itt_counter_info_t)); \
|
||||
if (h != NULL) { \
|
||||
h->nameA = NULL; \
|
||||
h->nameW = name ? _wcsdup(name) : NULL; \
|
||||
h->domainA = NULL; \
|
||||
h->domainW = name ? _wcsdup(domain) : NULL; \
|
||||
h->type = type; \
|
||||
h->index = 0; \
|
||||
h->next = NULL; \
|
||||
if (h_tail == NULL) \
|
||||
(gptr)->counter_list = h; \
|
||||
else \
|
||||
h_tail->next = h; \
|
||||
} \
|
||||
}
|
||||
|
||||
#define NEW_COUNTER_A(gptr,h,h_tail,name,domain,type) { \
|
||||
h = (__itt_counter_info_t*)malloc(sizeof(__itt_counter_info_t)); \
|
||||
if (h != NULL) { \
|
||||
h->nameA = name ? __itt_fstrdup(name) : NULL; \
|
||||
h->nameW = NULL; \
|
||||
h->domainA = domain ? __itt_fstrdup(domain) : NULL; \
|
||||
h->domainW = NULL; \
|
||||
h->type = type; \
|
||||
h->index = 0; \
|
||||
h->next = NULL; \
|
||||
if (h_tail == NULL) \
|
||||
(gptr)->counter_list = h; \
|
||||
else \
|
||||
h_tail->next = h; \
|
||||
} \
|
||||
}
|
||||
|
||||
#endif /* _ITTNOTIFY_CONFIG_H_ */
|
||||
+1236
File diff suppressed because it is too large
Load Diff
+389
@@ -0,0 +1,389 @@
|
||||
/* <copyright>
|
||||
This file is provided under a dual BSD/GPLv2 license. When using or
|
||||
redistributing this file, you may do so under either license.
|
||||
|
||||
GPL LICENSE SUMMARY
|
||||
|
||||
Copyright (c) 2005-2014 Intel Corporation. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of version 2 of the GNU General Public License as
|
||||
published by the Free Software Foundation.
|
||||
|
||||
This program is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
The full GNU General Public License is included in this distribution
|
||||
in the file called LICENSE.GPL.
|
||||
|
||||
Contact Information:
|
||||
http://software.intel.com/en-us/articles/intel-vtune-amplifier-xe/
|
||||
|
||||
BSD LICENSE
|
||||
|
||||
Copyright (c) 2005-2014 Intel Corporation. All rights reserved.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in
|
||||
the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
</copyright> */
|
||||
|
||||
#include "ittnotify_config.h"
|
||||
|
||||
#ifndef ITT_FORMAT_DEFINED
|
||||
# ifndef ITT_FORMAT
|
||||
# define ITT_FORMAT
|
||||
# endif /* ITT_FORMAT */
|
||||
# ifndef ITT_NO_PARAMS
|
||||
# define ITT_NO_PARAMS
|
||||
# endif /* ITT_NO_PARAMS */
|
||||
#endif /* ITT_FORMAT_DEFINED */
|
||||
|
||||
/*
|
||||
* parameters for macro expected:
|
||||
* ITT_STUB(api, type, func_name, arguments, params, func_name_in_dll, group, printf_fmt)
|
||||
*/
|
||||
#ifdef __ITT_INTERNAL_INIT
|
||||
|
||||
#ifndef __ITT_INTERNAL_BODY
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
ITT_STUB(ITTAPI, __itt_domain*, domain_createA, (const char *name), (ITT_FORMAT name), domain_createA, __itt_group_structure, "\"%s\"")
|
||||
ITT_STUB(ITTAPI, __itt_domain*, domain_createW, (const wchar_t *name), (ITT_FORMAT name), domain_createW, __itt_group_structure, "\"%S\"")
|
||||
#else /* ITT_PLATFORM!=ITT_PLATFORM_WIN */
|
||||
ITT_STUB(ITTAPI, __itt_domain*, domain_create, (const char *name), (ITT_FORMAT name), domain_create, __itt_group_structure, "\"%s\"")
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
ITT_STUB(ITTAPI, __itt_string_handle*, string_handle_createA, (const char *name), (ITT_FORMAT name), string_handle_createA, __itt_group_structure, "\"%s\"")
|
||||
ITT_STUB(ITTAPI, __itt_string_handle*, string_handle_createW, (const wchar_t *name), (ITT_FORMAT name), string_handle_createW, __itt_group_structure, "\"%S\"")
|
||||
#else /* ITT_PLATFORM!=ITT_PLATFORM_WIN */
|
||||
ITT_STUB(ITTAPI, __itt_string_handle*, string_handle_create, (const char *name), (ITT_FORMAT name), string_handle_create, __itt_group_structure, "\"%s\"")
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
ITT_STUB(ITTAPI, __itt_counter, counter_createA, (const char *name, const char *domain), (ITT_FORMAT name, domain), counter_createA, __itt_group_counter, "\"%s\", \"%s\"")
|
||||
ITT_STUB(ITTAPI, __itt_counter, counter_createW, (const wchar_t *name, const wchar_t *domain), (ITT_FORMAT name, domain), counter_createW, __itt_group_counter, "\"%s\", \"%s\"")
|
||||
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
ITT_STUB(ITTAPI, __itt_counter, counter_create, (const char *name, const char *domain), (ITT_FORMAT name, domain), counter_create, __itt_group_counter, "\"%s\", \"%s\"")
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
ITT_STUB(ITTAPI, __itt_counter, counter_create_typedA, (const char *name, const char *domain, __itt_metadata_type type), (ITT_FORMAT name, domain, type), counter_create_typedA, __itt_group_counter, "\"%s\", \"%s\", %d")
|
||||
ITT_STUB(ITTAPI, __itt_counter, counter_create_typedW, (const wchar_t *name, const wchar_t *domain, __itt_metadata_type type), (ITT_FORMAT name, domain, type), counter_create_typedW, __itt_group_counter, "\"%s\", \"%s\", %d")
|
||||
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
ITT_STUB(ITTAPI, __itt_counter, counter_create_typed, (const char *name, const char *domain, __itt_metadata_type type), (ITT_FORMAT name, domain, type), counter_create_typed, __itt_group_counter, "\"%s\", \"%s\", %d")
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
|
||||
|
||||
ITT_STUBV(ITTAPI, void, pause, (void), (ITT_NO_PARAMS), pause, __itt_group_control | __itt_group_legacy, "no args")
|
||||
ITT_STUBV(ITTAPI, void, resume, (void), (ITT_NO_PARAMS), resume, __itt_group_control | __itt_group_legacy, "no args")
|
||||
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
ITT_STUBV(ITTAPI, void, thread_set_nameA, (const char *name), (ITT_FORMAT name), thread_set_nameA, __itt_group_thread, "\"%s\"")
|
||||
ITT_STUBV(ITTAPI, void, thread_set_nameW, (const wchar_t *name), (ITT_FORMAT name), thread_set_nameW, __itt_group_thread, "\"%S\"")
|
||||
#else /* ITT_PLATFORM!=ITT_PLATFORM_WIN */
|
||||
ITT_STUBV(ITTAPI, void, thread_set_name, (const char *name), (ITT_FORMAT name), thread_set_name, __itt_group_thread, "\"%s\"")
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
ITT_STUBV(ITTAPI, void, thread_ignore, (void), (ITT_NO_PARAMS), thread_ignore, __itt_group_thread, "no args")
|
||||
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
ITT_STUB(LIBITTAPI, int, thr_name_setA, (const char *name, int namelen), (ITT_FORMAT name, namelen), thr_name_setA, __itt_group_thread | __itt_group_legacy, "\"%s\", %d")
|
||||
ITT_STUB(LIBITTAPI, int, thr_name_setW, (const wchar_t *name, int namelen), (ITT_FORMAT name, namelen), thr_name_setW, __itt_group_thread | __itt_group_legacy, "\"%S\", %d")
|
||||
#else /* ITT_PLATFORM!=ITT_PLATFORM_WIN */
|
||||
ITT_STUB(LIBITTAPI, int, thr_name_set, (const char *name, int namelen), (ITT_FORMAT name, namelen), thr_name_set, __itt_group_thread | __itt_group_legacy, "\"%s\", %d")
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
ITT_STUBV(LIBITTAPI, void, thr_ignore, (void), (ITT_NO_PARAMS), thr_ignore, __itt_group_thread | __itt_group_legacy, "no args")
|
||||
#endif /* __ITT_INTERNAL_BODY */
|
||||
|
||||
ITT_STUBV(ITTAPI, void, enable_attach, (void), (ITT_NO_PARAMS), enable_attach, __itt_group_all, "no args")
|
||||
|
||||
#else /* __ITT_INTERNAL_INIT */
|
||||
|
||||
ITT_STUBV(ITTAPI, void, detach, (void), (ITT_NO_PARAMS), detach, __itt_group_control | __itt_group_legacy, "no args")
|
||||
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
ITT_STUBV(ITTAPI, void, sync_createA, (void *addr, const char *objtype, const char *objname, int attribute), (ITT_FORMAT addr, objtype, objname, attribute), sync_createA, __itt_group_sync | __itt_group_fsync, "%p, \"%s\", \"%s\", %x")
|
||||
ITT_STUBV(ITTAPI, void, sync_createW, (void *addr, const wchar_t *objtype, const wchar_t *objname, int attribute), (ITT_FORMAT addr, objtype, objname, attribute), sync_createW, __itt_group_sync | __itt_group_fsync, "%p, \"%S\", \"%S\", %x")
|
||||
ITT_STUBV(ITTAPI, void, sync_renameA, (void *addr, const char *name), (ITT_FORMAT addr, name), sync_renameA, __itt_group_sync | __itt_group_fsync, "%p, \"%s\"")
|
||||
ITT_STUBV(ITTAPI, void, sync_renameW, (void *addr, const wchar_t *name), (ITT_FORMAT addr, name), sync_renameW, __itt_group_sync | __itt_group_fsync, "%p, \"%S\"")
|
||||
#else /* ITT_PLATFORM!=ITT_PLATFORM_WIN */
|
||||
ITT_STUBV(ITTAPI, void, sync_create, (void *addr, const char *objtype, const char *objname, int attribute), (ITT_FORMAT addr, objtype, objname, attribute), sync_create, __itt_group_sync | __itt_group_fsync, "%p, \"%s\", \"%s\", %x")
|
||||
ITT_STUBV(ITTAPI, void, sync_rename, (void *addr, const char *name), (ITT_FORMAT addr, name), sync_rename, __itt_group_sync | __itt_group_fsync, "%p, \"%s\"")
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
ITT_STUBV(ITTAPI, void, sync_destroy, (void *addr), (ITT_FORMAT addr), sync_destroy, __itt_group_sync | __itt_group_fsync, "%p")
|
||||
|
||||
ITT_STUBV(ITTAPI, void, sync_prepare, (void* addr), (ITT_FORMAT addr), sync_prepare, __itt_group_sync, "%p")
|
||||
ITT_STUBV(ITTAPI, void, sync_cancel, (void *addr), (ITT_FORMAT addr), sync_cancel, __itt_group_sync, "%p")
|
||||
ITT_STUBV(ITTAPI, void, sync_acquired, (void *addr), (ITT_FORMAT addr), sync_acquired, __itt_group_sync, "%p")
|
||||
ITT_STUBV(ITTAPI, void, sync_releasing, (void* addr), (ITT_FORMAT addr), sync_releasing, __itt_group_sync, "%p")
|
||||
|
||||
ITT_STUBV(ITTAPI, void, suppress_push, (unsigned int mask), (ITT_FORMAT mask), suppress_push, __itt_group_suppress, "%p")
|
||||
ITT_STUBV(ITTAPI, void, suppress_pop, (void), (ITT_NO_PARAMS), suppress_pop, __itt_group_suppress, "no args")
|
||||
ITT_STUBV(ITTAPI, void, suppress_mark_range, (__itt_suppress_mode_t mode, unsigned int mask, void * address, size_t size),(ITT_FORMAT mode, mask, address, size), suppress_mark_range, __itt_group_suppress, "%d, %p, %p, %d")
|
||||
ITT_STUBV(ITTAPI, void, suppress_clear_range,(__itt_suppress_mode_t mode, unsigned int mask, void * address, size_t size),(ITT_FORMAT mode, mask, address, size), suppress_clear_range,__itt_group_suppress, "%d, %p, %p, %d")
|
||||
|
||||
ITT_STUBV(ITTAPI, void, fsync_prepare, (void* addr), (ITT_FORMAT addr), sync_prepare, __itt_group_fsync, "%p")
|
||||
ITT_STUBV(ITTAPI, void, fsync_cancel, (void *addr), (ITT_FORMAT addr), sync_cancel, __itt_group_fsync, "%p")
|
||||
ITT_STUBV(ITTAPI, void, fsync_acquired, (void *addr), (ITT_FORMAT addr), sync_acquired, __itt_group_fsync, "%p")
|
||||
ITT_STUBV(ITTAPI, void, fsync_releasing, (void* addr), (ITT_FORMAT addr), sync_releasing, __itt_group_fsync, "%p")
|
||||
|
||||
ITT_STUBV(ITTAPI, void, model_site_begin, (__itt_model_site *site, __itt_model_site_instance *instance, const char *name), (ITT_FORMAT site, instance, name), model_site_begin, __itt_group_model, "%p, %p, \"%s\"")
|
||||
ITT_STUBV(ITTAPI, void, model_site_end, (__itt_model_site *site, __itt_model_site_instance *instance), (ITT_FORMAT site, instance), model_site_end, __itt_group_model, "%p, %p")
|
||||
ITT_STUBV(ITTAPI, void, model_task_begin, (__itt_model_task *task, __itt_model_task_instance *instance, const char *name), (ITT_FORMAT task, instance, name), model_task_begin, __itt_group_model, "%p, %p, \"%s\"")
|
||||
ITT_STUBV(ITTAPI, void, model_task_end, (__itt_model_task *task, __itt_model_task_instance *instance), (ITT_FORMAT task, instance), model_task_end, __itt_group_model, "%p, %p")
|
||||
ITT_STUBV(ITTAPI, void, model_lock_acquire, (void *lock), (ITT_FORMAT lock), model_lock_acquire, __itt_group_model, "%p")
|
||||
ITT_STUBV(ITTAPI, void, model_lock_release, (void *lock), (ITT_FORMAT lock), model_lock_release, __itt_group_model, "%p")
|
||||
ITT_STUBV(ITTAPI, void, model_record_allocation, (void *addr, size_t size), (ITT_FORMAT addr, size), model_record_allocation, __itt_group_model, "%p, %d")
|
||||
ITT_STUBV(ITTAPI, void, model_record_deallocation, (void *addr), (ITT_FORMAT addr), model_record_deallocation, __itt_group_model, "%p")
|
||||
ITT_STUBV(ITTAPI, void, model_induction_uses, (void* addr, size_t size), (ITT_FORMAT addr, size), model_induction_uses, __itt_group_model, "%p, %d")
|
||||
ITT_STUBV(ITTAPI, void, model_reduction_uses, (void* addr, size_t size), (ITT_FORMAT addr, size), model_reduction_uses, __itt_group_model, "%p, %d")
|
||||
ITT_STUBV(ITTAPI, void, model_observe_uses, (void* addr, size_t size), (ITT_FORMAT addr, size), model_observe_uses, __itt_group_model, "%p, %d")
|
||||
ITT_STUBV(ITTAPI, void, model_clear_uses, (void* addr), (ITT_FORMAT addr), model_clear_uses, __itt_group_model, "%p")
|
||||
|
||||
#ifndef __ITT_INTERNAL_BODY
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
ITT_STUBV(ITTAPI, void, model_site_beginW, (const wchar_t *name), (ITT_FORMAT name), model_site_beginW, __itt_group_model, "\"%s\"")
|
||||
ITT_STUBV(ITTAPI, void, model_task_beginW, (const wchar_t *name), (ITT_FORMAT name), model_task_beginW, __itt_group_model, "\"%s\"")
|
||||
ITT_STUBV(ITTAPI, void, model_iteration_taskW, (const wchar_t *name), (ITT_FORMAT name), model_iteration_taskW, __itt_group_model, "\"%s\"")
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
ITT_STUBV(ITTAPI, void, model_site_beginA, (const char *name), (ITT_FORMAT name), model_site_beginA, __itt_group_model, "\"%s\"")
|
||||
ITT_STUBV(ITTAPI, void, model_site_beginAL, (const char *name, size_t len), (ITT_FORMAT name, len), model_site_beginAL, __itt_group_model, "\"%s\", %d")
|
||||
ITT_STUBV(ITTAPI, void, model_task_beginA, (const char *name), (ITT_FORMAT name), model_task_beginA, __itt_group_model, "\"%s\"")
|
||||
ITT_STUBV(ITTAPI, void, model_task_beginAL, (const char *name, size_t len), (ITT_FORMAT name, len), model_task_beginAL, __itt_group_model, "\"%s\", %d")
|
||||
ITT_STUBV(ITTAPI, void, model_iteration_taskA, (const char *name), (ITT_FORMAT name), model_iteration_taskA, __itt_group_model, "\"%s\"")
|
||||
ITT_STUBV(ITTAPI, void, model_iteration_taskAL, (const char *name, size_t len), (ITT_FORMAT name, len), model_iteration_taskAL, __itt_group_model, "\"%s\", %d")
|
||||
ITT_STUBV(ITTAPI, void, model_site_end_2, (void), (ITT_NO_PARAMS), model_site_end_2, __itt_group_model, "no args")
|
||||
ITT_STUBV(ITTAPI, void, model_task_end_2, (void), (ITT_NO_PARAMS), model_task_end_2, __itt_group_model, "no args")
|
||||
ITT_STUBV(ITTAPI, void, model_lock_acquire_2, (void *lock), (ITT_FORMAT lock), model_lock_acquire_2, __itt_group_model, "%p")
|
||||
ITT_STUBV(ITTAPI, void, model_lock_release_2, (void *lock), (ITT_FORMAT lock), model_lock_release_2, __itt_group_model, "%p")
|
||||
ITT_STUBV(ITTAPI, void, model_aggregate_task, (size_t count), (ITT_FORMAT count), model_aggregate_task, __itt_group_model, "%d")
|
||||
ITT_STUBV(ITTAPI, void, model_disable_push, (__itt_model_disable x), (ITT_FORMAT x), model_disable_push, __itt_group_model, "%p")
|
||||
ITT_STUBV(ITTAPI, void, model_disable_pop, (void), (ITT_NO_PARAMS), model_disable_pop, __itt_group_model, "no args")
|
||||
#endif /* __ITT_INTERNAL_BODY */
|
||||
|
||||
#ifndef __ITT_INTERNAL_BODY
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
ITT_STUB(ITTAPI, __itt_heap_function, heap_function_createA, (const char *name, const char *domain), (ITT_FORMAT name, domain), heap_function_createA, __itt_group_heap, "\"%s\", \"%s\"")
|
||||
ITT_STUB(ITTAPI, __itt_heap_function, heap_function_createW, (const wchar_t *name, const wchar_t *domain), (ITT_FORMAT name, domain), heap_function_createW, __itt_group_heap, "\"%s\", \"%s\"")
|
||||
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
ITT_STUB(ITTAPI, __itt_heap_function, heap_function_create, (const char *name, const char *domain), (ITT_FORMAT name, domain), heap_function_create, __itt_group_heap, "\"%s\", \"%s\"")
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
#endif /* __ITT_INTERNAL_BODY */
|
||||
ITT_STUBV(ITTAPI, void, heap_allocate_begin, (__itt_heap_function h, size_t size, int initialized), (ITT_FORMAT h, size, initialized), heap_allocate_begin, __itt_group_heap, "%p, %lu, %d")
|
||||
ITT_STUBV(ITTAPI, void, heap_allocate_end, (__itt_heap_function h, void** addr, size_t size, int initialized), (ITT_FORMAT h, addr, size, initialized), heap_allocate_end, __itt_group_heap, "%p, %p, %lu, %d")
|
||||
ITT_STUBV(ITTAPI, void, heap_free_begin, (__itt_heap_function h, void* addr), (ITT_FORMAT h, addr), heap_free_begin, __itt_group_heap, "%p, %p")
|
||||
ITT_STUBV(ITTAPI, void, heap_free_end, (__itt_heap_function h, void* addr), (ITT_FORMAT h, addr), heap_free_end, __itt_group_heap, "%p, %p")
|
||||
ITT_STUBV(ITTAPI, void, heap_reallocate_begin, (__itt_heap_function h, void* addr, size_t new_size, int initialized), (ITT_FORMAT h, addr, new_size, initialized), heap_reallocate_begin, __itt_group_heap, "%p, %p, %lu, %d")
|
||||
ITT_STUBV(ITTAPI, void, heap_reallocate_end, (__itt_heap_function h, void* addr, void** new_addr, size_t new_size, int initialized), (ITT_FORMAT h, addr, new_addr, new_size, initialized), heap_reallocate_end, __itt_group_heap, "%p, %p, %p, %lu, %d")
|
||||
ITT_STUBV(ITTAPI, void, heap_internal_access_begin, (void), (ITT_NO_PARAMS), heap_internal_access_begin, __itt_group_heap, "no args")
|
||||
ITT_STUBV(ITTAPI, void, heap_internal_access_end, (void), (ITT_NO_PARAMS), heap_internal_access_end, __itt_group_heap, "no args")
|
||||
ITT_STUBV(ITTAPI, void, heap_record_memory_growth_begin, (void), (ITT_NO_PARAMS), heap_record_memory_growth_begin, __itt_group_heap, "no args")
|
||||
ITT_STUBV(ITTAPI, void, heap_record_memory_growth_end, (void), (ITT_NO_PARAMS), heap_record_memory_growth_end, __itt_group_heap, "no args")
|
||||
ITT_STUBV(ITTAPI, void, heap_reset_detection, (unsigned int reset_mask), (ITT_FORMAT reset_mask), heap_reset_detection, __itt_group_heap, "%u")
|
||||
ITT_STUBV(ITTAPI, void, heap_record, (unsigned int record_mask), (ITT_FORMAT record_mask), heap_record, __itt_group_heap, "%u")
|
||||
|
||||
ITT_STUBV(ITTAPI, void, id_create, (const __itt_domain *domain, __itt_id id), (ITT_FORMAT domain, id), id_create, __itt_group_structure, "%p, %lu")
|
||||
ITT_STUBV(ITTAPI, void, id_destroy, (const __itt_domain *domain, __itt_id id), (ITT_FORMAT domain, id), id_destroy, __itt_group_structure, "%p, %lu")
|
||||
|
||||
ITT_STUB(ITTAPI, __itt_timestamp, get_timestamp, (void), (ITT_NO_PARAMS), get_timestamp, __itt_group_structure, "no args")
|
||||
|
||||
ITT_STUBV(ITTAPI, void, region_begin, (const __itt_domain *domain, __itt_id id, __itt_id parent, __itt_string_handle *name), (ITT_FORMAT domain, id, parent, name), region_begin, __itt_group_structure, "%p, %lu, %lu, %p")
|
||||
ITT_STUBV(ITTAPI, void, region_end, (const __itt_domain *domain, __itt_id id), (ITT_FORMAT domain, id), region_end, __itt_group_structure, "%p, %lu")
|
||||
|
||||
#ifndef __ITT_INTERNAL_BODY
|
||||
ITT_STUBV(ITTAPI, void, frame_begin_v3, (const __itt_domain *domain, __itt_id *id), (ITT_FORMAT domain, id), frame_begin_v3, __itt_group_structure, "%p, %p")
|
||||
ITT_STUBV(ITTAPI, void, frame_end_v3, (const __itt_domain *domain, __itt_id *id), (ITT_FORMAT domain, id), frame_end_v3, __itt_group_structure, "%p, %p")
|
||||
ITT_STUBV(ITTAPI, void, frame_submit_v3, (const __itt_domain *domain, __itt_id *id, __itt_timestamp begin, __itt_timestamp end), (ITT_FORMAT domain, id, begin, end), frame_submit_v3, __itt_group_structure, "%p, %p, %lu, %lu")
|
||||
#endif /* __ITT_INTERNAL_BODY */
|
||||
|
||||
ITT_STUBV(ITTAPI, void, task_group, (const __itt_domain *domain, __itt_id id, __itt_id parent, __itt_string_handle *name), (ITT_FORMAT domain, id, parent, name), task_group, __itt_group_structure, "%p, %lu, %lu, %p")
|
||||
|
||||
ITT_STUBV(ITTAPI, void, task_begin, (const __itt_domain *domain, __itt_id id, __itt_id parent, __itt_string_handle *name), (ITT_FORMAT domain, id, parent, name), task_begin, __itt_group_structure, "%p, %lu, %lu, %p")
|
||||
ITT_STUBV(ITTAPI, void, task_begin_fn, (const __itt_domain *domain, __itt_id id, __itt_id parent, void* fn), (ITT_FORMAT domain, id, parent, fn), task_begin_fn, __itt_group_structure, "%p, %lu, %lu, %p")
|
||||
ITT_STUBV(ITTAPI, void, task_end, (const __itt_domain *domain), (ITT_FORMAT domain), task_end, __itt_group_structure, "%p")
|
||||
|
||||
ITT_STUBV(ITTAPI, void, counter_inc_v3, (const __itt_domain *domain, __itt_string_handle *name), (ITT_FORMAT domain, name), counter_inc_v3, __itt_group_structure, "%p, %p")
|
||||
ITT_STUBV(ITTAPI, void, counter_inc_delta_v3, (const __itt_domain *domain, __itt_string_handle *name, unsigned long long value), (ITT_FORMAT domain, name, value), counter_inc_delta_v3, __itt_group_structure, "%p, %p, %lu")
|
||||
ITT_STUBV(ITTAPI, void, counter_dec_v3, (const __itt_domain *domain, __itt_string_handle *name), (ITT_FORMAT domain, name), counter_dec_v3, __itt_group_structure, "%p, %p")
|
||||
ITT_STUBV(ITTAPI, void, counter_dec_delta_v3, (const __itt_domain *domain, __itt_string_handle *name, unsigned long long value), (ITT_FORMAT domain, name, value), counter_dec_delta_v3, __itt_group_structure, "%p, %p, %lu")
|
||||
|
||||
ITT_STUBV(ITTAPI, void, marker, (const __itt_domain *domain, __itt_id id, __itt_string_handle *name, __itt_scope scope), (ITT_FORMAT domain, id, name, scope), marker, __itt_group_structure, "%p, %lu, %p, %d")
|
||||
|
||||
ITT_STUBV(ITTAPI, void, metadata_add, (const __itt_domain *domain, __itt_id id, __itt_string_handle *key, __itt_metadata_type type, size_t count, void *data), (ITT_FORMAT domain, id, key, type, count, data), metadata_add, __itt_group_structure, "%p, %lu, %p, %d, %lu, %p")
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
ITT_STUBV(ITTAPI, void, metadata_str_addA, (const __itt_domain *domain, __itt_id id, __itt_string_handle *key, const char* data, size_t length), (ITT_FORMAT domain, id, key, data, length), metadata_str_addA, __itt_group_structure, "%p, %lu, %p, %p, %lu")
|
||||
ITT_STUBV(ITTAPI, void, metadata_str_addW, (const __itt_domain *domain, __itt_id id, __itt_string_handle *key, const wchar_t* data, size_t length), (ITT_FORMAT domain, id, key, data, length), metadata_str_addW, __itt_group_structure, "%p, %lu, %p, %p, %lu")
|
||||
#else /* ITT_PLATFORM!=ITT_PLATFORM_WIN */
|
||||
ITT_STUBV(ITTAPI, void, metadata_str_add, (const __itt_domain *domain, __itt_id id, __itt_string_handle *key, const char* data, size_t length), (ITT_FORMAT domain, id, key, data, length), metadata_str_add, __itt_group_structure, "%p, %lu, %p, %p, %lu")
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
|
||||
ITT_STUBV(ITTAPI, void, relation_add_to_current, (const __itt_domain *domain, __itt_relation relation, __itt_id tail), (ITT_FORMAT domain, relation, tail), relation_add_to_current, __itt_group_structure, "%p, %lu, %p")
|
||||
ITT_STUBV(ITTAPI, void, relation_add, (const __itt_domain *domain, __itt_id head, __itt_relation relation, __itt_id tail), (ITT_FORMAT domain, head, relation, tail), relation_add, __itt_group_structure, "%p, %p, %lu, %p")
|
||||
|
||||
#ifndef __ITT_INTERNAL_BODY
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
ITT_STUB(LIBITTAPI, __itt_event, event_createA, (const char *name, int namelen), (ITT_FORMAT name, namelen), event_createA, __itt_group_mark | __itt_group_legacy, "\"%s\", %d")
|
||||
ITT_STUB(LIBITTAPI, __itt_event, event_createW, (const wchar_t *name, int namelen), (ITT_FORMAT name, namelen), event_createW, __itt_group_mark | __itt_group_legacy, "\"%S\", %d")
|
||||
#else /* ITT_PLATFORM!=ITT_PLATFORM_WIN */
|
||||
ITT_STUB(LIBITTAPI, __itt_event, event_create, (const char *name, int namelen), (ITT_FORMAT name, namelen), event_create, __itt_group_mark | __itt_group_legacy, "\"%s\", %d")
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
ITT_STUB(LIBITTAPI, int, event_start, (__itt_event event), (ITT_FORMAT event), event_start, __itt_group_mark | __itt_group_legacy, "%d")
|
||||
ITT_STUB(LIBITTAPI, int, event_end, (__itt_event event), (ITT_FORMAT event), event_end, __itt_group_mark | __itt_group_legacy, "%d")
|
||||
#endif /* __ITT_INTERNAL_BODY */
|
||||
|
||||
#ifndef __ITT_INTERNAL_BODY
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
ITT_STUBV(ITTAPI, void, sync_set_nameA, (void *addr, const char *objtype, const char *objname, int attribute), (ITT_FORMAT addr, objtype, objname, attribute), sync_set_nameA, __itt_group_sync | __itt_group_fsync | __itt_group_legacy, "%p, \"%s\", \"%s\", %x")
|
||||
ITT_STUBV(ITTAPI, void, sync_set_nameW, (void *addr, const wchar_t *objtype, const wchar_t *objname, int attribute), (ITT_FORMAT addr, objtype, objname, attribute), sync_set_nameW, __itt_group_sync | __itt_group_fsync | __itt_group_legacy, "%p, \"%S\", \"%S\", %x")
|
||||
#else /* ITT_PLATFORM!=ITT_PLATFORM_WIN */
|
||||
ITT_STUBV(ITTAPI, void, sync_set_name, (void *addr, const char *objtype, const char *objname, int attribute), (ITT_FORMAT addr, objtype, objname, attribute), sync_set_name, __itt_group_sync | __itt_group_fsync | __itt_group_legacy, "p, \"%s\", \"%s\", %x")
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
ITT_STUB(LIBITTAPI, int, notify_sync_nameA, (void *p, const char *objtype, int typelen, const char *objname, int namelen, int attribute), (ITT_FORMAT p, objtype, typelen, objname, namelen, attribute), notify_sync_nameA, __itt_group_sync | __itt_group_fsync | __itt_group_legacy, "%p, \"%s\", %d, \"%s\", %d, %x")
|
||||
ITT_STUB(LIBITTAPI, int, notify_sync_nameW, (void *p, const wchar_t *objtype, int typelen, const wchar_t *objname, int namelen, int attribute), (ITT_FORMAT p, objtype, typelen, objname, namelen, attribute), notify_sync_nameW, __itt_group_sync | __itt_group_fsync | __itt_group_legacy, "%p, \"%S\", %d, \"%S\", %d, %x")
|
||||
#else /* ITT_PLATFORM!=ITT_PLATFORM_WIN */
|
||||
ITT_STUB(LIBITTAPI, int, notify_sync_name, (void *p, const char *objtype, int typelen, const char *objname, int namelen, int attribute), (ITT_FORMAT p, objtype, typelen, objname, namelen, attribute), notify_sync_name, __itt_group_sync | __itt_group_fsync | __itt_group_legacy, "%p, \"%s\", %d, \"%s\", %d, %x")
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
|
||||
ITT_STUBV(LIBITTAPI, void, notify_sync_prepare, (void *p), (ITT_FORMAT p), notify_sync_prepare, __itt_group_sync | __itt_group_fsync | __itt_group_legacy, "%p")
|
||||
ITT_STUBV(LIBITTAPI, void, notify_sync_cancel, (void *p), (ITT_FORMAT p), notify_sync_cancel, __itt_group_sync | __itt_group_fsync | __itt_group_legacy, "%p")
|
||||
ITT_STUBV(LIBITTAPI, void, notify_sync_acquired, (void *p), (ITT_FORMAT p), notify_sync_acquired, __itt_group_sync | __itt_group_fsync | __itt_group_legacy, "%p")
|
||||
ITT_STUBV(LIBITTAPI, void, notify_sync_releasing, (void *p), (ITT_FORMAT p), notify_sync_releasing, __itt_group_sync | __itt_group_fsync | __itt_group_legacy, "%p")
|
||||
#endif /* __ITT_INTERNAL_BODY */
|
||||
|
||||
ITT_STUBV(LIBITTAPI, void, memory_read, (void *addr, size_t size), (ITT_FORMAT addr, size), memory_read, __itt_group_legacy, "%p, %lu")
|
||||
ITT_STUBV(LIBITTAPI, void, memory_write, (void *addr, size_t size), (ITT_FORMAT addr, size), memory_write, __itt_group_legacy, "%p, %lu")
|
||||
ITT_STUBV(LIBITTAPI, void, memory_update, (void *addr, size_t size), (ITT_FORMAT addr, size), memory_update, __itt_group_legacy, "%p, %lu")
|
||||
|
||||
ITT_STUB(LIBITTAPI, __itt_state_t, state_get, (void), (ITT_NO_PARAMS), state_get, __itt_group_legacy, "no args")
|
||||
ITT_STUB(LIBITTAPI, __itt_state_t, state_set, (__itt_state_t s), (ITT_FORMAT s), state_set, __itt_group_legacy, "%d")
|
||||
ITT_STUB(LIBITTAPI, __itt_obj_state_t, obj_mode_set, (__itt_obj_prop_t p, __itt_obj_state_t s), (ITT_FORMAT p, s), obj_mode_set, __itt_group_legacy, "%d, %d")
|
||||
ITT_STUB(LIBITTAPI, __itt_thr_state_t, thr_mode_set, (__itt_thr_prop_t p, __itt_thr_state_t s), (ITT_FORMAT p, s), thr_mode_set, __itt_group_legacy, "%d, %d")
|
||||
|
||||
#ifndef __ITT_INTERNAL_BODY
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
ITT_STUB(ITTAPI, __itt_frame, frame_createA, (const char *domain), (ITT_FORMAT domain), frame_createA, __itt_group_frame, "\"%s\"")
|
||||
ITT_STUB(ITTAPI, __itt_frame, frame_createW, (const wchar_t *domain), (ITT_FORMAT domain), frame_createW, __itt_group_frame, "\"%s\"")
|
||||
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
ITT_STUB(ITTAPI, __itt_frame, frame_create, (const char *domain), (ITT_FORMAT domain), frame_create, __itt_group_frame, "\"%s\"")
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
#endif /* __ITT_INTERNAL_BODY */
|
||||
ITT_STUBV(ITTAPI, void, frame_begin, (__itt_frame frame), (ITT_FORMAT frame), frame_begin, __itt_group_frame, "%p")
|
||||
ITT_STUBV(ITTAPI, void, frame_end, (__itt_frame frame), (ITT_FORMAT frame), frame_end, __itt_group_frame, "%p")
|
||||
|
||||
ITT_STUBV(ITTAPI, void, counter_destroy, (__itt_counter id), (ITT_FORMAT id), counter_destroy, __itt_group_counter, "%p")
|
||||
ITT_STUBV(ITTAPI, void, counter_inc, (__itt_counter id), (ITT_FORMAT id), counter_inc, __itt_group_counter, "%p")
|
||||
ITT_STUBV(ITTAPI, void, counter_inc_delta, (__itt_counter id, unsigned long long value), (ITT_FORMAT id, value), counter_inc_delta, __itt_group_counter, "%p, %lu")
|
||||
ITT_STUBV(ITTAPI, void, counter_dec, (__itt_counter id), (ITT_FORMAT id), counter_dec, __itt_group_counter, "%p")
|
||||
ITT_STUBV(ITTAPI, void, counter_dec_delta, (__itt_counter id, unsigned long long value), (ITT_FORMAT id, value), counter_dec_delta, __itt_group_counter, "%p, %lu")
|
||||
ITT_STUBV(ITTAPI, void, counter_set_value, (__itt_counter id, void *value_ptr), (ITT_FORMAT id, value_ptr), counter_set_value, __itt_group_counter, "%p, %p")
|
||||
ITT_STUBV(ITTAPI, void, counter_set_value_ex, (__itt_counter id, __itt_clock_domain *clock_domain, unsigned long long timestamp, void *value_ptr), (ITT_FORMAT id, clock_domain, timestamp, value_ptr), counter_set_value_ex, __itt_group_counter, "%p, %p, %llu, %p")
|
||||
|
||||
#ifndef __ITT_INTERNAL_BODY
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
ITT_STUB(ITTAPI, __itt_mark_type, mark_createA, (const char *name), (ITT_FORMAT name), mark_createA, __itt_group_mark, "\"%s\"")
|
||||
ITT_STUB(ITTAPI, __itt_mark_type, mark_createW, (const wchar_t *name), (ITT_FORMAT name), mark_createW, __itt_group_mark, "\"%S\"")
|
||||
#else /* ITT_PLATFORM!=ITT_PLATFORM_WIN */
|
||||
ITT_STUB(ITTAPI, __itt_mark_type, mark_create, (const char *name), (ITT_FORMAT name), mark_create, __itt_group_mark, "\"%s\"")
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
#endif /* __ITT_INTERNAL_BODY */
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
ITT_STUB(ITTAPI, int, markA, (__itt_mark_type mt, const char *parameter), (ITT_FORMAT mt, parameter), markA, __itt_group_mark, "%d, \"%s\"")
|
||||
ITT_STUB(ITTAPI, int, markW, (__itt_mark_type mt, const wchar_t *parameter), (ITT_FORMAT mt, parameter), markW, __itt_group_mark, "%d, \"%S\"")
|
||||
#else /* ITT_PLATFORM!=ITT_PLATFORM_WIN */
|
||||
ITT_STUB(ITTAPI, int, mark, (__itt_mark_type mt, const char *parameter), (ITT_FORMAT mt, parameter), mark, __itt_group_mark, "%d, \"%s\"")
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
ITT_STUB(ITTAPI, int, mark_off, (__itt_mark_type mt), (ITT_FORMAT mt), mark_off, __itt_group_mark, "%d")
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
ITT_STUB(ITTAPI, int, mark_globalA, (__itt_mark_type mt, const char *parameter), (ITT_FORMAT mt, parameter), mark_globalA, __itt_group_mark, "%d, \"%s\"")
|
||||
ITT_STUB(ITTAPI, int, mark_globalW, (__itt_mark_type mt, const wchar_t *parameter), (ITT_FORMAT mt, parameter), mark_globalW, __itt_group_mark, "%d, \"%S\"")
|
||||
#else /* ITT_PLATFORM!=ITT_PLATFORM_WIN */
|
||||
ITT_STUB(ITTAPI, int, mark_global, (__itt_mark_type mt, const char *parameter), (ITT_FORMAT mt, parameter), mark_global, __itt_group_mark, "%d, \"%S\"")
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
ITT_STUB(ITTAPI, int, mark_global_off, (__itt_mark_type mt), (ITT_FORMAT mt), mark_global_off, __itt_group_mark, "%d")
|
||||
|
||||
#ifndef __ITT_INTERNAL_BODY
|
||||
ITT_STUB(ITTAPI, __itt_caller, stack_caller_create, (void), (ITT_NO_PARAMS), stack_caller_create, __itt_group_stitch, "no args")
|
||||
#endif /* __ITT_INTERNAL_BODY */
|
||||
ITT_STUBV(ITTAPI, void, stack_caller_destroy, (__itt_caller id), (ITT_FORMAT id), stack_caller_destroy, __itt_group_stitch, "%p")
|
||||
ITT_STUBV(ITTAPI, void, stack_callee_enter, (__itt_caller id), (ITT_FORMAT id), stack_callee_enter, __itt_group_stitch, "%p")
|
||||
ITT_STUBV(ITTAPI, void, stack_callee_leave, (__itt_caller id), (ITT_FORMAT id), stack_callee_leave, __itt_group_stitch, "%p")
|
||||
|
||||
ITT_STUB(ITTAPI, __itt_clock_domain*, clock_domain_create, (__itt_get_clock_info_fn fn, void* fn_data), (ITT_FORMAT fn, fn_data), clock_domain_create, __itt_group_structure, "%p, %p")
|
||||
ITT_STUBV(ITTAPI, void, clock_domain_reset, (void), (ITT_NO_PARAMS), clock_domain_reset, __itt_group_structure, "no args")
|
||||
ITT_STUBV(ITTAPI, void, id_create_ex, (const __itt_domain *domain, __itt_clock_domain* clock_domain, unsigned long long timestamp, __itt_id id), (ITT_FORMAT domain, clock_domain, timestamp, id), id_create_ex, __itt_group_structure, "%p, %p, %lu, %lu")
|
||||
ITT_STUBV(ITTAPI, void, id_destroy_ex, (const __itt_domain *domain, __itt_clock_domain* clock_domain, unsigned long long timestamp, __itt_id id), (ITT_FORMAT domain, clock_domain, timestamp, id), id_destroy_ex, __itt_group_structure, "%p, %p, %lu, %lu")
|
||||
ITT_STUBV(ITTAPI, void, task_begin_ex, (const __itt_domain *domain, __itt_clock_domain* clock_domain, unsigned long long timestamp, __itt_id id, __itt_id parentid, __itt_string_handle *name), (ITT_FORMAT domain, clock_domain, timestamp, id, parentid, name), task_begin_ex, __itt_group_structure, "%p, %p, %lu, %lu, %lu, %p")
|
||||
ITT_STUBV(ITTAPI, void, task_begin_fn_ex, (const __itt_domain *domain, __itt_clock_domain* clock_domain, unsigned long long timestamp, __itt_id id, __itt_id parentid, void* fn), (ITT_FORMAT domain, clock_domain, timestamp, id, parentid, fn), task_begin_fn_ex, __itt_group_structure, "%p, %p, %lu, %lu, %lu, %p")
|
||||
ITT_STUBV(ITTAPI, void, task_end_ex, (const __itt_domain *domain, __itt_clock_domain* clock_domain, unsigned long long timestamp), (ITT_FORMAT domain, clock_domain, timestamp), task_end_ex, __itt_group_structure, "%p, %p, %lu")
|
||||
ITT_STUBV(ITTAPI, void, task_begin_overlapped, (const __itt_domain *domain, __itt_id id, __itt_id parent, __itt_string_handle *name), (ITT_FORMAT domain, id, parent, name), task_begin_overlapped, __itt_group_structure, "%p, %lu, %lu, %p")
|
||||
ITT_STUBV(ITTAPI, void, task_begin_overlapped_ex, (const __itt_domain *domain, __itt_clock_domain* clock_domain, unsigned long long timestamp, __itt_id id, __itt_id parentid, __itt_string_handle *name), (ITT_FORMAT domain, clock_domain, timestamp, id, parentid, name), task_begin_overlapped_ex, __itt_group_structure, "%p, %p, %lu, %lu, %lu, %p")
|
||||
ITT_STUBV(ITTAPI, void, task_end_overlapped, (const __itt_domain *domain, __itt_id id), (ITT_FORMAT domain, id), task_end_overlapped, __itt_group_structure, "%p, %lu")
|
||||
ITT_STUBV(ITTAPI, void, task_end_overlapped_ex, (const __itt_domain *domain, __itt_clock_domain* clock_domain, unsigned long long timestamp, __itt_id id), (ITT_FORMAT domain, clock_domain, timestamp, id), task_end_overlapped_ex, __itt_group_structure, "%p, %p, %lu, %lu")
|
||||
ITT_STUBV(ITTAPI, void, marker_ex, (const __itt_domain *domain, __itt_clock_domain* clock_domain, unsigned long long timestamp, __itt_id id, __itt_string_handle *name, __itt_scope scope), (ITT_FORMAT domain, clock_domain, timestamp, id, name, scope), marker_ex, __itt_group_structure, "%p, %p, %lu, %lu, %p, %d")
|
||||
ITT_STUBV(ITTAPI, void, metadata_add_with_scope, (const __itt_domain *domain, __itt_scope scope, __itt_string_handle *key, __itt_metadata_type type, size_t count, void *data), (ITT_FORMAT domain, scope, key, type, count, data), metadata_add_with_scope, __itt_group_structure, "%p, %d, %p, %d, %lu, %p")
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
ITT_STUBV(ITTAPI, void, metadata_str_add_with_scopeA, (const __itt_domain *domain, __itt_scope scope, __itt_string_handle *key, const char *data, size_t length), (ITT_FORMAT domain, scope, key, data, length), metadata_str_add_with_scopeA, __itt_group_structure, "%p, %d, %p, %p, %lu")
|
||||
ITT_STUBV(ITTAPI, void, metadata_str_add_with_scopeW, (const __itt_domain *domain, __itt_scope scope, __itt_string_handle *key, const wchar_t *data, size_t length), (ITT_FORMAT domain, scope, key, data, length), metadata_str_add_with_scopeW, __itt_group_structure, "%p, %d, %p, %p, %lu")
|
||||
#else /* ITT_PLATFORM!=ITT_PLATFORM_WIN */
|
||||
ITT_STUBV(ITTAPI, void, metadata_str_add_with_scope, (const __itt_domain *domain, __itt_scope scope, __itt_string_handle *key, const char *data, size_t length), (ITT_FORMAT domain, scope, key, data, length), metadata_str_add_with_scope, __itt_group_structure, "%p, %d, %p, %p, %lu")
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
ITT_STUBV(ITTAPI, void, relation_add_to_current_ex, (const __itt_domain *domain, __itt_clock_domain* clock_domain, unsigned long long timestamp, __itt_relation relation, __itt_id tail), (ITT_FORMAT domain, clock_domain, timestamp, relation, tail), relation_add_to_current_ex, __itt_group_structure, "%p, %p, %lu, %d, %lu")
|
||||
ITT_STUBV(ITTAPI, void, relation_add_ex, (const __itt_domain *domain, __itt_clock_domain* clock_domain, unsigned long long timestamp, __itt_id head, __itt_relation relation, __itt_id tail), (ITT_FORMAT domain, clock_domain, timestamp, head, relation, tail), relation_add_ex, __itt_group_structure, "%p, %p, %lu, %lu, %d, %lu")
|
||||
ITT_STUB(ITTAPI, __itt_track_group*, track_group_create, (__itt_string_handle* name, __itt_track_group_type track_group_type), (ITT_FORMAT name, track_group_type), track_group_create, __itt_group_structure, "%p, %d")
|
||||
ITT_STUB(ITTAPI, __itt_track*, track_create, (__itt_track_group* track_group,__itt_string_handle* name, __itt_track_type track_type), (ITT_FORMAT track_group, name, track_type), track_create, __itt_group_structure, "%p, %p, %d")
|
||||
ITT_STUBV(ITTAPI, void, set_track, (__itt_track *track), (ITT_FORMAT track), set_track, __itt_group_structure, "%p")
|
||||
|
||||
#ifndef __ITT_INTERNAL_BODY
|
||||
ITT_STUB(ITTAPI, const char*, api_version, (void), (ITT_NO_PARAMS), api_version, __itt_group_all & ~__itt_group_legacy, "no args")
|
||||
#endif /* __ITT_INTERNAL_BODY */
|
||||
|
||||
#ifndef __ITT_INTERNAL_BODY
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
ITT_STUB(ITTAPI, int, av_saveA, (void *data, int rank, const int *dimensions, int type, const char *filePath, int columnOrder), (ITT_FORMAT data, rank, dimensions, type, filePath, columnOrder), av_saveA, __itt_group_arrays, "%p, %d, %p, %d, \"%s\", %d")
|
||||
ITT_STUB(ITTAPI, int, av_saveW, (void *data, int rank, const int *dimensions, int type, const wchar_t *filePath, int columnOrder), (ITT_FORMAT data, rank, dimensions, type, filePath, columnOrder), av_saveW, __itt_group_arrays, "%p, %d, %p, %d, \"%S\", %d")
|
||||
#else /* ITT_PLATFORM!=ITT_PLATFORM_WIN */
|
||||
ITT_STUB(ITTAPI, int, av_save, (void *data, int rank, const int *dimensions, int type, const char *filePath, int columnOrder), (ITT_FORMAT data, rank, dimensions, type, filePath, columnOrder), av_save, __itt_group_arrays, "%p, %d, %p, %d, \"%s\", %d")
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
#endif /* __ITT_INTERNAL_BODY */
|
||||
|
||||
#ifndef __ITT_INTERNAL_BODY
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
ITT_STUBV(ITTAPI, void, module_loadA, (void *start_addr, void* end_addr, const char *path), (ITT_FORMAT start_addr, end_addr, path), module_loadA, __itt_group_none, "%p, %p, %p")
|
||||
ITT_STUBV(ITTAPI, void, module_loadW, (void *start_addr, void* end_addr, const wchar_t *path), (ITT_FORMAT start_addr, end_addr, path), module_loadW, __itt_group_none, "%p, %p, %p")
|
||||
#else /* ITT_PLATFORM!=ITT_PLATFORM_WIN */
|
||||
ITT_STUBV(ITTAPI, void, module_load, (void *start_addr, void *end_addr, const char *path), (ITT_FORMAT start_addr, end_addr, path), module_load, __itt_group_none, "%p, %p, %p")
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
#endif /* __ITT_INTERNAL_BODY */
|
||||
|
||||
|
||||
#endif /* __ITT_INTERNAL_INIT */
|
||||
+115
@@ -0,0 +1,115 @@
|
||||
/* <copyright>
|
||||
This file is provided under a dual BSD/GPLv2 license. When using or
|
||||
redistributing this file, you may do so under either license.
|
||||
|
||||
GPL LICENSE SUMMARY
|
||||
|
||||
Copyright (c) 2005-2014 Intel Corporation. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of version 2 of the GNU General Public License as
|
||||
published by the Free Software Foundation.
|
||||
|
||||
This program is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
The full GNU General Public License is included in this distribution
|
||||
in the file called LICENSE.GPL.
|
||||
|
||||
Contact Information:
|
||||
http://software.intel.com/en-us/articles/intel-vtune-amplifier-xe/
|
||||
|
||||
BSD LICENSE
|
||||
|
||||
Copyright (c) 2005-2014 Intel Corporation. All rights reserved.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in
|
||||
the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
</copyright> */
|
||||
|
||||
#ifndef _ITTNOTIFY_TYPES_H_
|
||||
#define _ITTNOTIFY_TYPES_H_
|
||||
|
||||
typedef enum ___itt_group_id
|
||||
{
|
||||
__itt_group_none = 0,
|
||||
__itt_group_legacy = 1<<0,
|
||||
__itt_group_control = 1<<1,
|
||||
__itt_group_thread = 1<<2,
|
||||
__itt_group_mark = 1<<3,
|
||||
__itt_group_sync = 1<<4,
|
||||
__itt_group_fsync = 1<<5,
|
||||
__itt_group_jit = 1<<6,
|
||||
__itt_group_model = 1<<7,
|
||||
__itt_group_splitter_min = 1<<7,
|
||||
__itt_group_counter = 1<<8,
|
||||
__itt_group_frame = 1<<9,
|
||||
__itt_group_stitch = 1<<10,
|
||||
__itt_group_heap = 1<<11,
|
||||
__itt_group_splitter_max = 1<<12,
|
||||
__itt_group_structure = 1<<12,
|
||||
__itt_group_suppress = 1<<13,
|
||||
__itt_group_arrays = 1<<14,
|
||||
__itt_group_all = -1
|
||||
} __itt_group_id;
|
||||
|
||||
#pragma pack(push, 8)
|
||||
|
||||
typedef struct ___itt_group_list
|
||||
{
|
||||
__itt_group_id id;
|
||||
const char* name;
|
||||
} __itt_group_list;
|
||||
|
||||
#pragma pack(pop)
|
||||
|
||||
#define ITT_GROUP_LIST(varname) \
|
||||
static __itt_group_list varname[] = { \
|
||||
{ __itt_group_all, "all" }, \
|
||||
{ __itt_group_control, "control" }, \
|
||||
{ __itt_group_thread, "thread" }, \
|
||||
{ __itt_group_mark, "mark" }, \
|
||||
{ __itt_group_sync, "sync" }, \
|
||||
{ __itt_group_fsync, "fsync" }, \
|
||||
{ __itt_group_jit, "jit" }, \
|
||||
{ __itt_group_model, "model" }, \
|
||||
{ __itt_group_counter, "counter" }, \
|
||||
{ __itt_group_frame, "frame" }, \
|
||||
{ __itt_group_stitch, "stitch" }, \
|
||||
{ __itt_group_heap, "heap" }, \
|
||||
{ __itt_group_structure, "structure" }, \
|
||||
{ __itt_group_suppress, "suppress" }, \
|
||||
{ __itt_group_arrays, "arrays" }, \
|
||||
{ __itt_group_none, NULL } \
|
||||
}
|
||||
|
||||
#endif /* _ITTNOTIFY_TYPES_H_ */
|
||||
+314
@@ -0,0 +1,314 @@
|
||||
/* <copyright>
|
||||
This file is provided under a dual BSD/GPLv2 license. When using or
|
||||
redistributing this file, you may do so under either license.
|
||||
|
||||
GPL LICENSE SUMMARY
|
||||
|
||||
Copyright (c) 2005-2014 Intel Corporation. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of version 2 of the GNU General Public License as
|
||||
published by the Free Software Foundation.
|
||||
|
||||
This program is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
The full GNU General Public License is included in this distribution
|
||||
in the file called LICENSE.GPL.
|
||||
|
||||
Contact Information:
|
||||
http://software.intel.com/en-us/articles/intel-vtune-amplifier-xe/
|
||||
|
||||
BSD LICENSE
|
||||
|
||||
Copyright (c) 2005-2014 Intel Corporation. All rights reserved.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in
|
||||
the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
</copyright> */
|
||||
|
||||
#include "ittnotify_config.h"
|
||||
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
#include <windows.h>
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
#if ITT_PLATFORM != ITT_PLATFORM_MAC && ITT_PLATFORM != ITT_PLATFORM_FREEBSD
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "jitprofiling.h"
|
||||
|
||||
static const char rcsid[] = "\n@(#) $Revision: 471937 $\n";
|
||||
|
||||
#define DLL_ENVIRONMENT_VAR "VS_PROFILER"
|
||||
|
||||
#ifndef NEW_DLL_ENVIRONMENT_VAR
|
||||
#if ITT_ARCH==ITT_ARCH_IA32
|
||||
#define NEW_DLL_ENVIRONMENT_VAR "INTEL_JIT_PROFILER32"
|
||||
#else
|
||||
#define NEW_DLL_ENVIRONMENT_VAR "INTEL_JIT_PROFILER64"
|
||||
#endif
|
||||
#endif /* NEW_DLL_ENVIRONMENT_VAR */
|
||||
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
#define DEFAULT_DLLNAME "JitPI.dll"
|
||||
HINSTANCE m_libHandle = NULL;
|
||||
#elif ITT_PLATFORM==ITT_PLATFORM_MAC
|
||||
#define DEFAULT_DLLNAME "libJitPI.dylib"
|
||||
void* m_libHandle = NULL;
|
||||
#else
|
||||
#define DEFAULT_DLLNAME "libJitPI.so"
|
||||
void* m_libHandle = NULL;
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
|
||||
/* default location of JIT profiling agent on Android */
|
||||
#define ANDROID_JIT_AGENT_PATH "/data/intel/libittnotify.so"
|
||||
|
||||
/* the function pointers */
|
||||
typedef unsigned int(JITAPI *TPInitialize)(void);
|
||||
static TPInitialize FUNC_Initialize=NULL;
|
||||
|
||||
typedef unsigned int(JITAPI *TPNotify)(unsigned int, void*);
|
||||
static TPNotify FUNC_NotifyEvent=NULL;
|
||||
|
||||
static iJIT_IsProfilingActiveFlags executionMode = iJIT_NOTHING_RUNNING;
|
||||
|
||||
/* end collector dll part. */
|
||||
|
||||
/* loadiJIT_Funcs() : this function is called just in the beginning
|
||||
* and is responsible to load the functions from BistroJavaCollector.dll
|
||||
* result:
|
||||
* on success: the functions loads, iJIT_DLL_is_missing=0, return value = 1
|
||||
* on failure: the functions are NULL, iJIT_DLL_is_missing=1, return value = 0
|
||||
*/
|
||||
static int loadiJIT_Funcs(void);
|
||||
|
||||
/* global representing whether the collector can't be loaded */
|
||||
static int iJIT_DLL_is_missing = 0;
|
||||
|
||||
ITT_EXTERN_C int JITAPI
|
||||
iJIT_NotifyEvent(iJIT_JVM_EVENT event_type, void *EventSpecificData)
|
||||
{
|
||||
int ReturnValue = 0;
|
||||
|
||||
/* initialization part - the collector has not been loaded yet. */
|
||||
if (!FUNC_NotifyEvent)
|
||||
{
|
||||
if (iJIT_DLL_is_missing)
|
||||
return 0;
|
||||
|
||||
if (!loadiJIT_Funcs())
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (event_type == iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED ||
|
||||
event_type == iJVM_EVENT_TYPE_METHOD_UPDATE)
|
||||
{
|
||||
if (((piJIT_Method_Load)EventSpecificData)->method_id == 0)
|
||||
return 0;
|
||||
}
|
||||
else if (event_type == iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED_V2)
|
||||
{
|
||||
if (((piJIT_Method_Load_V2)EventSpecificData)->method_id == 0)
|
||||
return 0;
|
||||
}
|
||||
else if (event_type == iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED_V3)
|
||||
{
|
||||
if (((piJIT_Method_Load_V3)EventSpecificData)->method_id == 0)
|
||||
return 0;
|
||||
}
|
||||
else if (event_type == iJVM_EVENT_TYPE_METHOD_INLINE_LOAD_FINISHED)
|
||||
{
|
||||
if (((piJIT_Method_Inline_Load)EventSpecificData)->method_id == 0 ||
|
||||
((piJIT_Method_Inline_Load)EventSpecificData)->parent_method_id == 0)
|
||||
return 0;
|
||||
}
|
||||
|
||||
ReturnValue = (int)FUNC_NotifyEvent(event_type, EventSpecificData);
|
||||
|
||||
return ReturnValue;
|
||||
}
|
||||
|
||||
ITT_EXTERN_C iJIT_IsProfilingActiveFlags JITAPI iJIT_IsProfilingActive()
|
||||
{
|
||||
if (!iJIT_DLL_is_missing)
|
||||
{
|
||||
loadiJIT_Funcs();
|
||||
}
|
||||
|
||||
return executionMode;
|
||||
}
|
||||
|
||||
/* This function loads the collector dll and the relevant functions.
|
||||
* on success: all functions load, iJIT_DLL_is_missing = 0, return value = 1
|
||||
* on failure: all functions are NULL, iJIT_DLL_is_missing = 1, return value = 0
|
||||
*/
|
||||
static int loadiJIT_Funcs()
|
||||
{
|
||||
static int bDllWasLoaded = 0;
|
||||
char *dllName = (char*)rcsid; /* !! Just to avoid unused code elimination */
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
DWORD dNameLength = 0;
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
|
||||
if(bDllWasLoaded)
|
||||
{
|
||||
/* dll was already loaded, no need to do it for the second time */
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Assumes that the DLL will not be found */
|
||||
iJIT_DLL_is_missing = 1;
|
||||
FUNC_NotifyEvent = NULL;
|
||||
|
||||
if (m_libHandle)
|
||||
{
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
FreeLibrary(m_libHandle);
|
||||
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
dlclose(m_libHandle);
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
m_libHandle = NULL;
|
||||
}
|
||||
|
||||
/* Try to get the dll name from the environment */
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
dNameLength = GetEnvironmentVariableA(NEW_DLL_ENVIRONMENT_VAR, NULL, 0);
|
||||
if (dNameLength)
|
||||
{
|
||||
DWORD envret = 0;
|
||||
dllName = (char*)malloc(sizeof(char) * (dNameLength + 1));
|
||||
if(dllName != NULL)
|
||||
{
|
||||
envret = GetEnvironmentVariableA(NEW_DLL_ENVIRONMENT_VAR,
|
||||
dllName, dNameLength);
|
||||
if (envret)
|
||||
{
|
||||
/* Try to load the dll from the PATH... */
|
||||
m_libHandle = LoadLibraryExA(dllName,
|
||||
NULL, LOAD_WITH_ALTERED_SEARCH_PATH);
|
||||
}
|
||||
free(dllName);
|
||||
}
|
||||
} else {
|
||||
/* Try to use old VS_PROFILER variable */
|
||||
dNameLength = GetEnvironmentVariableA(DLL_ENVIRONMENT_VAR, NULL, 0);
|
||||
if (dNameLength)
|
||||
{
|
||||
DWORD envret = 0;
|
||||
dllName = (char*)malloc(sizeof(char) * (dNameLength + 1));
|
||||
if(dllName != NULL)
|
||||
{
|
||||
envret = GetEnvironmentVariableA(DLL_ENVIRONMENT_VAR,
|
||||
dllName, dNameLength);
|
||||
if (envret)
|
||||
{
|
||||
/* Try to load the dll from the PATH... */
|
||||
m_libHandle = LoadLibraryA(dllName);
|
||||
}
|
||||
free(dllName);
|
||||
}
|
||||
}
|
||||
}
|
||||
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
dllName = getenv(NEW_DLL_ENVIRONMENT_VAR);
|
||||
if (!dllName)
|
||||
dllName = getenv(DLL_ENVIRONMENT_VAR);
|
||||
#if defined(__ANDROID__) || defined(ANDROID)
|
||||
if (!dllName)
|
||||
dllName = ANDROID_JIT_AGENT_PATH;
|
||||
#endif
|
||||
if (dllName)
|
||||
{
|
||||
/* Try to load the dll from the PATH... */
|
||||
m_libHandle = dlopen(dllName, RTLD_LAZY);
|
||||
}
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
|
||||
if (!m_libHandle)
|
||||
{
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
m_libHandle = LoadLibraryA(DEFAULT_DLLNAME);
|
||||
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
m_libHandle = dlopen(DEFAULT_DLLNAME, RTLD_LAZY);
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
}
|
||||
|
||||
/* if the dll wasn't loaded - exit. */
|
||||
if (!m_libHandle)
|
||||
{
|
||||
iJIT_DLL_is_missing = 1; /* don't try to initialize
|
||||
* JIT agent the second time
|
||||
*/
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
FUNC_NotifyEvent = (TPNotify)GetProcAddress(m_libHandle, "NotifyEvent");
|
||||
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
FUNC_NotifyEvent = (TPNotify)dlsym(m_libHandle, "NotifyEvent");
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
if (!FUNC_NotifyEvent)
|
||||
{
|
||||
FUNC_Initialize = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
FUNC_Initialize = (TPInitialize)GetProcAddress(m_libHandle, "Initialize");
|
||||
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
FUNC_Initialize = (TPInitialize)dlsym(m_libHandle, "Initialize");
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
if (!FUNC_Initialize)
|
||||
{
|
||||
FUNC_NotifyEvent = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
executionMode = (iJIT_IsProfilingActiveFlags)FUNC_Initialize();
|
||||
|
||||
bDllWasLoaded = 1;
|
||||
iJIT_DLL_is_missing = 0; /* DLL is ok. */
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
ITT_EXTERN_C unsigned int JITAPI iJIT_GetNewMethodID()
|
||||
{
|
||||
static unsigned int methodID = 1;
|
||||
|
||||
if (methodID == 0)
|
||||
return 0; /* ERROR : this is not a valid value */
|
||||
|
||||
return methodID++;
|
||||
}
|
||||
Vendored
-33
@@ -1,33 +0,0 @@
|
||||
Jinja is written and maintained by the Jinja Team and various
|
||||
contributors:
|
||||
|
||||
Lead Developer:
|
||||
|
||||
- Armin Ronacher <armin.ronacher@active-4.com>
|
||||
|
||||
Developers:
|
||||
|
||||
- Christoph Hack
|
||||
- Georg Brandl
|
||||
|
||||
Contributors:
|
||||
|
||||
- Bryan McLemore
|
||||
- Mickaël Guérin <kael@crocobox.org>
|
||||
- Cameron Knight
|
||||
- Lawrence Journal-World.
|
||||
- David Cramer
|
||||
|
||||
Patches and suggestions:
|
||||
|
||||
- Ronny Pfannschmidt
|
||||
- Axel Böhm
|
||||
- Alexey Melchakov
|
||||
- Bryan McLemore
|
||||
- Clovis Fabricio (nosklo)
|
||||
- Cameron Knight
|
||||
- Peter van Dijk (Habbie)
|
||||
- Stefan Ebner
|
||||
- Rene Leonhardt
|
||||
- Thomas Waldmann
|
||||
- Cory Benfield (Lukasa)
|
||||
Vendored
-31
@@ -1,31 +0,0 @@
|
||||
Copyright (c) 2009 by the Jinja Team, see AUTHORS for more details.
|
||||
|
||||
Some rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the following
|
||||
disclaimer in the documentation and/or other materials provided
|
||||
with the distribution.
|
||||
|
||||
* The names of the contributors may not be used to endorse or
|
||||
promote products derived from this software without specific
|
||||
prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
Vendored
-69
@@ -1,69 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
jinja2
|
||||
~~~~~~
|
||||
|
||||
Jinja2 is a template engine written in pure Python. It provides a
|
||||
Django inspired non-XML syntax but supports inline expressions and
|
||||
an optional sandboxed environment.
|
||||
|
||||
Nutshell
|
||||
--------
|
||||
|
||||
Here a small example of a Jinja2 template::
|
||||
|
||||
{% extends 'base.html' %}
|
||||
{% block title %}Memberlist{% endblock %}
|
||||
{% block content %}
|
||||
<ul>
|
||||
{% for user in users %}
|
||||
<li><a href="{{ user.url }}">{{ user.username }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
:copyright: (c) 2010 by the Jinja Team.
|
||||
:license: BSD, see LICENSE for more details.
|
||||
"""
|
||||
__docformat__ = 'restructuredtext en'
|
||||
__version__ = '2.7.1'
|
||||
|
||||
# high level interface
|
||||
from jinja2.environment import Environment, Template
|
||||
|
||||
# loaders
|
||||
from jinja2.loaders import BaseLoader, FileSystemLoader, PackageLoader, \
|
||||
DictLoader, FunctionLoader, PrefixLoader, ChoiceLoader, \
|
||||
ModuleLoader
|
||||
|
||||
# bytecode caches
|
||||
from jinja2.bccache import BytecodeCache, FileSystemBytecodeCache, \
|
||||
MemcachedBytecodeCache
|
||||
|
||||
# undefined types
|
||||
from jinja2.runtime import Undefined, DebugUndefined, StrictUndefined
|
||||
|
||||
# exceptions
|
||||
from jinja2.exceptions import TemplateError, UndefinedError, \
|
||||
TemplateNotFound, TemplatesNotFound, TemplateSyntaxError, \
|
||||
TemplateAssertionError
|
||||
|
||||
# decorators and public utilities
|
||||
from jinja2.filters import environmentfilter, contextfilter, \
|
||||
evalcontextfilter
|
||||
from jinja2.utils import Markup, escape, clear_caches, \
|
||||
environmentfunction, evalcontextfunction, contextfunction, \
|
||||
is_undefined
|
||||
|
||||
__all__ = [
|
||||
'Environment', 'Template', 'BaseLoader', 'FileSystemLoader',
|
||||
'PackageLoader', 'DictLoader', 'FunctionLoader', 'PrefixLoader',
|
||||
'ChoiceLoader', 'BytecodeCache', 'FileSystemBytecodeCache',
|
||||
'MemcachedBytecodeCache', 'Undefined', 'DebugUndefined',
|
||||
'StrictUndefined', 'TemplateError', 'UndefinedError', 'TemplateNotFound',
|
||||
'TemplatesNotFound', 'TemplateSyntaxError', 'TemplateAssertionError',
|
||||
'ModuleLoader', 'environmentfilter', 'contextfilter', 'Markup', 'escape',
|
||||
'environmentfunction', 'contextfunction', 'clear_caches', 'is_undefined',
|
||||
'evalcontextfilter', 'evalcontextfunction'
|
||||
]
|
||||
Vendored
-150
@@ -1,150 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
jinja2._compat
|
||||
~~~~~~~~~~~~~~
|
||||
|
||||
Some py2/py3 compatibility support based on a stripped down
|
||||
version of six so we don't have to depend on a specific version
|
||||
of it.
|
||||
|
||||
:copyright: Copyright 2013 by the Jinja team, see AUTHORS.
|
||||
:license: BSD, see LICENSE for details.
|
||||
"""
|
||||
import sys
|
||||
|
||||
PY2 = sys.version_info[0] == 2
|
||||
PYPY = hasattr(sys, 'pypy_translation_info')
|
||||
_identity = lambda x: x
|
||||
|
||||
|
||||
if not PY2:
|
||||
unichr = chr
|
||||
range_type = range
|
||||
text_type = str
|
||||
string_types = (str,)
|
||||
|
||||
iterkeys = lambda d: iter(d.keys())
|
||||
itervalues = lambda d: iter(d.values())
|
||||
iteritems = lambda d: iter(d.items())
|
||||
|
||||
import pickle
|
||||
from io import BytesIO, StringIO
|
||||
NativeStringIO = StringIO
|
||||
|
||||
def reraise(tp, value, tb=None):
|
||||
if value.__traceback__ is not tb:
|
||||
raise value.with_traceback(tb)
|
||||
raise value
|
||||
|
||||
ifilter = filter
|
||||
imap = map
|
||||
izip = zip
|
||||
intern = sys.intern
|
||||
|
||||
implements_iterator = _identity
|
||||
implements_to_string = _identity
|
||||
encode_filename = _identity
|
||||
get_next = lambda x: x.__next__
|
||||
|
||||
else:
|
||||
unichr = unichr
|
||||
text_type = unicode
|
||||
range_type = xrange
|
||||
string_types = (str, unicode)
|
||||
|
||||
iterkeys = lambda d: d.iterkeys()
|
||||
itervalues = lambda d: d.itervalues()
|
||||
iteritems = lambda d: d.iteritems()
|
||||
|
||||
import cPickle as pickle
|
||||
from cStringIO import StringIO as BytesIO, StringIO
|
||||
NativeStringIO = BytesIO
|
||||
|
||||
exec('def reraise(tp, value, tb=None):\n raise tp, value, tb')
|
||||
|
||||
from itertools import imap, izip, ifilter
|
||||
intern = intern
|
||||
|
||||
def implements_iterator(cls):
|
||||
cls.next = cls.__next__
|
||||
del cls.__next__
|
||||
return cls
|
||||
|
||||
def implements_to_string(cls):
|
||||
cls.__unicode__ = cls.__str__
|
||||
cls.__str__ = lambda x: x.__unicode__().encode('utf-8')
|
||||
return cls
|
||||
|
||||
get_next = lambda x: x.next
|
||||
|
||||
def encode_filename(filename):
|
||||
if isinstance(filename, unicode):
|
||||
return filename.encode('utf-8')
|
||||
return filename
|
||||
|
||||
try:
|
||||
next = next
|
||||
except NameError:
|
||||
def next(it):
|
||||
return it.next()
|
||||
|
||||
|
||||
def with_metaclass(meta, *bases):
|
||||
# This requires a bit of explanation: the basic idea is to make a
|
||||
# dummy metaclass for one level of class instanciation that replaces
|
||||
# itself with the actual metaclass. Because of internal type checks
|
||||
# we also need to make sure that we downgrade the custom metaclass
|
||||
# for one level to something closer to type (that's why __call__ and
|
||||
# __init__ comes back from type etc.).
|
||||
#
|
||||
# This has the advantage over six.with_metaclass in that it does not
|
||||
# introduce dummy classes into the final MRO.
|
||||
class metaclass(meta):
|
||||
__call__ = type.__call__
|
||||
__init__ = type.__init__
|
||||
def __new__(cls, name, this_bases, d):
|
||||
if this_bases is None:
|
||||
return type.__new__(cls, name, (), d)
|
||||
return meta(name, bases, d)
|
||||
return metaclass('temporary_class', None, {})
|
||||
|
||||
|
||||
try:
|
||||
from collections import Mapping as mapping_types
|
||||
except ImportError:
|
||||
import UserDict
|
||||
mapping_types = (UserDict.UserDict, UserDict.DictMixin, dict)
|
||||
|
||||
|
||||
# common types. These do exist in the special types module too which however
|
||||
# does not exist in IronPython out of the box. Also that way we don't have
|
||||
# to deal with implementation specific stuff here
|
||||
class _C(object):
|
||||
def method(self): pass
|
||||
def _func():
|
||||
yield None
|
||||
function_type = type(_func)
|
||||
generator_type = type(_func())
|
||||
method_type = type(_C().method)
|
||||
code_type = type(_C.method.__code__)
|
||||
try:
|
||||
raise TypeError()
|
||||
except TypeError:
|
||||
_tb = sys.exc_info()[2]
|
||||
traceback_type = type(_tb)
|
||||
frame_type = type(_tb.tb_frame)
|
||||
|
||||
|
||||
try:
|
||||
from urllib.parse import quote_from_bytes as url_quote
|
||||
except ImportError:
|
||||
from urllib import quote as url_quote
|
||||
|
||||
|
||||
try:
|
||||
from thread import allocate_lock
|
||||
except ImportError:
|
||||
try:
|
||||
from threading import Lock as allocate_lock
|
||||
except ImportError:
|
||||
from dummy_thread import allocate_lock
|
||||
Vendored
-132
File diff suppressed because one or more lines are too long
Vendored
-311
@@ -1,311 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
jinja2.bccache
|
||||
~~~~~~~~~~~~~~
|
||||
|
||||
This module implements the bytecode cache system Jinja is optionally
|
||||
using. This is useful if you have very complex template situations and
|
||||
the compiliation of all those templates slow down your application too
|
||||
much.
|
||||
|
||||
Situations where this is useful are often forking web applications that
|
||||
are initialized on the first request.
|
||||
|
||||
:copyright: (c) 2010 by the Jinja Team.
|
||||
:license: BSD.
|
||||
"""
|
||||
from os import path, listdir
|
||||
import sys
|
||||
import marshal
|
||||
import tempfile
|
||||
import fnmatch
|
||||
from hashlib import sha1
|
||||
from jinja2.utils import open_if_exists
|
||||
from jinja2._compat import BytesIO, pickle, PY2, text_type
|
||||
|
||||
|
||||
# marshal works better on 3.x, one hack less required
|
||||
if not PY2:
|
||||
marshal_dump = marshal.dump
|
||||
marshal_load = marshal.load
|
||||
else:
|
||||
|
||||
def marshal_dump(code, f):
|
||||
if isinstance(f, file):
|
||||
marshal.dump(code, f)
|
||||
else:
|
||||
f.write(marshal.dumps(code))
|
||||
|
||||
def marshal_load(f):
|
||||
if isinstance(f, file):
|
||||
return marshal.load(f)
|
||||
return marshal.loads(f.read())
|
||||
|
||||
|
||||
bc_version = 2
|
||||
|
||||
# magic version used to only change with new jinja versions. With 2.6
|
||||
# we change this to also take Python version changes into account. The
|
||||
# reason for this is that Python tends to segfault if fed earlier bytecode
|
||||
# versions because someone thought it would be a good idea to reuse opcodes
|
||||
# or make Python incompatible with earlier versions.
|
||||
bc_magic = 'j2'.encode('ascii') + \
|
||||
pickle.dumps(bc_version, 2) + \
|
||||
pickle.dumps((sys.version_info[0] << 24) | sys.version_info[1])
|
||||
|
||||
|
||||
class Bucket(object):
|
||||
"""Buckets are used to store the bytecode for one template. It's created
|
||||
and initialized by the bytecode cache and passed to the loading functions.
|
||||
|
||||
The buckets get an internal checksum from the cache assigned and use this
|
||||
to automatically reject outdated cache material. Individual bytecode
|
||||
cache subclasses don't have to care about cache invalidation.
|
||||
"""
|
||||
|
||||
def __init__(self, environment, key, checksum):
|
||||
self.environment = environment
|
||||
self.key = key
|
||||
self.checksum = checksum
|
||||
self.reset()
|
||||
|
||||
def reset(self):
|
||||
"""Resets the bucket (unloads the bytecode)."""
|
||||
self.code = None
|
||||
|
||||
def load_bytecode(self, f):
|
||||
"""Loads bytecode from a file or file like object."""
|
||||
# make sure the magic header is correct
|
||||
magic = f.read(len(bc_magic))
|
||||
if magic != bc_magic:
|
||||
self.reset()
|
||||
return
|
||||
# the source code of the file changed, we need to reload
|
||||
checksum = pickle.load(f)
|
||||
if self.checksum != checksum:
|
||||
self.reset()
|
||||
return
|
||||
self.code = marshal_load(f)
|
||||
|
||||
def write_bytecode(self, f):
|
||||
"""Dump the bytecode into the file or file like object passed."""
|
||||
if self.code is None:
|
||||
raise TypeError('can\'t write empty bucket')
|
||||
f.write(bc_magic)
|
||||
pickle.dump(self.checksum, f, 2)
|
||||
marshal_dump(self.code, f)
|
||||
|
||||
def bytecode_from_string(self, string):
|
||||
"""Load bytecode from a string."""
|
||||
self.load_bytecode(BytesIO(string))
|
||||
|
||||
def bytecode_to_string(self):
|
||||
"""Return the bytecode as string."""
|
||||
out = BytesIO()
|
||||
self.write_bytecode(out)
|
||||
return out.getvalue()
|
||||
|
||||
|
||||
class BytecodeCache(object):
|
||||
"""To implement your own bytecode cache you have to subclass this class
|
||||
and override :meth:`load_bytecode` and :meth:`dump_bytecode`. Both of
|
||||
these methods are passed a :class:`~jinja2.bccache.Bucket`.
|
||||
|
||||
A very basic bytecode cache that saves the bytecode on the file system::
|
||||
|
||||
from os import path
|
||||
|
||||
class MyCache(BytecodeCache):
|
||||
|
||||
def __init__(self, directory):
|
||||
self.directory = directory
|
||||
|
||||
def load_bytecode(self, bucket):
|
||||
filename = path.join(self.directory, bucket.key)
|
||||
if path.exists(filename):
|
||||
with open(filename, 'rb') as f:
|
||||
bucket.load_bytecode(f)
|
||||
|
||||
def dump_bytecode(self, bucket):
|
||||
filename = path.join(self.directory, bucket.key)
|
||||
with open(filename, 'wb') as f:
|
||||
bucket.write_bytecode(f)
|
||||
|
||||
A more advanced version of a filesystem based bytecode cache is part of
|
||||
Jinja2.
|
||||
"""
|
||||
|
||||
def load_bytecode(self, bucket):
|
||||
"""Subclasses have to override this method to load bytecode into a
|
||||
bucket. If they are not able to find code in the cache for the
|
||||
bucket, it must not do anything.
|
||||
"""
|
||||
raise NotImplementedError()
|
||||
|
||||
def dump_bytecode(self, bucket):
|
||||
"""Subclasses have to override this method to write the bytecode
|
||||
from a bucket back to the cache. If it unable to do so it must not
|
||||
fail silently but raise an exception.
|
||||
"""
|
||||
raise NotImplementedError()
|
||||
|
||||
def clear(self):
|
||||
"""Clears the cache. This method is not used by Jinja2 but should be
|
||||
implemented to allow applications to clear the bytecode cache used
|
||||
by a particular environment.
|
||||
"""
|
||||
|
||||
def get_cache_key(self, name, filename=None):
|
||||
"""Returns the unique hash key for this template name."""
|
||||
hash = sha1(name.encode('utf-8'))
|
||||
if filename is not None:
|
||||
filename = '|' + filename
|
||||
if isinstance(filename, text_type):
|
||||
filename = filename.encode('utf-8')
|
||||
hash.update(filename)
|
||||
return hash.hexdigest()
|
||||
|
||||
def get_source_checksum(self, source):
|
||||
"""Returns a checksum for the source."""
|
||||
return sha1(source.encode('utf-8')).hexdigest()
|
||||
|
||||
def get_bucket(self, environment, name, filename, source):
|
||||
"""Return a cache bucket for the given template. All arguments are
|
||||
mandatory but filename may be `None`.
|
||||
"""
|
||||
key = self.get_cache_key(name, filename)
|
||||
checksum = self.get_source_checksum(source)
|
||||
bucket = Bucket(environment, key, checksum)
|
||||
self.load_bytecode(bucket)
|
||||
return bucket
|
||||
|
||||
def set_bucket(self, bucket):
|
||||
"""Put the bucket into the cache."""
|
||||
self.dump_bytecode(bucket)
|
||||
|
||||
|
||||
class FileSystemBytecodeCache(BytecodeCache):
|
||||
"""A bytecode cache that stores bytecode on the filesystem. It accepts
|
||||
two arguments: The directory where the cache items are stored and a
|
||||
pattern string that is used to build the filename.
|
||||
|
||||
If no directory is specified the system temporary items folder is used.
|
||||
|
||||
The pattern can be used to have multiple separate caches operate on the
|
||||
same directory. The default pattern is ``'__jinja2_%s.cache'``. ``%s``
|
||||
is replaced with the cache key.
|
||||
|
||||
>>> bcc = FileSystemBytecodeCache('/tmp/jinja_cache', '%s.cache')
|
||||
|
||||
This bytecode cache supports clearing of the cache using the clear method.
|
||||
"""
|
||||
|
||||
def __init__(self, directory=None, pattern='__jinja2_%s.cache'):
|
||||
if directory is None:
|
||||
directory = tempfile.gettempdir()
|
||||
self.directory = directory
|
||||
self.pattern = pattern
|
||||
|
||||
def _get_cache_filename(self, bucket):
|
||||
return path.join(self.directory, self.pattern % bucket.key)
|
||||
|
||||
def load_bytecode(self, bucket):
|
||||
f = open_if_exists(self._get_cache_filename(bucket), 'rb')
|
||||
if f is not None:
|
||||
try:
|
||||
bucket.load_bytecode(f)
|
||||
finally:
|
||||
f.close()
|
||||
|
||||
def dump_bytecode(self, bucket):
|
||||
f = open(self._get_cache_filename(bucket), 'wb')
|
||||
try:
|
||||
bucket.write_bytecode(f)
|
||||
finally:
|
||||
f.close()
|
||||
|
||||
def clear(self):
|
||||
# imported lazily here because google app-engine doesn't support
|
||||
# write access on the file system and the function does not exist
|
||||
# normally.
|
||||
from os import remove
|
||||
files = fnmatch.filter(listdir(self.directory), self.pattern % '*')
|
||||
for filename in files:
|
||||
try:
|
||||
remove(path.join(self.directory, filename))
|
||||
except OSError:
|
||||
pass
|
||||
|
||||
|
||||
class MemcachedBytecodeCache(BytecodeCache):
|
||||
"""This class implements a bytecode cache that uses a memcache cache for
|
||||
storing the information. It does not enforce a specific memcache library
|
||||
(tummy's memcache or cmemcache) but will accept any class that provides
|
||||
the minimal interface required.
|
||||
|
||||
Libraries compatible with this class:
|
||||
|
||||
- `werkzeug <http://werkzeug.pocoo.org/>`_.contrib.cache
|
||||
- `python-memcached <http://www.tummy.com/Community/software/python-memcached/>`_
|
||||
- `cmemcache <http://gijsbert.org/cmemcache/>`_
|
||||
|
||||
(Unfortunately the django cache interface is not compatible because it
|
||||
does not support storing binary data, only unicode. You can however pass
|
||||
the underlying cache client to the bytecode cache which is available
|
||||
as `django.core.cache.cache._client`.)
|
||||
|
||||
The minimal interface for the client passed to the constructor is this:
|
||||
|
||||
.. class:: MinimalClientInterface
|
||||
|
||||
.. method:: set(key, value[, timeout])
|
||||
|
||||
Stores the bytecode in the cache. `value` is a string and
|
||||
`timeout` the timeout of the key. If timeout is not provided
|
||||
a default timeout or no timeout should be assumed, if it's
|
||||
provided it's an integer with the number of seconds the cache
|
||||
item should exist.
|
||||
|
||||
.. method:: get(key)
|
||||
|
||||
Returns the value for the cache key. If the item does not
|
||||
exist in the cache the return value must be `None`.
|
||||
|
||||
The other arguments to the constructor are the prefix for all keys that
|
||||
is added before the actual cache key and the timeout for the bytecode in
|
||||
the cache system. We recommend a high (or no) timeout.
|
||||
|
||||
This bytecode cache does not support clearing of used items in the cache.
|
||||
The clear method is a no-operation function.
|
||||
|
||||
.. versionadded:: 2.7
|
||||
Added support for ignoring memcache errors through the
|
||||
`ignore_memcache_errors` parameter.
|
||||
"""
|
||||
|
||||
def __init__(self, client, prefix='jinja2/bytecode/', timeout=None,
|
||||
ignore_memcache_errors=True):
|
||||
self.client = client
|
||||
self.prefix = prefix
|
||||
self.timeout = timeout
|
||||
self.ignore_memcache_errors = ignore_memcache_errors
|
||||
|
||||
def load_bytecode(self, bucket):
|
||||
try:
|
||||
code = self.client.get(self.prefix + bucket.key)
|
||||
except Exception:
|
||||
if not self.ignore_memcache_errors:
|
||||
raise
|
||||
code = None
|
||||
if code is not None:
|
||||
bucket.bytecode_from_string(code)
|
||||
|
||||
def dump_bytecode(self, bucket):
|
||||
args = (self.prefix + bucket.key, bucket.bytecode_to_string())
|
||||
if self.timeout is not None:
|
||||
args += (self.timeout,)
|
||||
try:
|
||||
self.client.set(*args)
|
||||
except Exception:
|
||||
if not self.ignore_memcache_errors:
|
||||
raise
|
||||
Vendored
-1640
File diff suppressed because it is too large
Load Diff
Vendored
-32
@@ -1,32 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
jinja.constants
|
||||
~~~~~~~~~~~~~~~
|
||||
|
||||
Various constants.
|
||||
|
||||
:copyright: (c) 2010 by the Jinja Team.
|
||||
:license: BSD, see LICENSE for more details.
|
||||
"""
|
||||
|
||||
|
||||
#: list of lorem ipsum words used by the lipsum() helper function
|
||||
LOREM_IPSUM_WORDS = u'''\
|
||||
a ac accumsan ad adipiscing aenean aliquam aliquet amet ante aptent arcu at
|
||||
auctor augue bibendum blandit class commodo condimentum congue consectetuer
|
||||
consequat conubia convallis cras cubilia cum curabitur curae cursus dapibus
|
||||
diam dictum dictumst dignissim dis dolor donec dui duis egestas eget eleifend
|
||||
elementum elit enim erat eros est et etiam eu euismod facilisi facilisis fames
|
||||
faucibus felis fermentum feugiat fringilla fusce gravida habitant habitasse hac
|
||||
hendrerit hymenaeos iaculis id imperdiet in inceptos integer interdum ipsum
|
||||
justo lacinia lacus laoreet lectus leo libero ligula litora lobortis lorem
|
||||
luctus maecenas magna magnis malesuada massa mattis mauris metus mi molestie
|
||||
mollis montes morbi mus nam nascetur natoque nec neque netus nibh nisi nisl non
|
||||
nonummy nostra nulla nullam nunc odio orci ornare parturient pede pellentesque
|
||||
penatibus per pharetra phasellus placerat platea porta porttitor posuere
|
||||
potenti praesent pretium primis proin pulvinar purus quam quis quisque rhoncus
|
||||
ridiculus risus rutrum sagittis sapien scelerisque sed sem semper senectus sit
|
||||
sociis sociosqu sodales sollicitudin suscipit suspendisse taciti tellus tempor
|
||||
tempus tincidunt torquent tortor tristique turpis ullamcorper ultrices
|
||||
ultricies urna ut varius vehicula vel velit venenatis vestibulum vitae vivamus
|
||||
viverra volutpat vulputate'''
|
||||
Vendored
-337
@@ -1,337 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
jinja2.debug
|
||||
~~~~~~~~~~~~
|
||||
|
||||
Implements the debug interface for Jinja. This module does some pretty
|
||||
ugly stuff with the Python traceback system in order to achieve tracebacks
|
||||
with correct line numbers, locals and contents.
|
||||
|
||||
:copyright: (c) 2010 by the Jinja Team.
|
||||
:license: BSD, see LICENSE for more details.
|
||||
"""
|
||||
import sys
|
||||
import traceback
|
||||
from types import TracebackType
|
||||
from jinja2.utils import missing, internal_code
|
||||
from jinja2.exceptions import TemplateSyntaxError
|
||||
from jinja2._compat import iteritems, reraise, code_type
|
||||
|
||||
# on pypy we can take advantage of transparent proxies
|
||||
try:
|
||||
from __pypy__ import tproxy
|
||||
except ImportError:
|
||||
tproxy = None
|
||||
|
||||
|
||||
# how does the raise helper look like?
|
||||
try:
|
||||
exec("raise TypeError, 'foo'")
|
||||
except SyntaxError:
|
||||
raise_helper = 'raise __jinja_exception__[1]'
|
||||
except TypeError:
|
||||
raise_helper = 'raise __jinja_exception__[0], __jinja_exception__[1]'
|
||||
|
||||
|
||||
class TracebackFrameProxy(object):
|
||||
"""Proxies a traceback frame."""
|
||||
|
||||
def __init__(self, tb):
|
||||
self.tb = tb
|
||||
self._tb_next = None
|
||||
|
||||
@property
|
||||
def tb_next(self):
|
||||
return self._tb_next
|
||||
|
||||
def set_next(self, next):
|
||||
if tb_set_next is not None:
|
||||
try:
|
||||
tb_set_next(self.tb, next and next.tb or None)
|
||||
except Exception:
|
||||
# this function can fail due to all the hackery it does
|
||||
# on various python implementations. We just catch errors
|
||||
# down and ignore them if necessary.
|
||||
pass
|
||||
self._tb_next = next
|
||||
|
||||
@property
|
||||
def is_jinja_frame(self):
|
||||
return '__jinja_template__' in self.tb.tb_frame.f_globals
|
||||
|
||||
def __getattr__(self, name):
|
||||
return getattr(self.tb, name)
|
||||
|
||||
|
||||
def make_frame_proxy(frame):
|
||||
proxy = TracebackFrameProxy(frame)
|
||||
if tproxy is None:
|
||||
return proxy
|
||||
def operation_handler(operation, *args, **kwargs):
|
||||
if operation in ('__getattribute__', '__getattr__'):
|
||||
return getattr(proxy, args[0])
|
||||
elif operation == '__setattr__':
|
||||
proxy.__setattr__(*args, **kwargs)
|
||||
else:
|
||||
return getattr(proxy, operation)(*args, **kwargs)
|
||||
return tproxy(TracebackType, operation_handler)
|
||||
|
||||
|
||||
class ProcessedTraceback(object):
|
||||
"""Holds a Jinja preprocessed traceback for printing or reraising."""
|
||||
|
||||
def __init__(self, exc_type, exc_value, frames):
|
||||
assert frames, 'no frames for this traceback?'
|
||||
self.exc_type = exc_type
|
||||
self.exc_value = exc_value
|
||||
self.frames = frames
|
||||
|
||||
# newly concatenate the frames (which are proxies)
|
||||
prev_tb = None
|
||||
for tb in self.frames:
|
||||
if prev_tb is not None:
|
||||
prev_tb.set_next(tb)
|
||||
prev_tb = tb
|
||||
prev_tb.set_next(None)
|
||||
|
||||
def render_as_text(self, limit=None):
|
||||
"""Return a string with the traceback."""
|
||||
lines = traceback.format_exception(self.exc_type, self.exc_value,
|
||||
self.frames[0], limit=limit)
|
||||
return ''.join(lines).rstrip()
|
||||
|
||||
def render_as_html(self, full=False):
|
||||
"""Return a unicode string with the traceback as rendered HTML."""
|
||||
from jinja2.debugrenderer import render_traceback
|
||||
return u'%s\n\n<!--\n%s\n-->' % (
|
||||
render_traceback(self, full=full),
|
||||
self.render_as_text().decode('utf-8', 'replace')
|
||||
)
|
||||
|
||||
@property
|
||||
def is_template_syntax_error(self):
|
||||
"""`True` if this is a template syntax error."""
|
||||
return isinstance(self.exc_value, TemplateSyntaxError)
|
||||
|
||||
@property
|
||||
def exc_info(self):
|
||||
"""Exception info tuple with a proxy around the frame objects."""
|
||||
return self.exc_type, self.exc_value, self.frames[0]
|
||||
|
||||
@property
|
||||
def standard_exc_info(self):
|
||||
"""Standard python exc_info for re-raising"""
|
||||
tb = self.frames[0]
|
||||
# the frame will be an actual traceback (or transparent proxy) if
|
||||
# we are on pypy or a python implementation with support for tproxy
|
||||
if type(tb) is not TracebackType:
|
||||
tb = tb.tb
|
||||
return self.exc_type, self.exc_value, tb
|
||||
|
||||
|
||||
def make_traceback(exc_info, source_hint=None):
|
||||
"""Creates a processed traceback object from the exc_info."""
|
||||
exc_type, exc_value, tb = exc_info
|
||||
if isinstance(exc_value, TemplateSyntaxError):
|
||||
exc_info = translate_syntax_error(exc_value, source_hint)
|
||||
initial_skip = 0
|
||||
else:
|
||||
initial_skip = 1
|
||||
return translate_exception(exc_info, initial_skip)
|
||||
|
||||
|
||||
def translate_syntax_error(error, source=None):
|
||||
"""Rewrites a syntax error to please traceback systems."""
|
||||
error.source = source
|
||||
error.translated = True
|
||||
exc_info = (error.__class__, error, None)
|
||||
filename = error.filename
|
||||
if filename is None:
|
||||
filename = '<unknown>'
|
||||
return fake_exc_info(exc_info, filename, error.lineno)
|
||||
|
||||
|
||||
def translate_exception(exc_info, initial_skip=0):
|
||||
"""If passed an exc_info it will automatically rewrite the exceptions
|
||||
all the way down to the correct line numbers and frames.
|
||||
"""
|
||||
tb = exc_info[2]
|
||||
frames = []
|
||||
|
||||
# skip some internal frames if wanted
|
||||
for x in range(initial_skip):
|
||||
if tb is not None:
|
||||
tb = tb.tb_next
|
||||
initial_tb = tb
|
||||
|
||||
while tb is not None:
|
||||
# skip frames decorated with @internalcode. These are internal
|
||||
# calls we can't avoid and that are useless in template debugging
|
||||
# output.
|
||||
if tb.tb_frame.f_code in internal_code:
|
||||
tb = tb.tb_next
|
||||
continue
|
||||
|
||||
# save a reference to the next frame if we override the current
|
||||
# one with a faked one.
|
||||
next = tb.tb_next
|
||||
|
||||
# fake template exceptions
|
||||
template = tb.tb_frame.f_globals.get('__jinja_template__')
|
||||
if template is not None:
|
||||
lineno = template.get_corresponding_lineno(tb.tb_lineno)
|
||||
tb = fake_exc_info(exc_info[:2] + (tb,), template.filename,
|
||||
lineno)[2]
|
||||
|
||||
frames.append(make_frame_proxy(tb))
|
||||
tb = next
|
||||
|
||||
# if we don't have any exceptions in the frames left, we have to
|
||||
# reraise it unchanged.
|
||||
# XXX: can we backup here? when could this happen?
|
||||
if not frames:
|
||||
reraise(exc_info[0], exc_info[1], exc_info[2])
|
||||
|
||||
return ProcessedTraceback(exc_info[0], exc_info[1], frames)
|
||||
|
||||
|
||||
def fake_exc_info(exc_info, filename, lineno):
|
||||
"""Helper for `translate_exception`."""
|
||||
exc_type, exc_value, tb = exc_info
|
||||
|
||||
# figure the real context out
|
||||
if tb is not None:
|
||||
real_locals = tb.tb_frame.f_locals.copy()
|
||||
ctx = real_locals.get('context')
|
||||
if ctx:
|
||||
locals = ctx.get_all()
|
||||
else:
|
||||
locals = {}
|
||||
for name, value in iteritems(real_locals):
|
||||
if name.startswith('l_') and value is not missing:
|
||||
locals[name[2:]] = value
|
||||
|
||||
# if there is a local called __jinja_exception__, we get
|
||||
# rid of it to not break the debug functionality.
|
||||
locals.pop('__jinja_exception__', None)
|
||||
else:
|
||||
locals = {}
|
||||
|
||||
# assamble fake globals we need
|
||||
globals = {
|
||||
'__name__': filename,
|
||||
'__file__': filename,
|
||||
'__jinja_exception__': exc_info[:2],
|
||||
|
||||
# we don't want to keep the reference to the template around
|
||||
# to not cause circular dependencies, but we mark it as Jinja
|
||||
# frame for the ProcessedTraceback
|
||||
'__jinja_template__': None
|
||||
}
|
||||
|
||||
# and fake the exception
|
||||
code = compile('\n' * (lineno - 1) + raise_helper, filename, 'exec')
|
||||
|
||||
# if it's possible, change the name of the code. This won't work
|
||||
# on some python environments such as google appengine
|
||||
try:
|
||||
if tb is None:
|
||||
location = 'template'
|
||||
else:
|
||||
function = tb.tb_frame.f_code.co_name
|
||||
if function == 'root':
|
||||
location = 'top-level template code'
|
||||
elif function.startswith('block_'):
|
||||
location = 'block "%s"' % function[6:]
|
||||
else:
|
||||
location = 'template'
|
||||
code = code_type(0, code.co_nlocals, code.co_stacksize,
|
||||
code.co_flags, code.co_code, code.co_consts,
|
||||
code.co_names, code.co_varnames, filename,
|
||||
location, code.co_firstlineno,
|
||||
code.co_lnotab, (), ())
|
||||
except:
|
||||
pass
|
||||
|
||||
# execute the code and catch the new traceback
|
||||
try:
|
||||
exec(code, globals, locals)
|
||||
except:
|
||||
exc_info = sys.exc_info()
|
||||
new_tb = exc_info[2].tb_next
|
||||
|
||||
# return without this frame
|
||||
return exc_info[:2] + (new_tb,)
|
||||
|
||||
|
||||
def _init_ugly_crap():
|
||||
"""This function implements a few ugly things so that we can patch the
|
||||
traceback objects. The function returned allows resetting `tb_next` on
|
||||
any python traceback object. Do not attempt to use this on non cpython
|
||||
interpreters
|
||||
"""
|
||||
import ctypes
|
||||
from types import TracebackType
|
||||
|
||||
# figure out side of _Py_ssize_t
|
||||
if hasattr(ctypes.pythonapi, 'Py_InitModule4_64'):
|
||||
_Py_ssize_t = ctypes.c_int64
|
||||
else:
|
||||
_Py_ssize_t = ctypes.c_int
|
||||
|
||||
# regular python
|
||||
class _PyObject(ctypes.Structure):
|
||||
pass
|
||||
_PyObject._fields_ = [
|
||||
('ob_refcnt', _Py_ssize_t),
|
||||
('ob_type', ctypes.POINTER(_PyObject))
|
||||
]
|
||||
|
||||
# python with trace
|
||||
if hasattr(sys, 'getobjects'):
|
||||
class _PyObject(ctypes.Structure):
|
||||
pass
|
||||
_PyObject._fields_ = [
|
||||
('_ob_next', ctypes.POINTER(_PyObject)),
|
||||
('_ob_prev', ctypes.POINTER(_PyObject)),
|
||||
('ob_refcnt', _Py_ssize_t),
|
||||
('ob_type', ctypes.POINTER(_PyObject))
|
||||
]
|
||||
|
||||
class _Traceback(_PyObject):
|
||||
pass
|
||||
_Traceback._fields_ = [
|
||||
('tb_next', ctypes.POINTER(_Traceback)),
|
||||
('tb_frame', ctypes.POINTER(_PyObject)),
|
||||
('tb_lasti', ctypes.c_int),
|
||||
('tb_lineno', ctypes.c_int)
|
||||
]
|
||||
|
||||
def tb_set_next(tb, next):
|
||||
"""Set the tb_next attribute of a traceback object."""
|
||||
if not (isinstance(tb, TracebackType) and
|
||||
(next is None or isinstance(next, TracebackType))):
|
||||
raise TypeError('tb_set_next arguments must be traceback objects')
|
||||
obj = _Traceback.from_address(id(tb))
|
||||
if tb.tb_next is not None:
|
||||
old = _Traceback.from_address(id(tb.tb_next))
|
||||
old.ob_refcnt -= 1
|
||||
if next is None:
|
||||
obj.tb_next = ctypes.POINTER(_Traceback)()
|
||||
else:
|
||||
next = _Traceback.from_address(id(next))
|
||||
next.ob_refcnt += 1
|
||||
obj.tb_next = ctypes.pointer(next)
|
||||
|
||||
return tb_set_next
|
||||
|
||||
|
||||
# try to get a tb_set_next implementation if we don't have transparent
|
||||
# proxies.
|
||||
tb_set_next = None
|
||||
if tproxy is None:
|
||||
try:
|
||||
tb_set_next = _init_ugly_crap()
|
||||
except:
|
||||
pass
|
||||
del _init_ugly_crap
|
||||
Vendored
-43
@@ -1,43 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
jinja2.defaults
|
||||
~~~~~~~~~~~~~~~
|
||||
|
||||
Jinja default filters and tags.
|
||||
|
||||
:copyright: (c) 2010 by the Jinja Team.
|
||||
:license: BSD, see LICENSE for more details.
|
||||
"""
|
||||
from jinja2._compat import range_type
|
||||
from jinja2.utils import generate_lorem_ipsum, Cycler, Joiner
|
||||
|
||||
|
||||
# defaults for the parser / lexer
|
||||
BLOCK_START_STRING = '{%'
|
||||
BLOCK_END_STRING = '%}'
|
||||
VARIABLE_START_STRING = '{{'
|
||||
VARIABLE_END_STRING = '}}'
|
||||
COMMENT_START_STRING = '{#'
|
||||
COMMENT_END_STRING = '#}'
|
||||
LINE_STATEMENT_PREFIX = None
|
||||
LINE_COMMENT_PREFIX = None
|
||||
TRIM_BLOCKS = False
|
||||
LSTRIP_BLOCKS = False
|
||||
NEWLINE_SEQUENCE = '\n'
|
||||
KEEP_TRAILING_NEWLINE = False
|
||||
|
||||
|
||||
# default filters, tests and namespace
|
||||
from jinja2.filters import FILTERS as DEFAULT_FILTERS
|
||||
from jinja2.tests import TESTS as DEFAULT_TESTS
|
||||
DEFAULT_NAMESPACE = {
|
||||
'range': range_type,
|
||||
'dict': lambda **kw: kw,
|
||||
'lipsum': generate_lorem_ipsum,
|
||||
'cycler': Cycler,
|
||||
'joiner': Joiner
|
||||
}
|
||||
|
||||
|
||||
# export all constants
|
||||
__all__ = tuple(x for x in locals().keys() if x.isupper())
|
||||
Vendored
-1191
File diff suppressed because it is too large
Load Diff
Vendored
-146
@@ -1,146 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
jinja2.exceptions
|
||||
~~~~~~~~~~~~~~~~~
|
||||
|
||||
Jinja exceptions.
|
||||
|
||||
:copyright: (c) 2010 by the Jinja Team.
|
||||
:license: BSD, see LICENSE for more details.
|
||||
"""
|
||||
from jinja2._compat import imap, text_type, PY2, implements_to_string
|
||||
|
||||
|
||||
class TemplateError(Exception):
|
||||
"""Baseclass for all template errors."""
|
||||
|
||||
if PY2:
|
||||
def __init__(self, message=None):
|
||||
if message is not None:
|
||||
message = text_type(message).encode('utf-8')
|
||||
Exception.__init__(self, message)
|
||||
|
||||
@property
|
||||
def message(self):
|
||||
if self.args:
|
||||
message = self.args[0]
|
||||
if message is not None:
|
||||
return message.decode('utf-8', 'replace')
|
||||
|
||||
def __unicode__(self):
|
||||
return self.message or u''
|
||||
else:
|
||||
def __init__(self, message=None):
|
||||
Exception.__init__(self, message)
|
||||
|
||||
@property
|
||||
def message(self):
|
||||
if self.args:
|
||||
message = self.args[0]
|
||||
if message is not None:
|
||||
return message
|
||||
|
||||
|
||||
@implements_to_string
|
||||
class TemplateNotFound(IOError, LookupError, TemplateError):
|
||||
"""Raised if a template does not exist."""
|
||||
|
||||
# looks weird, but removes the warning descriptor that just
|
||||
# bogusly warns us about message being deprecated
|
||||
message = None
|
||||
|
||||
def __init__(self, name, message=None):
|
||||
IOError.__init__(self)
|
||||
if message is None:
|
||||
message = name
|
||||
self.message = message
|
||||
self.name = name
|
||||
self.templates = [name]
|
||||
|
||||
def __str__(self):
|
||||
return self.message
|
||||
|
||||
|
||||
class TemplatesNotFound(TemplateNotFound):
|
||||
"""Like :class:`TemplateNotFound` but raised if multiple templates
|
||||
are selected. This is a subclass of :class:`TemplateNotFound`
|
||||
exception, so just catching the base exception will catch both.
|
||||
|
||||
.. versionadded:: 2.2
|
||||
"""
|
||||
|
||||
def __init__(self, names=(), message=None):
|
||||
if message is None:
|
||||
message = u'none of the templates given were found: ' + \
|
||||
u', '.join(imap(text_type, names))
|
||||
TemplateNotFound.__init__(self, names and names[-1] or None, message)
|
||||
self.templates = list(names)
|
||||
|
||||
|
||||
@implements_to_string
|
||||
class TemplateSyntaxError(TemplateError):
|
||||
"""Raised to tell the user that there is a problem with the template."""
|
||||
|
||||
def __init__(self, message, lineno, name=None, filename=None):
|
||||
TemplateError.__init__(self, message)
|
||||
self.lineno = lineno
|
||||
self.name = name
|
||||
self.filename = filename
|
||||
self.source = None
|
||||
|
||||
# this is set to True if the debug.translate_syntax_error
|
||||
# function translated the syntax error into a new traceback
|
||||
self.translated = False
|
||||
|
||||
def __str__(self):
|
||||
# for translated errors we only return the message
|
||||
if self.translated:
|
||||
return self.message
|
||||
|
||||
# otherwise attach some stuff
|
||||
location = 'line %d' % self.lineno
|
||||
name = self.filename or self.name
|
||||
if name:
|
||||
location = 'File "%s", %s' % (name, location)
|
||||
lines = [self.message, ' ' + location]
|
||||
|
||||
# if the source is set, add the line to the output
|
||||
if self.source is not None:
|
||||
try:
|
||||
line = self.source.splitlines()[self.lineno - 1]
|
||||
except IndexError:
|
||||
line = None
|
||||
if line:
|
||||
lines.append(' ' + line.strip())
|
||||
|
||||
return u'\n'.join(lines)
|
||||
|
||||
|
||||
class TemplateAssertionError(TemplateSyntaxError):
|
||||
"""Like a template syntax error, but covers cases where something in the
|
||||
template caused an error at compile time that wasn't necessarily caused
|
||||
by a syntax error. However it's a direct subclass of
|
||||
:exc:`TemplateSyntaxError` and has the same attributes.
|
||||
"""
|
||||
|
||||
|
||||
class TemplateRuntimeError(TemplateError):
|
||||
"""A generic runtime error in the template engine. Under some situations
|
||||
Jinja may raise this exception.
|
||||
"""
|
||||
|
||||
|
||||
class UndefinedError(TemplateRuntimeError):
|
||||
"""Raised if a template tries to operate on :class:`Undefined`."""
|
||||
|
||||
|
||||
class SecurityError(TemplateRuntimeError):
|
||||
"""Raised if a template tries to do something insecure if the
|
||||
sandbox is enabled.
|
||||
"""
|
||||
|
||||
|
||||
class FilterArgumentError(TemplateRuntimeError):
|
||||
"""This error is raised if a filter was called with inappropriate
|
||||
arguments
|
||||
"""
|
||||
Vendored
-636
@@ -1,636 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
jinja2.ext
|
||||
~~~~~~~~~~
|
||||
|
||||
Jinja extensions allow to add custom tags similar to the way django custom
|
||||
tags work. By default two example extensions exist: an i18n and a cache
|
||||
extension.
|
||||
|
||||
:copyright: (c) 2010 by the Jinja Team.
|
||||
:license: BSD.
|
||||
"""
|
||||
from jinja2 import nodes
|
||||
from jinja2.defaults import BLOCK_START_STRING, \
|
||||
BLOCK_END_STRING, VARIABLE_START_STRING, VARIABLE_END_STRING, \
|
||||
COMMENT_START_STRING, COMMENT_END_STRING, LINE_STATEMENT_PREFIX, \
|
||||
LINE_COMMENT_PREFIX, TRIM_BLOCKS, NEWLINE_SEQUENCE, \
|
||||
KEEP_TRAILING_NEWLINE, LSTRIP_BLOCKS
|
||||
from jinja2.environment import Environment
|
||||
from jinja2.runtime import concat
|
||||
from jinja2.exceptions import TemplateAssertionError, TemplateSyntaxError
|
||||
from jinja2.utils import contextfunction, import_string, Markup
|
||||
from jinja2._compat import next, with_metaclass, string_types, iteritems
|
||||
|
||||
|
||||
# the only real useful gettext functions for a Jinja template. Note
|
||||
# that ugettext must be assigned to gettext as Jinja doesn't support
|
||||
# non unicode strings.
|
||||
GETTEXT_FUNCTIONS = ('_', 'gettext', 'ngettext')
|
||||
|
||||
|
||||
class ExtensionRegistry(type):
|
||||
"""Gives the extension an unique identifier."""
|
||||
|
||||
def __new__(cls, name, bases, d):
|
||||
rv = type.__new__(cls, name, bases, d)
|
||||
rv.identifier = rv.__module__ + '.' + rv.__name__
|
||||
return rv
|
||||
|
||||
|
||||
class Extension(with_metaclass(ExtensionRegistry, object)):
|
||||
"""Extensions can be used to add extra functionality to the Jinja template
|
||||
system at the parser level. Custom extensions are bound to an environment
|
||||
but may not store environment specific data on `self`. The reason for
|
||||
this is that an extension can be bound to another environment (for
|
||||
overlays) by creating a copy and reassigning the `environment` attribute.
|
||||
|
||||
As extensions are created by the environment they cannot accept any
|
||||
arguments for configuration. One may want to work around that by using
|
||||
a factory function, but that is not possible as extensions are identified
|
||||
by their import name. The correct way to configure the extension is
|
||||
storing the configuration values on the environment. Because this way the
|
||||
environment ends up acting as central configuration storage the
|
||||
attributes may clash which is why extensions have to ensure that the names
|
||||
they choose for configuration are not too generic. ``prefix`` for example
|
||||
is a terrible name, ``fragment_cache_prefix`` on the other hand is a good
|
||||
name as includes the name of the extension (fragment cache).
|
||||
"""
|
||||
|
||||
#: if this extension parses this is the list of tags it's listening to.
|
||||
tags = set()
|
||||
|
||||
#: the priority of that extension. This is especially useful for
|
||||
#: extensions that preprocess values. A lower value means higher
|
||||
#: priority.
|
||||
#:
|
||||
#: .. versionadded:: 2.4
|
||||
priority = 100
|
||||
|
||||
def __init__(self, environment):
|
||||
self.environment = environment
|
||||
|
||||
def bind(self, environment):
|
||||
"""Create a copy of this extension bound to another environment."""
|
||||
rv = object.__new__(self.__class__)
|
||||
rv.__dict__.update(self.__dict__)
|
||||
rv.environment = environment
|
||||
return rv
|
||||
|
||||
def preprocess(self, source, name, filename=None):
|
||||
"""This method is called before the actual lexing and can be used to
|
||||
preprocess the source. The `filename` is optional. The return value
|
||||
must be the preprocessed source.
|
||||
"""
|
||||
return source
|
||||
|
||||
def filter_stream(self, stream):
|
||||
"""It's passed a :class:`~jinja2.lexer.TokenStream` that can be used
|
||||
to filter tokens returned. This method has to return an iterable of
|
||||
:class:`~jinja2.lexer.Token`\s, but it doesn't have to return a
|
||||
:class:`~jinja2.lexer.TokenStream`.
|
||||
|
||||
In the `ext` folder of the Jinja2 source distribution there is a file
|
||||
called `inlinegettext.py` which implements a filter that utilizes this
|
||||
method.
|
||||
"""
|
||||
return stream
|
||||
|
||||
def parse(self, parser):
|
||||
"""If any of the :attr:`tags` matched this method is called with the
|
||||
parser as first argument. The token the parser stream is pointing at
|
||||
is the name token that matched. This method has to return one or a
|
||||
list of multiple nodes.
|
||||
"""
|
||||
raise NotImplementedError()
|
||||
|
||||
def attr(self, name, lineno=None):
|
||||
"""Return an attribute node for the current extension. This is useful
|
||||
to pass constants on extensions to generated template code.
|
||||
|
||||
::
|
||||
|
||||
self.attr('_my_attribute', lineno=lineno)
|
||||
"""
|
||||
return nodes.ExtensionAttribute(self.identifier, name, lineno=lineno)
|
||||
|
||||
def call_method(self, name, args=None, kwargs=None, dyn_args=None,
|
||||
dyn_kwargs=None, lineno=None):
|
||||
"""Call a method of the extension. This is a shortcut for
|
||||
:meth:`attr` + :class:`jinja2.nodes.Call`.
|
||||
"""
|
||||
if args is None:
|
||||
args = []
|
||||
if kwargs is None:
|
||||
kwargs = []
|
||||
return nodes.Call(self.attr(name, lineno=lineno), args, kwargs,
|
||||
dyn_args, dyn_kwargs, lineno=lineno)
|
||||
|
||||
|
||||
@contextfunction
|
||||
def _gettext_alias(__context, *args, **kwargs):
|
||||
return __context.call(__context.resolve('gettext'), *args, **kwargs)
|
||||
|
||||
|
||||
def _make_new_gettext(func):
|
||||
@contextfunction
|
||||
def gettext(__context, __string, **variables):
|
||||
rv = __context.call(func, __string)
|
||||
if __context.eval_ctx.autoescape:
|
||||
rv = Markup(rv)
|
||||
return rv % variables
|
||||
return gettext
|
||||
|
||||
|
||||
def _make_new_ngettext(func):
|
||||
@contextfunction
|
||||
def ngettext(__context, __singular, __plural, __num, **variables):
|
||||
variables.setdefault('num', __num)
|
||||
rv = __context.call(func, __singular, __plural, __num)
|
||||
if __context.eval_ctx.autoescape:
|
||||
rv = Markup(rv)
|
||||
return rv % variables
|
||||
return ngettext
|
||||
|
||||
|
||||
class InternationalizationExtension(Extension):
|
||||
"""This extension adds gettext support to Jinja2."""
|
||||
tags = set(['trans'])
|
||||
|
||||
# TODO: the i18n extension is currently reevaluating values in a few
|
||||
# situations. Take this example:
|
||||
# {% trans count=something() %}{{ count }} foo{% pluralize
|
||||
# %}{{ count }} fooss{% endtrans %}
|
||||
# something is called twice here. One time for the gettext value and
|
||||
# the other time for the n-parameter of the ngettext function.
|
||||
|
||||
def __init__(self, environment):
|
||||
Extension.__init__(self, environment)
|
||||
environment.globals['_'] = _gettext_alias
|
||||
environment.extend(
|
||||
install_gettext_translations=self._install,
|
||||
install_null_translations=self._install_null,
|
||||
install_gettext_callables=self._install_callables,
|
||||
uninstall_gettext_translations=self._uninstall,
|
||||
extract_translations=self._extract,
|
||||
newstyle_gettext=False
|
||||
)
|
||||
|
||||
def _install(self, translations, newstyle=None):
|
||||
gettext = getattr(translations, 'ugettext', None)
|
||||
if gettext is None:
|
||||
gettext = translations.gettext
|
||||
ngettext = getattr(translations, 'ungettext', None)
|
||||
if ngettext is None:
|
||||
ngettext = translations.ngettext
|
||||
self._install_callables(gettext, ngettext, newstyle)
|
||||
|
||||
def _install_null(self, newstyle=None):
|
||||
self._install_callables(
|
||||
lambda x: x,
|
||||
lambda s, p, n: (n != 1 and (p,) or (s,))[0],
|
||||
newstyle
|
||||
)
|
||||
|
||||
def _install_callables(self, gettext, ngettext, newstyle=None):
|
||||
if newstyle is not None:
|
||||
self.environment.newstyle_gettext = newstyle
|
||||
if self.environment.newstyle_gettext:
|
||||
gettext = _make_new_gettext(gettext)
|
||||
ngettext = _make_new_ngettext(ngettext)
|
||||
self.environment.globals.update(
|
||||
gettext=gettext,
|
||||
ngettext=ngettext
|
||||
)
|
||||
|
||||
def _uninstall(self, translations):
|
||||
for key in 'gettext', 'ngettext':
|
||||
self.environment.globals.pop(key, None)
|
||||
|
||||
def _extract(self, source, gettext_functions=GETTEXT_FUNCTIONS):
|
||||
if isinstance(source, string_types):
|
||||
source = self.environment.parse(source)
|
||||
return extract_from_ast(source, gettext_functions)
|
||||
|
||||
def parse(self, parser):
|
||||
"""Parse a translatable tag."""
|
||||
lineno = next(parser.stream).lineno
|
||||
num_called_num = False
|
||||
|
||||
# find all the variables referenced. Additionally a variable can be
|
||||
# defined in the body of the trans block too, but this is checked at
|
||||
# a later state.
|
||||
plural_expr = None
|
||||
plural_expr_assignment = None
|
||||
variables = {}
|
||||
while parser.stream.current.type != 'block_end':
|
||||
if variables:
|
||||
parser.stream.expect('comma')
|
||||
|
||||
# skip colon for python compatibility
|
||||
if parser.stream.skip_if('colon'):
|
||||
break
|
||||
|
||||
name = parser.stream.expect('name')
|
||||
if name.value in variables:
|
||||
parser.fail('translatable variable %r defined twice.' %
|
||||
name.value, name.lineno,
|
||||
exc=TemplateAssertionError)
|
||||
|
||||
# expressions
|
||||
if parser.stream.current.type == 'assign':
|
||||
next(parser.stream)
|
||||
variables[name.value] = var = parser.parse_expression()
|
||||
else:
|
||||
variables[name.value] = var = nodes.Name(name.value, 'load')
|
||||
|
||||
if plural_expr is None:
|
||||
if isinstance(var, nodes.Call):
|
||||
plural_expr = nodes.Name('_trans', 'load')
|
||||
variables[name.value] = plural_expr
|
||||
plural_expr_assignment = nodes.Assign(
|
||||
nodes.Name('_trans', 'store'), var)
|
||||
else:
|
||||
plural_expr = var
|
||||
num_called_num = name.value == 'num'
|
||||
|
||||
parser.stream.expect('block_end')
|
||||
|
||||
plural = plural_names = None
|
||||
have_plural = False
|
||||
referenced = set()
|
||||
|
||||
# now parse until endtrans or pluralize
|
||||
singular_names, singular = self._parse_block(parser, True)
|
||||
if singular_names:
|
||||
referenced.update(singular_names)
|
||||
if plural_expr is None:
|
||||
plural_expr = nodes.Name(singular_names[0], 'load')
|
||||
num_called_num = singular_names[0] == 'num'
|
||||
|
||||
# if we have a pluralize block, we parse that too
|
||||
if parser.stream.current.test('name:pluralize'):
|
||||
have_plural = True
|
||||
next(parser.stream)
|
||||
if parser.stream.current.type != 'block_end':
|
||||
name = parser.stream.expect('name')
|
||||
if name.value not in variables:
|
||||
parser.fail('unknown variable %r for pluralization' %
|
||||
name.value, name.lineno,
|
||||
exc=TemplateAssertionError)
|
||||
plural_expr = variables[name.value]
|
||||
num_called_num = name.value == 'num'
|
||||
parser.stream.expect('block_end')
|
||||
plural_names, plural = self._parse_block(parser, False)
|
||||
next(parser.stream)
|
||||
referenced.update(plural_names)
|
||||
else:
|
||||
next(parser.stream)
|
||||
|
||||
# register free names as simple name expressions
|
||||
for var in referenced:
|
||||
if var not in variables:
|
||||
variables[var] = nodes.Name(var, 'load')
|
||||
|
||||
if not have_plural:
|
||||
plural_expr = None
|
||||
elif plural_expr is None:
|
||||
parser.fail('pluralize without variables', lineno)
|
||||
|
||||
node = self._make_node(singular, plural, variables, plural_expr,
|
||||
bool(referenced),
|
||||
num_called_num and have_plural)
|
||||
node.set_lineno(lineno)
|
||||
if plural_expr_assignment is not None:
|
||||
return [plural_expr_assignment, node]
|
||||
else:
|
||||
return node
|
||||
|
||||
def _parse_block(self, parser, allow_pluralize):
|
||||
"""Parse until the next block tag with a given name."""
|
||||
referenced = []
|
||||
buf = []
|
||||
while 1:
|
||||
if parser.stream.current.type == 'data':
|
||||
buf.append(parser.stream.current.value.replace('%', '%%'))
|
||||
next(parser.stream)
|
||||
elif parser.stream.current.type == 'variable_begin':
|
||||
next(parser.stream)
|
||||
name = parser.stream.expect('name').value
|
||||
referenced.append(name)
|
||||
buf.append('%%(%s)s' % name)
|
||||
parser.stream.expect('variable_end')
|
||||
elif parser.stream.current.type == 'block_begin':
|
||||
next(parser.stream)
|
||||
if parser.stream.current.test('name:endtrans'):
|
||||
break
|
||||
elif parser.stream.current.test('name:pluralize'):
|
||||
if allow_pluralize:
|
||||
break
|
||||
parser.fail('a translatable section can have only one '
|
||||
'pluralize section')
|
||||
parser.fail('control structures in translatable sections are '
|
||||
'not allowed')
|
||||
elif parser.stream.eos:
|
||||
parser.fail('unclosed translation block')
|
||||
else:
|
||||
assert False, 'internal parser error'
|
||||
|
||||
return referenced, concat(buf)
|
||||
|
||||
def _make_node(self, singular, plural, variables, plural_expr,
|
||||
vars_referenced, num_called_num):
|
||||
"""Generates a useful node from the data provided."""
|
||||
# no variables referenced? no need to escape for old style
|
||||
# gettext invocations only if there are vars.
|
||||
if not vars_referenced and not self.environment.newstyle_gettext:
|
||||
singular = singular.replace('%%', '%')
|
||||
if plural:
|
||||
plural = plural.replace('%%', '%')
|
||||
|
||||
# singular only:
|
||||
if plural_expr is None:
|
||||
gettext = nodes.Name('gettext', 'load')
|
||||
node = nodes.Call(gettext, [nodes.Const(singular)],
|
||||
[], None, None)
|
||||
|
||||
# singular and plural
|
||||
else:
|
||||
ngettext = nodes.Name('ngettext', 'load')
|
||||
node = nodes.Call(ngettext, [
|
||||
nodes.Const(singular),
|
||||
nodes.Const(plural),
|
||||
plural_expr
|
||||
], [], None, None)
|
||||
|
||||
# in case newstyle gettext is used, the method is powerful
|
||||
# enough to handle the variable expansion and autoescape
|
||||
# handling itself
|
||||
if self.environment.newstyle_gettext:
|
||||
for key, value in iteritems(variables):
|
||||
# the function adds that later anyways in case num was
|
||||
# called num, so just skip it.
|
||||
if num_called_num and key == 'num':
|
||||
continue
|
||||
node.kwargs.append(nodes.Keyword(key, value))
|
||||
|
||||
# otherwise do that here
|
||||
else:
|
||||
# mark the return value as safe if we are in an
|
||||
# environment with autoescaping turned on
|
||||
node = nodes.MarkSafeIfAutoescape(node)
|
||||
if variables:
|
||||
node = nodes.Mod(node, nodes.Dict([
|
||||
nodes.Pair(nodes.Const(key), value)
|
||||
for key, value in variables.items()
|
||||
]))
|
||||
return nodes.Output([node])
|
||||
|
||||
|
||||
class ExprStmtExtension(Extension):
|
||||
"""Adds a `do` tag to Jinja2 that works like the print statement just
|
||||
that it doesn't print the return value.
|
||||
"""
|
||||
tags = set(['do'])
|
||||
|
||||
def parse(self, parser):
|
||||
node = nodes.ExprStmt(lineno=next(parser.stream).lineno)
|
||||
node.node = parser.parse_tuple()
|
||||
return node
|
||||
|
||||
|
||||
class LoopControlExtension(Extension):
|
||||
"""Adds break and continue to the template engine."""
|
||||
tags = set(['break', 'continue'])
|
||||
|
||||
def parse(self, parser):
|
||||
token = next(parser.stream)
|
||||
if token.value == 'break':
|
||||
return nodes.Break(lineno=token.lineno)
|
||||
return nodes.Continue(lineno=token.lineno)
|
||||
|
||||
|
||||
class WithExtension(Extension):
|
||||
"""Adds support for a django-like with block."""
|
||||
tags = set(['with'])
|
||||
|
||||
def parse(self, parser):
|
||||
node = nodes.Scope(lineno=next(parser.stream).lineno)
|
||||
assignments = []
|
||||
while parser.stream.current.type != 'block_end':
|
||||
lineno = parser.stream.current.lineno
|
||||
if assignments:
|
||||
parser.stream.expect('comma')
|
||||
target = parser.parse_assign_target()
|
||||
parser.stream.expect('assign')
|
||||
expr = parser.parse_expression()
|
||||
assignments.append(nodes.Assign(target, expr, lineno=lineno))
|
||||
node.body = assignments + \
|
||||
list(parser.parse_statements(('name:endwith',),
|
||||
drop_needle=True))
|
||||
return node
|
||||
|
||||
|
||||
class AutoEscapeExtension(Extension):
|
||||
"""Changes auto escape rules for a scope."""
|
||||
tags = set(['autoescape'])
|
||||
|
||||
def parse(self, parser):
|
||||
node = nodes.ScopedEvalContextModifier(lineno=next(parser.stream).lineno)
|
||||
node.options = [
|
||||
nodes.Keyword('autoescape', parser.parse_expression())
|
||||
]
|
||||
node.body = parser.parse_statements(('name:endautoescape',),
|
||||
drop_needle=True)
|
||||
return nodes.Scope([node])
|
||||
|
||||
|
||||
def extract_from_ast(node, gettext_functions=GETTEXT_FUNCTIONS,
|
||||
babel_style=True):
|
||||
"""Extract localizable strings from the given template node. Per
|
||||
default this function returns matches in babel style that means non string
|
||||
parameters as well as keyword arguments are returned as `None`. This
|
||||
allows Babel to figure out what you really meant if you are using
|
||||
gettext functions that allow keyword arguments for placeholder expansion.
|
||||
If you don't want that behavior set the `babel_style` parameter to `False`
|
||||
which causes only strings to be returned and parameters are always stored
|
||||
in tuples. As a consequence invalid gettext calls (calls without a single
|
||||
string parameter or string parameters after non-string parameters) are
|
||||
skipped.
|
||||
|
||||
This example explains the behavior:
|
||||
|
||||
>>> from jinja2 import Environment
|
||||
>>> env = Environment()
|
||||
>>> node = env.parse('{{ (_("foo"), _(), ngettext("foo", "bar", 42)) }}')
|
||||
>>> list(extract_from_ast(node))
|
||||
[(1, '_', 'foo'), (1, '_', ()), (1, 'ngettext', ('foo', 'bar', None))]
|
||||
>>> list(extract_from_ast(node, babel_style=False))
|
||||
[(1, '_', ('foo',)), (1, 'ngettext', ('foo', 'bar'))]
|
||||
|
||||
For every string found this function yields a ``(lineno, function,
|
||||
message)`` tuple, where:
|
||||
|
||||
* ``lineno`` is the number of the line on which the string was found,
|
||||
* ``function`` is the name of the ``gettext`` function used (if the
|
||||
string was extracted from embedded Python code), and
|
||||
* ``message`` is the string itself (a ``unicode`` object, or a tuple
|
||||
of ``unicode`` objects for functions with multiple string arguments).
|
||||
|
||||
This extraction function operates on the AST and is because of that unable
|
||||
to extract any comments. For comment support you have to use the babel
|
||||
extraction interface or extract comments yourself.
|
||||
"""
|
||||
for node in node.find_all(nodes.Call):
|
||||
if not isinstance(node.node, nodes.Name) or \
|
||||
node.node.name not in gettext_functions:
|
||||
continue
|
||||
|
||||
strings = []
|
||||
for arg in node.args:
|
||||
if isinstance(arg, nodes.Const) and \
|
||||
isinstance(arg.value, string_types):
|
||||
strings.append(arg.value)
|
||||
else:
|
||||
strings.append(None)
|
||||
|
||||
for arg in node.kwargs:
|
||||
strings.append(None)
|
||||
if node.dyn_args is not None:
|
||||
strings.append(None)
|
||||
if node.dyn_kwargs is not None:
|
||||
strings.append(None)
|
||||
|
||||
if not babel_style:
|
||||
strings = tuple(x for x in strings if x is not None)
|
||||
if not strings:
|
||||
continue
|
||||
else:
|
||||
if len(strings) == 1:
|
||||
strings = strings[0]
|
||||
else:
|
||||
strings = tuple(strings)
|
||||
yield node.lineno, node.node.name, strings
|
||||
|
||||
|
||||
class _CommentFinder(object):
|
||||
"""Helper class to find comments in a token stream. Can only
|
||||
find comments for gettext calls forwards. Once the comment
|
||||
from line 4 is found, a comment for line 1 will not return a
|
||||
usable value.
|
||||
"""
|
||||
|
||||
def __init__(self, tokens, comment_tags):
|
||||
self.tokens = tokens
|
||||
self.comment_tags = comment_tags
|
||||
self.offset = 0
|
||||
self.last_lineno = 0
|
||||
|
||||
def find_backwards(self, offset):
|
||||
try:
|
||||
for _, token_type, token_value in \
|
||||
reversed(self.tokens[self.offset:offset]):
|
||||
if token_type in ('comment', 'linecomment'):
|
||||
try:
|
||||
prefix, comment = token_value.split(None, 1)
|
||||
except ValueError:
|
||||
continue
|
||||
if prefix in self.comment_tags:
|
||||
return [comment.rstrip()]
|
||||
return []
|
||||
finally:
|
||||
self.offset = offset
|
||||
|
||||
def find_comments(self, lineno):
|
||||
if not self.comment_tags or self.last_lineno > lineno:
|
||||
return []
|
||||
for idx, (token_lineno, _, _) in enumerate(self.tokens[self.offset:]):
|
||||
if token_lineno > lineno:
|
||||
return self.find_backwards(self.offset + idx)
|
||||
return self.find_backwards(len(self.tokens))
|
||||
|
||||
|
||||
def babel_extract(fileobj, keywords, comment_tags, options):
|
||||
"""Babel extraction method for Jinja templates.
|
||||
|
||||
.. versionchanged:: 2.3
|
||||
Basic support for translation comments was added. If `comment_tags`
|
||||
is now set to a list of keywords for extraction, the extractor will
|
||||
try to find the best preceeding comment that begins with one of the
|
||||
keywords. For best results, make sure to not have more than one
|
||||
gettext call in one line of code and the matching comment in the
|
||||
same line or the line before.
|
||||
|
||||
.. versionchanged:: 2.5.1
|
||||
The `newstyle_gettext` flag can be set to `True` to enable newstyle
|
||||
gettext calls.
|
||||
|
||||
.. versionchanged:: 2.7
|
||||
A `silent` option can now be provided. If set to `False` template
|
||||
syntax errors are propagated instead of being ignored.
|
||||
|
||||
:param fileobj: the file-like object the messages should be extracted from
|
||||
:param keywords: a list of keywords (i.e. function names) that should be
|
||||
recognized as translation functions
|
||||
:param comment_tags: a list of translator tags to search for and include
|
||||
in the results.
|
||||
:param options: a dictionary of additional options (optional)
|
||||
:return: an iterator over ``(lineno, funcname, message, comments)`` tuples.
|
||||
(comments will be empty currently)
|
||||
"""
|
||||
extensions = set()
|
||||
for extension in options.get('extensions', '').split(','):
|
||||
extension = extension.strip()
|
||||
if not extension:
|
||||
continue
|
||||
extensions.add(import_string(extension))
|
||||
if InternationalizationExtension not in extensions:
|
||||
extensions.add(InternationalizationExtension)
|
||||
|
||||
def getbool(options, key, default=False):
|
||||
return options.get(key, str(default)).lower() in \
|
||||
('1', 'on', 'yes', 'true')
|
||||
|
||||
silent = getbool(options, 'silent', True)
|
||||
environment = Environment(
|
||||
options.get('block_start_string', BLOCK_START_STRING),
|
||||
options.get('block_end_string', BLOCK_END_STRING),
|
||||
options.get('variable_start_string', VARIABLE_START_STRING),
|
||||
options.get('variable_end_string', VARIABLE_END_STRING),
|
||||
options.get('comment_start_string', COMMENT_START_STRING),
|
||||
options.get('comment_end_string', COMMENT_END_STRING),
|
||||
options.get('line_statement_prefix') or LINE_STATEMENT_PREFIX,
|
||||
options.get('line_comment_prefix') or LINE_COMMENT_PREFIX,
|
||||
getbool(options, 'trim_blocks', TRIM_BLOCKS),
|
||||
getbool(options, 'lstrip_blocks', LSTRIP_BLOCKS),
|
||||
NEWLINE_SEQUENCE,
|
||||
getbool(options, 'keep_trailing_newline', KEEP_TRAILING_NEWLINE),
|
||||
frozenset(extensions),
|
||||
cache_size=0,
|
||||
auto_reload=False
|
||||
)
|
||||
|
||||
if getbool(options, 'newstyle_gettext'):
|
||||
environment.newstyle_gettext = True
|
||||
|
||||
source = fileobj.read().decode(options.get('encoding', 'utf-8'))
|
||||
try:
|
||||
node = environment.parse(source)
|
||||
tokens = list(environment.lex(environment.preprocess(source)))
|
||||
except TemplateSyntaxError as e:
|
||||
if not silent:
|
||||
raise
|
||||
# skip templates with syntax errors
|
||||
return
|
||||
|
||||
finder = _CommentFinder(tokens, comment_tags)
|
||||
for lineno, func, message in extract_from_ast(node, keywords):
|
||||
yield lineno, func, message, finder.find_comments(lineno)
|
||||
|
||||
|
||||
#: nicer import names
|
||||
i18n = InternationalizationExtension
|
||||
do = ExprStmtExtension
|
||||
loopcontrols = LoopControlExtension
|
||||
with_ = WithExtension
|
||||
autoescape = AutoEscapeExtension
|
||||
Vendored
-987
@@ -1,987 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
jinja2.filters
|
||||
~~~~~~~~~~~~~~
|
||||
|
||||
Bundled jinja filters.
|
||||
|
||||
:copyright: (c) 2010 by the Jinja Team.
|
||||
:license: BSD, see LICENSE for more details.
|
||||
"""
|
||||
import re
|
||||
import math
|
||||
|
||||
from random import choice
|
||||
from operator import itemgetter
|
||||
from itertools import groupby
|
||||
from jinja2.utils import Markup, escape, pformat, urlize, soft_unicode, \
|
||||
unicode_urlencode
|
||||
from jinja2.runtime import Undefined
|
||||
from jinja2.exceptions import FilterArgumentError
|
||||
from jinja2._compat import next, imap, string_types, text_type, iteritems
|
||||
|
||||
|
||||
_word_re = re.compile(r'\w+(?u)')
|
||||
|
||||
|
||||
def contextfilter(f):
|
||||
"""Decorator for marking context dependent filters. The current
|
||||
:class:`Context` will be passed as first argument.
|
||||
"""
|
||||
f.contextfilter = True
|
||||
return f
|
||||
|
||||
|
||||
def evalcontextfilter(f):
|
||||
"""Decorator for marking eval-context dependent filters. An eval
|
||||
context object is passed as first argument. For more information
|
||||
about the eval context, see :ref:`eval-context`.
|
||||
|
||||
.. versionadded:: 2.4
|
||||
"""
|
||||
f.evalcontextfilter = True
|
||||
return f
|
||||
|
||||
|
||||
def environmentfilter(f):
|
||||
"""Decorator for marking evironment dependent filters. The current
|
||||
:class:`Environment` is passed to the filter as first argument.
|
||||
"""
|
||||
f.environmentfilter = True
|
||||
return f
|
||||
|
||||
|
||||
def make_attrgetter(environment, attribute):
|
||||
"""Returns a callable that looks up the given attribute from a
|
||||
passed object with the rules of the environment. Dots are allowed
|
||||
to access attributes of attributes. Integer parts in paths are
|
||||
looked up as integers.
|
||||
"""
|
||||
if not isinstance(attribute, string_types) \
|
||||
or ('.' not in attribute and not attribute.isdigit()):
|
||||
return lambda x: environment.getitem(x, attribute)
|
||||
attribute = attribute.split('.')
|
||||
def attrgetter(item):
|
||||
for part in attribute:
|
||||
if part.isdigit():
|
||||
part = int(part)
|
||||
item = environment.getitem(item, part)
|
||||
return item
|
||||
return attrgetter
|
||||
|
||||
|
||||
def do_forceescape(value):
|
||||
"""Enforce HTML escaping. This will probably double escape variables."""
|
||||
if hasattr(value, '__html__'):
|
||||
value = value.__html__()
|
||||
return escape(text_type(value))
|
||||
|
||||
|
||||
def do_urlencode(value):
|
||||
"""Escape strings for use in URLs (uses UTF-8 encoding). It accepts both
|
||||
dictionaries and regular strings as well as pairwise iterables.
|
||||
|
||||
.. versionadded:: 2.7
|
||||
"""
|
||||
itemiter = None
|
||||
if isinstance(value, dict):
|
||||
itemiter = iteritems(value)
|
||||
elif not isinstance(value, string_types):
|
||||
try:
|
||||
itemiter = iter(value)
|
||||
except TypeError:
|
||||
pass
|
||||
if itemiter is None:
|
||||
return unicode_urlencode(value)
|
||||
return u'&'.join(unicode_urlencode(k) + '=' +
|
||||
unicode_urlencode(v) for k, v in itemiter)
|
||||
|
||||
|
||||
@evalcontextfilter
|
||||
def do_replace(eval_ctx, s, old, new, count=None):
|
||||
"""Return a copy of the value with all occurrences of a substring
|
||||
replaced with a new one. The first argument is the substring
|
||||
that should be replaced, the second is the replacement string.
|
||||
If the optional third argument ``count`` is given, only the first
|
||||
``count`` occurrences are replaced:
|
||||
|
||||
.. sourcecode:: jinja
|
||||
|
||||
{{ "Hello World"|replace("Hello", "Goodbye") }}
|
||||
-> Goodbye World
|
||||
|
||||
{{ "aaaaargh"|replace("a", "d'oh, ", 2) }}
|
||||
-> d'oh, d'oh, aaargh
|
||||
"""
|
||||
if count is None:
|
||||
count = -1
|
||||
if not eval_ctx.autoescape:
|
||||
return text_type(s).replace(text_type(old), text_type(new), count)
|
||||
if hasattr(old, '__html__') or hasattr(new, '__html__') and \
|
||||
not hasattr(s, '__html__'):
|
||||
s = escape(s)
|
||||
else:
|
||||
s = soft_unicode(s)
|
||||
return s.replace(soft_unicode(old), soft_unicode(new), count)
|
||||
|
||||
|
||||
def do_upper(s):
|
||||
"""Convert a value to uppercase."""
|
||||
return soft_unicode(s).upper()
|
||||
|
||||
|
||||
def do_lower(s):
|
||||
"""Convert a value to lowercase."""
|
||||
return soft_unicode(s).lower()
|
||||
|
||||
|
||||
@evalcontextfilter
|
||||
def do_xmlattr(_eval_ctx, d, autospace=True):
|
||||
"""Create an SGML/XML attribute string based on the items in a dict.
|
||||
All values that are neither `none` nor `undefined` are automatically
|
||||
escaped:
|
||||
|
||||
.. sourcecode:: html+jinja
|
||||
|
||||
<ul{{ {'class': 'my_list', 'missing': none,
|
||||
'id': 'list-%d'|format(variable)}|xmlattr }}>
|
||||
...
|
||||
</ul>
|
||||
|
||||
Results in something like this:
|
||||
|
||||
.. sourcecode:: html
|
||||
|
||||
<ul class="my_list" id="list-42">
|
||||
...
|
||||
</ul>
|
||||
|
||||
As you can see it automatically prepends a space in front of the item
|
||||
if the filter returned something unless the second parameter is false.
|
||||
"""
|
||||
rv = u' '.join(
|
||||
u'%s="%s"' % (escape(key), escape(value))
|
||||
for key, value in iteritems(d)
|
||||
if value is not None and not isinstance(value, Undefined)
|
||||
)
|
||||
if autospace and rv:
|
||||
rv = u' ' + rv
|
||||
if _eval_ctx.autoescape:
|
||||
rv = Markup(rv)
|
||||
return rv
|
||||
|
||||
|
||||
def do_capitalize(s):
|
||||
"""Capitalize a value. The first character will be uppercase, all others
|
||||
lowercase.
|
||||
"""
|
||||
return soft_unicode(s).capitalize()
|
||||
|
||||
|
||||
def do_title(s):
|
||||
"""Return a titlecased version of the value. I.e. words will start with
|
||||
uppercase letters, all remaining characters are lowercase.
|
||||
"""
|
||||
rv = []
|
||||
for item in re.compile(r'([-\s]+)(?u)').split(s):
|
||||
if not item:
|
||||
continue
|
||||
rv.append(item[0].upper() + item[1:].lower())
|
||||
return ''.join(rv)
|
||||
|
||||
|
||||
def do_dictsort(value, case_sensitive=False, by='key'):
|
||||
"""Sort a dict and yield (key, value) pairs. Because python dicts are
|
||||
unsorted you may want to use this function to order them by either
|
||||
key or value:
|
||||
|
||||
.. sourcecode:: jinja
|
||||
|
||||
{% for item in mydict|dictsort %}
|
||||
sort the dict by key, case insensitive
|
||||
|
||||
{% for item in mydict|dictsort(true) %}
|
||||
sort the dict by key, case sensitive
|
||||
|
||||
{% for item in mydict|dictsort(false, 'value') %}
|
||||
sort the dict by key, case insensitive, sorted
|
||||
normally and ordered by value.
|
||||
"""
|
||||
if by == 'key':
|
||||
pos = 0
|
||||
elif by == 'value':
|
||||
pos = 1
|
||||
else:
|
||||
raise FilterArgumentError('You can only sort by either '
|
||||
'"key" or "value"')
|
||||
def sort_func(item):
|
||||
value = item[pos]
|
||||
if isinstance(value, string_types) and not case_sensitive:
|
||||
value = value.lower()
|
||||
return value
|
||||
|
||||
return sorted(value.items(), key=sort_func)
|
||||
|
||||
|
||||
@environmentfilter
|
||||
def do_sort(environment, value, reverse=False, case_sensitive=False,
|
||||
attribute=None):
|
||||
"""Sort an iterable. Per default it sorts ascending, if you pass it
|
||||
true as first argument it will reverse the sorting.
|
||||
|
||||
If the iterable is made of strings the third parameter can be used to
|
||||
control the case sensitiveness of the comparison which is disabled by
|
||||
default.
|
||||
|
||||
.. sourcecode:: jinja
|
||||
|
||||
{% for item in iterable|sort %}
|
||||
...
|
||||
{% endfor %}
|
||||
|
||||
It is also possible to sort by an attribute (for example to sort
|
||||
by the date of an object) by specifying the `attribute` parameter:
|
||||
|
||||
.. sourcecode:: jinja
|
||||
|
||||
{% for item in iterable|sort(attribute='date') %}
|
||||
...
|
||||
{% endfor %}
|
||||
|
||||
.. versionchanged:: 2.6
|
||||
The `attribute` parameter was added.
|
||||
"""
|
||||
if not case_sensitive:
|
||||
def sort_func(item):
|
||||
if isinstance(item, string_types):
|
||||
item = item.lower()
|
||||
return item
|
||||
else:
|
||||
sort_func = None
|
||||
if attribute is not None:
|
||||
getter = make_attrgetter(environment, attribute)
|
||||
def sort_func(item, processor=sort_func or (lambda x: x)):
|
||||
return processor(getter(item))
|
||||
return sorted(value, key=sort_func, reverse=reverse)
|
||||
|
||||
|
||||
def do_default(value, default_value=u'', boolean=False):
|
||||
"""If the value is undefined it will return the passed default value,
|
||||
otherwise the value of the variable:
|
||||
|
||||
.. sourcecode:: jinja
|
||||
|
||||
{{ my_variable|default('my_variable is not defined') }}
|
||||
|
||||
This will output the value of ``my_variable`` if the variable was
|
||||
defined, otherwise ``'my_variable is not defined'``. If you want
|
||||
to use default with variables that evaluate to false you have to
|
||||
set the second parameter to `true`:
|
||||
|
||||
.. sourcecode:: jinja
|
||||
|
||||
{{ ''|default('the string was empty', true) }}
|
||||
"""
|
||||
if isinstance(value, Undefined) or (boolean and not value):
|
||||
return default_value
|
||||
return value
|
||||
|
||||
|
||||
@evalcontextfilter
|
||||
def do_join(eval_ctx, value, d=u'', attribute=None):
|
||||
"""Return a string which is the concatenation of the strings in the
|
||||
sequence. The separator between elements is an empty string per
|
||||
default, you can define it with the optional parameter:
|
||||
|
||||
.. sourcecode:: jinja
|
||||
|
||||
{{ [1, 2, 3]|join('|') }}
|
||||
-> 1|2|3
|
||||
|
||||
{{ [1, 2, 3]|join }}
|
||||
-> 123
|
||||
|
||||
It is also possible to join certain attributes of an object:
|
||||
|
||||
.. sourcecode:: jinja
|
||||
|
||||
{{ users|join(', ', attribute='username') }}
|
||||
|
||||
.. versionadded:: 2.6
|
||||
The `attribute` parameter was added.
|
||||
"""
|
||||
if attribute is not None:
|
||||
value = imap(make_attrgetter(eval_ctx.environment, attribute), value)
|
||||
|
||||
# no automatic escaping? joining is a lot eaiser then
|
||||
if not eval_ctx.autoescape:
|
||||
return text_type(d).join(imap(text_type, value))
|
||||
|
||||
# if the delimiter doesn't have an html representation we check
|
||||
# if any of the items has. If yes we do a coercion to Markup
|
||||
if not hasattr(d, '__html__'):
|
||||
value = list(value)
|
||||
do_escape = False
|
||||
for idx, item in enumerate(value):
|
||||
if hasattr(item, '__html__'):
|
||||
do_escape = True
|
||||
else:
|
||||
value[idx] = text_type(item)
|
||||
if do_escape:
|
||||
d = escape(d)
|
||||
else:
|
||||
d = text_type(d)
|
||||
return d.join(value)
|
||||
|
||||
# no html involved, to normal joining
|
||||
return soft_unicode(d).join(imap(soft_unicode, value))
|
||||
|
||||
|
||||
def do_center(value, width=80):
|
||||
"""Centers the value in a field of a given width."""
|
||||
return text_type(value).center(width)
|
||||
|
||||
|
||||
@environmentfilter
|
||||
def do_first(environment, seq):
|
||||
"""Return the first item of a sequence."""
|
||||
try:
|
||||
return next(iter(seq))
|
||||
except StopIteration:
|
||||
return environment.undefined('No first item, sequence was empty.')
|
||||
|
||||
|
||||
@environmentfilter
|
||||
def do_last(environment, seq):
|
||||
"""Return the last item of a sequence."""
|
||||
try:
|
||||
return next(iter(reversed(seq)))
|
||||
except StopIteration:
|
||||
return environment.undefined('No last item, sequence was empty.')
|
||||
|
||||
|
||||
@environmentfilter
|
||||
def do_random(environment, seq):
|
||||
"""Return a random item from the sequence."""
|
||||
try:
|
||||
return choice(seq)
|
||||
except IndexError:
|
||||
return environment.undefined('No random item, sequence was empty.')
|
||||
|
||||
|
||||
def do_filesizeformat(value, binary=False):
|
||||
"""Format the value like a 'human-readable' file size (i.e. 13 kB,
|
||||
4.1 MB, 102 Bytes, etc). Per default decimal prefixes are used (Mega,
|
||||
Giga, etc.), if the second parameter is set to `True` the binary
|
||||
prefixes are used (Mebi, Gibi).
|
||||
"""
|
||||
bytes = float(value)
|
||||
base = binary and 1024 or 1000
|
||||
prefixes = [
|
||||
(binary and 'KiB' or 'kB'),
|
||||
(binary and 'MiB' or 'MB'),
|
||||
(binary and 'GiB' or 'GB'),
|
||||
(binary and 'TiB' or 'TB'),
|
||||
(binary and 'PiB' or 'PB'),
|
||||
(binary and 'EiB' or 'EB'),
|
||||
(binary and 'ZiB' or 'ZB'),
|
||||
(binary and 'YiB' or 'YB')
|
||||
]
|
||||
if bytes == 1:
|
||||
return '1 Byte'
|
||||
elif bytes < base:
|
||||
return '%d Bytes' % bytes
|
||||
else:
|
||||
for i, prefix in enumerate(prefixes):
|
||||
unit = base ** (i + 2)
|
||||
if bytes < unit:
|
||||
return '%.1f %s' % ((base * bytes / unit), prefix)
|
||||
return '%.1f %s' % ((base * bytes / unit), prefix)
|
||||
|
||||
|
||||
def do_pprint(value, verbose=False):
|
||||
"""Pretty print a variable. Useful for debugging.
|
||||
|
||||
With Jinja 1.2 onwards you can pass it a parameter. If this parameter
|
||||
is truthy the output will be more verbose (this requires `pretty`)
|
||||
"""
|
||||
return pformat(value, verbose=verbose)
|
||||
|
||||
|
||||
@evalcontextfilter
|
||||
def do_urlize(eval_ctx, value, trim_url_limit=None, nofollow=False):
|
||||
"""Converts URLs in plain text into clickable links.
|
||||
|
||||
If you pass the filter an additional integer it will shorten the urls
|
||||
to that number. Also a third argument exists that makes the urls
|
||||
"nofollow":
|
||||
|
||||
.. sourcecode:: jinja
|
||||
|
||||
{{ mytext|urlize(40, true) }}
|
||||
links are shortened to 40 chars and defined with rel="nofollow"
|
||||
"""
|
||||
rv = urlize(value, trim_url_limit, nofollow)
|
||||
if eval_ctx.autoescape:
|
||||
rv = Markup(rv)
|
||||
return rv
|
||||
|
||||
|
||||
def do_indent(s, width=4, indentfirst=False):
|
||||
"""Return a copy of the passed string, each line indented by
|
||||
4 spaces. The first line is not indented. If you want to
|
||||
change the number of spaces or indent the first line too
|
||||
you can pass additional parameters to the filter:
|
||||
|
||||
.. sourcecode:: jinja
|
||||
|
||||
{{ mytext|indent(2, true) }}
|
||||
indent by two spaces and indent the first line too.
|
||||
"""
|
||||
indention = u' ' * width
|
||||
rv = (u'\n' + indention).join(s.splitlines())
|
||||
if indentfirst:
|
||||
rv = indention + rv
|
||||
return rv
|
||||
|
||||
|
||||
def do_truncate(s, length=255, killwords=False, end='...'):
|
||||
"""Return a truncated copy of the string. The length is specified
|
||||
with the first parameter which defaults to ``255``. If the second
|
||||
parameter is ``true`` the filter will cut the text at length. Otherwise
|
||||
it will discard the last word. If the text was in fact
|
||||
truncated it will append an ellipsis sign (``"..."``). If you want a
|
||||
different ellipsis sign than ``"..."`` you can specify it using the
|
||||
third parameter.
|
||||
|
||||
.. sourcecode:: jinja
|
||||
|
||||
{{ "foo bar"|truncate(5) }}
|
||||
-> "foo ..."
|
||||
{{ "foo bar"|truncate(5, True) }}
|
||||
-> "foo b..."
|
||||
"""
|
||||
if len(s) <= length:
|
||||
return s
|
||||
elif killwords:
|
||||
return s[:length] + end
|
||||
words = s.split(' ')
|
||||
result = []
|
||||
m = 0
|
||||
for word in words:
|
||||
m += len(word) + 1
|
||||
if m > length:
|
||||
break
|
||||
result.append(word)
|
||||
result.append(end)
|
||||
return u' '.join(result)
|
||||
|
||||
@environmentfilter
|
||||
def do_wordwrap(environment, s, width=79, break_long_words=True,
|
||||
wrapstring=None):
|
||||
"""
|
||||
Return a copy of the string passed to the filter wrapped after
|
||||
``79`` characters. You can override this default using the first
|
||||
parameter. If you set the second parameter to `false` Jinja will not
|
||||
split words apart if they are longer than `width`. By default, the newlines
|
||||
will be the default newlines for the environment, but this can be changed
|
||||
using the wrapstring keyword argument.
|
||||
|
||||
.. versionadded:: 2.7
|
||||
Added support for the `wrapstring` parameter.
|
||||
"""
|
||||
if not wrapstring:
|
||||
wrapstring = environment.newline_sequence
|
||||
import textwrap
|
||||
return wrapstring.join(textwrap.wrap(s, width=width, expand_tabs=False,
|
||||
replace_whitespace=False,
|
||||
break_long_words=break_long_words))
|
||||
|
||||
|
||||
def do_wordcount(s):
|
||||
"""Count the words in that string."""
|
||||
return len(_word_re.findall(s))
|
||||
|
||||
|
||||
def do_int(value, default=0):
|
||||
"""Convert the value into an integer. If the
|
||||
conversion doesn't work it will return ``0``. You can
|
||||
override this default using the first parameter.
|
||||
"""
|
||||
try:
|
||||
return int(value)
|
||||
except (TypeError, ValueError):
|
||||
# this quirk is necessary so that "42.23"|int gives 42.
|
||||
try:
|
||||
return int(float(value))
|
||||
except (TypeError, ValueError):
|
||||
return default
|
||||
|
||||
|
||||
def do_float(value, default=0.0):
|
||||
"""Convert the value into a floating point number. If the
|
||||
conversion doesn't work it will return ``0.0``. You can
|
||||
override this default using the first parameter.
|
||||
"""
|
||||
try:
|
||||
return float(value)
|
||||
except (TypeError, ValueError):
|
||||
return default
|
||||
|
||||
|
||||
def do_format(value, *args, **kwargs):
|
||||
"""
|
||||
Apply python string formatting on an object:
|
||||
|
||||
.. sourcecode:: jinja
|
||||
|
||||
{{ "%s - %s"|format("Hello?", "Foo!") }}
|
||||
-> Hello? - Foo!
|
||||
"""
|
||||
if args and kwargs:
|
||||
raise FilterArgumentError('can\'t handle positional and keyword '
|
||||
'arguments at the same time')
|
||||
return soft_unicode(value) % (kwargs or args)
|
||||
|
||||
|
||||
def do_trim(value):
|
||||
"""Strip leading and trailing whitespace."""
|
||||
return soft_unicode(value).strip()
|
||||
|
||||
|
||||
def do_striptags(value):
|
||||
"""Strip SGML/XML tags and replace adjacent whitespace by one space.
|
||||
"""
|
||||
if hasattr(value, '__html__'):
|
||||
value = value.__html__()
|
||||
return Markup(text_type(value)).striptags()
|
||||
|
||||
|
||||
def do_slice(value, slices, fill_with=None):
|
||||
"""Slice an iterator and return a list of lists containing
|
||||
those items. Useful if you want to create a div containing
|
||||
three ul tags that represent columns:
|
||||
|
||||
.. sourcecode:: html+jinja
|
||||
|
||||
<div class="columwrapper">
|
||||
{%- for column in items|slice(3) %}
|
||||
<ul class="column-{{ loop.index }}">
|
||||
{%- for item in column %}
|
||||
<li>{{ item }}</li>
|
||||
{%- endfor %}
|
||||
</ul>
|
||||
{%- endfor %}
|
||||
</div>
|
||||
|
||||
If you pass it a second argument it's used to fill missing
|
||||
values on the last iteration.
|
||||
"""
|
||||
seq = list(value)
|
||||
length = len(seq)
|
||||
items_per_slice = length // slices
|
||||
slices_with_extra = length % slices
|
||||
offset = 0
|
||||
for slice_number in range(slices):
|
||||
start = offset + slice_number * items_per_slice
|
||||
if slice_number < slices_with_extra:
|
||||
offset += 1
|
||||
end = offset + (slice_number + 1) * items_per_slice
|
||||
tmp = seq[start:end]
|
||||
if fill_with is not None and slice_number >= slices_with_extra:
|
||||
tmp.append(fill_with)
|
||||
yield tmp
|
||||
|
||||
|
||||
def do_batch(value, linecount, fill_with=None):
|
||||
"""
|
||||
A filter that batches items. It works pretty much like `slice`
|
||||
just the other way round. It returns a list of lists with the
|
||||
given number of items. If you provide a second parameter this
|
||||
is used to fill up missing items. See this example:
|
||||
|
||||
.. sourcecode:: html+jinja
|
||||
|
||||
<table>
|
||||
{%- for row in items|batch(3, ' ') %}
|
||||
<tr>
|
||||
{%- for column in row %}
|
||||
<td>{{ column }}</td>
|
||||
{%- endfor %}
|
||||
</tr>
|
||||
{%- endfor %}
|
||||
</table>
|
||||
"""
|
||||
result = []
|
||||
tmp = []
|
||||
for item in value:
|
||||
if len(tmp) == linecount:
|
||||
yield tmp
|
||||
tmp = []
|
||||
tmp.append(item)
|
||||
if tmp:
|
||||
if fill_with is not None and len(tmp) < linecount:
|
||||
tmp += [fill_with] * (linecount - len(tmp))
|
||||
yield tmp
|
||||
|
||||
|
||||
def do_round(value, precision=0, method='common'):
|
||||
"""Round the number to a given precision. The first
|
||||
parameter specifies the precision (default is ``0``), the
|
||||
second the rounding method:
|
||||
|
||||
- ``'common'`` rounds either up or down
|
||||
- ``'ceil'`` always rounds up
|
||||
- ``'floor'`` always rounds down
|
||||
|
||||
If you don't specify a method ``'common'`` is used.
|
||||
|
||||
.. sourcecode:: jinja
|
||||
|
||||
{{ 42.55|round }}
|
||||
-> 43.0
|
||||
{{ 42.55|round(1, 'floor') }}
|
||||
-> 42.5
|
||||
|
||||
Note that even if rounded to 0 precision, a float is returned. If
|
||||
you need a real integer, pipe it through `int`:
|
||||
|
||||
.. sourcecode:: jinja
|
||||
|
||||
{{ 42.55|round|int }}
|
||||
-> 43
|
||||
"""
|
||||
if not method in ('common', 'ceil', 'floor'):
|
||||
raise FilterArgumentError('method must be common, ceil or floor')
|
||||
if method == 'common':
|
||||
return round(value, precision)
|
||||
func = getattr(math, method)
|
||||
return func(value * (10 ** precision)) / (10 ** precision)
|
||||
|
||||
|
||||
@environmentfilter
|
||||
def do_groupby(environment, value, attribute):
|
||||
"""Group a sequence of objects by a common attribute.
|
||||
|
||||
If you for example have a list of dicts or objects that represent persons
|
||||
with `gender`, `first_name` and `last_name` attributes and you want to
|
||||
group all users by genders you can do something like the following
|
||||
snippet:
|
||||
|
||||
.. sourcecode:: html+jinja
|
||||
|
||||
<ul>
|
||||
{% for group in persons|groupby('gender') %}
|
||||
<li>{{ group.grouper }}<ul>
|
||||
{% for person in group.list %}
|
||||
<li>{{ person.first_name }} {{ person.last_name }}</li>
|
||||
{% endfor %}</ul></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
Additionally it's possible to use tuple unpacking for the grouper and
|
||||
list:
|
||||
|
||||
.. sourcecode:: html+jinja
|
||||
|
||||
<ul>
|
||||
{% for grouper, list in persons|groupby('gender') %}
|
||||
...
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
As you can see the item we're grouping by is stored in the `grouper`
|
||||
attribute and the `list` contains all the objects that have this grouper
|
||||
in common.
|
||||
|
||||
.. versionchanged:: 2.6
|
||||
It's now possible to use dotted notation to group by the child
|
||||
attribute of another attribute.
|
||||
"""
|
||||
expr = make_attrgetter(environment, attribute)
|
||||
return sorted(map(_GroupTuple, groupby(sorted(value, key=expr), expr)))
|
||||
|
||||
|
||||
class _GroupTuple(tuple):
|
||||
__slots__ = ()
|
||||
grouper = property(itemgetter(0))
|
||||
list = property(itemgetter(1))
|
||||
|
||||
def __new__(cls, xxx_todo_changeme):
|
||||
(key, value) = xxx_todo_changeme
|
||||
return tuple.__new__(cls, (key, list(value)))
|
||||
|
||||
|
||||
@environmentfilter
|
||||
def do_sum(environment, iterable, attribute=None, start=0):
|
||||
"""Returns the sum of a sequence of numbers plus the value of parameter
|
||||
'start' (which defaults to 0). When the sequence is empty it returns
|
||||
start.
|
||||
|
||||
It is also possible to sum up only certain attributes:
|
||||
|
||||
.. sourcecode:: jinja
|
||||
|
||||
Total: {{ items|sum(attribute='price') }}
|
||||
|
||||
.. versionchanged:: 2.6
|
||||
The `attribute` parameter was added to allow suming up over
|
||||
attributes. Also the `start` parameter was moved on to the right.
|
||||
"""
|
||||
if attribute is not None:
|
||||
iterable = imap(make_attrgetter(environment, attribute), iterable)
|
||||
return sum(iterable, start)
|
||||
|
||||
|
||||
def do_list(value):
|
||||
"""Convert the value into a list. If it was a string the returned list
|
||||
will be a list of characters.
|
||||
"""
|
||||
return list(value)
|
||||
|
||||
|
||||
def do_mark_safe(value):
|
||||
"""Mark the value as safe which means that in an environment with automatic
|
||||
escaping enabled this variable will not be escaped.
|
||||
"""
|
||||
return Markup(value)
|
||||
|
||||
|
||||
def do_mark_unsafe(value):
|
||||
"""Mark a value as unsafe. This is the reverse operation for :func:`safe`."""
|
||||
return text_type(value)
|
||||
|
||||
|
||||
def do_reverse(value):
|
||||
"""Reverse the object or return an iterator the iterates over it the other
|
||||
way round.
|
||||
"""
|
||||
if isinstance(value, string_types):
|
||||
return value[::-1]
|
||||
try:
|
||||
return reversed(value)
|
||||
except TypeError:
|
||||
try:
|
||||
rv = list(value)
|
||||
rv.reverse()
|
||||
return rv
|
||||
except TypeError:
|
||||
raise FilterArgumentError('argument must be iterable')
|
||||
|
||||
|
||||
@environmentfilter
|
||||
def do_attr(environment, obj, name):
|
||||
"""Get an attribute of an object. ``foo|attr("bar")`` works like
|
||||
``foo["bar"]`` just that always an attribute is returned and items are not
|
||||
looked up.
|
||||
|
||||
See :ref:`Notes on subscriptions <notes-on-subscriptions>` for more details.
|
||||
"""
|
||||
try:
|
||||
name = str(name)
|
||||
except UnicodeError:
|
||||
pass
|
||||
else:
|
||||
try:
|
||||
value = getattr(obj, name)
|
||||
except AttributeError:
|
||||
pass
|
||||
else:
|
||||
if environment.sandboxed and not \
|
||||
environment.is_safe_attribute(obj, name, value):
|
||||
return environment.unsafe_undefined(obj, name)
|
||||
return value
|
||||
return environment.undefined(obj=obj, name=name)
|
||||
|
||||
|
||||
@contextfilter
|
||||
def do_map(*args, **kwargs):
|
||||
"""Applies a filter on a sequence of objects or looks up an attribute.
|
||||
This is useful when dealing with lists of objects but you are really
|
||||
only interested in a certain value of it.
|
||||
|
||||
The basic usage is mapping on an attribute. Imagine you have a list
|
||||
of users but you are only interested in a list of usernames:
|
||||
|
||||
.. sourcecode:: jinja
|
||||
|
||||
Users on this page: {{ users|map(attribute='username')|join(', ') }}
|
||||
|
||||
Alternatively you can let it invoke a filter by passing the name of the
|
||||
filter and the arguments afterwards. A good example would be applying a
|
||||
text conversion filter on a sequence:
|
||||
|
||||
.. sourcecode:: jinja
|
||||
|
||||
Users on this page: {{ titles|map('lower')|join(', ') }}
|
||||
|
||||
.. versionadded:: 2.7
|
||||
"""
|
||||
context = args[0]
|
||||
seq = args[1]
|
||||
|
||||
if len(args) == 2 and 'attribute' in kwargs:
|
||||
attribute = kwargs.pop('attribute')
|
||||
if kwargs:
|
||||
raise FilterArgumentError('Unexpected keyword argument %r' %
|
||||
next(iter(kwargs)))
|
||||
func = make_attrgetter(context.environment, attribute)
|
||||
else:
|
||||
try:
|
||||
name = args[2]
|
||||
args = args[3:]
|
||||
except LookupError:
|
||||
raise FilterArgumentError('map requires a filter argument')
|
||||
func = lambda item: context.environment.call_filter(
|
||||
name, item, args, kwargs, context=context)
|
||||
|
||||
if seq:
|
||||
for item in seq:
|
||||
yield func(item)
|
||||
|
||||
|
||||
@contextfilter
|
||||
def do_select(*args, **kwargs):
|
||||
"""Filters a sequence of objects by appying a test to either the object
|
||||
or the attribute and only selecting the ones with the test succeeding.
|
||||
|
||||
Example usage:
|
||||
|
||||
.. sourcecode:: jinja
|
||||
|
||||
{{ numbers|select("odd") }}
|
||||
|
||||
.. versionadded:: 2.7
|
||||
"""
|
||||
return _select_or_reject(args, kwargs, lambda x: x, False)
|
||||
|
||||
|
||||
@contextfilter
|
||||
def do_reject(*args, **kwargs):
|
||||
"""Filters a sequence of objects by appying a test to either the object
|
||||
or the attribute and rejecting the ones with the test succeeding.
|
||||
|
||||
Example usage:
|
||||
|
||||
.. sourcecode:: jinja
|
||||
|
||||
{{ numbers|reject("odd") }}
|
||||
|
||||
.. versionadded:: 2.7
|
||||
"""
|
||||
return _select_or_reject(args, kwargs, lambda x: not x, False)
|
||||
|
||||
|
||||
@contextfilter
|
||||
def do_selectattr(*args, **kwargs):
|
||||
"""Filters a sequence of objects by appying a test to either the object
|
||||
or the attribute and only selecting the ones with the test succeeding.
|
||||
|
||||
Example usage:
|
||||
|
||||
.. sourcecode:: jinja
|
||||
|
||||
{{ users|selectattr("is_active") }}
|
||||
{{ users|selectattr("email", "none") }}
|
||||
|
||||
.. versionadded:: 2.7
|
||||
"""
|
||||
return _select_or_reject(args, kwargs, lambda x: x, True)
|
||||
|
||||
|
||||
@contextfilter
|
||||
def do_rejectattr(*args, **kwargs):
|
||||
"""Filters a sequence of objects by appying a test to either the object
|
||||
or the attribute and rejecting the ones with the test succeeding.
|
||||
|
||||
.. sourcecode:: jinja
|
||||
|
||||
{{ users|rejectattr("is_active") }}
|
||||
{{ users|rejectattr("email", "none") }}
|
||||
|
||||
.. versionadded:: 2.7
|
||||
"""
|
||||
return _select_or_reject(args, kwargs, lambda x: not x, True)
|
||||
|
||||
|
||||
def _select_or_reject(args, kwargs, modfunc, lookup_attr):
|
||||
context = args[0]
|
||||
seq = args[1]
|
||||
if lookup_attr:
|
||||
try:
|
||||
attr = args[2]
|
||||
except LookupError:
|
||||
raise FilterArgumentError('Missing parameter for attribute name')
|
||||
transfunc = make_attrgetter(context.environment, attr)
|
||||
off = 1
|
||||
else:
|
||||
off = 0
|
||||
transfunc = lambda x: x
|
||||
|
||||
try:
|
||||
name = args[2 + off]
|
||||
args = args[3 + off:]
|
||||
func = lambda item: context.environment.call_test(
|
||||
name, item, args, kwargs)
|
||||
except LookupError:
|
||||
func = bool
|
||||
|
||||
if seq:
|
||||
for item in seq:
|
||||
if modfunc(func(transfunc(item))):
|
||||
yield item
|
||||
|
||||
|
||||
FILTERS = {
|
||||
'attr': do_attr,
|
||||
'replace': do_replace,
|
||||
'upper': do_upper,
|
||||
'lower': do_lower,
|
||||
'escape': escape,
|
||||
'e': escape,
|
||||
'forceescape': do_forceescape,
|
||||
'capitalize': do_capitalize,
|
||||
'title': do_title,
|
||||
'default': do_default,
|
||||
'd': do_default,
|
||||
'join': do_join,
|
||||
'count': len,
|
||||
'dictsort': do_dictsort,
|
||||
'sort': do_sort,
|
||||
'length': len,
|
||||
'reverse': do_reverse,
|
||||
'center': do_center,
|
||||
'indent': do_indent,
|
||||
'title': do_title,
|
||||
'capitalize': do_capitalize,
|
||||
'first': do_first,
|
||||
'last': do_last,
|
||||
'map': do_map,
|
||||
'random': do_random,
|
||||
'reject': do_reject,
|
||||
'rejectattr': do_rejectattr,
|
||||
'filesizeformat': do_filesizeformat,
|
||||
'pprint': do_pprint,
|
||||
'truncate': do_truncate,
|
||||
'wordwrap': do_wordwrap,
|
||||
'wordcount': do_wordcount,
|
||||
'int': do_int,
|
||||
'float': do_float,
|
||||
'string': soft_unicode,
|
||||
'list': do_list,
|
||||
'urlize': do_urlize,
|
||||
'format': do_format,
|
||||
'trim': do_trim,
|
||||
'striptags': do_striptags,
|
||||
'select': do_select,
|
||||
'selectattr': do_selectattr,
|
||||
'slice': do_slice,
|
||||
'batch': do_batch,
|
||||
'sum': do_sum,
|
||||
'abs': abs,
|
||||
'round': do_round,
|
||||
'groupby': do_groupby,
|
||||
'safe': do_mark_safe,
|
||||
'xmlattr': do_xmlattr,
|
||||
'urlencode': do_urlencode
|
||||
}
|
||||
Vendored
-733
@@ -1,733 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
jinja2.lexer
|
||||
~~~~~~~~~~~~
|
||||
|
||||
This module implements a Jinja / Python combination lexer. The
|
||||
`Lexer` class provided by this module is used to do some preprocessing
|
||||
for Jinja.
|
||||
|
||||
On the one hand it filters out invalid operators like the bitshift
|
||||
operators we don't allow in templates. On the other hand it separates
|
||||
template code and python code in expressions.
|
||||
|
||||
:copyright: (c) 2010 by the Jinja Team.
|
||||
:license: BSD, see LICENSE for more details.
|
||||
"""
|
||||
import re
|
||||
|
||||
from operator import itemgetter
|
||||
from collections import deque
|
||||
from jinja2.exceptions import TemplateSyntaxError
|
||||
from jinja2.utils import LRUCache
|
||||
from jinja2._compat import next, iteritems, implements_iterator, text_type, \
|
||||
intern
|
||||
|
||||
|
||||
# cache for the lexers. Exists in order to be able to have multiple
|
||||
# environments with the same lexer
|
||||
_lexer_cache = LRUCache(50)
|
||||
|
||||
# static regular expressions
|
||||
whitespace_re = re.compile(r'\s+', re.U)
|
||||
string_re = re.compile(r"('([^'\\]*(?:\\.[^'\\]*)*)'"
|
||||
r'|"([^"\\]*(?:\\.[^"\\]*)*)")', re.S)
|
||||
integer_re = re.compile(r'\d+')
|
||||
|
||||
# we use the unicode identifier rule if this python version is able
|
||||
# to handle unicode identifiers, otherwise the standard ASCII one.
|
||||
try:
|
||||
compile('föö', '<unknown>', 'eval')
|
||||
except SyntaxError:
|
||||
name_re = re.compile(r'\b[a-zA-Z_][a-zA-Z0-9_]*\b')
|
||||
else:
|
||||
from jinja2 import _stringdefs
|
||||
name_re = re.compile(r'[%s][%s]*' % (_stringdefs.xid_start,
|
||||
_stringdefs.xid_continue))
|
||||
|
||||
float_re = re.compile(r'(?<!\.)\d+\.\d+')
|
||||
newline_re = re.compile(r'(\r\n|\r|\n)')
|
||||
|
||||
# internal the tokens and keep references to them
|
||||
TOKEN_ADD = intern('add')
|
||||
TOKEN_ASSIGN = intern('assign')
|
||||
TOKEN_COLON = intern('colon')
|
||||
TOKEN_COMMA = intern('comma')
|
||||
TOKEN_DIV = intern('div')
|
||||
TOKEN_DOT = intern('dot')
|
||||
TOKEN_EQ = intern('eq')
|
||||
TOKEN_FLOORDIV = intern('floordiv')
|
||||
TOKEN_GT = intern('gt')
|
||||
TOKEN_GTEQ = intern('gteq')
|
||||
TOKEN_LBRACE = intern('lbrace')
|
||||
TOKEN_LBRACKET = intern('lbracket')
|
||||
TOKEN_LPAREN = intern('lparen')
|
||||
TOKEN_LT = intern('lt')
|
||||
TOKEN_LTEQ = intern('lteq')
|
||||
TOKEN_MOD = intern('mod')
|
||||
TOKEN_MUL = intern('mul')
|
||||
TOKEN_NE = intern('ne')
|
||||
TOKEN_PIPE = intern('pipe')
|
||||
TOKEN_POW = intern('pow')
|
||||
TOKEN_RBRACE = intern('rbrace')
|
||||
TOKEN_RBRACKET = intern('rbracket')
|
||||
TOKEN_RPAREN = intern('rparen')
|
||||
TOKEN_SEMICOLON = intern('semicolon')
|
||||
TOKEN_SUB = intern('sub')
|
||||
TOKEN_TILDE = intern('tilde')
|
||||
TOKEN_WHITESPACE = intern('whitespace')
|
||||
TOKEN_FLOAT = intern('float')
|
||||
TOKEN_INTEGER = intern('integer')
|
||||
TOKEN_NAME = intern('name')
|
||||
TOKEN_STRING = intern('string')
|
||||
TOKEN_OPERATOR = intern('operator')
|
||||
TOKEN_BLOCK_BEGIN = intern('block_begin')
|
||||
TOKEN_BLOCK_END = intern('block_end')
|
||||
TOKEN_VARIABLE_BEGIN = intern('variable_begin')
|
||||
TOKEN_VARIABLE_END = intern('variable_end')
|
||||
TOKEN_RAW_BEGIN = intern('raw_begin')
|
||||
TOKEN_RAW_END = intern('raw_end')
|
||||
TOKEN_COMMENT_BEGIN = intern('comment_begin')
|
||||
TOKEN_COMMENT_END = intern('comment_end')
|
||||
TOKEN_COMMENT = intern('comment')
|
||||
TOKEN_LINESTATEMENT_BEGIN = intern('linestatement_begin')
|
||||
TOKEN_LINESTATEMENT_END = intern('linestatement_end')
|
||||
TOKEN_LINECOMMENT_BEGIN = intern('linecomment_begin')
|
||||
TOKEN_LINECOMMENT_END = intern('linecomment_end')
|
||||
TOKEN_LINECOMMENT = intern('linecomment')
|
||||
TOKEN_DATA = intern('data')
|
||||
TOKEN_INITIAL = intern('initial')
|
||||
TOKEN_EOF = intern('eof')
|
||||
|
||||
# bind operators to token types
|
||||
operators = {
|
||||
'+': TOKEN_ADD,
|
||||
'-': TOKEN_SUB,
|
||||
'/': TOKEN_DIV,
|
||||
'//': TOKEN_FLOORDIV,
|
||||
'*': TOKEN_MUL,
|
||||
'%': TOKEN_MOD,
|
||||
'**': TOKEN_POW,
|
||||
'~': TOKEN_TILDE,
|
||||
'[': TOKEN_LBRACKET,
|
||||
']': TOKEN_RBRACKET,
|
||||
'(': TOKEN_LPAREN,
|
||||
')': TOKEN_RPAREN,
|
||||
'{': TOKEN_LBRACE,
|
||||
'}': TOKEN_RBRACE,
|
||||
'==': TOKEN_EQ,
|
||||
'!=': TOKEN_NE,
|
||||
'>': TOKEN_GT,
|
||||
'>=': TOKEN_GTEQ,
|
||||
'<': TOKEN_LT,
|
||||
'<=': TOKEN_LTEQ,
|
||||
'=': TOKEN_ASSIGN,
|
||||
'.': TOKEN_DOT,
|
||||
':': TOKEN_COLON,
|
||||
'|': TOKEN_PIPE,
|
||||
',': TOKEN_COMMA,
|
||||
';': TOKEN_SEMICOLON
|
||||
}
|
||||
|
||||
reverse_operators = dict([(v, k) for k, v in iteritems(operators)])
|
||||
assert len(operators) == len(reverse_operators), 'operators dropped'
|
||||
operator_re = re.compile('(%s)' % '|'.join(re.escape(x) for x in
|
||||
sorted(operators, key=lambda x: -len(x))))
|
||||
|
||||
ignored_tokens = frozenset([TOKEN_COMMENT_BEGIN, TOKEN_COMMENT,
|
||||
TOKEN_COMMENT_END, TOKEN_WHITESPACE,
|
||||
TOKEN_WHITESPACE, TOKEN_LINECOMMENT_BEGIN,
|
||||
TOKEN_LINECOMMENT_END, TOKEN_LINECOMMENT])
|
||||
ignore_if_empty = frozenset([TOKEN_WHITESPACE, TOKEN_DATA,
|
||||
TOKEN_COMMENT, TOKEN_LINECOMMENT])
|
||||
|
||||
|
||||
def _describe_token_type(token_type):
|
||||
if token_type in reverse_operators:
|
||||
return reverse_operators[token_type]
|
||||
return {
|
||||
TOKEN_COMMENT_BEGIN: 'begin of comment',
|
||||
TOKEN_COMMENT_END: 'end of comment',
|
||||
TOKEN_COMMENT: 'comment',
|
||||
TOKEN_LINECOMMENT: 'comment',
|
||||
TOKEN_BLOCK_BEGIN: 'begin of statement block',
|
||||
TOKEN_BLOCK_END: 'end of statement block',
|
||||
TOKEN_VARIABLE_BEGIN: 'begin of print statement',
|
||||
TOKEN_VARIABLE_END: 'end of print statement',
|
||||
TOKEN_LINESTATEMENT_BEGIN: 'begin of line statement',
|
||||
TOKEN_LINESTATEMENT_END: 'end of line statement',
|
||||
TOKEN_DATA: 'template data / text',
|
||||
TOKEN_EOF: 'end of template'
|
||||
}.get(token_type, token_type)
|
||||
|
||||
|
||||
def describe_token(token):
|
||||
"""Returns a description of the token."""
|
||||
if token.type == 'name':
|
||||
return token.value
|
||||
return _describe_token_type(token.type)
|
||||
|
||||
|
||||
def describe_token_expr(expr):
|
||||
"""Like `describe_token` but for token expressions."""
|
||||
if ':' in expr:
|
||||
type, value = expr.split(':', 1)
|
||||
if type == 'name':
|
||||
return value
|
||||
else:
|
||||
type = expr
|
||||
return _describe_token_type(type)
|
||||
|
||||
|
||||
def count_newlines(value):
|
||||
"""Count the number of newline characters in the string. This is
|
||||
useful for extensions that filter a stream.
|
||||
"""
|
||||
return len(newline_re.findall(value))
|
||||
|
||||
|
||||
def compile_rules(environment):
|
||||
"""Compiles all the rules from the environment into a list of rules."""
|
||||
e = re.escape
|
||||
rules = [
|
||||
(len(environment.comment_start_string), 'comment',
|
||||
e(environment.comment_start_string)),
|
||||
(len(environment.block_start_string), 'block',
|
||||
e(environment.block_start_string)),
|
||||
(len(environment.variable_start_string), 'variable',
|
||||
e(environment.variable_start_string))
|
||||
]
|
||||
|
||||
if environment.line_statement_prefix is not None:
|
||||
rules.append((len(environment.line_statement_prefix), 'linestatement',
|
||||
r'^[ \t\v]*' + e(environment.line_statement_prefix)))
|
||||
if environment.line_comment_prefix is not None:
|
||||
rules.append((len(environment.line_comment_prefix), 'linecomment',
|
||||
r'(?:^|(?<=\S))[^\S\r\n]*' +
|
||||
e(environment.line_comment_prefix)))
|
||||
|
||||
return [x[1:] for x in sorted(rules, reverse=True)]
|
||||
|
||||
|
||||
class Failure(object):
|
||||
"""Class that raises a `TemplateSyntaxError` if called.
|
||||
Used by the `Lexer` to specify known errors.
|
||||
"""
|
||||
|
||||
def __init__(self, message, cls=TemplateSyntaxError):
|
||||
self.message = message
|
||||
self.error_class = cls
|
||||
|
||||
def __call__(self, lineno, filename):
|
||||
raise self.error_class(self.message, lineno, filename)
|
||||
|
||||
|
||||
class Token(tuple):
|
||||
"""Token class."""
|
||||
__slots__ = ()
|
||||
lineno, type, value = (property(itemgetter(x)) for x in range(3))
|
||||
|
||||
def __new__(cls, lineno, type, value):
|
||||
return tuple.__new__(cls, (lineno, intern(str(type)), value))
|
||||
|
||||
def __str__(self):
|
||||
if self.type in reverse_operators:
|
||||
return reverse_operators[self.type]
|
||||
elif self.type == 'name':
|
||||
return self.value
|
||||
return self.type
|
||||
|
||||
def test(self, expr):
|
||||
"""Test a token against a token expression. This can either be a
|
||||
token type or ``'token_type:token_value'``. This can only test
|
||||
against string values and types.
|
||||
"""
|
||||
# here we do a regular string equality check as test_any is usually
|
||||
# passed an iterable of not interned strings.
|
||||
if self.type == expr:
|
||||
return True
|
||||
elif ':' in expr:
|
||||
return expr.split(':', 1) == [self.type, self.value]
|
||||
return False
|
||||
|
||||
def test_any(self, *iterable):
|
||||
"""Test against multiple token expressions."""
|
||||
for expr in iterable:
|
||||
if self.test(expr):
|
||||
return True
|
||||
return False
|
||||
|
||||
def __repr__(self):
|
||||
return 'Token(%r, %r, %r)' % (
|
||||
self.lineno,
|
||||
self.type,
|
||||
self.value
|
||||
)
|
||||
|
||||
|
||||
@implements_iterator
|
||||
class TokenStreamIterator(object):
|
||||
"""The iterator for tokenstreams. Iterate over the stream
|
||||
until the eof token is reached.
|
||||
"""
|
||||
|
||||
def __init__(self, stream):
|
||||
self.stream = stream
|
||||
|
||||
def __iter__(self):
|
||||
return self
|
||||
|
||||
def __next__(self):
|
||||
token = self.stream.current
|
||||
if token.type is TOKEN_EOF:
|
||||
self.stream.close()
|
||||
raise StopIteration()
|
||||
next(self.stream)
|
||||
return token
|
||||
|
||||
|
||||
@implements_iterator
|
||||
class TokenStream(object):
|
||||
"""A token stream is an iterable that yields :class:`Token`\s. The
|
||||
parser however does not iterate over it but calls :meth:`next` to go
|
||||
one token ahead. The current active token is stored as :attr:`current`.
|
||||
"""
|
||||
|
||||
def __init__(self, generator, name, filename):
|
||||
self._iter = iter(generator)
|
||||
self._pushed = deque()
|
||||
self.name = name
|
||||
self.filename = filename
|
||||
self.closed = False
|
||||
self.current = Token(1, TOKEN_INITIAL, '')
|
||||
next(self)
|
||||
|
||||
def __iter__(self):
|
||||
return TokenStreamIterator(self)
|
||||
|
||||
def __bool__(self):
|
||||
return bool(self._pushed) or self.current.type is not TOKEN_EOF
|
||||
__nonzero__ = __bool__ # py2
|
||||
|
||||
eos = property(lambda x: not x, doc="Are we at the end of the stream?")
|
||||
|
||||
def push(self, token):
|
||||
"""Push a token back to the stream."""
|
||||
self._pushed.append(token)
|
||||
|
||||
def look(self):
|
||||
"""Look at the next token."""
|
||||
old_token = next(self)
|
||||
result = self.current
|
||||
self.push(result)
|
||||
self.current = old_token
|
||||
return result
|
||||
|
||||
def skip(self, n=1):
|
||||
"""Got n tokens ahead."""
|
||||
for x in range(n):
|
||||
next(self)
|
||||
|
||||
def next_if(self, expr):
|
||||
"""Perform the token test and return the token if it matched.
|
||||
Otherwise the return value is `None`.
|
||||
"""
|
||||
if self.current.test(expr):
|
||||
return next(self)
|
||||
|
||||
def skip_if(self, expr):
|
||||
"""Like :meth:`next_if` but only returns `True` or `False`."""
|
||||
return self.next_if(expr) is not None
|
||||
|
||||
def __next__(self):
|
||||
"""Go one token ahead and return the old one"""
|
||||
rv = self.current
|
||||
if self._pushed:
|
||||
self.current = self._pushed.popleft()
|
||||
elif self.current.type is not TOKEN_EOF:
|
||||
try:
|
||||
self.current = next(self._iter)
|
||||
except StopIteration:
|
||||
self.close()
|
||||
return rv
|
||||
|
||||
def close(self):
|
||||
"""Close the stream."""
|
||||
self.current = Token(self.current.lineno, TOKEN_EOF, '')
|
||||
self._iter = None
|
||||
self.closed = True
|
||||
|
||||
def expect(self, expr):
|
||||
"""Expect a given token type and return it. This accepts the same
|
||||
argument as :meth:`jinja2.lexer.Token.test`.
|
||||
"""
|
||||
if not self.current.test(expr):
|
||||
expr = describe_token_expr(expr)
|
||||
if self.current.type is TOKEN_EOF:
|
||||
raise TemplateSyntaxError('unexpected end of template, '
|
||||
'expected %r.' % expr,
|
||||
self.current.lineno,
|
||||
self.name, self.filename)
|
||||
raise TemplateSyntaxError("expected token %r, got %r" %
|
||||
(expr, describe_token(self.current)),
|
||||
self.current.lineno,
|
||||
self.name, self.filename)
|
||||
try:
|
||||
return self.current
|
||||
finally:
|
||||
next(self)
|
||||
|
||||
|
||||
def get_lexer(environment):
|
||||
"""Return a lexer which is probably cached."""
|
||||
key = (environment.block_start_string,
|
||||
environment.block_end_string,
|
||||
environment.variable_start_string,
|
||||
environment.variable_end_string,
|
||||
environment.comment_start_string,
|
||||
environment.comment_end_string,
|
||||
environment.line_statement_prefix,
|
||||
environment.line_comment_prefix,
|
||||
environment.trim_blocks,
|
||||
environment.lstrip_blocks,
|
||||
environment.newline_sequence,
|
||||
environment.keep_trailing_newline)
|
||||
lexer = _lexer_cache.get(key)
|
||||
if lexer is None:
|
||||
lexer = Lexer(environment)
|
||||
_lexer_cache[key] = lexer
|
||||
return lexer
|
||||
|
||||
|
||||
class Lexer(object):
|
||||
"""Class that implements a lexer for a given environment. Automatically
|
||||
created by the environment class, usually you don't have to do that.
|
||||
|
||||
Note that the lexer is not automatically bound to an environment.
|
||||
Multiple environments can share the same lexer.
|
||||
"""
|
||||
|
||||
def __init__(self, environment):
|
||||
# shortcuts
|
||||
c = lambda x: re.compile(x, re.M | re.S)
|
||||
e = re.escape
|
||||
|
||||
# lexing rules for tags
|
||||
tag_rules = [
|
||||
(whitespace_re, TOKEN_WHITESPACE, None),
|
||||
(float_re, TOKEN_FLOAT, None),
|
||||
(integer_re, TOKEN_INTEGER, None),
|
||||
(name_re, TOKEN_NAME, None),
|
||||
(string_re, TOKEN_STRING, None),
|
||||
(operator_re, TOKEN_OPERATOR, None)
|
||||
]
|
||||
|
||||
# assemble the root lexing rule. because "|" is ungreedy
|
||||
# we have to sort by length so that the lexer continues working
|
||||
# as expected when we have parsing rules like <% for block and
|
||||
# <%= for variables. (if someone wants asp like syntax)
|
||||
# variables are just part of the rules if variable processing
|
||||
# is required.
|
||||
root_tag_rules = compile_rules(environment)
|
||||
|
||||
# block suffix if trimming is enabled
|
||||
block_suffix_re = environment.trim_blocks and '\\n?' or ''
|
||||
|
||||
# strip leading spaces if lstrip_blocks is enabled
|
||||
prefix_re = {}
|
||||
if environment.lstrip_blocks:
|
||||
# use '{%+' to manually disable lstrip_blocks behavior
|
||||
no_lstrip_re = e('+')
|
||||
# detect overlap between block and variable or comment strings
|
||||
block_diff = c(r'^%s(.*)' % e(environment.block_start_string))
|
||||
# make sure we don't mistake a block for a variable or a comment
|
||||
m = block_diff.match(environment.comment_start_string)
|
||||
no_lstrip_re += m and r'|%s' % e(m.group(1)) or ''
|
||||
m = block_diff.match(environment.variable_start_string)
|
||||
no_lstrip_re += m and r'|%s' % e(m.group(1)) or ''
|
||||
|
||||
# detect overlap between comment and variable strings
|
||||
comment_diff = c(r'^%s(.*)' % e(environment.comment_start_string))
|
||||
m = comment_diff.match(environment.variable_start_string)
|
||||
no_variable_re = m and r'(?!%s)' % e(m.group(1)) or ''
|
||||
|
||||
lstrip_re = r'^[ \t]*'
|
||||
block_prefix_re = r'%s%s(?!%s)|%s\+?' % (
|
||||
lstrip_re,
|
||||
e(environment.block_start_string),
|
||||
no_lstrip_re,
|
||||
e(environment.block_start_string),
|
||||
)
|
||||
comment_prefix_re = r'%s%s%s|%s\+?' % (
|
||||
lstrip_re,
|
||||
e(environment.comment_start_string),
|
||||
no_variable_re,
|
||||
e(environment.comment_start_string),
|
||||
)
|
||||
prefix_re['block'] = block_prefix_re
|
||||
prefix_re['comment'] = comment_prefix_re
|
||||
else:
|
||||
block_prefix_re = '%s' % e(environment.block_start_string)
|
||||
|
||||
self.newline_sequence = environment.newline_sequence
|
||||
self.keep_trailing_newline = environment.keep_trailing_newline
|
||||
|
||||
# global lexing rules
|
||||
self.rules = {
|
||||
'root': [
|
||||
# directives
|
||||
(c('(.*?)(?:%s)' % '|'.join(
|
||||
[r'(?P<raw_begin>(?:\s*%s\-|%s)\s*raw\s*(?:\-%s\s*|%s))' % (
|
||||
e(environment.block_start_string),
|
||||
block_prefix_re,
|
||||
e(environment.block_end_string),
|
||||
e(environment.block_end_string)
|
||||
)] + [
|
||||
r'(?P<%s_begin>\s*%s\-|%s)' % (n, r, prefix_re.get(n,r))
|
||||
for n, r in root_tag_rules
|
||||
])), (TOKEN_DATA, '#bygroup'), '#bygroup'),
|
||||
# data
|
||||
(c('.+'), TOKEN_DATA, None)
|
||||
],
|
||||
# comments
|
||||
TOKEN_COMMENT_BEGIN: [
|
||||
(c(r'(.*?)((?:\-%s\s*|%s)%s)' % (
|
||||
e(environment.comment_end_string),
|
||||
e(environment.comment_end_string),
|
||||
block_suffix_re
|
||||
)), (TOKEN_COMMENT, TOKEN_COMMENT_END), '#pop'),
|
||||
(c('(.)'), (Failure('Missing end of comment tag'),), None)
|
||||
],
|
||||
# blocks
|
||||
TOKEN_BLOCK_BEGIN: [
|
||||
(c('(?:\-%s\s*|%s)%s' % (
|
||||
e(environment.block_end_string),
|
||||
e(environment.block_end_string),
|
||||
block_suffix_re
|
||||
)), TOKEN_BLOCK_END, '#pop'),
|
||||
] + tag_rules,
|
||||
# variables
|
||||
TOKEN_VARIABLE_BEGIN: [
|
||||
(c('\-%s\s*|%s' % (
|
||||
e(environment.variable_end_string),
|
||||
e(environment.variable_end_string)
|
||||
)), TOKEN_VARIABLE_END, '#pop')
|
||||
] + tag_rules,
|
||||
# raw block
|
||||
TOKEN_RAW_BEGIN: [
|
||||
(c('(.*?)((?:\s*%s\-|%s)\s*endraw\s*(?:\-%s\s*|%s%s))' % (
|
||||
e(environment.block_start_string),
|
||||
block_prefix_re,
|
||||
e(environment.block_end_string),
|
||||
e(environment.block_end_string),
|
||||
block_suffix_re
|
||||
)), (TOKEN_DATA, TOKEN_RAW_END), '#pop'),
|
||||
(c('(.)'), (Failure('Missing end of raw directive'),), None)
|
||||
],
|
||||
# line statements
|
||||
TOKEN_LINESTATEMENT_BEGIN: [
|
||||
(c(r'\s*(\n|$)'), TOKEN_LINESTATEMENT_END, '#pop')
|
||||
] + tag_rules,
|
||||
# line comments
|
||||
TOKEN_LINECOMMENT_BEGIN: [
|
||||
(c(r'(.*?)()(?=\n|$)'), (TOKEN_LINECOMMENT,
|
||||
TOKEN_LINECOMMENT_END), '#pop')
|
||||
]
|
||||
}
|
||||
|
||||
def _normalize_newlines(self, value):
|
||||
"""Called for strings and template data to normalize it to unicode."""
|
||||
return newline_re.sub(self.newline_sequence, value)
|
||||
|
||||
def tokenize(self, source, name=None, filename=None, state=None):
|
||||
"""Calls tokeniter + tokenize and wraps it in a token stream.
|
||||
"""
|
||||
stream = self.tokeniter(source, name, filename, state)
|
||||
return TokenStream(self.wrap(stream, name, filename), name, filename)
|
||||
|
||||
def wrap(self, stream, name=None, filename=None):
|
||||
"""This is called with the stream as returned by `tokenize` and wraps
|
||||
every token in a :class:`Token` and converts the value.
|
||||
"""
|
||||
for lineno, token, value in stream:
|
||||
if token in ignored_tokens:
|
||||
continue
|
||||
elif token == 'linestatement_begin':
|
||||
token = 'block_begin'
|
||||
elif token == 'linestatement_end':
|
||||
token = 'block_end'
|
||||
# we are not interested in those tokens in the parser
|
||||
elif token in ('raw_begin', 'raw_end'):
|
||||
continue
|
||||
elif token == 'data':
|
||||
value = self._normalize_newlines(value)
|
||||
elif token == 'keyword':
|
||||
token = value
|
||||
elif token == 'name':
|
||||
value = str(value)
|
||||
elif token == 'string':
|
||||
# try to unescape string
|
||||
try:
|
||||
value = self._normalize_newlines(value[1:-1]) \
|
||||
.encode('ascii', 'backslashreplace') \
|
||||
.decode('unicode-escape')
|
||||
except Exception as e:
|
||||
msg = str(e).split(':')[-1].strip()
|
||||
raise TemplateSyntaxError(msg, lineno, name, filename)
|
||||
# if we can express it as bytestring (ascii only)
|
||||
# we do that for support of semi broken APIs
|
||||
# as datetime.datetime.strftime. On python 3 this
|
||||
# call becomes a noop thanks to 2to3
|
||||
try:
|
||||
value = str(value)
|
||||
except UnicodeError:
|
||||
pass
|
||||
elif token == 'integer':
|
||||
value = int(value)
|
||||
elif token == 'float':
|
||||
value = float(value)
|
||||
elif token == 'operator':
|
||||
token = operators[value]
|
||||
yield Token(lineno, token, value)
|
||||
|
||||
def tokeniter(self, source, name, filename=None, state=None):
|
||||
"""This method tokenizes the text and returns the tokens in a
|
||||
generator. Use this method if you just want to tokenize a template.
|
||||
"""
|
||||
source = text_type(source)
|
||||
lines = source.splitlines()
|
||||
if self.keep_trailing_newline and source:
|
||||
for newline in ('\r\n', '\r', '\n'):
|
||||
if source.endswith(newline):
|
||||
lines.append('')
|
||||
break
|
||||
source = '\n'.join(lines)
|
||||
pos = 0
|
||||
lineno = 1
|
||||
stack = ['root']
|
||||
if state is not None and state != 'root':
|
||||
assert state in ('variable', 'block'), 'invalid state'
|
||||
stack.append(state + '_begin')
|
||||
else:
|
||||
state = 'root'
|
||||
statetokens = self.rules[stack[-1]]
|
||||
source_length = len(source)
|
||||
|
||||
balancing_stack = []
|
||||
|
||||
while 1:
|
||||
# tokenizer loop
|
||||
for regex, tokens, new_state in statetokens:
|
||||
m = regex.match(source, pos)
|
||||
# if no match we try again with the next rule
|
||||
if m is None:
|
||||
continue
|
||||
|
||||
# we only match blocks and variables if braces / parentheses
|
||||
# are balanced. continue parsing with the lower rule which
|
||||
# is the operator rule. do this only if the end tags look
|
||||
# like operators
|
||||
if balancing_stack and \
|
||||
tokens in ('variable_end', 'block_end',
|
||||
'linestatement_end'):
|
||||
continue
|
||||
|
||||
# tuples support more options
|
||||
if isinstance(tokens, tuple):
|
||||
for idx, token in enumerate(tokens):
|
||||
# failure group
|
||||
if token.__class__ is Failure:
|
||||
raise token(lineno, filename)
|
||||
# bygroup is a bit more complex, in that case we
|
||||
# yield for the current token the first named
|
||||
# group that matched
|
||||
elif token == '#bygroup':
|
||||
for key, value in iteritems(m.groupdict()):
|
||||
if value is not None:
|
||||
yield lineno, key, value
|
||||
lineno += value.count('\n')
|
||||
break
|
||||
else:
|
||||
raise RuntimeError('%r wanted to resolve '
|
||||
'the token dynamically'
|
||||
' but no group matched'
|
||||
% regex)
|
||||
# normal group
|
||||
else:
|
||||
data = m.group(idx + 1)
|
||||
if data or token not in ignore_if_empty:
|
||||
yield lineno, token, data
|
||||
lineno += data.count('\n')
|
||||
|
||||
# strings as token just are yielded as it.
|
||||
else:
|
||||
data = m.group()
|
||||
# update brace/parentheses balance
|
||||
if tokens == 'operator':
|
||||
if data == '{':
|
||||
balancing_stack.append('}')
|
||||
elif data == '(':
|
||||
balancing_stack.append(')')
|
||||
elif data == '[':
|
||||
balancing_stack.append(']')
|
||||
elif data in ('}', ')', ']'):
|
||||
if not balancing_stack:
|
||||
raise TemplateSyntaxError('unexpected \'%s\'' %
|
||||
data, lineno, name,
|
||||
filename)
|
||||
expected_op = balancing_stack.pop()
|
||||
if expected_op != data:
|
||||
raise TemplateSyntaxError('unexpected \'%s\', '
|
||||
'expected \'%s\'' %
|
||||
(data, expected_op),
|
||||
lineno, name,
|
||||
filename)
|
||||
# yield items
|
||||
if data or tokens not in ignore_if_empty:
|
||||
yield lineno, tokens, data
|
||||
lineno += data.count('\n')
|
||||
|
||||
# fetch new position into new variable so that we can check
|
||||
# if there is a internal parsing error which would result
|
||||
# in an infinite loop
|
||||
pos2 = m.end()
|
||||
|
||||
# handle state changes
|
||||
if new_state is not None:
|
||||
# remove the uppermost state
|
||||
if new_state == '#pop':
|
||||
stack.pop()
|
||||
# resolve the new state by group checking
|
||||
elif new_state == '#bygroup':
|
||||
for key, value in iteritems(m.groupdict()):
|
||||
if value is not None:
|
||||
stack.append(key)
|
||||
break
|
||||
else:
|
||||
raise RuntimeError('%r wanted to resolve the '
|
||||
'new state dynamically but'
|
||||
' no group matched' %
|
||||
regex)
|
||||
# direct state name given
|
||||
else:
|
||||
stack.append(new_state)
|
||||
statetokens = self.rules[stack[-1]]
|
||||
# we are still at the same position and no stack change.
|
||||
# this means a loop without break condition, avoid that and
|
||||
# raise error
|
||||
elif pos2 == pos:
|
||||
raise RuntimeError('%r yielded empty string without '
|
||||
'stack change' % regex)
|
||||
# publish new function and start again
|
||||
pos = pos2
|
||||
break
|
||||
# if loop terminated without break we haven't found a single match
|
||||
# either we are at the end of the file or we have a problem
|
||||
else:
|
||||
# end of text
|
||||
if pos >= source_length:
|
||||
return
|
||||
# something went wrong
|
||||
raise TemplateSyntaxError('unexpected char %r at %d' %
|
||||
(source[pos], pos), lineno,
|
||||
name, filename)
|
||||
Vendored
-471
@@ -1,471 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
jinja2.loaders
|
||||
~~~~~~~~~~~~~~
|
||||
|
||||
Jinja loader classes.
|
||||
|
||||
:copyright: (c) 2010 by the Jinja Team.
|
||||
:license: BSD, see LICENSE for more details.
|
||||
"""
|
||||
import os
|
||||
import sys
|
||||
import weakref
|
||||
from types import ModuleType
|
||||
from os import path
|
||||
from hashlib import sha1
|
||||
from jinja2.exceptions import TemplateNotFound
|
||||
from jinja2.utils import open_if_exists, internalcode
|
||||
from jinja2._compat import string_types, iteritems
|
||||
|
||||
|
||||
def split_template_path(template):
|
||||
"""Split a path into segments and perform a sanity check. If it detects
|
||||
'..' in the path it will raise a `TemplateNotFound` error.
|
||||
"""
|
||||
pieces = []
|
||||
for piece in template.split('/'):
|
||||
if path.sep in piece \
|
||||
or (path.altsep and path.altsep in piece) or \
|
||||
piece == path.pardir:
|
||||
raise TemplateNotFound(template)
|
||||
elif piece and piece != '.':
|
||||
pieces.append(piece)
|
||||
return pieces
|
||||
|
||||
|
||||
class BaseLoader(object):
|
||||
"""Baseclass for all loaders. Subclass this and override `get_source` to
|
||||
implement a custom loading mechanism. The environment provides a
|
||||
`get_template` method that calls the loader's `load` method to get the
|
||||
:class:`Template` object.
|
||||
|
||||
A very basic example for a loader that looks up templates on the file
|
||||
system could look like this::
|
||||
|
||||
from jinja2 import BaseLoader, TemplateNotFound
|
||||
from os.path import join, exists, getmtime
|
||||
|
||||
class MyLoader(BaseLoader):
|
||||
|
||||
def __init__(self, path):
|
||||
self.path = path
|
||||
|
||||
def get_source(self, environment, template):
|
||||
path = join(self.path, template)
|
||||
if not exists(path):
|
||||
raise TemplateNotFound(template)
|
||||
mtime = getmtime(path)
|
||||
with file(path) as f:
|
||||
source = f.read().decode('utf-8')
|
||||
return source, path, lambda: mtime == getmtime(path)
|
||||
"""
|
||||
|
||||
#: if set to `False` it indicates that the loader cannot provide access
|
||||
#: to the source of templates.
|
||||
#:
|
||||
#: .. versionadded:: 2.4
|
||||
has_source_access = True
|
||||
|
||||
def get_source(self, environment, template):
|
||||
"""Get the template source, filename and reload helper for a template.
|
||||
It's passed the environment and template name and has to return a
|
||||
tuple in the form ``(source, filename, uptodate)`` or raise a
|
||||
`TemplateNotFound` error if it can't locate the template.
|
||||
|
||||
The source part of the returned tuple must be the source of the
|
||||
template as unicode string or a ASCII bytestring. The filename should
|
||||
be the name of the file on the filesystem if it was loaded from there,
|
||||
otherwise `None`. The filename is used by python for the tracebacks
|
||||
if no loader extension is used.
|
||||
|
||||
The last item in the tuple is the `uptodate` function. If auto
|
||||
reloading is enabled it's always called to check if the template
|
||||
changed. No arguments are passed so the function must store the
|
||||
old state somewhere (for example in a closure). If it returns `False`
|
||||
the template will be reloaded.
|
||||
"""
|
||||
if not self.has_source_access:
|
||||
raise RuntimeError('%s cannot provide access to the source' %
|
||||
self.__class__.__name__)
|
||||
raise TemplateNotFound(template)
|
||||
|
||||
def list_templates(self):
|
||||
"""Iterates over all templates. If the loader does not support that
|
||||
it should raise a :exc:`TypeError` which is the default behavior.
|
||||
"""
|
||||
raise TypeError('this loader cannot iterate over all templates')
|
||||
|
||||
@internalcode
|
||||
def load(self, environment, name, globals=None):
|
||||
"""Loads a template. This method looks up the template in the cache
|
||||
or loads one by calling :meth:`get_source`. Subclasses should not
|
||||
override this method as loaders working on collections of other
|
||||
loaders (such as :class:`PrefixLoader` or :class:`ChoiceLoader`)
|
||||
will not call this method but `get_source` directly.
|
||||
"""
|
||||
code = None
|
||||
if globals is None:
|
||||
globals = {}
|
||||
|
||||
# first we try to get the source for this template together
|
||||
# with the filename and the uptodate function.
|
||||
source, filename, uptodate = self.get_source(environment, name)
|
||||
|
||||
# try to load the code from the bytecode cache if there is a
|
||||
# bytecode cache configured.
|
||||
bcc = environment.bytecode_cache
|
||||
if bcc is not None:
|
||||
bucket = bcc.get_bucket(environment, name, filename, source)
|
||||
code = bucket.code
|
||||
|
||||
# if we don't have code so far (not cached, no longer up to
|
||||
# date) etc. we compile the template
|
||||
if code is None:
|
||||
code = environment.compile(source, name, filename)
|
||||
|
||||
# if the bytecode cache is available and the bucket doesn't
|
||||
# have a code so far, we give the bucket the new code and put
|
||||
# it back to the bytecode cache.
|
||||
if bcc is not None and bucket.code is None:
|
||||
bucket.code = code
|
||||
bcc.set_bucket(bucket)
|
||||
|
||||
return environment.template_class.from_code(environment, code,
|
||||
globals, uptodate)
|
||||
|
||||
|
||||
class FileSystemLoader(BaseLoader):
|
||||
"""Loads templates from the file system. This loader can find templates
|
||||
in folders on the file system and is the preferred way to load them.
|
||||
|
||||
The loader takes the path to the templates as string, or if multiple
|
||||
locations are wanted a list of them which is then looked up in the
|
||||
given order:
|
||||
|
||||
>>> loader = FileSystemLoader('/path/to/templates')
|
||||
>>> loader = FileSystemLoader(['/path/to/templates', '/other/path'])
|
||||
|
||||
Per default the template encoding is ``'utf-8'`` which can be changed
|
||||
by setting the `encoding` parameter to something else.
|
||||
"""
|
||||
|
||||
def __init__(self, searchpath, encoding='utf-8'):
|
||||
if isinstance(searchpath, string_types):
|
||||
searchpath = [searchpath]
|
||||
self.searchpath = list(searchpath)
|
||||
self.encoding = encoding
|
||||
|
||||
def get_source(self, environment, template):
|
||||
pieces = split_template_path(template)
|
||||
for searchpath in self.searchpath:
|
||||
filename = path.join(searchpath, *pieces)
|
||||
f = open_if_exists(filename)
|
||||
if f is None:
|
||||
continue
|
||||
try:
|
||||
contents = f.read().decode(self.encoding)
|
||||
finally:
|
||||
f.close()
|
||||
|
||||
mtime = path.getmtime(filename)
|
||||
def uptodate():
|
||||
try:
|
||||
return path.getmtime(filename) == mtime
|
||||
except OSError:
|
||||
return False
|
||||
return contents, filename, uptodate
|
||||
raise TemplateNotFound(template)
|
||||
|
||||
def list_templates(self):
|
||||
found = set()
|
||||
for searchpath in self.searchpath:
|
||||
for dirpath, dirnames, filenames in os.walk(searchpath):
|
||||
for filename in filenames:
|
||||
template = os.path.join(dirpath, filename) \
|
||||
[len(searchpath):].strip(os.path.sep) \
|
||||
.replace(os.path.sep, '/')
|
||||
if template[:2] == './':
|
||||
template = template[2:]
|
||||
if template not in found:
|
||||
found.add(template)
|
||||
return sorted(found)
|
||||
|
||||
|
||||
class PackageLoader(BaseLoader):
|
||||
"""Load templates from python eggs or packages. It is constructed with
|
||||
the name of the python package and the path to the templates in that
|
||||
package::
|
||||
|
||||
loader = PackageLoader('mypackage', 'views')
|
||||
|
||||
If the package path is not given, ``'templates'`` is assumed.
|
||||
|
||||
Per default the template encoding is ``'utf-8'`` which can be changed
|
||||
by setting the `encoding` parameter to something else. Due to the nature
|
||||
of eggs it's only possible to reload templates if the package was loaded
|
||||
from the file system and not a zip file.
|
||||
"""
|
||||
|
||||
def __init__(self, package_name, package_path='templates',
|
||||
encoding='utf-8'):
|
||||
from pkg_resources import DefaultProvider, ResourceManager, \
|
||||
get_provider
|
||||
provider = get_provider(package_name)
|
||||
self.encoding = encoding
|
||||
self.manager = ResourceManager()
|
||||
self.filesystem_bound = isinstance(provider, DefaultProvider)
|
||||
self.provider = provider
|
||||
self.package_path = package_path
|
||||
|
||||
def get_source(self, environment, template):
|
||||
pieces = split_template_path(template)
|
||||
p = '/'.join((self.package_path,) + tuple(pieces))
|
||||
if not self.provider.has_resource(p):
|
||||
raise TemplateNotFound(template)
|
||||
|
||||
filename = uptodate = None
|
||||
if self.filesystem_bound:
|
||||
filename = self.provider.get_resource_filename(self.manager, p)
|
||||
mtime = path.getmtime(filename)
|
||||
def uptodate():
|
||||
try:
|
||||
return path.getmtime(filename) == mtime
|
||||
except OSError:
|
||||
return False
|
||||
|
||||
source = self.provider.get_resource_string(self.manager, p)
|
||||
return source.decode(self.encoding), filename, uptodate
|
||||
|
||||
def list_templates(self):
|
||||
path = self.package_path
|
||||
if path[:2] == './':
|
||||
path = path[2:]
|
||||
elif path == '.':
|
||||
path = ''
|
||||
offset = len(path)
|
||||
results = []
|
||||
def _walk(path):
|
||||
for filename in self.provider.resource_listdir(path):
|
||||
fullname = path + '/' + filename
|
||||
if self.provider.resource_isdir(fullname):
|
||||
_walk(fullname)
|
||||
else:
|
||||
results.append(fullname[offset:].lstrip('/'))
|
||||
_walk(path)
|
||||
results.sort()
|
||||
return results
|
||||
|
||||
|
||||
class DictLoader(BaseLoader):
|
||||
"""Loads a template from a python dict. It's passed a dict of unicode
|
||||
strings bound to template names. This loader is useful for unittesting:
|
||||
|
||||
>>> loader = DictLoader({'index.html': 'source here'})
|
||||
|
||||
Because auto reloading is rarely useful this is disabled per default.
|
||||
"""
|
||||
|
||||
def __init__(self, mapping):
|
||||
self.mapping = mapping
|
||||
|
||||
def get_source(self, environment, template):
|
||||
if template in self.mapping:
|
||||
source = self.mapping[template]
|
||||
return source, None, lambda: source == self.mapping.get(template)
|
||||
raise TemplateNotFound(template)
|
||||
|
||||
def list_templates(self):
|
||||
return sorted(self.mapping)
|
||||
|
||||
|
||||
class FunctionLoader(BaseLoader):
|
||||
"""A loader that is passed a function which does the loading. The
|
||||
function becomes the name of the template passed and has to return either
|
||||
an unicode string with the template source, a tuple in the form ``(source,
|
||||
filename, uptodatefunc)`` or `None` if the template does not exist.
|
||||
|
||||
>>> def load_template(name):
|
||||
... if name == 'index.html':
|
||||
... return '...'
|
||||
...
|
||||
>>> loader = FunctionLoader(load_template)
|
||||
|
||||
The `uptodatefunc` is a function that is called if autoreload is enabled
|
||||
and has to return `True` if the template is still up to date. For more
|
||||
details have a look at :meth:`BaseLoader.get_source` which has the same
|
||||
return value.
|
||||
"""
|
||||
|
||||
def __init__(self, load_func):
|
||||
self.load_func = load_func
|
||||
|
||||
def get_source(self, environment, template):
|
||||
rv = self.load_func(template)
|
||||
if rv is None:
|
||||
raise TemplateNotFound(template)
|
||||
elif isinstance(rv, string_types):
|
||||
return rv, None, None
|
||||
return rv
|
||||
|
||||
|
||||
class PrefixLoader(BaseLoader):
|
||||
"""A loader that is passed a dict of loaders where each loader is bound
|
||||
to a prefix. The prefix is delimited from the template by a slash per
|
||||
default, which can be changed by setting the `delimiter` argument to
|
||||
something else::
|
||||
|
||||
loader = PrefixLoader({
|
||||
'app1': PackageLoader('mypackage.app1'),
|
||||
'app2': PackageLoader('mypackage.app2')
|
||||
})
|
||||
|
||||
By loading ``'app1/index.html'`` the file from the app1 package is loaded,
|
||||
by loading ``'app2/index.html'`` the file from the second.
|
||||
"""
|
||||
|
||||
def __init__(self, mapping, delimiter='/'):
|
||||
self.mapping = mapping
|
||||
self.delimiter = delimiter
|
||||
|
||||
def get_loader(self, template):
|
||||
try:
|
||||
prefix, name = template.split(self.delimiter, 1)
|
||||
loader = self.mapping[prefix]
|
||||
except (ValueError, KeyError):
|
||||
raise TemplateNotFound(template)
|
||||
return loader, name
|
||||
|
||||
def get_source(self, environment, template):
|
||||
loader, name = self.get_loader(template)
|
||||
try:
|
||||
return loader.get_source(environment, name)
|
||||
except TemplateNotFound:
|
||||
# re-raise the exception with the correct fileame here.
|
||||
# (the one that includes the prefix)
|
||||
raise TemplateNotFound(template)
|
||||
|
||||
@internalcode
|
||||
def load(self, environment, name, globals=None):
|
||||
loader, local_name = self.get_loader(name)
|
||||
try:
|
||||
return loader.load(environment, local_name)
|
||||
except TemplateNotFound:
|
||||
# re-raise the exception with the correct fileame here.
|
||||
# (the one that includes the prefix)
|
||||
raise TemplateNotFound(name)
|
||||
|
||||
def list_templates(self):
|
||||
result = []
|
||||
for prefix, loader in iteritems(self.mapping):
|
||||
for template in loader.list_templates():
|
||||
result.append(prefix + self.delimiter + template)
|
||||
return result
|
||||
|
||||
|
||||
class ChoiceLoader(BaseLoader):
|
||||
"""This loader works like the `PrefixLoader` just that no prefix is
|
||||
specified. If a template could not be found by one loader the next one
|
||||
is tried.
|
||||
|
||||
>>> loader = ChoiceLoader([
|
||||
... FileSystemLoader('/path/to/user/templates'),
|
||||
... FileSystemLoader('/path/to/system/templates')
|
||||
... ])
|
||||
|
||||
This is useful if you want to allow users to override builtin templates
|
||||
from a different location.
|
||||
"""
|
||||
|
||||
def __init__(self, loaders):
|
||||
self.loaders = loaders
|
||||
|
||||
def get_source(self, environment, template):
|
||||
for loader in self.loaders:
|
||||
try:
|
||||
return loader.get_source(environment, template)
|
||||
except TemplateNotFound:
|
||||
pass
|
||||
raise TemplateNotFound(template)
|
||||
|
||||
@internalcode
|
||||
def load(self, environment, name, globals=None):
|
||||
for loader in self.loaders:
|
||||
try:
|
||||
return loader.load(environment, name, globals)
|
||||
except TemplateNotFound:
|
||||
pass
|
||||
raise TemplateNotFound(name)
|
||||
|
||||
def list_templates(self):
|
||||
found = set()
|
||||
for loader in self.loaders:
|
||||
found.update(loader.list_templates())
|
||||
return sorted(found)
|
||||
|
||||
|
||||
class _TemplateModule(ModuleType):
|
||||
"""Like a normal module but with support for weak references"""
|
||||
|
||||
|
||||
class ModuleLoader(BaseLoader):
|
||||
"""This loader loads templates from precompiled templates.
|
||||
|
||||
Example usage:
|
||||
|
||||
>>> loader = ChoiceLoader([
|
||||
... ModuleLoader('/path/to/compiled/templates'),
|
||||
... FileSystemLoader('/path/to/templates')
|
||||
... ])
|
||||
|
||||
Templates can be precompiled with :meth:`Environment.compile_templates`.
|
||||
"""
|
||||
|
||||
has_source_access = False
|
||||
|
||||
def __init__(self, path):
|
||||
package_name = '_jinja2_module_templates_%x' % id(self)
|
||||
|
||||
# create a fake module that looks for the templates in the
|
||||
# path given.
|
||||
mod = _TemplateModule(package_name)
|
||||
if isinstance(path, string_types):
|
||||
path = [path]
|
||||
else:
|
||||
path = list(path)
|
||||
mod.__path__ = path
|
||||
|
||||
sys.modules[package_name] = weakref.proxy(mod,
|
||||
lambda x: sys.modules.pop(package_name, None))
|
||||
|
||||
# the only strong reference, the sys.modules entry is weak
|
||||
# so that the garbage collector can remove it once the
|
||||
# loader that created it goes out of business.
|
||||
self.module = mod
|
||||
self.package_name = package_name
|
||||
|
||||
@staticmethod
|
||||
def get_template_key(name):
|
||||
return 'tmpl_' + sha1(name.encode('utf-8')).hexdigest()
|
||||
|
||||
@staticmethod
|
||||
def get_module_filename(name):
|
||||
return ModuleLoader.get_template_key(name) + '.py'
|
||||
|
||||
@internalcode
|
||||
def load(self, environment, name, globals=None):
|
||||
key = self.get_template_key(name)
|
||||
module = '%s.%s' % (self.package_name, key)
|
||||
mod = getattr(self.module, module, None)
|
||||
if mod is None:
|
||||
try:
|
||||
mod = __import__(module, None, None, ['root'])
|
||||
except ImportError:
|
||||
raise TemplateNotFound(name)
|
||||
|
||||
# remove the entry from sys.modules, we only want the attribute
|
||||
# on the module object we have stored on the loader.
|
||||
sys.modules.pop(module, None)
|
||||
|
||||
return environment.template_class.from_module_dict(
|
||||
environment, mod.__dict__, globals)
|
||||
-234
@@ -1,234 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
markupsafe
|
||||
~~~~~~~~~~
|
||||
|
||||
Implements a Markup string.
|
||||
|
||||
:copyright: (c) 2010 by Armin Ronacher.
|
||||
:license: BSD, see LICENSE for more details.
|
||||
"""
|
||||
import re
|
||||
from ._compat import text_type, string_types, int_types, \
|
||||
unichr, PY2
|
||||
|
||||
|
||||
__all__ = ['Markup', 'soft_unicode', 'escape', 'escape_silent']
|
||||
|
||||
|
||||
_striptags_re = re.compile(r'(<!--.*?-->|<[^>]*>)')
|
||||
_entity_re = re.compile(r'&([^;]+);')
|
||||
|
||||
|
||||
class Markup(text_type):
|
||||
r"""Marks a string as being safe for inclusion in HTML/XML output without
|
||||
needing to be escaped. This implements the `__html__` interface a couple
|
||||
of frameworks and web applications use. :class:`Markup` is a direct
|
||||
subclass of `unicode` and provides all the methods of `unicode` just that
|
||||
it escapes arguments passed and always returns `Markup`.
|
||||
|
||||
The `escape` function returns markup objects so that double escaping can't
|
||||
happen.
|
||||
|
||||
The constructor of the :class:`Markup` class can be used for three
|
||||
different things: When passed an unicode object it's assumed to be safe,
|
||||
when passed an object with an HTML representation (has an `__html__`
|
||||
method) that representation is used, otherwise the object passed is
|
||||
converted into a unicode string and then assumed to be safe:
|
||||
|
||||
>>> Markup("Hello <em>World</em>!")
|
||||
Markup(u'Hello <em>World</em>!')
|
||||
>>> class Foo(object):
|
||||
... def __html__(self):
|
||||
... return '<a href="#">foo</a>'
|
||||
...
|
||||
>>> Markup(Foo())
|
||||
Markup(u'<a href="#">foo</a>')
|
||||
|
||||
If you want object passed being always treated as unsafe you can use the
|
||||
:meth:`escape` classmethod to create a :class:`Markup` object:
|
||||
|
||||
>>> Markup.escape("Hello <em>World</em>!")
|
||||
Markup(u'Hello <em>World</em>!')
|
||||
|
||||
Operations on a markup string are markup aware which means that all
|
||||
arguments are passed through the :func:`escape` function:
|
||||
|
||||
>>> em = Markup("<em>%s</em>")
|
||||
>>> em % "foo & bar"
|
||||
Markup(u'<em>foo & bar</em>')
|
||||
>>> strong = Markup("<strong>%(text)s</strong>")
|
||||
>>> strong % {'text': '<blink>hacker here</blink>'}
|
||||
Markup(u'<strong><blink>hacker here</blink></strong>')
|
||||
>>> Markup("<em>Hello</em> ") + "<foo>"
|
||||
Markup(u'<em>Hello</em> <foo>')
|
||||
"""
|
||||
__slots__ = ()
|
||||
|
||||
def __new__(cls, base=u'', encoding=None, errors='strict'):
|
||||
if hasattr(base, '__html__'):
|
||||
base = base.__html__()
|
||||
if encoding is None:
|
||||
return text_type.__new__(cls, base)
|
||||
return text_type.__new__(cls, base, encoding, errors)
|
||||
|
||||
def __html__(self):
|
||||
return self
|
||||
|
||||
def __add__(self, other):
|
||||
if isinstance(other, string_types) or hasattr(other, '__html__'):
|
||||
return self.__class__(super(Markup, self).__add__(self.escape(other)))
|
||||
return NotImplemented
|
||||
|
||||
def __radd__(self, other):
|
||||
if hasattr(other, '__html__') or isinstance(other, string_types):
|
||||
return self.escape(other).__add__(self)
|
||||
return NotImplemented
|
||||
|
||||
def __mul__(self, num):
|
||||
if isinstance(num, int_types):
|
||||
return self.__class__(text_type.__mul__(self, num))
|
||||
return NotImplemented
|
||||
__rmul__ = __mul__
|
||||
|
||||
def __mod__(self, arg):
|
||||
if isinstance(arg, tuple):
|
||||
arg = tuple(_MarkupEscapeHelper(x, self.escape) for x in arg)
|
||||
else:
|
||||
arg = _MarkupEscapeHelper(arg, self.escape)
|
||||
return self.__class__(text_type.__mod__(self, arg))
|
||||
|
||||
def __repr__(self):
|
||||
return '%s(%s)' % (
|
||||
self.__class__.__name__,
|
||||
text_type.__repr__(self)
|
||||
)
|
||||
|
||||
def join(self, seq):
|
||||
return self.__class__(text_type.join(self, map(self.escape, seq)))
|
||||
join.__doc__ = text_type.join.__doc__
|
||||
|
||||
def split(self, *args, **kwargs):
|
||||
return list(map(self.__class__, text_type.split(self, *args, **kwargs)))
|
||||
split.__doc__ = text_type.split.__doc__
|
||||
|
||||
def rsplit(self, *args, **kwargs):
|
||||
return list(map(self.__class__, text_type.rsplit(self, *args, **kwargs)))
|
||||
rsplit.__doc__ = text_type.rsplit.__doc__
|
||||
|
||||
def splitlines(self, *args, **kwargs):
|
||||
return list(map(self.__class__, text_type.splitlines(self, *args, **kwargs)))
|
||||
splitlines.__doc__ = text_type.splitlines.__doc__
|
||||
|
||||
def unescape(self):
|
||||
r"""Unescape markup again into an text_type string. This also resolves
|
||||
known HTML4 and XHTML entities:
|
||||
|
||||
>>> Markup("Main » <em>About</em>").unescape()
|
||||
u'Main \xbb <em>About</em>'
|
||||
"""
|
||||
from _constants import HTML_ENTITIES
|
||||
def handle_match(m):
|
||||
name = m.group(1)
|
||||
if name in HTML_ENTITIES:
|
||||
return unichr(HTML_ENTITIES[name])
|
||||
try:
|
||||
if name[:2] in ('#x', '#X'):
|
||||
return unichr(int(name[2:], 16))
|
||||
elif name.startswith('#'):
|
||||
return unichr(int(name[1:]))
|
||||
except ValueError:
|
||||
pass
|
||||
return u''
|
||||
return _entity_re.sub(handle_match, text_type(self))
|
||||
|
||||
def striptags(self):
|
||||
r"""Unescape markup into an text_type string and strip all tags. This
|
||||
also resolves known HTML4 and XHTML entities. Whitespace is
|
||||
normalized to one:
|
||||
|
||||
>>> Markup("Main » <em>About</em>").striptags()
|
||||
u'Main \xbb About'
|
||||
"""
|
||||
stripped = u' '.join(_striptags_re.sub('', self).split())
|
||||
return Markup(stripped).unescape()
|
||||
|
||||
@classmethod
|
||||
def escape(cls, s):
|
||||
"""Escape the string. Works like :func:`escape` with the difference
|
||||
that for subclasses of :class:`Markup` this function would return the
|
||||
correct subclass.
|
||||
"""
|
||||
rv = escape(s)
|
||||
if rv.__class__ is not cls:
|
||||
return cls(rv)
|
||||
return rv
|
||||
|
||||
def make_wrapper(name):
|
||||
orig = getattr(text_type, name)
|
||||
def func(self, *args, **kwargs):
|
||||
args = _escape_argspec(list(args), enumerate(args), self.escape)
|
||||
#_escape_argspec(kwargs, kwargs.iteritems(), None)
|
||||
return self.__class__(orig(self, *args, **kwargs))
|
||||
func.__name__ = orig.__name__
|
||||
func.__doc__ = orig.__doc__
|
||||
return func
|
||||
|
||||
for method in '__getitem__', 'capitalize', \
|
||||
'title', 'lower', 'upper', 'replace', 'ljust', \
|
||||
'rjust', 'lstrip', 'rstrip', 'center', 'strip', \
|
||||
'translate', 'expandtabs', 'swapcase', 'zfill':
|
||||
locals()[method] = make_wrapper(method)
|
||||
|
||||
# new in python 2.5
|
||||
if hasattr(text_type, 'partition'):
|
||||
def partition(self, sep):
|
||||
return tuple(map(self.__class__,
|
||||
text_type.partition(self, self.escape(sep))))
|
||||
def rpartition(self, sep):
|
||||
return tuple(map(self.__class__,
|
||||
text_type.rpartition(self, self.escape(sep))))
|
||||
|
||||
# new in python 2.6
|
||||
if hasattr(text_type, 'format'):
|
||||
format = make_wrapper('format')
|
||||
|
||||
# not in python 3
|
||||
if hasattr(text_type, '__getslice__'):
|
||||
__getslice__ = make_wrapper('__getslice__')
|
||||
|
||||
del method, make_wrapper
|
||||
|
||||
|
||||
def _escape_argspec(obj, iterable, escape):
|
||||
"""Helper for various string-wrapped functions."""
|
||||
for key, value in iterable:
|
||||
if hasattr(value, '__html__') or isinstance(value, string_types):
|
||||
obj[key] = escape(value)
|
||||
return obj
|
||||
|
||||
|
||||
class _MarkupEscapeHelper(object):
|
||||
"""Helper for Markup.__mod__"""
|
||||
|
||||
def __init__(self, obj, escape):
|
||||
self.obj = obj
|
||||
self.escape = escape
|
||||
|
||||
__getitem__ = lambda s, x: _MarkupEscapeHelper(s.obj[x], s.escape)
|
||||
__unicode__ = __str__ = lambda s: text_type(s.escape(s.obj))
|
||||
__repr__ = lambda s: str(s.escape(repr(s.obj)))
|
||||
__int__ = lambda s: int(s.obj)
|
||||
__float__ = lambda s: float(s.obj)
|
||||
|
||||
|
||||
# we have to import it down here as the speedups and native
|
||||
# modules imports the markup type which is define above.
|
||||
try:
|
||||
from _speedups import escape, escape_silent, soft_unicode
|
||||
except ImportError:
|
||||
from ._native import escape, escape_silent, soft_unicode
|
||||
|
||||
if not PY2:
|
||||
soft_str = soft_unicode
|
||||
__all__.append('soft_str')
|
||||
-24
@@ -1,24 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
markupsafe._compat
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Compatibility module for different Python versions.
|
||||
|
||||
:copyright: (c) 2013 by Armin Ronacher.
|
||||
:license: BSD, see LICENSE for more details.
|
||||
"""
|
||||
import sys
|
||||
|
||||
PY2 = sys.version_info[0] == 2
|
||||
|
||||
if not PY2:
|
||||
text_type = str
|
||||
string_types = (str,)
|
||||
unichr = chr
|
||||
int_types = (int,)
|
||||
else:
|
||||
text_type = unicode
|
||||
string_types = (str, unicode)
|
||||
unichr = unichr
|
||||
int_types = (int, long)
|
||||
-267
@@ -1,267 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
markupsafe._constants
|
||||
~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Highlevel implementation of the Markup string.
|
||||
|
||||
:copyright: (c) 2010 by Armin Ronacher.
|
||||
:license: BSD, see LICENSE for more details.
|
||||
"""
|
||||
|
||||
|
||||
HTML_ENTITIES = {
|
||||
'AElig': 198,
|
||||
'Aacute': 193,
|
||||
'Acirc': 194,
|
||||
'Agrave': 192,
|
||||
'Alpha': 913,
|
||||
'Aring': 197,
|
||||
'Atilde': 195,
|
||||
'Auml': 196,
|
||||
'Beta': 914,
|
||||
'Ccedil': 199,
|
||||
'Chi': 935,
|
||||
'Dagger': 8225,
|
||||
'Delta': 916,
|
||||
'ETH': 208,
|
||||
'Eacute': 201,
|
||||
'Ecirc': 202,
|
||||
'Egrave': 200,
|
||||
'Epsilon': 917,
|
||||
'Eta': 919,
|
||||
'Euml': 203,
|
||||
'Gamma': 915,
|
||||
'Iacute': 205,
|
||||
'Icirc': 206,
|
||||
'Igrave': 204,
|
||||
'Iota': 921,
|
||||
'Iuml': 207,
|
||||
'Kappa': 922,
|
||||
'Lambda': 923,
|
||||
'Mu': 924,
|
||||
'Ntilde': 209,
|
||||
'Nu': 925,
|
||||
'OElig': 338,
|
||||
'Oacute': 211,
|
||||
'Ocirc': 212,
|
||||
'Ograve': 210,
|
||||
'Omega': 937,
|
||||
'Omicron': 927,
|
||||
'Oslash': 216,
|
||||
'Otilde': 213,
|
||||
'Ouml': 214,
|
||||
'Phi': 934,
|
||||
'Pi': 928,
|
||||
'Prime': 8243,
|
||||
'Psi': 936,
|
||||
'Rho': 929,
|
||||
'Scaron': 352,
|
||||
'Sigma': 931,
|
||||
'THORN': 222,
|
||||
'Tau': 932,
|
||||
'Theta': 920,
|
||||
'Uacute': 218,
|
||||
'Ucirc': 219,
|
||||
'Ugrave': 217,
|
||||
'Upsilon': 933,
|
||||
'Uuml': 220,
|
||||
'Xi': 926,
|
||||
'Yacute': 221,
|
||||
'Yuml': 376,
|
||||
'Zeta': 918,
|
||||
'aacute': 225,
|
||||
'acirc': 226,
|
||||
'acute': 180,
|
||||
'aelig': 230,
|
||||
'agrave': 224,
|
||||
'alefsym': 8501,
|
||||
'alpha': 945,
|
||||
'amp': 38,
|
||||
'and': 8743,
|
||||
'ang': 8736,
|
||||
'apos': 39,
|
||||
'aring': 229,
|
||||
'asymp': 8776,
|
||||
'atilde': 227,
|
||||
'auml': 228,
|
||||
'bdquo': 8222,
|
||||
'beta': 946,
|
||||
'brvbar': 166,
|
||||
'bull': 8226,
|
||||
'cap': 8745,
|
||||
'ccedil': 231,
|
||||
'cedil': 184,
|
||||
'cent': 162,
|
||||
'chi': 967,
|
||||
'circ': 710,
|
||||
'clubs': 9827,
|
||||
'cong': 8773,
|
||||
'copy': 169,
|
||||
'crarr': 8629,
|
||||
'cup': 8746,
|
||||
'curren': 164,
|
||||
'dArr': 8659,
|
||||
'dagger': 8224,
|
||||
'darr': 8595,
|
||||
'deg': 176,
|
||||
'delta': 948,
|
||||
'diams': 9830,
|
||||
'divide': 247,
|
||||
'eacute': 233,
|
||||
'ecirc': 234,
|
||||
'egrave': 232,
|
||||
'empty': 8709,
|
||||
'emsp': 8195,
|
||||
'ensp': 8194,
|
||||
'epsilon': 949,
|
||||
'equiv': 8801,
|
||||
'eta': 951,
|
||||
'eth': 240,
|
||||
'euml': 235,
|
||||
'euro': 8364,
|
||||
'exist': 8707,
|
||||
'fnof': 402,
|
||||
'forall': 8704,
|
||||
'frac12': 189,
|
||||
'frac14': 188,
|
||||
'frac34': 190,
|
||||
'frasl': 8260,
|
||||
'gamma': 947,
|
||||
'ge': 8805,
|
||||
'gt': 62,
|
||||
'hArr': 8660,
|
||||
'harr': 8596,
|
||||
'hearts': 9829,
|
||||
'hellip': 8230,
|
||||
'iacute': 237,
|
||||
'icirc': 238,
|
||||
'iexcl': 161,
|
||||
'igrave': 236,
|
||||
'image': 8465,
|
||||
'infin': 8734,
|
||||
'int': 8747,
|
||||
'iota': 953,
|
||||
'iquest': 191,
|
||||
'isin': 8712,
|
||||
'iuml': 239,
|
||||
'kappa': 954,
|
||||
'lArr': 8656,
|
||||
'lambda': 955,
|
||||
'lang': 9001,
|
||||
'laquo': 171,
|
||||
'larr': 8592,
|
||||
'lceil': 8968,
|
||||
'ldquo': 8220,
|
||||
'le': 8804,
|
||||
'lfloor': 8970,
|
||||
'lowast': 8727,
|
||||
'loz': 9674,
|
||||
'lrm': 8206,
|
||||
'lsaquo': 8249,
|
||||
'lsquo': 8216,
|
||||
'lt': 60,
|
||||
'macr': 175,
|
||||
'mdash': 8212,
|
||||
'micro': 181,
|
||||
'middot': 183,
|
||||
'minus': 8722,
|
||||
'mu': 956,
|
||||
'nabla': 8711,
|
||||
'nbsp': 160,
|
||||
'ndash': 8211,
|
||||
'ne': 8800,
|
||||
'ni': 8715,
|
||||
'not': 172,
|
||||
'notin': 8713,
|
||||
'nsub': 8836,
|
||||
'ntilde': 241,
|
||||
'nu': 957,
|
||||
'oacute': 243,
|
||||
'ocirc': 244,
|
||||
'oelig': 339,
|
||||
'ograve': 242,
|
||||
'oline': 8254,
|
||||
'omega': 969,
|
||||
'omicron': 959,
|
||||
'oplus': 8853,
|
||||
'or': 8744,
|
||||
'ordf': 170,
|
||||
'ordm': 186,
|
||||
'oslash': 248,
|
||||
'otilde': 245,
|
||||
'otimes': 8855,
|
||||
'ouml': 246,
|
||||
'para': 182,
|
||||
'part': 8706,
|
||||
'permil': 8240,
|
||||
'perp': 8869,
|
||||
'phi': 966,
|
||||
'pi': 960,
|
||||
'piv': 982,
|
||||
'plusmn': 177,
|
||||
'pound': 163,
|
||||
'prime': 8242,
|
||||
'prod': 8719,
|
||||
'prop': 8733,
|
||||
'psi': 968,
|
||||
'quot': 34,
|
||||
'rArr': 8658,
|
||||
'radic': 8730,
|
||||
'rang': 9002,
|
||||
'raquo': 187,
|
||||
'rarr': 8594,
|
||||
'rceil': 8969,
|
||||
'rdquo': 8221,
|
||||
'real': 8476,
|
||||
'reg': 174,
|
||||
'rfloor': 8971,
|
||||
'rho': 961,
|
||||
'rlm': 8207,
|
||||
'rsaquo': 8250,
|
||||
'rsquo': 8217,
|
||||
'sbquo': 8218,
|
||||
'scaron': 353,
|
||||
'sdot': 8901,
|
||||
'sect': 167,
|
||||
'shy': 173,
|
||||
'sigma': 963,
|
||||
'sigmaf': 962,
|
||||
'sim': 8764,
|
||||
'spades': 9824,
|
||||
'sub': 8834,
|
||||
'sube': 8838,
|
||||
'sum': 8721,
|
||||
'sup': 8835,
|
||||
'sup1': 185,
|
||||
'sup2': 178,
|
||||
'sup3': 179,
|
||||
'supe': 8839,
|
||||
'szlig': 223,
|
||||
'tau': 964,
|
||||
'there4': 8756,
|
||||
'theta': 952,
|
||||
'thetasym': 977,
|
||||
'thinsp': 8201,
|
||||
'thorn': 254,
|
||||
'tilde': 732,
|
||||
'times': 215,
|
||||
'trade': 8482,
|
||||
'uArr': 8657,
|
||||
'uacute': 250,
|
||||
'uarr': 8593,
|
||||
'ucirc': 251,
|
||||
'ugrave': 249,
|
||||
'uml': 168,
|
||||
'upsih': 978,
|
||||
'upsilon': 965,
|
||||
'uuml': 252,
|
||||
'weierp': 8472,
|
||||
'xi': 958,
|
||||
'yacute': 253,
|
||||
'yen': 165,
|
||||
'yuml': 255,
|
||||
'zeta': 950,
|
||||
'zwj': 8205,
|
||||
'zwnj': 8204
|
||||
}
|
||||
-45
@@ -1,45 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
markupsafe._native
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Native Python implementation the C module is not compiled.
|
||||
|
||||
:copyright: (c) 2010 by Armin Ronacher.
|
||||
:license: BSD, see LICENSE for more details.
|
||||
"""
|
||||
from ._compat import text_type
|
||||
|
||||
|
||||
def escape(s):
|
||||
"""Convert the characters &, <, >, ' and " in string s to HTML-safe
|
||||
sequences. Use this if you need to display text that might contain
|
||||
such characters in HTML. Marks return value as markup string.
|
||||
"""
|
||||
if hasattr(s, '__html__'):
|
||||
return s.__html__()
|
||||
return Markup(text_type(s)
|
||||
.replace('&', '&')
|
||||
.replace('>', '>')
|
||||
.replace('<', '<')
|
||||
.replace("'", ''')
|
||||
.replace('"', '"')
|
||||
)
|
||||
|
||||
|
||||
def escape_silent(s):
|
||||
"""Like :func:`escape` but converts `None` into an empty
|
||||
markup string.
|
||||
"""
|
||||
if s is None:
|
||||
return Markup()
|
||||
return escape(s)
|
||||
|
||||
|
||||
def soft_unicode(s):
|
||||
"""Make a string unicode if it isn't already. That way a markup
|
||||
string is not converted back to unicode.
|
||||
"""
|
||||
if not isinstance(s, text_type):
|
||||
s = text_type(s)
|
||||
return s
|
||||
Vendored
-103
@@ -1,103 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
jinja2.meta
|
||||
~~~~~~~~~~~
|
||||
|
||||
This module implements various functions that exposes information about
|
||||
templates that might be interesting for various kinds of applications.
|
||||
|
||||
:copyright: (c) 2010 by the Jinja Team, see AUTHORS for more details.
|
||||
:license: BSD, see LICENSE for more details.
|
||||
"""
|
||||
from jinja2 import nodes
|
||||
from jinja2.compiler import CodeGenerator
|
||||
from jinja2._compat import string_types
|
||||
|
||||
|
||||
class TrackingCodeGenerator(CodeGenerator):
|
||||
"""We abuse the code generator for introspection."""
|
||||
|
||||
def __init__(self, environment):
|
||||
CodeGenerator.__init__(self, environment, '<introspection>',
|
||||
'<introspection>')
|
||||
self.undeclared_identifiers = set()
|
||||
|
||||
def write(self, x):
|
||||
"""Don't write."""
|
||||
|
||||
def pull_locals(self, frame):
|
||||
"""Remember all undeclared identifiers."""
|
||||
self.undeclared_identifiers.update(frame.identifiers.undeclared)
|
||||
|
||||
|
||||
def find_undeclared_variables(ast):
|
||||
"""Returns a set of all variables in the AST that will be looked up from
|
||||
the context at runtime. Because at compile time it's not known which
|
||||
variables will be used depending on the path the execution takes at
|
||||
runtime, all variables are returned.
|
||||
|
||||
>>> from jinja2 import Environment, meta
|
||||
>>> env = Environment()
|
||||
>>> ast = env.parse('{% set foo = 42 %}{{ bar + foo }}')
|
||||
>>> meta.find_undeclared_variables(ast)
|
||||
set(['bar'])
|
||||
|
||||
.. admonition:: Implementation
|
||||
|
||||
Internally the code generator is used for finding undeclared variables.
|
||||
This is good to know because the code generator might raise a
|
||||
:exc:`TemplateAssertionError` during compilation and as a matter of
|
||||
fact this function can currently raise that exception as well.
|
||||
"""
|
||||
codegen = TrackingCodeGenerator(ast.environment)
|
||||
codegen.visit(ast)
|
||||
return codegen.undeclared_identifiers
|
||||
|
||||
|
||||
def find_referenced_templates(ast):
|
||||
"""Finds all the referenced templates from the AST. This will return an
|
||||
iterator over all the hardcoded template extensions, inclusions and
|
||||
imports. If dynamic inheritance or inclusion is used, `None` will be
|
||||
yielded.
|
||||
|
||||
>>> from jinja2 import Environment, meta
|
||||
>>> env = Environment()
|
||||
>>> ast = env.parse('{% extends "layout.html" %}{% include helper %}')
|
||||
>>> list(meta.find_referenced_templates(ast))
|
||||
['layout.html', None]
|
||||
|
||||
This function is useful for dependency tracking. For example if you want
|
||||
to rebuild parts of the website after a layout template has changed.
|
||||
"""
|
||||
for node in ast.find_all((nodes.Extends, nodes.FromImport, nodes.Import,
|
||||
nodes.Include)):
|
||||
if not isinstance(node.template, nodes.Const):
|
||||
# a tuple with some non consts in there
|
||||
if isinstance(node.template, (nodes.Tuple, nodes.List)):
|
||||
for template_name in node.template.items:
|
||||
# something const, only yield the strings and ignore
|
||||
# non-string consts that really just make no sense
|
||||
if isinstance(template_name, nodes.Const):
|
||||
if isinstance(template_name.value, string_types):
|
||||
yield template_name.value
|
||||
# something dynamic in there
|
||||
else:
|
||||
yield None
|
||||
# something dynamic we don't know about here
|
||||
else:
|
||||
yield None
|
||||
continue
|
||||
# constant is a basestring, direct template name
|
||||
if isinstance(node.template.value, string_types):
|
||||
yield node.template.value
|
||||
# a tuple or list (latter *should* not happen) made of consts,
|
||||
# yield the consts that are strings. We could warn here for
|
||||
# non string values
|
||||
elif isinstance(node, nodes.Include) and \
|
||||
isinstance(node.template.value, (tuple, list)):
|
||||
for template_name in node.template.value:
|
||||
if isinstance(template_name, string_types):
|
||||
yield template_name
|
||||
# something else we don't care about, we could warn here
|
||||
else:
|
||||
yield None
|
||||
Vendored
-914
@@ -1,914 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
jinja2.nodes
|
||||
~~~~~~~~~~~~
|
||||
|
||||
This module implements additional nodes derived from the ast base node.
|
||||
|
||||
It also provides some node tree helper functions like `in_lineno` and
|
||||
`get_nodes` used by the parser and translator in order to normalize
|
||||
python and jinja nodes.
|
||||
|
||||
:copyright: (c) 2010 by the Jinja Team.
|
||||
:license: BSD, see LICENSE for more details.
|
||||
"""
|
||||
import operator
|
||||
|
||||
from collections import deque
|
||||
from jinja2.utils import Markup
|
||||
from jinja2._compat import next, izip, with_metaclass, text_type, \
|
||||
method_type, function_type
|
||||
|
||||
|
||||
#: the types we support for context functions
|
||||
_context_function_types = (function_type, method_type)
|
||||
|
||||
|
||||
_binop_to_func = {
|
||||
'*': operator.mul,
|
||||
'/': operator.truediv,
|
||||
'//': operator.floordiv,
|
||||
'**': operator.pow,
|
||||
'%': operator.mod,
|
||||
'+': operator.add,
|
||||
'-': operator.sub
|
||||
}
|
||||
|
||||
_uaop_to_func = {
|
||||
'not': operator.not_,
|
||||
'+': operator.pos,
|
||||
'-': operator.neg
|
||||
}
|
||||
|
||||
_cmpop_to_func = {
|
||||
'eq': operator.eq,
|
||||
'ne': operator.ne,
|
||||
'gt': operator.gt,
|
||||
'gteq': operator.ge,
|
||||
'lt': operator.lt,
|
||||
'lteq': operator.le,
|
||||
'in': lambda a, b: a in b,
|
||||
'notin': lambda a, b: a not in b
|
||||
}
|
||||
|
||||
|
||||
class Impossible(Exception):
|
||||
"""Raised if the node could not perform a requested action."""
|
||||
|
||||
|
||||
class NodeType(type):
|
||||
"""A metaclass for nodes that handles the field and attribute
|
||||
inheritance. fields and attributes from the parent class are
|
||||
automatically forwarded to the child."""
|
||||
|
||||
def __new__(cls, name, bases, d):
|
||||
for attr in 'fields', 'attributes':
|
||||
storage = []
|
||||
storage.extend(getattr(bases[0], attr, ()))
|
||||
storage.extend(d.get(attr, ()))
|
||||
assert len(bases) == 1, 'multiple inheritance not allowed'
|
||||
assert len(storage) == len(set(storage)), 'layout conflict'
|
||||
d[attr] = tuple(storage)
|
||||
d.setdefault('abstract', False)
|
||||
return type.__new__(cls, name, bases, d)
|
||||
|
||||
|
||||
class EvalContext(object):
|
||||
"""Holds evaluation time information. Custom attributes can be attached
|
||||
to it in extensions.
|
||||
"""
|
||||
|
||||
def __init__(self, environment, template_name=None):
|
||||
self.environment = environment
|
||||
if callable(environment.autoescape):
|
||||
self.autoescape = environment.autoescape(template_name)
|
||||
else:
|
||||
self.autoescape = environment.autoescape
|
||||
self.volatile = False
|
||||
|
||||
def save(self):
|
||||
return self.__dict__.copy()
|
||||
|
||||
def revert(self, old):
|
||||
self.__dict__.clear()
|
||||
self.__dict__.update(old)
|
||||
|
||||
|
||||
def get_eval_context(node, ctx):
|
||||
if ctx is None:
|
||||
if node.environment is None:
|
||||
raise RuntimeError('if no eval context is passed, the '
|
||||
'node must have an attached '
|
||||
'environment.')
|
||||
return EvalContext(node.environment)
|
||||
return ctx
|
||||
|
||||
|
||||
class Node(with_metaclass(NodeType, object)):
|
||||
"""Baseclass for all Jinja2 nodes. There are a number of nodes available
|
||||
of different types. There are four major types:
|
||||
|
||||
- :class:`Stmt`: statements
|
||||
- :class:`Expr`: expressions
|
||||
- :class:`Helper`: helper nodes
|
||||
- :class:`Template`: the outermost wrapper node
|
||||
|
||||
All nodes have fields and attributes. Fields may be other nodes, lists,
|
||||
or arbitrary values. Fields are passed to the constructor as regular
|
||||
positional arguments, attributes as keyword arguments. Each node has
|
||||
two attributes: `lineno` (the line number of the node) and `environment`.
|
||||
The `environment` attribute is set at the end of the parsing process for
|
||||
all nodes automatically.
|
||||
"""
|
||||
fields = ()
|
||||
attributes = ('lineno', 'environment')
|
||||
abstract = True
|
||||
|
||||
def __init__(self, *fields, **attributes):
|
||||
if self.abstract:
|
||||
raise TypeError('abstract nodes are not instanciable')
|
||||
if fields:
|
||||
if len(fields) != len(self.fields):
|
||||
if not self.fields:
|
||||
raise TypeError('%r takes 0 arguments' %
|
||||
self.__class__.__name__)
|
||||
raise TypeError('%r takes 0 or %d argument%s' % (
|
||||
self.__class__.__name__,
|
||||
len(self.fields),
|
||||
len(self.fields) != 1 and 's' or ''
|
||||
))
|
||||
for name, arg in izip(self.fields, fields):
|
||||
setattr(self, name, arg)
|
||||
for attr in self.attributes:
|
||||
setattr(self, attr, attributes.pop(attr, None))
|
||||
if attributes:
|
||||
raise TypeError('unknown attribute %r' %
|
||||
next(iter(attributes)))
|
||||
|
||||
def iter_fields(self, exclude=None, only=None):
|
||||
"""This method iterates over all fields that are defined and yields
|
||||
``(key, value)`` tuples. Per default all fields are returned, but
|
||||
it's possible to limit that to some fields by providing the `only`
|
||||
parameter or to exclude some using the `exclude` parameter. Both
|
||||
should be sets or tuples of field names.
|
||||
"""
|
||||
for name in self.fields:
|
||||
if (exclude is only is None) or \
|
||||
(exclude is not None and name not in exclude) or \
|
||||
(only is not None and name in only):
|
||||
try:
|
||||
yield name, getattr(self, name)
|
||||
except AttributeError:
|
||||
pass
|
||||
|
||||
def iter_child_nodes(self, exclude=None, only=None):
|
||||
"""Iterates over all direct child nodes of the node. This iterates
|
||||
over all fields and yields the values of they are nodes. If the value
|
||||
of a field is a list all the nodes in that list are returned.
|
||||
"""
|
||||
for field, item in self.iter_fields(exclude, only):
|
||||
if isinstance(item, list):
|
||||
for n in item:
|
||||
if isinstance(n, Node):
|
||||
yield n
|
||||
elif isinstance(item, Node):
|
||||
yield item
|
||||
|
||||
def find(self, node_type):
|
||||
"""Find the first node of a given type. If no such node exists the
|
||||
return value is `None`.
|
||||
"""
|
||||
for result in self.find_all(node_type):
|
||||
return result
|
||||
|
||||
def find_all(self, node_type):
|
||||
"""Find all the nodes of a given type. If the type is a tuple,
|
||||
the check is performed for any of the tuple items.
|
||||
"""
|
||||
for child in self.iter_child_nodes():
|
||||
if isinstance(child, node_type):
|
||||
yield child
|
||||
for result in child.find_all(node_type):
|
||||
yield result
|
||||
|
||||
def set_ctx(self, ctx):
|
||||
"""Reset the context of a node and all child nodes. Per default the
|
||||
parser will all generate nodes that have a 'load' context as it's the
|
||||
most common one. This method is used in the parser to set assignment
|
||||
targets and other nodes to a store context.
|
||||
"""
|
||||
todo = deque([self])
|
||||
while todo:
|
||||
node = todo.popleft()
|
||||
if 'ctx' in node.fields:
|
||||
node.ctx = ctx
|
||||
todo.extend(node.iter_child_nodes())
|
||||
return self
|
||||
|
||||
def set_lineno(self, lineno, override=False):
|
||||
"""Set the line numbers of the node and children."""
|
||||
todo = deque([self])
|
||||
while todo:
|
||||
node = todo.popleft()
|
||||
if 'lineno' in node.attributes:
|
||||
if node.lineno is None or override:
|
||||
node.lineno = lineno
|
||||
todo.extend(node.iter_child_nodes())
|
||||
return self
|
||||
|
||||
def set_environment(self, environment):
|
||||
"""Set the environment for all nodes."""
|
||||
todo = deque([self])
|
||||
while todo:
|
||||
node = todo.popleft()
|
||||
node.environment = environment
|
||||
todo.extend(node.iter_child_nodes())
|
||||
return self
|
||||
|
||||
def __eq__(self, other):
|
||||
return type(self) is type(other) and \
|
||||
tuple(self.iter_fields()) == tuple(other.iter_fields())
|
||||
|
||||
def __ne__(self, other):
|
||||
return not self.__eq__(other)
|
||||
|
||||
# Restore Python 2 hashing behavior on Python 3
|
||||
__hash__ = object.__hash__
|
||||
|
||||
def __repr__(self):
|
||||
return '%s(%s)' % (
|
||||
self.__class__.__name__,
|
||||
', '.join('%s=%r' % (arg, getattr(self, arg, None)) for
|
||||
arg in self.fields)
|
||||
)
|
||||
|
||||
|
||||
class Stmt(Node):
|
||||
"""Base node for all statements."""
|
||||
abstract = True
|
||||
|
||||
|
||||
class Helper(Node):
|
||||
"""Nodes that exist in a specific context only."""
|
||||
abstract = True
|
||||
|
||||
|
||||
class Template(Node):
|
||||
"""Node that represents a template. This must be the outermost node that
|
||||
is passed to the compiler.
|
||||
"""
|
||||
fields = ('body',)
|
||||
|
||||
|
||||
class Output(Stmt):
|
||||
"""A node that holds multiple expressions which are then printed out.
|
||||
This is used both for the `print` statement and the regular template data.
|
||||
"""
|
||||
fields = ('nodes',)
|
||||
|
||||
|
||||
class Extends(Stmt):
|
||||
"""Represents an extends statement."""
|
||||
fields = ('template',)
|
||||
|
||||
|
||||
class For(Stmt):
|
||||
"""The for loop. `target` is the target for the iteration (usually a
|
||||
:class:`Name` or :class:`Tuple`), `iter` the iterable. `body` is a list
|
||||
of nodes that are used as loop-body, and `else_` a list of nodes for the
|
||||
`else` block. If no else node exists it has to be an empty list.
|
||||
|
||||
For filtered nodes an expression can be stored as `test`, otherwise `None`.
|
||||
"""
|
||||
fields = ('target', 'iter', 'body', 'else_', 'test', 'recursive')
|
||||
|
||||
|
||||
class If(Stmt):
|
||||
"""If `test` is true, `body` is rendered, else `else_`."""
|
||||
fields = ('test', 'body', 'else_')
|
||||
|
||||
|
||||
class Macro(Stmt):
|
||||
"""A macro definition. `name` is the name of the macro, `args` a list of
|
||||
arguments and `defaults` a list of defaults if there are any. `body` is
|
||||
a list of nodes for the macro body.
|
||||
"""
|
||||
fields = ('name', 'args', 'defaults', 'body')
|
||||
|
||||
|
||||
class CallBlock(Stmt):
|
||||
"""Like a macro without a name but a call instead. `call` is called with
|
||||
the unnamed macro as `caller` argument this node holds.
|
||||
"""
|
||||
fields = ('call', 'args', 'defaults', 'body')
|
||||
|
||||
|
||||
class FilterBlock(Stmt):
|
||||
"""Node for filter sections."""
|
||||
fields = ('body', 'filter')
|
||||
|
||||
|
||||
class Block(Stmt):
|
||||
"""A node that represents a block."""
|
||||
fields = ('name', 'body', 'scoped')
|
||||
|
||||
|
||||
class Include(Stmt):
|
||||
"""A node that represents the include tag."""
|
||||
fields = ('template', 'with_context', 'ignore_missing')
|
||||
|
||||
|
||||
class Import(Stmt):
|
||||
"""A node that represents the import tag."""
|
||||
fields = ('template', 'target', 'with_context')
|
||||
|
||||
|
||||
class FromImport(Stmt):
|
||||
"""A node that represents the from import tag. It's important to not
|
||||
pass unsafe names to the name attribute. The compiler translates the
|
||||
attribute lookups directly into getattr calls and does *not* use the
|
||||
subscript callback of the interface. As exported variables may not
|
||||
start with double underscores (which the parser asserts) this is not a
|
||||
problem for regular Jinja code, but if this node is used in an extension
|
||||
extra care must be taken.
|
||||
|
||||
The list of names may contain tuples if aliases are wanted.
|
||||
"""
|
||||
fields = ('template', 'names', 'with_context')
|
||||
|
||||
|
||||
class ExprStmt(Stmt):
|
||||
"""A statement that evaluates an expression and discards the result."""
|
||||
fields = ('node',)
|
||||
|
||||
|
||||
class Assign(Stmt):
|
||||
"""Assigns an expression to a target."""
|
||||
fields = ('target', 'node')
|
||||
|
||||
|
||||
class Expr(Node):
|
||||
"""Baseclass for all expressions."""
|
||||
abstract = True
|
||||
|
||||
def as_const(self, eval_ctx=None):
|
||||
"""Return the value of the expression as constant or raise
|
||||
:exc:`Impossible` if this was not possible.
|
||||
|
||||
An :class:`EvalContext` can be provided, if none is given
|
||||
a default context is created which requires the nodes to have
|
||||
an attached environment.
|
||||
|
||||
.. versionchanged:: 2.4
|
||||
the `eval_ctx` parameter was added.
|
||||
"""
|
||||
raise Impossible()
|
||||
|
||||
def can_assign(self):
|
||||
"""Check if it's possible to assign something to this node."""
|
||||
return False
|
||||
|
||||
|
||||
class BinExpr(Expr):
|
||||
"""Baseclass for all binary expressions."""
|
||||
fields = ('left', 'right')
|
||||
operator = None
|
||||
abstract = True
|
||||
|
||||
def as_const(self, eval_ctx=None):
|
||||
eval_ctx = get_eval_context(self, eval_ctx)
|
||||
# intercepted operators cannot be folded at compile time
|
||||
if self.environment.sandboxed and \
|
||||
self.operator in self.environment.intercepted_binops:
|
||||
raise Impossible()
|
||||
f = _binop_to_func[self.operator]
|
||||
try:
|
||||
return f(self.left.as_const(eval_ctx), self.right.as_const(eval_ctx))
|
||||
except Exception:
|
||||
raise Impossible()
|
||||
|
||||
|
||||
class UnaryExpr(Expr):
|
||||
"""Baseclass for all unary expressions."""
|
||||
fields = ('node',)
|
||||
operator = None
|
||||
abstract = True
|
||||
|
||||
def as_const(self, eval_ctx=None):
|
||||
eval_ctx = get_eval_context(self, eval_ctx)
|
||||
# intercepted operators cannot be folded at compile time
|
||||
if self.environment.sandboxed and \
|
||||
self.operator in self.environment.intercepted_unops:
|
||||
raise Impossible()
|
||||
f = _uaop_to_func[self.operator]
|
||||
try:
|
||||
return f(self.node.as_const(eval_ctx))
|
||||
except Exception:
|
||||
raise Impossible()
|
||||
|
||||
|
||||
class Name(Expr):
|
||||
"""Looks up a name or stores a value in a name.
|
||||
The `ctx` of the node can be one of the following values:
|
||||
|
||||
- `store`: store a value in the name
|
||||
- `load`: load that name
|
||||
- `param`: like `store` but if the name was defined as function parameter.
|
||||
"""
|
||||
fields = ('name', 'ctx')
|
||||
|
||||
def can_assign(self):
|
||||
return self.name not in ('true', 'false', 'none',
|
||||
'True', 'False', 'None')
|
||||
|
||||
|
||||
class Literal(Expr):
|
||||
"""Baseclass for literals."""
|
||||
abstract = True
|
||||
|
||||
|
||||
class Const(Literal):
|
||||
"""All constant values. The parser will return this node for simple
|
||||
constants such as ``42`` or ``"foo"`` but it can be used to store more
|
||||
complex values such as lists too. Only constants with a safe
|
||||
representation (objects where ``eval(repr(x)) == x`` is true).
|
||||
"""
|
||||
fields = ('value',)
|
||||
|
||||
def as_const(self, eval_ctx=None):
|
||||
return self.value
|
||||
|
||||
@classmethod
|
||||
def from_untrusted(cls, value, lineno=None, environment=None):
|
||||
"""Return a const object if the value is representable as
|
||||
constant value in the generated code, otherwise it will raise
|
||||
an `Impossible` exception.
|
||||
"""
|
||||
from .compiler import has_safe_repr
|
||||
if not has_safe_repr(value):
|
||||
raise Impossible()
|
||||
return cls(value, lineno=lineno, environment=environment)
|
||||
|
||||
|
||||
class TemplateData(Literal):
|
||||
"""A constant template string."""
|
||||
fields = ('data',)
|
||||
|
||||
def as_const(self, eval_ctx=None):
|
||||
eval_ctx = get_eval_context(self, eval_ctx)
|
||||
if eval_ctx.volatile:
|
||||
raise Impossible()
|
||||
if eval_ctx.autoescape:
|
||||
return Markup(self.data)
|
||||
return self.data
|
||||
|
||||
|
||||
class Tuple(Literal):
|
||||
"""For loop unpacking and some other things like multiple arguments
|
||||
for subscripts. Like for :class:`Name` `ctx` specifies if the tuple
|
||||
is used for loading the names or storing.
|
||||
"""
|
||||
fields = ('items', 'ctx')
|
||||
|
||||
def as_const(self, eval_ctx=None):
|
||||
eval_ctx = get_eval_context(self, eval_ctx)
|
||||
return tuple(x.as_const(eval_ctx) for x in self.items)
|
||||
|
||||
def can_assign(self):
|
||||
for item in self.items:
|
||||
if not item.can_assign():
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
class List(Literal):
|
||||
"""Any list literal such as ``[1, 2, 3]``"""
|
||||
fields = ('items',)
|
||||
|
||||
def as_const(self, eval_ctx=None):
|
||||
eval_ctx = get_eval_context(self, eval_ctx)
|
||||
return [x.as_const(eval_ctx) for x in self.items]
|
||||
|
||||
|
||||
class Dict(Literal):
|
||||
"""Any dict literal such as ``{1: 2, 3: 4}``. The items must be a list of
|
||||
:class:`Pair` nodes.
|
||||
"""
|
||||
fields = ('items',)
|
||||
|
||||
def as_const(self, eval_ctx=None):
|
||||
eval_ctx = get_eval_context(self, eval_ctx)
|
||||
return dict(x.as_const(eval_ctx) for x in self.items)
|
||||
|
||||
|
||||
class Pair(Helper):
|
||||
"""A key, value pair for dicts."""
|
||||
fields = ('key', 'value')
|
||||
|
||||
def as_const(self, eval_ctx=None):
|
||||
eval_ctx = get_eval_context(self, eval_ctx)
|
||||
return self.key.as_const(eval_ctx), self.value.as_const(eval_ctx)
|
||||
|
||||
|
||||
class Keyword(Helper):
|
||||
"""A key, value pair for keyword arguments where key is a string."""
|
||||
fields = ('key', 'value')
|
||||
|
||||
def as_const(self, eval_ctx=None):
|
||||
eval_ctx = get_eval_context(self, eval_ctx)
|
||||
return self.key, self.value.as_const(eval_ctx)
|
||||
|
||||
|
||||
class CondExpr(Expr):
|
||||
"""A conditional expression (inline if expression). (``{{
|
||||
foo if bar else baz }}``)
|
||||
"""
|
||||
fields = ('test', 'expr1', 'expr2')
|
||||
|
||||
def as_const(self, eval_ctx=None):
|
||||
eval_ctx = get_eval_context(self, eval_ctx)
|
||||
if self.test.as_const(eval_ctx):
|
||||
return self.expr1.as_const(eval_ctx)
|
||||
|
||||
# if we evaluate to an undefined object, we better do that at runtime
|
||||
if self.expr2 is None:
|
||||
raise Impossible()
|
||||
|
||||
return self.expr2.as_const(eval_ctx)
|
||||
|
||||
|
||||
class Filter(Expr):
|
||||
"""This node applies a filter on an expression. `name` is the name of
|
||||
the filter, the rest of the fields are the same as for :class:`Call`.
|
||||
|
||||
If the `node` of a filter is `None` the contents of the last buffer are
|
||||
filtered. Buffers are created by macros and filter blocks.
|
||||
"""
|
||||
fields = ('node', 'name', 'args', 'kwargs', 'dyn_args', 'dyn_kwargs')
|
||||
|
||||
def as_const(self, eval_ctx=None):
|
||||
eval_ctx = get_eval_context(self, eval_ctx)
|
||||
if eval_ctx.volatile or self.node is None:
|
||||
raise Impossible()
|
||||
# we have to be careful here because we call filter_ below.
|
||||
# if this variable would be called filter, 2to3 would wrap the
|
||||
# call in a list beause it is assuming we are talking about the
|
||||
# builtin filter function here which no longer returns a list in
|
||||
# python 3. because of that, do not rename filter_ to filter!
|
||||
filter_ = self.environment.filters.get(self.name)
|
||||
if filter_ is None or getattr(filter_, 'contextfilter', False):
|
||||
raise Impossible()
|
||||
obj = self.node.as_const(eval_ctx)
|
||||
args = [x.as_const(eval_ctx) for x in self.args]
|
||||
if getattr(filter_, 'evalcontextfilter', False):
|
||||
args.insert(0, eval_ctx)
|
||||
elif getattr(filter_, 'environmentfilter', False):
|
||||
args.insert(0, self.environment)
|
||||
kwargs = dict(x.as_const(eval_ctx) for x in self.kwargs)
|
||||
if self.dyn_args is not None:
|
||||
try:
|
||||
args.extend(self.dyn_args.as_const(eval_ctx))
|
||||
except Exception:
|
||||
raise Impossible()
|
||||
if self.dyn_kwargs is not None:
|
||||
try:
|
||||
kwargs.update(self.dyn_kwargs.as_const(eval_ctx))
|
||||
except Exception:
|
||||
raise Impossible()
|
||||
try:
|
||||
return filter_(obj, *args, **kwargs)
|
||||
except Exception:
|
||||
raise Impossible()
|
||||
|
||||
|
||||
class Test(Expr):
|
||||
"""Applies a test on an expression. `name` is the name of the test, the
|
||||
rest of the fields are the same as for :class:`Call`.
|
||||
"""
|
||||
fields = ('node', 'name', 'args', 'kwargs', 'dyn_args', 'dyn_kwargs')
|
||||
|
||||
|
||||
class Call(Expr):
|
||||
"""Calls an expression. `args` is a list of arguments, `kwargs` a list
|
||||
of keyword arguments (list of :class:`Keyword` nodes), and `dyn_args`
|
||||
and `dyn_kwargs` has to be either `None` or a node that is used as
|
||||
node for dynamic positional (``*args``) or keyword (``**kwargs``)
|
||||
arguments.
|
||||
"""
|
||||
fields = ('node', 'args', 'kwargs', 'dyn_args', 'dyn_kwargs')
|
||||
|
||||
def as_const(self, eval_ctx=None):
|
||||
eval_ctx = get_eval_context(self, eval_ctx)
|
||||
if eval_ctx.volatile:
|
||||
raise Impossible()
|
||||
obj = self.node.as_const(eval_ctx)
|
||||
|
||||
# don't evaluate context functions
|
||||
args = [x.as_const(eval_ctx) for x in self.args]
|
||||
if isinstance(obj, _context_function_types):
|
||||
if getattr(obj, 'contextfunction', False):
|
||||
raise Impossible()
|
||||
elif getattr(obj, 'evalcontextfunction', False):
|
||||
args.insert(0, eval_ctx)
|
||||
elif getattr(obj, 'environmentfunction', False):
|
||||
args.insert(0, self.environment)
|
||||
|
||||
kwargs = dict(x.as_const(eval_ctx) for x in self.kwargs)
|
||||
if self.dyn_args is not None:
|
||||
try:
|
||||
args.extend(self.dyn_args.as_const(eval_ctx))
|
||||
except Exception:
|
||||
raise Impossible()
|
||||
if self.dyn_kwargs is not None:
|
||||
try:
|
||||
kwargs.update(self.dyn_kwargs.as_const(eval_ctx))
|
||||
except Exception:
|
||||
raise Impossible()
|
||||
try:
|
||||
return obj(*args, **kwargs)
|
||||
except Exception:
|
||||
raise Impossible()
|
||||
|
||||
|
||||
class Getitem(Expr):
|
||||
"""Get an attribute or item from an expression and prefer the item."""
|
||||
fields = ('node', 'arg', 'ctx')
|
||||
|
||||
def as_const(self, eval_ctx=None):
|
||||
eval_ctx = get_eval_context(self, eval_ctx)
|
||||
if self.ctx != 'load':
|
||||
raise Impossible()
|
||||
try:
|
||||
return self.environment.getitem(self.node.as_const(eval_ctx),
|
||||
self.arg.as_const(eval_ctx))
|
||||
except Exception:
|
||||
raise Impossible()
|
||||
|
||||
def can_assign(self):
|
||||
return False
|
||||
|
||||
|
||||
class Getattr(Expr):
|
||||
"""Get an attribute or item from an expression that is a ascii-only
|
||||
bytestring and prefer the attribute.
|
||||
"""
|
||||
fields = ('node', 'attr', 'ctx')
|
||||
|
||||
def as_const(self, eval_ctx=None):
|
||||
if self.ctx != 'load':
|
||||
raise Impossible()
|
||||
try:
|
||||
eval_ctx = get_eval_context(self, eval_ctx)
|
||||
return self.environment.getattr(self.node.as_const(eval_ctx),
|
||||
self.attr)
|
||||
except Exception:
|
||||
raise Impossible()
|
||||
|
||||
def can_assign(self):
|
||||
return False
|
||||
|
||||
|
||||
class Slice(Expr):
|
||||
"""Represents a slice object. This must only be used as argument for
|
||||
:class:`Subscript`.
|
||||
"""
|
||||
fields = ('start', 'stop', 'step')
|
||||
|
||||
def as_const(self, eval_ctx=None):
|
||||
eval_ctx = get_eval_context(self, eval_ctx)
|
||||
def const(obj):
|
||||
if obj is None:
|
||||
return None
|
||||
return obj.as_const(eval_ctx)
|
||||
return slice(const(self.start), const(self.stop), const(self.step))
|
||||
|
||||
|
||||
class Concat(Expr):
|
||||
"""Concatenates the list of expressions provided after converting them to
|
||||
unicode.
|
||||
"""
|
||||
fields = ('nodes',)
|
||||
|
||||
def as_const(self, eval_ctx=None):
|
||||
eval_ctx = get_eval_context(self, eval_ctx)
|
||||
return ''.join(text_type(x.as_const(eval_ctx)) for x in self.nodes)
|
||||
|
||||
|
||||
class Compare(Expr):
|
||||
"""Compares an expression with some other expressions. `ops` must be a
|
||||
list of :class:`Operand`\s.
|
||||
"""
|
||||
fields = ('expr', 'ops')
|
||||
|
||||
def as_const(self, eval_ctx=None):
|
||||
eval_ctx = get_eval_context(self, eval_ctx)
|
||||
result = value = self.expr.as_const(eval_ctx)
|
||||
try:
|
||||
for op in self.ops:
|
||||
new_value = op.expr.as_const(eval_ctx)
|
||||
result = _cmpop_to_func[op.op](value, new_value)
|
||||
value = new_value
|
||||
except Exception:
|
||||
raise Impossible()
|
||||
return result
|
||||
|
||||
|
||||
class Operand(Helper):
|
||||
"""Holds an operator and an expression."""
|
||||
fields = ('op', 'expr')
|
||||
|
||||
if __debug__:
|
||||
Operand.__doc__ += '\nThe following operators are available: ' + \
|
||||
', '.join(sorted('``%s``' % x for x in set(_binop_to_func) |
|
||||
set(_uaop_to_func) | set(_cmpop_to_func)))
|
||||
|
||||
|
||||
class Mul(BinExpr):
|
||||
"""Multiplies the left with the right node."""
|
||||
operator = '*'
|
||||
|
||||
|
||||
class Div(BinExpr):
|
||||
"""Divides the left by the right node."""
|
||||
operator = '/'
|
||||
|
||||
|
||||
class FloorDiv(BinExpr):
|
||||
"""Divides the left by the right node and truncates conver the
|
||||
result into an integer by truncating.
|
||||
"""
|
||||
operator = '//'
|
||||
|
||||
|
||||
class Add(BinExpr):
|
||||
"""Add the left to the right node."""
|
||||
operator = '+'
|
||||
|
||||
|
||||
class Sub(BinExpr):
|
||||
"""Substract the right from the left node."""
|
||||
operator = '-'
|
||||
|
||||
|
||||
class Mod(BinExpr):
|
||||
"""Left modulo right."""
|
||||
operator = '%'
|
||||
|
||||
|
||||
class Pow(BinExpr):
|
||||
"""Left to the power of right."""
|
||||
operator = '**'
|
||||
|
||||
|
||||
class And(BinExpr):
|
||||
"""Short circuited AND."""
|
||||
operator = 'and'
|
||||
|
||||
def as_const(self, eval_ctx=None):
|
||||
eval_ctx = get_eval_context(self, eval_ctx)
|
||||
return self.left.as_const(eval_ctx) and self.right.as_const(eval_ctx)
|
||||
|
||||
|
||||
class Or(BinExpr):
|
||||
"""Short circuited OR."""
|
||||
operator = 'or'
|
||||
|
||||
def as_const(self, eval_ctx=None):
|
||||
eval_ctx = get_eval_context(self, eval_ctx)
|
||||
return self.left.as_const(eval_ctx) or self.right.as_const(eval_ctx)
|
||||
|
||||
|
||||
class Not(UnaryExpr):
|
||||
"""Negate the expression."""
|
||||
operator = 'not'
|
||||
|
||||
|
||||
class Neg(UnaryExpr):
|
||||
"""Make the expression negative."""
|
||||
operator = '-'
|
||||
|
||||
|
||||
class Pos(UnaryExpr):
|
||||
"""Make the expression positive (noop for most expressions)"""
|
||||
operator = '+'
|
||||
|
||||
|
||||
# Helpers for extensions
|
||||
|
||||
|
||||
class EnvironmentAttribute(Expr):
|
||||
"""Loads an attribute from the environment object. This is useful for
|
||||
extensions that want to call a callback stored on the environment.
|
||||
"""
|
||||
fields = ('name',)
|
||||
|
||||
|
||||
class ExtensionAttribute(Expr):
|
||||
"""Returns the attribute of an extension bound to the environment.
|
||||
The identifier is the identifier of the :class:`Extension`.
|
||||
|
||||
This node is usually constructed by calling the
|
||||
:meth:`~jinja2.ext.Extension.attr` method on an extension.
|
||||
"""
|
||||
fields = ('identifier', 'name')
|
||||
|
||||
|
||||
class ImportedName(Expr):
|
||||
"""If created with an import name the import name is returned on node
|
||||
access. For example ``ImportedName('cgi.escape')`` returns the `escape`
|
||||
function from the cgi module on evaluation. Imports are optimized by the
|
||||
compiler so there is no need to assign them to local variables.
|
||||
"""
|
||||
fields = ('importname',)
|
||||
|
||||
|
||||
class InternalName(Expr):
|
||||
"""An internal name in the compiler. You cannot create these nodes
|
||||
yourself but the parser provides a
|
||||
:meth:`~jinja2.parser.Parser.free_identifier` method that creates
|
||||
a new identifier for you. This identifier is not available from the
|
||||
template and is not threated specially by the compiler.
|
||||
"""
|
||||
fields = ('name',)
|
||||
|
||||
def __init__(self):
|
||||
raise TypeError('Can\'t create internal names. Use the '
|
||||
'`free_identifier` method on a parser.')
|
||||
|
||||
|
||||
class MarkSafe(Expr):
|
||||
"""Mark the wrapped expression as safe (wrap it as `Markup`)."""
|
||||
fields = ('expr',)
|
||||
|
||||
def as_const(self, eval_ctx=None):
|
||||
eval_ctx = get_eval_context(self, eval_ctx)
|
||||
return Markup(self.expr.as_const(eval_ctx))
|
||||
|
||||
|
||||
class MarkSafeIfAutoescape(Expr):
|
||||
"""Mark the wrapped expression as safe (wrap it as `Markup`) but
|
||||
only if autoescaping is active.
|
||||
|
||||
.. versionadded:: 2.5
|
||||
"""
|
||||
fields = ('expr',)
|
||||
|
||||
def as_const(self, eval_ctx=None):
|
||||
eval_ctx = get_eval_context(self, eval_ctx)
|
||||
if eval_ctx.volatile:
|
||||
raise Impossible()
|
||||
expr = self.expr.as_const(eval_ctx)
|
||||
if eval_ctx.autoescape:
|
||||
return Markup(expr)
|
||||
return expr
|
||||
|
||||
|
||||
class ContextReference(Expr):
|
||||
"""Returns the current template context. It can be used like a
|
||||
:class:`Name` node, with a ``'load'`` ctx and will return the
|
||||
current :class:`~jinja2.runtime.Context` object.
|
||||
|
||||
Here an example that assigns the current template name to a
|
||||
variable named `foo`::
|
||||
|
||||
Assign(Name('foo', ctx='store'),
|
||||
Getattr(ContextReference(), 'name'))
|
||||
"""
|
||||
|
||||
|
||||
class Continue(Stmt):
|
||||
"""Continue a loop."""
|
||||
|
||||
|
||||
class Break(Stmt):
|
||||
"""Break a loop."""
|
||||
|
||||
|
||||
class Scope(Stmt):
|
||||
"""An artificial scope."""
|
||||
fields = ('body',)
|
||||
|
||||
|
||||
class EvalContextModifier(Stmt):
|
||||
"""Modifies the eval context. For each option that should be modified,
|
||||
a :class:`Keyword` has to be added to the :attr:`options` list.
|
||||
|
||||
Example to change the `autoescape` setting::
|
||||
|
||||
EvalContextModifier(options=[Keyword('autoescape', Const(True))])
|
||||
"""
|
||||
fields = ('options',)
|
||||
|
||||
|
||||
class ScopedEvalContextModifier(EvalContextModifier):
|
||||
"""Modifies the eval context and reverts it later. Works exactly like
|
||||
:class:`EvalContextModifier` but will only modify the
|
||||
:class:`~jinja2.nodes.EvalContext` for nodes in the :attr:`body`.
|
||||
"""
|
||||
fields = ('body',)
|
||||
|
||||
|
||||
# make sure nobody creates custom nodes
|
||||
def _failing_new(*args, **kwargs):
|
||||
raise TypeError('can\'t create custom node types')
|
||||
NodeType.__new__ = staticmethod(_failing_new); del _failing_new
|
||||
Vendored
-68
@@ -1,68 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
jinja2.optimizer
|
||||
~~~~~~~~~~~~~~~~
|
||||
|
||||
The jinja optimizer is currently trying to constant fold a few expressions
|
||||
and modify the AST in place so that it should be easier to evaluate it.
|
||||
|
||||
Because the AST does not contain all the scoping information and the
|
||||
compiler has to find that out, we cannot do all the optimizations we
|
||||
want. For example loop unrolling doesn't work because unrolled loops would
|
||||
have a different scoping.
|
||||
|
||||
The solution would be a second syntax tree that has the scoping rules stored.
|
||||
|
||||
:copyright: (c) 2010 by the Jinja Team.
|
||||
:license: BSD.
|
||||
"""
|
||||
from jinja2 import nodes
|
||||
from jinja2.visitor import NodeTransformer
|
||||
|
||||
|
||||
def optimize(node, environment):
|
||||
"""The context hint can be used to perform an static optimization
|
||||
based on the context given."""
|
||||
optimizer = Optimizer(environment)
|
||||
return optimizer.visit(node)
|
||||
|
||||
|
||||
class Optimizer(NodeTransformer):
|
||||
|
||||
def __init__(self, environment):
|
||||
self.environment = environment
|
||||
|
||||
def visit_If(self, node):
|
||||
"""Eliminate dead code."""
|
||||
# do not optimize ifs that have a block inside so that it doesn't
|
||||
# break super().
|
||||
if node.find(nodes.Block) is not None:
|
||||
return self.generic_visit(node)
|
||||
try:
|
||||
val = self.visit(node.test).as_const()
|
||||
except nodes.Impossible:
|
||||
return self.generic_visit(node)
|
||||
if val:
|
||||
body = node.body
|
||||
else:
|
||||
body = node.else_
|
||||
result = []
|
||||
for node in body:
|
||||
result.extend(self.visit_list(node))
|
||||
return result
|
||||
|
||||
def fold(self, node):
|
||||
"""Do constant folding."""
|
||||
node = self.generic_visit(node)
|
||||
try:
|
||||
return nodes.Const.from_untrusted(node.as_const(),
|
||||
lineno=node.lineno,
|
||||
environment=self.environment)
|
||||
except nodes.Impossible:
|
||||
return node
|
||||
|
||||
visit_Add = visit_Sub = visit_Mul = visit_Div = visit_FloorDiv = \
|
||||
visit_Pow = visit_Mod = visit_And = visit_Or = visit_Pos = visit_Neg = \
|
||||
visit_Not = visit_Compare = visit_Getitem = visit_Getattr = visit_Call = \
|
||||
visit_Filter = visit_Test = visit_CondExpr = fold
|
||||
del fold
|
||||
Vendored
-895
@@ -1,895 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
jinja2.parser
|
||||
~~~~~~~~~~~~~
|
||||
|
||||
Implements the template parser.
|
||||
|
||||
:copyright: (c) 2010 by the Jinja Team.
|
||||
:license: BSD, see LICENSE for more details.
|
||||
"""
|
||||
from jinja2 import nodes
|
||||
from jinja2.exceptions import TemplateSyntaxError, TemplateAssertionError
|
||||
from jinja2.lexer import describe_token, describe_token_expr
|
||||
from jinja2._compat import next, imap
|
||||
|
||||
|
||||
#: statements that callinto
|
||||
_statement_keywords = frozenset(['for', 'if', 'block', 'extends', 'print',
|
||||
'macro', 'include', 'from', 'import',
|
||||
'set'])
|
||||
_compare_operators = frozenset(['eq', 'ne', 'lt', 'lteq', 'gt', 'gteq'])
|
||||
|
||||
|
||||
class Parser(object):
|
||||
"""This is the central parsing class Jinja2 uses. It's passed to
|
||||
extensions and can be used to parse expressions or statements.
|
||||
"""
|
||||
|
||||
def __init__(self, environment, source, name=None, filename=None,
|
||||
state=None):
|
||||
self.environment = environment
|
||||
self.stream = environment._tokenize(source, name, filename, state)
|
||||
self.name = name
|
||||
self.filename = filename
|
||||
self.closed = False
|
||||
self.extensions = {}
|
||||
for extension in environment.iter_extensions():
|
||||
for tag in extension.tags:
|
||||
self.extensions[tag] = extension.parse
|
||||
self._last_identifier = 0
|
||||
self._tag_stack = []
|
||||
self._end_token_stack = []
|
||||
|
||||
def fail(self, msg, lineno=None, exc=TemplateSyntaxError):
|
||||
"""Convenience method that raises `exc` with the message, passed
|
||||
line number or last line number as well as the current name and
|
||||
filename.
|
||||
"""
|
||||
if lineno is None:
|
||||
lineno = self.stream.current.lineno
|
||||
raise exc(msg, lineno, self.name, self.filename)
|
||||
|
||||
def _fail_ut_eof(self, name, end_token_stack, lineno):
|
||||
expected = []
|
||||
for exprs in end_token_stack:
|
||||
expected.extend(imap(describe_token_expr, exprs))
|
||||
if end_token_stack:
|
||||
currently_looking = ' or '.join(
|
||||
"'%s'" % describe_token_expr(expr)
|
||||
for expr in end_token_stack[-1])
|
||||
else:
|
||||
currently_looking = None
|
||||
|
||||
if name is None:
|
||||
message = ['Unexpected end of template.']
|
||||
else:
|
||||
message = ['Encountered unknown tag \'%s\'.' % name]
|
||||
|
||||
if currently_looking:
|
||||
if name is not None and name in expected:
|
||||
message.append('You probably made a nesting mistake. Jinja '
|
||||
'is expecting this tag, but currently looking '
|
||||
'for %s.' % currently_looking)
|
||||
else:
|
||||
message.append('Jinja was looking for the following tags: '
|
||||
'%s.' % currently_looking)
|
||||
|
||||
if self._tag_stack:
|
||||
message.append('The innermost block that needs to be '
|
||||
'closed is \'%s\'.' % self._tag_stack[-1])
|
||||
|
||||
self.fail(' '.join(message), lineno)
|
||||
|
||||
def fail_unknown_tag(self, name, lineno=None):
|
||||
"""Called if the parser encounters an unknown tag. Tries to fail
|
||||
with a human readable error message that could help to identify
|
||||
the problem.
|
||||
"""
|
||||
return self._fail_ut_eof(name, self._end_token_stack, lineno)
|
||||
|
||||
def fail_eof(self, end_tokens=None, lineno=None):
|
||||
"""Like fail_unknown_tag but for end of template situations."""
|
||||
stack = list(self._end_token_stack)
|
||||
if end_tokens is not None:
|
||||
stack.append(end_tokens)
|
||||
return self._fail_ut_eof(None, stack, lineno)
|
||||
|
||||
def is_tuple_end(self, extra_end_rules=None):
|
||||
"""Are we at the end of a tuple?"""
|
||||
if self.stream.current.type in ('variable_end', 'block_end', 'rparen'):
|
||||
return True
|
||||
elif extra_end_rules is not None:
|
||||
return self.stream.current.test_any(extra_end_rules)
|
||||
return False
|
||||
|
||||
def free_identifier(self, lineno=None):
|
||||
"""Return a new free identifier as :class:`~jinja2.nodes.InternalName`."""
|
||||
self._last_identifier += 1
|
||||
rv = object.__new__(nodes.InternalName)
|
||||
nodes.Node.__init__(rv, 'fi%d' % self._last_identifier, lineno=lineno)
|
||||
return rv
|
||||
|
||||
def parse_statement(self):
|
||||
"""Parse a single statement."""
|
||||
token = self.stream.current
|
||||
if token.type != 'name':
|
||||
self.fail('tag name expected', token.lineno)
|
||||
self._tag_stack.append(token.value)
|
||||
pop_tag = True
|
||||
try:
|
||||
if token.value in _statement_keywords:
|
||||
return getattr(self, 'parse_' + self.stream.current.value)()
|
||||
if token.value == 'call':
|
||||
return self.parse_call_block()
|
||||
if token.value == 'filter':
|
||||
return self.parse_filter_block()
|
||||
ext = self.extensions.get(token.value)
|
||||
if ext is not None:
|
||||
return ext(self)
|
||||
|
||||
# did not work out, remove the token we pushed by accident
|
||||
# from the stack so that the unknown tag fail function can
|
||||
# produce a proper error message.
|
||||
self._tag_stack.pop()
|
||||
pop_tag = False
|
||||
self.fail_unknown_tag(token.value, token.lineno)
|
||||
finally:
|
||||
if pop_tag:
|
||||
self._tag_stack.pop()
|
||||
|
||||
def parse_statements(self, end_tokens, drop_needle=False):
|
||||
"""Parse multiple statements into a list until one of the end tokens
|
||||
is reached. This is used to parse the body of statements as it also
|
||||
parses template data if appropriate. The parser checks first if the
|
||||
current token is a colon and skips it if there is one. Then it checks
|
||||
for the block end and parses until if one of the `end_tokens` is
|
||||
reached. Per default the active token in the stream at the end of
|
||||
the call is the matched end token. If this is not wanted `drop_needle`
|
||||
can be set to `True` and the end token is removed.
|
||||
"""
|
||||
# the first token may be a colon for python compatibility
|
||||
self.stream.skip_if('colon')
|
||||
|
||||
# in the future it would be possible to add whole code sections
|
||||
# by adding some sort of end of statement token and parsing those here.
|
||||
self.stream.expect('block_end')
|
||||
result = self.subparse(end_tokens)
|
||||
|
||||
# we reached the end of the template too early, the subparser
|
||||
# does not check for this, so we do that now
|
||||
if self.stream.current.type == 'eof':
|
||||
self.fail_eof(end_tokens)
|
||||
|
||||
if drop_needle:
|
||||
next(self.stream)
|
||||
return result
|
||||
|
||||
def parse_set(self):
|
||||
"""Parse an assign statement."""
|
||||
lineno = next(self.stream).lineno
|
||||
target = self.parse_assign_target()
|
||||
self.stream.expect('assign')
|
||||
expr = self.parse_tuple()
|
||||
return nodes.Assign(target, expr, lineno=lineno)
|
||||
|
||||
def parse_for(self):
|
||||
"""Parse a for loop."""
|
||||
lineno = self.stream.expect('name:for').lineno
|
||||
target = self.parse_assign_target(extra_end_rules=('name:in',))
|
||||
self.stream.expect('name:in')
|
||||
iter = self.parse_tuple(with_condexpr=False,
|
||||
extra_end_rules=('name:recursive',))
|
||||
test = None
|
||||
if self.stream.skip_if('name:if'):
|
||||
test = self.parse_expression()
|
||||
recursive = self.stream.skip_if('name:recursive')
|
||||
body = self.parse_statements(('name:endfor', 'name:else'))
|
||||
if next(self.stream).value == 'endfor':
|
||||
else_ = []
|
||||
else:
|
||||
else_ = self.parse_statements(('name:endfor',), drop_needle=True)
|
||||
return nodes.For(target, iter, body, else_, test,
|
||||
recursive, lineno=lineno)
|
||||
|
||||
def parse_if(self):
|
||||
"""Parse an if construct."""
|
||||
node = result = nodes.If(lineno=self.stream.expect('name:if').lineno)
|
||||
while 1:
|
||||
node.test = self.parse_tuple(with_condexpr=False)
|
||||
node.body = self.parse_statements(('name:elif', 'name:else',
|
||||
'name:endif'))
|
||||
token = next(self.stream)
|
||||
if token.test('name:elif'):
|
||||
new_node = nodes.If(lineno=self.stream.current.lineno)
|
||||
node.else_ = [new_node]
|
||||
node = new_node
|
||||
continue
|
||||
elif token.test('name:else'):
|
||||
node.else_ = self.parse_statements(('name:endif',),
|
||||
drop_needle=True)
|
||||
else:
|
||||
node.else_ = []
|
||||
break
|
||||
return result
|
||||
|
||||
def parse_block(self):
|
||||
node = nodes.Block(lineno=next(self.stream).lineno)
|
||||
node.name = self.stream.expect('name').value
|
||||
node.scoped = self.stream.skip_if('name:scoped')
|
||||
|
||||
# common problem people encounter when switching from django
|
||||
# to jinja. we do not support hyphens in block names, so let's
|
||||
# raise a nicer error message in that case.
|
||||
if self.stream.current.type == 'sub':
|
||||
self.fail('Block names in Jinja have to be valid Python '
|
||||
'identifiers and may not contain hyphens, use an '
|
||||
'underscore instead.')
|
||||
|
||||
node.body = self.parse_statements(('name:endblock',), drop_needle=True)
|
||||
self.stream.skip_if('name:' + node.name)
|
||||
return node
|
||||
|
||||
def parse_extends(self):
|
||||
node = nodes.Extends(lineno=next(self.stream).lineno)
|
||||
node.template = self.parse_expression()
|
||||
return node
|
||||
|
||||
def parse_import_context(self, node, default):
|
||||
if self.stream.current.test_any('name:with', 'name:without') and \
|
||||
self.stream.look().test('name:context'):
|
||||
node.with_context = next(self.stream).value == 'with'
|
||||
self.stream.skip()
|
||||
else:
|
||||
node.with_context = default
|
||||
return node
|
||||
|
||||
def parse_include(self):
|
||||
node = nodes.Include(lineno=next(self.stream).lineno)
|
||||
node.template = self.parse_expression()
|
||||
if self.stream.current.test('name:ignore') and \
|
||||
self.stream.look().test('name:missing'):
|
||||
node.ignore_missing = True
|
||||
self.stream.skip(2)
|
||||
else:
|
||||
node.ignore_missing = False
|
||||
return self.parse_import_context(node, True)
|
||||
|
||||
def parse_import(self):
|
||||
node = nodes.Import(lineno=next(self.stream).lineno)
|
||||
node.template = self.parse_expression()
|
||||
self.stream.expect('name:as')
|
||||
node.target = self.parse_assign_target(name_only=True).name
|
||||
return self.parse_import_context(node, False)
|
||||
|
||||
def parse_from(self):
|
||||
node = nodes.FromImport(lineno=next(self.stream).lineno)
|
||||
node.template = self.parse_expression()
|
||||
self.stream.expect('name:import')
|
||||
node.names = []
|
||||
|
||||
def parse_context():
|
||||
if self.stream.current.value in ('with', 'without') and \
|
||||
self.stream.look().test('name:context'):
|
||||
node.with_context = next(self.stream).value == 'with'
|
||||
self.stream.skip()
|
||||
return True
|
||||
return False
|
||||
|
||||
while 1:
|
||||
if node.names:
|
||||
self.stream.expect('comma')
|
||||
if self.stream.current.type == 'name':
|
||||
if parse_context():
|
||||
break
|
||||
target = self.parse_assign_target(name_only=True)
|
||||
if target.name.startswith('_'):
|
||||
self.fail('names starting with an underline can not '
|
||||
'be imported', target.lineno,
|
||||
exc=TemplateAssertionError)
|
||||
if self.stream.skip_if('name:as'):
|
||||
alias = self.parse_assign_target(name_only=True)
|
||||
node.names.append((target.name, alias.name))
|
||||
else:
|
||||
node.names.append(target.name)
|
||||
if parse_context() or self.stream.current.type != 'comma':
|
||||
break
|
||||
else:
|
||||
break
|
||||
if not hasattr(node, 'with_context'):
|
||||
node.with_context = False
|
||||
self.stream.skip_if('comma')
|
||||
return node
|
||||
|
||||
def parse_signature(self, node):
|
||||
node.args = args = []
|
||||
node.defaults = defaults = []
|
||||
self.stream.expect('lparen')
|
||||
while self.stream.current.type != 'rparen':
|
||||
if args:
|
||||
self.stream.expect('comma')
|
||||
arg = self.parse_assign_target(name_only=True)
|
||||
arg.set_ctx('param')
|
||||
if self.stream.skip_if('assign'):
|
||||
defaults.append(self.parse_expression())
|
||||
args.append(arg)
|
||||
self.stream.expect('rparen')
|
||||
|
||||
def parse_call_block(self):
|
||||
node = nodes.CallBlock(lineno=next(self.stream).lineno)
|
||||
if self.stream.current.type == 'lparen':
|
||||
self.parse_signature(node)
|
||||
else:
|
||||
node.args = []
|
||||
node.defaults = []
|
||||
|
||||
node.call = self.parse_expression()
|
||||
if not isinstance(node.call, nodes.Call):
|
||||
self.fail('expected call', node.lineno)
|
||||
node.body = self.parse_statements(('name:endcall',), drop_needle=True)
|
||||
return node
|
||||
|
||||
def parse_filter_block(self):
|
||||
node = nodes.FilterBlock(lineno=next(self.stream).lineno)
|
||||
node.filter = self.parse_filter(None, start_inline=True)
|
||||
node.body = self.parse_statements(('name:endfilter',),
|
||||
drop_needle=True)
|
||||
return node
|
||||
|
||||
def parse_macro(self):
|
||||
node = nodes.Macro(lineno=next(self.stream).lineno)
|
||||
node.name = self.parse_assign_target(name_only=True).name
|
||||
self.parse_signature(node)
|
||||
node.body = self.parse_statements(('name:endmacro',),
|
||||
drop_needle=True)
|
||||
return node
|
||||
|
||||
def parse_print(self):
|
||||
node = nodes.Output(lineno=next(self.stream).lineno)
|
||||
node.nodes = []
|
||||
while self.stream.current.type != 'block_end':
|
||||
if node.nodes:
|
||||
self.stream.expect('comma')
|
||||
node.nodes.append(self.parse_expression())
|
||||
return node
|
||||
|
||||
def parse_assign_target(self, with_tuple=True, name_only=False,
|
||||
extra_end_rules=None):
|
||||
"""Parse an assignment target. As Jinja2 allows assignments to
|
||||
tuples, this function can parse all allowed assignment targets. Per
|
||||
default assignments to tuples are parsed, that can be disable however
|
||||
by setting `with_tuple` to `False`. If only assignments to names are
|
||||
wanted `name_only` can be set to `True`. The `extra_end_rules`
|
||||
parameter is forwarded to the tuple parsing function.
|
||||
"""
|
||||
if name_only:
|
||||
token = self.stream.expect('name')
|
||||
target = nodes.Name(token.value, 'store', lineno=token.lineno)
|
||||
else:
|
||||
if with_tuple:
|
||||
target = self.parse_tuple(simplified=True,
|
||||
extra_end_rules=extra_end_rules)
|
||||
else:
|
||||
target = self.parse_primary()
|
||||
target.set_ctx('store')
|
||||
if not target.can_assign():
|
||||
self.fail('can\'t assign to %r' % target.__class__.
|
||||
__name__.lower(), target.lineno)
|
||||
return target
|
||||
|
||||
def parse_expression(self, with_condexpr=True):
|
||||
"""Parse an expression. Per default all expressions are parsed, if
|
||||
the optional `with_condexpr` parameter is set to `False` conditional
|
||||
expressions are not parsed.
|
||||
"""
|
||||
if with_condexpr:
|
||||
return self.parse_condexpr()
|
||||
return self.parse_or()
|
||||
|
||||
def parse_condexpr(self):
|
||||
lineno = self.stream.current.lineno
|
||||
expr1 = self.parse_or()
|
||||
while self.stream.skip_if('name:if'):
|
||||
expr2 = self.parse_or()
|
||||
if self.stream.skip_if('name:else'):
|
||||
expr3 = self.parse_condexpr()
|
||||
else:
|
||||
expr3 = None
|
||||
expr1 = nodes.CondExpr(expr2, expr1, expr3, lineno=lineno)
|
||||
lineno = self.stream.current.lineno
|
||||
return expr1
|
||||
|
||||
def parse_or(self):
|
||||
lineno = self.stream.current.lineno
|
||||
left = self.parse_and()
|
||||
while self.stream.skip_if('name:or'):
|
||||
right = self.parse_and()
|
||||
left = nodes.Or(left, right, lineno=lineno)
|
||||
lineno = self.stream.current.lineno
|
||||
return left
|
||||
|
||||
def parse_and(self):
|
||||
lineno = self.stream.current.lineno
|
||||
left = self.parse_not()
|
||||
while self.stream.skip_if('name:and'):
|
||||
right = self.parse_not()
|
||||
left = nodes.And(left, right, lineno=lineno)
|
||||
lineno = self.stream.current.lineno
|
||||
return left
|
||||
|
||||
def parse_not(self):
|
||||
if self.stream.current.test('name:not'):
|
||||
lineno = next(self.stream).lineno
|
||||
return nodes.Not(self.parse_not(), lineno=lineno)
|
||||
return self.parse_compare()
|
||||
|
||||
def parse_compare(self):
|
||||
lineno = self.stream.current.lineno
|
||||
expr = self.parse_add()
|
||||
ops = []
|
||||
while 1:
|
||||
token_type = self.stream.current.type
|
||||
if token_type in _compare_operators:
|
||||
next(self.stream)
|
||||
ops.append(nodes.Operand(token_type, self.parse_add()))
|
||||
elif self.stream.skip_if('name:in'):
|
||||
ops.append(nodes.Operand('in', self.parse_add()))
|
||||
elif self.stream.current.test('name:not') and \
|
||||
self.stream.look().test('name:in'):
|
||||
self.stream.skip(2)
|
||||
ops.append(nodes.Operand('notin', self.parse_add()))
|
||||
else:
|
||||
break
|
||||
lineno = self.stream.current.lineno
|
||||
if not ops:
|
||||
return expr
|
||||
return nodes.Compare(expr, ops, lineno=lineno)
|
||||
|
||||
def parse_add(self):
|
||||
lineno = self.stream.current.lineno
|
||||
left = self.parse_sub()
|
||||
while self.stream.current.type == 'add':
|
||||
next(self.stream)
|
||||
right = self.parse_sub()
|
||||
left = nodes.Add(left, right, lineno=lineno)
|
||||
lineno = self.stream.current.lineno
|
||||
return left
|
||||
|
||||
def parse_sub(self):
|
||||
lineno = self.stream.current.lineno
|
||||
left = self.parse_concat()
|
||||
while self.stream.current.type == 'sub':
|
||||
next(self.stream)
|
||||
right = self.parse_concat()
|
||||
left = nodes.Sub(left, right, lineno=lineno)
|
||||
lineno = self.stream.current.lineno
|
||||
return left
|
||||
|
||||
def parse_concat(self):
|
||||
lineno = self.stream.current.lineno
|
||||
args = [self.parse_mul()]
|
||||
while self.stream.current.type == 'tilde':
|
||||
next(self.stream)
|
||||
args.append(self.parse_mul())
|
||||
if len(args) == 1:
|
||||
return args[0]
|
||||
return nodes.Concat(args, lineno=lineno)
|
||||
|
||||
def parse_mul(self):
|
||||
lineno = self.stream.current.lineno
|
||||
left = self.parse_div()
|
||||
while self.stream.current.type == 'mul':
|
||||
next(self.stream)
|
||||
right = self.parse_div()
|
||||
left = nodes.Mul(left, right, lineno=lineno)
|
||||
lineno = self.stream.current.lineno
|
||||
return left
|
||||
|
||||
def parse_div(self):
|
||||
lineno = self.stream.current.lineno
|
||||
left = self.parse_floordiv()
|
||||
while self.stream.current.type == 'div':
|
||||
next(self.stream)
|
||||
right = self.parse_floordiv()
|
||||
left = nodes.Div(left, right, lineno=lineno)
|
||||
lineno = self.stream.current.lineno
|
||||
return left
|
||||
|
||||
def parse_floordiv(self):
|
||||
lineno = self.stream.current.lineno
|
||||
left = self.parse_mod()
|
||||
while self.stream.current.type == 'floordiv':
|
||||
next(self.stream)
|
||||
right = self.parse_mod()
|
||||
left = nodes.FloorDiv(left, right, lineno=lineno)
|
||||
lineno = self.stream.current.lineno
|
||||
return left
|
||||
|
||||
def parse_mod(self):
|
||||
lineno = self.stream.current.lineno
|
||||
left = self.parse_pow()
|
||||
while self.stream.current.type == 'mod':
|
||||
next(self.stream)
|
||||
right = self.parse_pow()
|
||||
left = nodes.Mod(left, right, lineno=lineno)
|
||||
lineno = self.stream.current.lineno
|
||||
return left
|
||||
|
||||
def parse_pow(self):
|
||||
lineno = self.stream.current.lineno
|
||||
left = self.parse_unary()
|
||||
while self.stream.current.type == 'pow':
|
||||
next(self.stream)
|
||||
right = self.parse_unary()
|
||||
left = nodes.Pow(left, right, lineno=lineno)
|
||||
lineno = self.stream.current.lineno
|
||||
return left
|
||||
|
||||
def parse_unary(self, with_filter=True):
|
||||
token_type = self.stream.current.type
|
||||
lineno = self.stream.current.lineno
|
||||
if token_type == 'sub':
|
||||
next(self.stream)
|
||||
node = nodes.Neg(self.parse_unary(False), lineno=lineno)
|
||||
elif token_type == 'add':
|
||||
next(self.stream)
|
||||
node = nodes.Pos(self.parse_unary(False), lineno=lineno)
|
||||
else:
|
||||
node = self.parse_primary()
|
||||
node = self.parse_postfix(node)
|
||||
if with_filter:
|
||||
node = self.parse_filter_expr(node)
|
||||
return node
|
||||
|
||||
def parse_primary(self):
|
||||
token = self.stream.current
|
||||
if token.type == 'name':
|
||||
if token.value in ('true', 'false', 'True', 'False'):
|
||||
node = nodes.Const(token.value in ('true', 'True'),
|
||||
lineno=token.lineno)
|
||||
elif token.value in ('none', 'None'):
|
||||
node = nodes.Const(None, lineno=token.lineno)
|
||||
else:
|
||||
node = nodes.Name(token.value, 'load', lineno=token.lineno)
|
||||
next(self.stream)
|
||||
elif token.type == 'string':
|
||||
next(self.stream)
|
||||
buf = [token.value]
|
||||
lineno = token.lineno
|
||||
while self.stream.current.type == 'string':
|
||||
buf.append(self.stream.current.value)
|
||||
next(self.stream)
|
||||
node = nodes.Const(''.join(buf), lineno=lineno)
|
||||
elif token.type in ('integer', 'float'):
|
||||
next(self.stream)
|
||||
node = nodes.Const(token.value, lineno=token.lineno)
|
||||
elif token.type == 'lparen':
|
||||
next(self.stream)
|
||||
node = self.parse_tuple(explicit_parentheses=True)
|
||||
self.stream.expect('rparen')
|
||||
elif token.type == 'lbracket':
|
||||
node = self.parse_list()
|
||||
elif token.type == 'lbrace':
|
||||
node = self.parse_dict()
|
||||
else:
|
||||
self.fail("unexpected '%s'" % describe_token(token), token.lineno)
|
||||
return node
|
||||
|
||||
def parse_tuple(self, simplified=False, with_condexpr=True,
|
||||
extra_end_rules=None, explicit_parentheses=False):
|
||||
"""Works like `parse_expression` but if multiple expressions are
|
||||
delimited by a comma a :class:`~jinja2.nodes.Tuple` node is created.
|
||||
This method could also return a regular expression instead of a tuple
|
||||
if no commas where found.
|
||||
|
||||
The default parsing mode is a full tuple. If `simplified` is `True`
|
||||
only names and literals are parsed. The `no_condexpr` parameter is
|
||||
forwarded to :meth:`parse_expression`.
|
||||
|
||||
Because tuples do not require delimiters and may end in a bogus comma
|
||||
an extra hint is needed that marks the end of a tuple. For example
|
||||
for loops support tuples between `for` and `in`. In that case the
|
||||
`extra_end_rules` is set to ``['name:in']``.
|
||||
|
||||
`explicit_parentheses` is true if the parsing was triggered by an
|
||||
expression in parentheses. This is used to figure out if an empty
|
||||
tuple is a valid expression or not.
|
||||
"""
|
||||
lineno = self.stream.current.lineno
|
||||
if simplified:
|
||||
parse = self.parse_primary
|
||||
elif with_condexpr:
|
||||
parse = self.parse_expression
|
||||
else:
|
||||
parse = lambda: self.parse_expression(with_condexpr=False)
|
||||
args = []
|
||||
is_tuple = False
|
||||
while 1:
|
||||
if args:
|
||||
self.stream.expect('comma')
|
||||
if self.is_tuple_end(extra_end_rules):
|
||||
break
|
||||
args.append(parse())
|
||||
if self.stream.current.type == 'comma':
|
||||
is_tuple = True
|
||||
else:
|
||||
break
|
||||
lineno = self.stream.current.lineno
|
||||
|
||||
if not is_tuple:
|
||||
if args:
|
||||
return args[0]
|
||||
|
||||
# if we don't have explicit parentheses, an empty tuple is
|
||||
# not a valid expression. This would mean nothing (literally
|
||||
# nothing) in the spot of an expression would be an empty
|
||||
# tuple.
|
||||
if not explicit_parentheses:
|
||||
self.fail('Expected an expression, got \'%s\'' %
|
||||
describe_token(self.stream.current))
|
||||
|
||||
return nodes.Tuple(args, 'load', lineno=lineno)
|
||||
|
||||
def parse_list(self):
|
||||
token = self.stream.expect('lbracket')
|
||||
items = []
|
||||
while self.stream.current.type != 'rbracket':
|
||||
if items:
|
||||
self.stream.expect('comma')
|
||||
if self.stream.current.type == 'rbracket':
|
||||
break
|
||||
items.append(self.parse_expression())
|
||||
self.stream.expect('rbracket')
|
||||
return nodes.List(items, lineno=token.lineno)
|
||||
|
||||
def parse_dict(self):
|
||||
token = self.stream.expect('lbrace')
|
||||
items = []
|
||||
while self.stream.current.type != 'rbrace':
|
||||
if items:
|
||||
self.stream.expect('comma')
|
||||
if self.stream.current.type == 'rbrace':
|
||||
break
|
||||
key = self.parse_expression()
|
||||
self.stream.expect('colon')
|
||||
value = self.parse_expression()
|
||||
items.append(nodes.Pair(key, value, lineno=key.lineno))
|
||||
self.stream.expect('rbrace')
|
||||
return nodes.Dict(items, lineno=token.lineno)
|
||||
|
||||
def parse_postfix(self, node):
|
||||
while 1:
|
||||
token_type = self.stream.current.type
|
||||
if token_type == 'dot' or token_type == 'lbracket':
|
||||
node = self.parse_subscript(node)
|
||||
# calls are valid both after postfix expressions (getattr
|
||||
# and getitem) as well as filters and tests
|
||||
elif token_type == 'lparen':
|
||||
node = self.parse_call(node)
|
||||
else:
|
||||
break
|
||||
return node
|
||||
|
||||
def parse_filter_expr(self, node):
|
||||
while 1:
|
||||
token_type = self.stream.current.type
|
||||
if token_type == 'pipe':
|
||||
node = self.parse_filter(node)
|
||||
elif token_type == 'name' and self.stream.current.value == 'is':
|
||||
node = self.parse_test(node)
|
||||
# calls are valid both after postfix expressions (getattr
|
||||
# and getitem) as well as filters and tests
|
||||
elif token_type == 'lparen':
|
||||
node = self.parse_call(node)
|
||||
else:
|
||||
break
|
||||
return node
|
||||
|
||||
def parse_subscript(self, node):
|
||||
token = next(self.stream)
|
||||
if token.type == 'dot':
|
||||
attr_token = self.stream.current
|
||||
next(self.stream)
|
||||
if attr_token.type == 'name':
|
||||
return nodes.Getattr(node, attr_token.value, 'load',
|
||||
lineno=token.lineno)
|
||||
elif attr_token.type != 'integer':
|
||||
self.fail('expected name or number', attr_token.lineno)
|
||||
arg = nodes.Const(attr_token.value, lineno=attr_token.lineno)
|
||||
return nodes.Getitem(node, arg, 'load', lineno=token.lineno)
|
||||
if token.type == 'lbracket':
|
||||
args = []
|
||||
while self.stream.current.type != 'rbracket':
|
||||
if args:
|
||||
self.stream.expect('comma')
|
||||
args.append(self.parse_subscribed())
|
||||
self.stream.expect('rbracket')
|
||||
if len(args) == 1:
|
||||
arg = args[0]
|
||||
else:
|
||||
arg = nodes.Tuple(args, 'load', lineno=token.lineno)
|
||||
return nodes.Getitem(node, arg, 'load', lineno=token.lineno)
|
||||
self.fail('expected subscript expression', self.lineno)
|
||||
|
||||
def parse_subscribed(self):
|
||||
lineno = self.stream.current.lineno
|
||||
|
||||
if self.stream.current.type == 'colon':
|
||||
next(self.stream)
|
||||
args = [None]
|
||||
else:
|
||||
node = self.parse_expression()
|
||||
if self.stream.current.type != 'colon':
|
||||
return node
|
||||
next(self.stream)
|
||||
args = [node]
|
||||
|
||||
if self.stream.current.type == 'colon':
|
||||
args.append(None)
|
||||
elif self.stream.current.type not in ('rbracket', 'comma'):
|
||||
args.append(self.parse_expression())
|
||||
else:
|
||||
args.append(None)
|
||||
|
||||
if self.stream.current.type == 'colon':
|
||||
next(self.stream)
|
||||
if self.stream.current.type not in ('rbracket', 'comma'):
|
||||
args.append(self.parse_expression())
|
||||
else:
|
||||
args.append(None)
|
||||
else:
|
||||
args.append(None)
|
||||
|
||||
return nodes.Slice(lineno=lineno, *args)
|
||||
|
||||
def parse_call(self, node):
|
||||
token = self.stream.expect('lparen')
|
||||
args = []
|
||||
kwargs = []
|
||||
dyn_args = dyn_kwargs = None
|
||||
require_comma = False
|
||||
|
||||
def ensure(expr):
|
||||
if not expr:
|
||||
self.fail('invalid syntax for function call expression',
|
||||
token.lineno)
|
||||
|
||||
while self.stream.current.type != 'rparen':
|
||||
if require_comma:
|
||||
self.stream.expect('comma')
|
||||
# support for trailing comma
|
||||
if self.stream.current.type == 'rparen':
|
||||
break
|
||||
if self.stream.current.type == 'mul':
|
||||
ensure(dyn_args is None and dyn_kwargs is None)
|
||||
next(self.stream)
|
||||
dyn_args = self.parse_expression()
|
||||
elif self.stream.current.type == 'pow':
|
||||
ensure(dyn_kwargs is None)
|
||||
next(self.stream)
|
||||
dyn_kwargs = self.parse_expression()
|
||||
else:
|
||||
ensure(dyn_args is None and dyn_kwargs is None)
|
||||
if self.stream.current.type == 'name' and \
|
||||
self.stream.look().type == 'assign':
|
||||
key = self.stream.current.value
|
||||
self.stream.skip(2)
|
||||
value = self.parse_expression()
|
||||
kwargs.append(nodes.Keyword(key, value,
|
||||
lineno=value.lineno))
|
||||
else:
|
||||
ensure(not kwargs)
|
||||
args.append(self.parse_expression())
|
||||
|
||||
require_comma = True
|
||||
self.stream.expect('rparen')
|
||||
|
||||
if node is None:
|
||||
return args, kwargs, dyn_args, dyn_kwargs
|
||||
return nodes.Call(node, args, kwargs, dyn_args, dyn_kwargs,
|
||||
lineno=token.lineno)
|
||||
|
||||
def parse_filter(self, node, start_inline=False):
|
||||
while self.stream.current.type == 'pipe' or start_inline:
|
||||
if not start_inline:
|
||||
next(self.stream)
|
||||
token = self.stream.expect('name')
|
||||
name = token.value
|
||||
while self.stream.current.type == 'dot':
|
||||
next(self.stream)
|
||||
name += '.' + self.stream.expect('name').value
|
||||
if self.stream.current.type == 'lparen':
|
||||
args, kwargs, dyn_args, dyn_kwargs = self.parse_call(None)
|
||||
else:
|
||||
args = []
|
||||
kwargs = []
|
||||
dyn_args = dyn_kwargs = None
|
||||
node = nodes.Filter(node, name, args, kwargs, dyn_args,
|
||||
dyn_kwargs, lineno=token.lineno)
|
||||
start_inline = False
|
||||
return node
|
||||
|
||||
def parse_test(self, node):
|
||||
token = next(self.stream)
|
||||
if self.stream.current.test('name:not'):
|
||||
next(self.stream)
|
||||
negated = True
|
||||
else:
|
||||
negated = False
|
||||
name = self.stream.expect('name').value
|
||||
while self.stream.current.type == 'dot':
|
||||
next(self.stream)
|
||||
name += '.' + self.stream.expect('name').value
|
||||
dyn_args = dyn_kwargs = None
|
||||
kwargs = []
|
||||
if self.stream.current.type == 'lparen':
|
||||
args, kwargs, dyn_args, dyn_kwargs = self.parse_call(None)
|
||||
elif self.stream.current.type in ('name', 'string', 'integer',
|
||||
'float', 'lparen', 'lbracket',
|
||||
'lbrace') and not \
|
||||
self.stream.current.test_any('name:else', 'name:or',
|
||||
'name:and'):
|
||||
if self.stream.current.test('name:is'):
|
||||
self.fail('You cannot chain multiple tests with is')
|
||||
args = [self.parse_expression()]
|
||||
else:
|
||||
args = []
|
||||
node = nodes.Test(node, name, args, kwargs, dyn_args,
|
||||
dyn_kwargs, lineno=token.lineno)
|
||||
if negated:
|
||||
node = nodes.Not(node, lineno=token.lineno)
|
||||
return node
|
||||
|
||||
def subparse(self, end_tokens=None):
|
||||
body = []
|
||||
data_buffer = []
|
||||
add_data = data_buffer.append
|
||||
|
||||
if end_tokens is not None:
|
||||
self._end_token_stack.append(end_tokens)
|
||||
|
||||
def flush_data():
|
||||
if data_buffer:
|
||||
lineno = data_buffer[0].lineno
|
||||
body.append(nodes.Output(data_buffer[:], lineno=lineno))
|
||||
del data_buffer[:]
|
||||
|
||||
try:
|
||||
while self.stream:
|
||||
token = self.stream.current
|
||||
if token.type == 'data':
|
||||
if token.value:
|
||||
add_data(nodes.TemplateData(token.value,
|
||||
lineno=token.lineno))
|
||||
next(self.stream)
|
||||
elif token.type == 'variable_begin':
|
||||
next(self.stream)
|
||||
add_data(self.parse_tuple(with_condexpr=True))
|
||||
self.stream.expect('variable_end')
|
||||
elif token.type == 'block_begin':
|
||||
flush_data()
|
||||
next(self.stream)
|
||||
if end_tokens is not None and \
|
||||
self.stream.current.test_any(*end_tokens):
|
||||
return body
|
||||
rv = self.parse_statement()
|
||||
if isinstance(rv, list):
|
||||
body.extend(rv)
|
||||
else:
|
||||
body.append(rv)
|
||||
self.stream.expect('block_end')
|
||||
else:
|
||||
raise AssertionError('internal parsing error')
|
||||
|
||||
flush_data()
|
||||
finally:
|
||||
if end_tokens is not None:
|
||||
self._end_token_stack.pop()
|
||||
|
||||
return body
|
||||
|
||||
def parse(self):
|
||||
"""Parse the whole template into a `Template` node."""
|
||||
result = nodes.Template(self.subparse(), lineno=1)
|
||||
result.set_environment(self.environment)
|
||||
return result
|
||||
Vendored
-581
@@ -1,581 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
jinja2.runtime
|
||||
~~~~~~~~~~~~~~
|
||||
|
||||
Runtime helpers.
|
||||
|
||||
:copyright: (c) 2010 by the Jinja Team.
|
||||
:license: BSD.
|
||||
"""
|
||||
from itertools import chain
|
||||
from jinja2.nodes import EvalContext, _context_function_types
|
||||
from jinja2.utils import Markup, soft_unicode, escape, missing, concat, \
|
||||
internalcode, object_type_repr
|
||||
from jinja2.exceptions import UndefinedError, TemplateRuntimeError, \
|
||||
TemplateNotFound
|
||||
from jinja2._compat import next, imap, text_type, iteritems, \
|
||||
implements_iterator, implements_to_string, string_types, PY2
|
||||
|
||||
|
||||
# these variables are exported to the template runtime
|
||||
__all__ = ['LoopContext', 'TemplateReference', 'Macro', 'Markup',
|
||||
'TemplateRuntimeError', 'missing', 'concat', 'escape',
|
||||
'markup_join', 'unicode_join', 'to_string', 'identity',
|
||||
'TemplateNotFound']
|
||||
|
||||
#: the name of the function that is used to convert something into
|
||||
#: a string. We can just use the text type here.
|
||||
to_string = text_type
|
||||
|
||||
#: the identity function. Useful for certain things in the environment
|
||||
identity = lambda x: x
|
||||
|
||||
_last_iteration = object()
|
||||
|
||||
|
||||
def markup_join(seq):
|
||||
"""Concatenation that escapes if necessary and converts to unicode."""
|
||||
buf = []
|
||||
iterator = imap(soft_unicode, seq)
|
||||
for arg in iterator:
|
||||
buf.append(arg)
|
||||
if hasattr(arg, '__html__'):
|
||||
return Markup(u'').join(chain(buf, iterator))
|
||||
return concat(buf)
|
||||
|
||||
|
||||
def unicode_join(seq):
|
||||
"""Simple args to unicode conversion and concatenation."""
|
||||
return concat(imap(text_type, seq))
|
||||
|
||||
|
||||
def new_context(environment, template_name, blocks, vars=None,
|
||||
shared=None, globals=None, locals=None):
|
||||
"""Internal helper to for context creation."""
|
||||
if vars is None:
|
||||
vars = {}
|
||||
if shared:
|
||||
parent = vars
|
||||
else:
|
||||
parent = dict(globals or (), **vars)
|
||||
if locals:
|
||||
# if the parent is shared a copy should be created because
|
||||
# we don't want to modify the dict passed
|
||||
if shared:
|
||||
parent = dict(parent)
|
||||
for key, value in iteritems(locals):
|
||||
if key[:2] == 'l_' and value is not missing:
|
||||
parent[key[2:]] = value
|
||||
return Context(environment, parent, template_name, blocks)
|
||||
|
||||
|
||||
class TemplateReference(object):
|
||||
"""The `self` in templates."""
|
||||
|
||||
def __init__(self, context):
|
||||
self.__context = context
|
||||
|
||||
def __getitem__(self, name):
|
||||
blocks = self.__context.blocks[name]
|
||||
return BlockReference(name, self.__context, blocks, 0)
|
||||
|
||||
def __repr__(self):
|
||||
return '<%s %r>' % (
|
||||
self.__class__.__name__,
|
||||
self.__context.name
|
||||
)
|
||||
|
||||
|
||||
class Context(object):
|
||||
"""The template context holds the variables of a template. It stores the
|
||||
values passed to the template and also the names the template exports.
|
||||
Creating instances is neither supported nor useful as it's created
|
||||
automatically at various stages of the template evaluation and should not
|
||||
be created by hand.
|
||||
|
||||
The context is immutable. Modifications on :attr:`parent` **must not**
|
||||
happen and modifications on :attr:`vars` are allowed from generated
|
||||
template code only. Template filters and global functions marked as
|
||||
:func:`contextfunction`\s get the active context passed as first argument
|
||||
and are allowed to access the context read-only.
|
||||
|
||||
The template context supports read only dict operations (`get`,
|
||||
`keys`, `values`, `items`, `iterkeys`, `itervalues`, `iteritems`,
|
||||
`__getitem__`, `__contains__`). Additionally there is a :meth:`resolve`
|
||||
method that doesn't fail with a `KeyError` but returns an
|
||||
:class:`Undefined` object for missing variables.
|
||||
"""
|
||||
__slots__ = ('parent', 'vars', 'environment', 'eval_ctx', 'exported_vars',
|
||||
'name', 'blocks', '__weakref__')
|
||||
|
||||
def __init__(self, environment, parent, name, blocks):
|
||||
self.parent = parent
|
||||
self.vars = {}
|
||||
self.environment = environment
|
||||
self.eval_ctx = EvalContext(self.environment, name)
|
||||
self.exported_vars = set()
|
||||
self.name = name
|
||||
|
||||
# create the initial mapping of blocks. Whenever template inheritance
|
||||
# takes place the runtime will update this mapping with the new blocks
|
||||
# from the template.
|
||||
self.blocks = dict((k, [v]) for k, v in iteritems(blocks))
|
||||
|
||||
def super(self, name, current):
|
||||
"""Render a parent block."""
|
||||
try:
|
||||
blocks = self.blocks[name]
|
||||
index = blocks.index(current) + 1
|
||||
blocks[index]
|
||||
except LookupError:
|
||||
return self.environment.undefined('there is no parent block '
|
||||
'called %r.' % name,
|
||||
name='super')
|
||||
return BlockReference(name, self, blocks, index)
|
||||
|
||||
def get(self, key, default=None):
|
||||
"""Returns an item from the template context, if it doesn't exist
|
||||
`default` is returned.
|
||||
"""
|
||||
try:
|
||||
return self[key]
|
||||
except KeyError:
|
||||
return default
|
||||
|
||||
def resolve(self, key):
|
||||
"""Looks up a variable like `__getitem__` or `get` but returns an
|
||||
:class:`Undefined` object with the name of the name looked up.
|
||||
"""
|
||||
if key in self.vars:
|
||||
return self.vars[key]
|
||||
if key in self.parent:
|
||||
return self.parent[key]
|
||||
return self.environment.undefined(name=key)
|
||||
|
||||
def get_exported(self):
|
||||
"""Get a new dict with the exported variables."""
|
||||
return dict((k, self.vars[k]) for k in self.exported_vars)
|
||||
|
||||
def get_all(self):
|
||||
"""Return a copy of the complete context as dict including the
|
||||
exported variables.
|
||||
"""
|
||||
return dict(self.parent, **self.vars)
|
||||
|
||||
@internalcode
|
||||
def call(__self, __obj, *args, **kwargs):
|
||||
"""Call the callable with the arguments and keyword arguments
|
||||
provided but inject the active context or environment as first
|
||||
argument if the callable is a :func:`contextfunction` or
|
||||
:func:`environmentfunction`.
|
||||
"""
|
||||
if __debug__:
|
||||
__traceback_hide__ = True
|
||||
|
||||
# Allow callable classes to take a context
|
||||
fn = __obj.__call__
|
||||
for fn_type in ('contextfunction',
|
||||
'evalcontextfunction',
|
||||
'environmentfunction'):
|
||||
if hasattr(fn, fn_type):
|
||||
__obj = fn
|
||||
break
|
||||
|
||||
if isinstance(__obj, _context_function_types):
|
||||
if getattr(__obj, 'contextfunction', 0):
|
||||
args = (__self,) + args
|
||||
elif getattr(__obj, 'evalcontextfunction', 0):
|
||||
args = (__self.eval_ctx,) + args
|
||||
elif getattr(__obj, 'environmentfunction', 0):
|
||||
args = (__self.environment,) + args
|
||||
try:
|
||||
return __obj(*args, **kwargs)
|
||||
except StopIteration:
|
||||
return __self.environment.undefined('value was undefined because '
|
||||
'a callable raised a '
|
||||
'StopIteration exception')
|
||||
|
||||
def derived(self, locals=None):
|
||||
"""Internal helper function to create a derived context."""
|
||||
context = new_context(self.environment, self.name, {},
|
||||
self.parent, True, None, locals)
|
||||
context.vars.update(self.vars)
|
||||
context.eval_ctx = self.eval_ctx
|
||||
context.blocks.update((k, list(v)) for k, v in iteritems(self.blocks))
|
||||
return context
|
||||
|
||||
def _all(meth):
|
||||
proxy = lambda self: getattr(self.get_all(), meth)()
|
||||
proxy.__doc__ = getattr(dict, meth).__doc__
|
||||
proxy.__name__ = meth
|
||||
return proxy
|
||||
|
||||
keys = _all('keys')
|
||||
values = _all('values')
|
||||
items = _all('items')
|
||||
|
||||
# not available on python 3
|
||||
if PY2:
|
||||
iterkeys = _all('iterkeys')
|
||||
itervalues = _all('itervalues')
|
||||
iteritems = _all('iteritems')
|
||||
del _all
|
||||
|
||||
def __contains__(self, name):
|
||||
return name in self.vars or name in self.parent
|
||||
|
||||
def __getitem__(self, key):
|
||||
"""Lookup a variable or raise `KeyError` if the variable is
|
||||
undefined.
|
||||
"""
|
||||
item = self.resolve(key)
|
||||
if isinstance(item, Undefined):
|
||||
raise KeyError(key)
|
||||
return item
|
||||
|
||||
def __repr__(self):
|
||||
return '<%s %s of %r>' % (
|
||||
self.__class__.__name__,
|
||||
repr(self.get_all()),
|
||||
self.name
|
||||
)
|
||||
|
||||
|
||||
# register the context as mapping if possible
|
||||
try:
|
||||
from collections import Mapping
|
||||
Mapping.register(Context)
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
|
||||
class BlockReference(object):
|
||||
"""One block on a template reference."""
|
||||
|
||||
def __init__(self, name, context, stack, depth):
|
||||
self.name = name
|
||||
self._context = context
|
||||
self._stack = stack
|
||||
self._depth = depth
|
||||
|
||||
@property
|
||||
def super(self):
|
||||
"""Super the block."""
|
||||
if self._depth + 1 >= len(self._stack):
|
||||
return self._context.environment. \
|
||||
undefined('there is no parent block called %r.' %
|
||||
self.name, name='super')
|
||||
return BlockReference(self.name, self._context, self._stack,
|
||||
self._depth + 1)
|
||||
|
||||
@internalcode
|
||||
def __call__(self):
|
||||
rv = concat(self._stack[self._depth](self._context))
|
||||
if self._context.eval_ctx.autoescape:
|
||||
rv = Markup(rv)
|
||||
return rv
|
||||
|
||||
|
||||
class LoopContext(object):
|
||||
"""A loop context for dynamic iteration."""
|
||||
|
||||
def __init__(self, iterable, recurse=None, depth0=0):
|
||||
self._iterator = iter(iterable)
|
||||
self._recurse = recurse
|
||||
self._after = self._safe_next()
|
||||
self.index0 = -1
|
||||
self.depth0 = depth0
|
||||
|
||||
# try to get the length of the iterable early. This must be done
|
||||
# here because there are some broken iterators around where there
|
||||
# __len__ is the number of iterations left (i'm looking at your
|
||||
# listreverseiterator!).
|
||||
try:
|
||||
self._length = len(iterable)
|
||||
except (TypeError, AttributeError):
|
||||
self._length = None
|
||||
|
||||
def cycle(self, *args):
|
||||
"""Cycles among the arguments with the current loop index."""
|
||||
if not args:
|
||||
raise TypeError('no items for cycling given')
|
||||
return args[self.index0 % len(args)]
|
||||
|
||||
first = property(lambda x: x.index0 == 0)
|
||||
last = property(lambda x: x._after is _last_iteration)
|
||||
index = property(lambda x: x.index0 + 1)
|
||||
revindex = property(lambda x: x.length - x.index0)
|
||||
revindex0 = property(lambda x: x.length - x.index)
|
||||
depth = property(lambda x: x.depth0 + 1)
|
||||
|
||||
def __len__(self):
|
||||
return self.length
|
||||
|
||||
def __iter__(self):
|
||||
return LoopContextIterator(self)
|
||||
|
||||
def _safe_next(self):
|
||||
try:
|
||||
return next(self._iterator)
|
||||
except StopIteration:
|
||||
return _last_iteration
|
||||
|
||||
@internalcode
|
||||
def loop(self, iterable):
|
||||
if self._recurse is None:
|
||||
raise TypeError('Tried to call non recursive loop. Maybe you '
|
||||
"forgot the 'recursive' modifier.")
|
||||
return self._recurse(iterable, self._recurse, self.depth0 + 1)
|
||||
|
||||
# a nifty trick to enhance the error message if someone tried to call
|
||||
# the the loop without or with too many arguments.
|
||||
__call__ = loop
|
||||
del loop
|
||||
|
||||
@property
|
||||
def length(self):
|
||||
if self._length is None:
|
||||
# if was not possible to get the length of the iterator when
|
||||
# the loop context was created (ie: iterating over a generator)
|
||||
# we have to convert the iterable into a sequence and use the
|
||||
# length of that.
|
||||
iterable = tuple(self._iterator)
|
||||
self._iterator = iter(iterable)
|
||||
self._length = len(iterable) + self.index0 + 1
|
||||
return self._length
|
||||
|
||||
def __repr__(self):
|
||||
return '<%s %r/%r>' % (
|
||||
self.__class__.__name__,
|
||||
self.index,
|
||||
self.length
|
||||
)
|
||||
|
||||
|
||||
@implements_iterator
|
||||
class LoopContextIterator(object):
|
||||
"""The iterator for a loop context."""
|
||||
__slots__ = ('context',)
|
||||
|
||||
def __init__(self, context):
|
||||
self.context = context
|
||||
|
||||
def __iter__(self):
|
||||
return self
|
||||
|
||||
def __next__(self):
|
||||
ctx = self.context
|
||||
ctx.index0 += 1
|
||||
if ctx._after is _last_iteration:
|
||||
raise StopIteration()
|
||||
next_elem = ctx._after
|
||||
ctx._after = ctx._safe_next()
|
||||
return next_elem, ctx
|
||||
|
||||
|
||||
class Macro(object):
|
||||
"""Wraps a macro function."""
|
||||
|
||||
def __init__(self, environment, func, name, arguments, defaults,
|
||||
catch_kwargs, catch_varargs, caller):
|
||||
self._environment = environment
|
||||
self._func = func
|
||||
self._argument_count = len(arguments)
|
||||
self.name = name
|
||||
self.arguments = arguments
|
||||
self.defaults = defaults
|
||||
self.catch_kwargs = catch_kwargs
|
||||
self.catch_varargs = catch_varargs
|
||||
self.caller = caller
|
||||
|
||||
@internalcode
|
||||
def __call__(self, *args, **kwargs):
|
||||
# try to consume the positional arguments
|
||||
arguments = list(args[:self._argument_count])
|
||||
off = len(arguments)
|
||||
|
||||
# if the number of arguments consumed is not the number of
|
||||
# arguments expected we start filling in keyword arguments
|
||||
# and defaults.
|
||||
if off != self._argument_count:
|
||||
for idx, name in enumerate(self.arguments[len(arguments):]):
|
||||
try:
|
||||
value = kwargs.pop(name)
|
||||
except KeyError:
|
||||
try:
|
||||
value = self.defaults[idx - self._argument_count + off]
|
||||
except IndexError:
|
||||
value = self._environment.undefined(
|
||||
'parameter %r was not provided' % name, name=name)
|
||||
arguments.append(value)
|
||||
|
||||
# it's important that the order of these arguments does not change
|
||||
# if not also changed in the compiler's `function_scoping` method.
|
||||
# the order is caller, keyword arguments, positional arguments!
|
||||
if self.caller:
|
||||
caller = kwargs.pop('caller', None)
|
||||
if caller is None:
|
||||
caller = self._environment.undefined('No caller defined',
|
||||
name='caller')
|
||||
arguments.append(caller)
|
||||
if self.catch_kwargs:
|
||||
arguments.append(kwargs)
|
||||
elif kwargs:
|
||||
raise TypeError('macro %r takes no keyword argument %r' %
|
||||
(self.name, next(iter(kwargs))))
|
||||
if self.catch_varargs:
|
||||
arguments.append(args[self._argument_count:])
|
||||
elif len(args) > self._argument_count:
|
||||
raise TypeError('macro %r takes not more than %d argument(s)' %
|
||||
(self.name, len(self.arguments)))
|
||||
return self._func(*arguments)
|
||||
|
||||
def __repr__(self):
|
||||
return '<%s %s>' % (
|
||||
self.__class__.__name__,
|
||||
self.name is None and 'anonymous' or repr(self.name)
|
||||
)
|
||||
|
||||
|
||||
@implements_to_string
|
||||
class Undefined(object):
|
||||
"""The default undefined type. This undefined type can be printed and
|
||||
iterated over, but every other access will raise an :exc:`UndefinedError`:
|
||||
|
||||
>>> foo = Undefined(name='foo')
|
||||
>>> str(foo)
|
||||
''
|
||||
>>> not foo
|
||||
True
|
||||
>>> foo + 42
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
UndefinedError: 'foo' is undefined
|
||||
"""
|
||||
__slots__ = ('_undefined_hint', '_undefined_obj', '_undefined_name',
|
||||
'_undefined_exception')
|
||||
|
||||
def __init__(self, hint=None, obj=missing, name=None, exc=UndefinedError):
|
||||
self._undefined_hint = hint
|
||||
self._undefined_obj = obj
|
||||
self._undefined_name = name
|
||||
self._undefined_exception = exc
|
||||
|
||||
@internalcode
|
||||
def _fail_with_undefined_error(self, *args, **kwargs):
|
||||
"""Regular callback function for undefined objects that raises an
|
||||
`UndefinedError` on call.
|
||||
"""
|
||||
if self._undefined_hint is None:
|
||||
if self._undefined_obj is missing:
|
||||
hint = '%r is undefined' % self._undefined_name
|
||||
elif not isinstance(self._undefined_name, string_types):
|
||||
hint = '%s has no element %r' % (
|
||||
object_type_repr(self._undefined_obj),
|
||||
self._undefined_name
|
||||
)
|
||||
else:
|
||||
hint = '%r has no attribute %r' % (
|
||||
object_type_repr(self._undefined_obj),
|
||||
self._undefined_name
|
||||
)
|
||||
else:
|
||||
hint = self._undefined_hint
|
||||
raise self._undefined_exception(hint)
|
||||
|
||||
@internalcode
|
||||
def __getattr__(self, name):
|
||||
if name[:2] == '__':
|
||||
raise AttributeError(name)
|
||||
return self._fail_with_undefined_error()
|
||||
|
||||
__add__ = __radd__ = __mul__ = __rmul__ = __div__ = __rdiv__ = \
|
||||
__truediv__ = __rtruediv__ = __floordiv__ = __rfloordiv__ = \
|
||||
__mod__ = __rmod__ = __pos__ = __neg__ = __call__ = \
|
||||
__getitem__ = __lt__ = __le__ = __gt__ = __ge__ = __int__ = \
|
||||
__float__ = __complex__ = __pow__ = __rpow__ = \
|
||||
_fail_with_undefined_error
|
||||
|
||||
def __eq__(self, other):
|
||||
return type(self) is type(other)
|
||||
|
||||
def __ne__(self, other):
|
||||
return not self.__eq__(other)
|
||||
|
||||
def __hash__(self):
|
||||
return id(type(self))
|
||||
|
||||
def __str__(self):
|
||||
return u''
|
||||
|
||||
def __len__(self):
|
||||
return 0
|
||||
|
||||
def __iter__(self):
|
||||
if 0:
|
||||
yield None
|
||||
|
||||
def __nonzero__(self):
|
||||
return False
|
||||
|
||||
def __repr__(self):
|
||||
return 'Undefined'
|
||||
|
||||
|
||||
@implements_to_string
|
||||
class DebugUndefined(Undefined):
|
||||
"""An undefined that returns the debug info when printed.
|
||||
|
||||
>>> foo = DebugUndefined(name='foo')
|
||||
>>> str(foo)
|
||||
'{{ foo }}'
|
||||
>>> not foo
|
||||
True
|
||||
>>> foo + 42
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
UndefinedError: 'foo' is undefined
|
||||
"""
|
||||
__slots__ = ()
|
||||
|
||||
def __str__(self):
|
||||
if self._undefined_hint is None:
|
||||
if self._undefined_obj is missing:
|
||||
return u'{{ %s }}' % self._undefined_name
|
||||
return '{{ no such element: %s[%r] }}' % (
|
||||
object_type_repr(self._undefined_obj),
|
||||
self._undefined_name
|
||||
)
|
||||
return u'{{ undefined value printed: %s }}' % self._undefined_hint
|
||||
|
||||
|
||||
@implements_to_string
|
||||
class StrictUndefined(Undefined):
|
||||
"""An undefined that barks on print and iteration as well as boolean
|
||||
tests and all kinds of comparisons. In other words: you can do nothing
|
||||
with it except checking if it's defined using the `defined` test.
|
||||
|
||||
>>> foo = StrictUndefined(name='foo')
|
||||
>>> str(foo)
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
UndefinedError: 'foo' is undefined
|
||||
>>> not foo
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
UndefinedError: 'foo' is undefined
|
||||
>>> foo + 42
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
UndefinedError: 'foo' is undefined
|
||||
"""
|
||||
__slots__ = ()
|
||||
__iter__ = __str__ = __len__ = __nonzero__ = __eq__ = \
|
||||
__ne__ = __bool__ = __hash__ = \
|
||||
Undefined._fail_with_undefined_error
|
||||
|
||||
|
||||
# remove remaining slots attributes, after the metaclass did the magic they
|
||||
# are unneeded and irritating as they contain wrong data for the subclasses.
|
||||
del Undefined.__slots__, DebugUndefined.__slots__, StrictUndefined.__slots__
|
||||
Vendored
-368
@@ -1,368 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
jinja2.sandbox
|
||||
~~~~~~~~~~~~~~
|
||||
|
||||
Adds a sandbox layer to Jinja as it was the default behavior in the old
|
||||
Jinja 1 releases. This sandbox is slightly different from Jinja 1 as the
|
||||
default behavior is easier to use.
|
||||
|
||||
The behavior can be changed by subclassing the environment.
|
||||
|
||||
:copyright: (c) 2010 by the Jinja Team.
|
||||
:license: BSD.
|
||||
"""
|
||||
import operator
|
||||
from jinja2.environment import Environment
|
||||
from jinja2.exceptions import SecurityError
|
||||
from jinja2._compat import string_types, function_type, method_type, \
|
||||
traceback_type, code_type, frame_type, generator_type, PY2
|
||||
|
||||
|
||||
#: maximum number of items a range may produce
|
||||
MAX_RANGE = 100000
|
||||
|
||||
#: attributes of function objects that are considered unsafe.
|
||||
UNSAFE_FUNCTION_ATTRIBUTES = set(['func_closure', 'func_code', 'func_dict',
|
||||
'func_defaults', 'func_globals'])
|
||||
|
||||
#: unsafe method attributes. function attributes are unsafe for methods too
|
||||
UNSAFE_METHOD_ATTRIBUTES = set(['im_class', 'im_func', 'im_self'])
|
||||
|
||||
#: unsafe generator attirbutes.
|
||||
UNSAFE_GENERATOR_ATTRIBUTES = set(['gi_frame', 'gi_code'])
|
||||
|
||||
# On versions > python 2 the special attributes on functions are gone,
|
||||
# but they remain on methods and generators for whatever reason.
|
||||
if not PY2:
|
||||
UNSAFE_FUNCTION_ATTRIBUTES = set()
|
||||
|
||||
import warnings
|
||||
|
||||
# make sure we don't warn in python 2.6 about stuff we don't care about
|
||||
warnings.filterwarnings('ignore', 'the sets module', DeprecationWarning,
|
||||
module='jinja2.sandbox')
|
||||
|
||||
from collections import deque
|
||||
|
||||
_mutable_set_types = (set,)
|
||||
_mutable_mapping_types = (dict,)
|
||||
_mutable_sequence_types = (list,)
|
||||
|
||||
|
||||
# on python 2.x we can register the user collection types
|
||||
try:
|
||||
from UserDict import UserDict, DictMixin
|
||||
from UserList import UserList
|
||||
_mutable_mapping_types += (UserDict, DictMixin)
|
||||
_mutable_set_types += (UserList,)
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
# if sets is still available, register the mutable set from there as well
|
||||
try:
|
||||
from sets import Set
|
||||
_mutable_set_types += (Set,)
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
#: register Python 2.6 abstract base classes
|
||||
try:
|
||||
from collections import MutableSet, MutableMapping, MutableSequence
|
||||
_mutable_set_types += (MutableSet,)
|
||||
_mutable_mapping_types += (MutableMapping,)
|
||||
_mutable_sequence_types += (MutableSequence,)
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
_mutable_spec = (
|
||||
(_mutable_set_types, frozenset([
|
||||
'add', 'clear', 'difference_update', 'discard', 'pop', 'remove',
|
||||
'symmetric_difference_update', 'update'
|
||||
])),
|
||||
(_mutable_mapping_types, frozenset([
|
||||
'clear', 'pop', 'popitem', 'setdefault', 'update'
|
||||
])),
|
||||
(_mutable_sequence_types, frozenset([
|
||||
'append', 'reverse', 'insert', 'sort', 'extend', 'remove'
|
||||
])),
|
||||
(deque, frozenset([
|
||||
'append', 'appendleft', 'clear', 'extend', 'extendleft', 'pop',
|
||||
'popleft', 'remove', 'rotate'
|
||||
]))
|
||||
)
|
||||
|
||||
|
||||
def safe_range(*args):
|
||||
"""A range that can't generate ranges with a length of more than
|
||||
MAX_RANGE items.
|
||||
"""
|
||||
rng = range(*args)
|
||||
if len(rng) > MAX_RANGE:
|
||||
raise OverflowError('range too big, maximum size for range is %d' %
|
||||
MAX_RANGE)
|
||||
return rng
|
||||
|
||||
|
||||
def unsafe(f):
|
||||
"""Marks a function or method as unsafe.
|
||||
|
||||
::
|
||||
|
||||
@unsafe
|
||||
def delete(self):
|
||||
pass
|
||||
"""
|
||||
f.unsafe_callable = True
|
||||
return f
|
||||
|
||||
|
||||
def is_internal_attribute(obj, attr):
|
||||
"""Test if the attribute given is an internal python attribute. For
|
||||
example this function returns `True` for the `func_code` attribute of
|
||||
python objects. This is useful if the environment method
|
||||
:meth:`~SandboxedEnvironment.is_safe_attribute` is overridden.
|
||||
|
||||
>>> from jinja2.sandbox import is_internal_attribute
|
||||
>>> is_internal_attribute(lambda: None, "func_code")
|
||||
True
|
||||
>>> is_internal_attribute((lambda x:x).func_code, 'co_code')
|
||||
True
|
||||
>>> is_internal_attribute(str, "upper")
|
||||
False
|
||||
"""
|
||||
if isinstance(obj, function_type):
|
||||
if attr in UNSAFE_FUNCTION_ATTRIBUTES:
|
||||
return True
|
||||
elif isinstance(obj, method_type):
|
||||
if attr in UNSAFE_FUNCTION_ATTRIBUTES or \
|
||||
attr in UNSAFE_METHOD_ATTRIBUTES:
|
||||
return True
|
||||
elif isinstance(obj, type):
|
||||
if attr == 'mro':
|
||||
return True
|
||||
elif isinstance(obj, (code_type, traceback_type, frame_type)):
|
||||
return True
|
||||
elif isinstance(obj, generator_type):
|
||||
if attr in UNSAFE_GENERATOR_ATTRIBUTES:
|
||||
return True
|
||||
return attr.startswith('__')
|
||||
|
||||
|
||||
def modifies_known_mutable(obj, attr):
|
||||
"""This function checks if an attribute on a builtin mutable object
|
||||
(list, dict, set or deque) would modify it if called. It also supports
|
||||
the "user"-versions of the objects (`sets.Set`, `UserDict.*` etc.) and
|
||||
with Python 2.6 onwards the abstract base classes `MutableSet`,
|
||||
`MutableMapping`, and `MutableSequence`.
|
||||
|
||||
>>> modifies_known_mutable({}, "clear")
|
||||
True
|
||||
>>> modifies_known_mutable({}, "keys")
|
||||
False
|
||||
>>> modifies_known_mutable([], "append")
|
||||
True
|
||||
>>> modifies_known_mutable([], "index")
|
||||
False
|
||||
|
||||
If called with an unsupported object (such as unicode) `False` is
|
||||
returned.
|
||||
|
||||
>>> modifies_known_mutable("foo", "upper")
|
||||
False
|
||||
"""
|
||||
for typespec, unsafe in _mutable_spec:
|
||||
if isinstance(obj, typespec):
|
||||
return attr in unsafe
|
||||
return False
|
||||
|
||||
|
||||
class SandboxedEnvironment(Environment):
|
||||
"""The sandboxed environment. It works like the regular environment but
|
||||
tells the compiler to generate sandboxed code. Additionally subclasses of
|
||||
this environment may override the methods that tell the runtime what
|
||||
attributes or functions are safe to access.
|
||||
|
||||
If the template tries to access insecure code a :exc:`SecurityError` is
|
||||
raised. However also other exceptions may occour during the rendering so
|
||||
the caller has to ensure that all exceptions are catched.
|
||||
"""
|
||||
sandboxed = True
|
||||
|
||||
#: default callback table for the binary operators. A copy of this is
|
||||
#: available on each instance of a sandboxed environment as
|
||||
#: :attr:`binop_table`
|
||||
default_binop_table = {
|
||||
'+': operator.add,
|
||||
'-': operator.sub,
|
||||
'*': operator.mul,
|
||||
'/': operator.truediv,
|
||||
'//': operator.floordiv,
|
||||
'**': operator.pow,
|
||||
'%': operator.mod
|
||||
}
|
||||
|
||||
#: default callback table for the unary operators. A copy of this is
|
||||
#: available on each instance of a sandboxed environment as
|
||||
#: :attr:`unop_table`
|
||||
default_unop_table = {
|
||||
'+': operator.pos,
|
||||
'-': operator.neg
|
||||
}
|
||||
|
||||
#: a set of binary operators that should be intercepted. Each operator
|
||||
#: that is added to this set (empty by default) is delegated to the
|
||||
#: :meth:`call_binop` method that will perform the operator. The default
|
||||
#: operator callback is specified by :attr:`binop_table`.
|
||||
#:
|
||||
#: The following binary operators are interceptable:
|
||||
#: ``//``, ``%``, ``+``, ``*``, ``-``, ``/``, and ``**``
|
||||
#:
|
||||
#: The default operation form the operator table corresponds to the
|
||||
#: builtin function. Intercepted calls are always slower than the native
|
||||
#: operator call, so make sure only to intercept the ones you are
|
||||
#: interested in.
|
||||
#:
|
||||
#: .. versionadded:: 2.6
|
||||
intercepted_binops = frozenset()
|
||||
|
||||
#: a set of unary operators that should be intercepted. Each operator
|
||||
#: that is added to this set (empty by default) is delegated to the
|
||||
#: :meth:`call_unop` method that will perform the operator. The default
|
||||
#: operator callback is specified by :attr:`unop_table`.
|
||||
#:
|
||||
#: The following unary operators are interceptable: ``+``, ``-``
|
||||
#:
|
||||
#: The default operation form the operator table corresponds to the
|
||||
#: builtin function. Intercepted calls are always slower than the native
|
||||
#: operator call, so make sure only to intercept the ones you are
|
||||
#: interested in.
|
||||
#:
|
||||
#: .. versionadded:: 2.6
|
||||
intercepted_unops = frozenset()
|
||||
|
||||
def intercept_unop(self, operator):
|
||||
"""Called during template compilation with the name of a unary
|
||||
operator to check if it should be intercepted at runtime. If this
|
||||
method returns `True`, :meth:`call_unop` is excuted for this unary
|
||||
operator. The default implementation of :meth:`call_unop` will use
|
||||
the :attr:`unop_table` dictionary to perform the operator with the
|
||||
same logic as the builtin one.
|
||||
|
||||
The following unary operators are interceptable: ``+`` and ``-``
|
||||
|
||||
Intercepted calls are always slower than the native operator call,
|
||||
so make sure only to intercept the ones you are interested in.
|
||||
|
||||
.. versionadded:: 2.6
|
||||
"""
|
||||
return False
|
||||
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
Environment.__init__(self, *args, **kwargs)
|
||||
self.globals['range'] = safe_range
|
||||
self.binop_table = self.default_binop_table.copy()
|
||||
self.unop_table = self.default_unop_table.copy()
|
||||
|
||||
def is_safe_attribute(self, obj, attr, value):
|
||||
"""The sandboxed environment will call this method to check if the
|
||||
attribute of an object is safe to access. Per default all attributes
|
||||
starting with an underscore are considered private as well as the
|
||||
special attributes of internal python objects as returned by the
|
||||
:func:`is_internal_attribute` function.
|
||||
"""
|
||||
return not (attr.startswith('_') or is_internal_attribute(obj, attr))
|
||||
|
||||
def is_safe_callable(self, obj):
|
||||
"""Check if an object is safely callable. Per default a function is
|
||||
considered safe unless the `unsafe_callable` attribute exists and is
|
||||
True. Override this method to alter the behavior, but this won't
|
||||
affect the `unsafe` decorator from this module.
|
||||
"""
|
||||
return not (getattr(obj, 'unsafe_callable', False) or
|
||||
getattr(obj, 'alters_data', False))
|
||||
|
||||
def call_binop(self, context, operator, left, right):
|
||||
"""For intercepted binary operator calls (:meth:`intercepted_binops`)
|
||||
this function is executed instead of the builtin operator. This can
|
||||
be used to fine tune the behavior of certain operators.
|
||||
|
||||
.. versionadded:: 2.6
|
||||
"""
|
||||
return self.binop_table[operator](left, right)
|
||||
|
||||
def call_unop(self, context, operator, arg):
|
||||
"""For intercepted unary operator calls (:meth:`intercepted_unops`)
|
||||
this function is executed instead of the builtin operator. This can
|
||||
be used to fine tune the behavior of certain operators.
|
||||
|
||||
.. versionadded:: 2.6
|
||||
"""
|
||||
return self.unop_table[operator](arg)
|
||||
|
||||
def getitem(self, obj, argument):
|
||||
"""Subscribe an object from sandboxed code."""
|
||||
try:
|
||||
return obj[argument]
|
||||
except (TypeError, LookupError):
|
||||
if isinstance(argument, string_types):
|
||||
try:
|
||||
attr = str(argument)
|
||||
except Exception:
|
||||
pass
|
||||
else:
|
||||
try:
|
||||
value = getattr(obj, attr)
|
||||
except AttributeError:
|
||||
pass
|
||||
else:
|
||||
if self.is_safe_attribute(obj, argument, value):
|
||||
return value
|
||||
return self.unsafe_undefined(obj, argument)
|
||||
return self.undefined(obj=obj, name=argument)
|
||||
|
||||
def getattr(self, obj, attribute):
|
||||
"""Subscribe an object from sandboxed code and prefer the
|
||||
attribute. The attribute passed *must* be a bytestring.
|
||||
"""
|
||||
try:
|
||||
value = getattr(obj, attribute)
|
||||
except AttributeError:
|
||||
try:
|
||||
return obj[attribute]
|
||||
except (TypeError, LookupError):
|
||||
pass
|
||||
else:
|
||||
if self.is_safe_attribute(obj, attribute, value):
|
||||
return value
|
||||
return self.unsafe_undefined(obj, attribute)
|
||||
return self.undefined(obj=obj, name=attribute)
|
||||
|
||||
def unsafe_undefined(self, obj, attribute):
|
||||
"""Return an undefined object for unsafe attributes."""
|
||||
return self.undefined('access to attribute %r of %r '
|
||||
'object is unsafe.' % (
|
||||
attribute,
|
||||
obj.__class__.__name__
|
||||
), name=attribute, obj=obj, exc=SecurityError)
|
||||
|
||||
def call(__self, __context, __obj, *args, **kwargs):
|
||||
"""Call an object from sandboxed code."""
|
||||
# the double prefixes are to avoid double keyword argument
|
||||
# errors when proxying the call.
|
||||
if not __self.is_safe_callable(__obj):
|
||||
raise SecurityError('%r is not safely callable' % (__obj,))
|
||||
return __context.call(__obj, *args, **kwargs)
|
||||
|
||||
|
||||
class ImmutableSandboxedEnvironment(SandboxedEnvironment):
|
||||
"""Works exactly like the regular `SandboxedEnvironment` but does not
|
||||
permit modifications on the builtin mutable objects `list`, `set`, and
|
||||
`dict` by using the :func:`modifies_known_mutable` function.
|
||||
"""
|
||||
|
||||
def is_safe_attribute(self, obj, attr, value):
|
||||
if not SandboxedEnvironment.is_safe_attribute(self, obj, attr, value):
|
||||
return False
|
||||
return not modifies_known_mutable(obj, attr)
|
||||
Vendored
-149
@@ -1,149 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
jinja2.tests
|
||||
~~~~~~~~~~~~
|
||||
|
||||
Jinja test functions. Used with the "is" operator.
|
||||
|
||||
:copyright: (c) 2010 by the Jinja Team.
|
||||
:license: BSD, see LICENSE for more details.
|
||||
"""
|
||||
import re
|
||||
from jinja2.runtime import Undefined
|
||||
from jinja2._compat import text_type, string_types, mapping_types
|
||||
|
||||
|
||||
number_re = re.compile(r'^-?\d+(\.\d+)?$')
|
||||
regex_type = type(number_re)
|
||||
|
||||
|
||||
test_callable = callable
|
||||
|
||||
|
||||
def test_odd(value):
|
||||
"""Return true if the variable is odd."""
|
||||
return value % 2 == 1
|
||||
|
||||
|
||||
def test_even(value):
|
||||
"""Return true if the variable is even."""
|
||||
return value % 2 == 0
|
||||
|
||||
|
||||
def test_divisibleby(value, num):
|
||||
"""Check if a variable is divisible by a number."""
|
||||
return value % num == 0
|
||||
|
||||
|
||||
def test_defined(value):
|
||||
"""Return true if the variable is defined:
|
||||
|
||||
.. sourcecode:: jinja
|
||||
|
||||
{% if variable is defined %}
|
||||
value of variable: {{ variable }}
|
||||
{% else %}
|
||||
variable is not defined
|
||||
{% endif %}
|
||||
|
||||
See the :func:`default` filter for a simple way to set undefined
|
||||
variables.
|
||||
"""
|
||||
return not isinstance(value, Undefined)
|
||||
|
||||
|
||||
def test_undefined(value):
|
||||
"""Like :func:`defined` but the other way round."""
|
||||
return isinstance(value, Undefined)
|
||||
|
||||
|
||||
def test_none(value):
|
||||
"""Return true if the variable is none."""
|
||||
return value is None
|
||||
|
||||
|
||||
def test_lower(value):
|
||||
"""Return true if the variable is lowercased."""
|
||||
return text_type(value).islower()
|
||||
|
||||
|
||||
def test_upper(value):
|
||||
"""Return true if the variable is uppercased."""
|
||||
return text_type(value).isupper()
|
||||
|
||||
|
||||
def test_string(value):
|
||||
"""Return true if the object is a string."""
|
||||
return isinstance(value, string_types)
|
||||
|
||||
|
||||
def test_mapping(value):
|
||||
"""Return true if the object is a mapping (dict etc.).
|
||||
|
||||
.. versionadded:: 2.6
|
||||
"""
|
||||
return isinstance(value, mapping_types)
|
||||
|
||||
|
||||
def test_number(value):
|
||||
"""Return true if the variable is a number."""
|
||||
return isinstance(value, (int, float, complex))
|
||||
|
||||
|
||||
def test_sequence(value):
|
||||
"""Return true if the variable is a sequence. Sequences are variables
|
||||
that are iterable.
|
||||
"""
|
||||
try:
|
||||
len(value)
|
||||
value.__getitem__
|
||||
except:
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
def test_sameas(value, other):
|
||||
"""Check if an object points to the same memory address than another
|
||||
object:
|
||||
|
||||
.. sourcecode:: jinja
|
||||
|
||||
{% if foo.attribute is sameas false %}
|
||||
the foo attribute really is the `False` singleton
|
||||
{% endif %}
|
||||
"""
|
||||
return value is other
|
||||
|
||||
|
||||
def test_iterable(value):
|
||||
"""Check if it's possible to iterate over an object."""
|
||||
try:
|
||||
iter(value)
|
||||
except TypeError:
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
def test_escaped(value):
|
||||
"""Check if the value is escaped."""
|
||||
return hasattr(value, '__html__')
|
||||
|
||||
|
||||
TESTS = {
|
||||
'odd': test_odd,
|
||||
'even': test_even,
|
||||
'divisibleby': test_divisibleby,
|
||||
'defined': test_defined,
|
||||
'undefined': test_undefined,
|
||||
'none': test_none,
|
||||
'lower': test_lower,
|
||||
'upper': test_upper,
|
||||
'string': test_string,
|
||||
'mapping': test_mapping,
|
||||
'number': test_number,
|
||||
'sequence': test_sequence,
|
||||
'iterable': test_iterable,
|
||||
'callable': test_callable,
|
||||
'sameas': test_sameas,
|
||||
'escaped': test_escaped
|
||||
}
|
||||
Vendored
-520
@@ -1,520 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
jinja2.utils
|
||||
~~~~~~~~~~~~
|
||||
|
||||
Utility functions.
|
||||
|
||||
:copyright: (c) 2010 by the Jinja Team.
|
||||
:license: BSD, see LICENSE for more details.
|
||||
"""
|
||||
import re
|
||||
import errno
|
||||
from collections import deque
|
||||
from jinja2._compat import text_type, string_types, implements_iterator, \
|
||||
allocate_lock, url_quote
|
||||
|
||||
|
||||
_word_split_re = re.compile(r'(\s+)')
|
||||
_punctuation_re = re.compile(
|
||||
'^(?P<lead>(?:%s)*)(?P<middle>.*?)(?P<trail>(?:%s)*)$' % (
|
||||
'|'.join(map(re.escape, ('(', '<', '<'))),
|
||||
'|'.join(map(re.escape, ('.', ',', ')', '>', '\n', '>')))
|
||||
)
|
||||
)
|
||||
_simple_email_re = re.compile(r'^\S+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9._-]+$')
|
||||
_striptags_re = re.compile(r'(<!--.*?-->|<[^>]*>)')
|
||||
_entity_re = re.compile(r'&([^;]+);')
|
||||
_letters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
|
||||
_digits = '0123456789'
|
||||
|
||||
# special singleton representing missing values for the runtime
|
||||
missing = type('MissingType', (), {'__repr__': lambda x: 'missing'})()
|
||||
|
||||
# internal code
|
||||
internal_code = set()
|
||||
|
||||
concat = u''.join
|
||||
|
||||
|
||||
def contextfunction(f):
|
||||
"""This decorator can be used to mark a function or method context callable.
|
||||
A context callable is passed the active :class:`Context` as first argument when
|
||||
called from the template. This is useful if a function wants to get access
|
||||
to the context or functions provided on the context object. For example
|
||||
a function that returns a sorted list of template variables the current
|
||||
template exports could look like this::
|
||||
|
||||
@contextfunction
|
||||
def get_exported_names(context):
|
||||
return sorted(context.exported_vars)
|
||||
"""
|
||||
f.contextfunction = True
|
||||
return f
|
||||
|
||||
|
||||
def evalcontextfunction(f):
|
||||
"""This decorator can be used to mark a function or method as an eval
|
||||
context callable. This is similar to the :func:`contextfunction`
|
||||
but instead of passing the context, an evaluation context object is
|
||||
passed. For more information about the eval context, see
|
||||
:ref:`eval-context`.
|
||||
|
||||
.. versionadded:: 2.4
|
||||
"""
|
||||
f.evalcontextfunction = True
|
||||
return f
|
||||
|
||||
|
||||
def environmentfunction(f):
|
||||
"""This decorator can be used to mark a function or method as environment
|
||||
callable. This decorator works exactly like the :func:`contextfunction`
|
||||
decorator just that the first argument is the active :class:`Environment`
|
||||
and not context.
|
||||
"""
|
||||
f.environmentfunction = True
|
||||
return f
|
||||
|
||||
|
||||
def internalcode(f):
|
||||
"""Marks the function as internally used"""
|
||||
internal_code.add(f.__code__)
|
||||
return f
|
||||
|
||||
|
||||
def is_undefined(obj):
|
||||
"""Check if the object passed is undefined. This does nothing more than
|
||||
performing an instance check against :class:`Undefined` but looks nicer.
|
||||
This can be used for custom filters or tests that want to react to
|
||||
undefined variables. For example a custom default filter can look like
|
||||
this::
|
||||
|
||||
def default(var, default=''):
|
||||
if is_undefined(var):
|
||||
return default
|
||||
return var
|
||||
"""
|
||||
from jinja2.runtime import Undefined
|
||||
return isinstance(obj, Undefined)
|
||||
|
||||
|
||||
def consume(iterable):
|
||||
"""Consumes an iterable without doing anything with it."""
|
||||
for event in iterable:
|
||||
pass
|
||||
|
||||
|
||||
def clear_caches():
|
||||
"""Jinja2 keeps internal caches for environments and lexers. These are
|
||||
used so that Jinja2 doesn't have to recreate environments and lexers all
|
||||
the time. Normally you don't have to care about that but if you are
|
||||
messuring memory consumption you may want to clean the caches.
|
||||
"""
|
||||
from jinja2.environment import _spontaneous_environments
|
||||
from jinja2.lexer import _lexer_cache
|
||||
_spontaneous_environments.clear()
|
||||
_lexer_cache.clear()
|
||||
|
||||
|
||||
def import_string(import_name, silent=False):
|
||||
"""Imports an object based on a string. This is useful if you want to
|
||||
use import paths as endpoints or something similar. An import path can
|
||||
be specified either in dotted notation (``xml.sax.saxutils.escape``)
|
||||
or with a colon as object delimiter (``xml.sax.saxutils:escape``).
|
||||
|
||||
If the `silent` is True the return value will be `None` if the import
|
||||
fails.
|
||||
|
||||
:return: imported object
|
||||
"""
|
||||
try:
|
||||
if ':' in import_name:
|
||||
module, obj = import_name.split(':', 1)
|
||||
elif '.' in import_name:
|
||||
items = import_name.split('.')
|
||||
module = '.'.join(items[:-1])
|
||||
obj = items[-1]
|
||||
else:
|
||||
return __import__(import_name)
|
||||
return getattr(__import__(module, None, None, [obj]), obj)
|
||||
except (ImportError, AttributeError):
|
||||
if not silent:
|
||||
raise
|
||||
|
||||
|
||||
def open_if_exists(filename, mode='rb'):
|
||||
"""Returns a file descriptor for the filename if that file exists,
|
||||
otherwise `None`.
|
||||
"""
|
||||
try:
|
||||
return open(filename, mode)
|
||||
except IOError as e:
|
||||
if e.errno not in (errno.ENOENT, errno.EISDIR):
|
||||
raise
|
||||
|
||||
|
||||
def object_type_repr(obj):
|
||||
"""Returns the name of the object's type. For some recognized
|
||||
singletons the name of the object is returned instead. (For
|
||||
example for `None` and `Ellipsis`).
|
||||
"""
|
||||
if obj is None:
|
||||
return 'None'
|
||||
elif obj is Ellipsis:
|
||||
return 'Ellipsis'
|
||||
# __builtin__ in 2.x, builtins in 3.x
|
||||
if obj.__class__.__module__ in ('__builtin__', 'builtins'):
|
||||
name = obj.__class__.__name__
|
||||
else:
|
||||
name = obj.__class__.__module__ + '.' + obj.__class__.__name__
|
||||
return '%s object' % name
|
||||
|
||||
|
||||
def pformat(obj, verbose=False):
|
||||
"""Prettyprint an object. Either use the `pretty` library or the
|
||||
builtin `pprint`.
|
||||
"""
|
||||
try:
|
||||
from pretty import pretty
|
||||
return pretty(obj, verbose=verbose)
|
||||
except ImportError:
|
||||
from pprint import pformat
|
||||
return pformat(obj)
|
||||
|
||||
|
||||
def urlize(text, trim_url_limit=None, nofollow=False):
|
||||
"""Converts any URLs in text into clickable links. Works on http://,
|
||||
https:// and www. links. Links can have trailing punctuation (periods,
|
||||
commas, close-parens) and leading punctuation (opening parens) and
|
||||
it'll still do the right thing.
|
||||
|
||||
If trim_url_limit is not None, the URLs in link text will be limited
|
||||
to trim_url_limit characters.
|
||||
|
||||
If nofollow is True, the URLs in link text will get a rel="nofollow"
|
||||
attribute.
|
||||
"""
|
||||
trim_url = lambda x, limit=trim_url_limit: limit is not None \
|
||||
and (x[:limit] + (len(x) >=limit and '...'
|
||||
or '')) or x
|
||||
words = _word_split_re.split(text_type(escape(text)))
|
||||
nofollow_attr = nofollow and ' rel="nofollow"' or ''
|
||||
for i, word in enumerate(words):
|
||||
match = _punctuation_re.match(word)
|
||||
if match:
|
||||
lead, middle, trail = match.groups()
|
||||
if middle.startswith('www.') or (
|
||||
'@' not in middle and
|
||||
not middle.startswith('http://') and
|
||||
not middle.startswith('https://') and
|
||||
len(middle) > 0 and
|
||||
middle[0] in _letters + _digits and (
|
||||
middle.endswith('.org') or
|
||||
middle.endswith('.net') or
|
||||
middle.endswith('.com')
|
||||
)):
|
||||
middle = '<a href="http://%s"%s>%s</a>' % (middle,
|
||||
nofollow_attr, trim_url(middle))
|
||||
if middle.startswith('http://') or \
|
||||
middle.startswith('https://'):
|
||||
middle = '<a href="%s"%s>%s</a>' % (middle,
|
||||
nofollow_attr, trim_url(middle))
|
||||
if '@' in middle and not middle.startswith('www.') and \
|
||||
not ':' in middle and _simple_email_re.match(middle):
|
||||
middle = '<a href="mailto:%s">%s</a>' % (middle, middle)
|
||||
if lead + middle + trail != word:
|
||||
words[i] = lead + middle + trail
|
||||
return u''.join(words)
|
||||
|
||||
|
||||
def generate_lorem_ipsum(n=5, html=True, min=20, max=100):
|
||||
"""Generate some lorem impsum for the template."""
|
||||
from jinja2.constants import LOREM_IPSUM_WORDS
|
||||
from random import choice, randrange
|
||||
words = LOREM_IPSUM_WORDS.split()
|
||||
result = []
|
||||
|
||||
for _ in range(n):
|
||||
next_capitalized = True
|
||||
last_comma = last_fullstop = 0
|
||||
word = None
|
||||
last = None
|
||||
p = []
|
||||
|
||||
# each paragraph contains out of 20 to 100 words.
|
||||
for idx, _ in enumerate(range(randrange(min, max))):
|
||||
while True:
|
||||
word = choice(words)
|
||||
if word != last:
|
||||
last = word
|
||||
break
|
||||
if next_capitalized:
|
||||
word = word.capitalize()
|
||||
next_capitalized = False
|
||||
# add commas
|
||||
if idx - randrange(3, 8) > last_comma:
|
||||
last_comma = idx
|
||||
last_fullstop += 2
|
||||
word += ','
|
||||
# add end of sentences
|
||||
if idx - randrange(10, 20) > last_fullstop:
|
||||
last_comma = last_fullstop = idx
|
||||
word += '.'
|
||||
next_capitalized = True
|
||||
p.append(word)
|
||||
|
||||
# ensure that the paragraph ends with a dot.
|
||||
p = u' '.join(p)
|
||||
if p.endswith(','):
|
||||
p = p[:-1] + '.'
|
||||
elif not p.endswith('.'):
|
||||
p += '.'
|
||||
result.append(p)
|
||||
|
||||
if not html:
|
||||
return u'\n\n'.join(result)
|
||||
return Markup(u'\n'.join(u'<p>%s</p>' % escape(x) for x in result))
|
||||
|
||||
|
||||
def unicode_urlencode(obj, charset='utf-8'):
|
||||
"""URL escapes a single bytestring or unicode string with the
|
||||
given charset if applicable to URL safe quoting under all rules
|
||||
that need to be considered under all supported Python versions.
|
||||
|
||||
If non strings are provided they are converted to their unicode
|
||||
representation first.
|
||||
"""
|
||||
if not isinstance(obj, string_types):
|
||||
obj = text_type(obj)
|
||||
if isinstance(obj, text_type):
|
||||
obj = obj.encode(charset)
|
||||
return text_type(url_quote(obj))
|
||||
|
||||
|
||||
class LRUCache(object):
|
||||
"""A simple LRU Cache implementation."""
|
||||
|
||||
# this is fast for small capacities (something below 1000) but doesn't
|
||||
# scale. But as long as it's only used as storage for templates this
|
||||
# won't do any harm.
|
||||
|
||||
def __init__(self, capacity):
|
||||
self.capacity = capacity
|
||||
self._mapping = {}
|
||||
self._queue = deque()
|
||||
self._postinit()
|
||||
|
||||
def _postinit(self):
|
||||
# alias all queue methods for faster lookup
|
||||
self._popleft = self._queue.popleft
|
||||
self._pop = self._queue.pop
|
||||
self._remove = self._queue.remove
|
||||
self._wlock = allocate_lock()
|
||||
self._append = self._queue.append
|
||||
|
||||
def __getstate__(self):
|
||||
return {
|
||||
'capacity': self.capacity,
|
||||
'_mapping': self._mapping,
|
||||
'_queue': self._queue
|
||||
}
|
||||
|
||||
def __setstate__(self, d):
|
||||
self.__dict__.update(d)
|
||||
self._postinit()
|
||||
|
||||
def __getnewargs__(self):
|
||||
return (self.capacity,)
|
||||
|
||||
def copy(self):
|
||||
"""Return a shallow copy of the instance."""
|
||||
rv = self.__class__(self.capacity)
|
||||
rv._mapping.update(self._mapping)
|
||||
rv._queue = deque(self._queue)
|
||||
return rv
|
||||
|
||||
def get(self, key, default=None):
|
||||
"""Return an item from the cache dict or `default`"""
|
||||
try:
|
||||
return self[key]
|
||||
except KeyError:
|
||||
return default
|
||||
|
||||
def setdefault(self, key, default=None):
|
||||
"""Set `default` if the key is not in the cache otherwise
|
||||
leave unchanged. Return the value of this key.
|
||||
"""
|
||||
self._wlock.acquire()
|
||||
try:
|
||||
try:
|
||||
return self[key]
|
||||
except KeyError:
|
||||
self[key] = default
|
||||
return default
|
||||
finally:
|
||||
self._wlock.release()
|
||||
|
||||
def clear(self):
|
||||
"""Clear the cache."""
|
||||
self._wlock.acquire()
|
||||
try:
|
||||
self._mapping.clear()
|
||||
self._queue.clear()
|
||||
finally:
|
||||
self._wlock.release()
|
||||
|
||||
def __contains__(self, key):
|
||||
"""Check if a key exists in this cache."""
|
||||
return key in self._mapping
|
||||
|
||||
def __len__(self):
|
||||
"""Return the current size of the cache."""
|
||||
return len(self._mapping)
|
||||
|
||||
def __repr__(self):
|
||||
return '<%s %r>' % (
|
||||
self.__class__.__name__,
|
||||
self._mapping
|
||||
)
|
||||
|
||||
def __getitem__(self, key):
|
||||
"""Get an item from the cache. Moves the item up so that it has the
|
||||
highest priority then.
|
||||
|
||||
Raise a `KeyError` if it does not exist.
|
||||
"""
|
||||
self._wlock.acquire()
|
||||
try:
|
||||
rv = self._mapping[key]
|
||||
if self._queue[-1] != key:
|
||||
try:
|
||||
self._remove(key)
|
||||
except ValueError:
|
||||
# if something removed the key from the container
|
||||
# when we read, ignore the ValueError that we would
|
||||
# get otherwise.
|
||||
pass
|
||||
self._append(key)
|
||||
return rv
|
||||
finally:
|
||||
self._wlock.release()
|
||||
|
||||
def __setitem__(self, key, value):
|
||||
"""Sets the value for an item. Moves the item up so that it
|
||||
has the highest priority then.
|
||||
"""
|
||||
self._wlock.acquire()
|
||||
try:
|
||||
if key in self._mapping:
|
||||
self._remove(key)
|
||||
elif len(self._mapping) == self.capacity:
|
||||
del self._mapping[self._popleft()]
|
||||
self._append(key)
|
||||
self._mapping[key] = value
|
||||
finally:
|
||||
self._wlock.release()
|
||||
|
||||
def __delitem__(self, key):
|
||||
"""Remove an item from the cache dict.
|
||||
Raise a `KeyError` if it does not exist.
|
||||
"""
|
||||
self._wlock.acquire()
|
||||
try:
|
||||
del self._mapping[key]
|
||||
try:
|
||||
self._remove(key)
|
||||
except ValueError:
|
||||
# __getitem__ is not locked, it might happen
|
||||
pass
|
||||
finally:
|
||||
self._wlock.release()
|
||||
|
||||
def items(self):
|
||||
"""Return a list of items."""
|
||||
result = [(key, self._mapping[key]) for key in list(self._queue)]
|
||||
result.reverse()
|
||||
return result
|
||||
|
||||
def iteritems(self):
|
||||
"""Iterate over all items."""
|
||||
return iter(self.items())
|
||||
|
||||
def values(self):
|
||||
"""Return a list of all values."""
|
||||
return [x[1] for x in self.items()]
|
||||
|
||||
def itervalue(self):
|
||||
"""Iterate over all values."""
|
||||
return iter(self.values())
|
||||
|
||||
def keys(self):
|
||||
"""Return a list of all keys ordered by most recent usage."""
|
||||
return list(self)
|
||||
|
||||
def iterkeys(self):
|
||||
"""Iterate over all keys in the cache dict, ordered by
|
||||
the most recent usage.
|
||||
"""
|
||||
return reversed(tuple(self._queue))
|
||||
|
||||
__iter__ = iterkeys
|
||||
|
||||
def __reversed__(self):
|
||||
"""Iterate over the values in the cache dict, oldest items
|
||||
coming first.
|
||||
"""
|
||||
return iter(tuple(self._queue))
|
||||
|
||||
__copy__ = copy
|
||||
|
||||
|
||||
# register the LRU cache as mutable mapping if possible
|
||||
try:
|
||||
from collections import MutableMapping
|
||||
MutableMapping.register(LRUCache)
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
|
||||
@implements_iterator
|
||||
class Cycler(object):
|
||||
"""A cycle helper for templates."""
|
||||
|
||||
def __init__(self, *items):
|
||||
if not items:
|
||||
raise RuntimeError('at least one item has to be provided')
|
||||
self.items = items
|
||||
self.reset()
|
||||
|
||||
def reset(self):
|
||||
"""Resets the cycle."""
|
||||
self.pos = 0
|
||||
|
||||
@property
|
||||
def current(self):
|
||||
"""Returns the current item."""
|
||||
return self.items[self.pos]
|
||||
|
||||
def __next__(self):
|
||||
"""Goes one item ahead and returns it."""
|
||||
rv = self.current
|
||||
self.pos = (self.pos + 1) % len(self.items)
|
||||
return rv
|
||||
|
||||
|
||||
class Joiner(object):
|
||||
"""A joining helper for templates."""
|
||||
|
||||
def __init__(self, sep=u', '):
|
||||
self.sep = sep
|
||||
self.used = False
|
||||
|
||||
def __call__(self):
|
||||
if not self.used:
|
||||
self.used = True
|
||||
return u''
|
||||
return self.sep
|
||||
|
||||
|
||||
# Imported here because that's where it was in the past
|
||||
from .markupsafe import Markup, escape, soft_unicode
|
||||
Vendored
-87
@@ -1,87 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
jinja2.visitor
|
||||
~~~~~~~~~~~~~~
|
||||
|
||||
This module implements a visitor for the nodes.
|
||||
|
||||
:copyright: (c) 2010 by the Jinja Team.
|
||||
:license: BSD.
|
||||
"""
|
||||
from jinja2.nodes import Node
|
||||
|
||||
|
||||
class NodeVisitor(object):
|
||||
"""Walks the abstract syntax tree and call visitor functions for every
|
||||
node found. The visitor functions may return values which will be
|
||||
forwarded by the `visit` method.
|
||||
|
||||
Per default the visitor functions for the nodes are ``'visit_'`` +
|
||||
class name of the node. So a `TryFinally` node visit function would
|
||||
be `visit_TryFinally`. This behavior can be changed by overriding
|
||||
the `get_visitor` function. If no visitor function exists for a node
|
||||
(return value `None`) the `generic_visit` visitor is used instead.
|
||||
"""
|
||||
|
||||
def get_visitor(self, node):
|
||||
"""Return the visitor function for this node or `None` if no visitor
|
||||
exists for this node. In that case the generic visit function is
|
||||
used instead.
|
||||
"""
|
||||
method = 'visit_' + node.__class__.__name__
|
||||
return getattr(self, method, None)
|
||||
|
||||
def visit(self, node, *args, **kwargs):
|
||||
"""Visit a node."""
|
||||
f = self.get_visitor(node)
|
||||
if f is not None:
|
||||
return f(node, *args, **kwargs)
|
||||
return self.generic_visit(node, *args, **kwargs)
|
||||
|
||||
def generic_visit(self, node, *args, **kwargs):
|
||||
"""Called if no explicit visitor function exists for a node."""
|
||||
for node in node.iter_child_nodes():
|
||||
self.visit(node, *args, **kwargs)
|
||||
|
||||
|
||||
class NodeTransformer(NodeVisitor):
|
||||
"""Walks the abstract syntax tree and allows modifications of nodes.
|
||||
|
||||
The `NodeTransformer` will walk the AST and use the return value of the
|
||||
visitor functions to replace or remove the old node. If the return
|
||||
value of the visitor function is `None` the node will be removed
|
||||
from the previous location otherwise it's replaced with the return
|
||||
value. The return value may be the original node in which case no
|
||||
replacement takes place.
|
||||
"""
|
||||
|
||||
def generic_visit(self, node, *args, **kwargs):
|
||||
for field, old_value in node.iter_fields():
|
||||
if isinstance(old_value, list):
|
||||
new_values = []
|
||||
for value in old_value:
|
||||
if isinstance(value, Node):
|
||||
value = self.visit(value, *args, **kwargs)
|
||||
if value is None:
|
||||
continue
|
||||
elif not isinstance(value, Node):
|
||||
new_values.extend(value)
|
||||
continue
|
||||
new_values.append(value)
|
||||
old_value[:] = new_values
|
||||
elif isinstance(old_value, Node):
|
||||
new_node = self.visit(old_value, *args, **kwargs)
|
||||
if new_node is None:
|
||||
delattr(node, field)
|
||||
else:
|
||||
setattr(node, field, new_node)
|
||||
return node
|
||||
|
||||
def visit_list(self, node, *args, **kwargs):
|
||||
"""As transformers may return lists in some places this method
|
||||
can be used to enforce a list as return value.
|
||||
"""
|
||||
rv = self.visit(node, *args, **kwargs)
|
||||
if not isinstance(rv, list):
|
||||
rv = [rv]
|
||||
return rv
|
||||
Vendored
+7
-8
@@ -25,16 +25,13 @@ endif(WIN32 AND NOT MINGW)
|
||||
|
||||
ocv_warnings_disable(CMAKE_C_FLAGS -Wno-implicit-function-declaration -Wno-uninitialized -Wmissing-prototypes
|
||||
-Wno-unused-but-set-parameter -Wmissing-declarations -Wunused -Wshadow
|
||||
-Wsign-compare -Wstrict-overflow)
|
||||
ocv_warnings_disable(CMAKE_C_FLAGS -Wunused-parameter) # clang
|
||||
-Wsign-compare -Wstrict-overflow -Wpointer-compare
|
||||
-Wabsolute-value # clang on Linux
|
||||
-Wimplicit-fallthrough
|
||||
)
|
||||
ocv_warnings_disable(CMAKE_C_FLAGS -Wunused-parameter -Wstrict-prototypes) # clang
|
||||
ocv_warnings_disable(CMAKE_C_FLAGS /wd4013 /wd4018 /wd4101 /wd4244 /wd4267 /wd4715) # vs2005
|
||||
|
||||
if(UNIX)
|
||||
if(CMAKE_COMPILER_IS_GNUCXX OR CV_ICC)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set_target_properties(${JASPER_LIBRARY}
|
||||
PROPERTIES
|
||||
OUTPUT_NAME ${JASPER_LIBRARY}
|
||||
@@ -51,3 +48,5 @@ endif()
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
ocv_install_target(${JASPER_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev)
|
||||
endif()
|
||||
|
||||
ocv_install_3rdparty_licenses(jasper LICENSE README copyright)
|
||||
|
||||
+98
@@ -0,0 +1,98 @@
|
||||
project(${JPEG_LIBRARY} C)
|
||||
|
||||
ocv_warnings_disable(CMAKE_C_FLAGS -Wunused-parameter -Wsign-compare -Wshorten-64-to-32 -Wimplicit-fallthrough)
|
||||
|
||||
set(VERSION_MAJOR 1)
|
||||
set(VERSION_MINOR 5)
|
||||
set(VERSION_REVISION 3)
|
||||
set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REVISION})
|
||||
set(LIBJPEG_TURBO_VERSION_NUMBER 1005003)
|
||||
|
||||
string(TIMESTAMP BUILD "opencv-${OPENCV_VERSION}-libjpeg-turbo")
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
set(BUILD "${BUILD}-debug")
|
||||
endif()
|
||||
|
||||
message(STATUS "libjpeg-turbo: VERSION = ${VERSION}, BUILD = ${BUILD}")
|
||||
|
||||
option(WITH_ARITH_ENC "Include arithmetic encoding support when emulating the libjpeg v6b API/ABI" TRUE)
|
||||
option(WITH_ARITH_DEC "Include arithmetic decoding support when emulating the libjpeg v6b API/ABI" TRUE)
|
||||
|
||||
if(NOT DEFINED SIZEOF_SIZE_T)
|
||||
if(IOS) # Workaround iOS issues
|
||||
set(SIZEOF_SIZE_T "${CMAKE_SIZEOF_VOID_P}")
|
||||
message(STATUS "SIZEOF_SIZE_T = ${SIZEOF_SIZE_T}")
|
||||
else()
|
||||
include(CheckTypeSize)
|
||||
CHECK_TYPE_SIZE("size_t" SIZEOF_SIZE_T)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(BITS_IN_JSAMPLE 8)
|
||||
|
||||
if(WITH_ARITH_ENC)
|
||||
set(C_ARITH_CODING_SUPPORTED 1)
|
||||
endif()
|
||||
|
||||
if(WITH_ARITH_DEC)
|
||||
set(D_ARITH_CODING_SUPPORTED 1)
|
||||
endif()
|
||||
|
||||
set(JPEG_LIB_VERSION 62)
|
||||
|
||||
# OpenCV
|
||||
set(JPEG_LIB_VERSION "${VERSION}-${JPEG_LIB_VERSION}" PARENT_SCOPE)
|
||||
|
||||
if(MSVC)
|
||||
add_definitions(-W3 -wd4996 -wd4018)
|
||||
endif()
|
||||
|
||||
configure_file(jconfig.h.in jconfig.h)
|
||||
configure_file(jconfigint.h.in jconfigint.h)
|
||||
|
||||
include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/src)
|
||||
|
||||
set(JPEG_SOURCES jcapimin.c jcapistd.c jccoefct.c jccolor.c jcdctmgr.c jchuff.c
|
||||
jcinit.c jcmainct.c jcmarker.c jcmaster.c jcomapi.c jcparam.c jcphuff.c
|
||||
jcprepct.c jcsample.c jctrans.c jdapimin.c jdapistd.c jdatadst.c jdatasrc.c
|
||||
jdcoefct.c jdcolor.c jddctmgr.c jdhuff.c jdinput.c jdmainct.c jdmarker.c
|
||||
jdmaster.c jdmerge.c jdphuff.c jdpostct.c jdsample.c jdtrans.c jerror.c
|
||||
jfdctflt.c jfdctfst.c jfdctint.c jidctflt.c jidctfst.c jidctint.c jidctred.c
|
||||
jquant1.c jquant2.c jutils.c jmemmgr.c jmemnobs.c)
|
||||
|
||||
if(WITH_ARITH_ENC OR WITH_ARITH_DEC)
|
||||
set(JPEG_SOURCES ${JPEG_SOURCES} jaricom.c)
|
||||
endif()
|
||||
|
||||
if(WITH_ARITH_ENC)
|
||||
set(JPEG_SOURCES ${JPEG_SOURCES} jcarith.c)
|
||||
endif()
|
||||
|
||||
if(WITH_ARITH_DEC)
|
||||
set(JPEG_SOURCES ${JPEG_SOURCES} jdarith.c)
|
||||
endif()
|
||||
|
||||
# No SIMD
|
||||
set(JPEG_SOURCES ${JPEG_SOURCES} jsimd_none.c)
|
||||
|
||||
ocv_list_add_prefix(JPEG_SOURCES src/)
|
||||
|
||||
add_library(${JPEG_LIBRARY} STATIC ${JPEG_SOURCES} ${SIMD_OBJS})
|
||||
|
||||
set_target_properties(${JPEG_LIBRARY}
|
||||
PROPERTIES OUTPUT_NAME ${JPEG_LIBRARY}
|
||||
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
|
||||
COMPILE_PDB_NAME ${JPEG_LIBRARY}
|
||||
COMPILE_PDB_NAME_DEBUG "${JPEG_LIBRARY}${OPENCV_DEBUG_POSTFIX}"
|
||||
ARCHIVE_OUTPUT_DIRECTORY ${3P_LIBRARY_OUTPUT_PATH}
|
||||
)
|
||||
|
||||
if(ENABLE_SOLUTION_FOLDERS)
|
||||
set_target_properties(${JPEG_LIBRARY} PROPERTIES FOLDER "3rdparty")
|
||||
endif()
|
||||
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
ocv_install_target(${JPEG_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev)
|
||||
endif()
|
||||
|
||||
ocv_install_3rdparty_licenses(libjpeg-turbo README.md LICENSE.md README.ijg)
|
||||
Vendored
+139
@@ -0,0 +1,139 @@
|
||||
libjpeg-turbo Licenses
|
||||
======================
|
||||
|
||||
libjpeg-turbo is covered by three compatible BSD-style open source licenses:
|
||||
|
||||
- The IJG (Independent JPEG Group) License, which is listed in
|
||||
[README.ijg](README.ijg)
|
||||
|
||||
This license applies to the libjpeg API library and associated programs
|
||||
(any code inherited from libjpeg, and any modifications to that code.)
|
||||
|
||||
- The Modified (3-clause) BSD License, which is listed below
|
||||
|
||||
This license covers the TurboJPEG API library and associated programs.
|
||||
|
||||
- The zlib License, which is listed below
|
||||
|
||||
This license is a subset of the other two, and it covers the libjpeg-turbo
|
||||
SIMD extensions.
|
||||
|
||||
|
||||
Complying with the libjpeg-turbo Licenses
|
||||
=========================================
|
||||
|
||||
This section provides a roll-up of the libjpeg-turbo licensing terms, to the
|
||||
best of our understanding.
|
||||
|
||||
1. If you are distributing a modified version of the libjpeg-turbo source,
|
||||
then:
|
||||
|
||||
1. You cannot alter or remove any existing copyright or license notices
|
||||
from the source.
|
||||
|
||||
**Origin**
|
||||
- Clause 1 of the IJG License
|
||||
- Clause 1 of the Modified BSD License
|
||||
- Clauses 1 and 3 of the zlib License
|
||||
|
||||
2. You must add your own copyright notice to the header of each source
|
||||
file you modified, so others can tell that you modified that file (if
|
||||
there is not an existing copyright header in that file, then you can
|
||||
simply add a notice stating that you modified the file.)
|
||||
|
||||
**Origin**
|
||||
- Clause 1 of the IJG License
|
||||
- Clause 2 of the zlib License
|
||||
|
||||
3. You must include the IJG README file, and you must not alter any of the
|
||||
copyright or license text in that file.
|
||||
|
||||
**Origin**
|
||||
- Clause 1 of the IJG License
|
||||
|
||||
2. If you are distributing only libjpeg-turbo binaries without the source, or
|
||||
if you are distributing an application that statically links with
|
||||
libjpeg-turbo, then:
|
||||
|
||||
1. Your product documentation must include a message stating:
|
||||
|
||||
This software is based in part on the work of the Independent JPEG
|
||||
Group.
|
||||
|
||||
**Origin**
|
||||
- Clause 2 of the IJG license
|
||||
|
||||
2. If your binary distribution includes or uses the TurboJPEG API, then
|
||||
your product documentation must include the text of the Modified BSD
|
||||
License.
|
||||
|
||||
**Origin**
|
||||
- Clause 2 of the Modified BSD License
|
||||
|
||||
3. You cannot use the name of the IJG or The libjpeg-turbo Project or the
|
||||
contributors thereof in advertising, publicity, etc.
|
||||
|
||||
**Origin**
|
||||
- IJG License
|
||||
- Clause 3 of the Modified BSD License
|
||||
|
||||
4. The IJG and The libjpeg-turbo Project do not warrant libjpeg-turbo to be
|
||||
free of defects, nor do we accept any liability for undesirable
|
||||
consequences resulting from your use of the software.
|
||||
|
||||
**Origin**
|
||||
- IJG License
|
||||
- Modified BSD License
|
||||
- zlib License
|
||||
|
||||
|
||||
The Modified (3-clause) BSD License
|
||||
===================================
|
||||
|
||||
Copyright (C)\<YEAR\> \<AUTHOR\>. All Rights Reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
- Neither the name of the libjpeg-turbo Project nor the names of its
|
||||
contributors may be used to endorse or promote products derived from this
|
||||
software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS",
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS 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.
|
||||
|
||||
|
||||
The zlib License
|
||||
================
|
||||
|
||||
Copyright (C) \<YEAR\>, \<AUTHOR\>.
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
Vendored
+279
@@ -0,0 +1,279 @@
|
||||
libjpeg-turbo note: This file has been modified by The libjpeg-turbo Project
|
||||
to include only information relevant to libjpeg-turbo, to wordsmith certain
|
||||
sections, and to remove impolitic language that existed in the libjpeg v8
|
||||
README. It is included only for reference. Please see README.md for
|
||||
information specific to libjpeg-turbo.
|
||||
|
||||
|
||||
The Independent JPEG Group's JPEG software
|
||||
==========================================
|
||||
|
||||
This distribution contains a release of the Independent JPEG Group's free JPEG
|
||||
software. You are welcome to redistribute this software and to use it for any
|
||||
purpose, subject to the conditions under LEGAL ISSUES, below.
|
||||
|
||||
This software is the work of Tom Lane, Guido Vollbeding, Philip Gladstone,
|
||||
Bill Allombert, Jim Boucher, Lee Crocker, Bob Friesenhahn, Ben Jackson,
|
||||
Julian Minguillon, Luis Ortiz, George Phillips, Davide Rossi, Ge' Weijers,
|
||||
and other members of the Independent JPEG Group.
|
||||
|
||||
IJG is not affiliated with the ISO/IEC JTC1/SC29/WG1 standards committee
|
||||
(also known as JPEG, together with ITU-T SG16).
|
||||
|
||||
|
||||
DOCUMENTATION ROADMAP
|
||||
=====================
|
||||
|
||||
This file contains the following sections:
|
||||
|
||||
OVERVIEW General description of JPEG and the IJG software.
|
||||
LEGAL ISSUES Copyright, lack of warranty, terms of distribution.
|
||||
REFERENCES Where to learn more about JPEG.
|
||||
ARCHIVE LOCATIONS Where to find newer versions of this software.
|
||||
FILE FORMAT WARS Software *not* to get.
|
||||
TO DO Plans for future IJG releases.
|
||||
|
||||
Other documentation files in the distribution are:
|
||||
|
||||
User documentation:
|
||||
usage.txt Usage instructions for cjpeg, djpeg, jpegtran,
|
||||
rdjpgcom, and wrjpgcom.
|
||||
*.1 Unix-style man pages for programs (same info as usage.txt).
|
||||
wizard.txt Advanced usage instructions for JPEG wizards only.
|
||||
change.log Version-to-version change highlights.
|
||||
Programmer and internal documentation:
|
||||
libjpeg.txt How to use the JPEG library in your own programs.
|
||||
example.c Sample code for calling the JPEG library.
|
||||
structure.txt Overview of the JPEG library's internal structure.
|
||||
coderules.txt Coding style rules --- please read if you contribute code.
|
||||
|
||||
Please read at least usage.txt. Some information can also be found in the JPEG
|
||||
FAQ (Frequently Asked Questions) article. See ARCHIVE LOCATIONS below to find
|
||||
out where to obtain the FAQ article.
|
||||
|
||||
If you want to understand how the JPEG code works, we suggest reading one or
|
||||
more of the REFERENCES, then looking at the documentation files (in roughly
|
||||
the order listed) before diving into the code.
|
||||
|
||||
|
||||
OVERVIEW
|
||||
========
|
||||
|
||||
This package contains C software to implement JPEG image encoding, decoding,
|
||||
and transcoding. JPEG (pronounced "jay-peg") is a standardized compression
|
||||
method for full-color and grayscale images. JPEG's strong suit is compressing
|
||||
photographic images or other types of images that have smooth color and
|
||||
brightness transitions between neighboring pixels. Images with sharp lines or
|
||||
other abrupt features may not compress well with JPEG, and a higher JPEG
|
||||
quality may have to be used to avoid visible compression artifacts with such
|
||||
images.
|
||||
|
||||
JPEG is lossy, meaning that the output pixels are not necessarily identical to
|
||||
the input pixels. However, on photographic content and other "smooth" images,
|
||||
very good compression ratios can be obtained with no visible compression
|
||||
artifacts, and extremely high compression ratios are possible if you are
|
||||
willing to sacrifice image quality (by reducing the "quality" setting in the
|
||||
compressor.)
|
||||
|
||||
This software implements JPEG baseline, extended-sequential, and progressive
|
||||
compression processes. Provision is made for supporting all variants of these
|
||||
processes, although some uncommon parameter settings aren't implemented yet.
|
||||
We have made no provision for supporting the hierarchical or lossless
|
||||
processes defined in the standard.
|
||||
|
||||
We provide a set of library routines for reading and writing JPEG image files,
|
||||
plus two sample applications "cjpeg" and "djpeg", which use the library to
|
||||
perform conversion between JPEG and some other popular image file formats.
|
||||
The library is intended to be reused in other applications.
|
||||
|
||||
In order to support file conversion and viewing software, we have included
|
||||
considerable functionality beyond the bare JPEG coding/decoding capability;
|
||||
for example, the color quantization modules are not strictly part of JPEG
|
||||
decoding, but they are essential for output to colormapped file formats or
|
||||
colormapped displays. These extra functions can be compiled out of the
|
||||
library if not required for a particular application.
|
||||
|
||||
We have also included "jpegtran", a utility for lossless transcoding between
|
||||
different JPEG processes, and "rdjpgcom" and "wrjpgcom", two simple
|
||||
applications for inserting and extracting textual comments in JFIF files.
|
||||
|
||||
The emphasis in designing this software has been on achieving portability and
|
||||
flexibility, while also making it fast enough to be useful. In particular,
|
||||
the software is not intended to be read as a tutorial on JPEG. (See the
|
||||
REFERENCES section for introductory material.) Rather, it is intended to
|
||||
be reliable, portable, industrial-strength code. We do not claim to have
|
||||
achieved that goal in every aspect of the software, but we strive for it.
|
||||
|
||||
We welcome the use of this software as a component of commercial products.
|
||||
No royalty is required, but we do ask for an acknowledgement in product
|
||||
documentation, as described under LEGAL ISSUES.
|
||||
|
||||
|
||||
LEGAL ISSUES
|
||||
============
|
||||
|
||||
In plain English:
|
||||
|
||||
1. We don't promise that this software works. (But if you find any bugs,
|
||||
please let us know!)
|
||||
2. You can use this software for whatever you want. You don't have to pay us.
|
||||
3. You may not pretend that you wrote this software. If you use it in a
|
||||
program, you must acknowledge somewhere in your documentation that
|
||||
you've used the IJG code.
|
||||
|
||||
In legalese:
|
||||
|
||||
The authors make NO WARRANTY or representation, either express or implied,
|
||||
with respect to this software, its quality, accuracy, merchantability, or
|
||||
fitness for a particular purpose. This software is provided "AS IS", and you,
|
||||
its user, assume the entire risk as to its quality and accuracy.
|
||||
|
||||
This software is copyright (C) 1991-2016, Thomas G. Lane, Guido Vollbeding.
|
||||
All Rights Reserved except as specified below.
|
||||
|
||||
Permission is hereby granted to use, copy, modify, and distribute this
|
||||
software (or portions thereof) for any purpose, without fee, subject to these
|
||||
conditions:
|
||||
(1) If any part of the source code for this software is distributed, then this
|
||||
README file must be included, with this copyright and no-warranty notice
|
||||
unaltered; and any additions, deletions, or changes to the original files
|
||||
must be clearly indicated in accompanying documentation.
|
||||
(2) If only executable code is distributed, then the accompanying
|
||||
documentation must state that "this software is based in part on the work of
|
||||
the Independent JPEG Group".
|
||||
(3) Permission for use of this software is granted only if the user accepts
|
||||
full responsibility for any undesirable consequences; the authors accept
|
||||
NO LIABILITY for damages of any kind.
|
||||
|
||||
These conditions apply to any software derived from or based on the IJG code,
|
||||
not just to the unmodified library. If you use our work, you ought to
|
||||
acknowledge us.
|
||||
|
||||
Permission is NOT granted for the use of any IJG author's name or company name
|
||||
in advertising or publicity relating to this software or products derived from
|
||||
it. This software may be referred to only as "the Independent JPEG Group's
|
||||
software".
|
||||
|
||||
We specifically permit and encourage the use of this software as the basis of
|
||||
commercial products, provided that all warranty or liability claims are
|
||||
assumed by the product vendor.
|
||||
|
||||
|
||||
The Unix configuration script "configure" was produced with GNU Autoconf.
|
||||
It is copyright by the Free Software Foundation but is freely distributable.
|
||||
The same holds for its supporting scripts (config.guess, config.sub,
|
||||
ltmain.sh). Another support script, install-sh, is copyright by X Consortium
|
||||
but is also freely distributable.
|
||||
|
||||
The IJG distribution formerly included code to read and write GIF files.
|
||||
To avoid entanglement with the Unisys LZW patent (now expired), GIF reading
|
||||
support has been removed altogether, and the GIF writer has been simplified
|
||||
to produce "uncompressed GIFs". This technique does not use the LZW
|
||||
algorithm; the resulting GIF files are larger than usual, but are readable
|
||||
by all standard GIF decoders.
|
||||
|
||||
We are required to state that
|
||||
"The Graphics Interchange Format(c) is the Copyright property of
|
||||
CompuServe Incorporated. GIF(sm) is a Service Mark property of
|
||||
CompuServe Incorporated."
|
||||
|
||||
|
||||
REFERENCES
|
||||
==========
|
||||
|
||||
We recommend reading one or more of these references before trying to
|
||||
understand the innards of the JPEG software.
|
||||
|
||||
The best short technical introduction to the JPEG compression algorithm is
|
||||
Wallace, Gregory K. "The JPEG Still Picture Compression Standard",
|
||||
Communications of the ACM, April 1991 (vol. 34 no. 4), pp. 30-44.
|
||||
(Adjacent articles in that issue discuss MPEG motion picture compression,
|
||||
applications of JPEG, and related topics.) If you don't have the CACM issue
|
||||
handy, a PDF file containing a revised version of Wallace's article is
|
||||
available at http://www.ijg.org/files/Wallace.JPEG.pdf. The file (actually
|
||||
a preprint for an article that appeared in IEEE Trans. Consumer Electronics)
|
||||
omits the sample images that appeared in CACM, but it includes corrections
|
||||
and some added material. Note: the Wallace article is copyright ACM and IEEE,
|
||||
and it may not be used for commercial purposes.
|
||||
|
||||
A somewhat less technical, more leisurely introduction to JPEG can be found in
|
||||
"The Data Compression Book" by Mark Nelson and Jean-loup Gailly, published by
|
||||
M&T Books (New York), 2nd ed. 1996, ISBN 1-55851-434-1. This book provides
|
||||
good explanations and example C code for a multitude of compression methods
|
||||
including JPEG. It is an excellent source if you are comfortable reading C
|
||||
code but don't know much about data compression in general. The book's JPEG
|
||||
sample code is far from industrial-strength, but when you are ready to look
|
||||
at a full implementation, you've got one here...
|
||||
|
||||
The best currently available description of JPEG is the textbook "JPEG Still
|
||||
Image Data Compression Standard" by William B. Pennebaker and Joan L.
|
||||
Mitchell, published by Van Nostrand Reinhold, 1993, ISBN 0-442-01272-1.
|
||||
Price US$59.95, 638 pp. The book includes the complete text of the ISO JPEG
|
||||
standards (DIS 10918-1 and draft DIS 10918-2).
|
||||
|
||||
The original JPEG standard is divided into two parts, Part 1 being the actual
|
||||
specification, while Part 2 covers compliance testing methods. Part 1 is
|
||||
titled "Digital Compression and Coding of Continuous-tone Still Images,
|
||||
Part 1: Requirements and guidelines" and has document numbers ISO/IEC IS
|
||||
10918-1, ITU-T T.81. Part 2 is titled "Digital Compression and Coding of
|
||||
Continuous-tone Still Images, Part 2: Compliance testing" and has document
|
||||
numbers ISO/IEC IS 10918-2, ITU-T T.83.
|
||||
|
||||
The JPEG standard does not specify all details of an interchangeable file
|
||||
format. For the omitted details we follow the "JFIF" conventions, revision
|
||||
1.02. JFIF 1.02 has been adopted as an Ecma International Technical Report
|
||||
and thus received a formal publication status. It is available as a free
|
||||
download in PDF format from
|
||||
http://www.ecma-international.org/publications/techreports/E-TR-098.htm.
|
||||
A PostScript version of the JFIF document is available at
|
||||
http://www.ijg.org/files/jfif.ps.gz. There is also a plain text version at
|
||||
http://www.ijg.org/files/jfif.txt.gz, but it is missing the figures.
|
||||
|
||||
The TIFF 6.0 file format specification can be obtained by FTP from
|
||||
ftp://ftp.sgi.com/graphics/tiff/TIFF6.ps.gz. The JPEG incorporation scheme
|
||||
found in the TIFF 6.0 spec of 3-June-92 has a number of serious problems.
|
||||
IJG does not recommend use of the TIFF 6.0 design (TIFF Compression tag 6).
|
||||
Instead, we recommend the JPEG design proposed by TIFF Technical Note #2
|
||||
(Compression tag 7). Copies of this Note can be obtained from
|
||||
http://www.ijg.org/files/. It is expected that the next revision
|
||||
of the TIFF spec will replace the 6.0 JPEG design with the Note's design.
|
||||
Although IJG's own code does not support TIFF/JPEG, the free libtiff library
|
||||
uses our library to implement TIFF/JPEG per the Note.
|
||||
|
||||
|
||||
ARCHIVE LOCATIONS
|
||||
=================
|
||||
|
||||
The "official" archive site for this software is www.ijg.org.
|
||||
The most recent released version can always be found there in
|
||||
directory "files".
|
||||
|
||||
The JPEG FAQ (Frequently Asked Questions) article is a source of some
|
||||
general information about JPEG.
|
||||
It is available on the World Wide Web at http://www.faqs.org/faqs/jpeg-faq/
|
||||
and other news.answers archive sites, including the official news.answers
|
||||
archive at rtfm.mit.edu: ftp://rtfm.mit.edu/pub/usenet/news.answers/jpeg-faq/.
|
||||
If you don't have Web or FTP access, send e-mail to mail-server@rtfm.mit.edu
|
||||
with body
|
||||
send usenet/news.answers/jpeg-faq/part1
|
||||
send usenet/news.answers/jpeg-faq/part2
|
||||
|
||||
|
||||
FILE FORMAT WARS
|
||||
================
|
||||
|
||||
The ISO/IEC JTC1/SC29/WG1 standards committee (also known as JPEG, together
|
||||
with ITU-T SG16) currently promotes different formats containing the name
|
||||
"JPEG" which are incompatible with original DCT-based JPEG. IJG therefore does
|
||||
not support these formats (see REFERENCES). Indeed, one of the original
|
||||
reasons for developing this free software was to help force convergence on
|
||||
common, interoperable format standards for JPEG files.
|
||||
Don't use an incompatible file format!
|
||||
(In any case, our decoder will remain capable of reading existing JPEG
|
||||
image files indefinitely.)
|
||||
|
||||
|
||||
TO DO
|
||||
=====
|
||||
|
||||
Please send bug reports, offers of help, etc. to jpeg-info@jpegclub.org.
|
||||
Vendored
+341
@@ -0,0 +1,341 @@
|
||||
Background
|
||||
==========
|
||||
|
||||
libjpeg-turbo is a JPEG image codec that uses SIMD instructions (MMX, SSE2,
|
||||
NEON, AltiVec) to accelerate baseline JPEG compression and decompression on
|
||||
x86, x86-64, ARM, and PowerPC systems. On such systems, libjpeg-turbo is
|
||||
generally 2-6x as fast as libjpeg, all else being equal. On other types of
|
||||
systems, libjpeg-turbo can still outperform libjpeg by a significant amount, by
|
||||
virtue of its highly-optimized Huffman coding routines. In many cases, the
|
||||
performance of libjpeg-turbo rivals that of proprietary high-speed JPEG codecs.
|
||||
|
||||
libjpeg-turbo implements both the traditional libjpeg API as well as the less
|
||||
powerful but more straightforward TurboJPEG API. libjpeg-turbo also features
|
||||
colorspace extensions that allow it to compress from/decompress to 32-bit and
|
||||
big-endian pixel buffers (RGBX, XBGR, etc.), as well as a full-featured Java
|
||||
interface.
|
||||
|
||||
libjpeg-turbo was originally based on libjpeg/SIMD, an MMX-accelerated
|
||||
derivative of libjpeg v6b developed by Miyasaka Masaru. The TigerVNC and
|
||||
VirtualGL projects made numerous enhancements to the codec in 2009, and in
|
||||
early 2010, libjpeg-turbo spun off into an independent project, with the goal
|
||||
of making high-speed JPEG compression/decompression technology available to a
|
||||
broader range of users and developers.
|
||||
|
||||
|
||||
License
|
||||
=======
|
||||
|
||||
libjpeg-turbo is covered by three compatible BSD-style open source licenses.
|
||||
Refer to [LICENSE.md](LICENSE.md) for a roll-up of license terms.
|
||||
|
||||
|
||||
Building libjpeg-turbo
|
||||
======================
|
||||
|
||||
Refer to [BUILDING.md](BUILDING.md) for complete instructions.
|
||||
|
||||
|
||||
Using libjpeg-turbo
|
||||
===================
|
||||
|
||||
libjpeg-turbo includes two APIs that can be used to compress and decompress
|
||||
JPEG images:
|
||||
|
||||
- **TurboJPEG API**<br>
|
||||
This API provides an easy-to-use interface for compressing and decompressing
|
||||
JPEG images in memory. It also provides some functionality that would not be
|
||||
straightforward to achieve using the underlying libjpeg API, such as
|
||||
generating planar YUV images and performing multiple simultaneous lossless
|
||||
transforms on an image. The Java interface for libjpeg-turbo is written on
|
||||
top of the TurboJPEG API.
|
||||
|
||||
- **libjpeg API**<br>
|
||||
This is the de facto industry-standard API for compressing and decompressing
|
||||
JPEG images. It is more difficult to use than the TurboJPEG API but also
|
||||
more powerful. The libjpeg API implementation in libjpeg-turbo is both
|
||||
API/ABI-compatible and mathematically compatible with libjpeg v6b. It can
|
||||
also optionally be configured to be API/ABI-compatible with libjpeg v7 and v8
|
||||
(see below.)
|
||||
|
||||
There is no significant performance advantage to either API when both are used
|
||||
to perform similar operations.
|
||||
|
||||
Colorspace Extensions
|
||||
---------------------
|
||||
|
||||
libjpeg-turbo includes extensions that allow JPEG images to be compressed
|
||||
directly from (and decompressed directly to) buffers that use BGR, BGRX,
|
||||
RGBX, XBGR, and XRGB pixel ordering. This is implemented with ten new
|
||||
colorspace constants:
|
||||
|
||||
JCS_EXT_RGB /* red/green/blue */
|
||||
JCS_EXT_RGBX /* red/green/blue/x */
|
||||
JCS_EXT_BGR /* blue/green/red */
|
||||
JCS_EXT_BGRX /* blue/green/red/x */
|
||||
JCS_EXT_XBGR /* x/blue/green/red */
|
||||
JCS_EXT_XRGB /* x/red/green/blue */
|
||||
JCS_EXT_RGBA /* red/green/blue/alpha */
|
||||
JCS_EXT_BGRA /* blue/green/red/alpha */
|
||||
JCS_EXT_ABGR /* alpha/blue/green/red */
|
||||
JCS_EXT_ARGB /* alpha/red/green/blue */
|
||||
|
||||
Setting `cinfo.in_color_space` (compression) or `cinfo.out_color_space`
|
||||
(decompression) to one of these values will cause libjpeg-turbo to read the
|
||||
red, green, and blue values from (or write them to) the appropriate position in
|
||||
the pixel when compressing from/decompressing to an RGB buffer.
|
||||
|
||||
Your application can check for the existence of these extensions at compile
|
||||
time with:
|
||||
|
||||
#ifdef JCS_EXTENSIONS
|
||||
|
||||
At run time, attempting to use these extensions with a libjpeg implementation
|
||||
that does not support them will result in a "Bogus input colorspace" error.
|
||||
Applications can trap this error in order to test whether run-time support is
|
||||
available for the colorspace extensions.
|
||||
|
||||
When using the RGBX, BGRX, XBGR, and XRGB colorspaces during decompression, the
|
||||
X byte is undefined, and in order to ensure the best performance, libjpeg-turbo
|
||||
can set that byte to whatever value it wishes. If an application expects the X
|
||||
byte to be used as an alpha channel, then it should specify `JCS_EXT_RGBA`,
|
||||
`JCS_EXT_BGRA`, `JCS_EXT_ABGR`, or `JCS_EXT_ARGB`. When these colorspace
|
||||
constants are used, the X byte is guaranteed to be 0xFF, which is interpreted
|
||||
as opaque.
|
||||
|
||||
Your application can check for the existence of the alpha channel colorspace
|
||||
extensions at compile time with:
|
||||
|
||||
#ifdef JCS_ALPHA_EXTENSIONS
|
||||
|
||||
[jcstest.c](jcstest.c), located in the libjpeg-turbo source tree, demonstrates
|
||||
how to check for the existence of the colorspace extensions at compile time and
|
||||
run time.
|
||||
|
||||
libjpeg v7 and v8 API/ABI Emulation
|
||||
-----------------------------------
|
||||
|
||||
With libjpeg v7 and v8, new features were added that necessitated extending the
|
||||
compression and decompression structures. Unfortunately, due to the exposed
|
||||
nature of those structures, extending them also necessitated breaking backward
|
||||
ABI compatibility with previous libjpeg releases. Thus, programs that were
|
||||
built to use libjpeg v7 or v8 did not work with libjpeg-turbo, since it is
|
||||
based on the libjpeg v6b code base. Although libjpeg v7 and v8 are not
|
||||
as widely used as v6b, enough programs (including a few Linux distros) made
|
||||
the switch that there was a demand to emulate the libjpeg v7 and v8 ABIs
|
||||
in libjpeg-turbo. It should be noted, however, that this feature was added
|
||||
primarily so that applications that had already been compiled to use libjpeg
|
||||
v7+ could take advantage of accelerated baseline JPEG encoding/decoding
|
||||
without recompiling. libjpeg-turbo does not claim to support all of the
|
||||
libjpeg v7+ features, nor to produce identical output to libjpeg v7+ in all
|
||||
cases (see below.)
|
||||
|
||||
By passing an argument of `--with-jpeg7` or `--with-jpeg8` to `configure`, or
|
||||
an argument of `-DWITH_JPEG7=1` or `-DWITH_JPEG8=1` to `cmake`, you can build a
|
||||
version of libjpeg-turbo that emulates the libjpeg v7 or v8 ABI, so that
|
||||
programs that are built against libjpeg v7 or v8 can be run with libjpeg-turbo.
|
||||
The following section describes which libjpeg v7+ features are supported and
|
||||
which aren't.
|
||||
|
||||
### Support for libjpeg v7 and v8 Features
|
||||
|
||||
#### Fully supported
|
||||
|
||||
- **libjpeg: IDCT scaling extensions in decompressor**<br>
|
||||
libjpeg-turbo supports IDCT scaling with scaling factors of 1/8, 1/4, 3/8,
|
||||
1/2, 5/8, 3/4, 7/8, 9/8, 5/4, 11/8, 3/2, 13/8, 7/4, 15/8, and 2/1 (only 1/4
|
||||
and 1/2 are SIMD-accelerated.)
|
||||
|
||||
- **libjpeg: Arithmetic coding**
|
||||
|
||||
- **libjpeg: In-memory source and destination managers**<br>
|
||||
See notes below.
|
||||
|
||||
- **cjpeg: Separate quality settings for luminance and chrominance**<br>
|
||||
Note that the libpjeg v7+ API was extended to accommodate this feature only
|
||||
for convenience purposes. It has always been possible to implement this
|
||||
feature with libjpeg v6b (see rdswitch.c for an example.)
|
||||
|
||||
- **cjpeg: 32-bit BMP support**
|
||||
|
||||
- **cjpeg: `-rgb` option**
|
||||
|
||||
- **jpegtran: Lossless cropping**
|
||||
|
||||
- **jpegtran: `-perfect` option**
|
||||
|
||||
- **jpegtran: Forcing width/height when performing lossless crop**
|
||||
|
||||
- **rdjpgcom: `-raw` option**
|
||||
|
||||
- **rdjpgcom: Locale awareness**
|
||||
|
||||
|
||||
#### Not supported
|
||||
|
||||
NOTE: As of this writing, extensive research has been conducted into the
|
||||
usefulness of DCT scaling as a means of data reduction and SmartScale as a
|
||||
means of quality improvement. The reader is invited to peruse the research at
|
||||
<http://www.libjpeg-turbo.org/About/SmartScale> and draw his/her own conclusions,
|
||||
but it is the general belief of our project that these features have not
|
||||
demonstrated sufficient usefulness to justify inclusion in libjpeg-turbo.
|
||||
|
||||
- **libjpeg: DCT scaling in compressor**<br>
|
||||
`cinfo.scale_num` and `cinfo.scale_denom` are silently ignored.
|
||||
There is no technical reason why DCT scaling could not be supported when
|
||||
emulating the libjpeg v7+ API/ABI, but without the SmartScale extension (see
|
||||
below), only scaling factors of 1/2, 8/15, 4/7, 8/13, 2/3, 8/11, 4/5, and
|
||||
8/9 would be available, which is of limited usefulness.
|
||||
|
||||
- **libjpeg: SmartScale**<br>
|
||||
`cinfo.block_size` is silently ignored.
|
||||
SmartScale is an extension to the JPEG format that allows for DCT block
|
||||
sizes other than 8x8. Providing support for this new format would be
|
||||
feasible (particularly without full acceleration.) However, until/unless
|
||||
the format becomes either an official industry standard or, at minimum, an
|
||||
accepted solution in the community, we are hesitant to implement it, as
|
||||
there is no sense of whether or how it might change in the future. It is
|
||||
our belief that SmartScale has not demonstrated sufficient usefulness as a
|
||||
lossless format nor as a means of quality enhancement, and thus our primary
|
||||
interest in providing this feature would be as a means of supporting
|
||||
additional DCT scaling factors.
|
||||
|
||||
- **libjpeg: Fancy downsampling in compressor**<br>
|
||||
`cinfo.do_fancy_downsampling` is silently ignored.
|
||||
This requires the DCT scaling feature, which is not supported.
|
||||
|
||||
- **jpegtran: Scaling**<br>
|
||||
This requires both the DCT scaling and SmartScale features, which are not
|
||||
supported.
|
||||
|
||||
- **Lossless RGB JPEG files**<br>
|
||||
This requires the SmartScale feature, which is not supported.
|
||||
|
||||
### What About libjpeg v9?
|
||||
|
||||
libjpeg v9 introduced yet another field to the JPEG compression structure
|
||||
(`color_transform`), thus making the ABI backward incompatible with that of
|
||||
libjpeg v8. This new field was introduced solely for the purpose of supporting
|
||||
lossless SmartScale encoding. Furthermore, there was actually no reason to
|
||||
extend the API in this manner, as the color transform could have just as easily
|
||||
been activated by way of a new JPEG colorspace constant, thus preserving
|
||||
backward ABI compatibility.
|
||||
|
||||
Our research (see link above) has shown that lossless SmartScale does not
|
||||
generally accomplish anything that can't already be accomplished better with
|
||||
existing, standard lossless formats. Therefore, at this time it is our belief
|
||||
that there is not sufficient technical justification for software projects to
|
||||
upgrade from libjpeg v8 to libjpeg v9, and thus there is not sufficient
|
||||
technical justification for us to emulate the libjpeg v9 ABI.
|
||||
|
||||
In-Memory Source/Destination Managers
|
||||
-------------------------------------
|
||||
|
||||
By default, libjpeg-turbo 1.3 and later includes the `jpeg_mem_src()` and
|
||||
`jpeg_mem_dest()` functions, even when not emulating the libjpeg v8 API/ABI.
|
||||
Previously, it was necessary to build libjpeg-turbo from source with libjpeg v8
|
||||
API/ABI emulation in order to use the in-memory source/destination managers,
|
||||
but several projects requested that those functions be included when emulating
|
||||
the libjpeg v6b API/ABI as well. This allows the use of those functions by
|
||||
programs that need them, without breaking ABI compatibility for programs that
|
||||
don't, and it allows those functions to be provided in the "official"
|
||||
libjpeg-turbo binaries.
|
||||
|
||||
Those who are concerned about maintaining strict conformance with the libjpeg
|
||||
v6b or v7 API can pass an argument of `--without-mem-srcdst` to `configure` or
|
||||
an argument of `-DWITH_MEM_SRCDST=0` to `cmake` prior to building
|
||||
libjpeg-turbo. This will restore the pre-1.3 behavior, in which
|
||||
`jpeg_mem_src()` and `jpeg_mem_dest()` are only included when emulating the
|
||||
libjpeg v8 API/ABI.
|
||||
|
||||
On Un*x systems, including the in-memory source/destination managers changes
|
||||
the dynamic library version from 62.1.0 to 62.2.0 if using libjpeg v6b API/ABI
|
||||
emulation and from 7.1.0 to 7.2.0 if using libjpeg v7 API/ABI emulation.
|
||||
|
||||
Note that, on most Un*x systems, the dynamic linker will not look for a
|
||||
function in a library until that function is actually used. Thus, if a program
|
||||
is built against libjpeg-turbo 1.3+ and uses `jpeg_mem_src()` or
|
||||
`jpeg_mem_dest()`, that program will not fail if run against an older version
|
||||
of libjpeg-turbo or against libjpeg v7- until the program actually tries to
|
||||
call `jpeg_mem_src()` or `jpeg_mem_dest()`. Such is not the case on Windows.
|
||||
If a program is built against the libjpeg-turbo 1.3+ DLL and uses
|
||||
`jpeg_mem_src()` or `jpeg_mem_dest()`, then it must use the libjpeg-turbo 1.3+
|
||||
DLL at run time.
|
||||
|
||||
Both cjpeg and djpeg have been extended to allow testing the in-memory
|
||||
source/destination manager functions. See their respective man pages for more
|
||||
details.
|
||||
|
||||
|
||||
Mathematical Compatibility
|
||||
==========================
|
||||
|
||||
For the most part, libjpeg-turbo should produce identical output to libjpeg
|
||||
v6b. The one exception to this is when using the floating point DCT/IDCT, in
|
||||
which case the outputs of libjpeg v6b and libjpeg-turbo can differ for the
|
||||
following reasons:
|
||||
|
||||
- The SSE/SSE2 floating point DCT implementation in libjpeg-turbo is ever so
|
||||
slightly more accurate than the implementation in libjpeg v6b, but not by
|
||||
any amount perceptible to human vision (generally in the range of 0.01 to
|
||||
0.08 dB gain in PNSR.)
|
||||
|
||||
- When not using the SIMD extensions, libjpeg-turbo uses the more accurate
|
||||
(and slightly faster) floating point IDCT algorithm introduced in libjpeg
|
||||
v8a as opposed to the algorithm used in libjpeg v6b. It should be noted,
|
||||
however, that this algorithm basically brings the accuracy of the floating
|
||||
point IDCT in line with the accuracy of the slow integer IDCT. The floating
|
||||
point DCT/IDCT algorithms are mainly a legacy feature, and they do not
|
||||
produce significantly more accuracy than the slow integer algorithms (to put
|
||||
numbers on this, the typical difference in PNSR between the two algorithms
|
||||
is less than 0.10 dB, whereas changing the quality level by 1 in the upper
|
||||
range of the quality scale is typically more like a 1.0 dB difference.)
|
||||
|
||||
- If the floating point algorithms in libjpeg-turbo are not implemented using
|
||||
SIMD instructions on a particular platform, then the accuracy of the
|
||||
floating point DCT/IDCT can depend on the compiler settings.
|
||||
|
||||
While libjpeg-turbo does emulate the libjpeg v8 API/ABI, under the hood it is
|
||||
still using the same algorithms as libjpeg v6b, so there are several specific
|
||||
cases in which libjpeg-turbo cannot be expected to produce the same output as
|
||||
libjpeg v8:
|
||||
|
||||
- When decompressing using scaling factors of 1/2 and 1/4, because libjpeg v8
|
||||
implements those scaling algorithms differently than libjpeg v6b does, and
|
||||
libjpeg-turbo's SIMD extensions are based on the libjpeg v6b behavior.
|
||||
|
||||
- When using chrominance subsampling, because libjpeg v8 implements this
|
||||
with its DCT/IDCT scaling algorithms rather than with a separate
|
||||
downsampling/upsampling algorithm. In our testing, the subsampled/upsampled
|
||||
output of libjpeg v8 is less accurate than that of libjpeg v6b for this
|
||||
reason.
|
||||
|
||||
- When decompressing using a scaling factor > 1 and merged (AKA "non-fancy" or
|
||||
"non-smooth") chrominance upsampling, because libjpeg v8 does not support
|
||||
merged upsampling with scaling factors > 1.
|
||||
|
||||
|
||||
Performance Pitfalls
|
||||
====================
|
||||
|
||||
Restart Markers
|
||||
---------------
|
||||
|
||||
The optimized Huffman decoder in libjpeg-turbo does not handle restart markers
|
||||
in a way that makes the rest of the libjpeg infrastructure happy, so it is
|
||||
necessary to use the slow Huffman decoder when decompressing a JPEG image that
|
||||
has restart markers. This can cause the decompression performance to drop by
|
||||
as much as 20%, but the performance will still be much greater than that of
|
||||
libjpeg. Many consumer packages, such as PhotoShop, use restart markers when
|
||||
generating JPEG images, so images generated by those programs will experience
|
||||
this issue.
|
||||
|
||||
Fast Integer Forward DCT at High Quality Levels
|
||||
-----------------------------------------------
|
||||
|
||||
The algorithm used by the SIMD-accelerated quantization function cannot produce
|
||||
correct results whenever the fast integer forward DCT is used along with a JPEG
|
||||
quality of 98-100. Thus, libjpeg-turbo must use the non-SIMD quantization
|
||||
function in those cases. This causes performance to drop by as much as 40%.
|
||||
It is therefore strongly advised that you use the slow integer forward DCT
|
||||
whenever encoding images with a JPEG quality of 98 or higher.
|
||||
Vendored
+53
@@ -0,0 +1,53 @@
|
||||
/* jconfig.vc --- jconfig.h for Microsoft Visual C++ on Windows 95 or NT. */
|
||||
/* see jconfig.txt for explanations */
|
||||
|
||||
#define JPEG_LIB_VERSION @JPEG_LIB_VERSION@
|
||||
#define LIBJPEG_TURBO_VERSION @VERSION@
|
||||
#define LIBJPEG_TURBO_VERSION_NUMBER @LIBJPEG_TURBO_VERSION_NUMBER@
|
||||
#cmakedefine C_ARITH_CODING_SUPPORTED
|
||||
#cmakedefine D_ARITH_CODING_SUPPORTED
|
||||
#cmakedefine MEM_SRCDST_SUPPORTED
|
||||
|
||||
/*
|
||||
* Define BITS_IN_JSAMPLE as either
|
||||
* 8 for 8-bit sample values (the usual setting)
|
||||
* 12 for 12-bit sample values
|
||||
* Only 8 and 12 are legal data precisions for lossy JPEG according to the
|
||||
* JPEG standard, and the IJG code does not support anything else!
|
||||
* We do not support run-time selection of data precision, sorry.
|
||||
*/
|
||||
|
||||
#define BITS_IN_JSAMPLE @BITS_IN_JSAMPLE@ /* use 8 or 12 */
|
||||
|
||||
#define HAVE_UNSIGNED_CHAR
|
||||
#define HAVE_UNSIGNED_SHORT
|
||||
/* #define void char */
|
||||
/* #define const */
|
||||
#undef __CHAR_UNSIGNED__
|
||||
#define HAVE_STDDEF_H
|
||||
#define HAVE_STDLIB_H
|
||||
#undef NEED_BSD_STRINGS
|
||||
#undef NEED_SYS_TYPES_H
|
||||
#undef NEED_FAR_POINTERS /* we presume a 32-bit flat memory model */
|
||||
#undef INCOMPLETE_TYPES_BROKEN
|
||||
|
||||
/* Define "boolean" as unsigned char, not int, per Windows custom */
|
||||
#ifndef __RPCNDR_H__ /* don't conflict if rpcndr.h already read */
|
||||
typedef unsigned char boolean;
|
||||
#endif
|
||||
#define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */
|
||||
|
||||
/* Define "INT32" as int, not long, per Windows custom */
|
||||
#if !(defined(_BASETSD_H_) || defined(_BASETSD_H)) /* don't conflict if basetsd.h already read */
|
||||
typedef short INT16;
|
||||
typedef signed int INT32;
|
||||
#endif
|
||||
#define XMD_H /* prevent jmorecfg.h from redefining it */
|
||||
|
||||
#ifdef JPEG_INTERNALS
|
||||
|
||||
#undef RIGHT_SHIFT_IS_UNSIGNED
|
||||
|
||||
#define SIZEOF_SIZE_T @SIZEOF_SIZE_T@
|
||||
|
||||
#endif /* JPEG_INTERNALS */
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
#define VERSION "@VERSION@"
|
||||
#define BUILD "@BUILD@"
|
||||
#define PACKAGE_NAME "@CMAKE_PROJECT_NAME@"
|
||||
|
||||
#ifndef INLINE
|
||||
#if defined(__GNUC__)
|
||||
#define INLINE inline __attribute__((always_inline))
|
||||
#elif defined(_MSC_VER)
|
||||
#define INLINE __forceinline
|
||||
#else
|
||||
#define INLINE
|
||||
#endif
|
||||
#endif
|
||||
Vendored
+156
@@ -0,0 +1,156 @@
|
||||
/*
|
||||
* jaricom.c
|
||||
*
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Developed 1997-2009 by Guido Vollbeding.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2015, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
* This file contains probability estimation tables for common use in
|
||||
* arithmetic entropy encoding and decoding routines.
|
||||
*
|
||||
* This data represents Table D.2 in the JPEG spec (ISO/IEC IS 10918-1
|
||||
* and CCITT Recommendation ITU-T T.81) and Table 24 in the JBIG spec
|
||||
* (ISO/IEC IS 11544 and CCITT Recommendation ITU-T T.82).
|
||||
*/
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
|
||||
/* The following #define specifies the packing of the four components
|
||||
* into the compact JLONG representation.
|
||||
* Note that this formula must match the actual arithmetic encoder
|
||||
* and decoder implementation. The implementation has to be changed
|
||||
* if this formula is changed.
|
||||
* The current organization is leaned on Markus Kuhn's JBIG
|
||||
* implementation (jbig_tab.c).
|
||||
*/
|
||||
|
||||
#define V(i,a,b,c,d) (((JLONG)a << 16) | ((JLONG)c << 8) | ((JLONG)d << 7) | b)
|
||||
|
||||
const JLONG jpeg_aritab[113+1] = {
|
||||
/*
|
||||
* Index, Qe_Value, Next_Index_LPS, Next_Index_MPS, Switch_MPS
|
||||
*/
|
||||
V( 0, 0x5a1d, 1, 1, 1 ),
|
||||
V( 1, 0x2586, 14, 2, 0 ),
|
||||
V( 2, 0x1114, 16, 3, 0 ),
|
||||
V( 3, 0x080b, 18, 4, 0 ),
|
||||
V( 4, 0x03d8, 20, 5, 0 ),
|
||||
V( 5, 0x01da, 23, 6, 0 ),
|
||||
V( 6, 0x00e5, 25, 7, 0 ),
|
||||
V( 7, 0x006f, 28, 8, 0 ),
|
||||
V( 8, 0x0036, 30, 9, 0 ),
|
||||
V( 9, 0x001a, 33, 10, 0 ),
|
||||
V( 10, 0x000d, 35, 11, 0 ),
|
||||
V( 11, 0x0006, 9, 12, 0 ),
|
||||
V( 12, 0x0003, 10, 13, 0 ),
|
||||
V( 13, 0x0001, 12, 13, 0 ),
|
||||
V( 14, 0x5a7f, 15, 15, 1 ),
|
||||
V( 15, 0x3f25, 36, 16, 0 ),
|
||||
V( 16, 0x2cf2, 38, 17, 0 ),
|
||||
V( 17, 0x207c, 39, 18, 0 ),
|
||||
V( 18, 0x17b9, 40, 19, 0 ),
|
||||
V( 19, 0x1182, 42, 20, 0 ),
|
||||
V( 20, 0x0cef, 43, 21, 0 ),
|
||||
V( 21, 0x09a1, 45, 22, 0 ),
|
||||
V( 22, 0x072f, 46, 23, 0 ),
|
||||
V( 23, 0x055c, 48, 24, 0 ),
|
||||
V( 24, 0x0406, 49, 25, 0 ),
|
||||
V( 25, 0x0303, 51, 26, 0 ),
|
||||
V( 26, 0x0240, 52, 27, 0 ),
|
||||
V( 27, 0x01b1, 54, 28, 0 ),
|
||||
V( 28, 0x0144, 56, 29, 0 ),
|
||||
V( 29, 0x00f5, 57, 30, 0 ),
|
||||
V( 30, 0x00b7, 59, 31, 0 ),
|
||||
V( 31, 0x008a, 60, 32, 0 ),
|
||||
V( 32, 0x0068, 62, 33, 0 ),
|
||||
V( 33, 0x004e, 63, 34, 0 ),
|
||||
V( 34, 0x003b, 32, 35, 0 ),
|
||||
V( 35, 0x002c, 33, 9, 0 ),
|
||||
V( 36, 0x5ae1, 37, 37, 1 ),
|
||||
V( 37, 0x484c, 64, 38, 0 ),
|
||||
V( 38, 0x3a0d, 65, 39, 0 ),
|
||||
V( 39, 0x2ef1, 67, 40, 0 ),
|
||||
V( 40, 0x261f, 68, 41, 0 ),
|
||||
V( 41, 0x1f33, 69, 42, 0 ),
|
||||
V( 42, 0x19a8, 70, 43, 0 ),
|
||||
V( 43, 0x1518, 72, 44, 0 ),
|
||||
V( 44, 0x1177, 73, 45, 0 ),
|
||||
V( 45, 0x0e74, 74, 46, 0 ),
|
||||
V( 46, 0x0bfb, 75, 47, 0 ),
|
||||
V( 47, 0x09f8, 77, 48, 0 ),
|
||||
V( 48, 0x0861, 78, 49, 0 ),
|
||||
V( 49, 0x0706, 79, 50, 0 ),
|
||||
V( 50, 0x05cd, 48, 51, 0 ),
|
||||
V( 51, 0x04de, 50, 52, 0 ),
|
||||
V( 52, 0x040f, 50, 53, 0 ),
|
||||
V( 53, 0x0363, 51, 54, 0 ),
|
||||
V( 54, 0x02d4, 52, 55, 0 ),
|
||||
V( 55, 0x025c, 53, 56, 0 ),
|
||||
V( 56, 0x01f8, 54, 57, 0 ),
|
||||
V( 57, 0x01a4, 55, 58, 0 ),
|
||||
V( 58, 0x0160, 56, 59, 0 ),
|
||||
V( 59, 0x0125, 57, 60, 0 ),
|
||||
V( 60, 0x00f6, 58, 61, 0 ),
|
||||
V( 61, 0x00cb, 59, 62, 0 ),
|
||||
V( 62, 0x00ab, 61, 63, 0 ),
|
||||
V( 63, 0x008f, 61, 32, 0 ),
|
||||
V( 64, 0x5b12, 65, 65, 1 ),
|
||||
V( 65, 0x4d04, 80, 66, 0 ),
|
||||
V( 66, 0x412c, 81, 67, 0 ),
|
||||
V( 67, 0x37d8, 82, 68, 0 ),
|
||||
V( 68, 0x2fe8, 83, 69, 0 ),
|
||||
V( 69, 0x293c, 84, 70, 0 ),
|
||||
V( 70, 0x2379, 86, 71, 0 ),
|
||||
V( 71, 0x1edf, 87, 72, 0 ),
|
||||
V( 72, 0x1aa9, 87, 73, 0 ),
|
||||
V( 73, 0x174e, 72, 74, 0 ),
|
||||
V( 74, 0x1424, 72, 75, 0 ),
|
||||
V( 75, 0x119c, 74, 76, 0 ),
|
||||
V( 76, 0x0f6b, 74, 77, 0 ),
|
||||
V( 77, 0x0d51, 75, 78, 0 ),
|
||||
V( 78, 0x0bb6, 77, 79, 0 ),
|
||||
V( 79, 0x0a40, 77, 48, 0 ),
|
||||
V( 80, 0x5832, 80, 81, 1 ),
|
||||
V( 81, 0x4d1c, 88, 82, 0 ),
|
||||
V( 82, 0x438e, 89, 83, 0 ),
|
||||
V( 83, 0x3bdd, 90, 84, 0 ),
|
||||
V( 84, 0x34ee, 91, 85, 0 ),
|
||||
V( 85, 0x2eae, 92, 86, 0 ),
|
||||
V( 86, 0x299a, 93, 87, 0 ),
|
||||
V( 87, 0x2516, 86, 71, 0 ),
|
||||
V( 88, 0x5570, 88, 89, 1 ),
|
||||
V( 89, 0x4ca9, 95, 90, 0 ),
|
||||
V( 90, 0x44d9, 96, 91, 0 ),
|
||||
V( 91, 0x3e22, 97, 92, 0 ),
|
||||
V( 92, 0x3824, 99, 93, 0 ),
|
||||
V( 93, 0x32b4, 99, 94, 0 ),
|
||||
V( 94, 0x2e17, 93, 86, 0 ),
|
||||
V( 95, 0x56a8, 95, 96, 1 ),
|
||||
V( 96, 0x4f46, 101, 97, 0 ),
|
||||
V( 97, 0x47e5, 102, 98, 0 ),
|
||||
V( 98, 0x41cf, 103, 99, 0 ),
|
||||
V( 99, 0x3c3d, 104, 100, 0 ),
|
||||
V( 100, 0x375e, 99, 93, 0 ),
|
||||
V( 101, 0x5231, 105, 102, 0 ),
|
||||
V( 102, 0x4c0f, 106, 103, 0 ),
|
||||
V( 103, 0x4639, 107, 104, 0 ),
|
||||
V( 104, 0x415e, 103, 99, 0 ),
|
||||
V( 105, 0x5627, 105, 106, 1 ),
|
||||
V( 106, 0x50e7, 108, 107, 0 ),
|
||||
V( 107, 0x4b85, 109, 103, 0 ),
|
||||
V( 108, 0x5597, 110, 109, 0 ),
|
||||
V( 109, 0x504f, 111, 107, 0 ),
|
||||
V( 110, 0x5a10, 110, 111, 1 ),
|
||||
V( 111, 0x5522, 112, 109, 0 ),
|
||||
V( 112, 0x59eb, 112, 111, 1 ),
|
||||
/*
|
||||
* This last entry is used for fixed probability estimate of 0.5
|
||||
* as recommended in Section 10.3 Table 5 of ITU-T Rec. T.851.
|
||||
*/
|
||||
V( 113, 0x5a1d, 113, 113, 0 )
|
||||
};
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user