#include "check.h"
#include <glib.h>
#include <stddef.h>
#include <stdbool.h>
#include <sys/types.h>
Go to the source code of this file.
|
static void | input_stream_init (struct input_stream *is, const struct input_plugin *plugin, const char *uri) |
|
static void | input_stream_deinit (struct input_stream *is) |
|
struct input_stream * | input_stream_open (const char *uri, GError **error_r) |
| Opens a new input stream.
|
|
void | input_stream_close (struct input_stream *is) |
| Close the input stream and free resources.
|
|
bool | input_stream_seek (struct input_stream *is, goffset offset, int whence, GError **error_r) |
| Seeks to the specified position in the stream.
|
|
bool | input_stream_eof (struct input_stream *is) |
| Returns true if the stream has reached end-of-file.
|
|
struct tag * | input_stream_tag (struct input_stream *is) |
| Reads the tag from the stream.
|
|
int | input_stream_buffer (struct input_stream *is, GError **error_r) |
| Reads some of the stream into its buffer.
|
|
size_t | input_stream_read (struct input_stream *is, void *ptr, size_t size, GError **error_r) |
| Reads data from the stream into the caller-supplied buffer.
|
|
int input_stream_buffer |
( |
struct input_stream * |
is, |
|
|
GError ** |
error_r |
|
) |
| |
Reads some of the stream into its buffer.
The following return codes are defined: -1 = error, 1 = something was buffered, 0 = nothing was buffered.
The semantics of this function are not well-defined, and it will eventually be removed.
Close the input stream and free resources.
Returns true if the stream has reached end-of-file.
struct input_stream* input_stream_open |
( |
const char * |
uri, |
|
|
GError ** |
error_r |
|
) |
| |
|
read |
Opens a new input stream.
You may not access it until the "ready" flag is set.
- Returns
- an input_stream object on success, NULL on error
size_t input_stream_read |
( |
struct input_stream * |
is, |
|
|
void * |
ptr, |
|
|
size_t |
size, |
|
|
GError ** |
error_r |
|
) |
| |
Reads data from the stream into the caller-supplied buffer.
Returns 0 on error or eof (check with input_stream_eof()).
- Parameters
-
is | the input_stream object |
ptr | the buffer to read into |
size | the maximum number of bytes to read |
- Returns
- the number of bytes read
bool input_stream_seek |
( |
struct input_stream * |
is, |
|
|
goffset |
offset, |
|
|
int |
whence, |
|
|
GError ** |
error_r |
|
) |
| |
Seeks to the specified position in the stream.
This will most likely fail if the "seekable" flag is false.
- Parameters
-
is | the input_stream object |
offset | the relative offset |
whence | the base of the seek, one of SEEK_SET, SEEK_CUR, SEEK_END |
Reads the tag from the stream.
- Returns
- a tag object which must be freed with tag_free(), or NULL if the tag has not changed since the last call