/**
* @brief Open a file
* @param filename Path to the file to open
* @param mode Opening mode ("r", "w", "a", etc.)
* @return FILE pointer on success, NULL on failure
*/
FILE* fopen(const char* filename, const char* mode);
/**
* @brief Close a file
* @param stream FILE pointer to close
* @return 0 on success, EOF on failure
*/
int fclose(FILE* stream);
/**
* @brief Read data from a file
* @param ptr Pointer to buffer where data will be stored
* @param size Size of each element to read
* @param nmemb Number of elements to read
* @param stream FILE pointer to read from
* @return Number of elements successfully read
*/
size_t fread(void* ptr, size_t size, size_t nmemb, FILE* stream);
/**
* @brief Write data to a file
* @param ptr Pointer to data to write
* @param size Size of each element to write
* @param nmemb Number of elements to write
* @param stream FILE pointer to write to
* @return Number of elements successfully written
*/
size_t fwrite(const void* ptr, size_t size, size_t nmemb, FILE* stream);
/**
* @brief Reposition file position indicator
* @param stream FILE pointer to seek on
* @param offset Number of bytes to offset
* @param whence Position from which offset is measured (SEEK_SET, SEEK_CUR, SEEK_END)
* @return 0 on success, non-zero on failure
*/
int fseek(FILE* stream, long offset, int whence);
/**
* @brief Get current file position
* @param stream FILE pointer to examine
* @return Current file position, or -1 on error
* @note Currently unimplemented, always returns 0
*/
long ftell(FILE* stream);
/**
* @brief Reset file position to beginning
* @param stream FILE pointer to rewind
*/
void rewind(FILE* stream);
/**
* @brief Print formatted output to a file
* @param stream FILE pointer to write to
* @param format Format string
* @return Number of characters written, or negative on error
* @note Currently unimplemented, always returns 0
*/
int fprintf(FILE* stream, const char* format, ...);
/**
* @brief Print formatted output to stdout
* @param format Format string
* @return Number of characters written
*/
int printf(const char* format, ...);
/**
* @brief Read formatted input from stdin
* @param format Format string
* @return Number of input items successfully matched and assigned
*/
int scanf(const char* format, ...);
/**
* @brief Read a character from a file
* @param stream FILE pointer to read from
* @return Character read as unsigned char cast to int, or EOF on error
* @note Currently unimplemented, always returns EOF
*/
int fgetc(FILE* stream);
/**
* @brief Read a character from a file (macro version of fgetc)
* @param stream FILE pointer to read from
* @return Character read as unsigned char cast to int, or EOF on error
*/
int getc(FILE* stream);
/**
* @brief Read a character from stdin
* @return Character read as unsigned char cast to int, or EOF on error
*/
int getchar(void);
/**
* @brief Write a character to a file
* @param c Character to write
* @param stream FILE pointer to write to
* @return Character written as unsigned char cast to int, or EOF on error
* @note Currently unimplemented, always returns EOF
*/
int fputc(int c, FILE* stream);
/**
* @brief Write a character to a file (macro version of fputc)
* @param c Character to write
* @param stream FILE pointer to write to
* @return Character written as unsigned char cast to int, or EOF on error
*/
int putc(int c, FILE* stream);
/**
* @brief Write a character to stdout
* @param c Character to write
* @return Character written as unsigned char cast to int, or EOF on error
*/
int putchar(int c);
/**
* @brief Read a line from a file
* @param s Buffer to store the read line
* @param size Maximum number of characters to read
* @param stream FILE pointer to read from
* @return s on success, NULL on error or when no characters are read
*/
char* fgets(char* s, int size, FILE* stream);
/**
* @brief Initialize standard streams
* @note Internal initialization function
*/
void __stdio_init(void);