prfile 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. #!/bin/rc
  2. switch($#*){
  3. case 1
  4. outfile = $1
  5. infile = $1.ms
  6. case *
  7. outfile = $1
  8. shift
  9. infile = $*
  10. }
  11. FONTS='.FP lucidasans'
  12. MACS ='.de BT
  13. .nr PX \\n(.s
  14. .nr PF \\n(.f
  15. .nr Bt 1
  16. .ft 1
  17. .ps \\n(PS
  18. ''lt \\n(LTu
  19. .po \\n(POu
  20. .if \\n%>0 .tl \(ts\\*(LF\(ts\\*(CF\(ts\\*(RF\(ts
  21. .ft \\n(PF
  22. .ps \\n(PX
  23. ..
  24. .de PT
  25. .lt \\n(LLu
  26. .pc %
  27. .nr PN \\n%
  28. .nr Ps \\n(PS-1
  29. .if \\n(Bt>0 .if e .tl @\\n% \s\\n(Ps\\*(Au\s0@@@
  30. .if \\n(Bt>0 .if o .tl @@@\f2\\*(Tl\\f1 \\n%@
  31. .lt \\n(.lu
  32. ..'
  33. macros = -ms
  34. switch($outfile){
  35. case 8½ acme gfx panel sam
  36. macros = ($macros -mpictures)
  37. }
  38. switch($outfile){
  39. case 9 comp 8½ utf acme
  40. macros = ($macros -mnihongo)
  41. }
  42. fn assemble{
  43. switch($1){
  44. case 9
  45. pageno = 1
  46. title = 'Plan 9 From Bell Labs'
  47. author = 'INTRODUCTION'
  48. case README
  49. pageno = 23
  50. title = '\s-1README\s0'
  51. author = 'INTRODUCTION'
  52. case names
  53. pageno = 29
  54. title = 'The Use of Name Spaces in Plan 9'
  55. author = 'INTRODUCTION'
  56. case net
  57. pageno = 35
  58. title = 'The Organization of Networks in Plan 9'
  59. author = 'INTRODUCTION'
  60. case comp
  61. pageno = 49
  62. title = 'How to Use the Plan 9 C Compiler'
  63. author = 'PROGRAMMING'
  64. case ape
  65. pageno = 63
  66. title = 'APE \(em The ANSI/POSIX Environment'
  67. author = 'PROGRAMMING'
  68. case ug
  69. pageno = 67
  70. title = 'Alef User''s Guide'
  71. author = 'PROGRAMMING'
  72. case alef
  73. pageno = 103
  74. title = 'Alef Language Reference Manual'
  75. author = 'PROGRAMMING'
  76. case acidpaper
  77. pageno = 141
  78. title = 'Acid: A Debugger Built From A Language'
  79. author = 'PROGRAMMING'
  80. case acid
  81. pageno = 155
  82. title = 'Acid Manual'
  83. author = 'PROGRAMMING'
  84. case mk
  85. pageno = 181
  86. title = 'Maintaining Files on Plan 9 with Mk'
  87. author = 'PROGRAMMING'
  88. case mkfiles
  89. pageno = 195
  90. title = 'Plan 9 Mkfiles'
  91. author = 'PROGRAMMING'
  92. case asm
  93. pageno = 203
  94. title = 'A Manual for the Plan 9 assembler'
  95. author = 'PROGRAMMING'
  96. case 8½
  97. pageno = 211
  98. title = '8½, the Plan 9 Window System'
  99. author = 'USER INTERFACES'
  100. case rc
  101. pageno = 221
  102. title = 'Rc \(em The Plan 9 Shell'
  103. author = 'USER INTERFACES'
  104. case sam
  105. pageno = 237
  106. title = 'The Text Editor Sam'
  107. author = 'USER INTERFACES'
  108. case acme # actually done in acme/mkfile
  109. pageno = 267
  110. title = 'The Text Editor Sam'
  111. author = 'USER INTERFACES'
  112. case utf
  113. pageno = 283
  114. title = 'Hello World, or \f1\S''12''Καλημέρα κόσμε\fP\S''0'', or \f(Jpこんにちは 世界\fP'
  115. author = 'IMPLEMENTATION'
  116. case compiler
  117. pageno = 295
  118. title = 'Plan 9 C Compilers'
  119. author = 'IMPLEMENTATION'
  120. case libmach
  121. pageno = 305
  122. title = 'Adding Application Support for a New Architecture'
  123. author = 'IMPLEMENTATION'
  124. case fs
  125. pageno = 313
  126. title = 'The Plan 9 File Server'
  127. author = 'IMPLEMENTATION'
  128. case il
  129. pageno = 321
  130. title = 'The IL Protocol'
  131. author = 'IMPLEMENTATION'
  132. case sleep
  133. pageno = 327
  134. title = 'Process Sleep and Wakeup on a Shared-memory Multiprocessor'
  135. author = 'IMPLEMENTATION'
  136. case gfx
  137. pageno = 333
  138. title = 'Raster Graphics in Plan 9'
  139. author = 'MISCELLANY'
  140. case panel
  141. pageno = 343
  142. title = 'A Quick Introduction to the Panel Library'
  143. author = 'MISCELLANY'
  144. case lp
  145. pageno = 363
  146. title = 'A Guide to the Lp Printer Spooler'
  147. author = 'MISCELLANY'
  148. case troff
  149. pageno = 371
  150. title = 'Troff User''s Manual'
  151. author = 'MISCELLANY'
  152. case spin
  153. pageno = 411
  154. title = 'Using SPIN'
  155. author = 'MISCELLANY'
  156. case port
  157. pageno = 439
  158. title = 'The Various Ports'
  159. author = 'INSTALLATION'
  160. case install
  161. pageno = 447
  162. title = 'Installing the Plan 9 Distribution'
  163. author = 'INSTALLATION'
  164. case *
  165. echo $1 page number not known >[2=1]
  166. exit page
  167. }
  168. echo $FONTS
  169. echo .pn $pageno
  170. echo .ds Tl "$title
  171. echo .ds Au "$author
  172. echo $MACS
  173. pic $infile | tbl | eqn
  174. }
  175. assemble $outfile | troff $macros | lp -m.9 -dstdout > $outfile.bs