X-Git-Url: https://git.donarmstrong.com/lilypond.git?a=blobdiff_plain;f=lily%2Flily-guile.cc;h=d46d4255eacdb3a68532813161f18b0fb28b59cb;hb=70616862ee425830c3c6bb63f2eec197fef9bbd7;hp=ded411da835fb6726da646beb71e6e48c969f5c9;hpb=ccbdd4aa99225a649a9fe8290f6e0c1d28e955c7;p=lilypond.git diff --git a/lily/lily-guile.cc b/lily/lily-guile.cc index ded411da83..d46d4255ea 100644 --- a/lily/lily-guile.cc +++ b/lily/lily-guile.cc @@ -33,41 +33,6 @@ ly_ch_C_eval_scm (char const*c) return gh_eval_str ((char*)c); } - -/* - Pass string to scm parser, evaluate one expression. - Return result value and #chars read. - - Thanks to Gary Houston - - Need guile-1.3.4 (>1.3 anyway) for ftell on str ports -- jcn -*/ -SCM -ly_parse_scm (char const* s, int* n) -{ - SCM str = gh_str02scm ((char*)s); - SCM port = scm_mkstrport (SCM_INUM0, str, SCM_OPN | SCM_RDNG, - "scm_eval_0str"); - SCM from = scm_ftell (port); - - SCM form; - SCM answer = SCM_UNSPECIFIED; - - /* Read expression from port */ - if (!SCM_EOF_OBJECT_P (form = scm_read (port))) - answer = scm_eval_x (form); - - SCM to = scm_ftell (port); - *n = gh_scm2int (to) - gh_scm2int (from); - - /* Don't close the port here; if we re-enter this function via a - continuation, then the next time we enter it, we'll get an error. - It's a string port anyway, so there's no advantage to closing it - early. */ - - return answer; -} - /* scm_m_quote doesn't use any env, but needs one for a good signature in GUILE. */ @@ -164,7 +129,7 @@ ly_scm2string (SCM s) char * p = gh_scm2newstr (s , &len); String r (p); - // delete p; + free (p); return r; }