[uim-commit] r165 - trunk/uim
yamaken@freedesktop.org
yamaken@freedesktop.org
Fri Jan 7 23:11:20 PST 2005
Author: yamaken
Date: 2005-01-07 23:11:17 -0800 (Fri, 07 Jan 2005)
New Revision: 165
Modified:
trunk/uim/plugin.c
trunk/uim/slib.c
trunk/uim/uim-scm.c
trunk/uim/uim.h
Log:
* uim/slib.c
- (repl_c_string_entered): New static variable for #if
!NESTED_REPL_C_STRING configuration
- (repl_driver): Add error check for nested entrance
- (siod_init): Add initialization of repl_c_string_entered
* uim/uim-scm.c
- (uim_scm_require_file): Support #ifndef UIM_SCM_NESTED_EVAL
configuration as AS-IS quality
* uim/plugin.c
- Add #include "uim-compat-scm.h" for #ifdef UIM_SCM_NESTED_EVAL
- (plugin_load): Support #ifndef UIM_SCM_NESTED_EVAL configuration
by replacing uim_scm_eval_c_string() with uim_scm_symbol_value()
to remove nested repl_c_string call
* uim/uim.h
- Modify the comment about uim_bool
Modified: trunk/uim/plugin.c
===================================================================
--- trunk/uim/plugin.c 2005-01-08 05:54:23 UTC (rev 164)
+++ trunk/uim/plugin.c 2005-01-08 07:11:17 UTC (rev 165)
@@ -48,6 +48,9 @@
#include "config.h"
#include "uim.h"
#include "uim-scm.h"
+#ifdef UIM_SCM_NESTED_EVAL
+#include "uim-compat-scm.h"
+#endif
#include "plugin.h"
#include "context.h"
@@ -67,8 +70,13 @@
uim_plugin_info_list *info_list_entry;
char *tmp;
char *plugin_lib_filename, *plugin_scm_filename;
+#ifdef UIM_SCM_NESTED_EVAL
uim_lisp lib_path = uim_scm_eval_c_string("uim-plugin-lib-load-path");
uim_lisp scm_path = uim_scm_eval_c_string("uim-plugin-scm-load-path");
+#else
+ uim_lisp lib_path = uim_scm_symbol_value("uim-plugin-lib-load-path");
+ uim_lisp scm_path = uim_scm_symbol_value("uim-plugin-scm-load-path");
+#endif
uim_lisp path_car, path_cdr;
size_t len;
Modified: trunk/uim/slib.c
===================================================================
--- trunk/uim/slib.c 2005-01-08 05:54:23 UTC (rev 164)
+++ trunk/uim/slib.c 2005-01-08 07:11:17 UTC (rev 165)
@@ -226,6 +226,9 @@
static LISP unbound_marker;
static LISP *obarray;
static LISP repl_return_val;
+#if (!NESTED_REPL_C_STRING)
+static int repl_c_string_entered;
+#endif
static long obarray_dim;
static struct catch_frame *catch_framep;
static void (*repl_puts) (char *);
@@ -774,6 +777,13 @@
struct repl_hooks hd;
LISP stack_start;
#if (!NESTED_REPL_C_STRING)
+ if (repl_c_string_entered)
+ {
+ my_err("nested repl_driver", NIL);
+ ret = 0;
+ goto fin;
+ }
+ repl_c_string_entered = 1;
func_trace = NULL;
#endif
#if (NESTED_REPL_C_STRING)
@@ -810,6 +820,8 @@
fin:
#if (NESTED_REPL_C_STRING)
siod_gc_unprotect_stack(&stack_start);
+#else
+ repl_c_string_entered = 0;
#endif
return ret;
}
@@ -4692,6 +4704,9 @@
unbound_marker = NIL;
obarray = NULL;
repl_return_val = NIL;
+#if (!NESTED_REPL_C_STRING)
+ repl_c_string_entered = 0;
+#endif
obarray_dim = 100;
catch_framep = (struct catch_frame *) NULL;
repl_puts = NULL;
Modified: trunk/uim/uim-scm.c
===================================================================
--- trunk/uim/uim-scm.c 2005-01-08 05:54:23 UTC (rev 164)
+++ trunk/uim/uim-scm.c 2005-01-08 07:11:17 UTC (rev 165)
@@ -359,12 +359,22 @@
uim_scm_require_file(const char *fn)
{
uim_bool succeeded;
+#ifndef UIM_SCM_NESTED_EVAL
+ uim_lisp _fn;
+#endif
if (!fn)
return UIM_FALSE;
+#ifdef UIM_SCM_NESTED_EVAL
UIM_EVAL_FSTRING2(NULL, "(eq? '*%s-loaded* (*catch 'errobj (require \"%s\")))", fn, fn);
succeeded = uim_scm_c_bool(uim_scm_return_value());
+#else
+ /* broken: does not support direct call from C */
+ _fn = uim_scm_make_str(fn);
+ require((LISP)_fn);
+ succeeded = UIM_TRUE; /* bogus result */
+#endif
return succeeded;
}
Modified: trunk/uim/uim.h
===================================================================
--- trunk/uim/uim.h 2005-01-08 05:54:23 UTC (rev 164)
+++ trunk/uim/uim.h 2005-01-08 07:11:17 UTC (rev 165)
@@ -41,7 +41,11 @@
#include <stdio.h>
-/* a boolean type for uim to explicitly indicate intention about values */
+/*
+ * A boolean type for uim to explicitly indicate intention about values. A
+ * true value is represented as (val != UIM_FALSE). i.e. Don't test a value
+ * with (val == UIM_TRUE).
+ */
typedef int uim_bool;
#define UIM_FALSE 0
More information about the Uim-commit
mailing list