test.c (395B)
1 #include <u.h> 2 #include <libc.h> 3 #include "fltp.h" 4 5 enum{ 6 BufSize = 4 * 1024 * 1024, 7 }; 8 9 void 10 main(void){ 11 char *b = malloc(BufSize); 12 long n = read(0, b, BufSize); 13 FLTP *f = initfltp(); 14 evalfltp(f, b, n); 15 FLTNode *N = f->np; 16 while(N->prev != nil) N = N->prev; 17 for(; N != nil; N = N->next) { 18 fprint(2, "%.11p %.11p %.*s\n", 19 N, N->parent, N->nbytes, (char*)N + sizeof(FLTNode)); 20 } 21 }