2023-03-19 03:41:40 +00:00
|
|
|
#include "pair.h" /* pair */
|
2023-02-04 06:00:55 +00:00
|
|
|
struct source { struct pair name, desc; };
|
2023-02-03 02:53:59 +00:00
|
|
|
|
2023-03-19 03:41:40 +00:00
|
|
|
#define ARRAY_NAME sourcelist
|
|
|
|
#define ARRAY_TYPE struct source
|
|
|
|
#define ARRAY_HEAD
|
|
|
|
#include "../src/array.h"
|
2023-02-03 02:53:59 +00:00
|
|
|
|
2023-03-19 03:41:40 +00:00
|
|
|
#include <stddef.h> /* size_t */
|
|
|
|
#include <stdint.h> /* uint32_t */
|
2023-02-04 06:00:55 +00:00
|
|
|
|
2023-03-19 03:41:40 +00:00
|
|
|
#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"
|
2023-02-04 06:00:55 +00:00
|
|
|
|
2023-03-19 03:41:40 +00:00
|
|
|
#include "../src/journal.h" /* line64 */
|
2023-02-04 06:00:55 +00:00
|
|
|
|
2023-03-19 03:41:40 +00:00
|
|
|
#define TREE_NAME source
|
|
|
|
#define TREE_KEY union line64
|
|
|
|
#define TREE_VALUE size_t
|
|
|
|
#define TREE_HEAD
|
|
|
|
#include "../src/tree.h"
|
2023-02-03 02:53:59 +00:00
|
|
|
|
2023-02-04 06:00:55 +00:00
|
|
|
struct sources {
|
|
|
|
struct sourcelist_array list;
|
2023-02-04 06:54:49 +00:00
|
|
|
struct sourcemap_table map;
|
2023-02-04 06:00:55 +00:00
|
|
|
struct source_tree dates;
|
|
|
|
};
|
2023-02-03 02:53:59 +00:00
|
|
|
struct source *sources_add(struct sources *, const union line64);
|
|
|
|
struct sources sources(struct journal *);
|
|
|
|
void sources_(struct sources *);
|
2023-03-16 03:10:12 +00:00
|
|
|
int sources_is_empty(const struct sources *);
|
2023-02-03 02:53:59 +00:00
|
|
|
const char *sources_to_string(const struct sources *);
|
2023-02-12 05:21:29 +00:00
|
|
|
const struct source *source_lookup(struct sources *s, const union line64 range);
|