#define ROUTINES_C
#include "citadel.h"
-
-char inkey();
-void sttybbs();
-void newprompt();
-void val_user();
-int intprompt();
-void formout();
-void logoff();
-void set_keepalives();
-void strprompt();
-void newprompt();
-void color();
+#include "routines.h"
+
+char inkey(void);
+void sttybbs(int cmd);
+void newprompt(char *prompt, char *str, int len);
+void val_user(char *user);
+int intprompt(char *prompt, int ival, int imin, int imax);
+void formout(char *name);
+void logoff(int code);
+void set_keepalives(int s);
+void strprompt(char *prompt, char *str, int len);
+void newprompt(char *prompt, char *str, int len);
+void color(int colornum);
#define IFAIDE if(axlevel>=6)
#define IFNAIDE if (axlevel<6)
extern struct CtdlServInfo serv_info;
extern char rc_floor_mode;
-int struncmp(lstr,rstr,len)
-char lstr[],rstr[];
-int len; {
+int struncmp(char *lstr, char *rstr, int len)
+{
int pos = 0;
char lc,rc;
while (pos<len) {
/*
* check for the presence of a character within a string (returns count)
*/
-int haschar(st,ch)
-char st[];
-int ch; {
+int haschar(char *st, int ch)
+{
int a,b;
b=0;
for (a=0; a<strlen(st); ++a) if (st[a]==ch) ++b;
/*
* num_parms() - discover number of parameters...
*/
-int num_parms(source)
-char source[]; {
+int num_parms(char *source)
+{
int a;
int count = 1;
/*
* extract() - extract a parameter from a series of "|" separated...
*/
-void extract(dest,source,parmnum)
-char dest[];
-char source[];
-int parmnum; {
+void extract(char *dest, char *source, int parmnum)
+{
char buf[256];
int count = 0;
int n;
/*
* extract_int() - extract an int parm w/o supplying a buffer
*/
-int extract_int(source,parmnum)
-char *source;
-int parmnum; {
+int extract_int(char *source, int parmnum)
+{
char buf[256];
extract(buf,source,parmnum);
/*
* extract_long() - extract a long parm w/o supplying a buffer
*/
-long extract_long(source,parmnum)
-char *source;
-int parmnum; {
+long extract_long(char *source, int parmnum)
+{
char buf[256];
extract(buf,source,parmnum);
return(atol(buf));
}
-void back(spaces) /* Destructive backspace */
-int spaces; {
+void back(int spaces) /* Destructive backspace */
+ {
int a;
for (a=1; a<=spaces; ++a) {
putc(8,stdout); putc(32,stdout); putc(8,stdout);
}
}
-int yesno() { /* Returns 1 for yes, 0 for no */
+int yesno(void) { /* Returns 1 for yes, 0 for no */
int a;
while (1) {
a=inkey(); a=tolower(a);
}
}
-int yesno_d(d) /* Returns 1 for yes, 0 for no, arg is default value */
-int d; {
+int yesno_d(int d) /* Returns 1 for yes, 0 for no, arg is default value */
+ {
int a;
while (1) {
a=inkey(); a=tolower(a);
}
-void hit_any_key() { /* hit any key to continue */
+void hit_any_key(void) { /* hit any key to continue */
int a,b;
printf("%s\r",serv_info.serv_moreprompt);
/*
* change a user's access level
*/
-void edituser(userbuf)
-struct usersupp *userbuf; {
+void edituser(void)
+{
char who[256];
char buf[256];
}
-int set_attr(sval,prompt,sbit)
-int sval;
-char *prompt;
-unsigned sbit; {
+int set_attr(int sval, char *prompt, unsigned int sbit)
+{
int a;
int temp;
* modes are: 0 - .EC command, 1 - .EC for new user,
* 2 - toggle Xpert mode 3 - toggle floor mode
*/
-void enter_config(mode)
-int mode; {
+void enter_config(int mode)
+{
int width,height,flags;
char buf[128];
* getstring() - get a line of text from a file
* ignores lines beginning with "#"
*/
-int getstring(fp,string)
-FILE *fp;
-char string[]; {
+int getstring(FILE *fp, char *string)
+{
int a,c;
do {
strcpy(string,"");
return(strlen(string));
}
-int pattern(search,patn) /* Searches for patn in search string */
-char search[];
-char patn[];
+int pattern(char *search, char *patn) /* Searches for patn in search string */
+
+
{
int a,b;
for (a=0; a<strlen(search); ++a)
return(-1);
}
-void interr(errnum) /* display internal error as defined in errmsgs */
-int errnum; {
+void interr(int errnum) /* display internal error as defined in errmsgs */
+ {
printf("*** INTERNAL ERROR %d\n",errnum);
printf("(Press any key to continue)\n");
inkey();
* we are probably in the middle of a server operation and the NOOP command
* would confuse everything.
*/
-int checkpagin(lp,pagin,height)
-int lp;
-int pagin; {
+int checkpagin(int lp, int pagin, int height)
+{
if (pagin!=1) return(0);
if (lp>=(height-1)) {
set_keepalives(KA_NO);
}
-void strproc(string)
-char string[];
+void strproc(char *string)
{
int a;
}
-int hash(str)
-char str[]; {
+int hash(char *str)
+{
int h = 0;
int i;
return(h);
}
-long finduser(file,name)
-int file;
-char *name; {
+long finduser(int file, char *name)
+{
FILE *fp;
int uh,fh;
long pp=0L;
}
-int alias(name) /* process alias and routing info for mail */
-char name[]; {
+int alias(char *name) /* process alias and routing info for mail */
+ {
FILE *fp;
int a,b;
char aaa[300],bbb[300];
/*
* replacement strerror() for systems that don't have it
*/
-char *strerror(e)
-int e; {
+char *strerror(int e)
+{
static char buf[32];
sprintf(buf,"errno = %d",e);
#endif
-void progress(curr,cmax)
-long curr;
-long cmax; {
+void progress(long int curr, long int cmax)
+{
static long dots_printed;
long a;
* NOT the same locate_host() in locate_host.c. This one just does a
* 'who am i' to try to discover where the user is...
*/
-void locate_host(hbuf)
-char hbuf[]; {
+void locate_host(char *hbuf)
+{
char buf[256];
FILE *who;
int a,b;
/*
* compute the checksum of a file
*/
-int file_checksum(filename)
-char *filename; {
+int file_checksum(char *filename)
+{
int cksum = 0;
int ch;
FILE *fp;
/*
* nuke a directory and its contents
*/
-int nukedir(dirname)
-char *dirname; {
+int nukedir(char *dirname)
+{
DIR *dp;
struct dirent *d;
char filename[256];