Sha256: 5f7c4f85cd96347ad6cb1531cfbb6ec2bccb5c369fb19729d065e0a8bbd024c5

Contents?: true

Size: 1.23 KB

Versions: 22

Compression:

Stored size: 1.23 KB

Contents

// Copyright (c) 2011 Peter Ohler. All rights reserved.
// Licensed under the MIT License. See LICENSE file in the project root for license details.

#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

22 entries across 22 versions & 2 rubygems

Version Path
devcycle-ruby-server-sdk-2.0.0 vendor/bundle/ruby/3.0.0/gems/oj-3.13.2/ext/oj/odd.h
oj-3.13.11 ext/oj/odd.h
oj-3.13.10 ext/oj/odd.h
oj-3.13.9 ext/oj/odd.h
oj-3.13.8 ext/oj/odd.h
oj-3.13.7 ext/oj/odd.h
oj-3.13.6 ext/oj/odd.h
oj-3.13.5 ext/oj/odd.h
oj-3.13.4 ext/oj/odd.h
oj-3.13.3 ext/oj/odd.h
oj-3.13.2 ext/oj/odd.h
oj-3.13.1 ext/oj/odd.h
oj-3.13.0 ext/oj/odd.h
oj-3.12.3 ext/oj/odd.h
oj-3.12.2 ext/oj/odd.h
oj-3.12.1 ext/oj/odd.h
oj-3.12.0 ext/oj/odd.h
oj-3.11.8 ext/oj/odd.h
oj-3.11.7 ext/oj/odd.h
oj-3.11.6 ext/oj/odd.h