[uim-commit] r1774 - branches/r5rs/sigscheme

yamaken at freedesktop.org yamaken at freedesktop.org
Mon Oct 3 10:02:41 PDT 2005


Author: yamaken
Date: 2005-10-03 10:02:39 -0700 (Mon, 03 Oct 2005)
New Revision: 1774

Modified:
   branches/r5rs/sigscheme/datas.c
   branches/r5rs/sigscheme/operations-siod.c
   branches/r5rs/sigscheme/sigscheme.c
   branches/r5rs/sigscheme/sigscheme.h
Log:
* sigscheme/datas.c
  - (scm_return_value, Scm_eval_c_string, Scm_eval_c_string_internal,
    Scm_return_value): Move to sigscheme.c
* sigscheme/sigscheme.c
  - (Scm_eval_c_string, Scm_eval_c_string_internal, Scm_return_value):
    Moved from datas.c
  - (scm_return_value):
    * Ditto
    * Make static
* sigscheme/operations-siod.c
  - (SigScm_Initialize_SIOD): Remove unnecessary scm_return_value
    initialization
* sigscheme/sigscheme.h
  - (Scm_eval_c_string, Scm_return_value): Move section


Modified: branches/r5rs/sigscheme/datas.c
===================================================================
--- branches/r5rs/sigscheme/datas.c	2005-10-03 15:34:35 UTC (rev 1773)
+++ branches/r5rs/sigscheme/datas.c	2005-10-03 17:02:39 UTC (rev 1774)
@@ -168,10 +168,6 @@
 static ScmObj *symbol_hash = NULL;
 static gc_protected_var *protected_var_list = NULL;
 
-#if SCM_COMPAT_SIOD
-ScmObj scm_return_value    = NULL;
-#endif
-
 ScmObj SigScm_null, SigScm_true, SigScm_false, SigScm_eof;
 ScmObj SigScm_unbound, SigScm_undef;
 
@@ -217,12 +213,6 @@
 
 static void finalize_protected_var(void);
 
-#if SCM_GCC4_READY_GC
-static SCM_GC_PROTECTED_FUNC_DECL(ScmObj, Scm_eval_c_string_internal, (const char *exp));
-#else
-static ScmObj Scm_eval_c_string_internal(const char *exp);
-#endif
-
 /*=======================================
   Function Implementations
 =======================================*/
@@ -1045,53 +1035,3 @@
 
     return sym;
 }
-
-/*============================================================================
-  Other functions: should be moved into appropriate files
-============================================================================*/
-
-ScmObj Scm_eval_c_string(const char *exp)
-{
-#if !SCM_GCC4_READY_GC
-    ScmObj stack_start = NULL;
-#endif
-    ScmObj ret         = SCM_NULL;
-
-#if SCM_GCC4_READY_GC
-    SCM_GC_CALL_PROTECTED_FUNC(ret, Scm_eval_c_string_internal, (exp));
-#else
-    /* start protecting stack */
-    SigScm_GC_ProtectStack(&stack_start);
-
-    ret = Scm_eval_c_string_internal(exp);
-
-    /* now no need to protect stack */
-    SigScm_GC_UnprotectStack(&stack_start);
-#endif
-
-    return ret;
-}
-
-ScmObj Scm_eval_c_string_internal(const char *exp)
-{
-    ScmObj str_port    = SCM_NULL;
-    ScmObj ret         = SCM_NULL;
-
-    str_port = Scm_NewStringPort(exp);
-
-    ret = SigScm_Read(str_port);
-    ret = EVAL(ret, SCM_INTERACTION_ENV);
-
-#if SCM_COMPAT_SIOD
-    scm_return_value = ret;
-#endif
-
-    return ret;
-}
-
-#if SCM_COMPAT_SIOD
-ScmObj Scm_return_value(void)
-{
-    return scm_return_value;
-}
-#endif

Modified: branches/r5rs/sigscheme/operations-siod.c
===================================================================
--- branches/r5rs/sigscheme/operations-siod.c	2005-10-03 15:34:35 UTC (rev 1773)
+++ branches/r5rs/sigscheme/operations-siod.c	2005-10-03 17:02:39 UTC (rev 1774)
@@ -108,7 +108,6 @@
     Scm_RegisterProcedureFixed1("%%closure-code"       , ScmOp_closure_code);
     Scm_RegisterProcedureVariadic0("verbose" , ScmOp_verbose);
     /* datas.c */
-    scm_return_value = SCM_NULL;
     SigScm_SetVerboseLevel(2);
 }
 

Modified: branches/r5rs/sigscheme/sigscheme.c
===================================================================
--- branches/r5rs/sigscheme/sigscheme.c	2005-10-03 15:34:35 UTC (rev 1773)
+++ branches/r5rs/sigscheme/sigscheme.c	2005-10-03 17:02:39 UTC (rev 1774)
@@ -57,6 +57,10 @@
 ScmObj SigScm_null_values;
 #endif
 
+#if SCM_COMPAT_SIOD
+static ScmObj scm_return_value    = NULL;
+#endif
+
 /*=======================================
   File Local Function Declarations
 =======================================*/
@@ -68,6 +72,12 @@
 
 static int Scm_RegisterFunc(const char *name, ScmFuncType func, enum ScmFuncTypeCode type);
 
+#if SCM_GCC4_READY_GC
+static SCM_GC_PROTECTED_FUNC_DECL(ScmObj, Scm_eval_c_string_internal, (const char *exp));
+#else
+static ScmObj Scm_eval_c_string_internal(const char *exp);
+#endif
+
 /*=======================================
   Function Implementations
 =======================================*/
@@ -365,6 +375,52 @@
                          SCM_SYMBOL_VCELL(Scm_Intern(sym)));
 }
 
+ScmObj Scm_eval_c_string(const char *exp)
+{
+#if !SCM_GCC4_READY_GC
+    ScmObj stack_start = NULL;
+#endif
+    ScmObj ret         = SCM_NULL;
+
+#if SCM_GCC4_READY_GC
+    SCM_GC_CALL_PROTECTED_FUNC(ret, Scm_eval_c_string_internal, (exp));
+#else
+    /* start protecting stack */
+    SigScm_GC_ProtectStack(&stack_start);
+
+    ret = Scm_eval_c_string_internal(exp);
+
+    /* now no need to protect stack */
+    SigScm_GC_UnprotectStack(&stack_start);
+#endif
+
+    return ret;
+}
+
+ScmObj Scm_eval_c_string_internal(const char *exp)
+{
+    ScmObj str_port    = SCM_NULL;
+    ScmObj ret         = SCM_NULL;
+
+    str_port = Scm_NewStringPort(exp);
+
+    ret = SigScm_Read(str_port);
+    ret = EVAL(ret, SCM_INTERACTION_ENV);
+
+#if SCM_COMPAT_SIOD
+    scm_return_value = ret;
+#endif
+
+    return ret;
+}
+
+#if SCM_COMPAT_SIOD
+ScmObj Scm_return_value(void)
+{
+    return scm_return_value;
+}
+#endif
+
 /*===========================================================================
   Scheme Function Export Related Functions
 ===========================================================================*/

Modified: branches/r5rs/sigscheme/sigscheme.h
===================================================================
--- branches/r5rs/sigscheme/sigscheme.h	2005-10-03 15:34:35 UTC (rev 1773)
+++ branches/r5rs/sigscheme/sigscheme.h	2005-10-03 17:02:39 UTC (rev 1774)
@@ -173,6 +173,10 @@
 void SigScm_Initialize(void);
 void SigScm_Finalize(void);
 void Scm_DefineAlias(const char *newsym, const char *sym);
+ScmObj Scm_eval_c_string(const char *exp);
+#if SCM_COMPAT_SIOD
+ScmObj Scm_return_value(void);
+#endif
 
 /* Procedure/Syntax Registration */
 void Scm_RegisterReductionOperator(const char *name, ScmObj (*func)(ScmObj, ScmObj, enum ScmReductionState*));
@@ -332,10 +336,6 @@
 ScmObj Scm_NewCFuncPointer(ScmCFunc func);
 #endif
 ScmObj Scm_Intern(const char *name);
-ScmObj Scm_eval_c_string(const char *exp);
-#if SCM_COMPAT_SIOD
-ScmObj Scm_return_value(void);
-#endif
 
 /* storage-protection.c */
 #if SCM_GCC4_READY_GC



More information about the uim-commit mailing list