* backtrace.c, debug.c, debug.h, deprecation.c, eq.c, eval.c
authorHan-Wen Nienhuys <hanwen@lilypond.org>
Mon, 22 Jan 2007 15:14:40 +0000 (15:14 +0000)
committerHan-Wen Nienhuys <hanwen@lilypond.org>
Mon, 22 Jan 2007 15:14:40 +0000 (15:14 +0000)
eval.h, gsubr.c, init.c, macros.c, print.c, print.h, read.c,
read.h, stacks.c, symbols.c, throw.c: use private-options.h

* private-options.h: new file: contain hardcoded option
definitions.

18 files changed:
libguile/ChangeLog
libguile/backtrace.c
libguile/debug.c
libguile/debug.h
libguile/deprecation.c
libguile/eq.c
libguile/eval.h
libguile/gsubr.c
libguile/init.c
libguile/macros.c
libguile/print.c
libguile/print.h
libguile/private-options.h [new file with mode: 0644]
libguile/read.c
libguile/read.h
libguile/stacks.c
libguile/symbols.c
libguile/throw.c

index 5889278..6c26857 100644 (file)
@@ -1,5 +1,12 @@
 2007-01-22  Han-Wen Nienhuys  <hanwen@lilypond.org>
 
+       * backtrace.c, debug.c, debug.h, deprecation.c, eq.c, eval.c
+       eval.h, gsubr.c, init.c, macros.c, print.c, print.h, read.c,
+       read.h, stacks.c, symbols.c, throw.c: use private-options.h
+
+       * private-options.h: new file: contain hardcoded option
+       definitions.
+
        * private-gc.h: add FSF header.
 
 2007-01-19  Han-Wen Nienhuys  <hanwen@lilypond.org>
index 38d7a83..a8bc120 100644 (file)
@@ -47,6 +47,7 @@
 #include "libguile/lang.h"
 #include "libguile/backtrace.h"
 #include "libguile/filesys.h"
+#include "libguile/private-options.h"
 
 /* {Error reporting and backtraces}
  *
index 01b8204..08793f3 100644 (file)
 
 #include "libguile/validate.h"
 #include "libguile/debug.h"
+
+#include "libguile/private-options.h"
 \f
 
+
 /* {Run time control of the debugging evaluator}
  */
 
@@ -74,6 +77,7 @@ SCM_DEFINE (scm_debug_options, "debug-options-interface", 0, 1, 0,
 }
 #undef FUNC_NAME
 
+
 static void
 with_traps_before (void *data)
 {
@@ -112,7 +116,6 @@ SCM_DEFINE (scm_with_traps, "with-traps", 1, 0, 0,
 #undef FUNC_NAME
 
 \f
-
 SCM_SYMBOL (scm_sym_procname, "procname");
 SCM_SYMBOL (scm_sym_dots, "...");
 SCM_SYMBOL (scm_sym_source, "source");
index ce7dcfe..79afa4d 100644 (file)
 /* scm_debug_opts is  defined in eval.c.
  */
 
-SCM_API scm_t_option scm_debug_opts[];
-
-#define SCM_BREAKPOINTS_P      scm_debug_opts[1].val
-#define SCM_TRACE_P            scm_debug_opts[2].val
-#define SCM_REC_PROCNAMES_P    scm_debug_opts[3].val
-#define SCM_BACKWARDS_P                scm_debug_opts[4].val
-#define SCM_BACKTRACE_WIDTH    scm_debug_opts[5].val
-#define SCM_BACKTRACE_INDENT           scm_debug_opts[6].val
-#define SCM_N_FRAMES           scm_debug_opts[7].val
-#define SCM_BACKTRACE_MAXDEPTH scm_debug_opts[8].val
-#define SCM_BACKTRACE_DEPTH    scm_debug_opts[9].val
-#define SCM_BACKTRACE_P                scm_debug_opts[10].val
-#define SCM_DEVAL_P            scm_debug_opts[11].val
-#define SCM_STACK_LIMIT                scm_debug_opts[12].val
-#define SCM_SHOW_FILE_NAME     scm_debug_opts[13].val
-#define SCM_WARN_DEPRECATED    scm_debug_opts[14].val
-#define SCM_N_DEBUG_OPTIONS 15
+
 
 SCM_API int scm_debug_mode_p;
 SCM_API int scm_check_entry_p;
index 6e314dd..2207303 100644 (file)
@@ -31,6 +31,9 @@
 #include "libguile/strings.h"
 #include "libguile/ports.h"
 
+#include "libguile/private-options.h"
+
+
 /* Windows defines. */
 #ifdef __MINGW32__
 #define vsnprintf _vsnprintf
index 7c7e76d..ebc91c9 100644 (file)
@@ -36,6 +36,9 @@
 
 #include "libguile/validate.h"
 #include "libguile/eq.h"
+
+#include "libguile/private-options.h"
+
 \f
 
 #ifdef HAVE_STRING_H
index dec9983..247cf16 100644 (file)
 /* {Options}
  */
 
-SCM_API scm_t_option scm_eval_opts[];
-
-#define SCM_EVAL_STACK         scm_eval_opts[0].val
-#define SCM_N_EVAL_OPTIONS 1
-
-SCM_API long scm_eval_stack;
-
-SCM_API scm_t_option scm_evaluator_trap_table[];
-
-SCM_API SCM scm_eval_options_interface (SCM setting);
-
-
-#define SCM_TRAPS_P            scm_evaluator_trap_table[0].val
-#define SCM_ENTER_FRAME_P      scm_evaluator_trap_table[1].val
-#define SCM_APPLY_FRAME_P      scm_evaluator_trap_table[2].val
-#define SCM_EXIT_FRAME_P       scm_evaluator_trap_table[3].val
-#define SCM_ENTER_FRAME_HDLR   (SCM_PACK (scm_evaluator_trap_table[4].val))
-#define SCM_APPLY_FRAME_HDLR   (SCM_PACK (scm_evaluator_trap_table[5].val))
-#define SCM_EXIT_FRAME_HDLR    (SCM_PACK (scm_evaluator_trap_table[6].val))
-#define SCM_MEMOIZE_P       scm_evaluator_trap_table[7].val
-#define SCM_MEMOIZE_HDLR    (SCM_PACK (scm_evaluator_trap_table[8].val))
 
 \f
 
index c0bdd84..356d771 100644 (file)
@@ -24,6 +24,8 @@
 
 #include "libguile/gsubr.h"
 #include "libguile/deprecation.h"
+
+#include "libguile/private-options.h"
 \f
 /*
  * gsubr.c
index 219ef62..ff69ab9 100644 (file)
 #include "libguile/deprecated.h"
 
 #include "libguile/init.h"
+#include "libguile/private-options.h"
 
 #ifdef HAVE_STRING_H
 #include <string.h>
index ede8751..db279ec 100644 (file)
@@ -30,6 +30,8 @@
 #include "libguile/validate.h"
 #include "libguile/macros.h"
 
+#include "libguile/private-options.h"
+
 scm_t_bits scm_tc16_macro;
 
 
index fa6ea8c..fb9a74e 100644 (file)
@@ -43,6 +43,9 @@
 
 #include "libguile/validate.h"
 #include "libguile/print.h"
+
+#include "libguile/private-options.h"
+
 \f
 
 /* {Names of immediate symbols}
index 7e59ba8..740aa28 100644 (file)
 
 #include "libguile/options.h"
 \f
-SCM_API scm_t_option scm_print_opts[];
-
-#define SCM_PRINT_CLOSURE          (SCM_PACK (scm_print_opts[0].val))
-#define SCM_PRINT_SOURCE_P         ((int) scm_print_opts[1].val)
-#define SCM_PRINT_HIGHLIGHT_PREFIX  (SCM_PACK (scm_print_opts[2].val))
-#define SCM_PRINT_HIGHLIGHT_SUFFIX  (SCM_PACK (scm_print_opts[3].val))
-#define SCM_PRINT_KEYWORD_STYLE_I   4
-#define SCM_PRINT_KEYWORD_STYLE     (SCM_PACK (scm_print_opts[4].val))
-#define SCM_N_PRINT_OPTIONS 5
 
 /* State information passed around during printing.
  */
diff --git a/libguile/private-options.h b/libguile/private-options.h
new file mode 100644 (file)
index 0000000..6ec8353
--- /dev/null
@@ -0,0 +1,103 @@
+/*
+ * private-options.h - private declarations for option handling
+ *
+ * We put this in a private header, since layout of data structures
+ * is an implementation detail that we want to hide.
+ * 
+ * Copyright (C) 2002, 03, 04, 05, 06, 07 Free Software Foundation, Inc.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef PRIVATE_OPTIONS
+#define PRIVATE_OPTIONS
+
+/*
+  evaluator
+ */
+SCM_API scm_t_option scm_eval_opts[];
+
+SCM_API long scm_eval_stack;
+
+SCM_API scm_t_option scm_evaluator_trap_table[];
+
+SCM_API SCM scm_eval_options_interface (SCM setting);
+
+#define SCM_EVAL_STACK         scm_eval_opts[0].val
+
+#define SCM_TRAPS_P            scm_evaluator_trap_table[0].val
+#define SCM_ENTER_FRAME_P      scm_evaluator_trap_table[1].val
+#define SCM_APPLY_FRAME_P      scm_evaluator_trap_table[2].val
+#define SCM_EXIT_FRAME_P       scm_evaluator_trap_table[3].val
+#define SCM_ENTER_FRAME_HDLR   (SCM_PACK (scm_evaluator_trap_table[4].val))
+#define SCM_APPLY_FRAME_HDLR   (SCM_PACK (scm_evaluator_trap_table[5].val))
+#define SCM_EXIT_FRAME_HDLR    (SCM_PACK (scm_evaluator_trap_table[6].val))
+#define SCM_MEMOIZE_P       scm_evaluator_trap_table[7].val
+#define SCM_MEMOIZE_HDLR    (SCM_PACK (scm_evaluator_trap_table[8].val))
+
+/*
+  debugging.
+ */
+SCM_API scm_t_option scm_debug_opts[];
+
+#define SCM_BREAKPOINTS_P      scm_debug_opts[1].val
+#define SCM_TRACE_P            scm_debug_opts[2].val
+#define SCM_REC_PROCNAMES_P    scm_debug_opts[3].val
+#define SCM_BACKWARDS_P                scm_debug_opts[4].val
+#define SCM_BACKTRACE_WIDTH    scm_debug_opts[5].val
+#define SCM_BACKTRACE_INDENT           scm_debug_opts[6].val
+#define SCM_N_FRAMES           scm_debug_opts[7].val
+#define SCM_BACKTRACE_MAXDEPTH scm_debug_opts[8].val
+#define SCM_BACKTRACE_DEPTH    scm_debug_opts[9].val
+#define SCM_BACKTRACE_P                scm_debug_opts[10].val
+#define SCM_DEVAL_P            scm_debug_opts[11].val
+#define SCM_STACK_LIMIT                scm_debug_opts[12].val
+#define SCM_SHOW_FILE_NAME     scm_debug_opts[13].val
+#define SCM_WARN_DEPRECATED    scm_debug_opts[14].val
+#define SCM_N_DEBUG_OPTIONS 15
+
+
+/*
+  printing
+*/
+SCM_API scm_t_option scm_print_opts[];
+
+#define SCM_PRINT_CLOSURE          (SCM_PACK (scm_print_opts[0].val))
+#define SCM_PRINT_SOURCE_P         ((int) scm_print_opts[1].val)
+#define SCM_PRINT_HIGHLIGHT_PREFIX  (SCM_PACK (scm_print_opts[2].val))
+#define SCM_PRINT_HIGHLIGHT_SUFFIX  (SCM_PACK (scm_print_opts[3].val))
+#define SCM_PRINT_KEYWORD_STYLE_I   4
+#define SCM_PRINT_KEYWORD_STYLE     (SCM_PACK (scm_print_opts[4].val))
+#define SCM_N_PRINT_OPTIONS 5
+
+
+/*
+  read
+ */
+SCM_API scm_t_option scm_read_opts[];
+
+#define SCM_COPY_SOURCE_P      scm_read_opts[0].val
+#define SCM_RECORD_POSITIONS_P scm_read_opts[1].val
+#define SCM_CASE_INSENSITIVE_P scm_read_opts[2].val
+#define SCM_KEYWORD_STYLE      scm_read_opts[3].val
+#if SCM_ENABLE_ELISP
+#define SCM_ELISP_VECTORS_P    scm_read_opts[4].val
+#define SCM_ESCAPED_PARENS_P   scm_read_opts[5].val
+#define SCM_N_READ_OPTIONS 6
+#else
+#define SCM_N_READ_OPTIONS 4
+#endif
+
+#endif  /* PRIVATE_OPTIONS */ 
index d0c4a87..de2e87b 100644 (file)
@@ -38,6 +38,8 @@
 #include "libguile/srfi-4.h"
 
 #include "libguile/read.h"
+#include "libguile/private-options.h"
+
 
 \f
 
index 4bfa59e..9ff3626 100644 (file)
 
 #define SCM_WHITE_SPACES  SCM_SINGLE_SPACES: case '\t'
 
-SCM_API scm_t_option scm_read_opts[];
-
-#define SCM_COPY_SOURCE_P      scm_read_opts[0].val
-#define SCM_RECORD_POSITIONS_P scm_read_opts[1].val
-#define SCM_CASE_INSENSITIVE_P scm_read_opts[2].val
-#define SCM_KEYWORD_STYLE      scm_read_opts[3].val
-#if SCM_ENABLE_ELISP
-#define SCM_ELISP_VECTORS_P    scm_read_opts[4].val
-#define SCM_ESCAPED_PARENS_P   scm_read_opts[5].val
-#define SCM_N_READ_OPTIONS 6
-#else
-#define SCM_N_READ_OPTIONS 4
-#endif
+
 
 \f
 
index de85522..922c522 100644 (file)
@@ -32,6 +32,8 @@
 
 #include "libguile/validate.h"
 #include "libguile/stacks.h"
+#include "libguile/private-options.h"
+
 
 \f
 /* {Frames and stacks}
index c8b9017..d786dd9 100644 (file)
@@ -40,6 +40,9 @@
 #include "libguile/validate.h"
 #include "libguile/symbols.h"
 
+#include "libguile/private-options.h"
+
+
 #ifdef HAVE_STRING_H
 #include <string.h>
 #endif
index 9bffda7..02503c3 100644 (file)
@@ -39,6 +39,9 @@
 #include "libguile/init.h"
 #include "libguile/strings.h"
 
+#include "libguile/private-options.h"
+
+
 \f
 /* the jump buffer data structure */
 static scm_t_bits tc16_jmpbuffer;