;+ ; NAME: ; www_help_calls ; PURPOSE: ; Adds the content of 'line' to the information from all CALLS sections ; CATEGORY: ; www_help ; CALLING SEQUENCE: FUNCTION www_help_calls, style, line, ithis, header, section, this_section, calls=calls ; INPUTS: ; style array[1]; type: structure ; www_help_style structure ; passed to www_help_is_text and www_help_is_code ; line scalar; type: string ; line of CALLS section from header ithis ; ithis scalar; type: integer ; header index (index into header array) ; header array; type: structure ; structure with header info ; section array; type: string ; list of valid section headings ; calls=calls scalar; type: pointer to heap variable ; information from CALLS section ; the pointer points to an array of structures ; OUTPUTS: ; calls=calls scalar; type: pointer to heap variable ; updated information from CALLS section ; INCLUDE: @compile_opt.pro ; On error, return to caller ; CALLS: ; www_help_is_text, www_help_is_code, www_help_ptr ; PROCEDURE: ; This procedure is called by www_help_get_calls after the start of the CALLS ; section of header 'ithis' is detected. For the first call 'line' is the first ; line of the section. www_help_get_calls keeps feeding subsequent lines until the return ; value of this procedure indicates that the end of the section has been reached. ; ; The entries into 'calls' are structures defined as follows ; *calls = {www_help_called, ; name:name, index of procedure header into 'header' array ; called_by:ptr_new(/allocate))} headers that have 'name' in their CALLS section. ; ; MODIFICATION HISTORY: ; JAN-2001, Paul Hick (UCSD/CASS) ; FEB-2002, Paul Hick (UCSD/CASS; pphick@ucsd.edu) ; Put management of the 'calls' heap variable in a separate subroutine www_help_ptr ;- on = www_help_is_text(style, line, section) IF on THEN BEGIN header_name = strupcase(header.name) is_code = www_help_is_code(style, line, names, code_front, code_back) ncomma = n_elements(names) IF ncomma GT 0 AND this_section EQ 'CALLS:' THEN BEGIN CASE header[ithis].calls NE '' OF 0: header[ithis].calls = strjoin(names, ', ') 1: header[ithis].calls = strjoin( [header[ithis].calls, names], ', ') ENDCASE ENDIF ; Loop over all routines in 'line'. Add them to 'calls' if headers are available. FOR icomma=0L,ncomma-1 DO $ www_help_ptr, calls, ithis, where(strupcase(names[icomma]) EQ header_name) ENDIF RETURN, on & END