/* $Id: mthreads.h,v 2.3 1992/12/14 00:14:07 davison Trn $
*/

#define RWBUFSIZ 8192

#define PASS_LOCK 1
#define DAEMON_LOCK 2

EXT char rwbuf[RWBUFSIZ];

EXT TOTAL total;

EXT int added_articles INIT(0);
EXT int expired_articles INIT(0);
EXT int added_count;
EXT int expired_count;
EXT bool extra_expire INIT(FALSE);

EXT char *strings INIT(0);
EXT WORD *subject_cnts INIT(0);
EXT WORD *author_cnts INIT(0);
EXT WORD *ids INIT(0);

EXT SUBJECT **subject_array;
EXT ROOT **root_array;
EXT AUTHOR **author_array;
EXT ARTICLE **article_array;

EXT PACKED_ROOT p_root;
EXT PACKED_ARTICLE p_article;

EXT ROOT *root_root;
EXT AUTHOR *author_root;

#ifndef DOINIT
EXT DOMAIN unk_domain;
#else
DOMAIN unk_domain = {
    ".unknown.", NULL, NULL
};
#endif

EXT bool word_same, long_same;
EXT BMAP my_bmap, mt_bmap;

char *thread_name _((char *));
void mybytemap _((BMAP *));
void wp_bmap(), lp_bmap(), swap_bmaps();

int ngmatch _((char *,char *));
int onepatmatch _((char *,char *));

void mt_init _((void));
long mt_lock _((int, int));
void mt_unlock _((int));
void wrap_it_up _((int));
void log_entry();
void log_error();

int read_data _((void));
int write_data _((char *));
void dont_read_data _((int));

void process_articles _((ART_NUM,ART_NUM));

char *file_exp _((char *));
char *savestr _((char *));

#ifndef lint
char *safemalloc _((MEM_SIZE));
void free();
void safefree();
#endif

time_t get_date _((char *,time_t,long));

#define Nullart Null(ARTICLE*)
