Sha256: ef59fb155e88d86d423a051953a609f66d4a07cf02eda6a6da91c40750a35d7d

Contents?: true

Size: 974 Bytes

Versions: 27

Compression:

Stored size: 974 Bytes

Contents

/* code.h
 * Copyright (c) 2017, Peter Ohler
 * All rights reserved.
 */

#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

27 entries across 27 versions & 2 rubygems

Version Path
oj-3.10.14 ext/oj/code.h
oj-3.10.13 ext/oj/code.h
oj-3.10.12 ext/oj/code.h
oj-3.10.11 ext/oj/code.h
oj-3.10.10 ext/oj/code.h
oj-3.10.9 ext/oj/code.h
oj-3.10.8 ext/oj/code.h
oj-3.10.7 ext/oj/code.h
oj-3.10.6 ext/oj/code.h
oj-3.10.5 ext/oj/code.h
oj-3.10.3 ext/oj/code.h
oj-3.10.2 ext/oj/code.h
oj-3.10.1 ext/oj/code.h
zuora_connect_ui-0.10.0 vendor/ruby/2.6.0/gems/oj-3.10.0/ext/oj/code.h
oj-3.10.0 ext/oj/code.h
oj-3.9.2 ext/oj/code.h
oj-3.9.1 ext/oj/code.h
oj-3.9.0 ext/oj/code.h
oj-3.8.1 ext/oj/code.h
oj-3.8.0 ext/oj/code.h