1/* -*- c-basic-offset: 2 -*- */
2/*
3 Copyright(C) 2015 Brazil
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License version 2.1 as published by the Free Software Foundation.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Lesser General Public License for more details.
13
14 You should have received a copy of the GNU Lesser General Public
15 License along with this library; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17*/
18
19#include "../grn_ctx_impl.h"
20#include "../grn_db.h"
21
22#ifdef GRN_WITH_MRUBY
23#include <mruby.h>
24#include <mruby/hash.h>
25
26#include "mrb_options.h"
27
28mrb_value
29grn_mrb_options_get_static(mrb_state *mrb,
30 mrb_value mrb_options,
31 const char *key,
32 size_t key_size)
33{
34 mrb_sym mrb_key;
35
36 mrb_key = mrb_intern_static(mrb, key, key_size);
37 return mrb_hash_get(mrb, mrb_options, mrb_symbol_value(mrb_key));
38}
39#endif
40