This is the mail archive of the
guile@sourceware.cygnus.com
mailing list for the Guile project.
Re: [Q] How to hook up the GUILE parser?
- To: hanwen at cs dot uu dot nl
- Subject: Re: [Q] How to hook up the GUILE parser?
- From: Gary Houston <ghouston at freewire dot co dot uk>
- Date: 19 Oct 1999 18:24:30 -0000
- CC: guile at sourceware dot cygnus dot com, jantien at xs4all dot nl
- References: <14346.5416.798640.647651@dokkum.cs.uu.nl>
| Now my question: how do I set up a string port that does this, and how
| do I read back the number of characters taken from the port?
You could probably write a modified version of scm_eval_string from
libguile/strports.c that would do what you want. To get the number of
characters read, you could either look at the various read_buf
pointers in the port internals, or simply call scm_ftell or scm_seek
on the string port (assuming a recent version of Guile and that you
don't run into some bug or other).