#include "pair.h" /* pair */ struct source { struct pair name, desc; }; #define ARRAY_NAME sourcelist #define ARRAY_TYPE struct source #define ARRAY_HEAD #include "../src/array.h" #include /* size_t */ #include /* uint32_t */ #define TABLE_NAME sourcemap #define TABLE_KEY struct pair #define TABLE_UINT uint32_t #define TABLE_VALUE size_t #define TABLE_HEAD #include "../src/table.h" #include "../src/journal.h" /* line64 */ #define TREE_NAME source #define TREE_KEY union line64 #define TREE_VALUE size_t #define TREE_HEAD #include "../src/tree.h" struct sources { struct sourcelist_array list; struct sourcemap_table map; struct source_tree dates; }; struct source *sources_add(struct sources *, const union line64); struct sources sources(struct journal *); void sources_(struct sources *); int sources_is_empty(const struct sources *); const char *sources_to_string(const struct sources *); const struct source *source_lookup(struct sources *s, const union line64 range);