raz / sbcl / lib / C.raz

14 lines · 509 B · raw · history · last change cfa2bc20

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. *)
3module C;
4
5extern var stdout*: ^U8; (* C's FILE *stdout *)
6
7extern proc printf*(format: ^U8; ...): I32;
8extern proc fflush*(f: ^U8): I32;
9extern proc malloc*(size: UINT): ^U8;
10extern proc free*(p: ^U8);
11extern proc pthread_create*(thread: ^UINT; attr: ^U8; start: proc(arg: ^U8): ^U8; arg: ^U8): I32;
12extern proc pthread_join*(thread: UINT; result: ^^U8): I32;
13
14end C.