Sha256: a189312f5d5e841711329cf7615843c9ba4d9328e5993424a6a83d7b56b41de5

Contents?: true

Size: 1022 Bytes

Versions: 23

Compression:

Stored size: 1022 Bytes

Contents

// Copyright (c) 2021, Peter Ohler, All rights reserved.

#include "parser.h"

static void noop(ojParser p) {
}

static VALUE option(ojParser p, const char *key, VALUE value) {
    rb_raise(rb_eArgError, "%s is not an option for the validate delegate", key);
    return Qnil;
}

static VALUE result(ojParser p) {
    return Qnil;
}

static void dfree(ojParser p) {
}

static void mark(ojParser p) {
}

void oj_set_parser_validator(ojParser p) {
    Funcs end = p->funcs + 3;
    Funcs f;
    p->ctx = NULL;

    for (f = p->funcs; f < end; f++) {
        f->add_null     = noop;
        f->add_true     = noop;
        f->add_false    = noop;
        f->add_int      = noop;
        f->add_float    = noop;
        f->add_big      = noop;
        f->add_str      = noop;
        f->open_array   = noop;
        f->close_array  = noop;
        f->open_object  = noop;
        f->close_object = noop;
    }
    p->option = option;
    p->result = result;
    p->free   = dfree;
    p->mark   = mark;
    p->start  = noop;
}

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
oj-3.16.9 ext/oj/validate.c
oj-3.16.8 ext/oj/validate.c
oj-3.16.7 ext/oj/validate.c
oj-3.16.6 ext/oj/validate.c
oj-3.16.5 ext/oj/validate.c
oj-3.16.4 ext/oj/validate.c
oj-3.16.3 ext/oj/validate.c
oj-3.16.2 ext/oj/validate.c
oj-3.16.1 ext/oj/validate.c
oj-3.16.0 ext/oj/validate.c
oj-3.15.1 ext/oj/validate.c
oj-3.15.0 ext/oj/validate.c
oj-3.14.3 ext/oj/validate.c
oj-3.14.2 ext/oj/validate.c
oj-3.14.1 ext/oj/validate.c
oj-3.14.0 ext/oj/validate.c
oj-3.13.23 ext/oj/validate.c
oj-3.13.22 ext/oj/validate.c
oj-3.13.21 ext/oj/validate.c
oj-3.13.20 ext/oj/validate.c