Compare commits
932 Commits
stable-1.0
...
main
Author | SHA1 | Date |
---|---|---|
Ryan C. Gordon | 9266e773d3 | |
Ryan C. Gordon | fdd38a3f8a | |
Ryan C. Gordon | 6a7625cd77 | |
Ozkan Sezer | 49662cd826 | |
Ryan C. Gordon | 4d9bcc3d1a | |
Ryan C. Gordon | 496817a9e8 | |
Ozkan Sezer | 0d4e9aac45 | |
Ozkan Sezer | 65195f9c1a | |
Ozkan Sezer | fb0901b10f | |
Ryan C. Gordon | f0c7367b0f | |
Ozkan Sezer | e32221a104 | |
Ozkan Sezer | cfbbb255a2 | |
Anonymous Maarten | 2a90b1f469 | |
Anonymous Maarten | 88ef84c053 | |
Anonymous Maarten | 9bc66b6469 | |
Anonymous Maarten | aabb732caf | |
Ryan C. Gordon | 6925c1067d | |
Ryan C. Gordon | 64807353df | |
Ryan C. Gordon | ed4ab15524 | |
Ryan C. Gordon | 48e7c2e3af | |
Ryan C. Gordon | 497934818b | |
Ryan C. Gordon | 17b691b0ea | |
Ozkan Sezer | 14691399cd | |
Ozkan Sezer | 20e90ed3c4 | |
Ozkan Sezer | eec3f7f79a | |
Ryan C. Gordon | 3a3c552e50 | |
Ryan C. Gordon | b975bb679b | |
Ozkan Sezer | 0ae9467685 | |
Ozkan Sezer | cd2e055454 | |
Ozkan Sezer | 141dccb087 | |
Ozkan Sezer | 3abe069870 | |
Ozkan Sezer | 02b6a7f084 | |
Ryan C. Gordon | 045ee2cb7f | |
Ryan C. Gordon | a329a35993 | |
Semphris | 7305ee92a2 | |
past-due | a0dfe220ff | |
alfadur | b3cca6a026 | |
alfadur | 8eab55d173 | |
Arthur Brianville (Ybalrid) | 23690f316d | |
pastdue | b8fa8fdcac | |
pastdue | a9cb20772b | |
James Le Cuirot | d8ba1a935c | |
Ryan C. Gordon | 0145431345 | |
Ryan C. Gordon | b7410d673e | |
Ryan C. Gordon | fdf308fa88 | |
Matthew Albrecht | d24ce15922 | |
Ryan C. Gordon | 69a7428787 | |
Ryan C. Gordon | ebe02ceb02 | |
Ryan C. Gordon | 9b83066716 | |
Ryan C. Gordon | 13f00546a9 | |
Ryan C. Gordon | 5ea6ba7557 | |
Ryan C. Gordon | 009be5ab20 | |
Ryan C. Gordon | 55c3d9f9d8 | |
Ryan C. Gordon | 22297e7ea2 | |
Ryan C. Gordon | 00599b7dac | |
Ryan C. Gordon | 3169a5e9d3 | |
Ryan C. Gordon | 101ec3c831 | |
Ryan C. Gordon | e3231d1cb0 | |
Ryan C. Gordon | 9d61fadd3e | |
Ryan C. Gordon | 235e31c420 | |
Ryan C. Gordon | 291cad07b7 | |
Ryan C. Gordon | 0d1df744ba | |
Ryan C. Gordon | 08dc47a72b | |
Ryan C. Gordon | 1daf787fb2 | |
Ryan C. Gordon | 56aaae4949 | |
Ryan C. Gordon | 19ea59109d | |
Ryan C. Gordon | a8180f0e4c | |
Ryan C. Gordon | 9cb45dc6cb | |
Kevin d'Orange | 8791811909 | |
Ryan C. Gordon | f94ce0613d | |
Ryan C. Gordon | 6b0839051f | |
Ryan C. Gordon | 5cbb460bcd | |
Ryan C. Gordon | e549fe0e0f | |
Ryan C. Gordon | 736d0b371a | |
Ryan C. Gordon | 28ac5794b1 | |
Ryan C. Gordon | 500033f37d | |
Ryan C. Gordon | b57d8960e8 | |
Ryan C. Gordon | 5786a58628 | |
Ryan C. Gordon | 73d66441e3 | |
Ryan C. Gordon | 7d194a8a62 | |
Ryan C. Gordon | 8ce294a458 | |
Ryan C. Gordon | 15dd00659a | |
Ryan C. Gordon | 7394c07d6b | |
Ryan C. Gordon | 0bad12d401 | |
Ryan C. Gordon | 89d4809f28 | |
Ryan C. Gordon | ea90a92016 | |
Ryan C. Gordon | 3597a7b69a | |
Ryan C. Gordon | c86895264b | |
Ryan C. Gordon | 47b0e834dc | |
Ryan C. Gordon | 90dfc49f6d | |
Ryan C. Gordon | a45afc5d50 | |
Ryan C. Gordon | 62d24e228f | |
Ryan C. Gordon | 26db9376da | |
Ryan C. Gordon | 1c7945461d | |
Ryan C. Gordon | f5e5b586c7 | |
Ryan C. Gordon | fbb8ce7e2d | |
Ryan C. Gordon | 347bb7b6c8 | |
Ryan C. Gordon | 9e756312d5 | |
Ryan C. Gordon | 975b7a577b | |
R?mi Verschelde | 3167a48675 | |
Ryan C. Gordon | bb2c38cdea | |
Ryan C. Gordon | 9b42fe23fd | |
Ryan C. Gordon | 300beeda72 | |
Ryan C. Gordon | 1722e9ba92 | |
Ryan C. Gordon | 4ca60a090b | |
Ryan C. Gordon | 3d8817346d | |
Ryan C. Gordon | 425131ccda | |
Ryan C. Gordon | 2b78f64c11 | |
Ryan C. Gordon | 395b2b02dd | |
Ryan C. Gordon | 69d3df3286 | |
Ryan C. Gordon | 7a26b83733 | |
Francesco Bertolaccini | e728c65912 | |
Marty Plummer | db700fd327 | |
Ryan C. Gordon | 21b2fd39f2 | |
Ryan C. Gordon | bc2ddf0a53 | |
Ryan C. Gordon | 9f8ecb91cb | |
Ryan C. Gordon | eb75883226 | |
Ryan C. Gordon | 689333dc8f | |
Ryan C. Gordon | 6ad71878fe | |
Ryan C. Gordon | 4e0d3d55e9 | |
Ryan C. Gordon | 5fb9119ebc | |
Ryan C. Gordon | 7607eeeb00 | |
Ryan C. Gordon | e19422cc06 | |
Ryan C. Gordon | cd0ccf64ed | |
Ryan C. Gordon | 98278f787b | |
Ryan C. Gordon | 2270b3c3c2 | |
Ryan C. Gordon | b311ee44ad | |
Ryan C. Gordon | 735fd14ea4 | |
Ryan C. Gordon | 8dfd3cff8d | |
Ryan C. Gordon | 692d5e8219 | |
Ryan C. Gordon | a65a7ed7a5 | |
Ryan C. Gordon | 0d1a73fce4 | |
Ryan C. Gordon | 395ea71990 | |
Ryan C. Gordon | 660171f79f | |
Ryan C. Gordon | f425f051db | |
Ryan C. Gordon | 8db27a1236 | |
Ryan C. Gordon | cfe3f0180b | |
Ryan C. Gordon | 3b7ee3974c | |
Ryan C. Gordon | 63277e500c | |
Ryan C. Gordon | 3078acd1eb | |
Ryan C. Gordon | 2a6215394b | |
Ryan C. Gordon | 88e7f3eb0f | |
Ryan C. Gordon | 9c9325c2c5 | |
Ryan C. Gordon | dd68246737 | |
Ryan C. Gordon | 1364f6a915 | |
Ryan C. Gordon | 0d61295781 | |
Ryan C. Gordon | cc3ac9539e | |
Ryan C. Gordon | 7fcddfb741 | |
Ryan C. Gordon | 6da5bea804 | |
Ryan C. Gordon | f6a8533ba2 | |
Ryan C. Gordon | db2201e4e1 | |
Ryan C. Gordon | ee9687bca9 | |
Ryan C. Gordon | b082bc3432 | |
Ryan C. Gordon | 78c1a985ec | |
Ryan C. Gordon | 15048fbb1d | |
Ryan C. Gordon | d1f2637ca8 | |
Ryan C. Gordon | 587ec88a0d | |
Ryan C. Gordon | 1efdb62a8f | |
Ryan C. Gordon | 0e778b0b16 | |
Ryan C. Gordon | 961c0604dc | |
Ryan C. Gordon | c52be25d1e | |
Ryan C. Gordon | 982411ec8a | |
Ryan C. Gordon | 0a730433ae | |
Ryan C. Gordon | ca4d5be5f8 | |
Ryan C. Gordon | eb46d82500 | |
Ryan C. Gordon | af555317b9 | |
Ryan C. Gordon | f0eb5c0db9 | |
Ryan C. Gordon | 0287160f3c | |
Ryan C. Gordon | 1d6c519c5e | |
Ryan C. Gordon | 2176364a16 | |
Ryan C. Gordon | 36c51d40d1 | |
Ryan C. Gordon | 114bfd1b21 | |
Ryan C. Gordon | a7ce178eec | |
Ryan C. Gordon | 121ee38fde | |
Ryan C. Gordon | 61bdee4d78 | |
Ryan C. Gordon | 248167af40 | |
Ryan C. Gordon | be9bf023d0 | |
Ryan C. Gordon | befc894b1f | |
Ryan C. Gordon | b6e139fc22 | |
Ryan C. Gordon | 0d249cae36 | |
Ryan C. Gordon | cc2c29b207 | |
Ryan C. Gordon | 093dcb555b | |
Ryan C. Gordon | 3f9ffddc83 | |
Ryan C. Gordon | 1e850d32ea | |
Ryan C. Gordon | 007c2fc037 | |
Ryan C. Gordon | bea510def0 | |
Ryan C. Gordon | 02c2c4736e | |
Ryan C. Gordon | 5ab8df339d | |
Ryan C. Gordon | 32930ef41d | |
Ryan C. Gordon | 99992bb1d5 | |
Ryan C. Gordon | 0e7f3ee6a1 | |
Ryan C. Gordon | f578f85557 | |
Ryan C. Gordon | 1e2650b6fc | |
Ryan C. Gordon | c74f4cb007 | |
Ryan C. Gordon | a5461ddcd9 | |
Ryan C. Gordon | 8c13bd27d6 | |
Ryan C. Gordon | bc28fb74b4 | |
Ryan C. Gordon | e2750bff62 | |
Ryan C. Gordon | 6d91dde273 | |
Ryan C. Gordon | 1fa4be6f66 | |
Ryan C. Gordon | f10b861036 | |
Ryan C. Gordon | e75d38adf5 | |
Ryan C. Gordon | ea29339a8b | |
Ryan C. Gordon | db349bd067 | |
Ryan C. Gordon | 18c89c1cbc | |
Ryan C. Gordon | d9f040cb6a | |
Ryan C. Gordon | ace324cdc8 | |
Ryan C. Gordon | c1defd3ec4 | |
Ryan C. Gordon | eefc757398 | |
Ryan C. Gordon | 6ed2bf1478 | |
Ryan C. Gordon | 8ee7f5d351 | |
Ryan C. Gordon | a7616f3960 | |
Ryan C. Gordon | 03097332ca | |
Ryan C. Gordon | 3c9351c0ad | |
Ryan C. Gordon | 91a19982ca | |
Ryan C. Gordon | 2dd3d7c28a | |
Ryan C. Gordon | d3ac612b61 | |
Ryan C. Gordon | 32ed71db48 | |
Ryan C. Gordon | 7e30657f54 | |
Ryan C. Gordon | adb7ea4dfc | |
Ryan C. Gordon | 28f32ad240 | |
Ryan C. Gordon | 823061758b | |
Ryan C. Gordon | f130714e92 | |
Ryan C. Gordon | 0bda50c276 | |
Ryan C. Gordon | 1d616dcaf1 | |
Ryan C. Gordon | 4557dbf0f7 | |
Ryan C. Gordon | 7ab5cc52ce | |
Ryan C. Gordon | f6c830968c | |
Ryan C. Gordon | 3765efb652 | |
Ryan C. Gordon | 8ebecded22 | |
Ryan C. Gordon | a28a01c124 | |
Ryan C. Gordon | 8553113870 | |
Ryan C. Gordon | 7fed370cfd | |
Ryan C. Gordon | 43f8ffcd2d | |
Ryan C. Gordon | afacf0395e | |
Ryan C. Gordon | d38c10dea7 | |
Ryan C. Gordon | f83e36a8be | |
Ryan C. Gordon | c375504463 | |
Ryan C. Gordon | cdba81f5c4 | |
Ryan C. Gordon | 8c3501491c | |
Ryan C. Gordon | 6d42436270 | |
Ryan C. Gordon | 820109cc1d | |
Ryan C. Gordon | da1561a09f | |
Ryan C. Gordon | a5d3dd498e | |
Ryan C. Gordon | 63de092cb7 | |
Ryan C. Gordon | e84277a1df | |
Ryan C. Gordon | de444a9866 | |
Ryan C. Gordon | 62ad133862 | |
Ryan C. Gordon | ffa1836335 | |
Ryan C. Gordon | 56bddb0b78 | |
Ryan C. Gordon | 5afd9754e2 | |
Ryan C. Gordon | 9cec66be3e | |
Ryan C. Gordon | 53225ca62c | |
Ryan C. Gordon | 1bacc6d6af | |
Ryan C. Gordon | bf9999af2d | |
Ryan C. Gordon | 4438fe14cf | |
Ryan C. Gordon | a25569ba14 | |
Ryan C. Gordon | efd71e08f6 | |
Ryan C. Gordon | a681fe258d | |
Ryan C. Gordon | 187d04ae9e | |
Ryan C. Gordon | 46db289145 | |
Ryan C. Gordon | 19b15d34a1 | |
Ryan C. Gordon | 2cb1f73737 | |
Ryan C. Gordon | 9ae6fc9e87 | |
Ryan C. Gordon | 4b2180dd17 | |
Ryan C. Gordon | 5f5eca8d01 | |
Ryan C. Gordon | 0f514bbae3 | |
Ryan C. Gordon | 68ad1fa8c5 | |
Ryan C. Gordon | c2c1c7ac30 | |
Ryan C. Gordon | 0be0e3fd33 | |
Ryan C. Gordon | 73070339a4 | |
Ryan C. Gordon | fe55814681 | |
Ryan C. Gordon | 4ae17a5d60 | |
Ryan C. Gordon | 3b5091ba9f | |
Ryan C. Gordon | f2cbac7479 | |
Ryan C. Gordon | a7f5ebf684 | |
Ryan C. Gordon | ebb00f0520 | |
Ryan C. Gordon | 4015689068 | |
Ryan C. Gordon | 53c81e216a | |
Ryan C. Gordon | 2dbd784cc1 | |
Ryan C. Gordon | 3324ec88a9 | |
Ryan C. Gordon | f5c6383b4b | |
Ryan C. Gordon | cf11d2ec99 | |
Ryan C. Gordon | c057f2d7dd | |
Ryan C. Gordon | 083940aef1 | |
Ryan C. Gordon | ffdc55f1e5 | |
Ryan C. Gordon | f8ed5c6f7e | |
Ryan C. Gordon | e4c035a99f | |
Ryan C. Gordon | 7cb89ce454 | |
Ryan C. Gordon | bae1f440ba | |
Ryan C. Gordon | 84231feb0f | |
Ryan C. Gordon | 3e5f92d756 | |
Ryan C. Gordon | bbd1fd4b38 | |
Ryan C. Gordon | d1f8c9df35 | |
Ryan C. Gordon | e9e0ca81de | |
Ryan C. Gordon | fc1687cc2d | |
Ryan C. Gordon | 35ab010a7b | |
Ryan C. Gordon | 3776e50310 | |
Ryan C. Gordon | 16850b0a9c | |
Ryan C. Gordon | b2e9cbf004 | |
Ryan C. Gordon | 3346eb24c6 | |
Ryan C. Gordon | 59a07020a8 | |
Ryan C. Gordon | d3237eba1f | |
Ryan C. Gordon | 377b420a18 | |
Ryan C. Gordon | 4cbffd39e8 | |
Ryan C. Gordon | 683216def8 | |
Ryan C. Gordon | 9a19eba065 | |
Ryan C. Gordon | 2bd8c33fe5 | |
Ryan C. Gordon | 32da097a55 | |
Ryan C. Gordon | 9aebcff5ba | |
Ryan C. Gordon | 34009cf762 | |
Ryan C. Gordon | d1e40af4e3 | |
Ryan C. Gordon | 062bdc2c5b | |
Ryan C. Gordon | 9ca88e3794 | |
Ryan C. Gordon | 58bca6ae05 | |
Ryan C. Gordon | 15c18b0c04 | |
Francesco Bertolaccini | 4b80422a79 | |
Francesco Bertolaccini | dc5958ec71 | |
Ryan C. Gordon | 656a9b92c0 | |
Francesco Bertolaccini | e4206408e5 | |
Ryan C. Gordon | cf18d4f2c6 | |
Ryan C. Gordon | 468edd80eb | |
Ryan C. Gordon | 2777b5efe2 | |
Ryan C. Gordon | 66b7767cec | |
Ryan C. Gordon | ab7eb81a4a | |
Ryan C. Gordon | dfd658ff92 | |
Ryan C. Gordon | e05d1acc76 | |
Ryan C. Gordon | 84f27f8fb5 | |
Ryan C. Gordon | 8363d15439 | |
Ryan C. Gordon | b66b2d4563 | |
David Yip | 51f0807cb3 | |
David Yip | 9293c3dc8d | |
Ryan C. Gordon | c3cc732a70 | |
Ryan C. Gordon | 32d4f4541e | |
Ryan C. Gordon | b479c57bcb | |
Ryan C. Gordon | acd00dda94 | |
Ryan C. Gordon | e608c5c3de | |
Ryan C. Gordon | 0278c30776 | |
Ryan C. Gordon | ce85702893 | |
Ryan C. Gordon | cec3dad0aa | |
Ryan C. Gordon | 2b060f8127 | |
Ryan C. Gordon | c4deb67883 | |
Ryan C. Gordon | 57bbcc3eb3 | |
Ryan C. Gordon | 1ab2afda15 | |
Ryan C. Gordon | fb31167e11 | |
Ryan C. Gordon | 6cafcc4bc7 | |
Ryan C. Gordon | 3d38708088 | |
Ryan C. Gordon | e13803c101 | |
Ryan C. Gordon | 0c4d9ec68f | |
Martin Ahrnbom | 9d55f3f099 | |
Ryan C. Gordon | f6a62ecad1 | |
Ryan C. Gordon | c9f40346bc | |
Ryan C. Gordon | 53ef674270 | |
Ryan C. Gordon | 4b906c1e5f | |
Ryan C. Gordon | 628b88f112 | |
Willi Schinmeyer | 9df22f4bf5 | |
Ryan C. Gordon | 2091eccad3 | |
Ryan C. Gordon | 016394067c | |
Ryan C. Gordon | 8e065c08f7 | |
Ryan C. Gordon | 44fb6d5e2d | |
Ryan C. Gordon | 5aa0dae5e2 | |
Ryan C. Gordon | 5dd2cfce35 | |
Ryan C. Gordon | 61d931fecc | |
Ryan C. Gordon | 6d9923706d | |
Ryan C. Gordon | 4046759f61 | |
Ryan C. Gordon | 09baf99aa4 | |
Ryan C. Gordon | 26f5eb481e | |
Ryan C. Gordon | 7a42f7dd41 | |
Ryan C. Gordon | 4eafb44817 | |
Ryan C. Gordon | 2dd99ccbb2 | |
Ryan C. Gordon | f5c746967f | |
Ryan C. Gordon | 36b542ee7f | |
Ryan C. Gordon | 697c31e81b | |
Ryan C. Gordon | 7824a093fb | |
Ryan C. Gordon | ada24e9c5d | |
Ryan C. Gordon | 1ed8bc07c0 | |
Ryan C. Gordon | 16ee8355db | |
Ryan C. Gordon | 259399124a | |
Ryan C. Gordon | e40d80b00f | |
Ryan C. Gordon | 123313c3cd | |
Ryan C. Gordon | 9826c8b073 | |
Ryan C. Gordon | e61ade0062 | |
Ryan C. Gordon | 8156bd219c | |
Ryan C. Gordon | 06edd385fc | |
Ryan C. Gordon | 7be76515a5 | |
Aleksi Nurmi | fd137cba42 | |
Ryan C. Gordon | 7bd05972c7 | |
Ryan C. Gordon | 72430427c8 | |
Ryan C. Gordon | de59afc5a2 | |
Ryan C. Gordon | 1c48a28166 | |
Ryan C. Gordon | 3f212a8a44 | |
Sam Lantinga | 724b71a657 | |
Ryan C. Gordon | 13855849e6 | |
Ryan C. Gordon | 986c40ac6a | |
Ryan C. Gordon | e38b5e9cb7 | |
Ryan C. Gordon | e70c6847a9 | |
Ryan C. Gordon | c59105bd03 | |
Ryan C. Gordon | bbbbb17258 | |
Ryan C. Gordon | 2a4d891ac5 | |
Ryan C. Gordon | 9159717a27 | |
Ryan C. Gordon | 5c18db7fe9 | |
Ryan C. Gordon | 4d9f2534f2 | |
Ryan C. Gordon | 2b39e47fda | |
Ryan C. Gordon | a865b14bec | |
Ryan C. Gordon | 3e750a903f | |
Ryan C. Gordon | 758e5beedb | |
Ryan C. Gordon | 6222a4a92d | |
Ryan C. Gordon | a7383c295f | |
Ryan C. Gordon | 107f07da97 | |
Ryan C. Gordon | 4cfd7277f3 | |
Ryan C. Gordon | b3fbba7af0 | |
Ryan C. Gordon | 716ea0522f | |
Ryan C. Gordon | de54065b31 | |
Ryan C. Gordon | af4bf8419f | |
Ryan C. Gordon | d4a99cc204 | |
Ryan C. Gordon | fed8e331a5 | |
Ryan C. Gordon | 0de337eb75 | |
Ryan C. Gordon | 24aef83ead | |
Ryan C. Gordon | b2e6882f52 | |
Ryan C. Gordon | 14d723c316 | |
Ryan C. Gordon | dda627412c | |
Ryan C. Gordon | 2392ca1aa3 | |
Ryan C. Gordon | 9d01a645ed | |
Ryan C. Gordon | c306437ece | |
Ryan C. Gordon | a6ff95c6aa | |
Ryan C. Gordon | 0360899357 | |
Ryan C. Gordon | a688d5c686 | |
Ryan C. Gordon | 320b154a11 | |
Ryan C. Gordon | 0584117f85 | |
Ryan C. Gordon | cd5362cc57 | |
Ryan C. Gordon | 66fbf41bc0 | |
Ryan C. Gordon | 53fe6d360a | |
Ryan C. Gordon | 4aec77e618 | |
Ryan C. Gordon | 76fdd9cab6 | |
Ryan C. Gordon | b7f3e5bd1e | |
Ryan C. Gordon | 46125c95b3 | |
Ryan C. Gordon | 0d8bf3a129 | |
Ryan C. Gordon | a0af6bbb71 | |
Ryan C. Gordon | b1d4afcbd3 | |
Ryan C. Gordon | 59c6310e92 | |
Ryan C. Gordon | 60aa0e460c | |
Ryan C. Gordon | 43367c0c29 | |
Ryan C. Gordon | 629614838a | |
Ryan C. Gordon | 3a5a780988 | |
Ryan C. Gordon | 24d6a925d1 | |
Ryan C. Gordon | 584119a4a0 | |
Ryan C. Gordon | ba676b23e5 | |
Ryan C. Gordon | 8d7cf56651 | |
Ryan C. Gordon | f5923f5cea | |
Ryan C. Gordon | e34e67ff68 | |
Ryan C. Gordon | 803730884a | |
Ryan C. Gordon | 2486105f4f | |
Ryan C. Gordon | d67e2c9207 | |
Ryan C. Gordon | f49c122784 | |
Ryan C. Gordon | bb6c5e468c | |
Ryan C. Gordon | e5fa9ab9fc | |
Ryan C. Gordon | 52267fe380 | |
Ryan C. Gordon | 82a6ce0abf | |
Ryan C. Gordon | 1030e5d5ec | |
Ryan C. Gordon | 391f94681c | |
Ryan C. Gordon | be4ae4d401 | |
Ryan C. Gordon | 03dbc3f758 | |
Ryan C. Gordon | aaf8868c8d | |
Ryan C. Gordon | 466f538926 | |
Ryan C. Gordon | abd2624c59 | |
Ryan C. Gordon | 624d7f3a42 | |
Ryan C. Gordon | 519046db72 | |
Ryan C. Gordon | a42ada1380 | |
Ryan C. Gordon | c57bd94f84 | |
Ryan C. Gordon | 0ae446d970 | |
Ryan C. Gordon | 16ff5c8aca | |
Ryan C. Gordon | 5ad70036b2 | |
Ryan C. Gordon | 1d41608a64 | |
Ryan C. Gordon | 611aeec61b | |
Ryan C. Gordon | 2aa0c5a278 | |
Ryan C. Gordon | c94d70ec0a | |
Ryan C. Gordon | b7e0ec7391 | |
Ryan C. Gordon | 7a8e3de103 | |
Ryan C. Gordon | df3c281014 | |
Ryan C. Gordon | 700d94e577 | |
Ryan C. Gordon | c8fc8cf957 | |
Ryan C. Gordon | 6e4279e76a | |
Ryan C. Gordon | 9dceda3d9f | |
Ryan C. Gordon | a0b21c9ae9 | |
Ryan C. Gordon | 25224b0e7a | |
Ryan C. Gordon | eac0f11005 | |
Ryan C. Gordon | 86dbf54fc7 | |
Ryan C. Gordon | 54cc53349d | |
Ryan C. Gordon | de27c2a422 | |
Ryan C. Gordon | 9e2acfd8a6 | |
Ryan C. Gordon | 4d46d42f73 | |
Ryan C. Gordon | d1d0de3947 | |
Ryan C. Gordon | 608958b8ce | |
Sam Lantinga | 9fb20ec349 | |
Ryan C. Gordon | 9d11b991bc | |
Ryan C. Gordon | bbd356a27b | |
Ryan C. Gordon | b97ad1f366 | |
Ryan C. Gordon | 6d4d91414a | |
Ryan C. Gordon | 9d1ef087a9 | |
Ryan C. Gordon | 28007c9bae | |
Ryan C. Gordon | 025a02f4c0 | |
Ryan C. Gordon | 8258274a90 | |
Ryan C. Gordon | e4cc3fcd9b | |
Ryan C. Gordon | 65497160f7 | |
Ryan C. Gordon | 4075482826 | |
Ryan C. Gordon | f94d227945 | |
Ryan C. Gordon | 49a8ff3f86 | |
Ryan C. Gordon | b8c4942413 | |
Ryan C. Gordon | 6a1aca5db5 | |
Ryan C. Gordon | c6ca60eb20 | |
Ryan C. Gordon | 4446cfa613 | |
Ryan C. Gordon | 2939b26b7f | |
Ryan C. Gordon | 4298d85313 | |
Ryan C. Gordon | 014f0e2254 | |
Ryan C. Gordon | 794a3b3d90 | |
Ryan C. Gordon | 72f0e7f9b5 | |
Ryan C. Gordon | 67995ad0c5 | |
Ryan C. Gordon | 7dee41eb0c | |
Ryan C. Gordon | 8e4fb13617 | |
Ryan C. Gordon | 660c7f9823 | |
Ryan C. Gordon | 54f72a0b42 | |
Ryan C. Gordon | 855025c3e5 | |
Ryan C. Gordon | 706f50be0a | |
Ryan C. Gordon | 82b8546bc9 | |
Ryan C. Gordon | f5e0dbe78b | |
Ryan C. Gordon | 899517dc85 | |
Ryan C. Gordon | 5f5775c1ec | |
Ryan C. Gordon | 7d253b13ed | |
Ryan C. Gordon | 4d567a0d2f | |
Ryan C. Gordon | f871802f51 | |
Ryan C. Gordon | 3f02ce767f | |
Ryan C. Gordon | 9d900f8814 | |
Ryan C. Gordon | 125c170f7d | |
Ryan C. Gordon | 7f0e7105a7 | |
Ryan C. Gordon | 2219123cc5 | |
Ryan C. Gordon | 84c6e2242e | |
Ryan C. Gordon | d9e98704f7 | |
Ryan C. Gordon | 5ff1a2a12e | |
Ryan C. Gordon | bb9f5e5049 | |
Ryan C. Gordon | 8cd320b858 | |
Ryan C. Gordon | 4bc5ed1725 | |
Ryan C. Gordon | c2e77d7e35 | |
Ryan C. Gordon | 74f8cb4f91 | |
Ryan C. Gordon | b58e5f348c | |
Ryan C. Gordon | 8def2f8aaf | |
Ryan C. Gordon | fc680aa468 | |
Ryan C. Gordon | c92f3035f9 | |
Ryan C. Gordon | 2beafa790d | |
Ryan C. Gordon | c1969d0595 | |
Ryan C. Gordon | c306d73fdc | |
Ryan C. Gordon | f99f0ef9e7 | |
Ryan C. Gordon | 024784efbd | |
Ryan C. Gordon | f7a8d9292c | |
Ryan C. Gordon | b69dfedaf0 | |
Ryan C. Gordon | 8b0988a038 | |
Ryan C. Gordon | 51a22c576e | |
Ryan C. Gordon | 94c621c8fb | |
Ryan C. Gordon | 8546c9a202 | |
Ryan C. Gordon | 3dc77f8a54 | |
Ryan C. Gordon | d797ea7cd8 | |
Ryan C. Gordon | 4000b234c0 | |
Ryan C. Gordon | 68632d3c57 | |
Ryan C. Gordon | 11e2306c1c | |
Ryan C. Gordon | c88d2c3746 | |
Ryan C. Gordon | acdfcfca04 | |
Ryan C. Gordon | 77d16c2bed | |
Ryan C. Gordon | 9d979b21d0 | |
Ryan C. Gordon | f329f4ed0b | |
Ryan C. Gordon | 1fe05388ad | |
Ryan C. Gordon | 80713fb40e | |
Ryan C. Gordon | a9855949f0 | |
Ryan C. Gordon | a44e9669c1 | |
Ryan C. Gordon | e6f331f32d | |
Ryan C. Gordon | ddd82040f4 | |
Ryan C. Gordon | efa498fd5d | |
Ryan C. Gordon | 72b232d4f5 | |
Ryan C. Gordon | 4c7d25aebe | |
Ryan C. Gordon | ed989aa171 | |
Ryan C. Gordon | 47c3e8875c | |
Ryan C. Gordon | cd3587bbf3 | |
Ryan C. Gordon | 39e4da1929 | |
Ryan C. Gordon | 0fa35af2b9 | |
Ryan C. Gordon | c369e78296 | |
Ryan C. Gordon | 8d1cff2bdf | |
Ryan C. Gordon | 9141cd77a0 | |
Ryan C. Gordon | 71dd0f7a6c | |
Ryan C. Gordon | a4a72dfe8c | |
Ryan C. Gordon | a4a7f88db0 | |
Ryan C. Gordon | f1cd4d8f0d | |
Ryan C. Gordon | 8e78e4719d | |
Ryan C. Gordon | 7cc80bebc5 | |
Ryan C. Gordon | eafefbdfdc | |
Ryan C. Gordon | c08d722c2e | |
Ryan C. Gordon | 5a98fc83a8 | |
Ryan C. Gordon | 6d6fec87ad | |
Ryan C. Gordon | 68db1196be | |
Ryan C. Gordon | 13a9f9b2dd | |
Ryan C. Gordon | 8ce71e5924 | |
Ryan C. Gordon | a40d3e1e3b | |
Ryan C. Gordon | 12ad3828e7 | |
Ryan C. Gordon | 35ed8dd586 | |
Ryan C. Gordon | 282bf1b3ec | |
Ryan C. Gordon | bdd4d3ebe3 | |
Ryan C. Gordon | 6116683f5e | |
Ryan C. Gordon | c844a98be3 | |
Ryan C. Gordon | 8415f297f0 | |
Ryan C. Gordon | 319ff77100 | |
Ryan C. Gordon | 23d28cbe12 | |
Ryan C. Gordon | 392193ea0c | |
Ryan C. Gordon | 5720b168ca | |
Ryan C. Gordon | a09a54d0f2 | |
Ryan C. Gordon | aa7126619e | |
Ryan C. Gordon | 5629f8b8bc | |
Ryan C. Gordon | c2c1ba9cc5 | |
Ryan C. Gordon | 4cbe694020 | |
Ryan C. Gordon | 595ac1da39 | |
Ryan C. Gordon | 17b2640d71 | |
Ryan C. Gordon | cef8847a06 | |
Ryan C. Gordon | 5a26df8383 | |
Ryan C. Gordon | 88729ebff2 | |
Ryan C. Gordon | a69f97bb26 | |
Ryan C. Gordon | 71e0e6883d | |
Ryan C. Gordon | 44f6c8306d | |
Ryan C. Gordon | 43207273dd | |
Ryan C. Gordon | ff80fc8003 | |
Ryan C. Gordon | 71fc15fd19 | |
Ryan C. Gordon | 5323b6a532 | |
Ryan C. Gordon | 04b6388b68 | |
Ryan C. Gordon | d7945d5955 | |
Ryan C. Gordon | 94d1b71e49 | |
Ryan C. Gordon | cedcd95541 | |
Ryan C. Gordon | 652f0ec03c | |
Ryan C. Gordon | d26781a809 | |
Ryan C. Gordon | 57d908dca0 | |
Ryan C. Gordon | 0bc32891ba | |
Ryan C. Gordon | 3b91814f20 | |
Ryan C. Gordon | 05e3864db8 | |
Ryan C. Gordon | d8d296e8c6 | |
Ryan C. Gordon | 07e97a0166 | |
Ryan C. Gordon | e1dee8e56a | |
Ryan C. Gordon | 3f0cffcc50 | |
Ryan C. Gordon | 8d796488a2 | |
Ryan C. Gordon | ca244993e6 | |
Ryan C. Gordon | 3bc1f7d670 | |
Ryan C. Gordon | 47557ee2d4 | |
Ryan C. Gordon | 544f0f6185 | |
Ryan C. Gordon | 7eff1f1977 | |
Ryan C. Gordon | ec93cca7c7 | |
Ryan C. Gordon | 778f1987cf | |
Ryan C. Gordon | fb5e8d9cd2 | |
Ryan C. Gordon | b78da18657 | |
Ryan C. Gordon | d6ce63e912 | |
Ryan C. Gordon | 2a65060cde | |
Ryan C. Gordon | 60366b5b32 | |
Ryan C. Gordon | da35dbe448 | |
Ryan C. Gordon | 87558aad9d | |
Ryan C. Gordon | c32cd9d130 | |
Ryan C. Gordon | c021fa0613 | |
Ryan C. Gordon | a6354f6869 | |
Ryan C. Gordon | 8b4f9e89b2 | |
Ryan C. Gordon | fed94bf21a | |
Ryan C. Gordon | 613aedceaa | |
Ryan C. Gordon | b71ef88ba7 | |
Ryan C. Gordon | 6df0e5ffba | |
Ryan C. Gordon | 10ce30f80d | |
Ryan C. Gordon | 3c38768192 | |
Ryan C. Gordon | 78037a7ccb | |
Ryan C. Gordon | 43dbf3a22c | |
Ryan C. Gordon | 2e134c7190 | |
Ryan C. Gordon | bf895c15fc | |
Ryan C. Gordon | 2f3ba7602b | |
Ryan C. Gordon | 2651eb2eb9 | |
Ryan C. Gordon | 2f23846245 | |
convert-repo | 4322ae7af2 | |
Ryan C. Gordon | 61749966b9 | |
Ryan C. Gordon | 1b042d124d | |
Ryan C. Gordon | 5c5e3d7e14 | |
Ryan C. Gordon | 53a9169400 | |
Ryan C. Gordon | bdb7e2a795 | |
Ryan C. Gordon | af11d0a462 | |
Ryan C. Gordon | 73e7465f55 | |
Ryan C. Gordon | 1ae24fd938 | |
Ryan C. Gordon | 3b0e1d7471 | |
Ryan C. Gordon | 7501090a5b | |
Ryan C. Gordon | ac277daac4 | |
Ryan C. Gordon | f7f6c0efd0 | |
Ryan C. Gordon | ee9e106555 | |
Ryan C. Gordon | 77a2c5009c | |
Ryan C. Gordon | 66631578f8 | |
Ryan C. Gordon | 4e457760a2 | |
Ryan C. Gordon | a91fc0d024 | |
Ryan C. Gordon | a863c128be | |
Ryan C. Gordon | a928ba2763 | |
Ryan C. Gordon | 0ea431927e | |
Ryan C. Gordon | 1aa0511f7b | |
Ryan C. Gordon | 565f973e2e | |
Ryan C. Gordon | 2296f69deb | |
Ryan C. Gordon | a8842c9713 | |
Ryan C. Gordon | 827b643f49 | |
Ryan C. Gordon | c5ee3d965c | |
Ryan C. Gordon | c27fd9639f | |
Ryan C. Gordon | d1d0ea025f | |
Ryan C. Gordon | 711d9ec926 | |
Ryan C. Gordon | 05e44324c8 | |
Ryan C. Gordon | 35dcb89748 | |
Ryan C. Gordon | 32bc908a4b | |
Ryan C. Gordon | 8db7b0a622 | |
Ryan C. Gordon | d4d3d52fc5 | |
Ryan C. Gordon | ad430a8816 | |
Ryan C. Gordon | 515f409083 | |
Ryan C. Gordon | cacd778311 | |
Ryan C. Gordon | 4343984522 | |
Ryan C. Gordon | ded756bbe5 | |
Ryan C. Gordon | 41ede697d0 | |
Ryan C. Gordon | d6647fa86d | |
Ryan C. Gordon | 7ed45636ae | |
Ryan C. Gordon | 6ee992c1d9 | |
Ryan C. Gordon | bc1c890468 | |
Ryan C. Gordon | 1622f171f4 | |
Ryan C. Gordon | 40ab6d277f | |
Ryan C. Gordon | 0d45ce01c4 | |
Ryan C. Gordon | 777eec4254 | |
Ryan C. Gordon | b572b556d2 | |
Ryan C. Gordon | 9af599504d | |
Ryan C. Gordon | 45967499d0 | |
Ryan C. Gordon | 3bd2db53ae | |
Ryan C. Gordon | 4176049c43 | |
Ryan C. Gordon | 60dfcae88b | |
Ryan C. Gordon | a8de53670d | |
Ryan C. Gordon | 0e3233a205 | |
Ryan C. Gordon | 1e6550292d | |
Ryan C. Gordon | ded10c9238 | |
Ryan C. Gordon | 49c576280d | |
Ryan C. Gordon | c771a650ce | |
Ryan C. Gordon | aad1408594 | |
Ryan C. Gordon | d8845b0be5 | |
Ryan C. Gordon | da2d3ede59 | |
Ryan C. Gordon | dc0d27228c | |
Ryan C. Gordon | 71e6a8dc3f | |
Ryan C. Gordon | 75a4f4ffe1 | |
Ryan C. Gordon | 4fe2134a3c | |
Ryan C. Gordon | 63f9a21c44 | |
Ryan C. Gordon | 4396d7b3ba | |
Ryan C. Gordon | 7386320811 | |
Ryan C. Gordon | 80ec45d88a | |
Ryan C. Gordon | b2f9b61715 | |
Ryan C. Gordon | 68027001f8 | |
Ryan C. Gordon | 030e84f356 | |
Ryan C. Gordon | 075e6769e2 | |
Ryan C. Gordon | 03fe5bb823 | |
Ryan C. Gordon | 857d9bc84d | |
Ryan C. Gordon | bb1d757244 | |
Ryan C. Gordon | 7703202ee5 | |
Ryan C. Gordon | 75e467576d | |
Ryan C. Gordon | 5eab0737b8 | |
Ryan C. Gordon | b68495e760 | |
Ryan C. Gordon | 4530776d5b | |
Ryan C. Gordon | 2ce4b64a73 | |
Ryan C. Gordon | fde676b2dc | |
Ryan C. Gordon | 6fe37fd840 | |
Ryan C. Gordon | f6c383ff24 | |
Ryan C. Gordon | 8a3220fa1b | |
Ryan C. Gordon | 2caa3b94e3 | |
Ryan C. Gordon | 733f59cd8c | |
Ryan C. Gordon | 5bc21ecf59 | |
Ryan C. Gordon | 237170ebcb | |
Ryan C. Gordon | 503fafad9b | |
Ryan C. Gordon | 607d39a1d3 | |
Ryan C. Gordon | 52cb5bac69 | |
Ryan C. Gordon | 5331c984da | |
Ryan C. Gordon | 0ed7bbc3cf | |
Ryan C. Gordon | 31ff24a38f | |
Ryan C. Gordon | 5908057d71 | |
Ryan C. Gordon | a600edf8ab | |
Ryan C. Gordon | 1a6f1787fa | |
Ryan C. Gordon | 1da70fd66b | |
Ryan C. Gordon | a3a0846701 | |
Ryan C. Gordon | 69598e49ab | |
Ryan C. Gordon | 839f7334a8 | |
Ryan C. Gordon | 6731c7b0e5 | |
Ryan C. Gordon | b133b5dfce | |
Ryan C. Gordon | 230c63cfb3 | |
Ryan C. Gordon | be8216d868 | |
Ryan C. Gordon | 5f0aa93cc7 | |
Ryan C. Gordon | 2c506f8ce8 | |
Ryan C. Gordon | e029cb54e5 | |
Ryan C. Gordon | 53bbe35ddd | |
Ryan C. Gordon | ca2489418e | |
Ryan C. Gordon | 54ba6773b0 | |
Ryan C. Gordon | 0a4ee52e31 | |
Ryan C. Gordon | 902b7b9bae | |
Ryan C. Gordon | e4a317401d | |
Ryan C. Gordon | e3c3acb3b6 | |
Ryan C. Gordon | 94496e3302 | |
Ryan C. Gordon | a1bb93b43f | |
Ryan C. Gordon | c0baa55549 | |
Ryan C. Gordon | c6273ae317 | |
Ryan C. Gordon | 6cdd5b5e57 | |
Ryan C. Gordon | 7fc64a99cc | |
Ryan C. Gordon | 9d42a71574 | |
Ryan C. Gordon | d8f69c0e93 | |
Ryan C. Gordon | 048851d244 | |
Ryan C. Gordon | d5327897cb | |
Ryan C. Gordon | a41e32d112 | |
Ryan C. Gordon | f6790ee34e | |
Ryan C. Gordon | 42e21ff4df | |
Ryan C. Gordon | ad6d05c95b | |
Ryan C. Gordon | afd7163321 | |
Ryan C. Gordon | 95cbc6bed2 | |
Ryan C. Gordon | 49f0f536cb | |
Ryan C. Gordon | 7fcc071ca8 | |
Ryan C. Gordon | 5a25658811 | |
Ryan C. Gordon | a9d65e6d59 | |
Ryan C. Gordon | 64cb8c260e | |
Ryan C. Gordon | f9b8dec5cc | |
Ryan C. Gordon | ab32c0313d | |
Ryan C. Gordon | 25909afde4 | |
Ryan C. Gordon | 8a86d04945 | |
Ryan C. Gordon | a9108ed3ba | |
Ryan C. Gordon | 1c3d7dcc7c | |
Ryan C. Gordon | c527092aed | |
Ryan C. Gordon | 91d1ecc161 | |
Ryan C. Gordon | 1444557273 | |
Ryan C. Gordon | 5d26eca4a4 | |
Ryan C. Gordon | e459e0714d | |
Ryan C. Gordon | c81367d0ca | |
Ryan C. Gordon | 3e912c3c1b | |
Ryan C. Gordon | a66c36b42a | |
Ryan C. Gordon | 8544ea9431 | |
Ryan C. Gordon | 361c434180 | |
Ryan C. Gordon | b7a3aeaccd | |
Ryan C. Gordon | c28540fe89 | |
Ryan C. Gordon | a1208dae33 | |
Ryan C. Gordon | 499631936f | |
Ryan C. Gordon | 6e7e45cdaf | |
Ryan C. Gordon | 24ce834f44 | |
Ryan C. Gordon | 0e54e2a4cf | |
Ryan C. Gordon | 67746179d3 | |
Ryan C. Gordon | 0d43bf1eb1 | |
Ryan C. Gordon | 2362abe855 | |
Ryan C. Gordon | 64599213f1 | |
Ryan C. Gordon | bbb0cab5ee | |
Ryan C. Gordon | 7b4181684e | |
Ryan C. Gordon | 823baad1e1 | |
Ryan C. Gordon | c2b1932747 | |
Ryan C. Gordon | fc4b5f2c69 | |
Ryan C. Gordon | 36005323fe | |
Ryan C. Gordon | 84b03eba46 | |
Ryan C. Gordon | 6e33ae594d | |
Ryan C. Gordon | 19d99f222f | |
Ryan C. Gordon | 779e526014 | |
Ryan C. Gordon | 54969f6075 | |
Ryan C. Gordon | 80a63bb1cd | |
Ryan C. Gordon | d8a2b4be1e | |
Ryan C. Gordon | 8365cbdd07 | |
Ryan C. Gordon | 31443d2c81 | |
Ryan C. Gordon | d8541f7ae4 | |
Ryan C. Gordon | 3f6c5e6348 | |
Ryan C. Gordon | 49ebc305ac | |
Ryan C. Gordon | 8f3ab12d22 | |
Ryan C. Gordon | 507b099d5d | |
Ryan C. Gordon | f114094fa8 | |
Ryan C. Gordon | c794701885 | |
Ryan C. Gordon | ec86fac0bb | |
Ryan C. Gordon | 91319260b1 | |
Ryan C. Gordon | af6fa158f0 | |
Ryan C. Gordon | 63b29f78c1 | |
Ryan C. Gordon | d18fb707b0 | |
Ryan C. Gordon | 34f60ab12d | |
Ryan C. Gordon | e9cf90feda | |
Ryan C. Gordon | 5c7308cdd3 | |
Ryan C. Gordon | 8bfdf7c9e7 | |
Ryan C. Gordon | 7a62100d99 | |
Ryan C. Gordon | 12684647dc | |
Ryan C. Gordon | 16e00ed962 | |
Ryan C. Gordon | 3749633f88 | |
Ryan C. Gordon | 3a0e6fa051 | |
Ryan C. Gordon | d840403c1c | |
Ryan C. Gordon | 4787894ffa | |
Ryan C. Gordon | c799a14c70 | |
Ryan C. Gordon | 2211ea7240 | |
Ryan C. Gordon | a2cc461727 | |
Ryan C. Gordon | ae093ff0fc | |
Ryan C. Gordon | d992f4325a | |
Ryan C. Gordon | 38a1c7f559 | |
Ryan C. Gordon | 67776da8cc | |
Ryan C. Gordon | c557443265 | |
Ryan C. Gordon | 71da6381ad | |
Ryan C. Gordon | 8786d07f5d | |
Ryan C. Gordon | 93adbf1d88 | |
Ryan C. Gordon | 389a4d826a | |
Ryan C. Gordon | 9f9800928d | |
Ryan C. Gordon | bdb7f54bd9 | |
Ryan C. Gordon | 0dd93d3c13 | |
Ryan C. Gordon | ed5de27c73 | |
Ryan C. Gordon | 5c313d7a93 | |
Ryan C. Gordon | d19d7b5a59 | |
Ryan C. Gordon | e2c199b8ab | |
Ryan C. Gordon | a27c289f29 | |
Ryan C. Gordon | bdd4ca0d93 | |
Ryan C. Gordon | 3e06b381e9 | |
Ryan C. Gordon | 35ec4ba395 | |
Ryan C. Gordon | 4b02bb0c64 | |
Ryan C. Gordon | c2c71fb55f | |
Ryan C. Gordon | 0492580bda | |
Ryan C. Gordon | c2765f8571 | |
Ryan C. Gordon | 80535e9b83 | |
Ryan C. Gordon | 8641e4e7ef | |
Ryan C. Gordon | 221a2303be | |
Ryan C. Gordon | e0da355650 | |
Ryan C. Gordon | 27f82cc5e2 | |
Ryan C. Gordon | 90031c81f3 | |
Ryan C. Gordon | 73044892fa | |
Ryan C. Gordon | 94759513d9 | |
Ryan C. Gordon | c02b0db3ec | |
Ryan C. Gordon | 7553af8acf | |
Ryan C. Gordon | 0030a3cd04 | |
Ryan C. Gordon | c0acfc0118 | |
Ryan C. Gordon | d9675edf4b | |
Ryan C. Gordon | cd942faff4 | |
Ryan C. Gordon | 1ba7972aa9 | |
Ryan C. Gordon | 0cc3dea44f | |
Ryan C. Gordon | d7b46c9697 | |
Ryan C. Gordon | f3af262a99 | |
Ryan C. Gordon | bf41b44099 | |
Ryan C. Gordon | a7fe9bcdad | |
Ryan C. Gordon | 44cd602b46 | |
Ryan C. Gordon | 87d412da79 | |
Ryan C. Gordon | bb09a88a67 | |
Ryan C. Gordon | 7988aab2e4 | |
Ryan C. Gordon | 579c5ff438 | |
Ryan C. Gordon | 1ed3abfcab |
53
.cvsignore
53
.cvsignore
|
@ -1,53 +0,0 @@
|
|||
physfs_static_debug
|
||||
physfs_static_release
|
||||
depcomp
|
||||
Makefile
|
||||
.deps
|
||||
.libs
|
||||
aclocal.m4
|
||||
config.status
|
||||
ltmain.sh
|
||||
configure
|
||||
libtool
|
||||
physfs.lo
|
||||
config.guess
|
||||
install-sh
|
||||
config.log
|
||||
config.sub
|
||||
missing
|
||||
stamp-h
|
||||
mkinstalldirs
|
||||
config.h
|
||||
Makefile.in
|
||||
config.h.in
|
||||
libphysfs.la
|
||||
stamp-h.in
|
||||
stamp-h1
|
||||
physfs_byteorder.lo
|
||||
ltconfig
|
||||
inftrees.lo
|
||||
trees.lo
|
||||
uncompr.lo
|
||||
zutil.lo
|
||||
infcodes.lo
|
||||
unzip.lo
|
||||
inflate.lo
|
||||
adler32.lo
|
||||
posix.lo
|
||||
infblock.lo
|
||||
compress.lo
|
||||
dir.lo
|
||||
inffast.lo
|
||||
grp.lo
|
||||
test_physfs
|
||||
unix.lo
|
||||
crc32.lo
|
||||
zip.lo
|
||||
infutil.lo
|
||||
deflate.lo
|
||||
beos.lo
|
||||
Makefile.am
|
||||
config.cache
|
||||
autom4te.cache
|
||||
configure.lineno
|
||||
physfs.spec
|
|
@ -0,0 +1,2 @@
|
|||
github: [icculus]
|
||||
patreon: icculus
|
|
@ -0,0 +1,30 @@
|
|||
name: Build
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
Build:
|
||||
name: ${{ matrix.platform.name }}
|
||||
runs-on: ${{ matrix.platform.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
platform: # !!! FIXME: figure out an efficient way to get SDL2 on the Windows/Mac bots.
|
||||
- { name: Linux, os: ubuntu-20.04, flags: -GNinja }
|
||||
- { name: MinGW, os: windows-latest, flags: -GNinja -DCMAKE_C_COMPILER=x86_64-w64-mingw32-gcc -DCMAKE_SYSTEM_NAME=Windows }
|
||||
- { name: Windows, os: windows-latest }
|
||||
- { name: MacOS, os: macos-latest }
|
||||
steps:
|
||||
- name: Setup Linux dependencies
|
||||
if: runner.os == 'Linux'
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install ninja-build
|
||||
- name: Setup MinGW dependencies
|
||||
if: contains(matrix.platform.name, 'MinGW')
|
||||
run: choco install ninja
|
||||
- name: Get PhysicsFS sources
|
||||
uses: actions/checkout@v2
|
||||
- name: Configure CMake
|
||||
run: cmake -B build ${{ matrix.platform.flags }}
|
||||
- name: Build
|
||||
run: cmake --build build/
|
|
@ -0,0 +1,20 @@
|
|||
name: Build (OS/2)
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
os2:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: open-watcom/setup-watcom@v0
|
||||
- name: Build physfs.dll
|
||||
run: |
|
||||
cd src
|
||||
wmake -f Makefile.os2
|
||||
cd ..
|
||||
- name: distclean
|
||||
run: |
|
||||
cd src
|
||||
wmake -f Makefile.os2 distclean
|
||||
cd ..
|
|
@ -0,0 +1,2 @@
|
|||
cmake-build
|
||||
|
410
CHANGELOG
410
CHANGELOG
|
@ -1,410 +0,0 @@
|
|||
/*
|
||||
* CHANGELOG.
|
||||
*/
|
||||
|
||||
12292003 - Updated CodeWarrior projects from CW6 to CW7, and made a bunch of
|
||||
patches to get the Mac Classic target building again. Removed
|
||||
zlib114 from CVS repository. Updated OS/2 build batch file.
|
||||
Added Z_PREFIX define to Unix builds that use internal zlib.
|
||||
Patched up some (outdated?) Visual C project files for zlib121.
|
||||
Patched Doxyfile and physfs.h for newer Doxygen. Fixed OS/2
|
||||
build script. Tweaked Project Builder files to at least compile.
|
||||
Added some last minute BeOS and Cygwin build fixes. Updated
|
||||
Visual Studio projects and tweaked some Makefile.am crap. Made
|
||||
changes so Visual Studio files would pack with DOS endlines and...
|
||||
Upped version to 1.0.0 (woohoo!).
|
||||
12222003 - Fixed a search-and-replace mistake in win32.c that preventing
|
||||
compiling on Windows. (thanks, Brian!) Converted VC6 .dsp to use
|
||||
zlib121; made Z_PREFIX=1 enabled by default to avoid link clashes;
|
||||
put zlib files in separate logical folder in .dsp project; updated
|
||||
zlib121/zconf.h to address remaining symbols that were still
|
||||
causing link warnings.
|
||||
12182003 - WAD archiver now puts maps into subdirectories, making them
|
||||
accessible to the application. (Thanks, Travis!) RPM spec and
|
||||
Makefile.am* now package zlib_license_change.txt (Thanks, Edward!)
|
||||
12142003 - Added Doom WAD support (Thanks, Travis!)
|
||||
12082003 - Fixed some win32.c deficiencies that Robby Dermody pointed
|
||||
out (thanks!)
|
||||
12072003 - Upgraded internal zlib to 1.2.1 (thanks, Adam!) Other
|
||||
Unix build fixes.
|
||||
11112003 - Patches to make OS/2 support compile again.
|
||||
11092003 - Added __PHYSFS_platformStrnicmp(), and made qpak.c case-insensitive.
|
||||
09122003 - Happy September. Actually released current tree as 0.1.9.
|
||||
08262003 - Added MiNT support to build process and fixed cross-compiling
|
||||
(thanks Patrice Mandin!)
|
||||
08092003 - Some Windows build fixes (thanks, Brian Hook!)
|
||||
07232003 - Upped version to 0.1.9.
|
||||
07202003 - Switched to zlib license (see new LICENSE text in root of source
|
||||
tree, and zlib_license_switch.txt for details). Had to remove
|
||||
archivers/qpak.c, the Ruby bindings from the extras directory, and
|
||||
the Russian and Spanish translations, since those contributors
|
||||
couldn't be contacted. If they show up, we'll readd them to the
|
||||
project, otherwise we'll eventually replace their work...everyone
|
||||
else signed on for the change. Committed a patch to convert all
|
||||
tabs to spaces (Thanks, James!). Added patch to zip.c to fix
|
||||
crash (thanks, dillo!). Reimplmented qpak.c, by welding together
|
||||
bits of grp.c and zip.c. Ed contacted me, so I could readd his
|
||||
contributions post-license change...I'm going to keep the new
|
||||
qpak.c, but I've readded his Ruby bindings and Russian translations.
|
||||
06112003 - Patches to globbing.c to handle corner cases (thanks, Bradley!).
|
||||
06102003 - Added globbing.c to "extras" directory.
|
||||
05232003 - Rewrote MacOSX/Darwin CD-ROM detection code to use IOKit, which is
|
||||
much much more accurate than the previous code. Updated
|
||||
configure.in and Makefile.am.newautomake for some MacOSX stuff.
|
||||
05222003 - Fixed win32 crash if PHYSFS_init() is called with a NULL.
|
||||
05182003 - PocketPC fixes (thanks, David Hedbor!)
|
||||
05162003 - Compiler warning cleanup in HOG and MVL archivers (Thanks, Bradley!)
|
||||
04082003 - Minor changes to extras/abs-file.h (Thanks, Adam!)
|
||||
03302003 - Fixed seeking in uncompressed ZIP entries, and handle a
|
||||
misbehaviour in Java's JAR creation tools. Thanks to "Tree" for
|
||||
pointing these bugs out. Added HOG and MVL archive support for
|
||||
Descent I and II (Thanks, Bradley Bell!). Added example code to
|
||||
do case-insensitive file searches ("extras/ignorecase.*").
|
||||
03192003 - Fixed problem in PHYSFS_mkdir() when dirs to be created already
|
||||
exist. Fixed problem where PHYSFS_mkdir() incorrectly tripped an
|
||||
alarm in __PHYSFS_verifySecurity().
|
||||
03122003 - Attempt at cleaning up some type correctness for VC++6. Made QPAK
|
||||
archiver case-insensitive (since Quake2 has problems without it).
|
||||
01302003 - Added buffering API to OS/2 build's exported symbol list. Updated
|
||||
CWProjects.sit and made several fixes to get physfs building on
|
||||
MacOS Classic again.
|
||||
01282003 - Fixed seeking in buffered files opened for read.
|
||||
01072003 - .NET assembly and C# wrapper by Gregory S. Read in the extras dir.
|
||||
01042003 - Added a hack for dealing with OSX bundles and newer PBProjects
|
||||
(thanks, Eric Wing!). Added some missing files to "make dist".
|
||||
Fixed minor Doxygen typo in PHYSFS_flush() docs. Upped version to
|
||||
0.1.8.
|
||||
12172002 - Added Apple Project Builder support files (thanks, Eric Wing!).
|
||||
12112002 - Added Ruby bindings to extras directory (thanks, Ed Sinjiashvili!).
|
||||
Patched win32.c to compile with Mingw32 (thanks, Niels Wagenaar!).
|
||||
12032002 - Adam updated his extras/abs-file.h for the new buffering API.
|
||||
12022002 - German translation added, compliments of Michael Renner.
|
||||
12012002 - Minor fix to configure.in: reported --enable-debug's default
|
||||
setting incorrectly. Added buffering to the API: you can now
|
||||
buffer a file with PHYSFS_setBuffer(), and flush the buffer to
|
||||
disk with PHYSFS_flush(). PhysicsFS file handles are unbuffered
|
||||
by default (as they were before this API addition), so this does
|
||||
not break the API. Other fixes for bugs I stumbled upon during
|
||||
this work are in CVS, too.
|
||||
11292002 - Minor fix for strange PATH strings in unix.c (thanks, Alexander!)
|
||||
11222002 - Initial PocketPC port by Corona688.
|
||||
10222002 - Fixed segfault in test_physfs.c when user hits CTRL-D (and
|
||||
readline() thus returns NULL)...now gracefully exits, as it should.
|
||||
10142002 - Added check for AMD's x86-64 ("Hammer") architecture when
|
||||
determining platform byte order.
|
||||
10112002 - Fixed "setsaneconfig" command in test_physfs.c ...
|
||||
09232002 - Happy September. Updated VC++6 project files, fixed some
|
||||
VC++ compile nags (more work to be done in zip.c).
|
||||
08302002 - Cleaned tab stops out of zip.c, and fixed a possible infinite loop
|
||||
in zip_find_entry().
|
||||
08292002 - Fixed a mistake in makeos2.cmd, and updated the INSTALL docs.
|
||||
Added physfs.spec.in to EXTRA_DIST in Makefile.am*
|
||||
08292002 - Added a physfs/stdio wrapper header to the "extras" dir,
|
||||
compliments of Adam D. Moss (file is "abs-file.h").
|
||||
08282002 - Cleanups in grp.c so that Visual C++ doesn't complain anymore.
|
||||
zip.c now works correctly when PhysicsFS is disallowing symlinks.
|
||||
A few minor optimizations in zip.c, with a few more to come later.
|
||||
Added VS.NET project files to CVS.
|
||||
08222002 - Fixed ZIP_exists() to work with directories. Now breaks out of
|
||||
__PHYSFS_verifySecurity() early if a path element is missing
|
||||
(since all the others will be, too)...this check is only done
|
||||
if symlinks are disabled, but we might as well save easy cycles
|
||||
where we can.
|
||||
08212002 - Did a couple tedious-for-small-rewards cleanups, optimizations,
|
||||
corrections and streamlinings I've been meaning to do. Touched a
|
||||
lot of code. One of the side results is that ZIP_isDirectory()
|
||||
got fixed.
|
||||
08192002 - Generalized sorting routines, moved them into physfs.c and removed
|
||||
the multiple copies from the various archivers. Adding profiling
|
||||
code (currently only for sort routines)...enable it with
|
||||
--enable-profiling in the configure script. Fixed incorrect
|
||||
behaviours in configure.in.
|
||||
08172002 - Patched configure.in to work around buggy autoconfs.
|
||||
08162002 - Fixed QPAK archiver, since I broke it (sorry!). Also fixed a
|
||||
qpak memory leak.
|
||||
08092002 - Added Quake PAK archiver (qpak.c) by Ed Sinjiashvili. Thanks!
|
||||
Made (successful?) attempt to fix pthread-to-ui64 cast problem.
|
||||
Check for OS/2 in configure.in, in case anyone gets autoconf and
|
||||
such to work right on their OS/2 box.
|
||||
08012002 - Patched win32.c to compile.
|
||||
07302002 - Minor error handling fix (thanks, Alexander!)
|
||||
07292002 - Found some memory leaks, thanks to Valgrind (which rules, btw).
|
||||
Added Russian translations (koi8-r, cp1251, cp866, and iso-8859-5)
|
||||
by Ed Sinjiashvili. Added Spanish translation by Pedro J. Pérez.
|
||||
Debian package support in CVS, thanks to Colin Bayer. French
|
||||
translation by Stéphane Peter.
|
||||
07282002 - macclassic.c now returns human readable error messages instead of
|
||||
ERR_OS_ERROR. Closing files on MacOS no longer fails if the volume
|
||||
info can't be flushed. Minor error message tweak in os2.c. All
|
||||
possible human-readable literal strings (including all those OS/2
|
||||
and MacOS error messages) have moved to constants in
|
||||
physfs_internal.h...this allows the library to be translated to
|
||||
other spoken languages fairly easily.
|
||||
07272002 - Patched the OS/2 code to be useful...works pretty well, now. Added
|
||||
makeos2.cmd for building (not an ideal solution, but oh well).
|
||||
Initialized some variables in zip.c to prevent compiler whining.
|
||||
07262002 - Fixed a typo in documentation. Archivers with matching file
|
||||
extensions are now given first shot at opening an archive, but if
|
||||
they fail, the other archivers are tried. More fixes to zip.c's
|
||||
ZIP_enumerateFiles(). Wrote an OS/2 platform driver based on API
|
||||
specs and a heavy pounding of Google Groups...as I don't have an
|
||||
OS/2 compiler at the moment, it probably doesn't even compile. :)
|
||||
07252002 - configure.in and unix.c now deal with platforms that lack a
|
||||
functional pthread library. Edward Rudd sent in a patch to the RPM
|
||||
specfile to have the build system set the correct version.
|
||||
Clean ups in grp.c, beos.cpp and macclassic.c.
|
||||
07242002 - Rewrote ZIP_enumerate(). Hopefully it sucks less this time.
|
||||
unix.c and configure.in now have the infrastructure to disable
|
||||
the CD-ROM detection code, and use a stub that successfully (and
|
||||
unconditionally) reports no detected discs. Currently this is
|
||||
used on AtheOS (which doesn't have CD-ROM support at the moment
|
||||
anyhow), but it will be useful to get the library up on odd,
|
||||
Unix-like systems that don't use either getmntinfo() or getmntent().
|
||||
07232002 - Cleaned up the cut-and-pastes in the various file enumeration
|
||||
routines and moved it into __PHYSFS_addToLinkedStringList().
|
||||
Tons more ZIP file enhancing. I'm fairly certain it's robust and
|
||||
fast in every reasonable respect, now. GRP archiver now caches
|
||||
the file table...it was generally overhauled like the ZIP driver.
|
||||
Added "ls" as an alias of "enumerate" in test_physfs.
|
||||
I lied about zip.c's robustness; disabled the enumeration code.
|
||||
07212002 - More FreeBSD build system patches. Added some new autoconf spew to
|
||||
.cvsignore. bootstrap now copies the appropriate Makefile.am
|
||||
instead of rename()ing it.
|
||||
07192002 - Cleaned up configure.in and unix.c so that we check by available
|
||||
header to determine the appropriate CD-ROM detection code...this
|
||||
should make this more future-proof (and probably get it building
|
||||
out of the box on other BSD platforms.)
|
||||
07172002 - Fixed seeking backwards in ZIP_seek(). Changed the error message
|
||||
ERR_TOO_MANY_SYMLINKS to ERR_SYMLINK_LOOP. Patches to build system
|
||||
and unix.c for FreeBSD compatibility. Added physfs.spec to
|
||||
"make dist" archives (thanks, Edward Rudd!).
|
||||
07152002 - Symlinks in ZIP archives are detected correctly now, I think.
|
||||
07142002 - Use GetVolumeInformation() instead of GetDiskFreeSpace() in
|
||||
win32.c's mediaInDrive() function. This allows Windows NT 3.x to
|
||||
correctly detect CD-ROM drives. Library now appears to be fully
|
||||
functional on WinNT 3.51...need to try NT 3.1 still. :)
|
||||
Patches to new ZIP code; cleaned up bugs in symlink reading code,
|
||||
but we incorrectly identify some entries as symlinks, which doesn't
|
||||
fly...for now, symlink code is commented out, so symlinks look
|
||||
like regular files (and reading from a symlink entry gives you
|
||||
the link as file data).
|
||||
07122002 - Rewrote the ZIP archiver to no longer use Gilles Vollant's unzip.c
|
||||
code. Losing that abstraction should make the ZIP archiver
|
||||
significantly more efficient, and halved the amount of code used.
|
||||
Plus, being a control freak, I like my coding style more than
|
||||
Gilles's. :) There are still bugs to shake out, but this is good
|
||||
progress.
|
||||
07112002 - configure.in updated to make it happier on newer autoconfs
|
||||
(thanks again, Alexander!). FIXME cleanups.
|
||||
07102002 - Added a byteorder-friendly convenience API, so you can read/write
|
||||
data and convert to the native byteorder without too much effort.
|
||||
Upped version to 0.1.7.
|
||||
Build system corrections for BeOS and Cygwin (thanks, Alexander!).
|
||||
Added RPM specfile for PhysicsFS (thanks, Edward Rudd!).
|
||||
06292002 - Fixed incorrect error message when opening a file for read without
|
||||
defining a search path. LOTS of win32 updates and fixes; lots of
|
||||
things that were broken work now, and we are slowly becoming
|
||||
more compatible with legacy win32 systems. Builds on Cygwin again.
|
||||
All platform drivers (except beos.cpp) had a buffer overflow when
|
||||
detecting mounted CD-ROM drives...it only occurs when a drive is
|
||||
detected, and it probably won't result in your box getting rooted,
|
||||
but upgrade soon anyhow. Readded the .cvsignore files from the old
|
||||
build system.
|
||||
06282002 - Reworked build system _AGAIN_.
|
||||
06222002 - Alexander Pipelka spotted a bug in the file open routines in
|
||||
posix.c; patched.
|
||||
06152002 - Autoconf build system will now generate shared libraries on BeOS,
|
||||
and (supposedly) Cygwin.
|
||||
06142002 - Rewrote autoconf build system. It now works around the MacOS X bug
|
||||
that prevented shared libraries from building.
|
||||
06112002 - Updated CodeWarrior projects and added them to CVS. _Finally_
|
||||
officially released 0.1.6.
|
||||
06102002 - Major overhauls to platform/win32.c ... should work on all Windows
|
||||
platforms, including 95/98/ME and NT/2K/XP flavors. Someone should
|
||||
see if this builds on WinCE! :) You no longer need the latest
|
||||
platform SDK to build it, either; the questionable DLL is accessed
|
||||
with LoadLibrary() at runtime now, and handled if not present. This
|
||||
now builds correctly on a freshly installed Visual Studio 6.0, and
|
||||
the DLL it builds works everywhere. Plus, a bunch of other bugs
|
||||
and incorrect behaviours were squashed. Visual Studio 6.0 project
|
||||
file added to CVS.
|
||||
06082002 - Fixes to __PHYSFS_platformEnumerateFiles() in win32.c: cleaned up
|
||||
memory leak, handles paths more robustly, and prevents possible
|
||||
skipped file entries. Removed AC_C_CONST and AC_TYPE_SIZE_T checks
|
||||
from configure.in (not needed, and they broke BeOS build). Clean
|
||||
out the docs/ directory when doing a "make dist". Fixed crashbug
|
||||
when calling PHYSFS_deinit() more than once in a row. Tried to get
|
||||
MacOS X to build a shared library, gave up; I'm doing something
|
||||
wrong in my Makefile.am, I think. On MacOS X, running ./configure
|
||||
--enable-static --disable-shared works, though. Hopefully someone
|
||||
will fix this soon. In unix.c, the Darwin version of
|
||||
__PHYSFS_platformDetectAvailableCDs() was free()ing a static
|
||||
buffer; fixed.
|
||||
06072002 - Manpages! Finally installed Doxygen and scratched together a
|
||||
Doxyfile. After some revision to physfs.h, we've got a rather
|
||||
nice API reference.
|
||||
06062002 - Fixed __PHYSFS_platformSeek() in archivers/posix.c. Implemented the
|
||||
getLastModTime method in archivers/zip.c (returns legitimate info)
|
||||
and archivers/grp.c (returns lastmodtime of GRPfile itself in the
|
||||
physical filesystem). Put a 64-bit _llseek() version of the seek()
|
||||
and tell() methods in platform/posix.c, but you need to hack (or
|
||||
rather, fix) configure.in to enable it. From Greg on win32.c: Fixed
|
||||
file enumerator function (needed a wildcard '*' specification), CD
|
||||
enumeration only reports CDs that have media, getLastModTime() has
|
||||
been implemented.
|
||||
06012002 - Added -Wall to debug builds. Removed ANSI stdio calls from
|
||||
platform/posix.c, and replaced them with actual POSIX calls (that
|
||||
is, fopen() became open(), fseek() became lseek(), etc...)
|
||||
05272002 - Added some explicit casts when calling malloc() in platform/posix.c
|
||||
05252002 - Added John Hall's file modification time patch, and added a
|
||||
getlastmodtime command to test_physfs. Corrected error reporting
|
||||
for missing files a little bit. Changed build system to only try
|
||||
building beos.cpp if on a BeOS system (since we need a C++ compiler
|
||||
available to do so). Implemented getLastModTime in macclassic.c.
|
||||
05242002 - Upped version to 0.1.6 (not officially released yet).
|
||||
05232002 - Fixed the build system to always package the complete source, not
|
||||
just what we built for a given system, when doing a "make dist".
|
||||
Updated INSTALL. Wrote BeOS platform code (platform/beos.cpp).
|
||||
Split unix.c into unix.c and posix.c. Linux and BeOS both share
|
||||
posix.c, although I don't think it's completely POSIX compliant at
|
||||
this point (not that it matters much).
|
||||
05212002 - Cleaned up some FIXMEs.
|
||||
05202002 - Added .cvsignore files.
|
||||
05162002 - Edward Rudd also caught an embarrassing screwup by me in
|
||||
unix.c: the open-for-append call was using "wb+" instead of
|
||||
"ab" when calling fopen(). Doh!
|
||||
05152002 - configure script now deals with systems that have a readline
|
||||
lib, but require it to be linked with curses. Thanks to Edward
|
||||
Rudd for the patch.
|
||||
05102002 - A trimmed-down zlib 1.1.4 is now included in the source distro, for
|
||||
use by win32, MacOS, and Unix systems that don't have it installed
|
||||
on the system. Autoconf support! Initial attempt at this. Lots of
|
||||
stuff may be very broken.
|
||||
05082002 - From Greg: More win32 work. Library is now 95% functional on win32.
|
||||
Only known win32 problem is that the CD drives are reported whether
|
||||
they contain a disc or not).
|
||||
05062002 - From Greg: Win32 boxes without the latest Platform SDK can now
|
||||
#define DISABLE_NT_SUPPORT. Other fixes.
|
||||
04242002 - Updated win32 info in INSTALL to discuss Platform SDK issues.
|
||||
04202002 - Added a (very) quick and (very) dirty http server to the
|
||||
extras directory (public domain), as another example of using
|
||||
the library.
|
||||
04192002 - Corrected some win32 info in INSTALL. Changed Makefile to
|
||||
package releases as .tar.gz instead of .tar.bz2.
|
||||
04122002 - Some win32 cleanups and fixes across several files. Upped
|
||||
version to 0.1.5.
|
||||
04082002 - Fixed problem when calling __PHYSFS_setError before PHYSFS_init.
|
||||
04062002 - Added MacOS info, etc to INSTALL. Patched unix.c and
|
||||
test_physfs.c to compile on Darwin again.
|
||||
04052002 - Added byte ordering API. Byte ordering fixes in grp.c, and some
|
||||
cleanups in unzip.c. Mac work is more or less complete.
|
||||
04042002 - Mac work continues. Almost complete, now. test_physfs now has
|
||||
tests for write, append, and filelength, and most of the
|
||||
commands can tolerate a quoted argument (although this is
|
||||
hacky, it's good enough for these purposes). Upped test_physfs
|
||||
version to 0.1.1. Added a malloc-failure check in the Unix
|
||||
CD-ROM detection code.
|
||||
04032002 - PHYSFS_init always makes sure the calling thread initializes its
|
||||
error state. Win32 codebase is updated with mutex implementation
|
||||
(thanks, Greg!).
|
||||
04022002 - Mac work continues. Found a bug where we put a double dir
|
||||
separator in if we had to resort to the fallback userdir (if
|
||||
__PHYSFS_platformGetUserDir() returned NULL to calculateUserDir().
|
||||
Made note of potential infinite recursion in platform driver docs.
|
||||
04012002 - (_NOT_ an April Fool's Joke:) Started working on MacOS Classic
|
||||
port. Added skeleton.c to platform directory. Minor patches to
|
||||
get things compiling on Mac (notably, DirInfo conflicts with
|
||||
a type exposed by MacOS's namespace-polluting API, and some
|
||||
typecasting issues). Found a call to ferror() I had missed in
|
||||
unzip.c.
|
||||
03302002 - Mutexes! PhysicsFS should be thread safe now, so long as you
|
||||
don't try to do something like close a file at the same time as
|
||||
you are reading from it in another thread. All reasonable race
|
||||
conditions should now be gone, but the new code will need some
|
||||
eyeballing before we install it on life support systems or anything.
|
||||
The mutex abstraction is implemented in unix.c, win32.c will be
|
||||
updated shortly.
|
||||
03292002 - Fixed a potential problem in ZIP_realpath() and some byte order
|
||||
issues in zip.c. Converted unzip.c to use physfs file i/o
|
||||
abstractions. Converted CHANGELOG to list latest entries first.
|
||||
03242002 - Added __PHYSFS_platformInit() and __PHYSFS_platformDeinit(). Win32
|
||||
improvements by Gregory S. Read. Added PHYSFS_[us]int(8|16|32)
|
||||
types...this breaks binary compatibility with previous PhysicsFS
|
||||
releases! Added platform specific i/o functions, so we don't have
|
||||
to rely on stdio anymore. Updated TODO with my comments on the
|
||||
physfs mailing list. 1.0, here we come! Removed race condition from
|
||||
grp.c and converted to file i/o abstraction layer calls from stdio.
|
||||
Tons of other fixes and enhancements.
|
||||
03202002 - Patched platform/win32.c to compile.
|
||||
03152002 - PHYSFS_setSaneConfig() now handles failure to set the write dir
|
||||
better. Patched makefile to link the test program. Changed all the
|
||||
"write" functions to get data from a "const" buffer. Added an
|
||||
"extras" dir, which currently contains PhysFS->SDL_RWops glue code.
|
||||
03052002 - Made unix.c's timeslice implementation more portable, and added a
|
||||
Darwin-specific means to detect CDs (thanks to Patrick Stein).
|
||||
Minor cleanup in win32.c (changed "for (; condition ;)" into
|
||||
"while (condition)" ...)
|
||||
11142001 - Removed a redundant error check in platform/win32.c
|
||||
10092001 - Syntax fixes in dir.c, a FIXME in grp.c, and a "cat" command in
|
||||
the test program. Apparently I had accidentally removed a rather
|
||||
crucial line from dir.c a few revisions ago, and no one noticed. :(
|
||||
Fixed. The win32 userdir will default to the base dir, now.
|
||||
09252001 - Changed API: PHYSFS_setSaneConfig() takes an organization name, and
|
||||
sets up less directories. Be warned. Fixes from David Hedbor:
|
||||
make setSaneConfig() set write directory correctly if it had to
|
||||
create the directory, and make sure that the writing functions
|
||||
get used in dir.c when a file is opened for writing/appending.
|
||||
Updated CREDITS.
|
||||
09142001 - David Hedbor submitted a patch to handle a case where the
|
||||
current working directory has been deleted out from under the
|
||||
process (both in platform/unix.c and physfs.c itself). Thanks,
|
||||
David! Added a CREDITS file. Changed the format of the author field
|
||||
in PHYSFS_ArchiveInfo to put the email address between "<>" instead
|
||||
of "()" chars. Updated TODO. make install now deletes previous
|
||||
revisions of the library. Changed version to 0.1.4.
|
||||
09012001 - Happy September. Moved the Visual C project files and the zlib
|
||||
source to a separate download. Look for it at
|
||||
http://icculus.org/physfs/downloads/physfs-win32-support.zip ...
|
||||
Updated the INSTALL doc for Win32 building. Rewrote win32.c's
|
||||
__PHYSFS_platformRealPath() to not rely on Visual C's runtime lib,
|
||||
which was the last Cygwin incompatibility (although the Makefile
|
||||
needs to be updated to build a DLL under Cygwin). Tinkered with the
|
||||
Makefile a little, but it needs more work. Started working on a
|
||||
MacOS version. All I have is CodeWarrior 4, which is way out of
|
||||
date, and (for what is supposed to be an ultra-user-friendly
|
||||
environment) is completely uninituitive to me. Still, managed to
|
||||
get most everything compiling, which improved the quality of the
|
||||
code somewhat). Haven't tried to compile the zipfile support, and
|
||||
I still can't link the library. Dunno what the hell I'm supposed
|
||||
to do there. Isn't Unix supposed to be hard compared to this?
|
||||
08312001 - Built PhysicsFS on Mandrake 8.0 for the PowerPC. Compiles clean,
|
||||
but there's at least one byte-ordering issue in zip.c that needs
|
||||
to be fixed.
|
||||
08292001 - win32.c calculates the base dir with GetModuleFileName() first, now,
|
||||
and falls back to SearchPath() if there were problems. Changed an
|
||||
occurence of _MAX_PATH to MAX_PATH, so both CygWin and Visual C can
|
||||
handle it.
|
||||
08282001 - win32.c now checks HOMEDRIVE, HOMEPATH, and HOME when calculating
|
||||
the userdir. Added include files that make it a little closer to
|
||||
compiling under Cygwin. Added a TODO file. Fixed unix.c's
|
||||
__PHYSFS_platformCalcBaseDir() so that it actually works. Fixed
|
||||
Makefile so that it links the test program properly.
|
||||
Changed version to 0.1.3.
|
||||
08232001 - Fixed a potential free()ing of a NULL pointer in
|
||||
__PHYSFS_platformEnumerateFiles() in platform/unix.c. Added
|
||||
platform/win32.c. Other cleanups to get this compiling with
|
||||
Visual C and CygWin. Added BAIL_MACRO for times when we were doing
|
||||
BAIL_IF_MACRO(1, ...). Abstracted mkdir() in the platform drivers.
|
||||
Added GRP setting output to showcfg in the Makefile. Updated INSTALL
|
||||
with license info and Win32 build instructions. Dependency on the
|
||||
readline library in test_physfs.c is now optional.
|
||||
Changed version to 0.1.2.
|
||||
08072001 - Changed version to 0.1.1.
|
||||
08062001 - Added CD-ROM detection code to the unix platform driver.
|
||||
08012001 - Added a safety memset in error setting, fixed URLs and email addr.
|
||||
07282001 - Initial release.
|
||||
|
||||
--ryan. (icculus@clutteredmind.org)
|
||||
|
||||
/* end of CHANGELOG ... */
|
||||
|
|
@ -0,0 +1,345 @@
|
|||
# PhysicsFS; a portable, flexible file i/o abstraction.
|
||||
#
|
||||
# Please see the file LICENSE.txt in the source's root directory.
|
||||
|
||||
# The CMake project file is meant to get this compiling on all sorts of
|
||||
# platforms quickly, and serve as the way Unix platforms and Linux distros
|
||||
# package up official builds, but you don't _need_ to use this; we have
|
||||
# built PhysicsFS to (hopefully) be able to drop into your project and
|
||||
# compile, using preprocessor checks for platform-specific bits instead of
|
||||
# testing in here.
|
||||
|
||||
set(PHYSFS_VERSION 3.3.0)
|
||||
|
||||
cmake_minimum_required(VERSION 3.0)
|
||||
|
||||
project(PhysicsFS VERSION ${PHYSFS_VERSION} LANGUAGES C )
|
||||
|
||||
include(GNUInstallDirs)
|
||||
|
||||
# Increment this if/when we break backwards compatibility.
|
||||
set(PHYSFS_SOVERSION 1)
|
||||
|
||||
set(PHYSFS_M_SRCS)
|
||||
set(PHYSFS_CPP_SRCS)
|
||||
|
||||
# I hate that they define "WIN32" ... we're about to move to Win64...I hope!
|
||||
|
||||
if(APPLE)
|
||||
set(OTHER_LDFLAGS ${OTHER_LDFLAGS} "-framework IOKit -framework Foundation")
|
||||
list(APPEND PHYSFS_M_SRCS src/physfs_platform_apple.m)
|
||||
endif()
|
||||
|
||||
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||
add_compile_options(-Wall)
|
||||
# Don't use -rpath.
|
||||
set(CMAKE_SKIP_RPATH ON CACHE BOOL "Skip RPATH" FORCE)
|
||||
endif()
|
||||
|
||||
if(CMAKE_C_COMPILER_ID STREQUAL "SunPro")
|
||||
add_definitions(-erroff=E_EMPTY_TRANSLATION_UNIT)
|
||||
add_definitions(-xldscope=hidden)
|
||||
endif()
|
||||
|
||||
if(HAIKU)
|
||||
# We add this explicitly, since we don't want CMake to think this
|
||||
# is a C++ project unless we're on Haiku.
|
||||
list(APPEND PHYSFS_CPP_SRCS src/physfs_platform_haiku.cpp)
|
||||
find_library(BE_LIBRARY be)
|
||||
find_library(ROOT_LIBRARY root)
|
||||
list(APPEND OPTIONAL_LIBRARY_LIBS ${BE_LIBRARY} ${ROOT_LIBRARY})
|
||||
endif()
|
||||
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone" OR CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
|
||||
set(WINRT TRUE)
|
||||
endif()
|
||||
|
||||
if(WINRT)
|
||||
list(APPEND PHYSFS_CPP_SRCS src/physfs_platform_winrt.cpp)
|
||||
endif()
|
||||
|
||||
if(UNIX AND NOT WIN32 AND NOT APPLE) # (MingW and such might be UNIX _and_ WINDOWS!)
|
||||
find_library(PTHREAD_LIBRARY pthread)
|
||||
if(PTHREAD_LIBRARY)
|
||||
set(OPTIONAL_LIBRARY_LIBS ${OPTIONAL_LIBRARY_LIBS} ${PTHREAD_LIBRARY})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(PHYSFS_CPP_SRCS)
|
||||
enable_language(CXX)
|
||||
endif()
|
||||
|
||||
# Almost everything is "compiled" here, but things that don't apply to the
|
||||
# build are #ifdef'd out. This is to make it easy to embed PhysicsFS into
|
||||
# another project or bring up a new build system: just compile all the source
|
||||
# code and #define the things you want.
|
||||
set(PHYSFS_SRCS
|
||||
src/physfs.c
|
||||
src/physfs_byteorder.c
|
||||
src/physfs_unicode.c
|
||||
src/physfs_platform_posix.c
|
||||
src/physfs_platform_unix.c
|
||||
src/physfs_platform_windows.c
|
||||
src/physfs_platform_os2.c
|
||||
src/physfs_platform_qnx.c
|
||||
src/physfs_platform_android.c
|
||||
src/physfs_archiver_dir.c
|
||||
src/physfs_archiver_unpacked.c
|
||||
src/physfs_archiver_grp.c
|
||||
src/physfs_archiver_hog.c
|
||||
src/physfs_archiver_7z.c
|
||||
src/physfs_archiver_mvl.c
|
||||
src/physfs_archiver_qpak.c
|
||||
src/physfs_archiver_wad.c
|
||||
src/physfs_archiver_zip.c
|
||||
src/physfs_archiver_slb.c
|
||||
src/physfs_archiver_iso9660.c
|
||||
src/physfs_archiver_vdf.c
|
||||
${PHYSFS_CPP_SRCS}
|
||||
${PHYSFS_M_SRCS}
|
||||
)
|
||||
|
||||
|
||||
# Archivers ...
|
||||
# These are (mostly) on by default now, so these options are only useful for
|
||||
# disabling them.
|
||||
|
||||
option(PHYSFS_ARCHIVE_ZIP "Enable ZIP support" TRUE)
|
||||
if(NOT PHYSFS_ARCHIVE_ZIP)
|
||||
add_definitions(-DPHYSFS_SUPPORTS_ZIP=0)
|
||||
endif()
|
||||
|
||||
option(PHYSFS_ARCHIVE_7Z "Enable 7zip support" TRUE)
|
||||
if(NOT PHYSFS_ARCHIVE_7Z)
|
||||
add_definitions(-DPHYSFS_SUPPORTS_7Z=0)
|
||||
endif()
|
||||
|
||||
option(PHYSFS_ARCHIVE_GRP "Enable Build Engine GRP support" TRUE)
|
||||
if(NOT PHYSFS_ARCHIVE_GRP)
|
||||
add_definitions(-DPHYSFS_SUPPORTS_GRP=0)
|
||||
endif()
|
||||
|
||||
option(PHYSFS_ARCHIVE_WAD "Enable Doom WAD support" TRUE)
|
||||
if(NOT PHYSFS_ARCHIVE_WAD)
|
||||
add_definitions(-DPHYSFS_SUPPORTS_WAD=0)
|
||||
endif()
|
||||
|
||||
option(PHYSFS_ARCHIVE_HOG "Enable Descent I/II HOG support" TRUE)
|
||||
if(NOT PHYSFS_ARCHIVE_HOG)
|
||||
add_definitions(-DPHYSFS_SUPPORTS_HOG=0)
|
||||
endif()
|
||||
|
||||
option(PHYSFS_ARCHIVE_MVL "Enable Descent I/II MVL support" TRUE)
|
||||
if(NOT PHYSFS_ARCHIVE_MVL)
|
||||
add_definitions(-DPHYSFS_SUPPORTS_MVL=0)
|
||||
endif()
|
||||
|
||||
option(PHYSFS_ARCHIVE_QPAK "Enable Quake I/II QPAK support" TRUE)
|
||||
if(NOT PHYSFS_ARCHIVE_QPAK)
|
||||
add_definitions(-DPHYSFS_SUPPORTS_QPAK=0)
|
||||
endif()
|
||||
|
||||
option(PHYSFS_ARCHIVE_SLB "Enable I-War / Independence War SLB support" TRUE)
|
||||
if(NOT PHYSFS_ARCHIVE_SLB)
|
||||
add_definitions(-DPHYSFS_SUPPORTS_SLB=0)
|
||||
endif()
|
||||
|
||||
option(PHYSFS_ARCHIVE_ISO9660 "Enable ISO9660 support" TRUE)
|
||||
if(NOT PHYSFS_ARCHIVE_ISO9660)
|
||||
add_definitions(-DPHYSFS_SUPPORTS_ISO9660=0)
|
||||
endif()
|
||||
|
||||
option(PHYSFS_ARCHIVE_VDF "Enable Gothic I/II VDF archive support" TRUE)
|
||||
if(NOT PHYSFS_ARCHIVE_VDF)
|
||||
add_definitions(-DPHYSFS_SUPPORTS_VDF=0)
|
||||
endif()
|
||||
|
||||
|
||||
option(PHYSFS_BUILD_STATIC "Build static library" TRUE)
|
||||
if(PHYSFS_BUILD_STATIC)
|
||||
add_library(physfs-static STATIC ${PHYSFS_SRCS})
|
||||
add_library(PhysFS::PhysFS-static ALIAS physfs-static)
|
||||
set_target_properties(physfs-static PROPERTIES EXPORT_NAME PhysFS-static)
|
||||
# Don't rename this on Windows, since DLLs will also produce an import
|
||||
# library named "physfs.lib" which would conflict; Unix tend to like the
|
||||
# same library name with a different extension for static libs, but
|
||||
# Windows can just have a separate name.
|
||||
if(NOT MSVC)
|
||||
set_target_properties(physfs-static PROPERTIES OUTPUT_NAME "physfs")
|
||||
endif()
|
||||
if(WINRT)
|
||||
# Ignore LNK4264 warnings; we don't author any WinRT components, just consume them, so we're okay in a static library.
|
||||
set_target_properties(physfs-static PROPERTIES VS_WINRT_COMPONENT True)
|
||||
set_target_properties(physfs-static PROPERTIES STATIC_LIBRARY_FLAGS "/ignore:4264")
|
||||
endif()
|
||||
if(WIN32 OR WINRT OR OS2)
|
||||
# no dll exports from the static library
|
||||
target_compile_definitions(physfs-static PRIVATE "PHYSFS_STATIC")
|
||||
endif()
|
||||
target_include_directories(physfs-static PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>")
|
||||
target_link_libraries(physfs-static PRIVATE ${OPTIONAL_LIBRARY_LIBS} ${OTHER_LDFLAGS})
|
||||
set(PHYSFS_LIB_TARGET physfs-static)
|
||||
list(APPEND PHYSFS_INSTALL_TARGETS "physfs-static")
|
||||
endif()
|
||||
|
||||
option(PHYSFS_BUILD_SHARED "Build shared library" TRUE)
|
||||
if(PHYSFS_BUILD_SHARED)
|
||||
add_library(physfs SHARED ${PHYSFS_SRCS})
|
||||
add_library(PhysFS::PhysFS ALIAS physfs)
|
||||
set_target_properties(physfs PROPERTIES MACOSX_RPATH 1)
|
||||
set_target_properties(physfs PROPERTIES VERSION ${PHYSFS_VERSION})
|
||||
set_target_properties(physfs PROPERTIES SOVERSION ${PHYSFS_SOVERSION})
|
||||
set_target_properties(physfs PROPERTIES EXPORT_NAME PhysFS)
|
||||
if(WINRT)
|
||||
set_target_properties(physfs PROPERTIES VS_WINRT_COMPONENT True)
|
||||
endif()
|
||||
if(OS2) # OS/2 does not support a DLL name longer than 8 characters.
|
||||
set_target_properties(physfs PROPERTIES OUTPUT_NAME "physfs")
|
||||
endif()
|
||||
target_include_directories(physfs PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>")
|
||||
target_link_libraries(physfs PRIVATE ${OPTIONAL_LIBRARY_LIBS} ${OTHER_LDFLAGS})
|
||||
set(PHYSFS_LIB_TARGET physfs)
|
||||
list(APPEND PHYSFS_INSTALL_TARGETS "physfs")
|
||||
endif()
|
||||
|
||||
if(NOT PHYSFS_BUILD_SHARED AND NOT PHYSFS_BUILD_STATIC)
|
||||
message(FATAL "Both shared and static libraries are disabled!")
|
||||
endif()
|
||||
|
||||
# CMake FAQ says I need this...
|
||||
if(PHYSFS_BUILD_SHARED AND PHYSFS_BUILD_STATIC AND NOT WIN32)
|
||||
set_target_properties(physfs PROPERTIES CLEAN_DIRECT_OUTPUT 1)
|
||||
set_target_properties(physfs-static PROPERTIES CLEAN_DIRECT_OUTPUT 1)
|
||||
endif()
|
||||
|
||||
option(PHYSFS_BUILD_TEST "Build stdio test program." TRUE)
|
||||
mark_as_advanced(PHYSFS_BUILD_TEST)
|
||||
if(PHYSFS_BUILD_TEST)
|
||||
find_path(READLINE_H readline/readline.h)
|
||||
find_path(HISTORY_H readline/history.h)
|
||||
if(READLINE_H AND HISTORY_H)
|
||||
find_library(CURSES_LIBRARY NAMES curses ncurses)
|
||||
if(CURSES_LIBRARY)
|
||||
set(CMAKE_REQUIRED_LIBRARIES ${CURSES_LIBRARY})
|
||||
find_library(READLINE_LIBRARY readline)
|
||||
if(READLINE_LIBRARY)
|
||||
set(HAVE_SYSTEM_READLINE TRUE)
|
||||
list(APPEND TEST_PHYSFS_LIBS ${READLINE_LIBRARY} ${CURSES_LIBRARY})
|
||||
include_directories(SYSTEM ${READLINE_H} ${HISTORY_H})
|
||||
add_definitions(-DPHYSFS_HAVE_READLINE=1)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
add_executable(test_physfs test/test_physfs.c)
|
||||
target_link_libraries(test_physfs PRIVATE ${PHYSFS_LIB_TARGET} ${TEST_PHYSFS_LIBS} ${OTHER_LDFLAGS})
|
||||
list(APPEND PHYSFS_INSTALL_TARGETS test_physfs)
|
||||
endif()
|
||||
|
||||
option(PHYSFS_DISABLE_INSTALL "Disable installing PhysFS" OFF)
|
||||
if(NOT PHYSFS_DISABLE_INSTALL)
|
||||
|
||||
install(TARGETS ${PHYSFS_INSTALL_TARGETS} EXPORT PhysFSExport
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
|
||||
install(FILES src/physfs.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
|
||||
|
||||
install(EXPORT PhysFSExport
|
||||
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/PhysFS"
|
||||
FILE PhysFSConfig.cmake
|
||||
NAMESPACE PhysFS::
|
||||
)
|
||||
|
||||
if(NOT MSVC)
|
||||
configure_file(
|
||||
"extras/physfs.pc.in"
|
||||
"extras/physfs.pc"
|
||||
@ONLY
|
||||
)
|
||||
|
||||
install(
|
||||
FILES "${CMAKE_CURRENT_BINARY_DIR}/extras/physfs.pc"
|
||||
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
option(PHYSFS_BUILD_DOCS "Build doxygen based documentation" TRUE)
|
||||
if(PHYSFS_BUILD_DOCS)
|
||||
find_package(Doxygen)
|
||||
if(DOXYGEN_FOUND)
|
||||
set(PHYSFS_OUTPUT_DOXYFILE "${CMAKE_CURRENT_BINARY_DIR}/Doxyfile")
|
||||
configure_file(
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/docs/Doxyfile"
|
||||
"${PHYSFS_OUTPUT_DOXYFILE}"
|
||||
COPYONLY
|
||||
)
|
||||
file(APPEND "${PHYSFS_OUTPUT_DOXYFILE}" "\n\n# Below auto-generated by cmake...\n\n")
|
||||
file(APPEND "${PHYSFS_OUTPUT_DOXYFILE}" "PROJECT_NUMBER = \"${PHYSFS_VERSION}\"\n")
|
||||
file(APPEND "${PHYSFS_OUTPUT_DOXYFILE}" "OUTPUT_DIRECTORY = \"${CMAKE_CURRENT_BINARY_DIR}/docs\"\n")
|
||||
file(APPEND "${PHYSFS_OUTPUT_DOXYFILE}" "\n# End auto-generated section.\n\n")
|
||||
|
||||
set(PHYSFS_TARGETNAME_DOCS "docs" CACHE STRING "Name of 'docs' build target")
|
||||
|
||||
add_custom_target(
|
||||
${PHYSFS_TARGETNAME_DOCS}
|
||||
${DOXYGEN_EXECUTABLE} "${PHYSFS_OUTPUT_DOXYFILE}"
|
||||
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
|
||||
COMMENT "Building documentation in 'docs' directory..."
|
||||
)
|
||||
|
||||
else()
|
||||
message(STATUS "Doxygen not found. You won't be able to build documentation.")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(UNIX)
|
||||
set(PHYSFS_TARBALL "${CMAKE_CURRENT_SOURCE_DIR}/../physfs-${PHYSFS_VERSION}.tar.gz")
|
||||
|
||||
set(PHYSFS_TARGETNAME_DIST "dist" CACHE STRING "Name of 'dist' build target")
|
||||
add_custom_target(
|
||||
${PHYSFS_TARGETNAME_DIST}
|
||||
git archive --prefix="physfs-${PHYSFS_VERSION}/" --output="${PHYSFS_TARBALL}" HEAD
|
||||
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
|
||||
COMMENT "Building source tarball '${PHYSFS_TARBALL}'..."
|
||||
)
|
||||
|
||||
set(PHYSFS_TARGETNAME_UNINSTALL "uninstall" CACHE STRING "Name of 'uninstall' build target")
|
||||
add_custom_target(
|
||||
${PHYSFS_TARGETNAME_UNINSTALL}
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/extras/uninstall.sh"
|
||||
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
|
||||
COMMENT "Uninstall the project..."
|
||||
)
|
||||
endif()
|
||||
|
||||
|
||||
macro(message_bool_option _NAME _VALUE)
|
||||
if(${_VALUE})
|
||||
message(STATUS " ${_NAME}: enabled")
|
||||
else()
|
||||
message(STATUS " ${_NAME}: disabled")
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
message(STATUS "PhysicsFS will build with the following options:")
|
||||
message_bool_option("ZIP support" PHYSFS_ARCHIVE_ZIP)
|
||||
message_bool_option("7zip support" PHYSFS_ARCHIVE_7Z)
|
||||
message_bool_option("GRP support" PHYSFS_ARCHIVE_GRP)
|
||||
message_bool_option("WAD support" PHYSFS_ARCHIVE_WAD)
|
||||
message_bool_option("HOG support" PHYSFS_ARCHIVE_HOG)
|
||||
message_bool_option("MVL support" PHYSFS_ARCHIVE_MVL)
|
||||
message_bool_option("QPAK support" PHYSFS_ARCHIVE_QPAK)
|
||||
message_bool_option("SLB support" PHYSFS_ARCHIVE_SLB)
|
||||
message_bool_option("VDF support" PHYSFS_ARCHIVE_VDF)
|
||||
message_bool_option("ISO9660 support" PHYSFS_ARCHIVE_ISO9660)
|
||||
message_bool_option("Build static library" PHYSFS_BUILD_STATIC)
|
||||
message_bool_option("Build shared library" PHYSFS_BUILD_SHARED)
|
||||
message_bool_option("Build stdio test program" PHYSFS_BUILD_TEST)
|
||||
message_bool_option("Build Doxygen documentation" PHYSFS_BUILD_DOCS)
|
||||
if(PHYSFS_BUILD_TEST)
|
||||
message_bool_option(" Use readline in test program" HAVE_SYSTEM_READLINE)
|
||||
endif()
|
||||
|
||||
# end of CMakeLists.txt ...
|
71
CREDITS
71
CREDITS
|
@ -1,71 +0,0 @@
|
|||
Initial API interface and implementation,
|
||||
Unix support,
|
||||
Win32 support,
|
||||
BeOS support,
|
||||
POSIX support,
|
||||
OS/2 support,
|
||||
GRP archiver,
|
||||
DIR archiver,
|
||||
ZIP archiver,
|
||||
QPAK archiver,
|
||||
MacOS Classic support:
|
||||
Ryan C. Gordon
|
||||
|
||||
Tons of win32 help:
|
||||
Adam Gates
|
||||
|
||||
More win32 hacking:
|
||||
Gregory S. Read
|
||||
|
||||
Fixes for missing current working directories,
|
||||
PHYSFS_setSaneConfig() improvements,
|
||||
other bugfixes:
|
||||
David Hedbor
|
||||
|
||||
Darwin support:
|
||||
Patrick Stein
|
||||
|
||||
configure fixes,
|
||||
RPM specfile:
|
||||
Edward Rudd
|
||||
|
||||
GetLastModTime API,
|
||||
other stuff:
|
||||
John R. Hall
|
||||
|
||||
Various support, fixes and suggestions:
|
||||
Alexander Pipelka
|
||||
|
||||
Russian translation,
|
||||
Ruby bindings,
|
||||
QPAK archiver:
|
||||
Ed Sinjiashvili
|
||||
|
||||
French translation:
|
||||
Stéphane Peter
|
||||
|
||||
Debian package support:
|
||||
Colin Bayer
|
||||
|
||||
"abs-file.h" in "extras" dir:
|
||||
Adam D. Moss
|
||||
|
||||
WinCE port and other Win32 patches:
|
||||
Corona688
|
||||
|
||||
German translation:
|
||||
Michael Renner
|
||||
|
||||
Apple Project Builder support,
|
||||
MacOS X improvements:
|
||||
Eric Wing
|
||||
|
||||
HOG archiver,
|
||||
MVL archiver,
|
||||
Bradley Bell
|
||||
|
||||
Other stuff:
|
||||
Your name here! Patches go to icculus@clutteredmind.org ...
|
||||
|
||||
/* end of CREDITS ... */
|
||||
|
BIN
CWProjects.sitx
BIN
CWProjects.sitx
Binary file not shown.
133
INSTALL
133
INSTALL
|
@ -1,133 +0,0 @@
|
|||
|
||||
The latest PhysicsFS information and releases can be found at:
|
||||
http://icculus.org/physfs/
|
||||
|
||||
Building is (ahem) very easy.
|
||||
|
||||
|
||||
ALL PLATFORMS:
|
||||
|
||||
Please understand your rights and mine: read the text file LICENSE in the root
|
||||
of the source tree. If you can't abide by it, delete this source tree now.
|
||||
|
||||
If you've got Doxygen (http://www.doxygen.org/) installed, you can run it
|
||||
without any command line arguments in the root of the source tree to generate
|
||||
the API reference. This is optional. You can browse the API docs online
|
||||
here: http://icculus.org/physfs/docs/
|
||||
|
||||
|
||||
|
||||
UNIX:
|
||||
(If you got this code from CVS, run "./bootstrap" first.)
|
||||
|
||||
Run ./configure --help and see what features can be optionally enabled or
|
||||
disabled. "./configure" does its best to pick optimal defaults for your
|
||||
platform.
|
||||
|
||||
Run "make".
|
||||
As root, run "make install".
|
||||
If you get sick of the library, run "make uninstall" as root and it will
|
||||
remove all traces of the library from the system paths.
|
||||
|
||||
Primary Unix development is done with GNU/Linux, but PhysicsFS is known to
|
||||
work out of the box with several flavors of Unix. It it doesn't work, patches
|
||||
to get it running can be sent to icculus@clutteredmind.org.
|
||||
|
||||
|
||||
BeOS:
|
||||
Use the "Unix" instructions, above.
|
||||
|
||||
|
||||
AtheOS:
|
||||
Use the "Unix" instructions, above.
|
||||
|
||||
|
||||
WIN32:
|
||||
If building with CygWin, mingw32 or something else that uses the GNU
|
||||
toolchain, follow the Unix instructions, above.
|
||||
|
||||
If you're using Visual C++ 6, point it at "physfs.dsp" in the root of the
|
||||
source tree, and build. This will produce a "physfs.dll" and "physfs.lib"
|
||||
(shared library and import lib, respectively) in either a "Debug" or
|
||||
"Release" directory, depending on what configuration you chose to build.
|
||||
After building the lib, you can make sure it works by building the
|
||||
"test_physfs.dsp" project file, which will create "test_physfs.exe" in
|
||||
"Debug" or "Release". This EXE is linked against the DLL you built
|
||||
previously.
|
||||
|
||||
If you're using Visual C++ 6 and want to generate a static LIB file, point
|
||||
it at "physfs_static.dsp" in the root of the source tree and build. This
|
||||
will produce a "physfs_static.lib" in either a "physfs_static_debug"
|
||||
or a "physfs_static_release" directory, depending on what configuration
|
||||
you chose to build. NOPE: "test_physfs.dsp" does not work with the
|
||||
statically linked build.
|
||||
|
||||
Visual Studio.NET users should do the same thing, but use the "physfs.vcproj"
|
||||
and "test_physfs.vcproj" project files instead.
|
||||
|
||||
NOTE: to change build options such as which drivers are loaded (ZIP, QPAK,
|
||||
etc.) modify the appropriate manifest constants under the Project Settings.
|
||||
By default the LIB version supports all drivers, but the DLL build does
|
||||
not support MVL or HOG file formats.
|
||||
|
||||
If you're using another compiler, send me a patch when you get it working. :)
|
||||
|
||||
No one's tried building this for a WinCE (PocketPC) platform, but it may or
|
||||
may not work. Patches are welcome.
|
||||
|
||||
If someone is willing to maintain prebuilt PhysicsFS DLLs, I'd like to hear
|
||||
from you; send an email to icculus@clutteredmind.org.
|
||||
|
||||
MACOS 8/9:
|
||||
Double-click on "CWProjects.sit" in the root of the source tree. This will
|
||||
unpack into a folder called "Mac Classic Support", which has CodeWarrior 6
|
||||
project files.
|
||||
|
||||
Point CodeWarrior at "physfs.mcp" in that new folder, and build. This will
|
||||
produce a "PhysicsFS" or "PhysicsFS Debug" shared library, depending on what
|
||||
configuration you chose to build. After building the lib, you can make sure
|
||||
it works by building the "test_physfs.mcp" project file, which will create
|
||||
"test_physfs" or "test_physfs Debug". These binaries are linked against the
|
||||
DLLs you built previously.
|
||||
|
||||
If someone is willing to maintain prebuilt PhysicsFS Shared Libraries for
|
||||
the Mac, I'd like to hear from you; send an email to icculus@clutteredmind.org.
|
||||
|
||||
|
||||
|
||||
MACOS X:
|
||||
You (currently) need to use the freeware Apple Developer Tools, which are
|
||||
based on the GNU toolchain. Fire up a terminal and run "cc"...if this reports
|
||||
"no input files" then you've got the tools installed.
|
||||
|
||||
Follow the Unix directions, above (configure, make, make install).
|
||||
|
||||
If someone is willing to maintain prebuilt PhysicsFS Shared Libraries for
|
||||
MacOS X, I'd like to hear from you; send an email to icculus@clutteredmind.org.
|
||||
|
||||
|
||||
OS/2:
|
||||
You need EMX installed. I tried this on a stock Warp 4 install, no fixpaks.
|
||||
I used the latest EMX and patches (which are several years old now). You need
|
||||
to install link386.exe (Selective Install, "link object modules" option). Once
|
||||
EMX is installed correctly, unpack the source to PhysicsFS and run the script
|
||||
file "makeos2.cmd". I know this isn't ideal, but I wanted to have this build
|
||||
without users having to hunt down a "make" program (While several exist, EMX
|
||||
doesn't come with one). If someone wants to hack some REXX to make this a bit
|
||||
more piccky about recompiling, I'll accept the patch.
|
||||
|
||||
If someone is willing to maintain prebuilt PhysicsFS Shared Libraries for
|
||||
OS/2, I'd like to hear from you; send an email to icculus@clutteredmind.org.
|
||||
|
||||
|
||||
OTHER PLATFORMS:
|
||||
Many Unix-like platforms might "just work" with the GNU autoconf tools. Some
|
||||
of these platforms are known to have worked at one time, but have not been
|
||||
heavily tested, if tested at all. PhysicsFS is, as far as we know, 64-bit and
|
||||
byteorder clean, and is known to compile on several compilers across many
|
||||
platforms. To implement a new platform or archiver, please read the
|
||||
heavily-commented physfs_internal.h and look in the platform/ and archiver/
|
||||
directories for examples.
|
||||
|
||||
--ryan. (icculus@clutteredmind.org)
|
||||
|
29
LICENSE
29
LICENSE
|
@ -1,29 +0,0 @@
|
|||
|
||||
Copyright (c) 2003 Ryan C. Gordon and others.
|
||||
|
||||
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.
|
||||
|
||||
Ryan C. Gordon <icculus@clutteredmind.org>
|
||||
|
||||
|
||||
(Please note that versions of PhysicsFS prior to 0.1.9 are licensed under
|
||||
the GNU Lesser General Public License, which restricts you significantly more.
|
||||
For your own safety, please make sure you've got 0.1.9 or later if you plan
|
||||
to use physfs in a commercial or closed-source project.)
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
Copyright (c) 2001-2022 Ryan C. Gordon <icculus@icculus.org> and others.
|
||||
|
||||
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.
|
|
@ -1,158 +0,0 @@
|
|||
lib_LTLIBRARIES = libphysfs.la
|
||||
|
||||
libphysfsincludedir = $(includedir)
|
||||
libphysfsinclude_HEADERS = \
|
||||
physfs.h
|
||||
|
||||
if BUILD_MACOSX
|
||||
|
||||
ZLIB_FILES = zlib121/adler32.c \
|
||||
zlib121/compress.c \
|
||||
zlib121/crc32.c \
|
||||
zlib121/crc32.h \
|
||||
zlib121/deflate.c \
|
||||
zlib121/deflate.h \
|
||||
zlib121/gzio.c \
|
||||
zlib121/infback.c \
|
||||
zlib121/inffast.c \
|
||||
zlib121/inffast.h \
|
||||
zlib121/inffixed.h \
|
||||
zlib121/inflate.c \
|
||||
zlib121/inflate.h \
|
||||
zlib121/inftrees.c \
|
||||
zlib121/inftrees.h \
|
||||
zlib121/trees.c \
|
||||
zlib121/trees.h \
|
||||
zlib121/uncompr.c \
|
||||
zlib121/zconf.h \
|
||||
zlib121/zlib.h \
|
||||
zlib121/zutil.c \
|
||||
zlib121/zutil.h
|
||||
|
||||
|
||||
if BUILD_ZLIB
|
||||
ZLIB_SRC = $(ZLIB_FILES)
|
||||
ZLIB_INC = -I$(top_srcdir)/zlib121
|
||||
ZLIB_EXTRADIST =
|
||||
else
|
||||
ZLIB_SRC =
|
||||
ZLIB_INC =
|
||||
ZLIB_EXTRADIST = $(ZLIB_FILES)
|
||||
endif
|
||||
|
||||
libphysfs_la_SOURCES = \
|
||||
physfs.c \
|
||||
physfs_internal.h \
|
||||
physfs_byteorder.c \
|
||||
archivers/dir.c \
|
||||
archivers/grp.c \
|
||||
archivers/wad.c \
|
||||
archivers/hog.c \
|
||||
archivers/mvl.c \
|
||||
archivers/zip.c \
|
||||
archivers/qpak.c \
|
||||
platform/unix.c \
|
||||
platform/posix.c \
|
||||
$(ZLIB_SRC)
|
||||
|
||||
libphysfs_la_INCLUDES = $(ZLIB_INC)
|
||||
|
||||
libphysfs_la_LDFLAGS = \
|
||||
-release $(LT_RELEASE) \
|
||||
-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
|
||||
|
||||
|
||||
if BUILD_TEST_PHYSFS
|
||||
bin_PROGRAMS = test_physfs
|
||||
test_physfs_INCLUDES = -I$(top_srcdir)
|
||||
test_physfs_LDADD = $(top_srcdir)/libphysfs.la
|
||||
test_physfs_SOURCES = test/test_physfs.c
|
||||
TEST_EXTRADIST =
|
||||
else
|
||||
TEST_EXTRADIST = test/test_physfs.c
|
||||
endif
|
||||
|
||||
|
||||
EXTRA_DIST = \
|
||||
CREDITS \
|
||||
LICENSE \
|
||||
CHANGELOG \
|
||||
INSTALL \
|
||||
TODO \
|
||||
Doxyfile \
|
||||
CWProjects.sitx \
|
||||
physfs.spec \
|
||||
physfs.dsp \
|
||||
test_physfs.dsp \
|
||||
physfs_static.dsp \
|
||||
physfs.vcproj \
|
||||
test_physfs.vcproj \
|
||||
platform/skeleton.c \
|
||||
platform/macclassic.c \
|
||||
platform/win32.c \
|
||||
platform/beos.cpp \
|
||||
platform/os2.c \
|
||||
extras/physfsrwops.h \
|
||||
extras/physfsrwops.c \
|
||||
extras/physfshttpd.c \
|
||||
Makefile.am.oldautomake \
|
||||
Makefile.am.newautomake \
|
||||
zlib_license_change.txt \
|
||||
makeos2.cmd \
|
||||
PBProjects \
|
||||
$(ZLIB_EXTRADIST) $(BEOS_EXTRADIST) $(TEST_EXTRADIST)
|
||||
|
||||
else
|
||||
|
||||
SUBDIRS = platform archivers zlib121 . test extras
|
||||
|
||||
libphysfs_la_SOURCES = \
|
||||
physfs.c \
|
||||
physfs_internal.h \
|
||||
physfs_byteorder.c
|
||||
|
||||
if BUILD_ZLIB
|
||||
ZLIB_LIB = zlib121/libz.la
|
||||
else
|
||||
ZLIB_LIB =
|
||||
endif
|
||||
|
||||
libphysfs_la_LDFLAGS = \
|
||||
-release $(LT_RELEASE) \
|
||||
-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
|
||||
libphysfs_la_LIBADD = \
|
||||
archivers/libarchivers.la \
|
||||
platform/libplatform.la \
|
||||
$(ZLIB_LIB)
|
||||
|
||||
EXTRA_DIST = \
|
||||
CREDITS \
|
||||
LICENSE \
|
||||
CHANGELOG \
|
||||
INSTALL \
|
||||
TODO \
|
||||
Doxyfile \
|
||||
PBProjects \
|
||||
CWProjects.sitx \
|
||||
physfs.spec.in \
|
||||
physfs.spec \
|
||||
physfs.dsp \
|
||||
test_physfs.dsp \
|
||||
physfs_static.dsp \
|
||||
physfs.vcproj \
|
||||
test_physfs.vcproj \
|
||||
zlib_license_change.txt \
|
||||
makeos2.cmd
|
||||
|
||||
|
||||
endif
|
||||
|
||||
|
||||
dist-hook:
|
||||
perl -w -pi -e 'chomp; $$_ .= "\r\n";' $(distdir)/*.dsp $(distdir)/*.vcproj
|
||||
mkdir $(distdir)/docs
|
||||
echo "Docs are generated with the program "Doxygen" (http://www.doxygen.org/)," >> $(distdir)/docs/README
|
||||
echo " or can be read online at http://icculus.org/physfs/docs/" >> $(distdir)/docs/README
|
||||
echo >> $(distdir)/docs/README
|
||||
rm -rf `find $(distdir) -name "CVS" -type d`
|
||||
|
|
@ -1,53 +0,0 @@
|
|||
lib_LTLIBRARIES = libphysfs.la
|
||||
|
||||
SUBDIRS = platform archivers zlib121 . test extras
|
||||
|
||||
libphysfsincludedir = $(includedir)
|
||||
libphysfsinclude_HEADERS = \
|
||||
physfs.h
|
||||
|
||||
libphysfs_la_SOURCES = \
|
||||
physfs.c \
|
||||
physfs_internal.h \
|
||||
physfs_byteorder.c
|
||||
|
||||
if BUILD_ZLIB
|
||||
ZLIB_LIB = zlib121/libz.la
|
||||
else
|
||||
ZLIB_LIB =
|
||||
endif
|
||||
|
||||
libphysfs_la_LDFLAGS = \
|
||||
-release $(LT_RELEASE) \
|
||||
-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
|
||||
libphysfs_la_LIBADD = \
|
||||
archivers/libarchivers.la \
|
||||
platform/libplatform.la \
|
||||
$(ZLIB_LIB)
|
||||
|
||||
EXTRA_DIST = \
|
||||
CREDITS \
|
||||
LICENSE \
|
||||
CHANGELOG \
|
||||
INSTALL \
|
||||
TODO \
|
||||
Doxyfile \
|
||||
PBProjects \
|
||||
CWProjects.sitx \
|
||||
physfs.spec.in \
|
||||
physfs.spec \
|
||||
physfs.dsp \
|
||||
physfs_static.dsp \
|
||||
test_physfs.dsp \
|
||||
physfs.vcproj \
|
||||
test_physfs.vcproj \
|
||||
zlib_license_change.txt \
|
||||
makeos2.cmd
|
||||
|
||||
dist-hook:
|
||||
perl -w -pi -e 'chomp; $$_ .= "\r\n";' $(distdir)/*.dsp $(distdir)/*.vcproj
|
||||
mkdir $(distdir)/docs
|
||||
echo "Docs are generated with the program "Doxygen" (http://www.doxygen.org/)," >> $(distdir)/docs/README
|
||||
echo " or can be read online at http://icculus.org/physfs/docs/" >> $(distdir)/docs/README
|
||||
echo >> $(distdir)/docs/README
|
||||
rm -rf `find $(distdir) -name "CVS" -type d`
|
Binary file not shown.
|
@ -1,25 +0,0 @@
|
|||
This is an unofficial OS X Project Builder environment to build a physfs Framework.
|
||||
|
||||
|
||||
Built with:
|
||||
physfs 0.1.9
|
||||
Project Builder 2.0.1
|
||||
OS X (10.2 Jaguar)
|
||||
|
||||
This project was created by brainlessly mimicking the SDL (Simple Direct Media
|
||||
Layer) Project Builder projects. The scripts were also shamelessly taken from
|
||||
SDL as well. There may be errors. Use at your own risk!
|
||||
|
||||
This project creates 2 installer packages:
|
||||
|
||||
- A physfs framework for development (for people who wish to link to physfs)
|
||||
|
||||
- A physfs framework for users (for users who run programs that used the above
|
||||
package
|
||||
|
||||
This project also builds static libraries for physfs (to build physfs and physfsc) but
|
||||
they are not installed anywhere. If you wish to use them, you will need to
|
||||
copy them out of the build directory.
|
||||
|
||||
Eric Wing <ewing2121@yahoo.com>
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
|
||||
EXPORTS = SDL_sound.x
|
||||
HEADERS = \
|
||||
../../SDL_sound.h
|
||||
|
||||
all: $(EXPORTS)
|
||||
|
||||
$(EXPORTS): $(HEADERS)
|
||||
perl gendef.pl $(HEADERS) >$@ || rm $@
|
||||
|
||||
clean:
|
||||
rm -f $(EXPORTS)
|
|
@ -1,20 +0,0 @@
|
|||
#!/usr/bin/perl
|
||||
#
|
||||
# Program to take a set of header files and generate DLL export definitions
|
||||
|
||||
while ( ($file = shift(@ARGV)) ) {
|
||||
if ( ! defined(open(FILE, $file)) ) {
|
||||
warn "Couldn't open $file: $!\n";
|
||||
next;
|
||||
}
|
||||
$printed_header = 0;
|
||||
$file =~ s,.*/,,;
|
||||
while (<FILE>) {
|
||||
if ( /^__EXPORT__.*\s\**([^\s\(]+)\(/ ) {
|
||||
print "\t_$1\n";
|
||||
} elsif ( /^__EXPORT__.*\s\**([^\s\(]+)$/ ) {
|
||||
print "\t_$1\n";
|
||||
}
|
||||
}
|
||||
close(FILE);
|
||||
}
|
|
@ -1,73 +0,0 @@
|
|||
_PHYSFS_getLinkedVersion
|
||||
_PHYSFS_init
|
||||
_PHYSFS_deinit
|
||||
_PHYSFS_supportedArchiveTypes
|
||||
_PHYSFS_freeList
|
||||
_PHYSFS_getLastError
|
||||
_PHYSFS_getDirSeparator
|
||||
_PHYSFS_permitSymbolicLinks
|
||||
_PHYSFS_getCdRomDirs
|
||||
_PHYSFS_getBaseDir
|
||||
_PHYSFS_getUserDir
|
||||
_PHYSFS_getWriteDir
|
||||
_PHYSFS_setWriteDir
|
||||
_PHYSFS_addToSearchPath
|
||||
_PHYSFS_removeFromSearchPath
|
||||
_PHYSFS_getSearchPath
|
||||
_PHYSFS_setSaneConfig
|
||||
_PHYSFS_mkdir
|
||||
_PHYSFS_delete
|
||||
_PHYSFS_getRealDir
|
||||
_PHYSFS_enumerateFiles
|
||||
_PHYSFS_exists
|
||||
_PHYSFS_isDirectory
|
||||
_PHYSFS_isSymbolicLink
|
||||
_PHYSFS_getLastModTime
|
||||
_PHYSFS_openWrite
|
||||
_PHYSFS_openAppend
|
||||
_PHYSFS_openRead
|
||||
_PHYSFS_close
|
||||
_PHYSFS_read
|
||||
_PHYSFS_write
|
||||
_PHYSFS_eof
|
||||
_PHYSFS_tell
|
||||
_PHYSFS_seek
|
||||
_PHYSFS_fileLength
|
||||
_PHYSFS_setBuffer
|
||||
_PHYSFS_flush
|
||||
_PHYSFS_swapSLE16
|
||||
_PHYSFS_swapULE16
|
||||
_PHYSFS_swapSLE32
|
||||
_PHYSFS_swapULE32
|
||||
_PHYSFS_swapSLE64
|
||||
_PHYSFS_swapULE64
|
||||
_PHYSFS_swapSBE16
|
||||
_PHYSFS_swapUBE16
|
||||
_PHYSFS_swapSBE32
|
||||
_PHYSFS_swapUBE32
|
||||
_PHYSFS_swapSBE64
|
||||
_PHYSFS_swapUBE64
|
||||
_PHYSFS_readSLE16
|
||||
_PHYSFS_readULE16
|
||||
_PHYSFS_readSBE16
|
||||
_PHYSFS_readUBE16
|
||||
_PHYSFS_readSLE32
|
||||
_PHYSFS_readULE32
|
||||
_PHYSFS_readSBE32
|
||||
_PHYSFS_readUBE32
|
||||
_PHYSFS_readSLE64
|
||||
_PHYSFS_readULE64
|
||||
_PHYSFS_readSBE64
|
||||
_PHYSFS_readUBE64
|
||||
_PHYSFS_writeSLE16
|
||||
_PHYSFS_writeULE16
|
||||
_PHYSFS_writeSBE16
|
||||
_PHYSFS_writeUBE16
|
||||
_PHYSFS_writeSLE32
|
||||
_PHYSFS_writeULE32
|
||||
_PHYSFS_writeSBE32
|
||||
_PHYSFS_writeUBE32
|
||||
_PHYSFS_writeSLE64
|
||||
_PHYSFS_writeULE64
|
||||
_PHYSFS_writeSBE64
|
||||
_PHYSFS_writeUBE64
|
|
@ -1,20 +0,0 @@
|
|||
#!/bin/csh
|
||||
|
||||
###
|
||||
## This script creates "PBProjects.tar.gz" in the parent directory
|
||||
###
|
||||
|
||||
# remove build products
|
||||
rm -rf build
|
||||
|
||||
# remove Finder info files
|
||||
find . -name ".DS_Store" -exec rm "{}" ";"
|
||||
|
||||
# remove user project prefs
|
||||
find . -name "*.pbxuser" -exec rm "{}" ";"
|
||||
|
||||
# create the archive
|
||||
(cd .. && gnutar -zcvf PBProjects.tar.gz PBProjects)
|
||||
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
|
@ -1,7 +0,0 @@
|
|||
This is an example portable filesystem.
|
||||
The API can be found in the file ~/Library/Frameworks/physfs.framework/Headers/physfs.h
|
||||
|
||||
The source code is available from:
|
||||
http://www.icculus.org/physfs/
|
||||
|
||||
This library is distributed under the terms of the zlib license: http://www.opensource.org/licenses/zlib-license.php
|
|
@ -1,3 +0,0 @@
|
|||
This package installs the developer version of the physfs library and associated files.
|
||||
|
||||
The physfs Framework is installed into ~/Library/Frameworks.
|
|
@ -1,19 +0,0 @@
|
|||
#!/bin/sh
|
||||
# finish up the installation
|
||||
# this script should be executed using the sudo command
|
||||
# this file is copied to physfs.post_install and physfs.post_upgrade
|
||||
# inside the .pkg bundle
|
||||
echo "Running post-install script"
|
||||
umask 022
|
||||
|
||||
ROOT=/Developer/Documentation/SDL
|
||||
|
||||
echo "Moving physfs.framework to ~/Library/Frameworks"
|
||||
# move SDL to its proper home, so the target stationary works
|
||||
mkdir -p ~/Library/Frameworks
|
||||
/Developer/Tools/CpMac -r $ROOT/physfs.framework ~/Library/Frameworks
|
||||
rm -rf $ROOT/physfs.framework
|
||||
|
||||
echo "Precompiling Header"
|
||||
# precompile header for speedier compiles
|
||||
/usr/bin/cc -I $HOME/Library/Frameworks/SDL.framework/Headers -precomp ~/Library/Frameworks/physfs.framework/Headers/physfs.h -o ~/Library/Frameworks/physfs.framework/Headers/physfs.p
|
|
@ -1,51 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Generic script to create a package with Project Builder in mind
|
||||
# There should only be one version of this script for all projects!
|
||||
|
||||
FRAMEWORK="$1"
|
||||
VARIANT="$2"
|
||||
|
||||
if test "$VARIANT" = "devel" ; then
|
||||
PACKAGE="$FRAMEWORK-devel"
|
||||
PACKAGE_RESOURCES="pkg-support/devel-resources"
|
||||
else
|
||||
PACKAGE="$FRAMEWORK"
|
||||
PACKAGE_RESOURCES="pkg-support/resources"
|
||||
fi
|
||||
|
||||
echo "Building package for $FRAMEWORK.framework"
|
||||
echo "Will fetch resources from $PACKAGE_RESOURCES"
|
||||
echo "Will create the package $PACKAGE.pkg"
|
||||
|
||||
# create a copy of the framework
|
||||
mkdir -p build/pkg-tmp
|
||||
/Developer/Tools/CpMac -r "build/$FRAMEWORK.framework" build/pkg-tmp/
|
||||
|
||||
|
||||
if test "$VARIANT" = "standard" ; then
|
||||
rm -rf "build/pkg-tmp/$FRAMEWORK.framework/Headers"
|
||||
rm -rf "build/pkg-tmp/$FRAMEWORK.framework/Versions/Current/Headers"
|
||||
fi
|
||||
|
||||
rm -rf build/pkg-tmp/$FRAMEWORK.framework/Resources/pbdevelopment.plist
|
||||
rm -rf $PACKAGE_RESOURCES/.DS_Store
|
||||
|
||||
# create the .pkg
|
||||
package build/pkg-tmp "pkg-support/$PACKAGE.info" -d build -r "$PACKAGE_RESOURCES"
|
||||
|
||||
if test "$VARIANT" = "devel" ; then
|
||||
# create install scripts
|
||||
DIR="build/$PACKAGE.pkg"
|
||||
cp "$DIR/install.sh" "$DIR/$PACKAGE.post_install"
|
||||
mv "$DIR/install.sh" "$DIR/$PACKAGE.post_upgrade"
|
||||
|
||||
# add execute flag to scripts
|
||||
chmod 755 "$DIR/$PACKAGE.post_install" "$DIR/$PACKAGE.post_upgrade"
|
||||
fi
|
||||
|
||||
# remove temporary files
|
||||
rm -rf build/pkg-tmp
|
||||
|
||||
# compress
|
||||
(cd build; tar -zcvf "$PACKAGE.pkg.tar.gz" "$PACKAGE.pkg")
|
|
@ -1,15 +0,0 @@
|
|||
Title PhysFS-Devel 1.0.0
|
||||
Version 1
|
||||
Description PhysicsFS Library for Mac OS X (http://www.icculus.org/physfs/)
|
||||
DefaultLocation /Developer/Documentation/physfs
|
||||
Diskname (null)
|
||||
DeleteWarning
|
||||
NeedsAuthorization YES
|
||||
DisableStop NO
|
||||
UseUserMask YES
|
||||
Application NO
|
||||
Relocatable NO
|
||||
Required NO
|
||||
InstallOnly NO
|
||||
RequiresReboot NO
|
||||
InstallFat NO
|
|
@ -1,15 +0,0 @@
|
|||
Title PhysFS 1.0.0
|
||||
Version 1
|
||||
Description PhysicsFS Library for Mac OS X (http://www.icculus.org/physfs/)
|
||||
DefaultLocation /Library/Frameworks
|
||||
Diskname (null)
|
||||
DeleteWarning
|
||||
NeedsAuthorization NO
|
||||
DisableStop NO
|
||||
UseUserMask NO
|
||||
Application NO
|
||||
Relocatable YES
|
||||
Required NO
|
||||
InstallOnly NO
|
||||
RequiresReboot NO
|
||||
InstallFat NO
|
|
@ -1,6 +0,0 @@
|
|||
This is an example portable file system.
|
||||
|
||||
The source code is available from:
|
||||
http://www.icculus.org/physfs/
|
||||
|
||||
This library is distributed under the terms of the zlib license: http://www.opensource.org/licenses/zlib-license.php
|
|
@ -1,3 +0,0 @@
|
|||
This package installs the physfs library into /Library/Frameworks. You can also install it in
|
||||
<your home directory>/Library/Frameworks if your access privileges are not high enough.
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
#!/bin/csh
|
||||
|
||||
###
|
||||
## This script removes the Developer physfs package
|
||||
###
|
||||
|
||||
setenv HOME_DIR ~
|
||||
|
||||
sudo -v -p "Enter administrator password to remove physfs: "
|
||||
|
||||
sudo rm -rf "$HOME_DIR/Library/Frameworks/physfs.framework"
|
||||
|
||||
# will only remove the Frameworks dir if empty (since we put it there)
|
||||
sudo rmdir "$HOME_DIR/Library/Frameworks"
|
||||
|
||||
#sudo rm -r "$HOME_DIR/Readme physfs Developer.txt"
|
||||
sudo rm -r "/Developer/Documentation/physfs"
|
||||
sudo rm -r "/Developer/Documentation/ManPages/man1/physfs"*
|
||||
#sudo rm -r "/Developer/ProjectBuilder Extras/Project Templates/Application/physfs Application"
|
||||
#sudo rm -r "/Developer/ProjectBuilder Extras/Target Templates/physfs"
|
||||
sudo rm -r "/Library/Receipts/physfs-devel.pkg"
|
||||
|
||||
# rebuild apropos database
|
||||
sudo /usr/libexec/makewhatis
|
||||
|
||||
unsetenv HOME_DIR
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
|
||||
PhysicsFS; a portable, flexible file i/o abstraction.
|
||||
|
||||
https://icculus.org/physfs/
|
||||
|
||||
Please see the docs directory for documentation.
|
||||
|
||||
Please see LICENSE.txt for licensing information.
|
||||
|
24
TODO
24
TODO
|
@ -1,24 +0,0 @@
|
|||
Stuff that needs to be done and wishlist:
|
||||
|
||||
These are in no particular order.
|
||||
Some might be dupes, some might be done already.
|
||||
|
||||
- Other archivers: perhaps tar(.gz|.bz2), RPM, ARJ, etc. These are less
|
||||
important, since streaming archives aren't of much value to games (which
|
||||
is why zipfiles are king: random access), but it could have uses for, say,
|
||||
an installer/updater.
|
||||
- Stack allocate in stripAppleBundle() (platform/unix.c) instead of calloc().
|
||||
- Reduce malloc() pressure all over the place. We fragment memory like mad.
|
||||
- macclassic.c :
|
||||
"/* (Hmm. Default behaviour is broken in the base library. :) ) */"
|
||||
- Platforms to port to: Amiga (needs platform driver), DOS4GW (platform driver).
|
||||
- profile string list interpolation.
|
||||
- We have two different ways to find dir entries in zip.c.
|
||||
- Do symlinks in zip archiver work when they point to dirs?
|
||||
- Enable more warnings?
|
||||
- Use __cdecl in physfs.h?
|
||||
- Look for FIXMEs (many marked with "!!!" in comments).
|
||||
- Probably other stuff. Requests and recommendations are welcome.
|
||||
|
||||
// end of TODO ...
|
||||
|
11
acconfig.h
11
acconfig.h
|
@ -1,11 +0,0 @@
|
|||
|
||||
#undef DEBUG
|
||||
#undef DEBUG_CHATTER
|
||||
#undef NDEBUG
|
||||
#undef PHYSFS_SUPPORTS_ZIP
|
||||
#undef PHYSFS_SUPPORTS_GRP
|
||||
#undef PHYSFS_SUPPORTS_HOG
|
||||
#undef PHYSFS_SUPPORTS_MVL
|
||||
#undef PHYSFS_HAVE_READLINE
|
||||
#undef PHYSFS_HAVE_LLSEEK
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
Makefile
|
||||
.deps
|
||||
.libs
|
||||
unzip.lo
|
||||
dir.lo
|
||||
Makefile.in
|
||||
grp.lo
|
||||
hog.lo
|
||||
mvl.lo
|
||||
zip.lo
|
||||
libarchivers.la
|
||||
qpak.lo
|
||||
wad.lo
|
|
@ -1,17 +0,0 @@
|
|||
noinst_LTLIBRARIES = libarchivers.la
|
||||
|
||||
if BUILD_ZLIB
|
||||
INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/zlib121
|
||||
else
|
||||
INCLUDES = -I$(top_srcdir)
|
||||
endif
|
||||
|
||||
libarchivers_la_SOURCES = \
|
||||
dir.c \
|
||||
grp.c \
|
||||
wad.c \
|
||||
hog.c \
|
||||
mvl.c \
|
||||
zip.c \
|
||||
qpak.c
|
||||
|
376
archivers/dir.c
376
archivers/dir.c
|
@ -1,376 +0,0 @@
|
|||
/*
|
||||
* Standard directory I/O support routines for PhysicsFS.
|
||||
*
|
||||
* Please see the file LICENSE in the source's root directory.
|
||||
*
|
||||
* This file written by Ryan C. Gordon.
|
||||
*/
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "physfs.h"
|
||||
|
||||
#define __PHYSICSFS_INTERNAL__
|
||||
#include "physfs_internal.h"
|
||||
|
||||
static PHYSFS_sint64 DIR_read(FileHandle *handle, void *buffer,
|
||||
PHYSFS_uint32 objSize, PHYSFS_uint32 objCount);
|
||||
static PHYSFS_sint64 DIR_write(FileHandle *handle, const void *buffer,
|
||||
PHYSFS_uint32 objSize, PHYSFS_uint32 objCount);
|
||||
static PHYSFS_sint64 DIR_dummyRead(FileHandle *handle, void *buffer,
|
||||
PHYSFS_uint32 objSize, PHYSFS_uint32 objCount);
|
||||
static PHYSFS_sint64 DIR_dummyWrite(FileHandle *handle, const void *buffer,
|
||||
PHYSFS_uint32 objSize, PHYSFS_uint32 objCount);
|
||||
static int DIR_eof(FileHandle *handle);
|
||||
static PHYSFS_sint64 DIR_tell(FileHandle *handle);
|
||||
static int DIR_seek(FileHandle *handle, PHYSFS_uint64 offset);
|
||||
static PHYSFS_sint64 DIR_fileLength(FileHandle *handle);
|
||||
static int DIR_fileClose(FileHandle *handle);
|
||||
static int DIR_isArchive(const char *filename, int forWriting);
|
||||
static DirHandle *DIR_openArchive(const char *name, int forWriting);
|
||||
static LinkedStringList *DIR_enumerateFiles(DirHandle *h,
|
||||
const char *dname,
|
||||
int omitSymLinks);
|
||||
static int DIR_exists(DirHandle *h, const char *name);
|
||||
static int DIR_isDirectory(DirHandle *h, const char *name, int *fileExists);
|
||||
static int DIR_isSymLink(DirHandle *h, const char *name, int *fileExists);
|
||||
static FileHandle *DIR_openRead(DirHandle *h, const char *fnm, int *exist);
|
||||
static PHYSFS_sint64 DIR_getLastModTime(DirHandle *h, const char *f, int *e);
|
||||
static FileHandle *DIR_openWrite(DirHandle *h, const char *filename);
|
||||
static FileHandle *DIR_openAppend(DirHandle *h, const char *filename);
|
||||
static int DIR_remove(DirHandle *h, const char *name);
|
||||
static int DIR_mkdir(DirHandle *h, const char *name);
|
||||
static void DIR_dirClose(DirHandle *h);
|
||||
|
||||
|
||||
const PHYSFS_ArchiveInfo __PHYSFS_ArchiveInfo_DIR =
|
||||
{
|
||||
"",
|
||||
DIR_ARCHIVE_DESCRIPTION,
|
||||
"Ryan C. Gordon <icculus@clutteredmind.org>",
|
||||
"http://icculus.org/physfs/",
|
||||
};
|
||||
|
||||
|
||||
static const FileFunctions __PHYSFS_FileFunctions_DIR =
|
||||
{
|
||||
DIR_read, /* read() method */
|
||||
DIR_dummyWrite, /* write() method */
|
||||
DIR_eof, /* eof() method */
|
||||
DIR_tell, /* tell() method */
|
||||
DIR_seek, /* seek() method */
|
||||
DIR_fileLength, /* fileLength() method */
|
||||
DIR_fileClose /* fileClose() method */
|
||||
};
|
||||
|
||||
|
||||
static const FileFunctions __PHYSFS_FileFunctions_DIRW =
|
||||
{
|
||||
DIR_dummyRead, /* read() method */
|
||||
DIR_write, /* write() method */
|
||||
DIR_eof, /* eof() method */
|
||||
DIR_tell, /* tell() method */
|
||||
DIR_seek, /* seek() method */
|
||||
DIR_fileLength, /* fileLength() method */
|
||||
DIR_fileClose /* fileClose() method */
|
||||
};
|
||||
|
||||
|
||||
const DirFunctions __PHYSFS_DirFunctions_DIR =
|
||||
{
|
||||
&__PHYSFS_ArchiveInfo_DIR,
|
||||
DIR_isArchive, /* isArchive() method */
|
||||
DIR_openArchive, /* openArchive() method */
|
||||
DIR_enumerateFiles, /* enumerateFiles() method */
|
||||
DIR_exists, /* exists() method */
|
||||
DIR_isDirectory, /* isDirectory() method */
|
||||
DIR_isSymLink, /* isSymLink() method */
|
||||
DIR_getLastModTime, /* getLastModTime() method */
|
||||
DIR_openRead, /* openRead() method */
|
||||
DIR_openWrite, /* openWrite() method */
|
||||
DIR_openAppend, /* openAppend() method */
|
||||
DIR_remove, /* remove() method */
|
||||
DIR_mkdir, /* mkdir() method */
|
||||
DIR_dirClose /* dirClose() method */
|
||||
};
|
||||
|
||||
|
||||
static PHYSFS_sint64 DIR_read(FileHandle *handle, void *buffer,
|
||||
PHYSFS_uint32 objSize, PHYSFS_uint32 objCount)
|
||||
{
|
||||
PHYSFS_sint64 retval;
|
||||
retval = __PHYSFS_platformRead(handle->opaque, buffer, objSize, objCount);
|
||||
return(retval);
|
||||
} /* DIR_read */
|
||||
|
||||
|
||||
static PHYSFS_sint64 DIR_write(FileHandle *handle, const void *buffer,
|
||||
PHYSFS_uint32 objSize, PHYSFS_uint32 objCount)
|
||||
{
|
||||
PHYSFS_sint64 retval;
|
||||
retval = __PHYSFS_platformWrite(handle->opaque, buffer, objSize, objCount);
|
||||
return(retval);
|
||||
} /* DIR_write */
|
||||
|
||||
|
||||
static PHYSFS_sint64 DIR_dummyRead(FileHandle *handle, void *buffer,
|
||||
PHYSFS_uint32 objSize, PHYSFS_uint32 objCount)
|
||||
{
|
||||
BAIL_MACRO(ERR_NOT_SUPPORTED, -1);
|
||||
} /* DIR_dummyRead */
|
||||
|
||||
|
||||
static PHYSFS_sint64 DIR_dummyWrite(FileHandle *handle, const void *buffer,
|
||||
PHYSFS_uint32 objSize, PHYSFS_uint32 objCount)
|
||||
{
|
||||
BAIL_MACRO(ERR_NOT_SUPPORTED, -1);
|
||||
} /* DIR_dummyWrite */
|
||||
|
||||
|
||||
static int DIR_eof(FileHandle *handle)
|
||||
{
|
||||
return(__PHYSFS_platformEOF(handle->opaque));
|
||||
} /* DIR_eof */
|
||||
|
||||
|
||||
static PHYSFS_sint64 DIR_tell(FileHandle *handle)
|
||||
{
|
||||
return(__PHYSFS_platformTell(handle->opaque));
|
||||
} /* DIR_tell */
|
||||
|
||||
|
||||
static int DIR_seek(FileHandle *handle, PHYSFS_uint64 offset)
|
||||
{
|
||||
return(__PHYSFS_platformSeek(handle->opaque, offset));
|
||||
} /* DIR_seek */
|
||||
|
||||
|
||||
static PHYSFS_sint64 DIR_fileLength(FileHandle *handle)
|
||||
{
|
||||
return(__PHYSFS_platformFileLength(handle->opaque));
|
||||
} /* DIR_fileLength */
|
||||
|
||||
|
||||
static int DIR_fileClose(FileHandle *handle)
|
||||
{
|
||||
/*
|
||||
* we manually flush the buffer, since that's the place a close will
|
||||
* most likely fail, but that will leave the file handle in an undefined
|
||||
* state if it fails. Flush failures we can recover from.
|
||||
*/
|
||||
BAIL_IF_MACRO(!__PHYSFS_platformFlush(handle->opaque), NULL, 0);
|
||||
BAIL_IF_MACRO(!__PHYSFS_platformClose(handle->opaque), NULL, 0);
|
||||
free(handle);
|
||||
return(1);
|
||||
} /* DIR_fileClose */
|
||||
|
||||
|
||||
static int DIR_isArchive(const char *filename, int forWriting)
|
||||
{
|
||||
/* directories ARE archives in this driver... */
|
||||
return(__PHYSFS_platformIsDirectory(filename));
|
||||
} /* DIR_isArchive */
|
||||
|
||||
|
||||
static DirHandle *DIR_openArchive(const char *name, int forWriting)
|
||||
{
|
||||
const char *dirsep = PHYSFS_getDirSeparator();
|
||||
DirHandle *retval = NULL;
|
||||
size_t namelen = strlen(name);
|
||||
size_t seplen = strlen(dirsep);
|
||||
|
||||
BAIL_IF_MACRO(!DIR_isArchive(name, forWriting),
|
||||
ERR_UNSUPPORTED_ARCHIVE, NULL);
|
||||
|
||||
retval = (DirHandle *) malloc(sizeof (DirHandle));
|
||||
BAIL_IF_MACRO(retval == NULL, ERR_OUT_OF_MEMORY, NULL);
|
||||
retval->opaque = malloc(namelen + seplen + 1);
|
||||
if (retval->opaque == NULL)
|
||||
{
|
||||
free(retval);
|
||||
BAIL_MACRO(ERR_OUT_OF_MEMORY, NULL);
|
||||
} /* if */
|
||||
|
||||
/* make sure there's a dir separator at the end of the string */
|
||||
strcpy((char *) (retval->opaque), name);
|
||||
if (strcmp((name + namelen) - seplen, dirsep) != 0)
|
||||
strcat((char *) (retval->opaque), dirsep);
|
||||
|
||||
retval->funcs = &__PHYSFS_DirFunctions_DIR;
|
||||
|
||||
return(retval);
|
||||
} /* DIR_openArchive */
|
||||
|
||||
|
||||
static LinkedStringList *DIR_enumerateFiles(DirHandle *h,
|
||||
const char *dname,
|
||||
int omitSymLinks)
|
||||
{
|
||||
char *d = __PHYSFS_platformCvtToDependent((char *)(h->opaque),dname,NULL);
|
||||
LinkedStringList *retval;
|
||||
|
||||
BAIL_IF_MACRO(d == NULL, NULL, NULL);
|
||||
retval = __PHYSFS_platformEnumerateFiles(d, omitSymLinks);
|
||||
free(d);
|
||||
return(retval);
|
||||
} /* DIR_enumerateFiles */
|
||||
|
||||
|
||||
static int DIR_exists(DirHandle *h, const char *name)
|
||||
{
|
||||
char *f = __PHYSFS_platformCvtToDependent((char *)(h->opaque), name, NULL);
|
||||
int retval;
|
||||
|
||||
BAIL_IF_MACRO(f == NULL, NULL, 0);
|
||||
retval = __PHYSFS_platformExists(f);
|
||||
free(f);
|
||||
return(retval);
|
||||
} /* DIR_exists */
|
||||
|
||||
|
||||
static int DIR_isDirectory(DirHandle *h, const char *name, int *fileExists)
|
||||
{
|
||||
char *d = __PHYSFS_platformCvtToDependent((char *)(h->opaque), name, NULL);
|
||||
int retval = 0;
|
||||
|
||||
BAIL_IF_MACRO(d == NULL, NULL, 0);
|
||||
*fileExists = __PHYSFS_platformExists(d);
|
||||
if (*fileExists)
|
||||
retval = __PHYSFS_platformIsDirectory(d);
|
||||
free(d);
|
||||
return(retval);
|
||||
} /* DIR_isDirectory */
|
||||
|
||||
|
||||
static int DIR_isSymLink(DirHandle *h, const char *name, int *fileExists)
|
||||
{
|
||||
char *f = __PHYSFS_platformCvtToDependent((char *)(h->opaque), name, NULL);
|
||||
int retval = 0;
|
||||
|
||||
BAIL_IF_MACRO(f == NULL, NULL, 0);
|
||||
*fileExists = __PHYSFS_platformExists(f);
|
||||
if (*fileExists)
|
||||
retval = __PHYSFS_platformIsSymLink(f);
|
||||
free(f);
|
||||
return(retval);
|
||||
} /* DIR_isSymLink */
|
||||
|
||||
|
||||
static PHYSFS_sint64 DIR_getLastModTime(DirHandle *h,
|
||||
const char *name,
|
||||
int *fileExists)
|
||||
{
|
||||
char *d = __PHYSFS_platformCvtToDependent((char *)(h->opaque), name, NULL);
|
||||
PHYSFS_sint64 retval = -1;
|
||||
|
||||
BAIL_IF_MACRO(d == NULL, NULL, 0);
|
||||
*fileExists = __PHYSFS_platformExists(d);
|
||||
if (*fileExists)
|
||||
retval = __PHYSFS_platformGetLastModTime(d);
|
||||
free(d);
|
||||
return(retval);
|
||||
} /* DIR_getLastModTime */
|
||||
|
||||
|
||||
static FileHandle *doOpen(DirHandle *h, const char *name,
|
||||
void *(*openFunc)(const char *filename),
|
||||
int *fileExists, const FileFunctions *fileFuncs)
|
||||
{
|
||||
char *f = __PHYSFS_platformCvtToDependent((char *)(h->opaque), name, NULL);
|
||||
void *rc;
|
||||
FileHandle *retval;
|
||||
|
||||
BAIL_IF_MACRO(f == NULL, NULL, NULL);
|
||||
|
||||
if (fileExists != NULL)
|
||||
{
|
||||
*fileExists = __PHYSFS_platformExists(f);
|
||||
if (!(*fileExists))
|
||||
{
|
||||
free(f);
|
||||
return(NULL);
|
||||
} /* if */
|
||||
} /* if */
|
||||
|
||||
retval = (FileHandle *) malloc(sizeof (FileHandle));
|
||||
if (!retval)
|
||||
{
|
||||
free(f);
|
||||
BAIL_MACRO(ERR_OUT_OF_MEMORY, NULL);
|
||||
} /* if */
|
||||
|
||||
rc = openFunc(f);
|
||||
free(f);
|
||||
|
||||
if (!rc)
|
||||
{
|
||||
free(retval);
|
||||
return(NULL);
|
||||
} /* if */
|
||||
|
||||
retval->opaque = (void *) rc;
|
||||
retval->dirHandle = h;
|
||||
retval->funcs = fileFuncs;
|
||||
|
||||
return(retval);
|
||||
} /* doOpen */
|
||||
|
||||
|
||||
static FileHandle *DIR_openRead(DirHandle *h, const char *fnm, int *exist)
|
||||
{
|
||||
return(doOpen(h, fnm, __PHYSFS_platformOpenRead, exist,
|
||||
&__PHYSFS_FileFunctions_DIR));
|
||||
} /* DIR_openRead */
|
||||
|
||||
|
||||
static FileHandle *DIR_openWrite(DirHandle *h, const char *filename)
|
||||
{
|
||||
return(doOpen(h, filename, __PHYSFS_platformOpenWrite, NULL,
|
||||
&__PHYSFS_FileFunctions_DIRW));
|
||||
} /* DIR_openWrite */
|
||||
|
||||
|
||||
static FileHandle *DIR_openAppend(DirHandle *h, const char *filename)
|
||||
{
|
||||
return(doOpen(h, filename, __PHYSFS_platformOpenAppend, NULL,
|
||||
&__PHYSFS_FileFunctions_DIRW));
|
||||
} /* DIR_openAppend */
|
||||
|
||||
|
||||
static int DIR_remove(DirHandle *h, const char *name)
|
||||
{
|
||||
char *f = __PHYSFS_platformCvtToDependent((char *)(h->opaque), name, NULL);
|
||||
int retval;
|
||||
|
||||
BAIL_IF_MACRO(f == NULL, NULL, 0);
|
||||
retval = __PHYSFS_platformDelete(f);
|
||||
free(f);
|
||||
return(retval);
|
||||
} /* DIR_remove */
|
||||
|
||||
|
||||
static int DIR_mkdir(DirHandle *h, const char *name)
|
||||
{
|
||||
char *f = __PHYSFS_platformCvtToDependent((char *)(h->opaque), name, NULL);
|
||||
int retval;
|
||||
|
||||
BAIL_IF_MACRO(f == NULL, NULL, 0);
|
||||
retval = __PHYSFS_platformMkDir(f);
|
||||
free(f);
|
||||
return(retval);
|
||||
} /* DIR_mkdir */
|
||||
|
||||
|
||||
static void DIR_dirClose(DirHandle *h)
|
||||
{
|
||||
free(h->opaque);
|
||||
free(h);
|
||||
} /* DIR_dirClose */
|
||||
|
||||
/* end of dir.c ... */
|
||||
|
533
archivers/grp.c
533
archivers/grp.c
|
@ -1,533 +0,0 @@
|
|||
/*
|
||||
* GRP support routines for PhysicsFS.
|
||||
*
|
||||
* This driver handles BUILD engine archives ("groupfiles"). This format
|
||||
* (but not this driver) was put together by Ken Silverman.
|
||||
*
|
||||
* The format is simple enough. In Ken's words:
|
||||
*
|
||||
* What's the .GRP file format?
|
||||
*
|
||||
* The ".grp" file format is just a collection of a lot of files stored
|
||||
* into 1 big one. I tried to make the format as simple as possible: The
|
||||
* first 12 bytes contains my name, "KenSilverman". The next 4 bytes is
|
||||
* the number of files that were compacted into the group file. Then for
|
||||
* each file, there is a 16 byte structure, where the first 12 bytes are
|
||||
* the filename, and the last 4 bytes are the file's size. The rest of
|
||||
* the group file is just the raw data packed one after the other in the
|
||||
* same order as the list of files.
|
||||
*
|
||||
* (That info is from http://www.advsys.net/ken/build.htm ...)
|
||||
*
|
||||
* Please see the file LICENSE in the source's root directory.
|
||||
*
|
||||
* This file written by Ryan C. Gordon.
|
||||
*/
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#if (defined PHYSFS_SUPPORTS_GRP)
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "physfs.h"
|
||||
|
||||
#define __PHYSICSFS_INTERNAL__
|
||||
#include "physfs_internal.h"
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char name[13];
|
||||
PHYSFS_uint32 startPos;
|
||||
PHYSFS_uint32 size;
|
||||
} GRPentry;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char *filename;
|
||||
PHYSFS_sint64 last_mod_time;
|
||||
PHYSFS_uint32 entryCount;
|
||||
GRPentry *entries;
|
||||
} GRPinfo;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
void *handle;
|
||||
GRPentry *entry;
|
||||
PHYSFS_uint32 curPos;
|
||||
} GRPfileinfo;
|
||||
|
||||
|
||||
static void GRP_dirClose(DirHandle *h);
|
||||
static PHYSFS_sint64 GRP_read(FileHandle *handle, void *buffer,
|
||||
PHYSFS_uint32 objSize, PHYSFS_uint32 objCount);
|
||||
static PHYSFS_sint64 GRP_write(FileHandle *handle, const void *buffer,
|
||||
PHYSFS_uint32 objSize, PHYSFS_uint32 objCount);
|
||||
static int GRP_eof(FileHandle *handle);
|
||||
static PHYSFS_sint64 GRP_tell(FileHandle *handle);
|
||||
static int GRP_seek(FileHandle *handle, PHYSFS_uint64 offset);
|
||||
static PHYSFS_sint64 GRP_fileLength(FileHandle *handle);
|
||||
static int GRP_fileClose(FileHandle *handle);
|
||||
static int GRP_isArchive(const char *filename, int forWriting);
|
||||
static DirHandle *GRP_openArchive(const char *name, int forWriting);
|
||||
static LinkedStringList *GRP_enumerateFiles(DirHandle *h,
|
||||
const char *dirname,
|
||||
int omitSymLinks);
|
||||
static int GRP_exists(DirHandle *h, const char *name);
|
||||
static int GRP_isDirectory(DirHandle *h, const char *name, int *fileExists);
|
||||
static int GRP_isSymLink(DirHandle *h, const char *name, int *fileExists);
|
||||
static PHYSFS_sint64 GRP_getLastModTime(DirHandle *h, const char *n, int *e);
|
||||
static FileHandle *GRP_openRead(DirHandle *h, const char *name, int *exist);
|
||||
static FileHandle *GRP_openWrite(DirHandle *h, const char *name);
|
||||
static FileHandle *GRP_openAppend(DirHandle *h, const char *name);
|
||||
static int GRP_remove(DirHandle *h, const char *name);
|
||||
static int GRP_mkdir(DirHandle *h, const char *name);
|
||||
|
||||
const PHYSFS_ArchiveInfo __PHYSFS_ArchiveInfo_GRP =
|
||||
{
|
||||
"GRP",
|
||||
GRP_ARCHIVE_DESCRIPTION,
|
||||
"Ryan C. Gordon <icculus@clutteredmind.org>",
|
||||
"http://icculus.org/physfs/",
|
||||
};
|
||||
|
||||
|
||||
static const FileFunctions __PHYSFS_FileFunctions_GRP =
|
||||
{
|
||||
GRP_read, /* read() method */
|
||||
GRP_write, /* write() method */
|
||||
GRP_eof, /* eof() method */
|
||||
GRP_tell, /* tell() method */
|
||||
GRP_seek, /* seek() method */
|
||||
GRP_fileLength, /* fileLength() method */
|
||||
GRP_fileClose /* fileClose() method */
|
||||
};
|
||||
|
||||
|
||||
const DirFunctions __PHYSFS_DirFunctions_GRP =
|
||||
{
|
||||
&__PHYSFS_ArchiveInfo_GRP,
|
||||
GRP_isArchive, /* isArchive() method */
|
||||
GRP_openArchive, /* openArchive() method */
|
||||
GRP_enumerateFiles, /* enumerateFiles() method */
|
||||
GRP_exists, /* exists() method */
|
||||
GRP_isDirectory, /* isDirectory() method */
|
||||
GRP_isSymLink, /* isSymLink() method */
|
||||
GRP_getLastModTime, /* getLastModTime() method */
|
||||
GRP_openRead, /* openRead() method */
|
||||
GRP_openWrite, /* openWrite() method */
|
||||
GRP_openAppend, /* openAppend() method */
|
||||
GRP_remove, /* remove() method */
|
||||
GRP_mkdir, /* mkdir() method */
|
||||
GRP_dirClose /* dirClose() method */
|
||||
};
|
||||
|
||||
|
||||
|
||||
static void GRP_dirClose(DirHandle *h)
|
||||
{
|
||||
GRPinfo *info = ((GRPinfo *) h->opaque);
|
||||
free(info->filename);
|
||||
free(info->entries);
|
||||
free(info);
|
||||
free(h);
|
||||
} /* GRP_dirClose */
|
||||
|
||||
|
||||
static PHYSFS_sint64 GRP_read(FileHandle *handle, void *buffer,
|
||||
PHYSFS_uint32 objSize, PHYSFS_uint32 objCount)
|
||||
{
|
||||
GRPfileinfo *finfo = (GRPfileinfo *) (handle->opaque);
|
||||
GRPentry *entry = finfo->entry;
|
||||
PHYSFS_uint32 bytesLeft = entry->size - finfo->curPos;
|
||||
PHYSFS_uint32 objsLeft = (bytesLeft / objSize);
|
||||
PHYSFS_sint64 rc;
|
||||
|
||||
if (objsLeft < objCount)
|
||||
objCount = objsLeft;
|
||||
|
||||
rc = __PHYSFS_platformRead(finfo->handle, buffer, objSize, objCount);
|
||||
if (rc > 0)
|
||||
finfo->curPos += (PHYSFS_uint32) (rc * objSize);
|
||||
|
||||
return(rc);
|
||||
} /* GRP_read */
|
||||
|
||||
|
||||
static PHYSFS_sint64 GRP_write(FileHandle *handle, const void *buffer,
|
||||
PHYSFS_uint32 objSize, PHYSFS_uint32 objCount)
|
||||
{
|
||||
BAIL_MACRO(ERR_NOT_SUPPORTED, -1);
|
||||
} /* GRP_write */
|
||||
|
||||
|
||||
static int GRP_eof(FileHandle *handle)
|
||||
{
|
||||
GRPfileinfo *finfo = (GRPfileinfo *) (handle->opaque);
|
||||
GRPentry *entry = finfo->entry;
|
||||
return(finfo->curPos >= entry->size);
|
||||
} /* GRP_eof */
|
||||
|
||||
|
||||
static PHYSFS_sint64 GRP_tell(FileHandle *handle)
|
||||
{
|
||||
return(((GRPfileinfo *) (handle->opaque))->curPos);
|
||||
} /* GRP_tell */
|
||||
|
||||
|
||||
static int GRP_seek(FileHandle *handle, PHYSFS_uint64 offset)
|
||||
{
|
||||
GRPfileinfo *finfo = (GRPfileinfo *) (handle->opaque);
|
||||
GRPentry *entry = finfo->entry;
|
||||
int rc;
|
||||
|
||||
BAIL_IF_MACRO(offset < 0, ERR_INVALID_ARGUMENT, 0);
|
||||
BAIL_IF_MACRO(offset >= entry->size, ERR_PAST_EOF, 0);
|
||||
rc = __PHYSFS_platformSeek(finfo->handle, entry->startPos + offset);
|
||||
if (rc)
|
||||
finfo->curPos = (PHYSFS_uint32) offset;
|
||||
|
||||
return(rc);
|
||||
} /* GRP_seek */
|
||||
|
||||
|
||||
static PHYSFS_sint64 GRP_fileLength(FileHandle *handle)
|
||||
{
|
||||
GRPfileinfo *finfo = ((GRPfileinfo *) handle->opaque);
|
||||
return((PHYSFS_sint64) finfo->entry->size);
|
||||
} /* GRP_fileLength */
|
||||
|
||||
|
||||
static int GRP_fileClose(FileHandle *handle)
|
||||
{
|
||||
GRPfileinfo *finfo = ((GRPfileinfo *) handle->opaque);
|
||||
BAIL_IF_MACRO(!__PHYSFS_platformClose(finfo->handle), NULL, 0);
|
||||
free(finfo);
|
||||
free(handle);
|
||||
return(1);
|
||||
} /* GRP_fileClose */
|
||||
|
||||
|
||||
static int grp_open(const char *filename, int forWriting,
|
||||
void **fh, PHYSFS_uint32 *count)
|
||||
{
|
||||
PHYSFS_uint8 buf[12];
|
||||
|
||||
*fh = NULL;
|
||||
BAIL_IF_MACRO(forWriting, ERR_ARC_IS_READ_ONLY, 0);
|
||||
|
||||
*fh = __PHYSFS_platformOpenRead(filename);
|
||||
BAIL_IF_MACRO(*fh == NULL, NULL, 0);
|
||||
|
||||
if (__PHYSFS_platformRead(*fh, buf, 12, 1) != 1)
|
||||
goto openGrp_failed;
|
||||
|
||||
if (memcmp(buf, "KenSilverman", 12) != 0)
|
||||
{
|
||||
__PHYSFS_setError(ERR_UNSUPPORTED_ARCHIVE);
|
||||
goto openGrp_failed;
|
||||
} /* if */
|
||||
|
||||
if (__PHYSFS_platformRead(*fh, count, sizeof (PHYSFS_uint32), 1) != 1)
|
||||
goto openGrp_failed;
|
||||
|
||||
*count = PHYSFS_swapULE32(*count);
|
||||
|
||||
return(1);
|
||||
|
||||
openGrp_failed:
|
||||
if (*fh != NULL)
|
||||
__PHYSFS_platformClose(*fh);
|
||||
|
||||
*count = -1;
|
||||
*fh = NULL;
|
||||
return(0);
|
||||
} /* grp_open */
|
||||
|
||||
|
||||
static int GRP_isArchive(const char *filename, int forWriting)
|
||||
{
|
||||
void *fh;
|
||||
PHYSFS_uint32 fileCount;
|
||||
int retval = grp_open(filename, forWriting, &fh, &fileCount);
|
||||
|
||||
if (fh != NULL)
|
||||
__PHYSFS_platformClose(fh);
|
||||
|
||||
return(retval);
|
||||
} /* GRP_isArchive */
|
||||
|
||||
|
||||
static int grp_entry_cmp(void *_a, PHYSFS_uint32 one, PHYSFS_uint32 two)
|
||||
{
|
||||
GRPentry *a = (GRPentry *) _a;
|
||||
return(strcmp(a[one].name, a[two].name));
|
||||
} /* grp_entry_cmp */
|
||||
|
||||
|
||||
static void grp_entry_swap(void *_a, PHYSFS_uint32 one, PHYSFS_uint32 two)
|
||||
{
|
||||
GRPentry tmp;
|
||||
GRPentry *first = &(((GRPentry *) _a)[one]);
|
||||
GRPentry *second = &(((GRPentry *) _a)[two]);
|
||||
memcpy(&tmp, first, sizeof (GRPentry));
|
||||
memcpy(first, second, sizeof (GRPentry));
|
||||
memcpy(second, &tmp, sizeof (GRPentry));
|
||||
} /* grp_entry_swap */
|
||||
|
||||
|
||||
static int grp_load_entries(const char *name, int forWriting, GRPinfo *info)
|
||||
{
|
||||
void *fh = NULL;
|
||||
PHYSFS_uint32 fileCount;
|
||||
PHYSFS_uint32 location = 16; /* sizeof sig. */
|
||||
GRPentry *entry;
|
||||
char *ptr;
|
||||
|
||||
BAIL_IF_MACRO(!grp_open(name, forWriting, &fh, &fileCount), NULL, 0);
|
||||
info->entryCount = fileCount;
|
||||
info->entries = (GRPentry *) malloc(sizeof (GRPentry) * fileCount);
|
||||
if (info->entries == NULL)
|
||||
{
|
||||
__PHYSFS_platformClose(fh);
|
||||
BAIL_MACRO(ERR_OUT_OF_MEMORY, 0);
|
||||
} /* if */
|
||||
|
||||
location += (16 * fileCount);
|
||||
|
||||
for (entry = info->entries; fileCount > 0; fileCount--, entry++)
|
||||
{
|
||||
if (__PHYSFS_platformRead(fh, &entry->name, 12, 1) != 1)
|
||||
{
|
||||
__PHYSFS_platformClose(fh);
|
||||
return(0);
|
||||
} /* if */
|
||||
|
||||
entry->name[12] = '\0'; /* name isn't null-terminated in file. */
|
||||
if ((ptr = strchr(entry->name, ' ')) != NULL)
|
||||
*ptr = '\0'; /* trim extra spaces. */
|
||||
|
||||
if (__PHYSFS_platformRead(fh, &entry->size, 4, 1) != 1)
|
||||
{
|
||||
__PHYSFS_platformClose(fh);
|
||||
return(0);
|
||||
} /* if */
|
||||
|
||||
entry->size = PHYSFS_swapULE32(entry->size);
|
||||
entry->startPos = location;
|
||||
location += entry->size;
|
||||
} /* for */
|
||||
|
||||
__PHYSFS_platformClose(fh);
|
||||
|
||||
__PHYSFS_sort(info->entries, info->entryCount,
|
||||
grp_entry_cmp, grp_entry_swap);
|
||||
return(1);
|
||||
} /* grp_load_entries */
|
||||
|
||||
|
||||
static DirHandle *GRP_openArchive(const char *name, int forWriting)
|
||||
{
|
||||
GRPinfo *info;
|
||||
DirHandle *retval = malloc(sizeof (DirHandle));
|
||||
PHYSFS_sint64 modtime = __PHYSFS_platformGetLastModTime(name);
|
||||
|
||||
BAIL_IF_MACRO(retval == NULL, ERR_OUT_OF_MEMORY, NULL);
|
||||
info = retval->opaque = malloc(sizeof (GRPinfo));
|
||||
if (info == NULL)
|
||||
{
|
||||
__PHYSFS_setError(ERR_OUT_OF_MEMORY);
|
||||
goto GRP_openArchive_failed;
|
||||
} /* if */
|
||||
|
||||
memset(info, '\0', sizeof (GRPinfo));
|
||||
|
||||
info->filename = (char *) malloc(strlen(name) + 1);
|
||||
if (info->filename == NULL)
|
||||
{
|
||||
__PHYSFS_setError(ERR_OUT_OF_MEMORY);
|
||||
goto GRP_openArchive_failed;
|
||||
} /* if */
|
||||
|
||||
if (!grp_load_entries(name, forWriting, info))
|
||||
goto GRP_openArchive_failed;
|
||||
|
||||
strcpy(info->filename, name);
|
||||
info->last_mod_time = modtime;
|
||||
retval->funcs = &__PHYSFS_DirFunctions_GRP;
|
||||
return(retval);
|
||||
|
||||
GRP_openArchive_failed:
|
||||
if (retval != NULL)
|
||||
{
|
||||
if (retval->opaque != NULL)
|
||||
{
|
||||
if (info->filename != NULL)
|
||||
free(info->filename);
|
||||
if (info->entries != NULL)
|
||||
free(info->entries);
|
||||
free(info);
|
||||
} /* if */
|
||||
free(retval);
|
||||
} /* if */
|
||||
|
||||
return(NULL);
|
||||
} /* GRP_openArchive */
|
||||
|
||||
|
||||
static LinkedStringList *GRP_enumerateFiles(DirHandle *h,
|
||||
const char *dirname,
|
||||
int omitSymLinks)
|
||||
{
|
||||
GRPinfo *info = ((GRPinfo *) h->opaque);
|
||||
GRPentry *entry = info->entries;
|
||||
LinkedStringList *retval = NULL, *p = NULL;
|
||||
PHYSFS_uint32 max = info->entryCount;
|
||||
PHYSFS_uint32 i;
|
||||
|
||||
/* no directories in GRP files. */
|
||||
BAIL_IF_MACRO(*dirname != '\0', ERR_NOT_A_DIR, NULL);
|
||||
|
||||
for (i = 0; i < max; i++, entry++)
|
||||
retval = __PHYSFS_addToLinkedStringList(retval, &p, entry->name, -1);
|
||||
|
||||
return(retval);
|
||||
} /* GRP_enumerateFiles */
|
||||
|
||||
|
||||
static GRPentry *grp_find_entry(GRPinfo *info, const char *name)
|
||||
{
|
||||
char *ptr = strchr(name, '.');
|
||||
GRPentry *a = info->entries;
|
||||
PHYSFS_sint32 lo = 0;
|
||||
PHYSFS_sint32 hi = (PHYSFS_sint32) (info->entryCount - 1);
|
||||
PHYSFS_sint32 middle;
|
||||
int rc;
|
||||
|
||||
/*
|
||||
* Rule out filenames to avoid unneeded processing...no dirs,
|
||||
* big filenames, or extensions > 3 chars.
|
||||
*/
|
||||
BAIL_IF_MACRO((ptr) && (strlen(ptr) > 4), ERR_NO_SUCH_FILE, NULL);
|
||||
BAIL_IF_MACRO(strlen(name) > 12, ERR_NO_SUCH_FILE, NULL);
|
||||
BAIL_IF_MACRO(strchr(name, '/') != NULL, ERR_NO_SUCH_FILE, NULL);
|
||||
|
||||
while (lo <= hi)
|
||||
{
|
||||
middle = lo + ((hi - lo) / 2);
|
||||
rc = strcmp(name, a[middle].name);
|
||||
if (rc == 0) /* found it! */
|
||||
return(&a[middle]);
|
||||
else if (rc > 0)
|
||||
lo = middle + 1;
|
||||
else
|
||||
hi = middle - 1;
|
||||
} /* while */
|
||||
|
||||
BAIL_MACRO(ERR_NO_SUCH_FILE, NULL);
|
||||
} /* grp_find_entry */
|
||||
|
||||
|
||||
static int GRP_exists(DirHandle *h, const char *name)
|
||||
{
|
||||
return(grp_find_entry(((GRPinfo *) h->opaque), name) != NULL);
|
||||
} /* GRP_exists */
|
||||
|
||||
|
||||
static int GRP_isDirectory(DirHandle *h, const char *name, int *fileExists)
|
||||
{
|
||||
*fileExists = GRP_exists(h, name);
|
||||
return(0); /* never directories in a groupfile. */
|
||||
} /* GRP_isDirectory */
|
||||
|
||||
|
||||
static int GRP_isSymLink(DirHandle *h, const char *name, int *fileExists)
|
||||
{
|
||||
*fileExists = GRP_exists(h, name);
|
||||
return(0); /* never symlinks in a groupfile. */
|
||||
} /* GRP_isSymLink */
|
||||
|
||||
|
||||
static PHYSFS_sint64 GRP_getLastModTime(DirHandle *h,
|
||||
const char *name,
|
||||
int *fileExists)
|
||||
{
|
||||
GRPinfo *info = ((GRPinfo *) h->opaque);
|
||||
PHYSFS_sint64 retval = -1;
|
||||
|
||||
*fileExists = (grp_find_entry(info, name) != NULL);
|
||||
if (*fileExists) /* use time of GRP itself in the physical filesystem. */
|
||||
retval = ((GRPinfo *) h->opaque)->last_mod_time;
|
||||
|
||||
return(retval);
|
||||
} /* GRP_getLastModTime */
|
||||
|
||||
|
||||
static FileHandle *GRP_openRead(DirHandle *h, const char *fnm, int *fileExists)
|
||||
{
|
||||
GRPinfo *info = ((GRPinfo *) h->opaque);
|
||||
FileHandle *retval;
|
||||
GRPfileinfo *finfo;
|
||||
GRPentry *entry;
|
||||
|
||||
entry = grp_find_entry(info, fnm);
|
||||
*fileExists = (entry != NULL);
|
||||
BAIL_IF_MACRO(entry == NULL, NULL, NULL);
|
||||
|
||||
retval = (FileHandle *) malloc(sizeof (FileHandle));
|
||||
BAIL_IF_MACRO(retval == NULL, ERR_OUT_OF_MEMORY, NULL);
|
||||
finfo = (GRPfileinfo *) malloc(sizeof (GRPfileinfo));
|
||||
if (finfo == NULL)
|
||||
{
|
||||
free(retval);
|
||||
BAIL_MACRO(ERR_OUT_OF_MEMORY, NULL);
|
||||
} /* if */
|
||||
|
||||
finfo->handle = __PHYSFS_platformOpenRead(info->filename);
|
||||
if ( (finfo->handle == NULL) ||
|
||||
(!__PHYSFS_platformSeek(finfo->handle, entry->startPos)) )
|
||||
{
|
||||
free(finfo);
|
||||
free(retval);
|
||||
return(NULL);
|
||||
} /* if */
|
||||
|
||||
finfo->curPos = 0;
|
||||
finfo->entry = entry;
|
||||
retval->opaque = (void *) finfo;
|
||||
retval->funcs = &__PHYSFS_FileFunctions_GRP;
|
||||
retval->dirHandle = h;
|
||||
return(retval);
|
||||
} /* GRP_openRead */
|
||||
|
||||
|
||||
static FileHandle *GRP_openWrite(DirHandle *h, const char *name)
|
||||
{
|
||||
BAIL_MACRO(ERR_NOT_SUPPORTED, NULL);
|
||||
} /* GRP_openWrite */
|
||||
|
||||
|
||||
static FileHandle *GRP_openAppend(DirHandle *h, const char *name)
|
||||
{
|
||||
BAIL_MACRO(ERR_NOT_SUPPORTED, NULL);
|
||||
} /* GRP_openAppend */
|
||||
|
||||
|
||||
static int GRP_remove(DirHandle *h, const char *name)
|
||||
{
|
||||
BAIL_MACRO(ERR_NOT_SUPPORTED, 0);
|
||||
} /* GRP_remove */
|
||||
|
||||
|
||||
static int GRP_mkdir(DirHandle *h, const char *name)
|
||||
{
|
||||
BAIL_MACRO(ERR_NOT_SUPPORTED, 0);
|
||||
} /* GRP_mkdir */
|
||||
|
||||
#endif /* defined PHYSFS_SUPPORTS_GRP */
|
||||
|
||||
/* end of grp.c ... */
|
||||
|
573
archivers/hog.c
573
archivers/hog.c
|
@ -1,573 +0,0 @@
|
|||
/*
|
||||
* HOG support routines for PhysicsFS.
|
||||
*
|
||||
* This driver handles Descent I/II HOG archives.
|
||||
*
|
||||
* The format is very simple:
|
||||
*
|
||||
* The file always starts with the 3-byte signature "DHF" (Descent
|
||||
* HOG file). After that the files of a HOG are just attached after
|
||||
* another, divided by a 17 bytes header, which specifies the name
|
||||
* and length (in bytes) of the forthcoming file! So you just read
|
||||
* the header with its information of how big the following file is,
|
||||
* and then skip exact that number of bytes to get to the next file
|
||||
* in that HOG.
|
||||
*
|
||||
* char sig[3] = {'D', 'H', 'F'}; // "DHF"=Descent HOG File
|
||||
*
|
||||
* struct {
|
||||
* char file_name[13]; // Filename, padded to 13 bytes with 0s
|
||||
* int file_size; // filesize in bytes
|
||||
* char data[file_size]; // The file data
|
||||
* } FILE_STRUCT; // Repeated until the end of the file.
|
||||
*
|
||||
* (That info is from http://www.descent2.com/ddn/specs/hog/)
|
||||
*
|
||||
* Please see the file LICENSE in the source's root directory.
|
||||
*
|
||||
* This file written by Bradley Bell.
|
||||
* Based on grp.c by Ryan C. Gordon.
|
||||
*/
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#if (defined PHYSFS_SUPPORTS_HOG)
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "physfs.h"
|
||||
|
||||
#define __PHYSICSFS_INTERNAL__
|
||||
#include "physfs_internal.h"
|
||||
|
||||
/*
|
||||
* One HOGentry is kept for each file in an open HOG archive.
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
char name[13];
|
||||
PHYSFS_uint32 startPos;
|
||||
PHYSFS_uint32 size;
|
||||
} HOGentry;
|
||||
|
||||
/*
|
||||
* One HOGinfo is kept for each open HOG archive.
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
char *filename;
|
||||
PHYSFS_sint64 last_mod_time;
|
||||
PHYSFS_uint32 entryCount;
|
||||
HOGentry *entries;
|
||||
} HOGinfo;
|
||||
|
||||
/*
|
||||
* One HOGfileinfo is kept for each open file in a HOG archive.
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
void *handle;
|
||||
HOGentry *entry;
|
||||
PHYSFS_uint32 curPos;
|
||||
} HOGfileinfo;
|
||||
|
||||
|
||||
static void HOG_dirClose(DirHandle *h);
|
||||
static PHYSFS_sint64 HOG_read(FileHandle *handle, void *buffer,
|
||||
PHYSFS_uint32 objSize, PHYSFS_uint32 objCount);
|
||||
static PHYSFS_sint64 HOG_write(FileHandle *handle, const void *buffer,
|
||||
PHYSFS_uint32 objSize, PHYSFS_uint32 objCount);
|
||||
static int HOG_eof(FileHandle *handle);
|
||||
static PHYSFS_sint64 HOG_tell(FileHandle *handle);
|
||||
static int HOG_seek(FileHandle *handle, PHYSFS_uint64 offset);
|
||||
static PHYSFS_sint64 HOG_fileLength(FileHandle *handle);
|
||||
static int HOG_fileClose(FileHandle *handle);
|
||||
static int HOG_isArchive(const char *filename, int forWriting);
|
||||
static DirHandle *HOG_openArchive(const char *name, int forWriting);
|
||||
static LinkedStringList *HOG_enumerateFiles(DirHandle *h,
|
||||
const char *dirname,
|
||||
int omitSymLinks);
|
||||
static int HOG_exists(DirHandle *h, const char *name);
|
||||
static int HOG_isDirectory(DirHandle *h, const char *name, int *fileExists);
|
||||
static int HOG_isSymLink(DirHandle *h, const char *name, int *fileExists);
|
||||
static PHYSFS_sint64 HOG_getLastModTime(DirHandle *h, const char *n, int *e);
|
||||
static FileHandle *HOG_openRead(DirHandle *h, const char *name, int *exist);
|
||||
static FileHandle *HOG_openWrite(DirHandle *h, const char *name);
|
||||
static FileHandle *HOG_openAppend(DirHandle *h, const char *name);
|
||||
static int HOG_remove(DirHandle *h, const char *name);
|
||||
static int HOG_mkdir(DirHandle *h, const char *name);
|
||||
|
||||
const PHYSFS_ArchiveInfo __PHYSFS_ArchiveInfo_HOG =
|
||||
{
|
||||
"HOG",
|
||||
HOG_ARCHIVE_DESCRIPTION,
|
||||
"Bradley Bell <btb@icculus.org>",
|
||||
"http://icculus.org/physfs/",
|
||||
};
|
||||
|
||||
|
||||
static const FileFunctions __PHYSFS_FileFunctions_HOG =
|
||||
{
|
||||
HOG_read, /* read() method */
|
||||
HOG_write, /* write() method */
|
||||
HOG_eof, /* eof() method */
|
||||
HOG_tell, /* tell() method */
|
||||
HOG_seek, /* seek() method */
|
||||
HOG_fileLength, /* fileLength() method */
|
||||
HOG_fileClose /* fileClose() method */
|
||||
};
|
||||
|
||||
|
||||
const DirFunctions __PHYSFS_DirFunctions_HOG =
|
||||
{
|
||||
&__PHYSFS_ArchiveInfo_HOG,
|
||||
HOG_isArchive, /* isArchive() method */
|
||||
HOG_openArchive, /* openArchive() method */
|
||||
HOG_enumerateFiles, /* enumerateFiles() method */
|
||||
HOG_exists, /* exists() method */
|
||||
HOG_isDirectory, /* isDirectory() method */
|
||||
HOG_isSymLink, /* isSymLink() method */
|
||||
HOG_getLastModTime, /* getLastModTime() method */
|
||||
HOG_openRead, /* openRead() method */
|
||||
HOG_openWrite, /* openWrite() method */
|
||||
HOG_openAppend, /* openAppend() method */
|
||||
HOG_remove, /* remove() method */
|
||||
HOG_mkdir, /* mkdir() method */
|
||||
HOG_dirClose /* dirClose() method */
|
||||
};
|
||||
|
||||
|
||||
|
||||
static void HOG_dirClose(DirHandle *h)
|
||||
{
|
||||
HOGinfo *info = ((HOGinfo *) h->opaque);
|
||||
free(info->filename);
|
||||
free(info->entries);
|
||||
free(info);
|
||||
free(h);
|
||||
} /* HOG_dirClose */
|
||||
|
||||
|
||||
static PHYSFS_sint64 HOG_read(FileHandle *handle, void *buffer,
|
||||
PHYSFS_uint32 objSize, PHYSFS_uint32 objCount)
|
||||
{
|
||||
HOGfileinfo *finfo = (HOGfileinfo *) (handle->opaque);
|
||||
HOGentry *entry = finfo->entry;
|
||||
PHYSFS_uint32 bytesLeft = entry->size - finfo->curPos;
|
||||
PHYSFS_uint32 objsLeft = (bytesLeft / objSize);
|
||||
PHYSFS_sint64 rc;
|
||||
|
||||
if (objsLeft < objCount)
|
||||
objCount = objsLeft;
|
||||
|
||||
rc = __PHYSFS_platformRead(finfo->handle, buffer, objSize, objCount);
|
||||
if (rc > 0)
|
||||
finfo->curPos += (PHYSFS_uint32) (rc * objSize);
|
||||
|
||||
return(rc);
|
||||
} /* HOG_read */
|
||||
|
||||
|
||||
static PHYSFS_sint64 HOG_write(FileHandle *handle, const void *buffer,
|
||||
PHYSFS_uint32 objSize, PHYSFS_uint32 objCount)
|
||||
{
|
||||
BAIL_MACRO(ERR_NOT_SUPPORTED, -1);
|
||||
} /* HOG_write */
|
||||
|
||||
|
||||
static int HOG_eof(FileHandle *handle)
|
||||
{
|
||||
HOGfileinfo *finfo = (HOGfileinfo *) (handle->opaque);
|
||||
HOGentry *entry = finfo->entry;
|
||||
return(finfo->curPos >= entry->size);
|
||||
} /* HOG_eof */
|
||||
|
||||
|
||||
static PHYSFS_sint64 HOG_tell(FileHandle *handle)
|
||||
{
|
||||
return(((HOGfileinfo *) (handle->opaque))->curPos);
|
||||
} /* HOG_tell */
|
||||
|
||||
|
||||
static int HOG_seek(FileHandle *handle, PHYSFS_uint64 offset)
|
||||
{
|
||||
HOGfileinfo *finfo = (HOGfileinfo *) (handle->opaque);
|
||||
HOGentry *entry = finfo->entry;
|
||||
int rc;
|
||||
|
||||
BAIL_IF_MACRO(offset < 0, ERR_INVALID_ARGUMENT, 0);
|
||||
BAIL_IF_MACRO(offset >= entry->size, ERR_PAST_EOF, 0);
|
||||
rc = __PHYSFS_platformSeek(finfo->handle, entry->startPos + offset);
|
||||
if (rc)
|
||||
finfo->curPos = (PHYSFS_uint32) offset;
|
||||
|
||||
return(rc);
|
||||
} /* HOG_seek */
|
||||
|
||||
|
||||
static PHYSFS_sint64 HOG_fileLength(FileHandle *handle)
|
||||
{
|
||||
HOGfileinfo *finfo = ((HOGfileinfo *) handle->opaque);
|
||||
return((PHYSFS_sint64) finfo->entry->size);
|
||||
} /* HOG_fileLength */
|
||||
|
||||
|
||||
static int HOG_fileClose(FileHandle *handle)
|
||||
{
|
||||
HOGfileinfo *finfo = ((HOGfileinfo *) handle->opaque);
|
||||
BAIL_IF_MACRO(!__PHYSFS_platformClose(finfo->handle), NULL, 0);
|
||||
free(finfo);
|
||||
free(handle);
|
||||
return(1);
|
||||
} /* HOG_fileClose */
|
||||
|
||||
|
||||
static int hog_open(const char *filename, int forWriting,
|
||||
void **fh, PHYSFS_uint32 *count)
|
||||
{
|
||||
PHYSFS_uint8 buf[13];
|
||||
PHYSFS_uint32 size;
|
||||
PHYSFS_sint64 pos;
|
||||
|
||||
*count = 0;
|
||||
|
||||
*fh = NULL;
|
||||
BAIL_IF_MACRO(forWriting, ERR_ARC_IS_READ_ONLY, 0);
|
||||
|
||||
*fh = __PHYSFS_platformOpenRead(filename);
|
||||
BAIL_IF_MACRO(*fh == NULL, NULL, 0);
|
||||
|
||||
if (__PHYSFS_platformRead(*fh, buf, 3, 1) != 1)
|
||||
goto openHog_failed;
|
||||
|
||||
if (memcmp(buf, "DHF", 3) != 0)
|
||||
{
|
||||
__PHYSFS_setError(ERR_UNSUPPORTED_ARCHIVE);
|
||||
goto openHog_failed;
|
||||
} /* if */
|
||||
|
||||
while (1)
|
||||
{
|
||||
if (__PHYSFS_platformRead(*fh, buf, 13, 1) != 1)
|
||||
break; /* eof here is ok */
|
||||
|
||||
if (__PHYSFS_platformRead(*fh, &size, 4, 1) != 1)
|
||||
goto openHog_failed;
|
||||
|
||||
size = PHYSFS_swapULE32(size);
|
||||
|
||||
(*count)++;
|
||||
|
||||
/* Skip over entry... */
|
||||
pos = __PHYSFS_platformTell(*fh);
|
||||
if (pos == -1)
|
||||
goto openHog_failed;
|
||||
if (!__PHYSFS_platformSeek(*fh, pos + size))
|
||||
goto openHog_failed;
|
||||
} /* while */
|
||||
|
||||
/* Rewind to start of entries... */
|
||||
if (!__PHYSFS_platformSeek(*fh, 3))
|
||||
goto openHog_failed;
|
||||
|
||||
return(1);
|
||||
|
||||
openHog_failed:
|
||||
if (*fh != NULL)
|
||||
__PHYSFS_platformClose(*fh);
|
||||
|
||||
*count = -1;
|
||||
*fh = NULL;
|
||||
return(0);
|
||||
} /* hog_open */
|
||||
|
||||
|
||||
static int HOG_isArchive(const char *filename, int forWriting)
|
||||
{
|
||||
void *fh;
|
||||
PHYSFS_uint32 fileCount;
|
||||
int retval = hog_open(filename, forWriting, &fh, &fileCount);
|
||||
|
||||
if (fh != NULL)
|
||||
__PHYSFS_platformClose(fh);
|
||||
|
||||
return(retval);
|
||||
} /* HOG_isArchive */
|
||||
|
||||
|
||||
static int hog_entry_cmp(void *_a, PHYSFS_uint32 one, PHYSFS_uint32 two)
|
||||
{
|
||||
HOGentry *a = (HOGentry *) _a;
|
||||
return(strcmp(a[one].name, a[two].name));
|
||||
} /* hog_entry_cmp */
|
||||
|
||||
|
||||
static void hog_entry_swap(void *_a, PHYSFS_uint32 one, PHYSFS_uint32 two)
|
||||
{
|
||||
HOGentry tmp;
|
||||
HOGentry *first = &(((HOGentry *) _a)[one]);
|
||||
HOGentry *second = &(((HOGentry *) _a)[two]);
|
||||
memcpy(&tmp, first, sizeof (HOGentry));
|
||||
memcpy(first, second, sizeof (HOGentry));
|
||||
memcpy(second, &tmp, sizeof (HOGentry));
|
||||
} /* hog_entry_swap */
|
||||
|
||||
|
||||
static int hog_load_entries(const char *name, int forWriting, HOGinfo *info)
|
||||
{
|
||||
void *fh = NULL;
|
||||
PHYSFS_uint32 fileCount;
|
||||
HOGentry *entry;
|
||||
|
||||
BAIL_IF_MACRO(!hog_open(name, forWriting, &fh, &fileCount), NULL, 0);
|
||||
info->entryCount = fileCount;
|
||||
info->entries = (HOGentry *) malloc(sizeof (HOGentry) * fileCount);
|
||||
if (info->entries == NULL)
|
||||
{
|
||||
__PHYSFS_platformClose(fh);
|
||||
BAIL_MACRO(ERR_OUT_OF_MEMORY, 0);
|
||||
} /* if */
|
||||
|
||||
for (entry = info->entries; fileCount > 0; fileCount--, entry++)
|
||||
{
|
||||
if (__PHYSFS_platformRead(fh, &entry->name, 13, 1) != 1)
|
||||
{
|
||||
__PHYSFS_platformClose(fh);
|
||||
return(0);
|
||||
} /* if */
|
||||
|
||||
if (__PHYSFS_platformRead(fh, &entry->size, 4, 1) != 1)
|
||||
{
|
||||
__PHYSFS_platformClose(fh);
|
||||
return(0);
|
||||
} /* if */
|
||||
|
||||
entry->size = PHYSFS_swapULE32(entry->size);
|
||||
entry->startPos = (unsigned int) __PHYSFS_platformTell(fh);
|
||||
if (entry->startPos == -1)
|
||||
{
|
||||
__PHYSFS_platformClose(fh);
|
||||
return(0);
|
||||
}
|
||||
|
||||
/* Skip over entry */
|
||||
if (!__PHYSFS_platformSeek(fh, entry->startPos + entry->size))
|
||||
{
|
||||
__PHYSFS_platformClose(fh);
|
||||
return(0);
|
||||
}
|
||||
} /* for */
|
||||
|
||||
__PHYSFS_platformClose(fh);
|
||||
|
||||
__PHYSFS_sort(info->entries, info->entryCount,
|
||||
hog_entry_cmp, hog_entry_swap);
|
||||
return(1);
|
||||
} /* hog_load_entries */
|
||||
|
||||
|
||||
static DirHandle *HOG_openArchive(const char *name, int forWriting)
|
||||
{
|
||||
HOGinfo *info;
|
||||
DirHandle *retval = malloc(sizeof (DirHandle));
|
||||
PHYSFS_sint64 modtime = __PHYSFS_platformGetLastModTime(name);
|
||||
|
||||
BAIL_IF_MACRO(retval == NULL, ERR_OUT_OF_MEMORY, NULL);
|
||||
info = retval->opaque = malloc(sizeof (HOGinfo));
|
||||
if (info == NULL)
|
||||
{
|
||||
__PHYSFS_setError(ERR_OUT_OF_MEMORY);
|
||||
goto HOG_openArchive_failed;
|
||||
} /* if */
|
||||
|
||||
memset(info, '\0', sizeof (HOGinfo));
|
||||
|
||||
info->filename = (char *) malloc(strlen(name) + 1);
|
||||
if (info->filename == NULL)
|
||||
{
|
||||
__PHYSFS_setError(ERR_OUT_OF_MEMORY);
|
||||
goto HOG_openArchive_failed;
|
||||
} /* if */
|
||||
|
||||
if (!hog_load_entries(name, forWriting, info))
|
||||
goto HOG_openArchive_failed;
|
||||
|
||||
strcpy(info->filename, name);
|
||||
info->last_mod_time = modtime;
|
||||
retval->funcs = &__PHYSFS_DirFunctions_HOG;
|
||||
return(retval);
|
||||
|
||||
HOG_openArchive_failed:
|
||||
if (retval != NULL)
|
||||
{
|
||||
if (retval->opaque != NULL)
|
||||
{
|
||||
if (info->filename != NULL)
|
||||
free(info->filename);
|
||||
if (info->entries != NULL)
|
||||
free(info->entries);
|
||||
free(info);
|
||||
} /* if */
|
||||
free(retval);
|
||||
} /* if */
|
||||
|
||||
return(NULL);
|
||||
} /* HOG_openArchive */
|
||||
|
||||
|
||||
static LinkedStringList *HOG_enumerateFiles(DirHandle *h,
|
||||
const char *dirname,
|
||||
int omitSymLinks)
|
||||
{
|
||||
HOGinfo *info = ((HOGinfo *) h->opaque);
|
||||
HOGentry *entry = info->entries;
|
||||
LinkedStringList *retval = NULL, *p = NULL;
|
||||
PHYSFS_uint32 max = info->entryCount;
|
||||
PHYSFS_uint32 i;
|
||||
|
||||
/* no directories in HOG files. */
|
||||
BAIL_IF_MACRO(*dirname != '\0', ERR_NOT_A_DIR, NULL);
|
||||
|
||||
for (i = 0; i < max; i++, entry++)
|
||||
retval = __PHYSFS_addToLinkedStringList(retval, &p, entry->name, -1);
|
||||
|
||||
return(retval);
|
||||
} /* HOG_enumerateFiles */
|
||||
|
||||
|
||||
static HOGentry *hog_find_entry(HOGinfo *info, const char *name)
|
||||
{
|
||||
char *ptr = strchr(name, '.');
|
||||
HOGentry *a = info->entries;
|
||||
PHYSFS_sint32 lo = 0;
|
||||
PHYSFS_sint32 hi = (PHYSFS_sint32) (info->entryCount - 1);
|
||||
PHYSFS_sint32 middle;
|
||||
int rc;
|
||||
|
||||
/*
|
||||
* Rule out filenames to avoid unneeded processing...no dirs,
|
||||
* big filenames, or extensions > 3 chars.
|
||||
*/
|
||||
BAIL_IF_MACRO((ptr) && (strlen(ptr) > 4), ERR_NO_SUCH_FILE, NULL);
|
||||
BAIL_IF_MACRO(strlen(name) > 12, ERR_NO_SUCH_FILE, NULL);
|
||||
BAIL_IF_MACRO(strchr(name, '/') != NULL, ERR_NO_SUCH_FILE, NULL);
|
||||
|
||||
while (lo <= hi)
|
||||
{
|
||||
middle = lo + ((hi - lo) / 2);
|
||||
rc = __PHYSFS_platformStricmp(name, a[middle].name);
|
||||
if (rc == 0) /* found it! */
|
||||
return(&a[middle]);
|
||||
else if (rc > 0)
|
||||
lo = middle + 1;
|
||||
else
|
||||
hi = middle - 1;
|
||||
} /* while */
|
||||
|
||||
BAIL_MACRO(ERR_NO_SUCH_FILE, NULL);
|
||||
} /* hog_find_entry */
|
||||
|
||||
|
||||
static int HOG_exists(DirHandle *h, const char *name)
|
||||
{
|
||||
return(hog_find_entry(((HOGinfo *) h->opaque), name) != NULL);
|
||||
} /* HOG_exists */
|
||||
|
||||
|
||||
static int HOG_isDirectory(DirHandle *h, const char *name, int *fileExists)
|
||||
{
|
||||
*fileExists = HOG_exists(h, name);
|
||||
return(0); /* never directories in a groupfile. */
|
||||
} /* HOG_isDirectory */
|
||||
|
||||
|
||||
static int HOG_isSymLink(DirHandle *h, const char *name, int *fileExists)
|
||||
{
|
||||
*fileExists = HOG_exists(h, name);
|
||||
return(0); /* never symlinks in a groupfile. */
|
||||
} /* HOG_isSymLink */
|
||||
|
||||
|
||||
static PHYSFS_sint64 HOG_getLastModTime(DirHandle *h,
|
||||
const char *name,
|
||||
int *fileExists)
|
||||
{
|
||||
HOGinfo *info = ((HOGinfo *) h->opaque);
|
||||
PHYSFS_sint64 retval = -1;
|
||||
|
||||
*fileExists = (hog_find_entry(info, name) != NULL);
|
||||
if (*fileExists) /* use time of HOG itself in the physical filesystem. */
|
||||
retval = ((HOGinfo *) h->opaque)->last_mod_time;
|
||||
|
||||
return(retval);
|
||||
} /* HOG_getLastModTime */
|
||||
|
||||
|
||||
static FileHandle *HOG_openRead(DirHandle *h, const char *fnm, int *fileExists)
|
||||
{
|
||||
HOGinfo *info = ((HOGinfo *) h->opaque);
|
||||
FileHandle *retval;
|
||||
HOGfileinfo *finfo;
|
||||
HOGentry *entry;
|
||||
|
||||
entry = hog_find_entry(info, fnm);
|
||||
*fileExists = (entry != NULL);
|
||||
BAIL_IF_MACRO(entry == NULL, NULL, NULL);
|
||||
|
||||
retval = (FileHandle *) malloc(sizeof (FileHandle));
|
||||
BAIL_IF_MACRO(retval == NULL, ERR_OUT_OF_MEMORY, NULL);
|
||||
finfo = (HOGfileinfo *) malloc(sizeof (HOGfileinfo));
|
||||
if (finfo == NULL)
|
||||
{
|
||||
free(retval);
|
||||
BAIL_MACRO(ERR_OUT_OF_MEMORY, NULL);
|
||||
} /* if */
|
||||
|
||||
finfo->handle = __PHYSFS_platformOpenRead(info->filename);
|
||||
if ( (finfo->handle == NULL) ||
|
||||
(!__PHYSFS_platformSeek(finfo->handle, entry->startPos)) )
|
||||
{
|
||||
free(finfo);
|
||||
free(retval);
|
||||
return(NULL);
|
||||
} /* if */
|
||||
|
||||
finfo->curPos = 0;
|
||||
finfo->entry = entry;
|
||||
retval->opaque = (void *) finfo;
|
||||
retval->funcs = &__PHYSFS_FileFunctions_HOG;
|
||||
retval->dirHandle = h;
|
||||
return(retval);
|
||||
} /* HOG_openRead */
|
||||
|
||||
|
||||
static FileHandle *HOG_openWrite(DirHandle *h, const char *name)
|
||||
{
|
||||
BAIL_MACRO(ERR_NOT_SUPPORTED, NULL);
|
||||
} /* HOG_openWrite */
|
||||
|
||||
|
||||
static FileHandle *HOG_openAppend(DirHandle *h, const char *name)
|
||||
{
|
||||
BAIL_MACRO(ERR_NOT_SUPPORTED, NULL);
|
||||
} /* HOG_openAppend */
|
||||
|
||||
|
||||
static int HOG_remove(DirHandle *h, const char *name)
|
||||
{
|
||||
BAIL_MACRO(ERR_NOT_SUPPORTED, 0);
|
||||
} /* HOG_remove */
|
||||
|
||||
|
||||
static int HOG_mkdir(DirHandle *h, const char *name)
|
||||
{
|
||||
BAIL_MACRO(ERR_NOT_SUPPORTED, 0);
|
||||
} /* HOG_mkdir */
|
||||
|
||||
#endif /* defined PHYSFS_SUPPORTS_HOG */
|
||||
|
||||
/* end of hog.c ... */
|
||||
|
531
archivers/mvl.c
531
archivers/mvl.c
|
@ -1,531 +0,0 @@
|
|||
/*
|
||||
* MVL support routines for PhysicsFS.
|
||||
*
|
||||
* This driver handles Descent II Movielib archives.
|
||||
*
|
||||
* The file format of MVL is quite easy...
|
||||
*
|
||||
* //MVL File format - Written by Heiko Herrmann
|
||||
* char sig[4] = {'D','M', 'V', 'L'}; // "DMVL"=Descent MoVie Library
|
||||
*
|
||||
* int num_files; // the number of files in this MVL
|
||||
*
|
||||
* struct {
|
||||
* char file_name[13]; // Filename, padded to 13 bytes with 0s
|
||||
* int file_size; // filesize in bytes
|
||||
* }DIR_STRUCT[num_files];
|
||||
*
|
||||
* struct {
|
||||
* char data[file_size]; // The file data
|
||||
* }FILE_STRUCT[num_files];
|
||||
*
|
||||
* (That info is from http://www.descent2.com/ddn/specs/mvl/)
|
||||
*
|
||||
* Please see the file LICENSE in the source's root directory.
|
||||
*
|
||||
* This file written by Bradley Bell.
|
||||
* Based on grp.c by Ryan C. Gordon.
|
||||
*/
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#if (defined PHYSFS_SUPPORTS_MVL)
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "physfs.h"
|
||||
|
||||
#define __PHYSICSFS_INTERNAL__
|
||||
#include "physfs_internal.h"
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char name[13];
|
||||
PHYSFS_uint32 startPos;
|
||||
PHYSFS_uint32 size;
|
||||
} MVLentry;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char *filename;
|
||||
PHYSFS_sint64 last_mod_time;
|
||||
PHYSFS_uint32 entryCount;
|
||||
MVLentry *entries;
|
||||
} MVLinfo;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
void *handle;
|
||||
MVLentry *entry;
|
||||
PHYSFS_uint32 curPos;
|
||||
} MVLfileinfo;
|
||||
|
||||
|
||||
static void MVL_dirClose(DirHandle *h);
|
||||
static PHYSFS_sint64 MVL_read(FileHandle *handle, void *buffer,
|
||||
PHYSFS_uint32 objSize, PHYSFS_uint32 objCount);
|
||||
static PHYSFS_sint64 MVL_write(FileHandle *handle, const void *buffer,
|
||||
PHYSFS_uint32 objSize, PHYSFS_uint32 objCount);
|
||||
static int MVL_eof(FileHandle *handle);
|
||||
static PHYSFS_sint64 MVL_tell(FileHandle *handle);
|
||||
static int MVL_seek(FileHandle *handle, PHYSFS_uint64 offset);
|
||||
static PHYSFS_sint64 MVL_fileLength(FileHandle *handle);
|
||||
static int MVL_fileClose(FileHandle *handle);
|
||||
static int MVL_isArchive(const char *filename, int forWriting);
|
||||
static DirHandle *MVL_openArchive(const char *name, int forWriting);
|
||||
static LinkedStringList *MVL_enumerateFiles(DirHandle *h,
|
||||
const char *dirname,
|
||||
int omitSymLinks);
|
||||
static int MVL_exists(DirHandle *h, const char *name);
|
||||
static int MVL_isDirectory(DirHandle *h, const char *name, int *fileExists);
|
||||
static int MVL_isSymLink(DirHandle *h, const char *name, int *fileExists);
|
||||
static PHYSFS_sint64 MVL_getLastModTime(DirHandle *h, const char *n, int *e);
|
||||
static FileHandle *MVL_openRead(DirHandle *h, const char *name, int *exist);
|
||||
static FileHandle *MVL_openWrite(DirHandle *h, const char *name);
|
||||
static FileHandle *MVL_openAppend(DirHandle *h, const char *name);
|
||||
static int MVL_remove(DirHandle *h, const char *name);
|
||||
static int MVL_mkdir(DirHandle *h, const char *name);
|
||||
|
||||
const PHYSFS_ArchiveInfo __PHYSFS_ArchiveInfo_MVL =
|
||||
{
|
||||
"MVL",
|
||||
MVL_ARCHIVE_DESCRIPTION,
|
||||
"Bradley Bell <btb@icculus.org>",
|
||||
"http://icculus.org/physfs/",
|
||||
};
|
||||
|
||||
|
||||
static const FileFunctions __PHYSFS_FileFunctions_MVL =
|
||||
{
|
||||
MVL_read, /* read() method */
|
||||
MVL_write, /* write() method */
|
||||
MVL_eof, /* eof() method */
|
||||
MVL_tell, /* tell() method */
|
||||
MVL_seek, /* seek() method */
|
||||
MVL_fileLength, /* fileLength() method */
|
||||
MVL_fileClose /* fileClose() method */
|
||||
};
|
||||
|
||||
|
||||
const DirFunctions __PHYSFS_DirFunctions_MVL =
|
||||
{
|
||||
&__PHYSFS_ArchiveInfo_MVL,
|
||||
MVL_isArchive, /* isArchive() method */
|
||||
MVL_openArchive, /* openArchive() method */
|
||||
MVL_enumerateFiles, /* enumerateFiles() method */
|
||||
MVL_exists, /* exists() method */
|
||||
MVL_isDirectory, /* isDirectory() method */
|
||||
MVL_isSymLink, /* isSymLink() method */
|
||||
MVL_getLastModTime, /* getLastModTime() method */
|
||||
MVL_openRead, /* openRead() method */
|
||||
MVL_openWrite, /* openWrite() method */
|
||||
MVL_openAppend, /* openAppend() method */
|
||||
MVL_remove, /* remove() method */
|
||||
MVL_mkdir, /* mkdir() method */
|
||||
MVL_dirClose /* dirClose() method */
|
||||
};
|
||||
|
||||
|
||||
|
||||
static void MVL_dirClose(DirHandle *h)
|
||||
{
|
||||
MVLinfo *info = ((MVLinfo *) h->opaque);
|
||||
free(info->filename);
|
||||
free(info->entries);
|
||||
free(info);
|
||||
free(h);
|
||||
} /* MVL_dirClose */
|
||||
|
||||
|
||||
static PHYSFS_sint64 MVL_read(FileHandle *handle, void *buffer,
|
||||
PHYSFS_uint32 objSize, PHYSFS_uint32 objCount)
|
||||
{
|
||||
MVLfileinfo *finfo = (MVLfileinfo *) (handle->opaque);
|
||||
MVLentry *entry = finfo->entry;
|
||||
PHYSFS_uint32 bytesLeft = entry->size - finfo->curPos;
|
||||
PHYSFS_uint32 objsLeft = (bytesLeft / objSize);
|
||||
PHYSFS_sint64 rc;
|
||||
|
||||
if (objsLeft < objCount)
|
||||
objCount = objsLeft;
|
||||
|
||||
rc = __PHYSFS_platformRead(finfo->handle, buffer, objSize, objCount);
|
||||
if (rc > 0)
|
||||
finfo->curPos += (PHYSFS_uint32) (rc * objSize);
|
||||
|
||||
return(rc);
|
||||
} /* MVL_read */
|
||||
|
||||
|
||||
static PHYSFS_sint64 MVL_write(FileHandle *handle, const void *buffer,
|
||||
PHYSFS_uint32 objSize, PHYSFS_uint32 objCount)
|
||||
{
|
||||
BAIL_MACRO(ERR_NOT_SUPPORTED, -1);
|
||||
} /* MVL_write */
|
||||
|
||||
|
||||
static int MVL_eof(FileHandle *handle)
|
||||
{
|
||||
MVLfileinfo *finfo = (MVLfileinfo *) (handle->opaque);
|
||||
MVLentry *entry = finfo->entry;
|
||||
return(finfo->curPos >= entry->size);
|
||||
} /* MVL_eof */
|
||||
|
||||
|
||||
static PHYSFS_sint64 MVL_tell(FileHandle *handle)
|
||||
{
|
||||
return(((MVLfileinfo *) (handle->opaque))->curPos);
|
||||
} /* MVL_tell */
|
||||
|
||||
|
||||
static int MVL_seek(FileHandle *handle, PHYSFS_uint64 offset)
|
||||
{
|
||||
MVLfileinfo *finfo = (MVLfileinfo *) (handle->opaque);
|
||||
MVLentry *entry = finfo->entry;
|
||||
int rc;
|
||||
|
||||
BAIL_IF_MACRO(offset < 0, ERR_INVALID_ARGUMENT, 0);
|
||||
BAIL_IF_MACRO(offset >= entry->size, ERR_PAST_EOF, 0);
|
||||
rc = __PHYSFS_platformSeek(finfo->handle, entry->startPos + offset);
|
||||
if (rc)
|
||||
finfo->curPos = (PHYSFS_uint32) offset;
|
||||
|
||||
return(rc);
|
||||
} /* MVL_seek */
|
||||
|
||||
|
||||
static PHYSFS_sint64 MVL_fileLength(FileHandle *handle)
|
||||
{
|
||||
MVLfileinfo *finfo = ((MVLfileinfo *) handle->opaque);
|
||||
return((PHYSFS_sint64) finfo->entry->size);
|
||||
} /* MVL_fileLength */
|
||||
|
||||
|
||||
static int MVL_fileClose(FileHandle *handle)
|
||||
{
|
||||
MVLfileinfo *finfo = ((MVLfileinfo *) handle->opaque);
|
||||
BAIL_IF_MACRO(!__PHYSFS_platformClose(finfo->handle), NULL, 0);
|
||||
free(finfo);
|
||||
free(handle);
|
||||
return(1);
|
||||
} /* MVL_fileClose */
|
||||
|
||||
|
||||
static int mvl_open(const char *filename, int forWriting,
|
||||
void **fh, PHYSFS_uint32 *count)
|
||||
{
|
||||
PHYSFS_uint8 buf[4];
|
||||
|
||||
*fh = NULL;
|
||||
BAIL_IF_MACRO(forWriting, ERR_ARC_IS_READ_ONLY, 0);
|
||||
|
||||
*fh = __PHYSFS_platformOpenRead(filename);
|
||||
BAIL_IF_MACRO(*fh == NULL, NULL, 0);
|
||||
|
||||
if (__PHYSFS_platformRead(*fh, buf, 4, 1) != 1)
|
||||
goto openMvl_failed;
|
||||
|
||||
if (memcmp(buf, "DMVL", 4) != 0)
|
||||
{
|
||||
__PHYSFS_setError(ERR_UNSUPPORTED_ARCHIVE);
|
||||
goto openMvl_failed;
|
||||
} /* if */
|
||||
|
||||
if (__PHYSFS_platformRead(*fh, count, sizeof (PHYSFS_uint32), 1) != 1)
|
||||
goto openMvl_failed;
|
||||
|
||||
*count = PHYSFS_swapULE32(*count);
|
||||
|
||||
return(1);
|
||||
|
||||
openMvl_failed:
|
||||
if (*fh != NULL)
|
||||
__PHYSFS_platformClose(*fh);
|
||||
|
||||
*count = -1;
|
||||
*fh = NULL;
|
||||
return(0);
|
||||
} /* mvl_open */
|
||||
|
||||
|
||||
static int MVL_isArchive(const char *filename, int forWriting)
|
||||
{
|
||||
void *fh;
|
||||
PHYSFS_uint32 fileCount;
|
||||
int retval = mvl_open(filename, forWriting, &fh, &fileCount);
|
||||
|
||||
if (fh != NULL)
|
||||
__PHYSFS_platformClose(fh);
|
||||
|
||||
return(retval);
|
||||
} /* MVL_isArchive */
|
||||
|
||||
|
||||
static int mvl_entry_cmp(void *_a, PHYSFS_uint32 one, PHYSFS_uint32 two)
|
||||
{
|
||||
MVLentry *a = (MVLentry *) _a;
|
||||
return(strcmp(a[one].name, a[two].name));
|
||||
} /* mvl_entry_cmp */
|
||||
|
||||
|
||||
static void mvl_entry_swap(void *_a, PHYSFS_uint32 one, PHYSFS_uint32 two)
|
||||
{
|
||||
MVLentry tmp;
|
||||
MVLentry *first = &(((MVLentry *) _a)[one]);
|
||||
MVLentry *second = &(((MVLentry *) _a)[two]);
|
||||
memcpy(&tmp, first, sizeof (MVLentry));
|
||||
memcpy(first, second, sizeof (MVLentry));
|
||||
memcpy(second, &tmp, sizeof (MVLentry));
|
||||
} /* mvl_entry_swap */
|
||||
|
||||
|
||||
static int mvl_load_entries(const char *name, int forWriting, MVLinfo *info)
|
||||
{
|
||||
void *fh = NULL;
|
||||
PHYSFS_uint32 fileCount;
|
||||
PHYSFS_uint32 location = 8; /* sizeof sig. */
|
||||
MVLentry *entry;
|
||||
|
||||
BAIL_IF_MACRO(!mvl_open(name, forWriting, &fh, &fileCount), NULL, 0);
|
||||
info->entryCount = fileCount;
|
||||
info->entries = (MVLentry *) malloc(sizeof (MVLentry) * fileCount);
|
||||
if (info->entries == NULL)
|
||||
{
|
||||
__PHYSFS_platformClose(fh);
|
||||
BAIL_MACRO(ERR_OUT_OF_MEMORY, 0);
|
||||
} /* if */
|
||||
|
||||
location += (17 * fileCount);
|
||||
|
||||
for (entry = info->entries; fileCount > 0; fileCount--, entry++)
|
||||
{
|
||||
if (__PHYSFS_platformRead(fh, &entry->name, 13, 1) != 1)
|
||||
{
|
||||
__PHYSFS_platformClose(fh);
|
||||
return(0);
|
||||
} /* if */
|
||||
|
||||
if (__PHYSFS_platformRead(fh, &entry->size, 4, 1) != 1)
|
||||
{
|
||||
__PHYSFS_platformClose(fh);
|
||||
return(0);
|
||||
} /* if */
|
||||
|
||||
entry->size = PHYSFS_swapULE32(entry->size);
|
||||
entry->startPos = location;
|
||||
location += entry->size;
|
||||
} /* for */
|
||||
|
||||
__PHYSFS_platformClose(fh);
|
||||
|
||||
__PHYSFS_sort(info->entries, info->entryCount,
|
||||
mvl_entry_cmp, mvl_entry_swap);
|
||||
return(1);
|
||||
} /* mvl_load_entries */
|
||||
|
||||
|
||||
static DirHandle *MVL_openArchive(const char *name, int forWriting)
|
||||
{
|
||||
MVLinfo *info;
|
||||
DirHandle *retval = malloc(sizeof (DirHandle));
|
||||
PHYSFS_sint64 modtime = __PHYSFS_platformGetLastModTime(name);
|
||||
|
||||
BAIL_IF_MACRO(retval == NULL, ERR_OUT_OF_MEMORY, NULL);
|
||||
info = retval->opaque = malloc(sizeof (MVLinfo));
|
||||
if (info == NULL)
|
||||
{
|
||||
__PHYSFS_setError(ERR_OUT_OF_MEMORY);
|
||||
goto MVL_openArchive_failed;
|
||||
} /* if */
|
||||
|
||||
memset(info, '\0', sizeof (MVLinfo));
|
||||
|
||||
info->filename = (char *) malloc(strlen(name) + 1);
|
||||
if (info->filename == NULL)
|
||||
{
|
||||
__PHYSFS_setError(ERR_OUT_OF_MEMORY);
|
||||
goto MVL_openArchive_failed;
|
||||
} /* if */
|
||||
|
||||
if (!mvl_load_entries(name, forWriting, info))
|
||||
goto MVL_openArchive_failed;
|
||||
|
||||
strcpy(info->filename, name);
|
||||
info->last_mod_time = modtime;
|
||||
retval->funcs = &__PHYSFS_DirFunctions_MVL;
|
||||
return(retval);
|
||||
|
||||
MVL_openArchive_failed:
|
||||
if (retval != NULL)
|
||||
{
|
||||
if (retval->opaque != NULL)
|
||||
{
|
||||
if (info->filename != NULL)
|
||||
free(info->filename);
|
||||
if (info->entries != NULL)
|
||||
free(info->entries);
|
||||
free(info);
|
||||
} /* if */
|
||||
free(retval);
|
||||
} /* if */
|
||||
|
||||
return(NULL);
|
||||
} /* MVL_openArchive */
|
||||
|
||||
|
||||
static LinkedStringList *MVL_enumerateFiles(DirHandle *h,
|
||||
const char *dirname,
|
||||
int omitSymLinks)
|
||||
{
|
||||
MVLinfo *info = ((MVLinfo *) h->opaque);
|
||||
MVLentry *entry = info->entries;
|
||||
LinkedStringList *retval = NULL, *p = NULL;
|
||||
PHYSFS_uint32 max = info->entryCount;
|
||||
PHYSFS_uint32 i;
|
||||
|
||||
/* no directories in MVL files. */
|
||||
BAIL_IF_MACRO(*dirname != '\0', ERR_NOT_A_DIR, NULL);
|
||||
|
||||
for (i = 0; i < max; i++, entry++)
|
||||
retval = __PHYSFS_addToLinkedStringList(retval, &p, entry->name, -1);
|
||||
|
||||
return(retval);
|
||||
} /* MVL_enumerateFiles */
|
||||
|
||||
|
||||
static MVLentry *mvl_find_entry(MVLinfo *info, const char *name)
|
||||
{
|
||||
char *ptr = strchr(name, '.');
|
||||
MVLentry *a = info->entries;
|
||||
PHYSFS_sint32 lo = 0;
|
||||
PHYSFS_sint32 hi = (PHYSFS_sint32) (info->entryCount - 1);
|
||||
PHYSFS_sint32 middle;
|
||||
int rc;
|
||||
|
||||
/*
|
||||
* Rule out filenames to avoid unneeded processing...no dirs,
|
||||
* big filenames, or extensions > 3 chars.
|
||||
*/
|
||||
BAIL_IF_MACRO((ptr) && (strlen(ptr) > 4), ERR_NO_SUCH_FILE, NULL);
|
||||
BAIL_IF_MACRO(strlen(name) > 12, ERR_NO_SUCH_FILE, NULL);
|
||||
BAIL_IF_MACRO(strchr(name, '/') != NULL, ERR_NO_SUCH_FILE, NULL);
|
||||
|
||||
while (lo <= hi)
|
||||
{
|
||||
middle = lo + ((hi - lo) / 2);
|
||||
rc = __PHYSFS_platformStricmp(name, a[middle].name);
|
||||
if (rc == 0) /* found it! */
|
||||
return(&a[middle]);
|
||||
else if (rc > 0)
|
||||
lo = middle + 1;
|
||||
else
|
||||
hi = middle - 1;
|
||||
} /* while */
|
||||
|
||||
BAIL_MACRO(ERR_NO_SUCH_FILE, NULL);
|
||||
} /* mvl_find_entry */
|
||||
|
||||
|
||||
static int MVL_exists(DirHandle *h, const char *name)
|
||||
{
|
||||
return(mvl_find_entry(((MVLinfo *) h->opaque), name) != NULL);
|
||||
} /* MVL_exists */
|
||||
|
||||
|
||||
static int MVL_isDirectory(DirHandle *h, const char *name, int *fileExists)
|
||||
{
|
||||
*fileExists = MVL_exists(h, name);
|
||||
return(0); /* never directories in a groupfile. */
|
||||
} /* MVL_isDirectory */
|
||||
|
||||
|
||||
static int MVL_isSymLink(DirHandle *h, const char *name, int *fileExists)
|
||||
{
|
||||
*fileExists = MVL_exists(h, name);
|
||||
return(0); /* never symlinks in a groupfile. */
|
||||
} /* MVL_isSymLink */
|
||||
|
||||
|
||||
static PHYSFS_sint64 MVL_getLastModTime(DirHandle *h,
|
||||
const char *name,
|
||||
int *fileExists)
|
||||
{
|
||||
MVLinfo *info = ((MVLinfo *) h->opaque);
|
||||
PHYSFS_sint64 retval = -1;
|
||||
|
||||
*fileExists = (mvl_find_entry(info, name) != NULL);
|
||||
if (*fileExists) /* use time of MVL itself in the physical filesystem. */
|
||||
retval = ((MVLinfo *) h->opaque)->last_mod_time;
|
||||
|
||||
return(retval);
|
||||
} /* MVL_getLastModTime */
|
||||
|
||||
|
||||
static FileHandle *MVL_openRead(DirHandle *h, const char *fnm, int *fileExists)
|
||||
{
|
||||
MVLinfo *info = ((MVLinfo *) h->opaque);
|
||||
FileHandle *retval;
|
||||
MVLfileinfo *finfo;
|
||||
MVLentry *entry;
|
||||
|
||||
entry = mvl_find_entry(info, fnm);
|
||||
*fileExists = (entry != NULL);
|
||||
BAIL_IF_MACRO(entry == NULL, NULL, NULL);
|
||||
|
||||
retval = (FileHandle *) malloc(sizeof (FileHandle));
|
||||
BAIL_IF_MACRO(retval == NULL, ERR_OUT_OF_MEMORY, NULL);
|
||||
finfo = (MVLfileinfo *) malloc(sizeof (MVLfileinfo));
|
||||
if (finfo == NULL)
|
||||
{
|
||||
free(retval);
|
||||
BAIL_MACRO(ERR_OUT_OF_MEMORY, NULL);
|
||||
} /* if */
|
||||
|
||||
finfo->handle = __PHYSFS_platformOpenRead(info->filename);
|
||||
if ( (finfo->handle == NULL) ||
|
||||
(!__PHYSFS_platformSeek(finfo->handle, entry->startPos)) )
|
||||
{
|
||||
free(finfo);
|
||||
free(retval);
|
||||
return(NULL);
|
||||
} /* if */
|
||||
|
||||
finfo->curPos = 0;
|
||||
finfo->entry = entry;
|
||||
retval->opaque = (void *) finfo;
|
||||
retval->funcs = &__PHYSFS_FileFunctions_MVL;
|
||||
retval->dirHandle = h;
|
||||
return(retval);
|
||||
} /* MVL_openRead */
|
||||
|
||||
|
||||
static FileHandle *MVL_openWrite(DirHandle *h, const char *name)
|
||||
{
|
||||
BAIL_MACRO(ERR_NOT_SUPPORTED, NULL);
|
||||
} /* MVL_openWrite */
|
||||
|
||||
|
||||
static FileHandle *MVL_openAppend(DirHandle *h, const char *name)
|
||||
{
|
||||
BAIL_MACRO(ERR_NOT_SUPPORTED, NULL);
|
||||
} /* MVL_openAppend */
|
||||
|
||||
|
||||
static int MVL_remove(DirHandle *h, const char *name)
|
||||
{
|
||||
BAIL_MACRO(ERR_NOT_SUPPORTED, 0);
|
||||
} /* MVL_remove */
|
||||
|
||||
|
||||
static int MVL_mkdir(DirHandle *h, const char *name)
|
||||
{
|
||||
BAIL_MACRO(ERR_NOT_SUPPORTED, 0);
|
||||
} /* MVL_mkdir */
|
||||
|
||||
#endif /* defined PHYSFS_SUPPORTS_MVL */
|
||||
|
||||
/* end of mvl.c ... */
|
||||
|
674
archivers/qpak.c
674
archivers/qpak.c
|
@ -1,674 +0,0 @@
|
|||
/*
|
||||
* QPAK support routines for PhysicsFS.
|
||||
*
|
||||
* This archiver handles the archive format utilized by Quake 1 and 2.
|
||||
* Quake3-based games use the PkZip/Info-Zip format (which our zip.c
|
||||
* archiver handles).
|
||||
*
|
||||
* ========================================================================
|
||||
*
|
||||
* This format info (in more detail) comes from:
|
||||
* http://debian.fmi.uni-sofia.bg/~sergei/cgsr/docs/pak.txt
|
||||
*
|
||||
* Quake PAK Format
|
||||
*
|
||||
* Header
|
||||
* (4 bytes) signature = 'PACK'
|
||||
* (4 bytes) directory offset
|
||||
* (4 bytes) directory length
|
||||
*
|
||||
* Directory
|
||||
* (56 bytes) file name
|
||||
* (4 bytes) file position
|
||||
* (4 bytes) file length
|
||||
*
|
||||
* ========================================================================
|
||||
*
|
||||
* Please see the file LICENSE in the source's root directory.
|
||||
*
|
||||
* This file written by Ryan C. Gordon.
|
||||
*/
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#if (defined PHYSFS_SUPPORTS_QPAK)
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "physfs.h"
|
||||
|
||||
#define __PHYSICSFS_INTERNAL__
|
||||
#include "physfs_internal.h"
|
||||
|
||||
#if 1 /* Make this case insensitive? */
|
||||
#define QPAK_strcmp(x, y) __PHYSFS_platformStricmp(x, y)
|
||||
#define QPAK_strncmp(x, y, z) __PHYSFS_platformStrnicmp(x, y, z)
|
||||
#else
|
||||
#define QPAK_strcmp(x, y) strcmp(x, y)
|
||||
#define QPAK_strncmp(x, y, z) strncmp(x, y, z)
|
||||
#endif
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char name[56];
|
||||
PHYSFS_uint32 startPos;
|
||||
PHYSFS_uint32 size;
|
||||
} QPAKentry;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char *filename;
|
||||
PHYSFS_sint64 last_mod_time;
|
||||
PHYSFS_uint32 entryCount;
|
||||
QPAKentry *entries;
|
||||
} QPAKinfo;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
void *handle;
|
||||
QPAKentry *entry;
|
||||
PHYSFS_uint32 curPos;
|
||||
} QPAKfileinfo;
|
||||
|
||||
/* Magic numbers... */
|
||||
#define QPAK_SIGNATURE 0x4b434150 /* "PACK" in ASCII. */
|
||||
|
||||
|
||||
static void QPAK_dirClose(DirHandle *h);
|
||||
static PHYSFS_sint64 QPAK_read(FileHandle *handle, void *buffer,
|
||||
PHYSFS_uint32 objSize, PHYSFS_uint32 objCount);
|
||||
static PHYSFS_sint64 QPAK_write(FileHandle *handle, const void *buffer,
|
||||
PHYSFS_uint32 objSize, PHYSFS_uint32 objCount);
|
||||
static int QPAK_eof(FileHandle *handle);
|
||||
static PHYSFS_sint64 QPAK_tell(FileHandle *handle);
|
||||
static int QPAK_seek(FileHandle *handle, PHYSFS_uint64 offset);
|
||||
static PHYSFS_sint64 QPAK_fileLength(FileHandle *handle);
|
||||
static int QPAK_fileClose(FileHandle *handle);
|
||||
static int QPAK_isArchive(const char *filename, int forWriting);
|
||||
static DirHandle *QPAK_openArchive(const char *name, int forWriting);
|
||||
static LinkedStringList *QPAK_enumerateFiles(DirHandle *h,
|
||||
const char *dirname,
|
||||
int omitSymLinks);
|
||||
static int QPAK_exists(DirHandle *h, const char *name);
|
||||
static int QPAK_isDirectory(DirHandle *h, const char *name, int *fileExists);
|
||||
static int QPAK_isSymLink(DirHandle *h, const char *name, int *fileExists);
|
||||
static PHYSFS_sint64 QPAK_getLastModTime(DirHandle *h, const char *n, int *e);
|
||||
static FileHandle *QPAK_openRead(DirHandle *h, const char *name, int *exist);
|
||||
static FileHandle *QPAK_openWrite(DirHandle *h, const char *name);
|
||||
static FileHandle *QPAK_openAppend(DirHandle *h, const char *name);
|
||||
static int QPAK_remove(DirHandle *h, const char *name);
|
||||
static int QPAK_mkdir(DirHandle *h, const char *name);
|
||||
|
||||
const PHYSFS_ArchiveInfo __PHYSFS_ArchiveInfo_QPAK =
|
||||
{
|
||||
"PAK",
|
||||
QPAK_ARCHIVE_DESCRIPTION,
|
||||
"Ryan C. Gordon <icculus@clutteredmind.org>",
|
||||
"http://icculus.org/physfs/",
|
||||
};
|
||||
|
||||
|
||||
static const FileFunctions __PHYSFS_FileFunctions_QPAK =
|
||||
{
|
||||
QPAK_read, /* read() method */
|
||||
QPAK_write, /* write() method */
|
||||
QPAK_eof, /* eof() method */
|
||||
QPAK_tell, /* tell() method */
|
||||
QPAK_seek, /* seek() method */
|
||||
QPAK_fileLength, /* fileLength() method */
|
||||
QPAK_fileClose /* fileClose() method */
|
||||
};
|
||||
|
||||
|
||||
const DirFunctions __PHYSFS_DirFunctions_QPAK =
|
||||
{
|
||||
&__PHYSFS_ArchiveInfo_QPAK,
|
||||
QPAK_isArchive, /* isArchive() method */
|
||||
QPAK_openArchive, /* openArchive() method */
|
||||
QPAK_enumerateFiles, /* enumerateFiles() method */
|
||||
QPAK_exists, /* exists() method */
|
||||
QPAK_isDirectory, /* isDirectory() method */
|
||||
QPAK_isSymLink, /* isSymLink() method */
|
||||
QPAK_getLastModTime, /* getLastModTime() method */
|
||||
QPAK_openRead, /* openRead() method */
|
||||
QPAK_openWrite, /* openWrite() method */
|
||||
QPAK_openAppend, /* openAppend() method */
|
||||
QPAK_remove, /* remove() method */
|
||||
QPAK_mkdir, /* mkdir() method */
|
||||
QPAK_dirClose /* dirClose() method */
|
||||
};
|
||||
|
||||
|
||||
|
||||
static void QPAK_dirClose(DirHandle *h)
|
||||
{
|
||||
QPAKinfo *info = ((QPAKinfo *) h->opaque);
|
||||
free(info->filename);
|
||||
free(info->entries);
|
||||
free(info);
|
||||
free(h);
|
||||
} /* QPAK_dirClose */
|
||||
|
||||
|
||||
static PHYSFS_sint64 QPAK_read(FileHandle *handle, void *buffer,
|
||||
PHYSFS_uint32 objSize, PHYSFS_uint32 objCount)
|
||||
{
|
||||
QPAKfileinfo *finfo = (QPAKfileinfo *) (handle->opaque);
|
||||
QPAKentry *entry = finfo->entry;
|
||||
PHYSFS_uint32 bytesLeft = entry->size - finfo->curPos;
|
||||
PHYSFS_uint32 objsLeft = (bytesLeft / objSize);
|
||||
PHYSFS_sint64 rc;
|
||||
|
||||
if (objsLeft < objCount)
|
||||
objCount = objsLeft;
|
||||
|
||||
rc = __PHYSFS_platformRead(finfo->handle, buffer, objSize, objCount);
|
||||
if (rc > 0)
|
||||
finfo->curPos += (PHYSFS_uint32) (rc * objSize);
|
||||
|
||||
return(rc);
|
||||
} /* QPAK_read */
|
||||
|
||||
|
||||
static PHYSFS_sint64 QPAK_write(FileHandle *handle, const void *buffer,
|
||||
PHYSFS_uint32 objSize, PHYSFS_uint32 objCount)
|
||||
{
|
||||
BAIL_MACRO(ERR_NOT_SUPPORTED, -1);
|
||||
} /* QPAK_write */
|
||||
|
||||
|
||||
static int QPAK_eof(FileHandle *handle)
|
||||
{
|
||||
QPAKfileinfo *finfo = (QPAKfileinfo *) (handle->opaque);
|
||||
QPAKentry *entry = finfo->entry;
|
||||
return(finfo->curPos >= entry->size);
|
||||
} /* QPAK_eof */
|
||||
|
||||
|
||||
static PHYSFS_sint64 QPAK_tell(FileHandle *handle)
|
||||
{
|
||||
return(((QPAKfileinfo *) (handle->opaque))->curPos);
|
||||
} /* QPAK_tell */
|
||||
|
||||
|
||||
static int QPAK_seek(FileHandle *handle, PHYSFS_uint64 offset)
|
||||
{
|
||||
QPAKfileinfo *finfo = (QPAKfileinfo *) (handle->opaque);
|
||||
QPAKentry *entry = finfo->entry;
|
||||
int rc;
|
||||
|
||||
BAIL_IF_MACRO(offset < 0, ERR_INVALID_ARGUMENT, 0);
|
||||
BAIL_IF_MACRO(offset >= entry->size, ERR_PAST_EOF, 0);
|
||||
rc = __PHYSFS_platformSeek(finfo->handle, entry->startPos + offset);
|
||||
if (rc)
|
||||
finfo->curPos = (PHYSFS_uint32) offset;
|
||||
|
||||
return(rc);
|
||||
} /* QPAK_seek */
|
||||
|
||||
|
||||
static PHYSFS_sint64 QPAK_fileLength(FileHandle *handle)
|
||||
{
|
||||
QPAKfileinfo *finfo = ((QPAKfileinfo *) handle->opaque);
|
||||
return((PHYSFS_sint64) finfo->entry->size);
|
||||
} /* QPAK_fileLength */
|
||||
|
||||
|
||||
static int QPAK_fileClose(FileHandle *handle)
|
||||
{
|
||||
QPAKfileinfo *finfo = ((QPAKfileinfo *) handle->opaque);
|
||||
BAIL_IF_MACRO(!__PHYSFS_platformClose(finfo->handle), NULL, 0);
|
||||
free(finfo);
|
||||
free(handle);
|
||||
return(1);
|
||||
} /* QPAK_fileClose */
|
||||
|
||||
|
||||
static int qpak_open(const char *filename, int forWriting,
|
||||
void **fh, PHYSFS_uint32 *count)
|
||||
{
|
||||
PHYSFS_uint32 buf;
|
||||
|
||||
*fh = NULL;
|
||||
BAIL_IF_MACRO(forWriting, ERR_ARC_IS_READ_ONLY, 0);
|
||||
|
||||
*fh = __PHYSFS_platformOpenRead(filename);
|
||||
BAIL_IF_MACRO(*fh == NULL, NULL, 0);
|
||||
|
||||
if (__PHYSFS_platformRead(*fh, &buf, sizeof (PHYSFS_uint32), 1) != 1)
|
||||
goto openQpak_failed;
|
||||
|
||||
buf = PHYSFS_swapULE32(buf);
|
||||
if (buf != QPAK_SIGNATURE)
|
||||
{
|
||||
__PHYSFS_setError(ERR_UNSUPPORTED_ARCHIVE);
|
||||
goto openQpak_failed;
|
||||
} /* if */
|
||||
|
||||
if (__PHYSFS_platformRead(*fh, &buf, sizeof (PHYSFS_uint32), 1) != 1)
|
||||
goto openQpak_failed;
|
||||
|
||||
buf = PHYSFS_swapULE32(buf); /* directory table offset. */
|
||||
|
||||
if (__PHYSFS_platformRead(*fh, count, sizeof (PHYSFS_uint32), 1) != 1)
|
||||
goto openQpak_failed;
|
||||
|
||||
*count = PHYSFS_swapULE32(*count);
|
||||
|
||||
if ((*count % 64) != 0) /* corrupted archive? */
|
||||
{
|
||||
__PHYSFS_setError(ERR_CORRUPTED);
|
||||
goto openQpak_failed;
|
||||
} /* if */
|
||||
|
||||
if (!__PHYSFS_platformSeek(*fh, buf))
|
||||
goto openQpak_failed;
|
||||
|
||||
*count /= 64;
|
||||
return(1);
|
||||
|
||||
openQpak_failed:
|
||||
if (*fh != NULL)
|
||||
__PHYSFS_platformClose(*fh);
|
||||
|
||||
*count = -1;
|
||||
*fh = NULL;
|
||||
return(0);
|
||||
} /* qpak_open */
|
||||
|
||||
|
||||
static int QPAK_isArchive(const char *filename, int forWriting)
|
||||
{
|
||||
void *fh;
|
||||
PHYSFS_uint32 fileCount;
|
||||
int retval = qpak_open(filename, forWriting, &fh, &fileCount);
|
||||
|
||||
if (fh != NULL)
|
||||
__PHYSFS_platformClose(fh);
|
||||
|
||||
return(retval);
|
||||
} /* QPAK_isArchive */
|
||||
|
||||
|
||||
static int qpak_entry_cmp(void *_a, PHYSFS_uint32 one, PHYSFS_uint32 two)
|
||||
{
|
||||
QPAKentry *a = (QPAKentry *) _a;
|
||||
return(QPAK_strcmp(a[one].name, a[two].name));
|
||||
} /* qpak_entry_cmp */
|
||||
|
||||
|
||||
static void qpak_entry_swap(void *_a, PHYSFS_uint32 one, PHYSFS_uint32 two)
|
||||
{
|
||||
QPAKentry tmp;
|
||||
QPAKentry *first = &(((QPAKentry *) _a)[one]);
|
||||
QPAKentry *second = &(((QPAKentry *) _a)[two]);
|
||||
memcpy(&tmp, first, sizeof (QPAKentry));
|
||||
memcpy(first, second, sizeof (QPAKentry));
|
||||
memcpy(second, &tmp, sizeof (QPAKentry));
|
||||
} /* qpak_entry_swap */
|
||||
|
||||
|
||||
static int qpak_load_entries(const char *name, int forWriting, QPAKinfo *info)
|
||||
{
|
||||
void *fh = NULL;
|
||||
PHYSFS_uint32 fileCount;
|
||||
QPAKentry *entry;
|
||||
|
||||
BAIL_IF_MACRO(!qpak_open(name, forWriting, &fh, &fileCount), NULL, 0);
|
||||
info->entryCount = fileCount;
|
||||
info->entries = (QPAKentry *) malloc(sizeof (QPAKentry) * fileCount);
|
||||
if (info->entries == NULL)
|
||||
{
|
||||
__PHYSFS_platformClose(fh);
|
||||
BAIL_MACRO(ERR_OUT_OF_MEMORY, 0);
|
||||
} /* if */
|
||||
|
||||
for (entry = info->entries; fileCount > 0; fileCount--, entry++)
|
||||
{
|
||||
PHYSFS_uint32 loc;
|
||||
|
||||
if (__PHYSFS_platformRead(fh,&entry->name,sizeof(entry->name),1) != 1)
|
||||
{
|
||||
__PHYSFS_platformClose(fh);
|
||||
return(0);
|
||||
} /* if */
|
||||
|
||||
if (__PHYSFS_platformRead(fh,&loc,sizeof(loc),1) != 1)
|
||||
{
|
||||
__PHYSFS_platformClose(fh);
|
||||
return(0);
|
||||
} /* if */
|
||||
|
||||
if (__PHYSFS_platformRead(fh,&entry->size,sizeof(entry->size),1) != 1)
|
||||
{
|
||||
__PHYSFS_platformClose(fh);
|
||||
return(0);
|
||||
} /* if */
|
||||
|
||||
entry->size = PHYSFS_swapULE32(entry->size);
|
||||
entry->startPos = PHYSFS_swapULE32(loc);
|
||||
} /* for */
|
||||
|
||||
__PHYSFS_platformClose(fh);
|
||||
|
||||
__PHYSFS_sort(info->entries, info->entryCount,
|
||||
qpak_entry_cmp, qpak_entry_swap);
|
||||
return(1);
|
||||
} /* qpak_load_entries */
|
||||
|
||||
|
||||
static DirHandle *QPAK_openArchive(const char *name, int forWriting)
|
||||
{
|
||||
QPAKinfo *info;
|
||||
DirHandle *retval = malloc(sizeof (DirHandle));
|
||||
PHYSFS_sint64 modtime = __PHYSFS_platformGetLastModTime(name);
|
||||
|
||||
BAIL_IF_MACRO(retval == NULL, ERR_OUT_OF_MEMORY, NULL);
|
||||
info = retval->opaque = malloc(sizeof (QPAKinfo));
|
||||
if (info == NULL)
|
||||
{
|
||||
__PHYSFS_setError(ERR_OUT_OF_MEMORY);
|
||||
goto QPAK_openArchive_failed;
|
||||
} /* if */
|
||||
|
||||
memset(info, '\0', sizeof (QPAKinfo));
|
||||
|
||||
info->filename = (char *) malloc(strlen(name) + 1);
|
||||
if (info->filename == NULL)
|
||||
{
|
||||
__PHYSFS_setError(ERR_OUT_OF_MEMORY);
|
||||
goto QPAK_openArchive_failed;
|
||||
} /* if */
|
||||
|
||||
if (!qpak_load_entries(name, forWriting, info))
|
||||
goto QPAK_openArchive_failed;
|
||||
|
||||
strcpy(info->filename, name);
|
||||
info->last_mod_time = modtime;
|
||||
retval->funcs = &__PHYSFS_DirFunctions_QPAK;
|
||||
return(retval);
|
||||
|
||||
QPAK_openArchive_failed:
|
||||
if (retval != NULL)
|
||||
{
|
||||
if (retval->opaque != NULL)
|
||||
{
|
||||
if (info->filename != NULL)
|
||||
free(info->filename);
|
||||
if (info->entries != NULL)
|
||||
free(info->entries);
|
||||
free(info);
|
||||
} /* if */
|
||||
free(retval);
|
||||
} /* if */
|
||||
|
||||
return(NULL);
|
||||
} /* QPAK_openArchive */
|
||||
|
||||
|
||||
static PHYSFS_sint32 qpak_find_start_of_dir(QPAKinfo *info, const char *path,
|
||||
int stop_on_first_find)
|
||||
{
|
||||
PHYSFS_sint32 lo = 0;
|
||||
PHYSFS_sint32 hi = (PHYSFS_sint32) (info->entryCount - 1);
|
||||
PHYSFS_sint32 middle;
|
||||
PHYSFS_uint32 dlen = strlen(path);
|
||||
PHYSFS_sint32 retval = -1;
|
||||
const char *name;
|
||||
int rc;
|
||||
|
||||
if (*path == '\0') /* root dir? */
|
||||
return(0);
|
||||
|
||||
if ((dlen > 0) && (path[dlen - 1] == '/')) /* ignore trailing slash. */
|
||||
dlen--;
|
||||
|
||||
while (lo <= hi)
|
||||
{
|
||||
middle = lo + ((hi - lo) / 2);
|
||||
name = info->entries[middle].name;
|
||||
rc = QPAK_strncmp(path, name, dlen);
|
||||
if (rc == 0)
|
||||
{
|
||||
char ch = name[dlen];
|
||||
if (ch < '/') /* make sure this isn't just a substr match. */
|
||||
rc = -1;
|
||||
else if (ch > '/')
|
||||
rc = 1;
|
||||
else
|
||||
{
|
||||
if (stop_on_first_find) /* Just checking dir's existance? */
|
||||
return(middle);
|
||||
|
||||
if (name[dlen + 1] == '\0') /* Skip initial dir entry. */
|
||||
return(middle + 1);
|
||||
|
||||
/* there might be more entries earlier in the list. */
|
||||
retval = middle;
|
||||
hi = middle - 1;
|
||||
} /* else */
|
||||
} /* if */
|
||||
|
||||
if (rc > 0)
|
||||
lo = middle + 1;
|
||||
else
|
||||
hi = middle - 1;
|
||||
} /* while */
|
||||
|
||||
return(retval);
|
||||
} /* qpak_find_start_of_dir */
|
||||
|
||||
|
||||
static LinkedStringList *QPAK_enumerateFiles(DirHandle *h,
|
||||
const char *dirname,
|
||||
int omitSymLinks)
|
||||
{
|
||||
QPAKinfo *info = ((QPAKinfo *) h->opaque);
|
||||
LinkedStringList *retval = NULL, *p = NULL;
|
||||
PHYSFS_sint32 dlen, dlen_inc, max, i;
|
||||
|
||||
i = qpak_find_start_of_dir(info, dirname, 0);
|
||||
BAIL_IF_MACRO(i == -1, ERR_NO_SUCH_FILE, NULL);
|
||||
|
||||
dlen = strlen(dirname);
|
||||
if ((dlen > 0) && (dirname[dlen - 1] == '/')) /* ignore trailing slash. */
|
||||
dlen--;
|
||||
|
||||
dlen_inc = ((dlen > 0) ? 1 : 0) + dlen;
|
||||
max = (PHYSFS_sint32) info->entryCount;
|
||||
while (i < max)
|
||||
{
|
||||
char *add;
|
||||
char *ptr;
|
||||
PHYSFS_sint32 ln;
|
||||
char *e = info->entries[i].name;
|
||||
if ((dlen) && ((QPAK_strncmp(e, dirname, dlen)) || (e[dlen] != '/')))
|
||||
break; /* past end of this dir; we're done. */
|
||||
|
||||
add = e + dlen_inc;
|
||||
ptr = strchr(add, '/');
|
||||
ln = (PHYSFS_sint32) ((ptr) ? ptr-add : strlen(add));
|
||||
retval = __PHYSFS_addToLinkedStringList(retval, &p, add, ln);
|
||||
ln += dlen_inc; /* point past entry to children... */
|
||||
|
||||
/* increment counter and skip children of subdirs... */
|
||||
while ((++i < max) && (ptr != NULL))
|
||||
{
|
||||
char *e_new = info->entries[i].name;
|
||||
if ((QPAK_strncmp(e, e_new, ln) != 0) || (e_new[ln] != '/'))
|
||||
break;
|
||||
} /* while */
|
||||
} /* while */
|
||||
|
||||
return(retval);
|
||||
} /* QPAK_enumerateFiles */
|
||||
|
||||
|
||||
/*
|
||||
* This will find the QPAKentry associated with a path in platform-independent
|
||||
* notation. Directories don't have QPAKentries associated with them, but
|
||||
* (*isDir) will be set to non-zero if a dir was hit.
|
||||
*/
|
||||
static QPAKentry *qpak_find_entry(QPAKinfo *info, const char *path, int *isDir)
|
||||
{
|
||||
QPAKentry *a = info->entries;
|
||||
PHYSFS_sint32 pathlen = strlen(path);
|
||||
PHYSFS_sint32 lo = 0;
|
||||
PHYSFS_sint32 hi = (PHYSFS_sint32) (info->entryCount - 1);
|
||||
PHYSFS_sint32 middle;
|
||||
const char *thispath = NULL;
|
||||
int rc;
|
||||
|
||||
while (lo <= hi)
|
||||
{
|
||||
middle = lo + ((hi - lo) / 2);
|
||||
thispath = a[middle].name;
|
||||
rc = QPAK_strncmp(path, thispath, pathlen);
|
||||
|
||||
if (rc > 0)
|
||||
lo = middle + 1;
|
||||
|
||||
else if (rc < 0)
|
||||
hi = middle - 1;
|
||||
|
||||
else /* substring match...might be dir or entry or nothing. */
|
||||
{
|
||||
if (isDir != NULL)
|
||||
{
|
||||
*isDir = (thispath[pathlen] == '/');
|
||||
if (*isDir)
|
||||
return(NULL);
|
||||
} /* if */
|
||||
|
||||
if (thispath[pathlen] == '\0') /* found entry? */
|
||||
return(&a[middle]);
|
||||
else
|
||||
hi = middle - 1; /* adjust search params, try again. */
|
||||
} /* if */
|
||||
} /* while */
|
||||
|
||||
if (isDir != NULL)
|
||||
*isDir = 0;
|
||||
|
||||
BAIL_MACRO(ERR_NO_SUCH_FILE, NULL);
|
||||
} /* qpak_find_entry */
|
||||
|
||||
|
||||
static int QPAK_exists(DirHandle *h, const char *name)
|
||||
{
|
||||
int isDir;
|
||||
QPAKinfo *info = (QPAKinfo *) h->opaque;
|
||||
QPAKentry *entry = qpak_find_entry(info, name, &isDir);
|
||||
return((entry != NULL) || (isDir));
|
||||
} /* QPAK_exists */
|
||||
|
||||
|
||||
static int QPAK_isDirectory(DirHandle *h, const char *name, int *fileExists)
|
||||
{
|
||||
QPAKinfo *info = (QPAKinfo *) h->opaque;
|
||||
int isDir;
|
||||
QPAKentry *entry = qpak_find_entry(info, name, &isDir);
|
||||
|
||||
*fileExists = ((isDir) || (entry != NULL));
|
||||
if (isDir)
|
||||
return(1); /* definitely a dir. */
|
||||
|
||||
BAIL_MACRO(ERR_NO_SUCH_FILE, 0);
|
||||
} /* QPAK_isDirectory */
|
||||
|
||||
|
||||
static int QPAK_isSymLink(DirHandle *h, const char *name, int *fileExists)
|
||||
{
|
||||
*fileExists = QPAK_exists(h, name);
|
||||
return(0); /* never symlinks in a quake pak. */
|
||||
} /* QPAK_isSymLink */
|
||||
|
||||
|
||||
static PHYSFS_sint64 QPAK_getLastModTime(DirHandle *h,
|
||||
const char *name,
|
||||
int *fileExists)
|
||||
{
|
||||
int isDir;
|
||||
QPAKinfo *info = ((QPAKinfo *) h->opaque);
|
||||
PHYSFS_sint64 retval = -1;
|
||||
QPAKentry *entry = qpak_find_entry(info, name, &isDir);
|
||||
|
||||
*fileExists = ((isDir) || (entry != NULL));
|
||||
if (*fileExists) /* use time of QPAK itself in the physical filesystem. */
|
||||
retval = info->last_mod_time;
|
||||
|
||||
return(retval);
|
||||
} /* QPAK_getLastModTime */
|
||||
|
||||
|
||||
static FileHandle *QPAK_openRead(DirHandle *h, const char *fnm, int *fileExists)
|
||||
{
|
||||
QPAKinfo *info = ((QPAKinfo *) h->opaque);
|
||||
FileHandle *retval;
|
||||
QPAKfileinfo *finfo;
|
||||
QPAKentry *entry;
|
||||
int isDir;
|
||||
|
||||
entry = qpak_find_entry(info, fnm, &isDir);
|
||||
*fileExists = ((entry != NULL) || (isDir));
|
||||
BAIL_IF_MACRO(isDir, ERR_NOT_A_FILE, NULL);
|
||||
BAIL_IF_MACRO(entry == NULL, ERR_NO_SUCH_FILE, NULL);
|
||||
|
||||
retval = (FileHandle *) malloc(sizeof (FileHandle));
|
||||
BAIL_IF_MACRO(retval == NULL, ERR_OUT_OF_MEMORY, NULL);
|
||||
finfo = (QPAKfileinfo *) malloc(sizeof (QPAKfileinfo));
|
||||
if (finfo == NULL)
|
||||
{
|
||||
free(retval);
|
||||
BAIL_MACRO(ERR_OUT_OF_MEMORY, NULL);
|
||||
} /* if */
|
||||
|
||||
finfo->handle = __PHYSFS_platformOpenRead(info->filename);
|
||||
if ( (finfo->handle == NULL) ||
|
||||
(!__PHYSFS_platformSeek(finfo->handle, entry->startPos)) )
|
||||
{
|
||||
free(finfo);
|
||||
free(retval);
|
||||
return(NULL);
|
||||
} /* if */
|
||||
|
||||
finfo->curPos = 0;
|
||||
finfo->entry = entry;
|
||||
retval->opaque = (void *) finfo;
|
||||
retval->funcs = &__PHYSFS_FileFunctions_QPAK;
|
||||
retval->dirHandle = h;
|
||||
return(retval);
|
||||
} /* QPAK_openRead */
|
||||
|
||||
|
||||
static FileHandle *QPAK_openWrite(DirHandle *h, const char *name)
|
||||
{
|
||||
BAIL_MACRO(ERR_NOT_SUPPORTED, NULL);
|
||||
} /* QPAK_openWrite */
|
||||
|
||||
|
||||
static FileHandle *QPAK_openAppend(DirHandle *h, const char *name)
|
||||
{
|
||||
BAIL_MACRO(ERR_NOT_SUPPORTED, NULL);
|
||||
} /* QPAK_openAppend */
|
||||
|
||||
|
||||
static int QPAK_remove(DirHandle *h, const char *name)
|
||||
{
|
||||
BAIL_MACRO(ERR_NOT_SUPPORTED, 0);
|
||||
} /* QPAK_remove */
|
||||
|
||||
|
||||
static int QPAK_mkdir(DirHandle *h, const char *name)
|
||||
{
|
||||
BAIL_MACRO(ERR_NOT_SUPPORTED, 0);
|
||||
} /* QPAK_mkdir */
|
||||
|
||||
#endif /* defined PHYSFS_SUPPORTS_QPAK */
|
||||
|
||||
/* end of qpak.c ... */
|
||||
|
597
archivers/wad.c
597
archivers/wad.c
|
@ -1,597 +0,0 @@
|
|||
/*
|
||||
* WAD support routines for PhysicsFS.
|
||||
*
|
||||
* This driver handles DOOM engine archives ("wads").
|
||||
* This format (but not this driver) was designed by id Software for use
|
||||
* with the DOOM engine.
|
||||
* The specs of the format are from the unofficial doom specs v1.666
|
||||
* found here: http://www.gamers.org/dhs/helpdocs/dmsp1666.html
|
||||
* The format of the archive: (from the specs)
|
||||
*
|
||||
* A WAD file has three parts:
|
||||
* (1) a twelve-byte header
|
||||
* (2) one or more "lumps"
|
||||
* (3) a directory or "info table" that contains the names, offsets, and
|
||||
* sizes of all the lumps in the WAD
|
||||
*
|
||||
* The header consists of three four-byte parts:
|
||||
* (a) an ASCII string which must be either "IWAD" or "PWAD"
|
||||
* (b) a 4-byte (long) integer which is the number of lumps in the wad
|
||||
* (c) a long integer which is the file offset to the start of
|
||||
* the directory
|
||||
*
|
||||
* The directory has one 16-byte entry for every lump. Each entry consists
|
||||
* of three parts:
|
||||
*
|
||||
* (a) a long integer, the file offset to the start of the lump
|
||||
* (b) a long integer, the size of the lump in bytes
|
||||
* (c) an 8-byte ASCII string, the name of the lump, padded with zeros.
|
||||
* For example, the "DEMO1" entry in hexadecimal would be
|
||||
* (44 45 4D 4F 31 00 00 00)
|
||||
*
|
||||
* Note that there is no way to tell if an opened WAD archive is a
|
||||
* IWAD or PWAD with this archiver.
|
||||
* I couldn't think of a way to provide that information, without being too
|
||||
* hacky.
|
||||
* I don't think it's really that important though.
|
||||
*
|
||||
*
|
||||
* Please see the file LICENSE in the source's root directory.
|
||||
*
|
||||
* This file written by Travis Wells, based on the GRP archiver by
|
||||
* Ryan C. Gordon.
|
||||
*/
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#if (defined PHYSFS_SUPPORTS_WAD)
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "physfs.h"
|
||||
|
||||
#define __PHYSICSFS_INTERNAL__
|
||||
#include "physfs_internal.h"
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char name[18];
|
||||
PHYSFS_uint32 startPos;
|
||||
PHYSFS_uint32 size;
|
||||
} WADentry;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char *filename;
|
||||
PHYSFS_sint64 last_mod_time;
|
||||
PHYSFS_uint32 entryCount;
|
||||
PHYSFS_uint32 entryOffset;
|
||||
WADentry *entries;
|
||||
} WADinfo;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
void *handle;
|
||||
WADentry *entry;
|
||||
PHYSFS_uint32 curPos;
|
||||
} WADfileinfo;
|
||||
|
||||
|
||||
static void WAD_dirClose(DirHandle *h);
|
||||
static PHYSFS_sint64 WAD_read(FileHandle *handle, void *buffer,
|
||||
PHYSFS_uint32 objSize, PHYSFS_uint32 objCount);
|
||||
static PHYSFS_sint64 WAD_write(FileHandle *handle, const void *buffer,
|
||||
PHYSFS_uint32 objSize, PHYSFS_uint32 objCount);
|
||||
static int WAD_eof(FileHandle *handle);
|
||||
static PHYSFS_sint64 WAD_tell(FileHandle *handle);
|
||||
static int WAD_seek(FileHandle *handle, PHYSFS_uint64 offset);
|
||||
static PHYSFS_sint64 WAD_fileLength(FileHandle *handle);
|
||||
static int WAD_fileClose(FileHandle *handle);
|
||||
static int WAD_isArchive(const char *filename, int forWriting);
|
||||
static DirHandle *WAD_openArchive(const char *name, int forWriting);
|
||||
static LinkedStringList *WAD_enumerateFiles(DirHandle *h,
|
||||
const char *dirname,
|
||||
int omitSymLinks);
|
||||
static int WAD_exists(DirHandle *h, const char *name);
|
||||
static int WAD_isDirectory(DirHandle *h, const char *name, int *fileExists);
|
||||
static int WAD_isSymLink(DirHandle *h, const char *name, int *fileExists);
|
||||
static PHYSFS_sint64 WAD_getLastModTime(DirHandle *h, const char *n, int *e);
|
||||
static FileHandle *WAD_openRead(DirHandle *h, const char *name, int *exist);
|
||||
static FileHandle *WAD_openWrite(DirHandle *h, const char *name);
|
||||
static FileHandle *WAD_openAppend(DirHandle *h, const char *name);
|
||||
static int WAD_remove(DirHandle *h, const char *name);
|
||||
static int WAD_mkdir(DirHandle *h, const char *name);
|
||||
|
||||
const PHYSFS_ArchiveInfo __PHYSFS_ArchiveInfo_WAD =
|
||||
{
|
||||
"WAD",
|
||||
/* !!! FIXME WAD_ARCHIVE_DESCRIPTION, */ "DOOM engine format",
|
||||
"Travis Wells <traviswells@mchsi.com>",
|
||||
"http://www.3dmm2.com/doom/",
|
||||
};
|
||||
|
||||
|
||||
static const FileFunctions __PHYSFS_FileFunctions_WAD =
|
||||
{
|
||||
WAD_read, /* read() method */
|
||||
WAD_write, /* write() method */
|
||||
WAD_eof, /* eof() method */
|
||||
WAD_tell, /* tell() method */
|
||||
WAD_seek, /* seek() method */
|
||||
WAD_fileLength, /* fileLength() method */
|
||||
WAD_fileClose /* fileClose() method */
|
||||
};
|
||||
|
||||
|
||||
const DirFunctions __PHYSFS_DirFunctions_WAD =
|
||||
{
|
||||
&__PHYSFS_ArchiveInfo_WAD,
|
||||
WAD_isArchive, /* isArchive() method */
|
||||
WAD_openArchive, /* openArchive() method */
|
||||
WAD_enumerateFiles, /* enumerateFiles() method */
|
||||
WAD_exists, /* exists() method */
|
||||
WAD_isDirectory, /* isDirectory() method */
|
||||
WAD_isSymLink, /* isSymLink() method */
|
||||
WAD_getLastModTime, /* getLastModTime() method */
|
||||
WAD_openRead, /* openRead() method */
|
||||
WAD_openWrite, /* openWrite() method */
|
||||
WAD_openAppend, /* openAppend() method */
|
||||
WAD_remove, /* remove() method */
|
||||
WAD_mkdir, /* mkdir() method */
|
||||
WAD_dirClose /* dirClose() method */
|
||||
};
|
||||
|
||||
|
||||
|
||||
static void WAD_dirClose(DirHandle *h)
|
||||
{
|
||||
WADinfo *info = ((WADinfo *) h->opaque);
|
||||
free(info->filename);
|
||||
free(info->entries);
|
||||
free(info);
|
||||
free(h);
|
||||
} /* WAD_dirClose */
|
||||
|
||||
|
||||
static PHYSFS_sint64 WAD_read(FileHandle *handle, void *buffer,
|
||||
PHYSFS_uint32 objSize, PHYSFS_uint32 objCount)
|
||||
{
|
||||
WADfileinfo *finfo = (WADfileinfo *) (handle->opaque);
|
||||
WADentry *entry = finfo->entry;
|
||||
PHYSFS_uint32 bytesLeft = entry->size - finfo->curPos;
|
||||
PHYSFS_uint32 objsLeft = (bytesLeft / objSize);
|
||||
PHYSFS_sint64 rc;
|
||||
|
||||
if (objsLeft < objCount)
|
||||
objCount = objsLeft;
|
||||
|
||||
rc = __PHYSFS_platformRead(finfo->handle, buffer, objSize, objCount);
|
||||
if (rc > 0)
|
||||
finfo->curPos += (PHYSFS_uint32) (rc * objSize);
|
||||
|
||||
return(rc);
|
||||
} /* WAD_read */
|
||||
|
||||
|
||||
static PHYSFS_sint64 WAD_write(FileHandle *handle, const void *buffer,
|
||||
PHYSFS_uint32 objSize, PHYSFS_uint32 objCount)
|
||||
{
|
||||
BAIL_MACRO(ERR_NOT_SUPPORTED, -1);
|
||||
} /* WAD_write */
|
||||
|
||||
|
||||
static int WAD_eof(FileHandle *handle)
|
||||
{
|
||||
WADfileinfo *finfo = (WADfileinfo *) (handle->opaque);
|
||||
WADentry *entry = finfo->entry;
|
||||
return(finfo->curPos >= entry->size);
|
||||
} /* WAD_eof */
|
||||
|
||||
|
||||
static PHYSFS_sint64 WAD_tell(FileHandle *handle)
|
||||
{
|
||||
return(((WADfileinfo *) (handle->opaque))->curPos);
|
||||
} /* WAD_tell */
|
||||
|
||||
|
||||
static int WAD_seek(FileHandle *handle, PHYSFS_uint64 offset)
|
||||
{
|
||||
WADfileinfo *finfo = (WADfileinfo *) (handle->opaque);
|
||||
WADentry *entry = finfo->entry;
|
||||
int rc;
|
||||
|
||||
BAIL_IF_MACRO(offset < 0, ERR_INVALID_ARGUMENT, 0);
|
||||
BAIL_IF_MACRO(offset >= entry->size, ERR_PAST_EOF, 0);
|
||||
rc = __PHYSFS_platformSeek(finfo->handle, entry->startPos + offset);
|
||||
if (rc)
|
||||
finfo->curPos = (PHYSFS_uint32) offset;
|
||||
|
||||
return(rc);
|
||||
} /* WAD_seek */
|
||||
|
||||
|
||||
static PHYSFS_sint64 WAD_fileLength(FileHandle *handle)
|
||||
{
|
||||
WADfileinfo *finfo = ((WADfileinfo *) handle->opaque);
|
||||
return((PHYSFS_sint64) finfo->entry->size);
|
||||
} /* WAD_fileLength */
|
||||
|
||||
|
||||
static int WAD_fileClose(FileHandle *handle)
|
||||
{
|
||||
WADfileinfo *finfo = ((WADfileinfo *) handle->opaque);
|
||||
BAIL_IF_MACRO(!__PHYSFS_platformClose(finfo->handle), NULL, 0);
|
||||
free(finfo);
|
||||
free(handle);
|
||||
return(1);
|
||||
} /* WAD_fileClose */
|
||||
|
||||
|
||||
static int wad_open(const char *filename, int forWriting,
|
||||
void **fh, PHYSFS_uint32 *count,PHYSFS_uint32 *offset)
|
||||
{
|
||||
PHYSFS_uint8 buf[4];
|
||||
|
||||
*fh = NULL;
|
||||
BAIL_IF_MACRO(forWriting, ERR_ARC_IS_READ_ONLY, 0);
|
||||
|
||||
*fh = __PHYSFS_platformOpenRead(filename);
|
||||
BAIL_IF_MACRO(*fh == NULL, NULL, 0);
|
||||
|
||||
if (__PHYSFS_platformRead(*fh, buf, 4, 1) != 1)
|
||||
goto openWad_failed;
|
||||
|
||||
if (memcmp(buf, "IWAD", 4) != 0 && memcmp(buf, "PWAD", 4) != 0)
|
||||
{
|
||||
__PHYSFS_setError(ERR_UNSUPPORTED_ARCHIVE);
|
||||
goto openWad_failed;
|
||||
} /* if */
|
||||
|
||||
if (__PHYSFS_platformRead(*fh, count, sizeof (PHYSFS_uint32), 1) != 1)
|
||||
goto openWad_failed;
|
||||
|
||||
*count = PHYSFS_swapULE32(*count);
|
||||
|
||||
if (__PHYSFS_platformRead(*fh, offset, sizeof (PHYSFS_uint32), 1) != 1)
|
||||
goto openWad_failed;
|
||||
|
||||
*offset = PHYSFS_swapULE32(*offset);
|
||||
|
||||
return(1);
|
||||
|
||||
openWad_failed:
|
||||
if (*fh != NULL)
|
||||
__PHYSFS_platformClose(*fh);
|
||||
|
||||
*count = -1;
|
||||
*fh = NULL;
|
||||
return(0);
|
||||
} /* wad_open */
|
||||
|
||||
|
||||
static int WAD_isArchive(const char *filename, int forWriting)
|
||||
{
|
||||
void *fh;
|
||||
PHYSFS_uint32 fileCount,offset;
|
||||
int retval = wad_open(filename, forWriting, &fh, &fileCount,&offset);
|
||||
|
||||
if (fh != NULL)
|
||||
__PHYSFS_platformClose(fh);
|
||||
|
||||
return(retval);
|
||||
} /* WAD_isArchive */
|
||||
|
||||
|
||||
static int wad_entry_cmp(void *_a, PHYSFS_uint32 one, PHYSFS_uint32 two)
|
||||
{
|
||||
WADentry *a = (WADentry *) _a;
|
||||
return(strcmp(a[one].name, a[two].name));
|
||||
} /* wad_entry_cmp */
|
||||
|
||||
|
||||
static void wad_entry_swap(void *_a, PHYSFS_uint32 one, PHYSFS_uint32 two)
|
||||
{
|
||||
WADentry tmp;
|
||||
WADentry *first = &(((WADentry *) _a)[one]);
|
||||
WADentry *second = &(((WADentry *) _a)[two]);
|
||||
memcpy(&tmp, first, sizeof (WADentry));
|
||||
memcpy(first, second, sizeof (WADentry));
|
||||
memcpy(second, &tmp, sizeof (WADentry));
|
||||
} /* wad_entry_swap */
|
||||
|
||||
|
||||
static int wad_load_entries(const char *name, int forWriting, WADinfo *info)
|
||||
{
|
||||
void *fh = NULL;
|
||||
PHYSFS_uint32 fileCount;
|
||||
PHYSFS_uint32 directoryOffset;
|
||||
WADentry *entry;
|
||||
char lastDirectory[9];
|
||||
|
||||
lastDirectory[8] = 0; /* Make sure lastDirectory stays null-terminated. */
|
||||
|
||||
BAIL_IF_MACRO(!wad_open(name, forWriting, &fh, &fileCount,&directoryOffset), NULL, 0);
|
||||
info->entryCount = fileCount;
|
||||
info->entries = (WADentry *) malloc(sizeof (WADentry) * fileCount);
|
||||
if (info->entries == NULL)
|
||||
{
|
||||
__PHYSFS_platformClose(fh);
|
||||
BAIL_MACRO(ERR_OUT_OF_MEMORY, 0);
|
||||
} /* if */
|
||||
|
||||
__PHYSFS_platformSeek(fh,directoryOffset);
|
||||
|
||||
for (entry = info->entries; fileCount > 0; fileCount--, entry++)
|
||||
{
|
||||
if (__PHYSFS_platformRead(fh, &entry->startPos, 4, 1) != 1)
|
||||
{
|
||||
__PHYSFS_platformClose(fh);
|
||||
return(0);
|
||||
} /* if */
|
||||
|
||||
if (__PHYSFS_platformRead(fh, &entry->size, 4, 1) != 1)
|
||||
{
|
||||
__PHYSFS_platformClose(fh);
|
||||
return(0);
|
||||
} /* if */
|
||||
|
||||
if (__PHYSFS_platformRead(fh, &entry->name, 8, 1) != 1)
|
||||
{
|
||||
__PHYSFS_platformClose(fh);
|
||||
return(0);
|
||||
} /* if */
|
||||
|
||||
entry->name[8] = '\0'; /* name might not be null-terminated in file. */
|
||||
entry->size = PHYSFS_swapULE32(entry->size);
|
||||
entry->startPos = PHYSFS_swapULE32(entry->startPos);
|
||||
} /* for */
|
||||
|
||||
__PHYSFS_platformClose(fh);
|
||||
|
||||
__PHYSFS_sort(info->entries, info->entryCount,
|
||||
wad_entry_cmp, wad_entry_swap);
|
||||
return(1);
|
||||
} /* wad_load_entries */
|
||||
|
||||
|
||||
static DirHandle *WAD_openArchive(const char *name, int forWriting)
|
||||
{
|
||||
WADinfo *info;
|
||||
DirHandle *retval = malloc(sizeof (DirHandle));
|
||||
PHYSFS_sint64 modtime = __PHYSFS_platformGetLastModTime(name);
|
||||
|
||||
BAIL_IF_MACRO(retval == NULL, ERR_OUT_OF_MEMORY, NULL);
|
||||
info = retval->opaque = malloc(sizeof (WADinfo));
|
||||
if (info == NULL)
|
||||
{
|
||||
__PHYSFS_setError(ERR_OUT_OF_MEMORY);
|
||||
goto WAD_openArchive_failed;
|
||||
} /* if */
|
||||
|
||||
memset(info, '\0', sizeof (WADinfo));
|
||||
|
||||
info->filename = (char *) malloc(strlen(name) + 1);
|
||||
if (info->filename == NULL)
|
||||
{
|
||||
__PHYSFS_setError(ERR_OUT_OF_MEMORY);
|
||||
goto WAD_openArchive_failed;
|
||||
} /* if */
|
||||
|
||||
if (!wad_load_entries(name, forWriting, info))
|
||||
goto WAD_openArchive_failed;
|
||||
|
||||
strcpy(info->filename, name);
|
||||
info->last_mod_time = modtime;
|
||||
retval->funcs = &__PHYSFS_DirFunctions_WAD;
|
||||
return(retval);
|
||||
|
||||
WAD_openArchive_failed:
|
||||
if (retval != NULL)
|
||||
{
|
||||
if (retval->opaque != NULL)
|
||||
{
|
||||
if (info->filename != NULL)
|
||||
free(info->filename);
|
||||
if (info->entries != NULL)
|
||||
free(info->entries);
|
||||
free(info);
|
||||
} /* if */
|
||||
free(retval);
|
||||
} /* if */
|
||||
|
||||
return(NULL);
|
||||
} /* WAD_openArchive */
|
||||
|
||||
|
||||
static LinkedStringList *WAD_enumerateFiles(DirHandle *h,
|
||||
const char *dirname,
|
||||
int omitSymLinks)
|
||||
{
|
||||
WADinfo *info = ((WADinfo *) h->opaque);
|
||||
WADentry *entry = info->entries;
|
||||
LinkedStringList *retval = NULL, *p = NULL;
|
||||
PHYSFS_uint32 max = info->entryCount;
|
||||
PHYSFS_uint32 i;
|
||||
char *sep;
|
||||
|
||||
if (dirname[0] == 0)
|
||||
{
|
||||
for (i = 0; i < max; i++, entry++)
|
||||
{
|
||||
if (strchr(entry->name, '/') == NULL)
|
||||
{
|
||||
retval = __PHYSFS_addToLinkedStringList(retval, &p,
|
||||
entry->name, -1);
|
||||
} /* if */
|
||||
} /* for */
|
||||
} /* if */
|
||||
else
|
||||
{
|
||||
for (i = 0; i < max; i++, entry++)
|
||||
{
|
||||
sep = strchr(entry->name, '/');
|
||||
if (sep != NULL)
|
||||
{
|
||||
if (strncmp(dirname, entry->name, (sep-entry->name)) == 0)
|
||||
{
|
||||
retval = __PHYSFS_addToLinkedStringList(retval, &p,
|
||||
sep + 1, -1);
|
||||
} /* if */
|
||||
} /* if */
|
||||
} /* for */
|
||||
} /* else */
|
||||
|
||||
return(retval);
|
||||
} /* WAD_enumerateFiles */
|
||||
|
||||
|
||||
static WADentry *wad_find_entry(WADinfo *info, const char *name)
|
||||
{
|
||||
WADentry *a = info->entries;
|
||||
PHYSFS_sint32 lo = 0;
|
||||
PHYSFS_sint32 hi = (PHYSFS_sint32) (info->entryCount - 1);
|
||||
PHYSFS_sint32 middle;
|
||||
int rc;
|
||||
|
||||
while (lo <= hi)
|
||||
{
|
||||
middle = lo + ((hi - lo) / 2);
|
||||
rc = strcmp(name, a[middle].name);
|
||||
if (rc == 0) /* found it! */
|
||||
return(&a[middle]);
|
||||
else if (rc > 0)
|
||||
lo = middle + 1;
|
||||
else
|
||||
hi = middle - 1;
|
||||
} /* while */
|
||||
|
||||
BAIL_MACRO(ERR_NO_SUCH_FILE, NULL);
|
||||
} /* wad_find_entry */
|
||||
|
||||
|
||||
static int WAD_exists(DirHandle *h, const char *name)
|
||||
{
|
||||
return(wad_find_entry(((WADinfo *) h->opaque), name) != NULL);
|
||||
} /* WAD_exists */
|
||||
|
||||
|
||||
static int WAD_isDirectory(DirHandle *h, const char *name, int *fileExists)
|
||||
{
|
||||
WADentry *entry = wad_find_entry(((WADinfo *) h->opaque), name);
|
||||
if (entry != NULL)
|
||||
{
|
||||
char *n;
|
||||
|
||||
*fileExists = 1;
|
||||
|
||||
/* Can't be a directory if it's a subdirectory. */
|
||||
if (strchr(entry->name, '/') != NULL)
|
||||
return(0);
|
||||
|
||||
/* Check if it matches "MAP??" or "E?M?" ... */
|
||||
n = entry->name;
|
||||
if ((n[0] == 'E' && n[2] == 'M') ||
|
||||
(n[0] == 'M' && n[1] == 'A' && n[2] == 'P' && n[6] == 0))
|
||||
{
|
||||
return(1);
|
||||
} /* if */
|
||||
return(0);
|
||||
} /* if */
|
||||
else
|
||||
{
|
||||
*fileExists = 0;
|
||||
return(0);
|
||||
} /* else */
|
||||
} /* WAD_isDirectory */
|
||||
|
||||
|
||||
static int WAD_isSymLink(DirHandle *h, const char *name, int *fileExists)
|
||||
{
|
||||
*fileExists = WAD_exists(h, name);
|
||||
return(0); /* never symlinks in a wad. */
|
||||
} /* WAD_isSymLink */
|
||||
|
||||
|
||||
static PHYSFS_sint64 WAD_getLastModTime(DirHandle *h,
|
||||
const char *name,
|
||||
int *fileExists)
|
||||
{
|
||||
WADinfo *info = ((WADinfo *) h->opaque);
|
||||
PHYSFS_sint64 retval = -1;
|
||||
|
||||
*fileExists = (wad_find_entry(info, name) != NULL);
|
||||
if (*fileExists) /* use time of WAD itself in the physical filesystem. */
|
||||
retval = ((WADinfo *) h->opaque)->last_mod_time;
|
||||
|
||||
return(retval);
|
||||
} /* WAD_getLastModTime */
|
||||
|
||||
|
||||
static FileHandle *WAD_openRead(DirHandle *h, const char *fnm, int *fileExists)
|
||||
{
|
||||
WADinfo *info = ((WADinfo *) h->opaque);
|
||||
FileHandle *retval;
|
||||
WADfileinfo *finfo;
|
||||
WADentry *entry;
|
||||
|
||||
entry = wad_find_entry(info, fnm);
|
||||
*fileExists = (entry != NULL);
|
||||
BAIL_IF_MACRO(entry == NULL, NULL, NULL);
|
||||
|
||||
retval = (FileHandle *) malloc(sizeof (FileHandle));
|
||||
BAIL_IF_MACRO(retval == NULL, ERR_OUT_OF_MEMORY, NULL);
|
||||
finfo = (WADfileinfo *) malloc(sizeof (WADfileinfo));
|
||||
if (finfo == NULL)
|
||||
{
|
||||
free(retval);
|
||||
BAIL_MACRO(ERR_OUT_OF_MEMORY, NULL);
|
||||
} /* if */
|
||||
|
||||
finfo->handle = __PHYSFS_platformOpenRead(info->filename);
|
||||
if ( (finfo->handle == NULL) ||
|
||||
(!__PHYSFS_platformSeek(finfo->handle, entry->startPos)) )
|
||||
{
|
||||
free(finfo);
|
||||
free(retval);
|
||||
return(NULL);
|
||||
} /* if */
|
||||
|
||||
finfo->curPos = 0;
|
||||
finfo->entry = entry;
|
||||
retval->opaque = (void *) finfo;
|
||||
retval->funcs = &__PHYSFS_FileFunctions_WAD;
|
||||
retval->dirHandle = h;
|
||||
return(retval);
|
||||
} /* WAD_openRead */
|
||||
|
||||
|
||||
static FileHandle *WAD_openWrite(DirHandle *h, const char *name)
|
||||
{
|
||||
BAIL_MACRO(ERR_NOT_SUPPORTED, NULL);
|
||||
} /* WAD_openWrite */
|
||||
|
||||
|
||||
static FileHandle *WAD_openAppend(DirHandle *h, const char *name)
|
||||
{
|
||||
BAIL_MACRO(ERR_NOT_SUPPORTED, NULL);
|
||||
} /* WAD_openAppend */
|
||||
|
||||
|
||||
static int WAD_remove(DirHandle *h, const char *name)
|
||||
{
|
||||
BAIL_MACRO(ERR_NOT_SUPPORTED, 0);
|
||||
} /* WAD_remove */
|
||||
|
||||
|
||||
static int WAD_mkdir(DirHandle *h, const char *name)
|
||||
{
|
||||
BAIL_MACRO(ERR_NOT_SUPPORTED, 0);
|
||||
} /* WAD_mkdir */
|
||||
|
||||
#endif /* defined PHYSFS_SUPPORTS_WAD */
|
||||
|
||||
/* end of wad.c ... */
|
||||
|
1463
archivers/zip.c
1463
archivers/zip.c
File diff suppressed because it is too large
Load Diff
14
bootstrap
14
bootstrap
|
@ -1,14 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
echo "Initial preparation...this can take awhile, so sit tight..."
|
||||
rm -f Makefile.am
|
||||
perl -w -e 'use File::Copy; exit 0 if (-f "Makefile.am"); my $x = `automake --version |head -n 1`; chomp($x); $x = 0.0 if ($x !~ s/\A.*?(\d+\.\d+).*\Z/$1/); if ($x < 1.5) { copy("./Makefile.am.oldautomake", "./Makefile.am"); } else { copy("./Makefile.am.newautomake", "./Makefile.am"); }'
|
||||
aclocal
|
||||
libtoolize --automake --copy --force
|
||||
autoheader
|
||||
automake --foreign --add-missing --copy
|
||||
autoconf
|
||||
|
||||
echo "You are now ready to run ./configure ..."
|
||||
|
518
configure.in
518
configure.in
|
@ -1,518 +0,0 @@
|
|||
# Process this file with autoconf to produce a configure script.
|
||||
AC_INIT(physfs.c)
|
||||
|
||||
dnl ---------------------------------------------------------------------
|
||||
dnl System/version info
|
||||
dnl ---------------------------------------------------------------------
|
||||
|
||||
# Making releases:
|
||||
# MICRO_VERSION += 1;
|
||||
# INTERFACE_AGE += 1;
|
||||
# BINARY_AGE += 1;
|
||||
# if any functions have been added, set INTERFACE_AGE to 0.
|
||||
# if backwards compatibility has been broken,
|
||||
# set BINARY_AGE and INTERFACE_AGE to 0.
|
||||
|
||||
MAJOR_VERSION=1
|
||||
MINOR_VERSION=0
|
||||
MICRO_VERSION=0
|
||||
INTERFACE_AGE=0
|
||||
BINARY_AGE=0
|
||||
VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION
|
||||
|
||||
AC_SUBST(MAJOR_VERSION)
|
||||
AC_SUBST(MINOR_VERSION)
|
||||
AC_SUBST(MICRO_VERSION)
|
||||
AC_SUBST(INTERFACE_AGE)
|
||||
AC_SUBST(BINARY_AGE)
|
||||
AC_SUBST(VERSION)
|
||||
|
||||
# libtool versioning
|
||||
LT_RELEASE=$MAJOR_VERSION.$MINOR_VERSION
|
||||
LT_CURRENT=`expr $MICRO_VERSION - $INTERFACE_AGE`
|
||||
LT_REVISION=$INTERFACE_AGE
|
||||
LT_AGE=`expr $BINARY_AGE - $INTERFACE_AGE`
|
||||
|
||||
AC_SUBST(LT_RELEASE)
|
||||
AC_SUBST(LT_CURRENT)
|
||||
AC_SUBST(LT_REVISION)
|
||||
AC_SUBST(LT_AGE)
|
||||
|
||||
dnl Detect the canonical host and target build environment
|
||||
AC_CANONICAL_SYSTEM
|
||||
|
||||
dnl Setup for automake
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
AM_INIT_AUTOMAKE(physfs, $VERSION)
|
||||
|
||||
|
||||
dnl ---------------------------------------------------------------------
|
||||
dnl Compilers and other tools
|
||||
dnl ---------------------------------------------------------------------
|
||||
|
||||
AC_PROG_CC
|
||||
AC_PROG_CXX
|
||||
AC_PROG_INSTALL
|
||||
AC_PROG_LN_S
|
||||
AC_LIBTOOL_WIN32_DLL
|
||||
LIBTOOL="libtool"
|
||||
AM_PROG_LIBTOOL
|
||||
AC_CHECK_PROG(we_have_sed, sed, yes, no)
|
||||
|
||||
dnl ---------------------------------------------------------------------
|
||||
dnl Debug mode?
|
||||
dnl ---------------------------------------------------------------------
|
||||
|
||||
AC_ARG_ENABLE(debug,
|
||||
[ --enable-debug enable debug mode [default=no]],
|
||||
, enable_debug=no)
|
||||
if test x$enable_debug = xyes; then
|
||||
if test x$ac_cv_prog_cc_g = xyes; then
|
||||
PHYSFSCFLAGS="-g -O0"
|
||||
else
|
||||
PHYSFSCFLAGS="-O0"
|
||||
fi
|
||||
PHYSFSCFLAGS="$PHYSFSCFLAGS -Werror -Wall"
|
||||
AC_DEFINE([DEBUG], 1, [define if debug build is enabled])
|
||||
AC_DEFINE([DEBUG_CHATTER], 1, [define if debug chatter is enabled])
|
||||
else
|
||||
PHYSFSCFLAGS="-O2"
|
||||
AC_DEFINE([NDEBUG], 1, [define if debug build is disabled])
|
||||
fi
|
||||
|
||||
|
||||
dnl ---------------------------------------------------------------------
|
||||
dnl Profile sorts, etc?
|
||||
dnl ---------------------------------------------------------------------
|
||||
|
||||
AC_ARG_ENABLE(profiling,
|
||||
[ --enable-profiling do algorithm profiling [default=no]],
|
||||
, enable_profiling=no)
|
||||
if test x$enable_profiling = xyes; then
|
||||
AC_DEFINE([PHYSFS_PROFILING], 1, [define to profile sorting, etc algorithms])
|
||||
fi
|
||||
|
||||
|
||||
dnl ---------------------------------------------------------------------
|
||||
dnl Build test program?
|
||||
dnl ---------------------------------------------------------------------
|
||||
|
||||
AC_ARG_ENABLE(testprog,
|
||||
[ --enable-testprog build test program [default=yes]],
|
||||
, enable_testprog=yes)
|
||||
|
||||
dnl ---------------------------------------------------------------------
|
||||
dnl Checks for libraries.
|
||||
dnl ---------------------------------------------------------------------
|
||||
|
||||
require_zlib="no"
|
||||
|
||||
dnl Check for zip archiver inclusion...
|
||||
AC_ARG_ENABLE(zip,
|
||||
[ --enable-zip enable ZIP support [default=yes]],
|
||||
, enable_zip=yes)
|
||||
if test x$enable_zip = xyes; then
|
||||
AC_DEFINE([PHYSFS_SUPPORTS_ZIP], 1, [define if zip support is enabled])
|
||||
require_zlib="yes"
|
||||
fi
|
||||
|
||||
|
||||
dnl Check for grp archiver inclusion...
|
||||
AC_ARG_ENABLE(grp,
|
||||
[ --enable-grp enable Build Engine GRP support [default=yes]],
|
||||
, enable_grp=yes)
|
||||
if test x$enable_grp = xyes; then
|
||||
AC_DEFINE([PHYSFS_SUPPORTS_GRP], 1, [define if grp support is enabled])
|
||||
fi
|
||||
|
||||
dnl Check for wad archiver inclusion...
|
||||
AC_ARG_ENABLE(wad,
|
||||
[ --enable-wad enable Doom WAD support [default=yes]],
|
||||
, enable_wad=yes)
|
||||
if test x$enable_wad = xyes; then
|
||||
AC_DEFINE([PHYSFS_SUPPORTS_WAD], 1, [define if wad support is enabled])
|
||||
fi
|
||||
|
||||
dnl Check for hog archiver inclusion...
|
||||
AC_ARG_ENABLE(hog,
|
||||
[ --enable-hog enable Descent I/II HOG support [default=yes]],
|
||||
, enable_hog=yes)
|
||||
if test x$enable_hog = xyes; then
|
||||
AC_DEFINE([PHYSFS_SUPPORTS_HOG], 1, [define if hog support is enabled])
|
||||
fi
|
||||
|
||||
|
||||
dnl Check for mvl archiver inclusion...
|
||||
AC_ARG_ENABLE(mvl,
|
||||
[ --enable-mvl enable Descent II MVL support [default=yes]],
|
||||
, enable_mvl=yes)
|
||||
if test x$enable_mvl = xyes; then
|
||||
AC_DEFINE([PHYSFS_SUPPORTS_MVL], 1, [define if mvl support is enabled])
|
||||
fi
|
||||
|
||||
|
||||
dnl Check for qpak archiver inclusion...
|
||||
AC_ARG_ENABLE(qpak,
|
||||
[ --enable-qpak enable Quake PAK support [default=yes]],
|
||||
, enable_qpak=yes)
|
||||
if test x$enable_qpak = xyes; then
|
||||
AC_DEFINE([PHYSFS_SUPPORTS_QPAK], 1, [define if qpak support is enabled])
|
||||
fi
|
||||
|
||||
dnl Check if we should statically link the included zlib...
|
||||
AC_ARG_ENABLE(internal-zlib,
|
||||
[ --enable-internal-zlib use included zlib [default=only if needed]],
|
||||
, enable_internal_zlib=maybe)
|
||||
|
||||
dnl Check for zlib if needed.
|
||||
have_external_zlib="no"
|
||||
if test x$enable_internal_zlib != xyes; then
|
||||
if test x$require_zlib = xyes; then
|
||||
AC_CHECK_HEADER(zlib.h, have_zlib_hdr=yes)
|
||||
AC_CHECK_LIB(z, zlibVersion, have_zlib_lib=yes)
|
||||
if test x$have_zlib_hdr = xyes -a x$have_zlib_lib = xyes; then
|
||||
have_external_zlib="yes"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING([what zlib to use])
|
||||
|
||||
dnl no zlib is needed at all if we aren't supporting ZIP files.
|
||||
if test x$require_zlib = xno; then
|
||||
enable_internal_zlib="no"
|
||||
enable_external_zlib="no"
|
||||
AC_MSG_RESULT([no zlib needed])
|
||||
else
|
||||
|
||||
if test x$enable_internal_zlib = xmaybe; then
|
||||
if test x$have_external_zlib = xyes; then
|
||||
enable_internal_zlib="no"
|
||||
enable_external_zlib="yes"
|
||||
else
|
||||
enable_internal_zlib="yes"
|
||||
enable_external_zlib="no"
|
||||
fi
|
||||
else
|
||||
if test x$enable_internal_zlib = xno -a x$have_external_zlib = xyes; then
|
||||
enable_internal_zlib="no"
|
||||
enable_external_zlib="yes"
|
||||
fi
|
||||
fi
|
||||
|
||||
if test x$enable_internal_zlib = xyes; then
|
||||
AC_MSG_RESULT([internal zlib])
|
||||
PHYSFSCFLAGS="$PHYSFSCFLAGS -DZ_PREFIX"
|
||||
else
|
||||
if test x$enable_external_zlib = xyes; then
|
||||
AC_MSG_RESULT([external zlib])
|
||||
LIBS="$LIBS -lz"
|
||||
else
|
||||
AC_MSG_ERROR([Need zlib, but you disabled our copy and have no system lib])
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
dnl determine if we should include readline support...
|
||||
AC_ARG_ENABLE(readline,
|
||||
[ --enable-readline use GNU readline in test program [default=yes]],
|
||||
, enable_readline=yes)
|
||||
|
||||
if test x$enable_readline = xyes; then
|
||||
AC_CHECK_HEADER(readline/readline.h, have_readline_hdr=yes)
|
||||
AC_CHECK_LIB(readline, readline, have_readline_lib=yes, , -lcurses)
|
||||
AC_CHECK_HEADER(readline/history.h, have_history_hdr=yes)
|
||||
AC_CHECK_LIB(readline, add_history, have_history_lib=yes, , -lcurses)
|
||||
if test x$have_readline_hdr = xyes -a x$have_readline_lib = xyes; then
|
||||
if test x$have_history_hdr = xyes -a x$have_history_lib = xyes; then
|
||||
AC_DEFINE([PHYSFS_HAVE_READLINE], 1, [define if we have readline])
|
||||
have_readline="yes"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl !!! FIXME: Not sure how to detect this...
|
||||
dnl check for 64-bit llseek()...
|
||||
dnl AC_CHECK_LIB(c, llseek, have_llseek=yes)
|
||||
if test x$have_llseek = xyes; then
|
||||
AC_DEFINE([PHYSFS_HAVE_LLSEEK], 1, [define if we have llseek])
|
||||
fi
|
||||
|
||||
|
||||
dnl determine if we should use the stubbed pthread code.
|
||||
AC_ARG_ENABLE(pthreads,
|
||||
[ --enable-pthreads include POSIX threads support [default=yes]],
|
||||
, enable_pthreads=yes)
|
||||
if test x$enable_pthreads = xyes; then
|
||||
AC_CHECK_HEADER(pthread.h, have_pthread_hdr=yes)
|
||||
if test x$have_pthread_hdr != xyes; then
|
||||
enable_pthreads=no
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl determine if we should use the stubbed CD-ROM detection code.
|
||||
AC_ARG_ENABLE(cdrom,
|
||||
[ --enable-cdrom include CD-ROM support [default=yes]],
|
||||
, enable_cdrom=yes)
|
||||
|
||||
if test x$enable_cdrom = xyes; then
|
||||
dnl reset this and let header detection reenable...
|
||||
enable_cdrom=no
|
||||
|
||||
dnl BSD systems use sys/ucred.h for getting mounted volumes.
|
||||
dnl Linux and others use mntent.h.
|
||||
AC_CHECK_HEADER(sys/ucred.h, have_ucred_hdr=yes)
|
||||
if test x$have_ucred_hdr = xyes; then
|
||||
AC_DEFINE([PHYSFS_HAVE_SYS_UCRED_H], 1, [define if we have sys/ucred.h])
|
||||
enable_cdrom=yes
|
||||
fi
|
||||
|
||||
AC_CHECK_HEADER(mntent.h, have_mntent_hdr=yes)
|
||||
if test x$have_mntent_hdr = xyes; then
|
||||
AC_DEFINE([PHYSFS_HAVE_MNTENT_H], 1, [define if we have mntent.h])
|
||||
enable_cdrom=yes
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl determine language.
|
||||
AC_ARG_ENABLE(language,
|
||||
[ --enable-language=lang Select natural language. [default=english]],
|
||||
physfslang=`echo $enable_language |tr A-Z a-z`, physfslang=english)
|
||||
|
||||
AC_MSG_CHECKING([if language choice is supported])
|
||||
physfs_valid_lang=no
|
||||
|
||||
if test x$physfslang = xenglish; then
|
||||
physfs_valid_lang=yes
|
||||
AC_DEFINE([PHYSFS_LANG], PHYSFS_LANG_ENGLISH, [define desired natural language])
|
||||
fi
|
||||
|
||||
if test x$physfslang = xgerman; then
|
||||
physfs_valid_lang=yes
|
||||
AC_DEFINE([PHYSFS_LANG], PHYSFS_LANG_GERMAN, [define desired natural language])
|
||||
fi
|
||||
|
||||
if test x$physfslang = xfrench; then
|
||||
physfs_valid_lang=yes
|
||||
AC_DEFINE([PHYSFS_LANG], PHYSFS_LANG_FRENCH, [define desired natural language])
|
||||
fi
|
||||
|
||||
if test x$physfslang = xrussian-koi8-r; then
|
||||
physfs_valid_lang=yes
|
||||
AC_DEFINE([PHYSFS_LANG], PHYSFS_LANG_RUSSIAN_KOI8_R, [define desired natural language])
|
||||
fi
|
||||
|
||||
if test x$physfslang = xrussian-cp1251; then
|
||||
physfs_valid_lang=yes
|
||||
AC_DEFINE([PHYSFS_LANG], PHYSFS_LANG_RUSSIAN_CP866, [define desired natural language])
|
||||
fi
|
||||
|
||||
if test x$physfslang = xrussian-cp866; then
|
||||
physfs_valid_lang=yes
|
||||
AC_DEFINE([PHYSFS_LANG], PHYSFS_LANG_RUSSIAN_CP866, [define desired natural language])
|
||||
fi
|
||||
|
||||
if test x$physfslang = xrussian-iso-8859-5; then
|
||||
physfs_valid_lang=yes
|
||||
AC_DEFINE([PHYSFS_LANG], PHYSFS_LANG_RUSSIAN_ISO_8859_5, [define desired natural language])
|
||||
fi
|
||||
|
||||
dnl Add other language checks here...
|
||||
|
||||
|
||||
AC_MSG_RESULT([$physfs_valid_lang])
|
||||
if test x$physfs_valid_lang = xno; then
|
||||
AC_MSG_WARN([***])
|
||||
AC_MSG_WARN([*** You've asked for "$physfslang" language support...])
|
||||
AC_MSG_WARN([*** ...but we don't support that.])
|
||||
AC_MSG_WARN([*** You could choose another language,])
|
||||
AC_MSG_WARN([*** but is this what you REALLY wanted?])
|
||||
AC_MSG_WARN([*** Please see the LANG section of physfs_internal.h])
|
||||
AC_MSG_WARN([*** for info on writing a translation.])
|
||||
AC_MSG_WARN([***])
|
||||
AC_MSG_WARN([*** Currently known languages:])
|
||||
AC_MSG_WARN([*** --enable-language=english])
|
||||
AC_MSG_WARN([*** --enable-language=german])
|
||||
AC_MSG_WARN([*** --enable-language=french])
|
||||
AC_MSG_WARN([*** --enable-language=russian-koi8-r])
|
||||
AC_MSG_WARN([*** --enable-language=russian-cp1251])
|
||||
AC_MSG_WARN([*** --enable-language=russian-cp866])
|
||||
AC_MSG_WARN([*** --enable-language=russian-iso-8859-5])
|
||||
AC_MSG_WARN([***])
|
||||
AC_MSG_ERROR([*** unsupported language. stop.])
|
||||
fi
|
||||
|
||||
have_non_posix_threads=no
|
||||
|
||||
AC_MSG_CHECKING([if this is BeOS])
|
||||
if test x$target_os = xbeos; then
|
||||
this_is_beos=yes
|
||||
have_non_posix_threads=yes
|
||||
enable_cdrom=yes
|
||||
enable_pthreads=no
|
||||
LIBS="$LIBS -lroot -lbe"
|
||||
else
|
||||
this_is_beos=no
|
||||
fi
|
||||
|
||||
AC_MSG_RESULT([$this_is_beos])
|
||||
|
||||
AC_MSG_CHECKING([if this is Cygwin])
|
||||
if test x$target_os = xcygwin; then
|
||||
this_is_cygwin=yes
|
||||
PHYSFSCFLAGS="$PHYSFSCFLAGS -DWIN32"
|
||||
enable_cdrom=yes
|
||||
enable_pthreads=no
|
||||
have_non_posix_threads=yes
|
||||
else
|
||||
this_is_cygwin=no
|
||||
fi
|
||||
|
||||
AC_MSG_RESULT([$this_is_cygwin])
|
||||
|
||||
this_is_macosx=no
|
||||
if test x$we_have_sed = xyes; then
|
||||
AC_MSG_CHECKING([if this is MacOS X])
|
||||
x=`echo $target_os |sed "s/darwin.*/darwin/"`
|
||||
if test x$x = xdarwin -a x$target_vendor = xapple; then
|
||||
this_is_macosx=yes
|
||||
PHYSFSLDFLAGS="$PHYSFSLDFLAGS -Wl,-framework -Wl,Carbon -Wl,-framework -Wl,IOKit"
|
||||
fi
|
||||
|
||||
AC_MSG_RESULT([$this_is_macosx])
|
||||
fi
|
||||
|
||||
this_is_freebsd=no
|
||||
if test x$we_have_sed = xyes; then
|
||||
AC_MSG_CHECKING([if this is FreeBSD])
|
||||
x=`echo $target_os |tr A-Z a-z |sed "s/.*freebsd.*/freebsd/"`
|
||||
if test x$x = xfreebsd; then
|
||||
this_is_freebsd=yes
|
||||
PHYSFSLDFLAGS="$PHYSFSLDFLAGS -pthread"
|
||||
fi
|
||||
|
||||
AC_MSG_RESULT([$this_is_freebsd])
|
||||
fi
|
||||
|
||||
this_is_openbsd=no
|
||||
if test x$we_have_sed = xyes; then
|
||||
AC_MSG_CHECKING([if this is OpenBSD])
|
||||
x=`echo $target_os |tr A-Z a-z |sed "s/.*openbsd.*/openbsd/"`
|
||||
if test x$x = xopenbsd; then
|
||||
this_is_openbsd=yes
|
||||
PHYSFSLDFLAGS="$PHYSFSLDFLAGS -pthread"
|
||||
fi
|
||||
|
||||
AC_MSG_RESULT([$this_is_openbsd])
|
||||
fi
|
||||
|
||||
this_is_atheos=no
|
||||
if test x$we_have_sed = xyes; then
|
||||
AC_MSG_CHECKING([if this is AtheOS])
|
||||
x=`echo $target_os |tr A-Z a-z |sed "s/.*atheos.*/atheos/"`
|
||||
if test x$x = xatheos; then
|
||||
this_is_atheos=yes
|
||||
enable_cdrom=no
|
||||
enable_pthreads=no
|
||||
fi
|
||||
|
||||
AC_MSG_RESULT([$this_is_atheos])
|
||||
fi
|
||||
|
||||
this_is_os2=no
|
||||
if test x$we_have_sed = xyes; then
|
||||
AC_MSG_CHECKING([if this is OS/2])
|
||||
x=`echo $target_os |tr A-Z a-z |sed "s/.*os2.*/os2/"`
|
||||
if test x$x = xos2; then
|
||||
this_is_os2=yes
|
||||
have_non_posix_threads=yes
|
||||
enable_cdrom=yes
|
||||
enable_pthreads=no
|
||||
PHYSFSCFLAGS="$PHYSFSCFLAGS -DOS2"
|
||||
fi
|
||||
|
||||
AC_MSG_RESULT([$this_is_os2])
|
||||
fi
|
||||
|
||||
this_is_mint=no
|
||||
if test x$we_have_sed = xyes; then
|
||||
AC_MSG_CHECKING([if this is MiNT])
|
||||
x=`echo $target_os |tr A-Z a-z |sed "s/.*mint.*/mint/"`
|
||||
if test x$x = xmint; then
|
||||
this_is_mint=yes
|
||||
enable_cdrom=no
|
||||
enable_pthreads=no
|
||||
fi
|
||||
|
||||
AC_MSG_RESULT([$this_is_mint])
|
||||
fi
|
||||
|
||||
|
||||
dnl Some platform might disable this, so check this down here...
|
||||
if test x$enable_cdrom != xyes; then
|
||||
AC_DEFINE([PHYSFS_NO_CDROM_SUPPORT], 1, [define if we have no CD support])
|
||||
AC_MSG_WARN([***])
|
||||
AC_MSG_WARN([*** There is no CD-ROM support in this build!])
|
||||
AC_MSG_WARN([*** PhysicsFS will just pretend there are no discs.])
|
||||
AC_MSG_WARN([*** This may be fine, depending on how PhysicsFS is used,])
|
||||
AC_MSG_WARN([*** but is this what you REALLY wanted?])
|
||||
AC_MSG_WARN([*** (Maybe fix configure.in, or write a platform driver?)])
|
||||
AC_MSG_WARN([***])
|
||||
fi
|
||||
|
||||
if test x$enable_pthreads != xyes; then
|
||||
AC_DEFINE([PHYSFS_NO_PTHREADS_SUPPORT], 1, [define if we have no POSIX threads support])
|
||||
if test x$have_non_posix_threads != xyes; then
|
||||
AC_MSG_WARN([***])
|
||||
AC_MSG_WARN([*** There is no thread support in this build!])
|
||||
AC_MSG_WARN([*** PhysicsFS will NOT be reentrant!])
|
||||
AC_MSG_WARN([*** This may be fine, depending on how PhysicsFS is used,])
|
||||
AC_MSG_WARN([*** but is this what you REALLY wanted?])
|
||||
AC_MSG_WARN([*** (Maybe fix configure.in, or write a platform driver?)])
|
||||
AC_MSG_WARN([***])
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
# Checks for header files.
|
||||
AC_HEADER_STDC
|
||||
AC_CHECK_HEADERS([stdlib.h string.h assert.h])
|
||||
|
||||
# Checks for typedefs, structures, and compiler characteristics.
|
||||
dnl AC_C_CONST
|
||||
dnl AC_TYPE_SIZE_T
|
||||
|
||||
# Checks for library functions.
|
||||
|
||||
# This is only in the bleeding edge autoconf distro...
|
||||
#AC_FUNC_MALLOC
|
||||
|
||||
AC_FUNC_MEMCMP
|
||||
AC_CHECK_FUNCS([memset strrchr])
|
||||
|
||||
AC_CHECK_SIZEOF(int, 4)
|
||||
|
||||
CFLAGS="$CFLAGS $PHYSFSCFLAGS -D_REENTRANT -D_THREAD_SAFE"
|
||||
LDFLAGS="$LDFLAGS $PHYSFSLDFLAGS -no-undefined"
|
||||
|
||||
dnl Add Makefile conditionals
|
||||
AM_CONDITIONAL(BUILD_ZLIB, test x$enable_internal_zlib = xyes)
|
||||
AM_CONDITIONAL(BUILD_TEST_PHYSFS, test x$enable_testprog = xyes)
|
||||
AM_CONDITIONAL(BUILD_MACOSX, test x$this_is_macosx = xyes)
|
||||
AM_CONDITIONAL(BUILD_BEOS, test x$this_is_beos = xyes)
|
||||
AM_CONDITIONAL(BUILD_CYGWIN, test x$this_is_cygwin = xyes)
|
||||
AM_CONDITIONAL(BUILD_READLINE, test x$have_readline = xyes)
|
||||
|
||||
AC_OUTPUT([
|
||||
Makefile
|
||||
archivers/Makefile
|
||||
platform/Makefile
|
||||
zlib121/Makefile
|
||||
test/Makefile
|
||||
extras/Makefile
|
||||
physfs.spec
|
||||
])
|
||||
|
||||
dnl end of configure.in ...
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
libphysfs0 (0.1.7-cvs20020729) unstable; urgency=low
|
||||
|
||||
* Updated control files merged with CVS tree.
|
||||
|
||||
-- Colin Bayer <cbayer@localhost> Mon, 29 Jul 2002 23:03:58 -0700
|
||||
|
||||
libphysfs0 (0.1.7-2) unstable; urgency=low
|
||||
|
||||
* Fixed manpage install locations.
|
||||
|
||||
-- Colin Bayer <cbayer@localhost> Mon, 29 Jul 2002 22:24:02 -0700
|
||||
|
||||
libphysfs0 (0.1.7-1) unstable; urgency=low
|
||||
|
||||
* Initial Release.
|
||||
|
||||
-- Colin Bayer <vogon@icculus.org> Mon, 29 Jul 2002 07:47:31 -0700
|
|
@ -1,22 +0,0 @@
|
|||
Source: libphysfs0
|
||||
Priority: optional
|
||||
Maintainer: Colin Bayer <vogon@icculus.org>
|
||||
Build-Depends: debhelper (>> 3.0.0), binutils (>= 2.12.90.0.1-4 ), fileutils (>= 4.1-10 ), gcc-2.95 (>= 1 ), libc6 (>= 2.2.5-10 ), libncurses5 (>= 5.2.20020112a-8 ), zlib1g (>= 1 ), libncurses5-dev (>= 5.2.20020112a-8 ), zlib1g-dev (>= 1 ), doxygen, autoconf2.13 (>= 2.13-44 ), autoconf (>= 2.53-4 ), automake (>= 1)
|
||||
Standards-Version: 3.5.2
|
||||
|
||||
Package: libphysfs0-dev
|
||||
Section: devel
|
||||
Architecture: any
|
||||
Depends: libphysfs0 (= ${Source-Version})
|
||||
Description: A filesystem abstraction for game programmers.
|
||||
libphysfs0-dev is the set of header files needed to compile programs that
|
||||
utilize the libphysfs0 library.
|
||||
|
||||
Package: libphysfs0
|
||||
Section: libs
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends}
|
||||
Description: A filesystem abstraction for game programmers.
|
||||
libphysfs0 is the PhysicsFS filesystem abstraction library, a library that
|
||||
provides a simple C interface to aid game programmers in utilizing game
|
||||
assets packaged in many different types of archive files.
|
|
@ -1,33 +0,0 @@
|
|||
This package was debianized by Colin Bayer <vogon@icculus.org> on
|
||||
Mon, 29 Jul 2002 04:41:27 -0700.
|
||||
|
||||
It was downloaded from http://icculus.org/physfs/downloads/physfs-0.1.7.tar.gz
|
||||
|
||||
Upstream Author(s): Ryan Gordon <icculus@icculus.org>
|
||||
|
||||
This software is copyright (c) 2001-02 by Ryan Gordon, icculus.org.
|
||||
|
||||
This library is distributed under the terms of the zlib license:
|
||||
|
||||
Copyright (c) 2003 Ryan C. Gordon and others.
|
||||
|
||||
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.
|
||||
|
||||
Ryan C. Gordon <icculus@clutteredmind.org>
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
TODO
|
||||
CREDITS
|
|
@ -1,2 +0,0 @@
|
|||
libphysfs0-dev_0.1.7-cvs20020729_i386.deb devel optional
|
||||
libphysfs0_0.1.7-cvs20020729_i386.deb libs optional
|
|
@ -1,6 +0,0 @@
|
|||
usr/lib
|
||||
usr/include
|
||||
usr/share/man/man3
|
||||
usr/share/doc/libphysfs0-dev
|
||||
usr/share/doc/libphysfs0-dev/latex
|
||||
usr/share/doc/libphysfs0-dev/html
|
|
@ -1,9 +0,0 @@
|
|||
Document: libphysfs0-api
|
||||
Title: PhysicsFS API Documentation
|
||||
Author: Ryan Gordon <icculus@icculus.org>
|
||||
Abstract: This document outlines the C API for libphysfs0.
|
||||
Section: unknown
|
||||
|
||||
Format: HTML
|
||||
Index: /usr/share/doc/libphysfs0-dev/html/index.html
|
||||
Files: /usr/share/doc/libphysfs0-dev/html/*.html
|
|
@ -1,5 +0,0 @@
|
|||
usr/include/*
|
||||
usr/lib/lib*.a
|
||||
usr/lib/lib*.so
|
||||
usr/share/doc/libphysfs0-dev/*
|
||||
usr/share/man/man3/*
|
|
@ -1,5 +0,0 @@
|
|||
# Automatically added by dh_installdocs
|
||||
if [ "$1" = configure ] && which install-docs >/dev/null 2>&1; then
|
||||
install-docs -i /usr/share/doc-base/libphysfs0-api
|
||||
fi
|
||||
# End automatically added section
|
|
@ -1,6 +0,0 @@
|
|||
# Automatically added by dh_installdocs
|
||||
if [ "$1" = remove ] || [ "$1" = upgrade ] && \
|
||||
which install-docs >/dev/null 2>&1; then
|
||||
install-docs -r libphysfs0-api
|
||||
fi
|
||||
# End automatically added section
|
|
@ -1 +0,0 @@
|
|||
usr/lib
|
|
@ -1 +0,0 @@
|
|||
usr/lib/lib*.so.*
|
|
@ -1,5 +0,0 @@
|
|||
# Automatically added by dh_makeshlibs
|
||||
if [ "$1" = "configure" ]; then
|
||||
ldconfig
|
||||
fi
|
||||
# End automatically added section
|
|
@ -1,5 +0,0 @@
|
|||
# Automatically added by dh_makeshlibs
|
||||
if [ "$1" = "remove" ]; then
|
||||
ldconfig
|
||||
fi
|
||||
# End automatically added section
|
|
@ -1 +0,0 @@
|
|||
shlibs:Depends=libc6 (>= 2.2.4-4), zlib1g (>= 1:1.1.4)
|
|
@ -1,47 +0,0 @@
|
|||
#! /bin/sh
|
||||
# postinst script for libphysfs0
|
||||
#
|
||||
# see: dh_installdeb(1)
|
||||
|
||||
set -e
|
||||
|
||||
# summary of how this script can be called:
|
||||
# * <postinst> `configure' <most-recently-configured-version>
|
||||
# * <old-postinst> `abort-upgrade' <new version>
|
||||
# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
|
||||
# <new-version>
|
||||
# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
|
||||
# <failed-install-package> <version> `removing'
|
||||
# <conflicting-package> <version>
|
||||
# for details, see http://www.debian.org/doc/debian-policy/ or
|
||||
# the debian-policy package
|
||||
#
|
||||
# quoting from the policy:
|
||||
# Any necessary prompting should almost always be confined to the
|
||||
# post-installation script, and should be protected with a conditional
|
||||
# so that unnecessary prompting doesn't happen if a package's
|
||||
# installation fails and the `postinst' is called with `abort-upgrade',
|
||||
# `abort-remove' or `abort-deconfigure'.
|
||||
|
||||
case "$1" in
|
||||
configure)
|
||||
;;
|
||||
|
||||
abort-upgrade|abort-remove|abort-deconfigure)
|
||||
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "postinst called with unknown argument \`$1'" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
# dh_installdeb will replace this with shell code automatically
|
||||
# generated by other debhelper scripts.
|
||||
|
||||
#DEBHELPER#
|
||||
|
||||
exit 0
|
||||
|
||||
|
|
@ -1,38 +0,0 @@
|
|||
#! /bin/sh
|
||||
# postrm script for libphysfs0
|
||||
#
|
||||
# see: dh_installdeb(1)
|
||||
|
||||
set -e
|
||||
|
||||
# summary of how this script can be called:
|
||||
# * <postrm> `remove'
|
||||
# * <postrm> `purge'
|
||||
# * <old-postrm> `upgrade' <new-version>
|
||||
# * <new-postrm> `failed-upgrade' <old-version>
|
||||
# * <new-postrm> `abort-install'
|
||||
# * <new-postrm> `abort-install' <old-version>
|
||||
# * <new-postrm> `abort-upgrade' <old-version>
|
||||
# * <disappearer's-postrm> `disappear' <r>overwrit>r> <new-version>
|
||||
# for details, see http://www.debian.org/doc/debian-policy/ or
|
||||
# the debian-policy package
|
||||
|
||||
|
||||
case "$1" in
|
||||
purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
|
||||
|
||||
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "postrm called with unknown argument \`$1'" >&2
|
||||
exit 1
|
||||
|
||||
esac
|
||||
|
||||
# dh_installdeb will replace this with shell code automatically
|
||||
# generated by other debhelper scripts.
|
||||
|
||||
#DEBHELPER#
|
||||
|
||||
exit 0
|
|
@ -1,44 +0,0 @@
|
|||
#! /bin/sh
|
||||
# preinst script for libphysfs0
|
||||
#
|
||||
# see: dh_installdeb(1)
|
||||
|
||||
set -e
|
||||
|
||||
# summary of how this script can be called:
|
||||
# * <new-preinst> `install'
|
||||
# * <new-preinst> `install' <old-version>
|
||||
# * <new-preinst> `upgrade' <old-version>
|
||||
# * <old-preinst> `abort-upgrade' <new-version>
|
||||
#
|
||||
# for details, see http://www.debian.org/doc/debian-policy/ or
|
||||
# the debian-policy package
|
||||
|
||||
|
||||
case "$1" in
|
||||
install|upgrade)
|
||||
# if [ "$1" = "upgrade" ]
|
||||
# then
|
||||
# start-stop-daemon --stop --quiet --oknodo \
|
||||
# --pidfile /var/run/libphysfs0.pid \
|
||||
# --exec /usr/sbin/libphysfs0 2>/dev/null || true
|
||||
# fi
|
||||
;;
|
||||
|
||||
abort-upgrade)
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "preinst called with unknown argument \`$1'" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
# dh_installdeb will replace this with shell code automatically
|
||||
# generated by other debhelper scripts.
|
||||
|
||||
#DEBHELPER#
|
||||
|
||||
exit 0
|
||||
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
#! /bin/sh
|
||||
# prerm script for libphysfs0
|
||||
#
|
||||
# see: dh_installdeb(1)
|
||||
|
||||
set -e
|
||||
|
||||
# summary of how this script can be called:
|
||||
# * <prerm> `remove'
|
||||
# * <old-prerm> `upgrade' <new-version>
|
||||
# * <new-prerm> `failed-upgrade' <old-version>
|
||||
# * <conflictor's-prerm> `remove' `in-favour' <package> <new-version>
|
||||
# * <deconfigured's-prerm> `deconfigure' `in-favour'
|
||||
# <package-being-installed> <version> `removing'
|
||||
# <conflicting-package> <version>
|
||||
# for details, see http://www.debian.org/doc/debian-policy/ or
|
||||
# the debian-policy package
|
||||
|
||||
|
||||
case "$1" in
|
||||
remove|upgrade|deconfigure)
|
||||
# install-info --quiet --remove /usr/info/libphysfs0.info.gz
|
||||
;;
|
||||
failed-upgrade)
|
||||
;;
|
||||
*)
|
||||
echo "prerm called with unknown argument \`$1'" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
# dh_installdeb will replace this with shell code automatically
|
||||
# generated by other debhelper scripts.
|
||||
|
||||
#DEBHELPER#
|
||||
|
||||
exit 0
|
||||
|
||||
|
|
@ -1,118 +0,0 @@
|
|||
#!/usr/bin/make -f
|
||||
# Sample debian/rules that uses debhelper.
|
||||
# GNU copyright 1997 to 1999 by Joey Hess.
|
||||
|
||||
# Uncomment this to turn on verbose mode.
|
||||
#export DH_VERBOSE=1
|
||||
|
||||
# This is the debhelper compatibility version to use.
|
||||
export DH_COMPAT=3
|
||||
|
||||
# These are used for cross-compiling and for saving the configure script
|
||||
# from having to guess our platform (since we know it already)
|
||||
DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
|
||||
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
|
||||
|
||||
|
||||
ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
|
||||
CFLAGS += -g
|
||||
endif
|
||||
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
|
||||
INSTALL_PROGRAM += -s
|
||||
endif
|
||||
|
||||
# shared library versions, option 1
|
||||
version=0.1.9
|
||||
major=0
|
||||
# option 2, assuming the library is created as src/.libs/libfoo.so.2.0.5 or so
|
||||
#version=`ls src/.libs/lib*.so.* | \
|
||||
# awk '{if (match($$0,/[0-9]+\.[0-9]+\.[0-9]+$$/)) print substr($$0,RSTART)}'`
|
||||
#major=`ls src/.libs/lib*.so.* | \
|
||||
# awk '{if (match($$0,/\.so\.[0-9]+$$/)) print substr($$0,RSTART+4)}'`
|
||||
|
||||
config.status: configure
|
||||
dh_testdir
|
||||
# Add here commands to configure the package.
|
||||
./bootstrap
|
||||
CFLAGS="$(CFLAGS)" ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info
|
||||
|
||||
|
||||
build: build-stamp
|
||||
build-stamp: config.status
|
||||
dh_testdir
|
||||
|
||||
# Add here commands to compile the package.
|
||||
$(MAKE)
|
||||
doxygen
|
||||
|
||||
touch build-stamp
|
||||
|
||||
clean:
|
||||
dh_testdir
|
||||
dh_testroot
|
||||
rm -f build-stamp
|
||||
|
||||
# Add here commands to clean up after the build process.
|
||||
-$(MAKE) distclean
|
||||
-test -r /usr/share/misc/config.sub && \
|
||||
cp -f /usr/share/misc/config.sub config.sub
|
||||
-test -r /usr/share/misc/config.guess && \
|
||||
cp -f /usr/share/misc/config.guess config.guess
|
||||
|
||||
|
||||
dh_clean
|
||||
|
||||
install: build
|
||||
dh_testdir
|
||||
dh_testroot
|
||||
dh_clean -k
|
||||
dh_installdirs
|
||||
|
||||
# Add here commands to install the package into debian/tmp
|
||||
$(MAKE) install prefix=$(CURDIR)/debian/tmp/usr
|
||||
install -d $(CURDIR)/debian/tmp/usr/share/doc/libphysfs0-dev/latex
|
||||
install -d $(CURDIR)/debian/tmp/usr/share/doc/libphysfs0-dev/html
|
||||
install -d $(CURDIR)/debian/tmp/usr/share/man/man3
|
||||
# install -D docs/README $(CURDIR)/debian/tmp/usr/share/doc/libphysfs0-dev/README
|
||||
install -D docs/latex/* $(CURDIR)/debian/tmp/usr/share/doc/libphysfs0-dev/latex
|
||||
install -D docs/html/* $(CURDIR)/debian/tmp/usr/share/doc/libphysfs0-dev/html
|
||||
install -D docs/man/man3/* $(CURDIR)/debian/tmp/usr/share/man/man3
|
||||
|
||||
# Build architecture-independent files here.
|
||||
binary-indep: build install
|
||||
# We have nothing to do by default.
|
||||
|
||||
# Build architecture-dependent files here.
|
||||
binary-arch: build install
|
||||
dh_testdir
|
||||
dh_testroot
|
||||
dh_movefiles
|
||||
|
||||
# dh_installdebconf
|
||||
dh_installdocs
|
||||
dh_installexamples
|
||||
dh_installmenu
|
||||
# dh_installlogrotate
|
||||
# dh_installemacsen
|
||||
# dh_installpam
|
||||
# dh_installmime
|
||||
# dh_installinit
|
||||
dh_installcron
|
||||
dh_installman
|
||||
dh_installinfo
|
||||
# dh_undocumented
|
||||
dh_installchangelogs CHANGELOG
|
||||
dh_link
|
||||
dh_strip
|
||||
dh_compress
|
||||
dh_fixperms
|
||||
dh_makeshlibs
|
||||
dh_installdeb
|
||||
# dh_perl
|
||||
dh_shlibdeps
|
||||
dh_gencontrol
|
||||
dh_md5sums
|
||||
dh_builddeb
|
||||
|
||||
binary: binary-indep binary-arch
|
||||
.PHONY: build clean binary-indep binary-arch binary install
|
|
@ -1 +0,0 @@
|
|||
libPACKAGE# 0.1.7 libphysfs0 (>> 0.1.7-0), libphysfs0 (<< 0.1.7-99)
|
|
@ -0,0 +1,11 @@
|
|||
|
||||
The changelog is no longer maintained by hand. It made sense to have a single
|
||||
timeline when we were using CVS, but modern revision control tools make this
|
||||
redundant, at best.
|
||||
|
||||
If you want a list of changes, updated in real time, just point your web
|
||||
browser here:
|
||||
|
||||
https://github.com/icculus/physfs/commits/
|
||||
|
||||
|
|
@ -0,0 +1,174 @@
|
|||
Maintainer and general codemonkey:
|
||||
Ryan C. Gordon
|
||||
|
||||
Tons of win32 help:
|
||||
Adam Gates
|
||||
|
||||
More win32 hacking:
|
||||
Gregory S. Read
|
||||
|
||||
Fixes for missing current working directories,
|
||||
PHYSFS_setSaneConfig() improvements,
|
||||
other bugfixes:
|
||||
David Hedbor
|
||||
|
||||
Darwin support:
|
||||
Patrick Stein
|
||||
|
||||
configure fixes,
|
||||
RPM specfile:
|
||||
Edward Rudd
|
||||
|
||||
GetLastModTime API,
|
||||
other stuff:
|
||||
John R. Hall
|
||||
|
||||
Various support, fixes and suggestions:
|
||||
Alexander Pipelka
|
||||
|
||||
Russian translation,
|
||||
QPAK archiver:
|
||||
Ed Sinjiashvili
|
||||
|
||||
French translation:
|
||||
Stéphane Peter
|
||||
|
||||
Debian package support:
|
||||
Colin Bayer
|
||||
|
||||
"abs-file.h" in "extras" dir:
|
||||
Adam D. Moss
|
||||
|
||||
WinCE port and other Win32 patches:
|
||||
Corona688
|
||||
|
||||
German translation:
|
||||
Michael Renner
|
||||
|
||||
Apple Project Builder support,
|
||||
Mac OS X improvements:
|
||||
Eric Wing
|
||||
|
||||
iPhone support:
|
||||
Christian Gmeiner
|
||||
|
||||
WinRT support:
|
||||
Martin Ahrnbom
|
||||
|
||||
HOG archiver,
|
||||
MVL archiver:
|
||||
Bradley Bell
|
||||
|
||||
MIX archiver:
|
||||
Sebastian Steinhauer
|
||||
|
||||
Bug fixes:
|
||||
Tolga Dalman
|
||||
|
||||
Initial PHYSFS_mount() work:
|
||||
Philip D. Bober
|
||||
|
||||
Brazillian Portuguese translation:
|
||||
Danny Angelo Carminati Grein
|
||||
|
||||
Spanish translation:
|
||||
Pedro J. Pérez
|
||||
|
||||
MacOS Classic fixes,
|
||||
MPW support,
|
||||
bug fixes:
|
||||
Chris Taylor
|
||||
|
||||
Mingw support,
|
||||
General bug fixes:
|
||||
Matze Braun
|
||||
|
||||
Haiku support:
|
||||
scott mc
|
||||
|
||||
Bug fixes:
|
||||
Jörg Walter
|
||||
|
||||
Bug fixes:
|
||||
Olivier Boudeville
|
||||
|
||||
Bug fixes:
|
||||
Henk Boom
|
||||
|
||||
Build system fixes:
|
||||
Marc Kleine-Budde
|
||||
|
||||
Windows .rc file,
|
||||
7zip/lzma archiver:
|
||||
Dennis Schridde
|
||||
|
||||
OS/2 updates:
|
||||
Dave Yeo
|
||||
|
||||
Bug fixes:
|
||||
Patrice Mandin
|
||||
|
||||
PHYSFS_stat() API:
|
||||
Christoph Nelles
|
||||
Indy Sams
|
||||
|
||||
ISO9660 archiver:
|
||||
Christoph Nelles
|
||||
|
||||
Bug fixes:
|
||||
Steven Fuller
|
||||
|
||||
Bug fixes:
|
||||
Tolga Dalman
|
||||
|
||||
Bug fixes:
|
||||
Frank Becker
|
||||
|
||||
Bug fixes:
|
||||
Norfanin
|
||||
|
||||
Bug fixes:
|
||||
Evgeny Podjachev
|
||||
|
||||
Haiku fixes:
|
||||
Chris Roberts
|
||||
|
||||
SLB archiver:
|
||||
Aleksi Nurmi
|
||||
|
||||
Bug fixes:
|
||||
Dmitry Marakasov
|
||||
|
||||
Bug fixes:
|
||||
Andreas Karlsson
|
||||
|
||||
Bug fixes:
|
||||
Michael Bacon
|
||||
|
||||
Bug fixes:
|
||||
Xian Nox
|
||||
|
||||
Bug fixes:
|
||||
Reto Schneider
|
||||
|
||||
pkg-config support:
|
||||
Jonas Kulla
|
||||
|
||||
Bug fixes,
|
||||
VDF archiver:
|
||||
Francesco Bertolaccini
|
||||
|
||||
CMake fixes:
|
||||
Tobias Markus
|
||||
|
||||
Bug fixes,
|
||||
Rémi Verschelde
|
||||
|
||||
Bug fixes:
|
||||
Rob Loach
|
||||
|
||||
Other stuff:
|
||||
Your name here! Patches go to icculus@icculus.org ...
|
||||
|
||||
/* end of CREDITS.txt ... */
|
||||
|
|
@ -23,7 +23,8 @@ PROJECT_NAME = physfs
|
|||
# This could be handy for archiving the generated documentation or
|
||||
# if some version control system is used.
|
||||
|
||||
PROJECT_NUMBER = 1.0.0
|
||||
# (CMake will set this properly at build time. --ryan.)
|
||||
PROJECT_NUMBER = "unknown version (build with 'make docs' next time!)"
|
||||
|
||||
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
|
||||
# base path where the generated documentation will be put.
|
||||
|
@ -361,7 +362,7 @@ WARN_LOGFILE =
|
|||
# directories like "/usr/src/myproject". Separate the files or directories
|
||||
# with spaces.
|
||||
|
||||
INPUT = physfs.h
|
||||
INPUT = src/physfs.h
|
||||
|
||||
# If the value of the INPUT tag contains directories, you can use the
|
||||
# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
|
||||
|
@ -876,7 +877,8 @@ INCLUDE_FILE_PATTERNS =
|
|||
# omitted =1 is assumed.
|
||||
|
||||
PREDEFINED = DOXYGEN_SHOULD_IGNORE_THIS=1 \
|
||||
__EXPORT__=
|
||||
PHYSFS_DECL= \
|
||||
PHYSFS_DEPRECATED=
|
||||
|
||||
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
|
||||
# this tag can be used to specify a list of macro names that should be expanded.
|
|
@ -0,0 +1,173 @@
|
|||
|
||||
The latest PhysicsFS information and releases can be found at:
|
||||
https://icculus.org/physfs/
|
||||
|
||||
Building is (ahem) very easy.
|
||||
|
||||
|
||||
ALL PLATFORMS:
|
||||
|
||||
Please read the text file LICENSE.txt in the root of the source tree.
|
||||
The license is extremely liberal, even to closed-source, commercial
|
||||
applications.
|
||||
|
||||
If you've got Doxygen (http://www.doxygen.org/) installed, you can run it
|
||||
without any command line arguments in the root of the source tree to generate
|
||||
the API reference (or build the "docs" target from your build system). This
|
||||
is optional. You can browse the API docs online here:
|
||||
|
||||
https://icculus.org/physfs/docs/
|
||||
|
||||
|
||||
|
||||
BUILD IT WITH YOUR OWN PROGRAM:
|
||||
|
||||
If you don't care about formal packaging: just add everything in the "src"
|
||||
directory to whatever you use to build your program and compile it along with
|
||||
everything else, and you're done. It should compile with any reasonable
|
||||
ANSI C compiler, should build cleanly even with excessive compiler warnings
|
||||
enabled, needs no extra configuration, and allows static linking.
|
||||
WinRT and Haiku need C++ compilers for their system APIs, but if you aren't on
|
||||
these platforms and don't have a C++ compiler, don't build the .cpp files.
|
||||
Likewise: Apple platforms (macOS, iOS, etc) need an Objective-C compiler, but
|
||||
if you aren't on these platforms and don't have a Objective-C compiler, don't
|
||||
build the .m file. Everything you need is in the .c sources.
|
||||
|
||||
If this all worked for your specific project, you can stop reading now.
|
||||
|
||||
|
||||
|
||||
Unix:
|
||||
|
||||
You will need CMake (https://www.cmake.org/) 2.4 or later installed.
|
||||
|
||||
Make a directory, wherever you like. This will be your build directory.
|
||||
|
||||
Chdir to your build directory. Run "cmake /where/i/unpacked/physfs" to
|
||||
generate Makefiles. You can then run "ccmake ." and customize the build,
|
||||
but the defaults are probably okay. You can have CMake generate KDevelop
|
||||
or Ninja project files or whatever, if you prefer these.
|
||||
|
||||
Run "make". PhysicsFS will now build.
|
||||
|
||||
As root, run "make install".
|
||||
If you get sick of the library, run "make uninstall" as root
|
||||
and it will remove all traces of the library from the system paths.
|
||||
|
||||
Once you are satisfied, you can delete the build directory.
|
||||
|
||||
Primary Unix development is done with GNU/Linux, but PhysicsFS is known to
|
||||
work out of the box with several flavors of Unix. It it doesn't work, patches
|
||||
to get it running can be sent to icculus@icculus.org.
|
||||
|
||||
|
||||
Windows:
|
||||
|
||||
If building with Cygwin, mingw32, MSYS, or something else that uses the GNU
|
||||
toolchain, follow the Unix instructions, above.
|
||||
|
||||
If you want to use Visual Studio, nmake, or the Platform SDK, you will need
|
||||
CMake (https://www.cmake.org/) 2.4 or later installed. Point CMake at the
|
||||
CMakeLists.txt file in the root of the source directory and hit the
|
||||
"Configure" button. After telling it what type of compiler you are targeting
|
||||
(Borland, Visual Studio, etc), CMake will process for while and then give you
|
||||
a list of options you can change (what archivers you want to support, etc).
|
||||
If you aren't sure, the defaults are probably fine. Hit the "Configure"
|
||||
button again, then "OK" once configuration has completed with options that
|
||||
match your liking. Now project files for your favorite programming
|
||||
environment will be generated for you in the directory you specified.
|
||||
Go there and use them to build PhysicsFS.
|
||||
|
||||
PhysicsFS will only link directly against system libraries that have existed
|
||||
since Windows NT 3.51. If there's a newer API we want to use, we try to
|
||||
dynamically load it at runtime and fallback to a reasonable behaviour when
|
||||
we can't find it. Note that Windows 98 and later _should_
|
||||
work if you use the Microsoft Layer for Unicode (UNICOWS.DLL) to provide
|
||||
some missing system APIs, but this is no longer tested as of PhysicsFS 2.1.0.
|
||||
PhysicsFS 2.0.x is known to work with Windows 95 without UNICOWS.DLL.
|
||||
|
||||
PhysicsFS works on 32-bit and 64-bit Windows. There is no 16-bit Windows
|
||||
support at all. Windows RT is covered below.
|
||||
|
||||
|
||||
Windows RT:
|
||||
|
||||
Windows RT (Windows Phone, Windows Store, UWP) 8.0 and later are supported.
|
||||
Make sure you include both physfs_platform_windows.c _and_
|
||||
physfs_platform_winrt.cpp in your build, and that the C++ file has
|
||||
"Consume Windows Runtime Extension" set to "Yes" in its Visual Studio
|
||||
properties (from the command line, you want to compile this file with the
|
||||
"/ZW" compiler switch). CMake can, in theory, generate a project file for
|
||||
WinRT if you pick a recent Visual Studio target, choose manual cross-compile
|
||||
options, and set the system name to "WindowsPhone" or "WindowsStore" and the
|
||||
correct OS version (8.0 or later).
|
||||
|
||||
|
||||
PocketPC/WindowsCE:
|
||||
|
||||
Support for PocketPC was removed in PhysicsFS 2.1.0. This was known to work
|
||||
in the 1.0 releases, but wasn't tested in 2.0 and later. PhysicsFS should
|
||||
work on modern Windows Phones (see "Windows RT" section).
|
||||
|
||||
|
||||
macOS:
|
||||
|
||||
You will need CMake (https://www.cmake.org/) 2.4 or later installed.
|
||||
|
||||
You can either generate a Unix makefile with CMake, or generate an Xcode
|
||||
project, whichever makes you more comfortable.
|
||||
|
||||
PowerPC and Intel Macs should both be supported.
|
||||
|
||||
|
||||
MAC OS 8/9 ("Mac OS Classic"):
|
||||
|
||||
Classic Mac OS support has been dropped in PhysicsFS 2.0. Apple hasn't updated
|
||||
pre-OSX versions in more than a decade at this point, none of the hardware
|
||||
they've shipped will boot it for almost as many years, and finding
|
||||
developer tools for it is becoming almost impossible. As the switch to Intel
|
||||
hardware has removed the "Classic" emulation environment, it was time to
|
||||
remove support from PhysicsFS. That being said, the PhysicsFS 1.0 branch can
|
||||
still target back to Mac OS 8.5, so you can use that if you need support for
|
||||
this legacy OS. We still very much support modern macOS, though: see above.
|
||||
|
||||
|
||||
Emscripten:
|
||||
|
||||
Use the "Unix" instructions, above. You can install the Emscripten SDK and use
|
||||
the extras/buildbot-emscripten.sh script to automate this for you.
|
||||
|
||||
|
||||
BeOS, Zeta, YellowTab:
|
||||
|
||||
BeOS support was dropped in PhysicsFS 2.1.0. Consider installing Haiku, which
|
||||
we still support.
|
||||
|
||||
|
||||
Haiku:
|
||||
|
||||
Use the "Unix" instructions, above.
|
||||
|
||||
|
||||
OS/2:
|
||||
|
||||
OS/2 is known to work with OpenWatcom and GCC-based compilers. I couldn't get
|
||||
an OS/2 port of CMake to generate OpenWatcom project files (although it should
|
||||
be able to do that in theory), it should be able to do Unix Makefiles with
|
||||
GCC. It might be easier to just compile PhysicsFS along with the rest of
|
||||
your project on this platform.
|
||||
|
||||
|
||||
|
||||
OTHER PLATFORMS:
|
||||
|
||||
Many Unix-like platforms might "just work" with CMake. Some of these platforms
|
||||
are known to have worked at one time, but have not been heavily tested, if
|
||||
tested at all. PhysicsFS is, as far as we know, 64-bit and byteorder clean,
|
||||
and is known to compile on several compilers across many platforms. To
|
||||
implement a new platform or archiver, please read the heavily-commented
|
||||
physfs_internal.h and look at the physfs_platform_* and physfs_archiver_*
|
||||
source files for examples.
|
||||
|
||||
--ryan. (icculus@icculus.org)
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
The API documentation is readable in a few ways:
|
||||
|
||||
- Read physfs.h; it's _heavily_ documented and the primary source of reference
|
||||
documentation for the library.
|
||||
- Run Doxygen over the header, which produces nicer-to-browse documentation in
|
||||
HTML, LaTeX, manpage, etc formats. This is done for you if Doxygen is
|
||||
installed and you build the "docs" target in whatever project files CMake
|
||||
generated for you.
|
||||
- Too much trouble? We generated the HTML reference for you, online here:
|
||||
|
||||
https://icculus.org/physfs/docs/
|
||||
|
||||
- We would love well-written tutorials for the latest version of PhysicsFS!
|
||||
If you write one, we would love to list it here. Drop me a line about it:
|
||||
icculus@icculus.org ... Thanks!
|
||||
|
||||
--ryan.
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
Stuff that needs to be done and wishlist:
|
||||
|
||||
These are in no particular order.
|
||||
Some might be dupes, some might be done already, some might be bad ideas.
|
||||
|
||||
|
||||
From https://icculus.org/pipermail/physfs/2009-March/000698.html ...
|
||||
|
||||
- Write support for various archives. I haven't decided how to do this yet,
|
||||
but I'd like to.
|
||||
- Add an API to expose a file's extended attributes to the application?
|
||||
- Deprecate PHYSFS_setSaneConfig(). It really should have been in the extras
|
||||
directory.
|
||||
- Clean up the sources to match my ever-changing coding style. :)
|
||||
|
||||
|
||||
|
||||
From https://icculus.org/pipermail/physfs/2010-January/000826.html ...
|
||||
|
||||
- Lua bindings
|
||||
|
||||
|
||||
From https://icculus.org/pipermail/physfs/2010-January/000833.html ...
|
||||
|
||||
- SWIG bindings
|
||||
|
||||
|
||||
|
||||
From old TODO.txt...
|
||||
|
||||
- Other archivers: perhaps tar(.gz|.bz2), RPM, ARJ, etc. These are less
|
||||
important, since streaming archives aren't of much value to games (which
|
||||
is why zipfiles are king: random access), but it could have uses for, say,
|
||||
an installer/updater.
|
||||
- Do symlinks in zip archiver work when they point to dirs?
|
||||
- Enable more warnings?
|
||||
- Use __cdecl in physfs.h?
|
||||
- Look for FIXMEs (many marked with "!!!" in comments).
|
||||
- fscanf and fprintf support in extras dir.
|
||||
- Sanity check byte order at runtime.
|
||||
- Memory locking?
|
||||
- General code audit.
|
||||
- Multiple write dirs with mount points?
|
||||
|
||||
|
||||
Other stuff I thought of...
|
||||
- moar asserts!
|
||||
- constify!
|
||||
- Does iPhone work?
|
||||
- Fix CMake vs Doxygen.
|
||||
- Doxygen replacement? (manpages suck.)
|
||||
- Fix coding standards to match.
|
||||
- See if we can ditch some #include lines...
|
||||
- LZMA support in zip archiver?
|
||||
- bzip2 support in zip archiver?
|
||||
- Reduce the BAIL and GOTO macro use. A lot of these don't add anything.
|
||||
- Change the term "search path" to something less confusing.
|
||||
|
||||
Probably other stuff. Requests and recommendations are welcome.
|
||||
|
||||
// end of TODO.txt ...
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
Makefile
|
||||
.deps
|
||||
.libs
|
||||
Makefile.in
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
EXTRA_DIST = \
|
||||
physfsrwops.c \
|
||||
physfsrwops.h \
|
||||
abs-file.h \
|
||||
physfshttpd.c \
|
||||
physfs_rb
|
||||
|
|
@ -1,58 +0,0 @@
|
|||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
//
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
//
|
||||
[assembly: AssemblyTitle("PhysFS.NET")]
|
||||
[assembly: AssemblyDescription("PhysFS Bindings for .NET")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("PhysFS.NET")]
|
||||
[assembly: AssemblyCopyright("(c)2003 Gregory S. Read")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
//
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
|
||||
[assembly: AssemblyVersion("1.0.*")]
|
||||
|
||||
//
|
||||
// In order to sign your assembly you must specify a key to use. Refer to the
|
||||
// Microsoft .NET Framework documentation for more information on assembly signing.
|
||||
//
|
||||
// Use the attributes below to control which key is used for signing.
|
||||
//
|
||||
// Notes:
|
||||
// (*) If no key is specified, the assembly is not signed.
|
||||
// (*) KeyName refers to a key that has been installed in the Crypto Service
|
||||
// Provider (CSP) on your machine. KeyFile refers to a file which contains
|
||||
// a key.
|
||||
// (*) If the KeyFile and the KeyName values are both specified, the
|
||||
// following processing occurs:
|
||||
// (1) If the KeyName can be found in the CSP, that key is used.
|
||||
// (2) If the KeyName does not exist and the KeyFile does exist, the key
|
||||
// in the KeyFile is installed into the CSP and used.
|
||||
// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
|
||||
// When specifying the KeyFile, the location of the KeyFile should be
|
||||
// relative to the project output directory which is
|
||||
// %Project Directory%\obj\<configuration>. For example, if your KeyFile is
|
||||
// located in the project directory, you would specify the AssemblyKeyFile
|
||||
// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
|
||||
// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
|
||||
// documentation for more information on this.
|
||||
//
|
||||
[assembly: AssemblyDelaySign(false)]
|
||||
[assembly: AssemblyKeyFile("")]
|
||||
[assembly: AssemblyKeyName("")]
|
|
@ -1,113 +0,0 @@
|
|||
<VisualStudioProject>
|
||||
<CSHARP
|
||||
ProjectType = "Local"
|
||||
ProductVersion = "7.0.9466"
|
||||
SchemaVersion = "1.0"
|
||||
ProjectGuid = "{C6205A43-3D4D-41E6-872C-96CD7BE55230}"
|
||||
>
|
||||
<Build>
|
||||
<Settings
|
||||
ApplicationIcon = ""
|
||||
AssemblyKeyContainerName = ""
|
||||
AssemblyName = "PhysFS.NET"
|
||||
AssemblyOriginatorKeyFile = ""
|
||||
DefaultClientScript = "JScript"
|
||||
DefaultHTMLPageLayout = "Grid"
|
||||
DefaultTargetSchema = "IE50"
|
||||
DelaySign = "false"
|
||||
OutputType = "Library"
|
||||
RootNamespace = "PhysFS.NET"
|
||||
StartupObject = ""
|
||||
>
|
||||
<Config
|
||||
Name = "Debug"
|
||||
AllowUnsafeBlocks = "true"
|
||||
BaseAddress = "285212672"
|
||||
CheckForOverflowUnderflow = "false"
|
||||
ConfigurationOverrideFile = ""
|
||||
DefineConstants = "DEBUG;TRACE"
|
||||
DocumentationFile = ""
|
||||
DebugSymbols = "true"
|
||||
FileAlignment = "4096"
|
||||
IncrementalBuild = "true"
|
||||
Optimize = "false"
|
||||
OutputPath = "bin\Debug\"
|
||||
RegisterForComInterop = "false"
|
||||
RemoveIntegerChecks = "false"
|
||||
TreatWarningsAsErrors = "false"
|
||||
WarningLevel = "4"
|
||||
/>
|
||||
<Config
|
||||
Name = "Release"
|
||||
AllowUnsafeBlocks = "true"
|
||||
BaseAddress = "285212672"
|
||||
CheckForOverflowUnderflow = "false"
|
||||
ConfigurationOverrideFile = ""
|
||||
DefineConstants = "TRACE"
|
||||
DocumentationFile = ""
|
||||
DebugSymbols = "false"
|
||||
FileAlignment = "4096"
|
||||
IncrementalBuild = "false"
|
||||
Optimize = "true"
|
||||
OutputPath = "bin\Release\"
|
||||
RegisterForComInterop = "false"
|
||||
RemoveIntegerChecks = "false"
|
||||
TreatWarningsAsErrors = "false"
|
||||
WarningLevel = "4"
|
||||
/>
|
||||
</Settings>
|
||||
<References>
|
||||
<Reference
|
||||
Name = "System"
|
||||
AssemblyName = "System"
|
||||
HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.0.3705\System.dll"
|
||||
/>
|
||||
<Reference
|
||||
Name = "System.Data"
|
||||
AssemblyName = "System.Data"
|
||||
HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.0.3705\System.Data.dll"
|
||||
/>
|
||||
<Reference
|
||||
Name = "System.XML"
|
||||
AssemblyName = "System.Xml"
|
||||
HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.0.3705\System.XML.dll"
|
||||
/>
|
||||
<Reference
|
||||
Name = "System.Drawing"
|
||||
AssemblyName = "System.Drawing"
|
||||
HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.0.3705\System.Drawing.dll"
|
||||
/>
|
||||
<Reference
|
||||
Name = "System.Windows.Forms"
|
||||
AssemblyName = "System.Windows.Forms"
|
||||
HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.0.3705\System.Windows.Forms.dll"
|
||||
/>
|
||||
</References>
|
||||
</Build>
|
||||
<Files>
|
||||
<Include>
|
||||
<File
|
||||
RelPath = "AssemblyInfo.cs"
|
||||
SubType = "Code"
|
||||
BuildAction = "Compile"
|
||||
/>
|
||||
<File
|
||||
RelPath = "PhysFS.cs"
|
||||
SubType = "Code"
|
||||
BuildAction = "Compile"
|
||||
/>
|
||||
<File
|
||||
RelPath = "PhysFS_DLL.cs"
|
||||
SubType = "Code"
|
||||
BuildAction = "Compile"
|
||||
/>
|
||||
<File
|
||||
RelPath = "PhysFSFileStream.cs"
|
||||
SubType = "Code"
|
||||
BuildAction = "Compile"
|
||||
/>
|
||||
</Include>
|
||||
</Files>
|
||||
</CSHARP>
|
||||
</VisualStudioProject>
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
Microsoft Visual Studio Solution File, Format Version 7.00
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PhysFS.NET", "PhysFS.NET.csproj", "{C6205A43-3D4D-41E6-872C-96CD7BE55230}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfiguration) = preSolution
|
||||
ConfigName.0 = Debug
|
||||
ConfigName.1 = Release
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectDependencies) = postSolution
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfiguration) = postSolution
|
||||
{C6205A43-3D4D-41E6-872C-96CD7BE55230}.Debug.ActiveCfg = Debug|.NET
|
||||
{C6205A43-3D4D-41E6-872C-96CD7BE55230}.Debug.Build.0 = Debug|.NET
|
||||
{C6205A43-3D4D-41E6-872C-96CD7BE55230}.Release.ActiveCfg = Release|.NET
|
||||
{C6205A43-3D4D-41E6-872C-96CD7BE55230}.Release.Build.0 = Release|.NET
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityAddIns) = postSolution
|
||||
EndGlobalSection
|
||||
EndGlobal
|
|
@ -1,189 +0,0 @@
|
|||
/* PhysFS.cs - (c)2003 Gregory S. Read
|
||||
* Provides access to PhysFS API calls not specific to file handle access.
|
||||
*/
|
||||
using System;
|
||||
|
||||
namespace PhysFS_NET
|
||||
{
|
||||
public class PhysFS
|
||||
{
|
||||
/* Initialize
|
||||
* Inits the PhysFS API. This normally does not need to be called unless
|
||||
* the API has been manually deinitialized since the PhysFS_DLL class
|
||||
* initializes just before the first call is made into the DLL.
|
||||
* Parameters
|
||||
* none
|
||||
* Returns
|
||||
* none
|
||||
* Exceptions
|
||||
* PhysFSException - An error occured in the PhysFS API
|
||||
*/
|
||||
public static void Initialize()
|
||||
{
|
||||
// Initialize the physfs library, raise an exception if error
|
||||
if(PhysFS_DLL.PHYSFS_init("") == 0)
|
||||
throw new PhysFSException();
|
||||
}
|
||||
|
||||
/* Deinitialize
|
||||
* Deinits the PhysFS API. It is recommended that this method be called
|
||||
* by the application before exiting in order to gracefully deallocate
|
||||
* resources and close all filehandles, etc.
|
||||
* Parameters
|
||||
* none
|
||||
* Returns
|
||||
* none
|
||||
* Exceptions
|
||||
* PhysFSException - An error occured in the PhysFS API
|
||||
*/
|
||||
public static void Deinitialize()
|
||||
{
|
||||
// Deinit, raise an exception if an error occured
|
||||
if(PhysFS_DLL.PHYSFS_deinit() == 0)
|
||||
throw new PhysFSException();
|
||||
}
|
||||
|
||||
/* BaseDir
|
||||
* Gets the base directory configured for PhysFS. See the PhysFS API
|
||||
* documentation for more information.
|
||||
* Parameters
|
||||
* none
|
||||
* Returns
|
||||
* A string value representing the Base Directory
|
||||
* Exceptions
|
||||
* none
|
||||
*/
|
||||
public static string BaseDir
|
||||
{
|
||||
get
|
||||
{
|
||||
// Return the current base directory
|
||||
return PhysFS_DLL.PHYSFS_getBaseDir();
|
||||
}
|
||||
}
|
||||
|
||||
/* WriteDir
|
||||
* Gets or sets the write directory configured for PhysFS. See the PhysFS API
|
||||
* documentation for more information.
|
||||
* Parameters
|
||||
* set - Path to set the WriteDir property to
|
||||
* Returns
|
||||
* A string value representing the Write Directory
|
||||
* Exceptions
|
||||
* PhysFSException - An error occured in the PhysFS API when
|
||||
* settings the write directory.
|
||||
*/
|
||||
public static string WriteDir
|
||||
{
|
||||
get
|
||||
{
|
||||
// Return the current write directory
|
||||
return PhysFS_DLL.PHYSFS_getWriteDir();
|
||||
}
|
||||
set
|
||||
{
|
||||
// Set the write directory and raise an exception if an error occured
|
||||
if(PhysFS_DLL.PHYSFS_setWriteDir(value) == 0)
|
||||
throw new PhysFSException();
|
||||
}
|
||||
}
|
||||
|
||||
/* UserDir
|
||||
* Gets or sets the write directory configured for PhysFS. See the PhysFS API
|
||||
* documentation for more information.
|
||||
* Parameters
|
||||
* set - Path to set the WriteDir property to
|
||||
* Returns
|
||||
* A string value representing the Write Directory
|
||||
* Exceptions
|
||||
* PhysFSException - An error occured in the PhysFS API when
|
||||
* settings the write directory.
|
||||
*/
|
||||
public static string UserDir
|
||||
{
|
||||
get
|
||||
{
|
||||
// Return the current user directory
|
||||
return PhysFS_DLL.PHYSFS_getUserDir();
|
||||
}
|
||||
}
|
||||
public static void AddToSearchPath(string NewDir, bool Append)
|
||||
{
|
||||
if(PhysFS_DLL.PHYSFS_addToSearchPath(NewDir, Append?1:0) == 0)
|
||||
throw new PhysFSException();
|
||||
}
|
||||
public static void RemoveFromSearchPath(string OldDir)
|
||||
{
|
||||
if(PhysFS_DLL.PHYSFS_removeFromSearchPath(OldDir) == 0)
|
||||
throw new PhysFSException();
|
||||
}
|
||||
public unsafe static string[] GetSearchPath()
|
||||
{
|
||||
byte** p; // Searchpath list from PhysFS dll
|
||||
string[] pathlist; // List converted to an array
|
||||
|
||||
// Get the CDROM drive listing
|
||||
p = PhysFS_DLL.PHYSFS_getSearchPath();
|
||||
// Convert the C-style array to a .NET style array
|
||||
pathlist = PhysFS_DLL.BytePPToArray(p);
|
||||
// Free the original list since we're done with it
|
||||
PhysFS_DLL.PHYSFS_freeList(p);
|
||||
|
||||
return pathlist;
|
||||
}
|
||||
public unsafe static string[] GetCDROMDrives()
|
||||
{
|
||||
byte** p; // CDROM list from PhysFS dll
|
||||
string[] cdromlist; // List converted to an array
|
||||
|
||||
// Get the CDROM drive listing
|
||||
p = PhysFS_DLL.PHYSFS_getCdRomDirs();
|
||||
// Convert the C-style array to a .NET style array
|
||||
cdromlist = PhysFS_DLL.BytePPToArray(p);
|
||||
// Free the original list since we're done with it
|
||||
PhysFS_DLL.PHYSFS_freeList(p);
|
||||
|
||||
return cdromlist;
|
||||
}
|
||||
public static void MkDir(string Dirname)
|
||||
{
|
||||
if(PhysFS_DLL.PHYSFS_mkdir(Dirname) == 0)
|
||||
throw new PhysFSException();
|
||||
}
|
||||
public static void Delete(string Filename)
|
||||
{
|
||||
if(PhysFS_DLL.PHYSFS_delete(Filename) == 0)
|
||||
throw new PhysFSException();
|
||||
}
|
||||
public static string GetRealDir(string Filename)
|
||||
{
|
||||
string RetValue;
|
||||
|
||||
RetValue = PhysFS_DLL.PHYSFS_getRealDir(Filename);
|
||||
if(RetValue == null)
|
||||
throw new PhysFSException("File not found in search path.");
|
||||
|
||||
// Return the real file path of the specified filename
|
||||
return RetValue;
|
||||
}
|
||||
public unsafe static string[] EnumerateFiles(string Dirname)
|
||||
{
|
||||
byte** p; // File list from PhysFS dll
|
||||
string[] filelist; // List converted to an array
|
||||
|
||||
// Get the CDROM drive listing
|
||||
p = PhysFS_DLL.PHYSFS_enumerateFiles(Dirname);
|
||||
// Convert the C-style array to a .NET style array
|
||||
filelist = PhysFS_DLL.BytePPToArray(p);
|
||||
// Free the original list since we're done with it
|
||||
PhysFS_DLL.PHYSFS_freeList(p);
|
||||
|
||||
return filelist;
|
||||
}
|
||||
public static bool IsDirectory(string Filename)
|
||||
{
|
||||
// Return true if non-zero, otherwise return false
|
||||
return (PhysFS_DLL.PHYSFS_isDirectory(Filename) == 0)?false:true;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,194 +0,0 @@
|
|||
/* PhysFSFileStream.cs - (c)2003 Gregory S. Read */
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.IO;
|
||||
|
||||
namespace PhysFS_NET
|
||||
{
|
||||
public enum PhysFSFileMode {Read, Write, Append};
|
||||
|
||||
// Our exception class we'll use for throwing all PhysFS API related exception
|
||||
public class PhysFSException : IOException
|
||||
{
|
||||
public PhysFSException(string Message) : base(Message) {}
|
||||
public PhysFSException() : base(PhysFS_DLL.PHYSFS_getLastError()) {}
|
||||
}
|
||||
|
||||
public unsafe class PhysFSFileStream : Stream
|
||||
{
|
||||
// ***Public properties***
|
||||
public override bool CanRead
|
||||
{
|
||||
get
|
||||
{
|
||||
// Reading is supported
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool CanSeek
|
||||
{
|
||||
get
|
||||
{
|
||||
// Seek is supported
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool CanWrite
|
||||
{
|
||||
get
|
||||
{
|
||||
// Writing is supported
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public override long Length
|
||||
{
|
||||
get
|
||||
{
|
||||
long TempLength;
|
||||
TempLength = PhysFS_DLL.PHYSFS_fileLength(pHandle);
|
||||
|
||||
// If call returned an error, throw an exception
|
||||
if(TempLength == -1)
|
||||
throw new PhysFSException();
|
||||
|
||||
return TempLength;
|
||||
}
|
||||
}
|
||||
|
||||
public override long Position
|
||||
{
|
||||
get
|
||||
{
|
||||
long TempPosition;
|
||||
TempPosition = PhysFS_DLL.PHYSFS_tell(pHandle);
|
||||
|
||||
// If call returned an error, throw an exception
|
||||
if(TempPosition == -1)
|
||||
throw new PhysFSException();
|
||||
|
||||
return TempPosition;
|
||||
}
|
||||
set
|
||||
{
|
||||
// Seek from beginning of file using the position value
|
||||
Seek(value, SeekOrigin.Begin);
|
||||
}
|
||||
}
|
||||
|
||||
// ***Public methods***
|
||||
public PhysFSFileStream(string FileName, PhysFSFileMode FileMode, ulong BufferSize)
|
||||
{
|
||||
// Open the specified file with the appropriate file access
|
||||
switch(FileMode)
|
||||
{
|
||||
case PhysFSFileMode.Read:
|
||||
pHandle = PhysFS_DLL.PHYSFS_openRead(FileName);
|
||||
break;
|
||||
case PhysFSFileMode.Write:
|
||||
pHandle = PhysFS_DLL.PHYSFS_openWrite(FileName);
|
||||
break;
|
||||
case PhysFSFileMode.Append:
|
||||
pHandle = PhysFS_DLL.PHYSFS_openAppend(FileName);
|
||||
break;
|
||||
default:
|
||||
throw new PhysFSException("Invalid FileMode specified");
|
||||
}
|
||||
|
||||
// If handle is null, an error occured, so raise an exception
|
||||
//!!! Does object get created if exception is thrown?
|
||||
if(pHandle == null)
|
||||
throw new PhysFSException();
|
||||
|
||||
// Set buffer size, raise an exception if an error occured
|
||||
if(PhysFS_DLL.PHYSFS_setBuffer(pHandle, BufferSize) == 0)
|
||||
throw new PhysFSException();
|
||||
}
|
||||
|
||||
// This constructor sets the buffer size to 0 if not specified
|
||||
public PhysFSFileStream(string FileName, PhysFSFileMode FileMode) : this(FileName, FileMode, 0) {}
|
||||
|
||||
~PhysFSFileStream()
|
||||
{
|
||||
// Don't close the handle if they've specifically closed it already
|
||||
if(!Closed)
|
||||
Close();
|
||||
}
|
||||
|
||||
public override void Flush()
|
||||
{
|
||||
if(PhysFS_DLL.PHYSFS_flush(pHandle) == 0)
|
||||
throw new PhysFSException();
|
||||
}
|
||||
|
||||
public override int Read(byte[] buffer, int offset, int count)
|
||||
{
|
||||
long RetValue;
|
||||
|
||||
fixed(byte *pbytes = &buffer[offset])
|
||||
{
|
||||
// Read into our allocated pointer
|
||||
RetValue = PhysFS_DLL.PHYSFS_read(pHandle, pbytes, sizeof(byte), (uint)count);
|
||||
}
|
||||
|
||||
if(RetValue == -1)
|
||||
throw new PhysFSException();
|
||||
|
||||
// Return number of bytes read
|
||||
// Note: This cast should be safe since we are only reading 'count' items, which
|
||||
// is of type 'int'.
|
||||
return (int)RetValue;
|
||||
}
|
||||
|
||||
public override void Write(byte[] buffer, int offset, int count)
|
||||
{
|
||||
long RetValue;
|
||||
|
||||
fixed(byte* pbytes = &buffer[offset])
|
||||
{
|
||||
// Write buffer
|
||||
RetValue = PhysFS_DLL.PHYSFS_write(pHandle, pbytes, sizeof(byte), (uint)count);
|
||||
}
|
||||
|
||||
if(RetValue == -1)
|
||||
throw new PhysFSException();
|
||||
}
|
||||
|
||||
public override long Seek(long offset, SeekOrigin origin)
|
||||
{
|
||||
// Only seeking from beginning is supported by PhysFS API
|
||||
if(origin != SeekOrigin.Begin)
|
||||
throw new PhysFSException("Only seek origin of \"Begin\" is supported");
|
||||
|
||||
// Seek to specified offset, raise an exception if error occured
|
||||
if(PhysFS_DLL.PHYSFS_seek(pHandle, (ulong)offset) == 0)
|
||||
throw new PhysFSException();
|
||||
|
||||
// Since we always seek from beginning, the offset is always
|
||||
// the absolute position.
|
||||
return offset;
|
||||
}
|
||||
|
||||
public override void SetLength(long value)
|
||||
{
|
||||
throw new NotSupportedException("SetLength method not supported in PhysFSFileStream objects.");
|
||||
}
|
||||
|
||||
public override void Close()
|
||||
{
|
||||
// Close the handle
|
||||
if(PhysFS_DLL.PHYSFS_close(pHandle) == 0)
|
||||
throw new PhysFSException();
|
||||
|
||||
// File has been closed. Rock.
|
||||
Closed = true;
|
||||
}
|
||||
|
||||
// ***Private variables***
|
||||
private void *pHandle;
|
||||
private bool Closed = false;
|
||||
}
|
||||
}
|
|
@ -1,113 +0,0 @@
|
|||
/* PhysFS_DLL - (c)2003 Gregory S. Read
|
||||
* Internal class that provides direct access to the PhysFS DLL. It is
|
||||
* not accessible outside of the PhysFS.NET assembly.
|
||||
*/
|
||||
using System.Collections;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace PhysFS_NET
|
||||
{
|
||||
internal class PhysFS_DLL
|
||||
{
|
||||
/* Static constructor
|
||||
* Initializes the PhysFS API before any method is called in this class. This
|
||||
* relieves the user from having to explicitly initialize the API.
|
||||
* Parameters
|
||||
* none
|
||||
* Returns
|
||||
* none
|
||||
* Exceptions
|
||||
* PhysFSException - An error occured in the PhysFS API
|
||||
*/
|
||||
static PhysFS_DLL()
|
||||
{
|
||||
if(PHYSFS_init("") == 0)
|
||||
throw new PhysFSException();
|
||||
}
|
||||
|
||||
/* BytePPToArray
|
||||
* Converts a C-style string array into a .NET managed string array
|
||||
* Parameters
|
||||
* C-style string array pointer returned from PhysFS
|
||||
* Returns
|
||||
* .NET managed string array
|
||||
* Exceptions
|
||||
* none
|
||||
*/
|
||||
public unsafe static string[] BytePPToArray(byte **bytearray)
|
||||
{
|
||||
byte** ptr;
|
||||
byte* c;
|
||||
string tempstr;
|
||||
ArrayList MyArrayList = new ArrayList();
|
||||
string[] RetArray;
|
||||
|
||||
for(ptr = bytearray; *ptr != null; ptr++)
|
||||
{
|
||||
tempstr = "";
|
||||
for(c = *ptr; *c != 0; c++)
|
||||
{
|
||||
tempstr += (char)*c;
|
||||
}
|
||||
|
||||
// Add string to our list
|
||||
MyArrayList.Add(tempstr);
|
||||
}
|
||||
|
||||
// Return a normal array of the list
|
||||
RetArray = new string[MyArrayList.Count];
|
||||
MyArrayList.CopyTo(RetArray, 0);
|
||||
return RetArray;
|
||||
}
|
||||
|
||||
// Name of DLL to import
|
||||
private const string PHYSFS_DLLNAME = "physfs.dll";
|
||||
|
||||
// DLL import declarations
|
||||
[DllImport(PHYSFS_DLLNAME)] public static extern int PHYSFS_init(string argv0);
|
||||
[DllImport(PHYSFS_DLLNAME)] public static extern int PHYSFS_deinit();
|
||||
[DllImport(PHYSFS_DLLNAME)] public static extern unsafe void PHYSFS_freeList(void *listVar);
|
||||
[DllImport(PHYSFS_DLLNAME)] public static extern string PHYSFS_getLastError();
|
||||
[DllImport(PHYSFS_DLLNAME)] public static extern string PHYSFS_getDirSeparator();
|
||||
[DllImport(PHYSFS_DLLNAME)] public static extern void PHYSFS_permitSymbolicLinks(int allow);
|
||||
[DllImport(PHYSFS_DLLNAME)] public static extern unsafe byte** PHYSFS_getCdRomDirs();
|
||||
[DllImport(PHYSFS_DLLNAME)] public static extern string PHYSFS_getBaseDir();
|
||||
[DllImport(PHYSFS_DLLNAME)] public static extern string PHYSFS_getUserDir();
|
||||
[DllImport(PHYSFS_DLLNAME)] public static extern string PHYSFS_getWriteDir();
|
||||
[DllImport(PHYSFS_DLLNAME)] public static extern int PHYSFS_setWriteDir(string newDir);
|
||||
[DllImport(PHYSFS_DLLNAME)] public static extern int PHYSFS_addToSearchPath(string newDir, int appendToPath);
|
||||
[DllImport(PHYSFS_DLLNAME)] public static extern int PHYSFS_removeFromSearchPath(string oldDir);
|
||||
[DllImport(PHYSFS_DLLNAME)] public static extern unsafe byte** PHYSFS_getSearchPath();
|
||||
[DllImport(PHYSFS_DLLNAME)] public static extern int PHYSFS_setSaneConfig(string organization,
|
||||
string appName,
|
||||
string archiveExt,
|
||||
int includeCdRoms,
|
||||
int archivesFirst);
|
||||
[DllImport(PHYSFS_DLLNAME)] public static extern int PHYSFS_mkdir(string dirName);
|
||||
[DllImport(PHYSFS_DLLNAME)] public static extern int PHYSFS_delete(string filename);
|
||||
[DllImport(PHYSFS_DLLNAME)] public static extern string PHYSFS_getRealDir(string filename);
|
||||
[DllImport(PHYSFS_DLLNAME)] public static extern unsafe byte** PHYSFS_enumerateFiles(string dir);
|
||||
[DllImport(PHYSFS_DLLNAME)] public static extern int PHYSFS_exists(string fname);
|
||||
[DllImport(PHYSFS_DLLNAME)] public static extern int PHYSFS_isDirectory(string fname);
|
||||
[DllImport(PHYSFS_DLLNAME)] public static extern int PHYSFS_isSymbolicLink(string fname);
|
||||
[DllImport(PHYSFS_DLLNAME)] public static extern unsafe void* PHYSFS_openWrite(string filename);
|
||||
[DllImport(PHYSFS_DLLNAME)] public static extern unsafe void* PHYSFS_openAppend(string filename);
|
||||
[DllImport(PHYSFS_DLLNAME)] public static extern unsafe void* PHYSFS_openRead(string filename);
|
||||
[DllImport(PHYSFS_DLLNAME)] public static extern unsafe int PHYSFS_close(void* handle);
|
||||
[DllImport(PHYSFS_DLLNAME)] public static extern unsafe long PHYSFS_getLastModTime(string filename);
|
||||
[DllImport(PHYSFS_DLLNAME)] public static extern unsafe long PHYSFS_read(void* handle,
|
||||
void *buffer,
|
||||
uint objSize,
|
||||
uint objCount);
|
||||
[DllImport(PHYSFS_DLLNAME)] public static extern unsafe long PHYSFS_write(void* handle,
|
||||
void *buffer,
|
||||
uint objSize,
|
||||
uint objCount);
|
||||
[DllImport(PHYSFS_DLLNAME)] public static extern unsafe int PHYSFS_eof(void* handle);
|
||||
[DllImport(PHYSFS_DLLNAME)] public static extern unsafe long PHYSFS_tell(void* handle);
|
||||
[DllImport(PHYSFS_DLLNAME)] public static extern unsafe int PHYSFS_seek(void* handle, ulong pos);
|
||||
[DllImport(PHYSFS_DLLNAME)] public static extern unsafe long PHYSFS_fileLength(void* handle);
|
||||
[DllImport(PHYSFS_DLLNAME)] public static extern unsafe int PHYSFS_setBuffer(void* handle, ulong bufsize);
|
||||
[DllImport(PHYSFS_DLLNAME)] public static extern unsafe int PHYSFS_flush(void* handle);
|
||||
}
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
PhysFS.NET is a library that encapsulates the PhysFS API into a .NET assembly.
|
||||
|
||||
There are two class objects that are exposed in the assembly:
|
||||
PhysFS.cs
|
||||
This class exposes any non-filehandle specific functionality contained in
|
||||
the PhysFS library.
|
||||
PhysFSFileStream.cs
|
||||
A System.IO.Stream derived class which provides file access via the
|
||||
PhysFS API. Usage of this object is identical to a standard stream
|
||||
object.
|
Binary file not shown.
Before Width: | Height: | Size: 1.1 KiB |
|
@ -1,58 +0,0 @@
|
|||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
//
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
//
|
||||
[assembly: AssemblyTitle("")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("")]
|
||||
[assembly: AssemblyCopyright("")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
//
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
|
||||
[assembly: AssemblyVersion("1.0.*")]
|
||||
|
||||
//
|
||||
// In order to sign your assembly you must specify a key to use. Refer to the
|
||||
// Microsoft .NET Framework documentation for more information on assembly signing.
|
||||
//
|
||||
// Use the attributes below to control which key is used for signing.
|
||||
//
|
||||
// Notes:
|
||||
// (*) If no key is specified, the assembly is not signed.
|
||||
// (*) KeyName refers to a key that has been installed in the Crypto Service
|
||||
// Provider (CSP) on your machine. KeyFile refers to a file which contains
|
||||
// a key.
|
||||
// (*) If the KeyFile and the KeyName values are both specified, the
|
||||
// following processing occurs:
|
||||
// (1) If the KeyName can be found in the CSP, that key is used.
|
||||
// (2) If the KeyName does not exist and the KeyFile does exist, the key
|
||||
// in the KeyFile is installed into the CSP and used.
|
||||
// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
|
||||
// When specifying the KeyFile, the location of the KeyFile should be
|
||||
// relative to the project output directory which is
|
||||
// %Project Directory%\obj\<configuration>. For example, if your KeyFile is
|
||||
// located in the project directory, you would specify the AssemblyKeyFile
|
||||
// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
|
||||
// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
|
||||
// documentation for more information on this.
|
||||
//
|
||||
[assembly: AssemblyDelaySign(false)]
|
||||
[assembly: AssemblyKeyFile("")]
|
||||
[assembly: AssemblyKeyName("")]
|
|
@ -1,116 +0,0 @@
|
|||
<VisualStudioProject>
|
||||
<CSHARP
|
||||
ProjectType = "Local"
|
||||
ProductVersion = "7.0.9466"
|
||||
SchemaVersion = "1.0"
|
||||
ProjectGuid = "{9C1ECC6B-16C7-42B3-BF7C-8BA8D81BA980}"
|
||||
>
|
||||
<Build>
|
||||
<Settings
|
||||
ApplicationIcon = "App.ico"
|
||||
AssemblyKeyContainerName = ""
|
||||
AssemblyName = "TestApp"
|
||||
AssemblyOriginatorKeyFile = ""
|
||||
DefaultClientScript = "JScript"
|
||||
DefaultHTMLPageLayout = "Grid"
|
||||
DefaultTargetSchema = "IE50"
|
||||
DelaySign = "false"
|
||||
OutputType = "WinExe"
|
||||
RootNamespace = "TestApp"
|
||||
StartupObject = ""
|
||||
>
|
||||
<Config
|
||||
Name = "Debug"
|
||||
AllowUnsafeBlocks = "false"
|
||||
BaseAddress = "285212672"
|
||||
CheckForOverflowUnderflow = "false"
|
||||
ConfigurationOverrideFile = ""
|
||||
DefineConstants = "DEBUG;TRACE"
|
||||
DocumentationFile = ""
|
||||
DebugSymbols = "true"
|
||||
FileAlignment = "4096"
|
||||
IncrementalBuild = "true"
|
||||
Optimize = "false"
|
||||
OutputPath = "bin\Debug\"
|
||||
RegisterForComInterop = "false"
|
||||
RemoveIntegerChecks = "false"
|
||||
TreatWarningsAsErrors = "false"
|
||||
WarningLevel = "4"
|
||||
/>
|
||||
<Config
|
||||
Name = "Release"
|
||||
AllowUnsafeBlocks = "false"
|
||||
BaseAddress = "285212672"
|
||||
CheckForOverflowUnderflow = "false"
|
||||
ConfigurationOverrideFile = ""
|
||||
DefineConstants = "TRACE"
|
||||
DocumentationFile = ""
|
||||
DebugSymbols = "false"
|
||||
FileAlignment = "4096"
|
||||
IncrementalBuild = "false"
|
||||
Optimize = "true"
|
||||
OutputPath = "bin\Release\"
|
||||
RegisterForComInterop = "false"
|
||||
RemoveIntegerChecks = "false"
|
||||
TreatWarningsAsErrors = "false"
|
||||
WarningLevel = "4"
|
||||
/>
|
||||
</Settings>
|
||||
<References>
|
||||
<Reference
|
||||
Name = "System"
|
||||
AssemblyName = "System"
|
||||
HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.0.3705\System.dll"
|
||||
/>
|
||||
<Reference
|
||||
Name = "System.Data"
|
||||
AssemblyName = "System.Data"
|
||||
HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.0.3705\System.Data.dll"
|
||||
/>
|
||||
<Reference
|
||||
Name = "System.Drawing"
|
||||
AssemblyName = "System.Drawing"
|
||||
HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.0.3705\System.Drawing.dll"
|
||||
/>
|
||||
<Reference
|
||||
Name = "System.Windows.Forms"
|
||||
AssemblyName = "System.Windows.Forms"
|
||||
HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.0.3705\System.Windows.Forms.dll"
|
||||
/>
|
||||
<Reference
|
||||
Name = "System.XML"
|
||||
AssemblyName = "System.Xml"
|
||||
HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.0.3705\System.XML.dll"
|
||||
/>
|
||||
<Reference
|
||||
Name = "PhysFS.NET"
|
||||
Project = "{C6205A43-3D4D-41E6-872C-96CD7BE55230}"
|
||||
Package = "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}"
|
||||
/>
|
||||
</References>
|
||||
</Build>
|
||||
<Files>
|
||||
<Include>
|
||||
<File
|
||||
RelPath = "App.ico"
|
||||
BuildAction = "Content"
|
||||
/>
|
||||
<File
|
||||
RelPath = "AssemblyInfo.cs"
|
||||
BuildAction = "Compile"
|
||||
/>
|
||||
<File
|
||||
RelPath = "TestAppForm.cs"
|
||||
SubType = "Form"
|
||||
BuildAction = "Compile"
|
||||
/>
|
||||
<File
|
||||
RelPath = "TestAppForm.resx"
|
||||
DependentUpon = "TestAppForm.cs"
|
||||
BuildAction = "EmbeddedResource"
|
||||
/>
|
||||
</Include>
|
||||
</Files>
|
||||
</CSHARP>
|
||||
</VisualStudioProject>
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
Microsoft Visual Studio Solution File, Format Version 7.00
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestApp", "TestApp.csproj", "{9C1ECC6B-16C7-42B3-BF7C-8BA8D81BA980}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PhysFS.NET", "..\PhysFS.NET.csproj", "{C6205A43-3D4D-41E6-872C-96CD7BE55230}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfiguration) = preSolution
|
||||
ConfigName.0 = Debug
|
||||
ConfigName.1 = Release
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectDependencies) = postSolution
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfiguration) = postSolution
|
||||
{9C1ECC6B-16C7-42B3-BF7C-8BA8D81BA980}.Debug.ActiveCfg = Debug|.NET
|
||||
{9C1ECC6B-16C7-42B3-BF7C-8BA8D81BA980}.Debug.Build.0 = Debug|.NET
|
||||
{9C1ECC6B-16C7-42B3-BF7C-8BA8D81BA980}.Release.ActiveCfg = Release|.NET
|
||||
{9C1ECC6B-16C7-42B3-BF7C-8BA8D81BA980}.Release.Build.0 = Release|.NET
|
||||
{C6205A43-3D4D-41E6-872C-96CD7BE55230}.Debug.ActiveCfg = Debug|.NET
|
||||
{C6205A43-3D4D-41E6-872C-96CD7BE55230}.Debug.Build.0 = Debug|.NET
|
||||
{C6205A43-3D4D-41E6-872C-96CD7BE55230}.Release.ActiveCfg = Release|.NET
|
||||
{C6205A43-3D4D-41E6-872C-96CD7BE55230}.Release.Build.0 = Release|.NET
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityAddIns) = postSolution
|
||||
EndGlobalSection
|
||||
EndGlobal
|
|
@ -1,274 +0,0 @@
|
|||
using System;
|
||||
using System.Drawing;
|
||||
using System.Collections;
|
||||
using System.ComponentModel;
|
||||
using System.Windows.Forms;
|
||||
using System.Data;
|
||||
using System.IO;
|
||||
using PhysFS_NET;
|
||||
|
||||
namespace TestApp
|
||||
{
|
||||
/// <summary>
|
||||
/// Summary description for Form1.
|
||||
/// </summary>
|
||||
public class TestAppForm : System.Windows.Forms.Form
|
||||
{
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.Button RefreshCDsButton;
|
||||
private System.Windows.Forms.ListBox CDDrivesList;
|
||||
private System.Windows.Forms.ListBox SearchPathList;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.TextBox EnumFilesPath;
|
||||
private System.Windows.Forms.ListBox EnumList;
|
||||
private System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.TextBox NewSearchPathText;
|
||||
private System.Windows.Forms.Button AddSearchPathButton;
|
||||
private System.Windows.Forms.Button RemovePathButton;
|
||||
private System.Windows.Forms.Button RefreshEnumList;
|
||||
private System.Windows.Forms.Button RefreshSearchPathButton;
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.Container components = null;
|
||||
|
||||
public TestAppForm()
|
||||
{
|
||||
//
|
||||
// Required for Windows Form Designer support
|
||||
//
|
||||
InitializeComponent();
|
||||
|
||||
//
|
||||
// TODO: Add any constructor code after InitializeComponent call
|
||||
//
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
protected override void Dispose( bool disposing )
|
||||
{
|
||||
if( disposing )
|
||||
{
|
||||
if (components != null)
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
}
|
||||
base.Dispose( disposing );
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.RefreshCDsButton = new System.Windows.Forms.Button();
|
||||
this.CDDrivesList = new System.Windows.Forms.ListBox();
|
||||
this.SearchPathList = new System.Windows.Forms.ListBox();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.EnumFilesPath = new System.Windows.Forms.TextBox();
|
||||
this.EnumList = new System.Windows.Forms.ListBox();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.RefreshEnumList = new System.Windows.Forms.Button();
|
||||
this.NewSearchPathText = new System.Windows.Forms.TextBox();
|
||||
this.AddSearchPathButton = new System.Windows.Forms.Button();
|
||||
this.RemovePathButton = new System.Windows.Forms.Button();
|
||||
this.RefreshSearchPathButton = new System.Windows.Forms.Button();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.Location = new System.Drawing.Point(8, 8);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(136, 16);
|
||||
this.label2.TabIndex = 2;
|
||||
this.label2.Text = "Available CD-ROM Drives";
|
||||
//
|
||||
// RefreshCDsButton
|
||||
//
|
||||
this.RefreshCDsButton.Location = new System.Drawing.Point(8, 152);
|
||||
this.RefreshCDsButton.Name = "RefreshCDsButton";
|
||||
this.RefreshCDsButton.Size = new System.Drawing.Size(72, 24);
|
||||
this.RefreshCDsButton.TabIndex = 4;
|
||||
this.RefreshCDsButton.Text = "Refresh";
|
||||
this.RefreshCDsButton.Click += new System.EventHandler(this.RefreshCDsButton_Click);
|
||||
//
|
||||
// CDDrivesList
|
||||
//
|
||||
this.CDDrivesList.Location = new System.Drawing.Point(8, 24);
|
||||
this.CDDrivesList.Name = "CDDrivesList";
|
||||
this.CDDrivesList.Size = new System.Drawing.Size(136, 121);
|
||||
this.CDDrivesList.TabIndex = 7;
|
||||
//
|
||||
// SearchPathList
|
||||
//
|
||||
this.SearchPathList.Location = new System.Drawing.Point(152, 24);
|
||||
this.SearchPathList.Name = "SearchPathList";
|
||||
this.SearchPathList.Size = new System.Drawing.Size(248, 95);
|
||||
this.SearchPathList.TabIndex = 8;
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.Location = new System.Drawing.Point(152, 8);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(136, 16);
|
||||
this.label1.TabIndex = 10;
|
||||
this.label1.Text = "Search Path";
|
||||
//
|
||||
// EnumFilesPath
|
||||
//
|
||||
this.EnumFilesPath.Location = new System.Drawing.Point(408, 128);
|
||||
this.EnumFilesPath.Name = "EnumFilesPath";
|
||||
this.EnumFilesPath.Size = new System.Drawing.Size(208, 20);
|
||||
this.EnumFilesPath.TabIndex = 11;
|
||||
this.EnumFilesPath.Text = "";
|
||||
//
|
||||
// EnumList
|
||||
//
|
||||
this.EnumList.Location = new System.Drawing.Point(408, 24);
|
||||
this.EnumList.Name = "EnumList";
|
||||
this.EnumList.Size = new System.Drawing.Size(208, 95);
|
||||
this.EnumList.TabIndex = 12;
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.Location = new System.Drawing.Point(408, 8);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(136, 16);
|
||||
this.label3.TabIndex = 13;
|
||||
this.label3.Text = "Enumerate Files";
|
||||
//
|
||||
// RefreshEnumList
|
||||
//
|
||||
this.RefreshEnumList.Location = new System.Drawing.Point(544, 152);
|
||||
this.RefreshEnumList.Name = "RefreshEnumList";
|
||||
this.RefreshEnumList.Size = new System.Drawing.Size(72, 24);
|
||||
this.RefreshEnumList.TabIndex = 14;
|
||||
this.RefreshEnumList.Text = "Refresh";
|
||||
this.RefreshEnumList.Click += new System.EventHandler(this.RefreshEnumList_Click);
|
||||
//
|
||||
// NewSearchPathText
|
||||
//
|
||||
this.NewSearchPathText.Location = new System.Drawing.Point(152, 128);
|
||||
this.NewSearchPathText.Name = "NewSearchPathText";
|
||||
this.NewSearchPathText.Size = new System.Drawing.Size(248, 20);
|
||||
this.NewSearchPathText.TabIndex = 15;
|
||||
this.NewSearchPathText.Text = "";
|
||||
//
|
||||
// AddSearchPathButton
|
||||
//
|
||||
this.AddSearchPathButton.Location = new System.Drawing.Point(152, 152);
|
||||
this.AddSearchPathButton.Name = "AddSearchPathButton";
|
||||
this.AddSearchPathButton.Size = new System.Drawing.Size(72, 24);
|
||||
this.AddSearchPathButton.TabIndex = 9;
|
||||
this.AddSearchPathButton.Text = "Add Path";
|
||||
this.AddSearchPathButton.Click += new System.EventHandler(this.AddSearchPathButton_Click);
|
||||
//
|
||||
// RemovePathButton
|
||||
//
|
||||
this.RemovePathButton.Location = new System.Drawing.Point(232, 152);
|
||||
this.RemovePathButton.Name = "RemovePathButton";
|
||||
this.RemovePathButton.Size = new System.Drawing.Size(88, 24);
|
||||
this.RemovePathButton.TabIndex = 16;
|
||||
this.RemovePathButton.Text = "Remove Path";
|
||||
this.RemovePathButton.Click += new System.EventHandler(this.RemovePathButton_Click);
|
||||
//
|
||||
// RefreshSearchPathButton
|
||||
//
|
||||
this.RefreshSearchPathButton.Location = new System.Drawing.Point(328, 152);
|
||||
this.RefreshSearchPathButton.Name = "RefreshSearchPathButton";
|
||||
this.RefreshSearchPathButton.Size = new System.Drawing.Size(72, 24);
|
||||
this.RefreshSearchPathButton.TabIndex = 17;
|
||||
this.RefreshSearchPathButton.Text = "Refresh";
|
||||
this.RefreshSearchPathButton.Click += new System.EventHandler(this.RefreshSearchPathButton_Click);
|
||||
//
|
||||
// TestAppForm
|
||||
//
|
||||
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
|
||||
this.ClientSize = new System.Drawing.Size(624, 309);
|
||||
this.Controls.AddRange(new System.Windows.Forms.Control[] {
|
||||
this.RefreshSearchPathButton,
|
||||
this.RemovePathButton,
|
||||
this.NewSearchPathText,
|
||||
this.RefreshEnumList,
|
||||
this.label3,
|
||||
this.EnumList,
|
||||
this.EnumFilesPath,
|
||||
this.label1,
|
||||
this.SearchPathList,
|
||||
this.CDDrivesList,
|
||||
this.RefreshCDsButton,
|
||||
this.label2,
|
||||
this.AddSearchPathButton});
|
||||
this.Name = "TestAppForm";
|
||||
this.Text = "PhysFS Test Application";
|
||||
this.Load += new System.EventHandler(this.TestAppForm_Load);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// The main entry point for the application.
|
||||
/// </summary>
|
||||
[STAThread]
|
||||
static void Main()
|
||||
{
|
||||
Application.Run(new TestAppForm());
|
||||
}
|
||||
|
||||
private void TestAppForm_Load(object sender, System.EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void RefreshCDsButton_Click(object sender, System.EventArgs e)
|
||||
{
|
||||
// Clear ths listbox if it contains any items
|
||||
CDDrivesList.Items.Clear();
|
||||
// Add the items to the list
|
||||
CDDrivesList.Items.AddRange(PhysFS.GetCDROMDrives());
|
||||
}
|
||||
|
||||
private void RefreshSearchPathButton_Click(object sender, System.EventArgs e)
|
||||
{
|
||||
// Clear ths listbox if it contains any items
|
||||
SearchPathList.Items.Clear();
|
||||
// Add the items to the list
|
||||
SearchPathList.Items.AddRange(PhysFS.GetSearchPath());
|
||||
}
|
||||
|
||||
private void AddSearchPathButton_Click(object sender, System.EventArgs e)
|
||||
{
|
||||
// Add search path
|
||||
PhysFS.AddToSearchPath(NewSearchPathText.Text, false);
|
||||
// Clear ths listbox if it contains any items
|
||||
SearchPathList.Items.Clear();
|
||||
// Add the items to the list
|
||||
SearchPathList.Items.AddRange(PhysFS.GetSearchPath());
|
||||
}
|
||||
|
||||
private void RemovePathButton_Click(object sender, System.EventArgs e)
|
||||
{
|
||||
if(SearchPathList.SelectedItem != null)
|
||||
{
|
||||
PhysFS.RemoveFromSearchPath(SearchPathList.SelectedItem.ToString());
|
||||
// Clear ths listbox if it contains any items
|
||||
SearchPathList.Items.Clear();
|
||||
// Add the items to the list
|
||||
SearchPathList.Items.AddRange(PhysFS.GetSearchPath());
|
||||
}
|
||||
}
|
||||
|
||||
private void RefreshEnumList_Click(object sender, System.EventArgs e)
|
||||
{
|
||||
EnumList.Items.Clear();
|
||||
EnumList.Items.AddRange(PhysFS.EnumerateFiles(EnumFilesPath.Text));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,102 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 1.3
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">1.3</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1">this is my long string</data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
[base64 mime encoded serialized .NET Framework object]
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
[base64 mime encoded string representing a byte array form of the .NET Framework object]
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>1.3</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="$this.Name">
|
||||
<value>TestAppForm</value>
|
||||
</data>
|
||||
</root>
|
|
@ -0,0 +1,11 @@
|
|||
There used to be C# bindings in this directory, but they have been
|
||||
unmaintained for many years.
|
||||
|
||||
Instead, there is a more modern PhysicsFS wrapper for .NET available.
|
||||
|
||||
You can find it at https://github.com/frabert/SharpPhysFS
|
||||
|
||||
Thanks to Francesco Bertolaccini for his efforts on that project!
|
||||
|
||||
--ryan.
|
||||
|
|
@ -92,7 +92,7 @@ from the Author.
|
|||
#ifdef USE_PHYSFS
|
||||
|
||||
#include <physfs.h>
|
||||
#define MY_FILETYPE PHYSFS_file
|
||||
#define MY_FILETYPE PHYSFS_File
|
||||
#define MY_SETBUFFER(fp,size) PHYSFS_setBuffer(fp,size)
|
||||
#define MY_READ(p,s,n,fp) PHYSFS_read(fp,p,s,n)
|
||||
#if PHYSFS_DEFAULT_READ_BUFFER
|
||||
|
|
|
@ -0,0 +1,59 @@
|
|||
#!/bin/bash
|
||||
|
||||
# This is a script used by some Buildbot workers to push the project
|
||||
# through Clang's static analyzer and prepare the output to be uploaded
|
||||
# back to the buildmaster. You might find it useful too.
|
||||
|
||||
# Install Clang (you already have it on Mac OS X, apt-get install clang
|
||||
# on Ubuntu, etc), Make sure "scan-build" is in your $PATH.
|
||||
|
||||
FINALDIR="$1"
|
||||
|
||||
set -x
|
||||
set -e
|
||||
|
||||
cd `dirname "$0"`
|
||||
cd ..
|
||||
|
||||
rm -rf checker-buildbot analysis
|
||||
if [ ! -z "$FINALDIR" ]; then
|
||||
rm -rf "$FINALDIR"
|
||||
fi
|
||||
|
||||
mkdir checker-buildbot
|
||||
cd checker-buildbot
|
||||
|
||||
# We turn off deprecated declarations, because we don't care about these warnings during static analysis.
|
||||
# The -Wno-liblto is new since our checker-279 upgrade, I think; checker otherwise warns "libLTO.dylib relative to clang installed dir not found"
|
||||
|
||||
# You might want to do this for CMake-backed builds instead...
|
||||
scan-build -o analysis cmake -G Ninja -Wno-dev -DPHYSFS_BUILD_SHARED=False -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_FLAGS="-Wno-deprecated-declarations" -DCMAKE_EXE_LINKER_FLAGS="-Wno-liblto" ..
|
||||
|
||||
rm -rf analysis
|
||||
scan-build -o analysis cmake --build . --config Debug
|
||||
|
||||
if [ `ls -A analysis |wc -l` == 0 ] ; then
|
||||
mkdir analysis/zarro
|
||||
echo '<html><head><title>Zarro boogs</title></head><body>Static analysis: no issues to report.</body></html>' >analysis/zarro/index.html
|
||||
fi
|
||||
|
||||
mv analysis/* ../analysis
|
||||
rmdir analysis # Make sure this is empty.
|
||||
cd ..
|
||||
chmod -R a+r analysis
|
||||
chmod -R go-w analysis
|
||||
find analysis -type d -exec chmod a+x {} \;
|
||||
if [ -x /usr/bin/xattr ]; then find analysis -exec /usr/bin/xattr -d com.apple.quarantine {} \; 2>/dev/null ; fi
|
||||
|
||||
if [ ! -z "$FINALDIR" ]; then
|
||||
mv analysis "$FINALDIR"
|
||||
else
|
||||
FINALDIR=analysis
|
||||
fi
|
||||
|
||||
rm -rf checker-buildbot
|
||||
|
||||
echo "Done. Final output is in '$FINALDIR' ..."
|
||||
|
||||
# end of checker-buildbot.sh ...
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
#!/bin/bash
|
||||
|
||||
if [ -z "$SDKDIR" ]; then
|
||||
SDKDIR="/emsdk"
|
||||
fi
|
||||
|
||||
ENVSCRIPT="$SDKDIR/emsdk_env.sh"
|
||||
if [ ! -f "$ENVSCRIPT" ]; then
|
||||
echo "ERROR: This script expects the Emscripten SDK to be in '$SDKDIR'." 1>&2
|
||||
echo "ERROR: Set the \$SDKDIR environment variable to override this." 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
TARBALL="$1"
|
||||
if [ -z $1 ]; then
|
||||
TARBALL=physfs-emscripten.tar.xz
|
||||
fi
|
||||
|
||||
cd `dirname "$0"`
|
||||
cd ..
|
||||
PHYSFSBASE=`pwd`
|
||||
|
||||
echo "Setting up Emscripten SDK environment..."
|
||||
source "$ENVSCRIPT"
|
||||
|
||||
echo "Setting up..."
|
||||
cd "$PHYSFSBASE"
|
||||
rm -rf buildbot
|
||||
mkdir buildbot
|
||||
cd buildbot
|
||||
|
||||
echo "Configuring..."
|
||||
emcmake cmake -G "Ninja" -DPHYSFS_BUILD_SHARED=False -DCMAKE_BUILD_TYPE=MinSizeRel .. || exit $?
|
||||
|
||||
echo "Building..."
|
||||
emmake cmake --build . --config MinSizeRel || exit $?
|
||||
|
||||
set -e
|
||||
rm -rf "$TARBALL" physfs-emscripten
|
||||
mkdir -p physfs-emscripten
|
||||
echo "Archiving to '$TARBALL' ..."
|
||||
cp ../src/physfs.h libphysfs.a physfs-emscripten
|
||||
chmod -R a+r physfs-emscripten
|
||||
chmod a+x physfs-emscripten
|
||||
chmod -R go-w physfs-emscripten
|
||||
tar -cJvvf "$TARBALL" physfs-emscripten
|
||||
echo "Done."
|
||||
|
||||
exit 0
|
||||
|
||||
# end of emscripten-buildbot.sh ...
|
||||
|
|
@ -0,0 +1,87 @@
|
|||
#!/bin/bash
|
||||
|
||||
# This is used by the buildbot to cross-compile for OS/2 from Linux, using
|
||||
# OpenWatcom. In an ideal world, we wouldn't need this, but we need a few
|
||||
# things to do this "properly" ...
|
||||
#
|
||||
# - OS/2 running as a VMware guest on the build machine
|
||||
# - Buildbot-worker running on that OS/2 guest
|
||||
# - CMake for OS/2 that...
|
||||
# - ... has Open Watcom compiler support and...
|
||||
# - ... a Watcom WMake project generator.
|
||||
#
|
||||
# Some of these things are doable (there is a CMake port for OS/2, you can
|
||||
# use GCC with it), but since OpenWatcom will just target OS/2 on Linux just
|
||||
# like it could on OS/2, it's easier and more efficient to just have a
|
||||
# buildbot script compile it here.
|
||||
#
|
||||
# Note that we just blast all the C files through the wcc386 compiler and
|
||||
# skip CMake entirely. We should fix this at some point.
|
||||
|
||||
set -e
|
||||
|
||||
ZIPFILE="$1"
|
||||
if [ -z $ZIPFILE ]; then
|
||||
ZIPFILE=physfs-os2.zip
|
||||
fi
|
||||
|
||||
export WATCOM="/usr/local/share/watcom"
|
||||
export PATH="$PATH:$WATCOM/binl"
|
||||
|
||||
CFLAGS="-i=\"$WATCOM/h;$WATCOM/h/os2;../src\" -wx -d0 -otexan -6r -zq -bt=os2 -fo=.obj -mf"
|
||||
WLIBFLAGS="-b -c -n -q -p=512"
|
||||
|
||||
cd `dirname "$0"`
|
||||
cd ..
|
||||
mkdir -p buildbot
|
||||
cd buildbot
|
||||
|
||||
rm -f test_physfs.obj
|
||||
|
||||
OKAY="1"
|
||||
for src in ../src/*.c ; do
|
||||
echo wcc386 $src $CFLAGS
|
||||
wcc386 $src $CFLAGS || OKAY="0"
|
||||
done
|
||||
|
||||
if [ "$OKAY" == "1" ]; then
|
||||
echo wlib $WLIBFLAGS physfs.lib *.obj
|
||||
wlib $WLIBFLAGS physfs.lib *.obj || OKAY="0"
|
||||
fi
|
||||
|
||||
echo wcc386 ../test/test_physfs.c $CFLAGS
|
||||
wcc386 ../test/test_physfs.c $CFLAGS || OKAY="0"
|
||||
|
||||
if [ "$OKAY" == "1" ]; then
|
||||
LDFLAGS="name test_physfs d all sys os2v2 op m libr physfs op q op symf FIL test_physfs.obj"
|
||||
echo wlink $LDFLAGS
|
||||
wlink $LDFLAGS || OKAY="0"
|
||||
fi
|
||||
|
||||
if [ "$OKAY" == "1" ]; then
|
||||
F=`file test_physfs.exe`
|
||||
echo "$F"
|
||||
if [ "$F" != 'test_physfs.exe: MS-DOS executable, LX for OS/2 (console) i80386' ]; then
|
||||
echo 1>&2 "ERROR: final binary doesn't appear to be OS/2 executable."
|
||||
OKAY=0
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$OKAY" == "1" ]; then
|
||||
echo 1>&2 "Build succeeded."
|
||||
set -e
|
||||
rm -rf "$ZIPFILE" physfs-os2
|
||||
mkdir -p physfs-os2
|
||||
echo "Zipping to '$ZIPFILE' ..."
|
||||
cp ../src/physfs.h physfs.lib physfs-os2
|
||||
chmod -R a+r physfs-os2
|
||||
chmod a+x physfs-os2
|
||||
chmod -R go-w physfs-os2
|
||||
zip -9r "$ZIPFILE" physfs-os2
|
||||
echo "Done."
|
||||
exit 0
|
||||
else
|
||||
echo 1>&2 "Build failed."
|
||||
exit 1
|
||||
fi
|
||||
|
|
@ -0,0 +1,56 @@
|
|||
#!/bin/bash
|
||||
|
||||
# This is the script physfs-buildbot.icculus.org uses to cross-compile
|
||||
# PhysicsFS from x86 Linux to Raspberry Pi. This script was originally from
|
||||
# Simple Directmedia Layer ( https://www.libsdl.org/ ).
|
||||
|
||||
# The final tarball can be unpacked in the root directory of a RPi,
|
||||
# so the PhysicsFS install lands in /usr/local. Run ldconfig, and then
|
||||
# you should be able to build and run PhysicsFS-based software on your
|
||||
# Pi. Standard configure scripts should be able to find PhysicsFS and
|
||||
# build against it.
|
||||
|
||||
TARBALL="$1"
|
||||
if [ -z $1 ]; then
|
||||
TARBALL=physfs-raspberrypi.tar.xz
|
||||
fi
|
||||
|
||||
BUILDBOTDIR="buildbot"
|
||||
PARENTDIR="$PWD"
|
||||
|
||||
set -e
|
||||
set -x
|
||||
rm -f $TARBALL
|
||||
rm -rf $BUILDBOTDIR
|
||||
mkdir -p $BUILDBOTDIR
|
||||
pushd $BUILDBOTDIR
|
||||
|
||||
# the '-G "Ninja"' can be '-G "Unix Makefiles"' if you prefer to use GNU Make.
|
||||
SYSROOT="/opt/rpi-sysroot"
|
||||
cmake -G "Ninja" \
|
||||
-DCMAKE_C_COMPILER="/opt/rpi-tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-gcc" \
|
||||
-DCMAKE_BUILD_TYPE=MinSizeRel \
|
||||
-DCMAKE_SYSROOT="$SYSROOT" \
|
||||
-DCMAKE_FIND_ROOT_PATH="$SYSROOT" \
|
||||
-DCMAKE_SYSTEM_NAME="Linux" \
|
||||
-DCMAKE_SYSTEM_VERSION=1 \
|
||||
-DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER \
|
||||
-DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY \
|
||||
-DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY \
|
||||
..
|
||||
|
||||
cmake --build . --config MinSizeRel
|
||||
|
||||
rm -rf "$TARBALL" physfs-raspberrypi
|
||||
mkdir -p physfs-raspberrypi
|
||||
echo "Archiving to '$TARBALL' ..."
|
||||
cp -a ../src/physfs.h libphysfs.a libphysfs.so* physfs-raspberrypi
|
||||
chmod -R a+r physfs-raspberrypi
|
||||
chmod a+x physfs-raspberrypi physfs-raspberrypi/*.so*
|
||||
chmod -R go-w physfs-raspberrypi
|
||||
tar -cJvvf "$TARBALL" physfs-raspberrypi
|
||||
|
||||
set +x
|
||||
echo "Done."
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
|
@ -4,8 +4,8 @@
|
|||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include "physfs.h"
|
||||
#include "globbing.h"
|
||||
|
||||
/**
|
||||
|
@ -22,7 +22,7 @@
|
|||
* NO WARRANTY.
|
||||
*
|
||||
* Unless otherwise stated, the rest of PhysicsFS falls under the zlib license.
|
||||
* Please see LICENSE in the root of the source tree.
|
||||
* Please see the file LICENSE.txt in the source's root directory.
|
||||
*
|
||||
* \author Ryan C. Gordon.
|
||||
*/
|
||||
|
@ -77,38 +77,118 @@ static int matchesPattern(const char *fname, const char *wildcard,
|
|||
fnameptr++;
|
||||
|
||||
if (x != y)
|
||||
return(0);
|
||||
return 0;
|
||||
} /* else */
|
||||
} /* while */
|
||||
|
||||
while (*wildptr == '*')
|
||||
wildptr++;
|
||||
|
||||
return(*fnameptr == *wildptr);
|
||||
return (*fnameptr == *wildptr);
|
||||
} /* matchesPattern */
|
||||
|
||||
typedef struct
|
||||
{
|
||||
const PHYSFS_Allocator *allocator;
|
||||
const char *wildcard;
|
||||
int caseSensitive;
|
||||
PHYSFS_EnumFilesCallback callback;
|
||||
void *origData;
|
||||
} WildcardCallbackData;
|
||||
|
||||
|
||||
/*
|
||||
* This callback sits between the enumerator and the enduser callback,
|
||||
* filtering out files that don't match the wildcard pattern.
|
||||
*/
|
||||
static void wildcardCallback(void *_d, const char *origdir, const char *fname)
|
||||
{
|
||||
const WildcardCallbackData *data = (const WildcardCallbackData *) _d;
|
||||
if (matchesPattern(fname, data->wildcard, data->caseSensitive))
|
||||
data->callback(data->origData, origdir, fname);
|
||||
} /* wildcardCallback */
|
||||
|
||||
|
||||
void PHYSFSEXT_enumerateFilesCallbackWildcard(const char *dir,
|
||||
const char *wildcard,
|
||||
int caseSensitive,
|
||||
PHYSFS_EnumFilesCallback c,
|
||||
void *d)
|
||||
{
|
||||
WildcardCallbackData data;
|
||||
data.allocator = PHYSFS_getAllocator();
|
||||
data.wildcard = wildcard;
|
||||
data.caseSensitive = caseSensitive;
|
||||
data.callback = c;
|
||||
data.origData = d;
|
||||
PHYSFS_enumerateFilesCallback(dir, wildcardCallback, &data);
|
||||
} /* PHYSFSEXT_enumerateFilesCallbackWildcard */
|
||||
|
||||
|
||||
void PHYSFSEXT_freeEnumeration(char **list)
|
||||
{
|
||||
const PHYSFS_Allocator *allocator = PHYSFS_getAllocator();
|
||||
int i;
|
||||
if (list != NULL)
|
||||
{
|
||||
for (i = 0; list[i] != NULL; i++)
|
||||
allocator->Free(list[i]);
|
||||
allocator->Free(list);
|
||||
} /* if */
|
||||
} /* PHYSFSEXT_freeEnumeration */
|
||||
|
||||
|
||||
char **PHYSFSEXT_enumerateFilesWildcard(const char *dir, const char *wildcard,
|
||||
int caseSensitive)
|
||||
{
|
||||
char **rc = PHYSFS_enumerateFiles(dir);
|
||||
char **i = rc;
|
||||
char **j;
|
||||
const PHYSFS_Allocator *allocator = PHYSFS_getAllocator();
|
||||
char **list = PHYSFS_enumerateFiles(dir);
|
||||
char **retval = NULL;
|
||||
int totalmatches = 0;
|
||||
int matches = 0;
|
||||
char **i;
|
||||
|
||||
while (*i != NULL)
|
||||
for (i = list; *i != NULL; i++)
|
||||
{
|
||||
#if 0
|
||||
printf("matchesPattern: '%s' vs '%s' (%s) ... %s\n", *i, wildcard,
|
||||
caseSensitive ? "case" : "nocase",
|
||||
matchesPattern(*i, wildcard, caseSensitive) ? "true" : "false");
|
||||
#endif
|
||||
if (matchesPattern(*i, wildcard, caseSensitive))
|
||||
i++;
|
||||
else
|
||||
{
|
||||
/* FIXME: This counts on physfs's allocation method not changing! */
|
||||
free(*i);
|
||||
for (j = i; *j != NULL; j++)
|
||||
j[0] = j[1];
|
||||
} /* else */
|
||||
totalmatches++;
|
||||
} /* for */
|
||||
|
||||
return(rc);
|
||||
retval = (char **) allocator->Malloc(sizeof (char *) * (totalmatches+1));
|
||||
if (retval != NULL)
|
||||
{
|
||||
for (i = list; ((matches < totalmatches) && (*i != NULL)); i++)
|
||||
{
|
||||
if (matchesPattern(*i, wildcard, caseSensitive))
|
||||
{
|
||||
retval[matches] = (char *) allocator->Malloc(strlen(*i) + 1);
|
||||
if (retval[matches] == NULL)
|
||||
{
|
||||
while (matches--)
|
||||
allocator->Free(retval[matches]);
|
||||
allocator->Free(retval);
|
||||
retval = NULL;
|
||||
break;
|
||||
} /* if */
|
||||
strcpy(retval[matches], *i);
|
||||
matches++;
|
||||
} /* if */
|
||||
} /* for */
|
||||
|
||||
if (retval != NULL)
|
||||
{
|
||||
assert(totalmatches == matches);
|
||||
retval[matches] = NULL;
|
||||
} /* if */
|
||||
} /* if */
|
||||
|
||||
PHYSFS_freeList(list);
|
||||
return retval;
|
||||
} /* PHYSFSEXT_enumerateFilesWildcard */
|
||||
|
||||
|
||||
|
@ -123,20 +203,20 @@ int main(int argc, char **argv)
|
|||
{
|
||||
printf("USAGE: %s <pattern> <caseSen>\n"
|
||||
" where <caseSen> is 1 or 0.\n", argv[0]);
|
||||
return(1);
|
||||
return 1;
|
||||
} /* if */
|
||||
|
||||
if (!PHYSFS_init(argv[0]))
|
||||
{
|
||||
fprintf(stderr, "PHYSFS_init(): %s\n", PHYSFS_getLastError());
|
||||
return(1);
|
||||
fprintf(stderr, "PHYSFS_init(): %s\n", PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()));
|
||||
return 1;
|
||||
} /* if */
|
||||
|
||||
if (!PHYSFS_addToSearchPath(".", 1))
|
||||
{
|
||||
fprintf(stderr, "PHYSFS_addToSearchPath(): %s\n", PHYSFS_getLastError());
|
||||
fprintf(stderr, "PHYSFS_addToSearchPath(): %s\n", PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()));
|
||||
PHYSFS_deinit();
|
||||
return(1);
|
||||
return 1;
|
||||
} /* if */
|
||||
|
||||
flist = PHYSFSEXT_enumerateFilesWildcard("/", argv[1], atoi(argv[2]));
|
||||
|
@ -148,10 +228,10 @@ int main(int argc, char **argv)
|
|||
} /* for */
|
||||
printf("\n total %d files.\n\n", rc);
|
||||
|
||||
PHYSFS_freeList(flist);
|
||||
PHYSFSEXT_freeEnumeration(flist);
|
||||
PHYSFS_deinit();
|
||||
|
||||
return(0);
|
||||
return 0;
|
||||
} /* main */
|
||||
#endif
|
||||
|
||||
|
|
|
@ -1,5 +1,10 @@
|
|||
#ifndef INCL_PHYSFSEXT_GLOBBING_H
|
||||
#define INCL_PHYSFSEXT_GLOBBING_H
|
||||
|
||||
/** \file globbing.h */
|
||||
|
||||
#include "physfs.h"
|
||||
|
||||
/**
|
||||
* \mainpage PhysicsFS globbing
|
||||
*
|
||||
|
@ -9,10 +14,10 @@
|
|||
* locating matching entries.
|
||||
*
|
||||
* Usage: Set up PhysicsFS as you normally would, then use
|
||||
* PHYSFSEXT_enumerateFilesPattern() when enumerating files. This is just
|
||||
* PHYSFSEXT_enumerateFilesWildcard() when enumerating files. This is just
|
||||
* like PHYSFS_enumerateFiles(), but it returns a subset that matches your
|
||||
* wildcard pattern. You must call PHYSFS_freeList() on the results, just
|
||||
* like you would with PHYSFS_enumerateFiles().
|
||||
* wildcard pattern. You must call PHYSFSEXT_freeEnumeration() on the results,
|
||||
* just PHYSFS_enumerateFiles() would do with PHYSFS_freeList().
|
||||
*
|
||||
* License: this code is public domain. I make no warranty that it is useful,
|
||||
* correct, harmless, or environmentally safe.
|
||||
|
@ -25,15 +30,18 @@
|
|||
* NO WARRANTY.
|
||||
*
|
||||
* Unless otherwise stated, the rest of PhysicsFS falls under the zlib license.
|
||||
* Please see LICENSE in the root of the source tree.
|
||||
* Please see LICENSE.txt in the source's "docs" directory.
|
||||
*
|
||||
* \author Ryan C. Gordon.
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* \fn char **PHYSFS_enumerateFilesWildcard(const char *dir, const char *wildcard, int caseSensitive)
|
||||
* \brief Get a file listing of a search path's directory.
|
||||
* \brief Get a file listing of a search path's directory, filtered with a wildcard pattern.
|
||||
*
|
||||
* Matching directories are interpolated. That is, if "C:\mydir" is in the
|
||||
* search path and contains a directory "savegames" that contains "x.sav",
|
||||
|
@ -63,15 +71,95 @@
|
|||
* Wildcard strings can use the '*' and '?' characters, currently.
|
||||
* Matches can be case-insensitive if you pass a zero for argument 3.
|
||||
*
|
||||
* Don't forget to call PHYSFS_freeList() with the return value from this
|
||||
* function when you are done with it.
|
||||
* Don't forget to call PHYSFSEXT_freeEnumerator() with the return value from
|
||||
* this function when you are done with it. As we use PhysicsFS's allocator
|
||||
* for this list, you must free it before calling PHYSFS_deinit().
|
||||
* Do not use PHYSFS_freeList() on the returned value!
|
||||
*
|
||||
* \param dir directory in platform-independent notation to enumerate.
|
||||
* \param wildcard Wildcard pattern to use for filtering.
|
||||
* \param caseSensitive Zero for case-insensitive matching,
|
||||
* non-zero for case-sensitive.
|
||||
* \return Null-terminated array of null-terminated strings.
|
||||
*
|
||||
* \sa PHYSFSEXT_freeEnumeration
|
||||
*/
|
||||
__EXPORT__ char **PHYSFSEXT_enumerateFilesWildcard(const char *dir,
|
||||
PHYSFS_DECL char **PHYSFSEXT_enumerateFilesWildcard(const char *dir,
|
||||
const char *wildcard,
|
||||
int caseSensitive);
|
||||
|
||||
/**
|
||||
* \fn void PHYSFSEXT_freeEnumeration(char **list)
|
||||
* \brief Free data returned by PHYSFSEXT_enumerateFilesWildcard
|
||||
*
|
||||
* Conceptually, this works like PHYSFS_freeList(), but is used with data
|
||||
* returned by PHYSFSEXT_enumerateFilesWildcard() only. Be sure to call this
|
||||
* on any returned data from that function before
|
||||
*
|
||||
* \param list Pointer previously returned by
|
||||
* PHYSFSEXT_enumerateFilesWildcard(). It is safe to pass a
|
||||
* NULL here.
|
||||
*
|
||||
* \sa PHYSFSEXT_enumerateFilesWildcard
|
||||
*/
|
||||
PHYSFS_DECL void PHYSFSEXT_freeEnumeration(char **list);
|
||||
|
||||
|
||||
/**
|
||||
* \fn void PHYSFSEXT_enumerateFilesCallbackWildcard(const char *dir, const char *wildcard, int caseSensitive, PHYSFS_EnumFilesCallback c, void *d);
|
||||
* \brief Get a file listing of a search path's directory, filtered with a wildcard pattern, using an application-defined callback.
|
||||
*
|
||||
* This function is equivalent to PHYSFSEXT_enumerateFilesWildcard(). It
|
||||
* reports file listings, filtered by a wildcard pattern.
|
||||
*
|
||||
* Unlike PHYSFS_enumerateFiles(), this function does not return an array.
|
||||
* Rather, it calls a function specified by the application once per
|
||||
* element of the search path:
|
||||
*
|
||||
* \code
|
||||
*
|
||||
* static void printDir(void *data, const char *origdir, const char *fname)
|
||||
* {
|
||||
* printf(" * We've got [%s] in [%s].\n", fname, origdir);
|
||||
* }
|
||||
*
|
||||
* // ...
|
||||
* PHYSFS_enumerateFilesCallbackWildcard("savegames","*.sav",0,printDir,NULL);
|
||||
* \endcode
|
||||
*
|
||||
* Items sent to the callback are not guaranteed to be in any order whatsoever.
|
||||
* There is no sorting done at this level, and if you need that, you should
|
||||
* probably use PHYSFS_enumerateFilesWildcard() instead, which guarantees
|
||||
* alphabetical sorting. This form reports whatever is discovered in each
|
||||
* archive before moving on to the next. Even within one archive, we can't
|
||||
* guarantee what order it will discover data. <em>Any sorting you find in
|
||||
* these callbacks is just pure luck. Do not rely on it.</em> As this walks
|
||||
* the entire list of archives, you may receive duplicate filenames.
|
||||
*
|
||||
* Wildcard strings can use the '*' and '?' characters, currently.
|
||||
* Matches can be case-insensitive if you pass a zero for argument 3.
|
||||
*
|
||||
* \param dir Directory, in platform-independent notation, to enumerate.
|
||||
* \param wildcard Wildcard pattern to use for filtering.
|
||||
* \param caseSensitive Zero for case-insensitive matching,
|
||||
* non-zero for case-sensitive.
|
||||
* \param c Callback function to notify about search path elements.
|
||||
* \param d Application-defined data passed to callback. Can be NULL.
|
||||
*
|
||||
* \sa PHYSFS_EnumFilesCallback
|
||||
* \sa PHYSFS_enumerateFiles
|
||||
*/
|
||||
PHYSFS_DECL void PHYSFSEXT_enumerateFilesCallbackWildcard(const char *dir,
|
||||
const char *wildcard,
|
||||
int caseSensitive,
|
||||
PHYSFS_EnumFilesCallback c,
|
||||
void *d);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* include-once blocker. */
|
||||
|
||||
/* end of globbing.h ... */
|
||||
|
||||
|
|
|
@ -22,29 +22,11 @@
|
|||
* NO WARRANTY.
|
||||
*
|
||||
* Unless otherwise stated, the rest of PhysicsFS falls under the zlib license.
|
||||
* Please see LICENSE in the root of the source tree.
|
||||
* Please see LICENSE.txt in the root of the source tree.
|
||||
*
|
||||
* \author Ryan C. Gordon.
|
||||
*/
|
||||
|
||||
/* I'm not screwing around with stricmp vs. strcasecmp... */
|
||||
static int caseInsensitiveStringCompare(const char *x, const char *y)
|
||||
{
|
||||
int ux, uy;
|
||||
do
|
||||
{
|
||||
ux = toupper((int) *x);
|
||||
uy = toupper((int) *y);
|
||||
if (ux != uy)
|
||||
return((ux > uy) ? 1 : -1);
|
||||
x++;
|
||||
y++;
|
||||
} while ((ux) && (uy));
|
||||
|
||||
return(0);
|
||||
} /* caseInsensitiveStringCompare */
|
||||
|
||||
|
||||
static int locateOneElement(char *buf)
|
||||
{
|
||||
char *ptr;
|
||||
|
@ -52,7 +34,7 @@ static int locateOneElement(char *buf)
|
|||
char **i;
|
||||
|
||||
if (PHYSFS_exists(buf))
|
||||
return(1); /* quick rejection: exists in current case. */
|
||||
return 1; /* quick rejection: exists in current case. */
|
||||
|
||||
ptr = strrchr(buf, '/'); /* find entry at end of path. */
|
||||
if (ptr == NULL)
|
||||
|
@ -68,19 +50,23 @@ static int locateOneElement(char *buf)
|
|||
ptr++; /* point past dirsep to entry itself. */
|
||||
} /* else */
|
||||
|
||||
for (i = rc; *i != NULL; i++)
|
||||
if (rc != NULL)
|
||||
{
|
||||
if (caseInsensitiveStringCompare(*i, ptr) == 0)
|
||||
for (i = rc; *i != NULL; i++)
|
||||
{
|
||||
strcpy(ptr, *i); /* found a match. Overwrite with this case. */
|
||||
PHYSFS_freeList(rc);
|
||||
return(1);
|
||||
} /* if */
|
||||
} /* for */
|
||||
if (PHYSFS_utf8stricmp(*i, ptr) == 0)
|
||||
{
|
||||
strcpy(ptr, *i); /* found a match. Overwrite with this case. */
|
||||
PHYSFS_freeList(rc);
|
||||
return 1;
|
||||
} /* if */
|
||||
} /* for */
|
||||
|
||||
PHYSFS_freeList(rc);
|
||||
} /* if */
|
||||
|
||||
/* no match at all... */
|
||||
PHYSFS_freeList(rc);
|
||||
return(0);
|
||||
return 0;
|
||||
} /* locateOneElement */
|
||||
|
||||
|
||||
|
@ -88,26 +74,25 @@ int PHYSFSEXT_locateCorrectCase(char *buf)
|
|||
{
|
||||
int rc;
|
||||
char *ptr;
|
||||
char *prevptr;
|
||||
|
||||
while (*buf == '/') /* skip any '/' at start of string... */
|
||||
buf++;
|
||||
|
||||
ptr = prevptr = buf;
|
||||
ptr = buf;
|
||||
if (*ptr == '\0')
|
||||
return(0); /* Uh...I guess that's success. */
|
||||
return 0; /* Uh...I guess that's success. */
|
||||
|
||||
while (ptr = strchr(ptr + 1, '/'))
|
||||
while ( (ptr = strchr(ptr + 1, '/')) != NULL )
|
||||
{
|
||||
*ptr = '\0'; /* block this path section off */
|
||||
rc = locateOneElement(buf);
|
||||
*ptr = '/'; /* restore path separator */
|
||||
if (!rc)
|
||||
return(-2); /* missing element in path. */
|
||||
return -2; /* missing element in path. */
|
||||
} /* while */
|
||||
|
||||
/* check final element... */
|
||||
return(locateOneElement(buf) ? 0 : -1);
|
||||
return locateOneElement(buf) ? 0 : -1;
|
||||
} /* PHYSFSEXT_locateCorrectCase */
|
||||
|
||||
|
||||
|
@ -116,58 +101,58 @@ int main(int argc, char **argv)
|
|||
{
|
||||
int rc;
|
||||
char buf[128];
|
||||
PHYSFS_file *f;
|
||||
PHYSFS_File *f;
|
||||
|
||||
if (!PHYSFS_init(argv[0]))
|
||||
{
|
||||
fprintf(stderr, "PHYSFS_init(): %s\n", PHYSFS_getLastError());
|
||||
return(1);
|
||||
fprintf(stderr, "PHYSFS_init(): %s\n", PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()));
|
||||
return 1;
|
||||
} /* if */
|
||||
|
||||
if (!PHYSFS_addToSearchPath(".", 1))
|
||||
{
|
||||
fprintf(stderr, "PHYSFS_addToSearchPath(): %s\n", PHYSFS_getLastError());
|
||||
fprintf(stderr, "PHYSFS_addToSearchPath(): %s\n", PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()));
|
||||
PHYSFS_deinit();
|
||||
return(1);
|
||||
return 1;
|
||||
} /* if */
|
||||
|
||||
if (!PHYSFS_setWriteDir("."))
|
||||
{
|
||||
fprintf(stderr, "PHYSFS_setWriteDir(): %s\n", PHYSFS_getLastError());
|
||||
fprintf(stderr, "PHYSFS_setWriteDir(): %s\n", PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()));
|
||||
PHYSFS_deinit();
|
||||
return(1);
|
||||
return 1;
|
||||
} /* if */
|
||||
|
||||
if (!PHYSFS_mkdir("/a/b/c"))
|
||||
{
|
||||
fprintf(stderr, "PHYSFS_mkdir(): %s\n", PHYSFS_getLastError());
|
||||
fprintf(stderr, "PHYSFS_mkdir(): %s\n", PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()));
|
||||
PHYSFS_deinit();
|
||||
return(1);
|
||||
return 1;
|
||||
} /* if */
|
||||
|
||||
if (!PHYSFS_mkdir("/a/b/C"))
|
||||
{
|
||||
fprintf(stderr, "PHYSFS_mkdir(): %s\n", PHYSFS_getLastError());
|
||||
fprintf(stderr, "PHYSFS_mkdir(): %s\n", PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()));
|
||||
PHYSFS_deinit();
|
||||
return(1);
|
||||
return 1;
|
||||
} /* if */
|
||||
|
||||
f = PHYSFS_openWrite("/a/b/c/x.txt");
|
||||
PHYSFS_close(f);
|
||||
if (f == NULL)
|
||||
{
|
||||
fprintf(stderr, "PHYSFS_openWrite(): %s\n", PHYSFS_getLastError());
|
||||
fprintf(stderr, "PHYSFS_openWrite(): %s\n", PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()));
|
||||
PHYSFS_deinit();
|
||||
return(1);
|
||||
return 1;
|
||||
} /* if */
|
||||
|
||||
f = PHYSFS_openWrite("/a/b/C/X.txt");
|
||||
PHYSFS_close(f);
|
||||
if (f == NULL)
|
||||
{
|
||||
fprintf(stderr, "PHYSFS_openWrite(): %s\n", PHYSFS_getLastError());
|
||||
fprintf(stderr, "PHYSFS_openWrite(): %s\n", PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()));
|
||||
PHYSFS_deinit();
|
||||
return(1);
|
||||
return 1;
|
||||
} /* if */
|
||||
|
||||
strcpy(buf, "/a/b/c/x.txt");
|
||||
|
@ -210,7 +195,7 @@ int main(int argc, char **argv)
|
|||
PHYSFS_delete("/a/b");
|
||||
PHYSFS_delete("/a");
|
||||
PHYSFS_deinit();
|
||||
return(0);
|
||||
return 0;
|
||||
} /* main */
|
||||
#endif
|
||||
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
#ifndef INCL_PHYSFSEXT_IGNORECASE_H
|
||||
#define INCL_PHYSFSEXT_IGNORECASE_H
|
||||
|
||||
/** \file ignorecase.h */
|
||||
|
||||
/**
|
||||
|
@ -15,14 +18,14 @@
|
|||
* or file (which brings security considerations and potential bugs). This
|
||||
* code favours exact case matches, but you will lose access to otherwise
|
||||
* duplicate filenames, or you might go down a wrong directory tree, etc.
|
||||
* In practive, this is rarely a problem, but you need to be aware of it.
|
||||
* In practice, this is rarely a problem, but you need to be aware of it.
|
||||
* - This doesn't do _anything_ with the write directory; you're on your
|
||||
* own for opening the right files for writing. You can sort of get around
|
||||
* this by adding your write directory to the search path, but then the
|
||||
* interpolated directory tree can screw you up even more.
|
||||
*
|
||||
* This code should be considered an aid for legacy code. New development
|
||||
* shouldn't do dumbass things that require this aid in the first place. :)
|
||||
* shouldn't do things that require this aid in the first place. :)
|
||||
*
|
||||
* Usage: Set up PhysicsFS as you normally would, then use
|
||||
* PHYSFSEXT_locateCorrectCase() to get a "correct" pathname to pass to
|
||||
|
@ -39,11 +42,14 @@
|
|||
* NO WARRANTY.
|
||||
*
|
||||
* Unless otherwise stated, the rest of PhysicsFS falls under the zlib license.
|
||||
* Please see LICENSE in the root of the source tree.
|
||||
* Please see LICENSE.txt in the root of the source tree.
|
||||
*
|
||||
* \author Ryan C. Gordon.
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* \fn int PHYSFSEXT_locateCorrectCase(char *buf)
|
||||
|
@ -61,8 +67,7 @@
|
|||
* existing match. If there is no match, the search aborts and reports an
|
||||
* error. Exact matches are favored over case-insensitive matches.
|
||||
*
|
||||
* THIS IS RISKY. Please do not use this function for anything but crappy
|
||||
* legacy code.
|
||||
* THIS IS RISKY. Please do not use this function for anything but legacy code.
|
||||
*
|
||||
* \param buf Buffer with null-terminated string of path/file to locate.
|
||||
* This buffer will be modified by this function.
|
||||
|
@ -71,5 +76,11 @@
|
|||
*/
|
||||
int PHYSFSEXT_locateCorrectCase(char *buf);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* include-once blocker. */
|
||||
|
||||
/* end of ignorecase.h ... */
|
||||
|
||||
|
|
|
@ -0,0 +1,276 @@
|
|||
#!/usr/bin/perl -w
|
||||
|
||||
use warnings;
|
||||
use strict;
|
||||
|
||||
my $HASHBUCKETS1_16 = 256;
|
||||
my $HASHBUCKETS1_32 = 16;
|
||||
my $HASHBUCKETS2_16 = 16;
|
||||
my $HASHBUCKETS3_16 = 4;
|
||||
|
||||
print <<__EOF__;
|
||||
/*
|
||||
* This file is part of PhysicsFS (https://icculus.org/physfs/)
|
||||
*
|
||||
* This data generated by physfs/extras/makecasefoldhashtable.pl ...
|
||||
* Do not manually edit this file!
|
||||
*
|
||||
* Please see the file LICENSE.txt in the source's root directory.
|
||||
*/
|
||||
|
||||
#ifndef _INCLUDE_PHYSFS_CASEFOLDING_H_
|
||||
#define _INCLUDE_PHYSFS_CASEFOLDING_H_
|
||||
|
||||
#ifndef __PHYSICSFS_INTERNAL__
|
||||
#error Do not include this header from your applications.
|
||||
#endif
|
||||
|
||||
/* We build three simple hashmaps here: one that maps Unicode codepoints to
|
||||
a one, two, or three lowercase codepoints. To retrieve this info: look at
|
||||
case_fold_hashX, where X is 1, 2, or 3. Most foldable codepoints fold to one,
|
||||
a few dozen fold to two, and a handful fold to three. If the codepoint isn't
|
||||
in any of these hashes, it doesn't fold (no separate upper and lowercase).
|
||||
|
||||
Almost all these codepoints fit into 16 bits, so we hash them as such to save
|
||||
memory. If a codepoint is > 0xFFFF, we have separate hashes for them,
|
||||
since there are (currently) only about 120 of them and (currently) all of them
|
||||
map to a single lowercase codepoint. */
|
||||
|
||||
typedef struct CaseFoldMapping1_32
|
||||
{
|
||||
PHYSFS_uint32 from;
|
||||
PHYSFS_uint32 to0;
|
||||
} CaseFoldMapping1_32;
|
||||
|
||||
typedef struct CaseFoldMapping1_16
|
||||
{
|
||||
PHYSFS_uint16 from;
|
||||
PHYSFS_uint16 to0;
|
||||
} CaseFoldMapping1_16;
|
||||
|
||||
typedef struct CaseFoldMapping2_16
|
||||
{
|
||||
PHYSFS_uint16 from;
|
||||
PHYSFS_uint16 to0;
|
||||
PHYSFS_uint16 to1;
|
||||
} CaseFoldMapping2_16;
|
||||
|
||||
typedef struct CaseFoldMapping3_16
|
||||
{
|
||||
PHYSFS_uint16 from;
|
||||
PHYSFS_uint16 to0;
|
||||
PHYSFS_uint16 to1;
|
||||
PHYSFS_uint16 to2;
|
||||
} CaseFoldMapping3_16;
|
||||
|
||||
typedef struct CaseFoldHashBucket1_16
|
||||
{
|
||||
const CaseFoldMapping1_16 *list;
|
||||
const PHYSFS_uint8 count;
|
||||
} CaseFoldHashBucket1_16;
|
||||
|
||||
typedef struct CaseFoldHashBucket1_32
|
||||
{
|
||||
const CaseFoldMapping1_32 *list;
|
||||
const PHYSFS_uint8 count;
|
||||
} CaseFoldHashBucket1_32;
|
||||
|
||||
typedef struct CaseFoldHashBucket2_16
|
||||
{
|
||||
const CaseFoldMapping2_16 *list;
|
||||
const PHYSFS_uint8 count;
|
||||
} CaseFoldHashBucket2_16;
|
||||
|
||||
typedef struct CaseFoldHashBucket3_16
|
||||
{
|
||||
const CaseFoldMapping3_16 *list;
|
||||
const PHYSFS_uint8 count;
|
||||
} CaseFoldHashBucket3_16;
|
||||
|
||||
__EOF__
|
||||
|
||||
|
||||
my @foldPairs1_16;
|
||||
my @foldPairs2_16;
|
||||
my @foldPairs3_16;
|
||||
my @foldPairs1_32;
|
||||
|
||||
for (my $i = 0; $i < $HASHBUCKETS1_16; $i++) {
|
||||
$foldPairs1_16[$i] = '';
|
||||
}
|
||||
|
||||
for (my $i = 0; $i < $HASHBUCKETS1_32; $i++) {
|
||||
$foldPairs1_32[$i] = '';
|
||||
}
|
||||
|
||||
for (my $i = 0; $i < $HASHBUCKETS2_16; $i++) {
|
||||
$foldPairs2_16[$i] = '';
|
||||
}
|
||||
|
||||
for (my $i = 0; $i < $HASHBUCKETS3_16; $i++) {
|
||||
$foldPairs3_16[$i] = '';
|
||||
}
|
||||
|
||||
open(FH,'<','casefolding.txt') or die("failed to open casefolding.txt: $!\n");
|
||||
while (<FH>) {
|
||||
chomp;
|
||||
# strip comments from textfile...
|
||||
s/\#.*\Z//;
|
||||
|
||||
# strip whitespace...
|
||||
s/\A\s+//;
|
||||
s/\s+\Z//;
|
||||
|
||||
next if not /\A([a-fA-F0-9]+)\;\s*(.)\;\s*(.+)\;/;
|
||||
my ($code, $status, $mapping) = ($1, $2, $3);
|
||||
|
||||
my $hexxed = hex($code);
|
||||
#print("// code '$code' status '$status' mapping '$mapping'\n");
|
||||
|
||||
if (($status eq 'C') or ($status eq 'F')) {
|
||||
my ($map1, $map2, $map3) = (undef, undef, undef);
|
||||
$map1 = $1 if $mapping =~ s/\A([a-fA-F0-9]+)(\s*|\Z)//;
|
||||
$map2 = $1 if $mapping =~ s/\A([a-fA-F0-9]+)(\s*|\Z)//;
|
||||
$map3 = $1 if $mapping =~ s/\A([a-fA-F0-9]+)(\s*|\Z)//;
|
||||
die("mapping space too small for '$code'\n") if ($mapping ne '');
|
||||
die("problem parsing mapping for '$code'\n") if (not defined($map1));
|
||||
|
||||
if ($hexxed < 128) {
|
||||
# Just ignore these, we'll handle the low-ASCII ones ourselves.
|
||||
} elsif ($hexxed > 0xFFFF) {
|
||||
# We just need to add the 32-bit 2 and/or 3 codepoint maps if this die()'s here.
|
||||
die("Uhoh, a codepoint > 0xFFFF that folds to multiple codepoints! Fixme.") if defined($map2);
|
||||
my $hashed = (($hexxed ^ ($hexxed >> 8)) & ($HASHBUCKETS1_32-1));
|
||||
#print("// hexxed '$hexxed' hashed1 '$hashed'\n");
|
||||
$foldPairs1_32[$hashed] .= " { 0x$code, 0x$map1 },\n";
|
||||
} elsif (not defined($map2)) {
|
||||
my $hashed = (($hexxed ^ ($hexxed >> 8)) & ($HASHBUCKETS1_16-1));
|
||||
#print("// hexxed '$hexxed' hashed1 '$hashed'\n");
|
||||
$foldPairs1_16[$hashed] .= " { 0x$code, 0x$map1 },\n";
|
||||
} elsif (not defined($map3)) {
|
||||
my $hashed = (($hexxed ^ ($hexxed >> 8)) & ($HASHBUCKETS2_16-1));
|
||||
#print("// hexxed '$hexxed' hashed2 '$hashed'\n");
|
||||
$foldPairs2_16[$hashed] .= " { 0x$code, 0x$map1, 0x$map2 },\n";
|
||||
} else {
|
||||
my $hashed = (($hexxed ^ ($hexxed >> 8)) & ($HASHBUCKETS3_16-1));
|
||||
#print("// hexxed '$hexxed' hashed3 '$hashed'\n");
|
||||
$foldPairs3_16[$hashed] .= " { 0x$code, 0x$map1, 0x$map2, 0x$map3 },\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
close(FH);
|
||||
|
||||
for (my $i = 0; $i < $HASHBUCKETS1_16; $i++) {
|
||||
$foldPairs1_16[$i] =~ s/,\n\Z//;
|
||||
my $str = $foldPairs1_16[$i];
|
||||
next if $str eq '';
|
||||
my $num = '000' . $i;
|
||||
$num =~ s/\A.*?(\d\d\d)\Z/$1/;
|
||||
my $sym = "case_fold1_16_${num}";
|
||||
print("static const CaseFoldMapping1_16 ${sym}[] = {\n$str\n};\n\n");
|
||||
}
|
||||
|
||||
for (my $i = 0; $i < $HASHBUCKETS1_32; $i++) {
|
||||
$foldPairs1_32[$i] =~ s/,\n\Z//;
|
||||
my $str = $foldPairs1_32[$i];
|
||||
next if $str eq '';
|
||||
my $num = '000' . $i;
|
||||
$num =~ s/\A.*?(\d\d\d)\Z/$1/;
|
||||
my $sym = "case_fold1_32_${num}";
|
||||
print("static const CaseFoldMapping1_32 ${sym}[] = {\n$str\n};\n\n");
|
||||
}
|
||||
|
||||
for (my $i = 0; $i < $HASHBUCKETS2_16; $i++) {
|
||||
$foldPairs2_16[$i] =~ s/,\n\Z//;
|
||||
my $str = $foldPairs2_16[$i];
|
||||
next if $str eq '';
|
||||
my $num = '000' . $i;
|
||||
$num =~ s/\A.*?(\d\d\d)\Z/$1/;
|
||||
my $sym = "case_fold2_16_${num}";
|
||||
print("static const CaseFoldMapping2_16 ${sym}[] = {\n$str\n};\n\n");
|
||||
}
|
||||
|
||||
for (my $i = 0; $i < $HASHBUCKETS3_16; $i++) {
|
||||
$foldPairs3_16[$i] =~ s/,\n\Z//;
|
||||
my $str = $foldPairs3_16[$i];
|
||||
next if $str eq '';
|
||||
my $num = '000' . $i;
|
||||
$num =~ s/\A.*?(\d\d\d)\Z/$1/;
|
||||
my $sym = "case_fold3_16_${num}";
|
||||
print("static const CaseFoldMapping3_16 ${sym}[] = {\n$str\n};\n\n");
|
||||
}
|
||||
|
||||
print("static const CaseFoldHashBucket1_16 case_fold_hash1_16[] = {\n");
|
||||
|
||||
for (my $i = 0; $i < $HASHBUCKETS1_16; $i++) {
|
||||
my $str = $foldPairs1_16[$i];
|
||||
if ($str eq '') {
|
||||
print(" { NULL, 0 },\n");
|
||||
} else {
|
||||
my $num = '000' . $i;
|
||||
$num =~ s/\A.*?(\d\d\d)\Z/$1/;
|
||||
my $sym = "case_fold1_16_${num}";
|
||||
print(" { $sym, __PHYSFS_ARRAYLEN($sym) },\n");
|
||||
}
|
||||
}
|
||||
print("};\n\n");
|
||||
|
||||
|
||||
print("static const CaseFoldHashBucket1_32 case_fold_hash1_32[] = {\n");
|
||||
|
||||
for (my $i = 0; $i < $HASHBUCKETS1_32; $i++) {
|
||||
my $str = $foldPairs1_32[$i];
|
||||
if ($str eq '') {
|
||||
print(" { NULL, 0 },\n");
|
||||
} else {
|
||||
my $num = '000' . $i;
|
||||
$num =~ s/\A.*?(\d\d\d)\Z/$1/;
|
||||
my $sym = "case_fold1_32_${num}";
|
||||
print(" { $sym, __PHYSFS_ARRAYLEN($sym) },\n");
|
||||
}
|
||||
}
|
||||
print("};\n\n");
|
||||
|
||||
|
||||
print("static const CaseFoldHashBucket2_16 case_fold_hash2_16[] = {\n");
|
||||
|
||||
for (my $i = 0; $i < $HASHBUCKETS2_16; $i++) {
|
||||
my $str = $foldPairs2_16[$i];
|
||||
if ($str eq '') {
|
||||
print(" { NULL, 0 },\n");
|
||||
} else {
|
||||
my $num = '000' . $i;
|
||||
$num =~ s/\A.*?(\d\d\d)\Z/$1/;
|
||||
my $sym = "case_fold2_16_${num}";
|
||||
print(" { $sym, __PHYSFS_ARRAYLEN($sym) },\n");
|
||||
}
|
||||
}
|
||||
print("};\n\n");
|
||||
|
||||
print("static const CaseFoldHashBucket3_16 case_fold_hash3_16[] = {\n");
|
||||
|
||||
for (my $i = 0; $i < $HASHBUCKETS3_16; $i++) {
|
||||
my $str = $foldPairs3_16[$i];
|
||||
if ($str eq '') {
|
||||
print(" { NULL, 0 },\n");
|
||||
} else {
|
||||
my $num = '000' . $i;
|
||||
$num =~ s/\A.*?(\d\d\d)\Z/$1/;
|
||||
my $sym = "case_fold3_16_${num}";
|
||||
print(" { $sym, __PHYSFS_ARRAYLEN($sym) },\n");
|
||||
}
|
||||
}
|
||||
print("};\n\n");
|
||||
|
||||
print <<__EOF__;
|
||||
|
||||
#endif /* _INCLUDE_PHYSFS_CASEFOLDING_H_ */
|
||||
|
||||
/* end of physfs_casefolding.h ... */
|
||||
|
||||
__EOF__
|
||||
|
||||
exit 0;
|
||||
|
||||
# end of makecashfoldhashtable.pl ...
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
prefix=@CMAKE_INSTALL_PREFIX@
|
||||
exec_prefix=@CMAKE_INSTALL_PREFIX@
|
||||
libdir=@CMAKE_INSTALL_FULL_LIBDIR@
|
||||
includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
|
||||
|
||||
Name: PhysicsFS
|
||||
Description: PhysicsFS is a library to provide abstract access to various archives.
|
||||
URL: https://icculus.org/physfs/
|
||||
Version: @PHYSFS_VERSION@
|
||||
Libs: -L${libdir} -lphysfs
|
||||
Cflags: -I${includedir}
|
|
@ -1,103 +0,0 @@
|
|||
# $Id: installer.rb,v 1.3 2003/07/21 03:46:50 icculus Exp $
|
||||
|
||||
require 'rbconfig'
|
||||
require 'find'
|
||||
require 'ftools'
|
||||
|
||||
include Config
|
||||
|
||||
module Slimb
|
||||
class Installer
|
||||
def initialize target_dir = "", &user_skip
|
||||
@user_skip = user_skip or proc {|f| false}
|
||||
|
||||
@version = CONFIG["MAJOR"] + "." + CONFIG["MINOR"]
|
||||
@libdir = File.join(CONFIG["libdir"], "ruby", @version)
|
||||
@sitedir = CONFIG["sitedir"] || File.join(@libdir, "site_ruby")
|
||||
@dest = File.join @sitedir, target_dir
|
||||
|
||||
File::makedirs @dest
|
||||
File::chmod 0755, @dest, true
|
||||
end
|
||||
|
||||
def skip? file
|
||||
@user_skip[file] or
|
||||
file[0] == ?. or file[-1] == ?~ or file[-1] == ?#
|
||||
end
|
||||
|
||||
def install_dir dir
|
||||
File::makedirs(File.join(@dest, dir))
|
||||
File::chmod(0755, File.join(@dest, dir), true)
|
||||
Dir.foreach(dir) {|file|
|
||||
next if skip? file
|
||||
|
||||
if File.ftype(File.join(dir, file)) == "directory"
|
||||
install_dir File.join(dir, file)
|
||||
else
|
||||
install_file File.join(dir, file)
|
||||
end
|
||||
}
|
||||
end
|
||||
|
||||
def install_file file
|
||||
if file =~ /\.so$/
|
||||
install_so file
|
||||
else
|
||||
File::install file, File.join(@dest, file), 0644, true
|
||||
end
|
||||
end
|
||||
|
||||
def install_so file
|
||||
File::install file, File.join(CONFIG["sitearchdir"], file), 0644, true
|
||||
end
|
||||
|
||||
def uninstall_so file
|
||||
file = File.join(CONFIG["sitearchdir"], file)
|
||||
File::safe_unlink file
|
||||
end
|
||||
|
||||
def install something
|
||||
case something
|
||||
when Array
|
||||
something.each {|x|
|
||||
install x if x.is_a? String
|
||||
}
|
||||
when String
|
||||
if File.ftype(something) == "directory"
|
||||
install_dir something
|
||||
else
|
||||
install_file something
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def uninstall what = "*"
|
||||
case what
|
||||
when Array
|
||||
files = what.map {|x| File.join(@dest, x)}
|
||||
when String
|
||||
files = Dir[File.join(@dest, what)]
|
||||
end
|
||||
|
||||
files.each {|x|
|
||||
# FIXME: recursive uninstall is a must
|
||||
next if FileTest.directory? x
|
||||
File::safe_unlink x
|
||||
}
|
||||
end
|
||||
|
||||
def run files, argv
|
||||
if !argv.grep(/--uninstall/).empty?
|
||||
uninstall files
|
||||
else
|
||||
install files
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# self-installation
|
||||
if $0 == __FILE__
|
||||
$stderr.puts "Installing slimb installer..."
|
||||
Slimb::Installer.new("slimb").install File.basename(__FILE__)
|
||||
end
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue