6 #include "libgeda_priv.h"
8 void main_prog(void *userdata
, int argc
, char *argv
[])
15 toplevel
= s_toplevel_new();
17 s_log_init("/dev/null");
19 /* Check that we get the right return value. */
20 x
= g_scm_c_eval_string_protected("(+ 17 42)");
21 if (!scm_is_integer(x
) || scm_to_int(x
) != (17 + 42)) {
25 /* Evaluate just a number as an s-expr rather than a string. */
26 x
= g_scm_eval_protected(scm_from_int(42), scm_current_module());
27 if (!scm_is_integer(x
) || scm_to_int(x
) != 42) {
31 /* Force an exception. */
32 x
= g_scm_eval_protected(scm_list_3(scm_from_locale_symbol("throw"),
33 scm_list_2(scm_from_locale_symbol("quote"),
34 scm_from_locale_symbol("pro-forma")),
36 scm_current_module());
37 if (!scm_is_false(x
)) {
44 int main(int argc
, char *argv
[])
46 scm_boot_guile(argc
, argv
, &main_prog
, NULL
);
48 /* scm_boot_guile doesn't return! */