Sha256: 69f6b6a2939b244c1fcaf9af276e394333c131022c770e1b2d9ad474fc27cfbd

Contents?: true

Size: 1.69 KB

Versions: 53

Compression:

Stored size: 1.69 KB

Contents

/*
 * MessagePack for Ruby
 *
 * Copyright (C) 2008-2015 Sadayuki Furuhashi
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *        http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */

#include "unpacker_ext_registry.h"

static ID s_call;
static ID s_dup;

void msgpack_unpacker_ext_registry_static_init()
{
    s_call = rb_intern("call");
    s_dup = rb_intern("dup");
}

void msgpack_unpacker_ext_registry_static_destroy()
{ }

void msgpack_unpacker_ext_registry_init(msgpack_unpacker_ext_registry_t* ukrg)
{
    for(int i=0; i < 256; i++) {
        ukrg->array[i] = Qnil;
    }
}

void msgpack_unpacker_ext_registry_mark(msgpack_unpacker_ext_registry_t* ukrg)
{
    for(int i=0; i < 256; i++) {
        rb_gc_mark(ukrg->array[i]);
    }
}

void msgpack_unpacker_ext_registry_dup(msgpack_unpacker_ext_registry_t* src,
        msgpack_unpacker_ext_registry_t* dst)
{
    for(int i=0; i < 256; i++) {
        dst->array[i] = src->array[i];
    }
}

VALUE msgpack_unpacker_ext_registry_put(msgpack_unpacker_ext_registry_t* ukrg,
        VALUE ext_module, int ext_type, VALUE proc, VALUE arg)
{
    VALUE e = rb_ary_new3(3, ext_module, proc, arg);
    VALUE before = ukrg->array[ext_type + 128];
    ukrg->array[ext_type + 128] = e;
    return before;
}

Version data entries

53 entries across 53 versions & 3 rubygems

Version Path
msgpack-1.4.4 ext/msgpack/unpacker_ext_registry.c
msgpack-1.4.3 ext/msgpack/unpacker_ext_registry.c
msgpack-1.4.2 ext/msgpack/unpacker_ext_registry.c
msgpack-1.4.0.pre1 ext/msgpack/unpacker_ext_registry.c
msgpack-1.3.3-x64-mingw32 ext/msgpack/unpacker_ext_registry.c
msgpack-1.3.3-x86-mingw32 ext/msgpack/unpacker_ext_registry.c
msgpack-1.3.3 ext/msgpack/unpacker_ext_registry.c
msgpack-1.3.2-x64-mingw32 ext/msgpack/unpacker_ext_registry.c
msgpack-1.3.2-x86-mingw32 ext/msgpack/unpacker_ext_registry.c
msgpack-1.3.2 ext/msgpack/unpacker_ext_registry.c
chatops-rpc-0.0.2 fixtures/chatops-controller-example/vendor/bundle/ruby/2.5.0/gems/msgpack-1.3.1/ext/msgpack/unpacker_ext_registry.c
chatops-rpc-0.0.1 fixtures/chatops-controller-example/vendor/bundle/ruby/2.5.0/gems/msgpack-1.3.1/ext/msgpack/unpacker_ext_registry.c
msgpack-1.3.1-x64-mingw32 ext/msgpack/unpacker_ext_registry.c
msgpack-1.3.1-x86-mingw32 ext/msgpack/unpacker_ext_registry.c
msgpack-1.3.1 ext/msgpack/unpacker_ext_registry.c
msgpack-1.3.0-x64-mingw32 ext/msgpack/unpacker_ext_registry.c
msgpack-1.3.0-x86-mingw32 ext/msgpack/unpacker_ext_registry.c
msgpack-1.3.0 ext/msgpack/unpacker_ext_registry.c
msgpack-1.2.10-x64-mingw32 ext/msgpack/unpacker_ext_registry.c
msgpack-1.2.10-x86-mingw32 ext/msgpack/unpacker_ext_registry.c