From c63c25ac3116eb41f12d230e1e570b68afcef28b Mon Sep 17 00:00:00 2001 From: fred Date: Tue, 26 Mar 2002 23:56:10 +0000 Subject: [PATCH] lilypond-1.3.91 --- lily/all-font-metrics.cc | 20 +++++--------- lily/include/kpath.hh | 22 ++++++++++++++++ lily/include/lily-guile.hh | 2 +- lily/kpath.cc | 54 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 84 insertions(+), 14 deletions(-) create mode 100644 lily/include/kpath.hh create mode 100644 lily/kpath.cc diff --git a/lily/all-font-metrics.cc b/lily/all-font-metrics.cc index 215e7b3b09..d7ec2a94fb 100644 --- a/lily/all-font-metrics.cc +++ b/lily/all-font-metrics.cc @@ -16,13 +16,11 @@ #include "tfm.hh" #include "lily-guile.hh" #include "scm-hash.hh" +#include "kpath.hh" + + -#if HAVE_KPATHSEA_KPATHSEA_H -extern "C" { -#include -} -#endif const char * default_font_sz_ = "cmr10"; @@ -53,15 +51,13 @@ All_font_metrics::find_afm (String name) if (path.empty_b()) path = search_path_.find (name + ".afm"); -#if (KPATHSEA && HAVE_KPSE_FIND_FILE) if (path.empty_b ()) { - char * p = kpse_find_file (name.ch_C(), kpse_afm_format, true); + char * p = ly_find_afm (name.ch_C()); if (p) path = p; } -#endif - + if (path.empty_b()) return 0; @@ -108,15 +104,13 @@ All_font_metrics::find_tfm (String name) { String path; -//#if KPATHSEA && HAVE_KPSE_FIND_TFM -- urg: a macro -#if KPATHSEA && HAVE_KPSE_FIND_FILE if (path.empty_b()) { - char * p = kpse_find_tfm (name.ch_C()); + char * p = ly_find_tfm (name.ch_C()); if (p) path = p; } -#endif + if (path.empty_b()) path = search_path_.find (name + ".tfm"); if (path.empty_b()) diff --git a/lily/include/kpath.hh b/lily/include/kpath.hh new file mode 100644 index 0000000000..7bd89c82e4 --- /dev/null +++ b/lily/include/kpath.hh @@ -0,0 +1,22 @@ +/* +kpath.hh -- declare kpath funcs. + +source file of the GNU LilyPond music typesetter + +(c) 2000 Han-Wen Nienhuys + + */ + +#ifndef KPATH_HH +#define KPATH_HH + + + +char * ly_find_afm (char const * name); +char * ly_find_tfm (char const * name); +void ly_init_kpath (char *av0); + + + +#endif /* KPATH_HH */ + diff --git a/lily/include/lily-guile.hh b/lily/include/lily-guile.hh index 36ed954f41..7d5bef2265 100644 --- a/lily/include/lily-guile.hh +++ b/lily/include/lily-guile.hh @@ -90,7 +90,7 @@ void \ TYPE ## _ ## FUNC ## _init_functions () \ { \ TYPE ## _ ## FUNC ## _proc = gh_new_procedure1_0 (#TYPE "::" #FUNC, \ - (SCM(*)(...))TYPE :: FUNC); \ + (SCM(*)(SCM))TYPE :: FUNC); \ } \ \ ADD_SCM_INIT_FUNC(TYPE ## _ ## FUNC ## _callback, TYPE ## _ ## FUNC ## _init_functions); \ diff --git a/lily/kpath.cc b/lily/kpath.cc new file mode 100644 index 0000000000..022f929ec3 --- /dev/null +++ b/lily/kpath.cc @@ -0,0 +1,54 @@ +/* +kpath.cc -- glue kpathsea to lily. Need some ugly kludges for gcc 2.96 + +source file of the GNU LilyPond music typesetter + +(c) 2000 Han-Wen Nienhuys + + */ + +#include +#include "config.h" + +#define popen REALLYUGLYKLUDGE +#define pclose ANOTHERREALLYUGLYKLUDGE + +#if HAVE_KPATHSEA_KPATHSEA_H +extern "C" { +#include +#include +} +#endif + +#include "kpath.hh" + + + +char * ly_find_afm (char const * name) +{ +#if (KPATHSEA && HAVE_KPSE_FIND_FILE) + return kpse_find_file (name, kpse_afm_format, true); +#endif + return 0; +} + +char * ly_find_tfm (char const * name) +{ +#if (KPATHSEA && HAVE_KPSE_FIND_FILE) + return kpse_find_file (name, kpse_tfm_format, true); +#endif + return 0; +} + + +void +ly_init_kpath (char *av0) +{ +#if KPATHSEA && HAVE_KPATHSEA_KPATHSEA_H + /* + initialize kpathsea + */ + kpse_set_program_name(av0, NULL); + kpse_maketex_option("tfm", TRUE); +#endif +} -- 2.39.5