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