summaryrefslogtreecommitdiffhomepage
path: root/doc/api
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2015-10-09 05:30:31 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2015-10-09 05:30:31 +0900
commit02a6d866bafc31efa0d583524f38232b848f0e58 (patch)
tree869a2d8d13e3cf4070da9d10d571e4d08a8a9984 /doc/api
parent0050bfe586fc9e7aa51d922a4cadcced52e3d80c (diff)
parent87e0840e9d8894d491e5180c7f7923a5cc403f5d (diff)
downloadmruby-02a6d866bafc31efa0d583524f38232b848f0e58.tar.gz
mruby-02a6d866bafc31efa0d583524f38232b848f0e58.zip
Merge pull request #2984 from sagmor/yard
Simpler documentation
Diffstat (limited to 'doc/api')
-rw-r--r--doc/api/README.md30
-rw-r--r--doc/api/gc-arena-howto.md171
-rw-r--r--doc/api/mruby.h.md217
-rw-r--r--doc/api/mruby/array.h.md250
-rw-r--r--doc/api/mruby/hash.h.md380
-rw-r--r--doc/api/mruby/range.h.md47
-rw-r--r--doc/api/mruby/re.h.md3
-rw-r--r--doc/api/mruby/string.h.md91
-rw-r--r--doc/api/mruby/value.h.md238
-rw-r--r--doc/api/mruby/version.h.md33
10 files changed, 0 insertions, 1460 deletions
diff --git a/doc/api/README.md b/doc/api/README.md
deleted file mode 100644
index a83330d82..000000000
--- a/doc/api/README.md
+++ /dev/null
@@ -1,30 +0,0 @@
-# C API Reference
-
-This is a C API Reference.
-The structure of this document will follow the directory structure of `include/` directory.
-
-## Headers list
-Header name|Features
------------|--------
-[mrbconf.h](../mrbconf/README.md)|Defines macros for mruby configurations.
-[mruby.h](./mruby.h.md)|Main header of mruby C API. Include this first.
-[mruby/array.h](./mruby/array.h.md)|`Array` class.
-[mruby/class.h](./mruby/class.h.md)|`Class` class.
-[mruby/compile.h](./mruby/compile.h.md)|mruby compiler.
-[mruby/data.h](./mruby/data.h.md)|User defined object.
-[mruby/debug.h](./mruby/debug.h.md)|Debugging.
-[mruby/dump.h](./mruby/dump.h.md)|Dumping compiled mruby script.
-[mruby/error.h](./mruby/error.h.md)|Error handling.
-[mruby/gc.h](./mruby/gc.h.md)|Uncommon memory management stuffs.
-[mruby/hash.h](./mruby/hash.h.md)|`Hash` class.
-[mruby/irep.h](./mruby/irep.h.md)|Compiled mruby script.
-[mruby/khash.h](./mruby/khash.h.md)|Defines of khash which is used in hash table of mruby.
-[mruby/numeric.h](./mruby/numeric.h.md)|`Numeric` class and sub-classes of it.
-[mruby/opode.h](./mruby/opcode.h.md)|Operation codes used in mruby VM.
-[mruby/proc.h](./mruby/proc.h.md)|`Proc` class.
-[mruby/range.h](./mruby/range.h.md)|`Range` class.
-[mruby/re.h](./mruby/re.h.md)|`Regexp` class.
-[mruby/string.h](./mruby/string.h.md)|`String` class.
-[mruby/value.h](./mruby/value.h.md)|`mrb_value` functions and macros.
-[mruby/variable.h](./mruby/variable.h.md)|Functions to access to mruby variables.
-[mruby/version.h](./mruby/version.h.md)|Macros of mruby version.
diff --git a/doc/api/gc-arena-howto.md b/doc/api/gc-arena-howto.md
deleted file mode 100644
index f2a0448bd..000000000
--- a/doc/api/gc-arena-howto.md
+++ /dev/null
@@ -1,171 +0,0 @@
-# How to use `mrb_gc_arena_save()`/`mrb_gc_arena_restore()`
-
-This is basically English translation of [Matz's blog post](http://www.rubyist.net/~matz/20130731.html) written in Japanese.
-Some parts are updated to reflect recent changes.
-
-When you are extending mruby using C language, you may encounter
-mysterious "arena overflow error" or memory leak or very slow
-execution speed. This is an error indicating overflow of "GC arena"
-implementing "conservative GC".
-
-GC (garbage collector) must ensure that object is "alive", in other
-words, that it is referenced by somewhere from program. This can be
-determined by checking that that object can be directly or indirectly
-referenced by root. The local variables, global variables and
-constants etc are root.
-
-If program execution is performed inside mruby VM, there is nothing to
-worry about because GC can access all roots owned by VM.
-
-The problem arises when executing C functions. The object referenced
-by C variable is also "alive", but mruby GC cannot aware of this, so
-it might mistakenly recognize the objects referenced by only C
-variables as dead.
-
-It is a fatal bug for GC to collect live objects.
-
-In CRuby, we scan C stack area, and use C variable as root to check
-whether object is alive or not. Of course, because we are accessing C
-stack just as memory region, we never know it is an integer or a
-pointer. We workaround this by assuming that if it looks like a
-pointer, then assume it as a pointer. We call it "conservative".
-
-By the way, CRuby's "conservative GC" has some problems.
-
-Its biggest problem is we have no way to access to the stack area in
-portable way. Therefore, we cannot use this method if we'd like to
-implement highly portable runtime, like mruby.
-
-So we came up an another plan to implement "conservative GC" in mruby.
-
-Again, the problem is that there is an object which was created in C
-function, and is not referenced by Ruby world, and cannot be treated
-as garbage.
-
-In mruby, we recognize all objects created in C function are alive.
-Then we have no problem such as recognizing live object as dead.
-
-This means that because we cannot collect truly dead object, we may
-get a little bit less efficiency, but GC itself is highly portable.
-We can say goodbye to the problem that GC deletes live objects due to
-optimization which sometimes occurs in CRuby.
-
-According to this idea, we have a table, called "GC arena", which
-remembers objects created in C function. The arena is stack
-structure, when C function execution is returned to mruby VM, all
-objects registered in the arena are popped.
-
-This works very well, but GC arena causes another problem. "arena
-overflow error" or memory leak.
-
-As of this writing, mruby automatically extend arena to remember
-objects (See `MRB_GC_FIXED_ARENA` and `MRB_GC_ARENA_SIZE` in
-doc/mrbconf/README.md). If you keep creating objects in C functions,
-it increases memory usage, since GC never kick in. This memory usage
-may look like memory leak, and also makes execution slower.
-
-With the build time configuration, you can limit the maximum size of
-arena (e.g., 100). Then if you create many objects, arena overflows,
-thus you will get "arena overflow error".
-
-To workaround these problems, we have `mrb_gc_arena_save()` and
-`mrb_gc_arena_restore()` functions.
-
-`int mrb_gc_arena_save(mrb)` returns the current position of the stack
-top of GC arena, and `void mrb_gc_arena_restore(mrb, idx)` sets the
-stack top position to back to given idx. We uses them like so:
-
-```c
-int arena_idx = mrb_gc_arena_save(mrb);
-
-...create objects...
-mrb_gc_arena_restore(mrb, arena_idx);
-
-```
-
-In mruby, C function call are surrounded by this save/restore, but we
-can further optimize memory usage by surrounding save/restore, and can
-avoid arena overflow.
-
-Let's take a real example. Here is the source code of `Array#inspect`:
-
-```c
-static mrb_value
-inspect_ary(mrb_state *mrb, mrb_value ary, mrb_value list)
-{
- mrb_int i;
- mrb_value s, arystr;
- char head[] = { '[' };
- char sep[] = { ',', ' ' };
- char tail[] = { ']' };
-
- /* check recursive */
- for(i=0; i<RARRAY_LEN(list); i++) {
- if (mrb_obj_equal(mrb, ary, RARRAY_PTR(list)[i])) {
- return mrb_str_new(mrb, "[...]", 5);
- }
- }
-
- mrb_ary_push(mrb, list, ary);
-
- arystr = mrb_str_buf_new(mrb, 64);
- mrb_str_buf_cat(mrb, arystr, head, sizeof(head));
-
- for(i=0; i<RARRAY_LEN(ary); i++) {
- int ai = mrb_gc_arena_save(mrb);
-
- if (i > 0) {
- mrb_str_buf_cat(mrb, arystr, sep, sizeof(sep));
- }
- if (mrb_array_p(RARRAY_PTR(ary)[i])) {
- s = inspect_ary(mrb, RARRAY_PTR(ary)[i], list);
- }
- else {
- s = mrb_inspect(mrb, RARRAY_PTR(ary)[i]);
- }
- mrb_str_buf_cat(mrb, arystr, RSTRING_PTR(s), RSTRING_LEN(s));
- mrb_gc_arena_restore(mrb, ai);
- }
-
- mrb_str_buf_cat(mrb, arystr, tail, sizeof(tail));
- mrb_ary_pop(mrb, list);
-
- return arystr;
-}
-```
-
-This is a real example, so a little bit complicated, so bear with me.
-The essence of `Array#inspect` is that after stringifying each element
-of array using `inspect` method, we join them together so that we can
-get `inspect` representation of entire array.
-
-After the `inspect` representation of entire array is created, we no
-longer require the individual string representation. That means that
-we don't have to register these temporal objects into GC arena.
-
-Therefore, in `ary_inspect()` function, we do:
-
-* save the position of the stack top using `mrb_gc_arena_save()`.
-* get `inspect` representation of each element.
-* append it to the constructing entire `inspect` representation of array.
-* restore stack top position using `mrb_gc_arena_restore()`.
-
-to keep the arena size small.
-
-Please note that the final `inspect` representation of entire array
-was created before the call of `mrb_gc_arena_restore()`. Otherwise,
-required temporal object may be deleted by GC.
-
-We may have a usecase that after creating many temporal objects, we'd
-like to keep some of them. In this case, we cannot use the same idea
-in `ary_inspect()` like appending objects to existing one. Instead,
-after `mrb_gc_arena_restore()`, we register back the objects we'd like
-to keep to the arena using `mrb_gc_protect(mrb, obj)`. Use
-`mrb_gc_protect()` with caution because its usage could lead to arena
-overflow error.
-
-We also have to mention that when `mrb_funcall` is called in top
-level, its return value is also registered to GC arena, so calling
-them repeatedly eventually lead to arena overflow error. Use
-`mrb_gc_arena_save()` and `mrb_gc_arena_restore()` or possible use of
-`mrb_gc_protect()` to workaround this.
diff --git a/doc/api/mruby.h.md b/doc/api/mruby.h.md
deleted file mode 100644
index 06bab2d56..000000000
--- a/doc/api/mruby.h.md
+++ /dev/null
@@ -1,217 +0,0 @@
-# mruby.h
-
-Basic header of mruby.
-It includes **mrbconf.h**, **mruby/value.h**, **mruby/version.h** internally.
-
-## `mrb_state` management
-
-### mrb_open
-```C
-mrb_state* mrb_open();
-```
-Creates new `mrb_state`.
-
-### mrb_allocf
-```C
-typedef void* (*mrb_allocf) (struct mrb_state *mrb, void *ptr, size_t s, void *ud);
-```
-Function pointer type of custom allocator used in `mrb_open_allocf`.
-
-The function pointing it must behave similarly as `realloc` except:
-* If `ptr` is `NULL` it must allocate new space.
-* If `s` is `NULL`, `ptr` must be freed.
-
-### mrb_open_allocf
-```C
-mrb_state* mrb_open_allocf(mrb_allocf f, void *ud);
-```
-Create new `mrb_state` with custom allocator.
-`ud` will be passed to custom allocator `f`.
-If user data isn't required just pass `NULL`.
-Function pointer `f` must satisfy requirements of its type.
-
-### mrb_close
-```C
-void mrb_close(mrb_state *mrb);
-```
-Deletes `mrb_state`.
-
-## Method
-
-### mrb_get_args
-```C
-int mrb_get_args(mrb_state *mrb, const char *format, ...);
-```
-Retrieve arguments from `mrb_state`.
-When applicable, implicit conversions (such as `to_str`,
-`to_ary`, `to_hash`) are applied to received arguments.
-Use it inside a function pointed by `mrb_func_t`.
-It returns the number of arguments retrieved.
-`format` is a list of following format specifiers:
-
-char|mruby type|retrieve types|note
-:---:|----------|--------------|---
-`o`|`Object`|`mrb_value`|Could be used to retrieve any type of argument
-`C`|`Class`/`Module`|`mrb_value`|
-`S`|`String`|`mrb_value`|when ! follows, the value may be nil
-`A`|`Array`|`mrb_value`|when ! follows, the value may be nil
-`H`|`Hash`|`mrb_value`|when ! follows, the value may be nil
-`s`|`String`|`char*`, `mrb_int`|Receive two arguments; s! gives (NULL,0) for nil
-`z`|`String`|`char*`|NUL terminated string; z! gives NULL for nil
-`a`|`Array`|`mrb_value*`, `mrb_int`|Receive two arguments; a! gives (NULL,0) for nil
-`f`|`Float`|`mrb_float`|
-`i`|`Integer`|`mrb_int`|
-`b`|boolean|`mrb_bool`|
-`n`|`Symbol`|`mrb_sym`|
-`&`|block|`mrb_value`|
-`*`|rest arguments|`mrb_value*`, `mrb_int`|Receive the rest of arguments as an array.
-<code>&#124;</code>|optional||After this spec following specs would be optional.
-`?`|optional given|`mrb_bool`|True if preceding argument is given. Used to check optional argument is given.
-
-The passing variadic arguments must be a pointer of retrieving type.
-
-### mrb_define_class
-```C
-MRB_API struct RClass *mrb_define_class(mrb_state *, const char*, struct RClass*);
-```
-Defines a new class. If you're creating a gem it may look something like this:
-
-```C
-void mrb_example_gem_init(mrb_state* mrb) {
- struct RClass *example_class;
- example_class = mrb_define_class(mrb, "Example_Class", mrb->object_class);
-}
-
-void mrb_example_gem_final(mrb_state* mrb) {
- //free(TheAnimals);
-}
-```
-### mrb_define_method
-
-```C
-MRB_API void mrb_define_method(mrb_state*, struct RClass*, const char*, mrb_func_t, mrb_aspec);
-```
-
-Defines a global function in ruby. If you're creating a gem it may look something like this:
-
-```C
-mrb_value example_method(mrb_state* mrb, mrb_value self){
- puts("Executing example command!");
- return self;
-}
-
-void mrb_example_gem_init(mrb_state* mrb) {
- mrb_define_method(mrb, mrb->kernel_module, "example_method", example_method, MRB_ARGS_NONE());
-}
-
-void mrb_example_gem_final(mrb_state* mrb) {
- //free(TheAnimals);
-}
-```
-
-Or maybe you want to create a class method for a class? It might look something like this:
-
-```C
-mrb_value example_method(mrb_state* mrb, mrb_value self){
- puts("Examples are like pizza...");
- return self;
-}
-
-void mrb_example_gem_init(mrb_state* mrb) {
- struct RClass *example_class;
- example_class = mrb_define_class(mrb, "Example_Class", mrb->object_class);
- mrb_define_method(mrb, example_class, "example_method", example_method, MRB_ARGS_NONE());
-}
-
-void mrb_example_gem_final(mrb_state* mrb) {
- //free(TheAnimals);
-}
-```
-### mrb_define_module
-
-```C
-MRB_API struct RClass *mrb_define_module(mrb_state *, const char*);
-```
-
-Defines a module. If you're creating a gem it may look something like this:
-
-```C
-mrb_value example_method(mrb_state* mrb, mrb_value self){
- puts("Examples are like tacos...");
- return self;
-}
-
-void mrb_example_gem_init(mrb_state* mrb) {
- struct RClass *example_module;
- example_module = mrb_define_module(mrb, "Example_Module");
-}
-
-void mrb_example_gem_final(mrb_state* mrb) {
- //free(TheAnimals);
-}
-```
-
-### mrb_define_module_function
-
-```C
-MRB_API void mrb_define_module_function(mrb_state*, struct RClass*, const char*, mrb_func_t, mrb_aspec);
-```
-
-Defines a module function. If you're creating a gem it may look something like this:
-
-
-```C
-mrb_value example_method(mrb_state* mrb, mrb_value self){
- puts("Examples are like hot wings...");
- return self;
-}
-
-void mrb_example_gem_init(mrb_state* mrb) {
- struct RClass *example_module;
- example_module = mrb_define_module(mrb, "Example_Module");
- mrb_define_module_function(mrb, example_module, "example_method", example_method, MRB_ARGS_NONE());
-}
-
-void mrb_example_gem_final(mrb_state* mrb) {
- //free(TheAnimals);
-}
-```
-
-### mrb_define_const
-
-```C
-MRB_API void mrb_define_const(mrb_state*, struct RClass*, const char *name, mrb_value);
-```
-
-Defines a constant. If you're creating a gem it may look something like this:
-
-```C
-mrb_value example_method(mrb_state* mrb, mrb_value self){
- puts("Examples are like hot wings...");
- return self;
-}
-
-void mrb_example_gem_init(mrb_state* mrb) {
- mrb_define_const(mrb, mrb->kernel_module, "EXAPMLE_CONSTANT", mrb_fixnum_value(0x00000001));
-}
-
-void mrb_example_gem_final(mrb_state* mrb) {
- //free(TheAnimals);
-}
-```
-
-### mrb_str_new_cstr
-
-```C
-MRB_API mrb_value mrb_str_new_cstr(mrb_state*, const char*);
-```
-
-Turns a C string into a Ruby string value.
-
-
-### mrb_value mrb_funcall
-
-```C
-MRB_API mrb_value mrb_funcall(mrb_state*, mrb_value, const char*, mrb_int,...);
-```
-Call existing ruby functions.
diff --git a/doc/api/mruby/array.h.md b/doc/api/mruby/array.h.md
deleted file mode 100644
index 36c253cec..000000000
--- a/doc/api/mruby/array.h.md
+++ /dev/null
@@ -1,250 +0,0 @@
-### mrb_ary_new
-
-```C
-mrb_value mrb_ary_new(mrb_state *mrb);
-```
-Initializes an array.
-#### Example
-In this example we read from a Ruby file inside C. The Ruby code will print what you pass as an argument and what class the passed in value is. In this case we are declaring a variable new_ary of data type mrb_value. Then we are initializing it with the mrb_ary_new function which only takes an mruby state as an argument.
-```C
-#include <stdio.h>
-#include <mruby.h>
-#include "mruby/array.h" // Needs the array header.
-#include "mruby/compile.h"
-
-int main(int argc, char *argv[])
-{
- mrb_value new_ary; // Declare variable.
- mrb_state *mrb = mrb_open();
- if (!mrb) { /* handle error */ }
- FILE *fp = fopen("test.rb","r");
- new_ary = mrb_ary_new(mrb);
- mrb_value obj = mrb_load_file(mrb,fp);
- mrb_funcall(mrb, obj, "method_name", 1, new_ary);
- fclose(fp);
- mrb_close(mrb);
- return 0;
-}
-```
-test.rb
-```Ruby
-class Example_Class
- def method_name(a)
- puts a
- puts a.class
- end
-end
-Example_Class.new
-```
-
-### mrb_ary_push
-```C
-void mrb_ary_push(mrb_state*, mrb_value, mrb_value);
-```
-Pushes given value into an array.
-#### Example
-In this example we read from a Ruby file inside C. The Ruby code will print what you pass as an argument and what class the passed in value is. In this case after initializing our array. We are declaring two variables with the mrb_int data type random_value1 & random_value2 and we initialize them 70 and 60 respectively. Then we use the mrb_ary_push function to push values those values into the array.
-```C
-#include <stdio.h>
-#include <mruby.h>
-#include "mruby/array.h" // Needs the array header.
-#include "mruby/compile.h"
-
-int main(int argc, char *argv[])
-{
- mrb_value new_ary; // Declare variable.
- mrb_int random_value1 = 70; // Initialize variable
- mrb_int random_value2 = 60; // Initialize variable
- mrb_state *mrb = mrb_open();
- if (!mrb) { /* handle error */ }
- FILE *fp = fopen("test.rb","r");
- new_ary = mrb_ary_new(mrb); // Initialize ruby array.
- /* Pushes the fixnum value from random_value1 to the new_ary instance. */
- mrb_ary_push(mrb, new_ary, mrb_fixnum_value(random_value1));
- /* Pushes the fixnum value from random_value2 to the new_ary instance. */
- mrb_ary_push(mrb, new_ary, mrb_fixnum_value(random_value2));
- mrb_value obj = mrb_load_file(mrb,fp);
- mrb_funcall(mrb, obj, "method_name", 1, new_ary);
- fclose(fp);
- mrb_close(mrb);
- return 0;
-}
-```
-test.rb
-```Ruby
-class Example_Class
- def method_name(a)
- puts a
- puts a.class
- end
-end
-Example_Class.new
-```
-#### Result
-After compiling you should get these results.
-```Ruby
-[70, 60]
-Array
-```
-
-## mrb_ary_pop
-```C
-mrb_value mrb_ary_pop(mrb_state *mrb, mrb_value ary);
-```
-Pops the last element from the array.
-#### Example
-In this example we read from a Ruby file inside C. The Ruby code will print what you pass as an argument and what class the passed in value is. In this case after initializing our array. We are declaring two variables with the mrb_int data type random_value1 & random_value2 and we initialize them 70 and 60 respectively. Then we use the mrb_ary_push function to push values those values into the array. Now here in the Ruby files we add another method
-called pop_ary that will return the array alone(just to be clean) and you should see the last element gone.
-```C
-#include <stdio.h>
-#include <mruby.h>
-#include "mruby/array.h" // Needs the array header.
-#include "mruby/compile.h"
-
-int main(int argc, char *argv[])
-{
- mrb_value new_ary; // Declare variable.
- mrb_int random_value1 = 70; // Initialize variable
- mrb_int random_value2 = 60; // Initialize variable
- mrb_state *mrb = mrb_open();
- if (!mrb) { /* handle error */ }
- FILE *fp = fopen("test.rb","r");
- new_ary = mrb_ary_new(mrb); // Initialize ruby array.
- /* Pushes the fixnum value from random_value1 to the new_ary instance. */
- mrb_ary_push(mrb, new_ary, mrb_fixnum_value(random_value1));
- /* Pushes the fixnum value from random_value2 to the new_ary instance. */
- mrb_ary_push(mrb, new_ary, mrb_fixnum_value(random_value2));
- mrb_value obj = mrb_load_file(mrb,fp);
- mrb_funcall(mrb, obj, "method_name", 1, new_ary);
- mrb_ary_pop(mrb, new_ary); // Pops the last element of the array. In this case 60.
- mrb_funcall(mrb, obj, "pop_ary", 1, new_ary); // Calls the method again to show the results.
- fclose(fp);
- mrb_close(mrb);
- return 0;
-}
-```
-test.rb
-```Ruby
-class Example_Class
- def method_name(a)
- puts a
- puts a.class
- end
- def pop_ary(a)
- puts a
- end
-end
-Example_Class.new
-```
-#### Result
-After compiling you should get these results.
-```Ruby
-[70, 60]
-Array
-[70]
-```
-## mrb_ary_ref
-```C
-mrb_value mrb_ary_ref(mrb_state *mrb, mrb_value ary, mrb_int n);
-```
-Returns a reference to an element of the array. Specified by the value given to mrb_int n.
-#### Example
-In this example we read from a Ruby file inside C. The Ruby code will print what you pass as an argument and what class the passed in value is. In this case we're declaring a variable ary_ref with the data type of mrb_value. Then we assign mrb_ary_ref to it getting new_ary's value at index 1.
-```C
-#include <stdio.h>
-#include <mruby.h>
-#include "mruby/array.h" // Needs the array header.
-#include "mruby/compile.h"
-
-int main(int argc, char *argv[])
-{
- mrb_value ary_ref; // Declare variable.
- mrb_value new_ary; // Declare variable.
- mrb_int random_value1 = 70; // Initialize variable
- mrb_int random_value2 = 60; // Initialize variable
- mrb_state *mrb = mrb_open();
- if (!mrb) { /* handle error */ }
- FILE *fp = fopen("test.rb","r");
- new_ary = mrb_ary_new(mrb); // Initialize ruby array.
- /* Pushes the fixnum value from random_value1 to the new_ary instance. */
- mrb_ary_push(mrb, new_ary, mrb_fixnum_value(random_value1));
- /* Pushes the fixnum value from random_value2 to the new_ary instance. */
- mrb_ary_push(mrb, new_ary, mrb_fixnum_value(random_value2));
- ary_ref = mrb_ary_ref(mrb, new_ary, 1); // Gets the value of new_ary's second element at index 1.
- mrb_value obj = mrb_load_file(mrb,fp);
- /* Passing the value from ary_ref to the method method_name.*/
- mrb_funcall(mrb, obj, "method_name", 1, ary_ref);
- fclose(fp);
- mrb_close(mrb);
- return 0;
-}
-```
-test.rb
-```Ruby
-class Example_Class
- def method_name(a)
- puts a
- puts a.class
- end
-end
-Example_Class.new
-```
-#### Result
-After compiling you should get these results.
-```Ruby
-60
-Fixnum
-```
-
-### mrb_ary_set
-```C
-void mrb_ary_set(mrb_state *mrb, mrb_value ary, mrb_int n, mrb_value val);
-```
-Sets a value to an index.
-#### Example
-In this example we read from a Ruby file inside C. The Ruby code will print what you pass as an argument and what class the passed in value is. In this case we're declaring a variable ary_ref with the data type of mrb_value. Then we assign mrb_ary_ref to it getting new_ary's value at index 1.
-```C
-#include <stdio.h>
-#include <mruby.h>
-#include "mruby/array.h" // Needs the array header.
-#include "mruby/compile.h"
-
-int main(int argc, char *argv[])
-{
- mrb_value new_ary;
- mrb_value ary_obj;
- mrb_int random_value1 = 70;
- mrb_int random_value2 = 60;
- mrb_state *mrb = mrb_open();
- if (!mrb) { /* handle error */ }
- FILE *fp = fopen("test.rb","r");
- new_ary = mrb_ary_new(mrb);
- mrb_ary_push(mrb, new_ary, mrb_fixnum_value(random_value1));
- mrb_ary_push(mrb, new_ary, mrb_fixnum_value(random_value2));
- /* Sets the fixnum value of 7 to the second index of the array.*/
- mrb_ary_set(mrb, new_ary, 2, mrb_fixnum_value(7));
- mrb_value obj = mrb_load_file(mrb,fp);
- mrb_funcall(mrb, obj, "before_after", 1, new_ary);
- fclose(fp);
- mrb_close(mrb);
- return 0;
-}
-```
-test.rb
-```Ruby
-class Example_Class
- def method_name(a)
- puts a
- puts a.class
- end
- def before_after(a)
- puts a
- end
-end
-Example_Class.new
-```
-#### Result
-After compiling you should get these results.
-```Ruby
-[70, 60, 7]
-```
diff --git a/doc/api/mruby/hash.h.md b/doc/api/mruby/hash.h.md
deleted file mode 100644
index fa12ea670..000000000
--- a/doc/api/mruby/hash.h.md
+++ /dev/null
@@ -1,380 +0,0 @@
-### mrb_hash_new
-
-```C
-mrb_value mrb_hash_new(mrb_state *mrb);
-```
-
-Initializes a hash.
-#### Example
-
-In this example we read from a Ruby file inside C. The Ruby code will print what you pass as an argument
-and what class the passed in value is. This example initializes a hash. In pure Ruby doing this is equivalent
-to Hash.new.
-
-```C
-#include <stdio.h>
-#include <mruby.h>
-#include "mruby/hash.h" // Needs the hash header.
-#include "mruby/compile.h"
-
-int main(int argc, char *argv[])
-{
- mrb_state *mrb = mrb_open();
- if (!mrb) { /* handle error */ }
- mrb_value new_hash; // Declare variable.
- FILE *fp = fopen("test_ext.rb","r");
- new_hash = mrb_hash_new(mrb); // Initialize hash.
- mrb_value obj = mrb_load_file(mrb,fp);
- mrb_funcall(mrb, obj, "method_name", 1, new_hash);
- fclose(fp);
- mrb_close(mrb);
- return 0;
-}
-```
-
-#### test_ext.rb
-
-``` Ruby
-class Example_Class
- def method_name(a)
- puts a
- puts a.class
- end
-end
-Example_Class.new
-```
-
-### mrb_hash_set
-
-```C
-void mrb_hash_set(mrb_state *mrb, mrb_value hash, mrb_value key, mrb_value val);
-```
-
-Sets a keys and values to hashes.
-#### Example
-
-In this example we read from a Ruby file inside C. The Ruby code will print what you pass as an argument
-and what class the passed in value is. This example sets a key and value pair to a hash. In pure Ruby doing this is equivalent to:
-
-```Ruby
-a = {:da_key => 80}
-```
-
-```C
-#include <stdio.h>
-#include <mruby.h>
-#include "mruby/hash.h" // Needs the hash header.
-#include "mruby/compile.h"
-
-int main(int argc, char *argv[])
-{
- mrb_state *mrb = mrb_open();
- if (!mrb) { /* handle error */ }
- mrb_value new_hash; // Declare variable.
- mrb_sym hash_key = mrb_intern_cstr(mrb, "da_key"); // Declare a symbol.
- mrb_int hash_value = 80; // Declare a fixnum value.
- FILE *fp = fopen("test_ext.rb","r");
- new_hash = mrb_hash_new(mrb); // Initialize hash.
- mrb_value obj = mrb_load_file(mrb,fp);
- mrb_hash_set(mrb, new_hash, mrb_symbol_value(hash_key), mrb_fixnum_value(hash_value)); // Set values to hash.
- mrb_funcall(mrb, obj, "method_name", 1, new_hash);
- fclose(fp);
- mrb_close(mrb);
- return 0;
-}
-```
-
-#### test_ext.rb
-
-```Ruby
-class Example_Class
- def method_name(a)
- puts a
- puts a.class
- end
-end
-Example_Class.new
-```
-
-#### Result
-
-After compiling you should get these results.
-
-```Ruby
-{:da_key=>80}
-Hash
-```
-
-### mrb_hash_get
-
-```C
-mrb_value mrb_hash_get(mrb_state *mrb, mrb_value hash, mrb_value key);
-```
-
-Gets a value from a key.
-#### Example
-
-In this example we read from a Ruby file inside C. The Ruby code will print what you pass as an argument
-and what class the passed in value is. This example gets a value from a key. In pure Ruby doing this is equivalent to:
-
-```Ruby
-a = {:da_key => 80}
-a[:da_key]
-```
-
-```C
-#include <stdio.h>
-#include <mruby.h>
-#include "mruby/hash.h" // Needs the hash header.
-#include "mruby/compile.h"
-
-int main(int argc, char *argv[])
-{
- mrb_state *mrb = mrb_open();
- if (!mrb) { /* handle error */ }
- mrb_value new_hash; // Declare variable for new hash object.
- mrb_value get_hash_value; // Declare variable for getting a value from a hash.
- mrb_sym hash_key_a = mrb_intern_cstr(mrb, "da_key1"); // Declare a symbol.
- mrb_sym hash_key_b = mrb_intern_cstr(mrb, "da_key2"); // Declare a symbol.
- mrb_int hash_value_a = 80; // Declare a fixnum value.
- mrb_int hash_value_b = 90; // Declare a fixnum value.
- FILE *fp = fopen("test_ext.rb","r");
- new_hash = mrb_hash_new(mrb); // Initialize hash.
- mrb_value obj = mrb_load_file(mrb,fp);
- mrb_hash_set(mrb, new_hash, mrb_symbol_value(hash_key_a), mrb_fixnum_value(hash_value_a)); // Set values to hash.
- mrb_hash_set(mrb, new_hash, mrb_symbol_value(hash_key_b), mrb_fixnum_value(hash_value_b)); // Set values to hash.
- get_hash_value = mrb_hash_get(mrb, new_hash, mrb_symbol_value(hash_key_b)); // Get value from hash.
- mrb_funcall(mrb, obj, "method_name", 1, get_hash_value);
- fclose(fp);
- mrb_close(mrb);
- return 0;
-}
-```
-
-#### test_ext.rb
-
-```Ruby
-class Example_Class
- def method_name(a)
- puts a
- puts a.class
- end
-end
-Example_Class.new
-```
-
-#### Result
-
-After compiling you should get these results.
-
-```Ruby
-90
-Fixnum
-```
-
-### mrb_hash_delete_key
-
-```C
-mrb_value mrb_hash_delete_key(mrb_state *mrb, mrb_value hash, mrb_value key);
-```
-
-Deletes hash key and value pair.
-#### Example
-
-In this example we read from a Ruby file inside C. The Ruby code will print what you pass as an argument
-and what class the passed in value is. This example deletes hash key and value pair. In pure Ruby doing this is equivalent to:
-
-```Ruby
-a = {:da_key1 => 80,:da_key2 => 90}
-a.delete(:da_key2)
-```
-
-```C
-#include <stdio.h>
-#include <mruby.h>
-#include "mruby/hash.h" // Needs the hash header.
-#include "mruby/compile.h"
-
-int main(int argc, char *argv[])
-{
- mrb_state *mrb = mrb_open();
- if (!mrb) { /* handle error */ }
- mrb_value new_hash; // Declare variable for new hash object.
- mrb_value get_hash_value; // Declare variable for getting a value from a hash.
- mrb_sym hash_key_a = mrb_intern_cstr(mrb, "da_key1"); // Declare a symbol.
- mrb_sym hash_key_b = mrb_intern_cstr(mrb, "da_key2"); // Declare a symbol.
- mrb_sym hash_key_b = mrb_intern_cstr(mrb, "da_key2"); // Declare a symbol.
- mrb_int hash_value_a = 80; // Declare a fixnum value.
- mrb_int hash_value_b = 90; // Declare a fixnum value.
- FILE *fp = fopen("test_ext.rb","r");
- new_hash = mrb_hash_new(mrb); // Initialize hash.
- mrb_value obj = mrb_load_file(mrb,fp);
- mrb_hash_set(mrb, new_hash, mrb_symbol_value(hash_key_a), mrb_fixnum_value(hash_value_a)); // Set values to hash.
- mrb_hash_set(mrb, new_hash, mrb_symbol_value(hash_key_b), mrb_fixnum_value(hash_value_b)); // Set values to hash.
- mrb_funcall(mrb, obj, "method_name", 1, new_hash);
- mrb_hash_delete_key(mrb, new_hash, mrb_symbol_value(hash_key_b));
- mrb_funcall(mrb, obj, "another_method_name", 1, new_hash);
- fclose(fp);
- mrb_close(mrb);
- return 0;
-}
-```
-
-#### test_ext.rb
-
-```Ruby
-class Example_Class
- def method_name(a)
- puts "Hash pre deletion #{a}"
- #puts a.class
- end
- # Show deleted key and value pair.
- def another_method_name(a)
- puts "Hash post deletion #{a}"
- end
-end
-Example_Class.new
-```
-
-#### Result
-
-After compiling you should get these results.
-
-```Ruby
-Hash pre deletion {:da_key1 => 80, :da_key2 => 90}
-Hash post deletion {:da_key1 => 80}
-```
-
-### mrb_hash_keys
-
-```C
-mrb_value mrb_hash_keys(mrb_state *mrb, mrb_value hash);
-```
-
-Gets an array of keys.
-#### Example
-
-In this example we read from a Ruby file inside C. The Ruby code will print what you pass as an argument
-and what class the passed in value is. This example gets an array of keys from a hash.
-
-```C
-#include <stdio.h>
-#include <mruby.h>
-#include "mruby/hash.h" // Needs the hash header.
-#include "mruby/compile.h"
-
-int main(int argc, char *argv[])
-{
- mrb_state *mrb = mrb_open();
- if (!mrb) { /* handle error */ }
- mrb_value new_hash; // Declare variable for new hash object.
- mrb_value get_hash_keys; // Declare variable for getting an array of keys.
- mrb_sym hash_key_a = mrb_intern_cstr(mrb, "da_key1"); // Declare a symbol.
- mrb_sym hash_key_b = mrb_intern_cstr(mrb, "da_key2"); // Declare a symbol.
- mrb_int hash_value_a = 80; // Declare a fixnum value.
- mrb_int hash_value_b = 90; // Declare a fixnum value.
- FILE *fp = fopen("test_ext.rb","r");
- new_hash = mrb_hash_new(mrb); // Initialize hash.
- mrb_value obj = mrb_load_file(mrb,fp);
- mrb_hash_set(mrb, new_hash, mrb_symbol_value(hash_key_a), mrb_fixnum_value(hash_value_a)); // Set values to hash.
- mrb_hash_set(mrb, new_hash, mrb_symbol_value(hash_key_b), mrb_fixnum_value(hash_value_b)); // Set values to hash.
- get_hash_keys = mrb_hash_keys(mrb, new_hash); // get an array of keys.
- mrb_funcall(mrb, obj, "method_name", 1, get_hash_keys);
- fclose(fp);
- mrb_close(mrb);
- return 0;
-}
-```
-
-#### test_ext.rb
-
-```Ruby
-class Example_Class
- def method_name(a)
- puts a
- puts a.class
- end
-end
-Example_Class.new
-```
-
-#### Result
-
-After compiling you should get these results.
-
-```Ruby
-[:da_key1, :da_key2]
-Array
-```
-
-### mrb_hash_clear
-
-```C
-mrb_value mrb_hash_clear(mrb_state *mrb, mrb_value hash);
-```
-
-Clears the hash.
-#### Example
-
-In this example we read from a Ruby file inside C. The Ruby code will print what you pass as an argument
-and what class the passed in value is. This example clears the hash. In pure Ruby doing this is equivalent to:
-
-```Ruby
-a = {:da_key1 => 80,:da_key2 => 90}
-a.clear
-```
-
-```C
-#include <stdio.h>
-#include <mruby.h>
-#include "mruby/hash.h" // Needs the hash header.
-#include "mruby/compile.h"
-
-int main(int argc, char *argv[])
-{
- mrb_state *mrb = mrb_open();
- if (!mrb) { /* handle error */ }
- mrb_value new_hash; // Declare variable for new hash object.
- mrb_value get_hash; // Declare variable for getting a hash.
- mrb_sym hash_key_a = mrb_intern_cstr(mrb, "da_key1"); // Declare a symbol.
- mrb_sym hash_key_b = mrb_intern_cstr(mrb, "da_key2"); // Declare a symbol.
- mrb_int hash_value_a = 80; // Declare a fixnum value.
- mrb_int hash_value_b = 90; // Declare a fixnum value.
- FILE *fp = fopen("test_ext.rb","r");
- new_hash = mrb_hash_new(mrb); // Initialize hash.
- mrb_value obj = mrb_load_file(mrb,fp);
- mrb_hash_set(mrb, new_hash, mrb_symbol_value(hash_key_a), mrb_fixnum_value(hash_value_a)); // Set values to hash.
- mrb_hash_set(mrb, new_hash, mrb_symbol_value(hash_key_b), mrb_fixnum_value(hash_value_b)); // Set values to hash.
- mrb_funcall(mrb, obj, "method_name", 1, new_hash);
- get_hash = mrb_hash_clear(mrb, new_hash);
- mrb_funcall(mrb, obj, "another_method_name", 1, get_hash);
- fclose(fp);
- mrb_close(mrb);
- return 0;
-}
-```
-
-#### test_ext.rb
-
-```Ruby
-class Example_Class
- def method_name(a)
- puts "Hash pre clear #{a}"
- #puts a.class
- end
- # Show clear hash.
- def another_method_name(a)
- puts "Hash post clear #{a}"
- end
-end
-Example_Class.new
-```
-
-#### Result
-
-After compiling you should get these results.
-
-```Ruby
-Hash pre clear {:da_key1 => 80, :da_key2 => 90}
-Hash post clear {}
-```
diff --git a/doc/api/mruby/range.h.md b/doc/api/mruby/range.h.md
deleted file mode 100644
index 188e6ede6..000000000
--- a/doc/api/mruby/range.h.md
+++ /dev/null
@@ -1,47 +0,0 @@
-#### mrb_range_new
-```C
- mrb_value mrb_range_new(mrb_state*, mrb_value, mrb_value, mrb_bool);
-```
-Initializes a Range. The first mrb_value being the beginning value and second being the ending value.
-The third parameter is an mrb_bool value that represents the inclusion or exclusion of the last value.
-If the third parameter is 0 then it includes the last value in the range. If the third parameter is 1
-then it excludes the last value in the range.
-C code
-```C
- #include <stdio.h>
- #include <mruby.h>
- #include "mruby/range.h" // Needs the range header.
- #include "mruby/compile.h"
-
- int main(int argc, char *argv[])
- {
- mrb_int beg = 0;
- mrb_int end = 2;
- mrb_bool exclude = 1;
- mrb_value range_obj;
- mrb_state *mrb = mrb_open();
- if (!mrb) { /* handle error */ }
- FILE *fp = fopen("test.rb","r");
- range_obj = mrb_range_new(mrb, mrb_fixnum_value(beg), mrb_fixnum_value(end), exclude);
- mrb_value obj = mrb_load_file(mrb,fp);
- mrb_funcall(mrb, obj, "method_name", 1, range_obj);
- fclose(fp);
- mrb_close(mrb);
- return 0;
- }
-```
-Ruby code
-```Ruby
- class Example_Class
- def method_name(a)
- puts a
- puts a.class
- end
- end
- Example_Class.new
-```
-This returns the following:
-```Ruby
- 0...2
- Range
-```
diff --git a/doc/api/mruby/re.h.md b/doc/api/mruby/re.h.md
deleted file mode 100644
index f5cd2a71e..000000000
--- a/doc/api/mruby/re.h.md
+++ /dev/null
@@ -1,3 +0,0 @@
-### Macros
-#### REGEXP_CLASS
-A string with the name of the REGEXP class.
diff --git a/doc/api/mruby/string.h.md b/doc/api/mruby/string.h.md
deleted file mode 100644
index 7bf94df5b..000000000
--- a/doc/api/mruby/string.h.md
+++ /dev/null
@@ -1,91 +0,0 @@
-## Macros
-### mrb_str_ptr(s)
-Returns a pointer from a Ruby string.
-## Functions
-### mrb_str_plus
-```C
- mrb_value mrb_str_plus(mrb_state*, mrb_value, mrb_value);
-```
-Adds to strings together.
-### mrb_ptr_to_str
-```C
- mrb_value mrb_ptr_to_str(mrb_state *, void*);
-```
-Converts pointer into a Ruby string.
-### mrb_obj_as_string
-```C
- mrb_value mrb_obj_as_string(mrb_state *mrb, mrb_value obj);
-```
-Returns an object as a Ruby string.
-### mrb_str_resize
-```C
- mrb_value mrb_str_resize(mrb_state *mrb, mrb_value str, mrb_int len);
-```
-Resizes the string's length.
-### mrb_str_substr
-```C
- mrb_value mrb_str_substr(mrb_state *mrb, mrb_value str, mrb_int beg, mrb_int len);
-```
-Returns a sub string.
-### mrb_string_type
-```C
- mrb_value mrb_string_type(mrb_state *mrb, mrb_value str);
-```
-Returns a Ruby string type.
-### mrb_str_new_cstr
-```C
- const char *mrb_string_value_cstr(mrb_state *mrb, mrb_value *ptr);
-```
-Returns a Ruby string as a C string.
-### mrb_str_dup
-```C
- mrb_value mrb_str_dup(mrb_state *mrb, mrb_value str);
-```
-Duplicates a string object.
-### mrb_str_intern
-```C
- mrb_value mrb_str_intern(mrb_state *mrb, mrb_value self);
-```
-Returns a symbol from a passed in string.
-### mrb_str_to_str
-```C
- mrb_value mrb_str_to_str(mrb_state *mrb, mrb_value str);
-```
-Returns a converted string type.
-### mrb_str_equal
-```C
- mrb_bool mrb_str_equal(mrb_state *mrb, mrb_value str1, mrb_value str2);
-```
-Returns true if the strings match and false if the strings don't match.
-### mrb_str_cat
-```C
- mrb_value mrb_str_cat(mrb_state *mrb, mrb_value str, const char *ptr, size_t len);
-```
-Returns a concated string comprised of a Ruby string and a C string.
-### mrb_str_cat_cstr
-```C
- mrb_value mrb_str_cat_str(mrb_state *mrb, mrb_value str, mrb_value str2);
-```
-Returns a concated string comprised of a Ruby string and a C string(A shorter alternative to mrb_str_cat).
-### mrb_str_append
-```C
- mrb_value mrb_str_append(mrb_state *mrb, mrb_value str1, mrb_value str2);
-```
-Adds str2 to the end of str1.
-### mrb_str_cmp
-```C
- int mrb_str_cmp(mrb_state *mrb, mrb_value str1, mrb_value str2);
-```
-Returns 0 if both Ruby strings are equal.
-Returns a value < 0 if Ruby str1 is less than Ruby str2.
-Returns a value > 0 if Ruby str2 is greater than Ruby str1.
-### mrb_str_to_cstr
-```C
- char *mrb_str_to_cstr(mrb_state *mrb, mrb_value str);
-```
-Returns a C string from a Ruby string.
-### mrb_str_inspect
-```C
- mrb_str_inspect(mrb_state *mrb, mrb_value str);
-```
-Returns a printable version of str, surrounded by quote marks, with special characters escaped.
diff --git a/doc/api/mruby/value.h.md b/doc/api/mruby/value.h.md
deleted file mode 100644
index fbf2dadf1..000000000
--- a/doc/api/mruby/value.h.md
+++ /dev/null
@@ -1,238 +0,0 @@
-### mrb_float_value
-```C
-static inline mrb_value mrb_float_value(struct mrb_state *mrb, mrb_float f)
-```
-
-Returns a float in Ruby.
-
-##### Example
-
-In this example we read from a Ruby file inside C. The Ruby code will print what you pass as an argument
-and what class the passed in value is. In this case we are passing in mrb_float f = 0.09. Alternatively
-double i = 0.09 could also be used.
-
-
-example.c
-```C
-#include <stdio.h>
-#include <mruby.h>
-#include "mruby/compile.h"
-#include "mruby/string.h"
-
-int
-main(void)
-{
- mrb_float f = 0.09;// or double i = 0.09;
- mrb_state *mrb = mrb_open();
- if (!mrb) { /* handle error */ }
- FILE *fp = fopen("test.rb","r");
- mrb_value obj = mrb_load_file(mrb,fp);
- mrb_funcall(mrb, obj, "method_name", 1, mrb_float_value(mrb, f));
- fclose(fp);
- mrb_close(mrb);
- return 0;
-}
-
-```
-
-test.rb
-```Ruby
-class My_Class
- def method_name(s)
- puts s
- puts s.class
- end
-end
-a = My_Class.new
-```
-
-### mrb_fixnum_value
-
-```C
-static inline mrb_value mrb_fixnum_value(mrb_int i)
-```
-
-Returns a fixnum in Ruby.
-
-##### Example
-
-In this example we read from a Ruby file inside C. The Ruby code will print what you pass as an argument
-and what class the passed in value is. In this case we are passing in mrb_int i = 99. Alternativly int i = 99
-could also be used.
-
-
-example.c
-```C
-#include <stdio.h>
-#include <mruby.h>
-#include "mruby/compile.h"
-
-int
-main(void)
-{
- mrb_int i = 99; // or int i = 99;
- mrb_state *mrb = mrb_open();
- if (!mrb) { /* handle error */ }
- FILE *fp = fopen("test.rb","r");
- mrb_value obj = mrb_load_file(mrb,fp);
- mrb_funcall(mrb, obj, "method_name", 1, mrb_fixnum_value(i));
- fclose(fp);
- mrb_close(mrb);
- return 0;
-}
-
-```
-
-test.rb
-```Ruby
-class My_Class
- def method_name(s)
- puts s
- puts s.class
- end
-end
-a = My_Class.new
-```
-
-
-
-### mrb_nil_value
-
-```C
-static inline mrb_value mrb_nil_value(void)
-```
-
-Returns nil in Ruby.
-
-##### Example
-
-In this example we read from a Ruby file inside C. The Ruby code will print what you pass as an argument
-and what class the passed in value is. In this case we are passing in nothing and we will get NillClass.
-
-
-example.c
-```C
-#include <stdio.h>
-#include <mruby.h>
-#include "mruby/compile.h"
-
-int
-main(void)
-{
- mrb_state *mrb = mrb_open();
- if (!mrb) { /* handle error */ }
- FILE *fp = fopen("test.rb","r");
- mrb_value obj = mrb_load_file(mrb,fp);
- mrb_funcall(mrb, obj, "method_name", 1, mrb_nil_value());
- fclose(fp);
- mrb_close(mrb);
- return 0;
-}
-
-```
-
-test.rb
-```Ruby
-class My_Class
- def method_name(s)
- puts s
- puts s.class
- end
-end
-a = My_Class.new
-```
-
-
-### mrb_false_value
-
-```C
-static inline mrb_value mrb_false_value(void)
-```
-
-Returns false in Ruby.
-
-##### Example
-
-In this example we read from a Ruby file inside C. The Ruby code will print what you pass as an argument
-and what class the passed in value is. In this case we are passing in nothing and we will get FalseClass.
-
-
-example.c
-```C
-#include <stdio.h>
-#include <mruby.h>
-#include "mruby/compile.h"
-
-int
-main(void)
-{
- mrb_state *mrb = mrb_open();
- if (!mrb) { /* handle error */ }
- FILE *fp = fopen("test.rb","r");
- mrb_value obj = mrb_load_file(mrb,fp);
- mrb_funcall(mrb, obj, "method_name", 1, mrb_false_value());
- fclose(fp);
- mrb_close(mrb);
- return 0;
-}
-
-```
-
-test.rb
-```Ruby
-class My_Class
- def method_name(s)
- puts s
- puts s.class
- end
-end
-a = My_Class.new
-```
-
-
-
-### mrb_true_value
-
-```C
-static inline mrb_value mrb_true_value(void)
-```
-
-Returns true in Ruby.
-
-##### Example
-
-In this example we read from a Ruby file inside C. The Ruby code will print what you pass as an argument
-and what class the passed in value is. In this case we are passing in nothing and we will get TrueClass.
-
-
-example.c
-```C
-#include <stdio.h>
-#include <mruby.h>
-#include "mruby/compile.h"
-
-int
-main(void)
-{
- mrb_state *mrb = mrb_open();
- if (!mrb) { /* handle error */ }
- FILE *fp = fopen("test.rb","r");
- mrb_value obj = mrb_load_file(mrb,fp);
- mrb_funcall(mrb, obj, "method_name", 1, mrb_true_value());
- fclose(fp);
- mrb_close(mrb);
- return 0;
-}
-
-```
-
-test.rb
-```Ruby
-class My_Class
- def method_name(s)
- puts s
- puts s.class
- end
-end
-a = My_Class.new
-```
diff --git a/doc/api/mruby/version.h.md b/doc/api/mruby/version.h.md
deleted file mode 100644
index f627b1da1..000000000
--- a/doc/api/mruby/version.h.md
+++ /dev/null
@@ -1,33 +0,0 @@
-### Macros
-#### MRUBY_RUBY_VERSION
-The version of Ruby used by mruby.
-#### MRUBY_RUBY_ENGINE
-Ruby engine.
-#### MRUBY_VERSION
-The mruby version.
-#### MRUBY_RELEASE_MAJOR
-Major release version.
-#### MRUBY_RELEASE_MINOR
-Minor release version.
-#### MRUBY_RELEASE_NO
-Release number.
-#### MRUBY_RELEASE_DATE
-Release date as a string.
-#### MRUBY_RELEASE_YEAR
-Release year.
-#### MRUBY_RELEASE_MONTH
-Release month.
-#### MRUBY_RELEASE_DAY
-Release day.
-#### MRUBY_BIRTH_YEAR
-The year mruby was first created.
-#### MRUBY_AUTHOR
-Mruby's authors.
-#### MRB_STRINGIZE0(expr)
-A passed in expression.
-#### MRB_STRINGIZE(expr)
-Passes in an expression to MRB_STRINGIZE0.
-#### MRUBY_DESCRIPTION
-mruby's version, and release date.
-#### MRUBY_COPYRIGHT
-mruby's copyright information.