1 #ifndef __SCHRO_BUFFERLIST_H__
2 #define __SCHRO_BUFFERLIST_H__
3 
4 #include <schroedinger/schroutils.h>
5 #include <schroedinger/schrobuffer.h>
6 #include <schroedinger/schrolist.h>
7 
8 SCHRO_BEGIN_DECLS
9 
10 #ifdef SCHRO_ENABLE_UNSTABLE_API
11 
12 typedef struct _SchroBufferList SchroBufferList;
13 
14 struct _SchroBufferList
15 {
16   /* private */
17   SchroList *list;
18   unsigned offset;
19 
20   /* stashed tag for use in next extraction */
21   SchroTag *tag;
22 };
23 
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);
31 
32 #endif
33 
34 SCHRO_END_DECLS
35 
36 #endif
37