Initial commit
[platform/upstream/ccid.git] / src / openct / buffer.h
1 /*
2  * Buffer handling functions of the IFD handler library
3  *
4  * Copyright (C) 2003, Olaf Kirch <okir@suse.de>
5  */
6
7 #ifndef OPENCT_BUFFER_H
8 #define OPENCT_BUFFER_H
9
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
13
14 #ifdef HAVE_SYS_TYPES_H
15 #include <sys/types.h>
16 #endif
17
18 typedef struct ct_buf {
19         unsigned char *         base;
20         unsigned int            head, tail, size;
21         unsigned int            overrun;
22 } ct_buf_t;
23
24 extern void             ct_buf_init(ct_buf_t *, void *, size_t);
25 extern void             ct_buf_set(ct_buf_t *, void *, size_t);
26 extern int              ct_buf_get(ct_buf_t *, void *, size_t);
27 extern int              ct_buf_put(ct_buf_t *, const void *, size_t);
28 extern int              ct_buf_putc(ct_buf_t *, int);
29 extern unsigned int     ct_buf_avail(ct_buf_t *);
30 extern void *           ct_buf_head(ct_buf_t *);
31
32 #ifdef __cplusplus
33 }
34 #endif
35
36 #endif /* OPENCT_BUFFER_H */