home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Devil's Doorknob BBS Capture (1996-2003)
/
devilsdoorknobbbscapture1996-2003.iso
/
Dloads
/
WWIVMODS
/
MODSUNKN.ZIP
/
PREVLINE.MOD
< prev
next >
Wrap
Text File
|
1990-04-09
|
9KB
|
202 lines
Goose #14 @7303
Sat Apr 07 08:39:58 1990
Backspace to Previous Line
This is an update to my previous versions of the mod. I've made the following
changes and enhancements to the mod for this release of the PREVLINE mod:
- The calling of the inli void is unchanged, since there are other mods
that may use this "standard" function. Instead, I've added an inli2
that controls the backspacing capabilities.
- I've fixed the problem where colors are not displayed correctly when
backspacing to the previous line.
- This mod also has all the fixes I've previously released. Hey, what can
I say? I'm not perfect, unlike some people <grin>...
OK, on with the mod itself. What this mod does is allow users to backspace to
the previous line while posting a message. When the user gets to the
beginning of the line, the message:
[*> Previous Line <*]
is displayed, the previous line is shown, and the cursor is placed at the end
of the line. This makes it much easier to fix mistakes that are made at the
end of a line, since it saves the user from having to type /ED and re-enter
the entire line. This mod will sure be a blessing to those users who have not
yet learned to use a full screen editor (which, by the way, is the reason I
didn't bother to try to update the tiny editor that Wayne built in to the
source. Sysops should know enough to use a full screen editor).
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.
NOTE: If you have installed the previous version of this mod, you will
probably get the error "too many parameters in call to inli" or
something very similar to that. Well, if you look at the end of these
lines you will notice that there is a ",0" (comma followed by a zero)
just before the right parenthesis. Remove this and it should compile
just fine.
If there are any questions, comments, or whatever, I can be reached at 1@7312
or via the mods net, or my BBS at 703-369-5225. Maybe I've got this mod good
enough where Wayne will consider implementing it in the next release of the
source code.
3«« 2Goose 3»»0