Haka: include/haka/vbuffer_stream.h File Reference

Haka

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

Data Structures | Functions
vbuffer_stream.h File Reference
`#include <haka/vbuffer.h>`

Go to the source code of this file.

## Data Structures
struct | vbuffer_stream

## Functions
bool | vbuffer_stream_init (struct vbuffer_stream *stream, void(*userdata_cleanup)(void *))
void | vbuffer_stream_clear (struct vbuffer_stream *stream)
bool | vbuffer_stream_push (struct vbuffer_stream *stream, struct vbuffer *buffer, void *userdata, struct vbuffer_iterator *current)
void | vbuffer_stream_finish (struct vbuffer_stream *stream)
bool | vbuffer_stream_isfinished (struct vbuffer_stream *stream)
bool | vbuffer_stream_pop (struct vbuffer_stream *stream, struct vbuffer *buffer, void **userdata)
struct vbuffer * | vbuffer_stream_data (struct vbuffer_stream *stream)

## Detailed Description

Stream based on vbuffer.

## Function Documentation

void vbuffer_stream_clear | ( | struct vbuffer_stream * | stream | ) |

Clear a stream.

struct vbuffer* vbuffer_stream_data | ( | struct vbuffer_stream * | stream | ) |

Get the buffer inside the stream.

void vbuffer_stream_finish | ( | struct vbuffer_stream * | stream | ) |

Finish the stream and mark the end as the eof. It is not possible to push any more data after calling this function.

bool vbuffer_stream_init | ( | struct vbuffer_stream * | stream,
|  | void(*)(void *) | userdata_cleanup
| ) |  |

Initialize a new stream.

bool vbuffer_stream_isfinished | ( | struct vbuffer_stream * | stream | ) |

Check if the stream has been finished.

bool vbuffer_stream_pop | ( | struct vbuffer_stream * | stream,
|  | struct vbuffer * | buffer,
|  | void ** | userdata
| ) |  |

Get some data out of the stream. The data are only extracted if no mark have been inserted in the buffer. Otherwise, the mark will need to be removed before calling this function again.

bool vbuffer_stream_push | ( | struct vbuffer_stream * | stream,
|  | struct vbuffer * | buffer,
|  | void * | userdata,
|  | struct vbuffer_iterator * | current
| ) |  |

Push some data in the stream. Fill the iterator `current` with the position right before the data just added.