56 lines
1.5 KiB
C
56 lines
1.5 KiB
C
#if defined BASE \
|
|
|| !defined BASE && !defined PRIVATE && !defined PROTO /* <!-- base */
|
|
#include "pair.h"
|
|
struct source { struct pair name, desc; };
|
|
#endif /* base --> */
|
|
|
|
|
|
#if defined PRIVATE \
|
|
|| !defined BASE && !defined PRIVATE && !defined PROTO /* <!-- private */
|
|
|
|
struct tree_source_node;
|
|
struct tree_source_tree { struct tree_source_node *node; unsigned height; };
|
|
struct source_tree { struct tree_source_tree root; };
|
|
struct tree_source_ref { struct tree_source_node *node; unsigned height, idx; };
|
|
struct tree_source_iterator {
|
|
struct tree_source_tree *root; struct tree_source_ref ref; int seen;
|
|
};
|
|
struct source_tree_iterator { struct tree_source_iterator _; };
|
|
|
|
struct sourcelist_array { struct source *data; size_t size, capacity; };
|
|
|
|
struct sourcemap_bucket;
|
|
struct sourcemap_table {
|
|
struct sourcemap_bucket *buckets;
|
|
uint32_t log_capacity, size, top;
|
|
};
|
|
|
|
#endif /* private --> */
|
|
|
|
|
|
#if defined PROTO \
|
|
|| !defined BASE && !defined PRIVATE && !defined PROTO /* <!-- proto */
|
|
#include <stddef.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);
|
|
#endif /* proto --> */
|
|
|
|
#ifdef BASE
|
|
#undef BASE
|
|
#endif
|
|
#ifdef PRIVATE
|
|
#undef PRIVATE
|
|
#endif
|
|
#ifdef PROTO
|
|
#undef PROTO
|
|
#endif
|