c21185418a9a38f4b6e676b866ba56a486f8fe96
[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 Null terminated!
62  * INPUTS
63  *  id - the ident
64  * RESULT
65  *  cp - a string
66  * SEE ALSO
67  *  id_from_str, id_to_strlen
68  ***
69  */
70 inline const char *id_to_str   (ident *id);
71
72 /****f* ident/id_to_strlen
73  *
74  * NAME
75  *  id_to_strlen - return the length of a string represented by an ident
76  * SYNOPSIS
77  *  int len = id_to_strlen (ident *id);
78  * FUNCTION
79  *  Returns the length of string represented by id.
80  * INPUTS
81  *  id - the ident
82  * RESULT
83  *  len - the length of the string
84  * SEE ALSO
85  *  id_from_str, id_to_str
86  ***
87  */
88 inline int         id_to_strlen(ident *id);
89
90 # endif /* _IDENT_H_ */