/* Mods by PA0GRI */
#ifndef _COMMANDS_H
#define _COMMANDS_H

#include "cmdparse.h"
#if defined(MSDOS) && !defined(__dj_include_time_h_)
#include <time.h>
#endif

#ifdef MSDOS
/* In alloc.c */
int domem (int argc,char *argv[],void *p);
#endif

#ifdef	APRSD
/* In aprssrv.c */
int doaprs (int argc, char *argv[], void *p);
#endif

/* In arpcmd.c */
int doarp (int argc,char *argv[],void *p);

/* In asy.c */
int asy_attach (int argc,char *argv[],void *p);
int doasycomm (int argc,char *argv[],void *p);
int doasystat (int argc,char *argv[],void *p);
#ifdef KISS
int axloop_attach (int argc,char *argv[],void *p);
#endif

/* In at.c */
int doat (int argc,char *argv[],void *p);

/* In ax25.c */
int axip_attach (int argc,char *argv[],void *p);

#ifdef	AXUDP
/* In axudp.c - 12Mar2001, VE4KLM */
int axudp_attach (int argc,char *argv[],void *p);
#endif

/* In ax25aar.c */
int doax25autoroute (int argc,char *argv[],void *p);

/* In ax25cmd.c */
int doax25 (int argc,char *argv[],void *p);
int doaxstat (int argc,char *argv[],void *p);
int doaxcounters (int argc,char *argv[],void *p);
int doaxheard (int argc,char *argv[],void *p);
int doconnect (int argc,char *argv[],void *p);
int donralias (int argc, char *argv[], void *p);
int ifax25 (int argc,char *argv[],void *p);

/* In bmutil.c */
int issysarea (const char *name);
int isarea (const char *name);

/* In bid_wp.c */
#ifdef WPAGES
int dooldwpages (int argc, char *argv[], void *p);
#endif

/* In bootp.c */
int dobootp (int argc,char *argv[],void *p);

/* In bootpcmd.c */
int bootpdcmd (int argc,char *argv[],void *p);

/* In browser.c */
int dobrowser (int argc,char *argv[],void *p);
int dobrowsercheck (int argc,char *argv[],void *p);
int dobrowseremail (int argc,char *argv[],void *p);
char *obtain_statline_marquee (void);

#ifdef CALLSERVER
/* In buckbook.c  */
int docdrom (int argc, char *argv[], void *p);
#endif
#if defined(CALLCLI) || defined(SAMCALLB) || defined(QRZCALLB)
int docallserver (int argc,char *argv[],void *p);
#endif

/* In calldbd.c */
int cdbstart (int argc,char *argv[],void *p);
int cdb0 (int argc,char *argv[],void *p);
int docallbook (int argc,char *argv[],void *p);

/* In color.c */
int docolor (int argc, char *argv[], void *p);

/* In convers.c */
#ifdef CONVERS
int doconvers (int argc, char **argv, void *p);
int conv1 (int argc, char **argv, void *p);
int conv0 (int argc, char **argv, void *p);
#endif

/* In crontab.c */
#ifdef CRONTAB
int docrontab (int argc, char **argv, void *p);
int cron1 (int argc, char **argv, void *p);
int cron0 (int argc, char **argv, void *p);
#endif

/* In dialer.c */
int dodialer (int argc,char *argv[],void *p);

/* In dirutil.c */
int docd (int argc,char *argv[],void *p);
int dodir (int argc,char *argv[],void *p);
int domkd (int argc,char *argv[],void *p);
int dormd (int argc,char *argv[],void *p);
#ifdef MSDOS
int dodrive (int argc, char *argv[], void *p);
#endif

/* In domain.c */
int dodomain (int argc,char *argv[],void *p);

#ifdef DRSI
/* In drsi.c */
int dodrstat (int argc,char *argv[],void *p);
int dr_attach (int argc,char *argv[],void *p);
int dodr (int argc,char *argv[],void *p);
#endif

#ifdef EAGLE
/* In eagle.c */
int eg_attach (int argc,char *argv[],void *p);
int doegstat (int argc,char *argv[],void *p);
#endif

#ifdef PC_EC
/* In ec.c */
int doetherstat (int argc,char *argv[],void *p);
int ec_attach (int argc,char *argv[],void *p);
#endif

/* In expire.c */
int doexpire (int argc,char *argv[],void *p);
int dooldbids (int argc,char *argv[],void *p);
void RenewWPages (void);

/* In export.c */
#ifdef BBSEXPORT
int doexport (int argc, char *argv[], void *p);
#endif

/* In fifo.c */
#ifdef FIFOSERVER
int fifo0 (int argc, char *argv[], void *p);
int fifo1 (int argc, char *argv[], void *p);
#endif

/* In finger.c */
int dofinger (int argc,char *argv[],void *p);

/* In fingerd.c */
int finstart (int argc,char *argv[],void *p);
int fin0 (int argc,char *argv[],void *p);

/* In forward.c */
void netPrompt (void);
int AREAlookup (char *area,int theindex);
void fwdlockit (char *name);
void fwdunlockit (char *name);

/* In fopen.c */
int dofstat (int argc,char *argv[],void *p);

/* In ftpcli.c */
int doftp (int argc,char *argv[],void *p);
int doftype (int argc,char *argv[],void *p);
int doabort (int argc,char *argv[],void *p);

/* In ftpserv.c */
int ftpstart (int argc,char *argv[],void *p);
int ftp0 (int argc,char *argv[],void *p);
int doftptdisc (int argc,char *argv[],void *p);
int doftpmaxclients (int argc,char *argv[],void *p);

/* In ftpsubr.c */
int md5hash (FILE *fp,char hash[],int ascii);

/* In fwdcmd.c */
#ifdef MBFWD
int doforward (int argc, char *argv[], void *p);
#endif

/* In getline.c */
char * getline (FILE *fp);

#ifdef HAPN
/* In hapn.c */
int dohapnstat (int argc,char *argv[],void *p);
int hapn_attach (int argc,char *argv[],void *p);
#endif

/* In help.c */
void dohelper (const char *title,register struct cmds *cmdp,const char *stopstr,const char *filename,const char *search);

/* In hop.c */
int dohop (int argc,char *argv[],void *p);

/* In http.c */
int httpstart (int argc,char *argv[],void *p);
int http0 (int argc, char *argv[], void *p);
int dohttp (int argc,char *argv[],void *p);

#ifdef HS
/* In hs.c */
int dohs (int argc,char *argv[],void *p);
int hs_attach (int argc,char *argv[],void *p);
#endif

/* In icmpcmd.c */
int doicmp (int argc,char *argv[],void *p);
int doping (int argc,char *argv[],void *p);

/* In iface.c */
int doifconfig (int argc,char *argv[],void *p);
int dodetach (int argc,char *argv[],void *p);
void removetrace (void);
int dummy_attach (int argc, char *argv[], void *p);

/* In import.c */
#ifdef BBSIMPORT
int doimport (int argc, char *argv[], void *p);
#endif

/* In ipcmd.c */
int doip (int argc,char *argv[],void *p);
int doroute (int argc,char *argv[],void *p);
int doipheard (int argc,char *argv[],void *p);

/* In kiss.c */
int kiss_attach (int argc,char **argv,void *p);

#ifdef linux
/* In krnlif.c */
int krnlif_attach(int argc, char *argv[], void *p);
#endif

/* In ksubr.c */
int ps (int argc,char *argv[],void *p);
int dokstat (int argc,char *argv[],void *p);

/* In look.c */
int dolook (int argc,char *argv[],void *p);

/* In lzw.c */
int dolzw (int argc,char *argv[],void *p);

/* In mailbox.c */
int dopbbs (int argc,char *argv[],void *p);
#ifdef CALLBOOK
int doinetcallserver (int argc,char *argv[],void *p);
#endif
#ifdef MAILCMDS
int doarea (int argc, char *argv[], void *p);
int dombreview (int argc, char *argv[], void *p);
#endif
void setMaintenance (void);
void clearMaintenance (void);
void quickscan (struct mbx *m, int olduser, int usename);

/* In mailfor.c */
int dombrline (int argc,char *argv[],void *p);

/* In main.c */
int doshutdown (int argc,char *argv[],void *p);
int dodelete (int argc,char *argv[],void *p);
int dorename (int argc,char *argv[],void *p);
int doexit (int argc,char *argv[],void *p);
int dohostname (int argc,char *argv[],void *p);
int dolog (int argc,char *argv[],void *p);
int dohelp (int argc,char *argv[],void *p);
int doattach (int argc,char *argv[],void *p);
int doparam (int argc,char *argv[],void *p);
int domode (int argc,char *argv[],void *p);
int doman (int argc,char *argv[],void *p);
int domore (int argc,char *argv[],void *p);
int donothing (int argc,char *argv[],void *p);
int donrstat (int argc,char *argv[],void *p);
int doescape (int argc,char *argv[],void *p);
int doremote (int argc,char *argv[],void *p);
int dosource (int argc,char *argv[],void *p);
#if defined(ALLCMD) && !defined(UNIX)
int domdump (int argc,char *argv[],void *p);
#endif
int dostatus (int argc,char *argv[],void *p);
int domotd (int argc,char *argv[],void *p);
int dothirdparty (int argc,char *argv[],void *p);
int dotail (int argc,char *argv[],void *p);
int dolock (int argc,char *argv[],void *p);
int dounlock (int argc,char *argv[],void *p);
int morecmd (int argc,char *argv[],void *p);
int docopy (int, char **, void *);
int doerror (int, char **, void *);
int dowrite (int, char **, void *);
int dowriteall (int, char **, void *);
int doprompt (int, char **, void *);
int dohistory (int, char **, void *);
int dorepeat (int, char **, void *);
void mail_error (const char *fmt, ...);
int dosystime (int argc,char *argv[],void *p);
int DisplayFile (const char *fname,int thesocket);
int docrashprot (int, char **, void *);
int shall_we_crash (void);
void crash_it_already (char const *where);
#ifdef SETPSINFO
void setprocname (char *str);
#endif

/* In mbfilter.c */
int mbfilter (FILE *fp,const char *from,const char *to);

/* In merge.c */
FILE *fopennew (const char *fname, const char *mode);
FILE *fopentmp (const char *fname, const char *mode);
int merge (const char *fname);

/* In message.c */
#ifdef MESSAGESERVER
int message1 (int argc, char **argv, void *p);
int message0 (int argc, char **argv, void *p);
#endif

/* In misc.c */
int readhex (char *out,char *in,int size);
void kmutex_lock (int *key);
void kmutex_unlock (int *key);

#ifdef NODECALL
/* In node.c */
int donode (int argc, char *argv[], void *p);
int node_incom (int argc, char *argv[], void *p);
#endif

/* In nntpcli.c */
int donntp (int argc,char *argv[],void *p);

/* In nntpserv.c */
#ifdef	NNTPS
int nntp0 (int argc, char *argv[], void *p);
int nntp1 (int argc, char *argv[], void *p);
#endif

/* In nrcmd.c */
int donetrom (int argc,char *argv[],void *p);
int nr_attach (int argc,char *argv[],void *p);

/* in pbbscmd.c */
int douptime (int, char **, void *);
int dombchat (int, char **, void *);

#ifdef MSDOS
/* In pc.c */
int doshell (int argc,char *argv[],void *p);
int dofkey (int argc,char *argv[],void *p);
int doisat (int argc,char *argv[],void *p);
#if defined(ALLCMD) && !defined(UNIX)
int dobmail (int argc,char *argv[],void *p);
#endif
#endif

#ifdef PC100
/* In pc100.h: */
int pc_attach (int argc,char *argv[],void *p);
#endif

#ifdef PACKET
/* In pktdrvr.c */
int pk_attach (int argc,char *argv[],void *p);
#endif

#ifdef PI
/* In pi.c */
int pi_attach (int argc,char *argv[],void *p);
int dopistat (int argc,char *argv[],void *p);
#endif

#ifdef UNIX
/* In pipe.c */
int dopipe (int argc, char *argv[], void *p);
#endif

#ifdef POP
/* In popcli.c */
int dopop (int argc,char *argv[],void *p);

/* In popserv.c */
int pop1 (int argc,char *argv[],void *p);
int pop0 (int argc,char *argv[],void *p);
#endif

#ifdef POP2SERVER
/* in pop2serv.c */
int pop2start   (int argc,char *argv[],void *p);
int pop2stop    (int argc,char *argv[],void *p);
#endif

#ifdef POP3SERVER
/* in pop3serv.c */
int pop3start   (int argc,char *argv[],void *p);
int pop3stop    (int argc,char *argv[],void *p);
#endif

/* In profile.c */
int doprofile (int argc,char *argv[],void *p);
int dombprofile (int argc,char *argv[],void *p);
int dombpasswd (int argc,char *argv[],void *p);

/* In rarp.c */
int dorarp (int argc,char *argv[],void *p);

/* In reqsvr.c */
int rdaemon (FILE *data,const char *replyto, const char *from, const char *to, const char *msg, const char msgtype, int mode);
int rmail (FILE *fp,const char *from);
#ifdef REQSVR
int reqsvr (FILE *fp,const char *from);
#endif

/* In ripcmd.c */
int dorip (int argc,char *argv[],void *p);
int doripinit (int argc,char *argv[],void *p);
int doripstat (int argc,char *argv[],void *p);
int doripstop (int argc,char *argv[],void *p);

/* In rdate.c */
int dordate (int argc,char *argv[],void *p);

/* In register.c */
int is_registered (void);
void reg_status (void);
int doregister (int argc,char *argv[],void *p);
int doregistry (int argc,char *argv[],void *p);

/* In reject.c */
int reject (const char *cmdstr, int rmtuser, int xfwd);

/* In reqsvr.c */
void parseheader (FILE *fp,char *from, char *subject, char *to, char *bid, char *buf,long *startat);
int dosendmail (int argc, char *argv[], void *p);

/* In rlogin.c */
int dorlogin (int argc,char *argv[],void *p);

/* In rspfcmd.c */
int dorspf (int argc,char **argv,void *p);

/* In rtcli.c */
#ifdef ENCAP
int routecli0 (int argc, char *argv[], void *p);
int routecli1 (int argc, char *argv[], void *p);
#endif

/* In rtserv.c */
#ifdef ROUTESERVER
int route0 (int argc, char *argv[], void *p);
int route1 (int argc, char *argv[], void *p);
#endif

#ifdef SCC
/* In scc.c */
int scc_attach (int argc,char *argv[],void *p);
int dosccstat (int argc,char *argv[],void *p);
#endif

/* In script.c */
int dogone (int argc,char *argv[],void *p);
int dohere (int argc,char *argv[],void *p);
int dosleep (int argc,char *argv[],void *p);
int dopause (int argc,char *argv[],void *p);
int doecho (int argc,char *argv[],void *p);
char * _variable_expansion (char *input);
int doalias (int argc,char *argv[],void *p);
int dounalias (int argc,char *argv[],void *p);
int doset (int argc,char *argv[],void *p);
int dounset (int argc,char *argv[],void *p);
int doincr (int argc,char *argv[],void *p);
int dodecr (int argc,char *argv[],void *p);
int dogoto (int argc,char *argv[],void *p);
int dolabel (int argc,char *argv[],void *p);
int doif (int argc,char *argv[],void *p);
int doelse (int argc,char *argv[],void *p);
int doforeach (int argc,char *argv[],void *p);
int dowhile (int argc,char *argv[],void *p);
int dountil (int argc,char *argv[],void *p);
int doifdef (int argc,char *argv[],void *p);
int doifndef (int argc,char *argv[],void *p);


/* In search.c */
int searchfile (register char *searchfor,const char *fname,register char *buf,int entrysize, int *passes, int searchlen);

/* In security.c */
int dosecurity (int argc, char *argv[], void *p);

/* In session.c */
int dosession (int argc,char *argv[],void *p);
int go (int argc,char *argv[],void *p);
int doclose (int argc,char *argv[],void *p);
int doreset (int argc,char *argv[],void *p);
int dokick (int argc,char *argv[],void *p);
int dorecord (int argc,char *argv[],void *p);
int doupload (int argc,char *argv[],void *p);
void sesflush(void);

/* In smisc.c */
void server_disconnect_io (void);
int deleteserver (int *mysocket);
int installserver (int argc,char *argv[],int *mysocket,const char *listener,
	int defport, uint32 defaddress, const char *procname,
	void (*proc) (int,void *,void *),
	unsigned int size, void *parm);
int dis1 (int argc,char *argv[],void *p);
int dis0 (int argc,char *argv[],void *p);
int echo1 (int argc,char *argv[],void *p);
int echo0 (int argc,char *argv[],void *p);
int time1 (int argc,char *argv[],void *p);
int time0 (int argc,char *argv[],void *p);
int daytime1 (int argc,char *argv[],void *p);
int daytime0 (int argc,char *argv[],void *p);
int rem1 (int argc,char *argv[],void *p);
int rem0 (int argc,char *argv[],void *p);
int quote1 (int argc,char *argv[],void *p);
int quote0 (int argc,char *argv[],void *p);
int doquote (int argc, char *argv[], void *p);

#ifdef UNIX
/* In sessmgr.c */
int dosessmgr (int, char **, void *);
#endif

#ifdef SOUNDS
int dosounds (int argc,char *argv[],void *p);
int playsound (const char *soundname);
int setsoundstr (int argc,char *argv[],char **sound);
#endif

#ifdef RLOGINSERV
int rlogin0 (int argc, char *argv[], void *p);
int rlogin1 (int argc, char *argv[], void *p);
#endif

#ifdef TUTOR
int tutor0 (int argc, char *argv[], void *p);
int tutor1 (int argc, char *argv[], void *p);
int info0 (int argc, char *argv[], void *p);
int info1 (int argc, char *argv[], void *p);
int news0 (int argc, char *argv[], void *p);
int news1 (int argc, char *argv[], void *p);
int dotutor (int argc, char *argv[], void *p);
int doinfo (int argc, char *argv[], void *p);
int donews (int argc, char *argv[], void *p);
#endif

#ifdef TRACESERVER
int trace0 (int argc, char *argv[], void *p);
int trace1 (int argc, char *argv[], void *p);
#endif

/* In smtpcli.c */
int dosmtp (int argc,char *argv[],void *p);

/* In smtpserv.c */
int smtp1 (int argc,char *argv[],void *p);
int smtp0 (int argc,char *argv[],void *p);
char *ptime (time_t *t);

/* In sockcmd.c */
int dosock (int argc,char *argv[],void *p);
int dokicksocket (int argc,char *argv[],void *p);
int doresetsocket (int argc,char *argv[],void *p);

/* In ssaver.c */
#ifdef SCREENSAVER
void screensaver (void);
void sskick (void);
int ssenabled (void);
int dossaver (int argc, char *argv[], void *p);
#endif

/* In statline.c */
int dostatline (int argc, char *argv[], void *p);
int dostatmode (int argc, char *argv[], void *p);
void screendaemon (int i, void *v1, void *v2);
void marquee_display (char *str, int *position);
int statnews0 (int argc, char *argv[], void *p);
int statnews1 (int argc, char *argv[], void *p);
int getStatlines (void);

/* In stats.c */
#ifdef STATS
void statsdaemon (int i, void *v1, void *v2);
int dostats (int argc,char *argv[],void *p);
int doSTATsave (int argc,char *argv[],void *p);
#ifdef STATS_USE
void STATS_adduse (int which);
int STATdaily_use (int argc,char *argv[],void *p);
int STATweekly_use (int argc,char *argv[],void *p);
int STATmonthly_use (int argc,char *argv[],void *p);
int STATyearly_use (int argc,char *argv[],void *p);
int STATgeneral_use (int argc,char *argv[],void *p);
#endif
#ifdef STATS_MSG
void STATS_addmsg (int which, int amount);
int STATdaily_msg (int argc,char *argv[],void *p);
int STATweekly_msg (int argc,char *argv[],void *p);
int STATmonthly_msg (int argc,char *argv[],void *p);
int STATyearly_msg (int argc,char *argv[],void *p);
int STATgeneral_msg (int argc,char *argv[],void *p);
#endif
#ifdef STATS_HTTP
void STATS_addhttp (int which);
int STATdaily_http (int argc,char *argv[],void *p);
int STATweekly_http (int argc,char *argv[],void *p);
int STATmonthly_http (int argc,char *argv[],void *p);
int STATyearly_http (int argc,char *argv[],void *p);
int STATgeneral_http (int argc,char *argv[],void *p);
#endif
#ifdef STATS_TFC
void STATS_addtfc (int which, int amount);
int STATdaily_tfc (int argc,char *argv[],void *p);
int STATweekly_tfc (int argc,char *argv[],void *p);
int STATmonthly_tfc (int argc,char *argv[],void *p);
int STATyearly_tfc (int argc,char *argv[],void *p);
int STATgeneral_tfc (int argc,char *argv[],void *p);
#endif
#ifdef STATS_AREA
void STATS_addarea (int which, int amount, char *name);
#endif
#ifdef STATS_FWD
void STATS_addfwd (int which, int amount, char *name);
#endif
#endif

/* In tcpcmd.c */
int dotcp (int argc,char *argv[],void *p);

/* In tcpgate.c */
#ifdef TCPGATE
int tcpgate1 (int argc, char *argv[], void *p);
int tcpgate0 (int argc, char *argv[], void *p);
#endif

/* In telnet.c */
int doechomode (int argc,char *argv[],void *p);
int doeol (int argc,char *argv[],void *p);
int dotelnet (int argc,char *argv[],void *p);
int dobbs (int argc,char *argv[],void *p);
int doconf (int argc,char *argv[],void *p);

/* In term.c */
#ifdef TERMSERVER
int doterm (int argc,char *argv[],void *p);
int term0 (int argc,char *argv[],void *p);
int term1 (int argc,char *argv[],void *p);
#endif

/* In timer.c */
int dotimers (int argc, char *argv[], void *p);

/* In tip.c */
int dotip (int argc,char *argv[],void *p);

/* In tipmail.c */
int telnet0 (int argc, char *argv[], void *p);
int telnet1 (int argc, char *argv[], void *p);
int fbbtelnet0 (int argc, char *argv[], void *p);
int fbbtelnet1 (int argc, char *argv[], void *p);
#ifdef TIPMAIL
int tipstart (int argc, char *argv[], void *p);
int tip0 (int argc, char const *argv[], void *p);
#endif

/* In trace.c */
int dotrace (int argc,char *argv[],void *p);
int dostrace (int argc,char *argv[],void *p);

/* In ts_serv.c */
#ifdef TSCRIPTSERVER
int tscript1 (int argc, char **argv, void *p);
int tscript0 (int argc, char **argv, void *p);
#endif

/* In ttylink.c */
int ttylstart (int argc,char *argv[],void *p);
int ttyl0 (int argc,char *argv[],void *p);
int chatcmd (int argc,char *argv[],void *p);

/* In tutor.c */
#ifdef SKIP_HACK
char *skipnonwhite (char *ptr);
char *skipwhite (char *ptr);
#else
char *skipnonwhite (char const *ptr);
char *skipwhite (char const *ptr);
#endif
void trimright (char *ptr);
void trimrightCR (char *ptr);

#ifdef TUTOR
int doscript (int argc, char *argv[], void *p);
#endif

/* In udpcmd.c */
int doudp (int argc,char *argv[],void *p);

#ifdef UNIX
/* In unix.c */
int doshell (int argc,char *argv[],void *p);

/* In unixasy.c */
int Unixlockfile (char const *name, int dev, char const *_basename, int silent);
void findUnixLockdir (char *where);
#endif

/* In version.c */
int doversion (int argc,char *argv[],void *p);

/* In view.c */
int doview (int argc,char *argv[],void *p);

/* In warnings.c */
int dowarnings (int argc, char *argv[], void *p);

#endif  /* _COMMANDS_H */
