BT_TRAVERSAL(1) btparse BT_TRAVERSAL(1) (NAME) bt_traversal - AST btparse (SYNOPSIS) AST * bt_next_entry (AST * entry_list, AST * prev_entry) AST * bt_next_field (AST * entry, AST * prev, char ** name) AST * bt_next_value (AST * head, AST * prev, bt_nodetype_t * nodetype, char ** text) bt_metatype_t bt_entry_metatype (AST * entry) char * bt_entry_type (AST * entry) char * bt_entry_key (AST * entry) char * bt_get_text (AST * node) (DESCRIPTION) (AST) bt_input . <> (bt_next_entry() bt_next_field() bt_next_value()) . . (Traversal functions) bt_next_entry() AST * bt_next_entry (AST * entry_list, AST * prev_entry) bt_parse_file() ( bt_input ) . "NULL" "prev_entry" . "prev_entry" "NULL" . "entry_list" "prev_entry" "NULL" . ( ): entries = bt_parse_file (filename, options, &status); entry = NULL; while (entry = bt_next_entry (entries, entry)) { /* process entry */ } bt_next_field() AST * bt_next_field (AST * entry, AST * prev, char ** name) . ( bt_next_field() bt_entry_metatype() .) "entry" AST bt_parse_entry() bt_parse_entry_s() bt_next_entry() . "prev" "NULL" bt_next_field() "entry" "entry" ( comment preamble ) "NULL" . "prev" bt_next_field() AST . bt_next_value() bt_get_text() . : field = NULL; while (field = bt_next_field (entry, field, &field_name)) { /* process field */ } bt_next_value() AST * bt_next_value (AST * head, AST * prev, bt_nodetype_t * nodetype, char ** text) . ( . '#' . << >> AST bt_next_value() .) bt_next_value() bt_next_entry() bt_next_field() : "NULL" "prev" . "NULL" . *nodetype *text . *nodetype "BTAST_STRING" "BTAST_MACRO" "BTAST_NUMBER" *text AST ( ) . bt_next_field() : value = NULL; while (value = bt_next_field (field, value, &nodetype, &text)) { switch (nodetype) { case BTAST_STRING: /* process the string */ case BTAST_MACRO: /* process the macro */ case BTAST_NUMBER: /* process the number */ } } <> . (Query functions) bt_entry_metatype() bt_metatype_t bt_entry_metatype (AST * entry) (metatype) . ( metatype @comment "comment" metatype "BTE_COMMENT" . (type-metatype) "BTE_PREAMBLE" "BTE_MACRODEF" @string "BTE_REGULAR" .) "entry" ( "NULL" AST ) "BTE_UNKNOWN" . bt_entry_type() char * bt_entry_type (AST * entry) . '@' . "entry" ( "NULL" AST ) "NULL" . bt_entry_key() char * bt_entry_key (AST * entry) (citation key) . ( .) "entry" ( "NULL" AST ) "NULL" . bt_get_text() char * bt_get_text (AST * node) ( ) . ( bt_next_field() ) comment preamble . AST "NULL" . (SEE ALSO) btparse, bt_input, bt_postprocess (AUTHOR) Greg Ward btparse, version 0.91 2025-07-14 BT_TRAVERSAL(1)