Main Page
Related Pages
Data Structures
Files
Examples
File List
Globals
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Pages
include
urg_ring_buffer.h
Go to the documentation of this file.
1
#ifndef URG_RING_BUFFER_H
2
#define URG_RING_BUFFER_H
3
14
15
typedef
struct
16
{
17
char
*
buffer
;
18
int
buffer_size
;
19
int
first
;
20
int
last
;
21
}
ring_buffer_t
;
22
23
31
extern
void
ring_initialize
(
ring_buffer_t
*ring,
32
char
*buffer,
const
int
shift_length);
33
34
40
extern
void
ring_clear
(
ring_buffer_t
*ring);
41
42
48
extern
int
ring_size
(
const
ring_buffer_t
*ring);
49
50
56
extern
int
ring_capacity
(
const
ring_buffer_t
*ring);
57
58
68
extern
int
ring_write
(
ring_buffer_t
*ring,
const
char
*data,
int
size);
69
70
80
extern
int
ring_read
(
ring_buffer_t
*ring,
char
*buffer,
int
size);
81
82
#endif
/* ! RING_BUFFER_H */
Generated on Thu May 2 2013 10:55:17 by
1.8.3.1