/* 
 *   This file was automatically generated by version 1.7 of cextract.
 *   Manual editing not recommended.
 *
 *   Created: Wed Feb 10 12:47:03 1999
 */

/* main.c */
extern void setup_dump(int flag);
extern Buffer *loadVisualStartPage(char *title_more);
extern int main(int argc, char **argv, char **envp);
extern void main_loop(int (*test_func)(void));
extern long text_buf_len(Line *lp);
extern int searchKeyNum(void);
extern int inputTargetXY(int range_p);
extern void pcmap(void);
extern void escmap(void);
extern void escbmap(void);
extern void escdmap(char c);
extern void tmpClearBuffer(Buffer * buf);
extern void saveBufferInfo(void);
extern void nextchar(void);
extern void nulcmd(void);
extern void pushEvent(int event, void *user_data);
extern void delBuffer(Buffer *buf);
extern void pushBuffer(Buffer * buf);
extern MySignalHandler intTrap(SIGNAL_ARG);
extern void pgFore(void);
extern void pgBack(void);
extern void lup1(void);
extern void ldown1(void);
extern void ctrCsrV(void);
extern void ctrCsrH(void);
extern void rdrwSc(void);
extern Str shell_quote_cat(Str str, char *s, int len);
extern void srchfor(void);
extern void srchbak(void);
extern void isrchfor(void);
extern void isrchbak(void);
extern void srchnxt(void);
extern void srchprv(void);
extern void shiftl(void);
extern void shiftr(void);
extern void col1R(void);
extern void col1L(void);
extern Buffer *bufferAtXY(short goal_x, short goal_y);
extern void scrollXY(void);
extern void setEnv(void);
extern void pipeBuf(void);
extern void pipesh(void);
extern void readsh(void);
extern void execsh(void);
extern void ldfile(void);
extern void ldhelp(void);
extern void movL(void);
extern void movD(void);
extern void movU(void);
extern void movR(void);
extern void movLW(void);
extern void movRW(void);
extern void qquitfm(void);
extern void quitfm(void);
extern void susp(void);
extern void goLine(void);
extern void goLineF(void);
extern void goLineL(void);
extern void goLineT(void);
extern void goLineB(void);
extern void linbeg(void);
extern void linend(void);
extern void editBf(void);
extern void editScr(void);
#ifdef USE_MARK
extern void _mark(void);
extern void nextMk(void);
extern void prevMk(void);
extern void reMark(void);
#else				/* not USE_MARK */
#define _mark  nulcmd
#define nextMk nulcmd
#define prevMk nulcmd
#define reMark nulcmd
#endif				/* not USE_MARK */
extern void followA(void);
extern void bufferA(void);
extern void followI(void);
extern void submitForm(void);
extern void followForm(void);
extern void topA(void);
extern void lastA(void);
extern void nextA(void);
extern void physNextA(void);
extern void prevA(void);
extern void physPrevA(void);
extern void nextL(void);
extern void nextLU(void);
extern void nextR(void);
extern void nextRD(void);
extern void nextD(void);
extern void nextU(void);
extern void nextBf(void);
extern void prevBf(void);
extern void backBf(void);
extern void deletePrevBuf(void);
extern void goURL(void);
extern void gorURL(void);
extern void svURL(void);
extern void repBf(void);
extern void ldBmark(void);
extern void adBmark(void);
extern void ldOpt(void);
extern void setOpt(void);
extern void msgs(void);
extern void pginfo(void);
extern void follow_map(struct parsed_tagarg *arg);
#ifdef USE_COOKIE
extern void cooLst(void);
#else				/* not USE_COOKIE */
#define cooLst nulcmd
#endif				/* not USE_COOKIE */
#ifdef USE_HISTORY
extern void ldHist(void);
#else				/* not USE_HISTORY */
#define ldHist nulcmd
#endif				/* not USE_HISTORY */
extern void svA(void);
extern void svI(void);
extern void svBuf(void);
extern void svSrc(void);
extern void peekURL(void);
extern void peekIMG(void);
extern void curURL(void);
extern int vwSrc_internal(Buffer *cur, Buffer **ret, Phase0Env *p0env);
extern void vwSrc(void);
extern void reload(void);
extern void reload_view(void);
extern void rerender(void);
extern void chkURL(void);
extern void chkURLBuffer(Buffer *buf);
extern void chkWORD(void);
#ifdef USE_MARK
extern void chkRegion(void);
#else
#define chkRegion nulcmd
#endif
#ifdef USE_NNTP
extern void chkNMID(void);
extern void chkNMIDBuffer(Buffer *buf);
#else
#define chkNMID nulcmd
#endif
extern Buffer *rFrame_internal(Buffer *buf, Phase0Env *p0env_orig);
extern void rFrame(void);
extern void extbrz(void);
extern void linkbrz(void);
extern Str curlno_str(int needsspace);
extern void curlno(void);
extern void execCmd(void);
#ifdef USE_IMAGE
extern void dispI(void);
extern void stopI(void);
#else
#define dispI nulcmd
#define stopI nulcmd
#endif
extern void gotoXY(void);
#ifdef USE_MOUSE
extern void process_mouse(int btn, int x, int y, void (*doit)(int, void *), void *arg);
extern void mouse(void);
extern void msToggle(void);
#else				/* not USE_MOUSE */
#define mouse nulcmd
#define msToggle nulcmd
#endif				/* not USE_MOUSE */
extern void wrapToggle(void);
#ifdef USE_MARK
extern char *GetMarkedRegion(Buffer *buf, Line **p_bl, int *p_bpos, Line **p_el, int *p_epos);
#endif
#ifdef USE_DICT
extern void dictword(void);
extern void dictwordat(void);
#ifdef USE_MARK
extern void dictregion(void);
#else
#define dictregion nulcmd
#endif
#else				/* not USE_DICT */
#define dictword nulcmd
#define dictwordat nulcmd
#define dictregion nulcmd
#endif				/* not USE_DICT */
extern char *searchKeyData(void);
extern void setAlarm(void);
extern void callfunc(void);
extern void dispVer(void);
extern void procList(void);
extern void close_selected_process(struct parsed_tagarg *arg);
extern void vwErrLog(void);
extern void multipart_load_part(struct parsed_tagarg *arg);
extern void initMc(void);
extern void initBc(void);
extern void resetAE(void);
extern void forever_try(void *arg);
extern void forever(void);
extern void nevermore(void);
extern void next_frame(void);
extern void prev_frame(void);
extern void frame_view(void);
extern void reinit(void);
extern void defKey(void);
extern void chgDir(void);

/* file.c */
extern int currentLn(Buffer * buf);
extern char *allAcceptEncodings(void);
extern void resetEncodingMedia(void);
extern bt_result_t searchEncodingMedia(int op, const char *enc, size_t n, ContentEncoding **ret);
extern bt_result_t searchMediaEncoding(int op, const char *media, ContentEncoding **ret);
extern ParsedURL *schemeToProxy(int scheme);
extern void initTryExtensions(void);
extern void examineFileExt(char *path, URLFile *uf, Phase0Env *p0env);
extern void examineFile(char *path, URLFile *uf, Phase0Env *p0env);
extern int dir_exist(char *path);
extern Buffer *loadFile(char *path, Phase0Env *p0env);
#ifdef USE_COOKIE
extern void processSetCookie(ParsedURL * pu, Str name, Str value,
			     time_t expires, Str domain, Str path,
			     int flag, Str comment, int version,
			     Str port, Str commentURL, int sub_p);
#endif
extern void get_auth_cookie(char *auth_header, TextList *extra_header, ParsedURL *pu,
			    HRequest *hr, FormList *request, Phase0Env *p0env);
extern int same_url_p(ParsedURL *pu1, ParsedURL *pu2);
extern Buffer *loadGeneralFileOnBuffer(char *path, ParsedURL * volatile current,
				       char *referer, Phase0Env *p0env,
				       FormList * volatile request,
				       Buffer * volatile t_buf);
extern void retryLoadGeneralFile(char *path, ParsedURL *current, char *referer, FormList *request, void *arg);
extern Buffer *loadGeneralFile(char *path, ParsedURL * current, char *referer, Phase0Env *p0env, FormList * request);
extern int is_boundary(int, int);
extern int is_blank_line(char *line, int indent);
extern void push_render_image(Str str, int width, int limit, struct html_feed_environ *h_env);
extern void addMultirowsAnchorsInLine(Phase2Env *p2env, int force);
extern Str three_quater_cat_charp_n(Str d, const char *p, size_t n);
#define three_quater_cat_charp(d, p) (three_quater_cat_charp_n((d), (p), strlen((p))))
#define three_quater_cat(d, s) (three_quater_cat_charp_n((d), (s)->ptr, (s)->length))
extern void flushline(struct html_feed_environ *h_env, struct readbuffer *obuf, int indent, int force, int width);
extern void do_blankline(struct html_feed_environ *h_env, struct readbuffer *obuf, int indent, int indent_incr, int width);
extern void purgeline(struct html_feed_environ *h_env);
extern void save_fonteffect(struct html_feed_environ *h_env,
			    struct readbuffer *obuf);
extern void restore_fonteffect(struct html_feed_environ *h_env,
			       struct readbuffer *obuf);
#ifdef USE_IMAGE
extern ImageCache *getImageCache(const char *key, int key_len);
extern void putImageCache(ImageCache *c);
extern ImageCache *getOrLoadImageCache(char *url, char *ext, Phase0Env *p0env, int w, int h, int flag);
extern ImageCache *getImage(Image *image, Phase0Env *p0env, int flag);
#endif
extern Str process_img(struct parsed_tag *tag, int width, struct readbuffer *obuf);
extern Str process_anchor(struct parsed_tag *tag, char *tagbuf, Phase1Env *p1env);
extern Str process_input(struct parsed_tag *tag, struct readbuffer *obuf);
extern Str process_button(struct parsed_tag *tag, struct readbuffer *obuf);
extern Str process_n_button(Phase1Env *p1env);
extern void process_select(struct parsed_tag *tag, struct readbuffer *obuf);
extern Str tiny_safe_sprintf(const char *frmt, ...);
extern Str process_n_select(Phase1Env *p1env);
extern void feed_select(char *str, struct readbuffer *obuf);
extern void process_option(Phase1Env *p1env);
extern Str process_textarea(struct parsed_tag *tag, int width, struct readbuffer *obuf);
extern Str process_n_textarea(Phase1Env *p1env);
extern void feed_textarea(char *str, Phase1Env *p1env);
extern Str process_form(struct parsed_tag *tag, struct readbuffer *obuf);
extern Str process_n_form(Phase1Env *p1env);
extern int HTMLtagproc1(struct parsed_tag *tag, struct html_feed_environ *h_env);
extern Phase2Env *init_phase2env(Phase2Env *p2env, Buffer *buf, int llimit, Phase1Env *p1env);
extern void doHTMLlineproc2(Phase2Env *p2env, Str line);
extern void HTMLlineproc2(Buffer * buf, TextLineList * tl, Phase1Env *p1env);
extern char *HTMLlineproc0(char *istr, char *str_end, struct html_feed_environ *h_env, int procmode);
#define HTMLStrproc0(x,y,z) HTMLlineproc0((x)->ptr, (x)->ptr + (x)->length, (y), (z))
#define HTMLstrproc0(x,y,z) HTMLlineproc0((x), (x) + strlen((x)), (y), (z))
#define HTMLStrproc1(x,y) HTMLlineproc0((x)->ptr, (x)->ptr + (x)->length, (y), HLP_INTERNAL | HLP_EOL)
#define HTMLcstrproc1(x,y) HTMLlineproc0((x), (x) + sizeof(x) - 1, (y), HLP_INTERNAL | HLP_EOL)
extern void pushFileToDelete(char *fn, int flag);
extern Buffer *loadHTMLBuffer(URLFile * f, Buffer * newBuf, Phase0Env *p0env);
extern void showCompleted(clen_t *linelen, clen_t *trbyte, Phase0Env *p0env);
extern void showProgress(clen_t *linelen, clen_t *trbyte, Phase0Env *p0env);
extern void init_henv(struct html_feed_environ *, struct readbuffer *,
		      struct environment *, int, TextLineList *, int, int,
		      Phase1Env *p1env);
extern void completeHTMLstream(struct html_feed_environ *, struct readbuffer *);
extern Phase1Env *init_phase1env(Phase1Env *p1env, Buffer *newBuf, Phase0Env *p0env);
extern void loadHTMLstream(URLFile * f, Buffer * newBuf, FILE * src, int internal, Phase0Env *p0env);
extern Buffer *loadHTMLString(Str page, Buffer *newBuf, Phase0Env *p0env);
#ifdef USE_GOPHER
extern Buffer *loadGopherDir(URLFile * uf, Buffer * newBuf, Phase0Env *p0env);
extern void gopher_redirect(struct parsed_tagarg *arg);
#endif				/* USE_GOPHER */
extern int Plainlineproc(Buffer *buf, int flag, CheckTypeEnv *ctenv, char *from, char *from_end, int eol_p, int *rest);
extern Buffer *loadBuffer(URLFile * uf, Buffer * newBuf, Phase0Env *p0env);
extern Buffer *loadMultipartBuffer(char *path, URLFile *uf, Buffer *newBuf, Phase0Env *p0env);
#ifdef USE_IMAGE
extern Buffer *loadImageBuffer(URLFile *uf, Buffer *newBuf, Phase0Env *p0env);
#endif
extern void saveBuffer(Buffer * buf, FILE * f);
extern Line *getNextLine(Buffer *buf, int *tty_in_p);
extern Buffer *getshell(char *cmd, Phase0Env *p0env);
extern Buffer *getpipe(char *cmd, Phase0Env *p0env);
extern Buffer *openGeneralPagerBuffer(InputStream stream, Phase0Env *p0env);
extern int save2tmp(URLFile uf, char *tmpf, Phase0Env *p0env);
extern btri_string_tab_t *contentTypeAttributesToTable(Buffer *buf);
extern int doExternal(URLFile *p_uf, ParsedURL *pu, char *type, Buffer **bufp, Buffer *defaultbuf,
		      char *referer, FormList *request, Phase0Env *p0env);
extern void doFileCopy(char *tmpf, char *defstr, Phase0Env *p0env);
extern void doFileMove(char *tmpf, char *defstr, Phase0Env *p0env);
extern void doFileSave(URLFile uf, char *defstr, Phase0Env *p0env);
extern int checkCopyFile(char *path1, char *path2);
extern int checkSaveFile(InputStream stream, char *path);
extern int checkOverWrite(char *path);
extern char *inputAnswer(char *prompt);
extern int matchattr(char *p, char *attr, int len, Str *value);
extern void init_ctenv(CheckTypeEnv *env, Buffer *buf, int width
#ifdef USE_ANSI_COLOR
		       , int use_color
#endif
		       );
extern void reset_ctenv(CheckTypeEnv *env, int nl_p);
extern char *checkHeader(Buffer * buf, char *field);
extern char *contentTypeAttribute(char *beg, char **p_end);
extern Buffer *reloadBuffer(Buffer * buf, Phase0Env *p0env);
extern char *guess_save_name(char *file);

/* ipc.c */
extern Str urgent_quote_cat_charp_n(Str d, const char *s, int n);
#define urgent_quote_cat_charp(d, s) (urgent_quote_cat_charp_n((d), (s), strlen((s))))
#define urgent_quote_cat(d, s) (urgent_quote_cat_charp_n((d), (s)->ptr, (s)->length))
#define urgent_quote_charp_n(s, n) (urgent_quote_cat_charp_n(NULL, (s), (n)))
#define urgent_quote_charp(s) (urgent_quote_cat_charp_n(NULL, (s), strlen((s))))
#define urgent_quote(s) (urgent_quote_cat_charp_n(NULL, (s)->ptr, (s)->length))
extern Str urgent_unquote_cat_charp_n(Str d, const char *s, int n);
#define urgent_unquote_cat_charp(d, s) (urgent_unquote_cat_charp_n((d), (s), strlen((s))))
#define urgent_unquote_cat(d, s) (urgent_unquote_cat_charp_n((d), (s)->ptr, (s)->length))
#define urgent_unquote_charp_n(s, n) (urgent_unquote_cat_charp_n(NULL, (s), (n)))
#define urgent_unquote_charp(s) (urgent_unquote_cat_charp_n(NULL, (s), strlen((s))))
#define urgent_unquote(s) (urgent_unquote_cat_charp_n(NULL, (s)->ptr, (s)->length))
extern Str halfdump_buffer_quote_to_str(const char *s);
extern char *halfdump_buffer_quote(const char *s);
extern Str halfdump_buffer_unquote_to_str(const char *s);
extern char *halfdump_buffer_unquote(const char *s);
#define halfdump_buffer_send_number(which, value) \
(fprintf(urgent_out, "%X %X %lX\n", urgent_bufferinfo, urgent_bufferinfo_ ## which, (long)(value)))
#define halfdump_buffer_send_string(which, value) \
(fprintf(urgent_out, "%X %X %s\n", urgent_bufferinfo, urgent_bufferinfo_ ## which, halfdump_buffer_quote((value))))
#define halfdump_buffer_send_URL(which, pu) (halfdump_buffer_send_string(which, (pu) ? parsedURL2Str((pu))->ptr : NULL))
extern void halfdump_buffer_send(Buffer *buf);
extern void processBufferEvents(Buffer *buf);
extern int onCurrentview(Buffer *buf);
extern int setCurrentbuf(Buffer *buf, Phase0Env *p0env, int redraw, int *p_flag);
extern long my_clock(void);
extern int keepAsyncRWBuf(char *host, unsigned short port, AsyncRWBuf *abuf, int busy);
extern AsyncRWBuf *getKeptAsyncRWBuf(char *host, unsigned short port, int implicit_p);
extern void waitKeptAsyncRWBuf(char *path, ParsedURL *current, char *referer, FormList *request,
			       void (*pre_hook)(char *, ParsedURL *, char *, FormList *, void *),
			       void *pre_arg);
extern void freeKeptAsyncRWBuf(AsyncRWBuf *abuf, int force);
extern void expireKeptAsyncRWBuf(void);
extern void freeAllKeptAsyncRWBuffers(void);
extern void discardKeptAsyncRWBuf(AsyncRWBuf *abuf);
extern void watchKeptAsyncRWBuf(int fd, void *arg);
extern void finishAsyncBuffer(Buffer *buf, int html_p);
extern void discardAsyncRWBuf(AsyncRWBuf *abuf, int force);
extern void displayBufferMaybe(Buffer *buf, int nlines);
extern void gotoURLLabel(Buffer *b, char *label, int html_p);
#ifdef USE_COOKIE
extern void sendCookieInfo(ParsedURL * pu, Str name, Str value,
			   time_t expires, Str domain, Str path,
			   int flag, Str comment, int version,
			   Str port, Str commentURL);
#endif
extern void readUrgentMessage(int ufd, void *arg);
extern Str make_urgent_title(char *path, int pid);
extern void forkCleanup(void);
extern Str quotePhase0Env(Phase0Env *p0env);
extern Phase0Env *unquotePhase0Env(char *qs, Phase0Env *p0env, Str *p_proxy_auth_cookie);
extern Str quoteFormList(FormList *r);
extern FormList *unquoteFormList(char *qs, FormList *r);
extern Str quoteLoadRequest(char *path, ParsedURL *current, char *referer,
			    FormList *request, RedirectHistory *rh);
extern void unquoteLoadRequest(char *qs, char **p_path, ParsedURL **p_current, char **p_referer,
			       FormList **p_request, RedirectHistory **p_rh);
extern Buffer *bindBufferWithAsyncRWBuf(Buffer *buf, AsyncRWBuf *abuf, char *path, Phase0Env *p0env);
extern pid_t forkWithChannel(char *path, Phase0Env *p0env, Buffer **p_buf);
extern void flush_buffer_and_exit(Buffer *newBuf);
#ifdef USE_IMAGE
extern void urgent_send_cur_baseURL(Phase0Env *p0env);
extern Str quoteImageCache(ImageCache *c);
extern ImageCache *unquoteImageCache(ImageCache *d, char *t);
#endif
extern void processRedirectedLoad(char *b, Buffer *buf);
extern Str find_sup_auth_cookie(char *host, int port, char *file, char *realm, Phase0Env *p0env);
extern Str find_sub_auth_cookie(char *qs);
extern void add_sup_auth_cookie(char *host, int port, char *file, char *realm, Str cookie, Phase0Env *p0env);

/* buffer.c */
extern void initBuffer(Buffer *n, BufferView *v);
extern Buffer *newBuffer(BufferView *v);
extern void clearBuffer(Buffer *buf);
extern void discardBuffer(Buffer *buf);
extern void removeViewFromView(BufferViewList *l, BufferView *);
extern BufferView *nextBufferView(BufferView *v);
extern void insertViewToView(BufferViewList *l, BufferView *nv);
extern void removeBufferFromView(Buffer *buf);
extern void insertBufferToView(Buffer *ref, Buffer *buf);
extern void appendBufferToView(Buffer *ref, Buffer *buf);
extern void updateCurrentbuf(Buffer *);
extern Buffer *checkCurrentbuf(void);
extern int isPrevBuffer(Buffer *a, Buffer *b);
extern void mkunlinkedBuffer(Buffer *buf);
extern void deleteBuffer(Buffer *delbuf);
extern void replaceBuffer(Buffer *delbuf, Buffer *newbuf);
extern void insertBuffer(Buffer *old, Buffer *new);
extern void appendBuffer(Buffer *old, Buffer *new);
#ifdef USE_MENU_BUFFER
extern void gotoRealLineMaybe(Buffer * buf, int n, int force);
#endif
extern void gotoRealLine(Buffer * buf, int n);
extern void gotoLine(Buffer * buf, int n);
extern Buffer *selectBuffer(Buffer * firstbuf, Buffer * currentbuf, char *selectchar);
extern void copyBuffer(Buffer * a, Buffer * b);
extern int writeBufferCache(Buffer *buf);
extern int readBufferCache(Buffer *buf);

/* display.c */
extern void fmTerm(int subproc_p);
extern void fmInit(int subproc_p);
extern void shrink_cat(int width, Str dst, Str s);
extern BufferView *initBufferView(BufferView *v, struct frameset *fset, BufferView *sup,
				  short rootX, short rootY, short width, short height, short col, short row);
extern BufferView *defaultBufferView(void);
extern void displayCurrentView(BufferView *v);
extern void displayBuffer(Buffer * buf, int mode);
extern void redrawBuffer(Buffer * buf);
extern void redrawBufferImage(Buffer * buf);
extern void redrawNLine(Buffer * buf, int n);
extern Line *redrawLine(Buffer * buf, Line * l, int i);
extern int redrawLineRegion(Buffer *buf, Line *l, int i, int bpos, int epos);
extern void do_effects(Lineprop m);
#ifdef USE_ANSI_COLOR
extern void do_color(Linecolor c);
#endif
extern void addChar(char c, Lineprop mode);
#ifdef MANY_CHARSET
extern void addWChar(mb_wchar_t wc, size_t len, Lineprop mode);
#endif
extern GeneralList *message_list;
extern void record_err_message(char *s);
extern Buffer *message_list_panel(void);
extern void message(char *s);
#define disp_err_message(s, f) (record_err_message((s)), disp_message((s), (f)))
extern void disp_message_nsec(char *s, int redraw_current, int sec, int purge, int mouse);
extern void disp_message(char *s, int redraw_current);
#ifdef USE_MOUSE
extern void disp_message_nomouse(char *s, int redraw_current);
#else
#define disp_message_nomouse disp_message
#endif
extern void cursorUp(Buffer * buf, int n);
extern void cursorDown(Buffer * buf, int n);
extern void cursorUpDown(Buffer * buf, int n);
extern void cursorRight(Buffer * buf, int n);
extern void cursorLeft(Buffer * buf, int n);
extern void cursorHome(Buffer * buf);
extern void arrangeCursor(Buffer * buf);
extern void arrangeLine(Buffer * buf);
extern void cursorXY(Buffer * buf, int x, int y);
extern void restorePosition(Buffer *buf, Buffer *orig);

/* etc.c */
extern int columnSkip(Buffer * buf, int offset);
extern int columnPos(Line * line, int column);
extern Line *lineSkip(Buffer * buf, Line * line, int offset, int last);
extern Line *currentLineSkip(Buffer * buf, Line * line, int offset, int last);
extern int gethtmlcmd(char **s);
extern int checkTypeCat(CheckTypeEnv *p);
extern int calcPosition(char *l, Lineprop *pr, int len, int pos, int bpos, int mode);
extern char *lastFileName(char *path);
#ifdef USE_INCLUDED_SRAND48
void srand48(long);
long lrand48(void);
#endif
extern char *mybasename(char *s);
extern char *mydirname(char *s);
extern int next_status(char c, int *status);
extern int read_token(Str buf, char **instr, char *instr_end, int *status, int flag);
extern Str correct_irrtag(int status);
extern FILE *openSecretFile(char *fname);
extern void loadPasswd(void);
extern int find_auth_user_passwd(ParsedURL *pu, char *realm,
				 Str *uname, Str *pwd, int is_proxy);
extern Str find_auth_cookie(char *host, int port, char *file, char *realm);
extern void add_auth_cookie(char *host, int port, char *file, char *realm, Str cookie);
extern char *last_modified(Buffer * buf);
extern Str romanNumeral(int n);
extern Str romanAlphabet(int n);
extern void mySystem(char *command, int background);
extern Str myExtCommand(char *cmd, char *arg, int redirect);
extern char *file_to_url(char *file);
extern char *expandName(char *name);
extern Str tmpfname(int type, char *ext);
#ifdef USE_COOKIE
extern time_t mymktime(char *timestr);
extern char *FQDN(char *host);
#endif

/* search.c */
#ifdef USE_ROMAJI
extern void init_romaji_filter(int pid);
#endif
extern int forwardSearch(Buffer * buf, char *str, int across_line_p);
extern int backwardSearch(Buffer * buf, char *str, int across_line_p);

/* linein.c */
extern int inputLineBusy;
extern UrgentInputQueue inputLineQueue;
extern char *inputLineHistTabSearch(char *prompt, char *def_str, int flag,
				    Hist *hist, btri_string_tab_t *tab,
				    int (*incfunc)(int ch, Str buf, Lineprop *prop));
#define inputLineHistSearch(p, d, f, h, ifun) (inputLineHistTabSearch((p), (d), (f), (h), NULL, (ifun)))
extern void linein_mvR(int key, InputLineEnv *env);
extern void linein_mvL(int key, InputLineEnv *env);
extern void linein_mvRw(int key, InputLineEnv *env);
extern void linein_mvLw(int key, InputLineEnv *env);
extern void linein_delC(int key, InputLineEnv *env);
extern void linein_mvB(int key, InputLineEnv *env);
extern void linein_mvE(int key, InputLineEnv *env);
extern void linein_enter(int key, InputLineEnv *env);
extern void linein_quo(int key, InputLineEnv *env);
extern void linein_bs(int key, InputLineEnv *env);
extern void linein_bsw(int key, InputLineEnv *env);
extern void linein_delRw(int key, InputLineEnv *env);
extern void linein_killn(int key, InputLineEnv *env);
extern void linein_killb(int key, InputLineEnv *env);
extern void linein_inbrk(int key, InputLineEnv *env);
extern void linein_esc(int key, InputLineEnv *env);
extern void linein_prev(int key, InputLineEnv *env);
extern void linein_next(int key, InputLineEnv *env);
extern void linein_compl(int key, InputLineEnv *env);
extern void linein_tcompl(int key, InputLineEnv *env);
extern void next_dcompl(int next, InputLineEnv *env);
extern Str unescape_spaces(Str s);
extern void linein_copyregion(int key, InputLineEnv *env);
extern void linein_nextchar(int key, InputLineEnv *env);

/* history.c */
#ifdef USE_HISTORY
extern Buffer *historyBuffer(Hist *hist);
extern void loadHistory(Hist *hist);
extern void saveHistory(Hist *hist, size_t size);
#endif				/* not USE_HISTORY */

/* table.c */
extern double log_like(int x);
extern struct table *newTable(void);
extern void pushdata(struct table *t, int row, int col, char *data);
extern int visible_length(char *str, int visible_length_offset);
extern void align(TextLine *lbuf, int width, int mode);
extern void print_item(struct table *t, int row, int col, int width, Str buf);
extern void print_sep(struct table *t, int row, int type, int maxcol, Str buf);
extern void do_refill(struct table *tbl, int row, int col, int maxlimit, Phase1Env *p1env);
extern void renderTable(struct table *t, int max_width, struct html_feed_environ *h_env);
extern struct table *begin_table(int border, int spacing, int padding, int vspace);
extern void end_table(struct table * tbl);
extern void check_rowcol(struct table *tbl, struct table_mode *mode);
extern int minimum_length(char *line);
extern int feed_table(struct table *tbl, char *line, struct table_mode *mode, int width, int internal, struct readbuffer *obuf);
extern void feed_table1(struct table *tbl, Str tok, struct table_mode *mode, int width, struct readbuffer *obuf);
extern void pushTable(struct table *, struct table *);

/* form.c */
extern struct form_list *newFormList(char *action, char *method, char *charset, char *enctype, char *target, char *name,
				     struct form_list *_next);
extern struct form_list *newFormList_internal(char *action, int method, char *charset, int enctype, char *target, char *name,
					      struct form_list *_next);
extern struct form_item_list *formList_addInput(struct form_list *fl, struct parsed_tag *tag, Phase1Env *p1env);
extern char *form2str(FormItemList * fi);
extern int formtype(char *typestr);
extern void formRecheckRadio(Anchor * a, Buffer * buf, FormItemList * form);
extern void formResetBuffer(Buffer * buf, AnchorList * formitem);
extern void formItemResetBuffer(Buffer *buf, FormItemList *sfi);
extern Str input_textarea_write(FormItemList * fi);
extern void input_textarea_read(FormItemList *fi, Str tmpname);
extern void do_internal(char *action, char *data);
extern void form_write_data(FILE * f, char *boundary, char *name, char *value);
extern void form_write_from_file(FILE * f, char *boundary, char *name, char *filename, char *file);
extern void formSplitValue(FormItemList *fi);

/* map.c */
extern MapArea *follow_map_menu(Buffer *buf, char *name, Anchor *a_img, int x, int y);
#ifndef MENU_MAP
extern Buffer *follow_map_panel(Buffer *buf, char *name);
#endif
#ifdef USE_IMAGE
extern int getMapXY(Buffer *buf, Anchor *a, int *x, int *y);
extern Str getCurrentMapLabel(Buffer *buf);
#endif
extern Anchor *retrieveCurrentMap(Buffer *buf);
extern MapArea *newMapArea(char *url, char *target, char *alt, char *shape, char *coords);
extern Buffer *page_info_panel(Buffer * buf, Buffer *infoBuf);

/* frame.c */
extern struct frame_body *newFrame(struct parsed_tag *tag, Buffer *buf);
extern struct frameset *newFrameSet(struct parsed_tag *tag);
extern void addFrameSetElement(struct frameset *f, union frameset_element element);
extern Buffer *frameOrigin(BufferView *v);
extern Buffer *frameCorner(BufferView *v);
extern BufferView *renderFrameOnView(BufferView *nv, Buffer *Cbuf, Phase0Env *p0env_orig);
extern BufferView *renderFrame(struct frameset *fset, Buffer *Cbuf, Phase0Env *p0env);
extern BufferView *searchBufferView(BufferView *ov, char *name);
extern void parse_frame_colrow(short ctotal, short cmin, int rulesize, double ppc, char **sv, int orig_n, short *cwv);
extern Buffer *frameViewBuffer(BufferView *v);

/* terms.c */
extern void record_read_fd(int rfd, void (*read_hook)(int, void *), void (*close_hook)(int, void *), void *hook_arg);
extern void change_read_fd(int rfd, void (*hook)(int, void *), void *hook_arg);
extern void clear_read_fd(int *p_rfd, int istemp);
extern void clear_all_read_fds(void);
extern int is_recorded_read_fd(int rfd);
extern int is_hook_recorded_read_fd(int rfd);
extern void record_raw_crontab(void (*func)(void *), void *arg, int relative, long seconds);
extern void record_crontab(int cmd, void *cmd_arg, int relative, long seconds, Buffer *argbuf);
struct timeval;
extern int wait_until(RawEvent *special, struct timeval *timeout);
extern int wait_user_event_and(int fd, struct timeval *timeout);
#ifdef MANY_CHARSET
extern mb_setup_t tty_mb_r_setup;
extern mb_setup_t tty_mb_w_setup;
extern const char *tty_initial_input_charset;
extern const char *tty_initial_output_charset;
extern mb_cs_detector_t *conv_cs_detector;
extern mb_setup_t conv_mb_setup_r;
extern mb_setup_t conv_mb_setup_w;
extern mb_ws_conv_t *tty_input_converters;
extern mb_ws_conv_t *tty_output_converters;
extern mb_ws_conv_t *tty_fallback_converters;
extern void setup_tty_mb_r(const char *frmt, ...);
extern void setup_tty_mb_w(const char *frmt, ...);
extern mb_wchar_t *tty_char_conv_mbs2wcs(char *s, int n, mb_wchar_t *wbuf);
extern int tty_char_conv(mb_wchar_t **p_from, mb_wchar_t *from_end,
			 mb_wchar_t **p_to, mb_wchar_t *to_end);
extern size_t tty_apply_convv(mb_wchar_t *ws, mb_wchar_t *ws_end, mb_info_t *info);
extern char *tty_mbs_apply_convv(char *s, int *p_len);
extern void ttyfix_wcwidth_init(void);
extern size_t ttyfix_wchar_width(mb_wchar_t wc);
extern size_t ttyfix_width(const char *s);
extern size_t ttyfix_width_n(const char *s, size_t n);
extern mb_wchar_t tty_getwc(void);
#endif
extern int set_tty(void);
extern void set_cc(int spec, int val);
extern void close_tty(void);
extern char *ttyname_tty(void);
extern void reset_tty(void);
extern MySignalHandler resize_hook(SIGNAL_ARG);
extern MySignalHandler reset_exit(SIGNAL_ARG);
extern MySignalHandler error_dump(SIGNAL_ARG);
extern void set_int(void);
extern void getTCstr(void);
extern void setlinescols(void);
extern void setupscreen(void);
extern int initscr(void);
extern int write1(char c);
#ifdef MANY_CHARSET
extern void tty_store_wchar(mb_wchar_t wc, mb_info_t *info);
#endif
extern void endline(void);
extern void switch_ascii(FILE * f);
extern void switch_wchar(FILE * f);
extern void putchars(unsigned char c1, unsigned char c2, FILE * f);
extern void move(int line, int column);
extern void my_getyx(int *y, int *x);
#define getyx(y, x) (my_getyx(&(y), &(x)))
extern void addch(char c);
#ifdef MANY_CHARSET
extern void add_wch(mb_wchar_t wc, size_t wid);
#endif
extern void wrap(void);
extern void touch_column(int col);
extern void touch_line(void);
extern void standout(void);
extern void standend(void);
extern void bold(void);
extern void boldend(void);
extern void underline(void);
extern void underlineend(void);
extern void graphstart(void);
extern void graphend(void);
extern int graph_ok(void);
#ifdef USE_COLOR
extern void setfcolor(int color);
#ifdef USE_BG_COLOR
extern void setbcolor(int color);
#endif				/* USE_BG_COLOR */
#endif				/* USE_COLOR */
extern void refresh(void);
extern void clear(void);
extern void clear_partial(int x, int y, int w, int h);
extern void scroll(int n, int beg, int m);
extern void rscroll(int n, int beg, int m);
extern void clrtoeol(void);
extern void clrtoeolx(void);
extern void clrtobot(void);
extern void clrtobotx(void);
extern void clrtobot_partial(int x, int y, int w, int h);
extern void clrtobotx_partial(int x, int y, int w, int h);
extern void no_clrtoeol(void);
extern void addstr(char *s);
extern void addnstr(char *s, int n);
extern void addnstr_sup(char *s, int n);
extern void crmode(void);
extern void nocrmode(void);
extern void term_echo(void);
extern void term_noecho(void);
extern void term_raw(void);
extern void term_cooked(void);
extern void term_cbreak(void);
extern void term_title(char *s);
extern void flush_tty(void);
extern void toggle_stand(void);
#ifdef MANY_CHARSET
extern void process_getch_mode(int mode);
extern char getch_internal(int mode);
#define getch() (getch_internal(GETCH_MODE_CLR))
#else
extern char getch(void);
#endif
extern int getevent(CookedEvent *cev);
extern void bell(void);
extern void sleep_till_anykey(int sec, int purge);
#ifdef USE_MOUSE
#if defined(MANY_CHARSET) || defined(JP_CHARSET)
extern int here_is_mousecursor_p(int x, int y, int cursor_x);
#endif
extern void mouse_init(void);
extern void mouse_end(void);
extern void mouse_active(void);
extern void mouse_inactive(void);
#endif				/* not USE_MOUSE */
#ifdef USE_IMAGE
extern int getImageSize(ImageCache *cache, int subproc_p);
extern void initImage(void);
extern void termImage(pid_t pid);
extern void addImage(ImageCache *cache, int x, int y, int sx, int sy, int w, int h);
extern void drawImage(void);
extern void clearImage(BufferView *v);
extern void resetImage(void);
extern void checkUnloadedImage(BufferView *v);
#endif

/* conv.c */
#ifdef MANY_CHARSET
extern mb_ws_conv_t *input_converters;
extern mb_ws_conv_t *output_converters;
extern void conv_init_r(const char *lang, const char *ics, const char *op, ...);
extern void conv_setup_r(const char *op, ...);
extern void conv_init_w(const char *op, ...);
extern void conv_setup_w(const char *op, ...);
extern char *conv_apply_convv(char *s, int *p_n, mb_ws_conv_t *cv, mb_info_t *info);
extern size_t conv_ucs2mb(mb_wchar_t, char *buf);
extern Str conv_vmem2mbStr(const char *s, size_t n, Str S, const char **p_cs, const char *op, va_list ap);
extern Str conv_mem2mbStr(const char *s, size_t n, const char **p_cs, const char *op, ...);
extern Str conv_vstr2mbStr(const char *s, const char **p_cs, const char *op, va_list ap);
extern Str conv_str2mbStr(const char *s, const char **p_cs, const char *op, ...);
extern Str conv_Str2mbStr(Str s, const char **p_cs, const char *op, ...);
extern size_t conv_Str_write(const char *s, size_t n, void *ap);
extern size_t conv_default_decoder(mb_wchar_t enc, mb_info_t *info);
extern Str conv_vmem2isoStr(const char *s, size_t n, const char *op, va_list ap);
extern Str conv_mem2isoStr(const char *s, size_t n, const char *op, ...);
extern Str conv_vstr2isoStr(const char *s, const char *op, va_list ap);
extern Str conv_str2isoStr(const char *s, const char *op, ...);
#endif
#ifdef JP_CHARSET
extern int getConvToEJRoutine(char key,
			      int (**p_routine)(JA_CES_conv_t *cd, const char **from, int *from_left, char **to, int *to_left),
			      JA_CES_conv_t *cd);
extern int getConvFromEJRoutine(char key,
				int (**p_routine)(JA_CES_conv_t *cd, const char **from, int *from_left, char **to, int *to_left),
				JA_CES_conv_t *cd);
extern const char *GetSICode(char key);
extern const char *GetSOCode(char key);
extern Str conv_str(Str is, char fc, char tc);
extern Str conv(char *is, char fc, char tc);
extern void JA_CES_find1(const uchar *p, JA_CES_stat_t *st);
extern void JA_CES_find(const uchar *p, int len, JA_CES_stat_t *st);
extern char JA_CES_examin_siso(JA_CES_stat_t *st);
extern char JA_CES_examine_stat(JA_CES_stat_t *st);
extern char checkShiftCode(Str buf, unsigned char hint);
extern char str_to_code(char *str);
extern char *code_to_str(char code);
extern void put_sjis(unsigned char ub, unsigned char lb, char *s);
#endif				/* JP_CHARSET */

/* url.c */
extern void free_ssl_ctx(void);
extern ParsedURL *baseURL(Buffer * buf);
extern int openSocket(char *hostname, char *remoteport_name, unsigned short remoteport_num);
extern void parseURL(char *url, ParsedURL * p_url, ParsedURL * current);
extern void copyParsedURL(ParsedURL * p, ParsedURL * q);
extern void parseURL2(char *url, ParsedURL * pu, ParsedURL * current);
extern char *getParsedURLScheme(ParsedURL *pu);
extern Str parsedURL2Str(ParsedURL * pu);
extern int getURLScheme(char **url);
extern void init_stream(URLFile *uf, int scheme, InputStream stream);
Str HTTPrequestMethod(HRequest *hr);
Str HTTPrequestURI(ParsedURL *pu, HRequest *hr);
extern int keepSock(int sock);
extern int getKeptSock(char *host, unsigned short port);
extern void discardKeptSock(void);
extern URLFile openURL(char *url, ParsedURL *pu, ParsedURL *current,
		       URLOption *option, FormList *request, TextList *extra_header,
		       URLFile *ouf, HRequest *hr, unsigned char *status,
		       Phase0Env *p0env);
extern char *guessContentTypeFromTable(btri_string_tab_t *table, char *filename, char **p_ext_beg, char **p_ext_end);
extern char *guessContentTypeAndExtension(char *filename, char **p_ext_beg, char **p_ext_end);
extern char *guessContentType(char *filename);
extern TextList *make_domain_list(char *domain_list);
extern int check_no_proxy(char *domain);
extern char *filename_extension(char *patch, int is_url);
extern void chkExternalURIBuffer(Str rexstr);

/* mailcap.c */
extern int mailcapMatch(struct mailcap *mcap, char *type);
extern struct mailcap *searchMailcap(struct mailcap *table, char *type, btri_string_tab_t *attr, ParsedURL *pu);
extern void initMailcap(struct mailcap ***cap, TextList **cap_list, char *files, TextList *entries, int mailcap_p);
extern int extractMailcapEntry(char *mcap_entry, struct mailcap *mcap, int skip_html);
extern char *acceptableMimeTypes(void);
extern struct mailcap *searchExtViewer(char *type, btri_string_tab_t *attr, ParsedURL *pu, struct mailcap **cap);
extern Str unquote_mailcap(char *qstr, char *type, btri_string_tab_t *attr, ParsedURL *pu, int *mc_stat, int need_shell_quote);

/* ftp.c */
extern void openFTP(URLFile *uf, ParsedURL *pu, Phase0Env *p0env);
extern int Ftpfclose(FILE *f);
extern void FtpExit(void);

/* anchor.c */
extern void makeAnchorKey(int line, int pos, AnchorKey *key);
extern AnchorList *putAnchor(AnchorList *al, int i, int line, int pos, Anchor **ret);
extern Anchor *registerHref(Buffer *buf, int hseq, char *url, char *target, char *referer, int line, int pos);
extern AnchorList *putNameAnchor(AnchorList *al, char *name, int line, int pos);
extern void registerName(Buffer *buf, char *name, int line, int pos);
extern Anchor *registerImg(Buffer *buf, int hseq, char *url, int line, int pos);
extern Anchor *registerForm(Buffer *buf, int hseq, FormList *flist, struct parsed_tag *tag, int line, int pos, Phase1Env *p1env);
extern int onAnchor(Anchor *a, int line, int pos);
extern Anchor *retrieveAnchor(AnchorList *al, int line, int pos);
extern Anchor *retrieveCurrentAnchor(Buffer *buf);
extern Anchor *retrieveCurrentImg(Buffer *buf);
extern Anchor *retrieveCurrentForm(Buffer *buf);
extern Anchor *searchAnchor(AnchorList *al, char *str);
extern Anchor *searchURLLabel(Buffer *buf, char *url);
extern void reAnchorWord(Buffer *buf, Line *sl, int spos, Line *el, int epos);
extern char *reAnchor(Buffer *buf, char *re);
#ifdef USE_NNTP
extern char *reAnchorNews(Buffer *buf, char *re);
#endif				/* USE_NNTP */
extern void addMultirowsImage1(Buffer *buf, Anchor *a_found);
extern void addMultirowsForm1(Buffer *buf, Anchor *a_found);
extern Anchor *closest_next_anchor(AnchorList * a, Anchor * an, int x, int y);
extern Anchor *closest_prev_anchor(AnchorList * a, Anchor * an, int x, int y);
extern HmarkerList *putHmarker(HmarkerList * ml, int line, int pos, int seq);
extern void reseqHmarker(HmarkerList *ml);

/* mimiehead.c */
extern Str decodeB(char **ww);
extern Str decodeQ(char **ww);
extern Str decodeQP(char **ww);
extern Str decodeU(char **ww);
extern Str decodeWord(char **ow);
extern Str decodeMIME(char *orgstr);
extern Str encodeB(char *a);

/* rc.c */
#ifdef MANY_CHARSET
extern void try_cfg_files(const char *fn, void (*func)(FILE *), char *(*find)(char *));
#endif
extern const char *lookup_process_charset(const char *process);
extern btri_string_tab_t rc_paramtab[];
extern int set_param_option(char *option);
extern char *get_param_option(char *name);
extern void initMimeTypes(void);
extern void setup_locale_charset(void);
extern void init_rc(char *config_file);
extern void rc_finish(void);
extern Buffer *load_option_panel(void);
extern void panel_set_option(struct parsed_tagarg *);
extern void sync_with_header(void);
extern void sync_with_option(void);
extern char *rcFile(char *base);
extern char *etcFile(char *base);
extern char *auxbinFile(char *base);
extern char *libFile(char *base);
extern char *helpFile(char *base);
extern void setLocalCookie(void);

/* local.c */
extern Buffer *dirBuffer(char *dirname);
extern void set_environ(const char *var, const char *value);
extern int localcgi_post(char *, char *, FormList *, char*);
extern int localcgi_get(char *, char *, char*);

/* cookie.c */
#ifdef USE_COOKIE
extern Str find_cookie(ParsedURL * pu);
extern int add_cookie(ParsedURL * pu, Str name, Str value, time_t expires,
		      Str domain, Str path, int flag, Str comment, int version,
		      Str port, Str commentURL);
extern void save_cookies(void);
extern void load_cookies(void);
extern void initCookie(void);
extern Buffer *cookie_list_panel(void);
extern void set_cookie_flag(struct parsed_tagarg *arg);
extern int check_cookie_accept_domain(char *domain);
#endif				/* not USE_COOKIE */

/* func.c */
extern void addToKeyTab(KeyTabList *kl, int key, int cmd);
extern int cmpKeyTabItem(const void *x, const void *y);
extern KeyTabList *copyKeyTabList(KeyTabList *kl);
extern void setKeymap(char *p, int lineno, int verbose,
		      KeyTabList *func_tab, KeyTabList *edit_tab
#ifdef USE_MENU
		      , KeyTabList *menu_tab
#endif
		      );
extern void initKeymap(int force);
extern int getKey(char *s);
extern int lookupKeyIndex(int key, KeyTabList *tabl);
extern FuncList *lookupKey(int key, KeyTabList *tabl);
extern char *getKeyData(int key);
extern char *getWord(char **str);
extern char *getQWord(char **str);

/* menu.c */
#ifdef USE_MENU
#ifdef USE_MENU_BUFFER
extern void mUpMenu(void);
extern void mDownMenu(void);
extern void mLeftMenu(void);
extern void mRightMenu(void);
extern void mMoveMenu(void);
extern void mSelect(void);
extern void mOk(void);
extern void mCancel(void);
extern void mClose(void);
#define mNextchar nextchar
#define mEsc escmap
#define mEscB escbmap
#define mNull nulcmd
#define mDown ldown1
#define mUp lup1
#define mLast goLineL
#define mTop goLineF
#define mNext movD
#define mPrev movU
#define mFore pgFore
#define mBack pgBack
#define mSusp susp
#ifdef USE_MOUSE
extern void mPositional(void);
#define mMouse mouse
#endif
#define mSrchF srchfor
#define mSrchB srchbak
#define mSrchN srchnxt
#define mSrchP srchprv
#ifdef __EMX__
#define mPc pcmap
#else
#define mPc mNull
#endif
#else
extern int mNextchar(int c);
extern int mEsc(int c);
extern int mEscB(int c);
extern int mNull(int c);
extern int mSelect(int c);
extern int mDown(int c);
extern int mUp(int c);
extern int mLast(int c);
extern int mTop(int c);
extern int mNext(int c);
extern int mPrev(int c);
extern int mFore(int c);
extern int mBack(int c);
extern int mOk(int c);
extern int mCancel(int c);
extern int mClose(int c);
extern int mSusp(int c);
#ifdef USE_MOUSE
extern int mPositional(int key);
extern int mMouse(int c);
#else
#define mPositional mNull
#define mMouse mNull
#endif
extern int mSrchF(int c);
extern int mSrchB(int c);
extern int mSrchN(int c);
extern int mSrchP(int c);
#ifdef __EMX__
extern int mPc(int c);
#else
#define mPc mNull
#endif
#define mUpMenu mNull
#define mDownMenu mNull
#define mLeftMenu mNull
#define mRightMenu mNull
#define mMoveMenu mNull
#endif
#ifdef USE_MENU_BUFFER
extern void smDelBuf(void);
#else
extern int smDelBuf(int c);
#endif
extern void new_menu(Menu *menu, MenuItem *item
#ifdef USE_MENU_BUFFER
		     , BufferView *view
#endif
		     );
extern void select_menu_line(Buffer *b, Line *old);
extern void geom_menu(Menu *menu, int mselect);
extern void draw_all_menu(Menu *menu);
extern void draw_menu(Menu *menu);
extern void draw_menu_item(Menu *menu, int mselect);
extern int select_menu(Menu *menu, int mselect);
extern void goto_menu(Menu *menu, int mselect, int down);
#ifndef USE_MENU_BUFFER
extern void up_menu(Menu *menu, int n);
extern void down_menu(Menu *menu, int n);
extern int action_menu(Menu *menu);
#endif
extern void popup_menu(Menu *parent, Menu *menu);
#ifdef USE_MENU_BUFFER
extern void popdown_menu(int close_p, int selected);
#endif
extern void guess_menu_xy(Menu *menu, short width, short *x, short *y);
extern void new_option_menu(Menu *menu, char **label, int *variable, void (*func) (), MenuItem *more);
extern int setMenuItem(MenuItem * item, char *type, char *line);
extern int addMenuList(MenuList ** list, char *id);
extern int getMenuN(MenuList * list, char *id);
extern void popupMenu(short x, short y, Menu *menu);
extern void mainMenu(short x, short y);
extern void mainMn(void);
extern void selMn(void);
extern void reshapeMenus(Menu *m, Menu *p, void (*hook)(void));
extern void reshapeMenu(void);
extern void optionMenu(int x, int y, char **label, int *variable, int initial, void (*func) ());
extern void initMenu(void);
#else				/* not USE_MENU */
#define mNull nulcmd
#define mNextchar nulcmd
#define mEsc nulcmd
#define mEscB nulcmd
#define nulcmd nulcmd
#define mSelect nulcmd
#define mDown nulcmd
#define mUp nulcmd
#define mLast nulcmd
#define mTop nulcmd
#define mNext nulcmd
#define mPrev nulcmd
#define mFore nulcmd
#define mBack nulcmd
#define mOk nulcmd
#define mCancel nulcmd
#define mClose nulcmd
#define mSusp nulcmd
#define mPositional nulcmd
#define mMouse nulcmd
#define mSrchF nulcmd
#define mSrchB nulcmd
#define mSrchN nulcmd
#define mSrchP nulcmd
#define mPc nulcmd
#define mUpMenu mNull
#define mDownMenu mNull
#define mLeftMenu mNull
#define mRightMenu mNull
#define mMoveMenu mNull
#define smDelBuf nulcmd
#define mainMn nulcmd
#define selMn selBuf
#endif				/* not USE_MENU */

#include "indep.h"
