home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Devil's Doorknob BBS Capture (1996-2003)
/
devilsdoorknobbbscapture1996-2003.iso
/
Dloads
/
WWIVMODS
/
MODSUNKN.ZIP
/
MSGQUOT3.MOD
< prev
next >
Wrap
Text File
|
1990-07-11
|
4KB
|
76 lines
Goose #19 @7313
Mon Jul 02 18:20:58 1990
That's it for the quote itself. It will work fine as long as the user has
selected a full screen editor. Unfortunately, many don't like to do this and
instead stick with the internal editor in WWIV. The next part of this mod
allows the user to delete lines using the internal editor (which is necessary
to be able to really use the quote feature), and allows the internal editor to
be loaded from an external file. Load up MSGBASE.C and find void
load_workspace(...), then make the following change to allow editing of
messages when using the internal editor:
- strcat(s,"INPUT.MSG");
- i5=open(s,O_RDWR | O_CREAT | O_BINARY,S_IREAD | S_IWRITE);
- write(i5, (void *)b,l);
- close(i5);
- farfree(b);
+ if (no_edit) /* mod - change */
- use_workspace=1;
- else
- use_workspace=0;
Then go down to void inmsg(...), and add the variable declarations as shown.
You can include them on the line with the other int variables if you want, I
just figured it would be easier this way.
+ int i5,i6; /* mod - add */
And if you haven't defined it in another mod, you'll have to add l2 as well:
+ long l2; /* mod - add */
Then, go down a few lines and make the following change to correctly set the
flag only if an external editor is selected:
- strcat(fnx,"INPUT.MSG");
- if (fsed)
- fsed=1;
+ if ((use_workspace) && (okfsed)) { /* mod - change */
- if (!exist(fnx))
And a few lines farther down, add the following code to read in the input file
for the internal editor:
- for (i=0; i<maxli; i++)
- lin[i*LEN]=0;
- ro[0]=0;
+ if (exist(fnx)) { /* mod - add */
+ f=open(fnx,O_RDONLY | O_BINARY); /* mod - add */
+ l1=filelength(f); /* mod - add */
+ if ((b=malloca(l1))!=NULL) { /* mod - add */
+ read(f,(void *)b,l1); /* mod - add */
+ i5=0; l2=0; /* mod - add */
+ do { /* mod - add */
+ if (b[l2]==13) { /* mod - add */
+ s[i5]=0; /* mod - add */
+ strcpy(&(lin[(curli++)*LEN]),s); /* mod - add */
+ ++l2; /* mod - add */
+ i5=0; /* mod - add */
+ } else /* mod - add */
+ if ((b[l2]!=10) && (b[l2]!=26)) { /* mod - add */
+ s[i5]=b[l2]; /* mod - add */
+ ++i5; /* mod - add */
+ } /* mod - add */
+ ++l2; /* mod - add */
+ } while (l2<l1); /* mod - add */
+ farfree(b); /* mod - add */
+ } /* mod - add */
+ close(f); /* mod - add */
+ unlink(fnx); /* mod - add */
+ } /* mod - add */
- }
-
- nl();
- helpl=6;
(Continued...)