home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Devil's Doorknob BBS Capture (1996-2003)
/
devilsdoorknobbbscapture1996-2003.iso
/
Dloads
/
WWIVMODS
/
MODSUNKN.ZIP
/
GIFDESC.MOD
< prev
next >
Wrap
Text File
|
1990-05-11
|
2KB
|
99 lines
Snorkel #1 @3459
Wed May 09 08:34:52 1990
5Reference : 1Mod Requests:0
5Written by: 2Warrior #304 @31100
I did not write this mod. Just those places that you see 2YELLOW0 (^P2), are
places where I modified the code to make it operate more smoothly.
1 °0
1 °0
1 °0
1°0
4Snorkel 1@34590
4==============================================================================0
This is a simple mod that will automatically add a prefix to any GIF file
that is uploaded to your board, remotely or locally. The prefix will be in
the format of (WWxHHxCC), where WW is the width, HH is the height, and CC is
the number of colors used.
Legend: * Existing Line - search for this.
+ Add this line
In XFER.C in function void upload add the following line.
* if (ok) {
* l=filelength(f);
* u.numbytes=l;
* close(f);
+ if (2strstr0(u.filename,"2.GIF0"))
+ check_gif(s1,u.description);
* ++thisuser.uploaded;
* thisuser.uk += ((l+1023)/1024);
Then add the following line in int upload_file.
* if (s[0]==0)
* return(0);
* ++thisuser.uploaded;
+ if (2strstr0(u.filename,"2.GIF0"))
+ check_gif(ff,u.description);
* thisuser.uk += ((l+1023)/1024);
Then, block read the following two functions to the end of SR.C
int getbytes(FILE *dev)
{
int byte1;
int byte2;
int result;
/* read bytes and shift over */
byte1 = getc(dev);
byte2 = getc(dev);
result = (byte2 << 8) | byte1;
return result;
}
void check_gif(char *fn, char *descript)
{
int byte1, bits_per_pix,colors,i;
unsigned int width;
unsigned int height;
FILE *in;
char s[81];
in = fopen (fn, "rb");
for (i = 0; (i < 6); i++) s[i] = getc(in);
s[6] = '\0';
width = getbytes(in);
height = getbytes(in);
byte1 = getc(in);
fclose(in);
if (strcmp(s,"GIF87a")) {
sprintf(s,"%s -- NOT a GIF file.",fn);
sysoplog(s);
return;
}
bits_per_pix = byte1 & 0x07;
bits_per_pix++;
colors = 1 << bits_per_pix;
sprintf(s,"(%dx%dx%2-30d) %s",width,height,colors,descript);
strcpy(descript,s);
}
And that's all! Just recompile your BBS and you are finished.
Note: You can put the two new functions anywhere, but then you will
need to put an entry in FCNS.H for them, thus making you re-
compile the entire 50K lines of the BBS.
Thog