1$! The following extracts documentation from pgplot source files.
2$!
3$! This procedure assumes the current configuration's drivers.list is
4$! in the current default directory.
5$!
6$! The following files are created:
7$!
8$! pgplot.index - a listing of routine names and short descriptions,
9$!                one routine per line
10$! pgplot.doc -   documentation extracted from source files,
11$!                one routine per page
12$! pgplot.hlp -   VMS help file showing routines and drivers
13$
14$ on error then $ goto abort
15$ on severe_error then $ goto abort
16$ on control_y then $ goto abort
17$ pgplot = p1
18$ src = pgplot - "]" + ".src]"
19$ file_list = "''src'pg*.f"
20$ ff[0,8] = 12
21$ tab[0,8] = 9
22$ copy sys$input pgplot.hlp
231 PGPLOT
24  PGPLOT GRAPHICS SUBROUTINE LIBRARY Version 5.1
25
26  PGPLOT is a Fortran subroutine package for drawing graphs on a variety
27  of display devices. For more details, see the manual ``PGPLOT Graphics
28  Subroutine Library'' available from T. J. Pearson
29  (tjp@astro.caltech.edu).
30
312 Routines
32
33$ open/append hlp_file pgplot.hlp
34$ create pgplot.hlp3
35$ open/append hlp3_file pgplot.hlp3
36$ create pgplot.index
37$ open/append index_file pgplot.index
38$ create pgplot.doc
39$ open/append doc_file pgplot.doc
40$ next_file:
41$ file_name = f$search (file_list)
42$ if file_name .eqs. "" then $ goto last_file
43$ open/read src_file 'file_name'
44$ read src_file title
45$ if f$edit (f$extract (0, 2, title), "upcase") .nes. "C*" -
46      then $ goto end_file
47$ write index_file f$extract (2, 255, title)
48$ write doc_file ff
49$ write doc_file title
50$ look_for_doc:
51$ read/end=end_file src_file line
52$ write doc_file line
53$ if f$edit (f$extract (0, 2, line), "upcase") .nes. "C+" -
54      then $ goto look_for_doc
55$ write hlp_file  "  " + f$extract (2, 255, title)
56$ write hlp3_file "3 " + f$element (0, " ", f$extract (2, 255, title))
57$ write hlp3_file "  " + f$extract (2, 255, title)
58$ read_doc:
59$ read/end=no_end src_file line
60$ write doc_file line
61$ if f$edit (f$extract (0, 2, line), "upcase") .eqs. "C-" -
62      then $ goto end_file
63$ write hlp3_file " " + f$extract (1, 255, line)
64$ goto read_doc
65$
66$ no_end:
67$ write sys$output "No C- in ''file_name'"
68$
69$ end_file:
70$ close src_file
71$ goto next_file
72$
73$ last_file:
74$ close hlp_file
75$ close hlp3_file
76$ close index_file
77$ close doc_file
78$ append pgplot.hlp3 pgplot.hlp
79$ delete pgplot.hlp3;*
80$
81$ open/read drivers_file drivers.list
82$ open/append hlp_file pgplot.hlp
83$ write hlp_file "2 Drivers"
84$ write hlp_file "  The following drivers are supported on this system:"
85$ write hlp_file ""
86$ write hlp_file "  File       Code       Description"
87$ open/read drivers_file drivers.list
88$ next_driver:
89$ read/end=last_driver drivers_file driver
90$ if f$extract (0, 1, driver) .nes. " " then $ goto next_driver
91$ len = f$locate (tab, driver) ! tab is end of line
92$ write hlp_file " " + f$extract (1, len-1, driver)
93$ goto next_driver
94$ last_driver:
95$ close hlp_file
96$ close drivers_file
97$ exit (1)
98$
99$ abort:
100$ write sys$output file_name
101$ close src_file
102$ close drivers_file
103$ close hlp_file
104$ close hlp3_file
105$ close index_file
106$ close doc_file
107$ exit (0)
108