Lines Matching refs:mlist
125 private void apprentice_list(struct mlist *, int );
128 private struct mlist *mlist_alloc(void);
129 private void mlist_free(struct mlist *);
370 add_mlist(struct mlist *mlp, struct magic_map *map, size_t idx) in add_mlist()
372 struct mlist *ml; in add_mlist()
374 if ((ml = CAST(struct mlist *, emalloc(sizeof(*ml)))) == NULL) in add_mlist()
394 struct mlist *ml; in apprentice_1()
424 if (add_mlist(ms->mlist[i], map, i) == -1) { in apprentice_1()
434 apprentice_list(ms->mlist[i], BINTEST); in apprentice_1()
436 apprentice_list(ms->mlist[i], TEXTTEST); in apprentice_1()
450 mlist_free(ms->mlist[i]); in file_ms_free()
487 ms->mlist[i] = NULL; in file_ms_alloc()
516 private struct mlist *
519 struct mlist *mlist; in mlist_alloc() local
520 if ((mlist = CAST(struct mlist *, ecalloc(1, sizeof(*mlist)))) == NULL) { in mlist_alloc()
523 mlist->next = mlist->prev = mlist; in mlist_alloc()
524 return mlist; in mlist_alloc()
528 mlist_free(struct mlist *mlist) in mlist_free() argument
530 struct mlist *ml; in mlist_free()
532 if (mlist == NULL) in mlist_free()
535 for (ml = mlist->next; ml != mlist;) { in mlist_free()
536 struct mlist *next = ml->next; in mlist_free()
567 mlist_free(ms->mlist[i]); in file_apprentice()
568 if ((ms->mlist[i] = mlist_alloc()) == NULL) { in file_apprentice()
569 file_oomem(ms, sizeof(*ms->mlist[i])); in file_apprentice()
582 mlist_free(ms->mlist[i]); in file_apprentice()
583 if ((ms->mlist[i] = mlist_alloc()) == NULL) { in file_apprentice()
584 file_oomem(ms, sizeof(*ms->mlist[i])); in file_apprentice()
588 mlist_free(ms->mlist[i]); in file_apprentice()
612 mlist_free(ms->mlist[i]); in file_apprentice()
613 ms->mlist[i] = NULL; in file_apprentice()
627 mlist_free(ms->mlist[i]); in file_apprentice()
628 ms->mlist[i] = NULL; in file_apprentice()
812 apprentice_list(struct mlist *mlist, int mode) in apprentice_list() argument
815 struct mlist *ml; in apprentice_list()
816 for (ml = mlist->next; ml != mlist; ml = ml->next) { in apprentice_list()
3003 file_magicfind(struct magic_set *ms, const char *name, struct mlist *v)
3006 struct mlist *mlist, *ml; local
3008 mlist = ms->mlist[1];
3010 for (ml = mlist->next; ml != mlist; ml = ml->next) {