Lines Matching refs:mlist
140 private void apprentice_list(struct mlist *, int );
143 private struct mlist *mlist_alloc(void);
145 private void mlist_free(struct mlist *);
402 add_mlist(struct mlist *mlp, struct magic_map *map, size_t idx) in add_mlist()
404 struct mlist *ml; in add_mlist()
407 if ((ml = CAST(struct mlist *, emalloc(sizeof(*ml)))) == NULL) in add_mlist()
429 struct mlist *ml; in apprentice_1()
458 if (add_mlist(ms->mlist[i], map, i) == -1) { in apprentice_1()
473 apprentice_list(ms->mlist[i], BINTEST); in apprentice_1()
475 apprentice_list(ms->mlist[i], TEXTTEST); in apprentice_1()
491 mlist_free(ms->mlist[i]); in file_ms_free()
529 ms->mlist[i] = NULL; in file_ms_alloc()
565 private struct mlist *
568 struct mlist *mlist; in mlist_alloc() local
569 if ((mlist = CAST(struct mlist *, ecalloc(1, sizeof(*mlist)))) == NULL) { in mlist_alloc()
572 mlist->next = mlist->prev = mlist; in mlist_alloc()
573 return mlist; in mlist_alloc()
582 mlist_free(ms->mlist[i]); in mlist_free_all()
583 ms->mlist[i] = NULL; in mlist_free_all()
588 mlist_free_one(struct mlist *ml) in mlist_free_one()
596 mlist_free(struct mlist *mlist) in mlist_free() argument
598 struct mlist *ml, *next; in mlist_free()
600 if (mlist == NULL) in mlist_free()
603 for (ml = mlist->next; ml != mlist;) { in mlist_free()
608 mlist_free_one(mlist); in mlist_free()
633 mlist_free(ms->mlist[i]); in file_apprentice()
634 if ((ms->mlist[i] = mlist_alloc()) == NULL) { in file_apprentice()
635 file_oomem(ms, sizeof(*ms->mlist[i])); in file_apprentice()
648 mlist_free(ms->mlist[i]); in file_apprentice()
649 if ((ms->mlist[i] = mlist_alloc()) == NULL) { in file_apprentice()
650 file_oomem(ms, sizeof(*ms->mlist[i])); in file_apprentice()
652 mlist_free(ms->mlist[j]); in file_apprentice()
653 ms->mlist[j] = NULL; in file_apprentice()
676 mlist_free(ms->mlist[i]); in file_apprentice()
677 ms->mlist[i] = NULL; in file_apprentice()
691 mlist_free(ms->mlist[i]); in file_apprentice()
692 ms->mlist[i] = NULL; in file_apprentice()
986 apprentice_list(struct mlist *mlist, int mode) in apprentice_list() argument
989 struct mlist *ml; in apprentice_list()
990 for (ml = mlist->next; ml != mlist; ml = ml->next) { in apprentice_list()
3435 file_magicfind(struct magic_set *ms, const char *name, struct mlist *v)
3438 struct mlist *mlist, *ml; local
3440 mlist = ms->mlist[1];
3442 for (ml = mlist->next; ml != mlist; ml = ml->next) {