100 lines
2.6 KiB
C
100 lines
2.6 KiB
C
#if defined BASE \
|
|
|| !defined BASE && !defined PRIVATE && !defined PROTO /* <!-- base */
|
|
#ifdef BASE
|
|
#define PUSH_BASE
|
|
#undef BASE
|
|
#endif
|
|
#ifdef PRIVATE
|
|
#define PUSH_PRIVATE
|
|
#undef PRIVATE
|
|
#endif
|
|
#ifdef PROTO
|
|
#define PUSH_PROTO
|
|
#undef PROTO
|
|
#endif
|
|
#include "kjvcount.h" /* Uses same conflicting system. */
|
|
#ifdef PUSH_BASE
|
|
#undef PUSH_BASE
|
|
#define BASE
|
|
#endif
|
|
#ifdef PUSH_PRIVATE
|
|
#undef PUSH_PRIVATE
|
|
#define PRIVATE
|
|
#endif
|
|
#ifdef PUSH_PROTO
|
|
#undef PUSH_PROTO
|
|
#define PROTO
|
|
#endif
|
|
#endif /* base --> */
|
|
|
|
|
|
#if defined PRIVATE \
|
|
|| !defined BASE && !defined PRIVATE && !defined PROTO /* <!-- private */
|
|
struct tree_kjvline_node;
|
|
struct tree_kjvline_tree { struct tree_kjvline_node *node; unsigned height; };
|
|
struct kjvline_tree { struct tree_kjvline_tree root; };
|
|
struct tree_kjvline_ref
|
|
{ struct tree_kjvline_node *node; unsigned height, idx; };
|
|
struct tree_kjvline_iterator {
|
|
struct tree_kjvline_tree *root; struct tree_kjvline_ref ref; int seen;
|
|
};
|
|
struct kjvline_tree_iterator { struct tree_kjvline_iterator _; };
|
|
#endif /* private --> */
|
|
|
|
|
|
#if defined PROTO \
|
|
|| !defined BASE && !defined PRIVATE && !defined PROTO /* <!-- proto */
|
|
#ifdef BASE
|
|
#error BASE!!!
|
|
#endif
|
|
#include <stddef.h>
|
|
struct kjv {
|
|
struct kjvline_tree line;
|
|
struct kjvset_table set;
|
|
struct count_table count;
|
|
struct { size_t total, cumulative, set, verse; } words;
|
|
};
|
|
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 **);
|
|
|
|
|
|
struct kjv kjv(void);
|
|
void kjv_(struct kjv *);
|
|
int kjv_is_empty(const struct kjv *const kjv);
|
|
/* Only used in test. */
|
|
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);
|
|
#endif
|
|
|
|
#endif /* proto --> */
|
|
|
|
#ifdef BASE
|
|
#undef BASE
|
|
#endif
|
|
#ifdef PRIVATE
|
|
#undef PRIVATE
|
|
#endif
|
|
#ifdef PROTO
|
|
#undef PROTO
|
|
#endif
|