More doxygen docu added.
[libfirm] / ir / ident / ident.h
1 /* Declarations for ident.
2    Copyright (C) 1995, 1996 Markus Armbruster */
3
4 /* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
5 * All rights reserved.
6 *
7 * Authors: Martin Trapp, Christian Schaefer
8 */
9
10 /**
11  * @file ident.h
12  *
13  * Declarations for identifiers in the firm library
14  *
15  * Identifiers are used in the firm library. This is the interface to it.
16  */
17
18 /* $Id$ */
19
20 # ifndef _IDENT_H_
21 # define _IDENT_H_
22
23 # include <stdio.h>
24 # include <assert.h>
25 # include "firm_common.h"
26
27 /* Identifiers */
28
29 /**
30  *  the abstract data type ident
31  */
32 typedef const struct set_entry ident;
33
34 /**
35  *  Store a string and create an ident.
36  *  Stores a string in the ident module and returns a handle for the string.
37  *  Copies the string.
38  *
39  * @param str - the string (or whatever) which shall be stored
40  * @param len - the length of the data in bytes
41  *
42  * @return id - a handle for the generated ident
43  *
44  * @see id_to_str, id_to_strlen
45  */
46 INLINE ident      *id_from_str (const char *str, int len);
47
48 /**
49  * Returns a string represented by an ident.
50  * Returns the string cp represented by id. This string cp is not
51  * NULL terminated! The string may not be changed.
52  *
53  * @param id - the ident
54  *
55  * @return cp - a string
56  *
57  * @see id_from_str, id_to_strlen
58  */
59 INLINE const char *id_to_str   (ident *id);
60
61 /**
62  * Returns the length of a string represented by an ident.
63  *
64  * @param id - the ident
65  *
66  * @return len - the length of the string
67  *
68  * @see id_from_str, id_to_str
69  */
70 INLINE int  id_to_strlen(ident *id);
71
72 /**
73  * Returns true if prefix is prefix of an ident.
74  *
75  * @param prefix - the prefix
76  * @param id     - the ident
77  *
78  * @see id_from_str, id_to_str, id_is_prefix
79  */
80 int id_is_prefix (ident *prefix, ident *id);
81
82 /**
83  * Returns true if suffix is suffix of id.
84  *
85  * @param suffix - the suffix
86  * @param id     - the ident
87  *
88  * @see id_from_str, id_to_str, id_is_prefix
89  */
90 int id_is_suffix (ident *suffix, ident *id);
91
92 /**
93  * Prints the ident to stdout.
94  *
95  * @param id - The ident to print.
96  *
97  * @see id_from_str, id_to_str, id_is_prefix, fprint_id
98  */
99 int print_id (ident *id);
100
101 /**
102  * Prints the ident to the file passed.
103  *
104  * @param F  - file pointer to print the ident to.
105  * @param id - The ident to print and the file.
106  *
107  * @see id_from_str, id_to_str, id_is_prefix, print_id
108  */
109 int fprint_id (FILE *F, ident *id);
110
111 # endif /* _IDENT_H_ */