+2002-09-21 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+
+ * lily/main.cc: small cleanups.
+
2002-09-20 Han-Wen Nienhuys <hanwen@cs.uu.nl>
- * lily/ly-module.cc: new file.
+ * lily/ly-module.{cc,hh}: new file.
2002-09-17 Rune Zedeler <rune@zedeler.dk>
#ifndef LY_MODULES_HH
#define LY_MODULES_HH
+#include "lily-guile.hh"
+
SCM ly_make_anonymous_module ();
void ly_copy_module_variables (SCM dest, SCM src);
SCM ly_module_to_alist (SCM mod);
SCM ly_module_lookup (SCM module, SCM sym);
SCM ly_module_symbols (SCM mod);
void ly_reexport_module (SCM mod);
+inline bool ly_module_p (SCM x) { return SCM_MODULEP(x); }
#endif /* LY_MODULES_HH */
ly_init_guile ()
{
lily_module = scm_c_define_module ("lily", ly_init_ly_module, 0);
+ scm_c_use_module ("lily");
}
unsigned int ly_scm_hash (SCM s)
#include "string.hh"
#include "lily-guile.hh"
#include "ly-modules.hh"
+#define FUNC_NAME __FUNCTION__
static int module_count;
void
ly_copy_module_variables (SCM dest, SCM src)
{
+ #define FUNC_NAME __FUNCTION__
+ SCM_VALIDATE_MODULE (1, src);
+
SCM obarr= SCM_MODULE_OBARRAY(src);
SCM syms = SCM_EOL;
SCM
ly_module_symbols (SCM mod)
{
+ SCM_VALIDATE_MODULE (1, mod);
+
SCM obarr= SCM_MODULE_OBARRAY(mod);
SCM syms = SCM_EOL;
SCM
ly_module_to_alist (SCM mod)
{
+ SCM_VALIDATE_MODULE (1, mod);
+
+
SCM obarr= SCM_MODULE_OBARRAY(mod);
SCM alist = SCM_EOL;
SCM
ly_module_lookup (SCM module, SCM sym)
{
- SCM var;
#define FUNC_NAME __FUNCTION__
SCM_VALIDATE_MODULE (1, module);
- var = scm_sym2var (sym, scm_module_lookup_closure (module), SCM_BOOL_F);
- return var;
+ return scm_sym2var (sym, scm_module_lookup_closure (module), SCM_BOOL_F);
}
SCM export_function ;
/* Where LilyPond's init files live. Typically:
LILYPOND_DATADIR = /usr/local/share/lilypond
LOCAL_LILYPOND_DATADIR = /usr/local/share/lilypond/1.5.68 */
-char const *prefix_directory[2] = {LILYPOND_DATADIR, LOCAL_LILYPOND_DATADIR};
+char const *prefix_directory[] = {LILYPOND_DATADIR, LOCAL_LILYPOND_DATADIR, 0};
void
setup_paths ()
LILYPONDPREFIX to lilypond-x.y.z */
char *suffixes[] = {"ly", "afm", "mf/out", "scm", "tfm", "ps", 0};
- for (unsigned i = 0; i < sizeof (prefix_directory)
- / sizeof (*prefix_directory); i++)
+ for (unsigned i = 0; prefix_directory[i]; i++)
for (char **s = suffixes; *s; s++)
{
String p = prefix_directory[i] + to_string ('/') + String (*s);
/* Engravers use lily.scm contents, need to make Guile find it.
Prepend onto GUILE %load-path, very ugh. */
- for (unsigned i = 0; i < sizeof (prefix_directory)
- / sizeof (*prefix_directory); i++)
+ for (unsigned i = 0; prefix_directory[i]; i++)
{
prepend_load_path (prefix_directory[i]);
+
/* Junk this. We should make real modules iso. just loading files. */
prepend_load_path (String (prefix_directory[i]) + "/scm");
}
void
Paper_outputter::write_header_fields_to_file (SCM mod)
{
-
- if (dump_header_fieldnames_global.size ())
+ if (ly_module_p (mod)&&
+ dump_header_fieldnames_global.size ())
{
SCM fields = ly_module_to_alist (mod);
for (int i = 0; i < dump_header_fieldnames_global.size (); i++)
(define-public security-paranoia #f)
-(define (line-column-location line col file)
+(define-public (line-column-location line col file)
"Print an input location, including column number ."
(string-append (number->string line) ":"
(number->string col) " " file)
)
-(define (line-location line col file)
+(define-public (line-location line col file)
"Print an input location, without column number ."
(string-append (number->string line) " " file)
)
latex_cmd = 'latex'
tex_extension = '.tex'
pdftex_p = 0
+binary = 'lilypond'
+#binary = 'valgrind --suppressions=%(home)s/usr/src/guile-1.6.supp --num-callers=10 %(home)s/usr/src/lilypond/lily/out/lilypond '% { 'home' : '/home/hanwen' }
help_summary = _ ("Run LilyPond using LaTeX for titling")
# for better debugging!
print_environment ()
- cmd = 'lilypond %s %s ' % (opts, fs)
+ cmd = '%s %s %s ' % (binary, opts, fs)
if verbose_p:
progress ("Invoking `%s'"% cmd)
status = os.system (cmd)