]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/input-scheme.cc
* ChangeLog: Recode utf-8.
[lilypond.git] / lily / input-scheme.cc
index 7f2ccf1a021084b78ef6594eae415ae5331fcbd0..51432ff9b9833886a645acbb757fe57b17634d25 100644 (file)
@@ -1,10 +1,9 @@
 /*
-  input-scheme.cc --  implement Input bindings.
+  input-scheme.cc -- implement Input bindings.
 
   source file of the GNU LilyPond music typesetter
 
   (c) 2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
 */
 
 #include "string.hh"
@@ -20,7 +19,7 @@ LY_DEFINE (ly_input, "ly:input-location?", 1, 0, 0,
 }
 
 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"
+          "Print @var{msg} as a GNU compliant error message, pointing to the"
           "location in @var{sip}.\n")
 {
   Input *ip = unsmob_input (sip);
@@ -33,18 +32,22 @@ LY_DEFINE (ly_input_message, "ly:input-message", 2, 0, 0, (SCM sip, SCM msg),
   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_int2num (l),
+                    scm_int2num (ch),
+                    scm_int2num (col));
 }
 
 LY_DEFINE (ly_input_both_locations, "ly:input-both-locations", 1, 0, 0, (SCM sip),
-         "Return input location in @var{sip} as (file-name first-line first-column last-line last-column).")
+          "Return input location in @var{sip} as (file-name first-line first-column last-line last-column).")
 {
   Input *ip = unsmob_input (sip);
   SCM_ASSERT_TYPE (ip, sip, SCM_ARG1, __FUNCTION__, "input location");