Lines Matching refs:fnlp
341 * struct fn_list *fnlp = some_func_returning_a_list();
342 * if (fn_list_empty(fnlp))
345 * is preferable to checking if the fnlp returned is NULL.
350 struct fn_list *fnlp = MALLOC(sizeof (struct fn_list));
352 fnlp->fnl_first = fnlp->fnl_last = fnlp->fnl_rptr = NULL;
355 fn_list_adds(fnlp, *slist++);
357 return (fnlp);
364 fn_list_dup(struct fn_list *fnlp)
369 fn_list_rewind(fnlp);
370 while ((fnp = fn_list_next(fnlp)) != NULL)
380 fn_list_free(struct fn_list *fnlp)
384 fn_list_rewind(fnlp);
385 while ((fnp = fn_list_next(fnlp)) != NULL)
387 FREE(fnlp);
394 fn_list_adds(struct fn_list *fnlp, const char *s)
396 fn_list_addfn(fnlp, fn_new(s));
403 fn_list_addfn(struct fn_list *fnlp, struct fn *fnp)
406 if (fnlp->fnl_first == NULL)
407 fnlp->fnl_first = fnlp->fnl_last = fnlp->fnl_rptr = fnp;
409 fnlp->fnl_last->fn_next = fnp;
410 fnlp->fnl_last = fnp;
418 fn_list_rewind(struct fn_list *fnlp)
420 fnlp->fnl_rptr = fnlp->fnl_first;
427 fn_list_next(struct fn_list *fnlp)
429 struct fn *ret = fnlp->fnl_rptr;
431 if (fnlp->fnl_rptr == fnlp->fnl_last)
432 fnlp->fnl_rptr = NULL;
433 else if (fnlp->fnl_rptr != NULL)
434 fnlp->fnl_rptr = fnlp->fnl_rptr->fn_next;
440 * fn_list_addfn_list -- move filenames from fnlp2 to end of fnlp
445 fn_list_addfn_list(struct fn_list *fnlp, struct fn_list *fnlp2)
458 fn_list_addfn(fnlp, fnp2);
476 fn_list_appendrange(struct fn_list *fnlp, const char *s, const char *limit)
478 struct fn *fnp = fnlp->fnl_first;
484 if (fnp == fnlp->fnl_last)
501 fn_list_totalsize(struct fn_list *fnlp)
506 fn_list_rewind(fnlp);
507 while ((fnp = fn_list_next(fnlp)) != NULL)
521 fn_list_popoldest(struct fn_list *fnlp)
526 fn_list_rewind(fnlp);
527 while ((fnp = fn_list_next(fnlp)) != NULL)
541 if (fnlp->fnl_first == ret) {
542 fnlp->fnl_first = ret->fn_next;
544 fn_list_rewind(fnlp);
545 while ((fnp = fn_list_next(fnlp)) != NULL) {
548 if (fnlp->fnl_last == ret)
549 fnlp->fnl_last = fnp;
563 fn_list_empty(struct fn_list *fnlp)
565 return (fnlp->fnl_first == NULL);
572 fn_list_count(struct fn_list *fnlp)
581 fn_list_rewind(fnlp);
582 while (fn_list_next(fnlp) != NULL)