* mild gx prototype tweak
[binutils-gdb.git] / gprof / source.h
blobb33bad3e0a675178a3a743d72cd5b7ff9f4d6226
1 #ifndef source_h
2 #define source_h
4 #include <stdio.h>
5 #include "gprof.h"
6 #include "search_list.h"
8 typedef struct source_file
10 struct source_file *next;
11 const char *name; /* name of source file */
12 unsigned long ncalls; /* # of "calls" to this file */
13 int num_lines; /* # of lines in file */
14 int nalloced; /* number of lines allocated */
15 void **line; /* usage-dependent per-line data */
17 Source_File;
20 * Options:
22 extern bool create_annotation_files; /* create annotated output files? */
25 * List of directories to search for source files:
27 extern Search_List src_search_list;
30 * Chain of source-file descriptors:
32 extern Source_File *first_src_file;
35 * Returns pointer to source file descriptor for PATH/FILENAME.
37 extern Source_File *source_file_lookup_path PARAMS ((const char *path));
38 extern Source_File *source_file_lookup_name PARAMS ((const char *filename));
41 * Read source file SF output annotated source. The annotation is at
42 * MAX_WIDTH characters wide and for each source-line an annotation is
43 * obtained by invoking function ANNOTE. ARG is an argument passed to
44 * ANNOTE that is left uninterpreted by annotate_source().
46 * Returns a pointer to the output file (which maybe stdout) such
47 * that summary statistics can be printed. If the returned file
48 * is not stdout, it should be closed when done with it.
50 extern FILE *annotate_source PARAMS ((Source_File * sf, int max_width,
51 void (*annote) (char *b, int w, int l,
52 void *arg),
53 void *arg));
55 #endif /* source_h */