home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / misc / volume32 / xbbs / part01 < prev    next >
Encoding:
Text File  |  1992-09-08  |  63.0 KB  |  2,382 lines

  1. Newsgroups: comp.sources.misc
  2. From: sandy@godzilla.Quotron.COM (Sanford Zelkovitz)
  3. Subject:  v32i016:  xbbs - A Bulletin Board System for System V, Part01/11
  4. Message-ID: <csm-v32i016=xbbs.234515@sparky.IMD.Sterling.COM>
  5. X-Md4-Signature: 47d5316d2ff5601e4692e3181301276e
  6. Date: Wed, 9 Sep 1992 04:46:33 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: sandy@godzilla.Quotron.COM (Sanford Zelkovitz)
  10. Posting-number: Volume 32, Issue 16
  11. Archive-name: xbbs/part01
  12. Environment: SYSV, Xenix
  13.  
  14. This is XBBS, version 7.2. XBBS is a bulletin board system.  Please refer to 
  15. the file MAKEbbs for information on how to setup the system.
  16.  
  17. -------
  18. #! /bin/sh
  19. # This is a shell archive.  Remove anything before this line, then feed it
  20. # into a shell via "sh file" or similar.  To overwrite existing files,
  21. # type "sh file -c".
  22. # Contents:  allign bbsc1.c.B chatbbs files.bbs listuser locking.h
  23. #   msgpack purguser sealink today xbbsgen
  24. # Wrapped by kent@sparky on Fri Sep  4 12:48:47 1992
  25. PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin ; export PATH
  26. echo If this archive is complete, you will see the following message:
  27. echo '          "shar: End of archive 1 (of 11)."'
  28. if test ! -d 'allign' ; then
  29.     echo shar: Creating directory \"'allign'\"
  30.     mkdir 'allign'
  31. fi
  32. if test -f 'bbsc1.c.B' -a "${1}" != "-c" ; then 
  33.   echo shar: Will not clobber existing file \"'bbsc1.c.B'\"
  34. else
  35.   echo shar: Extracting \"'bbsc1.c.B'\" \(43634 characters\)
  36.   sed "s/^X//" >'bbsc1.c.B' <<'END_OF_FILE'
  37. Xfile_loc( strg )
  38. Xchar *strg;
  39. X{
  40. X    int             result;
  41. X    int             i;
  42. X    int             zz;
  43. X    int             outok;
  44. X    int             len_in, len_file, times;
  45. X    long            foo;
  46. X    char            timeptr[30];
  47. X    char           *fileptr;
  48. X    char            temp[15];
  49. X    char            string_loc[20];
  50. X    int             lnctx, xp;
  51. X    
  52. X    if (xpert)
  53. X        xp = 10;
  54. X    else
  55. X        xp = 5;
  56. X
  57. X
  58. X    lnctx = 1;
  59. X    substr(z_date, z_mm, 1, 2);
  60. X    substr(z_date, z_dd, 4, 2);
  61. X    substr(z_date, z_yy, 7, 2);
  62. X    xmm = atol(z_mm);
  63. X    xdd = atol(z_dd);
  64. X    xyy = atol(z_yy);
  65. X    foo = atol(yy);
  66. X    outok = FALSE;
  67. X    old_long_date = (xyy * 10000L) + (xmm * 100L) + xdd;
  68. X    if( strg == NULL) {
  69. X        portsout("\n\r\n\rInput file name substring (max 14 characters): ");
  70. X        portsin(string_loc, 14);
  71. X        portsout(CRLF);
  72. X        fileptr = strchr(string_loc, '*');
  73. X        if( fileptr != NULL ) {
  74. X            portsout("\n\rDo not use an asterisk as part of the string.\n\r\n\r");
  75. X            return;
  76. X        }
  77. X    } else {
  78. X        strcpy(string_loc, strg );
  79. X    }
  80. X    len_in = strlen(string_loc);
  81. X    if (!len_in)
  82. X        return;
  83. X    strcpy(buf128, f_pathname);
  84. X    strcat(buf128, FILES);
  85. X    if ((rdstatbuf = fopen(buf128, "r")) == NULL) {
  86. X        portsout("\n\rThe are NO files available!\n\r");
  87. X        return;
  88. X    }
  89. X    msgck();
  90. X    portsout("\n\rSearching for a comparison\n\r\n\r");
  91. X    while (fscanf(rdstatbuf, "%14s", x_filename) != EOF) {
  92. X        zz = 0;
  93. X        if (x_filename[0] == '~') {
  94. X            goto finisx;    /* Special case so that that
  95. X                     * following files are not displayed
  96. X                     * - can be used to disallow uploads
  97. X                     * from being shown until they are
  98. X                     * validated. */
  99. X        }
  100. X        if (x_filename[0] == '+') {
  101. X            fileptr = x_filename + 1;
  102. X            strcpy(work_msg, fileptr);
  103. X            (void) fgets(buf128, 80, rdstatbuf);
  104. X            goto xend;
  105. X        }
  106. X        if (x_filename[0] == '.') {
  107. X            strcpy(x_filename, "   ");
  108. X            strcpy(who_am_i, "   ");
  109. X            strcpy(who_am_I, "   ");
  110. X            zz++;
  111. X        }
  112. X        if (result = fgets(buf128, 55, rdstatbuf) == NULL) {
  113. X            if (!zz)
  114. X                strcpy(buf128, " ***** No description on file *****");
  115. X        }
  116. X        strip(buf128);
  117. X        if (!zz)
  118. X            term_space(buf128);
  119. X        result = strlen(buf128);
  120. X        if (result == 0) {
  121. X            if (!zz)
  122. X                strcpy(buf128, " ***** No description on file *****");
  123. X        }
  124. X        if (!zz) {
  125. X            len_file = strlen(x_filename);
  126. X            if (len_file < len_in) {
  127. X                outok = FALSE;
  128. X                goto xend;
  129. X            }
  130. X            strcpy(x_pathandfile, f_pathname);
  131. X            strcat(x_pathandfile, x_filename);
  132. X            result = stat(x_pathandfile, &statbuf);
  133. X            if (result != 0) {
  134. X                strcpy(who_am_i, "OFFLINE");
  135. X                strcpy(who_am_I, "    ");
  136. X                outok = FALSE;
  137. X                goto xend;
  138. X            }
  139. X            xmm = statbuf.st_size;
  140. X            sprintf(who_am_i, "%6ld", xmm);
  141. X            xmm = statbuf.st_mtime;
  142. X            strcpy(timeptr, ctime(&xmm));
  143. X            substr(timeptr, bufx, 5, 6);
  144. X            strcpy(who_am_I, bufx);
  145. X            substr(timeptr, bufx, 5, 3);
  146. X            substr(timeptr, z_dd, 9, 2);
  147. X            substr(timeptr, z_yy, 23, 2);
  148. X            xdd = atol(z_dd);
  149. X            xyy = atol(z_yy);
  150. X            if (foo > xyy) {
  151. X                strcpy(who_am_I, bufx);
  152. X                strcat(who_am_I, "-");
  153. X                strcat(who_am_I, z_yy);
  154. X            }
  155. X            times = len_file - len_in + 1;
  156. X            outok = FALSE;
  157. X            for (result = 1; result <= times; result++) {
  158. X                substr(x_filename, temp, result, len_in);
  159. X                if (strcmp(temp, string_loc) == 0) {
  160. X                    outok = TRUE;
  161. X                    break;
  162. X                }
  163. X            }
  164. X        }
  165. X        if (!outok)
  166. X            goto xend;
  167. X        sprintf(work_msg, "%-15s%-7s%-6s%-50s", x_filename, who_am_i, who_am_I, buf128);
  168. X        strip(work_msg);
  169. X        term_space(work_msg);
  170. X
  171. X        sprintf(buf128, "%s\n\r", work_msg);
  172. X        portsout(buf128);
  173. X        if (stop_that) {
  174. X            fclose(rdstatbuf);
  175. X            stop_that = FALSE;
  176. X            return;
  177. X        }
  178. X        if (toggle) {
  179. X            lnctx++;
  180. X            if (lnctx == 23) {
  181. X                portsout(CRLF);
  182. X                portsout("*** Depress a key to continue ( control-k to quit ) ........ ");
  183. X                jnk[0] = portin();
  184. X                if (jnk[0] == CTL_K || stop_that) {
  185. X                    stop_that = FALSE;
  186. X                    fclose(rdstatbuf);
  187. X                    return;
  188. X                }
  189. X                portsout(CRLF);
  190. X                lnctx = 1;
  191. X            }
  192. X        }
  193. Xxend:
  194. X        ;
  195. X    }
  196. Xfinisx:
  197. X    fclose(rdstatbuf);
  198. X    if (toggle && lnctx > xp) {
  199. X        portsout(CRLF);
  200. X        portsout("*** Depress a key to continue ........ ");
  201. X        jnk[0] = portin();
  202. X        portsout(CRLF);
  203. X    }
  204. X    portsout(CRLF);
  205. X    portsout(CRLF);
  206. X}
  207. Xfile_n()
  208. X{
  209. X    int             result;
  210. X    int             i;
  211. X    int             zz;
  212. X    int             outok;
  213. X    long            foo;
  214. X    char            timeptr[30];
  215. X    char           *fileptr;
  216. X    int             lnctx, xp;
  217. X    static char    *dates[] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun",
  218. X                 "Jul", "Aug", "Sep", "Oct", "Nov", "Dec",};
  219. X    substr(z_date, z_mm, 1, 2);
  220. X    substr(z_date, z_dd, 4, 2);
  221. X    substr(z_date, z_yy, 7, 2);
  222. X    lnctx = 1;
  223. X    if (xpert)
  224. X        xp = 10;
  225. X    else
  226. X        xp = 5;
  227. X    xmm = atol(z_mm);
  228. X    xdd = atol(z_dd);
  229. X    xyy = atol(z_yy);
  230. X    foo = atol(yy);
  231. X    outok = FALSE;
  232. X    old_long_date = (xyy * 10000L) + (xmm * 100L) + xdd;
  233. X    strcpy(buf128, f_pathname);
  234. X    strcat(buf128, FILES);
  235. X    if ((rdstatbuf = fopen(buf128, "r")) == NULL) {
  236. X        portsout("\n\rThe are NO files available!\n\r");
  237. X        return;
  238. X    }
  239. X    strcpy(buf128, TMPFILE);
  240. X    strcat(buf128, port_id);
  241. X    msgck();
  242. X    portsout("\n\rStarting the new file search.\n\r\n\r");
  243. X    while (fscanf(rdstatbuf, "%14s", x_filename) != EOF) {
  244. X        zz = 0;
  245. X        if (x_filename[0] == '~') {
  246. X            goto finisn;    /* Special case so that that
  247. X                     * following files are not displayed
  248. X                     * - can be used to disallow uploads
  249. X                     * from being shown until they are
  250. X                     * validated. */
  251. X        }
  252. X        if (x_filename[0] == '+') {
  253. X            fileptr = x_filename + 1;
  254. X            strcpy(work_msg, fileptr);
  255. X            (void) fgets(buf128, 80, rdstatbuf);
  256. X            goto nend;
  257. X        }
  258. X        if (x_filename[0] == '.') {
  259. X            strcpy(x_filename, "   ");
  260. X            strcpy(who_am_i, "   ");
  261. X            strcpy(who_am_I, "   ");
  262. X            zz++;
  263. X        }
  264. X        if (result = fgets(buf128, 55, rdstatbuf) == NULL) {
  265. X            if (!zz)
  266. X                strcpy(buf128, " ***** No description on file *****");
  267. X        }
  268. X        strip(buf128);
  269. X        if (!zz)
  270. X            term_space(buf128);
  271. X        result = strlen(buf128);
  272. X        if (result == 0) {
  273. X            if (!zz)
  274. X                strcpy(buf128, " ***** No description on file *****");
  275. X        }
  276. X        if (!zz) {
  277. X            strcpy(x_pathandfile, f_pathname);
  278. X            strcat(x_pathandfile, x_filename);
  279. X            result = stat(x_pathandfile, &statbuf);
  280. X            if (result != 0) {
  281. X                strcpy(who_am_i, "OFFLINE");
  282. X                strcpy(who_am_I, "    ");
  283. X                outok = FALSE;
  284. X                goto nend;
  285. X            }
  286. X            xmm = statbuf.st_size;
  287. X            sprintf(who_am_i, "%6ld", xmm);
  288. X            xmm = statbuf.st_mtime;
  289. X            strcpy(timeptr, ctime(&xmm));
  290. X            substr(timeptr, bufx, 5, 6);
  291. X            strcpy(who_am_I, bufx);
  292. X            substr(timeptr, bufx, 5, 3);
  293. X            substr(timeptr, z_dd, 9, 2);
  294. X            substr(timeptr, z_yy, 23, 2);
  295. X            xdd = atol(z_dd);
  296. X            xyy = atol(z_yy);
  297. X            if (foo > xyy) {
  298. X                strcpy(who_am_I, bufx);
  299. X                strcat(who_am_I, "-");
  300. X                strcat(who_am_I, z_yy);
  301. X            }
  302. X            for (result = 0; result < 12; result++) {
  303. X                i = strcmp(bufx, dates[result]);
  304. X                if (!i) {
  305. X                    xmm = (long) result + 1;
  306. X                    new_long_date = (xyy * 10000L) + (xmm * 100L) + xdd;
  307. X                    if (new_long_date < old_long_date) {
  308. X                        outok = FALSE;
  309. X                        goto nend;
  310. X                    }
  311. X                    outok = TRUE;
  312. X                    break;
  313. X                }
  314. X            }
  315. X
  316. X        }
  317. X        if (!outok)
  318. X            goto nend;
  319. Xaroundn:
  320. X        sprintf(work_msg, "%-15s%-7s%-6s%-50s", x_filename, who_am_i, who_am_I, buf128);
  321. Xarondn:
  322. X        strip(work_msg);
  323. X        term_space(work_msg);
  324. X
  325. X        sprintf(buf128, "%s\n\r", work_msg);
  326. X        portsout(buf128);
  327. X        if (stop_that) {
  328. X            fclose(rdstatbuf);
  329. X            stop_that = FALSE;
  330. X            return;
  331. X        }
  332. X        if (toggle) {
  333. X            lnctx++;
  334. X            if (lnctx == 23) {
  335. X                portsout(CRLF);
  336. X                portsout("*** Depress a key to continue ( control-k to quit ) ........ ");
  337. X                jnk[0] = portin();
  338. X                if (jnk[0] == CTL_K || stop_that) {
  339. X                    stop_that = FALSE;
  340. X                    fclose(rdstatbuf);
  341. X                    return;
  342. X                }
  343. X                portsout(CRLF);
  344. X                lnctx = 1;
  345. X            }
  346. X        }
  347. Xnend:
  348. X        ;
  349. X    }
  350. Xfinisn:
  351. X    fclose(rdstatbuf);
  352. Xfinisln:
  353. X    if (toggle && lnctx > xp) {
  354. X        portsout(CRLF);
  355. X        portsout("*** Depress a key to continue ........ ");
  356. X        jnk[0] = portin();
  357. X        portsout(CRLF);
  358. X    }
  359. X    portsout(CRLF);
  360. X    portsout(CRLF);
  361. X}
  362. Xfile_u()
  363. X{
  364. X    char            choic1[2], *str_result;
  365. X    FILE           *storbuff;
  366. X    int             result, tryit, tryit1, code;
  367. Xfileu:
  368. X    tryit = FALSE;
  369. X    tryit1 = FALSE;
  370. X    if_kermit = 0;
  371. X    portsout("\n\rYour usage time will be STOPPED during uploads and \n\r");
  372. X    portsout("the size of the file(s) will be added to your limit.\n\r");
  373. X    portsout(CRLF);
  374. X    portsout("Input filename for upload:  ");
  375. X    portsin(x_filename, 15);
  376. X    if (strlen(x_filename) < 1)
  377. X        return;
  378. X    if (x_filename[0] == '.' || x_filename[0] == '/' || x_filename[0] == ' ') {
  379. X        portsout("\n\r\n\rIllegal Filename!\n\r");
  380. X        return;
  381. X    }
  382. X    code = strlen(x_filename);
  383. X    code--;
  384. X    if (x_filename[code] == '.' || x_filename[code] == '/' || x_filename[code] == ' ') {
  385. X        portsout("\n\r\n\rIllegal Filename! \n\r");
  386. X        return;
  387. X    }
  388. X    code = strcmp(x_filename, "files.bbs");
  389. X    if (code == 0) {
  390. X        portsout("\n\r\n\rIllegal Filename! \n\r");
  391. X        return;
  392. X    }
  393. X    code = legalname("|`><!;:", x_filename);
  394. X    if (code == 0) {
  395. X        portsout("\n\r\n\rIllegal Filename! \n\r");
  396. X        return;
  397. X    }
  398. X    portsout(CRLF);
  399. X    str_result = strchr(x_filename, '*');
  400. X    if (str_result != NULL)
  401. X        tryit = TRUE;
  402. X    strcpy(x_pathandfile, u_pathname);
  403. X    strcat(x_pathandfile, x_filename);
  404. X    if (!tryit) {
  405. X        result = stat(x_pathandfile, &statbuf);
  406. X        if (result == 0) {
  407. X            portsout("That file already exists!\n\r");
  408. X            return;
  409. X        }
  410. X    }
  411. X    portsout(CRLF);
  412. X    if ( tryit ) {
  413. X        portsout("Options: K(ermit),  B(atch ymodem),  Z(modem),\n\r\n\r");
  414. X        portsout("Commands: K,B,Z  ===> ");
  415. X    }
  416. X    else {
  417. X        portsout("Options: X(modem), C(rc xmodem), B(atch ymodem), Y(modem), Z(modem),\n\r");
  418. X        portsout("         K(ermit), S(EAlink),    A(scii)\n\r\n\r");
  419. X        portsout("Commands: X,C,B,Y,Z,K,S,A  ===> ");
  420. X    }
  421. X    portsin(choic1, 1);
  422. X    portsout(CRLF);
  423. X    *choic1 = toupper(*choic1);
  424. X    if ((inbuf = fopen(callers, "a")) == NULL) {    /* create or open for
  425. X                             * append */
  426. X        portsout(CRLF);
  427. X        portsout("Can't open/create callers file!");
  428. X        portsout(CRLF);
  429. X        return;
  430. X    }
  431. X    code = fprintf(inbuf, "%s %s  ", "   UPLOAD  ", x_filename);
  432. X    if (code < 0) {
  433. X        portsout(CRLF);
  434. X        portsout("Caller file has problem writing");
  435. X        portsout(CRLF);
  436. X    } 
  437. X    fclose(inbuf);
  438. X    if (choic1[0] == 'K' || choic1[0] == 'B' || choic1[0] == 'Z')
  439. X        tryit1 = TRUE;
  440. X    if (tryit && !tryit1) {
  441. X        portsout("\n\rIllegal use of wildcards - Must be KERMIT, YMODEM BATCH, or ZMODEM\n\r");
  442. X        typexfr(11);
  443. X        return;
  444. X    }
  445. X    switch (choic1[0]) {
  446. X    case ('X'):
  447. X        strcpy(x_pathandfile, RB);
  448. X        strcat(x_pathandfile, u_pathname);
  449. X        strcat(x_pathandfile, x_filename);
  450. X        typexfr(5);
  451. X        uploadtime();
  452. X        result = system(x_pathandfile);
  453. X        restoresig();
  454. X        updatef();
  455. X        enabletime();
  456. X        break;
  457. X    case ('Y'):
  458. X        strcpy(x_pathandfile, YMDR);
  459. X        strcat(x_pathandfile, u_pathname);
  460. X        strcat(x_pathandfile, x_filename);
  461. X        typexfr(3);
  462. X        uploadtime();
  463. X        result = system(x_pathandfile);
  464. X        restoresig();
  465. X        updatef();
  466. X        enabletime();
  467. X        break;
  468. X    case ('C'):
  469. X        strcpy(x_pathandfile, CRCR);
  470. X        strcat(x_pathandfile, u_pathname);
  471. X        strcat(x_pathandfile, x_filename);
  472. X        typexfr(4);
  473. X        uploadtime();
  474. X        result = system(x_pathandfile);
  475. X        restoresig();
  476. X        updatef();
  477. X        enabletime();
  478. X        break;
  479. X    case ('S'):
  480. X        strcpy(x_pathandfile, SEAR);
  481. X        strcat(x_pathandfile, u_pathname);
  482. X        strcat(x_pathandfile, x_filename);
  483. X        typexfr(7);
  484. X        uploadtime();
  485. X        result = system(x_pathandfile);
  486. X        restoresig();
  487. X        updatef();
  488. X        enabletime();
  489. X        break;
  490. X    case ('A'):
  491. X        strcpy(x_pathandfile, u_pathname);
  492. X        strcat(x_pathandfile, x_filename);
  493. X        typexfr(8);
  494. X        if ((storbuff = fopen(x_pathandfile, "w")) == NULL) {
  495. X            portsout("\n\rError opening upload file!\n\r");
  496. X            break;
  497. X        }
  498. X        fds = fileno(storbuff);
  499. X        rewind(storbuff);
  500. X        locking(fds, LK_LOCK, 0L);
  501. X        portsout("\n\rTerminate the ASCII upload with a control d ( ^d )");
  502. X        portsout("\n\rReady to receive ASCII upload....\n\r");
  503. X        uploadtime();
  504. X
  505. X        restoremodes();
  506. X        portrst();
  507. X
  508. X        while ((fgets(buf128, 132, stdin)) != NULL) {
  509. X            result = fputs(buf128, storbuff);
  510. X        }
  511. X        rewind(storbuff);
  512. X        locking(fds, LK_UNLCK, 0L);
  513. X        fclose(storbuff);
  514. X
  515. X        portinit();
  516. X        setmodes();
  517. X
  518. X        updatef();
  519. X        enabletime();
  520. X        break;
  521. X    case ('B'):
  522. X        strcpy(x_pathandfile, YMR);
  523. X        portsout("Please start your YMODEM transfer");
  524. X        portsout(CRLF);
  525. X        if_kermit = 1;
  526. X        typexfr(2);
  527. X        uploadtime();
  528. X        result = system(x_pathandfile);
  529. X        restoresig();
  530. X        strcpy(x_pathandfile, KRE);
  531. X        result = system(x_pathandfile);
  532. X        if ((rdstatbuf = fopen(FLIST, "r")) == NULL) {
  533. X            portsout("\n\rERROR: Unable to update!\n\r");
  534. X            exit(1);
  535. X        }
  536. X        while (fscanf(rdstatbuf, "%14s", x_filename) != EOF) {
  537. X            strcpy(x_pathandfile, u_pathname);
  538. X            strcat(x_pathandfile, x_filename);
  539. X            result = stat(x_pathandfile, &statbuf);
  540. X            if (result != 0) {
  541. X                updatef();
  542. X            } else {
  543. X                portsout(CRLF);
  544. X                portsout(x_filename);
  545. X                portsout(":  Duplicate file deleted!\n\r");
  546. X                strcpy(x_pathandfile, USRBBS);
  547. X                strcat(x_pathandfile, x_filename);
  548. X                result = unlink(x_pathandfile);
  549. X            }
  550. X        }
  551. X        enabletime();
  552. X        fclose(rdstatbuf);
  553. X        break;
  554. X    case ('K'):
  555. X        strcpy(x_pathandfile, KRA);
  556. X        portsout("Please start your KERMIT transfer");
  557. X        portsout(CRLF);
  558. X        if_kermit = 1;
  559. X        typexfr(6);
  560. X        uploadtime();
  561. X        result = system(x_pathandfile);
  562. X        restoresig();
  563. X        strcpy(x_pathandfile, KRE);
  564. X        result = system(x_pathandfile);
  565. X        if ((rdstatbuf = fopen(FLIST, "r")) == NULL) {
  566. X            portsout("\n\rERROR: Unable to update!\n\r");
  567. X            exit(1);
  568. X        }
  569. X        while (fscanf(rdstatbuf, "%14s", x_filename) != EOF) {
  570. X            strcpy(x_pathandfile, u_pathname);
  571. X            strcat(x_pathandfile, x_filename);
  572. X            result = stat(x_pathandfile, &statbuf);
  573. X            if (result != 0) {
  574. X                updatef();
  575. X            } else {
  576. X                portsout(CRLF);
  577. X                portsout(x_filename);
  578. X                portsout(":  Duplicate file deleted!\n\r");
  579. X                strcpy(x_pathandfile, USRBBS);
  580. X                strcat(x_pathandfile, x_filename);
  581. X                result = unlink(x_pathandfile);
  582. X            }
  583. X        }
  584. X        enabletime();
  585. X        fclose(rdstatbuf);
  586. X        break;
  587. X    case ('Z'):
  588. X        strcpy(x_pathandfile, RZ);
  589. X        portsout("Please start your ZMODEM transfer");
  590. X        portsout(CRLF);
  591. X        if_kermit = 1;
  592. X        typexfr(1);
  593. X        uploadtime();
  594. X        result = system(x_pathandfile);
  595. X        restoresig();
  596. X        strcpy(x_pathandfile, KRE);
  597. X        result = system(x_pathandfile);
  598. X        if ((rdstatbuf = fopen(FLIST, "r")) == NULL) {
  599. X            portsout("\n\rERROR: Unable to update!\n\r");
  600. X            exit(1);
  601. X        }
  602. X        while (fscanf(rdstatbuf, "%14s", x_filename) != EOF) {
  603. X            strcpy(x_pathandfile, u_pathname);
  604. X            strcat(x_pathandfile, x_filename);
  605. X            result = stat(x_pathandfile, &statbuf);
  606. X            if (result != 0) {
  607. X                updatef();
  608. X            } else {
  609. X                portsout(CRLF);
  610. X                portsout(x_filename);
  611. X                portsout(":  Duplicate file deleted!\n\r");
  612. X                strcpy(x_pathandfile, USRBBS);
  613. X                strcat(x_pathandfile, x_filename);
  614. X                result = unlink(x_pathandfile);
  615. X            }
  616. X        }
  617. X        enabletime();
  618. X        fclose(rdstatbuf);
  619. X        break;
  620. X    default:
  621. X        portsout("Illegal option");
  622. X        portsout(CRLF);
  623. X        typexfr(11);
  624. X        break;
  625. X    }
  626. X    portsout(CRLF);
  627. X}
  628. Xuploadtime()
  629. X{
  630. X    xsec = alarm(0);
  631. X    Ztime = xsec;
  632. X    alarm(32767);
  633. X}
  634. Xenabletime()
  635. X{
  636. X    sec = xsec;
  637. X    alarm(sec);
  638. X}
  639. Xdigit(datr) char *
  640. X                    datr;
  641. X{
  642. X    int             res;
  643. X    char           *datr1;
  644. X    datr1 = datr;
  645. X    while (*datr1) {
  646. X        res = *datr1;
  647. X        if (!isdigit(res))
  648. X            *datr1 = ' ';
  649. X        datr1++;
  650. X    }
  651. X}
  652. X
  653. X
  654. Xupdatef()
  655. X{
  656. X    /*
  657. X     * The following modifications to "updatef()" allow you to have
  658. X     * MAX_DEC_LINES lines of description for uploaded files instead of
  659. X     * just one. 
  660. X     */
  661. X#define MAX_DESC_LINES  5
  662. X    int             code;
  663. X    int             index, index2;
  664. X    char            buf50[MAX_DESC_LINES][51], tmp[51];
  665. X
  666. X    if (if_kermit == 0) {
  667. X        strcpy(buf128, u_pathname);
  668. X    } else {
  669. X        strcpy(buf128, USRBBS);
  670. X    }
  671. X    strcat(buf128, x_filename);
  672. X    (void) stat(buf128, &statbuf);
  673. X    if (statbuf.st_size == ((off_t) 0)) {
  674. X        unlink(buf128);
  675. X        return;
  676. X    }
  677. X    max_dload += statbuf.st_size;
  678. X    set_upd(-statbuf.st_size);
  679. X    portsout(CRLF);
  680. X    portsout("Please describe ");
  681. X    portsout(x_filename);
  682. X    sprintf(tmp, "    ( max of 50 characters on %d lines ) ", MAX_DESC_LINES);
  683. X    portsout(tmp);
  684. X    portsout(CRLF);
  685. X    portsout("NOTE: NO WORD WRAP.  Please watch how long your lines are!!");
  686. X    portsout(CRLF);
  687. X    portsout("Start with a / on line 1 for SYSOP ONLY!");
  688. X    portsout(CRLF);
  689. X    portsout("  ---------1---------2---------3---------4---------5");
  690. X    portsout(CRLF);
  691. X    index = 1;
  692. X    sprintf(tmp, "%1d:", index);
  693. X    portsout(tmp);
  694. X    portsin(buf50[0], 50);
  695. X    portsout(CRLF);
  696. X    while ((buf50[(index - 1)][0] != '\0') && (index < MAX_DESC_LINES)) {
  697. X        index++;
  698. X        sprintf(tmp, "%1d:", index);
  699. X        portsout(tmp);
  700. X        portsin(buf50[(index - 1)], 50);
  701. X        portsout(CRLF);
  702. X    }
  703. X    if (buf50[0][0] == '/') {
  704. X        portsout(CRLF);
  705. X        portsout(x_filename);
  706. X        portsout(" will NOT be logged\n\r");
  707. X        if ((inbuf = fopen(callers, "a")) == NULL) {
  708. X            portsout(CRLF);
  709. X            portsout("Can't open/create callers.bbs!");
  710. X            portsout(CRLF);
  711. X            return;
  712. X        }
  713. X        code = fprintf(inbuf, "%s %s", x_filename, buf50[0]);
  714. X        if (code < 0) {
  715. X            portsout(CRLF);
  716. X            portsout("Callers file has problem writing");
  717. X            portsout(CRLF);
  718. X        } else {
  719. X            fputs("\n", inbuf);
  720. X        }
  721. X        index2 = 1;
  722. X        while (index2 < index) {
  723. X            fprintf(inbuf, ". %s\n", buf50[index2]);
  724. X            index2++;
  725. X        }
  726. X        if( index == MAX_DESC_LINES )
  727. X            fprintf(inbuf, ".\n");
  728. X        fclose(inbuf);
  729. X        if (if_kermit == 0) {
  730. X            strcpy(x_pathandfile, u_pathname);
  731. X        } else {
  732. X            strcpy(x_pathandfile, USRBBS);
  733. X        }
  734. X        strcat(x_pathandfile, x_filename);
  735. X        strcpy(buf128, ORGPATH);
  736. X        strcat(buf128, x_filename);
  737. X        code = link(x_pathandfile, buf128);
  738. X        if( code == -1) {
  739. X            strcpy(buf128, "mv ");
  740. X            strcat(buf128, x_pathandfile);
  741. X            strcat(buf128, " ");
  742. X            strcat(buf128, ORGPATH);
  743. X            strcat(buf128, x_filename);
  744. X            (void)system(buf128);
  745. X            portsout("\n\r\n\rPlease leave a message to the sysop advising him that the\n");
  746. X            portsout("bbs users' home directory is NOT in the same filesystem as the upload path.\n\r\n\r");
  747. X        }
  748. X            
  749. X        (void)unlink(x_pathandfile);
  750. X        return;
  751. X    }
  752. X    strcpy(who_am_i, u_pathname);
  753. X    strcat(who_am_i, FILES);
  754. X    if ((inbuf = fopen(who_am_i, "a")) == NULL) {    /* create or open for
  755. X                             * append */
  756. X        portsout(CRLF);
  757. X        portsout("Can't open/create files.bbs!");
  758. X        portsout(CRLF);
  759. X        return;
  760. X    }
  761. X    fds = fileno(inbuf);
  762. X    rewind(inbuf);
  763. X    locking(fds, LK_LOCK, 0L);
  764. X    code = fprintf(inbuf, "%s %s", x_filename, buf50[0]);
  765. X    if (code < 0) {
  766. X        portsout(CRLF);
  767. X        portsout("List file has problem writing");
  768. X        portsout(CRLF);
  769. X    } else {
  770. X        fputs("\n", inbuf);    /* put lf on end of each record */
  771. X    }
  772. X    index2 = 1;
  773. X    while (index2 < index) {
  774. X        fprintf(inbuf, ". %s\n", buf50[index2]);
  775. X        index2++;
  776. X    }
  777. X    if( index == MAX_DESC_LINES )
  778. X        fprintf(inbuf, ".\n");
  779. X    rewind(inbuf);
  780. X    locking(fds, LK_UNLCK, 0L);
  781. X    fclose(inbuf);
  782. X    if (if_kermit != 0) {
  783. X        strcpy(x_pathandfile, USRBBS);
  784. X        strcat(x_pathandfile, x_filename);
  785. X        strcpy(buf128, u_pathname);
  786. X        strcat(buf128, x_filename);
  787. X        code = link(x_pathandfile, buf128);
  788. X        if( code == -1) {
  789. X            strcpy(buf128, "mv ");
  790. X            strcat(buf128, x_pathandfile);
  791. X            strcat(buf128, " ");
  792. X            strcat(buf128, u_pathname);
  793. X            strcat(buf128, x_filename);
  794. X            (void)system(buf128);
  795. X            portsout("\n\r\n\rPlease leave a message to the sysop advising him that the\n");
  796. X            portsout("bbs users' home directory is NOT in the same filesystem as the upload path.\n\r\n\r");
  797. X        }
  798. X            
  799. X        code = unlink(x_pathandfile);
  800. X    }
  801. X}
  802. Xenough_time()
  803. X{
  804. X    long            lsec, lspeed;
  805. X    int             size, speed, code, result, astptr;
  806. X    static int      baud[15] = {0, 50, 75, 110, 134, 150, 200, 300, 600, 1200, 1800, 2400, 4800, 9600, 19200};
  807. X    char            data_buffer[600];
  808. X    char         *ppr, *locptr;
  809. X    locptr = strchr(x_pathandfile, '*');
  810. X    if( locptr == NULL )
  811. X        astptr = 0;
  812. X    else
  813. X        astptr = 1;
  814. X    strcpy(data_buffer, "ls ");
  815. X    strcat(data_buffer, x_pathandfile);
  816. X    strcat(data_buffer, " > /tmp/wild");
  817. X    strcat(data_buffer, port_id);
  818. X    code = system(data_buffer);
  819. X    if( !astptr )
  820. X        x_pathandfile[0] = '\0';
  821. X    code = 0;
  822. X    sum_size = 0L;
  823. X    sum_lsec = 0L;
  824. X    strcpy(data_buffer, "/tmp/wild");
  825. X    strcat(data_buffer, port_id);
  826. X    portsout("\n\rThe following files will be sent:\n\r");
  827. X    if ((inbuf = fopen(data_buffer, "r")) == NULL)
  828. X        return (FALSE);
  829. X    while (fscanf(inbuf, "%s", data_buffer) != EOF) {
  830. X        result = stat(data_buffer, &statbuf);
  831. X        if( !astptr ) {
  832. X            strcat(x_pathandfile, data_buffer);
  833. X            strcat(x_pathandfile, " ");
  834. X        }
  835. X        ppr = strrchr(data_buffer, '/');
  836. X        if (ppr == NULL)
  837. X            ppr = data_buffer;
  838. X        else
  839. X            ppr++;
  840. X        if (result != 0) {
  841. X            fclose(inbuf);
  842. X            strcpy(data_buffer, "/tmp/wild");
  843. X            strcat(data_buffer, port_id);
  844. X            result = unlink(data_buffer);
  845. X            return (FALSE);
  846. X        }
  847. X        result = strcmp(ppr, "files.bbs");
  848. X        if( result == 0 ) {
  849. X            portsout("\n\rIllegal file request\n\r");
  850. X            return(FALSE);
  851. X        }
  852. X        portsout(ppr);
  853. X        portsout(CRLF);
  854. X        size = (statbuf.st_size / 128) + 1;
  855. X        ioctl(0, TCGETA, &ttyhold);
  856. X        speed = baud[ttyhold.c_cflag & 017];
  857. X        lspeed = speed;
  858. X        lsec = size;
  859. X        sum_lsec = sum_lsec + (lsec * 128L * 11L / lspeed);
  860. X        sum_size = sum_size + statbuf.st_size;
  861. X        code++;
  862. X    }
  863. X    if( ! astptr ) {
  864. X        ppr = strrchr( x_pathandfile, ' ');
  865. X        if( ppr != NULL )
  866. X            *ppr = '\0';
  867. X    }
  868. X    fclose(inbuf);
  869. X    strcpy(data_buffer, "/tmp/wild");
  870. X    strcat(data_buffer, port_id);
  871. X    result = unlink(data_buffer);
  872. X    strcpy(buf128, "\n\rTotal number of files = ");
  873. X    itoa(data_buffer, code);
  874. X    strcat(buf128, data_buffer);
  875. X    strcat(buf128, "\n\r");
  876. X    portsout(buf128);
  877. X    strcpy(buf128, "Total number of bytes = ");
  878. X    sprintf(data_buffer, "%ld", sum_size);
  879. X    strcat(buf128, data_buffer);
  880. X    portsout(buf128);
  881. X    strcpy(buf128, "\n\rTotal download time = ");
  882. X    sprintf(data_buffer, "%ld", sum_lsec);
  883. X    strcat(buf128, data_buffer);
  884. X    strcat(buf128, " seconds\n\r");
  885. X    portsout(buf128);
  886. X    xsec = alarm(0);
  887. X    Ztime = xsec;
  888. X    sec = xsec;
  889. X    alarm(sec);
  890. X    if (sum_lsec > xsec)
  891. X        return (FALSE);
  892. X    if ((sum_size + dload_total) > max_dload)
  893. X        return (FALSE);
  894. X    if( sum_size == 0L )
  895. X        return (FALSE);
  896. X    return (TRUE);
  897. X}
  898. Xfile_d()
  899. X{
  900. X    FILE        *zipp;
  901. X    char            choic2[2], *str_result, *ptr, *ptr1;
  902. X    long            lsec, hold_sec, jsec, ksec;
  903. X    unsigned        start_sec, stop_sec;
  904. X    long            var_sec;
  905. X    int             result, tryit, tryit1, size, speed, default_flag, code;
  906. X    int        mult;
  907. X    static int      baud[15] = {0, 50, 75, 110, 134, 150, 200, 300, 600, 1200, 1800, 2400, 4800, 9600, 19200};
  908. Xfiled:
  909. X    result = stat(DLMSG, &statbuf);
  910. X    if (!result) {
  911. X        portsout(CRLF);
  912. X        no_cntrl_k = TRUE;
  913. X        cmd_p(DLMSG);
  914. X        no_cntrl_k = FALSE;
  915. X        portsout(CRLF);
  916. X    }
  917. X    tryit = FALSE;
  918. X    tryit1 = FALSE;
  919. X    mult = FALSE;
  920. X    portsout(CRLF);
  921. X    portsout("Input file name(s) to download:  ");
  922. X    portsin(x_filename, 98);
  923. X    if (strlen(x_filename) < 1)
  924. X        return;
  925. X    if (x_filename[0] == '.' || x_filename[0] == '/' || x_filename[0] == ' ') {
  926. X        portsout("\n\r\n\rIllegal Filename! \n\r");
  927. X        return;
  928. X    }
  929. X    code = strlen(x_filename);
  930. X    code--;
  931. X    if (x_filename[code] == '.' || x_filename[code] == '/' || x_filename[code] == ' ') {
  932. X        portsout("\n\r\n\rIllegal Filename! \n\r");
  933. X        return;
  934. X    }
  935. X    code = strcmp(x_filename, "files.bbs");
  936. X    if (code == 0) {
  937. X        portsout("\n\r\n\rIllegal Filename! \n\r");
  938. X        return;
  939. X    }
  940. X    str_result = strchr(x_filename, '*');
  941. X    if (str_result != NULL)
  942. X        tryit = TRUE;
  943. X
  944. X    str_result = strchr(x_filename, ' ');
  945. X    if (str_result != NULL) {
  946. X        tryit = TRUE;
  947. X        mult = TRUE;
  948. X    }
  949. X
  950. X    portsout(CRLF);
  951. X    code = legalname("|`><!;:", x_filename);
  952. X    if (code == 0) {
  953. X        portsout("\n\r\n\rIllegal Filename! \n\r");
  954. X        return;
  955. X    }
  956. X    if( mult ) {
  957. X        ptr = x_filename;
  958. X        x_pathandfile[0] = '\0';
  959. X        while(1) {
  960. X            ptr1 = strchr(ptr, ' ');
  961. X            if(ptr1 == NULL)
  962. X                break;    
  963. X            *ptr1 = '\0';
  964. X            strcat(x_pathandfile, f_pathname);
  965. X            strcat(x_pathandfile, ptr);
  966. X            strcat(x_pathandfile, " ");
  967. X            *ptr1 = (char)' ';
  968. X            ptr = ptr1 + 1;
  969. X        }
  970. X        strcat(x_pathandfile, f_pathname);
  971. X        strcat(x_pathandfile, ptr);
  972. X    } else {
  973. X        strcpy(x_pathandfile, f_pathname);
  974. X        strcat(x_pathandfile, x_filename);
  975. X    }
  976. X    if (!tryit) {
  977. X        result = stat(x_pathandfile, &statbuf);
  978. X        if (result != 0) {
  979. X            portsout("\n\rThat file does not exist!\n\r");
  980. X            portsout("Remember that file names are CASE sensitive.\n\r");
  981. X            return;
  982. X        }
  983. X        size = (statbuf.st_size / 128) + 1;
  984. X        ioctl(0, TCGETA, &ttyhold);
  985. X        speed = baud[ttyhold.c_cflag & 017];
  986. X        lsec = size;
  987. X        lsec = lsec * 128L * 11L / speed;
  988. X        sum_size = statbuf.st_size;
  989. X        xsec = alarm(0);
  990. X        Ztime = xsec;
  991. X        sec = xsec;
  992. X        alarm(sec);
  993. X        hold_sec = lsec;
  994. X        if (lsec > xsec) {
  995. X            portsout("\n\rYou don't have enough time left to download that file.\n\r");
  996. X            return;
  997. X        }
  998. X        if ((statbuf.st_size + dload_total) > max_dload) {
  999. X            portsout("\n\rThis download will overrun your download limit.");
  1000. X            portsout("\n\rUploads will increase your limit.\n\r");
  1001. X            return;
  1002. X        }
  1003. X    } else {
  1004. X        if (!enough_time()) {
  1005. X            portsout("\n\rYou don't have enough time/bytes or an error was detected.\n\r");
  1006. X            return;
  1007. X        }
  1008. X        hold_sec = sum_lsec;
  1009. X    }
  1010. X    hold_sec /= 2L;
  1011. X    portsout(CRLF);
  1012. X    if ( tryit ) 
  1013. X        portsout("Multi-file options: Z(modem),  B(atch ymodem), K(ermit)");
  1014. X    else {
  1015. X        portsout("Options: Z(modem),  C(rc xmodem), X(modem), B(atch ymodem), Y(modem),\n\r");
  1016. X        portsout("         K(ermit),  S(EAlink),    A(scii),  T(ype)");
  1017. X    }
  1018. X    portsout(CRLF);
  1019. X    portsout(CRLF);
  1020. X    if ( tryit )
  1021. X        portsout("Commands: Z,B,K  ===> ");
  1022. X    else
  1023. X        portsout("Commands: Z,C,X,B,Y,K,S,A,T  ===> ");
  1024. X    portsin(choic2, 1);
  1025. X    portsout(CRLF);
  1026. X    default_flag = 1;
  1027. X    *choic2 = toupper(*choic2);
  1028. X    if ((inbuf = fopen(callers, "a")) == NULL) {    /* create or open for
  1029. X                             * append */
  1030. X        portsout(CRLF);
  1031. X        portsout("Can't open/create callers file!");
  1032. X        portsout(CRLF);
  1033. X        return;
  1034. X    }
  1035. X    code = fprintf(inbuf, "%s %s  ", "   DNLOAD  ", x_filename);
  1036. X    if (code < 0) {
  1037. X        portsout(CRLF);
  1038. X        portsout("Caller file has problem writing");
  1039. X        portsout(CRLF);
  1040. X    } 
  1041. X    fclose(inbuf);
  1042. X    if (choic2[0] == 'K' || choic2[0] == 'B' || choic2[0] == 'Z')
  1043. X        tryit1 = TRUE;
  1044. X    if (tryit && !tryit1) {
  1045. X        portsout("\n\rIllegal use of wildcards - Must be KERMIT, YMODEM BATCH, or ZMODEM\n\r");
  1046. X        typexfr(11);
  1047. X        return;
  1048. X    }
  1049. X    start_sec = stop_sec = 0;
  1050. X    xsec = alarm(0);
  1051. X    alarm(32767);
  1052. X    switch (choic2[0]) {
  1053. X    case ('T'):
  1054. X        portsout("\n\r\n\rOne moment please while an ascii check is done on the file ......  ");
  1055. X        if(!asciicheck(x_pathandfile)) {
  1056. X            portsout("Sorry.\n\rEither the file does not exist or it is not printable ascii.\n\r\n\r");
  1057. X            typexfr(10);
  1058. X            return;
  1059. X        }
  1060. X        portsout("ok.\n\r\n\r");
  1061. X        cmd_p(x_pathandfile);
  1062. X        typexfr(9);
  1063. X        break;
  1064. X    case ('A'):
  1065. X        strcpy(x_pathandfile, f_pathname);
  1066. X        strcat(x_pathandfile, x_filename);
  1067. X        portsout("\n\r\n\rOne moment please while an ascii check is done on the file ......  ");
  1068. X        if(!asciicheck(x_pathandfile)) {
  1069. X            portsout("Sorry.\n\rEither the file does not exist or it is not printable ascii.\n\r\n\r");
  1070. X            typexfr(10);
  1071. X            return;
  1072. X        }
  1073. X        portsout("ok.\n\r\n\r");
  1074. X        typexfr(8);
  1075. X        portsout("\n\rOnce the transfer starts, you may terminate it by typing a Control-K");
  1076. X        portsout("\n\rType a character to start the transfer when you are ready ===>  ");
  1077. X        portsin(choic2, 1);
  1078. X        portsout(CRLF);
  1079. X        no_cntrl_k = TRUE;
  1080. X        if (!toggle) {
  1081. X            cmd_p(x_pathandfile);
  1082. X        } else {
  1083. X            toggle = FALSE;
  1084. X            cmd_p(x_pathandfile);
  1085. X            toggle = TRUE;
  1086. X        }
  1087. X        no_cntrl_k = FALSE;
  1088. X        sleep(3);
  1089. X        break;
  1090. X    case ('X'):
  1091. X        strcpy(x_pathandfile, SB);
  1092. X        strcat(x_pathandfile, f_pathname);
  1093. X        strcat(x_pathandfile, x_filename);
  1094. X        typexfr(5);
  1095. X        result = system(x_pathandfile);
  1096. X        restoresig();
  1097. X        start_sec = result;
  1098. X        sleep(1);
  1099. X        break;
  1100. X    case ('Y'):
  1101. X        strcpy(x_pathandfile, YMDS);
  1102. X        strcat(x_pathandfile, f_pathname);
  1103. X        strcat(x_pathandfile, x_filename);
  1104. X        typexfr(3);
  1105. X        result = system(x_pathandfile);
  1106. X        restoresig();
  1107. X        start_sec = result;
  1108. X        sleep(1);
  1109. X        break;
  1110. X    case ('C'):
  1111. X        strcpy(x_pathandfile, CRCS);
  1112. X        strcat(x_pathandfile, f_pathname);
  1113. X        strcat(x_pathandfile, x_filename);
  1114. X        typexfr(4);
  1115. X        result = system(x_pathandfile);
  1116. X        restoresig();
  1117. X        start_sec = result;
  1118. X        sleep(1);
  1119. X        break;
  1120. X    case ('S'):
  1121. X        strcpy(x_pathandfile, SEAS);
  1122. X        strcat(x_pathandfile, f_pathname);
  1123. X        strcat(x_pathandfile, x_filename);
  1124. X        typexfr(7);
  1125. X        result = system(x_pathandfile);
  1126. X        restoresig();
  1127. X        start_sec = result;
  1128. X        sleep(1);
  1129. X        break;
  1130. X    case ('Z'):
  1131. X        strcpy(msg_text, SZ);
  1132. X        strcat(msg_text, x_pathandfile);
  1133. X        typexfr(1);
  1134. X        result = system(msg_text);
  1135. X        restoresig();
  1136. X        start_sec = result;
  1137. X        sleep(1);
  1138. X        break;
  1139. X    case ('B'):
  1140. X        strcpy(msg_text, YMS);
  1141. X        strcat(msg_text, x_pathandfile);
  1142. X        typexfr(2);
  1143. X        result = system(msg_text);
  1144. X        restoresig();
  1145. X        start_sec = result;
  1146. X        sleep(1);
  1147. X        break;
  1148. X    case ('K'):
  1149. X        strcpy(msg_text, KS);
  1150. X        strcat(msg_text, x_pathandfile);
  1151. X        typexfr(6);
  1152. X        portsout("Ready to start KERMIT transfer");
  1153. X        portsout(CRLF);
  1154. X        result = system(msg_text);
  1155. X        restoresig();
  1156. X        start_sec = result;
  1157. X        break;
  1158. X    default:
  1159. X        portsout("Illegal option");
  1160. X        typexfr(11);
  1161. X        default_flag = 0;
  1162. X        portsout(CRLF);
  1163. X        break;
  1164. X    }
  1165. X    sec = alarm(0);
  1166. X    jsec = 32767L - (long) sec;
  1167. X    ksec = (long) xsec;
  1168. X    ksec -= jsec;
  1169. X    if (ksec <= 2L)
  1170. X        ksec = 2L;
  1171. X    xsec = (unsigned int) ksec;
  1172. X    code = 0;
  1173. X    if (default_flag) {
  1174. X        if ((zipp = fopen(callers, "a")) == NULL) {    /* create or open for
  1175. X                                 * append */
  1176. X            portsout(CRLF);
  1177. X            portsout("Can't open/create callers file!");
  1178. X            portsout(CRLF);
  1179. X            return;
  1180. X        }
  1181. X        if (start_sec == 0) {
  1182. X            dload_total += sum_size;
  1183. X            set_upd(sum_size);
  1184. X            code = fprintf(zipp, "      Transfer seems to be OK.\n");
  1185. X        } else 
  1186. X            code = fprintf(zipp, "      Transfer seems to have failed.\n");
  1187. X        if (code < 0) {
  1188. X            portsout(CRLF);
  1189. X            portsout("Caller file has problem writing");
  1190. X            portsout(CRLF);
  1191. X        } 
  1192. X        fclose(zipp);
  1193. X
  1194. X    }
  1195. X    alarm(xsec);
  1196. X    portsout(CRLF);
  1197. X}
  1198. Xtypexfr(typex)  int typex;
  1199. X{
  1200. X    int code;
  1201. X    if ((inbuf = fopen(callers, "a")) == NULL) {    /* create or open for
  1202. X                             * append */
  1203. X        portsout(CRLF);
  1204. X        portsout("Can't open/create callers file!");
  1205. X        portsout(CRLF);
  1206. X        return;
  1207. X    }
  1208. X    switch (typex) {
  1209. X        case (1): code = fprintf(inbuf, " using ZMODEM\n");
  1210. X            break;
  1211. X        case (2): code = fprintf(inbuf, " using BATCH YMODEM\n");
  1212. X            break;
  1213. X        case (3): code = fprintf(inbuf, " using YMODEM\n");
  1214. X            break;
  1215. X        case (4): code = fprintf(inbuf, " using XMODEM-CRC\n");
  1216. X            break;
  1217. X        case (5): code = fprintf(inbuf, " using XMODEM-CHECKSUM\n");
  1218. X            break;
  1219. X        case (6): code = fprintf(inbuf, " using KERMIT\n");
  1220. X            break;
  1221. X        case (7): code = fprintf(inbuf, " using SEALINK\n");
  1222. X            break;
  1223. X        case (8): code = fprintf(inbuf, " using ASCII\n");
  1224. X            break;
  1225. X        case (9): code = fprintf(inbuf, " using TYPE\n");
  1226. X            break;
  1227. X        case (10): code = fprintf(inbuf, " NOT printable ASCII\n");
  1228. X            break;
  1229. X        default:  code = fprintf(inbuf, " ......... illegal option!\n");
  1230. X            break;
  1231. X    }
  1232. X    if (code < 0) {
  1233. X        portsout(CRLF);
  1234. X        portsout("Caller file has problem writing");
  1235. X        portsout(CRLF);
  1236. X    }
  1237. X    fclose(inbuf);
  1238. X}
  1239. X
  1240. Xcmd_e()
  1241. X{                /* enter a message */
  1242. X    int             entering, editing, char_cnt, temp_int, temp_int1;
  1243. X    char            l_cnt[3], type[2], ans[2];
  1244. X    char           *char_ptr;
  1245. X    char            tmp[80];
  1246. X
  1247. X    entering = editing = TRUE;
  1248. X    cnt1 = 0;
  1249. X    strcpy(l_cnt, "00");
  1250. X    msg_text[0] = '\0';    /* init message text area */
  1251. X    portsout(CRLF);
  1252. X    portsout("This will be message # ");
  1253. X    portsout(h_act_msg);
  1254. X    portsout(CRLF);
  1255. X    if (!reply_sw) {
  1256. X        entr_name();
  1257. X        entr_subj();
  1258. X    }
  1259. X    if (!end_msg)
  1260. X        entr_priv();
  1261. X    if (end_msg)
  1262. X        strcpy(pubpriv, "5");
  1263. X
  1264. X    portsout(CRLF);
  1265. X    sprintf(tmp, "A line can contain 72 characters, up to %d lines.", MAX_MSG_LINES);
  1266. X    portsout(tmp);
  1267. X    portsout(CRLF);
  1268. X    portsout("To end, enter a carriage return on an empty line.");
  1269. X    portsout(CRLF);
  1270. X    if(blocked_m)
  1271. X        portsout("The lines will automatically word wrap and block.");
  1272. X    else
  1273. X        portsout("The lines will automatically word wrap.");
  1274. X    portsout(CRLF);
  1275. XEnter:
  1276. X    portsout(CRLF);
  1277. X    portsout("    .___.____1____.____2____.____3____.____4____.____5____.____6____.____7__");
  1278. X    portsout(CRLF);
  1279. X
  1280. X    char_cnt = 72;
  1281. X    work_msg[0] = '\0';
  1282. X    while (entering) {    /* get the text of the message */
  1283. X        linecnt(l_cnt);    /* calc line count */
  1284. X
  1285. X        portsout(l_cnt);/* show line count */
  1286. X        portsout("> ");    /* and prompt */
  1287. X        portsout(work_msg);
  1288. X        strcpy(buf128, work_msg);
  1289. X        in_the_buffer = strlen(buf128);
  1290. X        work_msg[0] = '\0';
  1291. X        portsinm(x_pathandfile, char_cnt, buf128);
  1292. X        char_ptr = strrchr(x_pathandfile, ' ');
  1293. X        temp_int = strlen(x_pathandfile);
  1294. X        if (temp_int >= char_cnt) {
  1295. X            if (x_pathandfile[temp_int - 1] == '\n' || x_pathandfile[temp_int - 1] == '\r' || x_pathandfile[temp_int - 1] == ' ') {
  1296. X                char_cnt = 72;
  1297. X                goto enter1;
  1298. X            }
  1299. X            if (char_ptr != NULL) {
  1300. X                *char_ptr = '\0';
  1301. X                char_ptr++;
  1302. X                strcpy(work_msg, char_ptr);
  1303. X                temp_int = strlen(work_msg);
  1304. X                for (temp_int1 = 1; temp_int1 <= temp_int; temp_int1++)
  1305. X                    portsout("\b");
  1306. X                for (temp_int1 = 1; temp_int1 <= temp_int; temp_int1++)
  1307. X                    portsout(" ");
  1308. X                char_cnt = 72 - temp_int;
  1309. X
  1310. X            } else {
  1311. X                char_cnt = 72;
  1312. X            }
  1313. X        } else {
  1314. X            char_cnt = 72;
  1315. X            work_msg[0] = '\0';
  1316. X
  1317. X        }
  1318. Xenter1:
  1319. X        strcat(buf128, x_pathandfile);
  1320. X        portsout(CRLF);
  1321. X
  1322. X        strcat(buf128, "\n");    /* put a <lf> on each line */
  1323. X        if(blocked_m) {
  1324. X            strcpy(x_pathandfile, buf128);
  1325. X            block_text();
  1326. X        }
  1327. X
  1328. X        if (strlen(buf128) < 2) {    /* count cr too */
  1329. X            entering = FALSE;    /* all done */
  1330. X        } else {
  1331. X            strcat(msg_text, buf128);    /* append each line to
  1332. X                             * text */
  1333. X        }
  1334. X        if ((++cnt1) > MAX_MSG_LINES) {    /* only allow 20 lines */
  1335. X            entering = FALSE;    /* all done */
  1336. X        }
  1337. X    }
  1338. X
  1339. X    while (editing) {    /* save it, fix it, list it, or get out */
  1340. X        portsout(CRLF);
  1341. X        portsout("(S)ave,    (L)ist,     (C)ontinue, or (Q)uit");
  1342. X        portsout(CRLF);
  1343. X        portsout("ce(N)ter,  (B)lock,    (D)elete,      (I)nsert,    (R)eplace,  or (E)dit line");
  1344. X        portsout(CRLF);
  1345. X        portsout("Change     sub(J)ect,  recei(V)er, or (P)rivilege ==> ");
  1346. X        portsin(ans, 1);/* get a byte */
  1347. X        portsout(CRLF);
  1348. X
  1349. X        *ans = toupper(*ans);
  1350. X
  1351. X        switch (ans[0]) {    /* get 1 byte */
  1352. X        case ('S'):    /* save message */
  1353. X            new_msg = atoi(h_act_msg);
  1354. X            savemsg();
  1355. X            editing = FALSE;    /* get out of while */
  1356. X            break;
  1357. X        case ('E'):    /* edit message */
  1358. X        case ('I'):    /* edit message */
  1359. X        case ('D'):    /* edit message */
  1360. X        case ('R'):
  1361. X        case ('N'):
  1362. X        case ('B'):
  1363. X            editmsg(*ans);
  1364. X            break;
  1365. X        case ('P'):
  1366. X            if (end_msg) {
  1367. X                portsout("\n\rCannot change the privilege on a log off message\n\r");
  1368. X                break;
  1369. X            }
  1370. X            entr_priv();
  1371. X            portsout(CRLF);
  1372. X            break;
  1373. X        case ('J'):
  1374. X            if (end_msg) {
  1375. X                portsout("\n\rCannot change the subject on a log off message\n\r");
  1376. X                break;
  1377. X            }
  1378. X            if (reply_sw) {
  1379. X                portsout("\n\rCannot change the subject on a reply to a message\n\r");
  1380. X                break;
  1381. X            }
  1382. X            portsout(CRLF);
  1383. X            entr_subj();
  1384. X            portsout(CRLF);
  1385. X            break;
  1386. X        case ('V'):
  1387. X            if (end_msg) {
  1388. X                portsout("\n\rCannot change the name of the receiver on a log off message\n\r");
  1389. X                break;
  1390. X            }
  1391. X            if (reply_sw) {
  1392. X                portsout("\n\rCannot change the receiver's name on a message reply\n\r");
  1393. X                break;
  1394. X            }
  1395. X            entr_name();
  1396. X            break;
  1397. X        case ('L'):    /* list message */
  1398. X            listmsg();
  1399. X            break;
  1400. X        case ('Q'):    /* get out w/out saving */
  1401. X            portsout("\n\r\n\rAre you sure you want to quit? (Y/n): ");
  1402. X            portsin(ans, 1);
  1403. X            portsout(CRLF);
  1404. X            if (ans[0] == 'N' || ans[0] == 'n')
  1405. X                break;
  1406. X            editing = FALSE;    /* get out of while */
  1407. X            break;
  1408. X        case ('C'):
  1409. X            if (cnt1 == MAX_MSG_LINES) {
  1410. X                sprintf(tmp, "\n\rMessage is already %d lines!\n\r", MAX_MSG_LINES);
  1411. X                portsout(tmp);
  1412. X                break;
  1413. X            }
  1414. X            entering = TRUE;
  1415. X            cnt1--;
  1416. X            itoa(l_cnt, cnt1);
  1417. X            goto Enter;
  1418. X            break;
  1419. X        default:
  1420. X            portsout(CRLF);
  1421. X            portsout("Shall we try that one again?\r\n");
  1422. X            break;
  1423. X        }
  1424. X    }
  1425. X
  1426. X}
  1427. X/* end of function               */
  1428. Xentr_name()
  1429. X{
  1430. X    char            z_fname[11], z_lname[16], z_full[22];
  1431. X    int             length, length1;
  1432. X    char            firstz[20], lastz[20];
  1433. X    char            priv[6];
  1434. X    char            etime[9];
  1435. X    char            esize[9];
  1436. Xenter_it_again:
  1437. X    length1 = 0;
  1438. X    portsout(CRLF);
  1439. X    portsout("                                           ____.____1\r\n");
  1440. X    portsout("Enter the FIRST NAME of the receiver ===>  ");
  1441. X    portsin(z_fname, 10);
  1442. X    length = strlen(z_fname);
  1443. X    if (!length) {
  1444. X        strcpy(z_fname, "All");
  1445. X        z_lname[0] = '\0';
  1446. X        goto bobble;
  1447. X    }
  1448. X    portsout(CRLF);
  1449. X    portsout("                                           ____.____1____.\r\n");
  1450. X    portsout("Enter the LAST NAME of the receiver ====>  ");
  1451. X    portsin(z_lname, 15);
  1452. X    length1 = strlen(z_lname);
  1453. Xbobble:
  1454. X    portsout(CRLF);
  1455. X    fix_name(z_fname);
  1456. X    fix_name(z_lname);
  1457. X    length += length1;
  1458. X    if (length > 20) {
  1459. X        portsout("\n\rI'm sorry; however, the name is TOO long to be posted!\n\r");
  1460. X        goto enter_it_again;
  1461. X    }
  1462. X    strcpy(z_full, z_fname);
  1463. X    strcat(z_full, " ");
  1464. X    strcat(z_full, z_lname);
  1465. X    strcpy(msg_to, z_full);
  1466. X    portsout(CRLF);
  1467. X    if ((inbuf = fopen(USERPRIV, "r")) == NULL) {
  1468. X        portsout(CRLF);
  1469. X        portsout("Can't open user priv file!");
  1470. X        portsout(CRLF);
  1471. X        exit(1);
  1472. X    }
  1473. X    while (fscanf(inbuf, "%s%s%s%s%s", firstz, lastz, priv, etime, esize) != EOF) {
  1474. X        if ((strcmp(firstz, z_fname) == 0) &&
  1475. X            (strcmp(lastz, z_lname) == 0)) {
  1476. X            return;
  1477. X        }
  1478. X    }
  1479. X    fclose(inbuf);
  1480. X    if( strcmp(z_fname, "Sysop") == 0 ) {
  1481. X        strcpy(msg_to, SYSOP);
  1482. X        return;
  1483. X    }
  1484. X    if( strcmp(z_fname, "All") == 0 ) {
  1485. X        strcpy(msg_to, "All Users");
  1486. X        return;
  1487. X    }
  1488. X    portsout("\n\rWarning: there is no user on this system by that name.\n\r");
  1489. X    portsout("Do you still wish to use it? (Y/n): ");
  1490. X    portsin(etime, 1);
  1491. X    portsout(CRLF);
  1492. X    if( etime[0] == 'N' || etime[0] == 'n' )
  1493. X        goto enter_it_again;
  1494. X}
  1495. X
  1496. Xentr_subj()
  1497. X{
  1498. X    int             length;
  1499. X    portsout("                             ____.____1____.____2\n\r");
  1500. X    portsout("What is the subject     ===> ");
  1501. X    portsin(msg_subject, 20);
  1502. X    length = strlen(msg_subject);
  1503. X    if (!length) {
  1504. X        strcpy(msg_subject, "*** NO SUBJECT ***");
  1505. X    }
  1506. X}
  1507. Xentr_priv()
  1508. X{
  1509. X    char            type[2];
  1510. X    portsout(CRLF);
  1511. X    portsout("Do you wish the message to be P(ublic) or pri(V)ate) (P/V) ?  ");
  1512. X    portsin(type, 1);
  1513. X    *type = toupper(*type);
  1514. X    switch (type[0]) {
  1515. X    case ('P'):
  1516. X        strcpy(pubpriv, "0");
  1517. X        break;
  1518. X    case ('V'):
  1519. X        strcpy(pubpriv, "5");
  1520. X        break;
  1521. X    default:
  1522. X        portsout("\n\rDefaulting to public!\n\r");
  1523. X        strcpy(pubpriv, "0");
  1524. X        break;
  1525. X    }
  1526. X}
  1527. Xlinecnt(lcnt)            /* 2 byte string of line numbers */
  1528. X    char           *lcnt;
  1529. X{
  1530. X    int             icnt;
  1531. X    char            xcnt[4];
  1532. X
  1533. X    icnt = atoi(lcnt);
  1534. X    if (++icnt < 10) {
  1535. X        strcpy(lcnt, "0");
  1536. X        itoa(xcnt, icnt);
  1537. X        strcat(lcnt, xcnt);
  1538. X    } else {
  1539. X        itoa(xcnt, icnt);
  1540. X        strcpy(lcnt, xcnt);
  1541. X    }
  1542. X    return;
  1543. X}
  1544. X/* end of function               */
  1545. X
  1546. Xsavemsg()
  1547. X{                /* save a message */
  1548. X    int             fd;
  1549. X
  1550. X    portsout("Saving...\r\n");
  1551. X
  1552. X    strcpy(msg_delete, pubpriv);    /* delete byte */
  1553. X    strcpy(msg_date, mm);
  1554. X    strcat(msg_date, "/");
  1555. X    strcat(msg_date, dd);
  1556. X    strcat(msg_date, "/");
  1557. X    strcat(msg_date, yy);
  1558. X
  1559. X    strcpy(msg_time, ttime);/* and the time */
  1560. X
  1561. X    strcpy(msg_from, w_fname);    /* and the from name */
  1562. X    strcat(msg_from, " ");
  1563. X    strcat(msg_from, w_lname);
  1564. X    if ((inbuf = fopen(callers, "a")) == NULL) {    /* create or open for
  1565. X                             * append */
  1566. X        portsout(CRLF);
  1567. X        portsout("Can't open/create callers file!");
  1568. X        portsout(CRLF);
  1569. X        return;
  1570. X    }
  1571. X    fd = fprintf(inbuf, "%s%s", "   Message being sent to ", msg_to);
  1572. X    if (fd < 0) {
  1573. X        portsout(CRLF);
  1574. X        portsout("Caller file has problem writing");
  1575. X        portsout(CRLF);
  1576. X    } else {
  1577. X        fputs("\n", inbuf);    /* put lf on end of each record */
  1578. X    }
  1579. X    fclose(inbuf);
  1580. X    hdrread();        /* Guarantee proper header and table */
  1581. X    if ((fd = msgopen(2)) == ERROR) {    /* open i/o */
  1582. X        return (ERROR);
  1583. X    }
  1584. X    msgwrt(fd);        /* write the message */
  1585. X    msgclose(fd);
  1586. X
  1587. X    strcpy(h_date, msg_date);
  1588. X    hdrwrt();        /* update the header file */
  1589. X}
  1590. X/* end of function               */
  1591. X
  1592. X
  1593. Xlistmsg()
  1594. X{
  1595. X    char           *ptr, byte, lcnt[3];
  1596. X    int             i;
  1597. X
  1598. X    ptr = msg_text;        /* ptr points to start of text */
  1599. X    strcpy(lcnt, "00");
  1600. X
  1601. X    portsout(CRLF);
  1602. X    while (*ptr != 0) {
  1603. X        linecnt(lcnt);
  1604. X        portsout(lcnt);    /* put out line number */
  1605. X        portsout(">");
  1606. X        while (byte = *ptr++) {
  1607. X            if (byte == '\n') {    /* we dont save <cr>, so add *//* i
  1608. X                         * t here when find a <cr> */
  1609. X                portsout(CRLF);
  1610. X                break;
  1611. X            } else
  1612. X                portout(byte);
  1613. X        }
  1614. X    }
  1615. X}
  1616. X/* end of function               */
  1617. X
  1618. Xeditmsg(tflag) char
  1619. X    tflag;
  1620. X{
  1621. X    char            ans[3];
  1622. X    int             lnum;    /* line number to edit */
  1623. X    char            tmp[80];
  1624. X
  1625. X    while (1) {
  1626. X        portsout(CRLF);
  1627. X        portsout("Enter line number to ");
  1628. X        if (tflag == 'E')
  1629. X            portsout("edit,");
  1630. X        else if (tflag == 'D')
  1631. X            portsout("delete,");
  1632. X        else if (tflag == 'I')
  1633. X            portsout("insert after,");
  1634. X        else if (tflag == 'R')
  1635. X            portsout("replace,");
  1636. X        else if (tflag == 'N')
  1637. X            portsout("center,");
  1638. X        else if (tflag == 'B')
  1639. X            portsout("block,");
  1640. X        else
  1641. X            return;
  1642. X        portsout(CRLF);
  1643. X        portsout("   or RETURN to exit ==> ");
  1644. X        portsin(ans, 2);/* only MAX_MSG_LINES lines possible */
  1645. X        portsout(CRLF);
  1646. X        if (tflag == 'I' && cnt1 == MAX_MSG_LINES) {
  1647. X            sprintf(tmp, "\n\rMessage is already %d lines!\n\r", MAX_MSG_LINES);
  1648. X            portsout(tmp);
  1649. X            return;
  1650. X        }
  1651. X        lnum = atoi(ans);
  1652. X        if (lnum <= 0) {
  1653. X            break;    /* out of while and return */
  1654. X        }
  1655. X        if ((lnum < MAX_MSG_LINES) || ((lnum == MAX_MSG_LINES) && (tflag != 'I'))) {
  1656. X            editline(lnum, tflag);
  1657. X            break;
  1658. X        } else {    /* else slap on hand and loop around */
  1659. X            sprintf(tmp, "Aw come on, there can only be %d lines!", MAX_MSG_LINES);
  1660. X            portsout(tmp);
  1661. X            portsout(CRLF);
  1662. X            portsout("Shall we try that again?");
  1663. X            portsout(CRLF);
  1664. X        }
  1665. X    }
  1666. X}
  1667. X/* end of function               */
  1668. X
  1669. Xusenet()
  1670. X{                /* added for 7.2.1 USENET access */
  1671. X
  1672. X
  1673. X#ifdef  SYSV
  1674. X#define logname getlogin
  1675. X#endif
  1676. X
  1677. X    char           *logname();
  1678. X
  1679. X    static char     shell[] = "SHELL=/bin/sh";
  1680. X    static char     home[150];
  1681. X    static char     logn[50];
  1682. X    char            cmd[512];
  1683. X    char            news[520];
  1684. X    char            tmp[512];
  1685. X    FILE           *newsf;
  1686. X    int             mask;
  1687. X    char            term;
  1688. X
  1689. X    strcpy(home, "HOME=");
  1690. X    strcpy(logn,"LOGNAME=");
  1691. X    strcat(home, ORGPATH);
  1692. X    strcat(home, "usenet/");
  1693. X    strcat(home, u_fname);
  1694. X    strcat(home, "/");
  1695. X    strcat(home, u_lname);
  1696. X    strcat(logn, logname());
  1697. X
  1698. X    sprintf(news, "%susenet/%s/%s/.newsrc", ORGPATH, u_fname, u_lname);
  1699. X    if (access(news, 00) == -1) {
  1700. X        mask = umask(0000);
  1701. X        portsout("creating necessary news files\n\r");
  1702. X        portsout("\n\r");
  1703. X        sprintf(tmp, "/bin/mkdir %susenet/%s", ORGPATH, u_fname);
  1704. X        system(tmp);
  1705. X        strcat(tmp, "/");
  1706. X        strcat(tmp, u_lname);
  1707. X        system(tmp);
  1708. X        if ((newsf = fopen(news, "w")) == NULL) {
  1709. X            portsout("open of .newsrc failed\n\r");
  1710. X            exit(-1);
  1711. X        }
  1712. X        fprintf(newsf, "");
  1713. X        fclose(newsf);
  1714. X        umask(mask);
  1715. X    }
  1716. Xmenu:
  1717. X    portsout("\n\rWhich type of terminal do you have:\n\r");
  1718. X    portsout("1) Ansi Standard Monitor\n\r");
  1719. X    portsout("2) ANSI.SYS for MS-DOS\n\r");
  1720. X    portsout("3) VT100\n\r");
  1721. X    portsout("4) Macintosh MacTerm in VT-100 mode\n\r");
  1722. X    portsout("5) VT52 Terminal\n\r");
  1723. X    portsout("6) Televideo 925\n\r");
  1724. X    portsout("7) Televideo 910\n\r");
  1725. X    portsout("8) Tandy DT-100\n\r");
  1726. X    portsout("9) Dumb  - Use this when nothing else works correctly.\n\r");
  1727. X    portsout("           Instead of the normal \"- MORE -\" inbetween pages\n\r");
  1728. X    portsout("           You will see nothing, BUT you will hear a beep.\n\r");
  1729. X    portsout("           This is the same thing. \"?\" is for help\n\r");
  1730. X    portsout("\n\rQ) Return to main menu\n\r");
  1731. X    portsout("===> ");
  1732. X    term = portin();
  1733. X    portsout("\n\r");
  1734. X    switch (term) {
  1735. X    case ('1'):
  1736. X        putenv("TERM=ansi");
  1737. X        break;
  1738. X    case ('2'):
  1739. X        putenv("TERM=dosansi");
  1740. X        break;
  1741. X    case ('3'):
  1742. X        putenv("TERM=vt100");
  1743. X        break;
  1744. X    case ('4'):
  1745. X        putenv("TERM=macterm");
  1746. X        break;
  1747. X    case ('5'):
  1748. X        putenv("TERM=vt52so");
  1749. X        break;
  1750. X    case ('6'):
  1751. X        putenv("TERM=tvi925co");
  1752. X        break;
  1753. X    case ('7'):
  1754. X        putenv("TERM=tvi910");
  1755. X        break;
  1756. X    case ('8'):
  1757. X        putenv("TERM=dt100");
  1758. X        break;
  1759. X    case ('9'):
  1760. X        putenv("TERM=dumb");
  1761. X        break;
  1762. X    case ('Q'):
  1763. X    case ('q'):
  1764. X        portsout("\n\r");
  1765. X        return (0);
  1766. X        break;
  1767. X    default:
  1768. X        portsout("\n\rYou have selected an unsupported type. Please try again\n\r");
  1769. X        goto menu;
  1770. X        break;
  1771. X    }
  1772. X
  1773. X    putenv(shell);
  1774. X    putenv(home);
  1775. X    putenv(logn);
  1776. Xchoose:
  1777. X    portsout("\n\rDo you wish to:\n\r");
  1778. X    portsout("1) Readnews\n\r");
  1779. X    portsout("2) Postnews\n\r");
  1780. X    portsout("\n\rQ) Return to main menu\n\r");
  1781. X    portsout("===>");
  1782. X    term = portin();
  1783. X    portsout("\n\r");
  1784. X    switch (term) {
  1785. X    case ('1'):
  1786. X        restoremodes();
  1787. X        portrst();
  1788. X        STDerr = freopen("/dev/tty", "w+", stderr);
  1789. X        sprintf(cmd, "%s -n all",READN);
  1790. X        system(cmd);
  1791. X        break;
  1792. X    case ('2'):
  1793. X        restoremodes();
  1794. X        portrst();
  1795. X        STDerr = freopen("/dev/tty", "w+", stderr);
  1796. X        sprintf(cmd, "%s",POSTN);
  1797. X        system(cmd);
  1798. X        break;
  1799. X    case ('Q'):
  1800. X    case ('q'):
  1801. X        portsout("\n\r");
  1802. X        strcpy(home, "HOME=");
  1803. X        strcpy(logn, "LOGNAME=");
  1804. X        cmd[0] = '\0';
  1805. X        news[0] = '\0';
  1806. X        tmp[0] = '\0';
  1807. X        return (0);
  1808. X        break;
  1809. X    default:
  1810. X        portsout("Please try again\n\r");
  1811. X        goto choose;
  1812. X        break;
  1813. X    }
  1814. X
  1815. X    strcpy(home, "HOME=");
  1816. X    strcpy(logn, "LOGNAME=");
  1817. X    cmd[0] = '\0';
  1818. X    news[0] = '\0';
  1819. X    tmp[0] = '\0';
  1820. X
  1821. X    strcpy(buf128, STDERR);
  1822. X    strcat(buf128, port_id);
  1823. X    STDerr = freopen(buf128, "w+", stderr);
  1824. X    portinit();
  1825. X    setmodes();
  1826. X    restoresig();
  1827. X
  1828. X}
  1829. Xrestoresig()
  1830. X{
  1831. X    signal(SIGALRM, timer);
  1832. X    signal(SIGHUP, hanged);
  1833. X    signal(SIGUSR1, mon_toggle);
  1834. X    signal(SIGUSR2, sys_toggle);
  1835. X    signal(SIGPIPE, chat);
  1836. X
  1837. X}
  1838. END_OF_FILE
  1839.   if test 43634 -ne `wc -c <'bbsc1.c.B'`; then
  1840.     echo shar: \"'bbsc1.c.B'\" unpacked with wrong size!
  1841.   elif test -f 'bbsc1.c.A'; then
  1842.     echo shar: Combining  \"'bbsc1.c'\" \(83594 characters\)
  1843.     cat 'bbsc1.c.A' 'bbsc1.c.B' > 'bbsc1.c'
  1844.     if test 83594 -ne `wc -c <'bbsc1.c'`; then
  1845.       echo shar: \"'bbsc1.c'\" combined with wrong size!
  1846.     else
  1847.       rm bbsc1.c.A bbsc1.c.B
  1848.     fi
  1849.   fi
  1850.   # end of 'bbsc1.c.B'
  1851. fi
  1852. if test ! -d 'chatbbs' ; then
  1853.     echo shar: Creating directory \"'chatbbs'\"
  1854.     mkdir 'chatbbs'
  1855. fi
  1856. if test -f 'files.bbs' -a "${1}" != "-c" ; then 
  1857.   echo shar: Will not clobber existing file \"'files.bbs'\"
  1858. else
  1859.   echo shar: Extracting \"'files.bbs'\" \(12527 characters\)
  1860.   sed "s/^X//" >'files.bbs' <<'END_OF_FILE'
  1861. X+   ######  ######   #####          #######   ###   #       #######  #####
  1862. X+   #     # #     # #     #         #          #    #       #       #     #
  1863. X+   #     # #     # #               #          #    #       #       #
  1864. X+   ######  ######   #####          #####      #    #       #####    #####
  1865. X+   #     # #     #       #         #          #    #       #             #
  1866. X+   #     # #     # #     #         #          #    #       #       #     #
  1867. X+   ######  ######   #####          #         ###   ####### #######  #####
  1868. X.
  1869. X+                   ***********************************
  1870. X+                   *                                 *
  1871. X+                   *     ~  R E M E M B E R  ~       *
  1872. X+                   *                                 *
  1873. X+                   *  File names are CASE sensitive  *
  1874. X+                   *                                 *
  1875. X+                   ***********************************
  1876. X.
  1877. X+                   ************************************
  1878. X+                   *       Available files for        *
  1879. X+                   *           DOWNLOADING            *
  1880. X+                   *  The size and date of the file   *
  1881. X+                   *    is determined at LIST time    *
  1882. X+                   ************************************
  1883. X.
  1884. X+          The following files are required to generate the BBS
  1885. X+        The software now supports multiple file and message areas
  1886. X+    Arc is required for the bbs and can be found in the unix directory
  1887. X.
  1888. X.
  1889. X+                *******************************************
  1890. X+                ********** Start of BBS Software **********
  1891. X+                ****** Last Update  --   Apr 10, 92 *******
  1892. X+                ************** Version 7.101 **************
  1893. X+                *******************************************
  1894. X+                *    Be sure that you have the .newsrc    *
  1895. X+                *    file in ORGPATH for USENET access    *
  1896. X+                *******************************************
  1897. X.
  1898. X.
  1899. X+ Starting with version 7.6.0, "if you can see it, you can do it!" Commands
  1900. X+ that are not allowed because of your privilege level will now not be made
  1901. X+ known through the menu.
  1902. X.
  1903. X+     Starting with Version 7.101, you can NOW run this code under SysV.4
  1904. X.
  1905. X+     Starting with version 7.200, you no longer need an erternal arc 
  1906. X+                             or unzip program.
  1907. X.
  1908. X+   Please note that ALL executables within this directory are for Xenix-386
  1909. X.
  1910. X+        For SCO Unix Sys5.3.2, Use Makefile.386 and NOT Makefile.SYSV
  1911. X.
  1912. X.
  1913. XALLbbs.tar.Z All the files in this directory
  1914. X. except the kermit files, rzsz318.tar.Z,
  1915. X. locking.h, and compress/zcat
  1916. X. ( external arc and unzip is
  1917. X. no longer needed )
  1918. X. for SCO/IBM Xenix SysV
  1919. X. Version 7.200 - Aug 15, 1992 )
  1920. X. For non-Xenix systems, you will need to
  1921. X. download the file, locking.h, which is
  1922. X. not included in this overall file.
  1923. X. *** Contains the NEW msg packing code. ***
  1924. X.
  1925. X.
  1926. XConfig.bbs My .config.bbs!
  1927. X. Please note that this file is NOT included
  1928. X. in the overall TAR file and is only here
  1929. X. as an example.
  1930. X. ( Version 7.89 )
  1931. X. Modified on 03/09/90
  1932. X.
  1933. XMAKEbbs Description on how to make the BBS
  1934. X. New version!
  1935. X.
  1936. XMAKEquestion Description on how to make your 
  1937. X. questionnaire. New 3/16/87
  1938. X.
  1939. XMAKEfeatures Description on how to make your
  1940. X. features.bbs file. New 3/22/87 (Ver 2.5)
  1941. X.
  1942. XMAKElistfile Description on how to make your
  1943. X. listfile.bbs file. New 4/27/87 (Ver 2.8)
  1944. X.
  1945. XMAKEmsg.bbs How to make your daily messages.
  1946. X. (optional feature --- 9/2/87 (Ver 4.10)
  1947. X.
  1948. XMAKEsig How to set up the NEW SIG option
  1949. X. Version 7.51
  1950. X.
  1951. XMAKE_areas.bbs Description on how to make areas.bbs
  1952. X.
  1953. XMAKE_files.bbs Description on how to make files.bbs
  1954. X. Modified on Apr 1, 1987 for new command
  1955. X.
  1956. XMAKE_msg.bbs Description on how to make msgareas.bbs
  1957. X.
  1958. XMakefile.386 Makefile for BBS
  1959. X. for Xenix 386 and SCO Unix
  1960. X.
  1961. XMakefile.SVR4B Makefile for SVR4 (Big Endian)
  1962. X.
  1963. XMakefile.SVR4L Makefile for SVR4 (Little Endian)
  1964. X.
  1965. XMakefile.SYSV Makefile for SYSV
  1966. X. For SCO Unix, use Makefile.386
  1967. X.
  1968. XMakefile.3B1 Makefile for the 3B1
  1969. X.
  1970. XSep02.msg Example of a daily message.
  1971. X. This message would/will be
  1972. X. displayed on September 2.
  1973. X. (Optional) New for Ver 4.10
  1974. X.
  1975. Xallign.tar.Z Utility to make USERS file
  1976. X. compatible with vi for editing
  1977. X. ( Xenix executable included )
  1978. X. ( 16 bit compression )
  1979. X. Modified on 7/22/87 for 4.00 format
  1980. X.
  1981. Xareas.bbs Example of the file area file
  1982. X.
  1983. X. ***********************************
  1984. Xbbsc1 Executable file for Xenix386
  1985. X. Version 7.200
  1986. X. ***********************************
  1987. X.
  1988. Xbbsc12.h.Z One of the files to make the BBS
  1989. X. Version 7.200
  1990. X.
  1991. Xbbsc1.c.Z One of the files to make the BBS
  1992. X. Version 7.200
  1993. X.
  1994. Xbbsc2.c.Z One of the files to make the BBS
  1995. X. Version 7.99
  1996. X.
  1997. Xbbscadds.c.Z One of the files to make the BBS
  1998. X. Version 7.88
  1999. X.
  2000. Xbbscarc.c.Z One of the files to make the BBS
  2001. X. Version 7.200 ( arc lister )
  2002. X.
  2003. Xbbscarea.c.Z One of the files to make the BBS
  2004. X. Version 7.90
  2005. X.
  2006. Xbbscbult.c.Z One of the files to make the BBS
  2007. X. Version 7.88
  2008. X.
  2009. Xbbscconf.c.Z One of the files to make the BBS
  2010. X. Version 7.101
  2011. X.
  2012. Xbbscdef.h.Z One of the files to make the BBS
  2013. X. Version 7.91
  2014. X.
  2015. Xbbscfile.c.Z One of the files to make the BBS
  2016. X. Version 7.92
  2017. X.
  2018. Xbbsclist.c.Z One of the files to make the BBS
  2019. X. Version 7.88
  2020. X.
  2021. Xbbscio.c.Z One of the files to make the BBS
  2022. X. Version 5.10
  2023. X. (Jan 11 - now is stdin buff)
  2024. X. (Feb 01 - SIGINT = control-k)
  2025. X.
  2026. Xbbsclock.c.Z One of the files to make the BBS
  2027. X. Version 7.101
  2028. X.
  2029. Xbbscmenu.c.Z One of the files to make the BBS
  2030. X. Version 7.95
  2031. X.
  2032. Xbbscmisc.c.Z One of the files to make the BBS
  2033. X. Version 7.91
  2034. X.
  2035. Xbbscmsga.c.Z One of the files to make the BBS
  2036. X. Version 7.88
  2037. X.
  2038. Xbbscport.c.Z One of the files to make the BBS
  2039. X. Version 7.45
  2040. X.
  2041. Xbbscqust.c.Z One of the files to make the BBS
  2042. X. Version 7.88
  2043. X.
  2044. Xbbscsigs.c.Z One of the files to make the BBS
  2045. X. Version 7.88
  2046. X.
  2047. Xbbscsumm.c.Z One of the files to make the BBS
  2048. X. New for version 5.20
  2049. X. (May 01 --- Modified for 6.00)
  2050. X.
  2051. Xbbscunzip.c.Z One of the files to make the BBS
  2052. X. New for version 7.200
  2053. X. ( zip file lister )
  2054. X.
  2055. Xbbsczip.c.Z One of the files to make the BBS
  2056. X. Version 7.99
  2057. X.
  2058. Xbulletin.bbs An example of the bulletin file for the BBS
  2059. X. New format as of version 2.4!
  2060. X.
  2061. Xchatbbs.tar.Z SYSOP'S chatting program for the BBS
  2062. X. NOW compatible with SysV.4
  2063. X.
  2064. Xchecksum Executable form of checksum.c
  2065. X.
  2066. Xchecksum.c Xmodem-Checksum file for the BBS
  2067. X. (Bug fixed on 10/7/86)
  2068. X. (Modified on 5/20/87)
  2069. X.
  2070. Xcrc Executable form of crc.c
  2071. X.
  2072. Xcrc.c Xmodem-CRC file for the BBS
  2073. X. (Bug fixed on 10/7/86)
  2074. X. (Modified on 5/20/87)
  2075. X.
  2076. Xdlmsg.bbs An example of the download message sent
  2077. X. to the user when he tries to download a file
  2078. X. ( This is optional  1/7/87 )
  2079. Xetc_profile An example of the modification to /etc/profile
  2080. Xextra_info Extra information on how the bbs operates
  2081. X.
  2082. Xfeatures.bbs My features.bbs file
  2083. X. New as of 3/22/87  Version 2.5
  2084. X.
  2085. Xfiles.bbs.ex An example of files.bbs for the BBS
  2086. X. You can download this file to get a listing
  2087. X. of all the files that are required to 
  2088. X. make the BBS.
  2089. X.
  2090. Xfilepriv.bbs An example of filepriv.bbs for the BBS
  2091. X.
  2092. Xhelp.bbs The help file for the main menu
  2093. X. Version 7.95
  2094. X.
  2095. Xhelpfile.bbs The help file for the file section
  2096. X. Modified for version 7.80
  2097. X.
  2098. Xhelpmsg.bbs The help file for the message section
  2099. X. Modified for version 7.41
  2100. X.
  2101. Xhelpsig.bbs The help file for the SIG section
  2102. X. Version 7.84
  2103. X.
  2104. Xhumor.bbs An example of a humor file for the BBS
  2105. X.
  2106. Xinval_port.bbs An example file of the restricted
  2107. X. sio line file. This file is optional
  2108. X. and if it is not there, all lines
  2109. X. are automatically available. With
  2110. X. this file, you can reserve certain
  2111. X. lines for NON-BBS use.
  2112. X.
  2113. Xkermit Compiled kermit for the BBS
  2114. X. Sliding Windows!
  2115. X.
  2116. Xkermit.doc.Z Kermit documentation
  2117. X.
  2118. Xkermit.sld.tar Source code for Sliding Windows Kermit.
  2119. X. ( internal files are compressed - 16 bit )
  2120. X. ( Modifications done by Ken Brown )
  2121. X. ( This is the version that is used by the bbs )
  2122. X.
  2123. Xlistfile.bbs My listfile.bbs - use as an example
  2124. X. New for version 2.8
  2125. X.
  2126. Xlistuser.tar.Z My listuser program that is called
  2127. X. by the A(dditional features) entry.
  2128. X. Note: This is NOT presently in the
  2129. X. overall tar file (ALLbbs.tar.Z).
  2130. X.
  2131. Xlocking.h An emulation of the Xenix function,
  2132. X. locking. This file is ONLY for non-Xenix
  2133. X. systems that wish to run this BBS. It
  2134. X. is NOT included in the overall compressed
  2135. X. tar file, ALLbbs.tar.Z.
  2136. X. For 3b1, 3b2, etc, place this file on
  2137. X. your system as /usr/include/sys/locking.h
  2138. X. The conversion is handled by this
  2139. X. include file; however, lock for read only
  2140. X. is not supported and will do a complete
  2141. X. lock on the file.
  2142. X. Documentation for this file is included
  2143. X. within the file as a long comment.
  2144. X.
  2145. Xmainpriv.bbs An example of mainpriv.bbs for the BBS
  2146. X. Version 2.2 - Next to last entry is for chatting
  2147. X. Version 2.3 - Last entry is for the questionnaire
  2148. X. Version 2.5 - "A" is for A(dditional features
  2149. X. Version 2.8 - "$" is for R(ead selected features)
  2150. X. Version 4.33  "O" is added for c(O)nference
  2151. X. Version 6.30 - "L" is added for L(ogged in)
  2152. X. Version 7.22 - "I" is added for USENET ACCESS)
  2153. X.
  2154. Xmsgareas.bbs An example of msgareas.bbs for the BBS
  2155. X.
  2156. Xmsgpack.tar.Z Message "packing" "C" code
  2157. X. Removes "deleted" messages from the msg base
  2158. X. Contains its own Makefile
  2159. X. The tar file is compressed 
  2160. X. ( Brand new version..... 5/7/89 )
  2161. X.
  2162. Xpurge_mvfil.sh TWO utility SHELL SCRIPTS by
  2163. X. Larry Dighera. One script allows you
  2164. X. to purge your user files. The other
  2165. X. allows you to move files from one
  2166. X. directory to another (upload/download
  2167. X. directories) along with their
  2168. X. entry in files.bbs.
  2169. X.
  2170. Xpurguser.tar.Z A "C" program to purge the users file
  2171. X. by Chuck Brandt.
  2172. X.
  2173. Xnewuser.bbs An example of a newusers file for the BBS
  2174. X.
  2175. Xquestion.bbs File which contains list of
  2176. X. questionnaires to be presented to
  2177. X. the user.
  2178. X. New format for version 7.00
  2179. X.
  2180. Xquestion.qst My questionnaire
  2181. X. Use as an example!
  2182. X.
  2183. Xrz Executable for receive zmodem
  2184. X. (Make links to rx and rb)
  2185. X. rx is not used by the bbs
  2186. X. rb is used for Batch-ymodem
  2187. X.
  2188. Xrzsz318.tar.Z Ymodem & Zmodem for the BBS
  2189. X. Xenix386 executables included
  2190. X. New version 12/91
  2191. X.
  2192. Xsealink.tar.Z SEAlink protocal for XBBS
  2193. X. New for Version 3.10 (7/13/87)
  2194. X. Modified on 3/4/89
  2195. X. ( Based on new SEA version 1.20 )
  2196. X.
  2197. Xsigs.bbs An example of the sigs.bbs file
  2198. X.
  2199. Xsigentry.bbs An example of a sigentry file
  2200. X.
  2201. Xsigwelcome.bbs An example of a sig welcome file
  2202. X.
  2203. Xsysop A sysops' utility shell script
  2204. X. Written by Larry Dighera for XBBS
  2205. X.
  2206. Xsystem.bbs An example of the exit message for the BBS
  2207. X.
  2208. Xsystoggle An example of a SHELL SCRIPT to toggle
  2209. X. the PRIVILEGES of the present user on the BBS
  2210. X. This will set his time to MAXIMUM and his
  2211. X. privilege to MAXIMUM. This is a toggle so that
  2212. X. when it is issued again, it will return the
  2213. X. old settings.
  2214. X. ( This capability was added on Oct 14 )
  2215. X. Modified on Feb 11 for multiuser operation
  2216. X. (usage: systoggle 1A
  2217. X. The 1A is the LAST 2 characters of the device
  2218. X. This is ONLY an example and may be different
  2219. X. on your system)
  2220. X.
  2221. Xsz Executable for send zmodem
  2222. X. (make links to sx and sb)
  2223. X. sx is not used by the bbs
  2224. X. sb is for ymodem-batch (send)
  2225. X.
  2226. Xtoggle An example of a SHELL SCRIPT to toggle 
  2227. X. the SYSOP's local monitoring of the BBS
  2228. X. ( This capability was added on Sept 29 )
  2229. X. Modified on Feb 11 for multiuser operation
  2230. X. (usage: toggle 1A
  2231. X. The 1A is the LAST 2 characters of the device
  2232. X. This is ONLY an example and may be different
  2233. X. on your system)
  2234. X.
  2235. Xtoday.tar.Z Required for the 'D' option in the main menu
  2236. X. The compressed tar file contains its own Makefile
  2237. X.
  2238. Xunixmsg.bbs An example of the message that is sent to
  2239. X. the BBS user when he opts to switch to Unix.
  2240. X. This feature was added on 11/19 along with
  2241. X. the removal of the internal message in the
  2242. X. "C" code. This way, you can pass on any
  2243. X. information that you desire.
  2244. X.
  2245. Xunzip20a.tar.Z Used to list the contents of .zip files
  2246. X. Xenix386 executable included
  2247. X.
  2248. Xwelcome.bbs An example of a welcome message for the BBS
  2249. X.
  2250. Xxbbsgen.tar.Z NEW for version 2.00!
  2251. X. This file generates the configuration file
  2252. X. for the BBS. Now it is no longer necessary
  2253. X. to recompile whenever this is a system
  2254. X. configuration change!
  2255. X. (Modified 9/02/87 for SHELL choice)
  2256. X. (modified 9/10/87 for ZCAT & for msg scan)
  2257. X. (modified 10/2/87 to initialize userpriv)
  2258. X. (modified 11/5/87 for msg section help)
  2259. X. (modified 12/2/87 for Zmodem)
  2260. X. (modified 09/26/88 for Z/Ymodem)
  2261. X. (modified 05/28/89 for .zip files)
  2262. X. (modified 03/09/90 for USENET files)
  2263. X. (modified 08/15/92 to bypass arc/unzip)
  2264. X.
  2265. Xymod Executable form of ymod.c
  2266. X.
  2267. Xymod.c Ymodem for the BBS
  2268. X. (Modified on 5/20/87)
  2269. X.
  2270. X. 
  2271. X. *****************************************
  2272. X. ********** End of BBS Software **********
  2273. X. *****************************************
  2274. X~
  2275. END_OF_FILE
  2276.   if test 12527 -ne `wc -c <'files.bbs'`; then
  2277.     echo shar: \"'files.bbs'\" unpacked with wrong size!
  2278.   fi
  2279.   # end of 'files.bbs'
  2280. fi
  2281. if test ! -d 'listuser' ; then
  2282.     echo shar: Creating directory \"'listuser'\"
  2283.     mkdir 'listuser'
  2284. fi
  2285. if test -f 'locking.h' -a "${1}" != "-c" ; then 
  2286.   echo shar: Will not clobber existing file \"'locking.h'\"
  2287. else
  2288.   echo shar: Extracting \"'locking.h'\" \(2296 characters\)
  2289.   sed "s/^X//" >'locking.h' <<'END_OF_FILE'
  2290. X/*
  2291. X
  2292. X####### #     # #       #     #         ####### ####### ######
  2293. X#     # ##    # #        #   #          #       #     # #     #
  2294. X#     # # #   # #         # #           #       #     # #     #
  2295. X#     # #  #  # #          #            #####   #     # ######
  2296. X#     # #   # # #          #            #       #     # #   #
  2297. X#     # #    ## #          #            #       #     # #    #
  2298. X####### #     # #######    #            #       ####### #     #
  2299. X
  2300. X#     # ####### #     #         #     #
  2301. X##    # #     # ##    #          #   #   ######  #    #     #    #    #
  2302. X# #   # #     # # #   #           # #    #       ##   #     #     #  #
  2303. X#  #  # #     # #  #  #  #####     #     #####   # #  #     #      ##
  2304. X#   # # #     # #   # #           # #    #       #  # #     #      ##
  2305. X#    ## #     # #    ##          #   #   #       #   ##     #     #  #
  2306. X#     # ####### #     #         #     #  ######  #    #     #    #    #
  2307. X
  2308. X
  2309. X          ####    #   #   ####    #####  ######  #    #   ####
  2310. X         #         # #   #          #    #       ##  ##  #
  2311. X          ####      #     ####      #    #####   # ## #   ####
  2312. X              #     #         #     #    #       #    #       #
  2313. X         #    #     #    #    #     #    #       #    #  #    #
  2314. X          ####      #     ####      #    ######  #    #   ####
  2315. X
  2316. X   This as an attempt to emulate the 'locking' subroutine for non-Xenix
  2317. X   systems. This has not been tested; however, it should work. One of
  2318. X   the main differences is that Xenix can lock a file for writing;
  2319. X   however, it can still be read ( LK_RLCK and LK_NBRLCK ). The only
  2320. X   likely difference would be delays during a message read while
  2321. X   another user is writing into the same message base.
  2322. X   
  2323. X   *************** ONLY FOR NON-XENIX SYSTEMS ********************
  2324. X   This file should be added to the /usr/include/sys directory as locking.h
  2325. X   *************** ONLY FOR NON-XENIX SYSTEMS ********************
  2326. X
  2327. X   Please report back to me how this emulation performs.
  2328. X   Sanford Zelkovitz XBBS 714-821-9671
  2329. X   ...........!ihnp4!hermix!ucla-an!alphacm!{root|sandy}
  2330. X   ...........!ucbvax!ucivax!mickey!alphacm!{root|sandy}
  2331. X*/
  2332. X#include "/usr/include/unistd.h"
  2333. X#define LK_UNLCK F_ULOCK
  2334. X#define LK_LOCK F_LOCK
  2335. X#define LK_NBLCK F_TLOCK
  2336. X#define LK_RLCK F_LOCK
  2337. X#define LK_NBRLCK F_TLOCK
  2338. X#define locking lockf
  2339. END_OF_FILE
  2340.   if test 2296 -ne `wc -c <'locking.h'`; then
  2341.     echo shar: \"'locking.h'\" unpacked with wrong size!
  2342.   fi
  2343.   # end of 'locking.h'
  2344. fi
  2345. if test ! -d 'msgpack' ; then
  2346.     echo shar: Creating directory \"'msgpack'\"
  2347.     mkdir 'msgpack'
  2348. fi
  2349. if test ! -d 'purguser' ; then
  2350.     echo shar: Creating directory \"'purguser'\"
  2351.     mkdir 'purguser'
  2352. fi
  2353. if test ! -d 'sealink' ; then
  2354.     echo shar: Creating directory \"'sealink'\"
  2355.     mkdir 'sealink'
  2356. fi
  2357. if test ! -d 'today' ; then
  2358.     echo shar: Creating directory \"'today'\"
  2359.     mkdir 'today'
  2360. fi
  2361. if test ! -d 'xbbsgen' ; then
  2362.     echo shar: Creating directory \"'xbbsgen'\"
  2363.     mkdir 'xbbsgen'
  2364. fi
  2365. echo shar: End of archive 1 \(of 11\).
  2366. cp /dev/null ark1isdone
  2367. MISSING=""
  2368. for I in 1 2 3 4 5 6 7 8 9 10 11 ; do
  2369.     if test ! -f ark${I}isdone ; then
  2370.     MISSING="${MISSING} ${I}"
  2371.     fi
  2372. done
  2373. if test "${MISSING}" = "" ; then
  2374.     echo You have unpacked all 11 archives.
  2375.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  2376. else
  2377.     echo You still must unpack the following archives:
  2378.     echo "        " ${MISSING}
  2379. fi
  2380. exit 0
  2381. exit 0 # Just in case...
  2382.