| 1 | (* The parts of the C library that programs use most: printf, fflush, |
| 2 | stdout and pthread_create. A program that imports C uses C. *) |
| 3 | module C; |
| 4 | |
| 5 | extern var stdout*: ^U8; (* C's FILE *stdout *) |
| 6 | |
| 7 | extern proc printf*(format: ^U8; ...): I32; |
| 8 | extern proc fflush*(f: ^U8): I32; |
| 9 | extern proc malloc*(size: UINT): ^U8; |
| 10 | extern proc free*(p: ^U8); |
| 11 | extern proc pthread_create*(thread: ^UINT; attr: ^U8; start: proc(arg: ^U8): ^U8; arg: ^U8): I32; |
| 12 | extern proc pthread_join*(thread: UINT; result: ^^U8): I32; |
| 13 | |
| 14 | end C. |