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
13 * Declarations for identifiers in the firm library
15 * Identifiers are used in the firm library. This is the interface to it.
25 # include "firm_common.h"
30 * the abstract data type ident
32 typedef const struct set_entry ident;
35 * Store a string and create an ident.
36 * Stores a string in the ident module and returns a handle for the string.
39 * @param str - the string (or whatever) which shall be stored
40 * @param len - the length of the data in bytes
42 * @return id - a handle for the generated ident
44 * @see id_to_str, id_to_strlen
46 INLINE ident *id_from_str (const char *str, int len);
49 * Returns a string represented by an ident.
50 * Returns the string cp represented by id. This string cp is not
51 * NULL terminated! The string may not be changed.
53 * @param id - the ident
55 * @return cp - a string
57 * @see id_from_str, id_to_strlen
59 INLINE const char *id_to_str (ident *id);
62 * Returns the length of a string represented by an ident.
64 * @param id - the ident
66 * @return len - the length of the string
68 * @see id_from_str, id_to_str
70 INLINE int id_to_strlen(ident *id);
73 * Returns true if prefix is prefix of an ident.
75 * @param prefix - the prefix
76 * @param id - the ident
78 * @see id_from_str, id_to_str, id_is_prefix
80 int id_is_prefix (ident *prefix, ident *id);
83 * Returns true if suffix is suffix of id.
85 * @param suffix - the suffix
86 * @param id - the ident
88 * @see id_from_str, id_to_str, id_is_prefix
90 int id_is_suffix (ident *suffix, ident *id);
93 * Prints the ident to stdout.
95 * @param id - The ident to print.
97 * @see id_from_str, id_to_str, id_is_prefix, fprint_id
99 int print_id (ident *id);
102 * Prints the ident to the file passed.
104 * @param F - file pointer to print the ident to.
105 * @param id - The ident to print and the file.
107 * @see id_from_str, id_to_str, id_is_prefix, print_id
109 int fprint_id (FILE *F, ident *id);
111 # endif /* _IDENT_H_ */