]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/input-scheme.cc
(pango_item_string_stencil): put
[lilypond.git] / lily / input-scheme.cc
index 4c771f0049b538ad63b90dc6d341fa9a74304ee3..f3b8c4e52f42e6df936151504dd5e20253398b45 100644 (file)
@@ -18,28 +18,34 @@ LY_DEFINE (ly_input, "ly:input-location?", 1, 0, 0,
   return unsmob_input (x) ? SCM_BOOL_T : SCM_BOOL_F;
 }
 
-LY_DEFINE (ly_input_message, "ly:input-message", 2, 0, 0, (SCM sip, SCM msg),
-          "Print @var{msg} as a GNU compliant error message, pointing to the"
-          "location in @var{sip}.\n")
+LY_DEFINE (ly_input_message, "ly:input-message", 2, 0, 1, (SCM sip, SCM msg, SCM rest),
+          "Print @var{msg} as a GNU compliant error message, pointing to the "
+          "location in @var{sip}. @var{msg} is interpreted similar to @code{format}'s argument\n")
 {
   Input *ip = unsmob_input (sip);
   SCM_ASSERT_TYPE (ip, sip, SCM_ARG1, __FUNCTION__, "input location");
   SCM_ASSERT_TYPE (scm_is_string (msg), msg, SCM_ARG2, __FUNCTION__, "string");
 
+  msg = scm_simple_format (SCM_BOOL_F, msg, rest);
+
   String m = ly_scm2string (msg);
   ip->message (m);
 
   return SCM_UNSPECIFIED;
 }
 
-LY_DEFINE (ly_input_file_line_column, "ly:input-file-line-column", 1, 0, 0, (SCM sip),
-          "Return input location in @var{sip} as (file-name line column).")
+LY_DEFINE (ly_input_file_line_column, "ly:input-file-line-char-column", 1, 0, 0, (SCM sip),
+          "Return input location in @var{sip} as (file-name line char column).")
 {
   Input *ip = unsmob_input (sip);
   SCM_ASSERT_TYPE (ip, sip, SCM_ARG1, __FUNCTION__, "input location");
-  return scm_list_3 (scm_makfrom0str (ip->file_string ().to_str0 ()),
-                    scm_int2num (ip->line_number ()),
-                    scm_int2num (ip->column_number ()));
+
+  int l, ch, col;
+  ip->get_counts (&l, &ch, &col);
+  return scm_list_4 (scm_makfrom0str (ip->file_string ().to_str0 ()),
+                    scm_from_int (l),
+                    scm_from_int (ch),
+                    scm_from_int (col));
 }
 
 LY_DEFINE (ly_input_both_locations, "ly:input-both-locations", 1, 0, 0, (SCM sip),
@@ -48,8 +54,8 @@ LY_DEFINE (ly_input_both_locations, "ly:input-both-locations", 1, 0, 0, (SCM sip
   Input *ip = unsmob_input (sip);
   SCM_ASSERT_TYPE (ip, sip, SCM_ARG1, __FUNCTION__, "input location");
   return scm_list_5 (scm_makfrom0str (ip->file_string ().to_str0 ()),
-                    scm_int2num (ip->line_number ()),
-                    scm_int2num (ip->column_number ()),
-                    scm_int2num (ip->end_line_number ()),
-                    scm_int2num (ip->end_column_number ()));
+                    scm_from_int (ip->line_number ()),
+                    scm_from_int (ip->column_number ()),
+                    scm_from_int (ip->end_line_number ()),
+                    scm_from_int (ip->end_column_number ()));
 }