1
\input texinfo @c -*-texinfo-*-
2
@comment %**start of header
4
@setfilename c-wrapper-refe.info
5
@settitle c-wrapper reference manual
6
@dircategory The Algorithmic Language Scheme
8
* c-wrapper reference: (c-wrapper-refe.info). A generic wrapper for C libraries.
11
@setfilename c-wrapper-refj.info
12
@settitle c-wrapper ��ե���ޥ˥奢��
13
@dircategory The Algorithmic Language Scheme
15
* c-wrapper reference: (c-wrapper-refj.info). A generic wrapper for C libraries.
17
@documentencoding euc-jp
19
@comment %**end of header
21
@c $Id: c-wrapper-ref.texi 13 2005-09-29 15:31:11Z naoki $
23
@c module and class index
34
@title c-wrapper reference manual
35
@subtitle version @VERSION@
36
@author KOGURO, Naoki (naoki@@koguro.net)
38
@title c-wrapper ��ե���ޥ˥奢��
39
@subtitle version @VERSION@
40
@author KOGURO, Naoki (naoki@@koguro.net)
44
@vskip 0pt plus 1filll
45
Copyright @copyright{} 2006 KOGURO, Naoki(naoki@@koguro.net)
49
@node Top, c-wrapper, (dir), (dir)
53
This is a reference manual of c-wrapper.
55
�ܥɥ�����Ȥ�c-wrapper�Υ�ե���ޥ˥奢��Ǥ���
62
* Function and Syntax Index::
67
--- The Detailed Node Listing ---
71
* Load a shared library::
72
* Load a header file::
73
* Classes and function about C types and values::
77
* Load a framework library::
78
* Load an Objectice-C header file::
79
* Functions about Objective-C objects::
84
@node c-wrapper, objc-wrapper, Top, Top
85
@comment node-name, next, previous, up
89
@code{c-wrapper} is the module which enables to use C libraries.
91
@code{c-wrapper}�Ȥϡ�C�Υ饤�֥���Gauche����Ȥ���褦�ˤ��뤿��Υ⥸�塼��Ǥ���
95
* Load a shared library::
96
* Load a header file::
97
* Classes and function about C types and values::
100
@node Load a shared library, Load a header file, c-wrapper, c-wrapper
101
@comment node-name, next, previous, up
102
@section Load a shared library
104
@defun c-load-library file-or-list &keyword
106
Load one or more shared libraries. If you omit the extension, c-wrapper add
107
a extension (.so, .dylib, and so on) automatically.
109
��ͭ�饤�֥����ɤ߹��ߤޤ��� @var{file-or-list} �ǥꥹ�Ȥ��Ϥ���ʣ���Υ饤�֥�꤬�ɤ߹��ޤ�ޤ���
110
�ޤ���ĥ�Ҥ��ά������硢�Ķ��˱�������ĥ�� (.so �� .dylib �ʤ� ) ���ղä���ޤ���
114
Keyword arguments are:
116
������ɰ����ˤϰʲ��Τ�Τ�Ϳ���뤳�Ȥ��Ǥ��ޤ���
119
@item :option option-string
121
Specify library names and library load paths with ld like option.
123
ld��Ϳ���륪�ץ����Τ褦�ʷ����Ƕ�ͭ�饤�֥����ɤ߹��ߥѥ��λ����Ԥ��ޤ��������Ȥ���Τϰʲ��Υ��ץ����Ǥ���
128
Load the library named @var{library}. For example, -lc means to load 'libc'.
130
��ͭ�饤�֥�� @var{library} ���ɤ߹��ߤޤ����㤨�С�-lc �Τ褦�˻��ꤹ��� libc ���ɤ߹��ޤ�ޤ���
134
Add directory @var{dir} to the library search paths.
136
��ͭ�饤�֥��Υ������ꥹ�Ȥ˥ǥ��쥯�ȥ� @var{dir} ���ɲä��ޤ���
142
@defun c-ld option-string
144
This function is the same (c-load-library '() :option option-string). and is designed to use with a command returning linker flags like pkg-config.
146
(c-load-library '() :option option-string) ��Ʊ���Ǥ������δؿ��� pkg-config �ʤɤΤ褦�ʥ�Υե饰���֤����ޥ�ɤ��Ȥ߹�碌�ƻȤ����Ȥ����ꤷ�Ƥ��ޤ���
149
(c-ld (process-output->string "pkg-config Wand --libs"))
153
@node Load a header file, Classes and function about C types and values, Load a shared library, c-wrapper
154
@comment node-name, next, previous, up
155
@section Load a header file
157
@deffn {Macro} c-include file-or-list &keyword
159
Load one or more header files and define functions, global variables, constants
160
, type definitions and macros in the current module.
162
���ꤵ�줿�إå��ե�������ɤ߹��ߡ��ؿ����������Х��ѿ����������������ޥ������ȥ⥸�塼���������ޤ���
165
Keyword arguments are:
167
keyword �����ˤϰʲ��Τ�Τ���ꤹ�뤳�Ȥ��Ǥ��ޤ���
172
Sets up include directories. You can specify either a string file name or a list of string file names.
174
���롼�ɥѥ�����ꤷ�ޤ���ʸ����⤷����ʸ����Υꥹ�Ȥ������ǽ�Ǥ���
178
Sets up C preprocessor options.
180
C�ץ�ץ����å����Ϥ����ץ�������ꤷ�ޤ���ʸ�������ǽ�Ǥ���
184
Sets up symbols which you want to define. You can specify a symbol, a string, a regexp, a procedure or a list of them.
185
If you put a procedure, it is called with two arguments, a header file name and a symbol. When the procedure returns @code{#f}, the symbol is ignored, and the symbol is defined otherwise.
187
�إå��ե����뤫���ɤ߹��ॷ��ܥ����ꤷ�ޤ���
188
�����Ȥ��ơ�����ܥ롢ʸ��������ɽ������³���ȡ������Υꥹ�Ȥ������ǽ�Ǥ���
189
��³�����Ϥ��줿���ϡ�����ܥ뤬���Ĥ��뤿�Ӥ˥إå��ե�����Υѥ�̾�ȥ���ܥ�̾������Ȥ��ơ����μ�³�����ƤӽФ���ޤ���
190
��³����@code{#f}���֤�����礽�Υ���ܥ��̵�뤵�졢����ʳ����ͤξ��˥���ܥ뤬�������ޤ���
194
Specifies whether symbols in header files are exported or not. If you put @code{#t}, the symbols are exported automatically, and otherwise they are not exported.
196
�����������ܥ��@code{export}���뤫�ɤ�������ꤷ�ޤ���
197
@code{#t}�ξ��������������ܥ���Ф���ưŪ��@code{export}���¹Ԥ���ޤ���@code{#f}�ξ��ϲ��⤷�ޤ���
201
Sets up a shared library file name which cwcompile command generates.
202
At runtime, if the library is exists, loads it instead of parsing the header files. Otherwise, parses the header files.
204
cwcompile���ޥ�ɤˤ����������ѡ����Ѥߤζ�ͭ�饤�֥���̾������ꤷ�ޤ���
205
�����ǻ��ꤵ�줿��ͭ�饤�֥�꤬¸�ߤ����硢�إå��ե������ѡ�����������ˤ��ζ�ͭ�饤�֥����ɤ߹��ߤޤ�����ͭ�饤�֥�꤬¸�ߤ��ʤ����ϡ��إå��ե�����Υѡ������Ԥ��ޤ���
210
In loading header files, @code{c-include} gets these information and defines symbols.
212
@item Function prototype
213
Defines a function with the same name. It applies @code{cast} to its arguments and @code{scm-cast} to its return value.
214
@item External variable
215
Defines an object with the same name.
217
Defines a constant value with the same name.
219
Defines a struct class. You can use it with @code{(c-struct tagname)}.
221
Defines a union class. You can use it with @code{(c-union tagname)}.
223
Defines a class with the name @code{<typename>}.
224
@item Objectlike macro
225
Defines a value with the same name if the macro body is an expression, all identifiers in the body have been defined and the expression has no side-effect.
227
You have to be careful to use the value because it is the header-load-time value, not macro-use-time value. It may be different from one you expected.
228
@item Functionlike macro
229
Defines a macro with the same name if the macro body is an expression or statements and all identifiers in the body have been defined.
233
�إå��ե������ɤ߹����ˡ��ʲ��ξ����������ؿ����ѿ��ʤɤ�������Ƥ����ޤ���
235
@item �ؿ��Υץ��ȥ��������
236
�ؿ�̾��Ʊ̾�Υ���ܥ�Ǵؿ����������ޤ����ʤ����δؿ��ϰ������Ф���@code{cast}������ͤ��Ф���@code{scm-cast}��Ŭ�Ѥ��ޤ���
238
�ѿ�̾��Ʊ̾�Υ���ܥ�dz����ѿ��Ȥ��륪�֥������Ȥ��������ޤ���
240
���̾��Ʊ̾�Υ���ܥ��������������ޤ���
242
��¤�ΤΥ��饹��������ޤ������Υ��饹��@code{(c-struct tagname)}�ǻ��Ȥ��뤳�Ȥ��Ǥ��ޤ���
244
�����ΤΥ��饹��������ޤ������Υ��饹��@code{(c-union tagname)}�ǻ��Ȥ��뤳�Ȥ��Ǥ��ޤ���
246
@code{<typename>}�Ȥ�������ܥ��C�η����б����륯�饹��������ޤ���
247
@item ���֥������ȷ��� (objectlike) �Υޥ���
248
�ޥ��������Ƥ����Ǥ��ꡢ���Ѥ���Ƥ��뼱�̻Ҥ����٤�����ѤߤǤ��ꡢ���������Ѥ�ڤܤ����Ǥʤ����ˡ��ޥ���̾��Ʊ̾�Υ���ܥ���ͤ��������ޤ����ʤ���C����ǤΥޥ����Ȥϰ�̣���ۤʤꡢ�����ͤϥإå��ե������ɤ߹������Ǥ��ͤǤ��ꡢ�ޥ������ѻ����Ǥ��ͤǤϤ���ޤ���
249
@item �ؿ����� (functionlike) �Υޥ���
250
�ޥ��������Ƥ����⤷����ʸ�Ǥ�����Ѥ���Ƥ��뼱�̻Ҥ����٤�����Ѥߤξ��ˤΤߡ��ޥ���̾��Ʊ̾�Υ���ܥ�ǥޥ������������ޤ���
256
@deffn {Macro} c-load file-or-list &keyword
258
Loads libraries, parses header files and defines functions, global variables, constants, type definitions and macros in current module.
259
This macro does @code{c-load-library} and @code{c-include} at once.
261
���ꤵ�줿�إå��ե�����ȥ饤�֥����ɤ߹��ߡ��ؿ����������Х��ѿ����������������ޥ������ȥ⥸�塼���������ޤ���
262
@code{c-load-library}��@code{c-include}����٤˹Ԥ���ΤǤ���
266
Keyword arguments are:
268
keyword �����ˤϰʲ��Τ�Τ���ꤹ�뤳�Ȥ��Ǥ��ޤ���
276
Sets up flags for parsing header files and loading libraries, @code{:cppflags} is passed to the preprocessor and @code{:ldflags} and @code{:libs} are used for loading libraries. cwcompile uses these flags, too.
278
�إå��ե�����Υѡ����ȥ饤�֥��Υ����ɤǻȤ�����γƼ�ե饰����ꤷ�ޤ���@code{:cppflags}�ϥץ�ץ����å����Ϥ��졢@code{:ldflags}, @code{:libs}�ϥ饤�֥��Υ����ɤǻ��Ѥ���ޤ��������Υե饰��cwcompile�Ǥ�Ȥ��ޤ���
285
Sets up commands which returns the flags. For example, if you want to parse gtk's header file, you can do the following:
287
�Ƽ�ե饰��������뤿��Υ��ޥ�ɤ���ꤷ�ޤ����㤨�С�gtk�Υإå��ե������ѡ�������Ȥ���pkg-config��Ȥäưʲ��Τ褦�˥��ץ�������ꤹ�뤳�Ȥ��Ǥ��ޤ���
291
:cppflags-cmd "pkg-config gtk+-2.0 --cflags-only-I"
292
:cflags-cmd "pkg-config gtk+-2.0 --cflags-only-other"
293
:libs-cmd "pkg-config gtk+-2.0 --libs"
294
:compiled-lib "gtklib")
299
Sets up symbols which you want to define. You can specify a symbol, a string, a regexp, a procedure or a list of them.
300
If you put a procedure, it is called with two arguments, a header file name and a symbol. When the procedure returns @code{#f}, the symbol is ignored, and the symbol is defined otherwise.
302
�إå��ե����뤫���ɤ߹��ॷ��ܥ����ꤷ�ޤ���
303
�����Ȥ��ơ�����ܥ롢ʸ��������ɽ������³���ȡ������Υꥹ�Ȥ������ǽ�Ǥ���
304
��³�����Ϥ��줿���ϡ�����ܥ뤬���Ĥ��뤿�Ӥ˥إå��ե�����Υѥ�̾�ȥ���ܥ�̾������Ȥ��ơ����μ�³�����ƤӽФ���ޤ���
305
��³����@code{#f}���֤�����礽�Υ���ܥ��̵�뤵�졢����ʳ����ͤξ��˥���ܥ뤬�������ޤ���
309
Specifies whether symbols in header files are exported or not. If you put @code{#t}, the symbols are exported automatically, and otherwise they are not exported.
311
�����������ܥ��@code{export}���뤫�ɤ�������ꤷ�ޤ���
312
@code{#t}�ξ��������������ܥ���Ф���ưŪ��@code{export}���¹Ԥ���ޤ���@code{#f}�ξ��ϲ��⤷�ޤ���
316
Sets up a shared library file name which cwcompile command generates.
317
At runtime, if the library is exists, loads it instead of parsing the header files. Otherwise, parses the header files.
319
cwcompile���ޥ�ɤˤ����������ѡ����Ѥߤζ�ͭ�饤�֥���̾������ꤷ�ޤ���
320
�����ǻ��ꤵ�줿��ͭ�饤�֥�꤬¸�ߤ����硢�إå��ե������ѡ�����������ˤ��ζ�ͭ�饤�֥����ɤ߹��ߤޤ�����ͭ�饤�֥�꤬¸�ߤ��ʤ����ϡ��إå��ե�����Υѡ������Ԥ��ޤ���
327
@node Classes and function about C types and values, , Load a header file, c-wrapper
328
@comment node-name, next, previous, up
329
@section Classes and functions about C types
331
@deftp {Class} <c-type>
333
This is a basic class for the classes related with C types.
335
C�η����б��������饹�δ��쥯�饹�Ǥ���
339
@deftp {Class} <c-type-meta>
341
This is a meta class for the classes related with C types. All the classes are instances of @code{<c-type-meta>}.
343
C�η����б��������饹�Υ���饹�Ǥ���C�η��Υ��饹�Ϥ��٤� @code{<c-type-meta>} �Υ����Ȥʤ�ޤ���
347
@deftp {Class} <c-char>
348
@deftpx {Class} <c-uchar>
349
@deftpx {Class} <c-short>
350
@deftpx {Class} <c-ushort>
351
@deftpx {Class} <c-int>
352
@deftpx {Class} <c-uint>
353
@deftpx {Class} <c-long>
354
@deftpx {Class} <c-ulong>
355
@deftpx {Class} <c-longlong>
356
@deftpx {Class} <c-ulonglong>
357
@deftpx {Class} <c-float>
358
@deftpx {Class} <c-double>
372
These are classes for arithmetic types in C. you can use @code{make} to make an instance of the class.
374
C����λ��ѷ� (Arithmetic types) ���б����륯�饹�Ǥ��� @code{make} ��Ȥäƥ�����������뤳�Ȥ��Ǥ��ޤ���
378
@deftp {Class} <c-value-meta>
379
@clindex c-value-meta
381
This is a meta class for the classes related with C arithmetic types.
383
C����λ��ѷ� (Arithmetic types) ���б����륯�饹�Υ���饹�Ǥ���
387
@deffn {Method} ref (obj <c-value-meta>)
389
Returns the value of @var{obj}.
391
@var{obj} ���ͤ��֤��ޤ���
395
@deffn {Method} (setter ref) (obj <c-value-meta>) value
397
Sets @var{value} to @var{obj}.
399
@var{obj} ���� @var{value} �����ꤷ�ޤ���
403
@deftp {Class} <c-void>
405
This is a class for void type in C.
407
C����� void �����б����륯�饹�Ǥ���
411
@deftp {Class} <c-ptr>
413
This is an abstract class for pointer type in C. If you use a pointer type, make a concrete class with @code{ptr}.
415
C����Υݥ������б�������ݥ��饹�Ǥ����ºݤ˥ݥ�������Ѥ�����ϡ���Ҥ��� @code{ptr} ����Ѥ��� @code{<c-ptr>} �ζ�ݥ��饹���������ɬ�פ�����ޤ���
419
@deffn {Method} ptr (class <c-type-meta>)
421
Makes a class for a pointer type of @var{class}, and it is a subclass of @code{<c-ptr>}. You can use @code{make} to make an instance of the class.
423
@var{class} �ǻ��ꤵ�줿���Υݥ������б����륯�饹���������ޤ������Υ��饹�� @code{<c-ptr>} �Υ��֥��饹�Ȥʤ�ޤ���@code{make} ��Ȥäƺ����������饹�Υ�����������뤳�Ȥ��Ǥ��ޤ���
427
@deffn {Method} ptr (obj <c-type>)
429
Returns a pointer object for @var{obj}.
431
@var{obj} �Υݥ����֥������Ȥ��֤��ޤ���
435
@deftp {Class} <c-array>
437
This is an abstract class for array type in C. If you use an array type, make a concrete class with @code{c-array}.
439
@code{<c-array>} is a subclass of @code{<sequence>}, and you can use the operations of sequence framework (@code{gauche.sequence} module).
441
C�����������б�������ݥ��饹�Ǥ����ºݤ��������Ѥ�����ϡ���Ҥ��� @code{c-array} ����Ѥ��ơ�@code{<c-array>} �ζ�ݥ��饹���������ɬ�פ�����ޤ���
443
�ޤ� @code{<c-array>} �� @code{<sequence>} ��Ѿ����Ƥ��ꡢ�������ե졼���� (@code{gauche.sequence} �⥸�塼��) ���������Ƥ���������Ѥ��뤳�Ȥ��Ǥ��ޤ���
447
@defun c-array (class <c-type-meta>) size
449
Makes a class for an array type of @var{class}, and it is a subclass of @code{<c-array>}. You can use @code{make} to make an instance of the class.
451
@var{class} �����礭�� @var{size} �����饹���������ޤ������Υ��饹�� @code{<c-array>} �Υ��֥��饹�Ȥʤ�ޤ���@code{make} ��Ȥäƺ����������饹�Υ�����������뤳�Ȥ��Ǥ��ޤ���
455
@deftp {Class} <c-struct>
457
This is an abstract class for struct type in C.
459
C����ι�¤�Τ��б�������ݥ��饹�Ǥ���
463
@deftp {Class} <c-union>
465
This is an abstract class for union type in C.
467
C����ζ����Τ��б�������ݥ��饹�Ǥ���
471
@deffn {Macro} c-struct tagname
473
Returns the struct class named @var{tagname}.
475
@var{tagname}�Ȥ���̾���ι�¤�Υ��饹���֤��ޤ���
479
@deffn {Macro} c-union tagname
481
Returns the union class named @var{tagname}.
483
@var{tagname}�Ȥ���̾���ζ����Υ��饹���֤��ޤ���
487
@deffn {Method} ref (obj <c-struct>) member
488
@deffnx {Method} ref (obj <c-union>) member
490
Returns the value of the @var{member} of the struct or union @var{obj}. If the type of the member is arithmetic type, the type of the return value is casted to @code{<real>} or @code{<integer>}.
492
��¤�Τ⤷���϶����ΤΥ��� @var{member} ���ͤ��֤��ޤ������Ф����ѷ� (Arithmetic types) �ξ��� @code{<real>} �⤷���� @code{<integer>} ���Ѵ����줿�ͤ��֤�ޤ���
496
@deffn {Method} (setter ref) (obj <c-struct>) member value
497
@deffnx {Method} (setter ref) (obj <c-union>) member value
499
Sets @var{value} to the @var{member} of the struct or union @var{obj}.
501
��¤�Τ⤷���϶����ΤΥ��� @var{member} ���ͤåȤ��ޤ���
505
@deftp {Class} <c-func-ptr>
507
This is an abstract class for function pointer in C.
509
C����δؿ��ݥ����б�������ݥ��饹�Ǥ���
513
@deffn {Method} deref ptrobj
515
Returns a deference object of @var{ptrobj}. ('*' operator in C)
517
�ݥ����֥������� @var{ptrobj} �λ��Ȥ��֤��ޤ���
521
@deffn {Method} c-sizeof (class <c-type-meta>)
522
@deffnx {Method} c-sizeof (obj <c-type>)
524
Returns a size of @var{class} or @var{obj}.
526
@var{class}�⤷����@var{obj}�Υ��������֤��ޤ���
530
@deffn {Method} cast class obj
532
Makes an instance of @var{class} from @var{obj}. The following rules are applied to make an instance.
534
@multitable @columnfractions 0.2 0.2 0.6
535
@item @var{class} @tab Type of @var{obj} @tab Description
537
@item Subclasses of @code{<c-value>}
539
@tab Makes an instance of @var{class} which is the same value of @var{obj}.
541
@item Subclasses of @code{<c-value>}
542
@tab @code{<boolean>}
543
@tab Makes an instance of @var{class} which is 1 (if @var{obj} is @code{#t}) or 0 (if @var{obj} is @code{#f}).
545
@item @code{<c-ptr>} or @code{<c-func-ptr>}
546
@tab @code{<integer>}
547
@tab Makes a pointer object whose address is @var{obj}.
549
@item @code{<c-ptr>} or @code{<c-func-ptr>}
550
@tab @code{<c-ptr>} or @code{<c-func-ptr>}
551
@tab Makes a pointer object whose address is the same of @var{obj}.
553
@item @code{<c-ptr>} or @code{<c-func-ptr>}
554
@tab @code{<c-array>}
555
@tab Makes a pointer object whose address is the same of the first address of @var{obj}.
559
@tab Makes a pointer object whose address points an internally-generated C string.
562
@tab @code{<uvector>}
563
@tab Makes a pointer object whose address points the buffer of @code{<uvector>}.
566
@tab @code{<sequence>}
567
@tab Makes a pointer object whost address points an internally-generated array which contains the same elements of @var{obj}.
569
@item @code{<c-array>}
570
@tab @code{<sequence>}
571
@tab Makes an array which contains the same elements of @var{obj}.
573
@item @code{<c-array>}
575
@tab Makes an array object whose first address is @var{obj}.
577
@item @code{<c-func-ptr>}
578
@tab @code{<procedure>}
579
@tab Makes a pointer of a function which executes calls the procedure @var{obj}.
581
@item @code{<integer>} or @code{<real>}
582
@tab @code{<c-value>}
583
@tab Makes the value of @var{obj}.
585
@item @code{<boolean>}
586
@tab @code{<c-value>} or @code{<real>}
587
@tab Makes #f if the value of @var{obj} is 0, #t otherwise.
589
@item @code{<integer>}
590
@tab @code{<c-ptr>} or @code{<c-func-ptr>}
591
@tab Makes the pointer address of @var{obj}.
593
@item @code{<integer>}
594
@tab @code{<c-array>}
595
@tab Makes the first address of the array @var{obj}.
597
@item @code{<string>}
598
@tab @code{<c-ptr>} or @code{<c-func-ptr>}
599
@tab Makes a string from the address of @var{obj}.
601
@item @code{<string>}
602
@tab @code{<c-array>}
603
@tab Makes a string from the array @var{obj}. It must be 0 terminated string.
605
@item @code{<collection>}
606
@tab @code{<c-array>}
607
@tab Makes an instance of @var{class} which contains the same values of @var{obj}, which are casted with @code{scm-cast}.
611
@var{obj} ���� @var{class} ���Υ������������ޤ��������Υ롼��ϰʲ����̤�Ǥ���
613
@multitable @columnfractions 0.2 0.2 0.6
614
@item @var{class} @tab @var{obj}�η� @tab ����
616
@item @code{<c-value>} ��Ѿ��������饹
618
@tab @var{obj} ��Ʊ���ͤ���� @var{class} �Υ������������ޤ�
620
@item @code{<c-value>} ��Ѿ��������饹
621
@tab @code{<boolean>}
622
@tab @var{obj} �� @code{#t} �λ��� 1��@code{#f} �λ��� 0 ���ͤ���� @var{class} �Υ������������ޤ���
624
@item @code{<c-ptr>} �ޤ��� @code{<c-func-ptr>}
625
@tab @code{<integer>}
626
@tab @var{obj} �Υ��ɥ쥹����ĥݥ����������ޤ�
628
@item @code{<c-ptr>} �ޤ��� @code{<c-func-ptr>}
629
@tab @code{<c-ptr>} �ޤ��� @code{<c-func-ptr>}
630
@tab @var{obj} ��Ʊ�����ɥ쥹����ĥݥ����������ޤ�
632
@item @code{<c-ptr>} �ޤ��� @code{<c-func-ptr>}
633
@tab @code{<c-array>}
634
@tab @var{obj} ����Ƭ���ɥ쥹����ĥݥ����������ޤ���
638
@tab C��ʸ�������������������Ƭ���ɥ쥹����ĥݥ����������ޤ���
641
@tab @code{<uvector>}
642
@tab @var{obj} ����Ƭ���ɥ쥹����ĥݥ����������ޤ���
645
@tab @code{<sequence>}
646
@tab @var{obj} ��Ʊ�����Ƥ��������������������Ƭ���ɥ쥹����ĥݥ����������ޤ���
648
@item @code{<c-array>}
649
@tab @code{<sequence>}
650
@tab @var{obj} ��Ʊ�����Ƥ�������������ޤ���
652
@item @code{<c-array>}
654
@tab �ݥ����ؤ������ΰ������ȸ��ʤ��� @var{class} �Υ������������ޤ���
656
@item @code{<c-func-ptr>}
657
@tab @code{<procedure>}
658
@tab @var{obj} ��¹Ԥ���ؿ��Υݥ����������ޤ���
660
@item @code{<integer>} �ޤ��� @code{<real>}
661
@tab @code{<c-value>}
662
@tab @var{obj} ��Ʊ���ͤο��ͤ��֤��ޤ���
664
@item @code{<boolean>}
665
@tab @code{<c-value>} �ޤ��� @code{<real>}
666
@tab �ͤ� 0 �ΤȤ� @code{#f} ���������Ǥʤ���� @var{#t} ���֤�ޤ���
668
@item @code{<integer>}
669
@tab @code{<c-ptr>} �ޤ��� @code{<c-func-ptr>}
670
@tab �ݥ��Υ��ɥ쥹���֤�ޤ���
672
@item @code{<integer>}
673
@tab @code{<c-array>}
674
@tab �������Ƭ���ɥ쥹���֤�ޤ���
676
@item @code{<string>}
677
@tab @code{<c-ptr>} �ޤ��� @code{<c-func-ptr>}
678
@tab �ݥ����ؤ������ΰ褬0��ü���줿ʸ����ȸ��ʤ���ʸ������������ޤ���
680
@item @code{<string>}
681
@tab @code{<c-array>}
682
@tab ��������Ƥ�0��ü���줿ʸ����ȸ��ʤ���ʸ������������ޤ���
684
@item @code{<collection>}
685
@tab @code{<c-array>}
686
@tab ��������Ƥ���� @var{class} �Υ������������ޤ��������Ǥ��ͤ� @code{scm-cast} �ǥ��㥹�Ȥ���ޤ���
694
Returns the value of @var{obj} if @var{obj} is an instance of @code{<c-value>}. Otherwise, returns @var{obj}.
696
@var{obj} �� @code{<c-value>} ���Ǥ�����Ͽ��ͤ��֤��ޤ��������Ǥʤ���� @var{obj} �Τޤ��֤��ޤ���
702
Returns NULL pointer.
710
Returns @code{#t} if @var{obj} is a NULL pointer, @code{#f} otherwise.
712
@var{obj} ��NULL�ݥ��Ǥ���� @code{#t} ���������Ǥʤ���� @code{#f} ���֤���ޤ���
716
@defun register-finalizer! ptrobj proc
718
Register the finalizer @var{proc} to @var{ptrobj}. It is called when @var{ptrobj} is GCed.
720
@var{ptrobj} �˥ե����ʥ饤�� @var{proc} ����Ͽ���ޤ���@var{ptrobj} ��GC�����Ȥ��� @var{proc} ���ƤФ�ޤ���
724
@defun unregister-finalizer! ptrobj
726
Deletes the finalizer of @var{ptrobj}.
728
@var{ptrobj} �Υե����ʥ饤���������ޤ���
732
@defun finalize! ptrobj
734
Calls the finalizer of @var{ptrobj}, and deletes it from @var{ptrobj}.
736
@var{ptrobj} �Υե����ʥ饤����¹Ԥ��ޤ�������ˤ�� @var{ptrobj} �Υե����ʥ饤���Ϻ������ޤ���
740
@node objc-wrapper, Function and Syntax Index, c-wrapper, Top
741
@comment node-name, next, previous, up
742
@chapter objc-wrapper
745
@code{objc-wrapper} is the module which enables to use Objective-C libraries.
747
@code{objc-wrapper} �Ȥ� Objective-C �Υ饤�֥��� Gauche ����Ȥ���褦�ˤ��뤿��Υ⥸�塼��Ǥ���
751
* Load a framework library::
752
* Load an Objectice-C header file::
753
* Functions about Objective-C objects::
756
@node Load a framework library, Load an Objectice-C header file, objc-wrapper, objc-wrapper
757
@comment node-name, next, previous, up
758
@section Load a framework library
760
@defun c-load-framework framework
762
Load a framework library @var{framework}.
765
(c-load-framework "Foundation")
769
�ե졼�����饤�֥�� @var{framework} ���ɤ߹��ߤޤ���
772
(c-load-framework "Foundation")
778
@node Load an Objectice-C header file, Functions about Objective-C objects, Load a framework library, objc-wrapper
779
@comment node-name, next, previous, up
780
@section Load an Objective-C header file
782
@defun {Macro} c-include file-or-list &keyword
784
This extends the @code{c-include} in @code{c-wrapper} module. it defines classes and methods of Objective-C code.
786
If Objective-C class @code{Foo} is defined in the header file, @code{c-include} defines two symbols @code{Foo} and @code{<Foo>}. @code{Foo} is an instance of @code{<c-struct:objc_object>} and indicates the Objective-C class @code{Foo}. @code{<Foo>} is an alias of the type @code{<id>}.
788
@code{objc-wrapper} �⥸�塼��� @code{c-include} �Ǥ� Objective-C �Υ��饹������å�����γ�ĥ���Ԥ��Ƥ��ޤ���
790
Objective-C �Υ��饹 @code{Foo} ���إå��ե�������������Ƥ�����硢 @code{Foo} �� @code{<Foo>} ��2�ĤΥ���ܥ뤬�������ޤ���@code{Foo} �� @code{<c-struct:objc_objcect>} ���Υ��֥������Ȥǥ��饹 @code{Foo} ���Τ�Τ�ؤ��Ƥ��ޤ���@code{<Foo>} �� @code{<id>} �Υ����ꥢ���Ȥʤ�ޤ���
794
@node Functions about Objective-C objects, , Load an Objectice-C header file, objc-wrapper
795
@comment node-name, next, previous, up
796
@section Functions about Objective-C objects
798
@deffn {Macro} define-objc-class class-name super-class-name
800
Defines Objective-C class @var{class-name} whose super class is @var{super-class-name}.
802
@var{super-class-name}��Ѿ�����Objective-C�Υ��饹@var{class-name}��������ޤ���
806
@deffn {Macro} define-objc-method objc-class ret-type (message-keyword varspec ...) body ...
808
Defines an Objective-C method whose message keyword is @var{message-keyword} and return type is @var{ret-type}. @var{varspec} is a list, (variable-name variable-type).
810
In the body, you can use two variables @var{self} and @var{super}. @var{self} is the receiver object and @var{super} is the object which is casted to its super class.
812
��å�����������ɤ�@var{message-keyword}�Ǥ�������ͤη���@var{ret-type}�Ǥ���褦��@var{objc-class}�Υ�åɤ�������ޤ���@var{varspec}��(�ѿ�̾ �ѿ���)�Υꥹ�Ȥ���ꤷ�ޤ���
814
@var{body}�Ǥ�@var{self}��@var{super}��2�Ĥ��ѿ����Ȥ��ޤ������줾�졢�쥷���Х��֥������ȡ��쥷���Ф��ѥ��饹�˥��㥹�Ȥ������֥������Ȥ�ؤ��Ƥ��ޤ���
818
(define-objc-method MyFooClass <id> [:doSomething (v <c-int>)]
819
[super :doSomething v]
821
(bar v) ;; The result of (bar v) is the return value of this method.
826
@deffn {Method} object-apply (obj <c-struct:objc_object>) selector-or-args ...
828
Calls the method of @var{obj}.
831
[[NSString :alloc) :init]
833
[[NSString :startWithCString (@ "Hello, world") :encoding NSASCIIStringEncoding]]
837
@var{obj} �Υ�åɤ�ƤӽФ��ޤ���
840
[[NSString :alloc] :init]
842
[[NSString :startWithCString (@ "Hello, world") :encoding NSASCIIStringEncoding]]
849
Returns Objective-C string.
851
Objective-Cʸ������֤��ޤ���
855
@defun @@selector method-name
857
Returns a selector of @var{method-name}.
859
��å�̾ @var{method-name} �Υ��쥯�����֤��ޤ���
863
@node Function and Syntax Index, Class Index, objc-wrapper, Top
864
@comment node-name, next, previous, up
865
@appendix Function and Syntax Index
868
@node Class Index, Variable Index, Function and Syntax Index, Top
869
@comment node-name, next, previous, up
870
@appendix Class Index
871
For readability, the surrounding @code{<} and @code{>} are stripped off.
874
@node Variable Index, , Class Index, Top
875
@comment node-name, next, previous, up
876
@appendix Variable Index
883
@c outline-regexp: "@chap\\|@unnu\\|@\\(sub\\)*section"