Newsgroups: alt.sources From: lamping@parc.xerox.com (John Lamping) Subject: pindex: PostScript man page Message-ID: <1991Jul16.224713.19043@parc.xerox.com> Date: Tue, 16 Jul 1991 22:47:13 GMT Here is a PostScript man page for pindex. It's in a shell archive. #! /bin/sh # This is a shell archive. Remove anything before this line, then feed it # into a shell via "sh file" or similar. To overwrite existing files, # type "sh file -c". # The tool that generated this appeared in the comp.sources.unix newsgroup; # send mail to comp-sources-unix@uunet.uu.net if you want that tool. # If this archive is complete, you will see the following message at the end: # "End of shell archive." # Contents: pindex.ps # Wrapped by rice@groupw on Tue Jul 16 18:06:33 1991 PATH=/bin:/usr/bin:/usr/ucb ; export PATH if test -f 'pindex.ps' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'pindex.ps'\" else echo shar: Extracting \"'pindex.ps'\" \(11243 characters\) sed "s/^X//" >'pindex.ps' <<'END_OF_FILE' X%!PS-Adobe-2.1 X%%Creator: groff version 1.01 X%%DocumentFonts: Courier Times-Italic Times-Bold Times-Roman X%%DocumentSuppliedFonts: X%%DocumentNeededFonts: Courier Times-Italic Times-Bold Times-Roman X%%Pages: 2 X%%EndComments X/grops 100 dict def grops begin X%! X% If you add definitions here, be sure to check that MAX_PROLOGUE_DEFS X% in ps.c is large enough. X X% The ASCII code of the space character. X/SC 32 def X X/A /show load def X/B { 0 SC 3 -1 roll widthshow } bind def X/C { 0 exch ashow } bind def X/D { 0 exch 0 SC 5 2 roll awidthshow } bind def X/E { 0 rmoveto show } bind def X/F { 0 rmoveto 0 SC 3 -1 roll widthshow } bind def X/G { 0 rmoveto 0 exch ashow } bind def X/H { 0 rmoveto 0 exch 0 SC 5 2 roll awidthshow } bind def X/I { 0 exch rmoveto show } bind def X/J { 0 exch rmoveto 0 SC 3 -1 roll widthshow } bind def X/K { 0 exch rmoveto 0 exch ashow } bind def X/L { 0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow } bind def X/M { rmoveto show } bind def X/N { rmoveto 0 SC 3 -1 roll widthshow } bind def X/O { rmoveto 0 exch ashow } bind def X/P { rmoveto 0 exch 0 SC 5 2 roll awidthshow } bind def X/Q { moveto show } bind def X/R { moveto 0 SC 3 -1 roll widthshow } bind def X/S { moveto 0 exch ashow } bind def X/T { moveto 0 exch 0 SC 5 2 roll awidthshow } bind def X X% name size font SF - X X/SF { X findfont exch X [ exch dup 0 exch 0 exch neg 0 0 ] makefont X dup setfont X [ exch /setfont cvx ] cvx bind def X} bind def X X% name a c d font MF X X/MF { X findfont X [ 5 2 roll X 0 3 1 roll % b X neg 0 0 ] makefont X dup setfont X [ exch /setfont cvx ] cvx bind def X} bind def X X X% BP - X X/BP { X /level0 save def X 1 setlinecap X 1 setlinejoin X 72 RES div dup scale X LS { X 90 rotate X } { X 0 PL translate X } ifelse X 1 -1 scale X} bind def X X/EP { X level0 restore X showpage X} bind def X X X% centerx centery radius startangle endangle DA - X X/DA { X newpath arcn stroke X} bind def X X% x y SN - x' y' X% round a position to nearest (pixel + (.25,.25)) X X/SN { X transform X .25 sub exch .25 sub exch X round .25 add exch round .25 add exch X itransform X} bind def X X% endx endy startx starty DL - X% we round the endpoints of the line, so that parallel horizontal X% and vertical lines will appear even X X/DL { X SN X moveto X SN X lineto stroke X} bind def X X% centerx centery radius DC - X X/DC { X newpath 0 360 arc closepath X} bind def X X X/TM matrix def X X% width height centerx centery DE - X X/DE { X TM currentmatrix pop X translate scale newpath 0 0 .5 0 360 arc closepath X TM setmatrix X} bind def X X% these are for splines X X/RC /rcurveto load def X/RL /rlineto load def X/ST /stroke load def X/MT /moveto load def X/CL /closepath load def X X% fill the last path X X% amount FL - X X/FL { X currentgray exch setgray fill setgray X} bind def X X% fill with the ``current color'' X X/BL /fill load def X X/LW /setlinewidth load def X% new_font_name encoding_vector old_font_name RE - X X/RE { X findfont X dup maxlength dict begin X { X 1 index /FID ne { def } { pop pop } ifelse X } forall X /Encoding exch def X dup /FontName exch def X currentdict end definefont pop X} bind def X X% hpos vpos EBEGIN - X X/EBEGIN { X moveto X DEFS begin X} bind def X X/EEND /end load def X X% llx lly newwid wid newht ht newllx newlly - X X/PICTURE { X translate X div 3 1 roll div exch scale X neg exch neg exch translate X % set the graphics state to default values X 0 setgray X 0 setlinecap X 1 setlinewidth X 0 setlinejoin X 10 setmiterlimit X [] 0 setdash X newpath X} bind def X/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end end X%%EndProlog X%%IncludeFont: Courier X%%IncludeFont: Times-Italic X%%IncludeFont: Times-Bold X%%IncludeFont: Times-Roman X%%BeginSetup Xgrops begin/#copies 1 def/RES 72 def/PL 792 def/LS false def/ENC0[/asciicircum X/asciitilde/Scaron/Zcaron/scaron/zcaron/Ydieresis/trademark/.notdef/.notdef X/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef X/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef X/.notdef/.notdef/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar X/percent/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen X/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon/semicolon X/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O/P/Q/R/S/T/U/V/W/X X/Y/Z/bracketleft/backslash/bracketright/circumflex/underscore/quoteleft/a/b/c/d X/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/braceleft/bar/braceright/tilde X/.notdef/quotesinglbase/guillemotleft/guillemotright/bullet/florin/fraction X/perthousand/dagger/daggerdbl/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj X/grave/hungarumlaut/dotaccent/breve/caron/ring/ogonek/quotedblleft X/quotedblright/oe/lslash/quotedblbase/OE/Lslash/.notdef/exclamdown/cent X/sterling/currency/yen/brokenbar/section/dieresis/copyright/ordfeminine X/guilsinglleft/logicalnot/minus/registered/macron/degree/plusminus/twosuperior X/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior X/ordmasculine/guilsinglright/onequarter/onehalf/threequarters/questiondown X/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE/Ccedilla/Egrave/Eacute X/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex/Idieresis/Eth/Ntilde/Ograve X/Oacute/Ocircumflex/Otilde/Odieresis/multiply/Oslash/Ugrave/Uacute/Ucircumflex X/Udieresis/Yacute/Thorn/germandbls/agrave/aacute/acircumflex/atilde/adieresis X/aring/ae/ccedilla/egrave/eacute/ecircumflex/edieresis/igrave/iacute X/icircumflex/idieresis/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis X/divide/oslash/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def X/Courier@0 ENC0/Courier RE/Times-Italic@0 ENC0/Times-Italic RE/Times-Bold@0 XENC0/Times-Bold RE/Times-Roman@0 ENC0/Times-Roman RE X%%EndSetup X%%Page: 1 1 XBP/F0 10/Times-Roman@0 SF 387.74(pindex\(1\) pindex\(1\))72 48 R/F1 9 X/Times-Bold@0 SF(NAME)72 84 Q F0(pindex \255 primitive \214le indexer)108 96 Q XF1(SYNT)72 112.8 Q(AX)-.666 E/F2 10/Times-Bold@0 SF(pindex)108 124.8 Q F0([)2.5 XE F22.5 E/F3 10/Times-Italic@0 SF(number)A F0(])2.5 E F3 X(in\214le out\214le)2.5 E F0([)2.5 E F3(out\214le2 ...)2.5 E F0(])5 E F1 X(DESCRIPTION)72 146.4 Q F3(Pindex)108 158.4 Q F0 .066 X(takes an input \214le and produces from it an indexed version.)3.399 F .065 X(In the default case, it assumes that each)5.066 F(line of the input \214le is\ X one record, and writes to the \(sole\) output \214le a \214le of the followin\ Xg format:)108 170.4 Q 11.5<8354>108 187.2 S X(he \214rst long int is the number of items in the \214le \(call it)129.11 X187.2 Q F3(n)2.5 E F0(\).)A 11.5<8354>108 204 S .446(he next)129.11 204 R F3(n) X2.946 E F0 .447(long ints are the byte indexes in the output \214le of the sta\ Xrt of each item.)2.946 F .447(If you're trying to)5.447 F .542(get the)123 216 XR F3(i)3.042 E F0 .542(th item, the)B F3(i)3.042 E F0 .542 X(th index will point at its start, and the \()B F3(i)A F0 .542 X(+1\)th index will point at the byte after its)B(end.)123 228 Q 11.5<8354>108 X244.8 S .016(he next long int is the byte index of an imaginary byte one past \ Xthe last in the \214le.)129.11 244.8 R(It')5.017 E 2.517(sp)-.55 G .017 X(rovided so that)480.526 244.8 R X(you can retrieve the last element in the \214le uniformly)123 256.8 Q(.)-.65 E X11.5<8346>108 273.6 S .792(inally the data items from the input \214le are pre\ Xsented, with no delimiters, in the order in which they)128.56 273.6 R X(appeared in the input \214le.)123 285.6 Q .439(If you specify the \255)108 X302.4 R F3(number)A F0 .44 X(option, the input \214le is to be treated as containing groups of)2.939 F F3 X(number)2.94 E F0 .44(lines, and)2.94 F F3(pindex)108 314.4 Q F0 .423 X(will create)2.923 F F3(number)2.923 E F0 .422(output \214les, one for the \ X\214rst items in each group, one \214le for the second, and so)2.923 F(forth.) X108 326.4 Q F1(OPTIONS)72 343.2 Q F2108 355.2 Q F3(number)A F0 -.35(Tr)133 X367.2 S .484(eat the input \214le as containing groups of).35 F F3(number)2.985 XE F0 .485(lines, and create)2.985 F F3(number)2.985 E F0 .485 X(output \214les, one for the)2.985 F X(\214rst items in each group, one \214le for the second, and so forth.)133 X379.2 Q F1(EXAMPLES)72 400.8 Q F0(If you had a \214le called)108 412.8 Q F3 X(states)2.5 E F0(containing)2.5 E/F4 10/Courier@0 SF(Florida)144 436.8 Q X(Georgia)144 448.8 Q(Peru)144 460.8 Q F0(and issued the command)108 484.8 Q F4 X(pindex states states.pin)144 508.8 Q F0 .84(the resulting)108 532.8 R F3 X(states.pin)3.34 E F0 .84(\214le would have the following contents \(on a big-\ Xendian machine with 32-bit-wide)3.34 F(long ints\):)108 544.8 Q F4 X(\\000 \\000 \\000 \\003 \\000 \\000 \\000 \\024)144 568.8 Q X(\\000 \\000 \\000 \\033 \\000 \\000 \\000 \\042)144 580.8 Q X(\\000 \\000 \\000 \\056)144 592.8 Q 24(Flor)282 592.8 S 24(idaGeorg)162 604.8 XS 24(iaPeru)162 616.8 S F0(If you had a \214le called)108 633.6 Q F3(people)2.5 XE F0(containing)2.5 E F4(Schmoe)144 657.6 Q(Joe)144 669.6 Q(Fishbeck)144 681.6 XQ(Leslie)144 693.6 Q F0(and issued the command)108 717.6 Q(1)535 768 Q EP X%%Page: 2 2 XBP/F0 10/Times-Roman@0 SF 387.74(pindex\(1\) pindex\(1\))72 48 R/F1 10 X/Courier@0 SF(pindex -2 people lnames.pin fnames.pin)144 84 Q F0(you'd get an) X108 108 Q/F2 10/Times-Italic@0 SF(lnames.pin)2.5 E F0 X(containing \(under the same circumstance as above\):)2.5 E F1 X(\\000 \\000 \\000 \\002 \\000 \\000 \\000 \\020)144 132 Q X(\\000 \\000 \\000 \\026 \\000 \\000 \\000 \\036)144 144 Q 24(SchmoeFi)162 156 XS 24(shbeck)162 168 S F0(and an)108 192 Q F2(fnames.pin)2.5 E F0(containing:) X2.5 E F1(\\000 \\000 \\000 \\002 \\000 \\000 \\000 \\020)144 216 Q X(\\000 \\000 \\000 \\023 \\000 \\000 \\000 \\031)144 228 Q 24(JoeLesli)162 240 XS(e)162 252 Q/F3 9/Times-Bold@0 SF -.999(WA)72 273.6 S(RNINGS).999 E F0 2.5(Al) X108 285.6 S(ine containing only a newline will be treated as EOF)120.5 285.6 Q X5(.\()-.8 G 2.5(It)340.78 285.6 S(old you it was a primitive \214le indexer) X349.39 285.6 Q(.\))-.55 E .131(The number of output \214les)108 302.4 R F2 X(pindex)2.631 E F0 .131 X(can create is limited by the number of \214les your system can have open at) X2.631 F .743(one time.)108 314.4 R .743(\(It would not be dif)5.743 F .743 X(\214cult to enhance)-.18 F F2(pindex)3.243 E F0 .743 X(so that \214le descriptors were reused as necessary to)3.243 F X(get around this.\))108 326.4 Q .268(Exercise caution in the use of)108 343.2 R XF2(pindex)2.768 E F0 1.368 -.55('s o)D .268 X(utput \214les in environments where \214les are shared among machines).55 F X.496(\(as with NFS\).)108 355.2 R .496 X(In the event that such machines have dif)5.496 F .495 X(ferent byte orderings or their C compilers use dif-)-.18 F .409(ferent long i\ Xnt sizes, unexpected results may occur if the programs using the \214les are n\ Xot prepared to com-)108 367.2 R 3.136(pensate. Maybe)108 379.2 R .635(someday \ XI'll cook up an XDR version of this program, if I'm ever in the mood for some) X3.136 F(serious overkill.)108 391.2 Q F3(AUTHOR)72 412.8 Q F0(Brian Rice.)108 X424.8 Q(\(Internet\))108 441.6 Q F2(rice@dg-rtp.dg.com)168 441.6 Q F0(\(UUCP\)) X108 458.4 Q F2(...!mcnc!rti!xyzzy!rice)168 458.4 Q F0(\(BITNET\))108 475.2 Q F2 X(BALOGA@DR)168 475.2 Q(YCAS)-.18 E F0 2.5(Iw)108 492 S X(ould appreciate your notifying me of any bugs you discover)121.05 492 Q(.)-.55 XE F3(COPYRIGHT)72 513.6 Q F0(This program is in the public domain.)108 525.6 Q X(Everyone may use it as he or she sees \214t.)5 E(2)535 768 Q EP X%%Trailer Xend END_OF_FILE echo shar: NEWLINE appended to \"'pindex.ps'\" if test 11244 -ne `wc -c <'pindex.ps'`; then echo shar: \"'pindex.ps'\" unpacked with wrong size! fi # end of 'pindex.ps' fi echo shar: End of shell archive. exit 0