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
21 * ident -- identifiers in the firm library
23 * Identifiers are used in the firm library. This is the interface to it.
24 * @@@ we need comparison of the prefis of two idents! (strncmp);
32 * ident - the abstract data type ident
35 typedef const struct set_entry ident;
38 /****f* ident/id_from_str
41 * id_from_str - store a string and create an ident
43 * ident *id = id_from_str (const char *str, int len);
45 * Stores a string in the ident module and returns a handle for the string.
48 * str - the string (or whatever) which shall be stored
49 * len - the length of the data in bytes
51 * id - a handle for the generated ident
53 * id_to_str, id_to_strlen
56 INLINE ident *id_from_str (const char *str, int len);
58 /****f* ident/id_to_str
61 * id_to_str - return a string represented by an ident
63 * char *cp = id_to_str (ident *id);
65 * Returns the string cp represented by id. This string cp is not
66 * Null terminated! The string may not be changed.
72 * id_from_str, id_to_strlen
75 INLINE const char *id_to_str (ident *id);
77 /****f* ident/id_to_strlen
80 * id_to_strlen - return the length of a string represented by an ident
82 * int len = id_to_strlen (ident *id);
84 * Returns the length of string represented by id.
88 * len - the length of the string
90 * id_from_str, id_to_str
93 INLINE int id_to_strlen(ident *id);
95 /****f* ident/id_is_suffix
100 * int id_is_prefix (ident *prefix, ident *id);
102 * Returns true if prefix is prefix of id.
104 * prefix - the prefix
107 * id_from_str, id_to_str, id_is_prefix
111 int id_is_prefix (ident *prefix, ident *id);
113 /****f* ident/id_is_suffix
118 * int id_is_suffix (ident *suffix, ident *id);
120 * Returns true if suffix is suffix of id.
122 * suffix - the suffix
125 * id_from_str, id_to_str, id_is_prefix
129 int id_is_suffix (ident *suffix, ident *id);
132 # endif /* _IDENT_H_ */