mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-11 03:00:49 +00:00
Compare commits
856
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
aeb4ed5004 | ||
|
|
ddcfc93126 | ||
|
|
0b043e92a7 | ||
|
|
7ea53ff229 | ||
|
|
5872ffcead | ||
|
|
d7d480949f | ||
|
|
a2ea3caa69 | ||
|
|
da59c92901 | ||
|
|
0157bf243d | ||
|
|
8282d12be1 | ||
|
|
6b1c31661b | ||
|
|
c278eab916 | ||
|
|
d87135436b | ||
|
|
35792a8986 | ||
|
|
cba764c504 | ||
|
|
ac7be8892b | ||
|
|
b6b6b14ae9 | ||
|
|
12f8f00fb8 | ||
|
|
e3c79b33f8 | ||
|
|
e9c5c6ea7a | ||
|
|
0493e78c8d | ||
|
|
432a0a8d18 | ||
|
|
3844c9cfb6 | ||
|
|
f825493be1 | ||
|
|
236b0d0861 | ||
|
|
1b32827801 | ||
|
|
59b1db6bfc | ||
|
|
3efc767433 | ||
|
|
0eea6e7a8f | ||
|
|
43357775fa | ||
|
|
ec94654316 | ||
|
|
03e748888b | ||
|
|
3dca869c7b | ||
|
|
480a2ea1b7 | ||
|
|
bf80795cad | ||
|
|
881e6b69c4 | ||
|
|
888e41a834 | ||
|
|
02e8c41b24 | ||
|
|
bd3b413dc9 | ||
|
|
83a354b69a | ||
|
|
3de6716235 | ||
|
|
288d437b3e | ||
|
|
40cd0d8909 | ||
|
|
ac6d2d4fe9 | ||
|
|
ebc2ff7c07 | ||
|
|
a8b9717374 | ||
|
|
de138d3468 | ||
|
|
a5ce3491ef | ||
|
|
d07f47f59e | ||
|
|
c3670534df | ||
|
|
b583e753b5 | ||
|
|
f81e218f15 | ||
|
|
71fa3102fc | ||
|
|
ded8918b9e | ||
|
|
a574e24080 | ||
|
|
d812632083 | ||
|
|
ad39ef1462 | ||
|
|
c0446845b9 | ||
|
|
326dcb9e79 | ||
|
|
26a0663044 | ||
|
|
9b4e521b9c | ||
|
|
449ddbccb1 | ||
|
|
fa077c7be9 | ||
|
|
786eacfd45 | ||
|
|
46cdd040e2 | ||
|
|
6f164ad7dc | ||
|
|
58f0cbd534 | ||
|
|
594b7989cc | ||
|
|
44294ada47 | ||
|
|
c277e3f98d | ||
|
|
cd14d04924 | ||
|
|
d4b4ed3505 | ||
|
|
1731fb0c67 | ||
|
|
bb1d16c122 | ||
|
|
8d48566c6f | ||
|
|
10c685112a | ||
|
|
91436356b8 | ||
|
|
8e3abe8946 | ||
|
|
b3b277f32a | ||
|
|
4f4cac9611 | ||
|
|
8476f5b29e | ||
|
|
a1510f90b0 | ||
|
|
ae7c036e41 | ||
|
|
727e89ab1b | ||
|
|
f9e226fe4a | ||
|
|
518ab3c62f | ||
|
|
744f1a34ef | ||
|
|
6cdc90bae3 | ||
|
|
c2f1139738 | ||
|
|
1888009e26 | ||
|
|
4daab7c982 | ||
|
|
42fc96aaaf | ||
|
|
66e3243ddd | ||
|
|
ad17d8f0a4 | ||
|
|
20490db03f | ||
|
|
5cb6b6c667 | ||
|
|
f7650fe8ae | ||
|
|
ebffa649c3 | ||
|
|
2cc8e2f8c7 | ||
|
|
93b2587876 | ||
|
|
0bc55d8c81 | ||
|
|
69e30c20c1 | ||
|
|
d8bc7084ee | ||
|
|
2672602e30 | ||
|
|
2fef94cc11 | ||
|
|
bb69296ddd | ||
|
|
3a930785ec | ||
|
|
e5a997ff59 | ||
|
|
5c16c9fa1a | ||
|
|
dcd971e6bf | ||
|
|
4e1b1fa929 | ||
|
|
6e7a9e2705 | ||
|
|
84f8310e9a | ||
|
|
8d9082563a | ||
|
|
aa11144649 | ||
|
|
81814c8ddc | ||
|
|
3b195720e0 | ||
|
|
949b0893dc | ||
|
|
1626ba7ee9 | ||
|
|
0644641616 | ||
|
|
aa6a62d96d | ||
|
|
d5af60ca2f | ||
|
|
19bca1a309 | ||
|
|
45807e6dd9 | ||
|
|
dca467faf3 | ||
|
|
d4fc424554 | ||
|
|
8a03f3062f | ||
|
|
203d67ea6b | ||
|
|
939a8b31e7 | ||
|
|
960cc62e59 | ||
|
|
a33a3925f9 | ||
|
|
0d1bcd480c | ||
|
|
917cfd14e9 | ||
|
|
96b95bd286 | ||
|
|
fe25ebdd11 | ||
|
|
ea536c5808 | ||
|
|
b762691d4d | ||
|
|
def5059f44 | ||
|
|
db0d2c9bd6 | ||
|
|
888f376e4c | ||
|
|
0af5c36d94 | ||
|
|
f03b949134 | ||
|
|
23c3b190c2 | ||
|
|
78ed6e831f | ||
|
|
a216a9ad7e | ||
|
|
4a60447800 | ||
|
|
5ebbef16f2 | ||
|
|
819f11c9d2 | ||
|
|
ccb857ba81 | ||
|
|
e6d07d6fa3 | ||
|
|
df7c2eeabc | ||
|
|
4bb015938e | ||
|
|
cabfc674c2 | ||
|
|
fb35b3996c | ||
|
|
c534109bce | ||
|
|
ee3353e8d3 | ||
|
|
7ace1a3e8d | ||
|
|
a9f8aa69c9 | ||
|
|
b24c82e82a | ||
|
|
e3dae1013d | ||
|
|
929197cf83 | ||
|
|
e7101eb193 | ||
|
|
3cacf33572 | ||
|
|
c1dff68b34 | ||
|
|
53e3452649 | ||
|
|
e937eeb2e5 | ||
|
|
2f6fe425a4 | ||
|
|
781cf450f8 | ||
|
|
2c95d6268c | ||
|
|
c476bce2f1 | ||
|
|
be6ab20415 | ||
|
|
b36afe2957 | ||
|
|
e7aff0b676 | ||
|
|
a56c9f8e68 | ||
|
|
2fefaba7b6 | ||
|
|
afccae85d9 | ||
|
|
2ef6b689e8 | ||
|
|
6c1af20310 | ||
|
|
0222f92358 | ||
|
|
939b72c771 | ||
|
|
886fbabb0b | ||
|
|
5347ef1728 | ||
|
|
efa026c86b | ||
|
|
231d1a12d1 | ||
|
|
0b981df1b2 | ||
|
|
9d468a33c4 | ||
|
|
f8dabac6d5 | ||
|
|
12077112b4 | ||
|
|
9ca1038535 | ||
|
|
0a1f0ea22e | ||
|
|
358731195f | ||
|
|
f5bf3c10fd | ||
|
|
cea34b9dbe | ||
|
|
fda42b034f | ||
|
|
67f66b32c0 | ||
|
|
649c59b731 | ||
|
|
7743f5a59d | ||
|
|
4a8d9df816 | ||
|
|
cedb39ee56 | ||
|
|
ee23c53108 | ||
|
|
19555e57a8 | ||
|
|
67bb9d1ae2 | ||
|
|
b2c957d4b1 | ||
|
|
b5d5b3a703 | ||
|
|
dc70b6172b | ||
|
|
b853cd5dc8 | ||
|
|
d161e9d1c1 | ||
|
|
119ee485c6 | ||
|
|
35f4826fea | ||
|
|
1f6878e912 | ||
|
|
df81663614 | ||
|
|
6d2a433ec5 | ||
|
|
620cda3987 | ||
|
|
ce87ae4159 | ||
|
|
c8a56ea11d | ||
|
|
3b1a3a3f8c | ||
|
|
3c8cc8ab36 | ||
|
|
92dd81ba7f | ||
|
|
769cde2f9f | ||
|
|
49014ed560 | ||
|
|
965bb6d211 | ||
|
|
1cf5973ab4 | ||
|
|
0ee7fbe41a | ||
|
|
2116cfedf3 | ||
|
|
82952f8830 | ||
|
|
42b0e1cb1f | ||
|
|
66c667c974 | ||
|
|
030b707296 | ||
|
|
9a0b61a619 | ||
|
|
1ebdb6fa14 | ||
|
|
5b59b51e50 | ||
|
|
3c48053ca8 | ||
|
|
d5a09981d6 | ||
|
|
5739ee8799 | ||
|
|
b81828864f | ||
|
|
8b500cdcdf | ||
|
|
5767ab3f75 | ||
|
|
eb437a5870 | ||
|
|
66d8f798ad | ||
|
|
b52648efd5 | ||
|
|
ac5e01e567 | ||
|
|
3e2ddd1edf | ||
|
|
7059daa7ef | ||
|
|
023a95ae1c | ||
|
|
86f0184c33 | ||
|
|
280461e06b | ||
|
|
9f1eb35d6f | ||
|
|
608ee593a4 | ||
|
|
6f79fc7d46 | ||
|
|
6a81095313 | ||
|
|
31f63bee93 | ||
|
|
ca05afa7fc | ||
|
|
4bb564ad2b | ||
|
|
d1cecd1dd2 | ||
|
|
51011a6672 | ||
|
|
bde531da79 | ||
|
|
2fea5bb19c | ||
|
|
471bcfc8c8 | ||
|
|
14350f9aef | ||
|
|
d0b3314c77 | ||
|
|
8dcb3fdf3c | ||
|
|
fb8be26654 | ||
|
|
3625a729a7 | ||
|
|
c960bd930d | ||
|
|
008d23bb5c | ||
|
|
2d57a5b2a4 | ||
|
|
0b6a8d0458 | ||
|
|
d4f9f83363 | ||
|
|
eca0bd0f39 | ||
|
|
89d5983ad9 | ||
|
|
8f0d033450 | ||
|
|
218149da14 | ||
|
|
c509dc6dc7 | ||
|
|
dba76125e4 | ||
|
|
d13547fa7f | ||
|
|
f3a17761be | ||
|
|
5526248e53 | ||
|
|
60dd569a69 | ||
|
|
b4a6acf697 | ||
|
|
fcdf44a1a0 | ||
|
|
0c3d96c3ba | ||
|
|
c1e1bc07ff | ||
|
|
468068705f | ||
|
|
86b7cd0572 | ||
|
|
5d7a485cd7 | ||
|
|
6a86b6fad5 | ||
|
|
0f7f5c2c0e | ||
|
|
9b42296bab | ||
|
|
db65d0e076 | ||
|
|
4004ef6f25 | ||
|
|
34b0b1fc11 | ||
|
|
124569d167 | ||
|
|
39f8c9807e | ||
|
|
eea750ebc8 | ||
|
|
3fbfbf1f45 | ||
|
|
04f180b08a | ||
|
|
8658cace16 | ||
|
|
1f6edfc779 | ||
|
|
dd83069fff | ||
|
|
89d6b5b5bd | ||
|
|
6a149caaed | ||
|
|
20ab5c58c7 | ||
|
|
2325a41346 | ||
|
|
71e53f2a5f | ||
|
|
a2774081c9 | ||
|
|
40462d1d02 | ||
|
|
4d6ecaf26b | ||
|
|
86b8e890dc | ||
|
|
802d716c0d | ||
|
|
1ccf94066c | ||
|
|
86a13dd94e | ||
|
|
b69dd89d34 | ||
|
|
38569740da | ||
|
|
56d673217c | ||
|
|
4d48df3339 | ||
|
|
5e33cdaef3 | ||
|
|
52aba68aa2 | ||
|
|
7534b9857a | ||
|
|
7c8f9371e5 | ||
|
|
0bbb1906bd | ||
|
|
25db8b1882 | ||
|
|
86ac33e638 | ||
|
|
b98f580143 | ||
|
|
3374176643 | ||
|
|
f950a3724c | ||
|
|
113a5bb8c2 | ||
|
|
d9d4824cd3 | ||
|
|
ecaf64a362 | ||
|
|
2a5f8a8906 | ||
|
|
a46f36a564 | ||
|
|
eaad937f84 | ||
|
|
d82bade81c | ||
|
|
ffc95d6125 | ||
|
|
781816998c | ||
|
|
368054d223 | ||
|
|
1f71f1f3c0 | ||
|
|
7eb6e8d551 | ||
|
|
443d289380 | ||
|
|
4eece9b1bd | ||
|
|
3e2fa2781a | ||
|
|
f6a8f905b1 | ||
|
|
63cdbbd56e | ||
|
|
5e7041615a | ||
|
|
41d83c5d95 | ||
|
|
905e41af5c | ||
|
|
1afebc69c7 | ||
|
|
e4c95b17e6 | ||
|
|
64ef92eafb | ||
|
|
95eceee413 | ||
|
|
3f85e944ab | ||
|
|
c824ee09a0 | ||
|
|
87d8e44c26 | ||
|
|
9e40204f00 | ||
|
|
50e0d9d34b | ||
|
|
ef8fb2767b | ||
|
|
c9e39592b5 | ||
|
|
4be1fa5ea1 | ||
|
|
407ac966f8 | ||
|
|
5360d78278 | ||
|
|
ae6314468f | ||
|
|
79fd4ad841 | ||
|
|
c5e776ec2d | ||
|
|
e2bb93c575 | ||
|
|
65150b8512 | ||
|
|
6f0014982d | ||
|
|
61f2088846 | ||
|
|
44ecf58519 | ||
|
|
65f37060db | ||
|
|
cde5c779dc | ||
|
|
7f1dc85574 | ||
|
|
efd8117fd4 | ||
|
|
24035faa29 | ||
|
|
dec089e39c | ||
|
|
c5ff85c8bc | ||
|
|
248b5a32be | ||
|
|
2906e61a06 | ||
|
|
e7a632e950 | ||
|
|
16ca32d057 | ||
|
|
ee7821ea7d | ||
|
|
5a58b723ec | ||
|
|
1f3273481e | ||
|
|
ed218bb6b4 | ||
|
|
ea9ac669da | ||
|
|
f25ccb0a83 | ||
|
|
41a2b59977 | ||
|
|
a6a792ecdd | ||
|
|
d381e0702c | ||
|
|
1f9ee4857b | ||
|
|
29086bc027 | ||
|
|
d6e7b4fefa | ||
|
|
e314da896f | ||
|
|
b80e71fdac | ||
|
|
47654fd021 | ||
|
|
ffde875f70 | ||
|
|
303fe604e9 | ||
|
|
c5a87b4fa3 | ||
|
|
41c361dcbc | ||
|
|
f70f0909b6 | ||
|
|
cc73072804 | ||
|
|
6f398a247d | ||
|
|
1f00cff3ab | ||
|
|
848d353880 | ||
|
|
0d04945bfa | ||
|
|
90f2f64ca8 | ||
|
|
8e9967be00 | ||
|
|
f391eb7423 | ||
|
|
3e8ac5d7f8 | ||
|
|
0feb2a21e5 | ||
|
|
b4ce4e2634 | ||
|
|
c0904e1c9e | ||
|
|
5e48df787a | ||
|
|
b00ef1eb50 | ||
|
|
1f03630846 | ||
|
|
a5c75761c2 | ||
|
|
6d0749a95b | ||
|
|
313a459af3 | ||
|
|
8da331e6ab | ||
|
|
8ea486c58f | ||
|
|
b20f8b39b9 | ||
|
|
76accf4806 | ||
|
|
715ce15a6f | ||
|
|
a43cd1438e | ||
|
|
a3a0fe3797 | ||
|
|
e560ecfa47 | ||
|
|
139d5c102b | ||
|
|
6451d58455 | ||
|
|
471d070c94 | ||
|
|
4d3fc68f11 | ||
|
|
1497e148f4 | ||
|
|
51ec089429 | ||
|
|
6da2eaf600 | ||
|
|
1956fb48d2 | ||
|
|
3c775e6446 | ||
|
|
6053f2a118 | ||
|
|
d0ec3df288 | ||
|
|
e17df3a7bc | ||
|
|
24343cd5c0 | ||
|
|
e6b6213619 | ||
|
|
2986b89e1d | ||
|
|
464a561bb0 | ||
|
|
f1a9920bcf | ||
|
|
b06998a7d1 | ||
|
|
a878709db3 | ||
|
|
838264de75 | ||
|
|
8aa6f6d55c | ||
|
|
ce501c78a8 | ||
|
|
1884518cf4 | ||
|
|
d26cb379c8 | ||
|
|
32dcafc669 | ||
|
|
d949733c70 | ||
|
|
816f1f7903 | ||
|
|
a44361a769 | ||
|
|
43ff395b65 | ||
|
|
9866d899e9 | ||
|
|
3ac8e25812 | ||
|
|
1f53d0203c | ||
|
|
a023f9280a | ||
|
|
0b25301bce | ||
|
|
e8e3be00d5 | ||
|
|
18d1ecaa5e | ||
|
|
8c4852c2cb | ||
|
|
3dd6c2d96f | ||
|
|
4462bc2e2d | ||
|
|
94042d6848 | ||
|
|
c42564f780 | ||
|
|
f9e5c33803 | ||
|
|
648c141cbc | ||
|
|
f0c0ea97a8 | ||
|
|
91622ad7cb | ||
|
|
d9ba87c84c | ||
|
|
87e88d5a33 | ||
|
|
6139a2c8ce | ||
|
|
8907e17bde | ||
|
|
b25b80c147 | ||
|
|
0330643ea2 | ||
|
|
2ad7083005 | ||
|
|
d6d3f5e9b6 | ||
|
|
dfcd4c18e6 | ||
|
|
f90f30df60 | ||
|
|
0ee12a6488 | ||
|
|
8aecb3c984 | ||
|
|
7ab46420be | ||
|
|
00b8b66132 | ||
|
|
3bc3677439 | ||
|
|
92d37f688e | ||
|
|
dfe57b01a2 | ||
|
|
9e2a591ac6 | ||
|
|
fc466bebd8 | ||
|
|
604876542a | ||
|
|
c420d653ee | ||
|
|
f589a3b587 | ||
|
|
dc3f6eaf29 | ||
|
|
1b34b0bd89 | ||
|
|
4c2abe7df4 | ||
|
|
55ccb5a35b | ||
|
|
78194a47b7 | ||
|
|
4171da016c | ||
|
|
9596255da8 | ||
|
|
ea6985a225 | ||
|
|
2f5f83f518 | ||
|
|
fad7092ff8 | ||
|
|
c31faf0bd9 | ||
|
|
4b5eb2cf2c | ||
|
|
702b510dc6 | ||
|
|
1f7a3b3b11 | ||
|
|
76ede5ce5c | ||
|
|
622e66b31f | ||
|
|
7eed2e5b01 | ||
|
|
47a84052e5 | ||
|
|
4d0992bb22 | ||
|
|
283531c4e4 | ||
|
|
1e00d43dd6 | ||
|
|
7e8074731b | ||
|
|
f52a59062d | ||
|
|
60c0835470 | ||
|
|
3c06816532 | ||
|
|
668b3e89f5 | ||
|
|
4af433d627 | ||
|
|
ab3beffad7 | ||
|
|
d0fbddcc2b | ||
|
|
366c16e561 | ||
|
|
f3243082a3 | ||
|
|
6b4c369164 | ||
|
|
d39c2cf0f1 | ||
|
|
b07276c3e2 | ||
|
|
ca07586e1e | ||
|
|
009e5df030 | ||
|
|
af87dfe204 | ||
|
|
bed7034f92 | ||
|
|
27a8480028 | ||
|
|
13183ed5c3 | ||
|
|
c38005a4f1 | ||
|
|
e04fd648a6 | ||
|
|
f01e3fbe56 | ||
|
|
9041d4eedd | ||
|
|
86b2d4fefe | ||
|
|
7b0d92dd18 | ||
|
|
19dad410ec | ||
|
|
1fd09132c2 | ||
|
|
825457ae64 | ||
|
|
fc4b704fca | ||
|
|
e76bafd648 | ||
|
|
4a895b6919 | ||
|
|
a400c594ba | ||
|
|
ac7e22d3c4 | ||
|
|
273422f277 | ||
|
|
06de8e78cf | ||
|
|
b74d02dbe4 | ||
|
|
3dc7fc54a0 | ||
|
|
d77aede9a9 | ||
|
|
f302028e0e | ||
|
|
d943274af7 | ||
|
|
b45d265c54 | ||
|
|
11af318a62 | ||
|
|
d313ad8bf5 | ||
|
|
e252d77d5f | ||
|
|
70f262d0c5 | ||
|
|
02537bd2f2 | ||
|
|
ea7534a848 | ||
|
|
56ccd8701d | ||
|
|
f136e5cf08 | ||
|
|
d4cf62f86f | ||
|
|
b522397298 | ||
|
|
93683d052b | ||
|
|
50500e680b | ||
|
|
4f97ff0096 | ||
|
|
6b435870de | ||
|
|
703a0c1159 | ||
|
|
6ff371d9f7 | ||
|
|
3b02d88b8e | ||
|
|
33c8f50534 | ||
|
|
b725c6eef3 | ||
|
|
055efb70c3 | ||
|
|
e6dd64e96e | ||
|
|
85b52234e4 | ||
|
|
01b4c07747 | ||
|
|
9b2a1110a6 | ||
|
|
e577215736 | ||
|
|
2946f87f00 | ||
|
|
717e934a88 | ||
|
|
3a263dcd99 | ||
|
|
f367b3dfc8 | ||
|
|
b3ab7b8948 | ||
|
|
6f0e47f690 | ||
|
|
5583203e91 | ||
|
|
4aab269181 | ||
|
|
f610c44190 | ||
|
|
2b060b3bf3 | ||
|
|
52e45f514b | ||
|
|
00d1d1a347 | ||
|
|
39387c7781 | ||
|
|
2517250b35 | ||
|
|
4f757a3af0 | ||
|
|
c57830c1d2 | ||
|
|
8ef0d01baf | ||
|
|
5b7ff6f72a | ||
|
|
89aa77d306 | ||
|
|
d504de0f78 | ||
|
|
26f5fe6375 | ||
|
|
27a1c12ad8 | ||
|
|
fd7284a665 | ||
|
|
e5b0945e4c | ||
|
|
93232c7064 | ||
|
|
f1dcb32c9f | ||
|
|
84681b9c81 | ||
|
|
a35bf41670 | ||
|
|
1026416153 | ||
|
|
383a5e7d49 | ||
|
|
167c0a0277 | ||
|
|
2d7860edc7 | ||
|
|
6911ee5b99 | ||
|
|
48e5d3189f | ||
|
|
e91a524490 | ||
|
|
7c11cfaf03 | ||
|
|
86c0d81253 | ||
|
|
b17451635d | ||
|
|
fa8452bbb2 | ||
|
|
4fa1a4b468 | ||
|
|
def5cb5332 | ||
|
|
bccdaff6d1 | ||
|
|
1bf216ca57 | ||
|
|
0e705a5f60 | ||
|
|
b57f9eb541 | ||
|
|
dbdfbd9e0c | ||
|
|
32b10882e5 | ||
|
|
248d8527fd | ||
|
|
7ef3e414e2 | ||
|
|
3c92f6bb50 | ||
|
|
8f494c2ad0 | ||
|
|
61cf1f34a5 | ||
|
|
f69a4a431a | ||
|
|
69d704622d | ||
|
|
02f599ead5 | ||
|
|
667e96f2c8 | ||
|
|
7883ddaf51 | ||
|
|
5741816315 | ||
|
|
e8c7fd7f5f | ||
|
|
989d471643 | ||
|
|
4f1a8a763a | ||
|
|
0646a49386 | ||
|
|
6ac8281cf4 | ||
|
|
6cd1273c43 | ||
|
|
1d582b8829 | ||
|
|
4d676fe9d8 | ||
|
|
4edb210028 | ||
|
|
508d1993ed | ||
|
|
a953b5ae4d | ||
|
|
bef776742c | ||
|
|
c10bf6d129 | ||
|
|
9224f8e211 | ||
|
|
d12c4de6ba | ||
|
|
04f0f0b12c | ||
|
|
7d3b7d7cb2 | ||
|
|
218c2fa3ae | ||
|
|
6337c12473 | ||
|
|
8f280b2656 | ||
|
|
84bcbe7055 | ||
|
|
15d05bbce3 | ||
|
|
74ce674d27 | ||
|
|
c663980808 | ||
|
|
456ed7ae23 | ||
|
|
836df2f798 | ||
|
|
8fe7cf26fc | ||
|
|
625fde5090 | ||
|
|
a2dbb10eb1 | ||
|
|
ebaf484830 | ||
|
|
4682a3fe95 | ||
|
|
2c874f745d | ||
|
|
094d01148a | ||
|
|
a2cb42039f | ||
|
|
222d004714 | ||
|
|
878e348ff9 | ||
|
|
dadb140e2f | ||
|
|
7b4983c8f8 | ||
|
|
a0cfab65ea | ||
|
|
07d781be66 | ||
|
|
6b6b6cd940 | ||
|
|
6b8faeb1f2 | ||
|
|
d485e7fc29 | ||
|
|
287fc71ee2 | ||
|
|
2288607fc5 | ||
|
|
6cfcf6e010 | ||
|
|
2c05a539e5 | ||
|
|
1d9acd8337 | ||
|
|
78493a1b03 | ||
|
|
52fc5f0cd3 | ||
|
|
dc44e06eeb | ||
|
|
a57ea792c6 | ||
|
|
57dcb93324 | ||
|
|
5fc85205d9 | ||
|
|
e8967fdc58 | ||
|
|
c13cfa040d | ||
|
|
f9606d82fa | ||
|
|
ed9f9b3cd7 | ||
|
|
6eb45b5964 | ||
|
|
a9655b77ab | ||
|
|
928da71046 | ||
|
|
ffc6e72604 | ||
|
|
a953f6bc5b | ||
|
|
9f71179ca9 | ||
|
|
23defd97e9 | ||
|
|
7a54e0b10c | ||
|
|
33d15279ac | ||
|
|
afdf0e759f | ||
|
|
adb12b50b5 | ||
|
|
2da9a94d38 | ||
|
|
d47e48329b | ||
|
|
2ecce2dc35 | ||
|
|
aa203477bc | ||
|
|
f85a4a7325 | ||
|
|
7cb8ad4ea3 | ||
|
|
8fbf6ca7c5 | ||
|
|
5386c05cd1 | ||
|
|
610edbc7de | ||
|
|
9e5ef06ceb | ||
|
|
98bbb11780 | ||
|
|
68b899ce26 | ||
|
|
13fa52b881 | ||
|
|
e058cb0648 | ||
|
|
ffbd2367e7 | ||
|
|
9e693657d9 | ||
|
|
0b59e4b821 | ||
|
|
142a32b437 | ||
|
|
6e09d7cb53 | ||
|
|
e8861e6d20 | ||
|
|
d95bc9b3eb | ||
|
|
2d24f03033 | ||
|
|
c27ef11305 | ||
|
|
7c0ba95806 | ||
|
|
8cdff379d6 | ||
|
|
b3fb8a6e97 | ||
|
|
1f245a6f73 | ||
|
|
1c85ad029b | ||
|
|
8f5e25598a | ||
|
|
4de105ae4a | ||
|
|
4086197d95 | ||
|
|
9c1097c4db | ||
|
|
6fd1c9a929 | ||
|
|
d282abf2df | ||
|
|
54754242da | ||
|
|
5d98e49cbb | ||
|
|
f6b66196e1 | ||
|
|
d004ea17c3 | ||
|
|
be60fcb11a | ||
|
|
bc422640d7 | ||
|
|
0892ae5b25 | ||
|
|
83b3818e67 | ||
|
|
cd7dae0676 | ||
|
|
61a71738ae | ||
|
|
e6d03e7a3e | ||
|
|
5db1090dff | ||
|
|
154052ff15 | ||
|
|
5c6593b505 | ||
|
|
c3026223f7 | ||
|
|
beb42300e1 | ||
|
|
b8cadf21db | ||
|
|
c6e0cef254 | ||
|
|
ce51b94461 | ||
|
|
d7969026b3 | ||
|
|
bc37c9b1cd | ||
|
|
545ae277bc | ||
|
|
6d5f1d97f8 | ||
|
|
afef79762d | ||
|
|
6fb51171c8 | ||
|
|
38ad62e6c7 | ||
|
|
cae27179ce | ||
|
|
e07e515a1b | ||
|
|
e91c188e85 | ||
|
|
9bd721eb10 | ||
|
|
d82c344869 | ||
|
|
a57282df4b | ||
|
|
3ee228371d | ||
|
|
4166063897 | ||
|
|
8e4fe0acf9 | ||
|
|
174253123e | ||
|
|
82d199b639 | ||
|
|
5a48521049 | ||
|
|
a70ae211e1 | ||
|
|
e880e3fe0c | ||
|
|
22e48a814a | ||
|
|
5423a08558 | ||
|
|
2b3333f53e | ||
|
|
3156be3fa6 | ||
|
|
68683825ad | ||
|
|
d2d5320ee8 | ||
|
|
0fd6a7ed18 | ||
|
|
aee3c65a8f | ||
|
|
e9887156cf | ||
|
|
0b1b5e3080 | ||
|
|
dee2d85e77 | ||
|
|
48167d2b21 | ||
|
|
dea72ba6a4 | ||
|
|
b3d949852f | ||
|
|
ac0880fd8f | ||
|
|
f3232e99c3 | ||
|
|
84f81c50ba | ||
|
|
57a5bbd387 | ||
|
|
c834cbba59 | ||
|
|
98038f8228 | ||
|
|
1abd99a443 | ||
|
|
9aa38aad45 | ||
|
|
23a96536fa | ||
|
|
f2ddc10685 | ||
|
|
0b7745d713 | ||
|
|
9a0d7a40be | ||
|
|
8fc4200414 | ||
|
|
332b7125de | ||
|
|
be19c812ab | ||
|
|
8716039dec | ||
|
|
83905d9fec | ||
|
|
814639b2fc | ||
|
|
877855a74e | ||
|
|
8759dcc0ce | ||
|
|
a03858c40b | ||
|
|
e9ba352023 | ||
|
|
ab0f48d506 | ||
|
|
a193c9ce3e | ||
|
|
92b3dd06e3 | ||
|
|
046ecab96f | ||
|
|
86f2ad3017 | ||
|
|
bbc37db2f3 | ||
|
|
85d125c22c | ||
|
|
9103cae5e5 | ||
|
|
97bd1845a6 | ||
|
|
09f89187f4 | ||
|
|
d667e05543 | ||
|
|
990a86615d | ||
|
|
f2f5f5a870 | ||
|
|
c99f72d5ea | ||
|
|
683ce541c8 | ||
|
|
6b5441c30f | ||
|
|
b88fc00775 | ||
|
|
996bd9300b | ||
|
|
8520f94796 | ||
|
|
472c1a099b | ||
|
|
a39da32bf0 | ||
|
|
31a5160a0a | ||
|
|
9ece8612b8 | ||
|
|
7292abefc1 | ||
|
|
4b0db9a47b | ||
|
|
348079bc3f | ||
|
|
fb2c23645b | ||
|
|
5ab813e1b6 | ||
|
|
791cda209c | ||
|
|
d84c5a2238 | ||
|
|
f06ee6bdba | ||
|
|
8538f86ac1 | ||
|
|
3dd574bb94 | ||
|
|
b3450c2246 | ||
|
|
47dfaf232f | ||
|
|
6d92ac275d | ||
|
|
5674f1be45 | ||
|
|
de527c2379 | ||
|
|
5bcba1fadf | ||
|
|
da6c94f73b | ||
|
|
cc415d699e |
No files matched your search
+46
-8
@@ -5,8 +5,9 @@ PHP Coding Standards
|
||||
This file lists several standards that any programmer, adding or changing
|
||||
code in PHP, should follow. Since this file was added at a very late
|
||||
stage of the development of PHP v3.0, the code base does not (yet) fully
|
||||
follow it, but it's going in that general direction.
|
||||
This is an initial version - it'll most probably grow as time passes.
|
||||
follow it, but it's going in that general direction. Since we are now
|
||||
well into the version 4 releases, many sections have been recoded to use
|
||||
these rules.
|
||||
|
||||
|
||||
Code Implementation
|
||||
@@ -64,7 +65,24 @@ Naming Conventions
|
||||
------------------
|
||||
|
||||
[1] Function names for user functions should be enclosed with in
|
||||
the PHP_FUNCTION() macro.
|
||||
the PHP_FUNCTION() macro. They should be in lowercase, with words
|
||||
underscore delimited, with care taken to minimize the letter count.
|
||||
If they are part of a "parent set" of functions, that parent should
|
||||
be included in the user function name.
|
||||
|
||||
Good:
|
||||
'mcrypt_enc_self_test'
|
||||
'mysql_list_fields'
|
||||
|
||||
Ok:
|
||||
'mcrypt_module_get_algo_supported_key_sizes'
|
||||
(could be 'mcrypt_mod_get_algo_sup_key_sizes'?)
|
||||
'get_html_translation_table'
|
||||
(could be 'html_get_trans_table'?)
|
||||
|
||||
Bad:
|
||||
'hw_GetObjectByQueryCollObj'
|
||||
'pg_setclientencoding'
|
||||
|
||||
[2] Function names used by user functions should be prefixed
|
||||
with "_php_", and followed by a word or an underscore-delimited list of
|
||||
@@ -92,25 +110,32 @@ Syntax and indentation
|
||||
is known to accept C++-style comments in C code.
|
||||
|
||||
[2] Use K&R-style. Of course, we can't and don't want to
|
||||
force anybody to use a style she's not used to, but
|
||||
force anybody to use a style he or she is not used to, but,
|
||||
at the very least, when you write code that goes into the core
|
||||
of PHP or one of its standard modules, please maintain the K&R
|
||||
style. This applies to just about everything, starting with
|
||||
indentation and comment styles and up to function decleration
|
||||
syntax.
|
||||
|
||||
[3] Be generous with whitespace and braces. Always prefer
|
||||
if (foo) {
|
||||
[3] Be generous with whitespace and braces. Always prefer:
|
||||
|
||||
if (foo) {
|
||||
bar;
|
||||
}
|
||||
to
|
||||
|
||||
to:
|
||||
|
||||
if(foo)bar;
|
||||
|
||||
|
||||
Keep one empty line between the variable decleration section and
|
||||
the statements in a block, as well as between logical statement
|
||||
groups in a block. Maintain at least one empty line between
|
||||
two functions, preferably two.
|
||||
|
||||
[4] When indenting, use the tab character. A tab is expected to represent
|
||||
four spaces. It is important to maintain consistency in indenture so
|
||||
that definitions, comments, and control structures line up correctly.
|
||||
|
||||
Documentation and Folding Hooks
|
||||
-------------------------------
|
||||
|
||||
@@ -145,4 +170,17 @@ Optional arguments are written like this:
|
||||
|
||||
And yes, please keep everything on a single line, even if that line is massive.
|
||||
|
||||
Aliases & Legacy Documentation
|
||||
-----------------------------------
|
||||
You may also have some deprecated aliases with close to duplicate
|
||||
names, for example, somedb_select_result and somedb_selectresult. For
|
||||
documentation puposes, these will only be documented by the most
|
||||
current name, with the aliases listed in the documentation for
|
||||
the parent function. For ease of reference, user-functions with
|
||||
completely different names, that alias to the same function (such as
|
||||
highlight_file and show_source), will be separately documented. The
|
||||
proto should still be included, describing which function is aliased.
|
||||
|
||||
Backwards compatible functions and names should be maintained as long
|
||||
as the code can be reasonably be kept as part of the codebase. See
|
||||
/phpdoc/README for me information on documentation.
|
||||
@@ -1,3 +1,2 @@
|
||||
For the list of people who've put work into PHP 4.0, please see
|
||||
http://www.php.net/version4/credits.php
|
||||
|
||||
http://www.php.net/credits.php
|
||||
+14
-3
@@ -141,7 +141,7 @@ MAINTENANCE: Unknown
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: oci8
|
||||
PRIMARY MAINTAINER: Thies C. Arntzen <thies@digicol.de>
|
||||
PRIMARY MAINTAINER: Thies C. Arntzen <thies@thieso.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
@@ -152,7 +152,7 @@ STATUS: Working
|
||||
COMMENT: Working except for persistent connections
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: oracle
|
||||
PRIMARY MAINTAINER: Thies C. Arntzen <thies@digicol.de>
|
||||
PRIMARY MAINTAINER: Thies C. Arntzen <thies@thieso.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
COMMENT: Using the new OCI8 driver is encouraged where possible.
|
||||
@@ -262,6 +262,11 @@ PRIMARY MAINTAINER: Sascha Schumann <sascha@schumann.cx>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: openssl
|
||||
PRIMARY MAINTAINER: Stig Venaas <venaas@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Experimental
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: pcre
|
||||
PRIMARY MAINTAINER: Andrei Zmievski <andrei@ispi.net>
|
||||
MAINTENANCE: Maintained
|
||||
@@ -298,6 +303,12 @@ PRIMARY MAINTAINER: Kristian K
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: satellite
|
||||
PRIMARY MAINTAINER: David Eriksson <eriksson@php.net>
|
||||
MAINTENANCE: Odd Fixes
|
||||
STATUS: Experimental
|
||||
SINCE: 4.0.3
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: session
|
||||
PRIMARY MAINTAINER: Sascha Schumann <sascha@schumann.cx>
|
||||
MAINTENANCE: Maintained
|
||||
@@ -333,7 +344,7 @@ MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: xml
|
||||
PRIMARY MAINTAINER: Thies C. Arntzen <thies@digicol.de>
|
||||
PRIMARY MAINTAINER: Thies C. Arntzen <thies@thieso.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Unknown
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
@@ -389,7 +389,8 @@ USING PHP 3 AND PHP 4 AS CONCURRENT APACHE MODULES
|
||||
- Linux with recent binutils (binutils 2.9.1.0.25 tested)
|
||||
- Solaris 2.5 or better
|
||||
- FreeBSD (3.2, 4.0 tested)
|
||||
|
||||
- IRIX64 6.5
|
||||
|
||||
To enable it, configure PHP 3 and PHP 4 to use APXS (--with-apxs) and the
|
||||
necessary link extensions (--enable-versioning). Otherwise, all standard
|
||||
installations instructions apply. For example:
|
||||
|
||||
@@ -1,20 +1,195 @@
|
||||
PHP 4.0 NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
|
||||
05 Oct 2000, Version 4.0.3
|
||||
11 Jan 2001, Version 4.0.4pl1
|
||||
- Fixed the various pdf_open_*() functions (Daniel)
|
||||
- Fixed a bug that could cause invalid INI entries to be used under certain
|
||||
circumstances (Zeev)
|
||||
- Fixed a bug in the Apache module that could cause invalid INI values to
|
||||
propogate to different virtual hosts, if one or more of the virtual
|
||||
hosts was configured with engine=Off (Zeev)
|
||||
- Fixed possible crash bugs in the session module (Sascha)
|
||||
- Fixed the ODBC module to build properly with Solid 3.0 and OpenLink (Dan
|
||||
Kalowsky)
|
||||
- Fixed possible corruption of line number information in PHP scripts (Zeev,
|
||||
Zend Engine)
|
||||
- Fixed a few possible crashes in functions that use user-defined callbacks
|
||||
(Zeev, Zend Engine)
|
||||
|
||||
19 Dec 2000, Version 4.0.4
|
||||
- Allow assigning a newly created object by reference. This is needed only if
|
||||
your constructor makes other data structures reference the $this object (for
|
||||
example, $GLOBALS["foobar"] =& $this;)
|
||||
The new syntax is $obj =& new MyClass(); (Andi, Zend Engine)
|
||||
- Allow for three expression types to be sent to functions which are requesting
|
||||
the function argument to be passed by reference (only c. was previously
|
||||
supported):
|
||||
a. func(new myclass());
|
||||
b. func(func2()); where func2() returns a reference, i.e. is defined as
|
||||
function &func2(...)
|
||||
{
|
||||
...
|
||||
}
|
||||
c. func($var); where func() is defined as function func(&$var) {...}
|
||||
You CAN'T count on any other expressions to be passable by reference.
|
||||
(Andi, Zend Engine)
|
||||
- Made ldap_get_entries() return an array even if there are no entries
|
||||
in search result. (Jani)
|
||||
- Fixed bad mod_perl interaction which caused segfaults when using LFS (Sascha)
|
||||
- const CONSTNAME now gets recognized. Before the patch only @const CONSTNAME
|
||||
description was recognized.
|
||||
- Added the is_null() function that will return true if a variable is of
|
||||
type null. (Sterling)
|
||||
- Fixed a bug which made readdir() unusable in some systems. (Jani)
|
||||
- Added the get_defined_functions() function which returns a list of all
|
||||
currently defined functions. (Sterling)
|
||||
- Added the get_defined_vars() function which returns an associative array
|
||||
of all variables defined in the current scope and their subsequent values.
|
||||
(Sterling)
|
||||
- Added the call_user_func_array() function which gives you the ability to
|
||||
call a user function by passing an array of parameters as the second
|
||||
argument. (Sterling)
|
||||
- Added the constant() function which returns the value of a constant given
|
||||
the constant's name. (Sterling)
|
||||
- Implemented support for Perl-style matching regexp delimiters in PCRE.
|
||||
You can use <{[( and )]}> to delimit your expressions now. (Andrei)
|
||||
- Introduced new 'F' modifier in PCRE that lets you specify a function
|
||||
name in the replacement argument to preg_replace() that will be called
|
||||
at run-time to provide the replacement string. It is passed an array of
|
||||
matched pattern and subpatterns. (Andrei)
|
||||
- Put an end to BUG#4615 (kalowsky & Eric Veldhuyzen)
|
||||
- Fixed realpath() in Virtual Directory mode (Daniel)
|
||||
- Integrated the Phil Nelson's bc math library routines into PHP, now that
|
||||
the license allows it (Phil Nelson <phil@cs.wwu.edu>)
|
||||
- Added the xslt_set_error_handler() function to the Sablotron extension.
|
||||
(Sterling)
|
||||
- Improved Sablotron's error handling system allowing you to catch all
|
||||
errors before they are outputted to the screen. (Sterling)
|
||||
- Added OpenSSL extension (Stig Venaas)
|
||||
- Fixed/created support for Solid 3.0 databases (kalowsky)
|
||||
- Fixed support for Solid 2.3 databases (kalowsky)
|
||||
- quoted_printable_decode() function is made RFC-2045 compliant. (Kir)
|
||||
- Modified preg_grep() to always return the results with keys from the original
|
||||
array. (Andrei)
|
||||
- Modified preg_replace() to accept Perl-style $n backreferences in addition
|
||||
to \\n ones. (Andrei)
|
||||
- Modified preg_replace() to ignore backreferences that refer to
|
||||
non-existing subpatterns. (Andrei)
|
||||
- Fixed column-title buffer-overflow in OCIFetchStatement(). (Thies)
|
||||
- Added 'output_handler' INI directive (Zeev)
|
||||
- Fixed some buglets in the output buffering mechanism (Zeev)
|
||||
- Added transparent gzip compression support (Jade Nicoletti, Zeev)
|
||||
- Major overhaul of domxml. Added basic XPath support as well (Uwe)
|
||||
- Added 'r' flag to date() which generates an RFC822 formatted date, e.g.
|
||||
"Thu, 9 Nov 2000 16:33:01 -0500" (Colin)
|
||||
- In CGI mode, $HTTP_SERVER_VARS now includes all of the environment variables
|
||||
as well (Zeev)
|
||||
- Allow user to use mysql_use_result in mysql queries (Stas)
|
||||
- Fixed a memory leak that would occur when restarting Apache often
|
||||
(mookid@sigent.ru)
|
||||
- Fixed a bug that prevented $argv and $argc from being defined in the command
|
||||
line version of PHP (Stas)
|
||||
- Fixed a bug that prevented a changed compile-time extension_dir from
|
||||
affecting modules that were loaded via php.ini (Zeev)
|
||||
- Fixed a bug in ftp_mkdir() when used on ftp server which doesn't return
|
||||
the full path (Jani)
|
||||
- Added ImageCreateFromString() which creates an image stream out of
|
||||
e.g. a MySQL blob. (Mathieu)
|
||||
- Fixed a crash bug in imagewbmp() (Jani)
|
||||
- Changed the sablot configuration file so that if you use any version of
|
||||
Sablotron below 0.44 you must use Sablotron's built-in Expat libraries.
|
||||
(Sterling)
|
||||
- Added basic authentication support to thttpd (Sascha)
|
||||
- Added support for the Caudium webserver (http://caudium.net/). It's based
|
||||
on the Roxen SAPI module. Many bugs have been identified and fixed. (David)
|
||||
- Fixed mysql_close(), pg_close(), msql_close() and sybase_close() - they
|
||||
weren't properly closing the SQL connections (Zeev)
|
||||
- Fixed crypt() to supply random seed if none is given (Andi)
|
||||
- Made print_r() support recursive data structures, e.g. $GLOBALS. (Zeev)
|
||||
- Fixed a bug that caused PHP not to properly flush its output buffer, if more
|
||||
than one output buffer was used. (Zeev)
|
||||
- Fixed a bug that could draw the shutdown sequence of the PHP Apache module
|
||||
into an endless loop, under certain circumstances. It could cause Apache
|
||||
processes under Solaris to get stuck, especially when using output
|
||||
buffering. (Zeev)
|
||||
- Added support for serializing references (Stas)
|
||||
- Fixed conflict with OpenLDAP and Oracle 8.1.x (Jani)
|
||||
- parse_ini_file() supports a new optional 2nd argument that instructs it
|
||||
to divide the directives to arrays according to the sections in which they
|
||||
reside (Zeev)
|
||||
- parse_ini_file() is now thread-safe, and supported under Windows (Zeev)
|
||||
- Unified aborted-connection semantics of all SAPI modules (Sascha)
|
||||
- URL-opened files now store the HTTP response header in $http_response_header
|
||||
(Zeev)
|
||||
- Fixed array_rand() to shuffle results when the number of requested
|
||||
elements is the same as the number of elements in the array. (Andrei)
|
||||
- Added replace parameter to header() (Sascha)
|
||||
- Fixed handling of single quotes in transparent session-id mode (Sascha)
|
||||
- Fixed "php://*" fopen handler (Sascha)
|
||||
- Made rename work in threadsafe enviroments (Daniel)
|
||||
- Made session_destroy() close files before unlinking (Daniel)
|
||||
- Added array_sum() function. (Andrei)
|
||||
- Fixed a bug in session.c. The php_session_save_current_state did not check
|
||||
if mod_data is NULL and such situation is possible if the user calls
|
||||
session_module_name with a parameter. (alex@zend.com)
|
||||
- Added IIS Admin extension. (Frank)
|
||||
- OCIBindByName() now does better parameter-checking. (Thies)
|
||||
- Made read() binary-safe in sockets.c (Chris Vandomelen)
|
||||
- Made array_intersect() and array_diff() not alter order (Stig Venaas)
|
||||
- Made ldap_connect() accept URL in host parameter when using OpenLDAP
|
||||
2.x. To use SSL, use ldaps://host/ as URL. (Stig Venaas)
|
||||
- Made resource type names visible, e.g. var_dump() and
|
||||
get_resource_type() display "file" for file resources. (Andrei)
|
||||
- Added the curl_getinfo() function to find out information about a CURL
|
||||
transfer. This function requires cURL 7.4.0 or above. (Sterling)
|
||||
- Added the CURLOPT_KRB4, CURLOPT_INTERFACE, CURLOPT_QUOTE, CURLOPT_POSTQUOTE,
|
||||
CURLOPT_QUOTE and CURLOPT_HTTPPROXYTUNNELL options. (Sterling)
|
||||
- Renamed the shm_* functions to shmop_* (Derick)
|
||||
- Updated ext/mysql/libmysql to version 3.23 (tim@mysql.com)
|
||||
- Added ldap_get_option() and ldap_set_option() functions (Stig Venaas)
|
||||
- Fixed a crash in CGI mode, in case no file was provided
|
||||
(Daniel Beulshausen& Zeev)
|
||||
- Fixed possible crash bug in imap_fetchstructure() (Jani)
|
||||
- Fixed possible crash bug in imap_open() (Jani & Mark Musone)
|
||||
- Added url_rewriter.tags configuration directive (Sascha)
|
||||
- Added CORBA client extension, ready for use (eriksson@php.net)
|
||||
- Fixed memory leak in x-httpd-source mode (Jason Greene)
|
||||
- Changed ext/gd not to be enabled by default (Jani)
|
||||
- Make increment of empty string ("") behave like in PHP 3 and result in "1"
|
||||
(Andi, Zend Engine)
|
||||
- Added POST handler for Adobe FDF format (Hartmut)
|
||||
- Added transparent read and write .gz-files on glibc based systems
|
||||
using the 'zlib:' fopen wrapper (Hartmut)
|
||||
- Fixed a problem in the configuration parser (two null bytes were added
|
||||
to each ENCAPSULATED TC_STRING) (alex@zend.com)
|
||||
- Added HMAC support in the mhash module (nmav@altera.gr)
|
||||
- Added module for Ovrimos sql server (nmav@altera.gr)
|
||||
|
||||
11 Oct 2000, Version 4.0.3
|
||||
- Fixed a possible crash in -a interactive mode (Zeev, Zend Engine)
|
||||
- Added mysql_escape_string() (Peter A. Savitch and & Brian Wang)
|
||||
- Fixed many possible crash bugs with improper use of the printf() family of
|
||||
functions (Andi)
|
||||
- Fixed a problem that allowed users to override admin_value's and admin_flag's
|
||||
(Zeev)
|
||||
- Fixed PostgreSQL module to work when the link handle is omitted (Zeev)
|
||||
- Fixed returning of empty LOB fields in OCI8. (Thies)
|
||||
- Added Calendar module to default Win32 build (Andi)
|
||||
- Added FTP module to default Win32 build (Andi)
|
||||
- Fixed crash in the POSIX getrlimit() function (alex@zend.com)
|
||||
- Fixed dirname() under certain conditions (Andi)
|
||||
- Add --with-imap-ssl to support SSL'ized imap library in RH7 and others
|
||||
- Added --with-imap-ssl to support SSL'ized imap library in RH7 and others
|
||||
(Rasmus)
|
||||
- Fix possible crash bug in parse_url() (Andi)
|
||||
- Fixed possible crash bug in parse_url() (Andi)
|
||||
- Added support for trans sid under Win32 (Daniel)
|
||||
- IPv6 support in fopen (Stig Venaas)
|
||||
- Added IPv6 support in fopen (Stig Venaas)
|
||||
- Added the shmop extension. It allows more general ways of shared memory
|
||||
access. (thanks to Ilia Alshanestky <iliaa@home.com> and Slava Poliakov
|
||||
<slavapl@mailandnews.com> (Derick)
|
||||
- Added the ability for CURLOPT_POSTFIELDS to accept an associative array of
|
||||
HTTP POST variables and values. (Sterling)
|
||||
- Added the CURLOPT_HTTPHEADER option to curl_setopt(). (Sterling)
|
||||
- Add the curl_error() and curl_errno() functions. (Sterling)
|
||||
- Added the curl_error() and curl_errno() functions. (Sterling)
|
||||
- Changed ext/db not to be enabled by default (Jani)
|
||||
- Fixed building Apache SAPI module on SCO UnixWare (Sascha)
|
||||
- Fixed writing empty session sets to shared memory (tcarroll@chc-chimes.com)
|
||||
@@ -39,7 +214,7 @@ PHP 4.0 NEWS
|
||||
word is longer than the maximum allowed. (Derick)
|
||||
- Added functions pg_put_line and pg_end_copy (Dirk Elmendorf)
|
||||
- Added second parameter for parse_str to save result (John Bafford)
|
||||
- Fix bug with curl places extra data in the output. (medvitz@medvitz.net)
|
||||
- Fixed bug with curl places extra data in the output. (medvitz@medvitz.net)
|
||||
- Added the pathinfo() function. (Sterling)
|
||||
- Updated sybase_ct module and its sybase_query to use high performance API.
|
||||
(Joey)
|
||||
@@ -49,11 +224,10 @@ PHP 4.0 NEWS
|
||||
display_startup_errors - see php.ini-dist for further information (Zeev)
|
||||
- Worked around a bug in the libc5 implementation of readdir() (Stas)
|
||||
- Fixed some potential OpenBSD and NetBSD crash bugs when opening files. (Andi)
|
||||
- Add EscapeShellArg() function (Rasmus)
|
||||
- Add a php.ini option session.use_trans_sid to enable/disable trans-sid.
|
||||
- Added EscapeShellArg() function (Rasmus)
|
||||
- Added a php.ini option session.use_trans_sid to enable/disable trans-sid.
|
||||
(Sterling)
|
||||
- Quick-fix for the file upload security alert (Rasmus)
|
||||
- Add the Sablotron extension for XSL parsing. (Sterling)
|
||||
- Added the Sablotron extension for XSL parsing. (Sterling)
|
||||
- Fixed a bug in checkdate() which caused < 1 years to be valid (Jani)
|
||||
- Added support for an optional output handler function for output
|
||||
buffering. This enables transparent rendering of XML through XSL,
|
||||
@@ -84,7 +258,7 @@ PHP 4.0 NEWS
|
||||
syntax for the walk function. (Andrei)
|
||||
- Fixed segfault with fgets(), fgetcsv(), fgetss(), and fread() when
|
||||
called with negative length argument. (Torben)
|
||||
- Fix by-reference parameters passing for xml_ functions and for scanf
|
||||
- Fixed by-reference parameters passing for xml_ functions and for scanf
|
||||
functions (Stas)
|
||||
- Added experimental Oracle LDAP SDK support. 8.1.6 or later needed. Configure
|
||||
with something like --with-ldap=/usr/local/oracle/product/8.1.6 (Stig Venaas)
|
||||
|
||||
+5
-16
@@ -1,17 +1,6 @@
|
||||
How to install PHP with the BCMath arbitrary precision math library?
|
||||
--------------------------------------------------------------------
|
||||
As of PHP 4.0.4, the BC math library routines are bundled in the
|
||||
standard PHP distribution. There is no need to install any additional
|
||||
files.
|
||||
|
||||
Due to license restrictions, the BC math library can no longer be distributed
|
||||
along with PHP. The BC math library is distributed under the restrictive
|
||||
GNU Public License, and PHP is no longer distributed under that license, but
|
||||
under a less restrictive license, the PHP License.
|
||||
|
||||
If you want to enable BC math support (recommended), all you have to do is
|
||||
simply download http://www.php.net/extra/number4.tar.gz, and untar it on the
|
||||
top level php4 directory.
|
||||
|
||||
A typical way of doing this would be (assuming that you have lynx):
|
||||
cd ~/php4
|
||||
lynx -dump -source http://www.php.net/extra/number4.tar.gz | gzip -d | tar xvf -
|
||||
|
||||
The PHP Group
|
||||
Thanks goes to Phil Nelson, for releasing the BC math library routines
|
||||
under the LGPL.
|
||||
+5
-1
@@ -51,9 +51,13 @@ FORMAT OF FUNCTION DEFINITIONS FILE
|
||||
']'s as there where '['s. Currently, it does not harm if you forget to do it
|
||||
or there is a wrong amount of ']'s, but this may change in the future.
|
||||
|
||||
An additional short description may be added after the parameters.
|
||||
If present it will be filled into the 'proto' header comments in the stubs
|
||||
code and the <refpurpose> tag in the XML documentation.
|
||||
|
||||
An example:
|
||||
|
||||
my_function(int arg1, int arg2 [, int arg3 [, int arg4]])
|
||||
my_function(int arg1, int arg2 [, int arg3 [, int arg4]]) this is my 1st
|
||||
|
||||
Arguments arg3 and arg4 are optional.
|
||||
|
||||
|
||||
+53
-2
@@ -86,6 +86,28 @@ the 'configure' program to set up PHP; LDFLAGS and EXTRA_LIBS. Make
|
||||
sure that you also export these variables to the build process.
|
||||
(Type 'export LDFLAGS EXTRA_LIBS' in the shell to do this.)
|
||||
|
||||
If you are using 3rd party tools and libraries which are installed
|
||||
in non-standard locations, you may need to set the environment
|
||||
variable LD_LIBRARY_PATH to point to the library's location, prior
|
||||
to running the Zeus Web Server. For example, if you have compiled
|
||||
external MySQL support, and mysql is installed in /usr/local/mysql,
|
||||
you should set LD_LIBRARY_PATH to '/usr/local/mysql/lib/mysql'
|
||||
and then 'export LD_LIBRARY_PATH'. For convenience, you should add
|
||||
this to the 'start-zeus' script provided.
|
||||
|
||||
Yet another method of ensuring the linked libraries are found is to
|
||||
set the environment variable LD_RUN_PATH before compiling PHP. This
|
||||
works in a similar way to LD_LIBRARY_PATH, but at compile-time.
|
||||
Libraries produced with this envrionment variable set will have its
|
||||
value 'burned' into the resultant binary, specifying a runtime
|
||||
search pth to locate other required libraries such as MySQL.
|
||||
|
||||
On Linux, you can also tell the dynamic linker where to find the
|
||||
libraries, by adding '/usr/local/mysql/lib/mysql' to the file
|
||||
/etc/ld.so.conf - after editting this file, run 'ldconfig' as root,
|
||||
to use the changes.
|
||||
|
||||
|
||||
Specific examples:
|
||||
|
||||
Solaris + gcc:
|
||||
@@ -93,10 +115,39 @@ Ensure you run ./configure with the `--enable-libgcc' parameter. You
|
||||
may need to set LDFLAGS to '-L/usr/local/egcs/lib' (path depends on
|
||||
your gcc installation)
|
||||
|
||||
FreeBSD 4.0:
|
||||
FreeBSD 4:
|
||||
Some people may find they need to run ./configure with the
|
||||
'--enable-libgcc' compile option too.
|
||||
|
||||
|
||||
Performance issues
|
||||
==================
|
||||
|
||||
To make PHP run fast under Zeus, check the following points:
|
||||
|
||||
1) Run PHP as an ISAPI module, not a CGI - compile it with the --with-zeus=...
|
||||
flag!
|
||||
|
||||
2) Tune the ISAPI runner to your required workload. There are several
|
||||
tuneables that can be given. These are set by adding the appropriate
|
||||
lines to the $ZEUSHOME/web/global.cfg file. Changes to this file will only
|
||||
be picked up after the web server is restarted (run stop-zeus ; start-zeus)
|
||||
|
||||
tuning!modules!isapi!external!maxthreads xxx
|
||||
|
||||
- Sets the maximum number of threads that the ISAPI runner will spawn. If
|
||||
further PHP page requests arrive, they will be queued until a current
|
||||
page is finished. For busy websites, we suggest increasing this value
|
||||
(defaults to 16). Replace the 'xxx' in the above line with the required
|
||||
number of threads. Note that the threads are equally shared between
|
||||
ISAPI extensions and filters, so if you want to handle 100 concurrent
|
||||
PHP page requests, set this tuneable to 200.
|
||||
|
||||
tuning!modules!isapi!external!minthreads xxx
|
||||
|
||||
- Sets the minimum number of threads. Idle threads will be kept in a pool,
|
||||
which avoids costly thread creation/deletion.
|
||||
|
||||
|
||||
For more information and help with Zeus, please visit our website:
|
||||
http://www.zeus.com
|
||||
http://support.zeus.com
|
||||
@@ -7,6 +7,10 @@ Zend
|
||||
traverse an array without copying each element.
|
||||
* look at replacing c-lib call tolower().
|
||||
* make hash API functions work with HASH_OF() to save time.
|
||||
* native large number support (probably with GNU GMP)
|
||||
* Const'ify APIs. Right now, many functions leave parameters untouched,
|
||||
but don't declare those as const. This makes interaction with other
|
||||
interfaces difficult which pass const parameters to us.
|
||||
|
||||
global
|
||||
------
|
||||
@@ -16,7 +20,6 @@ global
|
||||
* make sure all source files have the "right" copyright.
|
||||
* the following modules still use PHP3_TLS_*() macros (and thereby don't
|
||||
work in ZTS mode): ext/dav/dav.c, ext/db/db.c, ext/gd/gd.c, ext/ldap/ldap.c
|
||||
* INI system causes segfaults in ZTS mode (operates on static HashTable)
|
||||
* make sure that all ZTS globals get destructed. Most ts_allocate_id()
|
||||
calls should have a dtor entry.
|
||||
* activate all extensions by default that don't rely on external
|
||||
@@ -24,7 +27,7 @@ global
|
||||
* --enable-all in configure. (--enable-shared=max ...)
|
||||
* make configure print out a summary when it's done (like XEmacs)
|
||||
* replace standard functions which work on static data with
|
||||
reentrancy-safe functions.
|
||||
reentrancy-safe functions (DONE?).
|
||||
* on some platforms unimplemented function will just do nothing (e.g. symlink)
|
||||
they should print a warning or not even be defined!
|
||||
* implement javadoc based function docs template system.
|
||||
@@ -50,10 +53,6 @@ ext/dav
|
||||
--------
|
||||
* rewrite.
|
||||
|
||||
ext/mcrypt
|
||||
----------
|
||||
* port to mcrypt-2.6 or later
|
||||
|
||||
ext/oci8
|
||||
--------
|
||||
* all OCIFetch*() functions should return 0 for no more data and false on error.
|
||||
@@ -62,7 +61,6 @@ ext/oci8
|
||||
|
||||
ext/pcre
|
||||
--------
|
||||
* have an option for preg_grep() to return keys as well.
|
||||
* update the online docs from version 3.1 man page
|
||||
|
||||
ext/session
|
||||
@@ -76,6 +74,7 @@ ext/session
|
||||
|
||||
ext/standard
|
||||
------------
|
||||
* array_mean()
|
||||
* add a version number to data serialized via serialize().
|
||||
* array_add(). (Andrei)
|
||||
* possibly modify parsing of GPC data to automatically create arrays if
|
||||
@@ -91,6 +90,8 @@ ext/standard
|
||||
strrpos()
|
||||
strrchr()
|
||||
strip_tags()
|
||||
* rewrite win32 SMTP code to be useable for *ix to, maybe as a (default)
|
||||
module of its own (Hartmut)
|
||||
|
||||
ext/wddx
|
||||
--------
|
||||
|
||||
+76
-33
@@ -38,13 +38,16 @@ typedef struct {
|
||||
} tsrm_resource_type;
|
||||
|
||||
|
||||
#define TSRM_SHUFFLE_RSRC_ID(rsrc_id) ((rsrc_id)+1)
|
||||
#define TSRM_UNSHUFFLE_RSRC_ID(rsrc_id) ((rsrc_id)-1)
|
||||
|
||||
/* The memory manager table */
|
||||
static tsrm_tls_entry **tsrm_tls_table;
|
||||
static tsrm_tls_entry **tsrm_tls_table=NULL;
|
||||
static int tsrm_tls_table_size;
|
||||
static ts_rsrc_id id_count;
|
||||
|
||||
/* The resource sizes table */
|
||||
static tsrm_resource_type *resource_types_table;
|
||||
static tsrm_resource_type *resource_types_table=NULL;
|
||||
static int resource_types_table_size;
|
||||
|
||||
|
||||
@@ -55,20 +58,31 @@ static void (*tsrm_new_thread_begin_handler)();
|
||||
static void (*tsrm_new_thread_end_handler)();
|
||||
|
||||
/* Debug support */
|
||||
static int tsrm_debug(const char *format, ...);
|
||||
static int tsrm_debug_status;
|
||||
|
||||
int tsrm_error(int level, const char *format, ...);
|
||||
static int tsrm_error_level;
|
||||
static FILE *tsrm_error_file;
|
||||
#if TSRM_DEBUG
|
||||
#define TSRM_ERROR tsrm_error
|
||||
#define TSRM_SAFE_ARRAY_OFFSET(array, offset, range) (((offset)>=0 && (offset)<(range)) ? array[offset] : NULL)
|
||||
#else
|
||||
#define TSRM_ERROR
|
||||
#define TSRM_SAFE_ARRAY_OFFSET(array, offset, range) array[offset]
|
||||
#endif
|
||||
|
||||
/* Startup TSRM (call once for the entire process) */
|
||||
TSRM_API int tsrm_startup(int expected_threads, int expected_resources, int debug_status)
|
||||
TSRM_API int tsrm_startup(int expected_threads, int expected_resources, int debug_level, char *debug_filename)
|
||||
{
|
||||
#if defined(GNUPTH)
|
||||
pth_init();
|
||||
#endif
|
||||
|
||||
tsrm_error_file = stderr;
|
||||
tsrm_error_set(debug_level, debug_filename);
|
||||
tsrm_tls_table_size = expected_threads;
|
||||
|
||||
tsrm_tls_table = (tsrm_tls_entry **) calloc(tsrm_tls_table_size, sizeof(tsrm_tls_entry *));
|
||||
if (!tsrm_tls_table) {
|
||||
TSRM_ERROR(TSRM_ERROR_LEVEL_ERROR, "Unable to allocate TLS table");
|
||||
return 0;
|
||||
}
|
||||
id_count=0;
|
||||
@@ -76,7 +90,9 @@ TSRM_API int tsrm_startup(int expected_threads, int expected_resources, int debu
|
||||
resource_types_table_size = expected_resources;
|
||||
resource_types_table = (tsrm_resource_type *) calloc(resource_types_table_size, sizeof(tsrm_resource_type));
|
||||
if (!resource_types_table) {
|
||||
TSRM_ERROR(TSRM_ERROR_LEVEL_ERROR, "Unable to allocate resource types table");
|
||||
free(tsrm_tls_table);
|
||||
tsrm_tls_table = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -84,9 +100,7 @@ TSRM_API int tsrm_startup(int expected_threads, int expected_resources, int debu
|
||||
|
||||
tsrm_new_thread_begin_handler = tsrm_new_thread_end_handler = NULL;
|
||||
|
||||
tsrm_debug_status = debug_status;
|
||||
|
||||
tsrm_debug("Started up TSRM, %d expected threads, %d expected resources\n", expected_threads, expected_resources);
|
||||
TSRM_ERROR(TSRM_ERROR_LEVEL_CORE, "Started up TSRM, %d expected threads, %d expected resources", expected_threads, expected_resources);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -113,12 +127,18 @@ TSRM_API void tsrm_shutdown(void)
|
||||
}
|
||||
}
|
||||
free(tsrm_tls_table);
|
||||
tsrm_tls_table = NULL;
|
||||
}
|
||||
if (resource_types_table) {
|
||||
free(resource_types_table);
|
||||
resource_types_table=NULL;
|
||||
}
|
||||
tsrm_mutex_free(tsmm_mutex);
|
||||
tsrm_debug("Shutdown TSRM\n");
|
||||
tsmm_mutex = NULL;
|
||||
TSRM_ERROR(TSRM_ERROR_LEVEL_CORE, "Shutdown TSRM");
|
||||
if (tsrm_error_file!=stderr) {
|
||||
fclose(tsrm_error_file);
|
||||
}
|
||||
#if defined(GNUPTH)
|
||||
pth_kill();
|
||||
#endif
|
||||
@@ -131,19 +151,21 @@ TSRM_API ts_rsrc_id ts_allocate_id(size_t size, ts_allocate_ctor ctor, ts_alloca
|
||||
ts_rsrc_id new_id;
|
||||
int i;
|
||||
|
||||
tsrm_debug("Obtaining a new resource id, %d bytes\n", size);
|
||||
TSRM_ERROR(TSRM_ERROR_LEVEL_CORE, "Obtaining a new resource id, %d bytes", size);
|
||||
|
||||
tsrm_mutex_lock(tsmm_mutex);
|
||||
|
||||
/* obtain a resource id */
|
||||
new_id = id_count++;
|
||||
tsrm_debug("Obtained resource id %d\n", new_id);
|
||||
TSRM_ERROR(TSRM_ERROR_LEVEL_CORE, "Obtained resource id %d", TSRM_SHUFFLE_RSRC_ID(new_id));
|
||||
|
||||
/* store the new resource type in the resource sizes table */
|
||||
if (resource_types_table_size < id_count) {
|
||||
resource_types_table = (tsrm_resource_type *) realloc(resource_types_table, sizeof(tsrm_resource_type)*id_count);
|
||||
if (!resource_types_table) {
|
||||
return -1;
|
||||
tsrm_mutex_unlock(tsmm_mutex);
|
||||
TSRM_ERROR(TSRM_ERROR_LEVEL_ERROR, "Unable to allocate storage for resource");
|
||||
return 0;
|
||||
}
|
||||
resource_types_table_size = id_count;
|
||||
}
|
||||
@@ -173,8 +195,8 @@ TSRM_API ts_rsrc_id ts_allocate_id(size_t size, ts_allocate_ctor ctor, ts_alloca
|
||||
}
|
||||
tsrm_mutex_unlock(tsmm_mutex);
|
||||
|
||||
tsrm_debug("Successfully allocated new resource id %d\n", new_id);
|
||||
return new_id;
|
||||
TSRM_ERROR(TSRM_ERROR_LEVEL_CORE, "Successfully allocated new resource id %d", TSRM_SHUFFLE_RSRC_ID(new_id));
|
||||
return TSRM_SHUFFLE_RSRC_ID(new_id);
|
||||
}
|
||||
|
||||
|
||||
@@ -182,6 +204,7 @@ static void allocate_new_resource(tsrm_tls_entry **thread_resources_ptr, THREAD_
|
||||
{
|
||||
int i;
|
||||
|
||||
TSRM_ERROR(TSRM_ERROR_LEVEL_CORE, "Creating data structures for thread %x", thread_id);
|
||||
(*thread_resources_ptr) = (tsrm_tls_entry *) malloc(sizeof(tsrm_tls_entry));
|
||||
(*thread_resources_ptr)->storage = (void **) malloc(sizeof(void *)*id_count);
|
||||
(*thread_resources_ptr)->count = id_count;
|
||||
@@ -218,7 +241,7 @@ TSRM_API void *ts_resource_ex(ts_rsrc_id id, THREAD_T *th_id)
|
||||
} else {
|
||||
thread_id = tsrm_thread_id();
|
||||
}
|
||||
tsrm_debug("Fetching resource id %d for thread %ld\n", id, (long) thread_id);
|
||||
TSRM_ERROR(TSRM_ERROR_LEVEL_INFO, "Fetching resource id %d for thread %ld", id, (long) thread_id);
|
||||
tsrm_mutex_lock(tsmm_mutex);
|
||||
|
||||
hash_value = THREAD_HASH_OF(thread_id, tsrm_tls_table_size);
|
||||
@@ -246,11 +269,15 @@ TSRM_API void *ts_resource_ex(ts_rsrc_id id, THREAD_T *th_id)
|
||||
} while (thread_resources);
|
||||
}
|
||||
|
||||
resource = thread_resources->storage[id];
|
||||
resource = TSRM_SAFE_ARRAY_OFFSET(thread_resources->storage, TSRM_UNSHUFFLE_RSRC_ID(id), thread_resources->count);
|
||||
|
||||
tsrm_mutex_unlock(tsmm_mutex);
|
||||
|
||||
tsrm_debug("Successfully fetched resource id %d for thread id %ld - %x\n", id, (long) thread_id, (long) resource);
|
||||
if (resource) {
|
||||
TSRM_ERROR(TSRM_ERROR_LEVEL_INFO, "Successfully fetched resource id %d for thread id %ld - %x", id, (long) thread_id, (long) resource);
|
||||
} else {
|
||||
TSRM_ERROR(TSRM_ERROR_LEVEL_ERROR, "Resource id %d is out of range (%d..%d)", id, TSRM_SHUFFLE_RSRC_ID(0), TSRM_SHUFFLE_RSRC_ID(thread_resources->count-1));
|
||||
}
|
||||
return resource;
|
||||
}
|
||||
|
||||
@@ -325,7 +352,7 @@ TSRM_API THREAD_T tsrm_thread_id(void)
|
||||
|
||||
|
||||
/* Allocate a mutex */
|
||||
TSRM_API MUTEX_T tsrm_mutex_alloc( void )
|
||||
TSRM_API MUTEX_T tsrm_mutex_alloc(void)
|
||||
{
|
||||
MUTEX_T mutexp;
|
||||
|
||||
@@ -351,7 +378,7 @@ TSRM_API MUTEX_T tsrm_mutex_alloc( void )
|
||||
|
||||
|
||||
/* Free a mutex */
|
||||
TSRM_API void tsrm_mutex_free( MUTEX_T mutexp )
|
||||
TSRM_API void tsrm_mutex_free(MUTEX_T mutexp)
|
||||
{
|
||||
if (mutexp) {
|
||||
#ifdef TSRM_WIN32
|
||||
@@ -374,11 +401,9 @@ TSRM_API void tsrm_mutex_free( MUTEX_T mutexp )
|
||||
|
||||
|
||||
/* Lock a mutex */
|
||||
TSRM_API int tsrm_mutex_lock( MUTEX_T mutexp )
|
||||
TSRM_API int tsrm_mutex_lock(MUTEX_T mutexp)
|
||||
{
|
||||
#if 0
|
||||
tsrm_debug("Mutex locked thread: %ld\n",tsrm_thread_id());
|
||||
#endif
|
||||
TSRM_ERROR(TSRM_ERROR_LEVEL_INFO, "Mutex locked thread: %ld", tsrm_thread_id());
|
||||
#ifdef TSRM_WIN32
|
||||
EnterCriticalSection(mutexp);
|
||||
return 1;
|
||||
@@ -395,11 +420,9 @@ TSRM_API int tsrm_mutex_lock( MUTEX_T mutexp )
|
||||
|
||||
|
||||
/* Unlock a mutex */
|
||||
TSRM_API int tsrm_mutex_unlock( MUTEX_T mutexp )
|
||||
TSRM_API int tsrm_mutex_unlock(MUTEX_T mutexp)
|
||||
{
|
||||
#if 0
|
||||
tsrm_debug("Mutex unlocked thread: %ld\n",tsrm_thread_id());
|
||||
#endif
|
||||
TSRM_ERROR(TSRM_ERROR_LEVEL_INFO, "Mutex unlocked thread: %ld", tsrm_thread_id());
|
||||
#ifdef TSRM_WIN32
|
||||
LeaveCriticalSection(mutexp);
|
||||
return 1;
|
||||
@@ -438,25 +461,45 @@ TSRM_API void *tsrm_set_new_thread_end_handler(void (*new_thread_end_handler)(TH
|
||||
* Debug support
|
||||
*/
|
||||
|
||||
static int tsrm_debug(const char *format, ...)
|
||||
#if TSRM_DEBUG
|
||||
int tsrm_error(int level, const char *format, ...)
|
||||
{
|
||||
if (tsrm_debug_status) {
|
||||
if (level<=tsrm_error_level) {
|
||||
va_list args;
|
||||
int size;
|
||||
|
||||
fprintf(tsrm_error_file, "TSRM: ");
|
||||
va_start(args, format);
|
||||
size = vprintf(format, args);
|
||||
size = vfprintf(tsrm_error_file, format, args);
|
||||
va_end(args);
|
||||
fprintf(tsrm_error_file, "\n");
|
||||
fflush(tsrm_error_file);
|
||||
return size;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
void tsrm_debug_set(int status)
|
||||
void tsrm_error_set(int level, char *debug_filename)
|
||||
{
|
||||
tsrm_debug_status = status;
|
||||
tsrm_error_level = level;
|
||||
|
||||
#if TSRM_DEBUG
|
||||
if (tsrm_error_file!=stderr) { /* close files opened earlier */
|
||||
fclose(tsrm_error_file);
|
||||
}
|
||||
|
||||
if (debug_filename) {
|
||||
tsrm_error_file = fopen(debug_filename, "w");
|
||||
if (!tsrm_error_file) {
|
||||
tsrm_error_file = stderr;
|
||||
}
|
||||
} else {
|
||||
tsrm_error_file = stderr;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif /* ZTS */
|
||||
+3
-3
@@ -42,7 +42,7 @@ RSC=rc.exe
|
||||
# PROP Intermediate_Dir "Debug_TS"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /I "C:\Projects\TSRM" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "." /D "_DEBUG" /D "ZTS" /D "_LIB" /D "TSRM_EXPORTS" /D "WIN32" /D "_MBCS" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "." /D "_DEBUG" /D "ZTS" /D "_LIB" /D "TSRM_EXPORTS" /D "WIN32" /D "_MBCS" /D TSRM_DEBUG=1 /YX /FD /GZ /c
|
||||
# ADD BASE RSC /l 0x40d /d "_DEBUG"
|
||||
# ADD RSC /l 0x40d /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
@@ -65,7 +65,7 @@ LIB32=link.exe -lib
|
||||
# PROP Intermediate_Dir "Release_TS"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /D "NDEBUG" /D "ZTS" /D "_LIB" /D "TSRM_EXPORTS" /D "WIN32" /D "_MBCS" /YX /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /D "NDEBUG" /D "ZTS" /D "_LIB" /D "TSRM_EXPORTS" /D "WIN32" /D "_MBCS" /D TSRM_DEBUG=0 /YX /FD /c
|
||||
# ADD BASE RSC /l 0x40d /d "NDEBUG"
|
||||
# ADD RSC /l 0x40d /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
@@ -88,7 +88,7 @@ LIB32=link.exe -lib
|
||||
# PROP Intermediate_Dir "Release_TS_inline"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "TSRM_EXPORTS" /YX /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /D "NDEBUG" /D "ZTS" /D "_LIB" /D "TSRM_EXPORTS" /D "WIN32" /D "_MBCS" /YX /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /D "NDEBUG" /D "ZTS" /D "_LIB" /D "TSRM_EXPORTS" /D "WIN32" /D "_MBCS" /D TSRM_DEBUG=0 /YX /FD /c
|
||||
# ADD BASE RSC /l 0x40d /d "NDEBUG"
|
||||
# ADD RSC /l 0x40d /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
|
||||
+6
-6
@@ -14,11 +14,7 @@
|
||||
#define TSRM_H
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# undef PACKAGE
|
||||
# undef VERSION
|
||||
# include "tsrm_config.h"
|
||||
# undef PACKAGE
|
||||
# undef VERSION
|
||||
#endif
|
||||
|
||||
/* Only compile multi-threading functions if we're in ZTS mode */
|
||||
@@ -77,7 +73,7 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
/* startup/shutdown */
|
||||
TSRM_API int tsrm_startup(int expected_threads, int expected_resources, int debug_status);
|
||||
TSRM_API int tsrm_startup(int expected_threads, int expected_resources, int debug_level, char *debug_filename);
|
||||
TSRM_API void tsrm_shutdown(void);
|
||||
|
||||
/* allocates a new thread-safe-resource id */
|
||||
@@ -95,7 +91,11 @@ TSRM_API void ts_free_id(ts_rsrc_id id);
|
||||
|
||||
|
||||
/* Debug support */
|
||||
TSRM_API void tsrm_debug_set(int status);
|
||||
#define TSRM_ERROR_LEVEL_ERROR 1
|
||||
#define TSRM_ERROR_LEVEL_CORE 2
|
||||
#define TSRM_ERROR_LEVEL_INFO 3
|
||||
TSRM_API int tsrm_error(int level, const char *format, ...);
|
||||
TSRM_API void tsrm_error_set(int level, char *debug_filename);
|
||||
|
||||
/* utility functions */
|
||||
TSRM_API THREAD_T tsrm_thread_id(void);
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ dnl Minimalistic configure.in for TSRM.
|
||||
dnl
|
||||
|
||||
AC_INIT(TSRM.c)
|
||||
AM_INIT_AUTOMAKE(TSRM, 1.0)
|
||||
AM_INIT_AUTOMAKE(TSRM, 1.0, nodefine)
|
||||
AM_CONFIG_HEADER(tsrm_config.h)
|
||||
|
||||
sinclude(tsrm.m4)
|
||||
|
||||
+32
-4
@@ -199,7 +199,7 @@ CWD_API void virtual_cwd_shutdown(void)
|
||||
free(main_cwd_state.cwd); /* Don't use CWD_STATE_FREE because the non global states will probably use emalloc()/efree() */
|
||||
}
|
||||
|
||||
CWD_API char *virtual_getcwd_ex(int *length)
|
||||
CWD_API char *virtual_getcwd_ex(size_t *length)
|
||||
{
|
||||
cwd_state *state;
|
||||
CWDLS_FETCH();
|
||||
@@ -442,7 +442,7 @@ CWD_API char *virtual_realpath(const char *path, char *real_path)
|
||||
CWD_STATE_COPY(&new_state, &CWDG(cwd));
|
||||
retval = virtual_file_ex(&new_state, path, NULL);
|
||||
|
||||
if(retval) {
|
||||
if (!retval) {
|
||||
int len = new_state.cwd_length>MAXPATHLEN-1?MAXPATHLEN-1:new_state.cwd_length;
|
||||
memcpy(real_path, new_state.cwd, len);
|
||||
real_path[len] = '\0';
|
||||
@@ -452,18 +452,24 @@ CWD_API char *virtual_realpath(const char *path, char *real_path)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
CWD_API int virtual_filepath(const char *path, char **filepath)
|
||||
CWD_API int virtual_filepath_ex(const char *path, char **filepath, verify_path_func verify_path)
|
||||
{
|
||||
cwd_state new_state;
|
||||
int retval;
|
||||
CWDLS_FETCH();
|
||||
|
||||
CWD_STATE_COPY(&new_state, &CWDG(cwd));
|
||||
retval = virtual_file_ex(&new_state, path, php_is_file_ok);
|
||||
retval = virtual_file_ex(&new_state, path, verify_path);
|
||||
|
||||
*filepath = new_state.cwd;
|
||||
|
||||
return retval;
|
||||
|
||||
}
|
||||
|
||||
CWD_API int virtual_filepath(const char *path, char **filepath)
|
||||
{
|
||||
return virtual_filepath_ex(path, filepath, php_is_file_ok);
|
||||
}
|
||||
|
||||
CWD_API FILE *virtual_fopen(const char *path, const char *mode)
|
||||
@@ -574,6 +580,28 @@ CWD_API int virtual_creat(const char *path, mode_t mode)
|
||||
return f;
|
||||
}
|
||||
|
||||
CWD_API int virtual_rename(char *oldname, char *newname)
|
||||
{
|
||||
cwd_state old_state;
|
||||
cwd_state new_state;
|
||||
int retval;
|
||||
CWDLS_FETCH();
|
||||
|
||||
CWD_STATE_COPY(&old_state, &CWDG(cwd));
|
||||
virtual_file_ex(&old_state, oldname, NULL);
|
||||
oldname = old_state.cwd;
|
||||
|
||||
CWD_STATE_COPY(&new_state, &CWDG(cwd));
|
||||
virtual_file_ex(&new_state, newname, NULL);
|
||||
newname = new_state.cwd;
|
||||
|
||||
retval = rename(oldname, newname);
|
||||
|
||||
CWD_STATE_FREE(&old_state);
|
||||
CWD_STATE_FREE(&new_state);
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
CWD_API int virtual_stat(const char *path, struct stat *buf)
|
||||
{
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
#include "readdir.h"
|
||||
#include <sys/utime.h>
|
||||
/* mode_t isn't defined on Windows */
|
||||
typedef int mode_t;
|
||||
typedef unsigned short mode_t;
|
||||
|
||||
#define DEFAULT_SLASH '\\'
|
||||
#define IS_SLASH(c) ((c) == '/' || (c) == '\\')
|
||||
@@ -95,15 +95,17 @@ typedef int (*verify_path_func)(const cwd_state *);
|
||||
|
||||
CWD_API void virtual_cwd_startup(void);
|
||||
CWD_API void virtual_cwd_shutdown(void);
|
||||
CWD_API char *virtual_getcwd_ex(int *length);
|
||||
CWD_API char *virtual_getcwd_ex(size_t *length);
|
||||
CWD_API char *virtual_getcwd(char *buf, size_t size);
|
||||
CWD_API int virtual_chdir(const char *path);
|
||||
CWD_API int virtual_chdir_file(const char *path, int (*p_chdir)(const char *path));
|
||||
CWD_API int virtual_filepath(const char *path, char **filepath);
|
||||
CWD_API int virtual_filepath_ex(const char *path, char **filepath, verify_path_func verify_path);
|
||||
CWD_API char *virtual_realpath(const char *path, char *real_path);
|
||||
CWD_API FILE *virtual_fopen(const char *path, const char *mode);
|
||||
CWD_API int virtual_open(const char *path, int flags, ...);
|
||||
CWD_API int virtual_creat(const char *path, mode_t mode);
|
||||
CWD_API int virtual_rename(char *oldname, char *newname);
|
||||
CWD_API int virtual_stat(const char *path, struct stat *buf);
|
||||
#ifndef TSRM_WIN32
|
||||
CWD_API int virtual_lstat(const char *path, struct stat *buf);
|
||||
@@ -159,6 +161,7 @@ typedef struct _virtual_cwd_globals {
|
||||
#define V_CHDIR_FILE(path) virtual_chdir_file(path, virtual_chdir)
|
||||
#define V_GETWD(buf)
|
||||
#define V_REALPATH(path,real_path) virtual_realpath(path,real_path)
|
||||
#define V_RENAME(oldname,newname) virtual_rename(oldname,newname)
|
||||
#define V_STAT(path, buff) virtual_stat(path, buff)
|
||||
#ifdef TSRM_WIN32
|
||||
#define V_LSTAT(path, buff) virtual_stat(path, buff)
|
||||
@@ -184,6 +187,7 @@ typedef struct _virtual_cwd_globals {
|
||||
#define V_FOPEN(path, mode) fopen(path, mode)
|
||||
#define V_OPEN(open_args) open open_args
|
||||
#define V_CREAT(path, mode) creat(path, mode)
|
||||
#define V_RENAME(oldname,newname) rename(oldname,newname)
|
||||
#define V_CHDIR(path) chdir(path)
|
||||
#define V_CHDIR_FILE(path) virtual_chdir_file(path, chdir)
|
||||
#define V_GETWD(buf) getwd(buf)
|
||||
|
||||
+32
-13
@@ -1,21 +1,23 @@
|
||||
## Process this file with automake to produce Makefile.in -*- makefile -*-
|
||||
|
||||
#CLEANFILES = zend-parser.c zend-parser.h zend-scanner.c zend-parser.output
|
||||
#CLEANFILES = zend_language_parser.c zend_language_parser.h zend_language_scanner.c zend_language_parser.output zend_ini_parser.c zend_ini_parser.h zend_ini_scanner.c zend_ini_parser.output
|
||||
|
||||
AUTOMAKE_OPTIONS=foreign
|
||||
EXTRA_LTLIBRARIES=libZend_cc.la libZend_c.la
|
||||
noinst_LTLIBRARIES=$(ZEND_SCANNER) libZend.la
|
||||
|
||||
libZend_cc_la_SOURCES=zend-scanner-cc.cc
|
||||
libZend_c_la_SOURCES=zend-scanner.c
|
||||
libZend_cc_la_SOURCES=zend_language_scanner_cc.cc zend_ini_scanner_cc.cc
|
||||
libZend_c_la_SOURCES=zend_language_scanner.c zend_ini_scanner.c
|
||||
|
||||
libZend_la_SOURCES=\
|
||||
zend-parser.y \
|
||||
zend_language_parser.y \
|
||||
zend_ini_parser.y \
|
||||
zend_alloc.c zend_compile.c zend_constants.c zend_dynamic_array.c \
|
||||
zend_execute.c zend_execute_API.c zend_highlight.c zend_llist.c \
|
||||
zend_opcode.c zend_operators.c zend_ptr_stack.c zend_stack.c \
|
||||
zend_variables.c zend.c zend_API.c zend_extensions.c zend_hash.c \
|
||||
zend_list.c zend_indent.c zend_builtin_functions.c zend_sprintf.c
|
||||
zend_list.c zend_indent.c zend_builtin_functions.c zend_sprintf.c \
|
||||
zend_ini.c
|
||||
|
||||
libZend_la_LIBADD = $(ZEND_SCANNER)
|
||||
libZend_la_LDFLAGS = @EXTRA_LIBS@
|
||||
@@ -23,19 +25,36 @@ libZend_la_DEPENDENCIES = $(ZEND_SCANNER)
|
||||
|
||||
# automake isn't too clever about "non-standard" use of lex and yacc
|
||||
|
||||
$(libZend_la_OBJECTS) zend-scanner.lo zend-scanner-cc.lo: zend-parser.h
|
||||
$(libZend_la_OBJECTS) zend_language_scanner.lo zend_language_scanner_cc.lo: zend_language_parser.h
|
||||
|
||||
zend-scanner.c: $(srcdir)/zend-scanner.l
|
||||
$(LEX) -Pzend -o$@ -i $(srcdir)/zend-scanner.l
|
||||
zend_ini_scanner.lo zend_ini_scanner_cc.lo: zend_ini_parser.h
|
||||
|
||||
zend-scanner-cc.cc: $(srcdir)/zend-scanner.l
|
||||
$(LEX) -+ -B -i -S$(srcdir)/flex.skl -Pzend -o$@ $(srcdir)/zend-scanner.l
|
||||
# Language parser/scanner rules
|
||||
|
||||
zend-parser.h: zend-parser.c
|
||||
zend-parser.c: $(srcdir)/zend-parser.y
|
||||
$(YACC) -p zend -v -d $(srcdir)/zend-parser.y -o zend-parser.c
|
||||
zend_language_scanner.c: $(srcdir)/zend_language_scanner.l
|
||||
$(LEX) -Pzend -o$@ -i $(srcdir)/zend_language_scanner.l
|
||||
|
||||
zend_language_scanner_cc.cc: $(srcdir)/zend_language_scanner.l
|
||||
$(LEX) -+ -B -i -S$(srcdir)/flex.skl -Pzend -o$@ $(srcdir)/zend_language_scanner.l
|
||||
|
||||
zend_language_parser.h: zend_language_parser.c
|
||||
zend_language_parser.c: $(srcdir)/zend_language_parser.y
|
||||
$(YACC) -p zend -v -d $(srcdir)/zend_language_parser.y -o zend_language_parser.c
|
||||
|
||||
# INI parser/scanner rules
|
||||
|
||||
zend_ini_parser.c: $(srcdir)/zend_ini_parser.y
|
||||
$(YACC) -p ini_ -v -d $(srcdir)/zend_ini_parser.y -o zend_ini_parser.c
|
||||
|
||||
zend_ini_scanner.c: $(srcdir)/zend_ini_scanner.l
|
||||
$(LEX) -Pini_ -o$@ -i $(srcdir)/zend_ini_scanner.l
|
||||
|
||||
zend_ini_scanner_cc.cc: $(srcdir)/zend_ini_scanner.l
|
||||
$(LEX) -+ -B -i -S$(srcdir)/flex.skl -Pini_ -o$@ $(srcdir)/zend_ini_scanner.l
|
||||
zend_ini_parser.h: zend_ini_parser.c
|
||||
|
||||
depend:
|
||||
|
||||
zend_execute.lo: $(srcdir)/zend_execute.c
|
||||
$(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(INLINE_CFLAGS) -c $(srcdir)/zend_execute.c
|
||||
|
||||
@@ -109,3 +109,4 @@ shamelessly lying about it. Here's why:
|
||||
This incompatability is due to the full variable reference
|
||||
within quoted strings feature added in Zend.
|
||||
|
||||
|
||||
+108
-46
@@ -107,14 +107,6 @@ LIB32=link.exe -lib
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\zend-parser.c"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\zend-scanner.c"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -151,10 +143,6 @@ SOURCE=.\zend_extensions.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_gcc_inline.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_hash.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -167,6 +155,26 @@ SOURCE=.\zend_indent.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_ini.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_ini_parser.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_ini_scanner.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\zend_language_parser.c"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\zend_language_scanner.c"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_list.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -211,14 +219,6 @@ SOURCE=.\modules.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\zend-parser.h"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\zend-scanner.h"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -279,6 +279,18 @@ SOURCE=.\zend_indent.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_ini.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\zend_language_parser.h"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\zend_language_scanner.h"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_list.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -307,23 +319,52 @@ SOURCE=.\zend_variables.h
|
||||
# PROP Default_Filter "y"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\zend-parser.y"
|
||||
SOURCE=.\zend_ini_parser.y
|
||||
|
||||
!IF "$(CFG)" == "Zend - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "Zend - Win32 Debug"
|
||||
|
||||
# Begin Custom Build
|
||||
InputDir=.
|
||||
InputPath=.\zend_ini_parser.y
|
||||
|
||||
BuildCmds= \
|
||||
if not "X%CYGWIN%"=="X" bison --output=zend_ini_parser.c -v -d -S "%CYGWIN%\share\bison.simple" -p ini_ zend_ini_parser.y \
|
||||
if "X%CYGWIN%"=="X" bison --output=zend_ini_parser.c -v -d -S "C:\Program Files\Cygnus\share\bison.simple" -p ini_ zend_ini_parser.y \
|
||||
|
||||
|
||||
"$(InputDir)\zend_ini_parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
$(BuildCmds)
|
||||
|
||||
"$(InputDir)\zend_ini_parser.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
$(BuildCmds)
|
||||
# End Custom Build
|
||||
|
||||
!ELSEIF "$(CFG)" == "Zend - Win32 Release_inline"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\zend_language_parser.y"
|
||||
|
||||
!IF "$(CFG)" == "Zend - Win32 Release"
|
||||
|
||||
# Begin Custom Build
|
||||
InputDir=.
|
||||
InputPath=".\zend-parser.y"
|
||||
InputPath=".\zend_language_parser.y"
|
||||
|
||||
BuildCmds= \
|
||||
if not "X%CYGWIN%"=="X" bison --output=zend-parser.c -v -d -S "%CYGWIN%\share\bison.simple" -p zend zend-parser.y \
|
||||
if "X%CYGWIN%"=="X" bison --output=zend-parser.c -v -d -S "C:\Program Files\Cygnus\share\bison.simple" -p zend zend-parser.y \
|
||||
if not "X%CYGWIN%"=="X" bison --output=zend_language_parser.c -v -d -S "%CYGWIN%\share\bison.simple" -p zend zend_language_parser.y \
|
||||
if "X%CYGWIN%"=="X" bison --output=zend_language_parser.c -v -d -S "C:\Program Files\Cygnus\share\bison.simple" -p zend zend_language_parser.y \
|
||||
|
||||
|
||||
"$(InputDir)\zend-parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
"$(InputDir)\zend_language_parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
$(BuildCmds)
|
||||
|
||||
"$(InputDir)\zend-parser.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
"$(InputDir)\zend_language_parser.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
$(BuildCmds)
|
||||
# End Custom Build
|
||||
|
||||
@@ -331,17 +372,17 @@ BuildCmds= \
|
||||
|
||||
# Begin Custom Build
|
||||
InputDir=.
|
||||
InputPath=".\zend-parser.y"
|
||||
InputPath=".\zend_language_parser.y"
|
||||
|
||||
BuildCmds= \
|
||||
if not "X%CYGWIN%"=="X" bison --output=zend-parser.c -v -d -S "%CYGWIN%\share\bison.simple" -p zend zend-parser.y \
|
||||
if "X%CYGWIN%"=="X" bison --output=zend-parser.c -v -d -S "C:\Program Files\Cygnus\share\bison.simple" -p zend zend-parser.y \
|
||||
if not "X%CYGWIN%"=="X" bison --output=zend_language_parser.c -v -d -S "%CYGWIN%\share\bison.simple" -p zend zend_language_parser.y \
|
||||
if "X%CYGWIN%"=="X" bison --output=zend_language_parser.c -v -d -S "C:\Program Files\Cygnus\share\bison.simple" -p zend zend_language_parser.y \
|
||||
|
||||
|
||||
"$(InputDir)\zend-parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
"$(InputDir)\zend_language_parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
$(BuildCmds)
|
||||
|
||||
"$(InputDir)\zend-parser.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
"$(InputDir)\zend_language_parser.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
$(BuildCmds)
|
||||
# End Custom Build
|
||||
|
||||
@@ -349,17 +390,17 @@ BuildCmds= \
|
||||
|
||||
# Begin Custom Build
|
||||
InputDir=.
|
||||
InputPath=".\zend-parser.y"
|
||||
InputPath=".\zend_language_parser.y"
|
||||
|
||||
BuildCmds= \
|
||||
if not "X%CYGWIN%"=="X" bison --output=zend-parser.c -v -d -S "%CYGWIN%\share\bison.simple" -p zend zend-parser.y \
|
||||
if "X%CYGWIN%"=="X" bison --output=zend-parser.c -v -d -S "C:\Program Files\Cygnus\share\bison.simple" -p zend zend-parser.y \
|
||||
if not "X%CYGWIN%"=="X" bison --output=zend_language_parser.c -v -d -S "%CYGWIN%\share\bison.simple" -p zend zend_language_parser.y \
|
||||
if "X%CYGWIN%"=="X" bison --output=zend_language_parser.c -v -d -S "C:\Program Files\Cygnus\share\bison.simple" -p zend zend_language_parser.y \
|
||||
|
||||
|
||||
"$(InputDir)\zend-parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
"$(InputDir)\zend_language_parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
$(BuildCmds)
|
||||
|
||||
"$(InputDir)\zend-parser.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
"$(InputDir)\zend_language_parser.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
$(BuildCmds)
|
||||
# End Custom Build
|
||||
|
||||
@@ -372,35 +413,56 @@ BuildCmds= \
|
||||
# PROP Default_Filter "l"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\zend-scanner.l"
|
||||
SOURCE=.\zend_ini_scanner.l
|
||||
|
||||
!IF "$(CFG)" == "Zend - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "Zend - Win32 Debug"
|
||||
|
||||
# Begin Custom Build
|
||||
InputPath=.\zend_ini_scanner.l
|
||||
|
||||
"zend_ini_scanner.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
flex -B -i -Sflex.skl -Pini_ -ozend_ini_scanner.c zend_ini_scanner.l
|
||||
|
||||
# End Custom Build
|
||||
|
||||
!ELSEIF "$(CFG)" == "Zend - Win32 Release_inline"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\zend_language_scanner.l"
|
||||
|
||||
!IF "$(CFG)" == "Zend - Win32 Release"
|
||||
|
||||
# Begin Custom Build
|
||||
InputPath=".\zend-scanner.l"
|
||||
InputPath=".\zend_language_scanner.l"
|
||||
|
||||
"zend-scanner.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
flex -i -Pzend -ozend-scanner.c zend-scanner.l
|
||||
"zend_language_scanner.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
flex -i -Pzend -ozend_language_scanner.c zend_language_scanner.l
|
||||
|
||||
# End Custom Build
|
||||
|
||||
!ELSEIF "$(CFG)" == "Zend - Win32 Debug"
|
||||
|
||||
# Begin Custom Build
|
||||
InputPath=".\zend-scanner.l"
|
||||
InputPath=".\zend_language_scanner.l"
|
||||
|
||||
"zend-scanner.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
flex -i -Pzend -ozend-scanner.c zend-scanner.l
|
||||
"zend_language_scanner.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
flex -i -Pzend -ozend_language_scanner.c zend_language_scanner.l
|
||||
|
||||
# End Custom Build
|
||||
|
||||
!ELSEIF "$(CFG)" == "Zend - Win32 Release_inline"
|
||||
|
||||
# Begin Custom Build
|
||||
InputPath=".\zend-scanner.l"
|
||||
InputPath=".\zend_language_scanner.l"
|
||||
|
||||
"zend-scanner.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
flex -i -Pzend -ozend-scanner.c zend-scanner.l
|
||||
"zend_language_scanner.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
flex -i -Pzend -ozend_language_scanner.c zend_language_scanner.l
|
||||
|
||||
# End Custom Build
|
||||
|
||||
|
||||
+2
-2
@@ -6,8 +6,8 @@ if test "$YACC" != "bison -y"; then
|
||||
else
|
||||
AC_MSG_CHECKING(bison version)
|
||||
set `bison --version| sed -e 's/^GNU Bison version //' -e 's/\./ /'`
|
||||
if test "${1}" = "1" -a "${2}" -lt "25"; then
|
||||
AC_MSG_WARN(You will need bison 1.25 if you want to regenerate the Zend parser (found ${1}.${2}).)
|
||||
if test "${1}" = "1" -a "${2}" -lt "28"; then
|
||||
AC_MSG_WARN(You will need bison 1.28 if you want to regenerate the Zend parser (found ${1}.${2}).)
|
||||
fi
|
||||
AC_MSG_RESULT(${1}.${2} (ok))
|
||||
fi
|
||||
|
||||
+1
-1
@@ -86,7 +86,7 @@
|
||||
".\zend_llist.h"\
|
||||
".\zend_ptr_stack.h"\
|
||||
".\zend_stack.h"\
|
||||
".\zend-parser.tab.h"\
|
||||
".\zend_language_parser.tab.h"\
|
||||
".\zend.h"\
|
||||
".\zend_errors.h"\
|
||||
".\zend_globals.h"\
|
||||
|
||||
+164
-42
@@ -107,14 +107,6 @@ LIB32=link.exe -lib
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\zend-parser.c"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\zend-scanner.cpp"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -167,6 +159,26 @@ SOURCE=.\zend_indent.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_ini.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_ini_parser.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_ini_scanner.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\zend_language_parser.c"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\zend_language_scanner.cpp"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_list.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -211,14 +223,6 @@ SOURCE=.\modules.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\zend-parser.h"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\zend-scanner.h"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -291,6 +295,26 @@ SOURCE=.\zend_indent.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_ini.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_ini_parser.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_ini_scanner.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\zend_language_parser.h"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\zend_language_scanner.h"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_list.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -319,23 +343,23 @@ SOURCE=.\zend_variables.h
|
||||
# PROP Default_Filter "y"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\zend-parser.y"
|
||||
SOURCE=.\zend_ini_parser.y
|
||||
|
||||
!IF "$(CFG)" == "ZendTS - Win32 Release_TS"
|
||||
|
||||
# Begin Custom Build
|
||||
InputDir=.
|
||||
InputPath=".\zend-parser.y"
|
||||
InputPath=.\zend_ini_parser.y
|
||||
|
||||
BuildCmds= \
|
||||
if not "X%CYGWIN%"=="X" bison --output=zend-parser.c -v -d -S "%CYGWIN%\share\bison.simple" -p zend zend-parser.y \
|
||||
if "X%CYGWIN%"=="X" bison --output=zend-parser.c -v -d -S "C:\Program Files\Cygnus\share\bison.simple" -p zend zend-parser.y \
|
||||
if not "X%CYGWIN%"=="X" bison --output=zend_ini_parser.c -v -d -S "%CYGWIN%\share\bison.simple" -p ini_ zend_ini_parser.y \
|
||||
if "X%CYGWIN%"=="X" bison --output=zend_ini_parser.c -v -d -S "C:\Program Files\Cygnus\share\bison.simple" -p ini_ zend_ini_parser.y \
|
||||
|
||||
|
||||
"$(InputDir)\zend-parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
"$(InputDir)\zend_ini_parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
$(BuildCmds)
|
||||
|
||||
"$(InputDir)\zend-parser.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
"$(InputDir)\zend_ini_parser.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
$(BuildCmds)
|
||||
# End Custom Build
|
||||
|
||||
@@ -343,17 +367,17 @@ BuildCmds= \
|
||||
|
||||
# Begin Custom Build
|
||||
InputDir=.
|
||||
InputPath=".\zend-parser.y"
|
||||
InputPath=.\zend_ini_parser.y
|
||||
|
||||
BuildCmds= \
|
||||
if not "X%CYGWIN%"=="X" bison --output=zend-parser.c -v -d -S "%CYGWIN%\share\bison.simple" -p zend zend-parser.y \
|
||||
if "X%CYGWIN%"=="X" bison --output=zend-parser.c -v -d -S "C:\Program Files\Cygnus\share\bison.simple" -p zend zend-parser.y \
|
||||
if not "X%CYGWIN%"=="X" bison --output=zend_ini_parser.c -v -d -S "%CYGWIN%\share\bison.simple" -p ini_ zend_ini_parser.y \
|
||||
if "X%CYGWIN%"=="X" bison --output=zend_ini_parser.c -v -d -S "C:\Program Files\Cygnus\share\bison.simple" -p ini_ zend_ini_parser.y \
|
||||
|
||||
|
||||
"$(InputDir)\zend-parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
"$(InputDir)\zend_ini_parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
$(BuildCmds)
|
||||
|
||||
"$(InputDir)\zend-parser.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
"$(InputDir)\zend_ini_parser.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
$(BuildCmds)
|
||||
# End Custom Build
|
||||
|
||||
@@ -361,17 +385,78 @@ BuildCmds= \
|
||||
|
||||
# Begin Custom Build
|
||||
InputDir=.
|
||||
InputPath=".\zend-parser.y"
|
||||
InputPath=.\zend_ini_parser.y
|
||||
|
||||
BuildCmds= \
|
||||
if not "X%CYGWIN%"=="X" bison --output=zend-parser.c -v -d -S "%CYGWIN%\share\bison.simple" -p zend zend-parser.y \
|
||||
if "X%CYGWIN%"=="X" bison --output=zend-parser.c -v -d -S "C:\Program Files\Cygnus\share\bison.simple" -p zend zend-parser.y \
|
||||
if not "X%CYGWIN%"=="X" bison --output=zend_ini_parser.c -v -d -S "%CYGWIN%\share\bison.simple" -p ini_ zend_ini_parser.y \
|
||||
if "X%CYGWIN%"=="X" bison --output=zend_ini_parser.c -v -d -S "C:\Program Files\Cygnus\share\bison.simple" -p ini_ zend_ini_parser.y \
|
||||
|
||||
|
||||
"$(InputDir)\zend-parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
"$(InputDir)\zend_ini_parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
$(BuildCmds)
|
||||
|
||||
"$(InputDir)\zend-parser.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
"$(InputDir)\zend_ini_parser.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
$(BuildCmds)
|
||||
# End Custom Build
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\zend_language_parser.y"
|
||||
|
||||
!IF "$(CFG)" == "ZendTS - Win32 Release_TS"
|
||||
|
||||
# Begin Custom Build
|
||||
InputDir=.
|
||||
InputPath=".\zend_language_parser.y"
|
||||
|
||||
BuildCmds= \
|
||||
if not "X%CYGWIN%"=="X" bison --output=zend_language_parser.c -v -d -S "%CYGWIN%\share\bison.simple" -p zend zend_language_parser.y \
|
||||
if "X%CYGWIN%"=="X" bison --output=zend_language_parser.c -v -d -S "C:\Program Files\Cygnus\share\bison.simple" -p zend zend_language_parser.y \
|
||||
|
||||
|
||||
"$(InputDir)\zend_language_parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
$(BuildCmds)
|
||||
|
||||
"$(InputDir)\zend_language_parser.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
$(BuildCmds)
|
||||
# End Custom Build
|
||||
|
||||
!ELSEIF "$(CFG)" == "ZendTS - Win32 Debug_TS"
|
||||
|
||||
# Begin Custom Build
|
||||
InputDir=.
|
||||
InputPath=".\zend_language_parser.y"
|
||||
|
||||
BuildCmds= \
|
||||
if not "X%CYGWIN%"=="X" bison --output=zend_language_parser.c -v -d -S "%CYGWIN%\share\bison.simple" -p zend zend_language_parser.y \
|
||||
if "X%CYGWIN%"=="X" bison --output=zend_language_parser.c -v -d -S "C:\Program Files\Cygnus\share\bison.simple" -p zend zend_language_parser.y \
|
||||
|
||||
|
||||
"$(InputDir)\zend_language_parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
$(BuildCmds)
|
||||
|
||||
"$(InputDir)\zend_language_parser.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
$(BuildCmds)
|
||||
# End Custom Build
|
||||
|
||||
!ELSEIF "$(CFG)" == "ZendTS - Win32 Release_TS_inline"
|
||||
|
||||
# Begin Custom Build
|
||||
InputDir=.
|
||||
InputPath=".\zend_language_parser.y"
|
||||
|
||||
BuildCmds= \
|
||||
if not "X%CYGWIN%"=="X" bison --output=zend_language_parser.c -v -d -S "%CYGWIN%\share\bison.simple" -p zend zend_language_parser.y \
|
||||
if "X%CYGWIN%"=="X" bison --output=zend_language_parser.c -v -d -S "C:\Program Files\Cygnus\share\bison.simple" -p zend zend_language_parser.y \
|
||||
|
||||
|
||||
"$(InputDir)\zend_language_parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
$(BuildCmds)
|
||||
|
||||
"$(InputDir)\zend_language_parser.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
$(BuildCmds)
|
||||
# End Custom Build
|
||||
|
||||
@@ -384,35 +469,72 @@ BuildCmds= \
|
||||
# PROP Default_Filter "l"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\zend-scanner.l"
|
||||
SOURCE=.\zend_ini_scanner.l
|
||||
|
||||
!IF "$(CFG)" == "ZendTS - Win32 Release_TS"
|
||||
|
||||
# Begin Custom Build
|
||||
InputPath=".\zend-scanner.l"
|
||||
InputPath=.\zend_ini_scanner.l
|
||||
|
||||
"zend-scanner.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
flex -+ -B -i -Sflex.skl -Pzend -ozend-scanner.cpp zend-scanner.l
|
||||
"zend_ini_scanner.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
flex -+ -B -i -Sflex.skl -Pini_ -ozend_ini_scanner.cpp zend_ini_scanner.l
|
||||
|
||||
# End Custom Build
|
||||
|
||||
!ELSEIF "$(CFG)" == "ZendTS - Win32 Debug_TS"
|
||||
|
||||
# Begin Custom Build
|
||||
InputPath=".\zend-scanner.l"
|
||||
InputPath=.\zend_ini_scanner.l
|
||||
|
||||
"zend-scanner.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
flex -+ -B -i -Sflex.skl -Pzend -ozend-scanner.cpp zend-scanner.l
|
||||
"zend_ini_scanner.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
flex -+ -B -i -Sflex.skl -Pini_ -ozend_ini_scanner.cpp zend_ini_scanner.l
|
||||
|
||||
# End Custom Build
|
||||
|
||||
!ELSEIF "$(CFG)" == "ZendTS - Win32 Release_TS_inline"
|
||||
|
||||
# Begin Custom Build
|
||||
InputPath=".\zend-scanner.l"
|
||||
InputPath=.\zend_ini_scanner.l
|
||||
|
||||
"zend-scanner.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
flex -+ -B -i -Sflex.skl -Pzend -ozend-scanner.cpp zend-scanner.l
|
||||
"zend_ini_scanner.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
flex -+ -B -i -Sflex.skl -Pini_ -ozend_ini_scanner.cpp zend_ini_scanner.l
|
||||
|
||||
# End Custom Build
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\zend_language_scanner.l"
|
||||
|
||||
!IF "$(CFG)" == "ZendTS - Win32 Release_TS"
|
||||
|
||||
# Begin Custom Build
|
||||
InputPath=".\zend_language_scanner.l"
|
||||
|
||||
"zend_language_scanner.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
flex -+ -B -i -Sflex.skl -Pzend -ozend_language_scanner.cpp zend_language_scanner.l
|
||||
|
||||
# End Custom Build
|
||||
|
||||
!ELSEIF "$(CFG)" == "ZendTS - Win32 Debug_TS"
|
||||
|
||||
# Begin Custom Build
|
||||
InputPath=".\zend_language_scanner.l"
|
||||
|
||||
"zend_language_scanner.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
flex -+ -B -i -Sflex.skl -Pzend -ozend_language_scanner.cpp zend_language_scanner.l
|
||||
|
||||
# End Custom Build
|
||||
|
||||
!ELSEIF "$(CFG)" == "ZendTS - Win32 Release_TS_inline"
|
||||
|
||||
# Begin Custom Build
|
||||
InputPath=".\zend_language_scanner.l"
|
||||
|
||||
"zend_language_scanner.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
flex -+ -B -i -Sflex.skl -Pzend -ozend_language_scanner.cpp zend_language_scanner.l
|
||||
|
||||
# End Custom Build
|
||||
|
||||
|
||||
@@ -3,10 +3,6 @@
|
||||
|
||||
@TOP@
|
||||
|
||||
/* these are defined by automake */
|
||||
#undef PACKAGE
|
||||
#undef VERSION
|
||||
|
||||
#undef uint
|
||||
#undef ulong
|
||||
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@ dnl $Id$
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
|
||||
AC_INIT(zend.c)
|
||||
AM_INIT_AUTOMAKE(zend, 0.80A)
|
||||
AM_INIT_AUTOMAKE(zend, 0.80A, nodefine)
|
||||
AM_CONFIG_HEADER(zend_config.h)
|
||||
AM_SANITY_CHECK
|
||||
AM_MAINTAINER_MODE
|
||||
|
||||
@@ -1,725 +0,0 @@
|
||||
%{
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 0.92 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available at through the world-wide-web at |
|
||||
| http://www.zend.com/license/0_92.txt. |
|
||||
| If you did not receive a copy of the Zend license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@zend.com so we can mail you a copy immediately. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Authors: Andi Gutmans <andi@zend.com> |
|
||||
| Zeev Suraski <zeev@zend.com> |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
/*
|
||||
* LALR shift/reduce conflicts and how they are resolved:
|
||||
*
|
||||
* - 2 shift/reduce conflicts due to the dangeling elseif/else ambiguity. Solved by shift.
|
||||
* - 1 shift/reduce conflict due to arrays within encapsulated strings. Solved by shift.
|
||||
* - 1 shift/reduce conflict due to objects within encapsulated strings. Solved by shift.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include "zend_compile.h"
|
||||
#include "zend.h"
|
||||
#include "zend_list.h"
|
||||
#include "zend_globals.h"
|
||||
#include "zend_API.h"
|
||||
|
||||
#define YYERROR_VERBOSE
|
||||
#define YYSTYPE znode
|
||||
#ifdef ZTS
|
||||
# define YYPARSE_PARAM compiler_globals
|
||||
# define YYLEX_PARAM compiler_globals
|
||||
#endif
|
||||
|
||||
|
||||
%}
|
||||
|
||||
%pure_parser
|
||||
%expect 4
|
||||
|
||||
%left T_INCLUDE T_INCLUDE_ONCE T_EVAL T_REQUIRE T_REQUIRE_ONCE
|
||||
%left ','
|
||||
%left T_LOGICAL_OR
|
||||
%left T_LOGICAL_XOR
|
||||
%left T_LOGICAL_AND
|
||||
%right T_PRINT
|
||||
%left '=' T_PLUS_EQUAL T_MINUS_EQUAL T_MUL_EQUAL T_DIV_EQUAL T_CONCAT_EQUAL T_MOD_EQUAL T_AND_EQUAL T_OR_EQUAL T_XOR_EQUAL T_SL_EQUAL T_SR_EQUAL
|
||||
%left '?' ':'
|
||||
%left T_BOOLEAN_OR
|
||||
%left T_BOOLEAN_AND
|
||||
%left '|'
|
||||
%left '^'
|
||||
%left '&'
|
||||
%nonassoc T_IS_EQUAL T_IS_NOT_EQUAL T_IS_IDENTICAL T_IS_NOT_IDENTICAL
|
||||
%nonassoc '<' T_IS_SMALLER_OR_EQUAL '>' T_IS_GREATER_OR_EQUAL
|
||||
%left T_SL T_SR
|
||||
%left '+' '-' '.'
|
||||
%left '*' '/' '%'
|
||||
%right '!' '~' T_INC T_DEC T_INT_CAST T_DOUBLE_CAST T_STRING_CAST T_ARRAY_CAST T_OBJECT_CAST T_BOOL_CAST T_UNSET_CAST '@'
|
||||
%right '['
|
||||
%nonassoc T_NEW
|
||||
%token T_EXIT
|
||||
%token T_IF
|
||||
%left T_ELSEIF
|
||||
%left T_ELSE
|
||||
%left T_ENDIF
|
||||
%token T_LNUMBER
|
||||
%token T_DNUMBER
|
||||
%token T_STRING
|
||||
%token T_STRING_VARNAME
|
||||
%token T_VARIABLE
|
||||
%token T_NUM_STRING
|
||||
%token T_INLINE_HTML
|
||||
%token T_CHARACTER
|
||||
%token T_BAD_CHARACTER
|
||||
%token T_ENCAPSED_AND_WHITESPACE
|
||||
%token T_CONSTANT_ENCAPSED_STRING
|
||||
%token T_ECHO
|
||||
%token T_DO
|
||||
%token T_WHILE
|
||||
%token T_ENDWHILE
|
||||
%token T_FOR
|
||||
%token T_ENDFOR
|
||||
%token T_FOREACH
|
||||
%token T_ENDFOREACH
|
||||
%token T_DECLARE
|
||||
%token T_ENDDECLARE
|
||||
%token T_AS
|
||||
%token T_SWITCH
|
||||
%token T_ENDSWITCH
|
||||
%token T_CASE
|
||||
%token T_DEFAULT
|
||||
%token T_BREAK
|
||||
%token T_CONTINUE
|
||||
%token T_OLD_FUNCTION
|
||||
%token T_FUNCTION
|
||||
%token T_CONST
|
||||
%token T_RETURN
|
||||
%token T_USE
|
||||
%token T_GLOBAL
|
||||
%token T_STATIC
|
||||
%token T_VAR
|
||||
%token T_UNSET
|
||||
%token T_ISSET
|
||||
%token T_EMPTY
|
||||
%token T_CLASS
|
||||
%token T_EXTENDS
|
||||
%token T_OBJECT_OPERATOR
|
||||
%token T_DOUBLE_ARROW
|
||||
%token T_LIST
|
||||
%token T_ARRAY
|
||||
%token T_LINE
|
||||
%token T_FILE
|
||||
%token T_COMMENT
|
||||
%token T_ML_COMMENT
|
||||
%token T_OPEN_TAG
|
||||
%token T_OPEN_TAG_WITH_ECHO
|
||||
%token T_CLOSE_TAG
|
||||
%token T_WHITESPACE
|
||||
%token T_START_HEREDOC
|
||||
%token T_END_HEREDOC
|
||||
%token T_DOLLAR_OPEN_CURLY_BRACES
|
||||
%token T_CURLY_OPEN
|
||||
%token T_PAAMAYIM_NEKUDOTAYIM
|
||||
|
||||
%% /* Rules */
|
||||
|
||||
start:
|
||||
top_statement_list
|
||||
;
|
||||
|
||||
top_statement_list:
|
||||
top_statement_list { do_extended_info(CLS_C); } top_statement { HANDLE_INTERACTIVE(); }
|
||||
| /* empty */
|
||||
;
|
||||
|
||||
|
||||
top_statement:
|
||||
statement
|
||||
| declaration_statement { do_early_binding(CLS_C); }
|
||||
;
|
||||
|
||||
|
||||
inner_statement_list:
|
||||
inner_statement_list { do_extended_info(CLS_C); } inner_statement { HANDLE_INTERACTIVE(); }
|
||||
| /* empty */
|
||||
;
|
||||
|
||||
|
||||
inner_statement:
|
||||
statement
|
||||
| declaration_statement
|
||||
;
|
||||
|
||||
|
||||
statement:
|
||||
unticked_statement { do_ticks(CLS_C); }
|
||||
;
|
||||
|
||||
|
||||
unticked_statement:
|
||||
'{' inner_statement_list '}'
|
||||
| T_IF '(' expr ')' { do_if_cond(&$3, &$4 CLS_CC); } statement { do_if_after_statement(&$4, 1 CLS_CC); } elseif_list else_single { do_if_end(CLS_C); }
|
||||
| T_IF '(' expr ')' ':' { do_if_cond(&$3, &$4 CLS_CC); } inner_statement_list { do_if_after_statement(&$4, 1 CLS_CC); } new_elseif_list new_else_single T_ENDIF ';' { do_if_end(CLS_C); }
|
||||
| T_WHILE '(' { $1.u.opline_num = get_next_op_number(CG(active_op_array)); } expr ')' { do_while_cond(&$4, &$5 CLS_CC); } while_statement { do_while_end(&$1, &$5 CLS_CC); }
|
||||
| T_DO { $1.u.opline_num = get_next_op_number(CG(active_op_array)); do_do_while_begin(CLS_C); } statement T_WHILE '(' { $5.u.opline_num = get_next_op_number(CG(active_op_array)); } expr ')' ';' { do_do_while_end(&$1, &$5, &$7 CLS_CC); }
|
||||
| T_FOR
|
||||
'('
|
||||
for_expr
|
||||
';' { do_free(&$3 CLS_CC); $4.u.opline_num = get_next_op_number(CG(active_op_array)); }
|
||||
for_expr
|
||||
';' { do_extended_info(CLS_C); do_for_cond(&$6, &$7 CLS_CC); }
|
||||
for_expr
|
||||
')' { do_free(&$9 CLS_CC); do_for_before_statement(&$4, &$7 CLS_CC); }
|
||||
for_statement { do_for_end(&$7 CLS_CC); }
|
||||
| T_SWITCH '(' expr ')' { do_switch_cond(&$3 CLS_CC); } switch_case_list { do_switch_end(&$6 CLS_CC); }
|
||||
| T_BREAK ';' { do_brk_cont(ZEND_BRK, NULL CLS_CC); }
|
||||
| T_BREAK expr ';' { do_brk_cont(ZEND_BRK, &$2 CLS_CC); }
|
||||
| T_CONTINUE ';' { do_brk_cont(ZEND_CONT, NULL CLS_CC); }
|
||||
| T_CONTINUE expr ';' { do_brk_cont(ZEND_CONT, &$2 CLS_CC); }
|
||||
| T_RETURN ';' { do_return(NULL, 0 CLS_CC); }
|
||||
| T_RETURN expr_without_variable ';' { do_return(&$2, 0 CLS_CC); }
|
||||
| T_RETURN cvar ';' { do_return(&$2, 1 CLS_CC); }
|
||||
| T_GLOBAL global_var_list ';'
|
||||
| T_STATIC static_var_list ';'
|
||||
| T_ECHO echo_expr_list ';'
|
||||
| T_INLINE_HTML { do_echo(&$1 CLS_CC); }
|
||||
| expr ';' { do_free(&$1 CLS_CC); }
|
||||
| T_USE use_filename ';' { zend_error(E_COMPILE_ERROR,"use: Not yet supported. Please use include_once() or require_once()"); zval_dtor(&$2.u.constant); }
|
||||
| T_UNSET '(' unset_variables ')' ';'
|
||||
| T_FOREACH '(' w_cvar T_AS { do_foreach_begin(&$1, &$3, &$2, &$4, 1 CLS_CC); } w_cvar foreach_optional_arg ')' { do_foreach_cont(&$6, &$7, &$4 CLS_CC); } foreach_statement { do_foreach_end(&$1, &$2 CLS_CC); }
|
||||
| T_FOREACH '(' expr_without_variable T_AS { do_foreach_begin(&$1, &$3, &$2, &$4, 0 CLS_CC); } w_cvar foreach_optional_arg ')' { do_foreach_cont(&$6, &$7, &$4 CLS_CC); } foreach_statement { do_foreach_end(&$1, &$2 CLS_CC); }
|
||||
| T_DECLARE { do_declare_begin(CLS_C); } '(' declare_list ')' declare_statement { do_declare_end(CLS_C); }
|
||||
| ';' /* empty statement */
|
||||
;
|
||||
|
||||
unset_variables:
|
||||
unset_variable
|
||||
| unset_variables ',' unset_variable
|
||||
;
|
||||
|
||||
unset_variable:
|
||||
cvar { do_end_variable_parse(BP_VAR_UNSET, 0 CLS_CC); do_unset(&$1 CLS_CC); }
|
||||
;
|
||||
|
||||
use_filename:
|
||||
T_CONSTANT_ENCAPSED_STRING { $$ = $1; }
|
||||
| '(' T_CONSTANT_ENCAPSED_STRING ')' { $$ = $2; }
|
||||
;
|
||||
|
||||
|
||||
declaration_statement:
|
||||
unticked_declaration_statement { do_ticks(CLS_C); }
|
||||
;
|
||||
|
||||
|
||||
unticked_declaration_statement:
|
||||
T_FUNCTION { $1.u.opline_num = CG(zend_lineno); } is_reference T_STRING { do_begin_function_declaration(&$1, &$4, 0, $3.op_type CLS_CC); }
|
||||
'(' parameter_list ')' '{' inner_statement_list '}' { do_end_function_declaration(&$1 CLS_CC); }
|
||||
| T_OLD_FUNCTION { $1.u.opline_num = CG(zend_lineno); } is_reference T_STRING { do_begin_function_declaration(&$1, &$4, 0, $3.op_type CLS_CC); }
|
||||
parameter_list '(' inner_statement_list ')' ';' { do_end_function_declaration(&$1 CLS_CC); }
|
||||
| T_CLASS T_STRING { do_begin_class_declaration(&$2, NULL CLS_CC); } '{' class_statement_list '}' { do_end_class_declaration(CLS_C); }
|
||||
| T_CLASS T_STRING T_EXTENDS T_STRING { do_begin_class_declaration(&$2, &$4 CLS_CC); } '{' class_statement_list '}' { do_end_class_declaration(CLS_C); }
|
||||
;
|
||||
|
||||
|
||||
foreach_optional_arg:
|
||||
/* empty */ { $$.op_type = IS_UNUSED; }
|
||||
| T_DOUBLE_ARROW w_cvar { $$ = $2; }
|
||||
;
|
||||
|
||||
|
||||
for_statement:
|
||||
statement
|
||||
| ':' inner_statement_list T_ENDFOR ';'
|
||||
;
|
||||
|
||||
|
||||
foreach_statement:
|
||||
statement
|
||||
| ':' inner_statement_list T_ENDFOREACH ';'
|
||||
;
|
||||
|
||||
|
||||
declare_statement:
|
||||
statement
|
||||
| ':' inner_statement_list T_ENDDECLARE ';'
|
||||
;
|
||||
|
||||
|
||||
declare_list:
|
||||
T_STRING '=' static_scalar { do_declare_stmt(&$1, &$3 CLS_CC); }
|
||||
| declare_list ',' T_STRING '=' static_scalar { do_declare_stmt(&$3, &$5 CLS_CC); }
|
||||
;
|
||||
|
||||
|
||||
switch_case_list:
|
||||
'{' case_list '}' { $$ = $2; }
|
||||
| '{' ';' case_list '}' { $$ = $3; }
|
||||
| ':' case_list T_ENDSWITCH ';' { $$ = $2; }
|
||||
| ':' ';' case_list T_ENDSWITCH ';' { $$ = $3; }
|
||||
;
|
||||
|
||||
|
||||
case_list:
|
||||
/* empty */ { $$.op_type = IS_UNUSED; }
|
||||
| case_list T_CASE expr case_separator { do_extended_info(CLS_C); do_case_before_statement(&$1, &$2, &$3 CLS_CC); } inner_statement_list { do_case_after_statement(&$$, &$2 CLS_CC); $$.op_type = IS_CONST }
|
||||
| case_list T_DEFAULT case_separator { do_extended_info(CLS_C); do_default_before_statement(&$1, &$2 CLS_CC); } inner_statement_list { do_case_after_statement(&$$, &$2 CLS_CC); $$.op_type = IS_CONST; }
|
||||
;
|
||||
|
||||
|
||||
case_separator:
|
||||
':'
|
||||
| ';'
|
||||
;
|
||||
|
||||
|
||||
while_statement:
|
||||
statement
|
||||
| ':' inner_statement_list T_ENDWHILE ';'
|
||||
;
|
||||
|
||||
|
||||
|
||||
elseif_list:
|
||||
/* empty */
|
||||
| elseif_list T_ELSEIF '(' expr ')' { do_if_cond(&$4, &$5 CLS_CC); } statement { do_if_after_statement(&$5, 0 CLS_CC); }
|
||||
;
|
||||
|
||||
|
||||
new_elseif_list:
|
||||
/* empty */
|
||||
| new_elseif_list T_ELSEIF '(' expr ')' ':' { do_if_cond(&$4, &$5 CLS_CC); } inner_statement_list { do_if_after_statement(&$5, 0 CLS_CC); }
|
||||
;
|
||||
|
||||
|
||||
else_single:
|
||||
/* empty */
|
||||
| T_ELSE statement
|
||||
;
|
||||
|
||||
|
||||
new_else_single:
|
||||
/* empty */
|
||||
| T_ELSE ':' inner_statement_list
|
||||
;
|
||||
|
||||
|
||||
parameter_list:
|
||||
non_empty_parameter_list
|
||||
| /* empty */
|
||||
;
|
||||
|
||||
|
||||
non_empty_parameter_list:
|
||||
T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$1, 0 CLS_CC); $$.op_type = IS_CONST; $$.u.constant.value.lval=1; $$.u.constant.type=IS_LONG; INIT_PZVAL(&$$.u.constant); do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, BYREF_NONE CLS_CC); }
|
||||
| '&' T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$2, 0 CLS_CC); $$.op_type = IS_CONST; $$.u.constant.value.lval=1; $$.u.constant.type=IS_LONG; INIT_PZVAL(&$$.u.constant); do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, BYREF_FORCE CLS_CC); }
|
||||
| T_CONST T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$2, 0 CLS_CC); $$.op_type = IS_CONST; $$.u.constant.value.lval=1; $$.u.constant.type=IS_LONG; INIT_PZVAL(&$$.u.constant); do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, BYREF_NONE CLS_CC); }
|
||||
| T_VARIABLE '=' static_scalar { znode tmp; fetch_simple_variable(&tmp, &$1, 0 CLS_CC); $$.op_type = IS_CONST; $$.u.constant.value.lval=1; $$.u.constant.type=IS_LONG; INIT_PZVAL(&$$.u.constant); do_receive_arg(ZEND_RECV_INIT, &tmp, &$$, &$3, BYREF_NONE CLS_CC); }
|
||||
| non_empty_parameter_list ',' T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$3, 0 CLS_CC); $$=$1; $$.u.constant.value.lval++; do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, BYREF_NONE CLS_CC); }
|
||||
| non_empty_parameter_list ',' '&' T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$4, 0 CLS_CC); $$=$1; $$.u.constant.value.lval++; do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, BYREF_FORCE CLS_CC); }
|
||||
| non_empty_parameter_list ',' T_CONST T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$4, 0 CLS_CC); $$=$1; $$.u.constant.value.lval++; do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, BYREF_NONE CLS_CC); }
|
||||
| non_empty_parameter_list ',' T_VARIABLE '=' static_scalar { znode tmp; fetch_simple_variable(&tmp, &$3, 0 CLS_CC); $$=$1; $$.u.constant.value.lval++; do_receive_arg(ZEND_RECV_INIT, &tmp, &$$, &$5, BYREF_NONE CLS_CC); }
|
||||
;
|
||||
|
||||
|
||||
function_call_parameter_list:
|
||||
non_empty_function_call_parameter_list { $$ = $1; }
|
||||
| /* empty */ { $$.u.constant.value.lval = 0; }
|
||||
;
|
||||
|
||||
|
||||
non_empty_function_call_parameter_list:
|
||||
expr_without_variable { $$.u.constant.value.lval = 1; do_pass_param(&$1, ZEND_SEND_VAL, $$.u.constant.value.lval CLS_CC); }
|
||||
| cvar { $$.u.constant.value.lval = 1; do_pass_param(&$1, ZEND_SEND_VAR, $$.u.constant.value.lval CLS_CC); }
|
||||
| '&' w_cvar { $$.u.constant.value.lval = 1; do_pass_param(&$2, ZEND_SEND_REF, $$.u.constant.value.lval CLS_CC); }
|
||||
| non_empty_function_call_parameter_list ',' expr_without_variable { $$.u.constant.value.lval=$1.u.constant.value.lval+1; do_pass_param(&$3, ZEND_SEND_VAL, $$.u.constant.value.lval CLS_CC); }
|
||||
| non_empty_function_call_parameter_list ',' cvar { $$.u.constant.value.lval=$1.u.constant.value.lval+1; do_pass_param(&$3, ZEND_SEND_VAR, $$.u.constant.value.lval CLS_CC); }
|
||||
| non_empty_function_call_parameter_list ',' '&' w_cvar { $$.u.constant.value.lval=$1.u.constant.value.lval+1; do_pass_param(&$4, ZEND_SEND_REF, $$.u.constant.value.lval CLS_CC); }
|
||||
;
|
||||
|
||||
global_var_list:
|
||||
global_var_list ',' global_var { do_fetch_global_or_static_variable(&$3, NULL, ZEND_FETCH_GLOBAL CLS_CC); }
|
||||
| global_var { do_fetch_global_or_static_variable(&$1, NULL, ZEND_FETCH_GLOBAL CLS_CC); }
|
||||
;
|
||||
|
||||
|
||||
global_var:
|
||||
T_VARIABLE { $$ = $1; }
|
||||
| '$' r_cvar { $$ = $2; }
|
||||
| '$' '{' expr '}' { $$ = $3; }
|
||||
;
|
||||
|
||||
|
||||
static_var_list:
|
||||
static_var_list ',' T_VARIABLE { do_fetch_global_or_static_variable(&$3, NULL, ZEND_FETCH_STATIC CLS_CC); }
|
||||
| static_var_list ',' T_VARIABLE '=' static_scalar { do_fetch_global_or_static_variable(&$3, &$5, ZEND_FETCH_STATIC CLS_CC); }
|
||||
| T_VARIABLE { do_fetch_global_or_static_variable(&$1, NULL, ZEND_FETCH_STATIC CLS_CC); }
|
||||
| T_VARIABLE '=' static_scalar { do_fetch_global_or_static_variable(&$1, &$3, ZEND_FETCH_STATIC CLS_CC); }
|
||||
|
||||
;
|
||||
|
||||
|
||||
class_statement_list:
|
||||
class_statement_list class_statement
|
||||
| /* empty */
|
||||
;
|
||||
|
||||
|
||||
class_statement:
|
||||
T_VAR class_variable_decleration ';'
|
||||
| T_FUNCTION { $1.u.opline_num = CG(zend_lineno); } is_reference T_STRING { do_begin_function_declaration(&$1, &$4, 1, $3.op_type CLS_CC); } '('
|
||||
parameter_list ')' '{' inner_statement_list '}' { do_end_function_declaration(&$1 CLS_CC); }
|
||||
| T_OLD_FUNCTION { $1.u.opline_num = CG(zend_lineno); } is_reference T_STRING { do_begin_function_declaration(&$1, &$4, 1, $3.op_type CLS_CC); }
|
||||
parameter_list '(' inner_statement_list ')' ';' { do_end_function_declaration(&$1 CLS_CC); }
|
||||
|
||||
;
|
||||
|
||||
is_reference:
|
||||
/* empty */ { $$.op_type = ZEND_RETURN_VAL; }
|
||||
| '&' { $$.op_type = ZEND_RETURN_REF; }
|
||||
|
||||
class_variable_decleration:
|
||||
class_variable_decleration ',' T_VARIABLE { do_declare_property(&$3, NULL CLS_CC); }
|
||||
| class_variable_decleration ',' T_VARIABLE '=' static_scalar { do_declare_property(&$3, &$5 CLS_CC); }
|
||||
| T_VARIABLE { do_declare_property(&$1, NULL CLS_CC); }
|
||||
| T_VARIABLE '=' static_scalar { do_declare_property(&$1, &$3 CLS_CC); }
|
||||
;
|
||||
|
||||
|
||||
echo_expr_list:
|
||||
| echo_expr_list ',' expr { do_echo(&$3 CLS_CC); }
|
||||
| expr { do_echo(&$1 CLS_CC); }
|
||||
;
|
||||
|
||||
|
||||
for_expr:
|
||||
/* empty */ { $$.op_type = IS_CONST; $$.u.constant.type = IS_BOOL; $$.u.constant.value.lval = 1; }
|
||||
| non_empty_for_expr { $$ = $1; }
|
||||
;
|
||||
|
||||
non_empty_for_expr:
|
||||
non_empty_for_expr ',' { do_free(&$1 CLS_CC); } expr { $$ = $4; }
|
||||
| expr { $$ = $1; }
|
||||
;
|
||||
|
||||
|
||||
expr_without_variable:
|
||||
T_LIST '(' { do_list_init(CLS_C); } assignment_list ')' '=' expr { do_list_end(&$$, &$7 CLS_CC); }
|
||||
| cvar '=' expr { do_end_variable_parse(BP_VAR_W, 0 CLS_CC); do_assign(&$$, &$1, &$3 CLS_CC); }
|
||||
| cvar '=' '&' w_cvar { do_end_variable_parse(BP_VAR_W, 0 CLS_CC); do_assign_ref(&$$, &$1, &$4 CLS_CC); }
|
||||
| cvar '=' '&' function_call { do_end_variable_parse(BP_VAR_W, 0 CLS_CC); do_assign_ref(&$$, &$1, &$4 CLS_CC); }
|
||||
| T_NEW class_name { do_extended_fcall_begin(CLS_C); do_begin_new_object(&$1, &$2 CLS_CC); } ctor_arguments { do_end_new_object(&$$, &$2, &$1, &$4 CLS_CC); do_extended_fcall_end(CLS_C);}
|
||||
| cvar T_PLUS_EQUAL expr { do_end_variable_parse(BP_VAR_RW, 0 CLS_CC); do_binary_assign_op(ZEND_ASSIGN_ADD, &$$, &$1, &$3 CLS_CC); }
|
||||
| cvar T_MINUS_EQUAL expr { do_end_variable_parse(BP_VAR_RW, 0 CLS_CC); do_binary_assign_op(ZEND_ASSIGN_SUB, &$$, &$1, &$3 CLS_CC); }
|
||||
| cvar T_MUL_EQUAL expr { do_end_variable_parse(BP_VAR_RW, 0 CLS_CC); do_binary_assign_op(ZEND_ASSIGN_MUL, &$$, &$1, &$3 CLS_CC); }
|
||||
| cvar T_DIV_EQUAL expr { do_end_variable_parse(BP_VAR_RW, 0 CLS_CC); do_binary_assign_op(ZEND_ASSIGN_DIV, &$$, &$1, &$3 CLS_CC); }
|
||||
| cvar T_CONCAT_EQUAL expr { do_end_variable_parse(BP_VAR_RW, 0 CLS_CC); do_binary_assign_op(ZEND_ASSIGN_CONCAT, &$$, &$1, &$3 CLS_CC); }
|
||||
| cvar T_MOD_EQUAL expr { do_end_variable_parse(BP_VAR_RW, 0 CLS_CC); do_binary_assign_op(ZEND_ASSIGN_MOD, &$$, &$1, &$3 CLS_CC); }
|
||||
| cvar T_AND_EQUAL expr { do_end_variable_parse(BP_VAR_RW, 0 CLS_CC); do_binary_assign_op(ZEND_ASSIGN_BW_AND, &$$, &$1, &$3 CLS_CC); }
|
||||
| cvar T_OR_EQUAL expr { do_end_variable_parse(BP_VAR_RW, 0 CLS_CC); do_binary_assign_op(ZEND_ASSIGN_BW_OR, &$$, &$1, &$3 CLS_CC); }
|
||||
| cvar T_XOR_EQUAL expr { do_end_variable_parse(BP_VAR_RW, 0 CLS_CC); do_binary_assign_op(ZEND_ASSIGN_BW_XOR, &$$, &$1, &$3 CLS_CC); }
|
||||
| cvar T_SL_EQUAL expr { do_end_variable_parse(BP_VAR_RW, 0 CLS_CC); do_binary_assign_op(ZEND_ASSIGN_SL, &$$, &$1, &$3 CLS_CC); }
|
||||
| cvar T_SR_EQUAL expr { do_end_variable_parse(BP_VAR_RW, 0 CLS_CC); do_binary_assign_op(ZEND_ASSIGN_SR, &$$, &$1, &$3 CLS_CC); }
|
||||
| rw_cvar T_INC { do_post_incdec(&$$, &$1, ZEND_POST_INC CLS_CC); }
|
||||
| T_INC rw_cvar { do_pre_incdec(&$$, &$2, ZEND_PRE_INC CLS_CC); }
|
||||
| rw_cvar T_DEC { do_post_incdec(&$$, &$1, ZEND_POST_DEC CLS_CC); }
|
||||
| T_DEC rw_cvar { do_pre_incdec(&$$, &$2, ZEND_PRE_DEC CLS_CC); }
|
||||
| expr T_BOOLEAN_OR { do_boolean_or_begin(&$1, &$2 CLS_CC); } expr { do_boolean_or_end(&$$, &$1, &$4, &$2 CLS_CC); }
|
||||
| expr T_BOOLEAN_AND { do_boolean_and_begin(&$1, &$2 CLS_CC); } expr { do_boolean_and_end(&$$, &$1, &$4, &$2 CLS_CC); }
|
||||
| expr T_LOGICAL_OR { do_boolean_or_begin(&$1, &$2 CLS_CC); } expr { do_boolean_or_end(&$$, &$1, &$4, &$2 CLS_CC); }
|
||||
| expr T_LOGICAL_AND { do_boolean_and_begin(&$1, &$2 CLS_CC); } expr { do_boolean_and_end(&$$, &$1, &$4, &$2 CLS_CC); }
|
||||
| expr T_LOGICAL_XOR expr { do_binary_op(ZEND_BOOL_XOR, &$$, &$1, &$3 CLS_CC); }
|
||||
| expr '|' expr { do_binary_op(ZEND_BW_OR, &$$, &$1, &$3 CLS_CC); }
|
||||
| expr '&' expr { do_binary_op(ZEND_BW_AND, &$$, &$1, &$3 CLS_CC); }
|
||||
| expr '^' expr { do_binary_op(ZEND_BW_XOR, &$$, &$1, &$3 CLS_CC); }
|
||||
| expr '.' expr { do_binary_op(ZEND_CONCAT,&$$,&$1,&$3 CLS_CC); }
|
||||
| expr '+' expr { do_binary_op(ZEND_ADD,&$$,&$1,&$3 CLS_CC); }
|
||||
| expr '-' expr { do_binary_op(ZEND_SUB,&$$,&$1,&$3 CLS_CC); }
|
||||
| expr '*' expr { do_binary_op(ZEND_MUL,&$$,&$1,&$3 CLS_CC); }
|
||||
| expr '/' expr { do_binary_op(ZEND_DIV,&$$,&$1,&$3 CLS_CC); }
|
||||
| expr '%' expr { do_binary_op(ZEND_MOD,&$$,&$1,&$3 CLS_CC); }
|
||||
| expr T_SL expr { do_binary_op(ZEND_SL, &$$, &$1, &$3 CLS_CC); }
|
||||
| expr T_SR expr { do_binary_op(ZEND_SR, &$$, &$1, &$3 CLS_CC); }
|
||||
| '+' expr { $1.u.constant.value.lval=0; $1.u.constant.type=IS_LONG; $1.op_type = IS_CONST; INIT_PZVAL(&$1.u.constant); do_binary_op(ZEND_ADD, &$$, &$1, &$2 CLS_CC); }
|
||||
| '-' expr { $1.u.constant.value.lval=0; $1.u.constant.type=IS_LONG; $1.op_type = IS_CONST; INIT_PZVAL(&$1.u.constant); do_binary_op(ZEND_SUB, &$$, &$1, &$2 CLS_CC); }
|
||||
| '!' expr { do_unary_op(ZEND_BOOL_NOT, &$$, &$2 CLS_CC); }
|
||||
| '~' expr { do_unary_op(ZEND_BW_NOT, &$$, &$2 CLS_CC); }
|
||||
| expr T_IS_IDENTICAL expr { do_binary_op(ZEND_IS_IDENTICAL, &$$, &$1, &$3 CLS_CC); }
|
||||
| expr T_IS_NOT_IDENTICAL expr { do_binary_op(ZEND_IS_NOT_IDENTICAL, &$$, &$1, &$3 CLS_CC); }
|
||||
| expr T_IS_EQUAL expr { do_binary_op(ZEND_IS_EQUAL, &$$, &$1, &$3 CLS_CC); }
|
||||
| expr T_IS_NOT_EQUAL expr { do_binary_op(ZEND_IS_NOT_EQUAL, &$$, &$1, &$3 CLS_CC); }
|
||||
| expr '<' expr { do_binary_op(ZEND_IS_SMALLER, &$$, &$1, &$3 CLS_CC); }
|
||||
| expr T_IS_SMALLER_OR_EQUAL expr { do_binary_op(ZEND_IS_SMALLER_OR_EQUAL, &$$, &$1, &$3 CLS_CC); }
|
||||
| expr '>' expr { do_binary_op(ZEND_IS_SMALLER, &$$, &$3, &$1 CLS_CC); }
|
||||
| expr T_IS_GREATER_OR_EQUAL expr { do_binary_op(ZEND_IS_SMALLER_OR_EQUAL, &$$, &$3, &$1 CLS_CC); }
|
||||
| '(' expr ')' { $$ = $2; }
|
||||
| expr '?' { do_begin_qm_op(&$1, &$2 CLS_CC); }
|
||||
expr ':' { do_qm_true(&$4, &$2, &$5 CLS_CC); }
|
||||
expr { do_qm_false(&$$, &$7, &$2, &$5 CLS_CC); }
|
||||
| function_call { $$ = $1; }
|
||||
| internal_functions_in_yacc { $$ = $1; }
|
||||
| T_INT_CAST expr { do_cast(&$$, &$2, IS_LONG CLS_CC); }
|
||||
| T_DOUBLE_CAST expr { do_cast(&$$, &$2, IS_DOUBLE CLS_CC); }
|
||||
| T_STRING_CAST expr { do_cast(&$$, &$2, IS_STRING CLS_CC); }
|
||||
| T_ARRAY_CAST expr { do_cast(&$$, &$2, IS_ARRAY CLS_CC); }
|
||||
| T_OBJECT_CAST expr { do_cast(&$$, &$2, IS_OBJECT CLS_CC); }
|
||||
| T_BOOL_CAST expr { do_cast(&$$, &$2, IS_BOOL CLS_CC); }
|
||||
| T_UNSET_CAST expr { do_cast(&$$, &$2, IS_NULL CLS_CC); }
|
||||
| T_EXIT exit_expr { do_exit(&$$, &$2 CLS_CC); }
|
||||
| '@' { do_begin_silence(&$1 CLS_CC); } expr { do_end_silence(&$1 CLS_CC); $$ = $3; }
|
||||
| scalar { $$ = $1; }
|
||||
| T_ARRAY '(' array_pair_list ')' { $$ = $3; }
|
||||
| '`' encaps_list '`' { do_shell_exec(&$$, &$2 CLS_CC); }
|
||||
| T_PRINT expr { do_print(&$$, &$2 CLS_CC); }
|
||||
;
|
||||
|
||||
function_call:
|
||||
T_STRING '(' { $2.u.opline_num = do_begin_function_call(&$1 CLS_CC); }
|
||||
function_call_parameter_list
|
||||
')' { do_end_function_call(&$1, &$$, &$4, 0, $2.u.opline_num CLS_CC); do_extended_fcall_end(CLS_C); }
|
||||
| cvar '(' { do_begin_dynamic_function_call(&$1 CLS_CC); }
|
||||
function_call_parameter_list
|
||||
')' { do_end_function_call(&$1, &$$, &$4, 0, 1 CLS_CC); do_extended_fcall_end(CLS_C);}
|
||||
| T_STRING T_PAAMAYIM_NEKUDOTAYIM T_STRING '(' { do_extended_fcall_begin(CLS_C); do_begin_class_member_function_call(&$1, &$3 CLS_CC); }
|
||||
function_call_parameter_list
|
||||
')' { do_end_function_call(&$3, &$$, &$6, 1, 1 CLS_CC); do_extended_fcall_end(CLS_C);}
|
||||
;
|
||||
|
||||
|
||||
exit_expr:
|
||||
/* empty */ { memset(&$$, 0, sizeof(znode)); $$.op_type = IS_UNUSED; }
|
||||
| '(' ')' { memset(&$$, 0, sizeof(znode)); $$.op_type = IS_UNUSED; }
|
||||
| '(' expr ')' { $$ = $2; }
|
||||
;
|
||||
|
||||
|
||||
ctor_arguments:
|
||||
/* empty */ { $$.u.constant.value.lval=0; }
|
||||
| '(' function_call_parameter_list ')' { $$ = $2; }
|
||||
;
|
||||
|
||||
|
||||
class_name:
|
||||
T_STRING { $$ = $1; }
|
||||
| r_cvar { $$ = $1; }
|
||||
;
|
||||
|
||||
|
||||
|
||||
common_scalar:
|
||||
T_LNUMBER { $$ = $1; }
|
||||
| T_DNUMBER { $$ = $1; }
|
||||
| T_CONSTANT_ENCAPSED_STRING { $$ = $1; }
|
||||
| T_LINE { $$ = $1; }
|
||||
| T_FILE { $$ = $1; }
|
||||
;
|
||||
|
||||
|
||||
static_scalar: /* compile-time evaluated scalars */
|
||||
common_scalar { $$ = $1; }
|
||||
| T_STRING { do_fetch_constant(&$$, &$1, ZEND_CT CLS_CC); }
|
||||
| '+' static_scalar { $$ = $1; }
|
||||
| '-' static_scalar { zval minus_one; minus_one.type = IS_LONG; minus_one.value.lval = -1; mul_function(&$2.u.constant, &$2.u.constant, &minus_one); $$ = $2; }
|
||||
| T_ARRAY '(' static_array_pair_list ')' { $$ = $3; $$.u.constant.type = IS_CONSTANT_ARRAY; }
|
||||
;
|
||||
|
||||
|
||||
scalar:
|
||||
T_STRING { do_fetch_constant(&$$, &$1, ZEND_RT CLS_CC); }
|
||||
| T_STRING_VARNAME { $$ = $1; }
|
||||
| common_scalar { $$ = $1; }
|
||||
| '"' encaps_list '"' { $$ = $2; }
|
||||
| '\'' encaps_list '\'' { $$ = $2; }
|
||||
| T_START_HEREDOC encaps_list T_END_HEREDOC { $$ = $2; do_end_heredoc(CLS_C); }
|
||||
;
|
||||
|
||||
|
||||
static_array_pair_list:
|
||||
/* empty */ { $$.op_type = IS_CONST; INIT_PZVAL(&$$.u.constant); array_init(&$$.u.constant); }
|
||||
| non_empty_static_array_pair_list possible_comma { $$ = $1; }
|
||||
;
|
||||
|
||||
possible_comma:
|
||||
/* empty */
|
||||
| ','
|
||||
;
|
||||
|
||||
non_empty_static_array_pair_list:
|
||||
non_empty_static_array_pair_list ',' static_scalar T_DOUBLE_ARROW static_scalar { do_add_static_array_element(&$$, &$3, &$5); }
|
||||
| non_empty_static_array_pair_list ',' static_scalar { do_add_static_array_element(&$$, NULL, &$3); }
|
||||
| static_scalar T_DOUBLE_ARROW static_scalar { $$.op_type = IS_CONST; INIT_PZVAL(&$$.u.constant); array_init(&$$.u.constant); do_add_static_array_element(&$$, &$1, &$3); }
|
||||
| static_scalar { $$.op_type = IS_CONST; INIT_PZVAL(&$$.u.constant); array_init(&$$.u.constant); do_add_static_array_element(&$$, NULL, &$1); }
|
||||
;
|
||||
|
||||
expr:
|
||||
r_cvar { $$ = $1; }
|
||||
| expr_without_variable { $$ = $1; }
|
||||
;
|
||||
|
||||
/*
|
||||
w_expr:
|
||||
w_cvar { $$ = $1; }
|
||||
| expr_without_variable { $$ = $1; }
|
||||
;
|
||||
*/
|
||||
|
||||
|
||||
r_cvar:
|
||||
cvar { do_end_variable_parse(BP_VAR_R, 0 CLS_CC); $$ = $1; }
|
||||
;
|
||||
|
||||
|
||||
w_cvar:
|
||||
cvar { do_end_variable_parse(BP_VAR_W, 0 CLS_CC); $$ = $1; }
|
||||
;
|
||||
|
||||
|
||||
rw_cvar:
|
||||
cvar { do_end_variable_parse(BP_VAR_RW, 0 CLS_CC); $$ = $1; }
|
||||
;
|
||||
|
||||
|
||||
cvar:
|
||||
cvar_without_objects { $$ = $1; }
|
||||
| cvar_without_objects T_OBJECT_OPERATOR { do_push_object(&$1 CLS_CC); } ref_list { $$ = $4; }
|
||||
;
|
||||
|
||||
|
||||
cvar_without_objects:
|
||||
reference_variable { $$ = $1; }
|
||||
| simple_indirect_reference reference_variable { do_indirect_references(&$$, &$1, &$2 CLS_CC); }
|
||||
;
|
||||
|
||||
|
||||
reference_variable:
|
||||
reference_variable '[' dim_offset ']' { fetch_array_dim(&$$, &$1, &$3 CLS_CC); }
|
||||
| reference_variable '{' expr '}' { fetch_string_offset(&$$, &$1, &$3 CLS_CC); }
|
||||
| compound_variable { do_fetch_globals(&$1 CLS_CC); do_begin_variable_parse(CLS_C); fetch_simple_variable(&$$, &$1, 1 CLS_CC); }
|
||||
;
|
||||
|
||||
|
||||
compound_variable:
|
||||
T_VARIABLE { $$ = $1; }
|
||||
| '$' '{' expr '}' { $$ = $3; }
|
||||
;
|
||||
|
||||
dim_offset:
|
||||
/* empty */ { $$.op_type = IS_UNUSED; }
|
||||
| expr { $$ = $1; }
|
||||
;
|
||||
|
||||
ref_list:
|
||||
object_property { $$ = $1; }
|
||||
| ref_list T_OBJECT_OPERATOR { do_push_object(&$1 CLS_CC); } object_property { $$ = $4; }
|
||||
;
|
||||
|
||||
object_property:
|
||||
object_dim_list { $$ = $1; }
|
||||
| cvar_without_objects { do_end_variable_parse(BP_VAR_R, 0 CLS_CC); } { znode tmp_znode; do_pop_object(&tmp_znode CLS_CC); do_fetch_property(&$$, &tmp_znode, &$1 CLS_CC);}
|
||||
;
|
||||
|
||||
object_dim_list:
|
||||
object_dim_list '[' dim_offset ']' { fetch_array_dim(&$$, &$1, &$3 CLS_CC); }
|
||||
| object_dim_list '{' expr '}' { fetch_string_offset(&$$, &$1, &$3 CLS_CC); }
|
||||
| variable_name { znode tmp_znode; do_pop_object(&tmp_znode CLS_CC); do_fetch_property(&$$, &tmp_znode, &$1 CLS_CC);}
|
||||
;
|
||||
|
||||
variable_name:
|
||||
T_STRING { $$ = $1; }
|
||||
| '{' expr '}' { $$ = $2; }
|
||||
;
|
||||
|
||||
|
||||
simple_indirect_reference:
|
||||
'$' { $$.u.constant.value.lval = 1; }
|
||||
| simple_indirect_reference '$' { $$.u.constant.value.lval++; }
|
||||
;
|
||||
|
||||
assignment_list:
|
||||
assignment_list ',' assignment_list_element
|
||||
| assignment_list_element
|
||||
;
|
||||
|
||||
|
||||
assignment_list_element:
|
||||
cvar { do_add_list_element(&$1 CLS_CC); }
|
||||
| T_LIST '(' { do_new_list_begin(CLS_C); } assignment_list ')' { do_new_list_end(CLS_C); }
|
||||
| /* empty */ { do_add_list_element(NULL CLS_CC); }
|
||||
;
|
||||
|
||||
|
||||
array_pair_list:
|
||||
/* empty */ { do_init_array(&$$, NULL, NULL, 0 CLS_CC); }
|
||||
| non_empty_array_pair_list possible_comma { $$ = $1; }
|
||||
;
|
||||
|
||||
non_empty_array_pair_list:
|
||||
non_empty_array_pair_list ',' expr T_DOUBLE_ARROW expr { do_add_array_element(&$$, &$5, &$3, 0 CLS_CC); }
|
||||
| non_empty_array_pair_list ',' expr { do_add_array_element(&$$, &$3, NULL, 0 CLS_CC); }
|
||||
| expr T_DOUBLE_ARROW expr { do_init_array(&$$, &$3, &$1, 0 CLS_CC); }
|
||||
| expr { do_init_array(&$$, &$1, NULL, 0 CLS_CC); }
|
||||
| non_empty_array_pair_list ',' expr T_DOUBLE_ARROW '&' w_cvar { do_add_array_element(&$$, &$6, &$3, 1 CLS_CC); }
|
||||
| non_empty_array_pair_list ',' '&' w_cvar { do_add_array_element(&$$, &$4, NULL, 1 CLS_CC); }
|
||||
| expr T_DOUBLE_ARROW '&' w_cvar { do_init_array(&$$, &$4, &$1, 1 CLS_CC); }
|
||||
| '&' w_cvar { do_init_array(&$$, &$2, NULL, 1 CLS_CC); }
|
||||
;
|
||||
|
||||
encaps_list:
|
||||
encaps_list encaps_var { do_end_variable_parse(BP_VAR_R, 0 CLS_CC); do_add_variable(&$$, &$1, &$2 CLS_CC); }
|
||||
| encaps_list T_STRING { do_add_string(&$$, &$1, &$2 CLS_CC); }
|
||||
| encaps_list T_NUM_STRING { do_add_string(&$$, &$1, &$2 CLS_CC); }
|
||||
| encaps_list T_ENCAPSED_AND_WHITESPACE { do_add_string(&$$, &$1, &$2 CLS_CC); }
|
||||
| encaps_list T_CHARACTER { do_add_char(&$$, &$1, &$2 CLS_CC); }
|
||||
| encaps_list T_BAD_CHARACTER { do_add_string(&$$, &$1, &$2 CLS_CC); }
|
||||
| encaps_list '[' { $2.u.constant.value.lval = (long) '['; do_add_char(&$$, &$1, &$2 CLS_CC); }
|
||||
| encaps_list ']' { $2.u.constant.value.lval = (long) ']'; do_add_char(&$$, &$1, &$2 CLS_CC); }
|
||||
| encaps_list '{' { $2.u.constant.value.lval = (long) '{'; do_add_char(&$$, &$1, &$2 CLS_CC); }
|
||||
| encaps_list '}' { $2.u.constant.value.lval = (long) '}'; do_add_char(&$$, &$1, &$2 CLS_CC); }
|
||||
| encaps_list T_OBJECT_OPERATOR { znode tmp; $2.u.constant.value.lval = (long) '-'; do_add_char(&tmp, &$1, &$2 CLS_CC); $2.u.constant.value.lval = (long) '>'; do_add_char(&$$, &tmp, &$2 CLS_CC); }
|
||||
| /* empty */ { do_init_string(&$$ CLS_CC); }
|
||||
|
||||
;
|
||||
|
||||
|
||||
|
||||
encaps_var:
|
||||
T_VARIABLE { do_fetch_globals(&$1 CLS_CC); do_begin_variable_parse(CLS_C); fetch_simple_variable(&$$, &$1, 1 CLS_CC); }
|
||||
| T_VARIABLE '[' { do_begin_variable_parse(CLS_C); } encaps_var_offset ']' { do_fetch_globals(&$1 CLS_CC); fetch_array_begin(&$$, &$1, &$4 CLS_CC); }
|
||||
| T_VARIABLE T_OBJECT_OPERATOR T_STRING { do_begin_variable_parse(CLS_C); fetch_simple_variable(&$2, &$1, 1 CLS_CC); do_fetch_property(&$$, &$2, &$3 CLS_CC); }
|
||||
| T_DOLLAR_OPEN_CURLY_BRACES expr '}' { do_begin_variable_parse(CLS_C); fetch_simple_variable(&$$, &$2, 1 CLS_CC); }
|
||||
| T_DOLLAR_OPEN_CURLY_BRACES T_STRING_VARNAME '[' expr ']' '}' { do_begin_variable_parse(CLS_C); fetch_array_begin(&$$, &$2, &$4 CLS_CC); }
|
||||
| T_CURLY_OPEN cvar '}' { $$ = $2; }
|
||||
;
|
||||
|
||||
|
||||
encaps_var_offset:
|
||||
T_STRING { $$ = $1; }
|
||||
| T_NUM_STRING { $$ = $1; }
|
||||
| T_VARIABLE { fetch_simple_variable(&$$, &$1, 1 CLS_CC); }
|
||||
;
|
||||
|
||||
|
||||
internal_functions_in_yacc:
|
||||
T_ISSET '(' cvar ')' { do_isset_or_isempty(ZEND_ISSET, &$$, &$3 CLS_CC); }
|
||||
| T_EMPTY '(' cvar ')' { do_isset_or_isempty(ZEND_ISEMPTY, &$$, &$3 CLS_CC); }
|
||||
| T_INCLUDE expr { do_include_or_eval(ZEND_INCLUDE, &$$, &$2 CLS_CC); }
|
||||
| T_INCLUDE_ONCE expr { do_include_or_eval(ZEND_INCLUDE_ONCE, &$$, &$2 CLS_CC); }
|
||||
| T_EVAL '(' expr ')' { do_include_or_eval(ZEND_EVAL, &$$, &$3 CLS_CC); }
|
||||
| T_REQUIRE expr { do_include_or_eval(ZEND_REQUIRE, &$$, &$2 CLS_CC); }
|
||||
| T_REQUIRE_ONCE expr { do_include_or_eval(ZEND_REQUIRE_ONCE, &$$, &$2 CLS_CC); }
|
||||
;
|
||||
|
||||
|
||||
%%
|
||||
|
||||
+12
@@ -198,11 +198,23 @@ ZEND_API void zend_print_zval_r_ex(zend_write_func_t write_func, zval *expr, int
|
||||
switch(expr->type) {
|
||||
case IS_ARRAY:
|
||||
ZEND_PUTS("Array\n");
|
||||
if (++expr->value.ht->nApplyCount>1) {
|
||||
ZEND_PUTS(" *RECURSION*");
|
||||
expr->value.ht->nApplyCount=0;
|
||||
return;
|
||||
}
|
||||
print_hash(expr->value.ht,indent);
|
||||
expr->value.ht->nApplyCount--;
|
||||
break;
|
||||
case IS_OBJECT:
|
||||
if (++expr->value.obj.properties->nApplyCount>1) {
|
||||
ZEND_PUTS(" *RECURSION*");
|
||||
expr->value.obj.properties->nApplyCount=0;
|
||||
return;
|
||||
}
|
||||
zend_printf("%s Object\n", expr->value.obj.ce->name);
|
||||
print_hash(expr->value.obj.properties, indent);
|
||||
expr->value.obj.properties->nApplyCount--;
|
||||
break;
|
||||
default:
|
||||
zend_print_variable(expr);
|
||||
|
||||
+16
-1
@@ -21,7 +21,7 @@
|
||||
#ifndef ZEND_H
|
||||
#define ZEND_H
|
||||
|
||||
#define ZEND_VERSION "1.0.2"
|
||||
#define ZEND_VERSION "1.0.4"
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define BEGIN_EXTERN_C() extern "C" {
|
||||
@@ -421,6 +421,21 @@ ZEND_API int zend_get_ini_entry(char *name, uint name_length, zval *contents);
|
||||
} \
|
||||
INIT_PZVAL(&(zv));
|
||||
|
||||
#define REPLACE_ZVAL_VALUE(ppzv_dest,pzv_src,copy) { \
|
||||
int is_ref,refcount; \
|
||||
\
|
||||
SEPARATE_ZVAL_IF_NOT_REF(ppzv_dest); \
|
||||
is_ref = (*ppzv_dest)->is_ref; \
|
||||
refcount = (*ppzv_dest)->refcount; \
|
||||
zval_dtor(*ppzv_dest); \
|
||||
**ppzv_dest = *pzv_src; \
|
||||
if(copy) { \
|
||||
zval_copy_ctor(*ppzv_dest); \
|
||||
} \
|
||||
(*ppzv_dest)->is_ref = is_ref; \
|
||||
(*ppzv_dest)->refcount = refcount; \
|
||||
}
|
||||
|
||||
#define ZEND_MAX_RESERVED_RESOURCES 2
|
||||
|
||||
#ifdef ZEND_WIN32
|
||||
|
||||
+2
-2
@@ -30,7 +30,7 @@
|
||||
|
||||
/* these variables are true statics/globals, and have to be mutex'ed on every access */
|
||||
static int module_count=0;
|
||||
HashTable module_registry;
|
||||
ZEND_API HashTable module_registry;
|
||||
|
||||
/* this function doesn't check for too many parameters */
|
||||
ZEND_API int zend_get_parameters(int ht, int param_count, ...)
|
||||
@@ -892,7 +892,7 @@ ZEND_API zend_class_entry *zend_register_internal_class_ex(zend_class_entry *cla
|
||||
register_class = zend_register_internal_class(class_entry);
|
||||
|
||||
if (parent_ce) {
|
||||
do_inheritance(register_class, parent_ce);
|
||||
zend_do_inheritance(register_class, parent_ce);
|
||||
}
|
||||
return register_class;
|
||||
}
|
||||
|
||||
+2
-2
@@ -177,8 +177,8 @@ ZEND_API int add_get_assoc_stringl(zval *arg, char *key, char *str, uint length,
|
||||
ZEND_API int add_get_index_string(zval *arg, uint idx, char *str, void **dest, int duplicate);
|
||||
ZEND_API int add_get_index_stringl(zval *arg, uint idx, char *str, uint length, void **dest, int duplicate);
|
||||
|
||||
ZEND_API int call_user_function(HashTable *function_table, zval *object, zval *function_name, zval *retval_ptr, int param_count, zval *params[]);
|
||||
ZEND_API int call_user_function_ex(HashTable *function_table, zval *object, zval *function_name, zval **retval_ptr_ptr, int param_count, zval **params[], int no_separation, HashTable *symbol_table);
|
||||
ZEND_API int call_user_function(HashTable *function_table, zval **object_pp, zval *function_name, zval *retval_ptr, int param_count, zval *params[]);
|
||||
ZEND_API int call_user_function_ex(HashTable *function_table, zval **object_pp, zval *function_name, zval **retval_ptr_ptr, int param_count, zval **params[], int no_separation, HashTable *symbol_table);
|
||||
|
||||
ZEND_API int add_property_long(zval *arg, char *key, long l);
|
||||
ZEND_API int add_property_unset(zval *arg, char *key);
|
||||
|
||||
+29
-1
@@ -137,6 +137,9 @@ ZEND_API void *_emalloc(size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
|
||||
p->orig_lineno = __zend_orig_lineno;
|
||||
p->magic = MEM_BLOCK_START_MAGIC;
|
||||
p->reported = 0;
|
||||
/* Setting the thread id should not be necessary, because we fetched this block
|
||||
* from this thread's cache
|
||||
*/
|
||||
AG(cache_stats)[CACHE_INDEX][1]++;
|
||||
#endif
|
||||
p->persistent = 0;
|
||||
@@ -177,6 +180,9 @@ ZEND_API void *_emalloc(size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
|
||||
p->orig_lineno = __zend_orig_lineno;
|
||||
p->magic = MEM_BLOCK_START_MAGIC;
|
||||
p->reported = 0;
|
||||
# ifdef ZTS
|
||||
p->thread_id = tsrm_thread_id();
|
||||
# endif
|
||||
*((long *)(((char *) p) + sizeof(zend_mem_header)+SIZE+PLATFORM_PADDING+END_ALIGNMENT(SIZE))) = MEM_BLOCK_END_MAGIC;
|
||||
#endif
|
||||
#if MEMORY_LIMIT
|
||||
@@ -193,6 +199,15 @@ ZEND_API void _efree(void *ptr ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
|
||||
DECLARE_CACHE_VARS
|
||||
ALS_FETCH();
|
||||
|
||||
#if defined(ZTS) && ZEND_DEBUG
|
||||
if (p->thread_id != tsrm_thread_id()) {
|
||||
tsrm_error(TSRM_ERROR_LEVEL_ERROR, "Memory block allocated at %s:(%d) on thread %x freed at %s:(%d) on thread %x, ignoring",
|
||||
p->filename, p->lineno, p->thread_id,
|
||||
__zend_filename, __zend_lineno, tsrm_thread_id());
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
CALCULATE_REAL_SIZE_AND_CACHE_INDEX(p->size);
|
||||
#if ZEND_DEBUG
|
||||
if (!_mem_block_check(ptr, 1 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC)) {
|
||||
@@ -253,6 +268,19 @@ ZEND_API void *_erealloc(void *ptr, size_t size, int allow_failure ZEND_FILE_LIN
|
||||
return _emalloc(size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
|
||||
}
|
||||
|
||||
#if defined(ZTS) && ZEND_DEBUG
|
||||
if (p->thread_id != tsrm_thread_id()) {
|
||||
void *new_p;
|
||||
|
||||
tsrm_error(TSRM_ERROR_LEVEL_ERROR, "Memory block allocated at %s:(%d) on thread %x reallocated at %s:(%d) on thread %x, duplicating",
|
||||
p->filename, p->lineno, p->thread_id,
|
||||
__zend_filename, __zend_lineno, tsrm_thread_id());
|
||||
new_p = _emalloc(size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
|
||||
memcpy(new_p, ptr, p->size);
|
||||
return new_p;
|
||||
}
|
||||
#endif
|
||||
|
||||
CALCULATE_REAL_SIZE_AND_CACHE_INDEX(size);
|
||||
|
||||
HANDLE_BLOCK_INTERRUPTIONS();
|
||||
@@ -520,7 +548,7 @@ void zend_debug_alloc_output(char *format, ...)
|
||||
#ifdef ZEND_WIN32
|
||||
OutputDebugString(output_buf);
|
||||
#else
|
||||
fprintf(stderr, output_buf);
|
||||
fprintf(stderr, "%s", output_buf);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
+9
-1
@@ -23,6 +23,10 @@
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#ifdef ZTS
|
||||
#include "../TSRM/TSRM.h"
|
||||
#endif
|
||||
|
||||
#include "zend_globals_macros.h"
|
||||
|
||||
#define MEM_BLOCK_START_MAGIC 0x7312F8DCL
|
||||
@@ -38,6 +42,9 @@ typedef struct _zend_mem_header {
|
||||
int reported;
|
||||
char *orig_filename;
|
||||
uint orig_lineno;
|
||||
# ifdef ZTS
|
||||
THREAD_T thread_id;
|
||||
# endif
|
||||
#endif
|
||||
struct _zend_mem_header *pNext;
|
||||
struct _zend_mem_header *pLast;
|
||||
@@ -64,10 +71,11 @@ typedef union _align_test {
|
||||
|
||||
#define PLATFORM_PADDING (((PLATFORM_ALIGNMENT-sizeof(zend_mem_header))%PLATFORM_ALIGNMENT+PLATFORM_ALIGNMENT)%PLATFORM_ALIGNMENT)
|
||||
|
||||
ZEND_API char *zend_strndup(const char *s, unsigned int length);
|
||||
|
||||
BEGIN_EXTERN_C()
|
||||
|
||||
ZEND_API char *zend_strndup(const char *s, unsigned int length);
|
||||
|
||||
ZEND_API void *_emalloc(size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC);
|
||||
ZEND_API void _efree(void *ptr ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC);
|
||||
ZEND_API void *_ecalloc(size_t nmemb, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC);
|
||||
|
||||
@@ -29,7 +29,7 @@ static ZEND_FUNCTION(zend_version);
|
||||
static ZEND_FUNCTION(func_num_args);
|
||||
static ZEND_FUNCTION(func_get_arg);
|
||||
static ZEND_FUNCTION(func_get_args);
|
||||
static ZEND_FUNCTION(strlen);
|
||||
static ZEND_NAMED_FUNCTION(zend_if_strlen);
|
||||
static ZEND_FUNCTION(strcmp);
|
||||
static ZEND_FUNCTION(strncmp);
|
||||
static ZEND_FUNCTION(strcasecmp);
|
||||
@@ -56,6 +56,8 @@ static ZEND_FUNCTION(trigger_error);
|
||||
static ZEND_FUNCTION(set_error_handler);
|
||||
static ZEND_FUNCTION(restore_error_handler);
|
||||
static ZEND_FUNCTION(get_declared_classes);
|
||||
static ZEND_FUNCTION(get_defined_functions);
|
||||
static ZEND_FUNCTION(get_defined_vars);
|
||||
static ZEND_FUNCTION(create_function);
|
||||
static ZEND_FUNCTION(get_resource_type);
|
||||
#if ZEND_DEBUG
|
||||
@@ -72,7 +74,7 @@ static zend_function_entry builtin_functions[] = {
|
||||
ZEND_FE(func_num_args, NULL)
|
||||
ZEND_FE(func_get_arg, NULL)
|
||||
ZEND_FE(func_get_args, NULL)
|
||||
ZEND_FE(strlen, NULL)
|
||||
{ "strlen", zend_if_strlen, NULL },
|
||||
ZEND_FE(strcmp, NULL)
|
||||
ZEND_FE(strncmp, NULL)
|
||||
ZEND_FE(strcasecmp, NULL)
|
||||
@@ -101,6 +103,8 @@ static zend_function_entry builtin_functions[] = {
|
||||
ZEND_FE(set_error_handler, NULL)
|
||||
ZEND_FE(restore_error_handler, NULL)
|
||||
ZEND_FE(get_declared_classes, NULL)
|
||||
ZEND_FE(get_defined_functions, NULL)
|
||||
ZEND_FE(get_defined_vars, NULL)
|
||||
ZEND_FE(create_function, NULL)
|
||||
ZEND_FE(get_resource_type, NULL)
|
||||
#if ZEND_DEBUG
|
||||
@@ -217,7 +221,7 @@ ZEND_FUNCTION(func_get_args)
|
||||
|
||||
/* {{{ proto int strlen(string str)
|
||||
Get string length */
|
||||
ZEND_FUNCTION(strlen)
|
||||
ZEND_NAMED_FUNCTION(zend_if_strlen)
|
||||
{
|
||||
zval **str;
|
||||
|
||||
@@ -527,6 +531,10 @@ ZEND_FUNCTION(get_class_vars)
|
||||
} else {
|
||||
efree(lcname);
|
||||
array_init(return_value);
|
||||
if (!ce->constants_updated) {
|
||||
zend_hash_apply_with_argument(&ce->default_properties, (int (*)(void *,void *)) zval_update_constant, (void *) 1);
|
||||
ce->constants_updated = 1;
|
||||
}
|
||||
zend_hash_copy(return_value->value.ht, &ce->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
|
||||
}
|
||||
}
|
||||
@@ -584,7 +592,7 @@ ZEND_FUNCTION(get_class_methods)
|
||||
while ((key_type = zend_hash_get_current_key(&ce->function_table, &string_key, &num_key)) != HASH_KEY_NON_EXISTANT) {
|
||||
if (key_type == HASH_KEY_IS_STRING) {
|
||||
MAKE_STD_ZVAL(method_name);
|
||||
ZVAL_STRING(method_name, string_key, 1);
|
||||
ZVAL_STRING(method_name, string_key, 0);
|
||||
zend_hash_next_index_insert(return_value->value.ht, &method_name, sizeof(zval *), NULL);
|
||||
}
|
||||
zend_hash_move_forward(&ce->function_table);
|
||||
@@ -851,6 +859,68 @@ ZEND_FUNCTION(get_declared_classes)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static int copy_function_name(zend_function *func, int num_args, va_list args, zend_hash_key *hash_key)
|
||||
{
|
||||
zval *internal_ar = va_arg(args, zval *),
|
||||
*user_ar = va_arg(args, zval *);
|
||||
|
||||
if (hash_key->nKeyLength == 0 || hash_key->arKey[0] == 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (func->type == ZEND_INTERNAL_FUNCTION) {
|
||||
add_next_index_stringl(internal_ar, hash_key->arKey, hash_key->nKeyLength, 1);
|
||||
} else if (func->type == ZEND_USER_FUNCTION) {
|
||||
add_next_index_stringl(user_ar, hash_key->arKey, hash_key->nKeyLength, 1);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* {{{ proto array get_defined_functions(void)
|
||||
Returns an array of all defined functions */
|
||||
ZEND_FUNCTION(get_defined_functions)
|
||||
{
|
||||
zval *internal;
|
||||
zval *user;
|
||||
|
||||
if (ZEND_NUM_ARGS() != 0) {
|
||||
ZEND_WRONG_PARAM_COUNT();
|
||||
}
|
||||
|
||||
MAKE_STD_ZVAL(internal);
|
||||
MAKE_STD_ZVAL(user);
|
||||
|
||||
array_init(internal);
|
||||
array_init(user);
|
||||
array_init(return_value);
|
||||
|
||||
zend_hash_apply_with_arguments(EG(function_table), (apply_func_args_t)copy_function_name, 2, internal, user);
|
||||
|
||||
if (zend_hash_add(return_value->value.ht, "internal", sizeof("internal"), (void **)&internal, sizeof(zval *), NULL) == FAILURE) {
|
||||
zend_error(E_WARNING, "Cannot add internal functions to return value from get_defined_functions()");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if (zend_hash_add(return_value->value.ht, "user", sizeof("user"), (void **)&user, sizeof(zval *), NULL) == FAILURE) {
|
||||
zend_error(E_WARNING, "Cannot add user functions to return value from get_defined_functions()");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto array get_defined_vars(void)
|
||||
Returns an associative array of names and values of all currently defined variable names (variables in the current scope) */
|
||||
ZEND_FUNCTION(get_defined_vars)
|
||||
{
|
||||
zval *tmp;
|
||||
|
||||
array_init(return_value);
|
||||
|
||||
zend_hash_copy(return_value->value.ht, EG(active_symbol_table),
|
||||
(copy_ctor_func_t)zval_add_ref, &tmp, sizeof(zval *));
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
#define LAMBDA_TEMP_FUNCNAME "__lambda_func"
|
||||
|
||||
|
||||
+143
-140
@@ -18,7 +18,7 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "zend-parser.h"
|
||||
#include "zend_language_parser.h"
|
||||
#include "zend.h"
|
||||
#include "zend_compile.h"
|
||||
#include "zend_llist.h"
|
||||
@@ -34,9 +34,6 @@ ZEND_API zend_compiler_globals compiler_globals;
|
||||
ZEND_API zend_executor_globals executor_globals;
|
||||
#endif
|
||||
|
||||
|
||||
#define SET_UNUSED(op) (op).op_type = IS_UNUSED
|
||||
|
||||
static void free_filename(void *p)
|
||||
{
|
||||
efree(*((char **) p));
|
||||
@@ -157,7 +154,7 @@ static zend_uint get_temporary_variable(zend_op_array *op_array)
|
||||
}
|
||||
|
||||
|
||||
void do_binary_op(int op, znode *result, znode *op1, znode *op2 CLS_DC)
|
||||
void zend_do_binary_op(int op, znode *result, znode *op1, znode *op2 CLS_DC)
|
||||
{
|
||||
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
|
||||
@@ -170,7 +167,7 @@ void do_binary_op(int op, znode *result, znode *op1, znode *op2 CLS_DC)
|
||||
}
|
||||
|
||||
|
||||
void do_unary_op(int op, znode *result, znode *op1 CLS_DC)
|
||||
void zend_do_unary_op(int op, znode *result, znode *op1 CLS_DC)
|
||||
{
|
||||
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
|
||||
@@ -183,7 +180,7 @@ void do_unary_op(int op, znode *result, znode *op1 CLS_DC)
|
||||
}
|
||||
|
||||
|
||||
void do_binary_assign_op(int op, znode *result, znode *op1, znode *op2 CLS_DC)
|
||||
void zend_do_binary_assign_op(int op, znode *result, znode *op1, znode *op2 CLS_DC)
|
||||
{
|
||||
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
|
||||
@@ -198,7 +195,7 @@ void do_binary_assign_op(int op, znode *result, znode *op1, znode *op2 CLS_DC)
|
||||
|
||||
|
||||
|
||||
void do_fetch_globals(znode *varname CLS_DC)
|
||||
void zend_do_fetch_globals(znode *varname CLS_DC)
|
||||
{
|
||||
if (!CG(active_op_array)->uses_globals
|
||||
&& varname->op_type == IS_CONST
|
||||
@@ -278,7 +275,7 @@ void fetch_string_offset(znode *result, znode *parent, znode *offset CLS_DC)
|
||||
}
|
||||
|
||||
|
||||
void do_print(znode *result, znode *arg CLS_DC)
|
||||
void zend_do_print(znode *result, znode *arg CLS_DC)
|
||||
{
|
||||
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
|
||||
@@ -291,7 +288,7 @@ void do_print(znode *result, znode *arg CLS_DC)
|
||||
}
|
||||
|
||||
|
||||
void do_echo(znode *arg CLS_DC)
|
||||
void zend_do_echo(znode *arg CLS_DC)
|
||||
{
|
||||
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
|
||||
@@ -301,7 +298,7 @@ void do_echo(znode *arg CLS_DC)
|
||||
}
|
||||
|
||||
|
||||
void do_assign(znode *result, znode *variable, znode *value CLS_DC)
|
||||
void zend_do_assign(znode *result, znode *variable, znode *value CLS_DC)
|
||||
{
|
||||
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
|
||||
@@ -315,7 +312,7 @@ void do_assign(znode *result, znode *variable, znode *value CLS_DC)
|
||||
}
|
||||
|
||||
|
||||
void do_assign_ref(znode *result, znode *lvar, znode *rvar CLS_DC)
|
||||
void zend_do_assign_ref(znode *result, znode *lvar, znode *rvar CLS_DC)
|
||||
{
|
||||
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
|
||||
@@ -354,7 +351,7 @@ static inline void do_end_loop(int cont_addr CLS_DC)
|
||||
}
|
||||
|
||||
|
||||
void do_while_cond(znode *expr, znode *close_bracket_token CLS_DC)
|
||||
void zend_do_while_cond(znode *expr, znode *close_bracket_token CLS_DC)
|
||||
{
|
||||
int while_cond_op_number = get_next_op_number(CG(active_op_array));
|
||||
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
@@ -369,7 +366,7 @@ void do_while_cond(znode *expr, znode *close_bracket_token CLS_DC)
|
||||
}
|
||||
|
||||
|
||||
void do_while_end(znode *while_token, znode *close_bracket_token CLS_DC)
|
||||
void zend_do_while_end(znode *while_token, znode *close_bracket_token CLS_DC)
|
||||
{
|
||||
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
|
||||
@@ -388,7 +385,7 @@ void do_while_end(znode *while_token, znode *close_bracket_token CLS_DC)
|
||||
}
|
||||
|
||||
|
||||
void do_for_cond(znode *expr, znode *second_semicolon_token CLS_DC)
|
||||
void zend_do_for_cond(znode *expr, znode *second_semicolon_token CLS_DC)
|
||||
{
|
||||
int for_cond_op_number = get_next_op_number(CG(active_op_array));
|
||||
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
@@ -400,7 +397,7 @@ void do_for_cond(znode *expr, znode *second_semicolon_token CLS_DC)
|
||||
}
|
||||
|
||||
|
||||
void do_for_before_statement(znode *cond_start, znode *second_semicolon_token CLS_DC)
|
||||
void zend_do_for_before_statement(znode *cond_start, znode *second_semicolon_token CLS_DC)
|
||||
{
|
||||
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
|
||||
@@ -416,7 +413,7 @@ void do_for_before_statement(znode *cond_start, znode *second_semicolon_token CL
|
||||
}
|
||||
|
||||
|
||||
void do_for_end(znode *second_semicolon_token CLS_DC)
|
||||
void zend_do_for_end(znode *second_semicolon_token CLS_DC)
|
||||
{
|
||||
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
|
||||
@@ -432,7 +429,7 @@ void do_for_end(znode *second_semicolon_token CLS_DC)
|
||||
}
|
||||
|
||||
|
||||
void do_pre_incdec(znode *result, znode *op1, int op CLS_DC)
|
||||
void zend_do_pre_incdec(znode *result, znode *op1, int op CLS_DC)
|
||||
{
|
||||
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
|
||||
@@ -446,7 +443,7 @@ void do_pre_incdec(znode *result, znode *op1, int op CLS_DC)
|
||||
}
|
||||
|
||||
|
||||
void do_post_incdec(znode *result, znode *op1, int op CLS_DC)
|
||||
void zend_do_post_incdec(znode *result, znode *op1, int op CLS_DC)
|
||||
{
|
||||
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
|
||||
@@ -459,7 +456,7 @@ void do_post_incdec(znode *result, znode *op1, int op CLS_DC)
|
||||
}
|
||||
|
||||
|
||||
void do_if_cond(znode *cond, znode *closing_bracket_token CLS_DC)
|
||||
void zend_do_if_cond(znode *cond, znode *closing_bracket_token CLS_DC)
|
||||
{
|
||||
int if_cond_op_number = get_next_op_number(CG(active_op_array));
|
||||
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
@@ -472,7 +469,7 @@ void do_if_cond(znode *cond, znode *closing_bracket_token CLS_DC)
|
||||
}
|
||||
|
||||
|
||||
void do_if_after_statement(znode *closing_bracket_token, unsigned char initialize CLS_DC)
|
||||
void zend_do_if_after_statement(znode *closing_bracket_token, unsigned char initialize CLS_DC)
|
||||
{
|
||||
int if_end_op_number = get_next_op_number(CG(active_op_array));
|
||||
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
@@ -495,7 +492,7 @@ void do_if_after_statement(znode *closing_bracket_token, unsigned char initializ
|
||||
}
|
||||
|
||||
|
||||
void do_if_end(CLS_D)
|
||||
void zend_do_if_end(CLS_D)
|
||||
{
|
||||
int next_op_number = get_next_op_number(CG(active_op_array));
|
||||
zend_llist *jmp_list_ptr;
|
||||
@@ -511,7 +508,7 @@ void do_if_end(CLS_D)
|
||||
}
|
||||
|
||||
|
||||
void do_begin_variable_parse(CLS_D)
|
||||
void zend_do_begin_variable_parse(CLS_D)
|
||||
{
|
||||
zend_llist fetch_list;
|
||||
|
||||
@@ -520,7 +517,7 @@ void do_begin_variable_parse(CLS_D)
|
||||
}
|
||||
|
||||
|
||||
void do_end_variable_parse(int type, int arg_offset CLS_DC)
|
||||
void zend_do_end_variable_parse(int type, int arg_offset CLS_DC)
|
||||
{
|
||||
zend_llist *fetch_list_ptr;
|
||||
zend_llist_element *le;
|
||||
@@ -585,7 +582,7 @@ static zend_bool is_method_call(CLS_D)
|
||||
}
|
||||
|
||||
|
||||
void do_init_string(znode *result CLS_DC)
|
||||
void zend_do_init_string(znode *result CLS_DC)
|
||||
{
|
||||
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
|
||||
@@ -598,7 +595,7 @@ void do_init_string(znode *result CLS_DC)
|
||||
}
|
||||
|
||||
|
||||
void do_add_char(znode *result, znode *op1, znode *op2 CLS_DC)
|
||||
void zend_do_add_char(znode *result, znode *op1, znode *op2 CLS_DC)
|
||||
{
|
||||
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
|
||||
@@ -611,7 +608,7 @@ void do_add_char(znode *result, znode *op1, znode *op2 CLS_DC)
|
||||
}
|
||||
|
||||
|
||||
void do_add_string(znode *result, znode *op1, znode *op2 CLS_DC)
|
||||
void zend_do_add_string(znode *result, znode *op1, znode *op2 CLS_DC)
|
||||
{
|
||||
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
|
||||
@@ -624,7 +621,7 @@ void do_add_string(znode *result, znode *op1, znode *op2 CLS_DC)
|
||||
}
|
||||
|
||||
|
||||
void do_add_variable(znode *result, znode *op1, znode *op2 CLS_DC)
|
||||
void zend_do_add_variable(znode *result, znode *op1, znode *op2 CLS_DC)
|
||||
{
|
||||
zend_op *opline;
|
||||
|
||||
@@ -660,7 +657,7 @@ void do_add_variable(znode *result, znode *op1, znode *op2 CLS_DC)
|
||||
}
|
||||
|
||||
|
||||
void do_free(znode *op1 CLS_DC)
|
||||
void zend_do_free(znode *op1 CLS_DC)
|
||||
{
|
||||
if (op1->op_type==IS_TMP_VAR) {
|
||||
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
@@ -706,7 +703,7 @@ void do_free(znode *op1 CLS_DC)
|
||||
}
|
||||
|
||||
|
||||
void do_begin_function_declaration(znode *function_token, znode *function_name, int is_method, int return_reference CLS_DC)
|
||||
void zend_do_begin_function_declaration(znode *function_token, znode *function_name, int is_method, int return_reference CLS_DC)
|
||||
{
|
||||
zend_op_array op_array;
|
||||
char *name = function_name->u.constant.value.str.val;
|
||||
@@ -763,10 +760,10 @@ void do_begin_function_declaration(znode *function_token, znode *function_name,
|
||||
}
|
||||
|
||||
|
||||
void do_end_function_declaration(znode *function_token CLS_DC)
|
||||
void zend_do_end_function_declaration(znode *function_token CLS_DC)
|
||||
{
|
||||
do_extended_info(CLS_C);
|
||||
do_return(NULL, 0 CLS_CC);
|
||||
zend_do_extended_info(CLS_C);
|
||||
zend_do_return(NULL, 0 CLS_CC);
|
||||
pass_two(CG(active_op_array));
|
||||
CG(active_op_array) = function_token->u.op_array;
|
||||
|
||||
@@ -776,7 +773,7 @@ void do_end_function_declaration(znode *function_token CLS_DC)
|
||||
}
|
||||
|
||||
|
||||
void do_receive_arg(int op, znode *var, znode *offset, znode *initialization, unsigned char pass_type CLS_DC)
|
||||
void zend_do_receive_arg(int op, znode *var, znode *offset, znode *initialization, unsigned char pass_type CLS_DC)
|
||||
{
|
||||
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
|
||||
@@ -807,7 +804,7 @@ void do_receive_arg(int op, znode *var, znode *offset, znode *initialization, un
|
||||
}
|
||||
|
||||
|
||||
int do_begin_function_call(znode *function_name CLS_DC)
|
||||
int zend_do_begin_function_call(znode *function_name CLS_DC)
|
||||
{
|
||||
zend_function *function;
|
||||
|
||||
@@ -816,7 +813,7 @@ int do_begin_function_call(znode *function_name CLS_DC)
|
||||
znode tmp = *function_name;
|
||||
|
||||
zval_copy_ctor(&tmp.u.constant);
|
||||
do_begin_dynamic_function_call(&tmp CLS_CC);
|
||||
zend_do_begin_dynamic_function_call(&tmp CLS_CC);
|
||||
return 1; /* Dynamic */
|
||||
}
|
||||
|
||||
@@ -834,19 +831,19 @@ int do_begin_function_call(znode *function_name CLS_DC)
|
||||
}
|
||||
break;
|
||||
}
|
||||
do_extended_fcall_begin(CLS_C);
|
||||
zend_do_extended_fcall_begin(CLS_C);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void do_begin_dynamic_function_call(znode *function_name CLS_DC)
|
||||
void zend_do_begin_dynamic_function_call(znode *function_name CLS_DC)
|
||||
{
|
||||
unsigned char *ptr = NULL;
|
||||
int last_op_number;
|
||||
zend_op *last_op;
|
||||
|
||||
if (function_name->op_type != IS_CONST && is_method_call(CLS_C)) {
|
||||
do_end_variable_parse(BP_VAR_W, 0 CLS_CC);
|
||||
zend_do_end_variable_parse(BP_VAR_W, 0 CLS_CC);
|
||||
last_op_number = get_next_op_number(CG(active_op_array))-1;
|
||||
last_op = &CG(active_op_array)->opcodes[last_op_number];
|
||||
last_op->opcode = ZEND_INIT_FCALL_BY_NAME;
|
||||
@@ -855,7 +852,7 @@ void do_begin_dynamic_function_call(znode *function_name CLS_DC)
|
||||
zend_op *opline;
|
||||
|
||||
if (function_name->op_type != IS_CONST) {
|
||||
do_end_variable_parse(BP_VAR_R, 0 CLS_CC);
|
||||
zend_do_end_variable_parse(BP_VAR_R, 0 CLS_CC);
|
||||
}
|
||||
|
||||
opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
@@ -865,11 +862,11 @@ void do_begin_dynamic_function_call(znode *function_name CLS_DC)
|
||||
SET_UNUSED(opline->op1);
|
||||
}
|
||||
zend_stack_push(&CG(function_call_stack), (void *) &ptr, sizeof(zend_function *));
|
||||
do_extended_fcall_begin(CLS_C);
|
||||
zend_do_extended_fcall_begin(CLS_C);
|
||||
}
|
||||
|
||||
|
||||
void do_begin_class_member_function_call(znode *class_name, znode *function_name CLS_DC)
|
||||
void zend_do_begin_class_member_function_call(znode *class_name, znode *function_name CLS_DC)
|
||||
{
|
||||
unsigned char *ptr = NULL;
|
||||
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
@@ -893,7 +890,7 @@ void do_begin_class_member_function_call(znode *class_name, znode *function_name
|
||||
}
|
||||
|
||||
|
||||
void do_end_function_call(znode *function_name, znode *result, znode *argument_list, int is_method, int is_dynamic_fcall CLS_DC)
|
||||
void zend_do_end_function_call(znode *function_name, znode *result, znode *argument_list, int is_method, int is_dynamic_fcall CLS_DC)
|
||||
{
|
||||
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
|
||||
@@ -913,12 +910,13 @@ void do_end_function_call(znode *function_name, znode *result, znode *argument_l
|
||||
}
|
||||
|
||||
|
||||
void do_pass_param(znode *param, int op, int offset CLS_DC)
|
||||
void zend_do_pass_param(znode *param, int op, int offset CLS_DC)
|
||||
{
|
||||
zend_op *opline;
|
||||
unsigned char *arg_types;
|
||||
int original_op=op;
|
||||
zend_function **function_ptr_ptr, *function_ptr;
|
||||
int send_by_reference;
|
||||
|
||||
|
||||
zend_stack_top(&CG(function_call_stack), (void **) &function_ptr_ptr);
|
||||
@@ -942,20 +940,13 @@ void do_pass_param(znode *param, int op, int offset CLS_DC)
|
||||
arg_types = NULL;
|
||||
}
|
||||
|
||||
if (op == ZEND_SEND_VAL) {
|
||||
switch (param->op_type) {
|
||||
case IS_CONST: /* constants behave like variables when passed to functions,
|
||||
* as far as reference counting is concerned. Treat them
|
||||
* as if they were variables here.
|
||||
*/
|
||||
case IS_VAR:
|
||||
op = ZEND_SEND_VAR;
|
||||
break;
|
||||
}
|
||||
send_by_reference = ARG_SHOULD_BE_SENT_BY_REF(offset, 1, arg_types)?ZEND_ARG_SEND_BY_REF:0;
|
||||
|
||||
if (op == ZEND_SEND_VAL && param->op_type == IS_VAR) {
|
||||
op = ZEND_SEND_VAR_NO_REF;
|
||||
}
|
||||
|
||||
|
||||
if (ARG_SHOULD_BE_SENT_BY_REF(offset, 1, arg_types)) {
|
||||
if (op!=ZEND_SEND_VAR_NO_REF && send_by_reference == ZEND_ARG_SEND_BY_REF) {
|
||||
/* change to passing by reference */
|
||||
switch (param->op_type) {
|
||||
case IS_VAR:
|
||||
@@ -967,26 +958,38 @@ void do_pass_param(znode *param, int op, int offset CLS_DC)
|
||||
}
|
||||
}
|
||||
|
||||
if (original_op==ZEND_SEND_VAR) {
|
||||
if (original_op == ZEND_SEND_VAR) {
|
||||
switch(op) {
|
||||
case ZEND_SEND_VAR_NO_REF:
|
||||
zend_do_end_variable_parse(BP_VAR_R, 0 CLS_CC);
|
||||
break;
|
||||
case ZEND_SEND_VAR:
|
||||
if (function_ptr) {
|
||||
do_end_variable_parse(BP_VAR_R, 0 CLS_CC);
|
||||
zend_do_end_variable_parse(BP_VAR_R, 0 CLS_CC);
|
||||
} else {
|
||||
do_end_variable_parse(BP_VAR_FUNC_ARG, offset CLS_CC);
|
||||
zend_do_end_variable_parse(BP_VAR_FUNC_ARG, offset CLS_CC);
|
||||
}
|
||||
break;
|
||||
case ZEND_SEND_REF:
|
||||
do_end_variable_parse(BP_VAR_W, 0 CLS_CC);
|
||||
zend_do_end_variable_parse(BP_VAR_W, 0 CLS_CC);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
if (function_ptr) {
|
||||
opline->extended_value = ZEND_DO_FCALL;
|
||||
|
||||
if (op == ZEND_SEND_VAR_NO_REF) {
|
||||
if (function_ptr) {
|
||||
opline->extended_value = ZEND_ARG_COMPILE_TIME_BOUND | send_by_reference;
|
||||
} else {
|
||||
opline->extended_value = 0;
|
||||
}
|
||||
} else {
|
||||
opline->extended_value = ZEND_DO_FCALL_BY_NAME;
|
||||
if (function_ptr) {
|
||||
opline->extended_value = ZEND_DO_FCALL;
|
||||
} else {
|
||||
opline->extended_value = ZEND_DO_FCALL_BY_NAME;
|
||||
}
|
||||
}
|
||||
opline->opcode = op;
|
||||
opline->op1 = *param;
|
||||
@@ -1029,15 +1032,15 @@ static int generate_free_foreach_copy(znode *foreach_copy CLS_DC)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void do_return(znode *expr, int do_end_vparse CLS_DC)
|
||||
void zend_do_return(znode *expr, int do_end_vparse CLS_DC)
|
||||
{
|
||||
zend_op *opline;
|
||||
|
||||
if (do_end_vparse) {
|
||||
if (CG(active_op_array)->return_reference) {
|
||||
do_end_variable_parse(BP_VAR_W, 0 CLS_CC);
|
||||
zend_do_end_variable_parse(BP_VAR_W, 0 CLS_CC);
|
||||
} else {
|
||||
do_end_variable_parse(BP_VAR_R, 0 CLS_CC);
|
||||
zend_do_end_variable_parse(BP_VAR_R, 0 CLS_CC);
|
||||
}
|
||||
}
|
||||
#ifdef ZTS
|
||||
@@ -1094,7 +1097,7 @@ static void do_inherit_parent_constructor(zend_class_entry *ce)
|
||||
}
|
||||
}
|
||||
|
||||
void do_inheritance(zend_class_entry *ce, zend_class_entry *parent_ce)
|
||||
void zend_do_inheritance(zend_class_entry *ce, zend_class_entry *parent_ce)
|
||||
{
|
||||
zend_function tmp_zend_function;
|
||||
zval *tmp;
|
||||
@@ -1181,7 +1184,7 @@ ZEND_API int do_bind_function_or_class(zend_op *opline, HashTable *function_tabl
|
||||
}
|
||||
efree(parent_name);
|
||||
|
||||
do_inheritance(ce, parent_ce);
|
||||
zend_do_inheritance(ce, parent_ce);
|
||||
|
||||
/* Register the derived class */
|
||||
if (zend_hash_add(class_table, class_name, strlen(class_name)+1, ce, sizeof(zend_class_entry), NULL)==FAILURE) {
|
||||
@@ -1201,7 +1204,7 @@ ZEND_API int do_bind_function_or_class(zend_op *opline, HashTable *function_tabl
|
||||
}
|
||||
|
||||
|
||||
void do_early_binding(CLS_D)
|
||||
void zend_do_early_binding(CLS_D)
|
||||
{
|
||||
zend_op *opline = &CG(active_op_array)->opcodes[CG(active_op_array)->last-1];
|
||||
HashTable *table;
|
||||
@@ -1231,7 +1234,7 @@ void do_early_binding(CLS_D)
|
||||
}
|
||||
|
||||
|
||||
void do_boolean_or_begin(znode *expr1, znode *op_token CLS_DC)
|
||||
void zend_do_boolean_or_begin(znode *expr1, znode *op_token CLS_DC)
|
||||
{
|
||||
int next_op_number = get_next_op_number(CG(active_op_array));
|
||||
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
@@ -1252,7 +1255,7 @@ void do_boolean_or_begin(znode *expr1, znode *op_token CLS_DC)
|
||||
}
|
||||
|
||||
|
||||
void do_boolean_or_end(znode *result, znode *expr1, znode *expr2, znode *op_token CLS_DC)
|
||||
void zend_do_boolean_or_end(znode *result, znode *expr1, znode *expr2, znode *op_token CLS_DC)
|
||||
{
|
||||
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
|
||||
@@ -1266,7 +1269,7 @@ void do_boolean_or_end(znode *result, znode *expr1, znode *expr2, znode *op_toke
|
||||
}
|
||||
|
||||
|
||||
void do_boolean_and_begin(znode *expr1, znode *op_token CLS_DC)
|
||||
void zend_do_boolean_and_begin(znode *expr1, znode *op_token CLS_DC)
|
||||
{
|
||||
int next_op_number = get_next_op_number(CG(active_op_array));
|
||||
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
@@ -1287,7 +1290,7 @@ void do_boolean_and_begin(znode *expr1, znode *op_token CLS_DC)
|
||||
}
|
||||
|
||||
|
||||
void do_boolean_and_end(znode *result, znode *expr1, znode *expr2, znode *op_token CLS_DC)
|
||||
void zend_do_boolean_and_end(znode *result, znode *expr1, znode *expr2, znode *op_token CLS_DC)
|
||||
{
|
||||
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
|
||||
@@ -1301,14 +1304,14 @@ void do_boolean_and_end(znode *result, znode *expr1, znode *expr2, znode *op_tok
|
||||
}
|
||||
|
||||
|
||||
void do_do_while_begin(CLS_D)
|
||||
void zend_do_do_while_begin(CLS_D)
|
||||
{
|
||||
do_begin_loop(CLS_C);
|
||||
INC_BPC(CG(active_op_array));
|
||||
}
|
||||
|
||||
|
||||
void do_do_while_end(znode *do_token, znode *expr_open_bracket, znode *expr CLS_DC)
|
||||
void zend_do_do_while_end(znode *do_token, znode *expr_open_bracket, znode *expr CLS_DC)
|
||||
{
|
||||
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
|
||||
@@ -1323,7 +1326,7 @@ void do_do_while_end(znode *do_token, znode *expr_open_bracket, znode *expr CLS_
|
||||
}
|
||||
|
||||
|
||||
void do_brk_cont(int op, znode *expr CLS_DC)
|
||||
void zend_do_brk_cont(int op, znode *expr CLS_DC)
|
||||
{
|
||||
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
|
||||
@@ -1341,7 +1344,7 @@ void do_brk_cont(int op, znode *expr CLS_DC)
|
||||
}
|
||||
|
||||
|
||||
void do_switch_cond(znode *cond CLS_DC)
|
||||
void zend_do_switch_cond(znode *cond CLS_DC)
|
||||
{
|
||||
zend_switch_entry switch_entry;
|
||||
zend_op *opline;
|
||||
@@ -1369,7 +1372,7 @@ void do_switch_cond(znode *cond CLS_DC)
|
||||
|
||||
|
||||
|
||||
void do_switch_end(znode *case_list CLS_DC)
|
||||
void zend_do_switch_end(znode *case_list CLS_DC)
|
||||
{
|
||||
zend_op *opline;
|
||||
zend_switch_entry *switch_entry_ptr;
|
||||
@@ -1414,7 +1417,7 @@ void do_switch_end(znode *case_list CLS_DC)
|
||||
}
|
||||
|
||||
|
||||
void do_case_before_statement(znode *case_list, znode *case_token, znode *case_expr CLS_DC)
|
||||
void zend_do_case_before_statement(znode *case_list, znode *case_token, znode *case_expr CLS_DC)
|
||||
{
|
||||
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
int next_op_number;
|
||||
@@ -1448,7 +1451,7 @@ void do_case_before_statement(znode *case_list, znode *case_token, znode *case_e
|
||||
}
|
||||
|
||||
|
||||
void do_case_after_statement(znode *result, znode *case_token CLS_DC)
|
||||
void zend_do_case_after_statement(znode *result, znode *case_token CLS_DC)
|
||||
{
|
||||
int next_op_number = get_next_op_number(CG(active_op_array));
|
||||
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
@@ -1470,7 +1473,7 @@ void do_case_after_statement(znode *result, znode *case_token CLS_DC)
|
||||
|
||||
|
||||
|
||||
void do_default_before_statement(znode *case_list, znode *default_token CLS_DC)
|
||||
void zend_do_default_before_statement(znode *case_list, znode *default_token CLS_DC)
|
||||
{
|
||||
int next_op_number = get_next_op_number(CG(active_op_array));
|
||||
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
@@ -1503,7 +1506,7 @@ void do_default_before_statement(znode *case_list, znode *default_token CLS_DC)
|
||||
}
|
||||
|
||||
|
||||
void do_begin_class_declaration(znode *class_name, znode *parent_class_name CLS_DC)
|
||||
void zend_do_begin_class_declaration(znode *class_name, znode *parent_class_name CLS_DC)
|
||||
{
|
||||
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
int runtime_inheritance = 0;
|
||||
@@ -1585,14 +1588,14 @@ void do_begin_class_declaration(znode *class_name, znode *parent_class_name CLS_
|
||||
}
|
||||
|
||||
|
||||
void do_end_class_declaration(CLS_D)
|
||||
void zend_do_end_class_declaration(CLS_D)
|
||||
{
|
||||
do_inherit_parent_constructor(CG(active_class_entry));
|
||||
CG(active_class_entry) = NULL;
|
||||
}
|
||||
|
||||
|
||||
void do_declare_property(znode *var_name, znode *value CLS_DC)
|
||||
void zend_do_declare_property(znode *var_name, znode *value CLS_DC)
|
||||
{
|
||||
if (value) {
|
||||
zval *property;
|
||||
@@ -1606,7 +1609,7 @@ void do_declare_property(znode *var_name, znode *value CLS_DC)
|
||||
}
|
||||
|
||||
|
||||
void do_fetch_property(znode *result, znode *object, znode *property CLS_DC)
|
||||
void zend_do_fetch_property(znode *result, znode *object, znode *property CLS_DC)
|
||||
{
|
||||
zend_op opline;
|
||||
zend_llist *fetch_list_ptr;
|
||||
@@ -1625,13 +1628,13 @@ void do_fetch_property(znode *result, znode *object, znode *property CLS_DC)
|
||||
}
|
||||
|
||||
|
||||
void do_push_object(znode *object CLS_DC)
|
||||
void zend_do_push_object(znode *object CLS_DC)
|
||||
{
|
||||
zend_stack_push(&CG(object_stack), object, sizeof(znode));
|
||||
}
|
||||
|
||||
|
||||
void do_pop_object(znode *object CLS_DC)
|
||||
void zend_do_pop_object(znode *object CLS_DC)
|
||||
{
|
||||
znode *tmp;
|
||||
|
||||
@@ -1641,7 +1644,7 @@ void do_pop_object(znode *object CLS_DC)
|
||||
}
|
||||
|
||||
|
||||
void do_begin_new_object(znode *new_token, znode *class_name CLS_DC)
|
||||
void zend_do_begin_new_object(znode *new_token, znode *class_name CLS_DC)
|
||||
{
|
||||
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
unsigned char *ptr = NULL;
|
||||
@@ -1652,10 +1655,6 @@ void do_begin_new_object(znode *new_token, znode *class_name CLS_DC)
|
||||
opline->op1 = *class_name;
|
||||
SET_UNUSED(opline->op2);
|
||||
|
||||
/* *result = opline->result;
|
||||
do_assign(result, variable, &opline->result CLS_CC); */
|
||||
|
||||
|
||||
new_token->u.opline_num = get_next_op_number(CG(active_op_array));
|
||||
opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
opline->opcode = ZEND_JMP_NO_CTOR;
|
||||
@@ -1674,22 +1673,22 @@ void do_begin_new_object(znode *new_token, znode *class_name CLS_DC)
|
||||
}
|
||||
|
||||
|
||||
void do_end_new_object(znode *result, znode *class_name, znode *new_token, znode *argument_list CLS_DC)
|
||||
void zend_do_end_new_object(znode *result, znode *class_name, znode *new_token, znode *argument_list CLS_DC)
|
||||
{
|
||||
znode ctor_result;
|
||||
|
||||
if (class_name->op_type == IS_CONST) {
|
||||
zval_copy_ctor(&class_name->u.constant);
|
||||
}
|
||||
do_end_function_call(class_name, &ctor_result, argument_list, 1, 0 CLS_CC);
|
||||
do_free(&ctor_result CLS_CC);
|
||||
zend_do_end_function_call(class_name, &ctor_result, argument_list, 1, 0 CLS_CC);
|
||||
zend_do_free(&ctor_result CLS_CC);
|
||||
|
||||
CG(active_op_array)->opcodes[new_token->u.opline_num].op2.u.opline_num = get_next_op_number(CG(active_op_array));
|
||||
*result = CG(active_op_array)->opcodes[new_token->u.opline_num].op1;
|
||||
}
|
||||
|
||||
|
||||
void do_fetch_constant(znode *result, znode *constant_name, int mode CLS_DC)
|
||||
void zend_do_fetch_constant(znode *result, znode *constant_name, int mode CLS_DC)
|
||||
{
|
||||
switch (mode) {
|
||||
case ZEND_CT:
|
||||
@@ -1711,7 +1710,7 @@ void do_fetch_constant(znode *result, znode *constant_name, int mode CLS_DC)
|
||||
}
|
||||
|
||||
|
||||
void do_shell_exec(znode *result, znode *cmd CLS_DC)
|
||||
void zend_do_shell_exec(znode *result, znode *cmd CLS_DC)
|
||||
{
|
||||
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
|
||||
@@ -1744,7 +1743,7 @@ void do_shell_exec(znode *result, znode *cmd CLS_DC)
|
||||
|
||||
|
||||
|
||||
void do_init_array(znode *result, znode *expr, znode *offset, int is_ref CLS_DC)
|
||||
void zend_do_init_array(znode *result, znode *expr, znode *offset, int is_ref CLS_DC)
|
||||
{
|
||||
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
|
||||
@@ -1767,7 +1766,7 @@ void do_init_array(znode *result, znode *expr, znode *offset, int is_ref CLS_DC)
|
||||
}
|
||||
|
||||
|
||||
void do_add_array_element(znode *result, znode *expr, znode *offset, int is_ref CLS_DC)
|
||||
void zend_do_add_array_element(znode *result, znode *expr, znode *offset, int is_ref CLS_DC)
|
||||
{
|
||||
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
|
||||
@@ -1784,7 +1783,7 @@ void do_add_array_element(znode *result, znode *expr, znode *offset, int is_ref
|
||||
|
||||
|
||||
|
||||
void do_add_static_array_element(znode *result, znode *offset, znode *expr)
|
||||
void zend_do_add_static_array_element(znode *result, znode *offset, znode *expr)
|
||||
{
|
||||
zval *element;
|
||||
|
||||
@@ -1792,6 +1791,7 @@ void do_add_static_array_element(znode *result, znode *offset, znode *expr)
|
||||
*element = expr->u.constant;
|
||||
if (offset) {
|
||||
switch (offset->u.constant.type) {
|
||||
case IS_CONSTANT:
|
||||
case IS_STRING:
|
||||
zend_hash_update(result->u.constant.value.ht, offset->u.constant.value.str.val, offset->u.constant.value.str.len+1, &element, sizeof(zval *), NULL);
|
||||
zval_dtor(&offset->u.constant);
|
||||
@@ -1806,7 +1806,7 @@ void do_add_static_array_element(znode *result, znode *offset, znode *expr)
|
||||
}
|
||||
|
||||
|
||||
void do_add_list_element(znode *element CLS_DC)
|
||||
void zend_do_add_list_element(znode *element CLS_DC)
|
||||
{
|
||||
list_llist_element lle;
|
||||
|
||||
@@ -1819,29 +1819,29 @@ void do_add_list_element(znode *element CLS_DC)
|
||||
}
|
||||
|
||||
|
||||
void do_new_list_begin(CLS_D)
|
||||
void zend_do_new_list_begin(CLS_D)
|
||||
{
|
||||
int current_dimension = 0;
|
||||
zend_llist_add_element(&CG(dimension_llist), ¤t_dimension);
|
||||
}
|
||||
|
||||
|
||||
void do_new_list_end(CLS_D)
|
||||
void zend_do_new_list_end(CLS_D)
|
||||
{
|
||||
zend_llist_remove_tail(&CG(dimension_llist));
|
||||
(*((int *)CG(dimension_llist).tail->data))++;
|
||||
}
|
||||
|
||||
|
||||
void do_list_init(CLS_D)
|
||||
void zend_do_list_init(CLS_D)
|
||||
{
|
||||
zend_llist_init(&CG(list_llist), sizeof(list_llist_element), NULL, 0);
|
||||
zend_llist_init(&CG(dimension_llist), sizeof(int), NULL, 0);
|
||||
do_new_list_begin(CLS_C);
|
||||
zend_do_new_list_begin(CLS_C);
|
||||
}
|
||||
|
||||
|
||||
void do_list_end(znode *result, znode *expr CLS_DC)
|
||||
void zend_do_list_end(znode *result, znode *expr CLS_DC)
|
||||
{
|
||||
zend_llist_element *le;
|
||||
zend_llist_element *dimension;
|
||||
@@ -1861,7 +1861,10 @@ void do_list_end(znode *result, znode *expr CLS_DC)
|
||||
opline->opcode = ZEND_FETCH_DIM_R;
|
||||
break;
|
||||
case IS_TMP_VAR:
|
||||
opline->opcode = ZEND_FETCH_DIM_TMP_VAR;
|
||||
break;
|
||||
case IS_CONST: /* fetch_dim_tmp_var will handle this bogus fetch */
|
||||
zval_copy_ctor(&expr->u.constant);
|
||||
opline->opcode = ZEND_FETCH_DIM_TMP_VAR;
|
||||
break;
|
||||
}
|
||||
@@ -1882,8 +1885,8 @@ void do_list_end(znode *result, znode *expr CLS_DC)
|
||||
}
|
||||
((list_llist_element *) le->data)->value = last_container;
|
||||
zend_llist_destroy(&((list_llist_element *) le->data)->dimensions);
|
||||
do_end_variable_parse(BP_VAR_W, 0 CLS_CC);
|
||||
do_assign(result, &((list_llist_element *) le->data)->var, &((list_llist_element *) le->data)->value CLS_CC);
|
||||
zend_do_end_variable_parse(BP_VAR_W, 0 CLS_CC);
|
||||
zend_do_assign(result, &((list_llist_element *) le->data)->var, &((list_llist_element *) le->data)->value CLS_CC);
|
||||
CG(active_op_array)->opcodes[CG(active_op_array)->last-1].result.u.EA.type |= EXT_TYPE_UNUSED;
|
||||
le = le->next;
|
||||
}
|
||||
@@ -1893,7 +1896,7 @@ void do_list_end(znode *result, znode *expr CLS_DC)
|
||||
}
|
||||
|
||||
|
||||
void do_fetch_global_or_static_variable(znode *varname, znode *static_assignment, int fetch_type CLS_DC)
|
||||
void zend_do_fetch_global_or_static_variable(znode *varname, znode *static_assignment, int fetch_type CLS_DC)
|
||||
{
|
||||
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
znode lval;
|
||||
@@ -1927,12 +1930,12 @@ void do_fetch_global_or_static_variable(znode *varname, znode *static_assignment
|
||||
}
|
||||
fetch_simple_variable(&lval, varname, 0 CLS_CC); /* Relies on the fact that the default fetch is BP_VAR_W */
|
||||
|
||||
do_assign_ref(NULL, &lval, &result CLS_CC);
|
||||
zend_do_assign_ref(NULL, &lval, &result CLS_CC);
|
||||
CG(active_op_array)->opcodes[CG(active_op_array)->last-1].result.u.EA.type |= EXT_TYPE_UNUSED;
|
||||
}
|
||||
|
||||
|
||||
void do_cast(znode *result, znode *expr, int type CLS_DC)
|
||||
void zend_do_cast(znode *result, znode *expr, int type CLS_DC)
|
||||
{
|
||||
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
|
||||
@@ -1946,9 +1949,9 @@ void do_cast(znode *result, znode *expr, int type CLS_DC)
|
||||
}
|
||||
|
||||
|
||||
void do_include_or_eval(int type, znode *result, znode *op1 CLS_DC)
|
||||
void zend_do_include_or_eval(int type, znode *result, znode *op1 CLS_DC)
|
||||
{
|
||||
do_extended_fcall_begin(CLS_C);
|
||||
zend_do_extended_fcall_begin(CLS_C);
|
||||
{
|
||||
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
|
||||
@@ -1963,25 +1966,25 @@ void do_include_or_eval(int type, znode *result, znode *op1 CLS_DC)
|
||||
opline->result.u.EA.type |= EXT_TYPE_UNUSED;
|
||||
}
|
||||
}
|
||||
do_extended_fcall_end(CLS_C);
|
||||
zend_do_extended_fcall_end(CLS_C);
|
||||
}
|
||||
|
||||
|
||||
void do_indirect_references(znode *result, znode *num_references, znode *variable CLS_DC)
|
||||
void zend_do_indirect_references(znode *result, znode *num_references, znode *variable CLS_DC)
|
||||
{
|
||||
int i;
|
||||
|
||||
do_end_variable_parse(BP_VAR_R, 0 CLS_CC);
|
||||
zend_do_end_variable_parse(BP_VAR_R, 0 CLS_CC);
|
||||
for (i=1; i<num_references->u.constant.value.lval; i++) {
|
||||
fetch_simple_variable_ex(result, variable, 0, ZEND_FETCH_R CLS_CC);
|
||||
*variable = *result;
|
||||
}
|
||||
do_begin_variable_parse(CLS_C);
|
||||
zend_do_begin_variable_parse(CLS_C);
|
||||
fetch_simple_variable(result, variable, 1 CLS_CC);
|
||||
}
|
||||
|
||||
|
||||
void do_unset(znode *variable CLS_DC)
|
||||
void zend_do_unset(znode *variable CLS_DC)
|
||||
{
|
||||
zend_op *last_op;
|
||||
|
||||
@@ -2000,11 +2003,11 @@ void do_unset(znode *variable CLS_DC)
|
||||
}
|
||||
|
||||
|
||||
void do_isset_or_isempty(int type, znode *result, znode *variable CLS_DC)
|
||||
void zend_do_isset_or_isempty(int type, znode *result, znode *variable CLS_DC)
|
||||
{
|
||||
zend_op *opline;
|
||||
|
||||
do_end_variable_parse(BP_VAR_IS, 0 CLS_CC);
|
||||
zend_do_end_variable_parse(BP_VAR_IS, 0 CLS_CC);
|
||||
opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
|
||||
opline->opcode = ZEND_ISSET_ISEMPTY;
|
||||
@@ -2017,7 +2020,7 @@ void do_isset_or_isempty(int type, znode *result, znode *variable CLS_DC)
|
||||
}
|
||||
|
||||
|
||||
void do_foreach_begin(znode *foreach_token, znode *array, znode *open_brackets_token, znode *as_token, int variable CLS_DC)
|
||||
void zend_do_foreach_begin(znode *foreach_token, znode *array, znode *open_brackets_token, znode *as_token, int variable CLS_DC)
|
||||
{
|
||||
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
|
||||
@@ -2049,7 +2052,7 @@ void do_foreach_begin(znode *foreach_token, znode *array, znode *open_brackets_t
|
||||
}
|
||||
|
||||
|
||||
void do_foreach_cont(znode *value, znode *key, znode *as_token CLS_DC)
|
||||
void zend_do_foreach_cont(znode *value, znode *key, znode *as_token CLS_DC)
|
||||
{
|
||||
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
znode result_value, result_key, dummy;
|
||||
@@ -2088,20 +2091,20 @@ void do_foreach_cont(znode *value, znode *key, znode *as_token CLS_DC)
|
||||
result_key = opline->result;
|
||||
}
|
||||
|
||||
do_assign(&dummy, value, &result_value CLS_CC);
|
||||
zend_do_assign(&dummy, value, &result_value CLS_CC);
|
||||
CG(active_op_array)->opcodes[CG(active_op_array)->last-1].result.u.EA.type |= EXT_TYPE_UNUSED;
|
||||
if (key->op_type != IS_UNUSED) {
|
||||
do_assign(&dummy, key, &result_key CLS_CC);
|
||||
zend_do_assign(&dummy, key, &result_key CLS_CC);
|
||||
CG(active_op_array)->opcodes[CG(active_op_array)->last-1].result.u.EA.type |= EXT_TYPE_UNUSED;
|
||||
}
|
||||
do_free(as_token CLS_CC);
|
||||
zend_do_free(as_token CLS_CC);
|
||||
|
||||
do_begin_loop(CLS_C);
|
||||
INC_BPC(CG(active_op_array));
|
||||
}
|
||||
|
||||
|
||||
void do_foreach_end(znode *foreach_token, znode *open_brackets_token CLS_DC)
|
||||
void zend_do_foreach_end(znode *foreach_token, znode *open_brackets_token CLS_DC)
|
||||
{
|
||||
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
|
||||
@@ -2122,13 +2125,13 @@ void do_foreach_end(znode *foreach_token, znode *open_brackets_token CLS_DC)
|
||||
}
|
||||
|
||||
|
||||
void do_declare_begin(CLS_D)
|
||||
void zend_do_declare_begin(CLS_D)
|
||||
{
|
||||
zend_stack_push(&CG(declare_stack), &CG(declarables), sizeof(zend_declarables));
|
||||
}
|
||||
|
||||
|
||||
void do_declare_stmt(znode *var, znode *val CLS_DC)
|
||||
void zend_do_declare_stmt(znode *var, znode *val CLS_DC)
|
||||
{
|
||||
convert_to_string(&var->u.constant);
|
||||
|
||||
@@ -2140,7 +2143,7 @@ void do_declare_stmt(znode *var, znode *val CLS_DC)
|
||||
}
|
||||
|
||||
|
||||
void do_declare_end(CLS_D)
|
||||
void zend_do_declare_end(CLS_D)
|
||||
{
|
||||
zend_declarables *declarables;
|
||||
|
||||
@@ -2149,7 +2152,7 @@ void do_declare_end(CLS_D)
|
||||
}
|
||||
|
||||
|
||||
void do_end_heredoc(CLS_D)
|
||||
void zend_do_end_heredoc(CLS_D)
|
||||
{
|
||||
int opline_num = get_next_op_number(CG(active_op_array))-1;
|
||||
zend_op *opline = &CG(active_op_array)->opcodes[opline_num];
|
||||
@@ -2167,7 +2170,7 @@ void do_end_heredoc(CLS_D)
|
||||
}
|
||||
|
||||
|
||||
void do_exit(znode *result, znode *message CLS_DC)
|
||||
void zend_do_exit(znode *result, znode *message CLS_DC)
|
||||
{
|
||||
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
|
||||
@@ -2181,7 +2184,7 @@ void do_exit(znode *result, znode *message CLS_DC)
|
||||
}
|
||||
|
||||
|
||||
void do_begin_silence(znode *strudel_token CLS_DC)
|
||||
void zend_do_begin_silence(znode *strudel_token CLS_DC)
|
||||
{
|
||||
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
|
||||
@@ -2194,7 +2197,7 @@ void do_begin_silence(znode *strudel_token CLS_DC)
|
||||
}
|
||||
|
||||
|
||||
void do_end_silence(znode *strudel_token CLS_DC)
|
||||
void zend_do_end_silence(znode *strudel_token CLS_DC)
|
||||
{
|
||||
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
|
||||
@@ -2204,7 +2207,7 @@ void do_end_silence(znode *strudel_token CLS_DC)
|
||||
}
|
||||
|
||||
|
||||
void do_begin_qm_op(znode *cond, znode *qm_token CLS_DC)
|
||||
void zend_do_begin_qm_op(znode *cond, znode *qm_token CLS_DC)
|
||||
{
|
||||
int jmpz_op_number = get_next_op_number(CG(active_op_array));
|
||||
zend_op *opline;
|
||||
@@ -2221,7 +2224,7 @@ void do_begin_qm_op(znode *cond, znode *qm_token CLS_DC)
|
||||
}
|
||||
|
||||
|
||||
void do_qm_true(znode *true_value, znode *qm_token, znode *colon_token CLS_DC)
|
||||
void zend_do_qm_true(znode *true_value, znode *qm_token, znode *colon_token CLS_DC)
|
||||
{
|
||||
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
|
||||
@@ -2243,7 +2246,7 @@ void do_qm_true(znode *true_value, znode *qm_token, znode *colon_token CLS_DC)
|
||||
}
|
||||
|
||||
|
||||
void do_qm_false(znode *result, znode *false_value, znode *qm_token, znode *colon_token CLS_DC)
|
||||
void zend_do_qm_false(znode *result, znode *false_value, znode *qm_token, znode *colon_token CLS_DC)
|
||||
{
|
||||
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
|
||||
@@ -2260,7 +2263,7 @@ void do_qm_false(znode *result, znode *false_value, znode *qm_token, znode *colo
|
||||
}
|
||||
|
||||
|
||||
void do_extended_info(CLS_D)
|
||||
void zend_do_extended_info(CLS_D)
|
||||
{
|
||||
zend_op *opline;
|
||||
|
||||
@@ -2276,7 +2279,7 @@ void do_extended_info(CLS_D)
|
||||
}
|
||||
|
||||
|
||||
void do_extended_fcall_begin(CLS_D)
|
||||
void zend_do_extended_fcall_begin(CLS_D)
|
||||
{
|
||||
zend_op *opline;
|
||||
|
||||
@@ -2292,7 +2295,7 @@ void do_extended_fcall_begin(CLS_D)
|
||||
}
|
||||
|
||||
|
||||
void do_extended_fcall_end(CLS_D)
|
||||
void zend_do_extended_fcall_end(CLS_D)
|
||||
{
|
||||
zend_op *opline;
|
||||
|
||||
@@ -2307,7 +2310,7 @@ void do_extended_fcall_end(CLS_D)
|
||||
SET_UNUSED(opline->op2);
|
||||
}
|
||||
|
||||
void do_ticks(CLS_D)
|
||||
void zend_do_ticks(CLS_D)
|
||||
{
|
||||
if (CG(declarables).ticks.value.lval) {
|
||||
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
|
||||
+95
-90
@@ -44,6 +44,7 @@
|
||||
#define FREE_PNODE(znode) zval_dtor(&znode->u.constant);
|
||||
#define FREE_OP(op, should_free) if (should_free) zval_dtor(&Ts[(op)->u.var].tmp_var);
|
||||
|
||||
#define SET_UNUSED(op) (op).op_type = IS_UNUSED
|
||||
|
||||
#if SUPPORT_INTERACTIVE
|
||||
#define INC_BPC(op_array) ((op_array)->backpatch_count++)
|
||||
@@ -236,145 +237,145 @@ int zend_get_zendleng(CLS_D);
|
||||
|
||||
|
||||
/* parser-driven code generators */
|
||||
void do_binary_op(int op, znode *result, znode *op1, znode *op2 CLS_DC);
|
||||
void do_unary_op(int op, znode *result, znode *op1 CLS_DC);
|
||||
void do_binary_assign_op(int op, znode *result, znode *op1, znode *op2 CLS_DC);
|
||||
void do_assign(znode *result, znode *variable, znode *value CLS_DC);
|
||||
void do_assign_ref(znode *result, znode *lvar, znode *rvar CLS_DC);
|
||||
void zend_do_binary_op(int op, znode *result, znode *op1, znode *op2 CLS_DC);
|
||||
void zend_do_unary_op(int op, znode *result, znode *op1 CLS_DC);
|
||||
void zend_do_binary_assign_op(int op, znode *result, znode *op1, znode *op2 CLS_DC);
|
||||
void zend_do_assign(znode *result, znode *variable, znode *value CLS_DC);
|
||||
void zend_do_assign_ref(znode *result, znode *lvar, znode *rvar CLS_DC);
|
||||
void fetch_simple_variable(znode *result, znode *varname, int bp CLS_DC);
|
||||
void fetch_simple_variable_ex(znode *result, znode *varname, int bp, int op CLS_DC);
|
||||
void do_indirect_references(znode *result, znode *num_references, znode *variable CLS_DC);
|
||||
void do_fetch_global_or_static_variable(znode *varname, znode *static_assignment, int fetch_type CLS_DC);
|
||||
void do_fetch_globals(znode *varname CLS_DC);
|
||||
void zend_do_indirect_references(znode *result, znode *num_references, znode *variable CLS_DC);
|
||||
void zend_do_fetch_global_or_static_variable(znode *varname, znode *static_assignment, int fetch_type CLS_DC);
|
||||
void zend_do_fetch_globals(znode *varname CLS_DC);
|
||||
|
||||
void fetch_array_begin(znode *result, znode *varname, znode *first_dim CLS_DC);
|
||||
void fetch_array_dim(znode *result, znode *parent, znode *dim CLS_DC);
|
||||
void fetch_string_offset(znode *result, znode *parent, znode *offset CLS_DC);
|
||||
void do_print(znode *result, znode *arg CLS_DC);
|
||||
void do_echo(znode *arg CLS_DC);
|
||||
void zend_do_print(znode *result, znode *arg CLS_DC);
|
||||
void zend_do_echo(znode *arg CLS_DC);
|
||||
typedef int (*unary_op_type)(zval *, zval *);
|
||||
ZEND_API unary_op_type get_unary_op(int opcode);
|
||||
ZEND_API void *get_binary_op(int opcode);
|
||||
|
||||
void do_while_cond(znode *expr, znode *close_bracket_token CLS_DC);
|
||||
void do_while_end(znode *while_token, znode *close_bracket_token CLS_DC);
|
||||
void do_do_while_begin(CLS_D);
|
||||
void do_do_while_end(znode *do_token, znode *expr_open_bracket, znode *expr CLS_DC);
|
||||
void zend_do_while_cond(znode *expr, znode *close_bracket_token CLS_DC);
|
||||
void zend_do_while_end(znode *while_token, znode *close_bracket_token CLS_DC);
|
||||
void zend_do_do_while_begin(CLS_D);
|
||||
void zend_do_do_while_end(znode *do_token, znode *expr_open_bracket, znode *expr CLS_DC);
|
||||
|
||||
|
||||
void do_if_cond(znode *cond, znode *closing_bracket_token CLS_DC);
|
||||
void do_if_after_statement(znode *closing_bracket_token, unsigned char initialize CLS_DC);
|
||||
void do_if_end(CLS_D);
|
||||
void zend_do_if_cond(znode *cond, znode *closing_bracket_token CLS_DC);
|
||||
void zend_do_if_after_statement(znode *closing_bracket_token, unsigned char initialize CLS_DC);
|
||||
void zend_do_if_end(CLS_D);
|
||||
|
||||
void do_for_cond(znode *expr, znode *second_semicolon_token CLS_DC);
|
||||
void do_for_before_statement(znode *cond_start, znode *second_semicolon_token CLS_DC);
|
||||
void do_for_end(znode *second_semicolon_token CLS_DC);
|
||||
void zend_do_for_cond(znode *expr, znode *second_semicolon_token CLS_DC);
|
||||
void zend_do_for_before_statement(znode *cond_start, znode *second_semicolon_token CLS_DC);
|
||||
void zend_do_for_end(znode *second_semicolon_token CLS_DC);
|
||||
|
||||
void do_pre_incdec(znode *result, znode *op1, int op CLS_DC);
|
||||
void do_post_incdec(znode *result, znode *op1, int op CLS_DC);
|
||||
void zend_do_pre_incdec(znode *result, znode *op1, int op CLS_DC);
|
||||
void zend_do_post_incdec(znode *result, znode *op1, int op CLS_DC);
|
||||
|
||||
void do_begin_variable_parse(CLS_D);
|
||||
void do_end_variable_parse(int type, int arg_offset CLS_DC);
|
||||
void zend_do_begin_variable_parse(CLS_D);
|
||||
void zend_do_end_variable_parse(int type, int arg_offset CLS_DC);
|
||||
|
||||
void do_free(znode *op1 CLS_DC);
|
||||
void zend_do_free(znode *op1 CLS_DC);
|
||||
|
||||
void do_init_string(znode *result CLS_DC);
|
||||
void do_add_char(znode *result, znode *op1, znode *op2 CLS_DC);
|
||||
void do_add_string(znode *result, znode *op1, znode *op2 CLS_DC);
|
||||
void do_add_variable(znode *result, znode *op1, znode *op2 CLS_DC);
|
||||
void zend_do_init_string(znode *result CLS_DC);
|
||||
void zend_do_add_char(znode *result, znode *op1, znode *op2 CLS_DC);
|
||||
void zend_do_add_string(znode *result, znode *op1, znode *op2 CLS_DC);
|
||||
void zend_do_add_variable(znode *result, znode *op1, znode *op2 CLS_DC);
|
||||
|
||||
void do_begin_function_declaration(znode *function_token, znode *function_name, int is_method, int return_reference CLS_DC);
|
||||
void do_end_function_declaration(znode *function_token CLS_DC);
|
||||
void do_receive_arg(int op, znode *var, znode *offset, znode *initialization, unsigned char pass_type CLS_DC);
|
||||
int do_begin_function_call(znode *function_name CLS_DC);
|
||||
void do_begin_dynamic_function_call(znode *function_name CLS_DC);
|
||||
void do_begin_class_member_function_call(znode *class_name, znode *function_name CLS_DC);
|
||||
void do_end_function_call(znode *function_name, znode *result, znode *argument_list, int is_method, int is_dynamic_fcall CLS_DC);
|
||||
void do_return(znode *expr, int do_end_vparse CLS_DC);
|
||||
void zend_do_begin_function_declaration(znode *function_token, znode *function_name, int is_method, int return_reference CLS_DC);
|
||||
void zend_do_end_function_declaration(znode *function_token CLS_DC);
|
||||
void zend_do_receive_arg(int op, znode *var, znode *offset, znode *initialization, unsigned char pass_type CLS_DC);
|
||||
int zend_do_begin_function_call(znode *function_name CLS_DC);
|
||||
void zend_do_begin_dynamic_function_call(znode *function_name CLS_DC);
|
||||
void zend_do_begin_class_member_function_call(znode *class_name, znode *function_name CLS_DC);
|
||||
void zend_do_end_function_call(znode *function_name, znode *result, znode *argument_list, int is_method, int is_dynamic_fcall CLS_DC);
|
||||
void zend_do_return(znode *expr, int do_end_vparse CLS_DC);
|
||||
ZEND_API int do_bind_function_or_class(zend_op *opline, HashTable *function_table, HashTable *class_table, int compile_time);
|
||||
void do_inheritance(zend_class_entry *ce, zend_class_entry *parent_ce);
|
||||
void do_early_binding(CLS_D);
|
||||
void zend_do_inheritance(zend_class_entry *ce, zend_class_entry *parent_ce);
|
||||
void zend_do_early_binding(CLS_D);
|
||||
|
||||
void do_pass_param(znode *param, int op, int offset CLS_DC);
|
||||
void zend_do_pass_param(znode *param, int op, int offset CLS_DC);
|
||||
|
||||
|
||||
void do_boolean_or_begin(znode *expr1, znode *op_token CLS_DC);
|
||||
void do_boolean_or_end(znode *result, znode *expr1, znode *expr2, znode *op_token CLS_DC);
|
||||
void do_boolean_and_begin(znode *expr1, znode *op_token CLS_DC);
|
||||
void do_boolean_and_end(znode *result, znode *expr1, znode *expr2, znode *op_token CLS_DC);
|
||||
void zend_do_boolean_or_begin(znode *expr1, znode *op_token CLS_DC);
|
||||
void zend_do_boolean_or_end(znode *result, znode *expr1, znode *expr2, znode *op_token CLS_DC);
|
||||
void zend_do_boolean_and_begin(znode *expr1, znode *op_token CLS_DC);
|
||||
void zend_do_boolean_and_end(znode *result, znode *expr1, znode *expr2, znode *op_token CLS_DC);
|
||||
|
||||
void do_brk_cont(int op, znode *expr CLS_DC);
|
||||
void zend_do_brk_cont(int op, znode *expr CLS_DC);
|
||||
|
||||
void do_switch_cond(znode *cond CLS_DC);
|
||||
void do_switch_end(znode *case_list CLS_DC);
|
||||
void do_case_before_statement(znode *case_list, znode *case_token, znode *case_expr CLS_DC);
|
||||
void do_case_after_statement(znode *result, znode *case_token CLS_DC);
|
||||
void do_default_before_statement(znode *case_list, znode *default_token CLS_DC);
|
||||
void zend_do_switch_cond(znode *cond CLS_DC);
|
||||
void zend_do_switch_end(znode *case_list CLS_DC);
|
||||
void zend_do_case_before_statement(znode *case_list, znode *case_token, znode *case_expr CLS_DC);
|
||||
void zend_do_case_after_statement(znode *result, znode *case_token CLS_DC);
|
||||
void zend_do_default_before_statement(znode *case_list, znode *default_token CLS_DC);
|
||||
|
||||
void do_begin_class_declaration(znode *class_name, znode *parent_class_name CLS_DC);
|
||||
void do_end_class_declaration(CLS_D);
|
||||
void do_declare_property(znode *var_name, znode *value CLS_DC);
|
||||
void zend_do_begin_class_declaration(znode *class_name, znode *parent_class_name CLS_DC);
|
||||
void zend_do_end_class_declaration(CLS_D);
|
||||
void zend_do_declare_property(znode *var_name, znode *value CLS_DC);
|
||||
|
||||
void do_fetch_property(znode *result, znode *object, znode *property CLS_DC);
|
||||
void zend_do_fetch_property(znode *result, znode *object, znode *property CLS_DC);
|
||||
|
||||
|
||||
void do_push_object(znode *object CLS_DC);
|
||||
void do_pop_object(znode *object CLS_DC);
|
||||
void zend_do_push_object(znode *object CLS_DC);
|
||||
void zend_do_pop_object(znode *object CLS_DC);
|
||||
|
||||
|
||||
void do_begin_new_object(znode *new_token, znode *class_name CLS_DC);
|
||||
void do_end_new_object(znode *result, znode *class_name, znode *new_token, znode *argument_list CLS_DC);
|
||||
void zend_do_begin_new_object(znode *new_token, znode *class_name CLS_DC);
|
||||
void zend_do_end_new_object(znode *result, znode *class_name, znode *new_token, znode *argument_list CLS_DC);
|
||||
|
||||
void do_fetch_constant(znode *result, znode *constant_name, int mode CLS_DC);
|
||||
void zend_do_fetch_constant(znode *result, znode *constant_name, int mode CLS_DC);
|
||||
|
||||
void do_shell_exec(znode *result, znode *cmd CLS_DC);
|
||||
void zend_do_shell_exec(znode *result, znode *cmd CLS_DC);
|
||||
|
||||
void do_init_array(znode *result, znode *expr, znode *offset, int is_ref CLS_DC);
|
||||
void do_add_array_element(znode *result, znode *expr, znode *offset, int is_ref CLS_DC);
|
||||
void do_add_static_array_element(znode *result, znode *offset, znode *expr);
|
||||
void do_list_init(CLS_D);
|
||||
void do_list_end(znode *result, znode *expr CLS_DC);
|
||||
void do_add_list_element(znode *element CLS_DC);
|
||||
void do_new_list_begin(CLS_D);
|
||||
void do_new_list_end(CLS_D);
|
||||
void zend_do_init_array(znode *result, znode *expr, znode *offset, int is_ref CLS_DC);
|
||||
void zend_do_add_array_element(znode *result, znode *expr, znode *offset, int is_ref CLS_DC);
|
||||
void zend_do_add_static_array_element(znode *result, znode *offset, znode *expr);
|
||||
void zend_do_list_init(CLS_D);
|
||||
void zend_do_list_end(znode *result, znode *expr CLS_DC);
|
||||
void zend_do_add_list_element(znode *element CLS_DC);
|
||||
void zend_do_new_list_begin(CLS_D);
|
||||
void zend_do_new_list_end(CLS_D);
|
||||
|
||||
void do_cast(znode *result, znode *expr, int type CLS_DC);
|
||||
void do_include_or_eval(int type, znode *result, znode *op1 CLS_DC);
|
||||
void zend_do_cast(znode *result, znode *expr, int type CLS_DC);
|
||||
void zend_do_include_or_eval(int type, znode *result, znode *op1 CLS_DC);
|
||||
|
||||
void do_unset(znode *variable CLS_DC);
|
||||
void do_isset_or_isempty(int type, znode *result, znode *variable CLS_DC);
|
||||
void zend_do_unset(znode *variable CLS_DC);
|
||||
void zend_do_isset_or_isempty(int type, znode *result, znode *variable CLS_DC);
|
||||
|
||||
void do_foreach_begin(znode *foreach_token, znode *array, znode *open_brackets_token, znode *as_token, int variable CLS_DC);
|
||||
void do_foreach_cont(znode *value, znode *key, znode *as_token CLS_DC);
|
||||
void do_foreach_end(znode *foreach_token, znode *open_brackets_token CLS_DC);
|
||||
void zend_do_foreach_begin(znode *foreach_token, znode *array, znode *open_brackets_token, znode *as_token, int variable CLS_DC);
|
||||
void zend_do_foreach_cont(znode *value, znode *key, znode *as_token CLS_DC);
|
||||
void zend_do_foreach_end(znode *foreach_token, znode *open_brackets_token CLS_DC);
|
||||
|
||||
void do_declare_begin(CLS_D);
|
||||
void do_declare_stmt(znode *var, znode *val CLS_DC);
|
||||
void do_declare_end(CLS_D);
|
||||
void zend_do_declare_begin(CLS_D);
|
||||
void zend_do_declare_stmt(znode *var, znode *val CLS_DC);
|
||||
void zend_do_declare_end(CLS_D);
|
||||
|
||||
void do_end_heredoc(CLS_D);
|
||||
void zend_do_end_heredoc(CLS_D);
|
||||
|
||||
void do_exit(znode *result, znode *message CLS_DC);
|
||||
void zend_do_exit(znode *result, znode *message CLS_DC);
|
||||
|
||||
void do_begin_silence(znode *strudel_token CLS_DC);
|
||||
void do_end_silence(znode *strudel_token CLS_DC);
|
||||
void zend_do_begin_silence(znode *strudel_token CLS_DC);
|
||||
void zend_do_end_silence(znode *strudel_token CLS_DC);
|
||||
|
||||
void do_begin_qm_op(znode *cond, znode *qm_token CLS_DC);
|
||||
void do_qm_true(znode *true_value, znode *qm_token, znode *colon_token CLS_DC);
|
||||
void do_qm_false(znode *result, znode *false_value, znode *qm_token, znode *colon_token CLS_DC);
|
||||
void zend_do_begin_qm_op(znode *cond, znode *qm_token CLS_DC);
|
||||
void zend_do_qm_true(znode *true_value, znode *qm_token, znode *colon_token CLS_DC);
|
||||
void zend_do_qm_false(znode *result, znode *false_value, znode *qm_token, znode *colon_token CLS_DC);
|
||||
|
||||
void do_extended_info(CLS_D);
|
||||
void do_extended_fcall_begin(CLS_D);
|
||||
void do_extended_fcall_end(CLS_D);
|
||||
void zend_do_extended_info(CLS_D);
|
||||
void zend_do_extended_fcall_begin(CLS_D);
|
||||
void zend_do_extended_fcall_end(CLS_D);
|
||||
|
||||
void do_ticks(CLS_D);
|
||||
void zend_do_ticks(CLS_D);
|
||||
|
||||
ZEND_API void function_add_ref(zend_function *function);
|
||||
|
||||
#define INITIAL_OP_ARRAY_SIZE 64
|
||||
|
||||
|
||||
/* helper functions in zend-scanner.l */
|
||||
/* helper functions in zend_language_scanner.l */
|
||||
ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type CLS_DC);
|
||||
ZEND_API zend_op_array *compile_string(zval *source_string, char *filename CLS_DC);
|
||||
ZEND_API zend_op_array *compile_filename(int type, zval *filename CLS_DC ELS_DC);
|
||||
@@ -537,6 +538,8 @@ int zendlex(znode *zendlval CLS_DC);
|
||||
|
||||
#define ZEND_TICKS 105
|
||||
|
||||
#define ZEND_SEND_VAR_NO_REF 106
|
||||
|
||||
/* end of block */
|
||||
|
||||
|
||||
@@ -594,6 +597,8 @@ int zendlex(znode *zendlval CLS_DC);
|
||||
#define ZEND_MEMBER_FUNC_CALL 1<<0
|
||||
#define ZEND_CTOR_CALL 1<<1
|
||||
|
||||
#define ZEND_ARG_SEND_BY_REF (1<<0)
|
||||
#define ZEND_ARG_COMPILE_TIME_BOUND (1<<1)
|
||||
|
||||
#define AI_USE_PTR(ai) \
|
||||
if ((ai).ptr_ptr) { \
|
||||
|
||||
+57
-21
@@ -1643,40 +1643,68 @@ do_fcall_common:
|
||||
}
|
||||
{
|
||||
zval *valptr;
|
||||
zval *value;
|
||||
|
||||
value = get_zval_ptr(&opline->op1, Ts, &EG(free_op1), BP_VAR_R);
|
||||
|
||||
ALLOC_ZVAL(valptr);
|
||||
*valptr = Ts[opline->op1.u.var].tmp_var;
|
||||
*valptr = *value;
|
||||
if (!EG(free_op1)) {
|
||||
zval_copy_ctor(valptr);
|
||||
}
|
||||
INIT_PZVAL(valptr);
|
||||
zend_ptr_stack_push(&EG(argument_stack), valptr);
|
||||
}
|
||||
NEXT_OPCODE();
|
||||
case ZEND_SEND_VAR:
|
||||
if (opline->extended_value==ZEND_DO_FCALL_BY_NAME
|
||||
&& ARG_SHOULD_BE_SENT_BY_REF(opline->op2.u.opline_num, fbc, fbc->common.arg_types)) {
|
||||
goto send_by_ref;
|
||||
case ZEND_SEND_VAR_NO_REF:
|
||||
if (opline->extended_value & ZEND_ARG_COMPILE_TIME_BOUND) { /* Had function_ptr at compile_time */
|
||||
if (!(opline->extended_value & ZEND_ARG_SEND_BY_REF)) {
|
||||
goto send_by_var;
|
||||
}
|
||||
} else if (!ARG_SHOULD_BE_SENT_BY_REF(opline->op2.u.opline_num, fbc, fbc->common.arg_types)) {
|
||||
goto send_by_var;
|
||||
}
|
||||
{
|
||||
zval *varptr;
|
||||
varptr = get_zval_ptr(&opline->op1, Ts, &EG(free_op1), BP_VAR_R);
|
||||
|
||||
if (varptr == &EG(uninitialized_zval)) {
|
||||
ALLOC_ZVAL(varptr);
|
||||
INIT_ZVAL(*varptr);
|
||||
varptr->refcount = 0;
|
||||
} else if (PZVAL_IS_REF(varptr)) {
|
||||
zval *original_var = varptr;
|
||||
|
||||
ALLOC_ZVAL(varptr);
|
||||
*varptr = *original_var;
|
||||
varptr->is_ref = 0;
|
||||
varptr->refcount = 0;
|
||||
zval_copy_ctor(varptr);
|
||||
if (varptr != &EG(uninitialized_zval) && (PZVAL_IS_REF(varptr) || varptr->refcount == 1)) {
|
||||
varptr->is_ref = 1;
|
||||
varptr->refcount++;
|
||||
zend_ptr_stack_push(&EG(argument_stack), varptr);
|
||||
NEXT_OPCODE();
|
||||
}
|
||||
varptr->refcount++;
|
||||
zend_ptr_stack_push(&EG(argument_stack), varptr);
|
||||
FREE_OP(&opline->op1, EG(free_op1)); /* for string offsets */
|
||||
zend_error(E_ERROR, "Only variables can be passed by reference");
|
||||
}
|
||||
NEXT_OPCODE();
|
||||
case ZEND_SEND_VAR:
|
||||
if ((opline->extended_value == ZEND_DO_FCALL_BY_NAME)
|
||||
&& ARG_SHOULD_BE_SENT_BY_REF(opline->op2.u.opline_num, fbc, fbc->common.arg_types)) {
|
||||
goto send_by_ref;
|
||||
}
|
||||
send_by_var:
|
||||
{
|
||||
zval *varptr;
|
||||
varptr = get_zval_ptr(&opline->op1, Ts, &EG(free_op1), BP_VAR_R);
|
||||
|
||||
if (varptr == &EG(uninitialized_zval)) {
|
||||
ALLOC_ZVAL(varptr);
|
||||
INIT_ZVAL(*varptr);
|
||||
varptr->refcount = 0;
|
||||
} else if (PZVAL_IS_REF(varptr)) {
|
||||
zval *original_var = varptr;
|
||||
|
||||
ALLOC_ZVAL(varptr);
|
||||
*varptr = *original_var;
|
||||
varptr->is_ref = 0;
|
||||
varptr->refcount = 0;
|
||||
zval_copy_ctor(varptr);
|
||||
}
|
||||
varptr->refcount++;
|
||||
zend_ptr_stack_push(&EG(argument_stack), varptr);
|
||||
FREE_OP(&opline->op1, EG(free_op1)); /* for string offsets */
|
||||
}
|
||||
NEXT_OPCODE();
|
||||
send_by_ref:
|
||||
case ZEND_SEND_REF: {
|
||||
zval **varptr_ptr;
|
||||
@@ -2270,7 +2298,13 @@ send_by_ref:
|
||||
NEXT_OPCODE();
|
||||
case ZEND_EXIT:
|
||||
if (opline->op1.op_type != IS_UNUSED) {
|
||||
zend_print_variable(get_zval_ptr(&opline->op1, Ts, &EG(free_op1), BP_VAR_R));
|
||||
zval *ptr;
|
||||
|
||||
ptr = get_zval_ptr(&opline->op1, Ts, &EG(free_op1), BP_VAR_R);
|
||||
if (Z_TYPE_P(ptr) == IS_LONG) {
|
||||
EG(exit_status) = Z_LVAL_P(ptr);
|
||||
}
|
||||
zend_print_variable(ptr);
|
||||
FREE_OP(&opline->op1, EG(free_op1));
|
||||
}
|
||||
zend_bailout();
|
||||
@@ -2326,7 +2360,9 @@ send_by_ref:
|
||||
}
|
||||
}
|
||||
#if SUPPORT_INTERACTIVE
|
||||
ALLOC_INIT_ZVAL(*(EG(return_value_ptr_ptr)));
|
||||
op_array->last_executed_op_number = opline-op_array->opcodes;
|
||||
EG(in_execution) = original_in_execution;
|
||||
free_alloca(Ts);
|
||||
#else
|
||||
zend_error(E_ERROR,"Arrived at end of main loop which shouldn't happen");
|
||||
|
||||
+7
-6
@@ -139,8 +139,8 @@ ZEND_API char *zend_get_executed_filename(ELS_D);
|
||||
ZEND_API uint zend_get_executed_lineno(ELS_D);
|
||||
ZEND_API zend_bool zend_is_executing(void);
|
||||
|
||||
void zend_set_timeout(long seconds);
|
||||
void zend_unset_timeout(void);
|
||||
ZEND_API void zend_set_timeout(long seconds);
|
||||
ZEND_API void zend_unset_timeout(void);
|
||||
ZEND_API void zend_timeout(int dummy);
|
||||
|
||||
#ifdef ZEND_WIN32
|
||||
@@ -157,16 +157,17 @@ void zend_shutdown_timeout_thread();
|
||||
|
||||
static inline void zend_assign_to_variable_reference(znode *result, zval **variable_ptr_ptr, zval **value_ptr_ptr, temp_variable *Ts ELS_DC)
|
||||
{
|
||||
zval *variable_ptr = *variable_ptr_ptr;
|
||||
zval *variable_ptr;
|
||||
zval *value_ptr;
|
||||
|
||||
|
||||
if (!value_ptr_ptr) {
|
||||
zend_error(E_ERROR, "Cannot create references to string offsets nor overloaded objects");
|
||||
if (!value_ptr_ptr || !variable_ptr_ptr) {
|
||||
zend_error(E_ERROR, "Cannot create references to/from string offsets nor overloaded objects");
|
||||
return;
|
||||
}
|
||||
|
||||
variable_ptr = *variable_ptr_ptr;
|
||||
value_ptr = *value_ptr_ptr;
|
||||
|
||||
if (variable_ptr == EG(error_zval_ptr) || value_ptr==EG(error_zval_ptr)) {
|
||||
variable_ptr_ptr = &EG(uninitialized_zval_ptr);
|
||||
/* } else if (variable_ptr==&EG(uninitialized_zval) || variable_ptr!=value_ptr) { */
|
||||
|
||||
+17
-14
@@ -312,7 +312,7 @@ ZEND_API int zval_update_constant(zval **pp, void *arg)
|
||||
}
|
||||
|
||||
|
||||
int call_user_function(HashTable *function_table, zval *object, zval *function_name, zval *retval_ptr, int param_count, zval *params[])
|
||||
int call_user_function(HashTable *function_table, zval **object_pp, zval *function_name, zval *retval_ptr, int param_count, zval *params[])
|
||||
{
|
||||
zval ***params_array = (zval ***) emalloc(sizeof(zval **)*param_count);
|
||||
int i;
|
||||
@@ -322,7 +322,7 @@ int call_user_function(HashTable *function_table, zval *object, zval *function_n
|
||||
for (i=0; i<param_count; i++) {
|
||||
params_array[i] = ¶ms[i];
|
||||
}
|
||||
ex_retval = call_user_function_ex(function_table, object, function_name, &local_retval_ptr, param_count, params_array, 1, NULL);
|
||||
ex_retval = call_user_function_ex(function_table, object_pp, function_name, &local_retval_ptr, param_count, params_array, 1, NULL);
|
||||
if (local_retval_ptr) {
|
||||
COPY_PZVAL_TO_ZVAL(*retval_ptr, local_retval_ptr);
|
||||
} else {
|
||||
@@ -333,7 +333,7 @@ int call_user_function(HashTable *function_table, zval *object, zval *function_n
|
||||
}
|
||||
|
||||
|
||||
int call_user_function_ex(HashTable *function_table, zval *object, zval *function_name, zval **retval_ptr_ptr, int param_count, zval **params[], int no_separation, HashTable *symbol_table)
|
||||
int call_user_function_ex(HashTable *function_table, zval **object_pp, zval *function_name, zval **retval_ptr_ptr, int param_count, zval **params[], int no_separation, HashTable *symbol_table)
|
||||
{
|
||||
int i;
|
||||
zval **original_return_value;
|
||||
@@ -357,15 +357,18 @@ int call_user_function_ex(HashTable *function_table, zval *object, zval *functio
|
||||
}
|
||||
function_name = *tmp_real_function_name;
|
||||
SEPARATE_ZVAL_IF_NOT_REF(tmp_object_ptr);
|
||||
object = *tmp_object_ptr;
|
||||
object->is_ref = 1;
|
||||
object_pp = tmp_object_ptr;
|
||||
(*object_pp)->is_ref = 1;
|
||||
}
|
||||
|
||||
if (object) {
|
||||
if (object->type != IS_OBJECT) {
|
||||
if (object_pp && !*object_pp) {
|
||||
object_pp = NULL;
|
||||
}
|
||||
if (object_pp) {
|
||||
if (Z_TYPE_PP(object_pp) != IS_OBJECT) {
|
||||
return FAILURE;
|
||||
}
|
||||
function_table = &object->value.obj.ce->function_table;
|
||||
function_table = &(*object_pp)->value.obj.ce->function_table;
|
||||
}
|
||||
|
||||
if (function_name->type!=IS_STRING) {
|
||||
@@ -422,14 +425,13 @@ int call_user_function_ex(HashTable *function_table, zval *object, zval *functio
|
||||
ALLOC_HASHTABLE(EG(active_symbol_table));
|
||||
zend_hash_init(EG(active_symbol_table), 0, NULL, ZVAL_PTR_DTOR, 0);
|
||||
}
|
||||
if (object) {
|
||||
if (object_pp) {
|
||||
zval *dummy, **this_ptr;
|
||||
|
||||
|
||||
ALLOC_ZVAL(dummy);
|
||||
INIT_ZVAL(*dummy);
|
||||
|
||||
INIT_ZVAL(*dummy);
|
||||
zend_hash_update(EG(active_symbol_table), "this", sizeof("this"), &dummy, sizeof(zval *), (void **) &this_ptr);
|
||||
zend_assign_to_variable_reference(NULL, this_ptr, &object, NULL ELS_CC);
|
||||
zend_assign_to_variable_reference(NULL, this_ptr, object_pp, NULL ELS_CC);
|
||||
}
|
||||
original_return_value = EG(return_value_ptr_ptr);
|
||||
original_op_array = EG(active_op_array);
|
||||
@@ -447,7 +449,7 @@ int call_user_function_ex(HashTable *function_table, zval *object, zval *functio
|
||||
EG(opline_ptr) = original_opline_ptr;
|
||||
} else {
|
||||
ALLOC_INIT_ZVAL(*retval_ptr_ptr);
|
||||
((zend_internal_function *) function_state.function)->handler(param_count, *retval_ptr_ptr, object, 1 ELS_CC);
|
||||
((zend_internal_function *) function_state.function)->handler(param_count, *retval_ptr_ptr, (object_pp?*object_pp:NULL), 1 ELS_CC);
|
||||
INIT_PZVAL(*retval_ptr_ptr);
|
||||
}
|
||||
zend_ptr_stack_clear_multiple(ELS_C);
|
||||
@@ -540,6 +542,7 @@ void execute_new_code(CLS_D)
|
||||
CG(active_op_array)->end_op_number = CG(active_op_array)->last;
|
||||
EG(active_op_array) = CG(active_op_array);
|
||||
zend_execute(CG(active_op_array) ELS_CC);
|
||||
zval_ptr_dtor(EG(return_value_ptr_ptr));
|
||||
CG(active_op_array)->start_op_number = CG(active_op_array)->last_executed_op_number;
|
||||
}
|
||||
#endif
|
||||
|
||||
+33
-30
@@ -23,23 +23,6 @@
|
||||
ZEND_API zend_llist zend_extensions;
|
||||
static int last_resource_number;
|
||||
|
||||
int zend_load_extensions(char **extension_paths)
|
||||
{
|
||||
char **p = extension_paths;
|
||||
|
||||
if (!p) {
|
||||
return SUCCESS;
|
||||
}
|
||||
while (*p) {
|
||||
if (zend_load_extension(*p)==FAILURE) {
|
||||
return FAILURE;
|
||||
}
|
||||
p++;
|
||||
}
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
int zend_load_extension(char *path)
|
||||
{
|
||||
#if ZEND_EXTENSIONS_SUPPORT
|
||||
@@ -64,17 +47,19 @@ int zend_load_extension(char *path)
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
if (extension_version_info->zend_extension_api_no > ZEND_EXTENSION_API_NO) {
|
||||
fprintf(stderr, "%s requires Zend Engine API version %d\n"
|
||||
|
||||
/* allow extension to proclaim compatibility with any Zend version */
|
||||
if(extension_version_info->zend_extension_api_no != ZEND_EXTENSION_API_NO &&(!new_extension->api_no_check || new_extension->api_no_check(ZEND_EXTENSION_API_NO) != SUCCESS)) {
|
||||
if (extension_version_info->zend_extension_api_no > ZEND_EXTENSION_API_NO) {
|
||||
fprintf(stderr, "%s requires Zend Engine API version %d\n"
|
||||
"The installed Zend Engine API version is %d\n\n",
|
||||
new_extension->name,
|
||||
extension_version_info->zend_extension_api_no,
|
||||
ZEND_EXTENSION_API_NO);
|
||||
DL_UNLOAD(handle);
|
||||
return FAILURE;
|
||||
} else if (extension_version_info->zend_extension_api_no < ZEND_EXTENSION_API_NO) {
|
||||
/* we may be able to allow for downwards compatability in some harmless cases. */
|
||||
fprintf(stderr, "%s designed to be used with the Zend Engine API %d is outdated\n"
|
||||
DL_UNLOAD(handle);
|
||||
return FAILURE;
|
||||
} else if (extension_version_info->zend_extension_api_no < ZEND_EXTENSION_API_NO) {
|
||||
fprintf(stderr, "%s designed to be used with the Zend Engine API %d is outdated\n"
|
||||
"It requires a more recent version of the Zend Engine\n"
|
||||
"The installed Zend Engine API version is %d\n"
|
||||
"Contact %s at %s for a later version of this module.\n\n",
|
||||
@@ -83,8 +68,9 @@ int zend_load_extension(char *path)
|
||||
ZEND_EXTENSION_API_NO,
|
||||
new_extension->author,
|
||||
new_extension->URL);
|
||||
DL_UNLOAD(handle);
|
||||
return FAILURE;
|
||||
DL_UNLOAD(handle);
|
||||
return FAILURE;
|
||||
}
|
||||
} else if (ZTS_V!=extension_version_info->thread_safe) {
|
||||
fprintf(stderr, "Cannot load %s - it %s thread safe, whereas Zend %s\n",
|
||||
new_extension->name,
|
||||
@@ -138,14 +124,16 @@ static void zend_extension_shutdown(zend_extension *extension)
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
static void zend_extension_startup(zend_extension *extension)
|
||||
static int zend_extension_startup(zend_extension *extension)
|
||||
{
|
||||
#if ZEND_EXTENSIONS_SUPPORT
|
||||
if (extension->startup) {
|
||||
if (extension->startup(extension)!=SUCCESS) {
|
||||
DL_UNLOAD(extension->handle);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -160,7 +148,7 @@ int zend_startup_extensions_mechanism()
|
||||
|
||||
int zend_startup_extensions()
|
||||
{
|
||||
zend_llist_apply(&zend_extensions, (void (*)(void *)) zend_extension_startup);
|
||||
zend_llist_apply_with_del(&zend_extensions, (int (*)(void *)) zend_extension_startup);
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
@@ -211,3 +199,18 @@ ZEND_API int zend_get_resource_handle(zend_extension *extension)
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ZEND_API zend_extension *zend_get_extension(char *extension_name)
|
||||
{
|
||||
zend_llist_element *element;
|
||||
|
||||
for (element = zend_extensions.head; element; element = element->next) {
|
||||
zend_extension *extension = (zend_extension *) element->data;
|
||||
|
||||
if (!strcmp(extension->name, extension_name)) {
|
||||
return extension;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
+33
-15
@@ -23,7 +23,7 @@
|
||||
|
||||
#include "zend_compile.h"
|
||||
|
||||
#define ZEND_EXTENSION_API_NO 20001002
|
||||
#define ZEND_EXTENSION_API_NO 20001120
|
||||
|
||||
typedef struct _zend_extension_version_info {
|
||||
int zend_extension_api_no;
|
||||
@@ -35,6 +35,23 @@ typedef struct _zend_extension_version_info {
|
||||
|
||||
typedef struct _zend_extension zend_extension;
|
||||
|
||||
/* Typedef's for zend_extension function pointers */
|
||||
typedef int (*startup_func_t)(zend_extension *extension);
|
||||
typedef void (*shutdown_func_t)(zend_extension *extension);
|
||||
typedef void (*activate_func_t)();
|
||||
typedef void (*deactivate_func_t)();
|
||||
|
||||
typedef void (*message_handler_func_t)(int message, void *arg);
|
||||
|
||||
typedef void (*op_array_handler_func_t)(zend_op_array *op_array);
|
||||
|
||||
typedef void (*statement_handler_func_t)(zend_op_array *op_array);
|
||||
typedef void (*fcall_begin_handler_func_t)(zend_op_array *op_array);
|
||||
typedef void (*fcall_end_handler_func_t)(zend_op_array *op_array);
|
||||
|
||||
typedef void (*op_array_ctor_func_t)(zend_op_array *op_array);
|
||||
typedef void (*op_array_dtor_func_t)(zend_op_array *op_array);
|
||||
|
||||
struct _zend_extension {
|
||||
char *name;
|
||||
char *version;
|
||||
@@ -42,23 +59,23 @@ struct _zend_extension {
|
||||
char *URL;
|
||||
char *copyright;
|
||||
|
||||
int (*startup)(zend_extension *extension);
|
||||
void (*shutdown)(zend_extension *extension);
|
||||
void (*activate)();
|
||||
void (*deactivate)();
|
||||
startup_func_t startup;
|
||||
shutdown_func_t shutdown;
|
||||
activate_func_t activate;
|
||||
deactivate_func_t deactivate;
|
||||
|
||||
void (*message_handler)(int message, void *arg);
|
||||
message_handler_func_t message_handler;
|
||||
|
||||
void (*op_array_handler)(zend_op_array *op_array);
|
||||
|
||||
void (*statement_handler)(zend_op_array *op_array);
|
||||
void (*fcall_begin_handler)(zend_op_array *op_array);
|
||||
void (*fcall_end_handler)(zend_op_array *op_array);
|
||||
op_array_handler_func_t op_array_handler;
|
||||
|
||||
void (*op_array_ctor)(zend_op_array *op_array);
|
||||
void (*op_array_dtor)(zend_op_array *op_array);
|
||||
statement_handler_func_t statement_handler;
|
||||
fcall_begin_handler_func_t fcall_begin_handler;
|
||||
fcall_end_handler_func_t fcall_end_handler;
|
||||
|
||||
void *reserved1;
|
||||
op_array_ctor_func_t op_array_ctor;
|
||||
op_array_dtor_func_t op_array_dtor;
|
||||
|
||||
int (*api_no_check)(int api_no);
|
||||
void *reserved2;
|
||||
void *reserved3;
|
||||
void *reserved4;
|
||||
@@ -82,17 +99,18 @@ ZEND_API void zend_extension_dispatch_message(int message, void *arg);
|
||||
ZEND_EXT_API zend_extension_version_info extension_version_info = { ZEND_EXTENSION_API_NO, ZEND_VERSION, ZTS_V, ZEND_DEBUG }
|
||||
|
||||
#define STANDARD_ZEND_EXTENSION_PROPERTIES NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, -1
|
||||
#define COMPAT_ZEND_EXTENSION_PROPERTIES NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, -1
|
||||
|
||||
|
||||
ZEND_API extern zend_llist zend_extensions;
|
||||
|
||||
void zend_extension_dtor(zend_extension *extension);
|
||||
ZEND_API int zend_load_extension(char *path);
|
||||
ZEND_API int zend_load_extensions(char **extension_paths);
|
||||
ZEND_API int zend_register_extension(zend_extension *new_extension, DL_HANDLE handle);
|
||||
void zend_append_version_info(zend_extension *extension);
|
||||
int zend_startup_extensions_mechanism(void);
|
||||
int zend_startup_extensions(void);
|
||||
void zend_shutdown_extensions(void);
|
||||
ZEND_API zend_extension *zend_get_extension(char *extension_name);
|
||||
|
||||
#endif /* ZEND_EXTENSIONS_H */
|
||||
@@ -74,7 +74,7 @@ typedef struct _zend_fast_cache_list_entry {
|
||||
{ \
|
||||
ALS_FETCH(); \
|
||||
\
|
||||
((zend_fast_cache_list_entry *) (p))->next = AG(fast_cache_list_head)[fc_type]; \
|
||||
((zend_fast_cache_list_entry *) (p))->next = (zend_fast_cache_list_entry *) AG(fast_cache_list_head)[fc_type]; \
|
||||
AG(fast_cache_list_head)[fc_type] = (zend_fast_cache_list_entry *) (p); \
|
||||
}
|
||||
|
||||
|
||||
+7
-3
@@ -40,6 +40,7 @@
|
||||
|
||||
#ifdef __cplusplus
|
||||
class ZendFlexLexer;
|
||||
class ZendIniFlexLexer;
|
||||
#endif
|
||||
|
||||
BEGIN_EXTERN_C()
|
||||
@@ -106,13 +107,15 @@ struct _zend_compiler_globals {
|
||||
|
||||
zend_bool unclean_shutdown;
|
||||
|
||||
zend_bool ini_parser_unbuffered_errors;
|
||||
|
||||
zend_llist open_files;
|
||||
#ifdef ZTS
|
||||
#ifdef __cplusplus
|
||||
#if defined(ZTS) && defined(__cplusplus)
|
||||
ZendFlexLexer *ZFL;
|
||||
ZendIniFlexLexer *ini_scanner;
|
||||
#else
|
||||
void *ZFL;
|
||||
#endif
|
||||
void *ini_parser;
|
||||
#endif
|
||||
};
|
||||
|
||||
@@ -148,6 +151,7 @@ struct _zend_executor_globals {
|
||||
|
||||
int error_reporting;
|
||||
int orig_error_reporting;
|
||||
int exit_status;
|
||||
|
||||
zend_op_array *active_op_array;
|
||||
|
||||
|
||||
+34
-2
@@ -155,7 +155,7 @@ ZEND_API ulong hashpjw(char *arKey, uint nKeyLength)
|
||||
if (!(p)->pDataPtr) { \
|
||||
pefree((p)->pData, (ht)->persistent); \
|
||||
} \
|
||||
(p)->pDataPtr = *(void **)pData; \
|
||||
memcpy(&(p)->pDataPtr, pData, sizeof(void *)); \
|
||||
(p)->pData = &(p)->pDataPtr; \
|
||||
} else { \
|
||||
if ((p)->pDataPtr) { \
|
||||
@@ -167,7 +167,7 @@ ZEND_API ulong hashpjw(char *arKey, uint nKeyLength)
|
||||
|
||||
#define INIT_DATA(ht, p, pData, nDataSize); \
|
||||
if (nDataSize == sizeof(void*)) { \
|
||||
(p)->pDataPtr = *(void **)pData; \
|
||||
memcpy(&(p)->pDataPtr, pData, sizeof(void *)); \
|
||||
(p)->pData = &(p)->pDataPtr; \
|
||||
} else { \
|
||||
(p)->pData = (void *) pemalloc(nDataSize, (ht)->persistent); \
|
||||
@@ -797,6 +797,38 @@ ZEND_API void zend_hash_merge(HashTable *target, HashTable *source, copy_ctor_fu
|
||||
}
|
||||
|
||||
|
||||
ZEND_API void zend_hash_merge_ex(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor, uint size, zend_bool (*pReplaceOrig)(void *orig, void *p_new))
|
||||
{
|
||||
Bucket *p;
|
||||
void *t;
|
||||
void *pOrig;
|
||||
|
||||
IS_CONSISTENT(source);
|
||||
IS_CONSISTENT(target);
|
||||
|
||||
p = source->pListHead;
|
||||
while (p) {
|
||||
if (p->nKeyLength>0) {
|
||||
if (zend_hash_find(target, p->arKey, p->nKeyLength, &pOrig)==FAILURE
|
||||
|| pReplaceOrig(pOrig, p->pData)) {
|
||||
if (zend_hash_update(target, p->arKey, p->nKeyLength, p->pData, size, &t)==SUCCESS && pCopyConstructor) {
|
||||
pCopyConstructor(t);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (zend_hash_index_find(target, p->h, &pOrig)==FAILURE
|
||||
|| pReplaceOrig(pOrig, p->pData)) {
|
||||
if (zend_hash_index_update(target, p->h, p->pData, size, &t)==SUCCESS && pCopyConstructor) {
|
||||
pCopyConstructor(t);
|
||||
}
|
||||
}
|
||||
}
|
||||
p = p->pListNext;
|
||||
}
|
||||
target->pInternalPointer = target->pListHead;
|
||||
}
|
||||
|
||||
|
||||
ZEND_API ulong zend_get_hash_value(HashTable *ht, char *arKey, uint nKeyLength)
|
||||
{
|
||||
IS_CONSISTENT(ht);
|
||||
|
||||
@@ -170,6 +170,7 @@ ZEND_API void zend_hash_internal_pointer_end_ex(HashTable *ht, HashPosition *pos
|
||||
/* Copying, merging and sorting */
|
||||
ZEND_API void zend_hash_copy(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor, void *tmp, uint size);
|
||||
ZEND_API void zend_hash_merge(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor, void *tmp, uint size, int overwrite);
|
||||
ZEND_API void zend_hash_merge_ex(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor, uint size, zend_bool (*pReplaceOrig)(void *orig, void *p_new));
|
||||
ZEND_API int zend_hash_sort(HashTable *ht, sort_func_t sort_func, compare_func_t compare_func, int renumber);
|
||||
ZEND_API int zend_hash_compare(HashTable *ht1, HashTable *ht2, compare_func_t compar, zend_bool ordered);
|
||||
ZEND_API int zend_hash_minmax(HashTable *ht, int (*compar)(const void *, const void *), int flag, void **pData);
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
|
||||
#include "zend.h"
|
||||
#include "zend-parser.h"
|
||||
#include "zend_language_parser.h"
|
||||
#include "zend_compile.h"
|
||||
#include "zend_highlight.h"
|
||||
#include "zend_ptr_stack.h"
|
||||
|
||||
@@ -40,8 +40,8 @@ typedef struct _zend_syntax_highlighter_ini {
|
||||
|
||||
BEGIN_EXTERN_C()
|
||||
ZEND_API void zend_highlight(zend_syntax_highlighter_ini *syntax_highlighter_ini);
|
||||
int highlight_file(char *filename, zend_syntax_highlighter_ini *syntax_highlighter_ini);
|
||||
int highlight_string(zval *str, zend_syntax_highlighter_ini *syntax_highlighter_ini, char *str_name);
|
||||
ZEND_API int highlight_file(char *filename, zend_syntax_highlighter_ini *syntax_highlighter_ini);
|
||||
ZEND_API int highlight_string(zval *str, zend_syntax_highlighter_ini *syntax_highlighter_ini, char *str_name);
|
||||
ZEND_API void zend_html_putc(char c);
|
||||
ZEND_API void zend_html_puts(char *s, uint len);
|
||||
END_EXTERN_C()
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@
|
||||
|
||||
|
||||
#include "zend.h"
|
||||
#include "zend-parser.h"
|
||||
#include "zend_language_parser.h"
|
||||
#include "zend_compile.h"
|
||||
#include "zend_indent.h"
|
||||
|
||||
|
||||
+485
@@ -0,0 +1,485 @@
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 0.92 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available at through the world-wide-web at |
|
||||
| http://www.zend.com/license/0_92.txt. |
|
||||
| If you did not receive a copy of the Zend license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@zend.com so we can mail you a copy immediately. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Author: Zeev Suraski <zeev@zend.com> |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "zend.h"
|
||||
#include "zend_API.h"
|
||||
#include "zend_ini.h"
|
||||
#include "zend_alloc.h"
|
||||
#include "zend_operators.h"
|
||||
|
||||
static HashTable known_directives;
|
||||
|
||||
|
||||
/*
|
||||
* hash_apply functions
|
||||
*/
|
||||
static int zend_remove_ini_entries(zend_ini_entry *ini_entry, int *module_number)
|
||||
{
|
||||
if (ini_entry->module_number == *module_number) {
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static int zend_restore_ini_entry_cb(zend_ini_entry *ini_entry, int stage)
|
||||
{
|
||||
if (ini_entry->modified) {
|
||||
if (ini_entry->on_modify) {
|
||||
ini_entry->on_modify(ini_entry, ini_entry->orig_value, ini_entry->orig_value_length, ini_entry->mh_arg1, ini_entry->mh_arg2, ini_entry->mh_arg3, stage);
|
||||
}
|
||||
efree(ini_entry->value);
|
||||
ini_entry->value = ini_entry->orig_value;
|
||||
ini_entry->value_length = ini_entry->orig_value_length;
|
||||
ini_entry->modified = 0;
|
||||
ini_entry->orig_value = NULL;
|
||||
ini_entry->orig_value_length = 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Startup / shutdown
|
||||
*/
|
||||
int zend_ini_mstartup()
|
||||
{
|
||||
if (zend_hash_init_ex(&known_directives, 100, NULL, NULL, 1, 0)==FAILURE) {
|
||||
return FAILURE;
|
||||
}
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
int zend_ini_mshutdown()
|
||||
{
|
||||
zend_hash_destroy(&known_directives);
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
int zend_ini_rshutdown()
|
||||
{
|
||||
zend_hash_apply_with_argument(&known_directives, (int (*)(void *, void *)) zend_restore_ini_entry_cb, (void *) ZEND_INI_STAGE_DEACTIVATE);
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
static int ini_key_compare(const void *a, const void *b)
|
||||
{
|
||||
Bucket *f;
|
||||
Bucket *s;
|
||||
|
||||
f = *((Bucket **) a);
|
||||
s = *((Bucket **) b);
|
||||
|
||||
if (f->nKeyLength==0 && s->nKeyLength==0) { /* both numeric */
|
||||
return ZEND_NORMALIZE_BOOL(f->nKeyLength - s->nKeyLength);
|
||||
} else if (f->nKeyLength==0) { /* f is numeric, s is not */
|
||||
return -1;
|
||||
} else if (s->nKeyLength==0) { /* s is numeric, f is not */
|
||||
return 1;
|
||||
} else { /* both strings */
|
||||
return zend_binary_strcasecmp(f->arKey, f->nKeyLength, s->arKey, s->nKeyLength);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void zend_ini_sort_entries(void)
|
||||
{
|
||||
zend_hash_sort(&known_directives, qsort, ini_key_compare, 0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Registration / unregistration
|
||||
*/
|
||||
|
||||
ZEND_API int zend_register_ini_entries(zend_ini_entry *ini_entry, int module_number)
|
||||
{
|
||||
zend_ini_entry *p = ini_entry;
|
||||
zend_ini_entry *hashed_ini_entry;
|
||||
zval *default_value;
|
||||
|
||||
while (p->name) {
|
||||
p->module_number = module_number;
|
||||
if (zend_hash_add(&known_directives, p->name, p->name_length, p, sizeof(zend_ini_entry), (void **) &hashed_ini_entry)==FAILURE) {
|
||||
zend_unregister_ini_entries(module_number);
|
||||
return FAILURE;
|
||||
}
|
||||
if ((default_value=cfg_get_entry(p->name, p->name_length))) {
|
||||
if (!hashed_ini_entry->on_modify
|
||||
|| hashed_ini_entry->on_modify(hashed_ini_entry, default_value->value.str.val, default_value->value.str.len, hashed_ini_entry->mh_arg1, hashed_ini_entry->mh_arg2, hashed_ini_entry->mh_arg3, ZEND_INI_STAGE_STARTUP)==SUCCESS) {
|
||||
hashed_ini_entry->value = default_value->value.str.val;
|
||||
hashed_ini_entry->value_length = default_value->value.str.len;
|
||||
}
|
||||
} else {
|
||||
if (hashed_ini_entry->on_modify) {
|
||||
hashed_ini_entry->on_modify(hashed_ini_entry, hashed_ini_entry->value, hashed_ini_entry->value_length, hashed_ini_entry->mh_arg1, hashed_ini_entry->mh_arg2, hashed_ini_entry->mh_arg3, ZEND_INI_STAGE_STARTUP);
|
||||
}
|
||||
}
|
||||
p++;
|
||||
}
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
ZEND_API void zend_unregister_ini_entries(int module_number)
|
||||
{
|
||||
zend_hash_apply_with_argument(&known_directives, (int (*)(void *, void *)) zend_remove_ini_entries, (void *) &module_number);
|
||||
}
|
||||
|
||||
|
||||
static int zend_ini_refresh_cache(zend_ini_entry *p, int stage)
|
||||
{
|
||||
if (p->on_modify) {
|
||||
p->on_modify(p, p->value, p->value_length, p->mh_arg1, p->mh_arg2, p->mh_arg3, stage);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
ZEND_API void zend_ini_refresh_caches(int stage)
|
||||
{
|
||||
zend_hash_apply_with_argument(&known_directives, (int (*)(void *, void *)) zend_ini_refresh_cache, (void *)(long) stage);
|
||||
}
|
||||
|
||||
|
||||
ZEND_API int zend_alter_ini_entry(char *name, uint name_length, char *new_value, uint new_value_length, int modify_type, int stage)
|
||||
{
|
||||
zend_ini_entry *ini_entry;
|
||||
char *duplicate;
|
||||
|
||||
if (zend_hash_find(&known_directives, name, name_length, (void **) &ini_entry)==FAILURE) {
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
if (!(ini_entry->modifyable & modify_type)) {
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
duplicate = estrndup(new_value, new_value_length);
|
||||
|
||||
if (!ini_entry->on_modify
|
||||
|| ini_entry->on_modify(ini_entry, duplicate, new_value_length, ini_entry->mh_arg1, ini_entry->mh_arg2, ini_entry->mh_arg3, stage)==SUCCESS) {
|
||||
if (!ini_entry->modified) {
|
||||
ini_entry->orig_value = ini_entry->value;
|
||||
ini_entry->orig_value_length = ini_entry->value_length;
|
||||
} else { /* we already changed the value, free the changed value */
|
||||
efree(ini_entry->value);
|
||||
}
|
||||
ini_entry->value = duplicate;
|
||||
ini_entry->value_length = new_value_length;
|
||||
ini_entry->modified = 1;
|
||||
} else {
|
||||
efree(duplicate);
|
||||
}
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
ZEND_API int zend_restore_ini_entry(char *name, uint name_length, int stage)
|
||||
{
|
||||
zend_ini_entry *ini_entry;
|
||||
|
||||
if (zend_hash_find(&known_directives, name, name_length, (void **) &ini_entry)==FAILURE) {
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
zend_restore_ini_entry_cb(ini_entry, stage);
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
ZEND_API int zend_ini_register_displayer(char *name, uint name_length, void (*displayer)(zend_ini_entry *ini_entry, int type))
|
||||
{
|
||||
zend_ini_entry *ini_entry;
|
||||
|
||||
if (zend_hash_find(&known_directives, name, name_length, (void **) &ini_entry)==FAILURE) {
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
ini_entry->displayer = displayer;
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Data retrieval
|
||||
*/
|
||||
|
||||
ZEND_API long zend_ini_long(char *name, uint name_length, int orig)
|
||||
{
|
||||
zend_ini_entry *ini_entry;
|
||||
|
||||
if (zend_hash_find(&known_directives, name, name_length, (void **) &ini_entry)==SUCCESS) {
|
||||
if (orig && ini_entry->modified) {
|
||||
return (ini_entry->orig_value ? strtol(ini_entry->orig_value, NULL, 0) : 0);
|
||||
} else if (ini_entry->value) {
|
||||
return strtol(ini_entry->value, NULL, 0);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
ZEND_API double zend_ini_double(char *name, uint name_length, int orig)
|
||||
{
|
||||
zend_ini_entry *ini_entry;
|
||||
|
||||
if (zend_hash_find(&known_directives, name, name_length, (void **) &ini_entry)==SUCCESS) {
|
||||
if (orig && ini_entry->modified) {
|
||||
return (double) (ini_entry->orig_value ? strtod(ini_entry->orig_value, NULL) : 0.0);
|
||||
} else if (ini_entry->value) {
|
||||
return (double) strtod(ini_entry->value, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
|
||||
ZEND_API char *zend_ini_string(char *name, uint name_length, int orig)
|
||||
{
|
||||
zend_ini_entry *ini_entry;
|
||||
|
||||
if (zend_hash_find(&known_directives, name, name_length, (void **) &ini_entry)==SUCCESS) {
|
||||
if (orig && ini_entry->modified) {
|
||||
return ini_entry->orig_value;
|
||||
} else {
|
||||
return ini_entry->value;
|
||||
}
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
zend_ini_entry *get_ini_entry(char *name, uint name_length)
|
||||
{
|
||||
zend_ini_entry *ini_entry;
|
||||
|
||||
if (zend_hash_find(&known_directives, name, name_length, (void **) &ini_entry)==SUCCESS) {
|
||||
return ini_entry;
|
||||
} else {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void zend_ini_displayer_cb(zend_ini_entry *ini_entry, int type)
|
||||
{
|
||||
if (ini_entry->displayer) {
|
||||
ini_entry->displayer(ini_entry, type);
|
||||
} else {
|
||||
char *display_string;
|
||||
uint display_string_length;
|
||||
|
||||
if (type==ZEND_INI_DISPLAY_ORIG && ini_entry->modified) {
|
||||
if (ini_entry->orig_value) {
|
||||
display_string = ini_entry->orig_value;
|
||||
display_string_length = ini_entry->orig_value_length;
|
||||
} else {
|
||||
display_string = "<i>no value</i>";
|
||||
display_string_length = sizeof("<i>no value</i>")-1;
|
||||
}
|
||||
} else if (ini_entry->value && ini_entry->value[0]) {
|
||||
display_string = ini_entry->value;
|
||||
display_string_length = ini_entry->value_length;
|
||||
} else {
|
||||
display_string = "<i>no value</i>";
|
||||
display_string_length = sizeof("<i>no value</i>")-1;
|
||||
}
|
||||
ZEND_WRITE(display_string, display_string_length);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ZEND_INI_DISP(zend_ini_boolean_displayer_cb)
|
||||
{
|
||||
int value;
|
||||
|
||||
if (type==ZEND_INI_DISPLAY_ORIG && ini_entry->modified) {
|
||||
value = (ini_entry->orig_value ? atoi(ini_entry->orig_value) : 0);
|
||||
} else if (ini_entry->value) {
|
||||
value = atoi(ini_entry->value);
|
||||
} else {
|
||||
value = 0;
|
||||
}
|
||||
if (value) {
|
||||
ZEND_PUTS("On");
|
||||
} else {
|
||||
ZEND_PUTS("Off");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ZEND_INI_DISP(zend_ini_color_displayer_cb)
|
||||
{
|
||||
char *value;
|
||||
|
||||
if (type==ZEND_INI_DISPLAY_ORIG && ini_entry->modified) {
|
||||
value = ini_entry->orig_value;
|
||||
} else if (ini_entry->value) {
|
||||
value = ini_entry->value;
|
||||
} else {
|
||||
value = NULL;
|
||||
}
|
||||
if (value) {
|
||||
zend_printf("<font color=\"%s\">%s</font>", value, value);
|
||||
} else {
|
||||
ZEND_PUTS("<i>no value</i>;");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ZEND_INI_DISP(display_link_numbers)
|
||||
{
|
||||
char *value;
|
||||
|
||||
if (type==ZEND_INI_DISPLAY_ORIG && ini_entry->modified) {
|
||||
value = ini_entry->orig_value;
|
||||
} else if (ini_entry->value) {
|
||||
value = ini_entry->value;
|
||||
} else {
|
||||
value = NULL;
|
||||
}
|
||||
|
||||
if (value) {
|
||||
if (atoi(value)==-1) {
|
||||
ZEND_PUTS("Unlimited");
|
||||
} else {
|
||||
zend_printf("%s", value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ZEND_API void zend_ini_apply_with_argument(apply_func_arg_t apply_func, void *arg)
|
||||
{
|
||||
zend_hash_apply_with_argument(&known_directives, apply_func, arg);
|
||||
}
|
||||
|
||||
|
||||
/* Standard message handlers */
|
||||
|
||||
ZEND_API ZEND_INI_MH(OnUpdateBool)
|
||||
{
|
||||
zend_bool *p;
|
||||
#ifndef ZTS
|
||||
char *base = (char *) mh_arg2;
|
||||
#else
|
||||
char *base;
|
||||
|
||||
base = (char *) ts_resource(*((int *) mh_arg2));
|
||||
#endif
|
||||
|
||||
p = (zend_bool *) (base+(size_t) mh_arg1);
|
||||
|
||||
*p = (zend_bool) atoi(new_value);
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
ZEND_API ZEND_INI_MH(OnUpdateInt)
|
||||
{
|
||||
long *p;
|
||||
#ifndef ZTS
|
||||
char *base = (char *) mh_arg2;
|
||||
#else
|
||||
char *base;
|
||||
|
||||
base = (char *) ts_resource(*((int *) mh_arg2));
|
||||
#endif
|
||||
|
||||
p = (long *) (base+(size_t) mh_arg1);
|
||||
|
||||
*p = zend_atoi(new_value, new_value_length);
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
ZEND_API ZEND_INI_MH(OnUpdateReal)
|
||||
{
|
||||
double *p;
|
||||
#ifndef ZTS
|
||||
char *base = (char *) mh_arg2;
|
||||
#else
|
||||
char *base;
|
||||
|
||||
base = (char *) ts_resource(*((int *) mh_arg2));
|
||||
#endif
|
||||
|
||||
p = (double *) (base+(size_t) mh_arg1);
|
||||
|
||||
*p = strtod(new_value, NULL);
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
ZEND_API ZEND_INI_MH(OnUpdateString)
|
||||
{
|
||||
char **p;
|
||||
#ifndef ZTS
|
||||
char *base = (char *) mh_arg2;
|
||||
#else
|
||||
char *base;
|
||||
|
||||
base = (char *) ts_resource(*((int *) mh_arg2));
|
||||
#endif
|
||||
|
||||
p = (char **) (base+(size_t) mh_arg1);
|
||||
|
||||
*p = new_value;
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
ZEND_API ZEND_INI_MH(OnUpdateStringUnempty)
|
||||
{
|
||||
char **p;
|
||||
#ifndef ZTS
|
||||
char *base = (char *) mh_arg2;
|
||||
#else
|
||||
char *base;
|
||||
|
||||
base = (char *) ts_resource(*((int *) mh_arg2));
|
||||
#endif
|
||||
|
||||
if (new_value && !new_value[0]) {
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
p = (char **) (base+(size_t) mh_arg1);
|
||||
|
||||
*p = new_value;
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Local variables:
|
||||
* tab-width: 4
|
||||
* c-basic-offset: 4
|
||||
* End:
|
||||
*/
|
||||
+168
@@ -0,0 +1,168 @@
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 0.92 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available at through the world-wide-web at |
|
||||
| http://www.zend.com/license/0_92.txt. |
|
||||
| If you did not receive a copy of the Zend license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@zend.com so we can mail you a copy immediately. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Author: Zeev Suraski <zeev@zend.com> |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
|
||||
#ifndef ZEND_INI_H
|
||||
#define ZEND_INI_H
|
||||
|
||||
#define ZEND_INI_USER (1<<0)
|
||||
#define ZEND_INI_PERDIR (1<<1)
|
||||
#define ZEND_INI_SYSTEM (1<<2)
|
||||
|
||||
#define ZEND_INI_ALL (ZEND_INI_USER|ZEND_INI_PERDIR|ZEND_INI_SYSTEM)
|
||||
|
||||
typedef struct _zend_ini_entry zend_ini_entry;
|
||||
|
||||
#define ZEND_INI_MH(name) int name(zend_ini_entry *entry, char *new_value, uint new_value_length, void *mh_arg1, void *mh_arg2, void *mh_arg3, int stage)
|
||||
#define ZEND_INI_DISP(name) void name(zend_ini_entry *ini_entry, int type)
|
||||
|
||||
struct _zend_ini_entry {
|
||||
int module_number;
|
||||
int modifyable;
|
||||
char *name;
|
||||
uint name_length;
|
||||
ZEND_INI_MH((*on_modify));
|
||||
void *mh_arg1;
|
||||
void *mh_arg2;
|
||||
void *mh_arg3;
|
||||
|
||||
char *value;
|
||||
uint value_length;
|
||||
|
||||
char *orig_value;
|
||||
uint orig_value_length;
|
||||
int modified;
|
||||
|
||||
void (*displayer)(zend_ini_entry *ini_entry, int type);
|
||||
};
|
||||
|
||||
|
||||
int zend_ini_mstartup(void);
|
||||
int zend_ini_mshutdown(void);
|
||||
int zend_ini_rshutdown(void);
|
||||
|
||||
void zend_ini_sort_entries(void);
|
||||
|
||||
ZEND_API int zend_register_ini_entries(zend_ini_entry *ini_entry, int module_number);
|
||||
ZEND_API void zend_unregister_ini_entries(int module_number);
|
||||
ZEND_API void zend_ini_refresh_caches(int stage);
|
||||
ZEND_API int zend_alter_ini_entry(char *name, uint name_length, char *new_value, uint new_value_length, int modify_type, int stage);
|
||||
ZEND_API int zend_restore_ini_entry(char *name, uint name_length, int stage);
|
||||
ZEND_API void display_ini_entries(zend_module_entry *module);
|
||||
|
||||
ZEND_API long zend_ini_long(char *name, uint name_length, int orig);
|
||||
ZEND_API double zend_ini_double(char *name, uint name_length, int orig);
|
||||
ZEND_API char *zend_ini_string(char *name, uint name_length, int orig);
|
||||
zend_ini_entry *get_ini_entry(char *name, uint name_length);
|
||||
|
||||
ZEND_API int zend_ini_register_displayer(char *name, uint name_length, void (*displayer)(zend_ini_entry *ini_entry, int type));
|
||||
|
||||
ZEND_API void zend_ini_apply_with_argument(apply_func_arg_t apply_func, void *arg);
|
||||
|
||||
ZEND_API ZEND_INI_DISP(zend_ini_boolean_displayer_cb);
|
||||
ZEND_API ZEND_INI_DISP(zend_ini_color_displayer_cb);
|
||||
ZEND_API ZEND_INI_DISP(display_link_numbers);
|
||||
|
||||
#define ZEND_INI_BEGIN() static zend_ini_entry ini_entries[] = {
|
||||
#define ZEND_INI_END() { 0, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, NULL } };
|
||||
|
||||
#define ZEND_INI_ENTRY3_EX(name, default_value, modifyable, on_modify, arg1, arg2, arg3, displayer) \
|
||||
{ 0, modifyable, name, sizeof(name), on_modify, arg1, arg2, arg3, default_value, sizeof(default_value)-1, NULL, 0, 0, displayer },
|
||||
|
||||
#define ZEND_INI_ENTRY3(name, default_value, modifyable, on_modify, arg1, arg2, arg3) \
|
||||
ZEND_INI_ENTRY3_EX(name, default_value, modifyable, on_modify, arg1, arg2, arg3, NULL)
|
||||
|
||||
#define ZEND_INI_ENTRY2_EX(name, default_value, modifyable, on_modify, arg1, arg2, displayer) \
|
||||
ZEND_INI_ENTRY3_EX(name, default_value, modifyable, on_modify, arg1, arg2, NULL, displayer)
|
||||
|
||||
#define ZEND_INI_ENTRY2(name, default_value, modifyable, on_modify, arg1, arg2) \
|
||||
ZEND_INI_ENTRY2_EX(name, default_value, modifyable, on_modify, arg1, arg2, NULL)
|
||||
|
||||
#define ZEND_INI_ENTRY1_EX(name, default_value, modifyable, on_modify, arg1, displayer) \
|
||||
ZEND_INI_ENTRY3_EX(name, default_value, modifyable, on_modify, arg1, NULL, NULL, displayer)
|
||||
|
||||
#define ZEND_INI_ENTRY1(name, default_value, modifyable, on_modify, arg1) \
|
||||
ZEND_INI_ENTRY1_EX(name, default_value, modifyable, on_modify, arg1, NULL)
|
||||
|
||||
#define ZEND_INI_ENTRY_EX(name, default_value, modifyable, on_modify, displayer) \
|
||||
ZEND_INI_ENTRY3_EX(name, default_value, modifyable, on_modify, NULL, NULL, NULL, displayer)
|
||||
|
||||
#define ZEND_INI_ENTRY(name, default_value, modifyable, on_modify) \
|
||||
ZEND_INI_ENTRY_EX(name, default_value, modifyable, on_modify, NULL)
|
||||
|
||||
#ifdef ZTS
|
||||
#define STD_ZEND_INI_ENTRY(name, default_value, modifyable, on_modify, property_name, struct_type, struct_ptr) \
|
||||
ZEND_INI_ENTRY2(name, default_value, modifyable, on_modify, (void *) XtOffsetOf(struct_type, property_name), (void *) &struct_ptr##_id)
|
||||
#define STD_ZEND_INI_ENTRY_EX(name, default_value, modifyable, on_modify, property_name, struct_type, struct_ptr, displayer) \
|
||||
ZEND_INI_ENTRY2_EX(name, default_value, modifyable, on_modify, (void *) XtOffsetOf(struct_type, property_name), (void *) &struct_ptr##_id, displayer)
|
||||
#define STD_ZEND_INI_BOOLEAN(name, default_value, modifyable, on_modify, property_name, struct_type, struct_ptr) \
|
||||
ZEND_INI_ENTRY3_EX(name, default_value, modifyable, on_modify, (void *) XtOffsetOf(struct_type, property_name), (void *) &struct_ptr##_id, NULL, zend_ini_boolean_displayer_cb)
|
||||
#else
|
||||
#define STD_ZEND_INI_ENTRY(name, default_value, modifyable, on_modify, property_name, struct_type, struct_ptr) \
|
||||
ZEND_INI_ENTRY2(name, default_value, modifyable, on_modify, (void *) XtOffsetOf(struct_type, property_name), (void *) &struct_ptr)
|
||||
#define STD_ZEND_INI_ENTRY_EX(name, default_value, modifyable, on_modify, property_name, struct_type, struct_ptr, displayer) \
|
||||
ZEND_INI_ENTRY2_EX(name, default_value, modifyable, on_modify, (void *) XtOffsetOf(struct_type, property_name), (void *) &struct_ptr, displayer)
|
||||
#define STD_ZEND_INI_BOOLEAN(name, default_value, modifyable, on_modify, property_name, struct_type, struct_ptr) \
|
||||
ZEND_INI_ENTRY3_EX(name, default_value, modifyable, on_modify, (void *) XtOffsetOf(struct_type, property_name), (void *) &struct_ptr, NULL, zend_ini_boolean_displayer_cb)
|
||||
#endif
|
||||
|
||||
#define INI_INT(name) zend_ini_long((name), sizeof(name), 0)
|
||||
#define INI_FLT(name) zend_ini_double((name), sizeof(name), 0)
|
||||
#define INI_STR(name) zend_ini_string((name), sizeof(name), 0)
|
||||
#define INI_BOOL(name) ((zend_bool) INI_INT(name))
|
||||
|
||||
#define INI_ORIG_INT(name) zend_ini_long((name), sizeof(name), 1)
|
||||
#define INI_ORIG_FLT(name) zend_ini_double((name), sizeof(name), 1)
|
||||
#define INI_ORIG_STR(name) zend_ini_string((name), sizeof(name), 1)
|
||||
#define INI_ORIG_BOOL(name) ((zend_bool) INI_ORIG_INT(name))
|
||||
|
||||
|
||||
#define REGISTER_INI_ENTRIES() zend_register_ini_entries(ini_entries, module_number)
|
||||
#define UNREGISTER_INI_ENTRIES() zend_unregister_ini_entries(module_number)
|
||||
#define DISPLAY_INI_ENTRIES() display_ini_entries(zend_module)
|
||||
|
||||
#define REGISTER_INI_DISPLAYER(name, displayer) zend_ini_register_displayer((name), sizeof(name), displayer)
|
||||
#define REGISTER_INI_BOOLEAN(name) REGISTER_INI_DISPLAYER(name, zend_ini_boolean_displayer_cb)
|
||||
|
||||
zval *cfg_get_entry(char *name, uint name_length);
|
||||
|
||||
|
||||
/* Standard message handlers */
|
||||
ZEND_API ZEND_INI_MH(OnUpdateBool);
|
||||
ZEND_API ZEND_INI_MH(OnUpdateInt);
|
||||
ZEND_API ZEND_INI_MH(OnUpdateReal);
|
||||
ZEND_API ZEND_INI_MH(OnUpdateString);
|
||||
ZEND_API ZEND_INI_MH(OnUpdateStringUnempty);
|
||||
|
||||
|
||||
#define ZEND_INI_DISPLAY_ORIG 1
|
||||
#define ZEND_INI_DISPLAY_ACTIVE 2
|
||||
|
||||
#define ZEND_INI_STAGE_STARTUP (1<<0)
|
||||
#define ZEND_INI_STAGE_SHUTDOWN (1<<1)
|
||||
#define ZEND_INI_STAGE_ACTIVATE (1<<2)
|
||||
#define ZEND_INI_STAGE_DEACTIVATE (1<<3)
|
||||
#define ZEND_INI_STAGE_RUNTIME (1<<4)
|
||||
|
||||
/* INI parsing engine */
|
||||
typedef void (*zend_ini_parser_cb_t)(zval *arg1, zval *arg2, int callback_type, void *arg);
|
||||
int zend_parse_ini_file(zend_file_handle *fh, zend_bool unbuffered_errors, zend_ini_parser_cb_t ini_parser_cb, void *arg);
|
||||
#define ZEND_INI_PARSER_ENTRY 1
|
||||
#define ZEND_INI_PARSER_SECTION 2
|
||||
|
||||
#endif /* ZEND_INI_H */
|
||||
@@ -0,0 +1,231 @@
|
||||
%{
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 0.92 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available at through the world-wide-web at |
|
||||
| http://www.zend.com/license/0_92.txt. |
|
||||
| If you did not receive a copy of the Zend license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@zend.com so we can mail you a copy immediately. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Author: Zeev Suraski <zeev@zend.com> |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
#define DEBUG_CFG_PARSER 0
|
||||
#include "zend.h"
|
||||
#include "zend_API.h"
|
||||
#include "zend_ini.h"
|
||||
#include "zend_constants.h"
|
||||
#include "zend_ini_scanner.h"
|
||||
#include "zend_extensions.h"
|
||||
|
||||
|
||||
#if WIN32
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#include <winbase.h>
|
||||
#endif
|
||||
|
||||
|
||||
typedef struct _zend_ini_parser_param {
|
||||
zend_ini_parser_cb_t ini_parser_cb;
|
||||
void *arg;
|
||||
} zend_ini_parser_param;
|
||||
|
||||
#define YYSTYPE zval
|
||||
#define YYPARSE_PARAM ini_parser_param
|
||||
|
||||
#define ZEND_INI_PARSER_CB ((zend_ini_parser_param *) ini_parser_param)->ini_parser_cb
|
||||
#define ZEND_INI_PARSER_ARG ((zend_ini_parser_param *) ini_parser_param)->arg
|
||||
|
||||
int ini_lex(zval *ini_lval);
|
||||
int ini_parse(void *ini_parser_param);
|
||||
|
||||
zval yylval;
|
||||
|
||||
#ifndef ZTS
|
||||
extern int ini_lex(zval *ini_lval);
|
||||
extern FILE *ini_in;
|
||||
extern int ini_lineno;
|
||||
extern void init_cfg_scanner(void);
|
||||
#endif
|
||||
|
||||
void zend_ini_do_op(char type, zval *result, zval *op1, zval *op2)
|
||||
{
|
||||
int i_result;
|
||||
int i_op1, i_op2;
|
||||
char str_result[MAX_LENGTH_OF_LONG];
|
||||
|
||||
i_op1 = atoi(op1->value.str.val);
|
||||
free(op1->value.str.val);
|
||||
if (op2) {
|
||||
i_op2 = atoi(op2->value.str.val);
|
||||
free(op2->value.str.val);
|
||||
} else {
|
||||
i_op2 = 0;
|
||||
}
|
||||
|
||||
switch (type) {
|
||||
case '|':
|
||||
i_result = i_op1 | i_op2;
|
||||
break;
|
||||
case '&':
|
||||
i_result = i_op1 & i_op2;
|
||||
break;
|
||||
case '~':
|
||||
i_result = ~i_op1;
|
||||
break;
|
||||
case '!':
|
||||
i_result = !i_op1;
|
||||
break;
|
||||
default:
|
||||
i_result = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
result->value.str.len = zend_sprintf(str_result, "%d", i_result);
|
||||
result->value.str.val = (char *) malloc(result->value.str.len+1);
|
||||
memcpy(result->value.str.val, str_result, result->value.str.len);
|
||||
result->value.str.val[result->value.str.len] = 0;
|
||||
result->type = IS_STRING;
|
||||
}
|
||||
|
||||
|
||||
void zend_ini_get_constant(zval *result, zval *name)
|
||||
{
|
||||
zval z_constant;
|
||||
|
||||
if (zend_get_constant(name->value.str.val, name->value.str.len, &z_constant)) {
|
||||
/* z_constant is emalloc()'d */
|
||||
convert_to_string(&z_constant);
|
||||
result->value.str.val = zend_strndup(z_constant.value.str.val, z_constant.value.str.len);
|
||||
result->value.str.len = z_constant.value.str.len;
|
||||
result->type = z_constant.type;
|
||||
zval_dtor(&z_constant);
|
||||
free(name->value.str.val);
|
||||
} else {
|
||||
*result = *name;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void ini_error(char *str)
|
||||
{
|
||||
char *error_buf;
|
||||
int error_buf_len;
|
||||
char *currently_parsed_filename = zend_ini_scanner_get_filename();
|
||||
CLS_FETCH();
|
||||
|
||||
error_buf_len = 128+strlen(currently_parsed_filename); /* should be more than enough */
|
||||
error_buf = (char *) emalloc(error_buf_len);
|
||||
|
||||
sprintf(error_buf, "Error parsing %s on line %d\n", currently_parsed_filename, zend_ini_scanner_get_lineno());
|
||||
|
||||
if (CG(ini_parser_unbuffered_errors)) {
|
||||
#ifdef PHP_WIN32
|
||||
MessageBox(NULL, error_buf, "PHP Error", MB_OK|MB_TOPMOST|0x00200000L);
|
||||
#else
|
||||
fprintf(stderr, "PHP: %s", error_buf);
|
||||
#endif
|
||||
} else {
|
||||
zend_error(E_CORE_WARNING, error_buf);
|
||||
}
|
||||
efree(error_buf);
|
||||
}
|
||||
|
||||
|
||||
int zend_parse_ini_file(zend_file_handle *fh, zend_bool unbuffered_errors, zend_ini_parser_cb_t ini_parser_cb, void *arg)
|
||||
{
|
||||
zend_ini_parser_param ini_parser_param;
|
||||
int retval;
|
||||
CLS_FETCH();
|
||||
|
||||
ini_parser_param.ini_parser_cb = ini_parser_cb;
|
||||
ini_parser_param.arg = arg;
|
||||
|
||||
if (zend_ini_open_file_for_scanning(fh)==FAILURE) {
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
CG(ini_parser_unbuffered_errors) = unbuffered_errors;
|
||||
retval = ini_parse(&ini_parser_param);
|
||||
|
||||
zend_ini_close_file(fh);
|
||||
|
||||
if (retval==0) {
|
||||
return SUCCESS;
|
||||
} else {
|
||||
return FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
%}
|
||||
|
||||
%pure_parser
|
||||
%token TC_STRING
|
||||
%token TC_ENCAPSULATED_STRING
|
||||
%token SECTION
|
||||
%token CFG_TRUE
|
||||
%token CFG_FALSE
|
||||
%left '|' '&'
|
||||
%right '~' '!'
|
||||
|
||||
%%
|
||||
|
||||
statement_list:
|
||||
statement_list statement
|
||||
| /* empty */
|
||||
;
|
||||
|
||||
statement:
|
||||
TC_STRING '=' string_or_value {
|
||||
#if DEBUG_CFG_PARSER
|
||||
printf("'%s' = '%s'\n", $1.value.str.val, $3.value.str.val);
|
||||
#endif
|
||||
ZEND_INI_PARSER_CB(&$1, &$3, ZEND_INI_PARSER_ENTRY, ZEND_INI_PARSER_ARG);
|
||||
free($1.value.str.val);
|
||||
free($3.value.str.val);
|
||||
}
|
||||
| TC_STRING { ZEND_INI_PARSER_CB(&$1, NULL, ZEND_INI_PARSER_ENTRY, ZEND_INI_PARSER_ARG); free($1.value.str.val); }
|
||||
| SECTION { ZEND_INI_PARSER_CB(&$1, NULL, ZEND_INI_PARSER_SECTION, ZEND_INI_PARSER_ARG); free($1.value.str.val); }
|
||||
| '\n'
|
||||
;
|
||||
|
||||
|
||||
string_or_value:
|
||||
expr { $$ = $1; }
|
||||
| TC_ENCAPSULATED_STRING { $$ = $1; }
|
||||
| CFG_TRUE { $$ = $1; }
|
||||
| CFG_FALSE { $$ = $1; }
|
||||
| '\n' { $$.value.str.val = strdup(""); $$.value.str.len=0; $$.type = IS_STRING; }
|
||||
| '\0' { $$.value.str.val = strdup(""); $$.value.str.len=0; $$.type = IS_STRING; }
|
||||
;
|
||||
|
||||
expr:
|
||||
constant_string { $$ = $1; }
|
||||
| expr '|' expr { zend_ini_do_op('|', &$$, &$1, &$3); }
|
||||
| expr '&' expr { zend_ini_do_op('&', &$$, &$1, &$3); }
|
||||
| '~' expr { zend_ini_do_op('~', &$$, &$2, NULL); }
|
||||
| '!' expr { zend_ini_do_op('!', &$$, &$2, NULL); }
|
||||
| '(' expr ')' { $$ = $2; }
|
||||
;
|
||||
|
||||
constant_string:
|
||||
TC_STRING { zend_ini_get_constant(&$$, &$1); }
|
||||
;
|
||||
/*
|
||||
* Local variables:
|
||||
* tab-width: 4
|
||||
* c-basic-offset: 4
|
||||
* End:
|
||||
*/
|
||||
@@ -0,0 +1,24 @@
|
||||
#ifndef _ZEND_INI_SCANNER_H
|
||||
#define _ZEND_INI_SCANNER_H
|
||||
|
||||
#if defined(ZTS) && defined(__cplusplus)
|
||||
class ZendIniFlexLexer : public yyFlexLexer
|
||||
{
|
||||
public:
|
||||
virtual ~ZendIniFlexLexer();
|
||||
int lex_scan(zval *zendlval);
|
||||
void BeginState(int state);
|
||||
|
||||
char *filename;
|
||||
};
|
||||
#endif /* ZTS && __cplusplus */
|
||||
|
||||
BEGIN_EXTERN_C()
|
||||
int zend_ini_scanner_get_lineno();
|
||||
char *zend_ini_scanner_get_filename();
|
||||
int zend_ini_open_file_for_scanning(zend_file_handle *fh);
|
||||
void zend_ini_close_file(zend_file_handle *fh);
|
||||
int ini_lex(zval *ini_lval);
|
||||
END_EXTERN_C()
|
||||
|
||||
#endif /* _ZEND_INI_SCANNER_H */
|
||||
@@ -0,0 +1,283 @@
|
||||
%{
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 0.92 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available at through the world-wide-web at |
|
||||
| http://www.zend.com/license/0_92.txt. |
|
||||
| If you did not receive a copy of the Zend license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@zend.com so we can mail you a copy immediately. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Author: Zeev Suraski <zeev@zend.com> |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
#include "zend.h"
|
||||
#include "zend_globals.h"
|
||||
#include "zend_ini_parser.h"
|
||||
#include "zend_ini_scanner.h"
|
||||
|
||||
#ifdef ZTS
|
||||
# ifdef HAVE_STDIOSTR_H
|
||||
# include <stdiostr.h>
|
||||
# endif
|
||||
# ifdef HAVE_STDIOSTREAM_H
|
||||
# include <stdiostream.h>
|
||||
# endif
|
||||
# ifdef ZEND_WIN32
|
||||
# include <strstrea.h>
|
||||
# else
|
||||
# include <strstream.h>
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#undef YYSTYPE
|
||||
#define YYSTYPE zval
|
||||
|
||||
#ifdef ZTS
|
||||
#define YY_DECL int ZendIniFlexLexer::lex_scan(zval *ini_lval)
|
||||
#else
|
||||
#define YY_DECL int ini_lex(zval *ini_lval)
|
||||
#endif
|
||||
|
||||
#ifndef ZTS
|
||||
static char *ini_filename;
|
||||
|
||||
void init_ini_scanner()
|
||||
{
|
||||
ini_lineno=1;
|
||||
}
|
||||
|
||||
|
||||
int zend_ini_scanner_get_lineno()
|
||||
{
|
||||
return ini_lineno;
|
||||
}
|
||||
|
||||
|
||||
char *zend_ini_scanner_get_filename()
|
||||
{
|
||||
return ini_filename;
|
||||
}
|
||||
|
||||
#else /* ZTS */
|
||||
|
||||
int zend_ini_scanner_get_lineno()
|
||||
{
|
||||
CLS_FETCH();
|
||||
|
||||
return CG(ini_scanner)->lineno();
|
||||
}
|
||||
|
||||
char *zend_ini_scanner_get_filename()
|
||||
{
|
||||
CLS_FETCH();
|
||||
|
||||
return CG(ini_scanner)->filename;
|
||||
}
|
||||
|
||||
int ini_lex(zval *ini_lval)
|
||||
{
|
||||
CLS_FETCH();
|
||||
|
||||
return CG(ini_scanner)->lex_scan(ini_lval);
|
||||
}
|
||||
|
||||
ZendIniFlexLexer::~ZendIniFlexLexer()
|
||||
{
|
||||
if (yy_start_stack) {
|
||||
yy_flex_free(yy_start_stack);
|
||||
}
|
||||
}
|
||||
|
||||
int yyFlexLexer::yylex()
|
||||
{
|
||||
fprintf(stderr, "Error: yyFlexLexer::yylex() called\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
int zend_ini_open_file_for_scanning(zend_file_handle *fh)
|
||||
{
|
||||
FILE *fp;
|
||||
CLS_FETCH();
|
||||
|
||||
switch (fh->type) {
|
||||
case ZEND_HANDLE_FP:
|
||||
fp = fh->handle.fp;
|
||||
break;
|
||||
case ZEND_HANDLE_FILENAME:
|
||||
fp = zend_fopen(fh->filename, NULL);
|
||||
fh->type = ZEND_HANDLE_FP;
|
||||
break;
|
||||
default:
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
#ifdef ZTS
|
||||
if (!fp) {
|
||||
return FAILURE;
|
||||
}
|
||||
fh->handle.is = new istdiostream(fp);
|
||||
fh->type = ZEND_HANDLE_STDIOSTREAM;
|
||||
|
||||
CG(ini_scanner) = new ZendIniFlexLexer;
|
||||
CG(ini_scanner)->switch_streams(fh->handle.is, &cout);
|
||||
CG(ini_scanner)->filename = fh->filename;
|
||||
#else
|
||||
init_ini_scanner();
|
||||
yyin = fp;
|
||||
yy_switch_to_buffer(yy_create_buffer(yyin, YY_BUF_SIZE));
|
||||
ini_filename = fh->filename;
|
||||
#endif
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
void zend_ini_close_file(zend_file_handle *fh)
|
||||
{
|
||||
switch (fh->type) {
|
||||
case ZEND_HANDLE_FP:
|
||||
fclose(fh->handle.fp);
|
||||
break;
|
||||
#ifdef ZTS
|
||||
case ZEND_HANDLE_STDIOSTREAM: {
|
||||
CLS_FETCH();
|
||||
delete CG(ini_scanner);
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
%}
|
||||
|
||||
%option noyywrap
|
||||
%option yylineno
|
||||
|
||||
%%
|
||||
|
||||
|
||||
<INITIAL>[ ]*("true"|"on"|"yes")[ ]* {
|
||||
ini_lval->value.str.val = zend_strndup("1",1);
|
||||
ini_lval->value.str.len = 1;
|
||||
ini_lval->type = IS_STRING;
|
||||
return CFG_TRUE;
|
||||
}
|
||||
|
||||
|
||||
<INITIAL>[ ]*("false"|"off"|"no"|"none")[ ]* {
|
||||
ini_lval->value.str.val = zend_strndup("",0);
|
||||
ini_lval->value.str.len = 0;
|
||||
ini_lval->type = IS_STRING;
|
||||
return CFG_FALSE;
|
||||
}
|
||||
|
||||
<INITIAL>[[][^[]+[\]]([\n]?|"\r\n"?) {
|
||||
/* SECTION */
|
||||
|
||||
/* eat trailng ] */
|
||||
while (yyleng>0 && (yytext[yyleng-1]=='\n' || yytext[yyleng-1]=='\r' || yytext[yyleng-1]==']')) {
|
||||
yyleng--;
|
||||
yytext[yyleng]=0;
|
||||
}
|
||||
|
||||
/* eat leading [ */
|
||||
yytext++;
|
||||
yyleng--;
|
||||
|
||||
ini_lval->value.str.val = zend_strndup(yytext,yyleng);
|
||||
ini_lval->value.str.len = yyleng;
|
||||
ini_lval->type = IS_STRING;
|
||||
return SECTION;
|
||||
}
|
||||
|
||||
|
||||
<INITIAL>["][^\n\r"]*["] {
|
||||
/* ENCAPSULATED TC_STRING */
|
||||
|
||||
/* eat trailing " */
|
||||
yytext[yyleng-1]=0;
|
||||
|
||||
/* eat leading " */
|
||||
yytext++;
|
||||
|
||||
ini_lval->value.str.val = zend_strndup(yytext, yyleng - 2);
|
||||
ini_lval->value.str.len = yyleng - 2;
|
||||
ini_lval->type = IS_STRING;
|
||||
return TC_ENCAPSULATED_STRING;
|
||||
}
|
||||
|
||||
<INITIAL>[&|~()!] {
|
||||
return yytext[0];
|
||||
}
|
||||
|
||||
|
||||
<INITIAL>[^=\n\r\t;|&~()!"]+ {
|
||||
/* STRING */
|
||||
register int i;
|
||||
|
||||
/* eat trailing whitespace */
|
||||
for (i=yyleng-1; i>=0; i--) {
|
||||
if (yytext[i]==' ' || yytext[i]=='\t') {
|
||||
yytext[i]=0;
|
||||
yyleng--;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
/* eat leading whitespace */
|
||||
while (yytext[0]) {
|
||||
if (yytext[0]==' ' || yytext[0]=='\t') {
|
||||
yytext++;
|
||||
yyleng--;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (yyleng!=0) {
|
||||
ini_lval->value.str.val = zend_strndup(yytext,yyleng);
|
||||
ini_lval->value.str.len = yyleng;
|
||||
ini_lval->type = IS_STRING;
|
||||
return TC_STRING;
|
||||
} else {
|
||||
/* whitespace */
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
<INITIAL>[=\n] {
|
||||
return yytext[0];
|
||||
}
|
||||
|
||||
<INITIAL>"\r\n" {
|
||||
return '\n';
|
||||
}
|
||||
|
||||
<INITIAL>[;][^\r\n]*[\r\n]? {
|
||||
/* comment */
|
||||
return '\n';
|
||||
}
|
||||
|
||||
<INITIAL>[ \t] {
|
||||
/* eat whitespace */
|
||||
}
|
||||
|
||||
<INITIAL>. {
|
||||
#if DEBUG
|
||||
php_error(E_NOTICE,"Unexpected character on line %d: '%s' (ASCII %d)\n",yylineno,yytext,yytext[0]);
|
||||
#endif
|
||||
}
|
||||
|
||||
<<EOF>> {
|
||||
yy_delete_buffer(YY_CURRENT_BUFFER);
|
||||
yyterminate();
|
||||
}
|
||||
@@ -0,0 +1,726 @@
|
||||
%{
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 0.92 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available at through the world-wide-web at |
|
||||
| http://www.zend.com/license/0_92.txt. |
|
||||
| If you did not receive a copy of the Zend license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@zend.com so we can mail you a copy immediately. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Authors: Andi Gutmans <andi@zend.com> |
|
||||
| Zeev Suraski <zeev@zend.com> |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
/*
|
||||
* LALR shift/reduce conflicts and how they are resolved:
|
||||
*
|
||||
* - 2 shift/reduce conflicts due to the dangeling elseif/else ambiguity. Solved by shift.
|
||||
* - 1 shift/reduce conflict due to arrays within encapsulated strings. Solved by shift.
|
||||
* - 1 shift/reduce conflict due to objects within encapsulated strings. Solved by shift.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include "zend_compile.h"
|
||||
#include "zend.h"
|
||||
#include "zend_list.h"
|
||||
#include "zend_globals.h"
|
||||
#include "zend_API.h"
|
||||
|
||||
#define YYERROR_VERBOSE
|
||||
#define YYSTYPE znode
|
||||
#ifdef ZTS
|
||||
# define YYPARSE_PARAM compiler_globals
|
||||
# define YYLEX_PARAM compiler_globals
|
||||
#endif
|
||||
|
||||
|
||||
%}
|
||||
|
||||
%pure_parser
|
||||
%expect 4
|
||||
|
||||
%left T_INCLUDE T_INCLUDE_ONCE T_EVAL T_REQUIRE T_REQUIRE_ONCE
|
||||
%left ','
|
||||
%left T_LOGICAL_OR
|
||||
%left T_LOGICAL_XOR
|
||||
%left T_LOGICAL_AND
|
||||
%right T_PRINT
|
||||
%left '=' T_PLUS_EQUAL T_MINUS_EQUAL T_MUL_EQUAL T_DIV_EQUAL T_CONCAT_EQUAL T_MOD_EQUAL T_AND_EQUAL T_OR_EQUAL T_XOR_EQUAL T_SL_EQUAL T_SR_EQUAL
|
||||
%left '?' ':'
|
||||
%left T_BOOLEAN_OR
|
||||
%left T_BOOLEAN_AND
|
||||
%left '|'
|
||||
%left '^'
|
||||
%left '&'
|
||||
%nonassoc T_IS_EQUAL T_IS_NOT_EQUAL T_IS_IDENTICAL T_IS_NOT_IDENTICAL
|
||||
%nonassoc '<' T_IS_SMALLER_OR_EQUAL '>' T_IS_GREATER_OR_EQUAL
|
||||
%left T_SL T_SR
|
||||
%left '+' '-' '.'
|
||||
%left '*' '/' '%'
|
||||
%right '!' '~' T_INC T_DEC T_INT_CAST T_DOUBLE_CAST T_STRING_CAST T_ARRAY_CAST T_OBJECT_CAST T_BOOL_CAST T_UNSET_CAST '@'
|
||||
%right '['
|
||||
%nonassoc T_NEW
|
||||
%token T_EXIT
|
||||
%token T_IF
|
||||
%left T_ELSEIF
|
||||
%left T_ELSE
|
||||
%left T_ENDIF
|
||||
%token T_LNUMBER
|
||||
%token T_DNUMBER
|
||||
%token T_STRING
|
||||
%token T_STRING_VARNAME
|
||||
%token T_VARIABLE
|
||||
%token T_NUM_STRING
|
||||
%token T_INLINE_HTML
|
||||
%token T_CHARACTER
|
||||
%token T_BAD_CHARACTER
|
||||
%token T_ENCAPSED_AND_WHITESPACE
|
||||
%token T_CONSTANT_ENCAPSED_STRING
|
||||
%token T_ECHO
|
||||
%token T_DO
|
||||
%token T_WHILE
|
||||
%token T_ENDWHILE
|
||||
%token T_FOR
|
||||
%token T_ENDFOR
|
||||
%token T_FOREACH
|
||||
%token T_ENDFOREACH
|
||||
%token T_DECLARE
|
||||
%token T_ENDDECLARE
|
||||
%token T_AS
|
||||
%token T_SWITCH
|
||||
%token T_ENDSWITCH
|
||||
%token T_CASE
|
||||
%token T_DEFAULT
|
||||
%token T_BREAK
|
||||
%token T_CONTINUE
|
||||
%token T_OLD_FUNCTION
|
||||
%token T_FUNCTION
|
||||
%token T_CONST
|
||||
%token T_RETURN
|
||||
%token T_USE
|
||||
%token T_GLOBAL
|
||||
%token T_STATIC
|
||||
%token T_VAR
|
||||
%token T_UNSET
|
||||
%token T_ISSET
|
||||
%token T_EMPTY
|
||||
%token T_CLASS
|
||||
%token T_EXTENDS
|
||||
%token T_OBJECT_OPERATOR
|
||||
%token T_DOUBLE_ARROW
|
||||
%token T_LIST
|
||||
%token T_ARRAY
|
||||
%token T_LINE
|
||||
%token T_FILE
|
||||
%token T_COMMENT
|
||||
%token T_ML_COMMENT
|
||||
%token T_OPEN_TAG
|
||||
%token T_OPEN_TAG_WITH_ECHO
|
||||
%token T_CLOSE_TAG
|
||||
%token T_WHITESPACE
|
||||
%token T_START_HEREDOC
|
||||
%token T_END_HEREDOC
|
||||
%token T_DOLLAR_OPEN_CURLY_BRACES
|
||||
%token T_CURLY_OPEN
|
||||
%token T_PAAMAYIM_NEKUDOTAYIM
|
||||
|
||||
%% /* Rules */
|
||||
|
||||
start:
|
||||
top_statement_list
|
||||
;
|
||||
|
||||
top_statement_list:
|
||||
top_statement_list { zend_do_extended_info(CLS_C); } top_statement { HANDLE_INTERACTIVE(); }
|
||||
| /* empty */
|
||||
;
|
||||
|
||||
|
||||
top_statement:
|
||||
statement
|
||||
| declaration_statement { zend_do_early_binding(CLS_C); }
|
||||
;
|
||||
|
||||
|
||||
inner_statement_list:
|
||||
inner_statement_list { zend_do_extended_info(CLS_C); } inner_statement { HANDLE_INTERACTIVE(); }
|
||||
| /* empty */
|
||||
;
|
||||
|
||||
|
||||
inner_statement:
|
||||
statement
|
||||
| declaration_statement
|
||||
;
|
||||
|
||||
|
||||
statement:
|
||||
unticked_statement { zend_do_ticks(CLS_C); }
|
||||
;
|
||||
|
||||
|
||||
unticked_statement:
|
||||
'{' inner_statement_list '}'
|
||||
| T_IF '(' expr ')' { zend_do_if_cond(&$3, &$4 CLS_CC); } statement { zend_do_if_after_statement(&$4, 1 CLS_CC); } elseif_list else_single { zend_do_if_end(CLS_C); }
|
||||
| T_IF '(' expr ')' ':' { zend_do_if_cond(&$3, &$4 CLS_CC); } inner_statement_list { zend_do_if_after_statement(&$4, 1 CLS_CC); } new_elseif_list new_else_single T_ENDIF ';' { zend_do_if_end(CLS_C); }
|
||||
| T_WHILE '(' { $1.u.opline_num = get_next_op_number(CG(active_op_array)); } expr ')' { zend_do_while_cond(&$4, &$5 CLS_CC); } while_statement { zend_do_while_end(&$1, &$5 CLS_CC); }
|
||||
| T_DO { $1.u.opline_num = get_next_op_number(CG(active_op_array)); zend_do_do_while_begin(CLS_C); } statement T_WHILE '(' { $5.u.opline_num = get_next_op_number(CG(active_op_array)); } expr ')' ';' { zend_do_do_while_end(&$1, &$5, &$7 CLS_CC); }
|
||||
| T_FOR
|
||||
'('
|
||||
for_expr
|
||||
';' { zend_do_free(&$3 CLS_CC); $4.u.opline_num = get_next_op_number(CG(active_op_array)); }
|
||||
for_expr
|
||||
';' { zend_do_extended_info(CLS_C); zend_do_for_cond(&$6, &$7 CLS_CC); }
|
||||
for_expr
|
||||
')' { zend_do_free(&$9 CLS_CC); zend_do_for_before_statement(&$4, &$7 CLS_CC); }
|
||||
for_statement { zend_do_for_end(&$7 CLS_CC); }
|
||||
| T_SWITCH '(' expr ')' { zend_do_switch_cond(&$3 CLS_CC); } switch_case_list { zend_do_switch_end(&$6 CLS_CC); }
|
||||
| T_BREAK ';' { zend_do_brk_cont(ZEND_BRK, NULL CLS_CC); }
|
||||
| T_BREAK expr ';' { zend_do_brk_cont(ZEND_BRK, &$2 CLS_CC); }
|
||||
| T_CONTINUE ';' { zend_do_brk_cont(ZEND_CONT, NULL CLS_CC); }
|
||||
| T_CONTINUE expr ';' { zend_do_brk_cont(ZEND_CONT, &$2 CLS_CC); }
|
||||
| T_RETURN ';' { zend_do_return(NULL, 0 CLS_CC); }
|
||||
| T_RETURN expr_without_variable ';' { zend_do_return(&$2, 0 CLS_CC); }
|
||||
| T_RETURN cvar ';' { zend_do_return(&$2, 1 CLS_CC); }
|
||||
| T_GLOBAL global_var_list ';'
|
||||
| T_STATIC static_var_list ';'
|
||||
| T_ECHO echo_expr_list ';'
|
||||
| T_INLINE_HTML { zend_do_echo(&$1 CLS_CC); }
|
||||
| expr ';' { zend_do_free(&$1 CLS_CC); }
|
||||
| T_USE use_filename ';' { zend_error(E_COMPILE_ERROR,"use: Not yet supported. Please use include_once() or require_once()"); zval_dtor(&$2.u.constant); }
|
||||
| T_UNSET '(' unset_variables ')' ';'
|
||||
| T_FOREACH '(' w_cvar T_AS { zend_do_foreach_begin(&$1, &$3, &$2, &$4, 1 CLS_CC); } w_cvar foreach_optional_arg ')' { zend_do_foreach_cont(&$6, &$7, &$4 CLS_CC); } foreach_statement { zend_do_foreach_end(&$1, &$2 CLS_CC); }
|
||||
| T_FOREACH '(' expr_without_variable T_AS { zend_do_foreach_begin(&$1, &$3, &$2, &$4, 0 CLS_CC); } w_cvar foreach_optional_arg ')' { zend_do_foreach_cont(&$6, &$7, &$4 CLS_CC); } foreach_statement { zend_do_foreach_end(&$1, &$2 CLS_CC); }
|
||||
| T_DECLARE { zend_do_declare_begin(CLS_C); } '(' declare_list ')' declare_statement { zend_do_declare_end(CLS_C); }
|
||||
| ';' /* empty statement */
|
||||
;
|
||||
|
||||
unset_variables:
|
||||
unset_variable
|
||||
| unset_variables ',' unset_variable
|
||||
;
|
||||
|
||||
unset_variable:
|
||||
cvar { zend_do_end_variable_parse(BP_VAR_UNSET, 0 CLS_CC); zend_do_unset(&$1 CLS_CC); }
|
||||
;
|
||||
|
||||
use_filename:
|
||||
T_CONSTANT_ENCAPSED_STRING { $$ = $1; }
|
||||
| '(' T_CONSTANT_ENCAPSED_STRING ')' { $$ = $2; }
|
||||
;
|
||||
|
||||
|
||||
declaration_statement:
|
||||
unticked_declaration_statement { zend_do_ticks(CLS_C); }
|
||||
;
|
||||
|
||||
|
||||
unticked_declaration_statement:
|
||||
T_FUNCTION { $1.u.opline_num = CG(zend_lineno); } is_reference T_STRING { zend_do_begin_function_declaration(&$1, &$4, 0, $3.op_type CLS_CC); }
|
||||
'(' parameter_list ')' '{' inner_statement_list '}' { zend_do_end_function_declaration(&$1 CLS_CC); }
|
||||
| T_OLD_FUNCTION { $1.u.opline_num = CG(zend_lineno); } is_reference T_STRING { zend_do_begin_function_declaration(&$1, &$4, 0, $3.op_type CLS_CC); }
|
||||
parameter_list '(' inner_statement_list ')' ';' { zend_do_end_function_declaration(&$1 CLS_CC); }
|
||||
| T_CLASS T_STRING { zend_do_begin_class_declaration(&$2, NULL CLS_CC); } '{' class_statement_list '}' { zend_do_end_class_declaration(CLS_C); }
|
||||
| T_CLASS T_STRING T_EXTENDS T_STRING { zend_do_begin_class_declaration(&$2, &$4 CLS_CC); } '{' class_statement_list '}' { zend_do_end_class_declaration(CLS_C); }
|
||||
;
|
||||
|
||||
|
||||
foreach_optional_arg:
|
||||
/* empty */ { $$.op_type = IS_UNUSED; }
|
||||
| T_DOUBLE_ARROW w_cvar { $$ = $2; }
|
||||
;
|
||||
|
||||
|
||||
for_statement:
|
||||
statement
|
||||
| ':' inner_statement_list T_ENDFOR ';'
|
||||
;
|
||||
|
||||
|
||||
foreach_statement:
|
||||
statement
|
||||
| ':' inner_statement_list T_ENDFOREACH ';'
|
||||
;
|
||||
|
||||
|
||||
declare_statement:
|
||||
statement
|
||||
| ':' inner_statement_list T_ENDDECLARE ';'
|
||||
;
|
||||
|
||||
|
||||
declare_list:
|
||||
T_STRING '=' static_scalar { zend_do_declare_stmt(&$1, &$3 CLS_CC); }
|
||||
| declare_list ',' T_STRING '=' static_scalar { zend_do_declare_stmt(&$3, &$5 CLS_CC); }
|
||||
;
|
||||
|
||||
|
||||
switch_case_list:
|
||||
'{' case_list '}' { $$ = $2; }
|
||||
| '{' ';' case_list '}' { $$ = $3; }
|
||||
| ':' case_list T_ENDSWITCH ';' { $$ = $2; }
|
||||
| ':' ';' case_list T_ENDSWITCH ';' { $$ = $3; }
|
||||
;
|
||||
|
||||
|
||||
case_list:
|
||||
/* empty */ { $$.op_type = IS_UNUSED; }
|
||||
| case_list T_CASE expr case_separator { zend_do_extended_info(CLS_C); zend_do_case_before_statement(&$1, &$2, &$3 CLS_CC); } inner_statement_list { zend_do_case_after_statement(&$$, &$2 CLS_CC); $$.op_type = IS_CONST }
|
||||
| case_list T_DEFAULT case_separator { zend_do_extended_info(CLS_C); zend_do_default_before_statement(&$1, &$2 CLS_CC); } inner_statement_list { zend_do_case_after_statement(&$$, &$2 CLS_CC); $$.op_type = IS_CONST; }
|
||||
;
|
||||
|
||||
|
||||
case_separator:
|
||||
':'
|
||||
| ';'
|
||||
;
|
||||
|
||||
|
||||
while_statement:
|
||||
statement
|
||||
| ':' inner_statement_list T_ENDWHILE ';'
|
||||
;
|
||||
|
||||
|
||||
|
||||
elseif_list:
|
||||
/* empty */
|
||||
| elseif_list T_ELSEIF '(' expr ')' { zend_do_if_cond(&$4, &$5 CLS_CC); } statement { zend_do_if_after_statement(&$5, 0 CLS_CC); }
|
||||
;
|
||||
|
||||
|
||||
new_elseif_list:
|
||||
/* empty */
|
||||
| new_elseif_list T_ELSEIF '(' expr ')' ':' { zend_do_if_cond(&$4, &$5 CLS_CC); } inner_statement_list { zend_do_if_after_statement(&$5, 0 CLS_CC); }
|
||||
;
|
||||
|
||||
|
||||
else_single:
|
||||
/* empty */
|
||||
| T_ELSE statement
|
||||
;
|
||||
|
||||
|
||||
new_else_single:
|
||||
/* empty */
|
||||
| T_ELSE ':' inner_statement_list
|
||||
;
|
||||
|
||||
|
||||
parameter_list:
|
||||
non_empty_parameter_list
|
||||
| /* empty */
|
||||
;
|
||||
|
||||
|
||||
non_empty_parameter_list:
|
||||
T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$1, 0 CLS_CC); $$.op_type = IS_CONST; $$.u.constant.value.lval=1; $$.u.constant.type=IS_LONG; INIT_PZVAL(&$$.u.constant); zend_do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, BYREF_NONE CLS_CC); }
|
||||
| '&' T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$2, 0 CLS_CC); $$.op_type = IS_CONST; $$.u.constant.value.lval=1; $$.u.constant.type=IS_LONG; INIT_PZVAL(&$$.u.constant); zend_do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, BYREF_FORCE CLS_CC); }
|
||||
| T_CONST T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$2, 0 CLS_CC); $$.op_type = IS_CONST; $$.u.constant.value.lval=1; $$.u.constant.type=IS_LONG; INIT_PZVAL(&$$.u.constant); zend_do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, BYREF_NONE CLS_CC); }
|
||||
| T_VARIABLE '=' static_scalar { znode tmp; fetch_simple_variable(&tmp, &$1, 0 CLS_CC); $$.op_type = IS_CONST; $$.u.constant.value.lval=1; $$.u.constant.type=IS_LONG; INIT_PZVAL(&$$.u.constant); zend_do_receive_arg(ZEND_RECV_INIT, &tmp, &$$, &$3, BYREF_NONE CLS_CC); }
|
||||
| non_empty_parameter_list ',' T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$3, 0 CLS_CC); $$=$1; $$.u.constant.value.lval++; zend_do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, BYREF_NONE CLS_CC); }
|
||||
| non_empty_parameter_list ',' '&' T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$4, 0 CLS_CC); $$=$1; $$.u.constant.value.lval++; zend_do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, BYREF_FORCE CLS_CC); }
|
||||
| non_empty_parameter_list ',' T_CONST T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$4, 0 CLS_CC); $$=$1; $$.u.constant.value.lval++; zend_do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, BYREF_NONE CLS_CC); }
|
||||
| non_empty_parameter_list ',' T_VARIABLE '=' static_scalar { znode tmp; fetch_simple_variable(&tmp, &$3, 0 CLS_CC); $$=$1; $$.u.constant.value.lval++; zend_do_receive_arg(ZEND_RECV_INIT, &tmp, &$$, &$5, BYREF_NONE CLS_CC); }
|
||||
;
|
||||
|
||||
|
||||
function_call_parameter_list:
|
||||
non_empty_function_call_parameter_list { $$ = $1; }
|
||||
| /* empty */ { $$.u.constant.value.lval = 0; }
|
||||
;
|
||||
|
||||
|
||||
non_empty_function_call_parameter_list:
|
||||
expr_without_variable { $$.u.constant.value.lval = 1; zend_do_pass_param(&$1, ZEND_SEND_VAL, $$.u.constant.value.lval CLS_CC); }
|
||||
| cvar { $$.u.constant.value.lval = 1; zend_do_pass_param(&$1, ZEND_SEND_VAR, $$.u.constant.value.lval CLS_CC); }
|
||||
| '&' w_cvar { $$.u.constant.value.lval = 1; zend_do_pass_param(&$2, ZEND_SEND_REF, $$.u.constant.value.lval CLS_CC); }
|
||||
| non_empty_function_call_parameter_list ',' expr_without_variable { $$.u.constant.value.lval=$1.u.constant.value.lval+1; zend_do_pass_param(&$3, ZEND_SEND_VAL, $$.u.constant.value.lval CLS_CC); }
|
||||
| non_empty_function_call_parameter_list ',' cvar { $$.u.constant.value.lval=$1.u.constant.value.lval+1; zend_do_pass_param(&$3, ZEND_SEND_VAR, $$.u.constant.value.lval CLS_CC); }
|
||||
| non_empty_function_call_parameter_list ',' '&' w_cvar { $$.u.constant.value.lval=$1.u.constant.value.lval+1; zend_do_pass_param(&$4, ZEND_SEND_REF, $$.u.constant.value.lval CLS_CC); }
|
||||
;
|
||||
|
||||
global_var_list:
|
||||
global_var_list ',' global_var { zend_do_fetch_global_or_static_variable(&$3, NULL, ZEND_FETCH_GLOBAL CLS_CC); }
|
||||
| global_var { zend_do_fetch_global_or_static_variable(&$1, NULL, ZEND_FETCH_GLOBAL CLS_CC); }
|
||||
;
|
||||
|
||||
|
||||
global_var:
|
||||
T_VARIABLE { $$ = $1; }
|
||||
| '$' r_cvar { $$ = $2; }
|
||||
| '$' '{' expr '}' { $$ = $3; }
|
||||
;
|
||||
|
||||
|
||||
static_var_list:
|
||||
static_var_list ',' T_VARIABLE { zend_do_fetch_global_or_static_variable(&$3, NULL, ZEND_FETCH_STATIC CLS_CC); }
|
||||
| static_var_list ',' T_VARIABLE '=' static_scalar { zend_do_fetch_global_or_static_variable(&$3, &$5, ZEND_FETCH_STATIC CLS_CC); }
|
||||
| T_VARIABLE { zend_do_fetch_global_or_static_variable(&$1, NULL, ZEND_FETCH_STATIC CLS_CC); }
|
||||
| T_VARIABLE '=' static_scalar { zend_do_fetch_global_or_static_variable(&$1, &$3, ZEND_FETCH_STATIC CLS_CC); }
|
||||
|
||||
;
|
||||
|
||||
|
||||
class_statement_list:
|
||||
class_statement_list class_statement
|
||||
| /* empty */
|
||||
;
|
||||
|
||||
|
||||
class_statement:
|
||||
T_VAR class_variable_decleration ';'
|
||||
| T_FUNCTION { $1.u.opline_num = CG(zend_lineno); } is_reference T_STRING { zend_do_begin_function_declaration(&$1, &$4, 1, $3.op_type CLS_CC); } '('
|
||||
parameter_list ')' '{' inner_statement_list '}' { zend_do_end_function_declaration(&$1 CLS_CC); }
|
||||
| T_OLD_FUNCTION { $1.u.opline_num = CG(zend_lineno); } is_reference T_STRING { zend_do_begin_function_declaration(&$1, &$4, 1, $3.op_type CLS_CC); }
|
||||
parameter_list '(' inner_statement_list ')' ';' { zend_do_end_function_declaration(&$1 CLS_CC); }
|
||||
|
||||
;
|
||||
|
||||
is_reference:
|
||||
/* empty */ { $$.op_type = ZEND_RETURN_VAL; }
|
||||
| '&' { $$.op_type = ZEND_RETURN_REF; }
|
||||
|
||||
class_variable_decleration:
|
||||
class_variable_decleration ',' T_VARIABLE { zend_do_declare_property(&$3, NULL CLS_CC); }
|
||||
| class_variable_decleration ',' T_VARIABLE '=' static_scalar { zend_do_declare_property(&$3, &$5 CLS_CC); }
|
||||
| T_VARIABLE { zend_do_declare_property(&$1, NULL CLS_CC); }
|
||||
| T_VARIABLE '=' static_scalar { zend_do_declare_property(&$1, &$3 CLS_CC); }
|
||||
;
|
||||
|
||||
|
||||
echo_expr_list:
|
||||
| echo_expr_list ',' expr { zend_do_echo(&$3 CLS_CC); }
|
||||
| expr { zend_do_echo(&$1 CLS_CC); }
|
||||
;
|
||||
|
||||
|
||||
for_expr:
|
||||
/* empty */ { $$.op_type = IS_CONST; $$.u.constant.type = IS_BOOL; $$.u.constant.value.lval = 1; }
|
||||
| non_empty_for_expr { $$ = $1; }
|
||||
;
|
||||
|
||||
non_empty_for_expr:
|
||||
non_empty_for_expr ',' { zend_do_free(&$1 CLS_CC); } expr { $$ = $4; }
|
||||
| expr { $$ = $1; }
|
||||
;
|
||||
|
||||
|
||||
expr_without_variable:
|
||||
T_LIST '(' { zend_do_list_init(CLS_C); } assignment_list ')' '=' expr { zend_do_list_end(&$$, &$7 CLS_CC); }
|
||||
| cvar '=' expr { zend_do_end_variable_parse(BP_VAR_W, 0 CLS_CC); zend_do_assign(&$$, &$1, &$3 CLS_CC); }
|
||||
| cvar '=' '&' w_cvar { zend_do_end_variable_parse(BP_VAR_W, 0 CLS_CC); zend_do_assign_ref(&$$, &$1, &$4 CLS_CC); }
|
||||
| cvar '=' '&' function_call { zend_do_end_variable_parse(BP_VAR_W, 0 CLS_CC); zend_do_assign_ref(&$$, &$1, &$4 CLS_CC); }
|
||||
| cvar '=' '&' T_NEW class_name { zend_do_extended_fcall_begin(CLS_C); zend_do_begin_new_object(&$4, &$5 CLS_CC); } ctor_arguments { zend_do_end_new_object(&$3, &$5, &$4, &$7 CLS_CC); zend_do_extended_fcall_end(CLS_C); zend_do_end_variable_parse(BP_VAR_W, 0 CLS_CC); zend_do_assign_ref(&$$, &$1, &$3 CLS_CC); }
|
||||
| T_NEW class_name { zend_do_extended_fcall_begin(CLS_C); zend_do_begin_new_object(&$1, &$2 CLS_CC); } ctor_arguments { zend_do_end_new_object(&$$, &$2, &$1, &$4 CLS_CC); zend_do_extended_fcall_end(CLS_C);}
|
||||
| cvar T_PLUS_EQUAL expr { zend_do_end_variable_parse(BP_VAR_RW, 0 CLS_CC); zend_do_binary_assign_op(ZEND_ASSIGN_ADD, &$$, &$1, &$3 CLS_CC); }
|
||||
| cvar T_MINUS_EQUAL expr { zend_do_end_variable_parse(BP_VAR_RW, 0 CLS_CC); zend_do_binary_assign_op(ZEND_ASSIGN_SUB, &$$, &$1, &$3 CLS_CC); }
|
||||
| cvar T_MUL_EQUAL expr { zend_do_end_variable_parse(BP_VAR_RW, 0 CLS_CC); zend_do_binary_assign_op(ZEND_ASSIGN_MUL, &$$, &$1, &$3 CLS_CC); }
|
||||
| cvar T_DIV_EQUAL expr { zend_do_end_variable_parse(BP_VAR_RW, 0 CLS_CC); zend_do_binary_assign_op(ZEND_ASSIGN_DIV, &$$, &$1, &$3 CLS_CC); }
|
||||
| cvar T_CONCAT_EQUAL expr { zend_do_end_variable_parse(BP_VAR_RW, 0 CLS_CC); zend_do_binary_assign_op(ZEND_ASSIGN_CONCAT, &$$, &$1, &$3 CLS_CC); }
|
||||
| cvar T_MOD_EQUAL expr { zend_do_end_variable_parse(BP_VAR_RW, 0 CLS_CC); zend_do_binary_assign_op(ZEND_ASSIGN_MOD, &$$, &$1, &$3 CLS_CC); }
|
||||
| cvar T_AND_EQUAL expr { zend_do_end_variable_parse(BP_VAR_RW, 0 CLS_CC); zend_do_binary_assign_op(ZEND_ASSIGN_BW_AND, &$$, &$1, &$3 CLS_CC); }
|
||||
| cvar T_OR_EQUAL expr { zend_do_end_variable_parse(BP_VAR_RW, 0 CLS_CC); zend_do_binary_assign_op(ZEND_ASSIGN_BW_OR, &$$, &$1, &$3 CLS_CC); }
|
||||
| cvar T_XOR_EQUAL expr { zend_do_end_variable_parse(BP_VAR_RW, 0 CLS_CC); zend_do_binary_assign_op(ZEND_ASSIGN_BW_XOR, &$$, &$1, &$3 CLS_CC); }
|
||||
| cvar T_SL_EQUAL expr { zend_do_end_variable_parse(BP_VAR_RW, 0 CLS_CC); zend_do_binary_assign_op(ZEND_ASSIGN_SL, &$$, &$1, &$3 CLS_CC); }
|
||||
| cvar T_SR_EQUAL expr { zend_do_end_variable_parse(BP_VAR_RW, 0 CLS_CC); zend_do_binary_assign_op(ZEND_ASSIGN_SR, &$$, &$1, &$3 CLS_CC); }
|
||||
| rw_cvar T_INC { zend_do_post_incdec(&$$, &$1, ZEND_POST_INC CLS_CC); }
|
||||
| T_INC rw_cvar { zend_do_pre_incdec(&$$, &$2, ZEND_PRE_INC CLS_CC); }
|
||||
| rw_cvar T_DEC { zend_do_post_incdec(&$$, &$1, ZEND_POST_DEC CLS_CC); }
|
||||
| T_DEC rw_cvar { zend_do_pre_incdec(&$$, &$2, ZEND_PRE_DEC CLS_CC); }
|
||||
| expr T_BOOLEAN_OR { zend_do_boolean_or_begin(&$1, &$2 CLS_CC); } expr { zend_do_boolean_or_end(&$$, &$1, &$4, &$2 CLS_CC); }
|
||||
| expr T_BOOLEAN_AND { zend_do_boolean_and_begin(&$1, &$2 CLS_CC); } expr { zend_do_boolean_and_end(&$$, &$1, &$4, &$2 CLS_CC); }
|
||||
| expr T_LOGICAL_OR { zend_do_boolean_or_begin(&$1, &$2 CLS_CC); } expr { zend_do_boolean_or_end(&$$, &$1, &$4, &$2 CLS_CC); }
|
||||
| expr T_LOGICAL_AND { zend_do_boolean_and_begin(&$1, &$2 CLS_CC); } expr { zend_do_boolean_and_end(&$$, &$1, &$4, &$2 CLS_CC); }
|
||||
| expr T_LOGICAL_XOR expr { zend_do_binary_op(ZEND_BOOL_XOR, &$$, &$1, &$3 CLS_CC); }
|
||||
| expr '|' expr { zend_do_binary_op(ZEND_BW_OR, &$$, &$1, &$3 CLS_CC); }
|
||||
| expr '&' expr { zend_do_binary_op(ZEND_BW_AND, &$$, &$1, &$3 CLS_CC); }
|
||||
| expr '^' expr { zend_do_binary_op(ZEND_BW_XOR, &$$, &$1, &$3 CLS_CC); }
|
||||
| expr '.' expr { zend_do_binary_op(ZEND_CONCAT,&$$,&$1,&$3 CLS_CC); }
|
||||
| expr '+' expr { zend_do_binary_op(ZEND_ADD,&$$,&$1,&$3 CLS_CC); }
|
||||
| expr '-' expr { zend_do_binary_op(ZEND_SUB,&$$,&$1,&$3 CLS_CC); }
|
||||
| expr '*' expr { zend_do_binary_op(ZEND_MUL,&$$,&$1,&$3 CLS_CC); }
|
||||
| expr '/' expr { zend_do_binary_op(ZEND_DIV,&$$,&$1,&$3 CLS_CC); }
|
||||
| expr '%' expr { zend_do_binary_op(ZEND_MOD,&$$,&$1,&$3 CLS_CC); }
|
||||
| expr T_SL expr { zend_do_binary_op(ZEND_SL, &$$, &$1, &$3 CLS_CC); }
|
||||
| expr T_SR expr { zend_do_binary_op(ZEND_SR, &$$, &$1, &$3 CLS_CC); }
|
||||
| '+' expr { $1.u.constant.value.lval=0; $1.u.constant.type=IS_LONG; $1.op_type = IS_CONST; INIT_PZVAL(&$1.u.constant); zend_do_binary_op(ZEND_ADD, &$$, &$1, &$2 CLS_CC); }
|
||||
| '-' expr { $1.u.constant.value.lval=0; $1.u.constant.type=IS_LONG; $1.op_type = IS_CONST; INIT_PZVAL(&$1.u.constant); zend_do_binary_op(ZEND_SUB, &$$, &$1, &$2 CLS_CC); }
|
||||
| '!' expr { zend_do_unary_op(ZEND_BOOL_NOT, &$$, &$2 CLS_CC); }
|
||||
| '~' expr { zend_do_unary_op(ZEND_BW_NOT, &$$, &$2 CLS_CC); }
|
||||
| expr T_IS_IDENTICAL expr { zend_do_binary_op(ZEND_IS_IDENTICAL, &$$, &$1, &$3 CLS_CC); }
|
||||
| expr T_IS_NOT_IDENTICAL expr { zend_do_binary_op(ZEND_IS_NOT_IDENTICAL, &$$, &$1, &$3 CLS_CC); }
|
||||
| expr T_IS_EQUAL expr { zend_do_binary_op(ZEND_IS_EQUAL, &$$, &$1, &$3 CLS_CC); }
|
||||
| expr T_IS_NOT_EQUAL expr { zend_do_binary_op(ZEND_IS_NOT_EQUAL, &$$, &$1, &$3 CLS_CC); }
|
||||
| expr '<' expr { zend_do_binary_op(ZEND_IS_SMALLER, &$$, &$1, &$3 CLS_CC); }
|
||||
| expr T_IS_SMALLER_OR_EQUAL expr { zend_do_binary_op(ZEND_IS_SMALLER_OR_EQUAL, &$$, &$1, &$3 CLS_CC); }
|
||||
| expr '>' expr { zend_do_binary_op(ZEND_IS_SMALLER, &$$, &$3, &$1 CLS_CC); }
|
||||
| expr T_IS_GREATER_OR_EQUAL expr { zend_do_binary_op(ZEND_IS_SMALLER_OR_EQUAL, &$$, &$3, &$1 CLS_CC); }
|
||||
| '(' expr ')' { $$ = $2; }
|
||||
| expr '?' { zend_do_begin_qm_op(&$1, &$2 CLS_CC); }
|
||||
expr ':' { zend_do_qm_true(&$4, &$2, &$5 CLS_CC); }
|
||||
expr { zend_do_qm_false(&$$, &$7, &$2, &$5 CLS_CC); }
|
||||
| function_call { $$ = $1; }
|
||||
| internal_functions_in_yacc { $$ = $1; }
|
||||
| T_INT_CAST expr { zend_do_cast(&$$, &$2, IS_LONG CLS_CC); }
|
||||
| T_DOUBLE_CAST expr { zend_do_cast(&$$, &$2, IS_DOUBLE CLS_CC); }
|
||||
| T_STRING_CAST expr { zend_do_cast(&$$, &$2, IS_STRING CLS_CC); }
|
||||
| T_ARRAY_CAST expr { zend_do_cast(&$$, &$2, IS_ARRAY CLS_CC); }
|
||||
| T_OBJECT_CAST expr { zend_do_cast(&$$, &$2, IS_OBJECT CLS_CC); }
|
||||
| T_BOOL_CAST expr { zend_do_cast(&$$, &$2, IS_BOOL CLS_CC); }
|
||||
| T_UNSET_CAST expr { zend_do_cast(&$$, &$2, IS_NULL CLS_CC); }
|
||||
| T_EXIT exit_expr { zend_do_exit(&$$, &$2 CLS_CC); }
|
||||
| '@' { zend_do_begin_silence(&$1 CLS_CC); } expr { zend_do_end_silence(&$1 CLS_CC); $$ = $3; }
|
||||
| scalar { $$ = $1; }
|
||||
| T_ARRAY '(' array_pair_list ')' { $$ = $3; }
|
||||
| '`' encaps_list '`' { zend_do_shell_exec(&$$, &$2 CLS_CC); }
|
||||
| T_PRINT expr { zend_do_print(&$$, &$2 CLS_CC); }
|
||||
;
|
||||
|
||||
function_call:
|
||||
T_STRING '(' { $2.u.opline_num = zend_do_begin_function_call(&$1 CLS_CC); }
|
||||
function_call_parameter_list
|
||||
')' { zend_do_end_function_call(&$1, &$$, &$4, 0, $2.u.opline_num CLS_CC); zend_do_extended_fcall_end(CLS_C); }
|
||||
| cvar '(' { zend_do_begin_dynamic_function_call(&$1 CLS_CC); }
|
||||
function_call_parameter_list
|
||||
')' { zend_do_end_function_call(&$1, &$$, &$4, 0, 1 CLS_CC); zend_do_extended_fcall_end(CLS_C);}
|
||||
| T_STRING T_PAAMAYIM_NEKUDOTAYIM T_STRING '(' { zend_do_extended_fcall_begin(CLS_C); zend_do_begin_class_member_function_call(&$1, &$3 CLS_CC); }
|
||||
function_call_parameter_list
|
||||
')' { zend_do_end_function_call(&$3, &$$, &$6, 1, 1 CLS_CC); zend_do_extended_fcall_end(CLS_C);}
|
||||
;
|
||||
|
||||
|
||||
exit_expr:
|
||||
/* empty */ { memset(&$$, 0, sizeof(znode)); $$.op_type = IS_UNUSED; }
|
||||
| '(' ')' { memset(&$$, 0, sizeof(znode)); $$.op_type = IS_UNUSED; }
|
||||
| '(' expr ')' { $$ = $2; }
|
||||
;
|
||||
|
||||
|
||||
ctor_arguments:
|
||||
/* empty */ { $$.u.constant.value.lval=0; }
|
||||
| '(' function_call_parameter_list ')' { $$ = $2; }
|
||||
;
|
||||
|
||||
|
||||
class_name:
|
||||
T_STRING { $$ = $1; }
|
||||
| r_cvar { $$ = $1; }
|
||||
;
|
||||
|
||||
|
||||
|
||||
common_scalar:
|
||||
T_LNUMBER { $$ = $1; }
|
||||
| T_DNUMBER { $$ = $1; }
|
||||
| T_CONSTANT_ENCAPSED_STRING { $$ = $1; }
|
||||
| T_LINE { $$ = $1; }
|
||||
| T_FILE { $$ = $1; }
|
||||
;
|
||||
|
||||
|
||||
static_scalar: /* compile-time evaluated scalars */
|
||||
common_scalar { $$ = $1; }
|
||||
| T_STRING { zend_do_fetch_constant(&$$, &$1, ZEND_CT CLS_CC); }
|
||||
| '+' static_scalar { $$ = $1; }
|
||||
| '-' static_scalar { zval minus_one; minus_one.type = IS_LONG; minus_one.value.lval = -1; mul_function(&$2.u.constant, &$2.u.constant, &minus_one); $$ = $2; }
|
||||
| T_ARRAY '(' static_array_pair_list ')' { $$ = $3; $$.u.constant.type = IS_CONSTANT_ARRAY; }
|
||||
;
|
||||
|
||||
|
||||
scalar:
|
||||
T_STRING { zend_do_fetch_constant(&$$, &$1, ZEND_RT CLS_CC); }
|
||||
| T_STRING_VARNAME { $$ = $1; }
|
||||
| common_scalar { $$ = $1; }
|
||||
| '"' encaps_list '"' { $$ = $2; }
|
||||
| '\'' encaps_list '\'' { $$ = $2; }
|
||||
| T_START_HEREDOC encaps_list T_END_HEREDOC { $$ = $2; zend_do_end_heredoc(CLS_C); }
|
||||
;
|
||||
|
||||
|
||||
static_array_pair_list:
|
||||
/* empty */ { $$.op_type = IS_CONST; INIT_PZVAL(&$$.u.constant); array_init(&$$.u.constant); }
|
||||
| non_empty_static_array_pair_list possible_comma { $$ = $1; }
|
||||
;
|
||||
|
||||
possible_comma:
|
||||
/* empty */
|
||||
| ','
|
||||
;
|
||||
|
||||
non_empty_static_array_pair_list:
|
||||
non_empty_static_array_pair_list ',' static_scalar T_DOUBLE_ARROW static_scalar { zend_do_add_static_array_element(&$$, &$3, &$5); }
|
||||
| non_empty_static_array_pair_list ',' static_scalar { zend_do_add_static_array_element(&$$, NULL, &$3); }
|
||||
| static_scalar T_DOUBLE_ARROW static_scalar { $$.op_type = IS_CONST; INIT_PZVAL(&$$.u.constant); array_init(&$$.u.constant); zend_do_add_static_array_element(&$$, &$1, &$3); }
|
||||
| static_scalar { $$.op_type = IS_CONST; INIT_PZVAL(&$$.u.constant); array_init(&$$.u.constant); zend_do_add_static_array_element(&$$, NULL, &$1); }
|
||||
;
|
||||
|
||||
expr:
|
||||
r_cvar { $$ = $1; }
|
||||
| expr_without_variable { $$ = $1; }
|
||||
;
|
||||
|
||||
/*
|
||||
w_expr:
|
||||
w_cvar { $$ = $1; }
|
||||
| expr_without_variable { $$ = $1; }
|
||||
;
|
||||
*/
|
||||
|
||||
|
||||
r_cvar:
|
||||
cvar { zend_do_end_variable_parse(BP_VAR_R, 0 CLS_CC); $$ = $1; }
|
||||
;
|
||||
|
||||
|
||||
w_cvar:
|
||||
cvar { zend_do_end_variable_parse(BP_VAR_W, 0 CLS_CC); $$ = $1; }
|
||||
;
|
||||
|
||||
|
||||
rw_cvar:
|
||||
cvar { zend_do_end_variable_parse(BP_VAR_RW, 0 CLS_CC); $$ = $1; }
|
||||
;
|
||||
|
||||
|
||||
cvar:
|
||||
cvar_without_objects { $$ = $1; }
|
||||
| cvar_without_objects T_OBJECT_OPERATOR { zend_do_push_object(&$1 CLS_CC); } ref_list { $$ = $4; }
|
||||
;
|
||||
|
||||
|
||||
cvar_without_objects:
|
||||
reference_variable { $$ = $1; }
|
||||
| simple_indirect_reference reference_variable { zend_do_indirect_references(&$$, &$1, &$2 CLS_CC); }
|
||||
;
|
||||
|
||||
|
||||
reference_variable:
|
||||
reference_variable '[' dim_offset ']' { fetch_array_dim(&$$, &$1, &$3 CLS_CC); }
|
||||
| reference_variable '{' expr '}' { fetch_string_offset(&$$, &$1, &$3 CLS_CC); }
|
||||
| compound_variable { zend_do_fetch_globals(&$1 CLS_CC); zend_do_begin_variable_parse(CLS_C); fetch_simple_variable(&$$, &$1, 1 CLS_CC); }
|
||||
;
|
||||
|
||||
|
||||
compound_variable:
|
||||
T_VARIABLE { $$ = $1; }
|
||||
| '$' '{' expr '}' { $$ = $3; }
|
||||
;
|
||||
|
||||
dim_offset:
|
||||
/* empty */ { $$.op_type = IS_UNUSED; }
|
||||
| expr { $$ = $1; }
|
||||
;
|
||||
|
||||
ref_list:
|
||||
object_property { $$ = $1; }
|
||||
| ref_list T_OBJECT_OPERATOR { zend_do_push_object(&$1 CLS_CC); } object_property { $$ = $4; }
|
||||
;
|
||||
|
||||
object_property:
|
||||
object_dim_list { $$ = $1; }
|
||||
| cvar_without_objects { zend_do_end_variable_parse(BP_VAR_R, 0 CLS_CC); } { znode tmp_znode; zend_do_pop_object(&tmp_znode CLS_CC); zend_do_fetch_property(&$$, &tmp_znode, &$1 CLS_CC);}
|
||||
;
|
||||
|
||||
object_dim_list:
|
||||
object_dim_list '[' dim_offset ']' { fetch_array_dim(&$$, &$1, &$3 CLS_CC); }
|
||||
| object_dim_list '{' expr '}' { fetch_string_offset(&$$, &$1, &$3 CLS_CC); }
|
||||
| variable_name { znode tmp_znode; zend_do_pop_object(&tmp_znode CLS_CC); zend_do_fetch_property(&$$, &tmp_znode, &$1 CLS_CC);}
|
||||
;
|
||||
|
||||
variable_name:
|
||||
T_STRING { $$ = $1; }
|
||||
| '{' expr '}' { $$ = $2; }
|
||||
;
|
||||
|
||||
|
||||
simple_indirect_reference:
|
||||
'$' { $$.u.constant.value.lval = 1; }
|
||||
| simple_indirect_reference '$' { $$.u.constant.value.lval++; }
|
||||
;
|
||||
|
||||
assignment_list:
|
||||
assignment_list ',' assignment_list_element
|
||||
| assignment_list_element
|
||||
;
|
||||
|
||||
|
||||
assignment_list_element:
|
||||
cvar { zend_do_add_list_element(&$1 CLS_CC); }
|
||||
| T_LIST '(' { zend_do_new_list_begin(CLS_C); } assignment_list ')' { zend_do_new_list_end(CLS_C); }
|
||||
| /* empty */ { zend_do_add_list_element(NULL CLS_CC); }
|
||||
;
|
||||
|
||||
|
||||
array_pair_list:
|
||||
/* empty */ { zend_do_init_array(&$$, NULL, NULL, 0 CLS_CC); }
|
||||
| non_empty_array_pair_list possible_comma { $$ = $1; }
|
||||
;
|
||||
|
||||
non_empty_array_pair_list:
|
||||
non_empty_array_pair_list ',' expr T_DOUBLE_ARROW expr { zend_do_add_array_element(&$$, &$5, &$3, 0 CLS_CC); }
|
||||
| non_empty_array_pair_list ',' expr { zend_do_add_array_element(&$$, &$3, NULL, 0 CLS_CC); }
|
||||
| expr T_DOUBLE_ARROW expr { zend_do_init_array(&$$, &$3, &$1, 0 CLS_CC); }
|
||||
| expr { zend_do_init_array(&$$, &$1, NULL, 0 CLS_CC); }
|
||||
| non_empty_array_pair_list ',' expr T_DOUBLE_ARROW '&' w_cvar { zend_do_add_array_element(&$$, &$6, &$3, 1 CLS_CC); }
|
||||
| non_empty_array_pair_list ',' '&' w_cvar { zend_do_add_array_element(&$$, &$4, NULL, 1 CLS_CC); }
|
||||
| expr T_DOUBLE_ARROW '&' w_cvar { zend_do_init_array(&$$, &$4, &$1, 1 CLS_CC); }
|
||||
| '&' w_cvar { zend_do_init_array(&$$, &$2, NULL, 1 CLS_CC); }
|
||||
;
|
||||
|
||||
encaps_list:
|
||||
encaps_list encaps_var { zend_do_end_variable_parse(BP_VAR_R, 0 CLS_CC); zend_do_add_variable(&$$, &$1, &$2 CLS_CC); }
|
||||
| encaps_list T_STRING { zend_do_add_string(&$$, &$1, &$2 CLS_CC); }
|
||||
| encaps_list T_NUM_STRING { zend_do_add_string(&$$, &$1, &$2 CLS_CC); }
|
||||
| encaps_list T_ENCAPSED_AND_WHITESPACE { zend_do_add_string(&$$, &$1, &$2 CLS_CC); }
|
||||
| encaps_list T_CHARACTER { zend_do_add_char(&$$, &$1, &$2 CLS_CC); }
|
||||
| encaps_list T_BAD_CHARACTER { zend_do_add_string(&$$, &$1, &$2 CLS_CC); }
|
||||
| encaps_list '[' { $2.u.constant.value.lval = (long) '['; zend_do_add_char(&$$, &$1, &$2 CLS_CC); }
|
||||
| encaps_list ']' { $2.u.constant.value.lval = (long) ']'; zend_do_add_char(&$$, &$1, &$2 CLS_CC); }
|
||||
| encaps_list '{' { $2.u.constant.value.lval = (long) '{'; zend_do_add_char(&$$, &$1, &$2 CLS_CC); }
|
||||
| encaps_list '}' { $2.u.constant.value.lval = (long) '}'; zend_do_add_char(&$$, &$1, &$2 CLS_CC); }
|
||||
| encaps_list T_OBJECT_OPERATOR { znode tmp; $2.u.constant.value.lval = (long) '-'; zend_do_add_char(&tmp, &$1, &$2 CLS_CC); $2.u.constant.value.lval = (long) '>'; zend_do_add_char(&$$, &tmp, &$2 CLS_CC); }
|
||||
| /* empty */ { zend_do_init_string(&$$ CLS_CC); }
|
||||
|
||||
;
|
||||
|
||||
|
||||
|
||||
encaps_var:
|
||||
T_VARIABLE { zend_do_fetch_globals(&$1 CLS_CC); zend_do_begin_variable_parse(CLS_C); fetch_simple_variable(&$$, &$1, 1 CLS_CC); }
|
||||
| T_VARIABLE '[' { zend_do_begin_variable_parse(CLS_C); } encaps_var_offset ']' { zend_do_fetch_globals(&$1 CLS_CC); fetch_array_begin(&$$, &$1, &$4 CLS_CC); }
|
||||
| T_VARIABLE T_OBJECT_OPERATOR T_STRING { zend_do_begin_variable_parse(CLS_C); fetch_simple_variable(&$2, &$1, 1 CLS_CC); zend_do_fetch_property(&$$, &$2, &$3 CLS_CC); }
|
||||
| T_DOLLAR_OPEN_CURLY_BRACES expr '}' { zend_do_begin_variable_parse(CLS_C); fetch_simple_variable(&$$, &$2, 1 CLS_CC); }
|
||||
| T_DOLLAR_OPEN_CURLY_BRACES T_STRING_VARNAME '[' expr ']' '}' { zend_do_begin_variable_parse(CLS_C); fetch_array_begin(&$$, &$2, &$4 CLS_CC); }
|
||||
| T_CURLY_OPEN cvar '}' { $$ = $2; }
|
||||
;
|
||||
|
||||
|
||||
encaps_var_offset:
|
||||
T_STRING { $$ = $1; }
|
||||
| T_NUM_STRING { $$ = $1; }
|
||||
| T_VARIABLE { fetch_simple_variable(&$$, &$1, 1 CLS_CC); }
|
||||
;
|
||||
|
||||
|
||||
internal_functions_in_yacc:
|
||||
T_ISSET '(' cvar ')' { zend_do_isset_or_isempty(ZEND_ISSET, &$$, &$3 CLS_CC); }
|
||||
| T_EMPTY '(' cvar ')' { zend_do_isset_or_isempty(ZEND_ISEMPTY, &$$, &$3 CLS_CC); }
|
||||
| T_INCLUDE expr { zend_do_include_or_eval(ZEND_INCLUDE, &$$, &$2 CLS_CC); }
|
||||
| T_INCLUDE_ONCE expr { zend_do_include_or_eval(ZEND_INCLUDE_ONCE, &$$, &$2 CLS_CC); }
|
||||
| T_EVAL '(' expr ')' { zend_do_include_or_eval(ZEND_EVAL, &$$, &$3 CLS_CC); }
|
||||
| T_REQUIRE expr { zend_do_include_or_eval(ZEND_REQUIRE, &$$, &$2 CLS_CC); }
|
||||
| T_REQUIRE_ONCE expr { zend_do_include_or_eval(ZEND_REQUIRE_ONCE, &$$, &$2 CLS_CC); }
|
||||
;
|
||||
|
||||
|
||||
%%
|
||||
|
||||
File renamed without changes.
@@ -38,11 +38,12 @@
|
||||
#endif
|
||||
|
||||
#include <errno.h>
|
||||
#include <limits.h>
|
||||
#include "zend.h"
|
||||
#include "zend_alloc.h"
|
||||
#include "zend-parser.h"
|
||||
#include "zend_language_parser.h"
|
||||
#include "zend_compile.h"
|
||||
#include "zend-scanner.h"
|
||||
#include "zend_language_scanner.h"
|
||||
#include "zend_highlight.h"
|
||||
#include "zend_constants.h"
|
||||
#include "zend_variables.h"
|
||||
@@ -76,6 +77,7 @@
|
||||
#else
|
||||
#define YY_DECL int lex_scan(zval *zendlval CLS_DC)
|
||||
#endif
|
||||
|
||||
#define ECHO { ZEND_WRITE( yytext, yyleng ); }
|
||||
|
||||
#ifdef ZTS
|
||||
@@ -88,10 +90,10 @@
|
||||
class istdiostream : public istream
|
||||
{
|
||||
private:
|
||||
stdiobuf _file;
|
||||
stdiobuf _file;
|
||||
public:
|
||||
istdiostream (FILE* __f) : istream(), _file(__f) { init(&_file); }
|
||||
stdiobuf* rdbuf()/* const */ { return &_file; }
|
||||
istdiostream (FILE* __f) : istream(), _file(__f) { init(&_file); }
|
||||
stdiobuf* rdbuf()/* const */ { return &_file; }
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -359,8 +361,7 @@ ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type CLS
|
||||
CG(in_compilation) = 1;
|
||||
CG(active_op_array) = op_array;
|
||||
compiler_result = zendparse(CLS_C);
|
||||
do_return(&retval_znode, 0 CLS_CC);
|
||||
restore_lexical_state(&original_lex_state CLS_CC);
|
||||
zend_do_return(&retval_znode, 0 CLS_CC);
|
||||
CG(in_compilation) = original_in_compilation;
|
||||
if (compiler_result==1) { /* parser error */
|
||||
CG(unclean_shutdown) = 1;
|
||||
@@ -378,6 +379,9 @@ ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type CLS
|
||||
retval = NULL;
|
||||
}
|
||||
}
|
||||
if (compilation_successful) {
|
||||
restore_lexical_state(&original_lex_state CLS_CC);
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
@@ -401,6 +405,10 @@ zend_op_array *compile_filename(int type, zval *filename CLS_DC ELS_DC)
|
||||
|
||||
|
||||
retval = zend_compile_file(&file_handle, type CLS_CC);
|
||||
if (retval && file_handle.opened_path) {
|
||||
int dummy = 1;
|
||||
zend_hash_add(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path)+1, (void *)&dummy, sizeof(int), NULL);
|
||||
}
|
||||
zend_destroy_file_handle(&file_handle CLS_CC);
|
||||
|
||||
if (filename==&tmp) {
|
||||
@@ -477,18 +485,18 @@ zend_op_array *compile_string(zval *source_string, char *filename CLS_DC)
|
||||
CG(ZFL)->BeginState(ST_IN_SCRIPTING);
|
||||
#endif
|
||||
compiler_result = zendparse(CLS_C);
|
||||
restore_lexical_state(&original_lex_state CLS_CC);
|
||||
|
||||
if (compiler_result==1) {
|
||||
CG(active_op_array) = original_active_op_array;
|
||||
CG(unclean_shutdown)=1;
|
||||
retval = NULL;
|
||||
} else {
|
||||
do_return(NULL, 0 CLS_CC);
|
||||
zend_do_return(NULL, 0 CLS_CC);
|
||||
CG(active_op_array) = original_active_op_array;
|
||||
pass_two(op_array);
|
||||
retval = op_array;
|
||||
}
|
||||
restore_lexical_state(&original_lex_state CLS_CC);
|
||||
}
|
||||
#ifdef ZTS
|
||||
delete input_stream;
|
||||
@@ -995,7 +1003,7 @@ ANY_CHAR (.|[\n])
|
||||
}
|
||||
|
||||
|
||||
<ST_IN_SCRIPTING>{LNUM}|{HNUM} {
|
||||
<ST_IN_SCRIPTING>{LNUM} {
|
||||
errno = 0;
|
||||
zendlval->value.lval = strtol(yytext, NULL, 0);
|
||||
if (errno == ERANGE) { /* overflow */
|
||||
@@ -1008,6 +1016,26 @@ ANY_CHAR (.|[\n])
|
||||
}
|
||||
}
|
||||
|
||||
<ST_IN_SCRIPTING>{HNUM} {
|
||||
errno = 0;
|
||||
zendlval->value.lval = strtoul(yytext, NULL, 16);
|
||||
if (errno == ERANGE) { /* overflow */
|
||||
/* not trying strtod - it returns trash on 0x-es */
|
||||
zendlval->value.lval = LONG_MAX; /* maximal long */
|
||||
zend_error(E_NOTICE,"Hex number is too big: %s",yytext);
|
||||
} else {
|
||||
if(zendlval->value.lval < 0) {
|
||||
/* maintain consistency with the old way */
|
||||
zendlval->value.dval = (unsigned long) zendlval->value.lval;
|
||||
zendlval->type = IS_DOUBLE;
|
||||
return T_DNUMBER;
|
||||
}
|
||||
zendlval->type = IS_LONG;
|
||||
}
|
||||
zendlval->type = IS_LONG;
|
||||
return T_LNUMBER;
|
||||
}
|
||||
|
||||
<ST_DOUBLE_QUOTES,ST_BACKQUOTE,ST_HEREDOC>{LNUM}|{HNUM} { /* treat numbers (almost) as strings inside encapsulated strings */
|
||||
zendlval->value.str.val = (char *)estrndup(yytext, yyleng);
|
||||
zendlval->value.str.len = yyleng;
|
||||
+5
-1
@@ -397,8 +397,12 @@ void zend_destroy_rsrc_list_dtors()
|
||||
char *zend_rsrc_list_get_rsrc_type(int resource)
|
||||
{
|
||||
zend_rsrc_list_dtors_entry *lde;
|
||||
int rsrc_type;
|
||||
|
||||
if (zend_hash_index_find(&list_destructors, resource, (void **) &lde)==SUCCESS) {
|
||||
if (!zend_list_find(resource, &rsrc_type))
|
||||
return NULL;
|
||||
|
||||
if (zend_hash_index_find(&list_destructors, rsrc_type, (void **) &lde)==SUCCESS) {
|
||||
return lde->type_name;
|
||||
} else {
|
||||
return NULL;
|
||||
|
||||
+33
-14
@@ -63,26 +63,30 @@ ZEND_API void zend_llist_prepend_element(zend_llist *l, void *element)
|
||||
}
|
||||
|
||||
|
||||
#define DEL_LLIST_ELEMENT(current,l) \
|
||||
if (current->prev) {\
|
||||
current->prev->next = current->next;\
|
||||
} else {\
|
||||
l->head = current->next;\
|
||||
}\
|
||||
if (current->next) {\
|
||||
current->next->prev = current->prev;\
|
||||
} else {\
|
||||
l->tail = current->prev;\
|
||||
}\
|
||||
if (l->dtor) {\
|
||||
l->dtor(current->data);\
|
||||
pefree(current, l->persistent);\
|
||||
}
|
||||
|
||||
|
||||
ZEND_API void zend_llist_del_element(zend_llist *l, void *element, int (*compare)(void *element1, void *element2))
|
||||
{
|
||||
zend_llist_element *current=l->head;
|
||||
|
||||
while (current) {
|
||||
if (compare(current->data, element)) {
|
||||
if (current->prev) {
|
||||
current->prev->next = current->next;
|
||||
} else {
|
||||
l->head = current->next;
|
||||
}
|
||||
if (current->next) {
|
||||
current->next->prev = current->prev;
|
||||
} else {
|
||||
l->tail = current->prev;
|
||||
}
|
||||
if (l->dtor) {
|
||||
l->dtor(current->data);
|
||||
pefree(current, l->persistent);
|
||||
}
|
||||
DEL_LLIST_ELEMENT(current,l);
|
||||
break;
|
||||
}
|
||||
current = current->next;
|
||||
@@ -139,6 +143,21 @@ ZEND_API void zend_llist_copy(zend_llist *dst, zend_llist *src)
|
||||
}
|
||||
|
||||
|
||||
ZEND_API void zend_llist_apply_with_del(zend_llist *l, int (*func)(void *data))
|
||||
{
|
||||
zend_llist_element *element, *next;
|
||||
|
||||
element=l->head;
|
||||
while (element) {
|
||||
next = element->next;
|
||||
if (func(element->data)) {
|
||||
DEL_LLIST_ELEMENT(element,l);
|
||||
}
|
||||
element = next;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ZEND_API void zend_llist_apply(zend_llist *l, void (*func)(void *data))
|
||||
{
|
||||
zend_llist_element *element;
|
||||
|
||||
@@ -55,6 +55,7 @@ ZEND_API void zend_llist_clean(zend_llist *l);
|
||||
ZEND_API void zend_llist_remove_tail(zend_llist *l);
|
||||
ZEND_API void zend_llist_copy(zend_llist *dst, zend_llist *src);
|
||||
ZEND_API void zend_llist_apply(zend_llist *l, llist_apply_func_t);
|
||||
ZEND_API void zend_llist_apply_with_del(zend_llist *l, int (*func)(void *data));
|
||||
ZEND_API void zend_llist_apply_with_argument(zend_llist *l, llist_apply_with_arg_func_t, void *arg);
|
||||
ZEND_API void zend_llist_apply_with_arguments(zend_llist *l, llist_apply_with_args_func_t func, int num_args, ...);
|
||||
ZEND_API int zend_llist_count(zend_llist *l);
|
||||
|
||||
+2
-2
@@ -37,7 +37,7 @@ extern unsigned char second_arg_allow_ref[];
|
||||
|
||||
#include "zend.h"
|
||||
|
||||
#define ZEND_MODULE_API_NO 20000809
|
||||
#define ZEND_MODULE_API_NO 20001214
|
||||
#ifdef ZTS
|
||||
#define USING_ZTS 1
|
||||
#else
|
||||
@@ -75,7 +75,7 @@ struct _zend_module_entry {
|
||||
};
|
||||
|
||||
|
||||
extern HashTable module_registry;
|
||||
extern ZEND_API HashTable module_registry;
|
||||
|
||||
void module_destructor(zend_module_entry *module);
|
||||
int module_registry_cleanup(zend_module_entry *module);
|
||||
|
||||
+6
-4
@@ -189,7 +189,7 @@ void init_op(zend_op *op CLS_DC)
|
||||
{
|
||||
memset(&op->result, 0, sizeof(znode));
|
||||
op->lineno = CG(zend_lineno);
|
||||
op->result.op_type = IS_UNUSED;
|
||||
SET_UNUSED(op->result);
|
||||
op->extended_value = 0;
|
||||
memset(&op->op1, 0, sizeof(znode));
|
||||
memset(&op->op2, 0, sizeof(znode));
|
||||
@@ -211,7 +211,7 @@ zend_op *get_next_op(zend_op_array *op_array CLS_DC)
|
||||
zend_bailout();
|
||||
}
|
||||
#endif
|
||||
op_array->size *= 2;
|
||||
op_array->size *= 4;
|
||||
op_array_alloc_ops(op_array);
|
||||
}
|
||||
|
||||
@@ -260,8 +260,8 @@ static void zend_update_extended_info(zend_op_array *op_array CLS_DC)
|
||||
}
|
||||
opline = get_next_op(op_array CLS_CC);
|
||||
opline->opcode = ZEND_EXT_STMT;
|
||||
opline->op1.op_type = IS_UNUSED;
|
||||
opline->op2.op_type = IS_UNUSED;
|
||||
SET_UNUSED(opline->op1);
|
||||
SET_UNUSED(opline->op2);
|
||||
if (op_array->last>0) {
|
||||
opline->lineno= op_array->opcodes[op_array->last-2].lineno;
|
||||
}
|
||||
@@ -302,6 +302,8 @@ int pass_two(zend_op_array *op_array)
|
||||
}
|
||||
opline++;
|
||||
}
|
||||
op_array->opcodes = (zend_op *) erealloc(op_array->opcodes, sizeof(zend_op)*op_array->last);
|
||||
op_array->size = op_array->last;
|
||||
op_array->done_pass_two = 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
+37
-4
@@ -32,10 +32,34 @@
|
||||
#include "zend_list.h"
|
||||
#include "zend_fast_cache.h"
|
||||
|
||||
#if WITH_BCMATH
|
||||
#if 0&&WITH_BCMATH
|
||||
#include "ext/bcmath/number.h"
|
||||
#endif
|
||||
|
||||
ZEND_API int zend_atoi(const char *str, int str_len)
|
||||
{
|
||||
int retval;
|
||||
|
||||
if (!str_len) {
|
||||
str_len = strlen(str);
|
||||
}
|
||||
retval = atoi(str);
|
||||
if (str_len>0) {
|
||||
switch (str[str_len-1]) {
|
||||
case 'k':
|
||||
case 'K':
|
||||
retval *= 1024;
|
||||
break;
|
||||
case 'm':
|
||||
case 'M':
|
||||
retval *= 1048576;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
||||
ZEND_API double zend_string_to_double(const char *number, zend_uint length)
|
||||
{
|
||||
double divisor = 10.0;
|
||||
@@ -92,7 +116,7 @@ ZEND_API void convert_scalar_to_number(zval *op)
|
||||
case IS_DOUBLE:
|
||||
case IS_LONG:
|
||||
break;
|
||||
#if WITH_BCMATH
|
||||
#if 0&&WITH_BCMATH
|
||||
case FLAG_IS_BC:
|
||||
op->type = IS_DOUBLE; /* may have lost significant digits */
|
||||
break;
|
||||
@@ -1339,6 +1363,13 @@ static void increment_string(zval *str)
|
||||
int last=0; /* Shut up the compiler warning */
|
||||
int ch;
|
||||
|
||||
if (str->value.str.len == 0) {
|
||||
STR_FREE(str->value.str.val);
|
||||
str->value.str.val = estrndup("1", sizeof("1")-1);
|
||||
str->value.str.len = 1;
|
||||
return;
|
||||
}
|
||||
|
||||
while(pos >= 0) {
|
||||
ch = s[pos];
|
||||
if (ch >= 'a' && ch <= 'z') {
|
||||
@@ -1532,7 +1563,7 @@ ZEND_API int zend_binary_strncasecmp(char *s1, uint len1, char *s2, uint len2, u
|
||||
}
|
||||
}
|
||||
|
||||
return len1 - len2;
|
||||
return MIN(length, len1) - MIN(length, len2);
|
||||
}
|
||||
|
||||
|
||||
@@ -1567,7 +1598,7 @@ ZEND_API void zendi_smart_strcmp(zval *result, zval *s1, zval *s2)
|
||||
|
||||
if ((ret1=is_numeric_string(s1->value.str.val, s1->value.str.len, &lval1, &dval1)) &&
|
||||
(ret2=is_numeric_string(s2->value.str.val, s2->value.str.len, &lval2, &dval2))) {
|
||||
#if WITH_BCMATH
|
||||
#if 0&&WITH_BCMATH
|
||||
if ((ret1==FLAG_IS_BC) || (ret2==FLAG_IS_BC)) {
|
||||
bc_num first, second;
|
||||
|
||||
@@ -1717,4 +1748,6 @@ static inline int is_numeric_string(char *str, int length, long *lval, double *d
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
+14
-3
@@ -28,8 +28,9 @@
|
||||
#include <ieeefp.h>
|
||||
#endif
|
||||
|
||||
#if WITH_BCMATH
|
||||
#include "ext/bcmath/number.h"
|
||||
|
||||
#if 0&&WITH_BCMATH
|
||||
#include "ext/bcmath/libbcmath/src/bcmath.h"
|
||||
#endif
|
||||
|
||||
#define MAX_LENGTH_OF_LONG 18
|
||||
@@ -88,7 +89,7 @@ static inline int is_numeric_string(char *str, int length, long *lval, double *d
|
||||
if (dval) {
|
||||
*dval = local_dval;
|
||||
}
|
||||
#if WITH_BCMATH
|
||||
#if 0&&WITH_BCMATH
|
||||
if (length>16) {
|
||||
register char *ptr=str, *end=str+length;
|
||||
|
||||
@@ -158,6 +159,7 @@ ZEND_API void zend_compare_symbol_tables(zval *result, HashTable *ht1, HashTable
|
||||
ZEND_API void zend_compare_arrays(zval *result, zval *a1, zval *a2);
|
||||
ZEND_API void zend_compare_objects(zval *result, zval *o1, zval *o2);
|
||||
|
||||
ZEND_API int zend_atoi(const char *str, int str_len);
|
||||
|
||||
#define convert_to_ex_master(ppzv, lower_type, upper_type) \
|
||||
if ((*ppzv)->type!=IS_##upper_type) { \
|
||||
@@ -207,6 +209,9 @@ ZEND_API void zend_compare_objects(zval *result, zval *o1, zval *o2);
|
||||
#define Z_STRVAL(zval) (zval).value.str.val
|
||||
#define Z_STRLEN(zval) (zval).value.str.len
|
||||
#define Z_ARRVAL(zval) (zval).value.ht
|
||||
#define Z_OBJPROP(zval) (zval).value.obj.properties
|
||||
#define Z_OBJCE(zval) (zval).value.obj.ce
|
||||
#define Z_RESVAL(zval) (zval).value.lval
|
||||
|
||||
#define Z_LVAL_P(zval_p) Z_LVAL(*zval_p)
|
||||
#define Z_BVAL_P(zval_p) Z_BVAL(*zval_p)
|
||||
@@ -214,6 +219,9 @@ ZEND_API void zend_compare_objects(zval *result, zval *o1, zval *o2);
|
||||
#define Z_STRVAL_P(zval_p) Z_STRVAL(*zval_p)
|
||||
#define Z_STRLEN_P(zval_p) Z_STRLEN(*zval_p)
|
||||
#define Z_ARRVAL_P(zval_p) Z_ARRVAL(*zval_p)
|
||||
#define Z_OBJPROP_P(zval_p) Z_OBJPROP(*zval_p)
|
||||
#define Z_OBJCE_P(zval_p) Z_OBJCE(*zval_p)
|
||||
#define Z_RESVAL_P(zval_p) Z_RESVAL(*zval_p)
|
||||
|
||||
#define Z_LVAL_PP(zval_pp) Z_LVAL(**zval_pp)
|
||||
#define Z_BVAL_PP(zval_pp) Z_BVAL(**zval_pp)
|
||||
@@ -221,6 +229,9 @@ ZEND_API void zend_compare_objects(zval *result, zval *o1, zval *o2);
|
||||
#define Z_STRVAL_PP(zval_pp) Z_STRVAL(**zval_pp)
|
||||
#define Z_STRLEN_PP(zval_pp) Z_STRLEN(**zval_pp)
|
||||
#define Z_ARRVAL_PP(zval_pp) Z_ARRVAL(**zval_pp)
|
||||
#define Z_OBJPROP_PP(zval_pp) Z_OBJPROP(**zval_pp)
|
||||
#define Z_OBJCE_PP(zval_pp) Z_OBJCE(**zval_pp)
|
||||
#define Z_RESVAL_PP(zval_pp) Z_RESVAL(**zval_pp)
|
||||
|
||||
#define Z_TYPE(zval) (zval).type
|
||||
#define Z_TYPE_P(zval_p) Z_TYPE(*zval_p)
|
||||
|
||||
+47
-4
@@ -51,15 +51,19 @@ AC_DEFUN(PHP_READDIR_R_TYPE,[
|
||||
#include <sys/types.h>
|
||||
#include <dirent.h>
|
||||
|
||||
#ifndef PATH_MAX
|
||||
#define PATH_MAX 1024
|
||||
#endif
|
||||
|
||||
main() {
|
||||
DIR *dir;
|
||||
char entry[sizeof(struct dirent)+257];
|
||||
char entry[sizeof(struct dirent)+PATH_MAX];
|
||||
struct dirent *pentry = (struct dirent *) &entry;
|
||||
|
||||
dir = opendir("/");
|
||||
if (!dir)
|
||||
exit(1);
|
||||
if (readdir_r(dir, &entry, &pentry) == 0)
|
||||
if (readdir_r(dir, (struct dirent *) entry, &pentry) == 0)
|
||||
exit(0);
|
||||
exit(1);
|
||||
}
|
||||
@@ -204,7 +208,7 @@ dnl Sets PHP_ARG_NAME either to the user value or to the default value.
|
||||
dnl default-val defaults to no.
|
||||
dnl
|
||||
AC_DEFUN(PHP_ARG_WITH,[
|
||||
PHP_REAL_ARG_WITH([$1],[$2],[$3],[$4],PHP_[]translit($1,a-z-,A-Z_))
|
||||
PHP_REAL_ARG_WITH([$1],[$2],[$3],[$4],PHP_[]translit($1,a-z0-9-,A-Z0-9_))
|
||||
])
|
||||
|
||||
AC_DEFUN(PHP_REAL_ARG_WITH,[
|
||||
@@ -476,7 +480,7 @@ AC_DEFUN(AC_EXPAND_PATH,[
|
||||
$2="$1"
|
||||
else
|
||||
changequote({,})
|
||||
ep_dir="`echo $1|sed 's%/*[^/][^/]*$%%'`"
|
||||
ep_dir="`echo $1|sed 's%/*[^/][^/]*/*$%%'`"
|
||||
changequote([,])
|
||||
ep_realdir="`(cd \"$ep_dir\" && pwd)`"
|
||||
$2="$ep_realdir/`basename \"$1\"`"
|
||||
@@ -879,3 +883,42 @@ int main(void) {
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN(PHP_FOPENCOOKIE,[
|
||||
AC_CHECK_FUNC(fopencookie, [ have_glibc_fopencookie=yes ])
|
||||
|
||||
if test "$have_glibc_fopencookie" = "yes" ; then
|
||||
dnl this comes in two flavors:
|
||||
dnl newer glibcs (since 2.1.2 ? )
|
||||
dnl have a type called cookie_io_functions_t
|
||||
AC_TRY_COMPILE([ #define _GNU_SOURCE
|
||||
#include <stdio.h>
|
||||
],
|
||||
[ cookie_io_functions_t cookie; ],
|
||||
[ have_cookie_io_functions_t=yes ],
|
||||
[ ] )
|
||||
|
||||
if test "$have_cookie_io_functions_t" = "yes" ; then
|
||||
cookie_io_functions_t=cookie_io_functions_t
|
||||
have_fopen_cookie=yes
|
||||
else
|
||||
dnl older glibc versions (up to 2.1.2 ?)
|
||||
dnl call it _IO_cookie_io_functions_t
|
||||
AC_TRY_COMPILE([ #define _GNU_SOURCE
|
||||
#include <stdio.h>
|
||||
],
|
||||
[ _IO_cookie_io_functions_t cookie; ],
|
||||
[ have_IO_cookie_io_functions_t=yes ],
|
||||
[] )
|
||||
if test "$have_cookie_io_functions_t" = "yes" ; then
|
||||
cookie_io_functions_t=_IO_cookie_io_functions_t
|
||||
have_fopen_cookie=yes
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "$have_fopen_cookie" = "yes" ; then
|
||||
AC_DEFINE(HAVE_FOPENCOOKIE, 1, [ ])
|
||||
AC_DEFINE_UNQUOTED(COOKIE_IO_FUNCTIONS_T, $cookie_io_functions_t, [ ])
|
||||
fi
|
||||
|
||||
fi
|
||||
])
|
||||
+1
-1
@@ -238,7 +238,7 @@ registers two INI entries - "foo" and "bar". They're given defaults "1"
|
||||
and "bah" respectively - note that all defaults are always given as
|
||||
strings. That doesn't reduce your ability to use integer values, simply
|
||||
specify them as strings. "foo" is marked so that it can be changed by
|
||||
anyone at any time (PHP_INI_ALL), whereas "foo" is marked so it can be
|
||||
anyone at any time (PHP_INI_ALL), whereas "bar" is marked so it can be
|
||||
changed only at startup in the php3.ini only, presumably, by the system
|
||||
administrator (PHP_INI_SYSTEM).
|
||||
When "foo" changes, no function is called. Access to it is done using the
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ LT_TARGETS = ltconfig ltmain.sh config.guess config.sub
|
||||
makefile_in_files = $(makefile_am_files:.am=.in)
|
||||
makefile_files = $(makefile_am_files:e.am=e)
|
||||
|
||||
config_h_in = php_config.h.in
|
||||
config_h_in = main/php_config.h.in
|
||||
|
||||
acconfig_h_SOURCES = acconfig.h.in $(config_h_files)
|
||||
|
||||
|
||||
+1
-1
@@ -54,7 +54,7 @@ distclean: distclean-recursive clean-x
|
||||
php_config.h stamp-h Makefile build-defs.h php4.spec libphp4.module
|
||||
|
||||
test: $(top_builddir)/php
|
||||
@$(top_builddir)/php -f $(top_srcdir)/run-tests.php `pwd`
|
||||
@TOP_BUILDDIR=$(top_builddir) TOP_SRCDIR=$(top_srcdir) $(top_builddir)/php -q $(top_srcdir)/run-tests.php $(srcdir)
|
||||
|
||||
include $(builddir)/.deps
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ mkinstalldirs = $(top_srcdir)/build/shtool mkdir -p
|
||||
INSTALL = $(top_srcdir)/build/shtool install -c
|
||||
INSTALL_DATA = $(INSTALL) -m 644
|
||||
|
||||
DEFS = -I. -I$(srcdir) -I$(top_builddir) -I$(top_builddir)/main
|
||||
DEFS = -I. -I$(srcdir) -I$(top_builddir)/main -I$(top_srcdir)
|
||||
|
||||
moduledir = $(EXTENSION_DIR)
|
||||
|
||||
|
||||
+66
-24
@@ -51,7 +51,7 @@ dnl ## All of these are normally in the extension directories.
|
||||
dnl ## Diversion 5 is the last one. Here we generate files and clean up.
|
||||
|
||||
dnl ## This is where the version number is changed from now on!
|
||||
AM_INIT_AUTOMAKE(php, 4.0.3RC2)
|
||||
AM_INIT_AUTOMAKE(php, 4.0.4pl1, nodefine)
|
||||
|
||||
PHP_VERSION=$VERSION
|
||||
echo "/* automatically generated by configure */" > php_version.h.new
|
||||
@@ -65,7 +65,7 @@ else
|
||||
rm -f php_version.h.new
|
||||
fi
|
||||
|
||||
AM_CONFIG_HEADER(php_config.h)
|
||||
AM_CONFIG_HEADER(main/php_config.h)
|
||||
AM_MAINTAINER_MODE
|
||||
AC_CANONICAL_HOST
|
||||
|
||||
@@ -95,7 +95,11 @@ BSD_MAKEFILE=no
|
||||
|
||||
case "$host_alias" in
|
||||
*solaris*)
|
||||
CPPFLAGS="$CPPFLAGS -D_POSIX_PTHREAD_SEMANTICS";;
|
||||
CPPFLAGS="$CPPFLAGS -D_POSIX_PTHREAD_SEMANTICS"
|
||||
if test "${enable_libgcc+set}" != "set" && test "$GCC" = "yes"; then
|
||||
enable_libgcc=yes
|
||||
fi
|
||||
;;
|
||||
*dgux*)
|
||||
CPPFLAGS="$CPPFLAGS -D_BSD_TIMEOFDAY_FLAVOR";;
|
||||
*darwin*|*rhapsody*)
|
||||
@@ -139,6 +143,7 @@ dnl paths to the targets are relative to the build directory
|
||||
SAPI_PROGRAM=php
|
||||
SAPI_SHARED=libs/libphp4.$SHLIB_SUFFIX_NAME
|
||||
SAPI_STATIC=libs/libphp4.a
|
||||
SAPI_LIBTOOL=libphp4.la
|
||||
|
||||
PHP_CONFIGURE_PART(Configuring SAPI modules)
|
||||
|
||||
@@ -198,7 +203,7 @@ if test -d /usr/pkg/include -a -d /usr/pkg/lib ; then
|
||||
LDFLAGS="$LDFLAGS -L/usr/pkg/lib"
|
||||
fi
|
||||
|
||||
INCLUDES="$INCLUDES -I\$(top_builddir)/Zend -I\$(top_srcdir)"
|
||||
INCLUDES="$INCLUDES -I\$(top_builddir)/Zend"
|
||||
|
||||
|
||||
AC_CHECK_LIB(socket, socket, [
|
||||
@@ -333,13 +338,13 @@ dnl Checks for types
|
||||
AC_TYPE_SIZE_T
|
||||
AC_TYPE_UID_T
|
||||
|
||||
dnl Check for struct sockaddr_in6
|
||||
AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_struct_sockaddr_in6,
|
||||
dnl Check for IPv6 support
|
||||
AC_CACHE_CHECK([for IPv6 support], ac_cv_ipv6_support,
|
||||
[AC_TRY_COMPILE([#include <sys/socket.h>
|
||||
#include <netinet/in.h>], [struct sockaddr_in6 s; s;],
|
||||
ac_cv_struct_sockaddr_in6=yes, ac_cv_struct_sockaddr_in6=no)])
|
||||
if test "$ac_cv_struct_sockaddr_in6" = yes; then
|
||||
AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6,1,[Whether you have struct sockaddr_in6])
|
||||
#include <netinet/in.h>], [struct sockaddr_in6 s; int i=AF_INET6; s],
|
||||
ac_cv_ipv6_support=yes, ac_cv_ipv6_support=no)])
|
||||
if test "$ac_cv_ipv6_support" = yes; then
|
||||
AC_DEFINE(HAVE_IPV6,1,[Whether you have IPv6 support])
|
||||
fi
|
||||
|
||||
dnl Checks for library functions.
|
||||
@@ -400,7 +405,7 @@ vsnprintf \
|
||||
dnl Check for getaddrinfo, should be a better way, but...
|
||||
AC_CACHE_CHECK([for getaddrinfo], ac_cv_func_getaddrinfo,
|
||||
[AC_TRY_COMPILE([#include <netdb.h>],
|
||||
[struct addrinfo h;getaddrinfo("","",&h,&h);],
|
||||
[struct addrinfo *g,h;g=&h;getaddrinfo("","",g,&g);],
|
||||
ac_cv_func_getaddrinfo=yes, ac_cv_func_getaddrinfo=no)])
|
||||
if test "$ac_cv_func_getaddrinfo" = yes; then
|
||||
AC_DEFINE(HAVE_GETADDRINFO,1,[Define if you have the getaddrinfo function])
|
||||
@@ -500,6 +505,53 @@ AC_ARG_WITH(exec-dir,
|
||||
AC_MSG_RESULT(/usr/local/php/bin)
|
||||
])
|
||||
|
||||
PHP_ARG_WITH(openssl,for OpenSSL support,
|
||||
[ --with-openssl[=DIR] Include OpenSSL support (requires OpenSSL >= 0.9.6) ])
|
||||
if test "$PHP_OPENSSL" = "yes"; then
|
||||
PHP_OPENSSL="/usr/local/ssl /usr/local /usr /usr/local/openssl"
|
||||
fi
|
||||
|
||||
AC_DEFUN(PHP_SETUP_OPENSSL,[
|
||||
if test "$PHP_OPENSSL" = "no"; then
|
||||
PHP_OPENSSL="/usr/local/ssl /usr/local /usr /usr/local/openssl"
|
||||
fi
|
||||
|
||||
for i in $PHP_OPENSSL; do
|
||||
if test -r $i/include/openssl/evp.h; then
|
||||
OPENSSL_DIR=$i
|
||||
OPENSSL_INC=$i/include
|
||||
fi
|
||||
done
|
||||
|
||||
if test -z "$OPENSSL_DIR"; then
|
||||
AC_MSG_ERROR(Cannot find OpenSSL's <evp.h>)
|
||||
fi
|
||||
|
||||
old_CPPFLAGS=$CPPFLAGS
|
||||
CPPFLAGS="-I$OPENSSL_INC"
|
||||
AC_MSG_CHECKING(for OpenSSL version)
|
||||
AC_EGREP_CPP(yes,[
|
||||
#include <openssl/opensslv.h>
|
||||
#if OPENSSL_VERSION_NUMBER >= 0x0090600fL
|
||||
yes
|
||||
#endif
|
||||
],[
|
||||
AC_MSG_RESULT(>= 0.9.6)
|
||||
],[
|
||||
AC_MSG_ERROR(OpenSSL version 0.9.6 or greater required.)
|
||||
])
|
||||
CPPFLAGS=$old_CPPFLAGS
|
||||
|
||||
AC_ADD_LIBPATH($OPENSSL_DIR/lib)
|
||||
AC_ADD_LIBRARY(ssl)
|
||||
AC_ADD_LIBRARY(crypto)
|
||||
AC_ADD_INCLUDE($OPENSSL_INC)
|
||||
])
|
||||
|
||||
if test "$PHP_OPENSSL" != "no"; then
|
||||
PHP_SETUP_OPENSSL
|
||||
fi
|
||||
|
||||
PHP_ARG_ENABLE(sigchild,whether to enable PHP's own SIGCHLD handler,
|
||||
[ --enable-sigchild Enable PHP's own SIGCHLD handler.],no)
|
||||
|
||||
@@ -543,16 +595,6 @@ else
|
||||
AC_DEFINE(DEFAULT_SHORT_OPEN_TAG,0,[ ])
|
||||
fi
|
||||
|
||||
PHP_ARG_ENABLE(url-fopen-wrapper,whether to enable the URL-aware fopen wrapper,
|
||||
[ --disable-url-fopen-wrapper
|
||||
Disable the URL-aware fopen wrapper that allows
|
||||
accessing files via http or ftp.], yes)
|
||||
|
||||
if test "$PHP_URL_FOPEN_WRAPPER" = "yes"; then
|
||||
AC_DEFINE(PHP_URL_FOPEN, 1, [ ])
|
||||
else
|
||||
AC_DEFINE(PHP_URL_FOPEN, 0, [ ])
|
||||
fi
|
||||
|
||||
PHP_ARG_ENABLE(pic,whether to enable PIC for shared objects,
|
||||
[ --disable-pic Disable PIC for shared objects], yes)
|
||||
@@ -819,7 +861,7 @@ PHP_CONFIGURE_PART(Generating files)
|
||||
|
||||
PHP_GEN_CONFIG_VARS
|
||||
|
||||
ALL_OUTPUT_FILES="php4.spec Zend/Makefile build-defs.h $PHP_OUTPUT_FILES"
|
||||
ALL_OUTPUT_FILES="php4.spec Zend/Makefile main/build-defs.h $PHP_OUTPUT_FILES"
|
||||
|
||||
AC_OUTPUT($ALL_OUTPUT_FILES, [], [
|
||||
|
||||
@@ -843,11 +885,11 @@ fi
|
||||
#
|
||||
|
||||
if test -d TSRM; then
|
||||
echo '#include "../php_config.h"' > TSRM/tsrm_config.h
|
||||
echo '#include "../main/php_config.h"' > TSRM/tsrm_config.h
|
||||
fi
|
||||
|
||||
cat >Zend/zend_config.h <<FEO
|
||||
#include "../php_config.h"
|
||||
#include "../main/php_config.h"
|
||||
#if defined(APACHE) && defined(PHP_API_VERSION)
|
||||
#undef HAVE_DLFCN_H
|
||||
#endif
|
||||
|
||||
@@ -54,7 +54,13 @@ AC_DEFUN(LIB_BUILD,[
|
||||
lib_target=""
|
||||
|
||||
$php_shtool mkdir -p $1
|
||||
if test "$BSD_MAKEFILE" = "yes"; then
|
||||
lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
|
||||
else
|
||||
lib_include_conf="include \$(top_builddir)/config_vars.mk"
|
||||
fi
|
||||
cat >$lib_makefile<<EOF
|
||||
$lib_include_conf
|
||||
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
|
||||
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
|
||||
EOF
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
aspell
|
||||
Rasmus Lerdorf
|
||||
+3
-2
@@ -52,15 +52,16 @@ zend_module_entry aspell_module_entry = {
|
||||
ZEND_GET_MODULE(aspell)
|
||||
#endif
|
||||
|
||||
static void php_aspell_close(aspell *sc)
|
||||
static void php_aspell_close(zend_rsrc_list_entry *rsrc)
|
||||
{
|
||||
aspell *sc = (aspell *)rsrc->ptr;
|
||||
aspell_free(sc);
|
||||
}
|
||||
|
||||
|
||||
PHP_MINIT_FUNCTION(aspell)
|
||||
{
|
||||
le_aspell = register_list_destructors(php_aspell_close,NULL);
|
||||
le_aspell = zend_register_list_destructors_ex(php_aspell_close, NULL, "aspell", module_number);
|
||||
return SUCCESS;
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
BC Math
|
||||
Andi Gutmans
|
||||
@@ -2,5 +2,10 @@
|
||||
LTLIBRARY_NAME = libbcmath.la
|
||||
LTLIBRARY_SOURCES = bcmath.c number.c
|
||||
LTLIBRARY_SHARED_NAME = bcmath.la
|
||||
LTLIBRARY_DEPENDENCIES = libbcmath/libbcmath.la
|
||||
LTLIBRARY_LIBADD = $(LTLIBRARY_DEPENDENCIES)
|
||||
LTLIBRARY_SHARED_LIBADD = $(LTLIBRARY_LIBADD)
|
||||
|
||||
SUBDIRS = libbcmath
|
||||
|
||||
include $(top_srcdir)/build/dynlib.mk
|
||||
+132
-70
@@ -22,8 +22,9 @@
|
||||
|
||||
#if WITH_BCMATH
|
||||
|
||||
#include "number.h"
|
||||
#include "ext/standard/info.h"
|
||||
#include "php_bcmath.h"
|
||||
#include "ext/bcmath/libbcmath/src/bcmath.h"
|
||||
|
||||
function_entry bcmath_functions[] = {
|
||||
PHP_FE(bcadd, NULL)
|
||||
@@ -39,7 +40,14 @@ function_entry bcmath_functions[] = {
|
||||
};
|
||||
|
||||
zend_module_entry bcmath_module_entry = {
|
||||
"bcmath", bcmath_functions, NULL, NULL, PHP_RINIT(bcmath), PHP_RSHUTDOWN(bcmath), NULL, STANDARD_MODULE_PROPERTIES
|
||||
"bcmath",
|
||||
bcmath_functions,
|
||||
PHP_MINIT(bcmath),
|
||||
PHP_MSHUTDOWN(bcmath),
|
||||
PHP_RINIT(bcmath),
|
||||
NULL,
|
||||
PHP_MINFO(bcmath),
|
||||
STANDARD_MODULE_PROPERTIES
|
||||
};
|
||||
|
||||
#ifdef COMPILE_DL_BCMATH
|
||||
@@ -50,19 +58,73 @@ ZEND_GET_MODULE(bcmath)
|
||||
static long bc_precision;
|
||||
#endif
|
||||
|
||||
/* Storage used for special numbers. */
|
||||
bc_num _zero_;
|
||||
bc_num _one_;
|
||||
bc_num _two_;
|
||||
|
||||
|
||||
/* Make a copy of a number! Just increments the reference count! */
|
||||
bc_num copy_num (bc_num num)
|
||||
{
|
||||
num->n_refs++;
|
||||
return num;
|
||||
}
|
||||
|
||||
|
||||
/* Initialize a number NUM by making it a copy of zero. */
|
||||
void init_num (bc_num *num)
|
||||
{
|
||||
*num = copy_num (_zero_);
|
||||
}
|
||||
|
||||
|
||||
PHP_MINIT_FUNCTION(bcmath)
|
||||
{
|
||||
extern bc_num _zero_;
|
||||
extern bc_num _one_;
|
||||
extern bc_num _two_;
|
||||
|
||||
_zero_ = bc_new_num (1,0);
|
||||
_one_ = bc_new_num (1,0);
|
||||
_one_->n_value[0] = 1;
|
||||
_two_ = bc_new_num (1,0);
|
||||
_two_->n_value[0] = 2;
|
||||
persist_alloc(_zero_);
|
||||
persist_alloc(_one_);
|
||||
persist_alloc(_two_);
|
||||
persist_alloc(_zero_->n_ptr);
|
||||
persist_alloc(_one_->n_ptr);
|
||||
persist_alloc(_two_->n_ptr);
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
|
||||
PHP_MSHUTDOWN_FUNCTION(bcmath)
|
||||
{
|
||||
bc_free_num(&_zero_);
|
||||
bc_free_num(&_one_);
|
||||
bc_free_num(&_two_);
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
PHP_RINIT_FUNCTION(bcmath)
|
||||
{
|
||||
init_numbers();
|
||||
if (cfg_get_long("bcmath.scale",&bc_precision)==FAILURE) {
|
||||
bc_precision=0;
|
||||
}
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
PHP_RSHUTDOWN_FUNCTION(bcmath)
|
||||
|
||||
PHP_MINFO_FUNCTION(bcmath)
|
||||
{
|
||||
destruct_numbers();
|
||||
return SUCCESS;
|
||||
php_info_print_table_start();
|
||||
php_info_print_table_row(2, "BCMath support", "enabled");
|
||||
php_info_print_table_end();
|
||||
}
|
||||
|
||||
/* {{{ proto string bcadd(string left_operand, string right_operand [, int scale])
|
||||
@@ -92,18 +154,18 @@ PHP_FUNCTION(bcadd)
|
||||
}
|
||||
convert_to_string_ex(left);
|
||||
convert_to_string_ex(right);
|
||||
init_num(&first);
|
||||
init_num(&second);
|
||||
init_num(&result);
|
||||
str2num(&first,(*left)->value.str.val,scale);
|
||||
str2num(&second,(*right)->value.str.val,scale);
|
||||
bc_init_num(&first);
|
||||
bc_init_num(&second);
|
||||
bc_init_num(&result);
|
||||
bc_str2num(&first,(*left)->value.str.val,scale);
|
||||
bc_str2num(&second,(*right)->value.str.val,scale);
|
||||
bc_add (first,second,&result, scale);
|
||||
return_value->value.str.val = num2str(result);
|
||||
return_value->value.str.val = bc_num2str(result);
|
||||
return_value->value.str.len = strlen(return_value->value.str.val);
|
||||
return_value->type = IS_STRING;
|
||||
free_num(&first);
|
||||
free_num(&second);
|
||||
free_num(&result);
|
||||
bc_free_num(&first);
|
||||
bc_free_num(&second);
|
||||
bc_free_num(&result);
|
||||
return;
|
||||
}
|
||||
/* }}} */
|
||||
@@ -135,18 +197,18 @@ PHP_FUNCTION(bcsub)
|
||||
}
|
||||
convert_to_string_ex(left);
|
||||
convert_to_string_ex(right);
|
||||
init_num(&first);
|
||||
init_num(&second);
|
||||
init_num(&result);
|
||||
str2num(&first,(*left)->value.str.val,scale);
|
||||
str2num(&second,(*right)->value.str.val,scale);
|
||||
bc_init_num(&first);
|
||||
bc_init_num(&second);
|
||||
bc_init_num(&result);
|
||||
bc_str2num(&first,(*left)->value.str.val,scale);
|
||||
bc_str2num(&second,(*right)->value.str.val,scale);
|
||||
bc_sub (first,second,&result, scale);
|
||||
return_value->value.str.val = num2str(result);
|
||||
return_value->value.str.val = bc_num2str(result);
|
||||
return_value->value.str.len = strlen(return_value->value.str.val);
|
||||
return_value->type = IS_STRING;
|
||||
free_num(&first);
|
||||
free_num(&second);
|
||||
free_num(&result);
|
||||
bc_free_num(&first);
|
||||
bc_free_num(&second);
|
||||
bc_free_num(&result);
|
||||
return;
|
||||
}
|
||||
/* }}} */
|
||||
@@ -178,18 +240,18 @@ PHP_FUNCTION(bcmul)
|
||||
}
|
||||
convert_to_string_ex(left);
|
||||
convert_to_string_ex(right);
|
||||
init_num(&first);
|
||||
init_num(&second);
|
||||
init_num(&result);
|
||||
str2num(&first,(*left)->value.str.val,scale);
|
||||
str2num(&second,(*right)->value.str.val,scale);
|
||||
bc_init_num(&first);
|
||||
bc_init_num(&second);
|
||||
bc_init_num(&result);
|
||||
bc_str2num(&first,(*left)->value.str.val,scale);
|
||||
bc_str2num(&second,(*right)->value.str.val,scale);
|
||||
bc_multiply (first,second,&result, scale);
|
||||
return_value->value.str.val = num2str(result);
|
||||
return_value->value.str.val = bc_num2str(result);
|
||||
return_value->value.str.len = strlen(return_value->value.str.val);
|
||||
return_value->type = IS_STRING;
|
||||
free_num(&first);
|
||||
free_num(&second);
|
||||
free_num(&result);
|
||||
bc_free_num(&first);
|
||||
bc_free_num(&second);
|
||||
bc_free_num(&result);
|
||||
return;
|
||||
}
|
||||
/* }}} */
|
||||
@@ -221,14 +283,14 @@ PHP_FUNCTION(bcdiv)
|
||||
}
|
||||
convert_to_string_ex(left);
|
||||
convert_to_string_ex(right);
|
||||
init_num(&first);
|
||||
init_num(&second);
|
||||
init_num(&result);
|
||||
str2num(&first,(*left)->value.str.val,scale);
|
||||
str2num(&second,(*right)->value.str.val,scale);
|
||||
bc_init_num(&first);
|
||||
bc_init_num(&second);
|
||||
bc_init_num(&result);
|
||||
bc_str2num(&first,(*left)->value.str.val,scale);
|
||||
bc_str2num(&second,(*right)->value.str.val,scale);
|
||||
switch (bc_divide (first,second,&result, scale)) {
|
||||
case 0: /* OK */
|
||||
return_value->value.str.val = num2str(result);
|
||||
return_value->value.str.val = bc_num2str(result);
|
||||
return_value->value.str.len = strlen(return_value->value.str.val);
|
||||
return_value->type = IS_STRING;
|
||||
break;
|
||||
@@ -236,9 +298,9 @@ PHP_FUNCTION(bcdiv)
|
||||
php_error(E_WARNING,"Division by zero");
|
||||
break;
|
||||
}
|
||||
free_num(&first);
|
||||
free_num(&second);
|
||||
free_num(&result);
|
||||
bc_free_num(&first);
|
||||
bc_free_num(&second);
|
||||
bc_free_num(&result);
|
||||
return;
|
||||
}
|
||||
/* }}} */
|
||||
@@ -262,14 +324,14 @@ PHP_FUNCTION(bcmod)
|
||||
}
|
||||
convert_to_string_ex(left);
|
||||
convert_to_string_ex(right);
|
||||
init_num(&first);
|
||||
init_num(&second);
|
||||
init_num(&result);
|
||||
str2num(&first,(*left)->value.str.val,0);
|
||||
str2num(&second,(*right)->value.str.val,0);
|
||||
bc_init_num(&first);
|
||||
bc_init_num(&second);
|
||||
bc_init_num(&result);
|
||||
bc_str2num(&first,(*left)->value.str.val,0);
|
||||
bc_str2num(&second,(*right)->value.str.val,0);
|
||||
switch (bc_modulo(first,second,&result, 0)) {
|
||||
case 0:
|
||||
return_value->value.str.val = num2str(result);
|
||||
return_value->value.str.val = bc_num2str(result);
|
||||
return_value->value.str.len = strlen(return_value->value.str.val);
|
||||
return_value->type = IS_STRING;
|
||||
break;
|
||||
@@ -277,9 +339,9 @@ PHP_FUNCTION(bcmod)
|
||||
php_error(E_WARNING,"Division by zero");
|
||||
break;
|
||||
}
|
||||
free_num(&first);
|
||||
free_num(&second);
|
||||
free_num(&result);
|
||||
bc_free_num(&first);
|
||||
bc_free_num(&second);
|
||||
bc_free_num(&result);
|
||||
return;
|
||||
}
|
||||
/* }}} */
|
||||
@@ -311,18 +373,18 @@ PHP_FUNCTION(bcpow)
|
||||
}
|
||||
convert_to_string_ex(left);
|
||||
convert_to_string_ex(right);
|
||||
init_num(&first);
|
||||
init_num(&second);
|
||||
init_num(&result);
|
||||
str2num(&first,(*left)->value.str.val,scale);
|
||||
str2num(&second,(*right)->value.str.val,scale);
|
||||
bc_init_num(&first);
|
||||
bc_init_num(&second);
|
||||
bc_init_num(&result);
|
||||
bc_str2num(&first,(*left)->value.str.val,scale);
|
||||
bc_str2num(&second,(*right)->value.str.val,scale);
|
||||
bc_raise (first,second,&result, scale);
|
||||
return_value->value.str.val = num2str(result);
|
||||
return_value->value.str.val = bc_num2str(result);
|
||||
return_value->value.str.len = strlen(return_value->value.str.val);
|
||||
return_value->type = IS_STRING;
|
||||
free_num(&first);
|
||||
free_num(&second);
|
||||
free_num(&result);
|
||||
bc_free_num(&first);
|
||||
bc_free_num(&second);
|
||||
bc_free_num(&result);
|
||||
return;
|
||||
}
|
||||
/* }}} */
|
||||
@@ -353,16 +415,16 @@ PHP_FUNCTION(bcsqrt)
|
||||
break;
|
||||
}
|
||||
convert_to_string_ex(left);
|
||||
init_num(&result);
|
||||
str2num(&result,(*left)->value.str.val,scale);
|
||||
bc_init_num(&result);
|
||||
bc_str2num(&result,(*left)->value.str.val,scale);
|
||||
if (bc_sqrt (&result, scale) != 0) {
|
||||
return_value->value.str.val = num2str(result);
|
||||
return_value->value.str.val = bc_num2str(result);
|
||||
return_value->value.str.len = strlen(return_value->value.str.val);
|
||||
return_value->type = IS_STRING;
|
||||
} else {
|
||||
php_error(E_WARNING,"Square root of negative number");
|
||||
}
|
||||
free_num(&result);
|
||||
bc_free_num(&result);
|
||||
return;
|
||||
}
|
||||
/* }}} */
|
||||
@@ -395,16 +457,16 @@ PHP_FUNCTION(bccomp)
|
||||
|
||||
convert_to_string_ex(left);
|
||||
convert_to_string_ex(right);
|
||||
init_num(&first);
|
||||
init_num(&second);
|
||||
bc_init_num(&first);
|
||||
bc_init_num(&second);
|
||||
|
||||
str2num(&first,(*left)->value.str.val,scale);
|
||||
str2num(&second,(*right)->value.str.val,scale);
|
||||
bc_str2num(&first,(*left)->value.str.val,scale);
|
||||
bc_str2num(&second,(*right)->value.str.val,scale);
|
||||
return_value->value.lval = bc_compare(first,second);
|
||||
return_value->type = IS_LONG;
|
||||
|
||||
free_num(&first);
|
||||
free_num(&second);
|
||||
bc_free_num(&first);
|
||||
bc_free_num(&second);
|
||||
return;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -1,16 +1,14 @@
|
||||
dnl $Id$
|
||||
|
||||
PHP_ARG_ENABLE(bcmath,whether to enable bc style precision math functions,
|
||||
[ --enable-bcmath Compile with bc style precision math functions.
|
||||
Read README-BCMATH for instructions on how to
|
||||
get this module installed. ])
|
||||
PHP_ARG_ENABLE(bcmath, for bc style precision math functions,
|
||||
[ --enable-bcmath Enable bc style precision math functions.])
|
||||
|
||||
if test "$PHP_BCMATH" != "no"; then
|
||||
AC_DEFINE(WITH_BCMATH, 1, [Whether you have bcmath])
|
||||
PHP_EXTENSION(bcmath, $ext_shared)
|
||||
if test ! -f $ext_srcdir/number.c || grep "Dummy File" $ext_srcdir/number.c >/dev/null; then
|
||||
AC_MSG_ERROR(You do not have the bcmath package. Please read the README.BCMATH file.)
|
||||
fi
|
||||
PHP_FAST_OUTPUT($ext_builddir/libbcmath/Makefile $ext_builddir/libbcmath/src/Makefile)
|
||||
LIB_BUILD($ext_builddir/libbcmath,$ext_shared,yes)
|
||||
LIB_BUILD($ext_builddir/libbcmath/src,$ext_shared,yes)
|
||||
fi
|
||||
|
||||
dnl ## Local Variables:
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
Phil Nelson <philnelson@acm.org> wrote bcmath library.
|
||||
|
||||
|
||||
@@ -0,0 +1,515 @@
|
||||
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 2.1, February 1999
|
||||
|
||||
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
[This is the first released version of the Lesser GPL. It also counts
|
||||
as the successor of the GNU Library Public License, version 2, hence
|
||||
the version number 2.1.]
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
Licenses are intended to guarantee your freedom to share and change
|
||||
free software--to make sure the software is free for all its users.
|
||||
|
||||
This license, the Lesser General Public License, applies to some
|
||||
specially designated software packages--typically libraries--of the
|
||||
Free Software Foundation and other authors who decide to use it. You
|
||||
can use it too, but we suggest you first think carefully about whether
|
||||
this license or the ordinary General Public License is the better
|
||||
strategy to use in any particular case, based on the explanations
|
||||
below.
|
||||
|
||||
When we speak of free software, we are referring to freedom of use,
|
||||
not price. Our General Public Licenses are designed to make sure that
|
||||
you have the freedom to distribute copies of free software (and charge
|
||||
for this service if you wish); that you receive source code or can get
|
||||
it if you want it; that you can change the software and use pieces of
|
||||
it in new free programs; and that you are informed that you can do
|
||||
these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
distributors to deny you these rights or to ask you to surrender these
|
||||
rights. These restrictions translate to certain responsibilities for
|
||||
you if you distribute copies of the library or if you modify it.
|
||||
|
||||
For example, if you distribute copies of the library, whether gratis
|
||||
or for a fee, you must give the recipients all the rights that we gave
|
||||
you. You must make sure that they, too, receive or can get the source
|
||||
code. If you link other code with the library, you must provide
|
||||
complete object files to the recipients, so that they can relink them
|
||||
with the library after making changes to the library and recompiling
|
||||
it. And you must show them these terms so they know their rights.
|
||||
|
||||
We protect your rights with a two-step method: (1) we copyright the
|
||||
library, and (2) we offer you this license, which gives you legal
|
||||
permission to copy, distribute and/or modify the library.
|
||||
|
||||
To protect each distributor, we want to make it very clear that
|
||||
there is no warranty for the free library. Also, if the library is
|
||||
modified by someone else and passed on, the recipients should know
|
||||
that what they have is not the original version, so that the original
|
||||
author's reputation will not be affected by problems that might be
|
||||
introduced by others.
|
||||
^L
|
||||
Finally, software patents pose a constant threat to the existence of
|
||||
any free program. We wish to make sure that a company cannot
|
||||
effectively restrict the users of a free program by obtaining a
|
||||
restrictive license from a patent holder. Therefore, we insist that
|
||||
any patent license obtained for a version of the library must be
|
||||
consistent with the full freedom of use specified in this license.
|
||||
|
||||
Most GNU software, including some libraries, is covered by the
|
||||
ordinary GNU General Public License. This license, the GNU Lesser
|
||||
General Public License, applies to certain designated libraries, and
|
||||
is quite different from the ordinary General Public License. We use
|
||||
this license for certain libraries in order to permit linking those
|
||||
libraries into non-free programs.
|
||||
|
||||
When a program is linked with a library, whether statically or using
|
||||
a shared library, the combination of the two is legally speaking a
|
||||
combined work, a derivative of the original library. The ordinary
|
||||
General Public License therefore permits such linking only if the
|
||||
entire combination fits its criteria of freedom. The Lesser General
|
||||
Public License permits more lax criteria for linking other code with
|
||||
the library.
|
||||
|
||||
We call this license the "Lesser" General Public License because it
|
||||
does Less to protect the user's freedom than the ordinary General
|
||||
Public License. It also provides other free software developers Less
|
||||
of an advantage over competing non-free programs. These disadvantages
|
||||
are the reason we use the ordinary General Public License for many
|
||||
libraries. However, the Lesser license provides advantages in certain
|
||||
special circumstances.
|
||||
|
||||
For example, on rare occasions, there may be a special need to
|
||||
encourage the widest possible use of a certain library, so that it
|
||||
becomes
|
||||
a de-facto standard. To achieve this, non-free programs must be
|
||||
allowed to use the library. A more frequent case is that a free
|
||||
library does the same job as widely used non-free libraries. In this
|
||||
case, there is little to gain by limiting the free library to free
|
||||
software only, so we use the Lesser General Public License.
|
||||
|
||||
In other cases, permission to use a particular library in non-free
|
||||
programs enables a greater number of people to use a large body of
|
||||
free software. For example, permission to use the GNU C Library in
|
||||
non-free programs enables many more people to use the whole GNU
|
||||
operating system, as well as its variant, the GNU/Linux operating
|
||||
system.
|
||||
|
||||
Although the Lesser General Public License is Less protective of the
|
||||
users' freedom, it does ensure that the user of a program that is
|
||||
linked with the Library has the freedom and the wherewithal to run
|
||||
that program using a modified version of the Library.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow. Pay close attention to the difference between a
|
||||
"work based on the library" and a "work that uses the library". The
|
||||
former contains code derived from the library, whereas the latter must
|
||||
be combined with the library in order to run.
|
||||
^L
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License Agreement applies to any software library or other
|
||||
program which contains a notice placed by the copyright holder or
|
||||
other authorized party saying it may be distributed under the terms of
|
||||
this Lesser General Public License (also called "this License").
|
||||
Each licensee is addressed as "you".
|
||||
|
||||
A "library" means a collection of software functions and/or data
|
||||
prepared so as to be conveniently linked with application programs
|
||||
(which use some of those functions and data) to form executables.
|
||||
|
||||
The "Library", below, refers to any such software library or work
|
||||
which has been distributed under these terms. A "work based on the
|
||||
Library" means either the Library or any derivative work under
|
||||
copyright law: that is to say, a work containing the Library or a
|
||||
portion of it, either verbatim or with modifications and/or translated
|
||||
straightforwardly into another language. (Hereinafter, translation is
|
||||
included without limitation in the term "modification".)
|
||||
|
||||
"Source code" for a work means the preferred form of the work for
|
||||
making modifications to it. For a library, complete source code means
|
||||
all the source code for all modules it contains, plus any associated
|
||||
interface definition files, plus the scripts used to control
|
||||
compilation
|
||||
and installation of the library.
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running a program using the Library is not restricted, and output from
|
||||
such a program is covered only if its contents constitute a work based
|
||||
on the Library (independent of the use of the Library in a tool for
|
||||
writing it). Whether that is true depends on what the Library does
|
||||
and what the program that uses the Library does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's
|
||||
complete source code as you receive it, in any medium, provided that
|
||||
you conspicuously and appropriately publish on each copy an
|
||||
appropriate copyright notice and disclaimer of warranty; keep intact
|
||||
all the notices that refer to this License and to the absence of any
|
||||
warranty; and distribute a copy of this License along with the
|
||||
Library.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy,
|
||||
and you may at your option offer warranty protection in exchange for a
|
||||
fee.
|
||||
|
||||
2. You may modify your copy or copies of the Library or any portion
|
||||
of it, thus forming a work based on the Library, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) The modified work must itself be a software library.
|
||||
|
||||
b) You must cause the files modified to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
c) You must cause the whole of the work to be licensed at no
|
||||
charge to all third parties under the terms of this License.
|
||||
|
||||
d) If a facility in the modified Library refers to a function or a
|
||||
table of data to be supplied by an application program that uses
|
||||
the facility, other than as an argument passed when the facility
|
||||
is invoked, then you must make a good faith effort to ensure that,
|
||||
in the event an application does not supply such function or
|
||||
table, the facility still operates, and performs whatever part of
|
||||
its purpose remains meaningful.
|
||||
|
||||
(For example, a function in a library to compute square roots has
|
||||
a purpose that is entirely well-defined independent of the
|
||||
application. Therefore, Subsection 2d requires that any
|
||||
application-supplied function or table used by this function must
|
||||
be optional: if the application does not supply it, the square
|
||||
root function must still compute square roots.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Library,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Library, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote
|
||||
it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Library.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Library
|
||||
with the Library (or with a work based on the Library) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may opt to apply the terms of the ordinary GNU General Public
|
||||
License instead of this License to a given copy of the Library. To do
|
||||
this, you must alter all the notices that refer to this License, so
|
||||
that they refer to the ordinary GNU General Public License, version 2,
|
||||
instead of to this License. (If a newer version than version 2 of the
|
||||
ordinary GNU General Public License has appeared, then you can specify
|
||||
that version instead if you wish.) Do not make any other change in
|
||||
these notices.
|
||||
^L
|
||||
Once this change is made in a given copy, it is irreversible for
|
||||
that copy, so the ordinary GNU General Public License applies to all
|
||||
subsequent copies and derivative works made from that copy.
|
||||
|
||||
This option is useful when you wish to copy part of the code of
|
||||
the Library into a program that is not a library.
|
||||
|
||||
4. You may copy and distribute the Library (or a portion or
|
||||
derivative of it, under Section 2) in object code or executable form
|
||||
under the terms of Sections 1 and 2 above provided that you accompany
|
||||
it with the complete corresponding machine-readable source code, which
|
||||
must be distributed under the terms of Sections 1 and 2 above on a
|
||||
medium customarily used for software interchange.
|
||||
|
||||
If distribution of object code is made by offering access to copy
|
||||
from a designated place, then offering equivalent access to copy the
|
||||
source code from the same place satisfies the requirement to
|
||||
distribute the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
5. A program that contains no derivative of any portion of the
|
||||
Library, but is designed to work with the Library by being compiled or
|
||||
linked with it, is called a "work that uses the Library". Such a
|
||||
work, in isolation, is not a derivative work of the Library, and
|
||||
therefore falls outside the scope of this License.
|
||||
|
||||
However, linking a "work that uses the Library" with the Library
|
||||
creates an executable that is a derivative of the Library (because it
|
||||
contains portions of the Library), rather than a "work that uses the
|
||||
library". The executable is therefore covered by this License.
|
||||
Section 6 states terms for distribution of such executables.
|
||||
|
||||
When a "work that uses the Library" uses material from a header file
|
||||
that is part of the Library, the object code for the work may be a
|
||||
derivative work of the Library even though the source code is not.
|
||||
Whether this is true is especially significant if the work can be
|
||||
linked without the Library, or if the work is itself a library. The
|
||||
threshold for this to be true is not precisely defined by law.
|
||||
|
||||
If such an object file uses only numerical parameters, data
|
||||
structure layouts and accessors, and small macros and small inline
|
||||
functions (ten lines or less in length), then the use of the object
|
||||
file is unrestricted, regardless of whether it is legally a derivative
|
||||
work. (Executables containing this object code plus portions of the
|
||||
Library will still fall under Section 6.)
|
||||
|
||||
Otherwise, if the work is a derivative of the Library, you may
|
||||
distribute the object code for the work under the terms of Section 6.
|
||||
Any executables containing that work also fall under Section 6,
|
||||
whether or not they are linked directly with the Library itself.
|
||||
^L
|
||||
6. As an exception to the Sections above, you may also combine or
|
||||
link a "work that uses the Library" with the Library to produce a
|
||||
work containing portions of the Library, and distribute that work
|
||||
under terms of your choice, provided that the terms permit
|
||||
modification of the work for the customer's own use and reverse
|
||||
engineering for debugging such modifications.
|
||||
|
||||
You must give prominent notice with each copy of the work that the
|
||||
Library is used in it and that the Library and its use are covered by
|
||||
this License. You must supply a copy of this License. If the work
|
||||
during execution displays copyright notices, you must include the
|
||||
copyright notice for the Library among them, as well as a reference
|
||||
directing the user to the copy of this License. Also, you must do one
|
||||
of these things:
|
||||
|
||||
a) Accompany the work with the complete corresponding
|
||||
machine-readable source code for the Library including whatever
|
||||
changes were used in the work (which must be distributed under
|
||||
Sections 1 and 2 above); and, if the work is an executable linked
|
||||
with the Library, with the complete machine-readable "work that
|
||||
uses the Library", as object code and/or source code, so that the
|
||||
user can modify the Library and then relink to produce a modified
|
||||
executable containing the modified Library. (It is understood
|
||||
that the user who changes the contents of definitions files in the
|
||||
Library will not necessarily be able to recompile the application
|
||||
to use the modified definitions.)
|
||||
|
||||
b) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (1) uses at run time a
|
||||
copy of the library already present on the user's computer system,
|
||||
rather than copying library functions into the executable, and (2)
|
||||
will operate properly with a modified version of the library, if
|
||||
the user installs one, as long as the modified version is
|
||||
interface-compatible with the version that the work was made with.
|
||||
|
||||
c) Accompany the work with a written offer, valid for at
|
||||
least three years, to give the same user the materials
|
||||
specified in Subsection 6a, above, for a charge no more
|
||||
than the cost of performing this distribution.
|
||||
|
||||
d) If distribution of the work is made by offering access to copy
|
||||
from a designated place, offer equivalent access to copy the above
|
||||
specified materials from the same place.
|
||||
|
||||
e) Verify that the user has already received a copy of these
|
||||
materials or that you have already sent this user a copy.
|
||||
|
||||
For an executable, the required form of the "work that uses the
|
||||
Library" must include any data and utility programs needed for
|
||||
reproducing the executable from it. However, as a special exception,
|
||||
the materials to be distributed need not include anything that is
|
||||
normally distributed (in either source or binary form) with the major
|
||||
components (compiler, kernel, and so on) of the operating system on
|
||||
which the executable runs, unless that component itself accompanies
|
||||
the executable.
|
||||
|
||||
It may happen that this requirement contradicts the license
|
||||
restrictions of other proprietary libraries that do not normally
|
||||
accompany the operating system. Such a contradiction means you cannot
|
||||
use both them and the Library together in an executable that you
|
||||
distribute.
|
||||
^L
|
||||
7. You may place library facilities that are a work based on the
|
||||
Library side-by-side in a single library together with other library
|
||||
facilities not covered by this License, and distribute such a combined
|
||||
library, provided that the separate distribution of the work based on
|
||||
the Library and of the other library facilities is otherwise
|
||||
permitted, and provided that you do these two things:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work
|
||||
based on the Library, uncombined with any other library
|
||||
facilities. This must be distributed under the terms of the
|
||||
Sections above.
|
||||
|
||||
b) Give prominent notice with the combined library of the fact
|
||||
that part of it is a work based on the Library, and explaining
|
||||
where to find the accompanying uncombined form of the same work.
|
||||
|
||||
8. You may not copy, modify, sublicense, link with, or distribute
|
||||
the Library except as expressly provided under this License. Any
|
||||
attempt otherwise to copy, modify, sublicense, link with, or
|
||||
distribute the Library is void, and will automatically terminate your
|
||||
rights under this License. However, parties who have received copies,
|
||||
or rights, from you under this License will not have their licenses
|
||||
terminated so long as such parties remain in full compliance.
|
||||
|
||||
9. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Library or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Library (or any work based on the
|
||||
Library), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Library or works based on it.
|
||||
|
||||
10. Each time you redistribute the Library (or any work based on the
|
||||
Library), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute, link with or modify the Library
|
||||
subject to these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties with
|
||||
this License.
|
||||
^L
|
||||
11. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Library at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Library by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Library.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply, and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
12. If the distribution and/or use of the Library is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Library under this License
|
||||
may add an explicit geographical distribution limitation excluding those
|
||||
countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
13. The Free Software Foundation may publish revised and/or new
|
||||
versions of the Lesser General Public License from time to time.
|
||||
Such new versions will be similar in spirit to the present version,
|
||||
but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Library
|
||||
specifies a version number of this License which applies to it and
|
||||
"any later version", you have the option of following the terms and
|
||||
conditions either of that version or of any later version published by
|
||||
the Free Software Foundation. If the Library does not specify a
|
||||
license version number, you may choose any version ever published by
|
||||
the Free Software Foundation.
|
||||
^L
|
||||
14. If you wish to incorporate parts of the Library into other free
|
||||
programs whose distribution conditions are incompatible with these,
|
||||
write to the author to ask for permission. For software which is
|
||||
copyrighted by the Free Software Foundation, write to the Free
|
||||
Software Foundation; we sometimes make exceptions for this. Our
|
||||
decision will be guided by the two goals of preserving the free status
|
||||
of all derivatives of our free software and of promoting the sharing
|
||||
and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
||||
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
||||
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
|
||||
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
|
||||
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
||||
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
||||
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
|
||||
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
|
||||
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
|
||||
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
|
||||
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
|
||||
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
|
||||
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
||||
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
^L
|
||||
How to Apply These Terms to Your New Libraries
|
||||
|
||||
If you develop a new library, and you want it to be of the greatest
|
||||
possible use to the public, we recommend making it free software that
|
||||
everyone can redistribute and change. You can do so by permitting
|
||||
redistribution under these terms (or, alternatively, under the terms
|
||||
of the ordinary General Public License).
|
||||
|
||||
To apply these terms, attach the following notices to the library.
|
||||
It is safest to attach them to the start of each source file to most
|
||||
effectively convey the exclusion of warranty; and each file should
|
||||
have at least the "copyright" line and a pointer to where the full
|
||||
notice is found.
|
||||
|
||||
|
||||
<one line to give the library's name and a brief idea of what it
|
||||
does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
Also add information on how to contact you by electronic and paper
|
||||
mail.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or
|
||||
your
|
||||
school, if any, to sign a "copyright disclaimer" for the library, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the
|
||||
library `Frob' (a library for tweaking knobs) written by James
|
||||
Random Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1990
|
||||
Ty Coon, President of Vice
|
||||
|
||||
That's all there is to it!
|
||||
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
Wed Jun 7 09:39:02 2000 Phil Nelson <phil@cs.wwu.edu>
|
||||
|
||||
* configure.in and many others: version number now at 0.2.
|
||||
Many other changes/additions for getting a distribution
|
||||
to work.
|
||||
|
||||
2000-05-21 Phil Nelson <phil@cs.wwu.edu>
|
||||
|
||||
* Initial setup of bcmath library., calling it version 0.1.
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
BCMATH FAQ:
|
||||
|
||||
1) Why BCMATH?
|
||||
|
||||
The math routines of GNU bc become more generally useful in a
|
||||
library form. By separating the BCMATH library from GNU bc,
|
||||
GNU bc can be under the GPL and BCMATH can be under the LGPL.
|
||||
|
||||
2) Why BCMATH when GMP exists?
|
||||
|
||||
GMP has "integers" (no digits after a decimal), "rational numbers"
|
||||
(stored as 2 integers) and "floats". None of these will correctly
|
||||
represent a POSIX BC number. Floats are the closest, but will not
|
||||
behave correctly for many computations. For example, BC numbers have
|
||||
a "scale" that represent the number of digits to represent after the
|
||||
decimal point. The multiplying two of these numbers requires one to
|
||||
calculate an exact number of digits after the decimal point regardless
|
||||
of the number of digits in the integer part. GMP floats have a
|
||||
"fixed, but arbitrary" mantissa and so multiplying two floats will end
|
||||
up dropping digits BC must calculate.
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
Currently, only libbcmath.a is built. To build and install it, do
|
||||
|
||||
configure
|
||||
make
|
||||
make install
|
||||
|
||||
Typical configure parameters are available. (e.g. PREFIX)
|
||||
|
||||
Bugs and comments to philnelson@acm.org.
|
||||
@@ -0,0 +1,12 @@
|
||||
## Process this file with automake to produce Makefile.in
|
||||
|
||||
SUBDIRS= src doc
|
||||
|
||||
MAINTAINERCLEANFILES = aclocal.m4 config.h.in configure Makefile.in \
|
||||
stamp-h.in *~
|
||||
|
||||
dist-hook:
|
||||
cp $(srcdir)/doc/bcmath.1 $(distdir)/doc
|
||||
cp $(srcdir)/src/private.h $(distdir)/src
|
||||
cp $(srcdir)/FAQ $(distdir)
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
|
||||
LTLIBRARY_NAME = libbcmath.la
|
||||
LTLIBRARY_DEPENDENCIES = src/libbcmath.la
|
||||
LTLIBRARY_LIBADD = $(LTLIBRARY_DEPENDENCIES)
|
||||
LTLIBRARY_SHARED_LIBADD = $(LTLIBRARY_LIBADD)
|
||||
|
||||
SUBDIRS = src
|
||||
|
||||
include $(top_srcdir)/build/dynlib.mk
|
||||
@@ -0,0 +1,3 @@
|
||||
NEWS for bcmath library:
|
||||
|
||||
May 2000: The library is created.
|
||||
@@ -0,0 +1,9 @@
|
||||
This is bcmath, a library of arbitrary precision math routines.
|
||||
These routines, in a different form, are the routines that to
|
||||
the arbitrary precision calculations for GNU bc and GNU dc.
|
||||
|
||||
This library is provided to make these routines useful in a
|
||||
larger context with less restrictions on the use of them.
|
||||
|
||||
These routines do not duplicate functionality of the GNU gmp
|
||||
library. gmp is similar, but the actual computation is different.
|
||||
@@ -0,0 +1,9 @@
|
||||
/* PACKAGE name */
|
||||
#undef PACKAGE
|
||||
|
||||
/* Package VERSION number */
|
||||
#undef VERSION
|
||||
|
||||
/* Define to `size_t' if <sys/types.h> and <stddef.h> don't define. */
|
||||
#undef ptrdiff_t
|
||||
|
||||
Vendored
+127
@@ -0,0 +1,127 @@
|
||||
dnl aclocal.m4 generated automatically by aclocal 1.4
|
||||
|
||||
dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
|
||||
dnl This program is distributed in the hope that it will be useful,
|
||||
dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
dnl PARTICULAR PURPOSE.
|
||||
|
||||
# Do all the work for Automake. This macro actually does too much --
|
||||
# some checks are only needed if your package does certain things.
|
||||
# But this isn't really a big deal.
|
||||
|
||||
# serial 1
|
||||
|
||||
dnl Usage:
|
||||
dnl AM_INIT_AUTOMAKE(package,version, [no-define])
|
||||
|
||||
AC_DEFUN(AM_INIT_AUTOMAKE,
|
||||
[AC_REQUIRE([AC_PROG_INSTALL])
|
||||
PACKAGE=[$1]
|
||||
AC_SUBST(PACKAGE)
|
||||
VERSION=[$2]
|
||||
AC_SUBST(VERSION)
|
||||
dnl test to see if srcdir already configured
|
||||
if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
|
||||
AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
|
||||
fi
|
||||
ifelse([$3],,
|
||||
AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
|
||||
AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
|
||||
AC_REQUIRE([AM_SANITY_CHECK])
|
||||
AC_REQUIRE([AC_ARG_PROGRAM])
|
||||
dnl FIXME This is truly gross.
|
||||
missing_dir=`cd $ac_aux_dir && pwd`
|
||||
AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
|
||||
AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
|
||||
AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
|
||||
AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
|
||||
AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
|
||||
AC_REQUIRE([AC_PROG_MAKE_SET])])
|
||||
|
||||
#
|
||||
# Check to make sure that the build environment is sane.
|
||||
#
|
||||
|
||||
AC_DEFUN(AM_SANITY_CHECK,
|
||||
[AC_MSG_CHECKING([whether build environment is sane])
|
||||
# Just in case
|
||||
sleep 1
|
||||
echo timestamp > conftestfile
|
||||
# Do `set' in a subshell so we don't clobber the current shell's
|
||||
# arguments. Must try -L first in case configure is actually a
|
||||
# symlink; some systems play weird games with the mod time of symlinks
|
||||
# (eg FreeBSD returns the mod time of the symlink's containing
|
||||
# directory).
|
||||
if (
|
||||
set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
|
||||
if test "[$]*" = "X"; then
|
||||
# -L didn't work.
|
||||
set X `ls -t $srcdir/configure conftestfile`
|
||||
fi
|
||||
if test "[$]*" != "X $srcdir/configure conftestfile" \
|
||||
&& test "[$]*" != "X conftestfile $srcdir/configure"; then
|
||||
|
||||
# If neither matched, then we have a broken ls. This can happen
|
||||
# if, for instance, CONFIG_SHELL is bash and it inherits a
|
||||
# broken ls alias from the environment. This has actually
|
||||
# happened. Such a system could not be considered "sane".
|
||||
AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
|
||||
alias in your environment])
|
||||
fi
|
||||
|
||||
test "[$]2" = conftestfile
|
||||
)
|
||||
then
|
||||
# Ok.
|
||||
:
|
||||
else
|
||||
AC_MSG_ERROR([newly created file is older than distributed files!
|
||||
Check your system clock])
|
||||
fi
|
||||
rm -f conftest*
|
||||
AC_MSG_RESULT(yes)])
|
||||
|
||||
dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
|
||||
dnl The program must properly implement --version.
|
||||
AC_DEFUN(AM_MISSING_PROG,
|
||||
[AC_MSG_CHECKING(for working $2)
|
||||
# Run test in a subshell; some versions of sh will print an error if
|
||||
# an executable is not found, even if stderr is redirected.
|
||||
# Redirect stdin to placate older versions of autoconf. Sigh.
|
||||
if ($2 --version) < /dev/null > /dev/null 2>&1; then
|
||||
$1=$2
|
||||
AC_MSG_RESULT(found)
|
||||
else
|
||||
$1="$3/missing $2"
|
||||
AC_MSG_RESULT(missing)
|
||||
fi
|
||||
AC_SUBST($1)])
|
||||
|
||||
# Like AC_CONFIG_HEADER, but automatically create stamp file.
|
||||
|
||||
AC_DEFUN(AM_CONFIG_HEADER,
|
||||
[AC_PREREQ([2.12])
|
||||
AC_CONFIG_HEADER([$1])
|
||||
dnl When config.status generates a header, we must update the stamp-h file.
|
||||
dnl This file resides in the same directory as the config header
|
||||
dnl that is generated. We must strip everything past the first ":",
|
||||
dnl and everything past the last "/".
|
||||
AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
|
||||
ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
|
||||
<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
|
||||
<<am_indx=1
|
||||
for am_file in <<$1>>; do
|
||||
case " <<$>>CONFIG_HEADERS " in
|
||||
*" <<$>>am_file "*<<)>>
|
||||
echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
|
||||
;;
|
||||
esac
|
||||
am_indx=`expr "<<$>>am_indx" + 1`
|
||||
done<<>>dnl>>)
|
||||
changequote([,]))])
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
/* config.h.in. Generated automatically from configure.in by autoheader. */
|
||||
|
||||
/* Define to empty if the keyword does not work. */
|
||||
#undef const
|
||||
|
||||
/* Define to `unsigned' if <sys/types.h> doesn't define. */
|
||||
#undef size_t
|
||||
|
||||
/* Define if you have the ANSI C header files. */
|
||||
#undef STDC_HEADERS
|
||||
|
||||
/* Define to `size_t' if <sys/types.h> and <stddef.h> don't define. */
|
||||
#undef ptrdiff_t
|
||||
|
||||
/* Define if you have the <lib.h> header file. */
|
||||
#undef HAVE_LIB_H
|
||||
|
||||
/* Define if you have the <limits.h> header file. */
|
||||
#undef HAVE_LIMITS_H
|
||||
|
||||
/* Define if you have the <stdarg.h> header file. */
|
||||
#undef HAVE_STDARG_H
|
||||
|
||||
/* Define if you have the <stddef.h> header file. */
|
||||
#undef HAVE_STDDEF_H
|
||||
|
||||
/* Define if you have the <stdlib.h> header file. */
|
||||
#undef HAVE_STDLIB_H
|
||||
|
||||
/* Define if you have the <string.h> header file. */
|
||||
#undef HAVE_STRING_H
|
||||
|
||||
/* Define if you have the <unistd.h> header file. */
|
||||
#undef HAVE_UNISTD_H
|
||||
|
||||
/* Name of package */
|
||||
#undef PACKAGE
|
||||
|
||||
/* Version number of package */
|
||||
#undef VERSION
|
||||
|
||||
Vendored
+1859
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,18 @@
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
AC_INIT(doc/bcmath.1)
|
||||
AM_INIT_AUTOMAKE("bcmath", "0.2")
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
|
||||
AC_PROG_CC
|
||||
|
||||
AC_PROG_INSTALL
|
||||
AC_PROG_RANLIB
|
||||
AC_PROG_MAKE_SET
|
||||
|
||||
AC_CHECK_HEADERS(stdarg.h stddef.h stdlib.h string.h limits.h unistd.h lib.h)
|
||||
AC_C_CONST
|
||||
AC_TYPE_SIZE_T
|
||||
AC_CHECK_TYPE(ptrdiff_t, size_t)
|
||||
|
||||
AC_OUTPUT(Makefile src/Makefile doc/Makefile)
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
# Documentation makefile
|
||||
|
||||
MAINTAINERCLEANFILES= Makefile.in
|
||||
@@ -0,0 +1,171 @@
|
||||
# Makefile.in generated automatically by automake 1.4 from Makefile.am
|
||||
|
||||
# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
# Documentation makefile
|
||||
|
||||
|
||||
SHELL = @SHELL@
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
|
||||
bindir = @bindir@
|
||||
sbindir = @sbindir@
|
||||
libexecdir = @libexecdir@
|
||||
datadir = @datadir@
|
||||
sysconfdir = @sysconfdir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
localstatedir = @localstatedir@
|
||||
libdir = @libdir@
|
||||
infodir = @infodir@
|
||||
mandir = @mandir@
|
||||
includedir = @includedir@
|
||||
oldincludedir = /usr/include
|
||||
|
||||
DESTDIR =
|
||||
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
|
||||
top_builddir = ..
|
||||
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
transform = @program_transform_name@
|
||||
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
CC = @CC@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
PACKAGE = @PACKAGE@
|
||||
RANLIB = @RANLIB@
|
||||
VERSION = @VERSION@
|
||||
|
||||
MAINTAINERCLEANFILES = Makefile.in
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
CONFIG_HEADER = ../config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
DIST_COMMON = Makefile.am Makefile.in
|
||||
|
||||
|
||||
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
|
||||
|
||||
TAR = tar
|
||||
GZIP_ENV = --best
|
||||
all: all-redirect
|
||||
.SUFFIXES:
|
||||
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
cd $(top_srcdir) && $(AUTOMAKE) --foreign --include-deps doc/Makefile
|
||||
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
cd $(top_builddir) \
|
||||
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
||||
|
||||
tags: TAGS
|
||||
TAGS:
|
||||
|
||||
|
||||
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
|
||||
|
||||
subdir = doc
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@for file in $(DISTFILES); do \
|
||||
d=$(srcdir); \
|
||||
if test -d $$d/$$file; then \
|
||||
cp -pr $$/$$file $(distdir)/$$file; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file || :; \
|
||||
fi; \
|
||||
done
|
||||
info-am:
|
||||
info: info-am
|
||||
dvi-am:
|
||||
dvi: dvi-am
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
installcheck-am:
|
||||
installcheck: installcheck-am
|
||||
install-exec-am:
|
||||
install-exec: install-exec-am
|
||||
|
||||
install-data-am:
|
||||
install-data: install-data-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
install: install-am
|
||||
uninstall-am:
|
||||
uninstall: uninstall-am
|
||||
all-am: Makefile
|
||||
all-redirect: all-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
|
||||
installdirs:
|
||||
|
||||
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-rm -f Makefile $(CONFIG_CLEAN_FILES)
|
||||
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
|
||||
|
||||
maintainer-clean-generic:
|
||||
-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
|
||||
mostlyclean-am: mostlyclean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
clean-am: clean-generic mostlyclean-am
|
||||
|
||||
clean: clean-am
|
||||
|
||||
distclean-am: distclean-generic clean-am
|
||||
|
||||
distclean: distclean-am
|
||||
|
||||
maintainer-clean-am: maintainer-clean-generic distclean-am
|
||||
@echo "This command is intended for maintainers to use;"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
|
||||
.PHONY: tags distdir info-am info dvi-am dvi check check-am \
|
||||
installcheck-am installcheck install-exec-am install-exec \
|
||||
install-data-am install-data install-am install uninstall-am uninstall \
|
||||
all-redirect all-am all installdirs mostlyclean-generic \
|
||||
distclean-generic clean-generic maintainer-clean-generic clean \
|
||||
mostlyclean distclean maintainer-clean
|
||||
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
||||
@@ -0,0 +1 @@
|
||||
./" bcmath library documentation
|
||||
@@ -0,0 +1,238 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# install - install a program, script, or datafile
|
||||
# This comes from X11R5.
|
||||
#
|
||||
# Calling this script install-sh is preferred over install.sh, to prevent
|
||||
# `make' implicit rules from creating a file called install from it
|
||||
# when there is no Makefile.
|
||||
#
|
||||
# This script is compatible with the BSD install script, but was written
|
||||
# from scratch.
|
||||
#
|
||||
|
||||
|
||||
# set DOITPROG to echo to test this script
|
||||
|
||||
# Don't use :- since 4.3BSD and earlier shells don't like it.
|
||||
doit="${DOITPROG-}"
|
||||
|
||||
|
||||
# put in absolute paths if you don't have them in your path; or use env. vars.
|
||||
|
||||
mvprog="${MVPROG-mv}"
|
||||
cpprog="${CPPROG-cp}"
|
||||
chmodprog="${CHMODPROG-chmod}"
|
||||
chownprog="${CHOWNPROG-chown}"
|
||||
chgrpprog="${CHGRPPROG-chgrp}"
|
||||
stripprog="${STRIPPROG-strip}"
|
||||
rmprog="${RMPROG-rm}"
|
||||
mkdirprog="${MKDIRPROG-mkdir}"
|
||||
|
||||
tranformbasename=""
|
||||
transform_arg=""
|
||||
instcmd="$mvprog"
|
||||
chmodcmd="$chmodprog 0755"
|
||||
chowncmd=""
|
||||
chgrpcmd=""
|
||||
stripcmd=""
|
||||
rmcmd="$rmprog -f"
|
||||
mvcmd="$mvprog"
|
||||
src=""
|
||||
dst=""
|
||||
dir_arg=""
|
||||
|
||||
while [ x"$1" != x ]; do
|
||||
case $1 in
|
||||
-c) instcmd="$cpprog"
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-d) dir_arg=true
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-m) chmodcmd="$chmodprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-o) chowncmd="$chownprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-g) chgrpcmd="$chgrpprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-s) stripcmd="$stripprog"
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-t=*) transformarg=`echo $1 | sed 's/-t=//'`
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
|
||||
shift
|
||||
continue;;
|
||||
|
||||
*) if [ x"$src" = x ]
|
||||
then
|
||||
src=$1
|
||||
else
|
||||
# this colon is to work around a 386BSD /bin/sh bug
|
||||
:
|
||||
dst=$1
|
||||
fi
|
||||
shift
|
||||
continue;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ x"$src" = x ]
|
||||
then
|
||||
echo "install: no input file specified"
|
||||
exit 1
|
||||
else
|
||||
true
|
||||
fi
|
||||
|
||||
if [ x"$dir_arg" != x ]; then
|
||||
dst=$src
|
||||
src=""
|
||||
|
||||
if [ -d $dst ]; then
|
||||
instcmd=:
|
||||
else
|
||||
instcmd=mkdir
|
||||
fi
|
||||
else
|
||||
|
||||
# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
|
||||
# might cause directories to be created, which would be especially bad
|
||||
# if $src (and thus $dsttmp) contains '*'.
|
||||
|
||||
if [ -f $src -o -d $src ]
|
||||
then
|
||||
true
|
||||
else
|
||||
echo "install: $src does not exist"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ x"$dst" = x ]
|
||||
then
|
||||
echo "install: no destination specified"
|
||||
exit 1
|
||||
else
|
||||
true
|
||||
fi
|
||||
|
||||
# If destination is a directory, append the input filename; if your system
|
||||
# does not like double slashes in filenames, you may need to add some logic
|
||||
|
||||
if [ -d $dst ]
|
||||
then
|
||||
dst="$dst"/`basename $src`
|
||||
else
|
||||
true
|
||||
fi
|
||||
fi
|
||||
|
||||
## this sed command emulates the dirname command
|
||||
dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
|
||||
|
||||
# Make sure that the destination directory exists.
|
||||
# this part is taken from Noah Friedman's mkinstalldirs script
|
||||
|
||||
# Skip lots of stat calls in the usual case.
|
||||
if [ ! -d "$dstdir" ]; then
|
||||
defaultIFS='
|
||||
'
|
||||
IFS="${IFS-${defaultIFS}}"
|
||||
|
||||
oIFS="${IFS}"
|
||||
# Some sh's can't handle IFS=/ for some reason.
|
||||
IFS='%'
|
||||
set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
|
||||
IFS="${oIFS}"
|
||||
|
||||
pathcomp=''
|
||||
|
||||
while [ $# -ne 0 ] ; do
|
||||
pathcomp="${pathcomp}${1}"
|
||||
shift
|
||||
|
||||
if [ ! -d "${pathcomp}" ] ;
|
||||
then
|
||||
$mkdirprog "${pathcomp}"
|
||||
else
|
||||
true
|
||||
fi
|
||||
|
||||
pathcomp="${pathcomp}/"
|
||||
done
|
||||
fi
|
||||
|
||||
if [ x"$dir_arg" != x ]
|
||||
then
|
||||
$doit $instcmd $dst &&
|
||||
|
||||
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
|
||||
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
|
||||
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
|
||||
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
|
||||
else
|
||||
|
||||
# If we're going to rename the final executable, determine the name now.
|
||||
|
||||
if [ x"$transformarg" = x ]
|
||||
then
|
||||
dstfile=`basename $dst`
|
||||
else
|
||||
dstfile=`basename $dst $transformbasename |
|
||||
sed $transformarg`$transformbasename
|
||||
fi
|
||||
|
||||
# don't allow the sed command to completely eliminate the filename
|
||||
|
||||
if [ x"$dstfile" = x ]
|
||||
then
|
||||
dstfile=`basename $dst`
|
||||
else
|
||||
true
|
||||
fi
|
||||
|
||||
# Make a temp file name in the proper directory.
|
||||
|
||||
dsttmp=$dstdir/#inst.$$#
|
||||
|
||||
# Move or copy the file name to the temp name
|
||||
|
||||
$doit $instcmd $src $dsttmp &&
|
||||
|
||||
trap "rm -f ${dsttmp}" 0 &&
|
||||
|
||||
# and set any options; do chmod last to preserve setuid bits
|
||||
|
||||
# If any of these fail, we abort the whole thing. If we want to
|
||||
# ignore errors from any of these, just make sure not to ignore
|
||||
# errors from the above "$doit $instcmd $src $dsttmp" command.
|
||||
|
||||
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
|
||||
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
|
||||
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
|
||||
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
|
||||
|
||||
# Now rename the file to the real destination.
|
||||
|
||||
$doit $rmcmd -f $dstdir/$dstfile &&
|
||||
$doit $mvcmd $dsttmp $dstdir/$dstfile
|
||||
|
||||
fi &&
|
||||
|
||||
|
||||
exit 0
|
||||
@@ -0,0 +1,134 @@
|
||||
#! /bin/sh
|
||||
# Common stub for a few missing GNU programs while installing.
|
||||
# Copyright (C) 1996, 1997 Free Software Foundation, Inc.
|
||||
# Franc,ois Pinard <pinard@iro.umontreal.ca>, 1996.
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
# 02111-1307, USA.
|
||||
|
||||
if test $# -eq 0; then
|
||||
echo 1>&2 "Try \`$0 --help' for more information"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
case "$1" in
|
||||
|
||||
-h|--h|--he|--hel|--help)
|
||||
echo "\
|
||||
$0 [OPTION]... PROGRAM [ARGUMENT]...
|
||||
|
||||
Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
|
||||
error status if there is no known handling for PROGRAM.
|
||||
|
||||
Options:
|
||||
-h, --help display this help and exit
|
||||
-v, --version output version information and exit
|
||||
|
||||
Supported PROGRAM values:
|
||||
aclocal touch file \`aclocal.m4'
|
||||
autoconf touch file \`configure'
|
||||
autoheader touch file \`config.h.in'
|
||||
automake touch all \`Makefile.in' files
|
||||
bison touch file \`y.tab.c'
|
||||
makeinfo touch the output file
|
||||
yacc touch file \`y.tab.c'"
|
||||
;;
|
||||
|
||||
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
|
||||
echo "missing - GNU libit 0.0"
|
||||
;;
|
||||
|
||||
-*)
|
||||
echo 1>&2 "$0: Unknown \`$1' option"
|
||||
echo 1>&2 "Try \`$0 --help' for more information"
|
||||
exit 1
|
||||
;;
|
||||
|
||||
aclocal)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is missing on your system. It should be needed only if
|
||||
you modified \`acinclude.m4' or \`configure.in'. You might want
|
||||
to install the \`Automake' and \`Perl' packages. Grab them from
|
||||
any GNU archive site."
|
||||
touch aclocal.m4
|
||||
;;
|
||||
|
||||
autoconf)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is missing on your system. It should be needed only if
|
||||
you modified \`configure.in'. You might want to install the
|
||||
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU
|
||||
archive site."
|
||||
touch configure
|
||||
;;
|
||||
|
||||
autoheader)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is missing on your system. It should be needed only if
|
||||
you modified \`acconfig.h' or \`configure.in'. You might want
|
||||
to install the \`Autoconf' and \`GNU m4' packages. Grab them
|
||||
from any GNU archive site."
|
||||
touch config.h.in
|
||||
;;
|
||||
|
||||
automake)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is missing on your system. It should be needed only if
|
||||
you modified \`Makefile.am', \`acinclude.m4' or \`configure.in'.
|
||||
You might want to install the \`Automake' and \`Perl' packages.
|
||||
Grab them from any GNU archive site."
|
||||
find . -type f -name Makefile.am -print \
|
||||
| sed 's/^\(.*\).am$/touch \1.in/' \
|
||||
| sh
|
||||
;;
|
||||
|
||||
bison|yacc)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is missing on your system. It should be needed only if
|
||||
your modified any \`.y' file. For being effective, your
|
||||
modifications might require the \`Bison' package. Grab it from
|
||||
any GNU archive site."
|
||||
touch y.tab.c
|
||||
;;
|
||||
|
||||
makeinfo)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is missing on your system. It should be needed only if
|
||||
you modified a \`.texi' or \`.texinfo' file, or any other file
|
||||
indirectly affecting the aspect of the manual. The spurious
|
||||
call might also be the consequence of using a buggy \`make' (AIX,
|
||||
DU, IRIX). You might want to install the \`Texinfo' package or
|
||||
the \`GNU make' package. Grab either from any GNU archive site."
|
||||
file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
|
||||
if test -z "$file"; then
|
||||
file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
|
||||
file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file`
|
||||
fi
|
||||
touch $file
|
||||
;;
|
||||
|
||||
*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is needed, and you do not seem to have it handy on your
|
||||
system. You might have modified some files without having the
|
||||
proper tools for further handling them. Check the \`README' file,
|
||||
it often tells you about the needed prerequirements for installing
|
||||
this package. You may also peek at any GNU archive site, in case
|
||||
some other package would contain this missing \`$1' program."
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
@@ -0,0 +1,36 @@
|
||||
#! /bin/sh
|
||||
# mkinstalldirs --- make directory hierarchy
|
||||
# Author: Noah Friedman <friedman@prep.ai.mit.edu>
|
||||
# Created: 1993-05-16
|
||||
# Last modified: 1994-03-25
|
||||
# Public domain
|
||||
|
||||
errstatus=0
|
||||
|
||||
for file in ${1+"$@"} ; do
|
||||
set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
|
||||
shift
|
||||
|
||||
pathcomp=
|
||||
for d in ${1+"$@"} ; do
|
||||
pathcomp="$pathcomp$d"
|
||||
case "$pathcomp" in
|
||||
-* ) pathcomp=./$pathcomp ;;
|
||||
esac
|
||||
|
||||
if test ! -d "$pathcomp"; then
|
||||
echo "mkdir $pathcomp" 1>&2
|
||||
mkdir "$pathcomp" > /dev/null 2>&1 || lasterr=$?
|
||||
fi
|
||||
|
||||
if test ! -d "$pathcomp"; then
|
||||
errstatus=$lasterr
|
||||
fi
|
||||
|
||||
pathcomp="$pathcomp/"
|
||||
done
|
||||
done
|
||||
|
||||
exit $errstatus
|
||||
|
||||
# mkinstalldirs ends here
|
||||
@@ -0,0 +1,21 @@
|
||||
# Makefile for bcmath library
|
||||
|
||||
lib_LIBRARIES = libbcmath.a
|
||||
|
||||
include_HEADERS = bcmath.h
|
||||
|
||||
libbcmath_a_SOURCES= add.c compare.c debug.c div.c divmod.c doaddsub.c \
|
||||
init.c int2num.c nearzero.c neg.c num2long.c num2str.c output.c \
|
||||
raise.c raisemod.c recmul.c rmzero.c sqrt.c str2num.c sub.c zero.c \
|
||||
outofmem.c rt.c
|
||||
|
||||
INCLUDES = -I$(srcdir) -I..
|
||||
|
||||
CFLAGS = @CFLAGS@ $(INCLUDES) -Wall
|
||||
|
||||
MAINTAINERCLEANFILES= Makefile.in $(libbcmath_a_SOURCES) private.h bcmath.h
|
||||
|
||||
all: $(bin_LIBRARIES)
|
||||
|
||||
clean:
|
||||
rm -f $(OBJS) $(LIB) *~
|
||||
@@ -0,0 +1,7 @@
|
||||
LTLIBRARY_NAME = libbcmath.la
|
||||
LTLIBRARY_SOURCES = add.c div.c init.c neg.c outofmem.c raisemod.c rt.c sub.c \
|
||||
compare.c divmod.c int2num.c num2long.c output.c recmul.c \
|
||||
sqrt.c zero.c debug.c doaddsub.c nearzero.c num2str.c raise.c \
|
||||
rmzero.c str2num.c
|
||||
|
||||
include $(top_srcdir)/build/dynlib.mk
|
||||
@@ -0,0 +1,88 @@
|
||||
/* add.c: bcmath library file. */
|
||||
/*
|
||||
Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc.
|
||||
Copyright (C) 2000 Philip A. Nelson
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details. (COPYING.LIB)
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to:
|
||||
|
||||
The Free Software Foundation, Inc.
|
||||
59 Temple Place, Suite 330
|
||||
Boston, MA 02111-1307 USA.
|
||||
|
||||
You may contact the author by:
|
||||
e-mail: philnelson@acm.org
|
||||
us-mail: Philip A. Nelson
|
||||
Computer Science Department, 9062
|
||||
Western Washington University
|
||||
Bellingham, WA 98226-9062
|
||||
|
||||
*************************************************************************/
|
||||
|
||||
#include <config.h>
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
#include <stdarg.h>
|
||||
#include "bcmath.h"
|
||||
#include "private.h"
|
||||
|
||||
|
||||
/* Here is the full add routine that takes care of negative numbers.
|
||||
N1 is added to N2 and the result placed into RESULT. SCALE_MIN
|
||||
is the minimum scale for the result. */
|
||||
|
||||
void
|
||||
bc_add (n1, n2, result, scale_min)
|
||||
bc_num n1, n2, *result;
|
||||
int scale_min;
|
||||
{
|
||||
bc_num sum = NULL;
|
||||
int cmp_res;
|
||||
int res_scale;
|
||||
|
||||
if (n1->n_sign == n2->n_sign)
|
||||
{
|
||||
sum = _bc_do_add (n1, n2, scale_min);
|
||||
sum->n_sign = n1->n_sign;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* subtraction must be done. */
|
||||
cmp_res = _bc_do_compare (n1, n2, FALSE, FALSE); /* Compare magnitudes. */
|
||||
switch (cmp_res)
|
||||
{
|
||||
case -1:
|
||||
/* n1 is less than n2, subtract n1 from n2. */
|
||||
sum = _bc_do_sub (n2, n1, scale_min);
|
||||
sum->n_sign = n2->n_sign;
|
||||
break;
|
||||
case 0:
|
||||
/* They are equal! return zero with the correct scale! */
|
||||
res_scale = MAX (scale_min, MAX(n1->n_scale, n2->n_scale));
|
||||
sum = bc_new_num (1, res_scale);
|
||||
memset (sum->n_value, 0, res_scale+1);
|
||||
break;
|
||||
case 1:
|
||||
/* n2 is less than n1, subtract n2 from n1. */
|
||||
sum = _bc_do_sub (n1, n2, scale_min);
|
||||
sum->n_sign = n1->n_sign;
|
||||
}
|
||||
}
|
||||
|
||||
/* Clean up and return. */
|
||||
bc_free_num (result);
|
||||
*result = sum;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,158 @@
|
||||
/* bcmath.h: bcmath library header. */
|
||||
/*
|
||||
Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc.
|
||||
Copyright (C) 2000 Philip A. Nelson
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details. (COPYING.LIB)
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to:
|
||||
|
||||
The Free Software Foundation, Inc.
|
||||
59 Temple Place, Suite 330
|
||||
Boston, MA 02111-1307 USA.
|
||||
|
||||
You may contact the author by:
|
||||
e-mail: philnelson@acm.org
|
||||
us-mail: Philip A. Nelson
|
||||
Computer Science Department, 9062
|
||||
Western Washington University
|
||||
Bellingham, WA 98226-9062
|
||||
|
||||
*************************************************************************/
|
||||
|
||||
#ifndef _BCMATH_H_
|
||||
#define _BCMATH_H_
|
||||
|
||||
typedef enum {PLUS, MINUS} sign;
|
||||
|
||||
typedef struct bc_struct *bc_num;
|
||||
|
||||
typedef struct bc_struct
|
||||
{
|
||||
sign n_sign;
|
||||
int n_len; /* The number of digits before the decimal point. */
|
||||
int n_scale; /* The number of digits after the decimal point. */
|
||||
int n_refs; /* The number of pointers to this number. */
|
||||
bc_num n_next; /* Linked list for available list. */
|
||||
char *n_ptr; /* The pointer to the actual storage.
|
||||
If NULL, n_value points to the inside of
|
||||
another number (bc_multiply...) and should
|
||||
not be "freed." */
|
||||
char *n_value; /* The number. Not zero char terminated.
|
||||
May not point to the same place as n_ptr as
|
||||
in the case of leading zeros generated. */
|
||||
} bc_struct;
|
||||
|
||||
|
||||
/* The base used in storing the numbers in n_value above.
|
||||
Currently this MUST be 10. */
|
||||
|
||||
#define BASE 10
|
||||
|
||||
/* Some useful macros and constants. */
|
||||
|
||||
#define CH_VAL(c) (c - '0')
|
||||
#define BCD_CHAR(d) (d + '0')
|
||||
|
||||
#ifdef MIN
|
||||
#undef MIN
|
||||
#undef MAX
|
||||
#endif
|
||||
#define MAX(a,b) ((a)>(b)?(a):(b))
|
||||
#define MIN(a,b) ((a)>(b)?(b):(a))
|
||||
#define ODD(a) ((a)&1)
|
||||
|
||||
#ifndef TRUE
|
||||
#define TRUE 1
|
||||
#define FALSE 0
|
||||
#endif
|
||||
|
||||
#ifndef LONG_MAX
|
||||
#define LONG_MAX 0x7ffffff
|
||||
#endif
|
||||
|
||||
|
||||
/* Global numbers. */
|
||||
extern bc_num _zero_;
|
||||
extern bc_num _one_;
|
||||
extern bc_num _two_;
|
||||
|
||||
|
||||
/* Function Prototypes */
|
||||
|
||||
/* Define the _PROTOTYPE macro if it is needed. */
|
||||
|
||||
#ifndef _PROTOTYPE
|
||||
#ifdef __STDC__
|
||||
#define _PROTOTYPE(func, args) func args
|
||||
#else
|
||||
#define _PROTOTYPE(func, args) func()
|
||||
#endif
|
||||
#endif
|
||||
|
||||
_PROTOTYPE(void bc_init_numbers, (void));
|
||||
|
||||
_PROTOTYPE(bc_num bc_new_num, (int length, int scale));
|
||||
|
||||
_PROTOTYPE(void bc_free_num, (bc_num *num));
|
||||
|
||||
_PROTOTYPE(bc_num bc_copy_num, (bc_num num));
|
||||
|
||||
_PROTOTYPE(void bc_init_num, (bc_num *num));
|
||||
|
||||
_PROTOTYPE(void bc_str2num, (bc_num *num, char *str, int scale));
|
||||
|
||||
_PROTOTYPE(char *bc_num2str, (bc_num num));
|
||||
|
||||
_PROTOTYPE(void bc_int2num, (bc_num *num, int val));
|
||||
|
||||
_PROTOTYPE(long bc_num2long, (bc_num num));
|
||||
|
||||
_PROTOTYPE(int bc_compare, (bc_num n1, bc_num n2));
|
||||
|
||||
_PROTOTYPE(char bc_is_zero, (bc_num num));
|
||||
|
||||
_PROTOTYPE(char bc_is_near_zero, (bc_num num, int scale));
|
||||
|
||||
_PROTOTYPE(char bc_is_neg, (bc_num num));
|
||||
|
||||
_PROTOTYPE(void bc_add, (bc_num n1, bc_num n2, bc_num *result, int scale_min));
|
||||
|
||||
_PROTOTYPE(void bc_sub, (bc_num n1, bc_num n2, bc_num *result, int scale_min));
|
||||
|
||||
_PROTOTYPE(void bc_multiply, (bc_num n1, bc_num n2, bc_num *prod, int scale));
|
||||
|
||||
_PROTOTYPE(int bc_divide, (bc_num n1, bc_num n2, bc_num *quot, int scale));
|
||||
|
||||
_PROTOTYPE(int bc_modulo, (bc_num num1, bc_num num2, bc_num *result,
|
||||
int scale));
|
||||
|
||||
_PROTOTYPE(int bc_divmod, (bc_num num1, bc_num num2, bc_num *quot,
|
||||
bc_num *rem, int scale));
|
||||
|
||||
_PROTOTYPE(int bc_raisemod, (bc_num base, bc_num expo, bc_num mod,
|
||||
bc_num *result, int scale));
|
||||
|
||||
_PROTOTYPE(void bc_raise, (bc_num num1, bc_num num2, bc_num *result,
|
||||
int scale));
|
||||
|
||||
_PROTOTYPE(int bc_sqrt, (bc_num *num, int scale));
|
||||
|
||||
_PROTOTYPE(void bc_out_num, (bc_num num, int o_base, void (* out_char)(int),
|
||||
int leading_zero));
|
||||
|
||||
/* Prototypes needed for external utility routines. */
|
||||
|
||||
_PROTOTYPE(void bc_rt_warn, (char *mesg ,...));
|
||||
_PROTOTYPE(void bc_rt_error, (char *mesg ,...));
|
||||
_PROTOTYPE(void bc_out_of_memory, (void));
|
||||
#endif
|
||||
@@ -0,0 +1,161 @@
|
||||
/* compare.c: bcmath library file. */
|
||||
/*
|
||||
Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc.
|
||||
Copyright (C) 2000 Philip A. Nelson
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details. (COPYING.LIB)
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to:
|
||||
|
||||
The Free Software Foundation, Inc.
|
||||
59 Temple Place, Suite 330
|
||||
Boston, MA 02111-1307 USA.
|
||||
|
||||
You may contact the author by:
|
||||
e-mail: philnelson@acm.org
|
||||
us-mail: Philip A. Nelson
|
||||
Computer Science Department, 9062
|
||||
Western Washington University
|
||||
Bellingham, WA 98226-9062
|
||||
|
||||
*************************************************************************/
|
||||
|
||||
#include <config.h>
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
#include <stdarg.h>
|
||||
#include "bcmath.h"
|
||||
#include "private.h"
|
||||
|
||||
|
||||
/* Compare two bc numbers. Return value is 0 if equal, -1 if N1 is less
|
||||
than N2 and +1 if N1 is greater than N2. If USE_SIGN is false, just
|
||||
compare the magnitudes. */
|
||||
|
||||
int
|
||||
_bc_do_compare (n1, n2, use_sign, ignore_last)
|
||||
bc_num n1, n2;
|
||||
int use_sign;
|
||||
int ignore_last;
|
||||
{
|
||||
char *n1ptr, *n2ptr;
|
||||
int count;
|
||||
|
||||
/* First, compare signs. */
|
||||
if (use_sign && n1->n_sign != n2->n_sign)
|
||||
{
|
||||
if (n1->n_sign == PLUS)
|
||||
return (1); /* Positive N1 > Negative N2 */
|
||||
else
|
||||
return (-1); /* Negative N1 < Positive N1 */
|
||||
}
|
||||
|
||||
/* Now compare the magnitude. */
|
||||
if (n1->n_len != n2->n_len)
|
||||
{
|
||||
if (n1->n_len > n2->n_len)
|
||||
{
|
||||
/* Magnitude of n1 > n2. */
|
||||
if (!use_sign || n1->n_sign == PLUS)
|
||||
return (1);
|
||||
else
|
||||
return (-1);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Magnitude of n1 < n2. */
|
||||
if (!use_sign || n1->n_sign == PLUS)
|
||||
return (-1);
|
||||
else
|
||||
return (1);
|
||||
}
|
||||
}
|
||||
|
||||
/* If we get here, they have the same number of integer digits.
|
||||
check the integer part and the equal length part of the fraction. */
|
||||
count = n1->n_len + MIN (n1->n_scale, n2->n_scale);
|
||||
n1ptr = n1->n_value;
|
||||
n2ptr = n2->n_value;
|
||||
|
||||
while ((count > 0) && (*n1ptr == *n2ptr))
|
||||
{
|
||||
n1ptr++;
|
||||
n2ptr++;
|
||||
count--;
|
||||
}
|
||||
if (ignore_last && count == 1 && n1->n_scale == n2->n_scale)
|
||||
return (0);
|
||||
if (count != 0)
|
||||
{
|
||||
if (*n1ptr > *n2ptr)
|
||||
{
|
||||
/* Magnitude of n1 > n2. */
|
||||
if (!use_sign || n1->n_sign == PLUS)
|
||||
return (1);
|
||||
else
|
||||
return (-1);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Magnitude of n1 < n2. */
|
||||
if (!use_sign || n1->n_sign == PLUS)
|
||||
return (-1);
|
||||
else
|
||||
return (1);
|
||||
}
|
||||
}
|
||||
|
||||
/* They are equal up to the last part of the equal part of the fraction. */
|
||||
if (n1->n_scale != n2->n_scale)
|
||||
{
|
||||
if (n1->n_scale > n2->n_scale)
|
||||
{
|
||||
for (count = n1->n_scale-n2->n_scale; count>0; count--)
|
||||
if (*n1ptr++ != 0)
|
||||
{
|
||||
/* Magnitude of n1 > n2. */
|
||||
if (!use_sign || n1->n_sign == PLUS)
|
||||
return (1);
|
||||
else
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (count = n2->n_scale-n1->n_scale; count>0; count--)
|
||||
if (*n2ptr++ != 0)
|
||||
{
|
||||
/* Magnitude of n1 < n2. */
|
||||
if (!use_sign || n1->n_sign == PLUS)
|
||||
return (-1);
|
||||
else
|
||||
return (1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* They must be equal! */
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
/* This is the "user callable" routine to compare numbers N1 and N2. */
|
||||
|
||||
int
|
||||
bc_compare (n1, n2)
|
||||
bc_num n1, n2;
|
||||
{
|
||||
return _bc_do_compare (n1, n2, TRUE, FALSE);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
#if PHP_WIN32
|
||||
#include "../../../../main/config.w32.h"
|
||||
#else
|
||||
#include "php_config.h"
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
#include "zend.h"
|
||||
#include "zend_alloc.h"
|
||||
Loaded 100 of 652 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user