[uim-commit] r3060 - in branches/r5rs/sigscheme/src: . script

yamaken at freedesktop.org yamaken at freedesktop.org
Tue Jan 31 20:30:13 PST 2006


Author: yamaken
Date: 2006-01-31 20:30:08 -0800 (Tue, 31 Jan 2006)
New Revision: 3060

Modified:
   branches/r5rs/sigscheme/src/error.c
   branches/r5rs/sigscheme/src/module-nonstd.c
   branches/r5rs/sigscheme/src/module-siod.c
   branches/r5rs/sigscheme/src/module-srfi1.c
   branches/r5rs/sigscheme/src/module-srfi2.c
   branches/r5rs/sigscheme/src/module-srfi23.c
   branches/r5rs/sigscheme/src/module-srfi34.c
   branches/r5rs/sigscheme/src/module-srfi38.c
   branches/r5rs/sigscheme/src/module-srfi6.c
   branches/r5rs/sigscheme/src/module-srfi60.c
   branches/r5rs/sigscheme/src/module-srfi8.c
   branches/r5rs/sigscheme/src/module.c
   branches/r5rs/sigscheme/src/script/check_declare_func_typo.rb
   branches/r5rs/sigscheme/src/script/scm_decl.rb
   branches/r5rs/sigscheme/src/sigscheme.c
   branches/r5rs/sigscheme/src/sigschemefunctable.c
   branches/r5rs/sigscheme/src/sigschemefunctable.h
   branches/r5rs/sigscheme/src/sigschemeinternal.h
   branches/r5rs/sigscheme/src/syntax.c
Log:
* sigscheme/src/sigschemefunctable.h
  - (SCM_REGISTER_FUNC_TABLE, ScmBuiltinFunc): Removed
  - (ScmRegisterFunc, struct scm_func_registration_info): Move to
    sigschemeinternal.h
* sigscheme/src/sigschemefunctable.c
  - Include sigschemeinternal.h
* sigscheme/src/sigschemeinternal.h
  - (ScmRegisterFunc): Moved from sigschemefunctable.h
  - (struct scm_func_registration_info):
    * Ditto
    * Change type of 'c_func' to ScmFuncType
  - (scm_register_funcs): New function decl
* sigscheme/src/script/check_declare_func_typo.rb
  - (search_declare_function): Follow the type change of 'c_func'
* sigscheme/src/script/scm_decl.rb
  - (scm_func_table_entry): Ditto
* sigscheme/src/module.c
  - (scm_register_funcs): New function copied from
    SCM_REGISTER_FUNC_TABLE()
* sigscheme/src/error.c
* sigscheme/src/syntax.c
* sigscheme/src/sigscheme.c
* sigscheme/src/module-nonstd.c
* sigscheme/src/module-siod.c
* sigscheme/src/module-srfi1.c
* sigscheme/src/module-srfi2.c
* sigscheme/src/module-srfi6.c
* sigscheme/src/module-srfi8.c
* sigscheme/src/module-srfi23.c
* sigscheme/src/module-srfi34.c
* sigscheme/src/module-srfi38.c
* sigscheme/src/module-srfi60.c
  - Replace SCM_REGISTER_FUNC_TABLE() with scm_register_funcs()


Modified: branches/r5rs/sigscheme/src/error.c
===================================================================
--- branches/r5rs/sigscheme/src/error.c	2006-02-01 04:05:20 UTC (rev 3059)
+++ branches/r5rs/sigscheme/src/error.c	2006-02-01 04:30:08 UTC (rev 3060)
@@ -100,7 +100,7 @@
     scm_err_funcname = NULL;
 #endif
 
-    SCM_REGISTER_FUNC_TABLE(scm_error_func_info_table);
+    scm_register_funcs(scm_error_func_info_table);
 }
 
 int

Modified: branches/r5rs/sigscheme/src/module-nonstd.c
===================================================================
--- branches/r5rs/sigscheme/src/module-nonstd.c	2006-02-01 04:05:20 UTC (rev 3059)
+++ branches/r5rs/sigscheme/src/module-nonstd.c	2006-02-01 04:30:08 UTC (rev 3060)
@@ -73,7 +73,7 @@
 void
 scm_initialize_nonstd_features(void)
 {
-    SCM_REGISTER_FUNC_TABLE(scm_nonstd_func_info_table);
+    scm_register_funcs(scm_nonstd_func_info_table);
 
     scm_define_alias("call/cc", "call-with-current-continuation");
 }

Modified: branches/r5rs/sigscheme/src/module-siod.c
===================================================================
--- branches/r5rs/sigscheme/src/module-siod.c	2006-02-01 04:05:20 UTC (rev 3059)
+++ branches/r5rs/sigscheme/src/module-siod.c	2006-02-01 04:30:08 UTC (rev 3060)
@@ -101,7 +101,7 @@
 scm_initialize_siod(void)
 {
     ScmCharPort *cport;
-    SCM_REGISTER_FUNC_TABLE(scm_siod_func_info_table);
+    scm_register_funcs(scm_siod_func_info_table);
 
     scm_use("srfi-60");
     scm_define_alias("bit-and", "logand");

Modified: branches/r5rs/sigscheme/src/module-srfi1.c
===================================================================
--- branches/r5rs/sigscheme/src/module-srfi1.c	2006-02-01 04:05:20 UTC (rev 3059)
+++ branches/r5rs/sigscheme/src/module-srfi1.c	2006-02-01 04:30:08 UTC (rev 3060)
@@ -72,7 +72,7 @@
 void
 scm_initialize_srfi1(void)
 {
-    SCM_REGISTER_FUNC_TABLE(scm_srfi1_func_info_table);
+    scm_register_funcs(scm_srfi1_func_info_table);
 }
 
 /*===========================================================================

Modified: branches/r5rs/sigscheme/src/module-srfi2.c
===================================================================
--- branches/r5rs/sigscheme/src/module-srfi2.c	2006-02-01 04:05:20 UTC (rev 3059)
+++ branches/r5rs/sigscheme/src/module-srfi2.c	2006-02-01 04:30:08 UTC (rev 3060)
@@ -67,7 +67,7 @@
 void
 scm_initialize_srfi2(void)
 {
-    SCM_REGISTER_FUNC_TABLE(scm_srfi2_func_info_table);
+    scm_register_funcs(scm_srfi2_func_info_table);
 }
 
 ScmObj

Modified: branches/r5rs/sigscheme/src/module-srfi23.c
===================================================================
--- branches/r5rs/sigscheme/src/module-srfi23.c	2006-02-01 04:05:20 UTC (rev 3059)
+++ branches/r5rs/sigscheme/src/module-srfi23.c	2006-02-01 04:30:08 UTC (rev 3060)
@@ -66,7 +66,7 @@
 void
 scm_initialize_srfi23(void)
 {
-    SCM_REGISTER_FUNC_TABLE(scm_srfi23_func_info_table);
+    scm_register_funcs(scm_srfi23_func_info_table);
 }
 
 /*===========================================================================

Modified: branches/r5rs/sigscheme/src/module-srfi34.c
===================================================================
--- branches/r5rs/sigscheme/src/module-srfi34.c	2006-02-01 04:05:20 UTC (rev 3059)
+++ branches/r5rs/sigscheme/src/module-srfi34.c	2006-02-01 04:30:08 UTC (rev 3060)
@@ -188,7 +188,7 @@
                        SCM_INTERACTION_ENV);
 #endif /* USE_WITH_SIGSCHEME_FATAL_ERROR */
 
-    SCM_REGISTER_FUNC_TABLE(scm_srfi34_func_info_table);
+    scm_register_funcs(scm_srfi34_func_info_table);
 
     current_exception_handlers = LIST_1(proc_fallback_handler);
 }

Modified: branches/r5rs/sigscheme/src/module-srfi38.c
===================================================================
--- branches/r5rs/sigscheme/src/module-srfi38.c	2006-02-01 04:05:20 UTC (rev 3059)
+++ branches/r5rs/sigscheme/src/module-srfi38.c	2006-02-01 04:30:08 UTC (rev 3060)
@@ -68,7 +68,7 @@
 void
 scm_initialize_srfi38(void)
 {
-    SCM_REGISTER_FUNC_TABLE(scm_srfi38_func_info_table);
+    scm_register_funcs(scm_srfi38_func_info_table);
 
     /* SRFI-38 allows providing (read/ss) and (write/ss) */
     scm_define_alias("write/ss", "write-with-shared-structure");

Modified: branches/r5rs/sigscheme/src/module-srfi6.c
===================================================================
--- branches/r5rs/sigscheme/src/module-srfi6.c	2006-02-01 04:05:20 UTC (rev 3059)
+++ branches/r5rs/sigscheme/src/module-srfi6.c	2006-02-01 04:30:08 UTC (rev 3060)
@@ -73,7 +73,7 @@
 {
     scm_strport_init();
 
-    SCM_REGISTER_FUNC_TABLE(scm_srfi6_func_info_table);
+    scm_register_funcs(scm_srfi6_func_info_table);
 }
 
 static void

Modified: branches/r5rs/sigscheme/src/module-srfi60.c
===================================================================
--- branches/r5rs/sigscheme/src/module-srfi60.c	2006-02-01 04:05:20 UTC (rev 3059)
+++ branches/r5rs/sigscheme/src/module-srfi60.c	2006-02-01 04:30:08 UTC (rev 3060)
@@ -88,7 +88,7 @@
 void
 scm_initialize_srfi60(void)
 {
-    SCM_REGISTER_FUNC_TABLE(scm_srfi60_func_info_table);
+    scm_register_funcs(scm_srfi60_func_info_table);
 
     scm_define_alias("bitwise-and",   "logand");
     scm_define_alias("bitwise-ior",   "logior");

Modified: branches/r5rs/sigscheme/src/module-srfi8.c
===================================================================
--- branches/r5rs/sigscheme/src/module-srfi8.c	2006-02-01 04:05:20 UTC (rev 3059)
+++ branches/r5rs/sigscheme/src/module-srfi8.c	2006-02-01 04:30:08 UTC (rev 3060)
@@ -66,7 +66,7 @@
 void
 scm_initialize_srfi8(void)
 {
-    SCM_REGISTER_FUNC_TABLE(scm_srfi8_func_info_table);
+    scm_register_funcs(scm_srfi8_func_info_table);
 }
 
 ScmObj

Modified: branches/r5rs/sigscheme/src/module.c
===================================================================
--- branches/r5rs/sigscheme/src/module.c	2006-02-01 04:05:20 UTC (rev 3059)
+++ branches/r5rs/sigscheme/src/module.c	2006-02-01 04:30:08 UTC (rev 3060)
@@ -205,6 +205,16 @@
                          SCM_SYMBOL_VCELL(scm_intern(sym)));
 }
 
+void
+scm_register_funcs(struct scm_func_registration_info *table)
+{
+    struct scm_func_registration_info *info;
+
+    for (info = &table[0]; info->funcname; info++) {
+        (*info->reg_func)(info->funcname, info->c_func);
+    }
+}
+
 static scm_bool
 scm_register_func(const char *name, ScmFuncType c_func,
                   enum ScmFuncTypeCode type)

Modified: branches/r5rs/sigscheme/src/script/check_declare_func_typo.rb
===================================================================
--- branches/r5rs/sigscheme/src/script/check_declare_func_typo.rb	2006-02-01 04:05:20 UTC (rev 3059)
+++ branches/r5rs/sigscheme/src/script/check_declare_func_typo.rb	2006-02-01 04:30:08 UTC (rev 3060)
@@ -145,7 +145,7 @@
       $declare_info[scm_func] = reg_func;
       $declare_info2[reg_func] = scm_func;
 
-#      puts "    { \"#{scm_func}\", (ScmBuiltinFunc)#{c_func}, (ScmRegisterFunc)#{reg_func} },"
+#      puts "    { \"#{scm_func}\", (ScmFuncType)#{c_func}, (ScmRegisterFunc)#{reg_func} },"
     end
   }
 end

Modified: branches/r5rs/sigscheme/src/script/scm_decl.rb
===================================================================
--- branches/r5rs/sigscheme/src/script/scm_decl.rb	2006-02-01 04:05:20 UTC (rev 3059)
+++ branches/r5rs/sigscheme/src/script/scm_decl.rb	2006-02-01 04:30:08 UTC (rev 3060)
@@ -69,7 +69,7 @@
 
 def scm_func_table_entry(decl)
   proc, func, register_func = decl.values_at(:proc, :func, :register_func)
-  "{ \"#{proc}\", (ScmBuiltinFunc)#{func}, (ScmRegisterFunc)#{register_func} }"
+  "{ \"#{proc}\", (ScmFuncType)#{func}, (ScmRegisterFunc)#{register_func} }"
 end
 
 def scm_func_register_exp(decl)

Modified: branches/r5rs/sigscheme/src/sigscheme.c
===================================================================
--- branches/r5rs/sigscheme/src/sigscheme.c	2006-02-01 04:05:20 UTC (rev 3059)
+++ branches/r5rs/sigscheme/src/sigscheme.c	2006-02-01 04:30:08 UTC (rev 3060)
@@ -121,11 +121,11 @@
     scm_init_syntax();
 
     /* R5RS Procedures */
-    SCM_REGISTER_FUNC_TABLE(scm_r5rs_procedure_func_info_table);
+    scm_register_funcs(scm_r5rs_procedure_func_info_table);
 
 #if SCM_USE_DEEP_CADRS
     /* Deep c[ad]+r Functions */
-    SCM_REGISTER_FUNC_TABLE(scm_r5rs_deepcadrs_func_info_table);
+    scm_register_funcs(scm_r5rs_deepcadrs_func_info_table);
 #endif
 #if SCM_USE_NONSTD_FEATURES
     scm_use("sscm");

Modified: branches/r5rs/sigscheme/src/sigschemefunctable.c
===================================================================
--- branches/r5rs/sigscheme/src/sigschemefunctable.c	2006-02-01 04:05:20 UTC (rev 3059)
+++ branches/r5rs/sigscheme/src/sigschemefunctable.c	2006-02-01 04:30:08 UTC (rev 3060)
@@ -42,7 +42,7 @@
   Local Include
 =======================================*/
 #include "sigscheme.h"
-#include "sigschemefunctable.h"
+#include "sigschemeinternal.h"
 
 /*=======================================
   Macro Definitions

Modified: branches/r5rs/sigscheme/src/sigschemefunctable.h
===================================================================
--- branches/r5rs/sigscheme/src/sigschemefunctable.h	2006-02-01 04:05:20 UTC (rev 3059)
+++ branches/r5rs/sigscheme/src/sigschemefunctable.h	2006-02-01 04:30:08 UTC (rev 3060)
@@ -51,26 +51,11 @@
 /*=======================================
   Macro Definitions
 =======================================*/
-#define SCM_REGISTER_FUNC_TABLE(functable)                                   \
-    do {                                                                     \
-        struct scm_func_registration_info *info = NULL;                      \
-        for (info = functable; info->funcname; info++) {                     \
-            (*info->reg_func)(info->funcname, info->c_func);                 \
-        }                                                                    \
-    } while (/* CONSTCOND */ 0)
 
 /*=======================================
   Type Definitions
 =======================================*/
-typedef ScmObj (*ScmBuiltinFunc)(void);
-typedef void   (*ScmRegisterFunc)(const char *name, ScmBuiltinFunc func);
 
-struct scm_func_registration_info {
-    const char     *funcname;
-    ScmBuiltinFunc  c_func;
-    ScmRegisterFunc reg_func;
-};
-
 /*=======================================
    Variable Declarations
 =======================================*/

Modified: branches/r5rs/sigscheme/src/sigschemeinternal.h
===================================================================
--- branches/r5rs/sigscheme/src/sigschemeinternal.h	2006-02-01 04:05:20 UTC (rev 3059)
+++ branches/r5rs/sigscheme/src/sigschemeinternal.h	2006-02-01 04:30:08 UTC (rev 3060)
@@ -44,7 +44,6 @@
    Local Include
 =======================================*/
 #include "sigscheme.h"
-#include "sigschemefunctable.h"
 #include "encoding.h"
 
 /*=======================================
@@ -57,6 +56,17 @@
     const char *lex_rep;  /* lexical representation as character object */
 };
 
+typedef void (*ScmRegisterFunc)(const char *name, ScmFuncType func);
+
+struct scm_func_registration_info {
+    const char     *funcname;
+    ScmFuncType     c_func;
+    ScmRegisterFunc reg_func;
+};
+
+/* workaround */
+#include "sigschemefunctable.h"
+
 /*=======================================
    Variable Declarations
 =======================================*/
@@ -563,6 +573,7 @@
 
 /* module.c */
 void scm_init_module(void);
+void scm_register_funcs(struct scm_func_registration_info *table);
 
 /* sigscheme.c */
 char **scm_interpret_argv(char **argv);

Modified: branches/r5rs/sigscheme/src/syntax.c
===================================================================
--- branches/r5rs/sigscheme/src/syntax.c	2006-02-01 04:05:20 UTC (rev 3059)
+++ branches/r5rs/sigscheme/src/syntax.c	2006-02-01 04:30:08 UTC (rev 3060)
@@ -84,7 +84,7 @@
 void
 scm_init_syntax(void)
 {
-    SCM_REGISTER_FUNC_TABLE(scm_r5rs_syntax_func_info_table);
+    scm_register_funcs(scm_r5rs_syntax_func_info_table);
 
     scm_sym_quote            = scm_intern("quote");
     scm_sym_quasiquote       = scm_intern("quasiquote");



More information about the uim-commit mailing list