- 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 ()));
+ LY_ASSERT_SMOB (Input, sip, 1);
+ Input *ip = unsmob<Input> (sip);
+
+ int l, ch, col, offset = 0;
+ ip->get_counts (&l, &ch, &col, &offset);
+ return scm_list_4 (ly_string2scm (ip->file_string ()),
+ 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),
+ "Return input location in @var{sip} as"
+ " @code{(file-name first-line first-column last-line last-column)}.")
+{
+
+ LY_ASSERT_SMOB (Input, sip, 1);
+ Input *ip = unsmob<Input> (sip);
+
+ return scm_list_5 (ly_string2scm (ip->file_string ()),
+ 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 ()));