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

yamaken at freedesktop.org yamaken at freedesktop.org
Wed Feb 1 19:51:11 PST 2006


Author: yamaken
Date: 2006-02-01 19:51:06 -0800 (Wed, 01 Feb 2006)
New Revision: 3065

Removed:
   branches/r5rs/sigscheme/src/sigschemefunctable.c
   branches/r5rs/sigscheme/src/sigschemefunctable.h
Modified:
   branches/r5rs/sigscheme/src/Makefile.am
   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/script/build_func_table.rb
   branches/r5rs/sigscheme/src/script/functable-header.txt
   branches/r5rs/sigscheme/src/sigscheme.c
   branches/r5rs/sigscheme/src/sigschemeinternal.h
   branches/r5rs/sigscheme/src/syntax.c
Log:
* This commit make the function tables module-local. It eliminates
  that unneeded tables are being included, and enables flexible module
  linking such as dynamic loading

* sigscheme/src/sigschemefunctable.h
* sigscheme/src/sigschemefunctable.c
  - Removed
* sigscheme/src/Makefile.am
  - Remove the rule for sigschemefunctable.c
  - Add new phony target 'func-tables' for developers
  - (BUILT_SOURCES): New variable
  - (libsscm_la_SOURCES): Remove sigschemefunctable.[hc]
* sigscheme/src/sigschemeinternal.h
  - Exclude sigschemefunctable.h
* sigscheme/src/script/build_func_table.rb
  - (print_tableheader): Make the table static
* sigscheme/src/script/functable-header.txt
  - Exclude sigscheme.h and sigschemefunctable.h
* 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
  - Include the function tables directly


Modified: branches/r5rs/sigscheme/src/Makefile.am
===================================================================
--- branches/r5rs/sigscheme/src/Makefile.am	2006-02-02 02:50:14 UTC (rev 3064)
+++ branches/r5rs/sigscheme/src/Makefile.am	2006-02-02 03:51:06 UTC (rev 3065)
@@ -24,10 +24,12 @@
 		./script/functable-header.txt \
 		./script/functable-footer.txt
 
+# FIXME: separate non-core R5RS features
 R5RS_PROC_SRCS = sigscheme.c procedure.c eval.c list.c number.c string.c \
                  vector.c port.c read.c write.c load.c
 
-sigschemefunctable.c: $(FUNC_TABLES)
+.PHONY: func-tables
+func-tables: $(FUNC_TABLES)
 sigschemefunctable-r5rs-syntax.c: syntax.c module.c $(BUILD_FUNCTBL_SOURCES)
 	$(BUILD_FUNCTBL) "scm_r5rs_syntax_func_info_table" \
           syntax.c module.c > $@
@@ -62,6 +64,10 @@
 EXTRA_DIST = $(FUNC_TABLES) $(BUILD_FUNCTBL_SOURCES) \
         test-compact.c
 
+# Only works on 'make all', 'make check' and 'make install'.
+# See "Built sources" section of automake info.
+BUILT_SOURCES = $(FUNC_TABLES)
+
 pkginclude_HEADERS = sigscheme.h config.h my-stdint.h
 
 libsscm_la_SOURCES = \
@@ -69,8 +75,7 @@
         alloc.c storage.c storage-gc.c storage-symbol.c \
         error.c env.c eval.c syntax.c procedure.c list.c \
         module.c \
-        sigscheme.c sigschemefunctable.c \
-        sigschemeinternal.h sigschemefunctable.h
+        sigschemeinternal.h sigscheme.c
 if USE_STORAGE_COMPACT
   pkginclude_HEADERS += storage-compact.h
 else

Modified: branches/r5rs/sigscheme/src/error.c
===================================================================
--- branches/r5rs/sigscheme/src/error.c	2006-02-02 02:50:14 UTC (rev 3064)
+++ branches/r5rs/sigscheme/src/error.c	2006-02-02 03:51:06 UTC (rev 3065)
@@ -61,6 +61,8 @@
 /*=======================================
   Variable Declarations
 =======================================*/
+#include "sigschemefunctable-error.c"
+
 #if (!HAVE_C99_VARIADIC_MACRO && !HAVE_GNU_VARIADIC_MACRO)
 const char *scm_err_funcname;
 #endif

Modified: branches/r5rs/sigscheme/src/module-nonstd.c
===================================================================
--- branches/r5rs/sigscheme/src/module-nonstd.c	2006-02-02 02:50:14 UTC (rev 3064)
+++ branches/r5rs/sigscheme/src/module-nonstd.c	2006-02-02 03:51:06 UTC (rev 3065)
@@ -58,6 +58,8 @@
 /*=======================================
   Variable Declarations
 =======================================*/
+#include "sigschemefunctable-nonstd.c"
+
 /* io.c */
 extern const char *scm_lib_path;
 

Modified: branches/r5rs/sigscheme/src/module-siod.c
===================================================================
--- branches/r5rs/sigscheme/src/module-siod.c	2006-02-02 02:50:14 UTC (rev 3064)
+++ branches/r5rs/sigscheme/src/module-siod.c	2006-02-02 03:51:06 UTC (rev 3065)
@@ -76,6 +76,8 @@
 /*=======================================
   Variable Declarations
 =======================================*/
+#include "sigschemefunctable-siod.c"
+
 static const int sscm_debug_mask_tbl[] = {
     SCM_DBG_SIOD_V0,
     SCM_DBG_SIOD_V1,

Modified: branches/r5rs/sigscheme/src/module-srfi1.c
===================================================================
--- branches/r5rs/sigscheme/src/module-srfi1.c	2006-02-02 02:50:14 UTC (rev 3064)
+++ branches/r5rs/sigscheme/src/module-srfi1.c	2006-02-02 03:51:06 UTC (rev 3065)
@@ -60,6 +60,7 @@
 /*=======================================
   Variable Declarations
 =======================================*/
+#include "sigschemefunctable-srfi1.c"
 
 /*=======================================
   File Local Function Declarations

Modified: branches/r5rs/sigscheme/src/module-srfi2.c
===================================================================
--- branches/r5rs/sigscheme/src/module-srfi2.c	2006-02-02 02:50:14 UTC (rev 3064)
+++ branches/r5rs/sigscheme/src/module-srfi2.c	2006-02-02 03:51:06 UTC (rev 3065)
@@ -56,6 +56,7 @@
 /*=======================================
   Variable Declarations
 =======================================*/
+#include "sigschemefunctable-srfi2.c"
 
 /*=======================================
   File Local Function Declarations

Modified: branches/r5rs/sigscheme/src/module-srfi23.c
===================================================================
--- branches/r5rs/sigscheme/src/module-srfi23.c	2006-02-02 02:50:14 UTC (rev 3064)
+++ branches/r5rs/sigscheme/src/module-srfi23.c	2006-02-02 03:51:06 UTC (rev 3065)
@@ -55,6 +55,7 @@
 /*=======================================
   Variable Declarations
 =======================================*/
+#include "sigschemefunctable-srfi23.c"
 
 /*=======================================
   File Local Function Declarations

Modified: branches/r5rs/sigscheme/src/module-srfi34.c
===================================================================
--- branches/r5rs/sigscheme/src/module-srfi34.c	2006-02-02 02:50:14 UTC (rev 3064)
+++ branches/r5rs/sigscheme/src/module-srfi34.c	2006-02-02 03:51:06 UTC (rev 3065)
@@ -73,6 +73,8 @@
 /*=======================================
   Variable Declarations
 =======================================*/
+#include "sigschemefunctable-srfi34.c"
+
 static ScmObj current_exception_handlers;
 
 /* error messages */

Modified: branches/r5rs/sigscheme/src/module-srfi38.c
===================================================================
--- branches/r5rs/sigscheme/src/module-srfi38.c	2006-02-02 02:50:14 UTC (rev 3064)
+++ branches/r5rs/sigscheme/src/module-srfi38.c	2006-02-02 03:51:06 UTC (rev 3065)
@@ -57,6 +57,7 @@
 /*=======================================
   Variable Declarations
 =======================================*/
+#include "sigschemefunctable-srfi38.c"
 
 /*=======================================
   File Local Function Declarations

Modified: branches/r5rs/sigscheme/src/module-srfi6.c
===================================================================
--- branches/r5rs/sigscheme/src/module-srfi6.c	2006-02-02 02:50:14 UTC (rev 3064)
+++ branches/r5rs/sigscheme/src/module-srfi6.c	2006-02-02 03:51:06 UTC (rev 3065)
@@ -59,6 +59,7 @@
 /*=======================================
   Variable Declarations
 =======================================*/
+#include "sigschemefunctable-srfi6.c"
 
 /*=======================================
   File Local Function Declarations

Modified: branches/r5rs/sigscheme/src/module-srfi60.c
===================================================================
--- branches/r5rs/sigscheme/src/module-srfi60.c	2006-02-02 02:50:14 UTC (rev 3064)
+++ branches/r5rs/sigscheme/src/module-srfi60.c	2006-02-02 03:51:06 UTC (rev 3065)
@@ -77,6 +77,7 @@
 /*=======================================
   Variable Declarations
 =======================================*/
+#include "sigschemefunctable-srfi60.c"
 
 /*=======================================
   File Local Function Declarations

Modified: branches/r5rs/sigscheme/src/module-srfi8.c
===================================================================
--- branches/r5rs/sigscheme/src/module-srfi8.c	2006-02-02 02:50:14 UTC (rev 3064)
+++ branches/r5rs/sigscheme/src/module-srfi8.c	2006-02-02 03:51:06 UTC (rev 3065)
@@ -55,6 +55,7 @@
 /*=======================================
   Variable Declarations
 =======================================*/
+#include "sigschemefunctable-srfi8.c"
 
 /*=======================================
   File Local Function Declarations

Modified: branches/r5rs/sigscheme/src/script/build_func_table.rb
===================================================================
--- branches/r5rs/sigscheme/src/script/build_func_table.rb	2006-02-02 02:50:14 UTC (rev 3064)
+++ branches/r5rs/sigscheme/src/script/build_func_table.rb	2006-02-02 03:51:06 UTC (rev 3065)
@@ -52,7 +52,7 @@
 end
 
 def print_tableheader(tablename)
-  puts "struct scm_func_registration_info #{tablename}[] = {"
+  puts "static struct scm_func_registration_info #{tablename}[] = {"
 end
 
 def print_tablefooter()

Modified: branches/r5rs/sigscheme/src/script/functable-header.txt
===================================================================
--- branches/r5rs/sigscheme/src/script/functable-header.txt	2006-02-02 02:50:14 UTC (rev 3064)
+++ branches/r5rs/sigscheme/src/script/functable-header.txt	2006-02-02 03:51:06 UTC (rev 3065)
@@ -40,8 +40,6 @@
 /*=======================================
   Local Include
 =======================================*/
-#include "sigscheme.h"
-#include "sigschemefunctable.h"
 
 /*=======================================
   Macro Definitions

Modified: branches/r5rs/sigscheme/src/sigscheme.c
===================================================================
--- branches/r5rs/sigscheme/src/sigscheme.c	2006-02-02 02:50:14 UTC (rev 3064)
+++ branches/r5rs/sigscheme/src/sigscheme.c	2006-02-02 03:51:06 UTC (rev 3065)
@@ -61,6 +61,11 @@
 /*=======================================
   Variable Declarations
 =======================================*/
+#include "sigschemefunctable-r5rs-procedure.c"
+#if SCM_USE_DEEP_CADRS
+#include "sigschemefunctable-r5rs-deepcadrs.c"
+#endif
+
 static scm_bool scm_initialized;
 
 #if SCM_COMPAT_SIOD

Deleted: branches/r5rs/sigscheme/src/sigschemefunctable.c
===================================================================
--- branches/r5rs/sigscheme/src/sigschemefunctable.c	2006-02-02 02:50:14 UTC (rev 3064)
+++ branches/r5rs/sigscheme/src/sigschemefunctable.c	2006-02-02 03:51:06 UTC (rev 3065)
@@ -1,94 +0,0 @@
-/*===========================================================================
- *  FileName : sigschemefunctable.c
- *  About    : Built-in function table
- *
- *  Copyright (C) 2005-2006 Kazuki Ohta <mover AT hct.zaq.ne.jp>
- *
- *  All rights reserved.
- *
- *  Redistribution and use in source and binary forms, with or without
- *  modification, are permitted provided that the following conditions
- *  are met:
- *
- *  1. Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- *  2. Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *  3. Neither the name of authors nor the names of its contributors
- *     may be used to endorse or promote products derived from this software
- *     without specific prior written permission.
- *
- *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS
- *  IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- *  THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- *  PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
- *  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- *  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- *  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- *  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- *  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- *  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-===========================================================================*/
-
-#include "config.h"
-
-/*=======================================
-  System Include
-=======================================*/
-
-/*=======================================
-  Local Include
-=======================================*/
-#include "sigscheme.h"
-#include "sigschemeinternal.h"
-
-/*=======================================
-  Macro Definitions
-=======================================*/
-
-/*=======================================
-  Type Definitions
-=======================================*/
-
-/*=======================================
-   Builtin Function Tables
-=======================================*/
-#include "sigschemefunctable-r5rs-syntax.c"
-#include "sigschemefunctable-r5rs-procedure.c"
-#include "sigschemefunctable-error.c"
-
-#if SCM_USE_DEEP_CADRS
-#include "sigschemefunctable-r5rs-deepcadrs.c"
-#endif
-#if SCM_USE_NONSTD_FEATURES
-#include "sigschemefunctable-nonstd.c"
-#endif
-#if SCM_USE_SRFI1
-#include "sigschemefunctable-srfi1.c"
-#endif
-#if SCM_USE_SRFI2
-#include "sigschemefunctable-srfi2.c"
-#endif
-#if SCM_USE_SRFI6
-#include "sigschemefunctable-srfi6.c"
-#endif
-#if SCM_USE_SRFI8
-#include "sigschemefunctable-srfi8.c"
-#endif
-#if SCM_USE_SRFI23
-#include "sigschemefunctable-srfi23.c"
-#endif
-#if SCM_USE_SRFI34
-#include "sigschemefunctable-srfi34.c"
-#endif
-#if SCM_USE_SRFI38
-#include "sigschemefunctable-srfi38.c"
-#endif
-#if SCM_USE_SRFI60
-#include "sigschemefunctable-srfi60.c"
-#endif
-#if SCM_COMPAT_SIOD
-#include "sigschemefunctable-siod.c"
-#endif

Deleted: branches/r5rs/sigscheme/src/sigschemefunctable.h
===================================================================
--- branches/r5rs/sigscheme/src/sigschemefunctable.h	2006-02-02 02:50:14 UTC (rev 3064)
+++ branches/r5rs/sigscheme/src/sigschemefunctable.h	2006-02-02 03:51:06 UTC (rev 3065)
@@ -1,104 +0,0 @@
-/*===========================================================================
- *  FileName : sigschemefunctable.h
- *  About    : Built-in function table
- *
- *  Copyright (C) 2005-2006 Kazuki Ohta <mover AT hct.zaq.ne.jp>
- *
- *  All rights reserved.
- *
- *  Redistribution and use in source and binary forms, with or without
- *  modification, are permitted provided that the following conditions
- *  are met:
- *
- *  1. Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- *  2. Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *  3. Neither the name of authors nor the names of its contributors
- *     may be used to endorse or promote products derived from this software
- *     without specific prior written permission.
- *
- *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS
- *  IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- *  THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- *  PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
- *  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- *  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- *  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- *  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- *  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- *  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-===========================================================================*/
-#ifndef __SIGSCHEME_FUNCTABLE_H
-#define __SIGSCHEME_FUNCTABLE_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "config.h"
-
-/*=======================================
-  System Include
-=======================================*/
-
-/*=======================================
-  Local Include
-=======================================*/
-
-/*=======================================
-  Macro Definitions
-=======================================*/
-
-/*=======================================
-  Type Definitions
-=======================================*/
-
-/*=======================================
-   Variable Declarations
-=======================================*/
-extern struct scm_func_registration_info scm_r5rs_syntax_func_info_table[];
-extern struct scm_func_registration_info scm_r5rs_procedure_func_info_table[];
-extern struct scm_func_registration_info scm_error_func_info_table[];
-
-#if SCM_USE_DEEP_CADRS
-extern struct scm_func_registration_info scm_r5rs_deepcadrs_func_info_table[];
-#endif
-#if SCM_USE_NONSTD_FEATURES
-extern struct scm_func_registration_info scm_nonstd_func_info_table[];
-#endif
-#if SCM_USE_SRFI1
-extern struct scm_func_registration_info scm_srfi1_func_info_table[];
-#endif
-#if SCM_USE_SRFI2
-extern struct scm_func_registration_info scm_srfi2_func_info_table[];
-#endif
-#if SCM_USE_SRFI6
-extern struct scm_func_registration_info scm_srfi6_func_info_table[];
-#endif
-#if SCM_USE_SRFI8
-extern struct scm_func_registration_info scm_srfi8_func_info_table[];
-#endif
-#if SCM_USE_SRFI23
-extern struct scm_func_registration_info scm_srfi23_func_info_table[];
-#endif
-#if SCM_USE_SRFI34
-extern struct scm_func_registration_info scm_srfi34_func_info_table[];
-#endif
-#if SCM_USE_SRFI38
-extern struct scm_func_registration_info scm_srfi38_func_info_table[];
-#endif
-#if SCM_USE_SRFI60
-extern struct scm_func_registration_info scm_srfi60_func_info_table[];
-#endif
-#if SCM_COMPAT_SIOD
-extern struct scm_func_registration_info scm_siod_func_info_table[];
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __SIGSCHEME_FUNCTABLE_H */

Modified: branches/r5rs/sigscheme/src/sigschemeinternal.h
===================================================================
--- branches/r5rs/sigscheme/src/sigschemeinternal.h	2006-02-02 02:50:14 UTC (rev 3064)
+++ branches/r5rs/sigscheme/src/sigschemeinternal.h	2006-02-02 03:51:06 UTC (rev 3065)
@@ -64,9 +64,6 @@
     ScmRegisterFunc reg_func;
 };
 
-/* workaround */
-#include "sigschemefunctable.h"
-
 /*=======================================
    Variable Declarations
 =======================================*/

Modified: branches/r5rs/sigscheme/src/syntax.c
===================================================================
--- branches/r5rs/sigscheme/src/syntax.c	2006-02-02 02:50:14 UTC (rev 3064)
+++ branches/r5rs/sigscheme/src/syntax.c	2006-02-02 03:51:06 UTC (rev 3065)
@@ -57,6 +57,8 @@
 /*=======================================
   Variable Declarations
 =======================================*/
+#include "sigschemefunctable-r5rs-syntax.c"
+
 ScmObj scm_sym_quote, scm_sym_quasiquote;
 ScmObj scm_sym_unquote, scm_sym_unquote_splicing;
 



More information about the uim-commit mailing list