properly mark symbols in the public API to be exported. This allows us to use -fvisib...
[libfirm] / include / libfirm / seqnumbers.h
1 /*
2  * Copyright (C) 1995-2008 University of Karlsruhe.  All right reserved.
3  *
4  * This file is part of libFirm.
5  *
6  * This file may be distributed and/or modified under the terms of the
7  * GNU General Public License version 2 as published by the Free Software
8  * Foundation and appearing in the file LICENSE.GPL included in the
9  * packaging of this file.
10  *
11  * Licensees holding valid libFirm Professional Edition licenses may use
12  * this file in accordance with the libFirm Commercial License.
13  * Agreement provided with the Software.
14  *
15  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
16  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17  * PURPOSE.
18  */
19
20 /**
21  * @file
22  * @brief    Implements simple sequence numbers for Firm debug info.
23  * @author   Michael Beck
24  * @date     2005
25  * @version  $Id$
26  * @brief
27  *  Sequence numbers for Firm.
28  *
29  *  A sequence number is an unique number representing a filename
30  *  and a line number. The number 0 represents empty information.
31  *  This module is an optional "snap-in" for the Firm debug info.
32  *  In simple cases it should be possible to use sequence numbers
33  *  as dbg_info.
34  */
35 #ifndef FIRM_DEBUG_SEQNUMBERS_H
36 #define FIRM_DEBUG_SEQNUMBERS_H
37
38 #include "ident.h"
39
40 #include "begin.h"
41
42 /**
43  * @typedef seqno_t
44  *
45  * An opaque type for a sequence number.
46  */
47
48 /**
49  * Create a new sequence number from a filename and a line number.
50  *
51  * @param filename  a file name
52  * @param lineno    a line number
53  *
54  * @return  a sequence number for this position.
55  */
56 FIRM_DLL seqno_t firm_seqno_enter(const char *filename, unsigned lineno);
57
58 /**
59  * Create a new sequence number from a filename ident and a line number.
60  *
61  * @param filename  an ident
62  * @param lineno    a line number
63  *
64  * @return  a sequence number for this position.
65  */
66 FIRM_DLL seqno_t firm_seqno_enter_id(ident *filename, unsigned lineno);
67
68 /**
69  * Retrieve filename and line number from a sequence number.
70  *
71  * @param seqno   a sequence number
72  * @param lineno  after return contains the line number of this position
73  *
74  * @return  the file name of this position.
75  */
76 FIRM_DLL const char *firm_seqno_retrieve(seqno_t seqno, unsigned *lineno);
77
78 /**
79  * Creates the sequence number pool.
80  * Is not called by init_firm(), because the sequence number
81  * support is optional. Call firm_seqno_init() after init_firm()
82  * if sequence numbers should be used.
83  */
84 FIRM_DLL void firm_seqno_init(void);
85
86 /**
87  * Terminates the sequence number pool.
88  * Sequence numbers cannot be resolved anymore.
89  * Call this function to terminate the sequence
90  * pool.
91  */
92 FIRM_DLL void firm_seqno_term(void);
93
94 #include "end.h"
95
96 #endif