From: tomo Date: Wed, 8 Oct 2008 16:50:59 +0000 (+0000) Subject: (concord_id_validate): New function. X-Git-Tag: r21-4-21-chise-0_24-6^20~29 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=adce135bf3dd74be0133cca8a272bd41ea5a70d3;p=chise%2Fxemacs-chise.git.1 (concord_id_validate): New function. (structure_type_create_concord): Use `concord_id_validate' instead of `concord_name_validate' to accept integer and character as =id. --- diff --git a/src/concord.c b/src/concord.c index 73b6047..6d8c212 100644 --- a/src/concord.c +++ b/src/concord.c @@ -1001,6 +1001,23 @@ concord_name_validate (Lisp_Object keyword, Lisp_Object value, } static int +concord_id_validate (Lisp_Object keyword, Lisp_Object value, + Error_behavior errb) +{ + if (ERRB_EQ (errb, ERROR_ME)) + { + /* CHECK_SYMBOL (value); */ + if ( INTP (value) || CHARP (value) || SYMBOLP (value) ) + ; + else + dead_wrong_type_argument (Qsymbolp, value); + return 1; + } + + return INTP (value) || CHARP (value) || SYMBOLP (value); +} + +static int concord_object_validate (Lisp_Object data, Error_behavior errb) { struct gcpro gcpro1, gcpro2, gcpro3; @@ -1108,7 +1125,7 @@ structure_type_create_concord (void) concord_object_instantiate); define_structure_type_keyword (st, Qgenre, concord_name_validate); - define_structure_type_keyword (st, Q_id, concord_name_validate); + define_structure_type_keyword (st, Q_id, concord_id_validate); } void