CoolPotOS/apps/include/stdio.h

43 lines
1.1 KiB
C
Raw Normal View History

2024-07-14 00:54:27 +08:00
#ifndef CRASHPOWEROS_STDIO_H
#define CRASHPOWEROS_STDIO_H
2024-09-01 14:56:38 +08:00
#define EOF -1
#define CANREAD(flag) ((flag)&READ || (flag)&PLUS)
#define CANWRITE(flag) ((flag)&WRITE || (flag)&PLUS || (flag)&APPEND)
#define READ 0x2
#define WRITE 0x4
#define APPEND 0x8
#define BIN 0x0
#define PLUS 0x10
2024-08-30 16:12:44 +08:00
#include <stdint.h>
#include <stddef.h>
2024-08-31 12:36:49 +08:00
#include <stdarg.h>
2024-08-30 16:12:44 +08:00
2024-09-01 14:56:38 +08:00
typedef struct FILE {
unsigned int mode;
unsigned int fileSize;
unsigned char *buffer;
unsigned int bufferSize;
unsigned int p;
char *name;
} FILE;
void put_char(char a);
2024-08-31 12:36:49 +08:00
int printf(const char* fmt, ...);
int puts(const char *s);
int vsprintf(char *buf, const char *fmt, va_list args);
2024-09-01 14:56:38 +08:00
int fgetc(FILE *stream);
FILE *fopen(char *filename, char *mode);
unsigned int fread(void *buffer, unsigned int size, unsigned int count,
FILE *stream);
int fclose(FILE *fp);
char *fgets(char *str, int n, FILE *stream);
int fputs(const char *str, FILE *stream);
int fprintf(FILE *stream, const char *format, ...);
int fputc(int ch, FILE *stream);
unsigned int fwrite(const void *ptr, unsigned int size, unsigned int nmemb,
FILE *stream);
2024-07-14 00:54:27 +08:00
#endif