Add filestream_putc
This commit is contained in:
parent
f0a1b94a11
commit
2bb90f3702
|
@ -66,6 +66,8 @@ int filestream_read_file(const char *path, void **buf, ssize_t *len);
|
|||
|
||||
bool filestream_write_file(const char *path, const void *data, ssize_t size);
|
||||
|
||||
int filestream_putc(RFILE *stream, int c);
|
||||
|
||||
int filestream_get_fd(RFILE *stream);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -409,6 +409,18 @@ error:
|
|||
return -1;
|
||||
}
|
||||
|
||||
int filestream_putc(RFILE *stream, int c)
|
||||
{
|
||||
if (!stream)
|
||||
return EOF;
|
||||
|
||||
#if defined(HAVE_BUFFERED_IO)
|
||||
return fputc(c, stream->fp);
|
||||
#else
|
||||
return EOF;
|
||||
#endif
|
||||
}
|
||||
|
||||
int filestream_close(RFILE *stream)
|
||||
{
|
||||
if (!stream)
|
||||
|
|
Loading…
Reference in New Issue