[uim-commit] r2055 - branches/r5rs/sigscheme
yamaken at freedesktop.org
yamaken at freedesktop.org
Mon Nov 7 04:52:03 PST 2005
Author: yamaken
Date: 2005-11-07 04:51:59 -0800 (Mon, 07 Nov 2005)
New Revision: 2055
Modified:
branches/r5rs/sigscheme/operations.c
Log:
* Oops
* sigscheme/operations.c
- Include lacking ctype.h for character operations
- (ScmOp_integer2char): New function
Modified: branches/r5rs/sigscheme/operations.c
===================================================================
--- branches/r5rs/sigscheme/operations.c 2005-11-07 12:49:36 UTC (rev 2054)
+++ branches/r5rs/sigscheme/operations.c 2005-11-07 12:51:59 UTC (rev 2055)
@@ -37,6 +37,7 @@
#include <string.h>
#include <stdlib.h>
#include <limits.h>
+#include <ctype.h>
/*=======================================
Local Include
@@ -1068,6 +1069,26 @@
return SCM_FALSE;
}
+ScmObj ScmOp_integer2char(ScmObj obj)
+{
+ int val;
+ char *buf;
+ DECLARE_FUNCTION("integer->char", ProcedureFixed1);
+
+ ASSERT_INTP(obj);
+
+ /* FIXME: only supports ASCII */
+ val = SCM_INT_VALUE(obj);
+ if (isascii(val)) {
+ buf = malloc(sizeof(char) + sizeof((char)'\0'));
+ buf[0] = val;
+ buf[1] = '\0';
+ return Scm_NewChar(buf);
+ } else {
+ ERR_OBJ("current implementation only supports ASCII", obj);
+ }
+}
+
ScmObj ScmOp_char_upcase(ScmObj obj)
{
DECLARE_FUNCTION("char-upcase", ProcedureFixed1);
More information about the uim-commit
mailing list