mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-20 11:40:18 +02:00
* strports.c (scm_eval_0str): New function.
#include "read.h", to get prototype for scm_read. * Makefile.in (strports.o): Update dependencies. * strports.h: New prototype.
This commit is contained in:
parent
d098b5d348
commit
cd07a09755
3 changed files with 24 additions and 1 deletions
|
@ -800,7 +800,7 @@ strports.o: strports.c _scm.h __scm.h scmconfig.h \
|
|||
tags.h error.h __scm.h print.h \
|
||||
options.h pairs.h list.h gc.h gsubr.h procs.h numbers.h \
|
||||
symbols.h boolean.h strings.h vectors.h root.h ports.h async.h unif.h \
|
||||
eval.h strports.h strports.x
|
||||
eval.h read.h strports.h strports.x
|
||||
struct.o: struct.c _scm.h __scm.h scmconfig.h \
|
||||
tags.h error.h __scm.h print.h \
|
||||
options.h pairs.h list.h gc.h gsubr.h procs.h numbers.h \
|
||||
|
|
|
@ -44,6 +44,7 @@
|
|||
#include "_scm.h"
|
||||
#include "unif.h"
|
||||
#include "eval.h"
|
||||
#include "read.h"
|
||||
|
||||
#include "strports.h"
|
||||
|
||||
|
@ -227,6 +228,27 @@ scm_call_with_input_string (str, proc)
|
|||
}
|
||||
|
||||
|
||||
|
||||
/* Given a null-terminated string EXPR containing Scheme program text,
|
||||
evaluate it, and discard the result. */
|
||||
void
|
||||
scm_eval_0str (expr)
|
||||
char *expr;
|
||||
{
|
||||
SCM port = scm_mkstrport (SCM_MAKINUM (0),
|
||||
scm_makfrom0str (expr),
|
||||
SCM_OPN | SCM_RDNG,
|
||||
"scm_eval_0str");
|
||||
SCM form;
|
||||
|
||||
/* Read expressions from that port; ignore the values. */
|
||||
while ((form = scm_read (port, SCM_BOOL_F, SCM_BOOL_F)) != SCM_EOF_VAL)
|
||||
scm_eval_x (form);
|
||||
|
||||
scm_close_port (port);
|
||||
}
|
||||
|
||||
|
||||
static int noop0 SCM_P ((SCM stream));
|
||||
|
||||
static int
|
||||
|
|
|
@ -54,6 +54,7 @@ extern SCM scm_mkstrport SCM_P ((SCM pos, SCM str, long modes, char * caller));
|
|||
extern SCM scm_call_with_output_string SCM_P ((SCM proc));
|
||||
extern SCM scm_strprint_obj SCM_P ((SCM obj));
|
||||
extern SCM scm_call_with_input_string SCM_P ((SCM str, SCM proc));
|
||||
extern void scm_eval_0str SCM_P ((char *expr));
|
||||
extern void scm_init_strports SCM_P ((void));
|
||||
|
||||
#endif /* STRPORTSH */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue