Stubbed out some more libc functions.
[planlOS.git] / shared / include / stdio.h
blobcad0f4a6725d62270c94fca378c3848ec00c57ba
1 /*
2 Copyright (C) 2008 Mathias Gottschlag
4 Permission is hereby granted, free of charge, to any person obtaining a copy of
5 this software and associated documentation files (the "Software"), to deal in the
6 Software without restriction, including without limitation the rights to use,
7 copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
8 Software, and to permit persons to whom the Software is furnished to do so,
9 subject to the following conditions:
11 The above copyright notice and this permission notice shall be included in all
12 copies or substantial portions of the Software.
14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
15 INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
16 PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
17 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
18 OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
19 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 #ifndef STDIO_H_INCLUDED
23 #define STDIO_H_INCLUDED
25 #include <stdint.h>
26 #include <stdarg.h>
28 #define SEEK_SET 0
29 #define SEEK_CUR 1
30 #define SEEK_END 2
32 #define EOF -1
34 #define L_tmpnam 13
36 #define BUFSIZ 256
38 #define _IOFBF 1
39 #define _IOLBF 2
40 #define _IONBF 3
42 #define NULL ((void*)0)
44 typedef unsigned int fpos_t;
46 typedef struct FILE FILE;
47 extern FILE *stderr;
48 extern FILE *stdout;
49 extern FILE *stdin;
51 FILE *fopen(const char *filename, const char *mode);
52 int fclose(FILE *file);
53 FILE *freopen(const char *filename, const char *mode, FILE *file);
54 int feof(FILE *file);
55 int ferror(FILE *file);
56 int fseek(FILE *file, long int offset, int origin);
57 long int ftell(FILE *file);
58 void rewind(FILE *file);
59 void clearerr(FILE *file);
61 int fgetpos(FILE *file, fpos_t *pos);
62 int fsetpos(FILE *file, const fpos_t *pos);
64 int fgetc(FILE *file);
65 char *fgets(char *str, int num, FILE *file);
66 int fscanf(FILE *file, const char *fmt, ...);
67 size_t fread(void *ptr, size_t size, size_t count, FILE *file);
69 int fputc(int c, FILE *file);
70 int fputs(const char *s, FILE *file);
71 int fprintf(FILE *file, const char *fmt, ...);
72 size_t fwrite(const void *ptr, size_t size, size_t count, FILE *file);
74 FILE *tmpfile(void);
75 char *tmpnam(char *s);
77 int ungetc(int character, FILE *file);
79 int rename(const char *oldname, const char *newname);
80 int remove(const char *filename);
82 int fflush(FILE *file);
84 int fileno(FILE *file);
86 int printf(const char *fmt, ...);
87 int puts(const char *s);
89 int snprintf(char *buf, size_t n, const char *fmt, ...);
90 int sprintf(char *buf, const char *fmt, ...);
91 int vsnprintf(char *buf, size_t n, const char *fmt, va_list arg);
92 int vsprintf(char *buf, const char *fmt, va_list arg);
94 int asprintf(char **buf, const char *fmt, ...);
95 int vasprintf(char **buf, const char *fmt, va_list arg);
97 void perror(const char *str);
99 int setvbuf(FILE *file, char *buf, int type, size_t size);
101 #endif