home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / misc / volume36 / unpost / part07 < prev    next >
Encoding:
Text File  |  1993-04-18  |  41.7 KB  |  1,411 lines

  1. Newsgroups: comp.sources.misc,alt.binaries.pictures.utilities
  2. From: jstevens@teal.csn.org (John W.M. Stevens)
  3. Subject: v36i120:  unpost - Smart multi-part uudecoder v2.1.2, Part07/07
  4. Message-ID: <1993Apr19.052646.29581@sparky.imd.sterling.com>
  5. X-Md4-Signature: 1dff28035b9ed522c9945a870c36b285
  6. Date: Mon, 19 Apr 1993 05:26:46 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: jstevens@teal.csn.org (John W.M. Stevens)
  10. Posting-number: Volume 36, Issue 120
  11. Archive-name: unpost/part07
  12. Environment: UNIX, MS-DOS, OS/2, Windows, MacIntosh, Amiga, Vax/VMS
  13.  
  14. #! /bin/sh
  15. # This is a shell archive.  Remove anything before this line, then feed it
  16. # into a shell via "sh file" or similar.  To overwrite existing files,
  17. # type "sh file -c".
  18. # Contents:  cfg/email.cfg cfg/mufud.cfg config.h decode.h ident.c
  19. #   ident.h lex.h makefils/makefile.aix makefils/makefile.dos
  20. #   makefils/makefile.gcc makefils/makefile.hp makefils/makefile.os2
  21. #   modflnm.h parse.h read_me.doc regexp.h sets.c sets.h unpost.h
  22. #   utils.h utils/tokens uudec.h
  23. # Wrapped by kent@sparky on Sun Apr 18 23:10:31 1993
  24. PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin ; export PATH
  25. echo If this archive is complete, you will see the following message:
  26. echo '          "shar: End of archive 7 (of 7)."'
  27. if test -f 'cfg/email.cfg' -a "${1}" != "-c" ; then 
  28.   echo shar: Will not clobber existing file \"'cfg/email.cfg'\"
  29. else
  30.   echo shar: Extracting \"'cfg/email.cfg'\" \(3704 characters\)
  31.   sed "s/^X//" >'cfg/email.cfg' <<'END_OF_FILE'
  32. X#   This configuration file tells UNPOST how to handle email (and,
  33. X#   if I remember correctly, nn) segments.
  34. X
  35. Xsegment "^From "
  36. X{
  37. X    header
  38. X    {
  39. X        "^Subject:"
  40. X        {
  41. X            "^Subject:(.*)[[({]Part[_   ]*([0-9]+)[^0-9]+([0-9]+)[)\]}](.*)"
  42. X            {
  43. X                id 1
  44. X                segment number 2
  45. X                segments 3
  46. X                alternate id 4
  47. X                case ignore
  48. X            }
  49. X            "^Subject:(.*)Part[_    ]*[[({]([0-9]+)[^0-9]+([0-9]+)[)\]}](.*)"
  50. X            {
  51. X                id 1
  52. X                segment number 2
  53. X                segments 3
  54. X                alternate id 4
  55. X                case ignore
  56. X            }
  57. X            "^Subject:(.*)Part[_    ]+([0-9]+)[^0-9]+([0-9]+)(.*)"
  58. X            {
  59. X                id 1
  60. X                segment number 2
  61. X                segments 3
  62. X                alternate id 4
  63. X                case ignore
  64. X            }
  65. X            "^Subject:(.*)[([{]([0-9]+)[^0-9]+([0-9]+)[)\]}](.*)"
  66. X            {
  67. X                id 1
  68. X                segment number 2
  69. X                segments 3
  70. X                alternate id 4
  71. X                case ignore
  72. X            }
  73. X            "^Subject:(.*)([0-9]+)([/|]|[ \t]+of[ \t]+)([0-9]+)(.*)"
  74. X            {
  75. X                id 1
  76. X                segment number 2
  77. X                segments 4
  78. X                alternate id 5
  79. X                case ignore
  80. X            }
  81. X            "^Subject:(.*)"
  82. X            {
  83. X                id 1
  84. X                segment number 0
  85. X                segments 0
  86. X                alternate id 0
  87. X                case ignore
  88. X            }
  89. X        }
  90. X        "^X-File-Name:"
  91. X        {
  92. X            "^X-File-Name:[     ]+(.*)"
  93. X            {
  94. X                id 1
  95. X                segment number 0
  96. X                segments 0
  97. X                 alternate id 0
  98. X                case sensitive
  99. X            }
  100. X        }
  101. X        "^X-Part:"
  102. X        {
  103. X            "^X-Part:[  ]+([0-9]+)"
  104. X            {
  105. X                id 0
  106. X                segment number 1
  107. X                segments 0
  108. X                alternate id 0
  109. X                case sensitive
  110. X            }
  111. X        }
  112. X        "^X-Part-Total:"
  113. X        {
  114. X            "^X-Part-Total:[    ]+([0-9]+)"
  115. X            {
  116. X                id 0
  117. X                segment number 0
  118. X                segments 1
  119. X                alternate id 0
  120. X                case sensitive
  121. X            }
  122. X        }
  123. X        "^Uusplit-part:"
  124. X        {
  125. X            "^Uusplit-part:[    ]+([0-9]+)"
  126. X            {
  127. X                id 0
  128. X                segment number 1
  129. X                segments 0
  130. X                alternate id 0
  131. X                case sensitive
  132. X            }
  133. X        }
  134. X        "^Uusplit-parts:"
  135. X        {
  136. X            "^Uusplit-parts:[   ]+([0-9]+)"
  137. X            {
  138. X                id 0
  139. X                segment number 0
  140. X                segments 1
  141. X                alternate id 0
  142. X                case sensitive
  143. X            }
  144. X        }
  145. X    }
  146. X    body
  147. X    {
  148. X        "^section [0-9]+ of uuencode [0-9]+\.[0-9]+ of file "
  149. X        "[^     ]+    by R.E.M."
  150. X        {
  151. X            "^section ([0-9]+) of uuencode [0-9]+\.[0-9]+ of file "
  152. X            "([^    ]+)[    ]+by R.E.M."
  153. X            {
  154. X                id 2
  155. X                segment number 1
  156. X                segments 0
  157. X                alternate id 0
  158. X                case sensitive
  159. X            }
  160. X        }
  161. X        "^[^    ]+[     ]+section[  ]+[0-9]+/[0-9]+[    ]+UUXFER "
  162. X        "ver [^     ]+ by David M. Read"
  163. X         {
  164. X            "^([^ \t]+)[ \t]+section[ \t]+([0-9]+)/([0-9]+)[ \t]+UUXFER "
  165. X            "ver [^ \t]+ by David M. Read"
  166. X            {
  167. X                id 1
  168. X                segment number 2
  169. X                segments 3
  170. X                alternate id 0
  171. X                case sensitive
  172. X            }
  173. X        }
  174. X    }
  175. X}
  176. END_OF_FILE
  177.   if test 3704 -ne `wc -c <'cfg/email.cfg'`; then
  178.     echo shar: \"'cfg/email.cfg'\" unpacked with wrong size!
  179.   fi
  180.   # end of 'cfg/email.cfg'
  181. fi
  182. if test -f 'cfg/mufud.cfg' -a "${1}" != "-c" ; then 
  183.   echo shar: Will not clobber existing file \"'cfg/mufud.cfg'\"
  184. else
  185.   echo shar: Extracting \"'cfg/mufud.cfg'\" \(579 characters\)
  186.   sed "s/^X//" >'cfg/mufud.cfg' <<'END_OF_FILE'
  187. Xsegment "^Article[:]?"
  188. X{
  189. X    header
  190. X    {
  191. X        "^Subject:"
  192. X        {
  193. X            "^Subject:(.*)part[ ]+([0-9]+)[ ]*(of|/)[ ]*([0-9]+)(.*)"
  194. X            {
  195. X                id 1
  196. X                segment number 2
  197. X                segments 4
  198. X                alternate id 5
  199. X                case ignore
  200. X            }
  201. X            "^Subject:(.*)([0-9]+)[ ]*(of|/)[ ]*([0-9]+)(.*)"
  202. X            {
  203. X                id 1
  204. X                segment number 2
  205. X                segments 4
  206. X                alternate id 5
  207. X                case ignore
  208. X            }
  209. X        }
  210. X    }
  211. X    body
  212. X    {
  213. X    }
  214. X}
  215. END_OF_FILE
  216.   if test 579 -ne `wc -c <'cfg/mufud.cfg'`; then
  217.     echo shar: \"'cfg/mufud.cfg'\" unpacked with wrong size!
  218.   fi
  219.   # end of 'cfg/mufud.cfg'
  220. fi
  221. if test -f 'config.h' -a "${1}" != "-c" ; then 
  222.   echo shar: Will not clobber existing file \"'config.h'\"
  223. else
  224.   echo shar: Extracting \"'config.h'\" \(452 characters\)
  225.   sed "s/^X//" >'config.h' <<'END_OF_FILE'
  226. X/******************************************************************************
  227. X* Module    :   Configuration File Parser --- Parse the configuration file.
  228. X*
  229. X* Author    :   John W. M. Stevens
  230. X******************************************************************************/
  231. X
  232. X#if ! defined(CONFIG_FILE_PARSER)
  233. X#define CONFIG_FILE_PARSER
  234. X
  235. X#include    "parse.h"
  236. X
  237. X/*  External function prototypes.   */
  238. Xextern
  239. XSEGMENT *ReadConfig(char    *CfgFlNm);
  240. X
  241. X#endif
  242. END_OF_FILE
  243.   if test 452 -ne `wc -c <'config.h'`; then
  244.     echo shar: \"'config.h'\" unpacked with wrong size!
  245.   fi
  246.   # end of 'config.h'
  247. fi
  248. if test -f 'decode.h' -a "${1}" != "-c" ; then 
  249.   echo shar: Will not clobber existing file \"'decode.h'\"
  250. else
  251.   echo shar: Extracting \"'decode.h'\" \(686 characters\)
  252.   sed "s/^X//" >'decode.h' <<'END_OF_FILE'
  253. X/******************************************************************************
  254. X* Module    :   Decode segments.
  255. X*
  256. X* Author    :   John W. Stevens
  257. X******************************************************************************/
  258. X
  259. X#if ! defined(DECODE_HELPER_HEADER)
  260. X#define DECODE_HELPER_HEADER
  261. X
  262. X#include    "parse.h"
  263. X
  264. X/*  Function prototypes.    */
  265. Xextern
  266. Xint     DecSeg(FILE         *InFlPtr,
  267. X               FILE         *OutFlPtr,
  268. X               CHK_UU_ENC   *UULnType);
  269. Xextern
  270. Xint         DeCode(FILE     *InFlPtr,
  271. X                   FL_LIST  *FlDesc);
  272. Xextern
  273. Xvoid        DecTruncUULn(char   *Line,
  274. X                         int    *Len,
  275. X                         BYTE   *Bfr);
  276. X
  277. X#endif
  278. END_OF_FILE
  279.   if test 686 -ne `wc -c <'decode.h'`; then
  280.     echo shar: \"'decode.h'\" unpacked with wrong size!
  281.   fi
  282.   # end of 'decode.h'
  283. fi
  284. if test -f 'ident.c' -a "${1}" != "-c" ; then 
  285.   echo shar: Will not clobber existing file \"'ident.c'\"
  286. else
  287.   echo shar: Extracting \"'ident.c'\" \(2385 characters\)
  288.   sed "s/^X//" >'ident.c' <<'END_OF_FILE'
  289. X/******************************************************************************
  290. X* Module    :   Identify a binary file.
  291. X*
  292. X* Author    :   John Stevens
  293. X******************************************************************************/
  294. X
  295. X#include    "compiler.h"
  296. X
  297. X#include    "ident.h"
  298. X
  299. X/*  Define file type information for static storage.    */
  300. Xtypedef struct
  301. X{
  302. X    int             Offset;
  303. X    int             length;
  304. X    char            *string;
  305. X    char            ext[5];
  306. X    BIN_TYPES       FileType;
  307. X} FILE_TYPES;
  308. X
  309. Xstatic  FILE_TYPES  FileTypes[] =
  310. X{
  311. X    {   0,  6,  "GIF87a",   ".gif",     GIF87A          },
  312. X    {   0,  6,  "GIF89a",   ".gif",     GIF89A          },
  313. X    {   6,  4,  "JFIF",     ".jpg",     JFIF_JPEG       },
  314. X    {   0,  4,  "hsi1",     ".hsi",     HSI1_JPEG       },
  315. X    {   0,  0,  "",         "",         UNKNOWN_TYPE    }
  316. X};
  317. X
  318. X/*-----------------------------------------------------------------------------
  319. X| Routine   :   IdUUFile() --- Identify a uuencoded binary file from it's
  320. X|               first line.  Currently this only works for graphics that
  321. X|               I have access to.
  322. X|
  323. X| Inputs    :   Bfr - Buffer containing first line.
  324. X|               Len - Number of bytes in buffer.
  325. X|               Ext - Pointer to extension buffer.
  326. X|
  327. X| Returns   :   Returns the file type.
  328. X-----------------------------------------------------------------------------*/
  329. X
  330. XBIN_TYPES   IdUUFile(BYTE   *Bfr,
  331. X                     int    Len,
  332. X                     char   *Ext)
  333. X{
  334. X    register    int     i;
  335. X    register    int     j;
  336. X    auto        BYTE    *tp;
  337. X
  338. X    /*  Run file types, looking for all listed types.   */
  339. X    *Ext = '\0';
  340. X    for (i = 0; FileTypes[i].length; i++)
  341. X    {
  342. X        /*  Make sure that there are enough bytes in the buffer
  343. X        *   to identify this file.
  344. X        */
  345. X        if (FileTypes[i].length + (int) FileTypes[i].Offset > Len)
  346. X            continue;
  347. X
  348. X        /*  Compare the buffers.    */
  349. X        for (j = 0, tp = Bfr + FileTypes[i].Offset;
  350. X             j < FileTypes[i].length;
  351. X             j++)
  352. X            if (FileTypes[i].string[j] != (char) tp[j])
  353. X                break;
  354. X
  355. X        /*  Check for file type found.  */
  356. X        if (j == FileTypes[i].length)
  357. X        {
  358. X            strcpy(Ext, FileTypes[i].ext);
  359. X            return( FileTypes[i].FileType );
  360. X        }
  361. X    }
  362. X
  363. X    /*  Return type unknown.    */
  364. X    return( UNKNOWN_TYPE );
  365. X}
  366. END_OF_FILE
  367.   if test 2385 -ne `wc -c <'ident.c'`; then
  368.     echo shar: \"'ident.c'\" unpacked with wrong size!
  369.   fi
  370.   # end of 'ident.c'
  371. fi
  372. if test -f 'ident.h' -a "${1}" != "-c" ; then 
  373.   echo shar: Will not clobber existing file \"'ident.h'\"
  374. else
  375.   echo shar: Extracting \"'ident.h'\" \(560 characters\)
  376.   sed "s/^X//" >'ident.h' <<'END_OF_FILE'
  377. X/******************************************************************************
  378. X* Module    :   Identify a binary file.
  379. X*
  380. X* Author    :   John W. M. Stevens
  381. X******************************************************************************/
  382. X
  383. X#if ! defined(IDENT_HEADER_FILE)
  384. X
  385. X#include    "unpost.h"
  386. X
  387. X/*  Define binary file type enumerations.   */
  388. Xtypedef enum
  389. X{
  390. X    UNKNOWN_TYPE,
  391. X    GIF87A,
  392. X    GIF89A,
  393. X    JFIF_JPEG,
  394. X    HSI1_JPEG
  395. X} BIN_TYPES;
  396. X
  397. Xextern
  398. XBIN_TYPES   IdUUFile(BYTE   *Bfr,
  399. X                     int    Len,
  400. X                     char   *Ext);
  401. X
  402. X#endif
  403. END_OF_FILE
  404.   if test 560 -ne `wc -c <'ident.h'`; then
  405.     echo shar: \"'ident.h'\" unpacked with wrong size!
  406.   fi
  407.   # end of 'ident.h'
  408. fi
  409. if test -f 'lex.h' -a "${1}" != "-c" ; then 
  410.   echo shar: Will not clobber existing file \"'lex.h'\"
  411. else
  412.   echo shar: Extracting \"'lex.h'\" \(923 characters\)
  413.   sed "s/^X//" >'lex.h' <<'END_OF_FILE'
  414. X/******************************************************************************
  415. X* Module    :   Lexical Analyzer --- Extract tokens from the source file.
  416. X*
  417. X* Author    :   John W. M. Stevens
  418. X******************************************************************************/
  419. X
  420. X#if ! defined(LEXICAL_ANALYZER)
  421. X#define     LEXICAL_ANALYZER
  422. X
  423. Xtypedef enum    {
  424. X    T_NOT_FND,
  425. X    T_ALTERNATE,
  426. X    T_BODY,
  427. X    T_CASE,
  428. X    T_HEADER,
  429. X    T_ID,
  430. X    T_IGNORE,
  431. X    T_NUMBER,
  432. X    T_PART,
  433. X    T_SEGMENT,
  434. X    T_SEGMENTS,
  435. X    T_SENSITIVE,
  436. X    T_STRING,
  437. X    T_TOTAL,
  438. X    T_L_BRACE,
  439. X    T_R_BRACE,
  440. X    T_DBL_QUOTE,
  441. X    T_INT_NO
  442. X} TKNS;
  443. X
  444. X/*  Token structure for returning values.   */
  445. Xtypedef struct  {
  446. X    char        str[256];
  447. X    int         no;
  448. X} TOKEN;
  449. X
  450. X/*  Function prototypes.    */
  451. Xextern
  452. Xvoid    ParseErr(char   *ErrStr);
  453. Xextern
  454. Xvoid    OpenCfg(char    *FileNm);
  455. Xextern
  456. Xvoid    CloseCfg(void);
  457. Xextern
  458. Xint     Lex(TOKEN   *sym);
  459. X
  460. X#endif
  461. END_OF_FILE
  462.   if test 923 -ne `wc -c <'lex.h'`; then
  463.     echo shar: \"'lex.h'\" unpacked with wrong size!
  464.   fi
  465.   # end of 'lex.h'
  466. fi
  467. if test -f 'makefils/makefile.aix' -a "${1}" != "-c" ; then 
  468.   echo shar: Will not clobber existing file \"'makefils/makefile.aix'\"
  469. else
  470.   echo shar: Extracting \"'makefils/makefile.aix'\" \(1080 characters\)
  471.   sed "s/^X//" >'makefils/makefile.aix' <<'END_OF_FILE'
  472. X#******************************************************************************
  473. X# Module    :   Makefile for UnPost utility. (IBM AIX)
  474. X#
  475. X# Author    :   John W. M. Stevens
  476. X#******************************************************************************
  477. X
  478. XCC_FLAGS    =
  479. X
  480. X.c.o:
  481. X        c89 -c $(CC_FLAGS) $<
  482. X
  483. Xall: retest unpost
  484. X
  485. Xretest: recomp.o rematch.o retest.o sets.o utils.o
  486. X        c89 $(CC_FLAGS) -o retest retest.o recomp.o rematch.o sets.o utils.o
  487. X
  488. Xunpost: config.o   decode.o   ident.o    lex.o      list.o \
  489. X        modflnm.o  parse.o    recomp.o   rematch.o  segment.o \
  490. X        sets.o     unpost.o   utils.o    uudec.o
  491. X        c89 -o unpost config.o   decode.o   ident.o    lex.o      list.o \
  492. X        modflnm.o  parse.o    recomp.o   rematch.o  segment.o \
  493. X        sets.o     unpost.o   utils.o    uudec.o
  494. X
  495. Xconfig.o: config.c
  496. X
  497. Xdecode.o: decode.c
  498. X
  499. Xident.o: ident.c
  500. X
  501. Xlex.o: lex.c
  502. X
  503. Xlist.o: list.c
  504. X
  505. Xmodflnm.o: modflnm.c
  506. X
  507. Xparse.o: parse.c
  508. X
  509. Xrecomp.o: recomp.c
  510. X
  511. Xrematch.o: rematch.c
  512. X
  513. Xsegment.o: segment.c
  514. X
  515. Xsets.o: sets.c
  516. X
  517. Xunpost.o: unpost.c
  518. X
  519. Xutils.o: utils.c
  520. X
  521. Xuudec.o: uudec.c
  522. END_OF_FILE
  523.   if test 1080 -ne `wc -c <'makefils/makefile.aix'`; then
  524.     echo shar: \"'makefils/makefile.aix'\" unpacked with wrong size!
  525.   fi
  526.   # end of 'makefils/makefile.aix'
  527. fi
  528. if test -f 'makefils/makefile.dos' -a "${1}" != "-c" ; then 
  529.   echo shar: Will not clobber existing file \"'makefils/makefile.dos'\"
  530. else
  531.   echo shar: Extracting \"'makefils/makefile.dos'\" \(1337 characters\)
  532.   sed "s/^X//" >'makefils/makefile.dos' <<'END_OF_FILE'
  533. X#******************************************************************************
  534. X# Module    :   Makefile for UnPost utility. (MS-DOS, Borland C++ 3.0)
  535. X#
  536. X# Author    :   John W. M. Stevens
  537. X#******************************************************************************
  538. X
  539. XCC_FLAGS    =   -w -ml -DSYSTEM_MS_DOS -DBCC_COMPILER
  540. X
  541. X.c.obj:
  542. X        bcc -c $(CC_FLAGS) $<
  543. X
  544. Xall: retest.exe unpost.exe
  545. X
  546. Xretest.exe: recomp.obj rematch.obj retest.obj sets.obj utils.obj
  547. X        bcc $(CC_FLAGS) retest.obj recomp.obj rematch.obj sets.obj utils.obj
  548. X
  549. Xunpost.exe: config.obj   decode.obj   ident.obj    lex.obj      list.obj\
  550. X            modflnm.obj  parse.obj    recomp.obj   rematch.obj  segment.obj\
  551. X            sets.obj     unpost.obj   utils.obj    uudec.obj
  552. X        tlink @&&!
  553. X        /x c0l.obj +
  554. X        config.obj   decode.obj   ident.obj    lex.obj      list.obj +
  555. X        modflnm.obj  parse.obj    recomp.obj   rematch.obj  segment.obj +
  556. X        sets.obj     unpost.obj   utils.obj    uudec.obj
  557. X        $*
  558. X        $*
  559. X        mathl.lib cl.lib emu.lib
  560. X!
  561. X
  562. Xconfig.obj: config.c
  563. X
  564. Xdecode.obj: decode.c
  565. X
  566. Xident.obj: ident.c
  567. X
  568. Xlex.obj: lex.c
  569. X
  570. Xlist.obj: list.c
  571. X
  572. Xmodflnm.obj: modflnm.c
  573. X
  574. Xparse.obj: parse.c
  575. X
  576. Xrecomp.obj: recomp.c
  577. X
  578. Xrematch.obj: rematch.c
  579. X
  580. Xsegment.obj: segment.c
  581. X
  582. Xsets.obj: sets.c
  583. X
  584. Xunpost.obj: unpost.c
  585. X
  586. Xutils.obj: utils.c
  587. X
  588. Xuudec.obj: uudec.c
  589. END_OF_FILE
  590.   if test 1337 -ne `wc -c <'makefils/makefile.dos'`; then
  591.     echo shar: \"'makefils/makefile.dos'\" unpacked with wrong size!
  592.   fi
  593.   # end of 'makefils/makefile.dos'
  594. fi
  595. if test -f 'makefils/makefile.gcc' -a "${1}" != "-c" ; then 
  596.   echo shar: Will not clobber existing file \"'makefils/makefile.gcc'\"
  597. else
  598.   echo shar: Extracting \"'makefils/makefile.gcc'\" \(1108 characters\)
  599.   sed "s/^X//" >'makefils/makefile.gcc' <<'END_OF_FILE'
  600. X#******************************************************************************
  601. X# Module    :   Makefile for UnPost utility. (GCC on Sun 4)
  602. X#
  603. X# Author    :   John W. M. Stevens
  604. X#******************************************************************************
  605. X
  606. XCC_FLAGS    =   -ansi -DGCC_COMPILER
  607. X
  608. X.c.o:
  609. X        gcc -c $(CC_FLAGS) $<
  610. X
  611. Xall: retest unpost
  612. X
  613. Xretest: recomp.o rematch.o retest.o sets.o utils.o
  614. X        gcc $(CC_FLAGS) -o retest retest.o recomp.o rematch.o sets.o utils.o
  615. X
  616. Xunpost: config.o   decode.o   ident.o    lex.o      list.o \
  617. X        modflnm.o  parse.o    recomp.o   rematch.o  segment.o \
  618. X        sets.o     unpost.o   utils.o    uudec.o
  619. X        gcc -o unpost config.o   decode.o   ident.o    lex.o      list.o \
  620. X        modflnm.o  parse.o    recomp.o   rematch.o  segment.o \
  621. X        sets.o     unpost.o   utils.o    uudec.o
  622. X
  623. Xconfig.o: config.c
  624. X
  625. Xdecode.o: decode.c
  626. X
  627. Xident.o: ident.c
  628. X
  629. Xlex.o: lex.c
  630. X
  631. Xlist.o: list.c
  632. X
  633. Xmodflnm.o: modflnm.c
  634. X
  635. Xparse.o: parse.c
  636. X
  637. Xrecomp.o: recomp.c
  638. X
  639. Xrematch.o: rematch.c
  640. X
  641. Xsegment.o: segment.c
  642. X
  643. Xsets.o: sets.c
  644. X
  645. Xunpost.o: unpost.c
  646. X
  647. Xutils.o: utils.c
  648. X
  649. Xuudec.o: uudec.c
  650. END_OF_FILE
  651.   if test 1108 -ne `wc -c <'makefils/makefile.gcc'`; then
  652.     echo shar: \"'makefils/makefile.gcc'\" unpacked with wrong size!
  653.   fi
  654.   # end of 'makefils/makefile.gcc'
  655. fi
  656. if test -f 'makefils/makefile.hp' -a "${1}" != "-c" ; then 
  657.   echo shar: Will not clobber existing file \"'makefils/makefile.hp'\"
  658. else
  659.   echo shar: Extracting \"'makefils/makefile.hp'\" \(1089 characters\)
  660.   sed "s/^X//" >'makefils/makefile.hp' <<'END_OF_FILE'
  661. X#******************************************************************************
  662. X# Module    :   Makefile for UnPost utility. (HP Apollo 700)
  663. X#
  664. X# Author    :   John W. M. Stevens
  665. X#******************************************************************************
  666. X
  667. XCC_FLAGS    =   -Aa
  668. X
  669. X.c.o:
  670. X        cc -c $(CC_FLAGS) $<
  671. X
  672. Xall: retest unpost
  673. X
  674. Xretest: recomp.o rematch.o retest.o sets.o utils.o
  675. X        cc $(CC_FLAGS) -o retest retest.o recomp.o rematch.o sets.o utils.o
  676. X
  677. Xunpost: config.o   decode.o   ident.o    lex.o      list.o \
  678. X        modflnm.o  parse.o    recomp.o   rematch.o  segment.o \
  679. X        sets.o     unpost.o   utils.o    uudec.o
  680. X        cc -o unpost config.o   decode.o   ident.o    lex.o      list.o \
  681. X        modflnm.o  parse.o    recomp.o   rematch.o  segment.o \
  682. X        sets.o     unpost.o   utils.o    uudec.o
  683. X
  684. Xconfig.o: config.c
  685. X
  686. Xdecode.o: decode.c
  687. X
  688. Xident.o: ident.c
  689. X
  690. Xlex.o: lex.c
  691. X
  692. Xlist.o: list.c
  693. X
  694. Xmodflnm.o: modflnm.c
  695. X
  696. Xparse.o: parse.c
  697. X
  698. Xrecomp.o: recomp.c
  699. X
  700. Xrematch.o: rematch.c
  701. X
  702. Xsegment.o: segment.c
  703. X
  704. Xsets.o: sets.c
  705. X
  706. Xunpost.o: unpost.c
  707. X
  708. Xutils.o: utils.c
  709. X
  710. Xuudec.o: uudec.c
  711. END_OF_FILE
  712.   if test 1089 -ne `wc -c <'makefils/makefile.hp'`; then
  713.     echo shar: \"'makefils/makefile.hp'\" unpacked with wrong size!
  714.   fi
  715.   # end of 'makefils/makefile.hp'
  716. fi
  717. if test -f 'makefils/makefile.os2' -a "${1}" != "-c" ; then 
  718.   echo shar: Will not clobber existing file \"'makefils/makefile.os2'\"
  719. else
  720.   echo shar: Extracting \"'makefils/makefile.os2'\" \(1145 characters\)
  721.   sed "s/^X//" >'makefils/makefile.os2' <<'END_OF_FILE'
  722. X#******************************************************************************
  723. X# Module    :   Makefile for UnPost utility. (EMX-GCC)
  724. X#
  725. X# Author    :   John W. M. Stevens
  726. X#******************************************************************************
  727. X
  728. XCC_FLAGS    =   -ansi -DEMX_GCC_COMPILER -DSYSTEM_OS_2
  729. X
  730. X.c.o:
  731. X        gcc -c $(CC_FLAGS) $<
  732. X
  733. Xall: retest unpost
  734. X
  735. Xretest.exe: recomp.o rematch.o retest.o sets.o utils.o
  736. X        gcc $(CC_FLAGS) -o retest.exe retest.o recomp.o rematch.o\
  737. X        sets.o utils.o
  738. X
  739. Xunpost.exe: config.o   decode.o   ident.o    lex.o      list.o \
  740. X        modflnm.o  parse.o    recomp.o   rematch.o  segment.o \
  741. X        sets.o     unpost.o   utils.o    uudec.o
  742. X        gcc -o unpost.exe config.o   decode.o   ident.o    lex.o\
  743. X        list.o      modflnm.o  parse.o    recomp.o   rematch.o\
  744. X        segment.o   sets.o     unpost.o   utils.o    uudec.o
  745. X
  746. Xconfig.o: config.c
  747. X
  748. Xdecode.o: decode.c
  749. X
  750. Xident.o: ident.c
  751. X
  752. Xlex.o: lex.c
  753. X
  754. Xlist.o: list.c
  755. X
  756. Xmodflnm.o: modflnm.c
  757. X
  758. Xparse.o: parse.c
  759. X
  760. Xrecomp.o: recomp.c
  761. X
  762. Xrematch.o: rematch.c
  763. X
  764. Xsegment.o: segment.c
  765. X
  766. Xsets.o: sets.c
  767. X
  768. Xunpost.o: unpost.c
  769. X
  770. Xutils.o: utils.c
  771. X
  772. Xuudec.o: uudec.c
  773. END_OF_FILE
  774.   if test 1145 -ne `wc -c <'makefils/makefile.os2'`; then
  775.     echo shar: \"'makefils/makefile.os2'\" unpacked with wrong size!
  776.   fi
  777.   # end of 'makefils/makefile.os2'
  778. fi
  779. if test -f 'modflnm.h' -a "${1}" != "-c" ; then 
  780.   echo shar: Will not clobber existing file \"'modflnm.h'\"
  781. else
  782.   echo shar: Extracting \"'modflnm.h'\" \(887 characters\)
  783.   sed "s/^X//" >'modflnm.h' <<'END_OF_FILE'
  784. X/******************************************************************************
  785. X* Module    :   File name utilities.
  786. X*
  787. X* Author    :   John W. M. Stevens
  788. X******************************************************************************/
  789. X
  790. X#if ! defined(MOD_FL_NM_HEADER)
  791. X#define MOD_FL_NM_HEADER
  792. X
  793. X/*  Define maximum base and extension file name string lengths.
  794. X*   Currently, as MS-DOS is the most restrictive, names will tested
  795. X*   for fit into MS-DOS length restrictions.
  796. X*/
  797. X#define MAX_FILE            8
  798. X#define MAX_EXT             3
  799. X#define EXT_SEP_CHAR        '.'
  800. X
  801. X/*  Function prototypes.    */
  802. Xextern
  803. Xvoid    FlNmFilter(char     *FlName);
  804. X
  805. Xextern
  806. Xint     ModifyFlNm(char         *FlName,
  807. X                   char         *Ext,
  808. X                   char         *OutName);
  809. Xextern
  810. Xvoid    ModExten(char   *FlName,
  811. X                 char   *Exten,
  812. X                 char   *OutFlNm);
  813. X
  814. X#endif
  815. END_OF_FILE
  816.   if test 887 -ne `wc -c <'modflnm.h'`; then
  817.     echo shar: \"'modflnm.h'\" unpacked with wrong size!
  818.   fi
  819.   # end of 'modflnm.h'
  820. fi
  821. if test -f 'parse.h' -a "${1}" != "-c" ; then 
  822.   echo shar: Will not clobber existing file \"'parse.h'\"
  823. else
  824.   echo shar: Extracting \"'parse.h'\" \(3645 characters\)
  825.   sed "s/^X//" >'parse.h' <<'END_OF_FILE'
  826. X/******************************************************************************
  827. X* Module    :   Parser header file.
  828. X*
  829. X* Author    :   John W. M. Stevens
  830. X******************************************************************************/
  831. X
  832. X#if ! defined(PARSER_HEADER_FILE)
  833. X#define     PARSER_HEADER_FILE
  834. X
  835. X#include    "regexp.h"
  836. X#include    "uudec.h"
  837. X
  838. X#define PRS_NO_SEGMENT  -1L     /*  Found end of file before SEGMENT begin. */
  839. X#define PRS_NO_ID_STR   -2L     /*  Did not find an ID string.              */
  840. X#define PRS_NO_UU_LN    -3L     /*  Did not find a UU line in SEGMENT.      */
  841. X#define PRS_NO_BEGIN    -4L     /*  Did not find expected uuencode begin.   */
  842. X#define PRS_NO_SEG_NUM  -5L     /*  Did not find a SEGMENT number.          */
  843. X#define PRS_NO_NUM_SEGS -6L     /*  Did not find total number of SEGMENTs.  */
  844. X#define PRS_UNX_END_SEG -7L     /*  Found unexpected end of segment.        */
  845. X
  846. X/*  Part numbering parsing RE's.    */
  847. Xtypedef struct  {
  848. X    char            *ReExpStr;  /*  RE source string.                   */
  849. X    int             IDStr;      /*  Sub-Expr. number for ID string.     */
  850. X    int             SegNo;      /*  Sub-Expr. for segment number.       */
  851. X    int             NoSegs;     /*  Sub-Expr. for number of segments.   */
  852. X    int             AltIDStr;   /*  Sub-Expr. for alternate ID string.  */
  853. X    CASE_CMP        Case;       /*  Case sensitivity switch.            */
  854. X    REG_EXP_NODE    *ReExpr;    /*  Pointer to compiled RE.             */
  855. X} PART_RE;
  856. X
  857. X/*  Subject line structure. */
  858. Xtypedef struct  {
  859. X    char            *ReExprStr; /*  Pointer to RE source string.        */
  860. X    PART_RE         *IdParts;   /*  List of part number parsing RE's.   */
  861. X    REG_EXP_NODE    *ReExpr;    /*  Pointer to compiled RE.             */
  862. X} IDENT;
  863. X
  864. X/*  Segment RE structure.   */
  865. Xtypedef struct  {
  866. X    char            *ReExprStr; /*  Pointer to RE source string.        */
  867. X    IDENT           *Header;    /*  Header ID regular expressions.      */
  868. X    IDENT           *Body;      /*  Body ID regular expressions.        */
  869. X    REG_EXP_NODE    *ReExpr;    /*  Pointer to compiled RE.             */
  870. X} SEGMENT;
  871. X
  872. X/*  Define a structure to store the results of the first pass.  */
  873. Xtypedef struct  {
  874. X    long        SegOfs;
  875. X    long        UUOfs;
  876. X    int         Exists;
  877. X    int         SegNo;
  878. X    int         SegLstOrd;
  879. X} SEGS;
  880. X
  881. X/*  File list structure.    */
  882. Xtypedef struct  {
  883. X    char    *IDString;      /*  Pointer to SEGMENT ID string.           */
  884. X    char    *FlName;        /*  File name.                              */
  885. X    int     Success;        /*  Successful unpost flag.                 */
  886. X    int     NoSegs;         /*  Number of segments in binary.           */
  887. X    SEGS    *Segs;          /*  Pointer to list of segment desc.        */
  888. X} FL_LIST;
  889. X
  890. X/*  Segment information.    */
  891. Xtypedef struct  {
  892. X    int     NoSegs;
  893. X    int     SegNo;
  894. X    long    SegOfs;
  895. X    long    UUOfs;
  896. X    char    *IDString;
  897. X    char    *FlName;
  898. X} SEG_INFO;
  899. X
  900. X/*  Function prototypes.    */
  901. Xextern
  902. Xvoid    GetBinFlNm(FILE     *InFlPtr,
  903. X                   char     **RetStrs,
  904. X                   char     *FlName);
  905. Xextern
  906. Xint     MatchEnd(char   *Line);
  907. Xextern
  908. Xint     MatchBegin(char     *Line,
  909. X                   char     ***RetStrs);
  910. Xextern
  911. Xint     MatchSegment(char       *Line,
  912. X                     IDENT      **Hdr,
  913. X                     IDENT      **Body);
  914. Xextern
  915. Xlong    Parse(FILE      *InFlPtr,
  916. X              char      *SegLine,
  917. X              char      *IDLine,
  918. X              SEG_INFO  *SegInfo);
  919. Xextern
  920. Xvoid    SetSegBegin(char    *SegType);
  921. Xextern
  922. Xvoid    LoadCfg(char   *CfgFlNm);
  923. Xextern
  924. Xvoid    ParseInit(void);
  925. X
  926. X#endif
  927. END_OF_FILE
  928.   if test 3645 -ne `wc -c <'parse.h'`; then
  929.     echo shar: \"'parse.h'\" unpacked with wrong size!
  930.   fi
  931.   # end of 'parse.h'
  932. fi
  933. if test -f 'read_me.doc' -a "${1}" != "-c" ; then 
  934.   echo shar: Will not clobber existing file \"'read_me.doc'\"
  935. else
  936.   echo shar: Extracting \"'read_me.doc'\" \(3023 characters\)
  937.   sed "s/^X//" >'read_me.doc' <<'END_OF_FILE'
  938. XTo compile:
  939. X
  940. XAt this point, you have the archive unpacked, or you will never see this
  941. Xmessage.
  942. X
  943. XSo, since this message is in the unpost directory, all you have to do
  944. Xis make a copy of one of the makefiles in the makefils directory,
  945. Xrenaming it to makefile and moving it to this directory, and type make.
  946. X
  947. XBe aware that you may need to convert the source files (CR<->CR/LF) to
  948. Xmake them acceptable to your compiler.
  949. X
  950. XExample:
  951. X    cp makefils/makefile.dos makefile
  952. X    make
  953. X
  954. XThere are five makefiles:
  955. X
  956. Xmakefile.aix - Contains the makefile that someone ELSE told me worked
  957. X               on his RS6000 running AIX.
  958. X
  959. Xmakefile.dos - Contains the makefile that I used to compile UNPOST
  960. X               on an MS-DOS machine.  I used Borland's C++ compiler,
  961. X               version 3.1.
  962. X
  963. Xmakefile.hp  - This is a makefile that should compile UNPOST on
  964. X               the HP Apollo 700 machines, and maybe some of the
  965. X               other HP Apollo machines.
  966. X
  967. Xmakefile.gcc - Makefile for compiling UNPOST using the gcc (GNU C
  968. X               compiler) compiler. This has the correct switch settings
  969. X               for the gcc compiler that I used (Vers. 2.1).  This
  970. X               makefile was what I used to compile UNPOST on a Sun.
  971. X
  972. X               If your system has sys_errlist already defined,
  973. X               Add -DNO_SYS_ERR_LIST to the compiler flags in the
  974. X               makefile.
  975. X
  976. Xmakefile.os2 - Makefile for compiling UNPOST using the EMX/gcc (GNU C
  977. X               compiler) compiler on OS/2. This has the define for
  978. X               removing the sys_errlist declarations.
  979. X
  980. XBe aware that UNPOST requires an ANSI C compatible compiler, as it uses
  981. Xthe ANSI C function headers for full type checking and maximum portability.
  982. X(If it ain't ANSI C, it ain't portable in the long run).
  983. X
  984. XIf you have any problems, edit the compiler.h file and uncomment the
  985. Xvariable UNPOST_DEBUG.  Then run unpost on your input file, capture
  986. Xthe output sent to standard out and email it to me.  Save the input
  987. Xfile, as I will probably email back asking you to send me one or
  988. Xmore article headers out of it.
  989. X
  990. XIf you have compilation problems, send me as much information as
  991. Xpossible and I will do my best to help you.
  992. X
  993. XSimplest way to use UNPOST:
  994. X
  995. XCapture all articles in a file called source.uue (How is system and
  996. Xnews access method dependent, see unpost.doc for an rn example), then
  997. Xrun unpost by doing:
  998. X
  999. Xunpost -e errors -t text -i incomp source.uue
  1000. X
  1001. XThat's it.  All complete and correct binary postings that were in
  1002. Xfile source.uue will be in the directory that you ran the above
  1003. Xcommand in.  The file 'errors' will have a summary of warnings,
  1004. Xerrors, the binary postings, parts and byte offsets into the source
  1005. Xfile.  The 'text' file will contain text only articles, and the
  1006. X'incomp' file will contain any incomplete or incorrect postings.
  1007. X
  1008. XPlease read the unpost.doc and changes.doc files.  They are the result
  1009. Xof a lot of work on my part, and I will feel slighted if you don't at
  1010. Xleast take a few seconds to scan them. . . :-)
  1011. X
  1012. Xjstevens@csn.org
  1013. END_OF_FILE
  1014.   if test 3023 -ne `wc -c <'read_me.doc'`; then
  1015.     echo shar: \"'read_me.doc'\" unpacked with wrong size!
  1016.   fi
  1017.   # end of 'read_me.doc'
  1018. fi
  1019. if test -f 'regexp.h' -a "${1}" != "-c" ; then 
  1020.   echo shar: Will not clobber existing file \"'regexp.h'\"
  1021. else
  1022.   echo shar: Extracting \"'regexp.h'\" \(2634 characters\)
  1023.   sed "s/^X//" >'regexp.h' <<'END_OF_FILE'
  1024. X/******************************************************************************
  1025. X* Module    :   Regular Expression String Matching --- Defines, typedefs and
  1026. X*               function prototypes.
  1027. X*
  1028. X* Author    :   John Stevens
  1029. X******************************************************************************/
  1030. X
  1031. X#if ! defined(REGULAR_EXPRESSION_HEADER_FILE)
  1032. X#define     REGULAR_EXPRESSION_HEADER_FILE
  1033. X
  1034. X#include    "sets.h"
  1035. X
  1036. X/*  Define the maximum number of sub-expressions supported. */
  1037. X#define MAX_SUB_EXPRS   20
  1038. X
  1039. X/*  Flags for case sensitivity in string compares.  */
  1040. Xtypedef enum    {
  1041. X    CASE_SENSITIVE,
  1042. X    IGN_CASE
  1043. X} CASE_CMP;
  1044. X
  1045. X/*  Type of regular expression node in expression tree. */
  1046. Xtypedef enum    {
  1047. X    NODE_TYPE_NOT_SET,
  1048. X    OP_ENUM,                /*  Enumeration operator.       */
  1049. X    OP_OR,                  /*  Alternation operator.       */
  1050. X    OP_AND,                 /*  Catenation operator.        */
  1051. X    OP_L_PAREN,             /*  Parentheses.                */
  1052. X    OP_R_PAREN,             /*  Right parentheses.          */
  1053. X    END_OR,                 /*  End alternation.            */
  1054. X    END_ENUM,               /*  End enumeration.            */
  1055. X    DATA_LEFT_ANCHOR,       /*  Anchor left side.           */
  1056. X    DATA_RIGHT_ANCHOR,      /*  Anchor right side.          */
  1057. X    DATA_ANY,               /*  Any single character.       */
  1058. X    DATA_SPAN,              /*  Match any character.        */
  1059. X    DATA_STRING,            /*  String data node.           */
  1060. X    DATA_SET                /*  Set data node.              */
  1061. X} NODE_TYPE;
  1062. X
  1063. X/*  Type definition for regular expression node in expression tree. */
  1064. Xtypedef struct  reg_exp_st
  1065. X{
  1066. X    NODE_TYPE           NodeType;   /*  Node type, operator or data.    */
  1067. X    struct  reg_exp_st  *Left;      /*  Expression tree pointers.       */
  1068. X    struct  reg_exp_st  *Right;
  1069. X    unsigned int        MinSpan;    /*  Minimum span.                   */
  1070. X    unsigned int        MaxSpan;    /*  Maximum span.                   */
  1071. X    unsigned int        SubExprNo;  /*  Sub-expression number.          */
  1072. X    union
  1073. X    {
  1074. X        char        *MatchStr;      /*  String to match against.        */
  1075. X        SET_TYPE    *CSet;          /*  Character set to match against. */
  1076. X    } data;
  1077. X} REG_EXP_NODE;
  1078. X
  1079. X/*  Function prototypes.    */
  1080. Xextern  REG_EXP_NODE    *ReCompile(char *);
  1081. Xextern  int             ReMatch(char            *Str,
  1082. X                                CASE_CMP        Case,
  1083. X                                REG_EXP_NODE    *ReExpr,
  1084. X                                char            ***SubStrs);
  1085. Xextern  REG_EXP_NODE    *FreeReExpr(REG_EXP_NODE    *ReExpr);
  1086. X
  1087. X#endif
  1088. END_OF_FILE
  1089.   if test 2634 -ne `wc -c <'regexp.h'`; then
  1090.     echo shar: \"'regexp.h'\" unpacked with wrong size!
  1091.   fi
  1092.   # end of 'regexp.h'
  1093. fi
  1094. if test -f 'sets.c' -a "${1}" != "-c" ; then 
  1095.   echo shar: Will not clobber existing file \"'sets.c'\"
  1096. else
  1097.   echo shar: Extracting \"'sets.c'\" \(2941 characters\)
  1098.   sed "s/^X//" >'sets.c' <<'END_OF_FILE'
  1099. X/******************************************************************************
  1100. X* Module    :   Bit Mapped Set Functions.
  1101. X*
  1102. X* Author    :   John W. M. Stevens.
  1103. X******************************************************************************/
  1104. X
  1105. X#include    "sets.h"
  1106. X
  1107. X#define     NUL     '\0'
  1108. X#define     EOL     '\n'
  1109. X
  1110. X/*-----------------------------------------------------------------------------
  1111. X| Routine   :   InSet() --- Test to see if a character is a member of a set.
  1112. X|
  1113. X| Inputs    :   CSet    - Character set to test against.
  1114. X|               c       - Character to test.
  1115. X|
  1116. X| Returns   :   Zero for not in the set, non-zero for in set.
  1117. X-----------------------------------------------------------------------------*/
  1118. X
  1119. Xint InSet(SET   CSet,
  1120. X          char  c)
  1121. X{
  1122. X    return( (int) (CSet[c / INT_SIZE] & (1 << (c % INT_SIZE))) );
  1123. X}
  1124. X
  1125. X/*-----------------------------------------------------------------------------
  1126. X| Routine   :   CrtSet() --- Create a character set.
  1127. X|
  1128. X| Inputs    :   Str     - String containing set elements.
  1129. X| Outputs   :   CSet    - Initialized character set.
  1130. X-----------------------------------------------------------------------------*/
  1131. X
  1132. Xvoid    CrtSet(char **Str,
  1133. X               SET  CSet)
  1134. X{
  1135. X    register    int     i;
  1136. X    register    int     c;
  1137. X    auto        int     NegateFlag;
  1138. X    auto        char    LastCh;
  1139. X
  1140. X    /*  If the first character of the set is a '^', this is a negated
  1141. X    *   set.
  1142. X    */
  1143. X    if (**Str == '^')
  1144. X    {
  1145. X        NegateFlag = 1;
  1146. X        (*Str)++;
  1147. X    }
  1148. X    else
  1149. X        NegateFlag = 0;
  1150. X
  1151. X    /*  Clear the set first.    */
  1152. X    for (i = 0; i < SET_SIZE; i++)
  1153. X        CSet[i] = 0;
  1154. X
  1155. X    /*  Get characters of set.  */
  1156. X    for (LastCh = '\0'; **Str && **Str != ']'; (*Str)++)
  1157. X    {
  1158. X        /*  Check for escape character. */
  1159. X        if (**Str == '\\')
  1160. X            (*Str)++;
  1161. X        else if (**Str == '-')
  1162. X        {
  1163. X            /*  Check to make sure that this is a range separator
  1164. X            *   character.
  1165. X            */
  1166. X            if ( LastCh )
  1167. X            {
  1168. X                /*  Get termination character.  */
  1169. X                if ((*Str)[1] && (*Str)[1] != ']')
  1170. X                {
  1171. X                    /*  Skip escape character.  */
  1172. X                    if ((c = *++(*Str)) == '\\')
  1173. X                        c = *++(*Str);
  1174. X
  1175. X                    /*  Fill in range.  */
  1176. X                    for (i = LastCh + 1; i < c; i++)
  1177. X                        CSet[i / INT_SIZE] |= 1 << (i % INT_SIZE);
  1178. X                    LastCh = '\0';
  1179. X                }
  1180. X            }
  1181. X        }
  1182. X
  1183. X        /*  Add character to set.   */
  1184. X        CSet[**Str / INT_SIZE] |= 1 << (**Str % INT_SIZE);
  1185. X        LastCh = **Str;
  1186. X    }
  1187. X    if (**Str == ']')
  1188. X        (*Str)++;
  1189. X
  1190. X    /*  Negate set if necesary. */
  1191. X    if ( NegateFlag )
  1192. X    {
  1193. X        for (i = 0; i < SET_SIZE; i++)
  1194. X            CSet[i] = ~CSet[i];
  1195. X    }
  1196. X
  1197. X    /*  Do not EVER match a '\0' or '\n'.   */
  1198. X    CSet[0] &= ~1;
  1199. X    CSet[EOL / INT_SIZE] &= ~(1 << (EOL % INT_SIZE));
  1200. X}
  1201. END_OF_FILE
  1202.   if test 2941 -ne `wc -c <'sets.c'`; then
  1203.     echo shar: \"'sets.c'\" unpacked with wrong size!
  1204.   fi
  1205.   # end of 'sets.c'
  1206. fi
  1207. if test -f 'sets.h' -a "${1}" != "-c" ; then 
  1208.   echo shar: Will not clobber existing file \"'sets.h'\"
  1209. else
  1210.   echo shar: Extracting \"'sets.h'\" \(745 characters\)
  1211.   sed "s/^X//" >'sets.h' <<'END_OF_FILE'
  1212. X/******************************************************************************
  1213. X* Module    :   Bit Map Sets Header File
  1214. X*
  1215. X* Author    :   John Stevens
  1216. X******************************************************************************/
  1217. X
  1218. X#if ! defined(BIT_MAPPED_SETS_HEADER_FILE)
  1219. X#define     BIT_MAPPED_SETS_HEADER_FILE
  1220. X
  1221. X/*  Type defines and macro defines for character set utilities. */
  1222. X#if     ! defined(_OS2EMX_H)
  1223. Xtypedef unsigned    int     UINT;
  1224. X#endif
  1225. Xtypedef UINT                SET_TYPE;
  1226. X#define INT_SIZE            (sizeof( SET_TYPE ) * 8)
  1227. X#define SET_SIZE            (256 / INT_SIZE)
  1228. Xtypedef SET_TYPE            SET[SET_SIZE];
  1229. X
  1230. X/*  Function prototypes.    */
  1231. Xextern  int     InSet(SET, char);
  1232. Xextern  void    CrtSet(char **, SET);
  1233. X
  1234. X#endif
  1235. END_OF_FILE
  1236.   if test 745 -ne `wc -c <'sets.h'`; then
  1237.     echo shar: \"'sets.h'\" unpacked with wrong size!
  1238.   fi
  1239.   # end of 'sets.h'
  1240. fi
  1241. if test -f 'unpost.h' -a "${1}" != "-c" ; then 
  1242.   echo shar: Will not clobber existing file \"'unpost.h'\"
  1243. else
  1244.   echo shar: Extracting \"'unpost.h'\" \(764 characters\)
  1245.   sed "s/^X//" >'unpost.h' <<'END_OF_FILE'
  1246. X/******************************************************************************
  1247. X* Module    :   Unpost header file.
  1248. X*
  1249. X* Author    :   John W. M. Stevens
  1250. X******************************************************************************/
  1251. X
  1252. X#if ! defined(UNPOST_HEADER_FILE)
  1253. X#define     UNPOST_HEADER_FILE
  1254. X
  1255. X/*  Global constants.   */
  1256. X#define TRUE    1
  1257. X#define ERROR   1
  1258. X#define MATCH   1
  1259. X#define FALSE   0
  1260. X#define OK      0
  1261. X
  1262. X#define FL_NM_SZ    256
  1263. X#define BFR_SIZE    512
  1264. X
  1265. X#if     ! defined(_OS2EMX_H)
  1266. Xtypedef unsigned    char    BYTE;
  1267. X#endif
  1268. X
  1269. X/*  Function prototypes.    */
  1270. Xextern
  1271. Xint     ReadLine(FILE   *FlPtr,
  1272. X                 char   *InBfr,
  1273. X                 int    BfrMax);
  1274. Xextern
  1275. Xchar    *StrDup(char    *Str);
  1276. Xextern
  1277. Xint     FileExists(char     *FlName);
  1278. X
  1279. X#endif
  1280. END_OF_FILE
  1281.   if test 764 -ne `wc -c <'unpost.h'`; then
  1282.     echo shar: \"'unpost.h'\" unpacked with wrong size!
  1283.   fi
  1284.   # end of 'unpost.h'
  1285. fi
  1286. if test -f 'utils.h' -a "${1}" != "-c" ; then 
  1287.   echo shar: Will not clobber existing file \"'utils.h'\"
  1288. else
  1289.   echo shar: Extracting \"'utils.h'\" \(657 characters\)
  1290.   sed "s/^X//" >'utils.h' <<'END_OF_FILE'
  1291. X/******************************************************************************
  1292. X* Module    :   Utility Functions --- Function prototypes.
  1293. X*
  1294. X* Author    :   John W. M. Stevens
  1295. X******************************************************************************/
  1296. X
  1297. X#if ! defined(UTILITY_HEADER_FILE)
  1298. X#define     UTILITY_HEADER_FILE
  1299. X
  1300. X/*  Function prototypes.    */
  1301. Xextern
  1302. Xchar    *StrDup(char    *Str);
  1303. Xextern
  1304. Xint     FileExists(char     *FlName);
  1305. Xextern
  1306. Xvoid    MemCopy(void    *Dest,
  1307. X                void    *Source,
  1308. X                int     NoBytes);
  1309. Xextern
  1310. Xvoid    MemMove(void    *Dest,
  1311. X                void    *Source,
  1312. X                int     NoBytes);
  1313. X
  1314. X#endif
  1315. END_OF_FILE
  1316.   if test 657 -ne `wc -c <'utils.h'`; then
  1317.     echo shar: \"'utils.h'\" unpacked with wrong size!
  1318.   fi
  1319.   # end of 'utils.h'
  1320. fi
  1321. if test -f 'utils/tokens' -a "${1}" != "-c" ; then 
  1322.   echo shar: Will not clobber existing file \"'utils/tokens'\"
  1323. else
  1324.   echo shar: Extracting \"'utils/tokens'\" \(315 characters\)
  1325.   sed "s/^X//" >'utils/tokens' <<'END_OF_FILE'
  1326. Xalternate   T_ALTERNATE
  1327. Xbody        T_BODY
  1328. Xcase        T_CASE
  1329. Xheader      T_HEADER
  1330. Xid          T_ID
  1331. Xignore      T_IGNORE
  1332. Xnumber      T_NUMBER
  1333. Xpart        T_PART
  1334. Xsegment     T_SEGMENT
  1335. Xsegments    T_SEGMENTS
  1336. Xsensitive   T_SENSITIVE
  1337. Xstring      T_STRING
  1338. Xtotal       T_TOTAL
  1339. X{           T_L_BRACE
  1340. X}           T_R_BRACE
  1341. END_OF_FILE
  1342.   if test 315 -ne `wc -c <'utils/tokens'`; then
  1343.     echo shar: \"'utils/tokens'\" unpacked with wrong size!
  1344.   fi
  1345.   # end of 'utils/tokens'
  1346. fi
  1347. if test -f 'uudec.h' -a "${1}" != "-c" ; then 
  1348.   echo shar: Will not clobber existing file \"'uudec.h'\"
  1349. else
  1350.   echo shar: Extracting \"'uudec.h'\" \(879 characters\)
  1351.   sed "s/^X//" >'uudec.h' <<'END_OF_FILE'
  1352. X/******************************************************************************
  1353. X* Module    :   UU Decode header file.
  1354. X*
  1355. X* Author    :   John W. Stevens
  1356. X******************************************************************************/
  1357. X
  1358. X#if ! defined(UU_DECODE_HEADER)
  1359. X#define UU_DECODE_HEADER
  1360. X
  1361. X#include    "segment.h"
  1362. X
  1363. X/*  Return value for UU line checking.  */
  1364. Xtypedef enum    {
  1365. X    UU_TYPE_NOT_SET,
  1366. X    NOT_UU_LINE,
  1367. X    IS_UU_LINE,
  1368. X    UU_SPACE,
  1369. X    UU_BEGIN,
  1370. X    UU_END
  1371. X} CHK_UU_ENC;
  1372. X
  1373. X/*  Function prototypes.    */
  1374. Xextern
  1375. XCHK_UU_ENC  ChkUULine(char  *Line,
  1376. X                      char  ***RetStrs,
  1377. X                      int   *EncLen);
  1378. Xextern
  1379. XCHK_UU_ENC  DecUULine(char  *Line,
  1380. X                      int   *Len,
  1381. X                      BYTE  *Bfr);
  1382. Xextern
  1383. Xvoid        DecTruncUULn(char   *Line,
  1384. X                         int    *Len,
  1385. X                         BYTE   *Bfr);
  1386. X
  1387. X#endif
  1388. END_OF_FILE
  1389.   if test 879 -ne `wc -c <'uudec.h'`; then
  1390.     echo shar: \"'uudec.h'\" unpacked with wrong size!
  1391.   fi
  1392.   # end of 'uudec.h'
  1393. fi
  1394. echo shar: End of archive 7 \(of 7\).
  1395. cp /dev/null ark7isdone
  1396. MISSING=""
  1397. for I in 1 2 3 4 5 6 7 ; do
  1398.     if test ! -f ark${I}isdone ; then
  1399.     MISSING="${MISSING} ${I}"
  1400.     fi
  1401. done
  1402. if test "${MISSING}" = "" ; then
  1403.     echo You have unpacked all 7 archives.
  1404.     rm -f ark[1-9]isdone
  1405. else
  1406.     echo You still must unpack the following archives:
  1407.     echo "        " ${MISSING}
  1408. fi
  1409. exit 0
  1410. exit 0 # Just in case...
  1411.