]> git.donarmstrong.com Git - lilypond.git/blob - lily/kpath.cc
release: 1.3.135
[lilypond.git] / lily / kpath.cc
1 /*   
2 kpath.cc --  glue kpathsea to lily. Need some ugly kludges for gcc 2.96
3
4 source file of the GNU LilyPond music typesetter
5
6 (c) 2000--2001 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7
8  */
9
10 #include <stdio.h>
11 #include "config.h"
12
13 #define popen REALLYUGLYKLUDGE
14 #define pclose ANOTHERREALLYUGLYKLUDGE
15
16 #if HAVE_KPATHSEA_KPATHSEA_H
17 extern "C" {
18 #include <kpathsea/kpathsea.h>
19 #include <kpathsea/tex-file.h>
20 }
21 #endif
22
23 #include "kpath.hh"
24
25
26
27 char * ly_find_afm (char const * name)
28 {
29 #if (KPATHSEA && HAVE_KPSE_FIND_FILE)
30   return kpse_find_file (name, kpse_afm_format, true);
31 #endif
32   return 0;
33 }
34
35 char * ly_find_tfm (char const * name)
36 {
37 #if (KPATHSEA && HAVE_KPSE_FIND_FILE)
38   return kpse_find_file (name, kpse_tfm_format, true);
39 #endif
40   return 0;
41 }
42
43
44 void
45 ly_init_kpath (char *av0)
46 {
47 #if KPATHSEA && HAVE_KPATHSEA_KPATHSEA_H
48   /*
49    initialize kpathsea
50    */
51   kpse_set_program_name(av0, NULL);
52   kpse_maketex_option("tfm", TRUE);
53
54   /*
55     UGH: should not use DIR_DATADIR, but /var,  
56    */
57
58   /*
59     ugh: apparently the program_args is non-functional.
60    */
61   kpse_format_info[kpse_tfm_format].program ="mktextfm --destdir " DIR_DATADIR "/tfm";
62
63   kpse_format_info[kpse_tfm_format].client_path =
64     (DIR_DATADIR "/tfm" );
65   
66 #endif
67 }
68
69