3 * Copyright (c) 2001,2004 David H. Hovemeyer <daveho@cs.umd.edu>
6 * This is free software. You are permitted to use,
7 * redistribute, and modify it as specified in the file "COPYING".
15 /* Definition of the control structure for streams
17 typedef struct file_struct {
18 short level; /* fill/empty level of buffer */
19 unsigned flags; /* File status flags */
20 char fd; /* File descriptor */
21 unsigned char hold; /* Ungetc char if no buffer */
22 short bsize; /* Buffer size */
23 unsigned char *buffer; /* Data transfer buffer */
24 unsigned char *curp; /* Current active pointer */
25 unsigned istemp; /* Temporary file indicator */
26 short token; /* Used for validity checking */
29 void* memset(void* s, int c, size_t n);
30 void* memcpy(void *dst, const void* src, size_t n);
31 void *memmove(void *dst, const void *src, size_t n);
32 int memcmp(const void *s1, const void *s2, size_t n);
33 size_t strlen(const char* s);
34 size_t strnlen(const char *s, size_t maxlen);
35 int strcmp(const char* s1, const char* s2);
36 int strncmp(const char* s1, const char* s2, size_t limit);
37 char *strcat(char *s1, const char *s2);
38 char *strcpy(char *dest, const char *src);
39 char *strncpy(char *dest, const char *src, size_t limit);
40 char *strdup(const char *s1);
41 int atoi(const char *buf);
42 char *strchr(const char *s, int c);
43 char *strrchr(const char *s, int c);
44 char *strpbrk(const char *s, const char *accept);
45 char *strncat(char *s1, const char *s2, size_t limit);
46 int fprintf(FILE *file, char *fmt, ...);
47 //int fflush(FILE *file);
51 void abort (void) __attribute__ ((__noreturn__));
52 #define _tolower(c) ((c) + 'a' - 'A')
56 /* Note: The ISO C standard puts this in <stdio.h>, but we don't
57 * have that header in GeekOS (yet). */
58 int snprintf(char *s, size_t size, const char *fmt, ...)
59 __attribute__ ((__format__ (__printf__, 3, 4)));