spark-connector
aien-dev/spark-connector
Brought by drakestapleton
spark-connector / gates / hostile / env.om
| 1 | note hostile probe: print every environment entry and the count |
| 2 | text m1 "env " |
| 3 | text nl "\n" |
| 4 | fn main to int |
| 5 | b = new uchar 4096 0 |
| 6 | d = new uchar 4 0 |
| 7 | c = envcnt |
| 8 | for i ulong ulong c bound 4096 |
| 9 | n = envread i b 0 4096 |
| 10 | if gt n 0 |
| 11 | k = write 1 b 0 ulong n |
| 12 | k = write 1 nl 0 len nl |
| 13 | end |
| 14 | end |
| 15 | k = write 1 m1 0 len m1 |
| 16 | put d 0 uchar add 48 rem ulong c 10 |
| 17 | k = write 1 d 0 1 |
| 18 | k = write 1 nl 0 len nl |
| 19 | ret 0 |
| 20 | end |