| 1187 | */ |
| 1188 | |
| 1189 | YAML_DECLARE(yaml_node_t *) |
| 1190 | yaml_document_get_node(yaml_document_t *document, int index) |
| 1191 | { |
| 1192 | assert(document); /* Non-NULL document object is expected. */ |
| 1193 | |
| 1194 | if (index > 0 && document->nodes.start + index <= document->nodes.top) { |
| 1195 | return document->nodes.start + index - 1; |
| 1196 | } |
| 1197 | return NULL; |
| 1198 | } |
| 1199 | |
| 1200 | /** |
| 1201 | * Get the root object. |