[uim-commit] r1908 - branches/r5rs/sigscheme
yamaken at freedesktop.org
yamaken at freedesktop.org
Mon Oct 31 07:54:10 PST 2005
Author: yamaken
Date: 2005-10-31 07:54:03 -0800 (Mon, 31 Oct 2005)
New Revision: 1908
Modified:
branches/r5rs/sigscheme/strport.c
branches/r5rs/sigscheme/strport.h
Log:
* sigscheme/strport.h
- (ScmInputStrPort_new): Change args
- (ScmInputStrPort_new_const): New function decl
* sigscheme/strport.c
- (istrport_new): New function renamed from former ScmInputStrPort_new()
- (ScmInputStrPort_new, ScmInputStrPort_new_copying): Reform as
wrapper to istrport_new()
- (ScmInputStrPort_new_const): New function
Modified: branches/r5rs/sigscheme/strport.c
===================================================================
--- branches/r5rs/sigscheme/strport.c 2005-10-31 13:57:55 UTC (rev 1907)
+++ branches/r5rs/sigscheme/strport.c 2005-10-31 15:54:03 UTC (rev 1908)
@@ -86,6 +86,8 @@
/*=======================================
File Local Function Declarations
=======================================*/
+static ScmBytePort *istrport_new(char *str, int ownership);
+
static ScmBytePort *istrport_dyn_cast(ScmBytePort *bport,
const ScmBytePortVTbl *dest_vptr);
static int istrport_close(ScmInputStrPort *port);
@@ -157,8 +159,8 @@
return;
}
-ScmBytePort *
-ScmInputStrPort_new(char *str, int ownership)
+static ScmBytePort *
+istrport_new(char *str, int ownership)
{
ScmInputStrPort *port;
@@ -175,11 +177,24 @@
}
ScmBytePort *
+ScmInputStrPort_new(char *str)
+{
+ return istrport_new(str, TRUE);
+}
+
+ScmBytePort *
ScmInputStrPort_new_copying(char *str)
{
- return ScmInputStrPort_new(strdup(str), TRUE);
+ return istrport_new(strdup(str), TRUE);
}
+ScmBytePort *
+ScmInputStrPort_new_const(const char *str)
+{
+ /* str is actually treated as const */
+ return istrport_new((char *)str, FALSE);
+}
+
void **
ScmInputStrPort_ref_opaque(ScmBytePort *bport)
{
Modified: branches/r5rs/sigscheme/strport.h
===================================================================
--- branches/r5rs/sigscheme/strport.h 2005-10-31 13:57:55 UTC (rev 1907)
+++ branches/r5rs/sigscheme/strport.h 2005-10-31 15:54:03 UTC (rev 1908)
@@ -68,8 +68,9 @@
=======================================*/
void Scm_strport_init(void);
-ScmBytePort *ScmInputStrPort_new(char *str, int ownership);
+ScmBytePort *ScmInputStrPort_new(char *str);
ScmBytePort *ScmInputStrPort_new_copying(char *str);
+ScmBytePort *ScmInputStrPort_new_const(const char *str);
void **ScmInputStrPort_ref_opaque(ScmBytePort *bport);
ScmBytePort *ScmOutputStrPort_new(void);
More information about the uim-commit
mailing list