Initialization of libguile and libmu_scm
Showing
1 changed file
with
64 additions
and
0 deletions
guimb/run_scm.c
0 → 100644
1 | /* GNU mailutils - a suite of utilities for electronic mail | ||
2 | Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. | ||
3 | |||
4 | This program is free software; you can redistribute it and/or modify | ||
5 | it under the terms of the GNU General Public License as published by | ||
6 | the Free Software Foundation; either version 2, or (at your option) | ||
7 | any later version. | ||
8 | |||
9 | This program is distributed in the hope that it will be useful, | ||
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | GNU General Public License for more details. | ||
13 | |||
14 | You should have received a copy of the GNU General Public License | ||
15 | along with this program; if not, write to the Free Software | ||
16 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ | ||
17 | |||
18 | #include "guimb.h" | ||
19 | #include <mu_scm.h> | ||
20 | |||
21 | static void _scheme_main (); | ||
22 | |||
23 | void | ||
24 | run_main (int argc, char *argv[]) | ||
25 | { | ||
26 | /* Finish creating input mailbox */ | ||
27 | collect_create_mailbox (); | ||
28 | scm_boot_guile (argc, argv, _scheme_main, NULL); | ||
29 | } | ||
30 | |||
31 | SCM _current_mailbox; | ||
32 | |||
33 | void | ||
34 | _scheme_main () | ||
35 | { | ||
36 | SCM *scm_loc; | ||
37 | |||
38 | if (debug_guile) | ||
39 | { | ||
40 | SCM_DEVAL_P = 1; | ||
41 | SCM_BACKTRACE_P = 1; | ||
42 | SCM_RECORD_POSITIONS_P = 1; | ||
43 | SCM_RESET_DEBUG_MODE; | ||
44 | } | ||
45 | |||
46 | /* Initialize scheme library */ | ||
47 | mu_scm_init (); | ||
48 | |||
49 | /* Provide basic primitives */ | ||
50 | #include <run_scm.x> | ||
51 | |||
52 | _current_mailbox = mu_scm_mailbox_create (mbox); | ||
53 | scm_loc = SCM_CDRLOC (scm_sysintern ("current-mailbox", SCM_EOL)); | ||
54 | *scm_loc = _current_mailbox; | ||
55 | |||
56 | if (program_file) | ||
57 | scm_primitive_load (scm_makfrom0str (program_file)); | ||
58 | |||
59 | if (program_expr) | ||
60 | scm_eval_0str (program_expr); | ||
61 | |||
62 | collect_drop_mailbox (); | ||
63 | |||
64 | } |
-
Please register or sign in to post a comment