home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.wwiv.com
/
ftp.wwiv.com.zip
/
ftp.wwiv.com
/
pub
/
EVENTS
/
MTSCN303.ZIP
/
MTI-SCAN.MOD
< prev
next >
Wrap
Text File
|
1994-12-04
|
11KB
|
333 lines
-------------------------------------------------------------------------------
Source Code Modifications
-------------------------------------------------------------------------------
Current users must review the source code modifications for use with WWIV 4.23.
-------------------------------------------------------------------------------
In XFER.C add the following lines:
== - Current WWIV Code.
++ - Add To Current WWIV Code.
+= - Modify Current WWIV Code.
== int foundany;
==
++ extern int RunScanLine(char *);
Now in UPLOAD() add:
==void upload(int dn)
=={
== directoryrec d;
== uploadsrec u, u1;
+= int i, i1, i2, i3, i4, ok, xfer, f, Rc; /* Add Rc to top of function */
== char s[255], s1[81], *ss;
A little further down add:
== if (ok == 1)
== {
== f = sh_open1(s1, O_RDONLY | O_BINARY);
== if (f < 0)
== {
== ok = 0;
== nl();
== nl();
== pl(get_string(780));
== nl();
== if (u.mask & mask_extended)
== delete_extended_description(u.filename);
== }
++ if (((strstr(u.filename, ".ARJ") != NULL) ||
++ (strstr(u.filename, ".LZH") != NULL) ||
++ (strstr(u.filename, ".ZOO") != NULL) ||
++ (strstr(u.filename, ".EXE") != NULL) ||
++ (strstr(u.filename, ".COM") != NULL) ||
++ (strstr(u.filename, ".ZIP") != NULL)) &&
++ (!access("MTI-SCAN.EXE", 0)) && ok)
++ {
++ sh_close(f);
++ pl(get_string(26));
++ stuff_in(s, "MTI-SCAN %1%2",
++ directories[dn].path,
++ stripfn(u.filename), "", "", "");
++ Rc = RunScanLine(s);
++
++ if (ok_modem_stuff)
++ initport(syscfg.primaryport);
++
++ if (Rc)
++ {
++ /* Due what you want here. */
++ /* Remove Access, Print A File */
++ /* Remove The Bad File. */
++ /* Make Sure You Remove The Bad */
++ /* File or It Will Be There For */
++ /* Download. */
++ npr("Error In Uploaded File!!\r\n");
++ if (u.mask & mask_extended)
++ delete_extended_description(u.filename);
++ ok = 0;
++ }
++ else
++ f = sh_open1(s1, O_RDONLY | O_BINARY);
++ }
+=// if (ok && syscfg.upload_c[0])
+=// {
+=// sh_close(f);
+=// pl(get_string(26));
+=// Remove Or if (check_ul_event(dn, &u))
+=// Comment This {
+=// IF statement! if (u.mask & mask_extended)
+=// delete_extended_description(u.filename);
+=// ok = 0;
+=// }
+=// else
+=// {
+=// f = sh_open1(s1, O_RDONLY | O_BINARY);
+=// }
+=// }
== }
== if (ok)
== {
== if (ok == 1)
== {
== l = filelength(f);
== u.numbytes = l;
== sh_close(f);
== ++thisuser.uploaded;
==#ifdef OPT_FAST_SEARCH
-------------------------------------------------------------------------------
More Source Code Modifications
-------------------------------------------------------------------------------
For Batch Uploads - Add the following code to BATCH.C:
== #define SETREC(f,i) sh_lseek(f,((long) (i))*((long)sizeof(uploadsrec)),SEEK_SET);
==
++ extern int RunScanLine(char *);
++
++void CreateBatchUList(char *listfn, int Mode)
++{
++ int f, i;
++ char s[255], s1[81];
++
++ if (instance > 1)
++ sprintf(listfn, "%s\\MTI-SCAN.%3.3d", cdir, instance);
++ else
++ sprintf(listfn, "%s\\MTI-SCAN.LST", cdir);
++
++ _chmod(listfn, 1, 0);
++ unlink(listfn);
++
++ f = sh_open(listfn, O_RDWR | O_BINARY | O_CREAT | O_TRUNC,
++ S_IREAD | S_IWRITE);
++
++ if (f < 0)
++ {
++ listfn[0] = 0;
++ return;
++ }
++
++ for (i = 0; i < numbatch; i++)
++ {
++ if (!batch[i].sending)
++ {
++ if (Mode)
++ sprintf(s, "%s%s\r\n", syscfgovr.batchdir, stripfn(batch[i].filename));
++ else
++ {
++ cd_to(directories[batch[i].dir].path);
++ get_dir(s1, 1);
++ cd_to(cdir);
++ sprintf(s, "%s%s\r\n", s1, stripfn(batch[i].filename));
++ }
++
++ sh_write(f, s, strlen(s));
++ }
++ }
++ sh_close(f);
++}
==void uploaded(char *fn, long cps)
=={
== int i, i1, rn, f, f1;
== uploadsrec u;
== char s[161], s1[81], s2[81];
==
++
++ sprintf(s1, "%s%s", syscfgovr.batchdir, stripfn(fn));
++
++ nl();
++ nl();
++ npr("Please Wait Testing Uploaded Files...\r\n");
++ stuff_in(s, "MTI-SCAN %1", s1, "", "", "", "");
++ i = RunScanLine(s);
++
++ if (ok_modem_stuff)
++ initport(syscfg.primaryport);
++
++ if (i) /* Failed */
++ {
++ /* Due what you want here */
++ /* Add Ass Pts? */
++ /* The follow bbs code */
++ /* handle the removal from*/
++ /* the BBS list. */
++ }
==
== for (i1 = 0; i1 < numbatch; i1++)
== {
== if ((strcmp(fn, batch[i1].filename) == 0) && (!batch[i1].sending))
== {
== dliscan1(batch[i1].dir);
== rn = recno((batch[i1].filename));
== if (rn > 0)
Add This To FCNS.H
++ void CreateBatchUList(char *listfn, int Mode);
Modify This In The Bordland C Makefile:
==bbs.exe: $(BBS_NRM) $(BBS_OVL) version.obj
== $(TCC_VER)
== tlink /c /x @&&^
== c0l $(OBJ)\version.obj $(BBS_O_NRM) $(OVER_START) $(BBS_O_OVL) $(OVER_END)
==$*
==nul
+=$(LIB87) mathl $(OVER_LIB) cl MTISCANL.LIB /* Add MTISCANL.LIB */
==^
==
==############################################################################
If Your Makefile Differs From The One Above, Call A Support Board For Help.
Put MTISCANL.LIB In Your Source Directory.
-------------------------------------------------------------------------------
Not Needed But Nice To Have Source Code Modifications
-------------------------------------------------------------------------------
Add The Following Code To BBS.C In The VOID DLMAINMENU(VOID) :
== /* Anyone commands here */
== if (strcmp(s,"WHO")==0) {
== multi_instance();
== }
==
== /* download cosysop checks here */
== if (dcs()) {
==
== if (strcmp(s,"/?")==0)
== printmenu(8);
++ if (!(strcmp(s,"/V")))
++ MTIScan('S');
++ if (!(strcmp(s,"/C")))
++ MTIScan('C');
++ if (!(strcmp(s,"/D")))
++ MTIScan('D');
++ if (!(strcmp(s,"/+")))
++ MTIScan('A');
Add The Following Function To XFER.C:
++void MTIScan(char Opt)
++{
++ char TempFile[81], ComLine[81], FileName[14];
++ int i, BatchMode = 0, f;
++ uploadsrec UpRec;
++
++ memset((char *)TempFile, '\0', sizeof(TempFile));
++ memset((char *)FileName, '\0', sizeof(FileName));
++ memset((char *)ComLine, '\0', sizeof(ComLine));
++
++ dliscan();
++
++ file_mask(FileName);
++
++ if (!stricmp(FileName, "????????.???"))
++ {
++ nl();
++ prt(6,"Aborting Scan.");
++ nl();
++ return;
++ }
++
++ if (strchr(FileName,'?'))
++ {
++ nl();
++ sprintf(ComLine, "Modified File Mask %s", FileName);
++ prt(1, ComLine);
++ nl();
++ BatchMode = 1;
++ }
++
++ f = sh_open1(dlfn, O_RDONLY | O_BINARY);
++
++ numbatch = 0;
++
++ for (i = 1; (i <= numf) && (!hangup); i++)
++ {
++ SETREC(f, i);
++ sh_read(f, (void *)&UpRec, sizeof(uploadsrec));
++ if (compare(FileName, UpRec.filename))
++ {
++ sprintf(ComLine,"%s%s",directories[udir[curdir].subnum].path,
++ stripfn(UpRec.filename));
++
++ if (!access(ComLine, 0))
++ {
++ if (BatchMode)
++ {
++ if (numbatch >= MAX_BATCH)
++ break;
++
++ strcpy(batch[numbatch].filename, stripfn(UpRec.filename));
++ batch[numbatch].dir = udir[curdir].subnum;
++ batch[numbatch].time = 0;
++ batch[numbatch].sending = 0;
++ batch[numbatch++].len = 0;
++ }
++ else
++ {
++ sprintf(TempFile,"%s%s",directories[udir[curdir].subnum].path,
++ stripfn(UpRec.filename));
++ break;
++ }
++ }
++ }
++ }
++
++ f = sh_close(f);
++
++ if (numbatch || TempFile[0])
++ {
++ if (BatchMode)
++ {
++ CreateBatchUList(TempFile, 0);
++ sprintf(ComLine, "MTI-SCAN -%c -@%s", Opt, TempFile);
++ }
++ else
++ sprintf(ComLine, "MTI-SCAN -%c %s", Opt, TempFile);
++
++ i = RunScanLine(ComLine);
++
++ if (ok_modem_stuff)
++ initport(syscfg.primaryport);
++ }
++ else
++ {
++ nl();
++ prt(6,"No Files Found To Process");
++ nl();
++ }
++
++ if (useron)
++ topscreen();
++
++}
Add This To FCNS.H Or Run Strip.
++ void CreateBatchUList(char *listfn);
++ void MTIScan(char Opt);