tests: fix build on os/x
[schroedinger.git] / schroedinger / schrobufferlist.h
blob03e83e2d29d821c158af17f10a97a777cf8c7cc6
1 #ifndef __SCHRO_BUFFERLIST_H__
2 #define __SCHRO_BUFFERLIST_H__
4 #include <schroedinger/schroutils.h>
5 #include <schroedinger/schrobuffer.h>
6 #include <schroedinger/schrolist.h>
8 SCHRO_BEGIN_DECLS
10 #ifdef SCHRO_ENABLE_UNSTABLE_API
12 typedef struct _SchroBufferList SchroBufferList;
14 struct _SchroBufferList
16 /* private */
17 SchroList *list;
18 unsigned offset;
20 /* stashed tag for use in next extraction */
21 SchroTag *tag;
24 SchroBufferList *schro_buflist_new (void);
25 void schro_buflist_free (SchroBufferList *buflist);
26 void schro_buflist_append (SchroBufferList *buflist, SchroBuffer *buf);
27 int schro_buflist_peekbytes (uint8_t *dst, unsigned len, SchroBufferList *buflist, unsigned offset);
28 int schro_buflist_findbytes (SchroBufferList *buflist, unsigned *start, const uint8_t *needle, unsigned needle_len);
29 void schro_buflist_flush (SchroBufferList *buflist, unsigned amount);
30 SchroBuffer * schro_buflist_extract (SchroBufferList *buflist, unsigned start, unsigned len);
32 #endif
34 SCHRO_END_DECLS
36 #endif