2 * Copyright (C) 1995-2007 University of Karlsruhe. All right reserved.
4 * This file is part of libFirm.
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.
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.
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
22 * @brief Implements simple sequence numbers for Firm debug info.
23 * @author Michael Beck
27 * Sequence numbers for Firm.
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
35 #ifndef FIRM_DEBUG_SEQNUMBERS_H
36 #define FIRM_DEBUG_SEQNUMBERS_H
41 * An opaque type for a sequence number.
43 #ifndef _SEQNO_T_TYPEDEF_
44 #define _SEQNO_T_TYPEDEF_
45 typedef struct sn_entry *seqno_t;
49 * Create a new sequence number from a filename and a line number.
51 * @param filename a file name
52 * @param lineno a line number
54 * @return a sequence number for this position.
56 seqno_t firm_seqno_enter(const char *filename, unsigned lineno);
59 * Create a new sequence number from a filename ident and a line number.
61 * @param filename an ident
62 * @param lineno a line number
64 * @return a sequence number for this position.
66 seqno_t firm_seqno_enter_id(ident *filename, unsigned lineno);
69 * Retrieve filename and line number from a sequence number.
71 * @param seqno a sequence number
72 * @param lineno after return contains the line number of this position
74 * @return the file name of this position.
76 const char *firm_seqno_retrieve(seqno_t seqno, unsigned *lineno);
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.
84 void firm_seqno_init(void);
87 * Terminates the sequence number pool.
88 * Sequence numbers cannot be resolved anymore.
89 * Call this function to terminate the sequence
92 void firm_seqno_term(void);