Lines Matching refs:zsp

73 	zed_strings_t *zsp;  in zed_strings_create()  local
75 zsp = calloc(1, sizeof (*zsp)); in zed_strings_create()
76 if (!zsp) in zed_strings_create()
79 avl_create(&zsp->tree, _zed_strings_node_compare, in zed_strings_create()
82 zsp->iteratorp = NULL; in zed_strings_create()
83 return (zsp); in zed_strings_create()
145 zed_strings_destroy(zed_strings_t *zsp) in zed_strings_destroy() argument
150 if (!zsp) in zed_strings_destroy()
154 while ((np = avl_destroy_nodes(&zsp->tree, &cookie))) in zed_strings_destroy()
157 avl_destroy(&zsp->tree); in zed_strings_destroy()
158 free(zsp); in zed_strings_destroy()
169 zed_strings_add(zed_strings_t *zsp, const char *key, const char *s) in zed_strings_add() argument
173 if (!zsp || !s) { in zed_strings_add()
184 oldp = avl_find(&zsp->tree, newp, NULL); in zed_strings_add()
186 avl_remove(&zsp->tree, oldp); in zed_strings_add()
189 avl_add(&zsp->tree, newp); in zed_strings_add()
200 zed_strings_first(zed_strings_t *zsp) in zed_strings_first() argument
202 if (!zsp) { in zed_strings_first()
206 zsp->iteratorp = avl_first(&zsp->tree); in zed_strings_first()
207 if (!zsp->iteratorp) in zed_strings_first()
210 return (((zed_strings_node_t *)zsp->iteratorp)->val); in zed_strings_first()
221 zed_strings_next(zed_strings_t *zsp) in zed_strings_next() argument
223 if (!zsp) { in zed_strings_next()
227 if (!zsp->iteratorp) in zed_strings_next()
230 zsp->iteratorp = AVL_NEXT(&zsp->tree, zsp->iteratorp); in zed_strings_next()
231 if (!zsp->iteratorp) in zed_strings_next()
234 return (((zed_strings_node_t *)zsp->iteratorp)->val); in zed_strings_next()
241 zed_strings_count(zed_strings_t *zsp) in zed_strings_count() argument
243 if (!zsp) { in zed_strings_count()
247 return (avl_numnodes(&zsp->tree)); in zed_strings_count()