[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: calling guile from C
From: |
Rob Browning |
Subject: |
Re: calling guile from C |
Date: |
Thu, 15 Nov 2001 21:03:23 -0600 |
User-agent: |
Gnus/5.090004 (Oort Gnus v0.04) Emacs/21.1 |
"Brian McAndrews" <address@hidden> writes:
> I have wrapped up some C functions so that they can be called from guile.
> What I want to do now, is call guile from my C program. The question I have
> is how do I set it up so that I run scm_boot_guile when I start my program,
> but then have the ability to call into guile whenever I want? It seems that
> I need an event loop to handle callbacks into guile, otherwise I'd have to
> call scm_boot_guile each time I wanted to make a call. Surely others have
> dealt with this.
All you have to do is use scm_init_guile or scm_boot_guile, and if the
latter, you call it with your normal main function as an argument.
After that, your C code can go on with it's business, but you can call
gh_eval_str, scm_c_module_lookup, gh_call, etc. whenever you like.
--
Rob Browning
rlb @defaultvalue.org, @linuxdevel.com, and @debian.org
Previously @cs.utexas.edu
GPG=1C58 8B2C FB5E 3F64 EA5C 64AE 78FE E5FE F0CB A0AD