newest biset from libcore
[libfirm] / ir / debug / seqnumbers.h
1 /*
2  * Project:     libFIRM
3  * File name:   ir/debug/seqnumbers.h
4  * Purpose:     Implements simple sequence numbers for Firm debug info.
5  * Author:      Michael Beck
6  * Modified by:
7  * Created:     2005
8  * CVS-ID:      $Id$
9  * Copyright:   (c) 2001-2005 Universität Karlsruhe
10  * Licence:     This file protected by GPL -  GNU GENERAL PUBLIC LICENSE.
11  */
12
13 /**
14  * @file seqnumbers.h
15  *
16  * Sequence numbers for Firm.
17  *
18  * A sequence number is an unique number representing a filename
19  * and a line number. The number 0 represents empty information.
20  * This module is an optional "snap-in" for the Firm debug info.
21  */
22 #ifndef _SEQNUMBERS_H_
23 #define _SEQNUMBERS_H_
24
25 #include "ident.h"
26
27 #ifndef _SEQNO_T_TYPEDEF_
28 #define _SEQNO_T_TYPEDEF_
29 typedef struct sn_entry *seqno_t;
30 #endif
31
32 /**
33  * Create a new sequence number from a filename and a line number.
34  *
35  * @param filename  a file name
36  * @param lineno    a line number
37  *
38  * @return  a sequence number for this position.
39  */
40 seqno_t firm_seqno_enter(const char *filename, unsigned lineno);
41
42 /**
43  * Retrieve filename and line number from a sequence number.
44  *
45  * @param seqno   a sequence number
46  * @param lineno  after return contains the line number of this position
47  *
48  * @return  the file name of this position.
49  */
50 const char *firm_seqno_retrieve(seqno_t seqno, unsigned *lineno);
51
52 /**
53  * Creates the seqno pool.
54  * Is not called by init_firm(), because the sequence number
55  * support is optional. Call firm_seqno_init() after init_firm()
56  * if sequence numbers should be used.
57  */
58 void firm_seqno_init(void);
59
60 /**
61  * Terminates the seqno pool.
62  * Sequence numbers cannot be resolved anymore.
63  * Call this fucntion to terminate the sequence
64  * pool.
65  */
66 void firm_seqno_term(void);
67
68 #endif /* _SEQNUMBERS_H_ */