[uim-commit] r2242 - branches/r5rs/sigscheme
kzk at freedesktop.org
kzk at freedesktop.org
Wed Nov 23 00:58:35 PST 2005
Author: kzk
Date: 2005-11-23 00:58:11 -0800 (Wed, 23 Nov 2005)
New Revision: 2242
Modified:
branches/r5rs/sigscheme/operations.c
branches/r5rs/sigscheme/sigscheme.h
Log:
* remove STL name "string", and rename it to "str"
* sigscheme/operations.c
- (ScmOp_string_append)
: rename strings to strlst. initialize with SCM_FALSE
- (ScmOp_string2list): rename string to str
- (ScmOp_string_copy): rename string to str
- (ScmOp_string_filld): rename string to str
* sigscheme/sigscheme.h
- (ScmOp_string2list): rename string to str
- (ScmOp_string_copy): rename string to str
- (ScmOp_string_filld): rename string to str
Modified: branches/r5rs/sigscheme/operations.c
===================================================================
--- branches/r5rs/sigscheme/operations.c 2005-11-23 08:44:36 UTC (rev 2241)
+++ branches/r5rs/sigscheme/operations.c 2005-11-23 08:58:11 UTC (rev 2242)
@@ -1337,8 +1337,8 @@
/* FIXME: transition to new arg extraction mechanism incomplete. */
int total_size = 0;
int total_len = 0;
- ScmObj strings = SCM_NULL;
- ScmObj obj = SCM_NULL;
+ ScmObj strlst = SCM_FALSE;
+ ScmObj obj = SCM_FALSE;
char *new_str = NULL;
char *p = NULL;
DECLARE_FUNCTION("string-append", ProcedureVariadic0);
@@ -1347,8 +1347,8 @@
return Scm_NewMutableStringCopying("");
/* count total size of the new string */
- for (strings = args; !NULLP(strings); strings = CDR(strings)) {
- obj = CAR(strings);
+ for (strlst = args; !NULLP(strlst); strlst = CDR(strlst)) {
+ obj = CAR(strlst);
ASSERT_STRINGP(obj);
total_size += strlen(SCM_STRING_STR(obj));
@@ -1360,8 +1360,8 @@
/* copy string by string */
p = new_str;
- for (strings = args; !NULLP(strings); strings = CDR(strings)) {
- obj = CAR(strings);
+ for (strlst = args; !NULLP(strlst); strlst = CDR(strlst)) {
+ obj = CAR(strlst);
strcpy(p, SCM_STRING_STR(obj));
p += strlen(SCM_STRING_STR(obj));
@@ -1370,7 +1370,7 @@
return Scm_NewMutableString(new_str);
}
-ScmObj ScmOp_string2list(ScmObj string)
+ScmObj ScmOp_string2list(ScmObj str)
{
ScmObj head = SCM_NULL;
ScmObj tail = SCM_NULL;
@@ -1380,11 +1380,11 @@
char *buf;
DECLARE_FUNCTION("string->list", ProcedureFixed1);
- ASSERT_STRINGP(string);
+ ASSERT_STRINGP(str);
SCM_MBS_INIT(mbs);
- SCM_MBS_SET_STR(mbs, SCM_STRING_STR(string));
- SCM_MBS_SET_SIZE(mbs, strlen(SCM_STRING_STR(string)));
+ SCM_MBS_SET_STR(mbs, SCM_STRING_STR(str));
+ SCM_MBS_SET_SIZE(mbs, strlen(SCM_STRING_STR(str)));
while (SCM_MBS_GET_SIZE(mbs)) {
ch = Scm_mb_scan_char(mbs);
@@ -1448,14 +1448,14 @@
return Scm_NewMutableString(new_str);
}
-ScmObj ScmOp_string_copy(ScmObj string)
+ScmObj ScmOp_string_copy(ScmObj str)
{
DECLARE_FUNCTION("string-copy", ProcedureFixed1);
- ASSERT_STRINGP(string);
- return Scm_NewMutableStringCopying(SCM_STRING_STR(string));
+ ASSERT_STRINGP(str);
+ return Scm_NewMutableStringCopying(SCM_STRING_STR(str));
}
-ScmObj ScmOp_string_filld(ScmObj string, ScmObj ch)
+ScmObj ScmOp_string_filld(ScmObj str, ScmObj ch)
{
int char_size = 0;
int str_len = 0;
@@ -1464,14 +1464,14 @@
int i = 0;
DECLARE_FUNCTION("string-fill!", ProcedureFixed2);
- ASSERT_STRINGP(string);
- ASSERT_MUTABLEP(string);
+ ASSERT_STRINGP(str);
+ ASSERT_MUTABLEP(str);
ASSERT_CHARP(ch);
/* create new str */
char_size = strlen(SCM_CHAR_VALUE(ch));
- str_len = SCM_STRING_LEN(string);
- new_str = (char*)realloc(SCM_STRING_STR(string),
+ str_len = SCM_STRING_LEN(str);
+ new_str = (char*)realloc(SCM_STRING_STR(str),
sizeof(char) * str_len * char_size + 1);
for (i = 0, p = new_str; i < char_size * str_len;) {
strcpy(p, SCM_CHAR_VALUE(ch));
@@ -1480,9 +1480,9 @@
i += char_size;
}
- SCM_STRING_SET_STR(string, new_str);
+ SCM_STRING_SET_STR(str, new_str);
- return string;
+ return str;
}
/*==============================================================================
Modified: branches/r5rs/sigscheme/sigscheme.h
===================================================================
--- branches/r5rs/sigscheme/sigscheme.h 2005-11-23 08:44:36 UTC (rev 2241)
+++ branches/r5rs/sigscheme/sigscheme.h 2005-11-23 08:58:11 UTC (rev 2242)
@@ -531,10 +531,10 @@
/* TODO : many comparing functions around string is unimplemented */
ScmObj ScmOp_substring(ScmObj str, ScmObj start, ScmObj end);
ScmObj ScmOp_string_append(ScmObj args);
-ScmObj ScmOp_string2list(ScmObj string);
+ScmObj ScmOp_string2list(ScmObj str);
ScmObj ScmOp_list2string(ScmObj lst);
-ScmObj ScmOp_string_copy(ScmObj string);
-ScmObj ScmOp_string_filld(ScmObj string, ScmObj ch);
+ScmObj ScmOp_string_copy(ScmObj str);
+ScmObj ScmOp_string_filld(ScmObj str, ScmObj ch);
ScmObj ScmOp_vectorp(ScmObj obj);
ScmObj ScmOp_make_vector(ScmObj vector_len, ScmObj args);
ScmObj ScmOp_vector(ScmObj args);
More information about the uim-commit
mailing list