lilypond-1.3.91
authorfred <fred>
Tue, 26 Mar 2002 23:56:10 +0000 (23:56 +0000)
committerfred <fred>
Tue, 26 Mar 2002 23:56:10 +0000 (23:56 +0000)
lily/all-font-metrics.cc
lily/include/kpath.hh [new file with mode: 0644]
lily/include/lily-guile.hh
lily/kpath.cc [new file with mode: 0644]

index 215e7b3b09b8b33148e51d0407a1af0e35282fb7..d7ec2a94fb565bc40986424eacac9fb011e1cbc5 100644 (file)
 #include "tfm.hh"
 #include "lily-guile.hh"
 #include "scm-hash.hh"
+#include "kpath.hh"
+
+
 
 
-#if HAVE_KPATHSEA_KPATHSEA_H
-extern "C" {
-#include <kpathsea/kpathsea.h>
-}
-#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 (file)
index 0000000..7bd89c8
--- /dev/null
@@ -0,0 +1,22 @@
+/*   
+kpath.hh -- declare kpath funcs.
+
+source file of the GNU LilyPond music typesetter
+
+(c) 2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+
+ */
+
+#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 */
+
index 36ed954f41c271de40ec50dfecb9e8b1dc7f4856..7d5bef226521ab959069bc79cb846eabeeb46ef3 100644 (file)
@@ -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 (file)
index 0000000..022f929
--- /dev/null
@@ -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 <hanwen@cs.uu.nl>
+
+ */
+
+#include <stdio.h>
+#include "config.h"
+
+#define popen REALLYUGLYKLUDGE
+#define pclose ANOTHERREALLYUGLYKLUDGE
+
+#if HAVE_KPATHSEA_KPATHSEA_H
+extern "C" {
+#include <kpathsea/kpathsea.h>
+#include <kpathsea/tex-file.h>
+}
+#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
+}