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 >
Text File  |  1994-12-04  |  11KB  |  333 lines

  1. -------------------------------------------------------------------------------
  2. Source Code Modifications
  3. -------------------------------------------------------------------------------
  4. Current users must review the source code modifications for use with WWIV 4.23.  
  5.        
  6. -------------------------------------------------------------------------------
  7. In XFER.C add the following lines:
  8.  
  9. == - Current WWIV Code.
  10. ++ - Add To Current WWIV Code.
  11. += - Modify Current WWIV Code.
  12.  
  13.  
  14. == int foundany;
  15. ==
  16. ++ extern int RunScanLine(char *);
  17.  
  18. Now in UPLOAD() add:
  19. ==void upload(int dn)
  20. =={
  21. ==    directoryrec d;
  22. ==    uploadsrec u, u1;
  23. +=    int i, i1, i2, i3, i4, ok, xfer, f, Rc; /* Add Rc to top of function */
  24. ==    char s[255], s1[81], *ss;
  25.  
  26. A little further down add:
  27.  
  28. ==                if (ok == 1)
  29. ==                {
  30. ==                    f = sh_open1(s1, O_RDONLY | O_BINARY);
  31. ==                    if (f < 0)
  32. ==                    {
  33. ==                        ok = 0;
  34. ==                        nl();
  35. ==                        nl();
  36. ==                        pl(get_string(780));
  37. ==                        nl();
  38. ==                        if (u.mask & mask_extended)
  39. ==                            delete_extended_description(u.filename);
  40. ==                    }
  41. ++                    if (((strstr(u.filename, ".ARJ") != NULL) ||
  42. ++                            (strstr(u.filename, ".LZH") != NULL) ||
  43. ++                            (strstr(u.filename, ".ZOO") != NULL) ||
  44. ++                            (strstr(u.filename, ".EXE") != NULL) ||
  45. ++                            (strstr(u.filename, ".COM") != NULL) ||
  46. ++                            (strstr(u.filename, ".ZIP") != NULL)) &&
  47. ++                        (!access("MTI-SCAN.EXE", 0)) && ok)
  48. ++                    {
  49. ++                        sh_close(f);
  50. ++                        pl(get_string(26));
  51. ++                        stuff_in(s, "MTI-SCAN %1%2",
  52. ++                                    directories[dn].path,
  53. ++                                    stripfn(u.filename), "", "", "");
  54. ++                        Rc = RunScanLine(s);
  55. ++
  56. ++                        if (ok_modem_stuff)      
  57. ++                           initport(syscfg.primaryport);
  58. ++            
  59. ++                        if (Rc)
  60. ++                        {
  61. ++                            /* Due what you want here.      */
  62. ++                            /* Remove Access, Print A File  */
  63. ++                            /* Remove The Bad File.         */
  64. ++                            /* Make Sure You Remove The Bad */
  65. ++                            /* File or It Will Be There For */
  66. ++                            /* Download.                    */
  67. ++                            npr("Error In Uploaded File!!\r\n");
  68. ++                            if (u.mask & mask_extended)
  69. ++                                delete_extended_description(u.filename);
  70. ++                            ok = 0;
  71. ++                        }
  72. ++                        else
  73. ++                            f = sh_open1(s1, O_RDONLY | O_BINARY);
  74. ++                    }
  75. +=//                    if (ok && syscfg.upload_c[0])
  76. +=//                    {
  77. +=//                        sh_close(f);
  78. +=//                        pl(get_string(26));
  79. +=//    Remove Or           if (check_ul_event(dn, &u))
  80. +=//    Comment This        {
  81. +=//    IF statement!            if (u.mask & mask_extended)
  82. +=//                                delete_extended_description(u.filename);
  83. +=//                            ok = 0;
  84. +=//                        }
  85. +=//                        else
  86. +=//                        {
  87. +=//                            f = sh_open1(s1, O_RDONLY | O_BINARY);
  88. +=//                        }
  89. +=//                    }
  90. ==                }
  91. ==                if (ok)
  92. ==                {
  93. ==                    if (ok == 1)
  94. ==                    {
  95. ==                        l = filelength(f);
  96. ==                        u.numbytes = l;
  97. ==                        sh_close(f);
  98. ==                        ++thisuser.uploaded;
  99. ==#ifdef OPT_FAST_SEARCH
  100.  
  101.  
  102. -------------------------------------------------------------------------------
  103. More Source Code Modifications
  104. -------------------------------------------------------------------------------
  105. For Batch Uploads - Add the following code to BATCH.C:
  106.  
  107. == #define SETREC(f,i)  sh_lseek(f,((long) (i))*((long)sizeof(uploadsrec)),SEEK_SET);
  108. ==
  109. ++ extern int RunScanLine(char *);
  110. ++
  111. ++void CreateBatchUList(char *listfn, int Mode)
  112. ++{
  113. ++    int f, i;
  114. ++    char s[255], s1[81];
  115. ++
  116. ++    if (instance > 1)
  117. ++        sprintf(listfn, "%s\\MTI-SCAN.%3.3d", cdir, instance);
  118. ++    else
  119. ++        sprintf(listfn, "%s\\MTI-SCAN.LST", cdir);
  120. ++
  121. ++    _chmod(listfn, 1, 0);
  122. ++    unlink(listfn);
  123. ++
  124. ++    f = sh_open(listfn, O_RDWR | O_BINARY | O_CREAT | O_TRUNC,
  125. ++                S_IREAD | S_IWRITE);
  126. ++
  127. ++    if (f < 0)
  128. ++    {
  129. ++        listfn[0] = 0;
  130. ++        return;
  131. ++    }
  132. ++
  133. ++    for (i = 0; i < numbatch; i++)
  134. ++    {
  135. ++        if (!batch[i].sending)
  136. ++        {
  137. ++            if (Mode)
  138. ++                sprintf(s, "%s%s\r\n", syscfgovr.batchdir, stripfn(batch[i].filename));
  139. ++            else
  140. ++            {
  141. ++                cd_to(directories[batch[i].dir].path);
  142. ++                get_dir(s1, 1);
  143. ++                cd_to(cdir);
  144. ++                sprintf(s, "%s%s\r\n", s1, stripfn(batch[i].filename));
  145. ++            }
  146. ++
  147. ++            sh_write(f, s, strlen(s));
  148. ++        }
  149. ++    }
  150. ++    sh_close(f);
  151. ++}
  152.  
  153. ==void uploaded(char *fn, long cps)
  154. =={
  155. ==    int i, i1, rn, f, f1;
  156. ==    uploadsrec u;
  157. ==    char s[161], s1[81], s2[81];
  158. ==
  159. ++
  160. ++    sprintf(s1, "%s%s", syscfgovr.batchdir, stripfn(fn));
  161. ++
  162. ++    nl();
  163. ++    nl();
  164. ++    npr("Please Wait Testing Uploaded Files...\r\n");
  165. ++    stuff_in(s, "MTI-SCAN %1", s1, "", "", "", ""); 
  166. ++    i = RunScanLine(s);
  167. ++    
  168. ++    if (ok_modem_stuff)              
  169. ++       initport(syscfg.primaryport);
  170. ++
  171. ++    if (i)     /* Failed */
  172. ++    {
  173. ++        /* Due what you want here */
  174. ++        /* Add Ass Pts?           */
  175. ++        /* The follow bbs code    */
  176. ++        /* handle the removal from*/
  177. ++        /* the BBS list.          */
  178. ++    }
  179. ==
  180. ==    for (i1 = 0; i1 < numbatch; i1++)
  181. ==    {
  182. ==        if ((strcmp(fn, batch[i1].filename) == 0) && (!batch[i1].sending))
  183. ==        {
  184. ==            dliscan1(batch[i1].dir);
  185. ==            rn = recno((batch[i1].filename));
  186. ==            if (rn > 0)
  187.  
  188. Add This To FCNS.H
  189. ++ void CreateBatchUList(char *listfn, int Mode);     
  190.  
  191. Modify This In The Bordland C Makefile:
  192. ==bbs.exe: $(BBS_NRM) $(BBS_OVL) version.obj
  193. ==  $(TCC_VER)
  194. ==  tlink /c /x @&&^
  195. ==  c0l $(OBJ)\version.obj $(BBS_O_NRM) $(OVER_START) $(BBS_O_OVL) $(OVER_END)
  196. ==$*
  197. ==nul
  198. +=$(LIB87) mathl $(OVER_LIB) cl MTISCANL.LIB  /* Add MTISCANL.LIB */
  199. ==^
  200. ==
  201. ==############################################################################
  202.  
  203. If Your Makefile Differs From The One Above, Call A Support Board For Help.
  204.  
  205. Put MTISCANL.LIB In Your Source Directory.
  206.  
  207. -------------------------------------------------------------------------------
  208. Not Needed But Nice To Have Source Code Modifications 
  209. -------------------------------------------------------------------------------
  210. Add The Following Code To BBS.C In The VOID DLMAINMENU(VOID) :
  211.  
  212. ==  /* Anyone commands here */
  213. ==  if (strcmp(s,"WHO")==0) {
  214. ==    multi_instance();
  215. ==  }
  216. ==
  217. ==  /* download cosysop checks here */
  218. ==  if (dcs()) {
  219. ==
  220. ==  if (strcmp(s,"/?")==0)
  221. ==      printmenu(8);
  222. ++  if (!(strcmp(s,"/V")))
  223. ++      MTIScan('S');
  224. ++  if (!(strcmp(s,"/C")))
  225. ++      MTIScan('C');
  226. ++  if (!(strcmp(s,"/D")))
  227. ++      MTIScan('D');
  228. ++  if (!(strcmp(s,"/+")))
  229. ++      MTIScan('A');
  230.  
  231. Add The Following Function To XFER.C: 
  232. ++void MTIScan(char Opt)
  233. ++{
  234. ++    char TempFile[81], ComLine[81], FileName[14];
  235. ++    int i, BatchMode = 0, f;
  236. ++    uploadsrec UpRec;
  237. ++
  238. ++    memset((char *)TempFile, '\0', sizeof(TempFile));
  239. ++    memset((char *)FileName, '\0', sizeof(FileName));
  240. ++    memset((char *)ComLine, '\0', sizeof(ComLine));
  241. ++
  242. ++    dliscan();
  243. ++
  244. ++    file_mask(FileName);
  245. ++    
  246. ++    if (!stricmp(FileName, "????????.???"))
  247. ++    {
  248. ++        nl();
  249. ++        prt(6,"Aborting Scan.");
  250. ++        nl();
  251. ++        return;
  252. ++    }
  253. ++
  254. ++    if (strchr(FileName,'?'))
  255. ++    {
  256. ++        nl();
  257. ++        sprintf(ComLine, "Modified File Mask %s", FileName);
  258. ++        prt(1, ComLine);
  259. ++        nl();
  260. ++        BatchMode = 1;
  261. ++    }
  262. ++
  263. ++    f = sh_open1(dlfn, O_RDONLY | O_BINARY);
  264. ++
  265. ++    numbatch = 0;
  266. ++
  267. ++    for (i = 1; (i <= numf) && (!hangup); i++)
  268. ++    {
  269. ++        SETREC(f, i);
  270. ++        sh_read(f, (void *)&UpRec, sizeof(uploadsrec));
  271. ++        if (compare(FileName, UpRec.filename))
  272. ++        {
  273. ++            sprintf(ComLine,"%s%s",directories[udir[curdir].subnum].path,
  274. ++                                    stripfn(UpRec.filename));
  275. ++
  276. ++            if (!access(ComLine, 0))
  277. ++            {
  278. ++                if (BatchMode)
  279. ++                {
  280. ++                    if (numbatch >= MAX_BATCH)
  281. ++                        break;
  282. ++
  283. ++                    strcpy(batch[numbatch].filename, stripfn(UpRec.filename));
  284. ++                    batch[numbatch].dir = udir[curdir].subnum;
  285. ++                    batch[numbatch].time = 0;
  286. ++                    batch[numbatch].sending = 0;
  287. ++                    batch[numbatch++].len = 0;
  288. ++                }
  289. ++                else
  290. ++                {
  291. ++                    sprintf(TempFile,"%s%s",directories[udir[curdir].subnum].path,
  292. ++                                        stripfn(UpRec.filename));
  293. ++                    break;
  294. ++                }
  295. ++            }
  296. ++        }
  297. ++    }
  298. ++
  299. ++    f = sh_close(f);
  300. ++    
  301. ++    if (numbatch || TempFile[0])
  302. ++    {
  303. ++        if (BatchMode)
  304. ++        {
  305. ++            CreateBatchUList(TempFile, 0);
  306. ++            sprintf(ComLine, "MTI-SCAN -%c -@%s", Opt, TempFile);
  307. ++        }
  308. ++        else
  309. ++            sprintf(ComLine, "MTI-SCAN -%c %s", Opt, TempFile);
  310. ++    
  311. ++        i = RunScanLine(ComLine);
  312. ++
  313. ++        if (ok_modem_stuff)
  314. ++           initport(syscfg.primaryport);
  315. ++    }
  316. ++    else
  317. ++    {
  318. ++        nl();
  319. ++        prt(6,"No Files Found To Process");
  320. ++        nl();
  321. ++    }
  322. ++
  323. ++    if (useron)
  324. ++       topscreen();
  325. ++
  326. ++}
  327.  
  328. Add This To FCNS.H Or Run Strip.
  329. ++ void CreateBatchUList(char *listfn);     
  330. ++ void MTIScan(char Opt);
  331.  
  332.  
  333.