/usr/share/gnudatalanguage/lib/doc_library.pro is in libgnudatalanguage0 0.9.6v2-1build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 | ;+
; NAME:
; DOC_LIBRARY
;
; PURPOSE:
; Extract and display documentation headers from a program or routine.
;
; CATEGORY:
; Documentation
;
; CALLING SEQUENCE:
; DOC_LIBRARY, procedure
;
; INPUTS:
; procedure STRING The procedure to document.
;
; KEYWORD PARAMETERS:
; /print Set to print the output to the default printer.
;
; SIDE EFFECTS:
; A file is created in /tmp and deleted after use.
;
; RESTRICTIONS:
; Only one documentation block per file is handled.
;
; EXAMPLE:
; DOC_LIBRARY, 'doc_library'
;
; MODIFICATION HISTORY:
; Original: 2013-March-28; SJT (see Feature Requests 3606434)
;
; LICENCE:
; This code in under GNU GPL v2 or later
;
;-
pro DOC_LIBRARY, proc, print = print, test=test
ON_ERROR, 2
if (!version.os_family ne 'unix') then begin
print, "DOC_LIBRARY is currently only available for Unix like systems"
return
endif
if (KEYWORD_SET(print)) then begin
less = FILE_WHICH(getenv('PATH'), 'lp')
if (less eq '') then less = FILE_WHICH(GETENV('PATH'), 'lpr')
if (less eq '') then begin
print, "Neither lp nor lpr was found"
return
endif
endif else begin
less = FILE_WHICH(GETENV('PATH'), 'less')
if (less eq '') then less = FILE_WHICH(GETENV('PATH'), 'more')
if (less eq '') then begin
print, "Neither more nor less was found"
return
endif
endelse
proc_path = FILE_WHICH(proc+'.pro', /include_current)
if (proc_path eq '') then begin
print, proc, ' not found'
return
endif
out_name = '/tmp/'+proc+'.txt'
OPENR, ipu, proc_path, /get
dflag = 0b
inln = ''
OPENW, isu, out_name, /get
while (~EOF(ipu)) do begin
READF, ipu, inln
inln = STRTRIM(inln, 2)
if (STRPOS(inln, ';+') eq 0) then dflag = 1b
if (STRPOS(inln, ';-') eq 0) then break
;;
if dflag then printf, isu, STRMID(inln, 1)
endwhile
;
FREE_LUN, isu, ipu
;
SPAWN, less+' '+out_name
;
FILE_DELETE, out_name
;
if KEYWORD_SET(test) then STOP
;
end
|