Flipper Developer Docs
Loading...
Searching...
No Matches
stream_i.h
1
#pragma once
2
#include <stdint.h>
3
#include <stdbool.h>
4
#include "stream.h"
5
6
#ifdef __cplusplus
7
extern
"C"
{
8
#endif
9
10
#define STREAM_CACHE_SIZE 512u
11
12
typedef
struct
StreamVTable
StreamVTable
;
13
14
typedef
void (*StreamFreeFn)(
Stream
* stream);
15
typedef
bool (*StreamEOFFn)(
Stream
* stream);
16
typedef
void (*StreamCleanFn)(
Stream
* stream);
17
typedef
bool (*StreamSeekFn)(
Stream
* stream, int32_t offset, StreamOffset offset_type);
18
typedef
size_t (*StreamTellFn)(
Stream
* stream);
19
typedef
size_t (*StreamSizeFn)(
Stream
* stream);
20
typedef
size_t (*StreamWriteFn)(
Stream
* stream,
const
uint8_t* data,
size_t
size);
21
typedef
size_t (*StreamReadFn)(
Stream
* stream, uint8_t* data,
size_t
count);
22
typedef
bool (*StreamDeleteAndInsertFn)(
23
Stream
* stream,
24
size_t
delete_size,
25
StreamWriteCB write_cb,
26
const
void
* ctx);
27
28
struct
StreamVTable
{
29
const
StreamFreeFn free;
30
const
StreamEOFFn eof;
31
const
StreamCleanFn clean;
32
const
StreamSeekFn seek;
33
const
StreamTellFn tell;
34
const
StreamSizeFn size;
35
const
StreamWriteFn write;
36
const
StreamReadFn read;
37
const
StreamDeleteAndInsertFn delete_and_insert;
38
};
39
40
struct
Stream
{
41
const
StreamVTable
* vtable;
42
};
43
44
#ifdef __cplusplus
45
}
46
#endif
Stream
Definition
stream_i.h:40
StreamVTable
Definition
stream_i.h:28
lib
toolbox
stream
stream_i.h
Generated by
1.12.0