O2S C Library 1.8.2
Provide high-level data-structures and other fundamental tools for C projects
Loading...
Searching...
No Matches
input.c File Reference

Functions common to all input streams. More...

#include "o2s/input_stream.h"

Go to the source code of this file.

Functions

istream_t istream_init (size_t buffer_size, bool(*accumulate)(istream_t *, size_t))
 Allocate a buffer and set the member function.
void istream_close (istream_t *self)
 Free the buffer.
bool istream_has_at_least (const istream_t *self, size_t count)
 Test if enough characters are available.

Detailed Description

Functions common to all input streams.

Author
Antoine GAGNIERE

Definition in file input.c.

Function Documentation

◆ istream_has_at_least()

bool istream_has_at_least ( const istream_t * self,
size_t count )

Test if enough characters are available.

Returns
true if the buffer contains at least count bytes

Definition at line 37 of file input.c.

◆ istream_init()

istream_t istream_init ( size_t buffer_size,
bool(* accumulate )(istream_t *, size_t) )

Allocate a buffer and set the member function.

Warning
Input stream is an abstact type and is not meant to be created by an end user

Definition at line 22 of file input.c.