omega-mv
Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance.
Brought by drakestapleton
omega-mv / train / omega-llm / tools / contrast / read.om
| 1 | fn pickread fd int dest edit uchar * to ulong |
| 2 | if lt fd 0 |
| 3 | exit 74 |
| 4 | end |
| 5 | used = ulong 0 |
| 6 | while lt used len dest bound 8193 |
| 7 | n = read fd dest used sub len dest used |
| 8 | if lt n 0 |
| 9 | exit 74 |
| 10 | end |
| 11 | if eq n 0 |
| 12 | break |
| 13 | end |
| 14 | used = add used ulong n |
| 15 | end |
| 16 | cl = fclose fd |
| 17 | if eq used len dest |
| 18 | exit 74 |
| 19 | end |
| 20 | ret used |
| 21 | end |
| 22 | fn pickload a ulong dest edit uchar * to ulong |
| 23 | wdpclr |
| 24 | wdpa a |
| 25 | ret pickread wdopen 0 0 dest |
| 26 | end |