1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/README.EXT

1030 lines
27 KiB
Text
Raw Normal View History

.\" README.EXT - -*- Text -*- created at: Mon Aug 7 16:45:54 JST 1995
This document explains how to make extention modules for Ruby.
1<EFBFBD><EFBFBD>Basic knowledge
In C, variables have types and data do not have types. In contrast,
Ruby variables do not have static type and data themselves have
types. So, data need to be converted across the languages.
Data in Ruby represented C type `VALUE'. Each VALUE data have its
data-type.
To retrieve an C data from the VALUE, you need to:
(1) Identify VALUE's data type
(2) Convert VALUE into C data
Converting to wrong data type may cause serious promblems.
1.1 Data-types
Ruby interpreter has data-types as below:
T_NIL nil
T_OBJECT ordinaly object
T_CLASS class
T_MODULE module
T_FLOAT floating point number
T_STRING string
T_REGEXP regular expression
T_ARRAY array
T_FIXNUM Fixnum(31bit integer)
T_HASH assosiative array
T_STRUCT (Ruby) structure
T_BIGNUM multi precision integer
T_TRUE true
T_FALSE false
T_DATA data
Otherwise, there are several other types used internally:
T_ICLASS
T_MATCH
T_VARMAP
T_SCOPE
T_NODE
Most of the types are represented by C structures.
1.2 Check Data Type of the VALUE
The macro TYPE() defined in ruby.h shows data-type of the VALUE.
TYPE() returns the constant number T_XXXX described above. To handle
data-types, the code will be like:
switch (TYPE(obj)) {
case T_FIXNUM:
/* process Fixnum */
break;
case T_STRING:
/* process String */
break;
case T_ARRAY:
/* process Array */
break;
default:
/* raise exception */
Fail("not valid value");
break;
}
There is the data-type check function.
void Check_Type(VALUE value, int type)
It raises an exception, if the VALUE does not have the type specified.
There are faster check-macros for fixnums and nil.
FIXNUM_P(obj)
NIL_P(obj)
1.3 Convert VALUE into C data
The data for type T_NIL, T_FALSE, T_TRUE are nil, true, false
respectively. They are singletons for the data type.
The T_FIXNUM data is the 31bit length fixed integer (63bit length on
some machines), which can be conver to the C integer by using
FIX2INT() macro. There also be NUM2INT() which converts any Ruby
numbers into C integer. The NUM2INT() macro includes type check, so
the exception will be raised if conversion failed.
Other data types have corresponding C structures, e.g. struct RArray
for T_ARRAY etc. VALUE of the type which has corresponding structure
can be cast to retrieve the pointer to the struct. The casting macro
RXXXX for each data type like RARRAY(obj). see "ruby.h".
For example, `RSTRING(size)->len' is the way to get the size of the
Ruby String object. The allocated region can be accessed by
`RSTRING(str)->ptr'. For arrays, `RARRAY(ary)->len' and
`RARRAY(ary)->ptr' respectively.
Notice: Do not change the value of the structure directly, unless you
are responsible about the result. It will be the cause of interesting
bugs.
1.4 Convert C data into VALUE
VALUE<EFBFBD>μºݤι<EFBFBD>¤<EFBFBD><EFBFBD>
* FIXNUM<55>ξ<EFBFBD><CEBE><EFBFBD>
1bit<69><74><EFBFBD><EFBFBD><EFBFBD>եȤ<D5A5><C8A4>ơ<EFBFBD>LSB<53><42>Ω<EFBFBD>Ƥ롥
* <20><><EFBFBD><EFBFBD>¾<EFBFBD>Υݥ<CEA5><DDA5>󥿤ξ<F3A5BFA4><CEBE><EFBFBD>
<20><><EFBFBD>Τޤ<CEA4>VALUE<55>˥<EFBFBD><CBA5><EFBFBD>Ȥ<EFBFBD><C8A4>
<EFBFBD>ȤʤäƤ<EFBFBD><EFBFBD>ޤ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>äơ<EFBFBD>LSB<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>å<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>VALUE<EFBFBD><EFBFBD>FIXNUM<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ǥ<EFBFBD>(<28>ݥ<EFBFBD><DDA5>󥿤<EFBFBD>LSB<53><42>Ω<EFBFBD>äƤ<C3A4><C6A4>ʤ<EFBFBD><CAA4><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4><EFBFBD><EFBFB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FBD><EFBFBD>VALUE<55><45>
INT2NUM()<29><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>FIXNUM<55><4D><EFBFBD>ϰϤ˼<CFA4><CBBC>ޤ<EFBFBD><DEA4>ʤ<EFBFBD><CAA4><EFBFBD><EFBFBD>硤Bignum<75><6D><EFBFBD>Ѵ<EFBFBD>
<EFBFBD><EFBFBD><EFBFBD>Ƥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD>(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>٤<EFBFBD>)<29><>
1.5 Manipulate Ruby data
As I already told, it is not recommended to modify object's internal
structure. To manipulate objects, use functions supplied by Ruby
interpreter. Useful functions are listed below (not all):
String funtions
rb_str_new(char *ptr, int len)
Creates a new Ruby string.
rb_str_new2(char *ptr)
Creates a new Ruby string from C string. This is equivalent to
rb_str_new(ptr, strlen(ptr)).
rb_str_cat(VALUE str, char *ptr, int len)
Appends len bytes data from ptr to the Ruby string.
Array functions
rb_ary_new()
Creates an array with no element.
rb_ary_new2(int len)
Creates an array with no element, with allocating internal buffer
for len elements.
rb_ary_new3(int n, ...)
Creates an n-elements array from arguments.
rb_ary_new4(int n, VALUE *elts)
Creates an n-elements array from C array.
rb_ary_push(VALUE ary, VALUE val)
rb_ary_pop(VALUE ary)
rb_ary_shift(VALUE ary)
rb_ary_unshift(VALUE ary, VALUE val)
rb_ary_entry(VALUE ary, int idx)
Array operations. The first argument to each functions must be an
array. They may dump core if other types given.
2. Extend Ruby with C
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ū<EFBFBD><EFBFBD>Ruby<EFBFBD>ǽ񤱤뤳<EFBFBD>Ȥ<EFBFBD>C<EFBFBD>Ǥ<EFBFBD><EFBFBD>񤱤ޤ<EFBFBD><EFBFBD><EFBFBD>Ruby<EFBFBD><EFBFBD><EFBFBD>Τ<EFBFBD><EFBFBD>Τ<EFBFBD>C<EF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FBD><EFBFBD><EFBFBD>Ruby<EFBFBD>Ǥϰʲ<EFBFBD><EFBFBD>ε<EFBFBD>ǽ<EFBFBD><EFBFBD><EFBFBD>ɲä<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ؿ<EFBFBD><EFBFBD><EFBFBD>
<EFBFBD>󶡤<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƥ<EFBFBD><EFBFBD>ޤ<EFBFBD><EFBFBD><EFBFBD>
* Classes, Modules
* Methods, Singleton Methods
* Constants
<EFBFBD>ǤϽ<EFBFBD><EFBFBD>˾Ҳ𤷤ޤ<EFBFBD><EFBFBD><EFBFBD>
2.1.1 Class/module definition
To define class or module, use functions below:
VALUE rb_define_class(char *name, VALUE super)
VALUE rb_define_module(char *name)
These functions return the newly created class ot module. You may
want to save this reference into the variable to use later.
2.1.2 Method/singleton method definition
To define methods or singleton methods, use functions below:
void rb_define_method(VALUE class, char *name,
VALUE (*func)(), int argc)
void rb_define_singleton_method(VALUE object, char *name,
VALUE (*func)(), int argc)
The `argc' represents the number of the arguments to the C function,
which must be less than 17. But I believe you don't need that much. :-)
If `argc' is negative, it specifies calling sequence, not number of
the arguments.
If argc is -1, the function will be called like:
VALUE func(int argc, VALUE *argv, VALUE obj)
where argc is the actual number of arguments, argv is the C array of
the arguments, and obj is the receiver.
if argc is -2, the arguments are passed in Ruby array. The function
will be called like:
VALUE func(VALUE obj, VALUE args)
where obj is the receiver, and args is the Ruby array containing
actual arguments.
There're two more functions to define method. One is to define
private method:
void rb_define_private_method(VALUE class, char *name,
VALUE (*func)(), int argc)
The other is to define module function, which is private AND singleton
method of the module. For example, sqrt is the module function
defined in Math module. It can be call in the form like:
Math.sqrt(4)
or
include Math
sqrt(4)
To define module function
void rb_define_module_function(VALUE module, char *name,
VALUE (*func)(), int argc)
Oh, in addition, function-like method, which is private method defined
in Kernel module, can be defined using:
void rb_define_global_function(char *name, VALUE (*func)(), int argc)
2.1.3 Constant definition
We have 2 functions to define constants:
void rb_define_const(VALUE class, char *name, VALUE val)
void rb_define_global_const(char *name, VALUE val)
The former is to define constant under specified class/module. The
latter is to define global constant.
2.2 Use Ruby features from C
There are several ways to invoke Ruby's features from C code.
2.2.1 Evaluate Ruby Program in String
Easiest way to call Ruby's function from C program is to evaluate the
string as Ruby program. This function will do the job.
VALUE rb_eval_string(char *str)
Evaluation is done under current context, thus current local variables
of the innermost method (which is defined by Ruby) can be accessed.
2.2.2 ID or Symbol
You can invoke methods directly, without parsing the string. First I
need to explain about symbols (which data type is ID). ID is the
integer number to represent Ruby's identifiers such as variable names.
It can be accessed from Ruby in the form like:
:Identifier
You can get the symbol value from string within C code, by using
rb_intern(char *name)
In addition, the symbols for one character operators (e.g +) is the
code for that character.
2.2.3 Invoke Ruby method from C
To invoke methods directly, you can use the function below
VALUE rb_funcall(VALUE recv, ID mid, int argc, ...)
This function invokes the method of the recv, which name is specified
by the symbol mid.
2.2.4 Accessing the variables and constants
C<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ؿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȥäƻ<EFBFBD><EFBFBD>ȡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ǥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Τϡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>󥹥<EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѿ<EFBFBD><EFBFBD>Ǥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѿ<EFBFBD><EFBFBD>ϰ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Τ<EFBFBD><EFBFBD>Τ<EFBFBD>C<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѿ<EFBFBD><EFBFBD>Ȥ<EFBFBD><EFBFBD>ƥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD>Ǥ<EFBFBD><EFBFBD>ޤ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѿ<EFBFBD><EFBFBD>򻲾Ȥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˡ<EFBFBD>ϸ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƥ<EFBFBD><EFBFBD>ޤ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
The functions to access/modify instance variables are below:
VALUE rb_ivar_get(VALUE obj, ID id)
VALUE rb_ivar_set(VALUE obj, ID id, VALUE val)
id must be the symbol, which can be retrieved by rb_intern().
To access the constants of the class/module:
VALUE rb_const_get(VALUE obj, ID id)
See 2.1.3 for defining new constant.
3. Informatin sharing between Ruby and C
C<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ruby<EFBFBD>δ֤Ǿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͭ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˡ<EFBFBD>ˤĤ<EFBFBD><EFBFBD>Ʋ<EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><EFBFBD><EFBFBD>
3.1 Ruby constant that C<><43><EFBFBD><EFBFBD>ȤǤ<C8A4><C7A4><EFBFBD>Ruby<62><79><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
Following Ruby constants can be referred from C.
Qtrue
Qfalse
Boolean values. Qfalse is false in the C also (i.e. 0).
Qnil
Ruby nil in C scope.
3.2 Global variables shared between C and Ruby
C<EFBFBD><EFBFBD>Ruby<EFBFBD><EFBFBD><EFBFBD><E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FBD><EFBFBD><EFBFBD><EFBFBD>ѿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ǥ<EFBFBD><EFBFBD>ޤ<EFBFBD><EFBFBD><EFBFBD>hook<EFBFBD>դ<EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѿ<EFBFBD><EFBFBD>ϰʲ<EFBFBD><EFBFBD>δؿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ѥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><EFBFBD><EFBFBD>hook<EFBFBD>դ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѿ<EFBFBD><EFBFBD><EFBFBD>
<EFBFBD>ͤλ<EFBFBD><EFBFBD>Ȥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>hook<EFBFBD>ǹԤ<EFBFBD>ɬ<EFBFBD>פ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><EFBFBD><EFBFBD>
void rb_define_hooked_variable(char *name, VALUE *var,
VALUE (*getter)(), VALUE (*setter)())
<EFBFBD><EFBFBD><EFBFBD>δؿ<EFBFBD><EFBFBD><EFBFBD>C<EFBFBD>δؿ<EFBFBD><EFBFBD>ˤ<EFBFBD><EFBFBD>ä<EFBFBD>hook<EFBFBD>ΤĤ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>줿<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȥ<EFBFBD><EFBFBD>줿<EFBFBD><EFBFBD><EFBFBD>ˤϴؿ<EFBFBD>getter<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͤ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>åȤ<EFBFBD><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˤϴؿ<EFBFBD>setter<EFBFBD><EFBFBD><EFBFBD>ƤФ<EFBFBD><EFBFBD>롥hook<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʤ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>getter<EFBFBD><EFBFBD>
setter<EFBFBD><EFBFBD>0<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><EFBFBD><EFBFBD>
# getter<65><72>setter<65><72>0<EFBFBD>ʤ<EFBFBD><CAA4><EFBFBD>rb_define_variable()<29><>Ʊ<EFBFBD><C6B1><EFBFBD>ˤʤ롥
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>顤C<EFBFBD>δؿ<EFBFBD><EFBFBD>ˤ<EFBFBD><EFBFBD>äƼ¸<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ruby<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD>ؿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><EFBFBD><EFBFBD>
void rb_define_virtual_variable(char *name,
VALUE (*getter)(), VALUE (*setter)())
<EFBFBD><EFBFBD><EFBFBD>δؿ<EFBFBD><EFBFBD>ˤ<EFBFBD><EFBFBD>ä<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>줿Ruby<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȥ<EFBFBD><EFBFBD>줿<EFBFBD><EFBFBD><EFBFBD>ˤ<EFBFBD>
getter<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͤ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>åȤ<EFBFBD><EFBFBD>줿<EFBFBD><EFBFBD><EFBFBD>ˤ<EFBFBD>setter<EFBFBD><EFBFBD><EFBFBD>ƤФ<EFBFBD><EFBFBD>ޤ<EFBFBD><EFBFBD><EFBFBD>
The prototypes of the getter and setter functions are as following:
(*getter)(ID id, void *data, struct global_entry* entry);
(*setter)(VALUE val, ID id, void *data, struct global_entry* entry);
3.3 Encapsulate C data into Ruby object
C<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>줿<EFBFBD>ǡ<EFBFBD><EFBFBD><EFBFBD>(<28><>¤<EFBFBD><C2A4>)<29><>Ruby<62>Υ<EFBFBD><CEA5>֥<EFBFBD><D6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȤȤ<C8A4><C8A4><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Τ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FBFBD><EFBFBD><EFBFBD>
Data_Make_Struct(class, type, mark, free, sval)
<EFBFBD><EFBFBD><EFBFBD>Υޥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͤ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>줿Data<EFBFBD><EFBFBD><EFBFBD>֥<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȤǤ<EFBFBD><EFBFBD><EFBFBD>
class, mark, free<65><65>Data_Wrap_Struct<63><74>Ʊ<EFBFBD><C6B1>Ư<EFBFBD><C6AF><EFBFBD>򤷤ޤ<F2A4B7A4><DEA4><EFBFBD>type
<EFBFBD>ϳ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƥ<EFBFBD>C<EFBFBD><EFBFBD>¤<EFBFBD>Τη<EFBFBD><EFBFBD>Ǥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƥ<EFBFBD><EFBFBD>줿<EFBFBD><EFBFBD>¤<EFBFBD>Τ<EFBFBD><EFBFBD>ѿ<EFBFBD>sval
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѿ<EFBFBD><EFBFBD>η<EFBFBD><EFBFBD><EFBFBD> (type*) <20>Ǥ<EFBFBD><C7A4><EFBFBD>ɬ<EFBFBD>פ<EFBFBD><D7A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD>
Data<EFBFBD><EFBFBD><EFBFBD>֥<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFB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FBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĥ<EFBFBD><EFBFBD>֥<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϥ<EFBFBD><EFBFBD>Ǥ<EFBFBD><EFBFBD><EFBFBD>
Ruby<EFBFBD><EFBFBD>ext<EFBFBD>ǥ<EFBFBD><EFBFBD><EFBFBD>ȥ<EFBFBD><EFBFBD>ˤ<EFBFBD><EFBFBD>Ǥ˴ޤޤ<EFBFBD><EFBFBD>Ƥ<EFBFBD><EFBFBD><EFBFBD>dbm<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʳ<EFBFBD>Ū<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><EFBFBD><EFBFBD>
(1) make the directory
% mkdir ext/dbm
Make a directory for the extension library under ext directory.
(2) create MANIFEST file
% cd ext/dbm
% touch MANIFEST
There should be MANIFEST file in the directory for the extension
library. Make empty file now.
(3) design the library
You need to design the library features, before making it.
(4) write C code.
<EFBFBD><EFBFBD>ĥ<EFBFBD><EFBFBD>֥<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ΤȤʤ<EFBFBD>C<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Υ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>񤭤ޤ<EFBFBD><EFBFBD><EFBFBD>C<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Υ<EFBFBD><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҤȤĤλ<EFBFBD><EFBFBD>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BD><EFBFBD><EFBFBD>
Ruby<EFBFBD>ϳ<EFBFBD>ĥ<EFBFBD><EFBFBD>֥<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɤ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˡ<EFBFBD>Init_<EFBFBD><EFBFBD><EFBFBD><EFBFBD>̾<EFBFBD>פ<EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ؿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ưŪ<EFBFBD>˼¹Ԥ<EFBFBD><EFBFBD>ޤ<EFBFBD><EFBFBD><EFBFBD>dbm<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ξ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Init_dbm<EFBFBD><EFBFBD>
<EFBFBD>Ǥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>δؿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>åɡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʤɤ<EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ԥ<EFBFBD><EFBFBD>ޤ<EFBFBD><EFBFBD><EFBFBD>dbm.c<><63><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ѥ<EFBFBD><D1A4>ޤ<EFBFBD><DEA4><EFBFBD>
--
Init_dbm()
{
/* define DBM class */
cDBM = rb_define_class("DBM", rb_cObject);
/* DBM includes Enumerate module */
rb_include_module(cDBM, rb_mEnumerable);
/* DBM has class method open(): arguments are received as C array */
rb_define_singleton_method(cDBM, "open", fdbm_s_open, -1);
/* DBM instance method close(): no args */
rb_define_method(cDBM, "close", fdbm_close, 0);
/* DBM instance method []: 1 argument */
rb_define_method(cDBM, "[]", fdbm_fetch, 1);
:
}
--
DBM<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>dbm<EFBFBD>Υǡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֥<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȥˤʤ<EFBFBD><EFBFBD>Ϥ<EFBFBD><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>顤C<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>dbm<EFBFBD><EFBFBD>Ruby<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˼<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɬ<EFBFBD>פ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><EFBFBD><EFBFBD>
dbm.c<>Ǥ<EFBFBD>Data_Make_Struct<63><74><EFBFBD>ʲ<EFBFBD><CAB2>Τ<CEA4>˻ȤäƤ<C3A4><C6A4>ޤ<EFBFBD><DEA4><EFBFBD>
--
struct dbmdata {
int di_size;
DBM *di_dbm;
};
obj = Data_Make_Struct(class,struct dbmdata,0,free_dbm,dbmp);
--
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ǥ<EFBFBD>dbmstruct<EFBFBD><EFBFBD>¤<EFBFBD>ΤؤΥݥ<EFBFBD><EFBFBD>󥿤<EFBFBD>Data<EFBFBD>˥<EFBFBD><EFBFBD>ץ<EFBFBD><EFBFBD><EFBF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FBD><EFBFBD>ΤȤ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><EFBFBD><EFBFBD>dbm<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǡ<EFBFBD>C<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ǽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD>DBM<EFBFBD>Υ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>åɤǤ<EFBFBD><EFBFBD><EFBFBD>open()<29>Ǥ<EFBFBD><C7A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƥ<EFBFBD><C6A4><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD>fdbm_s_open()<29>Ϥ<EFBFBD><CFA4><EFBFBD><EFBFBD>ʤäƤ<C3A4><C6A4>ޤ<EFBFBD><DEA4><EFBFBD>
--
static VALUE
fdbm_s_open(argc, argv, class)
int argc;
VALUE *argv;
VALUE class;
{
:
if (rb_scan_args(argc, argv, "11", &file, &vmode) == 1) {
mode = 0666; /* default value */
}
:
}
--
<EFBFBD><EFBFBD><EFBFBD>Υ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>פδؿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϳ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>줿<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ο<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>2<EFBFBD><EFBFBD><EFBFBD><EFBFB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UE
fdbm_indexes(obj, args)
VALUE obj;
struct RArray *args;
{
:
}
--
<EFBFBD><EFBFBD>1<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>self<EFBFBD><EFBFBD><EFBFBD><EFBFBD>2<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ruby<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ǥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ǥϥ<EFBFBD><EFBFBD><EFBFBD>Ȥ<EFBFBD><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> struct RArray* <20>Ǽ<EFBFBD><C7BC><EFBFBD><EFBFBD>Ƥ<EFBFBD><C6A4>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD>VALUE<55>Ǥ<EFBFBD>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD>Ǥ<EFBFBD><EFBFBD><EFBFBD>
** Notice
GC should know about global variables which refers Ruby's objects, but
not exported to the Ruby world. You need to protect them by
void rb_global_variable(VALUE *var)
(5) prepare extconf.rb
<EFBFBD><EFBFBD>ǥ<EFBFBD><EFBFBD><EFBFBD>ȥ<EFBFBD><EFBFBD>ˡ<EFBFBD>extconf.rb<72>פȤ<D7A4><C8A4><EFBFBD><EFBFBD>ե<EFBFBD><D5A5><EFBFBD><EFBFBD>¸<EBA4AC>ߤ<EFBFBD><DFA4><EFBFBD><EFBFBD>С<EFBFBD>
make<EFBFBD><EFBFBD><EFBFBD>˼¹Ԥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʤ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŭ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Makefile<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><EFBFBD><EFBFBD>
extconf.rb<72>ϥ⥸<CFA5><EFBFBD><E5A1BC><EFBFBD>Υ<EFBFBD><CEA5><EFBFBD><EFBFBD>ѥ<EFBFBD><D1A5><EFBFBD><EFBFBD><EFBFBD>ɬ<EFBFBD>פʾ<D7A4><CABE><EFBFBD><EFBFBD>Υ<EFBFBD><CEA5><EFBFBD><EFBFBD>å<EFBFBD><C3A5>ʤ<EFBFBD>
<EFBFBD><EFBFBD><EFBFBD>Ԥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȥ<EFBFBD><EFBFBD><EFBFBD>Ū<EFBFBD>Ǥ<EFBFBD><EFBFBD><EFBFBD>extconf.rb<72><62><EFBFBD><EFBFBD><EFBFBD>Ǥϰʲ<CFB0><CAB2><EFBFBD>Ruby<62>ؿ<EFBFBD><D8BF><EFBFBD><EFBFBD>Ȥ<EFBFBD>
<EFBFBD><EFBFBD><EFBFBD>Ȥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><EFBFBD><EFBFBD>
have_library(lib, func): <20><EFBFBD>֥<EFBFBD><D6A5><EFBFBD><EFBFBD><EFBFBD>¸<EFBFBD>ߥ<EFBFBD><DFA5><EFBFBD><EFBFBD>å<EFBFBD>
have_func(func): <20>ؿ<EFBFBD><D8BF><EFBFBD>¸<EFBFBD>ߥ<EFBFBD><DFA5><EFBFBD><EFBFBD>å<EFBFBD>
have_header(header): <20>إå<D8A5><C3A5>ե<EFBFBD><D5A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¸<EFBFBD>ߥ<EFBFBD><DFA5><EFBFBD><EFBFBD>å<EFBFBD>
create_makefile(target): Makefile<6C><65><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD>ʲ<EFBFBD><EFBF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FBFBD><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
(6) prepare depend (optional)
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǥ<EFBFBD><EFBFBD><EFBFBD>ȥ<EFBFBD><EFBFBD><EFBFBD>depend<EFBFBD>Ȥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ե<EFBFBD><EFBFBD><EFBFBD><EFBFBD>¸<EFBFBD>ߤ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>С<EFBFBD>
Makefile<EFBFBD><EFBFBD><EFBFBD><EFBFBD>¸<EFBFBD>ط<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>å<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><EFBFBD><EFBFBD>
% gcc -MM *.c > depend
<EFBFBD>ʤɤǺ<EFBFBD><EFBFBD><EFBFBD>Ȥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ä<EFBFBD>»<EFBFBD><EFBFBD>̵<EFBFBD><EFBFBD><EFBFBD>Ǥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
(7) MANIFEST<53>ե<EFBFBD><D5A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˥ե<CBA5><D5A5><EFBFBD><EFBFBD><EFBFBD>̾<EFBFBD><CCBE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
% ls > MANIFEST
% vi MANIFEST
*.o, *~<7E>ʤ<EFBFBD><CAA4><EFBFBD>ɬ<EFBFBD>פʥե<CAA5><D5A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʳ<EFBFBD><CAB3><EFBFBD>MANIFEST<53><54><EFBFBD>ɲä<C9B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BFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>make<EFBFBD><EFBFBD>
ɬ<EFBFBD>פˤ<EFBFBD><EFBFBD>äƤϤ<EFBFBD><EFBFBD>Υ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ruby<EFBFBD>ؤΥ<EFBFBD><EFBFBD>󥯤ޤǼ<EFBFBD>ưŪ<EFBFBD>˼¹<EFBFBD>
<EFBFBD><EFBFBD><EFBFBD>Ƥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><EFBFBD><EFBFBD>extconf.rb<72><62><EFBFBD>񤭴<EFBFBD><F1A4ADB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʤɤ<CAA4><C9A4><EFBFBD>Makefile<6C>κ<EFBFBD><CEBA><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD>ɬ<EFBFBD>פʻ<EFBFBD><EFBFBD>Ϥޤ<EFBFBD>Ruby<EFBFBD>ǥ<EFBFBD><EFBFBD><EFBFBD>ȥ<EFBFBD><EFBFBD><EFBFBD>make<EFBFBD><EFBFBD><EFBFBD>Ƥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
(9) debug
You may need to rb_debug the module. The modules can be linked
statically by adding directory name in the ext/Setup file,
so that you can inspect the module by the debugger.
(10) done, now you have the extension library
<EFBFBD><EFBFBD><EFBFBD>Ϥ<EFBFBD><EFBFBD>ä<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȥ<EFBFBD><EFBFBD>ʤꡤ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʤꡤ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʤꡤ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͳ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BFBD><EFBFBD><EFBFBD>ˤʤ<EFBFBD>
<EFBFBD>Ƥ<EFBFBD><EFBFBD>ޤ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Υ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϻ<EFBFBD><EFBFBD>ޤǤ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǤۤȤ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ǥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD>פ<EFBFBD><EFBFBD>ޤ<EFBFBD><EFBFBD><EFBFBD>
ruby language core
class.c
error.c
eval.c
gc.c
object.c
parse.y
variable.c
utility functions
dln.c
fnmatch.c
glob.c
regex.c
st.c
util.c
ruby interpreter implementation
dmyext.c
inits.c
main.c
ruby.c
version.c
class library
array.c
bignum.c
compar.c
dir.c
enum.c
file.c
hash.c
io.c
math.c
numeric.c
pack.c
process.c
random.c
range.c
re.c
signal.c
sprintf.c
string.c
struct.c
time.c
Appendix B. <20><>ĥ<EFBFBD>Ѵؿ<D1B4><D8BF><EFBFBD><EFBFBD>ե<EFBFBD><D5A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
C<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ruby<EFBFBD>ε<EFBFBD>ǽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ѥ<EFBFBD><EFBFBD><EFBFBD>API<EFBFBD>ϰʲ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>̤<EFBFBD><EFBFBD>Ǥ<EFBFBD><EFBFBD>
** <20><>
VALUE
Ruby<EFBFBD><EFBFBD><EFBFBD>֥<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȥ<EFBFBD>ɽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>뷿<EFBFBD><EFBFBD>ɬ<EFBFBD>פ˱<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƥ<EFBFBD><EFBFBD><EFBFBD>Ȥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ѥ<EFBFBD><EFBFBD>
<EFBFBD>Ȥ߹<EFBFBD><EFBFBD>߷<EFBFBD><EFBFBD><EFBFBD>ɽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>C<EFBFBD>η<EFBFBD><EFBFBD><EFBFBD>ruby.h<>˵<EFBFBD><CBB5>Ҥ<EFBFBD><D2A4>Ƥ<EFBFBD><C6A4><EFBFBD>R<EFBFBD>ǻϤޤ빽¤
<EFBFBD>ΤǤ<EFBFBD><EFBFBD>롥VALUE<EFBFBD><EFBFBD><EFBFBD>򤳤<EFBFBD><EFBFBD><EFBFBD><EFBFBD>˥<EFBFBD><EFBFBD><EFBFBD>Ȥ<EFBFBD><EFBFBD>뤿<EFBFBD><EFBFBD><EFBFBD><EFBFBD>R<EFBFBD>ǻϤޤ빽¤<EFBFBD><EFBFBD>
̾<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʸ<EFBFBD><EFBFBD><EFBFBD>ˤ<EFBFBD><EFBFBD><EFBFBD>̾<EFBFBD><EFBFBD><EFBFBD>Υޥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ѱդ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƥ<EFBFBD><EFBFBD>
** Variables and constants
Qnil
const: nil object
Qtrue
const: Qtrue object(default true value)
Qfalse
const: Qfalse object
** C<>ǡ<EFBFBD><C7A1><EFBFBD><EFBFBD>Υ<EFBFBD><CEA5>ץ<EFBFBD><D7A5>
Data_Wrap_Struct(VALUE class, void (*mark)(), void (*free)(), void *sval)
C<EFBFBD><EFBFB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><EFBFBD>
Data_Make_Struct(class, type, mark, free, sval)
type<EFBFBD><EFBFBD><EFBFBD>Υ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>malloc<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѿ<EFBFBD>sval<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>򥫥ץ<EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֤<EFBFBD><EFBFBD>ޥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
Data_Get_Struct(data, type, sval)
data<EFBFBD><EFBFBD><EFBFBD><EFBFBD>type<EFBFBD><EFBFBD><EFBFBD>Υݥ<EFBFBD><EFBFBD>󥿤<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ф<EFBFBD><EFBFBD>ѿ<EFBFBD>sval<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ޥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
** <20><><EFBFBD>饹/<2F><EFBFBD><EFBFBD><E5A1BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
VALUE rb_define_class(char *name, VALUE super)
super<EFBFBD>Υ<EFBFBD><EFBFBD>֥<EFBFBD><EFBFBD><EFBFBD>Ȥ<EFBFBD><EFBFBD>ƿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ruby<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
VALUE rb_define_class_under(VALUE module, char *name, VALUE super)
super<EFBFBD>Υ<EFBFBD><EFBFBD>֥<EFBFBD><EFBFBD><EFBFBD>Ȥ<EFBFBD><EFBFBD>ƿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ruby<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>module<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD>Ȥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
VALUE rb_define_module(char *name)
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ruby<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
VALUE rb_define_module_under(VALUE module, char *name, VALUE super)
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ruby<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>module<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
void rb_include_module(VALUE class, VALUE module)
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>򥤥󥯥롼<EFBFBD>ɤ<EFBFBD><EFBFBD>롥class<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ǥ<EFBFBD>module<EFBFBD>򥤥󥯥롼
<EFBFBD>ɤ<EFBFBD><EFBFBD>Ƥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˤϲ<EFBFBD><EFBFBD><EFBFBD>ʤ<EFBFBD>(¿<>ť<EFBFBD><C5A5>󥯥롼<F3A5AFA5>ɤζػ<CEB6>)<29><>
void rb_extend_object(VALUE object, VALUE module)
<EFBFBD><EFBFBD><EFBFBD>֥<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƥ<EFBFBD><C6A4><EFBFBD><EFBFBD><EFBFBD>å<EFBFBD>)<29>dz<EFBFBD>ĥ<EFBFBD><C4A5><EFBFBD>
** Defining Global Variables
void rb_define_variable(char *name, VALUE *var)
Defines a global variable which is shared between C and Ruby. If name
contains the character which is not allowed to be part of the symbol,
it can't be seen from Ruby programs.
void rb_define_readonly_variable(char *name, VALUE *var)
Defines a read-only global variable. Works just like
rb_define_variable(), except defined variable is read-only.
void rb_define_virtual_variable(char *name,
VALUE (*getter)(), VALUE (*setter)())
Defines a virtual variable, whose behavior is defined by pair of C
functions. The getter function is called when the variable is
referred. The setter function is called when the value is set to the
variable. The prototype for getter/setter functions are:
VALUE getter(ID id)
void setter(VALUE val, ID id)
The getter function must return the value for the access.
void rb_define_hooked_variable(char *name, VALUE *var,
VALUE (*getter)(), VALUE (*setter)())
Defines hooked variable. It's virtual variable with C variable. The
getter is called as
VALUE getter(ID id, VALUE *var)
returning new value. The setter is called as
void setter(VALUE val, ID id, VALUE *var)
GC requires to mark the C global variables which hold Ruby values.
void rb_global_variable(VALUE *var)
Tells GC to protect these variables.
** Constant Definition
void rb_define_const(VALUE klass, char *name, VALUE val)
Defines a new constant under the class/module.
void rb_define_global_const(char *name, VALUE val)
Defines global contant. This is just work as
rb_define_const(cKernal, name, val)
** Method Definition
rb_define_method(VALUE class, char *name, VALUE (*func)(), int argc)
<EFBFBD><EFBFBD>åɤ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>롥argc<EFBFBD><EFBFBD>self<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ο<EFBFBD><EFBFBD><EFBFBD>argc<EFBFBD><EFBFBD>-1<>λ<EFBFBD>,
<EFBFBD>ؿ<EFBFBD><EFBFBD>ˤϰ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ο<EFBFBD>(self<6C><66><EFBFBD>ޤޤʤ<DEA4>)<29><><EFBFBD><EFBFBD>1<EFBFBD><31><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>2<EFBFBD><32>
<EFBFBD><EFBFBD><EFBFBD>Ȥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϳ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(<28><>3<EFBFBD><33><EFBFBD><EFBFBD><EFBFBD><EFBFBD>self)<29><>argc<67><63>-2<>λ<EFBFBD>, <20><>1<EFBFBD><31>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>self, <20><>2<EFBFBD><32><EFBFBD><EFBFBD><EFBFBD><EFBFBD>args(args<67>ϰ<EFBFBD><CFB0><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD>Ruby<62><79><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)<29>Ȥ<EFBFBD><C8A4><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϳ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
rb_define_private_method(VALUE class, char *name, VALUE (*func)(), int argc)
private<EFBFBD><EFBFBD>åɤ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>rb_define_method()<29><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>
rb_define_singleton_method(VALUE class, char *name, VALUE (*func)(), int argc)
<EFBFBD>ðۥ᥽<EFBFBD>åɤ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>rb_define_method()<29><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>
rb_scan_args(int atgc, VALUE *argv, char *fmt, ...)
argc,argv<67><76><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϳ<EFBFBD><CDBF><EFBFBD><EFBFBD><EFBFBD>줿<EFBFBD><ECA4BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʬ<EFBFBD>򤹤롥fmt<6D><74>ɬ<EFBFBD>ܰ<EFBFBD><DCB0><EFBFBD><EFBFBD>ο<EFBFBD>,
<EFBFBD>ղð<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ο<EFBFBD>, <20>Ĥ<EFBFBD><C4A4>ΰ<EFBFBD><CEB0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EBA4AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EAA4B9>ʸ<EFBFBD><CAB8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD>*"<22>Ȥ<EFBFBD><C8A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ǥ<EFBFBD><C7A4>롥 2 <20><><EFBFB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
<EFBFBD>
** Ruby<62><EFBFBD>åɸƤӽФ<D3BD>
VALUE rb_funcall(VALUE recv, ID mid, int narg, ...)
<EFBFBD><EFBFBD>åɸƤӽФ<EFBFBD><EFBFBD><EFBFBD>ʸ<EFBFBD><EFBFBD><EFBFBD>󤫤<EFBFBD>mid<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>뤿<EFBFBD><EFBFBD><EFBFBD>ˤ<EFBFBD>rb_intern()<29><><EFBFBD>Ȥ<EFBFBD><C8A4><EFBFBD>
VALUE rb_funcall2(VALUE recv, ID mid, int argc, VALUE *argv)
<EFBFBD><EFBFBD>åɸƤӽФ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>argc,argv<67><76><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϥ<EFBFBD><CFA4><EFBFBD>
VALUE rb_eval_string(char *str)
ʸ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ruby<EFBFBD>ȥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ץȤ<EFBFBD><EFBFBD>ƥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѥ<EFBFBD><EFBFBD><EFBFBD>¹Ԥ<EFBFBD><EFBFBD>
ID rb_intern(char *name)
ʸ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ID<EFBFBD><EFBFBD><EFBFBD>֤<EFBFBD><EFBFBD><EFBFBD>
char *rb_id2name(ID id)
ID<EFBFBD><EFBFBD><EFBFBD>б<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʸ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֤<EFBFBD>(<28>ǥХå<D0A5><C3A5><EFBFBD>)<29><>
char *rb_class2name(VALUE class)
class<EFBFBD><EFBFBD>̾<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֤<EFBFBD>(<28>ǥХå<D0A5><C3A5><EFBFBD>)<29><>class<73><73>̾<EFBFBD><CCBE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʤ<EFBFBD><CAA4><EFBFBD><EFBFBD>ˤ<EFBFBD>,
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̤ä<EFBFBD>̾<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>̾<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֤<EFBFBD><EFBFBD><EFBFBD>
** <20><><EFBFBD>󥹥<EFBFBD><F3A5B9A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѿ<EFBFBD>
VALUE rb_iv_get(VALUE obj, char *name)
obj<EFBFBD>Υ<EFBFBD><EFBFBD>󥹥<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͤ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>롥`@'<27>ǻϤޤ<CFA4><DEA4>ʤ<EFBFBD><CAA4><EFBFBD><EFBFBD>󥹥<EFBFBD><F3A5B9A5><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD>ѿ<EFBFBD><EFBFBD><EFBFBD> Ruby<62>ץ<EFBFBD><D7A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E9A5A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ǥ<EFBFBD><C7A4>ʤ<EFBFBD><CAA4>ֱ<EFBFBD><D6B1>줿<EFBFBD>ץ<EFBFBD><D7A5>󥹥<EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѿ<EFBFBD><EFBFBD>ˤʤ롥
VALUE rb_iv_set(VALUE obj, char *name, VALUE val)
obj<EFBFBD>Υ<EFBFBD><EFBFBD>󥹥<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѿ<EFBFBD><EFBFBD><EFBFBD>val<EFBFBD>˥<EFBFBD><EFBFBD>åȤ<EFBFBD><EFBFBD>
** <20><><EFBFBD>湽¤
VALUE rb_iterate(VALUE (*func1)(), void *arg1, VALUE (*func2)(), void *arg2)
func2<EFBFBD><EFBFBD><EFBFBD>֥<EFBFBD><EFBFBD>å<EFBFBD><EFBFBD>Ȥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ꤷ, func1<63>򥤥ƥ졼<C6A5><ECA1BC><EFBFBD>Ȥ<EFBFBD><C8A4>ƸƤ֡<C6A4>
func1<EFBFBD>ˤ<EFBFBD> arg1<67><31><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4><EFBFBD><EFBFBD>Ϥ<EFBFBD><CFA4><EFBFBD>, func2<63>ˤ<EFBFBD><CBA4><EFBFBD>1<EFBFBD><31><EFBFBD><EFBFBD><EFBFBD>˥<EFBFBD><CBA5>ƥ졼
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϳ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>줿<EFBFBD><EFBFBD>, <20><>2<EFBFBD><32><EFBFBD><EFBFBD><EFBFBD><EFBFBD>arg2<67><32><EFBFBD>Ϥ<EFBFBD><CFA4><EFBFBD><EFBFBD>
VALUE rb_yield(VALUE val)
val<EFBFBD><EFBFBD><EFBFBD>ͤȤ<EFBFBD><EFBFBD>ƥ<EFBFBD><EFBFBD>ƥ졼<EFBFBD><EFBFBD><EFBFBD>֥<EFBFBD><EFBFBD>å<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƤӽФ<EFBFBD><EFBFBD><EFBFBD>
VALUE rb_rescue(VALUE (*func1)(), void *arg1, VALUE (*func2)(), void *arg2)
<EFBFBD>ؿ<EFBFBD>func1<EFBFBD><EFBFBD>arg1<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˸ƤӽФ<EFBFBD><EFBFBD><EFBFBD>func1<EFBFBD>μ¹<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȯ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˤ<EFBFBD> func2<63><32>arg2<67><32><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4>ƸƤ֡<C6A4><D6A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͤ<EFBFBD><CDA4><EFBFBD><E3B3B0>ȯ<EFBFBD><C8AF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD>ä<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>func1<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><EFBFBD><E3B3B0>ȯ<EFBFBD><C8AF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˤ<EFBFBD>func2<63><32><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͤ<EFBFBD>
<EFBFBD><EFBFBD><EFBFBD>
VALUE rb_ensure(VALUE (*func1)(), void *arg1, void (*func2)(), void *arg2)
<EFBFBD>ؿ<EFBFBD>func1<EFBFBD><EFBFBD>arg1<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȥ<EFBFBD><EFBFBD>Ƽ¹Ԥ<EFBFBD>, <20>¹Խ<C2B9>λ<EFBFBD><CEBB>(<28><><EFBFBD>Ȥ<EFBFBD><C8A4><EFBFBD><E3B3B0>ȯ
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƥ<EFBFBD>) func2<63><32>arg2<67><32><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4>Ƽ¹Ԥ<C2B9><D4A4><EFBFBD><EBA1A5><EFBFBD><EFBFBD><EFBFBD>ͤ<EFBFBD>func1<63><31><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD>ͤǤ<EFBFBD><EFBFBD><EFBFBD>(<28><EFBFBD><E3B3B0>ȯ<EFBFBD><C8AF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʤ<EFBFBD>)<29><>
** <20><EFBFBD><E3B3B0><EFBFBD><EFBFBD><EFBFBD>
void rb_warning(char *fmt, ...)
rb_verbose<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɸ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϥ˷ٹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>printf()<29><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>
void rb_raise(rb_eRuntimeError, char *fmt, ...)
<EFBFBD><EFBFBD><EFBFBD>ȯ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>printf()<29><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>
void rb_fatal(char *fmt, ...)
<EFBFBD><EFBFBD>̿Ū<EFBFBD><EFBFBD><EFBFBD>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BFBD><EFBFBD>ڹԤʤ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʤ<EFBFBD><EFBFBD><EFBFBD>
** Initialize and Starts the Interpreter
The embedding API are below (not needed for extension libraries):
void ruby_init(int argc, char **argv, char **envp)
Initializes the interpreter.
void ruby_run()
Starts execution of the interpreter.
void ruby_script(char *name)
Specifies the name of the script ($0).
Appendix B. Functions Available in extconf.rb
extconf.rb<72><62><EFBFBD><EFBFBD><EFBFBD>Ǥ<EFBFBD><C7A4><EFBFBD><EFBFBD>Ѳ<EFBFBD>ǽ<EFBFBD>ʥ<EFBFBD><CAA5><EFBFBD><EFBFBD>ѥ<EFBFBD><D1A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>å<EFBFBD><C3A5>δؿ<CEB4><D8BF>ϰ<EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̤<EFBFBD><EFBFBD>Ǥ<EFBFBD><EFBFBD>
have_library(lib, func)
Checks whether library which contains specified function exists.
Returns true if the library exists.
have_func(func)
Checks whether func exists. Returns true if the function exists. To
check functions in the additional library, you need to check that
library first using have_library().
have_header(header)
Checks for the header files. Returns true if the header file exists.
create_makefile(target)
Generates the Makefile for the extension library. If you don't invoke
this method, the compilation will not be done.
/*
* Local variables:
* fill-column: 60
* end:
*/