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 typedef struct
16 {
17  char *buffer;
19  int first;
20  int last;
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 */
ring_buffer_t::buffer_size
int buffer_size
バッファサイズ
Definition: urg_ring_buffer.h:18
ring_read
int ring_read(ring_buffer_t *ring, char *buffer, int size)
データの取り出し
Definition: urg_ring_buffer.c:83
ring_buffer_t::buffer
char * buffer
バッファへのポインタ
Definition: urg_ring_buffer.h:17
ring_buffer_t
リングバッファの管理情報
Definition: urg_ring_buffer.h:15
ring_initialize
void ring_initialize(ring_buffer_t *ring, char *buffer, const int shift_length)
初期化
Definition: urg_ring_buffer.c:13
ring_buffer_t::last
int last
バッファの最終位置
Definition: urg_ring_buffer.h:20
ring_buffer_t::first
int first
バッファの先頭位置
Definition: urg_ring_buffer.h:19
ring_write
int ring_write(ring_buffer_t *ring, const char *data, int size)
データの格納
Definition: urg_ring_buffer.c:52
ring_clear
void ring_clear(ring_buffer_t *ring)
リングバッファのクリア
Definition: urg_ring_buffer.c:21
ring_capacity
int ring_capacity(const ring_buffer_t *ring)
最大の格納データ数を返す
Definition: urg_ring_buffer.c:37
ring_size
int ring_size(const ring_buffer_t *ring)
格納データ数を返す
Definition: urg_ring_buffer.c:28


urg_c
Author(s): Satofumi Kamimura , Katsumi Kimoto, Adrian Boeing
autogenerated on Wed Mar 2 2022 01:08:11