Compare commits
1026 Commits
release-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 | |
Ryan C. Gordon | d43ca254c1 | |
Ryan C. Gordon | 19f5b8651d | |
Ryan C. Gordon | dd3008f799 | |
Ryan C. Gordon | 24c8651f7f | |
Ryan C. Gordon | 56606fa65c | |
Ryan C. Gordon | 81c06f3c9e | |
Ryan C. Gordon | ee41546b4c | |
Ryan C. Gordon | 46fe99b378 | |
bhook | 86dc6d9ebc | |
Ryan C. Gordon | 02866267d5 | |
Ryan C. Gordon | ffb2e6ca45 | |
Ryan C. Gordon | 6d45e5b718 | |
Ryan C. Gordon | ce799b99a8 | |
Ryan C. Gordon | 564d485f82 | |
Ryan C. Gordon | 4bbb4ea217 | |
Ryan C. Gordon | f2ebb00ef9 | |
Ryan C. Gordon | efdc4ac8a6 | |
Ryan C. Gordon | 3a5f64ff06 | |
Ryan C. Gordon | f6234dbc2a | |
Ryan C. Gordon | 9ac33cdcbe | |
Ryan C. Gordon | 4e58f93af9 | |
Ryan C. Gordon | cd08ed589b | |
Ryan C. Gordon | caf828b73d | |
Ryan C. Gordon | c7fb2e4cba | |
bhook | e3e3270b0f | |
Ryan C. Gordon | 4f0b5d6e47 | |
Ryan C. Gordon | 1822399aec | |
Ryan C. Gordon | e04c24cbcd | |
Ryan C. Gordon | 9dcb15fa2c | |
Ryan C. Gordon | 09ef260209 | |
Ryan C. Gordon | 13d6a130fd | |
Ryan C. Gordon | f49ab5f7d4 | |
Ryan C. Gordon | f7577d417f | |
bhook | f920549378 | |
bhook | b035d272ec | |
bhook | 5b6e1d4cee | |
bhook | 83cdb49cd3 | |
Ryan C. Gordon | 83fde3e480 | |
Ryan C. Gordon | c951ab5cb9 | |
Ryan C. Gordon | d21eaf18dc | |
Ryan C. Gordon | 52fc473ddb | |
Ryan C. Gordon | e0208e089f | |
Ryan C. Gordon | a4276d9a61 | |
Ryan C. Gordon | 1400b98be7 | |
Ryan C. Gordon | ccfa99fb61 | |
Ryan C. Gordon | d59c03cc8b | |
Ryan C. Gordon | f3191d0e85 | |
Ryan C. Gordon | f4309f51e8 | |
Ryan C. Gordon | db279de4d1 | |
Ryan C. Gordon | 025aef8a15 | |
Ryan C. Gordon | 33be461bcb | |
Ryan C. Gordon | adc1f9a434 | |
Ryan C. Gordon | 6f3eda601e | |
Ryan C. Gordon | 4454511ca0 | |
Ryan C. Gordon | 3e2885afda | |
Ryan C. Gordon | 01b8809162 | |
Ryan C. Gordon | 593bca81ff | |
Ryan C. Gordon | 8dbc9bf877 | |
Ryan C. Gordon | 4bf1b305e3 | |
Ryan C. Gordon | b50342ad13 | |
Ryan C. Gordon | 283c6291a7 | |
Ryan C. Gordon | 3a3451c4be | |
Ryan C. Gordon | 23dcba1970 | |
Ryan C. Gordon | a56ea0a917 | |
bhook | 585860f7c1 | |
Ryan C. Gordon | 76fbe60a41 | |
Ryan C. Gordon | 90060615ab | |
Ryan C. Gordon | fbbaf19a4f | |
Ryan C. Gordon | f22dfbf214 | |
Ryan C. Gordon | c3ebe9f352 | |
Ryan C. Gordon | 753f624be4 | |
Ryan C. Gordon | ef16139d8b | |
Ryan C. Gordon | 3a27dd9310 | |
Ryan C. Gordon | 433d7f0f44 | |
Ryan C. Gordon | 1344feceda | |
Ryan C. Gordon | 3744f54064 | |
Ryan C. Gordon | 8bdc0ea570 | |
Ryan C. Gordon | 8295a783d2 | |
bhook | 433ae86ef8 | |
bhook | f101472293 | |
bhook | e83d8bc71c | |
Ryan C. Gordon | c064749ad8 | |
Ryan C. Gordon | f3f15edb4a | |
Ryan C. Gordon | 0e334ae164 | |
Ryan C. Gordon | 6f1d693fe8 | |
Ryan C. Gordon | 01505d8d58 | |
Ryan C. Gordon | 1c8cec3d3e | |
Ryan C. Gordon | 3a479b6cd8 | |
Ryan C. Gordon | b35cef5ee2 | |
Ryan C. Gordon | ea760f1247 | |
Ryan C. Gordon | 0330dfac4f | |
Ryan C. Gordon | c518013bc3 | |
Ryan C. Gordon | 7246213c2f | |
Gregory S. Read | 48cb3c70ef |
51
.cvsignore
51
.cvsignore
|
@ -1,51 +0,0 @@
|
|||
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
|
||||
|
342
CHANGELOG
342
CHANGELOG
|
@ -1,342 +0,0 @@
|
|||
/*
|
||||
* CHANGELOG.
|
||||
*/
|
||||
|
||||
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 ...
|
69
CREDITS
69
CREDITS
|
@ -1,69 +0,0 @@
|
|||
Initial API interface and implementation,
|
||||
GRP driver,
|
||||
DIR driver,
|
||||
Unix support,
|
||||
Win32 support,
|
||||
BeOS support,
|
||||
POSIX support,
|
||||
OS/2 support,
|
||||
ZIP driver,
|
||||
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
|
||||
|
||||
Spanish translation:
|
||||
Pedro J. Pérez
|
||||
|
||||
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
|
||||
|
||||
Other stuff:
|
||||
Your name here! Patches go to icculus@clutteredmind.org ...
|
||||
|
||||
/* end of CREDITS ... */
|
||||
|
BIN
CWProjects.sit
BIN
CWProjects.sit
Binary file not shown.
123
INSTALL
123
INSTALL
|
@ -1,123 +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.
|
||||
|
||||
Visual Studio.NET users should do the same thing, but use the "physfs.vcproj"
|
||||
and "test_physfs.vcproj" project files instead.
|
||||
|
||||
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)
|
||||
|
504
LICENSE
504
LICENSE
|
@ -1,504 +0,0 @@
|
|||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 2.1, February 1999
|
||||
|
||||
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
[This is the first released version of the Lesser GPL. It also counts
|
||||
as the successor of the GNU Library Public License, version 2, hence
|
||||
the version number 2.1.]
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
Licenses are intended to guarantee your freedom to share and change
|
||||
free software--to make sure the software is free for all its users.
|
||||
|
||||
This license, the Lesser General Public License, applies to some
|
||||
specially designated software packages--typically libraries--of the
|
||||
Free Software Foundation and other authors who decide to use it. You
|
||||
can use it too, but we suggest you first think carefully about whether
|
||||
this license or the ordinary General Public License is the better
|
||||
strategy to use in any particular case, based on the explanations below.
|
||||
|
||||
When we speak of free software, we are referring to freedom of use,
|
||||
not price. Our General Public Licenses are designed to make sure that
|
||||
you have the freedom to distribute copies of free software (and charge
|
||||
for this service if you wish); that you receive source code or can get
|
||||
it if you want it; that you can change the software and use pieces of
|
||||
it in new free programs; and that you are informed that you can do
|
||||
these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
distributors to deny you these rights or to ask you to surrender these
|
||||
rights. These restrictions translate to certain responsibilities for
|
||||
you if you distribute copies of the library or if you modify it.
|
||||
|
||||
For example, if you distribute copies of the library, whether gratis
|
||||
or for a fee, you must give the recipients all the rights that we gave
|
||||
you. You must make sure that they, too, receive or can get the source
|
||||
code. If you link other code with the library, you must provide
|
||||
complete object files to the recipients, so that they can relink them
|
||||
with the library after making changes to the library and recompiling
|
||||
it. And you must show them these terms so they know their rights.
|
||||
|
||||
We protect your rights with a two-step method: (1) we copyright the
|
||||
library, and (2) we offer you this license, which gives you legal
|
||||
permission to copy, distribute and/or modify the library.
|
||||
|
||||
To protect each distributor, we want to make it very clear that
|
||||
there is no warranty for the free library. Also, if the library is
|
||||
modified by someone else and passed on, the recipients should know
|
||||
that what they have is not the original version, so that the original
|
||||
author's reputation will not be affected by problems that might be
|
||||
introduced by others.
|
||||
|
||||
Finally, software patents pose a constant threat to the existence of
|
||||
any free program. We wish to make sure that a company cannot
|
||||
effectively restrict the users of a free program by obtaining a
|
||||
restrictive license from a patent holder. Therefore, we insist that
|
||||
any patent license obtained for a version of the library must be
|
||||
consistent with the full freedom of use specified in this license.
|
||||
|
||||
Most GNU software, including some libraries, is covered by the
|
||||
ordinary GNU General Public License. This license, the GNU Lesser
|
||||
General Public License, applies to certain designated libraries, and
|
||||
is quite different from the ordinary General Public License. We use
|
||||
this license for certain libraries in order to permit linking those
|
||||
libraries into non-free programs.
|
||||
|
||||
When a program is linked with a library, whether statically or using
|
||||
a shared library, the combination of the two is legally speaking a
|
||||
combined work, a derivative of the original library. The ordinary
|
||||
General Public License therefore permits such linking only if the
|
||||
entire combination fits its criteria of freedom. The Lesser General
|
||||
Public License permits more lax criteria for linking other code with
|
||||
the library.
|
||||
|
||||
We call this license the "Lesser" General Public License because it
|
||||
does Less to protect the user's freedom than the ordinary General
|
||||
Public License. It also provides other free software developers Less
|
||||
of an advantage over competing non-free programs. These disadvantages
|
||||
are the reason we use the ordinary General Public License for many
|
||||
libraries. However, the Lesser license provides advantages in certain
|
||||
special circumstances.
|
||||
|
||||
For example, on rare occasions, there may be a special need to
|
||||
encourage the widest possible use of a certain library, so that it becomes
|
||||
a de-facto standard. To achieve this, non-free programs must be
|
||||
allowed to use the library. A more frequent case is that a free
|
||||
library does the same job as widely used non-free libraries. In this
|
||||
case, there is little to gain by limiting the free library to free
|
||||
software only, so we use the Lesser General Public License.
|
||||
|
||||
In other cases, permission to use a particular library in non-free
|
||||
programs enables a greater number of people to use a large body of
|
||||
free software. For example, permission to use the GNU C Library in
|
||||
non-free programs enables many more people to use the whole GNU
|
||||
operating system, as well as its variant, the GNU/Linux operating
|
||||
system.
|
||||
|
||||
Although the Lesser General Public License is Less protective of the
|
||||
users' freedom, it does ensure that the user of a program that is
|
||||
linked with the Library has the freedom and the wherewithal to run
|
||||
that program using a modified version of the Library.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow. Pay close attention to the difference between a
|
||||
"work based on the library" and a "work that uses the library". The
|
||||
former contains code derived from the library, whereas the latter must
|
||||
be combined with the library in order to run.
|
||||
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License Agreement applies to any software library or other
|
||||
program which contains a notice placed by the copyright holder or
|
||||
other authorized party saying it may be distributed under the terms of
|
||||
this Lesser General Public License (also called "this License").
|
||||
Each licensee is addressed as "you".
|
||||
|
||||
A "library" means a collection of software functions and/or data
|
||||
prepared so as to be conveniently linked with application programs
|
||||
(which use some of those functions and data) to form executables.
|
||||
|
||||
The "Library", below, refers to any such software library or work
|
||||
which has been distributed under these terms. A "work based on the
|
||||
Library" means either the Library or any derivative work under
|
||||
copyright law: that is to say, a work containing the Library or a
|
||||
portion of it, either verbatim or with modifications and/or translated
|
||||
straightforwardly into another language. (Hereinafter, translation is
|
||||
included without limitation in the term "modification".)
|
||||
|
||||
"Source code" for a work means the preferred form of the work for
|
||||
making modifications to it. For a library, complete source code means
|
||||
all the source code for all modules it contains, plus any associated
|
||||
interface definition files, plus the scripts used to control compilation
|
||||
and installation of the library.
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running a program using the Library is not restricted, and output from
|
||||
such a program is covered only if its contents constitute a work based
|
||||
on the Library (independent of the use of the Library in a tool for
|
||||
writing it). Whether that is true depends on what the Library does
|
||||
and what the program that uses the Library does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's
|
||||
complete source code as you receive it, in any medium, provided that
|
||||
you conspicuously and appropriately publish on each copy an
|
||||
appropriate copyright notice and disclaimer of warranty; keep intact
|
||||
all the notices that refer to this License and to the absence of any
|
||||
warranty; and distribute a copy of this License along with the
|
||||
Library.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy,
|
||||
and you may at your option offer warranty protection in exchange for a
|
||||
fee.
|
||||
|
||||
2. You may modify your copy or copies of the Library or any portion
|
||||
of it, thus forming a work based on the Library, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) The modified work must itself be a software library.
|
||||
|
||||
b) You must cause the files modified to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
c) You must cause the whole of the work to be licensed at no
|
||||
charge to all third parties under the terms of this License.
|
||||
|
||||
d) If a facility in the modified Library refers to a function or a
|
||||
table of data to be supplied by an application program that uses
|
||||
the facility, other than as an argument passed when the facility
|
||||
is invoked, then you must make a good faith effort to ensure that,
|
||||
in the event an application does not supply such function or
|
||||
table, the facility still operates, and performs whatever part of
|
||||
its purpose remains meaningful.
|
||||
|
||||
(For example, a function in a library to compute square roots has
|
||||
a purpose that is entirely well-defined independent of the
|
||||
application. Therefore, Subsection 2d requires that any
|
||||
application-supplied function or table used by this function must
|
||||
be optional: if the application does not supply it, the square
|
||||
root function must still compute square roots.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Library,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Library, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote
|
||||
it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Library.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Library
|
||||
with the Library (or with a work based on the Library) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may opt to apply the terms of the ordinary GNU General Public
|
||||
License instead of this License to a given copy of the Library. To do
|
||||
this, you must alter all the notices that refer to this License, so
|
||||
that they refer to the ordinary GNU General Public License, version 2,
|
||||
instead of to this License. (If a newer version than version 2 of the
|
||||
ordinary GNU General Public License has appeared, then you can specify
|
||||
that version instead if you wish.) Do not make any other change in
|
||||
these notices.
|
||||
|
||||
Once this change is made in a given copy, it is irreversible for
|
||||
that copy, so the ordinary GNU General Public License applies to all
|
||||
subsequent copies and derivative works made from that copy.
|
||||
|
||||
This option is useful when you wish to copy part of the code of
|
||||
the Library into a program that is not a library.
|
||||
|
||||
4. You may copy and distribute the Library (or a portion or
|
||||
derivative of it, under Section 2) in object code or executable form
|
||||
under the terms of Sections 1 and 2 above provided that you accompany
|
||||
it with the complete corresponding machine-readable source code, which
|
||||
must be distributed under the terms of Sections 1 and 2 above on a
|
||||
medium customarily used for software interchange.
|
||||
|
||||
If distribution of object code is made by offering access to copy
|
||||
from a designated place, then offering equivalent access to copy the
|
||||
source code from the same place satisfies the requirement to
|
||||
distribute the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
5. A program that contains no derivative of any portion of the
|
||||
Library, but is designed to work with the Library by being compiled or
|
||||
linked with it, is called a "work that uses the Library". Such a
|
||||
work, in isolation, is not a derivative work of the Library, and
|
||||
therefore falls outside the scope of this License.
|
||||
|
||||
However, linking a "work that uses the Library" with the Library
|
||||
creates an executable that is a derivative of the Library (because it
|
||||
contains portions of the Library), rather than a "work that uses the
|
||||
library". The executable is therefore covered by this License.
|
||||
Section 6 states terms for distribution of such executables.
|
||||
|
||||
When a "work that uses the Library" uses material from a header file
|
||||
that is part of the Library, the object code for the work may be a
|
||||
derivative work of the Library even though the source code is not.
|
||||
Whether this is true is especially significant if the work can be
|
||||
linked without the Library, or if the work is itself a library. The
|
||||
threshold for this to be true is not precisely defined by law.
|
||||
|
||||
If such an object file uses only numerical parameters, data
|
||||
structure layouts and accessors, and small macros and small inline
|
||||
functions (ten lines or less in length), then the use of the object
|
||||
file is unrestricted, regardless of whether it is legally a derivative
|
||||
work. (Executables containing this object code plus portions of the
|
||||
Library will still fall under Section 6.)
|
||||
|
||||
Otherwise, if the work is a derivative of the Library, you may
|
||||
distribute the object code for the work under the terms of Section 6.
|
||||
Any executables containing that work also fall under Section 6,
|
||||
whether or not they are linked directly with the Library itself.
|
||||
|
||||
6. As an exception to the Sections above, you may also combine or
|
||||
link a "work that uses the Library" with the Library to produce a
|
||||
work containing portions of the Library, and distribute that work
|
||||
under terms of your choice, provided that the terms permit
|
||||
modification of the work for the customer's own use and reverse
|
||||
engineering for debugging such modifications.
|
||||
|
||||
You must give prominent notice with each copy of the work that the
|
||||
Library is used in it and that the Library and its use are covered by
|
||||
this License. You must supply a copy of this License. If the work
|
||||
during execution displays copyright notices, you must include the
|
||||
copyright notice for the Library among them, as well as a reference
|
||||
directing the user to the copy of this License. Also, you must do one
|
||||
of these things:
|
||||
|
||||
a) Accompany the work with the complete corresponding
|
||||
machine-readable source code for the Library including whatever
|
||||
changes were used in the work (which must be distributed under
|
||||
Sections 1 and 2 above); and, if the work is an executable linked
|
||||
with the Library, with the complete machine-readable "work that
|
||||
uses the Library", as object code and/or source code, so that the
|
||||
user can modify the Library and then relink to produce a modified
|
||||
executable containing the modified Library. (It is understood
|
||||
that the user who changes the contents of definitions files in the
|
||||
Library will not necessarily be able to recompile the application
|
||||
to use the modified definitions.)
|
||||
|
||||
b) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (1) uses at run time a
|
||||
copy of the library already present on the user's computer system,
|
||||
rather than copying library functions into the executable, and (2)
|
||||
will operate properly with a modified version of the library, if
|
||||
the user installs one, as long as the modified version is
|
||||
interface-compatible with the version that the work was made with.
|
||||
|
||||
c) Accompany the work with a written offer, valid for at
|
||||
least three years, to give the same user the materials
|
||||
specified in Subsection 6a, above, for a charge no more
|
||||
than the cost of performing this distribution.
|
||||
|
||||
d) If distribution of the work is made by offering access to copy
|
||||
from a designated place, offer equivalent access to copy the above
|
||||
specified materials from the same place.
|
||||
|
||||
e) Verify that the user has already received a copy of these
|
||||
materials or that you have already sent this user a copy.
|
||||
|
||||
For an executable, the required form of the "work that uses the
|
||||
Library" must include any data and utility programs needed for
|
||||
reproducing the executable from it. However, as a special exception,
|
||||
the materials to be distributed need not include anything that is
|
||||
normally distributed (in either source or binary form) with the major
|
||||
components (compiler, kernel, and so on) of the operating system on
|
||||
which the executable runs, unless that component itself accompanies
|
||||
the executable.
|
||||
|
||||
It may happen that this requirement contradicts the license
|
||||
restrictions of other proprietary libraries that do not normally
|
||||
accompany the operating system. Such a contradiction means you cannot
|
||||
use both them and the Library together in an executable that you
|
||||
distribute.
|
||||
|
||||
7. You may place library facilities that are a work based on the
|
||||
Library side-by-side in a single library together with other library
|
||||
facilities not covered by this License, and distribute such a combined
|
||||
library, provided that the separate distribution of the work based on
|
||||
the Library and of the other library facilities is otherwise
|
||||
permitted, and provided that you do these two things:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work
|
||||
based on the Library, uncombined with any other library
|
||||
facilities. This must be distributed under the terms of the
|
||||
Sections above.
|
||||
|
||||
b) Give prominent notice with the combined library of the fact
|
||||
that part of it is a work based on the Library, and explaining
|
||||
where to find the accompanying uncombined form of the same work.
|
||||
|
||||
8. You may not copy, modify, sublicense, link with, or distribute
|
||||
the Library except as expressly provided under this License. Any
|
||||
attempt otherwise to copy, modify, sublicense, link with, or
|
||||
distribute the Library is void, and will automatically terminate your
|
||||
rights under this License. However, parties who have received copies,
|
||||
or rights, from you under this License will not have their licenses
|
||||
terminated so long as such parties remain in full compliance.
|
||||
|
||||
9. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Library or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Library (or any work based on the
|
||||
Library), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Library or works based on it.
|
||||
|
||||
10. Each time you redistribute the Library (or any work based on the
|
||||
Library), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute, link with or modify the Library
|
||||
subject to these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties with
|
||||
this License.
|
||||
|
||||
11. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Library at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Library by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Library.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any
|
||||
particular circumstance, the balance of the section is intended to apply,
|
||||
and the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
12. If the distribution and/or use of the Library is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Library under this License may add
|
||||
an explicit geographical distribution limitation excluding those countries,
|
||||
so that distribution is permitted only in or among countries not thus
|
||||
excluded. In such case, this License incorporates the limitation as if
|
||||
written in the body of this License.
|
||||
|
||||
13. The Free Software Foundation may publish revised and/or new
|
||||
versions of the Lesser General Public License from time to time.
|
||||
Such new versions will be similar in spirit to the present version,
|
||||
but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Library
|
||||
specifies a version number of this License which applies to it and
|
||||
"any later version", you have the option of following the terms and
|
||||
conditions either of that version or of any later version published by
|
||||
the Free Software Foundation. If the Library does not specify a
|
||||
license version number, you may choose any version ever published by
|
||||
the Free Software Foundation.
|
||||
|
||||
14. If you wish to incorporate parts of the Library into other free
|
||||
programs whose distribution conditions are incompatible with these,
|
||||
write to the author to ask for permission. For software which is
|
||||
copyrighted by the Free Software Foundation, write to the Free
|
||||
Software Foundation; we sometimes make exceptions for this. Our
|
||||
decision will be guided by the two goals of preserving the free status
|
||||
of all derivatives of our free software and of promoting the sharing
|
||||
and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
||||
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
||||
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
|
||||
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
|
||||
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
||||
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
||||
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
|
||||
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
|
||||
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
|
||||
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
|
||||
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
|
||||
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
|
||||
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
||||
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Libraries
|
||||
|
||||
If you develop a new library, and you want it to be of the greatest
|
||||
possible use to the public, we recommend making it free software that
|
||||
everyone can redistribute and change. You can do so by permitting
|
||||
redistribution under these terms (or, alternatively, under the terms of the
|
||||
ordinary General Public License).
|
||||
|
||||
To apply these terms, attach the following notices to the library. It is
|
||||
safest to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least the
|
||||
"copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the library's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the library, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the
|
||||
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1990
|
||||
Ty Coon, President of Vice
|
||||
|
||||
That's all there is to it!
|
||||
|
||||
|
|
@ -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,146 +0,0 @@
|
|||
lib_LTLIBRARIES = libphysfs.la
|
||||
|
||||
libphysfsincludedir = $(includedir)
|
||||
libphysfsinclude_HEADERS = \
|
||||
physfs.h
|
||||
|
||||
if BUILD_MACOSX
|
||||
|
||||
ZLIB_FILES = zlib114/adler32.c \
|
||||
zlib114/compress.c \
|
||||
zlib114/crc32.c \
|
||||
zlib114/deflate.c \
|
||||
zlib114/deflate.h \
|
||||
zlib114/infblock.c \
|
||||
zlib114/infblock.h \
|
||||
zlib114/infcodes.c \
|
||||
zlib114/infcodes.h \
|
||||
zlib114/inffast.c \
|
||||
zlib114/inffast.h \
|
||||
zlib114/inffixed.h \
|
||||
zlib114/inflate.c \
|
||||
zlib114/inftrees.c \
|
||||
zlib114/inftrees.h \
|
||||
zlib114/infutil.c \
|
||||
zlib114/infutil.h \
|
||||
zlib114/trees.c \
|
||||
zlib114/trees.h \
|
||||
zlib114/uncompr.c \
|
||||
zlib114/zconf.h \
|
||||
zlib114/zlib.h \
|
||||
zlib114/zutil.c \
|
||||
zlib114/zutil.h
|
||||
|
||||
|
||||
if BUILD_ZLIB
|
||||
ZLIB_SRC = $(ZLIB_FILES)
|
||||
ZLIB_INC = -I$(top_srcdir)/zlib114
|
||||
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/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.sit \
|
||||
physfs.spec \
|
||||
physfs.dsp \
|
||||
test_physfs.dsp \
|
||||
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 \
|
||||
makeos2.cmd \
|
||||
$(ZLIB_EXTRADIST) $(BEOS_EXTRADIST) $(TEST_EXTRADIST)
|
||||
|
||||
else
|
||||
|
||||
SUBDIRS = platform archivers zlib114 . test extras
|
||||
|
||||
libphysfs_la_SOURCES = \
|
||||
physfs.c \
|
||||
physfs_internal.h \
|
||||
physfs_byteorder.c
|
||||
|
||||
if BUILD_ZLIB
|
||||
ZLIB_LIB = zlib114/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 \
|
||||
CWProjects.sit \
|
||||
physfs.spec.in \
|
||||
physfs.spec \
|
||||
physfs.dsp \
|
||||
test_physfs.dsp \
|
||||
makeos2.cmd
|
||||
|
||||
|
||||
endif
|
||||
|
||||
|
||||
dist-hook:
|
||||
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,47 +0,0 @@
|
|||
lib_LTLIBRARIES = libphysfs.la
|
||||
|
||||
SUBDIRS = platform archivers zlib114 . test extras
|
||||
|
||||
libphysfsincludedir = $(includedir)
|
||||
libphysfsinclude_HEADERS = \
|
||||
physfs.h
|
||||
|
||||
libphysfs_la_SOURCES = \
|
||||
physfs.c \
|
||||
physfs_internal.h \
|
||||
physfs_byteorder.c
|
||||
|
||||
if BUILD_ZLIB
|
||||
ZLIB_LIB = zlib114/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 \
|
||||
CWProjects.sit \
|
||||
physfs.spec.in \
|
||||
physfs.spec \
|
||||
physfs.dsp \
|
||||
test_physfs.dsp \
|
||||
makeos2.cmd
|
||||
|
||||
dist-hook:
|
||||
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
|
||||
|
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.8
|
||||
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 GNU LGPL license: http://www.gnu.org/copyleft/lesser.html
|
|
@ -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 0.1.8
|
||||
Version 1
|
||||
Description PhysFS 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 0.1.8
|
||||
Version 1
|
||||
Description PhysFS 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 GNU LGPL license: http://www.gnu.org/copyleft/lesser.html
|
|
@ -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.
|
||||
|
31
TODO
31
TODO
|
@ -1,31 +0,0 @@
|
|||
Stuff that needs to be done and wishlist:
|
||||
|
||||
These are in no particular order. A 1.0 release is reliant on doing some of
|
||||
this stuff. 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. I thought it might be neat to have MBOX and Maildir
|
||||
support so that both "archives" look identical to an application; might be
|
||||
nice for an email program. That's blue sky, unless someone wants to tackle
|
||||
it.
|
||||
- I'm a little nervous about the use of linked lists in qpak.c.
|
||||
- Add qpak.c and PHYSFS_SUPPORTS_QPAK to mac classic projects.
|
||||
- macclassic.c :
|
||||
"/* (Hmm. Default behaviour is broken in the base library. :) ) */"
|
||||
- Platforms to be verified as working: Solaris, WinNT 3.1, WinME, WinXP,
|
||||
MacOS 8.1
|
||||
- Platforms to port to: PocketPC (Maybe can just use win32.c?),
|
||||
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).
|
||||
- Check for tab chars in the source.
|
||||
- Probably other stuff. Requests and recommendations are welcome.
|
||||
|
||||
// end of TODO ...
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
|
||||
#undef DEBUG
|
||||
#undef DEBUG_CHATTER
|
||||
#undef NDEBUG
|
||||
#undef PHYSFS_SUPPORTS_ZIP
|
||||
#undef PHYSFS_SUPPORTS_GRP
|
||||
#undef PHYSFS_HAVE_READLINE
|
||||
#undef PHYSFS_HAVE_LLSEEK
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
Makefile
|
||||
.deps
|
||||
.libs
|
||||
unzip.lo
|
||||
dir.lo
|
||||
Makefile.in
|
||||
grp.lo
|
||||
zip.lo
|
||||
libarchivers.la
|
||||
qpak.lo
|
|
@ -1,14 +0,0 @@
|
|||
noinst_LTLIBRARIES = libarchivers.la
|
||||
|
||||
if BUILD_ZLIB
|
||||
INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/zlib114
|
||||
else
|
||||
INCLUDES = -I$(top_srcdir)
|
||||
endif
|
||||
|
||||
libarchivers_la_SOURCES = \
|
||||
dir.c \
|
||||
grp.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 ... */
|
||||
|
778
archivers/qpak.c
778
archivers/qpak.c
|
@ -1,778 +0,0 @@
|
|||
/*
|
||||
* Quake PAK support routines for PhysicsFS.
|
||||
*
|
||||
* This driver handles id Software Quake PAK files.
|
||||
*
|
||||
* Please see the file LICENSE in the source's root directory.
|
||||
*
|
||||
* This file written by Ed Sinjiashvili.
|
||||
*/
|
||||
|
||||
#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"
|
||||
|
||||
#define QPAK_MAXDIRLEN 60
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char name[56];
|
||||
PHYSFS_uint32 offset;
|
||||
PHYSFS_uint32 size;
|
||||
} QPAKentry;
|
||||
|
||||
typedef struct tagQPAKdirentry
|
||||
{
|
||||
char *name;
|
||||
QPAKentry *entry;
|
||||
struct tagQPAKdirentry *next;
|
||||
} QPAKdirentry;
|
||||
|
||||
typedef struct QPAKDirectory
|
||||
{
|
||||
char name[QPAK_MAXDIRLEN];
|
||||
|
||||
struct QPAKDirectory *dirs, *next;
|
||||
|
||||
QPAKdirentry *files;
|
||||
} QPAKdirectory;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
void *handle;
|
||||
char *filename;
|
||||
PHYSFS_uint32 dirOffset;
|
||||
PHYSFS_uint32 totalEntries;
|
||||
QPAKentry *entries;
|
||||
QPAKdirectory *root;
|
||||
} QPAKinfo;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
void *handle;
|
||||
QPAKentry *entry;
|
||||
PHYSFS_sint64 curPos;
|
||||
} QPAKfileinfo;
|
||||
|
||||
|
||||
static int QPAK_isArchive(const char *filename, int forWriting);
|
||||
static DirHandle *QPAK_openArchive(const char *name, int forWriting);
|
||||
static void QPAK_dirClose(DirHandle *h);
|
||||
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 *e);
|
||||
static int QPAK_isSymLink(DirHandle *h, const char *name, int *e);
|
||||
static PHYSFS_sint64 QPAK_getLastModTime(DirHandle *h, const char *n, int *e);
|
||||
static FileHandle *QPAK_openRead(DirHandle *h, const char *name, int *e);
|
||||
static FileHandle *QPAK_openWrite(DirHandle *h, const char *name);
|
||||
static FileHandle *QPAK_openAppend(DirHandle *h, const char *name);
|
||||
|
||||
|
||||
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_remove(DirHandle *h, const char *name);
|
||||
static int QPAK_mkdir(DirHandle *h, const char *name);
|
||||
|
||||
|
||||
const PHYSFS_ArchiveInfo __PHYSFS_ArchiveInfo_QPAK =
|
||||
{
|
||||
"PAK",
|
||||
"Quake PAK file format",
|
||||
"Ed Sinjiashvili <slimb@swes.saren.ru>",
|
||||
"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 */
|
||||
};
|
||||
|
||||
|
||||
#define QPAK_MAGIC 0x4B434150 /* look like "PACK" in ascii. */
|
||||
|
||||
|
||||
/*
|
||||
* Read an unsigned 32-bit int and swap to native byte order.
|
||||
*/
|
||||
static int readui32(void *in, PHYSFS_uint32 *val)
|
||||
{
|
||||
PHYSFS_uint32 v;
|
||||
BAIL_IF_MACRO(__PHYSFS_platformRead(in, &v, sizeof (v), 1) != 1, NULL, 0);
|
||||
*val = PHYSFS_swapULE32(v);
|
||||
return(1);
|
||||
} /* readui32 */
|
||||
|
||||
|
||||
static int openQPak(const char *filename, int forWriting, void **fileHandle)
|
||||
{
|
||||
PHYSFS_uint32 sig;
|
||||
|
||||
*fileHandle = NULL;
|
||||
BAIL_IF_MACRO(forWriting, ERR_ARC_IS_READ_ONLY, 0);
|
||||
|
||||
*fileHandle = __PHYSFS_platformOpenRead(filename);
|
||||
BAIL_IF_MACRO(*fileHandle == NULL, NULL, 0);
|
||||
|
||||
if (!readui32(*fileHandle, &sig))
|
||||
goto openPak_failed;
|
||||
|
||||
if (sig != QPAK_MAGIC)
|
||||
{
|
||||
__PHYSFS_setError(ERR_UNSUPPORTED_ARCHIVE);
|
||||
goto openPak_failed;
|
||||
} /* if */
|
||||
|
||||
return(1);
|
||||
|
||||
openPak_failed:
|
||||
if (*fileHandle != NULL)
|
||||
__PHYSFS_platformClose(*fileHandle);
|
||||
|
||||
*fileHandle = NULL;
|
||||
return(0);
|
||||
} /* openQPak */
|
||||
|
||||
|
||||
static int QPAK_isArchive(const char *filename, int forWriting)
|
||||
{
|
||||
void *fileHandle;
|
||||
int retval = openQPak(filename, forWriting, &fileHandle);
|
||||
|
||||
if (fileHandle != NULL)
|
||||
__PHYSFS_platformClose(fileHandle);
|
||||
|
||||
return(retval);
|
||||
} /* QPAK_isArchive */
|
||||
|
||||
|
||||
static int qpak_loadEntries(void *fh, int dirOffset, int numEntries,
|
||||
QPAKentry *entries)
|
||||
{
|
||||
PHYSFS_sint32 i;
|
||||
|
||||
BAIL_IF_MACRO(__PHYSFS_platformSeek(fh, dirOffset) == 0, NULL, 0);
|
||||
|
||||
for (i = 0; i < numEntries; i++, entries++)
|
||||
{
|
||||
PHYSFS_sint64 r = __PHYSFS_platformRead(fh, entries->name, 56, 1);
|
||||
BAIL_IF_MACRO(r == 0, NULL, 0);
|
||||
BAIL_IF_MACRO(!readui32(fh, &entries->offset), NULL, 0);
|
||||
BAIL_IF_MACRO(!readui32(fh, &entries->size), NULL, 0);
|
||||
} /* for */
|
||||
|
||||
return(1);
|
||||
} /* qpak_loadEntries */
|
||||
|
||||
|
||||
static QPAKdirentry *qpak_newDirentry(char *name, QPAKentry *entry)
|
||||
{
|
||||
QPAKdirentry *retval = (QPAKdirentry *) malloc(sizeof (QPAKdirentry));
|
||||
BAIL_IF_MACRO(retval == NULL, ERR_OUT_OF_MEMORY, 0);
|
||||
|
||||
retval->name = name;
|
||||
retval->entry = entry;
|
||||
retval->next = NULL;
|
||||
|
||||
return(retval);
|
||||
} /* qpak_newDirentry */
|
||||
|
||||
|
||||
static void qpak_deleteDirentry(QPAKdirentry *e)
|
||||
{
|
||||
while (e != NULL)
|
||||
{
|
||||
QPAKdirentry *next = e->next;
|
||||
free(e);
|
||||
e = next;
|
||||
} /* while */
|
||||
} /* qpak_deleteDirentry */
|
||||
|
||||
|
||||
static QPAKdirectory *qpak_newDirectory(char *name)
|
||||
{
|
||||
QPAKdirectory *dir = (QPAKdirectory *) malloc(sizeof (QPAKdirectory));
|
||||
BAIL_IF_MACRO(dir == NULL, ERR_OUT_OF_MEMORY, 0);
|
||||
|
||||
strcpy(dir->name, name);
|
||||
dir->dirs = NULL;
|
||||
dir->next = NULL;
|
||||
dir->files = NULL;
|
||||
|
||||
return dir;
|
||||
} /* qpak_newDirectory */
|
||||
|
||||
|
||||
static void qpak_deleteDirectory(QPAKdirectory *d)
|
||||
{
|
||||
while (d != NULL)
|
||||
{
|
||||
QPAKdirectory *next = d->next;
|
||||
qpak_deleteDirentry(d->files);
|
||||
qpak_deleteDirectory(d->dirs);
|
||||
free(d);
|
||||
d = next;
|
||||
} /* while */
|
||||
} /* qpak_deleteDirectory */
|
||||
|
||||
|
||||
static int qpak_addFile(QPAKdirectory *dir, char *name, QPAKentry *entry)
|
||||
{
|
||||
QPAKdirentry *file = qpak_newDirentry(name, entry);
|
||||
if (file == NULL)
|
||||
return(0);
|
||||
|
||||
/* !!! FIXME: Traversing a linkedlist gets slower with each added file. */
|
||||
if (dir->files == NULL)
|
||||
{
|
||||
dir->files = file;
|
||||
} /* if */
|
||||
else
|
||||
{
|
||||
QPAKdirentry *tail = dir->files;
|
||||
while (tail->next != NULL)
|
||||
tail = tail->next;
|
||||
|
||||
tail->next = file;
|
||||
} /* else */
|
||||
|
||||
return(1);
|
||||
} /* qpak_addFile */
|
||||
|
||||
|
||||
static QPAKdirectory *qpak_findDirectory(QPAKdirectory *root, const char *name)
|
||||
{
|
||||
char *p = strchr(name, '/');
|
||||
|
||||
if (p == NULL)
|
||||
{
|
||||
QPAKdirectory *thisDir = root->dirs;
|
||||
while (thisDir != NULL)
|
||||
{
|
||||
if (strcmp(thisDir->name, name) == 0)
|
||||
return(thisDir);
|
||||
thisDir = thisDir->next;
|
||||
} /* while */
|
||||
} /* if */
|
||||
|
||||
else
|
||||
{
|
||||
char temp[QPAK_MAXDIRLEN];
|
||||
QPAKdirectory *thisDir = root->dirs;
|
||||
|
||||
strncpy (temp, name, p - name);
|
||||
temp[p - name] = '\0';
|
||||
|
||||
while (thisDir != NULL)
|
||||
{
|
||||
if (strcmp(thisDir->name, temp) == 0)
|
||||
return(qpak_findDirectory(thisDir, p + 1));
|
||||
thisDir = thisDir->next;
|
||||
} /* while */
|
||||
} /* else */
|
||||
|
||||
BAIL_MACRO(ERR_NO_SUCH_PATH, 0);
|
||||
} /* qpak_findDirectory */
|
||||
|
||||
|
||||
static QPAKdirectory *qpak_addDir(QPAKdirectory *dir, char *name)
|
||||
{
|
||||
QPAKdirectory *newDir = qpak_findDirectory(dir, name);
|
||||
if (newDir != 0)
|
||||
return(newDir);
|
||||
|
||||
newDir = qpak_newDirectory(name);
|
||||
if (newDir == 0)
|
||||
return 0;
|
||||
|
||||
if (dir->dirs == NULL)
|
||||
{
|
||||
dir->dirs = newDir;
|
||||
} /* if */
|
||||
|
||||
else
|
||||
{
|
||||
QPAKdirectory *tail = dir->dirs;
|
||||
while (tail->next != NULL)
|
||||
tail = tail->next;
|
||||
|
||||
tail->next = newDir;
|
||||
} /* else */
|
||||
|
||||
return(newDir);
|
||||
} /* qpak_addDir */
|
||||
|
||||
|
||||
static int qpak_addEntry(QPAKdirectory *dir, char *name, QPAKentry *entry)
|
||||
{
|
||||
char tempName[QPAK_MAXDIRLEN];
|
||||
QPAKdirectory *child;
|
||||
char *p = strchr(name, '/');
|
||||
if (p == NULL)
|
||||
return(qpak_addFile(dir, name, entry));
|
||||
|
||||
strncpy(tempName, name, p - name);
|
||||
tempName[p - name] = '\0';
|
||||
|
||||
child = qpak_addDir(dir, tempName);
|
||||
return(qpak_addEntry(child, p + 1, entry));
|
||||
} /* qpak_addEntry */
|
||||
|
||||
|
||||
static QPAKentry *qpak_findEntry(QPAKdirectory *root, const char *name)
|
||||
{
|
||||
QPAKdirectory *dir = NULL;
|
||||
QPAKdirentry *thisFile = NULL;
|
||||
const char *t = strrchr (name, '/');
|
||||
|
||||
if (t == NULL)
|
||||
{
|
||||
dir = root;
|
||||
t = name;
|
||||
} /* if */
|
||||
|
||||
else
|
||||
{
|
||||
char temp[QPAK_MAXDIRLEN];
|
||||
strncpy(temp, name, t - name);
|
||||
temp[t - name] = '\0';
|
||||
dir = qpak_findDirectory(root, temp);
|
||||
t++;
|
||||
} /* else */
|
||||
|
||||
if (dir == NULL)
|
||||
return(0);
|
||||
|
||||
thisFile = dir->files;
|
||||
|
||||
while (thisFile != NULL)
|
||||
{
|
||||
if (strcmp(thisFile->name, t) == 0)
|
||||
return(thisFile->entry);
|
||||
|
||||
thisFile = thisFile->next;
|
||||
} /* while */
|
||||
|
||||
BAIL_MACRO(ERR_NO_SUCH_FILE, 0);
|
||||
} /* qpak_findEntry */
|
||||
|
||||
|
||||
static int qpak_populateDirectories(QPAKentry *entries, int numEntries,
|
||||
QPAKdirectory *root)
|
||||
{
|
||||
PHYSFS_sint32 i;
|
||||
QPAKentry *entry = entries;
|
||||
|
||||
for (i = 0; i < numEntries; i++, entry++)
|
||||
{
|
||||
if (qpak_addEntry(root, entry->name, entry) == 0)
|
||||
return(0);
|
||||
} /* for */
|
||||
|
||||
return(1);
|
||||
} /* qpak_populateDirectories */
|
||||
|
||||
|
||||
static void qpak_deletePakInfo(QPAKinfo *pakInfo)
|
||||
{
|
||||
if (pakInfo->handle != NULL)
|
||||
__PHYSFS_platformClose(pakInfo->handle);
|
||||
|
||||
if (pakInfo->filename != NULL)
|
||||
free(pakInfo->filename);
|
||||
|
||||
if (pakInfo->entries != NULL)
|
||||
free(pakInfo->entries);
|
||||
|
||||
qpak_deleteDirectory(pakInfo->root);
|
||||
|
||||
free(pakInfo);
|
||||
} /* qpak_deletePakInfo */
|
||||
|
||||
|
||||
static int qpak_entry_cmp(void *_a, PHYSFS_uint32 one, PHYSFS_uint32 two)
|
||||
{
|
||||
QPAKentry *a = (QPAKentry *) _a;
|
||||
return(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 DirHandle *QPAK_openArchive(const char *name, int forWriting)
|
||||
{
|
||||
void *fh = NULL;
|
||||
PHYSFS_uint32 dirOffset, dirLength;
|
||||
QPAKinfo *pi;
|
||||
DirHandle *retval;
|
||||
|
||||
retval = (DirHandle *) malloc(sizeof (DirHandle));
|
||||
BAIL_IF_MACRO(retval == NULL, ERR_OUT_OF_MEMORY, NULL);
|
||||
|
||||
pi = (QPAKinfo *) malloc(sizeof (QPAKinfo));
|
||||
if (pi == NULL)
|
||||
{
|
||||
free(retval);
|
||||
BAIL_MACRO(ERR_OUT_OF_MEMORY, NULL);
|
||||
} /* if */
|
||||
|
||||
retval->opaque = pi;
|
||||
|
||||
pi->filename = (char *) malloc(strlen(name) + 1);
|
||||
if (pi->filename == NULL)
|
||||
{
|
||||
__PHYSFS_setError(ERR_OUT_OF_MEMORY);
|
||||
goto QPAK_openArchive_failed;
|
||||
} /* if */
|
||||
|
||||
if (!openQPak(name, forWriting, &fh))
|
||||
goto QPAK_openArchive_failed;
|
||||
|
||||
if (!readui32(fh, &dirOffset))
|
||||
goto QPAK_openArchive_failed;
|
||||
|
||||
if (!readui32(fh, &dirLength))
|
||||
goto QPAK_openArchive_failed;
|
||||
|
||||
if (__PHYSFS_platformFileLength(fh) < dirOffset + dirLength)
|
||||
goto QPAK_openArchive_failed;
|
||||
|
||||
strcpy(pi->filename, name);
|
||||
pi->handle = fh;
|
||||
pi->dirOffset = dirOffset;
|
||||
pi->totalEntries = dirLength / 64;
|
||||
|
||||
pi->entries = (QPAKentry *) malloc(pi->totalEntries * sizeof (QPAKentry));
|
||||
if (pi->entries == NULL)
|
||||
{
|
||||
__PHYSFS_setError(ERR_OUT_OF_MEMORY);
|
||||
goto QPAK_openArchive_failed;
|
||||
} /* if */
|
||||
|
||||
if (qpak_loadEntries(fh, dirOffset, pi->totalEntries, pi->entries) == 0)
|
||||
goto QPAK_openArchive_failed;
|
||||
|
||||
__PHYSFS_sort(pi->entries, pi->totalEntries,
|
||||
qpak_entry_cmp, qpak_entry_swap);
|
||||
|
||||
pi->root = qpak_newDirectory("");
|
||||
if (pi->root == NULL)
|
||||
goto QPAK_openArchive_failed;
|
||||
|
||||
if (qpak_populateDirectories(pi->entries, pi->totalEntries, pi->root) == 0)
|
||||
goto QPAK_openArchive_failed;
|
||||
|
||||
retval->funcs = &__PHYSFS_DirFunctions_QPAK;
|
||||
return(retval);
|
||||
|
||||
QPAK_openArchive_failed:
|
||||
if (retval != NULL)
|
||||
{
|
||||
if (retval->opaque != NULL)
|
||||
qpak_deletePakInfo((QPAKinfo *) retval->opaque);
|
||||
|
||||
free(retval);
|
||||
} /* if */
|
||||
|
||||
if (fh != NULL)
|
||||
__PHYSFS_platformClose(fh);
|
||||
|
||||
return(0);
|
||||
} /* QPAK_openArchive */
|
||||
|
||||
|
||||
static void QPAK_dirClose(DirHandle *dirHandle)
|
||||
{
|
||||
qpak_deletePakInfo((QPAKinfo *) dirHandle->opaque);
|
||||
free(dirHandle);
|
||||
} /* QPAK_dirClose */
|
||||
|
||||
|
||||
static LinkedStringList *QPAK_enumerateFiles(DirHandle *h, const char *dirname,
|
||||
int omitSymLinks)
|
||||
{
|
||||
LinkedStringList *retval = NULL, *p = NULL;
|
||||
QPAKdirectory *dir;
|
||||
QPAKinfo *info = (QPAKinfo *) h->opaque;
|
||||
|
||||
if ((dirname == NULL) || (*dirname == '\0'))
|
||||
dir = info->root;
|
||||
else
|
||||
dir = qpak_findDirectory(info->root, dirname);
|
||||
|
||||
if (dir != NULL)
|
||||
{
|
||||
QPAKdirectory *child = dir->dirs;
|
||||
QPAKdirentry *file = dir->files;
|
||||
|
||||
while (child != NULL)
|
||||
{
|
||||
retval = __PHYSFS_addToLinkedStringList(retval, &p, child->name, -1);
|
||||
child = child->next;
|
||||
} /* while */
|
||||
|
||||
while (file != NULL)
|
||||
{
|
||||
retval = __PHYSFS_addToLinkedStringList(retval, &p, file->name, -1);
|
||||
file = file->next;
|
||||
} /* while */
|
||||
} /* if */
|
||||
|
||||
return(retval);
|
||||
} /* QPAK_enumerateFiles */
|
||||
|
||||
|
||||
static int QPAK_exists(DirHandle *h, const char *name)
|
||||
{
|
||||
QPAKinfo *driver = (QPAKinfo *) h->opaque;
|
||||
|
||||
if ((name == NULL) || (*name == '\0'))
|
||||
return(0);
|
||||
|
||||
if (qpak_findDirectory(driver->root, name) != 0)
|
||||
return(1);
|
||||
|
||||
if (qpak_findEntry(driver->root, name) != 0)
|
||||
return(1);
|
||||
|
||||
return(0);
|
||||
} /* QPAK_exists */
|
||||
|
||||
|
||||
static int QPAK_isDirectory(DirHandle *h, const char *name, int *fileExists)
|
||||
{
|
||||
QPAKinfo *info = (QPAKinfo *) h->opaque;
|
||||
*fileExists = (qpak_findDirectory(info->root, name) != 0);
|
||||
return(*fileExists);
|
||||
} /* QPAK_isDirectory */
|
||||
|
||||
|
||||
static int QPAK_isSymLink(DirHandle *h, const char *name, int *fileExists)
|
||||
{
|
||||
*fileExists = QPAK_exists(h, name);
|
||||
return(0); /* we don't support symlinks for now */
|
||||
} /* QPAK_isSymlink */
|
||||
|
||||
|
||||
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 */
|
||||
|
||||
|
||||
static PHYSFS_sint64 QPAK_getLastModTime(DirHandle *h,
|
||||
const char *name,
|
||||
int *fileExists)
|
||||
{
|
||||
QPAKinfo *info = (QPAKinfo *) h->opaque;
|
||||
PHYSFS_sint64 retval = -1;
|
||||
|
||||
*fileExists = QPAK_exists(h, name);
|
||||
if (*fileExists)
|
||||
retval = __PHYSFS_platformGetLastModTime(info->filename);
|
||||
|
||||
return(retval);
|
||||
} /* QPAK_getLastModTime */
|
||||
|
||||
|
||||
static void *qpak_getFileHandle(const char *name, QPAKentry *entry)
|
||||
{
|
||||
void *retval = __PHYSFS_platformOpenRead(name);
|
||||
if (retval == NULL)
|
||||
return(NULL);
|
||||
|
||||
if (!__PHYSFS_platformSeek(retval, entry->offset))
|
||||
{
|
||||
__PHYSFS_platformClose(retval);
|
||||
return(NULL);
|
||||
} /* if */
|
||||
|
||||
return(retval);
|
||||
} /* qpak_getFileHandle */
|
||||
|
||||
|
||||
static FileHandle *QPAK_openRead(DirHandle *h, const char *fnm, int *fileExists)
|
||||
{
|
||||
QPAKinfo *driver = (QPAKinfo *) h->opaque;
|
||||
QPAKentry *entry = qpak_findEntry(driver->root, fnm);
|
||||
QPAKfileinfo *fileDriver = 0;
|
||||
FileHandle *result = 0;
|
||||
|
||||
*fileExists = (entry != NULL);
|
||||
if (entry == NULL)
|
||||
return(NULL);
|
||||
|
||||
fileDriver = (QPAKfileinfo *) malloc(sizeof (QPAKfileinfo));
|
||||
BAIL_IF_MACRO(fileDriver == NULL, ERR_OUT_OF_MEMORY, NULL);
|
||||
|
||||
fileDriver->handle = qpak_getFileHandle(driver->filename, entry);
|
||||
if (fileDriver->handle == NULL)
|
||||
{
|
||||
free(fileDriver);
|
||||
return(NULL);
|
||||
} /* if */
|
||||
|
||||
fileDriver->entry = entry;
|
||||
fileDriver->curPos = 0;
|
||||
|
||||
result = (FileHandle *)malloc(sizeof (FileHandle));
|
||||
if (result == NULL)
|
||||
{
|
||||
__PHYSFS_platformClose(fileDriver->handle);
|
||||
free(fileDriver);
|
||||
BAIL_MACRO(ERR_OUT_OF_MEMORY, NULL);
|
||||
} /* if */
|
||||
|
||||
result->opaque = fileDriver;
|
||||
result->dirHandle = h;
|
||||
result->funcs = &__PHYSFS_FileFunctions_QPAK;
|
||||
return(result);
|
||||
} /* 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 PHYSFS_sint64 QPAK_read(FileHandle *handle, void *buffer,
|
||||
PHYSFS_uint32 objSize, PHYSFS_uint32 objCount)
|
||||
{
|
||||
QPAKfileinfo *finfo = (QPAKfileinfo *) (handle->opaque);
|
||||
QPAKentry *entry = finfo->entry;
|
||||
PHYSFS_uint64 bytesLeft = entry->size - finfo->curPos;
|
||||
PHYSFS_uint64 objsLeft = (bytesLeft / objSize);
|
||||
PHYSFS_sint64 rc;
|
||||
|
||||
if (objsLeft < objCount)
|
||||
objCount = (PHYSFS_uint32) objsLeft;
|
||||
|
||||
rc = __PHYSFS_platformRead(finfo->handle, buffer, objSize, objCount);
|
||||
if (rc > 0)
|
||||
finfo->curPos += (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 >= (PHYSFS_sint64) 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;
|
||||
PHYSFS_uint64 newPos = entry->offset + offset;
|
||||
int rc;
|
||||
|
||||
BAIL_IF_MACRO(offset < 0, ERR_INVALID_ARGUMENT, 0);
|
||||
BAIL_IF_MACRO(newPos > entry->offset + entry->size, ERR_PAST_EOF, 0);
|
||||
rc = __PHYSFS_platformSeek(finfo->handle, newPos);
|
||||
if (rc)
|
||||
finfo->curPos = offset;
|
||||
|
||||
return(rc);
|
||||
} /* QPAK_seek */
|
||||
|
||||
|
||||
static PHYSFS_sint64 QPAK_fileLength(FileHandle *handle)
|
||||
{
|
||||
return ((QPAKfileinfo *) handle->opaque)->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 */
|
||||
|
||||
#endif /* defined PHYSFS_SUPPORTS_QPAK */
|
||||
|
||||
/* end of qpak.c ... */
|
||||
|
||||
|
1442
archivers/zip.c
1442
archivers/zip.c
File diff suppressed because it is too large
Load Diff
13
bootstrap
13
bootstrap
|
@ -1,13 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
echo "Initial preparation...this can take awhile, so sit tight..."
|
||||
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 ..."
|
||||
|
480
configure.in
480
configure.in
|
@ -1,480 +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=0
|
||||
MINOR_VERSION=1
|
||||
MICRO_VERSION=8
|
||||
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_BUILD
|
||||
AC_CANONICAL_HOST
|
||||
AC_CANONICAL_TARGET
|
||||
|
||||
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 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])
|
||||
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])
|
||||
LIBS="$LIBS -lreadline -lcurses"
|
||||
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 = 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
|
||||
|
||||
if test x$physfslang = xspanish; then
|
||||
physfs_valid_lang=yes
|
||||
AC_DEFINE([PHYSFS_LANG], PHYSFS_LANG_SPANISH, [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 = xgerman; then
|
||||
physfs_valid_lang=yes
|
||||
AC_DEFINE([PHYSFS_LANG], PHYSFS_LANG_GERMAN, [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=spanish])
|
||||
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([*** --enable-language=french])
|
||||
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$build_os = xbeos; then
|
||||
this_is_beos=yes
|
||||
enable_pthreads=no
|
||||
have_non_posix_threads=yes
|
||||
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$build_os = xcygwin; then
|
||||
this_is_cygwin=yes
|
||||
PHYSFSCFLAGS="$PHYSFSCFLAGS -DWIN32"
|
||||
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 $build_os |sed "s/darwin.*/darwin/"`
|
||||
if test x$x = xdarwin -a x$build_vendor = xapple; then
|
||||
this_is_macosx=yes
|
||||
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 $build_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 $build_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 $build_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 $build_os |tr A-Z a-z |sed "s/.*os2.*/os2/"`
|
||||
if test x$x = xos2; then
|
||||
this_is_os2=yes
|
||||
PHYSFSCFLAGS="$PHYSFSCFLAGS -DOS2"
|
||||
fi
|
||||
|
||||
AC_MSG_RESULT([$this_is_os2])
|
||||
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)
|
||||
|
||||
AC_OUTPUT([
|
||||
Makefile
|
||||
archivers/Makefile
|
||||
platform/Makefile
|
||||
zlib114/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,13 +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.
|
||||
|
||||
You are free to distribute this software under the terms of the GNU Lesser
|
||||
General Public License.
|
||||
On Debian systems, the complete text of the GNU Lesser General Public License
|
||||
can be found in the file `/usr/share/common-licenses/LGPL'.
|
|
@ -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.8
|
||||
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 ... */
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
# Doxyfile 1.2.16
|
||||
# Doxyfile 1.3.4
|
||||
|
||||
# This file describes the settings to be used by the documentation system
|
||||
# doxygen (www.doxygen.org) for a project
|
||||
|
@ -11,7 +11,7 @@
|
|||
# Values that contain spaces should be placed between quotes (" ")
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# General configuration options
|
||||
# Project related configuration options
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
|
||||
|
@ -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 = 0.1.8
|
||||
# (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.
|
||||
|
@ -36,50 +37,22 @@ OUTPUT_DIRECTORY = docs
|
|||
# documentation generated by doxygen is written. Doxygen will use this
|
||||
# information to generate all constant output in the proper language.
|
||||
# The default language is English, other supported languages are:
|
||||
# Brazilian, Chinese, Chinese-Traditional, Croatian, Czech, Danish, Dutch,
|
||||
# Finnish, French, German, Greek, Hungarian, Italian, Japanese, Korean,
|
||||
# Norwegian, Polish, Portuguese, Romanian, Russian, Slovak, Slovene,
|
||||
# Spanish, Swedish and Ukrainian.
|
||||
# Brazilian, Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, Dutch,
|
||||
# Finnish, French, German, Greek, Hungarian, Italian, Japanese, Japanese-en
|
||||
# (Japanese with English messages), Korean, Norwegian, Polish, Portuguese,
|
||||
# Romanian, Russian, Serbian, Slovak, Slovene, Spanish, Swedish, and Ukrainian.
|
||||
|
||||
OUTPUT_LANGUAGE = English
|
||||
|
||||
# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
|
||||
# documentation are documented, even if no documentation was available.
|
||||
# Private class members and static file members will be hidden unless
|
||||
# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
|
||||
# This tag can be used to specify the encoding used in the generated output.
|
||||
# The encoding is not always determined by the language that is chosen,
|
||||
# but also whether or not the output is meant for Windows or non-Windows users.
|
||||
# In case there is a difference, setting the USE_WINDOWS_ENCODING tag to YES
|
||||
# forces the Windows encoding (this is the default for the Windows binary),
|
||||
# whereas setting the tag to NO uses a Unix-style encoding (the default for
|
||||
# all platforms other than Windows).
|
||||
|
||||
EXTRACT_ALL = NO
|
||||
|
||||
# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
|
||||
# will be included in the documentation.
|
||||
|
||||
EXTRACT_PRIVATE = NO
|
||||
|
||||
# If the EXTRACT_STATIC tag is set to YES all static members of a file
|
||||
# will be included in the documentation.
|
||||
|
||||
EXTRACT_STATIC = NO
|
||||
|
||||
# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
|
||||
# defined locally in source files will be included in the documentation.
|
||||
# If set to NO only classes defined in header files are included.
|
||||
|
||||
EXTRACT_LOCAL_CLASSES = NO
|
||||
|
||||
# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
|
||||
# undocumented members of documented classes, files or namespaces.
|
||||
# If set to NO (the default) these members will be included in the
|
||||
# various overviews, but no documentation section is generated.
|
||||
# This option has no effect if EXTRACT_ALL is enabled.
|
||||
|
||||
HIDE_UNDOC_MEMBERS = NO
|
||||
|
||||
# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
|
||||
# undocumented classes that are normally visible in the class hierarchy.
|
||||
# If set to NO (the default) these class will be included in the various
|
||||
# overviews. This option has no effect if EXTRACT_ALL is enabled.
|
||||
|
||||
HIDE_UNDOC_CLASSES = NO
|
||||
USE_WINDOWS_ENCODING = NO
|
||||
|
||||
# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
|
||||
# include brief member descriptions after the members that are listed in
|
||||
|
@ -115,65 +88,34 @@ INLINE_INHERITED_MEMB = NO
|
|||
FULL_PATH_NAMES = NO
|
||||
|
||||
# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
|
||||
# can be used to strip a user defined part of the path. Stripping is
|
||||
# can be used to strip a user-defined part of the path. Stripping is
|
||||
# only done if one of the specified strings matches the left-hand part of
|
||||
# the path. It is allowed to use relative paths in the argument list.
|
||||
|
||||
STRIP_FROM_PATH =
|
||||
|
||||
# The INTERNAL_DOCS tag determines if documentation
|
||||
# that is typed after a \internal command is included. If the tag is set
|
||||
# to NO (the default) then the documentation will be excluded.
|
||||
# Set it to YES to include the internal documentation.
|
||||
|
||||
INTERNAL_DOCS = NO
|
||||
|
||||
# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
|
||||
# doxygen to hide any special comment blocks from generated source code
|
||||
# fragments. Normal C and C++ comments will always remain visible.
|
||||
|
||||
STRIP_CODE_COMMENTS = YES
|
||||
|
||||
# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
|
||||
# file names in lower case letters. If set to YES upper case letters are also
|
||||
# allowed. This is useful if you have classes or files whose names only differ
|
||||
# in case and if your file system supports case sensitive file names. Windows
|
||||
# users are adviced to set this option to NO.
|
||||
|
||||
CASE_SENSE_NAMES = YES
|
||||
|
||||
# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
|
||||
# (but less readable) file names. This can be useful is your file systems
|
||||
# doesn't support long names like on DOS, Mac, or CD-ROM.
|
||||
|
||||
SHORT_NAMES = NO
|
||||
|
||||
# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
|
||||
# will show members with their full class and namespace scopes in the
|
||||
# documentation. If set to YES the scope will be hidden.
|
||||
|
||||
HIDE_SCOPE_NAMES = NO
|
||||
|
||||
# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
|
||||
# will generate a verbatim copy of the header file for each class for
|
||||
# which an include is specified. Set to NO to disable this.
|
||||
|
||||
VERBATIM_HEADERS = YES
|
||||
|
||||
# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
|
||||
# will put list of the files that are included by a file in the documentation
|
||||
# of that file.
|
||||
|
||||
SHOW_INCLUDE_FILES = YES
|
||||
|
||||
# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
|
||||
# will interpret the first line (until the first dot) of a JavaDoc-style
|
||||
# comment as the brief description. If set to NO, the JavaDoc
|
||||
# comments will behave just like the Qt-style comments (thus requiring an
|
||||
# comments will behave just like the Qt-style comments (thus requiring an
|
||||
# explict @brief command for a brief description.
|
||||
|
||||
JAVADOC_AUTOBRIEF = NO
|
||||
|
||||
# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
|
||||
# treat a multi-line C++ special comment block (i.e. a block of //! or ///
|
||||
# comments) as a brief description. This used to be the default behaviour.
|
||||
# The new default is to treat a multi-line C++ comment block as a detailed
|
||||
# description. Set this tag to YES if you prefer the old behaviour instead.
|
||||
|
||||
MULTILINE_CPP_IS_BRIEF = NO
|
||||
|
||||
# If the DETAILS_AT_TOP tag is set to YES then Doxygen
|
||||
# will output the detailed description near the top, like JavaDoc.
|
||||
# If set to NO, the detailed description appears after the member
|
||||
|
@ -187,18 +129,6 @@ DETAILS_AT_TOP = NO
|
|||
|
||||
INHERIT_DOCS = YES
|
||||
|
||||
# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
|
||||
# is inserted in the documentation for inline members.
|
||||
|
||||
INLINE_INFO = YES
|
||||
|
||||
# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
|
||||
# will sort the (detailed) documentation of file and class members
|
||||
# alphabetically by member name. If set to NO the members will appear in
|
||||
# declaration order.
|
||||
|
||||
SORT_MEMBER_DOCS = YES
|
||||
|
||||
# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
|
||||
# tag is set to YES, then doxygen will reuse the documentation of the first
|
||||
# member in the group (if any) for the other members of the group. By default
|
||||
|
@ -211,6 +141,132 @@ DISTRIBUTE_GROUP_DOC = NO
|
|||
|
||||
TAB_SIZE = 4
|
||||
|
||||
# This tag can be used to specify a number of aliases that acts
|
||||
# as commands in the documentation. An alias has the form "name=value".
|
||||
# For example adding "sideeffect=\par Side Effects:\n" will allow you to
|
||||
# put the command \sideeffect (or @sideeffect) in the documentation, which
|
||||
# will result in a user-defined paragraph with heading "Side Effects:".
|
||||
# You can put \n's in the value part of an alias to insert newlines.
|
||||
|
||||
ALIASES =
|
||||
|
||||
# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
|
||||
# only. Doxygen will then generate output that is more tailored for C.
|
||||
# For instance, some of the names that are used will be different. The list
|
||||
# of all members will be omitted, etc.
|
||||
|
||||
OPTIMIZE_OUTPUT_FOR_C = YES
|
||||
|
||||
# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java sources
|
||||
# only. Doxygen will then generate output that is more tailored for Java.
|
||||
# For instance, namespaces will be presented as packages, qualified scopes
|
||||
# will look different, etc.
|
||||
|
||||
OPTIMIZE_OUTPUT_JAVA = NO
|
||||
|
||||
# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
|
||||
# the same type (for instance a group of public functions) to be put as a
|
||||
# subgroup of that type (e.g. under the Public Functions section). Set it to
|
||||
# NO to prevent subgrouping. Alternatively, this can be done per class using
|
||||
# the \nosubgrouping command.
|
||||
|
||||
SUBGROUPING = YES
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Build related configuration options
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
|
||||
# documentation are documented, even if no documentation was available.
|
||||
# Private class members and static file members will be hidden unless
|
||||
# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
|
||||
|
||||
EXTRACT_ALL = NO
|
||||
|
||||
# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
|
||||
# will be included in the documentation.
|
||||
|
||||
EXTRACT_PRIVATE = NO
|
||||
|
||||
# If the EXTRACT_STATIC tag is set to YES all static members of a file
|
||||
# will be included in the documentation.
|
||||
|
||||
EXTRACT_STATIC = NO
|
||||
|
||||
# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
|
||||
# defined locally in source files will be included in the documentation.
|
||||
# If set to NO only classes defined in header files are included.
|
||||
|
||||
EXTRACT_LOCAL_CLASSES = NO
|
||||
|
||||
# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
|
||||
# undocumented members of documented classes, files or namespaces.
|
||||
# If set to NO (the default) these members will be included in the
|
||||
# various overviews, but no documentation section is generated.
|
||||
# This option has no effect if EXTRACT_ALL is enabled.
|
||||
|
||||
HIDE_UNDOC_MEMBERS = NO
|
||||
|
||||
# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
|
||||
# undocumented classes that are normally visible in the class hierarchy.
|
||||
# If set to NO (the default) these classes will be included in the various
|
||||
# overviews. This option has no effect if EXTRACT_ALL is enabled.
|
||||
|
||||
HIDE_UNDOC_CLASSES = NO
|
||||
|
||||
# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
|
||||
# friend (class|struct|union) declarations.
|
||||
# If set to NO (the default) these declarations will be included in the
|
||||
# documentation.
|
||||
|
||||
HIDE_FRIEND_COMPOUNDS = NO
|
||||
|
||||
# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
|
||||
# documentation blocks found inside the body of a function.
|
||||
# If set to NO (the default) these blocks will be appended to the
|
||||
# function's detailed documentation block.
|
||||
|
||||
HIDE_IN_BODY_DOCS = NO
|
||||
|
||||
# The INTERNAL_DOCS tag determines if documentation
|
||||
# that is typed after a \internal command is included. If the tag is set
|
||||
# to NO (the default) then the documentation will be excluded.
|
||||
# Set it to YES to include the internal documentation.
|
||||
|
||||
INTERNAL_DOCS = NO
|
||||
|
||||
# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
|
||||
# file names in lower-case letters. If set to YES upper-case letters are also
|
||||
# allowed. This is useful if you have classes or files whose names only differ
|
||||
# in case and if your file system supports case sensitive file names. Windows
|
||||
# users are advised to set this option to NO.
|
||||
|
||||
CASE_SENSE_NAMES = YES
|
||||
|
||||
# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
|
||||
# will show members with their full class and namespace scopes in the
|
||||
# documentation. If set to YES the scope will be hidden.
|
||||
|
||||
HIDE_SCOPE_NAMES = NO
|
||||
|
||||
# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
|
||||
# will put a list of the files that are included by a file in the documentation
|
||||
# of that file.
|
||||
|
||||
SHOW_INCLUDE_FILES = YES
|
||||
|
||||
# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
|
||||
# is inserted in the documentation for inline members.
|
||||
|
||||
INLINE_INFO = YES
|
||||
|
||||
# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
|
||||
# will sort the (detailed) documentation of file and class members
|
||||
# alphabetically by member name. If set to NO the members will appear in
|
||||
# declaration order.
|
||||
|
||||
SORT_MEMBER_DOCS = YES
|
||||
|
||||
# The GENERATE_TODOLIST tag can be used to enable (YES) or
|
||||
# disable (NO) the todo list. This list is created by putting \todo
|
||||
# commands in the documentation.
|
||||
|
@ -229,14 +285,11 @@ GENERATE_TESTLIST = YES
|
|||
|
||||
GENERATE_BUGLIST = YES
|
||||
|
||||
# This tag can be used to specify a number of aliases that acts
|
||||
# as commands in the documentation. An alias has the form "name=value".
|
||||
# For example adding "sideeffect=\par Side Effects:\n" will allow you to
|
||||
# put the command \sideeffect (or @sideeffect) in the documentation, which
|
||||
# will result in a user defined paragraph with heading "Side Effects:".
|
||||
# You can put \n's in the value part of an alias to insert newlines.
|
||||
# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
|
||||
# disable (NO) the deprecated list. This list is created by putting
|
||||
# \deprecated commands in the documentation.
|
||||
|
||||
ALIASES =
|
||||
GENERATE_DEPRECATEDLIST= YES
|
||||
|
||||
# The ENABLED_SECTIONS tag can be used to enable conditional
|
||||
# documentation sections, marked by \if sectionname ... \endif.
|
||||
|
@ -244,7 +297,7 @@ ALIASES =
|
|||
ENABLED_SECTIONS =
|
||||
|
||||
# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
|
||||
# the initial value of a variable or define consist of for it to appear in
|
||||
# the initial value of a variable or define consists of for it to appear in
|
||||
# the documentation. If the initializer consists of more lines than specified
|
||||
# here it will be hidden. Use a value of 0 to hide initializers completely.
|
||||
# The appearance of the initializer of individual variables and defines in the
|
||||
|
@ -253,20 +306,6 @@ ENABLED_SECTIONS =
|
|||
|
||||
MAX_INITIALIZER_LINES = 30
|
||||
|
||||
# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
|
||||
# only. Doxygen will then generate output that is more tailored for C.
|
||||
# For instance some of the names that are used will be different. The list
|
||||
# of all members will be omitted, etc.
|
||||
|
||||
OPTIMIZE_OUTPUT_FOR_C = YES
|
||||
|
||||
# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java sources
|
||||
# only. Doxygen will then generate output that is more tailored for Java.
|
||||
# For instance namespaces will be presented as packages, qualified scopes
|
||||
# will look different, etc.
|
||||
|
||||
OPTIMIZE_OUTPUT_JAVA = NO
|
||||
|
||||
# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
|
||||
# at the bottom of the documentation of classes and structs. If set to YES the
|
||||
# list will mention the files that were used to generate the documentation.
|
||||
|
@ -294,6 +333,13 @@ WARNINGS = YES
|
|||
|
||||
WARN_IF_UNDOCUMENTED = YES
|
||||
|
||||
# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
|
||||
# potential errors in the documentation, such as not documenting some
|
||||
# parameters in a documented function, or documenting parameters that
|
||||
# don't exist or using markup commands wrongly.
|
||||
|
||||
WARN_IF_DOC_ERROR = YES
|
||||
|
||||
# The WARN_FORMAT tag determines the format of the warning messages that
|
||||
# doxygen can produce. The string should contain the $file, $line, and $text
|
||||
# tags, which will be replaced by the file and line number from which the
|
||||
|
@ -316,14 +362,14 @@ 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
|
||||
# and *.h) to filter out the source-files in the directories. If left
|
||||
# blank the following patterns are tested:
|
||||
# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx *.hpp
|
||||
# *.h++ *.idl *.odl
|
||||
# *.h++ *.idl *.odl *.cs *.php *.php3 *.inc
|
||||
|
||||
FILE_PATTERNS =
|
||||
|
||||
|
@ -387,7 +433,7 @@ INPUT_FILTER =
|
|||
|
||||
# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
|
||||
# INPUT_FILTER) will be used to filter the input files when producing source
|
||||
# files to browse.
|
||||
# files to browse (i.e. when SOURCE_BROWSER is set to YES).
|
||||
|
||||
FILTER_SOURCE_FILES = NO
|
||||
|
||||
|
@ -405,6 +451,12 @@ SOURCE_BROWSER = NO
|
|||
|
||||
INLINE_SOURCES = NO
|
||||
|
||||
# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
|
||||
# doxygen to hide any special comment blocks from generated source code
|
||||
# fragments. Normal C and C++ comments will always remain visible.
|
||||
|
||||
STRIP_CODE_COMMENTS = YES
|
||||
|
||||
# If the REFERENCED_BY_RELATION tag is set to YES (the default)
|
||||
# then for each documented function all documented
|
||||
# functions referencing it will be listed.
|
||||
|
@ -417,6 +469,12 @@ REFERENCED_BY_RELATION = YES
|
|||
|
||||
REFERENCES_RELATION = YES
|
||||
|
||||
# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
|
||||
# will generate a verbatim copy of the header file for each class for
|
||||
# which an include is specified. Set to NO to disable this.
|
||||
|
||||
VERBATIM_HEADERS = YES
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the alphabetical class index
|
||||
#---------------------------------------------------------------------------
|
||||
|
@ -438,7 +496,7 @@ COLS_IN_ALPHA_INDEX = 5
|
|||
# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
|
||||
# should be ignored while generating the index headers.
|
||||
|
||||
IGNORE_PREFIX =
|
||||
IGNORE_PREFIX =
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the HTML output
|
||||
|
@ -473,7 +531,7 @@ HTML_HEADER =
|
|||
|
||||
HTML_FOOTER =
|
||||
|
||||
# The HTML_STYLESHEET tag can be used to specify a user defined cascading
|
||||
# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
|
||||
# style sheet that is used by each HTML page. It can be used to
|
||||
# fine-tune the look of the HTML output. If the tag is left blank doxygen
|
||||
# will generate a default style sheet
|
||||
|
@ -493,6 +551,20 @@ HTML_ALIGN_MEMBERS = YES
|
|||
|
||||
GENERATE_HTMLHELP = NO
|
||||
|
||||
# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
|
||||
# be used to specify the file name of the resulting .chm file. You
|
||||
# can add a path in front of the file if the result should not be
|
||||
# written to the html output dir.
|
||||
|
||||
CHM_FILE =
|
||||
|
||||
# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
|
||||
# be used to specify the location (absolute path including file name) of
|
||||
# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
|
||||
# the HTML help compiler on the generated index.hhp.
|
||||
|
||||
HHC_LOCATION =
|
||||
|
||||
# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
|
||||
# controls if a separate .chi index file is generated (YES) or that
|
||||
# it should be included in the master .chm file (NO).
|
||||
|
@ -506,7 +578,7 @@ GENERATE_CHI = NO
|
|||
BINARY_TOC = NO
|
||||
|
||||
# The TOC_EXPAND flag can be set to YES to add extra items for group members
|
||||
# to the contents of the Html help documentation and to the tree view.
|
||||
# to the contents of the HTML help documentation and to the tree view.
|
||||
|
||||
TOC_EXPAND = NO
|
||||
|
||||
|
@ -524,10 +596,9 @@ ENUM_VALUES_PER_LINE = 4
|
|||
# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be
|
||||
# generated containing a tree-like index structure (just like the one that
|
||||
# is generated for HTML Help). For this to work a browser that supports
|
||||
# JavaScript and frames is required (for instance Mozilla, Netscape 4.0+,
|
||||
# or Internet explorer 4.0+). Note that for large projects the tree generation
|
||||
# can take a very long time. In such cases it is better to disable this feature.
|
||||
# Windows users are probably better off using the HTML help feature.
|
||||
# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+,
|
||||
# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are
|
||||
# probably better off using the HTML help feature.
|
||||
|
||||
GENERATE_TREEVIEW = NO
|
||||
|
||||
|
@ -552,7 +623,8 @@ GENERATE_LATEX = YES
|
|||
|
||||
LATEX_OUTPUT = latex
|
||||
|
||||
# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be invoked. If left blank `latex' will be used as the default command name.
|
||||
# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
|
||||
# invoked. If left blank `latex' will be used as the default command name.
|
||||
|
||||
LATEX_CMD_NAME = latex
|
||||
|
||||
|
@ -606,6 +678,12 @@ USE_PDFLATEX = NO
|
|||
|
||||
LATEX_BATCHMODE = NO
|
||||
|
||||
# If LATEX_HIDE_INDICES is set to YES then doxygen will not
|
||||
# include the index chapters (such as File Index, Compound Index, etc.)
|
||||
# in the output.
|
||||
|
||||
LATEX_HIDE_INDICES = NO
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the RTF output
|
||||
#---------------------------------------------------------------------------
|
||||
|
@ -688,6 +766,24 @@ MAN_LINKS = YES
|
|||
|
||||
GENERATE_XML = NO
|
||||
|
||||
# The XML_OUTPUT tag is used to specify where the XML pages will be put.
|
||||
# If a relative path is entered the value of OUTPUT_DIRECTORY will be
|
||||
# put in front of it. If left blank `xml' will be used as the default path.
|
||||
|
||||
XML_OUTPUT = xml
|
||||
|
||||
# The XML_SCHEMA tag can be used to specify an XML schema,
|
||||
# which can be used by a validating XML parser to check the
|
||||
# syntax of the XML files.
|
||||
|
||||
XML_SCHEMA =
|
||||
|
||||
# The XML_DTD tag can be used to specify an XML DTD,
|
||||
# which can be used by a validating XML parser to check the
|
||||
# syntax of the XML files.
|
||||
|
||||
XML_DTD =
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options for the AutoGen Definitions output
|
||||
#---------------------------------------------------------------------------
|
||||
|
@ -700,6 +796,39 @@ GENERATE_XML = NO
|
|||
|
||||
GENERATE_AUTOGEN_DEF = NO
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the Perl module output
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
# If the GENERATE_PERLMOD tag is set to YES Doxygen will
|
||||
# generate a Perl module file that captures the structure of
|
||||
# the code including all documentation. Note that this
|
||||
# feature is still experimental and incomplete at the
|
||||
# moment.
|
||||
|
||||
GENERATE_PERLMOD = NO
|
||||
|
||||
# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
|
||||
# the necessary Makefile rules, Perl scripts and LaTeX code to be able
|
||||
# to generate PDF and DVI output from the Perl module output.
|
||||
|
||||
PERLMOD_LATEX = NO
|
||||
|
||||
# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
|
||||
# nicely formatted so it can be parsed by a human reader. This is useful
|
||||
# if you want to understand what is going on. On the other hand, if this
|
||||
# tag is set to NO the size of the Perl module output will be much smaller
|
||||
# and Perl will parse it just the same.
|
||||
|
||||
PERLMOD_PRETTY = YES
|
||||
|
||||
# The names of the make variables in the generated doxyrules.make file
|
||||
# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
|
||||
# This is useful so different doxyrules.make files included by the same
|
||||
# Makefile don't overwrite each other's variables.
|
||||
|
||||
PERLMOD_MAKEVAR_PREFIX =
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to the preprocessor
|
||||
#---------------------------------------------------------------------------
|
||||
|
@ -747,9 +876,11 @@ INCLUDE_FILE_PATTERNS =
|
|||
# or name=definition (no spaces). If the definition and the = are
|
||||
# omitted =1 is assumed.
|
||||
|
||||
PREDEFINED = DOXYGEN_SHOULD_IGNORE_THIS=1 __EXPORT__=
|
||||
PREDEFINED = DOXYGEN_SHOULD_IGNORE_THIS=1 \
|
||||
PHYSFS_DECL= \
|
||||
PHYSFS_DEPRECATED=
|
||||
|
||||
# If the MACRO_EXPANSION and EXPAND_PREDEF_ONLY tags are set to YES then
|
||||
# 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.
|
||||
# The macro definition that is found in the sources will be used.
|
||||
# Use the PREDEFINED tag if you want to use a different macro definition.
|
||||
|
@ -758,8 +889,9 @@ EXPAND_AS_DEFINED =
|
|||
|
||||
# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
|
||||
# doxygen's preprocessor will remove all function-like macros that are alone
|
||||
# on a line and do not end with a semicolon. Such function macros are typically
|
||||
# used for boiler-plate code, and will confuse the parser if not removed.
|
||||
# on a line, have an all uppercase name, and do not end with a semicolon. Such
|
||||
# function macros are typically used for boiler-plate code, and will confuse the
|
||||
# parser if not removed.
|
||||
|
||||
SKIP_FUNCTION_MACROS = YES
|
||||
|
||||
|
@ -767,7 +899,20 @@ SKIP_FUNCTION_MACROS = YES
|
|||
# Configuration::addtions related to external references
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
# The TAGFILES tag can be used to specify one or more tagfiles.
|
||||
# The TAGFILES option can be used to specify one or more tagfiles.
|
||||
# Optionally an initial location of the external documentation
|
||||
# can be added for each tagfile. The format of a tag file without
|
||||
# this location is as follows:
|
||||
# TAGFILES = file1 file2 ...
|
||||
# Adding location for the tag files is done as follows:
|
||||
# TAGFILES = file1=loc1 "file2 = loc2" ...
|
||||
# where "loc1" and "loc2" can be relative or absolute paths or
|
||||
# URLs. If a location is present for each tag, the installdox tool
|
||||
# does not have to be run to correct the links.
|
||||
# Note that each tag file must have a unique name
|
||||
# (where the name does NOT include the path)
|
||||
# If a tag file is not located in the directory in which doxygen
|
||||
# is run, you must also specify the path to the tagfile here.
|
||||
|
||||
TAGFILES =
|
||||
|
||||
|
@ -798,7 +943,7 @@ PERL_PATH = /usr/bin/perl
|
|||
#---------------------------------------------------------------------------
|
||||
|
||||
# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
|
||||
# generate a inheritance diagram (in Html, RTF and LaTeX) for classes with base or
|
||||
# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base or
|
||||
# super classes. Setting the tag to NO turns the diagrams off. Note that this
|
||||
# option is superceded by the HAVE_DOT option below. This is only a fallback. It is
|
||||
# recommended to install and use dot, since it yields more powerful graphs.
|
||||
|
@ -832,6 +977,12 @@ CLASS_GRAPH = NO
|
|||
|
||||
COLLABORATION_GRAPH = NO
|
||||
|
||||
# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
|
||||
# collaboration diagrams in a style similiar to the OMG's Unified Modeling
|
||||
# Language.
|
||||
|
||||
UML_LOOK = NO
|
||||
|
||||
# If set to YES, the inheritance and collaboration graphs will show the
|
||||
# relations between templates and their instances.
|
||||
|
||||
|
@ -851,6 +1002,14 @@ INCLUDE_GRAPH = NO
|
|||
|
||||
INCLUDED_BY_GRAPH = YES
|
||||
|
||||
# If the CALL_GRAPH and HAVE_DOT tags are set to YES then doxygen will
|
||||
# generate a call dependency graph for every global function or class method.
|
||||
# Note that enabling this option will significantly increase the time of a run.
|
||||
# So in most cases it will be better to enable call graphs for selected
|
||||
# functions only using the \callgraph command.
|
||||
|
||||
CALL_GRAPH = NO
|
||||
|
||||
# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
|
||||
# will graphical hierarchy of all classes instead of a textual one.
|
||||
|
||||
|
@ -889,6 +1048,17 @@ MAX_DOT_GRAPH_WIDTH = 1024
|
|||
|
||||
MAX_DOT_GRAPH_HEIGHT = 1024
|
||||
|
||||
# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
|
||||
# graphs generated by dot. A depth value of 3 means that only nodes reachable
|
||||
# from the root by following a path via at most 3 edges will be shown. Nodes that
|
||||
# lay further from the root node will be omitted. Note that setting this option to
|
||||
# 1 or 2 may greatly reduce the computation time needed for large code bases. Also
|
||||
# note that a graph may be further truncated if the graph's image dimensions are
|
||||
# not sufficient to fit the graph (see MAX_DOT_GRAPH_WIDTH and MAX_DOT_GRAPH_HEIGHT).
|
||||
# If 0 is used for the depth value (the default), the graph is not depth-constrained.
|
||||
|
||||
MAX_DOT_GRAPH_DEPTH = 0
|
||||
|
||||
# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
|
||||
# generate a legend page explaining the meaning of the various boxes and
|
||||
# arrows in the dot generated graphs.
|
||||
|
@ -896,7 +1066,7 @@ MAX_DOT_GRAPH_HEIGHT = 1024
|
|||
GENERATE_LEGEND = YES
|
||||
|
||||
# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
|
||||
# remove the intermedate dot files that are used to generate
|
||||
# remove the intermediate dot files that are used to generate
|
||||
# the various graphs.
|
||||
|
||||
DOT_CLEANUP = YES
|
||||
|
@ -909,38 +1079,3 @@ DOT_CLEANUP = YES
|
|||
# used. If set to NO the values of all tags below this one will be ignored.
|
||||
|
||||
SEARCHENGINE = NO
|
||||
|
||||
# The CGI_NAME tag should be the name of the CGI script that
|
||||
# starts the search engine (doxysearch) with the correct parameters.
|
||||
# A script with this name will be generated by doxygen.
|
||||
|
||||
CGI_NAME = search.cgi
|
||||
|
||||
# The CGI_URL tag should be the absolute URL to the directory where the
|
||||
# cgi binaries are located. See the documentation of your http daemon for
|
||||
# details.
|
||||
|
||||
CGI_URL =
|
||||
|
||||
# The DOC_URL tag should be the absolute URL to the directory where the
|
||||
# documentation is located. If left blank the absolute path to the
|
||||
# documentation, with file:// prepended to it, will be used.
|
||||
|
||||
DOC_URL =
|
||||
|
||||
# The DOC_ABSPATH tag should be the absolute path to the directory where the
|
||||
# documentation is located. If left blank the directory on the local machine
|
||||
# will be used.
|
||||
|
||||
DOC_ABSPATH =
|
||||
|
||||
# The BIN_ABSPATH tag must point to the directory where the doxysearch binary
|
||||
# is installed.
|
||||
|
||||
BIN_ABSPATH = /usr/local/bin/
|
||||
|
||||
# The EXT_DOC_PATHS tag can be used to specify one or more paths to
|
||||
# documentation generated for other projects. This allows doxysearch to search
|
||||
# the documentation for these projects as well.
|
||||
|
||||
EXT_DOC_PATHS =
|
|
@ -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
|
||||
|
|
@ -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.
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* stdio/physfs abstraction layer 2002-12-03
|
||||
* stdio/physfs abstraction layer 2003-04-02
|
||||
*
|
||||
* Adam D. Moss <adam@gimp.org> <aspirin@icculus.org>
|
||||
*
|
||||
|
@ -15,7 +15,7 @@ you may embed this wrapper code within commercial software); PhysicsFS itself
|
|||
is (at the time of writing) released under a different license with
|
||||
additional restrictions.
|
||||
|
||||
Copyright (C) 2002 Adam D. Moss (the "Author"). All Rights Reserved.
|
||||
Copyright (C) 2002-2003 Adam D. Moss (the "Author"). All Rights Reserved.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -55,6 +55,8 @@ from the Author.
|
|||
* MY_GETC fgetc(...)
|
||||
* MY_GETS fgets(...)
|
||||
* MY_ATEOF feof(...)
|
||||
* MY_TELL ftell(...)
|
||||
* MY_SEEK fseek(..., SEEK_SET)
|
||||
* MY_REWIND rewind(...)
|
||||
* MY_SETBUFFER (not a standard for stdio, does nothing there)
|
||||
*/
|
||||
|
@ -90,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
|
||||
|
@ -116,8 +118,8 @@ static int MY_GETC(MY_FILETYPE *const fp) {
|
|||
}
|
||||
return c;
|
||||
}
|
||||
static char * MY_GETS(char * const str, const int size,
|
||||
MY_FILETYPE *const fp) {
|
||||
static char * MY_GETS(char * const str, const int size,
|
||||
MY_FILETYPE *const fp) {
|
||||
int i = 0;
|
||||
int c;
|
||||
do {
|
||||
|
@ -129,9 +131,9 @@ static char * MY_GETS(char * const str, const int size,
|
|||
break;
|
||||
}
|
||||
str[i++] = c;
|
||||
} while (c != '\0' &&
|
||||
c != -1 &&
|
||||
c != '\n');
|
||||
} while (c != '\0' &&
|
||||
c != -1 &&
|
||||
c != '\n');
|
||||
str[i] = '\0';
|
||||
if (i == 0) {
|
||||
return NULL;
|
||||
|
@ -140,7 +142,9 @@ static char * MY_GETS(char * const str, const int size,
|
|||
}
|
||||
#define MY_CLOSE(fp) PHYSFS_close(fp)
|
||||
#define MY_ATEOF(fp) PHYSFS_eof(fp)
|
||||
#define MY_REWIND(fp) PHYSFS_seek(fp,0)
|
||||
#define MY_TELL(fp) PHYSFS_tell(fp)
|
||||
#define MY_SEEK(fp,o) PHYSFS_seek(fp,o)
|
||||
#define MY_REWIND(fp) MY_SEEK(fp,0)
|
||||
|
||||
#else
|
||||
|
||||
|
@ -151,8 +155,11 @@ static char * MY_GETS(char * const str, const int size,
|
|||
#define MY_GETS(str,size,fp) fgets(str,size,fp)
|
||||
#define MY_CLOSE(fp) fclose(fp)
|
||||
#define MY_ATEOF(fp) feof(fp)
|
||||
#define MY_TELL(fp) ftell(fp)
|
||||
#define MY_SEEK(fp,o) fseek(fp,o, SEEK_SET)
|
||||
#define MY_REWIND(fp) rewind(fp)
|
||||
static void MY_SETBUFFER(const MY_FILETYPE *const file, const int num) { }
|
||||
/*static void MY_SETBUFFER(const MY_FILETYPE *const file, const int num) { }*/
|
||||
#define MY_SETBUFFER(fp,size)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -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
|
@ -0,0 +1,239 @@
|
|||
/** \file globbing.c */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include "globbing.h"
|
||||
|
||||
/**
|
||||
* Please see globbing.h for details.
|
||||
*
|
||||
* License: this code is public domain. I make no warranty that it is useful,
|
||||
* correct, harmless, or environmentally safe.
|
||||
*
|
||||
* This particular file may be used however you like, including copying it
|
||||
* verbatim into a closed-source project, exploiting it commercially, and
|
||||
* removing any trace of my name from the source (although I hope you won't
|
||||
* do that). I welcome enhancements and corrections to this file, but I do
|
||||
* not require you to send me patches if you make changes. This code has
|
||||
* NO WARRANTY.
|
||||
*
|
||||
* Unless otherwise stated, the rest of PhysicsFS falls under the zlib license.
|
||||
* Please see the file LICENSE.txt in the source's root directory.
|
||||
*
|
||||
* \author Ryan C. Gordon.
|
||||
*/
|
||||
|
||||
|
||||
static int matchesPattern(const char *fname, const char *wildcard,
|
||||
int caseSensitive)
|
||||
{
|
||||
char x, y;
|
||||
const char *fnameptr = fname;
|
||||
const char *wildptr = wildcard;
|
||||
|
||||
while ((*wildptr) && (*fnameptr))
|
||||
{
|
||||
y = *wildptr;
|
||||
if (y == '*')
|
||||
{
|
||||
do
|
||||
{
|
||||
wildptr++; /* skip multiple '*' in a row... */
|
||||
} while (*wildptr == '*');
|
||||
|
||||
y = (caseSensitive) ? *wildptr : (char) tolower(*wildptr);
|
||||
|
||||
while (1)
|
||||
{
|
||||
x = (caseSensitive) ? *fnameptr : (char) tolower(*fnameptr);
|
||||
if ((!x) || (x == y))
|
||||
break;
|
||||
else
|
||||
fnameptr++;
|
||||
} /* while */
|
||||
} /* if */
|
||||
|
||||
else if (y == '?')
|
||||
{
|
||||
wildptr++;
|
||||
fnameptr++;
|
||||
} /* else if */
|
||||
|
||||
else
|
||||
{
|
||||
if (caseSensitive)
|
||||
x = *fnameptr;
|
||||
else
|
||||
{
|
||||
x = tolower(*fnameptr);
|
||||
y = tolower(y);
|
||||
} /* if */
|
||||
|
||||
wildptr++;
|
||||
fnameptr++;
|
||||
|
||||
if (x != y)
|
||||
return 0;
|
||||
} /* else */
|
||||
} /* while */
|
||||
|
||||
while (*wildptr == '*')
|
||||
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)
|
||||
{
|
||||
const PHYSFS_Allocator *allocator = PHYSFS_getAllocator();
|
||||
char **list = PHYSFS_enumerateFiles(dir);
|
||||
char **retval = NULL;
|
||||
int totalmatches = 0;
|
||||
int matches = 0;
|
||||
char **i;
|
||||
|
||||
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))
|
||||
totalmatches++;
|
||||
} /* for */
|
||||
|
||||
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 */
|
||||
|
||||
|
||||
#ifdef TEST_PHYSFSEXT_ENUMERATEFILESWILDCARD
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
int rc;
|
||||
char **flist;
|
||||
char **i;
|
||||
|
||||
if (argc != 3)
|
||||
{
|
||||
printf("USAGE: %s <pattern> <caseSen>\n"
|
||||
" where <caseSen> is 1 or 0.\n", argv[0]);
|
||||
return 1;
|
||||
} /* if */
|
||||
|
||||
if (!PHYSFS_init(argv[0]))
|
||||
{
|
||||
fprintf(stderr, "PHYSFS_init(): %s\n", PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()));
|
||||
return 1;
|
||||
} /* if */
|
||||
|
||||
if (!PHYSFS_addToSearchPath(".", 1))
|
||||
{
|
||||
fprintf(stderr, "PHYSFS_addToSearchPath(): %s\n", PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()));
|
||||
PHYSFS_deinit();
|
||||
return 1;
|
||||
} /* if */
|
||||
|
||||
flist = PHYSFSEXT_enumerateFilesWildcard("/", argv[1], atoi(argv[2]));
|
||||
rc = 0;
|
||||
for (i = flist; *i; i++)
|
||||
{
|
||||
printf("%s\n", *i);
|
||||
rc++;
|
||||
} /* for */
|
||||
printf("\n total %d files.\n\n", rc);
|
||||
|
||||
PHYSFSEXT_freeEnumeration(flist);
|
||||
PHYSFS_deinit();
|
||||
|
||||
return 0;
|
||||
} /* main */
|
||||
#endif
|
||||
|
||||
/* end of globbing.c ... */
|
||||
|
|
@ -0,0 +1,165 @@
|
|||
#ifndef INCL_PHYSFSEXT_GLOBBING_H
|
||||
#define INCL_PHYSFSEXT_GLOBBING_H
|
||||
|
||||
/** \file globbing.h */
|
||||
|
||||
#include "physfs.h"
|
||||
|
||||
/**
|
||||
* \mainpage PhysicsFS globbing
|
||||
*
|
||||
* This is an extension to PhysicsFS to let you search for files with basic
|
||||
* wildcard matching, regardless of what sort of filesystem or archive they
|
||||
* reside in. It does this by enumerating directories as needed and manually
|
||||
* locating matching entries.
|
||||
*
|
||||
* Usage: Set up PhysicsFS as you normally would, then use
|
||||
* PHYSFSEXT_enumerateFilesWildcard() when enumerating files. This is just
|
||||
* like PHYSFS_enumerateFiles(), but it returns a subset that matches your
|
||||
* 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.
|
||||
*
|
||||
* This particular file may be used however you like, including copying it
|
||||
* verbatim into a closed-source project, exploiting it commercially, and
|
||||
* removing any trace of my name from the source (although I hope you won't
|
||||
* do that). I welcome enhancements and corrections to this file, but I do
|
||||
* not require you to send me patches if you make changes. This code has
|
||||
* NO WARRANTY.
|
||||
*
|
||||
* Unless otherwise stated, the rest of PhysicsFS falls under the zlib license.
|
||||
* 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, 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",
|
||||
* "y.Sav", and "z.txt", and there is also a "C:\userdir" in the search path
|
||||
* that has a "savegames" subdirectory with "w.sav", then the following code:
|
||||
*
|
||||
* \code
|
||||
* char **rc = PHYSFS_enumerateFilesWildcard("savegames", "*.sav", 0);
|
||||
* char **i;
|
||||
*
|
||||
* for (i = rc; *i != NULL; i++)
|
||||
* printf(" * We've got [%s].\n", *i);
|
||||
*
|
||||
* PHYSFS_freeList(rc);
|
||||
* \endcode
|
||||
*
|
||||
* ...will print:
|
||||
*
|
||||
* \verbatim
|
||||
* We've got [x.sav].
|
||||
* We've got [y.Sav].
|
||||
* We've got [w.sav].\endverbatim
|
||||
*
|
||||
* Feel free to sort the list however you like. We only promise there will
|
||||
* be no duplicates, but not what order the final list will come back in.
|
||||
*
|
||||
* 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 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
|
||||
*/
|
||||
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 ... */
|
||||
|
|
@ -0,0 +1,203 @@
|
|||
/** \file ignorecase.c */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include "physfs.h"
|
||||
#include "ignorecase.h"
|
||||
|
||||
/**
|
||||
* Please see ignorecase.h for details.
|
||||
*
|
||||
* License: this code is public domain. I make no warranty that it is useful,
|
||||
* correct, harmless, or environmentally safe.
|
||||
*
|
||||
* This particular file may be used however you like, including copying it
|
||||
* verbatim into a closed-source project, exploiting it commercially, and
|
||||
* removing any trace of my name from the source (although I hope you won't
|
||||
* do that). I welcome enhancements and corrections to this file, but I do
|
||||
* not require you to send me patches if you make changes. This code has
|
||||
* NO WARRANTY.
|
||||
*
|
||||
* Unless otherwise stated, the rest of PhysicsFS falls under the zlib license.
|
||||
* Please see LICENSE.txt in the root of the source tree.
|
||||
*
|
||||
* \author Ryan C. Gordon.
|
||||
*/
|
||||
|
||||
static int locateOneElement(char *buf)
|
||||
{
|
||||
char *ptr;
|
||||
char **rc;
|
||||
char **i;
|
||||
|
||||
if (PHYSFS_exists(buf))
|
||||
return 1; /* quick rejection: exists in current case. */
|
||||
|
||||
ptr = strrchr(buf, '/'); /* find entry at end of path. */
|
||||
if (ptr == NULL)
|
||||
{
|
||||
rc = PHYSFS_enumerateFiles("/");
|
||||
ptr = buf;
|
||||
} /* if */
|
||||
else
|
||||
{
|
||||
*ptr = '\0';
|
||||
rc = PHYSFS_enumerateFiles(buf);
|
||||
*ptr = '/';
|
||||
ptr++; /* point past dirsep to entry itself. */
|
||||
} /* else */
|
||||
|
||||
if (rc != NULL)
|
||||
{
|
||||
for (i = rc; *i != NULL; i++)
|
||||
{
|
||||
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... */
|
||||
return 0;
|
||||
} /* locateOneElement */
|
||||
|
||||
|
||||
int PHYSFSEXT_locateCorrectCase(char *buf)
|
||||
{
|
||||
int rc;
|
||||
char *ptr;
|
||||
|
||||
while (*buf == '/') /* skip any '/' at start of string... */
|
||||
buf++;
|
||||
|
||||
ptr = buf;
|
||||
if (*ptr == '\0')
|
||||
return 0; /* Uh...I guess that's success. */
|
||||
|
||||
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. */
|
||||
} /* while */
|
||||
|
||||
/* check final element... */
|
||||
return locateOneElement(buf) ? 0 : -1;
|
||||
} /* PHYSFSEXT_locateCorrectCase */
|
||||
|
||||
|
||||
#ifdef TEST_PHYSFSEXT_LOCATECORRECTCASE
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
int rc;
|
||||
char buf[128];
|
||||
PHYSFS_File *f;
|
||||
|
||||
if (!PHYSFS_init(argv[0]))
|
||||
{
|
||||
fprintf(stderr, "PHYSFS_init(): %s\n", PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()));
|
||||
return 1;
|
||||
} /* if */
|
||||
|
||||
if (!PHYSFS_addToSearchPath(".", 1))
|
||||
{
|
||||
fprintf(stderr, "PHYSFS_addToSearchPath(): %s\n", PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()));
|
||||
PHYSFS_deinit();
|
||||
return 1;
|
||||
} /* if */
|
||||
|
||||
if (!PHYSFS_setWriteDir("."))
|
||||
{
|
||||
fprintf(stderr, "PHYSFS_setWriteDir(): %s\n", PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()));
|
||||
PHYSFS_deinit();
|
||||
return 1;
|
||||
} /* if */
|
||||
|
||||
if (!PHYSFS_mkdir("/a/b/c"))
|
||||
{
|
||||
fprintf(stderr, "PHYSFS_mkdir(): %s\n", PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()));
|
||||
PHYSFS_deinit();
|
||||
return 1;
|
||||
} /* if */
|
||||
|
||||
if (!PHYSFS_mkdir("/a/b/C"))
|
||||
{
|
||||
fprintf(stderr, "PHYSFS_mkdir(): %s\n", PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()));
|
||||
PHYSFS_deinit();
|
||||
return 1;
|
||||
} /* if */
|
||||
|
||||
f = PHYSFS_openWrite("/a/b/c/x.txt");
|
||||
PHYSFS_close(f);
|
||||
if (f == NULL)
|
||||
{
|
||||
fprintf(stderr, "PHYSFS_openWrite(): %s\n", PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()));
|
||||
PHYSFS_deinit();
|
||||
return 1;
|
||||
} /* if */
|
||||
|
||||
f = PHYSFS_openWrite("/a/b/C/X.txt");
|
||||
PHYSFS_close(f);
|
||||
if (f == NULL)
|
||||
{
|
||||
fprintf(stderr, "PHYSFS_openWrite(): %s\n", PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()));
|
||||
PHYSFS_deinit();
|
||||
return 1;
|
||||
} /* if */
|
||||
|
||||
strcpy(buf, "/a/b/c/x.txt");
|
||||
rc = PHYSFSEXT_locateCorrectCase(buf);
|
||||
if ((rc != 0) || (strcmp(buf, "/a/b/c/x.txt") != 0))
|
||||
printf("test 1 failed\n");
|
||||
|
||||
strcpy(buf, "/a/B/c/x.txt");
|
||||
rc = PHYSFSEXT_locateCorrectCase(buf);
|
||||
if ((rc != 0) || (strcmp(buf, "/a/b/c/x.txt") != 0))
|
||||
printf("test 2 failed\n");
|
||||
|
||||
strcpy(buf, "/a/b/C/x.txt");
|
||||
rc = PHYSFSEXT_locateCorrectCase(buf);
|
||||
if ((rc != 0) || (strcmp(buf, "/a/b/C/X.txt") != 0))
|
||||
printf("test 3 failed\n");
|
||||
|
||||
strcpy(buf, "/a/b/c/X.txt");
|
||||
rc = PHYSFSEXT_locateCorrectCase(buf);
|
||||
if ((rc != 0) || (strcmp(buf, "/a/b/c/x.txt") != 0))
|
||||
printf("test 4 failed\n");
|
||||
|
||||
strcpy(buf, "/a/b/c/z.txt");
|
||||
rc = PHYSFSEXT_locateCorrectCase(buf);
|
||||
if ((rc != -1) || (strcmp(buf, "/a/b/c/z.txt") != 0))
|
||||
printf("test 5 failed\n");
|
||||
|
||||
strcpy(buf, "/A/B/Z/z.txt");
|
||||
rc = PHYSFSEXT_locateCorrectCase(buf);
|
||||
if ((rc != -2) || (strcmp(buf, "/a/b/Z/z.txt") != 0))
|
||||
printf("test 6 failed\n");
|
||||
|
||||
printf("Testing completed.\n");
|
||||
printf(" If no errors were reported, you're good to go.\n");
|
||||
|
||||
PHYSFS_delete("/a/b/c/x.txt");
|
||||
PHYSFS_delete("/a/b/C/X.txt");
|
||||
PHYSFS_delete("/a/b/c");
|
||||
PHYSFS_delete("/a/b/C");
|
||||
PHYSFS_delete("/a/b");
|
||||
PHYSFS_delete("/a");
|
||||
PHYSFS_deinit();
|
||||
return 0;
|
||||
} /* main */
|
||||
#endif
|
||||
|
||||
/* end of ignorecase.c ... */
|
||||
|
|
@ -0,0 +1,86 @@
|
|||
#ifndef INCL_PHYSFSEXT_IGNORECASE_H
|
||||
#define INCL_PHYSFSEXT_IGNORECASE_H
|
||||
|
||||
/** \file ignorecase.h */
|
||||
|
||||
/**
|
||||
* \mainpage PhysicsFS ignorecase
|
||||
*
|
||||
* This is an extension to PhysicsFS to let you handle files in a
|
||||
* case-insensitive manner, regardless of what sort of filesystem or
|
||||
* archive they reside in. It does this by enumerating directories as
|
||||
* needed and manually locating matching entries.
|
||||
*
|
||||
* Please note that this brings with it some caveats:
|
||||
* - On filesystems that are case-insensitive to start with, such as those
|
||||
* used on Windows or MacOS, you are adding extra overhead.
|
||||
* - On filesystems that are case-sensitive, you might select the wrong dir
|
||||
* 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 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 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
|
||||
* functions like PHYSFS_openRead(), etc.
|
||||
*
|
||||
* License: this code is public domain. I make no warranty that it is useful,
|
||||
* correct, harmless, or environmentally safe.
|
||||
*
|
||||
* This particular file may be used however you like, including copying it
|
||||
* verbatim into a closed-source project, exploiting it commercially, and
|
||||
* removing any trace of my name from the source (although I hope you won't
|
||||
* do that). I welcome enhancements and corrections to this file, but I do
|
||||
* not require you to send me patches if you make changes. This code has
|
||||
* NO WARRANTY.
|
||||
*
|
||||
* Unless otherwise stated, the rest of PhysicsFS falls under the zlib license.
|
||||
* 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)
|
||||
* \brief Find an existing filename with matching case.
|
||||
*
|
||||
* This function will look for a path/filename that matches the passed in
|
||||
* buffer. Each element of the buffer's path is checked for a
|
||||
* case-insensitive match. The buffer must specify a null-terminated string
|
||||
* in platform-independent notation.
|
||||
*
|
||||
* Please note results may be skewed differently depending on whether symlinks
|
||||
* are enabled or not.
|
||||
*
|
||||
* Each element of the buffer is overwritten with the actual case of an
|
||||
* 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 legacy code.
|
||||
*
|
||||
* \param buf Buffer with null-terminated string of path/file to locate.
|
||||
* This buffer will be modified by this function.
|
||||
* \return zero if match was found, -1 if the final element (the file itself)
|
||||
* is missing, -2 if one of the parent directories is missing.
|
||||
*/
|
||||
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.1 2002/12/11 15:37:23 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
|
|
@ -1,9 +0,0 @@
|
|||
require 'mkmf'
|
||||
|
||||
$CFLAGS += `sdl-config --cflags`.chomp
|
||||
$LDFLAGS += `sdl-config --libs`.chomp
|
||||
|
||||
have_library "physfs", "PHYSFS_init"
|
||||
have_library "SDL", "SDL_AllocRW"
|
||||
|
||||
create_makefile "physfs_so"
|
|
@ -1,7 +0,0 @@
|
|||
#!/usr/local/bin/ruby
|
||||
|
||||
if __FILE__ == $0
|
||||
require 'slimb/installer'
|
||||
files = ["physfs.rb", "physfs_so.so"]
|
||||
installer = Slimb::Installer.new.run files, ARGV
|
||||
end
|
|
@ -1,9 +0,0 @@
|
|||
#!/bin/sh
|
||||
ruby extconf.rb
|
||||
make
|
||||
cd ..
|
||||
ruby installer.rb
|
||||
cd physfs
|
||||
ruby install.rb
|
||||
cd test
|
||||
ruby test_physfs.rb
|
|
@ -1,121 +0,0 @@
|
|||
#
|
||||
# PhysicsFS - ruby interface
|
||||
#
|
||||
# Author: Ed Sinjiashvili (slimb@vlinkmail.com)
|
||||
# License: LGPL
|
||||
#
|
||||
|
||||
require 'physfs_so'
|
||||
|
||||
module PhysicsFS
|
||||
|
||||
class Version
|
||||
def initialize major, minor, patch
|
||||
@major = major
|
||||
@minor = minor
|
||||
@patch = patch
|
||||
end
|
||||
|
||||
attr_reader :major, :minor, :patch
|
||||
|
||||
def to_s
|
||||
"#@major.#@minor.#@patch"
|
||||
end
|
||||
end
|
||||
|
||||
class ArchiveInfo
|
||||
def initialize ext, desc, author, url
|
||||
@extension = ext
|
||||
@description = desc
|
||||
@author = author
|
||||
@url = url
|
||||
end
|
||||
|
||||
attr_reader :extension, :description
|
||||
attr_reader :author, :url
|
||||
|
||||
def to_s
|
||||
" * #@extension: #@description\n Written by #@author.\n #@url\n"
|
||||
end
|
||||
end
|
||||
|
||||
#
|
||||
# convenience methods
|
||||
#
|
||||
class << self
|
||||
|
||||
def init argv0 = $0
|
||||
init_internal argv0
|
||||
end
|
||||
|
||||
def append_search_path str
|
||||
add_to_search_path str, 1
|
||||
self
|
||||
end
|
||||
|
||||
def prepend_search_path str
|
||||
add_to_search_path str, 0
|
||||
self
|
||||
end
|
||||
|
||||
alias_method :<<, :append_search_path
|
||||
alias_method :push, :append_search_path
|
||||
alias_method :unshift, :prepend_search_path
|
||||
|
||||
def ls path = ""
|
||||
enumerate path
|
||||
end
|
||||
end
|
||||
|
||||
#
|
||||
# File - PhysicsFS abstract file - can be drawn from various sources
|
||||
#
|
||||
class File
|
||||
def write_str str
|
||||
write str, 1, str.length
|
||||
end
|
||||
|
||||
def cat
|
||||
prev_pos = tell
|
||||
seek 0
|
||||
r = read length, 1
|
||||
seek prev_pos
|
||||
r
|
||||
end
|
||||
|
||||
alias_method :size, :length
|
||||
end
|
||||
|
||||
#
|
||||
# RWops - general stdio like operations on file-like creatures
|
||||
#
|
||||
class RWops
|
||||
SEEK_SET = 0
|
||||
SEEK_CUR = 1
|
||||
SEEK_END = 2
|
||||
|
||||
# tell current position of RWopted entity
|
||||
def tell
|
||||
seek 0, SEEK_CUR
|
||||
end
|
||||
|
||||
# length of RWops abstracted entity
|
||||
def length
|
||||
cur = tell
|
||||
r = seek 0, SEEK_END
|
||||
seek cur, SEEK_SET
|
||||
r
|
||||
end
|
||||
|
||||
alias_method :size, :length
|
||||
|
||||
#
|
||||
# create rwops from PhysicsFS file object
|
||||
#
|
||||
def self.from_physfs file
|
||||
file.to_rwops
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# physfs.rb ends here #
|
|
@ -1,192 +0,0 @@
|
|||
/*
|
||||
* This code provides a glue layer between PhysicsFS and Simple Directmedia
|
||||
* Layer's (SDL) RWops i/o abstraction.
|
||||
*
|
||||
* License: this code is public domain. I make no warranty that it is useful,
|
||||
* correct, harmless, or environmentally safe.
|
||||
*
|
||||
* This particular file may be used however you like, including copying it
|
||||
* verbatim into a closed-source project, exploiting it commercially, and
|
||||
* removing any trace of my name from the source (although I hope you won't
|
||||
* do that). I welcome enhancements and corrections to this file, but I do
|
||||
* not require you to send me patches if you make changes.
|
||||
*
|
||||
* Unless otherwise stated, the rest of PhysicsFS falls under the GNU Lesser
|
||||
* General Public License: http://www.gnu.org/licenses/lgpl.txt
|
||||
*
|
||||
* SDL falls under the LGPL, too. You can get SDL at http://www.libsdl.org/
|
||||
*
|
||||
* This file was written by Ryan C. Gordon. (icculus@clutteredmind.org).
|
||||
*/
|
||||
|
||||
#include <stdio.h> /* used for SEEK_SET, SEEK_CUR, SEEK_END ... */
|
||||
#include "physfsrwops.h"
|
||||
|
||||
static int physfsrwops_seek(SDL_RWops *rw, int offset, int whence)
|
||||
{
|
||||
PHYSFS_file *handle = (PHYSFS_file *) rw->hidden.unknown.data1;
|
||||
int pos = 0;
|
||||
|
||||
if (whence == SEEK_SET)
|
||||
{
|
||||
pos = offset;
|
||||
} /* if */
|
||||
|
||||
else if (whence == SEEK_CUR)
|
||||
{
|
||||
PHYSFS_sint64 current = PHYSFS_tell(handle);
|
||||
if (current == -1)
|
||||
{
|
||||
SDL_SetError("Can't find position in file: %s",
|
||||
PHYSFS_getLastError());
|
||||
return(-1);
|
||||
} /* if */
|
||||
|
||||
pos = (int) current;
|
||||
if ( ((PHYSFS_sint64) pos) != current )
|
||||
{
|
||||
SDL_SetError("Can't fit current file position in an int!");
|
||||
return(-1);
|
||||
} /* if */
|
||||
|
||||
if (offset == 0) /* this is a "tell" call. We're done. */
|
||||
return(pos);
|
||||
|
||||
pos += offset;
|
||||
} /* else if */
|
||||
|
||||
else if (whence == SEEK_END)
|
||||
{
|
||||
PHYSFS_sint64 len = PHYSFS_fileLength(handle);
|
||||
if (len == -1)
|
||||
{
|
||||
SDL_SetError("Can't find end of file: %s", PHYSFS_getLastError());
|
||||
return(-1);
|
||||
} /* if */
|
||||
|
||||
pos = (int) len;
|
||||
if ( ((PHYSFS_sint64) pos) != len )
|
||||
{
|
||||
SDL_SetError("Can't fit end-of-file position in an int!");
|
||||
return(-1);
|
||||
} /* if */
|
||||
|
||||
pos += offset;
|
||||
} /* else if */
|
||||
|
||||
else
|
||||
{
|
||||
SDL_SetError("Invalid 'whence' parameter.");
|
||||
return(-1);
|
||||
} /* else */
|
||||
|
||||
if ( pos < 0 )
|
||||
{
|
||||
SDL_SetError("Attempt to seek past start of file.");
|
||||
return(-1);
|
||||
} /* if */
|
||||
|
||||
if (!PHYSFS_seek(handle, (PHYSFS_uint64) pos))
|
||||
{
|
||||
SDL_SetError("PhysicsFS error: %s", PHYSFS_getLastError());
|
||||
return(-1);
|
||||
} /* if */
|
||||
|
||||
return(pos);
|
||||
} /* physfsrwops_seek */
|
||||
|
||||
|
||||
static int physfsrwops_read(SDL_RWops *rw, void *ptr, int size, int maxnum)
|
||||
{
|
||||
PHYSFS_file *handle = (PHYSFS_file *) rw->hidden.unknown.data1;
|
||||
PHYSFS_sint64 rc = PHYSFS_read(handle, ptr, size, maxnum);
|
||||
if (rc != maxnum)
|
||||
{
|
||||
if (!PHYSFS_eof(handle)) /* not EOF? Must be an error. */
|
||||
SDL_SetError("PhysicsFS error: %s", PHYSFS_getLastError());
|
||||
} /* if */
|
||||
|
||||
return((int) rc);
|
||||
} /* physfsrwops_read */
|
||||
|
||||
|
||||
static int physfsrwops_write(SDL_RWops *rw, const void *ptr, int size, int num)
|
||||
{
|
||||
PHYSFS_file *handle = (PHYSFS_file *) rw->hidden.unknown.data1;
|
||||
PHYSFS_sint64 rc = PHYSFS_write(handle, ptr, size, num);
|
||||
if (rc != num)
|
||||
SDL_SetError("PhysicsFS error: %s", PHYSFS_getLastError());
|
||||
|
||||
return((int) rc);
|
||||
} /* physfsrwops_write */
|
||||
|
||||
|
||||
static int physfsrwops_close(SDL_RWops *rw)
|
||||
{
|
||||
PHYSFS_file *handle = (PHYSFS_file *) rw->hidden.unknown.data1;
|
||||
if (!PHYSFS_close(handle))
|
||||
{
|
||||
SDL_SetError("PhysicsFS error: %s", PHYSFS_getLastError());
|
||||
return(-1);
|
||||
} /* if */
|
||||
|
||||
SDL_FreeRW(rw);
|
||||
return(0);
|
||||
} /* physfsrwops_close */
|
||||
|
||||
|
||||
static SDL_RWops *create_rwops(PHYSFS_file *handle)
|
||||
{
|
||||
SDL_RWops *retval = NULL;
|
||||
|
||||
if (handle == NULL)
|
||||
SDL_SetError("PhysicsFS error: %s", PHYSFS_getLastError());
|
||||
else
|
||||
{
|
||||
retval = SDL_AllocRW();
|
||||
if (retval != NULL)
|
||||
{
|
||||
retval->seek = physfsrwops_seek;
|
||||
retval->read = physfsrwops_read;
|
||||
retval->write = physfsrwops_write;
|
||||
retval->close = physfsrwops_close;
|
||||
retval->hidden.unknown.data1 = handle;
|
||||
} /* if */
|
||||
} /* else */
|
||||
|
||||
return(retval);
|
||||
} /* create_rwops */
|
||||
|
||||
|
||||
SDL_RWops *PHYSFSRWOPS_makeRWops(PHYSFS_file *handle)
|
||||
{
|
||||
SDL_RWops *retval = NULL;
|
||||
if (handle == NULL)
|
||||
SDL_SetError("NULL pointer passed to PHYSFSRWOPS_makeRWops().");
|
||||
else
|
||||
retval = create_rwops(handle);
|
||||
|
||||
return(retval);
|
||||
} /* PHYSFSRWOPS_makeRWops */
|
||||
|
||||
|
||||
SDL_RWops *PHYSFSRWOPS_openRead(const char *fname)
|
||||
{
|
||||
return(create_rwops(PHYSFS_openRead(fname)));
|
||||
} /* PHYSFSRWOPS_openRead */
|
||||
|
||||
|
||||
SDL_RWops *PHYSFSRWOPS_openWrite(const char *fname)
|
||||
{
|
||||
return(create_rwops(PHYSFS_openWrite(fname)));
|
||||
} /* PHYSFSRWOPS_openWrite */
|
||||
|
||||
|
||||
SDL_RWops *PHYSFSRWOPS_openAppend(const char *fname)
|
||||
{
|
||||
return(create_rwops(PHYSFS_openAppend(fname)));
|
||||
} /* PHYSFSRWOPS_openAppend */
|
||||
|
||||
|
||||
/* end of physfsrwops.c ... */
|
||||
|
|
@ -1,87 +0,0 @@
|
|||
/*
|
||||
* This code provides a glue layer between PhysicsFS and Simple Directmedia
|
||||
* Layer's (SDL) RWops i/o abstraction.
|
||||
*
|
||||
* License: this code is public domain. I make no warranty that it is useful,
|
||||
* correct, harmless, or environmentally safe.
|
||||
*
|
||||
* This particular file may be used however you like, including copying it
|
||||
* verbatim into a closed-source project, exploiting it commercially, and
|
||||
* removing any trace of my name from the source (although I hope you won't
|
||||
* do that). I welcome enhancements and corrections to this file, but I do
|
||||
* not require you to send me patches if you make changes.
|
||||
*
|
||||
* Unless otherwise stated, the rest of PhysicsFS falls under the GNU Lesser
|
||||
* General Public License: http://www.gnu.org/licenses/lgpl.txt
|
||||
*
|
||||
* SDL falls under the LGPL, too. You can get SDL at http://www.libsdl.org/
|
||||
*
|
||||
* This file was written by Ryan C. Gordon. (icculus@clutteredmind.org).
|
||||
*/
|
||||
|
||||
#ifndef _INCLUDE_PHYSFSRWOPS_H_
|
||||
#define _INCLUDE_PHYSFSRWOPS_H_
|
||||
|
||||
#include "physfs.h"
|
||||
#include "SDL.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Open a platform-independent filename for reading, and make it accessible
|
||||
* via an SDL_RWops structure. The file will be closed in PhysicsFS when the
|
||||
* RWops is closed. PhysicsFS should be configured to your liking before
|
||||
* opening files through this method.
|
||||
*
|
||||
* @param filename File to open in platform-independent notation.
|
||||
* @return A valid SDL_RWops structure on success, NULL on error. Specifics
|
||||
* of the error can be gleaned from PHYSFS_getLastError().
|
||||
*/
|
||||
__EXPORT__ SDL_RWops *PHYSFSRWOPS_openRead(const char *fname);
|
||||
|
||||
/**
|
||||
* Open a platform-independent filename for writing, and make it accessible
|
||||
* via an SDL_RWops structure. The file will be closed in PhysicsFS when the
|
||||
* RWops is closed. PhysicsFS should be configured to your liking before
|
||||
* opening files through this method.
|
||||
*
|
||||
* @param filename File to open in platform-independent notation.
|
||||
* @return A valid SDL_RWops structure on success, NULL on error. Specifics
|
||||
* of the error can be gleaned from PHYSFS_getLastError().
|
||||
*/
|
||||
__EXPORT__ SDL_RWops *PHYSFSRWOPS_openWrite(const char *fname);
|
||||
|
||||
/**
|
||||
* Open a platform-independent filename for appending, and make it accessible
|
||||
* via an SDL_RWops structure. The file will be closed in PhysicsFS when the
|
||||
* RWops is closed. PhysicsFS should be configured to your liking before
|
||||
* opening files through this method.
|
||||
*
|
||||
* @param filename File to open in platform-independent notation.
|
||||
* @return A valid SDL_RWops structure on success, NULL on error. Specifics
|
||||
* of the error can be gleaned from PHYSFS_getLastError().
|
||||
*/
|
||||
__EXPORT__ SDL_RWops *PHYSFSRWOPS_openAppend(const char *fname);
|
||||
|
||||
/**
|
||||
* Make a SDL_RWops from an existing PhysicsFS file handle. You should
|
||||
* dispose of any references to the handle after successful creation of
|
||||
* the RWops. The actual PhysicsFS handle will be destroyed when the
|
||||
* RWops is closed.
|
||||
*
|
||||
* @param handle a valid PhysicsFS file handle.
|
||||
* @return A valid SDL_RWops structure on success, NULL on error. Specifics
|
||||
* of the error can be gleaned from PHYSFS_getLastError().
|
||||
*/
|
||||
__EXPORT__ SDL_RWops *PHYSFSRWOPS_makeRWops(PHYSFS_file *handle);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* include-once blocker */
|
||||
|
||||
/* end of physfsrwops.h ... */
|
||||
|
|
@ -1,462 +0,0 @@
|
|||
/*
|
||||
* PhysicsFS - ruby interface
|
||||
*
|
||||
* Author:: Ed Sinjiashvili (slimb@vlinkmail.com)
|
||||
* License:: LGPL
|
||||
*/
|
||||
|
||||
#include "physfs.h"
|
||||
#include "ruby.h"
|
||||
|
||||
#include "rb_physfs.h"
|
||||
#include "rb_physfs_file.h"
|
||||
|
||||
VALUE modulePhysfs;
|
||||
|
||||
/*
|
||||
* PhysicsFS::init str
|
||||
*
|
||||
* initialize PhysicsFS
|
||||
*/
|
||||
VALUE physfs_init (VALUE self, VALUE str)
|
||||
{
|
||||
int result = PHYSFS_init (STR2CSTR(str));
|
||||
|
||||
if (result)
|
||||
return Qtrue;
|
||||
|
||||
return Qfalse;
|
||||
}
|
||||
|
||||
/*
|
||||
* PhysicsFS::deinit
|
||||
*/
|
||||
VALUE physfs_deinit (VALUE self)
|
||||
{
|
||||
if (PHYSFS_deinit ())
|
||||
return Qtrue;
|
||||
|
||||
return Qfalse;
|
||||
}
|
||||
|
||||
/*
|
||||
* PhysicsFS::version
|
||||
*
|
||||
* return PhysicsFS::Version object
|
||||
*/
|
||||
VALUE physfs_version (VALUE self)
|
||||
{
|
||||
char evalStr[200];
|
||||
PHYSFS_Version ver;
|
||||
|
||||
PHYSFS_getLinkedVersion (&ver);
|
||||
|
||||
sprintf (evalStr, "PhysicsFS::Version.new %d, %d, %d",
|
||||
ver.major, ver.minor, ver.patch);
|
||||
return rb_eval_string (evalStr);
|
||||
}
|
||||
|
||||
/*
|
||||
* PhysicsFS::supported_archives
|
||||
*
|
||||
* return Array of PhysicsFS::ArchiveInfo objects
|
||||
*/
|
||||
VALUE physfs_supported_archives (VALUE self)
|
||||
{
|
||||
const PHYSFS_ArchiveInfo **info = PHYSFS_supportedArchiveTypes();
|
||||
VALUE klass = rb_const_get (modulePhysfs, rb_intern ("ArchiveInfo"));
|
||||
VALUE ary = rb_ary_new ();
|
||||
VALUE params[4];
|
||||
|
||||
while ( *info != 0 )
|
||||
{
|
||||
params[0] = rb_str_new2 ((*info)->extension);
|
||||
params[1] = rb_str_new2 ((*info)->description);
|
||||
params[2] = rb_str_new2 ((*info)->author);
|
||||
params[3] = rb_str_new2 ((*info)->url);
|
||||
|
||||
rb_ary_push (ary, rb_class_new_instance (4, params, klass));
|
||||
info++;
|
||||
}
|
||||
|
||||
return ary;
|
||||
}
|
||||
|
||||
/*
|
||||
* PhysicsFS::last_error
|
||||
*
|
||||
* return string representation of last PhysicsFS error
|
||||
*/
|
||||
VALUE physfs_last_error (VALUE self)
|
||||
{
|
||||
const char *last_error = PHYSFS_getLastError ();
|
||||
|
||||
if (last_error == 0)
|
||||
last_error = "";
|
||||
|
||||
return rb_str_new2 (last_error);
|
||||
}
|
||||
|
||||
/*
|
||||
* PhysicsFS::dir_separator
|
||||
*
|
||||
* return platform directory separator
|
||||
*/
|
||||
VALUE physfs_dir_separator (VALUE self)
|
||||
{
|
||||
return rb_str_new2 (PHYSFS_getDirSeparator ());
|
||||
}
|
||||
|
||||
/*
|
||||
* PhysicsFS::permit_symlinks boolValue
|
||||
*
|
||||
* turn symlinks support on/off
|
||||
*/
|
||||
VALUE physfs_permit_symlinks (VALUE self, VALUE allow)
|
||||
{
|
||||
int p = 1;
|
||||
|
||||
if (allow == Qfalse || allow == Qnil)
|
||||
p = 0;
|
||||
|
||||
PHYSFS_permitSymbolicLinks (p);
|
||||
return Qtrue;
|
||||
}
|
||||
|
||||
/*
|
||||
* PhysicsFS::cdrom_dirs
|
||||
*
|
||||
* return Array of strings containing available CDs
|
||||
*/
|
||||
VALUE physfs_cdrom_dirs (VALUE self)
|
||||
{
|
||||
char **cds = PHYSFS_getCdRomDirs();
|
||||
char **i;
|
||||
VALUE ary = rb_ary_new ();
|
||||
|
||||
for (i = cds; *i != 0; i++)
|
||||
rb_ary_push (ary, rb_str_new2 (*i));
|
||||
|
||||
PHYSFS_freeList (cds);
|
||||
return ary;
|
||||
}
|
||||
|
||||
/*
|
||||
* PhysicsFS::base_dir
|
||||
*
|
||||
* return base directory
|
||||
*/
|
||||
VALUE physfs_base_dir (VALUE self)
|
||||
{
|
||||
const char *base_dir = PHYSFS_getBaseDir ();
|
||||
if (base_dir == 0)
|
||||
base_dir = "";
|
||||
|
||||
return rb_str_new2 (base_dir);
|
||||
}
|
||||
|
||||
/*
|
||||
* PhysicsFS::user_dir
|
||||
*
|
||||
* return user directory
|
||||
*/
|
||||
VALUE physfs_user_dir (VALUE self)
|
||||
{
|
||||
const char *user_dir = PHYSFS_getBaseDir ();
|
||||
if (user_dir == 0)
|
||||
user_dir = "";
|
||||
|
||||
return rb_str_new2 (user_dir);
|
||||
}
|
||||
|
||||
/*
|
||||
* PhysicsFS::write_dir
|
||||
*
|
||||
* return write directory
|
||||
*/
|
||||
VALUE physfs_write_dir (VALUE self)
|
||||
{
|
||||
const char *write_dir = PHYSFS_getWriteDir ();
|
||||
if (write_dir == 0)
|
||||
return Qnil;
|
||||
|
||||
return rb_str_new2 (write_dir);
|
||||
}
|
||||
|
||||
/*
|
||||
* PhysicsFS::write_dir= str
|
||||
*
|
||||
* set write directory to *str*
|
||||
*/
|
||||
VALUE physfs_set_write_dir (VALUE self, VALUE str)
|
||||
{
|
||||
int result = PHYSFS_setWriteDir (STR2CSTR(str));
|
||||
|
||||
if (result)
|
||||
return Qtrue;
|
||||
return Qfalse;
|
||||
}
|
||||
|
||||
/*
|
||||
* PhysicsFS::add_to_search_path str, append
|
||||
*
|
||||
* if append > 0 - append str to search path, otherwise prepend it
|
||||
*/
|
||||
VALUE physfs_add_search_path (VALUE self, VALUE str, VALUE append)
|
||||
{
|
||||
int result = PHYSFS_addToSearchPath (STR2CSTR(str), FIX2INT(append));
|
||||
if (result)
|
||||
return Qtrue;
|
||||
return Qfalse;
|
||||
}
|
||||
|
||||
/*
|
||||
* PhysicsFS::remove_from_search_path str
|
||||
*
|
||||
* removes str from search path
|
||||
*/
|
||||
VALUE physfs_remove_search_path (VALUE self, VALUE str)
|
||||
{
|
||||
int result = PHYSFS_removeFromSearchPath (STR2CSTR(str));
|
||||
if (result)
|
||||
return Qtrue;
|
||||
return Qfalse;
|
||||
}
|
||||
|
||||
/*
|
||||
* PhysicsFS::search_path
|
||||
*
|
||||
* return current search_path - as array of strings
|
||||
*/
|
||||
VALUE physfs_search_path (VALUE self)
|
||||
{
|
||||
char **path = PHYSFS_getSearchPath ();
|
||||
char **i;
|
||||
VALUE ary = rb_ary_new ();
|
||||
|
||||
for (i = path ; *i != 0; i++)
|
||||
rb_ary_push (ary, rb_str_new2 (*i));
|
||||
|
||||
PHYSFS_freeList (path);
|
||||
return ary;
|
||||
}
|
||||
|
||||
//
|
||||
VALUE physfs_setSaneConfig(VALUE self, VALUE org, VALUE app, VALUE ext,
|
||||
VALUE includeCdroms, VALUE archivesFirst)
|
||||
{
|
||||
int res = PHYSFS_setSaneConfig (STR2CSTR(org), STR2CSTR(app), STR2CSTR(ext),
|
||||
RTEST(includeCdroms), RTEST(archivesFirst));
|
||||
if (res)
|
||||
return Qtrue;
|
||||
|
||||
return Qfalse;
|
||||
}
|
||||
|
||||
/*
|
||||
* PhysicsFS::mkdir newdir
|
||||
*
|
||||
* create new directory
|
||||
*/
|
||||
VALUE physfs_mkdir (VALUE self, VALUE newdir)
|
||||
{
|
||||
int result = PHYSFS_mkdir (STR2CSTR(newdir));
|
||||
if (result)
|
||||
return Qtrue;
|
||||
return Qfalse;
|
||||
}
|
||||
|
||||
/*
|
||||
* PhysicsFS::delete name
|
||||
*
|
||||
* delete file with name
|
||||
*/
|
||||
VALUE physfs_delete (VALUE self, VALUE name)
|
||||
{
|
||||
int result = PHYSFS_delete (STR2CSTR(name));
|
||||
if (result)
|
||||
return Qtrue;
|
||||
return Qfalse;
|
||||
}
|
||||
|
||||
/*
|
||||
* PhysicsFS::real_dir name
|
||||
*
|
||||
* return real directory (in search path) of a name
|
||||
*/
|
||||
VALUE physfs_real_dir (VALUE self, VALUE name)
|
||||
{
|
||||
const char *path = PHYSFS_getRealDir (STR2CSTR(name));
|
||||
if (path == 0)
|
||||
return Qnil;
|
||||
|
||||
return rb_str_new2 (path);
|
||||
}
|
||||
|
||||
/*
|
||||
* PhysicsFS::enumerate dir
|
||||
*
|
||||
* list a dir from a search path
|
||||
*/
|
||||
VALUE physfs_enumerate (VALUE self, VALUE dir)
|
||||
{
|
||||
char **files = PHYSFS_enumerateFiles (STR2CSTR(dir));
|
||||
char **i;
|
||||
VALUE ary = rb_ary_new ();
|
||||
|
||||
for (i = files; *i != 0; i++)
|
||||
rb_ary_push (ary, rb_str_new2 (*i));
|
||||
|
||||
PHYSFS_freeList (files);
|
||||
return ary;
|
||||
}
|
||||
|
||||
/*
|
||||
* PhysicsFS::exists? name
|
||||
*
|
||||
* does a file with name exist?
|
||||
*/
|
||||
VALUE physfs_exists (VALUE self, VALUE name)
|
||||
{
|
||||
int result = PHYSFS_exists (STR2CSTR(name));
|
||||
if (result)
|
||||
return Qtrue;
|
||||
return Qfalse;
|
||||
}
|
||||
|
||||
/*
|
||||
* PhysicsFS::is_directory? name
|
||||
*
|
||||
* return true if name is directory
|
||||
*/
|
||||
VALUE physfs_is_directory (VALUE self, VALUE name)
|
||||
{
|
||||
int result = PHYSFS_isDirectory (STR2CSTR(name));
|
||||
if (result)
|
||||
return Qtrue;
|
||||
return Qfalse;
|
||||
}
|
||||
|
||||
/*
|
||||
* PhysicsFS::is_symlink? name
|
||||
*
|
||||
* return true if name is symlink
|
||||
*/
|
||||
VALUE physfs_is_symlink (VALUE self, VALUE name)
|
||||
{
|
||||
int result = PHYSFS_isSymbolicLink (STR2CSTR(name));
|
||||
if (result)
|
||||
return Qtrue;
|
||||
return Qfalse;
|
||||
}
|
||||
|
||||
/*
|
||||
* PhysicsFS::last_mod_time name
|
||||
*
|
||||
* return last modification time of a file
|
||||
*/
|
||||
VALUE physfs_last_mod_time (VALUE self, VALUE name)
|
||||
{
|
||||
int result = PHYSFS_getLastModTime (STR2CSTR(name));
|
||||
|
||||
return INT2FIX(result);
|
||||
}
|
||||
|
||||
/*
|
||||
* PhysicsFS::open_read name
|
||||
*
|
||||
* return +PhysicsFS::File+ ready for reading
|
||||
*/
|
||||
VALUE physfs_open_read (VALUE self, VALUE name)
|
||||
{
|
||||
PHYSFS_file *file = PHYSFS_openRead (STR2CSTR(name));
|
||||
return physfs_file_new (file);
|
||||
}
|
||||
|
||||
/*
|
||||
* PhysicsFS::open_write name
|
||||
*
|
||||
* return PhysicsFS::File ready for writing
|
||||
*/
|
||||
VALUE physfs_open_write (VALUE self, VALUE name)
|
||||
{
|
||||
PHYSFS_file *file = PHYSFS_openWrite (STR2CSTR(name));
|
||||
return physfs_file_new (file);
|
||||
}
|
||||
|
||||
/*
|
||||
* PhysicsFS::open_append name
|
||||
*
|
||||
* return PhysicsFS::File ready for appending
|
||||
*/
|
||||
VALUE physfs_open_append (VALUE self, VALUE name)
|
||||
{
|
||||
PHYSFS_file *file = PHYSFS_openAppend (STR2CSTR(name));
|
||||
return physfs_file_new (file);
|
||||
}
|
||||
|
||||
void Init_physfs_so (void)
|
||||
{
|
||||
modulePhysfs = rb_define_module ("PhysicsFS");
|
||||
|
||||
rb_define_singleton_method (modulePhysfs, "init_internal", physfs_init, 1);
|
||||
rb_define_singleton_method (modulePhysfs, "deinit", physfs_deinit, 0);
|
||||
rb_define_singleton_method (modulePhysfs, "version", physfs_version, 0);
|
||||
rb_define_singleton_method (modulePhysfs, "supported_archives",
|
||||
physfs_supported_archives, 0);
|
||||
rb_define_singleton_method (modulePhysfs, "last_error",
|
||||
physfs_last_error, 0);
|
||||
rb_define_singleton_method (modulePhysfs, "dir_separator",
|
||||
physfs_dir_separator, 0);
|
||||
rb_define_singleton_method (modulePhysfs, "permit_symlinks",
|
||||
physfs_permit_symlinks, 1);
|
||||
rb_define_singleton_method (modulePhysfs, "cdrom_dirs",
|
||||
physfs_cdrom_dirs, 0);
|
||||
rb_define_singleton_method (modulePhysfs, "base_dir", physfs_base_dir, 0);
|
||||
rb_define_singleton_method (modulePhysfs, "user_dir", physfs_user_dir, 0);
|
||||
|
||||
rb_define_singleton_method (modulePhysfs, "write_dir", physfs_write_dir, 0);
|
||||
rb_define_singleton_method (modulePhysfs, "write_dir=",
|
||||
physfs_set_write_dir, 1);
|
||||
|
||||
rb_define_singleton_method (modulePhysfs, "add_to_search_path",
|
||||
physfs_add_search_path, 2);
|
||||
rb_define_singleton_method (modulePhysfs, "remove_from_search_path",
|
||||
physfs_remove_search_path, 1);
|
||||
rb_define_singleton_method (modulePhysfs, "search_path",
|
||||
physfs_search_path, 0);
|
||||
|
||||
rb_define_singleton_method (modulePhysfs, "set_sane_config",
|
||||
physfs_setSaneConfig, 5);
|
||||
|
||||
rb_define_singleton_method (modulePhysfs, "mkdir", physfs_mkdir, 1);
|
||||
rb_define_singleton_method (modulePhysfs, "delete", physfs_delete, 1);
|
||||
rb_define_singleton_method (modulePhysfs, "real_dir",
|
||||
physfs_real_dir, 1);
|
||||
rb_define_singleton_method (modulePhysfs, "enumerate", physfs_enumerate, 1);
|
||||
rb_define_singleton_method (modulePhysfs, "exists?", physfs_exists, 1);
|
||||
rb_define_singleton_method (modulePhysfs, "is_directory?",
|
||||
physfs_is_directory, 1);
|
||||
rb_define_singleton_method (modulePhysfs, "is_symlink?",
|
||||
physfs_is_symlink, 1);
|
||||
rb_define_singleton_method (modulePhysfs, "last_mod_time",
|
||||
physfs_last_mod_time, 1);
|
||||
|
||||
rb_define_singleton_method (modulePhysfs, "open_read",
|
||||
physfs_open_read, 1);
|
||||
rb_define_singleton_method (modulePhysfs, "open_write",
|
||||
physfs_open_write, 1);
|
||||
rb_define_singleton_method (modulePhysfs, "open_append",
|
||||
physfs_open_append, 1);
|
||||
|
||||
init_physfs_file ();
|
||||
init_sdl_rwops ();
|
||||
}
|
||||
|
||||
/*
|
||||
// Local Variables:
|
||||
// mode: C
|
||||
// c-indentation-style: "stroustrup"
|
||||
// indent-tabs-mode: nil
|
||||
// End:
|
||||
*/
|
|
@ -1,13 +0,0 @@
|
|||
/*
|
||||
* PhysicsFS - ruby interface
|
||||
*
|
||||
* Author:: Ed Sinjiashvili (slimb@vlinkmail.com)
|
||||
* License:: LGPL
|
||||
*/
|
||||
|
||||
#ifndef __RB__PHYSFS__H__
|
||||
#define __RB__PHYSFS__H__
|
||||
|
||||
extern VALUE modulePhysfs;
|
||||
|
||||
#endif
|
|
@ -1,226 +0,0 @@
|
|||
/*
|
||||
* PhysicsFS File abstraction - ruby interface
|
||||
*
|
||||
* Author:: Ed Sinjiashvili (slimb@vlinkmail.com)
|
||||
* License:: LGPL
|
||||
*/
|
||||
|
||||
#include "physfs.h"
|
||||
#include "ruby.h"
|
||||
|
||||
#include "rb_physfs.h"
|
||||
#include "rb_physfs_file.h"
|
||||
#include "physfsrwops.h"
|
||||
|
||||
VALUE classPhysfsFile;
|
||||
|
||||
/*
|
||||
* construct new PhysicsFS::File object
|
||||
*/
|
||||
VALUE physfs_file_new (PHYSFS_file *file)
|
||||
{
|
||||
if (file == 0)
|
||||
return Qnil;
|
||||
|
||||
return Data_Wrap_Struct (classPhysfsFile, 0, 0, file);
|
||||
}
|
||||
|
||||
/*
|
||||
* PhysicsFS::File#close
|
||||
*
|
||||
* Close the file. It's illegal to use the object after its closure.
|
||||
*/
|
||||
VALUE physfs_file_close (VALUE self)
|
||||
{
|
||||
int result;
|
||||
PHYSFS_file *file;
|
||||
Data_Get_Struct (self, PHYSFS_file, file);
|
||||
|
||||
if (file == 0)
|
||||
return Qfalse;
|
||||
|
||||
result = PHYSFS_close (file);
|
||||
DATA_PTR(self) = 0;
|
||||
|
||||
if (result)
|
||||
return Qtrue;
|
||||
return Qfalse;
|
||||
}
|
||||
|
||||
/*
|
||||
* PhysicsFS::File#read obj_size, num_objects
|
||||
*
|
||||
* Read *objCount* objects which are *objSize* each.
|
||||
* return String instance containing raw data or nil if failure.
|
||||
* #length of string will reflect real number of objects read.
|
||||
*/
|
||||
VALUE physfs_file_read (VALUE self, VALUE objSize, VALUE objCount)
|
||||
{
|
||||
int objRead;
|
||||
void *buffer;
|
||||
VALUE result;
|
||||
PHYSFS_file *file;
|
||||
|
||||
Data_Get_Struct (self, PHYSFS_file, file);
|
||||
if (file == 0)
|
||||
return Qnil; //wasted file - no read possible
|
||||
|
||||
buffer = malloc (FIX2UINT(objSize) * FIX2UINT(objCount));
|
||||
if (buffer == 0)
|
||||
return Qnil;
|
||||
|
||||
objRead = PHYSFS_read (file, buffer, FIX2UINT(objSize), FIX2UINT(objCount));
|
||||
if (objRead == -1)
|
||||
{
|
||||
free (buffer);
|
||||
return Qnil;
|
||||
}
|
||||
|
||||
result = rb_str_new (buffer, objRead * FIX2UINT(objSize));
|
||||
free (buffer);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* PhysicsFS::File#write buffer, obj_size, num_objects
|
||||
*
|
||||
* return nil on failure or number of objects written.
|
||||
*/
|
||||
VALUE physfs_file_write (VALUE self, VALUE buf, VALUE objSize, VALUE objCount)
|
||||
{
|
||||
int result;
|
||||
PHYSFS_file *file;
|
||||
|
||||
Data_Get_Struct (self, PHYSFS_file, file);
|
||||
if (file == 0)
|
||||
return Qnil;
|
||||
|
||||
result = PHYSFS_write (file, STR2CSTR(buf),
|
||||
FIX2UINT(objSize), FIX2UINT(objCount));
|
||||
if (result == -1)
|
||||
return Qnil;
|
||||
|
||||
return INT2FIX(result);
|
||||
}
|
||||
|
||||
/*
|
||||
* PhysicsFS::File#eof?
|
||||
*/
|
||||
VALUE physfs_file_eof (VALUE self)
|
||||
{
|
||||
int result;
|
||||
PHYSFS_file *file;
|
||||
|
||||
Data_Get_Struct (self, PHYSFS_file, file);
|
||||
if (file == 0)
|
||||
return Qnil;
|
||||
|
||||
result = PHYSFS_eof (file);
|
||||
|
||||
if (result)
|
||||
return Qtrue;
|
||||
|
||||
return Qfalse;
|
||||
}
|
||||
|
||||
/*
|
||||
* PhysicsFS::File#tell
|
||||
*
|
||||
* tells current position in file
|
||||
*/
|
||||
VALUE physfs_file_tell (VALUE self)
|
||||
{
|
||||
int result;
|
||||
PHYSFS_file *file;
|
||||
|
||||
Data_Get_Struct (self, PHYSFS_file, file);
|
||||
if (file == 0)
|
||||
return Qnil;
|
||||
|
||||
result = PHYSFS_tell (file);
|
||||
|
||||
if (result == -1)
|
||||
return Qnil;
|
||||
|
||||
return INT2FIX(result);
|
||||
}
|
||||
|
||||
/*
|
||||
* PhysicsFS::File#seek pos
|
||||
*
|
||||
* seek to pos in file
|
||||
*/
|
||||
VALUE physfs_file_seek (VALUE self, VALUE pos)
|
||||
{
|
||||
int result;
|
||||
PHYSFS_file *file;
|
||||
|
||||
Data_Get_Struct (self, PHYSFS_file, file);
|
||||
if (file == 0)
|
||||
return Qnil;
|
||||
|
||||
result = PHYSFS_seek (file, FIX2LONG(pos));
|
||||
|
||||
if (result)
|
||||
return Qtrue;
|
||||
|
||||
return Qfalse;
|
||||
}
|
||||
|
||||
/*
|
||||
* PhysicsFS::File#length
|
||||
*/
|
||||
VALUE physfs_file_length (VALUE self)
|
||||
{
|
||||
int result;
|
||||
PHYSFS_file *file;
|
||||
|
||||
Data_Get_Struct (self, PHYSFS_file, file);
|
||||
if (file == 0)
|
||||
return Qnil;
|
||||
|
||||
result = PHYSFS_fileLength (file);
|
||||
|
||||
if (result == -1)
|
||||
return Qnil;
|
||||
|
||||
return INT2FIX(result);
|
||||
}
|
||||
|
||||
/*
|
||||
* PhysicsFS::File#to_rwops
|
||||
*
|
||||
* File object is converted to RWops object.
|
||||
* File object becomes unusable after that - every operation
|
||||
* should be done through new-born RWops object.
|
||||
*/
|
||||
VALUE physfs_file_to_rwops (VALUE self)
|
||||
{
|
||||
PHYSFS_file *file;
|
||||
SDL_RWops *rwops;
|
||||
|
||||
Data_Get_Struct (self, PHYSFS_file, file);
|
||||
if (file == 0)
|
||||
return Qnil;
|
||||
|
||||
rwops = PHYSFSRWOPS_makeRWops (file);
|
||||
if (rwops == 0)
|
||||
return Qnil;
|
||||
|
||||
DATA_PTR(self) = 0; // oh, gosh, we've sacrificed ourselves!
|
||||
return sdl_rwops_new (rwops);
|
||||
}
|
||||
|
||||
void init_physfs_file (void)
|
||||
{
|
||||
classPhysfsFile = rb_define_class_under (modulePhysfs, "File", rb_cObject);
|
||||
|
||||
rb_define_method (classPhysfsFile, "close", physfs_file_close, 0);
|
||||
rb_define_method (classPhysfsFile, "eof?", physfs_file_eof, 0);
|
||||
rb_define_method (classPhysfsFile, "tell", physfs_file_tell, 0);
|
||||
rb_define_method (classPhysfsFile, "seek", physfs_file_seek, 1);
|
||||
rb_define_method (classPhysfsFile, "length", physfs_file_length, 0);
|
||||
rb_define_method (classPhysfsFile, "read", physfs_file_read, 2);
|
||||
rb_define_method (classPhysfsFile, "write", physfs_file_write, 3);
|
||||
rb_define_method (classPhysfsFile, "to_rwops", physfs_file_to_rwops, 0);
|
||||
}
|
|
@ -1,24 +0,0 @@
|
|||
/*
|
||||
* PhysicsFS File abstraction - ruby interface
|
||||
*
|
||||
* Author:: Ed Sinjiashvili (slimb@vlinkmail.com)
|
||||
* License:: LGPL
|
||||
*/
|
||||
|
||||
#ifndef __RB__PHYSFS__FILE__H__
|
||||
#define __RB__PHYSFS__FILE__H__
|
||||
|
||||
extern VALUE classPhysfsFile;
|
||||
|
||||
VALUE physfs_file_new (PHYSFS_file *file);
|
||||
VALUE physfs_file_close (VALUE self);
|
||||
VALUE physfs_file_read (VALUE self, VALUE objSize, VALUE objCount);
|
||||
VALUE physfs_file_write (VALUE self, VALUE buf, VALUE objSize, VALUE objCount);
|
||||
VALUE physfs_file_eof (VALUE self);
|
||||
VALUE physfs_file_tell (VALUE self);
|
||||
VALUE physfs_file_seek (VALUE self, VALUE pos);
|
||||
VALUE physfs_file_length (VALUE self);
|
||||
|
||||
void init_physfs_file (void);
|
||||
|
||||
#endif
|
|
@ -1,162 +0,0 @@
|
|||
/*
|
||||
* SDL_RWops - ruby interface
|
||||
*
|
||||
* Author:: Ed Sinjiashvili (slimb@vlinkmail.com)
|
||||
* License:: LGPL
|
||||
*/
|
||||
|
||||
#include "SDL_rwops.h"
|
||||
#include "ruby.h"
|
||||
|
||||
#include "rb_physfs.h"
|
||||
#include "rb_sdl_rwops.h"
|
||||
|
||||
VALUE classRWops;
|
||||
|
||||
/*
|
||||
* RWops constructor
|
||||
*/
|
||||
VALUE sdl_rwops_new (SDL_RWops *ops)
|
||||
{
|
||||
VALUE result;
|
||||
|
||||
if (ops == 0)
|
||||
return Qnil;
|
||||
|
||||
result = Data_Wrap_Struct (classRWops, 0, SDL_FreeRW, ops);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* PhysicsFS::RWops::from_file name, mode
|
||||
*
|
||||
* create RWops object from file
|
||||
*/
|
||||
VALUE sdl_rwops_from_file (VALUE self, VALUE name, VALUE mode)
|
||||
{
|
||||
SDL_RWops *ops = SDL_RWFromFile(STR2CSTR(name), STR2CSTR(mode));
|
||||
return sdl_rwops_new (ops);
|
||||
}
|
||||
|
||||
/*
|
||||
* PhysicsFS::RWops::from_memory string
|
||||
*
|
||||
* create RWops object from memory
|
||||
*/
|
||||
VALUE sdl_rwops_from_mem (VALUE self, VALUE str)
|
||||
{
|
||||
int len = RSTRING(str)->len;
|
||||
void *mem = STR2CSTR(str);
|
||||
SDL_RWops *ops = SDL_RWFromMem(mem, len);
|
||||
|
||||
return sdl_rwops_new (ops);
|
||||
}
|
||||
|
||||
/*
|
||||
* PhysicsFS::RWops#seek offset, whence
|
||||
*
|
||||
* position RWops object
|
||||
*/
|
||||
VALUE sdl_rwops_seek (VALUE self, VALUE offset, VALUE whence)
|
||||
{
|
||||
int result;
|
||||
SDL_RWops *ops;
|
||||
|
||||
Data_Get_Struct (self, SDL_RWops, ops);
|
||||
if (ops == 0)
|
||||
return Qnil;
|
||||
|
||||
result = SDL_RWseek(ops, FIX2INT(offset), FIX2INT(whence));
|
||||
return INT2FIX(result);
|
||||
}
|
||||
|
||||
/*
|
||||
* PhysicsFS::RWops#close
|
||||
*
|
||||
* close RWops. No use of the object is possible after that.
|
||||
*/
|
||||
VALUE sdl_rwops_close (VALUE self)
|
||||
{
|
||||
int result;
|
||||
SDL_RWops *ops;
|
||||
|
||||
Data_Get_Struct (self, SDL_RWops, ops);
|
||||
if (ops == 0)
|
||||
return Qnil;
|
||||
|
||||
result = SDL_RWclose (ops);
|
||||
DATA_PTR(self) = 0;
|
||||
|
||||
return INT2FIX(result);
|
||||
}
|
||||
|
||||
/*
|
||||
* PhysicsFS::RWops#read
|
||||
*
|
||||
* read from RWops object objCount objSize'd entities.
|
||||
* return string containing raw data or nil
|
||||
*/
|
||||
VALUE sdl_rwops_read (VALUE self, VALUE objSize, VALUE objCount)
|
||||
{
|
||||
int objRead;
|
||||
void *buffer;
|
||||
VALUE result;
|
||||
SDL_RWops *ops;
|
||||
|
||||
Data_Get_Struct (self, SDL_RWops, ops);
|
||||
if (ops == 0)
|
||||
return Qnil;
|
||||
|
||||
buffer = malloc (FIX2UINT(objSize) * FIX2UINT(objCount));
|
||||
if (buffer == 0)
|
||||
return Qnil;
|
||||
|
||||
objRead = SDL_RWread (ops, buffer, FIX2UINT(objSize), FIX2UINT(objCount));
|
||||
if (objRead == -1)
|
||||
{
|
||||
free (buffer);
|
||||
return Qnil;
|
||||
}
|
||||
|
||||
result = rb_str_new (buffer, objRead * FIX2UINT(objSize));
|
||||
free (buffer);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* PhysicsFS::RWops#write buffer, size, n
|
||||
*
|
||||
* write raw string containing n objects size length each.
|
||||
* return number of objects written or nil
|
||||
*/
|
||||
VALUE sdl_rwops_write (VALUE self, VALUE buffer, VALUE size, VALUE n)
|
||||
{
|
||||
int result;
|
||||
SDL_RWops *ops;
|
||||
|
||||
Data_Get_Struct (self, SDL_RWops, ops);
|
||||
if (ops == 0)
|
||||
return Qnil;
|
||||
|
||||
result = SDL_RWwrite (ops, STR2CSTR(buffer), FIX2INT(size), FIX2INT(n));
|
||||
|
||||
if (result == -1)
|
||||
return Qnil;
|
||||
|
||||
return INT2FIX(result);
|
||||
}
|
||||
|
||||
void init_sdl_rwops (void)
|
||||
{
|
||||
classRWops = rb_define_class_under (modulePhysfs, "RWops", rb_cObject);
|
||||
|
||||
rb_define_method (classRWops, "seek", sdl_rwops_seek, 2);
|
||||
rb_define_method (classRWops, "read", sdl_rwops_read, 2);
|
||||
rb_define_method (classRWops, "write", sdl_rwops_write, 3);
|
||||
rb_define_method (classRWops, "close", sdl_rwops_close, 0);
|
||||
|
||||
rb_define_singleton_method (classRWops, "from_file",
|
||||
sdl_rwops_from_file, 2);
|
||||
rb_define_singleton_method (classRWops, "from_memory",
|
||||
sdl_rwops_from_mem, 1);
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
/*
|
||||
* SDL_RWops - ruby interface
|
||||
*
|
||||
* Author:: Ed Sinjiashvili (slimb@vlinkmail.com)
|
||||
* License:: LGPL
|
||||
*/
|
||||
|
||||
#ifndef __RB__SDL__RWOPS__H__
|
||||
#define __RB__SDL__RWOPS__H__
|
||||
|
||||
extern VALUE classRWops;
|
||||
|
||||
VALUE sdl_rwops_new (SDL_RWops *ops);
|
||||
void init_sdl_rwops (void);
|
||||
|
||||
#endif
|
|
@ -1,358 +0,0 @@
|
|||
#
|
||||
# PhysicsFS test program - mimics real physfs_test
|
||||
#
|
||||
require 'readline'
|
||||
require 'physfs'
|
||||
|
||||
def die msg
|
||||
puts "#{msg} - reason: #{PhysicsFS.last_error}"
|
||||
end
|
||||
|
||||
#
|
||||
# parse line to command and args
|
||||
#
|
||||
def parse line
|
||||
return false if line.nil?
|
||||
|
||||
if line.strip =~ /^(.*?) (?: (?:\s+(.*)) | $)/x
|
||||
run $1, $2
|
||||
else
|
||||
false
|
||||
end
|
||||
end
|
||||
|
||||
#
|
||||
# parse command args
|
||||
#
|
||||
def parse_args args
|
||||
args.strip!
|
||||
|
||||
dquoted = /^ " (.*?) "/x
|
||||
squoted = /^ ' (.*?) '/x
|
||||
unquoted = /^([^\s\'\"]+)/
|
||||
|
||||
regexps = [dquoted, squoted, unquoted]
|
||||
|
||||
result = []
|
||||
while args != ""
|
||||
regexps.each do |r|
|
||||
if args =~ r
|
||||
result << $1
|
||||
args.sub! r, ""
|
||||
args.sub!(/\s+/, "")
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
result
|
||||
end
|
||||
|
||||
def usage cmd, prefix = "usage: "
|
||||
print prefix
|
||||
args = Commands::HELP[cmd]
|
||||
if args
|
||||
print cmd
|
||||
args.scan(/\w+/).each {|x|
|
||||
print " <#{x}>"
|
||||
}
|
||||
puts
|
||||
else
|
||||
puts %|#{cmd} (no arguments)|
|
||||
end
|
||||
end
|
||||
|
||||
# commands go below
|
||||
module Commands
|
||||
HELP = {
|
||||
"init" => "argv0",
|
||||
"addarchive" => "archiveLocation append",
|
||||
"removearchive" => "archiveLocation",
|
||||
"enumerate" => "dirToEnumerate",
|
||||
"ls" => "dirToEnumerate",
|
||||
"setwritedir" => "newWriteDir",
|
||||
"permitsymlinks" => "1or0",
|
||||
"setsaneconfig" => "org appName arcExt includeCdRoms archivesFirst",
|
||||
"mkdir" => "dirToMk",
|
||||
"delete" => "dirToDelete",
|
||||
"getrealdir" => "fileToFind",
|
||||
"exists" => "fileToCheck",
|
||||
"isdir" => "fileToCheck",
|
||||
"issymlink" => "fileToCheck",
|
||||
"cat" => "fileToCat",
|
||||
"filelength" => "fileToCheck",
|
||||
"append" => "fileToAppend",
|
||||
"write" => "fileToCreateOrTrash",
|
||||
"getlastmodtime" => "fileToExamine"
|
||||
}
|
||||
|
||||
def quit_cmd
|
||||
exit
|
||||
end
|
||||
|
||||
alias q_cmd quit_cmd
|
||||
|
||||
def help_cmd
|
||||
commands = ::Commands.instance_methods.grep(/_cmd$/).sort
|
||||
puts "Commands:"
|
||||
commands.each do |c|
|
||||
usage c.sub("_cmd", ""), " - "
|
||||
end
|
||||
|
||||
true
|
||||
end
|
||||
|
||||
def e val
|
||||
if val
|
||||
puts "Successful."
|
||||
else
|
||||
puts "Failure. reason: #{PhysicsFS.last_error}"
|
||||
end
|
||||
true
|
||||
end
|
||||
|
||||
def init_cmd arg
|
||||
e PhysicsFS.init(arg)
|
||||
end
|
||||
|
||||
def deinit_cmd
|
||||
e PhysicsFS.deinit
|
||||
end
|
||||
|
||||
def addarchive_cmd archive, append
|
||||
e PhysicsFS.add_to_search_path(archive, append)
|
||||
end
|
||||
|
||||
def removearchive_cmd archive
|
||||
e PhysicsFS.remove_from_search_path archive
|
||||
end
|
||||
|
||||
def enumerate_cmd path
|
||||
entries = PhysicsFS.enumerate(path)
|
||||
entries.each {|x|
|
||||
puts x
|
||||
}
|
||||
true
|
||||
end
|
||||
|
||||
alias ls_cmd enumerate_cmd
|
||||
|
||||
def getlasterror_cmd
|
||||
puts "Last error is [#{PhysicsFS.last_error}]"
|
||||
true
|
||||
end
|
||||
|
||||
def getdirsep_cmd
|
||||
puts "Directory separator is [#{PhysicsFS.dir_separator}]"
|
||||
true
|
||||
end
|
||||
|
||||
def getcdromdirs_cmd
|
||||
dirs = PhysicsFS.cdrom_dirs
|
||||
dirs.each {|x|
|
||||
puts x
|
||||
}
|
||||
puts " total [#{dirs.length}] drives."
|
||||
true
|
||||
end
|
||||
|
||||
def getsearchpath_cmd
|
||||
spath = PhysicsFS.search_path
|
||||
spath.each {|x|
|
||||
puts x
|
||||
}
|
||||
puts "total [#{spath.length}] directories."
|
||||
true
|
||||
end
|
||||
|
||||
def getbasedir_cmd
|
||||
dir = PhysicsFS.base_dir
|
||||
puts dir if dir
|
||||
true
|
||||
end
|
||||
|
||||
def getuserdir_cmd
|
||||
puts PhysicsFS.user_dir
|
||||
true
|
||||
end
|
||||
|
||||
def getwritedir_cmd
|
||||
dir = PhysicsFS.write_dir
|
||||
if dir
|
||||
puts "Write directory is [#{dir}]."
|
||||
else
|
||||
puts "No write directory defined."
|
||||
end
|
||||
true
|
||||
end
|
||||
|
||||
def setwritedir_cmd dir
|
||||
e(PhysicsFS.write_dir = dir)
|
||||
end
|
||||
|
||||
def permitsymlinks_cmd val
|
||||
if val.to_i == 1
|
||||
PhysicsFS.permit_symlinks true
|
||||
puts "Symlinks are now permitted"
|
||||
else
|
||||
PhysicsFS.permit_symlinks false
|
||||
puts "Symlinks are now forbidden"
|
||||
end
|
||||
true
|
||||
end
|
||||
|
||||
def setsaneconfig_cmd org, appname, ext, includeCdroms, archivesFirst
|
||||
includeCdroms = includeCdroms.to_i == 1
|
||||
archiveFirst = archivesFirst == 1
|
||||
e PhysicsFS.set_sane_config(org, appname, ext, includeCdroms, archivesFirst)
|
||||
end
|
||||
|
||||
def mkdir_cmd dir
|
||||
e PhysicsFS.mkdir(dir)
|
||||
end
|
||||
|
||||
def delete_cmd dir
|
||||
e PhysicsFS.delete(dir)
|
||||
end
|
||||
|
||||
def getrealdir_cmd file
|
||||
dir = PhysicsFS.real_dir file
|
||||
if dir
|
||||
puts "Found at [#{dir}]"
|
||||
else
|
||||
puts "Not found."
|
||||
end
|
||||
true
|
||||
end
|
||||
|
||||
def exists_cmd file
|
||||
if PhysicsFS.exists? file
|
||||
puts "File exists"
|
||||
else
|
||||
puts "File does not exist"
|
||||
end
|
||||
true
|
||||
end
|
||||
|
||||
def isdir_cmd file
|
||||
if PhysicsFS.is_directory? file
|
||||
puts "File is a directory"
|
||||
else
|
||||
puts "File is NOT a directory"
|
||||
end
|
||||
true
|
||||
end
|
||||
|
||||
def issymlink_cmd file
|
||||
if PhysicsFS.is_symlink? file
|
||||
puts "File is a symlink"
|
||||
else
|
||||
puts "File is NOT a symlink"
|
||||
end
|
||||
true
|
||||
end
|
||||
|
||||
def cat_cmd filename
|
||||
file = PhysicsFS.open_read filename
|
||||
if file.nil?
|
||||
puts "failed to open. reason: #{PhysicsFS.last_error}"
|
||||
return true
|
||||
end
|
||||
|
||||
puts file.cat
|
||||
true
|
||||
end
|
||||
|
||||
def filelength_cmd filename
|
||||
file = PhysicsFS.open_read filename
|
||||
if file.nil?
|
||||
puts "failed to open. reason: #{PhysicsFS.last_error}"
|
||||
return true
|
||||
end
|
||||
|
||||
puts file.length
|
||||
file.close
|
||||
true
|
||||
end
|
||||
|
||||
WRITE_STR = "Rubyfied PhysicsFS works just fine.\n\n"
|
||||
|
||||
def append_cmd filename
|
||||
file = PhysicsFS.open_append filename
|
||||
if file.nil?
|
||||
puts "failed to open. reason: #{PhysicsFS.last_error}"
|
||||
return true
|
||||
end
|
||||
|
||||
file.write WRITE_STR, 1, WRITE_STR.length
|
||||
file.close
|
||||
true
|
||||
end
|
||||
|
||||
def write_cmd filename
|
||||
file = PhysicsFS.open_write filename
|
||||
if file.nil?
|
||||
puts "failed to open. reason: #{PhysicsFS.last_error}"
|
||||
return true
|
||||
end
|
||||
|
||||
file.write_str WRITE_STR
|
||||
file.close
|
||||
true
|
||||
end
|
||||
|
||||
def getlastmodtime_cmd filename
|
||||
t = PhysicsFS.last_mod_time filename
|
||||
if t == -1
|
||||
puts "failed to determin. reason: #{PhysicsFS.last_error}"
|
||||
else
|
||||
puts "Last modified: #{Time.at(t)}"
|
||||
end
|
||||
true
|
||||
end
|
||||
end
|
||||
|
||||
include Commands
|
||||
|
||||
def run command, args
|
||||
if args
|
||||
args = parse_args args
|
||||
else
|
||||
args = []
|
||||
end
|
||||
|
||||
begin
|
||||
cmd = method "#{command}_cmd"
|
||||
if args.length == cmd.arity
|
||||
return cmd.call *args
|
||||
else
|
||||
usage command
|
||||
true
|
||||
end
|
||||
rescue NameError
|
||||
puts 'Unknown command. Enter "help" for instructions.'
|
||||
true
|
||||
end
|
||||
end
|
||||
|
||||
if __FILE__ == $0
|
||||
|
||||
PhysicsFS.init($0) or die "PhysicsFS init failed"
|
||||
|
||||
puts "PhysicsFS version: #{PhysicsFS.version}"
|
||||
puts
|
||||
|
||||
puts "Supported archives: "
|
||||
puts PhysicsFS.supported_archives
|
||||
puts
|
||||
|
||||
puts 'Enter commands. Enter "help" for instructions.'
|
||||
|
||||
loop {
|
||||
line = Readline::readline "physfs_rb> ", true
|
||||
break unless parse line
|
||||
}
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
|
@ -7,7 +7,7 @@
|
|||
* ./physfshttpd archive1.zip archive2.zip /path/to/a/real/dir etc...
|
||||
*
|
||||
* The files are appended in order to the PhysicsFS search path, and when
|
||||
* a client request comes it, it looks for the file in said search path.
|
||||
* a client request comes in, it looks for the file in said search path.
|
||||
*
|
||||
* My goal was to make this work in less than 300 lines of C, so again, it's
|
||||
* not to be used for any serious purpose. Patches to make this application
|
||||
|
@ -23,16 +23,18 @@
|
|||
* verbatim into a closed-source project, exploiting it commercially, and
|
||||
* removing any trace of my name from the source (although I hope you won't
|
||||
* do that). I welcome enhancements and corrections to this file, but I do
|
||||
* not require you to send me patches if you make changes.
|
||||
* not require you to send me patches if you make changes. This code has
|
||||
* NO WARRANTY.
|
||||
*
|
||||
* Unless otherwise stated, the rest of PhysicsFS falls under the GNU Lesser
|
||||
* General Public License: http://www.gnu.org/licenses/lgpl.txt
|
||||
* Unless otherwise stated, the rest of PhysicsFS falls under the zlib license.
|
||||
* Please see LICENSE.txt in the root of the source tree.
|
||||
*
|
||||
* This file was written by Ryan C. Gordon. (icculus@clutteredmind.org).
|
||||
* This file was written by Ryan C. Gordon. (icculus@icculus.org).
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
|
@ -53,7 +55,7 @@
|
|||
#include "physfs.h"
|
||||
|
||||
|
||||
#define DEFAULT_PORTNUM 6667
|
||||
#define DEFAULT_PORTNUM 8080
|
||||
|
||||
typedef struct
|
||||
{
|
||||
|
@ -63,45 +65,153 @@ typedef struct
|
|||
} http_args;
|
||||
|
||||
|
||||
static char *txt404 =
|
||||
"HTTP/1.0 404 Not Found\n"
|
||||
"Connection: close\n"
|
||||
"Content-type: text/html\n"
|
||||
"\n"
|
||||
"<html><head><title>404 Not Found</title></head>\n"
|
||||
"<body>Can't find that.</body></html>\n\n";
|
||||
#define txt404 \
|
||||
"HTTP/1.0 404 Not Found\n" \
|
||||
"Connection: close\n" \
|
||||
"Content-Type: text/html; charset=utf-8\n" \
|
||||
"\n" \
|
||||
"<html><head><title>404 Not Found</title></head>\n" \
|
||||
"<body>Can't find '%s'.</body></html>\n\n" \
|
||||
|
||||
#define txt200 \
|
||||
"HTTP/1.0 200 OK\n" \
|
||||
"Connection: close\n" \
|
||||
"Content-Type: %s\n" \
|
||||
"\n"
|
||||
|
||||
static const char *lastError(void)
|
||||
{
|
||||
return PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode());
|
||||
} /* lastError */
|
||||
|
||||
static int writeAll(const char *ipstr, const int sock, void *buf, const size_t len)
|
||||
{
|
||||
if (write(sock, buf, len) != len)
|
||||
{
|
||||
printf("%s: Write error to socket.\n", ipstr);
|
||||
return 0;
|
||||
} /* if */
|
||||
|
||||
return 1;
|
||||
} /* writeAll */
|
||||
|
||||
static int writeString(const char *ipstr, const int sock, const char *fmt, ...)
|
||||
{
|
||||
/* none of this is robust against large strings or HTML escaping. */
|
||||
char buffer[1024];
|
||||
int len;
|
||||
va_list ap;
|
||||
va_start(ap, fmt);
|
||||
len = vsnprintf(buffer, sizeof (buffer), fmt, ap);
|
||||
va_end(ap);
|
||||
if (len < 0)
|
||||
{
|
||||
printf("uhoh, vsnprintf() failed!\n");
|
||||
return 0;
|
||||
} /* if */
|
||||
|
||||
return writeAll(ipstr, sock, buffer, len);
|
||||
} /* writeString */
|
||||
|
||||
|
||||
static void feed_file_http(const char *ipstr, int sock, const char *fname)
|
||||
{
|
||||
PHYSFS_file *in = PHYSFS_openRead(fname);
|
||||
char buffer[1024];
|
||||
printf("%s: requested [%s].\n", ipstr, fname);
|
||||
PHYSFS_File *in = PHYSFS_openRead(fname);
|
||||
|
||||
if (in == NULL)
|
||||
{
|
||||
printf("%s: Can't open [%s]: %s.\n",
|
||||
ipstr, fname, PHYSFS_getLastError());
|
||||
write(sock, txt404, strlen(txt404)); /* !!! FIXME: Check retval */
|
||||
printf("%s: Can't open [%s]: %s.\n", ipstr, fname, lastError());
|
||||
writeString(ipstr, sock, txt404, fname);
|
||||
return;
|
||||
} /* if */
|
||||
else
|
||||
|
||||
/* !!! FIXME: mimetype */
|
||||
if (writeString(ipstr, sock, txt200, "text/plain; charset=utf-8"))
|
||||
{
|
||||
do
|
||||
{
|
||||
PHYSFS_sint64 br = PHYSFS_read(in, buffer, 1, sizeof (buffer));
|
||||
char buffer[1024];
|
||||
PHYSFS_sint64 br = PHYSFS_readBytes(in, buffer, sizeof (buffer));
|
||||
if (br == -1)
|
||||
{
|
||||
printf("%s: Read error: %s.\n", ipstr, PHYSFS_getLastError());
|
||||
printf("%s: Read error: %s.\n", ipstr, lastError());
|
||||
break;
|
||||
} /* if */
|
||||
|
||||
write(sock, buffer, (int) br); /* !!! FIXME: CHECK THIS RETVAL! */
|
||||
else if (!writeAll(ipstr, sock, buffer, (size_t) br))
|
||||
{
|
||||
break;
|
||||
} /* else if */
|
||||
} while (!PHYSFS_eof(in));
|
||||
} /* if */
|
||||
|
||||
PHYSFS_close(in);
|
||||
} /* else */
|
||||
PHYSFS_close(in);
|
||||
} /* feed_file_http */
|
||||
|
||||
|
||||
static void feed_dirlist_http(const char *ipstr, int sock,
|
||||
const char *dname, char **list)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (!writeString(ipstr, sock, txt200, "text/html; charset=utf-8"))
|
||||
return;
|
||||
|
||||
else if (!writeString(ipstr, sock,
|
||||
"<html><head><title>Directory %s</title></head>"
|
||||
"<body><p><h1>Directory %s</h1></p><p><ul>\n",
|
||||
dname, dname))
|
||||
return;
|
||||
|
||||
if (strcmp(dname, "/") == 0)
|
||||
dname = "";
|
||||
|
||||
for (i = 0; list[i]; i++)
|
||||
{
|
||||
const char *fname = list[i];
|
||||
if (!writeString(ipstr, sock,
|
||||
"<li><a href='%s/%s'>%s</a></li>\n", dname, fname, fname))
|
||||
break;
|
||||
} /* for */
|
||||
|
||||
writeString(ipstr, sock, "</ul></body></html>\n");
|
||||
} /* feed_dirlist_http */
|
||||
|
||||
static void feed_dir_http(const char *ipstr, int sock, const char *dname)
|
||||
{
|
||||
char **list = PHYSFS_enumerateFiles(dname);
|
||||
if (list == NULL)
|
||||
{
|
||||
printf("%s: Can't enumerate directory [%s]: %s.\n",
|
||||
ipstr, dname, lastError());
|
||||
writeString(ipstr, sock, txt404, dname);
|
||||
return;
|
||||
} /* if */
|
||||
|
||||
feed_dirlist_http(ipstr, sock, dname, list);
|
||||
PHYSFS_freeList(list);
|
||||
} /* feed_dir_http */
|
||||
|
||||
static void feed_http_request(const char *ipstr, int sock, const char *fname)
|
||||
{
|
||||
PHYSFS_Stat statbuf;
|
||||
|
||||
printf("%s: requested [%s].\n", ipstr, fname);
|
||||
|
||||
if (!PHYSFS_stat(fname, &statbuf))
|
||||
{
|
||||
printf("%s: Can't stat [%s]: %s.\n", ipstr, fname, lastError());
|
||||
writeString(ipstr, sock, txt404, fname);
|
||||
return;
|
||||
} /* if */
|
||||
|
||||
if (statbuf.filetype == PHYSFS_FILETYPE_DIRECTORY)
|
||||
feed_dir_http(ipstr, sock, fname);
|
||||
else
|
||||
feed_file_http(ipstr, sock, fname);
|
||||
} /* feed_http_request */
|
||||
|
||||
|
||||
static void *do_http(void *_args)
|
||||
{
|
||||
http_args *args = (http_args *) _args;
|
||||
|
@ -134,7 +244,7 @@ static void *do_http(void *_args)
|
|||
ptr = strchr(buffer + 5, ' ');
|
||||
if (ptr != NULL)
|
||||
*ptr = '\0';
|
||||
feed_file_http(ipstr, args->sock, buffer + 4);
|
||||
feed_http_request(ipstr, args->sock, buffer + 4);
|
||||
} /* if */
|
||||
} /* else */
|
||||
|
||||
|
@ -143,7 +253,7 @@ static void *do_http(void *_args)
|
|||
close(args->sock);
|
||||
free(args->addr);
|
||||
free(args);
|
||||
return(NULL);
|
||||
return NULL;
|
||||
} /* do_http */
|
||||
|
||||
|
||||
|
@ -155,14 +265,14 @@ static void serve_http_request(int sock, struct sockaddr *addr,
|
|||
{
|
||||
printf("out of memory.\n");
|
||||
return;
|
||||
} // if
|
||||
} /* if */
|
||||
args->addr = (struct sockaddr *) malloc(addrlen);
|
||||
if (args->addr == NULL)
|
||||
{
|
||||
free(args);
|
||||
printf("out of memory.\n");
|
||||
return;
|
||||
} // if
|
||||
} /* if */
|
||||
|
||||
args->sock = sock;
|
||||
args->addrlen = addrlen;
|
||||
|
@ -193,7 +303,7 @@ static int create_listen_socket(short portnum)
|
|||
addr.sin_family = AF_INET;
|
||||
addr.sin_port = htons(portnum);
|
||||
addr.sin_addr.s_addr = INADDR_ANY;
|
||||
if ((bind(retval, &addr, (socklen_t) sizeof (addr)) == -1) ||
|
||||
if ((bind(retval, (struct sockaddr *) &addr, (socklen_t) sizeof (addr)) == -1) ||
|
||||
(listen(retval, 5) == -1))
|
||||
{
|
||||
close(retval);
|
||||
|
@ -201,7 +311,7 @@ static int create_listen_socket(short portnum)
|
|||
} /* if */
|
||||
} /* if */
|
||||
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* create_listen_socket */
|
||||
|
||||
|
||||
|
@ -218,7 +328,7 @@ void at_exit_cleanup(void)
|
|||
close(listensocket);
|
||||
|
||||
if (!PHYSFS_deinit())
|
||||
printf("PHYSFS_deinit() failed: %s\n", PHYSFS_getLastError());
|
||||
printf("PHYSFS_deinit() failed: %s\n", lastError());
|
||||
} /* at_exit_cleanup */
|
||||
|
||||
|
||||
|
@ -243,13 +353,13 @@ int main(int argc, char **argv)
|
|||
if (argc == 1)
|
||||
{
|
||||
printf("USAGE: %s <archive1> [archive2 [... archiveN]]\n", argv[0]);
|
||||
return(42);
|
||||
return 42;
|
||||
} /* if */
|
||||
|
||||
if (!PHYSFS_init(argv[0]))
|
||||
{
|
||||
printf("PHYSFS_init() failed: %s\n", PHYSFS_getLastError());
|
||||
return(42);
|
||||
printf("PHYSFS_init() failed: %s\n", lastError());
|
||||
return 42;
|
||||
} /* if */
|
||||
|
||||
/* normally, this is bad practice, but oh well. */
|
||||
|
@ -257,7 +367,7 @@ int main(int argc, char **argv)
|
|||
|
||||
for (i = 1; i < argc; i++)
|
||||
{
|
||||
if (!PHYSFS_addToSearchPath(argv[i], 1))
|
||||
if (!PHYSFS_mount(argv[i], NULL, 1))
|
||||
printf(" WARNING: failed to add [%s] to search path.\n", argv[i]);
|
||||
} /* else */
|
||||
|
||||
|
@ -265,7 +375,7 @@ int main(int argc, char **argv)
|
|||
if (listensocket < 0)
|
||||
{
|
||||
printf("listen socket failed to create.\n");
|
||||
return(42);
|
||||
return 42;
|
||||
} /* if */
|
||||
|
||||
while (1) /* infinite loop for now. */
|
||||
|
@ -277,13 +387,13 @@ int main(int argc, char **argv)
|
|||
{
|
||||
printf("accept() failed: %s\n", strerror(errno));
|
||||
close(listensocket);
|
||||
return(42);
|
||||
return 42;
|
||||
} /* if */
|
||||
|
||||
serve_http_request(s, &addr, len);
|
||||
} /* while */
|
||||
|
||||
return(0);
|
||||
return 0;
|
||||
} /* main */
|
||||
|
||||
/* end of physfshttpd.c ... */
|
||||
|
|
|
@ -9,143 +9,202 @@
|
|||
* verbatim into a closed-source project, exploiting it commercially, and
|
||||
* removing any trace of my name from the source (although I hope you won't
|
||||
* do that). I welcome enhancements and corrections to this file, but I do
|
||||
* not require you to send me patches if you make changes.
|
||||
* not require you to send me patches if you make changes. This code has
|
||||
* NO WARRANTY.
|
||||
*
|
||||
* Unless otherwise stated, the rest of PhysicsFS falls under the GNU Lesser
|
||||
* General Public License: http://www.gnu.org/licenses/lgpl.txt
|
||||
* Unless otherwise stated, the rest of PhysicsFS falls under the zlib license.
|
||||
* Please see LICENSE.txt in the root of the source tree.
|
||||
*
|
||||
* SDL falls under the LGPL, too. You can get SDL at http://www.libsdl.org/
|
||||
* SDL 1.2 falls under the LGPL license. SDL 1.3+ is zlib, like PhysicsFS.
|
||||
* You can get SDL at https://www.libsdl.org/
|
||||
*
|
||||
* This file was written by Ryan C. Gordon. (icculus@clutteredmind.org).
|
||||
* This file was written by Ryan C. Gordon. (icculus@icculus.org).
|
||||
*/
|
||||
|
||||
#include <stdio.h> /* used for SEEK_SET, SEEK_CUR, SEEK_END ... */
|
||||
#include "physfsrwops.h"
|
||||
|
||||
static int physfsrwops_seek(SDL_RWops *rw, int offset, int whence)
|
||||
/* SDL's RWOPS interface changed a little in SDL 2.0... */
|
||||
#if defined(SDL_VERSION_ATLEAST)
|
||||
#if SDL_VERSION_ATLEAST(2, 0, 0)
|
||||
#define TARGET_SDL2 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if !TARGET_SDL2
|
||||
#ifndef RW_SEEK_SET
|
||||
#define RW_SEEK_SET SEEK_SET
|
||||
#endif
|
||||
#ifndef RW_SEEK_CUR
|
||||
#define RW_SEEK_CUR SEEK_CUR
|
||||
#endif
|
||||
#ifndef RW_SEEK_END
|
||||
#define RW_SEEK_END SEEK_END
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if TARGET_SDL2
|
||||
static Sint64 SDLCALL physfsrwops_size(struct SDL_RWops *rw)
|
||||
{
|
||||
PHYSFS_file *handle = (PHYSFS_file *) rw->hidden.unknown.data1;
|
||||
int pos = 0;
|
||||
PHYSFS_File *handle = (PHYSFS_File *) rw->hidden.unknown.data1;
|
||||
return (Sint64) PHYSFS_fileLength(handle);
|
||||
} /* physfsrwops_size */
|
||||
#endif
|
||||
|
||||
if (whence == SEEK_SET)
|
||||
{
|
||||
pos = offset;
|
||||
} /* if */
|
||||
|
||||
else if (whence == SEEK_CUR)
|
||||
#if TARGET_SDL2
|
||||
static Sint64 SDLCALL physfsrwops_seek(struct SDL_RWops *rw, Sint64 offset, int whence)
|
||||
#else
|
||||
static int physfsrwops_seek(SDL_RWops *rw, int offset, int whence)
|
||||
#endif
|
||||
{
|
||||
PHYSFS_File *handle = (PHYSFS_File *) rw->hidden.unknown.data1;
|
||||
PHYSFS_sint64 pos = 0;
|
||||
|
||||
if (whence == RW_SEEK_SET)
|
||||
pos = (PHYSFS_sint64) offset;
|
||||
|
||||
else if (whence == RW_SEEK_CUR)
|
||||
{
|
||||
PHYSFS_sint64 current = PHYSFS_tell(handle);
|
||||
const PHYSFS_sint64 current = PHYSFS_tell(handle);
|
||||
if (current == -1)
|
||||
{
|
||||
SDL_SetError("Can't find position in file: %s",
|
||||
PHYSFS_getLastError());
|
||||
return(-1);
|
||||
} /* if */
|
||||
|
||||
pos = (int) current;
|
||||
if ( ((PHYSFS_sint64) pos) != current )
|
||||
{
|
||||
SDL_SetError("Can't fit current file position in an int!");
|
||||
return(-1);
|
||||
PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()));
|
||||
return -1;
|
||||
} /* if */
|
||||
|
||||
if (offset == 0) /* this is a "tell" call. We're done. */
|
||||
return(pos);
|
||||
{
|
||||
#if TARGET_SDL2
|
||||
return (Sint64) current;
|
||||
#else
|
||||
return (int) current;
|
||||
#endif
|
||||
} /* if */
|
||||
|
||||
pos += offset;
|
||||
pos = current + ((PHYSFS_sint64) offset);
|
||||
} /* else if */
|
||||
|
||||
else if (whence == SEEK_END)
|
||||
else if (whence == RW_SEEK_END)
|
||||
{
|
||||
PHYSFS_sint64 len = PHYSFS_fileLength(handle);
|
||||
const PHYSFS_sint64 len = PHYSFS_fileLength(handle);
|
||||
if (len == -1)
|
||||
{
|
||||
SDL_SetError("Can't find end of file: %s", PHYSFS_getLastError());
|
||||
return(-1);
|
||||
SDL_SetError("Can't find end of file: %s", PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()));
|
||||
return -1;
|
||||
} /* if */
|
||||
|
||||
pos = (int) len;
|
||||
if ( ((PHYSFS_sint64) pos) != len )
|
||||
{
|
||||
SDL_SetError("Can't fit end-of-file position in an int!");
|
||||
return(-1);
|
||||
} /* if */
|
||||
|
||||
pos += offset;
|
||||
pos = len + ((PHYSFS_sint64) offset);
|
||||
} /* else if */
|
||||
|
||||
else
|
||||
{
|
||||
SDL_SetError("Invalid 'whence' parameter.");
|
||||
return(-1);
|
||||
return -1;
|
||||
} /* else */
|
||||
|
||||
if ( pos < 0 )
|
||||
{
|
||||
SDL_SetError("Attempt to seek past start of file.");
|
||||
return(-1);
|
||||
return -1;
|
||||
} /* if */
|
||||
|
||||
if (!PHYSFS_seek(handle, (PHYSFS_uint64) pos))
|
||||
{
|
||||
SDL_SetError("PhysicsFS error: %s", PHYSFS_getLastError());
|
||||
return(-1);
|
||||
SDL_SetError("PhysicsFS error: %s", PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()));
|
||||
return -1;
|
||||
} /* if */
|
||||
|
||||
return(pos);
|
||||
#if TARGET_SDL2
|
||||
return (Sint64) pos;
|
||||
#else
|
||||
return (int) pos;
|
||||
#endif
|
||||
} /* physfsrwops_seek */
|
||||
|
||||
|
||||
#if TARGET_SDL2
|
||||
static size_t SDLCALL physfsrwops_read(struct SDL_RWops *rw, void *ptr,
|
||||
size_t size, size_t maxnum)
|
||||
#else
|
||||
static int physfsrwops_read(SDL_RWops *rw, void *ptr, int size, int maxnum)
|
||||
#endif
|
||||
{
|
||||
PHYSFS_file *handle = (PHYSFS_file *) rw->hidden.unknown.data1;
|
||||
PHYSFS_sint64 rc = PHYSFS_read(handle, ptr, size, maxnum);
|
||||
if (rc != maxnum)
|
||||
PHYSFS_File *handle = (PHYSFS_File *) rw->hidden.unknown.data1;
|
||||
const PHYSFS_uint64 readlen = (PHYSFS_uint64) (maxnum * size);
|
||||
const PHYSFS_sint64 rc = PHYSFS_readBytes(handle, ptr, readlen);
|
||||
if (rc != ((PHYSFS_sint64) readlen))
|
||||
{
|
||||
if (!PHYSFS_eof(handle)) /* not EOF? Must be an error. */
|
||||
SDL_SetError("PhysicsFS error: %s", PHYSFS_getLastError());
|
||||
{
|
||||
SDL_SetError("PhysicsFS error: %s", PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()));
|
||||
|
||||
#if TARGET_SDL2
|
||||
return 0;
|
||||
#else
|
||||
return -1;
|
||||
#endif
|
||||
} /* if */
|
||||
} /* if */
|
||||
|
||||
return((int) rc);
|
||||
#if TARGET_SDL2
|
||||
return (size_t) rc / size;
|
||||
#else
|
||||
return (int) rc / size;
|
||||
#endif
|
||||
} /* physfsrwops_read */
|
||||
|
||||
|
||||
#if TARGET_SDL2
|
||||
static size_t SDLCALL physfsrwops_write(struct SDL_RWops *rw, const void *ptr,
|
||||
size_t size, size_t num)
|
||||
#else
|
||||
static int physfsrwops_write(SDL_RWops *rw, const void *ptr, int size, int num)
|
||||
#endif
|
||||
{
|
||||
PHYSFS_file *handle = (PHYSFS_file *) rw->hidden.unknown.data1;
|
||||
PHYSFS_sint64 rc = PHYSFS_write(handle, ptr, size, num);
|
||||
if (rc != num)
|
||||
SDL_SetError("PhysicsFS error: %s", PHYSFS_getLastError());
|
||||
PHYSFS_File *handle = (PHYSFS_File *) rw->hidden.unknown.data1;
|
||||
const PHYSFS_uint64 writelen = (PHYSFS_uint64) (num * size);
|
||||
const PHYSFS_sint64 rc = PHYSFS_writeBytes(handle, ptr, writelen);
|
||||
if (rc != ((PHYSFS_sint64) writelen))
|
||||
SDL_SetError("PhysicsFS error: %s", PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()));
|
||||
|
||||
return((int) rc);
|
||||
#if TARGET_SDL2
|
||||
return (size_t) rc;
|
||||
#else
|
||||
return (int) rc;
|
||||
#endif
|
||||
} /* physfsrwops_write */
|
||||
|
||||
|
||||
static int physfsrwops_close(SDL_RWops *rw)
|
||||
{
|
||||
PHYSFS_file *handle = (PHYSFS_file *) rw->hidden.unknown.data1;
|
||||
PHYSFS_File *handle = (PHYSFS_File *) rw->hidden.unknown.data1;
|
||||
if (!PHYSFS_close(handle))
|
||||
{
|
||||
SDL_SetError("PhysicsFS error: %s", PHYSFS_getLastError());
|
||||
return(-1);
|
||||
SDL_SetError("PhysicsFS error: %s", PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()));
|
||||
return -1;
|
||||
} /* if */
|
||||
|
||||
SDL_FreeRW(rw);
|
||||
return(0);
|
||||
return 0;
|
||||
} /* physfsrwops_close */
|
||||
|
||||
|
||||
static SDL_RWops *create_rwops(PHYSFS_file *handle)
|
||||
static SDL_RWops *create_rwops(PHYSFS_File *handle)
|
||||
{
|
||||
SDL_RWops *retval = NULL;
|
||||
|
||||
if (handle == NULL)
|
||||
SDL_SetError("PhysicsFS error: %s", PHYSFS_getLastError());
|
||||
SDL_SetError("PhysicsFS error: %s", PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()));
|
||||
else
|
||||
{
|
||||
retval = SDL_AllocRW();
|
||||
if (retval != NULL)
|
||||
{
|
||||
#if TARGET_SDL2
|
||||
retval->size = physfsrwops_size;
|
||||
#endif
|
||||
retval->seek = physfsrwops_seek;
|
||||
retval->read = physfsrwops_read;
|
||||
retval->write = physfsrwops_write;
|
||||
|
@ -154,11 +213,11 @@ static SDL_RWops *create_rwops(PHYSFS_file *handle)
|
|||
} /* if */
|
||||
} /* else */
|
||||
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* create_rwops */
|
||||
|
||||
|
||||
SDL_RWops *PHYSFSRWOPS_makeRWops(PHYSFS_file *handle)
|
||||
SDL_RWops *PHYSFSRWOPS_makeRWops(PHYSFS_File *handle)
|
||||
{
|
||||
SDL_RWops *retval = NULL;
|
||||
if (handle == NULL)
|
||||
|
@ -166,25 +225,25 @@ SDL_RWops *PHYSFSRWOPS_makeRWops(PHYSFS_file *handle)
|
|||
else
|
||||
retval = create_rwops(handle);
|
||||
|
||||
return(retval);
|
||||
return retval;
|
||||
} /* PHYSFSRWOPS_makeRWops */
|
||||
|
||||
|
||||
SDL_RWops *PHYSFSRWOPS_openRead(const char *fname)
|
||||
{
|
||||
return(create_rwops(PHYSFS_openRead(fname)));
|
||||
return create_rwops(PHYSFS_openRead(fname));
|
||||
} /* PHYSFSRWOPS_openRead */
|
||||
|
||||
|
||||
SDL_RWops *PHYSFSRWOPS_openWrite(const char *fname)
|
||||
{
|
||||
return(create_rwops(PHYSFS_openWrite(fname)));
|
||||
return create_rwops(PHYSFS_openWrite(fname));
|
||||
} /* PHYSFSRWOPS_openWrite */
|
||||
|
||||
|
||||
SDL_RWops *PHYSFSRWOPS_openAppend(const char *fname)
|
||||
{
|
||||
return(create_rwops(PHYSFS_openAppend(fname)));
|
||||
return create_rwops(PHYSFS_openAppend(fname));
|
||||
} /* PHYSFSRWOPS_openAppend */
|
||||
|
||||
|
||||
|
|
|
@ -9,14 +9,16 @@
|
|||
* verbatim into a closed-source project, exploiting it commercially, and
|
||||
* removing any trace of my name from the source (although I hope you won't
|
||||
* do that). I welcome enhancements and corrections to this file, but I do
|
||||
* not require you to send me patches if you make changes.
|
||||
* not require you to send me patches if you make changes. This code has
|
||||
* NO WARRANTY.
|
||||
*
|
||||
* Unless otherwise stated, the rest of PhysicsFS falls under the GNU Lesser
|
||||
* General Public License: http://www.gnu.org/licenses/lgpl.txt
|
||||
* Unless otherwise stated, the rest of PhysicsFS falls under the zlib license.
|
||||
* Please see LICENSE.txt in the root of the source tree.
|
||||
*
|
||||
* SDL falls under the LGPL, too. You can get SDL at http://www.libsdl.org/
|
||||
* SDL 1.2 falls under the LGPL license. SDL 1.3+ is zlib, like PhysicsFS.
|
||||
* You can get SDL at https://www.libsdl.org/
|
||||
*
|
||||
* This file was written by Ryan C. Gordon. (icculus@clutteredmind.org).
|
||||
* This file was written by Ryan C. Gordon. (icculus@icculus.org).
|
||||
*/
|
||||
|
||||
#ifndef _INCLUDE_PHYSFSRWOPS_H_
|
||||
|
@ -39,7 +41,7 @@ extern "C" {
|
|||
* @return A valid SDL_RWops structure on success, NULL on error. Specifics
|
||||
* of the error can be gleaned from PHYSFS_getLastError().
|
||||
*/
|
||||
__EXPORT__ SDL_RWops *PHYSFSRWOPS_openRead(const char *fname);
|
||||
PHYSFS_DECL SDL_RWops *PHYSFSRWOPS_openRead(const char *fname);
|
||||
|
||||
/**
|
||||
* Open a platform-independent filename for writing, and make it accessible
|
||||
|
@ -51,7 +53,7 @@ __EXPORT__ SDL_RWops *PHYSFSRWOPS_openRead(const char *fname);
|
|||
* @return A valid SDL_RWops structure on success, NULL on error. Specifics
|
||||
* of the error can be gleaned from PHYSFS_getLastError().
|
||||
*/
|
||||
__EXPORT__ SDL_RWops *PHYSFSRWOPS_openWrite(const char *fname);
|
||||
PHYSFS_DECL SDL_RWops *PHYSFSRWOPS_openWrite(const char *fname);
|
||||
|
||||
/**
|
||||
* Open a platform-independent filename for appending, and make it accessible
|
||||
|
@ -63,7 +65,7 @@ __EXPORT__ SDL_RWops *PHYSFSRWOPS_openWrite(const char *fname);
|
|||
* @return A valid SDL_RWops structure on success, NULL on error. Specifics
|
||||
* of the error can be gleaned from PHYSFS_getLastError().
|
||||
*/
|
||||
__EXPORT__ SDL_RWops *PHYSFSRWOPS_openAppend(const char *fname);
|
||||
PHYSFS_DECL SDL_RWops *PHYSFSRWOPS_openAppend(const char *fname);
|
||||
|
||||
/**
|
||||
* Make a SDL_RWops from an existing PhysicsFS file handle. You should
|
||||
|
@ -75,7 +77,7 @@ __EXPORT__ SDL_RWops *PHYSFSRWOPS_openAppend(const char *fname);
|
|||
* @return A valid SDL_RWops structure on success, NULL on error. Specifics
|
||||
* of the error can be gleaned from PHYSFS_getLastError().
|
||||
*/
|
||||
__EXPORT__ SDL_RWops *PHYSFSRWOPS_makeRWops(PHYSFS_file *handle);
|
||||
PHYSFS_DECL SDL_RWops *PHYSFSRWOPS_makeRWops(PHYSFS_File *handle);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue