OpenCT
0.6.20
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
#include <sys/types.h>
15
16
typedef
struct
ct_buf
{
17
unsigned
char
* base;
18
unsigned
int
head, tail, size;
19
unsigned
int
overrun;
20
}
ct_buf_t
;
21
22
extern
void
ct_buf_init(
ct_buf_t
*,
void
*,
size_t
);
23
extern
void
ct_buf_set(
ct_buf_t
*,
void
*,
size_t
);
24
extern
void
ct_buf_clear(
ct_buf_t
*);
25
extern
int
ct_buf_get(
ct_buf_t
*,
void
*,
size_t
);
26
extern
int
ct_buf_gets(
ct_buf_t
*,
char
*,
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
int
ct_buf_puts(
ct_buf_t
*,
const
char
*);
30
extern
int
ct_buf_push(
ct_buf_t
*,
const
void
*,
size_t
);
31
extern
unsigned
int
ct_buf_avail(
ct_buf_t
*);
32
extern
unsigned
int
ct_buf_tailroom(
ct_buf_t
*);
33
extern
unsigned
int
ct_buf_size(
ct_buf_t
*);
34
extern
void
* ct_buf_head(
ct_buf_t
*);
35
extern
void
* ct_buf_tail(
ct_buf_t
*);
36
extern
int
ct_buf_read(
ct_buf_t
*,
int
);
37
extern
void
ct_buf_compact(
ct_buf_t
*);
38
extern
int
ct_buf_overrun(
ct_buf_t
*);
39
40
#ifdef __cplusplus
41
}
42
#endif
43
44
#endif
/* OPENCT_BUFFER_H */
ct_buf
Definition:
buffer.h:16
libp11, Copyright (C) 2005 Olaf Kirch <okir@lst.de>