home *** CD-ROM | disk | FTP | other *** search
/ The Devil's Doorknob BBS Capture (1996-2003) / devilsdoorknobbbscapture1996-2003.iso / Dloads / WWIVMODS / PRE412.ZIP / BILBO85.MOD < prev    next >
Text File  |  1992-12-01  |  28KB  |  801 lines

  1. Tuck #1 @3652
  2. Fri Mar 09 21:28:15 1990
  3. Bilbo Baggins #1 @7303
  4. Thu Mar 08 00:22:34 1990
  5.  
  6.                              Version 0.85
  7.  
  8.      - UPDATE LIST:     03-07-90
  9.        . Fixed bug in Xmodem and Ymodem downloads
  10.        . Cleaned up the doc file. Fixed remaining truncated lines and
  11.          removed extra characters that showed up in columns > 80.
  12.          The doc file is now printable on 80 columns in normal prt mode.
  13.        . Installed in WWIV 4.11. This mod works for both 4.10 and 4.11.
  14.        . Optimized a couple of case statements.
  15.        . Added Puma and Ymodem-G protocols.
  16.  
  17.  
  18.       This document was written by Bilbo Baggins, SYSOP of Late Night BBS
  19.    who can be reached at 1@7303 or (703)-361-3691. The purpose is to explain
  20.    how to modify your transfer section so that your users can both upload
  21.    and download in batch mode. This modification can be expanded upon by you
  22.    if you know enough to hack a little C code. I have included only Ymodem,
  23.    Zmodem, Ymodem-G, Puma and Lynx protocols in my code. You may add others
  24.    if you wish, however I must forwarn you that it is not a trivial task,
  25.    especially the batch upload portion.
  26.  
  27.       Included in the archive should be BBBATCH.MOD (this file), BATCH.GFL -
  28.    the gfile you can use for your users and/or put in your documentation
  29.    download area, and BBBATCH.UPD - a file that let's you upgrade from
  30.    version one version to the next newer version.
  31.  
  32.       In this mod, I use -I- to signify to insert a line, and -D- to delete
  33.       a line, and -M- to modify an existing line.
  34.  
  35.       If you used my old batch DL mod, you may want to remove it and add
  36.    this mod in since it is MUCH more efficient. I shrank the DL portion
  37.    of the mod considerably. Also note that I got rid of Wayne's internal
  38.    Xmodem...at least as much as I dare for now. If you don't have 68K of
  39.    free memory and you are in the net, you CANNOT use this mod since Wayne
  40.    uses his internal Xmodem if there is not enough room to load DSZ.
  41.  
  42.       The majority of your changes will be to XFER.C and SR.C, although a
  43.    few other files are touched minorly. This is a long and complicated
  44.    mod, but is easy to install if you follow the instructions closely. If
  45.    you have questions, please feel free to send me email, but please
  46.    forgive me if I take a while to reply since I am a very busy person.
  47.    It would be BEST to ask on the mod net, so I can answer a single ? for
  48.    many people.
  49.  
  50.       This mod is in no way completed yet. I have a lot of ideas that I
  51.    want to pursue in the future. It is being released at this time for
  52.    several reasons. It is fairly much bug free, it is stable enough to
  53.    release, and it works as far as I can tell. No major bugs are presently
  54.    known. Any bugs you encounter, PLEASE send me e-mail at 1@7303. I will
  55.    add other protocols as I have time, but uploading in batch is not as
  56.    straight forward to implement with those I have tried (SUPER8K, Jmodem,
  57.    etc.). If you add a protocol, please cut it out and send it to me in
  58.    e-mail so I can add it to future releases, with due credit.
  59.  
  60.       The mod works as follows:
  61.  
  62.    - user enters xfer sections and scans for new files
  63.    - user selects an area and selects a file to DL
  64.    - user selects protocol 5 to add file to batch que
  65.    - user selects an area and selects a file to UL
  66.    - user selects protocol 5 to add file to batch que
  67.    - user repeats selections of files to upload and
  68.      download in any order and in any area.
  69.    - user fills in the descriptions for all uploads (no extended descriptions)
  70.    - user selects B from transfer menu to enter the batch menu
  71.    - user can remove, list, files in queue as well as clear the que
  72.    - user selects X to xfer, and is prompted for the protocol
  73.    - user selects Y, Z, or L for Ymodem, Zmodem, or Lynx
  74.    - Now if this is the first time user has used the batch upload portion
  75.      of this mod, he will be prompted for his protocol path, ul path, and
  76.      dl path as well as his COM port. This information is saved to disk
  77.      and may be edited any time you are in the batch menu by selecting E
  78.    - The user is prompted if he wishes to hangup after the xfer
  79.    - The user is prompted if he wishes to receive a file the mod has built
  80.      for him named BATCH.BAT. This batch file contains the Lynx or DSZ
  81.      commands to transfer everything. He should answer Y and drop to DOS
  82.      where he will run BATCH.BAT
  83.    - If user selected the hangup option, he may now leave his machine and
  84.      catch some ZZZ's. Otherwise he can stick around and toodle around
  85.      the board after the batch transfer is complete.
  86.  
  87.    To summarize, the user adds files to two queues (one for UL and one for
  88.    DL). He adds descriptions to his uploads as he would if he were doing an
  89.    immediate upload. He selects the "BATCH" protocol and receives a
  90.    customized batch file to implement the batch transfer. He drops to DOS
  91.    and runs the batch file. He can upload to any area except those
  92.    which you the sysop has setup as download-only areas. OK, ready your
  93.    editor and take off into the world of batch xfers!
  94.  
  95. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  96.  
  97.  *  Edit file VARS.H
  98.  *  Search for batchfn[50]
  99.  
  100. -M- char batchfn[12][13];
  101. -I- char batchdescr[12][59];
  102. -M- int batchdir[12];
  103. -M- float batchfntime[12];
  104. -I- float batchtimeul,batchfntimeul[12];
  105. -I- int numbatchul, batchdirul[12],num_listed;
  106. -I- char batchfnul[12][13],batchpathul[12][59]  ;
  107.  
  108.  *  Save file VARS.H
  109.  
  110. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  111.  
  112.  *  Edit file XFER.C
  113.  *  Search for batchfntime[50]
  114.  
  115. -M- extern float batchtime,batchfntime[12];
  116. -M- extern int numbatch, batchdir[12];
  117. -M- extern char batchfn[12][13],batchdescr[12][59],batchpathul[12][59] ;
  118. -I- extern float batchtimeul,batchfntimeul[12];
  119. -I- extern int numbatchul, batchdirul[12],num_listed;
  120. -I- extern char batchfnul[12][13];
  121.  
  122.  
  123. *   Scroll down a bit and add the following typedef:
  124. -I- typedef struct {
  125. -I-   char            name[31],               /* user's name */
  126. -I-                   protopath[51],          /* user's protocol path */
  127. -I-                   ulpath[51],             /* user's ul path */
  128. -I-                   dlpath[51],             /* user's dl path */
  129. -I-                   comport[2];             /* user's com port */
  130. -I- } batchuser;
  131.  
  132.  
  133. *   Search for   send_file
  134. -M-     send_file(s1,&sent,&abort,s,-1,numbytes);
  135.  
  136.  
  137. *   Search for   void upload(int dn)
  138. *   where the data is defined for this procedure:
  139. -M-   char s[81],s1[81],s2[81],*ss;
  140.  
  141.  
  142. *   Search for   if (numf>=d.maxfiles) {
  143. -M-   if (numf>=(d.maxfiles-numbatchul)) {
  144.  
  145.  
  146. *   Search for   if ((ok) && (yn())) {
  147. -D-     strcpy(s1,d.path);
  148. -D-     strcat(s1,s);
  149. -I-     sprintf(s1,"%s%s",d.path,stripfn(s));
  150.  
  151. *   Search for   receive_file
  152. -M-         receive_file(s,d.path,&ok,u.description,&dn);
  153.  
  154. *   Search for   the last else statement in the procedure upload.
  155.     You should add an if...endif after the else. Insert the two lines
  156.     in the code fragment below:
  157.       } else {
  158. -I-     if (numbatchul <= 0) {
  159.            nl();
  160.            nl();
  161.            pl("File transmission aborted.");
  162.            nl();
  163. -I-     } /* endif */
  164.  
  165.  
  166. *  Search for
  167.       if ((printfileinfo(&u,dn)) || (strncmp(u.filename,"WWIV4",5)==0)) {
  168.       strcpy(s1,(directories[dn].path));
  169. -M-   strcat(s1,stripfn(u.filename));  /* replace fn with stripfn(fn) */
  170.       sent=0;
  171.  
  172.  
  173. *   Search for send_file
  174. -M-       send_file(s1,&sent,&abort,u.filename,dn, u.numbytes);
  175.  
  176.  
  177. *   Search for    void listbatch
  178. -M-   sprintf(s,"Files - %d  Time - %s",numbatch+numbatchul,ctim(batchtime));
  179.  
  180. *   Search down a few more lines and replace the for statement with these two:
  181. -M-  for (i=0; (i<numbatch) && (!abort) && (!hangup); i++) {
  182. -M-     sprintf(s,"DL #%d. %s   %s",i+1,batchfn[i],ctim(batchfntime[i]));
  183. -M-     pla(s,&abort);
  184. -M-   }
  185. -M-   for (i=0; (i<numbatchul) && (!abort) && (!hangup); i++) {
  186. -M-     sprintf(s,"UL #%d. %s   %s",i+1,batchfnul[i],ctim(batchfntimeul[i]));
  187. -M-     pla(s,&abort);
  188. -M-   }
  189.  
  190. *   After the procedure listbatch, add the following procedure:
  191. -I- batchuser batchcfg(int edit)
  192. -I- {
  193. -I-    batchuser br;
  194. -I-    char s[81];
  195. -I-    int fhandle,found=0;
  196. -I-    long currec;
  197. -I-    /* open file BATCH.DAT in read/write mode */
  198. -I-    strcpy(s, syscfg.datadir);
  199. -I-    strcat(s, "BATCH.DAT");
  200. -I-    fhandle = open(s,O_RDWR | O_CREAT | O_BINARY,S_IREAD | S_IWRITE);
  201. -I-    currec = filelength(fhandle) / (long)sizeof(batchuser);
  202. -I-    /* find user's record */
  203. -I-    while ((currec > 0) && (!hangup) && (!found))
  204. -I-       {
  205. -I-       lseek(fhandle, (currec - 1) * (long)sizeof(batchuser), SEEK_SET);
  206. -I-       currec--;
  207. -I-       read(fhandle, (void *)(&br), sizeof(batchuser));
  208. -I-       if (!strcmp(thisuser.name,br.name))  {
  209. -I-          /* position file pointer to rewrite user's record */
  210. -I-          lseek(fhandle, (currec) * (long)sizeof(batchuser), SEEK_SET);
  211. -I-          /* say we found it */
  212. -I-          found = 1;
  213. -I-       }
  214. -I-    }
  215. -I-    /* if not found, add a default record for thisuser */
  216. -I-    if (!found) {
  217. -I-       close(fhandle);
  218. -I-       fhandle = open(s,O_RDWR | O_CREAT | O_APPEND | O_BINARY,
  219. -I-                      S_IREAD | S_IWRITE);
  220. -I-       strcpy(br.name,thisuser.name);
  221. -I-       strcpy(br.protopath,"C:");
  222. -I-       strcpy(br.ulpath,"C:");
  223. -I-       strcpy(br.dlpath,"C:");
  224. -I-       strcpy(br.comport,"1");
  225. -I-    } /* endif */
  226. -I-    if ((!found) || (edit)) {
  227. -I-    /* prompt for dsz/ul/dl pathnames, comport, speed showing current values */
  228. -I-      prt(2,"Paths should look like C:\\TELIX\\PROTOCOL\\    <--- note
  229. -I-             the ending \\!");
  230. -I-       nl();
  231. -I-       sprintf(s,"Your protocol path (%s) : ",br.protopath);
  232. -I-       prt(1,s);
  233. -I-       input(s,50);
  234. -I-       /* if s not equal br.protopath AND s not equal to blank then */
  235. -I-       if ((strcmp(s,br.protopath)) && (strcmp(s,"")) )
  236. -I-          strcpy(br.protopath,s);
  237. -I-       sprintf(s,"Your UL path (%s) : ",br.ulpath);
  238. -I-       prt(1,s);
  239. -I-       input(s,50);
  240. -I-       if ((strcmp(s,br.ulpath)) && (strcmp(s,"")) )
  241. -I-          strcpy(br.ulpath,s);
  242. -I-       sprintf(s,"Your DL path (%s) : ",br.dlpath);
  243. -I-       prt(1,s);
  244. -I-       input(s,50);
  245. -I-       if ((strcmp(s,br.dlpath)) && (strcmp(s,"")) )
  246. -I-          strcpy(br.dlpath,s);
  247. -I-       sprintf(s,"Your COM port (%s) : ",br.comport);
  248. -I-       prt(1,s);
  249. -I-       input(s,1);
  250. -I-       if ((strcmp(s,br.comport)) && (strcmp(s,"")) )
  251. -I-          strcpy(br.comport,s);
  252. -I-       /* write new record back out to batch config file BATCH.DAT */
  253. -I-       write(fhandle, (void *)(&br), sizeof(batchuser));
  254. -I-    } /* endif */
  255. -I-    close(fhandle);
  256. -I-    /* return to caller */
  257. -I-    return(br);
  258. -I- }
  259.  
  260. *    In the next procedure, batchdl(), change the following:
  261. -M-   int i,abort,done,ok,had,rr;
  262. -M-   char s[81],ch,ch2;
  263. *    And add
  264. -I-   batchuser br;
  265. *    And change the second line as follows:
  266. -M-   if ((numbatch+numbatchul)==0) {
  267.  
  268.  
  269. *    Search further down in the procedure for  Batch:
  270.  
  271. -I-     helpl=22;
  272. -M-     prt(2,"Batch: L,R,C,X,E,Q (?=menu) : ");
  273. -M-     ch=onek("Q?ELRCX");
  274.  
  275.  
  276. *    For the '?' case, add the line:
  277. -I-         done=0;
  278.  
  279.  
  280. *    Add after case 'L'
  281. -I-       case 'E':
  282. -I-         br=batchcfg(1);
  283. -I-         break;
  284.  
  285. *    Change case 'R' as follows...THANKS to my buddy Goose for this change!!
  286. -I-       case 'R':
  287. -I-         nl();
  288. -I-         prt(2,"Remove U)pload or D)ownload? : ");
  289. -I-         ch=onek("UD");
  290. -I-         prt(2,"Remove which? ");
  291. -I-         input(s,2);
  292. -I-         i=atoi(s);
  293. -I-         switch (ch) {
  294. -I-           case 'D':
  295. -I-             if ((i>0) && (i<=numbatch))
  296. -I-               delbatch(i-1);
  297. -I-             break;
  298. -I-          case 'U':
  299. -I-             if ((i>0) && (i<=numbatchul)) {
  300. -I-               --numbatchul;
  301. -I-               for (i1=i; i1<=numbatchul; i1++) {
  302. -I-                 batchdirul[i1]=batchdirul[i1+1];
  303. -I-                 strcpy((batchfnul[i1]),(batchfnul[i1+1]));
  304. -I-                 strcpy((batchdescr[i1]),(batchdescr[i1+1]));
  305. -I-                 strcpy((batchpathul[i1]),(batchpathul[i1]));
  306. -I-               }
  307. -I-             }
  308. -I-             break;
  309. -I-         }
  310. -I-         if ((numbatch==0) && (numbatchul==0)) {
  311. -I-           nl();
  312. -I-           pl("Batch queues empty.");
  313. -I-           nl();
  314. -I-           done=1;
  315. -I-         }
  316. -I-         break;
  317.  
  318. *    Add to case 'C' after if (yn()) {
  319.  
  320.             if (yn()) {
  321.               numbatch=0;
  322. -I-           numbatchul=0;
  323. -I-           batchtimeul=0.0;
  324.  
  325. *    Delete the rest of the procedure starting at the line case 'D':
  326.  
  327. -D-    case 'D':
  328. -D-      if (!incom)
  329. -D-        break;
  330. -D-      nl();
  331. -D-      prt(5,"Hang up after transfer? ");
  332. -D-      had=yn();
  333. -D-      nl();
  334. -D- sprintf(s,"Transmitting:  Files - %d  Time - %s",numbatch,ctim(batchtime));
  335. -D-      pl(s);
  336. -D-      nl();
  337. -D-      ok=1;
  338. -D-      rr=0;
  339. -D-      if ((syscfg.req_ratio>0.0001) && (ratio()<syscfg.req_ratio))
  340. -D-        rr=1;
  341. -D-      if (thisuser.exempt & exempt_ratio)
  342. -D-        rr=0;
  343. -D-      if (rr) {
  344. -D-        nl();
  345. -D-        pl("Sorry, your ratio is too low.");
  346. -D-        nl();
  347. -D-        break;
  348. -D-      }
  349. -D-      do {
  350. -D-        tleft(1);
  351. -D-        if ((syscfg.req_ratio>0.0001) && (ratio()<syscfg.req_ratio))
  352. -D-          rr=1;
  353. -D-        if (thisuser.exempt & exempt_ratio)
  354. -D-          rr=0;
  355. -D-        if ((nsl()>=batchfntime[0]) && (!rr)) {
  356. -D-          dliscan1(batchdir[0]);
  357. -D-          i=recno((batchfn[0]));
  358. -D-          if (i<=0) {
  359. -D-            delbatch(0);
  360. -D-          } else {
  361. -D-   sprintf(s,"%d files left, Time left = %s\r\n",numbatch,ctim(batchtime));
  362. -D-            outs(s);
  363. -D-            SETREC(i);
  364. -D-            read(dlf,(void *)&u,sizeof(uploadsrec));
  365. -D-            strcpy(s,directories[batchdir[0]].path);
  366. -D-            strcat(s,u.filename);
  367. -D-            xymodem_send(s,&ok,&percent,u.filetype,1,1,1);
  368. -D-            if (ok) {
  369. -D-              ++thisuser.downloaded;
  370. -D-              thisuser.dk += (int) ((u.numbytes+1023)/1024);
  371. -D-              ++u.numdloads;
  372. -D-              SETREC(i);
  373. -D-              write(dlf,(void *)&u,sizeof(uploadsrec));
  374. -D-              strcpy(s,"Downloaded '");
  375. -D-              strcat(s,u.filename);
  376. -D-              strcat(s,"'");
  377. -D-              sysoplog(s);
  378. -D-            }
  379. -D-          }
  380. -D-          closedl();
  381. -D-          delbatch(0);
  382. -D-        } else
  383. -D-          delbatch(0);
  384. -D-      } while ((ok) && (!hangup) && (numbatch>0) && (!rr));
  385. -D-      if ((ok) && (!hangup))
  386. -D-        endbatch();
  387. -D-      if (rr) {
  388. -D-        nl();
  389. -D-        pl("Your ratio is too low to continue the transfer.");
  390. -D-        nl();
  391. -D-      }
  392. -D-      if (had)
  393. -D-        hangup=1;
  394. -D-      done=1;
  395. -D-      break;
  396. -D-  }
  397. -D-} while ((!done) && (!hangup));
  398. -D-}
  399.  
  400. *    Then, add in new case 'X' to fill out the rest of the procedure
  401. -I-       case 'X':
  402. -I-         nl();
  403. -I-         pl("Batch Transfer -");
  404. -I-         nl();
  405. -I-         prt(2, "Batch Protocol: G,L,P,Y,Z,Q (?=menu) : ");
  406. -I-         while ((ch2=onek("Q?GLPYZ"))=='?')
  407. -I-            {
  408. -I-            printmenu(15);
  409. -I-            prt(2, "Batch Protocol: G,L,P,Y,Z,Q (?=menu) : ");
  410. -I-            }
  411. -I-         switch(ch2) {
  412. -I-            case 'Q':
  413. -I-               done=1;
  414. -I-               break;
  415. -I-             case 'Z':               /* Zmodem batch */
  416. -I-               bat_prot(0,&had);
  417. -I-               if (had){
  418. -I-               hangup=1;
  419. -I-               }
  420. -I-               done=1;
  421. -I-               break;
  422. -I-            case 'Y':                /* Ymodem Batch */
  423. -I-               bat_prot(1,&had);
  424. -I-               if (had)
  425. -I-                 hangup=1;
  426. -I-               done=1;
  427. -I-               break;
  428. -I-            case 'L':                /* Lynx Batch */
  429. -I-               bat_prot(2,&had);
  430. -I-               if (had)
  431. -I-                 hangup=1;
  432. -I-               done=1;
  433. -I-               break;
  434. -I-            case 'P':                /* Puma Batch */
  435. -I-               bat_prot(3,&had);
  436. -I-               if (had)
  437. -I-                 hangup=1;
  438. -I-               done=1;
  439. -I-               break;
  440. -I-            case 'G':               /* Ymodem-G Batch */
  441. -I-               bat_prot(4,&had);
  442. -I-               if (had)
  443. -I-                 hangup=1;
  444. -I-               done=1;
  445. -I-               break;
  446. -I-       }
  447. -I-       break;
  448. -I-       }
  449. -I-    } while ((!done) && (!hangup));
  450. -I- }
  451.  
  452. *  Now insert the following procedure, bat_prot, before procedure arc_l :
  453.  
  454. int bat_prot(int t, int *had)
  455.  
  456. {
  457.    FILE *f;
  458.    int i,abort,done,rr,i2,numb,f1;
  459.    directoryrec d;
  460.    char s[81],s1[81],s2[81];
  461.    double percent;
  462.    uploadsrec u,u1;
  463.    int i1;
  464.    long l;
  465.    double ti;
  466.    batchuser br;
  467.  
  468.    if (!incom)
  469.    {
  470.    *had=0;
  471.    return(*had);
  472.    }
  473.    nl();
  474.    prt(5,"Hang up after transfer? ");
  475.    *had=yn();
  476.    nl();
  477.    nl();
  478.    sprintf(s,"%s is currently online",thisuser.name);
  479.    outs(s);
  480.    nl();
  481.    sprintf(s,"Bilbo Baggins presents...The Batch UL/DL Mod!");
  482.    pl(s);
  483.    nl();
  484.    nl();
  485.    sprintf(s,"Transmitting:  Files - %d  DL Time - %s",numbatch+numbatchul,
  486.               ctim(batchtime));
  487.    pl(s);
  488.    nl();
  489.    rr=0;
  490.    if ((syscfg.req_ratio>0.0001) && (ratio()<syscfg.req_ratio)
  491.       && (numbatch > 0))
  492.       rr=1;
  493.    if (thisuser.exempt & exempt_ratio)
  494.       rr=0;
  495.    if (rr) {
  496.       nl();
  497.       pl("Sorry, your ratio is too low.");
  498.       nl();
  499.       *had=0;                               /* reset hangup to no */
  500.       return(*had);
  501.    }
  502. /*                                                                        */
  503. /*                         RECEIVE USER BATCH UPLOADS                     */
  504. /*                                                                        */
  505.  
  506.   /* if there are files in the batch queue */
  507.   if ((numbatchul)>0) {
  508.  
  509. /*  Send batch file to uploader */
  510.  
  511.    prt(5,"Receive batch file for upload(s) ? ");
  512.    if (yn()) {
  513.  
  514.       br=batchcfg(0);
  515.       strcpy(s,"C:\\BBS\\BATCH.BAT");
  516.       f = fopen(s,"w");
  517.  
  518. /*   Write the filenames out to a file for protocol to use.  */
  519.      switch (t)
  520.      {
  521.         case 0:
  522.                sprintf(s1,"%sdsz port %s sz %s",br.protopath,
  523.                                        br.comport,br.ulpath);
  524.                break;
  525.         case 1:
  526.                sprintf(s1,"%sdsz port %s sb %s",br.protopath,
  527.                                        br.comport,br.ulpath);
  528.                break;
  529.         case 2:
  530.                sprintf(s1,"%slynx s /%s /S /H %s",br.protopath,
  531.                                        br.comport,br.ulpath);
  532.                break;
  533.         case 3:
  534.                sprintf(s1,"%spuma P%s s %s",br.protopath,
  535.                                        br.comport,br.ulpath);
  536.                break;
  537.         case 4:
  538.                sprintf(s1,"%sdsz port %s sb -g %s",br.protopath,
  539.                                        br.comport,br.ulpath);
  540.                break;
  541.      } /* end switch */
  542.  
  543.       for (i=0; (i<numbatchul); i++ )        {  /* Writes a "clean" file. */
  544.          strcpy(s2,s1);
  545.          strcat(s2,stripfn(batchfnul[i]));
  546.          fprintf(f,"%s\n",s2);
  547.       } /* end for numbatchul */
  548.    /* if numbatch (dl) > 0, tack on receive batch to BATCH.BAT */
  549.    if (numbatch > 0) {
  550.       switch (t)
  551.       {
  552.          case 0:
  553.                 sprintf(s1,"%sdsz port %s rz %s",br.protopath,
  554.                                         br.comport,br.dlpath);
  555.                 fprintf(f,"%s\n",s1);
  556.                 break;
  557.          case 1:
  558.                 sprintf(s1,"%sdsz port %s rb %s",br.protopath,
  559.                                         br.comport,br.dlpath);
  560.                 fprintf(f,"%s\n",s1);
  561.                 break;
  562.          case 2:
  563.                 sprintf(s1,"%slynx r /%s /S /H %s",br.protopath,
  564.                                         br.comport,br.dlpath);
  565.                 fprintf(f,"%s\n",s1);
  566.                 break;
  567.          case 3:
  568.                 sprintf(s1,"%spuma P%s r %s",br.protopath,
  569.                                         br.comport,br.dlpath);
  570.                 fprintf(f,"%s\n",s1);
  571.                 break;
  572.          case 4:
  573.                 sprintf(s1,"%sdsz port %s rb -g %s",br.protopath,
  574.                                         br.comport,br.dlpath);
  575.                 fprintf(f,"%s\n",s1);
  576.                 break;
  577.       }
  578.       } /* endif */
  579.  
  580.       strcpy(s1,"EXIT\n");
  581.       fprintf(f,"%s\n",s1);
  582.  
  583.       fclose(f);
  584.       pl("Sending BATCH.BAT file...");
  585.       extern_prot(t,s,1);
  586.    }
  587.  
  588. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  589.  
  590. *  Edit file BBSUTL.C
  591.  
  592. *  Search for   extern int numbatch,  and modify as follows:
  593. -M- extern int numbatch,numbatchul,numed,lines_listed;
  594.  
  595.  
  596. *   In the procedure logon, add the following line:
  597.       batchsize=0.0;
  598.       numbatch=0;
  599. -I-   numbatchul=0;
  600.       strcpy(xdate,date());
  601.  
  602.  
  603. *  Search for receive_file
  604. -M-   receive_file(s,s,&i1,s,0);
  605.  
  606. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  607.  
  608.  *  Edit file FCNS.H
  609.  *  Search for send_file
  610.  
  611. -M- void send_file(char *fn, int *sent, int *abort, char *sfn, int dn, long fs);
  612. -M- void receive_file(char *fn,char *fn2,  int *received, char *descr, int *dn);
  613.  
  614. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  615.  
  616.  *  Edit file SR.C
  617.  *  Search for batchtime
  618.  
  619. -M- extern float batchtime,batchfntime[12];
  620. -M- extern int numbatch, batchdir[12];
  621. -M- extern char batchfn[12][13],batchdescr[12][59],batchpathul[12][59] ;
  622. -I- extern float batchtimeul,batchfntimeul[12];
  623. -I- extern int numbatchul, batchdirul[12],num_listed;
  624. -I- extern char batchfnul[12][13];
  625.  
  626.  *  Search for xymodem_send and delete the entire procedure!
  627.  
  628.  *  Search for xymodem_receive and delete the entire procedure!
  629.  
  630.  *  Search for receive_block and delete the entire procedure!
  631.  
  632.  *  Search for the procedure get_protocol and replace the following lines:
  633.  
  634. -D-  if (dl>0)
  635. -D-    strcpy(oks,"Q?012345");
  636. -D-  else
  637. -D-    if (dl<0)
  638. -D-      strcpy(oks,"Q?02345");
  639. -D-    else
  640. -D-      strcpy(oks,"Q?02345");
  641. -I-  if (dl>0)
  642. -I-    strcpy(oks,"Q?012345");
  643. -I-  else
  644. -I-    strcpy(oks,"Q?02345");
  645.  
  646. -D-           strcat(s,"YMODEM Batch");
  647. -I-           strcat(s,"Batch Xfer");
  648.  
  649. -D-       if (dl==1)
  650. -D-         pl("5: YMODEM Batch");
  651. -I-       pl("5: Batch Xfer");
  652.  
  653.  *  Search for send_file and do the following:
  654.  
  655. -M- void send_file(char *fn, int *sent, int *abort, char *sfn, int dn, long fs)
  656.  
  657. *  In SR.C, procedure send_file
  658. *  Search for the first switch, and replace cases 2/3/4 with the following:
  659.  
  660.          break;
  661. -M-    case 2:
  662. -M-    case 3:
  663. -M-      if (incom) {
  664. -M-        sprintf(s,"DSZ port 1 pB4096 sx -z %s",fn);
  665. -M-        i = run_external1(s);
  666. -M-        }
  667. -M-      break;
  668. -M-    case 4:
  669. -M-      if (incom)
  670. -M-        {
  671. -M-        sprintf(s,"DSZ port 1 pB4096 sb -z %s",fn);
  672. -M-        i = run_external1(s);
  673. -M-        }
  674. -M-      break;
  675.        case 5:
  676.          *sent=0;
  677.  
  678.  *  Search for   if (numbatch>=50) {
  679.  
  680. -M-       if (numbatch>=12) {
  681.  
  682.  *  Search for    } else {
  683. -D-         t=(12.656) / ((double) (modem_speed)) * ((double)(fs));
  684. -I-         i1=atoi(curspeed);
  685. -I-         if (i1==0)
  686. -I-           i1=syscfg.baudrate[syscfg.primaryport];
  687. -I-         t=(12.656) / ((double) (i1)) * ((double)(fs));
  688.  
  689. *   Search for   pl("Not enough time left in queue.");
  690.  
  691. -D-           nl();
  692. -D-           *sent=0;
  693. -D-           *abort=0;
  694. -D-         } else {
  695. -D-           if (dn==-1) {
  696. -D-             nl();
  697. -D-             pl("Can't add temporary file to batch queue.");
  698.  
  699. *    Search for  pl("File added to batch queue.");
  700. -D-             pl("File added to batch queue.");
  701. -D-       sprintf(s,"Batch: Files - %d  Time - %s",numbatch, ctim(batchtime));
  702. -D-             nl();
  703. -I-           itoa(numbatchul+numbatch,s,10);
  704. -I-           strcat(s," file(s) added to batch ques, DL time - ");
  705. -I-    strcat(s,ctim(batchtime));
  706.  
  707.  *  Search for the three } in a row and delete one of them
  708. -D-           }
  709.  
  710.  *  Search for   if ((*sent==0) && (ok==0))    and insert the following line
  711.     BEFORE the if
  712.  
  713. -I-   topscreen();
  714.  
  715.  *  Search for receive_file and do the following:
  716.  
  717.  
  718. -M- void receive_file(char *fn, char *fn2, int *received, char *descr, int *dn)
  719.  
  720. *    And add a new variable:
  721.  
  722. -I-   char s[81];
  723.  
  724. *   Search for  xymodem_receive(fn,ft,received,0);
  725.  
  726. -D-         xymodem_receive(fn,ft,received,0);
  727. -I-         sprintf(s,"DSZ port 1 pB4096 rx -z %s%s",fn2,stripfn(fn));
  728. -I-         i = run_external1(s);
  729.  
  730. -D-         xymodem_receive(fn,ft,received,1);
  731. -I-         sprintf(s,"DSZ port 1 pB4096 rx -z %s%s",fn2,stripfn(fn));
  732. -I-         i = run_external1(s);
  733.  
  734. -D-         xymodem_receive(fn,ft,received,1);
  735. -I-         sprintf(s,"DSZ port 1 pB4096 rb -z %s%s",fn2,stripfn(fn));
  736. -I-         i = run_external1(s);
  737. -I-       break;
  738. -I-     case 5:
  739. -I-       *received=0;
  740. -I-       if (numbatchul>=12) {
  741. -I-         pl("No room left in batch queue.");
  742. -I-       } else {
  743. -I-           strcpy(&(batchfnul[numbatchul][0]),fn);
  744. -I-           strcpy(&(batchpathul[numbatchul][0]),fn2);
  745. -I-           batchdirul[numbatchul]=*dn;
  746. -I-           strcpy(&(batchdescr[numbatchul][0]),descr);
  747. -I-           numbatchul++;
  748. -I-           itoa(numbatchul+numbatch,s,10);
  749. -I-           strcat(s," file(s) added to batch que.");
  750. -I-           pl(s);
  751. -I-         }
  752.  
  753. *   Search for  extern_prot(i-6,fn,0);
  754.  
  755. -D-         extern_prot(i-6,fn,0);
  756. -D-         *received=exist(fn);
  757. -I-         strcpy(s,fn2);
  758. -I-         strcat(s,stripfn(fn));
  759. -I-         extern_prot(i-6,s,0);
  760. -I-         *received=exist(s);
  761.  
  762. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  763.  
  764.     OK, now that you have edited and saved the above files, load up Turbo C and
  765.   remake the BBS by doing a Build. RECOMPILE THE WHOLE BOARD!
  766.  
  767. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  768.  
  769.     Add the following menu into your GFILES\MENUS.MSG (note that you may
  770.   have to use a different menu number if you have other mods in...:
  771.  
  772. `15===========================================================================
  773. 2G1:Ymodem-G Batch Protocol0
  774. 2L1:ynx Batch Protocol0
  775. 2P1:uma Batch Protocol0
  776. 2Y1:modem Batch Protocol0
  777. 2Z1:modem Batch Protocol0
  778. 2Q1:uit Protocol Menu0
  779.  
  780.  
  781. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  782.  
  783.     VERY IMPORTANT! You must realize by now (I hope) that this mod depends on
  784.   using your external protocols which you setup by running INIT.EXE. The mod
  785.   ASSUMES that your board is setup like mine, with the Zmodem being the FIRST
  786.   external protocol, Ymodem SECOND, Lynx the THIRD, Puma the FOURTH, and
  787.   Ymodem-G the FIFTH!! Either setup your board like mine, or make the neccesary
  788.   changes to the code (pretty simple if you are game...).
  789.  
  790. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  791.  
  792.     A final word...this is not the last time I will release this mod. I have
  793.   a lot of ideas and will be releasing much cleaner versions later. I will
  794.   strive to put in a second file in future releases with just what changed
  795.   since the last release. I think this will make upgrading simpler.
  796.  
  797.     If there are any problems, contact me at once at Late Night BBS,
  798.   703-361-3691 or through the mod net.
  799.  
  800.   Bilbo Baggins 1@7303
  801.