Sha256: 82db166eb3cb9811213fdfbdc50f22281625e9ed691c810b4e2ec43e7c8f76bb

Contents?: true

Size: 786 Bytes

Versions: 98

Compression:

Stored size: 786 Bytes

Contents

#ifndef RING_BUFFER_H
#define RING_BUFFER_H

#include "ruby.h"

typedef struct ring_buffer {
  VALUE *entries;
  unsigned int size;
  unsigned int count;
  unsigned int head;
  unsigned int tail;
} ring_buffer;

void ring_buffer_init(ring_buffer *buffer);
void ring_buffer_free(ring_buffer *buffer);
void ring_buffer_mark(ring_buffer *buffer);
int ring_buffer_empty_p(ring_buffer *buffer);
void ring_buffer_clear(ring_buffer *buffer);

VALUE ring_buffer_shift(ring_buffer *buffer);
void ring_buffer_unshift(ring_buffer *buffer, VALUE value);
void ring_buffer_push(ring_buffer *buffer, VALUE value);

void ring_buffer_shift_each(ring_buffer *buffer);
VALUE ring_buffer_shift_all(ring_buffer *buffer);
void ring_buffer_delete(ring_buffer *buffer, VALUE value);

#endif /* RING_BUFFER_H */

Version data entries

98 entries across 98 versions & 1 rubygems

Version Path
polyphony-1.6 ext/polyphony/ring_buffer.h
polyphony-1.5 ext/polyphony/ring_buffer.h
polyphony-1.4 ext/polyphony/ring_buffer.h
polyphony-1.3 ext/polyphony/ring_buffer.h
polyphony-1.2.1 ext/polyphony/ring_buffer.h
polyphony-1.2 ext/polyphony/ring_buffer.h
polyphony-1.1.1 ext/polyphony/ring_buffer.h
polyphony-1.1 ext/polyphony/ring_buffer.h
polyphony-1.0.2 ext/polyphony/ring_buffer.h
polyphony-1.0.1 ext/polyphony/ring_buffer.h
polyphony-1.0 ext/polyphony/ring_buffer.h
polyphony-0.99.6 ext/polyphony/ring_buffer.h
polyphony-0.99.5 ext/polyphony/ring_buffer.h
polyphony-0.99.4 ext/polyphony/ring_buffer.h
polyphony-0.99.3 ext/polyphony/ring_buffer.h
polyphony-0.99.2 ext/polyphony/ring_buffer.h
polyphony-0.99.1 ext/polyphony/ring_buffer.h
polyphony-0.99 ext/polyphony/ring_buffer.h
polyphony-0.98 ext/polyphony/ring_buffer.h
polyphony-0.97 ext/polyphony/ring_buffer.h