Compare commits
1148 Commits
v0.2
...
es_rev9933
| Author | SHA1 | Date | |
|---|---|---|---|
| 5e79751522 | |||
| ac908e4efd | |||
| 885195dbaa | |||
| 2e49febca8 | |||
| 53f4f64596 | |||
| dff9007aa6 | |||
| c34f89df9b | |||
|
|
4a47a00747 | ||
|
|
12508c8e21 | ||
|
|
3d58ef84fa | ||
|
|
3a120f3311 | ||
|
|
d45b90e52a | ||
| c74b9e0c45 | |||
| b8aee435dd | |||
|
|
a4d737d548 | ||
|
|
16f667af2c | ||
|
|
27a5c9d969 | ||
| 32ad7f0c65 | |||
| 78f24ecb37 | |||
| 1161e541fa | |||
| d4ec640ac8 | |||
| 01a9d02586 | |||
| 1e4203111f | |||
| b84f4838f5 | |||
| 8b43cb909a | |||
| 897f64e4fe | |||
| 981942b2d6 | |||
| c132d7734b | |||
|
|
b66cfce138 | ||
| d28f794828 | |||
| 9e92b8c0fa | |||
| ef704790a8 | |||
| 57b1691243 | |||
| 29590b1c0d | |||
| ed959042d7 | |||
| 1170417e54 | |||
| 2cfe00e61b | |||
| a498a167ed | |||
| f12158e535 | |||
| 080881368a | |||
|
|
3e935c7e33 | ||
|
|
ad2bb0d1a7 | ||
| 7a546622bc | |||
| aed7461faf | |||
| 56819d6793 | |||
| b4fd04ad9f | |||
| 71a98f3c28 | |||
| ed22be2551 | |||
| 77085364ee | |||
| 0217c6d3f4 | |||
| 55fec2423c | |||
| 1f7a81a2d6 | |||
| 612ff243c1 | |||
| 40fb3893af | |||
| 21407f8dcf | |||
| 356eb143ea | |||
| df551d4a4f | |||
| f010da04e9 | |||
| 5029049ef0 | |||
| 80254b2278 | |||
| 210fae5000 | |||
| 9cc9b95190 | |||
| 8b172b5d33 | |||
| cc2d7dbb1c | |||
| c88394b9fd | |||
| 4283662f43 | |||
| 1b951376f9 | |||
| 193cc3cbde | |||
| b49e841ac7 | |||
| 8ba74e1c90 | |||
| 0cecb9594c | |||
| e384a6d6ed | |||
| 71a5c086a5 | |||
| dfa60bf8f5 | |||
| 113aa69efc | |||
| af5fc75743 | |||
|
|
e53c960a89 | ||
|
|
63be2c278c | ||
|
|
f8ba741aa2 | ||
|
|
fe07af587d | ||
|
|
a3a9dd1393 | ||
|
|
fbb860024d | ||
|
|
a14488346f | ||
|
|
f74d1b3069 | ||
|
|
1ba3528974 | ||
| 5890ca6f73 | |||
| 7f4bf09d84 | |||
|
|
ad90e7c135 | ||
| cc3c8af6b4 | |||
| b35ec65577 | |||
| 4482520a86 | |||
| e9afc9ad17 | |||
| 55ab6969ee | |||
| d982bc06ad | |||
| 2ca87d53b8 | |||
| 1a4db1d7c6 | |||
| 3bb9101b07 | |||
| 1b2496b7f0 | |||
| d20c377580 | |||
| 166d0839b7 | |||
| fbe0732210 | |||
| b5d6a75155 | |||
| 4fc4b02449 | |||
| 5276bd1479 | |||
|
|
81ab31b19a | ||
|
|
e21e30ff74 | ||
|
|
3a9ba75717 | ||
| 7d94413297 | |||
| 35855941e6 | |||
| 50ba8ca703 | |||
| dde6a0b7de | |||
| b64a281d75 | |||
| b69b8aaaf9 | |||
| 65b28ed877 | |||
| 6c7637716b | |||
| ff9a238f5c | |||
| eec3cbdba1 | |||
| 29c4931dc0 | |||
|
|
9cd0f0b117 | ||
|
|
aa0eb4fc43 | ||
|
|
dbdc594b59 | ||
|
|
4176a8c68b | ||
|
|
0557d1ee2d | ||
|
|
eed8af9a0a | ||
|
|
1b881c4f60 | ||
|
|
770488dbd3 | ||
| 3f69081d32 | |||
| 7033db7dc4 | |||
| a1a16b4a22 | |||
| 98e92ee0fe | |||
| 29b55f36cf | |||
| 061e88c9fe | |||
| 66f204b1f2 | |||
| c92b1b8c3b | |||
| 98c12b8fb9 | |||
| 5fee483fd9 | |||
| f7a7afccd6 | |||
| e2c70e6d70 | |||
| a5e150d1c0 | |||
| 39887c8bdb | |||
|
|
1f1e2abbda | ||
| 1796d9631f | |||
| 389975e409 | |||
| 6c51590369 | |||
|
|
cc65bae644 | ||
|
|
c824f707cf | ||
| 47c5b798b3 | |||
| f0cba1d536 | |||
| ed891546bc | |||
| 8651ff6e1e | |||
| 629edea991 | |||
|
|
1e10ce8518 | ||
| 4f8f17ad48 | |||
| 148518984e | |||
| 33150e34d6 | |||
| af60a5719e | |||
| 31557cfc33 | |||
| 78c0cd5b0d | |||
| 412534d0be | |||
|
|
0f6aa8d7ae | ||
|
|
2c745c63d3 | ||
|
|
efd80c1287 | ||
|
|
01f649fd88 | ||
|
|
f23aeb6412 | ||
|
|
1a4596c79b | ||
|
|
b16e4aa570 | ||
|
|
5255b15fa9 | ||
|
|
57048373f4 | ||
|
|
9e06fb2ab8 | ||
|
|
f2405e0ccd | ||
|
|
6e3a7deb6e | ||
|
|
f254b599c0 | ||
| 99a05b95ba | |||
| 54dd43c38a | |||
| 903f925a79 | |||
| 80709578d6 | |||
| c0d5b7c968 | |||
| 7bea163f46 | |||
| 8992dbc515 | |||
| c2d3ea6138 | |||
| 9e336deb49 | |||
| 0160ce05dd | |||
| 7d089a88c2 | |||
| ab0bc7b314 | |||
| 0e3e97a7fd | |||
| b790c7fd21 | |||
| d0836d49a4 | |||
| 9424b1e369 | |||
| 64463df552 | |||
|
|
61f90bba38 | ||
|
|
fac3dd3946 | ||
|
|
e1b583a2b3 | ||
|
|
8c8dfdd4a3 | ||
|
|
857397e226 | ||
|
|
94340c1c01 | ||
| 8b60ab08e3 | |||
|
|
28e51cc314 | ||
|
|
a7c8d40b3e | ||
| d4c0ff03b4 | |||
| 7fbfda3a66 | |||
| 9e467689df | |||
| dd5c89e31c | |||
| fffa763d05 | |||
| d015c065f6 | |||
| 8ea443c115 | |||
| 019393fdb1 | |||
| da8028f8b3 | |||
| 20ed000879 | |||
|
|
24620b228c | ||
|
|
9c7e29b836 | ||
|
|
a0e9a41e21 | ||
|
|
dd9aff03d3 | ||
|
|
dc35925eb0 | ||
| a1a620a9c3 | |||
| d8ea9ba63c | |||
| c42af5b2de | |||
| d9cbc72058 | |||
| 7e057b20b1 | |||
| 3165c1e5c6 | |||
| 89e26519e4 | |||
| 9d20e85c03 | |||
| 48cb99498c | |||
| 8246bc1444 | |||
| 9e1083eba8 | |||
| 4907bc3085 | |||
| 7d2ce8a77f | |||
| b4a9c92ffc | |||
| bf0eb9a02d | |||
| ddf73077b3 | |||
| 3da80fce0d | |||
| 0970de5dc6 | |||
| 557b11f4e6 | |||
| 7f27a6c797 | |||
| c778e454cd | |||
| 44757b73eb | |||
| 525978db1d | |||
| 71c90a2f39 | |||
| 8057dca032 | |||
| 91d7b956b9 | |||
| 881625a0f6 | |||
| b7a12eddaf | |||
|
|
44b1ccbc3c | ||
|
|
30261632f6 | ||
|
|
08db0748f4 | ||
|
|
9dc22bee24 | ||
|
|
c4d362ff31 | ||
|
|
4a35ff7b77 | ||
|
|
871e9792a5 | ||
| 5f4ab50bf9 | |||
| f0a49aaf0a | |||
| 1aae58e00b | |||
| f81e5251e8 | |||
| b26504b4a1 | |||
| 4eddad0bcb | |||
| 1b9aa0c598 | |||
| 6e52774507 | |||
| e5403462bc | |||
| 33b555ff27 | |||
| 4c552671c1 | |||
| 25a362d043 | |||
| 023e03bb8f | |||
| 0caad2105f | |||
| f14fdc2a69 | |||
| 440d3f9c91 | |||
| 975ef90bab | |||
| 8c63e74b81 | |||
| 6b9d248542 | |||
| 6d2318ac9b | |||
|
|
0f76518b63 | ||
|
|
bb5faec3c6 | ||
|
|
22301fc15d | ||
|
|
f482ef06d5 | ||
|
|
4f62da8f90 | ||
|
|
eaa3dd435a | ||
|
|
e1d1d52260 | ||
| 0cc0ba047f | |||
| 641e114fed | |||
| 73d45c9817 | |||
| 519b959073 | |||
| 2cc751f326 | |||
| 99588faf40 | |||
|
|
9c6b6b978a | ||
| 0647a74875 | |||
|
|
de9d99e6bc | ||
| ae9f67391c | |||
| 82f832a556 | |||
| 19dbbf89e7 | |||
|
|
5d6e3c69ee | ||
|
|
984d04e972 | ||
|
|
83486ae0cc | ||
|
|
4fe5c5da7e | ||
|
|
ec1d8ca52f | ||
|
|
0404627153 | ||
|
|
de282948e6 | ||
|
|
93f1fed997 | ||
| f6ebd414d6 | |||
| ff19adc6c8 | |||
|
|
41d24c91b4 | ||
| 0427f7a8d3 | |||
| 985a5e5ce7 | |||
| fe4c283336 | |||
|
|
20e704604a | ||
|
|
0db02a8c52 | ||
| 1b4b50ee80 | |||
| 446c692f97 | |||
| 7dfc6ea67a | |||
|
|
a5a257f452 | ||
|
|
bde0e2900b | ||
|
|
361773101e | ||
|
|
052860b62c | ||
|
|
c5e1b1ee69 | ||
| 0b1697f20d | |||
| add71543a4 | |||
| 66a1e0629c | |||
| 425c976032 | |||
|
|
397dcc6128 | ||
| a3c403323d | |||
| 942896aa0c | |||
| 93c92c0e38 | |||
| 394ca46f03 | |||
| 67641da44d | |||
|
|
a826051979 | ||
|
|
ce4c62a989 | ||
| b59966595e | |||
| fcf8b63666 | |||
| cad9322839 | |||
| 31fcd61401 | |||
|
|
0b11663da4 | ||
| 5a179f514c | |||
| f099a70b87 | |||
| 1163b99f39 | |||
| ca6ccc7291 | |||
| bb11c24681 | |||
| d158579bdc | |||
| 02f5a09689 | |||
| cb3de17be9 | |||
| fd66d79ecb | |||
| d6b77e938b | |||
| 3c8dc0a9e1 | |||
| fdfeea508e | |||
| 99d0340e1b | |||
| a74cda2f33 | |||
| 322fd80f40 | |||
| 7168941495 | |||
| 161607cf8a | |||
| d45cd032a7 | |||
|
|
9db9a4957a | ||
|
|
d089921ef5 | ||
|
|
7f3ece2da9 | ||
| 4b497060a0 | |||
| d40131f863 | |||
| 9999b5e400 | |||
| 6e27f66306 | |||
| a4c1263190 | |||
| 46920fb991 | |||
| d50b3cb28c | |||
| 6481d2ec7d | |||
| f94820c824 | |||
| 1d0a2363d8 | |||
|
|
2100b856b0 | ||
|
|
e687affd17 | ||
|
|
195f3b4f68 | ||
| cc7d268610 | |||
|
|
acc8cda04f | ||
|
|
7c5637c063 | ||
|
|
b87392906b | ||
|
|
4e7e1e9c45 | ||
| da92d2d365 | |||
| ae0ba66416 | |||
| 718cebc700 | |||
| a2cbcbbbc6 | |||
|
|
c5363c948c | ||
|
|
4f7086a6de | ||
|
|
3c4e15b386 | ||
|
|
6685b3679b | ||
|
|
d6a27c26aa | ||
|
|
e7c4b949f5 | ||
|
|
f89e0abe69 | ||
|
|
cbcf9550f8 | ||
|
|
d4b877f18e | ||
|
|
605a094910 | ||
|
|
a16a7358d1 | ||
|
|
655c95158f | ||
| 9eca723dc5 | |||
| bbc2bab0eb | |||
|
|
fe913b0072 | ||
|
|
9ec2baf7d3 | ||
| cc6d2f3023 | |||
| 2ac717592d | |||
|
|
7ca62463b7 | ||
| 95971618ca | |||
| cb881877ac | |||
|
|
2cc26f98c6 | ||
|
|
47b4357a72 | ||
|
|
a60bd19e58 | ||
|
|
439e43fad9 | ||
|
|
7abbc96347 | ||
|
|
e9b4a8abd5 | ||
| cb7c20a0b7 | |||
| f5c2f9e017 | |||
|
|
45ddc47b0e | ||
|
|
8f148f2a5e | ||
|
|
5c9edeeae8 | ||
|
|
13349d07a8 | ||
| 991389e9b9 | |||
| d8487e6c12 | |||
|
|
b7750b9d06 | ||
|
|
d82cacc18f | ||
|
|
564248284a | ||
|
|
ee473d8844 | ||
|
|
2fb0d73439 | ||
|
|
5dd8a83081 | ||
|
|
f83a8db25c | ||
|
|
a3e5da052e | ||
|
|
942db6d708 | ||
|
|
48deb869de | ||
|
|
69b67b3b4b | ||
|
|
6acdcb4e6d | ||
|
|
e832478b76 | ||
|
|
c8e9a835f5 | ||
|
|
06c5f068db | ||
|
|
b81207e42e | ||
|
|
b312d69afa | ||
|
|
d1238a441d | ||
|
|
580739d0b4 | ||
|
|
093dec1808 | ||
|
|
2fb521aa42 | ||
|
|
992504a49f | ||
|
|
8696681710 | ||
|
|
73ce700ece | ||
|
|
c766881052 | ||
|
|
8bd14f5f21 | ||
|
|
45cd633e12 | ||
|
|
0744e13132 | ||
|
|
320584a693 | ||
|
|
514a44e022 | ||
|
|
191a00649f | ||
|
|
ecfd5738ce | ||
|
|
25fe7c8725 | ||
|
|
dbcb1def29 | ||
|
|
c4acbf563f | ||
|
|
c9599f449f | ||
|
|
e675e8aad9 | ||
|
|
37aac7053a | ||
|
|
9c9a132329 | ||
|
|
ce305d4e54 | ||
|
|
d3c66cd7fe | ||
|
|
7bf95cd927 | ||
|
|
05d4f24f6f | ||
|
|
d9c837918b | ||
|
|
5adee83350 | ||
|
|
720e26d19d | ||
|
|
29356c0b61 | ||
|
|
b39dd5c40d | ||
|
|
1ae44e74e7 | ||
|
|
7a5d1e378d | ||
| c68f6a30e6 | |||
| 07ec0d001f | |||
| 4f15745647 | |||
| 20367851cc | |||
| 2978ec33b7 | |||
| 3d126b04a9 | |||
| 33fd3c8009 | |||
| ea1c8a23cd | |||
| 1827723ccc | |||
|
|
949d3514b8 | ||
|
|
7818b9dc1c | ||
|
|
d15da0ffd4 | ||
|
|
a0665313ed | ||
|
|
8a7bd30ce0 | ||
| f2da98c387 | |||
|
|
51c4e8ab9e | ||
|
|
f369b26d88 | ||
|
|
40bb88a55f | ||
|
|
72e7493842 | ||
|
|
6213021f45 | ||
|
|
eb3fb7e5f7 | ||
|
|
1ec14ec397 | ||
|
|
38f422896d | ||
|
|
3895cf4399 | ||
|
|
7e69fddac9 | ||
| e6f1a06545 | |||
| e20dd076c3 | |||
|
|
a2cc3d8b29 | ||
|
|
fa4cbd8fa8 | ||
|
|
884b6b1339 | ||
|
|
9576779cce | ||
|
|
0721384b60 | ||
|
|
0d79799a5d | ||
|
|
86339d8163 | ||
|
|
64bde6220c | ||
|
|
3406780f65 | ||
|
|
597e0e82b9 | ||
|
|
137af843af | ||
|
|
8a96ed87b1 | ||
|
|
59b0d0d9fa | ||
|
|
c9102af0aa | ||
|
|
6838089570 | ||
|
|
aba60a473a | ||
|
|
9a392ba292 | ||
|
|
85369d5247 | ||
|
|
7c11de3073 | ||
|
|
4d07a6330d | ||
|
|
dad4191c40 | ||
|
|
b70450cfe9 | ||
|
|
10b950a7e7 | ||
|
|
1b831375ef | ||
|
|
a979bf24d4 | ||
|
|
4b11bbb73d | ||
|
|
f1cefd6173 | ||
|
|
ac31e1c29e | ||
|
|
61f032a819 | ||
| 026f8ae608 | |||
| ab07c2e0ce | |||
| 637303930a | |||
|
|
78ee9872bd | ||
| 4dd1731e60 | |||
|
|
2c2770b4f1 | ||
|
|
8c04a9183f | ||
|
|
373e13208f | ||
|
|
250d41c2d7 | ||
|
|
9329ea946e | ||
| ddd19023b0 | |||
| 9b329c8b8a | |||
| 6f48cf80f2 | |||
| 464cbcae80 | |||
| 8c57856232 | |||
| 4f490aaacc | |||
| 3065637c80 | |||
| cf01756c1c | |||
| 58dc2ec792 | |||
| 88e6837222 | |||
| d376f99832 | |||
| 3072ce7dec | |||
|
|
82fdd53adb | ||
|
|
b97073b14a | ||
|
|
9a10e6f2a3 | ||
|
|
60d77892e5 | ||
|
|
9e11931b44 | ||
|
|
8fe7f4db82 | ||
|
|
26e6a62e6b | ||
|
|
d26c68cd1e | ||
|
|
01327a4b06 | ||
|
|
d3299f8e06 | ||
|
|
1100328fee | ||
|
|
cb1a4825d2 | ||
|
|
aa9f4c4ed8 | ||
|
|
c6d59d3366 | ||
|
|
8353f34c45 | ||
|
|
b6c082e1fe | ||
|
|
48251fb872 | ||
|
|
f14728c1a7 | ||
|
|
295e6e9198 | ||
|
|
e21af4a0e8 | ||
|
|
805ac5dacf | ||
|
|
93f8cd789f | ||
|
|
7b0d264aab | ||
|
|
4d0dc964da | ||
|
|
95fd5f93fc | ||
| 0f7dca0701 | |||
| 843955b7b8 | |||
| 88192335b6 | |||
| b04159fb35 | |||
| 1d0eb14918 | |||
|
|
113df6efe1 | ||
|
|
e7951338c9 | ||
|
|
83329ca4b7 | ||
|
|
f51201eae1 | ||
|
|
c52a513378 | ||
|
|
6908bfe7bf | ||
|
|
a5fa428e98 | ||
|
|
24f760c043 | ||
|
|
3f089d6811 | ||
|
|
7e673b4628 | ||
|
|
ca633d3524 | ||
|
|
7dd726ca42 | ||
|
|
3f6caa76dc | ||
|
|
5a18cb4246 | ||
|
|
b33de9985f | ||
|
|
3a9ede6e8c | ||
|
|
87569ccee9 | ||
|
|
16b79ef193 | ||
|
|
f360e8a867 | ||
|
|
57dd4ce259 | ||
|
|
252b5ff758 | ||
|
|
b19598d902 | ||
|
|
b5ef1fbbb5 | ||
|
|
bc864bde39 | ||
|
|
0a2883e040 | ||
|
|
24474e6b31 | ||
| dd31970b01 | |||
| f31ed103d0 | |||
|
|
6c0eeebf27 | ||
| 48f5cb78d5 | |||
|
|
20a768749f | ||
|
|
2d964b1137 | ||
|
|
a1245b77fd | ||
|
|
f2ee91764d | ||
| fff08a29e7 | |||
|
|
a6260ed5a2 | ||
| 2f3a462c42 | |||
|
|
37e6d74a34 | ||
| f8a0bbf88b | |||
|
|
cbd7dc8176 | ||
|
|
1da678f726 | ||
|
|
fccb6776b0 | ||
|
|
f2e85aca42 | ||
|
|
2fbffb8c9e | ||
|
|
dd8bddd45c | ||
|
|
358fe04699 | ||
|
|
647beea245 | ||
|
|
251974fd2f | ||
|
|
81952e7898 | ||
|
|
1ba9792547 | ||
|
|
45e3a6d7cc | ||
|
|
be05edac7d | ||
|
|
6761d22fa8 | ||
|
|
9db93cf4c9 | ||
|
|
15dd993b95 | ||
|
|
0f8444a585 | ||
|
|
6230d643c8 | ||
|
|
cfe452543a | ||
|
|
26ec7d94c6 | ||
|
|
95f823e7a1 | ||
|
|
09544ba6d2 | ||
|
|
15676a7c9e | ||
| b5bdf88bf4 | |||
| 74e96d7816 | |||
| 527e877b30 | |||
|
|
efc1550ab9 | ||
|
|
f53974b138 | ||
|
|
6860860161 | ||
|
|
9c65194d91 | ||
|
|
b1cf630443 | ||
|
|
b3e383ea82 | ||
|
|
36368aff0b | ||
|
|
162735b328 | ||
|
|
27023283e7 | ||
|
|
8fc405fef1 | ||
|
|
44d8903a10 | ||
|
|
113c52f6b0 | ||
|
|
e29a4c8c8a | ||
| 9499601daf | |||
|
|
0887f7d22f | ||
|
|
327ecff63a | ||
|
|
55e91bff7f | ||
|
|
8b179fd98d | ||
|
|
e5841f2dad | ||
|
|
d45405f261 | ||
|
|
133ed9a0be | ||
|
|
33220b2b8e | ||
|
|
f542975872 | ||
| ed9fac0545 | |||
|
|
4dd4678b65 | ||
|
|
bbd48d24e4 | ||
| 3b66d77ddc | |||
| fc5ef995bc | |||
| 4c5fa0ed61 | |||
| ea9161b2f2 | |||
| 3c139315e5 | |||
| 15a96a402d | |||
| 5959099c55 | |||
|
|
9f40c6355c | ||
|
|
0fcb80aa29 | ||
|
|
59a12dcac1 | ||
|
|
eb47c101ca | ||
|
|
c67a7f4982 | ||
|
|
aba394502c | ||
|
|
0c265f4f78 | ||
|
|
32518cfb41 | ||
|
|
225f821206 | ||
|
|
f506d9e925 | ||
|
|
edce18fb1f | ||
|
|
ad15ab13c5 | ||
|
|
f52f6512a0 | ||
|
|
7bdafbd21e | ||
|
|
6486c8c472 | ||
|
|
fb345c5f0c | ||
|
|
deaeaa434d | ||
|
|
f9cc0afb9e | ||
|
|
ee0400463f | ||
|
|
fa35c22d2d | ||
|
|
422b73058c | ||
|
|
c50a46206d | ||
|
|
f866c067cb | ||
|
|
811d087d74 | ||
|
|
633243311d | ||
|
|
f5d5381fae | ||
|
|
bbc3249212 | ||
|
|
625b8803df | ||
|
|
0d8090b6f4 | ||
|
|
718c0af085 | ||
|
|
5a94264dc0 | ||
|
|
8269f3ea5b | ||
|
|
d6333362a7 | ||
|
|
3e43fd52ae | ||
|
|
1111333223 | ||
|
|
ae9952a941 | ||
|
|
3b2ad80dc3 | ||
|
|
1c08439c1a | ||
|
|
16c89180d2 | ||
|
|
bc6b4f90c3 | ||
|
|
275cc7aa21 | ||
|
|
e186475a81 | ||
|
|
595d0c501a | ||
|
|
4e09a15454 | ||
|
|
b7ab840d71 | ||
|
|
b72e6871e8 | ||
|
|
f14ea29636 | ||
|
|
cb7f1f0ee3 | ||
|
|
ef34217a6d | ||
|
|
ab7ee8e4c3 | ||
|
|
1a1df35ff1 | ||
|
|
0c0fb5c9c8 | ||
|
|
c29a6ad195 | ||
|
|
6fdffb7418 | ||
|
|
8db642cf3b | ||
|
|
850a05d6bb | ||
|
|
74995101d1 | ||
|
|
fa5d13e19d | ||
|
|
9f7e72f0a4 | ||
|
|
c224bf1bb1 | ||
|
|
b5b71a3db0 | ||
|
|
cc1abfd1f9 | ||
|
|
771c91227e | ||
|
|
1276ea0d1b | ||
|
|
611ce6eb9c | ||
|
|
2870df8478 | ||
|
|
59b2163a62 | ||
|
|
065318749b | ||
|
|
600ee095cc | ||
|
|
ecb49619da | ||
|
|
b73939d0a0 | ||
|
|
6c83639149 | ||
|
|
e77ee9bdf3 | ||
|
|
9449f0d16e | ||
|
|
4ff29e1fb3 | ||
|
|
4de85df5b6 | ||
|
|
294ccb04d3 | ||
|
|
4f0567ad88 | ||
|
|
65c613d0a4 | ||
|
|
a16bca2f29 | ||
| 517720c99c | |||
|
|
86e942ae0a | ||
| 9938cc941d | |||
| 2651171294 | |||
| 07f71dfc4e | |||
| 51730e0877 | |||
| 9958bb27a1 | |||
|
|
37b94bbf0d | ||
|
|
3ae898476f | ||
|
|
eefe547553 | ||
|
|
2903a1d3cd | ||
|
|
0755e2d2bc | ||
|
|
b5957d0f59 | ||
|
|
143608fd85 | ||
|
|
b2d9fe1a4b | ||
|
|
aff7948c65 | ||
|
|
bcdfcdd468 | ||
|
|
5e62d82e9c | ||
|
|
275c26b55b | ||
|
|
123fc8252e | ||
|
|
c93e50a7e2 | ||
|
|
9c8bc59224 | ||
|
|
b074570e99 | ||
|
|
bf5bae803d | ||
|
|
35224b1b17 | ||
|
|
2ed362f5d3 | ||
|
|
fe971d07ec | ||
|
|
f82456f352 | ||
|
|
bbbf958d7d | ||
|
|
4c901c3130 | ||
|
|
eade6d584c | ||
|
|
9c8a034a04 | ||
|
|
2dac1ff6c9 | ||
|
|
e9013e548b | ||
|
|
bc976c37b1 | ||
|
|
3249c377f1 | ||
|
|
2415a57ab0 | ||
|
|
7e4f51a7ce | ||
|
|
10caa4c1df | ||
|
|
a552b8fcfa | ||
|
|
9395e31c53 | ||
|
|
ce04737d46 | ||
|
|
259815467c | ||
|
|
3b517d3c53 | ||
|
|
c261f02c84 | ||
|
|
7815557f84 | ||
|
|
090e294f10 | ||
|
|
33d523e5bf | ||
|
|
7bc09bda8f | ||
|
|
45fd51b4b5 | ||
|
|
f3849679e8 | ||
|
|
bf0a8e8efb | ||
|
|
84c3039806 | ||
|
|
0c4a410ac0 | ||
|
|
b55f363651 | ||
|
|
7dd36014cc | ||
|
|
78ff0134c7 | ||
|
|
69da6c6d06 | ||
|
|
277eb0b4b6 | ||
|
|
8dbd24afd1 | ||
|
|
0a9d208529 | ||
|
|
8ab6dba1c8 | ||
|
|
e0bfdab106 | ||
|
|
fd09b39c1d | ||
| 8e743f3253 | |||
| 8d9dca1a94 | |||
| 5753af3e43 | |||
|
|
63f1976663 | ||
|
|
4b87a00637 | ||
|
|
8d12d1c0bc | ||
|
|
2c3d5b6f59 | ||
|
|
e8c66fa769 | ||
|
|
09f32e7025 | ||
|
|
0fca8daeb1 | ||
|
|
285e295b5a | ||
|
|
e6371c7adc | ||
|
|
ab7ff11cb6 | ||
|
|
ba11e84ed6 | ||
| 2676b16425 | |||
| f7012e5b85 | |||
| a149d8de97 | |||
| eea8894724 | |||
| 5b988ab760 | |||
| 88a38509de | |||
|
|
6dee9e85b5 | ||
|
|
2d795eb3c1 | ||
|
|
717b0f7ba8 | ||
|
|
2d373cab5b | ||
|
|
e20f45b2c3 | ||
|
|
917388b99e | ||
|
|
ed1f899534 | ||
|
|
60a80209dc | ||
|
|
e4f495b282 | ||
|
|
0efcd3cd07 | ||
| c216b96707 | |||
| cb3f983b91 | |||
| dc25723a35 | |||
| 8040dd5826 | |||
|
|
42ba1588c6 | ||
| 859a13ae51 | |||
| bce084b9db | |||
| 23ed157a75 | |||
| 3723469d52 | |||
|
|
d0fda6de66 | ||
| 218e73945d | |||
| 4ab44a0c47 | |||
| 47dbe7fdbb | |||
| 2252971c3e | |||
| 28a6bb158a | |||
| f653507fc8 | |||
| 225cda0af7 | |||
| f3f5384d9b | |||
| 110a95b786 | |||
| cc4ef1a575 | |||
|
|
a982286dd4 | ||
|
|
c27f57adf1 | ||
|
|
6fbe66ff7b | ||
|
|
cef69039f5 | ||
|
|
cdf3a25f88 | ||
| fa8b3fdccc | |||
| fbbd1f1eee | |||
| 95f14c501c | |||
| f41e83c30c | |||
|
|
d1a0229944 | ||
|
|
63beaabfa0 | ||
|
|
32cf1a5720 | ||
|
|
b4ec6fdff8 | ||
| 5b6c257fae | |||
| 401bbc657a | |||
| f706e049bc | |||
| eab8df7e10 | |||
|
|
28d158571c | ||
|
|
35729b4ab6 | ||
|
|
caac696465 | ||
|
|
c741e41597 | ||
|
|
60fa076796 | ||
|
|
7dbed3ade1 | ||
|
|
a6cad7e811 | ||
|
|
47da8c17ea | ||
|
|
ad5b52f4e4 | ||
|
|
af65519067 | ||
|
|
c9b44414b1 | ||
|
|
b96a02d55d | ||
|
|
d8987f8718 | ||
| 430b34df4f | |||
| 1a518e4d27 | |||
| b09060315c | |||
| 899a32c86c | |||
| 7d5d55462f | |||
| b083f1d596 | |||
| c61afe77a0 | |||
| 654561bcbc | |||
| a065cfb2b5 | |||
| 5c51937b7e | |||
| 330d1462bf | |||
|
|
7679898159 | ||
|
|
d344df6e7e | ||
|
|
e0c3c783fa | ||
|
|
30663dc9fb | ||
|
|
8db7d0daa3 | ||
|
|
48bc71c6e3 | ||
|
|
2d3dadc85e | ||
|
|
e5765d356f | ||
|
|
f8f1773d18 | ||
|
|
15782c7795 | ||
|
|
b777e81ab1 | ||
|
|
e29346dec8 | ||
|
|
8535a8378c | ||
|
|
a75ab85356 | ||
|
|
dcdc700bac | ||
|
|
31c2be768f | ||
|
|
9180667ac4 | ||
|
|
4f79bf2add | ||
|
|
9eaada0bdb | ||
|
|
c7e6fe38fb | ||
|
|
9e8548d65a | ||
| e8d96b3521 | |||
| 06088866e0 | |||
| ad34ec1156 | |||
|
|
3c41ca0864 | ||
|
|
f52aa2ecff | ||
|
|
c344ecceec | ||
|
|
ce2ca051f6 | ||
|
|
c63e307179 | ||
|
|
1daab0598a | ||
|
|
98ad77a57d | ||
|
|
b4ab4875fc | ||
|
|
6ead464a6b | ||
|
|
3d36c353fc | ||
| a547cbaeb1 | |||
|
|
77e2a7107f | ||
|
|
3997efcd2d | ||
|
|
024e5e4b04 | ||
|
|
92ce80cd63 | ||
|
|
137afab3d3 | ||
|
|
31ba0a8828 | ||
| 47e028de2a | |||
| a65f8cbc9c | |||
| f85dc7f550 | |||
|
|
47d98a1a11 | ||
|
|
1b94f58e7a | ||
| 5fc34d947a | |||
|
|
aee512a316 | ||
|
|
57a695555a | ||
|
|
a7e1be115a | ||
|
|
5b4c498ba6 | ||
|
|
decb9d0f9b | ||
|
|
e3e6fd7f62 | ||
|
|
0ef31cead3 | ||
|
|
a8a3f3cb8b | ||
|
|
8647ae1cd3 | ||
|
|
ec2792b645 | ||
|
|
1470389600 | ||
|
|
1fcc69b268 | ||
|
|
3bc3e3b874 | ||
|
|
f5b23c2571 | ||
|
|
9b0ec8a55b | ||
|
|
a0c000b50f | ||
|
|
91624258eb | ||
|
|
ba314cb3f5 | ||
|
|
44cb0ad98c | ||
|
|
01cab452d8 | ||
|
|
20d7009383 | ||
|
|
5249275b23 | ||
|
|
4875ca9ff1 | ||
|
|
a74fcd0575 | ||
|
|
ab9c304597 | ||
|
|
178a48cd7e | ||
|
|
9f132a7b72 | ||
|
|
403b9f7bde | ||
|
|
a05e08c207 | ||
|
|
8c5400915d | ||
|
|
8ebaf2a917 | ||
|
|
0507a1d347 | ||
|
|
7c6980860c | ||
|
|
b321bee60e | ||
|
|
14088f126b | ||
|
|
c9d11b3adb | ||
|
|
c3c8c66f59 | ||
|
|
a23871ff5b | ||
|
|
2eb9abeb37 | ||
|
|
955272f505 | ||
|
|
1ee6ffa725 | ||
|
|
ad5ccd6585 | ||
|
|
da28baf872 | ||
|
|
3b87481c93 | ||
|
|
53f848758a | ||
|
|
1f7f569d82 | ||
|
|
52cc356f8e | ||
|
|
de57e814c0 | ||
|
|
273b4d13f5 | ||
|
|
c44cf5e983 | ||
|
|
d96a76bffa | ||
|
|
665772bda2 | ||
|
|
aa479af8fd | ||
|
|
9e2410c284 | ||
|
|
eca868f10f | ||
|
|
a4095b4e16 | ||
|
|
5eb1f89273 | ||
|
|
f11dbd9080 | ||
|
|
07ac6a6742 | ||
|
|
813caa15e0 | ||
|
|
de8d36d0db | ||
|
|
62d880a7c1 | ||
|
|
1f76fd5360 | ||
|
|
19df76c332 | ||
|
|
78c83a4b69 | ||
|
|
7c7bf9a3f8 | ||
|
|
ade9a30c03 | ||
|
|
91a3b8176f | ||
|
|
982efe6d14 | ||
|
|
3f237c737d | ||
|
|
115b622724 | ||
|
|
f502e6a6f7 | ||
|
|
73f675db60 | ||
|
|
b629bba5cc | ||
|
|
d34c940c91 | ||
|
|
3faa2ab815 | ||
|
|
a4ea402fb5 | ||
|
|
ffd3e30086 | ||
|
|
b614613ff4 | ||
|
|
4d7660a9e3 | ||
|
|
b8490eff28 | ||
|
|
fc954c9521 | ||
|
|
7435b4f454 | ||
|
|
10ffa2066d | ||
|
|
d56f4e6c7d | ||
|
|
dd63042ec4 | ||
|
|
4c946f5829 | ||
|
|
767328287a | ||
|
|
cda8e75f4c | ||
|
|
d01f47f1ee | ||
|
|
a6fbed22fe | ||
|
|
032f96378d | ||
|
|
1c19ff4544 | ||
|
|
2d439a2414 | ||
|
|
34629662ff | ||
|
|
acc0f4ae94 | ||
|
|
a303783204 | ||
|
|
1198d6cef4 | ||
|
|
3e3869e391 | ||
|
|
8db9e85843 | ||
|
|
2ff2dbb7c3 | ||
|
|
c8845e7354 | ||
|
|
dde70512d8 | ||
|
|
69495e69a9 | ||
|
|
45f0971594 | ||
|
|
496b831956 | ||
|
|
bb56166f95 | ||
|
|
c6d022bf18 | ||
|
|
a2b63cb9ba | ||
|
|
049f769638 | ||
|
|
aef30966de | ||
|
|
e14772fcc1 | ||
|
|
3206bcc4fd | ||
|
|
1627fd6d94 | ||
|
|
a96a143fe0 | ||
|
|
4ec2832375 | ||
|
|
ca5619c6fc | ||
|
|
86777d75ea | ||
|
|
82784529fe | ||
|
|
f6e15b6ce1 | ||
|
|
334f7a362b | ||
|
|
b278dba565 | ||
|
|
58adb7ff88 | ||
|
|
617c48adcb | ||
|
|
231b263a82 | ||
|
|
37016a7796 | ||
|
|
504baaf859 | ||
|
|
0d9e1a84f3 | ||
|
|
f280f9b0de | ||
|
|
2501bd3495 | ||
|
|
f029c746bc | ||
|
|
42bd4fa58f | ||
|
|
98f3739c7c | ||
|
|
441cf86eda | ||
|
|
c1d913e67d | ||
|
|
65d8665a64 | ||
|
|
4a92612441 | ||
|
|
7cf395a9bc | ||
|
|
7efcdb065e | ||
|
|
218b2e44a7 | ||
|
|
544401c210 | ||
|
|
f3d37024fb | ||
|
|
ce7be6ea34 | ||
|
|
5dd6079fad | ||
|
|
e7b8f398f7 | ||
|
|
9d8e8eb25a | ||
|
|
ff9be2cf8e | ||
|
|
db4f665de1 | ||
|
|
06c9364362 | ||
|
|
69a77dc2c5 | ||
|
|
d4091a57c9 | ||
|
|
2302a91b5b | ||
|
|
22a725b8be | ||
|
|
92d3f642ac | ||
|
|
598f6df366 | ||
|
|
9c0a2bd6a1 | ||
|
|
0902eef91c | ||
|
|
12404a2d5c | ||
|
|
b543a6b6f2 | ||
|
|
a417cc1e16 | ||
|
|
5d05f31d03 | ||
|
|
c9674b9e8e | ||
|
|
fd0d771d43 | ||
|
|
0d51189324 | ||
|
|
a97235c7b7 | ||
|
|
c62ad33ddc | ||
|
|
5eb8baa096 | ||
|
|
61c8388eba | ||
|
|
9be87e8e15 | ||
|
|
84df92de10 | ||
|
|
df9eb65144 | ||
|
|
bf952a9719 | ||
|
|
1560752f97 | ||
|
|
589abc71a7 | ||
|
|
61e17a9134 | ||
|
|
09c3e56f86 | ||
|
|
3dbccc024f | ||
|
|
993f1ad6b9 | ||
|
|
7028ce07f4 | ||
|
|
461cb4a4db | ||
|
|
cffc02daee | ||
|
|
451aa7773d | ||
|
|
7db054a36d | ||
|
|
dc6255d410 | ||
|
|
0eff04c847 | ||
|
|
ff57d0ecd4 | ||
|
|
2b92ba9e62 | ||
|
|
c23bf7a05d | ||
|
|
92cbf48b49 | ||
|
|
1dc6ff6df1 | ||
|
|
e72ffab2ca | ||
|
|
e7a06ebc2e | ||
|
|
e12e0b35ee | ||
|
|
c6dac0384b | ||
|
|
e48cee9b4a | ||
|
|
9229b66091 | ||
|
|
eea428831c | ||
|
|
ad12d3e16d | ||
|
|
b1fcedf501 | ||
|
|
2b00192e87 | ||
|
|
2b82e7f07f | ||
|
|
f820d25a9e | ||
|
|
6e76747772 | ||
|
|
15d12b86aa |
3
.gitignore
vendored
3
.gitignore
vendored
@@ -2,3 +2,6 @@ EIFGENs
|
||||
tests/temp/
|
||||
.svn/
|
||||
*.swp
|
||||
*~
|
||||
*.scm
|
||||
*#
|
||||
|
||||
@@ -1,38 +1,7 @@
|
||||
History for Eiffel-Web-Framework
|
||||
[2015-06-10]
|
||||
* Updated EWF design to better support concurrency, including SCOOP via
|
||||
the new standalone connector.
|
||||
|
||||
[2011-09-23] Jocelyn
|
||||
* library "ewsgi":
|
||||
- NEW simple autotest cases using Nino web server
|
||||
-fixed issue with RAW_POST_DATA being added in form_data_parameters
|
||||
instead of meta_variables ...
|
||||
- Implemented WGI_VALUE for parameter's type (query_parameter,
|
||||
form_data_parameter, item ...)
|
||||
* Nino connector: added feature to shutdown the server from the WGI application
|
||||
* NEW library "http_client": a new library to perform simple http requests
|
||||
such as get, head, post, put, ... (currently implemented with Eiffel cURL)
|
||||
* NEW library "http_authorization": added simple library to support
|
||||
HTTP_AUTHORIZATION. For now only "Basic" auth type is supported ..
|
||||
|
||||
[2011-09-22] Javier
|
||||
* NEW Example: added partial Restbuck example
|
||||
|
||||
[2011-09-21] Jocelyn
|
||||
* Nino connector: fixed an issue with missing value for Content-Type and Content-Length
|
||||
|
||||
[2011-09-13] Jocelyn
|
||||
* library "router": now using a generic design to allow customization of
|
||||
request handler context class.
|
||||
* NEW library "server/request/rest": first attempt to provide a library to
|
||||
help building RESTful application (the interfaces are likely to change
|
||||
soon) EXPERIMENTAL
|
||||
|
||||
[2011-09-09] Jocelyn
|
||||
* library "uri-template": better support for {/vars} and {?vars}
|
||||
|
||||
[2011-09-07] Jocelyn
|
||||
* library "router": now routing depends on uri (or uri template) and request methods
|
||||
* Nino connector: Fixed issue where HTTP_ prefix were missing for header meta variable.
|
||||
|
||||
[2011-09-07] Jocelyn
|
||||
* changelog: starting to write down changelogs file
|
||||
|
||||
[Previous ] Many significant changes in v0
|
||||
|
||||
142
CONTRIBUTING.md
Normal file
142
CONTRIBUTING.md
Normal file
@@ -0,0 +1,142 @@
|
||||
# Contributing to this project
|
||||
|
||||
Please take a moment to review this document in order to make the contribution
|
||||
process easy and effective for everyone involved.
|
||||
|
||||
Following these guidelines helps to communicate that you respect the time of
|
||||
the developers managing and developing this open source project. In return,
|
||||
they should reciprocate that respect in addressing your issue or assessing
|
||||
patches and features.
|
||||
|
||||
|
||||
## Using the issue tracker
|
||||
|
||||
The issue tracker is the preferred channel for [bug reports](#bugs),
|
||||
[features requests](#features) and [submitting pull
|
||||
requests](#pull-requests), but please respect the following restrictions:
|
||||
|
||||
* Please **do not** use the issue tracker for personal support requests (use
|
||||
[Stack Overflow](http://stackoverflow.com) or IRC).
|
||||
|
||||
* Please **do not** derail or troll issues. Keep the discussion on topic and
|
||||
respect the opinions of others.
|
||||
|
||||
|
||||
<a name="bugs"></a>
|
||||
## Bug reports
|
||||
|
||||
A bug is a _demonstrable problem_ that is caused by the code in the repository.
|
||||
Good bug reports are extremely helpful - thank you!
|
||||
|
||||
Guidelines for bug reports:
|
||||
|
||||
1. **Use the GitHub issue search** — check if the issue has already been
|
||||
reported.
|
||||
|
||||
2. **Check if the issue has been fixed** — try to reproduce it using the
|
||||
latest `master` or development branch in the repository.
|
||||
|
||||
3. **Isolate the problem** — ideally create a [reduced test
|
||||
case](http://css-tricks.com/6263-reduced-test-cases/) and a live example.
|
||||
|
||||
A good bug report shouldn't leave others needing to chase you up for more
|
||||
information. Please try to be as detailed as possible in your report. What is
|
||||
your environment? What steps will reproduce the issue? What browser(s) and OS
|
||||
experience the problem? What would you expect to be the outcome? All these
|
||||
details will help people to fix any potential bugs.
|
||||
|
||||
Example:
|
||||
|
||||
> Short and descriptive example bug report title
|
||||
>
|
||||
> A summary of the issue and the browser/OS environment in which it occurs. If
|
||||
> suitable, include the steps required to reproduce the bug.
|
||||
>
|
||||
> 1. This is the first step
|
||||
> 2. This is the second step
|
||||
> 3. Further steps, etc.
|
||||
>
|
||||
> `<url>` - a link to the reduced test case
|
||||
>
|
||||
> Any other information you want to share that is relevant to the issue being
|
||||
> reported. This might include the lines of code that you have identified as
|
||||
> causing the bug, and potential solutions (and your opinions on their
|
||||
> merits).
|
||||
|
||||
|
||||
<a name="features"></a>
|
||||
## Feature requests
|
||||
|
||||
Feature requests are welcome. But take a moment to find out whether your idea
|
||||
fits with the scope and aims of the project. It's up to *you* to make a strong
|
||||
case to convince the project's developers of the merits of this feature. Please
|
||||
provide as much detail and context as possible.
|
||||
|
||||
|
||||
<a name="pull-requests"></a>
|
||||
## Pull requests
|
||||
|
||||
Good pull requests - patches, improvements, new features - are a fantastic
|
||||
help. They should remain focused in scope and avoid containing unrelated
|
||||
commits.
|
||||
|
||||
**Please ask first** before embarking on any significant pull request (e.g.
|
||||
implementing features, refactoring code, porting to a different language),
|
||||
otherwise you risk spending a lot of time working on something that the
|
||||
project's developers might not want to merge into the project.
|
||||
|
||||
Please adhere to the coding conventions used throughout a project (indentation,
|
||||
accurate comments, etc.) and any other requirements (such as test coverage).
|
||||
|
||||
Adhering to the following this process is the best way to get your work
|
||||
included in the project:
|
||||
|
||||
1. [Fork](http://help.github.com/fork-a-repo/) the project, clone your fork,
|
||||
and configure the remotes:
|
||||
|
||||
```bash
|
||||
# Clone your fork of the repo into the current directory
|
||||
git clone https://github.com/<your-username>/<repo-name>
|
||||
# Navigate to the newly cloned directory
|
||||
cd <repo-name>
|
||||
# Assign the original repo to a remote called "upstream"
|
||||
git remote add upstream https://github.com/<upstream-owner>/<repo-name>
|
||||
```
|
||||
|
||||
2. If you cloned a while ago, get the latest changes from upstream:
|
||||
|
||||
```bash
|
||||
git checkout <dev-branch>
|
||||
git pull upstream <dev-branch>
|
||||
```
|
||||
|
||||
3. Create a new topic branch (off the main project development branch) to
|
||||
contain your feature, change, or fix:
|
||||
|
||||
```bash
|
||||
git checkout -b <topic-branch-name>
|
||||
```
|
||||
|
||||
4. Commit your changes in logical chunks. Please adhere to these [git commit
|
||||
message guidelines](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)
|
||||
or your code is unlikely be merged into the main project. Use Git's
|
||||
[interactive rebase](https://help.github.com/articles/interactive-rebase)
|
||||
feature to tidy up your commits before making them public.
|
||||
|
||||
5. Locally merge (or rebase) the upstream development branch into your topic branch:
|
||||
|
||||
```bash
|
||||
git pull [--rebase] upstream <dev-branch>
|
||||
```
|
||||
|
||||
6. Push your topic branch up to your fork:
|
||||
|
||||
```bash
|
||||
git push origin <topic-branch-name>
|
||||
```
|
||||
|
||||
7. [Open a Pull Request](https://help.github.com/articles/using-pull-requests/)
|
||||
with a clear title and description.
|
||||
|
||||
**IMPORTANT**: By submitting a patch, you agree to allow the project owner to
|
||||
license your work under the same license as that used by the project.
|
||||
121
MIGRATION.md
Normal file
121
MIGRATION.md
Normal file
@@ -0,0 +1,121 @@
|
||||
Date: 2015-june
|
||||
|
||||
# Goal:
|
||||
=======
|
||||
- support safe concurrency with EWF
|
||||
- provide a concurrent standalone connector
|
||||
|
||||
# Status:
|
||||
=========
|
||||
- The version v0 of EWF has mainly 3 connectors: CGI, libFCGI, and nino.
|
||||
- CGI and libFCGI connectors does not need any concurrency support.
|
||||
- But the nino connector had a pseudo concurrency support with Thread, however one could do write code that result in hasardeous concurrency execution.
|
||||
|
||||
So, it was decided to provide an improved Eiffel web nino connector, and update EWF design to make it concurrency compliant.
|
||||
|
||||
# Decisions:
|
||||
============
|
||||
- instead of updating current nino library, we now have a new "standalone" connector which is inspired by nino, but have support for the 3 concurrency modes: none, thread and SCOOP.
|
||||
|
||||
|
||||
# Overview
|
||||
==========
|
||||
Adding support for SCOOP concurrency mode add constraints to the design, but also helps ensuring the concurrency design of EWF is correct.
|
||||
|
||||
As a consequence, we had to introduce a new interface WSF_EXECUTION which is instantiated for each incoming request. See its simplified interface :
|
||||
<code lang="eiffel">
|
||||
deferred class WSF_EXECUTION
|
||||
|
||||
feature -- Initialization
|
||||
|
||||
make (req: WGI_REQUEST; res: WGI_RESPONSE)
|
||||
do
|
||||
...
|
||||
īnitialize
|
||||
end
|
||||
|
||||
initialize
|
||||
-- Initialize Current object.
|
||||
--| To be redefined if needed.
|
||||
do
|
||||
end
|
||||
|
||||
|
||||
feature -- Access
|
||||
|
||||
request: WSF_REQUEST
|
||||
-- Access to request data.
|
||||
-- Header, Query, Post, Input data..
|
||||
|
||||
response: WSF_RESPONSE
|
||||
-- Access to output stream, back to the client.
|
||||
|
||||
feature -- Execution
|
||||
|
||||
execute
|
||||
-- Execute Current `request',
|
||||
-- getting data from `request'
|
||||
-- and response to client via `response'.
|
||||
deferred
|
||||
ensure
|
||||
is_valid_end_of_execution: is_valid_end_of_execution
|
||||
end
|
||||
|
||||
end
|
||||
</code>
|
||||
|
||||
And the related request execution routines are extracted from WSF_SERVICE which becomes almost useless. The "service" part is not mostly responsible of launching the expected connector and set optional options, and declare the type of "execution" interface.
|
||||
|
||||
As a result, the well known WSF_DEFAULT_SERVICE has now a formal generic that should conform to WSF_EXECUTION with a `make' creation procedure. See update code:
|
||||
|
||||
<code lang="eiffel">
|
||||
class
|
||||
APPLICATION
|
||||
|
||||
inherit
|
||||
WSF_DEFAULT_SERVICE [APPLICATION_EXECUTION]
|
||||
redefine
|
||||
initialize
|
||||
end
|
||||
|
||||
create
|
||||
make_and_launch
|
||||
|
||||
feature {NONE} -- Initialization
|
||||
|
||||
initialize
|
||||
-- Initialize current service.
|
||||
do
|
||||
set_service_option ("port", 9090)
|
||||
end
|
||||
|
||||
end
|
||||
</code>
|
||||
|
||||
Where APPLICATION_EXECUTION is an implementation of the WSF_EXECUTION interface (with the `make' creation procedure).
|
||||
|
||||
In addition to add better and safer concurrency support, there are other advantages:
|
||||
- we now have a clear separation between the service launcher, and the request execution itself.
|
||||
- the WSF_EXECUTION is created per request, with two main attributes <code>request: WSF_REQUEST</code> and <code>response: WSF_RESPONSE</code>.
|
||||
|
||||
# How to migrate to new design
|
||||
- you can check the various example from the EWF repository, there should all be migrated to new design and comparing previous and new code, this will show you how the migration was done.
|
||||
- a frequent process:
|
||||
- identify the root class of your service, (the class implementing the WSF_SERVICE), let us name it APPLICATION_SERVICE
|
||||
- copy the APPLICATION_SERVICE file to APPLICATION_EXECUTION file.
|
||||
- change the class name to be APPLICATION_EXECUTION, and replace _SERVICE occurences by _EXECUTION (note the new WSF_ROUTED_EXECUTION and so on, which are mainly migration from previous WSF_ROUTED_SERVICE .., and also WSF_FILTERED_ROUTED_EXECUTION which is new.
|
||||
- replace "make_and_launch" by "make", remove the initialize redefinition if any.
|
||||
- in the APPLICATION_SERVICE class, remove most of the ROUTED, FILTERED ... inheritance, and keep WSF_DEFAULT_SERVICE, with a new formal generic i.e WSF_DEFAULT_SERVICE [APPLICATION_EXECUTION].
|
||||
- in the eventual redefined initialize, remove code related to routers, filters, ...
|
||||
- remove all the execution related code.
|
||||
- And you should be done.
|
||||
- To be short, this is mostly creating a new _EXECUTION class, and move the execution related code into this class from the _SERVICE class.
|
||||
- Then, you can replace the usage of nino connector by using the new "Standalone" connector, and switch to SCOOP concurrency mode, to ensure you are not messing up with concurrency. Your own code/libraris may not be SCOOP compliant, we recommend to migrate to SCOOP, but as an intermediate solutioņ, you can use the other concurrency mode (none or thread).
|
||||
|
||||
Note: the new design impacts the _SERVICE classes, connectors, but WSF_REQUEST, WSF_RESPONSE , WSF_ROUTER are compatible, so the migration is really easy.
|
||||
|
||||
We may take the opportunity to update the design deeper according to user feedback, and eventually "wsf" library will be renamed "wsf2".
|
||||
This is work in progress, all comments , feedback, suggestions, bug report are welcome.
|
||||
Hopefully before the final version of the new design is out.
|
||||
|
||||
|
||||
68
README.md
68
README.md
@@ -3,6 +3,27 @@
|
||||
|
||||
## Overview
|
||||
|
||||
The Eiffel Web Framework (EWF) provides Eiffel users with a layer to build anything on top of the http protocol such as websites, web API/services.
|
||||
|
||||
This layer is multi-platform: it can be set on Windows, Linux operating systems, and in addition it can run on top of any httpd servers such as Apache2, IIS, nginx, lighttpd. EWF includes as well a standalone httpd web server component, written in Eiffel, which enables users to run easily a web server on their machine, or even embed this component in any application written with Eiffel.
|
||||
|
||||
Currently EWF offers a collection of Eiffel libraries designed to be integrated with each others, and among other functionalities, it give simple access to the request data, to handle content negotiation, url dispatcher, integrate with openid system, and so on.
|
||||
|
||||
There is a growing ecosystem around EWF, that provides useful components:
|
||||
* OpenID and OAuth consumer library
|
||||
* Various hypermedia format such as HAL, Collection+json, …
|
||||
* Websocket server and client
|
||||
* Template engine
|
||||
* API Auto-documentation with swagger
|
||||
* A simple experimental CMS.
|
||||
* ...
|
||||
|
||||
So if you want to build a website, a web api, RESTful service, …or even if you want to consume other web api, EWF is a solution.
|
||||
|
||||
EWF brings with it all the advantages of the Eiffel technology and tools with its powerful features such as Design by Contract, debugging, testing tools which enable to build efficient systems expected to be repeatedly refined, extended, and improved in a predictable and controllable way so as to become with time bugfree systems. Enjoy the full power of debugging your web server application from the IDE.
|
||||
|
||||
## Project
|
||||
|
||||
Official project site for Eiffel Web Framework:
|
||||
|
||||
* http://eiffelwebframework.github.com/EWF/
|
||||
@@ -14,26 +35,21 @@ For more information please have a look at the related wiki:
|
||||
For download, check
|
||||
* https://github.com/EiffelWebFramework/EWF/downloads
|
||||
|
||||
Tasks and issues are managed with github issue system
|
||||
* See https://github.com/EiffelWebFramework/EWF/issues
|
||||
* And visual dashboard: https://waffle.io/eiffelwebframework/ewf
|
||||
* Forum/group post: https://groups.google.com/forum/#!forum/eiffel-web-framework
|
||||
|
||||
## Requirements
|
||||
* Compiling from EiffelStudio 7.0
|
||||
* Developped using EiffelStudio 7.1 (on Windows, Linux)
|
||||
* Tested using EiffelStudio 7.1 with "jenkins" CI server (not anymore compatible with 6.8 due to use of `TABLE_ITERABLE')
|
||||
* Compiling from EiffelStudio 13.11 to 15.05 and more recent version of the compiler.
|
||||
* Currently being developped using EiffelStudio 15.01 (on Windows, Linux)
|
||||
* Tested using EiffelStudio 15.01 with "jenkins" CI server (not anymore compatible with 6.8 due to use of `TABLE_ITERABLE')
|
||||
* The code have to allow __void-safe__ compilation and non void-safe system (see [more about void-safety](http://docs.eiffel.com/book/method/void-safe-programming-eiffel) )
|
||||
|
||||
## How to get the source code?
|
||||
|
||||
Using git version >= 1.6.5
|
||||
* git clone --recursive https://github.com/EiffelWebFramework/EWF.git
|
||||
|
||||
Otherwise, try
|
||||
Using git
|
||||
* git clone https://github.com/EiffelWebFramework/EWF.git
|
||||
* cd Eiffel-Web-Framework
|
||||
* git submodule update --init
|
||||
* git submodule foreach --recursive git checkout master
|
||||
|
||||
An alternative to the last 2 instructions is to use the script from tools folder:
|
||||
* cd tools
|
||||
* update_git_working_copy
|
||||
|
||||
* And to build the required and related Clibs
|
||||
* cd contrib/ise_library/cURL
|
||||
@@ -51,7 +67,7 @@ An alternative to the last 2 instructions is to use the script from tools folder
|
||||
### protocol
|
||||
* __http__: HTTP related classes, constants for status code, content types, ... [read more](library/protocol/http)
|
||||
* __uri_template__: URI Template library (parsing and expander) [read more](library/protocol/uri_template)
|
||||
* __CONNEG__: CONNEG library (Content-type Negociation) [read more](library/protocol/CONNEG)
|
||||
* __CONNEG__: Content negotiation library (Content-type Negociation) [read more](library/protocol/content_negotiation)
|
||||
|
||||
### client
|
||||
* __http_client__: simple HTTP client based on cURL [read more](library/client/http_client)
|
||||
@@ -59,10 +75,6 @@ An alternative to the last 2 instructions is to use the script from tools folder
|
||||
### text
|
||||
* __encoder__: Various simpler encoders: base64, url-encoder, xml entities, html entities [read more](library/text/encoder)
|
||||
|
||||
### crypto
|
||||
* eel
|
||||
* eapml
|
||||
|
||||
### Others
|
||||
* error: very simple/basic library to handle error
|
||||
|
||||
@@ -75,6 +87,24 @@ An alternative to the last 2 instructions is to use the script from tools folder
|
||||
## Examples
|
||||
..
|
||||
|
||||
## Contributing to this project
|
||||
|
||||
Anyone and everyone is welcome to contribute. Please take a moment to
|
||||
review the [guidelines for contributing](CONTRIBUTING.md).
|
||||
|
||||
* [Bug reports](CONTRIBUTING.md#bugs)
|
||||
* [Feature requests](CONTRIBUTING.md#features)
|
||||
* [Pull requests](CONTRIBUTING.md#pull-requests)
|
||||
|
||||
## Community
|
||||
|
||||
Keep track of development and community news.
|
||||
|
||||
* Follow [@EiffelWeb](https://twitter.com/EiffelWeb) on Twitter
|
||||
* [Forum](https://groups.google.com/forum/#!forum/eiffel-web-framework) on Google groups.
|
||||
* Follow our [page](https://plus.google.com/u/0/110650349519032194479) and [community](https://plus.google.com/communities/110457383244374256721) on Google+
|
||||
* Have a question that's not a feature request or bug report? [Ask on the mailing list](http://groups.google.com/group/eiffel-web-framework)
|
||||
|
||||
|
||||
For more information please have a look at the related wiki:
|
||||
* https://github.com/EiffelWebFramework/EWF/wiki
|
||||
|
||||
@@ -29,7 +29,9 @@
|
||||
|
||||
<target name="_build_tpl_" >
|
||||
<argument name="_target_name" />
|
||||
<geant target="${_target_name}" dir="ise_library" file="build.eant" reuse_variables="true" />
|
||||
<!--
|
||||
<geant target="${_target_name}" dir="library" file="build.eant" reuse_variables="true" />
|
||||
-->
|
||||
</target>
|
||||
|
||||
</project>
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<project name="build_library" default="help">
|
||||
<description>
|
||||
description: "Compile Eiffel Web Framework / Contrib / ISE library"
|
||||
</description>
|
||||
|
||||
<target name="help">
|
||||
<echo message="usage:"/>
|
||||
<echo message=" geant compile"/>
|
||||
<echo message=" geant clean"/>
|
||||
<echo message=" geant clobber"/>
|
||||
</target>
|
||||
|
||||
<target name="compile" >
|
||||
<echo message="- Compile ise_library" />
|
||||
<geant target="_build_tpl_" arguments="compile" />
|
||||
</target>
|
||||
|
||||
<target name="clean" >
|
||||
<echo message="- Clean ise_library" />
|
||||
<geant target="_build_tpl_" arguments="clean" />
|
||||
</target>
|
||||
|
||||
<target name="clobber" >
|
||||
<echo message="- Clobber ise_library" />
|
||||
<geant target="_build_tpl_" arguments="clobber" />
|
||||
</target>
|
||||
|
||||
<target name="_build_tpl_" >
|
||||
<argument name="_target_name" />
|
||||
<geant target="${_target_name}" dir="cURL" file="build.eant" reuse_variables="true" />
|
||||
</target>
|
||||
|
||||
</project>
|
||||
@@ -1,93 +0,0 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-5-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-5-0 http://www.eiffel.com/developers/xml/configuration-1-5-0.xsd" name="curl" uuid="D51EF190-6157-4B47-8E73-FA93DCBB7A71" library_target="curl">
|
||||
<target name="curl">
|
||||
<description>cURL: libcURL wrapper library for Eiffel.
|
||||
Copyright (c) 1984-2006, Eiffel Software and others.
|
||||
Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt).</description>
|
||||
<root all_classes="true"/>
|
||||
<file_rule>
|
||||
<exclude>/\.svn$</exclude>
|
||||
<exclude>/EIFGEN.{0,1}$</exclude>
|
||||
<exclude>/temp$</exclude>
|
||||
</file_rule>
|
||||
<option warning="true" full_class_checking="true" cat_call_detection="false" is_attached_by_default="true" void_safety="all" namespace="EiffelSoftware.Library">
|
||||
</option>
|
||||
<setting name="dotnet_naming_convention" value="true"/>
|
||||
<external_include location="$(ECF_CONFIG_PATH)\cURL\spec\include">
|
||||
<condition>
|
||||
<platform value="windows"/>
|
||||
</condition>
|
||||
</external_include>
|
||||
<external_include location="$(ECF_CONFIG_PATH)/cURL/spec/include">
|
||||
<condition>
|
||||
<platform excluded_value="windows"/>
|
||||
</condition>
|
||||
</external_include>
|
||||
<external_object location="$(ECF_CONFIG_PATH)/cURL/spec/$(ISE_PLATFORM)/lib/eiffel_curl.o">
|
||||
<condition>
|
||||
<platform excluded_value="windows"/>
|
||||
<multithreaded value="false"/>
|
||||
</condition>
|
||||
</external_object>
|
||||
<external_object location="$(ECF_CONFIG_PATH)/cURL/spec/$(ISE_PLATFORM)/lib/MTeiffel_curl.o">
|
||||
<condition>
|
||||
<platform excluded_value="windows"/>
|
||||
<multithreaded value="true"/>
|
||||
</condition>
|
||||
</external_object>
|
||||
<external_object location="$(ECF_CONFIG_PATH)\cURL\spec\$(ISE_C_COMPILER)\$(ISE_PLATFORM)\lib\eiffel_curl.lib">
|
||||
<condition>
|
||||
<platform value="windows"/>
|
||||
<multithreaded value="false"/>
|
||||
<dotnet value="false"/>
|
||||
</condition>
|
||||
</external_object>
|
||||
<external_object location="$(ECF_CONFIG_PATH)\cURL\spec\$(ISE_C_COMPILER)\$(ISE_PLATFORM)\lib\mteiffel_curl.lib">
|
||||
<condition>
|
||||
<platform value="windows"/>
|
||||
<multithreaded value="true"/>
|
||||
<dotnet value="false"/>
|
||||
</condition>
|
||||
</external_object>
|
||||
<external_object location="$(ECF_CONFIG_PATH)\cURL\spec\$(ISE_C_COMPILER)\$(ISE_PLATFORM)\lib\ileiffel_curl.lib">
|
||||
<condition>
|
||||
<platform value="windows"/>
|
||||
<dotnet value="true"/>
|
||||
</condition>
|
||||
</external_object>
|
||||
<library name="api_wrapper" location="$ISE_LIBRARY\library\api_wrapper\api_wrapper-safe.ecf"/>
|
||||
<library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/>
|
||||
<cluster name="curl" location=".\cURL" recursive="true">
|
||||
<file_rule>
|
||||
<exclude>/spec$</exclude>
|
||||
<exclude>/Clib$</exclude>
|
||||
</file_rule>
|
||||
<file_rule>
|
||||
<exclude>/gtk$</exclude>
|
||||
<exclude>/mac$</exclude>
|
||||
<condition>
|
||||
<platform value="windows"/>
|
||||
</condition>
|
||||
</file_rule>
|
||||
<file_rule>
|
||||
<exclude>/mswin$</exclude>
|
||||
<exclude>/gtk$</exclude>
|
||||
<condition>
|
||||
<platform value="macintosh"/>
|
||||
<custom name="vision_implementation" value="cocoa"/>
|
||||
</condition>
|
||||
</file_rule>
|
||||
<file_rule>
|
||||
<exclude>/mswin$</exclude>
|
||||
<exclude>/mac$</exclude>
|
||||
<condition>
|
||||
<platform excluded_value="windows"/>
|
||||
<custom name="vision_implementation" excluded_value="cocoa"/>
|
||||
</condition>
|
||||
</file_rule>
|
||||
</cluster>
|
||||
</target>
|
||||
<target name="curl_dotnet" extends="curl">
|
||||
<setting name="msil_generation" value="true"/>
|
||||
</target>
|
||||
</system>
|
||||
@@ -1,93 +0,0 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-5-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-5-0 http://www.eiffel.com/developers/xml/configuration-1-5-0.xsd" name="curl" uuid="D51EF190-6157-4B47-8E73-FA93DCBB7A71" library_target="curl">
|
||||
<target name="curl">
|
||||
<description>cURL: libcURL wrapper library for Eiffel.
|
||||
Copyright (c) 1984-2006, Eiffel Software and others.
|
||||
Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt).</description>
|
||||
<root all_classes="true"/>
|
||||
<file_rule>
|
||||
<exclude>/\.svn$</exclude>
|
||||
<exclude>/EIFGEN.{0,1}$</exclude>
|
||||
<exclude>/temp$</exclude>
|
||||
</file_rule>
|
||||
<option warning="true" namespace="EiffelSoftware.Library">
|
||||
</option>
|
||||
<setting name="dotnet_naming_convention" value="true"/>
|
||||
<external_include location="$(ECF_CONFIG_PATH)\cURL\spec\include">
|
||||
<condition>
|
||||
<platform value="windows"/>
|
||||
</condition>
|
||||
</external_include>
|
||||
<external_include location="$(ECF_CONFIG_PATH)/cURL/spec/include">
|
||||
<condition>
|
||||
<platform excluded_value="windows"/>
|
||||
</condition>
|
||||
</external_include>
|
||||
<external_object location="$(ECF_CONFIG_PATH)/cURL/spec/$(ISE_PLATFORM)/lib/eiffel_curl.o">
|
||||
<condition>
|
||||
<platform excluded_value="windows"/>
|
||||
<multithreaded value="false"/>
|
||||
</condition>
|
||||
</external_object>
|
||||
<external_object location="$(ECF_CONFIG_PATH)/cURL/spec/$(ISE_PLATFORM)/lib/MTeiffel_curl.o">
|
||||
<condition>
|
||||
<platform excluded_value="windows"/>
|
||||
<multithreaded value="true"/>
|
||||
</condition>
|
||||
</external_object>
|
||||
<external_object location="$(ECF_CONFIG_PATH)\cURL\spec\$(ISE_C_COMPILER)\$(ISE_PLATFORM)\lib\eiffel_curl.lib">
|
||||
<condition>
|
||||
<platform value="windows"/>
|
||||
<multithreaded value="false"/>
|
||||
<dotnet value="false"/>
|
||||
</condition>
|
||||
</external_object>
|
||||
<external_object location="$(ECF_CONFIG_PATH)\cURL\spec\$(ISE_C_COMPILER)\$(ISE_PLATFORM)\lib\mteiffel_curl.lib">
|
||||
<condition>
|
||||
<platform value="windows"/>
|
||||
<multithreaded value="true"/>
|
||||
<dotnet value="false"/>
|
||||
</condition>
|
||||
</external_object>
|
||||
<external_object location="$(ECF_CONFIG_PATH)\cURL\spec\$(ISE_C_COMPILER)\$(ISE_PLATFORM)\lib\ileiffel_curl.lib">
|
||||
<condition>
|
||||
<platform value="windows"/>
|
||||
<dotnet value="true"/>
|
||||
</condition>
|
||||
</external_object>
|
||||
<library name="api_wrapper" location="$ISE_LIBRARY\library\api_wrapper\api_wrapper.ecf"/>
|
||||
<library name="base" location="$ISE_LIBRARY\library\base\base.ecf"/>
|
||||
<cluster name="curl" location=".\cURL" recursive="true">
|
||||
<file_rule>
|
||||
<exclude>/spec$</exclude>
|
||||
<exclude>/Clib$</exclude>
|
||||
</file_rule>
|
||||
<file_rule>
|
||||
<exclude>/gtk$</exclude>
|
||||
<exclude>/mac$</exclude>
|
||||
<condition>
|
||||
<platform value="windows"/>
|
||||
</condition>
|
||||
</file_rule>
|
||||
<file_rule>
|
||||
<exclude>/mswin$</exclude>
|
||||
<exclude>/gtk$</exclude>
|
||||
<condition>
|
||||
<platform value="macintosh"/>
|
||||
<custom name="vision_implementation" value="cocoa"/>
|
||||
</condition>
|
||||
</file_rule>
|
||||
<file_rule>
|
||||
<exclude>/mswin$</exclude>
|
||||
<exclude>/mac$</exclude>
|
||||
<condition>
|
||||
<platform excluded_value="windows"/>
|
||||
<custom name="vision_implementation" excluded_value="cocoa"/>
|
||||
</condition>
|
||||
</file_rule>
|
||||
</cluster>
|
||||
</target>
|
||||
<target name="curl_dotnet" extends="curl">
|
||||
<setting name="msil_generation" value="true"/>
|
||||
</target>
|
||||
</system>
|
||||
@@ -1,58 +0,0 @@
|
||||
TOP = ..
|
||||
DIR = $dir_sep
|
||||
OUTDIR= .
|
||||
INDIR= .
|
||||
CC = $cc
|
||||
OUTPUT_CMD = $output_cmd
|
||||
CFLAGS = -I"$rt_include" -I..$(DIR)spec$(DIR)include -I. \
|
||||
-I..$(DIR)..$(DIR)..$(DIR)C_library$(DIR)libpng -I..$(DIR)..$(DIR)..$(DIR)C_library$(DIR)zlib
|
||||
JCFLAGS = $(CFLAGS) $ccflags $optimize
|
||||
JMTCFLAGS = $(CFLAGS) $mtccflags $optimize
|
||||
JILCFLAGS = $(CFLAGS) $mtccflags $optimize -DEIF_IL_DLL
|
||||
LN = copy
|
||||
MV = $mv
|
||||
RM = $del
|
||||
MAKE = $make
|
||||
MKDIR = $mkdir
|
||||
LINK = $link32
|
||||
DLL_FLAGS = $dll_flags
|
||||
DLL_LIBS = $dll_libs
|
||||
OBJECTS = eiffel_curl.$obj
|
||||
MT_OBJECTS = MTeiffel_curl.$obj
|
||||
IL_OBJECTS = ILeiffel_curl.$obj
|
||||
|
||||
.c.$obj:
|
||||
$(CC) -c $(JCFLAGS) $<
|
||||
|
||||
all:: $output_libraries
|
||||
$(MAKE) clean
|
||||
|
||||
standard:: eiffel_curl.lib ileiffel_curl.lib
|
||||
mtstandard:: mteiffel_curl.lib
|
||||
|
||||
clean:
|
||||
$(RM) *.$obj
|
||||
$(RM) *.lib
|
||||
|
||||
eiffel_curl.lib: $(OBJECTS)
|
||||
$alib_line
|
||||
$(MKDIR) ..$(DIR)spec$(DIR)$(ISE_C_COMPILER)$(DIR)$(ISE_PLATFORM)$(DIR)lib
|
||||
$(MV) $@ ..$(DIR)spec$(DIR)$(ISE_C_COMPILER)$(DIR)$(ISE_PLATFORM)$(DIR)lib$(DIR)$@
|
||||
|
||||
mteiffel_curl.lib: $(MT_OBJECTS)
|
||||
$alib_line
|
||||
$(MKDIR) ..$(DIR)spec$(DIR)$(ISE_C_COMPILER)$(DIR)$(ISE_PLATFORM)$(DIR)lib
|
||||
$(MV) $@ ..$(DIR)spec$(DIR)$(ISE_C_COMPILER)$(DIR)$(ISE_PLATFORM)$(DIR)lib$(DIR)$@
|
||||
|
||||
ileiffel_curl.lib: $(IL_OBJECTS)
|
||||
$alib_line
|
||||
$(MKDIR) ..$(DIR)spec$(DIR)$(ISE_C_COMPILER)$(DIR)$(ISE_PLATFORM)$(DIR)lib
|
||||
$(MV) $@ ..$(DIR)spec$(DIR)$(ISE_C_COMPILER)$(DIR)$(ISE_PLATFORM)$(DIR)lib$(DIR)$@
|
||||
|
||||
#Multithreaded targets.
|
||||
MTeiffel_curl.$obj: eiffel_curl.c
|
||||
$(CC) $(JMTCFLAGS) $(OUTPUT_CMD)$@ -c $?
|
||||
|
||||
#.NET targets.
|
||||
ILeiffel_curl.$obj: eiffel_curl.c
|
||||
$(CC) $(JILCFLAGS) $(OUTPUT_CMD)$@ -c $?
|
||||
@@ -1,92 +0,0 @@
|
||||
case $CONFIG in
|
||||
'')
|
||||
if test ! -f config.sh; then
|
||||
(echo "Can't find config.sh."; exit 1)
|
||||
fi 2>/dev/null
|
||||
. ./config.sh
|
||||
;;
|
||||
esac
|
||||
case "$0" in
|
||||
*/*) cd `expr X$0 : 'X\(.*\)/'` ;;
|
||||
esac
|
||||
echo "Extracting "."/Makefile (with variable substitutions)"
|
||||
$spitshell >Makefile <<!GROK!THIS!
|
||||
########################################################################
|
||||
# Makefile generated from Makefile.SH on $DATE
|
||||
|
||||
SHELL = /bin/sh
|
||||
AR = ar rc
|
||||
CC = $cc
|
||||
CTAGS = ctags
|
||||
INCLUDE = -I$rt_include -I../spec/include -I../../../C_library/libpng -I../../../C_library/zlib
|
||||
CFLAGS = $optimize $ccflags $large -g \$(INCLUDE)
|
||||
MTCFLAGS = $optimize $mtccflags $large -g \$(INCLUDE)
|
||||
SHAREDLINK = $sharedlink
|
||||
LDSHAREDFLAGS = $ldsharedflags
|
||||
LN = $ln
|
||||
MAKE = $make
|
||||
MKDEP = $mkdep \$(DPFLAGS) --
|
||||
RANLIB = $ranlib
|
||||
RM = $rm -f
|
||||
MV = $mv
|
||||
MKDIR = $mkdir -p
|
||||
PLATFORM = $ISE_PLATFORM
|
||||
|
||||
########################################################################
|
||||
# New suffixes and associated building rules -- edit with care
|
||||
|
||||
|
||||
!GROK!THIS!
|
||||
$spitshell >>Makefile <<'!NO!SUBS!'
|
||||
|
||||
MT_OBJECTS = MTeiffel_curl.o
|
||||
OBJECTS = eiffel_curl.o
|
||||
|
||||
ALL_OBJECTS = $(OBJECTS) $(MT_OBJECTS)
|
||||
|
||||
all: $(ALL_OBJECTS)
|
||||
$(MKDIR) ../spec/$(PLATFORM)/lib
|
||||
$(MV) $? ../spec/$(PLATFORM)/lib
|
||||
$(MAKE) clobber
|
||||
|
||||
MTeiffel_curl.o: eiffel_curl.c
|
||||
$(CC) -c $(MTCFLAGS) $? -o $@
|
||||
|
||||
########################################################################
|
||||
# Common rules for all Makefiles -- do not edit
|
||||
|
||||
emptyrule::
|
||||
|
||||
clean: local_clean
|
||||
realclean: local_realclean
|
||||
clobber: local_clobber
|
||||
|
||||
local_clean::
|
||||
$(RM) core *~ *.o *.so *.a
|
||||
|
||||
local_realclean:: local_clean
|
||||
|
||||
local_clobber:: local_realclean
|
||||
$(RM) Makefile config.sh
|
||||
|
||||
Makefile: Makefile.SH
|
||||
/bin/sh Makefile.SH
|
||||
|
||||
tags::
|
||||
$(CTAGS) -w *.[ch]
|
||||
$(CTAGS) -xw *.[ch] > tags
|
||||
|
||||
local_clobber::
|
||||
$(RM) tags
|
||||
|
||||
########################################################################
|
||||
# Dependencies generated by make depend
|
||||
# DO NOT DELETE THIS LINE -- make depend relies on it
|
||||
|
||||
# Put nothing here or make depend will gobble it up
|
||||
.FORCE_DEPEND::
|
||||
@echo "You must run 'make depend' in $(TOP) first."; exit 1
|
||||
!NO!SUBS!
|
||||
chmod 644 Makefile
|
||||
$eunicefix Makefile
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<project name="build_curl_clib" default="help">
|
||||
|
||||
<description>
|
||||
description: "cURL Clib library compilation"
|
||||
</description>
|
||||
|
||||
<target name="help">
|
||||
<echo message="usage:"/>
|
||||
<echo message=" geant compile"/>
|
||||
<echo message=" geant clean"/>
|
||||
<echo message=" geant clobber"/>
|
||||
</target>
|
||||
|
||||
<target name="compile" >
|
||||
<exec executable="finish_freezing -library" />
|
||||
</target>
|
||||
|
||||
<target name="clean" >
|
||||
</target>
|
||||
|
||||
<target name="clobber" depend="clean" />
|
||||
|
||||
</project>
|
||||
@@ -1,188 +0,0 @@
|
||||
/*
|
||||
indexing
|
||||
description: "Functions used by the class CURL_FUNCTION."
|
||||
copyright: "Copyright (c) 1984-2006, Eiffel Software and others"
|
||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||
source: "[
|
||||
Eiffel Software
|
||||
356 Storke Road, Goleta, CA 93117 USA
|
||||
Telephone 805-685-1006, Fax 805-685-6869
|
||||
Website http://www.eiffel.com
|
||||
Customer support http://support.eiffel.com
|
||||
]"
|
||||
*/
|
||||
|
||||
#include "eiffel_curl.h"
|
||||
|
||||
typedef EIF_INTEGER (* EIF_CURL_PROGRESS_PROC) (
|
||||
#ifndef EIF_IL_DLL
|
||||
EIF_REFERENCE, /* CURL_FUNCTION Eiffel object */
|
||||
#endif
|
||||
EIF_POINTER, /* a_user_pointer */
|
||||
EIF_REAL_64, /* a_dltotal */
|
||||
EIF_REAL_64, /* a_dlnow */
|
||||
EIF_REAL_64, /* a_ultotal */
|
||||
EIF_REAL_64 /* a_ulnow */
|
||||
);
|
||||
|
||||
typedef EIF_INTEGER (* EIF_CURL_WRITE_PROC) (
|
||||
#ifndef EIF_IL_DLL
|
||||
EIF_REFERENCE, /* CURL_FUNCTION Eiffel object */
|
||||
#endif
|
||||
EIF_POINTER, /* a_data_pointer */
|
||||
EIF_INTEGER, /* a_size */
|
||||
EIF_INTEGER, /* a_nmemb */
|
||||
EIF_POINTER /* a_write_pointer */
|
||||
);
|
||||
|
||||
typedef EIF_INTEGER (* EIF_CURL_READ_PROC) (
|
||||
#ifndef EIF_IL_DLL
|
||||
EIF_REFERENCE, /* CURL_FUNCTION Eiffel object */
|
||||
#endif
|
||||
EIF_POINTER, /* a_data_pointer */
|
||||
EIF_INTEGER, /* a_size */
|
||||
EIF_INTEGER, /* a_nmemb */
|
||||
EIF_POINTER /* a_write_pointer */
|
||||
);
|
||||
|
||||
|
||||
typedef EIF_INTEGER (* EIF_CURL_DEBUG_PROC) (
|
||||
#ifndef EIF_IL_DLL
|
||||
EIF_REFERENCE, /* CURL_FUNCTION Eiffel object */
|
||||
#endif
|
||||
EIF_POINTER, /* a_curl_handle */
|
||||
EIF_INTEGER, /* a_curl_infotype */
|
||||
EIF_POINTER, /* a_char_pointer */
|
||||
EIF_INTEGER, /* a_size */
|
||||
EIF_POINTER /* a_user_pointer */
|
||||
);
|
||||
|
||||
static EIF_OBJECT eiffel_function_object = NULL;
|
||||
/* Address of Eiffel object CURL_FUNCTION */
|
||||
|
||||
static EIF_CURL_PROGRESS_PROC eiffel_progress_function = NULL;
|
||||
/* Address of Eiffel CURL_FUNCTION.progress_function */
|
||||
|
||||
static EIF_CURL_WRITE_PROC eiffel_write_function = NULL;
|
||||
/* Address of Eiffel CURL_FUNCTION.write_function */
|
||||
|
||||
static EIF_CURL_READ_PROC eiffel_read_function = NULL;
|
||||
/* Address of Eiffel CURL_FUNCTION.read_function */
|
||||
|
||||
static EIF_CURL_DEBUG_PROC eiffel_debug_function = NULL;
|
||||
/* Address of Eiffel CURL_FUNCTION.debug_function */
|
||||
|
||||
/* Set Eiffel CURL_FUNCTION object address */
|
||||
void c_set_object(EIF_REFERENCE a_address)
|
||||
{
|
||||
if (a_address) {
|
||||
eiffel_function_object = eif_protect (a_address);
|
||||
} else {
|
||||
eiffel_function_object = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/* Release Eiffel CURL_FUNCTION object address */
|
||||
void c_release_object()
|
||||
{
|
||||
eif_wean (eiffel_function_object);
|
||||
}
|
||||
|
||||
/* Set CURL_FUNCTOIN.progress_function address */
|
||||
void c_set_progress_function_address( EIF_POINTER a_address)
|
||||
{
|
||||
eiffel_progress_function = (EIF_CURL_PROGRESS_PROC) a_address;
|
||||
}
|
||||
|
||||
/* Set CURL_FUNCTOIN.write_function address */
|
||||
void c_set_write_function_address( EIF_POINTER a_address)
|
||||
{
|
||||
eiffel_write_function = (EIF_CURL_WRITE_PROC) a_address;
|
||||
}
|
||||
|
||||
/* Set CURL_FUNCTOIN.read_function address */
|
||||
void c_set_read_function_address( EIF_POINTER a_address)
|
||||
{
|
||||
eiffel_read_function = (EIF_CURL_READ_PROC) a_address;
|
||||
}
|
||||
|
||||
/* Set CURL_FUNCTOIN.debug_function address */
|
||||
void c_set_debug_function_address (EIF_POINTER a_address)
|
||||
{
|
||||
eiffel_debug_function = (EIF_CURL_DEBUG_PROC) a_address;
|
||||
}
|
||||
|
||||
/* Eiffel adapter function for CURLOPT_WRITEFUNCTION
|
||||
We need this function since Eiffel function call need first parameter is EIF_REFERENCE. */
|
||||
size_t curl_write_function (void *ptr, size_t size, size_t nmemb, void *data)
|
||||
{
|
||||
if (eiffel_function_object) {
|
||||
return (size_t) ((eiffel_write_function) (
|
||||
#ifndef EIF_IL_DLL
|
||||
(EIF_REFERENCE) eif_access (eiffel_function_object),
|
||||
#endif
|
||||
(EIF_POINTER) ptr,
|
||||
(EIF_INTEGER) size,
|
||||
(EIF_INTEGER) nmemb,
|
||||
(EIF_POINTER) data));
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* Eiffel adapter function for CURLOPT_READFUNCTION
|
||||
We need this function since Eiffel function call need first parameter is EIF_REFERENCE. */
|
||||
size_t curl_read_function (void *ptr, size_t size, size_t nmemb, void *data)
|
||||
{
|
||||
if (eiffel_function_object) {
|
||||
return (size_t) ((eiffel_read_function) (
|
||||
#ifndef EIF_IL_DLL
|
||||
(EIF_REFERENCE) eif_access (eiffel_function_object),
|
||||
#endif
|
||||
(EIF_POINTER) ptr,
|
||||
(EIF_INTEGER) size,
|
||||
(EIF_INTEGER) nmemb,
|
||||
(EIF_POINTER) data));
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Eiffel adapter function for CURLOPT_PROGRESSFUNCTION
|
||||
We need this function since Eiffel function call need first parameter is EIF_REFERENCE. */
|
||||
size_t curl_progress_function (void * a_object_id, double a_dltotal, double a_dlnow, double a_ultotal, double a_ulnow)
|
||||
{
|
||||
if (eiffel_function_object) {
|
||||
return (size_t) ((eiffel_progress_function) (
|
||||
#ifndef EIF_IL_DLL
|
||||
(EIF_REFERENCE) eif_access (eiffel_function_object),
|
||||
#endif
|
||||
(EIF_POINTER) a_object_id,
|
||||
(EIF_REAL_64) a_dltotal,
|
||||
(EIF_REAL_64) a_dlnow,
|
||||
(EIF_REAL_64) a_ultotal,
|
||||
(EIF_REAL_64) a_ulnow));
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* Eiffel adapter function for CURLOPT_DEBUGFUNCTION
|
||||
We need this function since Eiffel function call need first parameter is EIF_REFERENCE. */
|
||||
size_t curl_debug_function (CURL * a_curl_handle, curl_infotype a_curl_infotype, unsigned char * a_char_pointer, size_t a_size, void * a_object_id)
|
||||
{
|
||||
if (eiffel_function_object) {
|
||||
return (size_t) ((eiffel_debug_function) (
|
||||
#ifndef EIF_IL_DLL
|
||||
(EIF_REFERENCE) eif_access (eiffel_function_object),
|
||||
#endif
|
||||
(EIF_POINTER) a_curl_handle,
|
||||
(EIF_INTEGER) a_curl_infotype,
|
||||
(EIF_POINTER) a_char_pointer,
|
||||
(EIF_INTEGER) a_size,
|
||||
(EIF_POINTER) a_object_id));
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<project name="build_curl" default="help">
|
||||
|
||||
<description>
|
||||
description: "cURL library compilation"
|
||||
</description>
|
||||
|
||||
<target name="help">
|
||||
<echo message="usage:"/>
|
||||
<echo message=" geant compile"/>
|
||||
<echo message=" geant clean"/>
|
||||
<echo message=" geant clobber"/>
|
||||
</target>
|
||||
|
||||
<target name="compile">
|
||||
<echo message="- Compile [cURL]" />
|
||||
<geant target="compile" file="build.eant" dir="Clib"
|
||||
reuse_variables="true" />
|
||||
</target>
|
||||
|
||||
<target name="clean">
|
||||
<echo message="- Clean [cURL]" />
|
||||
<delete directory="spec\${ISE_C_COMPILER}\${ISE_PLATFORM}" />
|
||||
</target>
|
||||
|
||||
<target name="clobber" depend="clean" />
|
||||
|
||||
</project>
|
||||
@@ -1,93 +0,0 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-5-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-5-0 http://www.eiffel.com/developers/xml/configuration-1-5-0.xsd" name="curl" uuid="D51EF190-6157-4B47-8E73-FA93DCBB7A71" library_target="curl">
|
||||
<target name="curl">
|
||||
<description>cURL: libcURL wrapper library for Eiffel.
|
||||
Copyright (c) 1984-2006, Eiffel Software and others.
|
||||
Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt).</description>
|
||||
<root all_classes="true"/>
|
||||
<file_rule>
|
||||
<exclude>/\.svn$</exclude>
|
||||
<exclude>/EIFGEN.{0,1}$</exclude>
|
||||
<exclude>/temp$</exclude>
|
||||
</file_rule>
|
||||
<option warning="true" full_class_checking="true" cat_call_detection="false" is_attached_by_default="true" void_safety="all" namespace="EiffelSoftware.Library">
|
||||
</option>
|
||||
<setting name="dotnet_naming_convention" value="true"/>
|
||||
<external_include location="$(ISE_LIBRARY)\library\cURL\spec\include">
|
||||
<condition>
|
||||
<platform value="windows"/>
|
||||
</condition>
|
||||
</external_include>
|
||||
<external_include location="$(ISE_LIBRARY)/library/cURL/spec/include">
|
||||
<condition>
|
||||
<platform excluded_value="windows"/>
|
||||
</condition>
|
||||
</external_include>
|
||||
<external_object location="$(ISE_LIBRARY)/library/cURL/spec/$(ISE_PLATFORM)/lib/eiffel_curl.o">
|
||||
<condition>
|
||||
<platform excluded_value="windows"/>
|
||||
<multithreaded value="false"/>
|
||||
</condition>
|
||||
</external_object>
|
||||
<external_object location="$(ISE_LIBRARY)/library/cURL/spec/$(ISE_PLATFORM)/lib/MTeiffel_curl.o">
|
||||
<condition>
|
||||
<platform excluded_value="windows"/>
|
||||
<multithreaded value="true"/>
|
||||
</condition>
|
||||
</external_object>
|
||||
<external_object location="$(ISE_LIBRARY)\library\cURL\spec\$(ISE_C_COMPILER)\$(ISE_PLATFORM)\lib\eiffel_curl.lib">
|
||||
<condition>
|
||||
<platform value="windows"/>
|
||||
<multithreaded value="false"/>
|
||||
<dotnet value="false"/>
|
||||
</condition>
|
||||
</external_object>
|
||||
<external_object location="$(ISE_LIBRARY)\library\cURL\spec\$(ISE_C_COMPILER)\$(ISE_PLATFORM)\lib\mteiffel_curl.lib">
|
||||
<condition>
|
||||
<platform value="windows"/>
|
||||
<multithreaded value="true"/>
|
||||
<dotnet value="false"/>
|
||||
</condition>
|
||||
</external_object>
|
||||
<external_object location="$(ISE_LIBRARY)\library\cURL\spec\$(ISE_C_COMPILER)\$(ISE_PLATFORM)\lib\ileiffel_curl.lib">
|
||||
<condition>
|
||||
<platform value="windows"/>
|
||||
<dotnet value="true"/>
|
||||
</condition>
|
||||
</external_object>
|
||||
<library name="api_wrapper" location="$ISE_LIBRARY\library\api_wrapper\api_wrapper-safe.ecf"/>
|
||||
<library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/>
|
||||
<cluster name="curl" location=".\" recursive="true">
|
||||
<file_rule>
|
||||
<exclude>/spec$</exclude>
|
||||
<exclude>/Clib$</exclude>
|
||||
</file_rule>
|
||||
<file_rule>
|
||||
<exclude>/gtk$</exclude>
|
||||
<exclude>/mac$</exclude>
|
||||
<condition>
|
||||
<platform value="windows"/>
|
||||
</condition>
|
||||
</file_rule>
|
||||
<file_rule>
|
||||
<exclude>/mswin$</exclude>
|
||||
<exclude>/gtk$</exclude>
|
||||
<condition>
|
||||
<platform value="macintosh"/>
|
||||
<custom name="vision_implementation" value="cocoa"/>
|
||||
</condition>
|
||||
</file_rule>
|
||||
<file_rule>
|
||||
<exclude>/mswin$</exclude>
|
||||
<exclude>/mac$</exclude>
|
||||
<condition>
|
||||
<platform excluded_value="windows"/>
|
||||
<custom name="vision_implementation" excluded_value="cocoa"/>
|
||||
</condition>
|
||||
</file_rule>
|
||||
</cluster>
|
||||
</target>
|
||||
<target name="curl_dotnet" extends="curl">
|
||||
<setting name="msil_generation" value="true"/>
|
||||
</target>
|
||||
</system>
|
||||
@@ -1,93 +0,0 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-5-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-5-0 http://www.eiffel.com/developers/xml/configuration-1-5-0.xsd" name="curl" uuid="D51EF190-6157-4B47-8E73-FA93DCBB7A71" library_target="curl">
|
||||
<target name="curl">
|
||||
<description>cURL: libcURL wrapper library for Eiffel.
|
||||
Copyright (c) 1984-2006, Eiffel Software and others.
|
||||
Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt).</description>
|
||||
<root all_classes="true"/>
|
||||
<file_rule>
|
||||
<exclude>/\.svn$</exclude>
|
||||
<exclude>/EIFGEN.{0,1}$</exclude>
|
||||
<exclude>/temp$</exclude>
|
||||
</file_rule>
|
||||
<option warning="true" namespace="EiffelSoftware.Library">
|
||||
</option>
|
||||
<setting name="dotnet_naming_convention" value="true"/>
|
||||
<external_include location="$(ISE_LIBRARY)\library\cURL\spec\include">
|
||||
<condition>
|
||||
<platform value="windows"/>
|
||||
</condition>
|
||||
</external_include>
|
||||
<external_include location="$(ISE_LIBRARY)/library/cURL/spec/include">
|
||||
<condition>
|
||||
<platform excluded_value="windows"/>
|
||||
</condition>
|
||||
</external_include>
|
||||
<external_object location="$(ISE_LIBRARY)/library/cURL/spec/$(ISE_PLATFORM)/lib/eiffel_curl.o">
|
||||
<condition>
|
||||
<platform excluded_value="windows"/>
|
||||
<multithreaded value="false"/>
|
||||
</condition>
|
||||
</external_object>
|
||||
<external_object location="$(ISE_LIBRARY)/library/cURL/spec/$(ISE_PLATFORM)/lib/MTeiffel_curl.o">
|
||||
<condition>
|
||||
<platform excluded_value="windows"/>
|
||||
<multithreaded value="true"/>
|
||||
</condition>
|
||||
</external_object>
|
||||
<external_object location="$(ISE_LIBRARY)\library\cURL\spec\$(ISE_C_COMPILER)\$(ISE_PLATFORM)\lib\eiffel_curl.lib">
|
||||
<condition>
|
||||
<platform value="windows"/>
|
||||
<multithreaded value="false"/>
|
||||
<dotnet value="false"/>
|
||||
</condition>
|
||||
</external_object>
|
||||
<external_object location="$(ISE_LIBRARY)\library\cURL\spec\$(ISE_C_COMPILER)\$(ISE_PLATFORM)\lib\mteiffel_curl.lib">
|
||||
<condition>
|
||||
<platform value="windows"/>
|
||||
<multithreaded value="true"/>
|
||||
<dotnet value="false"/>
|
||||
</condition>
|
||||
</external_object>
|
||||
<external_object location="$(ISE_LIBRARY)\library\cURL\spec\$(ISE_C_COMPILER)\$(ISE_PLATFORM)\lib\ileiffel_curl.lib">
|
||||
<condition>
|
||||
<platform value="windows"/>
|
||||
<dotnet value="true"/>
|
||||
</condition>
|
||||
</external_object>
|
||||
<library name="api_wrapper" location="$ISE_LIBRARY\library\api_wrapper\api_wrapper.ecf"/>
|
||||
<library name="base" location="$ISE_LIBRARY\library\base\base.ecf"/>
|
||||
<cluster name="curl" location=".\" recursive="true">
|
||||
<file_rule>
|
||||
<exclude>/spec$</exclude>
|
||||
<exclude>/Clib$</exclude>
|
||||
</file_rule>
|
||||
<file_rule>
|
||||
<exclude>/gtk$</exclude>
|
||||
<exclude>/mac$</exclude>
|
||||
<condition>
|
||||
<platform value="windows"/>
|
||||
</condition>
|
||||
</file_rule>
|
||||
<file_rule>
|
||||
<exclude>/mswin$</exclude>
|
||||
<exclude>/gtk$</exclude>
|
||||
<condition>
|
||||
<platform value="macintosh"/>
|
||||
<custom name="vision_implementation" value="cocoa"/>
|
||||
</condition>
|
||||
</file_rule>
|
||||
<file_rule>
|
||||
<exclude>/mswin$</exclude>
|
||||
<exclude>/mac$</exclude>
|
||||
<condition>
|
||||
<platform excluded_value="windows"/>
|
||||
<custom name="vision_implementation" excluded_value="cocoa"/>
|
||||
</condition>
|
||||
</file_rule>
|
||||
</cluster>
|
||||
</target>
|
||||
<target name="curl_dotnet" extends="curl">
|
||||
<setting name="msil_generation" value="true"/>
|
||||
</target>
|
||||
</system>
|
||||
@@ -1,336 +0,0 @@
|
||||
note
|
||||
description: "[
|
||||
All possible error codes from all sorts of curl functions.
|
||||
Future versions may return other values, stay prepared.
|
||||
]"
|
||||
status: "See notice at end of class."
|
||||
legal: "See notice at end of class."
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
CURL_CODES
|
||||
|
||||
feature -- Eiffel cURL: Constants
|
||||
|
||||
eiffelcurle_error_occurred: INTEGER = -1
|
||||
-- Error occurred in Eiffel cURL internals
|
||||
|
||||
feature -- Constants
|
||||
|
||||
curle_ok: INTEGER = 0
|
||||
-- Declared as CURLE_OK
|
||||
|
||||
curle_unsupported_protocol: INTEGER = 1
|
||||
-- Declared as CURLE_UNSUPPORTED_PROTOCOL
|
||||
|
||||
curle_failed_init: INTEGER = 2
|
||||
-- Declared as CURLE_FAILED_INIT
|
||||
|
||||
curle_url_malformat: INTEGER = 3
|
||||
-- Declared as CURLE_URL_MALFORMAT
|
||||
|
||||
curle_obsolete4: INTEGER = 4
|
||||
-- Declared as CURLE_OBSOLETE4
|
||||
-- NOT USED
|
||||
|
||||
curle_couldnt_resolve_proxy: INTEGER = 5
|
||||
-- Declared as CURLE_COULDNT_RESOLVE_PROXY
|
||||
|
||||
curle_couldnt_resolve_host: INTEGER = 6
|
||||
-- Declared as CURLE_COULDNT_RESOLVE_HOST
|
||||
|
||||
curle_couldnt_connect: INTEGER = 7
|
||||
-- Declared as CURLE_COULDNT_CONNECT
|
||||
|
||||
curle_ftp_weird_server_reply: INTEGER = 8
|
||||
-- Declared as CURLE_FTP_WEIRD_SERVER_REPLY
|
||||
|
||||
curle_remote_access_denied: INTEGER = 9
|
||||
-- Declared as CURLE_REMOTE_ACCESS_DENIED
|
||||
-- A service was denied by the server due to lack of access
|
||||
-- when login fails this is not returned.
|
||||
|
||||
curle_obsolete10: INTEGER = 10
|
||||
-- Declared as CURLE_OBSOLETE10 NOT USED
|
||||
|
||||
curle_ftp_weird_pass_reply: INTEGER = 11
|
||||
-- Declared as CURLE_FTP_WEIRD_PASS_REPLY
|
||||
|
||||
curle_obsolete12: INTEGER = 12
|
||||
-- Declared as CURLE_OBSOLETE12 NOT USED
|
||||
|
||||
curle_ftp_weird_pasv_reply: INTEGER = 13
|
||||
-- Declared as CURLE_FTP_WEIRD_PASV_REPLY
|
||||
|
||||
curle_ftp_weird_227_format: INTEGER = 14
|
||||
-- Declared as CURLE_FTP_WEIRD_227_FORMAT
|
||||
|
||||
curle_ftp_cant_get_host: INTEGER = 15
|
||||
-- Declared as CURLE_FTP_CANT_GET_HOST
|
||||
|
||||
curle_obsolete16: INTEGER = 16
|
||||
-- Declared as CURLE_OBSOLETE16
|
||||
-- NOT USED
|
||||
|
||||
curle_ftp_couldnt_set_type: INTEGER = 17
|
||||
-- Declared as CURLE_FTP_COULDNT_SET_TYPE
|
||||
|
||||
curle_partial_file: INTEGER = 18
|
||||
-- Declared as CURLE_PARTIAL_FILE
|
||||
|
||||
curle_ftp_couldnt_retr_file: INTEGER = 19
|
||||
-- Declared as CURLE_FTP_COULDNT_RETR_FILE
|
||||
|
||||
curle_obsolete20: INTEGER = 20
|
||||
-- Declared as CURLE_OBSOLETE20
|
||||
-- NOT USED
|
||||
|
||||
curle_quote_error: INTEGER = 21
|
||||
-- Declared as CURLE_QUOTE_ERROR
|
||||
-- quote command failure
|
||||
|
||||
curle_http_returned_error: INTEGER = 22
|
||||
-- Declared as CURLE_HTTP_RETURNED_ERROR
|
||||
|
||||
curle_write_error: INTEGER = 23
|
||||
-- Declared as CURLE_WRITE_ERROR
|
||||
|
||||
curle_obsolete24: INTEGER = 24
|
||||
-- Declared as CURLE_OBSOLETE24 NOT USED
|
||||
|
||||
curle_upload_failed: INTEGER = 25
|
||||
-- Declared as CURLE_UPLOAD_FAILED
|
||||
-- failed upload "command"
|
||||
|
||||
curle_read_error: INTEGER = 26
|
||||
-- Declared as CURLE_READ_ERROR
|
||||
-- couldn't open/read from file
|
||||
|
||||
curle_out_of_memory: INTEGER = 27
|
||||
-- Declared as CURLE_OUT_OF_MEMORY
|
||||
-- Note: CURLE_OUT_OF_MEMORY may sometimes indicate a conversion error
|
||||
-- instead of a memory allocation error if CURL_DOES_CONVERSIONS
|
||||
-- is defined
|
||||
|
||||
curle_operation_timedout: INTEGER = 28
|
||||
-- Declared as CURLE_OPERATION_TIMEDOUT
|
||||
-- the timeout time was reached
|
||||
|
||||
curle_obsolete29: INTEGER = 29
|
||||
-- Declared as CURLE_OBSOLETE29
|
||||
-- NOT USED
|
||||
|
||||
curle_ftp_port_failed: INTEGER = 30
|
||||
-- Declared as CURLE_FTP_PORT_FAILED
|
||||
-- FTP PORT operation failed
|
||||
|
||||
curle_ftp_couldnt_use_rest: INTEGER = 31
|
||||
-- Declared as CURLE_FTP_COULDNT_USE_REST
|
||||
-- the REST command failed
|
||||
|
||||
curle_obsolete32: INTEGER = 32
|
||||
-- Declared as CURLE_OBSOLETE32
|
||||
-- NOT USED
|
||||
|
||||
curle_range_error: INTEGER = 33
|
||||
-- Declared as CURLE_RANGE_ERROR
|
||||
-- RANGE "command" didn't work
|
||||
|
||||
curle_http_post_error: INTEGER = 34
|
||||
-- Declared as CURLE_HTTP_POST_ERROR
|
||||
|
||||
curle_ssl_connect_error: INTEGER = 35
|
||||
-- Declared CURLE_SSL_CONNECT_ERROR
|
||||
-- wrong when connecting with SSL
|
||||
|
||||
curle_bad_download_resume: INTEGER = 36
|
||||
-- Declared as CURLE_BAD_DOWNLOAD_RESUME
|
||||
-- couldn't resume download
|
||||
|
||||
curle_file_couldnt_read_file: INTEGER = 37
|
||||
-- Declared as CURLE_FILE_COULDNT_READ_FILE
|
||||
|
||||
curle_ldap_cannot_bind: INTEGER = 38
|
||||
-- Declared as CURLE_LDAP_CANNOT_BIND
|
||||
|
||||
curle_ldap_search_failed: INTEGER = 39
|
||||
-- Declared as CURLE_LDAP_SEARCH_FAILED
|
||||
|
||||
curle_obsolete40: INTEGER = 40
|
||||
-- Declared as CURLE_OBSOLETE40
|
||||
-- NOT USED
|
||||
|
||||
curle_function_not_found: INTEGER = 41
|
||||
-- Declared as CURLE_FUNCTION_NOT_FOUND
|
||||
|
||||
curle_aborted_by_callback: INTEGER = 42
|
||||
-- Declared as CURLE_ABORTED_BY_CALLBACK
|
||||
|
||||
curle_bad_function_argument: INTEGER = 43
|
||||
-- Declared as CURLE_BAD_FUNCTION_ARGUMENT
|
||||
|
||||
curle_obsolete44: INTEGER = 44
|
||||
-- Declared as CURLE_OBSOLETE44
|
||||
-- NOT USED
|
||||
|
||||
curle_interface_failed: INTEGER = 45
|
||||
-- Declared as CURLE_INTERFACE_FAILED
|
||||
-- CURLOPT_INTERFACE failed
|
||||
|
||||
curle_obsolete46: INTEGER = 46
|
||||
-- Declared as CURLE_OBSOLETE46
|
||||
-- NOT USED
|
||||
|
||||
curle_too_many_redirects: INTEGER = 47
|
||||
-- Declared as CURLE_TOO_MANY_REDIRECTS
|
||||
-- catch endless re-direct loops
|
||||
|
||||
curle_unknown_telnet_option: INTEGER = 48
|
||||
-- Declared as CURLE_UNKNOWN_TELNET_OPTION
|
||||
-- User specified an unknown option
|
||||
|
||||
curle_telnet_option_syntax: INTEGER = 49
|
||||
-- Declared as CURLE_TELNET_OPTION_SYNTAX
|
||||
-- Malformed telnet option
|
||||
|
||||
curle_obsolete50: INTEGER = 50
|
||||
-- Declared as CURLE_OBSOLETE50
|
||||
-- NOT USED
|
||||
|
||||
curle_ssl_peer_certificate: INTEGER = 51
|
||||
-- Declared as CURLE_SSL_PEER_CERTIFICATE
|
||||
-- peer's certificate wasn't ok
|
||||
|
||||
curle_got_nothing: INTEGER = 52
|
||||
-- Declared as CURLE_GOT_NOTHING
|
||||
-- when this is a specific error
|
||||
|
||||
curle_ssl_engine_notfound: INTEGER = 53
|
||||
-- Declared as CURLE_SSL_ENGINE_NOTFOUND
|
||||
-- SSL crypto engine not found */
|
||||
|
||||
curle_ssl_engine_setfailed: INTEGER = 54
|
||||
-- Declared as CURLE_SSL_ENGINE_SETFAILED
|
||||
-- can not set SSL crypto engine as default
|
||||
|
||||
curle_send_error: INTEGER = 55
|
||||
-- Declared as CURLE_SEND_ERROR
|
||||
-- failed sending network data
|
||||
|
||||
curle_recv_error: INTEGER = 56
|
||||
-- Declared as CURLE_RECV_ERROR
|
||||
-- failure in receiving network data
|
||||
|
||||
curle_obsolete57: INTEGER = 57
|
||||
-- Declared as CURLE_OBSOLETE57
|
||||
-- NOT IN USE
|
||||
|
||||
curle_ssl_certproblem: INTEGER = 58
|
||||
-- Declared as CURLE_SSL_CERTPROBLEM
|
||||
-- problem with the local certificate
|
||||
|
||||
curle_ssl_cipher: INTEGER = 59
|
||||
-- Declared as CURLE_SSL_CIPHER
|
||||
-- couldn't use specified cipher
|
||||
|
||||
curle_ssl_cacert: INTEGER = 60
|
||||
-- Declared as CURLE_SSL_CACERT
|
||||
-- problem with the CA cert (path?)
|
||||
|
||||
curle_bad_content_encoding: INTEGER = 61
|
||||
-- Declared as CURLE_BAD_CONTENT_ENCODING
|
||||
-- Unrecognized transfer encoding
|
||||
|
||||
curle_ldap_invalid_url: INTEGER = 62
|
||||
-- Declared as CURLE_LDAP_INVALID_URL
|
||||
-- Invalid LDAP URL
|
||||
|
||||
curle_filesize_exceeded: INTEGER = 63
|
||||
-- Declared as CURLE_FILESIZE_EXCEEDED
|
||||
-- Maximum file size exceeded
|
||||
|
||||
curle_use_ssl_failed: INTEGER = 64
|
||||
-- Declared as CURLE_USE_SSL_FAILED
|
||||
-- Requested FTP SSL level failed
|
||||
|
||||
curle_send_fail_rewind: INTEGER = 65
|
||||
-- Declared as CURLE_SEND_FAIL_REWIND
|
||||
-- Sending the data requires a rewind that failed
|
||||
|
||||
curle_ssl_engine_initfailed: INTEGER = 66
|
||||
-- Declared as CURLE_SSL_ENGINE_INITFAILED
|
||||
-- failed to initialise ENGINE
|
||||
|
||||
curle_login_denied: INTEGER = 67
|
||||
-- Declared as CURLE_LOGIN_DENIED
|
||||
-- user, password or similar was not accepted and we failed to login
|
||||
|
||||
curle_tftp_notfound: INTEGER = 68
|
||||
-- Declared as CURLE_TFTP_NOTFOUND
|
||||
-- file not found on server
|
||||
|
||||
curle_tftp_perm: INTEGER = 69
|
||||
-- Declared as CURLE_TFTP_PERM
|
||||
-- permission problem on server
|
||||
|
||||
curle_remote_disk_full: INTEGER = 70
|
||||
-- Declared as CURLE_REMOTE_DISK_FULL
|
||||
-- out of disk space on server
|
||||
|
||||
curle_tftp_illegal: INTEGER = 71
|
||||
-- Declared as CURLE_TFTP_ILLEGAL
|
||||
-- Illegal TFTP operation
|
||||
|
||||
curle_tftp_unknownid: INTEGER = 72
|
||||
-- Declared as CURLE_TFTP_UNKNOWNID
|
||||
-- Unknown transfer ID
|
||||
|
||||
curle_remote_file_exists: INTEGER = 73
|
||||
-- Declared as CURLE_REMOTE_FILE_EXISTS
|
||||
-- File already exists
|
||||
|
||||
curle_tftp_nosuchuser: INTEGER = 74
|
||||
-- Declared as CURLE_TFTP_NOSUCHUSER
|
||||
-- No such user
|
||||
|
||||
curle_conv_failed: INTEGER = 75
|
||||
-- Declared as CURLE_CONV_FAILED
|
||||
-- conversion failed
|
||||
|
||||
curle_conv_reqd: INTEGER = 76
|
||||
-- Declared as CURLE_CONV_REQD
|
||||
-- caller must register conversion callbacks using curl_easy_setopt options
|
||||
-- CURLOPT_CONV_FROM_NETWORK_FUNCTION, CURLOPT_CONV_TO_NETWORK_FUNCTION, and
|
||||
-- CURLOPT_CONV_FROM_UTF8_FUNCTION
|
||||
|
||||
curle_ssl_cacert_badfile: INTEGER = 77
|
||||
-- Declared as CURLE_SSL_CACERT_BADFILE
|
||||
-- could not load CACERT file, missing or wrong format
|
||||
|
||||
curle_remote_file_not_found: INTEGER = 78
|
||||
-- Declared as CURLE_REMOTE_FILE_NOT_FOUND
|
||||
-- remote file not found
|
||||
|
||||
curle_ssh: INTEGER = 79
|
||||
-- Declared as CURLE_SSH
|
||||
-- error from the SSH layer, somewhat generic so the error message will be of
|
||||
-- interest when this has happened
|
||||
|
||||
curle_ssl_shutdown_failed: INTEGER = 80;
|
||||
-- Declared as CURLE_SSL_SHUTDOWN_FAILED
|
||||
-- Failed to shut down the SSL connection
|
||||
|
||||
note
|
||||
library: "cURL: Library of reusable components for Eiffel."
|
||||
copyright: "Copyright (c) 1984-2006, Eiffel Software and others"
|
||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||
source: "[
|
||||
Eiffel Software
|
||||
356 Storke Road, Goleta, CA 93117 USA
|
||||
Telephone 805-685-1006, Fax 805-685-6869
|
||||
Website http://www.eiffel.com
|
||||
Customer support http://support.eiffel.com
|
||||
]"
|
||||
|
||||
end
|
||||
@@ -1,104 +0,0 @@
|
||||
note
|
||||
description: "[
|
||||
Default implementation of CURL_FUNCTION.
|
||||
]"
|
||||
status: "See notice at end of class."
|
||||
legal: "See notice at end of class."
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
CURL_DEFAULT_FUNCTION
|
||||
|
||||
inherit
|
||||
CURL_FUNCTION
|
||||
|
||||
create
|
||||
make
|
||||
|
||||
feature {NONE} -- Initialization
|
||||
|
||||
make
|
||||
-- Creation method
|
||||
do
|
||||
set_object_and_function_address
|
||||
end
|
||||
|
||||
feature -- Command
|
||||
|
||||
progress_function (a_object_id: POINTER; a_download_total, a_download_now, a_upload_total, a_upload_now: REAL_64): INTEGER
|
||||
do
|
||||
end
|
||||
|
||||
write_function (a_data_pointer: POINTER; a_size, a_nmemb: INTEGER; a_object_id: POINTER): INTEGER
|
||||
local
|
||||
l_c_string: C_STRING
|
||||
do
|
||||
-- Returns the number of bytes actually saved into object identified by `a_object_id'
|
||||
Result := a_size * a_nmemb
|
||||
create l_c_string.make_shared_from_pointer_and_count (a_data_pointer, Result)
|
||||
|
||||
check attached {CURL_STRING} (create {IDENTIFIED}).id_object (a_object_id.to_integer_32) as l_string then
|
||||
l_string.append (l_c_string.substring (1, Result))
|
||||
end
|
||||
end
|
||||
|
||||
read_function (a_data_pointer: POINTER; a_size, a_nmemb: INTEGER; a_object_id: POINTER): INTEGER
|
||||
-- A callback readfunction
|
||||
do
|
||||
end
|
||||
|
||||
debug_function (a_curl_handle: POINTER; a_curl_infotype: INTEGER; a_char_pointer: POINTER; a_size: INTEGER; a_object_id: POINTER): INTEGER
|
||||
local
|
||||
l_c_string: C_STRING
|
||||
do
|
||||
inspect
|
||||
a_curl_infotype
|
||||
when {CURL_INFO_TYPE}.curlinfo_data_in then
|
||||
dump ("<= Recv data", a_char_pointer, a_size)
|
||||
when {CURL_INFO_TYPE}.curlinfo_data_out then
|
||||
dump ("=> Send data", a_char_pointer, a_size)
|
||||
when {CURL_INFO_TYPE}.curlinfo_header_in then
|
||||
dump ("<= Recv header", a_char_pointer, a_size)
|
||||
when {CURL_INFO_TYPE}.curlinfo_header_out then
|
||||
dump ("=> Send header", a_char_pointer, a_size)
|
||||
when {CURL_INFO_TYPE}.curlinfo_ssl_data_in then
|
||||
dump ("<= Recv SSL data", a_char_pointer, a_size)
|
||||
when {CURL_INFO_TYPE}.curlinfo_ssl_data_out then
|
||||
dump ("=> Send SSL data", a_char_pointer, a_size)
|
||||
when {CURL_INFO_TYPE}.curlinfo_text then
|
||||
create l_c_string.make_by_pointer_and_count (a_char_pointer, a_size)
|
||||
print ("%N== Info: " + l_c_string.string)
|
||||
else
|
||||
check type_unknow: False end
|
||||
end
|
||||
end
|
||||
|
||||
feature {NONE} -- Implementation
|
||||
|
||||
dump (a_text: STRING; a_char_pointer: POINTER; a_size: INTEGER)
|
||||
-- Dump debug information
|
||||
require
|
||||
not_void: a_text /= Void
|
||||
exists: a_char_pointer /= default_pointer
|
||||
non_negative: a_size >= 0
|
||||
local
|
||||
l_c_string: C_STRING
|
||||
do
|
||||
create l_c_string.make_shared_from_pointer_and_count (a_char_pointer, a_size)
|
||||
print ("%N" + a_text + "%N" + l_c_string.string)
|
||||
end
|
||||
|
||||
note
|
||||
library: "cURL: Library of reusable components for Eiffel."
|
||||
copyright: "Copyright (c) 1984-2012, Eiffel Software and others"
|
||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||
source: "[
|
||||
Eiffel Software
|
||||
5949 Hollister Ave., Goleta, CA 93117 USA
|
||||
Telephone 805-685-1006, Fax 805-685-6869
|
||||
Website http://www.eiffel.com
|
||||
Customer support http://support.eiffel.com
|
||||
]"
|
||||
|
||||
end
|
||||
@@ -1,409 +0,0 @@
|
||||
note
|
||||
description: "[
|
||||
cURL easy externals.
|
||||
For more informaton see:
|
||||
http://curl.haxx.se/libcurl/c/
|
||||
]"
|
||||
status: "See notice at end of class."
|
||||
legal: "See notice at end of class."
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
CURL_EASY_EXTERNALS
|
||||
|
||||
feature -- Command
|
||||
|
||||
init: POINTER
|
||||
-- Declared as curl_easy_init().
|
||||
require
|
||||
dynamic_library_exists: is_dynamic_library_exists
|
||||
local
|
||||
l_api: POINTER
|
||||
do
|
||||
l_api := api_loader.api_pointer ("curl_easy_init")
|
||||
if l_api /= default_pointer then
|
||||
Result := c_init (l_api)
|
||||
end
|
||||
ensure
|
||||
exists: Result /= default_pointer
|
||||
end
|
||||
|
||||
setopt_string (a_curl_handle: POINTER; a_opt: INTEGER; a_string: READABLE_STRING_GENERAL)
|
||||
-- Declared as curl_easy_setopt().
|
||||
require
|
||||
exists: a_curl_handle /= default_pointer
|
||||
valid: (create {CURL_OPT_CONSTANTS}).is_valid (a_opt)
|
||||
not_void: a_string /= Void
|
||||
local
|
||||
l_api: POINTER
|
||||
l_c_str: C_STRING
|
||||
do
|
||||
l_api := api_loader.api_pointer ("curl_easy_setopt")
|
||||
if l_api /= default_pointer then
|
||||
create l_c_str.make (a_string)
|
||||
c_setopt (l_api, a_curl_handle, a_opt, l_c_str.item)
|
||||
end
|
||||
end
|
||||
|
||||
setopt_form (a_curl_handle: POINTER; a_opt: INTEGER; a_form: CURL_FORM)
|
||||
-- Declared as curl_easy_setopt().
|
||||
require
|
||||
exists: a_curl_handle /= default_pointer
|
||||
valid: (create {CURL_OPT_CONSTANTS}).is_valid (a_opt)
|
||||
not_void: a_form /= Void and then a_form.is_exists
|
||||
do
|
||||
setopt_void_star (a_curl_handle, a_opt, a_form.item)
|
||||
end
|
||||
|
||||
setopt_slist (a_curl_handle: POINTER; a_opt: INTEGER; a_curl_slist: POINTER)
|
||||
-- Declared as curl_easy_setopt().
|
||||
require
|
||||
exists: a_curl_handle /= default_pointer
|
||||
valid: a_opt = {CURL_OPT_CONSTANTS}.curlopt_httpheader
|
||||
exists: a_curl_slist /= default_pointer
|
||||
do
|
||||
setopt_void_star (a_curl_handle, a_opt, a_curl_slist)
|
||||
end
|
||||
|
||||
setopt_curl_string (a_curl_handle: POINTER; a_opt: INTEGER; a_curl_string: CURL_STRING)
|
||||
-- Declared as curl_easy_setopt().
|
||||
require
|
||||
exists: a_curl_handle /= default_pointer
|
||||
valid: (create {CURL_OPT_CONSTANTS}).is_valid (a_opt)
|
||||
not_void: a_curl_string /= Void
|
||||
local
|
||||
l_api: POINTER
|
||||
do
|
||||
l_api := api_loader.api_pointer ("curl_easy_setopt")
|
||||
if l_api /= default_pointer then
|
||||
c_setopt_int (l_api, a_curl_handle, a_opt, a_curl_string.object_id)
|
||||
end
|
||||
end
|
||||
|
||||
setopt_integer (a_curl_handle: POINTER; a_opt: INTEGER; a_integer: INTEGER)
|
||||
-- Declared as curl_easy_setopt().
|
||||
require
|
||||
exists: a_curl_handle /= default_pointer
|
||||
valid: (create {CURL_OPT_CONSTANTS}).is_valid (a_opt)
|
||||
local
|
||||
l_api: POINTER
|
||||
do
|
||||
l_api := api_loader.api_pointer ("curl_easy_setopt")
|
||||
if l_api /= default_pointer then
|
||||
c_setopt_int (l_api, a_curl_handle, a_opt, a_integer)
|
||||
end
|
||||
end
|
||||
|
||||
setopt_file (a_curl_handle: POINTER; a_opt: INTEGER; a_file: FILE)
|
||||
-- Declared as curl_easy_setopt().
|
||||
require
|
||||
exists: a_curl_handle /= default_pointer
|
||||
valid: a_opt = {CURL_OPT_CONSTANTS}.curlopt_readdata
|
||||
readable: a_file /= Void and then a_file.file_readable
|
||||
do
|
||||
setopt_void_star (a_curl_handle, a_opt, a_file.file_pointer)
|
||||
end
|
||||
|
||||
perform (a_curl_handle: POINTER): INTEGER
|
||||
-- Declared as curl_easy_perform().
|
||||
-- Result is one value from {CURL_CODES}
|
||||
require
|
||||
exists: a_curl_handle /= default_pointer
|
||||
local
|
||||
l_api: POINTER
|
||||
do
|
||||
l_api := api_loader.api_pointer ("curl_easy_perform")
|
||||
if l_api /= default_pointer then
|
||||
Result := c_perform (l_api, a_curl_handle)
|
||||
else
|
||||
Result := {CURL_CODES}.eiffelcurle_error_occurred
|
||||
end
|
||||
end
|
||||
|
||||
cleanup (a_curl_handle: POINTER)
|
||||
-- Declared as curl_easy_cleanup().
|
||||
require
|
||||
exists: a_curl_handle /= default_pointer
|
||||
local
|
||||
l_api: POINTER
|
||||
do
|
||||
l_api := api_loader.api_pointer ("curl_easy_cleanup")
|
||||
if l_api /= default_pointer then
|
||||
c_cleanup (l_api, a_curl_handle)
|
||||
end
|
||||
end
|
||||
|
||||
feature -- Query
|
||||
|
||||
getinfo (a_curl_handle: POINTER; a_info: INTEGER; a_data: CELL [detachable ANY]): INTEGER
|
||||
-- `curl_getinfo
|
||||
--|* Request internal information from the curl session with this function. The
|
||||
--|* third argument MUST be a pointer to a long, a pointer to a char * or a
|
||||
--|* pointer to a double (as the documentation describes elsewhere). The data
|
||||
--|* pointed to will be filled in accordingly and can be relied upon only if the
|
||||
--|* function returns CURLE_OK. This function is intended to get used *AFTER* a
|
||||
--|* performed transfer, all results from this function are undefined until the
|
||||
--|* transfer is completed.
|
||||
require
|
||||
exists: a_curl_handle /= default_pointer
|
||||
valid: (create {CURL_INFO_CONSTANTS}).is_valid (a_info)
|
||||
local
|
||||
l_api: POINTER
|
||||
mp: detachable MANAGED_POINTER
|
||||
l: INTEGER
|
||||
cs: C_STRING
|
||||
d: REAL_64
|
||||
do
|
||||
a_data.replace (Void)
|
||||
l_api := api_loader.api_pointer ("curl_easy_getinfo")
|
||||
if l_api /= default_pointer then
|
||||
if a_info & {CURL_INFO_CONSTANTS}.curlinfo_long /= 0 then
|
||||
create mp.make ({PLATFORM}.integer_32_bytes)
|
||||
elseif a_info & {CURL_INFO_CONSTANTS}.curlinfo_string /= 0 then
|
||||
create mp.make ({PLATFORM}.pointer_bytes)
|
||||
elseif a_info & {CURL_INFO_CONSTANTS}.curlinfo_double /= 0 then
|
||||
create mp.make ({PLATFORM}.real_64_bytes)
|
||||
end
|
||||
if mp /= Void then
|
||||
Result := c_getinfo (l_api, a_curl_handle, a_info, mp.item)
|
||||
if Result = {CURL_CODES}.curle_ok then
|
||||
if a_info & {CURL_INFO_CONSTANTS}.curlinfo_long /= 0 then
|
||||
l := mp.read_integer_32 (0)
|
||||
a_data.put (l)
|
||||
elseif a_info & {CURL_INFO_CONSTANTS}.curlinfo_string /= 0 then
|
||||
create cs.make_shared_from_pointer (mp.read_pointer (0))
|
||||
a_data.put (cs.string)
|
||||
elseif a_info & {CURL_INFO_CONSTANTS}.curlinfo_double /= 0 then
|
||||
d := mp.read_real_64 (0)
|
||||
a_data.put (d)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
is_dynamic_library_exists: BOOLEAN
|
||||
-- If dll/so files exist?
|
||||
do
|
||||
Result := api_loader.is_interface_usable
|
||||
end
|
||||
|
||||
feature -- Special setting
|
||||
|
||||
set_curl_function (a_curl_function: CURL_FUNCTION)
|
||||
-- Set `curl_function' with `a_curl_function'
|
||||
do
|
||||
internal_curl_function := a_curl_function
|
||||
ensure
|
||||
set: a_curl_function /= Void implies curl_function = a_curl_function
|
||||
end
|
||||
|
||||
curl_function: CURL_FUNCTION
|
||||
-- cURL functions in curl_easy_setopt.
|
||||
do
|
||||
if attached internal_curl_function as l_curl_function then
|
||||
Result := l_curl_function
|
||||
else
|
||||
create {CURL_DEFAULT_FUNCTION} Result.make
|
||||
internal_curl_function := Result
|
||||
end
|
||||
ensure
|
||||
not_void: Result /= Void
|
||||
end
|
||||
|
||||
set_write_function (a_curl_handle: POINTER)
|
||||
-- Set cURL write function
|
||||
-- Set cURL write function with Eiffel default write function.
|
||||
-- So we can use CURL_STRING as parameter in {CURL_EASY_EXTERNALS}.setopt_curl_string when the option is {CURL_OPT_CONSTANTS}.curlopt_writedata
|
||||
require
|
||||
exists: a_curl_handle /= default_pointer
|
||||
local
|
||||
l_api: POINTER
|
||||
do
|
||||
l_api := api_loader.api_pointer ("curl_easy_setopt")
|
||||
if l_api /= default_pointer then
|
||||
curl_function.c_set_write_function (l_api, a_curl_handle)
|
||||
end
|
||||
end
|
||||
|
||||
set_read_function (a_curl_handle: POINTER)
|
||||
-- Set cURL read function
|
||||
-- Set cURL read function with Eiffel default read function.
|
||||
-- So we can use a c file pointer as parameter in {CURL_EASY_EXTERNALS}.setopt_file_pointer when the option is {CURL_OPT_CONSTANTS}.curlopt_readdata
|
||||
require
|
||||
exists: a_curl_handle /= default_pointer
|
||||
local
|
||||
l_api: POINTER
|
||||
do
|
||||
l_api := api_loader.api_pointer ("curl_easy_setopt")
|
||||
if l_api /= default_pointer then
|
||||
curl_function.c_set_read_function (l_api, a_curl_handle)
|
||||
end
|
||||
end
|
||||
|
||||
set_progress_function (a_curl_handle: POINTER)
|
||||
-- Set cURL progress function for upload/download progress.
|
||||
require
|
||||
exists: a_curl_handle /= default_pointer
|
||||
local
|
||||
l_api: POINTER
|
||||
do
|
||||
l_api := api_loader.api_pointer ("curl_easy_setopt")
|
||||
if l_api /= default_pointer then
|
||||
curl_function.c_set_progress_function (l_api, a_curl_handle)
|
||||
end
|
||||
end
|
||||
|
||||
set_debug_function (a_curl_handle: POINTER)
|
||||
-- Set cURL debug function
|
||||
require
|
||||
exists: a_curl_handle /= default_pointer
|
||||
local
|
||||
l_api: POINTER
|
||||
do
|
||||
l_api := api_loader.api_pointer ("curl_easy_setopt")
|
||||
if l_api /= default_pointer then
|
||||
curl_function.c_set_debug_function (l_api, a_curl_handle)
|
||||
end
|
||||
end
|
||||
|
||||
feature {NONE} -- Implementation
|
||||
|
||||
internal_curl_function: detachable CURL_FUNCTION
|
||||
-- cURL functions.
|
||||
|
||||
api_loader: DYNAMIC_MODULE
|
||||
-- Module name.
|
||||
local
|
||||
l_utility: CURL_UTILITY
|
||||
once
|
||||
create l_utility
|
||||
Result := l_utility.api_loader
|
||||
end
|
||||
|
||||
setopt_void_star (a_curl_handle: POINTER; a_opt: INTEGER; a_data:POINTER)
|
||||
-- Declared as curl_easy_setopt().
|
||||
require
|
||||
exists: a_curl_handle /= default_pointer
|
||||
valid: (create {CURL_OPT_CONSTANTS}).is_valid (a_opt)
|
||||
local
|
||||
l_api: POINTER
|
||||
do
|
||||
l_api := api_loader.api_pointer ("curl_easy_setopt")
|
||||
if l_api /= default_pointer then
|
||||
c_setopt (l_api, a_curl_handle, a_opt, a_data)
|
||||
end
|
||||
end
|
||||
|
||||
feature {NONE} -- C externals
|
||||
|
||||
c_init (a_api: POINTER): POINTER
|
||||
-- Declared curl_easy_init ().
|
||||
require
|
||||
exists: a_api /= default_pointer
|
||||
external
|
||||
"C inline use <curl/curl.h>"
|
||||
alias
|
||||
"[
|
||||
return (FUNCTION_CAST(CURL *, ()) $a_api)();
|
||||
]"
|
||||
end
|
||||
|
||||
c_cleanup (a_api: POINTER; a_curl_handle: POINTER)
|
||||
-- Decalred as curl_easy_cleanup ().
|
||||
require
|
||||
exists: a_api /= default_pointer
|
||||
exists: a_curl_handle /= default_pointer
|
||||
external
|
||||
"C inline use <curl/curl.h>"
|
||||
alias
|
||||
"[
|
||||
(FUNCTION_CAST(void, (CURL *)) $a_api)((CURL *)$a_curl_handle);
|
||||
]"
|
||||
end
|
||||
|
||||
c_perform (a_api: POINTER; a_curl_handle: POINTER): INTEGER
|
||||
-- Declared as curl_easy_perform().
|
||||
require
|
||||
exists: a_api /= default_pointer
|
||||
exists: a_curl_handle /= default_pointer
|
||||
external
|
||||
"C inline use <curl/curl.h>"
|
||||
alias
|
||||
"[
|
||||
return (FUNCTION_CAST(CURLcode, (CURL *)) $a_api)
|
||||
((CURL *) $a_curl_handle);
|
||||
]"
|
||||
end
|
||||
|
||||
c_setopt_int (a_api: POINTER; a_curl_handle: POINTER; a_opt: INTEGER; a_data: INTEGER)
|
||||
-- Same as `c_setopt' except we can pass `a_data' as integer.
|
||||
require
|
||||
exists: a_api /= default_pointer
|
||||
exists: a_curl_handle /= default_pointer
|
||||
valid: (create {CURL_OPT_CONSTANTS}).is_valid (a_opt)
|
||||
external
|
||||
"C inline use <curl/curl.h>"
|
||||
alias
|
||||
"[
|
||||
{
|
||||
(FUNCTION_CAST(void, (CURL *, CURLoption, ...)) $a_api)
|
||||
((CURL *) $a_curl_handle,
|
||||
(CURLoption)$a_opt,
|
||||
$a_data);
|
||||
}
|
||||
]"
|
||||
end
|
||||
|
||||
c_setopt (a_api: POINTER; a_curl_handle: POINTER; a_opt: INTEGER; a_data: POINTER)
|
||||
-- C implementation of `setopt_void_star'.
|
||||
-- Declared as curl_easy_setopt ().
|
||||
require
|
||||
exists: a_api /= default_pointer
|
||||
exists: a_curl_handle /= default_pointer
|
||||
valid: (create {CURL_OPT_CONSTANTS}).is_valid (a_opt)
|
||||
external
|
||||
"C inline use <curl/curl.h>"
|
||||
alias
|
||||
"[
|
||||
{
|
||||
(FUNCTION_CAST(void, (CURL *, CURLoption, ...)) $a_api)
|
||||
((CURL *) $a_curl_handle,
|
||||
(CURLoption)$a_opt,
|
||||
$a_data);
|
||||
}
|
||||
]"
|
||||
end
|
||||
|
||||
c_getinfo (a_api: POINTER; a_curl_handle: POINTER; a_opt: INTEGER; a_data: POINTER): INTEGER
|
||||
-- C implementation of `curl_easy_getinfo'.
|
||||
-- Declared as curl_easy_setopt ().
|
||||
require
|
||||
exists: a_api /= default_pointer
|
||||
exists: a_curl_handle /= default_pointer
|
||||
valid: (create {CURL_OPT_CONSTANTS}).is_valid (a_opt)
|
||||
external
|
||||
"C inline use <curl/curl.h>"
|
||||
alias
|
||||
"[
|
||||
return (FUNCTION_CAST(CURLcode, (CURL *, CURLINFO info, ...)) $a_api)
|
||||
((CURL *) $a_curl_handle,
|
||||
(CURLINFO)$a_opt,
|
||||
$a_data);
|
||||
]"
|
||||
end
|
||||
|
||||
note
|
||||
library: "cURL: Library of reusable components for Eiffel."
|
||||
copyright: "Copyright (c) 1984-2010, Eiffel Software and others"
|
||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||
source: "[
|
||||
Eiffel Software
|
||||
5949 Hollister Ave., Goleta, CA 93117 USA
|
||||
Telephone 805-685-1006, Fax 805-685-6869
|
||||
Website http://www.eiffel.com
|
||||
Customer support http://support.eiffel.com
|
||||
]"
|
||||
|
||||
end
|
||||
@@ -1,254 +0,0 @@
|
||||
note
|
||||
description: "[
|
||||
cURL externals.
|
||||
For more information, see:
|
||||
http://curl.haxx.se/libcurl/c/
|
||||
]"
|
||||
status: "See notice at end of class."
|
||||
legal: "See notice at end of class."
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
CURL_EXTERNALS
|
||||
|
||||
feature -- Command
|
||||
|
||||
global_init
|
||||
-- Declared as curl_global_init().
|
||||
require
|
||||
dynamic_library_exists: is_dynamic_library_exists
|
||||
local
|
||||
l_ptr: POINTER
|
||||
do
|
||||
l_ptr := api_loader.api_pointer ("curl_global_init")
|
||||
if l_ptr /= default_pointer then
|
||||
c_curl_global_init (l_ptr, {CURL_GLOBAL_CONSTANTS}.curl_global_all);
|
||||
end
|
||||
end
|
||||
|
||||
global_cleanup
|
||||
-- Declared as curl_global_cleanup().
|
||||
local
|
||||
l_ptr: POINTER
|
||||
do
|
||||
l_ptr := api_loader.api_pointer ("curl_global_cleanup")
|
||||
if l_ptr /= default_pointer then
|
||||
c_curl_global_cleanup (l_ptr);
|
||||
end
|
||||
end
|
||||
|
||||
formadd_string_string (a_form: CURL_FORM; a_last_pointer: CURL_FORM; a_arg_1: INTEGER; a_arg_1_value: READABLE_STRING_GENERAL; a_arg_2: INTEGER; a_arg_2_value: READABLE_STRING_GENERAL; a_arg_3: INTEGER)
|
||||
-- Declared as curl_formadd ().
|
||||
require
|
||||
not_void: a_form /= Void
|
||||
not_void: a_last_pointer /= Void
|
||||
valid: (create {CURL_FORM_CONSTANTS}).is_valid (a_arg_1)
|
||||
not_void: a_arg_1_value /= Void
|
||||
valid: (create {CURL_FORM_CONSTANTS}).is_valid (a_arg_2)
|
||||
not_void: a_arg_2_value /= Void
|
||||
valid: (create {CURL_FORM_CONSTANTS}).is_valid (a_arg_3)
|
||||
local
|
||||
l_form_pointer, l_last_pointer: POINTER
|
||||
do
|
||||
l_form_pointer := a_form.item
|
||||
l_last_pointer := a_last_pointer.item
|
||||
|
||||
internal_formadd_string_string ($l_form_pointer, $l_last_pointer, a_arg_1, a_arg_1_value, a_arg_2, a_arg_2_value, a_arg_3)
|
||||
|
||||
if a_form.item /= l_form_pointer then
|
||||
check not_set: a_form.item = default_pointer end
|
||||
a_form.set_item (l_form_pointer)
|
||||
end
|
||||
if a_last_pointer.item /= l_last_pointer then
|
||||
a_last_pointer.set_item (l_last_pointer)
|
||||
end
|
||||
end
|
||||
|
||||
slist_append (a_list: POINTER; a_string: READABLE_STRING_GENERAL): POINTER
|
||||
-- Declared as curl_slist_append ().
|
||||
-- note: call with a null `a_list' to get initialized pointer as Result
|
||||
require
|
||||
not_void: a_string /= Void
|
||||
local
|
||||
l_c_string: C_STRING
|
||||
l_api: POINTER
|
||||
do
|
||||
l_api := api_loader.api_pointer ("curl_slist_append")
|
||||
if l_api /= default_pointer then
|
||||
create l_c_string.make (a_string)
|
||||
Result := c_slist_append (l_api, a_list, l_c_string.item)
|
||||
end
|
||||
end
|
||||
|
||||
slist_free_all (a_curl_slist: POINTER)
|
||||
-- Declared as curl_slist_free_all ().
|
||||
-- See: http://curl.haxx.se/libcurl/c/curl_slist_free_all.html
|
||||
-- curl_slist_free_all - free an entire curl_slist list
|
||||
-- This must be called when the data has been used, which typically means after the curl_easy_perform(3) has been called.
|
||||
require
|
||||
exists: a_curl_slist /= default_pointer
|
||||
local
|
||||
l_api: POINTER
|
||||
do
|
||||
l_api := api_loader.api_pointer ("curl_slist_free_all")
|
||||
if l_api /= default_pointer then
|
||||
c_slist_free_all (l_api, a_curl_slist)
|
||||
end
|
||||
end
|
||||
|
||||
feature -- Query
|
||||
|
||||
is_dynamic_library_exists: BOOLEAN
|
||||
-- If dll/so files exist?
|
||||
do
|
||||
Result := api_loader.is_interface_usable
|
||||
end
|
||||
|
||||
feature {CURL_FORM} -- Internal command
|
||||
|
||||
formfree (a_curl_form: POINTER)
|
||||
-- Declared as curl_formfree ().
|
||||
-- See: http://curl.askapache.com/libcurl/c/curl_formfree.html
|
||||
-- curl_formfree() is used to clean up data previously built/appended with curl_formadd(3).
|
||||
-- This must be called when the data has been used, which typically means after the curl_easy_perform(3) has been called.
|
||||
require
|
||||
exists: a_curl_form /= default_pointer
|
||||
local
|
||||
l_api: POINTER
|
||||
do
|
||||
l_api := api_loader.api_pointer ("curl_formfree")
|
||||
if l_api /= default_pointer then
|
||||
c_formfree (l_api, a_curl_form)
|
||||
end
|
||||
end
|
||||
|
||||
feature {NONE} -- Implementation
|
||||
|
||||
api_loader: DYNAMIC_MODULE
|
||||
-- Module name.
|
||||
local
|
||||
l_utility: CURL_UTILITY
|
||||
once
|
||||
create l_utility
|
||||
Result := l_utility.api_loader
|
||||
end
|
||||
|
||||
internal_formadd_string_string (a_form: TYPED_POINTER [POINTER]; a_last_pointer: TYPED_POINTER [POINTER]; a_arg_1: INTEGER; a_arg_1_value: READABLE_STRING_GENERAL; a_arg_2: INTEGER; a_arg_2_value: READABLE_STRING_GENERAL; a_arg_3: INTEGER)
|
||||
-- Declared as curl_formadd ().
|
||||
local
|
||||
l_c_string_1, l_c_string_2: C_STRING
|
||||
l_api: POINTER
|
||||
do
|
||||
l_api := api_loader.api_pointer ("curl_formadd");
|
||||
if l_api /= default_pointer then
|
||||
create l_c_string_1.make (a_arg_1_value)
|
||||
create l_c_string_2.make (a_arg_2_value)
|
||||
c_formadd_string_string (l_api, a_form, a_last_pointer, a_arg_1, l_c_string_1.item, a_arg_2, l_c_string_2.item, a_arg_3)
|
||||
end
|
||||
end
|
||||
|
||||
feature {NONE} -- C externals
|
||||
|
||||
c_formadd_string_string (a_api: POINTER; a_form: TYPED_POINTER [POINTER]; a_last_pointer: TYPED_POINTER [POINTER]; a_arg_1: INTEGER; a_arg_1_value: POINTER; a_arg_2: INTEGER; a_arg_2_value: POINTER; a_arg_3: INTEGER)
|
||||
-- C implementation of formadd_string_string ().
|
||||
require
|
||||
exists: a_api /= default_pointer
|
||||
external
|
||||
"C inline use <curl/curl.h>"
|
||||
alias
|
||||
"[
|
||||
{
|
||||
(FUNCTION_CAST(void, (struct curl_httppost **, struct curl_httppost **, int, char *, int, char *, int)) $a_api)
|
||||
((struct curl_httppost **)$a_form,
|
||||
(struct curl_httppost **)$a_last_pointer,
|
||||
(int)$a_arg_1,
|
||||
(char *)$a_arg_1_value,
|
||||
(int)$a_arg_2,
|
||||
(char *)$a_arg_2_value,
|
||||
(int)$a_arg_3);
|
||||
}
|
||||
]"
|
||||
end
|
||||
|
||||
c_formfree (a_api: POINTER; a_curl_form: POINTER)
|
||||
-- Declared as curl_formfree ().
|
||||
require
|
||||
exists: a_api /= default_pointer
|
||||
exists: a_curl_form /= default_pointer
|
||||
external
|
||||
"C inline use <curl/curl.h>"
|
||||
alias
|
||||
"[
|
||||
(FUNCTION_CAST(void, (struct curl_httppost *)) $a_api)
|
||||
((struct curl_httppost *) $a_curl_form);
|
||||
]"
|
||||
end
|
||||
|
||||
c_curl_global_init (a_api: POINTER; a_opt: NATURAL_64)
|
||||
-- `a_api' point to API curl_global_init ()
|
||||
-- `a_opt' is intialization option.
|
||||
require
|
||||
exists: a_api /= default_pointer
|
||||
external
|
||||
"C inline use <curl/curl.h>"
|
||||
alias
|
||||
"[
|
||||
(FUNCTION_CAST(void, (long)) $a_api)((long) $a_opt);
|
||||
]"
|
||||
end
|
||||
|
||||
c_curl_global_cleanup (a_api: POINTER)
|
||||
-- `a_api' point to API curl_global_cleanup()
|
||||
require
|
||||
exists: a_api /= default_pointer
|
||||
external
|
||||
"C inline use <curl/curl.h>"
|
||||
alias
|
||||
"[
|
||||
(FUNCTION_CAST(void, ()) $a_api)();
|
||||
]"
|
||||
end
|
||||
|
||||
c_slist_append (a_api: POINTER; a_list_pointer: POINTER; a_string: POINTER): POINTER
|
||||
-- Declared as curl_slist_append ().
|
||||
require
|
||||
exists: a_api /= default_pointer
|
||||
external
|
||||
"C inline use <curl/curl.h>"
|
||||
alias
|
||||
"[
|
||||
{
|
||||
return (FUNCTION_CAST(void *, (struct curl_slist *, const char *)) $a_api)
|
||||
((struct curl_slist *)$a_list_pointer,
|
||||
(const char *)$a_string);
|
||||
}
|
||||
]"
|
||||
end
|
||||
|
||||
c_slist_free_all (a_api: POINTER; a_list_pointer: POINTER)
|
||||
-- Declared as void curl_slist_free_all(struct curl_slist * list)
|
||||
require
|
||||
exists: a_api /= default_pointer
|
||||
external
|
||||
"C inline use <curl/curl.h>"
|
||||
alias
|
||||
"[
|
||||
(FUNCTION_CAST(void *, (struct curl_slist *)) $a_api)
|
||||
((struct curl_slist *)$a_list_pointer);
|
||||
]"
|
||||
end
|
||||
|
||||
note
|
||||
library: "cURL: Library of reusable components for Eiffel."
|
||||
copyright: "Copyright (c) 1984-2010, Eiffel Software and others"
|
||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||
source: "[
|
||||
Eiffel Software
|
||||
5949 Hollister Ave., Goleta, CA 93117 USA
|
||||
Telephone 805-685-1006, Fax 805-685-6869
|
||||
Website http://www.eiffel.com
|
||||
Customer support http://support.eiffel.com
|
||||
]"
|
||||
|
||||
end
|
||||
@@ -1,94 +0,0 @@
|
||||
note
|
||||
description: "[
|
||||
cURL form.
|
||||
For more informaton see:
|
||||
http://curl.haxx.se/libcurl/c/curl_formadd.html
|
||||
]"
|
||||
status: "See notice at end of class."
|
||||
legal: "See notice at end of class."
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
CURL_FORM
|
||||
|
||||
inherit
|
||||
DISPOSABLE
|
||||
|
||||
create
|
||||
make,
|
||||
share_with_pointer
|
||||
|
||||
feature {NONE} -- Initialization
|
||||
|
||||
make
|
||||
-- Creation method.
|
||||
do
|
||||
end
|
||||
|
||||
share_with_pointer (a_pointer: POINTER)
|
||||
-- Creation method.
|
||||
-- `item' share with `a_pointer'.
|
||||
require
|
||||
exists: a_pointer /= default_pointer
|
||||
do
|
||||
item := a_pointer
|
||||
ensure
|
||||
set: item = a_pointer
|
||||
end
|
||||
|
||||
feature -- Query
|
||||
|
||||
item: POINTER
|
||||
-- C pointer of Current.
|
||||
|
||||
is_exists: BOOLEAN
|
||||
-- If C pointer exists?
|
||||
do
|
||||
Result := item /= default_pointer
|
||||
end
|
||||
|
||||
feature -- Command
|
||||
|
||||
dispose
|
||||
-- Free memory if possible.
|
||||
local
|
||||
l_curl: CURL_EXTERNALS
|
||||
do
|
||||
if item /= default_pointer then
|
||||
create l_curl
|
||||
l_curl.formfree (item)
|
||||
item := default_pointer
|
||||
end
|
||||
end
|
||||
|
||||
release_item
|
||||
-- Release item
|
||||
-- NOT free memory! This is useful if Current generated by {CURL_EXTERNALS}.formadd_string_string.
|
||||
do
|
||||
item := default_pointer
|
||||
end
|
||||
|
||||
feature {CURL_EXTERNALS} -- Internal command
|
||||
|
||||
set_item (a_item: POINTER)
|
||||
-- Set `item' with `a_item'
|
||||
do
|
||||
item := a_item
|
||||
ensure
|
||||
set: item = a_item
|
||||
end
|
||||
|
||||
note
|
||||
library: "cURL: Library of reusable components for Eiffel."
|
||||
copyright: "Copyright (c) 1984-2006, Eiffel Software and others"
|
||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||
source: "[
|
||||
Eiffel Software
|
||||
356 Storke Road, Goleta, CA 93117 USA
|
||||
Telephone 805-685-1006, Fax 805-685-6869
|
||||
Website http://www.eiffel.com
|
||||
Customer support http://support.eiffel.com
|
||||
]"
|
||||
|
||||
end
|
||||
@@ -1,78 +0,0 @@
|
||||
note
|
||||
description: "[
|
||||
cURL form constants.
|
||||
For more informaton see:
|
||||
http://curl.haxx.se/libcurl/c/curl_formadd.html
|
||||
]"
|
||||
status: "See notice at end of class."
|
||||
legal: "See notice at end of class."
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
CURL_FORM_CONSTANTS
|
||||
|
||||
feature -- Query
|
||||
|
||||
curlform_copyname: INTEGER
|
||||
-- Declared as CURLFORM_COPYNAME
|
||||
external
|
||||
"C inline use <curl/curl.h>"
|
||||
alias
|
||||
"[
|
||||
CURLFORM_COPYNAME
|
||||
]"
|
||||
end
|
||||
|
||||
curlform_copycontents: INTEGER
|
||||
-- Declared as CURLFORM_COPYCONTENTS
|
||||
external
|
||||
"C inline use <curl/curl.h>"
|
||||
alias
|
||||
"[
|
||||
CURLFORM_COPYCONTENTS
|
||||
]"
|
||||
end
|
||||
|
||||
curlform_end: INTEGER
|
||||
-- Declared as CURLFORM_END
|
||||
external
|
||||
"C inline use <curl/curl.h>"
|
||||
alias
|
||||
"[
|
||||
CURLFORM_END
|
||||
]"
|
||||
end
|
||||
|
||||
curlform_file: INTEGER
|
||||
-- Declared as CURLFORM_FILE
|
||||
external
|
||||
"C inline use <curl/curl.h>"
|
||||
alias
|
||||
"[
|
||||
CURLFORM_FILE
|
||||
]"
|
||||
end
|
||||
|
||||
is_valid (a_integer: INTEGER): BOOLEAN
|
||||
-- If `a_integer' valid?
|
||||
do
|
||||
Result := a_integer = curlform_copycontents or
|
||||
a_integer = curlform_copyname or
|
||||
a_integer = curlform_end or
|
||||
a_integer = curlform_file
|
||||
end
|
||||
|
||||
note
|
||||
library: "cURL: Library of reusable components for Eiffel."
|
||||
copyright: "Copyright (c) 1984-2006, Eiffel Software and others"
|
||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||
source: "[
|
||||
Eiffel Software
|
||||
356 Storke Road, Goleta, CA 93117 USA
|
||||
Telephone 805-685-1006, Fax 805-685-6869
|
||||
Website http://www.eiffel.com
|
||||
Customer support http://support.eiffel.com
|
||||
]"
|
||||
|
||||
end
|
||||
@@ -1,257 +0,0 @@
|
||||
note
|
||||
description: "[
|
||||
cURL curl_easy_setopt callback functions' Eiffel wrappers.
|
||||
We need this class since cURL need a c function pointer as value but
|
||||
Eiffel function need frist parameter of any funciton call is object address.
|
||||
Client programmers can inherit this class to fit their needs.
|
||||
|
||||
Note: descendants of this class have to call `set_object_and_function_address',
|
||||
otherwise cURL would not know how to call Eiffel features (such as `write_function').
|
||||
See example: $ISE_LIBRARY\examples\cURL\upload_and_read_function
|
||||
|
||||
See http://curl.haxx.se/libcurl/c/curl_easy_setopt.html for libcurl documentation
|
||||
]"
|
||||
status: "See notice at end of class."
|
||||
legal: "See notice at end of class."
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
deferred class
|
||||
CURL_FUNCTION
|
||||
|
||||
inherit
|
||||
DISPOSABLE
|
||||
|
||||
feature -- Interactive with C
|
||||
|
||||
set_object_and_function_address
|
||||
-- Set object and function addresses.
|
||||
-- Call this feature before call `c_set_progress_function', `c_set_debug_function' and `c_set_write_function, c_set_read_function'.
|
||||
do
|
||||
c_set_object ($Current)
|
||||
c_set_progress_function_address ($progress_function)
|
||||
c_set_write_function_address ($write_function)
|
||||
c_set_read_function_address ($read_function)
|
||||
c_set_debug_function_address ($debug_function)
|
||||
end
|
||||
|
||||
c_set_progress_function (a_setopt_api: POINTER; a_curl_handle: POINTER)
|
||||
-- Setting CURLOPT_PROGRESSFUNCTION option of `a_curl_handle'.
|
||||
-- We need this function since cURL need a c function pointer as value.
|
||||
require
|
||||
exists: a_setopt_api /= default_pointer
|
||||
external
|
||||
"C inline use <eiffel_curl.h>"
|
||||
alias
|
||||
"[
|
||||
{
|
||||
(FUNCTION_CAST(void, (CURL *, CURLoption, ...)) $a_setopt_api)
|
||||
((CURL *) $a_curl_handle,
|
||||
(CURLoption)CURLOPT_PROGRESSFUNCTION,
|
||||
curl_progress_function);
|
||||
}
|
||||
]"
|
||||
end
|
||||
|
||||
c_set_debug_function (a_setopt_api: POINTER; a_curl_handle: POINTER)
|
||||
-- Setting CURLOPT_DEBUGFUNCTION option of `a_curl_handle'.
|
||||
-- We need this function since cURL need a c function pointer as value.
|
||||
require
|
||||
exists: a_curl_handle /= default_pointer
|
||||
external
|
||||
"C inline use <eiffel_curl.h>"
|
||||
alias
|
||||
"[
|
||||
{
|
||||
(FUNCTION_CAST(void, (CURL *, CURLoption, ...)) $a_setopt_api)
|
||||
((CURL *) $a_curl_handle,
|
||||
(CURLoption)CURLOPT_DEBUGFUNCTION,
|
||||
curl_debug_function);
|
||||
|
||||
}
|
||||
]"
|
||||
end
|
||||
|
||||
c_set_write_function (a_setopt_api: POINTER; a_curl_handle: POINTER)
|
||||
-- Setting CURLOPT_WRITEFUNCTION option of `a_curl_handle'.
|
||||
-- We need this function since cURL need a c function pointer as value.
|
||||
require
|
||||
exists: a_setopt_api /= default_pointer
|
||||
external
|
||||
"C inline use <eiffel_curl.h>"
|
||||
alias
|
||||
"[
|
||||
{
|
||||
(FUNCTION_CAST(void, (CURL *, CURLoption, ...)) $a_setopt_api)
|
||||
((CURL *) $a_curl_handle,
|
||||
(CURLoption)CURLOPT_WRITEFUNCTION,
|
||||
curl_write_function);
|
||||
}
|
||||
]"
|
||||
end
|
||||
|
||||
c_set_read_function (a_setopt_api: POINTER; a_curl_handle: POINTER)
|
||||
-- Setting CURLOPT_READFUNCTION option of `a_curl_handle'.
|
||||
-- We need this function since cURL need a c function pointer as value.
|
||||
require
|
||||
exists: a_setopt_api /= default_pointer
|
||||
external
|
||||
"C inline use <eiffel_curl.h>"
|
||||
alias
|
||||
"[
|
||||
{
|
||||
(FUNCTION_CAST(void, (CURL *, CURLoption, ...)) $a_setopt_api)
|
||||
((CURL *) $a_curl_handle,
|
||||
(CURLoption)CURLOPT_READFUNCTION,
|
||||
curl_read_function);
|
||||
}
|
||||
]"
|
||||
end
|
||||
|
||||
feature -- cURL curl_easy_setopt functions
|
||||
|
||||
progress_function (a_object_id: POINTER; a_download_total, a_download_now, a_upload_total, a_upload_now: REAL_64): INTEGER
|
||||
-- Function correspond to {CURL_OPT_CONSTANTS}.curlopt_progressfunction
|
||||
-- Note, pass a {IDENTIFIED}.object_id as `a_object_id' value is helpful since we can't directly pass an Eiffel Object address which
|
||||
-- may changed during GC.
|
||||
deferred
|
||||
end
|
||||
|
||||
write_function (a_data_pointer: POINTER; a_size, a_nmemb: INTEGER; a_object_id: POINTER): INTEGER
|
||||
-- Function called by libcurl as soon as there is data received that needs to be saved.
|
||||
-- The size of the data pointed to by `a_data_pointer' is `a_size' multiplied with `a_nmemb', it will not be null terminated.
|
||||
-- Returns the number of bytes actually taken care of
|
||||
--
|
||||
-- Function corresponds to {CURL_OPT_CONSTANTS}.curlopt_writefunction
|
||||
-- Note, pass a {IDENTIFIED}.object_id as `a_object_id' value is helpful since we can't directly pass an Eiffel Object address which
|
||||
-- may changed during GC.
|
||||
--| libcurl doc:
|
||||
--| Function pointer that should match the following prototype: size_t function( char *ptr, size_t size, size_t nmemb, void *userdata);
|
||||
--| This function gets called by libcurl as soon as there is data received that needs to be saved.
|
||||
--| The size of the data pointed to by ptr is size multiplied with nmemb, it will not be zero terminated.
|
||||
--| Return the number of bytes actually taken care of.
|
||||
--| If that amount differs from the amount passed to your function, it'll signal an error to the library.
|
||||
--| This will abort the transfer and return CURLE_WRITE_ERROR.
|
||||
--| From 7.18.0, the function can return CURL_WRITEFUNC_PAUSE which then will cause writing to this connection to become paused.
|
||||
--| See curl_easy_pause(3) for further details.
|
||||
--|
|
||||
--| This function may be called with zero bytes data if the transferred file is empty.
|
||||
--|
|
||||
--| Set this option to NULL to get the internal default function.
|
||||
--| The internal default function will write the data to the FILE * given with CURLOPT_WRITEDATA.
|
||||
--|
|
||||
--| Set the userdata argument with the CURLOPT_WRITEDATA option.
|
||||
--|
|
||||
--| The callback function will be passed as much data as possible in all invokes,
|
||||
--| but you cannot possibly make any assumptions. It may be one byte, it may be thousands.
|
||||
--| The maximum amount of body data that can be passed to the write callback is defined
|
||||
--| in the curl.h header file: CURL_MAX_WRITE_SIZE (the usual default is 16K).
|
||||
--| If you however have CURLOPT_HEADER set, which sends header data to the write callback,
|
||||
--| you can get up to CURL_MAX_HTTP_HEADER bytes of header data passed into it. This usually means 100K.
|
||||
deferred
|
||||
end
|
||||
|
||||
read_function (a_data_pointer: POINTER; a_size, a_nmemb: INTEGER; a_object_id: POINTER): INTEGER
|
||||
-- Function called by libcurl as soon as it needs to read data in order to send it to the peer.
|
||||
-- The data area pointed at by the pointer `a_data_pointer' may be filled with at most
|
||||
-- `a_size' multiplied with `a_nmemb' number of bytes.
|
||||
-- Returns the actual number of bytes stored in that memory area.
|
||||
-- Returning 0 will signal end-of-file to the library and cause it to stop the current transfer.
|
||||
--
|
||||
-- Function corresponds to {CURL_OPT_CONSTANTS}.curlopt_readfunction
|
||||
-- Note, pass a {IDENTIFIED}.object_id as `a_object_id' value is helpful since we can't directly pass an Eiffel Object address which
|
||||
-- may changed during GC.
|
||||
--| libcurl doc:
|
||||
--| Function pointer that should match the following prototype: size_t function( void *ptr, size_t size, size_t nmemb, void *userdata);
|
||||
--| This function gets called by libcurl as soon as it needs to read data in order to send it to the peer.
|
||||
--| The data area pointed at by the pointer ptr may be filled with at most size multiplied with nmemb number of bytes.
|
||||
--| Your function must return the actual number of bytes that you stored in that memory area.
|
||||
--| Returning 0 will signal end-of-file to the library and cause it to stop the current transfer.
|
||||
--|
|
||||
--| If you stop the current transfer by returning 0 "pre-maturely" (i.e before the server expected it,
|
||||
--| like when you've said you will upload N bytes and you upload less than N bytes),
|
||||
--| you may experience that the server "hangs" waiting for the rest of the data that won't come.
|
||||
--|
|
||||
--| The read callback may return CURL_READFUNC_ABORT to stop the current operation immediately,
|
||||
--| resulting in a CURLE_ABORTED_BY_CALLBACK error code from the transfer (Added in 7.12.1)
|
||||
--|
|
||||
--| From 7.18.0, the function can return CURL_READFUNC_PAUSE which then will cause reading from this connection to become paused.
|
||||
--| See curl_easy_pause(3) for further details.
|
||||
--|
|
||||
--| Bugs: when doing TFTP uploads, you must return the exact amount of data that the callback wants,
|
||||
--| or it will be considered the final packet by the server end and the transfer will end there.
|
||||
--|
|
||||
--| If you set this callback pointer to NULL, or don't set it at all, the default internal read function will be used.
|
||||
--| It is doing an fread() on the FILE * userdata set with CURLOPT_READDATA.
|
||||
deferred
|
||||
end
|
||||
|
||||
debug_function (a_curl_handle: POINTER; a_curl_infotype: INTEGER; a_char_pointer: POINTER; a_size: INTEGER; a_object_id: POINTER): INTEGER
|
||||
-- Function correspond to {CURL_OPT_CONSTANTS}.curlopt_debugfunction
|
||||
-- Note, pass a {IDENTIFIED}.object_id as `a_object_id' value is helpful since we can't directly pass an Eiffel Object address which
|
||||
-- may changed during GC.
|
||||
require
|
||||
vaild: (create {CURL_INFO_TYPE}).is_valid (a_curl_infotype)
|
||||
deferred
|
||||
end
|
||||
|
||||
feature {NONE} -- Externals
|
||||
|
||||
c_set_object (a_object: POINTER)
|
||||
-- Set Current object address.
|
||||
external
|
||||
"C signature (EIF_REFERENCE) use %"eiffel_curl.h%""
|
||||
end
|
||||
|
||||
c_release_object
|
||||
-- Release Current pointer in C
|
||||
external
|
||||
"C use %"eiffel_curl.h%""
|
||||
end
|
||||
|
||||
c_set_progress_function_address (a_address: POINTER)
|
||||
-- Set progress function address.
|
||||
external
|
||||
"C use %"eiffel_curl.h%""
|
||||
end
|
||||
|
||||
c_set_write_function_address (a_address: POINTER)
|
||||
-- Set write function address.
|
||||
external
|
||||
"C use %"eiffel_curl.h%""
|
||||
end
|
||||
|
||||
c_set_read_function_address (a_address: POINTER)
|
||||
-- Set read function address.
|
||||
external
|
||||
"C use %"eiffel_curl.h%""
|
||||
end
|
||||
|
||||
c_set_debug_function_address (a_address: POINTER)
|
||||
-- Set write function address.
|
||||
external
|
||||
"C use %"eiffel_curl.h%""
|
||||
end
|
||||
|
||||
feature {NONE} -- Implementation
|
||||
|
||||
dispose
|
||||
-- Wean `Current'
|
||||
do
|
||||
c_release_object
|
||||
c_set_object (default_pointer)
|
||||
end
|
||||
|
||||
note
|
||||
library: "cURL: Library of reusable components for Eiffel."
|
||||
copyright: "Copyright (c) 1984-2012, Eiffel Software and others"
|
||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||
source: "[
|
||||
Eiffel Software
|
||||
5949 Hollister Ave., Goleta, CA 93117 USA
|
||||
Telephone 805-685-1006, Fax 805-685-6869
|
||||
Website http://www.eiffel.com
|
||||
Customer support http://support.eiffel.com
|
||||
]"
|
||||
|
||||
end
|
||||
@@ -1,78 +0,0 @@
|
||||
note
|
||||
description: "[
|
||||
cURL library constants used by curl_global_init ()
|
||||
]"
|
||||
status: "See notice at end of class."
|
||||
legal: "See notice at end of class."
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
CURL_GLOBAL_CONSTANTS
|
||||
|
||||
feature -- Query
|
||||
|
||||
curl_global_ssl: NATURAL_64
|
||||
-- Delcared as CURL_GLOBAL_SSL
|
||||
external
|
||||
"C inline use <curl/curl.h>"
|
||||
alias
|
||||
"[
|
||||
return CURL_GLOBAL_SSL;
|
||||
]"
|
||||
end
|
||||
|
||||
curl_global_win32: NATURAL_64
|
||||
-- Delcared as CURL_GLOBAL_WIN32
|
||||
external
|
||||
"C inline use <curl/curl.h>"
|
||||
alias
|
||||
"[
|
||||
return CURL_GLOBAL_WIN32;
|
||||
]"
|
||||
end
|
||||
|
||||
curl_global_all: NATURAL_64
|
||||
-- Delcared as CURL_GLOBAL_ALL
|
||||
external
|
||||
"C inline use <curl/curl.h>"
|
||||
alias
|
||||
"[
|
||||
return CURL_GLOBAL_ALL;
|
||||
]"
|
||||
end
|
||||
|
||||
curl_global_nothing: NATURAL_64
|
||||
-- Delcared as CURL_GLOBAL_NOTHING
|
||||
external
|
||||
"C inline use <curl/curl.h>"
|
||||
alias
|
||||
"[
|
||||
return CURL_GLOBAL_NOTHING;
|
||||
]"
|
||||
end
|
||||
|
||||
curl_global_default: NATURAL_64
|
||||
-- Delcared as CURL_GLOBAL_DEFAULT
|
||||
external
|
||||
"C inline use <curl/curl.h>"
|
||||
alias
|
||||
"[
|
||||
return CURL_GLOBAL_DEFAULT;
|
||||
]"
|
||||
end
|
||||
|
||||
note
|
||||
library: "cURL: Library of reusable components for Eiffel."
|
||||
copyright: "Copyright (c) 1984-2006, Eiffel Software and others"
|
||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||
source: "[
|
||||
Eiffel Software
|
||||
356 Storke Road, Goleta, CA 93117 USA
|
||||
Telephone 805-685-1006, Fax 805-685-6869
|
||||
Website http://www.eiffel.com
|
||||
Customer support http://support.eiffel.com
|
||||
]"
|
||||
|
||||
end
|
||||
|
||||
@@ -1,122 +0,0 @@
|
||||
note
|
||||
description: "[
|
||||
cURL library info constants.
|
||||
]"
|
||||
status: "See notice at end of class."
|
||||
legal: "See notice at end of class."
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
CURL_INFO_CONSTANTS
|
||||
|
||||
feature -- Constants
|
||||
|
||||
curlinfo_string: INTEGER = 0x100000
|
||||
-- Declared as CURLINFO_STRING
|
||||
|
||||
curlinfo_long: INTEGER = 0x200000
|
||||
-- Declared as CURLINFO_LONG
|
||||
|
||||
curlinfo_double: INTEGER = 0x300000
|
||||
-- Declared as CURLINFO_DOUBLE
|
||||
|
||||
curlinfo_slist: INTEGER = 0x400000
|
||||
-- Declared as CURLINFO_SLIST
|
||||
|
||||
curlinfo_mask: INTEGER = 0x0fffff
|
||||
-- Declared as CURLINFO_MASK
|
||||
|
||||
curlinfo_typemask: INTEGER = 0xf00000
|
||||
-- Declared as CURLINFO_TYPEMASK
|
||||
|
||||
feature -- Info constants
|
||||
|
||||
curlinfo_effective_url: INTEGER = 0x100001 -- CURLINFO_STRING + 1,
|
||||
curlinfo_response_code: INTEGER = 0x200002 -- CURLINFO_LONG + 2,
|
||||
curlinfo_total_time: INTEGER = 0x300003 -- CURLINFO_DOUBLE + 3,
|
||||
curlinfo_namelookup_time: INTEGER = 0x300004 -- CURLINFO_DOUBLE + 4,
|
||||
curlinfo_connect_time: INTEGER = 0x300005 -- CURLINFO_DOUBLE + 5,
|
||||
curlinfo_pretransfer_time: INTEGER = 0x300006 -- CURLINFO_DOUBLE + 6,
|
||||
curlinfo_size_upload: INTEGER = 0x300007 -- CURLINFO_DOUBLE + 7,
|
||||
curlinfo_size_download: INTEGER = 0x300008 -- CURLINFO_DOUBLE + 8,
|
||||
curlinfo_speed_download: INTEGER = 0x300009 -- CURLINFO_DOUBLE + 9,
|
||||
curlinfo_speed_upload: INTEGER = 0x30000a -- CURLINFO_DOUBLE + 10,
|
||||
curlinfo_header_size: INTEGER = 0x20000b -- CURLINFO_LONG + 11,
|
||||
curlinfo_request_size: INTEGER = 0x20000c -- CURLINFO_LONG + 12,
|
||||
curlinfo_ssl_verifyresult: INTEGER = 0x20000d -- CURLINFO_LONG + 13,
|
||||
curlinfo_filetime: INTEGER = 0x20000e -- CURLINFO_LONG + 14,
|
||||
curlinfo_content_length_download: INTEGER = 0x30000f -- CURLINFO_DOUBLE + 15,
|
||||
curlinfo_content_length_upload: INTEGER = 0x300010 -- CURLINFO_DOUBLE + 16,
|
||||
curlinfo_starttransfer_time: INTEGER = 0x300011 -- CURLINFO_DOUBLE + 17,
|
||||
curlinfo_content_type: INTEGER = 0x100012 -- CURLINFO_STRING + 18,
|
||||
curlinfo_redirect_time: INTEGER = 0x300013 -- CURLINFO_DOUBLE + 19,
|
||||
curlinfo_redirect_count: INTEGER = 0x200014 -- CURLINFO_LONG + 20,
|
||||
curlinfo_private: INTEGER = 0x100015 -- CURLINFO_STRING + 21,
|
||||
curlinfo_http_connectcode: INTEGER = 0x200016 -- CURLINFO_LONG + 22,
|
||||
curlinfo_httpauth_avail: INTEGER = 0x200017 -- CURLINFO_LONG + 23,
|
||||
curlinfo_proxyauth_avail: INTEGER = 0x200018 -- CURLINFO_LONG + 24,
|
||||
curlinfo_os_errno: INTEGER = 0x200019 -- CURLINFO_LONG + 25,
|
||||
curlinfo_num_connects: INTEGER = 0x20001a -- CURLINFO_LONG + 26,
|
||||
curlinfo_ssl_engines: INTEGER = 0x40001b -- CURLINFO_SLIST + 27,
|
||||
curlinfo_cookielist: INTEGER = 0x40001c -- CURLINFO_SLIST + 28,
|
||||
curlinfo_lastsocket: INTEGER = 0x20001d -- CURLINFO_LONG + 29,
|
||||
curlinfo_ftp_entry_path: INTEGER = 0x10001e -- CURLINFO_STRING + 30,
|
||||
|
||||
feature -- Contract support
|
||||
|
||||
is_valid (a_code: INTEGER): BOOLEAN
|
||||
-- Is `a_code' valid?
|
||||
do
|
||||
inspect a_code
|
||||
when
|
||||
curlinfo_effective_url,
|
||||
curlinfo_response_code,
|
||||
curlinfo_total_time,
|
||||
curlinfo_namelookup_time,
|
||||
curlinfo_connect_time,
|
||||
curlinfo_pretransfer_time,
|
||||
curlinfo_size_upload,
|
||||
curlinfo_size_download,
|
||||
curlinfo_speed_download,
|
||||
curlinfo_speed_upload,
|
||||
curlinfo_header_size,
|
||||
curlinfo_request_size,
|
||||
curlinfo_ssl_verifyresult,
|
||||
curlinfo_filetime,
|
||||
curlinfo_content_length_download,
|
||||
curlinfo_content_length_upload,
|
||||
curlinfo_starttransfer_time,
|
||||
curlinfo_content_type,
|
||||
curlinfo_redirect_time,
|
||||
curlinfo_redirect_count,
|
||||
curlinfo_private,
|
||||
curlinfo_http_connectcode,
|
||||
curlinfo_httpauth_avail,
|
||||
curlinfo_proxyauth_avail,
|
||||
curlinfo_os_errno,
|
||||
curlinfo_num_connects,
|
||||
curlinfo_ssl_engines,
|
||||
curlinfo_cookielist,
|
||||
curlinfo_lastsocket,
|
||||
curlinfo_ftp_entry_path
|
||||
then
|
||||
Result := True
|
||||
else
|
||||
Result := False
|
||||
end
|
||||
end
|
||||
|
||||
note
|
||||
library: "cURL: Library of reusable components for Eiffel."
|
||||
copyright: "Copyright (c) 1984-2006, Eiffel Software and others"
|
||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||
source: "[
|
||||
Eiffel Software
|
||||
356 Storke Road, Goleta, CA 93117 USA
|
||||
Telephone 805-685-1006, Fax 805-685-6869
|
||||
Website http://www.eiffel.com
|
||||
Customer support http://support.eiffel.com
|
||||
]"
|
||||
|
||||
end
|
||||
@@ -1,69 +0,0 @@
|
||||
note
|
||||
description: "[
|
||||
cURL library info type constants.
|
||||
]"
|
||||
status: "See notice at end of class."
|
||||
legal: "See notice at end of class."
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
CURL_INFO_TYPE
|
||||
|
||||
feature -- Enumeration
|
||||
|
||||
curlinfo_text: INTEGER = 0
|
||||
-- Declared as CURLINFO_TEXT
|
||||
|
||||
curlinfo_header_in: INTEGER = 1
|
||||
-- Declared as CURLINFO_HEADER_IN
|
||||
|
||||
curlinfo_header_out: INTEGER = 2
|
||||
-- Declared as CURLINFO_HEADER_OUT
|
||||
|
||||
curlinfo_data_in: INTEGER = 3
|
||||
-- Declared as CURLINFO_DATA_IN
|
||||
|
||||
curlinfo_data_out: INTEGER = 4
|
||||
-- Declared as CURLINFO_DATA_OUT
|
||||
|
||||
curlinfo_ssl_data_in: INTEGER = 5
|
||||
-- Declared as CURLINFO_SSL_DATA_IN
|
||||
|
||||
curlinfo_ssl_data_out: INTEGER = 6
|
||||
-- Declared as CURLINFO_SSL_DATA_OUT
|
||||
|
||||
feature -- Contract support
|
||||
|
||||
is_valid (a_type: INTEGER): BOOLEAN
|
||||
-- If `a_type' valid?
|
||||
do
|
||||
inspect a_type
|
||||
when
|
||||
curlinfo_data_in,
|
||||
curlinfo_data_out,
|
||||
curlinfo_header_in,
|
||||
curlinfo_header_out,
|
||||
curlinfo_ssl_data_in,
|
||||
curlinfo_ssl_data_out,
|
||||
curlinfo_text
|
||||
then
|
||||
Result := True
|
||||
else
|
||||
Result := False
|
||||
end
|
||||
end
|
||||
|
||||
note
|
||||
library: "cURL: Library of reusable components for Eiffel."
|
||||
copyright: "Copyright (c) 1984-2006, Eiffel Software and others"
|
||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||
source: "[
|
||||
Eiffel Software
|
||||
356 Storke Road, Goleta, CA 93117 USA
|
||||
Telephone 805-685-1006, Fax 805-685-6869
|
||||
Website http://www.eiffel.com
|
||||
Customer support http://support.eiffel.com
|
||||
]"
|
||||
|
||||
end
|
||||
@@ -1,51 +0,0 @@
|
||||
note
|
||||
description: "[
|
||||
C CURLMSG enum
|
||||
]"
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
CURL_MSG
|
||||
|
||||
feature -- Query
|
||||
|
||||
curlmsg_done: INTEGER
|
||||
-- Declared as CURLMSG_DONE.
|
||||
-- This easy handle has completed.
|
||||
-- 'result' contains the CURLcode of the transfer
|
||||
external
|
||||
"C inline use <curl/curl.h>"
|
||||
alias
|
||||
"return CURLMSG_DONE;"
|
||||
end
|
||||
|
||||
curlmsg_none: INTEGER
|
||||
-- Declared as CURLMSG_NONE.
|
||||
-- First, not used
|
||||
external
|
||||
"C inline use <curl/curl.h>"
|
||||
alias
|
||||
"return CURLMSG_NONE;"
|
||||
end
|
||||
|
||||
curlmsg_last: INTEGER
|
||||
-- Declared as CURLMSG_LAST.
|
||||
-- Last, not used
|
||||
external
|
||||
"C inline use <curl/curl.h>"
|
||||
alias
|
||||
"return CURLMSG_LAST;"
|
||||
end
|
||||
|
||||
note
|
||||
copyright: "Copyright (c) 1984-2012, Eiffel Software and others"
|
||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||
source: "[
|
||||
Eiffel Software
|
||||
5949 Hollister Ave., Goleta, CA 93117 USA
|
||||
Telephone 805-685-1006, Fax 805-685-6869
|
||||
Website http://www.eiffel.com
|
||||
Customer support http://support.eiffel.com
|
||||
]"
|
||||
end
|
||||
@@ -1,83 +0,0 @@
|
||||
note
|
||||
description: "[
|
||||
|
||||
C Struct CURLMsg wrapper
|
||||
Read multi stack informationals
|
||||
|
||||
This class is used by {CURL_MSG_STRUCT}.info_read
|
||||
|
||||
More info:
|
||||
http://curl.haxx.se/libcurl/c/curl_multi_info_read.html
|
||||
]"
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
CURL_MSG_STRUCT
|
||||
|
||||
create
|
||||
make
|
||||
|
||||
feature {NONE} -- Initialization
|
||||
|
||||
make (a_pointer: POINTER)
|
||||
-- Creation method
|
||||
-- Bind message structure to the address `a_pointer'".
|
||||
require
|
||||
not_default: a_pointer /= default_pointer
|
||||
do
|
||||
item := a_pointer
|
||||
ensure
|
||||
set: item = a_pointer
|
||||
end
|
||||
|
||||
feature -- Query
|
||||
|
||||
curl_handle: POINTER
|
||||
-- CURL easy_handle
|
||||
-- The handle it concerns
|
||||
do
|
||||
Result := c_curl_handle (item)
|
||||
end
|
||||
|
||||
msg: INTEGER
|
||||
-- What does this message mean?
|
||||
-- It's one value from {CURLMSG}
|
||||
do
|
||||
Result := c_msg (item)
|
||||
end
|
||||
|
||||
feature {NONE} -- Implementation
|
||||
|
||||
item: POINTER
|
||||
-- C struct item
|
||||
|
||||
feature {NONE} -- C externals
|
||||
|
||||
c_curl_handle (a_item: POINTER): POINTER
|
||||
-- cURL easy handle it concerns
|
||||
external
|
||||
"C inline use <curl/curl.h>"
|
||||
alias
|
||||
"return (CURL *)((CURLMsg *)$a_item)->easy_handle;"
|
||||
end
|
||||
|
||||
c_msg (a_item: POINTER): INTEGER
|
||||
-- Get msg
|
||||
external
|
||||
"C inline use <curl/curl.h>"
|
||||
alias
|
||||
"return (CURLMSG)((CURLMsg *)$a_item)->msg;"
|
||||
end
|
||||
|
||||
;note
|
||||
copyright: "Copyright (c) 1984-2012, Eiffel Software and others"
|
||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||
source: "[
|
||||
Eiffel Software
|
||||
5949 Hollister Ave., Goleta, CA 93117 USA
|
||||
Telephone 805-685-1006, Fax 805-685-6869
|
||||
Website http://www.eiffel.com
|
||||
Customer support http://support.eiffel.com
|
||||
]"
|
||||
end
|
||||
@@ -1,48 +0,0 @@
|
||||
note
|
||||
description: "[
|
||||
The generic return code used by functions in the libcurl multi interface.
|
||||
Also consider curl_multi_strerror(3).
|
||||
]"
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
CURL_MULTI_CODES
|
||||
|
||||
feature -- Query
|
||||
|
||||
curlm_call_multi_perform: INTEGER = -1
|
||||
-- This is not really an error. It means you should call curl_multi_perform(3) again without doing select() or similar in between.
|
||||
|
||||
curlm_ok: INTEGER = 0
|
||||
-- Things are fine.
|
||||
|
||||
curlm_bad_handle: INTEGER = 1
|
||||
-- The passed-in handle is not a valid CURLM handle.
|
||||
|
||||
curlm_bad_easy_handle: INTEGER = 2
|
||||
-- An easy handle was not good/valid. It could mean that it isn't an easy handle at all, or possibly that the handle already is in used by this or another multi handle.
|
||||
|
||||
curlm_out_of_memory: INTEGER = 3
|
||||
-- You are doomed.
|
||||
|
||||
curlm_internal_error: INTEGER = 4
|
||||
-- This can only be returned if libcurl bugs. Please report it to us!
|
||||
|
||||
curlm_bad_socket: INTEGER = 5
|
||||
-- The passed-in socket is not a valid one that libcurl already knows about. (Added in 7.15.4)
|
||||
|
||||
curlm_unknown_option: INTEGER = 6
|
||||
-- curl_multi_setopt() with unsupported option (Added in 7.15.4)
|
||||
|
||||
note
|
||||
copyright: "Copyright (c) 1984-2012, Eiffel Software and others"
|
||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||
source: "[
|
||||
Eiffel Software
|
||||
5949 Hollister Ave., Goleta, CA 93117 USA
|
||||
Telephone 805-685-1006, Fax 805-685-6869
|
||||
Website http://www.eiffel.com
|
||||
Customer support http://support.eiffel.com
|
||||
]"
|
||||
end
|
||||
@@ -1,251 +0,0 @@
|
||||
note
|
||||
description: "[
|
||||
The multi interface offers several abilities that the easy interface doesn't. They are mainly:
|
||||
1. Enable a "pull" interface. The application that uses libcurl decides where and when to ask libcurl to get/send data.
|
||||
2. Enable multiple simultaneous transfers in the same thread without making it complicated for the application.
|
||||
3. Enable the application to wait for action on its own file descriptors and curl's file descriptors simultaneous easily.
|
||||
|
||||
More info: http://curl.haxx.se/libcurl/c/libcurl-multi.html
|
||||
]"
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
CURL_MULTI_EXTERNALS
|
||||
|
||||
feature -- Command
|
||||
|
||||
init
|
||||
-- Create a multi handle.
|
||||
-- If success, Result is a cURL multi hanlde just created.
|
||||
-- This feature maybe failed in some cases: cannot find required DLL, etc.
|
||||
-- Then the post condition would be violated.
|
||||
require
|
||||
dynamic_library_exists: is_dynamic_library_exists
|
||||
local
|
||||
l_api: POINTER
|
||||
do
|
||||
l_api := api_loader.api_pointer ("curl_multi_init")
|
||||
if l_api /= default_pointer then
|
||||
item := c_init (l_api)
|
||||
end
|
||||
end
|
||||
|
||||
add_handle (a_easy_handle: POINTER)
|
||||
-- Add an easy handle to a multi session.
|
||||
require
|
||||
dynamic_library_exists: is_dynamic_library_exists
|
||||
is_multi_handle_exists: is_exists
|
||||
local
|
||||
l_api: POINTER
|
||||
do
|
||||
l_api := api_loader.api_pointer ("curl_multi_add_handle")
|
||||
if l_api /= default_pointer then
|
||||
c_add_handle (l_api, item, a_easy_handle)
|
||||
end
|
||||
end
|
||||
|
||||
remove_handle (a_easy_handle: POINTER)
|
||||
-- Remove an easy handle from a multi session.
|
||||
require
|
||||
dynamic_library_exists: is_dynamic_library_exists
|
||||
is_multi_handle_exists: is_exists
|
||||
local
|
||||
l_api: POINTER
|
||||
do
|
||||
l_api := api_loader.api_pointer ("curl_multi_remove_handle")
|
||||
if l_api /= default_pointer then
|
||||
c_remove_handle (l_api, item, a_easy_handle)
|
||||
end
|
||||
end
|
||||
|
||||
cleanup: INTEGER
|
||||
-- Close down a multi session.
|
||||
-- Result is one value from {CURL_MULTI_CODES}.
|
||||
require
|
||||
dynamic_library_exists: is_dynamic_library_exists
|
||||
is_multi_handle_exists: is_exists
|
||||
local
|
||||
l_api: POINTER
|
||||
do
|
||||
l_api := api_loader.api_pointer ("curl_multi_cleanup")
|
||||
if l_api /= default_pointer then
|
||||
Result := c_cleanup (l_api, item)
|
||||
end
|
||||
end
|
||||
|
||||
perform (a_running_handle: CELL [INTEGER]): INTEGER
|
||||
-- Reads/writes available data from each easy handle.
|
||||
-- Result is one value from {CURL_MULTI_CODES}.
|
||||
require
|
||||
dynamic_library_exists: is_dynamic_library_exists
|
||||
is_multi_handle_exists: is_exists
|
||||
local
|
||||
l_api: POINTER
|
||||
l_running_handle: INTEGER
|
||||
do
|
||||
l_api := api_loader.api_pointer ("curl_multi_perform")
|
||||
if l_api /= default_pointer then
|
||||
Result := c_perform (l_api, item, $l_running_handle)
|
||||
a_running_handle.put (l_running_handle)
|
||||
end
|
||||
end
|
||||
|
||||
info_read (a_msgs_in_queue: CELL [INTEGER]): POINTER
|
||||
-- Read multi stack informationals.
|
||||
-- The result is C struct CURLMsg {CURL_MSG_STRUCT}.
|
||||
-- Repeated calls to this function will return a new struct each time, until a NULL
|
||||
-- is returned as a signal that there is no more to get at this point. The integer
|
||||
-- pointed to with msgs_in_queue will contain the number of remaining messages after
|
||||
-- this function was called.
|
||||
-- When you fetch a message using this function, it is removed from the internal queue
|
||||
-- so calling this function again will not return the same message again. It will instead
|
||||
-- return new messages at each new invoke until the queue is emptied.
|
||||
require
|
||||
dynamic_library_exists: is_dynamic_library_exists
|
||||
is_multi_handle_exists: is_exists
|
||||
local
|
||||
l_api: POINTER
|
||||
l_msgs_in_queue: INTEGER
|
||||
do
|
||||
l_api := api_loader.api_pointer ("curl_multi_info_read")
|
||||
if l_api /= default_pointer then
|
||||
Result := c_info_read (l_api, item, $l_msgs_in_queue)
|
||||
a_msgs_in_queue.put (l_msgs_in_queue)
|
||||
end
|
||||
end
|
||||
|
||||
is_dynamic_library_exists: BOOLEAN
|
||||
-- Are required .dll/.so files available?
|
||||
do
|
||||
Result := api_loader.is_interface_usable
|
||||
end
|
||||
|
||||
-- Feature not yet wrapped/tested
|
||||
-- curl_multi_assign
|
||||
-- curl_multi_fdset
|
||||
-- curl_multi_setopt
|
||||
-- curl_multi_socket
|
||||
-- curl_multi_socket_action
|
||||
-- curl_multi_strerror
|
||||
-- curl_multi_timeout
|
||||
|
||||
feature -- Query
|
||||
|
||||
is_exists: BOOLEAN
|
||||
-- If C pointer exists?
|
||||
do
|
||||
Result := item /= default_pointer
|
||||
end
|
||||
|
||||
feature {NONE} -- Implementation
|
||||
|
||||
item: POINTER
|
||||
-- C pointer item for cURL multi
|
||||
|
||||
feature {NONE} -- C externals
|
||||
|
||||
c_init (a_api: POINTER): POINTER
|
||||
-- Declared as curl_multi_init ().
|
||||
require
|
||||
exists: a_api /= default_pointer
|
||||
external
|
||||
"C inline use <curl/curl.h>"
|
||||
alias
|
||||
"[
|
||||
return (FUNCTION_CAST(CURLM *, ()) $a_api)();
|
||||
]"
|
||||
end
|
||||
|
||||
c_cleanup (a_api: POINTER; a_multi_handle: POINTER): INTEGER
|
||||
-- Declared as curl_multi_cleanup ().
|
||||
require
|
||||
exists: a_api /= default_pointer
|
||||
external
|
||||
"C inline use <curl/curl.h>"
|
||||
alias
|
||||
"[
|
||||
return (FUNCTION_CAST(CURLMcode, (CURLM *)) $a_api)
|
||||
((CURLM *)$a_multi_handle);
|
||||
]"
|
||||
end
|
||||
|
||||
c_add_handle (a_api: POINTER; a_multi_handle: POINTER; a_easy_handle: POINTER)
|
||||
-- Declared as curl_multi_add_handle ().
|
||||
require
|
||||
exists: a_api /= default_pointer
|
||||
external
|
||||
"C inline use <curl/curl.h>"
|
||||
alias
|
||||
"[
|
||||
(FUNCTION_CAST(void, (CURLM *, CURL *)) $a_api)
|
||||
((CURLM *) $a_multi_handle,
|
||||
(CURL *) $a_easy_handle);
|
||||
]"
|
||||
end
|
||||
|
||||
c_remove_handle (a_api: POINTER; a_multi_handle: POINTER; a_easy_handle: POINTER)
|
||||
-- Declared as curl_multi_remove_handle ().
|
||||
require
|
||||
exists: a_api /= default_pointer
|
||||
external
|
||||
"C inline use <curl/curl.h>"
|
||||
alias
|
||||
"[
|
||||
(FUNCTION_CAST(void, (CURLM *, CURL *)) $a_api)
|
||||
((CURLM *) $a_multi_handle,
|
||||
(CURL *) $a_easy_handle);
|
||||
]"
|
||||
end
|
||||
|
||||
c_perform (a_api: POINTER; a_multi_handle: POINTER; a_running_handles: TYPED_POINTER [INTEGER]): INTEGER
|
||||
-- Declared as curl_multi_perform.
|
||||
require
|
||||
exists: a_api /= default_pointer
|
||||
external
|
||||
"C inline use <curl/curl.h>"
|
||||
alias
|
||||
"[
|
||||
return (FUNCTION_CAST(CURLMcode, (CURLM *, int *)) $a_api)
|
||||
((CURLM *) $a_multi_handle,
|
||||
(int *) $a_running_handles);
|
||||
]"
|
||||
end
|
||||
|
||||
c_info_read (a_api: POINTER; a_multi_handle: POINTER; a_msgs_in_queue: TYPED_POINTER [INTEGER]): POINTER
|
||||
-- Declared as curl_multi_info_read.
|
||||
require
|
||||
exists: a_api /= default_pointer
|
||||
external
|
||||
"C inline use <curl/curl.h>"
|
||||
alias
|
||||
"[
|
||||
return (FUNCTION_CAST(CURLMsg *, (CURLM *, int *)) $a_api)
|
||||
((CURLM *) $a_multi_handle,
|
||||
(int *) $a_msgs_in_queue);
|
||||
]"
|
||||
end
|
||||
|
||||
feature {NONE} -- Implementation
|
||||
|
||||
api_loader: DYNAMIC_MODULE
|
||||
-- Module name.
|
||||
local
|
||||
l_utility: CURL_UTILITY
|
||||
once
|
||||
create l_utility
|
||||
Result := l_utility.api_loader
|
||||
end
|
||||
|
||||
|
||||
note
|
||||
copyright: "Copyright (c) 1984-2012, Eiffel Software and others"
|
||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||
source: "[
|
||||
Eiffel Software
|
||||
5949 Hollister Ave., Goleta, CA 93117 USA
|
||||
Telephone 805-685-1006, Fax 805-685-6869
|
||||
Website http://www.eiffel.com
|
||||
Customer support http://support.eiffel.com
|
||||
]"
|
||||
end
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,50 +0,0 @@
|
||||
note
|
||||
description: "[
|
||||
String used by cURL wrapper library.
|
||||
Only added features from IDENTIFIED.
|
||||
]"
|
||||
status: "See notice at end of class."
|
||||
legal: "See notice at end of class."
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
CURL_STRING
|
||||
|
||||
inherit
|
||||
STRING
|
||||
select
|
||||
is_equal,
|
||||
copy,
|
||||
out
|
||||
end
|
||||
|
||||
IDENTIFIED
|
||||
rename
|
||||
is_equal as identified_is_equal,
|
||||
copy as identified_copy,
|
||||
out as identified_out
|
||||
end
|
||||
|
||||
create
|
||||
make,
|
||||
make_empty,
|
||||
make_filled,
|
||||
make_from_string,
|
||||
make_from_c,
|
||||
make_from_cil
|
||||
|
||||
note
|
||||
library: "cURL: Library of reusable components for Eiffel."
|
||||
copyright: "Copyright (c) 1984-2006, Eiffel Software and others"
|
||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||
source: "[
|
||||
Eiffel Software
|
||||
356 Storke Road, Goleta, CA 93117 USA
|
||||
Telephone 805-685-1006, Fax 805-685-6869
|
||||
Website http://www.eiffel.com
|
||||
Customer support http://support.eiffel.com
|
||||
]"
|
||||
|
||||
end
|
||||
|
||||
@@ -1,51 +0,0 @@
|
||||
note
|
||||
description: "[
|
||||
Utilities for Eiffel cURL wrapper library.
|
||||
]"
|
||||
status: "See notice at end of class."
|
||||
legal: "See notice at end of class."
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
CURL_UTILITY
|
||||
|
||||
feature -- Query
|
||||
|
||||
api_loader: DYNAMIC_MODULE
|
||||
-- API dynamic loader
|
||||
local
|
||||
l_platform: PLATFORM
|
||||
once
|
||||
create l_platform
|
||||
if l_platform.is_unix or l_platform.is_mac then
|
||||
create Result.make_with_version (module_name, "3")
|
||||
else
|
||||
check is_window: l_platform.is_windows end
|
||||
create Result.make (module_name)
|
||||
end
|
||||
ensure
|
||||
not_void: Result /= Void
|
||||
end
|
||||
|
||||
module_name: STRING
|
||||
-- Module name.
|
||||
once
|
||||
Result := "libcurl"
|
||||
ensure
|
||||
not_void: Result /= Void
|
||||
end
|
||||
|
||||
note
|
||||
library: "cURL: Library of reusable components for Eiffel."
|
||||
copyright: "Copyright (c) 1984-2006, Eiffel Software and others"
|
||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||
source: "[
|
||||
Eiffel Software
|
||||
356 Storke Road, Goleta, CA 93117 USA
|
||||
Telephone 805-685-1006, Fax 805-685-6869
|
||||
Website http://www.eiffel.com
|
||||
Customer support http://support.eiffel.com
|
||||
]"
|
||||
|
||||
end
|
||||
@@ -1 +0,0 @@
|
||||
reference:forum2
|
||||
@@ -1,5 +0,0 @@
|
||||
When your Eiffel executable running, Eiffel cURL library needs 3 DLLs, they are:
|
||||
|
||||
libcurl.dll, libeay32.dll and ssleay32.dll
|
||||
|
||||
Please make sure the 3 DLLs files can be found in your environment PATH or in same folder of your executable.
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,67 +0,0 @@
|
||||
#ifndef __CURL_CURLVER_H
|
||||
#define __CURL_CURLVER_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2007, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
* $Id$
|
||||
***************************************************************************/
|
||||
|
||||
/* This header file contains nothing but libcurl version info, generated by
|
||||
a script at release-time. This was made its own header file in 7.11.2 */
|
||||
|
||||
/* This is the version number of the libcurl package from which this header
|
||||
file origins: */
|
||||
#define LIBCURL_VERSION "7.17.0"
|
||||
|
||||
/* The numeric version number is also available "in parts" by using these
|
||||
defines: */
|
||||
#define LIBCURL_VERSION_MAJOR 7
|
||||
#define LIBCURL_VERSION_MINOR 17
|
||||
#define LIBCURL_VERSION_PATCH 0
|
||||
|
||||
/* This is the numeric version of the libcurl version number, meant for easier
|
||||
parsing and comparions by programs. The LIBCURL_VERSION_NUM define will
|
||||
always follow this syntax:
|
||||
|
||||
0xXXYYZZ
|
||||
|
||||
Where XX, YY and ZZ are the main version, release and patch numbers in
|
||||
hexadecimal (using 8 bits each). All three numbers are always represented
|
||||
using two digits. 1.2 would appear as "0x010200" while version 9.11.7
|
||||
appears as "0x090b07".
|
||||
|
||||
This 6-digit (24 bits) hexadecimal number does not show pre-release number,
|
||||
and it is always a greater number in a more recent release. It makes
|
||||
comparisons with greater than and less than work.
|
||||
*/
|
||||
#define LIBCURL_VERSION_NUM 0x071100
|
||||
|
||||
/*
|
||||
* This is the date and time when the full source package was created. The
|
||||
* timestamp is not stored in CVS, as the timestamp is properly set in the
|
||||
* tarballs by the maketgz script.
|
||||
*
|
||||
* The format of the date should follow this template:
|
||||
*
|
||||
* "Mon Feb 12 11:35:33 UTC 2007"
|
||||
*/
|
||||
#define LIBCURL_TIMESTAMP "Thu Sep 13 20:22:24 UTC 2007"
|
||||
|
||||
#endif /* __CURL_CURLVER_H */
|
||||
@@ -1,81 +0,0 @@
|
||||
#ifndef __CURL_EASY_H
|
||||
#define __CURL_EASY_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2004, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
* $Id$
|
||||
***************************************************************************/
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
CURL_EXTERN CURL *curl_easy_init(void);
|
||||
CURL_EXTERN CURLcode curl_easy_setopt(CURL *curl, CURLoption option, ...);
|
||||
CURL_EXTERN CURLcode curl_easy_perform(CURL *curl);
|
||||
CURL_EXTERN void curl_easy_cleanup(CURL *curl);
|
||||
|
||||
/*
|
||||
* NAME curl_easy_getinfo()
|
||||
*
|
||||
* DESCRIPTION
|
||||
*
|
||||
* Request internal information from the curl session with this function. The
|
||||
* third argument MUST be a pointer to a long, a pointer to a char * or a
|
||||
* pointer to a double (as the documentation describes elsewhere). The data
|
||||
* pointed to will be filled in accordingly and can be relied upon only if the
|
||||
* function returns CURLE_OK. This function is intended to get used *AFTER* a
|
||||
* performed transfer, all results from this function are undefined until the
|
||||
* transfer is completed.
|
||||
*/
|
||||
CURL_EXTERN CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ...);
|
||||
|
||||
|
||||
/*
|
||||
* NAME curl_easy_duphandle()
|
||||
*
|
||||
* DESCRIPTION
|
||||
*
|
||||
* Creates a new curl session handle with the same options set for the handle
|
||||
* passed in. Duplicating a handle could only be a matter of cloning data and
|
||||
* options, internal state info and things like persistant connections cannot
|
||||
* be transfered. It is useful in multithreaded applications when you can run
|
||||
* curl_easy_duphandle() for each new thread to avoid a series of identical
|
||||
* curl_easy_setopt() invokes in every thread.
|
||||
*/
|
||||
CURL_EXTERN CURL* curl_easy_duphandle(CURL *curl);
|
||||
|
||||
/*
|
||||
* NAME curl_easy_reset()
|
||||
*
|
||||
* DESCRIPTION
|
||||
*
|
||||
* Re-initializes a CURL handle to the default values. This puts back the
|
||||
* handle to the same state as it was in when it was just created.
|
||||
*
|
||||
* It does keep: live connections, the Session ID cache, the DNS cache and the
|
||||
* cookies.
|
||||
*/
|
||||
CURL_EXTERN void curl_easy_reset(CURL *curl);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -1,80 +0,0 @@
|
||||
#ifndef __CURL_MPRINTF_H
|
||||
#define __CURL_MPRINTF_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2006, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
* $Id$
|
||||
***************************************************************************/
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h> /* needed for FILE */
|
||||
|
||||
#include "curl.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
CURL_EXTERN int curl_mprintf(const char *format, ...);
|
||||
CURL_EXTERN int curl_mfprintf(FILE *fd, const char *format, ...);
|
||||
CURL_EXTERN int curl_msprintf(char *buffer, const char *format, ...);
|
||||
CURL_EXTERN int curl_msnprintf(char *buffer, size_t maxlength, const char *format, ...);
|
||||
CURL_EXTERN int curl_mvprintf(const char *format, va_list args);
|
||||
CURL_EXTERN int curl_mvfprintf(FILE *fd, const char *format, va_list args);
|
||||
CURL_EXTERN int curl_mvsprintf(char *buffer, const char *format, va_list args);
|
||||
CURL_EXTERN int curl_mvsnprintf(char *buffer, size_t maxlength, const char *format, va_list args);
|
||||
CURL_EXTERN char *curl_maprintf(const char *format, ...);
|
||||
CURL_EXTERN char *curl_mvaprintf(const char *format, va_list args);
|
||||
|
||||
#ifdef _MPRINTF_REPLACE
|
||||
# undef printf
|
||||
# undef fprintf
|
||||
# undef sprintf
|
||||
# undef vsprintf
|
||||
# undef snprintf
|
||||
# undef vprintf
|
||||
# undef vfprintf
|
||||
# undef vsnprintf
|
||||
# undef aprintf
|
||||
# undef vaprintf
|
||||
# define printf curl_mprintf
|
||||
# define fprintf curl_mfprintf
|
||||
#ifdef CURLDEBUG
|
||||
/* When built with CURLDEBUG we define away the sprintf() functions since we
|
||||
don't want internal code to be using them */
|
||||
# define sprintf sprintf_was_used
|
||||
# define vsprintf vsprintf_was_used
|
||||
#else
|
||||
# define sprintf curl_msprintf
|
||||
# define vsprintf curl_mvsprintf
|
||||
#endif
|
||||
# define snprintf curl_msnprintf
|
||||
# define vprintf curl_mvprintf
|
||||
# define vfprintf curl_mvfprintf
|
||||
# define vsnprintf curl_mvsnprintf
|
||||
# define aprintf curl_maprintf
|
||||
# define vaprintf curl_mvaprintf
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __CURL_MPRINTF_H */
|
||||
@@ -1,346 +0,0 @@
|
||||
#ifndef __CURL_MULTI_H
|
||||
#define __CURL_MULTI_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2007, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
* $Id$
|
||||
***************************************************************************/
|
||||
/*
|
||||
This is an "external" header file. Don't give away any internals here!
|
||||
|
||||
GOALS
|
||||
|
||||
o Enable a "pull" interface. The application that uses libcurl decides where
|
||||
and when to ask libcurl to get/send data.
|
||||
|
||||
o Enable multiple simultaneous transfers in the same thread without making it
|
||||
complicated for the application.
|
||||
|
||||
o Enable the application to select() on its own file descriptors and curl's
|
||||
file descriptors simultaneous easily.
|
||||
|
||||
*/
|
||||
|
||||
/*
|
||||
* This header file should not really need to include "curl.h" since curl.h
|
||||
* itself includes this file and we expect user applications to do #include
|
||||
* <curl/curl.h> without the need for especially including multi.h.
|
||||
*
|
||||
* For some reason we added this include here at one point, and rather than to
|
||||
* break existing (wrongly written) libcurl applications, we leave it as-is
|
||||
* but with this warning attached.
|
||||
*/
|
||||
#include "curl.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef void CURLM;
|
||||
|
||||
typedef enum {
|
||||
CURLM_CALL_MULTI_PERFORM = -1, /* please call curl_multi_perform() or
|
||||
curl_multi_socket*() soon */
|
||||
CURLM_OK,
|
||||
CURLM_BAD_HANDLE, /* the passed-in handle is not a valid CURLM handle */
|
||||
CURLM_BAD_EASY_HANDLE, /* an easy handle was not good/valid */
|
||||
CURLM_OUT_OF_MEMORY, /* if you ever get this, you're in deep sh*t */
|
||||
CURLM_INTERNAL_ERROR, /* this is a libcurl bug */
|
||||
CURLM_BAD_SOCKET, /* the passed in socket argument did not match */
|
||||
CURLM_UNKNOWN_OPTION, /* curl_multi_setopt() with unsupported option */
|
||||
CURLM_LAST
|
||||
} CURLMcode;
|
||||
|
||||
/* just to make code nicer when using curl_multi_socket() you can now check
|
||||
for CURLM_CALL_MULTI_SOCKET too in the same style it works for
|
||||
curl_multi_perform() and CURLM_CALL_MULTI_PERFORM */
|
||||
#define CURLM_CALL_MULTI_SOCKET CURLM_CALL_MULTI_PERFORM
|
||||
|
||||
typedef enum {
|
||||
CURLMSG_NONE, /* first, not used */
|
||||
CURLMSG_DONE, /* This easy handle has completed. 'result' contains
|
||||
the CURLcode of the transfer */
|
||||
CURLMSG_LAST /* last, not used */
|
||||
} CURLMSG;
|
||||
|
||||
struct CURLMsg {
|
||||
CURLMSG msg; /* what this message means */
|
||||
CURL *easy_handle; /* the handle it concerns */
|
||||
union {
|
||||
void *whatever; /* message-specific data */
|
||||
CURLcode result; /* return code for transfer */
|
||||
} data;
|
||||
};
|
||||
typedef struct CURLMsg CURLMsg;
|
||||
|
||||
/*
|
||||
* Name: curl_multi_init()
|
||||
*
|
||||
* Desc: inititalize multi-style curl usage
|
||||
*
|
||||
* Returns: a new CURLM handle to use in all 'curl_multi' functions.
|
||||
*/
|
||||
CURL_EXTERN CURLM *curl_multi_init(void);
|
||||
|
||||
/*
|
||||
* Name: curl_multi_add_handle()
|
||||
*
|
||||
* Desc: add a standard curl handle to the multi stack
|
||||
*
|
||||
* Returns: CURLMcode type, general multi error code.
|
||||
*/
|
||||
CURL_EXTERN CURLMcode curl_multi_add_handle(CURLM *multi_handle,
|
||||
CURL *curl_handle);
|
||||
|
||||
/*
|
||||
* Name: curl_multi_remove_handle()
|
||||
*
|
||||
* Desc: removes a curl handle from the multi stack again
|
||||
*
|
||||
* Returns: CURLMcode type, general multi error code.
|
||||
*/
|
||||
CURL_EXTERN CURLMcode curl_multi_remove_handle(CURLM *multi_handle,
|
||||
CURL *curl_handle);
|
||||
|
||||
/*
|
||||
* Name: curl_multi_fdset()
|
||||
*
|
||||
* Desc: Ask curl for its fd_set sets. The app can use these to select() or
|
||||
* poll() on. We want curl_multi_perform() called as soon as one of
|
||||
* them are ready.
|
||||
*
|
||||
* Returns: CURLMcode type, general multi error code.
|
||||
*/
|
||||
CURL_EXTERN CURLMcode curl_multi_fdset(CURLM *multi_handle,
|
||||
fd_set *read_fd_set,
|
||||
fd_set *write_fd_set,
|
||||
fd_set *exc_fd_set,
|
||||
int *max_fd);
|
||||
|
||||
/*
|
||||
* Name: curl_multi_perform()
|
||||
*
|
||||
* Desc: When the app thinks there's data available for curl it calls this
|
||||
* function to read/write whatever there is right now. This returns
|
||||
* as soon as the reads and writes are done. This function does not
|
||||
* require that there actually is data available for reading or that
|
||||
* data can be written, it can be called just in case. It returns
|
||||
* the number of handles that still transfer data in the second
|
||||
* argument's integer-pointer.
|
||||
*
|
||||
* Returns: CURLMcode type, general multi error code. *NOTE* that this only
|
||||
* returns errors etc regarding the whole multi stack. There might
|
||||
* still have occurred problems on invidual transfers even when this
|
||||
* returns OK.
|
||||
*/
|
||||
CURL_EXTERN CURLMcode curl_multi_perform(CURLM *multi_handle,
|
||||
int *running_handles);
|
||||
|
||||
/*
|
||||
* Name: curl_multi_cleanup()
|
||||
*
|
||||
* Desc: Cleans up and removes a whole multi stack. It does not free or
|
||||
* touch any individual easy handles in any way. We need to define
|
||||
* in what state those handles will be if this function is called
|
||||
* in the middle of a transfer.
|
||||
*
|
||||
* Returns: CURLMcode type, general multi error code.
|
||||
*/
|
||||
CURL_EXTERN CURLMcode curl_multi_cleanup(CURLM *multi_handle);
|
||||
|
||||
/*
|
||||
* Name: curl_multi_info_read()
|
||||
*
|
||||
* Desc: Ask the multi handle if there's any messages/informationals from
|
||||
* the individual transfers. Messages include informationals such as
|
||||
* error code from the transfer or just the fact that a transfer is
|
||||
* completed. More details on these should be written down as well.
|
||||
*
|
||||
* Repeated calls to this function will return a new struct each
|
||||
* time, until a special "end of msgs" struct is returned as a signal
|
||||
* that there is no more to get at this point.
|
||||
*
|
||||
* The data the returned pointer points to will not survive calling
|
||||
* curl_multi_cleanup().
|
||||
*
|
||||
* The 'CURLMsg' struct is meant to be very simple and only contain
|
||||
* very basic informations. If more involved information is wanted,
|
||||
* we will provide the particular "transfer handle" in that struct
|
||||
* and that should/could/would be used in subsequent
|
||||
* curl_easy_getinfo() calls (or similar). The point being that we
|
||||
* must never expose complex structs to applications, as then we'll
|
||||
* undoubtably get backwards compatibility problems in the future.
|
||||
*
|
||||
* Returns: A pointer to a filled-in struct, or NULL if it failed or ran out
|
||||
* of structs. It also writes the number of messages left in the
|
||||
* queue (after this read) in the integer the second argument points
|
||||
* to.
|
||||
*/
|
||||
CURL_EXTERN CURLMsg *curl_multi_info_read(CURLM *multi_handle,
|
||||
int *msgs_in_queue);
|
||||
|
||||
/*
|
||||
* Name: curl_multi_strerror()
|
||||
*
|
||||
* Desc: The curl_multi_strerror function may be used to turn a CURLMcode
|
||||
* value into the equivalent human readable error string. This is
|
||||
* useful for printing meaningful error messages.
|
||||
*
|
||||
* Returns: A pointer to a zero-terminated error message.
|
||||
*/
|
||||
CURL_EXTERN const char *curl_multi_strerror(CURLMcode);
|
||||
|
||||
/*
|
||||
* Name: curl_multi_socket() and
|
||||
* curl_multi_socket_all()
|
||||
*
|
||||
* Desc: An alternative version of curl_multi_perform() that allows the
|
||||
* application to pass in one of the file descriptors that have been
|
||||
* detected to have "action" on them and let libcurl perform.
|
||||
* See man page for details.
|
||||
*/
|
||||
#define CURL_POLL_NONE 0
|
||||
#define CURL_POLL_IN 1
|
||||
#define CURL_POLL_OUT 2
|
||||
#define CURL_POLL_INOUT 3
|
||||
#define CURL_POLL_REMOVE 4
|
||||
|
||||
#define CURL_SOCKET_TIMEOUT CURL_SOCKET_BAD
|
||||
|
||||
#define CURL_CSELECT_IN 0x01
|
||||
#define CURL_CSELECT_OUT 0x02
|
||||
#define CURL_CSELECT_ERR 0x04
|
||||
|
||||
typedef int (*curl_socket_callback)(CURL *easy, /* easy handle */
|
||||
curl_socket_t s, /* socket */
|
||||
int what, /* see above */
|
||||
void *userp, /* private callback
|
||||
pointer */
|
||||
void *socketp); /* private socket
|
||||
pointer */
|
||||
/*
|
||||
* Name: curl_multi_timer_callback
|
||||
*
|
||||
* Desc: Called by libcurl whenever the library detects a change in the
|
||||
* maximum number of milliseconds the app is allowed to wait before
|
||||
* curl_multi_socket() or curl_multi_perform() must be called
|
||||
* (to allow libcurl's timed events to take place).
|
||||
*
|
||||
* Returns: The callback should return zero.
|
||||
*/
|
||||
typedef int (*curl_multi_timer_callback)(CURLM *multi, /* multi handle */
|
||||
long timeout_ms, /* see above */
|
||||
void *userp); /* private callback
|
||||
pointer */
|
||||
|
||||
CURL_EXTERN CURLMcode curl_multi_socket(CURLM *multi_handle, curl_socket_t s,
|
||||
int *running_handles);
|
||||
|
||||
CURL_EXTERN CURLMcode curl_multi_socket_action(CURLM *multi_handle,
|
||||
curl_socket_t s,
|
||||
int ev_bitmask,
|
||||
int *running_handles);
|
||||
|
||||
CURL_EXTERN CURLMcode curl_multi_socket_all(CURLM *multi_handle,
|
||||
int *running_handles);
|
||||
|
||||
#ifndef CURL_ALLOW_OLD_MULTI_SOCKET
|
||||
/* This macro below was added in 7.16.3 to push users who recompile to use
|
||||
the new curl_multi_socket_action() instead of the old curl_multi_socket()
|
||||
*/
|
||||
#define curl_multi_socket(x,y,z) curl_multi_socket_action(x,y,0,z)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Name: curl_multi_timeout()
|
||||
*
|
||||
* Desc: Returns the maximum number of milliseconds the app is allowed to
|
||||
* wait before curl_multi_socket() or curl_multi_perform() must be
|
||||
* called (to allow libcurl's timed events to take place).
|
||||
*
|
||||
* Returns: CURLM error code.
|
||||
*/
|
||||
CURL_EXTERN CURLMcode curl_multi_timeout(CURLM *multi_handle,
|
||||
long *milliseconds);
|
||||
|
||||
#undef CINIT /* re-using the same name as in curl.h */
|
||||
|
||||
#ifdef CURL_ISOCPP
|
||||
#define CINIT(name,type,number) CURLMOPT_ ## name = CURLOPTTYPE_ ## type + number
|
||||
#else
|
||||
/* The macro "##" is ISO C, we assume pre-ISO C doesn't support it. */
|
||||
#define LONG CURLOPTTYPE_LONG
|
||||
#define OBJECTPOINT CURLOPTTYPE_OBJECTPOINT
|
||||
#define FUNCTIONPOINT CURLOPTTYPE_FUNCTIONPOINT
|
||||
#define OFF_T CURLOPTTYPE_OFF_T
|
||||
#define CINIT(name,type,number) CURLMOPT_/**/name = type + number
|
||||
#endif
|
||||
|
||||
typedef enum {
|
||||
/* This is the socket callback function pointer */
|
||||
CINIT(SOCKETFUNCTION, FUNCTIONPOINT, 1),
|
||||
|
||||
/* This is the argument passed to the socket callback */
|
||||
CINIT(SOCKETDATA, OBJECTPOINT, 2),
|
||||
|
||||
/* set to 1 to enable pipelining for this multi handle */
|
||||
CINIT(PIPELINING, LONG, 3),
|
||||
|
||||
/* This is the timer callback function pointer */
|
||||
CINIT(TIMERFUNCTION, FUNCTIONPOINT, 4),
|
||||
|
||||
/* This is the argument passed to the timer callback */
|
||||
CINIT(TIMERDATA, OBJECTPOINT, 5),
|
||||
|
||||
/* maximum number of entries in the connection cache */
|
||||
CINIT(MAXCONNECTS, LONG, 6),
|
||||
|
||||
CURLMOPT_LASTENTRY /* the last unused */
|
||||
} CURLMoption;
|
||||
|
||||
|
||||
/*
|
||||
* Name: curl_multi_setopt()
|
||||
*
|
||||
* Desc: Sets options for the multi handle.
|
||||
*
|
||||
* Returns: CURLM error code.
|
||||
*/
|
||||
CURL_EXTERN CURLMcode curl_multi_setopt(CURLM *multi_handle,
|
||||
CURLMoption option, ...);
|
||||
|
||||
|
||||
/*
|
||||
* Name: curl_multi_assign()
|
||||
*
|
||||
* Desc: This function sets an association in the multi handle between the
|
||||
* given socket and a private pointer of the application. This is
|
||||
* (only) useful for curl_multi_socket uses.
|
||||
*
|
||||
* Returns: CURLM error code.
|
||||
*/
|
||||
CURL_EXTERN CURLMcode curl_multi_assign(CURLM *multi_handle,
|
||||
curl_socket_t sockfd, void *sockp);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* end of extern "C" */
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -1,34 +0,0 @@
|
||||
#ifndef __STDC_HEADERS_H
|
||||
#define __STDC_HEADERS_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2004, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
* $Id$
|
||||
***************************************************************************/
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
size_t fread (void *, size_t, size_t, FILE *);
|
||||
size_t fwrite (const void *, size_t, size_t, FILE *);
|
||||
|
||||
int strcasecmp(const char *, const char *);
|
||||
int strncasecmp(const char *, const char *, size_t);
|
||||
|
||||
#endif
|
||||
@@ -1 +0,0 @@
|
||||
/* not used */
|
||||
@@ -1,47 +0,0 @@
|
||||
/*
|
||||
indexing
|
||||
description: "Functions used by the class CURL_FUNCTION."
|
||||
copyright: "Copyright (c) 1984-2006, Eiffel Software and others"
|
||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||
source: "[
|
||||
Eiffel Software
|
||||
356 Storke Road, Goleta, CA 93117 USA
|
||||
Telephone 805-685-1006, Fax 805-685-6869
|
||||
Website http://www.eiffel.com
|
||||
Customer support http://support.eiffel.com
|
||||
]"
|
||||
*/
|
||||
|
||||
#ifndef _eiffel_curl_h_
|
||||
#define _eiffel_curl_h_
|
||||
|
||||
#include "eif_eiffel.h"
|
||||
|
||||
/* unix-specific */
|
||||
#ifndef EIF_WINDOWS
|
||||
#include <sys/time.h>
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include <curl/curl.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern void c_set_object(EIF_REFERENCE a_address);
|
||||
extern void c_release_object(void);
|
||||
extern void c_set_progress_function_address( EIF_POINTER a_address);
|
||||
extern void c_set_read_function_address( EIF_POINTER a_address);
|
||||
extern void c_set_write_function_address( EIF_POINTER a_address);
|
||||
extern void c_set_debug_function_address (EIF_POINTER a_address);
|
||||
extern size_t curl_write_function (void *ptr, size_t size, size_t nmemb, void *data);
|
||||
extern size_t curl_read_function (void *ptr, size_t size, size_t nmemb, void *data);
|
||||
extern size_t curl_progress_function (void * a_object_id, double a_dltotal, double a_dlnow, double a_ultotal, double a_ulnow);
|
||||
extern size_t curl_debug_function (CURL * a_curl_handle, curl_infotype a_curl_infotype, unsigned char * a_char_pointer, size_t a_size, void * a_object_id);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,83 @@
|
||||
note
|
||||
description: "Summary description for {TCP_STREAM_SOCKET}."
|
||||
date: "$Date: 2015-02-16 19:53:13 +0100 (lun., 16 févr. 2015) $"
|
||||
revision: "$Revision: 96642 $"
|
||||
|
||||
class
|
||||
TCP_STREAM_SOCKET
|
||||
|
||||
inherit
|
||||
NETWORK_STREAM_SOCKET
|
||||
redefine
|
||||
make
|
||||
end
|
||||
|
||||
create
|
||||
make_server_by_address_and_port,
|
||||
make_server_by_port
|
||||
|
||||
create {NETWORK_STREAM_SOCKET}
|
||||
make_from_descriptor_and_address,
|
||||
make_empty
|
||||
|
||||
feature {NONE} -- Initialization
|
||||
|
||||
make_server_by_address_and_port (a_address: INET_ADDRESS; a_port: INTEGER)
|
||||
-- Create server socket on `a_address' and `a_port'.
|
||||
require
|
||||
valid_port: a_port >= 0
|
||||
do
|
||||
make
|
||||
create address.make_from_address_and_port (a_address, a_port)
|
||||
bind
|
||||
end
|
||||
|
||||
make
|
||||
-- Create a network stream socket.
|
||||
do
|
||||
Precursor
|
||||
set_reuse_address
|
||||
end
|
||||
|
||||
feature -- Basic operation
|
||||
|
||||
send_message (a_msg: STRING)
|
||||
local
|
||||
a_package : PACKET
|
||||
a_data : MANAGED_POINTER
|
||||
c_string : C_STRING
|
||||
do
|
||||
create c_string.make (a_msg)
|
||||
create a_data.make_from_pointer (c_string.item, a_msg.count + 1)
|
||||
create a_package.make_from_managed_pointer (a_data)
|
||||
send (a_package, 1)
|
||||
end
|
||||
|
||||
feature -- Output
|
||||
|
||||
put_readable_string_8 (s: READABLE_STRING_8)
|
||||
-- Write readable string `s' to socket.
|
||||
local
|
||||
ext: C_STRING
|
||||
do
|
||||
create ext.make (s)
|
||||
put_managed_pointer (ext.managed_data, 0, s.count)
|
||||
end
|
||||
|
||||
feature -- Status report
|
||||
|
||||
try_ready_for_reading: BOOLEAN
|
||||
-- Is data available for reading from the socket right now?
|
||||
require
|
||||
socket_exists: exists
|
||||
local
|
||||
retval: INTEGER
|
||||
do
|
||||
retval := c_select_poll_with_timeout (descriptor, True, 0)
|
||||
Result := (retval > 0)
|
||||
end
|
||||
|
||||
note
|
||||
copyright: "2011-2015, Javier Velilla and others"
|
||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||
end
|
||||
@@ -8,24 +8,25 @@ class
|
||||
|
||||
inherit
|
||||
NETWORK_STREAM_SOCKET
|
||||
redefine
|
||||
make
|
||||
end
|
||||
|
||||
create
|
||||
make_server_by_address_and_port,
|
||||
make_server_by_port
|
||||
|
||||
create {NETWORK_STREAM_SOCKET}
|
||||
make_from_descriptor_and_address
|
||||
make_from_descriptor_and_address,
|
||||
make_empty
|
||||
|
||||
feature {NONE} -- Initialization
|
||||
|
||||
make_server_by_address_and_port (an_address: INET_ADDRESS; a_port: INTEGER)
|
||||
-- Create server socket on `an_address' and `a_port'.
|
||||
require
|
||||
valid_port: a_port >= 0
|
||||
do
|
||||
make
|
||||
create address.make_from_address_and_port (an_address, a_port)
|
||||
bind
|
||||
-- Create a network stream socket.
|
||||
do
|
||||
Precursor
|
||||
set_reuse_address
|
||||
end
|
||||
|
||||
feature -- Basic operation
|
||||
@@ -67,6 +68,6 @@ feature -- Status report
|
||||
end
|
||||
|
||||
note
|
||||
copyright: "2011-2011, Javier Velilla and others"
|
||||
copyright: "2011-2015, Javier Velilla and others"
|
||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||
end
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-8-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-8-0 http://www.eiffel.com/developers/xml/configuration-1-8-0.xsd" name="nino" uuid="32C1D67D-33DE-4F1E-864B-D45388F2E3E6" library_target="nino">
|
||||
<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-12-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-12-0 http://www.eiffel.com/developers/xml/configuration-1-12-0.xsd" name="nino" uuid="32C1D67D-33DE-4F1E-864B-D45388F2E3E6" library_target="nino">
|
||||
<target name="nino">
|
||||
<root all_classes="true"/>
|
||||
<file_rule>
|
||||
@@ -8,13 +8,28 @@
|
||||
<exclude>/CVS$</exclude>
|
||||
<exclude>/.svn$</exclude>
|
||||
</file_rule>
|
||||
<option warning="true" is_attached_by_default="true" void_safety="all">
|
||||
<option warning="true" full_class_checking="false" is_attached_by_default="true" void_safety="all" syntax="transitional">
|
||||
<assertions precondition="true" postcondition="true" check="true" invariant="true" loop="true" supplier_precondition="true"/>
|
||||
</option>
|
||||
<setting name="concurrency" value="thread"/>
|
||||
<library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/>
|
||||
<library name="net" location="$ISE_LIBRARY\library\net\net-safe.ecf"/>
|
||||
<library name="thread" location="$ISE_LIBRARY\library\thread\thread-safe.ecf"/>
|
||||
<cluster name="nino" location=".\library\" recursive="true"/>
|
||||
<cluster name="nino" location=".\library\" recursive="true">
|
||||
<file_rule>
|
||||
<exclude>spec</exclude>
|
||||
</file_rule>
|
||||
<file_rule>
|
||||
<exclude>tcp_stream_socket.e</exclude>
|
||||
<condition>
|
||||
<version type="compiler" max="16.11"/>
|
||||
</condition>
|
||||
</file_rule>
|
||||
</cluster>
|
||||
<cluster name="spec_until_16_05" location=".\library\spec\until_16_05\" recursive="true">
|
||||
<condition>
|
||||
<version type="compiler" max="16.11"/>
|
||||
</condition>
|
||||
</cluster>
|
||||
</target>
|
||||
</system>
|
||||
|
||||
@@ -15,6 +15,21 @@
|
||||
<library name="base" location="$ISE_LIBRARY\library\base\base.ecf"/>
|
||||
<library name="net" location="$ISE_LIBRARY\library\net\net.ecf"/>
|
||||
<library name="thread" location="$ISE_LIBRARY\library\thread\thread.ecf"/>
|
||||
<cluster name="nino" location=".\library\" recursive="true"/>
|
||||
<cluster name="nino" location=".\library\" recursive="true">
|
||||
<file_rule>
|
||||
<exclude>spec</exclude>
|
||||
</file_rule>
|
||||
<file_rule>
|
||||
<exclude>tcp_stream_socket.e</exclude>
|
||||
<condition>
|
||||
<version type="compiler" max="16.11"/>
|
||||
</condition>
|
||||
</file_rule>
|
||||
</cluster>
|
||||
<cluster name="spec_until_16_05" location=".\library\spec\until_16_05\" recursive="true">
|
||||
<condition>
|
||||
<version type="compiler" max="16.11"/>
|
||||
</condition>
|
||||
</cluster>
|
||||
</target>
|
||||
</system>
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
|
||||
15
contrib/library/network/server/nino/package.iron
Normal file
15
contrib/library/network/server/nino/package.iron
Normal file
@@ -0,0 +1,15 @@
|
||||
package nino
|
||||
|
||||
project
|
||||
nino = "nino-safe.ecf"
|
||||
nino = "nino.ecf"
|
||||
|
||||
note
|
||||
title: Eiffel Nino Web Server
|
||||
description: Simple HTTPd server written in Eiffel
|
||||
tags: web, httpd, server
|
||||
copyright: Javier Velilla, Jocelyn Fiat and Eiffel Software.
|
||||
license: Eiffel Forum v2
|
||||
link[license]: http://www.eiffel.com/licensing/forum.txt
|
||||
|
||||
end
|
||||
2
contrib/library/text/parser/json/.gitignore
vendored
2
contrib/library/text/parser/json/.gitignore
vendored
@@ -1,2 +0,0 @@
|
||||
*.swp
|
||||
EIFGENs
|
||||
@@ -1,26 +0,0 @@
|
||||
History file for EJSON
|
||||
======================
|
||||
|
||||
team: ""
|
||||
date: "2011-07-06"
|
||||
revision: "0.3.0"
|
||||
|
||||
|
||||
+++++++++++++++++++++Important Changes since 0.2.0 version++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
*Updated skip_white_spaces, now check %U and %T codes
|
||||
|
||||
*Undo changes to is_a_valid_number, because it's doesn't follow the
|
||||
JSON spec. Tests : fail13.json, fail29.json and fail30.json are valid
|
||||
with this implementation, so we go back to the previous
|
||||
implementation.
|
||||
|
||||
*Added autotest test suite
|
||||
|
||||
*Added getest based test program
|
||||
|
||||
*Updated Eiffel configuration file, updated to the new clusters
|
||||
|
||||
*Added converters and factory classes
|
||||
|
||||
*Added new top level directories; library, test, build and example
|
||||
@@ -1,20 +0,0 @@
|
||||
Copyright (c) 2010 Javier Velilla and others, http://ejson.origo.ethz.ch
|
||||
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
@@ -1,97 +0,0 @@
|
||||
Readme file for eJSON
|
||||
=====================
|
||||
|
||||
team: "Javier Velilla,Jocelyn Fiat, Paul Cohen"
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
1. Introduction
|
||||
---------------
|
||||
|
||||
eJSON stands for Eiffel JSON library and is a small Eiffel library for dealing
|
||||
with the JSON format. The objective of the library is to provide two basic
|
||||
features Eiffel2JSON and JSON2Eiffel.
|
||||
|
||||
2. Legal stuff
|
||||
--------------
|
||||
|
||||
eJSON is copyrighted by the author Javier Velilla and others. It is licensed
|
||||
under the MIT License. See the file license.txt in the same directory as this
|
||||
readme file.
|
||||
|
||||
3. Versioning scheme
|
||||
--------------------
|
||||
|
||||
eJSON version numbers has the form:
|
||||
|
||||
«major number».«minor number».«patch level»
|
||||
|
||||
eJSON will retain the major number 0 as long as it has beta status. A change in
|
||||
major number indicates that a release is not backward compatible. A change in
|
||||
minor number indicates that a release is backward compatible (within that major
|
||||
number) but that new useful features may have been added. A change in patch
|
||||
level simply indicates that the release contains bug fixes for the previous
|
||||
release. Note that as long as eJSON is in beta status (0.Y.Z) backward
|
||||
compatibility is not guranteed for changes in minor numbers!
|
||||
|
||||
4. Documentation
|
||||
---------------
|
||||
|
||||
Currently the only documentation on eJSON is available at:
|
||||
|
||||
https://github.com/eiffelhub/json/wiki/User-guide
|
||||
|
||||
5. Requirements and installation
|
||||
--------------------------------
|
||||
|
||||
EJSON requires that you have:
|
||||
|
||||
1. Gobo 3.9 installed or later
|
||||
2. One of the following compiler combinations installed:
|
||||
* ISE Eiffel 6.5 or later.
|
||||
* gec [try to test]
|
||||
* tecomp [try to test]
|
||||
|
||||
eJSON probably works fine with other versions of the above compilers.
|
||||
There are no known platform dependencies (Windows, Linux).
|
||||
|
||||
To install eJSON simply extract the ejson-X.Y.Z.zip file to some appropriate
|
||||
place on your hard disk. There are no requirements on environment variables or
|
||||
registry variables.
|
||||
|
||||
To verify that everything works you should compile the example programs and/or
|
||||
the test program.
|
||||
|
||||
6. Contents of eJSON
|
||||
--------------------
|
||||
|
||||
All directory names below are relative to the root directory of your ejson
|
||||
installation.
|
||||
|
||||
Directory Description
|
||||
--------- -----------
|
||||
doc Contains the eJSON.pdf documentation file.
|
||||
examples Contains the two example programs.
|
||||
ejson Contains the actual eJSON library classes.
|
||||
test Contains a test program for eJSON.
|
||||
|
||||
7. Contacting the Team
|
||||
----------------------
|
||||
|
||||
Contact the team:
|
||||
|
||||
Javier Velilla «javier.hector@gmail.com»
|
||||
Paul Cohen «paco@seibostudios.se»
|
||||
Jocelyn Fiat «jfiat@eiffel.com»
|
||||
|
||||
8. Releases
|
||||
-----------
|
||||
|
||||
For more information on what was changed in each release look in the file
|
||||
history.txt.
|
||||
|
||||
Version Date Description
|
||||
------- ---- -----------
|
||||
0.3.0 2011-07-06 JSON Factory Converters
|
||||
0.2.0 2010-02-07 Adapted to EiffelStudio 6.4 or later, supports void-safety
|
||||
0.1.0 2010-02-07 First release, Adapted to SmartEiffel 1.2r7 and EiffelStudio 6.2 or previous
|
||||
@@ -1,38 +0,0 @@
|
||||
note
|
||||
description: "Objects that ..."
|
||||
author: ""
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
JSON_FILE_READER
|
||||
|
||||
feature -- Access
|
||||
|
||||
read_json_from (a_path: STRING): detachable STRING
|
||||
local
|
||||
l_file: PLAIN_TEXT_FILE
|
||||
template_content: STRING
|
||||
l_last_string: detachable STRING
|
||||
do
|
||||
create l_file.make (a_path)
|
||||
-- We perform several checks until we make a real attempt to open the file.
|
||||
if not l_file.exists then
|
||||
print ("error: '" + a_path + "' does not exist%N")
|
||||
else
|
||||
if not l_file.is_readable then
|
||||
print ("error: '" + a_path + "' is not readable.%N")
|
||||
else
|
||||
l_file.open_read
|
||||
create template_content.make_empty
|
||||
l_file.read_stream (l_file.count)
|
||||
l_last_string := l_file.last_string
|
||||
check l_last_string /= Void end -- implied by postcondition of `l_file.read_stream'
|
||||
template_content.append (l_last_string.string)
|
||||
Result := template_content
|
||||
l_file.close
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
@@ -1,175 +0,0 @@
|
||||
note
|
||||
description: "JSON_PRETTY_STRING_VISITOR Generates the JSON-String for a JSON_VALUE"
|
||||
revision: "0.1"
|
||||
|
||||
class
|
||||
JSON_PRETTY_STRING_VISITOR
|
||||
|
||||
inherit
|
||||
JSON_VISITOR
|
||||
|
||||
create
|
||||
make,
|
||||
make_custom
|
||||
|
||||
feature -- Initialization
|
||||
|
||||
make (a_output: like output)
|
||||
-- Create a new instance
|
||||
do
|
||||
make_custom (a_output, 1, 1)
|
||||
end
|
||||
|
||||
make_custom (a_output: like output; a_object_count_inlining, a_array_count_inlining: INTEGER)
|
||||
-- Create a new instance
|
||||
do
|
||||
output := a_output
|
||||
create indentation.make_empty
|
||||
indentation_step := "%T"
|
||||
|
||||
object_count_inlining := a_object_count_inlining
|
||||
array_count_inlining := a_array_count_inlining
|
||||
end
|
||||
|
||||
feature -- Access
|
||||
|
||||
output: STRING_32
|
||||
-- JSON representation
|
||||
|
||||
indentation: like output
|
||||
|
||||
indentation_step: like indentation
|
||||
|
||||
line_number: INTEGER
|
||||
|
||||
indent
|
||||
do
|
||||
indentation.append (indentation_step)
|
||||
end
|
||||
|
||||
exdent
|
||||
do
|
||||
indentation.remove_tail (indentation_step.count)
|
||||
end
|
||||
|
||||
new_line
|
||||
do
|
||||
output.append ("%N")
|
||||
output.append (indentation)
|
||||
line_number := line_number + 1
|
||||
end
|
||||
|
||||
object_count_inlining: INTEGER
|
||||
array_count_inlining: INTEGER
|
||||
|
||||
feature -- Visitor Pattern
|
||||
|
||||
visit_json_array (a_json_array: JSON_ARRAY)
|
||||
-- Visit `a_json_array'.
|
||||
local
|
||||
value: JSON_VALUE
|
||||
l_json_array: ARRAYED_LIST [JSON_VALUE]
|
||||
l_line: like line_number
|
||||
l_multiple_lines: BOOLEAN
|
||||
do
|
||||
l_json_array := a_json_array.array_representation
|
||||
l_multiple_lines := l_json_array.count >= array_count_inlining or across l_json_array as p some attached {JSON_OBJECT} p.item or attached {JSON_ARRAY} p.item end
|
||||
output.append ("[")
|
||||
l_line := line_number
|
||||
indent
|
||||
from
|
||||
l_json_array.start
|
||||
until
|
||||
l_json_array.off
|
||||
loop
|
||||
if
|
||||
line_number > l_line or
|
||||
l_multiple_lines
|
||||
then
|
||||
new_line
|
||||
end
|
||||
value := l_json_array.item
|
||||
value.accept (Current)
|
||||
l_json_array.forth
|
||||
if not l_json_array.after then
|
||||
output.append (", ")
|
||||
end
|
||||
end
|
||||
exdent
|
||||
if
|
||||
line_number > l_line or
|
||||
l_json_array.count >= array_count_inlining
|
||||
then
|
||||
new_line
|
||||
end
|
||||
output.append ("]")
|
||||
end
|
||||
|
||||
visit_json_boolean (a_json_boolean: JSON_BOOLEAN)
|
||||
-- Visit `a_json_boolean'.
|
||||
do
|
||||
output.append (a_json_boolean.item.out)
|
||||
end
|
||||
|
||||
visit_json_null (a_json_null: JSON_NULL)
|
||||
-- Visit `a_json_null'.
|
||||
do
|
||||
output.append ("null")
|
||||
end
|
||||
|
||||
visit_json_number (a_json_number: JSON_NUMBER)
|
||||
-- Visit `a_json_number'.
|
||||
do
|
||||
output.append (a_json_number.item)
|
||||
end
|
||||
|
||||
visit_json_object (a_json_object: JSON_OBJECT)
|
||||
-- Visit `a_json_object'.
|
||||
local
|
||||
l_pairs: HASH_TABLE [JSON_VALUE, JSON_STRING]
|
||||
l_line: like line_number
|
||||
l_multiple_lines: BOOLEAN
|
||||
do
|
||||
l_pairs := a_json_object.map_representation
|
||||
l_multiple_lines := l_pairs.count >= object_count_inlining or across l_pairs as p some attached {JSON_OBJECT} p.item or attached {JSON_ARRAY} p.item end
|
||||
output.append ("{")
|
||||
l_line := line_number
|
||||
indent
|
||||
from
|
||||
l_pairs.start
|
||||
until
|
||||
l_pairs.off
|
||||
loop
|
||||
if
|
||||
line_number > l_line or
|
||||
l_multiple_lines
|
||||
then
|
||||
new_line
|
||||
end
|
||||
l_pairs.key_for_iteration.accept (Current)
|
||||
output.append (": ")
|
||||
l_pairs.item_for_iteration.accept (Current)
|
||||
l_pairs.forth
|
||||
if not l_pairs.after then
|
||||
output.append (", ")
|
||||
end
|
||||
end
|
||||
exdent
|
||||
if
|
||||
line_number > l_line or
|
||||
l_pairs.count >= object_count_inlining
|
||||
then
|
||||
new_line
|
||||
end
|
||||
output.append ("}")
|
||||
end
|
||||
|
||||
visit_json_string (a_json_string: JSON_STRING)
|
||||
-- Visit `a_json_string'.
|
||||
do
|
||||
output.append ("%"")
|
||||
output.append (a_json_string.item)
|
||||
output.append ("%"")
|
||||
end
|
||||
|
||||
end
|
||||
@@ -1,59 +0,0 @@
|
||||
note
|
||||
description:
|
||||
|
||||
"JSON Visitor"
|
||||
|
||||
pattern: "Visitor"
|
||||
author: "Javier Velilla"
|
||||
license:"MIT (see http://www.opensource.org/licenses/mit-license.php)"
|
||||
date: "2008/08/24"
|
||||
revision: "Revision 0.1"
|
||||
|
||||
deferred class
|
||||
JSON_VISITOR
|
||||
|
||||
feature -- Visitor Pattern
|
||||
|
||||
visit_json_array (a_json_array: JSON_ARRAY)
|
||||
-- Visit `a_json_array'.
|
||||
require
|
||||
a_json_array_not_void: a_json_array /= Void
|
||||
deferred
|
||||
end
|
||||
|
||||
visit_json_boolean (a_json_boolean: JSON_BOOLEAN)
|
||||
-- Visit `a_json_boolean'.
|
||||
require
|
||||
a_json_boolean_not_void: a_json_boolean /= Void
|
||||
deferred
|
||||
end
|
||||
|
||||
visit_json_null (a_json_null: JSON_NULL)
|
||||
-- Visit `a_json_null'.
|
||||
require
|
||||
a_json_null_not_void: a_json_null /= Void
|
||||
deferred
|
||||
end
|
||||
|
||||
visit_json_number (a_json_number: JSON_NUMBER)
|
||||
-- Visit `a_json_number'.
|
||||
require
|
||||
a_json_number_not_void: a_json_number /= Void
|
||||
deferred
|
||||
end
|
||||
|
||||
visit_json_object (a_json_object: JSON_OBJECT)
|
||||
-- Visit `a_json_object'.
|
||||
require
|
||||
a_json_object_not_void: a_json_object /= Void
|
||||
deferred
|
||||
end
|
||||
|
||||
visit_json_string (a_json_string: JSON_STRING)
|
||||
-- Visit `a_json_string'.
|
||||
require
|
||||
a_json_string_not_void: a_json_string /= Void
|
||||
deferred
|
||||
end
|
||||
|
||||
end
|
||||
@@ -1,102 +0,0 @@
|
||||
note
|
||||
description: "PRINT_JSON_VISITOR Generates the JSON-String for a JSON_VALUE"
|
||||
author: "jvelilla"
|
||||
date: "2008/08/24"
|
||||
revision: "0.1"
|
||||
|
||||
class
|
||||
PRINT_JSON_VISITOR
|
||||
|
||||
inherit
|
||||
JSON_VISITOR
|
||||
|
||||
create make
|
||||
|
||||
feature -- Initialization
|
||||
|
||||
make
|
||||
-- Create a new instance
|
||||
do
|
||||
create to_json.make_empty
|
||||
end
|
||||
|
||||
feature -- Access
|
||||
|
||||
to_json: STRING
|
||||
-- JSON representation
|
||||
|
||||
feature -- Visitor Pattern
|
||||
|
||||
visit_json_array (a_json_array: JSON_ARRAY)
|
||||
-- Visit `a_json_array'.
|
||||
local
|
||||
value: JSON_VALUE
|
||||
l_json_array: ARRAYED_LIST [JSON_VALUE]
|
||||
do
|
||||
l_json_array:=a_json_array.array_representation
|
||||
to_json.append ("[")
|
||||
from
|
||||
l_json_array.start
|
||||
until
|
||||
l_json_array.off
|
||||
loop
|
||||
value := l_json_array.item
|
||||
value.accept (Current)
|
||||
l_json_array.forth
|
||||
if not l_json_array.after then
|
||||
to_json.append(",")
|
||||
end
|
||||
end
|
||||
to_json.append ("]")
|
||||
end
|
||||
|
||||
visit_json_boolean (a_json_boolean: JSON_BOOLEAN)
|
||||
-- Visit `a_json_boolean'.
|
||||
do
|
||||
to_json.append (a_json_boolean.item.out)
|
||||
end
|
||||
|
||||
visit_json_null (a_json_null: JSON_NULL)
|
||||
-- Visit `a_json_null'.
|
||||
do
|
||||
to_json.append ("null")
|
||||
end
|
||||
|
||||
visit_json_number (a_json_number: JSON_NUMBER)
|
||||
-- Visit `a_json_number'.
|
||||
do
|
||||
to_json.append (a_json_number.item)
|
||||
end
|
||||
|
||||
visit_json_object (a_json_object: JSON_OBJECT)
|
||||
-- Visit `a_json_object'.
|
||||
local
|
||||
l_pairs: HASH_TABLE[JSON_VALUE,JSON_STRING]
|
||||
do
|
||||
l_pairs := a_json_object.map_representation
|
||||
to_json.append ("{")
|
||||
from
|
||||
l_pairs.start
|
||||
until
|
||||
l_pairs.off
|
||||
loop
|
||||
l_pairs.key_for_iteration.accept (Current)
|
||||
to_json.append (":")
|
||||
l_pairs.item_for_iteration.accept (Current)
|
||||
l_pairs.forth
|
||||
if not l_pairs.after then
|
||||
to_json.append (",")
|
||||
end
|
||||
end
|
||||
to_json.append ("}")
|
||||
end
|
||||
|
||||
visit_json_string (a_json_string: JSON_STRING)
|
||||
-- Visit `a_json_string'.
|
||||
do
|
||||
to_json.append ("%"")
|
||||
to_json.append (a_json_string.item)
|
||||
to_json.append ("%"")
|
||||
end
|
||||
|
||||
end
|
||||
@@ -1,85 +0,0 @@
|
||||
note
|
||||
description: "A JSON converter for DS_HASH_TABLE [ANY, HASHABLE]"
|
||||
author: "Paul Cohen"
|
||||
date: "$Date: $"
|
||||
revision: "$Revision: $"
|
||||
file: "$HeadURL: $"
|
||||
|
||||
class JSON_DS_HASH_TABLE_CONVERTER
|
||||
|
||||
inherit
|
||||
JSON_CONVERTER
|
||||
|
||||
create
|
||||
make
|
||||
|
||||
feature {NONE} -- Initialization
|
||||
|
||||
make
|
||||
do
|
||||
create object.make (0)
|
||||
end
|
||||
|
||||
feature -- Access
|
||||
|
||||
value: JSON_OBJECT
|
||||
|
||||
object: DS_HASH_TABLE [ANY, HASHABLE]
|
||||
|
||||
feature -- Conversion
|
||||
|
||||
from_json (j: like value): detachable like object
|
||||
local
|
||||
keys: ARRAY [JSON_STRING]
|
||||
i: INTEGER
|
||||
h: HASHABLE
|
||||
a: ANY
|
||||
do
|
||||
keys := j.current_keys
|
||||
create Result.make (keys.count)
|
||||
from
|
||||
i := 1
|
||||
until
|
||||
i > keys.count
|
||||
loop
|
||||
h ?= json.object (keys [i], void)
|
||||
check h /= Void end
|
||||
a := json.object (j.item (keys [i]), Void)
|
||||
Result.put (a, h)
|
||||
i := i + 1
|
||||
end
|
||||
end
|
||||
|
||||
to_json (o: like object): like value
|
||||
local
|
||||
c: DS_HASH_TABLE_CURSOR [ANY, HASHABLE]
|
||||
js: JSON_STRING
|
||||
jv: JSON_VALUE
|
||||
failed: BOOLEAN
|
||||
do
|
||||
create Result.make
|
||||
from
|
||||
c := o.new_cursor
|
||||
c.start
|
||||
until
|
||||
c.after
|
||||
loop
|
||||
if attached {JSON_STRING} json.value (c.key) as l_key then
|
||||
js := l_key
|
||||
else
|
||||
create js.make_json (c.key.out)
|
||||
end
|
||||
jv := json.value (c.item)
|
||||
if jv /= Void then
|
||||
Result.put (jv, js)
|
||||
else
|
||||
failed := True
|
||||
end
|
||||
c.forth
|
||||
end
|
||||
if failed then
|
||||
Result := Void
|
||||
end
|
||||
end
|
||||
|
||||
end -- class JSON_DS_HASH_TABLE_CONVERTER
|
||||
@@ -1,62 +0,0 @@
|
||||
note
|
||||
description: "A JSON converter for DS_LINKED_LIST [ANY]"
|
||||
author: "Paul Cohen"
|
||||
date: "$Date: $"
|
||||
revision: "$Revision: $"
|
||||
file: "$HeadURL: $"
|
||||
|
||||
class JSON_DS_LINKED_LIST_CONVERTER
|
||||
|
||||
inherit
|
||||
JSON_CONVERTER
|
||||
|
||||
create
|
||||
make
|
||||
|
||||
feature {NONE} -- Initialization
|
||||
|
||||
make
|
||||
do
|
||||
create object.make
|
||||
end
|
||||
|
||||
feature -- Access
|
||||
|
||||
value: JSON_ARRAY
|
||||
|
||||
object: DS_LINKED_LIST [ANY]
|
||||
|
||||
feature -- Conversion
|
||||
|
||||
from_json (j: like value): detachable like object
|
||||
local
|
||||
i: INTEGER
|
||||
do
|
||||
create Result.make
|
||||
from
|
||||
i := 1
|
||||
until
|
||||
i > j.count
|
||||
loop
|
||||
Result.put_last (json.object (j [i], Void))
|
||||
i := i + 1
|
||||
end
|
||||
end
|
||||
|
||||
to_json (o: like object): like value
|
||||
local
|
||||
c: DS_LIST_CURSOR [ANY]
|
||||
do
|
||||
create Result.make_array
|
||||
from
|
||||
c := o.new_cursor
|
||||
c.start
|
||||
until
|
||||
c.after
|
||||
loop
|
||||
Result.add (json.value (c.item))
|
||||
c.forth
|
||||
end
|
||||
end
|
||||
|
||||
end -- class JSON_DS_LINKED_LIST_CONVERTER
|
||||
@@ -1,32 +0,0 @@
|
||||
note
|
||||
description: "[
|
||||
Shared factory class for creating JSON objects. Maps JSON
|
||||
objects to Gobo DS_HASH_TABLEs and JSON arrays to Gobo
|
||||
DS_LINKED_LISTs. Use non-conforming inheritance from this
|
||||
class to ensure that your classes share the same
|
||||
JSON_FACTORY instance.
|
||||
]"
|
||||
author: "Paul Cohen"
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
file: "$HeadURL: $"
|
||||
|
||||
class SHARED_GOBO_EJSON
|
||||
|
||||
feature
|
||||
|
||||
json: EJSON
|
||||
-- A shared EJSON instance with default converters for
|
||||
-- DS_LINKED_LIST [ANY] and DS_HASH_TABLE [ANY, HASHABLE]
|
||||
local
|
||||
jllc: JSON_DS_LINKED_LIST_CONVERTER
|
||||
jhtc: JSON_DS_HASH_TABLE_CONVERTER
|
||||
once
|
||||
create Result
|
||||
create jllc.make
|
||||
Result.add_converter (jllc)
|
||||
create jhtc.make
|
||||
Result.add_converter (jhtc)
|
||||
end
|
||||
|
||||
end -- class SHARED_GOBO_EJSON
|
||||
@@ -1,28 +0,0 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-8-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-8-0 http://www.eiffel.com/developers/xml/configuration-1-8-0.xsd" name="json" uuid="4E21C3BD-7951-4C6E-A673-431E762D7414" library_target="json">
|
||||
<target name="json">
|
||||
<root all_classes="true"/>
|
||||
<file_rule>
|
||||
<exclude>/EIFGENs$</exclude>
|
||||
<exclude>/CVS$</exclude>
|
||||
<exclude>/.svn$</exclude>
|
||||
</file_rule>
|
||||
<option trace="false" profile="false" debug="false" warning="true" full_class_checking="true" is_attached_by_default="true" void_safety="all" syntax="standard" namespace="EJSON.Library">
|
||||
<assertions/>
|
||||
<warning name="export_class_missing" enabled="false"/>
|
||||
<warning name="old_verbatim_strings" enabled="false"/>
|
||||
<warning name="syntax" enabled="false"/>
|
||||
<warning name="vjrv" enabled="false"/>
|
||||
</option>
|
||||
<library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf" readonly="true"/>
|
||||
<cluster name="json" location=".\" recursive="true">
|
||||
<file_rule>
|
||||
<exclude>^/gobo$</exclude>
|
||||
<exclude>^/kernel$</exclude>
|
||||
<exclude>^/extras$</exclude>
|
||||
</file_rule>
|
||||
<cluster name="kernel" location=".\kernel\" recursive="true"/>
|
||||
<cluster name="extras" location=".\extras\" recursive="true"/>
|
||||
</cluster>
|
||||
</target>
|
||||
</system>
|
||||
@@ -1,28 +0,0 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-8-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-8-0 http://www.eiffel.com/developers/xml/configuration-1-8-0.xsd" name="json" uuid="4E21C3BD-7951-4C6E-A673-431E762D7414" library_target="json">
|
||||
<target name="json">
|
||||
<root all_classes="true"/>
|
||||
<file_rule>
|
||||
<exclude>/EIFGENs$</exclude>
|
||||
<exclude>/CVS$</exclude>
|
||||
<exclude>/.svn$</exclude>
|
||||
</file_rule>
|
||||
<option trace="false" profile="false" debug="false" warning="true" full_class_checking="true" void_safety="none" syntax="standard" namespace="EJSON.Library">
|
||||
<assertions/>
|
||||
<warning name="export_class_missing" enabled="false"/>
|
||||
<warning name="old_verbatim_strings" enabled="false"/>
|
||||
<warning name="syntax" enabled="false"/>
|
||||
<warning name="vjrv" enabled="false"/>
|
||||
</option>
|
||||
<library name="base" location="$ISE_LIBRARY\library\base\base.ecf" readonly="true"/>
|
||||
<cluster name="json" location=".\" recursive="true">
|
||||
<file_rule>
|
||||
<exclude>^/gobo$</exclude>
|
||||
<exclude>^/kernel$</exclude>
|
||||
<exclude>^/extras$</exclude>
|
||||
</file_rule>
|
||||
<cluster name="kernel" location=".\kernel\" recursive="true"/>
|
||||
<cluster name="extras" location=".\extras\" recursive="true"/>
|
||||
</cluster>
|
||||
</target>
|
||||
</system>
|
||||
@@ -1 +0,0 @@
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-8-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-8-0 http://www.eiffel.com/developers/xml/configuration-1-8-0.xsd" name="json_gobo" uuid="437195AB-8B3C-4238-8998-A932A1423449" library_target="json_gobo">
|
||||
<target name="json_gobo">
|
||||
<root all_classes="true"/>
|
||||
<file_rule>
|
||||
<exclude>/EIFGENs$</exclude>
|
||||
<exclude>/CVS$</exclude>
|
||||
<exclude>/.svn$</exclude>
|
||||
</file_rule>
|
||||
<option trace="false" profile="false" debug="false" warning="true" full_class_checking="true" void_safety="none" syntax="standard" namespace="EJSON.Library">
|
||||
</option>
|
||||
<library name="base" location="$ISE_LIBRARY\library\base\base.ecf" readonly="true"/>
|
||||
<library name="json" location="json.ecf" readonly="true"/>
|
||||
<library name="gobo_structure" location="$ISE_LIBRARY\library\gobo\gobo_structure.ecf"/>
|
||||
<cluster name="json_gobo" location=".\gobo" recursive="true" />
|
||||
</target>
|
||||
</system>
|
||||
@@ -1,30 +0,0 @@
|
||||
note
|
||||
description: "A JSON converter for ARRAYED_LIST [ANY]"
|
||||
author: "Paul Cohen"
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
file: "$HeadURL: $"
|
||||
|
||||
class JSON_ARRAYED_LIST_CONVERTER
|
||||
|
||||
inherit
|
||||
JSON_LIST_CONVERTER
|
||||
redefine
|
||||
object
|
||||
end
|
||||
|
||||
create
|
||||
make
|
||||
|
||||
feature -- Access
|
||||
|
||||
object: ARRAYED_LIST [detachable ANY]
|
||||
|
||||
feature {NONE} -- Factory
|
||||
|
||||
new_object (nb: INTEGER): like object
|
||||
do
|
||||
create Result.make (nb)
|
||||
end
|
||||
|
||||
end -- class JSON_ARRAYED_LIST_CONVERTER
|
||||
@@ -1,36 +0,0 @@
|
||||
note
|
||||
description: "A JSON converter"
|
||||
author: "Paul Cohen"
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
file: "$HeadURL: $"
|
||||
|
||||
deferred class JSON_CONVERTER
|
||||
|
||||
inherit
|
||||
SHARED_EJSON
|
||||
|
||||
feature -- Access
|
||||
|
||||
object: ANY
|
||||
-- Eiffel object
|
||||
deferred
|
||||
end
|
||||
|
||||
feature -- Conversion
|
||||
|
||||
from_json (j: attached like to_json): detachable like object
|
||||
-- Convert from JSON value.
|
||||
-- Returns Void if unable to convert
|
||||
deferred
|
||||
end
|
||||
|
||||
to_json (o: like object): detachable JSON_VALUE
|
||||
-- Convert to JSON value
|
||||
deferred
|
||||
end
|
||||
|
||||
invariant
|
||||
has_eiffel_object: object /= Void -- An empty object must be created at creation time!
|
||||
|
||||
end
|
||||
@@ -1,92 +0,0 @@
|
||||
note
|
||||
description: "A JSON converter for HASH_TABLE [ANY, HASHABLE]"
|
||||
author: "Paul Cohen"
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
file: "$HeadURL: $"
|
||||
|
||||
class JSON_HASH_TABLE_CONVERTER
|
||||
|
||||
inherit
|
||||
JSON_CONVERTER
|
||||
|
||||
create
|
||||
make
|
||||
|
||||
feature {NONE} -- Initialization
|
||||
|
||||
make
|
||||
do
|
||||
create object.make (0)
|
||||
end
|
||||
|
||||
feature -- Access
|
||||
|
||||
object: HASH_TABLE [ANY, HASHABLE]
|
||||
|
||||
feature -- Conversion
|
||||
|
||||
from_json (j: attached like to_json): like object
|
||||
local
|
||||
keys: ARRAY [JSON_STRING]
|
||||
i: INTEGER
|
||||
h: detachable HASHABLE
|
||||
jv: detachable JSON_VALUE
|
||||
a: detachable ANY
|
||||
do
|
||||
keys := j.current_keys
|
||||
create Result.make (keys.count)
|
||||
from
|
||||
i := 1
|
||||
until
|
||||
i > keys.count
|
||||
loop
|
||||
h ?= json.object (keys [i], Void)
|
||||
check h /= Void end
|
||||
jv := j.item (keys [i])
|
||||
if jv /= Void then
|
||||
a := json.object (jv, Void)
|
||||
if a /= Void then
|
||||
Result.put (a, h)
|
||||
else
|
||||
check a_attached: a /= Void end
|
||||
end
|
||||
else
|
||||
check j_has_item: False end
|
||||
end
|
||||
i := i + 1
|
||||
end
|
||||
end
|
||||
|
||||
to_json (o: like object): detachable JSON_OBJECT
|
||||
local
|
||||
c: HASH_TABLE_ITERATION_CURSOR [ANY, HASHABLE]
|
||||
js: JSON_STRING
|
||||
jv: detachable JSON_VALUE
|
||||
failed: BOOLEAN
|
||||
do
|
||||
create Result.make
|
||||
from
|
||||
c := o.new_cursor
|
||||
until
|
||||
c.after
|
||||
loop
|
||||
if attached {JSON_STRING} json.value (c.key) as l_key then
|
||||
js := l_key
|
||||
else
|
||||
create js.make_json (c.key.out)
|
||||
end
|
||||
jv := json.value (c.item)
|
||||
if jv /= Void then
|
||||
Result.put (jv, js)
|
||||
else
|
||||
failed := True
|
||||
end
|
||||
c.forth
|
||||
end
|
||||
if failed then
|
||||
Result := Void
|
||||
end
|
||||
end
|
||||
|
||||
end -- class JSON_HASH_TABLE_CONVERTER
|
||||
@@ -1,30 +0,0 @@
|
||||
note
|
||||
description: "A JSON converter for LINKED_LIST [ANY]"
|
||||
author: "Paul Cohen"
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
file: "$HeadURL: $"
|
||||
|
||||
class JSON_LINKED_LIST_CONVERTER
|
||||
|
||||
inherit
|
||||
JSON_LIST_CONVERTER
|
||||
redefine
|
||||
object
|
||||
end
|
||||
|
||||
create
|
||||
make
|
||||
|
||||
feature -- Access
|
||||
|
||||
object: LINKED_LIST [detachable ANY]
|
||||
|
||||
feature {NONE} -- Factory
|
||||
|
||||
new_object (nb: INTEGER): like object
|
||||
do
|
||||
create Result.make
|
||||
end
|
||||
|
||||
end -- class JSON_LINKED_LIST_CONVERTER
|
||||
@@ -1,74 +0,0 @@
|
||||
note
|
||||
description: "A JSON converter for LIST [ANY]"
|
||||
author: "Paul Cohen"
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
file: "$HeadURL: $"
|
||||
|
||||
deferred class JSON_LIST_CONVERTER
|
||||
|
||||
inherit
|
||||
JSON_CONVERTER
|
||||
|
||||
feature {NONE} -- Initialization
|
||||
|
||||
make
|
||||
do
|
||||
object := new_object (0)
|
||||
end
|
||||
|
||||
feature -- Access
|
||||
|
||||
object: LIST [detachable ANY]
|
||||
|
||||
feature {NONE} -- Factory
|
||||
|
||||
new_object (nb: INTEGER): like object
|
||||
deferred
|
||||
ensure
|
||||
Result /= Void
|
||||
end
|
||||
|
||||
feature -- Conversion
|
||||
|
||||
from_json (j: attached like to_json): detachable like object
|
||||
local
|
||||
i: INTEGER
|
||||
do
|
||||
Result := new_object (j.count)
|
||||
from
|
||||
i := 1
|
||||
until
|
||||
i > j.count
|
||||
loop
|
||||
Result.extend (json.object (j [i], Void))
|
||||
i := i + 1
|
||||
end
|
||||
end
|
||||
|
||||
to_json (o: like object): detachable JSON_ARRAY
|
||||
local
|
||||
c: ITERATION_CURSOR [detachable ANY]
|
||||
jv: detachable JSON_VALUE
|
||||
failed: BOOLEAN
|
||||
do
|
||||
create Result.make_array
|
||||
from
|
||||
c := o.new_cursor
|
||||
until
|
||||
c.after
|
||||
loop
|
||||
jv := json.value (c.item)
|
||||
if jv /= Void then
|
||||
Result.add (jv)
|
||||
else
|
||||
failed := True
|
||||
end
|
||||
c.forth
|
||||
end
|
||||
if failed then
|
||||
Result := Void
|
||||
end
|
||||
end
|
||||
|
||||
end -- class JSON_ARRAYED_LIST_CONVERTER
|
||||
@@ -1,268 +0,0 @@
|
||||
note
|
||||
description: "Core factory class for creating JSON objects and corresponding Eiffel objects."
|
||||
author: "Paul Cohen"
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
file: "$HeadURL: $"
|
||||
|
||||
class EJSON
|
||||
|
||||
inherit
|
||||
EXCEPTIONS
|
||||
|
||||
feature -- Access
|
||||
|
||||
value (an_object: detachable ANY): detachable JSON_VALUE
|
||||
-- JSON value from Eiffel object. Raises an "eJSON exception" if
|
||||
-- unable to convert value.
|
||||
local
|
||||
i: INTEGER
|
||||
ja: JSON_ARRAY
|
||||
do
|
||||
-- Try to convert from basic Eiffel types. Note that we check with
|
||||
-- `conforms_to' since the client may have subclassed the base class
|
||||
-- that these basic types are derived from.
|
||||
if an_object = Void then
|
||||
create {JSON_NULL} Result
|
||||
elseif attached {BOOLEAN} an_object as b then
|
||||
create {JSON_BOOLEAN} Result.make_boolean (b)
|
||||
elseif attached {INTEGER_8} an_object as i8 then
|
||||
create {JSON_NUMBER} Result.make_integer (i8)
|
||||
elseif attached {INTEGER_16} an_object as i16 then
|
||||
create {JSON_NUMBER} Result.make_integer (i16)
|
||||
elseif attached {INTEGER_32} an_object as i32 then
|
||||
create {JSON_NUMBER} Result.make_integer (i32)
|
||||
elseif attached {INTEGER_64} an_object as i64 then
|
||||
create {JSON_NUMBER} Result.make_integer (i64)
|
||||
elseif attached {NATURAL_8} an_object as n8 then
|
||||
create {JSON_NUMBER} Result.make_natural (n8)
|
||||
elseif attached {NATURAL_16} an_object as n16 then
|
||||
create {JSON_NUMBER} Result.make_natural (n16)
|
||||
elseif attached {NATURAL_32} an_object as n32 then
|
||||
create {JSON_NUMBER} Result.make_natural (n32)
|
||||
elseif attached {NATURAL_64} an_object as n64 then
|
||||
create {JSON_NUMBER} Result.make_natural (n64)
|
||||
elseif attached {REAL_32} an_object as r32 then
|
||||
create {JSON_NUMBER} Result.make_real (r32)
|
||||
elseif attached {REAL_64} an_object as r64 then
|
||||
create {JSON_NUMBER} Result.make_real (r64)
|
||||
elseif attached {ARRAY [detachable ANY]} an_object as a then
|
||||
create ja.make_array
|
||||
from
|
||||
i := a.lower
|
||||
until
|
||||
i > a.upper
|
||||
loop
|
||||
if attached value (a @ i) as v then
|
||||
ja.add (v)
|
||||
else
|
||||
check value_attached: False end
|
||||
end
|
||||
i := i + 1
|
||||
end
|
||||
Result := ja
|
||||
elseif attached {CHARACTER_8} an_object as c8 then
|
||||
create {JSON_STRING} Result.make_json (c8.out)
|
||||
elseif attached {CHARACTER_32} an_object as c32 then
|
||||
create {JSON_STRING} Result.make_json (c32.out)
|
||||
|
||||
elseif attached {STRING_8} an_object as s8 then
|
||||
create {JSON_STRING} Result.make_json (s8)
|
||||
elseif attached {STRING_32} an_object as s32 then
|
||||
create {JSON_STRING} Result.make_json_from_string_32 (s32)
|
||||
end
|
||||
|
||||
if Result = Void then
|
||||
-- Now check the converters
|
||||
if an_object /= Void and then attached converter_for (an_object) as jc then
|
||||
Result := jc.to_json (an_object)
|
||||
else
|
||||
raise (exception_failed_to_convert_to_json (an_object))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
object (a_value: detachable JSON_VALUE; base_class: detachable STRING): detachable ANY
|
||||
-- Eiffel object from JSON value. If `base_class' /= Void an eiffel
|
||||
-- object based on `base_class' will be returned. Raises an "eJSON
|
||||
-- exception" if unable to convert value.
|
||||
local
|
||||
i: INTEGER
|
||||
ll: LINKED_LIST [detachable ANY]
|
||||
t: HASH_TABLE [detachable ANY, STRING_GENERAL]
|
||||
keys: ARRAY [JSON_STRING]
|
||||
do
|
||||
if a_value = Void then
|
||||
Result := Void
|
||||
else
|
||||
if base_class = Void then
|
||||
if a_value = Void then
|
||||
Result := Void
|
||||
elseif attached {JSON_NULL} a_value then
|
||||
Result := Void
|
||||
elseif attached {JSON_BOOLEAN} a_value as jb then
|
||||
Result := jb.item
|
||||
elseif attached {JSON_NUMBER} a_value as jn then
|
||||
if jn.item.is_integer_8 then
|
||||
Result := jn.item.to_integer_8
|
||||
elseif jn.item.is_integer_16 then
|
||||
Result := jn.item.to_integer_16
|
||||
elseif jn.item.is_integer_32 then
|
||||
Result := jn.item.to_integer_32
|
||||
elseif jn.item.is_integer_64 then
|
||||
Result := jn.item.to_integer_64
|
||||
elseif jn.item.is_natural_64 then
|
||||
Result := jn.item.to_natural_64
|
||||
elseif jn.item.is_double then
|
||||
Result := jn.item.to_double
|
||||
end
|
||||
elseif attached {JSON_STRING} a_value as js then
|
||||
create {STRING_32} Result.make_from_string (js.unescaped_string_32)
|
||||
elseif attached {JSON_ARRAY} a_value as ja then
|
||||
from
|
||||
create ll.make
|
||||
i := 1
|
||||
until
|
||||
i > ja.count
|
||||
loop
|
||||
ll.extend (object (ja [i], Void))
|
||||
i := i + 1
|
||||
end
|
||||
Result := ll
|
||||
elseif attached {JSON_OBJECT} a_value as jo then
|
||||
keys := jo.current_keys
|
||||
create t.make (keys.count)
|
||||
from
|
||||
i := keys.lower
|
||||
until
|
||||
i > keys.upper
|
||||
loop
|
||||
if attached {STRING_GENERAL} object (keys [i], Void) as s then
|
||||
t.put (object (jo.item (keys [i]), Void), s)
|
||||
end
|
||||
i := i + 1
|
||||
end
|
||||
Result := t
|
||||
end
|
||||
else
|
||||
if converters.has_key (base_class) and then attached converters.found_item as jc then
|
||||
Result := jc.from_json (a_value)
|
||||
else
|
||||
raise (exception_failed_to_convert_to_eiffel (a_value, base_class))
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
object_from_json (json: STRING; base_class: detachable STRING): detachable ANY
|
||||
-- Eiffel object from JSON representation. If `base_class' /= Void an
|
||||
-- Eiffel object based on `base_class' will be returned. Raises an
|
||||
-- "eJSON exception" if unable to convert value.
|
||||
require
|
||||
json_not_void: json /= Void
|
||||
local
|
||||
jv: detachable JSON_VALUE
|
||||
do
|
||||
json_parser.set_representation (json)
|
||||
jv := json_parser.parse
|
||||
if jv /= Void then
|
||||
Result := object (jv, base_class)
|
||||
end
|
||||
end
|
||||
|
||||
converter_for (an_object: ANY): detachable JSON_CONVERTER
|
||||
-- Converter for objects. Returns Void if none found.
|
||||
require
|
||||
an_object_not_void: an_object /= Void
|
||||
do
|
||||
if converters.has_key (an_object.generator) then
|
||||
Result := converters.found_item
|
||||
end
|
||||
end
|
||||
|
||||
json_reference (s: STRING): JSON_OBJECT
|
||||
-- A JSON (Dojo style) reference object using `s' as the
|
||||
-- reference value. The caller is responsable for ensuring
|
||||
-- the validity of `s' as a json reference.
|
||||
require
|
||||
s_not_void: s /= Void
|
||||
local
|
||||
js_key, js_value: JSON_STRING
|
||||
do
|
||||
create Result.make
|
||||
create js_key.make_json ("$ref")
|
||||
create js_value.make_json (s)
|
||||
Result.put (js_value, js_key)
|
||||
end
|
||||
|
||||
json_references (l: LIST [STRING]): JSON_ARRAY
|
||||
-- A JSON array of JSON (Dojo style) reference objects using the
|
||||
-- strings in `l' as reference values. The caller is responsable
|
||||
-- for ensuring the validity of all strings in `l' as json
|
||||
-- references.
|
||||
require
|
||||
l_not_void: l /= Void
|
||||
local
|
||||
c: ITERATION_CURSOR [STRING]
|
||||
do
|
||||
create Result.make_array
|
||||
from
|
||||
c := l.new_cursor
|
||||
until
|
||||
c.after
|
||||
loop
|
||||
Result.add (json_reference (c.item))
|
||||
c.forth
|
||||
end
|
||||
end
|
||||
|
||||
feature -- Change
|
||||
|
||||
add_converter (jc: JSON_CONVERTER)
|
||||
-- Add the converter `jc'.
|
||||
require
|
||||
jc_not_void: jc /= Void
|
||||
do
|
||||
converters.force (jc, jc.object.generator)
|
||||
ensure
|
||||
has_converter: converter_for (jc.object) /= Void
|
||||
end
|
||||
|
||||
feature {NONE} -- Implementation
|
||||
|
||||
converters: HASH_TABLE [JSON_CONVERTER, STRING]
|
||||
-- Converters hashed by generator (base class)
|
||||
once
|
||||
create Result.make (10)
|
||||
end
|
||||
|
||||
feature {NONE} -- Implementation (Exceptions)
|
||||
|
||||
exception_prefix: STRING = "eJSON exception: "
|
||||
|
||||
exception_failed_to_convert_to_eiffel (a_value: JSON_VALUE; base_class: detachable STRING): STRING
|
||||
-- Exception message for failing to convert a JSON_VALUE to an instance of `a'.
|
||||
do
|
||||
Result := exception_prefix + "Failed to convert JSON_VALUE to an Eiffel object: " + a_value.generator
|
||||
if base_class /= Void then
|
||||
Result.append (" -> {" + base_class + "}")
|
||||
end
|
||||
end
|
||||
|
||||
exception_failed_to_convert_to_json (an_object: detachable ANY): STRING
|
||||
-- Exception message for failing to convert `a' to a JSON_VALUE.
|
||||
do
|
||||
Result := exception_prefix + "Failed to convert Eiffel object to a JSON_VALUE"
|
||||
if an_object /= Void then
|
||||
Result.append (" : {" + an_object.generator + "}")
|
||||
end
|
||||
end
|
||||
|
||||
feature {NONE} -- Implementation (JSON parser)
|
||||
|
||||
json_parser: JSON_PARSER
|
||||
once
|
||||
create Result.make_parser ("")
|
||||
end
|
||||
|
||||
end -- class EJSON
|
||||
@@ -1,141 +0,0 @@
|
||||
note
|
||||
description: "[
|
||||
JSON_ARRAY represent an array in JSON.
|
||||
An array in JSON is an ordered set of names.
|
||||
Examples
|
||||
array
|
||||
[]
|
||||
[elements]
|
||||
]"
|
||||
|
||||
author: "Javier Velilla"
|
||||
date: "2008/08/24"
|
||||
revision: "Revision 0.1"
|
||||
|
||||
class
|
||||
JSON_ARRAY
|
||||
|
||||
inherit
|
||||
JSON_VALUE
|
||||
|
||||
DEBUG_OUTPUT
|
||||
|
||||
create
|
||||
make_array
|
||||
|
||||
feature {NONE} -- Initialization
|
||||
|
||||
make_array
|
||||
-- Initialize JSON Array
|
||||
do
|
||||
create values.make (10)
|
||||
end
|
||||
|
||||
feature -- Access
|
||||
|
||||
i_th alias "[]" (i: INTEGER): JSON_VALUE
|
||||
-- Item at `i'-th position
|
||||
require
|
||||
is_valid_index: valid_index (i)
|
||||
do
|
||||
Result := values.i_th (i)
|
||||
end
|
||||
|
||||
representation: STRING
|
||||
local
|
||||
i: INTEGER
|
||||
do
|
||||
Result := "["
|
||||
from
|
||||
i := 1
|
||||
until
|
||||
i > count
|
||||
loop
|
||||
Result.append (i_th (i).representation)
|
||||
i := i + 1
|
||||
if i <= count then
|
||||
Result.append_character (',')
|
||||
end
|
||||
end
|
||||
Result.append_character (']')
|
||||
end
|
||||
|
||||
feature -- Visitor pattern
|
||||
|
||||
accept (a_visitor: JSON_VISITOR)
|
||||
-- Accept `a_visitor'.
|
||||
-- (Call `visit_json_array' procedure on `a_visitor'.)
|
||||
do
|
||||
a_visitor.visit_json_array (Current)
|
||||
end
|
||||
|
||||
feature -- Mesurement
|
||||
|
||||
count: INTEGER
|
||||
-- Number of items.
|
||||
do
|
||||
Result := values.count
|
||||
end
|
||||
|
||||
feature -- Status report
|
||||
|
||||
valid_index (i: INTEGER): BOOLEAN
|
||||
-- Is `i' a valid index?
|
||||
do
|
||||
Result := (1 <= i) and (i <= count)
|
||||
end
|
||||
|
||||
feature -- Change Element
|
||||
|
||||
add (value: JSON_VALUE)
|
||||
require
|
||||
value_not_null: value /= void
|
||||
do
|
||||
values.extend (value)
|
||||
ensure
|
||||
has_new_value: old values.count + 1 = values.count and
|
||||
values.has (value)
|
||||
end
|
||||
|
||||
feature -- Report
|
||||
|
||||
hash_code: INTEGER
|
||||
-- Hash code value
|
||||
do
|
||||
from
|
||||
values.start
|
||||
Result := values.item.hash_code
|
||||
until
|
||||
values.off
|
||||
loop
|
||||
Result:= ((Result \\ 8388593) |<< 8) + values.item.hash_code
|
||||
values.forth
|
||||
end
|
||||
Result := Result \\ values.count
|
||||
end
|
||||
|
||||
feature -- Conversion
|
||||
|
||||
array_representation: ARRAYED_LIST [JSON_VALUE]
|
||||
-- Representation as a sequences of values
|
||||
do
|
||||
Result := values
|
||||
end
|
||||
|
||||
feature -- Status report
|
||||
|
||||
debug_output: STRING
|
||||
-- String that should be displayed in debugger to represent `Current'.
|
||||
do
|
||||
Result := count.out
|
||||
end
|
||||
|
||||
feature {NONE} -- Implementation
|
||||
|
||||
values: ARRAYED_LIST [JSON_VALUE]
|
||||
-- Value container
|
||||
|
||||
invariant
|
||||
value_not_void: values /= Void
|
||||
|
||||
end
|
||||
@@ -1,61 +0,0 @@
|
||||
note
|
||||
description: "JSON Truth values"
|
||||
author: "Javier Velilla"
|
||||
date: "2008/08/24"
|
||||
revision: "Revision 0.1"
|
||||
|
||||
class
|
||||
JSON_BOOLEAN
|
||||
|
||||
inherit
|
||||
JSON_VALUE
|
||||
|
||||
create
|
||||
make_boolean
|
||||
|
||||
feature {NONE} -- Initialization
|
||||
|
||||
make_boolean (an_item: BOOLEAN)
|
||||
--Initialize.
|
||||
do
|
||||
item := an_item
|
||||
end
|
||||
|
||||
feature -- Access
|
||||
|
||||
item: BOOLEAN
|
||||
-- Content
|
||||
|
||||
hash_code: INTEGER
|
||||
-- Hash code value
|
||||
do
|
||||
Result := item.hash_code
|
||||
end
|
||||
|
||||
representation: STRING
|
||||
do
|
||||
if item then
|
||||
Result := "true"
|
||||
else
|
||||
Result := "false"
|
||||
end
|
||||
end
|
||||
|
||||
feature -- Visitor pattern
|
||||
|
||||
accept (a_visitor: JSON_VISITOR)
|
||||
-- Accept `a_visitor'.
|
||||
-- (Call `visit_json_boolean' procedure on `a_visitor'.)
|
||||
do
|
||||
a_visitor.visit_json_boolean (Current)
|
||||
end
|
||||
|
||||
feature -- Status report
|
||||
|
||||
debug_output: STRING
|
||||
-- String that should be displayed in debugger to represent `Current'.
|
||||
do
|
||||
Result := item.out
|
||||
end
|
||||
|
||||
end
|
||||
@@ -1,47 +0,0 @@
|
||||
note
|
||||
description: "JSON Null Values"
|
||||
author: "Javier Velilla"
|
||||
date: "2008/08/24"
|
||||
revision: "Revision 0.1"
|
||||
|
||||
class
|
||||
JSON_NULL
|
||||
|
||||
inherit
|
||||
JSON_VALUE
|
||||
|
||||
feature --Access
|
||||
|
||||
hash_code: INTEGER
|
||||
-- Hash code value
|
||||
do
|
||||
Result := null_value.hash_code
|
||||
end
|
||||
|
||||
representation: STRING
|
||||
do
|
||||
Result := "null"
|
||||
end
|
||||
|
||||
feature -- Visitor pattern
|
||||
|
||||
accept (a_visitor: JSON_VISITOR)
|
||||
-- Accept `a_visitor'.
|
||||
-- (Call `visit_element_a' procedure on `a_visitor'.)
|
||||
do
|
||||
a_visitor.visit_json_null (Current)
|
||||
end
|
||||
|
||||
feature -- Status report
|
||||
|
||||
debug_output: STRING
|
||||
-- String that should be displayed in debugger to represent `Current'.
|
||||
do
|
||||
Result := null_value
|
||||
end
|
||||
|
||||
feature {NONE}-- Implementation
|
||||
|
||||
null_value: STRING = "null"
|
||||
|
||||
end
|
||||
@@ -1,99 +0,0 @@
|
||||
note
|
||||
|
||||
description: "JSON Numbers, octal and hexadecimal formats are not used."
|
||||
author: "Javier Velilla"
|
||||
date: "2008/08/24"
|
||||
revision: "Revision 0.1"
|
||||
license:"MIT (see http://www.opensource.org/licenses/mit-license.php)"
|
||||
|
||||
class
|
||||
JSON_NUMBER
|
||||
|
||||
inherit
|
||||
JSON_VALUE
|
||||
redefine
|
||||
is_equal
|
||||
end
|
||||
|
||||
create
|
||||
make_integer,
|
||||
make_natural,
|
||||
make_real
|
||||
|
||||
feature {NONE} -- initialization
|
||||
|
||||
make_integer (an_argument: INTEGER_64)
|
||||
-- Initialize an instance of JSON_NUMBER from the integer value of `an_argument'.
|
||||
do
|
||||
item := an_argument.out
|
||||
numeric_type := INTEGER_TYPE
|
||||
end
|
||||
|
||||
make_natural (an_argument: NATURAL_64)
|
||||
-- Initialize an instance of JSON_NUMBER from the unsigned integer value of `an_argument'.
|
||||
do
|
||||
item := an_argument.out
|
||||
numeric_type := NATURAL_TYPE
|
||||
end
|
||||
|
||||
make_real (an_argument: DOUBLE)
|
||||
-- Initialize an instance of JSON_NUMBER from the floating point value of `an_argument'.
|
||||
do
|
||||
item := an_argument.out
|
||||
numeric_type := DOUBLE_TYPE
|
||||
end
|
||||
|
||||
feature -- Access
|
||||
|
||||
item: STRING
|
||||
-- Content
|
||||
|
||||
hash_code: INTEGER
|
||||
--Hash code value
|
||||
do
|
||||
Result := item.hash_code
|
||||
end
|
||||
|
||||
representation: STRING
|
||||
do
|
||||
Result := item
|
||||
end
|
||||
|
||||
feature -- Visitor pattern
|
||||
|
||||
accept (a_visitor: JSON_VISITOR)
|
||||
-- Accept `a_visitor'.
|
||||
-- (Call `visit_json_number' procedure on `a_visitor'.)
|
||||
do
|
||||
a_visitor.visit_json_number (Current)
|
||||
end
|
||||
|
||||
feature -- Status
|
||||
|
||||
is_equal (other: like Current): BOOLEAN
|
||||
-- Is `other' attached to an object of the same type
|
||||
-- as current object and identical to it?
|
||||
do
|
||||
Result := item.is_equal (other.item)
|
||||
end
|
||||
|
||||
feature -- Status report
|
||||
|
||||
debug_output: STRING
|
||||
-- String that should be displayed in debugger to represent `Current'.
|
||||
do
|
||||
Result := item
|
||||
end
|
||||
|
||||
feature -- Implementation
|
||||
|
||||
INTEGER_TYPE: INTEGER = 1
|
||||
DOUBLE_TYPE: INTEGER = 2
|
||||
NATURAL_TYPE: INTEGER = 3
|
||||
|
||||
numeric_type: INTEGER
|
||||
|
||||
invariant
|
||||
item_not_void: item /= Void
|
||||
|
||||
end
|
||||
@@ -1,191 +0,0 @@
|
||||
note
|
||||
|
||||
description: "[
|
||||
An JSON_OBJECT represent an object in JSON.
|
||||
An object is an unordered set of name/value pairs
|
||||
|
||||
Examples:
|
||||
|
||||
object
|
||||
{}
|
||||
{"key","value"}
|
||||
|
||||
]"
|
||||
author: "Javier Velilla"
|
||||
date: "2008/08/24"
|
||||
revision: "Revision 0.1"
|
||||
license:"MIT (see http://www.opensource.org/licenses/mit-license.php)"
|
||||
|
||||
class
|
||||
JSON_OBJECT
|
||||
|
||||
inherit
|
||||
JSON_VALUE
|
||||
|
||||
TABLE_ITERABLE [JSON_VALUE, JSON_STRING]
|
||||
|
||||
create
|
||||
make
|
||||
|
||||
feature {NONE} -- Initialization
|
||||
|
||||
make
|
||||
-- Initialize
|
||||
do
|
||||
create object.make (10)
|
||||
end
|
||||
|
||||
feature -- Change Element
|
||||
|
||||
put (value: detachable JSON_VALUE; key: JSON_STRING)
|
||||
-- Assuming there is no item of key `key',
|
||||
-- insert `value' with `key'.
|
||||
require
|
||||
key_not_present: not has_key (key)
|
||||
local
|
||||
l_value: like value
|
||||
do
|
||||
l_value := value
|
||||
if l_value = Void then
|
||||
create {JSON_NULL} l_value
|
||||
end
|
||||
object.extend (l_value, key)
|
||||
end
|
||||
|
||||
replace (value: detachable JSON_VALUE; key: JSON_STRING)
|
||||
-- Assuming there is no item of key `key',
|
||||
-- insert `value' with `key'.
|
||||
local
|
||||
l_value: like value
|
||||
do
|
||||
l_value := value
|
||||
if l_value = Void then
|
||||
create {JSON_NULL} l_value
|
||||
end
|
||||
object.force (l_value, key)
|
||||
end
|
||||
|
||||
feature -- Access
|
||||
|
||||
has_key (key: JSON_STRING): BOOLEAN
|
||||
-- has the JSON_OBJECT contains a specific key 'key'.
|
||||
do
|
||||
Result := object.has (key)
|
||||
end
|
||||
|
||||
has_item (value: JSON_VALUE): BOOLEAN
|
||||
-- has the JSON_OBJECT contain a specfic item 'value'
|
||||
do
|
||||
Result := object.has_item (value)
|
||||
end
|
||||
|
||||
item (key: JSON_STRING): detachable JSON_VALUE
|
||||
-- the json_value associated with a key.
|
||||
do
|
||||
Result := object.item (key)
|
||||
end
|
||||
|
||||
current_keys: ARRAY [JSON_STRING]
|
||||
-- array containing actually used keys
|
||||
do
|
||||
Result := object.current_keys
|
||||
end
|
||||
|
||||
representation: STRING
|
||||
local
|
||||
t: HASH_TABLE [JSON_VALUE, JSON_STRING]
|
||||
do
|
||||
Result := "{"
|
||||
from
|
||||
t := map_representation
|
||||
t.start
|
||||
until
|
||||
t.after
|
||||
loop
|
||||
Result.append (t.key_for_iteration.representation)
|
||||
Result.append (":")
|
||||
Result.append (t.item_for_iteration.representation)
|
||||
t.forth
|
||||
if not t.after then
|
||||
Result.append_character (',')
|
||||
end
|
||||
end
|
||||
Result.append_character ('}')
|
||||
end
|
||||
|
||||
feature -- Mesurement
|
||||
|
||||
count: INTEGER
|
||||
-- Number of field
|
||||
do
|
||||
Result := object.count
|
||||
end
|
||||
|
||||
feature -- Access
|
||||
|
||||
new_cursor: TABLE_ITERATION_CURSOR [JSON_VALUE, JSON_STRING]
|
||||
-- Fresh cursor associated with current structure
|
||||
do
|
||||
Result := object.new_cursor
|
||||
end
|
||||
|
||||
feature -- Status report
|
||||
|
||||
is_empty: BOOLEAN
|
||||
-- Is empty object?
|
||||
do
|
||||
Result := object.is_empty
|
||||
end
|
||||
|
||||
feature -- Visitor pattern
|
||||
|
||||
accept (a_visitor: JSON_VISITOR)
|
||||
-- Accept `a_visitor'.
|
||||
-- (Call `visit_json_object' procedure on `a_visitor'.)
|
||||
do
|
||||
a_visitor.visit_json_object (Current)
|
||||
end
|
||||
|
||||
feature -- Conversion
|
||||
|
||||
map_representation: HASH_TABLE [JSON_VALUE, JSON_STRING]
|
||||
--A representation that maps keys to values
|
||||
do
|
||||
Result := object
|
||||
end
|
||||
|
||||
feature -- Report
|
||||
|
||||
hash_code: INTEGER
|
||||
-- Hash code value
|
||||
do
|
||||
from
|
||||
object.start
|
||||
Result := object.out.hash_code
|
||||
until
|
||||
object.off
|
||||
loop
|
||||
Result := ((Result \\ 8388593) |<< 8) + object.item_for_iteration.hash_code
|
||||
object.forth
|
||||
end
|
||||
-- Ensure it is a positive value.
|
||||
Result := Result.hash_code
|
||||
end
|
||||
|
||||
feature -- Status report
|
||||
|
||||
debug_output: STRING
|
||||
-- String that should be displayed in debugger to represent `Current'.
|
||||
do
|
||||
Result := object.count.out
|
||||
end
|
||||
|
||||
feature {NONE} -- Implementation
|
||||
|
||||
object: HASH_TABLE [JSON_VALUE, JSON_STRING]
|
||||
-- Value container
|
||||
|
||||
invariant
|
||||
object_not_null: object /= Void
|
||||
|
||||
end
|
||||
@@ -1,329 +0,0 @@
|
||||
note
|
||||
|
||||
description: "[
|
||||
A JSON_STRING represent a string in JSON.
|
||||
A string is a collection of zero or more Unicodes characters, wrapped in double
|
||||
quotes, using blackslash espaces.
|
||||
]"
|
||||
|
||||
author: "Javier Velilla"
|
||||
date: "2008/08/24"
|
||||
revision: "Revision 0.1"
|
||||
license:"MIT (see http://www.opensource.org/licenses/mit-license.php)"
|
||||
|
||||
|
||||
class
|
||||
JSON_STRING
|
||||
|
||||
inherit
|
||||
JSON_VALUE
|
||||
redefine
|
||||
is_equal
|
||||
end
|
||||
|
||||
create
|
||||
make_json,
|
||||
make_json_from_string_32,
|
||||
make_with_escaped_json
|
||||
|
||||
convert
|
||||
make_json ({READABLE_STRING_8, STRING_8, IMMUTABLE_STRING_8}),
|
||||
make_json_from_string_32 ({READABLE_STRING_32, STRING_32, IMMUTABLE_STRING_32})
|
||||
|
||||
feature {NONE} -- Initialization
|
||||
|
||||
make_json (s: READABLE_STRING_8)
|
||||
-- Initialize.
|
||||
require
|
||||
item_not_void: s /= Void
|
||||
do
|
||||
make_with_escaped_json (escaped_json_string (s))
|
||||
end
|
||||
|
||||
make_json_from_string_32 (s: READABLE_STRING_32)
|
||||
-- Initialize from STRING_32 `s'.
|
||||
require
|
||||
item_not_void: s /= Void
|
||||
do
|
||||
make_with_escaped_json (escaped_json_string_32 (s))
|
||||
end
|
||||
|
||||
make_with_escaped_json (s: READABLE_STRING_8)
|
||||
-- Initialize with an_item already escaped
|
||||
require
|
||||
item_not_void: s /= Void
|
||||
do
|
||||
item := s
|
||||
end
|
||||
|
||||
feature -- Access
|
||||
|
||||
item: STRING
|
||||
-- Contents with escaped entities if any
|
||||
|
||||
unescaped_string_8: STRING_8
|
||||
-- Unescaped string from `item'
|
||||
local
|
||||
s: like item
|
||||
i, n: INTEGER
|
||||
c: CHARACTER
|
||||
do
|
||||
s := item
|
||||
n := s.count
|
||||
create Result.make (n)
|
||||
from i := 1 until i > n loop
|
||||
c := s[i]
|
||||
if c = '\' then
|
||||
if i < n then
|
||||
inspect s[i+1]
|
||||
when '\' then
|
||||
Result.append_character ('\')
|
||||
i := i + 2
|
||||
when '%"' then
|
||||
Result.append_character ('%"')
|
||||
i := i + 2
|
||||
when 'n' then
|
||||
Result.append_character ('%N')
|
||||
i := i + 2
|
||||
when 'r' then
|
||||
Result.append_character ('%R')
|
||||
i := i + 2
|
||||
when 'u' then
|
||||
--| Leave unicode \uXXXX unescaped
|
||||
Result.append_character ('\')
|
||||
i := i + 1
|
||||
else
|
||||
Result.append_character ('\')
|
||||
i := i + 1
|
||||
end
|
||||
else
|
||||
Result.append_character ('\')
|
||||
i := i + 1
|
||||
end
|
||||
else
|
||||
Result.append_character (c)
|
||||
i := i + 1
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
unescaped_string_32: STRING_32
|
||||
-- Unescaped string 32 from `item'
|
||||
local
|
||||
s: like item
|
||||
i, n: INTEGER
|
||||
c: CHARACTER
|
||||
hex: STRING
|
||||
do
|
||||
s := item
|
||||
n := s.count
|
||||
create Result.make (n)
|
||||
from i := 1 until i > n loop
|
||||
c := s[i]
|
||||
if c = '\' then
|
||||
if i < n then
|
||||
inspect s[i+1]
|
||||
when '\' then
|
||||
Result.append_character ('\')
|
||||
i := i + 2
|
||||
when '%"' then
|
||||
Result.append_character ('%"')
|
||||
i := i + 2
|
||||
when 'n' then
|
||||
Result.append_character ('%N')
|
||||
i := i + 2
|
||||
when 'r' then
|
||||
Result.append_character ('%R')
|
||||
i := i + 2
|
||||
when 'u' then
|
||||
hex := s.substring (i+2, i+2+4 - 1)
|
||||
if hex.count = 4 then
|
||||
Result.append_code (hexadecimal_to_natural_32 (hex))
|
||||
end
|
||||
i := i + 2 + 4
|
||||
else
|
||||
Result.append_character ('\')
|
||||
i := i + 1
|
||||
end
|
||||
else
|
||||
Result.append_character ('\')
|
||||
i := i + 1
|
||||
end
|
||||
else
|
||||
Result.append_character (c.to_character_32)
|
||||
i := i + 1
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
representation: STRING
|
||||
-- String representation of `item' with escaped entities if any
|
||||
do
|
||||
create Result.make (item.count + 2)
|
||||
Result.append_character ('%"')
|
||||
Result.append (item)
|
||||
Result.append_character ('%"')
|
||||
end
|
||||
|
||||
feature -- Visitor pattern
|
||||
|
||||
accept (a_visitor: JSON_VISITOR)
|
||||
-- Accept `a_visitor'.
|
||||
-- (Call `visit_json_string' procedure on `a_visitor'.)
|
||||
do
|
||||
a_visitor.visit_json_string (Current)
|
||||
end
|
||||
|
||||
feature -- Comparison
|
||||
|
||||
is_equal (other: like Current): BOOLEAN
|
||||
-- Is JSON_STRING made of same character sequence as `other'
|
||||
-- (possibly with a different capacity)?
|
||||
do
|
||||
Result := item.same_string (other.item)
|
||||
end
|
||||
|
||||
feature -- Change Element
|
||||
|
||||
append (a_string: STRING)
|
||||
-- Add a_string
|
||||
require
|
||||
a_string_not_void: a_string /= Void
|
||||
do
|
||||
item.append_string (a_string)
|
||||
end
|
||||
|
||||
feature -- Status report
|
||||
|
||||
hash_code: INTEGER
|
||||
-- Hash code value
|
||||
do
|
||||
Result := item.hash_code
|
||||
end
|
||||
|
||||
feature -- Status report
|
||||
|
||||
debug_output: STRING
|
||||
-- String that should be displayed in debugger to represent `Current'.
|
||||
do
|
||||
Result := item
|
||||
end
|
||||
|
||||
feature {NONE} -- Implementation
|
||||
|
||||
is_hexadecimal (s: READABLE_STRING_8): BOOLEAN
|
||||
-- Is `s' an hexadecimal value?
|
||||
do
|
||||
Result := across s as scur all scur.item.is_hexa_digit end
|
||||
end
|
||||
|
||||
hexadecimal_to_natural_32 (s: READABLE_STRING_8): NATURAL_32
|
||||
-- Hexadecimal string `s' converted to NATURAL_32 value
|
||||
require
|
||||
s_not_void: s /= Void
|
||||
is_hexadecimal: is_hexadecimal (s)
|
||||
local
|
||||
i, nb: INTEGER
|
||||
char: CHARACTER
|
||||
do
|
||||
nb := s.count
|
||||
|
||||
if nb >= 2 and then s.item (2) = 'x' then
|
||||
i := 3
|
||||
else
|
||||
i := 1
|
||||
end
|
||||
|
||||
from
|
||||
until
|
||||
i > nb
|
||||
loop
|
||||
Result := Result * 16
|
||||
char := s.item (i)
|
||||
if char >= '0' and then char <= '9' then
|
||||
Result := Result + (char |-| '0').to_natural_32
|
||||
else
|
||||
Result := Result + (char.lower |-| 'a' + 10).to_natural_32
|
||||
end
|
||||
i := i + 1
|
||||
end
|
||||
end
|
||||
|
||||
escaped_json_string (s: READABLE_STRING_8): STRING_8
|
||||
-- JSON string with '"' and '\' characters escaped
|
||||
require
|
||||
s_not_void: s /= Void
|
||||
local
|
||||
i, n: INTEGER
|
||||
c: CHARACTER_8
|
||||
do
|
||||
n := s.count
|
||||
create Result.make (n + n // 10)
|
||||
from i := 1 until i > n loop
|
||||
c := s.item (i)
|
||||
inspect c
|
||||
when '%"' then Result.append_string ("\%"")
|
||||
when '\' then Result.append_string ("\\")
|
||||
when '%R' then Result.append_string ("\r")
|
||||
when '%N' then Result.append_string ("\n")
|
||||
else
|
||||
Result.extend (c)
|
||||
end
|
||||
i := i + 1
|
||||
end
|
||||
end
|
||||
|
||||
escaped_json_string_32 (s: READABLE_STRING_32): STRING_8
|
||||
-- JSON string with '"' and '\' characters and unicode escaped
|
||||
require
|
||||
s_not_void: s /= Void
|
||||
local
|
||||
i, j, n: INTEGER
|
||||
uc: CHARACTER_32
|
||||
c: CHARACTER_8
|
||||
h: STRING_8
|
||||
do
|
||||
n := s.count
|
||||
create Result.make (n + n // 10)
|
||||
from i := 1 until i > n loop
|
||||
uc := s.item (i)
|
||||
if uc.is_character_8 then
|
||||
c := uc.to_character_8
|
||||
inspect c
|
||||
when '%"' then Result.append_string ("\%"")
|
||||
when '\' then Result.append_string ("\\")
|
||||
when '%R' then Result.append_string ("\r")
|
||||
when '%N' then Result.append_string ("\n")
|
||||
else
|
||||
Result.extend (c)
|
||||
end
|
||||
else
|
||||
Result.append ("\u")
|
||||
h := uc.code.to_hex_string
|
||||
-- Remove first 0 and keep 4 hexa digit
|
||||
from
|
||||
j := 1
|
||||
until
|
||||
h.count = 4 or (j <= h.count and then h.item (j) /= '0')
|
||||
loop
|
||||
j := j + 1
|
||||
end
|
||||
h := h.substring (j, h.count)
|
||||
|
||||
from
|
||||
until
|
||||
h.count >= 4
|
||||
loop
|
||||
h.prepend_integer (0)
|
||||
end
|
||||
check h.count = 4 end
|
||||
Result.append (h)
|
||||
end
|
||||
i := i + 1
|
||||
end
|
||||
end
|
||||
|
||||
invariant
|
||||
item_not_void: item /= Void
|
||||
|
||||
end
|
||||
@@ -1,43 +0,0 @@
|
||||
note
|
||||
description:"[
|
||||
JSON_VALUE represent a value in JSON.
|
||||
A value can be
|
||||
* a string in double quotes
|
||||
* a number
|
||||
* boolean value(true, false )
|
||||
* null
|
||||
* an object
|
||||
* an array
|
||||
]"
|
||||
author: "Javier Velilla"
|
||||
date: "2008/05/19"
|
||||
revision: "Revision 0.1"
|
||||
license:"MIT (see http://www.opensource.org/licenses/mit-license.php)"
|
||||
|
||||
|
||||
deferred class
|
||||
JSON_VALUE
|
||||
|
||||
inherit
|
||||
HASHABLE
|
||||
|
||||
DEBUG_OUTPUT
|
||||
|
||||
feature -- Access
|
||||
|
||||
representation: STRING
|
||||
-- UTF-8 encoded Unicode string representation of Current
|
||||
deferred
|
||||
end
|
||||
|
||||
feature -- Visitor pattern
|
||||
|
||||
accept (a_visitor: JSON_VISITOR)
|
||||
-- Accept `a_visitor'.
|
||||
-- (Call `visit_*' procedure on `a_visitor'.)
|
||||
require
|
||||
a_visitor_not_void: a_visitor /= Void
|
||||
deferred
|
||||
end
|
||||
|
||||
end
|
||||
@@ -1,513 +0,0 @@
|
||||
note
|
||||
|
||||
description: "Parse serialized JSON data"
|
||||
author: "jvelilla"
|
||||
date: "2008/08/24"
|
||||
revision: "Revision 0.1"
|
||||
|
||||
class
|
||||
JSON_PARSER
|
||||
|
||||
inherit
|
||||
JSON_READER
|
||||
JSON_TOKENS
|
||||
|
||||
create
|
||||
make_parser
|
||||
|
||||
feature {NONE} -- Initialize
|
||||
|
||||
make_parser (a_json: STRING)
|
||||
-- Initialize.
|
||||
require
|
||||
json_not_empty: a_json /= Void and then not a_json.is_empty
|
||||
do
|
||||
make (a_json)
|
||||
is_parsed := True
|
||||
create errors.make
|
||||
end
|
||||
|
||||
feature -- Status report
|
||||
|
||||
is_parsed: BOOLEAN
|
||||
-- Is parsed?
|
||||
|
||||
errors: LINKED_LIST [STRING]
|
||||
-- Current errors
|
||||
|
||||
current_errors: STRING
|
||||
-- Current errors as string
|
||||
do
|
||||
create Result.make_empty
|
||||
from
|
||||
errors.start
|
||||
until
|
||||
errors.after
|
||||
loop
|
||||
Result.append_string (errors.item + "%N")
|
||||
errors.forth
|
||||
end
|
||||
end
|
||||
|
||||
feature -- Element change
|
||||
|
||||
report_error (e: STRING)
|
||||
-- Report error `e'
|
||||
require
|
||||
e_not_void: e /= Void
|
||||
do
|
||||
errors.force (e)
|
||||
end
|
||||
|
||||
feature -- Commands
|
||||
|
||||
parse_json: detachable JSON_VALUE
|
||||
-- Parse JSON data `representation'
|
||||
-- start ::= object | array
|
||||
do
|
||||
if is_valid_start_symbol then
|
||||
Result := parse
|
||||
if extra_elements then
|
||||
is_parsed := False
|
||||
end
|
||||
else
|
||||
is_parsed := False
|
||||
report_error ("Syntax error unexpected token, expecting `{' or `['")
|
||||
end
|
||||
end
|
||||
|
||||
parse: detachable JSON_VALUE
|
||||
-- Parse JSON data `representation'
|
||||
local
|
||||
c: CHARACTER
|
||||
do
|
||||
if is_parsed then
|
||||
skip_white_spaces
|
||||
c := actual
|
||||
inspect c
|
||||
when j_OBJECT_OPEN then
|
||||
Result := parse_object
|
||||
when j_STRING then
|
||||
Result := parse_string
|
||||
when j_ARRAY_OPEN then
|
||||
Result := parse_array
|
||||
else
|
||||
if c.is_digit or c = j_MINUS then
|
||||
Result := parse_number
|
||||
elseif is_null then
|
||||
Result := create {JSON_NULL}
|
||||
next
|
||||
next
|
||||
next
|
||||
elseif is_true then
|
||||
Result := create {JSON_BOOLEAN}.make_boolean (True)
|
||||
next
|
||||
next
|
||||
next
|
||||
elseif is_false then
|
||||
Result := create {JSON_BOOLEAN}.make_boolean (False)
|
||||
next
|
||||
next
|
||||
next
|
||||
next
|
||||
else
|
||||
is_parsed := False
|
||||
report_error ("JSON is not well formed in parse")
|
||||
Result := Void
|
||||
end
|
||||
end
|
||||
end
|
||||
ensure
|
||||
is_parsed_implies_result_not_void: is_parsed implies Result /= Void
|
||||
end
|
||||
|
||||
parse_object: JSON_OBJECT
|
||||
-- object
|
||||
-- {}
|
||||
-- {"key" : "value" [,]}
|
||||
local
|
||||
has_more: BOOLEAN
|
||||
l_json_string: detachable JSON_STRING
|
||||
l_value: detachable JSON_VALUE
|
||||
do
|
||||
create Result.make
|
||||
-- check if is an empty object {}
|
||||
next
|
||||
skip_white_spaces
|
||||
if actual = j_OBJECT_CLOSE then
|
||||
--is an empty object
|
||||
else
|
||||
-- a complex object {"key" : "value"}
|
||||
previous
|
||||
from has_more := True until not has_more loop
|
||||
next
|
||||
skip_white_spaces
|
||||
l_json_string := parse_string
|
||||
next
|
||||
skip_white_spaces
|
||||
if actual = ':' then
|
||||
next
|
||||
skip_white_spaces
|
||||
else
|
||||
is_parsed := False
|
||||
report_error ("%N Input string is a not well formed JSON, expected: : found: " + actual.out)
|
||||
has_more := False
|
||||
end
|
||||
|
||||
l_value := parse
|
||||
if is_parsed and then (l_value /= Void and l_json_string /= Void) then
|
||||
Result.put (l_value, l_json_string)
|
||||
next
|
||||
skip_white_spaces
|
||||
if actual = j_OBJECT_CLOSE then
|
||||
has_more := False
|
||||
elseif actual /= ',' then
|
||||
has_more := False
|
||||
is_parsed := False
|
||||
report_error ("JSON Object syntactically malformed expected , found: [" + actual.out + "]")
|
||||
end
|
||||
else
|
||||
has_more := False
|
||||
-- explain the error
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
parse_string: detachable JSON_STRING
|
||||
-- Parsed string
|
||||
local
|
||||
has_more: BOOLEAN
|
||||
l_json_string: STRING
|
||||
l_unicode: STRING
|
||||
c: like actual
|
||||
do
|
||||
create l_json_string.make_empty
|
||||
if actual = j_STRING then
|
||||
from
|
||||
has_more := True
|
||||
until
|
||||
not has_more
|
||||
loop
|
||||
next
|
||||
c := actual
|
||||
if c = j_STRING then
|
||||
has_more := False
|
||||
elseif c = '%H' then
|
||||
next
|
||||
c := actual
|
||||
if c = 'u' then
|
||||
create l_unicode.make_from_string ("\u")
|
||||
l_unicode.append (read_unicode)
|
||||
c := actual
|
||||
if is_valid_unicode (l_unicode) then
|
||||
l_json_string.append (l_unicode)
|
||||
else
|
||||
has_more := False
|
||||
is_parsed := False
|
||||
report_error ("Input String is not well formed JSON, expected a Unicode value, found [" + c.out + " ]")
|
||||
end
|
||||
elseif (not is_special_character (c) and not is_special_control (c)) or c = '%N' then
|
||||
has_more := False
|
||||
is_parsed := False
|
||||
report_error ("Input String is not well formed JSON, found [" + c.out + " ]")
|
||||
else
|
||||
l_json_string.append_character ('\')
|
||||
l_json_string.append_character (c)
|
||||
end
|
||||
else
|
||||
if is_special_character (c) and c /= '/' then
|
||||
has_more := False
|
||||
is_parsed := False
|
||||
report_error ("Input String is not well formed JSON, found [" + c.out + " ]")
|
||||
else
|
||||
l_json_string.append_character (c)
|
||||
end
|
||||
end
|
||||
end
|
||||
create Result.make_with_escaped_json (l_json_string)
|
||||
else
|
||||
Result := Void
|
||||
end
|
||||
end
|
||||
|
||||
parse_array: JSON_ARRAY
|
||||
-- array
|
||||
-- []
|
||||
-- [elements [,]]
|
||||
local
|
||||
flag: BOOLEAN
|
||||
l_value: detachable JSON_VALUE
|
||||
c: like actual
|
||||
do
|
||||
create Result.make_array
|
||||
--check if is an empty array []
|
||||
next
|
||||
skip_white_spaces
|
||||
if actual = j_array_close then
|
||||
--is an empty array
|
||||
else
|
||||
previous
|
||||
from
|
||||
flag := True
|
||||
until
|
||||
not flag
|
||||
loop
|
||||
next
|
||||
skip_white_spaces
|
||||
l_value := parse
|
||||
if is_parsed and then l_value /= Void then
|
||||
Result.add (l_value)
|
||||
next
|
||||
skip_white_spaces
|
||||
c := actual
|
||||
if c = j_ARRAY_CLOSE then
|
||||
flag := False
|
||||
elseif c /= ',' then
|
||||
flag := False
|
||||
is_parsed := False
|
||||
report_error ("Array is not well formed JSON, found [" + c.out + " ]")
|
||||
end
|
||||
else
|
||||
flag := False
|
||||
report_error ("Array is not well formed JSON, found [" + actual.out + " ]")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
parse_number: detachable JSON_NUMBER
|
||||
-- Parsed number
|
||||
local
|
||||
sb: STRING
|
||||
flag: BOOLEAN
|
||||
is_integer: BOOLEAN
|
||||
c: like actual
|
||||
do
|
||||
create sb.make_empty
|
||||
sb.append_character (actual)
|
||||
|
||||
from
|
||||
flag := True
|
||||
until
|
||||
not flag
|
||||
loop
|
||||
next
|
||||
c := actual
|
||||
if not has_next or is_close_token (c)
|
||||
or c = ',' or c = '%N' or c = '%R'
|
||||
then
|
||||
flag := False
|
||||
previous
|
||||
else
|
||||
sb.append_character (c)
|
||||
end
|
||||
end
|
||||
|
||||
if is_valid_number (sb) then
|
||||
if sb.is_integer then
|
||||
create Result.make_integer (sb.to_integer)
|
||||
is_integer := True
|
||||
elseif sb.is_double and not is_integer then
|
||||
create Result.make_real (sb.to_double)
|
||||
end
|
||||
else
|
||||
is_parsed := False
|
||||
report_error ("Expected a number, found: [ " + sb + " ]")
|
||||
end
|
||||
end
|
||||
|
||||
is_null: BOOLEAN
|
||||
-- Word at index represents null?
|
||||
local
|
||||
l_null: STRING
|
||||
l_string: STRING
|
||||
do
|
||||
l_null := null_id
|
||||
l_string := json_substring (index,index + l_null.count - 1)
|
||||
if l_string.is_equal (l_null) then
|
||||
Result := True
|
||||
end
|
||||
end
|
||||
|
||||
is_false: BOOLEAN
|
||||
-- Word at index represents false?
|
||||
local
|
||||
l_false: STRING
|
||||
l_string: STRING
|
||||
do
|
||||
l_false := false_id
|
||||
l_string := json_substring (index, index + l_false.count - 1)
|
||||
if l_string.is_equal (l_false) then
|
||||
Result := True
|
||||
end
|
||||
end
|
||||
|
||||
is_true: BOOLEAN
|
||||
-- Word at index represents true?
|
||||
local
|
||||
l_true: STRING
|
||||
l_string: STRING
|
||||
do
|
||||
l_true := true_id
|
||||
l_string := json_substring (index,index + l_true.count - 1)
|
||||
if l_string.is_equal (l_true) then
|
||||
Result := True
|
||||
end
|
||||
end
|
||||
|
||||
read_unicode: STRING
|
||||
-- Read unicode and return value
|
||||
local
|
||||
i: INTEGER
|
||||
do
|
||||
create Result.make_empty
|
||||
from
|
||||
i := 1
|
||||
until
|
||||
i > 4 or not has_next
|
||||
loop
|
||||
next
|
||||
Result.append_character (actual)
|
||||
i := i + 1
|
||||
end
|
||||
end
|
||||
|
||||
feature {NONE} -- Implementation
|
||||
|
||||
is_valid_number (a_number: STRING): BOOLEAN
|
||||
-- is 'a_number' a valid number based on this regular expression
|
||||
-- "-?(?: 0|[1-9]\d+)(?: \.\d+)?(?: [eE][+-]?\d+)?\b"?
|
||||
local
|
||||
s: detachable STRING
|
||||
c: CHARACTER
|
||||
i,n: INTEGER
|
||||
do
|
||||
create s.make_empty
|
||||
n := a_number.count
|
||||
if n = 0 then
|
||||
Result := False
|
||||
else
|
||||
Result := True
|
||||
i := 1
|
||||
--| "-?"
|
||||
c := a_number[i]
|
||||
if c = '-' then
|
||||
s.extend (c); i := i + 1; c := a_number[i]
|
||||
end
|
||||
--| "0|[1-9]\d*
|
||||
if c.is_digit then
|
||||
if c = '0' then
|
||||
--| "0"
|
||||
s.extend (c); i := i + 1; c := a_number[i]
|
||||
else
|
||||
--| "[1-9]"
|
||||
s.extend (c); i := i + 1; c := a_number[i]
|
||||
--| "\d*"
|
||||
from until i > n or not c.is_digit loop
|
||||
s.extend (c); i := i + 1; c := a_number[i]
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
if Result then
|
||||
--| "(\.\d+)?"
|
||||
if c = '.' then
|
||||
--| "\.\d+" = "\.\d\d*"
|
||||
s.extend (c); i := i + 1; c := a_number[i]
|
||||
if c.is_digit then
|
||||
from until i > n or not c.is_digit loop
|
||||
s.extend (c); i := i + 1; c := a_number[i]
|
||||
end
|
||||
else
|
||||
Result := False --| expecting digit
|
||||
end
|
||||
end
|
||||
end
|
||||
if Result then --| "(?:[eE][+-]?\d+)?\b"
|
||||
if c = 'e' or c = 'E' then
|
||||
--| "[eE][+-]?\d+"
|
||||
s.extend (c); i := i + 1; c := a_number[i]
|
||||
if c = '+' or c = '-' then
|
||||
s.extend (c); i := i + 1; c := a_number[i]
|
||||
end
|
||||
if c.is_digit then
|
||||
from until i > n or not c.is_digit loop
|
||||
s.extend (c); i := i + 1; c := a_number[i]
|
||||
end
|
||||
else
|
||||
Result := False --| expecting digit
|
||||
end
|
||||
end
|
||||
end
|
||||
if Result then --| "\b"
|
||||
from until i > n or not c.is_space loop
|
||||
s.extend (c); i := i + 1; c := a_number[i]
|
||||
end
|
||||
Result := i > n and then s.same_string (a_number)
|
||||
end
|
||||
end
|
||||
|
||||
is_valid_unicode (a_unicode: STRING): BOOLEAN
|
||||
-- is 'a_unicode' a valid unicode based on this regular expression
|
||||
-- "\\u[0-9a-fA-F]{4}"
|
||||
local
|
||||
i: INTEGER
|
||||
do
|
||||
if
|
||||
a_unicode.count = 6 and then
|
||||
a_unicode[1] = '\' and then
|
||||
a_unicode[2] = 'u'
|
||||
then
|
||||
from
|
||||
Result := True
|
||||
i := 3
|
||||
until
|
||||
i > 6 or Result = False
|
||||
loop
|
||||
inspect a_unicode[i]
|
||||
when '0'..'9', 'a'..'f', 'A'..'F' then
|
||||
else
|
||||
Result := False
|
||||
end
|
||||
i := i + 1
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
extra_elements: BOOLEAN
|
||||
-- has more elements?
|
||||
local
|
||||
c: like actual
|
||||
do
|
||||
if has_next then
|
||||
next
|
||||
end
|
||||
from
|
||||
c := actual
|
||||
until
|
||||
c /= ' ' or c /= '%R' or c /= '%U' or c /= '%T' or c /= '%N' or not has_next
|
||||
loop
|
||||
next
|
||||
end
|
||||
Result := has_next
|
||||
end
|
||||
|
||||
is_valid_start_symbol : BOOLEAN
|
||||
-- expecting `{' or `[' as start symbol
|
||||
do
|
||||
if attached representation as s and then s.count > 0 then
|
||||
Result := s[1] = '{' or s[1] = '['
|
||||
end
|
||||
end
|
||||
|
||||
feature {NONE} -- Constants
|
||||
|
||||
false_id: STRING = "false"
|
||||
|
||||
true_id: STRING = "true"
|
||||
|
||||
null_id: STRING = "null"
|
||||
|
||||
|
||||
end
|
||||
@@ -1,118 +0,0 @@
|
||||
note
|
||||
description: "Objects that ..."
|
||||
author: "jvelilla"
|
||||
date: "2008/08/24"
|
||||
revision: "0.1"
|
||||
|
||||
class
|
||||
JSON_READER
|
||||
|
||||
create
|
||||
make
|
||||
|
||||
feature {NONE} -- Initialization
|
||||
|
||||
make (a_json: STRING)
|
||||
-- Initialize Reader
|
||||
do
|
||||
set_representation (a_json)
|
||||
end
|
||||
|
||||
feature -- Commands
|
||||
|
||||
set_representation (a_json: STRING)
|
||||
-- Set `representation'.
|
||||
do
|
||||
a_json.left_adjust
|
||||
a_json.right_adjust
|
||||
representation := a_json
|
||||
index := 1
|
||||
end
|
||||
|
||||
read: CHARACTER
|
||||
-- Read character
|
||||
do
|
||||
if not representation.is_empty then
|
||||
Result := representation.item (index)
|
||||
end
|
||||
end
|
||||
|
||||
next
|
||||
-- Move to next index
|
||||
require
|
||||
has_more_elements: has_next
|
||||
do
|
||||
index := index + 1
|
||||
ensure
|
||||
incremented: old index + 1 = index
|
||||
end
|
||||
|
||||
previous
|
||||
-- Move to previous index
|
||||
require
|
||||
not_is_first: has_previous
|
||||
do
|
||||
index := index - 1
|
||||
ensure
|
||||
incremented: old index - 1 = index
|
||||
end
|
||||
|
||||
skip_white_spaces
|
||||
-- Remove white spaces
|
||||
local
|
||||
c: like actual
|
||||
do
|
||||
from
|
||||
c := actual
|
||||
until
|
||||
(c /= ' ' and c /= '%N' and c /= '%R' and c /= '%U' and c /= '%T' ) or not has_next
|
||||
loop
|
||||
next
|
||||
c := actual
|
||||
end
|
||||
end
|
||||
|
||||
json_substring (start_index, end_index: INTEGER_32): STRING
|
||||
-- JSON representation between `start_index' and `end_index'
|
||||
do
|
||||
Result := representation.substring (start_index, end_index)
|
||||
end
|
||||
|
||||
feature -- Status report
|
||||
|
||||
has_next: BOOLEAN
|
||||
-- Has a next character?
|
||||
do
|
||||
Result := index <= representation.count
|
||||
end
|
||||
|
||||
has_previous: BOOLEAN
|
||||
-- Has a previous character?
|
||||
do
|
||||
Result := index >= 1
|
||||
end
|
||||
|
||||
feature -- Access
|
||||
|
||||
representation: STRING
|
||||
-- Serialized representation of the original JSON string
|
||||
|
||||
feature {NONE} -- Implementation
|
||||
|
||||
actual: CHARACTER
|
||||
-- Current character or '%U' if none
|
||||
do
|
||||
if index > representation.count then
|
||||
Result := '%U'
|
||||
else
|
||||
Result := representation.item (index)
|
||||
end
|
||||
end
|
||||
|
||||
index: INTEGER
|
||||
-- Actual index
|
||||
|
||||
invariant
|
||||
representation_not_void: representation /= Void
|
||||
|
||||
end
|
||||
@@ -1,77 +0,0 @@
|
||||
note
|
||||
description: ""
|
||||
author: "jvelilla"
|
||||
date: "2008/08/24"
|
||||
revision: "0.1"
|
||||
|
||||
class
|
||||
JSON_TOKENS
|
||||
|
||||
feature -- Access
|
||||
|
||||
j_OBJECT_OPEN: CHARACTER = '{'
|
||||
j_ARRAY_OPEN: CHARACTER = '['
|
||||
j_OBJECT_CLOSE: CHARACTER = '}'
|
||||
j_ARRAY_CLOSE: CHARACTER = ']'
|
||||
|
||||
j_STRING: CHARACTER = '"'
|
||||
j_PLUS: CHARACTER = '+'
|
||||
j_MINUS: CHARACTER = '-'
|
||||
j_DOT: CHARACTER = '.'
|
||||
|
||||
feature -- Status report
|
||||
|
||||
is_open_token (c: CHARACTER): BOOLEAN
|
||||
-- Characters which open a type
|
||||
do
|
||||
inspect c
|
||||
when j_OBJECT_OPEN, j_ARRAY_OPEN, j_STRING, j_PLUS, j_MINUS, j_DOT then
|
||||
Result := True
|
||||
else
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
is_close_token (c: CHARACTER): BOOLEAN
|
||||
-- Characters which close a type
|
||||
do
|
||||
inspect c
|
||||
when j_OBJECT_CLOSE, j_ARRAY_CLOSE, j_STRING then
|
||||
Result := True
|
||||
else
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
is_special_character (c: CHARACTER): BOOLEAN
|
||||
-- Control Characters
|
||||
-- %F Form feed
|
||||
-- %H backslasH
|
||||
-- %N Newline
|
||||
-- %R carriage Return
|
||||
-- %T horizontal Tab
|
||||
-- %B Backspace
|
||||
-- / Solidus
|
||||
-- " Quotation
|
||||
do
|
||||
inspect c
|
||||
when '%F', '%H', '%N', '%R', '%T', '%B', '/', '"' then
|
||||
Result := True
|
||||
else
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
is_special_control (c: CHARACTER): BOOLEAN
|
||||
--Control Characters
|
||||
-- \b\f\n\r\t
|
||||
do
|
||||
inspect c
|
||||
when 'b', 'f', 'n', 'r', 't' then
|
||||
Result := True
|
||||
else
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
@@ -1,38 +0,0 @@
|
||||
note
|
||||
description: "[
|
||||
Shared factory class for creating JSON objects. Maps JSON
|
||||
objects to ELKS HASH_TABLEs and JSON arrays to ELKS
|
||||
LINKED_LISTs. Use non-conforming inheritance from this
|
||||
class to ensure that your classes share the same
|
||||
JSON_FACTORY instance.
|
||||
]"
|
||||
author: "Paul Cohen"
|
||||
date: "$Date$"
|
||||
revision: "$Revision: 89185 $"
|
||||
file: "$HeadURL: $"
|
||||
|
||||
class SHARED_EJSON
|
||||
|
||||
feature
|
||||
|
||||
json: EJSON
|
||||
-- A shared EJSON instance with default converters for
|
||||
--LINKED_LIST [ANY] and HASH_TABLE [ANY, HASHABLE]
|
||||
local
|
||||
jalc: JSON_ARRAYED_LIST_CONVERTER
|
||||
jllc: JSON_LINKED_LIST_CONVERTER
|
||||
jhtc: JSON_HASH_TABLE_CONVERTER
|
||||
once
|
||||
create Result
|
||||
|
||||
create jalc.make
|
||||
Result.add_converter (jalc)
|
||||
|
||||
create jllc.make
|
||||
Result.add_converter (jllc)
|
||||
|
||||
create jhtc.make
|
||||
Result.add_converter (jhtc)
|
||||
end
|
||||
|
||||
end -- class SHARED_EJSON
|
||||
@@ -1,24 +0,0 @@
|
||||
note
|
||||
description : "test_suite application root class"
|
||||
date : "$Date$"
|
||||
revision : "$Revision$"
|
||||
|
||||
class
|
||||
APPLICATION
|
||||
|
||||
inherit
|
||||
ARGUMENTS
|
||||
|
||||
create
|
||||
make
|
||||
|
||||
feature {NONE} -- Initialization
|
||||
|
||||
make
|
||||
-- Run application.
|
||||
do
|
||||
--| Add your code here
|
||||
print ("Hello Eiffel World!%N")
|
||||
end
|
||||
|
||||
end
|
||||
@@ -1,24 +0,0 @@
|
||||
class AUTHOR
|
||||
|
||||
create
|
||||
make
|
||||
|
||||
feature {NONE} -- Initialization
|
||||
|
||||
make (a_name: STRING_32)
|
||||
do
|
||||
set_name (a_name)
|
||||
end
|
||||
|
||||
feature -- Access
|
||||
|
||||
name: STRING_32
|
||||
|
||||
feature -- Status setting
|
||||
|
||||
set_name (a_name: STRING_32)
|
||||
do
|
||||
name := a_name
|
||||
end
|
||||
|
||||
end -- class AUTHOR
|
||||
@@ -1,40 +0,0 @@
|
||||
class BOOK
|
||||
|
||||
create
|
||||
make
|
||||
|
||||
feature {NONE} -- Initialization
|
||||
|
||||
make (a_title: STRING_32; an_author: AUTHOR; an_isbn: STRING_32)
|
||||
do
|
||||
set_title (a_title)
|
||||
set_author (an_author)
|
||||
set_isbn (an_isbn)
|
||||
end
|
||||
|
||||
feature -- Access
|
||||
|
||||
title: STRING_32
|
||||
|
||||
isbn: STRING_32
|
||||
|
||||
author: AUTHOR
|
||||
|
||||
feature -- Status setting
|
||||
|
||||
set_title (a_title: STRING_32)
|
||||
do
|
||||
title := a_title
|
||||
end
|
||||
|
||||
set_author (an_author: AUTHOR)
|
||||
do
|
||||
author := an_author
|
||||
end
|
||||
|
||||
set_isbn (an_isbn: STRING_32)
|
||||
do
|
||||
isbn := an_isbn
|
||||
end
|
||||
|
||||
end -- class BOOK
|
||||
@@ -1,80 +0,0 @@
|
||||
class BOOK_COLLECTION
|
||||
|
||||
create
|
||||
make
|
||||
|
||||
feature {NONE} -- Initialization
|
||||
|
||||
make (a_name: STRING_32)
|
||||
do
|
||||
set_name (a_name)
|
||||
create book_index.make (10)
|
||||
end
|
||||
|
||||
feature -- Access
|
||||
|
||||
name: STRING_32
|
||||
|
||||
books: LIST [BOOK]
|
||||
do
|
||||
from
|
||||
create {LINKED_LIST [BOOK]} Result.make
|
||||
book_index.start
|
||||
until
|
||||
book_index.after
|
||||
loop
|
||||
Result.append (book_index.item_for_iteration)
|
||||
book_index.forth
|
||||
end
|
||||
end
|
||||
|
||||
books_by_author (an_author: STRING_32): detachable LIST [BOOK]
|
||||
do
|
||||
if book_index.has (an_author) then
|
||||
Result := book_index @ an_author
|
||||
else
|
||||
create {LINKED_LIST [BOOK]} Result.make
|
||||
end
|
||||
end
|
||||
|
||||
feature -- Status setting
|
||||
|
||||
set_name (a_name: STRING_32)
|
||||
do
|
||||
name := a_name
|
||||
end
|
||||
|
||||
add_book (a_book: BOOK)
|
||||
local
|
||||
l: detachable LIST [BOOK]
|
||||
do
|
||||
if book_index.has (a_book.author.name) then
|
||||
l := book_index.at ( a_book.author.name )
|
||||
else
|
||||
create {LINKED_LIST [BOOK]} l.make
|
||||
book_index.put (l, a_book.author.name)
|
||||
end
|
||||
if attached l as la then
|
||||
la.force (a_book)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
add_books (book_list: like books)
|
||||
|
||||
do
|
||||
from
|
||||
book_list.start
|
||||
until
|
||||
book_list.after
|
||||
loop
|
||||
add_book (book_list.item)
|
||||
book_list.forth
|
||||
end
|
||||
end
|
||||
|
||||
feature {NONE} -- Implementation
|
||||
|
||||
book_index: HASH_TABLE [LIST [BOOK], STRING_32]
|
||||
|
||||
end -- class BOOK_COLLECTION
|
||||
@@ -1 +0,0 @@
|
||||
"A JSON payload should be an object or array, not a string."
|
||||
@@ -1 +0,0 @@
|
||||
{"Extra value after close": true} "misplaced quoted value"
|
||||
@@ -1 +0,0 @@
|
||||
{"Illegal expression": 1 + 2}
|
||||
@@ -1 +0,0 @@
|
||||
{"Illegal invocation": alert()}
|
||||
@@ -1 +0,0 @@
|
||||
{"Numbers cannot have leading zeroes": 013}
|
||||
@@ -1 +0,0 @@
|
||||
{"Numbers cannot be hex": 0x14}
|
||||
@@ -1 +0,0 @@
|
||||
["Illegal backslash escape: \x15"]
|
||||
@@ -1 +0,0 @@
|
||||
[\naked]
|
||||
@@ -1 +0,0 @@
|
||||
["Illegal backslash escape: \017"]
|
||||
@@ -1 +0,0 @@
|
||||
[[[[[[[[[[[[[[[[[[[["Too deep"]]]]]]]]]]]]]]]]]]]]
|
||||
@@ -1 +0,0 @@
|
||||
{"Missing colon" null}
|
||||
@@ -1 +0,0 @@
|
||||
["Unclosed array"
|
||||
@@ -1 +0,0 @@
|
||||
{"Double colon":: null}
|
||||
@@ -1 +0,0 @@
|
||||
{"Comma instead of colon", null}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user