/* these two should be in lib I think */
int id_close(int chan);
void slave_closing(int chan);
int slave_dbflush(void);
void copy_items(int chan, char *gfrom, char *gto, char *subject, char *mid, int dodel);
void copy_item(int chan,char *gfrom,char *gto, int n);
int ncmd_check_result(int chan, char *mid, char *rs);

int pop_backgnd(void);
void id_background(void);
int id_pop(void);
void id_ask(int chan);
void id_open(int c);
void id_read(int chan, char *buf, int len);
void cmd_pause(int t, char *reason);

int ncmd_dlist(int chan, char *in);  /* dlist rec. */
int xhdr_finish(int chan);
int nntp_time(char *s, int isgmt);
int gmt_to_local(int t);
int xover_finish(int chan);
int cmd_finish(int chan);
void ncmd_newgroups_finish(int chan);
void ncmd_newnews_finish(int chan, char *h);
int ncmd_item_suck(int chan, char *mid, String *item, char *res, int toobig, int isihave);



int ncmd_getihave(int chan, char *in, int sz);
int do_ncmd(int chan, char *in);
int ncmd_group(int chan, char *in);
int ncmd_article(int chan, char *in);
int ncmd_xhdr(int chan, char *in);
int ncmd_password(int chan, char *in);
int ncmd_cmd(int chan, char *in);
int ncmd_range(int chan, char *range, int *grp, int *from, int *to);
int ncmd_findart(int chan, char *in, int *grp, int *num);
int ncmd_body(int chan, char *in);
int ncmd_head(int chan, char *in);
int ncmd_help(int chan, char *in);
int ncmd_ihave(int chan, char *in);
int ncmd_getcur(int chan, char *in, int *grp, int *num);
int ncmd_last(int chan, char *in);
int ncmd_list(int chan, char *in);
int ncmd_listgroup(int chan, char *in);
int ncmd_newgroups(int chan, char *in);
int dist_match(char *dist, char *group);
int dist_matchlist(char *dist, char *glist);
int ncmd_newnews(int chan, char *in);
int ncmd_newnews2(int chan,char *dist, int group, int num);
int ncmd_next(int chan, char *in);
int ncmd_post(int chan, char *in);
int ncmd_getpost(int chan, char *in, int sz);
int ncmd_quit(int chan, char *in);
int ncmd_slave(int chan, char *in);
int ncmd_stat(int chan, char *in);
int ncmd_mode(int chan, char *in);
int ncmd_authinfo(int chan, char *in);
int ncmd_date(int chan, char *in);
int ncmd_xover(int chan, char *in);
int ncmd_xpath(int chan, char *in);
int ncmd_xpat(int chan, char *in);
int ncmd_xgtitle(int chan, char *in);
int ncmd_flushsite(int chan, char *in);

void slave_open(void);
int slave_takethis(String *xitem);
void slave_xhlookup(int chan, char *in);
void slave_xhresult(int schan, char *in);
void slave_lookup(int chan, char *msgid, int cmd);
void slave_xactive(int xchan, char *in);
void slave_xsetslave(int chan, char *in);
char *slave_port(void);
int slave_isopen(void);

enum {SL_NONE,SL_HEAD,SL_BODY,SL_ARTICLE,SL_STAT,SL_POST};
