#include "sio2.h"

Functions | |
| SIO2stream * | sio2StreamInit (char *_fname) |
| SIO2stream * | sio2StreamOpen (char *_fname, unsigned char _rel) |
| SIO2stream * | sio2StreamOpenText (char *_fname, unsigned char _rel) |
| SIO2stream * | sio2StreamClose (SIO2stream *_SIO2stream) |
| unsigned int | sio2StreamRead (SIO2stream *_SIO2stream, void *_ptr, unsigned int _size_t) |
| void * | sio2StreamReadPtr (SIO2stream *_SIO2stream, unsigned int _size_t) |
| unsigned char | sio2StreamEOF (SIO2stream *_SIO2stream) |
| void | sio2StreamParse (SIO2stream *_SIO2stream, unsigned int _n_entry, SIO2entry *_SIO2entry) |
| void | sio2StreamReset (SIO2stream *_SIO2stream) |
| SIO2stream* sio2StreamClose | ( | SIO2stream * | _SIO2stream | ) |
Close and free and SIO2stream, if the SIO2stream still contain some data the data will be freed.
_SIO2stream: A valid SIO2stream pointer.
return a NULL SIO2stream pointer.
References SIO2stream::buf.
Referenced by sio2ResourceExtract(), sio2SoundBufferFree(), sio2SoundBufferGenId(), sio2UrlFree(), and sio2VideoFree().
| unsigned char sio2StreamEOF | ( | SIO2stream * | _SIO2stream | ) |
Return whether or not the cursor is at the end of the SIO2stream.
_SIO2stream: A valid SIO2stream pointer.
return 1 or 0 if position in the SIO2stream is at the end of the stream.
References SIO2stream::pos, and SIO2stream::size.
Referenced by sio2VideoGetImage().
| SIO2stream* sio2StreamInit | ( | char * | _fname | ) |
Initialize an empty new SIO2stream memory stream. A SIO2stream is basically acting exactly like a FILE *, at the exception that it is 100% handled in memory speeding up the whole loading process and reduces to a minimum disk access.
_fname: The name of the SIO2stream.
return a new SIO2stream pointer.
References SIO2stream::fname, and sio2StringCpy().
Referenced by sio2ResourceExtract(), and sio2UrlInit().

| SIO2stream* sio2StreamOpen | ( | char * | _fname, | |
| unsigned char | _rel | |||
| ) |
Create a new SIO2stream and open the file passed in parameter.
_fname: The filename to open.
_rel: Determine wheter or not the file path is relative to the root of the package.
return a new SIO2stream pointer with the file loaded in the SIO2stream->buf. If the file cannot be found, a NULL SIO2stream pointer will be returned.
References SIO2::app_path, SIO2stream::buf, SIO2stream::cur, SIO2stream::fname, sio2, SIO2_MAX_PATH, sio2StringCpy(), and SIO2stream::size.
Referenced by sio2StreamOpenText().

| SIO2stream* sio2StreamOpenText | ( | char * | _fname, | |
| unsigned char | _rel | |||
| ) |
Basically the same as sio2StreamOpen except that this function should be used for text files only. For binary data use sio2StreamOpen.
_fname: The filename to open.
_rel: Determine wheter or not the file path is relative to the root of the package.
return a new SIO2stream pointer with the file loaded in the SIO2stream->buf. If the file cannot be found, a NULL SIO2stream pointer will be returned.
References SIO2stream::buf, sio2StreamOpen(), and SIO2stream::size.

| void sio2StreamParse | ( | SIO2stream * | _SIO2stream, | |
| unsigned int | _n_entry, | |||
| SIO2entry * | _SIO2entry | |||
| ) |
Parse the SIO2stream based on a dictionnary of SIO2entry, if the SIO2entry string is found the root callback will be called if not the custom callback will be called.
_SIO2stream: A valid SIO2stream pointer.
_n_entry: The number of entry in the SIO2entry dictionnary.
_SIO2entry: The dictionnary to use for parsing.
References SIO2stream::cur, SIO2entry::custom, SIO2entry::root, SIO2_MAX_CHAR, SIO2_MAX_PATH, sio2StringChr(), sio2StringCmp(), and sio2StringTok().
Referenced by sio2ResourceDispatchStream().

| unsigned int sio2StreamRead | ( | SIO2stream * | _SIO2stream, | |
| void * | _ptr, | |||
| unsigned int | _size_t | |||
| ) |
Read a specific amount of bytes.
_SIO2stream: A valid SIO2stream pointer with the buffer loaded.
_ptr: Pointer to the memory address to copy the data to.
_size_t: The size of the data to copy.
return the number of bytes copied.
References SIO2stream::buf, SIO2stream::pos, and SIO2stream::size.
Referenced by sio2ImageLoadTGA(), sio2PngRead(), sio2VideoBufferStream(), and sio2VideoLoad().
| void* sio2StreamReadPtr | ( | SIO2stream * | _SIO2stream, | |
| unsigned int | _size_t | |||
| ) |
Return the memory address specified by the size passed in parameter.
_SIO2stream: A valid SIO2stream pointer.
_size_t: The size in bytes to read.
return the memory address located in the SIO2stream->buf at the current position.
References SIO2stream::buf, SIO2stream::pos, and SIO2stream::size.
Referenced by sio2ImageLoadTGA().
| void sio2StreamReset | ( | SIO2stream * | _SIO2stream | ) |
Reset all the SIO2stream to its original state, and free the buffer.
_SIO2stream: A valid SIO2stream pointer
References SIO2stream::buf, SIO2stream::cur, SIO2stream::pos, and SIO2stream::size.
Referenced by sio2UrlDownload().
1.5.6