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.96 ext/polyphony/ring_buffer.h
polyphony-0.95 ext/polyphony/ring_buffer.h
polyphony-0.94 ext/polyphony/ring_buffer.h
polyphony-0.93 ext/polyphony/ring_buffer.h
polyphony-0.92 ext/polyphony/ring_buffer.h
polyphony-0.91 ext/polyphony/ring_buffer.h
polyphony-0.90 ext/polyphony/ring_buffer.h
polyphony-0.89 ext/polyphony/ring_buffer.h
polyphony-0.87 ext/polyphony/ring_buffer.h
polyphony-0.86 ext/polyphony/ring_buffer.h
polyphony-0.85 ext/polyphony/ring_buffer.h
polyphony-0.84.1 ext/polyphony/ring_buffer.h
polyphony-0.84 ext/polyphony/ring_buffer.h
polyphony-0.83 ext/polyphony/ring_buffer.h
polyphony-0.82 ext/polyphony/ring_buffer.h
polyphony-0.81.1 ext/polyphony/ring_buffer.h
polyphony-0.81 ext/polyphony/ring_buffer.h
polyphony-0.80 ext/polyphony/ring_buffer.h
polyphony-0.79 ext/polyphony/ring_buffer.h
polyphony-0.78 ext/polyphony/ring_buffer.h