home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Devil's Doorknob BBS Capture (1996-2003)
/
devilsdoorknobbbscapture1996-2003.iso
/
Dloads
/
WWIVMODS
/
MODSUNKN.ZIP
/
PREVLINE.C
< prev
next >
Wrap
Text File
|
1990-10-12
|
6KB
|
158 lines
First, load up FCNS.H and make the following change (note: - designates
existing code, + designates new or modified code. The & symbol indicates
lines that were split by the message editor to make it fit into the 80
column width. All these should be removed before trying to compile. They
are there to make your life easier):
- char *mmkey(int dl);
+ int inli2(char *s, char *rollover, int maxlen, int crend, int wb); /* mod -
& add */
- void inli(char *s, char *rollover, int maxlen, int crend);
- void getuser();
Now, load up BBSUTL.C and add the following external variable declaration at
the top of the file:
- extern char charbuffer[161];
- extern userrec thisuser;
+ extern int charbufferpointer,chatting,curatr; /* mod - change */
- extern int usernum,useron,num_sec,helpl;
Now find the inli(..) void to and rename it to inli2(..), and make the
following changes to it. Note also that it is being changed from a void to an
int function:
+ int inli2(char *s, char *rollover, int maxlen, int crend, int wb) /* mod -
& change */
- {
- int cp,i,i1,done,cm,begx;
- char s1[255];
- unsigned char ch;
And a little farther down in the code:
- backspace();
- }
+ } else /* mod - change */
+ if (wb) { /* mod - add */
+ i=curatr; /* mod - add */
+ ansic(3); /* mod - add */
+ pl("[*> Previous Line <*]"); /* mod - add */
+ setc(i); /* mod - add */
+ return(1); /* mod - add */
+ } /* mod - add */
- break;
- case 24: /* Ctrl-X */
And at the very bottom of the function:
- }
- if (crend)
- nl();
+ return(0); /* mod - add */
- }
Then, add a replacement inli function as shown. This will allow other mods to
call this function in the same way they always have:
+ void inli(char *s, char *rollover, int maxlen, int crend) /* mod - change
& entire void */
+ {
+ inli2(s,rollover,maxlen,crend,0);
+ }
- void getuser()
Next, load COM.C and make the following change in char inkey() to fix the
problem with changing colors in the line:
- if (charbufferpointer) {
- if (!charbuffer[charbufferpointer])
- charbufferpointer = charbuffer[0] = 0;
+ else { /* mod - change */
+ if ((charbuffer[charbufferpointer])==3) /* mod - add */
+ charbuffer[charbufferpointer]=16; /* mod - add */
- return(charbuffer[charbufferpointer++]);
+ } /* mod - add */
- }
OK, now for the change to MSGBASE.C to allow the user to actually to the
backspace. Make the following changes in void inmsg(...):
- while (!done) {
- helpl=27;
+ while (inli2(s,ro,160,1,curli)) { /* mod - change */
+ --curli; /* mod - add */
+ strcpy(ro,&(lin[(curli)*LEN])); /* mod - add */
+ if (strlen(ro)>thisuser.screenchars-1) /* mod - add */
+ ro[thisuser.screenchars-2]=0; /* mod - add */
+ } /* mod - add */
- if (hangup)
- done=1;
- savel=1;
And one more change in XFER.C to allow the user to back up when entering the
extended file description in void modify_extended_description(...). The first
part is in the variable declarations:
- void modify_extended_description(char **sss)
- {
- char s[161],s1[161];
+ int f,ii,i,i1,i2,i3; /* mod - change */
-
- if (*sss)
Then, a little farther down in the code:
- i=1;
+ i3=0; /* mod - add */
- nl();
- sprintf(s,"Enter up to %d lines, %d chars
& each.",MAX_LINES,78-INDENTION);
- pl(s);
- nl();
- s[0]=0;
- i1=thisuser.screenchars;
- if (thisuser.screenchars>(76-INDENTION))
- thisuser.screenchars=76-INDENTION;
- do {
- itoa(i,s1,10);
- strcat(s1,": ");
- prt(2,s1);
- s1[0]=0;
+ while (inli2(s1,s,90,1,i3)) { /* mod - change */
+ --i; /* mod - add */
+ itoa(i,s1,10); /* mod - add */
+ strcat(s1,": "); /* mod - add */
+ prt(2,s1); /* mod - add */
+ i2=0; /* mod - add */
+ i3-=2; /* mod - add */
+ do { /* mod - add */
+ s[i2]=*(sss[0]+i3-1); /* mod - add */
+ ++i2; /* mod - add */
+ --i3; /* mod - add */
+ } while ((*(sss[0]+i3)!=10) && (i3!=0)); /* mod - add */
+ if (i3) /* mod - add */
+ ++i3; /* mod - add */
+ *(sss[0]+i3)=0; /* mod - add */
+ s[i2]=0; /* mod - add */
+ strrev(s); /* mod - add */
+ if (strlen(s)>thisuser.screenchars-1) /* mod - add */
+ s[thisuser.screenchars-2]=0; /* mod - add */
+ } /* mod - add */
- i2=strlen(s1);
- if (i2 && (s1[i2-1]==1))
- s1[i2-1]=0;
- if (s1[0]) {
- strcat(s1,"En");
+ i3+=strlen(s1); /* mod - add */
- strcat(*sss,s1);
- }
- } while ((i++<10) && (s1[0]));
(NOTE: There may have been an easier way to accomplish this part of the code,
but I sure can't figure it out!).
That's it. You will need to recompile the entire BBS due to the change to
FCNS.H.