;+ ; NAME: ; www_help_get_calls ; PURPOSE: ; Controls collection of information from all CALLS sections ; CATEGORY: ; www_help ; CALLING SEQUENCE: PRO www_help_get_calls, style, header, section, this_section, calls=calls ; INPUTS: ; style array[1]; type: structure ; www_help_style structure ; style.automatic and style.html_top[1] are used ; Also passed to www_help_is_section and www_help_calls ; (which use style.anycase and style.commentchar) ; header array; type: structure ; all the headers ; section array; type: string ; list of valid section headings ; this_section scalar; type: string ; entry from 'section' array for CALLS ; INCLUDE or EXTERNAL section. ; OUTPUTS: ; calls=calls scalar; type: pointer to heap variable ; information from all CALLS sections ; header if style.automatic is set the automatically determined ; list of called procedures is added to header.calls. ; INCLUDE: @compile_opt.pro ; On error, return to caller ; CALLS: ; www_help_calls, www_help_is_section, www_help_get_info ; PROCEDURE: ; Looks for 'this_section' in each header, and stores the information in 'calls'. ; The content of the 'calls' structure is described in www_help_calls. ; MODIFICATION HISTORY: ; JAN-2001, Paul Hick (UCSD/CASS; pphick@ucsd.edu) ;- ; First check whether 'this_section' is present in 'section'. ; If it is not then don't build the 'calls' heap (this is needed for www_help_get_calls) IF www_help_is_section(style, this_section, section) NE -1 THEN BEGIN automatic = style.automatic AND this_section EQ 'CALLS:' IF automatic THEN message, /info, 'trying automatic CALLS: determination' FOR ithis=0L,n_elements(header)-1 DO BEGIN ; First try automatic way finding function/procedure references ; (ONLY FOR CALLS: section!!). Will not always work (e.g. IDL main programs). CASE automatic OF 0: nline = 0 1: BEGIN line = www_help_get_info(header[ithis].name, header[ithis].origin[0], $ style.idl_path, count=nline) header[ithis].auto = nline GT 0 END ENDCASE ; If the automatic method succeeded (nline > 0) then add the list of ; procedures to the calls structure; if not (nline = 0) then try to extract ; the information from the header itself by looking for a CALLS section. IF automatic AND header[ithis].auto THEN BEGIN nline = www_help_calls(style, line, ithis, header, section, this_section, calls=calls) ENDIF ELSE BEGIN nline = header[ithis].nline lines = *header[ithis].lines iline = www_help_is_section(style, this_section, lines) IF iline NE -1 AND iline LT nline-1 THEN $ REPEAT iline = iline+1 $ UNTIL (NOT www_help_calls(style, lines[iline], ithis, header, section, $ this_section, calls=calls)) OR iline EQ nline-1 ENDELSE ENDFOR ENDIF RETURN & END