ir 25 maint/gnulib/lib/i-ring.c i_ring_init (I_ring *ir, int default_val) ir 28 maint/gnulib/lib/i-ring.c ir->ir_empty = true; ir 29 maint/gnulib/lib/i-ring.c ir->ir_front = 0; ir 30 maint/gnulib/lib/i-ring.c ir->ir_back = 0; ir 32 maint/gnulib/lib/i-ring.c ir->ir_data[i] = default_val; ir 33 maint/gnulib/lib/i-ring.c ir->ir_default_val = default_val; ir 37 maint/gnulib/lib/i-ring.c i_ring_empty (I_ring const *ir) ir 39 maint/gnulib/lib/i-ring.c return ir->ir_empty; ir 43 maint/gnulib/lib/i-ring.c i_ring_push (I_ring *ir, int val) ir 45 maint/gnulib/lib/i-ring.c unsigned int dest_idx = (ir->ir_front + !ir->ir_empty) % I_RING_SIZE; ir 46 maint/gnulib/lib/i-ring.c int old_val = ir->ir_data[dest_idx]; ir 47 maint/gnulib/lib/i-ring.c ir->ir_data[dest_idx] = val; ir 48 maint/gnulib/lib/i-ring.c ir->ir_front = dest_idx; ir 49 maint/gnulib/lib/i-ring.c if (dest_idx == ir->ir_back) ir 50 maint/gnulib/lib/i-ring.c ir->ir_back = (ir->ir_back + !ir->ir_empty) % I_RING_SIZE; ir 51 maint/gnulib/lib/i-ring.c ir->ir_empty = false; ir 56 maint/gnulib/lib/i-ring.c i_ring_pop (I_ring *ir) ir 59 maint/gnulib/lib/i-ring.c if (i_ring_empty (ir)) ir 61 maint/gnulib/lib/i-ring.c top_val = ir->ir_data[ir->ir_front]; ir 62 maint/gnulib/lib/i-ring.c ir->ir_data[ir->ir_front] = ir->ir_default_val; ir 63 maint/gnulib/lib/i-ring.c if (ir->ir_front == ir->ir_back) ir 64 maint/gnulib/lib/i-ring.c ir->ir_empty = true; ir 66 maint/gnulib/lib/i-ring.c ir->ir_front = ((ir->ir_front + I_RING_SIZE - 1) % I_RING_SIZE); ir 41 maint/gnulib/lib/i-ring.h void i_ring_init (I_ring *ir, int ir_default_val); ir 42 maint/gnulib/lib/i-ring.h int i_ring_push (I_ring *ir, int val); ir 43 maint/gnulib/lib/i-ring.h int i_ring_pop (I_ring *ir); ir 44 maint/gnulib/lib/i-ring.h bool i_ring_empty (I_ring const *ir) _GL_ATTRIBUTE_PURE; ir 29 maint/gnulib/tests/test-i-ring.c I_ring ir; ir 30 maint/gnulib/tests/test-i-ring.c i_ring_init (&ir, -1); ir 31 maint/gnulib/tests/test-i-ring.c o = i_ring_push (&ir, 1); ir 33 maint/gnulib/tests/test-i-ring.c o = i_ring_push (&ir, 2); ir 35 maint/gnulib/tests/test-i-ring.c o = i_ring_push (&ir, 3); ir 37 maint/gnulib/tests/test-i-ring.c o = i_ring_push (&ir, 4); ir 39 maint/gnulib/tests/test-i-ring.c o = i_ring_push (&ir, 5); ir 41 maint/gnulib/tests/test-i-ring.c o = i_ring_push (&ir, 6); ir 43 maint/gnulib/tests/test-i-ring.c o = i_ring_push (&ir, 7); ir 46 maint/gnulib/tests/test-i-ring.c o = i_ring_pop (&ir); ir 48 maint/gnulib/tests/test-i-ring.c o = i_ring_pop (&ir); ir 50 maint/gnulib/tests/test-i-ring.c o = i_ring_pop (&ir); ir 52 maint/gnulib/tests/test-i-ring.c o = i_ring_pop (&ir); ir 54 maint/gnulib/tests/test-i-ring.c ASSERT (i_ring_empty (&ir)); ir 56 maint/gnulib/tests/test-i-ring.c o = i_ring_push (&ir, 8); ir 58 maint/gnulib/tests/test-i-ring.c o = i_ring_pop (&ir); ir 60 maint/gnulib/tests/test-i-ring.c ASSERT (i_ring_empty (&ir));