Compare commits
5441 Commits
tags/Alias
...
tags/XTech
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cf03213784 | ||
|
|
fd87815682 | ||
|
|
113dd31506 | ||
|
|
e0ded8d07f | ||
|
|
af5f1235c4 | ||
|
|
c3e3b1e67e | ||
|
|
031a23772b | ||
|
|
9ae1a51751 | ||
|
|
d8b06455af | ||
|
|
b3427e2a63 | ||
|
|
5a1bf02774 | ||
|
|
f9ff0cab61 | ||
|
|
a01e1fe820 | ||
|
|
d756a36bab | ||
|
|
83118f458a | ||
|
|
b443d2b304 | ||
|
|
8cf03a78ef | ||
|
|
7ff8c2a247 | ||
|
|
98d535f887 | ||
|
|
7313babfcb | ||
|
|
1e7bef47df | ||
|
|
164e781dbc | ||
|
|
511fa6c14c | ||
|
|
d5e75c7d94 | ||
|
|
3dd33ad63b | ||
|
|
9d515e0513 | ||
|
|
d98dcab829 | ||
|
|
72cb40d845 | ||
|
|
4780230a1d | ||
|
|
5592159ebd | ||
|
|
9239ed95dd | ||
|
|
4736f6084f | ||
|
|
c661625f46 | ||
|
|
026fef7a70 | ||
|
|
67096e4b06 | ||
|
|
fe443b1dbc | ||
|
|
a3003dd0a7 | ||
|
|
74b2238e29 | ||
|
|
9a4012c5b8 | ||
|
|
7bc46690b0 | ||
|
|
79123cdd98 | ||
|
|
5b16286cc0 | ||
|
|
3b2c55c209 | ||
|
|
38897658fa | ||
|
|
46f41b71a8 | ||
|
|
2aec37a819 | ||
|
|
fb21fe920d | ||
|
|
9190e73493 | ||
|
|
83439792ed | ||
|
|
b4f129401a | ||
|
|
232c2ffdce | ||
|
|
2b5bea4428 | ||
|
|
7f108b671e | ||
|
|
5223ba1452 | ||
|
|
9fe16eb6c4 | ||
|
|
af30301e84 | ||
|
|
2e0ae08fae | ||
|
|
6cc33f9350 | ||
|
|
af29355e8a | ||
|
|
b23e6b922a | ||
|
|
de9ca81516 | ||
|
|
9213603d11 | ||
|
|
bb4b081b1b | ||
|
|
dc6c858162 | ||
|
|
827abf76bc | ||
|
|
14b924f8e0 | ||
|
|
ccf6efce70 | ||
|
|
59d44590bd | ||
|
|
d52ad49e78 | ||
|
|
7adb2960f6 | ||
|
|
1818e38ea9 | ||
|
|
5ef8989937 | ||
|
|
9436817838 | ||
|
|
0a2a335945 | ||
|
|
b2cfd19d76 | ||
|
|
fba67216e8 | ||
|
|
9e4dad31a3 | ||
|
|
612f1b91bb | ||
|
|
c7088fcd96 | ||
|
|
f72fba19b7 | ||
|
|
4a8b00ac6d | ||
|
|
a4d010ff01 | ||
|
|
1ef728f3b2 | ||
|
|
20e2e66622 | ||
|
|
d2cc526401 | ||
|
|
6d580baadb | ||
|
|
00b6a4565e | ||
|
|
43ffe46441 | ||
|
|
b4b583d080 | ||
|
|
9375f1534d | ||
|
|
54957da9be | ||
|
|
692fd40e64 | ||
|
|
07854ec1b1 | ||
|
|
f1b7db0183 | ||
|
|
ae57673853 | ||
|
|
0919f76f35 | ||
|
|
5c7abd2ef9 | ||
|
|
b7b8376c6f | ||
|
|
a7a0e613b0 | ||
|
|
93a813dc24 | ||
|
|
406b124f2f | ||
|
|
a3439ca560 | ||
|
|
7b2d482943 | ||
|
|
a6760a0dec | ||
|
|
357801b38b | ||
|
|
e9ec617591 | ||
|
|
2d630f0db3 | ||
|
|
f3a1187961 | ||
|
|
a6e67ce7c6 | ||
|
|
922cde30d3 | ||
|
|
0f5602af49 | ||
|
|
e4a8d65787 | ||
|
|
98631882f9 | ||
|
|
7a7332eebd | ||
|
|
fde3db03f4 | ||
|
|
ea7fabcacf | ||
|
|
10fef5a529 | ||
|
|
a15d906398 | ||
|
|
42e0f0d865 | ||
|
|
fd08ec9642 | ||
|
|
1d6337aad3 | ||
|
|
031f64cd45 | ||
|
|
9a50248463 | ||
|
|
03d4988d0b | ||
|
|
1b29b161a4 | ||
|
|
46ee5bae96 | ||
|
|
99235ba41d | ||
|
|
186b6ff87a | ||
|
|
c75df5584b | ||
|
|
172680187e | ||
|
|
300d98c6fa | ||
|
|
f1421ae8d2 | ||
|
|
9b0f1dbc06 | ||
|
|
bd2671513e | ||
|
|
694566ce25 | ||
|
|
5ae2774317 | ||
|
|
e18d387533 | ||
|
|
fef280bf65 | ||
|
|
1062153d54 | ||
|
|
a66a8179b4 | ||
|
|
d3c05dfd48 | ||
|
|
9835083454 | ||
|
|
d9c1423d1e | ||
|
|
f94fca5d21 | ||
|
|
da12888a42 | ||
|
|
334560b897 | ||
|
|
13d995b822 | ||
|
|
b9dbb43f34 | ||
|
|
534160d16b | ||
|
|
3dcbcaa251 | ||
|
|
cec2fe742e | ||
|
|
1bb4856df5 | ||
|
|
975ac58a63 | ||
|
|
abf578071d | ||
|
|
f6fa0eaa90 | ||
|
|
877afbbea8 | ||
|
|
b74eeab8e0 | ||
|
|
8dfc6228f7 | ||
|
|
c25d436614 | ||
|
|
7375193b56 | ||
|
|
02eb7be6cb | ||
|
|
d4a9bfe19f | ||
|
|
5ffaf359cb | ||
|
|
f8cf8b500f | ||
|
|
862dafa27c | ||
|
|
6f6025f993 | ||
|
|
28ead7db61 | ||
|
|
4796874851 | ||
|
|
f6b3edfc94 | ||
|
|
3724c2ae4d | ||
|
|
16845338f6 | ||
|
|
6f7747af12 | ||
|
|
5ecec240af | ||
|
|
05f05cbc5c | ||
|
|
4a5bfcecf4 | ||
|
|
acfa7037f5 | ||
|
|
83f13a4b98 | ||
|
|
bde6ee5483 | ||
|
|
56f2a19d6e | ||
|
|
1a261f0163 | ||
|
|
698034ee52 | ||
|
|
ffd655ab4a | ||
|
|
74e10ba6d1 | ||
|
|
668fa3d44c | ||
|
|
6d1d5f3315 | ||
|
|
c75a33adec | ||
|
|
0e1f8526be | ||
|
|
165659caa3 | ||
|
|
818ef5f99b | ||
|
|
03ccb229ff | ||
|
|
6a355cdc1f | ||
|
|
1e383b5280 | ||
|
|
875f6e8d4d | ||
|
|
3eea650eac | ||
|
|
4facbaa6b0 | ||
|
|
36c680cad0 | ||
|
|
0f7ea6b1c9 | ||
|
|
49f460ef71 | ||
|
|
32bebb7ee2 | ||
|
|
efcc286270 | ||
|
|
40af69629d | ||
|
|
cfdfa76120 | ||
|
|
ba94b65a25 | ||
|
|
c1635e9bde | ||
|
|
938159a86b | ||
|
|
25ba927616 | ||
|
|
140e5d6e81 | ||
|
|
7952f9448e | ||
|
|
6cb22ba536 | ||
|
|
94b36f91ee | ||
|
|
cd28986280 | ||
|
|
b437323e2c | ||
|
|
e19e9c8f66 | ||
|
|
921aee5459 | ||
|
|
b984626b52 | ||
|
|
eab23107de | ||
|
|
8b3a885953 | ||
|
|
7831e45af4 | ||
|
|
5fdbb98c39 | ||
|
|
8c2d5cd165 | ||
|
|
41d9c2de41 | ||
|
|
580523708d | ||
|
|
0521e3acbc | ||
|
|
b06c567c1f | ||
|
|
4aa850fa93 | ||
|
|
2df4cc81ab | ||
|
|
0bdff758b4 | ||
|
|
ad09d80ac6 | ||
|
|
0fbfef36f1 | ||
|
|
07f73341a3 | ||
|
|
51c655ad3d | ||
|
|
cf3b82883c | ||
|
|
d68531d744 | ||
|
|
ceb2e8dc2c | ||
|
|
3417923ada | ||
|
|
634f978ce3 | ||
|
|
12c0262a82 | ||
|
|
9c1f05fdd8 | ||
|
|
1091f97f61 | ||
|
|
6b142d43cd | ||
|
|
3c0d098a85 | ||
|
|
0f787fde0e | ||
|
|
eb05521c3f | ||
|
|
6fed0e740d | ||
|
|
947a1ef4ff | ||
|
|
b127777cde | ||
|
|
26da731489 | ||
|
|
54234965d5 | ||
|
|
8334239104 | ||
|
|
9c4f03aa39 | ||
|
|
02a2298c97 | ||
|
|
7c483bbac7 | ||
|
|
0b7a662327 | ||
|
|
31f557d779 | ||
|
|
2e06c0f14a | ||
|
|
99bd38652f | ||
|
|
5e7a30bb73 | ||
|
|
9f2b58f6b6 | ||
|
|
98ab554353 | ||
|
|
1e98ec7746 | ||
|
|
b8608d2815 | ||
|
|
0ed15da9fd | ||
|
|
4b24555ced | ||
|
|
3ed23f5c9e | ||
|
|
61bf5c1e54 | ||
|
|
009b854b1f | ||
|
|
8ca53a41da | ||
|
|
376d73af3c | ||
|
|
b677533b37 | ||
|
|
0c96e67ebc | ||
|
|
e9c17590b1 | ||
|
|
8d609e47e6 | ||
|
|
e5d87f9498 | ||
|
|
0d29461854 | ||
|
|
1d63004b5d | ||
|
|
ee25e1ce6d | ||
|
|
59eb4ba094 | ||
|
|
31a5c6eedb | ||
|
|
97bb438dc7 | ||
|
|
5840b03d44 | ||
|
|
9e2cad2894 | ||
|
|
d4b13c8710 | ||
|
|
9746b4d5c5 | ||
|
|
6cf0f5a6ad | ||
|
|
cf0ce80158 | ||
|
|
02764ab1c7 | ||
|
|
4b610a857a | ||
|
|
6878c5e4eb | ||
|
|
f1fc5a9fec | ||
|
|
672bae1c57 | ||
|
|
32dc9597e9 | ||
|
|
d259eb2aad | ||
|
|
058584fccd | ||
|
|
97806affe4 | ||
|
|
8600e20f0e | ||
|
|
9a5ad5ba18 | ||
|
|
b8e8e7578e | ||
|
|
c693124762 | ||
|
|
91fa5c9384 | ||
|
|
815d6d9c4c | ||
|
|
64a3061b36 | ||
|
|
da118a4713 | ||
|
|
75e89e602f | ||
|
|
8720c2952d | ||
|
|
fef17484d9 | ||
|
|
b421dc5509 | ||
|
|
ab3c25a5f2 | ||
|
|
c729288dab | ||
|
|
9cb5576e4d | ||
|
|
44c442417e | ||
|
|
ae6440bd59 | ||
|
|
13608a9e24 | ||
|
|
369110d90c | ||
|
|
b68d985292 | ||
|
|
e914323594 | ||
|
|
6a553dabe3 | ||
|
|
55ffab420a | ||
|
|
c8fe8ac18f | ||
|
|
774bcbcaf4 | ||
|
|
4b07ef7da1 | ||
|
|
c9321630b1 | ||
|
|
7948faf8e8 | ||
|
|
f2ab10bb59 | ||
|
|
afb7fb16b8 | ||
|
|
b8539e233b | ||
|
|
d2550f1dbb | ||
|
|
f58eac9104 | ||
|
|
c306aa9bfe | ||
|
|
ad6702e668 | ||
|
|
7469bb9bcb | ||
|
|
83f6d724e1 | ||
|
|
2a60d6d88b | ||
|
|
507f449b32 | ||
|
|
8782ec3985 | ||
|
|
cbae90a7c1 | ||
|
|
bb66c75305 | ||
|
|
58c03f58da | ||
|
|
30a79fc6fa | ||
|
|
1ec712e1e8 | ||
|
|
056c27083c | ||
|
|
9fa4a5ec6a | ||
|
|
a859c35703 | ||
|
|
c2065b1017 | ||
|
|
836781ca39 | ||
|
|
f3c0c2ca83 | ||
|
|
daf4dfbb67 | ||
|
|
9d10b06a0d | ||
|
|
01824ed107 | ||
|
|
36edc1c253 | ||
|
|
be55e2c69d | ||
|
|
55c46dac15 | ||
|
|
23789a3a1a | ||
|
|
bda4005b55 | ||
|
|
5ac2a1d765 | ||
|
|
ea68125765 | ||
|
|
8b314ccb43 | ||
|
|
d05d7032e1 | ||
|
|
2500e9edaf | ||
|
|
ba84994876 | ||
|
|
789849f8bf | ||
|
|
513a79704b | ||
|
|
49ed8e046f | ||
|
|
bf7aa2f2f9 | ||
|
|
047bf73e83 | ||
|
|
74ccfa71b1 | ||
|
|
a39632b9af | ||
|
|
b364ac0639 | ||
|
|
b02c4ab54d | ||
|
|
290b452307 | ||
|
|
241ef884c8 | ||
|
|
11526464c8 | ||
|
|
b968d57b64 | ||
|
|
a61404126a | ||
|
|
afd136e6bf | ||
|
|
fd8160d7bd | ||
|
|
eaba928492 | ||
|
|
ef607fb50d | ||
|
|
579b075cdf | ||
|
|
1d244214d1 | ||
|
|
89a3d20da2 | ||
|
|
bfceba3989 | ||
|
|
51458a6c52 | ||
|
|
e84b411850 | ||
|
|
5012f4e582 | ||
|
|
b0e3a4ac8c | ||
|
|
38fb01af30 | ||
|
|
1a8100e0c5 | ||
|
|
7ed5bbeb0c | ||
|
|
175f212fe3 | ||
|
|
f12953d001 | ||
|
|
a3a56d921c | ||
|
|
6f69698824 | ||
|
|
70f43902ac | ||
|
|
9387da18fb | ||
|
|
fe425b96af | ||
|
|
9438adee6a | ||
|
|
d8af315b9c | ||
|
|
bf9e88cca3 | ||
|
|
dc53227e34 | ||
|
|
77dda8f63a | ||
|
|
17aff0f259 | ||
|
|
24f4257d53 | ||
|
|
2e3a647249 | ||
|
|
e5f5f9cde5 | ||
|
|
989ff04df2 | ||
|
|
5394b2a610 | ||
|
|
53e276fd09 | ||
|
|
2a82294f15 | ||
|
|
59aa28351c | ||
|
|
43188f40b8 | ||
|
|
42298d96aa | ||
|
|
5bb51bbb20 | ||
|
|
05158a78f0 | ||
|
|
b3ecd2c6b5 | ||
|
|
22db265958 | ||
|
|
d74a10535e | ||
|
|
a832e7cd61 | ||
|
|
4103384808 | ||
|
|
a1ab81c5b1 | ||
|
|
38b5613680 | ||
|
|
52083c19e0 | ||
|
|
8cd3ac46c2 | ||
|
|
6a2e3f3bea | ||
|
|
b4ef1c318a | ||
|
|
ad76645726 | ||
|
|
56dbfedf7b | ||
|
|
9ae1a629b4 | ||
|
|
282975714f | ||
|
|
a411b1387c | ||
|
|
c08b1ae756 | ||
|
|
6e30cacd1c | ||
|
|
1740753904 | ||
|
|
0629e3a3f0 | ||
|
|
5aba739fcc | ||
|
|
29d7191943 | ||
|
|
acb9d031fd | ||
|
|
7318c8827e | ||
|
|
200d36f911 | ||
|
|
43704aa51c | ||
|
|
087b97ae1f | ||
|
|
2e11906933 | ||
|
|
1d6c6156b4 | ||
|
|
8707f97633 | ||
|
|
bd8e33797e | ||
|
|
8f8b505175 | ||
|
|
74c82f07d6 | ||
|
|
810a288777 | ||
|
|
c74199e668 | ||
|
|
08cf89f6dd | ||
|
|
a63f8fa1e1 | ||
|
|
f0dd92bf71 | ||
|
|
468246c95a | ||
|
|
9fadcb978b | ||
|
|
df709ba5ea | ||
|
|
f59ab36c66 | ||
|
|
24e96ce5ac | ||
|
|
067a38fdcb | ||
|
|
5776fcaf07 | ||
|
|
5c3d475c6d | ||
|
|
2ef818e612 | ||
|
|
5f34c3c373 | ||
|
|
8dbe0bf70c | ||
|
|
3bc1b498bb | ||
|
|
ce1d1876aa | ||
|
|
3f857cbd81 | ||
|
|
5ae199533b | ||
|
|
1e84ef5fb9 | ||
|
|
5a91ac81df | ||
|
|
f3f6d856e0 | ||
|
|
a28665a754 | ||
|
|
25bcdd1a61 | ||
|
|
451b4db4af | ||
|
|
f1b059f18d | ||
|
|
d6117dc2c9 | ||
|
|
60ba4d7407 | ||
|
|
69eda9d37b | ||
|
|
94731511ba | ||
|
|
a200933a99 | ||
|
|
b7db5d8561 | ||
|
|
9fd58e5604 | ||
|
|
60c064de5d | ||
|
|
c073a85602 | ||
|
|
14c4d02ab6 | ||
|
|
162f7e0a0a | ||
|
|
e301d8f212 | ||
|
|
f0b27c0052 | ||
|
|
1599fcf118 | ||
|
|
8c2c134ce5 | ||
|
|
40f3362d92 | ||
|
|
8a3aa58c3e | ||
|
|
51c4060a76 | ||
|
|
02544623ab | ||
|
|
605cae244e | ||
|
|
4f42dc7317 | ||
|
|
b9e28d6823 | ||
|
|
6033015167 | ||
|
|
a1f2d080d0 | ||
|
|
6fa93574e6 | ||
|
|
771c27f26f | ||
|
|
9515e42db7 | ||
|
|
a4235416e3 | ||
|
|
9270605250 | ||
|
|
4e807fe46d | ||
|
|
f623a06bc4 | ||
|
|
0853369702 | ||
|
|
d24a730907 | ||
|
|
58e86110fe | ||
|
|
75f054fa60 | ||
|
|
68e6998fbd | ||
|
|
cb08c3dc10 | ||
|
|
850fd37ff2 | ||
|
|
7458e02ae8 | ||
|
|
fe37951134 | ||
|
|
465c926ebe | ||
|
|
989ce33bbf | ||
|
|
8bf6a59a42 | ||
|
|
a15cd434c9 | ||
|
|
5cf4630054 | ||
|
|
c245556712 | ||
|
|
76bc4c8e27 | ||
|
|
41cb054736 | ||
|
|
e8423e91a5 | ||
|
|
efb0274631 | ||
|
|
572519680a | ||
|
|
49eb294d55 | ||
|
|
4b3e627852 | ||
|
|
0032e2e4af | ||
|
|
e17dee7c12 | ||
|
|
49c3b93aed | ||
|
|
a8f3c33c80 | ||
|
|
9bd7ffc2b2 | ||
|
|
bd5640928a | ||
|
|
ef5a9a8f4d | ||
|
|
faebbc2480 | ||
|
|
885ac024e0 | ||
|
|
ecd35a5e3d | ||
|
|
aa43fb61a4 | ||
|
|
206bbf35d4 | ||
|
|
6b5c0c05a9 | ||
|
|
34b2e9668b | ||
|
|
f797c7d1e9 | ||
|
|
dd3ae803c4 | ||
|
|
9addc29ade | ||
|
|
8070a9c09f | ||
|
|
4b4cf3fd26 | ||
|
|
b4dec93fd1 | ||
|
|
c8121e783c | ||
|
|
2fc00c11bc | ||
|
|
ec435e7d0a | ||
|
|
5d45d9a695 | ||
|
|
8579381793 | ||
|
|
c80f10297f | ||
|
|
06ecb9f0c1 | ||
|
|
b18e41adc0 | ||
|
|
d3c71a6c51 | ||
|
|
5f56326130 | ||
|
|
d956616cd3 | ||
|
|
a64bcb4630 | ||
|
|
f937e91bfd | ||
|
|
d493860db8 | ||
|
|
d937524287 | ||
|
|
34ab284a39 | ||
|
|
780811338b | ||
|
|
e20153f1e5 | ||
|
|
3f6ecfa919 | ||
|
|
0ccc2b6075 | ||
|
|
ef156e8b9a | ||
|
|
31cd9ee4dd | ||
|
|
ed017fb44b | ||
|
|
7128be3e86 | ||
|
|
c678ac3e51 | ||
|
|
037abd6d71 | ||
|
|
ce87f6cb8a | ||
|
|
31b35318b6 | ||
|
|
69c736c565 | ||
|
|
98de55ae05 | ||
|
|
2f0e19c245 | ||
|
|
f2c490b3a7 | ||
|
|
e964886b03 | ||
|
|
eaab1f6e0a | ||
|
|
51829aa69c | ||
|
|
a89bc61e71 | ||
|
|
b51e46e943 | ||
|
|
6028d8ac48 | ||
|
|
98967931ba | ||
|
|
a0b014ad4f | ||
|
|
dee44e2cab | ||
|
|
337f3e2931 | ||
|
|
abce4d8cdf | ||
|
|
6be1979216 | ||
|
|
7dffb645fd | ||
|
|
c37ed31d31 | ||
|
|
0d07f4b46c | ||
|
|
b15f9df7b3 | ||
|
|
dfcfe44f77 | ||
|
|
1e6fcb2ed1 | ||
|
|
5b22aebd36 | ||
|
|
0d75747d10 | ||
|
|
297f27dd8d | ||
|
|
3a07cb34a1 | ||
|
|
7aa1b2cbf7 | ||
|
|
4f0fa8709a | ||
|
|
4d7c3e3536 | ||
|
|
ddc97e1735 | ||
|
|
1afcb664e6 | ||
|
|
f293c578fd | ||
|
|
e6d4c23f11 | ||
|
|
e5a01fc93f | ||
|
|
60a2cd5124 | ||
|
|
b0ccd6a5a6 | ||
|
|
ee68fae484 | ||
|
|
704c541b8d | ||
|
|
b924f93b58 | ||
|
|
4c6114e6de | ||
|
|
234a11f901 | ||
|
|
4c3b53a019 | ||
|
|
a55ed63bb2 | ||
|
|
7dcb8cedfa | ||
|
|
577108de78 | ||
|
|
039da3aec3 | ||
|
|
89f9d20598 | ||
|
|
8b1332aa21 | ||
|
|
42a6f835f9 | ||
|
|
d7f5e0eea9 | ||
|
|
92b4ff5fae | ||
|
|
431aa76762 | ||
|
|
474796f73a | ||
|
|
12ef209b44 | ||
|
|
af5f3e1a05 | ||
|
|
001dc03913 | ||
|
|
8b53976170 | ||
|
|
cd2d4a3130 | ||
|
|
4b0e88b151 | ||
|
|
54e890d546 | ||
|
|
0a97170220 | ||
|
|
5d7248ac52 | ||
|
|
0a330d4fa2 | ||
|
|
0b45bd759d | ||
|
|
1f70c34b61 | ||
|
|
54443c3564 | ||
|
|
b63e8f410d | ||
|
|
a689188c23 | ||
|
|
56ba0451e4 | ||
|
|
9cc87ede3a | ||
|
|
bbeaa4b069 | ||
|
|
25da21813d | ||
|
|
e3036d288f | ||
|
|
4df16c6d4f | ||
|
|
9ec8c72f93 | ||
|
|
0d6a2d1184 | ||
|
|
6020028e15 | ||
|
|
07627aacd7 | ||
|
|
a7cc3f833b | ||
|
|
e795e805ae | ||
|
|
b0f1fd136b | ||
|
|
ed1c44f826 | ||
|
|
b14da725b9 | ||
|
|
4e6c3bec20 | ||
|
|
3d0ff323a1 | ||
|
|
20af466edd | ||
|
|
7b4a09a0bd | ||
|
|
f890cfea30 | ||
|
|
6d5331d53d | ||
|
|
6b0ce7bcf8 | ||
|
|
340f5e3463 | ||
|
|
7528dde3af | ||
|
|
c79993466d | ||
|
|
471aaedbd9 | ||
|
|
218bdde687 | ||
|
|
5f7220fa9c | ||
|
|
852cf4e1a5 | ||
|
|
6e9016d233 | ||
|
|
77c015350f | ||
|
|
33f9460019 | ||
|
|
20242a49ff | ||
|
|
4011fdc5cc | ||
|
|
1c4a72bf86 | ||
|
|
fbafbed27c | ||
|
|
ef07af6c0a | ||
|
|
8f4fa61d30 | ||
|
|
7218a4a579 | ||
|
|
d4e6d41577 | ||
|
|
985c1c5280 | ||
|
|
98917fab07 | ||
|
|
c16c143ffd | ||
|
|
fab932bc7a | ||
|
|
8d92190b49 | ||
|
|
ece92e2556 | ||
|
|
6c8670469f | ||
|
|
e286af237d | ||
|
|
f0e1c4eb33 | ||
|
|
b63f71ab29 | ||
|
|
052485e37a | ||
|
|
6af4884ea6 | ||
|
|
262c16f88c | ||
|
|
d6348edced | ||
|
|
36a32fa1d4 | ||
|
|
e6600273c4 | ||
|
|
5355e69e73 | ||
|
|
6d94bdf506 | ||
|
|
08424e1fe2 | ||
|
|
7ce4e24042 | ||
|
|
2d5fa96b77 | ||
|
|
de5933b23a | ||
|
|
d9b9a230b3 | ||
|
|
863be8a643 | ||
|
|
3b7e819f00 | ||
|
|
1df9ebe984 | ||
|
|
5a70e75547 | ||
|
|
24f7d24bf0 | ||
|
|
b618607b4a | ||
|
|
936646de93 | ||
|
|
32312b1594 | ||
|
|
58444076cd | ||
|
|
ec5f7517ea | ||
|
|
eca64f8a2e | ||
|
|
f4694c48e5 | ||
|
|
150ffbab68 | ||
|
|
f4ddc0169c | ||
|
|
0618fffb2e | ||
|
|
6c5b21f9c3 | ||
|
|
ccb39c8662 | ||
|
|
b604003f29 | ||
|
|
f22f6c3326 | ||
|
|
420a9f60e8 | ||
|
|
04ff0b73e3 | ||
|
|
2e1253b46b | ||
|
|
003e43159e | ||
|
|
27419b6a07 | ||
|
|
148d290f2a | ||
|
|
29de5e46ca | ||
|
|
70b1ea8e3f | ||
|
|
cd4ee3debc | ||
|
|
93a84ec681 | ||
|
|
171a394ac1 | ||
|
|
cc2323242f | ||
|
|
52325e43b2 | ||
|
|
1462190b0e | ||
|
|
8698f50196 | ||
|
|
98e8b1857d | ||
|
|
6a81cd1d49 | ||
|
|
cbaac14adf | ||
|
|
f9f76ef341 | ||
|
|
9da05deb81 | ||
|
|
174d5a6ed0 | ||
|
|
4c9e9083ab | ||
|
|
afc60221b9 | ||
|
|
8822bb229d | ||
|
|
9cfe41ab86 | ||
|
|
c95897bc4c | ||
|
|
9139f00f4b | ||
|
|
ae089aebad | ||
|
|
b560ffbde3 | ||
|
|
20e1c90198 | ||
|
|
d8c488f5c5 | ||
|
|
401f517f00 | ||
|
|
cbc2f0518d | ||
|
|
b2efd04e97 | ||
|
|
f5c5ddd71c | ||
|
|
8ba45f340c | ||
|
|
e38d03b5a7 | ||
|
|
3d84d69a90 | ||
|
|
a90bec19e0 | ||
|
|
157e3b48ce | ||
|
|
1d43049387 | ||
|
|
4b2d255cf8 | ||
|
|
c07ac849a3 | ||
|
|
aa1a54ce38 | ||
|
|
5aeeb657be | ||
|
|
75624e97af | ||
|
|
3c79e6069e | ||
|
|
a003c214d5 | ||
|
|
60799b32a6 | ||
|
|
e9c298b2c5 | ||
|
|
02faee3f38 | ||
|
|
55e4f7028e | ||
|
|
79575e659d | ||
|
|
81924850ca | ||
|
|
917b653549 | ||
|
|
5f3bc876d1 | ||
|
|
3c43deb793 | ||
|
|
6c5308ed49 | ||
|
|
3e18d9fc97 | ||
|
|
5738ca12f1 | ||
|
|
04d7cc916e | ||
|
|
7efce2661d | ||
|
|
21d92613ab | ||
|
|
4825bbf7a6 | ||
|
|
8dc83d3fd1 | ||
|
|
d1314461d1 | ||
|
|
d46d285150 | ||
|
|
a2ce2ee3db | ||
|
|
4a4e091470 | ||
|
|
2a1ae998ee | ||
|
|
ed946ccfbf | ||
|
|
4585457984 | ||
|
|
93e88038fa | ||
|
|
6dfba2e03d | ||
|
|
a65c2103cc | ||
|
|
975a668e6e | ||
|
|
757ef013b8 | ||
|
|
53678f589d | ||
|
|
d314a0492b | ||
|
|
9731c74c2c | ||
|
|
aed185ddf3 | ||
|
|
0f7553fa69 | ||
|
|
2eade89c6f | ||
|
|
64dca5f8b7 | ||
|
|
c1da744044 | ||
|
|
47d50edee4 | ||
|
|
a17a4eb97b | ||
|
|
4011986b23 | ||
|
|
15a6223e7e | ||
|
|
8756b7a3f8 | ||
|
|
c8dcf473cc | ||
|
|
4a938e8779 | ||
|
|
6ade1d75b8 | ||
|
|
3ba813479d | ||
|
|
0d1074e32a | ||
|
|
3a5c59c63f | ||
|
|
654b2c2010 | ||
|
|
d2ee1b2bf0 | ||
|
|
d22f88dc21 | ||
|
|
01a84af5af | ||
|
|
cf6417104c | ||
|
|
be3111d1b5 | ||
|
|
c5f587f69a | ||
|
|
6d4ef66811 | ||
|
|
88f7367de4 | ||
|
|
239234185f | ||
|
|
8f1e36024b | ||
|
|
217fe9735b | ||
|
|
ca7cbb47b1 | ||
|
|
dcbc969438 | ||
|
|
c5742c86b2 | ||
|
|
f2eb9ef0cd | ||
|
|
ce5573b51a | ||
|
|
6b54b5a289 | ||
|
|
b272b8fc3b | ||
|
|
4d23c88fb4 | ||
|
|
e44999b362 | ||
|
|
ddf031a5e8 | ||
|
|
3b20c67e63 | ||
|
|
69306daed4 | ||
|
|
80d60a5255 | ||
|
|
cb10d9f3a0 | ||
|
|
a6c9db8b16 | ||
|
|
d1e17d4dea | ||
|
|
377ff86635 | ||
|
|
179d712308 | ||
|
|
6c2a6c03c0 | ||
|
|
4b366d00de | ||
|
|
672de92d3a | ||
|
|
ea080443e6 | ||
|
|
54d6d16add | ||
|
|
9b5a363ed9 | ||
|
|
d6f61f2865 | ||
|
|
c49d0d89a8 | ||
|
|
596795551c | ||
|
|
ef895ffca9 | ||
|
|
3955f8e7f3 | ||
|
|
bbf9e64a65 | ||
|
|
fc3f62f474 | ||
|
|
dc6c3011ec | ||
|
|
054b6ef66b | ||
|
|
00cd0660e1 | ||
|
|
3c6fd63262 | ||
|
|
94c3bc55ec | ||
|
|
d435333405 | ||
|
|
4877e32e8f | ||
|
|
eecca19c15 | ||
|
|
74e9a93bcf | ||
|
|
0c167bb377 | ||
|
|
7db1f7033f | ||
|
|
d86e09b16b | ||
|
|
21995bf11c | ||
|
|
2450c0ee83 | ||
|
|
b13db84c95 | ||
|
|
23b3de1494 | ||
|
|
e1052d2ede | ||
|
|
5126032312 | ||
|
|
63a8568ff8 | ||
|
|
d997998a21 | ||
|
|
a558186c75 | ||
|
|
0b40ca28ff | ||
|
|
fc3b93ecef | ||
|
|
b080bc7e52 | ||
|
|
04451dc06b | ||
|
|
1afe34dacc | ||
|
|
4a31fd689e | ||
|
|
213075ad38 | ||
|
|
a96513d0cf | ||
|
|
122438de05 | ||
|
|
d8df0e6b38 | ||
|
|
d47e32037c | ||
|
|
7b228c1f4a | ||
|
|
ccf25fd2cb | ||
|
|
ee9864a3b8 | ||
|
|
b5d4de6f11 | ||
|
|
96ae53ec00 | ||
|
|
29eb090ce8 | ||
|
|
e0810a7038 | ||
|
|
b5580a8f97 | ||
|
|
9e90f21952 | ||
|
|
7275cf4cbd | ||
|
|
2535706e7e | ||
|
|
e027401d35 | ||
|
|
a077f80db0 | ||
|
|
792d857087 | ||
|
|
a55b21fec4 | ||
|
|
d0cee28db8 | ||
|
|
54d60ac524 | ||
|
|
9041b188f9 | ||
|
|
0aa57c8318 | ||
|
|
f1bcc872d3 | ||
|
|
58189586c8 | ||
|
|
e7438f4393 | ||
|
|
4566c0af09 | ||
|
|
c994bcc637 | ||
|
|
c93c74cddd | ||
|
|
d4d557e798 | ||
|
|
586994c681 | ||
|
|
d20fc9f5e5 | ||
|
|
0403a01870 | ||
|
|
f999add513 | ||
|
|
2f12896d48 | ||
|
|
14f4b5ee95 | ||
|
|
f61b96d0bd | ||
|
|
d1023a23b1 | ||
|
|
e67967c1c2 | ||
|
|
cd81f2b734 | ||
|
|
4dd6cc4ce1 | ||
|
|
2bb1188bc8 | ||
|
|
49a8c115d7 | ||
|
|
3838e04036 | ||
|
|
0a38ef9c39 | ||
|
|
adaf4c6828 | ||
|
|
819a746c89 | ||
|
|
ac8a85f77d | ||
|
|
62807409da | ||
|
|
430639dafc | ||
|
|
2399e7a018 | ||
|
|
8462c67f4e | ||
|
|
6a966cfe55 | ||
|
|
27b7ce4ca4 | ||
|
|
fb7ad5c58c | ||
|
|
294ccdc501 | ||
|
|
32d8cf8e04 | ||
|
|
46dac9a429 | ||
|
|
4c1175e4b0 | ||
|
|
1c8fd37df1 | ||
|
|
276c8cb22e | ||
|
|
c52d2e5834 | ||
|
|
45b1a40c7a | ||
|
|
c5e9e52519 | ||
|
|
20526c39e0 | ||
|
|
39c608b459 | ||
|
|
22b8399dde | ||
|
|
537c9cb5ea | ||
|
|
957c46c254 | ||
|
|
465cddb814 | ||
|
|
4589e1e0e1 | ||
|
|
58cba90e27 | ||
|
|
b844735e32 | ||
|
|
cd5b595562 | ||
|
|
0a40cda128 | ||
|
|
55acfd21d7 | ||
|
|
e05f7ca3cb | ||
|
|
0588c407d6 | ||
|
|
1fc62fe57b | ||
|
|
16495c746c | ||
|
|
c1304ffecc | ||
|
|
0d87e040a3 | ||
|
|
19cf644cc1 | ||
|
|
c654edd155 | ||
|
|
694e9f8145 | ||
|
|
20f6409a0f | ||
|
|
f405547ad2 | ||
|
|
57b5f5c79b | ||
|
|
988ca9603d | ||
|
|
a8b27bf38c | ||
|
|
7d87b43f95 | ||
|
|
67226c1e96 | ||
|
|
3e39d64a45 | ||
|
|
e6d0867a28 | ||
|
|
593668da2a | ||
|
|
a51a1d37cb | ||
|
|
581b55a5ac | ||
|
|
83081501e5 | ||
|
|
f4ebc31945 | ||
|
|
46b7661e5e | ||
|
|
3ab15ad3ae | ||
|
|
de35e41c69 | ||
|
|
9e6564f1e1 | ||
|
|
efde44a684 | ||
|
|
cea97c5cae | ||
|
|
40c48fa727 | ||
|
|
4df8a07f61 | ||
|
|
8a7091809c | ||
|
|
e712d9c08a | ||
|
|
e8c5e7c32c | ||
|
|
8281f81e8a | ||
|
|
a42acfdfd4 | ||
|
|
52667cdf63 | ||
|
|
c7bae7988a | ||
|
|
2870c0620c | ||
|
|
9cbfd8e4f9 | ||
|
|
bd4ac0cddb | ||
|
|
069fd4d3db | ||
|
|
0951ed8dd2 | ||
|
|
f0dd8fa466 | ||
|
|
a7b513e908 | ||
|
|
986751b140 | ||
|
|
e964556c5c | ||
|
|
de65e8143f | ||
|
|
d73ce78fae | ||
|
|
bb5fecbdaf | ||
|
|
0b6134db08 | ||
|
|
967abbbedc | ||
|
|
0b94b60ff0 | ||
|
|
c4737508c1 | ||
|
|
173a8736bd | ||
|
|
d7cf5961f9 | ||
|
|
820c132b85 | ||
|
|
d41def05db | ||
|
|
a5e6e33af3 | ||
|
|
7891a2e32d | ||
|
|
565992401b | ||
|
|
fc49802bdb | ||
|
|
5fdc8d3672 | ||
|
|
dc0cd2a930 | ||
|
|
6ebe77c7d6 | ||
|
|
afbfdebf96 | ||
|
|
9a33e22c4c | ||
|
|
ce4de2fba0 | ||
|
|
568775e64c | ||
|
|
8e6c568ef4 | ||
|
|
6351718a4f | ||
|
|
83a34ecac9 | ||
|
|
148843f692 | ||
|
|
626d47873d | ||
|
|
2a66104b97 | ||
|
|
bb634b1838 | ||
|
|
b52264a83e | ||
|
|
adcc22143f | ||
|
|
a811da51ec | ||
|
|
25715df9ea | ||
|
|
46236d416a | ||
|
|
949daaf880 | ||
|
|
70f30c1dcc | ||
|
|
f8f83ecc27 | ||
|
|
549bc1175f | ||
|
|
75bc03462a | ||
|
|
cfec235502 | ||
|
|
f19a7b51fe | ||
|
|
9ef011c45f | ||
|
|
a785970646 | ||
|
|
a2542f8261 | ||
|
|
f641e6118d | ||
|
|
4e272a0aa9 | ||
|
|
171b74a9bd | ||
|
|
62fe220b56 | ||
|
|
7b20426c78 | ||
|
|
029be13fd1 | ||
|
|
eb3c0ea15d | ||
|
|
6e15814840 | ||
|
|
2d91b1e859 | ||
|
|
078a90b74d | ||
|
|
78b1ccb4a7 | ||
|
|
0b9b69291e | ||
|
|
40d8febe78 | ||
|
|
211ac29371 | ||
|
|
c05bfd575d | ||
|
|
681bb2f47b | ||
|
|
d3dc0c4391 | ||
|
|
22f48fdd7e | ||
|
|
994add6e25 | ||
|
|
ece31da4ba | ||
|
|
9ae8b8c3df | ||
|
|
4966836d25 | ||
|
|
f142222ea3 | ||
|
|
ae4233f4e1 | ||
|
|
4c9cc55514 | ||
|
|
7dbcfada76 | ||
|
|
8f7e66a512 | ||
|
|
b285b21227 | ||
|
|
6805ba51ec | ||
|
|
0abc84f688 | ||
|
|
3c77f58b02 | ||
|
|
1326f793c9 | ||
|
|
02df79470f | ||
|
|
d16f99e851 | ||
|
|
38e4c7c52b | ||
|
|
6d0cd7820b | ||
|
|
a713afe41e | ||
|
|
430ad20c2f | ||
|
|
5f84cd50d5 | ||
|
|
9865bce5b0 | ||
|
|
69142ed84b | ||
|
|
92753a46b3 | ||
|
|
d9d58d2259 | ||
|
|
b57ce47d93 | ||
|
|
5f03bde36f | ||
|
|
c76e336302 | ||
|
|
11efe4777c | ||
|
|
36202c86c7 | ||
|
|
bd068d2900 | ||
|
|
3ad3dcddb0 | ||
|
|
9654b55745 | ||
|
|
f4c6cbaf8d | ||
|
|
07ace3f11e | ||
|
|
b526be3e85 | ||
|
|
b689b92f0c | ||
|
|
46c4a16a9e | ||
|
|
93cd35c059 | ||
|
|
e3a664c320 | ||
|
|
737e598624 | ||
|
|
6cd8439821 | ||
|
|
48586c4d0f | ||
|
|
4073fb069c | ||
|
|
997ffb0991 | ||
|
|
d95127f626 | ||
|
|
cf681fb5f2 | ||
|
|
027bce5cae | ||
|
|
e1c53a6056 | ||
|
|
1dc9778116 | ||
|
|
bcd3f56bb8 | ||
|
|
92f8b2f140 | ||
|
|
0bf24da1ba | ||
|
|
b4abca0ff2 | ||
|
|
8d172223d3 | ||
|
|
5733b62506 | ||
|
|
19eb0cde55 | ||
|
|
1f7994d9de | ||
|
|
0ec3a2d8cf | ||
|
|
da252ac5a7 | ||
|
|
68e65f5b6f | ||
|
|
a8d48b571d | ||
|
|
98f27f7f53 | ||
|
|
42a31ae59a | ||
|
|
8d5b4d8988 | ||
|
|
467691c69c | ||
|
|
a906c1204e | ||
|
|
d9b8c3370e | ||
|
|
62c02dfd14 | ||
|
|
3fda99d774 | ||
|
|
ec9942b6be | ||
|
|
e12e6236d8 | ||
|
|
6c94cdaf95 | ||
|
|
84b3dd704b | ||
|
|
51cbc8248b | ||
|
|
92f8d12843 | ||
|
|
b97395c726 | ||
|
|
0b75042f6b | ||
|
|
978b778be6 | ||
|
|
0be8d28fa8 | ||
|
|
354adef46e | ||
|
|
dc574bc583 | ||
|
|
726c966a08 | ||
|
|
7d4f2c2c76 | ||
|
|
67e1d76bc2 | ||
|
|
2d2fb1c8b7 | ||
|
|
fcb29be1ad | ||
|
|
0434d32b61 | ||
|
|
fee0afd4ba | ||
|
|
7ecd89e7c3 | ||
|
|
0a8d990683 | ||
|
|
a898a253b9 | ||
|
|
e7e0a25231 | ||
|
|
9f18f7d524 | ||
|
|
b78067ee85 | ||
|
|
c71132e043 | ||
|
|
f276494411 | ||
|
|
f92429b874 | ||
|
|
72dbac31c5 | ||
|
|
628812f080 | ||
|
|
6049bf947b | ||
|
|
7bfa2b0470 | ||
|
|
48000fe302 | ||
|
|
75b0ae409a | ||
|
|
30a7157140 | ||
|
|
103dec6b88 | ||
|
|
189eb2cd2e | ||
|
|
b0cb95cfba | ||
|
|
461659931d | ||
|
|
301d4115d1 | ||
|
|
90cf0a152e | ||
|
|
fab9b8fd0d | ||
|
|
52d9b10a97 | ||
|
|
8c9a8dbd6a | ||
|
|
4d94c79d09 | ||
|
|
b5bb8d7250 | ||
|
|
8abc5148a7 | ||
|
|
9437ab4528 | ||
|
|
77737917d9 | ||
|
|
6055d14c33 | ||
|
|
e378675197 | ||
|
|
f768475e63 | ||
|
|
1e1667142a | ||
|
|
a3f468be66 | ||
|
|
92c173e493 | ||
|
|
77cc46acdc | ||
|
|
48f2deb8b8 | ||
|
|
f1c36c51a2 | ||
|
|
d5b8b13d8c | ||
|
|
687a599bc1 | ||
|
|
1c84f21c45 | ||
|
|
0078cba183 | ||
|
|
15708cc95f | ||
|
|
7f9d9e2cbd | ||
|
|
1061e81618 | ||
|
|
e6b7c227b8 | ||
|
|
768e91fc56 | ||
|
|
7fc3f9aa6a | ||
|
|
930f143f9c | ||
|
|
c6bb8cfa23 | ||
|
|
2f93db442f | ||
|
|
7374289593 | ||
|
|
cb4214dcdf | ||
|
|
01f184ec56 | ||
|
|
9596fcc41f | ||
|
|
12f6d07701 | ||
|
|
4716537e45 | ||
|
|
352dba47a1 | ||
|
|
75a9ff8c89 | ||
|
|
2731eecce6 | ||
|
|
9d53ca188b | ||
|
|
3cf01f0b50 | ||
|
|
75b8d59d5f | ||
|
|
67889cd9e7 | ||
|
|
ba2dfae464 | ||
|
|
fe3cfd5ead | ||
|
|
d1a27c7e27 | ||
|
|
e2a08bc361 | ||
|
|
7d89e840e2 | ||
|
|
ef0cd60b00 | ||
|
|
608be074b9 | ||
|
|
e12b558d1f | ||
|
|
c3ed0b23da | ||
|
|
6ec4d9395d | ||
|
|
d18115acba | ||
|
|
ff8024a3aa | ||
|
|
1ec564fccc | ||
|
|
2d56d53627 | ||
|
|
de89022e76 | ||
|
|
597d5a42e5 | ||
|
|
522f7e6d93 | ||
|
|
08e00e81f7 | ||
|
|
ebb56bf41c | ||
|
|
b79dc92650 | ||
|
|
0ca9f24e74 | ||
|
|
e78d2a9f39 | ||
|
|
ceeeef188b | ||
|
|
7af0dcc61e | ||
|
|
25a5525a24 | ||
|
|
d1a2ab5731 | ||
|
|
1f0737e036 | ||
|
|
8adf363343 | ||
|
|
4ab66b66a5 | ||
|
|
64946e6ea0 | ||
|
|
1098a58b04 | ||
|
|
133b081fb6 | ||
|
|
6369b8df24 | ||
|
|
bb3f825862 | ||
|
|
708b1e47f0 | ||
|
|
bd9d731f1d | ||
|
|
44d563da83 | ||
|
|
5bcfc821ca | ||
|
|
f011fbd216 | ||
|
|
615071e15e | ||
|
|
1bee575a8c | ||
|
|
4f1c7d9148 | ||
|
|
23d892e5a2 | ||
|
|
51aacb5ee6 | ||
|
|
d47d8e5b07 | ||
|
|
05044b0ee8 | ||
|
|
01e3829114 | ||
|
|
85de11e40a | ||
|
|
696f13970e | ||
|
|
598f1d281f | ||
|
|
fa4db70f26 | ||
|
|
d075589210 | ||
|
|
ff33b16eb8 | ||
|
|
656c1d08ba | ||
|
|
59a8c9178d | ||
|
|
1e83ecb886 | ||
|
|
0e2ed2303f | ||
|
|
7f83e9ffe2 | ||
|
|
18469f80d3 | ||
|
|
c597871027 | ||
|
|
3762fd4a73 | ||
|
|
2f203b251c | ||
|
|
65c05b56e0 | ||
|
|
a674934ef9 | ||
|
|
cb8834ef3a | ||
|
|
7f3aa35988 | ||
|
|
321fc1b1cf | ||
|
|
231408e37d | ||
|
|
bd900b8256 | ||
|
|
c5b77f467b | ||
|
|
ed40070a63 | ||
|
|
7fd6fb2575 | ||
|
|
916c0d316d | ||
|
|
3ab85f2050 | ||
|
|
66873c869a | ||
|
|
53b2d57c3c | ||
|
|
2326f2cf1f | ||
|
|
e9bf3da007 | ||
|
|
6604db1794 | ||
|
|
0471e422bc | ||
|
|
df4a08360c | ||
|
|
7258cdddda | ||
|
|
6f4d722db2 | ||
|
|
cfb2941367 | ||
|
|
29946279d1 | ||
|
|
d1bffb6304 | ||
|
|
9aaaefcbe2 | ||
|
|
6b65c21255 | ||
|
|
8d5ad2e84a | ||
|
|
da7c584bf4 | ||
|
|
6f23628ee5 | ||
|
|
bc682708aa | ||
|
|
1c931da059 | ||
|
|
b1a6ff20f0 | ||
|
|
75d3092e20 | ||
|
|
78c8a0019e | ||
|
|
1defb4fd38 | ||
|
|
e999bd483b | ||
|
|
564e53e97d | ||
|
|
cf0b064285 | ||
|
|
d4b4c375df | ||
|
|
ea5ca906ce | ||
|
|
0556407675 | ||
|
|
d44ee154e4 | ||
|
|
73d0b8257a | ||
|
|
efbf2406c3 | ||
|
|
afdfb1b0d3 | ||
|
|
e3dbe4db0b | ||
|
|
e04293df2c | ||
|
|
ba6284a483 | ||
|
|
1501c1cf35 | ||
|
|
e8b5c1f3f2 | ||
|
|
6e6893dc91 | ||
|
|
679ff22189 | ||
|
|
a5b8b44aa3 | ||
|
|
ceef1bfd5f | ||
|
|
ba80bd96ca | ||
|
|
fd90c045c2 | ||
|
|
c29487ef71 | ||
|
|
1d51efc7a2 | ||
|
|
b5dca37e01 | ||
|
|
39b1d08e3d | ||
|
|
2f367f36a6 | ||
|
|
ebdae2117a | ||
|
|
8f155a860a | ||
|
|
c086534bbc | ||
|
|
1f157ad53d | ||
|
|
1bf8a9850f | ||
|
|
8aaa05a493 | ||
|
|
e9888c15e1 | ||
|
|
cd5bf020f5 | ||
|
|
69b296aa60 | ||
|
|
8aebeb0c24 | ||
|
|
6e6e17bc43 | ||
|
|
5892636d05 | ||
|
|
f62022c72f | ||
|
|
858ef80269 | ||
|
|
ae0105459f | ||
|
|
8472c11182 | ||
|
|
5efb69700e | ||
|
|
1bf050c768 | ||
|
|
45c0c4d8b7 | ||
|
|
1094bcf166 | ||
|
|
04601e526f | ||
|
|
611f697372 | ||
|
|
0379cb730c | ||
|
|
604377454a | ||
|
|
2faefdcbe3 | ||
|
|
7df67aa0d4 | ||
|
|
faf0820419 | ||
|
|
ee7c2137c9 | ||
|
|
73a159c13d | ||
|
|
3302284007 | ||
|
|
09ea437c91 | ||
|
|
bf45e8cf21 | ||
|
|
84d3803b00 | ||
|
|
12b2eb58ee | ||
|
|
f72ebb9ef9 | ||
|
|
8d4d0a279d | ||
|
|
d3179f005f | ||
|
|
a807dd4853 | ||
|
|
909eb56d25 | ||
|
|
fbf1d1ac0a | ||
|
|
6b258d8513 | ||
|
|
0b3a71de02 | ||
|
|
0698a49751 | ||
|
|
ab4336334a | ||
|
|
d9e8c7f71f | ||
|
|
fe6e22933b | ||
|
|
1dbd117587 | ||
|
|
1566696e47 | ||
|
|
8cae2f7eee | ||
|
|
6fbb1d5d39 | ||
|
|
5db991bd3b | ||
|
|
10e3849823 | ||
|
|
3cc8cf1a19 | ||
|
|
42420a8c97 | ||
|
|
7fea89585a | ||
|
|
aad957545c | ||
|
|
496eec0e01 | ||
|
|
ffd89aa4ee | ||
|
|
95373911cb | ||
|
|
dd2351f9c4 | ||
|
|
d2cbcd36da | ||
|
|
3f28058dec | ||
|
|
54d5f999f2 | ||
|
|
c503957b8f | ||
|
|
35b9eb376f | ||
|
|
0059de3371 | ||
|
|
fe935c1b65 | ||
|
|
e4d1c56e4a | ||
|
|
ab3f8c8b0e | ||
|
|
93a4389e73 | ||
|
|
f135ae5edf | ||
|
|
89cdbe170a | ||
|
|
d8a48cb718 | ||
|
|
c188f38978 | ||
|
|
55fd386c70 | ||
|
|
b69922c4d5 | ||
|
|
0067870114 | ||
|
|
bff20acf78 | ||
|
|
769c236738 | ||
|
|
23bb05a6af | ||
|
|
926e87ac79 | ||
|
|
e6531f8683 | ||
|
|
f8f837b4fc | ||
|
|
3530ea3ce6 | ||
|
|
97de3ac691 | ||
|
|
f8b4c0424a | ||
|
|
08ea3d78f7 | ||
|
|
b2f701699d | ||
|
|
da55d1f653 | ||
|
|
cfee4c3f6e | ||
|
|
8d04b23b39 | ||
|
|
fa9393926d | ||
|
|
a0d6ac02f9 | ||
|
|
16a3f6f994 | ||
|
|
ce894be40d | ||
|
|
de84b5da7e | ||
|
|
252f7704b1 | ||
|
|
584afa89a7 | ||
|
|
9d9fe04c5a | ||
|
|
a9eeb049e5 | ||
|
|
116d8cfc28 | ||
|
|
d6179f96c1 | ||
|
|
5249a5dbda | ||
|
|
33c9decae9 | ||
|
|
db787f8261 | ||
|
|
8690ac32e8 | ||
|
|
0d6b96d3aa | ||
|
|
c774475bf5 | ||
|
|
66a0ecf87f | ||
|
|
1bd2c84e16 | ||
|
|
5c95e6e025 | ||
|
|
1c36e9851a | ||
|
|
d4b9511aad | ||
|
|
cc96f52e14 | ||
|
|
519bd126c3 | ||
|
|
368637b894 | ||
|
|
0c1cb525c7 | ||
|
|
1aaae0af52 | ||
|
|
379713ae18 | ||
|
|
5e58b8a2af | ||
|
|
8e4341cd89 | ||
|
|
9c5cc9a256 | ||
|
|
935f3ddcd6 | ||
|
|
1f5055f815 | ||
|
|
4e937fc0aa | ||
|
|
4f503f2e63 | ||
|
|
8162b7aeb8 | ||
|
|
4cc240caf4 | ||
|
|
bb4a16eaef | ||
|
|
b932514d5e | ||
|
|
166c8a5abe | ||
|
|
28d559cdf5 | ||
|
|
6035d614ae | ||
|
|
5c7f970359 | ||
|
|
c77b725d99 | ||
|
|
12a50ad32b | ||
|
|
a835c68f8e | ||
|
|
26600ad5c3 | ||
|
|
ed4bbfbcbe | ||
|
|
8e221c4fa3 | ||
|
|
abfcd4652c | ||
|
|
0e5165eb02 | ||
|
|
d972ef6fb2 | ||
|
|
d1f2203c7c | ||
|
|
462489fc94 | ||
|
|
1215f65f26 | ||
|
|
101bac8b27 | ||
|
|
9debf69f1f | ||
|
|
0fc815c181 | ||
|
|
99198fec39 | ||
|
|
29f7619162 | ||
|
|
5f7c1dc839 | ||
|
|
af5c10b815 | ||
|
|
5d29924ceb | ||
|
|
5b0507d693 | ||
|
|
ba9f84445b | ||
|
|
f6dd72944f | ||
|
|
0ea1b31dd3 | ||
|
|
ad361b0034 | ||
|
|
6782e965de | ||
|
|
97d456b38c | ||
|
|
2e906139b0 | ||
|
|
80dfbdbaea | ||
|
|
00b6cd61a9 | ||
|
|
ee4593df3e | ||
|
|
2b67a2ec3f | ||
|
|
e63ce482f2 | ||
|
|
f59cd2ba61 | ||
|
|
ab37511cae | ||
|
|
f1039dd4e2 | ||
|
|
719c61207f | ||
|
|
fe0412f001 | ||
|
|
2d74859e05 | ||
|
|
b1121113f1 | ||
|
|
ee9600b772 | ||
|
|
60d84be151 | ||
|
|
732551a79a | ||
|
|
243fa7c315 | ||
|
|
4374557e9f | ||
|
|
8ef0996ea9 | ||
|
|
5eed8ff9e0 | ||
|
|
794f3762f2 | ||
|
|
01d4e109e7 | ||
|
|
4edfdaf9b5 | ||
|
|
f17a23ddd9 | ||
|
|
2e468226f6 | ||
|
|
3d297b0ba4 | ||
|
|
781f6ccb10 | ||
|
|
d2122ed2b0 | ||
|
|
cf06c5d0e9 | ||
|
|
d444ccf989 | ||
|
|
334907990d | ||
|
|
8cb5d3e503 | ||
|
|
86dcf85db0 | ||
|
|
b03b95e2a4 | ||
|
|
e0e1a0be11 | ||
|
|
bb010a6114 | ||
|
|
7ac3f074af | ||
|
|
549c1927f3 | ||
|
|
fcae472e5d | ||
|
|
2c3dc317a4 | ||
|
|
96d9fe0464 | ||
|
|
193cea7624 | ||
|
|
3261298090 | ||
|
|
865f26a97a | ||
|
|
1b2aa59d45 | ||
|
|
07e545d59e | ||
|
|
356a0ea5bd | ||
|
|
e6e101dfd1 | ||
|
|
3b81ed11ce | ||
|
|
cb1a27b8f7 | ||
|
|
cd8aba491a | ||
|
|
80bf7397a5 | ||
|
|
6d9e8212a0 | ||
|
|
334061690b | ||
|
|
0bda0d910f | ||
|
|
72d2391591 | ||
|
|
b12b27a6f0 | ||
|
|
00c25964ec | ||
|
|
32f9067d0e | ||
|
|
b42b001008 | ||
|
|
e3f2944049 | ||
|
|
2cf50fdc88 | ||
|
|
19dabdfcc0 | ||
|
|
c4a5b54c35 | ||
|
|
f41e196da3 | ||
|
|
52be604435 | ||
|
|
8f032bc5b5 | ||
|
|
8b0af6d00b | ||
|
|
1c43108e78 | ||
|
|
b6d1e1997d | ||
|
|
483f2f6e2e | ||
|
|
a5f5eca604 | ||
|
|
132eb72d57 | ||
|
|
cbb92c1430 | ||
|
|
246b4ad1aa | ||
|
|
f89f085421 | ||
|
|
c0b2628626 | ||
|
|
cce0fb751a | ||
|
|
b5bf0ccfd2 | ||
|
|
702edc0ecd | ||
|
|
e56aadc0cf | ||
|
|
b4e7db6808 | ||
|
|
5238153785 | ||
|
|
a6d1f68128 | ||
|
|
5a2c3dcaaa | ||
|
|
175570e428 | ||
|
|
08c4894406 | ||
|
|
ddbf643c52 | ||
|
|
b8fd7c2564 | ||
|
|
74455c95c4 | ||
|
|
0890c9fce8 | ||
|
|
c461188a76 | ||
|
|
dd3bd0cca0 | ||
|
|
665de0a76a | ||
|
|
209384aa9e | ||
|
|
c46c9dde47 | ||
|
|
dd054b4642 | ||
|
|
4ff873c623 | ||
|
|
fa56f043ef | ||
|
|
6dd2f2c957 | ||
|
|
4c326c55eb | ||
|
|
e648bc58f5 | ||
|
|
36097df1c6 | ||
|
|
4ca2c9fafc | ||
|
|
3c90d2a780 | ||
|
|
658dac2de0 | ||
|
|
dc4dd5e2b6 | ||
|
|
307ef53826 | ||
|
|
1a976b63f6 | ||
|
|
9d0d5cb136 | ||
|
|
9e2d9f22ba | ||
|
|
6d851001ef | ||
|
|
c673563872 | ||
|
|
1450f8838e | ||
|
|
148f96f6da | ||
|
|
597b5f13e7 | ||
|
|
1f399e1730 | ||
|
|
7296f89a76 | ||
|
|
b60d07ed69 | ||
|
|
777c2af1fe | ||
|
|
b39c736097 | ||
|
|
c981e00884 | ||
|
|
2aa3cd9ceb | ||
|
|
8849170f95 | ||
|
|
971ead2abc | ||
|
|
17e456ea85 | ||
|
|
75c235687c | ||
|
|
1e8e639c11 | ||
|
|
d659384669 | ||
|
|
dcacbb662c | ||
|
|
f9f7004a97 | ||
|
|
b61049136e | ||
|
|
af486b5054 | ||
|
|
5b32b51a2e | ||
|
|
6b2453b0c2 | ||
|
|
c709649a66 | ||
|
|
db13e8ca08 | ||
|
|
6727dbd122 | ||
|
|
51c321c788 | ||
|
|
381f3f2afe | ||
|
|
d5b00c7f14 | ||
|
|
7f33a240cf | ||
|
|
5f17b1f282 | ||
|
|
0dd664d933 | ||
|
|
222d35ba2a | ||
|
|
4deef56157 | ||
|
|
0b87bbb08b | ||
|
|
081ff74fbc | ||
|
|
d5d6d3b84d | ||
|
|
21f221f840 | ||
|
|
9d11223055 | ||
|
|
0bf563a085 | ||
|
|
43c6c57418 | ||
|
|
d6921ac2f2 | ||
|
|
1e47576a02 | ||
|
|
268f937a1f | ||
|
|
edb5d64de3 | ||
|
|
4728578919 | ||
|
|
56889e9bc1 | ||
|
|
64a273f287 | ||
|
|
a89c076bfc | ||
|
|
d4d1fa58e8 | ||
|
|
3db467e6f6 | ||
|
|
bb2e253937 | ||
|
|
f047e295b9 | ||
|
|
bd7d899204 | ||
|
|
ed1eaba00f | ||
|
|
376b050ee9 | ||
|
|
33b9e85352 | ||
|
|
eeaa4aa122 | ||
|
|
c2c82c36e6 | ||
|
|
99ffcc7501 | ||
|
|
ed1a2a6f11 | ||
|
|
b99446c33e | ||
|
|
9859213e7d | ||
|
|
008255eed9 | ||
|
|
11a0501087 | ||
|
|
076ccff595 | ||
|
|
30af4ede8c | ||
|
|
24f5a3d9ca | ||
|
|
8b848ea6ad | ||
|
|
61a13359fc | ||
|
|
b973f5ac69 | ||
|
|
a262748d1c | ||
|
|
47c513fc7a | ||
|
|
176116b148 | ||
|
|
fe6eb6d858 | ||
|
|
e63575051f | ||
|
|
2e10d1c4d8 | ||
|
|
7ce1632cc7 | ||
|
|
ea0d14982e | ||
|
|
1cb01c351a | ||
|
|
dfeb9b176c | ||
|
|
477db97893 | ||
|
|
0f0937d520 | ||
|
|
9e0a5b8dda | ||
|
|
04d445235f | ||
|
|
a8d532bb79 | ||
|
|
34595f93fb | ||
|
|
8d6a3ab755 | ||
|
|
9b917419dc | ||
|
|
f15564054f | ||
|
|
9970519fc4 | ||
|
|
432a586840 | ||
|
|
4a976707f8 | ||
|
|
3d922201ed | ||
|
|
c9ddf3d724 | ||
|
|
d9511b5a50 | ||
|
|
6d04acb923 | ||
|
|
34ccb6c231 | ||
|
|
b00e86e289 | ||
|
|
d7a75e4fba | ||
|
|
c931d836eb | ||
|
|
307fbf07da | ||
|
|
c2906b67bb | ||
|
|
a49bf084ba | ||
|
|
55638075e8 | ||
|
|
4a805d6b49 | ||
|
|
da69d50760 | ||
|
|
8c0b3b8851 | ||
|
|
667b1de51f | ||
|
|
6da5abec3e | ||
|
|
34af7a4608 | ||
|
|
9edc411146 | ||
|
|
e3cecd642e | ||
|
|
30fa15edad | ||
|
|
3640b78b2d | ||
|
|
32d9feec85 | ||
|
|
38427deaa9 | ||
|
|
32592fa6e1 | ||
|
|
7881284620 | ||
|
|
f8c7ce833e | ||
|
|
501710cba1 | ||
|
|
0cc94dceb2 | ||
|
|
3e6fcb9dca | ||
|
|
c1996b47bc | ||
|
|
ec6abf170e | ||
|
|
946499d8d7 | ||
|
|
176b389e10 | ||
|
|
1c7064c0af | ||
|
|
061b634e4a | ||
|
|
31383c4410 | ||
|
|
ba034ddb21 | ||
|
|
c7844ac086 | ||
|
|
598d78aca8 | ||
|
|
5dbaac9c50 | ||
|
|
859ff0ab5d | ||
|
|
e0f9f5f8e2 | ||
|
|
1b6258684f | ||
|
|
979a08812c | ||
|
|
e38564c283 | ||
|
|
e87813e07f | ||
|
|
191b4e299a | ||
|
|
e17e8659cb | ||
|
|
d1686af672 | ||
|
|
05bd425eba | ||
|
|
8c2a0f6b41 | ||
|
|
2e448ce46e | ||
|
|
983b5ddcd9 | ||
|
|
dcd6eb01ea | ||
|
|
abf14ae01a | ||
|
|
4e78b8f143 | ||
|
|
2b152865b3 | ||
|
|
0527883d33 | ||
|
|
3c4807983d | ||
|
|
ef0f4a25f7 | ||
|
|
d8cf6d28ef | ||
|
|
9dd5f88a76 | ||
|
|
e584b6a5a1 | ||
|
|
3f40b55e0c | ||
|
|
dcd5aa9928 | ||
|
|
cc020a6b86 | ||
|
|
9325b614fe | ||
|
|
f52cc1e74c | ||
|
|
b66f5435a9 | ||
|
|
754e790b4e | ||
|
|
d5ba4ac966 | ||
|
|
51076e2e13 | ||
|
|
3dcba141ec | ||
|
|
63f06d275e | ||
|
|
fb75799b42 | ||
|
|
8218669c3d | ||
|
|
f2378893c8 | ||
|
|
3f2dbb314c | ||
|
|
b493ea8e99 | ||
|
|
f1cab8f326 | ||
|
|
b1bfc6b9cf | ||
|
|
c2c951e7f8 | ||
|
|
9b636c9328 | ||
|
|
ced8ef4d71 | ||
|
|
b4a259e54f | ||
|
|
5087b40527 | ||
|
|
c3570833a5 | ||
|
|
7b5c0a5490 | ||
|
|
0e66d5506a | ||
|
|
dd28e872ad | ||
|
|
1d05d66559 | ||
|
|
cadc7286e4 | ||
|
|
175269d933 | ||
|
|
1186101405 | ||
|
|
9845bce011 | ||
|
|
bc1f73cd9e | ||
|
|
0a55bab557 | ||
|
|
8b520832b9 | ||
|
|
cdd9b46762 | ||
|
|
5087b9b097 | ||
|
|
37112bc046 | ||
|
|
d694ab972f | ||
|
|
dcb6bd5973 | ||
|
|
0ebe0a4652 | ||
|
|
a18676255d | ||
|
|
1c79aff237 | ||
|
|
f48015fd94 | ||
|
|
2490c245af | ||
|
|
2172a75d87 | ||
|
|
2ffd018374 | ||
|
|
244cccb5d1 | ||
|
|
dd0604d5eb | ||
|
|
16ef48adcd | ||
|
|
5467c1838d | ||
|
|
225f0584da | ||
|
|
f8c051689b | ||
|
|
2ade6c86f9 | ||
|
|
ddaccc1f26 | ||
|
|
fbee0b5524 | ||
|
|
2a24ef0296 | ||
|
|
a1c6abd840 | ||
|
|
4232c39a18 | ||
|
|
7b4aad86e1 | ||
|
|
6fb34e8453 | ||
|
|
cbf3244393 | ||
|
|
9e9dae4511 | ||
|
|
616d38e01a | ||
|
|
4aa9574ffe | ||
|
|
b049d85cf0 | ||
|
|
3d953cbb83 | ||
|
|
c50f8d3acf | ||
|
|
6e1121c2d9 | ||
|
|
ab05faab56 | ||
|
|
ad3e9eec3f | ||
|
|
b2ff2f5475 | ||
|
|
b1f31a9e30 | ||
|
|
3148db617e | ||
|
|
466262b0fd | ||
|
|
ba7bcd62b9 | ||
|
|
bd05ec34b5 | ||
|
|
489dcad781 | ||
|
|
75e870bf80 | ||
|
|
f3715745e2 | ||
|
|
bdf9731aad | ||
|
|
fcbf19b87f | ||
|
|
46adb79a84 | ||
|
|
982bcc6574 | ||
|
|
fd9c02553e | ||
|
|
8f0051e5da | ||
|
|
90bade3f9e | ||
|
|
879bcd3dbe | ||
|
|
1570ae2e1e | ||
|
|
7dd61549ae | ||
|
|
183367f869 | ||
|
|
2a6670788d | ||
|
|
9e740fac46 | ||
|
|
375c80910b | ||
|
|
64a99cbcc4 | ||
|
|
a2778fad2f | ||
|
|
7d3efd1ae3 | ||
|
|
1ef2b77848 | ||
|
|
bcc7ef2082 | ||
|
|
a704f3bb96 | ||
|
|
63236dfa91 | ||
|
|
468ac41b66 | ||
|
|
b1d4970f0e | ||
|
|
c24d3c37c3 | ||
|
|
0081d86569 | ||
|
|
065bc208b3 | ||
|
|
742ab46863 | ||
|
|
d001b2a986 | ||
|
|
d024afd811 | ||
|
|
484307c6dc | ||
|
|
e64bbf889e | ||
|
|
b5c996e95b | ||
|
|
e6e9460541 | ||
|
|
79e1e729a1 | ||
|
|
d77f11eff2 | ||
|
|
4be3a056c9 | ||
|
|
6c61a1d979 | ||
|
|
1b36cf1517 | ||
|
|
a7eb073f7f | ||
|
|
681521266d | ||
|
|
2bae921097 | ||
|
|
10824c470f | ||
|
|
6ccd350a1d | ||
|
|
9e2845f5e9 | ||
|
|
37a0fec61a | ||
|
|
457f7b1e94 | ||
|
|
feafd5eb60 | ||
|
|
5339627bca | ||
|
|
f754194d31 | ||
|
|
dbc2872088 | ||
|
|
73c7b11b00 | ||
|
|
4d3a7a38f1 | ||
|
|
96756c14d9 | ||
|
|
36a6b55866 | ||
|
|
3ab78a2fec | ||
|
|
d1f266d3fa | ||
|
|
7a5bd2f430 | ||
|
|
100fa1c227 | ||
|
|
dbf2a0eef6 | ||
|
|
83aaaa04ba | ||
|
|
3e4860116c | ||
|
|
a0c49af128 | ||
|
|
091da21cf4 | ||
|
|
ef5749914b | ||
|
|
a0a263475e | ||
|
|
d3952da2d6 | ||
|
|
7eca6494db | ||
|
|
bcfa0713ea | ||
|
|
88333318d6 | ||
|
|
36c56bfc85 | ||
|
|
45da5a7fd0 | ||
|
|
c0eabe2017 | ||
|
|
6db1abe692 | ||
|
|
d27bb31aa9 | ||
|
|
297f9e16ec | ||
|
|
0ed3738afe | ||
|
|
fe7377435f | ||
|
|
63b56c396b | ||
|
|
fd120dee00 | ||
|
|
9da531cd6b | ||
|
|
aabfe0f826 | ||
|
|
390cefda5f | ||
|
|
218ef805b6 | ||
|
|
608179b291 | ||
|
|
3dbeb7eb3f | ||
|
|
4f668b7081 | ||
|
|
0b91100f7c | ||
|
|
6ed5f63bed | ||
|
|
81ed947e44 | ||
|
|
666a630c33 | ||
|
|
850497c0cd | ||
|
|
51c9f366be | ||
|
|
673b825eb8 | ||
|
|
7c0e3e8a42 | ||
|
|
3fed540617 | ||
|
|
b092c9244f | ||
|
|
4eb16d16d7 | ||
|
|
5e7cf504fd | ||
|
|
ebc409c1ab | ||
|
|
ad102c9784 | ||
|
|
23ab9042c7 | ||
|
|
1e93bb44a7 | ||
|
|
05e69a161e | ||
|
|
31c3b38273 | ||
|
|
d385a92372 | ||
|
|
f303703535 | ||
|
|
e590ed528d | ||
|
|
87455362bb | ||
|
|
51d0ad7397 | ||
|
|
7193d515a9 | ||
|
|
d0af8926a5 | ||
|
|
833b4d4d0d | ||
|
|
fce42ff00f | ||
|
|
df3d6278c2 | ||
|
|
a041ac5c7a | ||
|
|
a26fdf4b82 | ||
|
|
946c2cc718 | ||
|
|
fcdda5c5c1 | ||
|
|
abda00a8fc | ||
|
|
8f2154011e | ||
|
|
211d1478d5 | ||
|
|
a1e4c2a923 | ||
|
|
08c475b210 | ||
|
|
cb298f94b8 | ||
|
|
db2d99b076 | ||
|
|
f91535f863 | ||
|
|
8676f937c5 | ||
|
|
fa92838811 | ||
|
|
0889233a65 | ||
|
|
fc005bd21c | ||
|
|
9c7104846c | ||
|
|
0c1bfe75d8 | ||
|
|
07be1b0f72 | ||
|
|
2a9e445535 | ||
|
|
3d14e0916d | ||
|
|
5ceb3206bb | ||
|
|
c825e4b301 | ||
|
|
77eb4f3439 | ||
|
|
c6590e6940 | ||
|
|
a63203122e | ||
|
|
cb04e26922 | ||
|
|
66875f5837 | ||
|
|
e925328b5c | ||
|
|
789a083e10 | ||
|
|
fd8d8e3fd8 | ||
|
|
deac8ecb86 | ||
|
|
7485ef4bb4 | ||
|
|
3ab3644d20 | ||
|
|
8a5d0ddf5f | ||
|
|
baf0aa3a0a | ||
|
|
960299f551 | ||
|
|
ded383e7e5 | ||
|
|
829f95d1e4 | ||
|
|
8ba2c2c961 | ||
|
|
d52a9494a8 | ||
|
|
3ff0cf564d | ||
|
|
5e50cc117b | ||
|
|
2992df5b5a | ||
|
|
b37c86dc20 | ||
|
|
d408a4413d | ||
|
|
f6d39212e9 | ||
|
|
e1240ab078 | ||
|
|
ee4b78af1f | ||
|
|
0c343f8c51 | ||
|
|
8ae908a372 | ||
|
|
364fdd5a9a | ||
|
|
ddcdca1972 | ||
|
|
702ce6032c | ||
|
|
e57c5fedba | ||
|
|
091d8a00a7 | ||
|
|
a1f45d1784 | ||
|
|
27c01fccd5 | ||
|
|
97898ac00a | ||
|
|
10b169bbbd | ||
|
|
33444d5bfd | ||
|
|
4bc1a77489 | ||
|
|
3eaef57ed6 | ||
|
|
c833d569c4 | ||
|
|
8966bc4b40 | ||
|
|
384b9f6b4e | ||
|
|
f33d1fd371 | ||
|
|
d524d1607b | ||
|
|
b03844fe0f | ||
|
|
a3902839d9 | ||
|
|
bd78450e96 | ||
|
|
339afcce8a | ||
|
|
d76d572b5a | ||
|
|
37070ed319 | ||
|
|
c5ae175c14 | ||
|
|
6812881a0e | ||
|
|
b17310ba03 | ||
|
|
03568c1065 | ||
|
|
dbedf1803d | ||
|
|
2be995a545 | ||
|
|
379e584b92 | ||
|
|
3635a7c72c | ||
|
|
9699371b8c | ||
|
|
dd19db0171 | ||
|
|
b2795bfed8 | ||
|
|
fbd9ebf114 | ||
|
|
fa04adcb99 | ||
|
|
0e9be6ddc6 | ||
|
|
2af2ec249b | ||
|
|
72c48ee8e7 | ||
|
|
235cb9eb66 | ||
|
|
095504a872 | ||
|
|
0cc6721116 | ||
|
|
2fa35a3162 | ||
|
|
8934624982 | ||
|
|
4ed9a862df | ||
|
|
a2bd5d7922 | ||
|
|
f21bf31eb0 | ||
|
|
96a55c36a5 | ||
|
|
ba3e4b0f20 | ||
|
|
0ae6479a1e | ||
|
|
625d626ffc | ||
|
|
fcd65c543a | ||
|
|
9a1606dbb2 | ||
|
|
2996818b97 | ||
|
|
fa441ace42 | ||
|
|
4736a601af | ||
|
|
f8413c4ccd | ||
|
|
8b5c24895c | ||
|
|
7088cd1bf8 | ||
|
|
f2e4f73f72 | ||
|
|
9aa3de4341 | ||
|
|
f449c5a84e | ||
|
|
96d268d75c | ||
|
|
d4c5628835 | ||
|
|
2860db776d | ||
|
|
faf9dec2f3 | ||
|
|
27d0742fde | ||
|
|
7edacf7a1d | ||
|
|
9cf2df2097 | ||
|
|
96174e85fa | ||
|
|
7fd758d256 | ||
|
|
79ea35270e | ||
|
|
355b4331a7 | ||
|
|
a6fedb424b | ||
|
|
d1401ae1e7 | ||
|
|
95a77014e6 | ||
|
|
2dec274052 | ||
|
|
c5216bcf50 | ||
|
|
b2fdbf4cb4 | ||
|
|
e205358e25 | ||
|
|
676b7edbaf | ||
|
|
9c60acb6ce | ||
|
|
dc7eed33bc | ||
|
|
36886026e8 | ||
|
|
096e767f95 | ||
|
|
b2af9e1427 | ||
|
|
027b873ef5 | ||
|
|
2bd34cf543 | ||
|
|
4d2b17f530 | ||
|
|
65c348f115 | ||
|
|
acbb7712ae | ||
|
|
d2ec18b325 | ||
|
|
e9f9c520c6 | ||
|
|
670fa86718 | ||
|
|
35f21942b9 | ||
|
|
15bf313676 | ||
|
|
c5a5921a54 | ||
|
|
60ee060f62 | ||
|
|
c89e5197d3 | ||
|
|
7f58c1cf8f | ||
|
|
ab01d56e79 | ||
|
|
61f92897ed | ||
|
|
6b79d15f4c | ||
|
|
8e43f2a2e9 | ||
|
|
624b1625b9 | ||
|
|
46b275078b | ||
|
|
371cb2fc61 | ||
|
|
f9888f9161 | ||
|
|
5495555f65 | ||
|
|
09874be8dc | ||
|
|
18470b68ba | ||
|
|
7b59ba0a02 | ||
|
|
68ad4de532 | ||
|
|
3e88623c12 | ||
|
|
d914fa40b4 | ||
|
|
c193c19371 | ||
|
|
85a4bf1d8e | ||
|
|
0c9b70f32b | ||
|
|
e174d58ed7 | ||
|
|
1e9c0a90e0 | ||
|
|
b2169c29b8 | ||
|
|
cb5423e712 | ||
|
|
3baae40304 | ||
|
|
c7dda3e1f6 | ||
|
|
1ba5cdbaf6 | ||
|
|
1a22639c79 | ||
|
|
534006a292 | ||
|
|
310da7ba2f | ||
|
|
043794682b | ||
|
|
90c9d94a64 | ||
|
|
5b4c0b3c70 | ||
|
|
37753945fc | ||
|
|
375440882d | ||
|
|
80a11a7ad3 | ||
|
|
292b375a2f | ||
|
|
0df21a1729 | ||
|
|
a1e72bba1e | ||
|
|
d280b1d9d7 | ||
|
|
45bbaba878 | ||
|
|
c9a7e63cc4 | ||
|
|
3da87a4b64 | ||
|
|
1ccbf85b35 | ||
|
|
3c55c995a0 | ||
|
|
4f7018f975 | ||
|
|
d53851dcae | ||
|
|
64bf413f6a | ||
|
|
32270a048a | ||
|
|
75366daa97 | ||
|
|
6534d0c80b | ||
|
|
f231a9a4cb | ||
|
|
58d8ef8d01 | ||
|
|
86885e81e1 | ||
|
|
3174ee1055 | ||
|
|
e0a0cd6cc0 | ||
|
|
e2b9415d7c | ||
|
|
269ea070e6 | ||
|
|
b8067fe39e | ||
|
|
7d91171fa6 | ||
|
|
4ef71a6086 | ||
|
|
7cc4e877a6 | ||
|
|
eeb0448b81 | ||
|
|
0893400c85 | ||
|
|
991f41cbc8 | ||
|
|
0c1cbba8b5 | ||
|
|
9d63499817 | ||
|
|
4c46192950 | ||
|
|
ed6c90e4cf | ||
|
|
ea5a4dd249 | ||
|
|
787fd14b47 | ||
|
|
3dcdee1044 | ||
|
|
4b6563df51 | ||
|
|
5b6c9575f2 | ||
|
|
4f9ef9b8bd | ||
|
|
1116648212 | ||
|
|
a0557c372e | ||
|
|
19710e6cb7 | ||
|
|
410a4fb3b2 | ||
|
|
7371a0b20f | ||
|
|
cc0c80339a | ||
|
|
c042191a3f | ||
|
|
fa79039824 | ||
|
|
0b0f1e128c | ||
|
|
4c886d1021 | ||
|
|
5c43b2b2c8 | ||
|
|
d4827fc15b | ||
|
|
74d0854e19 | ||
|
|
0924db5b2c | ||
|
|
00f20e06da | ||
|
|
c997567b07 | ||
|
|
32a58be443 | ||
|
|
d48f035ca7 | ||
|
|
4f0ec63e11 | ||
|
|
6303e2d00a | ||
|
|
f1102dda23 | ||
|
|
b49ac588de | ||
|
|
54e5dd6ebc | ||
|
|
5de0a0b637 | ||
|
|
ce29c66aab | ||
|
|
170fe0fc97 | ||
|
|
29ef8e898c | ||
|
|
ebc5ecdc49 | ||
|
|
305a9167c5 | ||
|
|
a2f7523c10 | ||
|
|
24697ab983 | ||
|
|
fac186c4ad | ||
|
|
af87a2f248 | ||
|
|
e1f581ea95 | ||
|
|
4fbdc2fc0f | ||
|
|
6368fd01a7 | ||
|
|
66e8dc8d8a | ||
|
|
5342674ca9 | ||
|
|
26cc387729 | ||
|
|
165ac99ba0 | ||
|
|
59b7239e67 | ||
|
|
48d61a4757 | ||
|
|
5aab0b92f0 | ||
|
|
670211edd8 | ||
|
|
801a4fe99f | ||
|
|
9c8f73a8f0 | ||
|
|
874949f141 | ||
|
|
cd319ad609 | ||
|
|
e5625c0d3e | ||
|
|
eec0c667b8 | ||
|
|
ea9460a146 | ||
|
|
b8038d013a | ||
|
|
ede9d759c2 | ||
|
|
576d6d7c77 | ||
|
|
c58a8bcaff | ||
|
|
da4ee1e1f6 | ||
|
|
1053817440 | ||
|
|
df1d7e2808 | ||
|
|
028413a836 | ||
|
|
f349160857 | ||
|
|
13c504c824 | ||
|
|
08e08e24bc | ||
|
|
a583239a27 | ||
|
|
22f1e69f02 | ||
|
|
8dfb112feb | ||
|
|
71351e6450 | ||
|
|
03650d4867 | ||
|
|
69521dd5d3 | ||
|
|
d5775fb626 | ||
|
|
2d14ac1d51 | ||
|
|
8663961bdf | ||
|
|
2bf496221b | ||
|
|
03a4185f8a | ||
|
|
80cab90674 | ||
|
|
703dbaf64b | ||
|
|
3b7c0794b8 | ||
|
|
75b139baef | ||
|
|
1e27a68010 | ||
|
|
977cf5f42a | ||
|
|
9302e4296a | ||
|
|
5f1a886f61 | ||
|
|
9cd5ff0a00 | ||
|
|
97c2dbe99d | ||
|
|
98f5c9dd3d | ||
|
|
a36609968c | ||
|
|
de72e24a74 | ||
|
|
0e3b3bacd2 | ||
|
|
0dfafd06f9 | ||
|
|
7837f6d907 | ||
|
|
b9f4f0dd71 | ||
|
|
c38de251b2 | ||
|
|
fd744051d3 | ||
|
|
548958d0f3 | ||
|
|
e50f5c55aa | ||
|
|
93491aafd4 | ||
|
|
14d845a06b | ||
|
|
2cece923b1 | ||
|
|
9f4aa852a8 | ||
|
|
5e4c2de737 | ||
|
|
e59ca19d8c | ||
|
|
2731cf4703 | ||
|
|
f00a108a93 | ||
|
|
083a1cde2e | ||
|
|
0469b21d36 | ||
|
|
4be77da55a | ||
|
|
2800b91dc1 | ||
|
|
5f581cabad | ||
|
|
33c5a1f11e | ||
|
|
f10ef42ade | ||
|
|
acee8de036 | ||
|
|
ee6caf9c4b | ||
|
|
be7d2cb72a | ||
|
|
d9884cfb5d | ||
|
|
f05142f51e | ||
|
|
c8ec2db41a | ||
|
|
461f88eff7 | ||
|
|
65123fba41 | ||
|
|
fd364b15d8 | ||
|
|
b27aa3660d | ||
|
|
ae5ca54d8e | ||
|
|
e32442b816 | ||
|
|
0f4ca4981d | ||
|
|
098fef3119 | ||
|
|
af90d9f892 | ||
|
|
9bda7493f4 | ||
|
|
794ecdd8fe | ||
|
|
c8fd58e07d | ||
|
|
decc73730c | ||
|
|
fae2e7b855 | ||
|
|
eccd9eace8 | ||
|
|
6f5c751027 | ||
|
|
adda7082d8 | ||
|
|
2e186fb37f | ||
|
|
07105200e3 | ||
|
|
3e41dda406 | ||
|
|
fd25983668 | ||
|
|
2090593d55 | ||
|
|
9890008f83 | ||
|
|
432b43d3c3 | ||
|
|
be8fdbef0a | ||
|
|
d37dfeba8b | ||
|
|
960b794184 | ||
|
|
4a04416d1c | ||
|
|
ff73238817 | ||
|
|
3575e43cac | ||
|
|
96524babfc | ||
|
|
f5436a0d35 | ||
|
|
7e4a822ff3 | ||
|
|
30665c837b | ||
|
|
a6e63c58b6 | ||
|
|
c8ab09f607 | ||
|
|
ca69d7706b | ||
|
|
707faa1da0 | ||
|
|
27adb1a3dd | ||
|
|
5146b63c51 | ||
|
|
99ec85dde6 | ||
|
|
3ef9d11dac | ||
|
|
1a79a31591 | ||
|
|
6444d665e0 | ||
|
|
d93105b689 | ||
|
|
619c557bb8 | ||
|
|
5384d38dfb | ||
|
|
0a23f60a70 | ||
|
|
1acdae2e33 | ||
|
|
2e6b068ca6 | ||
|
|
1035a9e102 | ||
|
|
2fce3738a3 | ||
|
|
78ef4bb1e9 | ||
|
|
790d1b5169 | ||
|
|
357c97f16c | ||
|
|
dabf25f006 | ||
|
|
f83ebd9b11 | ||
|
|
cb1e2e6d1b | ||
|
|
f33772358f | ||
|
|
703c2a790c | ||
|
|
e3095ab052 | ||
|
|
235d8d73b9 | ||
|
|
b1d1113f0c | ||
|
|
5dd3e36558 | ||
|
|
5bbb86970a | ||
|
|
e8c30ece41 | ||
|
|
6c9f7e2e5a | ||
|
|
61b2630cc5 | ||
|
|
f9ff75cbe9 | ||
|
|
37fc0ea58e | ||
|
|
0a666c164e | ||
|
|
6a11fc957f | ||
|
|
1ae4f4ea6d | ||
|
|
9b655989a1 | ||
|
|
673efb8f58 | ||
|
|
207d783b47 | ||
|
|
6641553dc3 | ||
|
|
155dd50f2c | ||
|
|
c54078e092 | ||
|
|
4a13e77213 | ||
|
|
e0764fbe5f | ||
|
|
f3262603cb | ||
|
|
3329ac2c69 | ||
|
|
37debbfead | ||
|
|
0ef5cf2e12 | ||
|
|
600a352270 | ||
|
|
be13e2553b | ||
|
|
0b1b289d13 | ||
|
|
4db6bc8ecf | ||
|
|
43cbebaa93 | ||
|
|
f94727893d | ||
|
|
97decb4428 | ||
|
|
d5f5758b23 | ||
|
|
d18af846d8 | ||
|
|
08cd384dd1 | ||
|
|
d4910aea39 | ||
|
|
4d14b4476f | ||
|
|
8e9391d518 | ||
|
|
940daaaf96 | ||
|
|
926a21f7f7 | ||
|
|
f68df94d2d | ||
|
|
effd6d2e42 | ||
|
|
bc7c2b9b7f | ||
|
|
47264dd52f | ||
|
|
a63820f27d | ||
|
|
05bc18c52a | ||
|
|
c00e82384c | ||
|
|
b0360066ce | ||
|
|
fd9de297e7 | ||
|
|
eb5213b27e | ||
|
|
a2c3ea44b6 | ||
|
|
6a4a932864 | ||
|
|
f12ac43387 | ||
|
|
a59b46020d | ||
|
|
524c734e45 | ||
|
|
749e23241c | ||
|
|
7ab45e8daf | ||
|
|
e83ea7fda9 | ||
|
|
d16efc8370 | ||
|
|
0e7d8e3aa7 | ||
|
|
b85c0d84be | ||
|
|
79c749bdc4 | ||
|
|
7a173709f0 | ||
|
|
9839e83089 | ||
|
|
f64a7d8528 | ||
|
|
ce44fc9536 | ||
|
|
316974af35 | ||
|
|
0a2523b2dd | ||
|
|
e3787c4fad | ||
|
|
95ede7bfcf | ||
|
|
df991e65d8 | ||
|
|
ab0e727795 | ||
|
|
f51ad105fd | ||
|
|
84d3ab5fed | ||
|
|
b8ea1126db | ||
|
|
e3f81512df | ||
|
|
487a77d691 | ||
|
|
acd55b7659 | ||
|
|
899eba5aeb | ||
|
|
d0ba8eb254 | ||
|
|
3bd3d1f844 | ||
|
|
be65de08fd | ||
|
|
7b70d92069 | ||
|
|
7f477fb28c | ||
|
|
09741f04db | ||
|
|
1879dde6a2 | ||
|
|
d122428a22 | ||
|
|
dc7ba35e40 | ||
|
|
3978244fb9 | ||
|
|
2b8a08c9b5 | ||
|
|
b3e0416c95 | ||
|
|
56d2ac6876 | ||
|
|
f58ecefe9c | ||
|
|
083638a290 | ||
|
|
945421d42b | ||
|
|
e6ec89614f | ||
|
|
9aa1113404 | ||
|
|
dcf2c6f2e5 | ||
|
|
60b3be1f25 | ||
|
|
00718839e9 | ||
|
|
56c4488d91 | ||
|
|
01482d75cd | ||
|
|
12f4dc268d | ||
|
|
4976522161 | ||
|
|
597f34602d | ||
|
|
b51b0d7c27 | ||
|
|
9f17430e7d | ||
|
|
880faef485 | ||
|
|
1951c45fdc | ||
|
|
4da4d679ba | ||
|
|
d24bd9dd79 | ||
|
|
1f71ff8d50 | ||
|
|
ab292e4f1f | ||
|
|
412eeea36e | ||
|
|
88bfa91fc7 | ||
|
|
ee73733d3d | ||
|
|
b14fdd35be | ||
|
|
8d39c56892 | ||
|
|
f6e2a8018e | ||
|
|
b4619d97c0 | ||
|
|
5e9608e856 | ||
|
|
805c0c11fe | ||
|
|
4e8378e763 | ||
|
|
30c6b13d46 | ||
|
|
bf5c14847f | ||
|
|
c94584a65c | ||
|
|
d255662ca7 | ||
|
|
085c38b8da | ||
|
|
62f6105055 | ||
|
|
48bf15ab91 | ||
|
|
f7228ec994 | ||
|
|
0313ed9738 | ||
|
|
e9e59c0d21 | ||
|
|
b009dc03b9 | ||
|
|
721630353d | ||
|
|
82e2a967df | ||
|
|
478c828145 | ||
|
|
017f957fd9 | ||
|
|
47f15d590e | ||
|
|
e91f284c07 | ||
|
|
1e09258230 | ||
|
|
13ab6269f3 | ||
|
|
9ccfea39c4 | ||
|
|
ec57ec873f | ||
|
|
84520b1e14 | ||
|
|
3dfae5bbcc | ||
|
|
66bab5f6e3 | ||
|
|
74ee817188 | ||
|
|
4a957a219e | ||
|
|
5972d1e077 | ||
|
|
398c6180db | ||
|
|
6ccfd64676 | ||
|
|
36f7e20539 | ||
|
|
1da5e3d647 | ||
|
|
80eeefb723 | ||
|
|
0d1e317729 | ||
|
|
893cbad07f | ||
|
|
643dadcdd9 | ||
|
|
5d5cae5864 | ||
|
|
1b75d96c5b | ||
|
|
abe537bdde | ||
|
|
e6d847b909 | ||
|
|
945bcf681b | ||
|
|
b2fd1329a0 | ||
|
|
d2915d16d3 | ||
|
|
74d39bb1c3 | ||
|
|
2b5363b7aa | ||
|
|
11e411188f | ||
|
|
ca24c529bd | ||
|
|
ad82769079 | ||
|
|
806d734feb | ||
|
|
d395298e0c | ||
|
|
f46a950880 | ||
|
|
1fa43367bb | ||
|
|
f75d1182a7 | ||
|
|
5f78913337 | ||
|
|
7a9d406987 | ||
|
|
e60a1e46d7 | ||
|
|
3036e8de9b | ||
|
|
e499b1961f | ||
|
|
01519f58e2 | ||
|
|
5bebf0d77c | ||
|
|
35bd6ce005 | ||
|
|
379ca7eb4c | ||
|
|
1d6003277f | ||
|
|
f754335315 | ||
|
|
eac34daff7 | ||
|
|
364c12bc93 | ||
|
|
67291a1077 | ||
|
|
c205e2c04f | ||
|
|
9a6a29a0d6 | ||
|
|
ab4eb80a11 | ||
|
|
573ba69ecb | ||
|
|
3988762858 | ||
|
|
bfed4e7c20 | ||
|
|
bd4ca2a390 | ||
|
|
4142754bd1 | ||
|
|
a07fcab347 | ||
|
|
6b92d49bdd | ||
|
|
9a912de0e1 | ||
|
|
7cfbf3a67b | ||
|
|
b2cf1d8151 | ||
|
|
80267e4ba2 | ||
|
|
cb161038ce | ||
|
|
b391703d98 | ||
|
|
5d3d453ac9 | ||
|
|
8692499e59 | ||
|
|
710fcc50d3 | ||
|
|
df6c9ce263 | ||
|
|
0d4e9108ca | ||
|
|
d31e7abbb9 | ||
|
|
70532e1168 | ||
|
|
8b7bd111f2 | ||
|
|
cd164e97a2 | ||
|
|
c535541682 | ||
|
|
dd4e2d038c | ||
|
|
3b2bec70bf | ||
|
|
6162d39233 | ||
|
|
45da16b306 | ||
|
|
4e4edd0356 | ||
|
|
5cbea0f1ec | ||
|
|
00ff5052ca | ||
|
|
e2f5596ea3 | ||
|
|
9e24003c5f | ||
|
|
6f65f2d4a4 | ||
|
|
ce012b2b13 | ||
|
|
1233cd2b49 | ||
|
|
1f7957bbc7 | ||
|
|
b90594694b | ||
|
|
f612d438db | ||
|
|
8ff2b3b1c1 | ||
|
|
6699b1d614 | ||
|
|
fc04cf4c17 | ||
|
|
60324c45d1 | ||
|
|
18455df1c3 | ||
|
|
6fdc3ffa9b | ||
|
|
ba3bb11729 | ||
|
|
e30a6edff3 | ||
|
|
1526cec953 | ||
|
|
b2c830690b | ||
|
|
68aa1c80e5 | ||
|
|
ca60bedc58 | ||
|
|
b0dcd370b5 | ||
|
|
76dd281f0d | ||
|
|
3c1a4df051 | ||
|
|
f7a4362c56 | ||
|
|
22b9fa451c | ||
|
|
33b3b49288 | ||
|
|
98bb5b3314 | ||
|
|
e59d48cff3 | ||
|
|
9891fe14e6 | ||
|
|
2c76c26721 | ||
|
|
29ca4c23bc | ||
|
|
5df9635701 | ||
|
|
75a123b2ee | ||
|
|
079c005617 | ||
|
|
c5c06de4da | ||
|
|
b7ecf11083 | ||
|
|
19cc41ca68 | ||
|
|
79ee413eec | ||
|
|
56cf68426e | ||
|
|
4787cd5e13 | ||
|
|
f43ae4b0c5 | ||
|
|
5ab6658ab9 | ||
|
|
c4aee0da62 | ||
|
|
d85b082391 | ||
|
|
c160aeabf3 | ||
|
|
6eda94e535 | ||
|
|
7e4963637d | ||
|
|
f34c34a981 | ||
|
|
007b84bbfd | ||
|
|
20f0db9efd | ||
|
|
f728c86270 | ||
|
|
63994c899a | ||
|
|
ae979782da | ||
|
|
90bdf55344 | ||
|
|
2fbb1fb4e3 | ||
|
|
c5978ee653 | ||
|
|
c38f24f3ea | ||
|
|
179ced1243 | ||
|
|
871c405242 | ||
|
|
f22ae68dd3 | ||
|
|
b83bfcbe59 | ||
|
|
84e66af259 | ||
|
|
e6668b4d31 | ||
|
|
1f196c9975 | ||
|
|
48eb596de2 | ||
|
|
1251e59880 | ||
|
|
5f6247537d | ||
|
|
21ab169b68 | ||
|
|
3bc78537e4 | ||
|
|
9134079406 | ||
|
|
c05663e5e2 | ||
|
|
f5ead3cd95 | ||
|
|
24c5daca8b | ||
|
|
6f6b9113b2 | ||
|
|
c96dd9f540 | ||
|
|
52bbc59b7a | ||
|
|
04d75799be | ||
|
|
66937619db | ||
|
|
3508578f08 | ||
|
|
a5014bac8a | ||
|
|
300670690c | ||
|
|
51d1cbe590 | ||
|
|
9aefa78dcf | ||
|
|
23d0d3db3e | ||
|
|
d7bec35ca1 | ||
|
|
507d2da35b | ||
|
|
0d9cf334b3 | ||
|
|
13fddb6878 | ||
|
|
bcaa3d5f38 | ||
|
|
98ade06c5b | ||
|
|
d50a34f2fd | ||
|
|
d8bb0d8931 | ||
|
|
dddd29e31e | ||
|
|
8e4dd72da3 | ||
|
|
eb1e6bf0e7 | ||
|
|
42499e9b83 | ||
|
|
6a035fcddd | ||
|
|
690b22651d | ||
|
|
80407d0f85 | ||
|
|
20c3192308 | ||
|
|
7596fd3263 | ||
|
|
472fb332e1 | ||
|
|
5c218817b7 | ||
|
|
1c552d6363 | ||
|
|
cb866264fe | ||
|
|
ec7f04f5af | ||
|
|
f32aa4dbc4 | ||
|
|
0a8c73f0d4 | ||
|
|
0b2e2bfba2 | ||
|
|
c94ad1b7db | ||
|
|
267eedb001 | ||
|
|
97776ae093 | ||
|
|
956c5cc6d3 | ||
|
|
112e8ce552 | ||
|
|
d4278a7540 | ||
|
|
60d83beb96 | ||
|
|
acd10c909d | ||
|
|
1349b5dad4 | ||
|
|
19818eaa54 | ||
|
|
258ebe22f8 | ||
|
|
d772b13a57 | ||
|
|
46890c5cbc | ||
|
|
9411c96bdb | ||
|
|
be7acaf4cc | ||
|
|
ddacee16d3 | ||
|
|
dca0459b34 | ||
|
|
d7fc61cd9f | ||
|
|
2f31f19df9 | ||
|
|
2f00dc90ae | ||
|
|
3a37b73eab | ||
|
|
cf3bd77d9a | ||
|
|
a601a24765 | ||
|
|
3ac487b083 | ||
|
|
158674028d | ||
|
|
9b03fc96d8 | ||
|
|
15091c910a | ||
|
|
94c1fefbf7 | ||
|
|
8f39f603ba | ||
|
|
ee22698539 | ||
|
|
4b61fe58b7 | ||
|
|
dbfc00c76b | ||
|
|
89939dd7cf | ||
|
|
00b7524089 | ||
|
|
1a83a8188e | ||
|
|
278d9ea66b | ||
|
|
3871597854 | ||
|
|
5563943e5f | ||
|
|
e6a648cfbb | ||
|
|
8d39996f66 | ||
|
|
258092bcc8 | ||
|
|
a51dd18872 | ||
|
|
c1fb9ff172 | ||
|
|
e26583188c | ||
|
|
24be925378 | ||
|
|
5e8db0c547 | ||
|
|
2f78fa6120 | ||
|
|
07f0f22025 | ||
|
|
6664310c68 | ||
|
|
1c6fa36f87 | ||
|
|
cb6bce4173 | ||
|
|
6889802b50 | ||
|
|
cdf3de1d74 | ||
|
|
d70c988f51 | ||
|
|
0253b1eaae | ||
|
|
e8cfa7c5f6 | ||
|
|
d9299c4bc3 | ||
|
|
0633ab1c2c | ||
|
|
fcf0688ef4 | ||
|
|
b210c96897 | ||
|
|
67b0db3421 | ||
|
|
470dc11aeb | ||
|
|
6a859655b7 | ||
|
|
1e8dc1e3ef | ||
|
|
7f2b8d7b47 | ||
|
|
385307e652 | ||
|
|
988b3249e7 | ||
|
|
11e28ad143 | ||
|
|
99bd896fa0 | ||
|
|
c628c8cd1b | ||
|
|
8ed02f441f | ||
|
|
d3645a1bfe | ||
|
|
3a36261f69 | ||
|
|
ebe82f4efa | ||
|
|
948bd64f89 | ||
|
|
1f1446c5c0 | ||
|
|
50f9a9a376 | ||
|
|
f2d7b0374e | ||
|
|
83a10ea91b | ||
|
|
8614dc57ef | ||
|
|
7c65187c2c | ||
|
|
8d123f458f | ||
|
|
9960aaa2c8 | ||
|
|
99a0e147a7 | ||
|
|
57a8f70d4a | ||
|
|
9d48623d92 | ||
|
|
92718fbc7a | ||
|
|
1b883a7490 | ||
|
|
9e1cfc5c91 | ||
|
|
f4e5ac31fd | ||
|
|
889cd2c4ee | ||
|
|
fa993668ad | ||
|
|
89ebff9f1d | ||
|
|
454c2668e4 | ||
|
|
9efc8f2d20 | ||
|
|
ccd26fd185 | ||
|
|
08232e396c | ||
|
|
01c436eec4 | ||
|
|
5ff860d1ed | ||
|
|
027be789af | ||
|
|
2f19536421 | ||
|
|
98a28c9e2a | ||
|
|
a205f6095c | ||
|
|
8617faa87d | ||
|
|
7a086b6be2 | ||
|
|
50eff29c49 | ||
|
|
f8676b45aa | ||
|
|
38dc406a7a | ||
|
|
5ae447c613 | ||
|
|
0cd8e589cd | ||
|
|
46181410db | ||
|
|
69f1a7cd81 | ||
|
|
d5470d4135 | ||
|
|
6c2994b241 | ||
|
|
f20f741178 | ||
|
|
c748d4c465 | ||
|
|
25cc8d7a58 | ||
|
|
c223c01e28 | ||
|
|
353a25c88b | ||
|
|
6682fb1f77 | ||
|
|
2da2a6b0be | ||
|
|
dff8540b44 | ||
|
|
3ced68e7e0 | ||
|
|
3a77323683 | ||
|
|
85b58cc95c | ||
|
|
f9e9448302 | ||
|
|
19f31fcbcc | ||
|
|
79891cd010 | ||
|
|
fe2a1595ea | ||
|
|
8b20cf85fe | ||
|
|
832f79717f | ||
|
|
0274bad32b | ||
|
|
7ff0256293 | ||
|
|
9548d7fa85 | ||
|
|
49dab3ddd5 | ||
|
|
b2c0217a0d | ||
|
|
9cce639e0f | ||
|
|
6bb837e2c4 | ||
|
|
815fec0d73 | ||
|
|
caaefbe34c | ||
|
|
8958bcd8cf | ||
|
|
2ffd2f09f2 | ||
|
|
b46cc4ba4e | ||
|
|
d6a5085f59 | ||
|
|
0361354890 | ||
|
|
1a87d7d7dd | ||
|
|
8c6bdeb1ec | ||
|
|
7713fd6b6f | ||
|
|
d76f273118 | ||
|
|
c65c79999a | ||
|
|
4b0b77a0c9 | ||
|
|
c9a9695069 | ||
|
|
b08e800049 | ||
|
|
321e169adc | ||
|
|
3dcda91510 | ||
|
|
ee38fcff5b | ||
|
|
16cfb5cf86 | ||
|
|
6194e95652 | ||
|
|
6db73b0c2f | ||
|
|
cb24b1f1fe | ||
|
|
e20e8e5984 | ||
|
|
12ec3a1363 | ||
|
|
01c604354d | ||
|
|
3684b77c63 | ||
|
|
1b02f0725a | ||
|
|
79356ae82f | ||
|
|
6d1d7ec1c1 | ||
|
|
06e22f12e4 | ||
|
|
4d5db2152f | ||
|
|
f89af1a7e9 | ||
|
|
4e7fb0aec6 | ||
|
|
3fc6324194 | ||
|
|
7fc8c43a91 | ||
|
|
9afca0ed2a | ||
|
|
fb53d28fc5 | ||
|
|
26ba65da07 | ||
|
|
af4c5fbd21 | ||
|
|
1c1dcf2f12 | ||
|
|
c573d2cb71 | ||
|
|
1802c20620 | ||
|
|
4937d5428b | ||
|
|
9550ddb630 | ||
|
|
beddf1b292 | ||
|
|
58cccc3007 | ||
|
|
4b03faa1f0 | ||
|
|
6dec70fa04 | ||
|
|
3c1f2845cf | ||
|
|
a4dfd75157 | ||
|
|
7b8f33117c | ||
|
|
916537dfc0 | ||
|
|
4d86812d65 | ||
|
|
b12e89b24d | ||
|
|
b640a2b8c0 | ||
|
|
885e33e28f | ||
|
|
277242d161 | ||
|
|
9107865e01 | ||
|
|
f1f818e7b2 | ||
|
|
0b66f57ffd | ||
|
|
547ec63ddd | ||
|
|
149c69bfab | ||
|
|
c7cea5143a | ||
|
|
ca135be1b8 | ||
|
|
237db9ae1f | ||
|
|
4f6f070c86 | ||
|
|
f246e3117a | ||
|
|
7fcad9f549 | ||
|
|
6641976fe2 | ||
|
|
85096b6ed2 | ||
|
|
193de92ed8 | ||
|
|
95d4a15403 | ||
|
|
24479f8d35 | ||
|
|
a668e85215 | ||
|
|
6cbdf7e1f3 | ||
|
|
76b836910f | ||
|
|
b615a240fb | ||
|
|
ffe5330693 | ||
|
|
91f5fd0864 | ||
|
|
3f8f8174e9 | ||
|
|
5d76377adf | ||
|
|
e012c791a4 | ||
|
|
a0c9344277 | ||
|
|
4b222256c0 | ||
|
|
7ee6a57d1a | ||
|
|
7440ed82c0 | ||
|
|
cb97dd5de6 | ||
|
|
dd964b43c8 | ||
|
|
77936fd6a9 | ||
|
|
0712c2788d | ||
|
|
c8c059d33e | ||
|
|
3b381afeb1 | ||
|
|
1623d393fc | ||
|
|
0023fc15ec | ||
|
|
fb32eba0f8 | ||
|
|
b1a0eb3163 | ||
|
|
b19eee5b4b | ||
|
|
b055d2520d | ||
|
|
d5a8d19eb1 | ||
|
|
dc7a687c9d | ||
|
|
647eb1d958 | ||
|
|
d2b59b1bfa | ||
|
|
401de7180c | ||
|
|
41ecacbee9 | ||
|
|
df698d7c1c | ||
|
|
3e18f440b4 | ||
|
|
605e70727b | ||
|
|
3e325f9930 | ||
|
|
cfc04998c0 | ||
|
|
2ffa9f9553 | ||
|
|
3ef07d3bdc | ||
|
|
0c07a9e0b5 | ||
|
|
e056d8845f | ||
|
|
a2cae97390 | ||
|
|
ee072a8d45 | ||
|
|
7df195b4a9 | ||
|
|
f7bd2c0d45 | ||
|
|
dda3c38f63 | ||
|
|
8593007767 | ||
|
|
c62da8b2cb | ||
|
|
8e813bd41d | ||
|
|
a59efb63f6 | ||
|
|
135dbd204b | ||
|
|
aaea1a6f10 | ||
|
|
01b182a941 | ||
|
|
d33a6174ce | ||
|
|
900fbb5b81 | ||
|
|
66ff7d6ede | ||
|
|
c26752a8aa | ||
|
|
09c884c8aa | ||
|
|
2a038800f6 | ||
|
|
04932fcd30 | ||
|
|
419fe98bf5 | ||
|
|
366dbd219b | ||
|
|
982b3ff51a | ||
|
|
cf0eb7b62e | ||
|
|
fd697cbe2a | ||
|
|
974dbf9b53 | ||
|
|
9a46a4c943 | ||
|
|
aa9093858b | ||
|
|
1e15924c47 | ||
|
|
811c8829eb | ||
|
|
19d72edc18 | ||
|
|
50650d1c8c | ||
|
|
06bff9b9a8 | ||
|
|
ae52a34706 | ||
|
|
80a9fb0776 | ||
|
|
f5878ed8e4 | ||
|
|
b746e6d1ee | ||
|
|
8634509e0c | ||
|
|
1b0340eba8 | ||
|
|
650287af74 | ||
|
|
d5819916cd | ||
|
|
e4c4c9d8ea | ||
|
|
cbaa5243df | ||
|
|
3e6b9cfd1e | ||
|
|
939ab6d0cd | ||
|
|
936d8ad703 | ||
|
|
b69286f58e | ||
|
|
18342c47bf | ||
|
|
f1674f9cf6 | ||
|
|
9999c1cab2 | ||
|
|
ca814679f8 | ||
|
|
c7a22ef7de | ||
|
|
d0bdba0970 | ||
|
|
f9d634c294 | ||
|
|
b06d843c95 | ||
|
|
b0a2e83b0f | ||
|
|
9625211c9b | ||
|
|
1d86b393e9 | ||
|
|
35b37a84cb | ||
|
|
70f16066f3 | ||
|
|
b45ff08c16 | ||
|
|
f85ee98763 | ||
|
|
31a11f15b7 | ||
|
|
81140e2096 | ||
|
|
ce83955a74 | ||
|
|
e17a2e3b4f | ||
|
|
be5365a85d | ||
|
|
ec955224ea | ||
|
|
ca27edb003 | ||
|
|
3737c2cea4 | ||
|
|
a897eb02c6 | ||
|
|
dd71b22d20 | ||
|
|
ed1703e7ca | ||
|
|
b51c2b461b | ||
|
|
db78d2ea89 | ||
|
|
98f422ca3b | ||
|
|
87c3c0147a | ||
|
|
d64a49c1df | ||
|
|
64d873eedf | ||
|
|
22930c0928 | ||
|
|
a425bde170 | ||
|
|
d381cc106d | ||
|
|
92220dd477 | ||
|
|
b9c5d267b1 | ||
|
|
3baa7920d4 | ||
|
|
ee128013bb | ||
|
|
4e2026137a | ||
|
|
1b772da460 | ||
|
|
98f969bf7a | ||
|
|
4d3133bdbb | ||
|
|
1e0b972df8 | ||
|
|
e24ccd1b45 | ||
|
|
65ea939186 | ||
|
|
402b6ec1bc | ||
|
|
d107e8051d | ||
|
|
13492021b8 | ||
|
|
9419e22aa4 | ||
|
|
9a7378369c | ||
|
|
a0b7918004 | ||
|
|
0a6cd2c879 | ||
|
|
8f2fcbc3a4 | ||
|
|
26fdda6dbd | ||
|
|
cf5063c014 | ||
|
|
84f3dca4a1 | ||
|
|
00ad4c7a11 | ||
|
|
1802215d17 | ||
|
|
0fdc9e7968 | ||
|
|
18145e4022 | ||
|
|
21d86e6a91 | ||
|
|
9448a26899 | ||
|
|
f80cb9fa1c | ||
|
|
97891adcdc | ||
|
|
2ec8c99af4 | ||
|
|
97751ac24a | ||
|
|
944561658d | ||
|
|
becdf77adc | ||
|
|
8a4d2c923f | ||
|
|
9618cf9f73 | ||
|
|
56c03db38d | ||
|
|
d2ab8961fb | ||
|
|
b6adda0c36 | ||
|
|
426d480a11 | ||
|
|
f253a6fb30 | ||
|
|
b04efd48dc | ||
|
|
64d0c89c72 | ||
|
|
77e79d58e6 | ||
|
|
42ec731119 | ||
|
|
50ba5df259 | ||
|
|
181faf3bd7 | ||
|
|
acdf911ecc | ||
|
|
b381e908c8 | ||
|
|
925034f981 | ||
|
|
c8ae23014e | ||
|
|
4b6b00ac86 | ||
|
|
3a39ddc0f6 | ||
|
|
2bc8f51851 | ||
|
|
3af53581db | ||
|
|
d015b67976 | ||
|
|
ea0acaeb35 | ||
|
|
04c3551b99 | ||
|
|
df811fb275 | ||
|
|
d7f29bdcb2 | ||
|
|
216603b4f9 | ||
|
|
2ff2fbf5d7 | ||
|
|
f180303d1c | ||
|
|
51ebcfae81 | ||
|
|
781dc0721c | ||
|
|
211b9e9e06 | ||
|
|
a02386ecfe | ||
|
|
932ac26445 | ||
|
|
5a1c144232 | ||
|
|
249dbc3f77 | ||
|
|
81f5bef64b | ||
|
|
69a43fa2f3 | ||
|
|
a789f70484 | ||
|
|
57b368b683 | ||
|
|
4fb36ff503 | ||
|
|
0c2d63e0ac | ||
|
|
28aa049ef4 | ||
|
|
fba15c8b5c | ||
|
|
347d62dac2 | ||
|
|
11f34a8a99 | ||
|
|
8b491be57d | ||
|
|
7fd861cb1e | ||
|
|
9b9a44bb59 | ||
|
|
859118e1e7 | ||
|
|
1bbcfffa12 | ||
|
|
834b70d5a4 | ||
|
|
c57d3140d2 | ||
|
|
11f0eed269 | ||
|
|
9599105569 | ||
|
|
e569f50828 | ||
|
|
e999a4d03d | ||
|
|
3fa6083a4b | ||
|
|
4b5eccd041 | ||
|
|
47ea1b3168 | ||
|
|
7ba49b2604 | ||
|
|
7bd437338f | ||
|
|
bdbcec5a14 | ||
|
|
249a6de092 | ||
|
|
c977b554c1 | ||
|
|
408d68e175 | ||
|
|
c2c56781d3 | ||
|
|
8014626c2a | ||
|
|
def03bf7d8 | ||
|
|
27d304bd81 | ||
|
|
e66c5bc47e | ||
|
|
d218178e48 | ||
|
|
44b879f5f9 | ||
|
|
39294e692f | ||
|
|
6ff27d1704 | ||
|
|
4e782b81d6 | ||
|
|
5519426ab4 | ||
|
|
07059872ed | ||
|
|
ee35562351 | ||
|
|
8ac1169f7d | ||
|
|
c14e26a9fe | ||
|
|
da632d4a64 | ||
|
|
521fe96ab9 | ||
|
|
1c93f033dd | ||
|
|
66bb35d84e | ||
|
|
6e4af8f9ef | ||
|
|
98b2973669 | ||
|
|
16f36b3214 | ||
|
|
c59da5af63 | ||
|
|
b589837c36 | ||
|
|
59abb71e8d | ||
|
|
ade8d4eb9b | ||
|
|
fa6a076134 | ||
|
|
f4497fe28c | ||
|
|
5fd97d3fa6 | ||
|
|
8438f797d6 | ||
|
|
fdb78f4840 | ||
|
|
b4d51fcaf1 | ||
|
|
99b03d485a | ||
|
|
53e4f83029 | ||
|
|
262cc9fee9 | ||
|
|
2235f77acb | ||
|
|
7caf3a0d8d | ||
|
|
56363996dc | ||
|
|
53474f0052 | ||
|
|
3a74534d1e | ||
|
|
fcde2067d7 | ||
|
|
6fe92d260e | ||
|
|
ae831eebbd | ||
|
|
9eaca4775c | ||
|
|
db82d4760a | ||
|
|
8cc4137107 | ||
|
|
70678e51c5 | ||
|
|
4beb425ccc | ||
|
|
a0a9b67f0b | ||
|
|
a71f1d8139 | ||
|
|
5a6a640ccf | ||
|
|
e21ae440a2 | ||
|
|
d2451ab377 | ||
|
|
04b9e26796 | ||
|
|
30174b3861 | ||
|
|
842c76a7d8 | ||
|
|
71d7ab5672 | ||
|
|
c6098dc024 | ||
|
|
52b18e6064 | ||
|
|
d954257870 | ||
|
|
76ddf94cce | ||
|
|
03f9f9fb23 | ||
|
|
291017d32e | ||
|
|
2432b6feec | ||
|
|
57dd64effc | ||
|
|
6b057a5a6f | ||
|
|
7b7a4a7272 | ||
|
|
339d983050 | ||
|
|
dc85c6215a | ||
|
|
23010dac73 | ||
|
|
cd9ff1227d | ||
|
|
24382e5d23 | ||
|
|
5d0515728a | ||
|
|
305bc175bb | ||
|
|
f96eb40bf7 | ||
|
|
0bf18bbb3f | ||
|
|
83553be199 | ||
|
|
309940c73a | ||
|
|
60234ccd69 | ||
|
|
cdc04e7950 | ||
|
|
8387c638d1 | ||
|
|
c2d6d384ac | ||
|
|
fa0681c866 | ||
|
|
c7ebcef4d4 | ||
|
|
ef9d8902e3 | ||
|
|
18a51edf87 | ||
|
|
3a76a700a6 | ||
|
|
ea8ad29eb1 | ||
|
|
38a75aef05 | ||
|
|
988e7f0910 | ||
|
|
22ed156185 | ||
|
|
1e954a0eb9 | ||
|
|
2737ca110b | ||
|
|
af38e451ca | ||
|
|
ed972f200e | ||
|
|
472f8e89e0 | ||
|
|
34f869e5a6 | ||
|
|
7e9317d62f | ||
|
|
41e60bda96 | ||
|
|
5496f01530 | ||
|
|
180ab14492 | ||
|
|
f65c64acc8 | ||
|
|
c5aae001d3 | ||
|
|
40540c9906 | ||
|
|
9db8626bec | ||
|
|
0b5c1fde5d | ||
|
|
49cf8002b0 | ||
|
|
2ba26ff77e | ||
|
|
4ae550620f | ||
|
|
eea05f7032 | ||
|
|
427aeef7f4 | ||
|
|
b8528da324 | ||
|
|
6f46994948 | ||
|
|
239252e24c | ||
|
|
f3a612144b | ||
|
|
446bf56c98 | ||
|
|
7dbeeb5ef9 | ||
|
|
b59f150b13 | ||
|
|
e3a59ff1a2 | ||
|
|
79ad23cedf | ||
|
|
373d464054 | ||
|
|
9170fd690c | ||
|
|
18d9ecdf4d | ||
|
|
a4f6a739c5 | ||
|
|
726f3f8782 | ||
|
|
5d1ef109ba | ||
|
|
42ac3bd5b6 | ||
|
|
e580c2846e | ||
|
|
dffd10acd1 | ||
|
|
eb70f6669f | ||
|
|
36e4ee9653 | ||
|
|
243f50cdbe | ||
|
|
cd5bf676bb | ||
|
|
ef7d2685b5 | ||
|
|
fbd30c39f0 | ||
|
|
6f35ba2164 | ||
|
|
a43ebb6483 | ||
|
|
7d6bfdff63 | ||
|
|
733b961ac8 | ||
|
|
66724a85ba | ||
|
|
7ddaabe3a7 | ||
|
|
2312878c11 | ||
|
|
ef7ce67487 | ||
|
|
9832004ca6 | ||
|
|
e80f9ad023 | ||
|
|
814597b3de | ||
|
|
be22922918 | ||
|
|
4ba8e33bb7 | ||
|
|
9bef1f22ae | ||
|
|
1b6dcf5018 | ||
|
|
1f0f18e8c2 | ||
|
|
890af5afbd | ||
|
|
9d27388bf5 | ||
|
|
10133bbe45 | ||
|
|
f1fc4db8d7 | ||
|
|
956232ee80 | ||
|
|
94fed2f8e2 | ||
|
|
900fabe064 | ||
|
|
3dad9bdc84 | ||
|
|
3110f31278 | ||
|
|
b4b9fafa12 | ||
|
|
f2aea9aa2d | ||
|
|
b34a14698c | ||
|
|
05ab551aaa | ||
|
|
0986087710 | ||
|
|
a8162e1fc7 | ||
|
|
84902e3275 | ||
|
|
a06fe2c0dd | ||
|
|
61a3b41d8e | ||
|
|
082458bdf4 | ||
|
|
d33e9bb674 | ||
|
|
ea9a76f945 | ||
|
|
7e335082e8 | ||
|
|
49a193f463 | ||
|
|
1d91508c07 | ||
|
|
6aec39bd43 | ||
|
|
8d014ff76f | ||
|
|
24361e37cd | ||
|
|
296b63f0bb | ||
|
|
c07154c16f | ||
|
|
af3e54fb9b | ||
|
|
492510dc1d | ||
|
|
8b6acf11bf | ||
|
|
2b18562cef | ||
|
|
8767c19e77 | ||
|
|
c84a6e8537 | ||
|
|
ef89ea408e | ||
|
|
69eb9f161b | ||
|
|
9c1144dc6e | ||
|
|
950647ee49 | ||
|
|
fc6b608300 | ||
|
|
d031c90460 | ||
|
|
395cdccbc3 | ||
|
|
d3d84733cc | ||
|
|
803e0c410c | ||
|
|
5fe263329f | ||
|
|
739ca68f58 | ||
|
|
64766df633 | ||
|
|
1d259e42d0 | ||
|
|
9f35477262 | ||
|
|
4a15ef3410 | ||
|
|
89ffbef934 | ||
|
|
f92f31446c | ||
|
|
9f84532f3d | ||
|
|
cfa3919dd6 | ||
|
|
95ce9ec627 | ||
|
|
468ba6a0cf | ||
|
|
35b1cacfc2 | ||
|
|
25fb517e11 | ||
|
|
daf3b10e15 | ||
|
|
292c4c2b71 | ||
|
|
994e74cae7 | ||
|
|
ad0b74d152 | ||
|
|
05ab3bc006 | ||
|
|
e86bfb00bf | ||
|
|
dd74f3be20 | ||
|
|
6508012101 | ||
|
|
e1011d65aa | ||
|
|
7b005bc2cf | ||
|
|
a571f02ae9 | ||
|
|
323df73f79 | ||
|
|
9b3f9f9d23 | ||
|
|
33ef11a21c | ||
|
|
fc8d25213f | ||
|
|
ca6d8ba520 | ||
|
|
368b06d0cc | ||
|
|
b8e55de858 | ||
|
|
6ba9a4981b | ||
|
|
2aeb98c903 | ||
|
|
3d715677e9 | ||
|
|
133311baf8 | ||
|
|
bf6927a2a4 | ||
|
|
abd33d952d | ||
|
|
8eb9c566cd | ||
|
|
f84e544410 | ||
|
|
83e78717d9 | ||
|
|
7d19d006e0 | ||
|
|
5f305456c1 | ||
|
|
9174999138 | ||
|
|
64256b2b61 | ||
|
|
b4aa285938 | ||
|
|
13cf4874d5 | ||
|
|
67dce0cfb1 | ||
|
|
2649b2980f | ||
|
|
6ba2c43dce | ||
|
|
2e0179c943 | ||
|
|
1aefdcf63f | ||
|
|
a3df910d26 | ||
|
|
174d1b2ffd | ||
|
|
f69fdb1aec | ||
|
|
4859c3f41a | ||
|
|
345b57f041 | ||
|
|
c724a8ef4b | ||
|
|
fa6900cdad | ||
|
|
2e89af4b08 | ||
|
|
f43350eb49 | ||
|
|
9f11bbe8cc | ||
|
|
4174f88609 | ||
|
|
c543c71121 | ||
|
|
53318941d5 | ||
|
|
bea7127b57 | ||
|
|
b84c7b45fa | ||
|
|
ba14699cdd | ||
|
|
77a57f11b6 | ||
|
|
1d1db39246 | ||
|
|
f5e4efb177 | ||
|
|
a27c99e830 | ||
|
|
773f5dbf54 | ||
|
|
a7cd6099cd | ||
|
|
f0c4854988 | ||
|
|
42981e777b | ||
|
|
133ae04eae | ||
|
|
3e044b9cd2 | ||
|
|
6ae4bf74e6 | ||
|
|
7f37e1cc1b | ||
|
|
da0e16aeae | ||
|
|
4e86fbc278 | ||
|
|
30f6f5db1a | ||
|
|
ca6d66dfbe | ||
|
|
1d7cc71d41 | ||
|
|
82ce19e7f7 | ||
|
|
baa996e88c | ||
|
|
144c1ce875 | ||
|
|
fcbd98b397 | ||
|
|
62ec62189f | ||
|
|
b85bbf44ef | ||
|
|
dc32ee6b17 | ||
|
|
cf5bd0e193 | ||
|
|
bec0cde3ee | ||
|
|
b42e6a8457 | ||
|
|
2bacaceb15 | ||
|
|
a6a37b1d25 | ||
|
|
951d8949f7 | ||
|
|
6c31961b64 | ||
|
|
5076ef03f5 | ||
|
|
01cdf927e8 | ||
|
|
c415de0dcb | ||
|
|
1a3881cf7d | ||
|
|
4981161e36 | ||
|
|
465d554d62 | ||
|
|
cb3aa7d868 | ||
|
|
34cb44acbc | ||
|
|
91f739386d | ||
|
|
b5d0671483 | ||
|
|
c4c3da74b7 | ||
|
|
aa2dacad70 | ||
|
|
b82abe0bdc | ||
|
|
ddb6f2dc54 | ||
|
|
271bdffbb9 | ||
|
|
abd0d10a02 | ||
|
|
5d60d05625 | ||
|
|
4b53bc9711 | ||
|
|
4aab5ce7f9 | ||
|
|
bdfeda7589 | ||
|
|
2c9d2f2f26 | ||
|
|
951f351f66 | ||
|
|
7be892c832 | ||
|
|
72e9f65dec | ||
|
|
44aab19939 | ||
|
|
eb40ba55b1 | ||
|
|
0a820d90f0 | ||
|
|
05ddd629aa | ||
|
|
97b9d670fb | ||
|
|
6fa63c6ee6 | ||
|
|
2ae301f308 | ||
|
|
bfe575e019 | ||
|
|
eeb09800bb | ||
|
|
2f2f97c6a2 | ||
|
|
d9f7d78652 | ||
|
|
d91301c106 | ||
|
|
dac2b29609 | ||
|
|
3e91c0d918 | ||
|
|
8ef7c25bf9 | ||
|
|
df2016e126 | ||
|
|
3381a561f5 | ||
|
|
d4ac017acd | ||
|
|
f777c9980b | ||
|
|
fbb47872c1 | ||
|
|
40a9063f33 | ||
|
|
6d18ce16f8 | ||
|
|
e6691ac53f | ||
|
|
d6917d7a28 | ||
|
|
449732ccac | ||
|
|
bf03978d35 | ||
|
|
dacac830ff | ||
|
|
b02a88cfcd | ||
|
|
fec89f754b | ||
|
|
fe96f1475e | ||
|
|
e852893424 | ||
|
|
d46dbf1fea | ||
|
|
b45b87c481 | ||
|
|
061191ff9e | ||
|
|
bf214b42ce | ||
|
|
40a68b95fc | ||
|
|
b9ba3e6a61 | ||
|
|
3b80fdaa48 | ||
|
|
b44e44cb62 | ||
|
|
6d6fb26dd3 | ||
|
|
0aa401a0e6 | ||
|
|
dd210ba364 | ||
|
|
72385b26ac | ||
|
|
406bb8f692 | ||
|
|
9cc237bfee | ||
|
|
8b3ad3c365 | ||
|
|
9f44caa1f6 | ||
|
|
090afdeb87 | ||
|
|
0290bab375 | ||
|
|
00c1f554bc | ||
|
|
020bec1e30 | ||
|
|
87e829537e | ||
|
|
fe96feb62a | ||
|
|
233bdcb5ad | ||
|
|
3a0c7221e0 | ||
|
|
c49c5990c0 | ||
|
|
2a2c6ceac1 | ||
|
|
004e28586a | ||
|
|
2fe75675e5 | ||
|
|
68757819d4 | ||
|
|
252ad58710 | ||
|
|
f6bf2a81b4 | ||
|
|
dc15ecd43c | ||
|
|
6ef898005f | ||
|
|
71a84022b9 | ||
|
|
63cfa56abe | ||
|
|
39fe474e3b | ||
|
|
9d1b6ffc74 | ||
|
|
a9911ab9bf | ||
|
|
72e99c7c16 | ||
|
|
879bf81b4e | ||
|
|
d530ae462b | ||
|
|
b6116d5d47 | ||
|
|
eef8571946 | ||
|
|
78f31b3921 | ||
|
|
8c22f7a0dc | ||
|
|
cb72ae28f2 | ||
|
|
64903cc309 | ||
|
|
fa263f5e52 | ||
|
|
4fb93e8735 | ||
|
|
7b287efdfc | ||
|
|
668a8e2aad | ||
|
|
bb135eae27 | ||
|
|
b815400fc6 | ||
|
|
76f95a8712 | ||
|
|
516f7fd8d2 | ||
|
|
7e3a4dd843 | ||
|
|
2ffac12ecc | ||
|
|
686d146dff | ||
|
|
2870f82941 | ||
|
|
8432c564f8 | ||
|
|
2e9ab16293 | ||
|
|
82bcd53640 | ||
|
|
4ae5d93417 | ||
|
|
eb2fed3e15 | ||
|
|
bd2f738058 | ||
|
|
13acab0d03 | ||
|
|
b6c9941c80 | ||
|
|
1383058e53 | ||
|
|
0c870ba5af | ||
|
|
a517c981d1 | ||
|
|
2461c1d3c3 | ||
|
|
52f5c6a55c | ||
|
|
714a8f406b | ||
|
|
894a7ba3bd | ||
|
|
a7283ed820 | ||
|
|
cc32d390c7 | ||
|
|
961ef36d39 | ||
|
|
98eefe872a | ||
|
|
c3e5920240 | ||
|
|
ce3006450c | ||
|
|
21ae15f95f | ||
|
|
6550e9da04 | ||
|
|
5f81a8c8dd | ||
|
|
1e53362e49 | ||
|
|
e64187e51f | ||
|
|
2ab9aad2f4 | ||
|
|
9d2f7df13e | ||
|
|
25db1aed1f | ||
|
|
bf42a83e5d | ||
|
|
3b7baf5487 | ||
|
|
38330b38e1 | ||
|
|
839f5f7862 | ||
|
|
f583b70913 | ||
|
|
37be85660a | ||
|
|
3122ee1ba4 | ||
|
|
1de29ceae9 | ||
|
|
1334d0d0b6 | ||
|
|
50af4f507e | ||
|
|
5a8321381d | ||
|
|
b448a5f840 | ||
|
|
d1f8c96d05 | ||
|
|
f5bacba5d7 | ||
|
|
bb880b4b55 | ||
|
|
7902fb13e2 | ||
|
|
0f5dd89cc5 | ||
|
|
692077b956 | ||
|
|
85d13bd02e | ||
|
|
e0818cc28e | ||
|
|
76a4ad4447 | ||
|
|
ca0330b3fe | ||
|
|
88177ce149 | ||
|
|
86547bd566 | ||
|
|
3bc4bf2b13 | ||
|
|
8d18051670 | ||
|
|
3e82cea749 | ||
|
|
8b344cdfea | ||
|
|
976a2fafb8 | ||
|
|
dbb8132f71 | ||
|
|
7a5f2025aa | ||
|
|
0444d79703 | ||
|
|
c966f58d0d | ||
|
|
d600d7cae9 | ||
|
|
d3e9bd91a1 | ||
|
|
3a56986bde | ||
|
|
90dae20de7 | ||
|
|
3ba6e59952 | ||
|
|
89b776545b | ||
|
|
406f101f88 | ||
|
|
e313740053 | ||
|
|
23f7b9f073 | ||
|
|
543b008d43 | ||
|
|
126778f89f | ||
|
|
2e4daba1da | ||
|
|
8f0d397a2d | ||
|
|
92f7c1bbaa | ||
|
|
3ef498ecfb | ||
|
|
ede3b2feb0 | ||
|
|
21951bcff7 | ||
|
|
6239093dc6 | ||
|
|
aad69207fd | ||
|
|
ab193e013b | ||
|
|
00c1047430 | ||
|
|
e23285c5da | ||
|
|
99f8cc5c71 | ||
|
|
35841c5590 | ||
|
|
f2c3098f2c | ||
|
|
2370b023c9 | ||
|
|
44300b03b8 | ||
|
|
62ed743f3e | ||
|
|
8f2990b857 | ||
|
|
eabd0bfa79 | ||
|
|
50abd3de2a | ||
|
|
ee8f616d02 | ||
|
|
38f75cbfce | ||
|
|
cec8a9a572 | ||
|
|
82c431066f | ||
|
|
98cfa2b5da | ||
|
|
2f6556e311 | ||
|
|
d5d68ac980 | ||
|
|
7b84baad9b | ||
|
|
70609b39ee | ||
|
|
c9f16df0cd | ||
|
|
8cd44bae4a | ||
|
|
a4d377fd96 | ||
|
|
7a384da5bf | ||
|
|
7761ce2d75 | ||
|
|
ca757713fa | ||
|
|
0ee8c3c05f | ||
|
|
bf04f97fec | ||
|
|
6ecb547128 | ||
|
|
4764e3bd54 | ||
|
|
ff454b59ec | ||
|
|
5a9f7dd463 | ||
|
|
20a3af2667 | ||
|
|
fb766d5316 | ||
|
|
aca4488af6 | ||
|
|
14cf8d9163 | ||
|
|
29fafe3a49 | ||
|
|
33451dc445 | ||
|
|
dd6cebf197 | ||
|
|
83b6123fe6 | ||
|
|
c6a1e8d864 | ||
|
|
0303ea33b9 | ||
|
|
8df9a54c9b | ||
|
|
fd10199de6 | ||
|
|
2db1bb7d5d | ||
|
|
8856b10b58 | ||
|
|
c4f9290ed2 | ||
|
|
817b2a47d9 | ||
|
|
d0406126ba | ||
|
|
7d54925600 | ||
|
|
1658de670e | ||
|
|
cee15cff25 | ||
|
|
45bd69beef | ||
|
|
568e392af7 | ||
|
|
5e0ff19bc7 | ||
|
|
20cff3e357 | ||
|
|
4128e5d1a8 | ||
|
|
3d609968e8 | ||
|
|
18ddca2674 | ||
|
|
db1f2bd88d | ||
|
|
e11912d34b | ||
|
|
9438e2b421 | ||
|
|
7073ad3df7 | ||
|
|
4bcd16ae84 | ||
|
|
44f08a72d5 | ||
|
|
6e5e8910da | ||
|
|
97740bb7bb | ||
|
|
886616001a | ||
|
|
8a77d70353 | ||
|
|
9952f7bf55 | ||
|
|
34a5cfcdd8 | ||
|
|
8f2fccaa79 | ||
|
|
69bca89f3e | ||
|
|
2252d04796 | ||
|
|
e21485acfe | ||
|
|
3a8fb707b7 | ||
|
|
d804a8f7f9 | ||
|
|
25094ac7f0 | ||
|
|
509a2f333f | ||
|
|
5031243e51 | ||
|
|
006f55116c | ||
|
|
b932a218b9 | ||
|
|
d08f3acd1b | ||
|
|
658c86f7a4 | ||
|
|
73cbb5ae24 | ||
|
|
62b2548020 | ||
|
|
f4c3d83059 | ||
|
|
a961931540 | ||
|
|
3ceba2a26e | ||
|
|
2ceefe58b9 | ||
|
|
77868dc446 | ||
|
|
aa60cc320b | ||
|
|
8cad597409 | ||
|
|
148b605fbb | ||
|
|
48e0a7b1ab | ||
|
|
321a2a9f44 | ||
|
|
7e2cd3bad4 | ||
|
|
d9c3a6a581 | ||
|
|
1e570382d7 | ||
|
|
b0e0b9e79d | ||
|
|
706dcd2d19 | ||
|
|
13e555c340 | ||
|
|
629296566d | ||
|
|
8f044d3596 | ||
|
|
1a6a7a52aa | ||
|
|
46e3e5e60a | ||
|
|
5868424a36 | ||
|
|
5d0d9931c7 | ||
|
|
a7951cb1e3 | ||
|
|
2e6673e09c | ||
|
|
31299a6bfd | ||
|
|
5259c020ba | ||
|
|
3386ab9d93 | ||
|
|
135544df29 | ||
|
|
259184bc0e | ||
|
|
e02d0064a8 | ||
|
|
f516f061bf | ||
|
|
0f4d19b4b7 | ||
|
|
e74bb46494 | ||
|
|
b700b8dbb9 | ||
|
|
d3239a027a | ||
|
|
1174d93a4d | ||
|
|
c01fb9bfc1 | ||
|
|
58d3c27e3c | ||
|
|
2cf43972e0 | ||
|
|
3cfade4c64 | ||
|
|
6d5093b405 | ||
|
|
2cfa0d9b30 | ||
|
|
217629589e | ||
|
|
b276e5bb3a | ||
|
|
7b69d0f19b | ||
|
|
56e346a7d5 | ||
|
|
bf1e7cbfda | ||
|
|
fbe22a1bf9 | ||
|
|
d07fc84c6f | ||
|
|
301348a97e | ||
|
|
e5e6535f63 | ||
|
|
633da8094f | ||
|
|
88a347ab56 | ||
|
|
d87afbf15b | ||
|
|
30c7cb2930 | ||
|
|
b732addd9c | ||
|
|
642a555baf | ||
|
|
9e1b689b9f | ||
|
|
60c3665391 | ||
|
|
3bd409654c | ||
|
|
0ef9e9e297 | ||
|
|
b68f174e2d | ||
|
|
c602963710 | ||
|
|
a28d35c3d8 | ||
|
|
2f236a6ccc | ||
|
|
05710ba81b | ||
|
|
4671b6225b | ||
|
|
2d1ae38e3d | ||
|
|
8d45726e09 | ||
|
|
41850df73f | ||
|
|
77f64014a3 | ||
|
|
b02405c8c0 | ||
|
|
e67550003e | ||
|
|
dd89cd1401 | ||
|
|
64dba30423 | ||
|
|
3ed30608b4 | ||
|
|
9a51691424 | ||
|
|
d1a8b01386 | ||
|
|
9713cc8a09 | ||
|
|
c2d5d9cb79 | ||
|
|
edced705c2 | ||
|
|
d86add4d82 | ||
|
|
b30e13c978 | ||
|
|
4c6a934d77 | ||
|
|
e65729cc50 | ||
|
|
953e1a3dbc | ||
|
|
94c5f449dd | ||
|
|
e2ce091433 | ||
|
|
11541f543f | ||
|
|
01fc8b39f2 | ||
|
|
ce2f1c7917 | ||
|
|
0830d10110 | ||
|
|
1dcbc8af25 | ||
|
|
2424f94ec5 | ||
|
|
e61703b9b8 | ||
|
|
1e04b4539c | ||
|
|
6d49cd9f6d | ||
|
|
9cb38d2bda | ||
|
|
691d1ed037 | ||
|
|
b23674c817 | ||
|
|
1128cee41a | ||
|
|
d9d77970dc | ||
|
|
418e67a4a4 | ||
|
|
3682a5c58a | ||
|
|
f1d4e0ab8a | ||
|
|
c75d529454 | ||
|
|
4ac8d4dbbd | ||
|
|
3155d91aa3 | ||
|
|
d5dfa107f3 | ||
|
|
e116442fb0 | ||
|
|
8aa668599e | ||
|
|
2bc4d3b1d0 | ||
|
|
99ae4cff00 | ||
|
|
edbcac6ce6 | ||
|
|
f3974cee75 | ||
|
|
225f6f51be | ||
|
|
7efebe117e | ||
|
|
155a723fc9 | ||
|
|
4a0954c052 | ||
|
|
3ba704ef6d | ||
|
|
1606aa27bf | ||
|
|
456f4bc464 | ||
|
|
af97890612 | ||
|
|
c4a45795d5 | ||
|
|
b21219c408 | ||
|
|
a33b370cfb | ||
|
|
579c399f12 | ||
|
|
1010f84a9c | ||
|
|
03a60460f8 | ||
|
|
cb9c9fb271 | ||
|
|
f30eb3c31d | ||
|
|
e67ca2314a | ||
|
|
f8cb83a03e | ||
|
|
19c55aa5c3 | ||
|
|
1e43a7153b | ||
|
|
f311f2476e | ||
|
|
cd2edf3e7c | ||
|
|
ea2adbea24 | ||
|
|
bb9e8f162b | ||
|
|
d04bba5e7b | ||
|
|
81ef9c4292 | ||
|
|
8f1b6c4b34 | ||
|
|
3dea579ecf | ||
|
|
72a54d60f4 | ||
|
|
1aafb50b75 | ||
|
|
3c5ba1d382 | ||
|
|
e0f64c68e8 | ||
|
|
ac07320328 | ||
|
|
f95d3a13e2 | ||
|
|
2727b67152 | ||
|
|
023152a6fa | ||
|
|
a926066dba | ||
|
|
40df649a4e | ||
|
|
e2f35e4d1b | ||
|
|
96e6d94e56 | ||
|
|
4946dc1658 | ||
|
|
708b23bb32 | ||
|
|
4c1c0791f1 | ||
|
|
b79029fdb8 | ||
|
|
b70ff8ac48 | ||
|
|
a3204bdd9b | ||
|
|
801eeca0a3 | ||
|
|
549eaa4d7f | ||
|
|
7eb41b0061 | ||
|
|
a945a4c56e | ||
|
|
b39970f6d5 | ||
|
|
0360db506c | ||
|
|
989547753d | ||
|
|
5355ea66f7 | ||
|
|
4aba402296 | ||
|
|
652e32c887 | ||
|
|
128da5b0f8 | ||
|
|
2dfc331847 | ||
|
|
2c02dfaabf | ||
|
|
53a4f6ba7d | ||
|
|
048be49b69 | ||
|
|
21276a494f | ||
|
|
06c5902e82 | ||
|
|
064afea0b7 | ||
|
|
5429720a08 | ||
|
|
aec40f3832 | ||
|
|
bd9bdef601 | ||
|
|
2d41ee208d | ||
|
|
6e40fc8cb5 | ||
|
|
62018679d8 | ||
|
|
e8cb1bcbfa | ||
|
|
66a6d1fe9b | ||
|
|
b7650b7bc0 | ||
|
|
639fb0996b | ||
|
|
8f5b9c1901 | ||
|
|
13cedd6699 | ||
|
|
2a580719d4 | ||
|
|
749a5217b7 | ||
|
|
ce9720c590 | ||
|
|
3702364a44 | ||
|
|
f1bacd2e07 | ||
|
|
25196ce4f2 | ||
|
|
9b13d22d70 | ||
|
|
9d5248a35c | ||
|
|
5d9d7b1a75 | ||
|
|
c4d19ab423 | ||
|
|
b4a0472893 | ||
|
|
6717d57280 | ||
|
|
ebf361fe42 | ||
|
|
48bcd628fe | ||
|
|
bec9fa4dee | ||
|
|
2e6a02ca58 | ||
|
|
f6ea73216d | ||
|
|
3f6a97da54 | ||
|
|
0a090ef99c | ||
|
|
8d7747b12f | ||
|
|
871ba5cc04 | ||
|
|
22bd814852 | ||
|
|
23f177d2c6 | ||
|
|
57d4e8b0c9 | ||
|
|
dd2975fe39 | ||
|
|
a8a8007a50 | ||
|
|
5e0f4f6e7d | ||
|
|
8ce2376142 | ||
|
|
dd4c94c66e | ||
|
|
85eccd7f77 | ||
|
|
0fe5e0486e | ||
|
|
2f66be3784 | ||
|
|
8f3f641ccb | ||
|
|
ca8e5f4cdd | ||
|
|
3920604b69 | ||
|
|
3f2b918ccc | ||
|
|
4322f254c1 | ||
|
|
3329dafec7 | ||
|
|
00c92ab262 | ||
|
|
6c2d59ff3e | ||
|
|
4871e4700f | ||
|
|
41c102bca1 | ||
|
|
069accd798 | ||
|
|
c86c1c1ca7 | ||
|
|
0cd1281d38 | ||
|
|
d964c42276 | ||
|
|
70c4e1b464 | ||
|
|
73ed3a22a1 | ||
|
|
3c160c6d18 | ||
|
|
bbddba9557 | ||
|
|
9aea9834cb | ||
|
|
182b211c16 | ||
|
|
4335e45643 | ||
|
|
17a01c504e | ||
|
|
5826d3fb46 | ||
|
|
da1cc58b72 | ||
|
|
7a09e861da | ||
|
|
71d3b9f726 | ||
|
|
4cb696a903 | ||
|
|
d9166e1649 | ||
|
|
8ef5c8c436 | ||
|
|
b14b6cf164 | ||
|
|
dcdbe4cbec | ||
|
|
e33cc2e2db | ||
|
|
2263bd1e29 | ||
|
|
870c082b0a | ||
|
|
d9bb8b494e | ||
|
|
6a47bca0aa | ||
|
|
f5e5ee4980 | ||
|
|
f2ea90ba00 | ||
|
|
93b60e3ef6 | ||
|
|
c1270ca38b | ||
|
|
e1b0c0ce54 | ||
|
|
f2a42cc021 | ||
|
|
ccac147d8b | ||
|
|
fa6326f96b | ||
|
|
c45a0f4395 | ||
|
|
edef2644e5 | ||
|
|
6b621fbc7f | ||
|
|
e336506959 | ||
|
|
65f954e71e | ||
|
|
ab55f7150c | ||
|
|
4960f36497 | ||
|
|
d3e70b8d69 | ||
|
|
f68075a555 | ||
|
|
06d474a186 | ||
|
|
fe81c0710b | ||
|
|
d70fa8a71d | ||
|
|
2534046117 | ||
|
|
ad8275889f | ||
|
|
cfae70862f | ||
|
|
cdf6f26113 | ||
|
|
c9edc53ca0 | ||
|
|
fa0a416208 | ||
|
|
cd408aa4cf | ||
|
|
14c155e457 | ||
|
|
e2e5fa8fb9 | ||
|
|
9c8d20e4ac | ||
|
|
718181609f | ||
|
|
039b980f72 | ||
|
|
1cc8a06ad0 | ||
|
|
b7d8a404ea | ||
|
|
dc8dabe88e | ||
|
|
fcb10dcf9b | ||
|
|
c2d6eda11b | ||
|
|
aacb407d9b | ||
|
|
22f14ea4e2 | ||
|
|
75d16ce80a | ||
|
|
826d1b136d | ||
|
|
07a4b636fb | ||
|
|
7d1aefc5e1 | ||
|
|
902ec60ee1 | ||
|
|
7908dffae7 | ||
|
|
9f4dfbc49b | ||
|
|
dc84cfe6ba | ||
|
|
5d43857d3d | ||
|
|
5230673778 | ||
|
|
bbe9ff8df9 | ||
|
|
299037dd3a | ||
|
|
30bf014603 | ||
|
|
0b102f784e | ||
|
|
1b89be8db8 | ||
|
|
3877c94e12 | ||
|
|
4a59b0b852 | ||
|
|
6cb074b798 | ||
|
|
ec12610954 | ||
|
|
fe46e5b54f | ||
|
|
fc4915922f | ||
|
|
f1c348081a | ||
|
|
22322765b4 | ||
|
|
a3439dbf47 | ||
|
|
dee020a45b | ||
|
|
ba1dd649af | ||
|
|
bfde531d65 | ||
|
|
e3fb7eb1aa | ||
|
|
39f9762907 | ||
|
|
f70ca77f96 | ||
|
|
daefb175d4 | ||
|
|
f149440910 | ||
|
|
0f8bb10baa | ||
|
|
57173e943c | ||
|
|
cf211c6530 | ||
|
|
6ffbd3ae72 | ||
|
|
ee08981436 | ||
|
|
568c9da34d | ||
|
|
ec10bbffde | ||
|
|
c65113fc4a | ||
|
|
58b52f6a99 | ||
|
|
8ab33955da | ||
|
|
1b4095133b | ||
|
|
94bce04a89 | ||
|
|
6af6ca022b | ||
|
|
c360e48ecf | ||
|
|
cda381cbdc | ||
|
|
2d570b4ffc | ||
|
|
697a5dceba | ||
|
|
df9dc847f5 | ||
|
|
f32e0cbabf | ||
|
|
8be182c8d8 | ||
|
|
5d9b93e9f8 | ||
|
|
7825607ddf | ||
|
|
0325b85810 | ||
|
|
aebef542bf | ||
|
|
422b53a5da | ||
|
|
111eb2015c | ||
|
|
c0d8e5b3ef | ||
|
|
98d9fcade3 | ||
|
|
97da2ade09 | ||
|
|
38abe0e2d4 | ||
|
|
d040388bff | ||
|
|
04e9301e4d | ||
|
|
713bd78058 | ||
|
|
efa4d4f460 | ||
|
|
4f178959a5 | ||
|
|
85c77005a0 | ||
|
|
4490a6149a | ||
|
|
a8097b0db4 | ||
|
|
64c1df8ee4 | ||
|
|
801958a339 | ||
|
|
b48e2caf7c | ||
|
|
4891b6afd8 | ||
|
|
562508f0d5 | ||
|
|
b6493e8cbf | ||
|
|
2a8db68537 | ||
|
|
0a1d12585c | ||
|
|
8431595ebe | ||
|
|
28f5092aca | ||
|
|
af293b2d97 | ||
|
|
0b26371b83 | ||
|
|
2f72e68727 | ||
|
|
3664b28e00 | ||
|
|
e681cad92e | ||
|
|
68e0a17491 | ||
|
|
f56f2d4e52 | ||
|
|
1e63a95689 | ||
|
|
a3af3d319a | ||
|
|
fb2904dbb0 | ||
|
|
b223edc9b8 | ||
|
|
c8fb4d3ae8 | ||
|
|
72b5c556c0 | ||
|
|
e41832992f | ||
|
|
28e0286a67 | ||
|
|
2f763cedea | ||
|
|
3729c4258b | ||
|
|
eb71ff785b | ||
|
|
4744e211dd | ||
|
|
d0b03dc69c | ||
|
|
f1d1b986ee | ||
|
|
5707f6d56d | ||
|
|
321b0f22b1 | ||
|
|
be726c08ac | ||
|
|
51711ffde5 | ||
|
|
48e612895f | ||
|
|
4bdd8e7d22 | ||
|
|
b7788d4156 | ||
|
|
1629d20dfd | ||
|
|
bb380e6470 | ||
|
|
9507265d17 | ||
|
|
2bb4427ae0 | ||
|
|
6a7a0d086a | ||
|
|
c405cd59c1 | ||
|
|
e4af99d487 | ||
|
|
3f8992a334 | ||
|
|
31b1c02876 | ||
|
|
fb8116a5d3 | ||
|
|
46278f0bfa | ||
|
|
9c0fa91c65 | ||
|
|
f46b63bfa0 | ||
|
|
824374961b | ||
|
|
04a228881d | ||
|
|
48d3b28c3a | ||
|
|
1559395b74 | ||
|
|
6b9ae6865a | ||
|
|
2e04bf6189 | ||
|
|
add2c72fa0 | ||
|
|
5ca7f5e8c6 | ||
|
|
6f3675f1ff | ||
|
|
2749296524 | ||
|
|
780a797180 | ||
|
|
1c7f6dde92 | ||
|
|
9b88cc5f1d | ||
|
|
d152766772 | ||
|
|
d0a1720f4d | ||
|
|
f136a67812 | ||
|
|
26a8236401 | ||
|
|
de5055d62a | ||
|
|
262843afe6 | ||
|
|
eaf487828a | ||
|
|
dee0b35090 | ||
|
|
e822ec666d | ||
|
|
f081594357 | ||
|
|
258b0d3c24 | ||
|
|
74ec22f88f | ||
|
|
6b366ba64c | ||
|
|
2904958913 | ||
|
|
2467da69e4 | ||
|
|
f0aca82372 | ||
|
|
f81b0c50fe | ||
|
|
7aa910f11c | ||
|
|
6daa819b73 | ||
|
|
7383c42ad7 | ||
|
|
661e55b97f | ||
|
|
7d9e3b3d43 | ||
|
|
54b82849bb | ||
|
|
3aff90e222 | ||
|
|
2242310cce | ||
|
|
506ead5fcd | ||
|
|
fdfa2b0b22 | ||
|
|
a3efbe88da | ||
|
|
ae42b2d56a | ||
|
|
a9183717cf | ||
|
|
f55ce79305 | ||
|
|
8159390ee2 | ||
|
|
e034b82d75 | ||
|
|
529b6e8f8f | ||
|
|
3b1d92015b | ||
|
|
c0703d6b97 | ||
|
|
aaabaf86c1 | ||
|
|
c9d48f9027 | ||
|
|
34312b1f2f | ||
|
|
582f32db7a | ||
|
|
b3afe20c10 | ||
|
|
41ca50f15b | ||
|
|
b3fd92890d | ||
|
|
449bfd60e6 | ||
|
|
b4ea06ef45 | ||
|
|
6d58fb6b7c | ||
|
|
505e3d5466 | ||
|
|
13aa059a73 | ||
|
|
934589348e | ||
|
|
2434c90ca2 | ||
|
|
7936b86b4a | ||
|
|
c68ea5ab6f | ||
|
|
d21c2c56d3 | ||
|
|
fb1c8ede06 | ||
|
|
47bd3bb6e7 | ||
|
|
d39be21072 | ||
|
|
caa9033cb0 | ||
|
|
319109dbd6 | ||
|
|
18451d26e9 | ||
|
|
6b18066ef9 | ||
|
|
5b2738d43e | ||
|
|
cb60c36d89 | ||
|
|
10747a8399 | ||
|
|
372fb40b32 | ||
|
|
39596a0bb8 | ||
|
|
815cd2038f | ||
|
|
63d65c3623 | ||
|
|
34e121bd88 | ||
|
|
140e93b105 | ||
|
|
39b1681518 | ||
|
|
6df7749aba | ||
|
|
5ff85d5f7b | ||
|
|
0d84dd5f3e | ||
|
|
56ad6341a4 | ||
|
|
d0d14bad7f | ||
|
|
9251454eba | ||
|
|
df3dbc9122 | ||
|
|
f52d81f64d | ||
|
|
802c8b4d2d | ||
|
|
4b67c3a3c3 | ||
|
|
df9664e830 | ||
|
|
7112370451 | ||
|
|
c47ab182ae | ||
|
|
5d136cd0e4 | ||
|
|
0df6a2d9ae | ||
|
|
0d36c93ec3 | ||
|
|
a47b5a1409 | ||
|
|
f3af37b200 | ||
|
|
e2bcd3d211 | ||
|
|
10074f0384 | ||
|
|
8c0e3973f3 | ||
|
|
1a3b09ee9b | ||
|
|
64fcc4cfa2 | ||
|
|
46eb195775 | ||
|
|
4082964458 | ||
|
|
ef01cf77ca | ||
|
|
f07dcd7083 | ||
|
|
1692a63ff2 | ||
|
|
22c3cb9f47 | ||
|
|
1897c0ba41 | ||
|
|
a8feca1043 | ||
|
|
17ecd2e936 | ||
|
|
525b1062ea | ||
|
|
46dc14a9bb | ||
|
|
f875678a9c | ||
|
|
3f34c23843 | ||
|
|
1485e914c7 | ||
|
|
c14457833d | ||
|
|
684383509d | ||
|
|
64515206b5 | ||
|
|
dc9ee3099d | ||
|
|
e0f2b783e6 | ||
|
|
b4df8837c5 | ||
|
|
0323370c96 | ||
|
|
7ad97a3888 | ||
|
|
397d825a68 | ||
|
|
be590a7f1b | ||
|
|
a8f6c4be42 | ||
|
|
09fde7e34c | ||
|
|
e776b17de6 | ||
|
|
46bf27e1f8 | ||
|
|
0e1ebde9db | ||
|
|
9a8dd89fb4 | ||
|
|
c6499366d9 | ||
|
|
eaf777dadd | ||
|
|
1bda28a96d | ||
|
|
5fbd559ca3 | ||
|
|
10ce1a2ee5 | ||
|
|
84a333ae28 | ||
|
|
95ddbb5ffd | ||
|
|
4089317770 | ||
|
|
1de8de8681 | ||
|
|
c6325f6625 | ||
|
|
12f6e2266d | ||
|
|
614150d9c9 | ||
|
|
941d7a5f92 | ||
|
|
e1b3d3bd12 | ||
|
|
37e14404f9 | ||
|
|
1d7ca056f7 | ||
|
|
86e06cbf5a | ||
|
|
17170dd5f8 | ||
|
|
2046d592c4 | ||
|
|
bb73563bf0 | ||
|
|
6d11d388ca | ||
|
|
f8c10c6657 | ||
|
|
3c2e84fe27 | ||
|
|
fd7f93dbd7 | ||
|
|
4e355995e6 | ||
|
|
5f839220a3 | ||
|
|
8286fbb064 | ||
|
|
4995984517 | ||
|
|
15773fd920 | ||
|
|
4570d5baf2 | ||
|
|
95618732f8 | ||
|
|
1c030bfa0b | ||
|
|
d1c3b53530 | ||
|
|
0471bcb97b | ||
|
|
bcd0726142 | ||
|
|
1f0fa192a0 | ||
|
|
c3040176bf | ||
|
|
478aeecf15 | ||
|
|
2a1651c3e4 | ||
|
|
cf1d92e1f0 | ||
|
|
450d620463 | ||
|
|
151f94686f | ||
|
|
258d93b5db | ||
|
|
b10f143b39 | ||
|
|
221a2bc36c | ||
|
|
06d70c449d | ||
|
|
3b9905b53c | ||
|
|
efcfe62f11 | ||
|
|
a1dbc02252 | ||
|
|
b21480c640 | ||
|
|
c8ffafa0d6 | ||
|
|
99aa534807 | ||
|
|
0d6c623096 | ||
|
|
7053e3f078 | ||
|
|
31cbcecdc1 | ||
|
|
797e5add3c | ||
|
|
a86baa60f0 | ||
|
|
6aa855c91d | ||
|
|
2884211b1d | ||
|
|
bcae14f76c | ||
|
|
aaaf38083e | ||
|
|
c2d4d4ab29 | ||
|
|
546bdab866 | ||
|
|
e1e2b2708a | ||
|
|
9625b32c35 | ||
|
|
8a00831853 | ||
|
|
47646ffd92 | ||
|
|
8665f1db57 | ||
|
|
209d13cfe2 | ||
|
|
7554cf628e | ||
|
|
19c301f5fd | ||
|
|
3f413cb923 | ||
|
|
437fa7cdb5 | ||
|
|
401a0c93d9 | ||
|
|
0297504a3b | ||
|
|
a662b272cd | ||
|
|
cc277fb0fc | ||
|
|
a17a5c72c4 | ||
|
|
7a1879608d | ||
|
|
4eab0af794 | ||
|
|
fb7e0083d9 | ||
|
|
6d6a2a47aa | ||
|
|
1b86ec0556 | ||
|
|
952312d17b | ||
|
|
4903734012 | ||
|
|
8d0407462f | ||
|
|
128bbd56f0 | ||
|
|
03c3316c37 | ||
|
|
6a133b5aec | ||
|
|
5418d308a2 | ||
|
|
6f8531ba11 | ||
|
|
3ea8de5a73 | ||
|
|
3d6d5eed05 | ||
|
|
ca0b670784 | ||
|
|
745ebf782f | ||
|
|
707412ef5e | ||
|
|
7f81a64fe4 | ||
|
|
404b08681a | ||
|
|
7a0ed38a4e | ||
|
|
3c961a8c32 | ||
|
|
80f5bcaac3 | ||
|
|
fa221950f2 | ||
|
|
7b54523bc5 | ||
|
|
f40f1b9daa | ||
|
|
faf263ca85 | ||
|
|
f547bf04d4 | ||
|
|
a8300fda29 | ||
|
|
ff4f7a9fe8 | ||
|
|
098c401a87 | ||
|
|
ef96cd4a72 | ||
|
|
f465191dd8 | ||
|
|
b2faafdce6 | ||
|
|
9905bf6e1a | ||
|
|
a47c7d6527 | ||
|
|
f0f22a9148 | ||
|
|
1b2a75f8e6 | ||
|
|
7888f0ca7a | ||
|
|
0319af5eec | ||
|
|
9d9781932c | ||
|
|
73d5178d78 | ||
|
|
0a0005d6bc | ||
|
|
31c86c4cb7 | ||
|
|
f10c484578 | ||
|
|
42d6e74fbe | ||
|
|
3a4c7fbd89 | ||
|
|
582edeead6 | ||
|
|
5833f62773 | ||
|
|
86dfe9cb2d | ||
|
|
05dde72e8f | ||
|
|
6821d981a7 | ||
|
|
8a5d4c16b8 | ||
|
|
f55d23d9be | ||
|
|
2fdb6d754e | ||
|
|
08e3cd334b | ||
|
|
4bb3f24b2b | ||
|
|
89203899af | ||
|
|
89a909043d | ||
|
|
9b9be1867f | ||
|
|
e4802c01ae | ||
|
|
0ece72f323 | ||
|
|
043757e9fc | ||
|
|
46a406db90 | ||
|
|
ccf32dc186 | ||
|
|
66bdba18ff | ||
|
|
d81e61b1ff | ||
|
|
9b8f7545fe | ||
|
|
1ff29abbe0 | ||
|
|
5d490128a8 | ||
|
|
f48c09fa09 | ||
|
|
92b1cc77bb | ||
|
|
52326281de | ||
|
|
7ad183bf13 | ||
|
|
82360354b0 | ||
|
|
cec25e81be | ||
|
|
045c82cdbf | ||
|
|
552637d5ff | ||
|
|
5922ad8b08 | ||
|
|
162941cddc | ||
|
|
875d966f65 | ||
|
|
b3353eb548 | ||
|
|
baa0573468 | ||
|
|
4cd5464496 | ||
|
|
5d422e8d5b | ||
|
|
9c2f480a0e | ||
|
|
d6dd039681 | ||
|
|
dceac9452d | ||
|
|
f062e83a76 | ||
|
|
a3ac02c342 | ||
|
|
deecde44a4 | ||
|
|
ee542163d0 | ||
|
|
2d37ef1259 | ||
|
|
4d05a35652 | ||
|
|
08a09d5e00 | ||
|
|
91bf06000f | ||
|
|
0fa4a59674 | ||
|
|
a5b1311644 | ||
|
|
cc87efd697 | ||
|
|
a1c5cf9b9d | ||
|
|
7e6e42282a | ||
|
|
d0824bc3f6 | ||
|
|
5ab09dfebf | ||
|
|
9251d0c8b0 | ||
|
|
73e2ec4c7e | ||
|
|
f98ba48091 | ||
|
|
943b5057e7 | ||
|
|
2c59a6eb70 | ||
|
|
db5ebeda1e | ||
|
|
26ba0ffeae | ||
|
|
707af630d5 | ||
|
|
057f004909 | ||
|
|
e1318ff7cd | ||
|
|
19b8fd4bae | ||
|
|
d96a496896 | ||
|
|
ecc9f6f19d | ||
|
|
5caea33110 | ||
|
|
1667c46952 | ||
|
|
1d6131a23a | ||
|
|
b38a1bbdc3 | ||
|
|
fb0c34af4a | ||
|
|
fad62ea3b8 | ||
|
|
fda6b1aa8a | ||
|
|
adbc6f06d0 | ||
|
|
a305cc3f93 | ||
|
|
6e4020a144 | ||
|
|
5add71ad41 | ||
|
|
d34fd206f5 | ||
|
|
1f3ae5b4a0 | ||
|
|
301616f606 | ||
|
|
dbba5b8db2 | ||
|
|
f2d2484bc9 | ||
|
|
94275ccb6c | ||
|
|
2187a56ca7 | ||
|
|
8f4dfd10d3 | ||
|
|
bd27d339e7 | ||
|
|
aaf9843c9f | ||
|
|
2ec12ddca8 | ||
|
|
9da4ecb3d3 | ||
|
|
fbfe87c995 | ||
|
|
1c39ca1162 | ||
|
|
c7fcd604c6 | ||
|
|
a58c0398d8 | ||
|
|
3d8261ebe9 | ||
|
|
e69d38cccb | ||
|
|
c372c414ad | ||
|
|
c051bc3777 | ||
|
|
629f7e6755 | ||
|
|
80f6c6fa18 | ||
|
|
418e0c2c79 | ||
|
|
2b4f3e72b9 | ||
|
|
33caa0addc | ||
|
|
db6199f447 | ||
|
|
1340dbe0ef | ||
|
|
bbcce4c71a | ||
|
|
bb626b6036 | ||
|
|
b860710c8e | ||
|
|
4cd5350a12 | ||
|
|
496db1c678 | ||
|
|
cd62100e23 | ||
|
|
672d296303 | ||
|
|
2f690d5017 | ||
|
|
ae0b14d006 | ||
|
|
9654e78020 | ||
|
|
b2b5d3f972 | ||
|
|
73e3b8a43c | ||
|
|
bd7aae37af | ||
|
|
13346a8dec | ||
|
|
87b98ccf20 | ||
|
|
6be3aae4eb | ||
|
|
06fa45f3b8 | ||
|
|
704571812b | ||
|
|
90489758d1 | ||
|
|
7b94973506 | ||
|
|
3ec094cb24 | ||
|
|
662ba5f4fc | ||
|
|
705558e337 | ||
|
|
d83e0f433d | ||
|
|
bb238f863d | ||
|
|
0ae88c5c48 | ||
|
|
9f2af5acbd | ||
|
|
25444d1c4c | ||
|
|
250cc6f3dc | ||
|
|
1b72eebb15 | ||
|
|
9464edcc8f | ||
|
|
dac03c0d9a | ||
|
|
d2fd5b8e78 | ||
|
|
f4e23d1ec9 | ||
|
|
c637ea386a | ||
|
|
e922cb1761 | ||
|
|
590180f6f7 | ||
|
|
420e0f51a8 | ||
|
|
efa104cbfb | ||
|
|
46e5bfae41 | ||
|
|
f161b6e232 | ||
|
|
7cee1d1143 | ||
|
|
c5c21eff17 | ||
|
|
4bf9a053b1 | ||
|
|
78eec9966b | ||
|
|
5435e41ebe | ||
|
|
c5e776a818 | ||
|
|
4a1535fb62 | ||
|
|
6179f08691 | ||
|
|
e6c9ca3a33 | ||
|
|
8a6027fba4 | ||
|
|
3a68d19d55 | ||
|
|
40144bd963 | ||
|
|
84652f9f5e | ||
|
|
5f280e103c | ||
|
|
2f3f7cea38 | ||
|
|
86ed346089 | ||
|
|
acb177fff4 | ||
|
|
304f152661 | ||
|
|
17741ff819 | ||
|
|
7cd134bac0 | ||
|
|
df0c9d4a08 | ||
|
|
936b4bb074 | ||
|
|
6b72f77ef5 | ||
|
|
3ab32dadcd | ||
|
|
e7b7c5345f | ||
|
|
87fb4e371e | ||
|
|
eac2a23d6b | ||
|
|
772621999e | ||
|
|
6e248cd38a | ||
|
|
7c484d3803 | ||
|
|
c52f8ecd3d | ||
|
|
633383ee9e | ||
|
|
6b917f4b51 | ||
|
|
6b0124e885 | ||
|
|
67eef9e8c0 | ||
|
|
eb32e6bf84 | ||
|
|
0419a70e8a | ||
|
|
8c763dbcd0 | ||
|
|
cb2742db98 | ||
|
|
9b37e362b4 | ||
|
|
8fe2086b64 | ||
|
|
81694f575c | ||
|
|
b53694a93e | ||
|
|
3e7e911cdd | ||
|
|
8a19fb26be | ||
|
|
19f97e42a1 | ||
|
|
9f6e0a85d8 | ||
|
|
e804357187 | ||
|
|
b1b3f5f24e | ||
|
|
3e9bd176d9 | ||
|
|
aa16127a53 | ||
|
|
2d1e32ed00 | ||
|
|
3198e5cd24 | ||
|
|
03bcd515aa | ||
|
|
926558813f | ||
|
|
23f1bb6ead | ||
|
|
ed9e1fe3f0 | ||
|
|
4c4c2ea13a | ||
|
|
d4019b7169 | ||
|
|
a508a227d6 | ||
|
|
45107eea52 | ||
|
|
8535ef0c3b | ||
|
|
910429eee7 | ||
|
|
7b40f21a57 | ||
|
|
97e2d5d092 | ||
|
|
02460caff3 | ||
|
|
4e0af9a7d4 | ||
|
|
e0ba8b09c6 | ||
|
|
63a3cae583 | ||
|
|
160a996665 | ||
|
|
0e0363a6bd | ||
|
|
9cd45bdc69 | ||
|
|
3f045241f5 | ||
|
|
ea54ed3088 | ||
|
|
1adf3ddb71 | ||
|
|
b9f8f12bdb | ||
|
|
b01056fa69 | ||
|
|
daf4c21cb2 | ||
|
|
3888da36ad | ||
|
|
5f0317d1c2 | ||
|
|
7fac94d0f4 | ||
|
|
271084ac71 | ||
|
|
788095d952 | ||
|
|
94b8ac7cfa | ||
|
|
db479a82dc | ||
|
|
0001b16786 | ||
|
|
c272181df5 | ||
|
|
11e25ec707 | ||
|
|
8057b8be8a | ||
|
|
43027a66aa | ||
|
|
15bf4f2fdf | ||
|
|
905c70b0f1 | ||
|
|
649a36d0af | ||
|
|
f82b442b3c | ||
|
|
f8fb00ca59 | ||
|
|
f7f7d95b74 | ||
|
|
c1bb351fdc | ||
|
|
890b0592ba | ||
|
|
9d1ff5c821 | ||
|
|
fc2138096e | ||
|
|
cf3a317e91 | ||
|
|
a4be1febce | ||
|
|
4aa2c5eea8 | ||
|
|
8f8fa72183 | ||
|
|
1fecabe576 | ||
|
|
70ee43eed4 | ||
|
|
1b18ab6a23 | ||
|
|
6d919cbaef | ||
|
|
ab86759584 | ||
|
|
f1bf3a2dfd | ||
|
|
cb748a31e9 | ||
|
|
73dcbfbee5 | ||
|
|
59023ea173 | ||
|
|
b24197fa96 | ||
|
|
da1a7d5331 | ||
|
|
dfaa6e9b09 | ||
|
|
36cc1ed161 | ||
|
|
192c334fda | ||
|
|
31fe96b5ba | ||
|
|
9dd8a3d1db | ||
|
|
bda28e3c9e | ||
|
|
4aebf56bff | ||
|
|
f0390cbaba | ||
|
|
53ea652e5f | ||
|
|
977421c9eb | ||
|
|
a8382eb7c5 | ||
|
|
c8fc6237d4 | ||
|
|
d67d163fe3 | ||
|
|
5e7d188dcb | ||
|
|
4ba5317bfb | ||
|
|
d273e05710 | ||
|
|
be4b7d375b | ||
|
|
ab9a64b454 | ||
|
|
907e445ae7 | ||
|
|
71b47e4756 | ||
|
|
4d41c9404b | ||
|
|
148c970cbb | ||
|
|
375d1ffa3e | ||
|
|
b793ab7603 | ||
|
|
96ea6b03e7 | ||
|
|
5fe4fe9386 | ||
|
|
e14f3074db | ||
|
|
eaf4ef5a49 | ||
|
|
1e8f20f877 | ||
|
|
263cc7d9ae | ||
|
|
4c2b7a7459 | ||
|
|
43e27c5332 | ||
|
|
c616a840d6 | ||
|
|
180c1911ec | ||
|
|
fe3c0c5b0f | ||
|
|
163cc2e69b | ||
|
|
60c4b45a54 | ||
|
|
933341da74 | ||
|
|
cc5514275a | ||
|
|
9510d27748 | ||
|
|
2348d08595 | ||
|
|
ac31f2aef1 | ||
|
|
f918a4d82b | ||
|
|
fc5c6f3e0e | ||
|
|
24921b08d0 | ||
|
|
3a69773553 | ||
|
|
cff2c2c582 | ||
|
|
588d9f328d | ||
|
|
6980f434b4 | ||
|
|
97fdad841c | ||
|
|
ba184c3b57 | ||
|
|
c8cd5bfcd5 | ||
|
|
a845fe996f | ||
|
|
62f2a08600 | ||
|
|
189d1720ed | ||
|
|
2041e6a41f | ||
|
|
c1c7c84e7d | ||
|
|
b39d75f877 | ||
|
|
6324764a40 | ||
|
|
1eb75f8c27 | ||
|
|
b67bcf4843 | ||
|
|
a69758c914 | ||
|
|
35bfe95ab7 | ||
|
|
16dbd9c4a8 | ||
|
|
89572dc342 | ||
|
|
c58abca41f | ||
|
|
a328928280 | ||
|
|
962ae76bc0 | ||
|
|
c8813f8fc8 | ||
|
|
990a41d5fe | ||
|
|
ca37b268f7 | ||
|
|
9c3d464503 | ||
|
|
4ccdea739f | ||
|
|
6a8ebab58d | ||
|
|
092a294bbc | ||
|
|
5d6d168bed | ||
|
|
fbe2455d8d | ||
|
|
67f1bd08f8 | ||
|
|
6c72708d72 | ||
|
|
39eb289850 | ||
|
|
20a2c4f432 | ||
|
|
d1c8376449 | ||
|
|
f81fc2c840 | ||
|
|
b7f7196be3 | ||
|
|
19ed51c4e1 | ||
|
|
06af02477c | ||
|
|
c60139781d | ||
|
|
beb1e2a4bd | ||
|
|
939e901bce | ||
|
|
edf72c7977 | ||
|
|
29389f0fcd | ||
|
|
136be95fe1 | ||
|
|
d701b6973a | ||
|
|
cf5cfbf04e | ||
|
|
18a677af22 | ||
|
|
ca13a5ef65 | ||
|
|
19dedb1939 | ||
|
|
72350d066b | ||
|
|
87e2a4b54b | ||
|
|
0f2cf4f48b | ||
|
|
a0b5009a3a | ||
|
|
838649dfee | ||
|
|
a706077c61 | ||
|
|
1b15d81f48 | ||
|
|
79a67545f4 | ||
|
|
21aa4a2f9a | ||
|
|
8b9aea19d5 | ||
|
|
d7c9639cc1 | ||
|
|
bcf50862d1 | ||
|
|
bd43b6a25d | ||
|
|
fa8e52aa86 | ||
|
|
7f62da4f83 | ||
|
|
21da573629 | ||
|
|
32c39f7e29 | ||
|
|
01e98927ec | ||
|
|
05147c382f | ||
|
|
b29533962b | ||
|
|
005795626a | ||
|
|
bca7c818e7 | ||
|
|
cc8882b870 | ||
|
|
b27f2edc57 | ||
|
|
5c782392db | ||
|
|
a42211ad52 | ||
|
|
d4089c1822 | ||
|
|
c3621304cb | ||
|
|
9e46d5912f | ||
|
|
e8296305ec | ||
|
|
ba58676aea | ||
|
|
9a53de3e33 | ||
|
|
2659c27999 | ||
|
|
5bab9ec73f | ||
|
|
7a9a74ed4f | ||
|
|
90d8b8bcc8 | ||
|
|
4a5911d416 | ||
|
|
90711db7da | ||
|
|
ae0b875228 | ||
|
|
d1d8c0129f | ||
|
|
e08cbc29b4 | ||
|
|
50fff54810 | ||
|
|
f1e9e67f66 | ||
|
|
0e2a9c299a | ||
|
|
44f1a3899a | ||
|
|
0e5fc4af58 | ||
|
|
401c294965 | ||
|
|
10ba72ee76 | ||
|
|
b7692cd816 | ||
|
|
cd16235799 | ||
|
|
6a67e54d34 | ||
|
|
d86ab8df3a | ||
|
|
8fed1cb898 | ||
|
|
f860441730 | ||
|
|
061ed664e2 | ||
|
|
4272dc5b57 | ||
|
|
64065d7a6d | ||
|
|
3457e843ef | ||
|
|
7d15051ae1 | ||
|
|
67411e2c56 | ||
|
|
f5e08862ab | ||
|
|
d371d9c561 | ||
|
|
f2486eab07 | ||
|
|
72f4b595ff | ||
|
|
436fa33c47 | ||
|
|
9ead1505eb | ||
|
|
e617861340 | ||
|
|
a7ffffa54d | ||
|
|
4f09c07271 | ||
|
|
a95c4613a5 | ||
|
|
52428363a1 | ||
|
|
67a2f24b86 | ||
|
|
507c25df08 | ||
|
|
b9cd95595d | ||
|
|
abf7eb5b73 | ||
|
|
416493c71f | ||
|
|
120d150a31 | ||
|
|
ac699b3ffc | ||
|
|
58ee54a3dc | ||
|
|
0b95515322 | ||
|
|
2a0dbb2a26 | ||
|
|
a846609e45 | ||
|
|
dff2d0d4ba | ||
|
|
e0e4d6b1c0 | ||
|
|
63306ff75b | ||
|
|
153c332fcd | ||
|
|
97484d58c5 | ||
|
|
11d99751e8 | ||
|
|
eaa343fa75 | ||
|
|
88f1265869 | ||
|
|
79143d22b7 | ||
|
|
418dc949ad | ||
|
|
c87bdac8bb | ||
|
|
5ca13143ec | ||
|
|
d77aae8c04 | ||
|
|
5ff262029e | ||
|
|
a360db05aa | ||
|
|
0b8f2a8127 | ||
|
|
64fff4508d | ||
|
|
1e8cf12dc5 | ||
|
|
e48babd69b | ||
|
|
c4842cd1a6 | ||
|
|
2ee0c72d8a | ||
|
|
428d7418f0 | ||
|
|
a4b6caedf2 | ||
|
|
e1d099f21d | ||
|
|
5aed3ae866 | ||
|
|
2ff2921c1f | ||
|
|
bde250680b | ||
|
|
e4f050d6fc | ||
|
|
c89f14f6ea | ||
|
|
ddb1eb942d | ||
|
|
beecca57f1 | ||
|
|
4158028b3d | ||
|
|
2c8b3e5c73 | ||
|
|
a058dad22b | ||
|
|
58557ba9cd | ||
|
|
58fad32972 | ||
|
|
c305f0f5f8 | ||
|
|
c1acead14f | ||
|
|
e63ac30622 | ||
|
|
cf9125f987 | ||
|
|
d513985ecf | ||
|
|
14d3e56b03 | ||
|
|
0497c7b872 | ||
|
|
68093fb37c | ||
|
|
2b6ecb6aa8 | ||
|
|
9a8deed063 | ||
|
|
3b85fc3f20 | ||
|
|
e445b044dd | ||
|
|
dddd2fbded | ||
|
|
4ebd31d6c5 | ||
|
|
8d0ffda037 | ||
|
|
8bfeeda06f | ||
|
|
6f4a4cca87 | ||
|
|
b07273385d | ||
|
|
994fabcba7 | ||
|
|
0908ebd261 | ||
|
|
d8242b7b6e | ||
|
|
ee030ba487 | ||
|
|
c6ffa614fd | ||
|
|
7d4466c45a | ||
|
|
2a00ad3de1 | ||
|
|
641be3028f | ||
|
|
c236b76b0c | ||
|
|
a6f5e31e7d | ||
|
|
31c482e2a8 | ||
|
|
39aadedaf7 | ||
|
|
e0acc8d3d0 | ||
|
|
08658b989d | ||
|
|
8f7c09c770 | ||
|
|
93d3cb3b42 | ||
|
|
7c3eea677e | ||
|
|
f17ee19665 | ||
|
|
01a0925622 | ||
|
|
41f0e26051 | ||
|
|
99edef5c4c | ||
|
|
1950374fbe | ||
|
|
4995a4ea84 | ||
|
|
82b1df53d0 | ||
|
|
74c694c200 | ||
|
|
70b72261c8 | ||
|
|
ead2550eb0 | ||
|
|
844c8f946f | ||
|
|
30209acd75 | ||
|
|
a0df425ac3 | ||
|
|
1e44ca3c18 | ||
|
|
a7ee3cc2f2 | ||
|
|
264a75c13f | ||
|
|
8bbd874ef4 | ||
|
|
afa12446af | ||
|
|
5ebbaccf7b | ||
|
|
e320144878 | ||
|
|
8756b851e1 | ||
|
|
0eadeaf837 | ||
|
|
7404fe4fa5 | ||
|
|
d71f0e04b2 | ||
|
|
f0d7f6fddb | ||
|
|
d4874da99e | ||
|
|
c774854dcf | ||
|
|
b715d40019 | ||
|
|
6e42329df5 | ||
|
|
3477339d79 | ||
|
|
7b200af9a2 | ||
|
|
2f83b9cfdb | ||
|
|
ec65ee7ade | ||
|
|
9493f3c102 | ||
|
|
dd7cc8fddc | ||
|
|
bfb6a305f7 | ||
|
|
750b88f0de | ||
|
|
aa2086117c | ||
|
|
a7958b582d | ||
|
|
b5170621b9 | ||
|
|
801ab5428d | ||
|
|
e8f8188954 | ||
|
|
2266917d12 | ||
|
|
24e8e9d5cd | ||
|
|
d0aecad9d4 | ||
|
|
50a1d9d4a7 | ||
|
|
41ea29ef02 | ||
|
|
595b3fc337 | ||
|
|
4e4c0aad37 | ||
|
|
6e7d188d7b | ||
|
|
2fb0355c6b | ||
|
|
c1c89e5fd3 | ||
|
|
c94b267b34 | ||
|
|
745be1fd7d | ||
|
|
ce0f3f26ce | ||
|
|
7e33a97efc | ||
|
|
2d510a5603 | ||
|
|
a03bd0610f | ||
|
|
4dab9f4776 | ||
|
|
12bb169ebb | ||
|
|
52b207f812 | ||
|
|
a8e20395d0 | ||
|
|
e0ccf1f37e | ||
|
|
4a14e99dd5 | ||
|
|
b14dce6190 | ||
|
|
2b02b5ea74 | ||
|
|
d98b24c0f3 | ||
|
|
e2914acc38 | ||
|
|
4cb9ee6bab | ||
|
|
f611f3c664 | ||
|
|
e9f86cd8cf | ||
|
|
92a7c129df | ||
|
|
b8eeb8454d | ||
|
|
6bce9e5b21 | ||
|
|
a0f65d0e99 | ||
|
|
3f8ad7598f | ||
|
|
4d65b22403 | ||
|
|
c759ddad43 | ||
|
|
d95c559650 | ||
|
|
8897045308 | ||
|
|
56a7cf3ab3 | ||
|
|
535e4c1b38 | ||
|
|
8d76cca127 | ||
|
|
f409ad31b4 | ||
|
|
82750b9744 | ||
|
|
d1bebf1bc5 | ||
|
|
1c810256bf | ||
|
|
99d2f51f2c | ||
|
|
f16883b846 | ||
|
|
748bda0c54 | ||
|
|
b5bffb2735 | ||
|
|
0676951248 | ||
|
|
b924e4baa8 | ||
|
|
ca81e6912a | ||
|
|
58dd6fa960 | ||
|
|
29a57fc9cb | ||
|
|
2bb3760815 | ||
|
|
a41ba28081 | ||
|
|
243249521d | ||
|
|
d9019b2386 | ||
|
|
05bf72d1e9 | ||
|
|
4404aa487d | ||
|
|
5ec9a17505 | ||
|
|
0cec25a85d | ||
|
|
3a16ac0a92 | ||
|
|
2f67b6c5a1 | ||
|
|
88546760e9 | ||
|
|
527c480a9e | ||
|
|
3bf81d55cf | ||
|
|
bdbe9a1b5b | ||
|
|
4aa2b0ed83 | ||
|
|
592e6c3aa3 | ||
|
|
4f3a18180e | ||
|
|
b4ca26d112 | ||
|
|
5384748984 | ||
|
|
9f7db4a504 | ||
|
|
87316fb0e5 | ||
|
|
008a69b28f | ||
|
|
f5031101fd | ||
|
|
f84c6c743c | ||
|
|
7beee88783 | ||
|
|
d823abaaa3 | ||
|
|
6df6114357 | ||
|
|
4cd964039a | ||
|
|
2c3827d8ca | ||
|
|
e387be988a | ||
|
|
026f6d379d | ||
|
|
9864b12d26 | ||
|
|
92257be8b3 | ||
|
|
c94d23dc13 | ||
|
|
19d9cc2d75 | ||
|
|
aee1370842 | ||
|
|
f4d52efe5b | ||
|
|
4965267284 | ||
|
|
6adda3e963 | ||
|
|
aea5c2aaca | ||
|
|
1f784a84d0 | ||
|
|
60826ccda8 | ||
|
|
7cf55635ec | ||
|
|
c22f41cbf9 | ||
|
|
4659feb84c | ||
|
|
0b4a44f926 | ||
|
|
5df088c603 | ||
|
|
de46138715 | ||
|
|
363efbac97 | ||
|
|
c6a16212fc | ||
|
|
06b8ec5269 | ||
|
|
9a6867b7e9 | ||
|
|
05fedad27b | ||
|
|
cca2fe54e4 | ||
|
|
40cc77a614 | ||
|
|
526d71ae38 | ||
|
|
d8ba29c639 | ||
|
|
e6905cd686 | ||
|
|
4d29b4ba1b | ||
|
|
050ebec5db | ||
|
|
88a1b143d1 | ||
|
|
281d6445b1 | ||
|
|
1d011cec19 | ||
|
|
396e5e417f | ||
|
|
2968376436 | ||
|
|
b81dca611d | ||
|
|
ab6c2fa557 | ||
|
|
c01cd564e1 | ||
|
|
00bb487c0e | ||
|
|
26f914fde9 | ||
|
|
9a987c1346 | ||
|
|
b664c8d070 | ||
|
|
e4aeef3417 | ||
|
|
4ea7326030 | ||
|
|
435e568120 | ||
|
|
79f4ee31da | ||
|
|
9e4c52a9f9 | ||
|
|
a7dc225454 | ||
|
|
80dfd8f7b5 | ||
|
|
39c0e61381 | ||
|
|
0ee5686b8c | ||
|
|
3826ef37b1 | ||
|
|
2927e0972f | ||
|
|
e56c93f6f8 | ||
|
|
d12c228d7d | ||
|
|
1113a62e37 | ||
|
|
798ca8add0 | ||
|
|
38a8b5ecdb | ||
|
|
43b0f05bb3 | ||
|
|
6a46e826d5 | ||
|
|
9313e8f0c4 | ||
|
|
9a7f94d20b | ||
|
|
eb80b6fbaa | ||
|
|
62065135d1 | ||
|
|
b77dcba831 | ||
|
|
cdbdb080a4 | ||
|
|
4bbbe1f26f | ||
|
|
f8bbc3023a | ||
|
|
dbbb4b4485 | ||
|
|
610c12c402 | ||
|
|
259c5306a9 | ||
|
|
ba7c870812 | ||
|
|
97dde67cba | ||
|
|
02896f6428 | ||
|
|
63b7e2f477 | ||
|
|
2693122d24 | ||
|
|
9b4f53f45c | ||
|
|
768bc13f55 | ||
|
|
841874f176 | ||
|
|
b07aeb07ee | ||
|
|
fd610fd1a6 | ||
|
|
0ec87b1f76 | ||
|
|
5ab3cf2e4d | ||
|
|
c993029597 | ||
|
|
352c247c47 | ||
|
|
02f470b3f3 | ||
|
|
a13f1f35ed | ||
|
|
bfc4e23f90 | ||
|
|
d6f004b496 | ||
|
|
5e1d692eb5 | ||
|
|
4b67d52cbd | ||
|
|
7619dd2856 | ||
|
|
3a99cc7efe | ||
|
|
35517fc61d | ||
|
|
130cdcb69d | ||
|
|
90d3e47bd9 | ||
|
|
a6c2c792e7 | ||
|
|
56df9f36cf | ||
|
|
73017c20d2 | ||
|
|
955afb839b | ||
|
|
a3a4d647c6 | ||
|
|
ce8208c68b | ||
|
|
c9671e9bba | ||
|
|
d42567e422 | ||
|
|
769cf19111 | ||
|
|
854344e782 | ||
|
|
1becd370fb | ||
|
|
ce4b84fbcc | ||
|
|
74e221710e | ||
|
|
0fcb272584 | ||
|
|
21d167e225 | ||
|
|
114c1127fd | ||
|
|
b7cd0f30a4 | ||
|
|
1ad5e7564c | ||
|
|
00c4f31a6b | ||
|
|
5f528c9225 | ||
|
|
d3a641e794 | ||
|
|
d2ec0bdc12 | ||
|
|
8ba2307295 | ||
|
|
a9cb9f0b22 | ||
|
|
e36cad9a5c | ||
|
|
7f437ecbfe | ||
|
|
99d79a713c | ||
|
|
ca361d5346 | ||
|
|
d3c0cc39b7 | ||
|
|
2e24b50dbc | ||
|
|
347d867084 | ||
|
|
cf06946888 | ||
|
|
db39d66d1f | ||
|
|
d9d5b90bed | ||
|
|
217aa922ce | ||
|
|
0b215739a8 | ||
|
|
1d4512da96 | ||
|
|
78a76913b4 | ||
|
|
fb9c62c186 | ||
|
|
3e7c8545c0 | ||
|
|
5328d4b161 | ||
|
|
f3ed098831 | ||
|
|
9f90b6f237 | ||
|
|
80fd5be2e5 | ||
|
|
3b905ac208 | ||
|
|
23c492b7b6 | ||
|
|
4a5704d1c0 | ||
|
|
57f09eedf2 | ||
|
|
3e235bca21 | ||
|
|
76ecad404b | ||
|
|
e650117c4c | ||
|
|
27cc3295b1 | ||
|
|
aa06f7666a | ||
|
|
8f48bade9b | ||
|
|
30f91343e8 | ||
|
|
02b9d03af9 | ||
|
|
67bd8fc314 | ||
|
|
f96cfdb03e | ||
|
|
94d75018a0 | ||
|
|
4ef7dcc47f | ||
|
|
16ba8ffa10 | ||
|
|
0a3fd98778 | ||
|
|
7c37687daa | ||
|
|
de264087db | ||
|
|
d7dd1472e3 | ||
|
|
e53697af51 | ||
|
|
cf13a281b8 | ||
|
|
63312a2e66 | ||
|
|
8d6a89039a | ||
|
|
c01e30e606 | ||
|
|
48f492804b | ||
|
|
07b775d330 | ||
|
|
3fe72dbff2 | ||
|
|
5cb83ab7ee | ||
|
|
4944d0ea91 | ||
|
|
2f9eda3303 | ||
|
|
6d4cb77b68 | ||
|
|
bf0de58b71 | ||
|
|
dd443cbb06 | ||
|
|
10eb6321ce | ||
|
|
e62164115b | ||
|
|
c820a1c9c7 | ||
|
|
d76ca7e7fd | ||
|
|
204327240f | ||
|
|
1c136e6574 | ||
|
|
bc73cb575d | ||
|
|
c9dd100667 | ||
|
|
fe9d54682f | ||
|
|
df16f1e7d5 | ||
|
|
b650c4c03e | ||
|
|
89b8ac957e | ||
|
|
9335c0e1c3 | ||
|
|
2510e8fc62 | ||
|
|
ae45b63453 | ||
|
|
ccd004b025 | ||
|
|
682406d7b4 | ||
|
|
d45d06ee56 | ||
|
|
ec8c30d2c3 | ||
|
|
93ad905243 | ||
|
|
e9d8de921a | ||
|
|
2c81f40268 | ||
|
|
7325e15f1a | ||
|
|
a6d3000998 | ||
|
|
a3e035ac09 | ||
|
|
4089c941fd | ||
|
|
827bb7fd06 | ||
|
|
5566c7e8db | ||
|
|
face2561d4 | ||
|
|
0988604c10 | ||
|
|
f7a51c375f | ||
|
|
fe4f265208 | ||
|
|
89350411d8 | ||
|
|
75ca5cb9f4 | ||
|
|
794cd7a4b6 | ||
|
|
2758f89379 | ||
|
|
5ecc02dcbc | ||
|
|
8adeb7c77a | ||
|
|
324a98029b | ||
|
|
0aa0c6bd79 | ||
|
|
9a780dd772 | ||
|
|
d076c965b5 | ||
|
|
8e05bf08c4 | ||
|
|
e14ddad715 | ||
|
|
f2861e4e64 | ||
|
|
aa4a05c843 | ||
|
|
73a072a8c0 | ||
|
|
7acb8d2cbf | ||
|
|
2fb4a870a1 | ||
|
|
604c5ec81e | ||
|
|
08b60c2fa0 | ||
|
|
30676ade73 | ||
|
|
a6eccb520c | ||
|
|
1d1b53c90d | ||
|
|
ae1573ae1b | ||
|
|
f7d614172a | ||
|
|
eea6e4ca83 | ||
|
|
3d2ee270ed | ||
|
|
406de8984a | ||
|
|
f0d639e1bc | ||
|
|
49403601af | ||
|
|
2b86e9ad34 | ||
|
|
7397117a9f | ||
|
|
3fa2aa8cd6 | ||
|
|
7caa8001b4 | ||
|
|
e734385812 | ||
|
|
b20028be50 | ||
|
|
53950b34bb | ||
|
|
09258f3d67 | ||
|
|
e7b77e958f | ||
|
|
16d2b789af | ||
|
|
c64aa75ac1 | ||
|
|
1a1dd95f2b | ||
|
|
9fe6003b44 | ||
|
|
716994af04 | ||
|
|
a677499a6f | ||
|
|
456e939d21 | ||
|
|
d3408b8d1d | ||
|
|
52a0043631 | ||
|
|
739473adbe | ||
|
|
9fc5474ec3 | ||
|
|
383389930f | ||
|
|
60f703edc5 | ||
|
|
6afb1d76a9 | ||
|
|
6a9c1924cc | ||
|
|
b3da4ac017 | ||
|
|
b9266d33d7 | ||
|
|
6c56fda631 | ||
|
|
018edaedaa | ||
|
|
8b1319e1ac | ||
|
|
380bc170be | ||
|
|
c5e9de682e | ||
|
|
8b89e99baf | ||
|
|
96867d96c4 | ||
|
|
2920c69b1b | ||
|
|
6964b62775 | ||
|
|
061f365e37 | ||
|
|
9708832dd7 | ||
|
|
c164c7f97a | ||
|
|
21d61ca5f1 | ||
|
|
8f5fd569ee | ||
|
|
970293ac91 | ||
|
|
82ccb59aef | ||
|
|
9bbcaed4ae | ||
|
|
892eb98fdb | ||
|
|
c72b56daa3 | ||
|
|
39846f5631 | ||
|
|
0ca9be168d | ||
|
|
33b627e518 | ||
|
|
527d116f03 | ||
|
|
ef0129559b | ||
|
|
4ee0d91310 | ||
|
|
00d20bc63a | ||
|
|
a4ac66b40a | ||
|
|
fe18aadf26 | ||
|
|
4f05dc99af | ||
|
|
3f9c05e76a | ||
|
|
1ef11a145a | ||
|
|
e5e296e58c | ||
|
|
275833b30d | ||
|
|
8d025021af | ||
|
|
9cf5b1d99d | ||
|
|
4b24d97a17 | ||
|
|
648ad628b7 | ||
|
|
b22c5ee5b9 | ||
|
|
440e801148 | ||
|
|
90fa7951a8 | ||
|
|
b47c186427 | ||
|
|
d3035fbd10 | ||
|
|
f02e1a1119 | ||
|
|
ce7e27ef33 | ||
|
|
eca2711718 | ||
|
|
a752804b3a | ||
|
|
cec5e973ac | ||
|
|
504aaf12bd | ||
|
|
eaee82d4b3 | ||
|
|
8f45a6eabc | ||
|
|
332b42bb81 | ||
|
|
8f2719f5aa | ||
|
|
d644ebc792 | ||
|
|
406ce1034d | ||
|
|
c29cc486d3 | ||
|
|
fc485403b5 | ||
|
|
fe1969d001 | ||
|
|
ec9059a86a | ||
|
|
1084cdf38d | ||
|
|
9c2ff0a7c5 | ||
|
|
c20c8a8180 | ||
|
|
0985cec450 | ||
|
|
dac9ae77a4 | ||
|
|
f51e5e8b7e | ||
|
|
abce0b152c | ||
|
|
cb9f7f7608 | ||
|
|
2bada305e0 | ||
|
|
c1c9a2b786 | ||
|
|
f5bb9f4438 | ||
|
|
2d0eafe945 | ||
|
|
a54fa61041 | ||
|
|
e744a5d305 | ||
|
|
a5e6d7e9b5 | ||
|
|
46ba36922f | ||
|
|
d20b401d1b | ||
|
|
8c848640b3 | ||
|
|
831aebce72 | ||
|
|
c30a7ff7e5 | ||
|
|
655a1097a6 | ||
|
|
300be32995 | ||
|
|
d062db000f | ||
|
|
41a04a213e | ||
|
|
806d3c5bf2 | ||
|
|
9b098a8dba | ||
|
|
119c41470d | ||
|
|
a6e303e89e | ||
|
|
275f8a3a95 | ||
|
|
b6db010663 | ||
|
|
bb9c01d77b | ||
|
|
32c13321e7 | ||
|
|
4f61c6e05f | ||
|
|
906a026df1 | ||
|
|
9cd50c590e | ||
|
|
d9196c8135 | ||
|
|
cee6075cda | ||
|
|
9debb42671 | ||
|
|
26e8b90813 | ||
|
|
887cbb215b | ||
|
|
eeeb204407 | ||
|
|
d43795a7a8 | ||
|
|
8da08e85fc | ||
|
|
fdae4db922 | ||
|
|
839dd30dcf | ||
|
|
3a0aa5a0b5 | ||
|
|
34407e985d | ||
|
|
16badfe907 | ||
|
|
e534e78497 | ||
|
|
261d8c4bf9 | ||
|
|
b2644a7deb | ||
|
|
3d5e302f6d | ||
|
|
bc7994a1ef | ||
|
|
a09cdf1a14 | ||
|
|
28a5884fce | ||
|
|
e0271df732 | ||
|
|
82b43093b4 | ||
|
|
cfc5177808 | ||
|
|
113beb03ea | ||
|
|
1601fdb733 | ||
|
|
396fe5cf50 | ||
|
|
c84da05ca6 | ||
|
|
59fd0fcd5b | ||
|
|
5a88b6edb8 | ||
|
|
fbc5369c73 | ||
|
|
7f10d74dd3 | ||
|
|
025e0d4ba8 | ||
|
|
c5f1d3ba49 | ||
|
|
0dcc919b64 | ||
|
|
48aa04cc90 | ||
|
|
5b9e4e49dd | ||
|
|
abf0e29960 | ||
|
|
ae484588d7 | ||
|
|
36d1bb04a4 | ||
|
|
148860a0e0 | ||
|
|
1919fa1881 | ||
|
|
92cead7b60 | ||
|
|
90d3cc2f62 | ||
|
|
bebabe6f2e | ||
|
|
182bc0bdba | ||
|
|
f76447a07f | ||
|
|
6a3999f05a | ||
|
|
53c8b2569f | ||
|
|
1de3312ae2 | ||
|
|
7dbb291b72 | ||
|
|
214410065f | ||
|
|
acd2f83b0d |
40
mozilla/LEGAL
Normal file
40
mozilla/LEGAL
Normal file
@@ -0,0 +1,40 @@
|
||||
Please be apprised of the following Legal Notices:
|
||||
|
||||
A) The U.S. District Court for the Eastern District of Virginia has
|
||||
ruled that the Netscape Navigator code does not infringe Wang's U.S.
|
||||
Patent No. 4,751,669 ("the '669 Patent") because: 1) HTML is not
|
||||
Videotex as defined by the '669 patent; 2) web servers are not central
|
||||
suppliers; and 3) Navigator does not "connect," as defined by the '669
|
||||
Patent, to web servers on the Internet. Wang may appeal this decision to
|
||||
the Federal Circuit. Wang contended that its Patent disclosing a
|
||||
"Videotext" system, is infringed by the following functionality in the
|
||||
Netscape Navigator code: 1) the animated logo and status line indicators
|
||||
--See Claims 1,8 and 9; 2) the "File Save As" function --See Claims
|
||||
23-27; 3) Bookmarks and Rename Bookmarks in the Properties window --See
|
||||
Claims 20-22; 4) storing HTML, GIF, and JPEG files and adding filename
|
||||
extensions --See Claim 38
|
||||
|
||||
B) Intermind owns pending U.S. patent applications on communications
|
||||
systems which employ metadata ("channel objects") to define a control
|
||||
structure for information transfer. The Netscape code does not infringe
|
||||
as released; however, modifications which utilize channel objects as
|
||||
described by Intermind should be considered carefully. The following is
|
||||
a statement from Intermind: "Intermind's claims fundamentally involve
|
||||
the use of a control structure to automate communications. ...The
|
||||
essence of Intermind's top claim is that two devices sender and
|
||||
receiver have persistent storage, communicate over a network,
|
||||
and exchange a control structure including metadata which describes: 1)
|
||||
what information is to be updated, 2) when to update this information,
|
||||
and 3) how to transfer the updated information. In addition, at least
|
||||
the receiving device must be able to process the metadata in order to
|
||||
perform the update determination and transfer. Any digital
|
||||
communications system which incorporates all of these elements will be
|
||||
covered by Intermind's patents." See Intermind.com.
|
||||
|
||||
C) Stac, Inc., and its licensing agent Hi/fn, own several patents which
|
||||
disclose data compression methods implementing an LZS compression
|
||||
algorithm, including U.S. Patent Nos. 4,701,745 and 5,016, 009 ("the
|
||||
Stac Patents"). The Netscape Communicator code does not perform
|
||||
compression. If you modify the Netscape source code to perform
|
||||
compression, please take notice of the Stac Patents.
|
||||
|
||||
421
mozilla/LICENSE
Normal file
421
mozilla/LICENSE
Normal file
@@ -0,0 +1,421 @@
|
||||
NETSCAPE PUBLIC LICENSE
|
||||
Version 1.0
|
||||
|
||||
----------------
|
||||
|
||||
1. Definitions.
|
||||
|
||||
1.1. ``Contributor'' means each entity that creates or contributes to
|
||||
the creation of Modifications.
|
||||
|
||||
1.2. ``Contributor Version'' means the combination of the Original
|
||||
Code, prior Modifications used by a Contributor, and the Modifications
|
||||
made by that particular Contributor.
|
||||
|
||||
1.3. ``Covered Code'' means the Original Code or Modifications or the
|
||||
combination of the Original Code and Modifications, in each case
|
||||
including portions thereof.
|
||||
|
||||
1.4. ``Electronic Distribution Mechanism'' means a mechanism generally
|
||||
accepted in the software development community for the electronic
|
||||
transfer of data.
|
||||
|
||||
1.5. ``Executable'' means Covered Code in any form other than Source
|
||||
Code.
|
||||
|
||||
1.6. ``Initial Developer'' means the individual or entity identified as
|
||||
the Initial Developer in the Source Code notice required by Exhibit A.
|
||||
|
||||
1.7. ``Larger Work'' means a work which combines Covered Code or
|
||||
portions thereof with code not governed by the terms of this License.
|
||||
|
||||
1.8. ``License'' means this document.
|
||||
|
||||
1.9. ``Modifications'' means any addition to or deletion from the
|
||||
substance or structure of either the Original Code or any previous
|
||||
Modifications. When Covered Code is released as a series of files, a
|
||||
Modification is:
|
||||
|
||||
A. Any addition to or deletion from the contents of a file
|
||||
containing Original Code or previous Modifications.
|
||||
|
||||
B. Any new file that contains any part of the Original Code or
|
||||
previous Modifications.
|
||||
|
||||
1.10. ``Original Code'' means Source Code of computer software code
|
||||
which is described in the Source Code notice required by Exhibit A as
|
||||
Original Code, and which, at the time of its release under this License
|
||||
is not already Covered Code governed by this License.
|
||||
|
||||
1.11. ``Source Code'' means the preferred form of the Covered Code for
|
||||
making modifications to it, including all modules it contains, plus any
|
||||
associated interface definition files, scripts used to control
|
||||
compilation and installation of an Executable, or a list of source code
|
||||
differential comparisons against either the Original Code or another
|
||||
well known, available Covered Code of the Contributor's choice. The
|
||||
Source Code can be in a compressed or archival form, provided the
|
||||
appropriate decompression or de-archiving software is widely available
|
||||
for no charge.
|
||||
|
||||
1.12. ``You'' means an individual or a legal entity exercising rights
|
||||
under, and complying with all of the terms of, this License or a future
|
||||
version of this License issued under Section 6.1. For legal entities,
|
||||
``You'' includes any entity which controls, is controlled by, or is
|
||||
under common control with You. For purposes of this definition,
|
||||
``control'' means (a) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (b) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares or beneficial ownership of such entity.
|
||||
|
||||
2. Source Code License.
|
||||
|
||||
2.1. The Initial Developer Grant.
|
||||
The Initial Developer hereby grants You a world-wide, royalty-free,
|
||||
non-exclusive license, subject to third party intellectual property
|
||||
claims:
|
||||
|
||||
(a) to use, reproduce, modify, display, perform, sublicense and
|
||||
distribute the Original Code (or portions thereof) with or without
|
||||
Modifications, or as part of a Larger Work; and
|
||||
|
||||
(b) under patents now or hereafter owned or controlled by Initial
|
||||
Developer, to make, have made, use and sell (``Utilize'') the
|
||||
Original Code (or portions thereof), but solely to the extent that
|
||||
any such patent is reasonably necessary to enable You to Utilize
|
||||
the Original Code (or portions thereof) and not to any greater
|
||||
extent that may be necessary to Utilize further Modifications or
|
||||
combinations.
|
||||
|
||||
2.2. Contributor Grant.
|
||||
Each Contributor hereby grants You a world-wide, royalty-free,
|
||||
non-exclusive license, subject to third party intellectual property
|
||||
claims:
|
||||
|
||||
(a) to use, reproduce, modify, display, perform, sublicense and
|
||||
distribute the Modifications created by such Contributor (or
|
||||
portions thereof) either on an unmodified basis, with other
|
||||
Modifications, as Covered Code or as part of a Larger Work; and
|
||||
|
||||
(b) under patents now or hereafter owned or controlled by
|
||||
Contributor, to Utilize the Contributor Version (or portions
|
||||
thereof), but solely to the extent that any such patent is
|
||||
reasonably necessary to enable You to Utilize the Contributor
|
||||
Version (or portions thereof), and not to any greater extent that
|
||||
may be necessary to Utilize further Modifications or combinations.
|
||||
|
||||
3. Distribution Obligations.
|
||||
|
||||
3.1. Application of License.
|
||||
The Modifications which You create or to which You contribute are
|
||||
governed by the terms of this License, including without limitation
|
||||
Section 2.2. The Source Code version of Covered Code may be distributed
|
||||
only under the terms of this License or a future version of this
|
||||
License released under Section 6.1, and You must include a copy of this
|
||||
License with every copy of the Source Code You distribute. You may not
|
||||
offer or impose any terms on any Source Code version that alters or
|
||||
restricts the applicable version of this License or the recipients'
|
||||
rights hereunder. However, You may include an additional document
|
||||
offering the additional rights described in Section 3.5.
|
||||
|
||||
3.2. Availability of Source Code.
|
||||
Any Modification which You create or to which You contribute must be
|
||||
made available in Source Code form under the terms of this License
|
||||
either on the same media as an Executable version or via an accepted
|
||||
Electronic Distribution Mechanism to anyone to whom you made an
|
||||
Executable version available; and if made available via Electronic
|
||||
Distribution Mechanism, must remain available for at least twelve (12)
|
||||
months after the date it initially became available, or at least six
|
||||
(6) months after a subsequent version of that particular Modification
|
||||
has been made available to such recipients. You are responsible for
|
||||
ensuring that the Source Code version remains available even if the
|
||||
Electronic Distribution Mechanism is maintained by a third party.
|
||||
|
||||
3.3. Description of Modifications.
|
||||
You must cause all Covered Code to which you contribute to contain a
|
||||
file documenting the changes You made to create that Covered Code and
|
||||
the date of any change. You must include a prominent statement that the
|
||||
Modification is derived, directly or indirectly, from Original Code
|
||||
provided by the Initial Developer and including the name of the Initial
|
||||
Developer in (a) the Source Code, and (b) in any notice in an
|
||||
Executable version or related documentation in which You describe the
|
||||
origin or ownership of the Covered Code.
|
||||
|
||||
3.4. Intellectual Property Matters
|
||||
|
||||
(a) Third Party Claims.
|
||||
If You have knowledge that a party claims an intellectual property
|
||||
right in particular functionality or code (or its utilization
|
||||
under this License), you must include a text file with the source
|
||||
code distribution titled ``LEGAL'' which describes the claim and
|
||||
the party making the claim in sufficient detail that a recipient
|
||||
will know whom to contact. If you obtain such knowledge after You
|
||||
make Your Modification available as described in Section 3.2, You
|
||||
shall promptly modify the LEGAL file in all copies You make
|
||||
available thereafter and shall take other steps (such as notifying
|
||||
appropriate mailing lists or newsgroups) reasonably calculated to
|
||||
inform those who received the Covered Code that new knowledge has
|
||||
been obtained.
|
||||
|
||||
(b) Contributor APIs.
|
||||
If Your Modification is an application programming interface and
|
||||
You own or control patents which are reasonably necessary to
|
||||
implement that API, you must also include this information in the
|
||||
LEGAL file.
|
||||
|
||||
3.5. Required Notices.
|
||||
You must duplicate the notice in Exhibit A in each file of the Source
|
||||
Code, and this License in any documentation for the Source Code, where
|
||||
You describe recipients' rights relating to Covered Code. If You
|
||||
created one or more Modification(s), You may add your name as a
|
||||
Contributor to the notice described in Exhibit A. If it is not possible
|
||||
to put such notice in a particular Source Code file due to its
|
||||
structure, then you must include such notice in a location (such as a
|
||||
relevant directory file) where a user would be likely to look for such
|
||||
a notice. You may choose to offer, and to charge a fee for, warranty,
|
||||
support, indemnity or liability obligations to one or more recipients
|
||||
of Covered Code. However, You may do so only on Your own behalf, and
|
||||
not on behalf of the Initial Developer or any Contributor. You must
|
||||
make it absolutely clear than any such warranty, support, indemnity or
|
||||
liability obligation is offered by You alone, and You hereby agree to
|
||||
indemnify the Initial Developer and every Contributor for any liability
|
||||
incurred by the Initial Developer or such Contributor as a result of
|
||||
warranty, support, indemnity or liability terms You offer.
|
||||
|
||||
3.6. Distribution of Executable Versions.
|
||||
You may distribute Covered Code in Executable form only if the
|
||||
requirements of Section 3.1-3.5 have been met for that Covered Code,
|
||||
and if You include a notice stating that the Source Code version of the
|
||||
Covered Code is available under the terms of this License, including a
|
||||
description of how and where You have fulfilled the obligations of
|
||||
Section 3.2. The notice must be conspicuously included in any notice in
|
||||
an Executable version, related documentation or collateral in which You
|
||||
describe recipients' rights relating to the Covered Code. You may
|
||||
distribute the Executable version of Covered Code under a license of
|
||||
Your choice, which may contain terms different from this License,
|
||||
provided that You are in compliance with the terms of this License and
|
||||
that the license for the Executable version does not attempt to limit
|
||||
or alter the recipient's rights in the Source Code version from the
|
||||
rights set forth in this License. If You distribute the Executable
|
||||
version under a different license You must make it absolutely clear
|
||||
that any terms which differ from this License are offered by You alone,
|
||||
not by the Initial Developer or any Contributor. You hereby agree to
|
||||
indemnify the Initial Developer and every Contributor for any liability
|
||||
incurred by the Initial Developer or such Contributor as a result of
|
||||
any such terms You offer.
|
||||
|
||||
3.7. Larger Works.
|
||||
You may create a Larger Work by combining Covered Code with other code
|
||||
not governed by the terms of this License and distribute the Larger
|
||||
Work as a single product. In such a case, You must make sure the
|
||||
requirements of this License are fulfilled for the Covered Code.
|
||||
|
||||
4. Inability to Comply Due to Statute or Regulation.
|
||||
|
||||
If it is impossible for You to comply with any of the terms of this
|
||||
License with respect to some or all of the Covered Code due to statute
|
||||
or regulation then You must: (a) comply with the terms of this License
|
||||
to the maximum extent possible; and (b) describe the limitations and
|
||||
the code they affect. Such description must be included in the LEGAL
|
||||
file described in Section 3.4 and must be included with all
|
||||
distributions of the Source Code. Except to the extent prohibited by
|
||||
statute or regulation, such description must be sufficiently detailed
|
||||
for a recipient of ordinary skill to be able to understand it.
|
||||
|
||||
5. Application of this License.
|
||||
|
||||
This License applies to code to which the Initial Developer has
|
||||
attached the notice in Exhibit A, and to related Covered Code.
|
||||
|
||||
6. Versions of the License.
|
||||
|
||||
6.1. New Versions.
|
||||
Netscape Communications Corporation (``Netscape'') may publish revised
|
||||
and/or new versions of the License from time to time. Each version will
|
||||
be given a distinguishing version number.
|
||||
|
||||
6.2. Effect of New Versions.
|
||||
Once Covered Code has been published under a particular version of the
|
||||
License, You may always continue to use it under the terms of that
|
||||
version. You may also choose to use such Covered Code under the terms
|
||||
of any subsequent version of the License published by Netscape. No one
|
||||
other than Netscape has the right to modify the terms applicable to
|
||||
Covered Code created under this License.
|
||||
|
||||
6.3. Derivative Works.
|
||||
If you create or use a modified version of this License (which you may
|
||||
only do in order to apply it to code which is not already Covered Code
|
||||
governed by this License), you must (a) rename Your license so that the
|
||||
phrases ``Mozilla'', ``MOZILLAPL'', ``MOZPL'', ``Netscape'', ``NPL'' or
|
||||
any confusingly similar phrase do not appear anywhere in your license
|
||||
and (b) otherwise make it clear that your version of the license
|
||||
contains terms which differ from the Mozilla Public License and
|
||||
Netscape Public License. (Filling in the name of the Initial Developer,
|
||||
Original Code or Contributor in the notice described in Exhibit A shall
|
||||
not of themselves be deemed to be modifications of this License.)
|
||||
|
||||
7. DISCLAIMER OF WARRANTY.
|
||||
|
||||
COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN ``AS IS'' BASIS,
|
||||
WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
|
||||
WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF
|
||||
DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING.
|
||||
THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE
|
||||
IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT,
|
||||
YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE
|
||||
COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER
|
||||
OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF
|
||||
ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
|
||||
|
||||
8. TERMINATION.
|
||||
|
||||
This License and the rights granted hereunder will terminate
|
||||
automatically if You fail to comply with terms herein and fail to cure
|
||||
such breach within 30 days of becoming aware of the breach. All
|
||||
sublicenses to the Covered Code which are properly granted shall
|
||||
survive any termination of this License. Provisions which, by their
|
||||
nature, must remain in effect beyond the termination of this License
|
||||
shall survive.
|
||||
|
||||
9. LIMITATION OF LIABILITY.
|
||||
|
||||
UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT
|
||||
(INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL THE INITIAL
|
||||
DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE,
|
||||
OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO YOU OR ANY OTHER
|
||||
PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
|
||||
OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF
|
||||
GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND
|
||||
ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE
|
||||
BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF
|
||||
LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY
|
||||
RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW
|
||||
PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE
|
||||
EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THAT
|
||||
EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
|
||||
|
||||
10. U.S. GOVERNMENT END USERS.
|
||||
|
||||
The Covered Code is a ``commercial item,'' as that term is defined in
|
||||
48 C.F.R. 2.101 (Oct. 1995), consisting of ``commercial computer
|
||||
software'' and ``commercial computer software documentation,'' as such
|
||||
terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48
|
||||
C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995),
|
||||
all U.S. Government End Users acquire Covered Code with only those
|
||||
rights set forth herein.
|
||||
|
||||
11. MISCELLANEOUS.
|
||||
|
||||
This License represents the complete agreement concerning subject
|
||||
matter hereof. If any provision of this License is held to be
|
||||
unenforceable, such provision shall be reformed only to the extent
|
||||
necessary to make it enforceable. This License shall be governed by
|
||||
California law provisions (except to the extent applicable law, if any,
|
||||
provides otherwise), excluding its conflict-of-law provisions. With
|
||||
respect to disputes in which at least one party is a citizen of, or an
|
||||
entity chartered or registered to do business in, the United States of
|
||||
America: (a) unless otherwise agreed in writing, all disputes relating
|
||||
to this License (excepting any dispute relating to intellectual
|
||||
property rights) shall be subject to final and binding arbitration,
|
||||
with the losing party paying all costs of arbitration; (b) any
|
||||
arbitration relating to this Agreement shall be held in Santa Clara
|
||||
County, California, under the auspices of JAMS/EndDispute; and (c) any
|
||||
litigation relating to this Agreement shall be subject to the
|
||||
jurisdiction of the Federal Courts of the Northern District of
|
||||
California, with venue lying in Santa Clara County, California, with
|
||||
the losing party responsible for costs, including without limitation,
|
||||
court costs and reasonable attorneys fees and expenses. The application
|
||||
of the United Nations Convention on Contracts for the International
|
||||
Sale of Goods is expressly excluded. Any law or regulation which
|
||||
provides that the language of a contract shall be construed against the
|
||||
drafter shall not apply to this License.
|
||||
|
||||
12. RESPONSIBILITY FOR CLAIMS.
|
||||
|
||||
Except in cases where another Contributor has failed to comply with
|
||||
Section 3.4, You are responsible for damages arising, directly or
|
||||
indirectly, out of Your utilization of rights under this License, based
|
||||
on the number of copies of Covered Code you made available, the
|
||||
revenues you received from utilizing such rights, and other relevant
|
||||
factors. You agree to work with affected parties to distribute
|
||||
responsibility on an equitable basis.
|
||||
|
||||
AMENDMENTS
|
||||
Additional Terms applicable to the Netscape Public License.
|
||||
|
||||
I. Effect.
|
||||
These additional terms described in this Netscape Public License --
|
||||
Amendments shall apply to the Mozilla Communicator client code and to
|
||||
all Covered Code under this License.
|
||||
|
||||
II. ``Netscape's Branded Code'' means Covered Code that Netscape
|
||||
distributes and/or permits others to distribute under one or more
|
||||
trademark(s) which are controlled by Netscape but which are not
|
||||
licensed for use under this License.
|
||||
|
||||
III. Netscape and logo.
|
||||
This License does not grant any rights to use the trademark
|
||||
``Netscape'', the ``Netscape N and horizon'' logo or the Netscape
|
||||
lighthouse logo, even if such marks are included in the Original Code.
|
||||
|
||||
IV. Inability to Comply Due to Contractual Obligation.
|
||||
Prior to licensing the Original Code under this License, Netscape has
|
||||
licensed third party code for use in Netscape's Branded Code. To the
|
||||
extent that Netscape is limited contractually from making such third
|
||||
party code available under this License, Netscape may choose to
|
||||
reintegrate such code into Covered Code without being required to
|
||||
distribute such code in Source Code form, even if such code would
|
||||
otherwise be considered ``Modifications'' under this License.
|
||||
|
||||
V. Use of Modifications and Covered Code by Initial Developer.
|
||||
|
||||
V.1. In General.
|
||||
The obligations of Section 3 apply to Netscape, except to the
|
||||
extent specified in this Amendment, Section V.2 and V.3.
|
||||
|
||||
V.2. Other Products.
|
||||
Netscape may include Covered Code in products other than the
|
||||
Netscape's Branded Code which are released by Netscape during the
|
||||
two (2) years following the release date of the Original Code,
|
||||
without such additional products becoming subject to the terms of
|
||||
this License, and may license such additional products on
|
||||
different terms from those contained in this License.
|
||||
|
||||
V.3. Alternative Licensing.
|
||||
Netscape may license the Source Code of Netscape's Branded Code,
|
||||
including Modifications incorporated therein, without such
|
||||
additional products becoming subject to the terms of this License,
|
||||
and may license such additional products on different terms from
|
||||
those contained in this License.
|
||||
|
||||
VI. Arbitration and Litigation.
|
||||
Notwithstanding the limitations of Section 11 above, the provisions
|
||||
regarding arbitration and litigation in Section 11(a), (b) and (c) of
|
||||
the License shall apply to all disputes relating to this License.
|
||||
|
||||
EXHIBIT A.
|
||||
|
||||
``The contents of this file are subject to the Netscape Public License
|
||||
Version 1.0 (the "License"); you may not use this file except in
|
||||
compliance with the License. You may obtain a copy of the License at
|
||||
http://www.mozilla.org/NPL/
|
||||
|
||||
Software distributed under the License is distributed on an "AS IS"
|
||||
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
||||
License for the specific language governing rights and limitations
|
||||
under the License.
|
||||
|
||||
The Original Code is Mozilla Communicator client code, released March
|
||||
31, 1998.
|
||||
|
||||
The Initial Developer of the Original Code is Netscape Communications
|
||||
Corporation. Portions created by Netscape are Copyright (C) 1998
|
||||
Netscape Communications Corporation. All Rights Reserved.
|
||||
|
||||
Contributor(s): ______________________________________.''
|
||||
|
||||
[NOTE: The text of this Exhibit A may differ slightly from the text of
|
||||
the notices in the Source Code files of the Original Code. This is due
|
||||
to time constraints encountered in simultaneously finalizing the
|
||||
License and in preparing the Original Code for release. You should use
|
||||
the text of this Exhibit A rather than the text found in the Original
|
||||
Code Source Code for Your Modifications.]
|
||||
104
mozilla/Makefile.in
Normal file
104
mozilla/Makefile.in
Normal file
@@ -0,0 +1,104 @@
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
#
|
||||
|
||||
DEPTH = .
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
# The list of directories that need to be built to build the standalone
|
||||
# nglayout test program. The order is important.
|
||||
DIRS = \
|
||||
config \
|
||||
$(NULL)
|
||||
|
||||
ifndef MOZ_NATIVE_NSPR
|
||||
DIRS += \
|
||||
nsprpub \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
DIRS += \
|
||||
dbm \
|
||||
modules/libreg \
|
||||
xpcom \
|
||||
$(NULL)
|
||||
|
||||
ifndef MOZ_NATIVE_ZLIB
|
||||
DIRS += \
|
||||
modules/zlib \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
ifndef MOZ_NATIVE_JPEG
|
||||
DIRS += \
|
||||
jpeg \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
DIRS += \
|
||||
modules/libutil \
|
||||
base \
|
||||
intl \
|
||||
js \
|
||||
modules/security/freenav \
|
||||
modules/libpref \
|
||||
modules/libimg \
|
||||
modules/oji \
|
||||
modules/plugin \
|
||||
caps \
|
||||
lib/xp \
|
||||
lib/libpwcac \
|
||||
network \
|
||||
htmlparser \
|
||||
gfx \
|
||||
dom \
|
||||
view \
|
||||
widget \
|
||||
layout \
|
||||
rdf \
|
||||
webshell \
|
||||
editor \
|
||||
silentdl \
|
||||
sun-java \
|
||||
$(NULL)
|
||||
|
||||
|
||||
DIRS += xpfe
|
||||
|
||||
ifdef MOZ_MAIL_NEWS
|
||||
DIRS += mailnews
|
||||
endif
|
||||
|
||||
include $(topsrcdir)/config/config.mk
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
real_all: all
|
||||
|
||||
real_export: export
|
||||
|
||||
real_libs: libs
|
||||
|
||||
real_install: install
|
||||
|
||||
real_clobber: clobber
|
||||
|
||||
real_depend: depend
|
||||
|
||||
BIN
mozilla/README/mozilla/IDEMenuBar.gif
Normal file
BIN
mozilla/README/mozilla/IDEMenuBar.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.5 KiB |
BIN
mozilla/README/mozilla/IDEPrefs.gif
Normal file
BIN
mozilla/README/mozilla/IDEPrefs.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
443
mozilla/README/mozilla/classic-mac.html
Normal file
443
mozilla/README/mozilla/classic-mac.html
Normal file
@@ -0,0 +1,443 @@
|
||||
|
||||
<HEAD>
|
||||
<TITLE>Building Mozilla on the Macintosh PPC platform</TITLE>
|
||||
</HEAD>
|
||||
<BODY BGCOLOR="#FFFFFF" LINK="#0000EE" VLINK="#551A8B">
|
||||
<P>
|
||||
|
||||
<HR>
|
||||
|
||||
</P>
|
||||
|
||||
<H1>Building Mozilla on the Macintosh PPC platform</H1>
|
||||
|
||||
<H2>Daniel Nunes, <A HREF="mailto:leaf@netscape.com"><TT>leaf@netscape.com</TT></A></H2>
|
||||
|
||||
<P>v 1.1, 1998-9-29<BR>
|
||||
updated for the Pro4 IDE</P>
|
||||
|
||||
<P>
|
||||
|
||||
<HR>
|
||||
|
||||
<I>How to build Mozilla on a Macintosh PPC System.</I>
|
||||
|
||||
<HR>
|
||||
|
||||
</P>
|
||||
|
||||
<H2>1. <A HREF="#s1">Introduction</A></H2>
|
||||
|
||||
<H2>2. <A HREF="#s2">Building Mozilla</A></H2>
|
||||
|
||||
<UL>
|
||||
<LI><A HREF="#ss2.1">2.1 Get the Code </A></LI>
|
||||
|
||||
<LI><A HREF="#ss2.2">2.2 Requirements</A></LI>
|
||||
|
||||
<LI><A HREF="#ss2.3">2.3 Set up the Build Environment</A></LI>
|
||||
|
||||
<LI><A HREF="#ss2.4">2.4 Build the Lizard </A></LI>
|
||||
</UL>
|
||||
|
||||
<H2>3. <A HREF="#s3"> Common Problems </A></H2>
|
||||
|
||||
<H2>4. <A HREF="#s4"> Credits </A></H2>
|
||||
|
||||
<P>
|
||||
|
||||
<HR>
|
||||
|
||||
</P>
|
||||
|
||||
<H2><A NAME=s1></A>1. Introduction</H2>
|
||||
|
||||
<P>What this document is: A guide to building the Mozilla
|
||||
application. This includes:</P>
|
||||
|
||||
<OL>
|
||||
<LI>A listing of the development tools you will need to build
|
||||
Mozilla.</LI>
|
||||
|
||||
<LI>A list of environment variables you will need to set before
|
||||
building.</LI>
|
||||
</OL>
|
||||
|
||||
<P>If you're looking for documentation on developing features or
|
||||
fixing bugs, the Mozilla <A HREF="http://www.mozilla.org/docs/tplist/tplist.html">Technical
|
||||
Documents </A> or <A HREF="http://www.mozilla.org/library.html">
|
||||
Library </A> are probably what you're looking for.</P>
|
||||
|
||||
<P>
|
||||
|
||||
<HR>
|
||||
|
||||
</P>
|
||||
|
||||
<H2><A NAME=s2></A>2. Building Mozilla</H2>
|
||||
|
||||
<P> </P>
|
||||
|
||||
<UL>
|
||||
<LI>Each of the following subsections describes, or gives
|
||||
references to descriptions of, the steps necessary to build
|
||||
Mozilla.
|
||||
|
||||
<H2><A NAME="ss2.1"></A>2.1 Get the Code</H2>
|
||||
|
||||
<P> </P>
|
||||
|
||||
<UL>
|
||||
<LI>There are two principal ways of getting the code, <A HREF="http://www.mozilla.org/download.html">
|
||||
ftp</A> and <A HREF="http://www.mozilla.org/cvs.html"> CVS</A>.
|
||||
CVS will provide the most current code for building, but is
|
||||
slower than ftp. Ftp drops are generally produced once per
|
||||
month, and are known to compile.</LI>
|
||||
</UL>
|
||||
|
||||
<P> </P>
|
||||
|
||||
<H2><A NAME="ss2.2"></A>2.2 Requirements</H2>
|
||||
|
||||
<P>The following need to be installed:</P>
|
||||
|
||||
<UL>
|
||||
<LI>CodeWarrior (CW) Pro4 - obtainable from <A HREF="http://www.metrowerks.com">Metrowerks</A>.
|
||||
See <A HREF="#s3">Common Sticking Points</A> if you have a
|
||||
different version. Mozilla will no longer build with anything
|
||||
earlier.</LI>
|
||||
|
||||
<LI>PowerPlant - obtainable from the CodeWarrior CD.</LI>
|
||||
|
||||
<LI>MSL - the Metrowerks Standard Library, obtainable from the
|
||||
CodeWarrior CD</LI>
|
||||
|
||||
<LI><A HREF="ftp://ftp.boingo.com//dan/WASTE/waste-13.hqx">WASTE
|
||||
1.3</A></LI>
|
||||
|
||||
<LI><A HREF="http://www.bact.wisc.edu/CWASTEEdit/CWASTEEdit.sit.hqx">CWASTE
|
||||
1.6.2</A></LI>
|
||||
|
||||
<LI><A HREF="ftp://ftp.scripting.com/userland/menuSharingToolkit4.1.sit.hqx">Menu
|
||||
Sharing Toolkit</A> (from UserLand)</LI>
|
||||
|
||||
<LI><A HREF="ftp://ftp.share.com/pub/internet-configuration/ICProgKit1.4.sit">Internet
|
||||
Config 1.4 SDK</A></LI>
|
||||
|
||||
<LI><A HREF="http://www.mooseyard.com/Jens/Software/">AEGizmos
|
||||
1.4.2</A></LI>
|
||||
|
||||
<LI><A HREF="ftp://sunsite.cnlab-switch.ch/software/platform/macos/perl/Mac_Perl_520r4_tool.bin">MacPerl
|
||||
5 MPW Tool</A></LI>
|
||||
|
||||
<LI><A HREF="ftp://sunsite.cnlab-switch.ch/software/platform/macos/perl/Mac_Perl_520r4_appl.bin">MacPerl
|
||||
5 Application</A></LI>
|
||||
|
||||
<LI>The module Mac:AppleEvents:Simple, which should be stored
|
||||
in your Perl library folder under :Mac:AppleEvents:Simple.pm,
|
||||
may be downloaded <A HREF="http://www.perl.com/CPAN-local/modules/by-module/Mac/Mac-AppleEvents-Simple-0.10.tgz">here</A>.</LI>
|
||||
|
||||
<LI>The module Mac:Apps:Launch, which should be stored in your
|
||||
Perl library folder under :Mac:Apps:Launch.pm, may be
|
||||
downloaded <A HREF="http://www.perl.com/CPAN-local/modules/by-module/Mac/Mac-Apps-Launch-1.30.tar.gz">here</A>.</LI>
|
||||
|
||||
<LI>MakeStub - MPW (installed with CodeWarrior Heaven option).
|
||||
If you choose not to install MPW, it is located on the MacOS
|
||||
Tools CD in "CW Pro 4 Tools:CodeWarrior MPW:MPW:Tools"</LI>
|
||||
|
||||
<LI>RunTSScript - in Mozilla source distribution
|
||||
(mozilla:build:mac:RunTSScript), needs to be installed by
|
||||
hand</LI>
|
||||
|
||||
<LI><A HREF="ftp://dev.apple.com/devworld/Tool_Chest/Core_Mac_OS_Tools/MPW_etc./MPW-GM/MPW/ToolServer.sit.hqx">ToolServer</A>
|
||||
- or in the CW distribution (CW Pro 4 Tools:Apple Development
|
||||
Tools:ToolServer 3.4.1.sit). <B>We recommend pulling it off the
|
||||
CD</B> because it comes with configuration files for
|
||||
CodeWarrior which you would have to create manually were you to
|
||||
pull it off the net.</LI>
|
||||
|
||||
<LI><A HREF="http://sunsite.cnlab-switch.ch/ftp/software/platform/macos/src/HTML/MPW_C.html">patch
|
||||
2.1</A></LI>
|
||||
</UL>
|
||||
|
||||
<P>Hardware/OS</P>
|
||||
|
||||
<UL>
|
||||
<LI>To build Navigator, you need a fast PPC Mac. The faster the
|
||||
better.</LI>
|
||||
|
||||
<LI>You will need about 96 MB of physical RAM to "fast link"
|
||||
the app. You can still fast link if you give your machine 96 MB
|
||||
of virtual memory, but then the VM hit is large enough to
|
||||
counteract any improvement. One of our beta testers had a
|
||||
machine with only 64MB of physical RAM (VM was off) and it ran
|
||||
out of memory trying to link. Turning VM on got it to link, but
|
||||
build time increased greatly.</LI>
|
||||
|
||||
<LI>Reports from the net indicate that the optimized version
|
||||
(MozillaPPC) take much less RAM to build than the 96MB we
|
||||
suggest. If you are running out of memory, try building that
|
||||
instead of the debug version (the debug symbols require a lot
|
||||
of RAM come link time).</LI>
|
||||
|
||||
<LI>You should be ok with a 400MB disk partition, even when
|
||||
fully built. This does not include tools like the IDE, just
|
||||
source.</LI>
|
||||
|
||||
<LI>On an HFS+ volume, a full build takes about 110MB. HFS+ is
|
||||
good, but utilities are sparse.</LI>
|
||||
</UL>
|
||||
|
||||
<P> </P>
|
||||
|
||||
<H2><A NAME="ss2.3"></A>2.3 Setup the Build Environment</H2>
|
||||
|
||||
<P> </P>
|
||||
|
||||
<OL>
|
||||
<LI>Install CodeWarrior from the CD. While it is large,
|
||||
installing the "CodeWarrior Heaven" option will guarantee that
|
||||
you have everything you need. This will give you PowerPlant,
|
||||
MSL, and MPW. If you choose to install less, proceed at your
|
||||
own risk.</LI>
|
||||
|
||||
<LI>In the Finder, increase the memory partition of the IDE to
|
||||
15MB (you can get by with 12, if need be).</LI>
|
||||
|
||||
<LI>Uncompress the StuffIt Archive for ToolServer. The goal is
|
||||
to let ToolServer and MPW share the same Tools directory so you
|
||||
don't need to have multiple versions of tools. Do the
|
||||
following:
|
||||
|
||||
<OL>
|
||||
<LI>Open ToolServer's Tools folder. There is one file called
|
||||
"RMetrowerks".</LI>
|
||||
|
||||
<LI>Move RMetrowerks to Tools folder of MPW. MPW folder must
|
||||
be at "Metrowerks:Codewarrior MPW:MPW" if you installed
|
||||
Codewarrior Heaven.</LI>
|
||||
|
||||
<LI>Remove ToolServer's Tools folder.</LI>
|
||||
|
||||
<LI>Now create an alias of Tools folder in "CodeWarrior MPW"
|
||||
and move it to your ToolServer folder. Rename the alias
|
||||
(probably called "Tools alias") to "Tools"</LI>
|
||||
|
||||
<LI><FONT COLOR="#FF0000"><B>IMPORTANT</B></FONT>: Make sure
|
||||
you only have one instance of ToolServer on your machine. If
|
||||
the build script finds the wrong one, the correct tools will
|
||||
not be found and strange things will happen.</LI>
|
||||
</OL>
|
||||
</LI>
|
||||
|
||||
<LI>After installing the MacPerl MPW Tool distribution (run the
|
||||
InstallerVISE application), in the "MacPerl ƒ" folder,
|
||||
there will be an MPW tool named "perl". Install this in MPW's
|
||||
tools folder.</LI>
|
||||
|
||||
<LI>Install the MacPerl Application (run the InstallerVISE
|
||||
application). You can install this anywhere, but it is
|
||||
recommended that you install it inside of your CodeWarrior
|
||||
folder for easy reference. After installation, you will need to
|
||||
set a preference to enable double-click launch of the perl
|
||||
scripts. This preference is set by going under the Edit Menu to
|
||||
Preferences. Click on the "Script" button and hit the radio
|
||||
button "Run Scripts opened from Finder"</LI>
|
||||
|
||||
<LI>Install the "patch" and "MakeStub" Tools in the tools
|
||||
folder. Note that "MakeStub" is automatically installed by the
|
||||
"CodeWarrior Heaven" install option.</LI>
|
||||
|
||||
<LI>Install RunTSScript (found in the Mozilla source
|
||||
distribution) in the compilers folder in your build environment
|
||||
("Metrowerks:Metrowerks Codewarrior:Codewarrior
|
||||
Plugins:Compilers")</LI>
|
||||
|
||||
<LI>Next, after downloading all the 3rd party software
|
||||
components, drag WASTE, CWASTE, Menu Sharing, Internet Config,
|
||||
and the AEGizmo folders (just as they are) into the "MacOS
|
||||
Support" folder in your build environment.</LI>
|
||||
|
||||
<LI>Create a folder inside the PowerPlant folder
|
||||
(Metrowerks:Metrowerks CodeWarrior:MacOS Support:PowerPlant)
|
||||
called "_Will Be Obsolete" Make sure you include the leading
|
||||
underscore.</LI>
|
||||
|
||||
<LI>Unstuff the obsolete LGA classes (located on the Reference
|
||||
CD in "CodeWarrior Examples:MacOS Examples:PowerPlant
|
||||
Examples:Obsolete PP Items:Old GA Classes.sit) and place the
|
||||
resulting folder into the "_Will Be Obsolete" folder you
|
||||
created in the previous step.</LI>
|
||||
|
||||
<LI>Start ToolServer from within CodeWarrior (or use MPW if you
|
||||
are brave enough). We're about to patch some files. Make sure
|
||||
the ToolServer menu is in the CodeWarrior menu bar by turning
|
||||
on the <A HREF="IDEPrefs.gif">preference</A> under the "Extras"
|
||||
panel in the IDE Preferences (not the project preferences!).
|
||||
The menu bar should look like this:
|
||||
|
||||
<P><IMG SRC="IDEMenuBar.gif" WIDTH=359 HEIGHT=20 X-CLARIS-USEIMAGEWIDTH X-CLARIS-USEIMAGEHEIGHT ALIGN=bottom></P>
|
||||
|
||||
<P>Choose "Start ToolServer" from the ToolServer menu (this is
|
||||
the icon menu between "Window" and "Help" in the menubar
|
||||
above). You will now see a window with no close box. This is
|
||||
your ToolServer Worksheet where you will type (or cut &
|
||||
paste) the commands for the following steps.</P>
|
||||
|
||||
<P>In case you have never used MPW/ToolServer before, the
|
||||
following is <B>very important</B>. Pressing "return" does not
|
||||
execute commands like you might think. It just inserts a
|
||||
newline into the worksheet like a normal text editor. <B>To
|
||||
actually get ToolServer to execute the command, you must press
|
||||
"Enter" (lower right of numeric keypad).</B> This executes the
|
||||
line that the cursor is on, and only that line. If you want to
|
||||
execute multiple lines at once, select them all and hit
|
||||
Enter.</P></LI>
|
||||
|
||||
<LI>Set the shell variables {IDE} and {Source} to the correct
|
||||
paths for your build environment. {IDE} is where your
|
||||
CodeWarrior IDE is located. {Source} is the folder containing
|
||||
the toplevel "ns" folder of the Mozilla source. Mine look like
|
||||
this (don't forget to keep the quotes if your path includes
|
||||
spaces), yours will almost certainly be different
|
||||
(<FONT COLOR="#FF0000">to punctuate this, the things you need
|
||||
to change are in red</FONT>).
|
||||
|
||||
<PRE>Set IDE "<FONT COLOR="#FF0000">Develop:CW Pro 4:Metrowerks CodeWarrior:</FONT>"
|
||||
Set Source "<FONT COLOR="#FF0000">Source:FreeSource:</FONT>"</PRE></LI>
|
||||
|
||||
<LI>Execute the following lines to patch menusharing.c to allow
|
||||
it to compile with the new Universal Headers. It references an
|
||||
obsolete header file (GestaltEqu.h).
|
||||
|
||||
<PRE>directory "{IDE}MacOS Support:Menu Sharing Toolkit 4.1:"
|
||||
patch menusharing.c "{Source}mozilla:lib:mac:patches:menusharing.patch"</PRE></LI>
|
||||
|
||||
<LI>You need to patch stat.mac.h to fix a problem in MSL where
|
||||
lines were omitted.
|
||||
|
||||
<PRE>directory "{IDE}Metrowerks Standard Library:MSL C:MSL Mac:Public Includes"
|
||||
patch stat.mac.h "{Source}mozilla:lib:mac:patches:stat.mac.h.patch"</PRE></LI>
|
||||
|
||||
<LI>Congratulations! Now you are ready to build. Once these
|
||||
steps are done, you don't have to repeat these setups the next
|
||||
time!</LI>
|
||||
</OL>
|
||||
|
||||
<P> </P>
|
||||
|
||||
<H2><A NAME="ss2.4"></A>2.4 Run the build</H2>
|
||||
|
||||
<UL>
|
||||
<LI>In the folder mozilla:build:mac:, there are several Perl
|
||||
scripts with names of the form BuildMozillaXXX.pl, where XXX is
|
||||
"Optimized", "Debug", "Tinderbox", et al. Each script builds
|
||||
the corresponding version of Mozilla. If you configured the
|
||||
MacPerl application to execute scripts that are opened from the
|
||||
finder, all you have to do is double click on the appropriate
|
||||
one; otherwise, launch MacPerl, and run the appropriate script
|
||||
from the "Run Script..." menu item.
|
||||
|
||||
<P>These `configured build' scripts are simple, and you might
|
||||
want to make your own to force your build to StopForErrors(),
|
||||
or alternatively DontStopForErrors(), et al. You can set up
|
||||
certain build-script variables and (soon) compile-time flags.
|
||||
Compare the supplied scripts to figure out what you might want.
|
||||
Note that CodeWarriorLib, Moz.pm, and BuildList.pm, are
|
||||
AppleScript libraries and Perl modules meant to be used by a
|
||||
`configured build'. Use your favorite POD viewer (Shuck comes
|
||||
with MacPerl) to view the documentation in the Perl
|
||||
scripts.</P>
|
||||
|
||||
<P>If there were any errors in any of the projects along the
|
||||
way, the script will stop at that point and the IDE will tell
|
||||
you the errors. You can fix them and make sure they current
|
||||
project builds, but to continue the automation, you have to
|
||||
start from the beginning by double-clicking the script again.
|
||||
This isn't quite as bad as it sounds because the previous
|
||||
projects are already built (unless you changed some major
|
||||
header file). Please note that stopping the script once it has
|
||||
started is difficult. We are working to address this issue.</P>
|
||||
|
||||
<P>After the build is complete, you can find aliases to the
|
||||
built libraries and the final Mozilla application. Debug builds
|
||||
are built to Mozilla:dist:client_debug, while optimized builds
|
||||
are built to Mozilla:dist:client.</P>
|
||||
|
||||
<P>Don't worry too much about the numerous warnings generated
|
||||
during the build. We try our best to get the XP teams to use
|
||||
real compilers, but alas, they continue to write warning-laden
|
||||
code. There is also some generated code (Java is one example)
|
||||
that has a lot of warnings that we can't help either. If you
|
||||
write any new code, please help us in our quest to get zero
|
||||
warnings.</P></LI>
|
||||
</UL>
|
||||
</LI>
|
||||
</UL>
|
||||
|
||||
<P>
|
||||
|
||||
<HR>
|
||||
|
||||
</P>
|
||||
|
||||
<H2><A NAME=s3></A>3. Common Sticking Points</H2>
|
||||
|
||||
<UL>
|
||||
<LI><B>I only have CodeWarrior Pro3 or Pro2. How do i build with
|
||||
it?</B>
|
||||
|
||||
<UL>
|
||||
<LI>Currently, the answer is, "You don't." We make use of
|
||||
several classes in PowerPlant which recently appeared in Pro4.
|
||||
Time to upgrade, I'm afraid. Don't even try opening the
|
||||
projects with Pro2 because you will get data loss and have to
|
||||
throw the project away (it won't even prompt you!)</LI>
|
||||
</UL>
|
||||
</LI>
|
||||
|
||||
<LI><B>I'm having problems building. MacPerl tells me it can't
|
||||
fine MemAllocatorStubs</B>
|
||||
|
||||
<UL>
|
||||
<LI>It sounds like your ToolServer environment is not setup
|
||||
correctly. Make sure you follow the directions to the letter.
|
||||
You could also be seeing this if you have multiple versions of
|
||||
ToolServer on your computer and the Finder lauches the wrong
|
||||
one. This is very common, as the <I>Carbon Dater</I> app from
|
||||
Apple DTS contains a copy of ToolServer. Either remove all the
|
||||
other versions of ToolServer or make sure you launch the
|
||||
appropriate version before you start building.</LI>
|
||||
</UL>
|
||||
</LI>
|
||||
|
||||
<LI><B>The IDE runs out of memory building jsinterp.c. What do I
|
||||
do?</B>
|
||||
|
||||
<UL>
|
||||
<LI>We have seen this every now and then, and it only appears
|
||||
to show up when building optimized (non-debug) builds. You can
|
||||
normally get around this by building that file by itself
|
||||
(select it and choose "Compile") and then continuing the make.
|
||||
We're not sure why this is happening, so if you have any
|
||||
answers or solutions, please let us know!</LI>
|
||||
</UL>
|
||||
</LI>
|
||||
</UL>
|
||||
|
||||
<P>
|
||||
|
||||
<HR>
|
||||
|
||||
</P>
|
||||
|
||||
<H2><A NAME=s4></A>4. Credits</H2>
|
||||
|
||||
<UL>
|
||||
<LI>The majority of this document is taken from the build document
|
||||
included in the Mozilla source distribution at
|
||||
README:mozilla:macbuild.htm written by Mike Pinkerton, <A HREF="mailto:pinkerton@netscape.com">
|
||||
pinkerton@netscape.com</A>.</LI>
|
||||
</UL>
|
||||
</BODY>
|
||||
</HTML>
|
||||
158
mozilla/README/mozilla/classic-unix.html
Normal file
158
mozilla/README/mozilla/classic-unix.html
Normal file
@@ -0,0 +1,158 @@
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>Building Mozilla on unix platforms</TITLE>
|
||||
</HEAD>
|
||||
<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000EE" VLINK="#551A8B"
|
||||
ALINK="#FF0000">
|
||||
<HR>
|
||||
<H1>
|
||||
Building Mozilla on Unix platforms</H1>
|
||||
|
||||
<H2>
|
||||
Daniel Nunes, <TT><A HREF="mailto:leaf@netscape.com">leaf@netscape.com</A></TT></H2>
|
||||
v 1.1, June 1998
|
||||
|
||||
<P>
|
||||
<HR><I>How to build Mozilla on a Unix System.</I>
|
||||
<HR>
|
||||
<H2>1. <A HREF="#s1">Introduction</A></H2>
|
||||
|
||||
<H2>2. <A HREF="#s2">Building Mozilla</A></H2>
|
||||
|
||||
<UL>
|
||||
<LI>
|
||||
<A HREF="#ss2.1">2.1 Get the Code </A></LI>
|
||||
|
||||
<LI>
|
||||
<A HREF="#ss2.2">2.2 Requirements</A></LI>
|
||||
|
||||
<LI>
|
||||
<A HREF="#ss2.3">2.3 Set up the Build Environment</A></LI>
|
||||
|
||||
<LI>
|
||||
<A HREF="#ss2.4">2.4 Build the Lizard </A></LI>
|
||||
|
||||
<LI>
|
||||
<A HREF="#ss2.5">2.5 Run the Lizard </A></LI>
|
||||
</UL>
|
||||
|
||||
<H2>3. <A HREF="#s3"> Common Problems </A></H2>
|
||||
|
||||
<HR>
|
||||
<H2><A NAME="s1">1. Introduction</A></H2>
|
||||
|
||||
<P>
|
||||
What this document is: A guide to building the Mozilla application.
|
||||
<BR>
|
||||
This includes:
|
||||
<OL>
|
||||
<LI> A listing of the development tools you will need to build Mozilla. </LI>
|
||||
<LI> A list of environment variables you will need to set before building. </LI>
|
||||
</OL>
|
||||
<P>
|
||||
If you're looking for documentation on developing features or fixing bugs,
|
||||
the Mozilla
|
||||
<A HREF="http://www.mozilla.org/docs/tplist/tplist.html">Technical Documents
|
||||
</A> or <A HREF="http://www.mozilla.org/library.html"> Library </A>
|
||||
are probably what you're looking for.
|
||||
<P>
|
||||
<HR>
|
||||
<H2><A NAME="s2">2. Building Mozilla </A></H2>
|
||||
<P>
|
||||
<UL>Each of the following subsections describes, or gives references to
|
||||
descriptions of, the steps necessary to build Mozilla.
|
||||
</UL>
|
||||
<H2><A NAME="ss2.1">2.1 Get the Code</A></H2>
|
||||
<P>
|
||||
<UL>
|
||||
There are two principal ways of getting the code,
|
||||
<A HREF="http://www.mozilla.org/download.html"> ftp</A> and
|
||||
<A HREF="http://www.mozilla.org/cvs.html"> CVS</A>.
|
||||
CVS will provide the most current code for building, but is
|
||||
slower than ftp. Ftp drops are generally produced once per month,
|
||||
and are known to compile.
|
||||
</UL>
|
||||
<P>
|
||||
<H2><A NAME="ss2.2">2.2 Requirements</A></H2>
|
||||
<UL>
|
||||
The following should be installed:
|
||||
<UL>
|
||||
<LI>Motif 1.2
|
||||
<LI>The native C/C++ compiler (or GNU C/C++ compiler 2.7.2 in lieu of the
|
||||
native compiler)
|
||||
<LI>GNU make 3.74 or better
|
||||
<LI>Perl (or, if you have no Perl, then set <CODE>PERL=/bin/echo</CODE>)
|
||||
</UL>
|
||||
<P>
|
||||
Your hardware should be equal to, or better than:
|
||||
<UL>
|
||||
32 MB RAM, 128 MB swap (64 MB RAM recommended)
|
||||
</UL>
|
||||
</UL>
|
||||
<P>
|
||||
<H2><A NAME="ss2.3">2.3 Setup the Build Environment</A></H2>
|
||||
<P>
|
||||
<UL>
|
||||
The following environment variables need to be set:
|
||||
<CODE>
|
||||
<PRE>
|
||||
MOZILLA_CLIENT=1
|
||||
MOZ_MEDIUM=1
|
||||
NO_MDUPDATE=1
|
||||
</PRE>
|
||||
</CODE>
|
||||
Optionally, you can set <CODE>BUILD_OPT=1</CODE> if you don't want a debug
|
||||
build.
|
||||
<P>
|
||||
If your Motif libraries are installed in a non-standard place, you can tell
|
||||
the Mozilla makefiles where to look by setting
|
||||
<CODE>MOZILLA_MOTIF_SEARCH_PATH</CODE> to point to the directory in which
|
||||
your Motif installation resides.
|
||||
<P>
|
||||
Environment variables are set by the shell, and there are two common ways
|
||||
of setting them. <BR>
|
||||
Type <CODE>setenv VARIABLE value</CODE> or <CODE>export VARIABLE=value</CODE>.
|
||||
<P>
|
||||
</UL>
|
||||
|
||||
<H2><A NAME="ss2.4">2.4 Run the build </A></H2>
|
||||
<UL>
|
||||
Change to the directory you copied the source into (for example,
|
||||
<CODE>cd /builds</CODE>). If this directory was empty before you
|
||||
installed the source, there should be two directories here:
|
||||
<CODE>README</CODE> and <CODE>mozilla</CODE>.
|
||||
<CODE>
|
||||
<PRE>
|
||||
cd mozilla
|
||||
gmake
|
||||
</PRE>
|
||||
</CODE>
|
||||
</UL>
|
||||
<H2><A NAME="ss2.5">2.5 After the build </A></H2>
|
||||
<UL>
|
||||
You may notice that if you try running mozilla-export right after the build,
|
||||
you'll run into a problem. You need to set <CODE>LD_LIBRARY_PATH</CODE> to
|
||||
<CODE>
|
||||
${LD_LIBRARY_PATH}:/PATH_TO_SOURCE/mozilla/dist/Linux2.0.32_x86_OPT.OBJ/bin
|
||||
</CODE> (where <CODE>PATH_TO_SOURCE</CODE> is the full path to your source
|
||||
tree) before the dynamically linked binary will run. <BR><BR>
|
||||
This varies by platform:<br>
|
||||
<UL>
|
||||
<LI>On HP-UX, the equivalent environment variable is <CODE>SHLIB_PATH</CODE>.
|
||||
<LI>On AIX, the equivalent environment variable is <CODE>LIBPATH</CODE>.
|
||||
</UL>
|
||||
</UL>
|
||||
|
||||
<HR>
|
||||
<H2><A NAME="s3">3. Common Sticking Points</A></H2>
|
||||
<LI>My linker dies with this error: undefined reference to `_Xsetlocale'
|
||||
<UL>If this error occurs, you might have to recompile libX11.so
|
||||
with the -DX_LOCALE flag (thanks to Scott Lampert,
|
||||
<A HREF="mailto:fortunato@heavymetal.org">fortunato@heavymetal.org</A>).
|
||||
|
||||
</UL>
|
||||
<HR>
|
||||
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
217
mozilla/README/mozilla/classic-win.html
Normal file
217
mozilla/README/mozilla/classic-win.html
Normal file
@@ -0,0 +1,217 @@
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>Building Mozilla on Microsoft Windows 32-bit platforms</TITLE>
|
||||
</HEAD>
|
||||
<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000EE" VLINK="#551A8B"
|
||||
ALINK="#FF0000">
|
||||
<HR>
|
||||
<H1>
|
||||
Building Mozilla on Microsoft Windows 32-bit platforms</H1>
|
||||
|
||||
<H2>
|
||||
Daniel Nunes, <TT><A HREF="mailto:leaf@netscape.com">leaf@netscape.com</A></TT>
|
||||
</H2>
|
||||
v 1.0, June 1998
|
||||
|
||||
<P>
|
||||
<HR><I>How to build Mozilla on a Microsoft Windows 32-bit System.</I>
|
||||
<HR>
|
||||
<H2>1. <A HREF="#s1">Introduction</A></H2>
|
||||
|
||||
<H2>2. <A HREF="#s2">Building Mozilla</A></H2>
|
||||
|
||||
<UL>
|
||||
<LI>
|
||||
<A HREF="#ss2.1">2.1 Get the Code </A></LI>
|
||||
|
||||
<LI>
|
||||
<A HREF="#ss2.2">2.2 Requirements</A></LI>
|
||||
|
||||
<LI>
|
||||
<A HREF="#ss2.3">2.3 Set up the Build Environment</A></LI>
|
||||
|
||||
<LI>
|
||||
<A HREF="#ss2.4">2.4 Build the Lizard </A></LI>
|
||||
</UL>
|
||||
|
||||
<H2>3. <A HREF="#s3"> Common Problems </A></H2>
|
||||
|
||||
<HR>
|
||||
<H2><A NAME="s1">1. Introduction</A></H2>
|
||||
|
||||
<P>
|
||||
What this document is: A guide to building the Mozilla application.
|
||||
<BR>
|
||||
This includes:
|
||||
<OL>
|
||||
<LI> A listing of the development tools you will need to build Mozilla. </LI>
|
||||
<LI> A list of environment variables you will need to set before building. </LI>
|
||||
</OL>
|
||||
<P>
|
||||
If you're looking for documentation on developing features or fixing bugs,
|
||||
the Mozilla
|
||||
<A HREF="http://www.mozilla.org/docs/tplist/tplist.html">Technical Documents
|
||||
</A> or <A HREF="http://www.mozilla.org/library.html"> Library </A>
|
||||
are probably what you're looking for.
|
||||
<P>
|
||||
<HR>
|
||||
<H2><A NAME="s2">2. Building Mozilla </A></H2>
|
||||
<P>
|
||||
<UL>Each of the following subsections describes, or gives references to
|
||||
descriptions of, the steps necessary to build Mozilla.
|
||||
<H2><A NAME="ss2.1">2.1 Get the Code</A></H2>
|
||||
<P>
|
||||
<UL>
|
||||
There are two principal ways of getting the code,
|
||||
<A HREF="http://www.mozilla.org/download.html"> ftp</A> and
|
||||
<A HREF="http://www.mozilla.org/cvs.html"> CVS</A>.
|
||||
CVS will provide the most current code for building, but is
|
||||
slower than ftp. Ftp drops are generally produced once per month,
|
||||
and are known to compile.
|
||||
|
||||
</UL>
|
||||
<P>
|
||||
<H2><A NAME="ss2.2">2.2 Requirements</A></H2>
|
||||
<UL>
|
||||
The following need to be installed:
|
||||
<UL>
|
||||
<LI>Microsoft Visual C++ version 4.2 or later
|
||||
<LI>GNU Tools for Microsoft Windows, located:
|
||||
<UL>
|
||||
<LI><A HREF="http://www.cygnus.com/misc/gnu-win32">Cygnus</A></LI>
|
||||
<LI><A HREF="http://www.gnu.org/order/ftp.html">GNU home page</A></LI>
|
||||
<LI><A HREF="ftp://prep.ai.mit.edu/pub/gnu">MIT</A></LI>
|
||||
</UL>
|
||||
Specifically, you'll need:
|
||||
<UL><CODE>
|
||||
cp.exe<BR>
|
||||
rm.exe<BR>
|
||||
uname.exe<BR>
|
||||
</CODE>
|
||||
</UL>
|
||||
Netscape has internally modified version of gmake, shmsdos and win32gnu
|
||||
that we use to get around some problems we were having keeping in sync
|
||||
with the Unix version of gmake. This version of gmake can be found in the
|
||||
Windows Build Tools package, which can be ftp'd from
|
||||
<A HREF="http://www.mozilla.org/download-mozilla.html"> the Mozilla
|
||||
Download page</A>.
|
||||
The three files you will need are:
|
||||
<UL><CODE>
|
||||
gmake.exe<BR>
|
||||
shmsdos.exe<BR>
|
||||
uname.exe<BR>
|
||||
</CODE>
|
||||
</UL>
|
||||
|
||||
</UL>
|
||||
<P>
|
||||
Hardware/OS
|
||||
<UL>
|
||||
<LI>Pentium 133 MHz or better</LI>
|
||||
<LI>64 MB RAM, 128 MB recommended</LI>
|
||||
<LI>250 MB NTFS or 500 MB FAT disk space</LI>
|
||||
<LI>NT 4.0 is preferred; NT 3.51 will also work.
|
||||
</LI>
|
||||
</UL>
|
||||
</UL>
|
||||
<P>
|
||||
<H2><A NAME="ss2.3">2.3 Setup the Build Environment</A></H2>
|
||||
<P>
|
||||
<UL>
|
||||
The following environment variables need to be set:
|
||||
<UL>
|
||||
<CODE>
|
||||
set MOZ_BITS=32
|
||||
<BR>
|
||||
set MOZ_DEBUG=1 (set this only if you want to build a debug build)
|
||||
<BR>
|
||||
set MOZ_MEDIUM=1
|
||||
<BR>
|
||||
set MOZ_NT=351 (if running NT3.51)
|
||||
<BR>
|
||||
set MOZ_OUT=(optional: specifies location of resultant executable)
|
||||
<BR>
|
||||
set MOZ_SRC=(top of your tree, for example: set MOZ_SRC=d:\mozilla_source
|
||||
if this is the directory where you checked or unzipped the source into)
|
||||
<BR>
|
||||
set MOZ_TOOLS=(the parent directory of the GNU tools 'bin' directory. The build
|
||||
looks for MOZ_TOOLS\bin\gmake.exe, so make sure that the gmake.exe from
|
||||
the Windows Build Tools package resides there.)
|
||||
<BR>
|
||||
set NSPR20=1
|
||||
<BR>
|
||||
set _MSC_VER=1100 (if you are running VC++ 5.0) or 1200
|
||||
(if you are running VC++ 6.0)
|
||||
<BR>
|
||||
</CODE>
|
||||
</UL>
|
||||
<BR>
|
||||
<P>
|
||||
</UL>
|
||||
|
||||
<H2><A NAME="ss2.4">2.4 Run the build </A></H2>
|
||||
<UL>
|
||||
Change to the directory you copied the source into (for example,
|
||||
<CODE>cd d:\mozilla_source</CODE>). If this directory was empty before you
|
||||
installed the source, there should be two directories here:
|
||||
<CODE>README</CODE> and <CODE>mozilla</CODE>.
|
||||
<CODE>
|
||||
<PRE>
|
||||
cd mozilla\config
|
||||
nmake /f makefile.win
|
||||
cd ..
|
||||
nmake /f client.mak
|
||||
</PRE>
|
||||
</CODE>
|
||||
</UL>
|
||||
</UL>
|
||||
|
||||
<HR>
|
||||
<H2><A NAME="s3">3. Common Sticking Points</A></H2>
|
||||
<UL>
|
||||
<LI><B>nmake has a 'fatal error', listing one of the GNU commands and a
|
||||
hexadecimal return code.</B>
|
||||
<UL>
|
||||
This will happen as a result of not having the GNU tools and Windows Build
|
||||
tools in your path. Add the directories with the appropriate binaries to your
|
||||
path.
|
||||
</UL>
|
||||
</LI>
|
||||
<LI>
|
||||
<B>It fails with the message "'.\WIN32' unexpected": </B>
|
||||
<UL>
|
||||
You didn't properly
|
||||
set the environment variables -- you must not include a space at the end
|
||||
of the set statements (be careful if you are cut'n'pasting).
|
||||
</UL>
|
||||
</LI>
|
||||
<LI>
|
||||
<B>It fails to build, with directory-related errors: </B>
|
||||
<UL>
|
||||
The full path
|
||||
to the source must not include any spaces. Additionally, the source must
|
||||
be extracted with an intact directory structure by a utility that understands
|
||||
long filenames. If in doubt, grab Info-Zip at
|
||||
<A HREF="ftp://ftp.cdrom.com/pub/infozip">ftp://ftp.cdrom.com/pub/infozip</A>
|
||||
</UL>
|
||||
</LI>
|
||||
<LI>
|
||||
<B>It fails immediately with the message "Cannot find specified directory":
|
||||
</B>
|
||||
<UL>
|
||||
You didn't properly set the environment variable MOZ_TOOLS;
|
||||
this needs to be set to the path up to, but not including, the final \bin
|
||||
directory in the path to the gnu tools. So, the path to the tool executables
|
||||
is '%MOZ_TOOLS%\bin\<executable>'.
|
||||
</UL>
|
||||
</LI>
|
||||
<LI>
|
||||
<B>I'm not running a 32-bit windows system, how do i build?</B>
|
||||
<UL>
|
||||
Currently, the build process depends on a 32-bit operating system.
|
||||
Windows NT 4.0 is the recommended windows operating system.
|
||||
</UL>
|
||||
</UL>
|
||||
<HR>
|
||||
</BODY>
|
||||
</HTML>
|
||||
400
mozilla/README/mozilla/mac-build.html
Normal file
400
mozilla/README/mozilla/mac-build.html
Normal file
@@ -0,0 +1,400 @@
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>Building Mozilla on the Macintosh PPC platform</TITLE>
|
||||
</HEAD>
|
||||
<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000EE" VLINK="#551A8B"
|
||||
ALINK="#FF0000">
|
||||
<HR>
|
||||
<H1>
|
||||
Building Mozilla on the Macintosh PPC platform</H1>
|
||||
|
||||
<H2>
|
||||
Daniel Nunes, <TT><A HREF="mailto:leaf@netscape.com">leaf@netscape.com</A></TT>
|
||||
</H2>
|
||||
v 1.0, June 1998
|
||||
|
||||
<P>
|
||||
<HR><I>How to build Mozilla on a Macintosh PPC System.</I>
|
||||
<HR>
|
||||
<H2>1. <A HREF="#s1">Introduction</A></H2>
|
||||
|
||||
<H2>2. <A HREF="#s2">Building Mozilla</A></H2>
|
||||
|
||||
<UL>
|
||||
<LI>
|
||||
<A HREF="#ss2.1">2.1 Get the Code </A></LI>
|
||||
|
||||
<LI>
|
||||
<A HREF="#ss2.2">2.2 Requirements</A></LI>
|
||||
|
||||
<LI>
|
||||
<A HREF="#ss2.3">2.3 Set up the Build Environment</A></LI>
|
||||
|
||||
<LI>
|
||||
<A HREF="#ss2.4">2.4 Build the Lizard </A></LI>
|
||||
</UL>
|
||||
|
||||
<H2>3. <A HREF="#s3"> Common Problems </A></H2>
|
||||
|
||||
<H2>4. <A HREF="#s4"> Credits </A></H2>
|
||||
|
||||
<HR>
|
||||
<H2><A NAME="s1">1. Introduction</A></H2>
|
||||
|
||||
<P>
|
||||
What this document is: A guide to building the Mozilla application.
|
||||
This includes:
|
||||
<OL>
|
||||
<LI> A listing of the development tools you will need to build Mozilla. </LI>
|
||||
<LI> A list of environment variables you will need to set before building. </LI>
|
||||
</OL>
|
||||
<P>
|
||||
If you're looking for documentation on developing features or fixing bugs,
|
||||
the Mozilla
|
||||
<A HREF="http://www.mozilla.org/docs/tplist/tplist.html">Technical Documents
|
||||
</A> or <A HREF="http://www.mozilla.org/library.html"> Library </A>
|
||||
are probably what you're looking for.
|
||||
<P>
|
||||
<HR>
|
||||
<H2><A NAME="s2">2. Building Mozilla </A></H2>
|
||||
<P>
|
||||
<UL>Each of the following subsections describes, or gives references to
|
||||
descriptions of, the steps necessary to build Mozilla.
|
||||
<H2><A NAME="ss2.1">2.1 Get the Code</A></H2>
|
||||
<P>
|
||||
<UL>
|
||||
There are two principal ways of getting the code,
|
||||
<A HREF="http://www.mozilla.org/download.html"> ftp</A> and
|
||||
<A HREF="http://www.mozilla.org/cvs.html"> CVS</A>.
|
||||
CVS will provide the most current code for building, but is
|
||||
slower than ftp (takes longer to download).
|
||||
|
||||
</UL>
|
||||
<P>
|
||||
<H2><A NAME="ss2.2">2.2 Requirements</A></H2>
|
||||
The following need to be installed:
|
||||
<UL>
|
||||
<LI>CodeWarrior (CW) 2 - obtainable from
|
||||
<A HREF="http://www.metrowerks.com">Metrowerks</A>.
|
||||
See <A HREF="#s3">Common Sticking Points</A> if you have a different
|
||||
version.
|
||||
</LI>
|
||||
|
||||
<LI>PowerPlant 1.8 - obtainable from the CodeWarrior CD.</LI>
|
||||
|
||||
<LI>MSL - the Metrowerks Standard Library, obtainable from the
|
||||
CodeWarrior CD</LI>
|
||||
|
||||
<LI><A HREF="ftp://ftp.boingo.com//dan/WASTE/waste-13.hqx">WASTE
|
||||
1.3</A></LI>
|
||||
|
||||
<LI><A HREF="http://www.bact.wisc.edu/CWASTEEdit/CWASTEEdit.sit.hqx">CWASTE
|
||||
1.6.2</A></LI>
|
||||
|
||||
<LI>
|
||||
<A HREF="ftp://ftp.scripting.com/userland/menuSharingToolkit4.1.sit.hqx">
|
||||
Menu Sharing Toolkit</A> (from UserLand)</LI>
|
||||
|
||||
<LI>
|
||||
<A HREF="ftp://ftp.digitalalchemy.com/pub/digitalalchemy/mercutio-SDK.sit.bin">
|
||||
Mercutio 1.5 SDK</A> (only download the SDK, not the entire package, else
|
||||
the access paths will be wrong)</LI>
|
||||
|
||||
<LI>
|
||||
<A HREF="ftp://ftp.share.com/pub/internet-configuration/ICProgKit1.4.sit">
|
||||
Internet Config 1.4 SDK</A></LI>
|
||||
|
||||
<LI><A HREF="http://www.mooseyard.com/Jens/Software/">AEGizmos
|
||||
1.4.2</A></LI>
|
||||
|
||||
<LI><A HREF="ftp://sunsite.cnlab-switch.ch/software/platform/macos/perl/Mac_Perl_520r4_tool.bin">
|
||||
MacPerl 5 MPW Tool</A></LI>
|
||||
|
||||
<LI>
|
||||
<A HREF="ftp://sunsite.cnlab-switch.ch/software/platform/macos/perl/Mac_Perl_520r4_appl.bin">MacPerl 5 Application</A></LI>
|
||||
|
||||
<LI>MakeStub - MPW (installed with CodeWarrior Heaven option). If
|
||||
you choose not to install MPW, it is located on the MacOS Tools CD
|
||||
in "CW Pro 2 Tools:CodeWarrior MPW:MPW:Tools"</LI>
|
||||
|
||||
<LI>RunTSScript - in Mozilla source distribution
|
||||
(mozilla:build:mac:RunTSScript), needs to be installed by hand</LI>
|
||||
|
||||
<LI><A HREF="ftp://dev.apple.com/devworld/Tool_Chest/Core_Mac_OS_Tools/MPW_etc./MPW-GM/MPW/ToolServer.sit.hqx">ToolServer</A>
|
||||
- or in the CW distribution (CW Pro 2 Tools:Apple Development
|
||||
Tools:ToolServer 3.4.1.sit). <B>We recommend pulling it off the
|
||||
CD</B> because it comes with configuration files for CodeWarrior
|
||||
which you would have to create manually were you to pull it off
|
||||
the net.</LI>
|
||||
|
||||
<LI>
|
||||
<A HREF="http://people.netscape.com/sfraser/software/NewAlias_tool.sit.hqx">
|
||||
New Alias MPW Tool</A> An MPW tool that creates Finder aliases for files.
|
||||
</LI>
|
||||
|
||||
<LI>StreamEdit MPW Tool - MPW (installed with CodeWarrior Heaven option). If
|
||||
you choose not to install MPW, it is located on the MacOS Tools CD
|
||||
in "CW Pro 2 Tools:CodeWarrior MPW:MPW:Tools"</LI>
|
||||
</LI>
|
||||
|
||||
<LI>
|
||||
<A HREF="ftp://dev.apple.com/devworld/Periodicals/develop/develop25/develop_Issue_25_code/ToolFrontEnd.sit.hqx">ToolFrontEnd</A></LI>
|
||||
|
||||
<LI>
|
||||
<A HREF="http://sunsite.cnlab-switch.ch/ftp/software/platform/macos/src/HTML/MPW_C.html">
|
||||
patch 2.1</A></LI>
|
||||
</UL>
|
||||
|
||||
<P>
|
||||
Hardware/OS
|
||||
<UL>
|
||||
<LI>To build Navigator, you need a fast PPC Mac. The faster the
|
||||
better. You can't build with a 68K machine because we have too many
|
||||
resources, and the build process will crash when trying to generate
|
||||
resources out of our cross-platform strings. See the discussion below
|
||||
for a way around this.
|
||||
</LI>
|
||||
<LI>You will need about 96 MB of physical RAM to "fast link" the app.
|
||||
You can still fast link if you give your machine 96 MB of virtual
|
||||
memory, but then the VM hit is large enough to counteract any
|
||||
improvement. One of our beta testers had a machine with only 64MB of
|
||||
physical RAM (VM was off) and it ran out of memory trying to link.
|
||||
Turning VM on got it to link, but build time increased greatly.
|
||||
</LI>
|
||||
<LI>Reports from the net indicate that the optimized version
|
||||
(MozillaPPC) take much less RAM to build than the 96MB we suggest. If
|
||||
you are running out of memory, try building that instead of the debug
|
||||
version (the debug symbols require a lot of RAM come link time).
|
||||
</LI>
|
||||
<LI>You should be ok with a 400MB disk partition, even when fully
|
||||
built. This does not include tools like the IDE, just source.
|
||||
</LI>
|
||||
<LI>On an HFS+ volume, a full build takes about 110MB. HFS+ is good,
|
||||
but utilities are sparse.
|
||||
</LI>
|
||||
</UL>
|
||||
<P>
|
||||
<H2><A NAME="ss2.3">2.3 Setup the Build Environment</A></H2>
|
||||
<P>
|
||||
<OL>
|
||||
<LI>Install CodeWarrior from the CD. While it is large, installing
|
||||
the "CodeWarrior Heaven" option will guarantee that you have
|
||||
everything you need. This will give you PowerPlant, MSL, and MPW.
|
||||
If you choose to install less, proceed at your own risk.</LI>
|
||||
|
||||
<LI>In the Finder, increase the memory partition of the IDE to
|
||||
15MB (you can get by with 12, if need be).</LI>
|
||||
|
||||
<LI>Download ToolFrontEnd. After expanding it, in "ToolFrontEnd
|
||||
Folder:Drop-Ins" there are three items:
|
||||
|
||||
<UL>
|
||||
<LI><I>#include</I></LI>
|
||||
|
||||
<LI><I>ToolFrontEnd</I></LI>
|
||||
|
||||
<LI><I>ToolFrontEnd Panel</I></LI>
|
||||
</UL>
|
||||
|
||||
<P>Create a folder named "Include Scanners". Place the file
|
||||
"#include" into the Include Scanners folder. Move the Include
|
||||
Scanners folder to the CodeWarrior Plugins folder. Create a folder
|
||||
named "ToolFrontEnd". Place the files "ToolFrontEnd" and
|
||||
"ToolFrontEnd Panel" into the ToolFrontEnd folder. Place this
|
||||
folder in the CodeWarrior Plugins folder.</P></LI>
|
||||
|
||||
<LI>Open "ToolFrontEnd Panel" with ResEdit. Change the file type
|
||||
from <B>'Panl'</B> to <B>'PanL'</B>. Save.</LI>
|
||||
|
||||
<LI>Uncompress the StuffIt Archive for ToolServer. The goal is to
|
||||
let ToolServer and MPW share the same Tools directory so you don't
|
||||
need to have multiple versions of tools. Do the following:
|
||||
|
||||
<OL>
|
||||
<LI>Open ToolServer's Tools folder. There is one file called
|
||||
"RMetrowerks". </LI>
|
||||
|
||||
<LI>Move RMetrowerks to Tools folder of MPW. MPW folder must be
|
||||
at "Metrowerks:Codewarrior MPW:MPW" if you installed
|
||||
Codewarrior Heaven. </LI>
|
||||
|
||||
<LI>Remove ToolServer's Tools folder.</LI>
|
||||
|
||||
<LI>Now create an alias of Tools folder in "CodeWarrior MPW"
|
||||
and move it to your ToolServer folder. Rename the alias
|
||||
(probably called "Tools alias") to "Tools"</LI>
|
||||
|
||||
|
||||
<LI><FONT COLOR="#FF0000"><B>IMPORTANT</B></FONT>: Make sure
|
||||
you only have one instance of ToolServer on your machine. If
|
||||
the build script finds the wrong one, the correct tools will
|
||||
not be found and strange things will happen.</LI>
|
||||
</OL>
|
||||
</LI>
|
||||
|
||||
<LI>After installing the MacPerl MPW Tool distribution (run the
|
||||
InstallerVISE application), in the "MacPerl ƒ" folder, there
|
||||
will be an MPW tool named "perl". Install this in MPW's tools
|
||||
folder.</LI>
|
||||
|
||||
<LI>Install the MacPerl Application (run the
|
||||
InstallerVISE application). You can install this anywhere, but it is
|
||||
recommended that you install it inside of your CodeWarrior folder for
|
||||
easy reference. After installation, you will need to set a preference
|
||||
to enable double-click launch of the perl scripts. This preference is set
|
||||
by going under the Edit Menu to Preferences. Click on the "Script" button
|
||||
and hit the radio button "Run Scripts opened from Finder"</LI>
|
||||
|
||||
<LI>Install the "patch", "MakeStub", "NewAlias" and "StreamEdit" Tools in the
|
||||
tools
|
||||
folder. Note that "MakeStub" and "StreamEdit" are automatically installed by the
|
||||
"CodeWarrior Heaven" install option.</LI>
|
||||
|
||||
<LI>Install RunTSScript (found in the Mozilla source distribution)
|
||||
in the compilers folder in your build environment
|
||||
("Metrowerks:Metrowerks Codewarrior:Codewarrior
|
||||
Plugins:Compilers")</LI>
|
||||
|
||||
<LI>Next, after downloading all the 3rd party software components,
|
||||
drag WASTE, CWASTE, Menu Sharing, Mercutio, Internet Config, and
|
||||
the AEGizmo folders (just as they are) into the "MacOS Support"
|
||||
folder in your build environment.</LI>
|
||||
|
||||
<LI>Start ToolServer from within CodeWarrior (or use MPW if you
|
||||
are brave enough). We're about to patch some files. Make sure the
|
||||
ToolServer menu is in the CodeWarrior menu bar by turning on the
|
||||
<A HREF="IDEPrefs.gif">preference</A> under the "Extras" panel in
|
||||
the IDE Preferences (not the project preferences!). The menu bar
|
||||
should look like this:
|
||||
|
||||
|
||||
<P><IMG SRC="IDEMenuBar.gif" WIDTH=359 HEIGHT=20 X-CLARIS-USEIMAGEWIDTH X-CLARIS-USEIMAGEHEIGHT ALIGN=bottom></P>
|
||||
|
||||
<P>Choose "Start ToolServer" from the ToolServer menu (this is the
|
||||
icon menu between "Window" and "Help" in the menubar above). You
|
||||
will now see a window with no close box. This is your ToolServer
|
||||
Worksheet where you will type (or cut & paste) the commands
|
||||
for the following steps.</P>
|
||||
|
||||
<P>In case you have never used MPW/ToolServer before, the
|
||||
following is <B>very important</B>. Pressing "return" does not
|
||||
execute commands like you might think. It just inserts a newline
|
||||
into the worksheet like a normal text editor. <B>To actually get
|
||||
ToolServer to execute the command, you must press "Enter" (lower
|
||||
right of numeric keypad).</B> This executes the line that the
|
||||
cursor is on, and only that line. If you want to execute multiple
|
||||
lines at once, select them all and hit Enter.</P></LI>
|
||||
|
||||
<LI>Set the shell variables {IDE} and {Source} to the correct
|
||||
paths for your build environment. {IDE} is where your CodeWarrior
|
||||
IDE is located. {Source} is the folder containing the toplevel
|
||||
"ns" folder of the Mozilla source. Mine look like this (don't
|
||||
forget to keep the quotes if your path includes spaces), yours
|
||||
will almost certainly be different (<FONT COLOR="#FF0000">to
|
||||
punctuate this, the things you need to change are in red</FONT>).
|
||||
|
||||
<PRE>Set IDE "<FONT COLOR="#FF0000">Develop:Source331 Build Environment:CW Pro 2:Metrowerks CodeWarrior:</FONT>"
|
||||
Set Source "<FONT COLOR="#FF0000">Source:FreeSource:</FONT>"</PRE>
|
||||
</LI>
|
||||
|
||||
<LI>If you are using CWPro2, execute the following lines to patch
|
||||
LDropFlag to draw correcly over non-white backgrounds.
|
||||
|
||||
<PRE>directory "{IDE}MacOS Support:PowerPlant:_In Progress:_Table Classes:"
|
||||
patch LDropFlag.cp "{Source}mozilla:lib:mac:patches:LDropFlag.patch"
|
||||
duplicate -y "{Source}mozilla:lib:mac:patches:DropFlag Icons.rsrc" "{IDE}MacOS Support:PowerPlant:PowerPlant Resources:"</PRE></LI>
|
||||
|
||||
<LI>Execute the following lines to patch menusharing.c to allow it
|
||||
to compile with the new Universal Headers. It references an
|
||||
obsolete header file (GestaltEqu.h).
|
||||
|
||||
<PRE>directory "{IDE}MacOS Support:Menu Sharing Toolkit 4.1:"
|
||||
patch menusharing.c "{Source}mozilla:lib:mac:patches:menusharing.patch"</PRE></LI>
|
||||
|
||||
|
||||
<LI>If you are using CWPro2 straight off the CD, you need to patch
|
||||
AppleEvents.r to fix a problem with the Universal Headers (the
|
||||
definition of the 'aedt' resource was omitted). <B>You do not have
|
||||
to do this if you have applied the netborne patch to Pro2e
|
||||
</B> because it has been fixed.
|
||||
|
||||
<PRE>directory "{IDE}MacOS Support:Headers:Rez Headers:"
|
||||
patch AppleEvents.r "{Source}mozilla:lib:mac:patches:AppleEvents.r.patch"</PRE></LI>
|
||||
|
||||
<LI>You need to patch stat.mac.h to fix a problem in MSL where
|
||||
lines were omitted.
|
||||
|
||||
<PRE>directory "{IDE}Metrowerks Standard Library:MSL C:MSL Mac:Public Includes"
|
||||
patch stat.mac.h "{Source}mozilla:lib:mac:patches:stat.mac.h.patch"</PRE></LI>
|
||||
|
||||
<LI>Congratulations! Now you are ready to build. Once these steps
|
||||
are done, you don't have to repeat these setups the next
|
||||
time!</LI>
|
||||
</OL>
|
||||
|
||||
|
||||
<P>
|
||||
|
||||
<H2><A NAME="ss2.4">2.4 Run the build </A></H2>
|
||||
<UL>
|
||||
<P>In the folder mozilla:build:mac:, there are several Perl scripts with
|
||||
names of the form BuildMozillaXXX.pl, where XXX is "Optimized",
|
||||
"Debug", "Tinderbox", et al. Each script builds the corresponding
|
||||
version of Mozilla. If you configured the MacPerl application to
|
||||
execute scripts that are opened from the finder, all you have to do is
|
||||
double click on the appropriate one; otherwise, launch MacPerl, and
|
||||
run the appropriate script from the "Run Script..." menu item.</P>
|
||||
|
||||
<P>These `configured build' scripts are simple, and you might want to
|
||||
make your own to force your build to StopForErrors(), or alternatively
|
||||
DontStopForErrors(), et al. You can set up certain build-script
|
||||
variables and (soon) compile-time flags. Compare the supplied scripts
|
||||
to figure out what you might want. Note that CodeWarriorLib, Moz.pm,
|
||||
and BuildList.pm, are AppleScript libraries and Perl modules meant to
|
||||
be used by a `configured build'. Use your favorite POD viewer (Shuck
|
||||
comes with MacPerl) to view the documentation in the Perl scripts.</P>
|
||||
|
||||
<P>If there were any errors in any of the projects along the way, the
|
||||
script will stop at that point and the IDE will tell you the errors.
|
||||
You can fix them and make sure they current project builds, but to
|
||||
continue the automation, you have to start from the beginning by
|
||||
double-clicking the script again. This isn't quite as bad as it
|
||||
sounds because the previous projects are already built (unless you
|
||||
changed some major header file). Please note that stopping the script
|
||||
once it has started is difficult. We are working to address
|
||||
this issue.</P>
|
||||
|
||||
<P>After the build is complete, you can find aliases to the built libraries
|
||||
and the final Mozilla application. Debug builds are built to
|
||||
Mozilla:dist:client_debug, while optimized builds are built to Mozilla:dist:client.
|
||||
</P>
|
||||
|
||||
<P>Don't worry too much about the numerous warnings generated during
|
||||
the build. We try our best to get the XP teams to use real compilers,
|
||||
but alas, they continue to write warning-laden code. There is also
|
||||
some generated code (Java is one example) that has a lot of warnings
|
||||
that we can't help either. If you write any new code, please help us
|
||||
in our quest to get zero warnings.</P>
|
||||
|
||||
</UL>
|
||||
</UL>
|
||||
|
||||
<HR>
|
||||
<H2><A NAME="s3">3. Common Sticking Points</A></H2>
|
||||
<UL>
|
||||
<LI><B>I have CodeWarrior3, how do i build with it?</B>
|
||||
<UL> Currently, the answer is, "You don't." Eventually, the distribution
|
||||
will be modified to allow building using CodeWarrior3, but for now
|
||||
CodeWarrior2 is the only IDE that is supported.
|
||||
</UL>
|
||||
</LI>
|
||||
</UL>
|
||||
<HR>
|
||||
<H2><A NAME="s4">4. Credits</A></H2>
|
||||
<UL>
|
||||
The majority of this document is taken from the build document included
|
||||
in the Mozilla source distribution at README:mozilla:macbuild.htm written
|
||||
by Mike Pinkerton, <A HREF="mailto:pinkerton@netscape.com">
|
||||
pinkerton@netscape.com</A>.
|
||||
</BODY>
|
||||
</HTML>
|
||||
163
mozilla/README/mozilla/unix-build.html
Normal file
163
mozilla/README/mozilla/unix-build.html
Normal file
@@ -0,0 +1,163 @@
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>Building the Mozilla client on unix platforms</TITLE>
|
||||
</HEAD>
|
||||
<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000EE" VLINK="#551A8B"
|
||||
ALINK="#FF0000">
|
||||
<HR>
|
||||
<H1>Building the Mozilla client on Unix platforms</H1>
|
||||
|
||||
<H2>
|
||||
Daniel Nunes, <TT><A HREF="mailto:leaf@mozilla.org">leaf@mozilla.org</A></TT></H2>
|
||||
v 1.2, 1998-11-02
|
||||
|
||||
<P>
|
||||
<HR><I>How to build Mozilla on a Unix System.</I>
|
||||
<HR>
|
||||
<H2>1. <A HREF="#s1">Introduction</A></H2>
|
||||
|
||||
<H2>2. <A HREF="#s2">Building Mozilla</A></H2>
|
||||
|
||||
<UL>
|
||||
<LI>
|
||||
<A HREF="#ss2.1">2.1 Get the Code </A></LI>
|
||||
|
||||
<LI>
|
||||
<A HREF="#ss2.2">2.2 Requirements</A></LI>
|
||||
|
||||
<LI>
|
||||
<A HREF="#ss2.3">2.3 Build the Lizard</A></LI>
|
||||
|
||||
<LI>
|
||||
<A HREF="#ss2.4">2.4 After the Build</A></LI>
|
||||
</UL>
|
||||
|
||||
<H2>3. <A HREF="#s3"> Common Problems </A></H2>
|
||||
|
||||
<HR>
|
||||
<H2><A NAME="s1">1. Introduction</A></H2>
|
||||
|
||||
<P>
|
||||
Perhaps you are interested in building classic Mozilla, before the
|
||||
fall of the old layout engine, and the rise of the new. If so, the
|
||||
<B><A HREF="classic-unix.html">Classic Mozilla Build document</A></B>
|
||||
is what you're looking for.
|
||||
|
||||
<P>
|
||||
|
||||
<P>
|
||||
What this document is: A guide to building the Mozilla application.
|
||||
<BR>
|
||||
This includes:
|
||||
<OL>
|
||||
<LI> A listing of the development tools you will need to build Mozilla. </LI>
|
||||
<LI> A sample set of commands to build Mozilla using the Autoconf
|
||||
build system. </LI>
|
||||
</OL>
|
||||
<P>
|
||||
If you're looking for documentation on developing features or fixing bugs,
|
||||
the Mozilla
|
||||
<A HREF="../tplist.html">Technical Documents</A> or
|
||||
<A HREF="../../../library.html"> Library </A>
|
||||
are probably what you're looking for.
|
||||
<P>
|
||||
<HR>
|
||||
<H2><A NAME="s2">2. Building Mozilla </A></H2>
|
||||
<P>
|
||||
<UL>Each of the following subsections describes, or gives references to
|
||||
descriptions of, the steps necessary to build Mozilla.
|
||||
</UL>
|
||||
<UL>
|
||||
<H2><A NAME="ss2.1">2.1 Get the Code</A></H2>
|
||||
<P>
|
||||
<UL>
|
||||
|
||||
Eventually, there will be two principal ways of getting the code,
|
||||
<A HREF="../../../download.html"> ftp</A> and
|
||||
<A HREF="../../../cvs.html"> CVS</A>.
|
||||
CVS will provide the most current code for building, but is
|
||||
slower than ftp. Ftp drops are generally produced once per month,
|
||||
and are known to compile on some machine, somewhere.
|
||||
|
||||
<B>For now</B>, however, you must do the following to obtain the newest
|
||||
browser source:
|
||||
<BR>
|
||||
<CODE>
|
||||
cvs co mozilla/nglayout.mk<BR>
|
||||
cd mozilla<BR>
|
||||
gmake -f nglayout.mk pull_all<BR>
|
||||
</CODE>
|
||||
<BR>
|
||||
This should pull all the right source.
|
||||
</UL>
|
||||
<P>
|
||||
<H2><A NAME="ss2.2">2.2 Requirements</A></H2>
|
||||
<UL>
|
||||
The following should be installed:
|
||||
<UL>
|
||||
<LI>Motif 1.2
|
||||
<LI>The native C/C++ compiler (or GNU C/C++ compiler 2.7.2 in lieu of the
|
||||
native compiler)
|
||||
<LI>GNU make 3.74 or better
|
||||
<LI>Perl5
|
||||
<LI><A HREF="../../../projects/autoconf/">Autconf</A> requirements,
|
||||
including NSPR.
|
||||
<LI><CODE>LD_LIBRARY_PATH</CODE> must include the path to the NSPR
|
||||
shared objects.<BR>
|
||||
For most people, this means adding <CODE>/usr/local/nspr/lib</CODE>
|
||||
to <CODE>LD_LIBRARY_PATH</CODE>
|
||||
(either:
|
||||
<BR>
|
||||
<CODE>setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/usr/local/nspr/lib</CODE>
|
||||
<BR>
|
||||
or
|
||||
<BR>
|
||||
<CODE>export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/nspr/lib</CODE>
|
||||
.<BR>
|
||||
If you get an error like "No such variable" then omit the
|
||||
<CODE>${LD_LIBRARY_PATH}:</CODE> part
|
||||
)
|
||||
</UL>
|
||||
<P>
|
||||
Your hardware should be equal to, or better than:
|
||||
<UL>
|
||||
32 MB RAM, 128 MB swap (64 MB RAM recommended)
|
||||
</UL>
|
||||
</UL>
|
||||
<P>
|
||||
<H2><A NAME="ss2.3">2.3 Build the Lizard</A></H2>
|
||||
<P>
|
||||
<UL>
|
||||
<CODE>
|
||||
autoconf<BR>
|
||||
mkdir obj-`./build/autoconf/config.guess`<BR>
|
||||
cd obj-`./build/autoconf/config.guess`<BR>
|
||||
../configure --with-nspr=/usr/local/nspr --enable-toolkit=motif<BR>
|
||||
gmake depend<BR>
|
||||
gmake<BR>
|
||||
</CODE>
|
||||
</UL>
|
||||
<H2><A NAME="ss2.4">2.4 After the build </A></H2>
|
||||
<UL>
|
||||
|
||||
<LI> <CODE>cd dist/bin</CODE> and you should see links to the objects you
|
||||
need to run <CODE>main</CODE>.
|
||||
|
||||
<LI>On most unixen LD_LIBRARY_PATH must be set to wherever the necessary
|
||||
libraries are.
|
||||
|
||||
<UL>
|
||||
<LI>On HP-UX, the equivalent environment variable is <CODE>SHLIB_PATH</CODE>.
|
||||
<LI>On AIX, the equivalent environment variable is <CODE>LIBPATH</CODE>.
|
||||
</UL>
|
||||
</UL>
|
||||
</UL>
|
||||
<HR>
|
||||
<H2><A NAME="s3">3. Common Sticking Points</A></H2>
|
||||
<LI>I'm sure there are bound to be some. Send
|
||||
<A HREF="mailto:leaf@mozilla.org"> me</A> mail.
|
||||
<HR>
|
||||
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
209
mozilla/README/mozilla/win-build.html
Normal file
209
mozilla/README/mozilla/win-build.html
Normal file
@@ -0,0 +1,209 @@
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>Building Mozilla on Microsoft Windows 32-bit platforms</TITLE>
|
||||
</HEAD>
|
||||
<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000EE" VLINK="#551A8B"
|
||||
ALINK="#FF0000">
|
||||
<HR>
|
||||
<H1>
|
||||
Building Mozilla on Microsoft Windows 32-bit platforms</H1>
|
||||
|
||||
<H2>
|
||||
Daniel Nunes, <TT><A HREF="mailto:leaf@netscape.com">leaf@netscape.com</A></TT>
|
||||
</H2>
|
||||
v 1.0, June 1998
|
||||
|
||||
<P>
|
||||
<HR><I>How to build Mozilla on a Microsoft Windows 32-bit System.</I>
|
||||
<HR>
|
||||
<H2>1. <A HREF="#s1">Introduction</A></H2>
|
||||
|
||||
<H2>2. <A HREF="#s2">Building Mozilla</A></H2>
|
||||
|
||||
<UL>
|
||||
<LI>
|
||||
<A HREF="#ss2.1">2.1 Get the Code </A></LI>
|
||||
|
||||
<LI>
|
||||
<A HREF="#ss2.2">2.2 Requirements</A></LI>
|
||||
|
||||
<LI>
|
||||
<A HREF="#ss2.3">2.3 Set up the Build Environment</A></LI>
|
||||
|
||||
<LI>
|
||||
<A HREF="#ss2.4">2.4 Build the Lizard </A></LI>
|
||||
</UL>
|
||||
|
||||
<H2>3. <A HREF="#s3"> Common Problems </A></H2>
|
||||
|
||||
<HR>
|
||||
<H2><A NAME="s1">1. Introduction</A></H2>
|
||||
|
||||
<P>
|
||||
What this document is: A guide to building the Mozilla application.
|
||||
<BR>
|
||||
This includes:
|
||||
<OL>
|
||||
<LI> A listing of the development tools you will need to build Mozilla. </LI>
|
||||
<LI> A list of environment variables you will need to set before building. </LI>
|
||||
</OL>
|
||||
<P>
|
||||
If you're looking for documentation on developing features or fixing bugs,
|
||||
the Mozilla
|
||||
<A HREF="http://www.mozilla.org/docs/tplist/tplist.html">Technical Documents
|
||||
</A> or <A HREF="http://www.mozilla.org/library.html"> Library </A>
|
||||
are probably what you're looking for.
|
||||
<P>
|
||||
<HR>
|
||||
<H2><A NAME="s2">2. Building Mozilla </A></H2>
|
||||
<P>
|
||||
<UL>Each of the following subsections describes, or gives references to
|
||||
descriptions of, the steps necessary to build Mozilla.
|
||||
<H2><A NAME="ss2.1">2.1 Get the Code</A></H2>
|
||||
<P>
|
||||
<UL>
|
||||
There are two principal ways of getting the code,
|
||||
<A HREF="http://www.mozilla.org/download.html"> ftp</A> and
|
||||
<A HREF="http://www.mozilla.org/cvs.html"> CVS</A>.
|
||||
CVS will provide the least outdated code for building, but is
|
||||
slower than ftp.
|
||||
|
||||
</UL>
|
||||
<P>
|
||||
<H2><A NAME="ss2.2">2.2 Requirements</A></H2>
|
||||
<UL>
|
||||
The following need to be installed:
|
||||
<UL>
|
||||
<LI>Microsoft Visual C++ version 4.2 or later
|
||||
<LI>GNU Tools for Microsoft Windows, located:
|
||||
<UL>
|
||||
<LI><A HREF="http://www.cygnus.com/misc/gnu-win32">Cygnus</A></LI>
|
||||
<LI><A HREF="http://www.gnu.org/order/ftp.html">GNU home page</A></LI>
|
||||
<LI><A HREF="ftp://prep.ai.mit.edu/pub/gnu">MIT</A></LI>
|
||||
</UL>
|
||||
Specifically, you'll need:
|
||||
<UL><CODE>
|
||||
cp.exe<BR>
|
||||
rm.exe<BR>
|
||||
uname.exe<BR>
|
||||
</CODE>
|
||||
</UL>
|
||||
Netscape has internally modified version of gmake, shmsdos and win32gnu
|
||||
that we use to get around some problems we were having keeping in sync
|
||||
with the Unix version of gmake. This version of gmake can be found in the
|
||||
Windows Build Tools package, which can be ftp'd from
|
||||
<A HREF="http://www.mozilla.org/download-mozilla.html"> the Mozilla
|
||||
Download page</A>.
|
||||
The three files you will need are:
|
||||
<UL><CODE>
|
||||
gmake.exe<BR>
|
||||
shmsdos.exe<BR>
|
||||
uname.exe<BR>
|
||||
</CODE>
|
||||
</UL>
|
||||
|
||||
</UL>
|
||||
<P>
|
||||
Hardware/OS
|
||||
<UL>
|
||||
<LI>Pentium 133 MHz or better</LI>
|
||||
<LI>64 MB RAM, 128 MB recommended</LI>
|
||||
<LI>250 MB NTFS or 500 MB FAT disk space</LI>
|
||||
<LI>NT 4.0 is preferred; NT 3.51 will also work.
|
||||
</LI>
|
||||
</UL>
|
||||
</UL>
|
||||
<P>
|
||||
<H2><A NAME="ss2.3">2.3 Setup the Build Environment</A></H2>
|
||||
<P>
|
||||
<UL>
|
||||
The following environment variables need to be set:
|
||||
<UL>
|
||||
<CODE>
|
||||
set MOZ_BITS=32
|
||||
<BR>
|
||||
set MOZ_DEBUG=1 (set this only if you want to build a debug build)
|
||||
<BR>
|
||||
set MOZ_GOLD=1
|
||||
<BR>
|
||||
set MOZ_MEDIUM=1
|
||||
<BR>
|
||||
set MOZ_NT=351 (if running NT3.51)
|
||||
<BR>
|
||||
set MOZ_OUT=(optional: specifies location of resultant executable)
|
||||
<BR>
|
||||
set MOZ_SRC=(top of your tree, for example: set MOZ_SRC=d:\mozilla_source
|
||||
if this is the directory where you checked or unzipped the source into)
|
||||
<BR>
|
||||
set MOZ_TOOLS=(location of the bin directory of your GNU tools. The build
|
||||
looks for MOZ_TOOLS\bin\gmake.exe, so make sure that the gmake.exe from
|
||||
the Windows Build Tools package resides there.)
|
||||
<BR>
|
||||
set NO_SECURITY=1
|
||||
<BR>
|
||||
set NSPR20=1
|
||||
<BR>
|
||||
set _MSC_VER=1100 (if you are running VC++ 5.0 or higher)
|
||||
<BR>
|
||||
</CODE>
|
||||
</UL>
|
||||
<BR>
|
||||
<P>
|
||||
</UL>
|
||||
|
||||
<H2><A NAME="ss2.4">2.4 Run the build </A></H2>
|
||||
<UL>
|
||||
Change to the directory you copied the source into (for example,
|
||||
<CODE>cd d:\mozilla_source</CODE>). If this directory was empty before you
|
||||
installed the source, there should be two directories here:
|
||||
<CODE>README</CODE> and <CODE>mozilla</CODE>.
|
||||
<CODE>
|
||||
<PRE>
|
||||
cd mozilla\config
|
||||
nmake /f makefile.win
|
||||
cd ..
|
||||
nmake /f client.mak
|
||||
</PRE>
|
||||
</CODE>
|
||||
</UL>
|
||||
</UL>
|
||||
|
||||
<HR>
|
||||
<H2><A NAME="s3">3. Common Sticking Points</A></H2>
|
||||
<UL>
|
||||
<LI><B>nmake has a 'fatal error', listing one of the GNU commands and a
|
||||
hexadecimal return code.</B>
|
||||
<UL>
|
||||
This will happen as a result of not having the GNU tools and Windows Build
|
||||
tools in your path. Add the directories with the appropriate binaries to your
|
||||
path.
|
||||
</UL>
|
||||
</LI>
|
||||
<LI>
|
||||
<B>It fails with the message "'.\WIN32' unexpected": </B>
|
||||
<UL>
|
||||
You didn't properly
|
||||
set the environment variables -- you must not include a space at the end
|
||||
of the set statements (be careful if you are cut'n'pasting).
|
||||
</UL>
|
||||
</LI>
|
||||
<LI>
|
||||
<B>It fails to build, with directory-related errors: </B>
|
||||
<UL>
|
||||
The full path
|
||||
to the source must not include any spaces. Additionally, the source must
|
||||
be extracted with an intact directory structure by a utility that understands
|
||||
long filenames. If in doubt, grab Info-Zip at
|
||||
<A HREF="ftp://ftp.cdrom.com/pub/infozip">ftp://ftp.cdrom.com/pub/infozip</A>
|
||||
</UL>
|
||||
</LI>
|
||||
<LI>
|
||||
<B>I'm not running a 32-bit windows system, how do i build?</B>
|
||||
<UL>
|
||||
Currently, the build process depends on a 32-bit operating system.
|
||||
Windows NT 4.0 is the recommended windows operating system.
|
||||
</UL>
|
||||
</UL>
|
||||
<HR>
|
||||
</BODY>
|
||||
</HTML>
|
||||
53
mozilla/README/mozilla/wininstall.htm
Normal file
53
mozilla/README/mozilla/wininstall.htm
Normal file
@@ -0,0 +1,53 @@
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
|
||||
<META NAME="Author" CONTENT="Chris Yeh">
|
||||
<META NAME="GENERATOR" CONTENT="Mozilla/4.05 [en]C-NSCP (WinNT; U) [Netscape]">
|
||||
<TITLE>Running Mozilla...</TITLE>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
|
||||
<H2>
|
||||
<FONT FACE="Arial,Helvetica">Running Mozilla Without Trashing Netscape
|
||||
Installation</FONT></H2>
|
||||
This document explains how to run <TT>mozilla.exe</TT> separately from
|
||||
<TT>netscape.exe</TT> without trashing your regular installation of Netscape
|
||||
Communicator. This is necessary if, for example, you want to use Communicator's
|
||||
mail client while you work on Mozilla development.
|
||||
<BR>
|
||||
<HR WIDTH="100%">
|
||||
<OL>
|
||||
<LI>
|
||||
Before running <TT>mozilla.exe</TT>, create a new user profile either from
|
||||
a Netscape 4.0x installation using the "User Profile Manager" shortcut
|
||||
in the Utilities folder (on Windows) or by using the <TT>-new_account</TT>
|
||||
option on the command line of either <TT>netscape.exe</TT> or <TT>mozilla.exe</TT>.
|
||||
We suggest calling the profile "<TT>mozilla</TT>."</LI>
|
||||
|
||||
<LI>
|
||||
Always use that new account when running <TT>mozilla.exe</TT>, and never
|
||||
run <TT>netscape.exe</TT> using that same account profile.</LI>
|
||||
</OL>
|
||||
To make things easier, you can start the application with the user account
|
||||
on the command line, for example:
|
||||
<UL><TT>mozilla.exe -P"mozilla"</TT></UL>
|
||||
This assures that prefs and the cache will not interfere between the two
|
||||
versions. This will be especially
|
||||
<BR>important as new prefs are added to the Mozilla product. Note that
|
||||
you must use quotes around the name and there can be no space between the
|
||||
"P" and the profile name. Otherwise, the application won't catch the profile
|
||||
switch, and it will try to load the profile name as the initial URL.
|
||||
|
||||
<P>
|
||||
<HR WIDTH="100%">
|
||||
<BR>You can copy your <TT>bookmark.htm</TT> file from an existing profile
|
||||
to your new profile directory if you want to share bookmarks.
|
||||
|
||||
<P>After the initial 3/31 release, we will add some code to Mozilla to
|
||||
prevent running with a profile that is already being used by <TT>netscape.exe</TT>.
|
||||
<BR>
|
||||
<HR WIDTH="100%">
|
||||
<BR><FONT SIZE=-1>Copyright © 1998 <A HREF="http://home.netscape.com/misc/contact_info.html">Netscape
|
||||
Communications Corporation</A></FONT>
|
||||
</BODY>
|
||||
</HTML>
|
||||
184
mozilla/README/nglayout/winbuild.html
Normal file
184
mozilla/README/nglayout/winbuild.html
Normal file
@@ -0,0 +1,184 @@
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=x-mac-roman">
|
||||
<META NAME="GENERATOR" CONTENT="Mozilla/4.04 [en] (WinNT; I) [Netscape]">
|
||||
<META NAME="KeyWords" CONTENT="client, source, documentation">
|
||||
<META NAME="Author" CONTENT="Kipp E.B. Hickman">
|
||||
<TITLE>NGLayout Windows Build Instructions</TITLE>
|
||||
</HEAD>
|
||||
<BODY BGCOLOR="#FFFFFF">
|
||||
|
||||
<H2>
|
||||
<FONT FACE="Arial,Helvetica">NGLayout Windows Build Instructions</FONT></H2>
|
||||
This document explains how to build NGLayout for the Windows platform.
|
||||
<HR><B><FONT SIZE=+1>Required Tools:</FONT></B>
|
||||
<UL>
|
||||
<LI>
|
||||
<B>Microsoft Visual C++ version 4.2 or later</B></LI>
|
||||
|
||||
<LI>
|
||||
<B>The same set of tools for building <A HREF="http://www.mozilla.org/docs/tplist/catBuild/winbuild.htm">Mozilla</A></B></LI>
|
||||
</UL>
|
||||
<B><FONT SIZE=+1>Setting up:</FONT></B>
|
||||
<UL>
|
||||
<LI>
|
||||
You need a Pentium with at least a 133 MHz processor and at least 250 megs
|
||||
(NTFS partition) or 500 megs (FAT partition) of hard drive space. You need
|
||||
to have a minimum of 64 megs of memory in order to build this tree. These
|
||||
numbers are approximations.</LI>
|
||||
|
||||
<LI>
|
||||
The preferred platform is NT 4.0. NT 3.51 will also work, and Win95 might
|
||||
work if you're lucky. Maybe.</LI>
|
||||
|
||||
<LI>
|
||||
Install MSVC. If you don't choose to have the MSVC install modify your
|
||||
environment variables for PATH, INCLUDE, and LIB information, be sure to
|
||||
run VCVARS32.BAT out of the MSVC bin directory prior to attempting to build.</LI>
|
||||
|
||||
<LI>
|
||||
Download and install GNU tools. Put them in your path.</LI>
|
||||
|
||||
<LI>
|
||||
Install NGLayout source.</LI>
|
||||
|
||||
<UL>
|
||||
<LI>
|
||||
cd <your-source-area></LI>
|
||||
|
||||
<LI>
|
||||
unzip -o -q win-19980415.zip</LI>
|
||||
</UL>
|
||||
|
||||
<LI>
|
||||
There are several environment variables you will need to set, either manually
|
||||
or via a script within a command session, or by setting them in your system
|
||||
environment located through the Control Panel | System icon.</LI>
|
||||
|
||||
|
||||
<P> <B>Note: There is an additional variable for building NGLayout!
|
||||
Use this list carefully!</B>
|
||||
|
||||
<P> The variables are:
|
||||
<UL>
|
||||
<LI>
|
||||
set MOZ_BITS=32</LI>
|
||||
|
||||
<LI>
|
||||
set MOZ_DEBUG=1 (don't set this if you want to build an optimized release
|
||||
build)</LI>
|
||||
|
||||
<LI>
|
||||
set MOZ_GOLD=1</LI>
|
||||
|
||||
<LI>
|
||||
set MOZ_MEDIUM=1</LI>
|
||||
|
||||
<LI>
|
||||
set MOZ_NT=351 (if running NT 3.51, don't set otherwise)</LI>
|
||||
|
||||
<LI>
|
||||
set MOZ_OUT=(location of resulting executable and totally optional, see
|
||||
Notes for more details)</LI>
|
||||
|
||||
<LI>
|
||||
set MOZ_SRC=(top of your tree, drive letter and path, i.e. set MOZ_SRC=d:\mozilla_src.
|
||||
The topmost directory under this should be mozilla)</LI>
|
||||
|
||||
<LI>
|
||||
set MOZ_TOOLS=(location of the bin directory containing your GNU tools.
|
||||
The build looks for MOZ_TOOLS\bin\gmake.exe, so make sure your MOZ_TOOLS
|
||||
is figured appropriately)</LI>
|
||||
|
||||
<LI>
|
||||
set NO_SECURITY=1</LI>
|
||||
|
||||
<LI>
|
||||
set NSPR20=1</LI>
|
||||
|
||||
<LI>
|
||||
if you are running VC++ 5.0 or higher: set _MSC_VER=1100; if you are running
|
||||
VC++ 4.2 then set MOZ_VCVER=42</LI>
|
||||
|
||||
<LI>
|
||||
<B>set STANDALONE_IMAGE_LIB=1</B></LI>
|
||||
|
||||
<LI>
|
||||
<B>set MODULAR_NETLIB=1</B></LI>
|
||||
</UL>
|
||||
</UL>
|
||||
<B><FONT SIZE=+1>Building:</FONT></B>
|
||||
<UL>
|
||||
<LI>
|
||||
You need to be running a vanilla command prompt. Other shells may work,
|
||||
but you might have to tweak makefiles.</LI>
|
||||
|
||||
<LI>
|
||||
<B>Build the tools:</B> This generates several tools that handle things
|
||||
like dependency generation</LI>
|
||||
|
||||
<UL>
|
||||
<LI>
|
||||
cd mozilla\config</LI>
|
||||
|
||||
<LI>
|
||||
nmake /f makefile.win</LI>
|
||||
</UL>
|
||||
|
||||
<LI>
|
||||
<B>Build the NGLayout:</B> This will do a complete build of the source
|
||||
tree. You will end up with a viewer.exe at the end. The viewer.exe will
|
||||
be in your dist\win32_[OD].obj\bin directory (O will be used when you don't
|
||||
set MOZ_DEBUG; D will be used when you set MOZ_DEBUG).</LI>
|
||||
|
||||
<UL>
|
||||
<LI>
|
||||
cd mozilla</LI>
|
||||
|
||||
<LI>
|
||||
nmake /f nglayout.mak</LI>
|
||||
</UL>
|
||||
</UL>
|
||||
<B><FONT SIZE=+1>Running:</FONT></B>
|
||||
<UL>
|
||||
<LI>
|
||||
Once you have built the system, do this to run the viewer program (the
|
||||
viewer program is a simple test program that uses the nsIWebWidget API
|
||||
to embed a web widget object). The viewer program has a few basic menu
|
||||
items, include "Samples" which load sample tests.</LI>
|
||||
|
||||
<UL>
|
||||
<LI>
|
||||
cd mozilla\dist\win32_[OD].obj\bin</LI>
|
||||
|
||||
<LI>
|
||||
.\viewer.exe</LI>
|
||||
</UL>
|
||||
</UL>
|
||||
<B><FONT SIZE=+1>Notes:</FONT></B>
|
||||
<UL>
|
||||
<LI>
|
||||
This build process does not use Visual C++ generated project files for
|
||||
several reasons having to do with (among other things) size, maintainability,
|
||||
and the long term desire to start using more of tools like gmake, or plug
|
||||
and play developer tools. This does not preclude you from using the Visual
|
||||
C++ IDE, or it's debugger. Once you have built a viewer.exe do this to
|
||||
run it under the debugger:</LI>
|
||||
</UL>
|
||||
|
||||
<UL>
|
||||
<UL>
|
||||
<LI>
|
||||
cd mozilla\dist\win32_[OD].obj\bin</LI>
|
||||
|
||||
<LI>
|
||||
msdev viewer.exe</LI>
|
||||
</UL>
|
||||
</UL>
|
||||
|
||||
<HR WIDTH="100%">
|
||||
<CENTER><FONT SIZE=-1>Copyright © 1998 <A HREF="http://home.netscape.com/misc/contact_info.html">Netscape
|
||||
Communications Corporation</A></FONT></CENTER>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
8
mozilla/aclocal.m4
vendored
Normal file
8
mozilla/aclocal.m4
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
dnl
|
||||
dnl Local autoconf macros used with mozilla
|
||||
dnl The contents of this file are under the Public Domain.
|
||||
dnl
|
||||
|
||||
builtin(include, build/autoconf/gtk.m4)dnl
|
||||
builtin(include, build/autoconf/altoptions.m4)dnl
|
||||
|
||||
374
mozilla/allmakefiles.sh
Executable file
374
mozilla/allmakefiles.sh
Executable file
@@ -0,0 +1,374 @@
|
||||
#! /bin/sh
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1999 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
#
|
||||
|
||||
# allmakefiles.sh - List of all makefiles.
|
||||
# This script outputs the list to the standard output.
|
||||
# There is no need to rerun autoconf after adding makefiles.
|
||||
# You only need to run configure.
|
||||
#
|
||||
# Unused makefiles may be commented out with '#'.
|
||||
# ('#' must be the first character on the line).
|
||||
|
||||
# add_makefiles - Shell function to write non-commented lines to stdout
|
||||
add_makefiles() {
|
||||
while read line; do
|
||||
case $line in
|
||||
\#*|dnl*) ;;
|
||||
*) echo $line ;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
add_makefiles <<END_NGMAKEFILES
|
||||
Makefile
|
||||
base/Makefile
|
||||
base/public/Makefile
|
||||
base/src/Makefile
|
||||
base/src/motif/Makefile
|
||||
base/src/rhapsody/Makefile
|
||||
base/src/gtk/Makefile
|
||||
base/tests/Makefile
|
||||
config/Makefile
|
||||
config/autoconf.mk
|
||||
config/mkdepend/Makefile
|
||||
config/mkdetect/Makefile
|
||||
config/ports/Makefile
|
||||
dbm/Makefile
|
||||
dbm/include/Makefile
|
||||
dbm/src/Makefile
|
||||
dbm/tests/Makefile
|
||||
dom/Makefile
|
||||
dom/public/Makefile
|
||||
dom/public/base/Makefile
|
||||
dom/public/coreDom/Makefile
|
||||
dom/public/coreEvents/Makefile
|
||||
dom/public/css/Makefile
|
||||
dom/public/events/Makefile
|
||||
dom/public/html/Makefile
|
||||
dom/src/Makefile
|
||||
dom/src/base/Makefile
|
||||
dom/src/build/Makefile
|
||||
dom/src/coreDOM/Makefile
|
||||
dom/src/css/Makefile
|
||||
dom/src/events/Makefile
|
||||
dom/src/html/Makefile
|
||||
dom/src/jsurl/Makefile
|
||||
dom/tools/Makefile
|
||||
editor/Makefile
|
||||
editor/public/Makefile
|
||||
gfx/Makefile
|
||||
gfx/public/Makefile
|
||||
gfx/src/Makefile
|
||||
gfx/src/gtk/Makefile
|
||||
gfx/src/motif/Makefile
|
||||
gfx/src/rhapsody/Makefile
|
||||
gfx/tests/Makefile
|
||||
htmlparser/Makefile
|
||||
htmlparser/robot/Makefile
|
||||
htmlparser/src/Makefile
|
||||
htmlparser/tests/Makefile
|
||||
htmlparser/tests/grabpage/Makefile
|
||||
htmlparser/tests/logparse/Makefile
|
||||
include/Makefile
|
||||
intl/Makefile
|
||||
intl/uconv/Makefile
|
||||
intl/uconv/public/Makefile
|
||||
intl/uconv/src/Makefile
|
||||
intl/uconv/tests/Makefile
|
||||
intl/uconv/ucvja/Makefile
|
||||
intl/uconv/ucvlatin/Makefile
|
||||
intl/uconv/ucvja2/Makefile
|
||||
intl/locale/Makefile
|
||||
intl/locale/public/Makefile
|
||||
intl/locale/src/Makefile
|
||||
intl/locale/src/unix/Makefile
|
||||
intl/locale/tests/Makefile
|
||||
intl/lwbrk/Makefile
|
||||
intl/lwbrk/src/Makefile
|
||||
intl/lwbrk/public/Makefile
|
||||
intl/lwbrk/tests/Makefile
|
||||
intl/unicharutil/Makefile
|
||||
intl/unicharutil/src/Makefile
|
||||
intl/unicharutil/public/Makefile
|
||||
intl/unicharutil/tests/Makefile
|
||||
intl/unicharutil/tools/Makefile
|
||||
intl/strres/Makefile
|
||||
intl/strres/public/Makefile
|
||||
intl/strres/src/Makefile
|
||||
intl/strres/tests/Makefile
|
||||
jpeg/Makefile
|
||||
js/Makefile
|
||||
js/jsd/Makefile
|
||||
js/jsd/classes/Makefile
|
||||
js/src/Makefile
|
||||
js/src/fdlibm/Makefile
|
||||
js/src/liveconnect/Makefile
|
||||
js/src/liveconnect/classes/Makefile
|
||||
js/src/xpcom/Makefile
|
||||
js/src/xpconnect/Makefile
|
||||
layout/Makefile
|
||||
layout/base/Makefile
|
||||
layout/base/public/Makefile
|
||||
layout/base/src/Makefile
|
||||
layout/base/tests/Makefile
|
||||
layout/build/Makefile
|
||||
layout/events/Makefile
|
||||
layout/events/public/Makefile
|
||||
layout/events/src/Makefile
|
||||
layout/html/Makefile
|
||||
layout/html/base/Makefile
|
||||
layout/html/base/src/Makefile
|
||||
layout/html/content/Makefile
|
||||
layout/html/content/public/Makefile
|
||||
layout/html/content/src/Makefile
|
||||
layout/html/document/Makefile
|
||||
layout/html/document/src/Makefile
|
||||
layout/html/forms/Makefile
|
||||
layout/html/forms/public/Makefile
|
||||
layout/html/forms/src/Makefile
|
||||
layout/html/style/Makefile
|
||||
layout/html/style/public/Makefile
|
||||
layout/html/style/src/Makefile
|
||||
layout/html/table/Makefile
|
||||
layout/html/table/public/Makefile
|
||||
layout/html/table/src/Makefile
|
||||
layout/html/tests/Makefile
|
||||
layout/tools/Makefile
|
||||
layout/xml/Makefile
|
||||
layout/xml/content/Makefile
|
||||
layout/xml/content/public/Makefile
|
||||
layout/xml/content/src/Makefile
|
||||
layout/xml/document/Makefile
|
||||
layout/xml/document/public/Makefile
|
||||
layout/xml/document/src/Makefile
|
||||
layout/xul/Makefile
|
||||
layout/xul/base/Makefile
|
||||
layout/xul/base/src/Makefile
|
||||
layout/xul/content/Makefile
|
||||
layout/xul/content/src/Makefile
|
||||
# lib/liblayer/Makefile
|
||||
# lib/liblayer/include/Makefile
|
||||
# lib/liblayer/src/Makefile
|
||||
lib/libpwcac/Makefile
|
||||
lib/xp/Makefile
|
||||
modules/libimg/Makefile
|
||||
modules/libimg/classes/Makefile
|
||||
modules/libimg/classes/netscape/Makefile
|
||||
modules/libimg/classes/netscape/libimg/Makefile
|
||||
modules/libimg/png/Makefile
|
||||
modules/libimg/public/Makefile
|
||||
modules/libimg/src/Makefile
|
||||
modules/libpref/Makefile
|
||||
modules/libpref/admin/Makefile
|
||||
modules/libpref/l10n/Makefile
|
||||
modules/libpref/public/Makefile
|
||||
modules/libpref/src/Makefile
|
||||
modules/libreg/Makefile
|
||||
modules/libreg/include/Makefile
|
||||
modules/libreg/src/Makefile
|
||||
modules/libutil/Makefile
|
||||
modules/libutil/public/Makefile
|
||||
modules/libutil/src/Makefile
|
||||
modules/oji/Makefile
|
||||
modules/oji/public/Makefile
|
||||
modules/oji/src/Makefile
|
||||
modules/plugin/Makefile
|
||||
modules/plugin/nglsrc/Makefile
|
||||
modules/plugin/public/Makefile
|
||||
modules/plugin/src/Makefile
|
||||
modules/plugin/test/Makefile
|
||||
modules/security/freenav/Makefile
|
||||
modules/zlib/Makefile
|
||||
modules/zlib/src/Makefile
|
||||
nav-java/Makefile
|
||||
nav-java/stubs/Makefile
|
||||
nav-java/stubs/include/Makefile
|
||||
nav-java/stubs/jri/Makefile
|
||||
nav-java/stubs/src/Makefile
|
||||
network/Makefile
|
||||
network/cache/Makefile
|
||||
network/cache/nu/Makefile
|
||||
network/cache/nu/include/Makefile
|
||||
network/cache/nu/public/Makefile
|
||||
network/cache/nu/src/Makefile
|
||||
network/cache/nu/tests/Makefile
|
||||
network/cache/nu/tests/fftest/Makefile
|
||||
network/client/Makefile
|
||||
network/cnvts/Makefile
|
||||
network/cstream/Makefile
|
||||
network/main/Makefile
|
||||
network/mimetype/Makefile
|
||||
network/public/Makefile
|
||||
network/module/Makefile
|
||||
network/module/tests/Makefile
|
||||
network/protocol/Makefile
|
||||
network/protocol/about/Makefile
|
||||
network/protocol/callback/Makefile
|
||||
network/protocol/dataurl/Makefile
|
||||
network/protocol/file/Makefile
|
||||
network/protocol/ftp/Makefile
|
||||
network/protocol/gopher/Makefile
|
||||
network/protocol/http/Makefile
|
||||
network/protocol/js/Makefile
|
||||
network/protocol/ldap/Makefile
|
||||
network/protocol/marimba/Makefile
|
||||
network/protocol/remote/Makefile
|
||||
network/protocol/sockstub/Makefile
|
||||
network/util/Makefile
|
||||
rdf/Makefile
|
||||
rdf/base/Makefile
|
||||
rdf/base/public/Makefile
|
||||
rdf/base/src/Makefile
|
||||
rdf/build/Makefile
|
||||
rdf/content/Makefile
|
||||
rdf/content/public/Makefile
|
||||
rdf/content/src/Makefile
|
||||
rdf/datasource/Makefile
|
||||
rdf/datasource/public/Makefile
|
||||
rdf/datasource/src/Makefile
|
||||
rdf/tests/Makefile
|
||||
rdf/tests/localfile/Makefile
|
||||
rdf/tests/rdfsink/Makefile
|
||||
sun-java/Makefile
|
||||
sun-java/stubs/Makefile
|
||||
sun-java/stubs/include/Makefile
|
||||
sun-java/stubs/jri/Makefile
|
||||
sun-java/stubs/src/Makefile
|
||||
caps/Makefile
|
||||
caps/include/Makefile
|
||||
caps/public/Makefile
|
||||
caps/src/Makefile
|
||||
view/Makefile
|
||||
view/public/Makefile
|
||||
view/src/Makefile
|
||||
webshell/Makefile
|
||||
webshell/public/Makefile
|
||||
webshell/src/Makefile
|
||||
webshell/tests/Makefile
|
||||
webshell/tests/viewer/Makefile
|
||||
webshell/tests/viewer/public/Makefile
|
||||
widget/Makefile
|
||||
widget/public/Makefile
|
||||
widget/src/Makefile
|
||||
widget/src/build/Makefile
|
||||
widget/src/motif/Makefile
|
||||
widget/src/rhapsody/Makefile
|
||||
widget/src/gtk/Makefile
|
||||
widget/src/xpwidgets/Makefile
|
||||
widget/tests/Makefile
|
||||
widget/tests/scribble/Makefile
|
||||
widget/tests/widget/Makefile
|
||||
xpcom/Makefile
|
||||
xpcom/public/Makefile
|
||||
xpcom/src/Makefile
|
||||
xpcom/tests/Makefile
|
||||
xpcom/tests/dynamic/Makefile
|
||||
xpcom/tools/Makefile
|
||||
xpcom/tools/xpidl/Makefile
|
||||
xpcom/libxpt/Makefile
|
||||
xpcom/libxpt/public/Makefile
|
||||
xpcom/libxpt/src/Makefile
|
||||
xpcom/libxpt/tests/Makefile
|
||||
xpcom/libxpt/tools/Makefile
|
||||
silentdl/Makefile
|
||||
xpfe/Makefile
|
||||
xpfe/AppCores/Makefile
|
||||
xpfe/AppCores/public/Makefile
|
||||
xpfe/AppCores/src/Makefile
|
||||
xpfe/AppCores/xul/Makefile
|
||||
xpfe/AppCores/idl/Makefile
|
||||
xpfe/browser/Makefile
|
||||
xpfe/browser/public/Makefile
|
||||
xpfe/browser/src/Makefile
|
||||
# xpfe/xpviewer/Makefile
|
||||
# xpfe/xpviewer/src/Makefile
|
||||
# xpfe/xpviewer/public/Makefile
|
||||
xpfe/appshell/Makefile
|
||||
xpfe/appshell/src/Makefile
|
||||
xpfe/appshell/public/Makefile
|
||||
xpfe/bootstrap/Makefile
|
||||
xpfe/browser/Makefile
|
||||
xpfe/browser/src/Makefile
|
||||
# xpfe/browser/public/Makefile
|
||||
END_NGMAKEFILES
|
||||
|
||||
if [ "$MOZ_EDITOR" ]; then
|
||||
add_makefiles <<END_EDITOR_MAKEFILES
|
||||
editor/base/Makefile
|
||||
editor/txmgr/Makefile
|
||||
editor/txmgr/public/Makefile
|
||||
editor/txmgr/src/Makefile
|
||||
editor/txmgr/tests/Makefile
|
||||
editor/guimgr/Makefile
|
||||
editor/guimgr/src/Makefile
|
||||
editor/guimgr/public/Makefile
|
||||
END_EDITOR_MAKEFILES
|
||||
fi
|
||||
|
||||
if [ "$MOZ_MAIL_NEWS" ]; then
|
||||
add_makefiles <<END_MAILNEWS_MAKEFILES
|
||||
network/protocol/certld/Makefile
|
||||
network/protocol/imap4/Makefile
|
||||
network/protocol/mailbox/Makefile
|
||||
network/protocol/nntp/Makefile
|
||||
network/protocol/pop3/Makefile
|
||||
network/protocol/smtp/Makefile
|
||||
mailnews/Makefile
|
||||
mailnews/base/Makefile
|
||||
mailnews/base/public/Makefile
|
||||
mailnews/base/src/Makefile
|
||||
mailnews/base/build/Makefile
|
||||
mailnews/base/tests/Makefile
|
||||
mailnews/db/Makefile
|
||||
mailnews/db/mdb/Makefile
|
||||
mailnews/db/mdb/public/Makefile
|
||||
mailnews/db/msgdb/Makefile
|
||||
mailnews/db/msgdb/public/Makefile
|
||||
mailnews/db/msgdb/src/Makefile
|
||||
mailnews/local/Makefile
|
||||
mailnews/local/public/Makefile
|
||||
mailnews/local/src/Makefile
|
||||
mailnews/local/tests/Makefile
|
||||
mailnews/local/tests/pop3/Makefile
|
||||
mailnews/local/tests/mailbox/Makefile
|
||||
mailnews/imap/Makefile
|
||||
mailnews/imap/public/Makefile
|
||||
mailnews/imap/src/Makefile
|
||||
mailnews/news/Makefile
|
||||
mailnews/news/public/Makefile
|
||||
mailnews/news/src/Makefile
|
||||
mailnews/news/tests/Makefile
|
||||
mailnews/mime/Makefile
|
||||
mailnews/mime/public/Makefile
|
||||
mailnews/mime/src/Makefile
|
||||
mailnews/compose/Makefile
|
||||
mailnews/compose/public/Makefile
|
||||
mailnews/compose/src/Makefile
|
||||
mailnews/compose/tests/Makefile
|
||||
mailnews/compose/tests/smtp/Makefile
|
||||
mailnews/compose/tests/compose/Makefile
|
||||
mailnews/ui/Makefile
|
||||
mailnews/ui/messenger/Makefile
|
||||
mailnews/ui/messenger/public/Makefile
|
||||
mailnews/ui/messenger/src/Makefile
|
||||
mailnews/ui/messenger/resources/Makefile
|
||||
mailnews/ui/compose/Makefile
|
||||
mailnews/ui/ab/Makefile
|
||||
mailnews/public/Makefile
|
||||
END_MAILNEWS_MAKEFILES
|
||||
fi
|
||||
33
mozilla/base/Makefile.in
Normal file
33
mozilla/base/Makefile.in
Normal file
@@ -0,0 +1,33 @@
|
||||
#!gmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
|
||||
DEPTH = ..
|
||||
topsrcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
srcdir = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
DIRS = public src
|
||||
|
||||
ifdef ENABLE_TESTS
|
||||
DIRS += tests
|
||||
endif
|
||||
|
||||
include $(topsrcdir)/config/config.mk
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
21
mozilla/base/macbuild/BaseDebugPrefix.h
Normal file
21
mozilla/base/macbuild/BaseDebugPrefix.h
Normal file
@@ -0,0 +1,21 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
#define _IMPL_NS_BASE 1
|
||||
|
||||
#include "MacPrefix_debug.h"
|
||||
21
mozilla/base/macbuild/BasePrefix.h
Normal file
21
mozilla/base/macbuild/BasePrefix.h
Normal file
@@ -0,0 +1,21 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
#define _IMPL_NS_BASE 1
|
||||
|
||||
#include "MacPrefix.h"
|
||||
BIN
mozilla/base/macbuild/TestFiles.mcp
Normal file
BIN
mozilla/base/macbuild/TestFiles.mcp
Normal file
Binary file not shown.
BIN
mozilla/base/macbuild/TestProperties.mcp
Normal file
BIN
mozilla/base/macbuild/TestProperties.mcp
Normal file
Binary file not shown.
BIN
mozilla/base/macbuild/base.mcp
Normal file
BIN
mozilla/base/macbuild/base.mcp
Normal file
Binary file not shown.
19
mozilla/base/macbuild/base.toc
Normal file
19
mozilla/base/macbuild/base.toc
Normal file
@@ -0,0 +1,19 @@
|
||||
# target: baseDebug.shlb
|
||||
mozilla/base/src/mac/nsTimerMac.cpp
|
||||
mozilla/base/src/nsArena.cpp
|
||||
mozilla/base/src/nsAtomTable.cpp
|
||||
mozilla/base/src/nsBaseDLL.cpp
|
||||
mozilla/base/src/nsBTree.cpp
|
||||
mozilla/base/src/nsByteBuffer.cpp
|
||||
mozilla/base/src/nsCRT.cpp
|
||||
mozilla/base/src/nsDeque.cpp
|
||||
mozilla/base/src/nsEscape.cpp
|
||||
mozilla/base/src/nsFileSpec.cpp
|
||||
mozilla/base/src/nsFileStream.cpp
|
||||
mozilla/base/src/nsRBTree.cpp
|
||||
mozilla/base/src/nsProperties.cpp
|
||||
mozilla/base/src/nsSizeOfHandler.cpp
|
||||
mozilla/base/src/nsString.cpp
|
||||
mozilla/base/src/nsUnicharBuffer.cpp
|
||||
mozilla/base/src/nsUnicharInputStream.cpp
|
||||
mozilla/base/src/nsVoidArray.cpp
|
||||
19
mozilla/base/macbuild/files.prefix
Normal file
19
mozilla/base/macbuild/files.prefix
Normal file
@@ -0,0 +1,19 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
#include "MacPrefix_debug.h"
|
||||
19
mozilla/base/macbuild/filesDebug.prefix
Normal file
19
mozilla/base/macbuild/filesDebug.prefix
Normal file
@@ -0,0 +1,19 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
#include "MacPrefix_debug.h"
|
||||
23
mozilla/base/makefile.win
Normal file
23
mozilla/base/makefile.win
Normal file
@@ -0,0 +1,23 @@
|
||||
#!nmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
|
||||
DEPTH=..
|
||||
IGNORE_MANIFEST=1
|
||||
|
||||
DIRS=public src
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
12
mozilla/base/public/MANIFEST
Normal file
12
mozilla/base/public/MANIFEST
Normal file
@@ -0,0 +1,12 @@
|
||||
#
|
||||
# This is a list of local files which get copied to the mozilla:dist:base directory
|
||||
#
|
||||
|
||||
nsAutoLock.h
|
||||
nsISizeOfHandler.h
|
||||
nsFileStream.h
|
||||
nsIFileStream.h
|
||||
nsFileSpec.h
|
||||
nsRepeater.h
|
||||
nsIProperties.h
|
||||
nsCaretProperties.h
|
||||
44
mozilla/base/public/Makefile.in
Normal file
44
mozilla/base/public/Makefile.in
Normal file
@@ -0,0 +1,44 @@
|
||||
#!gmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
|
||||
DEPTH=../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
DEFINES += -D_IMPL_NS_BASE
|
||||
|
||||
EXPORTS = \
|
||||
nsAutoLock.h \
|
||||
nsIProperties.h \
|
||||
nsISizeOfHandler.h \
|
||||
nsCaretProperties.h \
|
||||
nsEscape.h \
|
||||
nsFileSpec.h \
|
||||
nsFileStream.h \
|
||||
nsIFileStream.h \
|
||||
$(NULL)
|
||||
|
||||
EXPORTS := $(addprefix $(srcdir)/, $(EXPORTS))
|
||||
|
||||
MODULE=base
|
||||
|
||||
include $(topsrcdir)/config/config.mk
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
37
mozilla/base/public/makefile.win
Normal file
37
mozilla/base/public/makefile.win
Normal file
@@ -0,0 +1,37 @@
|
||||
#!nmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
|
||||
DEPTH=..\..
|
||||
IGNORE_MANIFEST=1
|
||||
|
||||
DEFINES = -D_IMPL_NS_BASE
|
||||
|
||||
EXPORTS = \
|
||||
nsAutoLock.h \
|
||||
nsCaretProperties.h \
|
||||
nsIProperties.h \
|
||||
nsISizeOfHandler.h \
|
||||
nsEscape.h \
|
||||
nsFileSpec.h \
|
||||
nsFileStream.h \
|
||||
nsIFileStream.h \
|
||||
$(NULL)
|
||||
|
||||
MODULE = raptor
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
|
||||
116
mozilla/base/public/nsAutoLock.h
Normal file
116
mozilla/base/public/nsAutoLock.h
Normal file
@@ -0,0 +1,116 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
|
||||
A stack-based lock object that makes using PRLock a bit more
|
||||
convenient. It acquires the monitor when constructed, and releases
|
||||
it when it goes out of scope.
|
||||
|
||||
For example,
|
||||
|
||||
class Foo {
|
||||
private:
|
||||
PRLock* mLock;
|
||||
|
||||
public:
|
||||
Foo(void) {
|
||||
mLock = PR_NewLock();
|
||||
}
|
||||
|
||||
virtual ~Foo(void) {
|
||||
PR_DestroyLock(mLock);
|
||||
}
|
||||
|
||||
void ThreadSafeMethod(void) {
|
||||
// we're don't hold the lock yet...
|
||||
|
||||
nsAutoLock lock(mLock);
|
||||
// ...but now we do.
|
||||
|
||||
// we even can do wacky stuff like return from arbitrary places w/o
|
||||
// worrying about forgetting to release the lock
|
||||
if (some_weird_condition)
|
||||
return;
|
||||
|
||||
// otherwise do some other stuff
|
||||
}
|
||||
|
||||
void ThreadSafeBlockScope(void) {
|
||||
// we're not in the lock here...
|
||||
|
||||
{
|
||||
nsAutoLock lock(mLock);
|
||||
// but we are now, at least until the block scope closes
|
||||
}
|
||||
|
||||
// ...now we're not in the lock anymore
|
||||
}
|
||||
};
|
||||
|
||||
*/
|
||||
|
||||
#ifndef nsAutoLock_h__
|
||||
#define nsAutoLock_h__
|
||||
|
||||
#include "nscore.h"
|
||||
#include "prlock.h"
|
||||
#include "prlog.h"
|
||||
|
||||
// If you ever decide that you need to add a non-inline method to this
|
||||
// class, be sure to change the class declaration to "class NS_BASE
|
||||
// nsAutoLock".
|
||||
|
||||
class nsAutoLock {
|
||||
private:
|
||||
PRLock* mLock;
|
||||
|
||||
// Not meant to be implemented. This makes it a compiler error to
|
||||
// construct or assign an nsAutoLock object incorrectly.
|
||||
nsAutoLock(void) {}
|
||||
nsAutoLock(nsAutoLock& aLock) {}
|
||||
nsAutoLock& operator =(nsAutoLock& aLock) {
|
||||
return *this;
|
||||
}
|
||||
|
||||
// Not meant to be implemented. This makes it a compiler error to
|
||||
// attempt to create an nsAutoLock object on the heap.
|
||||
static void* operator new(size_t size) {
|
||||
return nsnull;
|
||||
}
|
||||
static void operator delete(void* memory) {}
|
||||
|
||||
public:
|
||||
nsAutoLock(PRLock* aLock) : mLock(aLock) {
|
||||
PR_ASSERT(mLock);
|
||||
|
||||
// This will assert deep in the bowels of NSPR if you attempt
|
||||
// to re-enter the lock.
|
||||
PR_Lock(mLock);
|
||||
}
|
||||
|
||||
|
||||
~nsAutoLock(void) {
|
||||
PR_Unlock(mLock);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
#endif // nsAutoLock_h__
|
||||
|
||||
53
mozilla/base/public/nsCaretProperties.h
Normal file
53
mozilla/base/public/nsCaretProperties.h
Normal file
@@ -0,0 +1,53 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
// this class is used to gather caret properties from the OS. It
|
||||
// must be implemented by each platform that wants more than
|
||||
// the generic caret properties.
|
||||
|
||||
class nsCaretProperties
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
nsCaretProperties();
|
||||
virtual ~nsCaretProperties() {}
|
||||
|
||||
virtual PRUint32 GetCaretWidth() { return mCaretWidth; }
|
||||
virtual PRUint32 GetCaretBlinkRate() { return mBlinkRate; }
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
// have value for no blinking
|
||||
|
||||
enum {
|
||||
eDefaulBlinkRate = 500, // twice a second
|
||||
eDefaultCaretWidth = 1 // one pixel wide
|
||||
};
|
||||
|
||||
|
||||
PRUint32 mCaretWidth; // caret width in twips
|
||||
PRUint32 mBlinkRate; // blink rate in milliseconds
|
||||
|
||||
|
||||
// members for vertical placement & size?
|
||||
|
||||
};
|
||||
|
||||
NS_BASE nsCaretProperties* NewCaretProperties();
|
||||
62
mozilla/base/public/nsEscape.h
Normal file
62
mozilla/base/public/nsEscape.h
Normal file
@@ -0,0 +1,62 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
/* First checked in on 98/12/03 by John R. McMullen, derived from net.h/mkparse.c. */
|
||||
|
||||
#ifndef _ESCAPE_H_
|
||||
#define _ESCAPE_H_
|
||||
|
||||
#include "prtypes.h"
|
||||
#include "nscore.h"
|
||||
|
||||
/* valid mask values for NET_Escape() and NET_EscapedSize(). */
|
||||
typedef enum {
|
||||
url_XAlphas = (1<<0)
|
||||
, url_XPAlphas = (1<<1)
|
||||
, url_Path = (1<<2)
|
||||
} nsEscapeMask;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
NS_BASE char * nsEscape(const char * str, nsEscapeMask mask);
|
||||
/* Caller must use delete [] on the result */
|
||||
|
||||
NS_BASE char * nsUnescape(char * str);
|
||||
/* decode % escaped hex codes into character values,
|
||||
* modifies the parameter, returns the same buffer
|
||||
*/
|
||||
|
||||
NS_BASE char * nsEscapeCount(const char * str, PRInt32 len, nsEscapeMask mask, PRInt32* out_len);
|
||||
/* Like nsEscape, but if out_len is non-null, return result string length
|
||||
* in *out_len, and uses len instead of NUL termination.
|
||||
* Caller must use delete [] on the result.
|
||||
*/
|
||||
NS_BASE PRInt32 nsUnescapeCount (char * str);
|
||||
/* decode % escaped hex codes into character values,
|
||||
* modifies the parameter buffer, returns the length of the result
|
||||
* (result may contain \0's).
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif // _ESCAPE_H_
|
||||
551
mozilla/base/public/nsFileSpec.h
Normal file
551
mozilla/base/public/nsFileSpec.h
Normal file
@@ -0,0 +1,551 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
// First checked in on 98/11/20 by John R. McMullen in the wrong directory.
|
||||
// Checked in again 98/12/04.
|
||||
// Polished version 98/12/08.
|
||||
|
||||
//========================================================================================
|
||||
//
|
||||
// Classes defined:
|
||||
//
|
||||
// nsFilePath, nsFileURL, nsFileSpec, nsPersistentFileDescriptor
|
||||
// nsDirectoryIterator. Oh, and a convenience class nsAutoCString.
|
||||
//
|
||||
// Q. How should I represent files at run time?
|
||||
// A. Use nsFileSpec. Using char* will lose information on some platforms.
|
||||
//
|
||||
// Q. Then what are nsFilePath and nsFileURL for?
|
||||
// A. Only when you need a char* parameter for legacy code.
|
||||
//
|
||||
// Q. How should I represent files in a persistent way (eg, in a disk file)?
|
||||
// A. Use nsPersistentFileDescriptor. Convert to and from nsFileSpec at run time.
|
||||
//
|
||||
// This suite provides the following services:
|
||||
//
|
||||
// 1. Encapsulates all platform-specific file details, so that files can be
|
||||
// described correctly without any platform #ifdefs
|
||||
//
|
||||
// 2. Type safety. This will fix the problems that used to occur because people
|
||||
// confused file paths. They used to use const char*, which could mean three
|
||||
// or four different things. Bugs were introduced as people coded, right up
|
||||
// to the moment Communicator 4.5 shipped.
|
||||
//
|
||||
// 3. Used in conjunction with nsFileStream.h (q.v.), this supports all the power
|
||||
// and readability of the ansi stream syntax.
|
||||
//
|
||||
// Basic example:
|
||||
//
|
||||
// nsFilePath myPath("/Development/iotest.txt");
|
||||
//
|
||||
// nsOutputFileStream testStream(myPath);
|
||||
// testStream << "Hello World" << nsEndl;
|
||||
//
|
||||
// 4. Handy methods for manipulating file specifiers safely, e.g. MakeUnique(),
|
||||
// SetLeafName(), Exists().
|
||||
//
|
||||
// 5. Easy cross-conversion.
|
||||
//
|
||||
// Examples:
|
||||
//
|
||||
// Initialize a URL from a string without suffix
|
||||
//
|
||||
// nsFileURL fileURL("file:///Development/MPW/MPW%20Shell");
|
||||
//
|
||||
// Initialize a Unix path from a URL
|
||||
//
|
||||
// nsFilePath filePath(fileURL);
|
||||
//
|
||||
// Initialize a native file spec from a URL
|
||||
//
|
||||
// nsFileSpec fileSpec(fileURL);
|
||||
//
|
||||
// Make the spec unique (this one has no suffix).
|
||||
//
|
||||
// fileSpec.MakeUnique();
|
||||
//
|
||||
// Assign the spec to a URL
|
||||
//
|
||||
// fileURL = fileSpec;
|
||||
//
|
||||
// Assign a unix path using a string with a suffix.
|
||||
//
|
||||
// filePath = "/Development/MPW/SysErrs.err";
|
||||
//
|
||||
// Assign to a file spec using a unix path.
|
||||
//
|
||||
// fileSpec = filePath;
|
||||
//
|
||||
// Make this unique (this one has a suffix).
|
||||
//
|
||||
// fileSpec.MakeUnique();
|
||||
//
|
||||
// 6. Fixes a bug that have been there for a long time, and
|
||||
// is inevitable if you use NSPR alone, where files are described as paths.
|
||||
//
|
||||
// The problem affects platforms (Macintosh) in which a path does not fully
|
||||
// specify a file, because two volumes can have the same name. This
|
||||
// is solved by holding a "private" native file spec inside the
|
||||
// nsFilePath and nsFileURL classes, which is used when appropriate.
|
||||
//
|
||||
// Not yet done:
|
||||
//
|
||||
// Equality operators... much more.
|
||||
//
|
||||
//========================================================================================
|
||||
|
||||
#ifndef _FILESPEC_H_
|
||||
#define _FILESPEC_H_
|
||||
|
||||
#include "nscore.h"
|
||||
#include "nsError.h"
|
||||
#include "nsString.h"
|
||||
|
||||
//========================================================================================
|
||||
// Compiler-specific macros, as needed
|
||||
//========================================================================================
|
||||
#if !defined(NS_USING_NAMESPACE) && (defined(__MWERKS__) || defined(XP_PC))
|
||||
#define NS_USING_NAMESPACE
|
||||
#endif
|
||||
|
||||
#ifdef NS_USING_NAMESPACE
|
||||
|
||||
#define NS_NAMESPACE_PROTOTYPE
|
||||
#define NS_NAMESPACE namespace
|
||||
#define NS_NAMESPACE_END
|
||||
#define NS_EXPLICIT explicit
|
||||
#else
|
||||
|
||||
#define NS_NAMESPACE_PROTOTYPE static
|
||||
#define NS_NAMESPACE struct
|
||||
#define NS_NAMESPACE_END ;
|
||||
#define NS_EXPLICIT
|
||||
|
||||
#endif
|
||||
//=========================== End Compiler-specific macros ===============================
|
||||
|
||||
#ifdef XP_MAC
|
||||
#include <Files.h>
|
||||
#elif defined(XP_UNIX) || defined (XP_OS2)
|
||||
#include <dirent.h>
|
||||
#elif XP_PC
|
||||
#include "prio.h"
|
||||
#endif
|
||||
|
||||
//========================================================================================
|
||||
// Here are the allowable ways to describe a file.
|
||||
//========================================================================================
|
||||
|
||||
class nsFileSpec; // Preferred. For i/o use nsInputFileStream, nsOutputFileStream
|
||||
class nsFilePath; // This can be passed to NSPR file I/O routines, if you must.
|
||||
class nsFileURL;
|
||||
class nsPersistentFileDescriptor; // Used for storage across program launches.
|
||||
|
||||
#define kFileURLPrefix "file://"
|
||||
#define kFileURLPrefixLength (7)
|
||||
|
||||
class nsOutputStream;
|
||||
class nsInputStream;
|
||||
class nsIOutputStream;
|
||||
class nsIInputStream;
|
||||
class nsOutputFileStream;
|
||||
class nsInputFileStream;
|
||||
class nsString;
|
||||
|
||||
//========================================================================================
|
||||
// Conversion of native file errors to nsresult values. These are really only for use
|
||||
// in the file module, clients of this interface shouldn't really need them.
|
||||
// Error results returned from this interface have, in the low-order 16 bits,
|
||||
// native errors that are masked to 16 bits. Assumption: a native error of 0 is success
|
||||
// on all platforms. Note the way we define this using an inline function. This
|
||||
// avoids multiple evaluation if people go NS_FILE_RESULT(function_call()).
|
||||
#define NS_FILE_RESULT(x) ns_file_convert_result((PRInt32)x)
|
||||
nsresult ns_file_convert_result(PRInt32 nativeErr);
|
||||
#define NS_FILE_FAILURE NS_FILE_RESULT(-1)
|
||||
|
||||
//========================================================================================
|
||||
class NS_BASE nsAutoCString
|
||||
//
|
||||
// This should be in nsString.h, but the owner would not reply to my proposal. After four
|
||||
// weeks, I decided to put it in here.
|
||||
//
|
||||
// This is a quiet little class that acts as a sort of autoptr for
|
||||
// a const char*. If you used to call nsString::ToNewCString(), just
|
||||
// to pass the result a parameter list, it was a nuisance having to
|
||||
// call delete [] on the result after the call. Now you can say
|
||||
// nsString myStr;
|
||||
// ...
|
||||
// f(nsAutoCString(myStr));
|
||||
// where f is declared as void f(const char*); This call will
|
||||
// make a temporary char* pointer on the stack and delete[] it
|
||||
// when the function returns.
|
||||
//========================================================================================
|
||||
{
|
||||
public:
|
||||
NS_EXPLICIT nsAutoCString(const nsString& other) : mCString(other.ToNewCString()) {}
|
||||
virtual ~nsAutoCString();
|
||||
operator const char*() const { return mCString; }
|
||||
operator const char*() { return mCString; }
|
||||
protected:
|
||||
const char* mCString;
|
||||
}; // class nsAutoCString
|
||||
|
||||
//========================================================================================
|
||||
class NS_BASE nsFileSpec
|
||||
// This is whatever each platform really prefers to describe files as. Declared first
|
||||
// because the other two types have an embeded nsFileSpec object.
|
||||
//========================================================================================
|
||||
{
|
||||
public:
|
||||
nsFileSpec();
|
||||
NS_EXPLICIT nsFileSpec(const char* inString, PRBool inCreateDirs = PR_FALSE);
|
||||
NS_EXPLICIT nsFileSpec(const nsString& inString, PRBool inCreateDirs = PR_FALSE);
|
||||
NS_EXPLICIT nsFileSpec(const nsFilePath& inPath);
|
||||
NS_EXPLICIT nsFileSpec(const nsFileURL& inURL);
|
||||
NS_EXPLICIT nsFileSpec(const nsPersistentFileDescriptor& inURL);
|
||||
nsFileSpec(const nsFileSpec& inPath);
|
||||
virtual ~nsFileSpec();
|
||||
|
||||
void operator = (const char* inPath);
|
||||
void operator = (const nsString& inPath)
|
||||
{
|
||||
*this = nsAutoCString(inPath);
|
||||
}
|
||||
void operator = (const nsFilePath& inPath);
|
||||
void operator = (const nsFileURL& inURL);
|
||||
void operator = (const nsFileSpec& inOther);
|
||||
void operator = (const nsPersistentFileDescriptor& inOther);
|
||||
|
||||
#ifndef XP_MAC
|
||||
operator const char* () const { return mPath; }
|
||||
// This is the only automatic conversion to const char*
|
||||
// that is provided, and it allows the
|
||||
// path to be "passed" to NSPR file routines.
|
||||
#endif
|
||||
|
||||
#ifdef XP_MAC
|
||||
// For Macintosh people, this is meant to be useful in its own right as a C++ version
|
||||
// of the FSSpec struct.
|
||||
nsFileSpec(
|
||||
short vRefNum,
|
||||
long parID,
|
||||
ConstStr255Param name);
|
||||
nsFileSpec(const FSSpec& inSpec)
|
||||
: mSpec(inSpec), mError(NS_OK) {}
|
||||
|
||||
operator FSSpec* () { return &mSpec; }
|
||||
operator const FSSpec* const () { return &mSpec; }
|
||||
operator FSSpec& () { return mSpec; }
|
||||
operator const FSSpec& () const { return mSpec; }
|
||||
void MakeAliasSafe();
|
||||
// Called for the spec of an alias. Copies the alias to
|
||||
// a secret temp directory and modifies the spec to point
|
||||
// to it. Sets mError.
|
||||
void ResolveAlias(PRBool& wasAliased);
|
||||
// Called for the spec of an alias. Modifies the spec to
|
||||
// point to the original. Sets mError.
|
||||
void MakeUnique(ConstStr255Param inSuggestedLeafName);
|
||||
StringPtr GetLeafPName() { return mSpec.name; }
|
||||
ConstStr255Param GetLeafPName() const { return mSpec.name; }
|
||||
#endif // end of Macintosh utility methods.
|
||||
|
||||
PRBool Valid() const { return NS_SUCCEEDED(Error()); }
|
||||
nsresult Error() const { return mError; }
|
||||
|
||||
|
||||
friend NS_BASE nsOutputStream& operator << (
|
||||
nsOutputStream& s,
|
||||
const nsFileSpec& spec); // THIS IS FOR DEBUGGING ONLY.
|
||||
// see PersistentFileDescriptor for the real deal.
|
||||
|
||||
|
||||
//--------------------------------------------------
|
||||
// Queries and path algebra. These do not modify the disk.
|
||||
//--------------------------------------------------
|
||||
|
||||
char* GetLeafName() const; // Allocated. Use delete [].
|
||||
void SetLeafName(const char* inLeafName);
|
||||
// inLeafName can be a relative path, so this allows
|
||||
// one kind of concatenation of "paths".
|
||||
void SetLeafName(const nsString& inLeafName)
|
||||
{
|
||||
SetLeafName(nsAutoCString(inLeafName));
|
||||
}
|
||||
void GetParent(nsFileSpec& outSpec) const;
|
||||
// Return the filespec of the parent directory. Used
|
||||
// in conjunction with GetLeafName(), this lets you
|
||||
// parse a path into a list of node names. Beware,
|
||||
// however, that the top node is still not a name,
|
||||
// but a spec. Volumes on Macintosh can have identical
|
||||
// names. Perhaps could be used for an operator --() ?
|
||||
|
||||
nsFileSpec operator + (const char* inRelativePath) const;
|
||||
nsFileSpec operator + (const nsString& inRelativePath) const
|
||||
{
|
||||
return *this + nsAutoCString(inRelativePath);
|
||||
}
|
||||
void operator += (const char* inRelativePath);
|
||||
// Concatenate the relative path to this directory.
|
||||
// Used for constructing the filespec of a descendant.
|
||||
// This must be a directory for this to work. This differs
|
||||
// from SetLeafName(), since the latter will work
|
||||
// starting with a sibling of the directory and throws
|
||||
// away its leaf information, whereas this one assumes
|
||||
// this is a directory, and the relative path starts
|
||||
// "below" this.
|
||||
void operator += (const nsString& inRelativePath)
|
||||
{
|
||||
*this += nsAutoCString(inRelativePath);
|
||||
}
|
||||
|
||||
void MakeUnique();
|
||||
void MakeUnique(const char* inSuggestedLeafName);
|
||||
void MakeUnique(const nsString& inSuggestedLeafName)
|
||||
{
|
||||
MakeUnique(nsAutoCString(inSuggestedLeafName));
|
||||
}
|
||||
|
||||
PRBool IsDirectory() const;
|
||||
// More stringent than Exists()
|
||||
PRBool IsFile() const;
|
||||
// More stringent than Exists()
|
||||
PRBool Exists() const;
|
||||
|
||||
//--------------------------------------------------
|
||||
// Creation and deletion of objects. These can modify the disk.
|
||||
//--------------------------------------------------
|
||||
|
||||
void CreateDirectory(int mode = 0700 /* for unix */);
|
||||
void Delete(PRBool inRecursive) const;
|
||||
|
||||
nsresult Rename(const char* inNewName); // not const: gets updated
|
||||
nsresult Rename(const nsString& inNewName)
|
||||
{
|
||||
return Rename(nsAutoCString(inNewName));
|
||||
}
|
||||
nsresult Copy(const nsFileSpec& inNewParentDirectory) const;
|
||||
nsresult Move(const nsFileSpec& inNewParentDirectory) const;
|
||||
nsresult Execute(const char* args) const;
|
||||
nsresult Execute(const nsString& args) const
|
||||
{
|
||||
return Execute(nsAutoCString(args));
|
||||
}
|
||||
|
||||
//--------------------------------------------------
|
||||
// Data
|
||||
//--------------------------------------------------
|
||||
|
||||
private:
|
||||
friend class nsFilePath;
|
||||
#ifdef XP_MAC
|
||||
FSSpec mSpec;
|
||||
#else
|
||||
char* mPath;
|
||||
#endif
|
||||
nsresult mError;
|
||||
}; // class nsFileSpec
|
||||
|
||||
// FOR HISTORICAL REASONS:
|
||||
|
||||
typedef nsFileSpec nsNativeFileSpec;
|
||||
|
||||
//========================================================================================
|
||||
class NS_BASE nsFileURL
|
||||
// This is an escaped string that looks like "file:///foo/bar/mumble%20fish". Since URLs
|
||||
// are the standard way of doing things in mozilla, this allows a string constructor,
|
||||
// which just stashes the string with no conversion.
|
||||
//========================================================================================
|
||||
{
|
||||
public:
|
||||
nsFileURL(const nsFileURL& inURL);
|
||||
NS_EXPLICIT nsFileURL(const char* inString, PRBool inCreateDirs = PR_FALSE);
|
||||
NS_EXPLICIT nsFileURL(const nsString& inString, PRBool inCreateDirs = PR_FALSE);
|
||||
NS_EXPLICIT nsFileURL(const nsFilePath& inPath);
|
||||
NS_EXPLICIT nsFileURL(const nsFileSpec& inPath);
|
||||
virtual ~nsFileURL();
|
||||
|
||||
// nsString GetString() const { return mPath; }
|
||||
// may be needed for implementation reasons,
|
||||
// but should not provide a conversion constructor.
|
||||
|
||||
void operator = (const nsFileURL& inURL);
|
||||
void operator = (const char* inString);
|
||||
void operator = (const nsString& inString)
|
||||
{
|
||||
*this = nsAutoCString(inString);
|
||||
}
|
||||
void operator = (const nsFilePath& inOther);
|
||||
void operator = (const nsFileSpec& inOther);
|
||||
|
||||
friend NS_BASE nsOutputStream& operator << (
|
||||
nsOutputStream& s, const nsFileURL& spec);
|
||||
|
||||
#ifdef XP_MAC
|
||||
// Accessor to allow quick assignment to a mFileSpec
|
||||
const nsFileSpec& GetFileSpec() const { return mFileSpec; }
|
||||
#endif
|
||||
private:
|
||||
// Should not be defined (only nsFilePath is to be treated as strings.
|
||||
operator char* ();
|
||||
operator const char* const ();
|
||||
private:
|
||||
friend class nsFilePath; // to allow construction of nsFilePath
|
||||
char* mURL;
|
||||
#ifdef XP_MAC
|
||||
// Since the path on the macintosh does not uniquely specify a file (volumes
|
||||
// can have the same name), stash the secret nsFileSpec, too.
|
||||
nsFileSpec mFileSpec;
|
||||
#endif
|
||||
}; // class nsFileURL
|
||||
|
||||
//========================================================================================
|
||||
class NS_BASE nsFilePath
|
||||
// This is a string that looks like "/foo/bar/mumble%20fish". Same as nsFileURL, but
|
||||
// without the "file:// prefix".
|
||||
//========================================================================================
|
||||
{
|
||||
public:
|
||||
nsFilePath(const nsFilePath& inPath);
|
||||
NS_EXPLICIT nsFilePath(const char* inString, PRBool inCreateDirs = PR_FALSE);
|
||||
NS_EXPLICIT nsFilePath(const nsString& inString, PRBool inCreateDirs = PR_FALSE);
|
||||
NS_EXPLICIT nsFilePath(const nsFileURL& inURL);
|
||||
NS_EXPLICIT nsFilePath(const nsFileSpec& inPath);
|
||||
virtual ~nsFilePath();
|
||||
|
||||
|
||||
operator const char* () const { return mPath; }
|
||||
// This is the only automatic conversion to const char*
|
||||
// that is provided, and it allows the
|
||||
// path to be "passed" to NSPR file routines.
|
||||
operator char* () { return mPath; }
|
||||
// This is the only automatic conversion to string
|
||||
// that is provided, because a naked string should
|
||||
// only mean a standard file path.
|
||||
|
||||
void operator = (const nsFilePath& inPath);
|
||||
void operator = (const char* inString);
|
||||
void operator = (const nsString& inString)
|
||||
{
|
||||
*this = nsAutoCString(inString);
|
||||
}
|
||||
void operator = (const nsFileURL& inURL);
|
||||
void operator = (const nsFileSpec& inOther);
|
||||
|
||||
#ifdef XP_MAC
|
||||
public:
|
||||
// Accessor to allow quick assignment to a mFileSpec
|
||||
const nsFileSpec& GetFileSpec() const { return mFileSpec; }
|
||||
#endif
|
||||
|
||||
private:
|
||||
|
||||
char* mPath;
|
||||
#ifdef XP_MAC
|
||||
// Since the path on the macintosh does not uniquely specify a file (volumes
|
||||
// can have the same name), stash the secret nsFileSpec, too.
|
||||
nsFileSpec mFileSpec;
|
||||
#endif
|
||||
}; // class nsFilePath
|
||||
|
||||
//========================================================================================
|
||||
class NS_BASE nsPersistentFileDescriptor
|
||||
//========================================================================================
|
||||
{
|
||||
public:
|
||||
nsPersistentFileDescriptor() : mDescriptorString(nsnull) {}
|
||||
// For use prior to reading in from a stream
|
||||
nsPersistentFileDescriptor(const nsPersistentFileDescriptor& inPath);
|
||||
virtual ~nsPersistentFileDescriptor();
|
||||
void operator = (const nsPersistentFileDescriptor& inPath);
|
||||
|
||||
// Conversions
|
||||
nsPersistentFileDescriptor(const nsFileSpec& inPath);
|
||||
void operator = (const nsFileSpec& inPath);
|
||||
|
||||
nsresult Read(nsIInputStream* aStream);
|
||||
nsresult Write(nsIOutputStream* aStream);
|
||||
// writes the data to a file
|
||||
friend NS_BASE nsInputStream& operator >> (nsInputStream&, nsPersistentFileDescriptor&);
|
||||
// reads the data from a file
|
||||
friend NS_BASE nsOutputStream& operator << (nsOutputStream&, const nsPersistentFileDescriptor&);
|
||||
// writes the data to a file
|
||||
friend class nsFileSpec;
|
||||
|
||||
private:
|
||||
// Here are the ways to get data in and out of a file.
|
||||
void GetData(void*& outData, PRInt32& outSize) const;
|
||||
// DON'T FREE the returned data!
|
||||
void SetData(const void* inData, PRInt32 inSize);
|
||||
|
||||
private:
|
||||
|
||||
char* mDescriptorString;
|
||||
|
||||
}; // class nsPersistentFileDescriptor
|
||||
|
||||
//========================================================================================
|
||||
class NS_BASE nsDirectoryIterator
|
||||
// Example:
|
||||
//
|
||||
// nsFileSpec parentDir(...); // directory over whose children we shall iterate
|
||||
// for (nsDirectoryIterator i(parentDir); i; i++)
|
||||
// {
|
||||
// // do something with (const nsFileSpec&)i
|
||||
// }
|
||||
//
|
||||
// or:
|
||||
//
|
||||
// for (nsDirectoryIterator i(parentDir, PR_FALSE); i; i--)
|
||||
// {
|
||||
// // do something with (const nsFileSpec&)i
|
||||
// }
|
||||
//
|
||||
// Currently, the only platform on which backwards iteration actually goes backwards
|
||||
// is Macintosh. On other platforms, both styles will work, but will go forwards.
|
||||
//========================================================================================
|
||||
{
|
||||
public:
|
||||
nsDirectoryIterator(
|
||||
const nsFileSpec& parent,
|
||||
int iterateDirection = +1);
|
||||
#ifndef XP_MAC
|
||||
// Macintosh currently doesn't allocate, so needn't clean up.
|
||||
virtual ~nsDirectoryIterator();
|
||||
#endif
|
||||
PRBool Exists() const { return mExists; }
|
||||
nsDirectoryIterator& operator ++(); // moves to the next item, if any.
|
||||
nsDirectoryIterator& operator ++(int) { return ++(*this); } // post-increment.
|
||||
nsDirectoryIterator& operator --(); // moves to the previous item, if any.
|
||||
nsDirectoryIterator& operator --(int) { return --(*this); } // post-decrement.
|
||||
operator nsFileSpec&() { return mCurrent; }
|
||||
private:
|
||||
nsFileSpec mCurrent;
|
||||
PRBool mExists;
|
||||
|
||||
#if defined(XP_UNIX)
|
||||
DIR* mDir;
|
||||
#elif defined(XP_PC)
|
||||
PRDir* mDir; // XXX why not use PRDir for Unix & Mac, too?
|
||||
#elif defined(XP_MAC)
|
||||
OSErr SetToIndex();
|
||||
short mIndex;
|
||||
short mMaxIndex;
|
||||
#endif
|
||||
}; // class nsDirectoryIterator
|
||||
|
||||
#endif // _FILESPEC_H_
|
||||
622
mozilla/base/public/nsFileStream.h
Normal file
622
mozilla/base/public/nsFileStream.h
Normal file
@@ -0,0 +1,622 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0(the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright(C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
// First checked in on 98/11/20 by John R. McMullen in the wrong directory.
|
||||
// Checked in again 98/12/04.
|
||||
// Polished version 98/12/08.
|
||||
// Completely rewritten to integrate with nsIInputStream and nsIOutputStream (the
|
||||
// xpcom stream objects.
|
||||
|
||||
//========================================================================================
|
||||
//
|
||||
// Classes defined:
|
||||
//
|
||||
// nsInputStream, nsOutputStream
|
||||
// These are the lightweight STATICALLY LINKED wrappers for
|
||||
// the xpcom objects nsIInputStream and nsIOutputstream.
|
||||
// Possible uses:
|
||||
// If you are implementing a function that accepts one of these xpcom
|
||||
// streams, just make one of these little jobbies on the stack, and
|
||||
// the handy << or >> notation can be yours.
|
||||
//
|
||||
// nsInputFileStream, nsOutputFileStream
|
||||
// These are the STATICALLY LINKED versions of the file i/o streams,
|
||||
// which wrap the NSPR file i/o plus console i/o.
|
||||
//
|
||||
// Related files:
|
||||
// prio.h the NSPR file i/o C API), which is wrapped by
|
||||
// THIS FILE statically linked C++ wrappers, which in turn are wrapped by
|
||||
// nsIFileStream.h COM wrappers for this file, which are wrapped by
|
||||
// nsAutoFileStream.h more easily used, nicer syntax wrappers for the
|
||||
// COMified ones. Wrapper of a wrapper of a wrapper.
|
||||
//
|
||||
// This suite provide the following services:
|
||||
//
|
||||
// 1. Encapsulates all platform-specific file details, so that file i/o
|
||||
// can be done correctly without any platform #ifdefs
|
||||
//
|
||||
// 2. Uses NSPR file services (NOT ansi file I/O), in order to get best
|
||||
// native performance. This performance difference is especially large on
|
||||
// macintosh.
|
||||
//
|
||||
// 3. Allows all the power of the ansi stream syntax.
|
||||
//
|
||||
// Basic example:
|
||||
//
|
||||
// nsFileSpec myPath("/Development/iotest.txt");
|
||||
//
|
||||
// nsOutputFileStream testStream(myPath);
|
||||
// testStream << "Hello World" << nsEndl;
|
||||
//
|
||||
// 4. Requires streams to be constructed using typesafe nsFileSpec specifier
|
||||
// (not the notorious and bug prone const char*), namely nsFileSpec. See
|
||||
// nsFileSpec.h for more details.
|
||||
//
|
||||
// 5. Fixes a bug that have been there for a long time, and
|
||||
// is inevitable if you use NSPR alone:
|
||||
//
|
||||
// The problem on platforms (Macintosh) in which a path does not fully
|
||||
// specify a file, because two volumes can have the same name.
|
||||
//
|
||||
// Not yet provided:
|
||||
//
|
||||
// Endian-awareness for reading and writing crossplatform binary files. At this
|
||||
// time there seems to be no demand for this.
|
||||
//
|
||||
//========================================================================================
|
||||
|
||||
#ifndef _FILESTREAM_H_
|
||||
#define _FILESTREAM_H_
|
||||
|
||||
#include "nscore.h"
|
||||
|
||||
#ifdef XP_MAC
|
||||
#include "pprio.h" // To get PR_ImportFile
|
||||
#else
|
||||
#include "prio.h"
|
||||
#endif
|
||||
|
||||
#include "nsIFileStream.h"
|
||||
#include "nsCOMPtr.h"
|
||||
|
||||
class nsFileSpec;
|
||||
class nsInputFileStream;
|
||||
class nsOutputFileStream;
|
||||
|
||||
//========================================================================================
|
||||
// Compiler-specific macros, as needed
|
||||
//========================================================================================
|
||||
#if !defined(NS_USING_NAMESPACE) && (defined(__MWERKS__) || defined(XP_PC))
|
||||
#define NS_USING_NAMESPACE
|
||||
#endif
|
||||
|
||||
#if !defined(NS_USING_STL) && (defined(__MWERKS__) || defined(XP_PC))
|
||||
#define NS_USING_STL
|
||||
#endif
|
||||
|
||||
#ifdef NS_USING_NAMESPACE
|
||||
|
||||
#define NS_NAMESPACE_PROTOTYPE
|
||||
#define NS_NAMESPACE namespace
|
||||
#define NS_NAMESPACE_END
|
||||
|
||||
#else
|
||||
|
||||
#define NS_NAMESPACE_PROTOTYPE static
|
||||
#define NS_NAMESPACE struct
|
||||
#define NS_NAMESPACE_END ;
|
||||
|
||||
#endif // NS_USING_NAMESPACE
|
||||
|
||||
#ifndef XP_MAC
|
||||
// PR_STDOUT and PR_STDIN are fatal on Macintosh. So for console i/o, we must use the std
|
||||
// stream stuff instead. However, we have to require that cout and cin are passed in
|
||||
// to the constructor because in the current build, there is a copy in the base.shlb,
|
||||
// and another in the caller's file. Passing it in as a parameter ensures that the
|
||||
// caller and this library are using the same global object. Groan.
|
||||
//
|
||||
// Unix currently does not support iostreams at all. Their compilers do not support
|
||||
// ANSI C++, or even ARM C++.
|
||||
//
|
||||
// Windows supports them, but only if you turn on the -GX compile flag, to support
|
||||
// exceptions.
|
||||
|
||||
// Catch 22.
|
||||
#define NS_USE_PR_STDIO
|
||||
#endif
|
||||
|
||||
#ifdef NS_USE_PR_STDIO
|
||||
class istream;
|
||||
class ostream;
|
||||
#define CONSOLE_IN 0
|
||||
#define CONSOLE_OUT 0
|
||||
#else
|
||||
#include <iostream>
|
||||
using std::istream;
|
||||
using std::ostream;
|
||||
#define CONSOLE_IN &std::cin
|
||||
#define CONSOLE_OUT &std::cout
|
||||
#endif
|
||||
|
||||
//=========================== End Compiler-specific macros ===============================
|
||||
|
||||
//========================================================================================
|
||||
class NS_BASE nsInputStream
|
||||
// This is a convenience class, for use on the STACK ("new" junkies: get detoxed first).
|
||||
// Given a COM-style stream, this allows you to use the >> operators. It also acquires and
|
||||
// reference counts its stream.
|
||||
// Please read the comments at the top of this file
|
||||
//========================================================================================
|
||||
{
|
||||
public:
|
||||
nsInputStream(nsIInputStream* inStream)
|
||||
: mInputStream(do_QueryInterface(inStream))
|
||||
, mEOF(PR_FALSE)
|
||||
{}
|
||||
virtual ~nsInputStream();
|
||||
|
||||
nsCOMPtr<nsIInputStream> GetIStream() const
|
||||
{
|
||||
return mInputStream;
|
||||
}
|
||||
char eof() const { return get_at_eof(); }
|
||||
char get();
|
||||
void close()
|
||||
{
|
||||
mInputStream->Close();
|
||||
}
|
||||
PRInt32 read(void* s, PRInt32 n)
|
||||
{
|
||||
if (!mInputStream)
|
||||
return 0;
|
||||
PRInt32 result = 0;
|
||||
mInputStream->Read((char*)s, 0, n, (PRUint32*)&result);
|
||||
if (result < n)
|
||||
set_at_eof(PR_TRUE);
|
||||
return result;
|
||||
}
|
||||
|
||||
// Input streamers. Add more as needed (int&, unsigned int& etc). (but you have to
|
||||
// add delegators to the derived classes, too, because these operators don't inherit).
|
||||
nsInputStream& operator >> (char& ch);
|
||||
|
||||
// Support manipulators
|
||||
nsInputStream& operator >> (nsInputStream& (*pf)(nsInputStream&))
|
||||
{
|
||||
return pf(*this);
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
// These certainly need to be overridden, they give the best shot we can at detecting
|
||||
// eof in a simple nsIInputStream.
|
||||
virtual void set_at_eof(PRBool atEnd)
|
||||
{
|
||||
mEOF = atEnd;
|
||||
}
|
||||
virtual PRBool get_at_eof() const
|
||||
{
|
||||
return mEOF;
|
||||
}
|
||||
private:
|
||||
|
||||
nsInputStream& operator >> (char* buf); // TOO DANGEROUS. DON'T DEFINE.
|
||||
|
||||
// DATA
|
||||
protected:
|
||||
nsCOMPtr<nsIInputStream> mInputStream;
|
||||
PRBool mEOF;
|
||||
}; // class nsInputStream
|
||||
|
||||
typedef nsInputStream nsBasicInStream; // historic support for this name
|
||||
|
||||
//========================================================================================
|
||||
class NS_BASE nsOutputStream
|
||||
// This is a convenience class, for use on the STACK ("new" junkies, get detoxed first).
|
||||
// Given a COM-style stream, this allows you to use the << operators. It also acquires and
|
||||
// reference counts its stream.
|
||||
// Please read the comments at the top of this file
|
||||
//========================================================================================
|
||||
{
|
||||
public:
|
||||
nsOutputStream() {}
|
||||
nsOutputStream(nsIOutputStream* inStream)
|
||||
: mOutputStream(do_QueryInterface(inStream))
|
||||
{}
|
||||
|
||||
virtual ~nsOutputStream();
|
||||
|
||||
nsCOMPtr<nsIOutputStream> GetIStream() const
|
||||
{
|
||||
return mOutputStream;
|
||||
}
|
||||
void close()
|
||||
{
|
||||
mOutputStream->Close();
|
||||
}
|
||||
void put(char c);
|
||||
PRInt32 write(const void* s, PRInt32 n)
|
||||
{
|
||||
if (!mOutputStream)
|
||||
return 0;
|
||||
PRInt32 result = 0;
|
||||
mOutputStream->Write((char*)s, 0, n, (PRUint32*)&result);
|
||||
return result;
|
||||
}
|
||||
virtual void flush();
|
||||
|
||||
// Output streamers. Add more as needed (but you have to add delegators to the derived
|
||||
// classes, too, because these operators don't inherit).
|
||||
nsOutputStream& operator << (const char* buf);
|
||||
nsOutputStream& operator << (char ch);
|
||||
nsOutputStream& operator << (short val);
|
||||
nsOutputStream& operator << (unsigned short val);
|
||||
nsOutputStream& operator << (long val);
|
||||
nsOutputStream& operator << (unsigned long val);
|
||||
|
||||
// Support manipulators
|
||||
nsOutputStream& operator << (nsOutputStream& (*pf)(nsOutputStream&))
|
||||
{
|
||||
return pf(*this);
|
||||
}
|
||||
|
||||
// DATA
|
||||
protected:
|
||||
nsCOMPtr<nsIOutputStream> mOutputStream;
|
||||
}; // class nsOutputStream
|
||||
|
||||
typedef nsOutputStream nsBasicOutStream; // Historic support for this name
|
||||
|
||||
//========================================================================================
|
||||
class NS_BASE nsFileClient
|
||||
// Because COM does not allow us to write functions which return a boolean value etc,
|
||||
// this class is here to take care of the tedious "declare variable then call with
|
||||
// the address of the variable" chores.
|
||||
//========================================================================================
|
||||
{
|
||||
public:
|
||||
nsFileClient() // for delayed opening
|
||||
: mResult(NS_OK)
|
||||
{
|
||||
}
|
||||
nsFileClient(const nsCOMPtr<nsIFile>& inFile)
|
||||
: mFile(do_QueryInterface(inFile))
|
||||
, mResult(NS_OK)
|
||||
{
|
||||
}
|
||||
virtual ~nsFileClient() {}
|
||||
|
||||
PRBool is_file() const
|
||||
{
|
||||
return mFile ? PR_TRUE : PR_FALSE;
|
||||
}
|
||||
void open(
|
||||
const nsFileSpec& inFile,
|
||||
int nsprMode,
|
||||
PRIntn accessMode)
|
||||
{
|
||||
if (mFile)
|
||||
mResult = mFile->Open(inFile, nsprMode, accessMode);
|
||||
}
|
||||
PRBool is_open() const
|
||||
{
|
||||
PRBool result = PR_FALSE;
|
||||
if (mFile)
|
||||
mFile->GetIsOpen(&result);
|
||||
return result;
|
||||
}
|
||||
PRBool failed() const
|
||||
{
|
||||
return NS_FAILED(mResult);
|
||||
}
|
||||
void seek(PRInt32 offset)
|
||||
{
|
||||
seek(PR_SEEK_SET, offset);
|
||||
}
|
||||
|
||||
void seek(PRSeekWhence whence, PRInt32 offset)
|
||||
{
|
||||
set_at_eof(PR_FALSE);
|
||||
if (mFile)
|
||||
mResult = mFile->Seek(whence, offset);
|
||||
}
|
||||
PRIntn tell()
|
||||
{
|
||||
PRIntn result = -1;
|
||||
if (mFile)
|
||||
mResult = mFile->Tell(&result);
|
||||
return result;
|
||||
}
|
||||
protected:
|
||||
|
||||
virtual PRBool get_at_eof() const
|
||||
{
|
||||
PRBool result;
|
||||
if (mFile)
|
||||
mFile->GetAtEOF(&result);
|
||||
return result;
|
||||
}
|
||||
|
||||
virtual void set_at_eof(PRBool atEnd)
|
||||
{
|
||||
if (mFile)
|
||||
mFile->SetAtEOF(atEnd);
|
||||
}
|
||||
|
||||
// DATA
|
||||
protected:
|
||||
nsCOMPtr<nsIFile> mFile;
|
||||
PRBool mResult;
|
||||
}; // class nsFileClient
|
||||
|
||||
//========================================================================================
|
||||
class NS_BASE nsInputFileStream
|
||||
// Please read the comments at the top of this file
|
||||
//========================================================================================
|
||||
: public nsInputStream
|
||||
, public nsFileClient
|
||||
{
|
||||
public:
|
||||
enum { kDefaultMode = PR_RDONLY };
|
||||
nsInputFileStream(nsIInputStream* inStream)
|
||||
: nsInputStream(inStream)
|
||||
, nsFileClient(do_QueryInterface(inStream))
|
||||
, mFileInputStream(do_QueryInterface(inStream))
|
||||
{
|
||||
}
|
||||
nsInputFileStream(
|
||||
const nsFileSpec& inFile,
|
||||
int nsprMode = kDefaultMode,
|
||||
PRIntn accessMode = 00700) // <- OCTAL
|
||||
: nsInputStream(nsnull)
|
||||
{
|
||||
nsISupports* stream;
|
||||
NS_NewIOFileStream(
|
||||
&stream,
|
||||
inFile, nsprMode, accessMode);
|
||||
mFile = nsQueryInterface(stream);
|
||||
mInputStream = nsQueryInterface(stream);
|
||||
mFileInputStream = nsQueryInterface(stream);
|
||||
NS_RELEASE(stream);
|
||||
}
|
||||
|
||||
PRBool readline(char* s, PRInt32 n);
|
||||
// Result always null-terminated.
|
||||
// Check eof() before each call.
|
||||
// CAUTION: false result only indicates line was truncated
|
||||
// to fit buffer, or an error occurred (OTHER THAN eof).
|
||||
|
||||
void Open(
|
||||
const nsFileSpec& inFile,
|
||||
int nsprMode = kDefaultMode,
|
||||
PRIntn accessMode = 00700) // <- OCTAL
|
||||
{
|
||||
if (mFile)
|
||||
mFile->Open(inFile, nsprMode, accessMode);
|
||||
}
|
||||
|
||||
// Input streamers. Unfortunately, they don't inherit!
|
||||
nsInputStream& operator >> (char& ch)
|
||||
{ return nsInputStream::operator >>(ch); }
|
||||
nsInputStream& operator >> (nsInputStream& (*pf)(nsInputStream&))
|
||||
{ return nsInputStream::operator >>(pf); }
|
||||
|
||||
protected:
|
||||
|
||||
virtual PRBool get_at_eof() const
|
||||
{
|
||||
return nsFileClient::get_at_eof();
|
||||
}
|
||||
|
||||
virtual void set_at_eof(PRBool atEnd)
|
||||
{
|
||||
nsFileClient::set_at_eof(atEnd);
|
||||
}
|
||||
|
||||
|
||||
// DATA
|
||||
protected:
|
||||
nsCOMPtr<nsIFileInputStream> mFileInputStream;
|
||||
}; // class nsInputFileStream
|
||||
|
||||
//========================================================================================
|
||||
class NS_BASE nsOutputFileStream
|
||||
// Please read the comments at the top of this file
|
||||
//========================================================================================
|
||||
: public nsOutputStream
|
||||
, public nsFileClient
|
||||
{
|
||||
public:
|
||||
enum { kDefaultMode = (PR_WRONLY | PR_CREATE_FILE | PR_TRUNCATE) };
|
||||
|
||||
nsOutputFileStream() {}
|
||||
nsOutputFileStream(nsIOutputStream* inStream)
|
||||
: nsOutputStream(inStream)
|
||||
, nsFileClient(do_QueryInterface(inStream))
|
||||
, mFileOutputStream(do_QueryInterface(inStream))
|
||||
{
|
||||
}
|
||||
nsOutputFileStream(
|
||||
const nsFileSpec& inFile,
|
||||
int nsprMode = kDefaultMode,
|
||||
PRIntn accessMode = 00700) // <- OCTAL
|
||||
: nsOutputStream(nsnull)
|
||||
{
|
||||
nsISupports* stream;
|
||||
if (NS_FAILED(NS_NewIOFileStream(
|
||||
&stream,
|
||||
inFile, nsprMode, accessMode)))
|
||||
return;
|
||||
mFile = nsQueryInterface(stream);
|
||||
mOutputStream = nsQueryInterface(stream);
|
||||
mFileOutputStream = nsQueryInterface(stream);
|
||||
NS_RELEASE(stream);
|
||||
}
|
||||
|
||||
virtual void flush();
|
||||
|
||||
// Output streamers. Unfortunately, they don't inherit!
|
||||
nsOutputStream& operator << (const char* buf)
|
||||
{ return nsOutputStream::operator << (buf); }
|
||||
nsOutputStream& operator << (char ch)
|
||||
{ return nsOutputStream::operator << (ch); }
|
||||
nsOutputStream& operator << (short val)
|
||||
{ return nsOutputStream::operator << (val); }
|
||||
nsOutputStream& operator << (unsigned short val)
|
||||
{ return nsOutputStream::operator << (val); }
|
||||
nsOutputStream& operator << (long val)
|
||||
{ return nsOutputStream::operator << (val); }
|
||||
nsOutputStream& operator << (unsigned long val)
|
||||
{ return nsOutputStream::operator << (val); }
|
||||
nsOutputStream& operator << (nsOutputStream& (*pf)(nsOutputStream&))
|
||||
{ return nsOutputStream::operator << (pf); }
|
||||
|
||||
protected:
|
||||
|
||||
virtual PRBool get_at_eof() const
|
||||
{
|
||||
return nsFileClient::get_at_eof();
|
||||
}
|
||||
|
||||
virtual void set_at_eof(PRBool atEnd)
|
||||
{
|
||||
nsFileClient::set_at_eof(atEnd);
|
||||
}
|
||||
|
||||
// DATA
|
||||
protected:
|
||||
nsCOMPtr<nsIFileOutputStream> mFileOutputStream;
|
||||
}; // class nsOutputFileStream
|
||||
|
||||
//========================================================================================
|
||||
class NS_BASE nsOutputConsoleStream
|
||||
// Please read the comments at the top of this file
|
||||
//========================================================================================
|
||||
: public nsOutputFileStream
|
||||
{
|
||||
public:
|
||||
|
||||
nsOutputConsoleStream()
|
||||
{
|
||||
nsISupports* stream;
|
||||
if (NS_FAILED(NS_NewOutputConsoleStream(&stream)))
|
||||
return;
|
||||
mFile = nsQueryInterface(stream);
|
||||
mOutputStream = nsQueryInterface(stream);
|
||||
mFileOutputStream = nsQueryInterface(stream);
|
||||
NS_RELEASE(stream);
|
||||
}
|
||||
|
||||
// Output streamers. Unfortunately, they don't inherit!
|
||||
nsOutputStream& operator << (const char* buf)
|
||||
{ return nsOutputStream::operator << (buf); }
|
||||
nsOutputStream& operator << (char ch)
|
||||
{ return nsOutputStream::operator << (ch); }
|
||||
nsOutputStream& operator << (short val)
|
||||
{ return nsOutputStream::operator << (val); }
|
||||
nsOutputStream& operator << (unsigned short val)
|
||||
{ return nsOutputStream::operator << (val); }
|
||||
nsOutputStream& operator << (long val)
|
||||
{ return nsOutputStream::operator << (val); }
|
||||
nsOutputStream& operator << (unsigned long val)
|
||||
{ return nsOutputStream::operator << (val); }
|
||||
nsOutputStream& operator << (nsOutputStream& (*pf)(nsOutputStream&))
|
||||
{ return nsOutputStream::operator << (pf); }
|
||||
|
||||
}; // class nsOutputConsoleStream
|
||||
|
||||
//========================================================================================
|
||||
class NS_BASE nsIOFileStream
|
||||
// Please read the comments at the top of this file
|
||||
//========================================================================================
|
||||
: public nsInputFileStream
|
||||
, public nsOutputStream
|
||||
{
|
||||
public:
|
||||
enum { kDefaultMode = (PR_RDWR | PR_CREATE_FILE) };
|
||||
|
||||
nsIOFileStream(
|
||||
nsIInputStream* inInputStream
|
||||
, nsIOutputStream* inOutputStream)
|
||||
: nsInputFileStream(inInputStream)
|
||||
, nsOutputStream(inOutputStream)
|
||||
, mFileOutputStream(do_QueryInterface(inOutputStream))
|
||||
{
|
||||
}
|
||||
nsIOFileStream(
|
||||
const nsFileSpec& inFile,
|
||||
int nsprMode = kDefaultMode,
|
||||
PRIntn accessMode = 00700) // <- OCTAL
|
||||
: nsInputFileStream(nsnull)
|
||||
, nsOutputStream(nsnull)
|
||||
{
|
||||
nsISupports* stream;
|
||||
if (NS_FAILED(NS_NewIOFileStream(
|
||||
&stream,
|
||||
inFile, nsprMode, accessMode)))
|
||||
return;
|
||||
mFile = nsQueryInterface(stream);
|
||||
mInputStream = nsQueryInterface(stream);
|
||||
mOutputStream = nsQueryInterface(stream);
|
||||
mFileInputStream = nsQueryInterface(stream);
|
||||
mFileOutputStream = nsQueryInterface(stream);
|
||||
NS_RELEASE(stream);
|
||||
}
|
||||
|
||||
virtual void close()
|
||||
{
|
||||
// Doesn't matter which of the two we close:
|
||||
// they're hooked up to the same file.
|
||||
nsInputFileStream::close();
|
||||
}
|
||||
|
||||
// Output streamers. Unfortunately, they don't inherit!
|
||||
nsOutputStream& operator << (const char* buf)
|
||||
{ return nsOutputStream::operator << (buf); }
|
||||
nsOutputStream& operator << (char ch)
|
||||
{ return nsOutputStream::operator << (ch); }
|
||||
nsOutputStream& operator << (short val)
|
||||
{ return nsOutputStream::operator << (val); }
|
||||
nsOutputStream& operator << (unsigned short val)
|
||||
{ return nsOutputStream::operator << (val); }
|
||||
nsOutputStream& operator << (long val)
|
||||
{ return nsOutputStream::operator << (val); }
|
||||
nsOutputStream& operator << (unsigned long val)
|
||||
{ return nsOutputStream::operator << (val); }
|
||||
nsOutputStream& operator << (nsOutputStream& (*pf)(nsOutputStream&))
|
||||
{ return nsOutputStream::operator << (pf); }
|
||||
|
||||
// Input streamers. Unfortunately, they don't inherit!
|
||||
nsInputStream& operator >> (char& ch)
|
||||
{ return nsInputStream::operator >>(ch); }
|
||||
nsInputStream& operator >> (nsInputStream& (*pf)(nsInputStream&))
|
||||
{ return nsInputStream::operator >>(pf); }
|
||||
|
||||
// DATA
|
||||
protected:
|
||||
nsCOMPtr<nsIFileOutputStream> mFileOutputStream;
|
||||
}; // class nsIOFileStream
|
||||
|
||||
//========================================================================================
|
||||
// Manipulators
|
||||
//========================================================================================
|
||||
|
||||
NS_BASE nsOutputStream& nsEndl(nsOutputStream& os); // outputs and FLUSHES.
|
||||
|
||||
|
||||
#endif /* _FILESTREAM_H_ */
|
||||
131
mozilla/base/public/nsIFileStream.h
Normal file
131
mozilla/base/public/nsIFileStream.h
Normal file
@@ -0,0 +1,131 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
#ifndef nsIFileStream_h___
|
||||
#define nsIFileStream_h___
|
||||
|
||||
#include "nsIInputStream.h"
|
||||
#include "nsIOutputStream.h"
|
||||
#include "prio.h"
|
||||
|
||||
class nsFileSpec;
|
||||
|
||||
/* a6cf90e8-15b3-11d2-932e-00805f8add32 */
|
||||
#define NS_IFILE_IID \
|
||||
{ 0xa6cf90e8, 0x15b3, 0x11d2, \
|
||||
{0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32} }
|
||||
|
||||
//========================================================================================
|
||||
class nsIFile
|
||||
// Represents a file, and supports Open, Tell etc.
|
||||
//========================================================================================
|
||||
: public nsISupports
|
||||
{
|
||||
public:
|
||||
static const nsIID& IID() { static nsIID iid = NS_IFILE_IID; return iid; }
|
||||
NS_IMETHOD Open(
|
||||
const nsFileSpec& inFile,
|
||||
int nsprMode,
|
||||
PRIntn accessMode) = 0;
|
||||
// Note: Open() is only needed after
|
||||
// an explicit Close(). All file streams
|
||||
// are automatically opened on construction.
|
||||
NS_IMETHOD Seek(PRSeekWhence whence, PRInt32 offset) = 0;
|
||||
NS_IMETHOD GetIsOpen(PRBool* outOpen) = 0;
|
||||
NS_IMETHOD Tell(PRIntn* outWhere) = 0;
|
||||
|
||||
/* "PROTECTED" */
|
||||
NS_IMETHOD GetAtEOF(PRBool* outAtEOF) = 0;
|
||||
NS_IMETHOD SetAtEOF(PRBool inAtEOF) = 0;
|
||||
}; // class nsIFile
|
||||
|
||||
/* a6cf90e6-15b3-11d2-932e-00805f8add32 */
|
||||
#define NS_IFILEINPUTSTREAM_IID \
|
||||
{ 0xa6cf90e6, 0x15b3, 0x11d2, \
|
||||
{0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32} }
|
||||
|
||||
//========================================================================================
|
||||
class nsIFileInputStream
|
||||
// These are additional file-specific methods that files have, above what
|
||||
// nsIInputStream supports. The current implementation supports both
|
||||
// interfaces.
|
||||
//========================================================================================
|
||||
: public nsISupports
|
||||
{
|
||||
public:
|
||||
static const nsIID& IID() { static nsIID iid = NS_IFILEINPUTSTREAM_IID; return iid; }
|
||||
}; // class nsIFileInputStream
|
||||
|
||||
/* a6cf90e7-15b3-11d2-932e-00805f8add32 */
|
||||
#define NS_IFILEOUTPUTSTREAM_IID \
|
||||
{ 0xa6cf90e7, 0x15b3, 0x11d2, \
|
||||
{0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32} }
|
||||
|
||||
//========================================================================================
|
||||
class nsIFileOutputStream
|
||||
// These are additional file-specific methods that files have, above what
|
||||
// nsIOutputStream supports. The current implementation supports both
|
||||
// interfaces.
|
||||
//========================================================================================
|
||||
: public nsISupports
|
||||
{
|
||||
public:
|
||||
static const nsIID& IID() { static nsIID iid = NS_IFILEOUTPUTSTREAM_IID; return iid; }
|
||||
NS_IMETHOD Flush() = 0;
|
||||
// Forces a write to disk.
|
||||
}; // class nsIFileOutputStream
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
extern "C" NS_BASE nsresult NS_NewTypicalInputFileStream(
|
||||
nsISupports** aStreamResult,
|
||||
const nsFileSpec& inFile
|
||||
/*Default nsprMode == PR_RDONLY*/
|
||||
/*Default accessmode = 0700 (octal)*/);
|
||||
// Factory method to get an nsInputStream from a file, using most common options
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
extern "C" NS_BASE nsresult NS_NewOutputConsoleStream(
|
||||
nsISupports** aStreamResult);
|
||||
// Factory method to get an nsOutputStream to the console.
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
extern "C" NS_BASE nsresult NS_NewTypicalOutputFileStream(
|
||||
nsISupports** aStreamResult, // will implement all the above interfaces
|
||||
const nsFileSpec& inFile
|
||||
/*default nsprMode= (PR_WRONLY | PR_CREATE_FILE | PR_TRUNCATE)*/
|
||||
/*Default accessMode= 0700 (octal)*/);
|
||||
// Factory method to get an nsOutputStream to a file - most common case.
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
extern "C" NS_BASE nsresult NS_NewTypicalIOFileStream(
|
||||
nsISupports** aStreamResult, // will implement all the above interfaces
|
||||
const nsFileSpec& inFile
|
||||
/*default nsprMode = (PR_RDWR | PR_CREATE_FILE)*/
|
||||
/*Default accessMode = 0700 (octal)*/);
|
||||
// Factory method to get an object that implements both nsIInputStream
|
||||
// and nsIOutputStream, associated with a single file.
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
extern "C" NS_BASE nsresult NS_NewIOFileStream(
|
||||
nsISupports** aStreamResult, // will implement all the above interfaces
|
||||
const nsFileSpec& inFile,
|
||||
PRInt32 nsprMode,
|
||||
PRInt32 accessMode);
|
||||
// Factory method to get an object that implements both nsIInputStream
|
||||
// and nsIOutputStream, associated with a single file.
|
||||
|
||||
#endif /* nsIFileStream_h___ */
|
||||
48
mozilla/base/public/nsIProperties.h
Normal file
48
mozilla/base/public/nsIProperties.h
Normal file
@@ -0,0 +1,48 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
#ifndef nsIProperties_h___
|
||||
#define nsIProperties_h___
|
||||
|
||||
#include "nsID.h"
|
||||
#include "nsIInputStream.h"
|
||||
#include "nsIOutputStream.h"
|
||||
#include "nsISupports.h"
|
||||
#include "nsString.h"
|
||||
|
||||
// {1A180F60-93B2-11d2-9B8B-00805F8A16D9}
|
||||
#define NS_IPROPERTIES_IID \
|
||||
{ 0x1a180f60, 0x93b2, 0x11d2, \
|
||||
{ 0x9b, 0x8b, 0x0, 0x80, 0x5f, 0x8a, 0x16, 0xd9 } }
|
||||
|
||||
// {2245E573-9464-11d2-9B8B-00805F8A16D9}
|
||||
NS_DECLARE_ID(kPropertiesCID,
|
||||
0x2245e573, 0x9464, 0x11d2, 0x9b, 0x8b, 0x0, 0x80, 0x5f, 0x8a, 0x16, 0xd9);
|
||||
|
||||
class nsIProperties : public nsISupports
|
||||
{
|
||||
public:
|
||||
NS_IMETHOD Load(nsIInputStream* aIn) = 0;
|
||||
NS_IMETHOD GetProperty(const nsString& aKey, nsString& aValue) = 0;
|
||||
NS_IMETHOD SetProperty(const nsString& aKey, nsString& aNewValue,
|
||||
nsString& aOldValue) = 0;
|
||||
NS_IMETHOD Save(nsIOutputStream* aOut, const nsString& aHeader) = 0;
|
||||
NS_IMETHOD Subclass(nsIProperties* aSubclass) = 0;
|
||||
};
|
||||
|
||||
#endif /* nsIProperties_h___ */
|
||||
66
mozilla/base/public/nsISizeOfHandler.h
Normal file
66
mozilla/base/public/nsISizeOfHandler.h
Normal file
@@ -0,0 +1,66 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
#ifndef nsISizeOfHandler_h___
|
||||
#define nsISizeOfHandler_h___
|
||||
|
||||
#include "nscore.h"
|
||||
#include "nsISupports.h"
|
||||
|
||||
/* c028d1f0-fc9e-11d1-89e4-006008911b81 */
|
||||
#define NS_ISIZEOF_HANDLER_IID \
|
||||
{ 0xc028d1f0, 0xfc9e, 0x11d1, {0x89, 0xe4, 0x00, 0x60, 0x08, 0x91, 0x1b, 0x81}}
|
||||
|
||||
/**
|
||||
* An API to managing a sizeof computation of an arbitrary graph.
|
||||
* The handler is responsible for remembering which objects have been
|
||||
* seen before. Note that the handler doesn't hold references to
|
||||
* nsISupport's objects; the assumption is that the objects being
|
||||
* sized are stationary and will not be modified during the sizing
|
||||
* computation and therefore do not need an extra reference count.
|
||||
*/
|
||||
class nsISizeOfHandler : public nsISupports {
|
||||
public:
|
||||
/**
|
||||
* Add in a simple size value to the running total.
|
||||
* Always returns NS_OK.
|
||||
*/
|
||||
NS_IMETHOD Add(size_t aSize) = 0;
|
||||
|
||||
/**
|
||||
* Update aResult with PR_TRUE if the object has been traversed
|
||||
* by the sizeof computation before. Otherwise aResult is set to
|
||||
* PR_FALSE and the object is added to the internal database
|
||||
* of objects that have been traversed. It's ok to pass a null
|
||||
* pointer in; aResult will be set to PR_TRUE so you won't accidently
|
||||
* try to traverse through null pointer.
|
||||
*
|
||||
* Note: This violates the COM API standard on purpose; so there!
|
||||
*/
|
||||
virtual PRBool HaveSeen(void* anObject) = 0;
|
||||
|
||||
/**
|
||||
* Return the currently computed size.
|
||||
* Always returns NS_OK.
|
||||
*/
|
||||
NS_IMETHOD GetSize(PRUint32& aResult) = 0;
|
||||
};
|
||||
|
||||
extern NS_BASE nsresult
|
||||
NS_NewSizeOfHandler(nsISizeOfHandler** aInstancePtrResult);
|
||||
|
||||
#endif /* nsISizeofHandler_h___ */
|
||||
60
mozilla/base/public/nsRepeater.h
Normal file
60
mozilla/base/public/nsRepeater.h
Normal file
@@ -0,0 +1,60 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
#ifndef nsRepeater_h___
|
||||
#define nsRepeater_h___
|
||||
|
||||
#include "nscore.h"
|
||||
|
||||
class EventRecord;
|
||||
|
||||
class NS_BASE Repeater {
|
||||
public:
|
||||
|
||||
Repeater();
|
||||
virtual ~Repeater();
|
||||
|
||||
virtual void RepeatAction(const EventRecord &aMacEvent) = 0;
|
||||
|
||||
void StartRepeating();
|
||||
void StopRepeating();
|
||||
void StartIdling();
|
||||
void StopIdling();
|
||||
|
||||
static void DoRepeaters(const EventRecord &aMacEvent);
|
||||
static void DoIdlers(const EventRecord &aMacEvent);
|
||||
|
||||
protected:
|
||||
|
||||
void AddToRepeatList();
|
||||
void RemoveFromRepeatList();
|
||||
void AddToIdleList();
|
||||
void RemoveFromIdleList();
|
||||
|
||||
static Repeater* sRepeaters;
|
||||
static Repeater* sIdlers;
|
||||
|
||||
bool mRepeating;
|
||||
bool mIdling;
|
||||
Repeater* mPrevRptr;
|
||||
Repeater* mNextRptr;
|
||||
Repeater* mPrevIdlr;
|
||||
Repeater* mNextIdlr;
|
||||
};
|
||||
|
||||
#endif
|
||||
939
mozilla/base/public/nsStdFileStream.h
Normal file
939
mozilla/base/public/nsStdFileStream.h
Normal file
@@ -0,0 +1,939 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0(the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright(C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
#error "Do not use this file. The unix compilers do not support standard C++. Use nsFileStream"
|
||||
|
||||
// First checked in on 98/11/20 by John R. McMullen in the wrong directory.
|
||||
// Checked in again 98/12/04.
|
||||
// Polished version 98/12/08.
|
||||
|
||||
//========================================================================================
|
||||
//
|
||||
// Classes defined:
|
||||
//
|
||||
// single-byte char:
|
||||
//
|
||||
// nsInputFileStream, nsOutputFileStream, nsIOFileStream
|
||||
//
|
||||
// wide char:
|
||||
//
|
||||
// nsWideInputFileStream, nsWideOutputFileStream, nsWideIOFileStream
|
||||
//
|
||||
// This suite provide the following services:
|
||||
//
|
||||
// 1. Encapsulates all platform-specific file details, so that file i/o
|
||||
// can be done correctly without any platform #ifdefs
|
||||
//
|
||||
// 2. Uses NSPR file services (NOT ansi file I/O), in order to get best
|
||||
// native performance. This performance difference is especially large on
|
||||
// macintosh.
|
||||
//
|
||||
// 3. Allows all the power of the ansi stream syntax: these streams
|
||||
// ARE derived classes of ostream, istream, and iostream. ALL METHODS OF
|
||||
// istream, ostream, AND iostream ARE AVAILABLE!
|
||||
//
|
||||
// Basic example:
|
||||
//
|
||||
// nsFilePath myPath("/Development/iotest.txt");
|
||||
//
|
||||
// nsOutputFileStream testStream(myPath);
|
||||
// testStream << "Hello World" << endl;
|
||||
//
|
||||
// 4. Requires streams to be constructed using typesafe nsFilePath specifier
|
||||
// (not the notorious and bug prone const char*), namely nsFilePath. See
|
||||
// nsFileSpec.h for more details.
|
||||
//
|
||||
// 5. Fixes a bug that have been there for a long time, and
|
||||
// is inevitable if you use NSPR alone:
|
||||
//
|
||||
// The problem on platforms (Macintosh) in which a path does not fully
|
||||
// specify a file, because two volumes can have the same name.
|
||||
//
|
||||
// Not yet provided:
|
||||
//
|
||||
// Endian-awareness for reading and writing crossplatform binary files. At this
|
||||
// time there seems to be no demand for this.
|
||||
//
|
||||
//========================================================================================
|
||||
|
||||
#ifndef _FILESTREAM_H_
|
||||
#define _FILESTREAM_H_
|
||||
|
||||
#include "nscore.h"
|
||||
|
||||
#ifdef XP_MAC
|
||||
#include "pprio.h" // To get PR_ImportFile
|
||||
#else
|
||||
#include "prio.h"
|
||||
#endif
|
||||
#include "nsFileSpec.h"
|
||||
|
||||
//========================================================================================
|
||||
// Compiler-specific macros, as needed
|
||||
//========================================================================================
|
||||
#if !defined(NS_USING_NAMESPACE) && (defined(__MWERKS__) || defined(XP_PC))
|
||||
#define NS_USING_NAMESPACE
|
||||
#endif
|
||||
|
||||
#if !defined(NS_USING_STL) && (defined(__MWERKS__) || defined(XP_PC))
|
||||
#define NS_USING_STL
|
||||
#endif
|
||||
|
||||
#ifdef NS_USING_NAMESPACE
|
||||
|
||||
#define NS_NAMESPACE_PROTOTYPE
|
||||
#define NS_NAMESPACE namespace
|
||||
#define NS_NAMESPACE_END
|
||||
|
||||
#else
|
||||
|
||||
#define NS_NAMESPACE_PROTOTYPE static
|
||||
#define NS_NAMESPACE struct
|
||||
#define NS_NAMESPACE_END ;
|
||||
|
||||
#endif // NS_USING_NAMESPACE
|
||||
|
||||
#ifdef NS_USING_STL
|
||||
|
||||
// Macintosh and Windows use this section.
|
||||
//
|
||||
// Here's where the party is. When Unix wants to join in (by supporting
|
||||
// a build system with STL headers), what fun we'll have! Meanwhile, I've used
|
||||
// macros to make this build on all our platforms. Unix doesn't have support for
|
||||
// STL, and therefore we could not use the template forms of these classes on Unix.
|
||||
// (it's a long story). Therefore, Unix supports no stream char types except 1-byte
|
||||
// characters, and therefore nobody else does now either, until Unix catches up.
|
||||
|
||||
|
||||
#define DEFINING_FILE_STREAM // templateers define this when this file is included.
|
||||
#define IOS_BASE ios_base
|
||||
#include <istream>
|
||||
using std::ios_base;
|
||||
using std::basic_streambuf;
|
||||
using std::codecvt_base;
|
||||
using std::codecvt;
|
||||
using std::streamsize;
|
||||
using std::locale;
|
||||
using std::basic_istream;
|
||||
using std::basic_ostream;
|
||||
using std::basic_iostream;
|
||||
using std::char_traits;
|
||||
#define TEMPLATE_DEF template<class charT, class traits>
|
||||
#define FILE_BUFFER_TYPE nsFileBufferT<charT, traits>
|
||||
#define INPUT_FILE_STREAM nsInputFileStreamT<charT, traits>
|
||||
#define OUTPUT_FILE_STREAM nsOutputFileStreamT<charT, traits>
|
||||
#define IO_FILE_STREAM nsIOFileStreamT<charT, traits>
|
||||
#define BASIC_STREAMBUF basic_streambuf<charT, traits>
|
||||
#define BASIC_ISTREAM basic_istream<charT, traits>
|
||||
#define BASIC_OSTREAM basic_ostream<charT, traits>
|
||||
#define BASIC_IOSTREAM basic_iostream<charT, traits>
|
||||
#define INT_TYPE FILE_BUFFER_TYPE::int_type
|
||||
#define POS_TYPE FILE_BUFFER_TYPE::pos_type
|
||||
#define OFF_TYPE FILE_BUFFER_TYPE::off_type
|
||||
#define SEEK_DIR IOS_BASE::seekdir
|
||||
#define EOF_VALUE traits::eof()
|
||||
|
||||
#else
|
||||
|
||||
// Unix uses this section until it supports STL. This means no locales, no traits,
|
||||
// no wide chars, etc. Also, the stream classes are the original ARM-style ones,
|
||||
// and are not templatized.
|
||||
|
||||
#define IOS_BASE ios
|
||||
#include <istream.h>
|
||||
#define TEMPLATE_DEF
|
||||
#define FILE_BUFFER_TYPE nsFileBufferT
|
||||
#define INPUT_FILE_STREAM nsInputFileStreamT
|
||||
#define OUTPUT_FILE_STREAM nsOutputFileStreamT
|
||||
#define IO_FILE_STREAM nsIOFileStreamT
|
||||
#define BASIC_STREAMBUF streambuf
|
||||
#define BASIC_ISTREAM istream
|
||||
#define BASIC_OSTREAM ostream
|
||||
#define BASIC_IOSTREAM iostream
|
||||
#define INT_TYPE int
|
||||
#define POS_TYPE long
|
||||
#define OFF_TYPE long
|
||||
#define SEEK_DIR ios::seek_dir
|
||||
#define int_type int
|
||||
#define pos_type long
|
||||
#define off_type long
|
||||
#define char_type char
|
||||
#define EOF_VALUE EOF
|
||||
|
||||
#endif // NS_USING_STL
|
||||
|
||||
#ifdef __MWERKS__
|
||||
|
||||
#ifdef MSIPL_WCHART
|
||||
#define NS_USING_WIDE_CHAR
|
||||
#endif
|
||||
#ifdef MSIPL_EXPLICIT_FUNC_TEMPLATE_ARG
|
||||
#define NS_EXPLICIT_FUNC_TEMPLATE_ARG
|
||||
#endif
|
||||
#define NS_READ_LOCK(mut) READ_LOCK(mut)
|
||||
#define NS_WRITE_LOCK(mut) WRITE_LOCK(mut)
|
||||
|
||||
#else
|
||||
|
||||
// Fix me, if necessary, for thread-safety.
|
||||
#define NS_READ_LOCK(mut)
|
||||
#define NS_WRITE_LOCK(mut)
|
||||
|
||||
#endif // __MWERKS__
|
||||
|
||||
//=========================== End Compiler-specific macros ===============================
|
||||
|
||||
//========================================================================================
|
||||
NS_NAMESPACE nsFileStreamHelpers
|
||||
// Prototypes for common (non-template) implementations in the .cpp file which do not
|
||||
// need the template args (charT, traits).
|
||||
//========================================================================================
|
||||
{
|
||||
NS_NAMESPACE_PROTOTYPE NS_BASE PRFileDesc* open(
|
||||
const nsFilePath& inFile,
|
||||
IOS_BASE::openmode mode,
|
||||
PRIntn accessMode);
|
||||
} NS_NAMESPACE_END // nsFileStreamHelpers
|
||||
|
||||
//========================================================================================
|
||||
// Template declarations
|
||||
//========================================================================================
|
||||
|
||||
//========================================================================================
|
||||
TEMPLATE_DEF
|
||||
class nsFileBufferT
|
||||
//========================================================================================
|
||||
: public BASIC_STREAMBUF
|
||||
{
|
||||
#ifdef NS_USING_STL
|
||||
typedef codecvt_base::result result;
|
||||
|
||||
public:
|
||||
typedef charT char_type;
|
||||
typedef typename traits::pos_type pos_type;
|
||||
typedef typename traits::off_type off_type;
|
||||
typedef typename traits::int_type int_type;
|
||||
typedef traits traits_type;
|
||||
typedef typename traits::state_type state_type;
|
||||
|
||||
typedef codecvt<charT, char, state_type> ofacet_type;
|
||||
typedef codecvt<char, charT, state_type> ifacet_type;
|
||||
#endif
|
||||
|
||||
public:
|
||||
nsFileBufferT();
|
||||
nsFileBufferT(PRFileDesc* pfile_arg);
|
||||
virtual ~nsFileBufferT();
|
||||
bool is_open() const;
|
||||
FILE_BUFFER_TYPE* open(
|
||||
const nsFilePath& inFile,
|
||||
IOS_BASE::openmode mode,
|
||||
PRIntn accessMode);
|
||||
FILE_BUFFER_TYPE* close();
|
||||
|
||||
protected:
|
||||
virtual int_type overflow(int_type c=EOF_VALUE);
|
||||
virtual int_type pbackfail(int_type c=EOF_VALUE);
|
||||
virtual int_type underflow();
|
||||
virtual pos_type seekoff(
|
||||
off_type off, SEEK_DIR way,
|
||||
IOS_BASE::openmode which=IOS_BASE::in|IOS_BASE::out);
|
||||
virtual pos_type seekpos(pos_type sp,
|
||||
IOS_BASE::openmode which=IOS_BASE::in|IOS_BASE::out);
|
||||
virtual BASIC_STREAMBUF* setbuf(char_type* s, streamsize n);
|
||||
virtual int sync();
|
||||
virtual int_type uflow();
|
||||
#ifdef NS_USING_STL
|
||||
virtual void imbue(const locale& loc);
|
||||
#endif
|
||||
virtual streamsize showmanyc();
|
||||
virtual streamsize xsgetn(char_type* s, streamsize n);
|
||||
virtual streamsize xsputn(const char_type* s, streamsize n);
|
||||
|
||||
private:
|
||||
PRFileDesc* mFileDesc;
|
||||
IOS_BASE::openmode mode_;
|
||||
}; // class nsFileBufferT
|
||||
|
||||
//========================================================================================
|
||||
TEMPLATE_DEF
|
||||
class nsInputFileStreamT
|
||||
//========================================================================================
|
||||
: public BASIC_ISTREAM
|
||||
{
|
||||
#ifdef NS_USING_STL
|
||||
public:
|
||||
typedef charT char_type;
|
||||
typedef typename traits::pos_type pos_type;
|
||||
typedef typename traits::off_type off_type;
|
||||
typedef typename traits::int_type int_type;
|
||||
typedef traits traits_type;
|
||||
#endif
|
||||
|
||||
public:
|
||||
nsInputFileStreamT();
|
||||
explicit nsInputFileStreamT(
|
||||
const nsFilePath& inFile,
|
||||
IOS_BASE::openmode mode=IOS_BASE::in,
|
||||
PRIntn accessMode = 0x00400);
|
||||
|
||||
virtual ~nsInputFileStreamT();
|
||||
|
||||
FILE_BUFFER_TYPE* rdbuf() const;
|
||||
inline bool is_open();
|
||||
inline void open(
|
||||
const nsFilePath& inFile,
|
||||
IOS_BASE::openmode mode=IOS_BASE::in,
|
||||
PRIntn accessMode = 0x00400);
|
||||
inline void close();
|
||||
|
||||
private:
|
||||
FILE_BUFFER_TYPE mBuffer;
|
||||
}; // class nsInputFileStreamT
|
||||
|
||||
//========================================================================================
|
||||
TEMPLATE_DEF
|
||||
class nsOutputFileStreamT
|
||||
//========================================================================================
|
||||
: public BASIC_OSTREAM
|
||||
{
|
||||
#ifdef NS_USING_STL
|
||||
public:
|
||||
typedef charT char_type;
|
||||
typedef typename traits::pos_type pos_type;
|
||||
typedef typename traits::off_type off_type;
|
||||
typedef typename traits::int_type int_type;
|
||||
typedef traits traits_type;
|
||||
#endif
|
||||
|
||||
public:
|
||||
|
||||
nsOutputFileStreamT();
|
||||
explicit nsOutputFileStreamT(
|
||||
const nsFilePath& inFile,
|
||||
IOS_BASE::openmode mode = IOS_BASE::out|IOS_BASE::trunc,
|
||||
PRIntn accessMode = 0x00200);
|
||||
|
||||
virtual ~nsOutputFileStreamT();
|
||||
|
||||
FILE_BUFFER_TYPE* rdbuf() const;
|
||||
inline bool is_open();
|
||||
inline void open(
|
||||
const nsFilePath& inFile,
|
||||
IOS_BASE::openmode mode = IOS_BASE::out|IOS_BASE::trunc,
|
||||
PRIntn accessMode = 0x00200);
|
||||
inline void close();
|
||||
|
||||
private:
|
||||
FILE_BUFFER_TYPE mBuffer;
|
||||
}; // class nsOutputFileStreamT
|
||||
|
||||
//========================================================================================
|
||||
// Implementation of nsFileBufferT
|
||||
//========================================================================================
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
TEMPLATE_DEF
|
||||
inline FILE_BUFFER_TYPE::nsFileBufferT()
|
||||
: BASIC_STREAMBUF(), mFileDesc(NULL)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
TEMPLATE_DEF
|
||||
inline FILE_BUFFER_TYPE::nsFileBufferT(PRFileDesc* pfarg)
|
||||
: BASIC_STREAMBUF(), mFileDesc(pfarg)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
TEMPLATE_DEF
|
||||
inline FILE_BUFFER_TYPE* FILE_BUFFER_TYPE::close()
|
||||
// Must precede the destructor because both are inline.
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
if (mFileDesc==PR_STDIN || mFileDesc==PR_STDOUT || mFileDesc==PR_STDERR)
|
||||
return this;
|
||||
NS_WRITE_LOCK(_mutex);
|
||||
return (mFileDesc && PR_Close(mFileDesc) == PR_SUCCESS) ? mFileDesc = 0, this : 0;
|
||||
}
|
||||
|
||||
#if defined(DEFINING_FILE_STREAM)
|
||||
//----------------------------------------------------------------------------------------
|
||||
TEMPLATE_DEF
|
||||
FILE_BUFFER_TYPE::~nsFileBufferT()
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
close();
|
||||
}
|
||||
#endif // #if defined(DEFINING_FILE_STREAM)
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
TEMPLATE_DEF
|
||||
inline bool
|
||||
FILE_BUFFER_TYPE::is_open() const
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
NS_READ_LOCK(_mutex);
|
||||
return bool(mFileDesc); // in case it is typedefed to int
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
TEMPLATE_DEF
|
||||
inline FILE_BUFFER_TYPE* FILE_BUFFER_TYPE::open(
|
||||
const nsFilePath& inFile,
|
||||
IOS_BASE::openmode mode,
|
||||
PRIntn accessMode)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
if (mFileDesc)
|
||||
return 0;
|
||||
NS_WRITE_LOCK(_mutex);
|
||||
mFileDesc = nsFileStreamHelpers::open(inFile, mode, accessMode);
|
||||
if (!mFileDesc)
|
||||
return 0;
|
||||
mode_ = mode;
|
||||
return this;
|
||||
} // FILE_BUFFER_TYPE::open
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
TEMPLATE_DEF
|
||||
inline int FILE_BUFFER_TYPE:: sync()
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
return (mFileDesc ? (int)PR_Sync(mFileDesc) : 0);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
TEMPLATE_DEF
|
||||
inline BASIC_STREAMBUF* FILE_BUFFER_TYPE::setbuf(char_type*, streamsize)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
return (!mFileDesc) ? 0 : this;
|
||||
}
|
||||
|
||||
#if defined(DEFINING_FILE_STREAM)
|
||||
//----------------------------------------------------------------------------------------
|
||||
TEMPLATE_DEF
|
||||
INT_TYPE FILE_BUFFER_TYPE::overflow(int_type c)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
#ifndef NS_USING_STL
|
||||
char ch = c;
|
||||
PRInt32 bytesWrit1 = PR_Write(mFileDesc, &ch, sizeof(ch));
|
||||
return bytesWrit1 < sizeof(ch) ? EOF_VALUE : c;
|
||||
#else
|
||||
#ifdef NS_EXPLICIT_FUNC_TEMPLATE_ARG
|
||||
const ofacet_type& ft=use_facet<ofacet_type>(getloc());
|
||||
#elif defined(XP_PC)
|
||||
const ofacet_type& ft=use_facet(getloc(), (ofacet_type*)0, false);
|
||||
#else
|
||||
const ofacet_type& ft=use_facet(getloc(), (ofacet_type*)0);
|
||||
#endif
|
||||
char_type ch = traits_type::to_char_type(c);
|
||||
if (!mFileDesc)
|
||||
return EOF_VALUE;
|
||||
if (traits_type::eq_int_type(c, EOF_VALUE))
|
||||
return traits_type::not_eof(c);
|
||||
if (ft.always_noconv())
|
||||
{
|
||||
PRInt32 bytesWrit1 = PR_Write(mFileDesc, &ch, sizeof(ch));
|
||||
return bytesWrit1 < sizeof(ch) ? EOF_VALUE : c;
|
||||
}
|
||||
{ // <- sic!
|
||||
state_type fst;
|
||||
const char_type* end;
|
||||
char buf[4];
|
||||
char* ebuf;
|
||||
result conv;
|
||||
if ((conv=ft.out(fst, &ch, &ch+1, end, buf, buf+3, ebuf))==
|
||||
codecvt_base::noconv)
|
||||
{
|
||||
PRInt32 bytesWrit2 = PR_Write(mFileDesc, &ch, sizeof(ch));
|
||||
return bytesWrit2 < sizeof(ch) ? EOF_VALUE : c;
|
||||
}
|
||||
if ((conv==codecvt_base::partial)||(conv==codecvt_base::error))
|
||||
return EOF_VALUE;
|
||||
*ebuf=0;
|
||||
PRInt32 bytesWrit3 = strlen(buf);
|
||||
return PR_Write(mFileDesc, buf, bytesWrit3) < bytesWrit3 ? EOF_VALUE : c;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif // #if defined(DEFINING_FILE_STREAM)
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
TEMPLATE_DEF
|
||||
inline INT_TYPE FILE_BUFFER_TYPE::underflow()
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
if (!mFileDesc)
|
||||
return EOF_VALUE;
|
||||
char_type s;
|
||||
PRInt32 request = 1;
|
||||
if (1 != PR_Read(mFileDesc, &s, request))
|
||||
return EOF_VALUE;
|
||||
PR_Seek(mFileDesc, -1, PR_SEEK_CUR);
|
||||
return (int_type)s;
|
||||
}
|
||||
|
||||
#if defined(DEFINING_FILE_STREAM)
|
||||
//----------------------------------------------------------------------------------------
|
||||
TEMPLATE_DEF
|
||||
streamsize FILE_BUFFER_TYPE::xsputn(const char_type* s, streamsize n)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
#ifndef NS_USING_STL
|
||||
PRInt32 bytesWrit1 = PR_Write(mFileDesc, s, sizeof(char) * size_t(n));
|
||||
return bytesWrit1 < 0 ? 0 : (streamsize)bytesWrit1;
|
||||
#else
|
||||
#ifdef NS_EXPLICIT_FUNC_TEMPLATE_ARG
|
||||
const ofacet_type& ft=use_facet<ofacet_type>(loc);
|
||||
#elif defined(XP_PC)
|
||||
const ofacet_type& ft=use_facet(getloc(), (ofacet_type*)0, false);
|
||||
#else
|
||||
const ofacet_type& ft=use_facet(getloc(), (ofacet_type*)0);
|
||||
#endif
|
||||
if (!mFileDesc || !n)
|
||||
return 0;
|
||||
if (ft.always_noconv())
|
||||
{
|
||||
PRInt32 bytesWrit1 = PR_Write(mFileDesc, s, sizeof(char) * size_t(n));
|
||||
return bytesWrit1 < 0 ? 0 : (streamsize)bytesWrit1;
|
||||
}
|
||||
{ // <- sic!
|
||||
state_type fst;
|
||||
const char_type* end;
|
||||
char buf[8];
|
||||
char* ebuf;
|
||||
result conv;
|
||||
#ifdef NS_EXPLICIT_FUNC_TEMPLATE_ARG
|
||||
if ((conv=use_facet<ofacet_type>(getloc()).
|
||||
#elif defined(XP_PC)
|
||||
if ((conv=use_facet(getloc(), (ofacet_type*)0, false).
|
||||
#else
|
||||
if ((conv=use_facet(getloc(), (ofacet_type*)0).
|
||||
#endif
|
||||
out(fst, s, s+n, end, buf, buf+7, ebuf))==codecvt_base::noconv)
|
||||
return (streamsize)PR_Write(mFileDesc, s, sizeof(char) * size_t(n));
|
||||
if ((conv==codecvt_base::partial) ||(conv==codecvt_base::error))
|
||||
return 0;
|
||||
*ebuf=0;
|
||||
PRInt32 bytesWrit2 = strlen(buf);
|
||||
bytesWrit2 = PR_Write(mFileDesc, buf, bytesWrit2);
|
||||
return bytesWrit2 < 0 ? 0 : streamsize(bytesWrit2 / sizeof(char_type));
|
||||
}
|
||||
#endif
|
||||
} // FILE_BUFFER_TYPE::xsputn
|
||||
#endif // #if defined(DEFINING_FILE_STREAM)
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
TEMPLATE_DEF
|
||||
inline INT_TYPE FILE_BUFFER_TYPE::pbackfail(int_type c)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
if (!mFileDesc)
|
||||
return EOF_VALUE;
|
||||
if (PR_Seek(mFileDesc, -1, PR_SEEK_CUR) < 0)
|
||||
return EOF_VALUE;
|
||||
#ifdef NS_USING_STL
|
||||
return (traits::eq_int_type(c, EOF_VALUE)) ? traits::not_eof(c) : c;
|
||||
#else
|
||||
return c;
|
||||
#endif
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
TEMPLATE_DEF
|
||||
inline INT_TYPE FILE_BUFFER_TYPE::uflow()
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
if (!mFileDesc)
|
||||
return EOF_VALUE;
|
||||
char_type s;
|
||||
if (1 != PR_Read(mFileDesc, &s, 1)) // attempt to read 1 byte, confirm 1 byte
|
||||
return EOF_VALUE;
|
||||
return (int_type)s;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
TEMPLATE_DEF
|
||||
inline streamsize FILE_BUFFER_TYPE::xsgetn(char_type* s, streamsize n)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
return mFileDesc ? (streamsize)PR_Read(mFileDesc, s, sizeof(char) * size_t(n)) : 0;
|
||||
}
|
||||
|
||||
#ifdef NS_USING_STL
|
||||
//----------------------------------------------------------------------------------------
|
||||
TEMPLATE_DEF
|
||||
inline void FILE_BUFFER_TYPE::imbue(const locale& loc_arg)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
#ifdef XP_MAC
|
||||
loc = loc_arg;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
TEMPLATE_DEF
|
||||
inline streamsize FILE_BUFFER_TYPE::showmanyc()
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
return (streamsize)PR_Available(mFileDesc);
|
||||
}
|
||||
|
||||
#if defined(DEFINING_FILE_STREAM)
|
||||
//----------------------------------------------------------------------------------------
|
||||
TEMPLATE_DEF
|
||||
POS_TYPE FILE_BUFFER_TYPE::seekoff(
|
||||
OFF_TYPE off,
|
||||
SEEK_DIR way,
|
||||
IOS_BASE::openmode /* which */)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
if (!mFileDesc ||
|
||||
#ifdef NS_USING_STL
|
||||
((way&IOS_BASE::beg) && off<0) || ((way&IOS_BASE::end) && off > 0)
|
||||
#else
|
||||
((way == IOS_BASE::beg) && off<0) || ((way == IOS_BASE::end) && off > 0)
|
||||
#endif
|
||||
)
|
||||
return pos_type(-1);
|
||||
PRSeekWhence poseek = PR_SEEK_CUR;
|
||||
switch (way)
|
||||
{
|
||||
case IOS_BASE::beg : poseek= PR_SEEK_SET;
|
||||
break;
|
||||
case IOS_BASE::end : poseek= PR_SEEK_END;
|
||||
break;
|
||||
}
|
||||
PRInt32 position = PR_Seek(mFileDesc, off, poseek);
|
||||
if (position < 0)
|
||||
return pos_type(-1);
|
||||
return pos_type(position);
|
||||
}
|
||||
#endif // #if defined(DEFINING_FILE_STREAM)
|
||||
|
||||
#if defined(DEFINING_FILE_STREAM)
|
||||
//----------------------------------------------------------------------------------------
|
||||
TEMPLATE_DEF
|
||||
POS_TYPE FILE_BUFFER_TYPE::seekpos(pos_type sp, IOS_BASE::openmode)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
if (!mFileDesc || sp==pos_type(-1))
|
||||
return -1;
|
||||
#if defined(XP_PC) || defined(XP_UNIX)
|
||||
PRInt32 position = sp;
|
||||
#else
|
||||
PRInt32 position = sp.offset();
|
||||
#endif
|
||||
position = PR_Seek(mFileDesc, position, PR_SEEK_SET);
|
||||
if (position < 0)
|
||||
return pos_type(-1);
|
||||
return position;
|
||||
}
|
||||
#endif // #if defined(DEFINING_FILE_STREAM)
|
||||
|
||||
//========================================================================================
|
||||
// Implementation of nsInputFileStreamT
|
||||
//========================================================================================
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
TEMPLATE_DEF
|
||||
inline INPUT_FILE_STREAM::nsInputFileStreamT()
|
||||
: BASIC_ISTREAM(&mBuffer)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
// already inited
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
TEMPLATE_DEF
|
||||
inline INPUT_FILE_STREAM::nsInputFileStreamT(
|
||||
const nsFilePath& inFile,
|
||||
IOS_BASE::openmode mode,
|
||||
PRIntn accessMode)
|
||||
//----------------------------------------------------------------------------------------
|
||||
: BASIC_ISTREAM(&mBuffer)
|
||||
{
|
||||
// already inited
|
||||
if (!mBuffer.open(inFile, openmode(mode|in), accessMode))
|
||||
setstate(failbit);
|
||||
}
|
||||
|
||||
#if defined(DEFINING_FILE_STREAM)
|
||||
//----------------------------------------------------------------------------------------
|
||||
TEMPLATE_DEF
|
||||
INPUT_FILE_STREAM::~nsInputFileStreamT()
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
}
|
||||
#endif // #if defined(DEFINING_FILE_STREAM)
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
TEMPLATE_DEF
|
||||
inline FILE_BUFFER_TYPE* INPUT_FILE_STREAM::rdbuf() const
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
return (FILE_BUFFER_TYPE*)&mBuffer;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
TEMPLATE_DEF
|
||||
inline bool INPUT_FILE_STREAM:: is_open()
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
return mBuffer.is_open();
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
TEMPLATE_DEF
|
||||
inline void INPUT_FILE_STREAM::open(
|
||||
const nsFilePath& inFile,
|
||||
IOS_BASE::openmode mode,
|
||||
PRIntn accessMode)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
if (!mBuffer.open(inFile, openmode(mode|in), accessMode))
|
||||
setstate(failbit);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
TEMPLATE_DEF
|
||||
inline void INPUT_FILE_STREAM::close()
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
if (!mBuffer.close())
|
||||
setstate(failbit);
|
||||
}
|
||||
|
||||
//========================================================================================
|
||||
// Implementation of nsOutputFileStreamT
|
||||
//========================================================================================
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
TEMPLATE_DEF
|
||||
inline OUTPUT_FILE_STREAM::nsOutputFileStreamT()
|
||||
: BASIC_OSTREAM(&mBuffer)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
// already inited
|
||||
}
|
||||
|
||||
#if defined(DEFINING_FILE_STREAM)
|
||||
//----------------------------------------------------------------------------------------
|
||||
TEMPLATE_DEF
|
||||
OUTPUT_FILE_STREAM::nsOutputFileStreamT(
|
||||
const nsFilePath& inFile,
|
||||
IOS_BASE::openmode mode,
|
||||
PRIntn accessMode)
|
||||
//----------------------------------------------------------------------------------------
|
||||
: BASIC_OSTREAM(&mBuffer)
|
||||
{
|
||||
// already inited
|
||||
if (!mBuffer.open(inFile, openmode(mode|out), accessMode))
|
||||
setstate(failbit);
|
||||
}
|
||||
#endif // #if defined(DEFINING_FILE_STREAM)
|
||||
|
||||
#if defined(DEFINING_FILE_STREAM)
|
||||
//----------------------------------------------------------------------------------------
|
||||
TEMPLATE_DEF
|
||||
inline OUTPUT_FILE_STREAM::~nsOutputFileStreamT()
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
}
|
||||
#endif // #if defined(DEFINING_FILE_STREAM)
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
TEMPLATE_DEF
|
||||
inline FILE_BUFFER_TYPE*
|
||||
OUTPUT_FILE_STREAM::rdbuf() const
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
return (FILE_BUFFER_TYPE*)&mBuffer;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
TEMPLATE_DEF
|
||||
inline bool OUTPUT_FILE_STREAM:: is_open()
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
return mBuffer.is_open();
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
TEMPLATE_DEF
|
||||
inline void OUTPUT_FILE_STREAM::open(
|
||||
const nsFilePath& inFile,
|
||||
IOS_BASE::openmode mode,
|
||||
PRIntn accessMode)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
if (!mBuffer.open(inFile, openmode(mode | out), accessMode))
|
||||
setstate(failbit);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
TEMPLATE_DEF
|
||||
inline void OUTPUT_FILE_STREAM:: close()
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
if (!mBuffer.close())
|
||||
setstate(failbit);
|
||||
}
|
||||
|
||||
//========================================================================================
|
||||
TEMPLATE_DEF
|
||||
class nsIOFileStreamT : public BASIC_IOSTREAM
|
||||
//========================================================================================
|
||||
{
|
||||
#ifdef NS_USING_STL
|
||||
public:
|
||||
typedef charT char_type;
|
||||
typedef typename traits::pos_type pos_type;
|
||||
typedef typename traits::off_type off_type;
|
||||
typedef typename traits::int_type int_type;
|
||||
typedef traits traits_type;
|
||||
#endif
|
||||
|
||||
public:
|
||||
nsIOFileStreamT();
|
||||
explicit nsIOFileStreamT(
|
||||
const nsFilePath& inFile,
|
||||
IOS_BASE::openmode mode = IOS_BASE::in|IOS_BASE::out,
|
||||
PRIntn accessMode = 0x00600);
|
||||
|
||||
virtual ~nsIOFileStreamT();
|
||||
|
||||
FILE_BUFFER_TYPE* rdbuf() const;
|
||||
inline bool is_open();
|
||||
inline void open(
|
||||
const nsFilePath& inFile,
|
||||
IOS_BASE::openmode mode = IOS_BASE::in|IOS_BASE::out,
|
||||
PRIntn accessMode = 0x00600);
|
||||
inline void close();
|
||||
|
||||
private:
|
||||
FILE_BUFFER_TYPE mBuffer;
|
||||
}; // class nsIOFileStreamT
|
||||
|
||||
//========================================================================================
|
||||
// Implementation of nsIOFileStream
|
||||
//========================================================================================
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
TEMPLATE_DEF
|
||||
inline IO_FILE_STREAM::nsIOFileStreamT()
|
||||
//----------------------------------------------------------------------------------------
|
||||
: mBuffer(), BASIC_IOSTREAM(&mBuffer)
|
||||
{
|
||||
// already inited
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
TEMPLATE_DEF
|
||||
inline IO_FILE_STREAM::nsIOFileStreamT(
|
||||
const nsFilePath& inFile,
|
||||
IOS_BASE::openmode mode,
|
||||
PRIntn accessMode)
|
||||
//----------------------------------------------------------------------------------------
|
||||
: mBuffer(), BASIC_IOSTREAM(&mBuffer)
|
||||
{
|
||||
// already inited
|
||||
if (!mBuffer.open(inFile, mode, accessMode))
|
||||
setstate(failbit);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
TEMPLATE_DEF
|
||||
inline IO_FILE_STREAM::~nsIOFileStreamT()
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
TEMPLATE_DEF
|
||||
inline FILE_BUFFER_TYPE*
|
||||
IO_FILE_STREAM::rdbuf() const
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
return (FILE_BUFFER_TYPE*)&mBuffer;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
TEMPLATE_DEF
|
||||
inline bool IO_FILE_STREAM::is_open()
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
return mBuffer.is_open();
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
TEMPLATE_DEF
|
||||
inline void IO_FILE_STREAM::open(
|
||||
const nsFilePath& inFile,
|
||||
IOS_BASE::openmode mode,
|
||||
PRIntn accessMode)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
if (!mBuffer.open(inFile, mode, accessMode))
|
||||
setstate(failbit);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
TEMPLATE_DEF
|
||||
inline void IO_FILE_STREAM::close()
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
if (!mBuffer.close())
|
||||
setstate(failbit);
|
||||
}
|
||||
|
||||
//========================================================================================
|
||||
// Specializations of the stream templates
|
||||
//========================================================================================
|
||||
|
||||
#ifdef NS_USING_STL
|
||||
typedef nsFileBufferT<char, char_traits<char> > nsFileBuffer;
|
||||
typedef nsInputFileStreamT<char, char_traits<char> > nsInputFileStream;
|
||||
typedef nsOutputFileStreamT<char, char_traits<char> > nsOutputFileStream;
|
||||
typedef nsIOFileStreamT<char, char_traits<char> > nsIOFileStream;
|
||||
|
||||
#ifdef NS_USING_WIDE_CHAR
|
||||
typedef nsFileBufferT<wchar_t, char_traits<wchar_t> > nsWideFileBuffer;
|
||||
typedef nsInputFileStreamT<wchar_t, char_traits<wchar_t> > nsWideInputFileStream;
|
||||
typedef nsOutputFileStreamT<wchar_t, char_traits<wchar_t> > nsWideOutputFileStream;
|
||||
typedef nsIOFileStreamT<wchar_t, char_traits<wchar_t> > nsWideIOFileStream;
|
||||
#endif // NS_USING_WIDE_CHAR
|
||||
|
||||
#else
|
||||
|
||||
typedef nsFileBufferT nsFileBuffer;
|
||||
typedef nsInputFileStreamT nsInputFileStream;
|
||||
typedef nsOutputFileStreamT nsOutputFileStream;
|
||||
typedef nsIOFileStreamT nsIOFileStream;
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* _FILESTREAM_H_ */
|
||||
|
||||
24
mozilla/base/src/MANIFEST
Normal file
24
mozilla/base/src/MANIFEST
Normal file
@@ -0,0 +1,24 @@
|
||||
#
|
||||
# This is a list of local files which get copied to the mozilla:dist directory
|
||||
#
|
||||
|
||||
nscore.h
|
||||
nsIArena.h
|
||||
nsIAtom.h
|
||||
nsIByteBuffer.h
|
||||
nsBTree.h
|
||||
nsCRT.h
|
||||
nsDeque.h
|
||||
nsITimer.h
|
||||
nsITimerCallback.h
|
||||
nsIUnicharBuffer.h
|
||||
nsRBTree.h
|
||||
nsIUnicharInputStream.h
|
||||
nsString.h
|
||||
nsVoidArray.h
|
||||
nsUnitConversion.h
|
||||
nsIBaseStream.h
|
||||
nsIInputStream.h
|
||||
nsIOutputStream.h
|
||||
nsInt64.h
|
||||
nsTime.h
|
||||
88
mozilla/base/src/Makefile.in
Normal file
88
mozilla/base/src/Makefile.in
Normal file
@@ -0,0 +1,88 @@
|
||||
#!gmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
|
||||
DEPTH=../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
DEFINES +=-D_IMPL_NS_BASE
|
||||
|
||||
DIRS = $(MOZ_TOOLKIT)
|
||||
|
||||
LIBRARY_NAME = raptorbase
|
||||
|
||||
CPPSRCS = \
|
||||
nsArena.cpp \
|
||||
nsAtomTable.cpp \
|
||||
nsBaseDLL.cpp \
|
||||
nsBTree.cpp \
|
||||
nsByteBuffer.cpp \
|
||||
nsCRT.cpp \
|
||||
nsDeque.cpp \
|
||||
nsEscape.cpp \
|
||||
nsFileSpec.cpp \
|
||||
nsFileStream.cpp \
|
||||
nsIFileStream.cpp \
|
||||
nsProperties.cpp \
|
||||
nsRBTree.cpp \
|
||||
nsSizeOfHandler.cpp \
|
||||
nsString.cpp \
|
||||
nsUnicharBuffer.cpp \
|
||||
nsUnicharInputStream.cpp \
|
||||
nsVoidArray.cpp \
|
||||
$(NULL)
|
||||
|
||||
EXPORTS = \
|
||||
nscore.h \
|
||||
nsBTree.h \
|
||||
nsCRT.h \
|
||||
nsDeque.h \
|
||||
nsIArena.h \
|
||||
nsIAtom.h \
|
||||
nsIByteBuffer.h \
|
||||
nsIBaseStream.h \
|
||||
nsIInputStream.h \
|
||||
nsIOutputStream.h \
|
||||
nsITimer.h \
|
||||
nsITimerCallback.h \
|
||||
nsIUnicharBuffer.h \
|
||||
nsIUnicharInputStream.h \
|
||||
nsInt64.h \
|
||||
nsRBTree.h \
|
||||
nsString.h \
|
||||
nsTime.h \
|
||||
nsVoidArray.h \
|
||||
nsUnitConversion.h \
|
||||
$(NULL)
|
||||
|
||||
EXPORTS := $(addprefix $(srcdir)/, $(EXPORTS))
|
||||
|
||||
MODULE=base
|
||||
|
||||
REQUIRES = xpcom netlib raptor
|
||||
|
||||
include $(topsrcdir)/config/config.mk
|
||||
|
||||
TARGET = $(LIBARY)
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
test:
|
||||
@echo OS_ARCH = $(OS_ARCH)
|
||||
42
mozilla/base/src/gtk/Makefile.in
Normal file
42
mozilla/base/src/gtk/Makefile.in
Normal file
@@ -0,0 +1,42 @@
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
#
|
||||
|
||||
DEPTH = ../../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
LIBRARY_NAME = gmbasegtk
|
||||
|
||||
MODULE=base
|
||||
|
||||
REQUIRES = xpcom raptor
|
||||
|
||||
DEFINES += -D_IMPL_NS_WIDGET
|
||||
|
||||
CPPSRCS = \
|
||||
nsTimer.cpp \
|
||||
nsCaretProperties.cpp \
|
||||
$(NULL)
|
||||
|
||||
include $(topsrcdir)/config/config.mk
|
||||
|
||||
CFLAGS += $(TK_CFLAGS)
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
40
mozilla/base/src/gtk/nsCaretProperties.cpp
Normal file
40
mozilla/base/src/gtk/nsCaretProperties.cpp
Normal file
@@ -0,0 +1,40 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
|
||||
#include "nscore.h"
|
||||
|
||||
#include "nsCaretProperties.h"
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
nsCaretProperties::nsCaretProperties()
|
||||
: mCaretWidth(eDefaultCaretWidth)
|
||||
, mBlinkRate(eDefaulBlinkRate)
|
||||
{
|
||||
// in your platform-specific class, get data from the OS in your constructor
|
||||
|
||||
mBlinkRate = 0; // don't blink the caret
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
nsCaretProperties* NewCaretProperties()
|
||||
{
|
||||
return new nsCaretProperties();
|
||||
}
|
||||
190
mozilla/base/src/gtk/nsTimer.cpp
Normal file
190
mozilla/base/src/gtk/nsTimer.cpp
Normal file
@@ -0,0 +1,190 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
#include "nsITimer.h"
|
||||
#include "nsITimerCallback.h"
|
||||
#include "nsCRT.h"
|
||||
#include "prlog.h"
|
||||
#include <stdio.h>
|
||||
#include <limits.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
static NS_DEFINE_IID(kITimerIID, NS_ITIMER_IID);
|
||||
|
||||
extern "C" gint nsTimerExpired(gpointer aCallData);
|
||||
|
||||
/*
|
||||
* Implementation of timers using Gtk timer facility
|
||||
*/
|
||||
class TimerImpl : public nsITimer {
|
||||
public:
|
||||
|
||||
public:
|
||||
TimerImpl();
|
||||
virtual ~TimerImpl();
|
||||
|
||||
virtual nsresult Init(nsTimerCallbackFunc aFunc,
|
||||
void *aClosure,
|
||||
// PRBool aRepeat,
|
||||
PRUint32 aDelay);
|
||||
|
||||
virtual nsresult Init(nsITimerCallback *aCallback,
|
||||
// PRBool aRepeat,
|
||||
PRUint32 aDelay);
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
virtual void Cancel();
|
||||
virtual PRUint32 GetDelay() { return mDelay; }
|
||||
virtual void SetDelay(PRUint32 aDelay) { mDelay=aDelay; };
|
||||
virtual void* GetClosure() { return mClosure; }
|
||||
|
||||
void FireTimeout();
|
||||
|
||||
private:
|
||||
nsresult Init(PRUint32 aDelay);
|
||||
|
||||
PRUint32 mDelay;
|
||||
nsTimerCallbackFunc mFunc;
|
||||
void *mClosure;
|
||||
nsITimerCallback *mCallback;
|
||||
// PRBool mRepeat;
|
||||
TimerImpl *mNext;
|
||||
guint mTimerId;
|
||||
};
|
||||
|
||||
void TimerImpl::FireTimeout()
|
||||
{
|
||||
if (mFunc != NULL) {
|
||||
(*mFunc)(this, mClosure);
|
||||
}
|
||||
else if (mCallback != NULL) {
|
||||
mCallback->Notify(this); // Fire the timer
|
||||
}
|
||||
|
||||
// Always repeating here
|
||||
|
||||
// if (mRepeat)
|
||||
// mTimerId = gtk_timeout_add(aDelay, nsTimerExpired, this);
|
||||
}
|
||||
|
||||
|
||||
TimerImpl::TimerImpl()
|
||||
{
|
||||
// printf("TimerImple::TimerImpl called for %p\n", this);
|
||||
NS_INIT_REFCNT();
|
||||
mFunc = NULL;
|
||||
mCallback = NULL;
|
||||
mNext = NULL;
|
||||
mTimerId = 0;
|
||||
mDelay = 0;
|
||||
mClosure = NULL;
|
||||
}
|
||||
|
||||
TimerImpl::~TimerImpl()
|
||||
{
|
||||
//printf("TimerImpl::~TimerImpl called for %p\n", this);
|
||||
Cancel();
|
||||
NS_IF_RELEASE(mCallback);
|
||||
}
|
||||
|
||||
nsresult
|
||||
TimerImpl::Init(nsTimerCallbackFunc aFunc,
|
||||
void *aClosure,
|
||||
// PRBool aRepeat,
|
||||
PRUint32 aDelay)
|
||||
{
|
||||
//printf("TimerImpl::Init called with func + closure for %p\n", this);
|
||||
mFunc = aFunc;
|
||||
mClosure = aClosure;
|
||||
// mRepeat = aRepeat;
|
||||
|
||||
if ((aDelay > 10000) || (aDelay < 0)) {
|
||||
printf("Timer::Init() called with bogus value \"%d\"! Not enabling timer.\n",
|
||||
aDelay);
|
||||
return Init(aDelay);
|
||||
}
|
||||
|
||||
mTimerId = gtk_timeout_add(aDelay, nsTimerExpired, this);
|
||||
|
||||
return Init(aDelay);
|
||||
}
|
||||
|
||||
nsresult
|
||||
TimerImpl::Init(nsITimerCallback *aCallback,
|
||||
// PRBool aRepeat,
|
||||
PRUint32 aDelay)
|
||||
{
|
||||
//printf("TimerImpl::Init called with callback only for %p\n", this);
|
||||
mCallback = aCallback;
|
||||
// mRepeat = aRepeat;
|
||||
if ((aDelay > 10000) || (aDelay < 0)) {
|
||||
printf("Timer::Init() called with bogus value \"%d\"! Not enabling timer.\n",
|
||||
aDelay);
|
||||
return Init(aDelay);
|
||||
}
|
||||
|
||||
mTimerId = gtk_timeout_add(aDelay, nsTimerExpired, this);
|
||||
|
||||
return Init(aDelay);
|
||||
}
|
||||
|
||||
nsresult
|
||||
TimerImpl::Init(PRUint32 aDelay)
|
||||
{
|
||||
//printf("TimerImpl::Init called with delay %d only for %p\n", aDelay, this);
|
||||
|
||||
mDelay = aDelay;
|
||||
NS_ADDREF(this);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS(TimerImpl, kITimerIID)
|
||||
|
||||
|
||||
void
|
||||
TimerImpl::Cancel()
|
||||
{
|
||||
//printf("TimerImpl::Cancel called for %p\n", this);
|
||||
TimerImpl *me = this;
|
||||
if (mTimerId)
|
||||
gtk_timeout_remove(mTimerId);
|
||||
}
|
||||
|
||||
NS_BASE nsresult NS_NewTimer(nsITimer** aInstancePtrResult)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
TimerImpl *timer = new TimerImpl();
|
||||
if (nsnull == timer) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
return timer->QueryInterface(kITimerIID, (void **) aInstancePtrResult);
|
||||
}
|
||||
|
||||
gint nsTimerExpired(gpointer aCallData)
|
||||
{
|
||||
//printf("nsTimerExpired for %p\n", aCallData);
|
||||
TimerImpl* timer = (TimerImpl *)aCallData;
|
||||
timer->FireTimeout();
|
||||
return 0;
|
||||
}
|
||||
43
mozilla/base/src/mac/nsCaretPropertiesMac.cpp
Normal file
43
mozilla/base/src/mac/nsCaretPropertiesMac.cpp
Normal file
@@ -0,0 +1,43 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
#include <Events.h>
|
||||
|
||||
#include "nscore.h"
|
||||
|
||||
#include "nsCaretProperties.h"
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
nsCaretProperties::nsCaretProperties()
|
||||
: mCaretWidth(eDefaultCaretWidth)
|
||||
, mBlinkRate(eDefaulBlinkRate)
|
||||
{
|
||||
// in your platform-specific class, get data from the OS in your constructor
|
||||
|
||||
// MacOS calls
|
||||
|
||||
mBlinkRate = ::GetCaretTime() * 1000 / 60;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
nsCaretProperties* NewCaretProperties()
|
||||
{
|
||||
return new nsCaretProperties();
|
||||
}
|
||||
971
mozilla/base/src/mac/nsFileSpecMac.cpp
Normal file
971
mozilla/base/src/mac/nsFileSpecMac.cpp
Normal file
@@ -0,0 +1,971 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
// This file is included by nsFile.cp, and includes the Macintosh-specific
|
||||
// implementations.
|
||||
|
||||
#include "FullPath.h"
|
||||
#include "FileCopy.h"
|
||||
#include "MoreFilesExtras.h"
|
||||
#include "nsEscape.h"
|
||||
|
||||
#include <Aliases.h>
|
||||
#include <Folders.h>
|
||||
#include <Errors.h>
|
||||
#include <TextUtils.h>
|
||||
#include <Processes.h>
|
||||
|
||||
const unsigned char* kAliasHavenFolderName = "\pnsAliasHaven";
|
||||
|
||||
//========================================================================================
|
||||
namespace MacFileHelpers
|
||||
//========================================================================================
|
||||
{
|
||||
inline void PLstrcpy(Str255 dst, ConstStr255Param src)
|
||||
{
|
||||
memcpy(dst, src, 1 + src[0]);
|
||||
}
|
||||
|
||||
void PLstrcpy(Str255 dst, const char* src, int inMaxLen=255);
|
||||
void PLstrncpy(Str255 dst, const char* src, int inMaxLen);
|
||||
|
||||
void SwapSlashColon(char * s);
|
||||
OSErr FSSpecFromFullUnixPath(
|
||||
const char * unixPath,
|
||||
FSSpec& outSpec,
|
||||
Boolean resolveAlias,
|
||||
Boolean allowPartial = false,
|
||||
Boolean createDirs = false);
|
||||
char* MacPathFromUnixPath(const char* unixPath);
|
||||
char* EncodeMacPath(
|
||||
char* inPath, // NOT const - gets clobbered
|
||||
Boolean prependSlash,
|
||||
Boolean doEscape );
|
||||
OSErr FSSpecFromPathname(
|
||||
const char* inPathNamePtr,
|
||||
FSSpec& outSpec,
|
||||
Boolean inCreateDirs);
|
||||
char* PathNameFromFSSpec(
|
||||
const FSSpec& inSpec,
|
||||
Boolean wantLeafName );
|
||||
OSErr CreateFolderInFolder(
|
||||
short refNum, // Parent directory/volume
|
||||
long dirID,
|
||||
ConstStr255Param folderName, // Name of the new folder
|
||||
short& outRefNum, // Volume of the created folder
|
||||
long& outDirID); //
|
||||
|
||||
// Some routines to support an "alias haven" directory. Aliases in this directory
|
||||
// are never resolved. There is a ResolveAlias here that respects that. This is
|
||||
// to support attaching of aliases in mail.
|
||||
void EnsureAliasHaven();
|
||||
void SetNoResolve(Boolean inResolve);
|
||||
PRBool IsAliasSafe(const FSSpec& inSpec);
|
||||
OSErr MakeAliasSafe(FSSpec& inOutSpec);
|
||||
OSErr ResolveAliasFile(FSSpec& inOutSpec, Boolean& wasAliased);
|
||||
|
||||
Boolean sNoResolve = false;
|
||||
long sAliasHavenDirID = 0;
|
||||
short sAliasHavenVRefNum = 0;
|
||||
} // namespace MacFileHelpers
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
void MacFileHelpers::PLstrcpy(Str255 dst, const char* src, int inMax)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
int srcLength = strlen(src);
|
||||
NS_ASSERTION(srcLength <= inMax, "Oops, string is too long!");
|
||||
if (srcLength > inMax)
|
||||
srcLength = inMax;
|
||||
dst[0] = srcLength;
|
||||
memcpy(&dst[1], src, srcLength);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
void MacFileHelpers::PLstrncpy(Str255 dst, const char* src, int inMax)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
int srcLength = strlen(src);
|
||||
if (srcLength > inMax)
|
||||
srcLength = inMax;
|
||||
dst[0] = srcLength;
|
||||
memcpy(&dst[1], src, srcLength);
|
||||
}
|
||||
|
||||
//-----------------------------------
|
||||
void MacFileHelpers::SwapSlashColon(char * s)
|
||||
//-----------------------------------
|
||||
|
||||
{
|
||||
while ( *s != 0)
|
||||
{
|
||||
if (*s == '/')
|
||||
*s++ = ':';
|
||||
else if (*s == ':')
|
||||
*s++ = '/';
|
||||
else
|
||||
*s++;
|
||||
}
|
||||
} // MacFileHelpers::SwapSlashColon
|
||||
|
||||
//-----------------------------------
|
||||
char* MacFileHelpers::EncodeMacPath(
|
||||
char* inPath, // NOT const, gets clobbered
|
||||
Boolean prependSlash,
|
||||
Boolean doEscape )
|
||||
// Transforms Macintosh style path into Unix one
|
||||
// Method: Swap ':' and '/', hex escape the result
|
||||
//-----------------------------------
|
||||
{
|
||||
if (inPath == nsnull)
|
||||
return nsnull;
|
||||
int pathSize = strlen(inPath);
|
||||
|
||||
// XP code sometimes chokes if there's a final slash in the unix path.
|
||||
// Since correct mac paths to folders and volumes will end in ':', strip this
|
||||
// first.
|
||||
char* c = inPath + pathSize - 1;
|
||||
if (*c == ':')
|
||||
{
|
||||
*c = 0;
|
||||
pathSize--;
|
||||
}
|
||||
|
||||
char * newPath = nsnull;
|
||||
char * finalPath = nsnull;
|
||||
|
||||
if (prependSlash)
|
||||
{
|
||||
newPath = new char[pathSize + 2];
|
||||
newPath[0] = ':'; // It will be converted to '/'
|
||||
memcpy(&newPath[1], inPath, pathSize + 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
newPath = new char[pathSize + 1];
|
||||
strcpy(newPath, inPath);
|
||||
}
|
||||
if (newPath)
|
||||
{
|
||||
SwapSlashColon( newPath );
|
||||
if (doEscape)
|
||||
{
|
||||
finalPath = nsEscape(newPath, url_Path);
|
||||
delete [] newPath;
|
||||
}
|
||||
else
|
||||
finalPath = newPath;
|
||||
}
|
||||
delete [] inPath;
|
||||
return finalPath;
|
||||
} // MacFileHelpers::EncodeMacPath
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
inline void MacFileHelpers::SetNoResolve(Boolean inResolve)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
sNoResolve = inResolve;
|
||||
} // MacFileHelpers::SetNoResolve
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
OSErr MacFileHelpers::MakeAliasSafe(FSSpec& inOutSpec)
|
||||
// Pass in the spec of an alias. This copies the file to the safe haven folder, and
|
||||
// returns the spec of the copy to the caller
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
EnsureAliasHaven();
|
||||
nsFileSpec dstDirSpec(sAliasHavenVRefNum, sAliasHavenDirID, "\p");
|
||||
|
||||
// Make sure its name is unique
|
||||
nsFileSpec havenSpec(sAliasHavenVRefNum, sAliasHavenDirID, "\pG'day");
|
||||
if (havenSpec.Valid())
|
||||
havenSpec.MakeUnique(inOutSpec.name);
|
||||
// Copy the file into the haven directory
|
||||
if (havenSpec.Valid())
|
||||
{
|
||||
OSErr err = ::FSpFileCopy(
|
||||
&inOutSpec,
|
||||
dstDirSpec,
|
||||
havenSpec.GetLeafPName(),
|
||||
nil, 0, true);
|
||||
// Return the spec of the copy to the caller.
|
||||
if (err != noErr)
|
||||
return err;
|
||||
inOutSpec = havenSpec;
|
||||
}
|
||||
return noErr;
|
||||
} // MacFileHelpers::MakeAliasSafe
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
char* MacFileHelpers::MacPathFromUnixPath(const char* unixPath)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
// Relying on the fact that the unix path is always longer than the mac path:
|
||||
size_t len = strlen(unixPath);
|
||||
char* result = new char[len + 2]; // ... but allow for the initial colon in a partial name
|
||||
if (result)
|
||||
{
|
||||
char* dst = result;
|
||||
const char* src = unixPath;
|
||||
if (*src == '/') // * full path
|
||||
src++;
|
||||
else if (strchr(src, '/')) // * partial path, and not just a leaf name
|
||||
*dst++ = ':';
|
||||
strcpy(dst, src);
|
||||
nsUnescape(dst); // Hex Decode
|
||||
MacFileHelpers::SwapSlashColon(dst);
|
||||
}
|
||||
return result;
|
||||
} // MacFileHelpers::MacPathFromUnixPath
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
OSErr MacFileHelpers::FSSpecFromPathname(
|
||||
const char* inPathNamePtr,
|
||||
FSSpec& outSpec,
|
||||
Boolean inCreateDirs)
|
||||
// FSSpecFromPathname reverses PathNameFromFSSpec.
|
||||
// It returns a FSSpec given a c string which is a mac pathname.
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
OSErr err;
|
||||
// Simplify this routine to use FSMakeFSSpec if length < 255. Otherwise use the MoreFiles
|
||||
// routine FSpLocationFromFullPath, which allocates memory, to handle longer pathnames.
|
||||
|
||||
size_t inLength = strlen(inPathNamePtr);
|
||||
if (inLength < 255)
|
||||
{
|
||||
Str255 ppath;
|
||||
MacFileHelpers::PLstrcpy(ppath, inPathNamePtr);
|
||||
err = ::FSMakeFSSpec(0, 0, ppath, &outSpec);
|
||||
}
|
||||
else
|
||||
err = FSpLocationFromFullPath(inLength, inPathNamePtr, &outSpec);
|
||||
|
||||
if (err == dirNFErr && inCreateDirs)
|
||||
{
|
||||
const char* path = inPathNamePtr;
|
||||
outSpec.vRefNum = 0;
|
||||
outSpec.parID = 0;
|
||||
do {
|
||||
// Locate the colon that terminates the node.
|
||||
// But if we've a partial path (starting with a colon), find the second one.
|
||||
const char* nextColon = strchr(path + (*path == ':'), ':');
|
||||
// Well, if there are no more colons, point to the end of the string.
|
||||
if (!nextColon)
|
||||
nextColon = path + strlen(path);
|
||||
|
||||
// Make a pascal string out of this node. Include initial
|
||||
// and final colon, if any!
|
||||
Str255 ppath;
|
||||
MacFileHelpers::PLstrncpy(ppath, path, nextColon - path + 1);
|
||||
|
||||
// Use this string as a relative path using the directory created
|
||||
// on the previous round (or directory 0,0 on the first round).
|
||||
err = ::FSMakeFSSpec(outSpec.vRefNum, outSpec.parID, ppath, &outSpec);
|
||||
|
||||
// If this was the leaf node, then we are done.
|
||||
if (!*nextColon)
|
||||
break;
|
||||
|
||||
// If we got "file not found", then
|
||||
// we need to create a directory.
|
||||
if (err == fnfErr && *nextColon)
|
||||
err = FSpDirCreate(&outSpec, smCurrentScript, &outSpec.parID);
|
||||
// For some reason, this usually returns fnfErr, even though it works.
|
||||
if (err != noErr && err != fnfErr)
|
||||
return err;
|
||||
path = nextColon; // next round
|
||||
} while (1);
|
||||
}
|
||||
return err;
|
||||
} // MacFileHelpers::FSSpecFromPathname
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
OSErr MacFileHelpers::CreateFolderInFolder(
|
||||
short refNum, // Parent directory/volume
|
||||
long dirID,
|
||||
ConstStr255Param folderName, // Name of the new folder
|
||||
short& outRefNum, // Volume of the created folder
|
||||
long& outDirID) //
|
||||
// Creates a folder named 'folderName' inside a folder.
|
||||
// The errors returned are same as PBDirCreate
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
HFileParam hpb;
|
||||
hpb.ioVRefNum = refNum;
|
||||
hpb.ioDirID = dirID;
|
||||
hpb.ioNamePtr = (StringPtr)&folderName;
|
||||
|
||||
OSErr err = PBDirCreateSync((HParmBlkPtr)&hpb);
|
||||
if (err == noErr)
|
||||
{
|
||||
outRefNum = hpb.ioVRefNum;
|
||||
outDirID = hpb.ioDirID;
|
||||
}
|
||||
else
|
||||
{
|
||||
outRefNum = 0;
|
||||
outDirID = 0;
|
||||
}
|
||||
return err;
|
||||
} // MacFileHelpers::CreateFolderInFolder
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
void MacFileHelpers::EnsureAliasHaven()
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
// Alias Haven is a directory in which we never resolve aliases.
|
||||
if (sAliasHavenVRefNum != 0)
|
||||
return;
|
||||
|
||||
|
||||
FSSpec temp;
|
||||
if (FindFolder(0, kTemporaryFolderType, true, & temp.vRefNum, &temp.parID) == noErr)
|
||||
{
|
||||
CreateFolderInFolder(
|
||||
temp.vRefNum, // Parent directory/volume
|
||||
temp.parID,
|
||||
kAliasHavenFolderName, // Name of the new folder
|
||||
sAliasHavenVRefNum, // Volume of the created folder
|
||||
sAliasHavenDirID);
|
||||
}
|
||||
} // MacFileHelpers::EnsureAliasHaven
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
PRBool MacFileHelpers::IsAliasSafe(const FSSpec& inSpec)
|
||||
// Returns true if the alias is in the alias haven directory, or if alias resolution
|
||||
// has been turned off.
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
return sNoResolve
|
||||
|| (inSpec.parID == sAliasHavenDirID && inSpec.vRefNum == sAliasHavenVRefNum);
|
||||
} // MacFileHelpers::IsAliasSafe
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
OSErr MacFileHelpers::ResolveAliasFile(FSSpec& inOutSpec, Boolean& wasAliased)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
wasAliased = false;
|
||||
if (IsAliasSafe(inOutSpec))
|
||||
return noErr;
|
||||
Boolean dummy;
|
||||
return ::ResolveAliasFile(&inOutSpec, TRUE, &dummy, &wasAliased);
|
||||
} // MacFileHelpers::ResolveAliasFile
|
||||
|
||||
//-----------------------------------
|
||||
OSErr MacFileHelpers::FSSpecFromFullUnixPath(
|
||||
const char * unixPath,
|
||||
FSSpec& outSpec,
|
||||
Boolean resolveAlias,
|
||||
Boolean allowPartial,
|
||||
Boolean createDirs)
|
||||
// File spec from URL. Reverses GetURLFromFileSpec
|
||||
// Its input is only the <path> part of the URL
|
||||
// JRM 97/01/08 changed this so that if it's a partial path (doesn't start with '/'),
|
||||
// then it is combined with inOutSpec's vRefNum and parID to form a new spec.
|
||||
//-----------------------------------
|
||||
{
|
||||
if (unixPath == nsnull)
|
||||
return badFidErr;
|
||||
char* macPath = MacPathFromUnixPath(unixPath);
|
||||
if (!macPath)
|
||||
return memFullErr;
|
||||
|
||||
OSErr err = noErr;
|
||||
if (!allowPartial)
|
||||
{
|
||||
NS_ASSERTION(*unixPath == '/' /*full path*/, "Not a full Unix path!");
|
||||
}
|
||||
err = FSSpecFromPathname(macPath, outSpec, createDirs);
|
||||
if (err == fnfErr)
|
||||
err = noErr;
|
||||
Boolean dummy;
|
||||
if (err == noErr && resolveAlias) // Added
|
||||
err = MacFileHelpers::ResolveAliasFile(outSpec, dummy);
|
||||
delete [] macPath;
|
||||
NS_ASSERTION(err==noErr||err==fnfErr||err==dirNFErr||err==nsvErr, "Not a path!");
|
||||
return err;
|
||||
} // MacFileHelpers::FSSpecFromLocalUnixPath
|
||||
|
||||
//-----------------------------------
|
||||
char* MacFileHelpers::PathNameFromFSSpec( const FSSpec& inSpec, Boolean wantLeafName )
|
||||
// Returns a full pathname to the given file
|
||||
// Returned value is allocated with new [], and must be freed with delete []
|
||||
// This is taken from FSpGetFullPath in MoreFiles, except that we need to tolerate
|
||||
// fnfErr.
|
||||
//-----------------------------------
|
||||
{
|
||||
char* result = nil;
|
||||
OSErr err = noErr;
|
||||
|
||||
short fullPathLength = 0;
|
||||
Handle fullPath = nsnull;
|
||||
|
||||
FSSpec tempSpec = inSpec;
|
||||
if ( tempSpec.parID == fsRtParID )
|
||||
{
|
||||
/* The object is a volume */
|
||||
|
||||
/* Add a colon to make it a full pathname */
|
||||
tempSpec.name[++tempSpec.name[0]] = ':';
|
||||
|
||||
/* We're done */
|
||||
err = PtrToHand(&tempSpec.name[1], &fullPath, tempSpec.name[0]);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* The object isn't a volume */
|
||||
|
||||
CInfoPBRec pb = { 0 };
|
||||
Str63 dummyFileName;
|
||||
MacFileHelpers::PLstrcpy(dummyFileName, "\pG'day!");
|
||||
|
||||
/* Is the object a file or a directory? */
|
||||
pb.dirInfo.ioNamePtr = (! tempSpec.name[0]) ? (StringPtr)dummyFileName : tempSpec.name;
|
||||
pb.dirInfo.ioVRefNum = tempSpec.vRefNum;
|
||||
pb.dirInfo.ioDrDirID = tempSpec.parID;
|
||||
pb.dirInfo.ioFDirIndex = 0;
|
||||
err = PBGetCatInfoSync(&pb);
|
||||
if ( err == noErr || err == fnfErr)
|
||||
{
|
||||
// if the object is a directory, append a colon so full pathname ends with colon
|
||||
// Beware of the "illegal spec" case that Netscape uses (empty name string). In
|
||||
// this case, we don't want the colon.
|
||||
if ( err == noErr && tempSpec.name[0] && (pb.hFileInfo.ioFlAttrib & ioDirMask) != 0 )
|
||||
{
|
||||
++tempSpec.name[0];
|
||||
tempSpec.name[tempSpec.name[0]] = ':';
|
||||
}
|
||||
|
||||
/* Put the object name in first */
|
||||
err = PtrToHand(&tempSpec.name[1], &fullPath, tempSpec.name[0]);
|
||||
if ( err == noErr )
|
||||
{
|
||||
/* Get the ancestor directory names */
|
||||
pb.dirInfo.ioNamePtr = tempSpec.name;
|
||||
pb.dirInfo.ioVRefNum = tempSpec.vRefNum;
|
||||
pb.dirInfo.ioDrParID = tempSpec.parID;
|
||||
do /* loop until we have an error or find the root directory */
|
||||
{
|
||||
pb.dirInfo.ioFDirIndex = -1;
|
||||
pb.dirInfo.ioDrDirID = pb.dirInfo.ioDrParID;
|
||||
err = PBGetCatInfoSync(&pb);
|
||||
if ( err == noErr )
|
||||
{
|
||||
/* Append colon to directory name */
|
||||
++tempSpec.name[0];
|
||||
tempSpec.name[tempSpec.name[0]] = ':';
|
||||
|
||||
/* Add directory name to beginning of fullPath */
|
||||
(void) Munger(fullPath, 0, nsnull, 0, &tempSpec.name[1], tempSpec.name[0]);
|
||||
err = MemError();
|
||||
}
|
||||
} while ( err == noErr && pb.dirInfo.ioDrDirID != fsRtDirID );
|
||||
}
|
||||
}
|
||||
}
|
||||
if ( err != noErr && err != fnfErr)
|
||||
goto Clean;
|
||||
|
||||
fullPathLength = GetHandleSize(fullPath);
|
||||
err = noErr;
|
||||
int allocSize = 1 + fullPathLength;
|
||||
// We only want the leaf name if it's the root directory or wantLeafName is true.
|
||||
if (inSpec.parID != fsRtParID && !wantLeafName)
|
||||
allocSize -= inSpec.name[0];
|
||||
result = new char[allocSize];
|
||||
if (!result)
|
||||
goto Clean;
|
||||
memcpy(result, *fullPath, allocSize - 1);
|
||||
result[ allocSize - 1 ] = 0;
|
||||
Clean:
|
||||
if (fullPath)
|
||||
DisposeHandle(fullPath);
|
||||
NS_ASSERTION(result, "Out of memory"); // OOPS! very bad.
|
||||
return result;
|
||||
} // MacFileHelpers::PathNameFromFSSpec
|
||||
|
||||
//========================================================================================
|
||||
// Macintosh nsFileSpec implementation
|
||||
//========================================================================================
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
nsFileSpec::nsFileSpec()
|
||||
//----------------------------------------------------------------------------------------
|
||||
: mError(NS_OK)
|
||||
{
|
||||
mSpec.name[0] = '\0';
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
nsFileSpec::nsFileSpec(const nsFileSpec& inSpec)
|
||||
//----------------------------------------------------------------------------------------
|
||||
: mSpec(inSpec.mSpec)
|
||||
, mError(inSpec.Error())
|
||||
{
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
nsFileSpec::nsFileSpec(const char* inString, PRBool inCreateDirs)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
mError = NS_FILE_RESULT(MacFileHelpers::FSSpecFromFullUnixPath(
|
||||
inString, mSpec, false, true, inCreateDirs));
|
||||
// allow a partial path, create as necessary
|
||||
if (mError == NS_FILE_RESULT(fnfErr))
|
||||
mError = NS_OK;
|
||||
} // nsFileSpec::nsFileSpec
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
nsFileSpec::nsFileSpec(const nsString& inString, PRBool inCreateDirs)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
mError = NS_FILE_RESULT(MacFileHelpers::FSSpecFromFullUnixPath(
|
||||
nsAutoCString(inString), mSpec, false, true, inCreateDirs));
|
||||
// allow a partial path, create as necessary
|
||||
if (mError == NS_FILE_RESULT(fnfErr))
|
||||
mError = NS_OK;
|
||||
} // nsFileSpec::nsFileSpec
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
nsFileSpec::nsFileSpec(
|
||||
short vRefNum,
|
||||
long parID,
|
||||
ConstStr255Param name)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
mError = NS_FILE_RESULT(::FSMakeFSSpec(vRefNum, parID, name, &mSpec));
|
||||
if (mError == NS_FILE_RESULT(fnfErr))
|
||||
mError = noErr;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
nsFileSpec::nsFileSpec(const nsFilePath& inPath)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
*this = inPath.GetFileSpec();
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
//----------------------------------------------------------------------------------------
|
||||
nsOutputStream& operator << (nsOutputStream& s, const nsFileSpec& spec)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
s << spec.mSpec.vRefNum << ", " << spec.mSpec.parID << ", \"";
|
||||
s.write((const char*)&spec.mSpec.name[1], spec.mSpec.name[0]);
|
||||
return s << "\"";
|
||||
} // nsOutputStream& operator << (nsOutputStream&, const nsFileSpec&)
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
void nsFileSpec::operator = (const char* inString)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
mError = NS_FILE_RESULT(MacFileHelpers::FSSpecFromFullUnixPath(inString, mSpec, false));
|
||||
} // nsFileSpec::operator =
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
void nsFileSpec::operator = (const nsFileSpec& inSpec)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
mSpec = inSpec.mSpec;
|
||||
mError = inSpec.Error();
|
||||
} // nsFileSpec::operator =
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
void nsFileSpec::operator = (const nsFilePath& inPath)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
*this = inPath.GetFileSpec();
|
||||
} // nsFileSpec::operator =
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
PRBool nsFileSpec::Exists() const
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
FSSpec temp;
|
||||
return ::FSMakeFSSpec(mSpec.vRefNum, mSpec.parID, mSpec.name, &temp) == noErr;
|
||||
} // nsFileSpec::operator =
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
void nsFileSpec::SetLeafName(const char* inLeafName)
|
||||
// In leaf name can actually be a partial path...
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
// what about long relative paths? Hmm?
|
||||
Str255 partialPath;
|
||||
MacFileHelpers::PLstrcpy(partialPath, inLeafName);
|
||||
mError = NS_FILE_RESULT(
|
||||
::FSMakeFSSpec(mSpec.vRefNum, mSpec.parID, partialPath, &mSpec));
|
||||
} // nsFileSpec::SetLeafName
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
char* nsFileSpec::GetLeafName() const
|
||||
// Result needs to be delete[]ed.
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
char leaf[64];
|
||||
memcpy(leaf, &mSpec.name[1], mSpec.name[0]);
|
||||
leaf[mSpec.name[0]] = '\0';
|
||||
return nsFileSpecHelpers::StringDup(leaf);
|
||||
} // nsFileSpec::GetLeafName
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
void nsFileSpec::MakeAliasSafe()
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
mError = NS_FILE_RESULT(MacFileHelpers::MakeAliasSafe(mSpec));
|
||||
} // nsFileSpec::MakeAliasSafe
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
void nsFileSpec::MakeUnique(ConstStr255Param inSuggestedLeafName)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
if (inSuggestedLeafName[0] > 0)
|
||||
MacFileHelpers::PLstrcpy(mSpec.name, inSuggestedLeafName);
|
||||
|
||||
MakeUnique();
|
||||
} // nsFileSpec::MakeUnique
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
void nsFileSpec::ResolveAlias(PRBool& wasAliased)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
Boolean wasAliased2;
|
||||
mError = NS_FILE_RESULT(MacFileHelpers::ResolveAliasFile(mSpec, wasAliased2));
|
||||
wasAliased = (wasAliased2 != false);
|
||||
} // nsFileSpec::ResolveAlias
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
PRBool nsFileSpec::IsFile() const
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
long dirID;
|
||||
Boolean isDirectory;
|
||||
return (noErr == FSpGetDirectoryID(&mSpec, &dirID, &isDirectory) && !isDirectory);
|
||||
} // nsFileSpec::IsFile
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
PRBool nsFileSpec::IsDirectory() const
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
long dirID;
|
||||
Boolean isDirectory;
|
||||
return (noErr == FSpGetDirectoryID(&mSpec, &dirID, &isDirectory) && isDirectory);
|
||||
} // nsFileSpec::IsDirectory
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
void nsFileSpec::GetParent(nsFileSpec& outSpec) const
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
if (NS_SUCCEEDED(mError))
|
||||
outSpec.mError
|
||||
= NS_FILE_RESULT(::FSMakeFSSpec(mSpec.vRefNum, mSpec.parID, nsnull, outSpec));
|
||||
} // nsFileSpec::GetParent
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
void nsFileSpec::operator += (const char* inRelativePath)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
long dirID;
|
||||
Boolean isDirectory;
|
||||
mError = NS_FILE_RESULT(::FSpGetDirectoryID(&mSpec, &dirID, &isDirectory));
|
||||
if (NS_SUCCEEDED(mError) && isDirectory)
|
||||
{
|
||||
Str255 partialPath;
|
||||
MacFileHelpers::PLstrcpy(partialPath, inRelativePath);
|
||||
mError = NS_FILE_RESULT(::FSMakeFSSpec(mSpec.vRefNum, dirID, partialPath, *this));
|
||||
//if (NS_SUCCEEDED(mError))
|
||||
// SetLeafName(inRelativePath);
|
||||
}
|
||||
} // nsFileSpec::operator +=
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
void nsFileSpec::CreateDirectory(int /* unix mode */)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
long ignoredDirID;
|
||||
FSpDirCreate(&mSpec, smCurrentScript, &ignoredDirID);
|
||||
} // nsFileSpec::CreateDirectory
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
void nsFileSpec::Delete(PRBool inRecursive) const
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
nsresult& mutableError = const_cast<nsFileSpec*>(this)->mError;
|
||||
if (inRecursive)
|
||||
{
|
||||
// MoreFilesExtras
|
||||
mutableError = NS_FILE_RESULT(::DeleteDirectory(
|
||||
mSpec.vRefNum,
|
||||
mSpec.parID,
|
||||
const_cast<unsigned char*>(mSpec.name)));
|
||||
}
|
||||
else
|
||||
mutableError = NS_FILE_RESULT(FSpDelete(&mSpec));
|
||||
} // nsFileSpec::Delete
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
nsresult nsFileSpec::Rename(const char* inNewName)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
if (strchr(inNewName, '/'))
|
||||
return -1; // no relative paths here!
|
||||
Str255 pName;
|
||||
MacFileHelpers::PLstrcpy(pName, inNewName);
|
||||
if (FSpRename(&mSpec, pName) != noErr)
|
||||
return -1;
|
||||
SetLeafName(inNewName);
|
||||
return 0;
|
||||
} // nsFileSpec::Rename
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
nsresult nsFileSpec::Copy(const nsFileSpec& newParentDir) const
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
// We can only copy into a directory, and (for now) can not copy entire directories
|
||||
|
||||
if (!newParentDir.IsDirectory() || (IsDirectory() ) )
|
||||
return NS_FILE_FAILURE;
|
||||
|
||||
|
||||
nsresult result = NS_FILE_RESULT(::FSpFileCopy( &mSpec,
|
||||
&newParentDir.mSpec,
|
||||
const_cast<StringPtr>(GetLeafPName()),
|
||||
nsnull,
|
||||
0,
|
||||
true));
|
||||
|
||||
return result;
|
||||
|
||||
} // nsFileSpec::Copy
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
nsresult nsFileSpec::Move(const nsFileSpec& newParentDir) const
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
// We can only move into a directory
|
||||
|
||||
if (!newParentDir.IsDirectory())
|
||||
return NS_FILE_FAILURE;
|
||||
|
||||
nsresult result = NS_FILE_RESULT(::FSpMoveRenameCompat(&mSpec,
|
||||
&newParentDir.mSpec,
|
||||
const_cast<StringPtr>(GetLeafPName())));
|
||||
|
||||
return result;
|
||||
} // nsFileSpec::Move
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
nsresult nsFileSpec::Execute(const char* /*args - how can this be cross-platform? problem! */ ) const
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
if (IsDirectory())
|
||||
return NS_FILE_FAILURE;
|
||||
|
||||
LaunchParamBlockRec launchThis;
|
||||
launchThis.launchAppSpec = const_cast<FSSpec*>(&mSpec);
|
||||
launchThis.launchAppParameters = nsnull; // args;
|
||||
/* launch the thing */
|
||||
launchThis.launchBlockID = extendedBlock;
|
||||
launchThis.launchEPBLength = extendedBlockLen;
|
||||
launchThis.launchFileFlags = nsnull;
|
||||
launchThis.launchControlFlags = launchContinue + launchNoFileFlags + launchUseMinimum;
|
||||
launchThis.launchControlFlags += launchDontSwitch;
|
||||
|
||||
nsresult result = NS_FILE_RESULT(::LaunchApplication(&launchThis));
|
||||
return result;
|
||||
|
||||
} // nsFileSpec::Execute
|
||||
|
||||
//========================================================================================
|
||||
// Macintosh nsFilePath implementation
|
||||
//========================================================================================
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
nsFilePath::nsFilePath(const char* inString, PRBool inCreateDirs)
|
||||
//----------------------------------------------------------------------------------------
|
||||
: mPath(nsnull)
|
||||
, mFileSpec(inString, inCreateDirs)
|
||||
{
|
||||
// Make canonical and absolute.
|
||||
char * path = MacFileHelpers::PathNameFromFSSpec( mFileSpec, TRUE );
|
||||
mPath = MacFileHelpers::EncodeMacPath(path, true, true);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
nsFilePath::nsFilePath(const nsString& inString, PRBool inCreateDirs)
|
||||
//----------------------------------------------------------------------------------------
|
||||
: mPath(nsnull)
|
||||
, mFileSpec(nsAutoCString(inString), inCreateDirs)
|
||||
{
|
||||
// Make canonical and absolute.
|
||||
char * path = MacFileHelpers::PathNameFromFSSpec( mFileSpec, TRUE );
|
||||
mPath = MacFileHelpers::EncodeMacPath(path, true, true);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
nsFilePath::nsFilePath(const nsFileSpec& inSpec)
|
||||
//----------------------------------------------------------------------------------------
|
||||
: mFileSpec(inSpec)
|
||||
{
|
||||
char * path = MacFileHelpers::PathNameFromFSSpec( inSpec.mSpec, TRUE );
|
||||
mPath = MacFileHelpers::EncodeMacPath(path, true, true);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
void nsFilePath::operator = (const nsFileSpec& inSpec)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
delete [] mPath;
|
||||
char * path = MacFileHelpers::PathNameFromFSSpec( inSpec.mSpec, TRUE );
|
||||
mPath = MacFileHelpers::EncodeMacPath(path, true, true);
|
||||
mFileSpec = inSpec;
|
||||
} // nsFilePath::operator =
|
||||
|
||||
//========================================================================================
|
||||
// nsFileURL implementation
|
||||
//========================================================================================
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
nsFileURL::nsFileURL(const char* inString, PRBool inCreateDirs)
|
||||
//----------------------------------------------------------------------------------------
|
||||
: mURL(nsnull)
|
||||
, mFileSpec(inString + kFileURLPrefixLength, inCreateDirs)
|
||||
{
|
||||
NS_ASSERTION(strstr(inString, kFileURLPrefix) == inString, "Not a URL!");
|
||||
// Make canonical and absolute.
|
||||
char* path = MacFileHelpers::PathNameFromFSSpec( mFileSpec, TRUE );
|
||||
char* escapedPath = MacFileHelpers::EncodeMacPath(path, true, true);
|
||||
mURL = nsFileSpecHelpers::StringDup(kFileURLPrefix, kFileURLPrefixLength + strlen(escapedPath));
|
||||
strcat(mURL, escapedPath);
|
||||
delete [] escapedPath;
|
||||
} // nsFileURL::nsFileURL
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
nsFileURL::nsFileURL(const nsString& inString, PRBool inCreateDirs)
|
||||
//----------------------------------------------------------------------------------------
|
||||
: mURL(nsnull)
|
||||
{
|
||||
nsAutoCString aString(inString);
|
||||
const char* aCString = (const char*)aString;
|
||||
NS_ASSERTION(strstr(aCString, kFileURLPrefix) == aCString, "Not a URL!");
|
||||
mFileSpec = aCString + kFileURLPrefixLength;
|
||||
// Make canonical and absolute.
|
||||
char* path = MacFileHelpers::PathNameFromFSSpec( mFileSpec, TRUE );
|
||||
char* escapedPath = MacFileHelpers::EncodeMacPath(path, true, true);
|
||||
mURL = nsFileSpecHelpers::StringDup(kFileURLPrefix, kFileURLPrefixLength + strlen(escapedPath));
|
||||
strcat(mURL, escapedPath);
|
||||
delete [] escapedPath;
|
||||
} // nsFileURL::nsFileURL
|
||||
|
||||
//========================================================================================
|
||||
// nsDirectoryIterator
|
||||
//========================================================================================
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
nsDirectoryIterator::nsDirectoryIterator(
|
||||
const nsFileSpec& inDirectory
|
||||
, int inIterateDirection)
|
||||
//----------------------------------------------------------------------------------------
|
||||
: mCurrent(inDirectory)
|
||||
, mExists(false)
|
||||
, mIndex(-1)
|
||||
{
|
||||
CInfoPBRec pb;
|
||||
DirInfo* dipb = (DirInfo*)&pb;
|
||||
// Sorry about this, there seems to be a bug in CWPro 4:
|
||||
const FSSpec& inSpec = inDirectory.nsFileSpec::operator const FSSpec&();
|
||||
Str255 outName;
|
||||
MacFileHelpers::PLstrcpy(outName, inSpec.name);
|
||||
pb.hFileInfo.ioNamePtr = outName;
|
||||
pb.hFileInfo.ioVRefNum = inSpec.vRefNum;
|
||||
pb.hFileInfo.ioDirID = inSpec.parID;
|
||||
pb.hFileInfo.ioFDirIndex = 0; // use ioNamePtr and ioDirID
|
||||
|
||||
OSErr err = PBGetCatInfoSync( &pb );
|
||||
|
||||
// test that we have got a directory back, not a file
|
||||
if ( (err != noErr ) || !( dipb->ioFlAttrib & 0x0010 ) )
|
||||
return;
|
||||
// Sorry about this, there seems to be a bug in CWPro 4:
|
||||
FSSpec& currentSpec = mCurrent.nsFileSpec::operator FSSpec&();
|
||||
currentSpec.vRefNum = inSpec.vRefNum;
|
||||
currentSpec.parID = dipb->ioDrDirID;
|
||||
mMaxIndex = pb.dirInfo.ioDrNmFls;
|
||||
if (inIterateDirection > 0)
|
||||
{
|
||||
mIndex = 0; // ready to increment
|
||||
++(*this); // the pre-increment operator
|
||||
}
|
||||
else
|
||||
{
|
||||
mIndex = mMaxIndex + 1; // ready to decrement
|
||||
--(*this); // the pre-decrement operator
|
||||
}
|
||||
} // nsDirectoryIterator::nsDirectoryIterator
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
OSErr nsDirectoryIterator::SetToIndex()
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
CInfoPBRec cipb;
|
||||
DirInfo *dipb=(DirInfo *)&cipb;
|
||||
Str255 objectName;
|
||||
dipb->ioCompletion = nsnull;
|
||||
dipb->ioFDirIndex = mIndex;
|
||||
// Sorry about this, there seems to be a bug in CWPro 4:
|
||||
FSSpec& currentSpec = mCurrent.nsFileSpec::operator FSSpec&();
|
||||
dipb->ioVRefNum = currentSpec.vRefNum; /* Might need to use vRefNum, not sure*/
|
||||
dipb->ioDrDirID = currentSpec.parID;
|
||||
dipb->ioNamePtr = objectName;
|
||||
OSErr err = PBGetCatInfoSync(&cipb);
|
||||
if (err == noErr)
|
||||
err = FSMakeFSSpec(currentSpec.vRefNum, currentSpec.parID, objectName, ¤tSpec);
|
||||
mExists = err == noErr;
|
||||
return err;
|
||||
} // nsDirectoryIterator::SetToIndex()
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
nsDirectoryIterator& nsDirectoryIterator::operator -- ()
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
mExists = false;
|
||||
while (--mIndex > 0)
|
||||
{
|
||||
OSErr err = SetToIndex();
|
||||
if (err == noErr)
|
||||
break;
|
||||
}
|
||||
return *this;
|
||||
} // nsDirectoryIterator::operator --
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
nsDirectoryIterator& nsDirectoryIterator::operator ++ ()
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
mExists = false;
|
||||
if (mIndex >= 0) // probably trying to use a file as a directory!
|
||||
while (++mIndex <= mMaxIndex)
|
||||
{
|
||||
OSErr err = SetToIndex();
|
||||
if (err == noErr)
|
||||
break;
|
||||
}
|
||||
return *this;
|
||||
} // nsDirectoryIterator::operator ++
|
||||
147
mozilla/base/src/mac/nsRepeater.cpp
Normal file
147
mozilla/base/src/mac/nsRepeater.cpp
Normal file
@@ -0,0 +1,147 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
#include "nsRepeater.h"
|
||||
|
||||
Repeater* Repeater::sRepeaters = 0;
|
||||
Repeater* Repeater::sIdlers = 0;
|
||||
|
||||
Repeater::Repeater()
|
||||
{
|
||||
mRepeating = false;
|
||||
mIdling = false;
|
||||
mPrevRptr = 0;
|
||||
mNextRptr = 0;
|
||||
mPrevIdlr = 0;
|
||||
mNextIdlr = 0;
|
||||
}
|
||||
|
||||
Repeater::~Repeater()
|
||||
{
|
||||
if (mRepeating) RemoveFromRepeatList();
|
||||
if (mIdling) RemoveFromIdleList();
|
||||
}
|
||||
|
||||
// protected helper functs
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
void Repeater::AddToRepeatList()
|
||||
{
|
||||
if (sRepeaters)
|
||||
{
|
||||
sRepeaters->mPrevRptr = this;
|
||||
mNextRptr = sRepeaters;
|
||||
}
|
||||
sRepeaters = this;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
void Repeater::RemoveFromRepeatList()
|
||||
{
|
||||
if (sRepeaters == this) sRepeaters = mNextRptr;
|
||||
if (mPrevRptr) mPrevRptr->mNextRptr = mNextRptr;
|
||||
if (mNextRptr) mNextRptr->mPrevRptr = mPrevRptr;
|
||||
mPrevRptr = 0;
|
||||
mNextRptr = 0;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
void Repeater::AddToIdleList()
|
||||
{
|
||||
if (sIdlers)
|
||||
{
|
||||
sIdlers->mPrevIdlr = this;
|
||||
mNextIdlr = sIdlers;
|
||||
}
|
||||
sIdlers = this;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
void Repeater::RemoveFromIdleList()
|
||||
{
|
||||
if (sIdlers == this) sIdlers = mNextIdlr;
|
||||
if (mPrevIdlr) mPrevIdlr->mNextIdlr = mNextIdlr;
|
||||
if (mNextIdlr) mNextIdlr->mPrevIdlr = mPrevIdlr;
|
||||
mPrevIdlr = 0;
|
||||
mNextIdlr = 0;
|
||||
}
|
||||
|
||||
// repeater methods
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
void Repeater::StartRepeating()
|
||||
{
|
||||
if (!mRepeating)
|
||||
{
|
||||
AddToRepeatList();
|
||||
mRepeating = true;
|
||||
}
|
||||
}
|
||||
|
||||
void Repeater::StopRepeating()
|
||||
{
|
||||
if (mRepeating)
|
||||
{
|
||||
RemoveFromRepeatList();
|
||||
mRepeating = false;
|
||||
}
|
||||
}
|
||||
|
||||
void Repeater::DoRepeaters(const EventRecord &aMacEvent)
|
||||
{
|
||||
Repeater* theRepeater = sRepeaters;
|
||||
while (theRepeater)
|
||||
{
|
||||
theRepeater->RepeatAction(aMacEvent);
|
||||
theRepeater = theRepeater->mNextRptr;
|
||||
}
|
||||
}
|
||||
|
||||
// idler methods
|
||||
|
||||
void Repeater::StartIdling()
|
||||
{
|
||||
if (!mIdling)
|
||||
{
|
||||
AddToIdleList();
|
||||
mIdling = true;
|
||||
}
|
||||
}
|
||||
|
||||
void Repeater::StopIdling()
|
||||
{
|
||||
if (mIdling)
|
||||
{
|
||||
RemoveFromIdleList();
|
||||
mIdling = false;
|
||||
}
|
||||
}
|
||||
|
||||
void Repeater::DoIdlers(const EventRecord &aMacEvent)
|
||||
{
|
||||
Repeater* theIdler = sIdlers;
|
||||
while (theIdler)
|
||||
{
|
||||
theIdler->RepeatAction(aMacEvent);
|
||||
theIdler = theIdler->mNextIdlr;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
365
mozilla/base/src/mac/nsTimerMac.cpp
Normal file
365
mozilla/base/src/mac/nsTimerMac.cpp
Normal file
@@ -0,0 +1,365 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
//
|
||||
// Mac implementation of the nsITimer interface
|
||||
//
|
||||
|
||||
|
||||
|
||||
#include "nsITimer.h"
|
||||
#include "nsITimerCallback.h"
|
||||
#include "prlog.h"
|
||||
#include "nsRepeater.h"
|
||||
|
||||
#include <list.h>
|
||||
#include <Events.h>
|
||||
|
||||
|
||||
|
||||
#pragma mark class TimerImpl
|
||||
|
||||
//========================================================================================
|
||||
class TimerImpl : public nsITimer
|
||||
// TimerImpl implements nsITimer API
|
||||
//========================================================================================
|
||||
{
|
||||
friend class TimerPeriodical;
|
||||
|
||||
private:
|
||||
nsTimerCallbackFunc mCallbackFunc;
|
||||
nsITimerCallback * mCallbackObject;
|
||||
void * mClosure;
|
||||
PRUint32 mDelay;
|
||||
PRUint32 mFireTime; // Timer should fire when TickCount >= this number
|
||||
TimerImpl * mPrev;
|
||||
TimerImpl * mNext;
|
||||
|
||||
public:
|
||||
|
||||
// constructors
|
||||
|
||||
TimerImpl();
|
||||
|
||||
virtual ~TimerImpl();
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
PRUint32 GetFireTime() const { return mFireTime; }
|
||||
|
||||
void Fire();
|
||||
|
||||
// nsITimer overrides
|
||||
|
||||
virtual nsresult Init(nsTimerCallbackFunc aFunc,
|
||||
void *aClosure,
|
||||
PRUint32 aDelay);
|
||||
|
||||
virtual nsresult Init(nsITimerCallback *aCallback,
|
||||
PRUint32 aDelay);
|
||||
|
||||
virtual void Cancel();
|
||||
|
||||
virtual PRUint32 GetDelay();
|
||||
|
||||
virtual void SetDelay(PRUint32 aDelay);
|
||||
|
||||
virtual void* GetClosure();
|
||||
|
||||
#if DEBUG
|
||||
enum {
|
||||
eGoodTimerSignature = 'Barf',
|
||||
eDeletedTimerSignature = 'oops'
|
||||
};
|
||||
|
||||
Boolean IsGoodTimer() const { return (mSignature == eGoodTimerSignature); }
|
||||
#endif
|
||||
|
||||
private:
|
||||
// Calculates mFireTime too
|
||||
void SetDelaySelf( PRUint32 aDelay );
|
||||
|
||||
#if DEBUG
|
||||
UInt32 mSignature;
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
#pragma mark class TimerPeriodical
|
||||
|
||||
//========================================================================================
|
||||
class TimerPeriodical : public Repeater
|
||||
// TimerPeriodical is a singleton Repeater subclass that fires
|
||||
// off TimerImpl. The firing is done on idle.
|
||||
//========================================================================================
|
||||
{
|
||||
static TimerPeriodical * gPeriodical;
|
||||
|
||||
TimerImpl* mTimers;
|
||||
|
||||
public:
|
||||
// Returns the singleton instance
|
||||
static TimerPeriodical * GetPeriodical();
|
||||
|
||||
TimerPeriodical();
|
||||
|
||||
virtual ~TimerPeriodical();
|
||||
|
||||
virtual void RepeatAction( const EventRecord &inMacEvent);
|
||||
|
||||
nsresult AddTimer( TimerImpl * aTimer);
|
||||
|
||||
nsresult RemoveTimer( TimerImpl * aTimer);
|
||||
|
||||
};
|
||||
|
||||
|
||||
//========================================================================================
|
||||
// TimerImpl implementation
|
||||
//========================================================================================
|
||||
|
||||
static NS_DEFINE_IID(kITimerIID, NS_ITIMER_IID);
|
||||
NS_IMPL_ISUPPORTS(TimerImpl, kITimerIID)
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
TimerImpl::TimerImpl()
|
||||
//----------------------------------------------------------------------------------------
|
||||
: mCallbackFunc(nsnull)
|
||||
, mCallbackObject(nsnull)
|
||||
, mClosure(nsnull)
|
||||
, mDelay(0)
|
||||
, mFireTime(0)
|
||||
, mPrev(nsnull)
|
||||
, mNext(nsnull)
|
||||
#if DEBUG
|
||||
, mSignature(eGoodTimerSignature)
|
||||
#endif
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
TimerImpl::~TimerImpl()
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
Cancel();
|
||||
NS_IF_RELEASE(mCallbackObject);
|
||||
#if DEBUG
|
||||
mSignature = eDeletedTimerSignature;
|
||||
#endif
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
nsresult TimerImpl::Init(nsTimerCallbackFunc aFunc,
|
||||
void *aClosure,
|
||||
PRUint32 aDelay)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
mCallbackFunc = aFunc;
|
||||
mClosure = aClosure;
|
||||
SetDelaySelf(aDelay);
|
||||
return TimerPeriodical::GetPeriodical()->AddTimer(this);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
nsresult TimerImpl::Init(nsITimerCallback *aCallback,
|
||||
PRUint32 aDelay)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
NS_ADDREF(aCallback);
|
||||
mCallbackObject = aCallback;
|
||||
SetDelaySelf(aDelay);
|
||||
return TimerPeriodical::GetPeriodical()->AddTimer(this);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
void TimerImpl::Cancel()
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
TimerPeriodical::GetPeriodical()->RemoveTimer(this);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
PRUint32 TimerImpl::GetDelay()
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
return mDelay;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
void TimerImpl::SetDelay(PRUint32 aDelay)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
SetDelaySelf(aDelay);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
void* TimerImpl::GetClosure()
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
return mClosure;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
void TimerImpl::Fire()
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
NS_PRECONDITION(mRefCnt > 0, "Firing a disposed Timer!");
|
||||
if (mCallbackFunc != NULL)
|
||||
{
|
||||
(*mCallbackFunc)(this, mClosure);
|
||||
}
|
||||
else if (mCallbackObject != NULL)
|
||||
{
|
||||
nsITimerCallback* object = mCallbackObject;
|
||||
mCallbackObject = nsnull;
|
||||
// because the Notify call will release it.
|
||||
// We will release again it in the destructor if
|
||||
// it is not null when we go away!
|
||||
object->Notify(this); // Fire the timer
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
void TimerImpl::SetDelaySelf( PRUint32 aDelay )
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
|
||||
mDelay = aDelay;
|
||||
mFireTime = TickCount() + (mDelay * 3) / 50; // We need mFireTime in ticks (1/60th)
|
||||
// but aDelay is in 1000th (60/1000 = 3/50)
|
||||
}
|
||||
|
||||
TimerPeriodical * TimerPeriodical::gPeriodical = nsnull;
|
||||
|
||||
TimerPeriodical * TimerPeriodical::GetPeriodical()
|
||||
{
|
||||
if (gPeriodical == NULL)
|
||||
gPeriodical = new TimerPeriodical();
|
||||
return gPeriodical;
|
||||
}
|
||||
|
||||
TimerPeriodical::TimerPeriodical()
|
||||
{
|
||||
mTimers = nsnull;
|
||||
}
|
||||
|
||||
TimerPeriodical::~TimerPeriodical()
|
||||
{
|
||||
PR_ASSERT(mTimers == 0);
|
||||
}
|
||||
|
||||
nsresult TimerPeriodical::AddTimer( TimerImpl * aTimer)
|
||||
{
|
||||
// make sure it's not already there
|
||||
RemoveTimer(aTimer);
|
||||
// keep list sorted by fire time
|
||||
if (mTimers)
|
||||
{
|
||||
if (aTimer->GetFireTime() < mTimers->GetFireTime())
|
||||
{
|
||||
mTimers->mPrev = aTimer;
|
||||
aTimer->mNext = mTimers;
|
||||
mTimers = aTimer;
|
||||
}
|
||||
else
|
||||
{
|
||||
TimerImpl *t = mTimers;
|
||||
TimerImpl *prevt;
|
||||
// we know we will enter the while loop at least the first
|
||||
// time, and thus prevt will be initialized
|
||||
while (t && (t->GetFireTime() <= aTimer->GetFireTime()))
|
||||
{
|
||||
prevt = t;
|
||||
t = t->mNext;
|
||||
}
|
||||
aTimer->mPrev = prevt;
|
||||
aTimer->mNext = prevt->mNext;
|
||||
prevt->mNext = aTimer;
|
||||
if (aTimer->mNext) aTimer->mNext->mPrev = aTimer;
|
||||
}
|
||||
}
|
||||
else mTimers = aTimer;
|
||||
|
||||
StartRepeating();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult TimerPeriodical::RemoveTimer( TimerImpl * aTimer)
|
||||
{
|
||||
TimerImpl* t = mTimers;
|
||||
TimerImpl* next_t = nsnull;
|
||||
if (t) next_t = t->mNext;
|
||||
while (t)
|
||||
{
|
||||
if (t == aTimer)
|
||||
{
|
||||
if (mTimers == t) mTimers = t->mNext;
|
||||
if (t->mPrev) t->mPrev->mNext = t->mNext;
|
||||
if (t->mNext) t->mNext->mPrev = t->mPrev;
|
||||
t->mNext = nsnull;
|
||||
t->mPrev = nsnull;
|
||||
}
|
||||
t = next_t;
|
||||
if (t) next_t = t->mNext;
|
||||
}
|
||||
|
||||
if ( mTimers == nsnull )
|
||||
StopRepeating();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// Called through every event loop
|
||||
// Loops through the list of available timers, and
|
||||
// fires off the appropriate ones
|
||||
void TimerPeriodical::RepeatAction( const EventRecord &inMacEvent)
|
||||
{
|
||||
PRBool done = false;
|
||||
while (!done)
|
||||
{
|
||||
TimerImpl* t = mTimers;
|
||||
while (t)
|
||||
{
|
||||
NS_ASSERTION(t->IsGoodTimer(), "Bad timer!");
|
||||
|
||||
if (t->GetFireTime() <= inMacEvent.when)
|
||||
{
|
||||
RemoveTimer(t);
|
||||
t->Fire();
|
||||
break;
|
||||
}
|
||||
t = t->mNext;
|
||||
}
|
||||
done = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
NS_BASE nsresult NS_NewTimer(nsITimer** aInstancePtrResult)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
TimerImpl *timer = new TimerImpl();
|
||||
if (nsnull == timer) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
return timer->QueryInterface(kITimerIID, (void **) aInstancePtrResult);
|
||||
}
|
||||
112
mozilla/base/src/makefile.win
Normal file
112
mozilla/base/src/makefile.win
Normal file
@@ -0,0 +1,112 @@
|
||||
#!nmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
|
||||
DEPTH=..\..
|
||||
IGNORE_MANIFEST=1
|
||||
|
||||
DIRS = windows
|
||||
|
||||
DEFINES=-D_IMPL_NS_BASE -DWIN32_LEAN_AND_MEAN
|
||||
LIBRARY_NAME=raptorbase
|
||||
|
||||
CPPSRCS = \
|
||||
nsArena.cpp \
|
||||
nsAtomTable.cpp \
|
||||
nsBaseDLL.cpp \
|
||||
nsBTree.cpp \
|
||||
nsByteBuffer.cpp \
|
||||
nsCRT.cpp \
|
||||
nsDeque.cpp \
|
||||
nsProperties.cpp \
|
||||
nsRBTree.cpp \
|
||||
nsSizeOfHandler.cpp \
|
||||
nsString.cpp \
|
||||
nsUnicharBuffer.cpp \
|
||||
nsUnicharInputStream.cpp \
|
||||
nsVoidArray.cpp \
|
||||
nsFileSpec.cpp \
|
||||
nsFileStream.cpp \
|
||||
nsEscape.cpp \
|
||||
nsIFileStream.cpp \
|
||||
$(NULL)
|
||||
|
||||
CPP_OBJS = \
|
||||
.\$(OBJDIR)\nsArena.obj \
|
||||
.\$(OBJDIR)\nsAtomTable.obj \
|
||||
.\$(OBJDIR)\nsBaseDLL.obj \
|
||||
.\$(OBJDIR)\nsBTree.obj \
|
||||
.\$(OBJDIR)\nsByteBuffer.obj \
|
||||
.\$(OBJDIR)\nsCRT.obj \
|
||||
.\$(OBJDIR)\nsDeque.obj \
|
||||
.\$(OBJDIR)\nsProperties.obj \
|
||||
.\$(OBJDIR)\nsRBTree.obj \
|
||||
.\$(OBJDIR)\nsSizeOfHandler.obj \
|
||||
.\$(OBJDIR)\nsString.obj \
|
||||
.\$(OBJDIR)\nsUnicharBuffer.obj \
|
||||
.\$(OBJDIR)\nsUnicharInputStream.obj \
|
||||
.\$(OBJDIR)\nsVoidArray.obj \
|
||||
.\$(OBJDIR)\nsFileSpec.obj \
|
||||
.\$(OBJDIR)\nsFileStream.obj \
|
||||
.\$(OBJDIR)\nsEscape.obj \
|
||||
.\$(OBJDIR)\nsIFileStream.obj \
|
||||
$(NULL)
|
||||
|
||||
EXPORTS=nscore.h nsIArena.h nsIAtom.h nsIByteBuffer.h \
|
||||
nsBTree.h nsCRT.h nsDeque.h nsITimer.h \
|
||||
nsITimerCallback.h nsIUnicharBuffer.h nsRBTree.h \
|
||||
nsIUnicharInputStream.h nsString.h nsVoidArray.h \
|
||||
nsUnitConversion.h \
|
||||
nsIBaseStream.h nsIInputStream.h nsIOutputStream.h \
|
||||
nsInt64.h nsTime.h
|
||||
|
||||
MODULE=raptor
|
||||
|
||||
REQUIRES=xpcom netlib raptor uconv
|
||||
|
||||
LINCS=-I$(PUBLIC)\xpcom -I$(PUBLIC)\netlib \
|
||||
-I$(PUBLIC)\raptor -I$(PUBLIC)\uconv -I$(PUBLIC)\unicharutil
|
||||
|
||||
MAKE_OBJ_TYPE = DLL
|
||||
DLLNAME = raptorbase
|
||||
DLL=.\$(OBJDIR)\$(DLLNAME).dll
|
||||
|
||||
OBJS = $(OBJS) .\$(OBJDIR)\nsTimer.obj .\$(OBJDIR)\nsCaretProperties.obj
|
||||
|
||||
LCFLAGS = \
|
||||
$(LCFLAGS) \
|
||||
$(DEFINES) \
|
||||
$(NULL)
|
||||
|
||||
# These are the libraries we need to link with to create the dll
|
||||
LLIBS= \
|
||||
$(DIST)\lib\xpcom32.lib \
|
||||
$(DIST)\lib\libplc21.lib \
|
||||
$(LIBNSPR)
|
||||
!if "$(MOZ_BITS)"=="32" && defined(MOZ_DEBUG) && defined(GLOWCODE)
|
||||
LLIBS=$(LLIBS) $(GLOWDIR)\glowcode.lib
|
||||
!endif
|
||||
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
|
||||
libs:: $(DLL)
|
||||
$(MAKE_INSTALL) .\$(OBJDIR)\$(DLLNAME).dll $(DIST)\bin
|
||||
$(MAKE_INSTALL) .\$(OBJDIR)\$(DLLNAME).lib $(DIST)\lib
|
||||
|
||||
clobber::
|
||||
rm -f $(DIST)\bin\$(DLLNAME).dll
|
||||
rm -f $(DIST)\lib\$(DLLNAME).lib
|
||||
39
mozilla/base/src/motif/Makefile.in
Normal file
39
mozilla/base/src/motif/Makefile.in
Normal file
@@ -0,0 +1,39 @@
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
#
|
||||
|
||||
DEPTH = ../../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
LIBRARY_NAME = gmbasemotif
|
||||
|
||||
MODULE=base
|
||||
|
||||
REQUIRES = xpcom raptor
|
||||
|
||||
DEFINES += -D_IMPL_NS_WIDGET
|
||||
|
||||
CPPSRCS = \
|
||||
nsTimer.cpp \
|
||||
nsCaretProperties.cpp \
|
||||
$(NULL)
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
39
mozilla/base/src/motif/nsCaretProperties.cpp
Normal file
39
mozilla/base/src/motif/nsCaretProperties.cpp
Normal file
@@ -0,0 +1,39 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
|
||||
#include "nscore.h"
|
||||
|
||||
#include "nsCaretProperties.h"
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
nsCaretProperties::nsCaretProperties()
|
||||
: mCaretWidth(eDefaultCaretWidth)
|
||||
, mBlinkRate(eDefaulBlinkRate)
|
||||
{
|
||||
// in your platform-specific class, get data from the OS in your constructor
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
nsCaretProperties* NewCaretProperties()
|
||||
{
|
||||
return new nsCaretProperties();
|
||||
}
|
||||
173
mozilla/base/src/motif/nsTimer.cpp
Normal file
173
mozilla/base/src/motif/nsTimer.cpp
Normal file
@@ -0,0 +1,173 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
#include "nsITimer.h"
|
||||
#include "nsITimerCallback.h"
|
||||
#include "nsCRT.h"
|
||||
#include "prlog.h"
|
||||
#include <stdio.h>
|
||||
#include <limits.h>
|
||||
#include <X11/Intrinsic.h>
|
||||
|
||||
static NS_DEFINE_IID(kITimerIID, NS_ITIMER_IID);
|
||||
|
||||
// Hack for now. This is Bad because it creates a dependency between the widget
|
||||
// library and this library. This needs to be replaced with having code
|
||||
// to pass an interface which can be queried for the app context.
|
||||
extern XtAppContext gAppContext;
|
||||
|
||||
extern void nsTimerExpired(XtPointer aCallData);
|
||||
|
||||
|
||||
/*
|
||||
* Implementation of timers using Xt timer facility
|
||||
*/
|
||||
class TimerImpl : public nsITimer {
|
||||
public:
|
||||
|
||||
public:
|
||||
TimerImpl();
|
||||
virtual ~TimerImpl();
|
||||
|
||||
virtual nsresult Init(nsTimerCallbackFunc aFunc,
|
||||
void *aClosure,
|
||||
// PRBool aRepeat,
|
||||
PRUint32 aDelay);
|
||||
|
||||
virtual nsresult Init(nsITimerCallback *aCallback,
|
||||
// PRBool aRepeat,
|
||||
PRUint32 aDelay);
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
virtual void Cancel();
|
||||
virtual PRUint32 GetDelay() { return mDelay; }
|
||||
virtual void SetDelay(PRUint32 aDelay) { mDelay=aDelay; };
|
||||
virtual void* GetClosure() { return mClosure; }
|
||||
|
||||
void FireTimeout();
|
||||
|
||||
private:
|
||||
nsresult Init(PRUint32 aDelay);
|
||||
|
||||
PRUint32 mDelay;
|
||||
nsTimerCallbackFunc mFunc;
|
||||
void *mClosure;
|
||||
nsITimerCallback *mCallback;
|
||||
// PRBool mRepeat;
|
||||
TimerImpl *mNext;
|
||||
XtIntervalId mTimerId;
|
||||
};
|
||||
|
||||
void TimerImpl::FireTimeout()
|
||||
{
|
||||
if (mFunc != NULL) {
|
||||
(*mFunc)(this, mClosure);
|
||||
}
|
||||
else if (mCallback != NULL) {
|
||||
mCallback->Notify(this); // Fire the timer
|
||||
}
|
||||
|
||||
// Always repeating here
|
||||
|
||||
// if (mRepeat)
|
||||
// mTimerId = XtAppAddTimeOut(gAppContext, GetDelay(),(XtTimerCallbackProc)nsTimerExpired, this);
|
||||
}
|
||||
|
||||
|
||||
TimerImpl::TimerImpl()
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mFunc = NULL;
|
||||
mCallback = NULL;
|
||||
mNext = NULL;
|
||||
mTimerId = 0;
|
||||
mDelay = 0;
|
||||
mClosure = NULL;
|
||||
}
|
||||
|
||||
TimerImpl::~TimerImpl()
|
||||
{
|
||||
}
|
||||
|
||||
nsresult
|
||||
TimerImpl::Init(nsTimerCallbackFunc aFunc,
|
||||
void *aClosure,
|
||||
// PRBool aRepeat,
|
||||
PRUint32 aDelay)
|
||||
{
|
||||
mFunc = aFunc;
|
||||
mClosure = aClosure;
|
||||
// mRepeat = aRepeat;
|
||||
|
||||
mTimerId = XtAppAddTimeOut(gAppContext, aDelay,(XtTimerCallbackProc)nsTimerExpired, this);
|
||||
|
||||
return Init(aDelay);
|
||||
}
|
||||
|
||||
nsresult
|
||||
TimerImpl::Init(nsITimerCallback *aCallback,
|
||||
// PRBool aRepeat,
|
||||
PRUint32 aDelay)
|
||||
{
|
||||
mCallback = aCallback;
|
||||
// mRepeat = aRepeat;
|
||||
|
||||
mTimerId = XtAppAddTimeOut(gAppContext, aDelay, (XtTimerCallbackProc)nsTimerExpired, this);
|
||||
|
||||
return Init(aDelay);
|
||||
}
|
||||
|
||||
nsresult
|
||||
TimerImpl::Init(PRUint32 aDelay)
|
||||
{
|
||||
mDelay = aDelay;
|
||||
NS_ADDREF(this);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS(TimerImpl, kITimerIID)
|
||||
|
||||
|
||||
void
|
||||
TimerImpl::Cancel()
|
||||
{
|
||||
XtRemoveTimeOut(mTimerId);
|
||||
}
|
||||
|
||||
NS_BASE nsresult NS_NewTimer(nsITimer** aInstancePtrResult)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
TimerImpl *timer = new TimerImpl();
|
||||
if (nsnull == timer) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
return timer->QueryInterface(kITimerIID, (void **) aInstancePtrResult);
|
||||
}
|
||||
|
||||
|
||||
void nsTimerExpired(XtPointer aCallData)
|
||||
{
|
||||
TimerImpl* timer = (TimerImpl *)aCallData;
|
||||
timer->FireTimeout();
|
||||
}
|
||||
80
mozilla/base/src/nsArena.cpp
Normal file
80
mozilla/base/src/nsArena.cpp
Normal file
@@ -0,0 +1,80 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
#include "nsIArena.h"
|
||||
#include "nsCRT.h"
|
||||
|
||||
#define PL_ARENA_CONST_ALIGN_MASK 7
|
||||
#include "plarena.h"
|
||||
|
||||
static NS_DEFINE_IID(kArenaIID, NS_IARENA_IID);
|
||||
|
||||
// Simple arena implementation layered on plarena
|
||||
class ArenaImpl : public nsIArena {
|
||||
public:
|
||||
ArenaImpl(PRInt32 aBlockSize);
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
virtual void* Alloc(PRInt32 aSize);
|
||||
|
||||
protected:
|
||||
~ArenaImpl();
|
||||
|
||||
PLArenaPool mPool;
|
||||
PRInt32 mBlockSize;
|
||||
};
|
||||
|
||||
ArenaImpl::ArenaImpl(PRInt32 aBlockSize)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
if (aBlockSize < NS_MIN_ARENA_BLOCK_SIZE) {
|
||||
aBlockSize = NS_DEFAULT_ARENA_BLOCK_SIZE;
|
||||
}
|
||||
PL_INIT_ARENA_POOL(&mPool, "nsIArena", aBlockSize);
|
||||
mBlockSize = aBlockSize;
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS(ArenaImpl,kArenaIID)
|
||||
|
||||
ArenaImpl::~ArenaImpl()
|
||||
{
|
||||
PL_FinishArenaPool(&mPool);
|
||||
}
|
||||
|
||||
void* ArenaImpl::Alloc(PRInt32 size)
|
||||
{
|
||||
// Adjust size so that it's a multiple of sizeof(double)
|
||||
PRInt32 align = size & (sizeof(double) - 1);
|
||||
if (0 != align) {
|
||||
size += sizeof(double) - align;
|
||||
}
|
||||
|
||||
void* p;
|
||||
PL_ARENA_ALLOCATE(p, &mPool, size);
|
||||
return p;
|
||||
}
|
||||
|
||||
NS_BASE nsresult NS_NewHeapArena(nsIArena** aInstancePtrResult,
|
||||
PRInt32 aArenaBlockSize)
|
||||
{
|
||||
ArenaImpl* it = new ArenaImpl(aArenaBlockSize);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kArenaIID, (void **) aInstancePtrResult);
|
||||
}
|
||||
154
mozilla/base/src/nsAtomTable.cpp
Normal file
154
mozilla/base/src/nsAtomTable.cpp
Normal file
@@ -0,0 +1,154 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
#include "nsIAtom.h"
|
||||
#include "nsString.h"
|
||||
#include "nsCRT.h"
|
||||
#include "plhash.h"
|
||||
#include "nsISizeOfHandler.h"
|
||||
|
||||
/**
|
||||
* The shared hash table for atom lookups.
|
||||
*/
|
||||
static nsrefcnt gAtoms;
|
||||
static struct PLHashTable* gAtomHashTable;
|
||||
|
||||
class AtomImpl : public nsIAtom {
|
||||
public:
|
||||
AtomImpl();
|
||||
~AtomImpl();
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
void* operator new(size_t size, const PRUnichar* us, PRInt32 uslen);
|
||||
|
||||
virtual void ToString(nsString& aBuf) const;
|
||||
|
||||
virtual const PRUnichar* GetUnicode() const;
|
||||
|
||||
NS_IMETHOD SizeOf(nsISizeOfHandler* aHandler) const;
|
||||
|
||||
// Actually more; 0 terminated. This slot is reserved for the
|
||||
// terminating zero.
|
||||
PRUnichar mString[1];
|
||||
};
|
||||
|
||||
AtomImpl::AtomImpl()
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
// Every live atom holds a reference on the atom hashtable
|
||||
gAtoms++;
|
||||
}
|
||||
|
||||
AtomImpl::~AtomImpl()
|
||||
{
|
||||
NS_PRECONDITION(nsnull != gAtomHashTable, "null atom hashtable");
|
||||
if (nsnull != gAtomHashTable) {
|
||||
PL_HashTableRemove(gAtomHashTable, mString);
|
||||
nsrefcnt cnt = --gAtoms;
|
||||
if (0 == cnt) {
|
||||
// When the last atom is destroyed, the atom arena is destroyed
|
||||
NS_ASSERTION(0 == gAtomHashTable->nentries, "bad atom table");
|
||||
PL_HashTableDestroy(gAtomHashTable);
|
||||
gAtomHashTable = nsnull;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static NS_DEFINE_IID(kIAtomIID, NS_IATOM_IID);
|
||||
NS_IMPL_ISUPPORTS(AtomImpl, kIAtomIID);
|
||||
|
||||
void* AtomImpl::operator new(size_t size, const PRUnichar* us, PRInt32 uslen)
|
||||
{
|
||||
size = size + uslen * sizeof(PRUnichar);
|
||||
AtomImpl* ii = (AtomImpl*) new char[size];
|
||||
nsCRT::memcpy(ii->mString, us, uslen * sizeof(PRUnichar));
|
||||
ii->mString[uslen] = 0;
|
||||
return ii;
|
||||
}
|
||||
|
||||
void AtomImpl::ToString(nsString& aBuf) const
|
||||
{
|
||||
aBuf.SetLength(0);
|
||||
aBuf.Append(mString, nsCRT::strlen(mString));
|
||||
}
|
||||
|
||||
const PRUnichar* AtomImpl::GetUnicode() const
|
||||
{
|
||||
return mString;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
AtomImpl::SizeOf(nsISizeOfHandler* aHandler) const
|
||||
{
|
||||
aHandler->Add(sizeof(*this) + nsCRT::strlen(mString) * sizeof(PRUnichar));
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
static PLHashNumber HashKey(const PRUnichar* k)
|
||||
{
|
||||
return (PLHashNumber) nsCRT::HashValue(k);
|
||||
}
|
||||
|
||||
static PRIntn CompareKeys(const PRUnichar* k1, const PRUnichar* k2)
|
||||
{
|
||||
return nsCRT::strcmp(k1, k2) == 0;
|
||||
}
|
||||
|
||||
NS_BASE nsIAtom* NS_NewAtom(const char* isolatin1)
|
||||
{
|
||||
nsAutoString tmp(isolatin1);
|
||||
return NS_NewAtom(tmp.GetUnicode());
|
||||
}
|
||||
|
||||
NS_BASE nsIAtom* NS_NewAtom(const nsString& aString)
|
||||
{
|
||||
return NS_NewAtom(aString.GetUnicode());
|
||||
}
|
||||
|
||||
NS_BASE nsIAtom* NS_NewAtom(const PRUnichar* us)
|
||||
{
|
||||
if (nsnull == gAtomHashTable) {
|
||||
gAtomHashTable = PL_NewHashTable(8, (PLHashFunction) HashKey,
|
||||
(PLHashComparator) CompareKeys,
|
||||
(PLHashComparator) nsnull,
|
||||
nsnull, nsnull);
|
||||
}
|
||||
PRUint32 uslen;
|
||||
PRUint32 hashCode = nsCRT::HashValue(us, &uslen);
|
||||
PLHashEntry** hep = PL_HashTableRawLookup(gAtomHashTable, hashCode, us);
|
||||
PLHashEntry* he = *hep;
|
||||
if (nsnull != he) {
|
||||
nsIAtom* id = (nsIAtom*) he->value;
|
||||
NS_ADDREF(id);
|
||||
return id;
|
||||
}
|
||||
AtomImpl* id = new(us, uslen) AtomImpl();
|
||||
PL_HashTableRawAdd(gAtomHashTable, hep, hashCode, id->mString, id);
|
||||
NS_ADDREF(id);
|
||||
return id;
|
||||
}
|
||||
|
||||
NS_BASE nsrefcnt NS_GetNumberOfAtoms(void)
|
||||
{
|
||||
if (nsnull != gAtomHashTable) {
|
||||
NS_PRECONDITION(nsrefcnt(gAtomHashTable->nentries) == gAtoms, "bad atom table");
|
||||
}
|
||||
return gAtoms;
|
||||
}
|
||||
402
mozilla/base/src/nsBTree.cpp
Normal file
402
mozilla/base/src/nsBTree.cpp
Normal file
@@ -0,0 +1,402 @@
|
||||
|
||||
/**
|
||||
* This file defines the binary tree class and it
|
||||
* nsNode child class.
|
||||
*
|
||||
* This simple version stores nodes, and the
|
||||
* nodes store void* ptrs.
|
||||
*
|
||||
* @update gess 4/11/98
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
|
||||
#include "nsBTree.h"
|
||||
|
||||
/**
|
||||
* default constructor
|
||||
*
|
||||
* @update gess 4/11/98
|
||||
*/
|
||||
nsNode::nsNode(){
|
||||
mLeft=0;
|
||||
mRight=0;
|
||||
mParent=0;
|
||||
mColor=eBlack;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Copy constructor
|
||||
*
|
||||
* @update gess 4/11/98
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
nsNode::nsNode(const nsNode& aNode){
|
||||
mLeft=aNode.mLeft;
|
||||
mRight=aNode.mRight;
|
||||
mParent=aNode.mParent;
|
||||
mColor=aNode.mColor;
|
||||
}
|
||||
|
||||
/**
|
||||
* destructor
|
||||
*
|
||||
* @update gess 4/11/98
|
||||
*/
|
||||
nsNode::~nsNode(){
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrive ptr to parent node
|
||||
*
|
||||
* @update gess 4/11/98
|
||||
* @return ptr to parent node
|
||||
*/
|
||||
nsNode* nsNode::GetParentNode(void) const{
|
||||
return mParent;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve ptr to left (less) node
|
||||
*
|
||||
* @update gess 4/11/98
|
||||
* @return ptr to left (may be NULL)
|
||||
*/
|
||||
nsNode* nsNode::GetLeftNode(void) const{
|
||||
return mLeft;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve ptr to right (more) node
|
||||
*
|
||||
* @update gess 4/11/98
|
||||
* @return ptr to right node (may be NULL)
|
||||
*/
|
||||
nsNode* nsNode::GetRightNode(void) const{
|
||||
return mRight;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @update gess 4/11/98
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
nsNode& nsNode::operator=(const nsNode& aNode){
|
||||
if(this!=&aNode){
|
||||
mLeft=aNode.mLeft;
|
||||
mRight=aNode.mRight;
|
||||
mParent=aNode.mParent;
|
||||
mColor=aNode.mColor;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
/********************************************************
|
||||
* Here comes the BTREE class...
|
||||
********************************************************/
|
||||
|
||||
/**
|
||||
* nsBTree constructor
|
||||
*
|
||||
* @update gess 4/11/98
|
||||
*/
|
||||
nsBTree::nsBTree(){
|
||||
mRoot=0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* destructor
|
||||
*
|
||||
* @update gess 4/11/98
|
||||
*/
|
||||
nsBTree::~nsBTree(){
|
||||
if(mRoot){
|
||||
//walk the tree and destroy the children.
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Given a node, we're supposed to add it into
|
||||
* our tree.
|
||||
*
|
||||
* @update gess 4/11/98
|
||||
* @param aNode to be added to tree
|
||||
* @return ptr to added node or NULL
|
||||
*/
|
||||
nsNode* nsBTree::Add(nsNode& aNode){
|
||||
|
||||
nsNode* node1=mRoot; //x
|
||||
nsNode* node2=0; //y
|
||||
while(node1) {
|
||||
node2=node1;
|
||||
if(aNode<*node1)
|
||||
node1=node1->mLeft;
|
||||
else node1=node1->mRight;
|
||||
}
|
||||
aNode.mParent=node2;
|
||||
if(!node2){
|
||||
mRoot=&aNode;
|
||||
}
|
||||
else{
|
||||
if(aNode<*node2)
|
||||
node2->mLeft=&aNode;
|
||||
else node2->mRight=&aNode;
|
||||
}
|
||||
|
||||
return &aNode;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Removes given node from tree if present.
|
||||
*
|
||||
* @update gess 4/11/98
|
||||
* @param aNode to be found and removed
|
||||
* @return ptr to remove node, or NULL
|
||||
*/
|
||||
nsNode* nsBTree::Remove(nsNode& aNode){
|
||||
nsNode* result=0;
|
||||
nsNode* node3=Find(aNode);
|
||||
|
||||
if(node3) {
|
||||
nsNode* node1;
|
||||
nsNode* node2;
|
||||
|
||||
if((!node3->mLeft) || (!node3->mRight))
|
||||
node2=node3;
|
||||
else node2=After(*node3);
|
||||
|
||||
if(node2->mLeft)
|
||||
node1=node2->mLeft;
|
||||
else node1=node2->mRight;
|
||||
|
||||
if(node1)
|
||||
node1->mParent=node2->mParent;
|
||||
|
||||
if(node2->mParent) {
|
||||
if(node2==node2->mParent->mLeft)
|
||||
node2->mParent->mLeft=node1;
|
||||
else node2->mParent->mRight=node1;
|
||||
}
|
||||
else mRoot=node1;
|
||||
|
||||
if(node2!=node3)
|
||||
(*node3)==(*node2);
|
||||
|
||||
if(node2->mColor == nsNode::eBlack)
|
||||
ReBalance(*node1);
|
||||
|
||||
delete node2;
|
||||
result=&aNode;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears the tree of any data.
|
||||
* Be careful here if your objects are heap based!
|
||||
* This method doesn't free the objects, so if you
|
||||
* don't have your own pointers, they will become
|
||||
* orphaned.
|
||||
*
|
||||
* @update gess 4/11/98
|
||||
* @param
|
||||
* @return this
|
||||
*/
|
||||
nsBTree& nsBTree::Empty(nsNode* aNode) {
|
||||
mRoot=0;
|
||||
return *this;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method destroys all the objects in the tree.
|
||||
* WARNING: Never call this method on stored objects
|
||||
* that are stack-based!
|
||||
*
|
||||
* @update gess 4/11/98
|
||||
* @param
|
||||
* @return this
|
||||
*/
|
||||
nsBTree& nsBTree::Erase(nsNode* aNode){
|
||||
// nsNode* node1 =(aNode) ? aNode : mRoot;
|
||||
|
||||
if(aNode) {
|
||||
Erase(aNode->mLeft); //begin by walking left side
|
||||
Erase(aNode->mRight); //then search right side
|
||||
delete aNode; //until a leaf, then delete
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve ptr to first node in tree
|
||||
*
|
||||
* @update gess 4/11/98
|
||||
* @return
|
||||
*/
|
||||
nsNode* nsBTree::First(void) const{
|
||||
if(mRoot)
|
||||
return First(*mRoot);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrive ptr to first node rel to given node
|
||||
*
|
||||
* @update gess 4/11/98
|
||||
* @param node to begin scan from
|
||||
* @return ptr to first node from given node or NULL
|
||||
*/
|
||||
nsNode* nsBTree::First(const nsNode& aNode) const{
|
||||
nsNode* result=0;
|
||||
|
||||
if(mRoot) {
|
||||
result=mRoot;
|
||||
while(result->GetLeftNode()) {
|
||||
result=result->GetLeftNode();
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrive ptr to last node
|
||||
*
|
||||
* @update gess 4/11/98
|
||||
* @return ptr to last node rel to root or NULL
|
||||
*/
|
||||
nsNode* nsBTree::Last(void) const{
|
||||
if(mRoot)
|
||||
return Last(*mRoot);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrive ptr to last node rel to given node
|
||||
*
|
||||
* @update gess 4/11/98
|
||||
* @param node to begin scan from
|
||||
* @return ptr to first node from given node or NULL
|
||||
*/
|
||||
nsNode* nsBTree::Last(const nsNode& aNode) const{
|
||||
nsNode* result=0;
|
||||
|
||||
if(mRoot) {
|
||||
result=mRoot;
|
||||
while(result->GetRightNode()) {
|
||||
result=result->GetRightNode();
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Retrive ptr to prior node rel to given node
|
||||
*
|
||||
* @update gess 4/11/98
|
||||
* @param node to begin scan from
|
||||
* @return ptr to prior node from given node or NULL
|
||||
*/
|
||||
nsNode* nsBTree::Before(const nsNode& aNode) const{
|
||||
|
||||
if(aNode.GetLeftNode())
|
||||
return Last(*aNode.GetLeftNode());
|
||||
|
||||
//otherwise...
|
||||
|
||||
nsNode* node1=(nsNode*)&aNode;
|
||||
nsNode* node2=aNode.GetParentNode();
|
||||
|
||||
while((node2) && (node1==node2->GetLeftNode())) {
|
||||
node1=node2;
|
||||
node2=node2->GetParentNode();
|
||||
}
|
||||
return node2;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Retrive ptr to next node rel to given node
|
||||
*
|
||||
* @update gess 4/11/98
|
||||
* @param node to begin scan from
|
||||
* @return ptr to next node from given node or NULL
|
||||
*/
|
||||
nsNode* nsBTree::After(const nsNode& aNode) const{
|
||||
|
||||
if(aNode.GetRightNode())
|
||||
return First(*aNode.GetRightNode());
|
||||
|
||||
//otherwise...
|
||||
|
||||
nsNode* node1=(nsNode*)&aNode;
|
||||
nsNode* node2=aNode.GetParentNode();
|
||||
|
||||
while((node2) && (node1==node2->GetRightNode())) {
|
||||
node1=node2;
|
||||
node2=node2->GetParentNode();
|
||||
}
|
||||
|
||||
return node2;
|
||||
}
|
||||
|
||||
/**
|
||||
* Scan for given node
|
||||
*
|
||||
* @update gess 4/11/98
|
||||
* @param node to find
|
||||
* @return ptr to given node, or NULL
|
||||
*/
|
||||
nsNode* nsBTree::Find(const nsNode& aNode) const{
|
||||
nsNode* result=mRoot;
|
||||
|
||||
while((result) && (!(aNode==(*result)))) {
|
||||
if(aNode<*result)
|
||||
result=result->mLeft;
|
||||
else result=result->mRight;
|
||||
}
|
||||
return (nsNode*)result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Rebalances tree around the given node. This only
|
||||
* needs to be called after a node is deleted.
|
||||
* This method does nothing for btrees, but is
|
||||
* needed for RBTrees.
|
||||
*
|
||||
* @update gess 4/11/98
|
||||
* @param aNode -- node to balance around
|
||||
* @return this
|
||||
*/
|
||||
nsBTree& nsBTree::ReBalance(nsNode& aNode){
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @update gess 4/11/98
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
const nsBTree& nsBTree::ForEach(nsNodeFunctor& aFunctor,nsNode* aNode) const{
|
||||
nsNode* node1 =(aNode) ? aNode : mRoot;
|
||||
|
||||
if(node1) {
|
||||
if(node1->mLeft)
|
||||
ForEach(aFunctor,node1->mLeft); //begin by walking left side
|
||||
aFunctor(*node1);
|
||||
if(node1->mRight)
|
||||
ForEach(aFunctor,node1->mRight); //then search right side
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
283
mozilla/base/src/nsBTree.h
Normal file
283
mozilla/base/src/nsBTree.h
Normal file
@@ -0,0 +1,283 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
/**
|
||||
* This file defines the binary tree class and it
|
||||
* nsNode child class. Note that like all nsBTree
|
||||
* containers, this one does not automatically balance.
|
||||
* (Find for random data, bad for pre-ordered data).
|
||||
*
|
||||
* This simple version stores nodes, and the
|
||||
* nodes store void* ptrs.
|
||||
*
|
||||
* @update gess 4/11/98
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* nsNode
|
||||
*
|
||||
* @update gess 4/11/98
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
|
||||
#ifndef _BTREE_H
|
||||
#define _BTREE_H
|
||||
|
||||
#include "nscore.h"
|
||||
|
||||
struct NS_BASE nsNode {
|
||||
|
||||
/**
|
||||
*
|
||||
* @update gess4/20/98
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
nsNode();
|
||||
|
||||
/**
|
||||
* Copy constructor
|
||||
* @update gess 4/11/98
|
||||
*/
|
||||
nsNode(const nsNode& aNode);
|
||||
|
||||
/**
|
||||
* destructor
|
||||
* @update gess 4/11/98
|
||||
*/
|
||||
virtual ~nsNode();
|
||||
|
||||
/**
|
||||
* Retrieve parent node
|
||||
*
|
||||
* @update gess 4/11/98
|
||||
* @return
|
||||
*/
|
||||
nsNode* GetParentNode(void) const;
|
||||
|
||||
/**
|
||||
*
|
||||
* @update gess 4/11/98
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
nsNode* GetLeftNode() const;
|
||||
|
||||
/**
|
||||
*
|
||||
* @update gess 4/11/98
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
nsNode* GetRightNode() const;
|
||||
|
||||
/**
|
||||
*
|
||||
* @update gess 4/11/98
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
virtual nsNode& operator=(const nsNode& aNode);
|
||||
|
||||
|
||||
/**
|
||||
* This method gets called to determine which of
|
||||
* two nodes is less. When you create your own
|
||||
* subclass of nsNode, this is the most important
|
||||
* method for you to overload.
|
||||
*
|
||||
* @update gess 4/11/98
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
virtual PRBool operator<(const nsNode& aNode) const=0;
|
||||
|
||||
/**
|
||||
* This method gets called to determine which of
|
||||
* two nodes is less. When you create your own
|
||||
* subclass of nsNode, this is the most important
|
||||
* method for you to overload.
|
||||
*
|
||||
* @update gess 4/11/98
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
virtual PRBool operator==(const nsNode& aNode) const=0;
|
||||
|
||||
enum eRBColor {eRed,eBlack};
|
||||
|
||||
nsNode* mParent;
|
||||
nsNode* mLeft;
|
||||
nsNode* mRight;
|
||||
eRBColor mColor;
|
||||
};
|
||||
|
||||
/**
|
||||
* The Nodefunctor class is used when you want to create
|
||||
* callbacks between the nsRBTree and your generic code.
|
||||
*
|
||||
* @update gess4/20/98
|
||||
*/
|
||||
class NS_BASE nsNodeFunctor {
|
||||
public:
|
||||
virtual nsNodeFunctor& operator()(nsNode& aNode)=0;
|
||||
};
|
||||
|
||||
|
||||
/****************************************************
|
||||
* Here comes the nsBTree class...
|
||||
****************************************************/
|
||||
|
||||
class NS_BASE nsBTree {
|
||||
public:
|
||||
friend class nsBTreeIterator;
|
||||
|
||||
nsBTree();
|
||||
virtual ~nsBTree();
|
||||
|
||||
/**
|
||||
* Add given node reference into our tree.
|
||||
*
|
||||
* @update gess 4/11/98
|
||||
* @param aNode is a ref to a node to be added
|
||||
* @return newly added node
|
||||
*/
|
||||
nsNode* Add(nsNode& aNode);
|
||||
|
||||
/**
|
||||
* Remove given node reference into our tree.
|
||||
*
|
||||
* @update gess 4/11/98
|
||||
* @param aNode is a ref to a node to be removed
|
||||
* @return Ptr to node if found (and removed) or NULL
|
||||
*/
|
||||
nsNode* Remove(nsNode& aNode);
|
||||
|
||||
/**
|
||||
* Clears the tree of any data.
|
||||
* Be careful here if your objects are heap based!
|
||||
* This method doesn't free the objects, so if you
|
||||
* don't have your own pointers, they will become
|
||||
* orphaned.
|
||||
*
|
||||
* @update gess 4/11/98
|
||||
* @param
|
||||
* @return this
|
||||
*/
|
||||
nsBTree& Empty(nsNode* aNode=0);
|
||||
|
||||
/**
|
||||
* This method destroys all the objects in the tree.
|
||||
* WARNING: Never call this method on stored objects
|
||||
* that are stack-based!
|
||||
*
|
||||
* @update gess 4/11/98
|
||||
* @param
|
||||
* @return this
|
||||
*/
|
||||
nsBTree& Erase(nsNode* aNode=0);
|
||||
|
||||
/**
|
||||
* Retrieve ptr to 1st node in tree (starting at root)
|
||||
*
|
||||
* @update gess 4/11/98
|
||||
* @return ptr to 1st node, possible to be NULL
|
||||
*/
|
||||
nsNode* First(void) const;
|
||||
|
||||
/**
|
||||
* Find first node in tree starting at given node
|
||||
*
|
||||
* @update gess 4/11/98
|
||||
* @param aNode node to begin 1st search from
|
||||
* @return ptr to 1st node below given node
|
||||
*/
|
||||
nsNode* First(const nsNode& aNode) const;
|
||||
|
||||
/**
|
||||
* Retrieve ptr to last node in tree relative to root.
|
||||
*
|
||||
* @update gess 4/11/98
|
||||
* @return ptr to last node or NULL
|
||||
*/
|
||||
nsNode* Last(void) const;
|
||||
|
||||
/**
|
||||
* Retrieve ptr to last node in tree relative to given node.
|
||||
*
|
||||
* @update gess 4/11/98
|
||||
* @param node to find last node from
|
||||
* @return ptr to last node or NULL
|
||||
*/
|
||||
nsNode* Last(const nsNode& aNode) const;
|
||||
|
||||
/**
|
||||
* Retrieve a ptr to the node that preceeds given node
|
||||
*
|
||||
* @update gess 4/11/98
|
||||
* @param aNode used as reference to find prev.
|
||||
* @return ptr to prev node or NULL
|
||||
*/
|
||||
nsNode* Before(const nsNode& aNode) const;
|
||||
|
||||
/**
|
||||
* Retrieve a ptr to the node after given node
|
||||
*
|
||||
* @update gess 4/11/98
|
||||
* @param aNode used as reference to find next.
|
||||
* @return ptr to next node or NULL
|
||||
*/
|
||||
nsNode* After(const nsNode& aNode) const;
|
||||
|
||||
/**
|
||||
* Find given node in tree.
|
||||
* (Why would you want to find a node you already have?)
|
||||
*
|
||||
* @update gess 4/11/98
|
||||
* @param aNode is the node you're searching for
|
||||
* @return ptr to node if found, or NULL
|
||||
*/
|
||||
nsNode* Find(const nsNode& aNode) const;
|
||||
|
||||
/**
|
||||
* Walks the tree, starting with root.
|
||||
*
|
||||
* @update gess 4/11/98
|
||||
*/
|
||||
virtual const nsBTree& ForEach(nsNodeFunctor& aFunctor,nsNode* aNode=0) const;
|
||||
|
||||
protected:
|
||||
|
||||
/**
|
||||
* Rebalances tree around the given node. This only
|
||||
* needs to be called after a node is deleted.
|
||||
*
|
||||
* @update gess 4/11/98
|
||||
* @param aNode -- node to balance around
|
||||
* @return this
|
||||
*/
|
||||
virtual nsBTree& ReBalance(nsNode& aNode);
|
||||
|
||||
|
||||
nsNode* mRoot;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
90
mozilla/base/src/nsBaseDLL.cpp
Normal file
90
mozilla/base/src/nsBaseDLL.cpp
Normal file
@@ -0,0 +1,90 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
#include "nsBaseDLL.h"
|
||||
#include "nscore.h"
|
||||
#include "nsIProperties.h"
|
||||
#include "nsProperties.h"
|
||||
#include "nsRepository.h"
|
||||
|
||||
PRInt32 gLockCount = 0;
|
||||
|
||||
NS_DEFINE_IID(kIFactoryIID, NS_IFACTORY_IID);
|
||||
|
||||
extern "C" NS_EXPORT nsresult
|
||||
NSRegisterSelf(nsISupports* aServMgr, const char* path)
|
||||
{
|
||||
nsresult ret;
|
||||
|
||||
ret = nsRepository::RegisterComponent(kPropertiesCID, NULL, NULL,
|
||||
path, PR_TRUE, PR_TRUE);
|
||||
if (NS_FAILED(ret)) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
extern "C" NS_EXPORT nsresult
|
||||
NSUnregisterSelf(nsISupports* aServMgr, const char* path)
|
||||
{
|
||||
nsresult ret;
|
||||
|
||||
ret = nsRepository::UnregisterFactory(kPropertiesCID, path);
|
||||
if (NS_FAILED(ret)) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
extern "C" NS_EXPORT nsresult
|
||||
NSGetFactory(nsISupports* aServMgr,
|
||||
const nsCID& aClass,
|
||||
const char *aClassName,
|
||||
const char *aProgID,
|
||||
nsIFactory** aFactory)
|
||||
{
|
||||
nsresult res;
|
||||
|
||||
if (!aFactory) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
if (aClass.Equals(kPropertiesCID)) {
|
||||
nsPropertiesFactory *propsFactory = new nsPropertiesFactory();
|
||||
if (!propsFactory) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
res = propsFactory->QueryInterface(kIFactoryIID, (void**) aFactory);
|
||||
if (NS_FAILED(res)) {
|
||||
*aFactory = nsnull;
|
||||
delete propsFactory;
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
return NS_NOINTERFACE;
|
||||
}
|
||||
|
||||
extern "C" NS_EXPORT PRBool
|
||||
NSCanUnload(nsISupports* serviceMgr)
|
||||
{
|
||||
return PR_FALSE; // XXX can we unload this?
|
||||
}
|
||||
26
mozilla/base/src/nsBaseDLL.h
Normal file
26
mozilla/base/src/nsBaseDLL.h
Normal file
@@ -0,0 +1,26 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
#ifndef nsBaseDLL_h___
|
||||
#define nsBaseDLL_h___
|
||||
|
||||
#include "prtypes.h"
|
||||
|
||||
extern PRInt32 gLockCount;
|
||||
|
||||
#endif /* nsBaseDLL_h___ */
|
||||
138
mozilla/base/src/nsByteBuffer.cpp
Normal file
138
mozilla/base/src/nsByteBuffer.cpp
Normal file
@@ -0,0 +1,138 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
#include "nsIByteBuffer.h"
|
||||
#include "nsIInputStream.h"
|
||||
#include "nsCRT.h"
|
||||
|
||||
#define MIN_BUFFER_SIZE 32
|
||||
|
||||
class ByteBufferImpl : public nsIByteBuffer {
|
||||
public:
|
||||
ByteBufferImpl(PRUint32 aBufferSize);
|
||||
~ByteBufferImpl();
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
virtual PRUint32 GetLength(void) const;
|
||||
virtual PRUint32 GetBufferSize(void) const;
|
||||
virtual char* GetBuffer() const;
|
||||
virtual PRBool Grow(PRUint32 aNewSize);
|
||||
virtual PRInt32 Fill(nsresult* aErrorCode, nsIInputStream* aStream,
|
||||
PRUint32 aKeep);
|
||||
|
||||
char* mBuffer;
|
||||
PRUint32 mSpace;
|
||||
PRUint32 mLength;
|
||||
};
|
||||
|
||||
ByteBufferImpl::ByteBufferImpl(PRUint32 aBufferSize)
|
||||
{
|
||||
if (aBufferSize < MIN_BUFFER_SIZE) {
|
||||
aBufferSize = MIN_BUFFER_SIZE;
|
||||
}
|
||||
mSpace = aBufferSize;
|
||||
mBuffer = new char[aBufferSize];
|
||||
mLength = 0;
|
||||
NS_INIT_REFCNT();
|
||||
}
|
||||
|
||||
NS_DEFINE_IID(kByteBufferIID,NS_IBYTE_BUFFER_IID);
|
||||
NS_IMPL_ISUPPORTS(ByteBufferImpl,kByteBufferIID)
|
||||
|
||||
ByteBufferImpl::~ByteBufferImpl()
|
||||
{
|
||||
if (nsnull != mBuffer) {
|
||||
delete mBuffer;
|
||||
mBuffer = nsnull;
|
||||
}
|
||||
mLength = 0;
|
||||
}
|
||||
|
||||
PRUint32 ByteBufferImpl::GetLength(void) const
|
||||
{
|
||||
return mLength;
|
||||
}
|
||||
|
||||
PRUint32 ByteBufferImpl::GetBufferSize(void) const
|
||||
{
|
||||
return mSpace;
|
||||
}
|
||||
|
||||
char* ByteBufferImpl::GetBuffer(void) const
|
||||
{
|
||||
return mBuffer;
|
||||
}
|
||||
|
||||
PRBool ByteBufferImpl::Grow(PRUint32 aNewSize)
|
||||
{
|
||||
if (aNewSize < MIN_BUFFER_SIZE) {
|
||||
aNewSize = MIN_BUFFER_SIZE;
|
||||
}
|
||||
char* newbuf = new char[aNewSize];
|
||||
if (nsnull != newbuf) {
|
||||
if (0 != mLength) {
|
||||
nsCRT::memcpy(newbuf, mBuffer, mLength);
|
||||
}
|
||||
delete mBuffer;
|
||||
mBuffer = newbuf;
|
||||
return PR_TRUE;
|
||||
}
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
PRInt32 ByteBufferImpl::Fill(nsresult* aErrorCode, nsIInputStream* aStream,
|
||||
PRUint32 aKeep)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aStream, "null stream");
|
||||
NS_PRECONDITION(aKeep <= mLength, "illegal keep count");
|
||||
if ((nsnull == aStream) || (PRUint32(aKeep) > PRUint32(mLength))) {
|
||||
// whoops
|
||||
*aErrorCode = NS_BASE_STREAM_ILLEGAL_ARGS;
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (0 != aKeep) {
|
||||
// Slide over kept data
|
||||
nsCRT::memmove(mBuffer, mBuffer + (mLength - aKeep), aKeep);
|
||||
}
|
||||
|
||||
// Read in some new data
|
||||
mLength = aKeep;
|
||||
PRUint32 amount = mSpace - aKeep;
|
||||
PRUint32 nb;
|
||||
*aErrorCode = aStream->Read(mBuffer, aKeep, amount, &nb);
|
||||
if (NS_SUCCEEDED(*aErrorCode)) {
|
||||
mLength += nb;
|
||||
}
|
||||
else
|
||||
nb = 0;
|
||||
return nb;
|
||||
}
|
||||
|
||||
NS_BASE nsresult NS_NewByteBuffer(nsIByteBuffer** aInstancePtrResult,
|
||||
nsISupports* aOuter,
|
||||
PRUint32 aBufferSize)
|
||||
{
|
||||
if (nsnull != aOuter) {
|
||||
return NS_ERROR_NO_AGGREGATION;
|
||||
}
|
||||
ByteBufferImpl* it = new ByteBufferImpl(aBufferSize);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kByteBufferIID, (void **) aInstancePtrResult);
|
||||
}
|
||||
513
mozilla/base/src/nsCRT.cpp
Normal file
513
mozilla/base/src/nsCRT.cpp
Normal file
@@ -0,0 +1,513 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* MODULE NOTES:
|
||||
* @update gess7/30/98
|
||||
*
|
||||
* Much as I hate to do it, we were using string compares wrong.
|
||||
* Often, programmers call functions like strcmp(s1,s2), and pass
|
||||
* one or more null strings. Rather than blow up on these, I've
|
||||
* added quick checks to ensure that cases like this don't cause
|
||||
* us to fail.
|
||||
*
|
||||
* In general, if you pass a null into any of these string compare
|
||||
* routines, we simply return 0.
|
||||
*/
|
||||
|
||||
|
||||
#include "nsCRT.h"
|
||||
#include "nsUnicharUtilCIID.h"
|
||||
#include "nsIServiceManager.h"
|
||||
#include "nsICaseConversion.h"
|
||||
|
||||
|
||||
// XXX Bug: These tables don't lowercase the upper 128 characters properly
|
||||
|
||||
// This table maps uppercase characters to lower case characters;
|
||||
// characters that are neither upper nor lower case are unaffected.
|
||||
static const unsigned char kUpper2Lower[256] = {
|
||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
|
||||
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
|
||||
32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
|
||||
48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
|
||||
64,
|
||||
|
||||
// upper band mapped to lower [A-Z] => [a-z]
|
||||
97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111,
|
||||
112,113,114,115,116,117,118,119,120,121,122,
|
||||
|
||||
91, 92, 93, 94, 95,
|
||||
96, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111,
|
||||
112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,
|
||||
128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,
|
||||
144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,
|
||||
160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,
|
||||
176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,
|
||||
192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,
|
||||
208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,
|
||||
224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,
|
||||
240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255
|
||||
};
|
||||
|
||||
static const unsigned char kLower2Upper[256] = {
|
||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
|
||||
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
|
||||
32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
|
||||
48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
|
||||
64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
|
||||
80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
|
||||
96,
|
||||
|
||||
// lower band mapped to upper [a-z] => [A-Z]
|
||||
65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
|
||||
80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,
|
||||
|
||||
123,124,125,126,127,
|
||||
128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,
|
||||
144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,
|
||||
160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,
|
||||
176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,
|
||||
192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,
|
||||
208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,
|
||||
224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,
|
||||
240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255
|
||||
};
|
||||
|
||||
// XXX bug: this doesn't map 0x80 to 0x9f properly
|
||||
static const PRUnichar kIsoLatin1ToUCS2[256] = {
|
||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
|
||||
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
|
||||
32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
|
||||
48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
|
||||
64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
|
||||
80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
|
||||
96, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111,
|
||||
112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,
|
||||
128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,
|
||||
144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,
|
||||
160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,
|
||||
176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,
|
||||
192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,
|
||||
208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,
|
||||
224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,
|
||||
240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
#define TOLOWER(_ucs2) \
|
||||
(((_ucs2) < 128) ? PRUnichar(kUpper2Lower[_ucs2]) : _ToLower(_ucs2))
|
||||
|
||||
#define TOUPPER(_ucs2) \
|
||||
(((_ucs2) < 128) ? PRUnichar(kLower2Upper[_ucs2]) : _ToUpper(_ucs2))
|
||||
|
||||
class HandleCaseConversionShutdown : public nsIShutdownListener {
|
||||
public :
|
||||
NS_IMETHOD OnShutdown(const nsCID& cid, nsISupports* service);
|
||||
HandleCaseConversionShutdown(void) { NS_INIT_REFCNT(); }
|
||||
virtual ~HandleCaseConversionShutdown(void) {}
|
||||
NS_DECL_ISUPPORTS
|
||||
};
|
||||
static NS_DEFINE_CID(kUnicharUtilCID, NS_UNICHARUTIL_CID);
|
||||
static NS_DEFINE_IID(kICaseConversionIID, NS_ICASECONVERSION_IID);
|
||||
|
||||
static nsICaseConversion * gCaseConv = NULL;
|
||||
|
||||
static NS_DEFINE_IID(kIShutdownListenerIID, NS_ISHUTDOWNLISTENER_IID);
|
||||
NS_IMPL_ISUPPORTS(HandleCaseConversionShutdown, kIShutdownListenerIID);
|
||||
|
||||
nsresult
|
||||
HandleCaseConversionShutdown::OnShutdown(const nsCID& cid, nsISupports* service)
|
||||
{
|
||||
if (cid.Equals(kUnicharUtilCID)) {
|
||||
NS_ASSERTION(service == gCaseConv, "wrong service!");
|
||||
nsrefcnt cnt = gCaseConv->Release();
|
||||
gCaseConv = NULL;
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
static HandleCaseConversionShutdown* gListener = NULL;
|
||||
|
||||
static void StartUpCaseConversion()
|
||||
{
|
||||
nsresult err;
|
||||
|
||||
if ( NULL == gListener )
|
||||
{
|
||||
gListener = new HandleCaseConversionShutdown();
|
||||
gListener->AddRef();
|
||||
}
|
||||
err = nsServiceManager::GetService(kUnicharUtilCID, kICaseConversionIID,
|
||||
(nsISupports**) &gCaseConv, gListener);
|
||||
}
|
||||
static void CheckCaseConversion()
|
||||
{
|
||||
if(NULL == gCaseConv )
|
||||
StartUpCaseConversion();
|
||||
|
||||
NS_ASSERTION( gCaseConv != NULL , "cannot obtain UnicharUtil");
|
||||
|
||||
}
|
||||
|
||||
static PRUnichar _ToLower(PRUnichar aChar)
|
||||
{
|
||||
PRUnichar oLower;
|
||||
CheckCaseConversion();
|
||||
nsresult err = gCaseConv->ToLower(aChar, &oLower);
|
||||
NS_ASSERTION( NS_SUCCEEDED(err), "failed to communicate to UnicharUtil");
|
||||
return ( NS_SUCCEEDED(err) ) ? oLower : aChar ;
|
||||
}
|
||||
|
||||
static PRUnichar _ToUpper(PRUnichar aChar)
|
||||
{
|
||||
nsresult err;
|
||||
PRUnichar oUpper;
|
||||
CheckCaseConversion();
|
||||
err = gCaseConv->ToUpper(aChar, &oUpper);
|
||||
NS_ASSERTION( NS_SUCCEEDED(err), "failed to communicate to UnicharUtil");
|
||||
return ( NS_SUCCEEDED(err) ) ? oUpper : aChar ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
PRUnichar nsCRT::ToUpper(PRUnichar aChar)
|
||||
{
|
||||
return TOUPPER(aChar);
|
||||
}
|
||||
|
||||
PRUnichar nsCRT::ToLower(PRUnichar aChar)
|
||||
{
|
||||
return TOLOWER(aChar);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// My lovely strtok routine
|
||||
|
||||
#define IS_DELIM(m, c) ((m)[(c) >> 3] & (1 << ((c) & 7)))
|
||||
#define SET_DELIM(m, c) ((m)[(c) >> 3] |= (1 << ((c) & 7)))
|
||||
#define DELIM_TABLE_SIZE 32
|
||||
|
||||
char* nsCRT::strtok(char* str, const char* delims, char* *newStr)
|
||||
{
|
||||
NS_ASSERTION(str, "Unlike regular strtok, the first argument cannot be null.");
|
||||
|
||||
char delimTable[DELIM_TABLE_SIZE];
|
||||
PRUint32 i;
|
||||
char* result;
|
||||
|
||||
for (i = 0; i < DELIM_TABLE_SIZE; i++)
|
||||
delimTable[i] = '\0';
|
||||
|
||||
for (i = 0; i < DELIM_TABLE_SIZE && delims[i]; i++) {
|
||||
SET_DELIM(delimTable, delims[i]);
|
||||
}
|
||||
NS_ASSERTION(delims[i] == '\0', "too many delimiters");
|
||||
|
||||
// skip to beginning
|
||||
while (*str && IS_DELIM(delimTable, *str)) {
|
||||
str++;
|
||||
}
|
||||
result = str;
|
||||
|
||||
// fix up the end of the token
|
||||
while (*str) {
|
||||
if (IS_DELIM(delimTable, *str)) {
|
||||
*str++ = '\0';
|
||||
break;
|
||||
}
|
||||
str++;
|
||||
}
|
||||
*newStr = str;
|
||||
|
||||
return str == result ? NULL : result;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
PRUint32 nsCRT::strlen(const PRUnichar* s)
|
||||
{
|
||||
PRUint32 len = 0;
|
||||
if(s) {
|
||||
while (*s++ != 0) {
|
||||
len++;
|
||||
}
|
||||
}
|
||||
return len;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Compare unichar string ptrs, stopping at the 1st null
|
||||
* NOTE: If both are null, we return 0.
|
||||
* @update gess7/30/98
|
||||
* @param s1 and s2 both point to unichar strings
|
||||
* @return 0 if they match, -1 if s1<s2; 1 if s1>s2
|
||||
*/
|
||||
PRInt32 nsCRT::strcmp(const PRUnichar* s1, const PRUnichar* s2)
|
||||
{
|
||||
if(s1 && s2) {
|
||||
for (;;) {
|
||||
PRUnichar c1 = *s1++;
|
||||
PRUnichar c2 = *s2++;
|
||||
if (c1 != c2) {
|
||||
if (c1 < c2) return -1;
|
||||
return 1;
|
||||
}
|
||||
if ((0==c1) || (0==c2)) break;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Compare unichar string ptrs, stopping at the 1st null or nth char.
|
||||
* NOTE: If either is null, we return 0.
|
||||
* @update gess7/30/98
|
||||
* @param s1 and s2 both point to unichar strings
|
||||
* @return 0 if they match, -1 if s1<s2; 1 if s1>s2
|
||||
*/
|
||||
PRInt32 nsCRT::strncmp(const PRUnichar* s1, const PRUnichar* s2, PRUint32 n)
|
||||
{
|
||||
if(s1 && s2) {
|
||||
if(n != 0) {
|
||||
do {
|
||||
PRUnichar c1 = *s1++;
|
||||
PRUnichar c2 = *s2++;
|
||||
if (c1 != c2) {
|
||||
if (c1 < c2) return -1;
|
||||
return 1;
|
||||
}
|
||||
if ((0==c1) || (0==c2)) break;
|
||||
} while (--n != 0);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Compare unichar string ptrs without regard to case
|
||||
* NOTE: If both are null, we return 0.
|
||||
* @update gess7/30/98
|
||||
* @param s1 and s2 both point to unichar strings
|
||||
* @return 0 if they match, -1 if s1<s2; 1 if s1>s2
|
||||
*/
|
||||
PRInt32 nsCRT::strcasecmp(const PRUnichar* s1, const PRUnichar* s2)
|
||||
{
|
||||
if(s1 && s2) {
|
||||
for (;;) {
|
||||
PRUnichar c1 = *s1++;
|
||||
PRUnichar c2 = *s2++;
|
||||
if (c1 != c2) {
|
||||
c1 = TOLOWER(c1);
|
||||
c2 = TOLOWER(c2);
|
||||
if (c1 != c2) {
|
||||
if (c1 < c2) return -1;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
if ((0==c1) || (0==c2)) break;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Compare unichar string ptrs, stopping at the 1st null or nth char;
|
||||
* also ignoring the case of characters.
|
||||
* NOTE: If both are null, we return 0.
|
||||
* @update gess7/30/98
|
||||
* @param s1 and s2 both point to unichar strings
|
||||
* @return 0 if they match, -1 if s1<s2; 1 if s1>s2
|
||||
*/
|
||||
PRInt32 nsCRT::strncasecmp(const PRUnichar* s1, const PRUnichar* s2, PRUint32 n)
|
||||
{
|
||||
if(s1 && s2) {
|
||||
if(0<n){
|
||||
while (--n >= 0) {
|
||||
PRUnichar c1 = *s1++;
|
||||
PRUnichar c2 = *s2++;
|
||||
if (c1 != c2) {
|
||||
c1 = TOLOWER(c1);
|
||||
c2 = TOLOWER(c2);
|
||||
if (c1 != c2) {
|
||||
if (c1 < c2) return -1;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
if ((0==c1) || (0==c2)) break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Compare a unichar string ptr to cstring.
|
||||
* NOTE: If both are null, we return 0.
|
||||
* @update gess7/30/98
|
||||
* @param s1 points to unichar string
|
||||
* @param s2 points to cstring
|
||||
* @return 0 if they match, -1 if s1<s2; 1 if s1>s2
|
||||
*/
|
||||
PRInt32 nsCRT::strcmp(const PRUnichar* s1, const char* s2)
|
||||
{
|
||||
if(s1 && s2) {
|
||||
for (;;) {
|
||||
PRUnichar c1 = *s1++;
|
||||
PRUnichar c2 = kIsoLatin1ToUCS2[*(const unsigned char*)s2++];
|
||||
if (c1 != c2) {
|
||||
if (c1 < c2) return -1;
|
||||
return 1;
|
||||
}
|
||||
if ((0==c1) || (0==c2)) break;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Compare a unichar string ptr to cstring, up to N chars.
|
||||
* NOTE: If both are null, we return 0.
|
||||
* @update gess7/30/98
|
||||
* @param s1 points to unichar string
|
||||
* @param s2 points to cstring
|
||||
* @return 0 if they match, -1 if s1<s2; 1 if s1>s2
|
||||
*/
|
||||
PRInt32 nsCRT::strncmp(const PRUnichar* s1, const char* s2, PRUint32 n)
|
||||
{
|
||||
if(s1 && s2) {
|
||||
if(n != 0){
|
||||
do {
|
||||
PRUnichar c1 = *s1++;
|
||||
PRUnichar c2 = kIsoLatin1ToUCS2[*(const unsigned char*)s2++];
|
||||
if (c1 != c2) {
|
||||
if (c1 < c2) return -1;
|
||||
return 1;
|
||||
}
|
||||
if ((0==c1) || (0==c2)) break;
|
||||
} while (--n != 0);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Compare a unichar string ptr to cstring without regard to case
|
||||
* NOTE: If both are null, we return 0.
|
||||
* @update gess7/30/98
|
||||
* @param s1 points to unichar string
|
||||
* @param s2 points to cstring
|
||||
* @return 0 if they match, -1 if s1<s2; 1 if s1>s2
|
||||
*/
|
||||
PRInt32 nsCRT::strcasecmp(const PRUnichar* s1, const char* s2)
|
||||
{
|
||||
if(s1 && s2) {
|
||||
for (;;) {
|
||||
PRUnichar c1 = *s1++;
|
||||
PRUnichar c2 = kIsoLatin1ToUCS2[*(const unsigned char*)s2++];
|
||||
if (c1 != c2) {
|
||||
c1 = TOLOWER(c1);
|
||||
c2 = TOLOWER(c2);
|
||||
if (c1 != c2) {
|
||||
if (c1 < c2) return -1;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
if ((0==c1) || (0==c2)) break;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Caseless compare up to N chars between unichar string ptr to cstring.
|
||||
* NOTE: If both are null, we return 0.
|
||||
* @update gess7/30/98
|
||||
* @param s1 points to unichar string
|
||||
* @param s2 points to cstring
|
||||
* @return 0 if they match, -1 if s1<s2; 1 if s1>s2
|
||||
*/
|
||||
PRInt32 nsCRT::strncasecmp(const PRUnichar* s1, const char* s2, PRUint32 n)
|
||||
{
|
||||
if(s1 && s2){
|
||||
if(n != 0){
|
||||
do {
|
||||
PRUnichar c1 = *s1++;
|
||||
PRUnichar c2 = kIsoLatin1ToUCS2[*(const unsigned char*)s2++];
|
||||
if (c1 != c2) {
|
||||
c1 = TOLOWER(c1);
|
||||
c2 = TOLOWER(c2);
|
||||
if (c1 != c2) {
|
||||
if (c1 < c2) return -1;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
if (c1 == 0) break;
|
||||
} while (--n != 0);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
PRUnichar* nsCRT::strdup(const PRUnichar* str)
|
||||
{
|
||||
PRUint32 len = nsCRT::strlen(str) + 1; // add one for null
|
||||
PRUnichar* rslt = new PRUnichar[len];
|
||||
if (rslt == NULL) return NULL;
|
||||
nsCRT::memcpy(rslt, str, len * sizeof(PRUnichar));
|
||||
return rslt;
|
||||
}
|
||||
|
||||
PRUint32 nsCRT::HashValue(const PRUnichar* us)
|
||||
{
|
||||
PRUint32 rv = 0;
|
||||
if(us) {
|
||||
PRUnichar ch;
|
||||
while ((ch = *us++) != 0) {
|
||||
// FYI: rv = rv*37 + ch
|
||||
rv = ((rv << 5) + (rv << 2) + rv) + ch;
|
||||
}
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
PRUint32 nsCRT::HashValue(const PRUnichar* us, PRUint32* uslenp)
|
||||
{
|
||||
PRUint32 rv = 0;
|
||||
PRUint32 len = 0;
|
||||
PRUnichar ch;
|
||||
while ((ch = *us++) != 0) {
|
||||
// FYI: rv = rv*37 + ch
|
||||
rv = ((rv << 5) + (rv << 2) + rv) + ch;
|
||||
len++;
|
||||
}
|
||||
*uslenp = len;
|
||||
return rv;
|
||||
}
|
||||
|
||||
PRInt32 nsCRT::atoi( const PRUnichar *string )
|
||||
{
|
||||
return atoi(string);
|
||||
}
|
||||
|
||||
192
mozilla/base/src/nsCRT.h
Normal file
192
mozilla/base/src/nsCRT.h
Normal file
@@ -0,0 +1,192 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
#ifndef nsCRT_h___
|
||||
#define nsCRT_h___
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "plstr.h"
|
||||
#include "nscore.h"
|
||||
|
||||
#define CR '\015'
|
||||
#define LF '\012'
|
||||
#define VTAB '\013'
|
||||
#define FF '\014'
|
||||
#define TAB '\011'
|
||||
#define CRLF "\015\012" /* A CR LF equivalent string */
|
||||
|
||||
|
||||
// This macro can be used in a class declaration for classes that want
|
||||
// to ensure that their instance memory is zeroed.
|
||||
#define NS_DECL_AND_IMPL_ZEROING_OPERATOR_NEW \
|
||||
void* operator new(size_t sz) { \
|
||||
void* rv = ::operator new(sz); \
|
||||
if (rv) { \
|
||||
nsCRT::zero(rv, sz); \
|
||||
} \
|
||||
return rv; \
|
||||
} \
|
||||
void operator delete(void* ptr) { \
|
||||
::operator delete(ptr); \
|
||||
}
|
||||
|
||||
// This macro works with the next macro to declare a non-inlined
|
||||
// version of the above.
|
||||
#define NS_DECL_ZEROING_OPERATOR_NEW \
|
||||
void* operator new(size_t sz); \
|
||||
void operator delete(void* ptr);
|
||||
|
||||
#define NS_IMPL_ZEROING_OPERATOR_NEW(_class) \
|
||||
void* _class::operator new(size_t sz) { \
|
||||
void* rv = ::operator new(sz); \
|
||||
if (rv) { \
|
||||
nsCRT::zero(rv, sz); \
|
||||
} \
|
||||
return rv; \
|
||||
} \
|
||||
void _class::operator delete(void* ptr) { \
|
||||
::operator delete(ptr); \
|
||||
}
|
||||
|
||||
/// This is a wrapper class around all the C runtime functions.
|
||||
|
||||
class NS_BASE nsCRT {
|
||||
public:
|
||||
|
||||
/** Copy bytes from aSrc to aDest.
|
||||
@param aDest the destination address
|
||||
@param aSrc the source address
|
||||
@param aCount the number of bytes to copy
|
||||
*/
|
||||
static void memcpy(void* aDest, const void* aSrc, PRUint32 aCount) {
|
||||
::memcpy(aDest, aSrc, (size_t)aCount);
|
||||
}
|
||||
|
||||
static void memmove(void* aDest, const void* aSrc, PRUint32 aCount) {
|
||||
::memmove(aDest, aSrc, (size_t)aCount);
|
||||
}
|
||||
|
||||
static void memset(void* aDest, PRUint8 aByte, PRUint32 aCount) {
|
||||
::memset(aDest, aByte, aCount);
|
||||
}
|
||||
|
||||
static void zero(void* aDest, PRUint32 aCount) {
|
||||
::memset(aDest, 0, (size_t)aCount);
|
||||
}
|
||||
|
||||
/** Compute the string length of s
|
||||
@param s the string in question
|
||||
@return the length of s
|
||||
*/
|
||||
static PRUint32 strlen(const char* s) {
|
||||
return PRUint32(::strlen(s));
|
||||
}
|
||||
|
||||
/// Compare s1 and s2.
|
||||
static PRInt32 strcmp(const char* s1, const char* s2) {
|
||||
return PRUint32(PL_strcmp(s1, s2));
|
||||
}
|
||||
|
||||
static PRUint32 strncmp(const char* s1, const char* s2,
|
||||
PRUint32 aMaxLen) {
|
||||
return PRInt32(PL_strncmp(s1, s2, aMaxLen));
|
||||
}
|
||||
|
||||
/// Case-insensitive string comparison.
|
||||
static PRInt32 strcasecmp(const char* s1, const char* s2) {
|
||||
return PRInt32(PL_strcasecmp(s1, s2));
|
||||
}
|
||||
|
||||
/// Case-insensitive string comparison with length
|
||||
static PRInt32 strncasecmp(const char* s1, const char* s2, PRUint32 aMaxLen) {
|
||||
return PRInt32(PL_strncasecmp(s1, s2, aMaxLen));
|
||||
}
|
||||
|
||||
static PRInt32 strncmp(const char* s1, const char* s2, PRInt32 aMaxLen) {
|
||||
return PRInt32(PL_strncmp(s1,s2,aMaxLen));
|
||||
}
|
||||
|
||||
static char* strdup(const char* str) {
|
||||
return PL_strdup(str);
|
||||
}
|
||||
|
||||
/**
|
||||
How to use this fancy (thread-safe) version of strtok:
|
||||
|
||||
void main( void ) {
|
||||
printf( "%s\n\nTokens:\n", string );
|
||||
// Establish string and get the first token:
|
||||
char* newStr;
|
||||
token = nsCRT::strtok( string, seps, &newStr );
|
||||
while( token != NULL ) {
|
||||
// While there are tokens in "string"
|
||||
printf( " %s\n", token );
|
||||
// Get next token:
|
||||
token = nsCRT::strtok( newStr, seps, &newStr );
|
||||
}
|
||||
}
|
||||
|
||||
*/
|
||||
static char* strtok(char* str, const char* delims, char* *newStr);
|
||||
|
||||
/// Like strlen except for ucs2 strings
|
||||
static PRUint32 strlen(const PRUnichar* s);
|
||||
|
||||
/// Like strcmp except for ucs2 strings
|
||||
static PRInt32 strcmp(const PRUnichar* s1, const PRUnichar* s2);
|
||||
/// Like strcmp except for ucs2 strings
|
||||
static PRInt32 strncmp(const PRUnichar* s1, const PRUnichar* s2,
|
||||
PRUint32 aMaxLen);
|
||||
|
||||
/// Like strcasecmp except for ucs2 strings
|
||||
static PRInt32 strcasecmp(const PRUnichar* s1, const PRUnichar* s2);
|
||||
/// Like strncasecmp except for ucs2 strings
|
||||
static PRInt32 strncasecmp(const PRUnichar* s1, const PRUnichar* s2,
|
||||
PRUint32 aMaxLen);
|
||||
|
||||
/// Like strcmp with a char* and a ucs2 string
|
||||
static PRInt32 strcmp(const PRUnichar* s1, const char* s2);
|
||||
/// Like strncmp with a char* and a ucs2 string
|
||||
static PRInt32 strncmp(const PRUnichar* s1, const char* s2,
|
||||
PRUint32 aMaxLen);
|
||||
|
||||
/// Like strcasecmp with a char* and a ucs2 string
|
||||
static PRInt32 strcasecmp(const PRUnichar* s1, const char* s2);
|
||||
/// Like strncasecmp with a char* and a ucs2 string
|
||||
static PRInt32 strncasecmp(const PRUnichar* s1, const char* s2,
|
||||
PRUint32 aMaxLen);
|
||||
|
||||
// Note: uses new[] to allocate memory, so you must use delete[] to
|
||||
// free the memory
|
||||
static PRUnichar* strdup(const PRUnichar* str);
|
||||
|
||||
/// Compute a hashcode for a ucs2 string
|
||||
static PRUint32 HashValue(const PRUnichar* s1);
|
||||
|
||||
/// Same as above except that we return the length in s1len
|
||||
static PRUint32 HashValue(const PRUnichar* s1, PRUint32* s1len);
|
||||
|
||||
/// String to integer.
|
||||
static PRInt32 atoi( const PRUnichar *string );
|
||||
|
||||
static PRUnichar ToUpper(PRUnichar aChar);
|
||||
|
||||
static PRUnichar ToLower(PRUnichar aChar);
|
||||
};
|
||||
|
||||
#endif /* nsCRT_h___ */
|
||||
553
mozilla/base/src/nsDeque.cpp
Normal file
553
mozilla/base/src/nsDeque.cpp
Normal file
@@ -0,0 +1,553 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
|
||||
#include "nsDeque.h"
|
||||
#include "nsCRT.h"
|
||||
|
||||
//#define _SELFTEST_DEQUE 1
|
||||
#undef _SELFTEST_DEQUE
|
||||
|
||||
/**
|
||||
* Standard constructor
|
||||
* @update gess4/18/98
|
||||
* @return new deque
|
||||
*/
|
||||
nsDeque::nsDeque(nsDequeFunctor* aDeallocator) {
|
||||
mDeallocator=aDeallocator;
|
||||
mCapacity=eGrowthDelta;
|
||||
mOrigin=mSize=0;
|
||||
mData=new void*[mCapacity];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Destructor
|
||||
* @update gess4/18/98
|
||||
*/
|
||||
nsDeque::~nsDeque() {
|
||||
Erase();
|
||||
delete [] mData;
|
||||
mData=0;
|
||||
if(mDeallocator) {
|
||||
delete mDeallocator;
|
||||
}
|
||||
mDeallocator=0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the number of elements currently stored in
|
||||
* this deque.
|
||||
*
|
||||
* @update gess4/18/98
|
||||
* @param
|
||||
* @return int contains element count
|
||||
*/
|
||||
PRInt32 nsDeque::GetSize(void) const {
|
||||
return mSize;
|
||||
}
|
||||
|
||||
void nsDeque::SetDeallocator(nsDequeFunctor* aDeallocator){
|
||||
if(mDeallocator) {
|
||||
delete mDeallocator;
|
||||
}
|
||||
mDeallocator=aDeallocator;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove all items from container without destroying them.
|
||||
*
|
||||
* @update gess4/18/98
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
nsDeque& nsDeque::Empty() {
|
||||
if((0<mCapacity) && (mData)) {
|
||||
nsCRT::zero(mData,mCapacity*sizeof(mData));
|
||||
}
|
||||
mSize=0;
|
||||
mOrigin=0;
|
||||
return *this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove and delete all items from container
|
||||
*
|
||||
* @update gess4/18/98
|
||||
* @return this
|
||||
*/
|
||||
nsDeque& nsDeque::Erase() {
|
||||
if(mDeallocator) {
|
||||
ForEach(*mDeallocator);
|
||||
}
|
||||
return Empty();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This method adds an item to the end of the deque.
|
||||
* This operation has the potential to cause the
|
||||
* underlying buffer to resize.
|
||||
*
|
||||
* @update gess4/18/98
|
||||
* @param anItem: new item to be added to deque
|
||||
* @return nada
|
||||
*/
|
||||
nsDeque& nsDeque::Push(void* anItem) {
|
||||
if(mSize==mCapacity) {
|
||||
void** temp=new void*[mCapacity+eGrowthDelta];
|
||||
|
||||
//Here's the interesting part: You can't just move the elements
|
||||
//directy (in situ) from the old buffer to the new one.
|
||||
//Since capacity has changed, the old origin doesn't make
|
||||
//sense anymore. It's better to resequence the elements now.
|
||||
|
||||
int tempi=0;
|
||||
int i=0;
|
||||
int j=0;
|
||||
for(i=mOrigin;i<mCapacity;i++) temp[tempi++]=mData[i]; //copy the leading elements...
|
||||
for(j=0;j<mOrigin;j++) temp[tempi++]=mData[j]; //copy the trailing elements...
|
||||
mCapacity+=eGrowthDelta;
|
||||
mOrigin=0; //now realign the origin...
|
||||
delete[]mData;
|
||||
mData=temp;
|
||||
}
|
||||
int offset=mOrigin+mSize;
|
||||
if(offset<mCapacity)
|
||||
mData[offset]=anItem;
|
||||
else mData[offset-mCapacity]=anItem;
|
||||
mSize++;
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This method adds an item to the front of the deque.
|
||||
* This operation has the potential to cause the
|
||||
* underlying buffer to resize.
|
||||
*
|
||||
* @update gess4/18/98
|
||||
* @param anItem: new item to be added to deque
|
||||
* @return nada
|
||||
*/
|
||||
nsDeque& nsDeque::PushFront(void* anItem) {
|
||||
if(mOrigin>0) {
|
||||
mOrigin-=1;
|
||||
mData[mOrigin]=anItem;
|
||||
mSize++;
|
||||
}
|
||||
else {
|
||||
Push(anItem);
|
||||
mOrigin=mSize-1;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove and return the last item in the container.
|
||||
*
|
||||
* @update gess4/18/98
|
||||
* @param none
|
||||
* @return ptr to last item in container
|
||||
*/
|
||||
void* nsDeque::Pop(void) {
|
||||
void* result=0;
|
||||
if(mSize>0) {
|
||||
int offset=mOrigin+mSize-1;
|
||||
if(offset>=mCapacity)
|
||||
offset-=mCapacity;
|
||||
result=mData[offset];
|
||||
mData[offset]=0;
|
||||
mSize--;
|
||||
if(0==mSize)
|
||||
mOrigin=0;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method gets called you want to remove and return
|
||||
* the first member in the container.
|
||||
*
|
||||
* @update gess4/18/98
|
||||
* @param nada
|
||||
* @return last item in container
|
||||
*/
|
||||
void* nsDeque::PopFront() {
|
||||
void* result=0;
|
||||
if(mSize>0) {
|
||||
result=mData[mOrigin];
|
||||
mData[mOrigin++]=0; //zero it out for debugging purposes.
|
||||
mSize--;
|
||||
if(mCapacity==mOrigin) //you popped off the end, so cycle back around...
|
||||
mOrigin=0;
|
||||
if(0==mSize)
|
||||
mOrigin=0;
|
||||
}
|
||||
NS_ASSERTION(mOrigin<mCapacity,"Error: Bad origin");
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method gets called you want to peek at the topmost
|
||||
* member without removing it.
|
||||
*
|
||||
* @update gess4/18/98
|
||||
* @param nada
|
||||
* @return last item in container
|
||||
*/
|
||||
void* nsDeque::Peek() {
|
||||
void* result=0;
|
||||
if(mSize>0) {
|
||||
result=mData[mOrigin];
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Call this to retrieve the ith element from this container.
|
||||
* Keep in mind that accessing the underlying elements is
|
||||
* done in a relative fashion. Object 0 is not necessarily
|
||||
* the first element (the first element is at mOrigin).
|
||||
*
|
||||
* @update gess4/18/98
|
||||
* @param anIndex : 0 relative offset of item you want
|
||||
* @return void* or null
|
||||
*/
|
||||
void* nsDeque::ObjectAt(PRInt32 anIndex) const {
|
||||
void* result=0;
|
||||
|
||||
if((anIndex>=0) && (anIndex<mSize))
|
||||
{
|
||||
if(anIndex<(mCapacity-mOrigin)) {
|
||||
result=mData[mOrigin+anIndex];
|
||||
}
|
||||
else {
|
||||
result=mData[anIndex-(mCapacity-mOrigin)];
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create and return an iterator pointing to
|
||||
* the beginning of the queue. Note that this
|
||||
* takes the circular buffer semantics into account.
|
||||
*
|
||||
* @update gess4/18/98
|
||||
* @return new deque iterator, init'ed to 1st item
|
||||
*/
|
||||
nsDequeIterator nsDeque::Begin(void) const{
|
||||
return nsDequeIterator(*this,0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create and return an iterator pointing to
|
||||
* the last of the queue. Note that this
|
||||
* takes the circular buffer semantics into account.
|
||||
*
|
||||
* @update gess4/18/98
|
||||
* @return new deque iterator, init'ed to last item
|
||||
*/
|
||||
nsDequeIterator nsDeque::End(void) const{
|
||||
return nsDequeIterator(*this,mSize);
|
||||
}
|
||||
|
||||
/**
|
||||
* Call this method when you wanto to iterate all the
|
||||
* members of the container, passing a functor along
|
||||
* to call your code.
|
||||
*
|
||||
* @update gess4/20/98
|
||||
* @param aFunctor object to call for each member
|
||||
* @return *this
|
||||
*/
|
||||
void nsDeque::ForEach(nsDequeFunctor& aFunctor) const{
|
||||
int i=0;
|
||||
for(i=0;i<mSize;i++){
|
||||
void* obj=ObjectAt(i);
|
||||
obj=aFunctor(obj);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Call this method when you wanto to iterate all the
|
||||
* members of the container, passing a functor along
|
||||
* to call your code. Iteration continues until your
|
||||
* functor returns a non-null.
|
||||
*
|
||||
* @update gess4/20/98
|
||||
* @param aFunctor object to call for each member
|
||||
* @return *this
|
||||
*/
|
||||
const void* nsDeque::FirstThat(nsDequeFunctor& aFunctor) const{
|
||||
int i=0;
|
||||
for(i=0;i<mSize;i++){
|
||||
void* obj=ObjectAt(i);
|
||||
obj=aFunctor(obj);
|
||||
if(obj)
|
||||
return obj;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/******************************************************
|
||||
* Here comes the nsDequeIterator class...
|
||||
******************************************************/
|
||||
|
||||
/**
|
||||
* DequeIterator is an object that knows how to iterate (forward and backward)
|
||||
* a Deque. Normally, you don't need to do this, but there are some special
|
||||
* cases where it is pretty handy, so here you go.
|
||||
*
|
||||
* This is a standard dequeiterator constructor
|
||||
*
|
||||
* @update gess4/18/98
|
||||
* @param aQueue is the deque object to be iterated
|
||||
* @param anIndex is the starting position for your iteration
|
||||
*/
|
||||
nsDequeIterator::nsDequeIterator(const nsDeque& aQueue,int anIndex): mIndex(anIndex), mDeque(aQueue) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Copy construct a new iterator beginning with given
|
||||
*
|
||||
* @update gess4/20/98
|
||||
* @param aCopy is another iterator to copy from
|
||||
* @return
|
||||
*/
|
||||
nsDequeIterator::nsDequeIterator(const nsDequeIterator& aCopy) : mIndex(aCopy.mIndex), mDeque(aCopy.mDeque) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Moves iterator to first element in deque
|
||||
* @update gess4/18/98
|
||||
* @return this
|
||||
*/
|
||||
nsDequeIterator& nsDequeIterator::First(void){
|
||||
mIndex=0;
|
||||
return *this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Standard assignment operator for dequeiterator
|
||||
*
|
||||
* @update gess4/18/98
|
||||
* @param aCopy is an iterator to be copied from
|
||||
* @return *this
|
||||
*/
|
||||
nsDequeIterator& nsDequeIterator::operator=(const nsDequeIterator& aCopy) {
|
||||
//queue's are already equal.
|
||||
mIndex=aCopy.mIndex;
|
||||
return *this;
|
||||
}
|
||||
|
||||
/**
|
||||
* preform ! operation against to iterators to test for equivalence
|
||||
* (or lack thereof)!
|
||||
*
|
||||
* @update gess4/18/98
|
||||
* @param anIter is the object to be compared to
|
||||
* @return TRUE if NOT equal.
|
||||
*/
|
||||
PRBool nsDequeIterator::operator!=(nsDequeIterator& anIter) {
|
||||
return PRBool(!this->operator==(anIter));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Compare 2 iterators for equivalence.
|
||||
*
|
||||
* @update gess4/18/98
|
||||
* @param anIter is the other iterator to be compared to
|
||||
* @return TRUE if EQUAL
|
||||
*/
|
||||
PRBool nsDequeIterator::operator<(nsDequeIterator& anIter) {
|
||||
return PRBool(((mIndex<anIter.mIndex) && (&mDeque==&anIter.mDeque)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Compare 2 iterators for equivalence.
|
||||
*
|
||||
* @update gess4/18/98
|
||||
* @param anIter is the other iterator to be compared to
|
||||
* @return TRUE if EQUAL
|
||||
*/
|
||||
PRBool nsDequeIterator::operator==(nsDequeIterator& anIter) {
|
||||
return PRBool(((mIndex==anIter.mIndex) && (&mDeque==&anIter.mDeque)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Compare 2 iterators for equivalence.
|
||||
*
|
||||
* @update gess4/18/98
|
||||
* @param anIter is the other iterator to be compared to
|
||||
* @return TRUE if EQUAL
|
||||
*/
|
||||
PRBool nsDequeIterator::operator>=(nsDequeIterator& anIter) {
|
||||
return PRBool(((mIndex>=anIter.mIndex) && (&mDeque==&anIter.mDeque)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Pre-increment operator
|
||||
*
|
||||
* @update gess4/18/98
|
||||
* @return object at preincremented index
|
||||
*/
|
||||
void* nsDequeIterator::operator++() {
|
||||
return mDeque.ObjectAt(++mIndex);
|
||||
}
|
||||
|
||||
/**
|
||||
* Post-increment operator
|
||||
*
|
||||
* @update gess4/18/98
|
||||
* @param param is ignored
|
||||
* @return object at post-incremented index
|
||||
*/
|
||||
void* nsDequeIterator::operator++(int) {
|
||||
return mDeque.ObjectAt(mIndex++);
|
||||
}
|
||||
|
||||
/**
|
||||
* Pre-decrement operator
|
||||
*
|
||||
* @update gess4/18/98
|
||||
* @return object at pre-decremented index
|
||||
*/
|
||||
void* nsDequeIterator::operator--() {
|
||||
return mDeque.ObjectAt(--mIndex);
|
||||
}
|
||||
|
||||
/**
|
||||
* Post-decrement operator
|
||||
*
|
||||
* @update gess4/18/98
|
||||
* @param param is ignored
|
||||
* @return object at post-decremented index
|
||||
*/
|
||||
void* nsDequeIterator::operator--(int) {
|
||||
return mDeque.ObjectAt(mIndex--);
|
||||
}
|
||||
|
||||
/**
|
||||
* Dereference operator
|
||||
*
|
||||
* @update gess4/18/98
|
||||
* @return object at ith index
|
||||
*/
|
||||
void* nsDequeIterator::GetCurrent(void) {
|
||||
return mDeque.ObjectAt(mIndex);
|
||||
}
|
||||
|
||||
/**
|
||||
* Call this method when you wanto to iterate all the
|
||||
* members of the container, passing a functor along
|
||||
* to call your code.
|
||||
*
|
||||
* @update gess4/20/98
|
||||
* @param aFunctor object to call for each member
|
||||
* @return *this
|
||||
*/
|
||||
void nsDequeIterator::ForEach(nsDequeFunctor& aFunctor) const{
|
||||
mDeque.ForEach(aFunctor);
|
||||
}
|
||||
|
||||
/**
|
||||
* Call this method when you wanto to iterate all the
|
||||
* members of the container, passing a functor along
|
||||
* to call your code.
|
||||
*
|
||||
* @update gess4/20/98
|
||||
* @param aFunctor object to call for each member
|
||||
* @return *this
|
||||
*/
|
||||
const void* nsDequeIterator::FirstThat(nsDequeFunctor& aFunctor) const{
|
||||
return mDeque.FirstThat(aFunctor);
|
||||
}
|
||||
|
||||
#ifdef _SELFTEST_DEQUE
|
||||
/**************************************************************
|
||||
Now define the token deallocator class...
|
||||
**************************************************************/
|
||||
class _SelfTestDeallocator: public nsDequeFunctor{
|
||||
public:
|
||||
_SelfTestDeallocator::_SelfTestDeallocator() {
|
||||
nsDeque::SelfTest();
|
||||
}
|
||||
virtual void* operator()(void* anObject) {
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
static _SelfTestDeallocator gDeallocator;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* conduct automated self test for this class
|
||||
*
|
||||
* @update gess4/18/98
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
void nsDeque::SelfTest(void) {
|
||||
#ifdef _SELFTEST_DEQUE
|
||||
|
||||
{
|
||||
nsDeque theDeque(gDeallocator); //construct a simple one...
|
||||
|
||||
int ints[200];
|
||||
int count=sizeof(ints)/sizeof(int);
|
||||
int i=0;
|
||||
|
||||
for(i=0;i<count;i++){ //initialize'em
|
||||
ints[i]=10*(1+i);
|
||||
}
|
||||
|
||||
for(i=0;i<70;i++){
|
||||
theDeque.Push(&ints[i]);
|
||||
}
|
||||
|
||||
for(i=0;i<56;i++){
|
||||
int* temp=(int*)theDeque.Pop();
|
||||
}
|
||||
|
||||
for(i=0;i<55;i++){
|
||||
theDeque.Push(&ints[i]);
|
||||
}
|
||||
|
||||
for(i=0;i<35;i++){
|
||||
int* temp=(int*)theDeque.Pop();
|
||||
}
|
||||
|
||||
for(i=0;i<35;i++){
|
||||
theDeque.Push(&ints[i]);
|
||||
}
|
||||
|
||||
for(i=0;i<38;i++){
|
||||
int* temp=(int*)theDeque.Pop();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
int x;
|
||||
x=10;
|
||||
#endif
|
||||
}
|
||||
|
||||
408
mozilla/base/src/nsDeque.h
Normal file
408
mozilla/base/src/nsDeque.h
Normal file
@@ -0,0 +1,408 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
/**
|
||||
* MODULE NOTES:
|
||||
* @update gess 4/15/98 (tax day)
|
||||
*
|
||||
* The Deque is a very small, very efficient container object
|
||||
* than can hold elements of type void*, offering the following features:
|
||||
* It's interface supports pushing and poping of children.
|
||||
* It can iterate (via an interator class) it's children.
|
||||
* When full, it can efficently resize dynamically.
|
||||
*
|
||||
*
|
||||
* NOTE: The only bit of trickery here is that this deque is
|
||||
* built upon a ring-buffer. Like all ring buffers, the first
|
||||
* element may not be at index[0]. The mOrigin member determines
|
||||
* where the first child is. This point is quietly hidden from
|
||||
* customers of this class.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _NSDEQUE
|
||||
#define _NSDEQUE
|
||||
|
||||
#include "nscore.h"
|
||||
|
||||
/**
|
||||
* The nsDequefunctor class is used when you want to create
|
||||
* callbacks between the deque and your generic code.
|
||||
* Use these objects in a call to ForEach();
|
||||
*
|
||||
* @update gess4/20/98
|
||||
*/
|
||||
class NS_BASE nsDequeFunctor{
|
||||
public:
|
||||
virtual void* operator()(void* anObject)=0;
|
||||
};
|
||||
|
||||
|
||||
/******************************************************
|
||||
* Here comes the nsDeque class itself...
|
||||
******************************************************/
|
||||
|
||||
/**
|
||||
* The deque (double-ended queue) class is a common container type,
|
||||
* whose behavior mimics a line in your favorite checkout stand.
|
||||
* Classic CS describes the common behavior of a queue as FIFO.
|
||||
* A Deque allows items to be added and removed from either end of
|
||||
* the queue.
|
||||
*
|
||||
* @update gess4/20/98
|
||||
*/
|
||||
|
||||
class NS_BASE nsDeque {
|
||||
friend class nsDequeIterator;
|
||||
public:
|
||||
nsDeque(nsDequeFunctor* aDeallocator);
|
||||
~nsDeque();
|
||||
|
||||
/**
|
||||
* Returns the number of elements currently stored in
|
||||
* this deque.
|
||||
*
|
||||
* @update gess4/18/98
|
||||
* @param
|
||||
* @return int contains element count
|
||||
*/
|
||||
PRInt32 GetSize() const;
|
||||
|
||||
|
||||
/**
|
||||
* Pushes new member onto the end of the deque
|
||||
*
|
||||
* @update gess4/18/98
|
||||
* @param ptr to object to store
|
||||
* @return *this
|
||||
*/
|
||||
nsDeque& Push(void* anItem);
|
||||
|
||||
/**
|
||||
* Pushes new member onto the front of the deque
|
||||
*
|
||||
* @update gess4/18/98
|
||||
* @param ptr to object to store
|
||||
* @return *this
|
||||
*/
|
||||
nsDeque& PushFront(void* anItem);
|
||||
|
||||
/**
|
||||
* Remove and return the first item in the container.
|
||||
*
|
||||
* @update gess4/18/98
|
||||
* @param none
|
||||
* @return ptr to first item in container
|
||||
*/
|
||||
void* Pop(void);
|
||||
|
||||
/**
|
||||
* Remove and return the first item in the container.
|
||||
*
|
||||
* @update gess4/18/98
|
||||
* @param none
|
||||
* @return ptr to first item in container
|
||||
*/
|
||||
void* PopFront(void);
|
||||
|
||||
|
||||
/**
|
||||
* Return topmost item without removing it.
|
||||
*
|
||||
* @update gess4/18/98
|
||||
* @param none
|
||||
* @return ptr to first item in container
|
||||
*/
|
||||
void* Peek(void);
|
||||
|
||||
/**
|
||||
* method used to retrieve ptr to
|
||||
* ith member in container. DOesn't remove
|
||||
* that item.
|
||||
*
|
||||
* @update gess4/18/98
|
||||
* @param index of desired item
|
||||
* @return ptr to ith element in list
|
||||
*/
|
||||
void* ObjectAt(int anIndex) const;
|
||||
|
||||
/**
|
||||
* Remove all items from container without destroying them
|
||||
*
|
||||
* @update gess4/18/98
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
nsDeque& Empty();
|
||||
|
||||
/**
|
||||
* Remove and delete all items from container
|
||||
*
|
||||
* @update gess4/18/98
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
nsDeque& Erase();
|
||||
|
||||
|
||||
/**
|
||||
* Creates a new iterator, init'ed to start of container
|
||||
*
|
||||
* @update gess4/18/98
|
||||
* @return new dequeIterator
|
||||
*/
|
||||
nsDequeIterator Begin() const;
|
||||
|
||||
/**
|
||||
* Creates a new iterator, init'ed to end of container
|
||||
*
|
||||
* @update gess4/18/98
|
||||
* @return new dequeIterator
|
||||
*/
|
||||
nsDequeIterator End() const;
|
||||
|
||||
|
||||
/**
|
||||
* Call this method when you wanto to iterate all the
|
||||
* members of the container, passing a functor along
|
||||
* to call your code.
|
||||
*
|
||||
* @update gess4/20/98
|
||||
* @param aFunctor object to call for each member
|
||||
* @return *this
|
||||
*/
|
||||
void ForEach(nsDequeFunctor& aFunctor) const;
|
||||
|
||||
/**
|
||||
* Call this method when you wanto to iterate all the
|
||||
* members of the container, passing a functor along
|
||||
* to call your code. This process will interupt if
|
||||
* your function returns a null to this iterator.
|
||||
*
|
||||
* @update gess4/20/98
|
||||
* @param aFunctor object to call for each member
|
||||
* @return *this
|
||||
*/
|
||||
const void* FirstThat(nsDequeFunctor& aFunctor) const;
|
||||
|
||||
void SetDeallocator(nsDequeFunctor* aDeallocator);
|
||||
|
||||
/**
|
||||
* Perform automated selftest on the deque
|
||||
*
|
||||
* @update gess4/18/98
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
static void SelfTest();
|
||||
|
||||
protected:
|
||||
|
||||
PRInt32 mSize;
|
||||
PRInt32 mCapacity;
|
||||
PRInt32 mOrigin;
|
||||
nsDequeFunctor* mDeallocator;
|
||||
void** mData;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
enum {eGrowthDelta=64};
|
||||
|
||||
/**
|
||||
* Simple default constructor (PRIVATE)
|
||||
*
|
||||
* @update gess4/18/98
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
nsDeque();
|
||||
|
||||
/**
|
||||
* Copy constructor (PRIVATE)
|
||||
*
|
||||
* @update gess4/18/98
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
nsDeque(const nsDeque& other);
|
||||
|
||||
/**
|
||||
* Deque assignment operator (PRIVATE)
|
||||
*
|
||||
* @update gess4/18/98
|
||||
* @param another deque
|
||||
* @return *this
|
||||
*/
|
||||
nsDeque& operator=(const nsDeque& anOther);
|
||||
|
||||
};
|
||||
|
||||
/******************************************************
|
||||
* Here comes the nsDequeIterator class...
|
||||
******************************************************/
|
||||
|
||||
class NS_BASE nsDequeIterator {
|
||||
public:
|
||||
|
||||
/**
|
||||
* DequeIterator is an object that knows how to iterate (forward and backward)
|
||||
* a Deque. Normally, you don't need to do this, but there are some special
|
||||
* cases where it is pretty handy, so here you go.
|
||||
*
|
||||
* @update gess4/18/98
|
||||
* @param aQueue is the deque object to be iterated
|
||||
* @param anIndex is the starting position for your iteration
|
||||
*/
|
||||
nsDequeIterator(const nsDeque& aQueue,int anIndex=0);
|
||||
|
||||
/**
|
||||
* DequeIterator is an object that knows how to iterate (forward and backward)
|
||||
* a Deque. Normally, you don't need to do this, but there are some special
|
||||
* cases where it is pretty handy, so here you go.
|
||||
*
|
||||
* @update gess4/18/98
|
||||
* @param aQueue is the deque object to be iterated
|
||||
* @param anIndex is the starting position for your iteration
|
||||
*/
|
||||
nsDequeIterator(const nsDequeIterator& aCopy);
|
||||
|
||||
/**
|
||||
* Moves iterator to first element in deque
|
||||
* @update gess4/18/98
|
||||
* @return this
|
||||
*/
|
||||
nsDequeIterator& First(void);
|
||||
|
||||
/**
|
||||
* Standard assignment operator for deque
|
||||
* @update gess4/18/98
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
nsDequeIterator& operator=(const nsDequeIterator& aCopy);
|
||||
|
||||
/**
|
||||
* preform ! operation against to iterators to test for equivalence
|
||||
* (or lack thereof)!
|
||||
*
|
||||
* @update gess4/18/98
|
||||
* @param anIter is the object to be compared to
|
||||
* @return TRUE if NOT equal.
|
||||
*/
|
||||
PRBool operator!=(nsDequeIterator& anIter);
|
||||
|
||||
/**
|
||||
* Compare 2 iterators for equivalence.
|
||||
*
|
||||
* @update gess4/18/98
|
||||
* @param anIter is the other iterator to be compared to
|
||||
* @return TRUE if EQUAL
|
||||
*/
|
||||
PRBool operator<(nsDequeIterator& anIter);
|
||||
|
||||
/**
|
||||
* Compare 2 iterators for equivalence.
|
||||
*
|
||||
* @update gess4/18/98
|
||||
* @param anIter is the other iterator to be compared to
|
||||
* @return TRUE if EQUAL
|
||||
*/
|
||||
PRBool operator==(nsDequeIterator& anIter);
|
||||
|
||||
/**
|
||||
* Compare 2 iterators for equivalence.
|
||||
*
|
||||
* @update gess4/18/98
|
||||
* @param anIter is the other iterator to be compared to
|
||||
* @return TRUE if EQUAL
|
||||
*/
|
||||
PRBool operator>=(nsDequeIterator& anIter);
|
||||
|
||||
/**
|
||||
* Pre-increment operator
|
||||
*
|
||||
* @update gess4/18/98
|
||||
* @return object at preincremented index
|
||||
*/
|
||||
void* operator++();
|
||||
|
||||
/**
|
||||
* Post-increment operator
|
||||
*
|
||||
* @update gess4/18/98
|
||||
* @param param is ignored
|
||||
* @return object at post-incremented index
|
||||
*/
|
||||
void* operator++(int);
|
||||
|
||||
/**
|
||||
* Pre-decrement operator
|
||||
*
|
||||
* @update gess4/18/98
|
||||
* @return object at pre-decremented index
|
||||
*/
|
||||
void* operator--();
|
||||
|
||||
/**
|
||||
* Post-decrement operator
|
||||
*
|
||||
* @update gess4/18/98
|
||||
* @param param is ignored
|
||||
* @return object at post-decremented index
|
||||
*/
|
||||
void* operator--(int);
|
||||
|
||||
/**
|
||||
* Retrieve the ptr to the iterators notion of current node
|
||||
*
|
||||
* @update gess4/18/98
|
||||
* @return object at ith index
|
||||
*/
|
||||
void* GetCurrent(void);
|
||||
|
||||
/**
|
||||
* Call this method when you wanto to iterate all the
|
||||
* members of the container, passing a functor along
|
||||
* to call your code.
|
||||
*
|
||||
* @update gess4/20/98
|
||||
* @param aFunctor object to call for each member
|
||||
* @return *this
|
||||
*/
|
||||
void ForEach(nsDequeFunctor& aFunctor) const;
|
||||
|
||||
/**
|
||||
* Call this method when you wanto to iterate all the
|
||||
* members of the container, passing a functor along
|
||||
* to call your code.
|
||||
*
|
||||
* @update gess4/20/98
|
||||
* @param aFunctor object to call for each member
|
||||
* @return *this
|
||||
*/
|
||||
const void* FirstThat(nsDequeFunctor& aFunctor) const;
|
||||
|
||||
protected:
|
||||
PRInt32 mIndex;
|
||||
const nsDeque& mDeque;
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
152
mozilla/base/src/nsEscape.cpp
Normal file
152
mozilla/base/src/nsEscape.cpp
Normal file
@@ -0,0 +1,152 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
// First checked in on 98/12/03 by John R. McMullen, derived from net.h/mkparse.c.
|
||||
|
||||
#include "nsEscape.h"
|
||||
|
||||
#include "plstr.h"
|
||||
|
||||
const int netCharType[256] =
|
||||
/* Bit 0 xalpha -- the alphas
|
||||
** Bit 1 xpalpha -- as xalpha but
|
||||
** converts spaces to plus and plus to %20
|
||||
** Bit 3 ... path -- as xalphas but doesn't escape '/'
|
||||
*/
|
||||
/* 0 1 2 3 4 5 6 7 8 9 A B C D E F */
|
||||
{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0x */
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 1x */
|
||||
0,0,0,0,0,0,0,0,0,0,7,4,0,7,7,4, /* 2x !"#$%&'()*+,-./ */
|
||||
7,7,7,7,7,7,7,7,7,7,0,0,0,0,0,0, /* 3x 0123456789:;<=>? */
|
||||
0,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, /* 4x @ABCDEFGHIJKLMNO */
|
||||
/* bits for '@' changed from 7 to 0 so '@' can be escaped */
|
||||
/* in usernames and passwords in publishing. */
|
||||
7,7,7,7,7,7,7,7,7,7,7,0,0,0,0,7, /* 5X PQRSTUVWXYZ[\]^_ */
|
||||
0,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, /* 6x `abcdefghijklmno */
|
||||
7,7,7,7,7,7,7,7,7,7,7,0,0,0,0,0, /* 7X pqrstuvwxyz{\}~ DEL */
|
||||
0, };
|
||||
|
||||
/* decode % escaped hex codes into character values
|
||||
*/
|
||||
#define UNHEX(C) \
|
||||
((C >= '0' && C <= '9') ? C - '0' : \
|
||||
((C >= 'A' && C <= 'F') ? C - 'A' + 10 : \
|
||||
((C >= 'a' && C <= 'f') ? C - 'a' + 10 : 0)))
|
||||
|
||||
|
||||
#define IS_OK(C) (netCharType[((unsigned int) (C))] & (mask))
|
||||
#define HEX_ESCAPE '%'
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
NS_BASE char* nsEscape(const char * str, nsEscapeMask mask)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
if(!str)
|
||||
return NULL;
|
||||
return nsEscapeCount(str, (PRInt32)PL_strlen(str), mask, NULL);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
NS_BASE char* nsEscapeCount(const char * str, PRInt32 len, nsEscapeMask mask, PRInt32 * out_len)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
int32 i, extra = 0;
|
||||
char *hexChars = "0123456789ABCDEF";
|
||||
|
||||
if(!str)
|
||||
return(0);
|
||||
|
||||
register const unsigned char* src = (unsigned char *) str;
|
||||
for (i = 0; i < len; i++)
|
||||
{
|
||||
if (!IS_OK(src[i]))
|
||||
extra+=2; /* the escape, plus an extra byte for each nibble */
|
||||
}
|
||||
|
||||
char* result = new char[len + extra + 1];
|
||||
if (!result)
|
||||
return(0);
|
||||
|
||||
register unsigned char* dst = (unsigned char *) result;
|
||||
for (i = 0; i < len; i++)
|
||||
{
|
||||
unsigned char c = src[i];
|
||||
if (IS_OK(c))
|
||||
{
|
||||
*dst++ = c;
|
||||
}
|
||||
else if (mask == url_XPAlphas && c == ' ')
|
||||
{
|
||||
*dst++ = '+'; /* convert spaces to pluses */
|
||||
}
|
||||
else
|
||||
{
|
||||
*dst++ = HEX_ESCAPE;
|
||||
*dst++ = hexChars[c >> 4]; /* high nibble */
|
||||
*dst++ = hexChars[c & 0x0f]; /* low nibble */
|
||||
}
|
||||
}
|
||||
|
||||
*dst = '\0'; /* tack on eos */
|
||||
if(out_len)
|
||||
*out_len = dst - (unsigned char *) result;
|
||||
return result;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
NS_BASE char* nsUnescape(char * str)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
nsUnescapeCount(str);
|
||||
return str;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
NS_BASE PRInt32 nsUnescapeCount(char * str)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
register char *src = str;
|
||||
register char *dst = str;
|
||||
|
||||
while (*src)
|
||||
if (*src != HEX_ESCAPE)
|
||||
{
|
||||
*dst++ = *src++;
|
||||
}
|
||||
else
|
||||
{
|
||||
src++; /* walk over escape */
|
||||
if (*src)
|
||||
{
|
||||
*dst = UNHEX(*src) << 4;
|
||||
src++;
|
||||
}
|
||||
if (*src)
|
||||
{
|
||||
*dst = (*dst + UNHEX(*src));
|
||||
src++;
|
||||
}
|
||||
dst++;
|
||||
}
|
||||
|
||||
*dst = 0;
|
||||
|
||||
return (int)(dst - str);
|
||||
|
||||
} /* NET_UnEscapeCnt */
|
||||
|
||||
889
mozilla/base/src/nsFileSpec.cpp
Normal file
889
mozilla/base/src/nsFileSpec.cpp
Normal file
@@ -0,0 +1,889 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
#include "nsFileSpec.h"
|
||||
|
||||
#include "nsFileStream.h"
|
||||
#include "nsDebug.h"
|
||||
|
||||
#include "prtypes.h"
|
||||
#include "plstr.h"
|
||||
#include "plbase64.h"
|
||||
#include "prmem.h"
|
||||
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
//========================================================================================
|
||||
NS_NAMESPACE nsFileSpecHelpers
|
||||
//========================================================================================
|
||||
{
|
||||
enum
|
||||
{ kMaxFilenameLength = 31 // should work on Macintosh, Unix, and Win32.
|
||||
, kMaxAltDigitLength = 5
|
||||
, kMaxCoreLeafNameLength = (kMaxFilenameLength - (kMaxAltDigitLength + 1))
|
||||
};
|
||||
NS_NAMESPACE_PROTOTYPE void LeafReplace(
|
||||
char*& ioPath,
|
||||
char inSeparator,
|
||||
const char* inLeafName);
|
||||
#ifndef XP_MAC
|
||||
NS_NAMESPACE_PROTOTYPE void Canonify(char*& ioPath, PRBool inMakeDirs);
|
||||
NS_NAMESPACE_PROTOTYPE void MakeAllDirectories(const char* inPath, int mode);
|
||||
#endif
|
||||
NS_NAMESPACE_PROTOTYPE char* GetLeaf(const char* inPath, char inSeparator); // allocated
|
||||
NS_NAMESPACE_PROTOTYPE char* StringDup(const char* inString, int allocLength = 0);
|
||||
NS_NAMESPACE_PROTOTYPE char* AllocCat(const char* inString1, const char* inString2);
|
||||
NS_NAMESPACE_PROTOTYPE char* StringAssign(char*& ioString, const char* inOther);
|
||||
NS_NAMESPACE_PROTOTYPE char* ReallocCat(char*& ioString, const char* inString1);
|
||||
#ifdef XP_PC
|
||||
NS_NAMESPACE_PROTOTYPE void NativeToUnix(char*& ioPath);
|
||||
NS_NAMESPACE_PROTOTYPE void UnixToNative(char*& ioPath);
|
||||
#endif
|
||||
} NS_NAMESPACE_END
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
nsresult ns_file_convert_result(PRInt32 nativeErr)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
return nativeErr ?
|
||||
NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_FILES,((nativeErr)&0xFFFF))
|
||||
: NS_OK;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
char* nsFileSpecHelpers::StringDup(
|
||||
const char* inString,
|
||||
int allocLength)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
if (!allocLength && inString)
|
||||
allocLength = strlen(inString);
|
||||
char* newPath = inString || allocLength ? new char[allocLength + 1] : nsnull;
|
||||
if (!newPath)
|
||||
return nsnull;
|
||||
strcpy(newPath, inString);
|
||||
return newPath;
|
||||
} // nsFileSpecHelpers::StringDup
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
char* nsFileSpecHelpers::AllocCat(
|
||||
const char* inString1,
|
||||
const char* inString2)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
if (!inString1)
|
||||
return inString2 ? StringDup(inString2) : (char*)nsnull;
|
||||
if (!inString2)
|
||||
return StringDup(inString1);
|
||||
char* outString = StringDup(inString1, strlen(inString1) + strlen(inString2));
|
||||
if (outString)
|
||||
strcat(outString, inString2);
|
||||
return outString;
|
||||
} // nsFileSpecHelpers::StringDup
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
char* nsFileSpecHelpers::StringAssign(
|
||||
char*& ioString,
|
||||
const char* inString2)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
if (!inString2)
|
||||
{
|
||||
delete [] ioString;
|
||||
ioString = (char*)nsnull;
|
||||
return ioString;
|
||||
}
|
||||
if (!ioString || (strlen(inString2) > strlen(ioString)))
|
||||
{
|
||||
delete [] ioString;
|
||||
ioString = StringDup(inString2);
|
||||
return ioString;
|
||||
}
|
||||
strcpy(ioString, inString2);
|
||||
return ioString;
|
||||
} // nsFileSpecHelpers::StringAssign
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
void nsFileSpecHelpers::LeafReplace(
|
||||
char*& ioPath,
|
||||
char inSeparator,
|
||||
const char* inLeafName)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
// Find the existing leaf name
|
||||
if (!ioPath)
|
||||
return;
|
||||
if (!inLeafName)
|
||||
{
|
||||
*ioPath = '\0';
|
||||
return;
|
||||
}
|
||||
char* lastSeparator = strrchr(ioPath, inSeparator);
|
||||
int oldLength = strlen(ioPath);
|
||||
PRBool trailingSeparator = (lastSeparator + 1 == ioPath + oldLength);
|
||||
if (trailingSeparator)
|
||||
{
|
||||
*lastSeparator = '\0';
|
||||
lastSeparator = strrchr(ioPath, inSeparator);
|
||||
}
|
||||
if (lastSeparator)
|
||||
lastSeparator++; // point at the trailing string
|
||||
else
|
||||
lastSeparator = ioPath; // the full monty
|
||||
*lastSeparator = '\0'; // strip the current leaf name
|
||||
|
||||
int newLength = (lastSeparator - ioPath) + strlen(inLeafName) + int(trailingSeparator);
|
||||
if (newLength > oldLength)
|
||||
{
|
||||
char* newPath = StringDup(ioPath, newLength + 1);
|
||||
delete [] ioPath;
|
||||
ioPath = newPath;
|
||||
}
|
||||
strcat(ioPath, inLeafName);
|
||||
if (trailingSeparator)
|
||||
{
|
||||
// If the original ended in a slash, then the new one should, too.
|
||||
char sepStr[2] = "/";
|
||||
*sepStr = inSeparator;
|
||||
strcat(ioPath, sepStr);
|
||||
}
|
||||
} // nsFileSpecHelpers::LeafReplace
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
char* nsFileSpecHelpers::GetLeaf(const char* inPath, char inSeparator)
|
||||
// Returns a pointer to an allocated string representing the leaf.
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
if (!inPath)
|
||||
return nsnull;
|
||||
const char* lastSeparator = strrchr(inPath, inSeparator);
|
||||
|
||||
// If there was no separator, then return a copy of the caller's path.
|
||||
if (!lastSeparator)
|
||||
return StringDup(inPath);
|
||||
|
||||
// So there's at least one separator. What's just after it?
|
||||
// If the separator was not the last character, return the trailing string.
|
||||
const char* leafPointer = lastSeparator + 1;
|
||||
if (*leafPointer)
|
||||
return StringDup(leafPointer);
|
||||
|
||||
// So now, separator was the last character. Poke in a null instead.
|
||||
*(char*)lastSeparator = '\0'; // Should use const_cast, but Unix has old compiler.
|
||||
leafPointer = strrchr(inPath, inSeparator);
|
||||
char* result = leafPointer ? StringDup(leafPointer++) : StringDup(inPath);
|
||||
// Restore the poked null before returning.
|
||||
*(char*)lastSeparator = inSeparator;
|
||||
#ifdef XP_PC
|
||||
// If it's a drive letter use the colon notation.
|
||||
if (!leafPointer && strlen(result) == 2 && result[1] == '|')
|
||||
result[1] = ':';
|
||||
#endif
|
||||
return result;
|
||||
} // nsFileSpecHelpers::GetLeaf
|
||||
|
||||
#if defined(XP_UNIX) || defined(XP_PC)
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
void nsFileSpecHelpers::MakeAllDirectories(const char* inPath, int mode)
|
||||
// Make the path a valid one by creating all the intermediate directories. Does NOT
|
||||
// make the leaf into a directory. This should be a unix path.
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
if (!inPath)
|
||||
return;
|
||||
|
||||
char* pathCopy = nsFileSpecHelpers::StringDup( inPath );
|
||||
if (!pathCopy)
|
||||
return;
|
||||
|
||||
const char kSeparator = '/'; // I repeat: this should be a unix-style path.
|
||||
const int kSkipFirst = 1;
|
||||
|
||||
#ifdef XP_PC
|
||||
// Either this is a relative path, or we ensure that it has
|
||||
// a drive letter specifier.
|
||||
NS_ASSERTION( pathCopy[0] != '/' || pathCopy[2] == '|', "No drive letter!" );
|
||||
#endif
|
||||
char* currentStart = pathCopy;
|
||||
char* currentEnd = strchr(currentStart + kSkipFirst, kSeparator);
|
||||
if (currentEnd)
|
||||
{
|
||||
*currentEnd = '\0';
|
||||
nsFileSpec spec(nsFilePath(pathCopy, PR_FALSE));
|
||||
do
|
||||
{
|
||||
// If the node doesn't exist, and it is not the initial node in a full path,
|
||||
// then make a directory (We cannot make the initial (volume) node).
|
||||
if (!spec.Exists() && *currentStart != kSeparator)
|
||||
spec.CreateDirectory(mode);
|
||||
if (!spec.Exists())
|
||||
{
|
||||
NS_ASSERTION(spec.Exists(), "Could not create the directory?");
|
||||
break;
|
||||
}
|
||||
currentStart = ++currentEnd;
|
||||
currentEnd = strchr(currentStart, kSeparator);
|
||||
if (!currentEnd)
|
||||
break;
|
||||
spec += currentStart; // "lengthen" the path, adding the next node.
|
||||
} while (currentEnd);
|
||||
}
|
||||
delete [] pathCopy;
|
||||
} // nsFileSpecHelpers::MakeAllDirectories
|
||||
|
||||
#endif // XP_PC || XP_UNIX
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
char* nsFileSpecHelpers::ReallocCat(char*& ioString, const char* inString1)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
char* newString = AllocCat(ioString, inString1);
|
||||
delete [] ioString;
|
||||
ioString = newString;
|
||||
return ioString;
|
||||
} // nsFileSpecHelpers::ReallocCat
|
||||
|
||||
#if defined(XP_PC)
|
||||
#include "windows/nsFileSpecWin.cpp" // Windows-specific implementations
|
||||
#elif defined(XP_MAC)
|
||||
#include "nsFileSpecMac.cpp" // Macintosh-specific implementations
|
||||
#elif defined(XP_UNIX)
|
||||
#include "unix/nsFileSpecUnix.cpp" // Unix-specific implementations
|
||||
#endif
|
||||
|
||||
//========================================================================================
|
||||
// nsFileURL implementation
|
||||
//========================================================================================
|
||||
|
||||
#ifndef XP_MAC
|
||||
//----------------------------------------------------------------------------------------
|
||||
nsFileURL::nsFileURL(const char* inString, PRBool inCreateDirs)
|
||||
//----------------------------------------------------------------------------------------
|
||||
: mURL(nsnull)
|
||||
{
|
||||
if (!inString)
|
||||
return;
|
||||
NS_ASSERTION(strstr(inString, kFileURLPrefix) == inString, "Not a URL!");
|
||||
// Make canonical and absolute.
|
||||
nsFilePath path(inString + kFileURLPrefixLength, inCreateDirs);
|
||||
*this = path;
|
||||
} // nsFileURL::nsFileURL
|
||||
#endif
|
||||
|
||||
#ifndef XP_MAC
|
||||
//----------------------------------------------------------------------------------------
|
||||
nsFileURL::nsFileURL(const nsString& inString, PRBool inCreateDirs)
|
||||
//----------------------------------------------------------------------------------------
|
||||
: mURL(nsnull)
|
||||
{
|
||||
const nsAutoCString aString(inString);
|
||||
const char* aCString = (const char*) aString;
|
||||
if (!inString)
|
||||
return;
|
||||
NS_ASSERTION(strstr(aCString, kFileURLPrefix) == aCString, "Not a URL!");
|
||||
// Make canonical and absolute.
|
||||
nsFilePath path(aCString + kFileURLPrefixLength, inCreateDirs);
|
||||
*this = path;
|
||||
} // nsFileURL::nsFileURL
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
nsFileURL::nsFileURL(const nsFileURL& inOther)
|
||||
//----------------------------------------------------------------------------------------
|
||||
: mURL(nsFileSpecHelpers::StringDup(inOther.mURL))
|
||||
#ifdef XP_MAC
|
||||
, mFileSpec(inOther.GetFileSpec())
|
||||
#endif
|
||||
{
|
||||
} // nsFileURL::nsFileURL
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
nsFileURL::nsFileURL(const nsFilePath& inOther)
|
||||
//----------------------------------------------------------------------------------------
|
||||
: mURL(nsFileSpecHelpers::AllocCat(kFileURLPrefix, (const char*)inOther))
|
||||
#ifdef XP_MAC
|
||||
, mFileSpec(inOther.GetFileSpec())
|
||||
#endif
|
||||
{
|
||||
} // nsFileURL::nsFileURL
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
nsFileURL::nsFileURL(const nsFileSpec& inOther)
|
||||
: mURL(nsFileSpecHelpers::AllocCat(kFileURLPrefix, (const char*)nsFilePath(inOther)))
|
||||
#ifdef XP_MAC
|
||||
, mFileSpec(inOther)
|
||||
#endif
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
} // nsFileURL::nsFileURL
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
nsFileURL::~nsFileURL()
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
delete [] mURL;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
void nsFileURL::operator = (const char* inString)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
nsFileSpecHelpers::StringAssign(mURL, inString);
|
||||
NS_ASSERTION(strstr(inString, kFileURLPrefix) == inString, "Not a URL!");
|
||||
#ifdef XP_MAC
|
||||
mFileSpec = inString + kFileURLPrefixLength;
|
||||
#endif
|
||||
} // nsFileURL::operator =
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
void nsFileURL::operator = (const nsFileURL& inOther)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
mURL = nsFileSpecHelpers::StringAssign(mURL, inOther.mURL);
|
||||
#ifdef XP_MAC
|
||||
mFileSpec = inOther.GetFileSpec();
|
||||
#endif
|
||||
} // nsFileURL::operator =
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
void nsFileURL::operator = (const nsFilePath& inOther)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
delete [] mURL;
|
||||
mURL = nsFileSpecHelpers::AllocCat(kFileURLPrefix, (const char*)inOther);
|
||||
#ifdef XP_MAC
|
||||
mFileSpec = inOther.GetFileSpec();
|
||||
#endif
|
||||
} // nsFileURL::operator =
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
void nsFileURL::operator = (const nsFileSpec& inOther)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
delete [] mURL;
|
||||
mURL = nsFileSpecHelpers::AllocCat(kFileURLPrefix, (const char*)nsFilePath(inOther));
|
||||
#ifdef XP_MAC
|
||||
mFileSpec = inOther;
|
||||
#endif
|
||||
} // nsFileURL::operator =
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
nsOutputStream& operator << (nsOutputStream& s, const nsFileURL& url)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
return (s << url.mURL);
|
||||
}
|
||||
|
||||
//========================================================================================
|
||||
// nsFilePath implementation
|
||||
//========================================================================================
|
||||
|
||||
nsFilePath::nsFilePath(const nsFilePath& inPath)
|
||||
: mPath(nsFileSpecHelpers::StringDup(inPath.mPath))
|
||||
#ifdef XP_MAC
|
||||
, mFileSpec(inPath.mFileSpec)
|
||||
#endif
|
||||
{
|
||||
}
|
||||
|
||||
#ifndef XP_MAC
|
||||
//----------------------------------------------------------------------------------------
|
||||
nsFilePath::nsFilePath(const char* inString, PRBool inCreateDirs)
|
||||
//----------------------------------------------------------------------------------------
|
||||
: mPath(nsFileSpecHelpers::StringDup(inString))
|
||||
{
|
||||
NS_ASSERTION(strstr(inString, kFileURLPrefix) != inString, "URL passed as path");
|
||||
|
||||
#ifdef XP_PC
|
||||
nsFileSpecHelpers::UnixToNative(mPath);
|
||||
#endif
|
||||
// Make canonical and absolute.
|
||||
nsFileSpecHelpers::Canonify(mPath, inCreateDirs);
|
||||
#ifdef XP_PC
|
||||
NS_ASSERTION( mPath[1] == ':', "unexpected canonical path" );
|
||||
nsFileSpecHelpers::NativeToUnix(mPath);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef XP_MAC
|
||||
//----------------------------------------------------------------------------------------
|
||||
nsFilePath::nsFilePath(const nsString& inString, PRBool inCreateDirs)
|
||||
//----------------------------------------------------------------------------------------
|
||||
: mPath(inString.ToNewCString())
|
||||
{
|
||||
NS_ASSERTION(strstr(mPath, kFileURLPrefix) != mPath, "URL passed as path");
|
||||
|
||||
#ifdef XP_PC
|
||||
nsFileSpecHelpers::UnixToNative(mPath);
|
||||
#endif
|
||||
// Make canonical and absolute.
|
||||
nsFileSpecHelpers::Canonify(mPath, inCreateDirs);
|
||||
#ifdef XP_PC
|
||||
NS_ASSERTION( mPath[1] == ':', "unexpected canonical path" );
|
||||
nsFileSpecHelpers::NativeToUnix(mPath);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
nsFilePath::nsFilePath(const nsFileURL& inOther)
|
||||
//----------------------------------------------------------------------------------------
|
||||
: mPath(nsFileSpecHelpers::StringDup(inOther.mURL + kFileURLPrefixLength))
|
||||
#ifdef XP_MAC
|
||||
, mFileSpec(inOther.GetFileSpec())
|
||||
#endif
|
||||
{
|
||||
}
|
||||
|
||||
#ifdef XP_UNIX
|
||||
//----------------------------------------------------------------------------------------
|
||||
nsFilePath::nsFilePath(const nsFileSpec& inOther)
|
||||
//----------------------------------------------------------------------------------------
|
||||
: mPath(nsFileSpecHelpers::StringDup(inOther.mPath))
|
||||
{
|
||||
}
|
||||
#endif // XP_UNIX
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
nsFilePath::~nsFilePath()
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
delete [] mPath;
|
||||
}
|
||||
|
||||
#ifdef XP_UNIX
|
||||
//----------------------------------------------------------------------------------------
|
||||
void nsFilePath::operator = (const nsFileSpec& inOther)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
mPath = nsFileSpecHelpers::StringAssign(mPath, inOther.mPath);
|
||||
}
|
||||
#endif // XP_UNIX
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
void nsFilePath::operator = (const char* inString)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
NS_ASSERTION(strstr(inString, kFileURLPrefix) != inString, "URL passed as path");
|
||||
#ifdef XP_MAC
|
||||
mFileSpec = inString;
|
||||
nsFileSpecHelpers::StringAssign(mPath, (const char*)nsFilePath(mFileSpec));
|
||||
#else
|
||||
nsFileSpecHelpers::StringAssign(mPath, inString);
|
||||
#ifdef XP_PC
|
||||
nsFileSpecHelpers::UnixToNative(mPath);
|
||||
#endif
|
||||
// Make canonical and absolute.
|
||||
nsFileSpecHelpers::Canonify(mPath, PR_FALSE /* XXX? */);
|
||||
#ifdef XP_PC
|
||||
nsFileSpecHelpers::NativeToUnix(mPath);
|
||||
#endif
|
||||
#endif // XP_MAC
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
void nsFilePath::operator = (const nsFileURL& inOther)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
nsFileSpecHelpers::StringAssign(mPath, (const char*)nsFilePath(inOther));
|
||||
#ifdef XP_MAC
|
||||
mFileSpec = inOther.GetFileSpec();
|
||||
#endif
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
void nsFilePath::operator = (const nsFilePath& inOther)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
nsFileSpecHelpers::StringAssign(mPath, inOther.mPath);
|
||||
#ifdef XP_MAC
|
||||
mFileSpec = inOther.GetFileSpec();
|
||||
#endif
|
||||
}
|
||||
|
||||
//========================================================================================
|
||||
// nsFileSpec implementation
|
||||
//========================================================================================
|
||||
|
||||
#ifndef XP_MAC
|
||||
//----------------------------------------------------------------------------------------
|
||||
nsFileSpec::nsFileSpec()
|
||||
//----------------------------------------------------------------------------------------
|
||||
: mPath(nsnull)
|
||||
, mError(NS_OK)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
nsFileSpec::nsFileSpec(const nsPersistentFileDescriptor& inDescriptor)
|
||||
//----------------------------------------------------------------------------------------
|
||||
#ifndef XP_MAC
|
||||
: mPath(nsnull)
|
||||
#endif
|
||||
{
|
||||
*this = inDescriptor;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
nsFileSpec::nsFileSpec(const nsFileURL& inURL)
|
||||
//----------------------------------------------------------------------------------------
|
||||
#ifndef XP_MAC
|
||||
: mPath(nsnull)
|
||||
#endif
|
||||
{
|
||||
*this = nsFilePath(inURL); // convert to unix path first
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
void nsFileSpec::MakeUnique(const char* inSuggestedLeafName)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
if (inSuggestedLeafName && *inSuggestedLeafName)
|
||||
SetLeafName(inSuggestedLeafName);
|
||||
|
||||
MakeUnique();
|
||||
} // nsFileSpec::MakeUnique
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
void nsFileSpec::MakeUnique()
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
if (!Exists())
|
||||
return;
|
||||
|
||||
char* leafName = GetLeafName();
|
||||
if (!leafName)
|
||||
return;
|
||||
|
||||
char* lastDot = strrchr(leafName, '.');
|
||||
char* suffix = "";
|
||||
if (lastDot)
|
||||
{
|
||||
suffix = nsFileSpecHelpers::StringDup(lastDot); // include '.'
|
||||
*lastDot = '\0'; // strip suffix and dot.
|
||||
}
|
||||
const int kMaxRootLength
|
||||
= nsFileSpecHelpers::kMaxCoreLeafNameLength - strlen(suffix) - 1;
|
||||
if ((int)strlen(leafName) > (int)kMaxRootLength)
|
||||
leafName[kMaxRootLength] = '\0';
|
||||
for (short index = 1; index < 1000 && Exists(); index++)
|
||||
{
|
||||
// start with "Picture-1.jpg" after "Picture.jpg" exists
|
||||
char newName[nsFileSpecHelpers::kMaxFilenameLength + 1];
|
||||
sprintf(newName, "%s-%d%s", leafName, index, suffix);
|
||||
SetLeafName(newName);
|
||||
}
|
||||
if (*suffix)
|
||||
delete [] suffix;
|
||||
delete [] leafName;
|
||||
} // nsFileSpec::MakeUnique
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
void nsFileSpec::operator = (const nsFileURL& inURL)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
*this = nsFilePath(inURL); // convert to unix path first
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
void nsFileSpec::operator = (const nsPersistentFileDescriptor& inDescriptor)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
|
||||
void* data;
|
||||
PRInt32 dataSize;
|
||||
inDescriptor.GetData(data, dataSize);
|
||||
|
||||
#ifdef XP_MAC
|
||||
char* decodedData = PL_Base64Decode((const char*)data, (int)dataSize, nsnull);
|
||||
// Cast to an alias record and resolve.
|
||||
AliasHandle aliasH = nsnull;
|
||||
mError = NS_FILE_RESULT(PtrToHand(decodedData, &(Handle)aliasH, (dataSize * 3) / 4));
|
||||
PR_Free(decodedData);
|
||||
if (NS_SUCCEEDED(mError))
|
||||
return; // not enough memory?
|
||||
|
||||
Boolean changed;
|
||||
mError = NS_FILE_RESULT(::ResolveAlias(nsnull, aliasH, &mSpec, &changed));
|
||||
DisposeHandle((Handle) aliasH);
|
||||
#else
|
||||
nsFileSpecHelpers::StringAssign(mPath, (char*)data);
|
||||
mError = NS_OK;
|
||||
#endif
|
||||
}
|
||||
|
||||
//========================================================================================
|
||||
// UNIX & WIN nsFileSpec implementation
|
||||
//========================================================================================
|
||||
|
||||
#ifdef XP_UNIX
|
||||
//----------------------------------------------------------------------------------------
|
||||
nsFileSpec::nsFileSpec(const nsFilePath& inPath)
|
||||
//----------------------------------------------------------------------------------------
|
||||
: mPath(nsFileSpecHelpers::StringDup((const char*)inPath))
|
||||
, mError(NS_OK)
|
||||
{
|
||||
}
|
||||
#endif // XP_UNIX
|
||||
|
||||
#ifdef XP_UNIX
|
||||
//----------------------------------------------------------------------------------------
|
||||
void nsFileSpec::operator = (const nsFilePath& inPath)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
nsFileSpecHelpers::StringAssign(mPath, (const char*)inPath);
|
||||
mError = NS_OK;
|
||||
}
|
||||
#endif //XP_UNIX
|
||||
|
||||
#if defined(XP_UNIX) || defined(XP_PC)
|
||||
//----------------------------------------------------------------------------------------
|
||||
nsFileSpec::nsFileSpec(const nsFileSpec& inSpec)
|
||||
//----------------------------------------------------------------------------------------
|
||||
: mPath(nsFileSpecHelpers::StringDup(inSpec.mPath))
|
||||
, mError(NS_OK)
|
||||
{
|
||||
}
|
||||
#endif //XP_UNIX
|
||||
|
||||
#if defined(XP_UNIX) || defined(XP_PC)
|
||||
//----------------------------------------------------------------------------------------
|
||||
nsFileSpec::nsFileSpec(const char* inString, PRBool inCreateDirs)
|
||||
//----------------------------------------------------------------------------------------
|
||||
: mPath(nsFileSpecHelpers::StringDup(inString))
|
||||
, mError(NS_OK)
|
||||
{
|
||||
// Make canonical and absolute.
|
||||
nsFileSpecHelpers::Canonify(mPath, inCreateDirs);
|
||||
}
|
||||
#endif //XP_UNIX,PC
|
||||
|
||||
#if defined(XP_UNIX) || defined(XP_PC)
|
||||
//----------------------------------------------------------------------------------------
|
||||
nsFileSpec::nsFileSpec(const nsString& inString, PRBool inCreateDirs)
|
||||
//----------------------------------------------------------------------------------------
|
||||
: mPath(inString.ToNewCString())
|
||||
, mError(NS_OK)
|
||||
{
|
||||
// Make canonical and absolute.
|
||||
nsFileSpecHelpers::Canonify(mPath, inCreateDirs);
|
||||
}
|
||||
#endif //XP_UNIX,PC
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
nsFileSpec::~nsFileSpec()
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
#ifndef XP_MAC
|
||||
delete [] mPath;
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined(XP_UNIX) || defined(XP_PC)
|
||||
//----------------------------------------------------------------------------------------
|
||||
void nsFileSpec::operator = (const nsFileSpec& inSpec)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
mPath = nsFileSpecHelpers::StringAssign(mPath, inSpec.mPath);
|
||||
mError = inSpec.Error();
|
||||
}
|
||||
#endif //XP_UNIX
|
||||
|
||||
|
||||
#if defined(XP_UNIX) || defined(XP_PC)
|
||||
//----------------------------------------------------------------------------------------
|
||||
void nsFileSpec::operator = (const char* inString)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
mPath = nsFileSpecHelpers::StringAssign(mPath, inString);
|
||||
// Make canonical and absolute.
|
||||
nsFileSpecHelpers::Canonify(mPath, PR_TRUE /* XXX? */);
|
||||
mError = NS_OK;
|
||||
}
|
||||
#endif //XP_UNIX
|
||||
|
||||
#if (defined(XP_UNIX) || defined(XP_PC))
|
||||
//----------------------------------------------------------------------------------------
|
||||
nsOutputStream& operator << (nsOutputStream& s, const nsFileSpec& spec)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
return (s << (const char*)spec.mPath);
|
||||
}
|
||||
#endif // DEBUG && XP_UNIX
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
nsFileSpec nsFileSpec::operator + (const char* inRelativePath) const
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
nsFileSpec result = *this;
|
||||
result += inRelativePath;
|
||||
return result;
|
||||
} // nsFileSpec::operator +
|
||||
|
||||
//========================================================================================
|
||||
// class nsPersistentFileDescriptor
|
||||
//========================================================================================
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
nsPersistentFileDescriptor::nsPersistentFileDescriptor(const nsPersistentFileDescriptor& inDesc)
|
||||
//----------------------------------------------------------------------------------------
|
||||
: mDescriptorString(nsFileSpecHelpers::StringDup(inDesc.mDescriptorString))
|
||||
{
|
||||
} // nsPersistentFileDescriptor::nsPersistentFileDescriptor
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
void nsPersistentFileDescriptor::operator = (const nsPersistentFileDescriptor& inDesc)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
nsFileSpecHelpers::StringAssign(mDescriptorString, inDesc.mDescriptorString);
|
||||
} // nsPersistentFileDescriptor::operator =
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
nsPersistentFileDescriptor::nsPersistentFileDescriptor(const nsFileSpec& inSpec)
|
||||
//----------------------------------------------------------------------------------------
|
||||
: mDescriptorString(nsnull)
|
||||
{
|
||||
*this = inSpec;
|
||||
} // nsPersistentFileDescriptor::nsPersistentFileDescriptor
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
void nsPersistentFileDescriptor::operator = (const nsFileSpec& inSpec)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
#ifdef XP_MAC
|
||||
if (inSpec.Error())
|
||||
return;
|
||||
AliasHandle aliasH;
|
||||
/*
|
||||
This is killing the tree. mcmullen will need to look at this.
|
||||
|
||||
OSErr err = NewAlias(nil, inSpec.operator const FSSpec* const (), &aliasH);
|
||||
if (err != noErr)
|
||||
return;
|
||||
*/
|
||||
|
||||
PRUint32 bytes = GetHandleSize((Handle) aliasH);
|
||||
HLock((Handle) aliasH);
|
||||
char* buf = PL_Base64Encode((const char*)*aliasH, bytes, nsnull);
|
||||
DisposeHandle((Handle) aliasH);
|
||||
|
||||
nsFileSpecHelpers::StringAssign(mDescriptorString, buf);
|
||||
PR_Free(buf);
|
||||
#else
|
||||
nsFileSpecHelpers::StringAssign(mDescriptorString, inSpec);
|
||||
#endif // XP_MAC
|
||||
} // nsPersistentFileDescriptor::operator =
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
nsPersistentFileDescriptor::~nsPersistentFileDescriptor()
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
delete [] mDescriptorString;
|
||||
} // nsPersistentFileDescriptor::~nsPersistentFileDescriptor
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
void nsPersistentFileDescriptor::GetData(void*& outData, PRInt32& outSize) const
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
outSize = PL_strlen(mDescriptorString);
|
||||
outData = mDescriptorString;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
void nsPersistentFileDescriptor::SetData(const void* inData, PRInt32 inSize)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
delete [] mDescriptorString;
|
||||
mDescriptorString = new char[1 + inSize];
|
||||
if (!mDescriptorString)
|
||||
return;
|
||||
memcpy(mDescriptorString, inData, inSize);
|
||||
mDescriptorString[inSize] = '\0';
|
||||
}
|
||||
|
||||
#define MAX_PERSISTENT_DATA_SIZE 1000
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
nsresult nsPersistentFileDescriptor::Read(nsIInputStream* aStream)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
nsInputStream(aStream) >> *this;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
nsresult nsPersistentFileDescriptor::Write(nsIOutputStream* aStream)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
nsOutputStream(aStream) << *this;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
nsInputStream& operator >> (nsInputStream& s, nsPersistentFileDescriptor& d)
|
||||
// reads the data from a file
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
char bigBuffer[MAX_PERSISTENT_DATA_SIZE + 1];
|
||||
// The first 8 bytes of the data should be a hex version of the data size to follow.
|
||||
PRInt32 bytesRead = 8;
|
||||
bytesRead = s.read(bigBuffer, bytesRead);
|
||||
if (bytesRead != 8)
|
||||
return s;
|
||||
bigBuffer[8] = '\0';
|
||||
sscanf(bigBuffer, "%lx", &bytesRead);
|
||||
if (bytesRead > MAX_PERSISTENT_DATA_SIZE)
|
||||
return s; // preposterous.
|
||||
// Now we know how many bytes to read, do it.
|
||||
s.read(bigBuffer, bytesRead);
|
||||
d.SetData(bigBuffer, bytesRead);
|
||||
return s;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
nsOutputStream& operator << (nsOutputStream& s, const nsPersistentFileDescriptor& d)
|
||||
// writes the data to a file
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
char littleBuf[9];
|
||||
PRInt32 dataSize;
|
||||
void* data;
|
||||
d.GetData(data, dataSize);
|
||||
// First write (in hex) the length of the data to follow. Exactly 8 bytes
|
||||
sprintf(littleBuf, "%0.8x", dataSize);
|
||||
s << littleBuf;
|
||||
// Now write the data itself
|
||||
s << d.mDescriptorString;
|
||||
return s;
|
||||
}
|
||||
|
||||
//========================================================================================
|
||||
// class nsAutoCString
|
||||
//========================================================================================
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
nsAutoCString::~nsAutoCString()
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
delete [] (char*)mCString;
|
||||
}
|
||||
201
mozilla/base/src/nsFileStream.cpp
Normal file
201
mozilla/base/src/nsFileStream.cpp
Normal file
@@ -0,0 +1,201 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
// First checked in on 98/12/08 by John R. McMullen.
|
||||
// Since nsFileStream.h is entirely templates, common code (such as open())
|
||||
// which does not actually depend on the charT, can be placed here.
|
||||
|
||||
#include "nsFileStream.h"
|
||||
|
||||
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
//========================================================================================
|
||||
// nsInputStream
|
||||
//========================================================================================
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
nsInputStream::~nsInputStream()
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
char nsInputStream::get()
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
char c;
|
||||
read(&c, sizeof(c));
|
||||
return c;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
static void TidyEndOfLine(char*& cp)
|
||||
// Assumes that cp is pointing at \n or \r. Nulls out the character, checks for
|
||||
// a second terminator (of the opposite persuasion), and returns cp pointing past the
|
||||
// entire eol construct (one or two characters).
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
char ch = *cp;
|
||||
*cp++ = '\0'; // terminate at the newline, then skip past it
|
||||
if ((ch == '\n' && *cp == '\r') || (ch == '\r' && *cp == '\n'))
|
||||
cp++; // possibly a pair.
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
nsInputStream& nsInputStream::operator >> (char& c)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
c = get();
|
||||
return *this;
|
||||
}
|
||||
|
||||
//========================================================================================
|
||||
// nsOutputStream
|
||||
//========================================================================================
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
nsOutputStream::~nsOutputStream()
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
void nsOutputStream::put(char c)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
write(&c, sizeof(c));
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
void nsOutputStream::flush()
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
nsOutputStream& nsOutputStream::operator << (char c)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
put(c);
|
||||
return *this;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
nsOutputStream& nsOutputStream::operator << (const char* s)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
write(s, strlen(s));
|
||||
return *this;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
nsOutputStream& nsOutputStream::operator << (short val)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
char buf[30];
|
||||
sprintf(buf, "%d", val);
|
||||
return (*this << buf);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
nsOutputStream& nsOutputStream::operator << (unsigned short val)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
char buf[30];
|
||||
sprintf(buf, "%ud", val);
|
||||
return (*this << buf);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
nsOutputStream& nsOutputStream::operator << (long val)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
char buf[30];
|
||||
sprintf(buf, "%ld", val);
|
||||
return (*this << buf);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
nsOutputStream& nsOutputStream::operator << (unsigned long val)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
char buf[30];
|
||||
sprintf(buf, "%uld", val);
|
||||
return (*this << buf);
|
||||
}
|
||||
|
||||
//========================================================================================
|
||||
// nsInputFileStream
|
||||
//========================================================================================
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
PRBool nsInputFileStream::readline(char* s, PRInt32 n)
|
||||
// This will truncate if the buffer is too small. Result will always be null-terminated.
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
PRBool bufferLargeEnough = PR_TRUE; // result
|
||||
if (!s || !n)
|
||||
return PR_TRUE;
|
||||
|
||||
PRIntn position = tell();
|
||||
if (position < 0)
|
||||
return PR_FALSE;
|
||||
PRInt32 bytesRead = read(s, n - 1);
|
||||
if (failed())
|
||||
return PR_FALSE;
|
||||
s[bytesRead] = '\0'; // always terminate at the end of the buffer
|
||||
char* tp = strpbrk(s, "\n\r");
|
||||
if (tp)
|
||||
{
|
||||
TidyEndOfLine(tp);
|
||||
bytesRead = (tp - s);
|
||||
}
|
||||
else if (!eof())
|
||||
bufferLargeEnough = PR_FALSE;
|
||||
position += bytesRead;
|
||||
seek(position);
|
||||
return bufferLargeEnough;
|
||||
} // nsInputStream::readline
|
||||
|
||||
//========================================================================================
|
||||
// nsOutputFileStream
|
||||
//========================================================================================
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
void nsOutputFileStream::flush()
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
if (mFileOutputStream)
|
||||
mFileOutputStream->Flush();
|
||||
}
|
||||
|
||||
//========================================================================================
|
||||
// Manipulators
|
||||
//========================================================================================
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
nsOutputStream& nsEndl(nsOutputStream& os)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
os.put('\n');
|
||||
os.flush();
|
||||
return os;
|
||||
} // nsEndl
|
||||
22
mozilla/base/src/nsGenericCaretProperties.cpp
Normal file
22
mozilla/base/src/nsGenericCaretProperties.cpp
Normal file
@@ -0,0 +1,22 @@
|
||||
|
||||
|
||||
#include "nscore.h"
|
||||
|
||||
#include "nsCaretProperties.h"
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
nsCaretProperties::nsCaretProperties()
|
||||
: mCaretWidth(eDefaultCaretWidth)
|
||||
, mBlinkRate(eDefaulBlinkRate)
|
||||
{
|
||||
// in your platform-specific class, get data from the OS in your constructor
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
nsCaretProperties* NewCaretProperties()
|
||||
{
|
||||
return new nsCaretProperties();
|
||||
}
|
||||
51
mozilla/base/src/nsIArena.h
Normal file
51
mozilla/base/src/nsIArena.h
Normal file
@@ -0,0 +1,51 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
#ifndef nsIArena_h___
|
||||
#define nsIArena_h___
|
||||
|
||||
#include "nscore.h"
|
||||
#include "nsISupports.h"
|
||||
|
||||
#define NS_MIN_ARENA_BLOCK_SIZE 64
|
||||
#define NS_DEFAULT_ARENA_BLOCK_SIZE 4096
|
||||
|
||||
/// Interface IID for nsIArena
|
||||
#define NS_IARENA_IID \
|
||||
{ 0xa24fdad0, 0x93b4, 0x11d1, \
|
||||
{0x89, 0x5b, 0x00, 0x60, 0x08, 0x91, 0x1b, 0x81} }
|
||||
|
||||
/** Interface to a memory arena abstraction. Arena's use large blocks
|
||||
* of memory to allocate smaller objects. Arena's provide no free
|
||||
* operator; instead, all of the objects in the arena are deallocated
|
||||
* by deallocating the arena (e.g. when it's reference count goes to
|
||||
* zero)
|
||||
*/
|
||||
class nsIArena : public nsISupports {
|
||||
public:
|
||||
virtual void* Alloc(PRInt32 size) = 0;
|
||||
};
|
||||
|
||||
/**
|
||||
* Create a new arena using the desired block size for allocating the
|
||||
* underlying memory blocks. The underlying memory blocks are allocated
|
||||
* using the PR heap.
|
||||
*/
|
||||
extern NS_BASE nsresult NS_NewHeapArena(nsIArena** aInstancePtrResult,
|
||||
PRInt32 aArenaBlockSize = 0);
|
||||
|
||||
#endif /* nsIArena_h___ */
|
||||
79
mozilla/base/src/nsIAtom.h
Normal file
79
mozilla/base/src/nsIAtom.h
Normal file
@@ -0,0 +1,79 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
#ifndef nsIAtom_h___
|
||||
#define nsIAtom_h___
|
||||
|
||||
#include "nscore.h"
|
||||
#include "nsISupports.h"
|
||||
class nsString;
|
||||
class nsISizeOfHandler;
|
||||
|
||||
#define NS_IATOM_IID \
|
||||
{ 0x3d1b15b0, 0x93b4, 0x11d1, \
|
||||
{0x89, 0x5b, 0x00, 0x60, 0x08, 0x91, 0x1b, 0x81} }
|
||||
|
||||
/**
|
||||
* A globally unique identfier. nsIAtom's can be compared for
|
||||
* equality by using operator '=='. These objects are reference
|
||||
* counted like other nsISupports objects. When you are done with
|
||||
* the atom, NS_RELEASE it.
|
||||
*/
|
||||
class nsIAtom : public nsISupports {
|
||||
public:
|
||||
static const nsIID& IID() { static nsIID iid = NS_IATOM_IID; return iid; }
|
||||
|
||||
/**
|
||||
* Translate the unicode string into the stringbuf.
|
||||
*/
|
||||
virtual void ToString(nsString& aString) const = 0;
|
||||
|
||||
/**
|
||||
* Return a pointer to a zero terminated unicode string.
|
||||
*/
|
||||
virtual const PRUnichar* GetUnicode() const = 0;
|
||||
|
||||
/**
|
||||
* Add the size, in bytes, of the atom to the handler.
|
||||
*/
|
||||
NS_IMETHOD SizeOf(nsISizeOfHandler* aHandler) const = 0;
|
||||
};
|
||||
|
||||
/**
|
||||
* Find an atom that matches the given iso-latin1 C string. The
|
||||
* C string is translated into it's unicode equivalent.
|
||||
*/
|
||||
extern NS_BASE nsIAtom* NS_NewAtom(const char* isolatin1);
|
||||
|
||||
/**
|
||||
* Find an atom that matches the given unicode string. The string is assumed
|
||||
* to be zero terminated.
|
||||
*/
|
||||
extern NS_BASE nsIAtom* NS_NewAtom(const PRUnichar* unicode);
|
||||
|
||||
/**
|
||||
* Find an atom that matches the given string.
|
||||
*/
|
||||
extern NS_BASE nsIAtom* NS_NewAtom(const nsString& aString);
|
||||
|
||||
/**
|
||||
* Return a count of the total number of atoms currently
|
||||
* alive in the system.
|
||||
*/
|
||||
extern NS_BASE nsrefcnt NS_GetNumberOfAtoms(void);
|
||||
|
||||
#endif /* nsIAtom_h___ */
|
||||
58
mozilla/base/src/nsIBaseStream.h
Normal file
58
mozilla/base/src/nsIBaseStream.h
Normal file
@@ -0,0 +1,58 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
#ifndef nsIBaseStream_h___
|
||||
#define nsIBaseStream_h___
|
||||
|
||||
#include "nscore.h"
|
||||
#include "nsISupports.h"
|
||||
|
||||
|
||||
/* 6ccb17a0-e95e-11d1-beae-00805f8a66dc */
|
||||
#define NS_IBASESTREAM_IID \
|
||||
{ 0x6ccb17a0, 0xe95e, 0x11d1, \
|
||||
{0xbe, 0xae, 0x00, 0x80, 0x5f, 0x8a, 0x66, 0xdc} }
|
||||
|
||||
/** Abstract stream */
|
||||
class nsIBaseStream : public nsISupports {
|
||||
public:
|
||||
|
||||
static const nsIID& IID() { static nsIID iid = NS_IBASESTREAM_IID; return iid; }
|
||||
|
||||
/** Close the stream. */
|
||||
NS_IMETHOD
|
||||
Close(void) = 0;
|
||||
};
|
||||
|
||||
/** Error codes */
|
||||
//@{
|
||||
/// End of file
|
||||
#define NS_BASE_STREAM_EOF NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_BASE, 1)
|
||||
/// Stream closed
|
||||
#define NS_BASE_STREAM_CLOSED NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_BASE, 2)
|
||||
/// Error from the operating system
|
||||
#define NS_BASE_STREAM_OSERROR NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_BASE, 3)
|
||||
/// Illegal arguments
|
||||
#define NS_BASE_STREAM_ILLEGAL_ARGS NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_BASE, 4)
|
||||
/// For unichar streams
|
||||
#define NS_BASE_STREAM_NO_CONVERTER NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_BASE, 5)
|
||||
/// For unichar streams
|
||||
#define NS_BASE_STREAM_BAD_CONVERSION NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_BASE, 6)
|
||||
//@}
|
||||
|
||||
|
||||
#endif /* nsInputStream_h___ */
|
||||
57
mozilla/base/src/nsIByteBuffer.h
Normal file
57
mozilla/base/src/nsIByteBuffer.h
Normal file
@@ -0,0 +1,57 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
#ifndef nsIByteBuffer_h___
|
||||
#define nsIByteBuffer_h___
|
||||
|
||||
#include "nscore.h"
|
||||
#include "nsISupports.h"
|
||||
|
||||
class nsIInputStream;
|
||||
|
||||
#define NS_IBYTE_BUFFER_IID \
|
||||
{ 0xe4a6e4b0, 0x93b4, 0x11d1, \
|
||||
{0x89, 0x5b, 0x00, 0x60, 0x08, 0x91, 0x1b, 0x81} }
|
||||
|
||||
/** Interface to a buffer that holds bytes */
|
||||
class nsIByteBuffer : public nsISupports {
|
||||
public:
|
||||
/** @return length of buffer, i.e. how many bytes are currently in it. */
|
||||
virtual PRUint32 GetLength(void) const = 0;
|
||||
|
||||
/** @return number of bytes allocated in the buffer */
|
||||
virtual PRUint32 GetBufferSize(void) const = 0;
|
||||
|
||||
/** @return the buffer */
|
||||
virtual char* GetBuffer(void) const = 0;
|
||||
|
||||
/** Grow buffer to aNewSize bytes. */
|
||||
virtual PRBool Grow(PRUint32 aNewSize) = 0;
|
||||
|
||||
/** Fill the buffer with data from aStream. Don't grow the buffer, only
|
||||
* read until length of buffer equals buffer size. */
|
||||
virtual PRInt32 Fill(nsresult* aErrorCode, nsIInputStream* aStream,
|
||||
PRUint32 aKeep) = 0;
|
||||
};
|
||||
|
||||
/** Create a new byte buffer using the given buffer size. */
|
||||
extern NS_BASE nsresult NS_NewByteBuffer(nsIByteBuffer** aInstancePtrResult,
|
||||
nsISupports* aOuter,
|
||||
PRUint32 aBufferSize = 0);
|
||||
|
||||
#endif /* nsIByteBuffer_h___ */
|
||||
|
||||
462
mozilla/base/src/nsIFileStream.cpp
Normal file
462
mozilla/base/src/nsIFileStream.cpp
Normal file
@@ -0,0 +1,462 @@
|
||||
#include "nsIFileStream.h"
|
||||
#include "nsFileSpec.h"
|
||||
|
||||
#include "prerror.h"
|
||||
|
||||
#ifdef XP_MAC
|
||||
#include "pprio.h" // To get PR_ImportFile
|
||||
#else
|
||||
#include "prio.h"
|
||||
#endif
|
||||
|
||||
#ifdef XP_MAC
|
||||
#include <Errors.h>
|
||||
#include <iostream>
|
||||
#endif
|
||||
|
||||
//========================================================================================
|
||||
class FileImpl
|
||||
: public nsIOutputStream
|
||||
, public nsIInputStream
|
||||
, public nsIFileOutputStream
|
||||
, public nsIFileInputStream
|
||||
, public nsIFile
|
||||
//========================================================================================
|
||||
{
|
||||
public:
|
||||
FileImpl(PRFileDesc* inDesc)
|
||||
: mFileDesc(inDesc)
|
||||
, mFailed(PR_FALSE)
|
||||
, mEOF(PR_FALSE)
|
||||
, mLength(-1)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
}
|
||||
FileImpl(
|
||||
const nsFileSpec& inFile,
|
||||
int nsprMode,
|
||||
PRIntn accessMode)
|
||||
: mFileDesc(nsnull)
|
||||
, mFailed(PR_FALSE)
|
||||
, mEOF(PR_FALSE)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
Open(inFile, nsprMode, accessMode);
|
||||
}
|
||||
virtual ~FileImpl()
|
||||
{
|
||||
Close();
|
||||
}
|
||||
|
||||
// nsISupports interface
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
// nsIFile interface
|
||||
NS_IMETHOD Open(
|
||||
const nsFileSpec& inFile,
|
||||
int nsprMode,
|
||||
PRIntn accessMode);
|
||||
NS_IMETHOD Close();
|
||||
NS_IMETHOD Seek(PRSeekWhence whence, PRInt32 offset);
|
||||
|
||||
NS_IMETHOD GetIsOpen(PRBool* outOpen)
|
||||
{
|
||||
*outOpen = (mFileDesc != nsnull);
|
||||
return NS_OK;
|
||||
}
|
||||
NS_IMETHOD Tell(PRIntn* outWhere);
|
||||
|
||||
// nsIInputStream interface
|
||||
NS_IMETHOD GetLength(PRUint32 *aLength)
|
||||
{
|
||||
NS_PRECONDITION(aLength != nsnull, "null ptr");
|
||||
if (!aLength)
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
if (mLength < 0)
|
||||
return NS_FILE_RESULT(NS_ERROR_UNEXPECTED);
|
||||
*aLength = mLength;
|
||||
return NS_OK;
|
||||
}
|
||||
NS_IMETHOD Read(char* aBuf,
|
||||
PRUint32 aOffset,
|
||||
PRUint32 aCount,
|
||||
PRUint32 *aReadCount)
|
||||
{
|
||||
NS_PRECONDITION(aBuf != nsnull, "null ptr");
|
||||
if (!aBuf)
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
NS_PRECONDITION(aReadCount != nsnull, "null ptr");
|
||||
if (!aReadCount)
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
if (!mFileDesc)
|
||||
return NS_FILE_RESULT(PR_BAD_DESCRIPTOR_ERROR);
|
||||
if (mFailed)
|
||||
return NS_ERROR_FAILURE;
|
||||
if (aOffset)
|
||||
PR_Seek(mFileDesc, aOffset, PR_SEEK_CUR);
|
||||
PRInt32 bytesRead = PR_Read(mFileDesc, aBuf, aCount);
|
||||
if (bytesRead < 0)
|
||||
{
|
||||
*aReadCount = 0;
|
||||
mFailed = PR_TRUE;
|
||||
return NS_FILE_RESULT(PR_GetError());
|
||||
}
|
||||
*aReadCount = bytesRead;
|
||||
return NS_OK;
|
||||
}
|
||||
// nsIOutputStream interface
|
||||
NS_IMETHOD Write(const char* aBuf,
|
||||
PRUint32 aOffset,
|
||||
PRUint32 aCount,
|
||||
PRUint32 *aWriteCount)
|
||||
{
|
||||
NS_PRECONDITION(aBuf != nsnull, "null ptr");
|
||||
NS_PRECONDITION(aWriteCount != nsnull, "null ptr");
|
||||
|
||||
|
||||
#ifdef XP_MAC
|
||||
// Calling PR_Write on stdout is sure suicide.
|
||||
if (mFileDesc == PR_STDOUT || mFileDesc == PR_STDERR)
|
||||
{
|
||||
cout.write(aBuf, aCount);
|
||||
*aWriteCount = aCount;
|
||||
return NS_OK;
|
||||
}
|
||||
#endif
|
||||
if (!mFileDesc)
|
||||
return NS_FILE_RESULT(PR_BAD_DESCRIPTOR_ERROR);
|
||||
if (mFailed)
|
||||
return NS_ERROR_FAILURE;
|
||||
if (aOffset)
|
||||
PR_Seek(mFileDesc, aOffset, PR_SEEK_CUR);
|
||||
PRInt32 bytesWrit = PR_Write(mFileDesc, aBuf, aCount);
|
||||
if (bytesWrit != aCount)
|
||||
{
|
||||
mFailed = PR_TRUE;
|
||||
*aWriteCount = 0;
|
||||
return NS_FILE_RESULT(PR_GetError());
|
||||
}
|
||||
*aWriteCount = bytesWrit;
|
||||
return NS_OK;
|
||||
}
|
||||
NS_IMETHOD Flush();
|
||||
|
||||
NS_IMETHOD GetAtEOF(PRBool* outAtEOF)
|
||||
{
|
||||
*outAtEOF = mEOF;
|
||||
return NS_OK;
|
||||
}
|
||||
NS_IMETHOD SetAtEOF(PRBool inAtEOF)
|
||||
{
|
||||
mEOF = inAtEOF;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
PRFileDesc* mFileDesc;
|
||||
int mNSPRMode;
|
||||
PRBool mFailed;
|
||||
PRBool mEOF;
|
||||
PRInt32 mLength;
|
||||
}; // class FileImpl
|
||||
|
||||
#define SAY_I_IMPLEMENT(classname) \
|
||||
if (aIID.Equals(classname::IID())) \
|
||||
{ \
|
||||
*aInstancePtr = (void*)((classname*)this); \
|
||||
NS_ADDREF_THIS(); \
|
||||
return NS_OK; \
|
||||
}
|
||||
|
||||
NS_IMPL_RELEASE(FileImpl)
|
||||
NS_IMPL_ADDREF(FileImpl)
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
NS_IMETHODIMP FileImpl::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
if (!aInstancePtr)
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
|
||||
*aInstancePtr = nsnull;
|
||||
|
||||
SAY_I_IMPLEMENT(nsIFile)
|
||||
SAY_I_IMPLEMENT(nsIOutputStream)
|
||||
SAY_I_IMPLEMENT(nsIInputStream)
|
||||
SAY_I_IMPLEMENT(nsIFileInputStream)
|
||||
SAY_I_IMPLEMENT(nsIFileOutputStream)
|
||||
// Note that we derive from two copies of nsIBaseStream (and hence
|
||||
// of nsISupports), one through
|
||||
// nsIOutputStream, the other through nsIInputStream. Resolve this
|
||||
// by giving them a specific one
|
||||
if (aIID.Equals(((nsIBaseStream*)(nsIOutputStream*)this)->IID()))
|
||||
{
|
||||
*aInstancePtr = (void*)((nsIBaseStream*)(nsIOutputStream*)this);
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
if (aIID.Equals(((nsISupports*)(nsIOutputStream*)this)->IID()))
|
||||
{
|
||||
*aInstancePtr = (void*)((nsISupports*)(nsIOutputStream*)this);
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_NOINTERFACE;
|
||||
} // FileImpl::QueryInterface
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
NS_IMETHODIMP FileImpl::Open(
|
||||
const nsFileSpec& inFile,
|
||||
int nsprMode,
|
||||
PRIntn accessMode)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
if (mFileDesc)
|
||||
if ((nsprMode & mNSPRMode) == nsprMode)
|
||||
return NS_OK;
|
||||
else
|
||||
return NS_FILE_RESULT(PR_ILLEGAL_ACCESS_ERROR);
|
||||
|
||||
const int nspr_modes[]={
|
||||
PR_WRONLY | PR_CREATE_FILE,
|
||||
PR_WRONLY | PR_CREATE_FILE | PR_APPEND,
|
||||
PR_WRONLY | PR_CREATE_FILE | PR_TRUNCATE,
|
||||
PR_RDONLY,
|
||||
PR_RDONLY | PR_APPEND,
|
||||
PR_RDWR | PR_CREATE_FILE,
|
||||
PR_RDWR | PR_CREATE_FILE | PR_TRUNCATE,
|
||||
// "wb",
|
||||
// "ab",
|
||||
// "wb",
|
||||
// "rb",
|
||||
// "r+b",
|
||||
// "w+b",
|
||||
0 };
|
||||
const int* currentLegalMode = nspr_modes;
|
||||
while (*currentLegalMode && nsprMode != *currentLegalMode)
|
||||
++currentLegalMode;
|
||||
if (!*currentLegalMode)
|
||||
return NS_FILE_RESULT(PR_ILLEGAL_ACCESS_ERROR);
|
||||
|
||||
#ifdef XP_MAC
|
||||
// Use the file spec to open the file, because one path can be common to
|
||||
// several files on the Macintosh (you can have several volumes with the
|
||||
// same name, see).
|
||||
mFileDesc = 0;
|
||||
if (inFile.Error() != noErr)
|
||||
return NS_FILE_RESULT(inFile.Error());
|
||||
OSErr err = noErr;
|
||||
#if DEBUG
|
||||
const OSType kCreator = 'CWIE';
|
||||
#else
|
||||
const OSType kCreator = 'MOSS';
|
||||
#endif
|
||||
// Resolve the alias to the original file.
|
||||
nsFileSpec original = inFile;
|
||||
PRBool ignoredResult;
|
||||
original.ResolveAlias(ignoredResult);
|
||||
const FSSpec& spec = original.operator const FSSpec&();
|
||||
if (nsprMode & PR_CREATE_FILE)
|
||||
err = FSpCreate(&spec, kCreator, 'TEXT', 0);
|
||||
if (err == dupFNErr)
|
||||
err = noErr;
|
||||
if (err != noErr)
|
||||
return NS_FILE_RESULT(err);
|
||||
|
||||
SInt8 perm;
|
||||
if (nsprMode & PR_RDWR)
|
||||
perm = fsRdWrPerm;
|
||||
else if (nsprMode & PR_WRONLY)
|
||||
perm = fsWrPerm;
|
||||
else
|
||||
perm = fsRdPerm;
|
||||
|
||||
short refnum;
|
||||
err = FSpOpenDF(&spec, perm, &refnum);
|
||||
|
||||
if (err == noErr && (nsprMode & PR_TRUNCATE))
|
||||
err = SetEOF(refnum, 0);
|
||||
if (err == noErr && (nsprMode & PR_APPEND))
|
||||
err = SetFPos(refnum, fsFromLEOF, 0);
|
||||
if (err != noErr)
|
||||
return NS_FILE_RESULT(err);
|
||||
|
||||
if ((mFileDesc = PR_ImportFile(refnum)) == 0)
|
||||
return NS_FILE_RESULT(PR_GetError());
|
||||
#else
|
||||
// Platforms other than Macintosh...
|
||||
// Another bug in NSPR: Mac PR_Open assumes a unix style path, but Win PR_Open assumes
|
||||
// a windows path.
|
||||
if ((mFileDesc = PR_Open((const char*)nsFileSpec(inFile), nsprMode, accessMode)) == 0)
|
||||
return NS_FILE_RESULT(PR_GetError());
|
||||
#endif
|
||||
mNSPRMode = nsprMode;
|
||||
mLength = PR_Available(mFileDesc);
|
||||
return NS_OK;
|
||||
} // FileImpl::Open
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
NS_IMETHODIMP FileImpl::Seek(PRSeekWhence whence, PRInt32 offset)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
if (mFileDesc==PR_STDIN || mFileDesc==PR_STDOUT || mFileDesc==PR_STDERR || !mFileDesc)
|
||||
return NS_FILE_RESULT(PR_BAD_DESCRIPTOR_ERROR);
|
||||
mFailed = PR_FALSE; // reset on a seek.
|
||||
mEOF = PR_FALSE; // reset on a seek.
|
||||
PRInt32 position = PR_Seek(mFileDesc, 0, PR_SEEK_CUR);
|
||||
PRInt32 available = PR_Available(mFileDesc);
|
||||
PRInt32 fileSize = position + available;
|
||||
PRInt32 newPosition;
|
||||
switch (whence)
|
||||
{
|
||||
case PR_SEEK_CUR: newPosition = position + offset; break;
|
||||
case PR_SEEK_SET: newPosition = offset; break;
|
||||
case PR_SEEK_END: newPosition = fileSize + offset; break;
|
||||
}
|
||||
if (newPosition < 0)
|
||||
{
|
||||
newPosition = 0;
|
||||
mFailed = PR_TRUE;
|
||||
}
|
||||
else if (newPosition >= fileSize)
|
||||
{
|
||||
newPosition = fileSize;
|
||||
mEOF = PR_TRUE;
|
||||
}
|
||||
if (PR_Seek(mFileDesc, newPosition, PR_SEEK_SET) < 0)
|
||||
mFailed = PR_TRUE;
|
||||
return NS_OK;
|
||||
} // FileImpl::Seek
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
NS_IMETHODIMP FileImpl::Tell(PRIntn* outWhere)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
if (mFileDesc==PR_STDIN || mFileDesc==PR_STDOUT || mFileDesc==PR_STDERR || !mFileDesc)
|
||||
return NS_FILE_RESULT(PR_BAD_DESCRIPTOR_ERROR);
|
||||
*outWhere = PR_Seek(mFileDesc, 0, PR_SEEK_CUR);
|
||||
return NS_OK;
|
||||
} // FileImpl::Tell
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
NS_IMETHODIMP FileImpl::Close()
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
if (mFileDesc==PR_STDIN || mFileDesc==PR_STDOUT || mFileDesc==PR_STDERR || !mFileDesc)
|
||||
return NS_OK;
|
||||
if (PR_Close(mFileDesc) == PR_SUCCESS)
|
||||
mFileDesc = 0;
|
||||
else
|
||||
return NS_FILE_RESULT(PR_GetError());
|
||||
return NS_OK;
|
||||
} // FileImpl::close
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
NS_IMETHODIMP FileImpl::Flush()
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
#ifdef XP_MAC
|
||||
if (mFileDesc == PR_STDOUT || mFileDesc == PR_STDERR)
|
||||
{
|
||||
cout.flush();
|
||||
return NS_OK;
|
||||
}
|
||||
#endif
|
||||
if (!mFileDesc)
|
||||
return NS_FILE_RESULT(PR_BAD_DESCRIPTOR_ERROR);
|
||||
PRBool itFailed = PR_Sync(mFileDesc) != PR_SUCCESS;
|
||||
#ifdef XP_MAC
|
||||
// On unix, it seems to fail always.
|
||||
if (itFailed)
|
||||
mFailed = PR_TRUE;
|
||||
#endif
|
||||
return NS_OK;
|
||||
} // FileImpl::flush
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
NS_BASE nsresult NS_NewTypicalInputFileStream(
|
||||
nsISupports** aResult,
|
||||
const nsFileSpec& inFile
|
||||
/*Default nsprMode == PR_RDONLY*/
|
||||
/*Default accessmode = 0700 (octal)*/)
|
||||
// Factory method to get an nsInputStream from a file, using most common options
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
return NS_NewIOFileStream(aResult, inFile, PR_RDONLY, 0700);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
NS_BASE nsresult NS_NewOutputConsoleStream(
|
||||
nsISupports** aResult)
|
||||
// Factory method to get an nsOutputStream to the console.
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
NS_PRECONDITION(aResult != nsnull, "null ptr");
|
||||
if (! aResult)
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
|
||||
FileImpl* stream = new FileImpl(PR_STDOUT);
|
||||
if (! stream)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
NS_ADDREF(stream);
|
||||
*aResult = (nsISupports*)(void*)stream;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
NS_BASE nsresult NS_NewTypicalOutputFileStream(
|
||||
nsISupports** aResult,
|
||||
const nsFileSpec& inFile
|
||||
/*default nsprMode= (PR_WRONLY | PR_CREATE_FILE | PR_TRUNCATE)*/
|
||||
/*Default accessMode= 0700 (octal)*/)
|
||||
// Factory method to get an nsOutputStream to a file - most common case.
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
return NS_NewIOFileStream(
|
||||
aResult,
|
||||
inFile,
|
||||
(PR_WRONLY | PR_CREATE_FILE | PR_TRUNCATE),
|
||||
0700);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
NS_BASE nsresult NS_NewIOFileStream(
|
||||
nsISupports** aResult,
|
||||
const nsFileSpec& inFile,
|
||||
PRInt32 nsprMode /*default = (PR_WRONLY | PR_CREATE_FILE | PR_TRUNCATE)*/,
|
||||
PRInt32 accessMode /*Default = 0700 (octal)*/)
|
||||
// Factory method to get an object that implements both nsIInputStream
|
||||
// and nsIOutputStream, associated with a file.
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
NS_PRECONDITION(aResult != nsnull, "null ptr");
|
||||
if (!aResult)
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
|
||||
FileImpl* stream = new FileImpl(inFile, nsprMode, accessMode);
|
||||
if (! stream)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
NS_ADDREF(stream);
|
||||
*aResult = (nsISupports*)(void*)stream;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
NS_BASE nsresult NS_NewTypicalIOFileStream(
|
||||
nsISupports** aResult,
|
||||
const nsFileSpec& inFile
|
||||
/*default nsprMode= (PR_RDWR | PR_CREATE_FILE)*/
|
||||
/*Default accessMode= 0700 (octal)*/)
|
||||
// Factory method to get an object that implements both nsIInputStream
|
||||
// and nsIOutputStream, associated with a single file.
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
return NS_NewIOFileStream(
|
||||
aResult,
|
||||
inFile,
|
||||
(PR_RDWR | PR_CREATE_FILE),
|
||||
0700);
|
||||
}
|
||||
56
mozilla/base/src/nsIInputStream.h
Normal file
56
mozilla/base/src/nsIInputStream.h
Normal file
@@ -0,0 +1,56 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
#ifndef nsIInputStream_h___
|
||||
#define nsIInputStream_h___
|
||||
|
||||
#include "nsIBaseStream.h"
|
||||
|
||||
#define NS_IINPUTSTREAM_IID \
|
||||
{ 0x022396f0, 0x93b5, 0x11d1, \
|
||||
{0x89, 0x5b, 0x00, 0x60, 0x08, 0x91, 0x1b, 0x81} }
|
||||
|
||||
/** Abstract byte input stream */
|
||||
class nsIInputStream : public nsIBaseStream {
|
||||
public:
|
||||
|
||||
static const nsIID& IID() { static nsIID iid = NS_IINPUTSTREAM_IID; return iid; }
|
||||
|
||||
/** Return the number of bytes in the stream
|
||||
* @param aLength out parameter to hold the length
|
||||
* of the stream. if an error occurs, the length
|
||||
* will be undefined
|
||||
* @return error status
|
||||
*/
|
||||
NS_IMETHOD
|
||||
GetLength(PRUint32 *aLength) = 0;
|
||||
|
||||
/** Read data from the stream.
|
||||
* @param aErrorCode the error code if an error occurs
|
||||
* @param aBuf the buffer into which the data is read
|
||||
* @param aOffset the start offset of the data
|
||||
* @param aCount the maximum number of bytes to read
|
||||
* @param aReadCount out parameter to hold the number of
|
||||
* bytes read, eof if 0. if an error occurs, the
|
||||
* read count will be undefined
|
||||
* @return error status
|
||||
*/
|
||||
NS_IMETHOD
|
||||
Read(char* aBuf, PRUint32 aOffset, PRUint32 aCount, PRUint32 *aReadCount) = 0;
|
||||
};
|
||||
|
||||
#endif /* nsInputStream_h___ */
|
||||
48
mozilla/base/src/nsIOutputStream.h
Normal file
48
mozilla/base/src/nsIOutputStream.h
Normal file
@@ -0,0 +1,48 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
#ifndef nsIOutputStream_h___
|
||||
#define nsIOutputStream_h___
|
||||
|
||||
#include "nsIBaseStream.h"
|
||||
|
||||
/* 7f13b870-e95f-11d1-beae-00805f8a66dc */
|
||||
#define NS_IOUTPUTSTREAM_IID \
|
||||
{ 0x7f13b870, 0xe95f, 0x11d1, \
|
||||
{0xbe, 0xae, 0x00, 0x80, 0x5f, 0x8a, 0x66, 0xdc} }
|
||||
|
||||
/** Abstract byte output stream */
|
||||
class nsIOutputStream : public nsIBaseStream {
|
||||
public:
|
||||
|
||||
static const nsIID& IID() { static nsIID iid = NS_IOUTPUTSTREAM_IID; return iid; }
|
||||
|
||||
/** Write data into the stream.
|
||||
* @param aBuf the buffer into which the data is read
|
||||
* @param aOffset the start offset of the data
|
||||
* @param aCount the maximum number of bytes to read
|
||||
* @param aWriteCount out parameter to hold the number of
|
||||
* bytes written. if an error occurs, the writecount
|
||||
* is undefined
|
||||
* @return error status
|
||||
*/
|
||||
NS_IMETHOD
|
||||
Write(const char* aBuf, PRUint32 aOffset, PRUint32 aCount, PRUint32 *aWriteCount) = 0;
|
||||
};
|
||||
|
||||
|
||||
#endif /* nsOutputStream_h___ */
|
||||
94
mozilla/base/src/nsITimer.h
Normal file
94
mozilla/base/src/nsITimer.h
Normal file
@@ -0,0 +1,94 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
#ifndef nsITimer_h___
|
||||
#define nsITimer_h___
|
||||
|
||||
#include "nscore.h"
|
||||
#include "nsISupports.h"
|
||||
|
||||
class nsITimer;
|
||||
class nsITimerCallback;
|
||||
|
||||
// Implementations of nsITimer should be written such that there are no limitations
|
||||
// on what can be called by the TimerCallbackFunc. On platforms like the Macintosh this
|
||||
// means that callback functions must be called from the main event loop NOT from
|
||||
// an interrupt.
|
||||
|
||||
/// Signature of timer callback function
|
||||
typedef void
|
||||
(*nsTimerCallbackFunc) (nsITimer *aTimer, void *aClosure);
|
||||
|
||||
/// Interface IID for nsITimer
|
||||
#define NS_ITIMER_IID \
|
||||
{ 0x497eed20, 0xb740, 0x11d1, \
|
||||
{ 0x9b, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3 } }
|
||||
|
||||
/**
|
||||
* Timer class, used to invoke a function or method after a fixed
|
||||
* millisecond interval. <B>Note that this interface is subject to
|
||||
* change!</B>
|
||||
*/
|
||||
class nsITimer : public nsISupports {
|
||||
public:
|
||||
/**
|
||||
* Initialize a timer to fire after the given millisecond interval.
|
||||
* This version takes a function to call and a closure to pass to
|
||||
* that function.
|
||||
*
|
||||
* @param aFunc - The function to invoke
|
||||
* @param aClosure - an opaque pointer to pass to that function
|
||||
* @param aRepeat - (Not yet implemented) One-shot or repeating
|
||||
* @param aDelay - The millisecond interval
|
||||
* @result - NS_OK if this operation was successful
|
||||
*/
|
||||
virtual nsresult Init(nsTimerCallbackFunc aFunc,
|
||||
void *aClosure,
|
||||
// PRBool aRepeat,
|
||||
PRUint32 aDelay)=0;
|
||||
|
||||
/**
|
||||
* Initialize a timer to fire after the given millisecond interval.
|
||||
* This version takes an interface of type <code>nsITimerCallback</code>.
|
||||
* The <code>Notify</code> method of this method is invoked.
|
||||
*
|
||||
* @param aCallback - The interface to notify
|
||||
* @param aRepeat - (Not yet implemented) One-shot or repeating
|
||||
* @param aDelay - The millisecond interval
|
||||
* @result - NS_OK if this operation was successful
|
||||
*/
|
||||
virtual nsresult Init(nsITimerCallback *aCallback,
|
||||
// PRBool aRepeat,
|
||||
PRUint32 aDelay)=0;
|
||||
|
||||
/// Cancels the timeout
|
||||
virtual void Cancel()=0;
|
||||
|
||||
/// @return the millisecond delay of the timeout
|
||||
virtual PRUint32 GetDelay()=0;
|
||||
|
||||
/// Change the millisecond interval for the timeout
|
||||
virtual void SetDelay(PRUint32 aDelay)=0;
|
||||
|
||||
/// @return the opaque pointer
|
||||
virtual void* GetClosure()=0;
|
||||
};
|
||||
|
||||
/** Factory method for creating an nsITimer */
|
||||
extern NS_BASE nsresult NS_NewTimer(nsITimer** aInstancePtrResult);
|
||||
|
||||
#endif
|
||||
41
mozilla/base/src/nsITimerCallback.h
Normal file
41
mozilla/base/src/nsITimerCallback.h
Normal file
@@ -0,0 +1,41 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
#ifndef nsITimerCallback_h___
|
||||
#define nsITimerCallback_h___
|
||||
|
||||
#include "nscore.h"
|
||||
#include "nsISupports.h"
|
||||
|
||||
class nsITimer;
|
||||
|
||||
/// Interface IID for nsITimerCallback
|
||||
#define NS_ITIMERCALLBACK_IID \
|
||||
{ 0x5079b3a0, 0xb743, 0x11d1, \
|
||||
{ 0x9b, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3 } }
|
||||
|
||||
/**
|
||||
* Interface implemented by users of the nsITimer class. An instance
|
||||
* of this interface is passed in when creating a timer. The Notify()
|
||||
* method of that instance is invoked after the specified delay.
|
||||
*/
|
||||
class nsITimerCallback : public nsISupports {
|
||||
public:
|
||||
virtual void Notify(nsITimer *timer)=0;
|
||||
};
|
||||
|
||||
#endif
|
||||
46
mozilla/base/src/nsIUnicharBuffer.h
Normal file
46
mozilla/base/src/nsIUnicharBuffer.h
Normal file
@@ -0,0 +1,46 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
#ifndef nsIUnicharBuffer_h___
|
||||
#define nsIUnicharBuffer_h___
|
||||
|
||||
#include "nscore.h"
|
||||
#include "nsISupports.h"
|
||||
class nsIUnicharInputStream;
|
||||
|
||||
#define NS_IUNICHAR_BUFFER_IID \
|
||||
{ 0x14cf6970, 0x93b5, 0x11d1, \
|
||||
{0x89, 0x5b, 0x00, 0x60, 0x08, 0x91, 0x1b, 0x81} }
|
||||
|
||||
/// Interface to a buffer that holds unicode characters
|
||||
class nsIUnicharBuffer : public nsISupports {
|
||||
public:
|
||||
virtual PRInt32 GetLength() const = 0;
|
||||
virtual PRInt32 GetBufferSize() const = 0;
|
||||
virtual PRUnichar* GetBuffer() const = 0;
|
||||
virtual PRBool Grow(PRInt32 aNewSize) = 0;
|
||||
virtual PRInt32 Fill(nsresult* aErrorCode, nsIUnicharInputStream* aStream,
|
||||
PRInt32 aKeep) = 0;
|
||||
};
|
||||
|
||||
/// Factory method for nsIUnicharBuffer.
|
||||
extern NS_BASE nsresult
|
||||
NS_NewUnicharBuffer(nsIUnicharBuffer** aInstancePtrResult,
|
||||
nsISupports* aOuter,
|
||||
PRUint32 aBufferSize = 0);
|
||||
|
||||
#endif /* nsIUnicharBuffer_h___ */
|
||||
62
mozilla/base/src/nsIUnicharInputStream.h
Normal file
62
mozilla/base/src/nsIUnicharInputStream.h
Normal file
@@ -0,0 +1,62 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
#ifndef nsIUnicharInputStream_h___
|
||||
#define nsIUnicharInputStream_h___
|
||||
|
||||
#include "nsIInputStream.h"
|
||||
class nsString;
|
||||
|
||||
#define NS_IUNICHAR_INPUT_STREAM_IID \
|
||||
{ 0x2d97fbf0, 0x93b5, 0x11d1, \
|
||||
{0x89, 0x5b, 0x00, 0x60, 0x08, 0x91, 0x1b, 0x81} }
|
||||
|
||||
/** Abstract unicode character input stream
|
||||
* @see nsIInputStream
|
||||
*/
|
||||
class nsIUnicharInputStream : public nsISupports {
|
||||
public:
|
||||
NS_IMETHOD Read(PRUnichar* aBuf,
|
||||
PRUint32 aOffset,
|
||||
PRUint32 aCount,
|
||||
PRUint32 *aReadCount) = 0;
|
||||
NS_IMETHOD Close() = 0;
|
||||
};
|
||||
|
||||
/**
|
||||
* Create a nsIUnicharInputStream that wraps up a string. Data is fed
|
||||
* from the string out until the done. When this object is destroyed
|
||||
* it destroyes the string (so make a copy if you don't want it doing
|
||||
* that)
|
||||
*/
|
||||
extern NS_BASE nsresult
|
||||
NS_NewStringUnicharInputStream(nsIUnicharInputStream** aInstancePtrResult,
|
||||
nsString* aString);
|
||||
|
||||
/** Create a new nsUnicharInputStream that provides a converter for the
|
||||
* byte input stream aStreamToWrap. If no converter can be found then
|
||||
* nsnull is returned and the error code is set to
|
||||
* NS_INPUTSTREAM_NO_CONVERTER.
|
||||
*/
|
||||
extern NS_BASE nsresult
|
||||
NS_NewConverterStream(nsIUnicharInputStream** aInstancePtrResult,
|
||||
nsISupports* aOuter,
|
||||
nsIInputStream* aStreamToWrap,
|
||||
PRInt32 aBufferSize = 0,
|
||||
nsString* aCharSet = nsnull);
|
||||
|
||||
#endif /* nsUnicharInputStream_h___ */
|
||||
340
mozilla/base/src/nsInt64.h
Normal file
340
mozilla/base/src/nsInt64.h
Normal file
@@ -0,0 +1,340 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
#ifndef nsInt64_h__
|
||||
#define nsInt64_h__
|
||||
|
||||
#include "prlong.h"
|
||||
#include "nscore.h"
|
||||
|
||||
/**
|
||||
* This class encapsulates full 64-bit integer functionality and
|
||||
* provides simple arithmetic and conversion operations.
|
||||
*/
|
||||
|
||||
// If you ever decide that you need to add a non-inline method to this
|
||||
// class, be sure to change the class declaration to "class NS_BASE
|
||||
// nsInt64".
|
||||
|
||||
class nsInt64
|
||||
{
|
||||
private:
|
||||
PRInt64 mValue;
|
||||
|
||||
public:
|
||||
/**
|
||||
* Construct a new 64-bit integer.
|
||||
*/
|
||||
nsInt64(void) : mValue(LL_ZERO) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new 64-bit integer from a 32-bit signed integer
|
||||
*/
|
||||
nsInt64(const PRInt32 aInt32) {
|
||||
LL_I2L(mValue, aInt32);
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new 64-bit integer from a 32-bit unsigned integer
|
||||
*/
|
||||
nsInt64(const PRUint32 aUint32) {
|
||||
LL_UI2L(mValue, aUint32);
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new 64-bit integer from a floating point value.
|
||||
*/
|
||||
nsInt64(const PRFloat64 aFloat64) {
|
||||
LL_D2L(mValue, aFloat64);
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new 64-bit integer from a native 64-bit integer
|
||||
*/
|
||||
nsInt64(const PRInt64 aInt64) : mValue(aInt64) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new 64-bit integer from another 64-bit integer
|
||||
*/
|
||||
nsInt64(const nsInt64& aObject) : mValue(aObject.mValue) {
|
||||
}
|
||||
|
||||
// ~nsInt64(void) -- XXX destructor unnecessary
|
||||
|
||||
/**
|
||||
* Assign a 64-bit integer to another 64-bit integer
|
||||
*/
|
||||
const nsInt64& operator =(const nsInt64& aObject) {
|
||||
mValue = aObject.mValue;
|
||||
return *this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert a 64-bit integer to a signed 32-bit value
|
||||
*/
|
||||
operator PRInt32(void) const {
|
||||
PRInt32 result;
|
||||
LL_L2I(result, mValue);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert a 64-bit integer to an unsigned 32-bit value
|
||||
*/
|
||||
operator PRUint32(void) const {
|
||||
PRUint32 result;
|
||||
LL_L2UI(result, mValue);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert a 64-bit integer to a floating point value
|
||||
*/
|
||||
operator PRFloat64(void) const {
|
||||
PRFloat64 result;
|
||||
LL_L2D(result, mValue);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert a 64-bit integer to a native 64-bit integer.
|
||||
*/
|
||||
operator PRInt64(void) const {
|
||||
return mValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform unary negation on a 64-bit integer.
|
||||
*/
|
||||
const nsInt64 operator -(void) {
|
||||
nsInt64 result;
|
||||
LL_NEG(result.mValue, mValue);
|
||||
return result;
|
||||
}
|
||||
|
||||
// Arithmetic operators
|
||||
friend const nsInt64 operator +(const nsInt64& aObject1, const nsInt64& aObject2);
|
||||
friend const nsInt64 operator -(const nsInt64& aObject1, const nsInt64& aObject2);
|
||||
friend const nsInt64 operator *(const nsInt64& aObject1, const nsInt64& aObject2);
|
||||
friend const nsInt64 operator /(const nsInt64& aObject1, const nsInt64& aObject2);
|
||||
friend const nsInt64 operator %(const nsInt64& aObject1, const nsInt64& aObject2);
|
||||
|
||||
/**
|
||||
* Increment a 64-bit integer by a 64-bit integer amount.
|
||||
*/
|
||||
nsInt64& operator +=(const nsInt64& aObject) {
|
||||
LL_ADD(mValue, mValue, aObject.mValue);
|
||||
return *this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Decrement a 64-bit integer by a 64-bit integer amount.
|
||||
*/
|
||||
nsInt64& operator -=(const nsInt64& aObject) {
|
||||
LL_SUB(mValue, mValue, aObject.mValue);
|
||||
return *this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Multiply a 64-bit integer by a 64-bit integer amount.
|
||||
*/
|
||||
nsInt64& operator *=(const nsInt64& aObject) {
|
||||
LL_MUL(mValue, mValue, aObject.mValue);
|
||||
return *this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Divide a 64-bit integer by a 64-bit integer amount.
|
||||
*/
|
||||
nsInt64& operator /=(const nsInt64& aObject) {
|
||||
LL_DIV(mValue, mValue, aObject.mValue);
|
||||
return *this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Compute the modulus of a 64-bit integer to a 64-bit value.
|
||||
*/
|
||||
nsInt64& operator %=(const nsInt64& aObject) {
|
||||
LL_MOD(mValue, mValue, aObject.mValue);
|
||||
return *this;
|
||||
}
|
||||
|
||||
// Comparison operators
|
||||
friend PRBool operator ==(const nsInt64& aObject1, const nsInt64& aObject2);
|
||||
friend PRBool operator !=(const nsInt64& aObject1, const nsInt64& aObject2);
|
||||
friend PRBool operator >(const nsInt64& aObject1, const nsInt64& aObject2);
|
||||
friend PRBool operator >=(const nsInt64& aObject1, const nsInt64& aObject2);
|
||||
friend PRBool operator <(const nsInt64& aObject1, const nsInt64& aObject2);
|
||||
friend PRBool operator <=(const nsInt64& aObject1, const nsInt64& aObject2);
|
||||
|
||||
// Bitwise operators
|
||||
friend const nsInt64 operator &(const nsInt64& aObject1, const nsInt64& aObject2);
|
||||
friend const nsInt64 operator |(const nsInt64& aObject1, const nsInt64& aObject2);
|
||||
friend const nsInt64 operator ^(const nsInt64& aObject1, const nsInt64& aObject2);
|
||||
|
||||
/**
|
||||
* Compute the bitwise NOT of a 64-bit integer
|
||||
*/
|
||||
const nsInt64 operator ~(void) {
|
||||
nsInt64 result;
|
||||
LL_NOT(result.mValue, mValue);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Compute the bitwise AND with another 64-bit integer
|
||||
*/
|
||||
nsInt64& operator &=(const nsInt64& aObject) {
|
||||
LL_AND(mValue, mValue, aObject.mValue);
|
||||
return *this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Compute the bitwise OR with another 64-bit integer
|
||||
*/
|
||||
nsInt64& operator |=(const nsInt64& aObject) {
|
||||
LL_OR(mValue, mValue, aObject.mValue);
|
||||
return *this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Compute the bitwise XOR with another 64-bit integer
|
||||
*/
|
||||
nsInt64& operator ^=(const nsInt64& aObject) {
|
||||
LL_XOR(mValue, mValue, aObject.mValue);
|
||||
return *this;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Add two 64-bit integers.
|
||||
*/
|
||||
inline const nsInt64
|
||||
operator +(const nsInt64& aObject1, const nsInt64& aObject2) {
|
||||
return nsInt64(aObject1) += aObject2;
|
||||
}
|
||||
|
||||
/**
|
||||
* Subtract one 64-bit integer from another.
|
||||
*/
|
||||
inline const nsInt64
|
||||
operator -(const nsInt64& aObject1, const nsInt64& aObject2) {
|
||||
return nsInt64(aObject1) -= aObject2;
|
||||
}
|
||||
|
||||
/**
|
||||
* Multiply two 64-bit integers
|
||||
*/
|
||||
inline const nsInt64
|
||||
operator *(const nsInt64& aObject1, const nsInt64& aObject2) {
|
||||
return nsInt64(aObject1) *= aObject2;
|
||||
}
|
||||
|
||||
/**
|
||||
* Divide one 64-bit integer by another
|
||||
*/
|
||||
inline const nsInt64
|
||||
operator /(const nsInt64& aObject1, const nsInt64& aObject2) {
|
||||
return nsInt64(aObject1) /= aObject2;
|
||||
}
|
||||
|
||||
/**
|
||||
* Compute the modulus of two 64-bit integers
|
||||
*/
|
||||
inline const nsInt64
|
||||
operator %(const nsInt64& aObject1, const nsInt64& aObject2) {
|
||||
return nsInt64(aObject1) %= aObject2;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if two 64-bit integers are equal
|
||||
*/
|
||||
inline PRBool
|
||||
operator ==(const nsInt64& aObject1, const nsInt64& aObject2) {
|
||||
return LL_EQ(aObject1.mValue, aObject2.mValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if two 64-bit integers are not equal
|
||||
*/
|
||||
inline PRBool
|
||||
operator !=(const nsInt64& aObject1, const nsInt64& aObject2) {
|
||||
return LL_NE(aObject1.mValue, aObject2.mValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if one 64-bit integer is strictly greater than another, using signed values
|
||||
*/
|
||||
inline PRBool
|
||||
operator >(const nsInt64& aObject1, const nsInt64& aObject2) {
|
||||
return LL_CMP(aObject1.mValue, >, aObject2.mValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if one 64-bit integer is greater than or equal to another, using signed values
|
||||
*/
|
||||
inline PRBool
|
||||
operator >=(const nsInt64& aObject1, const nsInt64& aObject2) {
|
||||
return LL_CMP(aObject1.mValue, >=, aObject2.mValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if one 64-bit integer is strictly less than another, using signed values
|
||||
*/
|
||||
inline PRBool
|
||||
operator <(const nsInt64& aObject1, const nsInt64& aObject2) {
|
||||
return LL_CMP(aObject1.mValue, <, aObject2.mValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if one 64-bit integers is less than or equal to another, using signed values
|
||||
*/
|
||||
inline PRBool
|
||||
operator <=(const nsInt64& aObject1, const nsInt64& aObject2) {
|
||||
return LL_CMP(aObject1.mValue, <=, aObject2.mValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a bitwise AND of two 64-bit integers
|
||||
*/
|
||||
inline const nsInt64
|
||||
operator &(const nsInt64& aObject1, const nsInt64& aObject2) {
|
||||
return nsInt64(aObject1) &= aObject2;
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a bitwise OR of two 64-bit integers
|
||||
*/
|
||||
inline const nsInt64
|
||||
operator |(const nsInt64& aObject1, const nsInt64& aObject2) {
|
||||
return nsInt64(aObject1) |= aObject2;
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a bitwise XOR of two 64-bit integers
|
||||
*/
|
||||
inline const nsInt64
|
||||
operator ^(const nsInt64& aObject1, const nsInt64& aObject2) {
|
||||
return nsInt64(aObject1) ^= aObject2;
|
||||
}
|
||||
|
||||
|
||||
#endif // nsInt64_h__
|
||||
312
mozilla/base/src/nsProperties.cpp
Normal file
312
mozilla/base/src/nsProperties.cpp
Normal file
@@ -0,0 +1,312 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
#define NS_IMPL_IDS
|
||||
#include "nsID.h"
|
||||
|
||||
#include "nsBaseDLL.h"
|
||||
#include "nsCRT.h"
|
||||
#include "nsIInputStream.h"
|
||||
#include "nsIProperties.h"
|
||||
#include "nsIUnicharInputStream.h"
|
||||
#include "nsProperties.h"
|
||||
#include "plhash.h"
|
||||
#include "pratom.h"
|
||||
|
||||
class nsProperties : public nsIProperties
|
||||
{
|
||||
public:
|
||||
nsProperties();
|
||||
virtual ~nsProperties();
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
NS_IMETHOD Load(nsIInputStream* aIn);
|
||||
NS_IMETHOD GetProperty(const nsString& aKey, nsString& aValue);
|
||||
NS_IMETHOD SetProperty(const nsString& aKey, nsString& aNewValue,
|
||||
nsString& aOldValue);
|
||||
NS_IMETHOD Save(nsIOutputStream* aOut, const nsString& aHeader);
|
||||
NS_IMETHOD Subclass(nsIProperties* aSubclass);
|
||||
|
||||
PRInt32 Read();
|
||||
PRInt32 SkipLine(PRInt32 c);
|
||||
PRInt32 SkipWhiteSpace(PRInt32 c);
|
||||
|
||||
nsIUnicharInputStream* mIn;
|
||||
nsIProperties* mSubclass;
|
||||
struct PLHashTable* mTable;
|
||||
};
|
||||
|
||||
nsProperties::nsProperties()
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
|
||||
mIn = nsnull;
|
||||
mSubclass = NS_STATIC_CAST(nsIProperties*, this);
|
||||
mTable = nsnull;
|
||||
}
|
||||
|
||||
PR_CALLBACK PRIntn
|
||||
FreeHashEntries(PLHashEntry* he, PRIntn i, void* arg)
|
||||
{
|
||||
delete[] (PRUnichar*)he->key;
|
||||
delete[] (PRUnichar*)he->value;
|
||||
return HT_ENUMERATE_REMOVE;
|
||||
}
|
||||
|
||||
nsProperties::~nsProperties()
|
||||
{
|
||||
if (mTable) {
|
||||
// Free the PRUnicode* pointers contained in the hash table entries
|
||||
PL_HashTableEnumerateEntries(mTable, FreeHashEntries, 0);
|
||||
PL_HashTableDestroy(mTable);
|
||||
mTable = nsnull;
|
||||
}
|
||||
}
|
||||
|
||||
NS_DEFINE_IID(kIPropertiesIID, NS_IPROPERTIES_IID);
|
||||
|
||||
NS_IMPL_ISUPPORTS(nsProperties, kIPropertiesIID)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsProperties::Load(nsIInputStream *aIn)
|
||||
{
|
||||
PRInt32 c;
|
||||
nsresult ret;
|
||||
|
||||
ret = NS_NewConverterStream(&mIn, nsnull, aIn);
|
||||
if (ret != NS_OK) {
|
||||
cout << "NS_NewConverterStream failed" << endl;
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
c = Read();
|
||||
while (1) {
|
||||
c = SkipWhiteSpace(c);
|
||||
if (c < 0) {
|
||||
break;
|
||||
}
|
||||
else if ((c == '#') || (c == '!')) {
|
||||
c = SkipLine(c);
|
||||
continue;
|
||||
}
|
||||
else {
|
||||
nsAutoString key("");
|
||||
while ((c >= 0) && (c != '=') && (c != ':')) {
|
||||
key.Append((PRUnichar) c);
|
||||
c = Read();
|
||||
}
|
||||
if (c < 0) {
|
||||
break;
|
||||
}
|
||||
char *trimThese = " \t";
|
||||
key.Trim(trimThese, PR_FALSE, PR_TRUE);
|
||||
c = Read();
|
||||
nsAutoString value("");
|
||||
while ((c >= 0) && (c != '\r') && (c != '\n')) {
|
||||
if (c == '\\') {
|
||||
c = Read();
|
||||
if ((c == '\r') || (c == '\n')) {
|
||||
c = SkipWhiteSpace(c);
|
||||
}
|
||||
else {
|
||||
value.Append('\\');
|
||||
}
|
||||
}
|
||||
value.Append((PRUnichar) c);
|
||||
c = Read();
|
||||
}
|
||||
value.Trim(trimThese, PR_TRUE, PR_TRUE);
|
||||
nsAutoString oldValue("");
|
||||
mSubclass->SetProperty(key, value, oldValue);
|
||||
}
|
||||
}
|
||||
mIn->Close();
|
||||
NS_RELEASE(mIn);
|
||||
NS_ASSERTION(!mIn, "unexpected remaining reference");
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
static PLHashNumber
|
||||
HashKey(const PRUnichar *aString)
|
||||
{
|
||||
return (PLHashNumber) nsCRT::HashValue(aString);
|
||||
}
|
||||
|
||||
static PRIntn
|
||||
CompareKeys(const PRUnichar *aStr1, const PRUnichar *aStr2)
|
||||
{
|
||||
return nsCRT::strcmp(aStr1, aStr2) == 0;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsProperties::SetProperty(const nsString& aKey, nsString& aNewValue,
|
||||
nsString& aOldValue)
|
||||
{
|
||||
// XXX The ToNewCString() calls allocate memory using "new" so this code
|
||||
// causes a memory leak...
|
||||
#if 0
|
||||
cout << "will add " << aKey.ToNewCString() << "=" << aNewValue.ToNewCString() << endl;
|
||||
#endif
|
||||
if (!mTable) {
|
||||
mTable = PL_NewHashTable(8, (PLHashFunction) HashKey,
|
||||
(PLHashComparator) CompareKeys,
|
||||
(PLHashComparator) nsnull, nsnull, nsnull);
|
||||
if (!mTable) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
}
|
||||
|
||||
const PRUnichar *key = aKey.GetUnicode(); // returns internal pointer (not a copy)
|
||||
PRUint32 len;
|
||||
PRUint32 hashValue = nsCRT::HashValue(key, &len);
|
||||
PLHashEntry **hep = PL_HashTableRawLookup(mTable, hashValue, key);
|
||||
PLHashEntry *he = *hep;
|
||||
if (he && aOldValue) {
|
||||
// XXX fix me
|
||||
}
|
||||
PL_HashTableRawAdd(mTable, hep, hashValue, aKey.ToNewUnicode(),
|
||||
aNewValue.ToNewUnicode());
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsProperties::Save(nsIOutputStream* aOut, const nsString& aHeader)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsProperties::Subclass(nsIProperties* aSubclass)
|
||||
{
|
||||
if (aSubclass) {
|
||||
mSubclass = aSubclass;
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsProperties::GetProperty(const nsString& aKey, nsString& aValue)
|
||||
{
|
||||
const PRUnichar *key = aKey;
|
||||
PRUint32 len;
|
||||
PRUint32 hashValue = nsCRT::HashValue(key, &len);
|
||||
PLHashEntry **hep = PL_HashTableRawLookup(mTable, hashValue, key);
|
||||
PLHashEntry *he = *hep;
|
||||
if (he) {
|
||||
aValue = (const PRUnichar*)he->value;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
PRInt32
|
||||
nsProperties::Read()
|
||||
{
|
||||
PRUnichar c;
|
||||
PRUint32 nRead;
|
||||
nsresult ret;
|
||||
|
||||
ret = mIn->Read(&c, 0, 1, &nRead);
|
||||
if (ret == NS_OK) {
|
||||
return c;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
#define IS_WHITE_SPACE(c) \
|
||||
(((c) == ' ') || ((c) == '\t') || ((c) == '\r') || ((c) == '\n'))
|
||||
|
||||
PRInt32
|
||||
nsProperties::SkipWhiteSpace(PRInt32 c)
|
||||
{
|
||||
while ((c >= 0) && IS_WHITE_SPACE(c)) {
|
||||
c = Read();
|
||||
}
|
||||
|
||||
return c;
|
||||
}
|
||||
|
||||
PRInt32
|
||||
nsProperties::SkipLine(PRInt32 c)
|
||||
{
|
||||
while ((c >= 0) && (c != '\r') && (c != '\n')) {
|
||||
c = Read();
|
||||
}
|
||||
if (c == '\r') {
|
||||
c = Read();
|
||||
}
|
||||
if (c == '\n') {
|
||||
c = Read();
|
||||
}
|
||||
|
||||
return c;
|
||||
}
|
||||
|
||||
nsPropertiesFactory::nsPropertiesFactory()
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
}
|
||||
|
||||
nsPropertiesFactory::~nsPropertiesFactory()
|
||||
{
|
||||
}
|
||||
|
||||
NS_DEFINE_IID(kIFactoryIID, NS_IFACTORY_IID);
|
||||
|
||||
NS_IMPL_ISUPPORTS(nsPropertiesFactory, kIFactoryIID);
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsPropertiesFactory::CreateInstance(nsISupports* aOuter, REFNSIID aIID,
|
||||
void** aResult)
|
||||
{
|
||||
if (aOuter) {
|
||||
return NS_ERROR_NO_AGGREGATION;
|
||||
}
|
||||
if (!aResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
*aResult = nsnull;
|
||||
nsProperties* props = new nsProperties();
|
||||
if (!props) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
nsresult ret = props->QueryInterface(aIID, aResult);
|
||||
if (NS_FAILED(ret)) {
|
||||
delete props;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsPropertiesFactory::LockFactory(PRBool aLock)
|
||||
{
|
||||
if (aLock) {
|
||||
PR_AtomicIncrement(&gLockCount);
|
||||
}
|
||||
else {
|
||||
PR_AtomicDecrement(&gLockCount);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
37
mozilla/base/src/nsProperties.h
Normal file
37
mozilla/base/src/nsProperties.h
Normal file
@@ -0,0 +1,37 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
#ifndef nsProperties_h___
|
||||
#define nsProperties_h___
|
||||
|
||||
#include "nsIFactory.h"
|
||||
|
||||
class nsPropertiesFactory : public nsIFactory
|
||||
{
|
||||
public:
|
||||
nsPropertiesFactory();
|
||||
virtual ~nsPropertiesFactory();
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
NS_IMETHOD CreateInstance(nsISupports* aOuter, REFNSIID aIID,
|
||||
void** aResult);
|
||||
NS_IMETHOD LockFactory(PRBool aLock);
|
||||
};
|
||||
|
||||
#endif /* nsProperties_h___ */
|
||||
423
mozilla/base/src/nsRBTree.cpp
Normal file
423
mozilla/base/src/nsRBTree.cpp
Normal file
@@ -0,0 +1,423 @@
|
||||
|
||||
/**
|
||||
* This file defines the binary tree class and it
|
||||
* nsNode child class.
|
||||
*
|
||||
* This simple version stores nodes, and the
|
||||
* nodes store void* ptrs.
|
||||
*
|
||||
* @update gess 4/11/98
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
|
||||
#include "nsRBTree.h"
|
||||
|
||||
|
||||
|
||||
/**************************************************
|
||||
Here comes the nsRBTree class...
|
||||
*************************************************/
|
||||
|
||||
/**
|
||||
* nsRBTree constructor
|
||||
*
|
||||
* @update gess 4/11/98
|
||||
*/
|
||||
nsRBTree::nsRBTree() : nsBTree() {
|
||||
mRoot=0;
|
||||
}
|
||||
|
||||
/**
|
||||
* nsRBTree constructor
|
||||
*
|
||||
* @update gess 4/11/98
|
||||
*/
|
||||
nsRBTree::nsRBTree(const nsRBTree& aCopy) : nsBTree(aCopy) {
|
||||
mRoot=aCopy.mRoot;
|
||||
}
|
||||
|
||||
/**
|
||||
* nsRBTree destructor
|
||||
*
|
||||
* @update gess 4/11/98
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
nsRBTree::~nsRBTree(){
|
||||
if(mRoot){
|
||||
//walk the tree and destroy the children.
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Given a node, we're supposed to add it into
|
||||
* our tree.
|
||||
*
|
||||
* @update gess 4/11/98
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
nsNode* nsRBTree::Add(nsNode& aNode){
|
||||
|
||||
nsBTree::Add(aNode);
|
||||
|
||||
nsNode* node1=&aNode;
|
||||
nsNode* node2=0;
|
||||
|
||||
node1->mColor=nsNode::eRed;
|
||||
|
||||
while((node1!=mRoot) && (node1->mParent->mColor==nsNode::eRed)) {
|
||||
if(node1->mParent==node1->mParent->mParent->mLeft) {
|
||||
node2=node1->mParent->mParent->mLeft;
|
||||
if(node2->mColor==nsNode::eRed) {
|
||||
node1->mParent->mColor=nsNode::eBlack;
|
||||
node2->mColor=nsNode::eBlack;
|
||||
node1->mParent->mParent->mColor=nsNode::eRed;
|
||||
node1=node1->mParent->mParent;
|
||||
}
|
||||
else {
|
||||
if(node1==node1->mParent->mRight) {
|
||||
node1=node1->mParent;
|
||||
ShiftLeft(*node1);
|
||||
}
|
||||
node1->mParent->mColor=nsNode::eBlack;
|
||||
node1->mParent->mParent->mColor=nsNode::eRed;
|
||||
ShiftRight(*node1->mParent->mParent);
|
||||
}
|
||||
}
|
||||
else {
|
||||
node2=node1->mParent->mParent->mRight;
|
||||
if (node2->mColor==nsNode::eRed){
|
||||
node1->mParent->mColor=nsNode::eBlack;
|
||||
node2->mColor=nsNode::eBlack;
|
||||
node1->mParent->mParent->mColor=nsNode::eRed;
|
||||
node1=node1->mParent->mParent;
|
||||
}
|
||||
else {
|
||||
if (node1==node1->mParent->mLeft) {
|
||||
node1=node1->mParent;
|
||||
ShiftRight(*node1);
|
||||
}
|
||||
node1->mParent->mColor=nsNode::eBlack;
|
||||
node1->mParent->mParent->mColor=nsNode::eRed;
|
||||
ShiftLeft(*node1->mParent->mParent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mRoot->mColor=nsNode::eBlack;
|
||||
return &aNode;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Retrive the first node in the tree
|
||||
*
|
||||
* @update gess 4/11/98
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
nsNode* nsRBTree::First(){
|
||||
nsNode* result=First(*mRoot);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the first node given a starting node
|
||||
*
|
||||
* @update gess 4/11/98
|
||||
* @param aNode --
|
||||
* @return node ptr or null
|
||||
*/
|
||||
nsNode* nsRBTree::First(nsNode& aNode){
|
||||
nsNode* result=0;
|
||||
|
||||
if(mRoot) {
|
||||
result=mRoot;
|
||||
while(result->GetLeftNode()) {
|
||||
result=result->GetLeftNode();
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find the last node in the tree
|
||||
*
|
||||
* @update gess 4/11/98
|
||||
* @param
|
||||
* @return node ptr or null
|
||||
*/
|
||||
nsNode* nsRBTree::Last(){
|
||||
nsNode* result=Last(*mRoot);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find the last node from a given node
|
||||
*
|
||||
* @update gess 4/11/98
|
||||
* @param aNode -- node ptr to start from
|
||||
* @return node ptr or null
|
||||
*/
|
||||
nsNode* nsRBTree::Last(nsNode& aNode){
|
||||
nsNode* result=0;
|
||||
|
||||
if(mRoot) {
|
||||
result=mRoot;
|
||||
while(result->GetRightNode()) {
|
||||
result=result->GetRightNode();
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Retrieve the node that preceeds the given node
|
||||
*
|
||||
* @update gess 4/11/98
|
||||
* @param aNode -- node to find precedent of
|
||||
* @return preceeding node ptr, or null
|
||||
*/
|
||||
nsNode* nsRBTree::Before(nsNode& aNode){
|
||||
|
||||
if(aNode.GetLeftNode())
|
||||
return Last(*aNode.GetLeftNode());
|
||||
|
||||
//otherwise...
|
||||
|
||||
nsNode* node1=&aNode;
|
||||
nsNode* node2=aNode.GetParentNode();
|
||||
|
||||
while((node2) && (node1==node2->GetLeftNode())) {
|
||||
node1=node2;
|
||||
node2=node2->GetParentNode();
|
||||
}
|
||||
return node2;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Retrieve a ptr to the node following the given node
|
||||
*
|
||||
* @update gess 4/11/98
|
||||
* @param aNode -- node to find successor node from
|
||||
* @return node ptr or null
|
||||
*/
|
||||
nsNode* nsRBTree::After(nsNode& aNode){
|
||||
|
||||
if(aNode.GetRightNode())
|
||||
return First(*aNode.GetRightNode());
|
||||
|
||||
//otherwise...
|
||||
|
||||
nsNode* node1=&aNode;
|
||||
nsNode* node2=aNode.GetParentNode();
|
||||
|
||||
while((node2) && (node1==node2->GetRightNode())) {
|
||||
node1=node2;
|
||||
node2=node2->GetParentNode();
|
||||
}
|
||||
|
||||
return node2;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find a (given) node in the tree
|
||||
*
|
||||
* @update gess 4/11/98
|
||||
* @param node to find in the tree
|
||||
* @return node ptr (if found) or null
|
||||
*/
|
||||
nsNode* nsRBTree::Find(nsNode& aNode){
|
||||
nsNode* result=mRoot;
|
||||
|
||||
while((result) && (!((*result)==aNode))) {
|
||||
if(aNode<*result)
|
||||
result=result->mLeft;
|
||||
else result=result->mRight;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Causes a shift to the left, to keep the
|
||||
* underlying RB data in balance
|
||||
*
|
||||
* @update gess 4/11/98
|
||||
* @param
|
||||
* @return this
|
||||
*/
|
||||
nsRBTree& nsRBTree::ShiftLeft(nsNode& aNode){
|
||||
|
||||
nsNode* temp= aNode.mRight;
|
||||
|
||||
aNode.mRight=temp->mLeft;
|
||||
if(temp->mLeft)
|
||||
temp->mRight->mParent=&aNode;
|
||||
temp->mParent= aNode.mParent;
|
||||
if (aNode.mParent) {
|
||||
if (&aNode==aNode.mParent->mLeft)
|
||||
aNode.mParent->mLeft=temp;
|
||||
else aNode.mParent->mRight=temp;
|
||||
}
|
||||
else mRoot=temp;
|
||||
temp->mLeft=&aNode;;
|
||||
aNode.mParent=temp;
|
||||
return *this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Causes a shift right to occur, to keep the
|
||||
* underlying RB data in balance
|
||||
*
|
||||
* @update gess 4/11/98
|
||||
* @param aNode -- node at which to perform shift
|
||||
* @return this
|
||||
*/
|
||||
nsRBTree& nsRBTree::ShiftRight(nsNode& aNode){
|
||||
|
||||
nsNode* temp=aNode.mLeft;
|
||||
|
||||
aNode.mLeft=temp->mRight;
|
||||
if(temp->mRight)
|
||||
temp->mRight->mParent=&aNode;
|
||||
temp->mParent=aNode.mParent;
|
||||
if(aNode.mParent){
|
||||
if(&aNode==aNode.mParent->mRight)
|
||||
aNode.mParent->mRight=temp;
|
||||
else aNode.mParent->mLeft=temp;
|
||||
}
|
||||
else mRoot=temp;
|
||||
temp->mRight=&aNode;
|
||||
aNode.mParent=temp;
|
||||
return *this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Rebalances tree around the given node. This only
|
||||
* needs to be called after a node is deleted.
|
||||
*
|
||||
* @update gess 4/11/98
|
||||
* @param aNode -- node to balance around
|
||||
* @return this
|
||||
*/
|
||||
nsBTree& nsRBTree::ReBalance(nsNode& aNode){
|
||||
|
||||
nsNode* node1=&aNode;
|
||||
nsNode* node2=0;
|
||||
|
||||
while ((node1!=mRoot) && (node1->mColor==nsNode::eBlack)) {
|
||||
if(node1==node1->mParent->mLeft) {
|
||||
node2=node1->mParent->mRight;
|
||||
if(node2->mColor==nsNode::eRed) {
|
||||
node2->mColor=nsNode::eBlack;
|
||||
node1->mParent->mColor=nsNode::eRed;
|
||||
ShiftLeft(*node1->mParent);
|
||||
node2=node1->mParent->mRight;
|
||||
}
|
||||
|
||||
if((node2->mLeft->mColor == nsNode::eBlack) &&
|
||||
(node2->mRight->mColor == nsNode::eBlack)) {
|
||||
node2->mColor=nsNode::eRed;
|
||||
node1=node1->mParent;
|
||||
}
|
||||
else {
|
||||
if(node2->mRight->mColor == nsNode::eBlack) {
|
||||
node2->mLeft->mColor=nsNode::eBlack;
|
||||
node2->mColor=nsNode::eRed;
|
||||
ShiftRight(*node2);
|
||||
node2=node1->mParent->mRight;
|
||||
}
|
||||
|
||||
node2->mColor=node1->mParent->mColor;
|
||||
node1->mParent->mColor=nsNode::eBlack;
|
||||
node2->mRight->mColor=nsNode::eBlack;
|
||||
ShiftLeft(*node1->mParent);
|
||||
node1=mRoot;
|
||||
} //else
|
||||
}
|
||||
else {
|
||||
node2=node1->mParent->mLeft;
|
||||
if(node2->mColor==nsNode::eRed) {
|
||||
node2->mColor=nsNode::eBlack;
|
||||
node1->mParent->mColor=nsNode::eRed;
|
||||
ShiftRight(*node1->mParent);
|
||||
node2=node1->mParent->mLeft;
|
||||
}
|
||||
|
||||
if((node2->mRight->mColor == nsNode::eBlack) &&
|
||||
(node2->mLeft->mColor == nsNode::eBlack)) {
|
||||
node2->mColor=nsNode::eRed;
|
||||
node1=node1->mParent;
|
||||
}
|
||||
else {
|
||||
if(node2->mLeft->mColor == nsNode::eBlack){
|
||||
node2->mRight->mColor=nsNode::eBlack;
|
||||
node2->mColor=nsNode::eRed;
|
||||
ShiftLeft(*node2);
|
||||
node2=node1->mParent->mLeft;
|
||||
}
|
||||
|
||||
node2->mColor=node1->mParent->mColor;
|
||||
node1->mParent->mColor=nsNode::eBlack;
|
||||
node2->mLeft->mColor=nsNode::eBlack;
|
||||
ShiftRight(*node1->mParent);
|
||||
node1=mRoot;
|
||||
} //else
|
||||
} //if
|
||||
} //while
|
||||
|
||||
node1->mColor=nsNode::eBlack;
|
||||
return *this;
|
||||
}
|
||||
|
||||
/**************************************************
|
||||
Here comes the nsRBTreeIterator class...
|
||||
*************************************************/
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @update gess 4/11/98
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
nsRBTreeIterator::nsRBTreeIterator(const nsRBTree& aTree) : mTree(aTree) {
|
||||
}
|
||||
|
||||
/**
|
||||
* copy constructor
|
||||
*
|
||||
* @update gess 4/11/98
|
||||
* @param aCopy is the object you want to copy from
|
||||
* @return newly constructed object
|
||||
*/
|
||||
nsRBTreeIterator::nsRBTreeIterator(const nsRBTreeIterator& aCopy) : mTree(aCopy.mTree) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Destructor method
|
||||
*
|
||||
* @update gess 4/11/98
|
||||
*/
|
||||
nsRBTreeIterator::~nsRBTreeIterator(){
|
||||
}
|
||||
|
||||
/**
|
||||
* This method iterates over the tree, calling
|
||||
* aFunctor for each node.
|
||||
*
|
||||
* @update gess 4/11/98
|
||||
* @param aFunctor -- object to call for each node
|
||||
* @param aNode -- node at which to start iteration
|
||||
* @return this
|
||||
*/
|
||||
const nsRBTreeIterator& nsRBTreeIterator::ForEach(nsNodeFunctor& aFunctor) const{
|
||||
mTree.ForEach(aFunctor);
|
||||
return *this;
|
||||
}
|
||||
223
mozilla/base/src/nsRBTree.h
Normal file
223
mozilla/base/src/nsRBTree.h
Normal file
@@ -0,0 +1,223 @@
|
||||
|
||||
/**
|
||||
* This file defines the binary tree class and its
|
||||
* nsNode child class.
|
||||
*
|
||||
* This simple version stores nodes, and the
|
||||
* nodes store void* ptrs.
|
||||
*
|
||||
* @update gess 4/11/98
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
|
||||
/**
|
||||
* MODULE NOTES
|
||||
* @update gess 4/11/98
|
||||
*
|
||||
* This file declares the nsRBTree (red/black tree).
|
||||
* Red/black trees are auto-balancing binary trees.
|
||||
*
|
||||
* To use this class, define a subclass of nsNode
|
||||
* which stores your data type. It's important that
|
||||
* you overload the following methods:
|
||||
*
|
||||
* virtual PRBool operator<()
|
||||
* virtual PRBool operator==()
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _nsRBTree
|
||||
#define _nsRBTree
|
||||
|
||||
|
||||
#include "nsBTree.h"
|
||||
|
||||
|
||||
/**
|
||||
* Here comes the main event: our nsRBTree (red/black tree).
|
||||
* Red/Black trees are autobalancing binary trees.
|
||||
*
|
||||
* @update gess4/20/98
|
||||
*/
|
||||
|
||||
class NS_BASE nsRBTree : public nsBTree {
|
||||
public:
|
||||
friend class NS_BASE nsRBTreeIterator;
|
||||
|
||||
/**
|
||||
* nsRBTree constructor
|
||||
*
|
||||
* @update gess 4/11/98
|
||||
*/
|
||||
nsRBTree();
|
||||
|
||||
/**
|
||||
* nsRBTree constructor
|
||||
*
|
||||
* @update gess 4/11/98
|
||||
*/
|
||||
nsRBTree(const nsRBTree& aCopy);
|
||||
|
||||
/**
|
||||
* nsRBTree destructor
|
||||
*
|
||||
* @update gess 4/11/98
|
||||
*/
|
||||
virtual ~nsRBTree();
|
||||
|
||||
/**
|
||||
* Given a node, we're supposed to add it into
|
||||
* our tree.
|
||||
*
|
||||
* @update gess 4/11/98
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
nsNode* Add(nsNode& aNode);
|
||||
|
||||
/**
|
||||
* Retrive the first node in the tree
|
||||
*
|
||||
* @update gess 4/11/98
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
nsNode* First(void);
|
||||
|
||||
/**
|
||||
* Retrieve the first node given a starting node
|
||||
*
|
||||
* @update gess 4/11/98
|
||||
* @param aNode --
|
||||
* @return node ptr or null
|
||||
*/
|
||||
nsNode* First(nsNode& aNode);
|
||||
|
||||
/**
|
||||
* Find the last node in the tree
|
||||
*
|
||||
* @update gess 4/11/98
|
||||
* @param
|
||||
* @return node ptr or null
|
||||
*/
|
||||
nsNode* Last(void);
|
||||
|
||||
/**
|
||||
* Find the last node from a given node
|
||||
*
|
||||
* @update gess 4/11/98
|
||||
* @param aNode -- node ptr to start from
|
||||
* @return node ptr or null
|
||||
*/
|
||||
nsNode* Last(nsNode& aNode);
|
||||
|
||||
/**
|
||||
* Retrieve the node that preceeds the given node
|
||||
*
|
||||
* @update gess 4/11/98
|
||||
* @param aNode -- node to find precedent of
|
||||
* @return preceeding node ptr, or null
|
||||
*/
|
||||
nsNode* Before(nsNode& aNode);
|
||||
|
||||
/**
|
||||
* Retrieve a ptr to the node following the given node
|
||||
*
|
||||
* @update gess 4/11/98
|
||||
* @param aNode -- node to find successor node from
|
||||
* @return node ptr or null
|
||||
*/
|
||||
nsNode* After(nsNode& aNode);
|
||||
|
||||
/**
|
||||
* Find a (given) node in the tree
|
||||
*
|
||||
* @update gess 4/11/98
|
||||
* @param node to find in the tree
|
||||
* @return node ptr (if found) or null
|
||||
*/
|
||||
nsNode* Find(nsNode& aNode);
|
||||
|
||||
private:
|
||||
|
||||
/**
|
||||
* Causes a shift to the left, to keep the
|
||||
* underlying RB data in balance
|
||||
*
|
||||
* @update gess 4/11/98
|
||||
* @param
|
||||
* @return this
|
||||
*/
|
||||
nsRBTree& ShiftLeft(nsNode& aNode);
|
||||
|
||||
/**
|
||||
* Causes a shift right to occur, to keep the
|
||||
* underlying RB data in balance
|
||||
*
|
||||
* @update gess 4/11/98
|
||||
* @param aNode -- node at which to perform shift
|
||||
* @return this
|
||||
*/
|
||||
nsRBTree& ShiftRight(nsNode& aNode);
|
||||
|
||||
/**
|
||||
* Rebalances tree around the given node. This only
|
||||
* needs to be called after a node is deleted.
|
||||
*
|
||||
* @update gess 4/11/98
|
||||
* @param aNode -- node to balance around
|
||||
* @return this
|
||||
*/
|
||||
virtual nsBTree& ReBalance(nsNode& aNode);
|
||||
|
||||
};
|
||||
|
||||
class NS_BASE nsRBTreeIterator {
|
||||
public:
|
||||
|
||||
/**
|
||||
* TreeIterator constructor
|
||||
*
|
||||
* @update gess 4/11/98
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
nsRBTreeIterator(const nsRBTree& aTree);
|
||||
|
||||
/**
|
||||
* TreeIterator constructor
|
||||
*
|
||||
* @update gess 4/11/98
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
nsRBTreeIterator(const nsRBTreeIterator& aCopy);
|
||||
|
||||
/**
|
||||
* tree iterator destructor
|
||||
*
|
||||
* @update gess 4/11/98
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
~nsRBTreeIterator();
|
||||
|
||||
/**
|
||||
* This method iterates over the tree, calling
|
||||
* aFunctor for each node.
|
||||
*
|
||||
* @update gess 4/11/98
|
||||
* @param aFunctor -- object to call for each node
|
||||
* @param aNode -- node at which to start iteration
|
||||
* @return this
|
||||
*/
|
||||
const nsRBTreeIterator& ForEach(nsNodeFunctor& aFunctor) const;
|
||||
|
||||
protected:
|
||||
const nsRBTree& mTree;
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
121
mozilla/base/src/nsSizeOfHandler.cpp
Normal file
121
mozilla/base/src/nsSizeOfHandler.cpp
Normal file
@@ -0,0 +1,121 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
#include "nsISizeOfHandler.h"
|
||||
#include "plhash.h"
|
||||
|
||||
static NS_DEFINE_IID(kISizeOfHandlerIID, NS_ISIZEOF_HANDLER_IID);
|
||||
|
||||
class nsSizeOfHandler : public nsISizeOfHandler {
|
||||
public:
|
||||
nsSizeOfHandler();
|
||||
~nsSizeOfHandler();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
// nsISizeOfHandler
|
||||
NS_IMETHOD Add(size_t aSize);
|
||||
virtual PRBool HaveSeen(void* anObject);
|
||||
NS_IMETHOD GetSize(PRUint32& aResult);
|
||||
|
||||
protected:
|
||||
PRUint32 mTotalSize;
|
||||
PLHashTable* mTable;
|
||||
};
|
||||
|
||||
static PLHashNumber
|
||||
HashKey(void* key)
|
||||
{
|
||||
return (PLHashNumber) key;
|
||||
}
|
||||
|
||||
static PRIntn
|
||||
CompareKeys(void* key1, void* key2)
|
||||
{
|
||||
return key1 == key2;
|
||||
}
|
||||
|
||||
nsSizeOfHandler::nsSizeOfHandler()
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mTotalSize = 0;
|
||||
mTable = PL_NewHashTable(8, (PLHashFunction) HashKey,
|
||||
(PLHashComparator) CompareKeys,
|
||||
(PLHashComparator) nsnull,
|
||||
nsnull, nsnull);
|
||||
}
|
||||
|
||||
nsSizeOfHandler::~nsSizeOfHandler()
|
||||
{
|
||||
if (nsnull != mTable) {
|
||||
PL_HashTableDestroy(mTable);
|
||||
}
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS(nsSizeOfHandler, kISizeOfHandlerIID)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSizeOfHandler::Add(size_t aSize)
|
||||
{
|
||||
mTotalSize += aSize;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
PRBool
|
||||
nsSizeOfHandler::HaveSeen(void* anObject)
|
||||
{
|
||||
if (nsnull == mTable) {
|
||||
// When we run out of memory, HaveSeen returns PR_TRUE to stop
|
||||
// wasting time.
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
||||
if (nsnull != anObject) {
|
||||
PRInt32 hashCode = (PRInt32) anObject;
|
||||
PLHashEntry** hep = PL_HashTableRawLookup(mTable, hashCode, anObject);
|
||||
PLHashEntry* he = *hep;
|
||||
if (nsnull != he) {
|
||||
return PR_TRUE;
|
||||
}
|
||||
he = PL_HashTableRawAdd(mTable, hep, hashCode, anObject, anObject);
|
||||
if (nsnull == he) {
|
||||
// When we run out of memory, HaveSeen returns PR_TRUE to stop
|
||||
// wasting time.
|
||||
return PR_TRUE;
|
||||
}
|
||||
return PR_FALSE;
|
||||
}
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSizeOfHandler::GetSize(PRUint32& aResult)
|
||||
{
|
||||
aResult = mTotalSize;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_BASE nsresult
|
||||
NS_NewSizeOfHandler(nsISizeOfHandler** aInstancePtrResult)
|
||||
{
|
||||
nsISizeOfHandler *it = new nsSizeOfHandler();
|
||||
if (it == nsnull) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kISizeOfHandlerIID, (void **) aInstancePtrResult);
|
||||
}
|
||||
133
mozilla/base/src/nsStdFileStream.cpp
Normal file
133
mozilla/base/src/nsStdFileStream.cpp
Normal file
@@ -0,0 +1,133 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
// First checked in on 98/12/08 by John R. McMullen.
|
||||
// Since nsFileStream.h is entirely templates, common code (such as open())
|
||||
// which does not actually depend on the charT, can be placed here.
|
||||
|
||||
#ifdef XP_UNIX
|
||||
// Compile the un-inlined functions in this file only.
|
||||
#define DEFINING_FILE_STREAM
|
||||
#endif
|
||||
|
||||
#include "nsStdFileStream.h"
|
||||
|
||||
#ifdef XP_MAC
|
||||
#include <Errors.h>
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
PRFileDesc* nsFileStreamHelpers::open(
|
||||
const nsFilePath& inFile,
|
||||
IOS_BASE::openmode mode,
|
||||
PRIntn accessMode)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
PRFileDesc* descriptor = 0;
|
||||
const IOS_BASE::openmode valid_modes[]=
|
||||
{
|
||||
IOS_BASE::out,
|
||||
IOS_BASE::out | IOS_BASE::app,
|
||||
IOS_BASE::out | IOS_BASE::trunc,
|
||||
IOS_BASE::in,
|
||||
IOS_BASE::in | IOS_BASE::out,
|
||||
IOS_BASE::in | IOS_BASE::out | IOS_BASE::trunc,
|
||||
// IOS_BASE::out | IOS_BASE::binary,
|
||||
// IOS_BASE::out | IOS_BASE::app | IOS_BASE::binary,
|
||||
// IOS_BASE::out | IOS_BASE::trunc | IOS_BASE::binary,
|
||||
// IOS_BASE::in | IOS_BASE::binary,
|
||||
// IOS_BASE::in | IOS_BASE::out | IOS_BASE::binary,
|
||||
// IOS_BASE::in | IOS_BASE::out | IOS_BASE::trunc | IOS_BASE::binary,
|
||||
0
|
||||
};
|
||||
|
||||
const int nspr_modes[]={
|
||||
PR_WRONLY | PR_CREATE_FILE,
|
||||
PR_WRONLY | PR_CREATE_FILE | PR_APPEND,
|
||||
PR_WRONLY | PR_CREATE_FILE | PR_TRUNCATE,
|
||||
PR_RDONLY,
|
||||
PR_RDONLY | PR_APPEND,
|
||||
PR_RDWR | PR_CREATE_FILE,
|
||||
PR_RDWR | PR_CREATE_FILE | PR_TRUNCATE,
|
||||
// "wb",
|
||||
// "ab",
|
||||
// "wb",
|
||||
// "rb",
|
||||
// "r+b",
|
||||
// "w+b",
|
||||
0 };
|
||||
int ind=0;
|
||||
while (valid_modes[ind] && valid_modes[ind] != (mode&~IOS_BASE::ate))
|
||||
++ind;
|
||||
if (!nspr_modes[ind])
|
||||
return 0;
|
||||
|
||||
#ifdef XP_MAC
|
||||
// Use the file spec to open the file, because one path can be common to
|
||||
// several files on the Macintosh (you can have several volumes with the
|
||||
// same name, see).
|
||||
descriptor = 0;
|
||||
if (inFile.GetNativeSpec().Error() != noErr)
|
||||
return 0;
|
||||
OSErr err = noErr;
|
||||
#if DEBUG
|
||||
const OSType kCreator = 'CWIE';
|
||||
#else
|
||||
const OSType kCreator = 'MOSS';
|
||||
#endif
|
||||
nsNativeFileSpec nativeSpec = inFile.GetNativeSpec();
|
||||
FSSpec* spec = (FSSpec*)nativeSpec;
|
||||
if (nspr_modes[ind] & PR_CREATE_FILE)
|
||||
err = FSpCreate(spec, kCreator, 'TEXT', 0);
|
||||
if (err == dupFNErr)
|
||||
err = noErr;
|
||||
if (err != noErr)
|
||||
return 0;
|
||||
|
||||
SInt8 perm;
|
||||
if (nspr_modes[ind] & PR_RDWR)
|
||||
perm = fsRdWrPerm;
|
||||
else if (nspr_modes[ind] & PR_WRONLY)
|
||||
perm = fsWrPerm;
|
||||
else
|
||||
perm = fsRdPerm;
|
||||
|
||||
short refnum;
|
||||
err = FSpOpenDF(spec, perm, &refnum);
|
||||
|
||||
if (err == noErr && (nspr_modes[ind] & PR_TRUNCATE))
|
||||
err = SetEOF(refnum, 0);
|
||||
if (err == noErr && (nspr_modes[ind] & PR_APPEND))
|
||||
err = SetFPos(refnum, fsFromLEOF, 0);
|
||||
if (err != noErr)
|
||||
return 0;
|
||||
|
||||
if ((descriptor = PR_ImportFile(refnum)) == 0)
|
||||
return 0;
|
||||
#else
|
||||
// Platforms other than Macintosh...
|
||||
if ((descriptor = PR_Open(inFile, nspr_modes[ind], accessMode)) != 0)
|
||||
#endif
|
||||
if (mode&IOS_BASE::ate && PR_Seek(descriptor, 0, PR_SEEK_END) >= 0)
|
||||
{
|
||||
PR_Close(descriptor);
|
||||
descriptor = 0;
|
||||
return 0;
|
||||
}
|
||||
return descriptor;
|
||||
} // nsFileStreamHelpers::open
|
||||
2460
mozilla/base/src/nsString.cpp
Normal file
2460
mozilla/base/src/nsString.cpp
Normal file
File diff suppressed because it is too large
Load Diff
808
mozilla/base/src/nsString.h
Normal file
808
mozilla/base/src/nsString.h
Normal file
@@ -0,0 +1,808 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
MODULE NOTES:
|
||||
|
||||
A. There are two philosophies to building string classes:
|
||||
1. Hide the underlying buffer & offer API's allow indirect iteration
|
||||
2. Reveal underlying buffer, risk corruption, but gain performance
|
||||
|
||||
We chose the second option for performance reasons.
|
||||
|
||||
B Our internal buffer always holds capacity+1 bytes.
|
||||
***********************************************************************/
|
||||
|
||||
|
||||
#ifndef _NSSTRING
|
||||
#define _NSSTRING
|
||||
|
||||
|
||||
#include "prtypes.h"
|
||||
#include "nscore.h"
|
||||
#include "nsIAtom.h"
|
||||
#include <iostream.h>
|
||||
#include <stdio.h>
|
||||
class nsISizeOfHandler;
|
||||
|
||||
class NS_BASE nsString {
|
||||
public:
|
||||
|
||||
/**
|
||||
* Default constructor. Note that we actually allocate a small buffer
|
||||
* to begin with. This is because the "philosophy" of the string class
|
||||
* was to allow developers direct access to the underlying buffer for
|
||||
* performance reasons.
|
||||
*/
|
||||
nsString();
|
||||
|
||||
/**
|
||||
* This constructor accepts an isolatin string
|
||||
* @param an ascii is a ptr to a 1-byte cstr
|
||||
*/
|
||||
nsString(const char* aCString);
|
||||
|
||||
/**
|
||||
* This is our copy constructor
|
||||
* @param reference to another nsString
|
||||
*/
|
||||
nsString(const nsString&);
|
||||
|
||||
/**
|
||||
* Constructor from a unicode string
|
||||
* @param anicodestr pts to a unicode string
|
||||
*/
|
||||
nsString(const PRUnichar* aUnicode);
|
||||
|
||||
/**
|
||||
* Virtual Destructor
|
||||
*/
|
||||
virtual ~nsString();
|
||||
|
||||
|
||||
/**
|
||||
* Retrieve the length of this string
|
||||
* @return string length
|
||||
*/
|
||||
PRInt32 Length() const { return mLength; }
|
||||
|
||||
|
||||
/**
|
||||
* Sets the new length of the string.
|
||||
* @param aLength is new string length.
|
||||
* @return nada
|
||||
*/
|
||||
void SetLength(PRInt32 aLength);
|
||||
|
||||
/**
|
||||
* This method truncates this string to given length.
|
||||
*
|
||||
* @param anIndex -- new length of string
|
||||
* @return nada
|
||||
*/
|
||||
void Truncate(PRInt32 anIndex=0);
|
||||
|
||||
|
||||
/**
|
||||
* This method gets called when the internal buffer needs
|
||||
* to grow to a given size.
|
||||
* @param aNewLength -- new capacity of string
|
||||
* @return void
|
||||
*/
|
||||
virtual void EnsureCapacityFor(PRInt32 aNewLength);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param
|
||||
*/
|
||||
virtual void SizeOf(nsISizeOfHandler* aHandler) const;
|
||||
|
||||
/**
|
||||
* Determine whether or not the characters in this
|
||||
* string are in sorted order.
|
||||
*
|
||||
* @return TRUE if ordered.
|
||||
*/
|
||||
PRBool IsOrdered(void) const;
|
||||
|
||||
/**********************************************************************
|
||||
Accessor methods...
|
||||
*********************************************************************/
|
||||
|
||||
/**
|
||||
* Retrieve pointer to internal string value
|
||||
* @return PRUnichar* to internal string
|
||||
*/
|
||||
const PRUnichar* GetUnicode(void) const;
|
||||
|
||||
/**
|
||||
*
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
operator const PRUnichar*() const;
|
||||
|
||||
/**
|
||||
* Retrieve unicode char at given index
|
||||
* @param offset into string
|
||||
* @return PRUnichar* to internal string
|
||||
*/
|
||||
PRUnichar operator()(PRInt32 anIndex) const;
|
||||
|
||||
/**
|
||||
* Retrieve reference to unicode char at given index
|
||||
* @param offset into string
|
||||
* @return PRUnichar& from internal string
|
||||
*/
|
||||
PRUnichar& operator[](PRInt32 anIndex) const;
|
||||
|
||||
/**
|
||||
* Retrieve reference to unicode char at given index
|
||||
* @param offset into string
|
||||
* @return PRUnichar& from internal string
|
||||
*/
|
||||
PRUnichar& CharAt(PRInt32 anIndex) const;
|
||||
|
||||
/**
|
||||
* Retrieve reference to first unicode char in string
|
||||
* @return PRUnichar from internal string
|
||||
*/
|
||||
PRUnichar& First() const;
|
||||
|
||||
/**
|
||||
* Retrieve reference to last unicode char in string
|
||||
* @return PRUnichar from internal string
|
||||
*/
|
||||
PRUnichar& Last() const;
|
||||
|
||||
/**********************************************************************
|
||||
String creation methods...
|
||||
*********************************************************************/
|
||||
|
||||
/**
|
||||
* Create a new string by appending given string to this
|
||||
* @param aString -- 2nd string to be appended
|
||||
* @return new string
|
||||
*/
|
||||
nsString operator+(const nsString& aString);
|
||||
|
||||
/**
|
||||
* create a new string by adding this to the given buffer.
|
||||
* @param aCString is a ptr to cstring to be added to this
|
||||
* @return newly created string
|
||||
*/
|
||||
nsString operator+(const char* aCString);
|
||||
|
||||
/**
|
||||
* create a new string by adding this to the given char.
|
||||
* @param aChar is a char to be added to this
|
||||
* @return newly created string
|
||||
*/
|
||||
nsString operator+(char aChar);
|
||||
|
||||
/**
|
||||
* create a new string by adding this to the given buffer.
|
||||
* @param aStr unichar buffer to be added to this
|
||||
* @return newly created string
|
||||
*/
|
||||
nsString operator+(const PRUnichar* aBuffer);
|
||||
|
||||
/**
|
||||
* create a new string by adding this to the given char.
|
||||
* @param aChar is a unichar to be added to this
|
||||
* @return newly created string
|
||||
*/
|
||||
nsString operator+(PRUnichar aChar);
|
||||
|
||||
/**
|
||||
* Converts all chars in internal string to lower
|
||||
*/
|
||||
void ToLowerCase();
|
||||
|
||||
/**
|
||||
* Converts all chars in given string to lower
|
||||
*/
|
||||
void ToLowerCase(nsString& aString) const;
|
||||
|
||||
/**
|
||||
* Converts all chars in given string to upper
|
||||
*/
|
||||
void ToUpperCase();
|
||||
|
||||
/**
|
||||
* Converts all chars in given string to UCS2
|
||||
* which ensure that the lower 256 chars are correct.
|
||||
*/
|
||||
void ToUCS2(PRInt32 aStartOffset);
|
||||
|
||||
/**
|
||||
* Converts all chars in internal string to upper
|
||||
*/
|
||||
void ToUpperCase(nsString& aString) const;
|
||||
|
||||
/**
|
||||
* Creates a duplicate clone (ptr) of this string.
|
||||
* @return ptr to clone of this string
|
||||
*/
|
||||
nsString* ToNewString() const;
|
||||
|
||||
/**
|
||||
* Creates an ascii clone of this string
|
||||
* NOTE: This string is allocated with new; YOU MUST deallocate with delete[]!
|
||||
* @return ptr to new c-String string
|
||||
*/
|
||||
char* ToNewCString() const;
|
||||
|
||||
/**
|
||||
* Copies data from internal buffer onto given char* buffer
|
||||
* @param aBuf is the buffer where data is stored
|
||||
* @param aBuflength is the max # of chars to move to buffer
|
||||
* @return ptr to given buffer
|
||||
*/
|
||||
char* ToCString(char* aBuf,PRInt32 aBufLength) const;
|
||||
|
||||
/**
|
||||
* Copies contents of this onto given string.
|
||||
* @param aString to hold copy of this
|
||||
* @return nada.
|
||||
*/
|
||||
void Copy(nsString& aString) const;
|
||||
|
||||
/**
|
||||
* Creates an unichar clone of this string
|
||||
* @return ptr to new unichar string
|
||||
*/
|
||||
PRUnichar* ToNewUnicode() const;
|
||||
|
||||
/**
|
||||
* Perform string to float conversion.
|
||||
* @param aErrorCode will contain error if one occurs
|
||||
* @return float rep of string value
|
||||
*/
|
||||
float ToFloat(PRInt32* aErrorCode) const;
|
||||
|
||||
/**
|
||||
* Perform string to int conversion.
|
||||
* @param aErrorCode will contain error if one occurs
|
||||
* @return int rep of string value
|
||||
*/
|
||||
PRInt32 ToInteger(PRInt32* aErrorCode,PRInt32 aRadix=10) const;
|
||||
|
||||
/**********************************************************************
|
||||
String manipulation methods...
|
||||
*********************************************************************/
|
||||
|
||||
/**
|
||||
* assign given PRUnichar* to this string
|
||||
* @param aStr: buffer to be assigned to this
|
||||
* @param alength is the length of the given str (or -1)
|
||||
if you want me to determine its length
|
||||
* @return this
|
||||
*/
|
||||
nsString& SetString(const PRUnichar* aStr,PRInt32 aLength=-1);
|
||||
|
||||
/**
|
||||
* assign given char* to this string
|
||||
* @param aCString: buffer to be assigned to this
|
||||
* @param alength is the length of the given str (or -1)
|
||||
if you want me to determine its length
|
||||
* @return this
|
||||
*/
|
||||
nsString& SetString(const char* aCString,PRInt32 aLength=-1);
|
||||
|
||||
/**
|
||||
* assign given string to this one
|
||||
* @param aString: string to be added to this
|
||||
* @return this
|
||||
*/
|
||||
nsString& operator=(const nsString& aString);
|
||||
|
||||
/**
|
||||
* assign given char* to this string
|
||||
* @param aCString: buffer to be assigned to this
|
||||
* @return this
|
||||
*/
|
||||
nsString& operator=(const char* aCString);
|
||||
|
||||
/**
|
||||
* assign given char to this string
|
||||
* @param aChar: char to be assignd to this
|
||||
* @return this
|
||||
*/
|
||||
nsString& operator=(char aChar);
|
||||
|
||||
/**
|
||||
* assign given unichar* to this string
|
||||
* @param aBuffer: unichar buffer to be assigned to this
|
||||
* @return this
|
||||
*/
|
||||
nsString& operator=(const PRUnichar* aBuffer);
|
||||
|
||||
/**
|
||||
* assign given char to this string
|
||||
* @param aChar: char to be assignd to this
|
||||
* @return this
|
||||
*/
|
||||
nsString& operator=(PRUnichar aChar);
|
||||
|
||||
/**
|
||||
* append given string to this string
|
||||
* @param aString : string to be appended to this
|
||||
* @return this
|
||||
*/
|
||||
nsString& operator+=(const nsString& aString);
|
||||
|
||||
/**
|
||||
* append given buffer to this string
|
||||
* @param aCString: buffer to be appended to this
|
||||
* @return this
|
||||
*/
|
||||
nsString& operator+=(const char* aCString);
|
||||
|
||||
/**
|
||||
* append given buffer to this string
|
||||
* @param aBuffer: buffer to be appended to this
|
||||
* @return this
|
||||
*/
|
||||
nsString& operator+=(const PRUnichar* aBuffer);
|
||||
|
||||
/**
|
||||
* append given char to this string
|
||||
* @param aChar: char to be appended to this
|
||||
* @return this
|
||||
*/
|
||||
nsString& operator+=(PRUnichar aChar);
|
||||
|
||||
/**
|
||||
* append given string to this string
|
||||
* @param aString : string to be appended to this
|
||||
* @param alength is the length of the given str (or -1)
|
||||
if you want me to determine its length
|
||||
* @return this
|
||||
*/
|
||||
nsString& Append(const nsString& aString,PRInt32 aLength=-1);
|
||||
|
||||
/**
|
||||
* append given string to this string
|
||||
* @param aString : string to be appended to this
|
||||
* @param alength is the length of the given str (or -1)
|
||||
if you want me to determine its length
|
||||
* @return this
|
||||
*/
|
||||
nsString& Append(const char* aCString,PRInt32 aLength=-1);
|
||||
|
||||
/**
|
||||
* append given string to this string
|
||||
* @param aString : string to be appended to this
|
||||
* @return this
|
||||
*/
|
||||
nsString& Append(char aChar);
|
||||
|
||||
/**
|
||||
* append given unichar buffer to this string
|
||||
* @param aString : string to be appended to this
|
||||
* @param alength is the length of the given str (or -1)
|
||||
if you want me to determine its length
|
||||
* @return this
|
||||
*/
|
||||
nsString& Append(const PRUnichar* aBuffer,PRInt32 aLength=-1);
|
||||
|
||||
/**
|
||||
* append given unichar character to this string
|
||||
* @param aChar is the char to be appended to this
|
||||
* @return this
|
||||
*/
|
||||
nsString& Append(PRUnichar aChar);
|
||||
|
||||
/**
|
||||
* Append an integer onto this string
|
||||
* @param aInteger is the int to be appended
|
||||
* @param aRadix specifies 8,10,16
|
||||
* @return this
|
||||
*/
|
||||
nsString& Append(PRInt32 aInteger,PRInt32 aRadix); //radix=8,10 or 16
|
||||
|
||||
/**
|
||||
* Append a float value onto this string
|
||||
* @param aFloat is the float to be appended
|
||||
* @return this
|
||||
*/
|
||||
nsString& Append(float aFloat);
|
||||
|
||||
/*
|
||||
* Copies n characters from this string to given string,
|
||||
* starting at the leftmost offset.
|
||||
*
|
||||
*
|
||||
* @param aCopy -- Receiving string
|
||||
* @param aCount -- number of chars to copy
|
||||
* @return number of chars copied
|
||||
*/
|
||||
PRInt32 Left(nsString& aCopy,PRInt32 aCount) const;
|
||||
|
||||
/*
|
||||
* Copies n characters from this string to given string,
|
||||
* starting at the given offset.
|
||||
*
|
||||
*
|
||||
* @param aCopy -- Receiving string
|
||||
* @param aCount -- number of chars to copy
|
||||
* @param anOffset -- position where copying begins
|
||||
* @return number of chars copied
|
||||
*/
|
||||
PRInt32 Mid(nsString& aCopy,PRInt32 anOffset,PRInt32 aCount) const;
|
||||
|
||||
/*
|
||||
* Copies n characters from this string to given string,
|
||||
* starting at rightmost char.
|
||||
*
|
||||
*
|
||||
* @param aCopy -- Receiving string
|
||||
* @param aCount -- number of chars to copy
|
||||
* @return number of chars copied
|
||||
*/
|
||||
PRInt32 Right(nsString& aCopy,PRInt32 aCount) const;
|
||||
|
||||
/*
|
||||
* This method inserts n chars from given string into this
|
||||
* string at str[anOffset].
|
||||
*
|
||||
* @param aCopy -- String to be inserted into this
|
||||
* @param anOffset -- insertion position within this str
|
||||
* @param aCount -- number of chars to be copied from aCopy
|
||||
* @return number of chars inserted into this.
|
||||
*/
|
||||
PRInt32 Insert(const nsString& aCopy,PRInt32 anOffset,PRInt32 aCount=-1);
|
||||
|
||||
/**
|
||||
* Insert a single unicode char into this string at
|
||||
* a specified offset.
|
||||
*
|
||||
* @param aChar char to be inserted into this string
|
||||
* @param anOffset is insert pos in str
|
||||
* @return the number of chars inserted into this string
|
||||
*/
|
||||
PRInt32 Insert(PRUnichar aChar,PRInt32 anOffset);
|
||||
|
||||
/*
|
||||
* This method is used to cut characters in this string
|
||||
* starting at anOffset, continuing for aCount chars.
|
||||
*
|
||||
* @param anOffset -- start pos for cut operation
|
||||
* @param aCount -- number of chars to be cut
|
||||
* @return *this
|
||||
*/
|
||||
nsString& Cut(PRInt32 anOffset,PRInt32 aCount);
|
||||
|
||||
/**
|
||||
* This method is used to remove all occurances of the
|
||||
* characters found in aSet from this string.
|
||||
*
|
||||
* @param aSet -- characters to be cut from this
|
||||
* @return *this
|
||||
*/
|
||||
nsString& StripChars(const char* aSet);
|
||||
|
||||
/**
|
||||
* This method is used to replace all occurances of the
|
||||
* given source char with the given dest char
|
||||
*
|
||||
* @param
|
||||
* @return *this
|
||||
*/
|
||||
nsString& ReplaceChar(PRUnichar aSourceChar, PRUnichar aDestChar);
|
||||
|
||||
/**
|
||||
* This method strips whitespace throughout the string
|
||||
*
|
||||
* @return this
|
||||
*/
|
||||
nsString& StripWhitespace();
|
||||
|
||||
/**
|
||||
* This method trims characters found in aTrimSet from
|
||||
* either end of the underlying string.
|
||||
*
|
||||
* @param aTrimSet -- contains chars to be trimmed from
|
||||
* both ends
|
||||
* @return this
|
||||
*/
|
||||
nsString& Trim(const char* aSet,
|
||||
PRBool aEliminateLeading=PR_TRUE,
|
||||
PRBool aEliminateTrailing=PR_TRUE);
|
||||
|
||||
/**
|
||||
* This method strips whitespace from string.
|
||||
* You can control whether whitespace is yanked from
|
||||
* start and end of string as well.
|
||||
*
|
||||
* @param aEliminateLeading controls stripping of leading ws
|
||||
* @param aEliminateTrailing controls stripping of trailing ws
|
||||
* @return this
|
||||
*/
|
||||
nsString& CompressWhitespace( PRBool aEliminateLeading=PR_TRUE,
|
||||
PRBool aEliminateTrailing=PR_TRUE);
|
||||
|
||||
/**
|
||||
* Determine if given char is a valid space character
|
||||
*
|
||||
* @param aChar is character to be tested
|
||||
* @return TRUE if is valid space char
|
||||
*/
|
||||
static PRBool IsSpace(PRUnichar ch);
|
||||
|
||||
/**
|
||||
* Determine if given char in valid alpha range
|
||||
*
|
||||
* @param aChar is character to be tested
|
||||
* @return TRUE if in alpha range
|
||||
*/
|
||||
static PRBool IsAlpha(PRUnichar ch);
|
||||
|
||||
/**
|
||||
* Determine if given char is valid digit
|
||||
*
|
||||
* @param aChar is character to be tested
|
||||
* @return TRUE if char is a valid digit
|
||||
*/
|
||||
static PRBool IsDigit(PRUnichar ch);
|
||||
|
||||
/**********************************************************************
|
||||
Searching methods...
|
||||
*********************************************************************/
|
||||
|
||||
/**
|
||||
* Search for given character within this string.
|
||||
* This method does so by using a binary search,
|
||||
* so your string HAD BETTER BE ORDERED!
|
||||
*
|
||||
* @param aChar is the unicode char to be found
|
||||
* @return offset in string, or -1 (kNotFound)
|
||||
*/
|
||||
PRInt32 BinarySearch(PRUnichar aChar) const;
|
||||
|
||||
/**
|
||||
* Search for given substring within this string
|
||||
*
|
||||
* @param aString is substring to be sought in this
|
||||
* @return offset in string, or -1 (kNotFound)
|
||||
*/
|
||||
PRInt32 Find(const char* aString) const;
|
||||
PRInt32 Find(const PRUnichar* aString) const;
|
||||
PRInt32 Find(const nsString& aString) const;
|
||||
|
||||
/**
|
||||
* Search for given char within this string
|
||||
*
|
||||
* @param aChar - char to be found
|
||||
* @return offset in string, or -1 (kNotFound)
|
||||
*/
|
||||
PRInt32 Find(PRUnichar aChar,PRInt32 offset=0) const;
|
||||
|
||||
/**
|
||||
* This method searches this string for the first character
|
||||
* found in the given string
|
||||
* @param aString contains set of chars to be found
|
||||
* @param anOffset tells us where to start searching in this
|
||||
* @return -1 if not found, else the offset in this
|
||||
*/
|
||||
PRInt32 FindCharInSet(const char* aString,PRInt32 anOffset=0) const;
|
||||
PRInt32 FindCharInSet(nsString& aString,PRInt32 anOffset=0) const;
|
||||
|
||||
/**
|
||||
* This method searches this string for the last character
|
||||
* found in the given string
|
||||
* @param aString contains set of chars to be found
|
||||
* @param anOffset tells us where to start searching in this
|
||||
* @return -1 if not found, else the offset in this
|
||||
*/
|
||||
PRInt32 RFindCharInSet(const char* aString,PRInt32 anOffset=0) const;
|
||||
PRInt32 RFindCharInSet(nsString& aString,PRInt32 anOffset=0) const;
|
||||
|
||||
|
||||
/**
|
||||
* This methods scans the string backwards, looking for the given string
|
||||
* @param aString is substring to be sought in this
|
||||
* @param aIgnoreCase tells us whether or not to do caseless compare
|
||||
* @return offset in string, or -1 (kNotFound)
|
||||
*/
|
||||
PRInt32 RFind(const char* aCString,PRBool aIgnoreCase=PR_FALSE) const;
|
||||
PRInt32 RFind(const PRUnichar* aString,PRBool aIgnoreCase=PR_FALSE) const;
|
||||
PRInt32 RFind(const nsString& aString,PRBool aIgnoreCase=PR_FALSE) const;
|
||||
|
||||
/**
|
||||
* This methods scans the string backwards, looking for the given char
|
||||
* @param char is the char to be sought in this
|
||||
* @param aIgnoreCase tells us whether or not to do caseless compare
|
||||
* @return offset in string, or -1 (kNotFound)
|
||||
*/
|
||||
PRInt32 RFind(PRUnichar aChar,PRBool aIgnoreCase=PR_FALSE) const;
|
||||
|
||||
/**********************************************************************
|
||||
Comparison methods...
|
||||
*********************************************************************/
|
||||
|
||||
/**
|
||||
* Compares a given string type to this string.
|
||||
* @update gess 7/27/98
|
||||
* @param S is the string to be compared
|
||||
* @param aIgnoreCase tells us how to treat case
|
||||
* @return -1,0,1
|
||||
*/
|
||||
virtual PRInt32 Compare(const nsString &aString,PRBool aIgnoreCase=PR_FALSE) const;
|
||||
virtual PRInt32 Compare(const char *aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 aLength=-1) const;
|
||||
virtual PRInt32 Compare(const PRUnichar *aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 aLength=-1) const;
|
||||
|
||||
/**
|
||||
* These methods compare a given string type to this one
|
||||
* @param aString is the string to be compared to this
|
||||
* @return TRUE or FALSE
|
||||
*/
|
||||
PRBool operator==(const nsString &aString) const;
|
||||
PRBool operator==(const char *aString) const;
|
||||
PRBool operator==(const PRUnichar* aString) const;
|
||||
PRBool operator==(PRUnichar* aString) const;
|
||||
|
||||
/**
|
||||
* These methods perform a !compare of a given string type to this
|
||||
* @param aString is the string to be compared to this
|
||||
* @return TRUE
|
||||
*/
|
||||
PRBool operator!=(const nsString &aString) const;
|
||||
PRBool operator!=(const char *aString) const;
|
||||
PRBool operator!=(const PRUnichar* aString) const;
|
||||
|
||||
/**
|
||||
* These methods test if a given string is < than this
|
||||
* @param aString is the string to be compared to this
|
||||
* @return TRUE or FALSE
|
||||
*/
|
||||
PRBool operator<(const nsString &aString) const;
|
||||
PRBool operator<(const char *aString) const;
|
||||
PRBool operator<(const PRUnichar* aString) const;
|
||||
|
||||
/**
|
||||
* These methods test if a given string is > than this
|
||||
* @param aString is the string to be compared to this
|
||||
* @return TRUE or FALSE
|
||||
*/
|
||||
PRBool operator>(const nsString &S) const;
|
||||
PRBool operator>(const char *aCString) const;
|
||||
PRBool operator>(const PRUnichar* aString) const;
|
||||
|
||||
/**
|
||||
* These methods test if a given string is <= than this
|
||||
* @param aString is the string to be compared to this
|
||||
* @return TRUE or FALSE
|
||||
*/
|
||||
PRBool operator<=(const nsString &S) const;
|
||||
PRBool operator<=(const char *aCString) const;
|
||||
PRBool operator<=(const PRUnichar* aString) const;
|
||||
|
||||
/**
|
||||
* These methods test if a given string is >= than this
|
||||
* @param aString is the string to be compared to this
|
||||
* @return TRUE or FALSE
|
||||
*/
|
||||
PRBool operator>=(const nsString &S) const;
|
||||
PRBool operator>=(const char* aCString) const;
|
||||
PRBool operator>=(const PRUnichar* aString) const;
|
||||
|
||||
/**
|
||||
* Compare this to given string; note that we compare full strings here.
|
||||
* The optional length argument just lets us know how long the given string is.
|
||||
* If you provide a length, it is compared to length of this string as an
|
||||
* optimization.
|
||||
*
|
||||
* @param aString -- the string to compare to this
|
||||
* @param aLength -- optional length of given string.
|
||||
* @return TRUE if equal
|
||||
*/
|
||||
PRBool Equals(const nsString& aString) const;
|
||||
PRBool Equals(const char* aString,PRInt32 aLength=-1) const;
|
||||
PRBool Equals(const nsIAtom *aAtom) const;
|
||||
|
||||
|
||||
/**
|
||||
* Compares to unichar string ptrs to each other
|
||||
* @param s1 is a ptr to a unichar buffer
|
||||
* @param s2 is a ptr to a unichar buffer
|
||||
* @return TRUE if they match
|
||||
*/
|
||||
PRBool Equals(const PRUnichar* s1, const PRUnichar* s2) const;
|
||||
|
||||
/**
|
||||
* Compare this to given string; note that we compare full strings here.
|
||||
* The optional length argument just lets us know how long the given string is.
|
||||
* If you provide a length, it is compared to length of this string as an
|
||||
* optimization.
|
||||
*
|
||||
* @param aString -- the string to compare to this
|
||||
* @param aLength -- optional length of given string.
|
||||
* @return TRUE if equal
|
||||
*/
|
||||
PRBool EqualsIgnoreCase(const nsString& aString) const;
|
||||
PRBool EqualsIgnoreCase(const char* aString,PRInt32 aLength=-1) const;
|
||||
PRBool EqualsIgnoreCase(const nsIAtom *aAtom) const;
|
||||
|
||||
/**
|
||||
* Compares to unichar string ptrs to each other without respect to case
|
||||
* @param s1 is a ptr to a unichar buffer
|
||||
* @param s2 is a ptr to a unichar buffer
|
||||
* @return TRUE if they match
|
||||
*/
|
||||
PRBool EqualsIgnoreCase(const PRUnichar* s1, const PRUnichar* s2) const;
|
||||
|
||||
|
||||
static void SelfTest();
|
||||
virtual void DebugDump(ostream& aStream) const;
|
||||
|
||||
protected:
|
||||
|
||||
typedef PRUnichar chartype;
|
||||
|
||||
chartype* mStr;
|
||||
PRInt32 mLength;
|
||||
PRInt32 mCapacity;
|
||||
static PRBool mSelfTested;
|
||||
};
|
||||
|
||||
ostream& operator<<(ostream& os,nsString& aString);
|
||||
extern NS_BASE int fputs(const nsString& aString, FILE* out);
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* A version of nsString which is designed to be used as an automatic
|
||||
* variable. It attempts to operate out of a fixed size internal
|
||||
* buffer until too much data is added; then a dynamic buffer is
|
||||
* allocated and grown as necessary.
|
||||
*/
|
||||
// XXX template this with a parameter for the size of the buffer?
|
||||
class NS_BASE nsAutoString : public nsString {
|
||||
public:
|
||||
nsAutoString();
|
||||
nsAutoString(const nsString& other);
|
||||
nsAutoString(const nsAutoString& other);
|
||||
nsAutoString(PRUnichar aChar);
|
||||
nsAutoString(const char* aCString);
|
||||
nsAutoString(const PRUnichar* us, PRInt32 uslen = -1);
|
||||
virtual ~nsAutoString();
|
||||
|
||||
nsAutoString& operator=(const nsString& aString) {nsString::operator=(aString); return *this;}
|
||||
nsAutoString& operator=(const nsAutoString& aString) {nsString::operator=(aString); return *this;}
|
||||
nsAutoString& operator=(const char* aCString) {nsString::operator=(aCString); return *this;}
|
||||
nsAutoString& operator=(char aChar) {nsString::operator=(aChar); return *this;}
|
||||
nsAutoString& operator=(const PRUnichar* aBuffer) {nsString::operator=(aBuffer); return *this;}
|
||||
nsAutoString& operator=(PRUnichar aChar) {nsString::operator=(aChar); return *this;}
|
||||
|
||||
virtual void SizeOf(nsISizeOfHandler* aHandler) const;
|
||||
|
||||
static void SelfTest();
|
||||
|
||||
protected:
|
||||
virtual void EnsureCapacityFor(PRInt32 aNewLength);
|
||||
|
||||
chartype mBuf[32];
|
||||
};
|
||||
|
||||
ostream& operator<<(ostream& os,nsAutoString& aString);
|
||||
|
||||
#endif
|
||||
|
||||
196
mozilla/base/src/nsTime.h
Normal file
196
mozilla/base/src/nsTime.h
Normal file
@@ -0,0 +1,196 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
#ifndef nsTime_h__
|
||||
#define nsTime_h__
|
||||
|
||||
#include "prtime.h"
|
||||
#include "nsInt64.h"
|
||||
#include "nscore.h"
|
||||
|
||||
/**
|
||||
* This class encapsulates full 64-bit time functionality and
|
||||
* provides simple arithmetic and conversion operations.
|
||||
*/
|
||||
|
||||
// If you ever decide that you need to add a non-inline method to this
|
||||
// class, be sure to change the class declaration to "class NS_BASE
|
||||
// nsTime".
|
||||
|
||||
class nsTime
|
||||
{
|
||||
private:
|
||||
nsInt64 mValue;
|
||||
|
||||
public:
|
||||
/**
|
||||
* Construct the current time.
|
||||
*/
|
||||
nsTime(void) : mValue(PR_Now()) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct the time from a string.
|
||||
*/
|
||||
nsTime(const char* dateStr, PRBool defaultToGMT) {
|
||||
PRInt64 time;
|
||||
PRStatus status = PR_ParseTimeString(dateStr, defaultToGMT, &time);
|
||||
if (status == PR_SUCCESS)
|
||||
mValue = time;
|
||||
else
|
||||
mValue = LL_ZERO;
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a time from a PRTime.
|
||||
*/
|
||||
nsTime(const PRTime aTime) : mValue(aTime) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a time from a 64-bit value.
|
||||
*/
|
||||
nsTime(const nsInt64& aTime) : mValue(aTime) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a time from another time.
|
||||
*/
|
||||
nsTime(const nsTime& aTime) : mValue(aTime.mValue) {
|
||||
}
|
||||
|
||||
// ~nsTime(void) -- XXX destructor unnecessary
|
||||
|
||||
/**
|
||||
* Assign one time to another.
|
||||
*/
|
||||
const nsTime& operator =(const nsTime& aTime) {
|
||||
mValue = aTime.mValue;
|
||||
return *this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert a nsTime object to a PRTime
|
||||
*/
|
||||
operator PRTime(void) const {
|
||||
return mValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Subtract a 64-bit interval from a time.
|
||||
*/
|
||||
nsTime& operator -=(const nsInt64& aInterval) {
|
||||
mValue -= aInterval;
|
||||
return *this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a 64-bit interval to a time.
|
||||
*/
|
||||
nsTime& operator +=(const nsInt64& aInterval) {
|
||||
mValue += aInterval;
|
||||
return *this;
|
||||
}
|
||||
|
||||
// Arithmetic operators
|
||||
friend const nsTime operator +(const nsTime& aTime, const nsInt64& aInterval);
|
||||
friend const nsTime operator -(const nsTime& aTime, const nsInt64& aInterval);
|
||||
friend const nsInt64 operator -(const nsTime& aTime1, const nsTime& aTime2);
|
||||
|
||||
// Comparison operators
|
||||
friend const PRBool operator ==(const nsTime& aTime1, const nsTime& aTime2);
|
||||
friend const PRBool operator !=(const nsTime& aTime1, const nsTime& aTime2);
|
||||
friend const PRBool operator <(const nsTime& aTime1, const nsTime& aTime2);
|
||||
friend const PRBool operator <=(const nsTime& aTime1, const nsTime& aTime2);
|
||||
friend const PRBool operator >(const nsTime& aTime1, const nsTime& aTime2);
|
||||
friend const PRBool operator >=(const nsTime& aTime1, const nsTime& aTime2);
|
||||
};
|
||||
|
||||
/**
|
||||
* Binary addition to add a 64-bit interval to a time.
|
||||
*/
|
||||
inline const nsTime
|
||||
operator +(const nsTime& aTime, const nsInt64& aInterval) {
|
||||
return nsTime(aTime.mValue + aInterval);
|
||||
}
|
||||
|
||||
/**
|
||||
* Binary subtraction to subtract a 64-bit interval to a time.
|
||||
*/
|
||||
inline const nsTime
|
||||
operator -(const nsTime& aTime, const nsInt64& aInterval) {
|
||||
return nsTime(aTime.mValue - aInterval);
|
||||
}
|
||||
|
||||
/**
|
||||
* Binary subtraction to compute an interval from the difference of two times.
|
||||
*/
|
||||
inline const nsInt64
|
||||
operator -(const nsTime& aTime1, const nsTime& aTime2) {
|
||||
return aTime1.mValue - aTime2.mValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if two times are equal
|
||||
*/
|
||||
inline const PRBool
|
||||
operator ==(const nsTime& aTime1, const nsTime& aTime2) {
|
||||
return aTime1.mValue == aTime2.mValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if two times are different
|
||||
*/
|
||||
inline const PRBool
|
||||
operator !=(const nsTime& aTime1, const nsTime& aTime2) {
|
||||
return aTime1.mValue != aTime2.mValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if one time is strictly less than another
|
||||
*/
|
||||
inline const PRBool
|
||||
operator <(const nsTime& aTime1, const nsTime& aTime2) {
|
||||
return aTime1.mValue < aTime2.mValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if one time is less than or equal to another
|
||||
*/
|
||||
inline const PRBool
|
||||
operator <=(const nsTime& aTime1, const nsTime& aTime2) {
|
||||
return aTime1.mValue <= aTime2.mValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if one time is strictly greater than another
|
||||
*/
|
||||
inline const PRBool
|
||||
operator >(const nsTime& aTime1, const nsTime& aTime2) {
|
||||
return aTime1.mValue > aTime2.mValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if one time is greater than or equal to another
|
||||
*/
|
||||
inline const PRBool
|
||||
operator >=(const nsTime& aTime1, const nsTime& aTime2) {
|
||||
return aTime1.mValue >= aTime2.mValue;
|
||||
}
|
||||
|
||||
#endif // nsTime_h__
|
||||
142
mozilla/base/src/nsUnicharBuffer.cpp
Normal file
142
mozilla/base/src/nsUnicharBuffer.cpp
Normal file
@@ -0,0 +1,142 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
#include "nsIUnicharBuffer.h"
|
||||
#include "nsIUnicharInputStream.h"
|
||||
#include "nsCRT.h"
|
||||
|
||||
#define MIN_BUFFER_SIZE 32
|
||||
|
||||
class UnicharBufferImpl : public nsIUnicharBuffer {
|
||||
public:
|
||||
UnicharBufferImpl(PRUint32 aBufferSize);
|
||||
~UnicharBufferImpl();
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
virtual PRInt32 GetLength() const;
|
||||
virtual PRInt32 GetBufferSize() const;
|
||||
virtual PRUnichar* GetBuffer() const;
|
||||
virtual PRBool Grow(PRInt32 aNewSize);
|
||||
virtual PRInt32 Fill(nsresult* aErrorCode, nsIUnicharInputStream* aStream,
|
||||
PRInt32 aKeep);
|
||||
|
||||
PRUnichar* mBuffer;
|
||||
PRUint32 mSpace;
|
||||
PRUint32 mLength;
|
||||
};
|
||||
|
||||
UnicharBufferImpl::UnicharBufferImpl(PRUint32 aBufferSize)
|
||||
{
|
||||
if (aBufferSize < MIN_BUFFER_SIZE) {
|
||||
aBufferSize = MIN_BUFFER_SIZE;
|
||||
}
|
||||
mSpace = aBufferSize;
|
||||
mBuffer = new PRUnichar[aBufferSize];
|
||||
mLength = 0;
|
||||
NS_INIT_REFCNT();
|
||||
}
|
||||
|
||||
NS_DEFINE_IID(kUnicharBufferIID, NS_IUNICHAR_BUFFER_IID);
|
||||
NS_IMPL_ISUPPORTS(UnicharBufferImpl,kUnicharBufferIID)
|
||||
|
||||
UnicharBufferImpl::~UnicharBufferImpl()
|
||||
{
|
||||
if (nsnull != mBuffer) {
|
||||
delete mBuffer;
|
||||
mBuffer = nsnull;
|
||||
}
|
||||
mLength = 0;
|
||||
}
|
||||
|
||||
PRInt32 UnicharBufferImpl::GetLength() const
|
||||
{
|
||||
return mLength;
|
||||
}
|
||||
|
||||
PRInt32 UnicharBufferImpl::GetBufferSize() const
|
||||
{
|
||||
return mSpace;
|
||||
}
|
||||
|
||||
PRUnichar* UnicharBufferImpl::GetBuffer() const
|
||||
{
|
||||
return mBuffer;
|
||||
}
|
||||
|
||||
PRBool UnicharBufferImpl::Grow(PRInt32 aNewSize)
|
||||
{
|
||||
if (PRUint32(aNewSize) < MIN_BUFFER_SIZE) {
|
||||
aNewSize = MIN_BUFFER_SIZE;
|
||||
}
|
||||
PRUnichar* newbuf = new PRUnichar[aNewSize];
|
||||
if (nsnull != newbuf) {
|
||||
if (0 != mLength) {
|
||||
nsCRT::memcpy(newbuf, mBuffer, mLength * sizeof(PRUnichar));
|
||||
}
|
||||
delete mBuffer;
|
||||
mBuffer = newbuf;
|
||||
return PR_TRUE;
|
||||
}
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
PRInt32 UnicharBufferImpl::Fill(nsresult* aErrorCode,
|
||||
nsIUnicharInputStream* aStream,
|
||||
PRInt32 aKeep)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aStream, "null stream");
|
||||
NS_PRECONDITION(PRUint32(aKeep) < PRUint32(mLength), "illegal keep count");
|
||||
if ((nsnull == aStream) || (PRUint32(aKeep) >= PRUint32(mLength))) {
|
||||
// whoops
|
||||
*aErrorCode = NS_BASE_STREAM_ILLEGAL_ARGS;
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (0 != aKeep) {
|
||||
// Slide over kept data
|
||||
nsCRT::memmove(mBuffer, mBuffer + (mLength - aKeep),
|
||||
aKeep * sizeof(PRUnichar));
|
||||
}
|
||||
|
||||
// Read in some new data
|
||||
mLength = aKeep;
|
||||
PRInt32 amount = mSpace - aKeep;
|
||||
PRUint32 nb;
|
||||
NS_ASSERTION(aKeep >= 0, "unsigned madness");
|
||||
NS_ASSERTION(amount >= 0, "unsigned madness");
|
||||
*aErrorCode = aStream->Read(mBuffer, (PRUint32)aKeep, (PRUint32)amount, &nb);
|
||||
if (NS_SUCCEEDED(*aErrorCode)) {
|
||||
mLength += nb;
|
||||
}
|
||||
else
|
||||
nb = 0;
|
||||
return nb;
|
||||
}
|
||||
|
||||
NS_BASE nsresult NS_NewUnicharBuffer(nsIUnicharBuffer** aInstancePtrResult,
|
||||
nsISupports* aOuter,
|
||||
PRUint32 aBufferSize)
|
||||
{
|
||||
if (nsnull != aOuter) {
|
||||
return NS_ERROR_NO_AGGREGATION;
|
||||
}
|
||||
UnicharBufferImpl* it = new UnicharBufferImpl(aBufferSize);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kUnicharBufferIID, (void **) aInstancePtrResult);
|
||||
}
|
||||
316
mozilla/base/src/nsUnicharInputStream.cpp
Normal file
316
mozilla/base/src/nsUnicharInputStream.cpp
Normal file
@@ -0,0 +1,316 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
#define NS_IMPL_IDS
|
||||
#include "nsIUnicharInputStream.h"
|
||||
#include "nsIByteBuffer.h"
|
||||
#include "nsIUnicharBuffer.h"
|
||||
#include "nsIServiceManager.h"
|
||||
#include "nsICharsetConverterManager.h"
|
||||
#include "nsIUnicodeDecoder.h"
|
||||
#include "nsString.h"
|
||||
#include "nsCRT.h"
|
||||
#include <fcntl.h>
|
||||
#ifdef NS_WIN32
|
||||
#include <io.h>
|
||||
#else
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
static NS_DEFINE_IID(kIUnicharInputStreamIID, NS_IUNICHAR_INPUT_STREAM_IID);
|
||||
|
||||
class StringUnicharInputStream : public nsIUnicharInputStream {
|
||||
public:
|
||||
StringUnicharInputStream(nsString* aString);
|
||||
~StringUnicharInputStream();
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
NS_IMETHOD Read(PRUnichar* aBuf,
|
||||
PRUint32 aOffset,
|
||||
PRUint32 aCount,
|
||||
PRUint32 *aReadCount);
|
||||
NS_IMETHOD Close();
|
||||
|
||||
nsString* mString;
|
||||
PRUint32 mPos;
|
||||
PRUint32 mLen;
|
||||
};
|
||||
|
||||
StringUnicharInputStream::StringUnicharInputStream(nsString* aString)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mString = aString;
|
||||
mPos = 0;
|
||||
mLen = aString->Length();
|
||||
}
|
||||
|
||||
StringUnicharInputStream::~StringUnicharInputStream()
|
||||
{
|
||||
if (nsnull != mString) {
|
||||
delete mString;
|
||||
}
|
||||
}
|
||||
|
||||
nsresult StringUnicharInputStream::Read(PRUnichar* aBuf,
|
||||
PRUint32 aOffset,
|
||||
PRUint32 aCount,
|
||||
PRUint32 *aReadCount)
|
||||
{
|
||||
if (mPos >= mLen) {
|
||||
*aReadCount = 0;
|
||||
return (nsresult)-1;
|
||||
}
|
||||
const PRUnichar* us = mString->GetUnicode();
|
||||
NS_ASSERTION(mLen >= mPos, "unsigned madness");
|
||||
PRUint32 amount = mLen - mPos;
|
||||
if (amount > aCount) {
|
||||
amount = aCount;
|
||||
}
|
||||
nsCRT::memcpy(aBuf + aOffset, us + mPos, sizeof(PRUnichar) * amount);
|
||||
mPos += amount;
|
||||
*aReadCount = amount;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult StringUnicharInputStream::Close()
|
||||
{
|
||||
mPos = mLen;
|
||||
if (nsnull != mString) {
|
||||
delete mString;
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS(StringUnicharInputStream, kIUnicharInputStreamIID);
|
||||
|
||||
NS_BASE nsresult
|
||||
NS_NewStringUnicharInputStream(nsIUnicharInputStream** aInstancePtrResult,
|
||||
nsString* aString)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aString, "null ptr");
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if ((nsnull == aString) || (nsnull == aInstancePtrResult)) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
StringUnicharInputStream* it = new StringUnicharInputStream(aString);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
return it->QueryInterface(kIUnicharInputStreamIID,
|
||||
(void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* This function used to be public, with the NS_BASE declaration. I am
|
||||
* changing it right now into a module private visibility because there are
|
||||
* better and more xpcom-like ways to get a Converter.
|
||||
*/
|
||||
|
||||
nsresult NS_NewB2UConverter(nsIUnicodeDecoder** aInstancePtrResult, nsISupports* aOuter, nsString* aCharSet);
|
||||
nsresult
|
||||
NS_NewB2UConverter(nsIUnicodeDecoder** aInstancePtrResult,
|
||||
nsISupports* aOuter,
|
||||
nsString* aCharSet)
|
||||
{
|
||||
if (nsnull != aOuter) {
|
||||
return NS_ERROR_NO_AGGREGATION;
|
||||
}
|
||||
|
||||
// Create converter
|
||||
nsresult res;
|
||||
nsICharsetConverterManager * ccm;
|
||||
nsAutoString defaultCharset("ISO-8859-1");
|
||||
|
||||
if (aCharSet == nsnull) aCharSet = &defaultCharset;
|
||||
res = nsServiceManager::GetService(kCharsetConverterManagerCID,
|
||||
kICharsetConverterManagerIID, (nsISupports**)&ccm);
|
||||
if (NS_FAILED(res)) return res;
|
||||
|
||||
res = ccm->GetUnicodeDecoder(aCharSet, aInstancePtrResult);
|
||||
nsServiceManager::ReleaseService(kCharsetConverterManagerCID, ccm);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
class ConverterInputStream : public nsIUnicharInputStream {
|
||||
public:
|
||||
ConverterInputStream(nsIInputStream* aStream,
|
||||
nsIUnicodeDecoder* aConverter,
|
||||
PRUint32 aBufSize);
|
||||
~ConverterInputStream();
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_IMETHOD Read(PRUnichar* aBuf,
|
||||
PRUint32 aOffset,
|
||||
PRUint32 aCount,
|
||||
PRUint32 *aReadCount);
|
||||
NS_IMETHOD Close();
|
||||
|
||||
protected:
|
||||
PRInt32 Fill(nsresult * aErrorCode);
|
||||
|
||||
nsIInputStream* mInput;
|
||||
nsIUnicodeDecoder* mConverter;
|
||||
nsIByteBuffer* mByteData;
|
||||
PRUint32 mByteDataOffset;
|
||||
nsIUnicharBuffer* mUnicharData;
|
||||
PRUint32 mUnicharDataOffset;
|
||||
PRUint32 mUnicharDataLength;
|
||||
};
|
||||
|
||||
ConverterInputStream::ConverterInputStream(nsIInputStream* aStream,
|
||||
nsIUnicodeDecoder* aConverter,
|
||||
PRUint32 aBufferSize)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mInput = aStream; aStream->AddRef();
|
||||
mConverter = aConverter; aConverter->AddRef();
|
||||
if (aBufferSize == 0) {
|
||||
aBufferSize = 8192;
|
||||
}
|
||||
nsresult rv1 = NS_NewByteBuffer(&mByteData, nsnull, aBufferSize);
|
||||
nsresult rv2 = NS_NewUnicharBuffer(&mUnicharData, nsnull, aBufferSize);
|
||||
mByteDataOffset = 0;
|
||||
mUnicharDataOffset = 0;
|
||||
mUnicharDataLength = 0;
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS(ConverterInputStream,kIUnicharInputStreamIID);
|
||||
|
||||
ConverterInputStream::~ConverterInputStream()
|
||||
{
|
||||
Close();
|
||||
}
|
||||
|
||||
nsresult ConverterInputStream::Close()
|
||||
{
|
||||
if (nsnull != mInput) {
|
||||
mInput->Release();
|
||||
mInput = nsnull;
|
||||
}
|
||||
if (nsnull != mConverter) {
|
||||
mConverter->Release();
|
||||
mConverter = nsnull;
|
||||
}
|
||||
if (nsnull != mByteData) {
|
||||
mByteData->Release();
|
||||
mByteData = nsnull;
|
||||
}
|
||||
if (nsnull != mUnicharData) {
|
||||
mUnicharData->Release();
|
||||
mUnicharData = nsnull;
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult ConverterInputStream::Read(PRUnichar* aBuf,
|
||||
PRUint32 aOffset,
|
||||
PRUint32 aCount,
|
||||
PRUint32 *aReadCount)
|
||||
{
|
||||
NS_ASSERTION(mUnicharDataLength >= mUnicharDataOffset, "unsigned madness");
|
||||
PRUint32 rv = mUnicharDataLength - mUnicharDataOffset;
|
||||
nsresult errorCode;
|
||||
if (0 == rv) {
|
||||
// Fill the unichar buffer
|
||||
rv = Fill(&errorCode);
|
||||
if (rv <= 0) {
|
||||
*aReadCount = 0;
|
||||
return errorCode;
|
||||
}
|
||||
}
|
||||
if (rv > aCount) {
|
||||
rv = aCount;
|
||||
}
|
||||
nsCRT::memcpy(aBuf + aOffset, mUnicharData->GetBuffer() + mUnicharDataOffset,
|
||||
rv * sizeof(PRUnichar));
|
||||
mUnicharDataOffset += rv;
|
||||
*aReadCount = rv;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
PRInt32 ConverterInputStream::Fill(nsresult * aErrorCode)
|
||||
{
|
||||
if (nsnull == mInput) {
|
||||
// We already closed the stream!
|
||||
*aErrorCode = NS_BASE_STREAM_CLOSED;
|
||||
return -1;
|
||||
}
|
||||
|
||||
NS_ASSERTION(mByteData->GetLength() >= mByteDataOffset, "unsigned madness");
|
||||
PRUint32 remainder = mByteData->GetLength() - mByteDataOffset;
|
||||
mByteDataOffset = remainder;
|
||||
PRInt32 nb = mByteData->Fill(aErrorCode, mInput, remainder);
|
||||
if (nb <= 0) {
|
||||
// Because we assume a many to one conversion, the lingering data
|
||||
// in the byte buffer must be a partial conversion
|
||||
// fragment. Because we know that we have recieved no more new
|
||||
// data to add to it, we can't convert it. Therefore, we discard
|
||||
// it.
|
||||
return nb;
|
||||
}
|
||||
NS_ASSERTION(remainder + nb == mByteData->GetLength(), "bad nb");
|
||||
|
||||
// Now convert as much of the byte buffer to unicode as possible
|
||||
PRInt32 dstLen = mUnicharData->GetBufferSize();
|
||||
PRInt32 srcLen = remainder + nb;
|
||||
*aErrorCode = mConverter->Convert(mUnicharData->GetBuffer(), 0, &dstLen,
|
||||
mByteData->GetBuffer(), 0, &srcLen);
|
||||
mUnicharDataOffset = 0;
|
||||
mUnicharDataLength = dstLen;
|
||||
mByteDataOffset += srcLen;
|
||||
return dstLen;
|
||||
}
|
||||
|
||||
// XXX hook up auto-detect here (do we need more info, like the url?)
|
||||
NS_BASE nsresult
|
||||
NS_NewConverterStream(nsIUnicharInputStream** aInstancePtrResult,
|
||||
nsISupports* aOuter,
|
||||
nsIInputStream* aStreamToWrap,
|
||||
PRInt32 aBufferSize,
|
||||
nsString* aCharSet)
|
||||
{
|
||||
if (nsnull != aOuter) {
|
||||
return NS_ERROR_NO_AGGREGATION;
|
||||
}
|
||||
|
||||
// Create converter
|
||||
nsIUnicodeDecoder* converter;
|
||||
nsresult rv = NS_NewB2UConverter(&converter, nsnull, aCharSet);
|
||||
if (NS_OK != rv) {
|
||||
return rv;
|
||||
}
|
||||
|
||||
// Create converter input stream
|
||||
ConverterInputStream* it =
|
||||
new ConverterInputStream(aStreamToWrap, converter, aBufferSize);
|
||||
NS_RELEASE(converter);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIUnicharInputStreamIID,
|
||||
(void **) aInstancePtrResult);
|
||||
}
|
||||
182
mozilla/base/src/nsUnitConversion.h
Normal file
182
mozilla/base/src/nsUnitConversion.h
Normal file
@@ -0,0 +1,182 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
#ifndef nsUnitConversion_h__
|
||||
#define nsUnitConversion_h__
|
||||
|
||||
#include "nscore.h"
|
||||
#include <math.h>
|
||||
|
||||
/// handy constants
|
||||
#define TWIPS_PER_POINT_INT 20
|
||||
#define TWIPS_PER_POINT_FLOAT 20.0f
|
||||
#define ROUND_EXCLUSIVE_CONST_FLOAT 0.4999999999999999f // XXX this should be derived from platform FLOAT_MIN
|
||||
#define ROUND_CONST_FLOAT 0.5f
|
||||
#define CEIL_CONST_FLOAT 0.9999999999999999f // XXX this should be derived from platform FLOAT_MIN
|
||||
|
||||
|
||||
/*
|
||||
* Coord Rounding Functions
|
||||
*/
|
||||
inline nscoord NSToCoordFloor(float aValue)
|
||||
{
|
||||
return ((0.0f <= aValue) ? nscoord(aValue) : nscoord(aValue - CEIL_CONST_FLOAT));
|
||||
}
|
||||
|
||||
inline nscoord NSToCoordCeil(float aValue)
|
||||
{
|
||||
return ((0.0f <= aValue) ? nscoord(aValue + CEIL_CONST_FLOAT) : nscoord(aValue));
|
||||
}
|
||||
|
||||
inline nscoord NSToCoordRound(float aValue)
|
||||
{
|
||||
return ((0.0f <= aValue) ? nscoord(aValue + ROUND_CONST_FLOAT) : nscoord(aValue - ROUND_CONST_FLOAT));
|
||||
}
|
||||
|
||||
inline nscoord NSToCoordRoundExclusive(float aValue)
|
||||
{
|
||||
return ((0.0f <= aValue) ? nscoord(aValue + ROUND_EXCLUSIVE_CONST_FLOAT) :
|
||||
nscoord(aValue - ROUND_EXCLUSIVE_CONST_FLOAT));
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Int Rounding Functions
|
||||
*/
|
||||
inline PRInt32 NSToIntFloor(float aValue)
|
||||
{
|
||||
return ((0.0f <= aValue) ? PRInt32(aValue) : PRInt32(aValue - CEIL_CONST_FLOAT));
|
||||
}
|
||||
|
||||
inline PRInt32 NSToIntCeil(float aValue)
|
||||
{
|
||||
return ((0.0f <= aValue) ? PRInt32(aValue + CEIL_CONST_FLOAT) : PRInt32(aValue));
|
||||
}
|
||||
|
||||
inline PRInt32 NSToIntRound(float aValue)
|
||||
{
|
||||
return ((0.0f <= aValue) ? PRInt32(aValue + ROUND_CONST_FLOAT) : PRInt32(aValue - ROUND_CONST_FLOAT));
|
||||
}
|
||||
|
||||
inline PRInt32 NSToIntRoundExclusive(float aValue)
|
||||
{
|
||||
return ((0.0f <= aValue) ? PRInt32(aValue + ROUND_EXCLUSIVE_CONST_FLOAT) :
|
||||
PRInt32(aValue - ROUND_EXCLUSIVE_CONST_FLOAT));
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Twips/Points conversions
|
||||
*/
|
||||
inline nscoord NSFloatPointsToTwips(float aPoints)
|
||||
{
|
||||
return NSToCoordRound(aPoints * TWIPS_PER_POINT_FLOAT);
|
||||
}
|
||||
|
||||
inline nscoord NSIntPointsToTwips(PRInt32 aPoints)
|
||||
{
|
||||
return nscoord(aPoints * TWIPS_PER_POINT_INT);
|
||||
}
|
||||
|
||||
inline PRInt32 NSTwipsToIntPoints(nscoord aTwips)
|
||||
{
|
||||
return NSToIntRound(aTwips / TWIPS_PER_POINT_FLOAT);
|
||||
}
|
||||
|
||||
inline PRInt32 NSTwipsToFloorIntPoints(nscoord aTwips)
|
||||
{
|
||||
return NSToIntFloor(aTwips / TWIPS_PER_POINT_FLOAT);
|
||||
}
|
||||
|
||||
inline PRInt32 NSTwipsToCeilIntPoints(nscoord aTwips)
|
||||
{
|
||||
return NSToIntCeil(aTwips / TWIPS_PER_POINT_FLOAT);
|
||||
}
|
||||
|
||||
inline float NSTwipsToFloatPoints(nscoord aTwips)
|
||||
{
|
||||
return (float(aTwips) / TWIPS_PER_POINT_FLOAT);
|
||||
}
|
||||
|
||||
/*
|
||||
* Twips/Pixel conversions
|
||||
*/
|
||||
inline nscoord NSFloatPixelsToTwips(float aPixels, float aTwipsPerPixel)
|
||||
{
|
||||
return NSToCoordRound(aPixels * aTwipsPerPixel);
|
||||
}
|
||||
|
||||
inline nscoord NSIntPixelsToTwips(PRInt32 aPixels, float aTwipsPerPixel)
|
||||
{
|
||||
return NSToCoordRound(float(aPixels) * aTwipsPerPixel);
|
||||
}
|
||||
|
||||
inline float NSTwipsToFloatPixels(nscoord aTwips, float aPixelsPerTwip)
|
||||
{
|
||||
return (float(aTwips) * aPixelsPerTwip);
|
||||
}
|
||||
|
||||
inline PRInt32 NSTwipsToIntPixels(nscoord aTwips, float aPixelsPerTwip)
|
||||
{
|
||||
return NSToIntRound(float(aTwips) * aPixelsPerTwip);
|
||||
}
|
||||
|
||||
/*
|
||||
* Twips/unit conversions
|
||||
*/
|
||||
inline nscoord NSUnitsToTwips(float aValue, float aPointsPerUnit)
|
||||
{
|
||||
return NSToCoordRound(aValue * aPointsPerUnit * TWIPS_PER_POINT_FLOAT);
|
||||
}
|
||||
|
||||
inline float NSTwipsToUnits(nscoord aTwips, float aUnitsPerPoint)
|
||||
{
|
||||
return (aTwips * (aUnitsPerPoint / TWIPS_PER_POINT_FLOAT));
|
||||
}
|
||||
|
||||
|
||||
/// Unit conversion macros
|
||||
//@{
|
||||
#define NS_INCHES_TO_TWIPS(x) NSUnitsToTwips((x), 72.0f) // 72 points per inch
|
||||
#define NS_FEET_TO_TWIPS(x) NSUnitsToTwips((x), (72.0f * 12.0f)) // 12 inches per foot
|
||||
#define NS_MILES_TO_TWIPS(x) NSUnitsToTwips((x), (72.0f * 12.0f * 5280.0f)) // 5280 feet per mile
|
||||
|
||||
#define NS_MILLIMETERS_TO_TWIPS(x) NSUnitsToTwips((x), (72.0f * 0.03937f))
|
||||
#define NS_CENTIMETERS_TO_TWIPS(x) NSUnitsToTwips((x), (72.0f * 0.3937f))
|
||||
#define NS_METERS_TO_TWIPS(x) NSUnitsToTwips((x), (72.0f * 39.37f))
|
||||
#define NS_KILOMETERS_TO_TWIPS(x) NSUnitsToTwips((x), (72.0f * 39370.0f))
|
||||
|
||||
#define NS_PICAS_TO_TWIPS(x) NSUnitsToTwips((x), 12.0f) // 12 points per pica
|
||||
#define NS_DIDOTS_TO_TWIPS(x) NSUnitsToTwips((x), (16.0f / 15.0f)) // 15 didots per 16 points
|
||||
#define NS_CICEROS_TO_TWIPS(x) NSUnitsToTwips((x), (12.0f * (16.0f / 15.0f))) // 12 didots per cicero
|
||||
|
||||
|
||||
#define NS_TWIPS_TO_INCHES(x) NSTwipsToUnits((x), 1.0f / 72.0f)
|
||||
#define NS_TWIPS_TO_FEET(x) NSTwipsToUnits((x), 1.0f / (72.0f * 12.0f))
|
||||
#define NS_TWIPS_TO_MILES(x) NSTwipsToUnits((x), 1.0f / (72.0f * 12.0f * 5280.0f))
|
||||
|
||||
#define NS_TWIPS_TO_MILLIMETERS(x) NSTwipsToUnits((x), 1.0f / (72.0f * 0.03937f))
|
||||
#define NS_TWIPS_TO_CENTIMETERS(x) NSTwipsToUnits((x), 1.0f / (72.0f * 0.3937f))
|
||||
#define NS_TWIPS_TO_METERS(x) NSTwipsToUnits((x), 1.0f / (72.0f * 39.37f))
|
||||
#define NS_TWIPS_TO_KILOMETERS(x) NSTwipsToUnits((x), 1.0f / (72.0f * 39370.0f))
|
||||
|
||||
#define NS_TWIPS_TO_PICAS(x) NSTwipsToUnits((x), 1.0f / 12.0f)
|
||||
#define NS_TWIPS_TO_DIDOTS(x) NSTwipsToUnits((x), 1.0f / (16.0f / 15.0f))
|
||||
#define NS_TWIPS_TO_CICEROS(x) NSTwipsToUnits((x), 1.0f / (12.0f * (16.0f / 15.0f)))
|
||||
//@}
|
||||
|
||||
#endif
|
||||
411
mozilla/base/src/nsVoidArray.cpp
Normal file
411
mozilla/base/src/nsVoidArray.cpp
Normal file
@@ -0,0 +1,411 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
#include "nsVoidArray.h"
|
||||
#include "nsCRT.h"
|
||||
#include "nsISizeOfHandler.h"
|
||||
#include "nsString.h"
|
||||
|
||||
static PRInt32 kGrowArrayBy = 8;
|
||||
|
||||
nsVoidArray::nsVoidArray()
|
||||
{
|
||||
mArray = nsnull;
|
||||
mArraySize = 0;
|
||||
mCount = 0;
|
||||
}
|
||||
|
||||
nsVoidArray::nsVoidArray(PRInt32 aCount)
|
||||
{
|
||||
NS_PRECONDITION(aCount > 0, "bad count");
|
||||
mCount = mArraySize = aCount;
|
||||
mArray = new void*[mCount];
|
||||
nsCRT::memset(mArray, 0, mCount * sizeof(void*));
|
||||
}
|
||||
|
||||
nsVoidArray& nsVoidArray::operator=(const nsVoidArray& other)
|
||||
{
|
||||
if (nsnull != mArray) {
|
||||
delete mArray;
|
||||
}
|
||||
PRInt32 otherCount = other.mCount;
|
||||
mArraySize = otherCount;
|
||||
mCount = otherCount;
|
||||
if (otherCount != 0) {
|
||||
mArray = new void*[otherCount];
|
||||
nsCRT::memcpy(mArray, other.mArray, otherCount * sizeof(void*));
|
||||
} else {
|
||||
mArray = nsnull;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
nsVoidArray::~nsVoidArray()
|
||||
{
|
||||
if (nsnull != mArray) {
|
||||
delete [] mArray;
|
||||
}
|
||||
}
|
||||
void
|
||||
nsVoidArray::SizeOf(nsISizeOfHandler* aHandler) const
|
||||
{
|
||||
aHandler->Add(sizeof(*this));
|
||||
aHandler->Add(sizeof(void*) * mArraySize);
|
||||
}
|
||||
|
||||
void* nsVoidArray::ElementAt(PRInt32 aIndex) const
|
||||
{
|
||||
if (PRUint32(aIndex) >= PRUint32(mCount)) {
|
||||
return nsnull;
|
||||
}
|
||||
return mArray[aIndex];
|
||||
}
|
||||
|
||||
PRInt32 nsVoidArray::IndexOf(void* aPossibleElement) const
|
||||
{
|
||||
void** ap = mArray;
|
||||
void** end = ap + mCount;
|
||||
while (ap < end) {
|
||||
if (*ap == aPossibleElement) {
|
||||
return ap - mArray;
|
||||
}
|
||||
ap++;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
PRBool nsVoidArray::InsertElementAt(void* aElement, PRInt32 aIndex)
|
||||
{
|
||||
PRInt32 oldCount = mCount;
|
||||
if (PRUint32(aIndex) > PRUint32(oldCount)) {
|
||||
// An invalid index causes the insertion to fail
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
if (oldCount + 1 > mArraySize) {
|
||||
// We have to grow the array
|
||||
PRInt32 newCount = oldCount + kGrowArrayBy;
|
||||
void** newArray = new void*[newCount];
|
||||
if (mArray != nsnull && aIndex != 0)
|
||||
nsCRT::memcpy(newArray, mArray, aIndex * sizeof(void*));
|
||||
PRInt32 slide = oldCount - aIndex;
|
||||
if (0 != slide) {
|
||||
// Slide data over to make room for the insertion
|
||||
nsCRT::memcpy(newArray + aIndex + 1, mArray + aIndex,
|
||||
slide * sizeof(void*));
|
||||
}
|
||||
if (mArray != nsnull)
|
||||
delete [] mArray;
|
||||
mArray = newArray;
|
||||
mArraySize = newCount;
|
||||
} else {
|
||||
// The array is already large enough
|
||||
PRInt32 slide = oldCount - aIndex;
|
||||
if (0 != slide) {
|
||||
// Slide data over to make room for the insertion
|
||||
nsCRT::memmove(mArray + aIndex + 1, mArray + aIndex,
|
||||
slide * sizeof(void*));
|
||||
}
|
||||
}
|
||||
mArray[aIndex] = aElement;
|
||||
mCount++;
|
||||
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
||||
PRBool nsVoidArray::ReplaceElementAt(void* aElement, PRInt32 aIndex)
|
||||
{
|
||||
if (PRUint32(aIndex) >= PRUint32(mArraySize)) {
|
||||
|
||||
PRInt32 requestedCount = aIndex + 1;
|
||||
PRInt32 growDelta = requestedCount - mCount;
|
||||
PRInt32 newCount = mCount + (growDelta > kGrowArrayBy ? growDelta : kGrowArrayBy);
|
||||
void** newArray = new void*[newCount];
|
||||
nsCRT::memset(newArray, 0, newCount * sizeof(void*));
|
||||
if (newArray==nsnull)
|
||||
return PR_FALSE;
|
||||
if (mArray != nsnull && aIndex != 0) {
|
||||
nsCRT::memcpy(newArray, mArray, mCount * sizeof(void*));
|
||||
if (mArray != nsnull)
|
||||
delete [] mArray;
|
||||
}
|
||||
mArray = newArray;
|
||||
mArraySize = newCount;
|
||||
}
|
||||
mArray[aIndex] = aElement;
|
||||
if (aIndex >= mCount)
|
||||
mCount = aIndex+1;
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
||||
PRBool nsVoidArray::RemoveElementAt(PRInt32 aIndex)
|
||||
{
|
||||
PRInt32 oldCount = mCount;
|
||||
if (PRUint32(aIndex) >= PRUint32(oldCount)) {
|
||||
// An invalid index causes the replace to fail
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
// We don't need to move any elements if we're removing the
|
||||
// last element in the array
|
||||
if (aIndex < (oldCount - 1)) {
|
||||
nsCRT::memmove(mArray + aIndex, mArray + aIndex + 1,
|
||||
(oldCount - 1 - aIndex) * sizeof(void*));
|
||||
}
|
||||
|
||||
mCount--;
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
||||
PRBool nsVoidArray::RemoveElement(void* aElement)
|
||||
{
|
||||
void** ep = mArray;
|
||||
void** end = ep + mCount;
|
||||
while (ep < end) {
|
||||
void* e = *ep++;
|
||||
if (e == aElement) {
|
||||
ep--;
|
||||
return RemoveElementAt(PRInt32(ep - mArray));
|
||||
}
|
||||
}
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
void nsVoidArray::Clear()
|
||||
{
|
||||
mCount = 0;
|
||||
}
|
||||
|
||||
void nsVoidArray::Compact()
|
||||
{
|
||||
PRInt32 count = mCount;
|
||||
if (mArraySize != count) {
|
||||
void** newArray = new void*[count];
|
||||
if (nsnull != newArray) {
|
||||
nsCRT::memcpy(newArray, mArray, count * sizeof(void*));
|
||||
delete [] mArray;
|
||||
mArray = newArray;
|
||||
mArraySize = count;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
PRBool nsVoidArray::EnumerateForwards(nsVoidArrayEnumFunc aFunc, void* aData)
|
||||
{
|
||||
PRInt32 index = -1;
|
||||
PRBool running = PR_TRUE;
|
||||
|
||||
while (running && (++index < mCount)) {
|
||||
running = (*aFunc)(mArray[index], aData);
|
||||
}
|
||||
return running;
|
||||
}
|
||||
|
||||
PRBool nsVoidArray::EnumerateBackwards(nsVoidArrayEnumFunc aFunc, void* aData)
|
||||
{
|
||||
PRInt32 index = mCount;
|
||||
PRBool running = PR_TRUE;
|
||||
|
||||
while (running && (0 <= --index)) {
|
||||
running = (*aFunc)(mArray[index], aData);
|
||||
}
|
||||
return running;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------
|
||||
// nsStringArray
|
||||
|
||||
nsStringArray::nsStringArray(void)
|
||||
: nsVoidArray()
|
||||
{
|
||||
}
|
||||
|
||||
nsStringArray::~nsStringArray(void)
|
||||
{
|
||||
Clear();
|
||||
}
|
||||
|
||||
nsStringArray&
|
||||
nsStringArray::operator=(const nsStringArray& other)
|
||||
{
|
||||
if (nsnull != mArray) {
|
||||
delete mArray;
|
||||
}
|
||||
PRInt32 otherCount = other.mCount;
|
||||
mArraySize = otherCount;
|
||||
mCount = otherCount;
|
||||
if (0 < otherCount) {
|
||||
mArray = new void*[otherCount];
|
||||
while (0 <= --otherCount) {
|
||||
nsString* otherString = (nsString*)(other.mArray[otherCount]);
|
||||
mArray[otherCount] = new nsString(*otherString);
|
||||
}
|
||||
} else {
|
||||
mArray = nsnull;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
void
|
||||
nsStringArray::SizeOf(nsISizeOfHandler* aHandler) const
|
||||
{
|
||||
nsVoidArray::SizeOf(aHandler);
|
||||
PRInt32 index = mCount;
|
||||
while (0 <= --index) {
|
||||
nsString* string = (nsString*)mArray[index];
|
||||
string->SizeOf(aHandler);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
nsStringArray::StringAt(PRInt32 aIndex, nsString& aString) const
|
||||
{
|
||||
nsString* string = (nsString*)nsVoidArray::ElementAt(aIndex);
|
||||
if (nsnull != string) {
|
||||
aString = *string;
|
||||
}
|
||||
else {
|
||||
aString.Truncate();
|
||||
}
|
||||
}
|
||||
|
||||
nsString*
|
||||
nsStringArray::StringAt(PRInt32 aIndex) const
|
||||
{
|
||||
return (nsString*)nsVoidArray::ElementAt(aIndex);
|
||||
}
|
||||
|
||||
PRInt32
|
||||
nsStringArray::IndexOf(const nsString& aPossibleString) const
|
||||
{
|
||||
void** ap = mArray;
|
||||
void** end = ap + mCount;
|
||||
while (ap < end) {
|
||||
nsString* string = (nsString*)*ap;
|
||||
if (string->Equals(aPossibleString)) {
|
||||
return ap - mArray;
|
||||
}
|
||||
ap++;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
PRInt32
|
||||
nsStringArray::IndexOfIgnoreCase(const nsString& aPossibleString) const
|
||||
{
|
||||
void** ap = mArray;
|
||||
void** end = ap + mCount;
|
||||
while (ap < end) {
|
||||
nsString* string = (nsString*)*ap;
|
||||
if (string->EqualsIgnoreCase(aPossibleString)) {
|
||||
return ap - mArray;
|
||||
}
|
||||
ap++;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
PRBool
|
||||
nsStringArray::InsertStringAt(const nsString& aString, PRInt32 aIndex)
|
||||
{
|
||||
nsString* string = new nsString(aString);
|
||||
if (nsVoidArray::InsertElementAt(string, aIndex)) {
|
||||
return PR_TRUE;
|
||||
}
|
||||
delete string;
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
PRBool
|
||||
nsStringArray::ReplaceStringAt(const nsString& aString, PRInt32 aIndex)
|
||||
{
|
||||
nsString* string = (nsString*)nsVoidArray::ElementAt(aIndex);
|
||||
if (nsnull != string) {
|
||||
*string = aString;
|
||||
return PR_TRUE;
|
||||
}
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
PRBool
|
||||
nsStringArray::RemoveString(const nsString& aString)
|
||||
{
|
||||
PRInt32 index = IndexOf(aString);
|
||||
if (-1 < index) {
|
||||
return RemoveStringAt(index);
|
||||
}
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
PRBool
|
||||
nsStringArray::RemoveStringIgnoreCase(const nsString& aString)
|
||||
{
|
||||
PRInt32 index = IndexOfIgnoreCase(aString);
|
||||
if (-1 < index) {
|
||||
return RemoveStringAt(index);
|
||||
}
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
PRBool nsStringArray::RemoveStringAt(PRInt32 aIndex)
|
||||
{
|
||||
nsString* string = StringAt(aIndex);
|
||||
if (nsnull != string) {
|
||||
nsVoidArray::RemoveElementAt(aIndex);
|
||||
delete string;
|
||||
return PR_TRUE;
|
||||
}
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
void
|
||||
nsStringArray::Clear(void)
|
||||
{
|
||||
PRInt32 index = mCount;
|
||||
while (0 <= --index) {
|
||||
nsString* string = (nsString*)mArray[index];
|
||||
delete string;
|
||||
}
|
||||
nsVoidArray::Clear();
|
||||
}
|
||||
|
||||
|
||||
|
||||
PRBool
|
||||
nsStringArray::EnumerateForwards(nsStringArrayEnumFunc aFunc, void* aData)
|
||||
{
|
||||
PRInt32 index = -1;
|
||||
PRBool running = PR_TRUE;
|
||||
|
||||
while (running && (++index < mCount)) {
|
||||
running = (*aFunc)(*((nsString*)mArray[index]), aData);
|
||||
}
|
||||
return running;
|
||||
}
|
||||
|
||||
PRBool
|
||||
nsStringArray::EnumerateBackwards(nsStringArrayEnumFunc aFunc, void* aData)
|
||||
{
|
||||
PRInt32 index = mCount;
|
||||
PRBool running = PR_TRUE;
|
||||
|
||||
while (running && (0 <= --index)) {
|
||||
running = (*aFunc)(*((nsString*)mArray[index]), aData);
|
||||
}
|
||||
return running;
|
||||
}
|
||||
|
||||
125
mozilla/base/src/nsVoidArray.h
Normal file
125
mozilla/base/src/nsVoidArray.h
Normal file
@@ -0,0 +1,125 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
#ifndef nsVoidArray_h___
|
||||
#define nsVoidArray_h___
|
||||
|
||||
#include "nscore.h"
|
||||
class nsISizeOfHandler;
|
||||
|
||||
// Enumerator callback function. Return PR_FALSE to stop
|
||||
typedef PRBool (*nsVoidArrayEnumFunc)(void* aElement, void *aData);
|
||||
|
||||
/// A basic zero-based array of void*'s that manages its own memory
|
||||
class NS_BASE nsVoidArray {
|
||||
public:
|
||||
nsVoidArray();
|
||||
nsVoidArray(PRInt32 aCount); // initial count of aCount elements set to nsnull
|
||||
~nsVoidArray();
|
||||
|
||||
nsVoidArray& operator=(const nsVoidArray& other);
|
||||
|
||||
void SizeOf(nsISizeOfHandler* aHandler) const;
|
||||
|
||||
PRInt32 Count() const {
|
||||
return mCount;
|
||||
}
|
||||
|
||||
void* ElementAt(PRInt32 aIndex) const;
|
||||
void* operator[](PRInt32 aIndex) const { return ElementAt(aIndex); }
|
||||
|
||||
PRInt32 IndexOf(void* aPossibleElement) const;
|
||||
|
||||
PRBool InsertElementAt(void* aElement, PRInt32 aIndex);
|
||||
|
||||
PRBool ReplaceElementAt(void* aElement, PRInt32 aIndex);
|
||||
|
||||
PRBool AppendElement(void* aElement) {
|
||||
return InsertElementAt(aElement, mCount);
|
||||
}
|
||||
|
||||
PRBool RemoveElement(void* aElement);
|
||||
PRBool RemoveElementAt(PRInt32 aIndex);
|
||||
void Clear();
|
||||
|
||||
void Compact();
|
||||
|
||||
PRBool EnumerateForwards(nsVoidArrayEnumFunc aFunc, void* aData);
|
||||
PRBool EnumerateBackwards(nsVoidArrayEnumFunc aFunc, void* aData);
|
||||
|
||||
protected:
|
||||
void** mArray;
|
||||
PRInt32 mArraySize;
|
||||
PRInt32 mCount;
|
||||
|
||||
private:
|
||||
/// Copy constructors are not allowed
|
||||
nsVoidArray(const nsVoidArray& other);
|
||||
};
|
||||
|
||||
|
||||
class nsString;
|
||||
|
||||
typedef PRBool (*nsStringArrayEnumFunc)(nsString& aElement, void *aData);
|
||||
|
||||
class NS_BASE nsStringArray: protected nsVoidArray
|
||||
{
|
||||
public:
|
||||
nsStringArray(void);
|
||||
~nsStringArray(void);
|
||||
|
||||
nsStringArray& operator=(const nsStringArray& other);
|
||||
|
||||
void SizeOf(nsISizeOfHandler* aHandler) const;
|
||||
|
||||
PRInt32 Count(void) const {
|
||||
return mCount;
|
||||
}
|
||||
|
||||
void StringAt(PRInt32 aIndex, nsString& aString) const;
|
||||
nsString* StringAt(PRInt32 aIndex) const;
|
||||
nsString* operator[](PRInt32 aIndex) const { return StringAt(aIndex); }
|
||||
|
||||
PRInt32 IndexOf(const nsString& aPossibleString) const;
|
||||
PRInt32 IndexOfIgnoreCase(const nsString& aPossibleString) const;
|
||||
|
||||
PRBool InsertStringAt(const nsString& aString, PRInt32 aIndex);
|
||||
|
||||
PRBool ReplaceStringAt(const nsString& aString, PRInt32 aIndex);
|
||||
|
||||
PRBool AppendString(const nsString& aString) {
|
||||
return InsertStringAt(aString, mCount);
|
||||
}
|
||||
|
||||
PRBool RemoveString(const nsString& aString);
|
||||
PRBool RemoveStringIgnoreCase(const nsString& aString);
|
||||
PRBool RemoveStringAt(PRInt32 aIndex);
|
||||
void Clear(void);
|
||||
|
||||
void Compact(void) {
|
||||
nsVoidArray::Compact();
|
||||
}
|
||||
|
||||
PRBool EnumerateForwards(nsStringArrayEnumFunc aFunc, void* aData);
|
||||
PRBool EnumerateBackwards(nsStringArrayEnumFunc aFunc, void* aData);
|
||||
|
||||
private:
|
||||
/// Copy constructors are not allowed
|
||||
nsStringArray(const nsStringArray& other);
|
||||
};
|
||||
|
||||
#endif /* nsVoidArray_h___ */
|
||||
171
mozilla/base/src/nscore.h
Normal file
171
mozilla/base/src/nscore.h
Normal file
@@ -0,0 +1,171 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
#ifndef nscore_h___
|
||||
#define nscore_h___
|
||||
|
||||
#ifdef _WIN32
|
||||
#define NS_WIN32 1
|
||||
#endif
|
||||
|
||||
#if defined(__unix)
|
||||
#define NS_UNIX 1
|
||||
#endif
|
||||
|
||||
#include "prtypes.h"
|
||||
#include "nsDebug.h"
|
||||
|
||||
/** ucs2 datatype for 2 byte unicode characters */
|
||||
typedef PRUint16 PRUcs2;
|
||||
|
||||
/** ucs4 datatype for 4 byte unicode characters */
|
||||
typedef PRUint32 PRUcs4;
|
||||
|
||||
#ifdef NS_UCS4
|
||||
typedef PRUcs4 PRUnichar;
|
||||
#else
|
||||
typedef PRUcs2 PRUnichar;
|
||||
#endif
|
||||
|
||||
/// The preferred symbol for null.
|
||||
#define nsnull 0
|
||||
|
||||
/* Define brackets for protecting C code from C++ */
|
||||
#ifdef __cplusplus
|
||||
#define NS_BEGIN_EXTERN_C extern "C" {
|
||||
#define NS_END_EXTERN_C }
|
||||
#else
|
||||
#define NS_BEGIN_EXTERN_C
|
||||
#define NS_END_EXTERN_C
|
||||
#endif
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
/* Import/export defines */
|
||||
|
||||
#ifdef NS_WIN32
|
||||
#define NS_IMPORT _declspec(dllimport)
|
||||
#define NS_IMPORT_(type) type _declspec(dllimport) __stdcall
|
||||
#define NS_EXPORT _declspec(dllexport)
|
||||
// XXX NS_EXPORT_ defined in nsCOm.h (xpcom) differs in where the __declspec
|
||||
// is placed. It needs to be done this way to make the 4.x compiler happy...
|
||||
#undef NS_EXPORT_
|
||||
#define NS_EXPORT_(type) type _declspec(dllexport) __stdcall
|
||||
#elif defined(XP_MAC)
|
||||
|
||||
#define NS_IMPORT
|
||||
#define NS_IMPORT_(type) type
|
||||
|
||||
// XXX NS_EXPORT_ defined in nsCom.h actually does an export. Here it's just sugar.
|
||||
#undef NS_EXPORT
|
||||
#undef NS_EXPORT_
|
||||
|
||||
#define NS_EXPORT __declspec(export)
|
||||
#define NS_EXPORT_(type) type __declspec(export)
|
||||
|
||||
#else
|
||||
/* XXX do something useful? */
|
||||
#define NS_IMPORT
|
||||
#define NS_IMPORT_(type) type
|
||||
#define NS_EXPORT
|
||||
#define NS_EXPORT_(type) type
|
||||
#endif
|
||||
|
||||
#ifdef _IMPL_NS_BASE
|
||||
#define NS_BASE NS_EXPORT
|
||||
#else
|
||||
#define NS_BASE NS_IMPORT
|
||||
#endif
|
||||
|
||||
#ifdef _IMPL_NS_NET
|
||||
#define NS_NET NS_EXPORT
|
||||
#else
|
||||
#define NS_NET NS_IMPORT
|
||||
#endif
|
||||
|
||||
#ifdef _IMPL_NS_DOM
|
||||
#define NS_DOM NS_EXPORT
|
||||
#else
|
||||
#define NS_DOM NS_IMPORT
|
||||
#endif
|
||||
|
||||
#ifdef _IMPL_NS_WIDGET
|
||||
#define NS_WIDGET NS_EXPORT
|
||||
#else
|
||||
#define NS_WIDGET NS_IMPORT
|
||||
#endif
|
||||
|
||||
#ifdef _IMPL_NS_VIEW
|
||||
#define NS_VIEW NS_EXPORT
|
||||
#else
|
||||
#define NS_VIEW NS_IMPORT
|
||||
#endif
|
||||
|
||||
#ifdef _IMPL_NS_GFXNONXP
|
||||
#define NS_GFXNONXP NS_EXPORT
|
||||
#define NS_GFXNONXP_(type) NS_EXPORT_(type)
|
||||
#else
|
||||
#define NS_GFXNONXP NS_IMPORT
|
||||
#define NS_GFXNONXP_(type) NS_IMPORT_(type)
|
||||
#endif
|
||||
|
||||
#ifdef _IMPL_NS_GFX
|
||||
#define NS_GFX NS_EXPORT
|
||||
#define NS_GFX_(type) NS_EXPORT_(type)
|
||||
#else
|
||||
#define NS_GFX NS_IMPORT
|
||||
#define NS_GFX_(type) NS_IMPORT_(type)
|
||||
#endif
|
||||
|
||||
#ifdef _IMPL_NS_PLUGIN
|
||||
#define NS_PLUGIN NS_EXPORT
|
||||
#else
|
||||
#define NS_PLUGIN NS_IMPORT
|
||||
#endif
|
||||
|
||||
#ifdef _IMPL_NS_APPSHELL
|
||||
#define NS_APPSHELL NS_EXPORT
|
||||
#else
|
||||
#define NS_APPSHELL NS_IMPORT
|
||||
#endif
|
||||
|
||||
|
||||
/* ------------------------------------------------------------------------ */
|
||||
// Casting macros for hiding C++ features from older compilers
|
||||
|
||||
// unix now determines this automatically
|
||||
#ifndef XP_UNIX
|
||||
#define HAVE_CPP_NEW_CASTS // we'll be optimistic.
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_CPP_NEW_CASTS)
|
||||
#define NS_STATIC_CAST(__type, __ptr) static_cast<__type>(__ptr)
|
||||
#define NS_CONST_CAST(__type, __ptr) const_cast<__type>(__ptr)
|
||||
#define NS_REINTERPRET_CAST(__type, __ptr) reinterpret_cast<__type>(__ptr)
|
||||
#else
|
||||
#define NS_STATIC_CAST(__type, __ptr) ((__type)(__ptr))
|
||||
#define NS_CONST_CAST(__type, __ptr) ((__type)(__ptr))
|
||||
#define NS_REINTERPRET_CAST(__type, __ptr) ((__type)(__ptr))
|
||||
#endif
|
||||
|
||||
// No sense in making an NS_DYNAMIC_CAST() macro: you can't duplicate
|
||||
// the semantics. So if you want to dynamic_cast, then just use it
|
||||
// "straight", no macro.
|
||||
#if defined(AIX)
|
||||
#define explicit
|
||||
#endif
|
||||
|
||||
#endif /* nscore_h___ */
|
||||
47
mozilla/base/src/rhapsody/Makefile.in
Normal file
47
mozilla/base/src/rhapsody/Makefile.in
Normal file
@@ -0,0 +1,47 @@
|
||||
#!gmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
|
||||
|
||||
DEPTH = ../../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
LIBRARY_NAME = gmbaseunix
|
||||
|
||||
MODULE=base
|
||||
|
||||
REQUIRES=xpcom raptor
|
||||
|
||||
DEFINES += -D_IMPL_NS_WIDGET
|
||||
|
||||
CPPSRCS= \
|
||||
nsTimer.cpp
|
||||
|
||||
CPP_OBJS= \
|
||||
./$(OBJDIR)/nsTimer.o \
|
||||
$(NULL)
|
||||
|
||||
include $(topsrcdir)/config/config.mk
|
||||
|
||||
TARGETS = $(LIBRARY)
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
|
||||
39
mozilla/base/src/rhapsody/nsCaretProperties.cpp
Normal file
39
mozilla/base/src/rhapsody/nsCaretProperties.cpp
Normal file
@@ -0,0 +1,39 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
|
||||
#include "nscore.h"
|
||||
|
||||
#include "nsCaretProperties.h"
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
nsCaretProperties::nsCaretProperties()
|
||||
: mCaretWidth(eDefaultCaretWidth)
|
||||
, mBlinkRate(eDefaulBlinkRate)
|
||||
{
|
||||
// in your platform-specific class, get data from the OS in your constructor
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
nsCaretProperties* NewCaretProperties()
|
||||
{
|
||||
return new nsCaretProperties();
|
||||
}
|
||||
200
mozilla/base/src/rhapsody/nsTimer.cpp
Normal file
200
mozilla/base/src/rhapsody/nsTimer.cpp
Normal file
@@ -0,0 +1,200 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
#include "nsITimer.h"
|
||||
#include "nsITimerCallback.h"
|
||||
#include "nsCRT.h"
|
||||
#include "prlog.h"
|
||||
#include <stdio.h>
|
||||
#include <limits.h>
|
||||
|
||||
//
|
||||
// Copied from the unix version, Rhapsody needs to
|
||||
// make this work. Stubs to compile things for now.
|
||||
//
|
||||
|
||||
#if 0
|
||||
Michael Hanni <mhanni@sprintmail.com> suggests:
|
||||
|
||||
I understand that nsTimer.cpp in base/rhapsody/ needs to be completed,
|
||||
yes? Wouldn't this code just use some NSTimers in the NSRunLoop?
|
||||
|
||||
Timer = [NSTimer timerWithTimeInterval:0.02 //seconds
|
||||
target:self
|
||||
selector:@selector(doThis:)
|
||||
userInfo:nil
|
||||
repeats:YES];
|
||||
[[NSRunLoop currentRunLoop] addTimer:Timer
|
||||
forMode:NSDefaultRunLoopMode];
|
||||
|
||||
I only looked at nsTimer.cpp briefly, but could something like this work
|
||||
if imbedded in all that c++? ;-)
|
||||
|
||||
#endif
|
||||
|
||||
static NS_DEFINE_IID(kITimerIID, NS_ITIMER_IID);
|
||||
|
||||
extern void nsTimerExpired(void *aCallData);
|
||||
|
||||
class TimerImpl : public nsITimer {
|
||||
public:
|
||||
|
||||
public:
|
||||
TimerImpl();
|
||||
virtual ~TimerImpl();
|
||||
|
||||
virtual nsresult Init(nsTimerCallbackFunc aFunc,
|
||||
void *aClosure,
|
||||
// PRBool aRepeat,
|
||||
PRUint32 aDelay);
|
||||
|
||||
virtual nsresult Init(nsITimerCallback *aCallback,
|
||||
// PRBool aRepeat,
|
||||
PRUint32 aDelay);
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
virtual void Cancel();
|
||||
virtual PRUint32 GetDelay() { return mDelay; }
|
||||
virtual void SetDelay(PRUint32 aDelay) { mDelay=aDelay; };
|
||||
virtual void* GetClosure() { return mClosure; }
|
||||
|
||||
void FireTimeout();
|
||||
|
||||
private:
|
||||
nsresult Init(PRUint32 aDelay);
|
||||
|
||||
PRUint32 mDelay;
|
||||
nsTimerCallbackFunc mFunc;
|
||||
void *mClosure;
|
||||
nsITimerCallback *mCallback;
|
||||
// PRBool mRepeat;
|
||||
TimerImpl *mNext;
|
||||
int mTimerId;
|
||||
};
|
||||
|
||||
void TimerImpl::FireTimeout()
|
||||
{
|
||||
if (mFunc != NULL) {
|
||||
(*mFunc)(this, mClosure);
|
||||
}
|
||||
else if (mCallback != NULL) {
|
||||
mCallback->Notify(this); // Fire the timer
|
||||
}
|
||||
|
||||
// Always repeating here
|
||||
|
||||
// if (mRepeat)
|
||||
// mTimerId = XtAppAddTimeOut(gAppContext, GetDelay(),(XtTimerCallbackProc)nsTimerExpired, this);
|
||||
}
|
||||
|
||||
|
||||
TimerImpl::TimerImpl()
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mFunc = NULL;
|
||||
mCallback = NULL;
|
||||
mNext = NULL;
|
||||
mTimerId = 0;
|
||||
mDelay = 0;
|
||||
mClosure = NULL;
|
||||
}
|
||||
|
||||
TimerImpl::~TimerImpl()
|
||||
{
|
||||
}
|
||||
|
||||
nsresult
|
||||
TimerImpl::Init(nsTimerCallbackFunc aFunc,
|
||||
void *aClosure,
|
||||
// PRBool aRepeat,
|
||||
PRUint32 aDelay)
|
||||
{
|
||||
mFunc = aFunc;
|
||||
mClosure = aClosure;
|
||||
// mRepeat = aRepeat;
|
||||
|
||||
printf("TimerImpl::Init() not implemented\n");
|
||||
|
||||
#ifdef RHAPSODY_NEEDS_TO_IMPLEMENT_THIS
|
||||
mTimerId = XtAppAddTimeOut(gAppContext, aDelay,(XtTimerCallbackProc)nsTimerExpired, this);
|
||||
#endif
|
||||
|
||||
return Init(aDelay);
|
||||
}
|
||||
|
||||
nsresult
|
||||
TimerImpl::Init(nsITimerCallback *aCallback,
|
||||
// PRBool aRepeat,
|
||||
PRUint32 aDelay)
|
||||
{
|
||||
mCallback = aCallback;
|
||||
// mRepeat = aRepeat;
|
||||
|
||||
printf("TimerImpl::Init() not implmented.\n");
|
||||
|
||||
#ifdef RHAPSODY_NEEDS_TO_IMPLEMENT_THIS
|
||||
mTimerId = XtAppAddTimeOut(gAppContext, aDelay, (XtTimerCallbackProc)nsTimerExpired, this);
|
||||
#endif
|
||||
|
||||
return Init(aDelay);
|
||||
}
|
||||
|
||||
nsresult
|
||||
TimerImpl::Init(PRUint32 aDelay)
|
||||
{
|
||||
mDelay = aDelay;
|
||||
NS_ADDREF(this);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS(TimerImpl, kITimerIID)
|
||||
|
||||
|
||||
void
|
||||
TimerImpl::Cancel()
|
||||
{
|
||||
|
||||
printf("TimerImpl::Cancel() not implemented.\n");
|
||||
|
||||
#ifdef RHAPSODY_NEEDS_TO_IMPLEMENT_THIS
|
||||
XtRemoveTimeOut(mTimerId);
|
||||
#endif
|
||||
}
|
||||
|
||||
NS_BASE nsresult NS_NewTimer(nsITimer** aInstancePtrResult)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
TimerImpl *timer = new TimerImpl();
|
||||
if (nsnull == timer) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
return timer->QueryInterface(kITimerIID, (void **) aInstancePtrResult);
|
||||
}
|
||||
|
||||
|
||||
void nsTimerExpired(void *aCallData)
|
||||
{
|
||||
TimerImpl* timer = (TimerImpl *)aCallData;
|
||||
timer->FireTimeout();
|
||||
}
|
||||
6
mozilla/base/src/unix/README
Normal file
6
mozilla/base/src/unix/README
Normal file
@@ -0,0 +1,6 @@
|
||||
This directory is obsolete.
|
||||
|
||||
The nsTimer files that used to live here have been moved to ../motif
|
||||
in order to allow for multiple unix toolkits.
|
||||
|
||||
ramiro@netscape.com 11-02-1998
|
||||
368
mozilla/base/src/unix/nsFileSpecUnix.cpp
Normal file
368
mozilla/base/src/unix/nsFileSpecUnix.cpp
Normal file
@@ -0,0 +1,368 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
// This file is included by nsFileSpec.cpp, and includes the Unix-specific
|
||||
// implementations.
|
||||
|
||||
#include <sys/stat.h>
|
||||
#include <sys/param.h>
|
||||
#include <errno.h>
|
||||
#include <dirent.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include "nsError.h"
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
void nsFileSpecHelpers::Canonify(char*& ioPath, PRBool inMakeDirs)
|
||||
// Canonify, make absolute, and check whether directories exist
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
if (!ioPath)
|
||||
return;
|
||||
if (inMakeDirs)
|
||||
{
|
||||
const mode_t mode = 0700;
|
||||
nsFileSpecHelpers::MakeAllDirectories(ioPath, mode);
|
||||
}
|
||||
char buffer[MAXPATHLEN];
|
||||
errno = 0;
|
||||
*buffer = '\0';
|
||||
char* canonicalPath = realpath(ioPath, buffer);
|
||||
if (!canonicalPath)
|
||||
{
|
||||
// Linux's realpath() is pathetically buggy. If the reason for the nil
|
||||
// result is just that the leaf does not exist, strip the leaf off,
|
||||
// process that, and then add the leaf back.
|
||||
char* allButLeaf = nsFileSpecHelpers::StringDup(ioPath);
|
||||
if (!allButLeaf)
|
||||
return;
|
||||
char* lastSeparator = strrchr(allButLeaf, '/');
|
||||
if (lastSeparator)
|
||||
{
|
||||
*lastSeparator = '\0';
|
||||
canonicalPath = realpath(allButLeaf, buffer);
|
||||
strcat(buffer, "/");
|
||||
// Add back the leaf
|
||||
strcat(buffer, ++lastSeparator);
|
||||
}
|
||||
delete [] allButLeaf;
|
||||
}
|
||||
if (!canonicalPath && *ioPath != '/' && !inMakeDirs)
|
||||
{
|
||||
// Well, if it's a relative path, hack it ourselves.
|
||||
canonicalPath = realpath(".", buffer);
|
||||
if (canonicalPath)
|
||||
{
|
||||
strcat(canonicalPath, "/");
|
||||
strcat(canonicalPath, ioPath);
|
||||
}
|
||||
}
|
||||
if (canonicalPath)
|
||||
nsFileSpecHelpers::StringAssign(ioPath, canonicalPath);
|
||||
} // nsFileSpecHelpers::Canonify
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
void nsFileSpec::SetLeafName(const char* inLeafName)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
nsFileSpecHelpers::LeafReplace(mPath, '/', inLeafName);
|
||||
} // nsFileSpec::SetLeafName
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
char* nsFileSpec::GetLeafName() const
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
return nsFileSpecHelpers::GetLeaf(mPath, '/');
|
||||
} // nsFileSpec::GetLeafName
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
PRBool nsFileSpec::Exists() const
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
struct stat st;
|
||||
return 0 == stat(mPath, &st);
|
||||
} // nsFileSpec::Exists
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
PRBool nsFileSpec::IsFile() const
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
struct stat st;
|
||||
return 0 == stat(mPath, &st) && S_ISREG(st.st_mode);
|
||||
} // nsFileSpec::IsFile
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
PRBool nsFileSpec::IsDirectory() const
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
struct stat st;
|
||||
return 0 == stat(mPath, &st) && S_ISDIR(st.st_mode);
|
||||
} // nsFileSpec::IsDirectory
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
void nsFileSpec::GetParent(nsFileSpec& outSpec) const
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
nsFileSpecHelpers::StringAssign(outSpec.mPath, mPath);
|
||||
char* cp = strrchr(outSpec.mPath, '/');
|
||||
if (cp)
|
||||
*cp = '\0';
|
||||
} // nsFileSpec::GetParent
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
void nsFileSpec::operator += (const char* inRelativePath)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
if (!inRelativePath || !mPath)
|
||||
return;
|
||||
|
||||
char endChar = mPath[strlen(mPath) - 1];
|
||||
if (endChar == '/')
|
||||
nsFileSpecHelpers::ReallocCat(mPath, "x");
|
||||
else
|
||||
nsFileSpecHelpers::ReallocCat(mPath, "/x");
|
||||
SetLeafName(inRelativePath);
|
||||
} // nsFileSpec::operator +=
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
void nsFileSpec::CreateDirectory(int mode)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
// Note that mPath is canonical!
|
||||
mkdir(mPath, mode);
|
||||
} // nsFileSpec::CreateDirectory
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
void nsFileSpec::Delete(PRBool inRecursive) const
|
||||
// To check if this worked, call Exists() afterwards, see?
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
if (IsDirectory())
|
||||
{
|
||||
if (inRecursive)
|
||||
{
|
||||
for (nsDirectoryIterator i(*this); i.Exists(); i++)
|
||||
{
|
||||
nsFileSpec& child = (nsFileSpec&)i;
|
||||
child.Delete(inRecursive);
|
||||
}
|
||||
}
|
||||
rmdir(mPath);
|
||||
}
|
||||
else
|
||||
remove(mPath);
|
||||
} // nsFileSpec::Delete
|
||||
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
nsresult nsFileSpec::Rename(const char* inNewName)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
// This function should not be used to move a file on disk.
|
||||
if (strchr(inNewName, '/'))
|
||||
return NS_FILE_FAILURE;
|
||||
|
||||
if (PR_Rename(mPath, inNewName) != 0)
|
||||
{
|
||||
return NS_FILE_FAILURE;
|
||||
}
|
||||
SetLeafName(inNewName);
|
||||
return NS_OK;
|
||||
} // nsFileSpec::Rename
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
static int CrudeFileCopy(const char* in, const char* out)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
struct stat in_stat;
|
||||
int stat_result = -1;
|
||||
|
||||
char buf [1024];
|
||||
FILE *ifp, *ofp;
|
||||
int rbytes, wbytes;
|
||||
|
||||
if (!in || !out)
|
||||
return -1;
|
||||
|
||||
stat_result = stat (in, &in_stat);
|
||||
|
||||
ifp = fopen (in, "r");
|
||||
if (!ifp)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
ofp = fopen (out, "w");
|
||||
if (!ofp)
|
||||
{
|
||||
fclose (ifp);
|
||||
return -1;
|
||||
}
|
||||
|
||||
while ((rbytes = fread (buf, 1, sizeof(buf), ifp)) > 0)
|
||||
{
|
||||
while (rbytes > 0)
|
||||
{
|
||||
if ( (wbytes = fwrite (buf, 1, rbytes, ofp)) < 0 )
|
||||
{
|
||||
fclose (ofp);
|
||||
fclose (ifp);
|
||||
unlink(out);
|
||||
return -1;
|
||||
}
|
||||
rbytes -= wbytes;
|
||||
}
|
||||
}
|
||||
fclose (ofp);
|
||||
fclose (ifp);
|
||||
|
||||
if (stat_result == 0)
|
||||
{
|
||||
chmod (out, in_stat.st_mode & 0777);
|
||||
}
|
||||
|
||||
return 0;
|
||||
} // nsFileSpec::Rename
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
nsresult nsFileSpec::Copy(const nsFileSpec& inParentDirectory) const
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
// We can only copy into a directory, and (for now) can not copy entire directories
|
||||
nsresult result = NS_FILE_FAILURE;
|
||||
|
||||
if (inParentDirectory.IsDirectory() && (! IsDirectory() ) )
|
||||
{
|
||||
char *leafname = GetLeafName();
|
||||
char* destPath = nsFileSpecHelpers::StringDup(inParentDirectory, ( strlen(inParentDirectory) + 1 + strlen(leafname) ) );
|
||||
strcat(destPath, "/");
|
||||
strcat(destPath, leafname);
|
||||
delete [] leafname;
|
||||
|
||||
result = NS_FILE_RESULT(CrudeFileCopy(*this, destPath));
|
||||
|
||||
delete [] destPath;
|
||||
}
|
||||
return result;
|
||||
} // nsFileSpec::Copy
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
nsresult nsFileSpec::Move(const nsFileSpec& inNewParentDirectory) const
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
// We can only copy into a directory, and (for now) can not copy entire directories
|
||||
nsresult result = NS_FILE_FAILURE;
|
||||
|
||||
if (inNewParentDirectory.IsDirectory() && (! IsDirectory() ) )
|
||||
{
|
||||
char *leafname = GetLeafName();
|
||||
char* destPath
|
||||
= nsFileSpecHelpers::StringDup(
|
||||
inNewParentDirectory,
|
||||
strlen(inNewParentDirectory) + 1 + strlen(leafname));
|
||||
strcat(destPath, "/");
|
||||
strcat(destPath, leafname);
|
||||
delete [] leafname;
|
||||
|
||||
result = NS_FILE_RESULT(CrudeFileCopy(*this, destPath));
|
||||
if (result == NS_OK)
|
||||
{
|
||||
// cast to fix const-ness
|
||||
((nsFileSpec*)this)->Delete(PR_FALSE);
|
||||
}
|
||||
delete [] destPath;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
nsresult nsFileSpec::Execute(const char* inArgs ) const
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
nsresult result = NS_FILE_FAILURE;
|
||||
|
||||
if (! IsDirectory())
|
||||
{
|
||||
char* fileNameWithArgs
|
||||
= nsFileSpecHelpers::StringDup(mPath, strlen(mPath) + 1 + strlen(inArgs));
|
||||
strcat(fileNameWithArgs, " ");
|
||||
strcat(fileNameWithArgs, inArgs);
|
||||
|
||||
result = NS_FILE_RESULT(system(fileNameWithArgs));
|
||||
delete [] fileNameWithArgs;
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
} // nsFileSpec::Execute
|
||||
|
||||
//========================================================================================
|
||||
// nsDirectoryIterator
|
||||
//========================================================================================
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
nsDirectoryIterator::nsDirectoryIterator(
|
||||
const nsFileSpec& inDirectory
|
||||
, int inIterateDirection)
|
||||
//----------------------------------------------------------------------------------------
|
||||
: mCurrent(inDirectory)
|
||||
, mExists(PR_FALSE)
|
||||
, mDir(nsnull)
|
||||
{
|
||||
mCurrent += "sysygy"; // prepare the path for SetLeafName
|
||||
mDir = opendir((const char*)nsFilePath(inDirectory));
|
||||
++(*this);
|
||||
} // nsDirectoryIterator::nsDirectoryIterator
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
nsDirectoryIterator::~nsDirectoryIterator()
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
if (mDir)
|
||||
closedir(mDir);
|
||||
} // nsDirectoryIterator::nsDirectoryIterator
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
nsDirectoryIterator& nsDirectoryIterator::operator ++ ()
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
mExists = PR_FALSE;
|
||||
if (!mDir)
|
||||
return *this;
|
||||
char* dot = ".";
|
||||
char* dotdot = "..";
|
||||
struct dirent* entry = readdir(mDir);
|
||||
if (entry && strcmp(entry->d_name, dot) == 0)
|
||||
entry = readdir(mDir);
|
||||
if (entry && strcmp(entry->d_name, dotdot) == 0)
|
||||
entry = readdir(mDir);
|
||||
if (entry)
|
||||
{
|
||||
mExists = PR_TRUE;
|
||||
mCurrent.SetLeafName(entry->d_name);
|
||||
}
|
||||
return *this;
|
||||
} // nsDirectoryIterator::operator ++
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
nsDirectoryIterator& nsDirectoryIterator::operator -- ()
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
return ++(*this); // can't do it backwards.
|
||||
} // nsDirectoryIterator::operator --
|
||||
45
mozilla/base/src/windows/makefile.win
Normal file
45
mozilla/base/src/windows/makefile.win
Normal file
@@ -0,0 +1,45 @@
|
||||
#!nmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
|
||||
DEPTH=..\..\..
|
||||
IGNORE_MANIFEST=1
|
||||
|
||||
DEFINES=-D_IMPL_NS_BASE
|
||||
LIBRARY_NAME=gmbase
|
||||
MODULE=raptor
|
||||
REQUIRES=xpcom raptor
|
||||
|
||||
CPPSRCS= nsTimer.cpp \
|
||||
nsCaretProperties.cpp \
|
||||
$(NULL)
|
||||
|
||||
CPP_OBJS= .\$(OBJDIR)\nsTimer.obj \
|
||||
.\$(OBJDIR)\nsCaretProperties.obj \
|
||||
$(NULL)
|
||||
|
||||
LINCS=-I$(XPDIST)\public\xpcom -I$(XPDIST)\public\raptor
|
||||
|
||||
LCFLAGS = \
|
||||
$(LCFLAGS) \
|
||||
-D_IMPL_NS_BASE \
|
||||
$(NULL)
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
|
||||
libs:: $(OBJS)
|
||||
$(MAKE_INSTALL) $(OBJDIR)\nsTimer.obj ..\$(OBJDIR)
|
||||
$(MAKE_INSTALL) $(OBJDIR)\nsCaretProperties.obj ..\$(OBJDIR)
|
||||
40
mozilla/base/src/windows/nsCaretProperties.cpp
Normal file
40
mozilla/base/src/windows/nsCaretProperties.cpp
Normal file
@@ -0,0 +1,40 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
|
||||
#include "nscore.h"
|
||||
|
||||
#include "nsCaretProperties.h"
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
nsCaretProperties::nsCaretProperties()
|
||||
: mCaretWidth(eDefaultCaretWidth)
|
||||
, mBlinkRate(eDefaulBlinkRate)
|
||||
{
|
||||
// in your platform-specific class, get data from the OS in your constructor
|
||||
mCaretWidth = 2; // 2 pixel caret on Windows
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
nsCaretProperties* NewCaretProperties()
|
||||
{
|
||||
return new nsCaretProperties();
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user