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 11extern "C" { 12#endif 13 14#include <sys/types.h> 15 16typedef struct ct_buf { 17 unsigned char * base; 18 unsigned int head, tail, size; 19 unsigned int overrun; 20} ct_buf_t; 21 22extern void ct_buf_init(ct_buf_t *, void *, size_t); 23extern void ct_buf_set(ct_buf_t *, void *, size_t); 24extern int ct_buf_get(ct_buf_t *, void *, size_t); 25extern int ct_buf_put(ct_buf_t *, const void *, size_t); 26extern int ct_buf_putc(ct_buf_t *, int); 27extern unsigned int ct_buf_avail(ct_buf_t *); 28extern void * ct_buf_head(ct_buf_t *); 29 30#ifdef __cplusplus 31} 32#endif 33 34#endif /* OPENCT_BUFFER_H */ 35