home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume43 / c2man-2.0 / patch29 < prev    next >
Encoding:
Internet Message Format  |  1994-06-10  |  45.6 KB

  1. From: greyham@research.canon.oz.au (Graham Stoney)
  2. Newsgroups: comp.sources.misc
  3. Subject: v43i022:  c2man-2.0 - automatic C documentation generator, Patch29
  4. Date: 9 Jun 1994 11:50:04 -0500
  5. Organization: Canon Information Systems Research Australia
  6. Sender: kent@sparky.sterling.com
  7. Approved: kent@sparky.sterling.com
  8. Message-ID: <2t7h7s$38m@sparky.sterling.com>
  9. Summary: This is an official patch for c2man 2.0.  Please apply it.
  10. X-Md4-Signature: dcb23b4cd6e914c07ce6d15275dcb370
  11.  
  12. Submitted-by: greyham@research.canon.oz.au (Graham Stoney)
  13. Posting-number: Volume 43, Issue 22
  14. Archive-name: c2man-2.0/patch29
  15. Environment: UNIX, DOS, OS/2, lex, yacc
  16. Patch-To: c2man-2.0: Volume 42, Issue 55-63
  17.  
  18. System: c2man version 2.0
  19. Patch #: 29
  20. Priority: LOW
  21. Subject: patch #28, continued
  22. Date: Fri May 20 11:37:32 EST 1994
  23. From: Graham Stoney <greyham@research.canon.oz.au>
  24.  
  25. Description:
  26.     See patch #28.
  27.  
  28.  
  29. Fix:    From rn, say "| patch -p -N -d DIR", where DIR is your c2man source
  30.     directory.  Outside of rn, say "cd DIR; patch -p -N <thisarticle".
  31.     If you don't have the patch program, apply the following by hand,
  32.     or get patch (version 2.0, latest patchlevel).
  33.  
  34.     After patching:
  35.         *** DO NOTHING--INSTALL ALL PATCHES UP THROUGH #30 FIRST ***
  36.                 *** NOTE: YOU MUST RUN Configure AFTER APPLYING PATCH 30 ***
  37.  
  38.     If patch indicates that patchlevel is the wrong version, you may need
  39.     to apply one or more previous patches, or the patch may already
  40.     have been applied.  See the patchlevel.h file to find out what has or
  41.     has not been applied.  In any event, don't continue with the patch.
  42.  
  43.     If you are missing previous patches they can be obtained from me:
  44.  
  45.         Graham Stoney <greyham@research.canon.oz.au>
  46.  
  47.     If you send a mail message of the following form it will greatly speed
  48.     processing:
  49.  
  50.         Subject: Command
  51.         @SH mailpatch PATH c2man 2.0 LIST
  52.                ^ note the c
  53.  
  54.     where PATH is a return path FROM ME TO YOU either in Internet notation,
  55.     or in bang notation from some well-known host, and LIST is the number
  56.     of one or more patches you need, separated by spaces, commas, and/or
  57.     hyphens.  Saying 35- says everything from 35 to the end.
  58.  
  59.     To get some more detailed instructions, send me the following mail:
  60.  
  61.         Subject: Command
  62.         @SH mailhelp PATH
  63.  
  64.  
  65. Index: patchlevel.h
  66. Prereq: 28
  67. 2c2
  68. < #define PATCHLEVEL 28
  69. ---
  70. > #define PATCHLEVEL 29
  71.  
  72. Index: vms/config.h
  73. *** vms/config.h.old    1994/05/19 01:10:43
  74. --- vms/config.h    1994/05/19 01:10:45
  75. ***************
  76. *** 0 ****
  77. --- 1,331 ----
  78. + /*
  79. +  * This file was produced by running the config_h.SH script, which
  80. +  * gets its values from config.sh, which is generally produced by
  81. +  * running Configure.
  82. +  *
  83. +  * Feel free to modify any of this as the need arises.  Note, however,
  84. +  * that running config.h.SH again will wipe out any changes you've made.
  85. +  * For a more permanent change edit config.sh and rerun config.h.SH.
  86. +  *
  87. +  * $Id: config.h,v 2.0.1.1 1994/05/19 01:10:45 greyham Exp $
  88. +  */
  89. + /* Configuration time: Tue Apr 26 09:56:37 PDT 1994
  90. +  * Configured by: flower
  91. +  * Target system: sunos flower 4.1.3 3 sun4 
  92. +  */
  93. + #ifndef _config_h_
  94. + #define _config_h_
  95. + #ifdef VMS
  96. + /*
  97. +  * Access call.  Also maintained in unistd.h
  98. +  */
  99. + #define F_OK            0       /* does file exist */
  100. + #define X_OK            1       /* is it executable by caller */
  101. + #define W_OK            2       /* writable by caller */
  102. + #define R_OK            4       /* readable by caller */
  103. + /* VMS does not have unlink() */
  104. + #define unlink(s)    delete(s)
  105. + #endif
  106. + /* BSD:
  107. +  *    This symbol, if defined, indicates that the program is running under
  108. +  *    a BSD system.
  109. +  */
  110. + /*#define BSD        */
  111. + /* CPP_FILE_COM:
  112. +  *    This symbol contains the first part of the string which will invoke
  113. +  *    the C preprocessor a file and produce to standard output, preserving
  114. +  *    comments. Typical value of "cc -E -C" or "/lib/cpp -C".
  115. +  */
  116. + /* CPP_STDIN_FLAGS:
  117. +  *    This variable contains any flags necessary to get CPP_FILE_COM to
  118. +  *    read from the standard input.
  119. +  */
  120. + /* CPP_IGN_HDRS:
  121. +  *    This symbol is defined if CPP_FILE_COM ignores *.h files.
  122. +  */
  123. + /* CPP_CAN_STDIN:
  124. +  *    This symbol is defined if CPP_FILE_COM can read standard input
  125. +  *    directly.
  126. +  */
  127. + #define CPP_FILE_COM "cpp -\"C\""
  128. + #define CPP_STDIN_FLAGS "\"-\""
  129. + /*#define CPP_IGN_HDRS    */    /* does CPP ignore .h files? */
  130. + #define CPP_CAN_STDIN             /* can CPP read stdin directly? */
  131. + /* HAS_ACCESS:
  132. +  *    This manifest constant lets the C program know that the access()
  133. +  *    system call is available to check for accessibility using real UID/GID.
  134. +  *    (always present on UNIX.)
  135. +  */
  136. + #define HAS_ACCESS        /**/
  137. + /* HASCONST:
  138. +  *    This symbol, if defined, indicates that this C compiler knows about
  139. +  *    the const type. There is no need to actually test for that symbol
  140. +  *    within your programs. The mere use of the "const" keyword will
  141. +  *    trigger the necessary tests.
  142. +  */
  143. + #define HASCONST    /**/
  144. + #ifndef HASCONST
  145. + #define const
  146. + #endif
  147. + /* FLEXFILENAMES:
  148. +  *    This symbol, if defined, indicates that the system supports filenames
  149. +  *    longer than 14 characters.
  150. +  */
  151. + #define    FLEXFILENAMES        /**/
  152. + /* HAS_LINK:
  153. +  *    This symbol, if defined, indicates that the link routine is
  154. +  *    available to create hard links.
  155. +  */
  156. + /*#define HAS_LINK    */
  157. + /* HAS_OPEN3:
  158. +  *    This manifest constant lets the C program know that the three
  159. +  *    argument form of open(2) is available.
  160. +  */
  161. + #define HAS_OPEN3        /**/
  162. + /* HAS_STRCHR:
  163. +  *    This symbol is defined to indicate that the strchr()/strrchr()
  164. +  *    functions are available for string searching. If not, try the
  165. +  *    index()/rindex() pair.
  166. +  */
  167. + /* HAS_INDEX:
  168. +  *    This symbol is defined to indicate that the index()/rindex()
  169. +  *    functions are available for string searching.
  170. +  */
  171. + #define HAS_STRCHR    /**/
  172. + /*#define HAS_INDEX    /**/
  173. + /* HAS_STRFTIME:
  174. +  *    This symbol, if defined, indicates that the strftime routine is
  175. +  *    available to format locale-specific times.
  176. +  */
  177. + /*#define HAS_STRFTIME    */
  178. + /* HAS_STRSTR:
  179. +  *    This symbol, if defined, indicates that the strstr routine is
  180. +  *    available to find substrings.
  181. +  */
  182. + #define HAS_STRSTR    /**/
  183. + /* HAS_SYMLINK:
  184. +  *    This symbol, if defined, indicates that the symlink routine is available
  185. +  *    to create symbolic links.
  186. +  */
  187. + /*#define HAS_SYMLINK    */
  188. + /* Time_t:
  189. +  *    This symbol holds the type returned by time(). It can be long,
  190. +  *    or time_t on BSD sites (in which case <sys/types.h> should be
  191. +  *    included).
  192. +  */
  193. + #define Time_t long        /* Time type */
  194. + /* Signal_t:
  195. +  *    This symbol's value is either "void" or "int", corresponding to the
  196. +  *    appropriate return type of a signal handler.  Thus, you can declare
  197. +  *    a signal handler using "Signal_t (*handler)()", and define the
  198. +  *    handler using "Signal_t handler(sig)".
  199. +  */
  200. + #define Signal_t void    /* Signal handler's return type */
  201. + /* HASVOLATILE:
  202. +  *    This symbol, if defined, indicates that this C compiler knows about
  203. +  *    the volatile declaration.
  204. +  */
  205. + /*#define    HASVOLATILE    */
  206. + #ifndef HASVOLATILE
  207. + #define volatile
  208. + #endif
  209. + /* I_FCNTL:
  210. +  *    This manifest constant tells the C program to include <fcntl.h>.
  211. +  */
  212. + /*#define I_FCNTL    /**/
  213. + /* I_STDARG:
  214. +  *    This symbol, if defined, indicates that <stdarg.h> exists and should
  215. +  *    be included.
  216. +  */
  217. + #define I_STDARG        /**/
  218. + /* I_STDDEF:
  219. +  *    This symbol, if defined, indicates that <stddef.h> exists and should
  220. +  *    be included.
  221. +  */
  222. + #define I_STDDEF    /**/
  223. + /* I_STDLIB:
  224. +  *    This symbol, if defined, indicates that <stdlib.h> exists and should
  225. +  *    be included.
  226. +  */
  227. + #define I_STDLIB        /**/
  228. + /* I_STRING:
  229. +  *    This symbol, if defined, indicates to the C program that it should
  230. +  *    include <string.h> (USG systems) instead of <strings.h> (BSD systems).
  231. +  */
  232. + #define I_STRING        /**/
  233. + /* I_SYS_FILE:
  234. +  *    This symbol, if defined, indicates to the C program that it should
  235. +  *    include <sys/file.h> to get definition of R_OK and friends.
  236. +  */
  237. + #define I_SYS_FILE        /**/
  238. + /* I_SYS_TYPES:
  239. +  *    This symbol, if defined, indicates to the C program that it should
  240. +  *    include <sys/types.h>.
  241. +  */
  242. + /*#define    I_SYS_TYPES        */
  243. + /* I_TIME:
  244. +  *    This symbol, if defined, indicates to the C program that it should
  245. +  *    include <time.h>.
  246. +  */
  247. + /* I_SYS_TIME:
  248. +  *    This symbol, if defined, indicates to the C program that it should
  249. +  *    include <sys/time.h>.
  250. +  */
  251. + #define I_TIME        /**/
  252. + /*#define I_SYS_TIME        */
  253. + /* I_UNISTD:
  254. +  *    This symbol, if defined, indicates to the C program that it should
  255. +  *    include <unistd.h>.
  256. +  */
  257. + /*#define I_UNISTD        */
  258. + /* I_VARARGS:
  259. +  *    This symbol, if defined, indicates to the C program that it should
  260. +  *    include <varargs.h>.
  261. +  */
  262. + /*#define I_VARARGS        */
  263. + /* CAN_PROTOTYPE:
  264. +  *    If defined, this macro indicates that the C compiler can handle
  265. +  *    function prototypes.
  266. +  */
  267. + /* DOTS:
  268. +  *    This macro is used to specify the ... in function prototypes which
  269. +  *    have arbitrary additional arguments.
  270. +  */
  271. + /* NXT_ARG:
  272. +  *    This macro is used to separate arguments in the declared argument list.
  273. +  */
  274. + /* P_FUNC:
  275. +  *    This macro is used to declare "private" (static) functions.
  276. +  *    It takes three arguments: the function type and name, a parenthesized
  277. +  *    traditional (comma separated) argument list, and the declared argument
  278. +  *    list (in which arguments are separated with NXT_ARG, and additional
  279. +  *    arbitrary arguments are specified with DOTS).  For example:
  280. +  *
  281. +  *        P_FUNC(int foo, (bar, baz), int bar NXT_ARG char *baz[])
  282. +  */
  283. + /* P_FUNC_VOID:
  284. +  *    This macro is used to declare "private" (static) functions that have
  285. +  *    no arguments.  The macro takes one argument: the function type and name.
  286. +  *    For example:
  287. +  *
  288. +  *        P_FUNC_VOID(int subr)
  289. +  */
  290. + /* V_FUNC:
  291. +  *    This macro is used to declare "public" (non-static) functions.
  292. +  *    It takes three arguments: the function type and name, a parenthesized
  293. +  *    traditional (comma separated) argument list, and the declared argument
  294. +  *    list (in which arguments are separated with NXT_ARG, and additional
  295. +  *    arbitrary arguments are specified with DOTS).  For example:
  296. +  *
  297. +  *        V_FUNC(int main, (argc, argv), int argc NXT_ARG char *argv[])
  298. +  */
  299. + /* V_FUNC_VOID:
  300. +  *    This macro is used to declare "public" (non-static) functions that have
  301. +  *    no arguments.  The macro takes one argument: the function type and name.
  302. +  *    For example:
  303. +  *
  304. +  *        V_FUNC_VOID(int fork)
  305. +  */
  306. + /* _:
  307. +  *    This macro is used to declare function parameters for folks who want
  308. +  *    to make declarations with prototypes using a different style than
  309. +  *    the above macros.  Use double parentheses.  For example:
  310. +  *
  311. +  *        int main _((int argc, char *argv[]));
  312. +  */
  313. + #define    CAN_PROTOTYPE    /**/
  314. + #ifdef CAN_PROTOTYPE
  315. + #define    NXT_ARG ,
  316. + #define    DOTS , ...
  317. + #define    V_FUNC(name, arglist, args)name(args)
  318. + #define    P_FUNC(name, arglist, args)static name(args)
  319. + #define    V_FUNC_VOID(name)name(void)
  320. + #define    P_FUNC_VOID(name)static name(void)
  321. + #define    _(args) args
  322. + #else
  323. + #define    NXT_ARG ;
  324. + #define    DOTS
  325. + #define    V_FUNC(name, arglist, args)name arglist args;
  326. + #define    P_FUNC(name, arglist, args)static name arglist args;
  327. + #define    V_FUNC_VOID(name)name()
  328. + #define    P_FUNC_VOID(name)static name()
  329. + #define    _(args) ()
  330. + #endif
  331. + /* CAN_VAPROTO:
  332. +  *    This variable is defined on systems supporting prototype declaration
  333. +  *    of functions with a variable number of arguments.
  334. +  */
  335. + /* _V:
  336. +  *    This macro is used to declare function parameters in prototypes for
  337. +  *    functions with a variable number of parameters. Use double parentheses.
  338. +  *    For example:
  339. +  *
  340. +  *        int printf _V((char *fmt, ...));
  341. +  *
  342. +  *    Remember to use the plain simple _() macro when declaring a function
  343. +  *    with no variable number of arguments, since it might be possible to
  344. +  *    have a non-effect _V() macro and still get prototypes via _().
  345. +  */
  346. + #define CAN_VAPROTO    /**/
  347. + #ifdef CAN_VAPROTO
  348. + #define    _V(args) args
  349. + #else
  350. + #define    _V(args) ()
  351. + #endif
  352. + /* VOIDFLAGS:
  353. +  *    This symbol indicates how much support of the void type is given by this
  354. +  *    compiler.  What various bits mean:
  355. +  *
  356. +  *        1 = supports declaration of void
  357. +  *        2 = supports arrays of pointers to functions returning void
  358. +  *        4 = supports comparisons between pointers to void functions and
  359. +  *            addresses of void functions
  360. +  *        8 = suports declaration of generic void pointers
  361. +  *
  362. +  *    The package designer should define VOIDUSED to indicate the requirements
  363. +  *    of the package.  This can be done either by #defining VOIDUSED before
  364. +  *    including config.h, or by defining defvoidused in Myinit.U.  If the
  365. +  *    latter approach is taken, only those flags will be tested.  If the
  366. +  *    level of void support necessary is not present, defines void to int.
  367. +  */
  368. + #ifndef VOIDUSED
  369. + #define VOIDUSED 9
  370. + #endif
  371. + #define VOIDFLAGS 9
  372. + #if (VOIDFLAGS & VOIDUSED) != VOIDUSED
  373. + #define void int        /* is void to be avoided? */
  374. + #define M_VOID            /* Xenix strikes again */
  375. + #endif
  376. + #endif
  377.  
  378. Index: pc/Makefile.pc
  379. *** pc/Makefile.pc.old    1993/12/07 04:46:03
  380. --- pc/Makefile.pc    1994/05/16 01:59:43
  381. ***************
  382. *** 1,5 ****
  383. ! # NOTE: This file is generated automatically by processing the Makefile in the
  384. ! # main directory with a perl script.
  385.   # Makefile for c2man                                           23 Aug 1993
  386.   #
  387.   # - for GNU gcc (emx 0.8g kit) under OS/2 2.x or DOS (32-bit)
  388. --- 1,7 ----
  389. ! # NOTE: This file is generated automatically by the `updmake' perl script,
  390. ! # which processes the Makefile in the main directory and re-pastes this header
  391. ! # on the top.
  392. ! #
  393.   # Makefile for c2man                                           23 Aug 1993
  394.   #
  395.   # - for GNU gcc (emx 0.8g kit) under OS/2 2.x or DOS (32-bit)
  396. ***************
  397. *** 50,74 ****
  398.   # As Larry said, "Grrrr"
  399.   SHELL=/bin/sh
  400.   
  401.   OSOURCES =    config.h c2man.h semantic.h symbol.h strconcat.h \
  402.           strappend.h manpage.h enum.h output.h lex.l grammar.y
  403.   DCSOURCES =    c2man.c semantic.c string.c symbol.c strconcat.c \
  404. !         strappend.c manpage.c enum.c nroff.c texinfo.c
  405.   SOURCES =    $(OSOURCES) $(DCSOURCES)
  406.   CSOURCES =    $(DCSOURCES) y.tab.c
  407.   OBJECTS =    c2man$O semantic$O string$O symbol$O y.tab$O strconcat$O \
  408. !         strappend$O manpage$O enum$O nroff$O texinfo$O
  409.   GENERATED =    c2man example.inc ctype_ex.inc y.tab.c lex.yy.c y.output \
  410. !         fixexample.sed flatten.sed
  411.   
  412.   all: c2man.exe example.inc ctype_ex.inc flatten.sed
  413.   
  414.   install:
  415. !     cp c2man.exe $(bin)
  416.       $(SED) -f flatten.sed < c2man.1 > $(mansrc)/c2man.$(manext)
  417.       -mkdir $(privlib)
  418.       -mkdir $(privlib)/eg
  419. !     cp eg/*.[chly] $(privlib)/eg
  420.   
  421.   uninstall:
  422.       $(RM) -f $(bin)/c2man $(mansrc)/c2man.$(manext)
  423. --- 52,80 ----
  424.   # As Larry said, "Grrrr"
  425.   SHELL=/bin/sh
  426.   
  427. + # To change anything below here, you should really fix updmake to do it.
  428. + # DO NOT EDIT ANYTHING BELOW HERE, OR IT WILL BE LOST NEXT TIME updmake IS RUN.
  429.   OSOURCES =    config.h c2man.h semantic.h symbol.h strconcat.h \
  430.           strappend.h manpage.h enum.h output.h lex.l grammar.y
  431.   DCSOURCES =    c2man.c semantic.c string.c symbol.c strconcat.c \
  432. !         strappend.c manpage.c enum.c nroff.c texinfo.c latex.c
  433.   SOURCES =    $(OSOURCES) $(DCSOURCES)
  434.   CSOURCES =    $(DCSOURCES) y.tab.c
  435.   OBJECTS =    c2man$O semantic$O string$O symbol$O y.tab$O strconcat$O \
  436. !         strappend$O manpage$O enum$O nroff$O texinfo$O latex$O
  437.   GENERATED =    c2man example.inc ctype_ex.inc y.tab.c lex.yy.c y.output \
  438. !         fixexamp.sed flatten.sed
  439.   
  440.   all: c2man.exe example.inc ctype_ex.inc flatten.sed
  441.   
  442.   install:
  443. !     $(CP) c2man $(bin)
  444.       $(SED) -f flatten.sed < c2man.1 > $(mansrc)/c2man.$(manext)
  445.       -mkdir $(privlib)
  446.       -mkdir $(privlib)/eg
  447. !     $(CP) eg/*.[chly] $(privlib)/eg
  448.   
  449.   uninstall:
  450.       $(RM) -f $(bin)/c2man $(mansrc)/c2man.$(manext)
  451. ***************
  452. *** 84,90 ****
  453.       $(CC) $(CFLAGS) $(WARNFLAGS) -c $<
  454.   
  455.   y.tab.c: grammar.y
  456. !     @$(ECHO) Expect 48 shift/reduce conflicts.
  457.       $(YACC) grammar.y
  458.   
  459.   # don't compile y.tab.c with all warnings; yacc/bison are not up to it.
  460. --- 90,96 ----
  461.       $(CC) $(CFLAGS) $(WARNFLAGS) -c $<
  462.   
  463.   y.tab.c: grammar.y
  464. !     @$(ECHO) Expect 54 shift/reduce conflicts.
  465.       $(YACC) grammar.y
  466.   
  467.   # don't compile y.tab.c with all warnings; yacc/bison are not up to it.
  468. ***************
  469. *** 95,116 ****
  470.       $(LEX) -t -n lex.l > $@
  471.       cp $@ lex_yy.c
  472.   
  473. ! example.inc: c2man.exe example.h fixexample.sed
  474. !     ./c2man -o- example.h | $(SED) -f fixexample.sed >example.inc
  475.   
  476. ! ctype_ex.inc: c2man.exe ctype_ex.h fixexample.sed
  477. !     ./c2man -o- -g ctype_ex.h | $(SED) -f fixexample.sed >ctype_ex.inc
  478.   
  479. ! fixexample.sed: fixexample.in
  480. !     $(SED) -e '/^#/d' fixexample.in > fixexample.sed
  481.   
  482. ! flatten.sed: flatten_sed.SH
  483. !     sh flatten_sed.SH
  484.   
  485. ! Makefile: Makefile.SH
  486.       sh Makefile.SH
  487.   
  488. ! config.h: config_h.SH
  489.       sh config_h.SH
  490.   
  491.   TAGS: $(SOURCES)
  492. --- 101,122 ----
  493.       $(LEX) -t -n lex.l > $@
  494.       cp $@ lex_yy.c
  495.   
  496. ! example.inc: c2man.exe example.h fixexamp.sed
  497. !     ./c2man -o- example.h | $(SED) -f fixexamp.sed >example.inc
  498.   
  499. ! ctype_ex.inc: c2man.exe ctype_ex.h fixexamp.sed
  500. !     ./c2man -o- -g ctype_ex.h | $(SED) -f fixexamp.sed >ctype_ex.inc
  501.   
  502. ! fixexamp.sed: fixexamp.in
  503. !     $(SED) -e '/^#/d' fixexamp.in > fixexamp.sed
  504.   
  505. ! flatten.sed: flatten.SH config.sh
  506. !     sh flatten.SH
  507.   
  508. ! Makefile: Makefile.SH config.sh
  509.       sh Makefile.SH
  510.   
  511. ! config.h: config_h.SH config.sh
  512.       sh config_h.SH
  513.   
  514.   TAGS: $(SOURCES)
  515. ***************
  516. *** 151,157 ****
  517.   c2man$O: c2man.c c2man.h config.h confmagic.h enum.h manpage.h output.h\
  518.       patchlevel.h strappend.h strconcat.h symbol.h
  519.   
  520. ! semantic$O: c2man.h config.h confmagic.h enum.h manpage.h semantic.c\
  521.       semantic.h strconcat.h symbol.h
  522.   
  523.   string$O: c2man.h config.h confmagic.h string.c symbol.h
  524. --- 157,163 ----
  525.   c2man$O: c2man.c c2man.h config.h confmagic.h enum.h manpage.h output.h\
  526.       patchlevel.h strappend.h strconcat.h symbol.h
  527.   
  528. ! semantic$O: c2man.h config.h confmagic.h enum.h manpage.h output.h semantic.c\
  529.       semantic.h strconcat.h symbol.h
  530.   
  531.   string$O: c2man.h config.h confmagic.h string.c symbol.h
  532. ***************
  533. *** 163,172 ****
  534.   strappend$O: c2man.h config.h confmagic.h strappend.c strappend.h symbol.h
  535.   
  536.   manpage$O: c2man.h config.h confmagic.h manpage.c manpage.h output.h\
  537. !     semantic.h strconcat.h symbol.h
  538.   
  539.   enum$O: c2man.h config.h confmagic.h enum.c enum.h manpage.h strconcat.h\
  540.       symbol.h
  541.   
  542.   nroff$O: c2man.h config.h confmagic.h manpage.h nroff.c output.h symbol.h
  543.   
  544. --- 169,182 ----
  545.   strappend$O: c2man.h config.h confmagic.h strappend.c strappend.h symbol.h
  546.   
  547.   manpage$O: c2man.h config.h confmagic.h manpage.c manpage.h output.h\
  548. !     semantic.h strappend.h strconcat.h symbol.h
  549.   
  550.   enum$O: c2man.h config.h confmagic.h enum.c enum.h manpage.h strconcat.h\
  551.       symbol.h
  552.   
  553.   nroff$O: c2man.h config.h confmagic.h manpage.h nroff.c output.h symbol.h
  554. + texinfo$O: c2man.h config.h confmagic.h manpage.h output.h symbol.h texinfo.c
  555. + latex$O: c2man.h config.h confmagic.h latex.c manpage.h output.h symbol.h
  556.   
  557.  
  558. Index: libc/alloca.c
  559. *** libc/alloca.c.old    1994/05/19 01:06:38
  560. --- libc/alloca.c    1994/05/19 01:06:54
  561. ***************
  562. *** 0 ****
  563. --- 1,186 ----
  564. + /*
  565. +     alloca -- (mostly) portable public-domain implementation -- D A Gwyn
  566. +     This implementation of the PWB library alloca() function,
  567. +     which is used to allocate space off the run-time stack so
  568. +     that it is automatically reclaimed upon procedure exit, 
  569. +     was inspired by discussions with J. Q. Johnson of Cornell.
  570. +     It should work under any C implementation that uses an
  571. +     actual procedure stack (as opposed to a linked list of
  572. +     frames).  There are some preprocessor constants that can
  573. +     be defined when compiling for your specific system, for
  574. +     improved efficiency; however, the defaults should be okay.
  575. +     The general concept of this implementation is to keep
  576. +     track of all alloca()-allocated blocks, and reclaim any
  577. +     that are found to be deeper in the stack than the current
  578. +     invocation.  This heuristic does not reclaim storage as
  579. +     soon as it becomes invalid, but it will do so eventually.
  580. +     As a special case, alloca(0) reclaims storage without
  581. +     allocating any.  It is a good idea to use alloca(0) in
  582. +     your main control loop, etc. to force garbage collection.
  583. + */
  584. + #ifndef lint
  585. + static char    SCCSid[] = "@(#)alloca.c    1.1";    /* for the "what" utility */
  586. + #endif
  587. + #ifdef emacs
  588. + #include "config.h"
  589. + #ifdef static
  590. + /* actually, only want this if static is defined as ""
  591. +    -- this is for usg, in which emacs must undefine static
  592. +    in order to make unexec workable
  593. +    */
  594. + #ifndef STACK_DIRECTION
  595. + you
  596. + lose
  597. + -- must know STACK_DIRECTION at compile-time
  598. + #endif /* STACK_DIRECTION undefined */
  599. + #endif static
  600. + #endif emacs
  601. + #ifdef X3J11
  602. + typedef void    *pointer;        /* generic pointer type */
  603. + #else
  604. + typedef char    *pointer;        /* generic pointer type */
  605. + #endif
  606. + #define    NULL    0            /* null pointer constant */
  607. + extern void    free();
  608. + extern pointer    malloc();
  609. + /*
  610. +     Define STACK_DIRECTION if you know the direction of stack
  611. +     growth for your system; otherwise it will be automatically
  612. +     deduced at run-time.
  613. +     STACK_DIRECTION > 0 => grows toward higher addresses
  614. +     STACK_DIRECTION < 0 => grows toward lower addresses
  615. +     STACK_DIRECTION = 0 => direction of growth unknown
  616. + */
  617. + #ifndef STACK_DIRECTION
  618. + #define    STACK_DIRECTION    0        /* direction unknown */
  619. + #endif
  620. + #if STACK_DIRECTION != 0
  621. + #define    STACK_DIR    STACK_DIRECTION    /* known at compile-time */
  622. + #else    /* STACK_DIRECTION == 0; need run-time code */
  623. + static int    stack_dir;        /* 1 or -1 once known */
  624. + #define    STACK_DIR    stack_dir
  625. + static void
  626. + find_stack_direction (/* void */)
  627. + {
  628. +   static char    *addr = NULL;    /* address of first
  629. +                    `dummy', once known */
  630. +   auto char    dummy;        /* to get stack address */
  631. +   if (addr == NULL)
  632. +     {                /* initial entry */
  633. +       addr = &dummy;
  634. +       find_stack_direction ();    /* recurse once */
  635. +     }
  636. +   else                /* second entry */
  637. +     if (&dummy > addr)
  638. +       stack_dir = 1;        /* stack grew upward */
  639. +     else
  640. +       stack_dir = -1;        /* stack grew downward */
  641. + }
  642. + #endif    /* STACK_DIRECTION == 0 */
  643. + /*
  644. +     An "alloca header" is used to:
  645. +     (a) chain together all alloca()ed blocks;
  646. +     (b) keep track of stack depth.
  647. +     It is very important that sizeof(header) agree with malloc()
  648. +     alignment chunk size.  The following default should work okay.
  649. + */
  650. + #ifndef    ALIGN_SIZE
  651. + #define    ALIGN_SIZE    sizeof(double)
  652. + #endif
  653. + typedef union hdr
  654. + {
  655. +   char    align[ALIGN_SIZE];    /* to force sizeof(header) */
  656. +   struct
  657. +     {
  658. +       union hdr *next;        /* for chaining headers */
  659. +       char *deep;        /* for stack depth measure */
  660. +     } h;
  661. + } header;
  662. + /*
  663. +     alloca( size ) returns a pointer to at least `size' bytes of
  664. +     storage which will be automatically reclaimed upon exit from
  665. +     the procedure that called alloca().  Originally, this space
  666. +     was supposed to be taken from the current stack frame of the
  667. +     caller, but that method cannot be made to work for some
  668. +     implementations of C, for example under Gould's UTX/32.
  669. + */
  670. + static header *last_alloca_header = NULL; /* -> last alloca header */
  671. + pointer
  672. + alloca (size)            /* returns pointer to storage */
  673. +      unsigned    size;        /* # bytes to allocate */
  674. + {
  675. +   auto char    probe;        /* probes stack depth: */
  676. +   register char    *depth = &probe;
  677. + #if STACK_DIRECTION == 0
  678. +   if (STACK_DIR == 0)        /* unknown growth direction */
  679. +     find_stack_direction ();
  680. + #endif
  681. +                 /* Reclaim garbage, defined as all alloca()ed storage that
  682. +                    was allocated from deeper in the stack than currently. */
  683. +   {
  684. +     register header    *hp;    /* traverses linked list */
  685. +     for (hp = last_alloca_header; hp != NULL;)
  686. +       if (STACK_DIR > 0 && hp->h.deep > depth
  687. +       || STACK_DIR < 0 && hp->h.deep < depth)
  688. +     {
  689. +       register header    *np = hp->h.next;
  690. +       free ((pointer) hp);    /* collect garbage */
  691. +       hp = np;        /* -> next header */
  692. +     }
  693. +       else
  694. +     break;            /* rest are not deeper */
  695. +     last_alloca_header = hp;    /* -> last valid storage */
  696. +   }
  697. +   if (size == 0)
  698. +     return NULL;        /* no allocation required */
  699. +   /* Allocate combined header + user data storage. */
  700. +   {
  701. +     register pointer    new = malloc (sizeof (header) + size);
  702. +     /* address of header */
  703. +     ((header *)new)->h.next = last_alloca_header;
  704. +     ((header *)new)->h.deep = depth;
  705. +     last_alloca_header = (header *)new;
  706. +     /* User storage begins just after header. */
  707. +     return (pointer)((char *)new + sizeof(header));
  708. +   }
  709. + }
  710.  
  711. Index: texinfo.c
  712. Prereq: 2.0.1.6
  713. *** texinfo.c.old    1994/01/07 07:05:58
  714. --- texinfo.c    1994/05/12 02:25:10
  715. ***************
  716. *** 1,10 ****
  717. ! /* $Id: texinfo.c,v 2.0.1.6 1994/01/07 07:05:58 greyham Exp $
  718.    * functions for texinfo style output.
  719.    */
  720.   #include "c2man.h"
  721.   #include "manpage.h"
  722.   #include "output.h"
  723.   
  724.   void texinfo_char(c)
  725.   const int c;
  726.   {
  727. --- 1,31 ----
  728. ! /* $Id: texinfo.c,v 2.0.1.7 1994/05/12 02:25:10 greyham Exp $
  729.    * functions for texinfo style output.
  730.    */
  731.   #include "c2man.h"
  732.   #include "manpage.h"
  733.   #include "output.h"
  734.   
  735. + static char *heading_not_in_contents[] =
  736. +      {"@chapheading ", "@heading ", "@subheading ", "@subsubheading "};
  737. + static char *heading_in_contents[] =
  738. +      {"@chapter ", "@section ", "@subsection ", "@subsubsection "};
  739. + #define n_levels  (sizeof(heading_not_in_contents) / sizeof(char *))
  740. + #define level(n) ((n) >= n_levels ? n_levels - 1 : (n))
  741. + /* section level for man page entry */
  742. + static int top_level = 1;
  743. + /* always output node for manpage, even if embedded */
  744. + static int embed_node_info = 0;
  745. + /* use title as name of section, rather than "NAME" */
  746. + static int title_name = 0;
  747. + /* the section title, filled in by texinfo_header */
  748. + static const char *title = "INTERNAL ERROR, BOGUS TITLE DUDE!";
  749.   void texinfo_char(c)
  750.   const int c;
  751.   {
  752. ***************
  753. *** 38,60 ****
  754.   const char *name;
  755.   const char *section;
  756.   {
  757. !     put_string("\\input texinfo @c -*-texinfo-*-\n");
  758. !     output_warning();
  759. !     put_string("@c %**start of header\n");
  760. !     put_string("@setfilename ");
  761. !     texinfo_text(name);
  762. !     put_string(".info\n@settitle ");
  763. !     texinfo_text(name);
  764. !     putchar('\n');
  765. !     put_string("@c %**end of header\n");
  766.   
  767. !     put_string("@node Top, ");
  768. !     texinfo_text(name);
  769. !     put_string(", (dir), (dir)\n");
  770.   
  771. !     put_string("@node ");
  772. !     texinfo_text(name);
  773. !     put_string(", (dir), Top, (dir)\n");
  774.   }
  775.   
  776.   void texinfo_dash()    { put_string("---"); }
  777. --- 59,89 ----
  778.   const char *name;
  779.   const char *section;
  780.   {
  781. !     if (! make_embeddable)
  782. !     {
  783. !     put_string("\\input texinfo @c -*-texinfo-*-\n");
  784. !     output_warning();
  785. !     put_string("@c %**start of header\n");
  786. !     put_string("@setfilename ");
  787. !     texinfo_text(name);
  788. !     put_string(".info\n@settitle ");
  789. !     texinfo_text(name);
  790. !     putchar('\n');
  791. !     put_string("@c %**end of header\n");
  792.   
  793. !     put_string("@node Top, ");
  794. !     texinfo_text(name);
  795. !     put_string(", (dir), (dir)\n");
  796. !     }
  797.   
  798. !     if (! make_embeddable || embed_node_info)
  799. !     {
  800. !       put_string("@node ");
  801. !       texinfo_text(name);
  802. !       put_string(", (dir), Top, (dir)\n");
  803. !     }
  804. !     title = name;
  805.   }
  806.   
  807.   void texinfo_dash()    { put_string("---"); }
  808. ***************
  809. *** 62,68 ****
  810.   void texinfo_section(name)
  811.   const char *name;
  812.   {
  813. !     put_string("@unnumberedsec ");
  814.       texinfo_text(name);
  815.       putchar('\n');
  816.       put_string("@noindent\n");
  817. --- 91,106 ----
  818.   void texinfo_section(name)
  819.   const char *name;
  820.   {
  821. !     put_string(heading_not_in_contents[level(top_level)]);
  822. !     texinfo_text(name);
  823. !     putchar('\n');
  824. !     put_string("@noindent\n");
  825. ! }
  826. ! void texinfo_section_in_contents(name)
  827. ! const char *name;
  828. ! {
  829. !     put_string(heading_in_contents[level(top_level)]);
  830.       texinfo_text(name);
  831.       putchar('\n');
  832.       put_string("@noindent\n");
  833. ***************
  834. *** 71,77 ****
  835.   void texinfo_sub_section(name)
  836.   const char *name;
  837.   {
  838. !     put_string("@unnumberedsubsec ");
  839.       texinfo_text(name);
  840.       putchar('\n');
  841.       put_string("@noindent\n");
  842. --- 109,115 ----
  843.   void texinfo_sub_section(name)
  844.   const char *name;
  845.   {
  846. !     put_string(heading_not_in_contents[level(top_level+1)]);
  847.       texinfo_text(name);
  848.       putchar('\n');
  849.       put_string("@noindent\n");
  850. ***************
  851. *** 141,146 ****
  852. --- 179,240 ----
  853.   
  854.   void texinfo_file_end() { put_string("@bye\n"); }
  855.   
  856. + static first_name = 1;
  857. + void texinfo_name(name)
  858. + char *name;
  859. + {
  860. +     if (name)
  861. +     {
  862. +     if (!first_name || !title_name || strcmp(title,name))
  863. +        texinfo_text(name);
  864. +     first_name = 0;
  865. +     }
  866. +     else
  867. +     {
  868. +     first_name = 1;
  869. +     if (title_name)
  870. +         texinfo_section_in_contents(title);
  871. +     else
  872. +         texinfo_section("NAME");
  873. +     }
  874. + }
  875. + void texinfo_terse_sep()
  876. + {
  877. +     if (!title_name || group_together)
  878. +     {
  879. +     texinfo_char(' ');
  880. +     texinfo_dash();
  881. +     texinfo_char(' ');
  882. +     }
  883. + }
  884. + int texinfo_parse_option(option)
  885. + char *option;
  886. + {
  887. +     if        (option[0] == 't')
  888. +     title_name = 1;
  889. +     else if (option[0] == 'n')
  890. +     embed_node_info = 1;
  891. +     else if (option[0] == 's')
  892. +     {
  893. +     top_level = atoi(&option[1]);
  894. +     if (top_level < 0) return 1;
  895. +     }
  896. +     else return 1;
  897. +     return 0;
  898. + }
  899. + void texinfo_print_options()
  900. + {
  901. +     fputs("\ttexinfo options:\n", stderr);
  902. +     fputs("\tt\tuse manpage title as NAME title\n", stderr);
  903. +     fputs("\tn\toutput node info if embedded output\n", stderr);
  904. +     fputs("\ts<n>\tset top heading level to <n>\n", stderr);
  905. + }
  906.   
  907.   struct Output texinfo_output =
  908.   {
  909. ***************
  910. *** 171,175 ****
  911.       texinfo_include,
  912.       texinfo_file_end,
  913.       texinfo_text,
  914. !     texinfo_char
  915.   };
  916. --- 265,273 ----
  917.       texinfo_include,
  918.       texinfo_file_end,
  919.       texinfo_text,
  920. !     texinfo_char,
  921. !     texinfo_parse_option,
  922. !     texinfo_print_options,
  923. !     texinfo_name,
  924. !     texinfo_terse_sep
  925.   };
  926.  
  927. Index: vms/popen.c
  928. *** vms/popen.c.old    1994/05/19 01:11:19
  929. --- vms/popen.c    1994/05/19 01:11:22
  930. ***************
  931. *** 0 ****
  932. --- 1,188 ----
  933. + /* Implement unix popen and pclose in vms by using mailboxes
  934. +    and lib$spawn.
  935. +    17-APR-91 -GJC@MITECH.COM version 1.0
  936. + */
  937. + #include <stdio.h>
  938. + #include <descrip.h>
  939. + #include <ssdef.h>
  940. + #include <string.h>
  941. + FILE *popen();
  942. + int pclose();
  943. + globalvalue CLI$M_NOWAIT;
  944. + void p_describe(); /* a non-unix function */
  945. + static struct dsc$descriptor *set_dsc_cst();
  946. + static int create_mbx();
  947. + #define mailbox_size (512)
  948. + #define mailbox_byte_quota (3*mailbox_size)
  949. + #define mailbox_protection_mask (0x0000F000)
  950. + struct popen_cell
  951. + {FILE *fp;
  952. +  char *mbx_name;
  953. +  short mbx_chan;
  954. +  long pid;
  955. +  long completed;
  956. +  long comp_status;
  957. +  struct popen_cell *next;
  958. +  struct popen_cell *prev;};
  959. + static struct popen_cell *popen_list = NULL;
  960. + static struct popen_cell *find_popen_cell(fp)
  961. +      FILE *fp;
  962. + {struct popen_cell *l;
  963. +  for(l=popen_list;l != NULL; l = l->next)
  964. +    if (l->fp == fp) return(l);
  965. +  return(NULL);}
  966. + void p_describe(fp)
  967. +      FILE *fp;
  968. + {struct popen_cell *cell;
  969. +  if (!(cell = find_popen_cell(fp)))
  970. +    {printf("File pointer is not from popen, or it has been closed\n");
  971. +     return;}
  972. +  printf("FILE *fp                = %08X\n",cell->fp);
  973. +  printf("char *mbx_name          = %s\n",cell->mbx_name);
  974. +  printf("short mbx_chan          = %d\n",cell->mbx_chan);
  975. +  printf("long pid                = %08X\n",cell->pid);
  976. +  printf("long completed          = %d\n",cell->completed);
  977. +  printf("long comp_status        = %d\n",cell->comp_status);
  978. +  printf("struct popen_cell *next = %08X\n",cell->next);
  979. +  printf("struct popen_cell *prev = %08X\n",cell->prev);}
  980. + static void proc_exit_ast(cell)
  981. +      struct popen_cell *cell;
  982. + {cell->completed = 1;}
  983. + static void pclose_cleanup(cell)
  984. +      struct popen_cell *cell;
  985. + {sys$dassgn(cell->mbx_chan);
  986. +  free(cell->mbx_name);
  987. +  if (!cell->completed)
  988. +    sys$delprc(&cell->pid,0);
  989. +  memset(cell,0,sizeof(struct popen_cell));
  990. +  free(cell);}
  991. + static void pclose_delq(cell)
  992. +      struct popen_cell *cell;
  993. + {if (cell->prev)
  994. +    {cell->prev->next = cell->next;
  995. +     if (cell->next)
  996. +       cell->next->prev = cell->prev;}
  997. +  else
  998. +    {popen_list = cell->next;
  999. +     if (cell->next)
  1000. +       cell->next->prev = NULL;}}
  1001. + static void popen_push(cell)
  1002. +      struct popen_cell *cell;
  1003. + {if (popen_list)
  1004. +    popen_list->prev = cell;
  1005. +  cell->prev = NULL;
  1006. +  cell->next = popen_list;
  1007. +  popen_list = cell;}
  1008. + int pclose(fp)
  1009. +      FILE *fp;
  1010. + {int i;
  1011. +  struct popen_cell *cell;
  1012. +  i = fclose(fp);
  1013. +  if (cell = find_popen_cell(fp))
  1014. +    {pclose_delq(cell);
  1015. +     pclose_cleanup(cell);}
  1016. +  return(i);}
  1017. + FILE *popen(command,mode)
  1018. +      char *command,*mode;
  1019. + {char *temp;
  1020. +  struct popen_cell *cell;
  1021. +  int readp,n,mask,ret;
  1022. +  char *name,*prompt,*in,*out;
  1023. +  struct dsc$descriptor comm_d,in_d,out_d,name_d,prompt_d;
  1024. +  
  1025. +  if (strcmp(mode,"r") == 0)
  1026. +    readp = 1;
  1027. +  else if (strcmp(mode,"w") == 0)
  1028. +    readp = 0;
  1029. +  else
  1030. +    return(NULL);
  1031. +  temp = mktemp("POPEN_MB_XXXXXXXXXX");
  1032. +  n = strlen(temp);
  1033. +   cell =  (struct popen_cell *) malloc(sizeof(struct popen_cell));
  1034. +  cell->mbx_name = (char *) malloc(n+1);
  1035. +  strcpy(cell->mbx_name,temp);
  1036. +  if ((cell->mbx_chan = create_mbx(cell->mbx_name)) < 0)
  1037. +    {cell->completed = 1;
  1038. +     pclose_cleanup(cell);
  1039. +     return(NULL);}
  1040. +  if (readp)
  1041. +    {in = "NL:";
  1042. +     out = cell->mbx_name;}
  1043. +  else
  1044. +    {in = cell->mbx_name;
  1045. +     out = "NL:";}
  1046. +  name = 0;
  1047. +  prompt = 0;
  1048. +  mask = CLI$M_NOWAIT;
  1049. +  cell->completed = 0;
  1050. +  ret = lib$spawn((command) ? set_dsc_cst(&comm_d,command) : 0,
  1051. +                  (in) ? set_dsc_cst(&in_d,in) : 0,
  1052. +                  (out) ? set_dsc_cst(&out_d,out) : 0,
  1053. +                  &mask,
  1054. +                  (name)  ? set_dsc_cst(&name_d,name) : 0,
  1055. +                  &cell->pid,
  1056. +                  &cell->comp_status,
  1057. +                  0, /* event flag */
  1058. +          proc_exit_ast,
  1059. +          cell,
  1060. +                  (prompt) ? set_dsc_cst(&prompt_d,prompt) : 0,
  1061. +                  0 /* cli */
  1062. +                  );
  1063. +  
  1064. +  if (ret != SS$_NORMAL)
  1065. +    {cell->completed = 1;
  1066. +     pclose_cleanup(cell);
  1067. +     return(NULL);}
  1068. +  if (!(cell->fp = fopen(cell->mbx_name,mode)))
  1069. +    {pclose_cleanup(cell);
  1070. +     return(NULL);}
  1071. +  popen_push(cell);
  1072. +  return(cell->fp);}
  1073. + static struct dsc$descriptor *set_dsc_cst(x,buff)
  1074. +      struct dsc$descriptor *x;
  1075. +      char *buff;
  1076. + {(*x).dsc$w_length = strlen(buff);
  1077. +  (*x).dsc$a_pointer = buff;
  1078. +  (*x).dsc$b_class = DSC$K_CLASS_S;
  1079. +  (*x).dsc$b_dtype = DSC$K_DTYPE_T;
  1080. +  return(x);}
  1081. + static int create_mbx(name)
  1082. +   char *name;
  1083. + {short chan;
  1084. +  int prmflg,maxmsg,bufquo,promsk,acmode,iflag,retval;
  1085. +  struct dsc$descriptor lognam;
  1086. +  prmflg = 0;
  1087. +  maxmsg = mailbox_size;
  1088. +  bufquo = mailbox_byte_quota;
  1089. +  promsk = mailbox_protection_mask;
  1090. +  acmode = 0;
  1091. +  set_dsc_cst(&lognam,name);
  1092. +  retval = sys$crembx(prmflg,&chan,maxmsg,bufquo,promsk,acmode,&lognam);
  1093. +  if (retval != SS$_NORMAL) return(-1);
  1094. +  return(chan);}
  1095.  
  1096. Index: vms/readme.1st
  1097. *** vms/readme.1st.old    1994/05/19 01:11:32
  1098. --- vms/readme.1st    1994/05/19 01:11:36
  1099. ***************
  1100. *** 0 ****
  1101. --- 1,80 ----
  1102. + *******************************************************************************
  1103. + **************************  README FOR VMS SYSTEMS ****************************
  1104. + *******************************************************************************
  1105. +                                                                    May 12, 1994
  1106. +                                                                    Rick Flower 
  1107. +                                                     <flower@donald.sp.trw.com>
  1108. +                                                     <flower@sdvax2.sp.trw.com>
  1109. + This file documents the differences between C2MAN for Unix and C2MAN for VMS
  1110. + systems.  The are some requirements that must be met in order to run C2MAN for
  1111. + VMS that are listed below.  You **CAN** (or should be able to) run C2MAN on
  1112. + VAX/AXP systems if you just install the GNU-CPP (see #1 below) since the
  1113. + there is no GNU-CC that supports the AXP architecture yet.
  1114. +     1) You must either install a full GCC distribution OR install just the
  1115. +        CPP that is part of the standard CPP program!  If you are unable to
  1116. +            install the entire GCC system, the CPP program can be compiled and
  1117. +            built very easily directly from the main GCC distribution on any
  1118. +        GNU Anonymous FTP site (such as prep.ai.mit.edu in /pub/gnu or
  1119. +        on gatekeeper.dec.com in /pub/GNU).  There is a command file that
  1120. +            is part of the distribution that will make CPP.EXE using the 
  1121. +            standard CC (Vax-C or DEC-C) that you have..
  1122. +     2) You will need BISON and FLEX which are also standard GNU tools that
  1123. +            can be made to run under VMS.  If I recall correctly, FLEX will
  1124. +            once again compile right-out-of-the-box and can be retrieved from
  1125. +            any GNU site (see #1 above for examples).  BISON on the other hand
  1126. +            appears to have some problems being built as of a while back.. I 
  1127. +            highly suggest that you look on one of the VMS fileserv's or any
  1128. +            other VMS FTP site to find a copy of BISON for VMS..  The install
  1129. +            procedure that is part of the standard GNU source distribution seems
  1130. +            to be a bit broken.. I got my version of BISON from one of the 
  1131. +            prebuilt GCC distributions available from DECUS (you might try on
  1132. +            nic.switch.ch in /mirror/vms/DECUS/vms93a/gccvms if you can't find
  1133. +            it elsewhere!).
  1134. +     3) Once you've got the above requirements met, go into the [.vms]
  1135. +            directory and edit the MAKE.COM and make any necessary changes to
  1136. +            the CC,CFLAGS,LFLAGS, and the OPTFILE statement to indicate whether
  1137. +            you are using GCC or plain VAX-C.. (DEC-C should work without too 
  1138. +            much work!).  Once the changes are complete, make sure that you are
  1139. +            in the [.C2MAN] directory and then invoke @[.VMS]MAKE to build it.
  1140. +            You should end up with a C2MAN.EXE after a short period of time..  
  1141. +     4) Before you invoke C2MAN, MAKE ABSOLUTELY SURE THAT YOU'VE GOT A 
  1142. +            SYMBOL SETUP CALLED "CPP" THAT WILL INVOKE THE GNU-CPP PROGRAM!!! If
  1143. +            you don't have a symbol setup, C2MAN will FAIL to run!  You can set
  1144. +            a symbol for CPP using the following as an example :
  1145. +         $ CPP == $GNU_CC:[000000]GCC-CPP.EXE
  1146. +        Just change the drive / directory specification to point to where 
  1147. +            you've got your CPP located.  You can test whether or not CPP is
  1148. +            working by invoking CPP at the "$" and press return.. You won't see
  1149. +            anything happen until you press CTRL-Z and you get something like :
  1150. +         $ CPP
  1151. +         *EXIT*   (in reverse video!)
  1152. +                 # 1 ""
  1153. +                 $
  1154. +        If you don't get that then you've not defined your CPP correctly..
  1155. +     5) When you go and use C2MAN options that are uppercase letters, you
  1156. +            **MUST** quote them otherwise DCL will automatically change them
  1157. +            into lowercase letters which will probably cause C2MAN to complain
  1158. +            about unrecognized options being specified on the command line!!!
  1159. +            In other words, the following two commands are *NOT* identical in
  1160. +            function :
  1161. +         $ C2MAN -V
  1162. +                 c2man: reading standard input
  1163. +                 and
  1164. +                 $ C2MAN -"V"
  1165. +                 c2man: Version 2, Patchlevel 27
  1166. +                 c2man: reading standard input
  1167. +                 c2man: running `cpp -"C" -"D__C2MAN__=2" "-"'
  1168.  
  1169. Index: c2man.c
  1170. Prereq: 2.0.1.29
  1171. *** c2man.c.old    1994/01/07 07:04:56
  1172. --- c2man.c    1994/05/19 01:16:02
  1173. ***************
  1174. *** 1,4 ****
  1175. ! /* $Id: c2man.c,v 2.0.1.29 1994/01/07 07:04:56 greyham Exp $
  1176.    *
  1177.    * C Manual page generator.
  1178.    * Reads C source code and outputs manual pages.
  1179. --- 1,4 ----
  1180. ! /* $Id: c2man.c,v 2.0.1.31 1994/05/19 01:16:02 greyham Exp $
  1181.    *
  1182.    * C Manual page generator.
  1183.    * Reads C source code and outputs manual pages.
  1184. ***************
  1185. *** 81,86 ****
  1186. --- 81,90 ----
  1187.   IncludeFile *first_include;
  1188.   static IncludeFile **last_next_include = &first_include;
  1189.   
  1190. + /* list of excluded sections specified by user */
  1191. + ExcludeSection *first_excluded_section;
  1192. + static ExcludeSection **last_next_excluded_section = &first_excluded_section;
  1193.   /* do we group related stuff into one file? */
  1194.   boolean group_together;
  1195.   
  1196. ***************
  1197. *** 295,304 ****
  1198.       fputs(" -n\t\tName output file after input source file\n", stderr);
  1199.       fputs(" -L\t\tLazy: Be silent about undocumented parameters\n",
  1200.                                       stderr);
  1201. !     fputs(" -T n|l|t\tselect typesetting output format: nroff, LaTeX or TeXinfo\n",
  1202.                                       stderr);
  1203.       fputs(" -M name\tset name of the manual in which the page goes\n",
  1204.                                       stderr);
  1205.       fputc('\n', stderr);
  1206.       fputs(" -D name[=value]\n", stderr);
  1207.       fputs(" -U name\n", stderr);
  1208. --- 299,313 ----
  1209.       fputs(" -n\t\tName output file after input source file\n", stderr);
  1210.       fputs(" -L\t\tLazy: Be silent about undocumented parameters\n",
  1211.                                       stderr);
  1212. !     fputs(" -T n|l|t[,options]\tselect typesetting output format: nroff, LaTeX or TeXinfo\n",
  1213.                                       stderr);
  1214. +     nroff_output.print_options();
  1215. +     latex_output.print_options();
  1216. +     texinfo_output.print_options();
  1217.       fputs(" -M name\tset name of the manual in which the page goes\n",
  1218.                                       stderr);
  1219. +     fputs(" -x section\texclude section from ouput\n", stderr);
  1220.       fputc('\n', stderr);
  1221.       fputs(" -D name[=value]\n", stderr);
  1222.       fputs(" -U name\n", stderr);
  1223. ***************
  1224. *** 597,602 ****
  1225. --- 606,612 ----
  1226.       char *s, cbuf[2];
  1227.       const char *base_cpp_cmd;
  1228.       IncludeFile *includefile;
  1229. +     ExcludeSection *excludesection;
  1230.       char *cpp_opts;
  1231.       const char *default_section = "3";
  1232.   #ifdef HAS_LINK
  1233. ***************
  1234. *** 612,624 ****
  1235.       /* initialise CPP options with -D__C2MAN__ */
  1236.       cbuf[0] = VERSION + '0';
  1237.       cbuf[1] = '\0';
  1238. !     cpp_opts = strconcat("-D__C2MAN__=", cbuf, NULLCP);
  1239.   #ifdef NeXT
  1240.       cpp_opts = strappend(cpp_opts, " -D_NEXT_SOURCE", NULLCP);
  1241. ! #endif
  1242.   
  1243.       /* Scan command line options. */
  1244. !     while ((c = getopt(argc, argv, "P:D:F:I:psU:Vvo:eM:H:G:gi:S:l:LT:nO:")) 
  1245.                                       != EOF)
  1246.       {
  1247.       switch (c) {
  1248. --- 622,639 ----
  1249.       /* initialise CPP options with -D__C2MAN__ */
  1250.       cbuf[0] = VERSION + '0';
  1251.       cbuf[1] = '\0';
  1252. ! #ifdef VMS
  1253. !     cpp_opts = strconcat("-\"D__C2MAN__=", cbuf, "\"",NULLCP);
  1254. ! #else
  1255.   #ifdef NeXT
  1256.       cpp_opts = strappend(cpp_opts, " -D_NEXT_SOURCE", NULLCP);
  1257. ! #else
  1258. !     cpp_opts = strconcat("-D__C2MAN__=", cbuf, NULLCP);
  1259. ! #endif /* !NeXT */
  1260. ! #endif /* !VMS  */
  1261.   
  1262.       /* Scan command line options. */
  1263. !     while ((c = getopt(argc, argv, "P:D:F:I:psU:Vvo:eM:H:G:gi:x:S:l:LT:nO:"))
  1264.                                       != EOF)
  1265.       {
  1266.       switch (c) {
  1267. ***************
  1268. *** 718,723 ****
  1269. --- 733,745 ----
  1270.           includefile->next = NULL;
  1271.           last_next_include = &includefile->next;
  1272.           break;
  1273. +     case 'x':
  1274. +         *last_next_excluded_section = excludesection =
  1275. +                 (ExcludeSection *)safe_malloc(sizeof *excludesection);
  1276. +         excludesection->name = optarg;
  1277. +         excludesection->next = NULL;
  1278. +         last_next_excluded_section = &excludesection->next;
  1279. +         break;
  1280.       case 'S':
  1281.           manual_section = optarg;
  1282.           break;
  1283. ***************
  1284. *** 755,760 ****
  1285. --- 777,789 ----
  1286.               break;
  1287.           default:    usage();
  1288.           }
  1289. +         s = strtok(&optarg[1], ",");
  1290. +         if (s && ! *output->parse_option) usage();
  1291. +         while(s)
  1292. +         {
  1293. +           if (output->parse_option(s)) usage();
  1294. +           s = strtok(NULL, ",");
  1295. +         }
  1296.           break;
  1297.       case 'O':
  1298.           for (i = 0; i < _OBJECT_NUM; i++)
  1299. ***************
  1300. *** 834,839 ****
  1301. --- 863,875 ----
  1302.       IncludeFile *next = includefile->next;
  1303.       free(includefile);
  1304.       includefile = next;
  1305. +     }
  1306. +     for (excludesection = first_excluded_section; excludesection;)
  1307. +     {
  1308. +     ExcludeSection *next = excludesection->next;
  1309. +     free(excludesection);
  1310. +     excludesection = next;
  1311.       }
  1312.   
  1313.       for (i = 0; i < _OBJECT_NUM; i++)
  1314.  
  1315. Index: pc/updmake
  1316. *** pc/updmake.old    1994/05/16 01:58:19
  1317. --- pc/updmake    1994/05/16 01:58:57
  1318. ***************
  1319. *** 0 ****
  1320. --- 1,99 ----
  1321. + #!/usr/local/bin/perl -w
  1322. + # This script updates the MSDOS & OS/2 Makefile.pc automatically from the Unix
  1323. + # one to minimise the possibility of me making a mistake.
  1324. + # It's a gross hack, but it works.
  1325. + open(MAKEFILE, "../Makefile") || die;
  1326. + rename("Makefile.pc", "Makefile.old") || die;
  1327. + open(PREVIOUS, "Makefile.old") || die;
  1328. + open(OUTPUT, ">Makefile.pc") || die;
  1329. + # skip the header from the Unix Makefile.
  1330. + do { $_ = <MAKEFILE>; } until m/^SHELL=/o;
  1331. + # retain the previous header from the PC Makefile.
  1332. + while (<PREVIOUS>)
  1333. + {
  1334. +     print OUTPUT;
  1335. +     last if /# DO NOT EDIT/;
  1336. + }
  1337. + while (<MAKEFILE>)
  1338. + {
  1339. +     if ($_ eq "MAKE=make\n")
  1340. +     {
  1341. +         while (<MAKEFILE>)
  1342. +         {
  1343. +             last unless $_ eq "\n";
  1344. +         }
  1345. +     }
  1346. +     next if /chmod/o;
  1347. +     s/\.o(\W)/\$O\1/go;
  1348. +     s/\.o$/\$O/o;
  1349. +     s/c2man([^.])/c2man.exe\1/ if (/:/ || /cp /);
  1350. +     s/^(install:) all$/\1/;
  1351. +     if (/\$\(LEX\) (.*)/)
  1352. +     {
  1353. +         print OUTPUT "\t\$(LEX) -t $1 > \$@";
  1354. +         print OUTPUT "\n";
  1355. +         $_ = "\tcp \$@ lex_yy.c\n";
  1356. +     }
  1357. +     print OUTPUT;
  1358. +     print OUTPUT "\t\$(BIND)\n" if (/\$\(LDFLAGS\) /);
  1359. +     last if m/^# y.tab.c dependancies/o;
  1360. + }
  1361. + # output dependancies grouped into lines.
  1362. + sub output_depend
  1363. + {
  1364. +     return if $current eq "";
  1365. +     $chars = length($current) + 1;
  1366. +     $current =~ s/\.o$/\$O/o;
  1367. +     print OUTPUT $current, ":";
  1368. +     foreach $file (@depends)
  1369. +     {
  1370. +         $chars += 1 + length($file);
  1371. +         if ($chars > 77)
  1372. +         {
  1373. +             print OUTPUT "\\\n\t";
  1374. +             $chars = 8 + length($file);
  1375. +         }
  1376. +         else
  1377. +         {
  1378. +             print OUTPUT " ";
  1379. +         }
  1380. +         print OUTPUT $file;
  1381. +     }
  1382. +     print OUTPUT "\n\n";
  1383. +     $current = "";
  1384. +     undef @depends;
  1385. + }
  1386. + # process the dependancies a bit.
  1387. + $current = "";
  1388. + undef @depends;
  1389. + while (<MAKEFILE>)
  1390. + {
  1391. +     if (m/^#/ || $_ eq "\n")
  1392. +     {
  1393. +         &output_depend;
  1394. +         print OUTPUT;
  1395. +         next;
  1396. +     }
  1397. +     # have we found a dependancy?
  1398. +     if (($obj,$dep) = m/^(.*):\s*(.*)/)
  1399. +     {
  1400. +         next if ($dep =~ m!^/!);    # ignore /usr/include
  1401. +         if ($obj ne $current)
  1402. +         {
  1403. +             &output_depend;
  1404. +             $current = $obj;
  1405. +         }
  1406. +         $dep =~ s!^\./!!;
  1407. +         push(@depends, $dep);
  1408. +     }
  1409. + }
  1410. + close OUTPUT || die;
  1411.  
  1412. *** End of Patch 29 ***
  1413. -- 
  1414. Graham Stoney, Hardware/Software Engineer
  1415. Canon Information Systems Research Australia
  1416. Ph: + 61 2 805 2909    Fax: + 61 2 805 2929
  1417.  
  1418. exit 0 # Just in case...
  1419.