From: handa Date: Fri, 12 Oct 2007 05:46:15 +0000 (+0000) Subject: * m17n-core.h (Mcharset): Extern it. X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=74315248a32260ce262400f43812776ad195e2da;p=m17n%2Fm17n-lib.git * m17n-core.h (Mcharset): Extern it. Move detabase related declarations from m17n.h. * m17n-flt.h: Include m17n-core.h instead of m17n.h. (struct _MFLTOtfFeatures): New struct. (struct _MFLTOtfSpec): Delete gsub, gpos, etc, add gsub_gpos. (struct _MFLTFont): Delete otf, add check_otf. (MCHAR_INVALID_CODE): Define it. * m17n.h: Move database related declarations to m17n-core.h (Mharset): Don't extern it. * m17n-flt.c: Include m17n-core.h instead of m17n.h. (Mexist): New variable. (enum FontLayoutCmdRuleSrcType): New enum SRC_EXIST. (FontLayoutCmdRule): New member src.exist. (parse_otf_command): Handle gsub_count and gpos_count separately. (load_otf_command): Adjusted for the change of MFLTOtfSpec. (load_command): Handle the command "exist". (free_flt_command): Adjusted for the change of MFLTOtfSpec. (run_rule): Handle the case SRC_EXIST. (run_otf): Adjusted for the change of MFLTOtfSpec. (run_command): Check the range of FROM. (check_otf_spec): Delete it. (m17n_init_flt): Call m17n_init_core instead of m17n_init. Initialize Mexist. (m17n_fini_flt): Call m17n_fini_core instead of m17n_fiini. (mflt_find): Call font->check_otf instead of check_otf_spec. (mflt_run): Keep the metrics in 26.6 fixed point. * database.c: Include m17n-core.h instead of m17n.h. (load_chartable): Use mtext__from_data. (load_charset): Moved to charset.c (load_database): Call mdatabase__load_charset_func instead of load_charset. (mdatabase__load_charset_func): New variable. (mdatabase__init): Initialize mdatabase__load_charset_func and Mcharset. Don't set mdatabase__finder and mdatabase__loader. (mdatabase__save): Use fwrite, not mconv_encode_stream. (Mcharset): Declare it here. --- diff --git a/src/m17n-core.h b/src/m17n-core.h index 3ee6028..e931bc7 100644 --- a/src/m17n-core.h +++ b/src/m17n-core.h @@ -197,6 +197,7 @@ extern MSymbol Mt; extern MSymbol Mstring; extern MSymbol Msymbol; extern MSymbol Mtext; +extern MSymbol Mcharset; /* Return a symbol of name NAME. */ extern MSymbol msymbol (const char *name); @@ -778,6 +779,51 @@ extern MText *mtext_serialize (MText *mt, int from, int to, extern MText *mtext_deserialize (MText *mt); +/*** @ingroup m17nCore */ +/***en @defgroup m17nDatabase Database */ +/***ja @defgroup m17nDatabase ¥Ç¡¼¥¿¥Ù¡¼¥¹ */ +/*=*/ + +/* Directory of an application specific databases. */ +extern char *mdatabase_dir; +/*=*/ +/*** + @ingroup m17nDatabase */ +/***en + @brief Type of database. + + The type #MDatabase is for a database object. Its internal + structure is concealed from an application program. */ +/***ja + @brief ¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î·¿Àë¸À. + + #MDatabase ·¿¤Ï¥Ç¡¼¥¿¥Ù¡¼¥¹¥ª¥Ö¥¸¥§¥¯¥ÈÍѤι½Â¤ÂΤǤ¢¤ë¡£ + ÆâÉô¹½Â¤¤Ï¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥×¥í¥°¥é¥à¤«¤é¤Ï¸«¤¨¤Ê¤¤¡£ + */ + +typedef struct MDatabase MDatabase; + +/*=*/ + +/* Look for a data. */ +extern MDatabase *mdatabase_find (MSymbol tag1, MSymbol tag2, + MSymbol tag3, MSymbol tag4); + +extern MPlist *mdatabase_list (MSymbol tag0, MSymbol tag1, + MSymbol tag2, MSymbol tag3); + +/* Load a data. */ +void *mdatabase_load (MDatabase *mdb); + +/* Get tags of a data. */ +extern MSymbol *mdatabase_tag (MDatabase *mdb); + +/* Define a data. */ +extern MDatabase *mdatabase_define (MSymbol tag1, MSymbol tag2, + MSymbol tag3, MSymbol tag4, + void *(*loader) (MSymbol *, void *), + void *extra_info); + M17N_END_HEADER #endif /* _M17N_CORE_H_ */