home *** CD-ROM | disk | FTP | other *** search
- From: greyham@research.canon.oz.au (Graham Stoney)
- Newsgroups: comp.sources.misc
- Subject: v43i022: c2man-2.0 - automatic C documentation generator, Patch29
- Date: 9 Jun 1994 11:50:04 -0500
- Organization: Canon Information Systems Research Australia
- Sender: kent@sparky.sterling.com
- Approved: kent@sparky.sterling.com
- Message-ID: <2t7h7s$38m@sparky.sterling.com>
- Summary: This is an official patch for c2man 2.0. Please apply it.
- X-Md4-Signature: dcb23b4cd6e914c07ce6d15275dcb370
-
- Submitted-by: greyham@research.canon.oz.au (Graham Stoney)
- Posting-number: Volume 43, Issue 22
- Archive-name: c2man-2.0/patch29
- Environment: UNIX, DOS, OS/2, lex, yacc
- Patch-To: c2man-2.0: Volume 42, Issue 55-63
-
- System: c2man version 2.0
- Patch #: 29
- Priority: LOW
- Subject: patch #28, continued
- Date: Fri May 20 11:37:32 EST 1994
- From: Graham Stoney <greyham@research.canon.oz.au>
-
- Description:
- See patch #28.
-
-
- Fix: From rn, say "| patch -p -N -d DIR", where DIR is your c2man source
- directory. Outside of rn, say "cd DIR; patch -p -N <thisarticle".
- If you don't have the patch program, apply the following by hand,
- or get patch (version 2.0, latest patchlevel).
-
- After patching:
- *** DO NOTHING--INSTALL ALL PATCHES UP THROUGH #30 FIRST ***
- *** NOTE: YOU MUST RUN Configure AFTER APPLYING PATCH 30 ***
-
- If patch indicates that patchlevel is the wrong version, you may need
- to apply one or more previous patches, or the patch may already
- have been applied. See the patchlevel.h file to find out what has or
- has not been applied. In any event, don't continue with the patch.
-
- If you are missing previous patches they can be obtained from me:
-
- Graham Stoney <greyham@research.canon.oz.au>
-
- If you send a mail message of the following form it will greatly speed
- processing:
-
- Subject: Command
- @SH mailpatch PATH c2man 2.0 LIST
- ^ note the c
-
- where PATH is a return path FROM ME TO YOU either in Internet notation,
- or in bang notation from some well-known host, and LIST is the number
- of one or more patches you need, separated by spaces, commas, and/or
- hyphens. Saying 35- says everything from 35 to the end.
-
- To get some more detailed instructions, send me the following mail:
-
- Subject: Command
- @SH mailhelp PATH
-
-
- Index: patchlevel.h
- Prereq: 28
- 2c2
- < #define PATCHLEVEL 28
- ---
- > #define PATCHLEVEL 29
-
- Index: vms/config.h
- *** vms/config.h.old 1994/05/19 01:10:43
- --- vms/config.h 1994/05/19 01:10:45
- ***************
- *** 0 ****
- --- 1,331 ----
- + /*
- + * This file was produced by running the config_h.SH script, which
- + * gets its values from config.sh, which is generally produced by
- + * running Configure.
- + *
- + * Feel free to modify any of this as the need arises. Note, however,
- + * that running config.h.SH again will wipe out any changes you've made.
- + * For a more permanent change edit config.sh and rerun config.h.SH.
- + *
- + * $Id: config.h,v 2.0.1.1 1994/05/19 01:10:45 greyham Exp $
- + */
- +
- + /* Configuration time: Tue Apr 26 09:56:37 PDT 1994
- + * Configured by: flower
- + * Target system: sunos flower 4.1.3 3 sun4
- + */
- +
- + #ifndef _config_h_
- + #define _config_h_
- +
- + #ifdef VMS
- + /*
- + * Access call. Also maintained in unistd.h
- + */
- + #define F_OK 0 /* does file exist */
- + #define X_OK 1 /* is it executable by caller */
- + #define W_OK 2 /* writable by caller */
- + #define R_OK 4 /* readable by caller */
- +
- + /* VMS does not have unlink() */
- + #define unlink(s) delete(s)
- + #endif
- +
- + /* BSD:
- + * This symbol, if defined, indicates that the program is running under
- + * a BSD system.
- + */
- + /*#define BSD */
- +
- + /* CPP_FILE_COM:
- + * This symbol contains the first part of the string which will invoke
- + * the C preprocessor a file and produce to standard output, preserving
- + * comments. Typical value of "cc -E -C" or "/lib/cpp -C".
- + */
- + /* CPP_STDIN_FLAGS:
- + * This variable contains any flags necessary to get CPP_FILE_COM to
- + * read from the standard input.
- + */
- + /* CPP_IGN_HDRS:
- + * This symbol is defined if CPP_FILE_COM ignores *.h files.
- + */
- + /* CPP_CAN_STDIN:
- + * This symbol is defined if CPP_FILE_COM can read standard input
- + * directly.
- + */
- + #define CPP_FILE_COM "cpp -\"C\""
- + #define CPP_STDIN_FLAGS "\"-\""
- + /*#define CPP_IGN_HDRS */ /* does CPP ignore .h files? */
- + #define CPP_CAN_STDIN /* can CPP read stdin directly? */
- +
- + /* HAS_ACCESS:
- + * This manifest constant lets the C program know that the access()
- + * system call is available to check for accessibility using real UID/GID.
- + * (always present on UNIX.)
- + */
- + #define HAS_ACCESS /**/
- +
- + /* HASCONST:
- + * This symbol, if defined, indicates that this C compiler knows about
- + * the const type. There is no need to actually test for that symbol
- + * within your programs. The mere use of the "const" keyword will
- + * trigger the necessary tests.
- + */
- + #define HASCONST /**/
- + #ifndef HASCONST
- + #define const
- + #endif
- +
- + /* FLEXFILENAMES:
- + * This symbol, if defined, indicates that the system supports filenames
- + * longer than 14 characters.
- + */
- + #define FLEXFILENAMES /**/
- +
- + /* HAS_LINK:
- + * This symbol, if defined, indicates that the link routine is
- + * available to create hard links.
- + */
- + /*#define HAS_LINK */
- +
- + /* HAS_OPEN3:
- + * This manifest constant lets the C program know that the three
- + * argument form of open(2) is available.
- + */
- + #define HAS_OPEN3 /**/
- +
- + /* HAS_STRCHR:
- + * This symbol is defined to indicate that the strchr()/strrchr()
- + * functions are available for string searching. If not, try the
- + * index()/rindex() pair.
- + */
- + /* HAS_INDEX:
- + * This symbol is defined to indicate that the index()/rindex()
- + * functions are available for string searching.
- + */
- + #define HAS_STRCHR /**/
- + /*#define HAS_INDEX /**/
- +
- + /* HAS_STRFTIME:
- + * This symbol, if defined, indicates that the strftime routine is
- + * available to format locale-specific times.
- + */
- + /*#define HAS_STRFTIME */
- +
- + /* HAS_STRSTR:
- + * This symbol, if defined, indicates that the strstr routine is
- + * available to find substrings.
- + */
- + #define HAS_STRSTR /**/
- +
- + /* HAS_SYMLINK:
- + * This symbol, if defined, indicates that the symlink routine is available
- + * to create symbolic links.
- + */
- + /*#define HAS_SYMLINK */
- +
- + /* Time_t:
- + * This symbol holds the type returned by time(). It can be long,
- + * or time_t on BSD sites (in which case <sys/types.h> should be
- + * included).
- + */
- + #define Time_t long /* Time type */
- +
- + /* Signal_t:
- + * This symbol's value is either "void" or "int", corresponding to the
- + * appropriate return type of a signal handler. Thus, you can declare
- + * a signal handler using "Signal_t (*handler)()", and define the
- + * handler using "Signal_t handler(sig)".
- + */
- + #define Signal_t void /* Signal handler's return type */
- +
- + /* HASVOLATILE:
- + * This symbol, if defined, indicates that this C compiler knows about
- + * the volatile declaration.
- + */
- + /*#define HASVOLATILE */
- + #ifndef HASVOLATILE
- + #define volatile
- + #endif
- +
- + /* I_FCNTL:
- + * This manifest constant tells the C program to include <fcntl.h>.
- + */
- + /*#define I_FCNTL /**/
- +
- + /* I_STDARG:
- + * This symbol, if defined, indicates that <stdarg.h> exists and should
- + * be included.
- + */
- + #define I_STDARG /**/
- +
- + /* I_STDDEF:
- + * This symbol, if defined, indicates that <stddef.h> exists and should
- + * be included.
- + */
- + #define I_STDDEF /**/
- +
- + /* I_STDLIB:
- + * This symbol, if defined, indicates that <stdlib.h> exists and should
- + * be included.
- + */
- + #define I_STDLIB /**/
- +
- + /* I_STRING:
- + * This symbol, if defined, indicates to the C program that it should
- + * include <string.h> (USG systems) instead of <strings.h> (BSD systems).
- + */
- + #define I_STRING /**/
- +
- + /* I_SYS_FILE:
- + * This symbol, if defined, indicates to the C program that it should
- + * include <sys/file.h> to get definition of R_OK and friends.
- + */
- + #define I_SYS_FILE /**/
- +
- + /* I_SYS_TYPES:
- + * This symbol, if defined, indicates to the C program that it should
- + * include <sys/types.h>.
- + */
- + /*#define I_SYS_TYPES */
- +
- + /* I_TIME:
- + * This symbol, if defined, indicates to the C program that it should
- + * include <time.h>.
- + */
- + /* I_SYS_TIME:
- + * This symbol, if defined, indicates to the C program that it should
- + * include <sys/time.h>.
- + */
- + #define I_TIME /**/
- + /*#define I_SYS_TIME */
- +
- + /* I_UNISTD:
- + * This symbol, if defined, indicates to the C program that it should
- + * include <unistd.h>.
- + */
- + /*#define I_UNISTD */
- +
- + /* I_VARARGS:
- + * This symbol, if defined, indicates to the C program that it should
- + * include <varargs.h>.
- + */
- + /*#define I_VARARGS */
- +
- + /* CAN_PROTOTYPE:
- + * If defined, this macro indicates that the C compiler can handle
- + * function prototypes.
- + */
- + /* DOTS:
- + * This macro is used to specify the ... in function prototypes which
- + * have arbitrary additional arguments.
- + */
- + /* NXT_ARG:
- + * This macro is used to separate arguments in the declared argument list.
- + */
- + /* P_FUNC:
- + * This macro is used to declare "private" (static) functions.
- + * It takes three arguments: the function type and name, a parenthesized
- + * traditional (comma separated) argument list, and the declared argument
- + * list (in which arguments are separated with NXT_ARG, and additional
- + * arbitrary arguments are specified with DOTS). For example:
- + *
- + * P_FUNC(int foo, (bar, baz), int bar NXT_ARG char *baz[])
- + */
- + /* P_FUNC_VOID:
- + * This macro is used to declare "private" (static) functions that have
- + * no arguments. The macro takes one argument: the function type and name.
- + * For example:
- + *
- + * P_FUNC_VOID(int subr)
- + */
- + /* V_FUNC:
- + * This macro is used to declare "public" (non-static) functions.
- + * It takes three arguments: the function type and name, a parenthesized
- + * traditional (comma separated) argument list, and the declared argument
- + * list (in which arguments are separated with NXT_ARG, and additional
- + * arbitrary arguments are specified with DOTS). For example:
- + *
- + * V_FUNC(int main, (argc, argv), int argc NXT_ARG char *argv[])
- + */
- + /* V_FUNC_VOID:
- + * This macro is used to declare "public" (non-static) functions that have
- + * no arguments. The macro takes one argument: the function type and name.
- + * For example:
- + *
- + * V_FUNC_VOID(int fork)
- + */
- + /* _:
- + * This macro is used to declare function parameters for folks who want
- + * to make declarations with prototypes using a different style than
- + * the above macros. Use double parentheses. For example:
- + *
- + * int main _((int argc, char *argv[]));
- + */
- + #define CAN_PROTOTYPE /**/
- + #ifdef CAN_PROTOTYPE
- + #define NXT_ARG ,
- + #define DOTS , ...
- + #define V_FUNC(name, arglist, args)name(args)
- + #define P_FUNC(name, arglist, args)static name(args)
- + #define V_FUNC_VOID(name)name(void)
- + #define P_FUNC_VOID(name)static name(void)
- + #define _(args) args
- + #else
- + #define NXT_ARG ;
- + #define DOTS
- + #define V_FUNC(name, arglist, args)name arglist args;
- + #define P_FUNC(name, arglist, args)static name arglist args;
- + #define V_FUNC_VOID(name)name()
- + #define P_FUNC_VOID(name)static name()
- + #define _(args) ()
- + #endif
- +
- + /* CAN_VAPROTO:
- + * This variable is defined on systems supporting prototype declaration
- + * of functions with a variable number of arguments.
- + */
- + /* _V:
- + * This macro is used to declare function parameters in prototypes for
- + * functions with a variable number of parameters. Use double parentheses.
- + * For example:
- + *
- + * int printf _V((char *fmt, ...));
- + *
- + * Remember to use the plain simple _() macro when declaring a function
- + * with no variable number of arguments, since it might be possible to
- + * have a non-effect _V() macro and still get prototypes via _().
- + */
- + #define CAN_VAPROTO /**/
- + #ifdef CAN_VAPROTO
- + #define _V(args) args
- + #else
- + #define _V(args) ()
- + #endif
- +
- + /* VOIDFLAGS:
- + * This symbol indicates how much support of the void type is given by this
- + * compiler. What various bits mean:
- + *
- + * 1 = supports declaration of void
- + * 2 = supports arrays of pointers to functions returning void
- + * 4 = supports comparisons between pointers to void functions and
- + * addresses of void functions
- + * 8 = suports declaration of generic void pointers
- + *
- + * The package designer should define VOIDUSED to indicate the requirements
- + * of the package. This can be done either by #defining VOIDUSED before
- + * including config.h, or by defining defvoidused in Myinit.U. If the
- + * latter approach is taken, only those flags will be tested. If the
- + * level of void support necessary is not present, defines void to int.
- + */
- + #ifndef VOIDUSED
- + #define VOIDUSED 9
- + #endif
- + #define VOIDFLAGS 9
- + #if (VOIDFLAGS & VOIDUSED) != VOIDUSED
- + #define void int /* is void to be avoided? */
- + #define M_VOID /* Xenix strikes again */
- + #endif
- +
- + #endif
-
- Index: pc/Makefile.pc
- *** pc/Makefile.pc.old 1993/12/07 04:46:03
- --- pc/Makefile.pc 1994/05/16 01:59:43
- ***************
- *** 1,5 ****
- ! # NOTE: This file is generated automatically by processing the Makefile in the
- ! # main directory with a perl script.
- # Makefile for c2man 23 Aug 1993
- #
- # - for GNU gcc (emx 0.8g kit) under OS/2 2.x or DOS (32-bit)
- --- 1,7 ----
- ! # NOTE: This file is generated automatically by the `updmake' perl script,
- ! # which processes the Makefile in the main directory and re-pastes this header
- ! # on the top.
- ! #
- # Makefile for c2man 23 Aug 1993
- #
- # - for GNU gcc (emx 0.8g kit) under OS/2 2.x or DOS (32-bit)
- ***************
- *** 50,74 ****
- # As Larry said, "Grrrr"
- SHELL=/bin/sh
-
- OSOURCES = config.h c2man.h semantic.h symbol.h strconcat.h \
- strappend.h manpage.h enum.h output.h lex.l grammar.y
- DCSOURCES = c2man.c semantic.c string.c symbol.c strconcat.c \
- ! strappend.c manpage.c enum.c nroff.c texinfo.c
- SOURCES = $(OSOURCES) $(DCSOURCES)
- CSOURCES = $(DCSOURCES) y.tab.c
- OBJECTS = c2man$O semantic$O string$O symbol$O y.tab$O strconcat$O \
- ! strappend$O manpage$O enum$O nroff$O texinfo$O
- GENERATED = c2man example.inc ctype_ex.inc y.tab.c lex.yy.c y.output \
- ! fixexample.sed flatten.sed
-
- all: c2man.exe example.inc ctype_ex.inc flatten.sed
-
- install:
- ! cp c2man.exe $(bin)
- $(SED) -f flatten.sed < c2man.1 > $(mansrc)/c2man.$(manext)
- -mkdir $(privlib)
- -mkdir $(privlib)/eg
- ! cp eg/*.[chly] $(privlib)/eg
-
- uninstall:
- $(RM) -f $(bin)/c2man $(mansrc)/c2man.$(manext)
- --- 52,80 ----
- # As Larry said, "Grrrr"
- SHELL=/bin/sh
-
- + # To change anything below here, you should really fix updmake to do it.
- + # DO NOT EDIT ANYTHING BELOW HERE, OR IT WILL BE LOST NEXT TIME updmake IS RUN.
- +
- OSOURCES = config.h c2man.h semantic.h symbol.h strconcat.h \
- strappend.h manpage.h enum.h output.h lex.l grammar.y
- DCSOURCES = c2man.c semantic.c string.c symbol.c strconcat.c \
- ! strappend.c manpage.c enum.c nroff.c texinfo.c latex.c
- SOURCES = $(OSOURCES) $(DCSOURCES)
- CSOURCES = $(DCSOURCES) y.tab.c
- OBJECTS = c2man$O semantic$O string$O symbol$O y.tab$O strconcat$O \
- ! strappend$O manpage$O enum$O nroff$O texinfo$O latex$O
- GENERATED = c2man example.inc ctype_ex.inc y.tab.c lex.yy.c y.output \
- ! fixexamp.sed flatten.sed
- !
-
- all: c2man.exe example.inc ctype_ex.inc flatten.sed
-
- install:
- ! $(CP) c2man $(bin)
- $(SED) -f flatten.sed < c2man.1 > $(mansrc)/c2man.$(manext)
- -mkdir $(privlib)
- -mkdir $(privlib)/eg
- ! $(CP) eg/*.[chly] $(privlib)/eg
-
- uninstall:
- $(RM) -f $(bin)/c2man $(mansrc)/c2man.$(manext)
- ***************
- *** 84,90 ****
- $(CC) $(CFLAGS) $(WARNFLAGS) -c $<
-
- y.tab.c: grammar.y
- ! @$(ECHO) Expect 48 shift/reduce conflicts.
- $(YACC) grammar.y
-
- # don't compile y.tab.c with all warnings; yacc/bison are not up to it.
- --- 90,96 ----
- $(CC) $(CFLAGS) $(WARNFLAGS) -c $<
-
- y.tab.c: grammar.y
- ! @$(ECHO) Expect 54 shift/reduce conflicts.
- $(YACC) grammar.y
-
- # don't compile y.tab.c with all warnings; yacc/bison are not up to it.
- ***************
- *** 95,116 ****
- $(LEX) -t -n lex.l > $@
- cp $@ lex_yy.c
-
- ! example.inc: c2man.exe example.h fixexample.sed
- ! ./c2man -o- example.h | $(SED) -f fixexample.sed >example.inc
-
- ! ctype_ex.inc: c2man.exe ctype_ex.h fixexample.sed
- ! ./c2man -o- -g ctype_ex.h | $(SED) -f fixexample.sed >ctype_ex.inc
-
- ! fixexample.sed: fixexample.in
- ! $(SED) -e '/^#/d' fixexample.in > fixexample.sed
-
- ! flatten.sed: flatten_sed.SH
- ! sh flatten_sed.SH
-
- ! Makefile: Makefile.SH
- sh Makefile.SH
-
- ! config.h: config_h.SH
- sh config_h.SH
-
- TAGS: $(SOURCES)
- --- 101,122 ----
- $(LEX) -t -n lex.l > $@
- cp $@ lex_yy.c
-
- ! example.inc: c2man.exe example.h fixexamp.sed
- ! ./c2man -o- example.h | $(SED) -f fixexamp.sed >example.inc
-
- ! ctype_ex.inc: c2man.exe ctype_ex.h fixexamp.sed
- ! ./c2man -o- -g ctype_ex.h | $(SED) -f fixexamp.sed >ctype_ex.inc
-
- ! fixexamp.sed: fixexamp.in
- ! $(SED) -e '/^#/d' fixexamp.in > fixexamp.sed
-
- ! flatten.sed: flatten.SH config.sh
- ! sh flatten.SH
-
- ! Makefile: Makefile.SH config.sh
- sh Makefile.SH
-
- ! config.h: config_h.SH config.sh
- sh config_h.SH
-
- TAGS: $(SOURCES)
- ***************
- *** 151,157 ****
- c2man$O: c2man.c c2man.h config.h confmagic.h enum.h manpage.h output.h\
- patchlevel.h strappend.h strconcat.h symbol.h
-
- ! semantic$O: c2man.h config.h confmagic.h enum.h manpage.h semantic.c\
- semantic.h strconcat.h symbol.h
-
- string$O: c2man.h config.h confmagic.h string.c symbol.h
- --- 157,163 ----
- c2man$O: c2man.c c2man.h config.h confmagic.h enum.h manpage.h output.h\
- patchlevel.h strappend.h strconcat.h symbol.h
-
- ! semantic$O: c2man.h config.h confmagic.h enum.h manpage.h output.h semantic.c\
- semantic.h strconcat.h symbol.h
-
- string$O: c2man.h config.h confmagic.h string.c symbol.h
- ***************
- *** 163,172 ****
- strappend$O: c2man.h config.h confmagic.h strappend.c strappend.h symbol.h
-
- manpage$O: c2man.h config.h confmagic.h manpage.c manpage.h output.h\
- ! semantic.h strconcat.h symbol.h
-
- enum$O: c2man.h config.h confmagic.h enum.c enum.h manpage.h strconcat.h\
- symbol.h
-
- nroff$O: c2man.h config.h confmagic.h manpage.h nroff.c output.h symbol.h
-
- --- 169,182 ----
- strappend$O: c2man.h config.h confmagic.h strappend.c strappend.h symbol.h
-
- manpage$O: c2man.h config.h confmagic.h manpage.c manpage.h output.h\
- ! semantic.h strappend.h strconcat.h symbol.h
-
- enum$O: c2man.h config.h confmagic.h enum.c enum.h manpage.h strconcat.h\
- symbol.h
-
- nroff$O: c2man.h config.h confmagic.h manpage.h nroff.c output.h symbol.h
- +
- + texinfo$O: c2man.h config.h confmagic.h manpage.h output.h symbol.h texinfo.c
- +
- + latex$O: c2man.h config.h confmagic.h latex.c manpage.h output.h symbol.h
-
-
- Index: libc/alloca.c
- *** libc/alloca.c.old 1994/05/19 01:06:38
- --- libc/alloca.c 1994/05/19 01:06:54
- ***************
- *** 0 ****
- --- 1,186 ----
- + /*
- + alloca -- (mostly) portable public-domain implementation -- D A Gwyn
- +
- + This implementation of the PWB library alloca() function,
- + which is used to allocate space off the run-time stack so
- + that it is automatically reclaimed upon procedure exit,
- + was inspired by discussions with J. Q. Johnson of Cornell.
- +
- + It should work under any C implementation that uses an
- + actual procedure stack (as opposed to a linked list of
- + frames). There are some preprocessor constants that can
- + be defined when compiling for your specific system, for
- + improved efficiency; however, the defaults should be okay.
- +
- + The general concept of this implementation is to keep
- + track of all alloca()-allocated blocks, and reclaim any
- + that are found to be deeper in the stack than the current
- + invocation. This heuristic does not reclaim storage as
- + soon as it becomes invalid, but it will do so eventually.
- +
- + As a special case, alloca(0) reclaims storage without
- + allocating any. It is a good idea to use alloca(0) in
- + your main control loop, etc. to force garbage collection.
- + */
- + #ifndef lint
- + static char SCCSid[] = "@(#)alloca.c 1.1"; /* for the "what" utility */
- + #endif
- +
- + #ifdef emacs
- + #include "config.h"
- + #ifdef static
- + /* actually, only want this if static is defined as ""
- + -- this is for usg, in which emacs must undefine static
- + in order to make unexec workable
- + */
- + #ifndef STACK_DIRECTION
- + you
- + lose
- + -- must know STACK_DIRECTION at compile-time
- + #endif /* STACK_DIRECTION undefined */
- + #endif static
- + #endif emacs
- +
- + #ifdef X3J11
- + typedef void *pointer; /* generic pointer type */
- + #else
- + typedef char *pointer; /* generic pointer type */
- + #endif
- +
- + #define NULL 0 /* null pointer constant */
- +
- + extern void free();
- + extern pointer malloc();
- +
- + /*
- + Define STACK_DIRECTION if you know the direction of stack
- + growth for your system; otherwise it will be automatically
- + deduced at run-time.
- +
- + STACK_DIRECTION > 0 => grows toward higher addresses
- + STACK_DIRECTION < 0 => grows toward lower addresses
- + STACK_DIRECTION = 0 => direction of growth unknown
- + */
- +
- + #ifndef STACK_DIRECTION
- + #define STACK_DIRECTION 0 /* direction unknown */
- + #endif
- +
- + #if STACK_DIRECTION != 0
- +
- + #define STACK_DIR STACK_DIRECTION /* known at compile-time */
- +
- + #else /* STACK_DIRECTION == 0; need run-time code */
- +
- + static int stack_dir; /* 1 or -1 once known */
- + #define STACK_DIR stack_dir
- +
- + static void
- + find_stack_direction (/* void */)
- + {
- + static char *addr = NULL; /* address of first
- + `dummy', once known */
- + auto char dummy; /* to get stack address */
- +
- + if (addr == NULL)
- + { /* initial entry */
- + addr = &dummy;
- +
- + find_stack_direction (); /* recurse once */
- + }
- + else /* second entry */
- + if (&dummy > addr)
- + stack_dir = 1; /* stack grew upward */
- + else
- + stack_dir = -1; /* stack grew downward */
- + }
- +
- + #endif /* STACK_DIRECTION == 0 */
- +
- + /*
- + An "alloca header" is used to:
- + (a) chain together all alloca()ed blocks;
- + (b) keep track of stack depth.
- +
- + It is very important that sizeof(header) agree with malloc()
- + alignment chunk size. The following default should work okay.
- + */
- +
- + #ifndef ALIGN_SIZE
- + #define ALIGN_SIZE sizeof(double)
- + #endif
- +
- + typedef union hdr
- + {
- + char align[ALIGN_SIZE]; /* to force sizeof(header) */
- + struct
- + {
- + union hdr *next; /* for chaining headers */
- + char *deep; /* for stack depth measure */
- + } h;
- + } header;
- +
- + /*
- + alloca( size ) returns a pointer to at least `size' bytes of
- + storage which will be automatically reclaimed upon exit from
- + the procedure that called alloca(). Originally, this space
- + was supposed to be taken from the current stack frame of the
- + caller, but that method cannot be made to work for some
- + implementations of C, for example under Gould's UTX/32.
- + */
- +
- + static header *last_alloca_header = NULL; /* -> last alloca header */
- +
- + pointer
- + alloca (size) /* returns pointer to storage */
- + unsigned size; /* # bytes to allocate */
- + {
- + auto char probe; /* probes stack depth: */
- + register char *depth = &probe;
- +
- + #if STACK_DIRECTION == 0
- + if (STACK_DIR == 0) /* unknown growth direction */
- + find_stack_direction ();
- + #endif
- +
- + /* Reclaim garbage, defined as all alloca()ed storage that
- + was allocated from deeper in the stack than currently. */
- +
- + {
- + register header *hp; /* traverses linked list */
- +
- + for (hp = last_alloca_header; hp != NULL;)
- + if (STACK_DIR > 0 && hp->h.deep > depth
- + || STACK_DIR < 0 && hp->h.deep < depth)
- + {
- + register header *np = hp->h.next;
- +
- + free ((pointer) hp); /* collect garbage */
- +
- + hp = np; /* -> next header */
- + }
- + else
- + break; /* rest are not deeper */
- +
- + last_alloca_header = hp; /* -> last valid storage */
- + }
- +
- + if (size == 0)
- + return NULL; /* no allocation required */
- +
- + /* Allocate combined header + user data storage. */
- +
- + {
- + register pointer new = malloc (sizeof (header) + size);
- + /* address of header */
- +
- + ((header *)new)->h.next = last_alloca_header;
- + ((header *)new)->h.deep = depth;
- +
- + last_alloca_header = (header *)new;
- +
- + /* User storage begins just after header. */
- +
- + return (pointer)((char *)new + sizeof(header));
- + }
- + }
-
- Index: texinfo.c
- Prereq: 2.0.1.6
- *** texinfo.c.old 1994/01/07 07:05:58
- --- texinfo.c 1994/05/12 02:25:10
- ***************
- *** 1,10 ****
- ! /* $Id: texinfo.c,v 2.0.1.6 1994/01/07 07:05:58 greyham Exp $
- * functions for texinfo style output.
- */
- #include "c2man.h"
- #include "manpage.h"
- #include "output.h"
-
- void texinfo_char(c)
- const int c;
- {
- --- 1,31 ----
- ! /* $Id: texinfo.c,v 2.0.1.7 1994/05/12 02:25:10 greyham Exp $
- * functions for texinfo style output.
- */
- #include "c2man.h"
- #include "manpage.h"
- #include "output.h"
-
- + static char *heading_not_in_contents[] =
- + {"@chapheading ", "@heading ", "@subheading ", "@subsubheading "};
- + static char *heading_in_contents[] =
- + {"@chapter ", "@section ", "@subsection ", "@subsubsection "};
- +
- + #define n_levels (sizeof(heading_not_in_contents) / sizeof(char *))
- +
- + #define level(n) ((n) >= n_levels ? n_levels - 1 : (n))
- +
- + /* section level for man page entry */
- + static int top_level = 1;
- +
- + /* always output node for manpage, even if embedded */
- + static int embed_node_info = 0;
- +
- + /* use title as name of section, rather than "NAME" */
- + static int title_name = 0;
- +
- + /* the section title, filled in by texinfo_header */
- + static const char *title = "INTERNAL ERROR, BOGUS TITLE DUDE!";
- +
- void texinfo_char(c)
- const int c;
- {
- ***************
- *** 38,60 ****
- const char *name;
- const char *section;
- {
- ! put_string("\\input texinfo @c -*-texinfo-*-\n");
- ! output_warning();
- ! put_string("@c %**start of header\n");
- ! put_string("@setfilename ");
- ! texinfo_text(name);
- ! put_string(".info\n@settitle ");
- ! texinfo_text(name);
- ! putchar('\n');
- ! put_string("@c %**end of header\n");
-
- ! put_string("@node Top, ");
- ! texinfo_text(name);
- ! put_string(", (dir), (dir)\n");
-
- ! put_string("@node ");
- ! texinfo_text(name);
- ! put_string(", (dir), Top, (dir)\n");
- }
-
- void texinfo_dash() { put_string("---"); }
- --- 59,89 ----
- const char *name;
- const char *section;
- {
- ! if (! make_embeddable)
- ! {
- ! put_string("\\input texinfo @c -*-texinfo-*-\n");
- ! output_warning();
- ! put_string("@c %**start of header\n");
- ! put_string("@setfilename ");
- ! texinfo_text(name);
- ! put_string(".info\n@settitle ");
- ! texinfo_text(name);
- ! putchar('\n');
- ! put_string("@c %**end of header\n");
-
- ! put_string("@node Top, ");
- ! texinfo_text(name);
- ! put_string(", (dir), (dir)\n");
- ! }
-
- ! if (! make_embeddable || embed_node_info)
- ! {
- ! put_string("@node ");
- ! texinfo_text(name);
- ! put_string(", (dir), Top, (dir)\n");
- ! }
- !
- ! title = name;
- }
-
- void texinfo_dash() { put_string("---"); }
- ***************
- *** 62,68 ****
- void texinfo_section(name)
- const char *name;
- {
- ! put_string("@unnumberedsec ");
- texinfo_text(name);
- putchar('\n');
- put_string("@noindent\n");
- --- 91,106 ----
- void texinfo_section(name)
- const char *name;
- {
- ! put_string(heading_not_in_contents[level(top_level)]);
- ! texinfo_text(name);
- ! putchar('\n');
- ! put_string("@noindent\n");
- ! }
- !
- ! void texinfo_section_in_contents(name)
- ! const char *name;
- ! {
- ! put_string(heading_in_contents[level(top_level)]);
- texinfo_text(name);
- putchar('\n');
- put_string("@noindent\n");
- ***************
- *** 71,77 ****
- void texinfo_sub_section(name)
- const char *name;
- {
- ! put_string("@unnumberedsubsec ");
- texinfo_text(name);
- putchar('\n');
- put_string("@noindent\n");
- --- 109,115 ----
- void texinfo_sub_section(name)
- const char *name;
- {
- ! put_string(heading_not_in_contents[level(top_level+1)]);
- texinfo_text(name);
- putchar('\n');
- put_string("@noindent\n");
- ***************
- *** 141,146 ****
- --- 179,240 ----
-
- void texinfo_file_end() { put_string("@bye\n"); }
-
- + static first_name = 1;
- + void texinfo_name(name)
- + char *name;
- + {
- + if (name)
- + {
- + if (!first_name || !title_name || strcmp(title,name))
- + texinfo_text(name);
- + first_name = 0;
- + }
- + else
- + {
- + first_name = 1;
- + if (title_name)
- + texinfo_section_in_contents(title);
- + else
- + texinfo_section("NAME");
- + }
- + }
- +
- + void texinfo_terse_sep()
- + {
- + if (!title_name || group_together)
- + {
- + texinfo_char(' ');
- + texinfo_dash();
- + texinfo_char(' ');
- + }
- + }
- +
- +
- +
- + int texinfo_parse_option(option)
- + char *option;
- + {
- + if (option[0] == 't')
- + title_name = 1;
- + else if (option[0] == 'n')
- + embed_node_info = 1;
- + else if (option[0] == 's')
- + {
- + top_level = atoi(&option[1]);
- + if (top_level < 0) return 1;
- + }
- + else return 1;
- +
- + return 0;
- + }
- +
- + void texinfo_print_options()
- + {
- + fputs("\ttexinfo options:\n", stderr);
- + fputs("\tt\tuse manpage title as NAME title\n", stderr);
- + fputs("\tn\toutput node info if embedded output\n", stderr);
- + fputs("\ts<n>\tset top heading level to <n>\n", stderr);
- + }
-
- struct Output texinfo_output =
- {
- ***************
- *** 171,175 ****
- texinfo_include,
- texinfo_file_end,
- texinfo_text,
- ! texinfo_char
- };
- --- 265,273 ----
- texinfo_include,
- texinfo_file_end,
- texinfo_text,
- ! texinfo_char,
- ! texinfo_parse_option,
- ! texinfo_print_options,
- ! texinfo_name,
- ! texinfo_terse_sep
- };
-
- Index: vms/popen.c
- *** vms/popen.c.old 1994/05/19 01:11:19
- --- vms/popen.c 1994/05/19 01:11:22
- ***************
- *** 0 ****
- --- 1,188 ----
- + /* Implement unix popen and pclose in vms by using mailboxes
- + and lib$spawn.
- + 17-APR-91 -GJC@MITECH.COM version 1.0
- + */
- +
- + #include <stdio.h>
- + #include <descrip.h>
- + #include <ssdef.h>
- + #include <string.h>
- +
- + FILE *popen();
- + int pclose();
- +
- + globalvalue CLI$M_NOWAIT;
- +
- + void p_describe(); /* a non-unix function */
- +
- + static struct dsc$descriptor *set_dsc_cst();
- + static int create_mbx();
- +
- + #define mailbox_size (512)
- + #define mailbox_byte_quota (3*mailbox_size)
- + #define mailbox_protection_mask (0x0000F000)
- +
- + struct popen_cell
- + {FILE *fp;
- + char *mbx_name;
- + short mbx_chan;
- + long pid;
- + long completed;
- + long comp_status;
- + struct popen_cell *next;
- + struct popen_cell *prev;};
- +
- + static struct popen_cell *popen_list = NULL;
- +
- + static struct popen_cell *find_popen_cell(fp)
- + FILE *fp;
- + {struct popen_cell *l;
- + for(l=popen_list;l != NULL; l = l->next)
- + if (l->fp == fp) return(l);
- + return(NULL);}
- +
- + void p_describe(fp)
- + FILE *fp;
- + {struct popen_cell *cell;
- + if (!(cell = find_popen_cell(fp)))
- + {printf("File pointer is not from popen, or it has been closed\n");
- + return;}
- + printf("FILE *fp = %08X\n",cell->fp);
- + printf("char *mbx_name = %s\n",cell->mbx_name);
- + printf("short mbx_chan = %d\n",cell->mbx_chan);
- + printf("long pid = %08X\n",cell->pid);
- + printf("long completed = %d\n",cell->completed);
- + printf("long comp_status = %d\n",cell->comp_status);
- + printf("struct popen_cell *next = %08X\n",cell->next);
- + printf("struct popen_cell *prev = %08X\n",cell->prev);}
- +
- + static void proc_exit_ast(cell)
- + struct popen_cell *cell;
- + {cell->completed = 1;}
- +
- + static void pclose_cleanup(cell)
- + struct popen_cell *cell;
- + {sys$dassgn(cell->mbx_chan);
- + free(cell->mbx_name);
- + if (!cell->completed)
- + sys$delprc(&cell->pid,0);
- + memset(cell,0,sizeof(struct popen_cell));
- + free(cell);}
- +
- + static void pclose_delq(cell)
- + struct popen_cell *cell;
- + {if (cell->prev)
- + {cell->prev->next = cell->next;
- + if (cell->next)
- + cell->next->prev = cell->prev;}
- + else
- + {popen_list = cell->next;
- + if (cell->next)
- + cell->next->prev = NULL;}}
- +
- + static void popen_push(cell)
- + struct popen_cell *cell;
- + {if (popen_list)
- + popen_list->prev = cell;
- + cell->prev = NULL;
- + cell->next = popen_list;
- + popen_list = cell;}
- +
- + int pclose(fp)
- + FILE *fp;
- + {int i;
- + struct popen_cell *cell;
- + i = fclose(fp);
- + if (cell = find_popen_cell(fp))
- + {pclose_delq(cell);
- + pclose_cleanup(cell);}
- + return(i);}
- +
- + FILE *popen(command,mode)
- + char *command,*mode;
- + {char *temp;
- + struct popen_cell *cell;
- + int readp,n,mask,ret;
- + char *name,*prompt,*in,*out;
- + struct dsc$descriptor comm_d,in_d,out_d,name_d,prompt_d;
- +
- + if (strcmp(mode,"r") == 0)
- + readp = 1;
- + else if (strcmp(mode,"w") == 0)
- + readp = 0;
- + else
- + return(NULL);
- +
- + temp = mktemp("POPEN_MB_XXXXXXXXXX");
- + n = strlen(temp);
- + cell = (struct popen_cell *) malloc(sizeof(struct popen_cell));
- + cell->mbx_name = (char *) malloc(n+1);
- + strcpy(cell->mbx_name,temp);
- + if ((cell->mbx_chan = create_mbx(cell->mbx_name)) < 0)
- + {cell->completed = 1;
- + pclose_cleanup(cell);
- + return(NULL);}
- +
- + if (readp)
- + {in = "NL:";
- + out = cell->mbx_name;}
- + else
- + {in = cell->mbx_name;
- + out = "NL:";}
- +
- + name = 0;
- + prompt = 0;
- + mask = CLI$M_NOWAIT;
- +
- + cell->completed = 0;
- +
- + ret = lib$spawn((command) ? set_dsc_cst(&comm_d,command) : 0,
- + (in) ? set_dsc_cst(&in_d,in) : 0,
- + (out) ? set_dsc_cst(&out_d,out) : 0,
- + &mask,
- + (name) ? set_dsc_cst(&name_d,name) : 0,
- + &cell->pid,
- + &cell->comp_status,
- + 0, /* event flag */
- + proc_exit_ast,
- + cell,
- + (prompt) ? set_dsc_cst(&prompt_d,prompt) : 0,
- + 0 /* cli */
- + );
- +
- + if (ret != SS$_NORMAL)
- + {cell->completed = 1;
- + pclose_cleanup(cell);
- + return(NULL);}
- +
- + if (!(cell->fp = fopen(cell->mbx_name,mode)))
- + {pclose_cleanup(cell);
- + return(NULL);}
- +
- + popen_push(cell);
- +
- + return(cell->fp);}
- +
- + static struct dsc$descriptor *set_dsc_cst(x,buff)
- + struct dsc$descriptor *x;
- + char *buff;
- + {(*x).dsc$w_length = strlen(buff);
- + (*x).dsc$a_pointer = buff;
- + (*x).dsc$b_class = DSC$K_CLASS_S;
- + (*x).dsc$b_dtype = DSC$K_DTYPE_T;
- + return(x);}
- +
- + static int create_mbx(name)
- + char *name;
- + {short chan;
- + int prmflg,maxmsg,bufquo,promsk,acmode,iflag,retval;
- + struct dsc$descriptor lognam;
- + prmflg = 0;
- + maxmsg = mailbox_size;
- + bufquo = mailbox_byte_quota;
- + promsk = mailbox_protection_mask;
- + acmode = 0;
- + set_dsc_cst(&lognam,name);
- + retval = sys$crembx(prmflg,&chan,maxmsg,bufquo,promsk,acmode,&lognam);
- + if (retval != SS$_NORMAL) return(-1);
- + return(chan);}
-
- Index: vms/readme.1st
- *** vms/readme.1st.old 1994/05/19 01:11:32
- --- vms/readme.1st 1994/05/19 01:11:36
- ***************
- *** 0 ****
- --- 1,80 ----
- +
- + *******************************************************************************
- + ************************** README FOR VMS SYSTEMS ****************************
- + *******************************************************************************
- + May 12, 1994
- + Rick Flower
- + <flower@donald.sp.trw.com>
- + <flower@sdvax2.sp.trw.com>
- +
- +
- + This file documents the differences between C2MAN for Unix and C2MAN for VMS
- + systems. The are some requirements that must be met in order to run C2MAN for
- + VMS that are listed below. You **CAN** (or should be able to) run C2MAN on
- + VAX/AXP systems if you just install the GNU-CPP (see #1 below) since the
- + there is no GNU-CC that supports the AXP architecture yet.
- +
- + 1) You must either install a full GCC distribution OR install just the
- + CPP that is part of the standard CPP program! If you are unable to
- + install the entire GCC system, the CPP program can be compiled and
- + built very easily directly from the main GCC distribution on any
- + GNU Anonymous FTP site (such as prep.ai.mit.edu in /pub/gnu or
- + on gatekeeper.dec.com in /pub/GNU). There is a command file that
- + is part of the distribution that will make CPP.EXE using the
- + standard CC (Vax-C or DEC-C) that you have..
- +
- + 2) You will need BISON and FLEX which are also standard GNU tools that
- + can be made to run under VMS. If I recall correctly, FLEX will
- + once again compile right-out-of-the-box and can be retrieved from
- + any GNU site (see #1 above for examples). BISON on the other hand
- + appears to have some problems being built as of a while back.. I
- + highly suggest that you look on one of the VMS fileserv's or any
- + other VMS FTP site to find a copy of BISON for VMS.. The install
- + procedure that is part of the standard GNU source distribution seems
- + to be a bit broken.. I got my version of BISON from one of the
- + prebuilt GCC distributions available from DECUS (you might try on
- + nic.switch.ch in /mirror/vms/DECUS/vms93a/gccvms if you can't find
- + it elsewhere!).
- +
- + 3) Once you've got the above requirements met, go into the [.vms]
- + directory and edit the MAKE.COM and make any necessary changes to
- + the CC,CFLAGS,LFLAGS, and the OPTFILE statement to indicate whether
- + you are using GCC or plain VAX-C.. (DEC-C should work without too
- + much work!). Once the changes are complete, make sure that you are
- + in the [.C2MAN] directory and then invoke @[.VMS]MAKE to build it.
- + You should end up with a C2MAN.EXE after a short period of time..
- +
- + 4) Before you invoke C2MAN, MAKE ABSOLUTELY SURE THAT YOU'VE GOT A
- + SYMBOL SETUP CALLED "CPP" THAT WILL INVOKE THE GNU-CPP PROGRAM!!! If
- + you don't have a symbol setup, C2MAN will FAIL to run! You can set
- + a symbol for CPP using the following as an example :
- +
- + $ CPP == $GNU_CC:[000000]GCC-CPP.EXE
- +
- + Just change the drive / directory specification to point to where
- + you've got your CPP located. You can test whether or not CPP is
- + working by invoking CPP at the "$" and press return.. You won't see
- + anything happen until you press CTRL-Z and you get something like :
- +
- + $ CPP
- + *EXIT* (in reverse video!)
- + # 1 ""
- + $
- +
- + If you don't get that then you've not defined your CPP correctly..
- +
- + 5) When you go and use C2MAN options that are uppercase letters, you
- + **MUST** quote them otherwise DCL will automatically change them
- + into lowercase letters which will probably cause C2MAN to complain
- + about unrecognized options being specified on the command line!!!
- + In other words, the following two commands are *NOT* identical in
- + function :
- +
- + $ C2MAN -V
- + c2man: reading standard input
- +
- + and
- + $ C2MAN -"V"
- + c2man: Version 2, Patchlevel 27
- + c2man: reading standard input
- + c2man: running `cpp -"C" -"D__C2MAN__=2" "-"'
-
- Index: c2man.c
- Prereq: 2.0.1.29
- *** c2man.c.old 1994/01/07 07:04:56
- --- c2man.c 1994/05/19 01:16:02
- ***************
- *** 1,4 ****
- ! /* $Id: c2man.c,v 2.0.1.29 1994/01/07 07:04:56 greyham Exp $
- *
- * C Manual page generator.
- * Reads C source code and outputs manual pages.
- --- 1,4 ----
- ! /* $Id: c2man.c,v 2.0.1.31 1994/05/19 01:16:02 greyham Exp $
- *
- * C Manual page generator.
- * Reads C source code and outputs manual pages.
- ***************
- *** 81,86 ****
- --- 81,90 ----
- IncludeFile *first_include;
- static IncludeFile **last_next_include = &first_include;
-
- + /* list of excluded sections specified by user */
- + ExcludeSection *first_excluded_section;
- + static ExcludeSection **last_next_excluded_section = &first_excluded_section;
- +
- /* do we group related stuff into one file? */
- boolean group_together;
-
- ***************
- *** 295,304 ****
- fputs(" -n\t\tName output file after input source file\n", stderr);
- fputs(" -L\t\tLazy: Be silent about undocumented parameters\n",
- stderr);
- ! fputs(" -T n|l|t\tselect typesetting output format: nroff, LaTeX or TeXinfo\n",
- stderr);
- fputs(" -M name\tset name of the manual in which the page goes\n",
- stderr);
- fputc('\n', stderr);
- fputs(" -D name[=value]\n", stderr);
- fputs(" -U name\n", stderr);
- --- 299,313 ----
- fputs(" -n\t\tName output file after input source file\n", stderr);
- fputs(" -L\t\tLazy: Be silent about undocumented parameters\n",
- stderr);
- ! fputs(" -T n|l|t[,options]\tselect typesetting output format: nroff, LaTeX or TeXinfo\n",
- stderr);
- + nroff_output.print_options();
- + latex_output.print_options();
- + texinfo_output.print_options();
- +
- fputs(" -M name\tset name of the manual in which the page goes\n",
- stderr);
- + fputs(" -x section\texclude section from ouput\n", stderr);
- fputc('\n', stderr);
- fputs(" -D name[=value]\n", stderr);
- fputs(" -U name\n", stderr);
- ***************
- *** 597,602 ****
- --- 606,612 ----
- char *s, cbuf[2];
- const char *base_cpp_cmd;
- IncludeFile *includefile;
- + ExcludeSection *excludesection;
- char *cpp_opts;
- const char *default_section = "3";
- #ifdef HAS_LINK
- ***************
- *** 612,624 ****
- /* initialise CPP options with -D__C2MAN__ */
- cbuf[0] = VERSION + '0';
- cbuf[1] = '\0';
- ! cpp_opts = strconcat("-D__C2MAN__=", cbuf, NULLCP);
- #ifdef NeXT
- cpp_opts = strappend(cpp_opts, " -D_NEXT_SOURCE", NULLCP);
- ! #endif
-
- /* Scan command line options. */
- ! while ((c = getopt(argc, argv, "P:D:F:I:psU:Vvo:eM:H:G:gi:S:l:LT:nO:"))
- != EOF)
- {
- switch (c) {
- --- 622,639 ----
- /* initialise CPP options with -D__C2MAN__ */
- cbuf[0] = VERSION + '0';
- cbuf[1] = '\0';
- ! #ifdef VMS
- ! cpp_opts = strconcat("-\"D__C2MAN__=", cbuf, "\"",NULLCP);
- ! #else
- #ifdef NeXT
- cpp_opts = strappend(cpp_opts, " -D_NEXT_SOURCE", NULLCP);
- ! #else
- ! cpp_opts = strconcat("-D__C2MAN__=", cbuf, NULLCP);
- ! #endif /* !NeXT */
- ! #endif /* !VMS */
-
- /* Scan command line options. */
- ! while ((c = getopt(argc, argv, "P:D:F:I:psU:Vvo:eM:H:G:gi:x:S:l:LT:nO:"))
- != EOF)
- {
- switch (c) {
- ***************
- *** 718,723 ****
- --- 733,745 ----
- includefile->next = NULL;
- last_next_include = &includefile->next;
- break;
- + case 'x':
- + *last_next_excluded_section = excludesection =
- + (ExcludeSection *)safe_malloc(sizeof *excludesection);
- + excludesection->name = optarg;
- + excludesection->next = NULL;
- + last_next_excluded_section = &excludesection->next;
- + break;
- case 'S':
- manual_section = optarg;
- break;
- ***************
- *** 755,760 ****
- --- 777,789 ----
- break;
- default: usage();
- }
- + s = strtok(&optarg[1], ",");
- + if (s && ! *output->parse_option) usage();
- + while(s)
- + {
- + if (output->parse_option(s)) usage();
- + s = strtok(NULL, ",");
- + }
- break;
- case 'O':
- for (i = 0; i < _OBJECT_NUM; i++)
- ***************
- *** 834,839 ****
- --- 863,875 ----
- IncludeFile *next = includefile->next;
- free(includefile);
- includefile = next;
- + }
- +
- + for (excludesection = first_excluded_section; excludesection;)
- + {
- + ExcludeSection *next = excludesection->next;
- + free(excludesection);
- + excludesection = next;
- }
-
- for (i = 0; i < _OBJECT_NUM; i++)
-
- Index: pc/updmake
- *** pc/updmake.old 1994/05/16 01:58:19
- --- pc/updmake 1994/05/16 01:58:57
- ***************
- *** 0 ****
- --- 1,99 ----
- + #!/usr/local/bin/perl -w
- + # This script updates the MSDOS & OS/2 Makefile.pc automatically from the Unix
- + # one to minimise the possibility of me making a mistake.
- + # It's a gross hack, but it works.
- + open(MAKEFILE, "../Makefile") || die;
- + rename("Makefile.pc", "Makefile.old") || die;
- + open(PREVIOUS, "Makefile.old") || die;
- + open(OUTPUT, ">Makefile.pc") || die;
- +
- + # skip the header from the Unix Makefile.
- + do { $_ = <MAKEFILE>; } until m/^SHELL=/o;
- +
- + # retain the previous header from the PC Makefile.
- + while (<PREVIOUS>)
- + {
- + print OUTPUT;
- + last if /# DO NOT EDIT/;
- + }
- +
- + while (<MAKEFILE>)
- + {
- + if ($_ eq "MAKE=make\n")
- + {
- + while (<MAKEFILE>)
- + {
- + last unless $_ eq "\n";
- + }
- + }
- +
- + next if /chmod/o;
- + s/\.o(\W)/\$O\1/go;
- + s/\.o$/\$O/o;
- + s/c2man([^.])/c2man.exe\1/ if (/:/ || /cp /);
- + s/^(install:) all$/\1/;
- + if (/\$\(LEX\) (.*)/)
- + {
- + print OUTPUT "\t\$(LEX) -t $1 > \$@";
- + print OUTPUT "\n";
- + $_ = "\tcp \$@ lex_yy.c\n";
- + }
- + print OUTPUT;
- + print OUTPUT "\t\$(BIND)\n" if (/\$\(LDFLAGS\) /);
- + last if m/^# y.tab.c dependancies/o;
- + }
- +
- + # output dependancies grouped into lines.
- + sub output_depend
- + {
- + return if $current eq "";
- +
- + $chars = length($current) + 1;
- + $current =~ s/\.o$/\$O/o;
- + print OUTPUT $current, ":";
- + foreach $file (@depends)
- + {
- + $chars += 1 + length($file);
- + if ($chars > 77)
- + {
- + print OUTPUT "\\\n\t";
- + $chars = 8 + length($file);
- + }
- + else
- + {
- + print OUTPUT " ";
- + }
- + print OUTPUT $file;
- + }
- + print OUTPUT "\n\n";
- + $current = "";
- + undef @depends;
- + }
- +
- + # process the dependancies a bit.
- + $current = "";
- + undef @depends;
- + while (<MAKEFILE>)
- + {
- + if (m/^#/ || $_ eq "\n")
- + {
- + &output_depend;
- + print OUTPUT;
- + next;
- + }
- +
- + # have we found a dependancy?
- + if (($obj,$dep) = m/^(.*):\s*(.*)/)
- + {
- + next if ($dep =~ m!^/!); # ignore /usr/include
- + if ($obj ne $current)
- + {
- + &output_depend;
- + $current = $obj;
- + }
- + $dep =~ s!^\./!!;
- + push(@depends, $dep);
- + }
- + }
- +
- + close OUTPUT || die;
-
- *** End of Patch 29 ***
- --
- Graham Stoney, Hardware/Software Engineer
- Canon Information Systems Research Australia
- Ph: + 61 2 805 2909 Fax: + 61 2 805 2929
-
- exit 0 # Just in case...
-