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.
21 * In simple cases it should be possible to use sequence numbers
24 #ifndef _SEQNUMBERS_H_
25 #define _SEQNUMBERS_H_
30 * An opaque type for a sequence number.
32 #ifndef _SEQNO_T_TYPEDEF_
33 #define _SEQNO_T_TYPEDEF_
34 typedef struct sn_entry *seqno_t;
38 * Create a new sequence number from a filename and a line number.
40 * @param filename a file name
41 * @param lineno a line number
43 * @return a sequence number for this position.
45 seqno_t firm_seqno_enter(const char *filename, unsigned lineno);
48 * Create a new sequence number from a filename ident and a line number.
50 * @param filename an ident
51 * @param lineno a line number
53 * @return a sequence number for this position.
55 seqno_t firm_seqno_enter_id(ident *filename, unsigned lineno);
58 * Retrieve filename and line number from a sequence number.
60 * @param seqno a sequence number
61 * @param lineno after return contains the line number of this position
63 * @return the file name of this position.
65 const char *firm_seqno_retrieve(seqno_t seqno, unsigned *lineno);
68 * Creates the sequence number pool.
69 * Is not called by init_firm(), because the sequence number
70 * support is optional. Call firm_seqno_init() after init_firm()
71 * if sequence numbers should be used.
73 void firm_seqno_init(void);
76 * Terminates the sequence number pool.
77 * Sequence numbers cannot be resolved anymore.
78 * Call this function to terminate the sequence
81 void firm_seqno_term(void);
83 #endif /* _SEQNUMBERS_H_ */