tinyxml2-capi 0.1.16

C FFI compatibility layer for tinyxml2-rs
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
#ifndef TINYXML2_RS_H
#define TINYXML2_RS_H

#pragma once

#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>

/**
 * C-compatible error code enum matching `TinyXML2` error values.
 */
typedef enum TxError {
    /**
     * Operation completed successfully.
     */
    TxSuccess = 0,
    /**
     * The document was empty or contained no XML content.
     */
    TxErrorEmptyDocument = 1,
    /**
     * Error while parsing an element.
     */
    TxErrorParsingElement = 2,
    /**
     * Error while parsing an attribute.
     */
    TxErrorParsingAttribute = 3,
    /**
     * Error while parsing text content.
     */
    TxErrorParsingText = 4,
    /**
     * Error while parsing a CDATA section.
     */
    TxErrorParsingCdata = 5,
    /**
     * Error while parsing a comment.
     */
    TxErrorParsingComment = 6,
    /**
     * Error while parsing a declaration.
     */
    TxErrorParsingDeclaration = 7,
    /**
     * Error while parsing an unknown construct.
     */
    TxErrorParsingUnknown = 8,
    /**
     * An element's closing tag did not match its opening tag.
     */
    TxErrorMismatchedElement = 9,
    /**
     * The specified file was not found.
     */
    TxErrorFileNotFound = 10,
    /**
     * An error occurred while reading/writing a file.
     */
    TxErrorFileRead = 11,
    /**
     * The maximum element nesting depth was exceeded.
     */
    TxErrorElementDepthExceeded = 12,
    /**
     * The requested attribute does not exist.
     */
    TxErrorNoAttribute = 13,
    /**
     * The attribute value could not be converted to the requested type.
     */
    TxErrorWrongAttributeType = 14,
    /**
     * Text content could not be converted to the requested type.
     */
    TxErrorCanNotConvertText = 15,
    /**
     * No text node was found as a child of the element.
     */
    TxErrorNoTextNode = 16,
    /**
     * The provided node ID is invalid or refers to a freed node.
     */
    TxErrorInvalidNodeId = 17,
} TxError;

/**
 * C-compatible representation of the XML node type.
 */
typedef enum TxNodeType {
    /**
     * The document root node.
     */
    TxNodeDocument = 0,
    /**
     * An XML element (tag).
     */
    TxNodeElement = 1,
    /**
     * A text content node.
     */
    TxNodeText = 2,
    /**
     * An XML comment (`<!-- ... -->`).
     */
    TxNodeComment = 3,
    /**
     * An XML declaration (`<?xml ... ?>`).
     */
    TxNodeDeclaration = 4,
    /**
     * An unrecognized XML construct.
     */
    TxNodeUnknown = 5,
} TxNodeType;

/**
 * A C-compatible node identifier.
 *
 * This is a `#[repr(C)]` mirror of the internal `NodeId` type. It carries
 * both an arena index and a generation counter for use-after-free detection.
 */
typedef struct TxNodeId {
    /**
     * Index into the document's node arena.
     */
    uint32_t index;
    /**
     * Generation counter for validity checking.
     */
    uint32_t generation;
} TxNodeId;

/**
 * Sentinel value representing a null / invalid node.
 *
 * Any function that would return "no node" returns this sentinel.
 * Use [`tx_node_is_null`](crate::tx_node_is_null) to test for it.
 */
#define TX_NULL_NODE (TxNodeId){ .index = UINT32_MAX, .generation = 0 }

#ifdef __cplusplus
extern "C" {
#endif // __cplusplus

/**
 * Creates a new, empty XML document.
 *
 * The returned pointer must eventually be freed with [`tx_document_free`].
 *
 * # Safety
 *
 * The caller must free the returned pointer with [`tx_document_free`] when
 * done. Returns null on allocation failure.
 */
TxDocument *tx_document_new(void);

/**
 * Frees a document previously created with [`tx_document_new`].
 *
 * # Safety
 *
 * `doc` must be a valid pointer returned by [`tx_document_new`], or null.
 * After this call, the pointer must not be used again.
 */
void tx_document_free(TxDocument *doc);

/**
 * Clears the document, removing all nodes and resetting to an empty state.
 *
 * # Safety
 *
 * `doc` must be a valid, non-null pointer to a `TxDocument`.
 */
void tx_document_clear(TxDocument *doc);

/**
 * Parses an XML string into the document, replacing any existing content.
 *
 * # Safety
 *
 * - `doc` must be a valid, non-null pointer to a `TxDocument`.
 * - `xml` must be a valid, non-null pointer to a null-terminated UTF-8 C string.
 */
enum TxError tx_document_parse(TxDocument *doc, const char *xml);

/**
 * Loads and parses an XML file.
 *
 * # Safety
 *
 * - `doc` must be a valid, non-null pointer to a `TxDocument`.
 * - `path` must be a valid, non-null pointer to a null-terminated UTF-8 C string
 *   containing a filesystem path.
 */
enum TxError tx_document_load_file(TxDocument *doc, const char *path);

/**
 * Saves the document to a file (pretty-printed).
 *
 * # Safety
 *
 * - `doc` must be a valid, non-null pointer to a `TxDocument`.
 * - `path` must be a valid, non-null pointer to a null-terminated UTF-8 C string
 *   containing a filesystem path.
 */
enum TxError tx_document_save_file(const TxDocument *doc, const char *path);

/**
 * Returns the pretty-printed XML string for the document.
 *
 * The returned pointer is valid until the next mutating operation on the
 * document or until the document is freed.
 *
 * # Safety
 *
 * `doc` must be a valid, non-null pointer to a `TxDocument`.
 */
const char *tx_document_to_string(TxDocument *doc);

/**
 * Returns the compact XML string for the document.
 *
 * The returned pointer is valid until the next mutating operation on the
 * document or until the document is freed.
 *
 * # Safety
 *
 * `doc` must be a valid, non-null pointer to a `TxDocument`.
 */
const char *tx_document_to_string_compact(TxDocument *doc);

/**
 * Returns the current error code of the document.
 *
 * Returns [`TxError::TxSuccess`] if no error has occurred.
 *
 * # Safety
 *
 * `doc` must be a valid, non-null pointer to a `TxDocument`.
 */
enum TxError tx_document_error(const TxDocument *doc);

/**
 * Returns the line number of the current error, or 0 if no error.
 *
 * # Safety
 *
 * `doc` must be a valid, non-null pointer to a `TxDocument`.
 */
int tx_document_error_line(const TxDocument *doc);

/**
 * Returns the error name string, or null if no error.
 *
 * The returned pointer is valid until the next mutating operation on the
 * document or until the document is freed.
 *
 * # Safety
 *
 * `doc` must be a valid, non-null pointer to a `TxDocument`.
 */
const char *tx_document_error_name(TxDocument *doc);

/**
 * Creates a new element node with the given tag name.
 *
 * # Safety
 *
 * - `doc` must be a valid, non-null pointer to a `TxDocument`.
 * - `name` must be a valid, non-null pointer to a null-terminated UTF-8 string.
 */
struct TxNodeId tx_new_element(TxDocument *doc, const char *name);

/**
 * Creates a new text node with the given content.
 *
 * # Safety
 *
 * - `doc` must be a valid, non-null pointer to a `TxDocument`.
 * - `text` must be a valid, non-null pointer to a null-terminated UTF-8 string.
 */
struct TxNodeId tx_new_text(TxDocument *doc, const char *text);

/**
 * Creates a new comment node.
 *
 * # Safety
 *
 * - `doc` must be a valid, non-null pointer to a `TxDocument`.
 * - `text` must be a valid, non-null pointer to a null-terminated UTF-8 string.
 */
struct TxNodeId tx_new_comment(TxDocument *doc, const char *text);

/**
 * Creates a new declaration node.
 *
 * # Safety
 *
 * - `doc` must be a valid, non-null pointer to a `TxDocument`.
 * - `text` must be a valid, non-null pointer to a null-terminated UTF-8 string.
 */
struct TxNodeId tx_new_declaration(TxDocument *doc, const char *text);

/**
 * Creates a new "unknown" node.
 *
 * # Safety
 *
 * - `doc` must be a valid, non-null pointer to a `TxDocument`.
 * - `text` must be a valid, non-null pointer to a null-terminated UTF-8 string.
 */
struct TxNodeId tx_new_unknown(TxDocument *doc, const char *text);

/**
 * Inserts `child` as the last child of `parent`.
 *
 * # Safety
 *
 * `doc` must be a valid, non-null pointer to a `TxDocument`.
 */
enum TxError tx_insert_end_child(TxDocument *doc, struct TxNodeId parent, struct TxNodeId child);

/**
 * Inserts `child` as the first child of `parent`.
 *
 * # Safety
 *
 * `doc` must be a valid, non-null pointer to a `TxDocument`.
 */
enum TxError tx_insert_first_child(TxDocument *doc, struct TxNodeId parent, struct TxNodeId child);

/**
 * Inserts `child` as the next sibling after `after`.
 *
 * # Safety
 *
 * `doc` must be a valid, non-null pointer to a `TxDocument`.
 */
enum TxError tx_insert_after_child(TxDocument *doc, struct TxNodeId after, struct TxNodeId child);

/**
 * Deletes `child` from `parent`.
 *
 * # Safety
 *
 * `doc` must be a valid, non-null pointer to a `TxDocument`.
 */
enum TxError tx_delete_child(TxDocument *doc, struct TxNodeId parent, struct TxNodeId child);

/**
 * Deletes all children of `parent`.
 *
 * # Safety
 *
 * `doc` must be a valid, non-null pointer to a `TxDocument`.
 */
enum TxError tx_delete_children(TxDocument *doc, struct TxNodeId parent);

/**
 * Deletes a node and all its descendants from the document.
 *
 * # Safety
 *
 * `doc` must be a valid, non-null pointer to a `TxDocument`.
 */
enum TxError tx_delete_node(TxDocument *doc, struct TxNodeId node);

/**
 * Returns the parent of the given node, or `TX_NULL_NODE` if none.
 *
 * # Safety
 *
 * `doc` must be a valid, non-null pointer to a `TxDocument`.
 */
struct TxNodeId tx_parent(const TxDocument *doc, struct TxNodeId node);

/**
 * Returns the first child of the given node, or `TX_NULL_NODE` if none.
 *
 * # Safety
 *
 * `doc` must be a valid, non-null pointer to a `TxDocument`.
 */
struct TxNodeId tx_first_child(const TxDocument *doc, struct TxNodeId node);

/**
 * Returns the last child of the given node, or `TX_NULL_NODE` if none.
 *
 * # Safety
 *
 * `doc` must be a valid, non-null pointer to a `TxDocument`.
 */
struct TxNodeId tx_last_child(const TxDocument *doc, struct TxNodeId node);

/**
 * Returns the previous sibling of the given node, or `TX_NULL_NODE` if none.
 *
 * # Safety
 *
 * `doc` must be a valid, non-null pointer to a `TxDocument`.
 */
struct TxNodeId tx_prev_sibling(const TxDocument *doc, struct TxNodeId node);

/**
 * Returns the next sibling of the given node, or `TX_NULL_NODE` if none.
 *
 * # Safety
 *
 * `doc` must be a valid, non-null pointer to a `TxDocument`.
 */
struct TxNodeId tx_next_sibling(const TxDocument *doc, struct TxNodeId node);

/**
 * Returns the first child element, optionally filtered by tag name.
 *
 * If `name` is null, returns the first child element regardless of its name.
 *
 * # Safety
 *
 * - `doc` must be a valid, non-null pointer to a `TxDocument`.
 * - `name`, if non-null, must be a valid null-terminated UTF-8 string.
 */
struct TxNodeId tx_first_child_element(const TxDocument *doc,
                                       struct TxNodeId node,
                                       const char *name);

/**
 * Returns the next sibling element, optionally filtered by tag name.
 *
 * If `name` is null, returns the next sibling element regardless of its name.
 *
 * # Safety
 *
 * - `doc` must be a valid, non-null pointer to a `TxDocument`.
 * - `name`, if non-null, must be a valid null-terminated UTF-8 string.
 */
struct TxNodeId tx_next_sibling_element(const TxDocument *doc,
                                        struct TxNodeId node,
                                        const char *name);

/**
 * Returns the root element of the document, or `TX_NULL_NODE` if the
 * document is empty.
 *
 * # Safety
 *
 * `doc` must be a valid, non-null pointer to a `TxDocument`.
 */
struct TxNodeId tx_root_element(const TxDocument *doc);

/**
 * Returns the tag name of an element node.
 *
 * The returned pointer is valid until the next mutating operation on the
 * document or until the document is freed.
 *
 * # Safety
 *
 * - `doc` must be a valid, non-null pointer to a `TxDocument`.
 * - `element` must identify an element node.
 */
const char *tx_element_name(TxDocument *doc, struct TxNodeId element);

/**
 * Returns the value of the named attribute on an element.
 *
 * Returns null if the element or attribute does not exist.
 *
 * # Safety
 *
 * - `doc` must be a valid, non-null pointer to a `TxDocument`.
 * - `name` must be a valid, non-null pointer to a null-terminated UTF-8 string.
 */
const char *tx_element_attribute(TxDocument *doc, struct TxNodeId el, const char *name);

/**
 * Sets an attribute on an element. Creates the attribute if it doesn't exist,
 * or updates its value if it does.
 *
 * # Safety
 *
 * - `doc` must be a valid, non-null pointer to a `TxDocument`.
 * - `name` and `value` must be valid, non-null pointers to null-terminated
 *   UTF-8 strings.
 */
enum TxError tx_element_set_attribute(TxDocument *doc,
                                      struct TxNodeId el,
                                      const char *name,
                                      const char *value);

/**
 * Deletes an attribute from an element by name.
 *
 * # Safety
 *
 * - `doc` must be a valid, non-null pointer to a `TxDocument`.
 * - `name` must be a valid, non-null pointer to a null-terminated UTF-8 string.
 */
enum TxError tx_element_delete_attribute(TxDocument *doc, struct TxNodeId el, const char *name);

/**
 * Returns the text content of an element's first child text node.
 *
 * Returns null if no text child exists.
 *
 * # Safety
 *
 * - `doc` must be a valid, non-null pointer to a `TxDocument`.
 * - `element` must identify an element node.
 */
const char *tx_element_get_text(TxDocument *doc, struct TxNodeId element);

/**
 * Sets the text content of an element.
 *
 * If a child text node exists, its content is replaced. Otherwise, a new
 * text node is created and inserted as the first child.
 *
 * # Safety
 *
 * - `doc` must be a valid, non-null pointer to a `TxDocument`.
 * - `text` must be a valid, non-null pointer to a null-terminated UTF-8 string.
 */
enum TxError tx_element_set_text(TxDocument *doc, struct TxNodeId element, const char *text);

/**
 * Queries an integer attribute value.
 *
 * On success, writes the value to `*value` and returns `TxSuccess`.
 *
 * # Safety
 *
 * - `doc` must be a valid, non-null pointer to a `TxDocument`.
 * - `name` must be a valid, non-null pointer to a null-terminated UTF-8 string.
 * - `value` must be a valid, non-null pointer to a `c_int`.
 */
enum TxError tx_query_int_attribute(const TxDocument *doc,
                                    struct TxNodeId el,
                                    const char *name,
                                    int *value);

/**
 * Queries a boolean attribute value.
 *
 * On success, writes the value to `*value` and returns `TxSuccess`.
 *
 * # Safety
 *
 * - `doc` must be a valid, non-null pointer to a `TxDocument`.
 * - `name` must be a valid, non-null pointer to a null-terminated UTF-8 string.
 * - `value` must be a valid, non-null pointer to a `bool`.
 */
enum TxError tx_query_bool_attribute(const TxDocument *doc,
                                     struct TxNodeId el,
                                     const char *name,
                                     bool *value);

/**
 * Queries a double (f64) attribute value.
 *
 * On success, writes the value to `*value` and returns `TxSuccess`.
 *
 * # Safety
 *
 * - `doc` must be a valid, non-null pointer to a `TxDocument`.
 * - `name` must be a valid, non-null pointer to a null-terminated UTF-8 string.
 * - `value` must be a valid, non-null pointer to a `c_double`.
 */
enum TxError tx_query_double_attribute(const TxDocument *doc,
                                       struct TxNodeId el,
                                       const char *name,
                                       double *value);

/**
 * Returns an integer attribute value, or `default_val` if the attribute
 * does not exist or cannot be parsed.
 *
 * # Safety
 *
 * - `doc` must be a valid, non-null pointer to a `TxDocument`.
 * - `name` must be a valid, non-null pointer to a null-terminated UTF-8 string.
 */
int tx_int_attribute(const TxDocument *doc, struct TxNodeId el, const char *name, int default_val);

/**
 * Returns a boolean attribute value, or `default_val` if the attribute
 * does not exist or cannot be parsed.
 *
 * # Safety
 *
 * - `doc` must be a valid, non-null pointer to a `TxDocument`.
 * - `name` must be a valid, non-null pointer to a null-terminated UTF-8 string.
 */
bool tx_bool_attribute(const TxDocument *doc,
                       struct TxNodeId el,
                       const char *name,
                       bool default_val);

/**
 * Returns a double (f64) attribute value, or `default_val` if the attribute
 * does not exist or cannot be parsed.
 *
 * # Safety
 *
 * - `doc` must be a valid, non-null pointer to a `TxDocument`.
 * - `name` must be a valid, non-null pointer to a null-terminated UTF-8 string.
 */
double tx_double_attribute(const TxDocument *doc,
                           struct TxNodeId el,
                           const char *name,
                           double default_val);

/**
 * Creates a new XML printer (pretty-print mode).
 *
 * # Safety
 *
 * The returned pointer must eventually be freed with [`tx_printer_free`].
 */
TxPrinter *tx_printer_new(void);

/**
 * Creates a new XML printer (compact mode, no whitespace).
 *
 * # Safety
 *
 * The returned pointer must eventually be freed with [`tx_printer_free`].
 */
TxPrinter *tx_printer_new_compact(void);

/**
 * Frees a printer previously created with [`tx_printer_new`] or
 * [`tx_printer_new_compact`].
 *
 * # Safety
 *
 * `printer` must be a valid pointer returned by a printer constructor, or null.
 * After this call, the pointer must not be used again.
 */
void tx_printer_free(TxPrinter *printer);

/**
 * Opens an element tag in the printer output.
 *
 * # Safety
 *
 * - `printer` must be a valid, non-null pointer to a `TxPrinter`.
 * - `name` must be a valid, non-null pointer to a null-terminated UTF-8 string.
 */
void tx_printer_open_element(TxPrinter *printer, const char *name);

/**
 * Pushes an attribute onto the currently open element.
 *
 * # Safety
 *
 * - `printer` must be a valid, non-null pointer to a `TxPrinter`.
 * - `name` and `value` must be valid, non-null pointers to null-terminated
 *   UTF-8 strings.
 */
void tx_printer_push_attribute(TxPrinter *printer, const char *name, const char *value);

/**
 * Closes the most recently opened element.
 *
 * # Safety
 *
 * `printer` must be a valid, non-null pointer to a `TxPrinter`.
 */
void tx_printer_close_element(TxPrinter *printer);

/**
 * Pushes text content into the current element.
 *
 * # Safety
 *
 * - `printer` must be a valid, non-null pointer to a `TxPrinter`.
 * - `text` must be a valid, non-null pointer to a null-terminated UTF-8 string.
 */
void tx_printer_push_text(TxPrinter *printer, const char *text);

/**
 * Pushes a comment into the printer output.
 *
 * # Safety
 *
 * - `printer` must be a valid, non-null pointer to a `TxPrinter`.
 * - `text` must be a valid, non-null pointer to a null-terminated UTF-8 string.
 */
void tx_printer_push_comment(TxPrinter *printer, const char *text);

/**
 * Returns the accumulated printer output as a C string.
 *
 * The returned pointer is valid until the printer is modified or freed.
 *
 * # Safety
 *
 * `printer` must be a valid, non-null pointer to a `TxPrinter`.
 */
const char *tx_printer_result(TxPrinter *printer);

/**
 * Clears the printer output, resetting it to empty.
 *
 * # Safety
 *
 * `printer` must be a valid, non-null pointer to a `TxPrinter`.
 */
void tx_printer_clear(TxPrinter *printer);

/**
 * Returns the type of the given node.
 *
 * # Safety
 *
 * `doc` must be a valid, non-null pointer to a `TxDocument`.
 */
enum TxNodeType tx_node_type(const TxDocument *doc, struct TxNodeId node);

/**
 * Returns `true` if the given node ID is the null sentinel.
 *
 * This function is safe to call without a document pointer.
 */
bool tx_node_is_null(struct TxNodeId node);

/**
 * Returns the "value" of a node based on its type:
 *
 * - Element → tag name
 * - Text → text content
 * - Comment → comment text
 * - Declaration → declaration name
 * - Unknown → raw content
 * - Document → empty string
 *
 * # Safety
 *
 * `doc` must be a valid, non-null pointer to a `TxDocument`.
 */
const char *tx_node_value(TxDocument *doc, struct TxNodeId node);

/**
 * Returns the 1-based source line number where the node was parsed,
 * or 0 if the node was not created by parsing.
 *
 * # Safety
 *
 * `doc` must be a valid, non-null pointer to a `TxDocument`.
 */
int tx_node_line(const TxDocument *doc, struct TxNodeId node);

#ifdef __cplusplus
}  // extern "C"
#endif  // __cplusplus

#endif  /* TINYXML2_RS_H */