1 /* Declarations for ident.
2 Copyright (C) 1995, 1996 Markus Armbruster */
4 /* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
5 ** All rights reserved.
7 ** Authors: Martin Trapp, Christian Schaefer
20 * ident -- identifiers in the firm library
22 * Identifiers are used in the firm library. This is the interface to it.
23 * @@@ we need comparison of the prefis of two idents! (strncmp);
31 * ident - the abstract data type ident
34 typedef const struct set_entry ident;
37 /****f* ident/id_from_str
40 * id_from_str - store a string and create an ident
42 * ident *id = id_from_str (const char *str, int len);
44 * Stores a string in the ident module and returns a handle for the string.
47 * str - the string (or whatever) which shall be stored
48 * len - the length of the data in bytes
50 * id - a handle for the generated ident
52 * id_to_str, id_to_strlen
55 inline ident *id_from_str (const char *str, int len);
57 /****f* ident/id_to_str
60 * id_to_str - return a string represented by an ident
62 * char *cp = id_to_str (ident *id);
64 * Returns the string cp represented by id. This string cp is not
65 * Null terminated! The string may not be changed.
71 * id_from_str, id_to_strlen
74 inline const char *id_to_str (ident *id);
76 /****f* ident/id_to_strlen
79 * id_to_strlen - return the length of a string represented by an ident
81 * int len = id_to_strlen (ident *id);
83 * Returns the length of string represented by id.
87 * len - the length of the string
89 * id_from_str, id_to_str
92 inline int id_to_strlen(ident *id);
94 /****f* ident/id_is_suffix
99 * int id_is_prefix (ident *prefix, ident *id);
101 * Returns true if prefix is prefix of id.
103 * prefix - the prefix
106 * id_from_str, id_to_str, id_is_prefix
110 int id_is_prefix (ident *prefix, ident *id);
112 /****f* ident/id_is_suffix
117 * int id_is_suffix (ident *suffix, ident *id);
119 * Returns true if suffix is suffix of id.
121 * suffix - the suffix
124 * id_from_str, id_to_str, id_is_prefix
128 int id_is_suffix (ident *suffix, ident *id);
131 # endif /* _IDENT_H_ */