Main Page Modules Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members File Members Related Pages

# io.h File Reference

`#include <lib3ds/types.h>`

Include dependency graph for io.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Typedefs
typedef enum _Lib3dsIoSeek | Lib3dsIoSeek
typedef Lib3dsBool(* | Lib3dsIoErrorFunc )(void *self)
typedef long(* | Lib3dsIoSeekFunc )(void *self, long offset, Lib3dsIoSeek origin)
typedef long(* | Lib3dsIoTellFunc )(void *self)
typedef int(* | Lib3dsIoReadFunc )(void *self, Lib3dsByte *buffer, int size)
typedef int(* | Lib3dsIoWriteFunc )(void *self, const Lib3dsByte *buffer, int size)
## Enumerations
enum | _Lib3dsIoSeek { LIB3DS_SEEK_SET = 0, LIB3DS_SEEK_CUR = 1, LIB3DS_SEEK_END = 2 }
## Functions
LIB3DSAPI Lib3dsIo * | lib3ds_io_new (void *self, Lib3dsIoErrorFunc error_func, Lib3dsIoSeekFunc seek_func, Lib3dsIoTellFunc tell_func, Lib3dsIoReadFunc read_func, Lib3dsIoWriteFunc write_func)
LIB3DSAPI void | lib3ds_io_free (Lib3dsIo *io)
LIB3DSAPI Lib3dsBool | lib3ds_io_error (Lib3dsIo *io)
LIB3DSAPI long | lib3ds_io_seek (Lib3dsIo *io, long offset, Lib3dsIoSeek origin)
LIB3DSAPI long | lib3ds_io_tell (Lib3dsIo *io)
LIB3DSAPI int | lib3ds_io_read (Lib3dsIo *io, Lib3dsByte *buffer, int size)
LIB3DSAPI int | lib3ds_io_write (Lib3dsIo *io, const Lib3dsByte *buffer, int size)
LIB3DSAPI Lib3dsByte | lib3ds_io_read_byte (Lib3dsIo *io)
LIB3DSAPI Lib3dsWord | lib3ds_io_read_word (Lib3dsIo *io)
LIB3DSAPI Lib3dsDword | lib3ds_io_read_dword (Lib3dsIo *io)
LIB3DSAPI Lib3dsIntb | lib3ds_io_read_intb (Lib3dsIo *io)
LIB3DSAPI Lib3dsIntw | lib3ds_io_read_intw (Lib3dsIo *io)
LIB3DSAPI Lib3dsIntd | lib3ds_io_read_intd (Lib3dsIo *io)
LIB3DSAPI Lib3dsFloat | lib3ds_io_read_float (Lib3dsIo *io)
LIB3DSAPI Lib3dsBool | lib3ds_io_read_vector (Lib3dsIo *io, Lib3dsVector v)
LIB3DSAPI Lib3dsBool | lib3ds_io_read_rgb (Lib3dsIo *io, Lib3dsRgb rgb)
LIB3DSAPI Lib3dsBool | lib3ds_io_read_string (Lib3dsIo *io, char *s, int buflen)
LIB3DSAPI Lib3dsBool | lib3ds_io_write_byte (Lib3dsIo *io, Lib3dsByte b)
LIB3DSAPI Lib3dsBool | lib3ds_io_write_word (Lib3dsIo *io, Lib3dsWord w)
LIB3DSAPI Lib3dsBool | lib3ds_io_write_dword (Lib3dsIo *io, Lib3dsDword d)
LIB3DSAPI Lib3dsBool | lib3ds_io_write_intb (Lib3dsIo *io, Lib3dsIntb b)
LIB3DSAPI Lib3dsBool | lib3ds_io_write_intw (Lib3dsIo *io, Lib3dsIntw w)
LIB3DSAPI Lib3dsBool | lib3ds_io_write_intd (Lib3dsIo *io, Lib3dsIntd d)
LIB3DSAPI Lib3dsBool | lib3ds_io_write_float (Lib3dsIo *io, Lib3dsFloat l)
LIB3DSAPI Lib3dsBool | lib3ds_io_write_vector (Lib3dsIo *io, Lib3dsVector v)
LIB3DSAPI Lib3dsBool | lib3ds_io_write_rgb (Lib3dsIo *io, Lib3dsRgb rgb)
LIB3DSAPI Lib3dsBool | lib3ds_io_write_string (Lib3dsIo *io, const char *s)

## Typedef Documentation

typedef Lib3dsBool(* Lib3dsIoErrorFunc)(void *self)

typedef int(* Lib3dsIoReadFunc)(void *self, Lib3dsByte *buffer, int size)

typedef enum _Lib3dsIoSeek Lib3dsIoSeek

typedef long(* Lib3dsIoSeekFunc)(void *self, long offset, Lib3dsIoSeek origin)

typedef long(* Lib3dsIoTellFunc)(void *self)

typedef int(* Lib3dsIoWriteFunc)(void *self, const Lib3dsByte *buffer, int size)

## Enumeration Type Documentation

enum _Lib3dsIoSeek

  | Enumeration values:
  LIB3DS_SEEK_SET |
  LIB3DS_SEEK_CUR |
  LIB3DS_SEEK_END |

## Function Documentation

LIB3DSAPI Lib3dsBool lib3ds_io_error | ( | Lib3dsIo * | io | ) |

LIB3DSAPI void lib3ds_io_free | ( | Lib3dsIo * | io | ) |

LIB3DSAPI Lib3dsIo* lib3ds_io_new | ( | void * | self,
|  | Lib3dsIoErrorFunc | error_func,
|  | Lib3dsIoSeekFunc | seek_func,
|  | Lib3dsIoTellFunc | tell_func,
|  | Lib3dsIoReadFunc | read_func,
|  | Lib3dsIoWriteFunc | write_func
| ) |

LIB3DSAPI int lib3ds_io_read | ( | Lib3dsIo * | io,
|  | Lib3dsByte * | buffer,
|  | int | size
| ) |

LIB3DSAPI Lib3dsByte lib3ds_io_read_byte | ( | Lib3dsIo * | io | ) |

| Read a byte from a file stream.

LIB3DSAPI Lib3dsDword lib3ds_io_read_dword | ( | Lib3dsIo * | io | ) |

| Read a dword from file a stream in little endian format.

LIB3DSAPI Lib3dsFloat lib3ds_io_read_float | ( | Lib3dsIo * | io | ) |

| Read a float from a file stream in little endian format.

LIB3DSAPI Lib3dsIntb lib3ds_io_read_intb | ( | Lib3dsIo * | io | ) |

| Read a signed byte from a file stream.

LIB3DSAPI Lib3dsIntd lib3ds_io_read_intd | ( | Lib3dsIo * | io | ) |

| Read a signed dword a from file stream in little endian format.

LIB3DSAPI Lib3dsIntw lib3ds_io_read_intw | ( | Lib3dsIo * | io | ) |

| Read a signed word from a file stream in little endian format.

LIB3DSAPI Lib3dsBool lib3ds_io_read_rgb | ( | Lib3dsIo * | io,
|  | Lib3dsRgb | rgb
| ) |

LIB3DSAPI Lib3dsBool lib3ds_io_read_string | ( | Lib3dsIo * | io,
|  | char * | s,
|  | int | buflen
| ) |

  | Read a zero-terminated string from a file stream. Parameters:
  io | IO input handle.
  s | The buffer to store the read string.
  buflen | Buffer length.
Returns: True on success, False otherwise.

LIB3DSAPI Lib3dsBool lib3ds_io_read_vector | ( | Lib3dsIo * | io,
|  | Lib3dsVector | v
| ) |

  | Read a vector from a file stream in little endian format. Parameters:
  io | IO input handle.
  v | The vector to store the data.

LIB3DSAPI Lib3dsWord lib3ds_io_read_word | ( | Lib3dsIo * | io | ) |

| Read a word from a file stream in little endian format.

LIB3DSAPI long lib3ds_io_seek | ( | Lib3dsIo * | io,
|  | long | offset,
|  | Lib3dsIoSeek | origin
| ) |

LIB3DSAPI long lib3ds_io_tell | ( | Lib3dsIo * | io | ) |

LIB3DSAPI int lib3ds_io_write | ( | Lib3dsIo * | io,
|  | const Lib3dsByte * | buffer,
|  | int | size
| ) |

LIB3DSAPI Lib3dsBool lib3ds_io_write_byte | ( | Lib3dsIo * | io,
|  | Lib3dsByte | b
| ) |

| Writes a byte into a file stream.

LIB3DSAPI Lib3dsBool lib3ds_io_write_dword | ( | Lib3dsIo * | io,
|  | Lib3dsDword | d
| ) |

| Writes a dword into a little endian file stream.

LIB3DSAPI Lib3dsBool lib3ds_io_write_float | ( | Lib3dsIo * | io,
|  | Lib3dsFloat | l
| ) |

| Writes a float into a little endian file stream.

LIB3DSAPI Lib3dsBool lib3ds_io_write_intb | ( | Lib3dsIo * | io,
|  | Lib3dsIntb | b
| ) |

| Writes a signed byte in a file stream.

LIB3DSAPI Lib3dsBool lib3ds_io_write_intd | ( | Lib3dsIo * | io,
|  | Lib3dsIntd | d
| ) |

| Writes a signed dword into a little endian file stream.

LIB3DSAPI Lib3dsBool lib3ds_io_write_intw | ( | Lib3dsIo * | io,
|  | Lib3dsIntw | w
| ) |

| Writes a signed word into a little endian file stream.

LIB3DSAPI Lib3dsBool lib3ds_io_write_rgb | ( | Lib3dsIo * | io,
|  | Lib3dsRgb | rgb
| ) |

LIB3DSAPI Lib3dsBool lib3ds_io_write_string | ( | Lib3dsIo * | io,
|  | const char * | s
| ) |

| Writes a zero-terminated string into a file stream.

LIB3DSAPI Lib3dsBool lib3ds_io_write_vector | ( | Lib3dsIo * | io,
|  | Lib3dsVector | v
| ) |

| Writes a vector into a file stream in little endian format.

LIB3DSAPI Lib3dsBool lib3ds_io_write_word | ( | Lib3dsIo * | io,
|  | Lib3dsWord | w
| ) |

| Writes a word into a little endian file stream.