| /* A part of the Native C Library for Windows NT |
| Copyright 2026 Rivoreo |
| |
| Permission is hereby granted, free of charge, to any person obtaining |
| a copy of this software and associated documentation files (the |
| "Software"), to deal in the Software without restriction, including |
| without limitation the rights to use, copy, modify, merge, publish, |
| distribute, sublicense, and/or sell copies of the Software, and to |
| permit persons to whom the Software is furnished to do so, subject to |
| the following conditions: |
| |
| The above copyright notice and this permission notice shall be |
| included in all copies or substantial portions of the Software. |
| |
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
| EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
| MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
| IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, |
| DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR |
| OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR |
| THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| */ |
| |
| #ifndef _STDIO_H |
| #define _STDIO_H |
| |
| #include <nativedefs.h> |
| |
| #define __need_size_t |
| #define __need_NULL |
| #define __need_wchar_t |
| #include <stddef.h> |
| #define __need___va_list |
| #include <stdarg.h> |
| |
| #if !defined __FILE_defined && !defined _FILE_DEFINED |
| typedef struct _io_buffer FILE; |
| #define __FILE_defined 1 |
| #define _FILE_DEFINED __FILE_defined |
| #endif |
| |
| #ifdef _USE_IO_BUFFER |
| struct _io_buffer { |
| int _flags; |
| // ... |
| int _fileno; // File descriptor |
| }; |
| #endif |
| |
| #define EOF (-1) |
| |
| #ifndef SEEK_SET |
| #define SEEK_SET 0 |
| #endif |
| |
| #ifndef SEEK_CUR |
| #define SEEK_CUR 1 |
| #endif |
| |
| #ifndef SEEK_END |
| #define SEEK_END 2 |
| #endif |
| |
| #ifndef FILENAME_MAX |
| #define FILENAME_MAX 260 |
| #endif |
| |
| #ifndef __VALIST |
| #ifdef __GNUC__ |
| #define __VALIST __gnuc_va_list |
| #else |
| #define __VALIST char * |
| #endif |
| #endif /* defined __VALIST */ |
| |
| #ifdef __cplusplus |
| extern "C" { |
| #endif |
| |
| int __cdecl printf(const char *, ...); |
| int __cdecl sprintf(char *, const char *, ...); |
| int __cdecl snprintf(char *, size_t, const char *, ...); |
| int __cdecl vprintf(const char *, __VALIST); |
| int __cdecl vsprintf(char *, const char *, __VALIST); |
| int __cdecl vsnprintf(char *, size_t, const char *, __VALIST); |
| |
| int __cdecl putchar(int); |
| int __cdecl puts(const char *); |
| int __cdecl getchar(void); |
| int __cdecl gets(char *); |
| |
| void __cdecl perror(const char *); |
| |
| int __cdecl remove(const char *); |
| int __cdecl rename(const char *, const char *); |
| |
| #ifdef __cplusplus |
| } |
| #endif |
| |
| #endif |