COMPLETE FLEIDZ13.MOD (read in FILE_ID/DESC.SDI as desc) David Morse #116 @8315 1Sunday, 2March 328, 51993 7@ 1 86:149 7pm 2EST ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ Mod Name: FLEIDZ13.MOD Mod Author: Etheral Cereal ³ ³ Difficulty: ÛÛ±±±±±±±± Mod Updated by: David Morse ³ ³ WWIV Versions: 4.21a/4.22 Date: March 28th, 1993 ³ ³ Affected Files: XFER.C, BBS.C, BATCH.C, FILEIDZ.C ³ ³ Version: 1.3 (COMPLETE version) ³ ³ Steps: 4 ³ ³ Description: This is a small but USEFUL update to Etheral Cereal's ³ ³ fantastic mod. It eliminates the need for TWO extraction ³ ³ commands by comibing DESC.SDI and FILE_ID.DIZ on the ³ ³ extract command line (thus making the mod about 2 times ³ ³ faster! :) ) ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ Note from David: This is a slimmed-down version of 1.2, in that it doesn't contain a page-full of comments by Etheral Cereal. Basically, this mod will read in FILE_ID.DIZ or DESC.SDI as the description as soon as an archived file is uploaded. For boxes, it will not look aligned correctly, but hey, thems the breaks. My changes are in FILEIDZ.C marked by a "// DM" line. I DEFINITELY did not write this; I just streamlined the extraction commands making it a LOT faster (esp when using the //CHECKIDZ on multiple directories!). If upgrading from 1.2, skip down to Step 4 and re-read "void fileidz". Etheral's net address is no longer in the net, so I went ahead and posted this (I'm sure he doesn't mind ). ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ /***********************/ /* L E G E N D */ /***********************/ /* - = Deleted Line */ /* + = New Line */ /* # = Existing Line */ /* ! = Modified Line */ /* * = Search For Line */ /***********************/ Step #1 -- XFER.C (v4.21a) Function -- void upload(int dn) Comments -- Just an insert. No biggie. # ++thisuser.uploaded; # thisuser.uk += ((l+1023)/1024); + fileidz(&u,dn); /* MOD */ # } else # u.numbytes=0; Step #2 -- BBS.C (v4.21a) Function -- void dlmainmenu(void) Comments -- Put this in right before the REN command [(strcmp(s,"REN")==0)]. This will allow you to check one entire directory of previously uploaded files for FILE_ID.DIZ and DESC.SDI files. In general, this command will lose it's value after its first usage. Recommendation before using: Turn Off Pause! + if ((strcmp(s,"CHECKIDZ")==0) && (dcs())) /* MOD */ + check_idz(); Step #3 -- BATCH.C (v4.21a) Function -- void uploaded(char *fn, long cps) Comments -- Just slip this in for Batch Uploads support. # } # } # if (d1>=0) { + fileidz(&u,batch[i1].dir); /* MOD */ # u.numbytes = filelength(d1); # close(d1); Step #4 -- FILEIDZ.C (v1.2) Function -- N/A Comments -- This needs to get inserted into your MAKEFILE or your project file if you are one of those IDE-type people (and, no, not the hard drive). I recommended overlaying it, but will work just fine without it. Be sure to look at the beginning of the file to make the appropriate changes... (NOTE from David: The changes from 1.2 are in "void fileidz" so just re-read that in if upgrading.) /****************************************************************************** FILEIDZ.C a modification by Ethereal Cereal PURPOSE : To give WWIV a way to read in FILE_IDZ.DIZ and DESC.SDI's into the extended description. VERSION : v1.3 COMMENTS: Suggested by Rockett 1@6869, Icenet. ******************************************************************************/ #include "vars.h" #pragma hdrstop #define SETREC(i) lseek(dlf,((long) (i))*((long)sizeof(uploadsrec)),SEEK_SET); /* Uncomment next line if you don't have this defined in VARDEC.H like I do. */ /* #define MAX_LINES 10 */ void fileidz(uploadsrec *u,int dn) { char *extbuf=NULL,run_me[81],s[81],s2[81],*ss; int f,i; //extract FILE_ID.DIZ cd_to(directories[dn].path); get_dir(s2,1); strcat(s2,stripfn(u->filename)); cd_to(cdir); get_arc_cmd(run_me,s2,1,"FILE_ID.DIZ DESC.SDI"); // Add DESC.SDI cd_to(syscfg.tempdir); do_external(run_me,0); // this puts us back in root on return sprintf(s,"%sFILE_ID.DIZ",syscfg.tempdir); if (!exist(s)) // Major change, sprintf(s,"%sDESC.SDI",syscfg.tempdir); // whole chunk deleted if (exist(s)) { npr("Reading in %s as extended description...",s); ss=read_extended_description(u->filename); if (ss) { farfree(ss); delete_extended_description(u->filename); } // read in the file id if ((extbuf=malloca((long)MAX_LINES*1024))==NULL) return; f=open(s,O_RDWR | O_BINARY); if (filelength(f)<(MAX_LINES*1024)) { read(f,extbuf,(int) filelength(f)); (extbuf)[filelength(f)]=0; } else { read(f,extbuf,(int)MAX_LINES*1024); (extbuf)[(int)MAX_LINES*1024]=0; } close(f); ss=strtok(extbuf,"\n"); sprintf(u->description,"%s\0",ss); u->mask &= ~mask_extended; ss=strtok(NULL,"\0"); add_extended_description(u->filename,ss); u->mask |= mask_extended; farfree(extbuf); npr("Done.\r\n"); } unlink(s); cd_to(cdir); } void check_idz(void) { char s[81]; int i,abort; uploadsrec u; dliscan(); file_mask(s); abort=0; num_listed=0; printtitle(&abort); for (i=1; (i<=numf) && (!abort) && (!hangup); i++) { SETREC(i); read(dlf,(void *)&u,sizeof(uploadsrec)); if (compare(s,u.filename)) fileidz(&u,udir[curdir].subnum); SETREC(i); write(dlf,(void *)&u,sizeof(uploadsrec)); } closedl(); } // END OF FILEIDZ.C That's it....compile! Any questions can be directed to this address since EC is nowhere to be found. 1 27ÄÄÄÄÄÄÄÄÄÄÄÄÄÍÍÍÍÍÍÍÍÍÍÍÍÍ 1T2he 1T2rading 1P2ost 7[1SOUTH7] ÍÍÍÍÍÍÍÍÍÍÍÍÍÄÄÄÄÄÄÄÄÄÄÄÄÄÄ0 31Columbia, S.C. 2- 5(803) 731-0690 2-3 USR DS 16.8 2- 1WOMRable7 2- 3ASV 2- 7Icenet Support0 47 5WWIVNet7/3AdventNet7/4ICENet7 1@28315 6-1 FidoNet 21:376/126 0 5