Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!rutgers!sri-spam!ames!ucbcad!ucbvax!DGOGWD01.BITNET!GWD21T From: GWD21T@DGOGWD01.BITNET.UUCP Newsgroups: mod.computers.vax Subject: generating definitions files for VAX C Message-ID: <8703232240.AA21678@ucbvax.Berkeley.EDU> Date: Mon, 23-Mar-87 17:40:28 EST Article-I.D.: ucbvax.8703232240.AA21678 Posted: Mon Mar 23 17:40:28 1987 Date-Received: Wed, 25-Mar-87 01:02:45 EST Sender: daemon@ucbvax.BERKELEY.EDU Distribution: world Organization: The ARPA Internet Lines: 76 Approved: info-vax@sri-kl.arpa Since the question "how can I generate .H files from VMS defintions" has been asked so often, here's the definite command procedure to do it. Call it C_DEFS.COM and invoke it by $ C_DEFS PCBDEF ! e.g. to obtain PCBDEF.H . It will handle all "standard" VMS definitions starting with "$DEFINI xxx,..." and define the same symbols that a macro programmer has available (no structures, of course). >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> cut here >>>>>>>>>>>>>>>>>>>>>>>>>>>>>> $! drive generation of C #define header file from MACRO definitions $! $! input: $'p1' in SYS$LIBRARY: STARLET or LIB .MLB $! output: []'p1'.H $! $ set noon $ open/write C_DEFS_MAR []C_DEFS.TMP $ write C_DEFS_MAR " .print;/*" $ write C_DEFS_MAR " .print; * definitions created by C_DEFS at ''f$time()'" $ write C_DEFS_MAR " .print; */" $ write C_DEFS_MAR " $''p1'" $ write C_DEFS_MAR " .print;/*" $ write C_DEFS_MAR " .print; * end of C_DEFS definitions" $ write C_DEFS_MAR " .print; */" $ write C_DEFS_MAR " .end" $ close C_DEFS_MAR $! $ define/user SYS$ERROR 'p1'.H !! MACRO puts .PRINT output here !! $ macro/nolist/noobject SYS$INPUT+SYS$LIBRARY:LIB/LIB+SYS$DISK:[]C_DEFS.TMP .MACRO $GBLINI GBL .MACRO $DEF SYM,ALLOC,SIZ .if NB,SYM SYM: .irp $$$,<\SYM> print;#define SYM $$$ .endm .endc .IIF NB,ALLOC, ALLOC SIZ .ENDM $DEF .MACRO $EQU SYM,VAL SYM=VAL .irp $$$,<\SYM> print;#define SYM $$$ .endm .ENDM $EQU .MACRO $VIELD1 MOD,SEP,SYM,SIZ,MSK SIZ...=1 .IIF NB,SIZ, SIZ...=SIZ .IF NB,SYM MOD'SEP'V_'SYM=BIT... .irp $$$,<\MOD'SEP'V_'SYM> print;#define MOD'SEP'V_'SYM $$$ .endm .if nb,siz MOD'SEP'S_'SYM=SIZ .irp $$$,<\MOD'SEP'S_'SYM> print;#define MOD'SEP'S_'SYM $$$ .endm .endc .if nb,msk MOD'SEP'M_'SYM=<<<1@SIZ...>-1>@BIT...> .irp $$$,<\MOD'SEP'M_'SYM> print;#define MOD'SEP'M_'SYM $$$ .endm .endc .ENDC BIT...=BIT...+SIZ... .ENDM $VIELD1 .ENDM $GBLINI $ xstat=$status $! $ delete []C_DEFS.TMP; $ exit xstat >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> cut here >>>>>>>>>>>>>>>>>>>>>>>>>>>>>> W.J.Moeller, GWDG, D-3400 Goettingen, F.R.Germany Phone +49 551 201516