1139825Simp/* source.h
282899Sjake
380708Sjake   Copyright (C) 2000-2017 Free Software Foundation, Inc.
480708Sjake
582899Sjake   This file is part of GNU Binutils.
682899Sjake
782899Sjake   This program is free software; you can redistribute it and/or modify
882899Sjake   it under the terms of the GNU General Public License as published by
980708Sjake   the Free Software Foundation; either version 3 of the License, or
1080708Sjake   (at your option) any later version.
1180708Sjake
1280708Sjake   This program is distributed in the hope that it will be useful,
1380708Sjake   but WITHOUT ANY WARRANTY; without even the implied warranty of
1480708Sjake   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1580708Sjake   GNU General Public License for more details.
1680708Sjake
1782899Sjake   You should have received a copy of the GNU General Public License
1882899Sjake   along with this program; if not, write to the Free Software
1982899Sjake   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
2080708Sjake   MA 02110-1301, USA.  */
2182899Sjake
2280708Sjake#ifndef source_h
2380708Sjake#define source_h
2482899Sjake
2580708Sjaketypedef struct source_file
2680708Sjake  {
2780708Sjake    struct source_file *next;
2880708Sjake    const char *name;		/* Name of source file.  */
2980708Sjake    unsigned long ncalls;	/* # of "calls" to this file.  */
3080708Sjake    int num_lines;		/* # of lines in file.  */
3180708Sjake    int nalloced;		/* Number of lines allocated.  */
3280708Sjake    void **line;		/* Usage-dependent per-line data.  */
3382899Sjake  }
3482899SjakeSource_File;
3582899Sjake
3680708Sjake/* Options.  */
3780708Sjake
3880708Sjake/* Create annotated output files?  */
3980708Sjakeextern bfd_boolean create_annotation_files;
4080708Sjake
4180708Sjake/* List of directories to search for source files.  */
42104265Sjakeextern Search_List src_search_list;
43222813Sattilio
44133451Salc/* Chain of source-file descriptors.  */
45133451Salcextern Source_File *first_src_file;
46237627Salc
47112399Sjake/* Returns pointer to source file descriptor for PATH/FILENAME.  */
4880709Sjakeextern Source_File *source_file_lookup_path (const char *);
4980709Sjakeextern Source_File *source_file_lookup_name (const char *);
5080709Sjake
5180709Sjake/* Read source file SF output annotated source.  The annotation is at
5280709Sjake   MAX_WIDTH characters wide and for each source-line an annotation is
5380709Sjake   obtained by invoking function ANNOTE.  ARG is an argument passed to
5483053Sobrien   ANNOTE that is left uninterpreted by annotate_source().
55108166Sjake
56108166Sjake   Returns a pointer to the output file (which maybe stdout) such
57108166Sjake   that summary statistics can be printed.  If the returned file
58108166Sjake   is not stdout, it should be closed when done with it.  */
59108166Sjakeextern FILE *annotate_source
6080708Sjake  (Source_File *sf, unsigned int max_width,
6180708Sjake	   void (*annote) (char *, unsigned int, int, PTR arg),
6283053Sobrien	   PTR arg);
63133451Salc#endif /* source_h */
6488651Sjake