lily functions in safe mode.
* lily/paper-outputter.cc (Paper_outputter): Eval output-ps in
safe mode.
2004-03-14 Jan Nieuwenhuizen <janneke@gnu.org>
+ * lily/parse-scm.cc (internal_ly_parse_scm)[PAGE_LAYOUT]: Import
+ lily functions in safe mode.
+
* scripts/lilypond-book.py (Lilypond_snippet.output_texinfo):
Print filename for HTML, LATEX, before texidoc.
* scm/lily.scm: Do not load output-ps module.
- * lily/paper-outputter.cc (Paper_outputter): Attempt to eval
- output-ps in safe mode.
+ * lily/paper-outputter.cc (Paper_outputter): Eval output-ps in
+ safe mode.
2004-03-14 Han-Wen Nienhuys <hanwen@xs4all.nl>
return result;
}
-LY_DEFINE (ly_gulp_file, "ly:gulp-file", 1,0, 0,
- (SCM name),
- "Read the file @var{name}, and return its contents in a string. The "
-" file is looked up using the search path.")
+LY_DEFINE (ly_gulp_file, "ly:gulp-file",
+ 1, 0, 0, (SCM name),
+ "Read the file @var{name}, and return its contents in a string. "
+ "The file is looked up using the search path.")
{
return scm_makfrom0str (gulp_file_to_string (ly_scm2string (name)).to_str0 ());
}
else
output_module_ = scm_c_resolve_module (name.to_str0 ());
+ /* FIXME: output-lib should be module, that can be imported. */
#define IMPORT_LESS 1 // only import the list of IMPORTS
#if IMPORT_LESS
scm_c_use_module ("lily");
"ly:output-def-scope",
"ly:gulp-file",
"ly:number->string",
- "assoc-get",
- "number-pair->string",
- "inexact->string",
+
+ "number-pair->string", /* output-lib.scm */
"numbers->string",
+
+ "assoc-get",
+ "inexact->string", /* insecure guile? */
#if IMPORT_LESS
"string-index", /* from srfi srfi-13 */
"regexp-substitute/global", /* from (ice9 regex) */
#include <stdio.h>
+#include "ly-module.hh"
#include "lily-guile.hh"
#include "parse-scm.hh"
#include "string.hh"
{
static SCM safe_module;
if (!safe_module)
- safe_module = scm_primitive_eval (ly_symbol2scm ("safe-module"));
+ {
+ safe_module = scm_primitive_eval (ly_symbol2scm ("safe-module"));
+ if (output_format_global == PAGE_LAYOUT)
+ ly_import_module (safe_module, scm_c_resolve_module ("lily"));
+ }
answer = scm_eval (form, safe_module);
}
else