Sha256: 87405078608a1011d3e773d9c477737af2330ec3116b595d29e7df82cefa6e7f

Contents?: true

Size: 1.07 KB

Versions: 37

Compression:

Stored size: 1.07 KB

Contents

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

#ifndef OJ_CODE_H
#define OJ_CODE_H

#include <ruby.h>

#include "oj.h"

typedef void (*EncodeFunc)(VALUE obj, int depth, Out out);
typedef VALUE (*DecodeFunc)(VALUE clas, VALUE args);

typedef struct _code {
    const char *name;
    VALUE       clas;
    EncodeFunc  encode;
    DecodeFunc  decode;
    bool        active;  // For compat mode.
} * Code;

// Used by encode functions.
typedef struct _attr {
    const char *name;
    int         len;
    VALUE       value;
    long        num;
    VALUE       time;
} * Attr;

extern bool  oj_code_dump(Code codes, VALUE obj, int depth, Out out);
extern VALUE oj_code_load(Code codes, VALUE clas, VALUE args);
extern void  oj_code_set_active(Code codes, VALUE clas, bool active);
extern bool  oj_code_has(Code codes, VALUE clas, bool encode);

extern void oj_code_attrs(VALUE obj, Attr attrs, int depth, Out out, bool with_class);

extern struct _code oj_compat_codes[];

#endif /* OJ_CODE_H */

Version data entries

37 entries across 37 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/code.h
oj-3.14.2 ext/oj/code.h
oj-3.14.1 ext/oj/code.h
oj-3.14.0 ext/oj/code.h
oj-3.13.23 ext/oj/code.h
oj-3.13.22 ext/oj/code.h
oj-3.13.21 ext/oj/code.h
oj-3.13.20 ext/oj/code.h
oj-3.13.19 ext/oj/code.h
oj-3.13.18 ext/oj/code.h
oj-3.13.17 ext/oj/code.h
oj-3.13.16 ext/oj/code.h
oj-3.13.15 ext/oj/code.h
oj-3.13.14 ext/oj/code.h
oj-3.13.13 ext/oj/code.h
oj-3.13.12 ext/oj/code.h
oj-3.13.11 ext/oj/code.h
oj-3.13.10 ext/oj/code.h
oj-3.13.9 ext/oj/code.h
oj-3.13.8 ext/oj/code.h