Lines Matching refs:shp
131 fmd_serd_hash_create(fmd_serd_hash_t *shp) in fmd_serd_hash_create() argument
133 shp->sh_hashlen = FMD_STR_BUCKETS; in fmd_serd_hash_create()
134 shp->sh_hash = calloc(shp->sh_hashlen, sizeof (void *)); in fmd_serd_hash_create()
135 shp->sh_count = 0; in fmd_serd_hash_create()
137 if (shp->sh_hash == NULL) { in fmd_serd_hash_create()
145 fmd_serd_hash_destroy(fmd_serd_hash_t *shp) in fmd_serd_hash_destroy() argument
150 for (i = 0; i < shp->sh_hashlen; i++) { in fmd_serd_hash_destroy()
151 for (sgp = shp->sh_hash[i]; sgp != NULL; sgp = ngp) { in fmd_serd_hash_destroy()
157 free(shp->sh_hash); in fmd_serd_hash_destroy()
158 memset(shp, 0, sizeof (fmd_serd_hash_t)); in fmd_serd_hash_destroy()
162 fmd_serd_hash_apply(fmd_serd_hash_t *shp, fmd_serd_eng_f *func, void *arg) in fmd_serd_hash_apply() argument
167 for (i = 0; i < shp->sh_hashlen; i++) { in fmd_serd_hash_apply()
168 for (sgp = shp->sh_hash[i]; sgp != NULL; sgp = sgp->sg_next) in fmd_serd_hash_apply()
174 fmd_serd_eng_insert(fmd_serd_hash_t *shp, const char *name, in fmd_serd_eng_insert() argument
177 uint_t h = fmd_strhash(name) % shp->sh_hashlen; in fmd_serd_eng_insert()
183 sgp->sg_next = shp->sh_hash[h]; in fmd_serd_eng_insert()
184 shp->sh_hash[h] = sgp; in fmd_serd_eng_insert()
185 shp->sh_count++; in fmd_serd_eng_insert()
191 fmd_serd_eng_lookup(fmd_serd_hash_t *shp, const char *name) in fmd_serd_eng_lookup() argument
193 uint_t h = fmd_strhash(name) % shp->sh_hashlen; in fmd_serd_eng_lookup()
196 for (sgp = shp->sh_hash[h]; sgp != NULL; sgp = sgp->sg_next) { in fmd_serd_eng_lookup()
205 fmd_serd_eng_delete(fmd_serd_hash_t *shp, const char *name) in fmd_serd_eng_delete() argument
207 uint_t h = fmd_strhash(name) % shp->sh_hashlen; in fmd_serd_eng_delete()
208 fmd_serd_eng_t *sgp, **pp = &shp->sh_hash[h]; in fmd_serd_eng_delete()
222 assert(shp->sh_count != 0); in fmd_serd_eng_delete()
223 shp->sh_count--; in fmd_serd_eng_delete()