// Minimal stdio.h stub for freestanding Nim
#ifndef _STDIO_H
#define _STDIO_H

#include <stddef.h>

typedef struct FILE FILE;
#define EOF (-1)
#define stdin  ((FILE*)0)
#define stdout ((FILE*)1)
#define stderr ((FILE*)2)

int printf(const char *format, ...);
int fprintf(FILE *stream, const char *format, ...);
int sprintf(char *str, const char *format, ...);
int snprintf(char *str, size_t size, const char *format, ...);
int vsnprintf(char *str, size_t size, const char *format, ...);
int putchar(int c);
int puts(const char *s);
int fflush(FILE *stream);
size_t fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream);
int ferror(FILE *stream);
void clearerr(FILE *stream);
int fputc(int c, FILE *stream);
int fputs(const char *s, FILE *stream);
char *fgets(char *s, int size, FILE *stream);
int fgetc(FILE *stream);

#endif /* _STDIO_H */
