From adce135bf3dd74be0133cca8a272bd41ea5a70d3 Mon Sep 17 00:00:00 2001 From: tomo Date: Wed, 8 Oct 2008 16:50:59 +0000 Subject: [PATCH] (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. --- src/concord.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) 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 -- 1.7.10.4