mruby/c VM Source Code release 3.4
Loading...
Searching...
No Matches
global.c File Reference

Constant and global variables. More...

#include "mrubyc.h"
Include dependency graph for global.c:

Go to the source code of this file.

Functions

void mrbc_init_global (void)
int mrbc_set_const (mrbc_sym sym_id, mrbc_value *v)
int mrbc_set_class_const (const struct RClass *cls, mrbc_sym sym_id, mrbc_value *v)
mrbc_valuemrbc_get_const (mrbc_sym sym_id)
mrbc_valuemrbc_get_class_const (const struct RClass *cls, mrbc_sym sym_id)
void mrbc_get_all_class_const (const struct RClass *cls, mrbc_value *ret)
int mrbc_set_global (mrbc_sym sym_id, mrbc_value *v)
mrbc_valuemrbc_get_global (mrbc_sym sym_id)

Variables

static mrbc_kv_handle handle_const
 for global(Object) constants.
static mrbc_kv_handle handle_global
 for global variables.

Detailed Description

Constant and global variables.

Copyright (C) 2015- Kyushu Institute of Technology.
Copyright (C) 2015- Shimane IT Open-Innovation Center.

This file is distributed under BSD 3-Clause License.

Definition in file global.c.

Function Documentation

◆ mrbc_get_all_class_const()

void mrbc_get_all_class_const ( const struct RClass * cls,
mrbc_value * ret )

get all of class constant.

Parameters
clsclass
retreturn value as array type.

Definition at line 119 of file global.c.

Here is the call graph for this function:

◆ mrbc_get_class_const()

mrbc_value * mrbc_get_class_const ( const struct RClass * cls,
mrbc_sym sym_id )

getter class constant

Parameters
clsclass
sym_idsymbol ID.
Returns
pointer to mrbc_value or NULL.

Definition at line 101 of file global.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mrbc_get_const()

mrbc_value * mrbc_get_const ( mrbc_sym sym_id)

getter constant

Parameters
sym_idsymbol ID.
Returns
pointer to mrbc_value or NULL.

Definition at line 88 of file global.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mrbc_get_global()

mrbc_value * mrbc_get_global ( mrbc_sym sym_id)

getter global variable.

Parameters
sym_idsymbol ID.
Returns
pointer to mrbc_value or NULL.

Definition at line 161 of file global.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mrbc_init_global()

void mrbc_init_global ( void )

initialize const and global table with default value.

Definition at line 39 of file global.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mrbc_set_class_const()

int mrbc_set_class_const ( const struct RClass * cls,
mrbc_sym sym_id,
mrbc_value * v )

setter class constant

Parameters
clsclass.
sym_idsymbol ID.
vpointer to mrbc_value.
Returns
mrbc_error_code.

Definition at line 71 of file global.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mrbc_set_const()

int mrbc_set_const ( mrbc_sym sym_id,
mrbc_value * v )

setter constant

Parameters
sym_idsymbol ID.
vpointer to mrbc_value.
Returns
mrbc_error_code.

Definition at line 53 of file global.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mrbc_set_global()

int mrbc_set_global ( mrbc_sym sym_id,
mrbc_value * v )

setter global variable.

Parameters
sym_idsymbol ID.
vpointer to mrbc_value.
Returns
mrbc_error_code.

Definition at line 149 of file global.c.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ handle_const

mrbc_kv_handle handle_const
static

for global(Object) constants.

Definition at line 28 of file global.c.

◆ handle_global

mrbc_kv_handle handle_global
static

for global variables.

Definition at line 29 of file global.c.