697973150cbaecc209bdbd8b0552da294fad2288
[ghc-hetmet.git] / utils / prof / cgprof / symbol.h
1 /* ------------------------------------------------------------------------
2  * $Id: symbol.h,v 1.1 2000/04/05 10:06:36 simonmar Exp $
3  *                                                                      
4  *      Copyright (C) 1995-2000 University of Oxford
5  *                                                                      
6  * Permission to use, copy, modify, and distribute this software,
7  * and to incorporate it, in whole or in part, into other software,
8  * is hereby granted without fee, provided that
9  *   (1) the above copyright notice and this permission notice appear in
10  *       all copies of the source code, and the above copyright notice
11  *       appear in clearly visible form on all supporting documentation
12  *       and distribution media;
13  *   (2) modified versions of this software be accompanied by a complete
14  *       change history describing author, date, and modifications made;
15  *       and
16  *   (3) any redistribution of the software, in original or modified
17  *       form, be without fee and subject to these same conditions.
18  * --------------------------------------------------------------------- */
19
20 #include <stdlib.h>
21 #include <stdio.h>
22 #include <limits.h>
23
24 /* -----------------------------------------------------------------------------
25  * Symbol table associated with cost centres
26  * -------------------------------------------------------------------------- */
27
28 #ifndef _SYMBOL_H_
29 #define _SYMBOL_H_
30 #define CG_STACK 42
31 #define CG_SSTEP 1968
32
33
34 #define MAX_PROFILE_LINE_LENGTH   10000
35 #define MAX_STACK_DEPTH           60
36 #define MAX_FUNNAME               80
37
38
39 typedef struct {
40   int   type;    /* Either CG_STACK or CG_SSTEP */
41   int   lineno;
42   char *filename;  
43 } name_object;
44
45 typedef int name_id; /* i.e. index into symbol table */
46
47 #define SYMBOL_TABLE_INIT_SIZE 100
48 extern int          symbol_table_next;
49 extern int          symbol_table_size;
50 extern name_object *symbol_table;
51
52
53 extern void printSymbolTable(int , int *);
54 extern int cmp_symbol_entry(const int *, const int *);
55 extern name_id lookupSymbolTable(int,int,char*);
56 extern void printSymbolTable_entry(int);
57 extern void getNameFromSymbolTable(int,char*);
58 #endif