1 /* Declarations for ident.
2 Copyright (C) 1995, 1996 Markus Armbruster */
4 /* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
7 * Authors: Martin Trapp, Christian Schaefer
17 # include "firm_common.h"
21 * - identifiers in the firm library
22 * Identifiers are used in the firm library. This is the interface to it.
28 * the abstract data type ident
30 typedef const struct set_entry ident;
34 * store a string and create an ident
35 * Stores a string in the ident module and returns a handle for 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
43 INLINE ident *id_from_str (const char *str, int len);
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
55 INLINE const char *id_to_str (ident *id);
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
66 INLINE int id_to_strlen(ident *id);
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
78 int id_is_prefix (ident *prefix, ident *id);
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
90 int id_is_suffix (ident *suffix, ident *id);
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
101 int print_id (ident *id);
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
112 int fprint_id (FILE *F, ident *id);
115 # endif /* _IDENT_H_ */