6 #include "libgeda_priv.h"
8 void main_prog(void *userdata
, int argc
, char *argv
[])
11 SCM magic_value
, gensym
, x
;
12 int exception_caught
= 0;
17 s_log_init("/dev/null");
19 toplevel
= s_toplevel_new();
21 magic_value
= scm_from_locale_symbol("magic");
22 scm_c_define("magic-value", magic_value
);
24 /* Check that we can look up a known variable. */
25 x
= g_scm_safe_ref_lookup("magic-value");
26 if (!scm_is_symbol(x
) || !scm_is_eq(x
, magic_value
)) {
30 /* Generate a quasi-unique name that won't be bound. */
31 gensym
= scm_gensym(scm_from_locale_string(" safereflookup"));
32 undefined_name
= scm_to_locale_string(scm_symbol_to_string(gensym
));
34 /* Force an exception. */
35 x
= g_scm_safe_ref_lookup(undefined_name
);
37 if (!scm_is_eq(x
, SCM_UNDEFINED
)) {
44 int main(int argc
, char *argv
[])
46 scm_boot_guile(argc
, argv
, &main_prog
, NULL
);
48 /* scm_boot_guile doesn't return! */