home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / sources / misc / 3907 next >
Encoding:
Text File  |  1992-09-08  |  63.1 KB  |  2,387 lines

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