/usr/share/gnudatalanguage/lib/doc_library.pro is in libgnudatalanguage0 0.9.7-6.
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 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 | ;+
; 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.
; /nowait read documentation in another window while GDL session goes on.
; SIDE EFFECTS:
; A file is created in /tmp and deleted after use (unless /nowait is successful).
;
; 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)
; Mods for win32 2015-May-18 G. Jung
; /NOWAIT keyword for win32 (Windows) and 'X' (unix)
; LICENCE:
; This code in under GNU GPL v2 or later
;
pro DOC_LIBRARY, proc, print = print, test=test, nowait=nowait
;-
if ~keyword_set(test) then ON_ERROR, 2
addexe="" & tempprefix="/tmp/"
if (!version.os_family eq 'Windows') then begin
addexe=".EXE"
tempprefix=getenv("TEMP")+"\"
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'+addexe)
if (less eq '') then less = FILE_WHICH(GETENV('PATH'), 'more'+addexe)
if (less eq '') then begin
if (!version.os_family eq 'Windows') then less='more' $
else begin
print, "Neither more nor less was found"
return
endelse
endif
endelse
proc_path = FILE_WHICH(proc+'.pro', /include_current)
if (proc_path eq '') then begin
print, proc, ' not found'
return
endif
out_name = tempprefix+proc+'.txt'
OPENR, ipu, proc_path, /get
dflag = 0b
inln = ''
OPENW, isu, out_name, /get
dflag=0
while (~EOF(ipu)) do begin
READF, ipu, inln
inln = STRTRIM(inln, 2)
if (STRPOS(inln, ';') eq 0) then begin
if (STRPOS(inln, ';+') eq 0) then dflag = 1b
if (STRPOS(inln, ';-') eq 0) then break
inln = strmid(inln,1)
endif else if dflag then inln='@>'+inln
;;
if dflag then printf, isu, inln
endwhile
;
free_lun, isu
free_lun, ipu
;FREE_LUN, isu, ipu
;
if(keyword_set(nowait)) then begin
if (!version.os_family eq 'unix') then begin
if(!D.name eq 'X') then $
SPAWN, 'xterm -e '+less+' '+out_name+' &' $
else begin
print," You need !D.name='X' to do that /nowait"
SPAWN, less+' '+out_name
FILE_DELETE, out_name
endelse
endif else SPAWN,/nowait, less+' '+out_name
endif
;
if(not keyword_Set(nowait)) then begin
SPAWN, less+' '+out_name
FILE_DELETE, out_name
endif
;
if KEYWORD_SET(test) then STOP
;
end
|