5F~ IMAKE.SAVs[ IMAKE.SAV#BACKUP/LOG [...]*.*; IMAKE.SAV/SAVE JAMISON @Mu V5.5 _OPNDCE::  _$2$DIA23: V5.5-2 ~ 6*[IMAKE]BINARY.DIR;1+,V./@ 4-R0123 KPWO56`Z7 89G@HJICPP.EXEV IMAKE.EXE#W! IMAKE.RULES%W IMAKE.TMPL&WMAKEDEPEND.EXEkW+MAKEINCLUDE.COMY SITE.DEFZVMS.CFkZ*[IMAKE.BINARY]CPP.EXE;1+,V.0/@ 40,-V0123 KPWO,56vXc7'L^89G@HJV0D`0205XchBCPPV1.0CXc05-13  ! @ * ? ! VAXCRTL_001! LIBRTL_001O! MTHRTL_001vaxvmsvax11c__LINE____FILE__-rat=crrfm=varmrs=4096Can't open output file "%s"-rCan't open input file "%s"Inside #ifdef block at end of input, depth = %d%d errors in preprocessor %d error in preprocessor #%s %d "%s"lineassertdefineelifelseendifififdefifndefincludelinepragmaundefControl line "%s" within macro expansion#%s may not follow #elseToo many nested #%s statements#%s must be in an #ifPreprocessor assertion failure#pragma Illegal # command "%s"Unexpected text in #control line ignored#if, #ifdef, or #ifndef without an argument.HCannot open include file "%s"#include syntax errorFilename work buffer overflow%s%srC$LIBRARYC$LIBRARY:SYS$LIBRARY:1Too many include directories-S, too few values specified in %s-S, too many values, "%s" unused"%s" wasn't definedUnknown option "%s"The following options are valid: -C Write source file comments to output -Dsymbol=value Define a symbol with the given (optional) value -Idirectory Add a directory to the #include search list -N Don't predefine target-specific names -Stext Specify sizes for #if sizeof -Usymbol Undefine symbol Too many file arguments. Usage: cpp [input [output]]1__DATE__rarat=crrfm=varToo many arguments for macroStrange character after # (%d.)Redefining defined variable "%s"#define syntax errorIllegal #undef argumentMacro work area overflowMacro work area overflowRecursive macro definition of "%s"(Defined by "%s") %d"%s"Bug: Illegal __ macro "%s"Macro "%s" needs argumentsWrong number of macro arguments for "%s"Too many arguments in macro expansionend of file within macro argumentOut of space in macro "%s" arg expansionend of expressionvalid+-*/%<<>>&|^==!=<<=>=>&&||?:,unary +unary -~!()(none)charintfloatdoubleshortlongsignedunsignedmisplaced constant in #if#if value stack overflowIllegal #if lineOperator %s in incorrect contextexpression stack overflow at op "%s"unbalanced paren's, op is "%s"Misplaced '?' or ':', previous operator is %sillegal character '%c' in #ifillegal character (%d decimal) in #ifCan't use a string in an #ifdefinedBad #if ... defined() syntaxsizeof!=<>&|\= not allowed in #ifUnexpected \ in #if#if sizeof, unknown type "%s"#if ... sizeof: illegal type combination#if sizeof() error, no type specified#if ... sizeof: bug, unknown type code 0x%x#if ... sizeof() syntax errormulti-byte constant '%c' isn't portable%s by zero in #if, zero result assumedmoddivide#if bug, operand = %d.work buffer overflow doing %s #%s%sStrange character '%c' after #Strange character (%d.) after #Unterminated stringIllegal digit in octal numberWork buffer overflow: %sOut of memoryEOF in commentToo much pushback%sline %d, %s: cpp: %sfrom macro %s from file %s, line %d: %sSErrorIErrorSFatal errorSWarningIWarning  aaiiiYYA99IIQQQQ1)!!ppppx    % , 2 @7 > <1// ECCCA AB D  <^>SU>TݬݬPݬݬP1?Pߣ!ЬRݢ/>Peߣ2ߣ*ߣ#ݢ>PRR @>P`P ~R=P$ЬRݢ>ݢߣ;G;,=ߣWЬRݢ=PEdߣYݢ=P ݢ=ݢߣ[:,=ЬRݢe=edq= P,_=edmyoPPcR Rߣv:V=+==R3RRRæRR/== ,<ݏ<2P ^Y6WXVZT<U@[g e <<RբLТSS\Т\\SkRRS5<P&k k <S1PkS/<ݥ '< <RP4P\LdCP4P\LdC\ RP\#gRPRShfSSg\f q)R\1 SգR1g e v;];SգNУ\\PPУPP\kSS\ ;P&k k:\0Pk\;e :Re :R6Pr3S\cPRBdC\cPRBdCR1R 1\ e :R)PRBd j)PR1R 1BdSmSPP>.?PPAOPA3Aj?Pej:1FPjR],12PVRe+1PR1eR91PR 1e 9Rբ11P^Ѭ9ݬ9 ^RS9 f9M9\լNЬPPQPЬQQ\cPP\8P&c c8\s.Pc\89 8 ^VZY[8X&P PPˏ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G, J/Pgh/h*eP\g\\ h\\\PP C PB?PP*P*@."?PƾQ~Q"ϒiPP\\*1qP\\/1_kg\ h\ \\ 1\\\2\\LɴC1b\ Pg11P`S\WPP  1~U2eReRT~T0,U ų\PS S  SSPP ^SRb\b\P~P0b, e^9RݬPPݬ^PaPP^UWЬRgScbSݬ ݬgc ݬ ݬgcg Z爐Rբ/SSg0SP@c  g Т RcVPբݢgf@TTݢТPPSТSSgfT|P@d  g Т RP^Rݬݬ"P^Rݬݬ)ϹsP^Rݬݬ0ϕ,(P^uRݬݬ=m^YRݬݬFQ@@"d|tl LDt 4\<|t40 8 , t ~ @VAXCRTLLIBRTLMTHRTL~~~~~*[IMAKE.BINARY]IMAKE.EXE;1+,#W!./@ 4-V0123 KPWO56`Z2Wc7S^89G@HJ 0D`02051Wc2hIMAKEV1.0Z1Wc05-13    ? ! VAXCRTL_001! LIBRTL_001O! MTHRTL_001cpp-I.-Dvms-Dvaxcppmmssys$scratch:imake_Imf.tmp;sys$scratch:imake_IIf.tmp;sys$scratch:imake_Icp.tmp;Makefile.mmsImake.tmpl-fMAKE=%sMAKEFILE=%sCannot convert cpp/make arg's to VMS-style.Cannot write stdout.Signal %d.IMAKEINCLUDEEnvironment var IMAKEINCLUDE %s must begin with -IIMAKECPPIMAKEMAKEOut of internal storage.Out of internal storage.imakeNo description arg after -f flag No description arg after -T flag Cannot open %s.ImakefileimakefileNo description file.imakefileImakefile.%s: imakeErrno value returned '%d' Stop. %s wbmrs = 1024Cannot create temporary file %s.#define IMAKE_TEMPLATE "%s" #define INCLUDE_IMAKEFILE "%s" #include IMAKE_TEMPLATE %s Unable to spawn C pre-processor, VMS err %%x%xC pre-processor returned VMS err %%x%x .wCannot create temporary file %s.FILE ORGANIZATION sequential RECORD FORMAT stream_lf CONVRT/FDL=SYS$INPUT: %s %sUnable to spawn Convert utility, VMS err %%x%xConvert utility returned VMS err %%x%x .r+Cannot open temporary cpp file %s.%s Unable to spawn MMS, VMS err %%x%x .MMS returned VMS err %%x%x .Cannot open %s for input.Cannot read all of %s:includedefineundefifdefifndefelseendififwCannot open %s for write. /**/-D/DEFINE=(-D/DEFINE=)/DEFINE=)-I/INCLUDE=(-I/INCLUDE=)/INCLUDE=)line cannot read %s w+# Makefile generated by imake - do not edit! # %s $XConsortium: imake.c,v 1.51 89/12/12 12:37:30 jim Exp $## The cpp used on this machine replaces all newlines and multiple tabs and# spaces in a macro expansion with a single space. Imake tries to compensate# for this, but is not always successful.#%s Cannot write to %s.Cannot allocate %d bytes /MACRO=(/ignore=error/noaction/descrip=Unknown '-' qualifier for make utility.MAKEFILE=MAKEFILE="%s"="%s",MAKEFILE=MAKEFILE=MAKE=MAKE="%s"="%s",MAKE=MAKE= /MACRO=)/MACRO=)LNM$FILE_DEV!omzR7^;[VZRXW_SSݬݬ"k= Pk< 4…Yhf1Z=UVTK ghhgTUg1gfPfY@jfP@jYhf1Z=UVTK ghhgyTUgl1g_:fPfY@jfP@j ˆ6Yhf1Z=UVTK ghhgTUg1gfPfY@jfP@jkYhf1Z=UVTK g|hhgiTUg\1gO*fPfY@jfP@jjW P œ^ݮ L P  P^UWTV|~ެScc<~^PR+dRKc<~3PRRbSRS g4,gRSg1gP^ rsP ^STUhRdPЬQPWQVK eDdde1VWe$1e^%XSYHR[ZVc\Li cc\Lih\Lhh\L߭P1Э\l-\lIZUTK j^kkjKTUj>1j1 ЭWkh1ZWUpTK jkkjTUj1jh\hWLh\L1UЭ\l v\P\`ЭWkh1JWTp\; jek kje\Tje1jeh\hWLOh\LE֭1v߭*RPЭ߭3:PЭP<P ^S Rc1V=#cPcЬ@P@} ^SRc1pWcPcЬ@eP@Y^ITYsR8X5[kq׬լ1xZPЬV-1fSWWD*SUkd1 pWjdPdU@hdP@h1PWI*SUkd1 pWjdPdU@hdP@h1WPWf6 SM1>P׬Vլ ™wjм(1WsJ-QPSQQ PѬ-׬Vм1PWeQSQQ1WT6 S1P׬Vլ ¼šjм\jPWv [Yki1 V=jiPiS@YiP@O-fSki1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3[dRSUk1pWokTkUDkP@Uk1pW7kTkUDkP@ެnоUeߣ(0!VXFeT1_-U"W ZHYXTߣ(eX1Pd-{TdPPfN^^*^.^^>^^^***>PJ?P1ߣ(e1Pߣ(e1Pߣ(eX1=1P*gPT jP*IgTP~?4ie_PYgPTSjP*pgTP~j_iePvߣ(eTߣ(exߣ(eVFT1P)@ƒPzPߣ(ޣ(2P^STÌ ÍݬCPЬԭޭ>Ȱ̰Ξ(>ԭ؟쟭P22P@(2PPPPR(RRPP@@ |l$t$l<|DtLD, , 8 t 0 @VAXCRTLLIBRTLMTHRTL0000*[IMAKE.BINARY]IMAKE.RULES;1+,%W.p/@ 4bpn-V0123KPWOo56'7j[^89G@HJ /* Imake.rules ** Imake Rules file */ /* Copyright (c) Digital Equipment Corporation, 1991 ** All Rights Reserved. Unpublished rights reserved ** under the copyright laws of the United States. ** ** The software contained on this media is proprietary ** to and embodies the confidential technology of ** Digital Equipment Corporation. Possession, use, ** duplication or dissemination of the software and ** media is authorized only pursuant to a valid written ** license from Digital Equipment Corporation. ** ** RESTRICTED RIGHTS LEGEND Use, duplication, or ** disclosure by the U.S. Government is subject to ** restrictions as set forth in Subparagraph (c)(1)(ii) ** of DFARS 252.227-7013, or in FAR 52.227-19, as ** applicable. ** ** FACILITY: ** ** Customized Imake for Portable DTM effort ** ** ABSTRACT: ** ** This file contains the high-level rules used to specify ** target creation of various build-able objects. This file ** works closely with Imake.tmpl and the platform specific ** definition files (vms.cf & ultrix.cf). ** ** AUTHORS: ** ** Kenneth B. Miller ** ** ** CREATION DATE: 19 November 1990 ** **/ /* * Warning, when defining rules: make sure you don't include both a trailing * backslash and double ampersand backslash or else you will get an extra * backslash in the Makefile. Also, don't forget to do both the Ultrix * and VMS equivalent (make & mms). * * These macros are defined for the various templates and Imakefiles (for * a list of the applicable make variables, see the template files): * * NormalLibraryTarget (lib,objlist) * SimpleProgramTarget (program) * ProgramTarget (program,objlist) * ComplexProgramTarget (program) * LibProgramTarget (program,lib) * DWProgramTarget (program) * XMProgramTarget (program) * XM2ProgramTarget (program,lib) * CCRProgramTarget (program) * XTrapProgramTarget (program) * XDtProgramTarget (program) * XDtUiProgTarget (program,obj1) * DmObjectTarget (object) * DmProgramTarget (program,objlist,liblist,libdepends) * DmDCLTarget (includefile, table) * UiProgramTarget (program,object,object2) * TmServerProgramTarget (program) * IDLTarget (idlsrc) * LEXTarget (lexsrc) * TILTarget (tilobj,options,tilsrc) * TmTestProgram (program,objlist) * CiProgramTarget (program,objlist) * TestProgramTarget (program,objlist) * SimpleTestProgramTarget (program) * TestModuleTarget (module) * CatFileTarget (msg_file,src_files) * HelpFileTarget (hlp_file) * RunoffHelpTarget (rnh_file) * MessageFileTarget (msg_file) * HeaderFileTarget (sdl_file) * SaberProgramTarget (program,etc.) * RemoveTargetProgram (program) * FetchListTarget (filelist) * ScaLibraryTarget (directory,scalist) * ScaHelpTarget (directory,module) * ScaLseTarget (directory,module) * ScaInternalsTarget (directory,module) * DependDependency () * RegDependTarget (component,modulelist) * DependTarget (component) * CleanTarget (target) * CleanAllTarget (list) * InstallTarget (target,dest) * TagsTarget () * BuildMakefileTarget (imakefile,imakeflags) * MakefileTarget () * AllTarget (depends) * LinkSourceFile (src,dir) * LinkFileList (step,list,sub) * FirstListTarget (firstlist) * InstallManPageLong (file,destdir,dest) * InstallManPage (file,dest) * BuildIncludeFileTarget (component) * * * The general linking for building programs is: * * program-objects programlibs syslibs EXTRA_LIBRARIES systemlibs\ * EXTRA_LOAD_FLAGS * * where programlibs is LOCAL_LIBRARIES for ComplexProgramTarget * and EXTRA comes with syslibs from the LDLIBS */ /* * NormalLibraryTarget - generate rules to create a library. */ #ifndef NormalLibraryTarget #ifndef vms #define NormalLibraryTarget(libname,objlist) @@\ AllTarget(lib#libname.$(LIB)) @@\ @@\ lib#libname.$(LIB): objlist @@\ $(RM) $@ @@\ $(AR) $@ objlist @@\ $(RANLIB) $@ @@\ @@\ clean:: @@\ $(RM) lib#libname.$(LIB) #else /* vms */ #define NormalLibraryTarget(libname,objlist) @@\ AllTarget(lib#libname.$(LIB)) @@\ @@\ lib#libname.$(LIB): lib#libname.$(LIB)(objlist) @@\ continue #endif /* vms */ #endif /* NormalLibraryTarget */ /* * XTrapLibraryTarget - generate rules to create a library. */ #ifndef XTrapLibraryTarget #ifndef vms #define XTrapLibraryTarget(libname,objlist) @@\ AllTarget(lib#libname.$(LIB)) @@\ @@\ lib#libname.$(LIB): objlist @@\ $(RM) $@ @@\ $(AR) $@ objlist @@\ $(RANLIB) $@ @@\ @@\ clean:: @@\ $(RM) lib#libname.$(LIB) #else /* vms */ #define XTrapLibraryTarget(libname,objlist) @@\ AllTarget(decw$#libname#libshr.exe) @@\ @@\ lib#libname.$(LIB): lib#libname.$(LIB)(objlist) @@\ continue @@\ decw$#libname#libshr.exe: lib#libname.$(LIB) lib#libname.opt @@\ RemoveTargetProgram($@) @@\ $(LINK) /exe='f$parse("$@")' /SHARE/NOTRACE/NOMAP\ @@\ $(LDOPTIONS) $(EXTRA_LOAD_FLAGS)\ @@\ lib#libname.$(LIB)/lib/inc=lib#libname#xfer,\ @@\ lib#libname.opt/opt @@\ @@\ map:: @@\ $(LINK) /exe=_NL:/map=decw$#libname#libshr.map/full $(LDOPTIONS)\ @@\ $(EXTRA_LOAD_FLAGS)\ @@\ lib#libname.$(LIB)/lib/inc=lib#libname#xfer,\ @@\ lib#libname.opt/opt @@\ @@\ clean:: @@\ $(RM) lib#libname.$(LIB) @@\ $(RM) decw$#libname#libshr.exe #endif /* vms */ #endif /* XTrapLibraryTarget */ /* * SimpleProgramTarget - generate rules to make target from a single * object. */ #ifndef SimpleProgramTarget #ifndef vms #define SimpleProgramTarget(program) @@\ program#$(EXE): program.$(OBJ) @@\ RemoveTargetProgram($@) @@\ $(CC) -o $@ program.$(OBJ) $(LDOPTIONS) $(EXTRA_LOAD_FLAGS) @@\ @@\ map:: @@\ $(CC) -o /dev/null -m >program.map\ @@\ program.$(OBJ) $(LDOPTIONS) $(EXTRA_LOAD_FLAGS) @@\ @@\ clean:: @@\ RemoveTargetProgram(program#$(EXE)) #else /* vms */ #define SimpleProgramTarget(program) @@\ program#$(EXE): program.$(OBJ) @@\ @- imaketmp := $(OPTIONFILE) @@\ @- if imaketmp .NES. "" then - @@\ if f$search(f$parse(imaketmp)) .eqs. "" then - @@\ echo "WARNING!!! First Type: Make opt" @@\ RemoveTargetProgram($@) @@\ $(LINK) /exe='f$parse("$@")' $(LDOPTIONS) \ @@\ $(EXTRA_LOAD_FLAGS) program.$(OBJ)\ @@\ $(VMSOPTIONLINK) @@\ @@\ map:: @@\ $(LINK) /exe=_NL:/map=program.map/full $(LDOPTIONS)\ @@\ $(EXTRA_LOAD_FLAGS) program.$(OBJ)\ @@\ $(VMSOPTIONLINK) @@\ @@\ clean:: @@\ RemoveTargetProgram(program#$(EXE)) #endif /* vms */ #endif /* SimpleProgramTarget */ /* Take a program name and a list of object modules, build them, and link * tham all together. Not too tough. */ #ifndef ProgramTarget #ifndef vms #define ProgramTarget(program,objlist) @@\ /* Program target not implemented for ultrix */ #else /* vms */ #define ProgramTarget(program,objlist) @@\ program#$(EXE): objlist $(OPTIONFILE) @@\ @- imaketmp := $(OPTIONFILE) @@\ @- if imaketmp .NES. "" then - @@\ if f$search(f$parse(imaketmp)) .eqs. "" then - @@\ echo "WARNING!!! First Type: Make opt" @@\ RemoveTargetProgram($@) @@\ $(LINK) /exe='f$parse("$@")' $(LDOPTIONS)\ @@\ $(EXTRA_LOAD_FLAGS) objlist \ @@\ $(VMSOPTIONLINK) @@\ @@\ map:: @@\ $(LINK) /exe=_NL:/map=program.map/full $(LDOPTIONS)\ @@\ $(EXTRA_LOAD_FLAGS) objlist \ @@\ $(VMSOPTIONLINK) @@\ @@\ clean:: @@\ RemoveTargetProgram(program#$(EXE)) #endif /* vms */ #endif /* ProgramTarget */ #ifndef VMSOptionFile #ifndef vms #define VMSOptionFile( program) @@\ /* Program target not implemented for ultrix */ #else /* vms */ #define VMSOptionFile(program) @@\ opt:: vmsoptfile linkoptions @@\ @- echo "Created VMS Options file - program.opt" @@\ @@\ vmsoptfile:: @@\ @- imaketmp := program.opt @@\ @- copy/nolog/overlay _NL: 'imaketmp' #endif /* vms */ #endif /* VMSOptionFile */ #ifndef VMSLinkOption #ifndef vms #define VMSLinkOption(program,linkoption) @@\ /* Program target not implemented for ultrix */ #else /* vms */ #define VMSLinkOption(program,linkoption) @@\ linkoptions:: @@\ @- optfile :== program.opt @@\ @- open/append optfd 'optfile' @@\ @- write optfd linkoption @@\ @- close optfd #endif /* vms */ #endif /* VMSLinkOption */ /* * Take a program name, the *main.c and the *struc.c from uigen, and * an object library of UI files and link them all together. */ /* * ComplexProgramTarget - generate rules for compiling and linking the * program specified by $(OBJS) and $(SRCS), installing the program and its * man page, and generating dependencies. It should only be used in * Imakefiles that describe a single program. */ #ifndef ComplexProgramTarget #ifndef vms #define ComplexProgramTarget(program) @@\ PROGRAM = program @@\ @@\ AllTarget(program) @@\ @@\ program#$(EXE): $(OBJS) $(DEPLIBS) @@\ RemoveTargetProgram($@) @@\ $(CC) -o $@ $(OBJS) $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) $(EXTRA_LOAD_FLAGS) @@\ @@\ DependTarget(program) @@\ @@\ map:: @@\ $(CC) -o /dev/null -m >program.map\ @@\ $(OBJS) $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) $(EXTRA_LOAD_FLAGS) @@\ @@\ clean:: @@\ RemoveTargetProgram(program#$(EXE)) #else /* vms */ #define ComplexProgramTarget(program) @@\ PROGRAM = program#$(EXE) @@\ @@\ AllTarget(program#$(EXE)) @@\ @@\ program#$(EXE): $(OBJS) $(DEPLIBS) @@\ RemoveTargetProgram($@) @@\ $(LINK) /exe='f$parse("$@")' $(OBJS)\ @@\ $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) $(EXTRA_LOAD_FLAGS) @@\ @@\ DependTarget(program) @@\ @@\ map:: @@\ $(LINK) /exe=_NL:/map=program.map/full $(OBJS)\ @@\ $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) $(EXTRA_LOAD_FLAGS) @@\ @@\ clean:: @@\ RemoveTargetProgram(program#$(EXE)) #endif /* vms */ #endif /* ComplexProgramTarget */ /* * LibProgramTarget - generate rules to make target from a single * object and one object library. */ #ifndef LibProgramTarget #ifndef vms #define LibProgramTarget(program,library) @@\ program#$(EXE): program.$(OBJ) lib#library.$(LIB) @@\ RemoveTargetProgram($@) @@\ $(CC) -o $@ program.$(OBJ) lib#library.$(LIB)\ @@\ $(LDOPTIONS) $(EXTRA_LOAD_FLAGS) @@\ @@\ map:: @@\ $(CC) -o /dev/null -m >program.map\ @@\ program.$(OBJ) lib#library.$(LIB)\ @@\ $(LDOPTIONS) $(EXTRA_LOAD_FLAGS) @@\ @@\ clean:: @@\ RemoveTargetProgram(program#$(EXE)) #else /* vms */ #define LibProgramTarget(program,library) @@\ program#$(EXE): program.$(OBJ) lib#library.$(LIB) @@\ RemoveTargetProgram($@) @@\ $(LINK) /exe='f$parse("$@")' $(LDOPTIONS)\ @@\ $(EXTRA_LOAD_FLAGS) program.$(OBJ),\ @@\ lib#library.$(LIB)/lib @@\ @@\ map:: @@\ $(LINK) /exe=_NL:/map=program.map/full $(LDOPTIONS)\ @@\ $(EXTRA_LOAD_FLAGS) program.$(OBJ),\ @@\ lib#library.$(LIB)/lib @@\ @@\ clean:: @@\ RemoveTargetProgram(program#$(EXE)) #endif /* vms */ #endif /* LibProgramTarget */ /* * DWProgramTarget - generate rules to make a DECwindows target from a single * object. */ #ifndef DWProgramTarget #ifndef vms #define DWProgramTarget(program) @@\ program#$(EXE): program.$(OBJ) @@\ RemoveTargetProgram($@) @@\ $(CC) -o $@ program.$(OBJ) $(LDOPTIONS)\ @@\ $(EXTRA_LOAD_FLAGS) -lXt -lX11 @@\ @@\ map:: @@\ $(CC) -o /dev/null -m >program.map\ @@\ program.$(OBJ) $(LDOPTIONS)\ @@\ $(EXTRA_LOAD_FLAGS) -lXt -lX11 @@\ @@\ clean:: @@\ RemoveTargetProgram(program#$(EXE)) #else /* vms */ #define DWProgramTarget(program) @@\ program#$(EXE): program.$(OBJ) @@\ RemoveTargetProgram($@) @@\ imaketmp:=sys$scratch:imake_tmp.opt @@\ open/write imaketmp 'imaketmp' @@\ write imaketmp "sys$share:decw$dwtlibshr.exe/share" @@\ write imaketmp "sys$share:decw$xlibshr.exe/share" @@\ close imaketmp @@\ $(LINK) /exe='f$parse("$@")' $(LDOPTIONS)\ @@\ $(EXTRA_LOAD_FLAGS) program.$(OBJ), 'f$search(imaketmp)'/opt @@\ - $(RM)/nolog 'imaketmp'; @@\ @@\ map:: @@\ imaketmp:=sys$scratch:imake_tmp.opt @@\ open/write imaketmp 'imaketmp' @@\ write imaketmp "sys$share:decw$dwtlibshr.exe/share" @@\ write imaketmp "sys$share:decw$xlibshr.exe/share" @@\ close imaketmp @@\ $(LINK) /exe=_NL:/map=program.map/full $(LDOPTIONS)\ @@\ $(EXTRA_LOAD_FLAGS) program.$(OBJ), 'f$search(imaketmp)'/opt @@\ - $(RM)/nolog 'imaketmp'; @@\ @@\ clean:: @@\ RemoveTargetProgram(program#$(EXE)) #endif /* vms */ #endif /* DWProgramTarget */ /* * XMProgramTarget - generate rules to make a X Motif target from a single * object. */ #ifndef XMProgramTarget #ifndef vms #define XMProgramTarget(program) @@\ program#$(EXE): program.$(OBJ) @@\ RemoveTargetProgram($@) @@\ $(CC) -o $@ program.$(OBJ) $(LDOPTIONS)\ @@\ $(EXTRA_LOAD_FLAGS) $(MOTIFLIBS) $(LOCAL_LIBRARIES)\ @@\ $(SYS_LIBRARIES) @@\ @@\ map:: @@\ $(CC) -o /dev/null -m >program.map\ @@\ program.$(OBJ) $(LDOPTIONS)\ @@\ $(EXTRA_LOAD_FLAGS) $(MOTIFLIBS) $(LOCAL_LIBRARIES)\ @@\ $(SYS_LIBRARIES) @@\ @@\ @@\ clean:: @@\ RemoveTargetProgram(program#$(EXE)) #else /* vms */ #define XMProgramTarget(program) @@\ program#$(EXE): program.$(OBJ) @@\ RemoveTargetProgram($@) @@\ imaketmp:=sys$scratch:imake_tmp.opt @@\ open/write imaketmp 'imaketmp' @@\ write imaketmp "sys$share:decw$dwtlibshr.exe/share" @@\ write imaketmp "sys$share:decw$dxmlibshr.exe/share" @@\ write imaketmp "sys$share:decw$xlibshr.exe/share" @@\ close imaketmp @@\ $(LINK) /exe='f$parse("$@")' $(LDOPTIONS)\ @@\ $(EXTRA_LOAD_FLAGS) program.$(OBJ),\ @@\ $(LOCAL_LIBRARIES), 'f$search(imaketmp)'/opt @@\ - $(RM)/nolog 'imaketmp'; @@\ @@\ map:: @@\ imaketmp:=sys$scratch:imake_tmp.opt @@\ open/write imaketmp 'imaketmp' @@\ write imaketmp "sys$share:decw$dwtlibshr.exe/share" @@\ write imaketmp "sys$share:decw$xlibshr.exe/share" @@\ close imaketmp @@\ $(LINK) /exe=_NL:/map=program.map/full $(LDOPTIONS)\ @@\ $(EXTRA_LOAD_FLAGS) program.$(OBJ),\ @@\ $(LOCAL_LIBRARIES), 'f$search(imaketmp)'/opt @@\ - $(RM)/nolog 'imaketmp'; @@\ @@\ clean:: @@\ RemoveTargetProgram(program#$(EXE)) #endif /* vms */ #endif /* XMProgramTarget */ /* * XM2ProgramTarget - generate rules to make a X Motif target from a single * object and a library. */ #ifndef XM2ProgramTarget #ifndef vms #define XM2ProgramTarget(program,library) @@\ program#$(EXE): program.$(OBJ) lib#library.a @@\ RemoveTargetProgram($@) @@\ $(CC) -o $@ program.$(OBJ) $(LDOPTIONS) lib#library.a\ @@\ $(EXTRA_LOAD_FLAGS) $(MOTIFLIBS) $(LOCAL_LIBRARIES)\ @@\ $(SYS_LIBRARIES) @@\ @@\ map:: @@\ $(CC) -o /dev/null -m >program.map\ @@\ program.$(OBJ) $(LDOPTIONS) lib#library.a\ @@\ $(EXTRA_LOAD_FLAGS) $(MOTIFLIBS) $(LOCAL_LIBRARIES)\ @@\ $(SYS_LIBRARIES) @@\ @@\ @@\ clean:: @@!\ RemoveTargetProgram(program#$(EXE)) #else /* vms */ #define XM2ProgramTarget(program, library) @@\ program#$(EXE): program.$(OBJ) lib#library.olb @@\ RemoveTargetProgram($@) @@\ imaketmp:=sys$scratch:imake_tmp.opt @@\ open/write imaketmp 'imaketmp' @@\ write imaketmp "sys$share:decw$dwtlibshr.exe/share" @@\ write imaketmp "sys$share:decw$dxmlibshr.exe/share" @@\ write imaketmp "sys$share:decw$xlibshr.exe/share" @@\ close imaketmp @@\ $(LINK) /exe='f$parse("$@")' $(LDOPTIONS)\ @@\ $(EXTRA_LOAD_FLAGS) program.$(OBJ),\ @@\ lib#library.olb/lib, $(LOCAL_LIBRARIES),\ @@\ 'f$search(imaketmp)'/opt @@\ - $(RM)/nolog 'imaketmp'; @@\ @@\ map:: @@\ imaketmp:=sys$scratch:imake_tmp.opt @@\ open/write imaketmp 'imaketmp' @@\ write imaketmp "sys$share:decw$dwtlibshr.exe/share" @@\ write imaketmp "sys$share:decw$xlibshr.exe/share" @@\ close imaketmp @@\ $(LINK) /exe=_NL:/map=program.map/full $(LDOPTIONS)\ @@\ $(EXTRA_LOAD_FLAGS) program.$(OBJ),\ @@\ lib#library.olb/lib, $(LOCAL_LIBRARIES),\ @@\ 'f$search(imaketmp)'/opt @@\ - $(RM)/nolog 'imaketmp'; @@\ @@\ clean:: @@\ RemoveTargetProgram(program#$(EXE)) #endif /* vms */ #endif /* XM2ProgramTarget */ /* * XTrapProgramTarget - generate rules to make a CCR DECwindows Tool target. */ #ifndef XTrapProgramTarget #ifndef vms #define XTrapProgramTarget(program) @@\ program#$(EXE): program.$(OBJ) libXTrap.$(LIB) @@\ RemoveTargetProgram($@) @@\ $(CC) -o $@ program.$(OBJ) $(LDOPTIONS)\ @@\ $(EXTRA_LOAD_FLAGS) libXTrap.$(LIB)\ @@\ $(LINKLIB)/libXext.$(LIB)\ @@\ $(MOTIF)/libXt.$(LIB) $(LINKLIB)/libX11.$(LIB)\ @@\ $(LINKLIB)/libdnet.$(LIB)\ @@\ $(LINKLIB)/libcurses.$(LIB)\ @@\ $(LINKLIB)/libtermcap.$(LIB)\ @@\ $(LINKLIB)/libi.$(LIB)\ @@\ $(LINKLIB)/libc.$(LIB) @@\ @@\ map:: @@\ $(CC) -o /dev/null -m >program.map\ @@\ program.$(OBJ) $(LDOPTIONS)\ @@\ $(EXTRA_LOAD_FLAGS) libXTr%ap.$(LIB)\ @@\ $(LINKLIB)/libXext.$(LIB)\ @@\ $(MOTIF)/libXt.$(LIB) $(LINKLIB)/libX11.$(LIB)\ @@\ $(LINKLIB)/libdnet.$(LIB)\ @@\ $(LINKLIB)/libcurses.$(LIB)\ @@\ $(LINKLIB)/libtermcap.$(LIB)\ @@\ $(LINKLIB)/libi.$(LIB)\ @@\ $(LINKLIB)/libc.$(LIB) @@\ @@\ clean:: @@\ RemoveTargetProgram(program#$(EXE)) #else /* vms */ #define XTrapProgramTarget(program) @@\ program#$(EXE): program.$(OBJ) decw$xtraplibshr.exe xtrap.opt @@\ RemoveTargetProgram($@) @@\ $(LINK) /exe='f$parse("$@")' $(LDOPTIONS)\ @@\ $(EXTRA_LOAD_FLAGS) program.$(OBJ),\ @@\ 'f$search("xtrap.opt")'/opt @@\ @@\ map:: @@\ $(LINK) /exe=_NL:/map=program.map/full $(LDOPTIONS)\ @@\ $(EXTRA_LOAD_FLAGS) program.$(OBJ),\ @@\ 'f$search("xtrap.opt")'/opt @@\ @@\ clean:: @@\ RemoveTargetProgram(program#$(EXE)) #endif /* vms */ #endif /* XTrapProgramTarget */ /* * XDtProgramTarget - generate rules to make a CCR DECwindows Tool target. */ #ifndef XDtProgramTarget #ifndef vms #define XDtProgramTarget(program) @@\ program#$(EXE): program.$(OBJ) libXDt.$(LIB) ../..toplink/ut/libut.$(LIB)\ @@\ ../..toplink/xtrap/libXTrap.$(LIB) @@\ RemoveTargetProgram($@) @@\ $(CC) -o $@ program.$(OBJ) $(LDOPTIONS)\ @@\ $(EXTRA_LOAD_FLAGS) libXDt.$(LIB)\ @@\ $(LOCAL_LIBRARIES) $(LINKLIB)/libXext.$(LIB)\ @@\ $(LINKLIB)/libi.$(LIB)\ @@\ $(LINKLIB)/libc.$(LIB)\ @@\ $(LINKLIB)/libXt.$(LIB) $(LINKLIB)/libX11.$(LIB)\ @@\ $(LINKLIB)/libdnet.$(LIB)\ @@\ $(LINKLIB)/libimg.$(LIB) $(LINKLIB)/libchf.$(LIB)\ @@\ $(LINKLIB)/libddif.$(LIB)\ @@\ $(LINKLIB)/libm.$(LIB)\ @@\ $(LINKLIB)/libc.$(LIB) @@\ @@\ map:: @@\ $(CC) -o /dev/null -m >program.map\ @@\ program.$(OBJ) $(LDOPTIONS)\ @@\ $(EXTRA_LOAD_FLAGS) libXDt.$(LIB)\ @@\ $(LOCAL_LIBRARIES) $(LINKLIB)/libXext.$(LIB)\ @@\ $(LINKLIB)/libi.$(LIB)\ @@\ $(LINKLIB)/libc.$(LIB)\ @@\ $(LINKLIB)/libXt.$(LIB) $(LINKLIB)/libX11.$(LIB)\ @@\ $(LINKLIB)/libdnet.$(LIB)\ @@\ $(LINKLIB)/libimg.$(LIB) $(LINKLIB)/libchf.$(LIB)\ @@\ $(LINKLIB)/libddif.$(LIB)\ @@\ $(LINKLIB)/libm.$(LIB)\ @@\ $(LINKLIB)/libc.$(LIB) @@\ @@\ clean:: @@\ RemoveTargetProgram(program#$(EXE)) #else /* vms */ #define XDtProgramTarget(program) @@\ program#$(EXE): program.$(OBJ) libXDt.$(LIB) xdt.opt @@\ RemoveTargetProgram($@) @@\ $(LINK) /exe='f$parse("$@")' $(LDOPTIONS)\ @@\ $(EXTRA_LOAD_FLAGS) program.$(OBJ),\ @@\ libXDt.$(LIB)/lib/inc=xdtmsg,\ @@\ [-.ut]libut.$(LIB)/lib/inc=utmsg, 'f$search("xdt.opt")'/opt @@\ @@\ map:: @@\ $(LINK) /exe=_NL:/map=program.map/full $(LDOPTIONS)\ @@\ $(EXTRA_LOAD_FLAGS) program.$(OBJ),\ @@\ libXDt.$(LIB)/lib/inc=xdtmsg,\ @@\ [-.ut]libut.$(LIB)/lib/inc=utmsg, 'f$search("xdt.opt")'/opt @@\ @@\ clean:: @@\ RemoveTargetProgram(program#$(EXE)) #endif /* vms */ #endif /* XDtProgramTarget */ /* * XDtUiProgTarget - generate rules to make a CCR DECwindows Tool target. */ #ifndef XDtUiProgTarget #ifndef vms #define XDtUiProgTarget(program,obj1) @@\ program#$(EXE): program.$(OBJ) libXDt.$(LIB)\ @@\ ../..toplink/ut/libut.$(LIB)\ @@\ ../..toplink/xtrap/libXTrap.$(LIB) @@\ RemoveTargetProgram($@) @@\ $(CC) -o $@ program.$(OBJ) obj1.$(OBJ) $(LDOPTIONS)\ @@\ $(EXTRA_LOAD_FLAGS)\ @@\ libXDt.$(LIB)\ @@\ $(LOCAL_LIBRARIES) $(LINKLIB)/libXext.$(LIB)\ @@\ $(MOTIF)/libDXm.$(LIB) $(MOTIF)/libMrm.$(LIB)\ @@\ $(MOTIF)/libXm.$(LIB) $(MOTIF)/libXt.$(LIB)\ @@\ $(LINKLIB)/libdgit.$(LIB)\ @@\ $(LINKLIB)/libi.$(LIB) $(LINKLIB)/libm.$(LIB)\ @@\ $(LINKLIB)/libc.$(LIB) $(LINKLIB)/libX11.$(LIB)\ @@\ $(LINKLIB)/libimg.$(LIB) $(LINKLIB)/libchf.$(LIB)\ @@\ $(LINKLIB)/libddif.$(LIB)\ @@\ $(LINKLIB)/libm.$(LIB)\ @@\ $(LINKLIB)/libc.$(LIB) @@\ @@\ map:: @@\ $(CC) -o /dev/null -m >program.map\ @@\ program.$(OBJ) obj1.$(OBJ) $(LDOPTIONS)\ @@\ $(EXTRA_LOAD_FLAGS)\ @@\ libXDt.$(LIB)\ @@\ $(LOCAL_LIBRARIES) $(LINKLIB)/libXext.$(LIB)\ @@\ $(MOTIF)/libDXm.$(LIB) $(MOTIF)/libMrm.$(LIB)\ @@\ $(MOTIF)/libXm.$(LIB) $(MOTIF)/libXt.$(LIB)\ @@\ $(LINKLIB)/libdgit.$(LIB)\ @@\ $(LINKLIB)/libi.$(LIB) $(LINKLIB)/libm.$(LIB)\ @@\ $(LINKLIB)/libc.$(LIB) $(LINKLIB)/libX11.$(LIB)\ @@\ $(LINKLIB)/libimg.$(LIB) $(LINKLIB)/libchf.$(LIB)\ @@\ $(LINKLIB)/libddif.$(LIB)\ @@\ $(LINKLIB)/libm.$(LIB)\ @@\ $(LINKLIB)/libc.$(LIB) @@\ @@\ clean:: @@\ RemoveTargetProgram(program#$(EXE)) #else /* vms */ #define XDtUiProgTarget(program,obj1) @@\ program#$(EXE): program.$(OBJ) obj1.$(OBJ) libXDt.$(LIB) xdt.opt [-.xtrap]decw$xtraplibshr.exe @@\ RemoveTargetProgram($@) @@\ $(LINK) /exe='f$parse("$@")' $(LDOPTIONS)\ @@\ $(EXTRA_LOAD_FLAGS) program.$(OBJ),\ @@\ libXDt.$(LIB)/lib/inc=(xdtmsg,obj1),\ @@\ [-.ut]libut.$(LIB)/lib/inc=utmsg, 'f$search("xdt.opt")'/opt @@\ @@\ map:: @@\ $(LINK) /exe=_NL:/map=program.map/full $(LDOPTIONS)\ @@\ $(EXTRA_LOAD_FLAGS) program.$(OBJ),\ @@\ libXDt.$(LIB)/lib/inc=(xdtmsg,obj1),\ @@\ [-.ut]libut.$(LIB)/lib/inc=utmsg, 'f$search("xdt.opt")'/opt @@\ @@\ clean:: @@\ RemoveTargetProgram(program#$(EXE)) #endif /* vms */ #endif /* XDtUiProgTarget */ /* * UiProgramTarget - generate rules to make a ui program target. */ #ifndef UiProgramTarget #ifndef vms #define UiProgramTarget(program,object,object2) @@\ program#$(EXE): libmi.$(LIB) @@\ RemoveTargetProgram($@) @@\ $(CC) -o $@ object.$(OBJ) object2.$(OBJ)\ @@\ $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) $(EXTRA_LOAD_FLAGS) @@\ @@\ map:: @@\ $(CC) -o /dev/null -m >program.map\ @@\ object.$(OBJ) object2.$(OBJ)\ @@\ $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) $(EXTRA_LOAD_FLAGS) @@\ @@\ clean:: @@\ RemoveTargetProgram(program#$(EXE)) #else /* vms */ #define UiProgramTarget(program,object,object2) @@\ program#$(EXE): libmi.$(LIB) program.opt @@\ RemoveTargetProgram($@) @@\ imaketmp:=program.opt @@\ - $(LINK) /exe='f$parse("$@")'\ @@\ object.$(OBJ), object2.$(OBJ),\ @@\ $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS)\ @@\ $(EXTRA_LOAD_FLAGS) 'f$search(imaketmp)'/opt @@\ @@\ map:: @@\ imaketmp:=program.opt @@\ - $(LINK) /exe=_NL:/map=program.map/full\ @@\ object.$(OBJ), object2.$(OBJ),\ @@\ $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS)\ @@\ $(EXTRA_LOAD_FLAGS) 'f$search(imaketmp)'/opt @@\ @@\ clean:: @@\ RemoveTargetProgram(program#$(EXE)) #endif /* vms */ #endif /* UiProgramTarget */ /* * UidTarget - generate rules to make a ui uid target. */ #ifndef UidTarget #ifndef vms #define UidTarget(uid, uil, uildepend) @@\ uid:: uildepend @@\ RemoveTargetProgram($@) @@\ $(UIL) -o uid $(UILFLAGS) $(UIL_INCLUDES) uil @@\ @@\ clean:: @@\ RemoveTargetProgram(uid) #else /* vms */ #define UidTarget(uid, u&K~ IMAKE.SAV%WVMAKE.BINARY]IMAKE.RULES;1bp*3il, uildepend) @@\ uid:: uildepend @@\ RemoveTargetProgram($@) @@\ define/user UIL$INCLUDE $(UIL_INCLUDES) @@\ define/user SYS$SHARE SYS$SYSROOT:[SYSLIB] @@\ $(UIL) /warning=noinformation /out='f$parse("$@")'\ @@\ /list=_NL: $(UILFLAGS) uil @@\ @@\ clean:: @@\ RemoveTargetProgram(uid) #endif /* vms */ #endif /* UidTarget */ /* * UilTarget - generate rules to make UIL target(s) from UIGEN */ #ifndef UilTarget #ifndef vms #define UilTarget(uigen, uildepend, fixup_rtn) /**/ #else /* vms */ #define UilTarget(uigen, uildepend, fixup_rtn) @@\ uildepend:: uigen @@\ define/user SYS$SHARE SYS$SYSROOT:[SYSLIB] @@\ uigltrans -wm uigen @@\ imaketmp:=fixup_rtn @@\ - if f$search(f$parse(imaketmp)) .nes. "" then @'f$parse(imaketmp)' #endif /* vms */ #endif /* UilTarget */ /* * DmObjectTarget - generate rules to compile a data manager object. */ #ifndef DmObjectTarget #ifndef vms #define DmObjectTarget(program) @@\ program.o: progr 5am.c @@\ RemoveTargetProgram($@) @@\ $(CC) -c -g program.c -I/usr/include/idl\ @@\ -I/usr/include/idl/c -I/usr/include/X11\ @@\ -I../..toplink/ut @@\ clean:: @@\ $(RM) program.o #else /* vms */ #define DmObjectTarget(program) #endif /* vms */ #endif /* DmOjbectTarget */ /* * DmProgramTarget - generate rules to compile a data manager executable. */ #ifndef DmProgramTarget #ifndef vms #define DmProgramTarget(program,objlist,liblist, libdepends) @@\ program#$(EXE): objlist libdepends @@\ RemoveTargetProgram($@) @@\ $(CC) -o $@ -s -O2 objlist $(LDOPTIONS) ../..toplink/ut/libut.$(LIB)\ @@\ liblist $(EXTRA_LOAD_FLAGS) @@\ @@\ map:: @@\ $(CC) -o /dev/null -m >program.map\ @@\ -s -O2 objlist $(LDOPTIONS) ../..toplink/ut/libut.$(LIB)\ @@\ liblist $(EXTRA_LOAD_FLAGS) @@\ @@\ clean:: @@\ RemoveTargetProgram(program#$(EXE)) @@\ $(RM) program.o #else /* vms */ #define DmProgramTarget(program,objlist, liblist, libdepends) @@\ program#$(EXE): objlist libdepends @@\ RemoveTargetProgram($@) @@\ $(LINK) /exe='f$parse("$@")' objlist, liblist,\ @@\ [-.ut]libut.$(LIB)/lib/inc=utmsg @@\ @@\ map:: @@\ $(LINK) /exe=_NL:/map=program.map/full objlist, liblist,\ @@\ [-.ut]libut.$(LIB)/lib/inc=utmsg @@\ @@\ clean:: @@\ RemoveTargetProgram(program#$(EXE)) #endif /* vms */ #endif /* DmProgramTarget */ /* * DmDCLTarget - generate a .dcl file from an SQL database */ #ifndef DmDCLTarget #if !defined(vms) #ifdef MipsArchitecture #define DmDCLTarget(includefile, table) @@\ includefile.dcl: @@\ RemoveTargetProgram($@) @@\ dclgen c dmtest1 table $@ table#Rec @@\ @@\ clean:: @@\ RemoveTargetProgram(includefile.dcl) @@\ $(RM) includefile.c #else #define DmDCLTarget(includefile, table) @@\ includefile.dcl: @@\ cp ../../mips/dm/includefile.dcl . @@\ @@\ clean:: @@\ RemoveTargetProgram(includefile.dcl) @@\ $(RM) includefile.c #endif #else #define DmDCLTarget(includefile, table) #endif /* MipsArchitecture - DmDCLTarget */ #endif /* DmDCLTarget */ /* * TmServerProgramTarget - generate rules to make a task manager server target. */ #ifndef TmServerProgramTarget #ifndef vms #define TmServerProgramTarget(program) @@\ program#$(EXE): program.$(OBJ) libtmserver.$(LIB) @@\ RemoveTargetProgram($@) @@\ $(CC) -o $@ $@.$(OBJ) libtmserver.$(LIB) $(LDOPTIONS)\ @@\ $(EXTRA_LOAD_FLAGS) $(LOCAL_LIBRARIES) @@\ @@\ map:: @@\ $(CC) -o /dev/null -m >program.map\ @@\ tmserver.$(OBJ) libtmserver.$(LIB) $(LDOPTIONS)\ @@\ $(EXTRA_LOAD_FLAGS) $(LOCAL_LIBRARIES) @@\ @@\ clean:: @@\ RemoveTargetProgram(program#$(EXE)) #else /* vms */ #define TmServerProgramTarget(program) @@\ program#$(EXE): program.$(OBJ), libtmserver.$(LIB) @@\ RemoveTargetProgram($@) @@\ - $(LINK) /exe='f$parse("$@")' program.$(OBJ),\ @@\ libtmserver.$(LIB)/lib,\ @@\ $(LOCAL_LIBRARIES),\ @@\ sys$library:rpc$libnck.$(LIB)/lib,\ @@\ sys$library:rpc$libucx.$(LIB)/lib,\ @@\ sys$library:ucx$ipc.$(LIB)/lib @@\ @@\ map:: @@\ - $(LINK) /exe=_NL:/map=program.map/full program.$(OBJ),\ @@\ libtmserver.$(LIB)/lib,\ @@\ $(LOCAL_LIBRARIES),\ @@\ sys$library:rpc$libnck.$(LIB)/lib,\ @@\ sys$library:rpc$libucx.$(LIB)/lib,\ @@\ sys$library:ucx$ipc.$(LIB)/lib @@\ @@\ clean:: @@\ RemoveTargetProgram(program#$(EXE)) #endif /* vms */ #endif /* TmServerProgramTarget */ /* * TmTestProgram - generate rules to compile a task manager object. */ #ifndef TmTestProgram #ifndef vms #define TmTestProgram(program,objlist) @@\ test:: program @@\ @@\ program#$(EXE): program.$(OBJ) objlist @@\ RemoveTargetProgram($@) @@\ $(CC) -o $@ objlist $(LDOPTIONS) ../..toplink/ut/libut.$(LIB)\ @@\ $(EXTRA_LOAD_FLAGS) $(LOCAL_LIBRARIES) @@\ @@\ map:: @@\ $(CC) -o /dev/null -m >program.map\ @@\ objlist $(LDOPTIONS) ../..toplink/ut/libut.$(LIB)\ @@\ $(EXTRA_LOAD_FLAGS) $(LOCAL_LIBRARIES) @@\ @@\ clean:: @@\ RemoveTargetProgram(program#$(EXE)) @@\ $(RM) program.o #else /* vms */ #define TmTestProgram(program,objlist) @@\ test:: program#$(EXE) @@\ write sys$output "Test program built" @@\ @@\ program#$(EXE): program.$(OBJ) tmrpc_cstub.$(OBJ) tmrpc_cswtch.$(OBJ) libtm.$(LIB) @@\ RemoveTargetProgram($@) @@\ - $(LINK) /exe='f$parse("$@")' program.$(OBJ),\ @@\ tmrpc_cstub.$(OBJ),tmrpc_cswtch.$(OBJ),libtm.$(LIB)/lib,\ @@\ $(LOCAL_LIBRARIES),\ @@\ sys$library:rpc$libnck.$(LIB)/lib,\ @@\ sys$library:rpc$libucx.$(LIB)/lib,\ @@\ sys$library:ucx$ipc.$(LIB)/lib @@\ @@\ map:: @@\ - $(LINK) /exe=_NL:/map=program.map/full program.$(OBJ),\ @@\ tmrpc_cstub.$(OBJ),tmrpc_cswtch.$(OBJ),libtm.$(LIB)/lib,\ @@\ $(LOCAL_LIBRARIES),\ @@\ sys$library:rpc$libnck.$(LIB)/lib,\ @@\ sys$library:rpc$libucx.$(LIB)/lib,\ @@\ sys$library:ucx$ipc.$(LIB)/lib @@\ @@\ clean:: @@\ RemoveTargetProgram(program#$(EXE)) #endif /* vms */ #endif /* TmTestProgram*/ /* * CiProgramTarget - generate rules to compile a task manager object. */ #ifndef CiProgramTarget #ifndef vms #define CiProgramTarget(program,objlist) @@\ test:: program @@\ @@\ program#$(EXE): program.$(OBJ) objlist @@\ RemoveTargetProgram($@) @@\ $(CC) -o $@ objlist $(LDOPTIONS)\ @@\ $(EXTRA_LOAD_FLAGS) $(LOCAL_LIBRARIES) @@\ @@\ map:: @@\ $(CC) -o /dev/null -m >program.map\ @@\ objlist $(LDOPTIONS)\ @@\ $(EXTRA_LOAD_FLAGS) $(LOCAL_LIBRARIES) @@\ @@\ clean:: @@\ RemoveTargetProgram(program#$(EXE)) @@\ $(RM) program.o #else /* vms */ #define CiProgramTarget(program,objlist) @@\ test:: program#$(EXE) @@\ write sys$output "CI program built" @@\ @@\ program#$(EXE): program.$(OBJ) objlist libci.$(LIB) program.opt @@\ RemoveTargetProgram($@) @@\ imaketmp:=program.opt @@\ - $(LINK) /exe='f$parse("$@")' program.$(OBJ),\ @@\ $(LDOPTIONS) $(LOCAL_LIBRARIES), $(LDLIBS)\ @@\ $(EXTRA_LOAD_FLAGS) 'f$search(imaketmp)'/opt @@\ @@\ map:: @@\ imaketmp:=program.opt @@\ - $(LINK) /exe=_NL:/map=program.map/full program.$(OBJ),\ @@\ $(LDOPTIONS) $(LOCAL_LIBRARIES), $(LDLIBS)\ @@\ $(EXTRA_LOAD_FLAGS) 'f$search(imaketmp)'/opt @@\ @@\ clean:: @@\ RemoveTargetProgram(program#$(EXE)) #endif /* vms */ #endif /* CiProgramTarget */ /* * TestProgramTarget - generate rules to compile a test program. */ #ifndef TestProgramTarget #ifndef vms #define TestProgramTarget(program,objlist) @@\ AllTarget(program#$(EXE)) @@\ test:: program#$(EXE) @@\ @@\ program#$(EXE): program.$(OBJ) objlist @@\ RemoveTargetProgram($@) @@\ $(CC) -o $@ program.$(OBJ)\ @@\ $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) $(EXTRA_LOAD_FLAGS) @@\ @@\ map:: @@\ $(CC) -o /dev/null -m >program.map\ @@\ program.$(OBJ)\ @@\ $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) $(EXTRA_LOAD_FLAGS) @@\ @@\ clean:: @@\ RemoveTargetProgram(program#$(EXE)) @@\ $(RM) program.o #else /* vms */ #define TestProgramTarget(program,objlist) @@\ AllTarget(program#$(EXE)) @@\ test:: program#$(EXE) @@\ ! Test program built @@\ @@\ program#$(EXE): program.$(OBJ) objlist program.opt @@\ RemoveTargetProgram($@) @@\ imaketmp:=program.opt @@\ $(LINK) /exe='f$parse("$@")' program.$(OBJ),\ @@\ $(LDOPTIONS) $(LOCAL_LIBRARIES), $(LDLIBS)\ @@\ [-.ut]libut.$(LIB)/lib/inc=utmsg,\ @@\ $(EXTRA_LOAD_FLAGS) 'f$search(imaketmp)'/opt @@\ @@\ map:: @@\ imaketmp:=program.opt @@\ $(LINK) /exe=_NL:/map=program.map/full program.$(OBJ),\ @@\ $(LDOPTIONS) $(LOCAL_LIBRARIES), $(LDLIBS)\ @@\ [-.ut]libut.$(LIB)/lib/inc=utmsg,\ @@\ $(EXTRA_LOAD_FLAGS) 'f$search(imaketmp)'/opt @@\ @@\ clean:: @@\ E RemoveTargetProgram(program#$(EXE)) #endif /* vms */ #endif /* TestProgramTarget*/ /* * SimpleTestProgramTarget - generate rules to compile a test program. */ #ifndef SimpleTestProgramTarget #ifndef vms #ifdef sparc #define SimpleTestProgramTarget(program) @@\ AllTarget(program#$(EXE)) @@\ test:: program#$(EXE) @@\ @@\ program#$(EXE): program.$(OBJ) ../..toplink/ut/libut.$(LIB) @@\ RemoveTargetProgram($@) @@\ $(CC) -o $@ program.$(OBJ) ../..toplink/ut/libut.$(LIB)\ @@\ $(LOCAL_LIBRARIES)\ @@\ $(LDOPTIONS) $(EXTRA_LOAD_FLAGS) @@\ @@\ map:: @@\ $(CC) -o /dev/nul -m >program.map\ @@\ program.$(OBJ) ../..toplink/ut/libut.$(LIB)\ @@\ $(LOCAL_LIBRARIES)\ @@\ $(LDOPTIONS) $(EXTRA_LOAD_FLAGS) @@\ @@\ clean:: @@\ RemoveTargetProgram(program#$(EXE)) @@\ $(RM) program.o #else /* it's mips */ #define SimpleTestProgramTarget(program) @@\ AllTarget(program#$(EXE)) @@\ test:: program#$(EXE) @@\ @@\ program#$(EXE): program.$(OBJ) ../..toplink/ut/libut.$(LIB) @@\ RemoveTargetProgram($@) @@\ $(CC) -o $@ program.$(OBJ) ../..toplink/ut/libut.$(LIB)\ @@\ $(LINKLIB)/libi.$(LIB)\ @@\ $(LDOPTIONS) $(EXTRA_LOAD_FLAGS) @@\ @@\ map:: @@\ $(CC) -o /dev/nul -m >program.map\ @@\ program.$(OBJ) ../..toplink/ut/libut.$(LIB)\ @@\ $(LINKLIB)/libi.$(LIB)\ @@\ $(LDOPTIONS) $(EXTRA_LOAD_FLAGS) @@\ @@\ clean:: @@\ RemoveTargetProgram(program#$(EXE)) @@\ $(RM) program.o #endif #else /* vms */ #define SimpleTestProgramTarget(program) @@\ AllTarget(program#$(EXE)) @@\ test:: program#$(EXE) @@\ ! Test program built @@\ @@\ program#$(EXE): program.$(OBJ) [-.ut]libut.$(LIB) @@\ RemoveTargetProgram($@) @@\ $(LINK) /exe='f$parse("$@")' program.$(OBJ),\ @@\ [-.ut]libut.$(LIB)/lib/inc=utmsg\ @@\ $(LDOPTIONS) $(EXTRA_LOAD_FLAGS) @@\ @@\ map:: @@\ $(LINK) /exe=_NL:/map=program.map/full program.$(OBJ),\ @@\ [-.ut]libut.$(LIB)/lib/inc=utmsg\ @@\ $(LDOPTIONS) $(EXTRA_LOAD_FLAGS) @@\ @@\ clean:: @@\ RemoveTargetProgram(program#$(EXE)) #endif /* vms */ #endif /* SimpleTestProgramTarget*/ /* * IDLTarget - generate rules to compile a IDL file */ #ifndef IDLTarget #ifndef vms #define IDLTarget(idlsrc) @@\ idlsrc.h: idlsrc.idl @@\ nidl -s idlsrc.idl -no_cpp -idir /usr/include/idl #else /* vms */ #define IDLTarget(idlsrc) @@\ idlsrc.h: idlsrc.idl @@\ nidl -s idlsrc.idl -idir rpc$lib: #endif /* vms */ #endif /* IDLTarget */ /* * LEXTarget - generate rules to compile a LEX file */ #ifndef LEXTarget #ifndef vms #define LEXTarget(lexsrc) @@\ AllTarget(lexsrc.c) @@\ lexsrc.c: lexsrc.lex @@\ lex lexsrc.lex @@\ mv lex.yy.c lexsrc.c #else /* vms */ #define LEXTarget(lexsrc) /**/ #endif /* vms */ #endif /* LEXTarget */ /* * TILTarget - generate rules to compile a TIL file */ #ifndef TILTarget #ifndef vms #define TILTarget(tilobj,options,tilsrc) @@\ FUSE_dx#tilobj.c: tilsrc.til @@\ RemoveTargetProgram($@) @@\ til -cdx#tilobj options tilsrc.til @@\ @@\ clean:: @@\ RemoveTargetProgram($@) #else /* vms */ #define TILTarget(tilobj,options,tilsrc) /**/ #endif /* vms */ #endif /* TILTarget */ /* * TestModuleTarget - generate rules to make target from a single * object. */ #ifndef TestModuleTarget #ifndef vms #define TestModuleTarget(module) @@\ module#_test.$(OBJ): module.c @@\ RemoveTargetProgram($@) @@\ $(CC) -c module.c -o $@ $(CFLAGS) -DTESTING @@\ @@\ clean:: @@\ RemoveTargetProgram(module#_test.$(OBJ)) #else /* vms */ #define TestModuleTarget(module) @@\ module#_test.$(OBJ): module.c @@\ RemoveTargetProgram(module#_test.$(OBJ)) @@\ $(CC) module.c /obj=$@ $(CFLAGS) -DTESTING @@\ @@\ clean:: @@\ RemoveTargetProgram(module#_test.$(OBJ)) #endif /* vms */ #endif /* TestModuleTargMet */ /* * XDtTestTarget - generate rules to make target from a single * object. */ #ifndef XDtTestTarget #ifndef vms #define XDtTestTarget(module) @@\ test:: module#_test.$(OBJ) @@\ @@\ module#_test.$(OBJ): module.c @@\ RemoveTargetProgram($@) @@\ $(CC) -c module.c -o $@ $(CFLAGS) -DTESTING @@\ @@\ clean:: @@\ RemoveTargetProgram(module#_test.$(OBJ)) #else /* vms */ #define XDtTestTarget(module) @@\ test:: module#_test.$(OBJ) @@\ @@\ module#_test.$(OBJ): module.c @@\ RemoveTargetProgram(module#_test.$(OBJ)) @@\ $(CC) module.c /obj=$@ $(CFLAGS) -DTESTING StandardDefines @@\ @@\ clean:: @@\ RemoveTargetProgram(module#_test.$(OBJ)) #endif /* vms */ #endif /* XDtTestTarget */ /* * CatFileTarget - generate rules to make single catalog file from * concatenated message files for U*IX. */ #ifndef CatFileTarget #ifndef vms #define CatFileTarget(msg_file, src_files) @@\ AllTarget(msg_file.cat) @@\ @@\ msg_file.cat: src_files @@\ RemoveTargetProgram($@) @@\ cat src_files | sed "s/^\.end/\! &/" | sed "s/ .title/\! &/" | \ @@\ cat - $(UTILSRC)/end_msg.msg >msg_file.msg @@\ msgtocat msg_file.msg msg_file.msf /dev/null @@\ gencat $@ msg_file.msf @@\ @@\ clean:: @@\ RemoveTargetProgram(msg_file.msg) @@\ RemoveTargetProgram(msg_file.cat) @@\ RemoveTargetProgram(msg_file.msf) #else /* vms */ #define CatFileTarget(msg_file, src_files) /**/ #endif /* vms */ #endif /* CatFileTarget */ /* * MessageFileTarget - generate rules to make message header file on VMS * for use on all platforms. Also creates .obj file used on VMS. */ #ifndef MessageFileTarget #ifndef vms #define MessageFileTarget(msg_file) /**/ #else /* vms */ #define MessageFileTarget(msg_file) @@\ AllTarget(msg_file.h msg_file.obj) @@\ msg_file.h: msg_file.msg @@\ RemoveTargetProgram($@) @@\ $(MESSAGE)/NOOBJ/SDL=msg_file.sdl msg_file.msg @@\ $(SDL)/LANGUAGE=C msg_file.sdl @@\ STREAMLF $@ @@\ @@\ msg_file.obj: msg_file.msg @@\ RemoveTargetProgram($@) @@\ $(MESSAGE)/OBJECT=$@ msg_file.msg @@\ @@\ clean:: @@\ RemoveTargetProgram(msg_file.h) @@\ RemoveTargetProgram(msg_file.obj) #endif /* vms */ #endif /* MessageFileTarget */ /* * HelpFileTarget - generate rules to make Help library file on VMS * for use on all platforms. */ #ifndef HelpFileTarget #ifndef vms #define HelpFileTarget(hlp_file) /**/ #else /* vms */ #define HelpFileTarget(hlp_file) @@\ AllTarget(hlp_file.hlb) @@\ hlp_file.hlb: hlp_file.hlp @@\ @@\ clean:: @@\ RemoveTargetProgram(hlp_file.hlb) #endif /* vms */ #endif /* HelpFileTarget */ /* * RunoffHelpTarget - generate rules to make Help file on VMS * from a Runoff source for use on all platforms. */ #ifndef RunoffHelpTarget #ifndef vms #define RunoffHelpTarget(rnh_file) /**/ #else /* vms */ #define RunoffHelpTarget(rnh_file) @@\ rnh_file.hlp: rnh_file.rnh @@\ RemoveTargetProgram($@) @@\ RUNOFF $< /OUTPUT=$@ @@\ STREAMLF $@ @@\ @@\ clean:: @@\ RemoveTargetProgram($@) #endif /* vms */ #endif /* RunoffHelpTarget */ /* * HeaderFileTarget - generate rules to make header file on VMS * for use on all platforms. */ #ifndef HeaderFileTarget #ifndef vms #define HeaderFileTarget(sdl_file) /**/ #else /* vms */ #define HeaderFileTarget(sdl_file) @@\ AllTarget(sdl_file.h) @@\ sdl_file.h: sdl_file.sdl @@\ RemoveTargetProgram($@) @@\ $(SDL)/LANGUAGE=C sdl_file.sdl @@\ STREAMLF $@ @@\ @@\ clean:: @@\ RemoveTargetProgram(sdl_file.h) #endif /* vms */ #endif /* HeaderFileTarget */ /* * SaberProgramTarget - generate rules to make Saber-C read in sources and * objects. */ #ifndef SaberProgramTarget #if HasSaberC #define SaberProgramTarget(program,srclist,objlist,locallibs,syslibs) @@\ saber_#program:: @@\ SABERLOAD $(ALLDEFINES) srclist locallibs $(SYS_LIBRARIEUS) $(EXTRA_LIBRARIES) syslibs @@\ @@\ osaber_#program:: @@\ SABERLOAD $(ALLDEFINES) objlist locallibs $(SYS_LIBRARIES) $(EXTRA_LIBRARIES) syslibs #else #define SaberProgramTarget(program,srclist,objlist,locallibs,syslibs) /**/ #endif #endif /* * SaberTestProgram - generate rules to make Saber-C read in sources and * objects for programs needing compilation with -DTESTING. */ #ifndef SaberTestProgram #if HasSaberC #define SaberTestProgram(program,srcfile) @@\ saber_#program:: @@\ $(RM) srcfile#_test.c; set -x; $(LN) srcfile.c srcfile#_test.c @@\ SABERLOAD $(ALLDEFINES) srcfile#_test.c -DTESTING #else #define SaberTestProgram(program,srcfile) /**/ #endif #endif #ifndef RemoveTargetProgram #ifndef vms #if RemoveTargetProgramByMoving #define RemoveTargetProgram(program)\ $(RM) program.bak; if [ -f program ]; then $(MV) program program.bak; fi #else #define RemoveTargetProgram(program) $(RM) program #endif #else /* vms */ #define RemoveTargetProgram(program) @@\ @- imaketmp:=program @@\ @- if f$search(f$parse(imaketmp)) .nes. "" then $(RM) 'f$parse(imaketmp)' #endif /* vms */ #endif /* RemoveTargetProgram */ /* * FetchList Target - Fetched a list of files from the CMS library */ #ifndef FetchListTarget #ifndef vms #define FetchListTarget(fetchlist) @@\ fetch:: @@\ echo "CMS not available on Unix" #else /* vms */ #define FetchListTarget(fetchlist) @@\ fetch:: fetchlist @@\ continue #endif /* vms */ #endif /* FetchListTarget */ /* * ScaLibrary Target - builds an SCA library from the source list */ #ifndef ScaLibraryTarget #ifndef vms #define ScaLibraryTarget(dir, scalist) @@\ scalib: @@\ echo "SCA not available on Unix" #else #define ScaLibraryTarget(dir, scalist) @@\ scalib: scalist @@\ SCA SET LIBRARY dir @@\ SCA LOAD *.ana #endif /* vms */ #endif /* ScaLibraryTarget */ /* * ScaHelpTarget - builds an SCA help file from an SCAlibrary */ #ifndef ScaHelpTarget #ifndef vms #define ScaHelpTarget(dirY, module) @@\ module.hlp: @@\ echo "SCA not available on Unix" #else #define ScaHelpTarget(dir, module) @@\ module.hlp: @@\ SCA SET LIBRARY dir @@\ SCA report/output=module.hlp help @@\ libr/help/create module module #endif /* vms */ #endif /* ScaHelpTarget */ /* * ScaLseTarget - builds an LSE packages file from an SCAlibrary */ #ifndef ScaLseTarget #ifndef vms #define ScaLseTarget(dir, module) @@\ module.lse: @@\ echo "SCA not available on Unix" #else #define ScaLseTarget(dir, module) @@\ module.lse: @@\ SCA SET LIBRARY dir @@\ SCA report/output=module.lse/language=c/help=module.hlb package #endif /* vms */ #endif /* ScaLseTarget */ /* * ScaInternalsTarget - builds an SDML internals report file from an SCAlibrary */ #ifndef ScaInternalsTarget #ifndef vms #define ScaInternalsTarget(dir, module) @@\ module#_internals.lse: @@\ echo " SCA not available on Unix" #else #define ScaInternalsTarget(dir, module) @@\ module#_internals.sdml: @@\ SCA SET LIBRARY dir @@\ SCA report/output=module#_internals.sdml internals #endif /* vms */ #endif /* ScaInternalsTarget */ /* * DependDependency - generate rules to build the makedepend program if * this Imakefile is within the source tree. */ #ifndef DependDependency #ifdef UseInstalled #define DependDependency() /**/ #else #ifndef vms #define DependDependency() @@\ depend:: $(DEPEND) @@\ @@\ $(DEPEND): @@\ @echo "checking $@ over in $(DEPENDSRC) first...";\ @@\ cd $(DEPENDSRC); $(MAKE);\ @@\ echo "okay, continuing in $(CURRENT_DIR)" #else /* vms */ #define DependDependency() /**/ #endif /* vms */ #endif /* UseInstalled */ #endif /* DependDependency */ /* * DependTarget - generate rules to compute dependencies for all files listed * in $(SRCS). */ #ifndef DependTarget #ifndef vms #define DependTarget(component) @@\ DependDependency() @@\ @@\ depend:: regdepend @@\ $(DEPEND) -- $(ALLDEFINES) -- $(SRCS) #else /* vms */ #define DependTarget(component) @@\ DependDependency() @@\ depend:: firstdepend regdepend @@\ imaketmp:=component#_depend.tmp @@\ $(DEPEND) -- $(ALLDEFINES) -- -1 'imaketmp' @@\ @@\ firstdepend:: @@\ imaketmp:=component#_depend.tmp @@\ copy/nolog _NL: 'imaketmp' #endif /* vms */ #endif /* DependTarget */ /* * MakeDependTarget - generate rules to compute dependencies for all * files listed in $(SRCS). Same as above but a clearer Imake Macro name, * and it will take a list of source files for makedpend to process. */ #ifndef MakeDependTarget #ifndef vms #define MakeDependTarget(component, modules) @@\ DependDependency() @@\ @@\ depend:: regdepend @@\ $(DEPEND) -- $(ALLDEFINES) -- modules #else /* vms */ #define MakeDependTarget(component,modules) @@\ DependDependency() @@\ depend:: firstdepend regdepend @@\ imaketmp:=component#_depend.tmp @@\ $(DEPEND) -- $(ALLDEFINES) -- -1 'imaketmp' @@\ $(RM) 'imaketmp';* @@\ @@\ firstdepend:: @@\ imaketmp:=component#_depend.tmp @@\ copy/nolog _NL: 'imaketmp' @@\ @@\ regdepend:: modules @@\ imaketmp:=component#_depend.tmp @@\ open/append dep_file 'imaketmp' @@\ imaketmpsrcs := modules @@\ write dep_file "''f$edit(imaketmpsrcs,"lowercase")'" @@\ close dep_file #endif /* vms */ #endif /* MakeDependTarget */ /* * RegDependTarget - Appends target(s) to a file for eventual depend * processing. This is used to get around DCL's length limitation on * VMS. */ #ifndef RegDependTarget #ifndef vms #define RegDependTarget(component, module) @@\ regdepend:: module #else /* vms */ #deafine RegDependTarget(component, module) @@\ regdepend:: module @@\ imaketmp:=component#_depend.tmp @@\ open/append dep_file 'imaketmp' @@\ imaketmp:=module @@\ write dep_file "''f$edit(imaketmp,"lowercase")'" @@\ close dep_file #endif /* vms */ #endif /* RegDependTarget */ /* * CleanTarget - generate rules to remove specified file */ #ifndef CleanTarget #ifndef vms #define CleanTarget(program) @@\ clean:: program @@\ RemoveTargetProgram(program) #else /* vms */ #define CleanTarget(program) @@\ clean:: program @@\ RemoveTargetProgram(program) #endif /* vms */ #endif /* CleanTarget */ /* * CleanAllTarget - generate rules to clean spurious files */ #ifndef CleanAllTarget #ifndef vms #define CleanAllTarget(filelist) @@\ clean:: @@\ $(RM) *.o mw \#* *~ core @@\ $(RM) filelist #else /* vms */ #define CleanAllTarget(filelist) @@\ clean:: @@\ purge/log *.* @@\ imaketmp:=filelist; @@\ - if imaketmp .nes. ";" then $(RM) 'imaketmp' #endif /* vms */ #endif /* CleanAllTarget */ /* * InstallTarget - generate rules to install specified file */ #ifndef InstallTarget #define InstallTarget(target, dest) @@\ Install:: @@\ $(INSTALL) $(INSTBINFLAGS) target dest #endif /* InstallTarget */ /* * TagsTarget - generate rules to compute tags files for C source code. */ #ifndef vms #ifndef TagsTarget #define TagsTarget() @@\ tags:: @@\ $(TAGS) -w *.[ch] @@\ $(TAGS) -xw *.[ch] > TAGS #endif /* TagsTarget */ #endif /* vms */ /* * BuildMakefileTarget - generate rules to build a Makefile from an Imakefile * and any special imake flags. This is generally done automatically by the * template or by any special Imakefiles. */ #ifndef BuildMakefileTarget #ifndef vms #define BuildMakefileTarget(imakefile,imakeflags) @@\ @@\ Makefile:: @@\ -@if [ -f Makefile ]; then\ @@\ echo " $(RM) Makefile.bak; $(MV) Makefile Makeefile.bak";\ @@\ $(RM) Makefile.bak; $(MV) Makefile Makefile.bak;\ @@\ else exit 0; fi @@\ $(IMAKE_CMD) -f imakefile imakeflags @@\ cat Makefile | sed "s/^ SABERLOAD/ #load/" >Makefile.tmp @@\ $(MV) Makefile.tmp Makefile #else /* vms */ #define BuildMakefileTarget(imakefile,imakeflags) @@\ @@\ Makefile:: imakefile @@\ @- if f$search(f$parse("Makefile.bak")) .nes. "" then $(RM) 'f$parse("Makefile.bak;*")' @@\ @- if f$search(f$parse("Makefile.mms")) .nes. "" then $(MV) Makefile.mms; Makefile.bak @@\ $(IMAKE_CMD) -f imakefile imakeflags @@\ @- purge/noconf/nolog makefile.mms #endif /* vms */ #endif /* BuildMakefileTarget */ /* * MakefileTarget - generate rules to build a normal Makefile. */ #ifndef MakefileTarget #ifndef vms #define MakefileTarget() @@\ BuildMakefileTarget(Imakefile, -s) #else #define MakefileTarget() @@\ BuildMakefileTarget(Imakefile., "/cms") #endif /* vms */ #endif /* MakefileTarget */ /* * AllTarget - generate rules to build necessary things during make all. */ #ifndef AllTarget #ifndef vms #define AllTarget(depends) @@\ all:: depends #else /* vms */ #define AllTarget(depends) @@\ all:: depends @@\ continue #endif /* vms */ #endif /* AllTarget */ /* * LinkSourceFile - snag source file from some other directory */ #ifndef LinkSourceFile #ifndef vms #define LinkSourceFile(src,dir) @@\ src: dir/src @@\ $(RM) $@ @@\ $(LN) $? $@ #else /* vms */ #define LinkSourceFile(src,dir) @@\ src: dir#src @@\ $(LN) $? $@ #endif /* vms */ #endif /* LinkSourceFile */ /* * LinkFileList - link a list of list of files from one place to another */ #ifndef LinkFileList #ifndef vms #define LinkFileList(step,list,sub) @@\ step:: @@\ for i in list; do ($(RM) $$i; set -x; $(LN) sub/$$i .); done #else /* vms */ #define LinkFileList(step,list,sub) /**/ #endif /* vms */ #endif /* LinkFileList */ #ifndef LinkFile #ifndef vms #define LinkFile(step,dest,src) @@\ step:: @@\ i$(RM) dest; set -x; $(LN) src dest #else /* vms */ #define LinkFile(step,file,sub) /**/ #endif /* vms */ #endif /* LinkFile */ /* * First List Target - Insert the .FIRST target for MMS on VMS */ #ifndef FirstListTarget #ifndef vms #define FirstListTarget(firstlist) @@\ first: @@\ echo ".first not available with U*IX make" #else #define FirstListTarget(firstlist) @@\ .first: @@\ firstlist @@\ continue #endif /* vms */ #endif /* FirstListTarget */ #ifndef EnvDef #ifndef vms #define EnvDef(var,value) /* child processes can't create env vars */ #else /* vms */ #define EnvDef(var,value) @@\ env:: @@\ define/job/nolog var value #endif /* vms */ #endif /* EnvDef */ /* * InstallManPageLong - generate rules to install the indicated manual page, * giving it an alternate name. This is used for installing man pages whose * base name without the .man suffix would normally be longer than 8 characters * (the limit for using source code control systems on files systems with * short file names). */ #ifndef InstallManPageLong #ifndef vms #define InstallManPageLong(file,destdir,dest) @@\ install.man:: file.man @@\ $(INSTALL) -c $(INSTMANFLAGS) file.man destdir/dest.ManSuffix #else /* vms */ #define InstallManPageLong(file,destdir,dest) /**/ #endif /* vms */ #endif /* InstallManPageLong */ /* * InstallManPage - generate rules to install the indicated manual page. */ #ifndef InstallManPage #define InstallManPage(file,dest) @@\ InstallManPageLong(file,dest,file) #endif /* InstallManPage */ /* * BuildIncludeFileTarget - generate rules to build an Include file * of dependencies from a Makefile. */ #ifndef BuildIncludeFileTarget #ifndef vms #define BuildIncludeFileTarget(component) /**/ #else /* vms */ #define BuildIncludeFileTarget(component) @@\ CMSCLASS = CURBLD @@\ includes:: @@\ imaketmp:=component#_depend.mms @@\ $(MAKEINCLUDE) 'imaketmp' "$(EXCLUDE_INCLUDES)" @@\ if imakestatus .eqs. "1" then - @@\ $(CMS) RESERVE 'imaketmp' /nooutput "Updated dependencies from makedepend" @@\ if imakestatus .eqs. "1" then - @@\ $(CMS) REPLACE 'imaketmp' /keep "" @@\ if imakestatus .eqs. "1" then - @@\ $(CMS) INSERT GENERATION 'imaketmp' $(CMSCLASS) /always "" @@\ @@\ .include component#_depend.mms #endif /* vms */ #endif /* BuildIncludefileTarget */ /* * NormalLibraryObjectRule - generate make rules to build "normal" objects. */ #ifndef NormalLibraryObjectRule #ifndef vms #define NormalLibraryObjectRule() @@\ .c.o: @@\ $(RM) $@ @@\ $(CC) -c $(CFLAGS) $*.c #else /* vms */ #define NormalLibraryObjectRule() /**/ #endif /* vms */ #endif /* NormalLibraryObjectRule */ *[IMAKE.BINARY]IMAKE.TMPL;1+,&W.(/@ 4((5-V0123KPWO)56BE7 c^89G@HJ/* Imake.tmpl ** Imake Template file (non-platform specific) */ /* Copyright (c) Digital Equipment Corporation, 1992 ** All Rights Reserved. Unpublished rights reserved ** under the copyright laws of the United States. ** ** The software contained on this media is proprietary ** to and embodies the confidential technology of ** Digital Equipment Corporation. Possession, use, ** duplication or dissemination of the software and ** media is authorized only pursuant to a valid writP|~ IMAKE.SAV&WV[IMAKE.BINARY]IMAKE.TMPL;1(ten ** license from Digital Equipment Corporation. ** ** RESTRICTED RIGHTS LEGEND Use, duplication, or ** disclosure by the U.S. Government is subject to ** restrictions as set forth in Subparagraph (c)(1)(ii) ** of DFARS 252.227-7013, or in FAR 52.227-19, as ** applicable. ** ** FACILITY: ** ** Customized Imake for Portable DTM effort ** ** ABSTRACT: ** ** This file contains the template "Makefile" for building ** MMS and Make files using high-level macros (Imake.rules) ** and platform specific definitions (vms.cf & ultrix.cf). ** ** AUTHORS: ** ** Kenneth B. Miller ** ** ** CREATION DATE: 19 November 1990 ** **/ #define YES 1 #define NO 0 /* * To add support for another platform: * * 1. Identify a machine-specific cpp symbol. If your preprocessor * doesn't have any built in, you'll need to add the symbol to the * cpp_argv table in util/imake/imake.c and rebuild imake with the * BOOTSTRAPCFLAGS variable set (see the macII for an example). * * 2. Add all machine-specific cpp symbols (either defined by you or by * the preprocessor or compiler) to the predefs table in * util/makedepend/main.c. * * 3. But a new #ifdef block below that defines MacroIncludeFile and * MacroFile for your new platform and then #undefs the machine- * specific preprocessor symbols (to avoid problems with file names). * * 4. Create a .cf file with the name given by MacroFile. */ #ifdef vms #define MacroIncludeFile "vms.cf" #define MacroFile "vms.cf" #endif /* vms */ #ifdef ultrix #define MacroIncludeFile #define MacroFile ultrix.cf #ifdef vax #undef vax #define VaxArchitecture #define CcCmd gcc #define DefaultCCOptions #define StandardDefines -DUNIX -DHAS_VFORK -D__vax #define MotifRoot /usr/lib #endif #ifdef mips #undef mips #define MipsArchitecture #define CcCmd cc #define DefaultCCOptions -Wf,-XNd18000,-XNh4000 -Olimit 4000 #define StandardDefines -DUNIX -DHAS_VFORK #define MotifRoot /usr/lib #endif #undef ultrix #define UltrixArchitecture #endif #if defined(vax) && !defined(UltrixArchitecture) && !defined(vms) #define MacroIncludeFile #define MacroFile bsd.cf #undef vax #define VaxArchitecture #endif #ifdef sun #define MacroIncludeFile #define MacroFile sun.cf #undef sun #define SunArchitecture #endif /* sun */ #ifdef sparc #define MacroIncludeFile #define MacroFile sparc.cf #define SparcArchitecture #define CcCmd /usr/local/bin/g++ #endif /* Sparc */ #ifdef hpux #define MacroIncludeFile #define MacroFile hp.cf #undef hpux #define HPArchitecture #endif /* hpux */ #ifdef att #define MacroIncludeFile #define MacroFile att.cf #undef att #define ATTArchitecture #endif /* att */ #ifdef apollo #define MacroIncludeFile #define MacroFile apollo.cf #undef apollo #define ApolloArchitecture #endif /* apollo */ #ifdef sony #define MacroIncludeFile #define MacroFile sony.cf #undef sony #define SonyArchitecture #endif /* sony */ #ifdef M4310 #define MacroIncludeFile #define MacroFile pegasus.cf #undef M4310 #define PegasusArchitecture #endif /* M4310 */ #ifdef M4330 #define MacroIncludeFile #define MacroFile m4330.cf #undef M4330 #define M4330Architecture #endif /* M4330 */ #ifdef macII /* A/UX cpp has no unique symbol: build imake with BOOTSTRAPCFLAGS=-DmacII */ #define MacroIncludeFile #define MacroFile macII.cf #undef macII #define MacIIArchitecture #endif /* macII */ #ifdef CRAY #define MacroIncludeFile #define MacroFile cray.cf #undef cra( y #undef CRAY #define CrayArchitecture #endif /* CRAY */ #ifdef sgi #define MacroIncludeFile #define MacroFile sgi.cf #undef sgi #define SGIArchitecture #undef mips #define MipsArchitecture #endif #ifdef stellar #define MacroIncludeFile #define MacroFile stellar.cf #undef stellar #define StellarArchitecture #endif /* * A convenience for people running on rt's since they define ibm032, and for * people running AIX (note that AOS will no longer be supported by IBM). */ #if defined(ibm032) && !defined(ibm) #define ibm #endif #if defined(aix) && !defined(ibm) #define ibm #endif #if defined(ibm) #define MacroIncludeFile #define MacroFile ibm.cf #undef ibm #define IBMArchitecture #ifdef i386 #undef i386 #define PS2Architecture #endif #ifdef ibm032 #undef ibm032 #define RtArchitecture #endif #ifdef aix #undef aix #define AIXArchitecture #endif #endif /* ibm */ #ifndef MacroIncludeFile #define MacroIncludeFile #define MacroFile generic.cf #endif /**************************************************************************** * * * DO NOT MODIFY BELOW THIS LINE * * * ****************************************************************************/ #include MacroIncludeFile /* * defaults for various generic parameters; */ #ifndef SystemV #ifdef SYSV #define SystemV YES /* need system 5 style */ #else #define SystemV NO /* bsd */ #endif #endif #ifndef OSMajorVersion #define OSMajorVersion 0 #endif #ifndef OSMinorVersion #define OSMinorVersion 0 #endif #ifndef UnalignedReferencesAllowed #define UnalignedReferencesAllowed NO /* if arbitrary deref is okay */ #endif #ifndef ExecableScripts #ifdef SYSV #define ExecableScripts NO #else #define ExecableScripts YES /* kernel exec() can handle #! */ #endif #endif #ifndef BourneShell /* to force shell in makefile */ #define BourneShell /bin/sh #endif #ifndef ConstructMFLAGS #if SystemV #define ConstructMFLAGS YES /* build MFLAGS from MAKEFLAGS */ #else #define ConstructMFLAGS NO /* build MFLAGS from MAKEFLAGS */ #endif #endif #ifndef HasLargeTmp #define HasLargeTmp NO /* be paranoid */ #endif #ifndef HasSockets #if SystemV #define HasSockets NO /* not yet... */ #else #define HasSockets YES /* bsd does have them */ #endif #endif #ifndef HasVFork #if SystemV #define HasVFork NO /* not yet... */ #else #define HasVFork YES #endif #endif #ifndef HasPutenv #define HasPutenv NO /* assume not */ #endif #ifndef HasVoidSignalReturn #if SystemV #define HasVoidSignalReturn YES #else #define HasVoidSignalReturn NO /* may or may not be true */ #endif #endif #ifndef HasBsearch #if SystemV #define HasBsearch YES #else #define HasBsearch NO /* stupid systems */ #endif #endif #ifndef HasSaberC #define HasSaberC NO /* for people unclear on the concept */ #endif #ifndef HasFortran #define HasFortran NO #endif #ifndef HasNdbm #define HasNdbm NO #endif #ifndef HasDESLibrary #define HasDESLibrary NO /* if you have any DES library */ #endif #ifndef NeedFunctionPrototypes #define NeedFunctionPrototypes NO #endif #ifndef NeedWidePrototypes #define NeedWidePrototypes YES /* mix and match ANSI-C, non-ANSI */ #endif #ifndef HasSunOSSharedLibraries #define HasSunOSSharedLibraries NO #endif #ifndef SharedCodeDef #if HasSunOSSharedLibraries #define SharedCodeDef -DSHAREDCODE #else #define SharedCodeDef /**/ #endif #endif #ifndef SharedLibraryDef #if HasSunOSSharedLibraries #define SharedLibraryDef -DSUNSHLIB /* eventually will be SVR4SHLIB... */ #ifndef HasSharedLibraries #define HasSharedLibraries YES #endif #else #define SharedLibraryDef /**/ #ifndef HasSharedLibraries #define HasSharedLibraries NO #endif #endif #else #ifndef HasSharedLibraries #define HasSharedLibraries NO #endif #endif #ifndef StripInstalledPrograms #define StripInstalledPrograms NO /* leave symbol table just in case */ #endif #ifndef DestDir #define DestDir /* as nothing */ #endif #ifndef UsrLibDir /* if changed under SunOS with shared */ #define UsrLibDir $(DESTDIR)/usr/lib /* libs, then need to run ldconfig */ #endif /* as root */ #ifndef IncRoot #define IncRoot $(DESTDIR)/usr/include #endif #ifndef UNCOMPRESSPATH #define UNCOMPRESSPATH /usr/ucb/uncompress #endif #ifndef OptimizedCDebugFlags #define OptimizedCDebugFlags -O #endif #ifndef DebuggableCDebugFlags #define DebuggableCDebugFlags -g #endif #ifndef NoOpCDebugFlags #define NoOpCDebugFlags /* as nothing */ #endif #ifndef DefaultCDebugFlags #define DefaultCDebugFlags OptimizedCDebugFlags #endif #ifndef LibraryCDebugFlags #define LibraryCDebugFlags OptimizedCDebugFlags #endif #ifndef DefaultCCOptions #define DefaultCCOptions /* as nothing: this is for floating point, etc. */ #endif #ifndef LibraryCCOptions #define LibraryCCOptions DefaultCCOptions #endif #ifndef ServerCCOptions #define ServerCCOptions DefaultCCOptions #endif #ifndef PexCDebugFlags #define PexCDebugFlags -g #endif #ifndef InstPgmFlags #define InstPgmFlags -s #endif #ifndef InstBinFlags #define InstBinFlags -m 0755 #endif #ifndef InstUidFlags #define InstUidFlags -m 4755 #endif #ifndef InstLibFlags #define InstLibFlags -m 0664 #endif #ifndef InstIncFlags #define InstIncFlags -m 0444 #endif #ifndef InstManFlags #define InstManFlags -m 0444 #endif #ifndef InstDatFlags #define InstDatFlags -m 0444 #endif #ifndef InstKmemFlags #define InstKmemFlags InstUidFlags /* put -g kmem -m 2755 in site.def... */ #endif #ifndef ArCmd #if HasLargeTmp #define ArCmd ar cq /* use /tmp for temp files */ #else #define ArCmd ar clq /* use local dir for temp files */ #endif #endif #ifndef BootstrapCFlags #define BootstrapCFlags /**/ #endif #ifndef CcCmd #define CcCmd cc #endif #ifndef HasGcc #define HasGcc NO #endif #ifndef ServerCcCmd #define ServerCcCmd CcCmd #endif #ifndef LibraryCcCmd #define LibraryCcCmd CcCmd #endif #if HasFortran #ifndef FortranCmd /* for xgks */ #define FortranCmd f77 #endif #ifndef FortranFlags #define FortranFlags /**/ #endif #ifndef FortranDebugFlags #define FortranDebugFlags /**/ /* for -O or -g */ #endif #endif #ifndef AsCmd #define AsCmd as #endif #ifndef CompressCmd #define CompressCmd compress #endif #ifndef CppCmd #define CppCmd /lib/cpp #endif #ifndef PreProcessCmd #define PreProcessCmd CcCmd -E #endif #ifndef InstallCmd #if SystemV #define InstallCmd $(SCRIPTSRC)/bsdinst.sh /* hack should be in project */ #else #define InstallCmd install #endif #endif #ifndef LdCmd #define LdCmd ld #endif #ifndef LintCmd #define LintCmd lint #endif #ifndef LintLibFlag #if SystemV #define LintLibFlag -o #else #define LintLibFlag -C #endif #endif #ifndef LintOpts #if SystemV #define LintOpts -ax #else #define LintOpts -axz #endif #endif #ifndef CpCmd #define CpCmd cp #endif #ifndef LnCmd #if SystemV #define LnCmd ln /* or even cp */ #else #define LnCmd ln -s #endif #endif #ifndef MakeCmd #define MakeCmd make #endif #ifndef MvCmd #define MvCmd mv #endif #ifndef RanlibCmd #if SystemV #define RanlibCmd /bin/true #else #define RanlibCmd ranlib #endif #endif #ifndef RanlibInstFlags #define RanlibInstFlags /**/ #endif #ifndef RmCmd #define RmCmd rm -f #endif #ifndef StandardCppDefines #if SystemV #define StandardCppDefines -DSYSV #else #define StandardCppDefines /**/ #endif #endif #ifndef StandardDefines #if SystemV #define StandardDefines -DSYSV #else #define StandardDefines /**/ #endif #endif #ifndef NdbmDefines #if HasNdbm #define NdbmDefines -DNDBM #else #define NdbmDefines /**/ #endif #endif #ifndef ExtraLibraries #define ExtraLibraries /**/ #endif #ifndef ExtraLoadFlags #define ExtraLoadFlags /**/ #endif #ifndef LdCombineFlags #define LdCombineFlags -X -r #endif #ifndef CompatibilityFlags #define CompatibilityFlags /**/ #endif #ifndef CompatibilityFlags2 #define CompatibilityFlags2 /**/ #endif #ifndef TagsCmd #define TagsCmd ctags #endif #ifndef LoaderLibPrefix #define LoaderLibPrefix /**/ /* cray does -l libX11.a */ #endif #ifndef TOPDIR #define TOPDIR . #endif #ifndef CURDIR #define CURDIR . #endif #ifndef Obj #define Obj o #endif #ifndef Lib #define Lib a #endif #ifndef Exe #define Exe #endif #ifndef FilesToClean #define FilesToClean *.CKP *.ln *.BAK *.bak *.o core errs ,* *~ *.a .emacs_* tags TAGS make.log MakeOut #endif SHELL = BourneShell OBJ = Obj LIB = Lib OPT = Opt EXE = Exe TOP = TOPDIR CURRENT_DIR = CURDIR AR = ArCmd BOOTSTRAPCFLAGS = BootstrapCFlags /* set if cpp doesn't have uniq sym */ CC = CcCmd #if HasFortran FC = FortranCmd FDEBUGFLAGS = FortranDebugFlags FCFLAGS = FortranFlags $(FDEBUGFLAGS) #endif COMPRESS = CompressCmd CPP = CppCmd $(STD_CPP_DEFINES) /* simple filters */ PREPROCESSCMD = PreProcessCmd $(STD_CPP_DEFINES) /* prefered; mdep */ INSTALL = InstallCmd LD = LdCmd LINT = LintCmd LINTLIBFLAG = LintLibFlag LINTOPTS = LintOpts LN = LnCmd MAKE = MakeCmd MV = MvCmd CP = CpCmd RANLIB = RanlibCmd RANLIBINSTFLAGS = RanlibInstFlags RM = RmCmd STD_INCLUDES = StandardIncludes STD_CPP_DEFINES = StandardCppDefines STD_DEFINES = StandardDefines EXTRA_LIBRARIES = ExtraLibraries TAGS = TagsCmd #if ConstructMFLAGS MFLAGS = -$(MAKEFLAGS) #endif #if HasSharedLibraries SHAREDCODEDEF = SharedCodeDef SHLIBDEF = SharedLibraryDef #endif #if !HasVoidSignalReturn SIGNAL_DEFINES = -DSIGNALRETURNSINT #endif /* * The following crap is necessary to support forcing of function prototypes */ #if NeedFunctionPrototypes #define _funcprotodef -DFUNCPROTO #else #define _funcprotodef /**/ #endif #if NeedWidePrototypes #define _wideprotodef /**/ #else #define _wideprotodef -DNARROWPROTO #endif PROTO_DEFINES = _funcprotodef _wideprotodef #undef _funcprotodef #undef _wideprotodef #if StripInstalledPrograms INSTPGMFLAGS = InstPgmFlags /* install flags for stripping */ #else INSTPGMFLAGS = #endif INSTBINFLAGS = InstBinFlags /* install flags for programs */ INSTUIDFLAGS = InstUidFlags /* install flags for setuid programs */ INSTLIBFLAGS = InstLibFlags /* install flags for libraries */ INSTINCFLAGS = InstIncFlags /* install flags for headers */ INSTMANFLAGS = InstManFlags /* install flags for man pages */ INSTDATFLAGS = InstDatFlags /* install flags for data files */ INSTKMEMFLAGS = InstKmemFlags /* install flags for /dev/kmem progs */ DESTDIR = DestDir /* root of install */ LDOPTIONS = /* command-line overwrites this with -g or "/debug" */ CCOPTIONS = DefaultCCOptions /* to distinguish from param flags */ #ifndef vms /* * STD_INCLUDES contains system-specific includes * TOP_INCLUDES specifies how to get to /usr/include or its build substitute * EXTRA_INCLUDES contains project-specific includes set in project incfiles * INCLUDES contains client-specific includes set in Imakefile */ TOP_INCLUDES = /* We don't use relative path's */ ALLINCLUDES = $(INCLUDES) $(STD_INCLUDES) $(TOP_INCLUDES) $(EXTRA_INCLUDES) ALLDEFINES = $(ALLINCLUDES) $(STD_DEFINES) $(PROTO_DEFINES) $(DEFINES) $(COMPATFLAGS) CFLAGS = $(CCOPTIONS) $(CDEBUGFLAGS) $(ALLDEFINES) UIL_INCLUDES = -I/usr/include/X11 -I/usr/include/X11/uil UIL = /usr/bin/uil #endif LINTFLAGS = $(LINTOPTS) -DLINT $(ALLDEFINES) LDLIBS = $(SYS_LIBRARIES) $(EXTRA_LIBRARIES) LDCOMBINEFLAGS = LdCombineFlags MACROFILE = MacroFile RM_CMD = $(RM) FilesToClean CONFIGSRC = ConfigSrcDir UTILSRC = UtilSrcDir DEPENDSRC = DependDir IMAKESRC = ConfigSrcDir MOTIF = MotifRoot IMAKE_DEFINES = /* leave blank, for command line use only */ IMAKE_CMD = $(IMAKE) $(IMAKE_DEFINES) ICONFIGFILES = $(IRULESRC)/Imake.tmpl $(IRULESRC)/Imake.rules $(IRULESRC)/Project.tmpl $(IRULESRC)/site.def $(IRULESRC)/$(MACROFILE) $(EXTRA_ICONFIGFILES) #ifdef VaxArchitecture ARCH = vax #endif #ifdef MipsArchitecture ARCH = mips #endif #include #include INCLUDE_IMAKEFILE #ifdef vms /* * STD_INCLUDES contains system-specific includes * TOP_INCLUDES specifies how to get to /usr/include or its build substitute * EXTRA_INCLUDES contains project-specific includes set in project incfiles * INCLUDES contains client-specific includes set in Imakefile */ TOP_INCLUDES = /* We don't use relativ!e path's */ ALLINCLUDES = $(INCLUDES) $(STD_INCLUDES) $(TOP_INCLUDES) $(EXTRA_INCLUDES) ALLDEFINES = $(STD_DEFINES) $(PROTO_DEFINES) $(DEFINES) $(COMPATFLAGS) CFLAGS = $(CCOPTIONS) $(CDEBUGFLAGS) $(ALLDEFINES) UIL_INCLUDES = $(CURRENT_DIR),ccrb:[$(COMPONENT)],ccr$:[ccr.uigen],decw$include:,sys$library: UIL = UIL/MOTIF #endif /* * These need to be here so that rules in Imakefile occur first; the blank * all is to make sure that an empty Imakefile doesn't default to make clean. */ emptyrule:: #ifndef IHaveSpecialMakefileTarget MakefileTarget() #endif #ifndef vms TagsTarget() #else /* vms */ .suffixes .cxx .hxx .obj .uid .uil .uil~ .uigl .uigl~ .sdl .sdl~ .msg .msg~ \ .opt .opt~ .com .com~ .dat .dat~ .lex .lex~ .idl .idl~ \ .imakefile .imakefile~ .sql .sql~ .sh .sh~ .til .til~ \ .hlb .hlp .hlp~ .man .man~ .rnh .rnh~ \ .col .col~ .cohesion_depends .cohesion_depends~ \ .crl .crl~ .cohesion_functions .cohesion_functions~ .cxx.obj ! Cxx action line support @@\ cxx $(CDEBUGFLAGS) $(MMS$SOURCE) .uil~.uil ! fetch rule for UIL source file @@\ $(CMS) FETCH $(MMS$SOURCE) $(CMSFLAGS) "" .opt~.opt ! fetch rule for LINK options file @@\ $(CMS) FETCH $(MMS$SOURCE) $(CMSFLAGS) "" .com~.com ! fetch rule for DCL command procedure @@\ $(CMS) FETCH $(MMS$SOURCE) $(CMSFLAGS) "" .dat~.dat ! fetch rule for DECwindows resource default @@\ $(CMS) FETCH $(MMS$SOURCE) $(CMSFLAGS) "" .lex~.lex ! fetch rule for LEX source file @@\ $(CMS) FETCH $(MMS$SOURCE) $(CMSFLAGS) "" .man~.man ! fetch rule for U*IX help file @@\ $(CMS) FETCH $(MMS$SOURCE) $(CMSFLAGS) "" .imakefile~.imakefile ! fetch rule for IMAKE source file @@\ $(CMS) FETCH $(MMS$SOURCE) $(CMSFLAGS) "" .uigl~.uigl ! fetch rule for UIGEN source file @@\ $(CMS) FETCH $(MMS$SOURCE) $(CMSFLAGS) "" .sql~.sql ! fetch rule for SQL source file @@\ $(CMS) FETCH $(MMS$SOURCE) $(CMSFLAGS) "" .idl~.idl ! fetch rule for NIDL source file @@\ $(CMS) FETCH $(MMS$SOURCE) $(CMSFLAGS) "" .sh~.sh ! fet%ch rule for SHELL scripts @@\ $(CMS) FETCH $(MMS$SOURCE) $(CMSFLAGS) "" .hlp~.hlp ! fetch rule for Help files @@\ $(CMS) FETCH $(MMS$SOURCE) $(CMSFLAGS) "" .sdl~.sdl ! fetch rule for SDL source file @@\ $(CMS) FETCH $(MMS$SOURCE) $(CMSFLAGS) "" .col~.col ! fetch rule for COL source file @@\ $(CMS) FETCH $(MMS$SOURCE) $(CMSFLAGS) "" .crl~.crl ! fetch rule for CRL source file @@\ $(CMS) FETCH $(MMS$SOURCE) $(CMSFLAGS) "" .rnh~.rnh ! fetch rule for RUNOFF source file @@\ $(CMS) FETCH $(MMS$SOURCE) $(CMSFLAGS) "" .msg~.msg ! fetch rule for MESSAGE source file @@\ $(CMS) FETCH $(MMS$SOURCE) $(CMSFLAGS) "" #endif /* vms */ #ifdef MakefileAdditions MakefileAdditions() #endif #ifdef IHaveSubdirs InstallSubdirs($(SUBDIRS)) InstallManSubdirs($(SUBDIRS)) CleanSubdirs($(SUBDIRS)) TagSubdirs($(SUBDIRS)) MakefileSubdirs($(SUBDIRS)) IncludesSubdirs($(SUBDIRS)) #else Makefiles:: clean:: @@\ $(RM_CMD) #ifndef vms includes:: #else /* vms */ includes:: @@\ ! Includes build completed. #endif /* vms */ #endif /* if subdirectory rules are needed */ #ifndef vms depend:: #else /* vms */ depend:: @@\ ! Depend build completed. #endif /* vms */ #ifndef vms fetch:: #else /* vms */ fetch:: @@\ ! Fetch build completed. #endif /* vms */ #ifndef vms firstdepend:: regdepend:: #else /* vms */ firstdepend:: @@\ ! Firstdepend build completed. regdepend:: @@\ ! Regdepend build completed. #endif /* vms */ #ifndef vms map:: #else /* vms */ map:: @@\ ! Map build completed. #endif /* vms */ *[IMAKE.BINARY]MAKEDEPEND.EXE;1+,kW+./@ 4-V0123 KPWO56\ Yc7e^89G@HJ*0D`0205 Ych(j MAKEDEPENDV1.0< Yc05-13   $ 12@  ? ! VAXCRTL_001! LIBRTL_001O! MTHRTL_001 not in %s /: not in %s /:%s%s not in %s out of space: increase MAXFILES %s includes %s more than once! Already have %s ififdefifndefelseendifdefineundefincludelinepragmaerroridentsccselifejectvax1vms1.obj# DO NOT DELETE THIS LINE -- make depend depends on it.got signal %d makedepend---s flag's value should start %s with '#'.ignoring option %s c$include:sys$library: cannot open "%s" cannot allocate mem cannot read all of %s makefile.mmsmakefile.mmsMakefileMakefile[mM]akefile is not present rcannot open "%s" %s.bakcannot rename %s to %s wcannot open "%s" Adding new delimiting line "%s" and dependencies... %s: errno: %d, %s, line %d: incomplete undef == "%s" %s (reading %s): %s: line %d: unknown directive == "%s" %s (reading %s): %s: line %d: incomplete include == "%s" %s, line %d: unknown directive == "%s" define() botch %s (reading %s): %s: cannot find include file "%s" %s%s : %s # %s includes: # %s4 jN<^Y"[ϡZЬSЬT Uե'PTeaP  P!Uեܕ1 ~T3P[TXTWkV!kﭻRARkR ߩ/X P WЦf W PfVUP Ti1-SSPRRSPbPP/P] P:RRSߩ TPVTvVPSRRS Tjf-SRWW~SjUWVFjTjVWVVV7 TjP1jjP[jWTVkS!kyRARkR ߩ/f W P VУc V PcSUP jߩ 1Rb1PߩTpPST`SP1TbߩjXjj/P[jXTWkV!k啕SASkS ߩ/ XP W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,РSRՠ !PcUPTRSЬPR {ЬRTP^ЬR bbݬ PRPRbPP^2P|^VTЬSЬRТPPUբxPPѢP~բ PxP~ݢPP~PТP PPPQPxQQAQaPxPPPUТPPUPxPPѢP SRbPPP@dPb_RbPPP@dPb_bSPeb b  Rb b RP^T~ݬ ЬSݣPRYЬPSPݣݠd ݣߤݬ ߤz[~ݬ ЬPݠPR=Rݬ*ݢPSݬRSS<^ЬSЬTЬ UѣT UTS"Rգ PUTBRR <^T܊UЬSݣPRRPPѬe2Ьeݣ=ݬ ߤ8\APPR ݣPPP(RP`P`/:`P`R գeݣߤCRգ BP`ߤSRR @@ $l$ld|LdD8 , t ~ @VAXCRTLLIBRTLMTHRTL~~~~*[IMAKE.BINARY]MAKEINCLUDE.COM;1+,Y . /@ 4E -V0123KPWO 56$̔7^89G@HJ$! MAKEINCLUDE.COM $! $! P1 = name of MMS .INCLUDE file to contain dependencies $! P2 = blank separated list of #include directories to exclude $! P3 = name of MMS .MMS file containing dependencies $! $! Open MAKEFILE.MMS and extract all the dependencies that $! were inserted by MAKEDEPEND into a .INCLUDE MMS file. $! $! =============================================================== $! NOTE: In order to prevent spurious CMS RESERVE/REPLACE $! the symbol IMAKESTATUS is set globally here $! because MMS d# -~ IMAKE.SAVY V[IMAKE.BINARY]MAKEINCLUDE.COM;1E 3oesn't preserve the original $STATUS $! which could then be tested in succeeding actions. $! =============================================================== $ $ set noon $ on control_y then goto ABORT $ $! Define common commands to default conditions $ copy := COPY/NOLOG $ close := CLOSE/NOLOG $ delete := DELETE/NOLOG/NOCONF $ open := OPEN $ read := READ $ write := WRITE $ $! Initialize program flags to default conditions $ abort_flag = 0 $ found_flag = 0 $ exclude_flag = 0 $ $ if (P1 .EQS. "") then P1 = "DEPEND.MMS" $ if (P2 .NES. "") $ then $ exclude_flag = 1 $ P2 = " " + F$EDIT(P2,"TRIM,COMPRESS,UPCASE") + " " $ endif $ if (P3 .EQS. "") then P3 = "MAKEFILE.MMS" $ $! Initialize file names to default conditions $ imaketmp = "" $ newmakefile = "" $ newfile = "newmakefile" $ makefile = P3 $ $! Open original MMS file for READ_ONLY to establish INPUT file $ open/read/error=EOF makefile 'makefile' $ $! Open tenative MMS file for APPEND to establish OUTPUT file $ copy _nl: 'makefile' $ newmakefile = F$SEARCH(makefile) $ open/append/error=ABORT newmakefile 'makefile' $ $! Open tenative MMS depend file for APPEND to establish OUTPUT file $ copy _NL: 'P1' $ imaketmp = F$SEARCH(P1) $ open/append/error=ABORT imaketmp 'P1' $ $LOOP: $ read/end=EOF makefile line $ if F$LENGTH(F$EDIT(line,"TRIM,COMPRESS")) .EQ. 0 $ then $ line = "" $ module = line $ else $ if .NOT. found_flag $ then $ if F$LOCATE("# DO NOT DELETE",line) .EQ. 0 $ then $ found_flag = 1 $ newfile = "imaketmp" $ module = "" $ endif $ else $ line = F$EDIT(line,"TRIM,COMPRESS") $ if exclude_flag $ then $ gosub STRIP_EXCLUDES $ if F$LENGTH(line) .EQ. 0 then goto LOOP $ endif $ if F$ELEMENT(0," ",line) .NES. module $ then $ if (module .NES. "") then write 'newfile' "" $ module = F$ELEMENT(0," ",line) $ endif $ endif $ endif $!========================================================= $! This is really stupidly bogus DCL, but it works for now. $! $ if F$LENGTH(line) .LT. 256 $ then $ write 'newfile' line $ else $ line1 = F$EXTRACT( 0,255,line) $ line2 = F$EXTRACT(255,255,line) $ line3 = F$EXTRACT(510,255,line) $ line4 = F$EXTRACT(765,255,line) $ write 'newfile' line1,line2,line3,line4 $ endif $! $! End of really stupidly bogus DCL workaround $!========================================================= $ goto LOOP $ $ABORT: $ abort_flag = 1 $EOF: $ close makefile $ close newmakefile $ close imaketmp $ if abort_flag .OR. (.NOT. found_flag) $ then $ found_flag = 3 $ if (imaketmp .NES. "") then delete 'imaketmp' $ if (newmakefile .NES. "") then delete 'newmakefile' $ else $ @ccr$util:STREAM_LF 'P1' /nolog $ endif $ imakestatus :== 'found_flag' $ exit (%x10000000 .OR. found_flag) $ $! Subroutine to strip out extraneous #include directories $ $STRIP_EXCLUDES: $ linex = "" $ n = -1 $STRIP_LOOP: $ n = n + 1 $ element = F$ELEMENT(n," ",line) $ if (element .EQS. " ") $ then $ line = linex $ if F$EXTRACT(F$LENGTH(line)-3,3,line) .EQS. " : " then line = "" $ return $ endif $ excludedir = " " + F$EDIT(F$ELEMENT(0,":",element),"UPCASE") + ": " $ if F$LOCATE(excludedir,P2) .EQ. F$LENGTH(P2) $ then $ linex = linex + element + " " $ endif $ goto STRIP_LOOP *[IMAKE.BINARY]SITE.DEF;1+,Z./@ 4-V0123KPWO5 6h.O7^89G@HJTOP_INCLUDES = /* We don't use relative path's */ CONFIGSRC = ConfigSrcDir UTILSRC = UtilSrcDir DEPENDSRC = DependDir IMAKESRC = ConfigSrcDir *[IMAKE.BINARY]VMS.CF;1+,kZ. /@ 4T -V0123KPWO 56-6;'7 I^89G@HJ/* vms.cf ** Imake VMS platform-specific configuration file */ /* Copyright (c) Digital Equipment Corporation, 1990, 1992. ** All Rights Reserved. Unpublished rights reserved ** under the copyright laws of the United States. ** ** The software contained on this media is proprietary ** to and embodies the confidential technology of ** Digital Equipment Corporation. Possession, use, ** duplication or dissemination of the software and ** media is authorized only pursuant to a valid written ** license from Digital Equipment Corporation. ** ** RESTRICTED RIGHTS LEGEND Use, duplication, or ** disclosure by the U.S. Government is subject to ** restrictions as set forth in Subparagraph (c)(1)(ii) ** of DFARS 252.227-7013, or in FAR 52.227-19, as ** applicable. ** ** FACILITY: ** ** Customized Imake for Portable DTM effort ** ** ABSTRACT: ** ** This file contains the platform specific definitions for ** building MMS / make files. Typically this involves file ** name and command definitions. This file is included in ** Imake.tmpl . ** ** AUTHORS: ** ** Kenneth B. Miller ** ** ** CREATION DATE: 19 November 1990 ** **/ #define OSName VMS V5.5-2 #define OSMajorVersion 5 #define OSMinorVersion 5 #define echo write sys$output #define ArCmd library #define AsCmd macro #define BourneShell write sys$output "Shell not available on VMS." #define CompressCmd write sys$output "Compress not available on VMS." #define CURDIR 'f$extract(0,f$length(f$parse(""))-2,f$parse(""))' #define CpCmd copy/noconf/log #define CppCmd cpp #define DefaultCCOptions #define DebuggableCDebugFlags DefaultCDebugFlags #define ExecableScripts NO #define FilesToClean *.obj;*,*.map;*,*.lis;*,*.exe;*,*.tmp;*,*.olb;*,*.ana;*,*.opt;* #define HasBsearch NO #define HasGcc NO #define HasPutenv NO #define HasSaberC NO #define HasSharedLibraries YES #define HasSockets NO #define HasVoidSignalReturn NO #define IncRoot decw$include: #define InstallCmd copy/log #define InstBinFlags /prot=(o:rewd,g:re,w:re) #define InstDatFlags /prot=(o:r,g:r,w:r) #define InstIncFlags /prot=(o:r,g:r,w:r) #define InstLibFlags /prot=(o:rwed,g:r,w:r) #define InstManFlags /prot=(o:r,g:r,w:r) #define InstPgmFlags #define InstUidFlags /prot=(o:rewd,g:re,w:re) #define LdCmd link #define LdCombineFlags #define LintCmd cc/standard=portable/noobj/list #define LintLibFlag #define LintOpts #define LnCmd copy/noconf/log #define MakeCmd mms/descrip=Makefile #define ImakeCmd imake #define MvCmd rename/noconf/log #define NeedWidePrototypes YES #define OptimizedCDebugFlags DefaultCCOptions #define PexCDebugFlags DefaultCCOptions #define PreProcessCmd CppCmd #define RanlibCmd write sys$output "Ranlib not necessary!" #define RmCmd delete/noconf/log #define SystemV NO #define TagsCmd write sys$output "Tags not available on VMS." #define TOPDIR 'f$extract(0,f$locate("[",f$parse("")),f$parse("")))'[000000] #define UnalignedReferencesAllowed YES #define Obj obj #define Lib olb #define Opt .opt #define Exe .exe #define SHELLPATH #define BDFTONLFFILT #define ZBDFTOSNFFILT #define DefaultFontPath #define DefaultRGBDatabase #define DefaultUserPath #define DefaultSystemPath #define ConfigSrcDir imake$binary: #define UtilSrcDir imake$binary: #define DependDir imake$binary: #define StandardIncludes /* Defined in CCRLOGIN.COM for c$include */ EXTRA_INCLUDES = /* not used on VMS */ IRULESRC = imake$binary: IMAKE = $(IMAKESRC)imake DEPEND = $(DEPENDSRC)makedepend MAKEINCLUDE = $(UTILSRC)makeinclude LINKLIB = /* Not used on VMS */ BLISS = BLISSX ! Make BLISS really be BLISS SET = SET MACRO = MACRO MESSAGE = MESSAGE SDL = SDL LIBRARY = LIBRARY LIBR = LIBRARY LINK = LINK *[IMAKE]CPP.DIR;1+,Z./@ 4-R0123 KPWO56<7 89G@HJI BUILD.DIRZCPP.MEMr CPP.READMErCPP.RNOr*[IMAKE.CPP]BUILD.DIR;1+,Z./@ 4-Z0123 KPWO56`Ω7@89G@HJI BUILDME.COMZCPP.EXE [ CPP.H\ CPP.IMAKEFILE\_CPP.OPT_CPP1.C_7CPP1.OBJyqCPP2.CqCPP2.OBJBr CPP3.CSrCPP3.OBJqr&CPP4.CtrCPP4.OBJwr-CPP5.CyrCPP5.OBJrCPP6.CrCPP6.OBJrCPPDEF.Hr  MAKEFILE.BAKr MAKEFILE.INIr MAKEFILE.MMSr*[IMAKE.CPP.BUILD]BUILDME.COM;1+,Z./@ 40^-Z0123KPWO56`Wc7@^89G@HJ$!0$! The make commands used to build this program.$!$ $ make env $ make opt$ make*[IMAKE.CPP.BUILD]CPP.EXE;1+, [ .0/@ 40,-Z0123 KPWO,56vXc7`*^89G@HJP0D`0205XchBCPPV1.0CXc05-13  ! @ * ? ! VAXCRTL_001! LIBRTL_001O! MTHRTL_001vaxvmsvax11c__LINE____FILE__-rat=crrfm=varmrs=4096Can't open output file "%s"-rCan't open input file "%s"Inside #ifdef block at end of input, depth = %d%d errors in preprocessor %d error in preprocessor #%s %d "%s"lineassertdefineelifelseendifififdefifndefincludelinepragmaundefControl line "%s" within macro expansion#%s may not follow #elseToo many nested #%s statements#%s must be in an #ifPreprocessor assertion failure#pragma Illegal # command "%s"Unexpected text in #control line ignored#if, #ifdef, or #ifndef without an argument.HCannot open include file "%s"#include syntax errorFilename work buffer overflow%s%srC$LIBRARYC$LIBRARY:SYS$LIBRARY:1Too many include directories-S, too few values specified in %s-S, too many values, "%s" unused"%s" wasn't definedUnknown option "%s"The following options are valid: -C Write source file comments to output -Dsymbol=value Define a symbol with the given (optional) value -Idirectory Add a directory to the #include search list -N Don't predefine target-specific names -Stext Specify sizes for #if sizeof -Usymbol Undefine symbol Too many file arguments. Usage: cpp [input [output]]1__DATE__rarat=crrfm=varToo many arguments for macroStrange character after # (%d.)Redefining defined variable "%s"#define syntax errorIllegal #undef argumentMacro work area overflowMacro work area overflowRecursive macro definition of "%s"(Defined by "%s") %d"%s"Bug: Illegal __ macro "%s"Macro "%s" needs argumentsWrong number of macro arguments for "%s"Too many arguments in macro expansionend of file within macro argumentOut of space in macro "%s" arg expansionend of expressionvalid+-*/%<<>>&|^==!=<<=>=>&&||?:,unary +unary -~!()(none)charintfloatdoubleshortlongsignedunsignedmisplaced constant in #if#if value stack overflowIllegal #if lineOperator %s in incorrect contextexpression stack overflow at op "%s"unbalanced paren's, op is "%s"Misplaced '?' or ':', previous operator is %sillegal character '%c' in #ifillegal character (%d decimal) in #ifCan't use a string in an #ifdefinedBad #if ... defined() syntaxsizeof!=<>&|\= not allowed in #ifUnexpected \ in #if#if sizeof, unknown type "%s"#if ... sizeof: illegal type combination#if sizeof() error, no type specified#if ... sizeof: bug, unknown type code 0x%x#if ... sizeof() syntax errormulti-byte constant '%c' isn't portable%s by zero in #if, zero result assumedmoddivide#if bug, operand = %d.work buffer overflow doing %s #%s%sStrange character '%c' after #Strange character (%d.) after #Unterminated stringIllegal digit in octal numberWork buffer overflow: %sOut of memoryEOF in commentToo much pushback%sline %d, %s: cpp: %sfrom macro %s from file %s, line %d: %sSErrorIErrorSFatal errorSWarningIWarning  aaiiiYYA99IIQQQQ1)!!ppppx    % , 2 @7 > <1// ECCCA AB D  <^>SU>TݬݬPݬݬP1?Pߣ!ЬRݢ/>Peߣ2ߣ*ߣ#ݢ>PRR @>P`P ~R=P$ЬRݢ>ݢߣ;G;,=ߣWЬRݢ=PEdߣYݢ=P ݢ=ݢߣ[:,=ЬRݢe=edq= P,_=edmyoPPcR Rߣv:V=+==R3RRRæRR/== ,<ݏ<2P ^Y6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SݬPRðQ~Q0ϋ, RPP ^iZ޸WXgSTRѬRR[ PURSReeT~PePRBhޑBhV2fRfRU~U0, c[PgPPSPPTˏTUEoRѢTg2PYbRYSRSSP^uWUЬP` PRRU`ìPXXUˏUQARbSIѣU:ݬP)S+Pcbգ ݣS PcRbSլMXVV*PTǰQ~Q0,jTSbcSbUԣԣ ݬnSPP^V襁W˶ZHY[FXTyRPb\bl\\2\S1բT¢jjТ G3ݢ<~jPbݢТ ݢբ ݢ}RtPߵ\Ь1TPSբ1PТ PT TP jjТ \ԬS 例kSPS/1nkP*AkoU2e\e\P~P0G, J/Pgh/h*eP\g\\ h\\\PP C PB?PP*P*@."?PƾQ~Q"ϒiPP\\*1qP\\/1_kg\ h\ \\ 1\\\2\\LɴC1b\ Pg11P`S\WPP  1~U2eReRT~T0,U ų\PS S  SSPP ^SRb\b\P~P0b, e^9RݬPPݬ^PaPP^UWЬRgScbSݬ ݬgc ݬ ݬgcg Z爐Rբ/SSg0SP@c  g Т RcVPբݢgf@TTݢТPPSТSSgfT|P@d  p.*~ IMAKE.SAV [ Z[IMAKE.CPP.BUILD]CPP.EXE;10\)g Т RP^Rݬݬ"P^Rݬݬ)ϹsP^Rݬݬ0ϕ,(P^uRݬݬ=m^YRݬݬFQ@@"d|tl LDt 4\<|t40 8 , t ~ @VAXCRTLLIBRTLMTHRTL~~~~~*[IMAKE.CPP.BUILD]CPP.H;1+,\./@ 4-Z0123KPWO56U7 R^89G@HJ /* * I n t e r n a l D e f i n i t i o n s f o r C P P * * In general, definitions in this file should not be changed. */ #include "errno.h" #ifndef TRUE #define TRUE 1 #define FALSE 0 #endif #ifndef EOS /* * This is predefined in Decus C */ #define EOS '\0' /* End of string */ #endif #define EOF_CHAR 0 /* Returned by get() on eof */ #define NULLST ((char *) NULL) /* Pointer to nowhere (linted) */ #define DEF_NOARGS (-1) /* #define foo vs #define foo() */ /* * The following may need to change if the host system doesn't use ASCII. */ #define DEF_MAGIC 0x1D /* Magic for #defines */ #define TOK_SEP 0x1E /* Token concatenation delim. */ #define COM_SEP 0x1F /* Magic comment separator */ /* * Note -- in Ascii, the following will map macro formals onto DEL + the * C1 control character region (decimal 128 .. (128 + PAR_MAC)) which will * be ok as long as PAR_MAC is less than 33). Note that the last PAR_MAC * value is reserved for string substitution. */ #define MAC_PARM 0x7F /* Macro formals start here */ #if PAR_MAC >= 33 assertion fails -- PAR_MAC isn't less than 33 #endif #define LASTPARM (PAR_MAC - 1) /* * Character type codes. */ #define INV 0 /* Invalid, must be zero */ #define OP_EOE INV /* End of expression */ #define DIG 1 /* Digit */ #define LET 2 /* Identifier start */ #define FIRST_BINOP OP_ADD #define OP_ADD 3 #define OP_SUB 4 #define OP_MUL 5 #define OP_DIV 6 #define OP_MOD 7 #define OP_ASL 8 #define OP_ASR 9 #define OP_AND 10 /* &, not && */ #define OP_OR 11 /* |, not || */ #define OP_XOR 12 #define OP_EQ 13 #define OP_NE 14 #define OP_LT 15 #define OP_LE 16 #define OP_GE 17 #define OP_GT 18 #define OP_ANA 19 /* && */ #define OP_ORO 20 /* || */ #define OP_QUE 21 /* ? */ #define OP_COL 22 /* : */ #define OP_CMA 23 /* , (relevant?) */ #define LAST_BINOP OP_CMA /* Last binary operand */ /* * The following are unary. */ #define FIRST_UNOP OP_PLU /* First Unary operand */ #define OP_PLU 24 /* + (draft ANSI standard) */ #define OP_NEG 25 /* - */ #define OP_COM 26 /* ~ */ #define OP_NOT 27 /* ! */ #define LAST_UNOP OP_NOT #define OP_LPA 28 /* ( */ #define OP_RPA 29 /* ) */ #define OP_END 30 /* End of expression marker */ #define OP_MAX (OP_END + 1) /* Number of operators */ #define OP_FAIL (OP_END + 1) /* For error returns */ /* * The following are for lexical scanning only. */ #define QUO 65 /* Both flavors of quotation */ #define DOT 66 /* . might start a number */ #define SPA 67 /* Space and tab */ #define BSH 68 /* Just a backslash */ #define END 69 /* EOF */ /* * These bits are set in ifstack[] */ #define WAS_COMPILING 1 /* TRUE if compile set at entry */ #define ELSE_SEEN 2 /* TRUE when #else processed */ #define TRUE_SEEN 4 /* TRUE when #if TRUE processed */ /* * Define bits for the basic types and their adjectives */ #define T_CHAR 1 #define T_INT 2 #define T_FLOAT 4 #define T_DOUBLE 8 #define T_SHORT 16 #define T_LONG 32 #define T_SIGNED 64 #define T_UNSIGNED 128 #define T_PTR 256 /* Pointer */ #define T_FPTR 512 /* Pointer to functions */ /* * The DEFBUF structure stores information about #defined * macros. Note that the defbuf->repl information is always * in malloc storage. */ typedef struct defbuf { struct defbuf *link; /* Next define in chain */ char *repl; /* -> replacement */ int hash; /* Symbol table hash */ int nargs; /* For define(args) */ char name[1]; /* #define name */ } DEFBUF; /* * The FILEINFO structure stores information about open files * and macros being expanded. */ typedef struct fileinfo { char *bptr; /* Buffer pointer */ int line; /* for include or macro */ FILE *fp; /* File if non-null */ struct fileinfo *parent; /* Link to includer */ char *filename; /* File/macro name */ char *progname; /* From #line statement */ unsigned int unrecur; /* For macro recursion */ char buffer[1]; /* current input line */ } FILEINFO; /* * The SIZES structure is used to store the values for #if sizeof */ typedef struct sizes { short bits; /* If this bit is set, */ short size; /* this is the datum size value */ short psize; /* this is the pointer size */ } SIZES; /* * nomacarg is a built-in #define on Decus C. */ #ifdef nomacarg #define cput output /* cput concatenates tokens */ #else #if COMMENT_INVISIBLE #define cput(c) { if (c != TOK_SEP && c != COM_SEP) putchar(c); } #else #define cput(c) { if (c != TOK_SEP) putchar(c); } #endif #endif #ifndef nomacarg #define streq(s1, s2) (strcmp(s1, s2) == 0) #endif /* * Error codes. VMS uses system definitions. * Decus C codes are defined in stdio.h. * Others are cooked to order. */ #if HOST == SYS_VMS #include #include #define IO_NORMAL (SS$_NORMAL | STS$M_INHIB_MSG) #define IO_ERROR SS$_ABORT #endif /* * Note: IO_NORMAL and IO_ERROR are defined in the Decus C stdio.h file */ #ifndef IO_NORMAL #define IO_NORMAL 0 #endif #ifndef IO_ERROR #define IO_ERROR 1 #endif /* * Externs */ extern int line; /* Current line number */ extern int wrongline; /* Force #line to cc pass 1 */ extern char type[]; /* Character classifier */ extern char token[IDMAX + 1]; /* Current input token */ extern int instring; /* TRUE if scanning string */ extern int inmacro; /* TRUE if scanning #define */ extern int errors; /* Error counter */ extern int recursion; /* Macro depth counter */ extern char ifstack[BLK_NEST]; /* #if information */ #define compiling ifstack[0] extern char *ifptr; /* -> current ifstack item */ extern char *incdir[NINCLUDE]; /* -i directories */ extern char **incend; /* -> active end of incdir */ extern int cflag; /* -C option (keep comments) */ extern int eflag; /* -E option (ignore errors) */ extern int nflag; /* -N option (no pre-defines) */ extern int rec_recover; /* unwind recursive macros */ extern char *preset[]; /* Standard predefined symbols */ extern char *magic[]; /* Magic predefined symbols */ extern FILEINFO *infile; /* Current input file */ extern char work[NWORK + 1]; /* #define scratch */ extern char *workp; /* Free space in work */ #if DEBUG extern int debug; /* Debug level */ #endif extern int keepcomments; /* Don't remove comments if set */ extern SIZES size_table[]; /* For #if sizeof sizes */ extern char *getmem(); /* Get memory or die. */ extern DEFBUF *lookid(); /* Look for a #define'd thing */ extern DEFBUF *defendel(); /* Symbol table enter/delete */ extern char *savestring(); /* Stuff string in malloc mem. */ extern char *strcpy(); extern char *strcat(); extern char *strrchr(); extern char *strchr(); extern long time(); #ifndef vms extern char *sprintf(); /* Lint needs this */ #endif *[IMAKE.CPP.BUILD]CPP.IMAKEFILE;1+,\_./@ 4O-Z0123KPWO56;c7l^89G@HJ/* * There is a bit of a catch-22 here. You might need cpp in order to * generate cpp.... But, for systems on which that isn't a problem, here * is the proper Imakefile. * * For systems upon which it is a problem (like VMS), use the makefile.ini * MMS description file to build CPP the first time (MMS/DESC=makefile.ini). */ #undef StandardDefines #define IHaveSpecialMakefileTarget COMPONENT = cpp OPTIONFILE = $(COMPONENT)$(OPT) VMSOPTIONLINK = , $(OPTIONFILE)/opt CDEBUGFLAGS = /nodebug/optimize INCLUDES = sys$disk:[], sys$library: DEFINES = $(STRINGDEFS) $(STYLE) SRCS = cpp1.c cpp2.c cpp3.c cpp4.c cpp5.c cpp6.c OBJS = cpp1.$(OBJ) , cpp2.$(OBJ) , cpp3.$(OBJ) , \ cpp4.$(OBJ) , cpp5.$(OBJ) , cpp6.$(OBJ) /* * This image will be linked with the fortran RTL sharable and vaxc.olb if * you do not link against the vaxcrtl.exe sharable image. */ ProgramTarget($(COMPONENT),$(OBJS)) /* * The VMS*() option file Imake macros are used to support linking with an * options file. These are noop if OPTIONFILE and VMSOPTIONLINK above are * defined blank. */ VMSOptionFile($(COMPONENT)) VMSLinkOption($(COMPONENT),"! Created by cpp.imakefile") VMSLinkOption($(COMPONENT),"sys$library:vaxcrtl.exe/share") /* Required for "make depend" processing */ MakeDependTarget($(COMPONENT),$(SRCS)) /* Required to re-build this makefile using "make makefile" */ BuildMakefileTarget($(COMPONENT).imakefile, "/cms") /* "make env" will set all these logical names */ EnvDef(c$include,$(INCLUDES)) EnvDef(vaxc$include,$(INCLUDES)) EnvDef(sys,sys$library:) /* "make install" will copy the component file to the destination directory */ InstallTarget($(COMPONENT).exe,imake$bin:*.*;) *[IMAKE.CPP.BUILD]CPP.OPT;1+,_./@ 4<-Z0123KPWO56 oXc7 ^89G@HJ! Created by cpp.imakefilesys$library:vaxcrtl.exe/share*[IMAKE.CPP.BUILD]CPP1.C;1+,_7.0/@ 40/3-Z0123KPWO056-7^89G@HJ(/* * CPP main program. * * Edit history * 21-May-84 MM "Field test" release * 23-May-84 MM Some minor hacks. * 30-May-84 ARF Didn't get enough memory for __DATE__ * Added code to read stdin if no input * files are provided. * 29-Jun-84 MM Added ARF's suggestions, Unixifying cpp. * 11-Jul-84 MM "Official" first release (that's what I thought!) * 22-Jul-84 MM/ARF/SCK Fixed line number bugs, added cpp recognition * of #line, fixed problems with #include. * 23-Jul-84 MM More (minor) include hacking, some documentation. * Also, redid cpp's #include files * 25-Jul-84 MM #line filename isn't used for #include searchlist * #line format is * 25-Jul-84 ARF/MM Various bugs, mostly serious. Removed homemade doprint * 01-Aug-84 MM Fixed recursion bug, remove extra newlines and * leading whitespace from cpp output. * 02-Aug-84 MM Hacked (i.e. optimized) out blank lines and unneeded * whitespace in general. Cleaned up unget()'s. * 03-Aug-84 Keie Several bug fixes from Ed Keizer, Vrije Universitet. * -- corrected arg. count in -D and pre-defined * macros. Also, allow \n inside macro actual parameter * lists. * 06-Aug-84 MM If debugging, dump the preset vector at startup. * 12-Aug-84 MM/SCK Some small changes from Sam Kendall * 15-Aug-84 Keie/MM cerror, cwarn, etc. take a single string arg. * cierror, etc. take a single int. arg. * changed LINE_PREFIX slightly so it can be * changed in the makefile. * 31-Aug-84 MM USENET net.sources release. * 7-Sep-84 SCH/ado Lint complaints * 10-Sep-84 Keie Char's can't be signed in some implementations * 11-Sep-84 ado Added -C flag, pathological line number fix * 13-Sep-84 ado Added -E flag (does nothing) and "-" file for stdin. * 14-Sep-84 MM Allow # 123 as a synonym for #line 123 * 19-Sep-84 MM scanid always reads to token, make sure #line is * written to a new line, even if -C switch given. * Also, cpp - - reads stdin, writes stdout. * 03-Oct-84 ado/MM Several changes to line counting and keepcomments * stuff. Also a rewritten control() hasher -- much * simpler and no less "perfect". Note also changes * in cpp3.c to fix numeric scanning. * 04-Oct-84 MM Added recognition of macro formal parameters if * they are the only thing in a string, per the * draft standard. * 08-Oct-84 MM One more attack on scannumber * 15-Oct-84 MM/ado Added -N to disable predefined symbols. Fixed * linecount if COMMENT_INVISIBLE enabled. * 22-Oct-84 MM Don't evaluate the #if/#ifdef argument if * compilation is supressed. This prevents * unnecessary error messages in sequences such as * #ifdef FOO -- undefined * #if FOO == 10 -- shouldn't print warning * 25-Oct-84 MM Fixed bug in false ifdef supression. On vms, * #include should open foo.h -- this duplicates * the behavior of Vax-C * 31-Oct-84 ado/MM Parametized $ in indentifiers. Added a better * token concatenator and took out the trial * concatenation code. Also improved #ifdef code * and cleaned up the macro recursion tester. * 2-Nov-84 MM/ado Some bug fixes in token concatenation, also * a variety of minor (uninteresting) hacks. * 6-Nov-84 MM Happy Birthday. Broke into 4 files and added * #if sizeof (basic_types) * 9-Nov-84 MM Added -S* for pointer type sizes * 13-Nov-84 MM Split cpp1.c, added vms defaulting * 23-Nov-84 MM/ado -E supresses error exit, added CPP_INCLUDE, * fixed strncpy bug. * 3-Dec-84 ado/MM Added OLD_PREPROCESSOR * 7-Dec-84 MM Stuff in Nov 12 Draft Standard * 17-Dec-84 george Fixed problems with recursive macros * 17-Dec-84 MM Yet another attack on #if's (f/t)level removed. * 07-Jan-85 ado Init defines before doing command line options * so -Uunix works. */ /*)BUILD $(PROGRAM) = cpp $(FILES) = { cpp1 cpp2 cpp3 cpp4 cpp5 cpp6 } $(INCLUDE) = { cppdef.h cpp.h } $(STACK) = 2000 $(TKBOPTIONS) = { STACK = 2000 } */ #ifdef DOCUMENTATION title cpp C Pre-Processor index C pre-processor synopsis .s.nf cpp [-options] [infile [outfile]] .s.f description CPP reads a C source file, expands macros and include files, and writes an input file for the C compiler. If no file arguments are given, CPP reads from stdin and writes to stdout. If one file argument is given, it will define the input file, while two file arguments define both input and output files. The file name "-" is a synonym for stdin or stdout as appropriate. The following options are supported. Options may be given in either case. .lm +16 .p -16 -C If set, source-file comments are written to the output file. This allows the output of CPP to be used as the input to a program, such as lint, that expects commands embedded in specially-formatted comments. .p -16 -Dname=value Define the name as if the programmer wrote #define name value at the start of the first file. If "=value" is not given, a value of "1" will be used. On non-unix systems, all alphabetic text will be forced to upper-case. .p -16 -E Always return "success" to the operating system, even if errors were detected. Note that some fatal errors, such as a missing #include file, will terminate CPP, returning "failure" even if the -E option is given. .p -16 -Idirectory Add this directory to the list of directories searched for #include "..." and #include <...> commands. Note that there is no space between the "-I" and the directory string. More than one -I command is permitted. On non-Unix systems "directory" is forced to upper-case. .p -16 -N CPP normally predefines some symbols defining the target computer and operating system. If -N is specified, no symbols will be predefined. If -N -N is specified, the "always present" symbols, __LINE__, __FILE__, and __DATE__ are not defined. .p -16 -Stext CPP normally assumes that the size of the target computer's basic variable types is the same as the size of these types of the host computer. (This can be overridden when CPP is compiled, however.) The -S option allows dynamic respecification of these values. "text" is a string of numbers, separated by commas, that specifies correct sizes. The sizes must be specified in the exact order: char short int long float double If you specify the option as "-S*text", pointers to these types will be specified. -S* takes one additional argument for pointer to function (e.g. int (*)()) For example, to specify sizes appropriate for a PDP-11, you would write: c s i l f d func -S1,2,2,2,4,8, -S*2,2,2,2,2,2,2 Note that all values must be specified. .p -16 -Uname Undefine the name as if #undef name were given. On non-Unix systems, "name" will be forced to upper-case. .p -16 -Xnumber Enable debugging code. If no value is given, a value of 1 will be used. (For maintenence of CPP only.) .s.lm -16 Pre-Defined Variables When CPP begins processing, the following variables will have been defined (unless the -N option is specified): .s Target computer (as appropriate): .s pdp11, vax, M68000 m68000 m68k .s Target operating system (as appropriate): .s rsx, rt11, vms, unix .s Target compiler (as appropriate): .s decus, vax11c .s The implementor may add definitions to this list. The default definitions match the definition of the host computer, operating system, and C compiler. .s The following are always available unless undefined (or -N was specified twice): .lm +16 .p -12 __FILE__ The input (or #include) file being compiled (as a quoted string). .p -12 __LINE__ The line number being compiled. .p -12 __DATE__ The date and time of compilation as a Unix ctime quoted string (the trailing newline is removed). Thus, .s printf("Bug at line %s,", __LINE__); printf(" source file %s", __FILE__); printf(" compiled on %s", __DATE__); .s.lm -16 Draft Proposed Ansi Standard Considerations The current version of the Draft Proposed Standard explicitly states that "readers are requested not to specify or claim conformance to this draft." Readers and users of Decus CPP should not assume that Decus CPP conforms to the standard, or that it will conform to the actual C Language Standard. When CPP is itself compiled, many features of the Draft Proposed Standard that are incompatible with existing preprocessors may be disabled. See the comments in CPP's source for details. The latest version of the Draft Proposed Standard (as reflected in Decus CPP) is dated November 12, 1984. Comments are removed from the input text. The comment is replaced by a single space character. The -C option preserves comments, writing them to the output file. The '$' character is considered to be a letter. This is a permitted extension. The following new features of C are processed by CPP: .s.comment Note: significant spaces, not tabs, .br quotes #if, #elif .br;####_#elif expression (_#else _#if) .br;####'_\xNNN' (Hexadecimal constant) .br;####'_\a' (Ascii BELL) .br;####'_\v' (Ascii Vertical Tab) .br;####_#if defined NAME 1 if defined, 0 if not .br;####_#if defined (NAME) 1 if defined, 0 if not .br;####_#if sizeof (basic type) .br;####unary + .br;####123U, 123LU Unsigned ints and longs. .br;####12.3L Long double numbers .br;####token_#token Token concatenation .br;####_#include token Expands to filename The Draft Proposed Standard has extended C, adding a constant string concatenation operator, where "foo" "bar" is regarded as the single string "foobar". (This does not affect CPP's processing but does permit a limited form of macro argument substitution into strings as will be discussed.) The Standard Committee plans to add token concatenation to #define command lines. One suggested implementation is as follows: the sequence "Token1#Token2" is treated as if the programmer wrote "Token1Token2". This could be used as follows: #line 123 #define ATLINE foo#__LINE__ ATLINE would be defined as foo123. Note that "Token2" must either have the format of an identifier or be a string of digits.  Thus, the string #define ATLINE foo#1x3 generates two tokens: "foo1" and "x3". If the tokens T1 and T2 are concatenated into T3, this implementation operates as follows: 1. Expand T1 if it is a macro. 2. Expand T2 if it is a macro. 3. Join the tokens, forming T3. 4. Expand T3 if it is a macro. A macro formal parameter will be substituted into a string or character constant if it is the only component of that constant: #define VECSIZE 123 #define vprint(name, size) \ printf("name" "[" "size" "] = {\n") ... vprint(vector, VECSIZE); expands (effectively) to vprint("vector[123] = {\n"); Note that this will be useful if your C compiler supports the new string concatenation operation noted above. As implemented here, if you write #define string(arg) "arg" ... string("foo") ... This implementation generates "foo", rather than the strictly correct ""foo"" (which will probably generate an error message). This is, strictly speaking, an error in CPP and may be removed from future releases. error messages Many. CPP prints warning or error messages if you try to use multiple-byte character constants (non-transportable) if you #undef a symbol that was not defined, or if your program has potentially nested comments. author Martin Minow bugs The #if expression processor uses signed integers only. I.e, #if 0xFFFFu < 0 may be TRUE. #endif #include #include #include "cppdef.h" #include "cpp.h" /* * Commonly used global variables: * line is the current input line number. * wrongline is set in many places when the actual output * line is out of sync with the numbering, e.g, * when expanding a macro with an embedded newline. * * token holds the last identifier scanned (which might * be a candidate for macro expansion). * errors is the running cpp error counter. * infile is the head of a linked list of input files (extended by * #include and macros being expanded). infile always points * to the current file/macro. infile->parent to the includer, * etc. infile->fd is NULL if this input stream is a macro. */ int line; /* Current line number */ int wrongline; /* Force #line to compiler */ char token[IDMAX + 1]; /* Current input token */ int errors; /* cpp error counter */ FILEINFO *infile = NULL; /* Current input file */ #if DEBUG int debug; /* TRUE if debugging now */ #endif /* * This counter is incremented when a macro expansion is initiated. * If it exceeds a built-in value, the expansion stops -- this tests * for a runaway condition: * #define X Y * #define Y X * X * This can be disabled by falsifying rec_recover. (Nothing does this * currently: it is a hook for an eventual invocation flag.) */ int recursion; /* Infinite recursion counter */ int rec_recover = TRUE; /* Unwind recursive macros */ /* * instring is set TRUE when a string is scanned. It modifies the * behavior of the "get next character" routine, causing all characters * to be passed to the caller (except ). Note especially that * comments and \ are not removed from the source. (This * prevents cpp output lines from being arbitrarily long). * * inmacro is set by #define -- it absorbs comments and converts * form-feed and vertical-tab to space, but returns \ * to the caller. Strictly speaking, this is a bug as \ * shouldn't delimit tokens, but we'll worry about that some other * time -- it is more important to prevent infinitly long output lines. * * instring and inmarcor are parameters to the get() routine which * were made global for speed. */ int instring = FALSE; /* TRUE if scanning string */ int inmacro = FALSE; /* TRUE if #defining a macro */ /* * work[] and workp are used to store one piece of text in a temporay * buffer. To initialize storage, set workp = work. To store one * character, call save(c); (This will fatally exit if there isn't * room.) To terminate the string, call save(EOS). Note that * the work buffer is used by several subroutines -- be sure your * data won't be overwritten. The extra byte in the allocation is * needed for string formal replacement. */ char work[NWORK + 1]; /* Work buffer */ char *workp; /* Work buffer pointer */ /* * keepcomments is set TRUE by the -C option. If TRUE, comments * are written directly to the output stream. This is needed if * the output from cpp is to be passed to lint (which uses commands * embedded in comments). cflag contains the permanent state of the * -C flag. keepcomments is always falsified when processing #control * commands and when compilation is supressed by a false #if * * If eflag is set, CPP returns "success" even if non-fatal errors * were detected. * * If nflag is non-zero, no symbols are predefined except __LINE__. * __FILE__, and __DATE__. If nflag > 1, absolutely no symbols * are predefined. */ int keepcomments = FALSE; /* Write out comments flag */ int cflag = FALSE; /* -C option (keep comments) */ int eflag = FALSE; /* -E option (never fail) */ int nflag = 0; /* -N option (no predefines) */ /* * ifstack[] holds information about nested #if's. It is always * accessed via *ifptr. The information is as follows: * WAS_COMPILING state of compiling flag at outer level. * ELSE_SEEN set TRUE when #else seen to prevent 2nd #else. * TRUE_SEEN set TRUE when #if or #elif succeeds * ifstack[0] holds the compiling flag. It is TRUE if compilation * is currently enabled. Note that this must be initialized TRUE. */ char ifstack[BLK_NEST] = { TRUE }; /* #if information */ char *ifptr = ifstack; /* -> current ifstack[] */ /* * incdir[] stores the -i directories (and the system-specific * #include <...> directories. */ char *incdir[NINCLUDE]; /* -i directories */ char **incend = incdir; /* -> free space in incdir[] */ /* * This is the table used to predefine target machine and operating * system designators. It may need hacking for specific circumstances. * Note: it is not clear that this is part of the Ansi Standard. * Th !e -N option supresses preset definitions. */ char *preset[] = { /* names defined at cpp start */ #ifdef MACHINE MACHINE, #endif #ifdef SYSTEM SYSTEM, #endif #ifdef COMPILER COMPILER, #endif #if DEBUG "decus_cpp", /* Ourselves! */ #endif NULL /* Must be last */ }; /* * The value of these predefined symbols must be recomputed whenever * they are evaluated. The order must not be changed. */ char *magic[] = { /* Note: order is important */ "__LINE__", "__FILE__", NULL /* Must be last */ }; main(argc, argv) int argc; char *argv[]; { register int i; #if HOST == SYS_VMS argc = getredirection(argc, argv); /* vms >file and stdin */ /* * Open input file, "-" means use stdin. */ if (!streq(argv[1], "-")) { if (freopen(argv[1], "r", stdin) == NULL) { perror(argv[1]); cerror("Can't open input file \"%s\"", argv[1]); exit(IO_ERROR); } strcpy(work, argv[1]); /* Remember input filename */ break; } /* Else, just get stdin */ case 0: /* No args? */ case 1: /* No files, stdin -> stdout */ #if HOST == SYS_UNIX work[0] = EOS; /* Unix can't find stdin name */ #else fgetname(stdin, work); /* Vax-11C, Decus C know name */ #endif break; default: exit(IO_ERROR); /* Can't happen */ } setincdirs(); /* Setup -I include directories */ addfile(stdin, work); /* "open" main input file */ #if DEBUG if (debug > 0) dumpdef("preset #define symbols"); #endif cppmain(); /* Process main file */ if ((i = (ifptr - &ifstack[0])) != 0) { #if OLD_PREPROCESSOR ciwarn("Inside #ifdef block at end of input, depth = %d", i); #else cierror("Inside #ifdef block at end of input, depth = %d", i); #endif } fclose(stdout); if (errors > 0) { fprintf(stderr, (errors == 1) ? "%d error in preprocessor\n" : "%d errors in preprocessor\n", errors); if (!eflag) exit(IO_ERROR); } exit(IO_NORMAL); /* No errors or -E option set */ } FILE_LOCAL cppmain() /* * Main process for cpp -- copies tokens from the current input * stream (main file, include file, or a macro) to the output * file. */ { register int c; /* Current character */ register int counter; /* newlines and spaces */ extern int output(); /* Output one character */ /* * Explicitly output a #line at the start of cpp output so * that lint (etc.) knows the name of the original`M%~ IMAKE.SAV_7Z[IMAKE.CPP.BUILD]CPP1.C;10' source * file. If we don't do this explicitly, we may get * the name of the first #include file instead. * We also seem to need a blank line following that first #line. */ sharp(); putchar('\n'); /* * This loop is started "from the top" at the beginning of each line * wrongline is set TRUE in many places if it is necessary to write * a #line record. (But we don't write them when expanding macros.) * * The counter variable has two different uses: at * the start of a line, it counts the number of blank lines that * have been skipped over. These are then either output via * #line records or by outputting explicit blank lines. * When expanding tokens within a line, the counter remembers * whether a blank/tab has been output. These are dropped * at the end of the line, and replaced by a single blank * within lines. */ for (;;) { counter = 0; /* Count empty lines */ for (;;) { /* For each line, ... */ while (type[(c = get())] == SPA) /* Skip leading blan)ks */ ; /* in this line. */ if (c == '\n') /* If line's all blank, */ ++counter; /* Do nothing now */ else if (c == '#') { /* Is 1st non-space '#' */ keepcomments = FALSE; /* Don't pass comments */ counter = control(counter); /* Yes, do a #command */ keepcomments = (cflag && compiling); } else if (c == EOF_CHAR) /* At end of file? */ break; else if (!compiling) { /* #ifdef false? */ skipnl(); /* Skip to newline */ counter++; /* Count it, too. */ } else { break; /* Actual token */ } } if (c == EOF_CHAR) /* Exit process at */ break; /* End of file */ /* * If the loop didn't terminate because of end of file, we * know there is a token to compile. First, clean up after * absorbing newlines. counter has the number we skipped. */ if ((wrongline && infile->fp != NULL) || counter > 4) sharp(); /* Output # line number */ else { /* If just a few, stuff */ while (--counter >= 0) /* them out ourselves */ putchar('\n'); } /* * Process each token on this line. */ unget(); /* Reread the char. */ for (;;) { /* For the whole line, */ do { /* Token concat. loop */ for (counter = 0; (type[(c = get())] == SPA);) { #if COMMENT_INVISIBLE if (c != COM_SEP) counter++; #else counter++; /* Skip over blanks */ #endif } if (c == EOF_CHAR || c == '\n') goto end_line; /* Exit line loop */ else if (counter > 0) /* If we got any spaces */ putchar(' '); /* Output one space */ c = macroid(c); /* Grab the token */ } while (type[c] == LET && catenate()); if (c == EOF_CHAR || c == '\n') /* From macro exp error */ goto end_line; /* Exit line loop */ switch (type[c]) { case LET: fputs(token, stdout); /* Quite ordinary token */ break; case DIG: /* Output a number */ case DOT: /* Dot may begin floats */ scannumber(c, output); break; case QUO: /* c-har or string const */ scanstring(c, output); /* Copy it to output */ break; default: /* Some other character */ cput(c); /* Just output it */ break; } /* Switch ends */ } /* Line for loop */ end_line: if (c == '\n') { /* Compiling at EOL? */ putchar('\n'); /* Output newline, if */ if (infile->fp == NULL) /* Expanding a macro, */ wrongline = TRUE; /* Output # line later */ } } /* Continue until EOF */ } output(c) int c; /* * Output one character to stdout -- output() is passed as an * argument to scanstring() */ { #if COMMENT_INVISIBLE if (c != TOK_SEP && c != COM_SEP) #else if (c != TOK_SEP) #endif putchar(c); } static char *sharpfilename = NULL; FILE_LOCAL sharp() /* * Output a line number line. */ { register char *name; if (keepcomments) /* Make sure # comes on */ putchar('\n'); /* a fresh, new line. */ printf("#%s %d", LINE_PREFIX, line); if (infile->fp != NULL) { name = (infile->progname != NULL) ? infile->progname : infile->filename; if (sharpfilename == NULL || sharpfilename != NULL && !streq(name, sharpfilename)) { if (sharpfilename != NULL) free(sharpfilename); sharpfilename = savestring(name); printf(" \"%s\"", name); } } putchar('\n'); wrongline = FALSE; } *[IMAKE.CPP.BUILD]CPP1.OBJ;1+,yq. /@ 4  -Z0123KPWO56 sXc7P_89G@HJ1CPP1V1.0 6-JAN-1993 14:36VAX C V3.2-044PPPPPvaxPPvmsPPvax11cPP__LINE__PP__FILE__P!P-#Prat=cr*Prfm=var2Pmrs=4096;PCan't open output file "%s"WP-YPr[PCan't open input file "%s"vPInside #ifdef block at end of input, depth = %dP%d errors in preprocessor P%d error in preprocessor P#%s %dP "%s"P<^ C$MAIN_ARGSSUTݬݬGETREDIRECTIONP INITDEFINESݬݬ DOOPTIONSPQP1?Pߣ!ЬRݢSTRCMPPeߣ2ߣ*ߣ#ݢCREATPRR P`P ~RDUP2P$ЬRݢPERRORݢߣ;CERROR,EXITߣWЬRݢSTRCMPPEdߣYݢFREOPENP ݢPERRORݢߣ[CERROR,EXITЬRݢeSTRCPYedFGETNAME P,EXIT SETINCDIRSedADDFILEyPPR RߣvCIERRORFCLOSER3RRRæRRFPRINTF ,EXITݏEXIT2P ^YWXV Z TU[g e FPUTCPRINTFRբLТSS\Т\\SkRRSSTRCMPP&k kFREES SAVESTRINGPkSPRINTFݥ FPUTC  FPUTCRPGETP\LdCPGETP\LdC\ RP\#gRCONTROLPRShfSSg\f SKIPNLR\1  SգR1g e FPUTCPRINTFSգNУ\\PPУPP\kSS\STRCMPP&k kFREE\ SAVESTRINGPk\PRINTFe FPUTC Re FPUTCRUNGETPGETS\cPRBdC\cPRBdCR1R 1\ e FPUTCRMACROIDPRBd CATENATEPR1R 1BdSmSPPnP?PPAOPAPAj?PejFPUTS1FPOUTPUTR SCANNUMBER12POUTPUTR SCANSTRING1PR1eRFPUTC1PR 1e FPUTCRբ1 1P^ѬݬFPUTC ^ C$V_CTYPEDEFSOUTPUTSTRCPY SAVESTRINGPERRORFPUTCPRINTFFPRINTFFPUTSFCLOSEFREOPENFGETNAMECIERRORADDFILE SETINCDIRSEXITCERRORDUP2CREATSTRCMP DOOPTIONS INITDEFINESGETREDIRECTION SCANSTRING SCANNUMBERCATENATEMACROIDUNGETSKIPNLCONTROLGETOUTPUTFREESTRCMP <MAIN OUTPUT C$MAIN_ARGS$CODE$DATASTDINSTDOUTSTDERR_CTYPE_ERRNO VAXC$ERRNOLINE WRONGLINETYPE TOKENINSTRINGINMACROERRORS RECURSION IFSTACKIFPTRINCDIRINCENDCFLAGEFLAGNFLAG REC_RECOVERPRESET MAGICINFILEWORKWORKP KEEPCOMMENTS SIZE_TABLE$CHAR_STRING_CONSTANTSRS FPUTCPRINTF\լNЬPPQPЬQQ\cPP\STRCMPP&c cFREE\ SAVESTRINGPc\PRINTF FPUTC P3jP>.IP*[IMAKE.CPP.BUILD]CPP2.C;1+,q.$/@ 4$[-Z0123KPWO 56x7 _89G@HJ/* * C P P 2 . C * * Process #control lines * * Edit history * 13-Nov-84 MM Split from cpp1.c */ #include #include #include "cppdef.h" #include "cpp.h" #if HOST == SYS_VMS /* * Include the rms stuff. (We can't just include rms.h as it uses the * VaxC-specific library include syntax that Decus CPP doesn't support. * By including things by hand, we can CPP ourself.) */ #include #include #include #include #endif /* * Generate (by hand-inspection) a set of unique values for each control * operator. Note that this is not guaranteed to work for non-Ascii * machines. CPP won't compile if there are hash conflicts. */ #define L_assert ('a' + ('s' << 1)) #define L_define ('d' + ('f' << 1)) #define L_elif ('e' + ('i' << 1)) #define L_else ('e' + ('s' << 1)) #define L_endif ('e' + ('d' << 1)) #define L_if ('i' + (EOS << 1)) #define L_ifdef ('i' + ('d' << 1)) #define L_ifndef ('i' + ('n' << 1)) #define L_include ('i' + ('c' << 1)) #define L_line ('l' + ('n' << 1)) #define L_nogood (EOS + (EOS << 1)) /* To catch #i */ #define L_pragma ('p' + ('a' << 1)) #define L_undef ('u' + ('d' << 1)) #if DEBUG #define L_debug ('d' + ('b' << 1)) /* #debug */ #define L_nodebug ('n' + ('d' << 1)) /* #nodebug */ #endif int control(counter) int counter; /* Pending newline counter */ /* * Process #control lines. Simple commands are processed inline, * while complex commands have their own subroutines. * * The counter is used to force out a newline before #line, and * #pragma commands. This prevents these commands from ending up at * the end of the previous line if cpp is invoked with the -C option. */ { register int c; register char *tp; register int hash; char *ep; c = skipws(); if (c == '\n' || c == EOF_CHAR) return (counter + 1); if (!isdigit(c)) scanid(c); /* Get #word to token[] */ else { unget(); /* Hack -- allow #123 as a */ strcpy(token, "line"); /* synonym for #line 123 */ } hash = (token[1] == EOS) ? L_nogood : (token[0] + (token[2] << 1)); switch (hash) { case L_assert: tp = "assert"; break; case L_define: tp = "define"; break; case L_elif: tp = "elif"; break; case L_else: tp = "else"; break; case L_endif: tp = "endif"; break; case L_if: tp = "if"; break; case L_ifdef: tp = "ifdef"; break; case L_ifndef: tp = "ifndef"; break; case L_include: tp = "include"; break; case L_line: tp = "line"; break; case L_pragma: tp = "pragma"; break; case L_undef: tp = "undef"; break; #if DEBUG case L_debug: tp = "debug"; break; case L_nodebug: tp = "nodebug"; break; #endif default: hash = L_nogood; case L_nogood: tp = ""; break; } if (!streq(tp, token)) hash = L_nogood; /* * hash is set to a unique value corresponding to the * control keyword (or L_nogood if we think it's nonsense). */ if (infile->fp == NULL) cwarn("Control line \"%s\" within macro expansion", token); if (!compiling) { /* Not compiling now */ switch (hash) { case L_if: /* These can't turn */ case L_ifdef: /* compilation on, but */ case L_ifndef: /* we must nest #if's */ if (++ifptr >= &ifstack[BLK_NEST]) goto if_nest_err; *ifptr = 0; /* !WAS_COMPILING */ case L_line: /* Many */ /* * Are pragma's always processed? */ case L_pragma: /* options */ case L_include: /* are uninteresting */ case L_define: /* if we */ case L_undef: /* aren't */ case L_assert: /* compiling. */ dump_line: skipnl(); /* Ignore rest of line */ return (counter + 1); } } /* * Make sure that #line and #pragma are output on a fresh line. */ if (counter > 0 && (hash == L_line || hash == L_pragma)) { putchar('\n'); counter--; } switch (hash) { case L_line: /* * Parse the line to update the line number and "progname" * field and line number for the next input line. * Set wrongline to force it out later. */ c = skipws(); workp = work; /* Save name in work */ while (c != '\n' && c != EOF_CHAR) { save(c); c = get(); } unget(); save(EOS); /* * Split #line argument into and * We subtract 1 as we want the number of the next line. */ line = atoi(work) - 1; /* Reset line number */ for (tp = work; isdigit(*tp) || type[*tp] == SPA; tp++) ; /* Skip over digits */ if (*tp != EOS) { /* Got a filename, so: */ if (*tp == '"' && (ep = strrchr(tp + 1, '"')) != NULL) { tp++; /* Skip over left quote */ *ep = EOS; /* And ignore right one */ } if (infile->progname != NULL) /* Give up the old name */ free(infile->progname); /* if it's allocated. */ infile->progname = savestring(tp); } wrongline = TRUE; /* Force output later */ break; case L_include: doinclude(); break; case L_define: dodefine(); break; case L_undef: doundef(); break; case L_else: if (ifptr == &ifstack[0]) goto nest_err; else if ((*ifptr & ELSE_SEEN) != 0) goto else_seen_err; *ifptr |= ELSE_SEEN; if ((*ifptr & WAS_COMPILING) != 0) { if (compiling || (*ifptr & TRUE_SEEN) != 0) compiling = FALSE; else { compiling = TRUE; } } break; case L_elif: if (ifptr == &ifstack[0]) goto nest_err; else if ((*ifptr & ELSE_SEEN) != 0) { else_seen_err: cerror("#%s may not follow #else", token); goto dump_line; } if ((*ifptr & (WAS_COMPILING | TRUE_SEEN)) != WAS_COMPILING) { compiling = FALSE; /* Done compiling stuff */ goto dump_line; /* Skip this clause */ } doif(L_if); break; case L_if: case L_ifdef: case L_ifndef: if (++ifptr >= &ifstack[BLK_NEST]) if_nest_err: cfatal("Too many nested #%s statements", token); *ifptr = WAS_COMPILING; doif(hash); break; case L_endif: if (ifptr == &ifstack[0]) { nest_err: cerror("#%s must be in an #if", token); goto dump_line; } if (!compiling && (*ifptr & WAS_COMPILING) != 0) wrongline = TRUE; compiling = ((*ifptr & WAS_COMPILING) != 0); --ifptr; break; case L_assert: if (eval() == 0) cerror("Preprocessor assertion failure", NULLST); break; case L_pragma: /* * #pragma is provided to pass "options" to later * passes of the compiler. cpp doesn't have any yet. */ printf("#pragma "); while ((c = get()) != '\n' && c != EOF_CHAR) cput(c); unget(); break; #if DEBUG case L_debug: if (debug == 0) dumpdef("debug set on"); debug++; break; case L_nodebug: debug--; break; #endif default: /* * Undefined #control keyword. * Note: the correct behavior may be to warn and * pass the line to a subsequent compiler pass. * This would allow #asm or similar extensions. */ cerror("Illegal # command \"%s\"", token); break; } if (hash != L_include) { #if OLD_PREPROCESSOR /* * Ignore the rest of the #control line so you can write * #if foo * #endif foo */ goto dump_line; /* Take common exit */ #else if (skipws() != '\n') { cwarn("Unexpected text in #control line ignored", NULLST); skipnl(); } #endif } return (counter + 1); } FILE_LOCAL doif(hash) int hash; /* * Process an #if, #ifdef, or #ifndef. The latter two are straightforward, * while #if needs a subroutine of its own to evaluate the expression. * * doif() is called only if compiling is TRUE. If false, compilation * is always supressed, so we don't need to evaluate anything. This * supresses unnecessary warnings. */ { register int c; register int found; if ((c = skipws()) == '\n' || c == EOF_CHAR) { unget(); goto badif; } if (hash == L_if) { unget(); found = (eval() != 0); /* Evaluate expr, != 0 is TRUE */ hash = L_ifdef; /* #if is now like #ifdef */ } else { if (type[c] != LET) /* Next non-blank isn't letter */ goto badif; /* ... is an error */ found = (lookid(c) != NULL); /* Look for it in symbol table */ } if (found == (hash == L_ifdef)) { compiling = TRUE; *ifptr |= TRUE_SEEN; } else { compiling = FALSE; } return; badif: cerror("#if, #ifdef, or #ifndef without an argument", NULLST); #if !OLD_PREPROCESSOR skipnl(); /* Prevent an extra */ unget(); /* Error message */ #endif return; } FILE_LOCAL doinclude() /* * Process the #include control line. * There are three variations: * #include "file" search somewhere relative to the * current source file, if not found, * treat as #include . * #include Search in an implementation-dependent * list of places. * #include token Expand the token, it must be one of * "file" or , process as such. * * Note: the November 12 draft forbids '>' in the #include format. * This restriction is unnecessary and not implemented. */ { register int c; register int delim; #if HOST == SYS_VMS char def_filename[NAM$C_MAXRSS + 1]; #endif delim = macroid(skipws()); if (delim != '<' && delim != '"') goto incerr; if (delim == '<') delim = '>'; workp = work; instring = TRUE; /* Accept all characters */ #ifdef CONTROL_COMMENTS_NOT_ALLOWED while ((c = get()) != '\n' && c != EOF_CHAR) save(c); /* Put it away. */ unget(); /* Force nl after includee */ /* * The draft is unclear if the following should be done. */ while (--workp >= work && *workp == ' ') ; /* Trim blanks from filename */ if (*workp != delim) goto incerr; #else while ((c = get()) != delim && c != EOF_CHAR) save(c); #endif *workp = EOS; /* Terminate filename */ instring = FALSE; #if HOST == SYS_VMS /* * Assume the default .h filetype. */ if (!vmsparse(work, ".H", def_filename)) { perror(work); /* Oops. */ goto incerr; } else if (openinclude(def_filename, (delim == '"'))) return; #else if (openinclude(work, (delim == '"'))) return; #endif /* * No sense continuing if #include file isn't there. */ cfatal("Cannot open include file \"%s\"", work); incerr: cerror("#include syntax error", NULLST); return; } FILE_LOCAL int openinclude(filename, searchlocal) char *filename; /* Input file name */ int searchlocal; /* TRUE if #include "file" */ /* * Actually open an include file. This routine is only called from * doinclude() above, but was written as a separate subroutine for * programmer convenience. It searches the list of directories * and actually opens the file, linking it into the list of * active files. Returns TRUE if the file was opened, FALSE * if openinclude() fails. No error message is printed. */ { register char **incptr; #if HOST == SYS_VMS #if NWORK < (NAM$C_MAXRSS + 1) << error, NWORK isn't greater than NAM$C_MAXRSS >> #endif #endif char tmpname[NWORK]; /* Filename work area */ if (searchlocal) { /* * Look in local directory first */ #if HOST == SYS_UNIX /* * Try to open filename relative to the directory of the current * source file (as opposed to the current directory). (ARF, SCK). */ if (filename[0] != '/' && hasdirectory(infile->filename, tmpname)) strcat(tmpname, filename); else { strcpy(tmpname, filename); } #else if (!hasdirectory(filename, tmpname) && hasdirectory(infile->filename, tmpname)) strcat(tmpname, filename); else { strcpy(tmpname, filename); } #endif if (openfile(tmpname)) return (TRUE); } /* * Look in any directories specified by -I command line * arguments, then in the builtin search list. */ for (incptr = incdir; incptr < incend; incptr++) { if (strlen(*incptr) + strlen(filename) >= (NWORK - 1)) cfatal("Filename work buffer overflow", NULLST); else { #if HOST == SYS_UNIX if (filename[0] == '/') strcpy(tmpname, filename); else { sprintf(tmpname, "%s/%s", *incptr, filename); } #else if (!hasdirectory(filename, tmpname)) sprintf(tmpname, "%s%s", *incptr, filename); #endif if (openfile(tmpname)) return (TRUE); } } return (FALSE); } FILE_LOCAL int hasdirectory(source, result) char *source; /* Directory to examine */ char *result; /* Put directory stuff here */ /* * If a device or directory is found in the source filename string, the * node/device/directory part of the string is copied to result and * hasdirectory returns TRUE. Else, nothing is copied and it returns FALSE. */ { #if HOST == SYS_UNIX register char *tp; if ((tp = strrchr(source, '/')) == NULL) return (FALSE); else { strncpy(result, source, tp - source + 1); result[tp - source + 1] = EOS; return (TRUE); } #else #if HOST == SYS_VMS if (vmsparse(source, NULLST, result) && result[0] != EOS) return (TRUE); else { return (FALSE); } #else /* * Random DEC operating system (RSX, RT11, RSTS/E) */ register char *tp; if ((tp = strrchr(source, ']')) == NULL && (tp = strrchr(source, ':')) == NULL) return (FALSE); else { strncpy(result, source, tp - source + 1); result[tp - source + 1] = EOS; return (TRUE); } #endif #endif } #if HOST == SYS_VMS /* * EXP_DEV is set if a device was specified, EXP_DIR if a directory * is specified. (Both set indicate a file-logical, but EXP_DEV * would be set by itself if you are reading, say, SYS$INPUT:) */ #define DEVDIR (NAM$M_EXP_DEV | NAM$M_EXP_DIR) FILE_LOCAL int vmsparse(source, defstring, result) char *source; char *defstring; /* non-NULL -> default string. */ char *result; /* Size is at least NAM$C_MAXRSS + 1 */ /* * Parse the source string, applying the default (properly, using * the system parse routine), storing it in result. * TRUE if it parsed, FALSE on error. * * If defstring is NULL, there are no defaults and result gets * (just) the node::[directory] part of the string (possibly "") */ { struct FAB fab = cc$rms_fab; /* File access block */ struct NAM nam = cc$rms_nam; /* File name block */ char fullname[NAM$C_MAXRSS + 1]; register char *rp; /* Result pointer */ fab.fab$l_nam = &nam; /* fab -> nam */ fab.fab$l_fna = source; /* Source filename */ fab.fab$b_fns = strlen(source); /* Size of source */ fab.fab$l_dna = defstring; /* Default string */ if (defstring != NULLST) fab.fab$b_dns = strlen(defstring); /* Size of default */ nam.nam$l_esa = fullname; /* Expanded filename */ nam.nam$b_ess = NAM$C_MAXRSS; /* Expanded name size */ if (sys$parse(&fab) == RMS$_NORMAL) { /* Parse away */ fullname[nam.nam$b_esl] = EOS; /* Terminate string */ result[0] = EOS; /* Just in case */ rp = &result[0]; /* * Remove stuff added implicitly, accepting node names and * dev:[directory] strings (but not process-permanent files). */ if ((nam.nam$l_fnb & NAM$M_PPF) == 0) { if ((nam.nam$l_fnb & NAM$M_NODE) != 0) { strncpy(result, nam.nam$l_node, nam.nam$b_node); rp += nam.nam$b_node; *rp = EOS; } if ((nam.nam$l_fnb & DEVDIR) == DEVDIR) { strncpy(rp, nam.nam$l_dev, nam.nam$b_dev + nam.nam$b_dir); rp += nam.nam$b_dev + nam.nam$b_dir; *rp = EOS; } } if (defstring != NULLST) { strncpy(rp, nam.nam$l_name, nam.nam$b_name + nam.nam$b_type); rp += nam.nam$b_name + nam.nam$b_type; *rp = EOS; if ((nam.nam$l_fnb & NAM$M_EXP_VER) != 0) { strncpy(rp, nam.nam$l_ver, nam.nam$b_ver); rp[nam.nam$b_ver] = EOS; } } return (TRUE); } return (FALSE); } #endif s*[IMAKE.CPP.BUILD]CPP2.OBJ;1+,Br . /@ 4  -Z0123KPWO 56lwXc7@_89G@HJ1CPP2V1.0 6-JAN-1993 14:36VAX C V3.2-044PlinePassert PdefinePelifPelsePendif#Pif&Pifdef,Pifndef3Pinclude;Pline@PpragmaGPundefNPControl line "%s" within macro expansionwP#%s may not follow #elsePToo many nested #%s statementsP#%s must be in an #ifPPreprocessor assertion failureP#pragma PIllegal # command "%s"PUnexpected text in #control line ignored-P#if, #ifdef, or #ifndef without an argumentYP.H\PCannot open include file "%s"zP#include syntax error C$V_CTYPEDEFS CC$RMS_NAM CC$RMS_FAB CC$RMS_RABSTRRCHRSTRCATSTRCPY SAVESTRINGLOOKIDPERRORFPUTCSPRINTFPRINTFEVALCFATALCERRORDOUNDEFDODEFINEFREEATOIGETSAVESKIPNLCWARNSTRCMPUNGETSCANIDSKIPWSSKIPNLCERROREVALUNGETSKIPWSCERRORCFATALSAVEGETMACROIDSKIPWSCFATALSTRLENOPENFILEPFilename work buffer overflowP%s%sP ^VZY [XSKIPWSP PPˏPRBh PSCANIDPUNGETf STRCPY TP S RxRRRSTTS11Si11S-1SPP-Pi?PަR`Pަ RXPަRPPަRHPަR@Pަ#R8Pަ&R0Pަ,R(Pަ3R Pަ;RPަ@RPަGRPSަMR RSTRCMPPSRբ ߦNCWARNݕi}SitRS/iSPP/P(?Pj RjR1jRbSKIPNLPլ$SH S2 FPUTC׬Si11S-1 SPP-P1P>?PSKIPWSPRR "RPRSAVEGETPRR RUNGETSAVEATOIPRbPPTDh bP@kCRbPPP@hbP@kCbGb""RTTSTRRCHRPTR`Pՠ ݠFREETR SAVESTRINGP 1Pϻ1DODEFINE1PDOUNDEF1PjTiRTR1d8jRbjTd1idi1i1PjTiRTR1d ߦwCERROR1PjRbRRi1PiWSKIPWSPUU U UNGETlWi#UNGETEVALTPTTR<1WPEk:ULOOKIDTPTTRTW1TRT ijRb1i1P-CERRORSKIPNLUNGET1Pj RjR ƐCFATALjRbSWSKIPWSPUU U UNGEToPWi#UNGETEVALTPTTR<1WPEk:ULOOKIDTPTTRTW1TRT ijRb1i1P-CERRORSKIPNLUNGET1PiRjR ƯCERROR1;ijRb jRbRTRTTij1PEVALPrCERRORcPPRINTFGETPRR -R)PRRFPUTCGETPRR RUNGET CERRORS/ SKIPWSP CWARNSKIPNLP^TSKIPWSPSS S UNGETwѬi"UNGETEVALQPQQR<1C ASLOOKIDQPQQRPѬ1PRPRb-CERRORSKIPNLUNGET^STSKIPWSPMACROIDPRR<R"1R<>Rd GETP\\R"\P\SAVEGETP\\R\\l Yd^PdPERROR(P\R"\\!Pd\CFATALzCERROR^UWլ[ݬP*RݢϷPݬSTRCATPݬSTRCPYOPENFILEPPRRgoSTRLENVެTbfPSdfPSSŐCFATAL4d6PdbŮSPRINTFOPENFILEPPRRgP^ЬRRݬPbPP<L^(P CC$RMS_FAB(` CC$RMS_NAMLLЬݬSTRLENPЬRRR RSTRLENPLXV SYS$PARSEP1WSCLЬ TddR譂X~ݭTSTRNCPYҚSSRbˏ?SS(TSST~ݭRSTRNCPYؚTSSTTRbլCTSST~ݭRSTRNCPYᚭTSSTTRb魀~ݭRSTRNCPY򚭉SCbPPyPK;C{ OSTRNCPY SYS$PARSESTRLEN CONTROL $CODE$DATASTDINSTDOUTSTDERR_CTYPE_ERRNO VAXC$ERRNOLINE WRONGLINETYPE TOKENINSTRINGINMACROERRORS RECURSION IFSTACKIFPTRINCDIRINCENDCFLAGEFLAGNFLAG REC_RECOVERPRESETMAGICINFILEWORKWORKPH KEEPCOMMENTS SIZE_TABLE$CHAR_STRING_CONSTANTS{K[PQQ>Q^^^^^^^^^^Q^^^^^^^>^QQPiQyYIa*[IMAKE.CPP.BUILD]CPP3.C;1+,Sr./@ 4-Z0123KPWO56D7`3_89G@HJ/* * C P P 3 . C * * File open and command line options * * Edit history * 13-Nov-84 MM Split from cpp1.c */ #include #include #include "cppdef.h" #include "cpp.h" #if DEBUG && (HOST == SYS_VMS || HOST == SYS_UNIX) #include extern int abort(); /* For debugging */ #endif int openfile(filename) char *filename; /* * Open a file, add it to the linked list of open files. * This is called only from openfile() above. */ { register FILE *fp; if ((fp = fopen(filename, "r")) == NULL) { #if DEBUG perror(filename); #endif return (FALSE); } #if DEBUG if (debug) fprintf(stderr, "Reading from \"%s\"\n", filename); #endif addfile(fp, filename); return (TRUE); } addfile(fp, filename) FILE *fp; /* Open file pointer */ char *filename; /* Name of the file */ /* * Initialize tables for this open file. This is called from openfile() * above (for #include files), and from the entry to cpp to open the main * input file. It calls a common routine, getfile() to build the FILEINFO * structure which is used to read characters. (getfile() is also called * to setup a macro replacement.) */ { register FILEINFO *file; extern FILEINFO *getfile(); file = getfile(NBUFF, filename); file->fp = fp; /* Better remember FILE * */ file->buffer[0] = EOS; /* Initialize for first read */ line = 1; /* Working on line 1 now */ wrongline = TRUE; /* Force out initial #line */ } setincdirs() /* * Append system-specific directories to the include dire _v~ IMAKE.SAVSrZ[IMAKE.CPP.BUILD]CPP3.C;15ctory list. * Called only when cpp is started. */ { #ifdef CPP_INCLUDE *incend++ = CPP_INCLUDE; #define IS_INCLUDE 1 #else #define IS_INCLUDE 0 #endif #if HOST == SYS_UNIX *incend++ = "/usr/include"; #define MAXINCLUDE (NINCLUDE - 1 - IS_INCLUDE) #endif #if HOST == SYS_VMS extern char *getenv(); if (getenv("C$LIBRARY") != NULL) *incend++ = "C$LIBRARY:"; *incend++ = "SYS$LIBRARY:"; #define MAXINCLUDE (NINCLUDE - 2 - IS_INCLUDE) #endif #if HOST == SYS_RSX extern int $$rsts; /* TRUE on RSTS/E */ extern int $$pos; /* TRUE on PRO-350 P/OS */ extern int $$vms; /* TRUE on VMS compat. */ if ($$pos) { /* P/OS? */ *incend++ = "SY:[ZZDECUSC]"; /* C #includes */ *incend++ = "LB:[1,5]"; /* RSX library */ } else if ($$rsts) { /* RSTS/E? */ *incend++ = "SY:@"; /* User-defined account */ *incend++ = "C:"; /* Decus-C library */ *incend++ = "LB:[1,1]"; /* RSX library */ } else if ($$vms) { /* VMS compatibility? */ *incend++ = "C:"; } else { /* Plain old RSX/IAS */ *incend++ = "LB:[1,1]"; } #define MAXINCLUDE (NINCLUDE - 3 - IS_INCLUDE) #endif #if HOST == SYS_RT11 extern int $$rsts; /* RSTS/E emulation? */ if ($$rsts) *incend++ = "SY:@"; /* User-defined account */ *incend++ = "C:"; /* Decus-C library disk */ *incend++ = "SY:"; /* System (boot) disk */ #define MAXINCLUDE (NINCLUDE - 3 - IS_INCLUDE) #endif } int dooptions(argc, argv) int argc; char *argv[]; /* * dooptions is called to process command line arguments (-Detc). * It is called only at cpp startup. */ { register char *ap; register DEFBUF *dp; register int c; int i, j; char *arg; SIZES *sizp; /* For -S */ int size; /* For -S */ int isdatum; /* FALSE for -S* */ int endtest; /* For -S */ for (i = j = 1; i < argc; i++) { arg = ap = argv[i]; if (*ap++ != '-' || *ap == EOS) argv[j++] = argv[i]; else { c = *ap++; /* Option byte */ if (islower(c)) /* Normalize case */ c = toupper(c); switch (c) { /* Command character */ case 'C': /* Keep comments */ cflag = TRUE; keepcomments = TRUE; break; case 'D': /* Define symbol */ #if HOST != SYS_UNIX zap_uc(ap); /* Force define to U.C. */ #endif /* * If the option is just "-Dfoo", make it -Dfoo=1 */ while (*ap != EOS && *ap != '=') ap++; if (*ap == EOS) ap = "1"; else *ap++ = EOS; /* * Now, save the word and its definition. */ dp = defendel(argv[i] + 2, F ALSE); dp->repl = savestring(ap); dp->nargs = DEF_NOARGS; break; case 'E': /* Ignore non-fatal */ eflag = TRUE; /* errors. */ break; case 'I': /* Include directory */ if (incend >= &incdir[MAXINCLUDE]) cfatal("Too many include directories", NULLST); *incend++ = ap; break; case 'N': /* No predefineds */ nflag++; /* Repeat to undefine */ break; /* __LINE__, etc. */ case 'S': sizp = size_table; if (isdatum = (*ap != '*')) /* If it's just -S, */ endtest = T_FPTR; /* Stop here */ else { /* But if it's -S* */ ap++; /* Step over '*' */ endtest = 0; /* Stop at end marker */ } while (sizp->bits != endtest && *ap != EOS) { if (!isdigit(*ap)) { /* Skip to next digit */ ap++; continue; } size = 0; /* Compile the value */ while (isdigit(*ap)) { size *= 10; size += (*ap++ - '0'); } if (isdatum) sizp->size = size; /* Datum size */ else sizp->psize = size; /* Pointer size */ sizp++; } if (sizp->bits != endtest) cwarn("-S, too few values specified in %s", argv[i]); else if (*ap != EOS) cwarn("-S, too many values, \"%s\" unused", ap); break; case 'U': /* Undefine symbol */ #if HOST != SYS_UNIX zap_uc(ap); #endif if (defendel(ap, TRUE) == NULL) cwarn("\"%s\" wasn't defined", ap); break; #if DEBUG case 'X': /* Debug */ debug = (isdigit(*ap)) ? atoi(ap) : 1; #if (HOST == SYS_VMS || HOST == SYS_UNIX) signal(SIGINT, abort); /* Trap "interrupt" */ #endif fprintf(stderr, "Debug set to %d\n", debug); break; #endif default: /* What is this one? */ cwarn("Unknown option \"%s\"", arg); fprintf(stderr, "The following options are valid:\n\ -C\t\t\tWrite source file comments to output\n\ -Dsymbol=value\tDefine a symbol with the given (optional) value\n\ -Idirectory\t\tAdd a directory to the #include search list\n\ -N\t\t\tDon't predefine  target-specific names\n\ -Stext\t\tSpecify sizes for #if sizeof\n\ -Usymbol\t\tUndefine symbol\n"); #if DEBUG fprintf(stderr, " -Xvalue\t\tSet internal debug flag\n"); #endif break; } /* Switch on all options */ } /* If it's a -option */ } /* For all arguments */ if (j > 3) { cerror( "Too many file arguments. Usage: cpp [input [output]]", NULLST); } return (j); /* Return new argc */ } #if HOST != SYS_UNIX FILE_LOCAL zap_uc(ap) register char *ap; /* * Dec operating systems mangle upper-lower case in command lines. * This routine forces the -D and -U arguments to uppercase. * It is called only on cpp startup by dooptions(). */ { while (*ap != EOS) { /* * Don't use islower() here so it works with Multinational */ if (*ap >= 'a' && *ap <= 'z') *ap = toupper(*ap); ap++; } } #endif initdefines() /* * Initialize the built-in #define's. There are two flavors: * #define decus 1 (static definitions) * #define __FILE__ ?? (dynamic, evaluated by magic) * Called only on cpp startup. * * Note: the built-in static definitions are supressed by the -N option. * __LINE__, __FILE__, and __DATE__ are always present. */ { register char **pp; register char *tp; register DEFBUF *dp; int i; long tvec; extern char *ctime(); /* * Predefine the built-in symbols. Allow the * implementor to pre-define a symbol as "" to * eliminate it. */ if (nflag == 0) { for (pp = preset; *pp != NULL; pp++) { if (*pp[0] != EOS) { dp = defendel(*pp, FALSE); dp->repl = savestring("1"); dp->nargs = DEF_NOARGS; } } } /* * The magic pre-defines (__FILE__ and __LINE__ are * initialized with negative argument counts. expand() * notices this and calls the appropriate routine. * DEF_NOARGS is one greater than the first "magic" definition. */ if (nflag < 2) { for (pp = magic, i = DEF_NOARGS; *pp != NULL; pp++) { dp = defendel(*pp, FALSE); dp->nargs = --i; } #if OK_DATE /* * Define __DATE__ as today's date. */ dp = defendel("__DATE__", FALSE); dp->repl = tp = getmem(27); dp->nargs = DEF_NOARGS; time(&tvec); *tp++ = '"'; strcpy(tp, ctime(&tvec)); tp[24] = '"'; /* Overwrite newline */ #endif } } #if HOST == SYS_VMS /* * getredirection() is intended to aid in porting C programs * to VMS (Vax-11 C) which does not support '>' and '<' * I/O redirection. With suitable modification, it may * useful for other portability problems as well. */ int getredirection(argc, argv) int argc; char **argv; /* * Process vms redirection arg's. Exit if any error is seen. * If getredirection() processes an argument, it is erased * from the vector. getredirection() returns a new argc value. * * Warning: do not try to simplify the code for vms. The code * presupposes that getredirection() is called before any data is * read from stdin or written to stdout. * * Normal usage is as follows: * * main(argc, argv) * int argc; * char *argv[]; * { * argc = getredirection(argc, argv); * } */ { register char *ap; /* Argument pointer */ int i; /* argv[] index */ int j; /* Output index */ int file; /* File_descriptor */ extern int errno; /* Last vms i/o error */ for (j = i = 1; i < argc; i++) { /* Do all arguments */ switch (*(ap = argv[i])) { case '<': /* ': /* >file or >>file */ if (*++ap == '>') { /* >>file */ /* * If the file exists, and is writable by us, * call freopen to append to the file (using the * file's current attributes). Otherwise, create * a new file with "vanilla" attributes as if the * argument was given as ">filename". * access(name, 2) returns zero if we can write on * the specified file. */ if (access(++ap, 2) == 0) { if (freopen(ap, "a", stdout) != NULL) break; /* Exit case statement */ perror(ap); /* Error, can't append */ exit(errno); /* After access test */ } /* If file accessable */ } /* * On vms, we want to create the file using "standard" * record attributes. creat(...) creates the file * using the caller's default protection mask and * "variable length, implied carriage return" * attributes. dup2() associates the file with stdout. */ if ((file = creat(ap, 0, "rat=cr", "rfm=var")) == -1 || dup2(file, fileno(stdout)) == -1) { perror(ap); /* Can't create file */ exit(errno); /* is a fatal error */ } /* If '>' creation */ break; /* Exit case test */ default: argv[j++] = ap; /* Not a redirector */ break; /* Exit case test */ } } /* For all arguments */ argv[j] = NULL; /* Terminate argv[] */ return (j); /* Return new argc */ } #endif *[IMAKE.CPP.BUILD]CPP3.OBJ;1+,qr&. /@ 4  -Z0123KPWO56 A|Xc7 [&_89G@HJ1CPP3V1.0 6-JAN-1993 14:37VAX C V3.2-044PrPC$LIBRARY PC$LIBRARY:PSYS$LIBRARY:$P1&PToo many include directoriesCP-S, too few values specified in %sfP-S, too many values, "%s" unusedP"%s" wasn't definedPUnknown option "%s"PThe following options are valid: -C Write source file comments to output -Dsymbol=value Define a symbol with the given (optional) value -Idirectory Add a directory to the #include search list -N Don't predefine target-specific names -Stext Specify sizes for #if sizeof  -Usymbol Undefine symbol PToo many file arguments. Usage: cpp [input [output]]P1!P__DATE__*Pr,Pa.Prat=cr5Prfm=varP^ݬFOPENPPPRݬ<~GETFILER 옏P^ݬ<~GETFILEЬ  ^RSߢGETENVP c\cޢ lc\cޢ^W[U YެY1ެZjnTOUPPERXDEFENDELCWARNIRRRS-cЮ R֮ jTIdBd1/PRˏRTDe R~hPRRPPCrP1P?P1PSTddRRaRz R~hPdTdcc= Scc=c ާ$SPI~PRS SAVESTRINGP 1SP1FPRR ߧ&CFATALRSb1P1 PTRc*RRV<QSQ2dRRQ_c[cRRRBeS>PPcRRRBe PR0RRPcRRRBeVPPT2dRRQc2dRRQ IߧClchSߧf]STddRRaRz R~hPdTdSP*SLJPݮǛǯFPRINTFYY1Ѯ  CERROR P^ЬRb%PbPPaPz P~TOUPPERPbRb ^S9\l.!lDEFENDELPR SAVESTRINGP \lu\RllDEFENDELRR \l!DEFENDELPRGETMEMP\\ ߭TIME\R\"b߭CTIMEP\STRCPY"^SYZXTެnT1ެUХFREOPEN[PERRORWEXITVDRbPP<P1P?Ph*RRk C$V_CTYPEDEFSADDFILETIMESTRCPY SAVESTRINGDEFENDELGETMEMTOUPPERPERRORFPRINTFFREOPENFOPENADDFILEGETFILEGETENVCERRORCWARNCFATALCTIMEDUP2CREATACCESSEXIT OPENFILE HADDFILE t SETINCDIRS  DOOPTIONS  INITDEFINES xGETREDIRECTION$CODE$DATASTDINSTDOUTSTDERR_CTYPE_ERRNO VAXC$ERRNOLINE WRONGLINETYPE TOKENINSTRINGINMACROERRORS RECURSION IFSTACKIFPTRINCDIRINCENDCFLAGEFLAGNFLAG REC_RECOVERPRESETMAGICINFILEWORKWORKP KEEPCOMMENTS SIZE_TABLE=$CHAR_STRING_CONSTANTSP1Rgif1PRb>*RRACCESSPj,RkP]Rgif5.RCREATPQQкP ~QDUP2PRgifPЮP֮R@TT1-޼RЮTDbTPP8LP4H*[IMAKE.CPP.BUILD]CPP4.C;1+,tr.$/@ 4$!C-Z0123KPWO"56ک7u,_89G@HJ/* * C P P 4 . C * M a c r o D e f i n i t i o n s * * Edit History * 31-Aug-84 MM USENET net.sources release * 04-Oct-84 MM __LINE__ and __FILE__ must call ungetstring() * so they work correctly with token concatenation. * Added string formal recognition. * 25-Oct-84 MM "Short-circuit" evaluate #if's so that we * don't print unnecessary error messages for * #if !defined(FOO) && FOO != 0 && 10 / FOO ... * 31-Oct-84 ado/MM Added token concatenation * 6-Nov-84 MM Split off eval stuff */ #include #include #include "cppdef.h" #include "cpp.h" /* * parm[], parmp, and parlist[] are used to store #define() argument * lists. nargs contains the actual number of parameters stored. */ static char parm[NPARMWORK + 1]; /* define param work buffer */ static char *parmp; /* Free space in parm */ static char *parlist[LASTPARM]; /* -> start of each parameter */ static int nargs; /* Parameters for this macro */ dodefine() /* * Called from control when a #define is scanned. This module * parses formal parameters and the replacement string. When * the formal parameter name is encountered in the replacement * string, it is replaced by a character in the range 128 to * 128+NPARAM (this allows up to 32 parameters within the * Dec Multinational range). If cpp is ported to an EBCDIC * machine, you will have to make other arrangements. * * There is some special case code to distinguish * #define foo bar * from #define foo() bar * * Also, we make sure that * #define foo foo * expands to "foo" but doesn't put cpp into an infinite loop. * * A warning message is printed if you redefine a symbol to a * different text. I.e, * #define foo 123 * #define foo 123 * is ok, but * #define foo 123 * #define foo +123 * is not. * * The following subroutines are called from define(): * checkparm called when a token is scanned. It checks through the * array of formal parameters. If a match is found, the * token is replaced by a control byte which will be used * to locate the parameter when the macro is expanded. * textput puts a string in the macro work area (parm[]), updating * parmp to point to the first free byte in parm[]. * textput() tests for work buffer overflow. * charput puts a single character in the macro work area (parm[]) * in a manner analogous to textput(). */ { register int c; register DEFBUF *dp; /* -> new definition */ int isredefine; /* TRUE if redefined */ char *old; /* Remember redefined */ extern int save(); /* Save char in work[] */ if (type[(c = skipws())] != LET) goto bad_define; isredefine = FALSE; /* Set if redefining */ if ((dp = lookid(c)) == NULL) /* If not known now */ dp = defendel(token, FALSE); /* Save the name */ else { /* It's known: */ isredefine = TRUE; /* Remember this fact */ old = dp->repl; /* Remember replacement */ dp->repl = NULL; /* No replacement now */ } parlist[0] = parmp = parm; /* Setup parm buffer */ if ((c = get()) == '(') { /* With arguments? */ nargs = 0; /* Init formals counter */ do { /* Collect formal parms */ if (nargs >= LASTPARM) cfatal("Too many arguments for macro", NULLST); else if ((c = skipws()) == ')') break; /* Got them all */ else if (type[c] != LET) /* Bad formal syntax */ goto bad_define; scanid(c); /* Get the formal param */ parlist[nargs++] = parmp; /* Save its start */ textput(token); /* Save text in parm[] */ } while ((c = skipws()) == ','); /* Get another argument */ if (c != ')') /* Must end at ) */ goto bad_define; c = ' '; /* Will skip to body */ } else { /* * DEF_NOARGS is needed to distinguish between * "#define foo" and "#define foo()". */ nargs = DEF_NOARGS; /* No () parameters */ } if (type[c] == SPA) /* At whitespace? */ c = skipws(); /* Not any more. */ workp = work; /* Replacement put here */ inmacro = TRUE; /* Keep \ now */ while (c != EOF_CHAR && c != '\n') { /* Compile ma cro body */ #if OK_CONCAT #if COMMENT_INVISIBLE if (c == COM_SEP) { /* Token concatenation? */ save(TOK_SEP); /* Stuff a delimiter */ c = get(); #else if (c == '#') { /* Token concatenation? */ while (workp > work && type[workp[-1]] == SPA) --workp; /* Erase leading spaces */ save(TOK_SEP); /* Stuff a delimiter */ c = skipws(); /* Eat whitespace */ #endif if (type[c] == LET) /* Another token here? */ ; /* Stuff it normally */ else if (type[c] == DIG) { /* Digit string after? */ while (type[c] == DIG) { /* Stuff the digits */ save(c); c = get(); } save(TOK_SEP); /* Delimit 2nd token */ } else { #if ! COMMENT_INVISIBLE ciwarn("Strange character after # (%d.)", c); #endif } continue; } #endif switch (type[c]) { case LET: checkparm(c, dp); /* Might be a formal */ break; case DIG: /* Number in mac. body */ case DOT: /* Maybe a float number */ scannumber(c, save); /* Scan it off */ break; case QUO: /* String in mac. body */ #if STRING_FORMAL stparmscan(c, dp); /* Do string magic */ #else stparmscan(c); #endif break; case BSH: /* Backslash */ save('\\'); if ((c = get()) == '\n') wrongline = TRUE; save(c); break; case SPA: /* Absorb whitespace */ /* * Note: the "end of comment" marker is passed on * to allow comments to separate tokens. */ if (workp[-1] == ' ') /* Absorb multiple */ break; /* spaces */ else if (c == '\t') c = ' '; /* Normalize tabs */ /* Fall through to store character */ default: /* Other character */ save(c); break; } c = get(); } inmacro = FALSE; /* Stop newline hack */ unget(); /* For control check */ if (workp > work && workp[-1] == ' ') /* Drop trailing blank */ workp--; *workp = EOS; /* Terminate work */ dp->repl = savestring(work); /* Save the string */ dp->nargs = nargs; /* Save arg count */ #if DEBUG if (debug) dumpadef("macro definition", dp); #endif if (isredefine) { /* Error if redefined */ if ((old != NULL && dp->repl != NULL && !streq(old, dp->repl)) || (old == NULL && dp->repl != NULL) || (old != NULL && dp->repl == NULL)) { #ifdef STRICT_UNDEF cerror("Redefining defined variable \"%s\"", dp->name); #else cwarn("Redefining defined variable \"%s\"", dp->name); #endif } if (old != NULL) /* We don't need the */ free(old); /* old definition now. */ } return; bad_define: cerror("#define syntax error", NULLST); inmacro = FALSE; /* Stop hack */ } checkparm(c, dp) register int c; DEFBUF *dp; /* * Replace this param if it's defined. Note that the macro name is a * possible replacement token. We stuff DEF_MAGIC in front of the token * which is treated as a LETTER by the token scanner and eaten by * the output routine. This prevents the macro expander from * looping if someone writes "#define foo foo". */ { register int i; register char *cp; scanid(c); /* Get parm to token[] */ for (i = 0; i < nargs; i++) { /* For each argument */ if (streq(parlist[i], token)) { /* If it's known */ save(i + MAC_PARM); /* Save a magic cookie */ return; /* And exit the search */ } } if (streq(dp->name, token)) /* Macro name in body? */ save(DEF_MAGIC); /* Save magic marker */ for (cp = token; *cp != EOS;) /* And save */ save(*cp++); /* The token itself */ } #if STRING_FORMAL stparmscan(delim, dp) int delim; register DEFBUF *dp; /* * Scan the string (starting with the given delimiter). * The token is replaced if it is the only text in this string or * character constant. The algorithm follows checkparm() above. * Note that scanstring() has approved of the string. */ { register int c; /* * Warning -- this code hasn't been tested for a while. * It exists only to preserve compatibility with earlier * implementations of cpp. It is not part of the Draft * ANSI Standard C language. */ save(delim); instring = TRUE; while ((c = get()) != delim && c != '\n' && c != EOF_CHAR) { if (type[c] == LET) /* Maybe formal parm */ checkparm(c, dp); else { save(c); if (c == '\\') save(get()); } } instring = FALSE; if (c != delim) cerror("Unterminated string in macro body", NULLST); save(c); } #else stparmscan(delim) int delim; /* * Normal string parameter scan. */ { register char *wp; register int i; extern int save(); wp = workp; /* Here's where it starts */ if (!scanstring(delim, save)) return; /* Exit on scanstring error */ workp[-1] = EOS; /* Erase trailing quote */ wp++; /* -> first string content byte */ for (i = 0; i < nargs; i++) { if (streq(parlist[i], wp)) { *wp++ = MAC_PARM + PAR_MAC; /* Stuff a magic marker */ *wp++ = (i + MAC_PARM); /* Make a formal marker */ *wp = wp[-3]; /* Add on closing quote */ workp = wp + 1; /* Reset string end */ return; } } workp[-1] = wp[-1]; /* Nope, reset end quote. */ } #endif doundef() /* * Remove the symbol from the defined list. * Called from the #control processor. */ { register int c; if (type[(c = skipws())] != LET) cerror("Illegal #undef argument", NULLST); else { scanid(c); /* Get name to token[] */ if (defendel(token, TRUE) == NULL) { #ifdef STRICT_UNDEF cwarn("Symbol \"%s\" not defined in #undef", token); #endif } } } textput(text) char *text; /* * Put the string in the parm[] buffer. */ { register int size; size = strlen(text) + 1; if ((parmp + size) >= &parm[NPARMWORK]) cfatal("Macro work area overflow", NULLST); else { strcpy(parmp, text); parmp += size; } } charput(c) register int c; /* * Put the byte in the parm[] buffer. */ { if (parmp >= &parm[NPARMWORK]) cfatal("Macro work area overflow", NULLST); else { *parmp++ = c; } } /* * M a c r o E x p a n s i o n */ static DEFBUF *macro; /* Catches start of infinite macro */ expand(tokenp) register DEFBUF *tokenp; /* * Expand a macro. Called from the cpp mainline routine (via subroutine * macroid()) when a token is found in the symbol table. It calls * expcollect() to parse actual parameters, checking for the correct number. * It then creates a "file" containing a single line containing the * macro with actual parameters inserted appropriately. This is * "pushed back" onto the input stream. (When the get() routine runs * off the end of the macro line, it will dismiss the macro itself.) */ { register int c; register FILEINFO *file; extern FILEINFO *getfile(); #if DEBUG if (debug) dumpadef("expand entry", tokenp); #endif /* * If no macro is pending, save the name of this macro * for an eventual error message. */ if (recursion++ == 0) macro = tokenp; else if (recursion == RECURSION_LIMIT) { cerror("Recursive macro definition of \"%s\"", tokenp->name); fprintf(stderr, "(Defined by \"%s\")\n", macro->name); if (rec_recover) { do { c = get(); } while (infile != NULL && infile->fp == NULL); unget(); recursion = 0; return; } } /* * Here's a macro to expand. */ nargs = 0; /* Formals counter */ parmp = parm; /* Setup parm buffer */ switch (tokenp->nargs) { case (-2): /* __LINE__ */ sprintf(work, "%d", line); ungetstring(work); break; case (-3): /* __FILE__ */ for (file = infile; file != NULL; file = file->parent) { if (file->fp != NULL) { sprintf(work, "\"%s\"", (file->progname != NULL) ? file->progname : file->filename); ungetstring(work); break; } } break; default: /* * Nothing funny about this macro. */ if (tokenp->nargs < 0) cfatal("Bug: Illegal __ macro \"%s\"", tokenp->name); while ((c = skipws()) == '\n') /* Look for (, skipping */ wrongline = TRUE; /* spaces and newlines */ if (c != '(') { /* * If the programmer writes * #define foo() ... * ... * foo [no ()] * just write foo to the output stream. */ unget(); cwarn("Macro \"%s\" needs arguments", tokenp->name); fputs(tokenp->name, stdout); return; } else if (expcollect()) { /* Collect arguments */ if (tokenp->nargs != nargs) { /* Should be an error? */ cwarn("Wrong number of macro arguments for \"%s\"", tokenp->name); } #if DEBUG if (debug) dumpparm("expand"); #endif } /* Collect arguments */ case DEF_NOARGS: /* No parameters just stuffs */ expstuff(tokenp); /* Do actual parameters */ } /* nargs switch */ } FILE_LOCAL int expcollect() /* * Collect the actual parameters for this macro. TRUE if ok. */ { register int c; register int paren; /* For embedded ()'s */ extern int charput(); for (;;) { paren = 0; /* Collect next arg. */ while ((c = skipws()) == '\n') /* Skip over whitespace */ wrongline = TRUE; /* and newlines. */ if (c == ')') { /* At end of all args? */ /* * Note that there is a guard byte in parm[] * so we don't have to check for overflow here. */ *parmp = EOS; /* Make sure terminated */ break; /* Exit collection loop */ } else if (nargs >= LASTPARM) cfatal("Too many arguments in macro expansion", NULLST); parlist[nargs++] = parmp; /* At start of new arg */ for (;; c = cget()) { /* Collect arg's bytes */ if (c == EOF_CHAR) { cerror("end of file within macro argument", NULLST); return (FALSE); /* Sorry. */ } else if (c == '\\') { /* Quote next character */ charput(c); /* Save the \ for later */ charput(cget()); /* Save the next char. */ continue; /* And go get another */ } else if (type[c] == QUO) { /* Start of string? */ scanstring(c, charput); /* Scan it off */ continue; /* Go get next char */ } else if (c == '(') /* Worry about balance */ paren++; /* To know about commas */ else if (c == ')') { /* Other side too */ if (paren == 0) { /* At the end? */ unget(); /* Look at it later */ break; /* Exit arg getter. */ } paren--; /* More to come. */ } else if (c == ',' && paren == 0) /* Comma delimits args */ break; else if (c == '\n') /* Newline inside arg? */ wrongline = TRUE; /* We'll need a #line */ charput(c); /* Store this one */ } /* Collect an argument */ charput(EOS); /* Terminate argument */ #if DEBUG if (debug) printf("parm[%d] = \"%s\"\n", nargs, parlist[nargs - 1]); #endif } /* Collect all args. */ return (TRUE); /* Normal return */ } FILE_LOCAL expstuff(tokenp) DEFBUF *tokenp; /* Current macro being expanded */ /* * Stuff the macro body, replacing formal parameters by actual parameters. */ { register int c; /* Current character */ register char *inp; /* -> repl string */ register char *defp; /* -> macro output buff */ int size; /* Actual parm. size */ char *defend; /* -> output buff end */ int string_magic; /* String formal hack */ FILEINFO *file; /* Funny #include */ extern FILEINFO *getfile(); file = getfile(NBUFF, tokenp->name); inp = tokenp->repl; /* -> macro replacement */ defp = file->buffer; /* -> output buffer */ defend = defp + (NBUFF - 1); /* Note its end */ if (inp != NULL) { while ((c = (*inp++ & 0xFF)) != EOS) { if (c >= MAC_PARM && c <= (MAC_PARM + PAR_MAC)) { string_magic = (c == (MAC_PARM + PAR_MAC)); if (string_magic) c = (*inp++ & 0xFF); /* * Replace formal parameter by actual parameter string. */ if ((c -= MAC_PARM) < nargs) { size = strlen(parlist[c]); if ((defp + size) >= defend) goto nospace; /* * Erase the extra set of quotes. */ if (string_magic && defp[-1] == parlist[c][0]) { strcpy(defp-1, parlist[c]); defp += (size - 2); } else { strcpy(defp, parlist[c]); defp += size; } } } else if (defp >= defend) { nospace: cfatal("Out of space in macro \"%s\" arg expansion", tokenp->name); } else { *defp++ = c; } } } *defp = EOS; #if DEBUG if (debug > 1) printf("macroline: \"%s\"\n", fi!le->buffer); #endif } #if DEBUG dumpparm(why) char *why; /* * Dump parameter list. */ { register int i; printf("dump of %d parameters (%d bytes total) %s\n", nargs, parmp - parm, why); for (i = 0; i < nargs; i++) { printf("parm[%d] (%d) = \"%s\"\n", i + 1, strlen(parlist[i]), parlist[i]); } } #endif l*[IMAKE.CPP.BUILD]CPP4.OBJ;1+,wr-. /@ 4  -Z0123KPWO 56yXc7`5_89G@HJ1CPP4V1.0 6-JAN-1993 14:37VAX C V3.2-044PToo many arguments for macroPStrange character after # (%d.)=PRedefining defined variable "%s"^P#define syntax errorsPIllegal #undef argumentPMacro work area overflowPMacro work area overflowPRecursive macro definition of "%s"P(Defined by "%s") P%dP"%s"PBug: Illegal __ macro "%s"PMacro "%s" needs arguments1PWrong number of macro arguments for "%s"ZPToo many arguments in  Tg(a~ IMAKE.SAVwr-ZMAKE.CPP.BUILD]CPP4.OBJ;1 Ymacro expansionPend of file within macro argumentPOut of space C$V_CTYPEDEFSCHARPUTTEXTPUT STPARMSCAN CHECKPARMSTRCPY SAVESTRINGDEFENDELLOOKIDSPRINTFFPRINTFFPUTSCERRORFREECWARNSTRCMPUNGET STPARMSCAN SCANNUMBER CHECKPARMCIWARNTEXTPUTSCANIDCFATALGETSKIPWSSAVESAVESTRCMPSCANIDSTRCMP SCANSTRINGSAVESCANIDCERRORSKIPWSCFATALSTRLENCFATALCWARN in macro "%s" arg expansionP^X WUSKIPWS@g1nPLOOKIDPT DEFENDELPT PnФԤe   GETPSS(1ń SKIPWSYń CFATALiPSS)~Cg1SSCANIDń Rń  B  ݮSTRLENPV V\ R\RCFATALPݮ STRCPYV iPSS,1_S)1 SPń CgC SKIPWSPSh S1IS 1ASAVEZGET[STRCMPSAVEYSTRCMPS#1h\R\R)RBgCPhh\R\R RBgCjSKIPWSPSCgRR1RSjkPSCgj1PSCIWARN1PCgR1lRPP0P P?PPA1IPAXP16?PS TVݮ SCANID\ń 0P L P\~i1P\\ń  Pi \l1P~il1PSAVES SCANNUMBER1PSVhRSAVEV SCANSTRINGP1hPR\ń 1RL P\PPbRhJ\\ń h\7\~jkP  PjPhR  S  SSjkPSSS 1 UNGEThSRSR ShhRb SAVESTRINGPń nNծդݤݮSTRCMPPծդ ծդ=CWARNծ ݮFREE^CERROR ^ TSݬSCANIDRÄ .PdB STRCMPPR~SAVERRÄ dЬRSTRCMPP SAVEdRb~SAVEb<^UTeSSAVEݬ SCANSTRINGPePSRĄ 4SB STRCMPPRPPcSeRRĄ eR^RSKIPWSP\L ߢsCERRORP\SCANID DEFENDELP^TRݬSTRLENPS SQ PQPċCFATALݬ STRCPYS ^TR S PSPĤCFATALSQS ^UVXZ YWЬSjRjRSLj TjJŽCERRORLj RFPRINTFGEThRբUNGETjDŽ g У PPPh?PfSPRINTFf UNGETSTRINGPhR1բ+ТPPTТTTfSPRINTFf UNGETSTRINGPТ Rգ CFATALSKIPWSPRR PiSKIPWSPRR R(&UNGETCWARNFPUTS#Pѣ DŽ 1CWARNS^V X WTPRSKIPWSP\\ PgSKIPWSP\\ \)  1rPĄ  ZCFATALĄ SĄ  C \ƀCERRORP\\k\U S PSPƤCFATALPSQS UaCGETPU S PSPƤCFATAL1PSQS Ua~PLhACHARPUT\ SCANSTRINGd\(R,P\)R UNGETVPR\,RG\ g\U S PSPƤCFATALPSQS UaCGETP\1P\ U RURƤCFATAL1oPUSU \c1]P^XUЬR<~GETFILEТSTTZS1PP2PR1STRCPYYRRvVRVV PP2PRRRń kB STRLENPWTPPZ:VSKIPWSCFATAL UNGETSTRINGUNGETGETCERRORUNGET SCANSTRINGCERRORCGETCFATALSKIPWSCHARPUTCFATALSTRLENGETFILE DODEFINE T CHECKPARM < STPARMSCAN TDOUNDEF TEXTPUT CHARPUT 4EXPAND $CODE $DATASTDINSTDOUTSTDERR_CTYPE_ERRNO VAXC$ERRNOLINE WRONGLINETYPE TOKENKINSTRINGINMACROERRORS RECURSION IFSTACKIFPTRINCDIRINCENDCFLAGEFLAGNFLAG REC_RECOVERPRESETMAGICINFILEWORKWORKP KEEPCOMMENTS SIZE_TABLE$CHAR_STRING_CONSTANTS!B P`PT~iWPPT2PB TiWT TZЬPȢCFATALPRPP2PR1IdP0PP0,P8*[IMAKE.CPP.BUILD]CPP5.C;1+,yr.0/@ 40+-Z0123KPWO,56qB7;_89G@HJ/* * C P P 5 . C * E x p r e s s i o n E v a l u a t i o n * * Edit History * 31-Aug-84 MM USENET net.sources release * 04-Oct-84 MM __LINE__ and __FILE__ must call ungetstring() * so they work correctly with token concatenation. * Added string formal recognition. * 25-Oct-84 MM "Short-circuit" evaluate #if's so that we * don't print unnecessary error messages for * #if !defined(FOO) && FOO != 0 && 10 / FOO ... * 31-Oct-84 ado/MM Added token concatenation * 6-Nov-84 MM Split from #define stuff, added sizeof stuff * 19-Nov-84 ado #if error returns TRUE for (sigh) compatibility */ #include #include #include "cppdef.h" #include "cpp.h" /* * Evaluate an #if expression. */ static char *opname[] = { /* For debug and error messages */ "end of expression", "val", "id", "+", "-", "*", "/", "%", "<<", ">>", "&", "|", "^", "==", "!=", "<", "<=", ">=", ">", "&&", "||", "?", ":", ",", "unary +", "unary -", "~", "!", "(", ")", "(none)", }; /* * opdope[] has the operator precedence: * Bits * 7 Unused (so the value is always positive) * 6-2 Precedence (000x .. 017x) * 1-0 Binary op. flags: * 01 The binop flag should be set/cleared when this op is seen. * 10 The new value of the binop flag. * Note: Expected, New binop * constant 0 1 Binop, end, or ) should follow constants * End of line 1 0 End may not be preceeded by an operator * binary 1 0 Binary op follows a value, value follows. * unary 0 0 Unary op doesn't follow a value, value follows * ( 0 0 Doesn't follow value, value or unop follows * ) 1 1 Follows value. Op follows. */ static char opdope[OP_MAX] = { 0001, /* End of expression */ 0002, /* Digit */ 0000, /* Letter (identifier) */ 0141, 0141, 0151, 0151, 0151, /* ADD, SUB, MUL, DIV, MOD */ 0131, 0131, 0101, 0071, 0071, /* ASL, ASR, AND, OR, XOR */ 0111, 0111, 0121, 0121, 0121, 0121, /* EQ, NE, LT, LE, GE, GT */ 0061, 0051, 0041, 0041, 0031, /* ANA, ORO, QUE, COL , CMA */ /* * Unary op's follow */ 0160, 0160, 0160, 0160, /* NEG, PLU, COM, NOT */ 0170, 0013, 0023, /* LPA, RPA, END */ }; /* * OP_QUE and OP_RPA have alternate precedences: */ #define OP_RPA_PREC 0013 #define OP_QUE_PREC 0034 /* * S_ANDOR and S_QUEST signal "short-circuit" boolean evaluation, so that * #if FOO != 0 && 10 / FOO ... * doesn't generate an error message. They are stored in optab.skip. */ #define S_ANDOR 2 #define S_QUEST 1 typedef struct optab { char op; /* Operator */ char prec; /* Its precedence */ char skip; /* Short-circuit: TRUE to skip */ } OPTAB; static int evalue; /* Current value from evallex() */ #ifdef nomacargs FILE_LOCAL int isbinary(op) register int op; { return (op >= FIRST_BINOP && op <= LAST_BINOP); } FILE_LOCAL int isunary(op) register int op; { return (op >= FIRST_UNOP && op <= LAST_UNOP); } #else #define isbinary(op) (op >= FIRST_BINOP && op <= LAST_BINOP) #define isunary(op) (op >= FIRST_UNOP && op <= LAST_UNOP) #endif /* * The following definitions are used to specify basic variable sizes. */ #ifndef S_CHAR #define S_CHAR (sizeof (char)) #endif #ifndef S_SINT #define S_SINT (sizeof (short int)) #endif #ifndef S_INT #define S_INT (sizeof (int)) #endif #ifndef S_LINT #define S_LINT (sizeof (long int)) #endif #ifndef S_FLOAT #define S_FLOAT (sizeof (float)) #endif #ifndef S_DOUBLE #define S_DOUBLE (sizeof (double)) #endif #ifndef S_PCHAR #define S_PCHAR (sizeof (char *)) #endif #ifndef S_PSINT #define S_PSINT (sizeof (short int *)) #endif #ifndef S_PINT #define S_PINT (sizeof (int *)) #endif #ifndef S_PLINT #define S_PLINT (sizeof (long int *)) #endif #ifndef S_PFLOAT #define S_PFLOAT (sizeof (float *)) #endif #ifndef S_PDOUBLE #define S_PDOUBLE (sizeof (double *)) #endif #ifndef S_PFPTR #define S_PFPTR (sizeof (int (*)())) #endif typedef struct types { short type; /* This is the bit if */ char *name; /* this is the token word */ } TYPES; static TYPES basic_types[] = { { T_CHAR, "char", }, { T_INT, "int", }, { T_FLOAT, "float", }, { T_DOUBLE, "double", }, { T_SHORT, "short", }, { T_LONG, "long", }, { T_SIGNED, "signed", }, { T_UNSIGNED, "unsigned", }, { 0, NULL, }, /* Signal end */ }; /* * Test_table[] is used to test for illegal combinations. */ static short test_table[] = { T_FLOAT | T_DOUBLE | T_LONG | T_SHORT, T_FLOAT | T_DOUBLE | T_CHAR | T_INT, T_FLOAT | T_DOUBLE | T_SIGNED | T_UNSIGNED, T_LONG | T_SHORT | T_CHAR, 0 /* end marker */ }; /* * The order of this table is important -- it is also referenced by * the command line processor to allow run-time overriding of the * built-in size values. The order must not be changed: * char, short, int, long, float, double (func pointer) */ SIZES size_table[] = { { T_CHAR, S_CHAR, S_PCHAR }, /* char */ { T_SHORT, S_SINT, S_PSINT }, /* short int */ { T_INT, S_INT, S_PINT }, /* int */ { T_LONG, S_LINT, S_PLINT }, /* long */ { T_FLOAT, S_FLOAT, S_PFLOAT }, /* float */ { T_DOUBLE, S_DOUBLE, S_PDOUBLE }, /* double */ { T_FPTR, 0, S_PFPTR }, /* int (*()) */ { 0, 0, 0 }, /* End of table */ }; int eval() /* * Evaluate an expression. Straight-forward operator precedence. * This is called from control() on encountering an #if statement. * It calls the following routines: * evallex Lexical analyser -- returns the type and value of * the next input token. * evaleval Evaluate the current operator, given the values on * the value stack. Returns a pointer to the (new) * value stack. * For compatiblity with older cpp's, this return returns 1 (TRUE) * if a syntax error is detected. */ { register int op; /* Current operator */ register int *valp; /* -> value vector */ register OPTAB *opp; /* Operator stack */ int prec; /* Op precedence */ int binop; /* Set if binary op. needed */ int op1; /* Operand from stack */ int skip; /* For short-circuit testing */ int value[NEXP]; /* Value stack */ OPTAB opstack[NEXP]; /* Operand stack */ extern int *evaleval(); /* Does actual evaluation */ valp = value; opp = opstack; opp->op = OP_END; /* Mark bottom of stack */ opp->prec = opdope[OP_END]; /* And its precedence */ opp->skip = 0; /* Not skipping now */ binop = 0; again: ; #ifdef DEBUG_EVAL printf("In #if at again: skip = %d, binop = %d, line is: %s", opp->skip, binop, infile->bptr); #endif if ((op = evallex(opp->skip)) == OP_SUB && binop == 0) op = OP_NEG; /* Unary minus */ else if (op == OP_ADD && binop == 0) op = OP_PLU; /* Unary plus */ else if (op == OP_FAIL) return (1); /* Error in evallex */ #ifdef DEBUG_EVAL printf("op = %s, opdope = %03o, binop = %d, skip = %d\n", opname[op], opdope[op], binop, opp->skip); #endif if (op == DIG) { /* Value? */ if (binop != 0) { cerror("misplaced constant in #if", NULLST); return (1); } else if (valp >= &value[NEXP-1]) { cerror("#if value stack overflow", NULLST); return (1); } else { #ifdef DEBUG_EVAL printf("pushing %d onto value stack[%d]\n", evalue, valp - value); #endif *valp++ = evalue; binop = 1; } goto again; } else if (op > OP_END) { cerror("Illegal #if line", NULLST); return (1); } prec = opdope[op]; if (binop != (prec & 1)) { cerror("Operator %s in incorrect context", opname[op]); return (1); } binop = (prec & 2) >> 1; for (;;) { #ifdef DEBUG_EVAL printf("op %s, prec %d., stacked op %s, prec %d, skip %d\n", opname[op], prec, opname[opp->op], opp->prec, opp->skip); #endif if (prec > opp->prec) { if (op == OP_LPA) prec = OP_RPA_PREC; else if (op == OP_QUE) prec = OP_QUE_PREC; op1 = opp->skip; /* Save skip for test */ /* * Push operator onto op. stack. */ opp++; if (opp >= &opstack[NEXP]) { cerror("expression stack overflow at op \"%s\"", opname[op]); return (1); } opp->op = op; opp->prec = prec; skip = (valp[-1] != 0); /* Short-circuit tester */ /* * Do the short-circuit stuff here. Short-circuiting * stops automagically when operators are evaluated. */ if ((op == OP_ANA && !skip) || (op == OP_ORO && skip)) opp->skip = S_ANDOR; /* And/or skip starts */ else if (op == OP_QUE) /* Start of ?: operator */ opp->skip = (op1 & S_ANDOR) | ((!skip) ? S_QUEST : 0); else if (op == OP_COL) { /* : inverts S_QUEST */ opp->skip = (op1 & S_ANDOR) | (((op1 & S_QUEST) != 0) ? 0 : S_QUEST); } else { /* Other ops leave */ opp->skip = op1; /* skipping unchanged. */ } #ifdef DEBUG_EVAL printf("stacking %s, valp[-1] == %d at %s", opname[op], valp[-1], infile->bptr); dumpstack(opstack, opp, value, valp); #endif goto again; } /* * Pop operator from op. stack and evaluate it. * End of stack and '(' are specials. */ skip = opp->skip; /* Remember skip value */ switch ((op1 = opp->op)) { /* Look at stacked op */ case OP_END: /* Stack end marker */ if (op == OP_EOE) return (valp[-1]); /* Finished ok. */ goto again; /* Read another op. */ case OP_LPA: /* ( on stack */ if (op != OP_RPA) { /* Matches ) on input */ cerror("unbalanced paren's, op is \"%s\"", opname[op]); return (1); } opp--; /* Unstack it */ /* goto again; -- Fall through */ case OP_QUE: goto again; /* Evaluate true expr. */ case OP_COL: /* : on stack. */ opp--; /* Unstack : */ if (opp->op != OP_QUE) { /* Matches ? on stack? */ cerror("Misplaced '?' or ':', previous operator is %s", opname[opp->op]); return (1); } /* * Evaluate op1. */ default: /* Others: */ opp--; /* Unstack the operator */ #ifdef DEBUG_EVAL printf("Stack before evaluation of %s\n", opname[op1]); dumpstack(opstack, opp, value, valp); #endif valp = evaleval(valp, op1, skip); #ifdef DEBUG_EVAL printf("Stack after evaluation\n"); dumpstack(opstack, opp, value, valp); #endif } /* op1 switch end */ } /* Stack unwind loop */ } FILE_LOCAL int evallex(skip) int skip;  /* TRUE if short-circuit evaluation */ /* * Return next eval operator or value. Called from eval(). It * calls a special-purpose routines for 'char' strings and * numeric values: * evalchar called to evaluate 'x' * evalnum called to evaluate numbers. */ { register int c, c1, t; again: do { /* Collect the token */ c = skipws(); if ((c = macroid(c)) == EOF_CHAR || c == '\n') { unget(); return (OP_EOE); /* End of expression */ } } while ((t = type[c]) == LET && catenate()); if (t == INV) { /* Total nonsense */ if (!skip) { if (isascii(c) && isprint(c)) cierror("illegal character '%c' in #if", c); else cierror("illegal character (%d decimal) in #if", c); } return (OP_FAIL); } else if (t == QUO) { /* ' or " */ if (c == '\'') { /* Character constant */ evalue = evalchar(skip); /* Somewhat messy */ #ifdef DEBUG_EVAL printf("evalchar returns %d.\n", evalue); #endif return (DIG); /* Return a value */ } cerror("Can't use a string in an #if", NULLST); return (OP_FAIL); } else if (t == LET) { /* ID must be a macro */ if (streq(token, "defined")) { /* Or defined name */ c1 = c = skipws(); if (c == '(') /* Allow defined(name) */ c = skipws(); if (type[c] == LET) { evalue = (lookid(c) != NULL); if (c1 != '(' /* Need to balance */ || skipws() == ')') /* Did we balance? */ return (DIG); /* Parsed ok */ } cerror("Bad #if ... defined() syntax", NULLST); return (OP_FAIL); } else if (streq(token, "sizeof")) /* New sizeof hackery */ return (dosizeof()); /* Gets own routine */ /* * The Draft ANSI C Standard says that an undefined symbol * in an #if has the value zero. We are a bit pickier, * warning except where the programmer was careful to write * #if defined(foo) ? foo : 0 */ #ifdef STRICT_UNDEF if (!skip) cwarn("undefined symbol \"%s\" in #if, 0 used", token); #endif evalue = 0; return (DIG); } else if (t == DIG) { /* Numbers are harder */ evalue = evalnum(c); #ifdef DEBUG_EVAL printf("evalnum returns %d.\n", evalue); #endif } else if (strchr("!=<>&|\\", c) != NULL) { /* * Process a possible multi-byte lexeme. */ c1 = cget(); /* Peek at next char */ switch (c) { case '!': if (c1 == '=') return (OP_NE); break; case '=': if (c1 != '=') { /* Can't say a=b in #if */ unget(); cerror("= not allowed in #if", NULLST); return (OP_FAIL); } return (OP_EQ); case '>': case '<': if (c1 == c) return ((c == '<') ? OP_ASL : OP_ASR); else if (c1 == '=') return ((c == '<') ? OP_LE : OP_GE); break; case '|': case '&': if (c1 == c) return ((c == '|') ? OP_ORO : OP_ANA); break; case '\\': if (c1 == '\n') /* Multi-line if */ goto again; cerror("Unexpected \\ in #if", NULLST); return (OP_FAIL); } unget(); } return (t); } FILE_LOCAL int dosizeof() /* * Process the sizeof (basic type) operation in an #if string. * Sets evalue to the size and returns * DIG success * OP_FAIL bad parse or something. */ { register int c; register TYPES *tp; register SIZES *sizp; register short *testp; short typecode; if ((c = skipws()) != '(') goto nogood; /* * Scan off the tokens. */ typecode = 0; while ((c = skipws())) { if ((c = macroid(c)) == EOF_CHAR || c == '\n') goto nogood; /* End of line is a bug */ else if (c == '(') { /* thing (*)() func ptr */ if (skipws() == '*' && skipws() == ')') { /* We found (*) */ if (skipws() != '(') /* Let () be optional */ unget(); else if (skipws() != ')') goto nogood; typecode |= T_FPTR; /* Function pointer */ } else { /* Junk is a bug */ goto nogood; } } else if (type[c] != LET) /* Exit if not a type */ break; else if (!catenate()) { /* Maybe combine tokens */ /* * Look for this unexpandable token in basic_types. * The code accepts "int long" as well as "long int" * which is a minor bug as bugs go (and one shared with * a lot of C compilers). */ for (tp = basic_types; tp->name != NULLST; tp++) { if (streq(token, tp->name)) break; } if (tp->name == NULLST) { cerror("#if sizeof, unknown type \"%s\"", token); return (OP_FAIL); } typecode |= tp->type; /* Or in the type bit */ } } /* * We are at the end of the type scan. Chew off '*' if necessary. */ if (c == '*') { typecode |= T_PTR; c = skipws(); } if (c == ')') { /* Last syntax check */ for (testp = test_table; *testp != 0; testp++) { if (!bittest(typecode & *testp)) { cerror("#if ... sizeof: illegal type combination", NULLST); return (OP_FAIL); } } /* * We assume that all function pointers are the same size: * sizeof (int (*)()) == sizeof (float (*)()) * We assume that signed and unsigned don't change the size: * sizeof (signed int) == (sizeof unsigned int) */ if ((typecode & T_FPTR) != 0) /* Function pointer */ typecode = T_FPTR | T_PTR; else { /* Var or var * datum */ typecode &= ~(T_SIGNED | T_UNSIGNED); if ((typecode & (T_SHORT | T_LONG)) != 0) typecode &= ~T_INT; } if ((typecode & ~T_PTR) == 0) { cerror("#if sizeof() error, no type specified", NULLST); return (OP_FAIL); } /* * Exactly one bit (and possibly T_PTR) may be set. */ for (sizp = size_table; sizp->bits != 0; sizp++) { if ((typecode & ~T_PTR) == sizp->bits) { evalue = ((typecode & T_PTR) != 0) ? sizp->psize : sizp->size; return (DIG); } } /* We shouldn't fail */ cierror("#if ... sizeof: bug, unknown type code 0x%x", typecode); return (OP_FAIL); } nogood: unget(); cerror("#if ... sizeof() syntax error", NULLST); return (OP_FAIL); } FILE_LOCAL int bittest(value) /* * TRUE if value is zero or exactly one bit is set in value. */ { #if (4096 & ~(-4096)) == 0 return ((value & ~(-value)) == 0); #e!lse /* * Do it the hard way (for non 2's complement machines) */ return (value == 0 || value ^ (value - 1) == (value * 2 - 1)); #endif } FILE_LOCAL int evalnum(c) register int c; /* * Expand number for #if lexical analysis. Note: evalnum recognizes * the unsigned suffix, but only returns a signed int value. */ { register int value; register int base; register int c1; if (c != '0') base = 10; else if ((c = cget()) == 'x' || c == 'X') { base = 16; c = cget(); } else base = 8; value = 0; for (;;) { c1 = c; if (isascii(c) && isupper(c1)) c1 = tolower(c1); if (c1 >= 'a') c1 -= ('a' - 10); else c1 -= '0'; if (c1 < 0 || c1 >= base) break; value *= base; value += c1; c = cget(); } if (c == 'u' || c == 'U') /* Unsigned nonsense */ c = cget(); unget(); return (value); } FILE_LOCAL int evalchar(skip) int skip; /* TRUE if short-circuit evaluation */ /* * Get a character constant */ { register int c; register int value; register int count; instring = TRUE; if ((c = cget()) == '\\') { switch ((c = cget())) { case 'a': /* New in Standard */ #if ('a' == '\a' || '\a' == ALERT) value = ALERT; /* Use predefined value */ #else value = '\a'; /* Use compiler's value */ #endif break; case 'b': value = '\b'; break; case 'f': value = '\f'; break; case 'n': value = '\n'; break; case 'r': value = '\r'; break; case 't': value = '\t'; break; case 'v': /* New in Standard */ #if ('v' == '\v' || '\v' == VT) value = VT; /* Use predefined value */ #else value = '\v'; /* Use compiler's value */ #endif break; case 'x': /* '\xFF' */ count = 3; value = 0; while ((((c = get()) >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F')) && (--count >= 0)) { value *= 16; value += (c <= '9') ? (c - '0') : ((c & 0xF) + 9); } unget(); break; default: if (c >= '0' && c <= '7') { count = 3; value = 0; while (c >= '0' && c <= '7' && --count >= 0) { value *= 8; value += (c - '0'); c = get(); } unget(); } else value = c; break; } } else if (c == '\'') value = 0; else value = c; /* * We warn on multi-byte constants and try to hack * (big|little)endian machines. */ #if BIG_ENDIAN count = 0; #endif while ((c = get()) != '\'' && c != EOF_CHAR && c != '\n') { if (!skip) ciwarn("multi-byte constant '%c' isn't portable", c); #if BIG_ENDIAN count += BITS_CHAR; value += (c << count); #else value <<= BITS_CHAR; value += c; #endif } instring = FALSE; return (value); } FILE_LOCAL int * evaleval(valp, op, skip) register int *valp; int op; int skip; /* TRUE if short-circuit evaluation */ /* * Apply the argument operator to the data on the value stack. * One or two values are popped from the value stack and the result * is pushed onto the value stack. * * OP_COL is a special case. * * evaleval() returns the new pointer to the top of the value stack. */ { register int v1, v2; if (isbinary(op)) v2 = *--valp; v1 = *--valp; #ifdef DEBUG_EVAL printf("%s op %s", (isbinary(op)) ? "binary" : "unary", opname[op]); if (isbinary(op)) printf(", v2 = %d.", v2); printf(", v1 = %d.\n", v1); #endif switch (op) { case OP_EOE: break; case OP_ADD: v1 += v2; break; case OP_SUB: v1 -= v2; break; case OP_MUL: v1 *= v2; break; case OP_DIV: case OP_MOD: if (v2 == 0) { if (!skip) { cwarn("%s by zero in #if, zero result assumed", (op == OP_DIV) ? "divide" : "mod"); } v1 = 0; } else if (op == OP_DIV) v1 /= v2; else v1 %= v2; break; case OP_ASL: v1 <<= v2; break; case OP_ASR: v1 >>= v2; break; case OP_AND: v1 &= v2; break; case OP_OR: v1 |= v2; break; case OP_XOR: v1 ^= v2; break; case OP_EQ: v1 = (v1 == v2); break; case OP_NE: v1 = (v1 != v2); break; case OP_LT: v1 = (v1 < v2); break; case OP_LE: v1 = (v1 <= v2); break; case OP_GE: v1 = (v1 >= v2); break; case OP_GT: v1 = (v1 > v2); break; case OP_ANA: v1 = (v1 && v2); break; case OP_ORO: v1 = (v1 || v2); break; case OP_COL: /* * v1 has the "true" value, v2 the "false" value. * The top of the value stack has the test. */ v1 = (*--valp) ? v1 : v2; break; case OP_NEG: v1 = (-v1); break; case OP_PLU: break; case OP_COM: v1 = ~v1; break; case OP_NOT: v1 = !v1; break; default: cierror("#if bug, operand = %d.", op); v1 = 0; } *valp++ = v1; return (valp); } #ifdef DEBUG_EVAL dumpstack(opstack, opp, value, valp) OPTAB opstack[NEXP]; /* Operand stack */ register OPTAB *opp; /* Operator stack */ int value[NEXP]; /* Value stack */ register int *valp; /* -> value vector */ { printf("index op prec skip name -- op stack at %s", infile->bptr); while (opp > opstack) { printf(" [%2d] %2d %03o %d %s\n", opp - opstack, opp->op, opp->prec, opp->skip, opname[opp->op]); opp--; } while (--valp >= value) { printf("value[%d] = %d\n", (valp - value), *valp); } } #endif *[IMAKE.CPP.BUILD]CPP5.OBJ;1+,r. /@ 4  -Z0123KPWO 56`ІXc7YC_89G@HJ1CPP5V1.0 6-JAN-1993 14:37VAX C V3.2-044Pend of expressionPPvalPPidPP+ PP-PP*PP/P!P%P!#P<< P#&P>>$P&)P&(P)+P|,P+-P^0P-/P==4P/2P!=8P25P<=DP:=P>HP=?P&&LP?BP||PPBEP?TPEGP:XPGIP,\PIKPunary +`PKSPunary -dPS[P~hP[]P!lP]_P(pP_aP)tPacP(none)xPcPaaiiiYYA99IIQQQQ1)!!ppppx PjPcharPjoPintPosPfloatPsyPdoublePyPshortP PlongP@PsignedPPunsignedPP<1P (PPmisplaced constant in #ifP#if value stack overflowPIllegal #if linePOperator %s in incorrect contextPexpression stack overflow at op "%s"%Punbalanced paren's, op is "%s"DPMisplaced '?' or ':', previous operator is %srPillegal character '%c' in #ifPillegal character (%d decimal) in #ifPCan't use a string in an #ifPdefinedPBad #if ... defined() syntaxPsizeofP!=<>&|\P= not allowed in #ifPUnexpected \ in #if0P#if sizeof, unknown type "%s"NP#if ... sizeof: illegal type combinationwP#if sizeof() error, no type specifiedP#if ... sizeof: bug, unknown type code 0x%xP#if ... sizeof() syntax errorPmulti-byte constant '%c' isn't portableP%s by zero in #if, zero result assumed6Pmod:PdivideAP#if bug, operand = %d.P|^VXS|RbȚY~P\\ Y\\ Y\ P\P\:YƛCERRORPTSTƵCERRORPȜY\CERRORPL|WˏWTYTLhCERRORPˏWTxTYPWP1\ W P\WURPRPLhCERRORP\bWTգT\T \ T1\#ˏUQTTPTTPPQQ1\ˏUQUTTTPPQQ1U1UbTTPP PQ.?P\1RУP\Lh%CERRORPR10PRbbP@hDCERRORPRUTSϙPS1P^U WXSKIPWSPSSMACROIDPSS  UNGETPCgVV CATENATEPVHլ?S)ˏSRBRhRSrCIERRORPSŐCIERRORPVA'S'ݬPȜPŶCERRORPV1 STRCMPP^SKIPWSPRRTR( SKIPWSPRBg+RLOOKIDQPQQȜT( SKIPWSP)PCERRORP STRCMPP:ȜPVS5PȜ1SSTRCHRP1CGETPTS!1SPP!P ?PP<1P<P?PP\11P|a1PT=1PT=UNGETCERRORP PTSS<P PPPT=HS<PPPPPTS0S|PPPPPT 1CERRORPUNGETVP^X T YVSKIPWSP(1WSKIPWSPR1SKIPWSUSTRCMPSRMACROIDPR1yR 1qR(>eP*1aeP)1VeP( UNGETPeP)17WKPBiNCATENATEP8Ơ\լݬdcP\լլd0CERRORPlWePR1PR*WSKIPWSPRR)1\l8PWRRlR2RPPRRPRPRPPNCERRORP\l WWWWRWWRwCERRORP\l,WSPSlWRR2RƜP\l2W~ȝCIERRORPUNGETCERROR2P^άPPPQPQQPP|^VЬUU0 T1PCGETPUUx UXTCGETPUTSPURUˏRP@f R~TOLOWERPRRa R0RRRTTSRSCGETPUPUu UUCGETUNGETSP^W CGETPXX\1CGETPTTPPaP1P?PU1=PU15P U1-P U1%P U1P U1P U1 PSUGETPRR0R9$Ra RfRAjRFaS]Pxp ~ IMAKE.SAVrZMAKE.CPP.BUILD]CPP5.OBJ;1 [. UUR90RV ˏRV VVUGETPRR0R9$Ra RfRA RFSUNGETdT0GT7BRUT0/T7*R&PxUU0TSSUGETPTT0 T7RUNGETTUPX'UPXUGETPRR';R7R 2լ RCIWARNxUURUGETPRR' RR  UP^WЬTѬ ѬtStRЬPP& P1cP?P1eSR1^PSR1VPSR1NPS,լ !Ѭ :VP6VVCWARNR1ѬSR1zRP{SPQPPR1xSRR1SUxURR1PRUUSR1PSR1PSR1PURSUUR1URSUUR1URSUUR1URSUUR1URS C$V_CTYPEDEFSSTRCHRLOOKIDTOLOWERCERRORCGETSTRCMPCERRORCIERRORCATENATEUNGETMACROIDSKIPWSCIERRORCERRORSTRCMPCATENATEUNGETMACROIDSKIPWSUNGETCGETCIWARNUNGETGETCGETCIERRORCWARN EVAL $CODE$DATASTDINSTDOUTSTDERR_CTYPE_ERRNO VAXC$ERRNOLINE WRONGLINETYPE TOKENKINSTRINGINMACROERRORS RECURSION IFSTACKIFPTRINCDIRINCENDCFLAGEFLAGNFLAG REC_RECOVERPRESETMAGICINFILEWORKWORKP KEEPCOMMENTS0 SIZE_TABLEX$CHAR_STRING_CONSTANTSEUUR1URSUURrPURSUUR_PPRSPPRJPtRUPSUUR4RR/P*PRR#PSRSSRPݬACIERRORRRTP PFJRZbb.>RfzP>FNV^fnvP]<]PSPDJggggg*g*[IMAKE.CPP.BUILD]CPP6.C;1+,r.</@ 4<7-Z0123KPWO856s7L_89G@HJ/* * C P P 6 . C * S u p p o r t R o u t i n e s * * Edit History * 25-May-84 MM Added 8-bit support to type table. * 30-May-84 ARF sharp() should output filename in quotes * 02-Aug-84 MM Newline and #line hacking. sharp() now in cpp1.c * 31-Aug-84 MM USENET net.sources release * 11-Sep-84 ado/MM Keepcomments, also line number pathological * 12-Sep-84 ado/MM bug if comment changes to space and we unget later. * 03-Oct-84 gkr/MM Fixed scannumber bug for '.e' (as in struct.element). * 04-Oct-84 MM Added ungetstring() for token concatenation * 08-Oct-84 MM Yet another attack on number scanning * 31-Oct-84 ado Parameterized $ in identifiers * 2-Nov-84 MM Token concatenation is messier than I thought * 6-Dec-84 MM \ is everywhere invisible. */ #include #include #include "cppdef.h" #include "cpp.h" /* * skipnl() skips over input text to the end of the line. * skipws() skips over "whitespace" (spaces or tabs), but * not skip over the end of the line. It skips over * TOK_SEP, however (though that shouldn't happen). * scanid() reads the next token (C identifier) into token[]. * The caller has already read the first character of * the identifier. Unlike macroid(), the token is * never expanded. * macroid() reads the next token (C identifier) into token[]. * If it is a #defined macro, it is expanded, and * macroid() returns TRUE, otherwise, FALSE. * catenate() Does the dirty work of token concatenation, TRUE if it did. * scanstring() Reads a string from the input stream, calling * a user-supplied function for each character. * This function may be output() to write the * string to the output file, or save() to save * the string in the work buffer. * scannumber() Reads a C numeric constant from the input stream, * calling the user-supplied function for each * character. (output() or save() as noted above.) * save() Save one character in the work[] buffer. * savestring() Saves a string in malloc() memory. * getfile() Initialize a new FILEINFO structure, called when * #include opens a new file, or a macro is to be * expanded. * getmem() Get a specified number of bytes from malloc memory. * output() Write one character to stdout (calling putchar) -- * implemented as a function so its address may be * passed to scanstring() and scannumber(). * lookid() Scans the next token (identifier) from the input * stream. Looks for it in the #defined symbol table. * Returns a pointer to the definition, if found, or NULL * if not present. The identifier is stored in token[]. * defnedel() Define enter/delete subroutine. Updates the * symbol table. * get() Read the next byte from the current input stream, * handling end of (macro/file) input and embedded * comments appropriately. Note that the global * instring is -- essentially -- a parameter to get(). * cget() Like get(), but skip over TOK_SEP. * unget() Push last gotten character back on the input stream. * cerror(), cwarn(), cfatal(), cierror(), ciwarn() * These routines format an print messages to the user. * cerror & cwarn take a format and a single string argument. * cierror & ciwarn take a format and a single int (char) argument. * cfatal takes a format and a single string argument. */ /* * This table must be rewritten for a non-Ascii machine. * * Note that several "non-visible" characters have special meaning: * Hex 1D DEF_MAGIC -- a flag to prevent #define recursion. * Hex 1E TOK_SEP -- a delimiter for token concatenation * Hex 1F COM_SEP -- a zero-width whitespace for comment concatenation */ #if TOK_SEP != 0x1E || COM_SEP != 0x1F || DEF_MAGIC != 0x1D << error type table isn't correct >> #endif #if OK_DOLLAR #define DOL LET #else #define DOL 000 #endif char type[256] = { /* Character type codes Hex */ END, 000, 000, 000, 000, 000, 000, 000, /* 00 */ 000, SPA, 000, 000, 000, 000, 000, 000, /* 08 */ 000, 000, 000, 000, 000, 000, 000, 000, /* 10 */ 000, 000, 000, 000, 000, LET, 000, SPA, /* 18 */ SPA,OP_NOT, QUO, 000, DOL,OP_MOD,OP_AND, QUO, /* 20 !"#$%&' */ OP_LPA,OP_RPA,OP_MUL,OP_ADD, 000,OP_SUB, DOT,OP_DIV, /* 28 ()*+,-./ */ DIG, DIG, DIG, DIG, DIG, DIG, DIG, DIG, /* 30 01234567 */ DIG, DIG,OP_COL, 000, OP_LT, OP_EQ, OP_GT,OP_QUE, /* 38 89:;<=>? */ 000, LET, LET, LET, LET, LET, LET, LET, /* 40 @ABCDEFG */ LET, LET, LET, LET, LET, LET, LET, LET, /* 48 HIJKLMNO */ LET, LET, LET, LET, LET, LET, LET, LET, /* 50 PQRSTUVW */ LET, LET, LET, 000, BSH, 000,OP_XOR, LET, /* 58 XYZ[\]^_ */ 000, LET, LET, LET, LET, LET, LET, LET, /* 60 `abcdefg */ LET, LET, LET, LET, LET, LET, LET, LET, /* 68 hijklmno */ LET, LET, LET, LET, LET, LET, LET, LET, /* 70 pqrstuvw */ LET, LET, LET, 000, OP_OR, 000,OP_NOT, 000, /* 78 xyz{|}~ */ 000, 000, 000, 000, 000, 000, 000, 000, /* 80 .. FF */ 000, 000, 000, 000, 000, 000, 000, 000, /* 80 .. FF */ 000, 000, 000, 000, 000, 000, 000, 000, /* 80 .. FF */ 000, 000, 000, 000, 000, 000, 000, 000, /* 80 .. FF */ 000, 000, 000, 000, 000, 000, 000, 000, /* 80 .. FF */ 000, 000, 000, 000, 000, 000, 000, 000, /* 80 .. FF */ 000, 000, 000, 000, 000, 000, 000, 000, /* 80 .. FF */ 000, 000, 000, 000, 000, 000, 000, 000, /* 80 .. FF */ }; skipnl() /* * Skip to the end of the current input line. */ { register int c; do { /* Skip to newline */ c = get(); } while (c != '\n' && c != EOF_CHAR); } int skipws() /* * Skip over whitespace */ { register int c; do { /* Skip whitespace */ c = get(); #if COMMENT_INVISIBLE } while (type[c] == SPA || c == COM_SEP); #else } while (type[c] == SPA); #endif return (c); } scanid(c) register int c; /* First char of id */ /* * Get the next token (an id) into the token buffer.  * Note: this code is duplicated in lookid(). * Change one, change both. */ { register char *bp; if (c == DEF_MAGIC) /* Eat the magic token */ c = get(); /* undefiner. */ bp = token; do { if (bp < &token[IDMAX]) /* token dim is IDMAX+1 */ *bp++ = c; c = get(); } while (type[c] == LET || type[c] == DIG); unget(); *bp = EOS; } int macroid(c) register int c; /* * If c is a letter, scan the id. if it's #defined, expand it and scan * the next character and try again. * * Else, return the character. If type[c] is a LET, the token is in token. */ { register DEFBUF *dp; if (infile != NULL && infile->fp != NULL) recursion = 0; while (type[c] == LET && (dp = lookid(c)) != NULL) { expand(dp); c = get(); } return (c); } int catenate() /* * A token was just read (via macroid). * If the next character is TOK_SEP, concatenate the next token * return TRUE -- which should recall macroid after refreshing * macroid's argument. If it is not TOK_SEP, unget() the character * and return FALSE. */ { register int c; register char *token1; #if OK_CONCAT if (get() != TOK_SEP) { /* Token concatenation */ unget(); return (FALSE); } else { token1 = savestring(token); /* Save first token */ c = macroid(get()); /* Scan next token */ switch(type[c]) { /* What was it? */ case LET: /* An identifier, ... */ if (strlen(token1) + strlen(token) >= NWORK) cfatal("work buffer overflow doing %s #", token1); sprintf(work, "%s%s", token1, token); break; case DIG: /* A digit string */ strcpy(work, token1); workp = work + strlen(work); do { save(c); } while ((c = get()) != TOK_SEP); /* * The trailing TOK_SEP is no longer needed. */ save(EOS); break; default: /* An error, ... */ #if ! COMMENT_INVISIBLE if (isprint(c)) cierror("Strange character '%c' after #", c); else cierror("Strange character (%d.) after #", c); #endif strcpy(work, token1); unget(); break; } /* * work has the concatenated token and token1 has * the first token (no longer needed). Unget the * new (concatenated) token after freeing token1. * Finally, setup to read the new token. */ free(token1); /* Free up memory */ ungetstring(work); /* Unget the new thing, */ return (TRUE); } #else return (FALSE); /* Not supported */ #endif } int scanstring(delim, outfun) register int delim; /* ' or " */ int (*outfun)(); /* Output function */ /* * Scan off a string. Warning if terminated by newline or EOF. * outfun() outputs the character -- to a buffer if in a macro. * TRUE if ok, FALSE if error. */ { register int c; instring = TRUE; /* Don't strip comments */ (*outfun)(delim); while ((c = get()) != delim && c != '\n' && c != EOF_CHAR) { if (c != DEF_MAGIC) (*outfun)(c); if (c == '\\') (*outfun)(get()); } instring = FALSE; if (c == delim) { (*outfun)(c); return (TRUE); } else { cerror("Unterminated string", NULLST); unget(); return (FALSE); } } scannumber(c, outfun) register int c; /* First char of number */ register int (*outfun)(); /* Output/store func */ /* * Process a number. We know that c is from 0 to 9 or dot. * Algorithm from Dave Conroy's Decus C. */ { register int radix; /* 8, 10, or 16 */ int expseen; /* 'e' seen in floater */ int signseen; /* '+' or '-' seen */ int octal89; /* For bad octal test */ int dotflag; /* TRUE if '.' was seen */ expseen = FALSE; /* No exponent seen yet */ signseen = TRUE; /* No +/- allowed yet */ octal89 = FALSE; /* No bad octal yet */ radix = 10; /* Assume decimal */ if ((dotflag = (c == '.')) != FALSE) { /* . something? */ (*outfun)('.'); /* Always out the dot */ if (type[(c = get())] != DIG) { /* If not a float numb, */ unget(); /* Rescan strange char */ return; /* All done for now */ } } /* End of float test */ else if (c == '0') { /* Octal or hex? */ (*outfun)(c); /* Stuff initial zero */ radix = 8; /* Assume it's octal */ c = get(); /* Look for an 'x' */ if (c == 'x' || c == 'X') { /* Did we get one? */ radix = 16; /* Remember new radix */ (*outfun)(c); /* Stuff the 'x' */ c = get(); /* Get next character */ } } for (;;) { /* Process curr. char. */ /* * Note that this algorithm accepts "012e4" and "03.4" * as legitimate floating-point numbers. */ if (radix != 16 && (c == 'e' || c == 'E')) { if (expseen) /* Already saw 'E'? */ break; /* Exit loop, bad nbr. */ expseen = TRUE; /* Set exponent seen */ signseen = FALSE; /* We can read '+' now */ radix = 10; /* Decimal exponent */ } else if (radix != 16 && c == '.') { if (dotflag) /* Saw dot already? */ break; /* Exit loop, two dots */ dotflag = TRUE; /* Remember the dot */ radix = 10; /* Decimal fraction */ } else if (c == '+' || c == '-') { /* 1.0e+10 */ if (signseen) /* Sign in wrong place? */ break; /* Exit loop, not nbr. */ /* signseen = TRUE; */ /* Remember we saw it */ } else { /* Check the digit */ switch (c) { case '8': case '9': /* Sometimes wrong */ octal89 = TRUE; /* Do check later */ case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': break; /* Always ok */ case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': if (radix == 16) /* Alpha's are ok only */ break; /* if reading hex. */ default: /* At number end */ goto done; /* Break from for loop */ } /* End of switch */ } /* End general case */ (*outfun)(c); /* Accept the character */ signseen = TRUE; /* Don't read sign now */ c = get(); /* Read another char */ } /* End of scan loop */ /* * When we break out of the scan loop, c contains the first * character (maybe) not in the number. If the number >is an * integer, allow a trailing 'L' for long and/or a trailing 'U' * for unsigned. If not those, push the trailing character back * on the input stream. Floating point numbers accept a trailing * 'L' for "long double". */ done: if (dotflag || expseen) { /* Floating point? */ if (c == 'l' || c == 'L') { (*outfun)(c); c = get(); /* Ungotten later */ } } else { /* Else it's an integer */ /* * We know that dotflag and expseen are both zero, now: * dotflag signals "saw 'L'", and * expseen signals "saw 'U'". */ for (;;) { switch (c) { case 'l': case 'L': if (dotflag) goto nomore; dotflag = TRUE; break; case 'u': case 'U': if (expseen) goto nomore; expseen = TRUE; break; default: goto nomore; } (*outfun)(c); /* Got 'L' or 'U'. */ c = get(); /* Look at next, too. */ } } nomore: unget(); /* Not part of a number */ if (octal89 && radix == 8) cwarn("Illegal digit in octal number", NULLST); } save(c) register int c; { if (workp >= &work[NWORK]) { work[NWORK-1] = '\0'; cfatal("Work buffer overflow: %s", work); } else *workp++ = c; } char * savestring(text) char *text; /* * Store a string into free memory. */ { register char *result; result = getmem(strlen(text) + 1); strcpy(result, text); return (result); } FILEINFO * getfile(bufsize, name) int bufsize; /* Line or define buffer size */ char *name; /* File or macro name string */ /* * Common FILEINFO buffer initialization for a new file or macro. */ { register FILEINFO *file; register int size; size = strlen(name); /* File/macro name */ file = (FILEINFO *) getmem(sizeof (FILEINFO) + bufsize + size); file->parent = infile; /* Chain files together */ file->fp = NULL; /* No file yet */ file->filename = savestring(name); /* Save file/macro name */ file->progname = NULL; /* No #line seen yet */ file->unrecur = 0; /* No macro fixup */ file->bptr = file->buffer; /* Initialize line ptr */ file->buffer[0] = EOS; /* Force first read */ file->line = 0; /* (Not used just yet) */ if (infile != NULL) /* If #include file */ infile->line = line; /* Save current line */ infile = file; /* New current file */ line = 1; /* Note first line */ return (file); /* All done. */ } char * getmem(size) int size; /* * Get a block of free memory. */ { register char *result; extern char *malloc(); if ((result = malloc((unsigned) size)) == NULL) cfatal("Out of memory", NULLST); return (result); } /* * C P P S y m b o l T a b l e s */ /* * SBSIZE defines the number of hash-table slots for the symbol table. * It must be a power of 2. */ #ifndef SBSIZE #define SBSIZE 64 #endif #define SBMASK (SBSIZE - 1) #if (SBSIZE ^ SBMASK) != ((SBSIZE * 2) - 1) << error, SBSIZE must be a power of 2 >> #endif static DEFBUF *symtab[SBSIZE]; /* Symbol table queue headers */ DEFBUF * lookid(c) int c; /* First character of token */ /* * Look for the next token in the symbol table. Returns token in "token". * If found, returns the table pointer; Else returns NULL. */ { register int nhash; register DEFBUF *dp; register char *np; int temp; int isrecurse; /* For #define foo foo */ np = token; nhash = 0; if ((isrecurse = (c == DEF_MAGIC))) /* If recursive macro */ c = get(); /* hack, skip DEF_MAGIC */ do { if (np < &token[IDMAX]) { /* token dim is IDMAX+1 */ *np++ = c; /* Store token byte */ nhash += c; /* Update hash value */ } c = get(); /* And get another byte */ } while (type[c] == LET || type[c] == DIG); unget(); /* Rescan terminator */ *np = EOS; /* Terminate token */ if (isrecurse) /* Recursive definition */ return (NULL); /* undefined just now */ nhash += (np - token); /* Fix hash value */ dp = symtab[nhash & SBMASK]; /* Starting bucket */ while (dp != (DEFBUF *) NULL) { /* Search symbol table */ if (dp->hash == nhash /* Fast precheck */ && (temp = strcmp(dp->name, token)) >= 0) break; dp = dp->link; /* Nope, try next one */ } return ((temp == 0) ? dp : NULL); } DEFBUF * defendel(name, delete) char *name; int delete; /* TRUE to delete a symbol */ /* * Enter this name in the lookup table (delete = FALSE) * or delete this name (delete = TRUE). * Returns a pointer to the define block (delete = FALSE) * Returns NULL if the symbol wasn't defined (delete = TRUE). */ { register DEFBUF *dp; register DEFBUF **prevp; register char *np; int nhash; int temp; int size; for (nhash = 0, np = name; *np != EOS;) nhash += *np++; size = (np - name); nhash += size; prevp = &symtab[nhash & SBMASK]; while ((dp = *prevp) != (DEFBUF *) NULL) { if (dp->hash == nhash && (temp = strcmp(dp->name, name)) >= 0) { if (temp > 0) dp = NULL; /* Not found */ else { *prevp = dp->link; /* Found, unlink and */ if (dp->repl != NULL) /* Free the replacement */ free(dp->repl); /* if any, and then */ free((char *) dp); /* Free the symbol */ } break; } prevp = &dp->link; } if (!delete) { dp = (DEFBUF *) getmem(sizeof (DEFBUF) + size); dp->link = *prevp; *prevp = dp; dp->hash = nhash; dp->repl = NULL; dp->nargs = 0; strcpy(dp->name, name); } return (dp); } #if DEBUG dumpdef(why) char *why; { register DEFBUF *dp; register DEFBUF **syp; printf("CPP symbol table dump %s\n", why); for (syp = symtab; syp < &symtab[SBSIZE]; syp++) { if ((dp = *syp) != (DEFBUF *) NULL) { printf("symtab[%d]\n", (syp - symtab)); do { dumpadef((char *) NULL, dp); } while ((dp = dp->link) != (DEFBUF *) NULL); } } } dumpadef(why, dp) char *why; /* Notation */ register DEFBUF *dp; { register char *cp; register int c; printf(" \"%s\" [%d]", dp->name, dp->nargs); if (why != NULL) printf(" (%s)", why); if (dp->repl != NULL) { printf(" => "); for (cp = dp->repl; (c = *cp++ & 0xFF) != EOS;) { if (c >= MAC_PARM && c <= (MAC_PARM + PAR_MAC)) printf("<%d>", c - MAC_PARM); else if (isprint(c) || c == '\n' || c == '\t') putchar(c); else if (c < ' ') printf("<^%c>", c + '@'); else printf("<\\0%o>", c); } } else { printf(", no replacement."); } putchar('\n'); } #endif /* * G E T */ int get() /* * Return the next character from a macro or the current file. * Handle end of file from #include files. */ { register int c; register FILEINFO *file; register int popped; /* Recursion fixup */ popped = 0; get_from_file: if ((file = infile) == NULL) return (EOF_CHAR); newline: #if 0 printf("get(%s), recursion %d, line %d, bptr = %d, buffer \"%s\"\n", file->filename, recursion, line, file->bptr - file->buffer, file->buffer); #endif /* * Read a character from the current input line or macro. * At EOS, either finish the current macro (freeing temp. * storage) or read another line from the current input file. * At EOF, exit the current file (#include) or, at EOF from * the cpp input file, return EOF_CHAR to finish processing. */ if ((c = *file->bptr++ & 0xFF) == EOS) { /* * Nothing in current line or macro. Get next line (if * input from a file), or do end of file/macro processing. * In the latter case, jump back to restart from the top. */ if (file->fp == NULL) { /* NULL if macro */ popped++; recursion -= file->unrecur; if (recursion < 0) recursion = 0; infile = file->parent; /* Unwind file chain */ } else { /* Else get from a file */ if ((file->bptr = fgets(file->buffer, NBUFF, file->fp)) != NULL) { #if DEBUG if (debug > 1) { /* Dump it to stdout */ printf("\n#line %d (%s), %s", line, file->filename, file->buffer); } #endif goto newline; /* process the line */ } else { fclose(file->fp); /* Close finished file */ if ((infile = file->parent) != NULL) { /* * There is an "ungotten" newline in the current * infile buffer (set there by doinclude() in * cpp1.c). Thus, we know that the mainline code * is skipping over blank lines and will do a * #line at its convenience. */ wrongline = TRUE; /* Need a #line now */ } } } /* * Free up space used by the (finished) file or macro and * restart input from the parent file/macro, if any. */ free(file->filename); /* Free name and */ if (file->progname != NULL) /* if a #line was seen, */ free(file->progname); /* free it, too. */ free((char *) file); /* Free file space */ if (infile == NULL) /* If at end of file */ return (EOF_CHAR); /* Return end of file */ line = infile->line; /* Reset line number */ goto get_from_file; /* Get from the top. */ } /* * Common processing for the new character. */ if (c == DEF_MAGIC && file->fp != NULL) /* Don't allow delete */ goto newline; /* from a file */ if (file->parent != NULL) { /* Macro or #include */ if (popped != 0) file->parent->unrecur += popped; else { recursion -= file->parent->unrecur; if (recursion < 0) recursion = 0; file->parent->unrecur = 0; } } if (c == '\n') /* Maintain current */ ++line; /* line counter */ if (instring) /* Strings just return */ return (c); /* the character. */ else if (c == '/') { /* Comment? */ instring = TRUE; /* So get() won't loop */ if ((c = get()) != '*') { /* Next byte '*'? */ instring = FALSE; /* Nope, no comment */ unget(); /* Push the char. back */ return ('/'); /* Return the slash */ } if (keepcomments) { /* If writing comments */ putchar('/'); /* Write out the */ putchar('*'); /* initializer */ } for (;;) { /* Eat a comment */ c = get(); test: if (keepcomments && c != EOF_CHAR) cput(c); switch (c) { case EOF_CHAR: cerror("EOF in comment", NULLST); return (EOF_CHAR); case '/': if ((c = get()) != '*') /* Don't let comments */ goto test; /* Nest. */ #ifdef STRICT_COMMENTS cwarn("Nested comments", NULLST); #endif /* Fall into * stuff */ case '*': if ((c = get()) != '/') /* If comment doesn't */ goto test; /* end, look at next */ instring = FALSE; /* End of comment, */ if (keepcomments) { /* Put out the comment */ cput(c); /* terminator, too */ } /* * A comment is syntactically "whitespace" -- * however, there are certain strange sequences * such as * #define foo(x) (something) * foo|* comment *|(123) * these are '/' ^ ^ * where just returning space (or COM_SEP) will cause * problems. This can be "fixed" by overwriting the * '/' in the input line buffer with ' ' (or COM_SEP) * but that may mess up an error message. * So, we peek ahead -- if the next character is * "whitespace" we just get another character, if not, * we modify the buffer. All in the name of purity. */ if (*file->bptr == '\n' || type[*file->bptr & 0xFF] == SPA) goto newline; #if COMMENT_INVISIBLE /* * Return magic (old-fashioned) syntactic space. */ return ((file->bptr[-1] = COM_SEP)); #else return ((file->bptr[-1] = ' ')); #endif case '\n': /* we'll need a #line */ if (!keepcomments) wrongline = TRUE; /* later... */ default: /* Anything else is */ break; /* Just a character */ } /* End switch */ } /* End comment loop */ } /* End if in comment */ else if (!inmacro && c == '\\') { /* If backslash, peek */ if ((c = get()) == '\n') { /* for a . If so, */ wrongline = TRUE; goto newline; } else { /* Backslash anything */ unget(); /* Get it later */ return ('\\'); /* Return the backslash */ } } else if (c == '\f' || c == VT) /* Form Feed, Vertical */ c = ' '; /* Tab are whitespace */ return (c); /* Just return the char */ } unget() /* * Backup the pointer to reread the last character. Fatal error * (code bug) if we backup too far. unget() may be called, * without problems, at end of file. Only one character may * be ungotten. If you need to unget more, call ungetstring(). */ { register FILEINFO *file; if ((file = infile) == NULL) return; /* Unget after EOF */ if (--file->bptr < file->buffer) cfatal("Too much pushback", NULLST); if (*file->bptr == '\n') /* Ungetting a newline? */ --line; /* Unget the line number, too */ } ungetstring(text) char *text; /* * Push a string back on the input stream. This is done by treating * the text as if it were a macro. */ { register FILEINFO *file; extern FILEINFO *getfile(); file = getfile(strlen(text) + 1, ""); strcpy(file->buffer, text); } int cget() /* * Get one character, absorb "funny space" after comments or * token concatenation */ { register int c; do { c = get(); #if COMMENT_INVISIBLE } while (c == TOK_SEP || c == COM_SEP); #else } while (c == TOK_SEP); #endif return (c); } /* * Error messages and other hacks. The first byte of severity * is 'S' for string arguments and 'I' for int arguments. This * is needed for portability with machines that have int's that * are shorter than char *'s. */ static domsg(severity, format, arg) char *severity; /* "Error", "Warning", "Fatal" */ char *format; /* Format for the error message */ char *arg; /* Something for the message */ /* * Print filenames, macro names, and line numbers for error messages. */ { register char *tp; register FILEINFO *file; fprintf(stderr, "%sline %d, %s: ", MSG_PREFIX, line, &severity[1]); if (*severity == 'S') fprintf(stderr, format, arg); else fprintf(stderr, format, (int) arg); putc('\n', stderr); if ((file = infile) == NULL) return; /* At end of file */ if (file->fp != NULL) { tp = file->buffer; /* Print current file */ fprintf(stderr, "%s", tp); /* name, making sure */ if (tp[strlen(tp) - 1] != '\n') /* there's a newline */ putc('\n', stderr); } while ((file = file->parent) != NULL) { /* Print #includes, too */ if (file->fp == NULL) fprintf(stderr, "from macro %s\n", file->filename); else { tp = file->buffer; fprintf(stderr, "from file %s, line %d:\n%s", (file->progname != NULL) ? file->progname : file->filename, file->line, tp); if (tp[strlen(tp) - 1] != '\n') putc('\n', stderr); } } } cerror(format, sarg) char *format; char *sarg; /* Single string argument */ /* * Print a normal error message, string argument. */ { domsg("SError", format, sarg); errors++; } cierror(format, narg) char *format; int narg; /* Single numeric argument */ /* * Print a normal error message, numeric argument. */ { domsg("IError", format, (char *) narg); errors++; } cfatal(format, sarg) char *format; char *sarg; /* Single string argument */ /* * A real disaster */ { domsg("SFatal error", format, sarg); exit(IO_ERROR); } cwarn(format, sarg) char *format; char *sarg; /* Single string argument */ /* * A non-fatal error, string argument. */ { domsg("SWarning", format, sarg); } ciwarn(format, narg) char *format; int narg; /* Single numeric argument */ /* * A non-fatal error, numeric argument. */ { domsg("IWarning", format, (char *) narg); } *[IMAKE.CPP.BUILD]CPP6.OBJ;1+,r./@ 4 -Z0123KPWO56 CËXc7!T_89G@HJ1CPP6V1.0 6-JAN-1993 14:37VAX C V3.2-044 PE PC P PCCA $P A -PB Xnu)j cv-_\Vex&X\H5PuJ~a/*Y%#'u nI*. ](Mc}I Ɔv64`ؓj5zחPjȮ%4}.(y, W a=}4aU 3(4Nܒ?ÄZ2* MG cۣ"z4+]>h[9(9w_iwOj%'By {ib} *+'x&!TS Xj]!lnƐٞ>b}]?Gk|MwX*-%zv&Te ?ԉf"%6Cdn $֦A3\xzؘ\iNumG oJ)s ~B{g@fgLaN159 v uJk0knm*+Ŀ٤s"] oNd;JYµ?@52}O=+e?!%"ܕƲ(;&9_jB-*|e :]F<8q=3@"a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[Goy]?b 8vfuI5=|$G9uP:}l&v&g4My@&)\g)c[zj L4sԏnr 1aAs#!In&)HHj ޒF-.VHEe'$ZlCEF[B /0Q皎ܛRToS  4/,i@g2 Ϯ0F)ȑ dx781š}t<(?\وf.s]M!o2/J!tg%_ /}GN)tSh3PwpozD":[+!i7wN]{('ٞˌJy,-"NM7?vIhWc_) 'Q6YG? @ z\eeyJ-e>·pV}no1u~w>^AM[N‚+ B7@N6-l=4+HG[,?0dTT6ւx`m#CkW~D")xvt5!|AN jWV_?qeQ0-X^{AVWE6mހ/OÇvO!\e%I d9VA 9YlPaBzη||C^XCM!yqoRov;%N-pۣ^JBLLJp.~bN.~DLc;Vu%:DHIn@̲…GhśЭo3Hae_-'[t=˶d'j:6o5[Q) R1,b@pw `+Ys{0iWW&^41o3usV4}{=JY-)>a 3tEz KQU @l]~doS  () /* * Append system-specific directories to the include dire  R'~ IMAKE.SAVrZMAKE.CPP.BUILD]CPP6.OBJ;1`CWARNUNGETGET%s"PSError)PIError0PSFatal error=PSWarningFPIWarningP^PGETP PP^ \GET@lC ^W T VЬSS GETPSdRPRPSGETPSCfCfU2eSeSP~P0 ,EXIT b^ TЬSR բCd5SLOOKIDPR'REXPANDGETPSCdSLOOKIDPRSP4^UYV[ ZGETP>T2dRdRS~S0 ,EXIT Pj,ݮ,STRLENPWWMALLOCPTŰS~S0ϴ ,EXITT\ݮ,\STRCPY\RGETPMACROIDP\L SSUS1RSTRLENPSjSTRLENPSSeTRT0@ ,EXITjRߥ fSPRINTF11RfSTRCPYfSfSTRLENSP\TiSPSP$ŖQfQ0 ,EXIT PSQSiTaGETP\\XiWSWS$ŖTfT0ϖ ,EXIT1PWSWiXc1Pˏ\SCShSޥ%T\T)P kޥDT\T); kRfSTRCPY\2lSlST~T0 ,EXIT RFREEf UNGETSTRINGP<^UЬS S޼RbGETPRRSHR CR?GETTR R޼P`R\ dP޼P`dPRRS R R RS R޼ScPޥdS~S"< T2dRdRS~S0 ,EXIT P^Y[ЬRЬSWXZ TPR.PPVQ.cGETPRB sU.ePePQ~Q0φ ,EXIT葵 kR06RcTGETPRRx RXTRcGETPRT$Re REW1W T1PTR.V1V T1PR+R- X11R01RPP0P ?PPaGPa P1?PZ PTRcXGETPR1PVW$Rl RL1RcGET1RL1RPPL P Pb?PPlWPl P92?PV,VPW WPPRcGETPR1jPU.eReRS~S0^,EXITՑ kZTީxS~S=3P^TSRPRP ĖQcQ0,EXITRQRa<^UݬSTRLENPTTMALLOCPSŰP~P0Ϣ,EXITSRRSTRCPYRP ^UXݬSTRLENVPVVMALLOCPTŰS~S0?,EXITTSh ԣЬWWSTRLENPVVMALLOCPTŰP~P0,EXITTRWRSTRCPYR|cԣhRShSP ^SݬMALLOCPRðQ~Q0ϋ,EXITRPP ^Z W XgSTRѬRR[ GETPURSReeTGETPePRBhޑBhV2fRfRU~U0,EXIT c[PgPPSPPTˏTUERѢTgSTRCMPPYbRYSRSSP^WUЬP` PRRU`ìPXXUˏUQARbSIѣU:ݬSTRCMPP)S+Pcbգ ݣFREESFREE PcRbSլMXVVMALLOCPTǰQ~Q0,EXITTSbcSbUԣԣ ݬSTRCPYSPP^VWZY [XTRPb\bl\\2\S1բT¢jjТ 3ݢ<~FGETSPbݢFCLOSEТ  ݢFREEբ ݢFREERFREEP\Ь1TPSբ1PТ PT TP jjТ \ԬS kSPS/1nkGETP*AkU2e\e\P~P0G,EXIT /Pgh/FPUTCh*FPUTCGETP\g\\ h\FPUTC\\PP  P PB?PP*P* P"?PCFATALSTRLENSTRLENCFATALMALLOCSTRCMPUNGETGETFREESTRCMPCERRORUNGETFREECFATALSTRLENGETFILESTRLENEXIT SKIPNL SKIPWS 8SCANID MACROID ,CATENATE < SCANSTRING  SCANNUMBER TSAVE < SAVESTRING GETFILE  GETMEM  LOOKID DEFENDEL GET UNGETƾQ~Q"ϒiPGETP\\*1qGETP\\/1_kg\ h\FPUTC琲\\ 1\\\2\\L C1b\ Pg1 1P `S\WGETP   1~U2eReRT~T0,EXIT ᚏ\PS S  SSPP ^SRb\b\P~P0b,EXIT ^RݬSTRLENPPGETFILEݬSTRCPY^PGETPP^UWЬRgFPRINTFScbSݬ ݬgc ݬ ݬgcg FPUTCRբ/SSgFPRINTFSSTRLENP@c  g FPUTCТ RcFPRINTFVPբݢgf@TTݢТPPSТSSgfTSTRLENP@d  g FPUTCТ RP^Rݬݬ"P^Rݬݬ)ϹP^Rݬݬ0ϕ,EXITP^Rݬݬ=m^RݬݬFQ P@. PCP77777777+ 8 UNGETSTRING  lCGET CERROR CIERROR CFATAL CWARN CIWARN4$CODE$DATASTDINSTDOUTSTDERR_CTYPE_ERRNO VAXC$ERRNOLINE WRONGLINETYPE TOKENINSTRINGINMACROERRORS RECURSION IFSTACKIFPTRINCDIRINCENDCFLAGEFLAGNFLAG REC_RECOVERPRESETMAGICINFILEWORKWORKP KEEPCOMMENTS SIZE_TABLEO$CHAR_STRING_CONSTANTSaPQiiiiiiii]PPddddddddaannnnnnniiiiii*[IMAKE.CPP.BUILD]CPPDEF.H;1+,r ./@ 4-Z0123KPWO564 7[_89G@HJ/* * S y s t e m D e p e n d e n t * D e f i n i t i o n s f o r C P P * * Definitions in this file may be edited to configure CPP for particular * host operating systems and target configurations. * * NOTE: cpp assumes it is compiled by a compiler that supports macros * with arguments. If this is not the case (as for Decus C), #define * nomacarg -- and provide function equivalents for all macros. * * cpp also assumes the host and target implement the Ascii character set. * If this is not the case, you will have to do some editing here and there. */ /* * This redundant definition of TRUE and FALSE works around * a limitation of Decus C. */ #ifndef TRUE #define TRUE 1 #define FALSE 0 #endif /* * Define the HOST operating system. This is needed so that * cpp can use appropriate filename conventions. */ #define SYS_UNKNOWN 0 #define SYS_UNIX 1 #define SYS_VMS 2 #define SYS_RSX 3 #define SYS_RT11 4 #define SYS_LATTICE 5 #define SYS_ONYX 6 #define SYS_68000 7 #ifndef HOST #ifdef unix #define HOST SYS_UNIX #else #ifdef vms #define HOST SYS_VMS #else #ifdef rsx #define HOST SYS_RSX #else #ifdef rt11 #define HOST SYS_RT11 #endif #endif #endif #endif #endif #ifndef HOST #define HOST SYS_UNKNOWN #endif /* * We assume that the target is the same as the host system */ #ifndef TARGET #define TARGET HOST #endif /* * In order to predefine machine-dependent constants, * several strings are defined here: * * MACHINE defines the target cpu (by name) * SYSTEM defines the target operating system * COMPILER defines the target compiler * * The above may be #defined as "" if they are not wanted. * They should not be #defined as NULL. * * LINE_PREFIX defines the # output line prefix, if not "line" * This should be defined as "" if cpp is to replace * the "standard" C pre-processor. * * FILE_LOCAL marks functions which are referenced only in the * file they reside. Some C compilers allow these * to be marked "static" even though they are referenced * by "extern" statements elsewhere. * * OK_DOLLAR Should be set TRUE if $ is a valid alphabetic character * in identifiers (default), or zero if $ is invalid. * Default is TRUE. * * OK_CONCAT Should be set TRUE if # may be used to concatenate * tokens in macros (per the Ansi Draft Standard) or * FALSE for old-style # processing (needed if cpp is * to process assembler source code). * * OK_DATE Predefines the compilation date if set TRUE. * Not permitted by the Nov. 12, 1984 Draft Standard. * * S_CHAR etc. Define the sizeof the basic TARGET machine word types. * By default, sizes are set to the values for the HOST * computer. If this is inappropriate, see the code in * cpp3.c for details on what to change. Also, if you * have a machine where sizeof (signed int) differs from * sizeof (unsigned int), you will have to edit code and * tables in cpp3.c (and extend the -S option definition.) * * CPP_LIBRARY May be defined if you have a site-specific include directory * which is to be searched *before* the operating-system * specific directories. */ #if TARGET == SYS_LATTICE /* * We assume the operating system is pcdos for the IBM-PC. * We also assume the small model (just like the PDP-11) */ #define MACHINE "i8086" #define SYSTEM "pcdos" #endif #if TARGET == SYS_ONYX #define MACHINE "z8000" #define SYSTEM "unix" #endif #if TARGET == SYS_VMS #define MACHINE "vax" #define SYSTEM "vms" #define COMPILER "vax11c" #endif #if TARGET == SYS_RSX #define MACHINE "pdp11" #define SYSTEM "rsx" #define COMPILER "decus" #endif #if TARGET == SYS_RT11 #define MACHINE "pdp11" #define SYSTEM "rt11" #define COMPILER "decus" #endif #if TARGET == SYS_68000 || defined(M68000) || defined(m68000) || defined(m68k) /* * All three machine designators have been seen in various systems. * Warning -- compilers differ as to sizeof (int). cpp3 assumes that * sizeof (int) == 2 */ #define MACHINE "M68000", "m68000", "m68k" #define SYSTEM "unix" #endif #if TARGET == SYS_UNIX #define SYSTEM "unix" #ifdef pdp11 #define MACHINE "pdp11" #endif #ifdef vax #define MACHINE "vax" #endif #endif /* * defaults */ #ifndef MSG_PREFIX #define MSG_PREFIX "cpp: " #endif #ifndef LINE_PREFIX #define LINE_PREFIX "" #endif /* * OLD_PREPROCESSOR forces the definition of OK_DOLLAR, OK_CONCAT, * COMMENT_INVISIBLE, and STRING_FORMAL to values appropriate for * an old-style preprocessor. */ #ifndef OLD_PREPROCESSOR #define OLD_PREPROCESSOR FALSE #endif #if OLD_PREPROCESSOR #define OK_DOLLAR FALSE #define OK_CONCAT TRUE #define COMMENT_INVISIBLE TRUE #define STRING_FORMAL TRUE #define IDMAX 63 /* actually, seems to be unlimited */ #endif /* * RECURSION_LIMIT may be set to -1 to disable the macro recursion test. */ #ifndef RECURSION_LIMIT #define RECURSION_LIMIT 1000 #endif /* * BITS_CHAR may be defined to set the number of bits per character. * it is needed only for multi-byte character constants. */ #ifndef BITS_CHAR #define BITS_CHAR 8 #endif /* * BIG_ENDIAN is set TRUE on machines (such as the IBM 360 series) * where 'ab' stores 'a' in the high-bits and 'b' in the low-bits. * It is set FALSE on machines (such as the PDP-11 and Vax-11) * where 'ab' stores 'a' in the low-bits and 'b' in the high-bits. * (Or is it the other way around?) -- Warning: BIG_ENDIAN code is untested. */ #ifndef BIG_ENDIAN #define BIG_ENDIAN FALSE #endif /* * COMMENT_INVISIBLE may be defined to allow "old-style" comment * processing, whereby the comment becomes a zero-length token * delimiter. This permitted tokens to be concatenated in macro * expansions. This was removed from the Draft Ansi Standard. */ #ifndef COMMENT_INVISIBLE #define COMMENT_INVISIBLE FALSE #endif /* * STRING_FORMAL may be defined to allow recognition of macro parameters * anywhere in replacement strings. This was removed from the Draft Ansi * Standard and a limited recognition capability added. */ #ifndef STRING_FORMAL #define STRING_FORMAL FALSE #endif /* * OK_DOLLAR enables use of $ as a valid "letter" in identifiers. * This is a permitted extension to the Ansi Standard and is required * for e.g., VMS, RSX-11M, etc. It should be set FALSE if cpp is * used to preprocess assembler source on Unix systems. OLD_PREPROCESSOR * sets OK_DOLLAR FALSE for that reason. */ #ifndef OK_DOLLAR #define OK_DOLLAR TRUE #endif /* * OK_CONCAT enables (one possible implementation of) token concatenation. * If cpp is used to preprocess Unix assembler source, this should be * set FALSE as the concatenation character, #, is used by the assembler. */ #ifndef OK_CONCAT #define OK_CONCAT TRUE #endif /* * OK_DATE may be enabled to predefine today's date as a string * at the start of each compilation. This is apparently not permitted * by the Draft Ansi Standard. */ #ifndef OK_DATE #define OK_DATE TRUE #endif /* * Some common definitions. */ #ifndef DEBUG #define DEBUG FALSE #endif /* * The following definitions are used to allocate memory for * work buffers. In general, they should not be modified * by implementors. * * PAR_MAC The maximum number of #define parameters (31 per Standard) * Note: we need another one for strings. * IDMAX The longest identifier, 31 per Ansi Standard * NBUFF Input buffer size * NWORK Work buffer size -- the longest macro * must fit here after expansion. * NEXP The nesting depth of #if expressions * NINCLUDE The number of directories that may be specified * on a per-system basis, or by the -I option. * BLK_NEST The number of nested #if's permitted. */ #ifndef IDMAX #define IDMAX 31 #endif #define PAR_MAC (31 + 1) #define NBUFF 4096 #define NWORK 4096 #define NEXP 128 #define NINCLUDE 7 #define NPARMWORK (NWORK * 2) #define BLK_NEST 32 /* * Some special constants. These may need to be changed if cpp * is ported to a wierd machine. * * NOTE: if cpp is run on a non-ascii machine, ALERT and VT may * need to be changed. They are used to implement the proposed * ANSI standard C control characters '\a' and '\v' only. * DEL is used to tag macro tokens to prevent #define foo foo * from looping. Note that we don't try to prevent more elaborate * #define loops from occurring. */ #ifndef ALERT #define ALERT '\007' /* '\a' is "Bell" */ #endif #ifndef VT #define VT '\013' /* Vertical Tab CTRL/K */ #endif #ifndef FILE_LOCAL #ifdef decus #define FILE_LOCAL static #else #ifdef vax11c #define FILE_LOCAL static #else #define FILE_LOCAL /* Others are global */ #endif #endif #endif r*[IMAKE.CPP.BUILD]MAKEFILE.BAK;1+,r./@ 4-Z0123KPWO56@x7c7d_89G@HJ# Makefile generated by imake - do not edit! # $XConsortium: imake.c,v 1.51 89/12/12 12:37:30 jim Exp $ # # The cpp used on this machine replaces all newlines and multiple tabs and # spaces in a macro expansion with a single space. Imake tries to compensate # for this, but is not always successful. # EXTRA_INCLUDES = IRULESRC = imake$binary: IMAKE = $(IMAKESRC)imake DEPEND = $(DEPENDSRC)makedepend MAKEINCLUDE = $(UTILSRC)makeinclude LINKLIB = BLISS = BLISSX ! Make BLISS really be BLISS SET = SET MACRO = MACRO MESSAGE = MESSAGE SDL = SDL LIBRARY = LIBRARY LIBR = LIBRARY LINK = LINK SHELL = write sys$output "Shell not available on VMS." OBJ = obj LIB = olb EXE = .exe TOP = 'f$extract(0,f$locate("[",f$parse("")),f$parse("")))'[000000] CURRENT_DIR = 'f$extract(0,f$length(f$parse(""))-2,f$parse(""))' AR = library BOOTSTRAPCFLAGS = CC = cc COMPRESS = write sys$output "Compress not available on VMS." CPP = cpp $(STD_CPP_DEFINES) PREPROCESSCMD = cpp $(STD_CPP_DEFINES) INSTALL = copy/log LD = link LINT = cc/standard=portable/noobj/list LINTLIBFLAG = LINTOPTS = LN = copy/noconf/log MAKE = mms/descrip=Makefile MV = rename/noconf/log CP = copy/noconf/log RANLIB = write sys$output "Ranlib not necessary!" RANLIBINSTFLAGS = RM = delete/noconf/log STD_INCLUDES = STD_CPP_DEFINES = STD_DEFINES = EXTRA_LIBRARIES = TAGS = write sys$output "Tags not available on VMS." SHAREDCODEDEF = SHLIBDEF = SIGNAL_DEFINES = /DEFINE=(SIGNALRETURNSINT) PROTO_DEFINES = INSTPGMFLAGS = INSTBINFLAGS = /prot=(o:rewd,g:re,w:re) INSTUIDFLAGS = /prot=(o:rewd,g:re,w:re) INSTLIBFLAGS = /prot=(o:rwed,g:r,w:r) INSTINCFLAGS = /prot=(o:r,g:r,w:r) INSTMANFLAGS = /prot=(o:r,g:r,w:r) INSTDATFLAGS = /prot=(o:r,g:r,w:r) INSTKMEMFLAGS = /prot=(o:rewd,g:re,w:re) DESTDIR = LDOPTIONS = CCOPTIONS = LINTFLAGS = $(LINTOPTS) $(ALLDEFINES)/DEFINE=(LINT) LDLIBS = $(SYS_LIBRARIES) $(EXTRA_LIBRARIES) LDCOMBINEFLAGS = MACROFILE = "vms.cf" RM_CMD = $(RM) *.obj;*,*.map;*,*.lis;*,*.exe;*,*.tmp;*,*.olb;*,*.ana;* CONFIGSRC = imake$binary: UTILSRC = imake$binary: DEPENDSRC = imake$binary: IMAKESRC = imake$binary: MOTIF = MotifRoot IMAKE_DEFINES = IMAKE_CMD = $(IMAKE) $(IMAKE_DEFINES) ICONFIGFILES = $(IRULESRC)/Imake.tmpl $(IRULESRC)/Imake.rules $(IRULESRC)/Project.tmpl $(IRULESRC)/site.def $(IRULESRC)/$(MACROFILE) $(EXTRA_ICONFIGFILES) COMPONENT = cpp OPT = .OPT OPTIONFILE = $(COMPONENT)$(OPT) VMSOPTIONLINK = , $(OPTIONFILE)/opt CDEBUGFLAGS = /debug/nooptimize INCLUDES = sys$disk:[], sys$library: DEFINES = $(STRINGDEFS) $(STYLE) SRCS = cpp1.c cpp2.c cpp3.c cpp4.c cpp5.c cpp6.c OBJS = cpp1.$(OBJ) , cpp2.$(OBJ) , cpp3.$(OBJ) , cpp4.$(OBJ) , cpp5.$(OBJ) , cpp6.$(OBJ) $(COMPONENT)$(EXE) : $(OBJS) $(OPTIONFILE) imaketmp:=$@ - if f$search(f$parse(imaketmp)) .nes. "" then $(RM) 'f$parse(imaketmp)' $(LINK) /exe='f$parse("$@")' $(LDOPTIONS)\ $(EXTRA_LOAD_FLAGS) $(OBJS) \ $(VMSOPTIONLINK) $(RM) $(OPTIONFILE); map :: $(LINK) /exe=_NL:/map=$(COMPONENT).map/full $(LDOPTIONS)\ $(EXTRA_LOAD_FLAGS) $(OBJS) \ $(VMSOPTIONLINK) clean :: imaketmp:=$(COMPONENT)$(EXE) - if f$search(f$parse(imaketmp)) .nes. "" then $(RM) 'f$parse(imaketmp)' $(COMPONENT)$(OPT) :: vmsoptfile linkoptions !Created 1 Options file - $(COMPONENT).opt vmsoptfile :: imaketmp := $(COMPONENT).opt copy/nolog _NL: 'imaketmp' linkoptions :: optfile :== $(COMPONENT).opt open/append optfd 'optfile' write optfd "! Created by cpp.imakefile" close optfd linkoptions :: optfile :== $(COMPONENT).opt open/append optfd 'optfile' write optfd "sys$library:vaxcrtl.exe/share" close optfd depend :: firstdepend regdepend imaketmp:=$(COMPONENT)_depend.tmp $(DEPEND) -- $(ALLDEFINES) -- -1 'imaketmp' $(RM) 'imaketmp';* firstdepend :: imaketmp:=$(COMPONENT)_depend.tmp copy/nolog _NL: 'imaketmp' regdepend :: $(SRCS) imaketmp:=$(COMPONENT)_depend.tmp open/append dep_file 'imaketmp' imaketmpsrcs := $(SRCS) write dep_file "''f$edit(imaketmpsrcs,"lowercase")'" close dep_file Makefile :: $(COMPONENT).imakefile - if f$search(f$parse("Makefile.bak")) .nes. "" then $(RM) 'f$parse("Makefile.bak;*")' - if f$sear  ch(f$parse("Makefile.mms")) .nes. "" then $(MV) Makefile.mms; Makefile.bak $(IMAKE_CMD) -f $(COMPONENT).imakefile "/cms" - purge/noconf/nolog makefile.mms env :: define/job/nolog c$include $(INCLUDES) env :: define/job/nolog vaxc$include $(INCLUDES) env :: define/job/nolog sys sys$library: Install :: $(INSTALL) $(INSTBINFLAGS) $(COMPONENT).exe imake$bin:*.*; TOP_INCLUDES = ALLINCLUDES = $(INCLUDES) $(STD_INCLUDES) $(TOP_INCLUDES) $(EXTRA_INCLUDES) ALLDEFINES = $(STD_DEFINES) $(PROTO_DEFINES) $(DEFINES) $(COMPATFLAGS) CFLAGS = $(CCOPTIONS) $(CDEBUGFLAGS) $(ALLDEFINES) UIL_INCLUDES = $(CURRENT_DIR),ccrb:[$(COMPONENT)],ccr$:[ccr.uigen],decw$include:,sys$library: UIL = UIL/MOTIF emptyrule :: .suffixes .uid .uil .uil~ .uigl .uigl~ .sdl .sdl~ .msg .msg~ .opt .opt~ .com .com~ .dat .dat~ .lex .lex~ .idl .idl~ .imakefile .imakefile~ .sql .sql~ .sh .sh~ .til .til~ .hlb .hlp .hlp~ .man .man~ .rnh .rnh~ .col .col~ .cohesion_depends .cohesion_depends~ .crl .crl~ .cohesion_functions .cohesion_functions~ .uil~.uil ! fetch rule for UIL source file $(CMS) FETCH $(MMS$SOURCE) $(CMSFLAGS) "" .opt~.opt ! fetch rule for LINK options file $(CMS) FETCH $(MMS$SOURCE) $(CMSFLAGS) "" .com~.com ! fetch rule for DCL command procedure $(CMS) FETCH $(MMS$SOURCE) $(CMSFLAGS) "" .dat~.dat ! fetch rule for DECwindows resource default $(CMS) FETCH $(MMS$SOURCE) $(CMSFLAGS) "" .lex~.lex ! fetch rule for LEX source file $(CMS) FETCH $(MMS$SOURCE) $(CMSFLAGS) "" .man~.man ! fetch rule for U*IX help file $(CMS) FETCH $(MMS$SOURCE) $(CMSFLAGS) "" .imakefile~.imakefile ! fetch rule for IMAKE source file $(CMS) FETCH $(MMS$SOURCE) $(CMSFLAGS) "" .uigl~.uigl ! fetch rule for UIGEN source file $(CMS) FETCH $(MMS$SOURCE) $(CMSFLAGS) "" .sql~.sql ! fetch rule for SQL source file $(CMS) FETCH $(MMS$SOURCE) $(CMSFLAGS) "" .idl~.idl ! fetch rule for NIDL source file $(CMS) FETCH $(MMS$SOURCE) $(CMSFLAGS) "" .sh~.sh ! fetch rule for SHELL scripts $(CMS) FETCH $(MMS$SOURCE) $(CMSFLAGS) "" .hlp~.hlp ! fetch rule for Help files $(CMS) FETCH $(MMS$SOURCE) $(CMSFLAGS) "" .sdl~.sdl ! fetch rule for SDL source file $(CMS) FETCH $(MMS$SOURCE) $(CMSFLAGS) "" .col~.col ! fetch rule for COL source file $(CMS) FETCH $(MMS$SOURCE) $(CMSFLAGS) "" .crl~.crl ! fetch rule for CRL source file $(CMS) FETCH $(MMS$SOURCE) $(CMSFLAGS) "" .rnh~.rnh ! fetch rule for RUNOFF source file $(CMS) FETCH $(MMS$SOURCE) $(CMSFLAGS) "" .msg~.msg ! fetch rule for MESSAGE source file $(CMS) FETCH $(MMS$SOURCE) $(CMSFLAGS) "" Makefiles :: clean :: $(RM_CMD) includes :: ! Includes build completed. depend :: ! Depend build completed. fetch :: ! Fetch build completed. firstdepend :: ! Firstdepend build completed. regdepend :: ! Regdepend build completed. map :: ! Map build completed. *[IMAKE.CPP.BUILD]MAKEFILE.INI;1+,r./@ 4M-Z0123KPWO56)a7l_89G@HJ#M# WARNING WARNING WARNING WARNING WARNING WARNING WARNING#L# This is NOT an automatically generated Makefile! It is hand-crafted as a L# bootstrap, may need editing for your system. The BOOTSTRAPCFLAGS variableJ# may be given at the top of the build tree for systems that do not define,# any machine-specific preprocessor symbols.#9# This is the VMS bootstrap MMS file for building CPP.EXE# OBJ = objSEP = ,CFLAGS = /nodebug/optimizeRM = delete/log LINK = LINKAOBJS = cpp1.$(OBJ) $(SEP) cpp2.$(OBJ) $(SEP) cpp3.$(OBJ) $(SEP) \9 cpp4.$(OBJ) $(SEP) cpp5.$(OBJ) $(SEP) cpp6.$(OBJ) &imake : Build_logicals cpp.opt cpp.exe !done# # cpp.exe#cpp.exe : $(OBJS)8 $(LINK)/exe='f$parse("$@")' $(OBJS), cpp.opt/opt cpp.opt : optfile :== cpp.opt open/write optfd 'optfile'7 write optfd "!options file created by makefile.ini"/ write optfd "sys$library:vaxcrtl.exe/share" close optfdBuild_logicals :6 define/job c$include sys$disk:[], sys$library:) define/job vaxc$include c$include# define/job sys sys$library:*[IMAKE.CPP.BUILD]MAKEFILE.MMS;1+,r./@ 4-Z0123KPWO56a2Xc7-t_89G@HJ# Makefile generated by imake - do not edit! # $XConsortium: imake.c,v 1.51 89/12/12 12:37:30 jim Exp $ # # The cpp used on this machine replaces all newlines and multiple tabs and # spaces in a macro expansion with a single space. Imake tries to compensate # for this, but is not always successful. # EXTRA_INCLUDES = IRULESRC = imake$binary: IMAKE = $(IMAKESRC)imake DEPEND = $(DEPENDSRC)makedepend MAKEINCLUDE = $(UTILSRC)makeinclude LINKLIB = BLISS = BLISSX ! Make BLISS really be BLISS SET = SET MACRO = MACRO MESSAGE = MESSAGE SDL = SDL LIBRARY = LIBRARY LIBR = LIBRARY LINK = LINK SHELL = write sys$output "Shell not available on VMS." OBJ = obj LIB = olb OPT = .opt EXE = .exe TOP = 'f$extract(0,f$locate("[",f$parse("")),f$parse("")))'[000000] CURRENT_DIR = 'f$extract(0,f$length(f$parse(""))-2,f$parse(""))' AR = library BOOTSTRAPCFLAGS = CC = cc COMPRESS = write sys$output "Compress not available on VMS." CPP = cpp $(STD_CPP_DEFINES) PREPROCESSCMD = cpp $(STD_CPP_DEFINES) INSTALL = copy/log LD = link LINT = cc/standard=portable/noobj/list LINTLIBFLAG = LINTOPTS = LN = copy/noconf/log MAKE = mms/descrip=Makefile MV = rename/noconf/log CP = copy/noconf/log RANLIB = write sys$output "Ranlib not necessary!" RANLIBINSTFLAGS = RM = delete/noconf/log STD_INCLUDES = STD_CPP_DEFINES = STD_DEFINES = EXTRA_LIBRARIES = TAGS = write sys$output "Tags not available on VMS." SHAREDCODEDEF = SHLIBDEF = SIGNAL_DEFINES = /DEFINE=(SIGNALRETURNSINT) PROTO_DEFINES = INSTPGMFLAGS = INSTBINFLAGS = /prot=(o:rewd,g:re,w:re) INSTUIDFLAGS = /prot=(o:rewd,g:re,w:re) INSTLIBFLAGS = /prot=(o:rwed,g:r,w:r) INSTINCFLAGS = /prot=(o:r,g:r,w:r) INSTMANFLAGS = /prot=(o:r,g:r,w:r) INSTDATFLAGS = /prot=(o:r,g:r,w:r) INSTKMEMFLAGS = /prot=(o:rewd,g:re,w:re) DESTDIR = LDOPTIONS = CCOPTIONS = LINTFLAGS = $(LINTOPTS) $(ALLDEFINES)/DEFINE=(LINT) LDLIBS = $(SYS_LIBRARIES) $(EXTRA_LIBRARIES) LDCOMBINEFLAGS = MACROFILE = "vms.cf" RM_CMD = $(RM) *.obj;*,*.map;*,*.lis;*,*.exe;*,*.tmp;*,*.olb;*,*.ana;*,*.opt;* CONFIGSRC = imake$binary: UTILSRC = imake$binary: DEPENDSRC = imake$binary: IMAKESRC = imake$binary: MOTIF = MotifRoot IMAKE_DEFINES = IMAKE_CMD = $(IMAKE) $(IMAKE_DEFINES) ICONFIGFILES = $(IRULESRC)/Imake.tmpl $(IRULESRC)/Imake.rules $(IRULESRC)/Project.tmpl $(IRULESRC)/site.def $(IRULESRC)/$(MACROFILE) $(EXTRA_ICONFIGFILES) COMPONENT = cpp OPTIONFILE = $(COMPONENT)$(OPT) VMSOPTIONLINK = , $(OPTIONFILE)/opt CDEBUGFLAGS = /nodebug/optimize INCLUDES = sys$disk:[], sys$library: DEFINES = $(STRINGDEFS) $(STYLE) SRCS = cpp1.c cpp2.c cpp3.c cpp4.c cpp5.c cpp6.c OBJS = cpp1.$(OBJ) , cpp2.$(OBJ) , cpp3.$(OBJ) , cpp4.$(OBJ) , cpp5.$(OBJ) , cpp6.$(OBJ) $(COMPONENT)$(EXE) : $(OBJS) $(OPTIONFILE) @- imaketmp := $(OPTIONFILE) @- if imaketmp .NES. "" then - if f$search(f$parse(imaketmp)) .eqs. "" then - write sys$output "WARNING!!! First Type: Make opt" @- imaketmp:=$@ @- if f$search(f$parse(imaketmp)) .nes. "" then $(RM) 'f$parse(imaketmp)' $(LINK) /exe='f$parse("$@")' $(LDOPTIONS)\ $(EXTRA_LOAD_FLAGS) $(OBJS) \ $(VMSOPTIONLINK) map :: $(LINK) /exe=_NL:/map=$(COMPONENT).map/full $(LDOPTIONS)\ $(EXTRA_LOAD_FLAGS) $(OBJS) \ $(VMSOPTIONLINK) clean :: @- imaketmp:=$(COMPONENT)$(EXE) @- if f$search(f$parse(imaketmp)) .nes. "" then $(RM) 'f$parse(imaketmp)' opt :: vmsoptfile linkoptions @- write sys$output "Created VMS Options file - program.opt" vmsoptfile :: @- imaketmp := $(COMPONENT).opt @- copy/nolog/overlay _NL: 'imaketmp' linkoptions :: @- optfile :== $(COMPONENT).opt @- open/append optfd 'optfile' @- write optfd "! Created by cpp.imakefile" @- close optfd linkoptions :: @- optfile :== $(COMPONENT).opt @- open/append optfd 'optfile' @- write optfd "sys$library:vaxcrtl.exe/share" @- close optfd depend :: firstdepend regdepend imaketmp:=$(COMPONENT)_depend.tmp $(DEPEND) -- $(ALLDEFINES) -- -1 'imaketmp' $(RM) 'imaketmp';* firstdepend :: imaketmp:=$(COMPONENT)_depend.tmp copy/nolog _NL: 'imaketmp' regdepend :: $(SRCS) imaketmp:=$(COMPONENT)_depend.tmp open/append dep_file 'imaketmp' imaketmpsrcs := $(SRCS) write de  p_file "''f$edit(imaketmpsrcs,"lowercase")'" close dep_file Makefile :: $(COMPONENT).imakefile @- if f$search(f$parse("Makefile.bak")) .nes. "" then $(RM) 'f$parse("Makefile.bak;*")' @- if f$search(f$parse("Makefile.mms")) .nes. "" then $(MV) Makefile.mms; Makefile.bak $(IMAKE_CMD) -f $(COMPONENT).imakefile "/cms" @- purge/noconf/nolog makefile.mms env :: define/job/nolog c$include $(INCLUDES) env :: define/job/nolog vaxc$include $(INCLUDES) env :: define/job/nolog sys sys$library: Install :: $(INSTALL) $(INSTBINFLAGS) $(COMPONENT).exe imake$bin:*.*; TOP_INCLUDES = ALLINCLUDES = $(INCLUDES) $(STD_INCLUDES) $(TOP_INCLUDES) $(EXTRA_INCLUDES) ALLDEFINES = $(STD_DEFINES) $(PROTO_DEFINES) $(DEFINES) $(COMPATFLAGS) CFLAGS = $(CCOPTIONS) $(CDEBUGFLAGS) $(ALLDEFINES) UIL_INCLUDES = $(CURRENT_DIR),ccrb:[$(COMPONENT)],ccr$:[ccr.uigen],decw$include:,sys$library: UIL = UIL/MOTIF emptyrule :: .suffixes .uid .uil .uil~ .uigl .uigl~ .sdl .sdl~ .msg .msg~ .opt .opt~ .com .com~ .dat .dat~ .lex .lex~ .idl .idl~ .imakefile .imakefile~ .sql .sql~ .sh .sh~ .til .til~ .hlb .hlp .hlp~ .man .man~ .rnh .rnh~ .col .col~ .cohesion_depends .cohesion_depends~ .crl .crl~ .cohesion_functions .cohesion_functions~ .uil~.uil ! fetch rule for UIL source file $(CMS) FETCH $(MMS$SOURCE) $(CMSFLAGS) "" .opt~.opt ! fetch rule for LINK options file $(CMS) FETCH $(MMS$SOURCE) $(CMSFLAGS) "" .com~.com ! fetch rule for DCL command procedure $(CMS) FETCH $(MMS$SOURCE) $(CMSFLAGS) "" .dat~.dat ! fetch rule for DECwindows resource default $(CMS) FETCH $(MMS$SOURCE) $(CMSFLAGS) "" .lex~.lex ! fetch rule for LEX source file $(CMS) FETCH $(MMS$SOURCE) $(CMSFLAGS) "" .man~.man ! fetch rule for U*IX help file $(CMS) FETCH $(MMS$SOURCE) $(CMSFLAGS) "" .imakefile~.imakefile ! fetch rule for IMAKE source file $(CMS) FETCH $(MMS$SOURCE) $(CMSFLAGS) "" .uigl~.uigl ! fetch rule for UIGEN source file $(CMS) FETCH $(MMS$SOURCE) $(CMSFLAGS) "" .sql~.sql ! fetch rule for SQL source file $(CMS) FETCH $(MMS$SOURCE) $(CMSFLAGS) "" .idl~.idl ! fetch rule for NIDL source file $(CMS) FETCH $(MMS$SOURCE) $(CMSFLAGS) "" .sh~.sh ! fetch rule for SHELL scripts $(CMS) FETCH $(MMS$SOURCE) $(CMSFLAGS) "" .hlp~.hlp ! fetch rule for Help files $(CMS) FETCH $(MMS$SOURCE) $(CMSFLAGS) "" .sdl~.sdl ! fetch rule for SDL source file $(CMS) FETCH $(MMS$SOURCE) $(CMSFLAGS) "" .col~.col ! fetch rule for COL source file $(CMS) FETCH $(MMS$SOURCE) $(CMSFLAGS) "" .crl~.crl ! fetch rule for CRL source file $(CMS) FETCH $(MMS$SOURCE) $(CMSFLAGS) "" .rnh~.rnh ! fetch rule for RUNOFF source file $(CMS) FETCH $(MMS$SOURCE) $(CMSFLAGS) "" .msg~.msg ! fetch rule for MESSAGE source file $(CMS) FETCH $(MMS$SOURCE) $(CMSFLAGS) "" Makefiles :: clean :: $(RM_CMD) includes :: ! Includes build completed. depend :: ! Depend build completed. fetch :: ! Fetch build completed. firstdepend :: ! Firstdepend build completed. regdepend :: ! Regdepend build completed. map :: ! Map build completed. ` n~ IMAKE.SAVrZ[IMAKE.CPP]CPP.MEM;1*[IMAKE.CPP]CPP.MEM;1+,r./@ 4L-Z0123KPWO56ꮦ7^89G@HJ 1.0 C Pre-Processor ******* * cpp * ******* NAME: cpp -- C Pre-Processor SYNOPSIS: cpp [-options] [infile [outfile]] DESCRIPTION: CPP reads a C source file, expands macros and include files, and writes an input file for the C compiler. If no file arguments are given, CPP reads from stdin and writes to stdout. If one file argument is given, it will define the input file, while two file arguments define both input and output files. The file name "-" is a synonym for stdin or stdout as appropriate. The following options are supported. Options may be given in either case. -C If set, source-file comments are written to the output file. This allows the output of CPP to be used as the input to a program, such as lint, that expects commands embedded in specially-formatted comments. -Dname=value Define the name as if the programmer wrote #define name value at the start of the first file. If "=value" is not given, a value of "1" will be used. On non-unix systems, all alphabetic text will be forced to upper-case. -E Always return "success" to the operating system, even if errors were detected. Note that some fatal errors, such as a  missing #include file, will terminate CPP, returning "failure" even if the -E option is given. Page 2 cpp C Pre-Processor -Idirectory Add this directory to the list of directories searched for #include "..." and #include <...> commands. Note that there is no space between the "-I" and the directory string. More than one -I command is permitted. On non-Unix systems "directory" is forced to upper-case. -N CPP normally predefines some symbols defining the target computer and operating system. If -N is specified, no symbols will be predefined. If -N -N is specified, the "always present" symbols, __LINE__, __FILE__, and __DATE__ are not defined. -Stext CPP normally assumes that the size of the target computer's basic variable types is the same as the size of these types of the host computer. (This can be overridden when CPP is compiled, however.) The -S option allows dynamic respecification of these values. "text" is a string of numbers, separated by commas, that specifies correct sizes. The sizes must be specified in the exact order: char short int long float double If you specify the option as "-S*text", pointers to these types will be specified. -S* takes one additional argument for pointer to function (e.g. int (*)()) For example, to specify sizes appropriate for a PDP-11, you would write: c s i l f d func -S1,2,2,2,4,8, -S*2,2,2,2,2,2,2 Note that all values must be specified. -Uname Undefine the name as if #undef name were given. On non-Unix systems, "name" will be forced to upper-case. Page 3 cpp C Pre-Processor -Xnumber Enable debugging code. If no value is given, a value of 1 will be used. (For maintenence of CPP only.) PRE-DEFINED VARIABLES: When CPP begins processing, the following variables will have been defined (unless the -N option is specified): Target computer (as appropriate): pdp11, vax, M68000 m68000 m68k Target operating system (as appropriate): rsx, rt11, vms, unix Target compiler (as appropriate): decus, vax11c The implementor may add definitions to this list. The default definitions  match the definition of the host computer, operating system, and C compiler. The following are always available unless undefined (or -N was specified twice): __FILE__ The input (or #include) file being compiled (as a quoted string). __LINE__ The line number being compiled. __DATE__ The date and time of compilation as a Unix ctime quoted string (the trailing newline is removed). Thus, printf("Bug at line %s,", __LINE__); printf(" source file %s", __FILE__); printf(" compiled on %s", __DATE__); DRAFT PROPOSED ANSI STANDARD CONSIDERATIONS: The current version of the Draft Proposed Standard explicitly states that "readers are requested not to specify or claim conformance to this draft." Readers and users of Decus CPP should not assume that Decus CPP conforms to the standard, or that it will conform to the actual C Language Standard. When CPP is itself compiled, many features of the Draft Proposed Standard that are incompatible with existing Page 4 cpp C Pre-Processor preprocessors may be disabled. See the comments in CPP's source for details. The latest version of the Draft Proposed Standard (as reflected in Decus CPP) is dated November 12, 1984. Comments are removed from the input text. The comment is replaced by a single space character. The -C option preserves comments, writing them to the output file. The '$' character is considered to be a letter. This is a permitted extension. The following new features of C are processed by CPP: #elif expression (#else #if) '\xNNN' (Hexadecimal constant) '\a' (Ascii BELL) '\v' (Ascii Vertical Tab) #if defined NAME 1 if defined, 0 if not #if defined (NAME) 1 if defined, 0 if not #if sizeof (basic type) unary + 123U, 123LU Unsigned ints and longs. 12.3L Long double numbers token#token Token concatenation #include token Expands to filename The Draft Proposed Standard has extended C, adding a constant string concatenation operator, where "foo" "bar" is regarded as the single string "foobar". (This does not affect CPP's processing but does permit a limited form of macro argument substitution into strings as will be discussed.) The Standard Committee plans to add token concatenation to #define command lines. One suggested implementation is as follows: the sequence "Token1#Token2" is treated as if the programmer wrote "Token1Token2". This could be used as follows: #line 123 #define ATLINE foo#__LINE__ ATLINE would be defined as foo123. Note that "Token2" must either have the format of an identifier or be a string of digits. Thus, the string #define ATLINE foo#1x3 Page 5 cpp C Pre-Processor generates two tokens: "foo1" and "x3". If the tokens T1 and T2 are concatenated into T3, this implementation operates as follows: 1. Expand T1 if it is a macro. 2. Expand T2 if it is a macro. 3. Join the tokens, forming T3. 4. Expand T3 if it is a macro. A macro formal parameter will be substituted into a string or character constant if it is the only component of that constant: #define VECSIZE 123 #define vprint(name, size) \ printf("name" "[" "size" "] = {\n") ... vprint(vector, VECSIZE); expands (effectively) to vprint("vector[123] = {\n"); Note that this will be useful if your C compiler supports the new string concatenation operation noted above. As implemented here, if you write #define string(arg) "arg" ... string("foo") ... This implementation generates "foo", rather than the strictly correct ""foo"" (which will probably generate an error message). This is, strictly speaking, an error in CPP and may be removed from future releases. ERROR MESSAGES: Many. CPP prints warning or error messages if you try to use multiple-byte character constants (non-transportable) if you #undef a symbol that was not defined, or if your program has potentially nested comments. AUTHOR: Martin Minow BUGS: The #if expression processor uses signed integers only. I.e, #if 0xFFFFu < 0 may be TRUE. *[IMAKE.CPP]CPP.README;1+,r. /@ 4 -Z0123KPWO 56}79^89G@HJThis public domain C preprocessor is provided for platforms with naive cpp's that cannot handle the abusively large macros in the server and the number of defines in the toolkit. It is currently needed under the following systems: Apple A/UX 1.0 Apollo Domain/IX 9.6 and earlier It might be nice to integrate with makedepend someday (or at least steal the #if processing).... * * * * Decus cpp is a public-domain implementation of the C preprocessor. It runs on VMS native (Vax C), VMS compatibilty mode (Decus C), RSX-11M, RSTS/E, P/OS, and RT11, as well as on several varieties of Unix, including Ultrix. Decus cpp attempts to implement features in the Draft ANSI Standard for the C language. It should be noted, however, that this standard is under active development: the current draft of the standard explicitly states that "readers are requested not to specify or claim conformance to this draft." Thus readers and users of Decus cpp should not assume that it conforms to the draft standard, or that it will conform to the actual C language standard. These notes describe how to extract the cpp source files, configure it for your needs, and mention a few design decisions that may be of interest to maintainers. Installation Because the primary development of cpp was not on Unix, it is distributed using the Decus C archive program (quite similar to the archiver published in Kernighan and Plauger's Software Tools). To extract the files from the net.sources distribution, save this message as cpp1.arc and the other two distribution files as cpp2.arc and cpp3.arc. Then, using your favorite editor, locate the archx.c program, just following the line beginning with "-h- archx.c" -- the format of the distribution is just: -h- readme.txt ... this file -h- cpp.mem ... description of cpp -h- archx.c ... archx.c program -- extracts archives -h- archc.c ... archc.c program -- creates archives Compile archx.c -- it shouldn't require any special editing. Then run it as follows: archx *.arc You do not need to remove mail headers from the saved messages. You should then read through cppdef.h to make sure the HOST and TARGET (and other implementation-specific) definitions are set correctly for your machine, editing them as needed. You may then copy makefile.txt to Makefile, editing it as needed for your particular system. On Unix, cpp should be compiled by make without further difficulty. On other operating systems, you should compile the six source modules, linking them together. Note that, on Decus C based systems, you must extend the default stack allocation. The Decus C build utility will create the appropriate command file. Support Notes The USENET distribution kit was designed to keep all submissions around 50,000 bytes: cpp1.arc: readme.txt This file cpp.mem Documentation page (see below) archx.c Archive extraction program archc.c Archive construction program cpp.rno Source for cpp.mem (see below) makefile.txt Unix makefile -- copy to Makefile cpp.h Main header file (structure def's and globals) cppdef.h Configuration file (host and target definitions) cpp2.arc: cpp1.c Mainline code, documentation master sources cpp2.c most #control processing cpp3.c filename stuff and command line parsing cpp3.arc: cpp4.c #define processor cpp5.c #if processor cpp6.c Support code (symbol table and I/O routines) Cpp intentionally does not rely on the presence of a full-scale macro preprocessor, it does require the simple parameter substitution preprocessor capabilities of Unix V6 and Decus C. If your C language lacks full preprocessing, you should make sure "nomacargs" is #define'd in cpp.h. (This is done automatically by the Decus C compiler.) The documentation (manual page) for cpp is included as cpp.mem and cpp.rno. Cpp.rno is in Dec Runoff format, built by a Decus C utility (getrno) from original source which is embedded in cpp1.c. To my knowledge, there is no equivalent program that creates the nroff source appropriate for Unix. I would be happy to receive fixes to any problems you encounter. As I do not maintain distribution kit base-levels, bare-bones diff listings without sufficient context are not very useful. It is unlikely that I can find time to help you with other difficulties. Acknowledgements I received a great deal of help from many people in debugging cpp. Alan Feuer and Sam Kendall used "state of the art" run-time code checkers to locate several errors. Ed Keiser found problems when cpp was used on machines with different int and pointer sizes. Dave Conroy helped with the initial debugging, while Arthur Olsen and George Rosenberg found (and solved) several problems in the first USENET release. Martin Minow decvax!minow *[IMAKE.CPP]CPP.RNO;1+,r./@ 4-Z0123KPWO56G7^89G@HJ.lm 8.rm 72.nhy .no autosubtitle .style headers 3,0,0 .pg.uc.ps 58,80.lm 8.rm 72 .hd .hd mixed .head mixed .st ########cpp#####C Pre-Processor .pg .hl 1 ^&C Pre-Processor\& .s 2 .c ;******* .c ;* cpp * .c ;******* .s 2 .lm +8 .s.i -8;NAME: cpp -- C Pre-Processor .s.f .i -8;SYNOPSIS: .s.nf cpp [-options] [infile [outfile]] .s.f .i -8;DESCRIPTION: .s CPP reads a C source file, expands macros and include files, and writes an input file for the C compiler. If no file arguments are given, CPP reads from stdin and writes to stdout. If one file argument is given, it will define the input file, while two file arguments define both input and output files. The file name "-" is a synonym for stdin or stdout as appropriate. .s The following options are supported. Options may be given in either case. .lm +16 .p -16 -C If set, source-file comments are written to the output file. This allows the output of CPP to be used as the input to a program, such as lint, that expects commands embedded in specially-formatted comments. .p -16 -Dname=value Define the name as if the programmer wrote .s .nf _#define name value .s .fill at the start of the first file. If "=value" is not given, a value of "1" will be used. .s On non-unix systems, all alphabetic text will be forced to upper-case. .p -16 -E Always return "success" to the operating system, even if errors were detected. Note that some fatal errors, such as a missing _#include file, will terminate CPP, returning "failure" even if the -E option is given. .p -16 -Idirectory Add this directory to the list of directories searched for _#include "..." and _#include <...> commands. Note that there is no space between the "-I" and the directory string. More than one -I command is permitted. On non-Unix systems "directory" is forced to upper-case. .p -16 -N CPP normally predefines some symbols defining the target computer and operating system. If -N is specified, no symbols will be predefined. If -N -N is specified, the "always present" symbols, ____LINE____, ____FILE____, and ____DATE____ are not defined. .p -16 -Stext CPP normally assumes that the size of the target computer's basic variable types is the same as the size of these types of the host computer. (This can be overridden when CPP is compiled, however.) The -S option allows dynamic respecification of these values. "text" is a string of numbers, separated by commas, that specifies correct sizes. The sizes must be specified in the exact order: .s .nf char short int long float double .s .fill If you specify the option as "-S*text", pointers to these types will be specified. -S* takes one additional argument for pointer to function (e.g. int (*)()) .s For example, to specify sizes appropriate for a PDP-11, you would write: .s .nf c s i l f d func -S1,2,2,2,4,8, -S*2,2,2,2,2,2,2 .s .fill Note that all values must be specified. .p -16 -Uname Undefine the name as if .s .nf _#undef name .s .fill were given. On non-Unix systems, "name" will be forced to upper-case. .p -16 -Xnumber Enable debugging code. If no value is given, a value of 1 will be used. (For maintenence of CPP only.) .s.lm -16 .s .i -8;PRE-DEFINED VARIABLES: .s When CPP begins processing, the following variables will have been defined (unless the -N option is specified): .s Target computer (as appropriate): .s .nf pdp11, vax, M68000 m68000 m68k .fill .s Target operating system (as appropriate): .s .nf rsx, rt11, vms, unix .fill .s Target compiler (as appropriate): .s .nf decus, vax11c .fill .s The implementor may add definitions to this list. The default definitions match the definition of the host computer, operating system, and C compiler. .s The following are always available unless undefined (or -N was specified twice): .lm +16 .p -12 ____FILE____ The input (or _#include) file being compiled (as a quoted string). .p -12 ____LINE____ The line number being compiled. .p -12 ____DATE____ The date and time of compilation as a Unix ctime quoted string (the trailing newline is removed). Thus, .s .nf printf("Bug at line _%s,", ____LINE____); printf(" source file _%s", ____FILE____); printf(" compiled on _%s", ____DATE____); .fill .s.lm -16 .s .i -8;DRAFT PROPOSED ANSI STANDARD CONSIDERATIONS: .s The current version of the Draft Proposed Standard explicitly states that "readers are requested not to specify or claim conformance to this draft." Readers and users of Decus CPP should not assume that Decus CPP conforms to the standard, or that it will conform to the actual C Language Standard. .s When CPP is itself compiled, many features of the Draft Proposed Standard that are incompatible with existing preprocessors may be disabled. See the comments in CPP's source for details. .s The latest version of the Draft Proposed Standard (as reflected in Decus CPP) is dated November 12, 1984. .s Comments are removed from the input text. The comment is replaced by a single space character. The -C option preserves comments, writing them to the output file. .s The '$' character is considered to be a letter. This is a permitted extension. .s The following new features of C are processed by CPP: .s.comment Note: significant spaces, not tabs, .br quotes #if, #elif .br;####_#elif expression (_#else _#if) .br;####'_\xNNN' (Hexadecimal constant) .br;####'_\a' (Ascii BELL) .br;####'_\v' (Ascii Vertical Tab) .br;####_#if defined NAME 1 if defined, 0 if not .br;####_#if defined (NAME) 1 if defined, 0 if not .br;####_#if sizeof (basic type) .br;####unary + .br;####123U, 123LU Unsigned ints and longs. .br;####12.3L Long double numbers .br;####token_#token Token concatenation .br;####_#include token Expands to filename .s The Draft Proposed Standard has extended C, adding a constant string concatenation operator, where .s .nf "foo" "bar" .s .fill is regarded as the single string "foobar". (This does not affect CPP's processing but does permit a limited form of macro argument substitution into strings as will be discussed.) .s The Standard Committee plans to add token concatenation to _#define command lines. One suggested implementation is as follows: the sequence "Token1_#Token2" is treated as if the programmer wrote "Token1Token2". This could be used as follows: .s .nf _#line 123 _#define ATLINE foo_#____LINE____ .s .fill ATLINE would be defined as foo123. .s Note that "Token2" must either have the format of an identifier or be a string of digits. Thus, the string .s .nf _#define ATLINE foo_#1x3 .s .fill generates two tokens: "foo1" and "x3". .s If the tokens T1 and T2 are concatenated into T3, this implementation operates as follows: .s .nf 1. Expand T1 if it is a macro. 2. Expand T2 if it is a macro. 3. Join the tokens, forming T3. 4. Expand T3 if it is a macro. .s .fill A macro formal parameter will be substituted into a string or character constant if it is the only component of that constant: .s .nf _#define VECSIZE 123 _#define vprint(name, size) _\ printf("name" "[" "size" "] = {_\n") ... vprint(vector, VECSIZE); .s .fill expands (effectively) to .s .nf vprint("vector[123] = {_\n"); .s .fill Note that this will be useful if your C compiler supports the new string concatenation operation noted above. As implemented here, if you write .s .nf _#define string(arg) "arg" ... string("foo") ... .s .fill This implementation generates "foo", rather than the strictly correct ""foo"" (which will probably generate an error message). This is, strictly speaking, an error in CPP and may be removed from future releases. .s .i -8;ERROR MESSAGES: .s Many. CPP prints warning or error messages if you try to use multiple-byte character constants (non-transportable) if you _#undef a symbol that was not defined, or if your program has potentially nested comments. .s .i -8;AUTHOR: .s Martin Minow .s .i -8;BUGS: .s The _#if expression processor uses signed integers only. I.e, _#if 0xFFFFu < 0 may be TRUE. .s .lm 8.rm 72.nhy .*[IMAKE]IMAKE.DIR;1+,r./@ 4-R0123 KPWO56v7൧89G@HJI BUILD.DIRr IMAKE.MANQs IMAKE.RULESRs IMAKE.TMPLuIMAKE_APP_X11R4.PSSsIMAKE_WHITE_13.PSYs README.$tSAMPLE.IMAKEFILERtSITE.DEFUt  ULTRIX.CFXtVMS.CFt*[IMAKE.IMAKE]BUILD.DIR;1+,r./@ 4-r0123 KPWO56`ç7է89G@HJI BUILDME.COMr CCIMAKE.CrIMAKE.Cr IMAKE.EXEr IMAKE.IMAKEFILEr IMAKE.OBJr IMAKE.OPTr IMAKEMDEP.Hr MAKEFILE.BAKs MAKEFILE.INIs  MAKEFILE.MMSPs *[IMAKE.IMAKE.BUILD]BUILDME.COM;1+,r./@ 40^-r0123KPWO56 Wc7 _89G@HJ$!0$! The make commands used to build this program.$!$ $ make env $ make opt$ make*[IMAKE.IMAKE.BUILD]CCIMAKE.C;1+,r./@ 4O/-r0123KPWO5 6%'iO7_89G@HJ/* * $XConsortium: ccimake.c,v 1.12 89/10/16 12:09:23 jim Exp $ * * Warning: This file must be kept as simple as posible so that it can * compile without any special flags on all systems. Do not touch it unless * you *really* know what you're doing. Make changes in imakemdep.h, not here. */ #define CCIMAKE /* only get imake_ccflags definitions */ #include "imakemdep.h" /* things to set when porting imake */ #ifndef imake_ccflags #define imake_ccflags "-O" #endif main() { write(1, imake_ccflags, sizeof(imake_ccflags) - 1); exit(0); } *[IMAKE.IMAKE.BUILD]IMAKE.C;1+,r.H/@ 4HG-r0123KPWOH5 6E-7`89G@HJ/*****************************************************************************\ * * * Porting Note * * * * Add the value of BOOTSTRAPCFLAGS to the cpp_argv table so that it will be * * passed to the template file. * * * \*****************************************************************************/ /* * * Copyright 1985, 1986, 1987 by the Massachusetts Institute of Technology * * Permission to use, copy, modify, and distribute this * software and its documentation for any purpose and without * fee is hereby granted, provided that the above copyright * notice appear in all copies and that both that copyright * notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in * advertising or publicity pertaining to distribution of the * software without specific, written prior permission. * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" * without express or implied warranty. * * $XConsortium: imake.c,v 1.51 89/12/12 12:37:30 jim Exp $ * $Locker: $ * * Author: * Todd Brunhoff * Tektronix, inc. * While a guest engineer at Project Athena, MIT *h~ IMAKE.SAVrr[IMAKE.IMAKE.BUILD]IMAKE.C;1Hd * imake: the include-make program. * * Usage: imake [-Idir] [-Ddefine] [-T] [-f imakefile ] [-s] [-e] [-v] [make flags] * * Imake takes a template makefile (Imake.tmpl) and runs cpp on it * producing a temporary makefile in /tmp. It then runs make on * this pre-processed makefile. * Options: * -D define. Same as cpp -D argument. * -I Include directory. Same as cpp -I argument. * -T template. Designate a template other * than Imake.tmpl * -s[F] show. Show the produced makefile on the standard * output. Make is not run is this case. If a file * argument is provided, the output is placed there. * -e[F] execute instead of show; optionally name Makefile F * -v verbose. Show the make command line executed. * * Environment variables: * * IMAKEINCLUDE Include directory to use in addition to "." * IMAKECPP Cpp to use instead of /lib/cpp * IMAKEMAKE make program to use other than what is * found by searching the $PATH variable. * Other features: * imake reads the entire cpp output into memory and then scans it * for occurences of "@@". If it encounters them, it replaces it with * a newline. It also trims any trailing white space on output lines * (because make gets upset at them). This helps when cpp expands * multi-line macros but you want them to appear on multiple lines. * * The macros MAKEFILE and MAKE are provided as macros * to make. MAKEFILE is set to imake's makefile (not the constructed, * preprocessed one) and MAKE is set to argv[0], i.e. the name of * the imake program. * * Theory of operation: * 1. Determine the name of the imakefile from the command line (-f) * or from the content of the current directory (Imakefile or imakefile). * Call this . This gets added to the arguments for * make as MAKEFILE=. * 2. Determine the name of the template from the command line (-T) * or the default, Imake.tmpl. Call this