Lines Matching defs:ident
99 const char *show_ident(const struct ident *ident)
105 if (!ident)
108 sprintf(buffer, "%.*s", ident->len, ident->name);
204 return show_ident(token->ident);
262 return show_ident(token->ident);
803 static struct ident *hash_table[IDENT_HASH_SIZE];
818 struct ident * ident = hash_table[i];
821 while (ident) {
823 ident = ident->next;
836 static struct ident *alloc_ident(const char *name, int len)
838 struct ident *ident = __alloc_ident(len);
839 ident->symbols = NULL;
840 ident->len = len;
841 ident->tainted = 0;
842 memcpy(ident->name, name, len);
843 return ident;
846 static struct ident * insert_hash(struct ident *ident, unsigned long hash)
848 ident->next = hash_table[hash];
849 hash_table[hash] = ident;
851 return ident;
854 static struct ident *create_hashed_ident(const char *name, int len, unsigned long hash)
856 struct ident *ident;
857 struct ident **p;
860 while ((ident = *p) != NULL) {
861 if (ident->len == (unsigned char) len) {
862 if (strncmp(name, ident->name, len) != 0)
866 return ident;
870 p = &ident->next;
872 ident = alloc_ident(name, len);
873 *p = ident;
874 ident->next = NULL;
877 return ident;
893 struct ident *hash_ident(struct ident *ident)
895 return insert_hash(ident, hash_name(ident->name, ident->len));
898 struct ident *built_in_ident(const char *name)
904 struct token *built_in_token(int stream, struct ident *ident)
911 token->ident = ident;
918 struct ident *ident;
947 ident = create_hashed_ident(buf, len, hash);
952 token->ident = ident;