home *** CD-ROM | disk | FTP | other *** search
- /*--------------------------------------------------------------------------*/
- /* */
- /* XBBS SOURCE CODE copyright (c) 1990 by M. Kimes */
- /* All Rights Reserved */
- /* */
- /* For complete details of the licensing restrictions, please refer */
- /* to the License agreement, which is published in its entirety in */
- /* the in the file LICENSE.XBS. */
- /* */
- /* USE OF THIS FILE IS SUBJECT TO THE RESTRICTIONS CONTAINED IN THE */
- /* XBBS LICENSING AGREEMENT. IF YOU DO NOT FIND THE TEXT OF */
- /* THIS AGREEMENT IN ANY OF THE AFOREMENTIONED FILES, OR IF YOU DO */
- /* NOT HAVE THESE FILES, YOU SHOULD IMMEDIATELY CONTACT M. KIMES */
- /* AT THE ADDRESS LISTED BELOW. IN NO EVENT SHOULD YOU PROCEED TO USE */
- /* THIS FILE WITHOUT HAVING ACCEPTED THE TERMS OF THE XBBS LICENSING */
- /* AGREEMENT, OR SUCH OTHER AGREEMENT AS YOU ARE ABLE TO REACH WITH */
- /* M. KIMES */
- /* */
- /* */
- /* You can contact M. Kimes at the following address: */
- /* */
- /* M. Kimes 1:380/16.0@FidoNet */
- /* 542 Merrick (318)222-3455 data */
- /* Shreveport, LA 71104 */
- /* */
- /* */
- /* Please feel free to contact me at any time to share your comments about */
- /* my software and/or licensing policies. */
- /* */
- /*--------------------------------------------------------------------------*/
- /************************************************************************/
- /* XBBS XIjit module (Ijit-mode, named for the ijits who use it :-) */
- /************************************************************************/
-
- #include "msg.h"
- #include "xext.h"
-
-
- void pascal xijit (void) {
-
- char command;
- static char comstring[26]="";
- int register x;
- char s[133];
- char prettystring[256]="";
- char *divie[28];
- char lastcommand=0;
- char highcommand,wascommand;
-
- cls();
- redraw_stat(NULL);
- printm("\n\04Ijit-mode\n");
- if(!*comstring) strncpy(comstring,say_prompt(453),26);
- strncpy(prettystring,say_prompt(580),256);
- prettystring[255]=0;
- divie[0]=strtok(prettystring," ");
- if(divie[0]) {
- x=1;
- while((divie[x]=strtok(0," ")) && x<26) {
-
- char *p;
-
- while(p=strchr(divie[x],'_')) *p=' ';
- x++;
- }
- highcommand=(char)x-1;
- }
- while(1) {
- if ((user.ansimenus || !user.graphics) || !divie[0]) {
- say_prompt(448);
- helpnum=576;
- command=*genin(1,0,1,1,ALLL);
- helpnum=0;
- for(x=0;x<(int)(highcommand+1);x++) {
- if(toupper(*divie[x])==toupper(command)) {
- printm(&divie[x][1]);
- }
- }
- }
- else {
- FancyReDo:
- say_prompt(581);
- FancyRepeat:
- printm(divie[lastcommand]);
- FancyNull:
- helpnum=0;
- command=*genin(1,0,1,1,HYPER);
- wascommand=lastcommand;
- switch((int)command) {
- case 0: command=toupper(*divie[lastcommand]);
- goto DirectEntry;
- case 1:
- case 4:
- case '4':
- case '8': if(lastcommand==0) lastcommand=highcommand;
- else lastcommand--;
- break;
- case 5:
- case 2:
- case '6':
- case '2': if(lastcommand==highcommand) lastcommand=0;
- else lastcommand++;
- break;
- case 11:
- case 27: printm("\n");
- say_prompt(454);
- printm("\n");
- goto FancyReDo;
- case 3: printm("\n");
- goto FancyReDo;
- default: for(x=0;x<(int)(highcommand+1);x++) {
- if(toupper(command)==toupper(*divie[x])) {
- if(lastcommand!=(char)x) {
- lastcommand=(char)x;
- backup(divie[wascommand]);
- printm(divie[lastcommand]);
- }
- goto DirectEntry;
- }
- }
- backup(divie[wascommand]);
- gprintf(0,"%c",command);
- goto DirectEntry;
- }
- backup(divie[wascommand]);
- goto FancyRepeat;
- }
- DirectEntry:
- printm("\n");
- for(x=0;x<27;x++) {
- if(comstring[x]==command) {
- command=(char)x+1;
- break;
- }
- if(!comstring[x])break;
- }
- switch ((int)command) {
- case '*': readfile("IJITXTRA.XBS",1,1,1);
- break;
- case 6:
- case 0: say_prompt(454);
- break;
- case 1: cls();
- sprintf(buffer,"%sMSGS.XBS",conf.menupath);
- if(!findfirst(buffer,&filestat,0)) {
- readfile("MSGS.XBS",1,1,1);
- break;
- }
- dobulls(NULL,3);
- cls();
- break;
- case 2: cls();
- sprintf(buffer,"%sFILES.XBS",conf.menupath);
- if(!findfirst(buffer,&filestat,0)) {
- readfile("FILES.XBS",1,1,1);
- break;
- }
- xfile(NULL,2);
- cls();
- break;
- case 3: cls();
- sprintf(buffer,"%sDOORS.XBS",conf.menupath);
- if(!findfirst(buffer,&filestat,0)) {
- readfile("DOORS.XBS",1,1,1);
- break;
- }
- xdoor(NULL,3);
- cls();
- break;
- case 4: cls();
- {
- char coms[26]="";
- char com;
-
- sprintf(buffer,"%sCONFIGUR.XBS",conf.menupath);
- if(!findfirst(buffer,&filestat,0)) {
- readfile("CONFIGUR.XBS",1,1,1);
- break;
- }
- strncpy(coms,say_prompt(457),26);
- while(1) {
- say_prompt(456);
- com=*genin(1,0,1,1,ALPHA);
- printm("\n");
- for(x=0;x<27;x++) {
- if(coms[x]==com) {
- com=(char)x+1;
- break;
- }
- if(!coms[x])break;
- }
- switch((int)com) {
- case 1: usertoggle(GRAPHICS);
- break;
- case 2: usertoggle(MORE);
- break;
- case 3: usertoggle(SCRNCLR);
- break;
- case 4: say_prompt(247);
- width();
- break;
- case 5: say_prompt(246);
- length();
- break;
- case 6: password();
- break;
- case 7:
- case 0: goto BreakOut;
- case 8: user.cold=1-user.cold;
- if(user.cold) printm("Cold\n");
- else printm("Hot\n");
- break;
- case 9: say_prompt(458);
- break;
- default: printm("\07");
- break;
- }
- }
- }
- BreakOut:
- cls();
- break;
- case 5: sprintf(buffer,"%sLOGOFF.XBS",conf.menupath);
- if(!findfirst(buffer,&filestat,0)) {
- readfile("LOGOFF.XBS",1,1,1);
- break;
- }
- say_prompt(455);
- if(*genin(1,0,1,1,YESNO)!='N') {
- cls();
- readfile("GOODBYE.XBS",1,1,1);
- fossil(FLUSHOUT,0);
- fossil(DTR,DOWN);
- baud=0;
- leaving++;
- logoff();
- userno=0;
- exit(254);
- }
- printm("\n");
- break;
- default: sprintf(s,"XIJIT%03hu.XBS",command);
- readfile(s,1,1,1);
- break;
- }
- }
- }
-
-