Common code for various VFS-stream related operations. More...
#include <glib.h>
#include <glib/gprintf.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "vfs.h"
Go to the source code of this file.
Functions | |
int | vfs_fputc (int c, VFSFile *stream) |
Writes a character to a stream. | |
char * | vfs_fgets (char *s, int n, VFSFile *stream) |
Reads a string of characters from a stream, ending in newline or EOF. | |
int | vfs_fputs (const char *s, VFSFile *stream) |
Writes a string to a VFS stream. | |
int | vfs_vfprintf (VFSFile *stream, char const *format, va_list args) |
Writes a formatted string to a VFS stream via a va_list of args. | |
int | vfs_fprintf (VFSFile *stream, char const *format,...) |
Writes a formatted string to a VFS stream. | |
void | vfs_file_get_contents (const char *filename, void **buf, int64_t *size) |
Gets contents of the file into a buffer. | |
bool_t | vfs_fget_le16 (uint16_t *value, VFSFile *stream) |
Reads an unsigned 16-bit Little Endian value from the stream into native endian format. | |
bool_t | vfs_fget_le32 (uint32_t *value, VFSFile *stream) |
Reads an unsigned 32-bit Little Endian value from the stream into native endian format. | |
bool_t | vfs_fget_le64 (uint64_t *value, VFSFile *stream) |
Reads an unsigned 64-bit Little Endian value from the stream into native endian format. | |
bool_t | vfs_fget_be16 (uint16_t *value, VFSFile *stream) |
Reads an unsigned 16-bit Big Endian value from the stream into native endian format. | |
bool_t | vfs_fget_be32 (uint32_t *value, VFSFile *stream) |
Reads an unsigned 32-bit Big Endian value from the stream into native endian format. | |
bool_t | vfs_fget_be64 (uint64_t *value, VFSFile *stream) |
Reads an unsigned 64-bit Big Endian value from the stream into native endian format. | |
bool_t | vfs_fput_le16 (uint16_t value, VFSFile *stream) |
Writes an unsigned 16-bit native endian value into the stream as a Little Endian value. | |
bool_t | vfs_fput_le32 (uint32_t value, VFSFile *stream) |
Writes an unsigned 32-bit native endian value into the stream as a Big Endian value. | |
bool_t | vfs_fput_le64 (uint64_t value, VFSFile *stream) |
Writes an unsigned 64-bit native endian value into the stream as a Big Endian value. | |
bool_t | vfs_fput_be16 (uint16_t value, VFSFile *stream) |
Writes an unsigned 16-bit native endian value into the stream as a Big Endian value. | |
bool_t | vfs_fput_be32 (uint32_t value, VFSFile *stream) |
Writes an unsigned 32-bit native endian value into the stream as a Big Endian value. | |
bool_t | vfs_fput_be64 (uint64_t value, VFSFile *stream) |
Writes an unsigned 64-bit native endian value into the stream as a Big Endian value. |
Common code for various VFS-stream related operations.
Routines for string reading and writing and functions for reading and writing endianess-dependant integer values.
Definition in file vfs_common.c.
Reads an unsigned 16-bit Big Endian value from the stream into native endian format.
value | Pointer to the variable to read the value into. | |
stream | A VFSFile object representing the stream. |
Definition at line 256 of file vfs_common.c.
Reads an unsigned 32-bit Big Endian value from the stream into native endian format.
value | Pointer to the variable to read the value into. | |
stream | A VFSFile object representing the stream. |
Definition at line 272 of file vfs_common.c.
Reads an unsigned 64-bit Big Endian value from the stream into native endian format.
value | Pointer to the variable to read the value into. | |
stream | A VFSFile object representing the stream. |
Definition at line 288 of file vfs_common.c.
Reads an unsigned 16-bit Little Endian value from the stream into native endian format.
value | Pointer to the variable to read the value into. | |
stream | A VFSFile object representing the stream. |
Definition at line 207 of file vfs_common.c.
Reads an unsigned 32-bit Little Endian value from the stream into native endian format.
value | Pointer to the variable to read the value into. | |
stream | A VFSFile object representing the stream. |
Definition at line 223 of file vfs_common.c.
Reads an unsigned 64-bit Little Endian value from the stream into native endian format.
value | Pointer to the variable to read the value into. | |
stream | A VFSFile object representing the stream. |
Definition at line 239 of file vfs_common.c.
Reads a string of characters from a stream, ending in newline or EOF.
s | A buffer to put the string in. | |
n | The amount of characters to read. | |
stream | A VFSFile object representing the stream. |
Definition at line 64 of file vfs_common.c.
void vfs_file_get_contents | ( | const char * | filename, | |
void ** | buf, | |||
int64_t * | size | |||
) |
Gets contents of the file into a buffer.
Buffer of filesize bytes is allocated by this function as necessary.
filename | URI of the file to read in. | |
buf | Pointer to a pointer variable of buffer. | |
size | Pointer to gsize variable that will hold the amount of read data e.g. filesize. |
Definition at line 150 of file vfs_common.c.
Referenced by art_get_data(), and vfs_async_file_get_contents_worker().
Writes a formatted string to a VFS stream.
stream | A VFSFile object representing the stream. | |
format | A printf-style format string. | |
... | Optional list of arguments. |
Definition at line 129 of file vfs_common.c.
Writes an unsigned 16-bit native endian value into the stream as a Big Endian value.
value | Value to write into the stream. | |
stream | A VFSFile object representing the stream. |
Definition at line 347 of file vfs_common.c.
Writes an unsigned 32-bit native endian value into the stream as a Big Endian value.
value | Value to write into the stream. | |
stream | A VFSFile object representing the stream. |
Definition at line 361 of file vfs_common.c.
Writes an unsigned 64-bit native endian value into the stream as a Big Endian value.
value | Value to write into the stream. | |
stream | A VFSFile object representing the stream. |
Definition at line 375 of file vfs_common.c.
Writes an unsigned 16-bit native endian value into the stream as a Little Endian value.
value | Value to write into the stream. | |
stream | A VFSFile object representing the stream. |
Definition at line 305 of file vfs_common.c.
Writes an unsigned 32-bit native endian value into the stream as a Big Endian value.
value | Value to write into the stream. | |
stream | A VFSFile object representing the stream. |
Definition at line 319 of file vfs_common.c.
Writes an unsigned 64-bit native endian value into the stream as a Big Endian value.
value | Value to write into the stream. | |
stream | A VFSFile object representing the stream. |
Definition at line 333 of file vfs_common.c.
Writes a character to a stream.
c | A character to write to the stream. | |
stream | A VFSFile object representing the stream. |
Definition at line 45 of file vfs_common.c.
Writes a string to a VFS stream.
s | A string to write to the stream. | |
stream | A VFSFile object representing the stream. |
Definition at line 96 of file vfs_common.c.
Referenced by vfs_vfprintf().
Writes a formatted string to a VFS stream via a va_list of args.
stream | A VFSFile object representing the stream. | |
format | A printf-style format string. | |
args | A va_list of args to use. |
Definition at line 111 of file vfs_common.c.
Referenced by vfs_fprintf().