source: trunk/src/binutils/gprof/source.h@ 106

Last change on this file since 106 was 10, checked in by bird, 22 years ago

Initial revision

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