OSDN Git Service

PDEBUG() disable.
[scilog/scilog.git] / ring.h
1
2
3 #if     !defined(__RING_H__)
4 #define __RING_H__
5
6 typedef struct {
7         // 読み出し位置 複数設定できる
8         int     *read;
9         // 書き込み位置
10         int     write;
11         // 最新データ位置
12         int     latest;
13         // バッファ個数
14         int     num;
15         // readポインタ個数
16         int     read_num;
17 } RING_T;
18
19 RING_T* ring_create(int read_num);
20 void ring_destroy(RING_T *t);
21 void ring_init(RING_T *t, int num);
22 void ring_clear(RING_T *t, int no);
23 int ring_read_get(RING_T *t, int no);
24 void ring_read_set(RING_T *t, int no, int i);
25 void ring_read_plus(RING_T *t, int no);
26 int ring_write_get(RING_T *t);
27 void ring_write_plus(RING_T *t);
28 int ring_num_get(RING_T *t, int no);
29 int ring_latest_get(RING_T *t);
30 void ring_latest_set(RING_T *t, int i);
31 int ring_is_full(RING_T *t, int no);
32
33 #endif