Back to index

cell-binutils  2.17cvs20070401
source.h
Go to the documentation of this file.
00001 /* source.h
00002 
00003    Copyright 2000, 2001, 2002, 2004 Free Software Foundation, Inc.
00004 
00005 This file is part of GNU Binutils.
00006 
00007 This program is free software; you can redistribute it and/or modify
00008 it under the terms of the GNU General Public License as published by
00009 the Free Software Foundation; either version 2 of the License, or
00010 (at your option) any later version.
00011 
00012 This program is distributed in the hope that it will be useful,
00013 but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015 GNU General Public License for more details.
00016 
00017 You should have received a copy of the GNU General Public License
00018 along with this program; if not, write to the Free Software
00019 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
00020 
00021 #ifndef source_h
00022 #define source_h
00023 
00024 typedef struct source_file
00025   {
00026     struct source_file *next;
00027     const char *name;              /* Name of source file.  */
00028     unsigned long ncalls;   /* # of "calls" to this file.  */
00029     int num_lines;          /* # of lines in file.  */
00030     int nalloced;           /* Number of lines allocated.  */
00031     void **line;            /* Usage-dependent per-line data.  */
00032   }
00033 Source_File;
00034 
00035 /* Options.  */
00036 
00037 /* Create annotated output files?  */
00038 extern bfd_boolean create_annotation_files;
00039 
00040 /* List of directories to search for source files.  */
00041 extern Search_List src_search_list;
00042 
00043 /* Chain of source-file descriptors.  */
00044 extern Source_File *first_src_file;
00045 
00046 /* Returns pointer to source file descriptor for PATH/FILENAME.  */
00047 extern Source_File *source_file_lookup_path (const char *);
00048 extern Source_File *source_file_lookup_name (const char *);
00049 
00050 /* Read source file SF output annotated source.  The annotation is at
00051    MAX_WIDTH characters wide and for each source-line an annotation is
00052    obtained by invoking function ANNOTE.  ARG is an argument passed to
00053    ANNOTE that is left uninterpreted by annotate_source().
00054 
00055    Returns a pointer to the output file (which maybe stdout) such
00056    that summary statistics can be printed.  If the returned file
00057    is not stdout, it should be closed when done with it.  */
00058 extern FILE *annotate_source
00059   (Source_File *sf, unsigned int max_width,
00060           void (*annote) (char *, unsigned int, int, PTR arg),
00061           PTR arg);
00062 #endif /* source_h */