[uim-commit] r2574 - branches/r5rs/sigscheme
yamaken at freedesktop.org
yamaken at freedesktop.org
Wed Dec 14 10:15:11 PST 2005
Author: yamaken
Date: 2005-12-14 10:14:58 -0800 (Wed, 14 Dec 2005)
New Revision: 2574
Modified:
branches/r5rs/sigscheme/debug.c
branches/r5rs/sigscheme/error.c
branches/r5rs/sigscheme/sigscheme.h
Log:
* sigscheme/debug.c
- (debug_mask, SigScm_DebugCategories, SigScm_SetDebugCategories,
SigScm_PredefinedDebugCategories, SigScm_CategorizedDebug,
SigScm_Debug): Move to error.c
* sigscheme/error.c
- (debug_mask, SigScm_DebugCategories, SigScm_SetDebugCategories,
SigScm_PredefinedDebugCategories, SigScm_CategorizedDebug,
SigScm_Debug): Moved from debug.c
* sigscheme/sigscheme.h
- Move section of the functions
Modified: branches/r5rs/sigscheme/debug.c
===================================================================
--- branches/r5rs/sigscheme/debug.c 2005-12-14 16:11:38 UTC (rev 2573)
+++ branches/r5rs/sigscheme/debug.c 2005-12-14 18:14:58 UTC (rev 2574)
@@ -100,7 +100,6 @@
=======================================*/
void (*Scm_writess_func)(ScmObj port, ScmObj obj) = &SigScm_WriteToPort;
-static int debug_mask;
#if SCM_USE_SRFI38
static write_ss_context *write_ss_ctx; /* misc info in priting shared structures */
#endif
@@ -127,59 +126,6 @@
/*=======================================
Function Implementations
=======================================*/
-int SigScm_DebugCategories(void)
-{
- return debug_mask;
-}
-
-void SigScm_SetDebugCategories(int categories)
-{
- debug_mask = categories;
-}
-
-int SigScm_PredefinedDebugCategories(void)
-{
-#if SCM_DEBUG
- return (SCM_DBG_DEVEL | SCM_DBG_COMPAT | SCM_DBG_OTHER
-#if SCM_DEBUG_PARSER
- | SCM_DBG_PARSER
-#endif
-#if SCM_DEBUG_GC
- | SCM_DBG_GC
-#endif
-#if SCM_DEBUG_ENCODING
- | SCM_DBG_ENCODING
-#endif
- );
-#else /* SCM_DEBUG */
- return SCM_DBG_NONE;
-#endif /* SCM_DEBUG */
-}
-
-void SigScm_CategorizedDebug(int category, const char *msg, ...)
-{
- va_list va;
-
- va_start(va, msg);
- if (debug_mask & category) {
- SigScm_VErrorPrintf(msg, va);
- SigScm_ErrorNewline();
- }
- va_end(va);
-}
-
-void SigScm_Debug(const char *msg, ...)
-{
- va_list va;
-
- va_start(va, msg);
- if (debug_mask & SCM_DBG_DEVEL) {
- SigScm_VErrorPrintf(msg, va);
- SigScm_ErrorNewline();
- }
- va_end(va);
-}
-
void SigScm_Display(ScmObj obj)
{
SigScm_DisplayToPort(scm_current_output_port, obj);
Modified: branches/r5rs/sigscheme/error.c
===================================================================
--- branches/r5rs/sigscheme/error.c 2005-12-14 16:11:38 UTC (rev 2573)
+++ branches/r5rs/sigscheme/error.c 2005-12-14 18:14:58 UTC (rev 2574)
@@ -63,7 +63,7 @@
/*=======================================
Variable Declarations
=======================================*/
-static int srfi34_is_provided, fatal_error_looped;
+static int debug_mask, srfi34_is_provided, fatal_error_looped;
static void (*cb_fatal_error)(void);
static ScmObj err_obj_tag, str_srfi34;
@@ -96,6 +96,59 @@
REGISTER_FUNC_TABLE(scm_error_func_info_table);
}
+int SigScm_DebugCategories(void)
+{
+ return debug_mask;
+}
+
+void SigScm_SetDebugCategories(int categories)
+{
+ debug_mask = categories;
+}
+
+int SigScm_PredefinedDebugCategories(void)
+{
+#if SCM_DEBUG
+ return (SCM_DBG_DEVEL | SCM_DBG_COMPAT | SCM_DBG_OTHER
+#if SCM_DEBUG_PARSER
+ | SCM_DBG_PARSER
+#endif
+#if SCM_DEBUG_GC
+ | SCM_DBG_GC
+#endif
+#if SCM_DEBUG_ENCODING
+ | SCM_DBG_ENCODING
+#endif
+ );
+#else /* SCM_DEBUG */
+ return SCM_DBG_NONE;
+#endif /* SCM_DEBUG */
+}
+
+void SigScm_CategorizedDebug(int category, const char *msg, ...)
+{
+ va_list va;
+
+ va_start(va, msg);
+ if (debug_mask & category) {
+ SigScm_VErrorPrintf(msg, va);
+ SigScm_ErrorNewline();
+ }
+ va_end(va);
+}
+
+void SigScm_Debug(const char *msg, ...)
+{
+ va_list va;
+
+ va_start(va, msg);
+ if (debug_mask & SCM_DBG_DEVEL) {
+ SigScm_VErrorPrintf(msg, va);
+ SigScm_ErrorNewline();
+ }
+ va_end(va);
+}
+
void *Scm_malloc(size_t size)
{
void *p;
Modified: branches/r5rs/sigscheme/sigscheme.h
===================================================================
--- branches/r5rs/sigscheme/sigscheme.h 2005-12-14 16:11:38 UTC (rev 2573)
+++ branches/r5rs/sigscheme/sigscheme.h 2005-12-14 18:14:58 UTC (rev 2574)
@@ -642,6 +642,11 @@
ScmObj SigScm_Read_Char(ScmObj port);
/* error.c */
+int SigScm_DebugCategories(void);
+void SigScm_SetDebugCategories(int categories);
+int SigScm_PredefinedDebugCategories(void);
+void SigScm_CategorizedDebug(int category, const char *msg, ...);
+void SigScm_Debug(const char *msg, ...);
int SigScm_Die(const char *msg, const char *filename, int line);
void SigScm_Error(const char *msg, ...) SCM_NORETURN;
void SigScm_ErrorObj(const char *msg, ScmObj obj) SCM_NORETURN;
@@ -656,11 +661,6 @@
ScmObj ScmOp_backtrace(void);
/* debug.c */
-int SigScm_DebugCategories(void);
-void SigScm_SetDebugCategories(int categories);
-int SigScm_PredefinedDebugCategories(void);
-void SigScm_CategorizedDebug(int category, const char *msg, ...);
-void SigScm_Debug(const char *msg, ...);
void SigScm_Display(ScmObj obj);
void SigScm_WriteToPort(ScmObj port, ScmObj obj);
void SigScm_DisplayToPort(ScmObj port, ScmObj obj);
More information about the uim-commit
mailing list