132 lines
3.4 KiB
C
Executable File
132 lines
3.4 KiB
C
Executable File
|
|
#include <stdio.h>
|
|
#include <ctype.h>
|
|
#include <string.h>
|
|
#include "config.h"
|
|
extern char *token[],buf[];
|
|
extern int sevsck,botsck;
|
|
|
|
|
|
do_ushelp(int sck)
|
|
{int j,k,l;
|
|
char filename[512];
|
|
k=chk_num(0);
|
|
if(k > 10) return 0;
|
|
*token[0]++;
|
|
if (k > 3) {
|
|
*token[3]++;
|
|
strcpy(filename,HELPPATH);
|
|
|
|
if(k==4) {
|
|
if(!match(token[3],"ON")) {
|
|
strcat(filename,"/ON/ON");
|
|
catfile(filename,USHELP);
|
|
return;
|
|
}
|
|
else if(!strcmp(token[3],"?")) {
|
|
strcat(filename,"/helplist");
|
|
catfile(filename,USHELP);
|
|
return;
|
|
}
|
|
else if(!match(token[3],"ALAIS")) {
|
|
strcat(filename,"/ALIAS/ALIAS");
|
|
catfile(filename,USHELP);
|
|
return;
|
|
}
|
|
else if(!match(token[3],"FAQ")) {
|
|
strcat(filename,"/FAQ/FAQ");
|
|
catfile(filename,USHELP);
|
|
return;
|
|
}
|
|
|
|
}
|
|
|
|
for(j=3;j<k;j++) {
|
|
strcat(filename,"/");
|
|
strcat(filename,token[j]);
|
|
}
|
|
|
|
for(l=0;l<strlen(filename);l++) filename[l] = toupper(filename[l]);
|
|
catfile(filename,USHELP);
|
|
}
|
|
else if(!match(token[3],":help")) {
|
|
strcpy(filename,"HELP/helplist");
|
|
catfile(filename,USHELP);
|
|
}
|
|
}
|
|
|
|
do_helpirc(int sck)
|
|
{int j,k,l;
|
|
char filename[180];
|
|
k=chk_num(0);
|
|
*token[0]++;
|
|
if(k > 10) { sprintf(filename,"%s/JOIN",HELPPATH);
|
|
return; }
|
|
if (k > 3) {
|
|
*token[3]++;
|
|
strcpy(filename,HELPPATH);
|
|
|
|
if(k==4) {
|
|
if(!match(token[3],"ON")) {
|
|
strcat(filename,"/ON/ON");
|
|
catfile(filename,IRCHELP);
|
|
return;
|
|
}
|
|
else if(!strcmp(token[3],"?")) {
|
|
strcat(filename,"/helplist");
|
|
catfile(filename,IRCHELP);
|
|
return;
|
|
}
|
|
else if(!match(token[3],"ALAIS")) {
|
|
strcat(filename,"/ALIAS/ALIAS");
|
|
catfile(filename,IRCHELP);
|
|
return;
|
|
}
|
|
else if(!match(token[3],"FAQ")) {
|
|
strcat(filename,"/FAQ/FAQ");
|
|
catfile(filename,USHELP);
|
|
return;
|
|
}
|
|
}
|
|
|
|
for(j=3;j<k;j++) {
|
|
strcat(filename,"/");
|
|
if((strlen(filename)+strlen(token[j])) > 500) return;
|
|
strcat(filename,token[j]);
|
|
if((strchr(filename,';')) || (strchr(filename,'|')))
|
|
return;
|
|
}
|
|
|
|
for(l=0;l<strlen(filename);l++) filename[l] = toupper(filename[l]);
|
|
catfile(filename,IRCHELP);
|
|
}
|
|
else if(!match(token[3],":help")) {
|
|
strcpy(filename,"HELP/helplist");
|
|
catfile(filename,IRCHELP);
|
|
}
|
|
}
|
|
|
|
do_helpem(int sck)
|
|
{int j,k,l;
|
|
char filename[180];
|
|
k=chk_num(0);
|
|
*token[0]++;
|
|
if ((k > 4) && (!match(token[3],":help"))) {
|
|
strcpy(filename,"HELP/");
|
|
|
|
if(k=5)
|
|
if(!match(token[4],"ON")) strcpy(filename,"ON/ON");
|
|
else if(!match(token[4],"ALAIS")) strcpy(filename,"ALIAS/ALIAS");
|
|
else if(!match(token[4],"FAQ")) strcpy(filename,"FAQ/FAQ");
|
|
else strcat(filename,token[4]);
|
|
|
|
printf("filename for help -- %s\n",filename);
|
|
for(l=0;l<strlen(filename);l++) filename[l] = toupper(filename[l]);
|
|
catfile(filename,HELPBOT);
|
|
}
|
|
else if(!match(token[3],":help")) {
|
|
strcpy(filename,"HELP/helplist");
|
|
catfile(filename,HELPBOT);
|
|
}
|
|
}
|