* gprof.c (main): Conditionally call setlocale.
[deliverable/binutils-gdb.git] / gprof / gprof.h
1 /*
2 * Copyright (c) 1983 Regents of the University of California.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms are permitted
6 * provided that: (1) source distributions retain this entire copyright
7 * notice and comment, and (2) distributions including binaries display
8 * the following acknowledgement: ``This product includes software
9 * developed by the University of California, Berkeley and its contributors''
10 * in the documentation or other materials provided with the distribution
11 * and in all advertising materials mentioning features or use of this
12 * software. Neither the name of the University nor the names of its
13 * contributors may be used to endorse or promote products derived
14 * from this software without specific prior written permission.
15 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
16 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
17 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
18 *
19 * @(#)gprof.h 5.9 (Berkeley) 6/1/90
20 */
21 #ifndef gprof_h
22 #define gprof_h
23
24 #include <ansidecl.h>
25
26 /* Include the BFD sysdep.h file. */
27 #include "sysdep.h"
28
29 /* Undefine the BFD PACKAGE and VERSION macros before including the
30 gprof config.h file. */
31 #undef PACKAGE
32 #undef VERSION
33
34 #include "gconfig.h"
35
36 #ifndef MIN
37 #define MIN(a,b) ((a) < (b) ? (a) : (b))
38 #endif
39 #ifndef MAX
40 #define MAX(a,b) ((a) > (b) ? (a) : (b))
41 #endif
42
43 /* AIX defines hz as a macro. */
44 #undef hz
45
46 #ifndef PATH_MAX
47 #define PATH_MAX 1024
48 #endif
49
50 #define A_OUTNAME "a.out" /* default core filename */
51 #define GMONNAME "gmon.out" /* default profile filename */
52 #define GMONSUM "gmon.sum" /* profile summary filename */
53
54 #ifdef HAVE_LOCALE_H
55 # include <locale.h>
56 #endif
57
58 #ifdef ENABLE_NLS
59 # include <libintl.h>
60 # define _(String) gettext (String)
61 # ifdef gettext_noop
62 # define N_(String) gettext_noop (String)
63 # else
64 # define N_(String) (String)
65 # endif
66 #else
67 /* Stubs that do something close enough. */
68 # define textdomain(String) (String)
69 # define gettext(String) (String)
70 # define dgettext(Domain,Message) (Message)
71 # define dcgettext(Domain,Message,Type) (Message)
72 # define bindtextdomain(Domain,Directory) (Domain)
73 # define _(String) (String)
74 # define N_(String) (String)
75 #endif
76
77 #ifndef LC_MESSAGES
78 # define LC_MESSAGES 0
79 #endif
80
81
82 /*
83 * These may already be defined on some systems. We could probably
84 * just use the BFD versions of these, since BFD has already dealt
85 * with this problem.
86 */
87 #undef FALSE
88 #define FALSE 0
89 #undef TRUE
90 #define TRUE 1
91
92 #define STYLE_FLAT_PROFILE (1<<0)
93 #define STYLE_CALL_GRAPH (1<<1)
94 #define STYLE_SUMMARY_FILE (1<<2)
95 #define STYLE_EXEC_COUNTS (1<<3)
96 #define STYLE_ANNOTATED_SOURCE (1<<4)
97 #define STYLE_GMON_INFO (1<<5)
98 #define STYLE_FUNCTION_ORDER (1<<6)
99 #define STYLE_FILE_ORDER (1<<7)
100
101 #define ANYDEBUG (1<<0) /* 1 */
102 #define DFNDEBUG (1<<1) /* 2 */
103 #define CYCLEDEBUG (1<<2) /* 4 */
104 #define ARCDEBUG (1<<3) /* 8 */
105 #define TALLYDEBUG (1<<4) /* 16 */
106 #define TIMEDEBUG (1<<5) /* 32 */
107 #define SAMPLEDEBUG (1<<6) /* 64 */
108 #define AOUTDEBUG (1<<7) /* 128 */
109 #define CALLDEBUG (1<<8) /* 256 */
110 #define LOOKUPDEBUG (1<<9) /* 512 */
111 #define PROPDEBUG (1<<10) /* 1024 */
112 #define BBDEBUG (1<<11) /* 2048 */
113 #define IDDEBUG (1<<12) /* 4096 */
114 #define SRCDEBUG (1<<13) /* 8192 */
115
116 #ifdef DEBUG
117 #define DBG(l,s) if (debug_level & (l)) {s;}
118 #else
119 #define DBG(l,s)
120 #endif
121
122 typedef enum
123 {
124 FF_AUTO = 0, FF_MAGIC, FF_BSD, FF_PROF
125 }
126 File_Format;
127
128 typedef int bool;
129 typedef unsigned char UNIT[2]; /* unit of profiling */
130
131 extern const char *whoami; /* command-name, for error messages */
132 extern const char *function_mapping_file; /* file mapping functions to files */
133 extern const char *a_out_name; /* core filename */
134 extern long hz; /* ticks per second */
135
136 /*
137 * Command-line options:
138 */
139 extern int debug_level; /* debug level */
140 extern int output_style;
141 extern int output_width; /* controls column width in index */
142 extern bool bsd_style_output; /* as opposed to FSF style output */
143 extern bool demangle; /* demangle symbol names? */
144 extern bool discard_underscores; /* discard leading underscores? */
145 extern bool ignore_direct_calls; /* don't count direct calls */
146 extern bool ignore_static_funcs; /* suppress static functions */
147 extern bool ignore_zeros; /* ignore unused symbols/files */
148 extern bool line_granularity; /* function or line granularity? */
149 extern bool print_descriptions; /* output profile description */
150 extern bool print_path; /* print path or just filename? */
151 extern bool ignore_non_functions;/* Ignore non-function symbols. */
152
153 extern File_Format file_format; /* requested file format */
154
155 extern bool first_output; /* no output so far? */
156
157 extern void done PARAMS ((int status));
158
159 #endif /* gprof_h */
This page took 0.059552 seconds and 5 git commands to generate.