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 (char *str, int len);
44 * Stores a string in the ident module and returns a handle for the string.
46 * str - the string (or whatever) which shall be stored
47 * len - the length of the data in bytes
49 * id - a handle for the generated ident
51 * id_to_str, id_to_strlen
54 inline ident *id_from_str (const char *str, int len);
56 /****f* ident/id_to_str
59 * id_to_str - return a string represented by an ident
61 * char *cp = id_to_str (ident *id);
63 * Returns the string cp represented by id. This string cp is not
70 * id_from_str, id_to_strlen
73 inline const char *id_to_str (ident *id);
75 /****f* ident/id_to_strlen
78 * id_to_strlen - return the length of a string represented by an ident
80 * int len = id_to_strlen (ident *id);
82 * Returns the length of string represented by id.
86 * len - the length of the string
88 * id_from_str, id_to_str
91 inline int id_to_strlen(ident *id);
93 /****f* ident/id_is_suffix
98 * int id_is_prefix (ident *prefix, ident *id);
100 * Returns true if prefix is prefix of id.
102 * prefix - the prefix
105 * id_from_str, id_to_str, id_is_prefix
109 int id_is_prefix (ident *prefix, ident *id);
111 /****f* ident/id_is_suffix
116 * int id_is_suffix (ident *suffix, ident *id);
118 * Returns true if suffix is suffix of id.
120 * suffix - the suffix
123 * id_from_str, id_to_str, id_is_prefix
127 int id_is_suffix (ident *suffix, ident *id);
130 # endif /* _IDENT_H_ */