File: circarray.h

package info (click to toggle)
ruby-oj 3.16.15-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 14,208 kB
  • sloc: ansic: 20,028; ruby: 11,642; sh: 70; makefile: 17
file content (22 lines) | stat: -rw-r--r-- 678 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Copyright (c) 2012 Peter Ohler. All rights reserved.
// Licensed under the MIT License. See LICENSE file in the project root for
// license details.

#ifndef OJ_CIRCARRAY_H
#define OJ_CIRCARRAY_H

#include "ruby.h"

typedef struct _circArray {
    VALUE         obj_array[1024];
    VALUE*        objs;
    unsigned long size;  // allocated size or initial array size
    unsigned long cnt;
}* CircArray;

extern CircArray oj_circ_array_new(void);
extern void      oj_circ_array_free(CircArray ca);
extern void      oj_circ_array_set(CircArray ca, VALUE obj, unsigned long id);
extern VALUE     oj_circ_array_get(CircArray ca, unsigned long id);

#endif /* OJ_CIRCARRAY_H */