Fixed function implemenation type
[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 /* $Id$ */
11
12 # ifndef _IDENT_H_
13 # define _IDENT_H_
14
15 # include <stdio.h>
16 # include <assert.h>
17 # include "firm_common.h"
18
19 /**
20  *
21  *   - identifiers in the firm library
22  *  Identifiers are used in the firm library. This is the interface to it.
23  */
24
25 /* Identifiers */
26 /**
27  *
28  *  the abstract data type ident
29  */
30 typedef const struct set_entry ident;
31
32 /**
33  *
34  *  store a string and create an ident
35  *  Stores a string in the ident module and returns a handle for the string.
36  *  Copies the string.
37  *  @param str - the string (or whatever) which shall be stored
38  *  @param len - the length of the data in bytes
39  *  @return id - a handle for the generated ident
40  * @see id_to_str, id_to_strlen
41  * @see
42  */
43 INLINE ident      *id_from_str (const char *str, int len);
44
45 /**
46  *
47  *  return a string represented by an ident
48  *  Returns the string cp represented by id. This string cp is not
49  *  Null terminated!  The string may not be changed.
50  *  @param id - the ident
51  *  @return cp - a string
52  * @see id_from_str, id_to_strlen
53  * @see
54  */
55 INLINE const char *id_to_str   (ident *id);
56
57 /**
58  *
59  *  return the length of a string represented by an ident
60  *  Returns the length of string represented by id.
61  *  @param id - the ident
62  *  @return len - the length of the string
63  * @see id_from_str, id_to_str
64  * @see
65  */
66 INLINE int  id_to_strlen(ident *id);
67
68 /**
69  *
70  *
71  *  Returns true if prefix is prefix of id.
72  *  @param prefix - the prefix
73  *  @param id - the ident
74  * @see id_from_str, id_to_str, id_is_prefix
75  * @see
76  */
77 /*  */
78 int id_is_prefix (ident *prefix, ident *id);
79
80 /**
81  *
82  *
83  *  Returns true if suffix is suffix of id.
84  *  @param suffix - the suffix
85  *  @param id - the ident
86  * @see id_from_str, id_to_str, id_is_prefix
87  * @see
88  */
89 /*  */
90 int id_is_suffix (ident *suffix, ident *id);
91
92 /**
93  *
94  *
95  *  Prints the ident to stdout.
96  *  @param The ident to print.
97  * @see id_from_str, id_to_str, id_is_prefix, fprint_id
98  * @see
99  */
100 /*  */
101 int print_id (ident *id);
102
103 /**
104  *
105  *
106  *  Prints the ident to the file passed.
107  *  @param The ident to print and the file.
108  * @see id_from_str, id_to_str, id_is_prefix, print_id
109  * @see
110  */
111 /*  */
112 int fprint_id (FILE *F, ident *id);
113
114
115 # endif /* _IDENT_H_ */