Method

GLibMarkupParseContextget_attribute_position

unstable since: 2.90

Declaration [src]

void
g_markup_parse_context_get_attribute_position (
  GMarkupParseContext* context,
  unsigned int attr,
  size_t* start_lines,
  size_t* start_chars,
  size_t* start_offset,
  size_t* end_lines,
  size_t* end_chars,
  size_t* end_offset
)

Description [src]

Retrieves the start and end positions of an attribute assignment in a start tag.

This function can be used in the start_element callback to obtain location information for error reporting.

Calling it outside of the start_element callback has undefined results.

Note that line_number and char_number are intended for human readable error messages and are therefore 1-based and in Unicode characters. offset on the other hand is meant for programmatic use, and thus is 0-based and in bytes.

The information is meant to accompany the values returned by g_markup_parse_context_get_position(), and comes with the same accuracy guarantees.

Available since: 2.90

Parameters

attr

Type: unsigned int

The index of the attribute to query.

start_lines

Type: size_t*

Return location for the line number of the attribute assignment start.

The argument will be set by the function.
The argument can be NULL.
start_chars

Type: size_t*

Return location for the character number of the attribute assignment start.

The argument will be set by the function.
The argument can be NULL.
start_offset

Type: size_t*

Return location for offset of the attribute assignment.

The argument will be set by the function.
The argument can be NULL.
end_lines

Type: size_t*

Return location for the line number of the attribute assignment end.

The argument will be set by the function.
The argument can be NULL.
end_chars

Type: size_t*

Return location for the character number of the attribute assignment end.

The argument will be set by the function.
The argument can be NULL.
end_offset

Type: size_t*

Return location for offset of the attribute assignment end.

The argument will be set by the function.
The argument can be NULL.