[uim-commit] r1330 - in branches/r5rs: scm sigscheme uim

kzk at freedesktop.org kzk at freedesktop.org
Fri Aug 26 03:14:26 PDT 2005


Author: kzk
Date: 2005-08-26 03:14:24 -0700 (Fri, 26 Aug 2005)
New Revision: 1330

Modified:
   branches/r5rs/scm/init.scm
   branches/r5rs/sigscheme/operations-siod.c
   branches/r5rs/sigscheme/sigscheme.c
   branches/r5rs/sigscheme/sigscheme.h
   branches/r5rs/uim/uim-scm.c
Log:
* Implement "verbose" interface for siod compatibility.
  This commit implements "interface" only.

* uim/uim-scm.c
  - (uim_scm_get_verbose_level,
     uim_scm_set_verbose_level): implemented
  - (uim_scm_init): set verbose level

* scm/init.scm
  - restore (load-user-conf)

* sigscheme/sigscheme.c
  - (SigScm_Initialize): export "verbose" procedure
* sigscheme/sigscheme.h
  - (ScmOp_verbose,
     SigScm_get_verbose_level,
     SigScm_set_verbose_level): new func
* sigscheme/operations-siod.c
  - (ScmOp_verbose,
     SigScm_get_verbose_level,
     SigScm_set_verbose_level): new func
  - (sscm_verbose_level): new variable



Modified: branches/r5rs/scm/init.scm
===================================================================
--- branches/r5rs/scm/init.scm	2005-08-26 07:25:03 UTC (rev 1329)
+++ branches/r5rs/scm/init.scm	2005-08-26 10:14:24 UTC (rev 1330)
@@ -101,5 +101,5 @@
 (load-modules)
 
 (or (getenv "LIBUIM_VANILLA")
-;    (load-user-conf)
+    (load-user-conf)
     (load "default.scm"))

Modified: branches/r5rs/sigscheme/operations-siod.c
===================================================================
--- branches/r5rs/sigscheme/operations-siod.c	2005-08-26 07:25:03 UTC (rev 1329)
+++ branches/r5rs/sigscheme/operations-siod.c	2005-08-26 10:14:24 UTC (rev 1330)
@@ -52,6 +52,7 @@
 /*=======================================
   Variable Declarations
 =======================================*/
+static long sscm_verbose_level = 0;
 
 /*=======================================
   File Local Function Declarations
@@ -143,3 +144,25 @@
 
     return SCM_CLOSURE_EXP(closure);
 }
+
+ScmObj ScmOp_verbose(ScmObj args, ScmObj env)
+{
+    if (!NULLP(args)) {
+        if (!INTP(CAR(args)))
+            SigScm_ErrorObj("verbose : integer required but got ", args);
+
+        sscm_verbose_level = SCM_INT_VALUE(CAR(args));
+    }
+
+    return Scm_NewInt(sscm_verbose_level);
+}
+
+long SigScm_get_verbose_level(void)
+{
+    return sscm_verbose_level;
+}
+
+void SigScm_set_verbose_level(long level)
+{
+    sscm_verbose_level = level;
+}

Modified: branches/r5rs/sigscheme/sigscheme.c
===================================================================
--- branches/r5rs/sigscheme/sigscheme.c	2005-08-26 07:25:03 UTC (rev 1329)
+++ branches/r5rs/sigscheme/sigscheme.c	2005-08-26 10:14:24 UTC (rev 1330)
@@ -336,6 +336,7 @@
     Scm_RegisterFunc1("bit-not"              , ScmOp_bit_not);
     Scm_RegisterFuncL("the-environment"      , ScmOp_the_environment);
     Scm_RegisterFunc1("%%closure-code"       , ScmOp_closure_code);
+    Scm_RegisterFuncL("verbose"              , ScmOp_verbose);
     /* datas.c */
     scm_return_value = SCM_NULL;
 #endif

Modified: branches/r5rs/sigscheme/sigscheme.h
===================================================================
--- branches/r5rs/sigscheme/sigscheme.h	2005-08-26 07:25:03 UTC (rev 1329)
+++ branches/r5rs/sigscheme/sigscheme.h	2005-08-26 10:14:24 UTC (rev 1330)
@@ -361,6 +361,9 @@
 ScmObj ScmOp_bit_not(ScmObj obj);
 ScmObj ScmOp_the_environment(ScmObj arg, ScmObj env);
 ScmObj ScmOp_closure_code(ScmObj closure);
+ScmObj ScmOp_verbose(ScmObj args, ScmObj env);
+long   SigScm_get_verbose_level(void);
+void   SigScm_set_verbose_level(long level);
 #endif
 
 #ifdef __cplusplus

Modified: branches/r5rs/uim/uim-scm.c
===================================================================
--- branches/r5rs/uim/uim-scm.c	2005-08-26 07:25:03 UTC (rev 1329)
+++ branches/r5rs/uim/uim-scm.c	2005-08-26 10:14:24 UTC (rev 1330)
@@ -195,18 +195,13 @@
 long
 uim_scm_get_verbose_level(void)
 {
-#if 0
-  return siod_verbose_level;
-#endif
-  return 0;
+  return (long)SigScm_get_verbose_level();
 }
 
 void
 uim_scm_set_verbose_level(long new_value)
 {
-#if 0
-  siod_verbose_level = new_value;
-#endif
+  SigScm_set_verbose_level(new_value);
 }
 
 void
@@ -512,10 +507,17 @@
 void
 uim_scm_init(const char *verbose_level)
 {
-  if (!uim_output) {
+  long vlevel = 4;
+
+  if (!uim_output)
     uim_output = stderr;
+
+  if (verbose_level && isdigit(verbose_level[0])) {
+    verbose_level = atoi(verbose_level) % 10;
   }
+  uim_scm_set_verbose_level(vlevel);
 
+
   SigScm_Initialize();
   true_sym  = (uim_lisp)SCM_TRUE;
   false_sym = (uim_lisp)SCM_FALSE;



More information about the uim-commit mailing list