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-0.47.3 ext/polyphony/ring_buffer.h
polyphony-0.47.2 ext/polyphony/ring_buffer.h
polyphony-0.47.1 ext/polyphony/ring_buffer.h
polyphony-0.47.0 ext/polyphony/ring_buffer.h
polyphony-0.46.1 ext/polyphony/ring_buffer.h
polyphony-0.46.0 ext/polyphony/ring_buffer.h
polyphony-0.45.5 ext/polyphony/ring_buffer.h
polyphony-0.45.4 ext/polyphony/ring_buffer.h
polyphony-0.45.2 ext/polyphony/ring_buffer.h
polyphony-0.45.1 ext/polyphony/ring_buffer.h
polyphony-0.45.0 ext/polyphony/ring_buffer.h
polyphony-0.44.0 ext/polyphony/ring_buffer.h
polyphony-0.43.11 ext/polyphony/ring_buffer.h
polyphony-0.43.10 ext/polyphony/ring_buffer.h
polyphony-0.43.9 ext/polyphony/ring_buffer.h
polyphony-0.43.8 ext/polyphony/ring_buffer.h
polyphony-0.43.6 ext/polyphony/ring_buffer.h
polyphony-0.43.5 ext/polyphony/ring_buffer.h