/* MacOS S fix:
source-file.hh includes cmath which undefines isinf and isnan
*/
-#ifdef MACOS_X
+#ifdef __APPLE__
inline int my_isinf (Real r) { return isinf (r); }
inline int my_isnan (Real r) { return isnan (r); }
#endif
int n;
char *str = gulp_file (s, &n);
- String result (str);
+ String result ((Byte*) str, n);
delete[] str;
if (verbose_global_b)
"The file is looked up using the search path.")
{
SCM_ASSERT_TYPE (scm_is_string (name), name, SCM_ARG1, __FUNCTION__, "string");
- return scm_makfrom0str (gulp_file_to_string (ly_scm2string (name),
- true).to_str0 ());
-
+ String contents = gulp_file_to_string (ly_scm2string (name), true);
+ return scm_from_locale_stringn (contents.get_str0 (), contents.length ());
}
if (scm_is_number (s))
{
int i = scm_to_int (s);
- return i== 0 || i == 1;
+ return i == 0 || i == 1;
}
return false;
}
if (scm_exact_p (s) == SCM_BOOL_F)
{
Real r (scm_to_double (s));
-#ifdef MACOS_X
+#ifdef __APPLE__
if (my_isinf (r) || my_isnan (r))
#else
if (isinf (r) || isnan (r))
return src;
}
-
-
+SCM
+ly_chain_assoc_get (SCM key, SCM achain, SCM dfault)
+{
+ if (scm_is_pair (achain))
+ {
+ SCM handle = scm_assoc (key, scm_car (achain));
+ if (scm_is_pair (handle))
+ return scm_cdr (handle);
+ else
+ return ly_chain_assoc (key, scm_cdr (achain));
+ }
+ else
+ return dfault;
+}
SCM
-ly_assoc_chain (SCM key, SCM achain)
+ly_chain_assoc (SCM key, SCM achain)
{
if (scm_is_pair (achain))
{
if (scm_is_pair (handle))
return handle;
else
- return ly_assoc_chain (key, scm_cdr (achain));
+ return ly_chain_assoc (key, scm_cdr (achain));
}
else
return SCM_BOOL_F;
SCM p = scm_current_output_port ();
scm_puts ("(", p);
- for (; scm_is_pair (s); s =scm_cdr (s))
+ for (; scm_is_pair (s); s = scm_cdr (s))
{
scm_display (scm_car (s), p);
scm_puts (" ", p);
return tab;
}
-#if 1
/*
Debugging mem leaks:
*/
{
return scm_protects;
}
-#endif
-
-
-#if HAVE_PANGO_FC_FONT_MAP_ADD_DECODER_FIND_FUNC
-
-#include "pangofc-afm-decoder.hh"
-
-LY_DEFINE (ly_pango_add_afm_decoder, "ly:pango-add-afm-decoder",
- 1, 0, 0, (SCM font_family),
- "Add pango afm decoder for FONT-FAMILY.")
-{
- SCM_ASSERT_TYPE (scm_is_string (font_family), font_family, SCM_ARG1,
- __FUNCTION__, "font_family");
- pango_fc_afm_add_decoder (ly_scm2newstr (font_family, 0));
- return SCM_UNSPECIFIED;
-}
-
-#endif
LY_DEFINE (ly_gettext, "ly:gettext",
1, 0, 0, (SCM string),