|
YATL
|
Functions for navigating and iterating through spans. More...
Functions | |
| YATL_Result_t | YATL_doc_span (const YATL_Doc_t *doc, YATL_Span_t *out_span) |
| Get a span covering the entire document. | |
| YATL_Result_t | YATL_span_find_next (const YATL_Span_t *in_span, YATL_Cursor_t *cursor, YATL_Span_t *out_span) |
| Find the next span within a boundary span. | |
| YATL_Result_t | YATL_span_find_name (const YATL_Span_t *in_span, const char *name, YATL_Span_t *out_span) |
| Find a table or key-value by name. | |
| YATL_Result_t | YATL_span_find_next_by_name (const YATL_Span_t *in_span, const char *name, const YATL_Cursor_t *in_cursor, YATL_Cursor_t *out_cursor, YATL_Span_t *out_span) |
| Find next table or key-value by name with cursor support. | |
| YATL_Result_t | YATL_span_iter_line (const YATL_Span_t *span, YATL_Cursor_t *cursor, const char **out_text, size_t *out_len) |
| Iterate over line segments within a span. | |
| YATL_Result_t | YATL_cursor_move (YATL_Cursor_t *cursor, long npos) |
| Move a cursor by a character offset. | |
Functions for navigating and iterating through spans.
| YATL_Result_t YATL_cursor_move | ( | YATL_Cursor_t * | cursor, |
| long | npos ) |
Move a cursor by a character offset.
Moves the cursor forward (positive) or backward (negative) by the specified number of characters, crossing line boundaries as needed.
| cursor | Cursor to move |
| npos | Number of positions to move (negative for backward) |
| YATL_Result_t YATL_doc_span | ( | const YATL_Doc_t * | doc, |
| YATL_Span_t * | out_span ) |
Get a span covering the entire document.
Creates a span of type YATL_S_NONE that encompasses all lines in the document.
| doc | Pointer to document |
| out_span | Output span covering the document |
| YATL_Result_t YATL_span_find_name | ( | const YATL_Span_t * | in_span, |
| const char * | name, | ||
| YATL_Span_t * | out_span ) |
Find a table or key-value by name.
Searches for the first TABLE, ARRAY_TABLE, or KEYVAL with the specified name within in_span.
| in_span | Span to search within |
| name | Name to search for (literal match, including dots) |
| out_span | Output span for the found element |
| YATL_Result_t YATL_span_find_next | ( | const YATL_Span_t * | in_span, |
| YATL_Cursor_t * | cursor, | ||
| YATL_Span_t * | out_span ) |
Find the next span within a boundary span.
Iterates through spans within in_span. Use with a cursor to iterate through all children of a span.
| in_span | Boundary span to search within |
| cursor | Cursor tracking iteration position (NULL to start from beginning). Initialize with YATL_cursor_create(). Advanced automatically. |
| out_span | Output span for the found element |
| YATL_Result_t YATL_span_find_next_by_name | ( | const YATL_Span_t * | in_span, |
| const char * | name, | ||
| const YATL_Cursor_t * | in_cursor, | ||
| YATL_Cursor_t * | out_cursor, | ||
| YATL_Span_t * | out_span ) |
Find next table or key-value by name with cursor support.
Like YATL_span_find_name() but supports iteration to find multiple elements with the same name (e.g., array of tables).
| in_span | Span to search within |
| name | Name to search for |
| in_cursor | Starting position (NULL to start from beginning) |
| out_cursor | Output cursor position after match (NULL to ignore) |
| out_span | Output span for the found element |
| YATL_Result_t YATL_span_iter_line | ( | const YATL_Span_t * | span, |
| YATL_Cursor_t * | cursor, | ||
| const char ** | out_text, | ||
| size_t * | out_len ) |
Iterate over line segments within a span.
For multi-line spans, iterates through each line segment, returning the text portion within the span boundaries.
| span | Span to iterate |
| cursor | Cursor tracking iteration (initialize with YATL_cursor_create()) |
| out_text | Output pointer to line text (not null-terminated) |
| out_len | Output length of line segment |