3 * File name: ir/debug/seqnumbers.h
4 * Purpose: Implements simple sequence numbers for Firm debug info.
9 * Copyright: (c) 2001-2005 Universität Karlsruhe
10 * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE.
16 * Sequence numbers for Firm.
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.
22 #ifndef _SEQNUMBERS_H_
23 #define _SEQNUMBERS_H_
27 #ifndef _SEQNO_T_TYPEDEF_
28 #define _SEQNO_T_TYPEDEF_
29 typedef struct sn_entry *seqno_t;
33 * Create a new sequence number from a filename and a line number.
35 * @param filename a file name
36 * @param lineno a line number
38 * @return a sequence number for this position.
40 seqno_t firm_seqno_enter(const char *filename, unsigned lineno);
43 * Retrieve filename and line number from a sequence number.
45 * @param seqno a sequence number
46 * @param lineno after return contains the line number of this position
48 * @return the file name of this position.
50 const char *firm_seqno_retrieve(seqno_t seqno, unsigned *lineno);
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.
58 void firm_seqno_init(void);
61 * Terminates the seqno pool.
62 * Sequence numbers cannot be resolved anymore.
63 * Call this fucntion to terminate the sequence
66 void firm_seqno_term(void);
68 #endif /* _SEQNUMBERS_H_ */