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

kzk at freedesktop.org kzk at freedesktop.org
Thu Jul 21 18:59:34 EST 2005


Author: kzk
Date: 2005-07-21 01:59:27 -0700 (Thu, 21 Jul 2005)
New Revision: 1000

Modified:
   branches/r5rs/sigscheme/error.c
   branches/r5rs/sigscheme/sigscheme.h
Log:
* Now SigScm_Error can handle printf like output.

* sigscheme/sigscheme.h
* sigscheme/sigscheme,c
  - (SigScm_Error):
    changed from
      void SigScm_Error(const char *msg);
    to
      void SigScm_Error(const char *msg, ...);


Modified: branches/r5rs/sigscheme/error.c
===================================================================
--- branches/r5rs/sigscheme/error.c	2005-07-21 08:46:15 UTC (rev 999)
+++ branches/r5rs/sigscheme/error.c	2005-07-21 08:59:27 UTC (rev 1000)
@@ -35,6 +35,7 @@
   System Include
 =======================================*/
 #include <stdio.h>
+#include <stdarg.h>
 
 /*=======================================
   Local Include
@@ -63,9 +64,13 @@
     return -1;
 }
 
-void SigScm_Error(const char *msg)
+void SigScm_Error(const char *msg, ...)
 {
-    fprintf(SCM_PORTINFO_FILE(current_output_port), "%s\n", msg);
+    va_list va;
+    va_start(va, msg);
+    vfprintf(SCM_PORTINFO_FILE(current_output_port), msg, va);
+    va_end(va);
+
     exit(-1);
 }
 

Modified: branches/r5rs/sigscheme/sigscheme.h
===================================================================
--- branches/r5rs/sigscheme/sigscheme.h	2005-07-21 08:46:15 UTC (rev 999)
+++ branches/r5rs/sigscheme/sigscheme.h	2005-07-21 08:59:27 UTC (rev 1000)
@@ -317,7 +317,7 @@
 ScmObj SigScm_Read_Char(ScmObj port);
 
 /* error.c */
-void SigScm_Error(const char *msg);
+void SigScm_Error(const char *msg, ...);
 void SigScm_ErrorObj(const char *msg, ScmObj obj);
 
 /* debug.c */



More information about the uim-commit mailing list