96fcf127b9023b4e7bdf60fca7a5163b755b50cd
[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 # ifndef _IDENT_H_
11 # define _IDENT_H_
12
13 # include "assert.h"
14
15 /****h* libfirm/ident
16  *
17  * NAME
18  *   ident -- identifiers in the firm library
19  * NOTES
20  *  Identifiers are used in the firm library. This is the interface to it.
21  *
22  ******
23  */
24
25 /* Identifiers */
26 /****s* ident/ident
27  *
28  * NAME
29  *  ident - the abstract data type ident
30  * SOURCE
31  */
32 typedef const struct set_entry ident;
33 /*****/
34
35 /****f* ident/id_from_str
36  *
37  * NAME
38  *  id_from_str - store a string and create an ident
39  * SYNOPSIS
40  *  ident *id = id_from_str (char *str, int len);
41  * FUNCTION
42  *  Stores a string in the ident module and returns a handle for the string.
43  * INPUTS
44  *  str - the string (or whatever) which shall be stored
45  *  len - the length of the data in bytes
46  * RESULT
47  *  id - a handle for the generated ident
48  * SEE ALSO
49  *  id_to_str, id_to_strlen
50  ***
51  */
52 inline ident      *id_from_str (char *str, int len);
53
54 /****f* ident/id_to_str
55  *
56  * NAME
57  *  id_to_str - return a string represented by an ident
58  * SYNOPSIS
59  *  char *cp = id_to_str (ident *id);
60  * FUNCTION
61  *  Returns the string cp represented by id. This string cp is not
62  *  Null terminated!
63  * INPUTS
64  *  id - the ident
65  * RESULT
66  *  cp - a string
67  * SEE ALSO
68  *  id_from_str, id_to_strlen
69  ***
70  */
71 inline const char *id_to_str   (ident *id);
72
73 /****f* ident/id_to_strlen
74  *
75  * NAME
76  *  id_to_strlen - return the length of a string represented by an ident
77  * SYNOPSIS
78  *  int len = id_to_strlen (ident *id);
79  * FUNCTION
80  *  Returns the length of string represented by id.
81  * INPUTS
82  *  id - the ident
83  * RESULT
84  *  len - the length of the string
85  * SEE ALSO
86  *  id_from_str, id_to_str
87  ***
88  */
89 inline int         id_to_strlen(ident *id);
90
91 # endif /* _IDENT_H_ */