#include "check.h"
#include "gcc.h"
#include <glib.h>
#include <stddef.h>
#include <stdbool.h>
#include <sys/types.h>
Go to the source code of this file.
Data Structures | |
struct | input_stream |
Functions | |
gcc_nonnull (1, 2) G_GNUC_MALLOC struct input_stream *input_stream_open(const char *uri | |
Opens a new input stream. | |
gcc_nonnull (1) void input_stream_close(struct input_stream *is) | |
Close the input stream and free resources. | |
Variables | |
GMutex * | mutex |
GMutex GCond * | cond |
GMutex GCond GError ** | error_r |
goffset | offset |
goffset int | whence |
void * | ptr |
void size_t | size |
gcc_nonnull | ( | 1 | ) |
Close the input stream and free resources.
Returns true if the next read operation will not block: either data is available, or end-of-stream has been reached, or an error has occurred.
Wrapper for input_stream_tag() which locks and unlocks the mutex; the caller must not be holding it already.
Reads the tag from the stream.
Wrapper for input_stream_eof() which locks and unlocks the mutex; the caller must not be holding it already.
Returns true if the stream has reached end-of-file.
Wrapper for input_stream_seek() which locks and unlocks the mutex; the caller must not be holding it already.
Seeks to the specified position in the stream.
Wrapper for input_stream_wait_locked() which locks and unlocks the mutex; the caller must not be holding it already.
Wait until the stream becomes ready.
Update the public attributes.
Check for errors that may have occurred in the I/O thread.
The caller must not lock the mutex.
Call before accessing attributes such as "ready" or "offset".
The caller must lock the mutex.
This will most likely fail if the "seekable" flag is false.
The caller must lock the mutex.
is | the input_stream object | |
offset | the relative offset | |
whence | the base of the seek, one of SEEK_SET, SEEK_CUR, SEEK_END |
The caller must lock the mutex.
gcc_nonnull | ( | 1 | , | |
2 | ||||
) | const |
Opens a new input stream.
Wrapper for input_stream_tag() which locks and unlocks the mutex; the caller must not be holding it already.
Reads data from the stream into the caller-supplied buffer.
You may not access it until the "ready" flag is set.
mutex | a mutex that is used to protect this object; must be locked before calling any of the public methods | |
cond | a cond that gets signalled when the state of this object changes; may be NULL if the caller doesn't want to get notifications |
Returns 0 on error or eof (check with input_stream_eof()).
The caller must lock the mutex.
is | the input_stream object | |
ptr | the buffer to read into | |
size | the maximum number of bytes to read |
GMutex GCond* cond |
Definition at line 106 of file input_stream.h.
void size_t GError** error_r |
Definition at line 106 of file input_stream.h.
GMutex* mutex |
Definition at line 106 of file input_stream.h.
goffset offset |
Definition at line 178 of file input_stream.h.
void * ptr |
Definition at line 255 of file input_stream.h.
void size_t size |
Definition at line 255 of file input_stream.h.
goffset int whence |
Definition at line 178 of file input_stream.h.