.\" Copyright (C) 2001 Information-technology Promotion Agency (IPA) .\" Copyright (C) 2001-2003 .\" National Institute of Advanced Industrial Science and Technology (AIST) .\" This file si aprt of the m17n library documentation. .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Section, Front-Cover Texts "The m17n library documentation", .\" and no Back-Cover Texts. A copy of the license is included in the .\" appendix entitled "GNU Free Documentation License". .TH "Symbol" 3m17n "14 Jul 2007" "" "Version 1.4.0" "" "The m17n Library" \" -*- nroff -*- .ad l .nh .SH NAME Symbol \- Symbol objects and API for them. .PP .SS "Typedefs" .in +1c .ti -1c .RI "typedef MSymbolStruct * \fBMSymbol\fP" .br .RI "\fIType of symbols. \fP" .in -1c .SS "Functions" .in +1c .ti -1c .RI "\fBMSymbol\fP \fBmsymbol\fP (const char *name)" .br .RI "\fIGet a symbol. \fP" .ti -1c .RI "\fBMSymbol\fP \fBmsymbol_as_managing_key\fP (const char *name)" .br .RI "\fICreate a managing key. \fP" .ti -1c .RI "int \fBmsymbol_is_managing_key\fP (\fBMSymbol\fP symbol)" .br .RI "\fICheck if a symbol is a managing key. \fP" .ti -1c .RI "\fBMSymbol\fP \fBmsymbol_exist\fP (const char *name)" .br .RI "\fISearch for a symbol that has a specified name. \fP" .ti -1c .RI "char * \fBmsymbol_name\fP (\fBMSymbol\fP symbol)" .br .RI "\fIGet symbol name. \fP" .ti -1c .RI "int \fBmsymbol_put\fP (\fBMSymbol\fP symbol, \fBMSymbol\fP key, void *val)" .br .RI "\fISet the value of a symbol property. \fP" .ti -1c .RI "void * \fBmsymbol_get\fP (\fBMSymbol\fP symbol, \fBMSymbol\fP key)" .br .RI "\fIGet the value of a symbol property. \fP" .ti -1c .RI "int \fBmsymbol_put_func\fP (\fBMSymbol\fP symbol, \fBMSymbol\fP key, \fBM17NFunc\fP func)" .br .RI "\fISet the value (function pointer) of a symbol property. \fP" .ti -1c .RI "\fBM17NFunc\fP \fBmsymbol_get_func\fP (\fBMSymbol\fP symbol, \fBMSymbol\fP key)" .br .RI "\fIGet the value (function pointer) of a symbol property. \fP" .in -1c .SS "Variables" .in +1c .ti -1c .RI "\fBMSymbol\fP \fBMnil\fP" .br .RI "\fISymbol whose name is 'nil'. \fP" .ti -1c .RI "\fBMSymbol\fP \fBMt\fP" .br .RI "\fISymbol whose name is 't'. \fP" .ti -1c .RI "\fBMSymbol\fP \fBMstring\fP" .br .RI "\fISymbol whose name is 'string'. \fP" .ti -1c .RI "\fBMSymbol\fP \fBMsymbol\fP" .br .RI "\fISymbol whose name is 'symbol'. \fP" .in -1c .SH "Detailed Description" .PP The m17n library uses objects called \fIsymbols\fP as unambiguous identifiers. Symbols are similar to atoms in the X library, but a symbol can have zero or more \fIsymbol\fP \fIproperties\fP. A symbol property consists of a \fIkey\fP and a \fIvalue\fP, where key is also a symbol and value is anything that can be cast to \fC(void *)\fP. 'The symbol property that belongs to the symbol S and whose key is K' may be shortened to 'K property of S'. .PP Symbols are used mainly in the following three ways. .PP .PD 0 .TP As keys of symbol properties and other properties. .PD 0 .TP To represent various objects, e.g. charsets, coding systems, fontsets. .PD 0 .TP As arguments of the m17n library functions to control their behavior. There is a special kind of symbol, a \fImanaging\fP \fIkey\fP. The value of a property whose key is a managing key must be a \fImanaged\fP \fIobject\fP. See \fBManaged Object\fP for the detail. .SH "Typedef Documentation" .PP .SS "typedef struct MSymbolStruct* \fBMSymbol\fP" .PP The type \fBMSymbol\fP is for a \fIsymbol\fP object. Its internal structure is concealed from application programs. .SH "Variable Documentation" .PP .SS "\fBMSymbol\fP \fBMnil\fP" .PP The symbol \fBMnil\fP has the name \fC'nil'\fP and, in general, represents \fIfalse\fP or \fIno\fP. When coerced to 'int', its value is zero. \fBMnil\fP can't have any symbol property. .SS "\fBMSymbol\fP \fBMt\fP" .PP The symbol \fBMt\fP has the name \fC't'\fP and, in general, represents \fItrue\fP or \fIyes\fP. .SS "\fBMSymbol\fP \fBMstring\fP" .PP The symbol \fBMstring\fP has the name \fC'string'\fP and is used as an argument of the functions \fBmchar_define_property()\fP, etc. .SS "\fBMSymbol\fP \fBMsymbol\fP" .PP The symbol \fBMsymbol\fP has the name \fC'symbol'\fP and is used as an argument of the functions \fBmchar_define_property()\fP, etc.