interpret/src/kjv.h

66 lines
1.8 KiB
C
Raw Normal View History

#include "kjvcount.h"
2022-12-27 20:28:04 +00:00
#define TREE_NAME kjvline
#define TREE_KEY union line64
#define TREE_VALUE struct kjvrange
#define TREE_HEAD
#include "../src/tree.h"
2022-12-27 20:28:04 +00:00
2023-02-02 06:23:35 +00:00
#if defined PROTO \
2023-03-15 05:02:22 +00:00
|| !defined BASE && !defined PRIVATE && !defined PROTO /* <!-- proto */
#ifdef BASE
#error BASE!!!
#endif
2022-12-27 20:28:04 +00:00
#include <stddef.h>
2022-12-27 21:01:51 +00:00
struct kjv {
2023-03-15 05:02:22 +00:00
struct kjvline_tree line;
2022-12-27 21:01:51 +00:00
struct kjvset_table set;
2023-03-15 05:02:22 +00:00
struct count_table count;
2022-12-30 07:38:58 +00:00
struct { size_t total, cumulative, set, verse; } words;
2022-12-27 21:01:51 +00:00
};
2023-03-15 05:02:22 +00:00
void kjv_line_(struct kjvline_tree *);
struct kjvline_tree kjv_line(struct journal *);
int kjv_line_is_empty(const struct kjvline_tree *);
const char *kjv_line_to_string(const struct kjvline_tree *);
struct kjvline_tree_iterator kjv_line_iterator(struct kjvline_tree *);
int kjv_line_next(struct kjvline_tree_iterator *, union line64 *,
const struct kjvrange **);
#if 0
const char *kjvline_to_string(const struct kjvline *);
struct kjvline_iterator kjvline_iterator(struct kjvline *);
int kjvline_next(struct kjvline_iterator *, union line64 *,
const struct kjvline **);
struct flights_iterator { struct flight_tree_iterator _; };
struct flights flights(/*const*/ struct journal *);
void flights_(struct flights *);
const char *flights_to_string(const struct flights *);
struct flights_iterator flights_iterator(struct flights *);
int flights_next(struct flights_iterator *, union line64 *,
const struct flight **);
2022-12-27 20:28:04 +00:00
struct kjv kjv(void);
void kjv_(struct kjv *);
int kjv_is_empty(const struct kjv *const kjv);
2023-02-15 07:30:57 +00:00
/* Only used in test. */
2022-12-27 21:01:51 +00:00
int kjv_add(struct kjv *const kjv, const union kjvcite cite);
const char *kjv_to_string(const struct kjv *const kjv);
const char *kjv_set_to_string(const struct kjv *const kjv);
2023-03-15 05:02:22 +00:00
#endif
2023-02-02 06:23:35 +00:00
#endif /* proto --> */
#ifdef BASE
#undef BASE
#endif
2023-03-15 05:02:22 +00:00
#ifdef PRIVATE
#undef PRIVATE
2023-02-02 06:23:35 +00:00
#endif
#ifdef PROTO
#undef PROTO
#endif