From: tomo Date: Sun, 24 Oct 2010 17:32:43 +0000 (+0000) Subject: Include if HAVE_LIBCHISE is defined. X-Git-Tag: r21-4-22-chise-0_25-2^20~14 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=99bd17fe9aa39bc09ad0724006f10b9ea214cd7b;p=chise%2Fxemacs-chise.git Include if HAVE_LIBCHISE is defined. (Qcharacter): New variable when HAVE_LIBCHISE is defined. (Qfeature): Ditto. (Fconcord_object_genre): New function. (syms_of_concord): - Add new builtin symbols `character' and `feature' when HAVE_LIBCHISE is defined. - Add Add new builtin function `concord-object-genre'. (complex_vars_of_concord): New function; assign genres `character' and `feature' when HAVE_LIBCHISE is defined. --- diff --git a/src/concord.c b/src/concord.c index 6d8c212..e368006 100644 --- a/src/concord.c +++ b/src/concord.c @@ -1,5 +1,5 @@ /* XEmacs routines to deal with CONCORD. - Copyright (C) 2005,2006,2008 MORIOKA Tomohiko + Copyright (C) 2005,2006,2008,2010 MORIOKA Tomohiko This file is part of XEmacs. @@ -28,6 +28,9 @@ Boston, MA 02111-1307, USA. */ #include "buffer.h" #include #include +#ifdef HAVE_LIBCHISE +# include +#endif EXFUN (Fread_from_string, 3); @@ -40,6 +43,10 @@ EXFUN (Fconcord_object_get, 2); Lisp_Object Qconcord; Lisp_Object Qconcord_object; Lisp_Object Qgenre, Q_id; +#ifdef HAVE_LIBCHISE +Lisp_Object Qcharacter; +Lisp_Object Qfeature; +#endif Lisp_Object Vconcord_ds_hash_table; Lisp_Object Vconcord_genre_hash_table; @@ -519,6 +526,15 @@ Return an id of Concord-object OBJECT. return XCONCORD_OBJECT_ID (object); } +DEFUN ("concord-object-genre", Fconcord_object_genre, 1, 1, 0, /* +Return genre of Concord-object OBJECT. +*/ + (object)) +{ + CHECK_CONCORD_OBJECT (object); + return intern (concord_genre_get_name (XCONCORD_OBJECT_GENRE (object))); +} + DEFUN ("concord-decode-object", Fconcord_decode_object, 2, 4, 0, /* Make and return a Concord-object from FEATURE and VALUE. Optional argument GENRE specifies the GENRE of the object. @@ -1093,6 +1109,10 @@ syms_of_concord (void) defsymbol (&Qconcord_object, "concord-object"); defsymbol (&Qgenre, "genre"); defsymbol (&Q_id, "=id"); +#ifdef HAVE_LIBCHISE + defsymbol (&Qcharacter, "character"); + defsymbol (&Qfeature, "feature"); +#endif DEFSUBR (Fconcord_open_ds); DEFSUBR (Fconcord_ds_p); @@ -1107,6 +1127,7 @@ syms_of_concord (void) DEFSUBR (Fconcord_make_object); DEFSUBR (Fconcord_object_p); DEFSUBR (Fconcord_object_id); + DEFSUBR (Fconcord_object_genre); DEFSUBR (Fconcord_decode_object); DEFSUBR (Fconcord_object_get); DEFSUBR (Fconcord_object_put); @@ -1145,3 +1166,14 @@ vars_of_concord (void) Vconcord_genre_object_hash_table = make_lisp_hash_table (16, HASH_TABLE_NON_WEAK, HASH_TABLE_EQ); } + +void +complex_vars_of_concord (void) +{ +#ifdef HAVE_LIBCHISE + Lisp_Object dir = build_string(chise_system_db_dir); + + Fconcord_assign_genre (Qcharacter, dir); + Fconcord_assign_genre (Qfeature, dir); +#endif +}