libk.h (803B)
1 #include <stdarg.h> 2 #include <stddef.h> 3 4 #undef assert 5 #ifndef NDEBUG 6 # define assert(exp) ((exp) ? (void) 0 : kassert(#exp, __FILE__, __LINE__)) 7 #else 8 # define assert(exp) ((void)0) 9 #endif 10 11 extern int kprint(const char *fmt, ...); 12 extern int ksnprint(char *str, size_t len, const char *fmt, ...); 13 extern int kvprint(const char *fmt, va_list va); 14 extern char *kgets(char *s, int n); 15 extern int tokenize(char *line, int siz, char *tokens[], int ntoks); 16 extern void kassert(char *exp, char *file, long line); 17 18 #ifdef OS9_H 19 extern int p9todir(Dir *, unsigned char *, int); 20 extern int dirtop9(Dir *, unsigned char *, int); 21 extern int dirstat(char *name, Dir *dir); 22 extern int getline(Chan *, char *, int); 23 #endif 24 25 /* external dependencies of the library */ 26 extern int getch(void); 27 extern void putch(int c);