Sha256: ba5a845b75501ece7e0b02c2559a3f3d217d885a7c1707106a816306ae9689c5

Contents?: true

Size: 1.09 KB

Versions: 51

Compression:

Stored size: 1.09 KB

Contents

/* odd.h
 * Copyright (c) 2011, Peter Ohler
 * All rights reserved.
 */

#ifndef __OJ_ODD_H__
#define __OJ_ODD_H__

#include <stdbool.h>

#include "ruby.h"

#define MAX_ODD_ARGS	10

typedef VALUE	(*AttrGetFunc)(VALUE obj);

typedef struct _Odd {
    const char	*classname;
    size_t	clen;
    VALUE	clas;			// Ruby class or module
    VALUE	create_obj;
    ID		create_op;
    int		attr_cnt;
    bool	is_module;
    bool	raw;
    const char	*attr_names[MAX_ODD_ARGS]; // NULL terminated attr names
    ID		attrs[MAX_ODD_ARGS];	   // 0 terminated attr IDs
    AttrGetFunc	attrFuncs[MAX_ODD_ARGS];
} *Odd;

typedef struct _OddArgs {
    Odd		odd;
    VALUE	args[MAX_ODD_ARGS];
} *OddArgs;

extern void	oj_odd_init(void);
extern Odd	oj_get_odd(VALUE clas);
extern Odd	oj_get_oddc(const char *classname, size_t len);
extern OddArgs	oj_odd_alloc_args(Odd odd);
extern void	oj_odd_free(OddArgs args);
extern int	oj_odd_set_arg(OddArgs args, const char *key, size_t klen, VALUE value);
extern void	oj_reg_odd(VALUE clas, VALUE create_object, VALUE create_method, int mcnt, VALUE *members, bool raw);

#endif /* __OJ_ODD_H__ */

Version data entries

51 entries across 51 versions & 1 rubygems

Version Path
oj-3.7.5 ext/oj/odd.h
oj-3.7.4 ext/oj/odd.h
oj-3.7.3 ext/oj/odd.h
oj-3.7.2 ext/oj/odd.h
oj-3.7.1 ext/oj/odd.h
oj-3.7.0 ext/oj/odd.h
oj-3.6.13 ext/oj/odd.h
oj-3.6.12 ext/oj/odd.h
oj-3.6.11 ext/oj/odd.h
oj-3.6.10 ext/oj/odd.h
oj-3.6.9 ext/oj/odd.h
oj-3.6.8 ext/oj/odd.h
oj-3.6.7 ext/oj/odd.h
oj-3.6.6 ext/oj/odd.h
oj-3.6.5 ext/oj/odd.h
oj-3.6.4 ext/oj/odd.h
oj-3.6.3 ext/oj/odd.h
oj-3.6.2 ext/oj/odd.h
oj-3.6.0 ext/oj/odd.h
oj-3.5.1 ext/oj/odd.h