#include "ctrump/common/dll.h"
#include <stddef.h>
Go to the source code of this file.
Data Structures | |
struct | ctrump_queue |
FIFO. More... | |
Defines | |
#define | QUEUE_PUSH(t, q, e) |
追加 | |
#define | QUEUE_PUSH_PTR(t, q, dest) |
空きを作りそこへのポインタを返す | |
#define | QUEUE_POP(t, q, dest) |
要素の取得 | |
Functions | |
CTRUMP_EXTDEF void | ctrump_queue_init (struct ctrump_queue *q, size_t nelem, size_t elem_size) |
FIFOの初期化. | |
CTRUMP_EXTDEF void | ctrump_queue_realloc (struct ctrump_queue *q) |
FIFOのサイズを増やす. | |
CTRUMP_EXTDEF void | ctrump_queue_destroy (struct ctrump_queue *q) |
FIFOの消去. |
Definition in file queue.h.
#define QUEUE_POP | ( | t, | |||
q, | |||||
dest | ) |
Value:
do { \ (dest) = ((t*)(q)->elements)[(q)->tail]; \ (q)->tail++; \ (q)->rem++; \ if ((q)->tail == (q)->size) \ (q)->tail = 0; \ } while (0)
t | 型 | |
q | FIFOオブジェクト | |
dest | 値を入れる変数 |
Definition at line 104 of file queue.h.
Referenced by build_bfs_order().
#define QUEUE_PUSH | ( | t, | |||
q, | |||||
e | ) |
Value:
do { \ if ((q)->rem==0) \ ctrump_queue_realloc(q); \ \ ((t*)(q)->elements)[(q)->head] = (e); \ (q)->rem --; \ (q)->head ++; \ if ((q)->head == (q)->size) \ (q)->head = 0; \ } while(0)
t | 型 | |
q | FIFOオブジェクト | |
e | 要素 |
Definition at line 67 of file queue.h.
Referenced by build_bfs_order().
#define QUEUE_PUSH_PTR | ( | t, | |||
q, | |||||
dest | ) |
Value:
do { \ if ((q)->rem==0) \ ctrump_queue_realloc(q); \ \ dest = &((t*)(q)->elements)[(q)->head]; \ (q)->rem --; \ (q)->head ++; \ if ((q)->head == (q)->size) \ (q)->head = 0; \ } while(0)
t | 型 | |
q | FIFOオブジェクト | |
dest | ポインタを入れる変数 |
CTRUMP_EXTDEF void ctrump_queue_destroy | ( | struct ctrump_queue * | q | ) |
FIFOの消去.
q | FIFOオブジェクト |
Definition at line 87 of file queue.c.
References ctrump_queue::elements.
Referenced by build_bfs_order().
CTRUMP_EXTDEF void ctrump_queue_init | ( | struct ctrump_queue * | q, | |
size_t | nelem, | |||
size_t | elem_size | |||
) |
FIFOの初期化.
q | FIFOオブジェクト | |
nelem | 初期要素数 | |
要素サイズ |
Definition at line 41 of file queue.c.
References ctrump_queue::elem_size, ctrump_queue::elements, ctrump_queue::head, ctrump_queue::rem, ctrump_queue::size, and ctrump_queue::tail.
Referenced by build_bfs_order().
CTRUMP_EXTDEF void ctrump_queue_realloc | ( | struct ctrump_queue * | q | ) |
FIFOのサイズを増やす.
q | FIFOオブジェクト |
Definition at line 52 of file queue.c.
References ctrump_queue::elem_size, ctrump_queue::elements, ctrump_queue::head, ctrump_queue::rem, ctrump_queue::size, and ctrump_queue::tail.