Pristine Ack-5.5
[Ack-5.5.git] / util / grind / position.h
1 /* $Id: position.h,v 1.4 1994/06/24 11:00:44 ceriel Exp $ */
2
3 /* maps from address to filename-lineno pair and reverse,
4    maps from filename-lineno pair or address to scope.
5 */
6
7 typedef unsigned int    t_lineno;
8 typedef long            t_addr;
9 #define ILL_ADDR        ((t_addr) -1)
10 #define NO_ADDR         ((t_addr) 0)
11
12 typedef struct pos {
13   t_lineno      lineno;
14   char          *filename;
15 } t_position, *p_position;
16
17 /* extern p_position    get_position_from_addr(t_addr t);
18    Returns a pointer to a structure containing the source position of the code
19    at address 't'.  0 is returned if no source position could be found.
20 */
21 extern p_position       get_position_from_addr();
22
23 /* extern t_addr        get_addr_from_position(p_position p);
24    Returns the address of the code at position 'p', or ILL_ADDR if it could
25    not be found. If there is no symbolic information for the filename in
26    position 'p', an error message will be given.
27 */
28 extern t_addr           get_addr_from_position();
29
30 /* extern       add_position_addr(char *filename, struct outname *n);
31    Adds the ('filename','n'->on_desc),'n'->on_valu pair to the mapping information.
32 */
33 extern                  add_position_addr();
34
35 /* extern p_position print_position(t_addr a, int print_function);
36    Prints position 'a' and returns it. If 'print_function' is set,
37    an attempt is made to print the function name as well.
38 */
39 extern p_position       print_position();