Lines Matching refs:mlist
139 private void apprentice_list(struct mlist *, int );
142 private struct mlist *mlist_alloc(void);
144 private void mlist_free(struct mlist *);
401 add_mlist(struct mlist *mlp, struct magic_map *map, size_t idx) in add_mlist()
403 struct mlist *ml; in add_mlist()
406 if ((ml = CAST(struct mlist *, emalloc(sizeof(*ml)))) == NULL) in add_mlist()
428 struct mlist *ml; in apprentice_1()
457 if (add_mlist(ms->mlist[i], map, i) == -1) { in apprentice_1()
472 apprentice_list(ms->mlist[i], BINTEST); in apprentice_1()
474 apprentice_list(ms->mlist[i], TEXTTEST); in apprentice_1()
490 mlist_free(ms->mlist[i]); in file_ms_free()
528 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()
3445 file_magicfind(struct magic_set *ms, const char *name, struct mlist *v)
3448 struct mlist *mlist, *ml; local
3450 mlist = ms->mlist[1];
3452 for (ml = mlist->next; ml != mlist; ml = ml->next) {