1*a9fa9459Szrj /* source.h 2*a9fa9459Szrj 3*a9fa9459Szrj Copyright (C) 2000-2016 Free Software Foundation, Inc. 4*a9fa9459Szrj 5*a9fa9459Szrj This file is part of GNU Binutils. 6*a9fa9459Szrj 7*a9fa9459Szrj This program is free software; you can redistribute it and/or modify 8*a9fa9459Szrj it under the terms of the GNU General Public License as published by 9*a9fa9459Szrj the Free Software Foundation; either version 3 of the License, or 10*a9fa9459Szrj (at your option) any later version. 11*a9fa9459Szrj 12*a9fa9459Szrj This program is distributed in the hope that it will be useful, 13*a9fa9459Szrj but WITHOUT ANY WARRANTY; without even the implied warranty of 14*a9fa9459Szrj MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15*a9fa9459Szrj GNU General Public License for more details. 16*a9fa9459Szrj 17*a9fa9459Szrj You should have received a copy of the GNU General Public License 18*a9fa9459Szrj along with this program; if not, write to the Free Software 19*a9fa9459Szrj Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, 20*a9fa9459Szrj MA 02110-1301, USA. */ 21*a9fa9459Szrj 22*a9fa9459Szrj #ifndef source_h 23*a9fa9459Szrj #define source_h 24*a9fa9459Szrj 25*a9fa9459Szrj typedef struct source_file 26*a9fa9459Szrj { 27*a9fa9459Szrj struct source_file *next; 28*a9fa9459Szrj const char *name; /* Name of source file. */ 29*a9fa9459Szrj unsigned long ncalls; /* # of "calls" to this file. */ 30*a9fa9459Szrj int num_lines; /* # of lines in file. */ 31*a9fa9459Szrj int nalloced; /* Number of lines allocated. */ 32*a9fa9459Szrj void **line; /* Usage-dependent per-line data. */ 33*a9fa9459Szrj } 34*a9fa9459Szrj Source_File; 35*a9fa9459Szrj 36*a9fa9459Szrj /* Options. */ 37*a9fa9459Szrj 38*a9fa9459Szrj /* Create annotated output files? */ 39*a9fa9459Szrj extern bfd_boolean create_annotation_files; 40*a9fa9459Szrj 41*a9fa9459Szrj /* List of directories to search for source files. */ 42*a9fa9459Szrj extern Search_List src_search_list; 43*a9fa9459Szrj 44*a9fa9459Szrj /* Chain of source-file descriptors. */ 45*a9fa9459Szrj extern Source_File *first_src_file; 46*a9fa9459Szrj 47*a9fa9459Szrj /* Returns pointer to source file descriptor for PATH/FILENAME. */ 48*a9fa9459Szrj extern Source_File *source_file_lookup_path (const char *); 49*a9fa9459Szrj extern Source_File *source_file_lookup_name (const char *); 50*a9fa9459Szrj 51*a9fa9459Szrj /* Read source file SF output annotated source. The annotation is at 52*a9fa9459Szrj MAX_WIDTH characters wide and for each source-line an annotation is 53*a9fa9459Szrj obtained by invoking function ANNOTE. ARG is an argument passed to 54*a9fa9459Szrj ANNOTE that is left uninterpreted by annotate_source(). 55*a9fa9459Szrj 56*a9fa9459Szrj Returns a pointer to the output file (which maybe stdout) such 57*a9fa9459Szrj that summary statistics can be printed. If the returned file 58*a9fa9459Szrj is not stdout, it should be closed when done with it. */ 59*a9fa9459Szrj extern FILE *annotate_source 60*a9fa9459Szrj (Source_File *sf, unsigned int max_width, 61*a9fa9459Szrj void (*annote) (char *, unsigned int, int, PTR arg), 62*a9fa9459Szrj PTR arg); 63*a9fa9459Szrj #endif /* source_h */ 64