home *** CD-ROM | disk | FTP | other *** search
Text File | 1990-05-25 | 21.5 KB | 1,153 lines |
- .ig
- A complete rewrite of the texttroff macro package.
- It would be loosely modelled after the -ms macros
-
- main concept is to separate the elements of the page,
- so a trap for the footer and a trap for the header separatly
-
- Also all default values are in well known registers,
- initialized by the .IZ macro
- ..
- .\"
- . \" IZ - initialize. Provide some default settings
- .de IZ
- .nr PS \n(.p \" pointsize
- .nr VS \n(.v \" linespacing
- .nr HM 1i \" header margin
- .nr FM 1i \" footer margin
- .nr LL \n(.l \" line length
- .nr IN 36p \" indent to allow outdenting headers
- .nr LT \n(.l-\n(INu \" title length
- .\" trap setting
- .\"
- .\" for the top of page
- .wh 0 NP
- .\" for dealing with footnotes
- .wh 14i FO \" footer trap, temp position
- . \" to process footnote overflow, we fire this trap
- . \" the trap for FO will be moved way up so we will fire
- . \" this one when FO is putting the footnote out
- .wh -\\n(FMu Fx
- . \" Now install FO on top of this position so it
- . \" will be fired when no footnote needs to be processed
- .ch -\\n(FMu FO
- .\" for the bottom tittle
- .wh -\\n(FMu/2u BT
- ..
- .\"
- . \" TA - set tabstops
- .de TA
- .ta \\n(ENu +\\n(ENu +\\n(ENu +\\n(ENu +\\n(ENu +\\n(ENu +\\n(ENu +\\n(ENu +\\n(ENu +\\n(ENu +\\n(ENu +\\n(ENu
- ..
- .\"
- . \" RS - Reset. Bring troff into a known state
- .de RS
- .ps \\n(PS
- .vs \\n(VSu
- .ll \\n(LLu
- .lt \\n(LTu
- .in \\n(INu
- .po \\n(POu
- .nr FS \\n(VSu/4u \" footnote separation
- .nr F 0 1 \" for footnote numbering
- .ev 1
- . \" where footnotes are processed
- .ps \\n(PS-2
- .vs (\\n(VSu-2p)u
- .ll \\n(LLu-\\n(INu
- .ev
- .ev 2
- . \" where the table of contents is stored
- .ps \\n(PS
- .vs \\n(VSu
- .ev
- .TA
- ..
- .\"
- . \" string for footnote numebering. Note that the increment takes place here
- . \" note that Fn is defined in texttroff to get the body font
- .ds * \v'-.3v'\\*(Fn\s-3\\n+F\s0\fP\v'.3v'
- .ig
- Running headers & footers.
- These will be called from the header & footer macro
- halfway the current margins in the macros PT & BT
- Note that we don't use the page counter (%) directly.
- We stick the value in register PN.
- This allows for changing the format of the page number with
- the .af request without screwing up troff
-
- We will enable the possibility to change on odd & even pages eventually
- ..
- .\"
- . \" PT - Page Trap & Bottom Trap macro
- .de PT
- .if \\n(Tc=2 .br
- .po +\\n(INu
- .pc %
- .ie \\n(Tc=3 .nr PN \\n%-\\n(Pc
- .el .nr PN \\n%
- .nr Pn \\n%
- .if \\n(Pn>1 .if e .tl '\\*(LT'\\*(CT'\\*(RT'
- .if \\n(Pn>1 .if o .tl '\\*(RT'\\*(CT'\\*(LT'
- .po
- ..
- . \" default footer string definitions
- .po +\\n(INu
- .de BT
- .nr PF \\n(.f
- .nr PX \\n(.s
- .ft 1
- .ps \\n(PS
- .lt \\n(LTu
- .po +\\n(INu
- .if e .tl '\\*(LB'\\*(CB'\\*(RB'
- .if o .tl '\\*(RB'\\*(CB'\\*(LB'
- .ft \\n(PF
- .ps \\n(PX
- .po
- .if \\n(Tc=2 \{\
- . nr Pc \\n%
- . nr Tc 3
- . af PN i
- . TC
- .\}
- ..
- . \" default header string definitions
- .ds CT - \\n(PN -
- .\"
- .\"
- . \" NP - header macro
- .ig
- print the header halfway the margins
- only print when not on the first page
- ..
- .de NP
- .\".tm in NP page \\n% PO \\n(PO .o \\n(.o
- .nr PF \\n(.f
- .nr PX \\n(.s
- .ft 1
- .ps \\n(PS
- 'sp |\\n(HMu/2u
- .if !\\n%=0 .PT
- .ps \\n(PX
- .ft \\n(PF
- 'sp |\\n(HMu
- .nr Fc 0 1 \" init footnote count
- .nr Fp 0-\\n(HMu \" current footer place
- .ch FO -\\n(HMu \" reset footer trap
- .if \\n(dn .Fz \" proces left over footnote
- .ns \" no space mode
- ..
- .\"
- . \" FO - footer macro
- .de FO
- .nr dn 0 \" zero last diversion size
- .if \\n(Fc \{\
- . ev 1 \" expand footnotes in ev1
- .\".if '\\n(.z'Fy' .tm in overlow .i \\n(.i
- .in \\n(INu \" set indentation to the one for the page
- . nf \" retain vertical size
- . FN \" dump the footnotes
- . \" remove them; Don't put a comment on the next line
- . \" with .rm, some troffs go into an infinite loop
- . rm FN
- .\".if '\\n(.z'Fy' .tm in overlow .i \\n(.i
- . if \\n(.zFy .di \"end overflow diversion
- . nr Fc 0 \" disable fx
- . in 0 \" clear indentation
- .ev
- .\}
- . \" pop environment
- 'bp
- ..
- ."
- .\" Fx - process footnote overflow
- .\"
- .de Fx
- .if \\n(Fc \{\
- . \" the foonote didn't fit so
- .di Fy \" divert the overflow into Fy (we are still in env 1, so nofill mode)
- . \" since we are in nofill mode and head indentation set,
- .in 0 \" set no indentation, so we don't indent twice
- .\}
- ..
- .\"
- .\" FS - Footnote Start
- .de FS
- .da FN \" divert (or append) footnote
- .ev 1 \" in environment 1
- .if \\n+(Fc=1 .FM \" if first include seperator
- .fi \" process in fill mode
- .if !\\n(Fo .FP \" Footnote paragraph if not processing overflow
- ..
- .\"
- . \" FP - footnote paragraph
- .de FP
- .sp \\n(FSu
- \v'-.3'\s-3\\nF\s0\v'.3'\|\c
- ..
- .\"
- .\" FE - Footnote End
- .de FE
- .br \" flush the output buffer
- .nr Sv \\n(.v \" save baselinespacing of this env
- .ev \" pop env
- .di \" end the diversion
- .nr Fp -\\n(dn \" new footer position
- .if \\n(Fc=1 .nr Fp -(\\n(.v-\\n(Sv) \" For Separator
- .ch FO \\n(Fpu \" change the trap, Fp is negative
- . \" See whether the stuff really fits.
- . \"if not change trap and we overflow
- .if (\\n(nl+1v)>(\\n(.p+\\n(Fp) .ch FO \\n(nlu+1v \" it didn't fit,
- . \" so fire the FO macro on the next line
- ..
- .\"
- . \" FM - footnote separator one inch line
- .de FM
- \l'1i'
- .br
- ..
- .\"
- .\" Fz - process footnote overflow
- .de Fz
- .nr Fo 1
- .FS
- .nf \" is already processed, so keep size
- .Fy \" where Fx put it
- .nr Fo 0
- .FE
- ..
- .\"
- .\" HE - next thing will be a header
- .\" minimalistic widow control in HE macro.
- .\" We aks for a couple of lines with the .ne statement, will trigger the
- .\" bottom of page trap on the moment when there is no space
- .de HE
- .ne 1.5i
- ..
- .\"
- .\" IC - in table of contents
- .\" $1 type of header $3 number, $2 text
- .\"
- .de IC
- .nr Tc 1 \"flag that we have a contents
- .ev 2
- .if !'\\$3'NO' \{\
- . nr Tx \w'\\$3\0'u
- . if \\n(Tx>\\n(Ta .nr Ta \\n(Tx
- .\}
- .nr Tp \w'\0\\n(PN'u
- .da Tc
- \\!.xx "\\$1" "\\$2" \\$3 \\n(PN
- .br
- .di
- .ev
- ..
- .\"
- .\" An item in the table of contents
- .de xx
- .if \\$1=1 .sp .5
- .ie !'\\$3'NO' \\$3\t\\$2\a\t\\$4
- .el .ie \\n(Ta \&\t\\$2\a\t\\$4
- .el \&\\$2\a\t\\$4
- ..
- .\" EM
- .\" check for work at end of file
- .de EM
- .if \\n(Tc \{\
- \c
- .nr Tc 2
- .\}
- .\"tm EM called, Tc: \\n(Tc
- ..
- .\" do the things we want at the end of the paper
- .de TC
- .\"tm TC called
- 'bp
- .ft B
- .\".tm tabel of contents
- .ce
- .rs
- .sp
- .ti -\\n(INu
- \s+2Table of Contents\s0
- .sp 2
- .ft R
- .nf
- .ev 2
- . \" where the table of contents is stored
- .nf
- .nr Tb \\n(LLu-\\n(Tpu-\\n(INu
- .nr c \w'1.1.1.1\0'u
- .ie \\n(Ta .ta \\n(Tau \\n(Tbu \\n(LLu-\\n(INuR
- .el .ta \\n(Tbu \\n(LLu-\\n(INuR
- .in \\n(INu
- .Tc
- .ev
- ..
- .\"
- .\" set end macro
- .em EM
- .\" in texttroff .IZ
- .\" in texttroff .RS
- .\"
- .\"
- .\"
- .\" Begin of the PSmacros, coutesy of fred hansen (I believe)
- .\"
- .nr zT 0
- .if "\*(.T"postscript" 'nr zT 1
- .if "\*(.T"psc" 'nr zT 1
- .de PB
- 'ne \\$2p
- 'nr zw \\n(.l-\\n(.k-1m-\\$1p
- 'nr zH \\n(.k
- 'nr zV \\n(.d
- 'if \\n(zT \\{\\
- 'ie !\\n(zw \\{\\
- 'nr zx \\n(.l-\\$1p-10m
- 'nr zV \\n(zV+1v
- .sp 0
- \\v'-.75v'\\ \\v'+.75v'\\c\\}
- 'el \\{\\
- 'nr zx \\n(zw-10m
- \\v'-.75v'\\ \\v'+.75v'\\c\\}
- .sp |\\n(zVu
- 'if ((\\n(zx<=0)&(\\$2p>0.75v)) \\x'\\$2p-0.75v'\\c
- \\!%
- \\!%!
- \\! PB
- 'if \\n(.j=3 \\{\\
- \\! /troffadjust { neg 2 idiv } def
- 'ss\\}
- 'if \\n(.j=5 \\{\\
- \\! /troffadjust { neg } def
- 'ss\\}
- 'if \\n(.j<3 \\{\\
- \\! /troffadjust { pop 0 } def
- 'ss\\}\\}
- ..
- .de PE
- 'if \\n(zT \\{\\
- \\! PE
- \\!.
- 'ie \\n(zx \\{\\
- 'if (\\$2p>0.75v) \\x'\\$2p-0.75v'\\c
- \\h'-\\n(.ku+\\n(zHu+\\$1p'\\c\\}
- 'el .br\\}
- 'if !\\n(zT \\{\\
- 'if !\\n(zw \\{\\
- \\h'-\\n(.k'\\ \\h'-\\n(.w'\\c
- .sp -1\\}
- \\x'\\$2p-0.75v'\\v'-.75v'\\D'l \\$1p \
- 0.0i'\\D'l 0.0i \\$2p'\\D'l -\\$1p 0.0i'\\D'l 0.0i \
- -\\$2p'\\v'+.75v'\\h'\\$1p'\\c\\}
- ..
- .\"
- .\" End of PSmacros
- .\"
- .\"
- .\" ix macro for index production.
- .\"
- .de ix
- .ie '\\n(.z'' .tm ix: \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 \\n%
- .el \\!.ix \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 \\n%
- ..
- .\"
- .\" End of ix macro
- .\"
- .IZ
- .nr IN 36p
- .nr LT 432p
- .nr PO 54p
- .br
- .ad b
- 'ft R
- .nr PS 12
- .ps \n(PS
- .nr VS 14p
- .vs \n(VSu
- .nr EN 8n
- .sp 0.5i
- .nr DP 0
- .ds Fn \fR
- .ds HF R
- .nr HS \n(.s
- .ds FF R
- .nr FS \n(.s
- .RS
- .nh
- .OC
- .ds Cl Installation
- .ll 6.75i
- .po .75i
- .nr Dr 1
- .nr DP 0
- .ds BU \s-2\(bu\s0
- .ds EM \(em
- .if\n(mo-0 .ds DT January
- .if\n(mo-1 .ds DT February
- .if\n(mo-2 .ds DT March
- .if\n(mo-3 .ds DT April
- .if\n(mo-4 .ds DT May
- .if\n(mo-5 .ds DT June
- .if\n(mo-6 .ds DT July
- .if\n(mo-7 .ds DT August
- .if\n(mo-8 .ds DT September
- .if\n(mo-9 .ds DT October
- .if\n(mo-10 .ds DT November
- .if\n(mo-11 .ds DT December
- .asDT " \n(dy, 19\n(yr
- .ds LT \*(Cl
- .ds CT NIH Class Library Revision 3.0
- .ds RT \*(Cl
- .ds LB Page \\n%
- .ds RB \*(DT
- .tl `\*(LT`\*(CT`\*(RT`
- .ps
- .ft P
- 'sp 0.3i
- .HE
- .br
- .ad l
- 'ft B
- .ps 14
- .OC
- .br
- .vs 16
- INTRODUCTION
- .ad b
- 'ft R
- .ps 12
- .OC
- .br
- .vs 14
- .TA
- .OC
- .sp 1
- This is the Installation Guide for the NIH Class Library (previously known as the
- "OOPS" Class Library) Revision 3.0.
- .OC
- .sp 1
- The NIH Class Library is intended to be portable to a UNIX system compatible with
- either System V or 4.2/4.3BSD and which supports the AT&T C++ translator Release 2.00,
- Release 2.1, or other compatible C++ compiler. We have ported and tested this library
- on the following systems:
- 'in 72p
- 'll \n(.lu-(36p)
- .OC
- .sp 1
- Sun-3 with SunOS 3.5
- .OC
- .br
- Sun-3 with SunOS 4.0
- .OC
- .br
- Sun-4 with SunOS 4.0
- 'in 36p
- 'll \n(.lu-(-36p)
- .OC
- .sp 1
- Send comments to:
- 'in 72p
- 'll \n(.lu-(36p)
- .OC
- .sp 1
- Keith Gorlen
- .OC
- .br
- Building 12A, Room 2033
- .OC
- .br
- Computer Systems Laboratory
- .OC
- .br
- Division of Computer Research and Technology
- .OC
- .br
- National Institutes of Health
- .OC
- .br
- Bethesda, MD 20892
- .OC
- .sp 1
- phone: (301) 496-1111
- .OC
- .br
- Internet
- 'in 108p
- 'll \n(.lu-(36p)
- : kgorlen@alw.nih.gov
- 'in 72p
- 'll \n(.lu-(-36p)
- .OC
- .br
- uucp: uunet!nih-csl!kgorlen
- 'in 36p
- 'll \n(.lu-(-36p)
- .HE
- .br
- .ad l
- 'ft B
- .ps 14
- .OC
- .sp 2
- .vs 16
- GUIDE TO THIS DISTRIBUTION KIT
- .ad b
- 'ft R
- .ps 12
- .OC
- .sp 1
- .vs 14
- The NIH Class Library distribution kit consists of a main directory and the following
- subdirectories:
- 'in 72p
- 'll \n(.lu-(36p)
- 'ft C
- .OC
- .sp 1
- errfac \fRError Message Facility source files\fC
- .OC
- .br
- lib \fRSource files for the basic library classes\fC
- .OC
- .br
- test \fRTest suite for the basic library classes\fC
- .OC
- .br
- vector \fRSource files for the Vector classes\fC
- .OC
- .br
- vectest \fRTest suite for the Vector classes\fC
- .OC
- .br
- ex \fRExample programs for the book
- 'in 36p
- 'll \n(.lu-(-36p)
- .OC
- .sp 1
- The main directory is refered to as \fCNIHCL\fR in the following discussion, but may be
- placed anywhere.
- .OC
- .sp 1
- Most subdirectories have files named \fCMAKEFILE\fR and \fCMakefile\fR. The \fCMAKEFILE\fR is used
- by the installation procedure, and should work with both the System V and BSD version
- of the \fCmake\fR utility. The fancier \fCMakefile\fR is used for development, and may not work
- under BSD.
- .HE
- .br
- .ad l
- 'ft B
- .ps 14
- .OC
- .sp 2
- .vs 16
- SUMMARY OF STEPS IN INSTALLING THE NIH CLASS LIBRARY
- .ad b
- 'ft R
- .ps 12
- 'in 109p
- .ti -46p
- .OC
- .sp 1
- .ti -46p
- .vs 14
- 1. Update C++ system library and include files
- .OC
- .br
- .ti -46p
- 2. Edit \fCNIHCL/Makefile\fR
- .OC
- .br
- .ti -46p
- 3. Edit \fCNIHCL/lib/nihclconfig.h\fR
- .OC
- .br
- .ti -46p
- 4. Build and install error message facility*
- .OC
- .br
- .ti -46p
- 5. Build NIHCL basic classes, Vector classes, and test suite
- .OC
- .br
- .ti -46p
- 6. Test basic classes and Vector classes
- .OC
- .br
- .ti -46p
- 7. Build NIHCL basic classes, Vector classes, and test suite with multiple inheritance
- support
- .OC
- .br
- .ti -46p
- 8. Test basic classes and Vector classes with multiple inheritance support
- .OC
- .br
- .ti -46p
- 9. Install class libraries*
- .OC
- .br
- .ti -46p
- 10. Build example programs
- .OC
- .br
- .ti -46p
- 11. Test example programs
- 'in 36p
- .ti +0p
- .OC
- .sp 1
- * root permission may be required
- .HE
- .br
- .ad l
- 'ft B
- .ps 14
- .OC
- .sp 3
- .vs 16
- INSTALLING THE NIH CLASS LIBRARY\fB
- .ps 12
- .HE
- .OC
- .sp 1
- .vs 14
- 1. Update C++ system library and include files
- .ad b
- 'ft R
- .OC
- .sp 1
- No updates to R2.00 of the AT&T C++ Translator are required. However, if you are
- using R2.1, be sure to make the changes documented in the section \fICOMPILING UNDER AT&T
- C++ TRANSLATOR RELEASE 2.1\fR in the \fINIH Class Library Release Notes\fR.
- .HE
- .br
- .ad l
- 'ft B
- .OC
- .sp 1
- 2. Edit NIHCL/Makefile
- .ad b
- 'ft R
- .OC
- .sp 1
- Edit \fCNIHCL/Makefile\fR to change make variables as needed for your environment. Here
- are the settings shipped with the distribution kit:
- 'in 72p
- .br
- .ad l
- 'ft C
- .ps 10
- .OC
- .sp 1
- .vs 12
- # C++ compiler
- .OC
- .br
- CC = CC
- .OC
- .sp 1
- # C++ debug switch
- .OC
- .br
- CCDEBUG =
- .OC
- .br
- #CCDEBUG = -g
- .OC
- .sp 1
- # C++ flags
- .OC
- .br
- # NOTE: Disable +p option when compiling with AT&T R2.1
- .OC
- .br
- #CCFLAGS = +p
- .OC
- .br
- #CCFLAGS =
- .OC
- .sp 1
- # C++ include files
- .OC
- .br
- I = /usr/include/CC
- .OC
- .sp 1
- # If using BSD
- .OC
- .br
- SYS = BSD
- .OC
- .br
- # If using System V
- .OC
- .br
- #SYS = SYSV
- .OC
- .sp 1
- # Compile with nested types
- .OC
- .br
- # (works with AT&T R2.1 and GNU C++)
- .OC
- .br
- NESTED_TYPES =
- .OC
- .br
- #NESTED_TYPES = -DNESTED_TYPES
- .OC
- .sp 1
- # Disable AT&T R2.0/R2.1 bug work-around code
- .OC
- .br
- BUGDEFS =
- .OC
- .br
- #BUGDEFS = -DBUG_bC2728 -DBUG_38 -DBUG_39 -DBUG_OPTYPECONST
- .OC
- .br
- # Defining BUG_TOOBIG disables code that
- .OC
- .br
- # prevents C compiler "yacc stack overflows" error
- .OC
- .br
- #BUGDEFS = -DBUG_bC2728 -DBUG_38 -DBUG_39 -DBUG_OPTYPECONST -DBUG_TOOBIG
- .OC
- .sp 1
- # Enable debug code
- .OC
- .br
- DEBUGDEFS =
- .OC
- .br
- #DEBUGDEFS = -DDEBUG_OBJIO -DDEBUG_PROCESS
- .OC
- .sp 1
- # Flags for ln
- .OC
- .br
- #LNFLAGS =
- .OC
- .br
- LNFLAGS = -s
- .OC
- .sp 1
- # If using "patch"
- .OC
- .br
- MAIN = _main.c_p
- .OC
- .br
- # If using "munch"
- .OC
- .br
- #MAIN = _main.c_m
- .OC
- .sp 1
- # Target library for installation of Error Facility
- .OC
- .br
- LIB_ID = libC
- .OC
- .sp 1
- # Target Directories for Installation
- .OC
- .sp 1
- # directory for libnihcl.a
- .OC
- .br
- NIHCLLIBDIR = /usr/local/lib
- .OC
- .br
- # directory for NIHCL include files
- .OC
- .br
- NIHCLINCDIR = /usr/include/nihcl
- .OC
- .br
- # directory where ${LIB_ID}.a resides
- .OC
- .br
- CLIBDIR = /usr/local/lib/C++R2.0
- .OC
- .br
- # directory for errgen utility
- .OC
- .br
- ERRGENDIR = /usr/local/bin
- .OC
- .br
- # directory for errgen table file
- .OC
- .br
- ERRTABDIR = /usr/local/lib
- .OC
- .br
- # directory for errlib.h and errors.h
- .OC
- .br
- ERRINCDIR = $I\fC
- .ps 12
- 'in 36p
- .ad b
- 'ft R
- .HE
- .br
- .ad l
- 'ft B
- .OC
- .sp 2
- .vs 14
- 3. Edit NIHCL/lib files
- .ad b
- 'ft R
- .HE
- .br
- .ad l
- 'ft I
- .OC
- .sp 1
- 3.1 Edit \f(COnihclconfig.h
- .ad b
- 'ft R
- .OC
- .sp 1
- The NIH Class Library source is configured for your system by setting flags in \fCNIHCL/lib/nihclconfig.h\fR
- which specify the machine model and operating system (UNIX variant).
- .OC
- .sp 1
- To configure the NIH Class Library for one of the not yet implemented options, at
- least all of the parameters appearing in \fCnihclconfig.h\fR will have to be defined for
- that option.
- .OC
- .sp 1
- The NIH Class Library should configure itself automatically for the following machines:
- 'in 72p
- 'll \n(.lu-(36p)
- .OC
- .sp 1
- sun/mc68000
- .OC
- .br
- sun/sparc
- 'in 36p
- 'll \n(.lu-(-36p)
- .OC
- .sp 1
- Classes \fCProcess\fR, \fCHeapProc\fR, \fCStackProc\fR, \fCScheduler\fR, \fCSemaphore\fR, and \fCSharedQueue\fR have some
- machine-specific dependencies and will not work unless the \fCSETJMP()/LONGJMP()\fR functions
- are properly defined. See the \fINIH Class Library Release Notes\fR for directions on porting
- the \fCProcess\fR classes.
- .HE
- .br
- .ad l
- 'ft I
- .OC
- .sp 1
- 3.2 Edit \f(COObject.h
- .ad b
- 'ft R
- .OC
- .sp 1
- The file \fCObject.h\fR defines three versions of a preprocessor macro named \fCSTRINGIZE\fR,
- which forms some symbol names by concatenating the class name argument with other strings.
- Each version does this a different way. The version for use with ANSI C preprocessors,
- conditionalized on the symbol \fC__STDC__\fR, uses \fC##\fR for concatenation. If you are not
- using an ANSI C preprocessor, defining the symbol \fCBS_NL\fR in \fCObject.h\fR selects the version
- that uses the sequence \fC\\\fR<newline> as the concatenation separator, which seems to work
- with most System V UNIX systems. If you do not define \fCBS_NL\fR, you get the version of
- DEFINE_CLASS that uses an empty comment sequence (\fC/**/\fR), which works with most Berkeley
- UNIX systems.\fC
- .OC
- .sp 1
- Object.h\fR should require no editing on most systems.
- .HE
- .br
- .ad l
- 'ft B
- .OC
- .sp 1
- 4. Install error message facility
- .ad b
- 'ft R
- .OC
- .sp 1
- (Skip this step for MASSCOMP/RTU)
- 'in 72p
- .br
- .ad l
- 'ft C
- .OC
- .sp 1
- su (if installing in protected directory)
- .OC
- .br
- make errorfacility
- 'in 36p
- .ad b
- 'ft R
- .OC
- .sp 1
- This builds an error message registery facility and error processing library similar
- to \fCerrcom\fR and the 3E library routines on the MASSCOMP.
- .OC
- .sp 1
- The \fCerrgen\fR program reads a \fC.err\fR file to determine a facility name, and then reads
- the file \fC${ERRTABDIR}/errgen_tab\fR to lookup the number assigned to that facility. The
- facility number determines the high-order bits of the error numbers which \fCerrgen\fR assigns,
- assuring that error numbers used by different libraries do not coincide. Errgen produces
- a \fC.h\fR file containing error symbols and their assigned numbers, and a \fC.c\fR file containing
- a table of error messages and formatting information.
- .OC
- .sp 1
- This step creates a module containing the error handling library routines named \fCerrors.o\fR
- and adds it to \fC${CLIBDIR}/${LIB_ID}.a\fR, and it copies the files \fCerrlib.h\fR and \fCerrors.h\fR
- into the directory \fC${ERRINCDIR}.\fR
- .OC
- .sp 1
- The test program testerr on \fCNIHCL/errfac\fR verifies that the error facilities have been
- built correctly. It returns the first and last error defined in the file \fCtesterrs.err\fR.
- .HE
- .br
- .ad l
- 'ft B
- .OC
- .sp 2
- 5. Build the NIH Class Library, Vector classes, and test suite
- .ad b
- 'ft R
- 'in 72p
- .br
- .ad l
- 'ft C
- .OC
- .sp 1
- make
- 'in 36p
- .ad b
- 'ft R
- .HE
- .br
- .ad l
- 'ft B
- .OC
- .sp 2
- 6. Test the NIH Class Library
- .ad b
- 'ft R
- 'in 72p
- .br
- .ad l
- 'ft C
- .OC
- .sp 1
- make verify
- 'in 36p
- .ad b
- 'ft R
- .OC
- .sp 1
- This runs the test suite and compares the output of each test program with the contents
- of a \fC.v\fR file containing the correct output. If the program runs correctly, you'll
- see the message "No differences encountered". Some tests such as \fCdate\fR, \fCidentdict\fR, \fC
- process\fR, \fCrandom\fR, \fCstack\fR, and \fCtim\fR produce output to the terminal. \fCdate\fR outputs yesterday's,
- today's, and tomorrow's date. \fCidentdict\fR dumps an identity dictionary. \fCrandom\fR prints
- out a list of random numbers. \fCstack\fR prints out a \fCCLTNEMPTY\fR error message to test error
- reporting, and \fCtim\fR prints out the current date and time.
- .OC
- .sp 1
- The \fCerror\fR test program frequently fails to compare because its output depends upon
- memory addresses that change from implementation to implementation. \fCerror\fR should differ
- only in the object address printed in the \fCCLTNEMPTY\fR error message.
- .OC
- .sp 1
- The output of \fCfdset\fR depends upon the maximum number of allowable file descriptors
- on your system. The test output was generated under SunOS 4.0, which has a limit of
- 64 file descriptors.
- .OC
- .sp 1
- Several tests that print floating point numbers may fail to compare due to formatting
- differences.
- .OC
- .sp 1
- The byte size of the object printed by ex8-1 may vary for different systems. The
- test output was produced by a Sun-3.
- .HE
- .br
- .ad l
- 'ft B
- .OC
- .sp 2
- 7. Build the NIH Class Library, Vector classes, and test suite with multiple inheritance
- support
- .ad b
- 'ft R
- 'in 72p
- .br
- .ad l
- 'ft C
- .OC
- .sp 1
- make cleantest
- .OC
- .br
- make mi
- 'in 36p
- .ad b
- 'ft R
- .HE
- .br
- .ad l
- 'ft B
- .OC
- .sp 2
- 8. Test the NIH Class Library, Vector classes, and test suite with multiple inheritance
- support
- .ad b
- 'ft R
- 'in 72p
- .br
- .ad l
- 'ft C
- .OC
- .sp 1
- make verify
- 'in 36p
- .ad b
- 'ft R
- .OC
- .sp 1
- This runs the same tests as in Step 6, with similar results.
- .HE
- .br
- .ad l
- 'ft B
- .OC
- .sp 2
- 9. Install the NIH Class Libraries
- .ad b
- 'ft R
- 'in 72p
- .br
- .ad l
- 'ft C
- .OC
- .sp 1
- su (if installing in protected directory)
- .OC
- .br
- make install
- 'in 36p
- .ad b
- 'ft R
- .OC
- .sp 1
- The NIH Class Library archives \fClibnihcl.a\fR, \fClibnihclmi.a\fR, \fClibnihclvec.a\fR, and \fClibnihclvecmi.a\fR
- are copied to \fC${NIHCLLIBDIR}\fR and \fCranlib\fR is executed on the libraries. All header files
- for basic classes are copied to directory \fC${NIHCLINCDIR}\fR.
- .HE
- .br
- .ad l
- 'ft B
- .OC
- .sp 2
- 10. Build example programs
- .ad b
- 'ft R
- 'in 72p
- .br
- .ad l
- 'ft C
- .OC
- .sp 1
- make examples
- 'in 36p
- .ad b
- 'ft R
- .HE
- .br
- .ad l
- 'ft B
- .OC
- .sp 2
- 11. Test example programs
- .ad b
- 'ft R
- 'in 72p
- .br
- .ad l
- 'ft C
- .OC
- .sp 1
- make exverify
- 'in 36p
- .ad b
- 'ft R
- .HE
- .br
- .ad l
- 'ft B
- .ps 14
- .OC
- .sp 2
- .vs 16
- TROUBLE SHOOTING
- .ad b
- 'ft R
- .ps 12
- .HE
- .br
- .ad l
- 'ft B
- .OC
- .sp 1
- .vs 14
- YACC stack overflows
- .ad b
- 'ft R
- .OC
- .sp 1
- Some test programs may fail to compile because they are too complicated for your C
- compiler and get a "yacc stack overflow". Either increase the table space in your
- C compiler or simplify the program by breaking it up into separate functions. The
- inline copy constructors that Release 2.0 automatically generates are frequently the
- source of this error. Explicitly defining non-inline copy constructors solves the
- problem. See the \fIRelease Notes\fR for further details.
- .HE
- .br
- .ad l
- 'ft B
- .OC
- .sp 1
- Problems with class Exception
- .ad b
- 'ft R
- .OC
- .sp 1
- Test programs error and except test class \fCException\fR, the the NIH Class Library exception
- handler. If these programs fail to perform correctly suspicion can be directed to the
- performance of system functions \fCsetjmp()\fR and \fClongjmp()\fR.
- .HE
- .br
- .ad l
- 'ft B
- .OC
- .sp 1
- Problems with Process classes
- .ad b
- 'ft R
- .OC
- .sp 1
- Progams \fCprocess\fR and \fCstackproc\fR test the NIH Class Library co-routine mechanism (classes \fC
- Process\fR, \fCHeapProc\fR, \fCStackProc\fR, and \fCScheduler\fR), the object queue (class \fCSharedQueue\fR)
- and semaphore (class \fCSemaphore\fR). These are machine-dependent and rely on the presence
- of \fCalloca()\fR, which all systems do not provide, and on \fCsetjmp()\fR/\fClongjmp()\fR being implemented
- by saving/restoring all machine registers, which is not always the case for all systems
- either. If the \fCprocess\fR or \fCstackproc\fR tests fail to compile, link, or run, check your
- system's implementations of \fCalloca()\fR \fCsetjmp()\fR, and \fClongjmp()\fR -- you may need to implement
- your own versions.
-