Lines Matching refs:mlist

137 private void apprentice_list(struct mlist *, int );
140 private struct mlist *mlist_alloc(void);
141 private void mlist_free(struct mlist *);
389 add_mlist(struct mlist *mlp, struct magic_map *map, size_t idx) in add_mlist()
391 struct mlist *ml; in add_mlist()
394 if ((ml = CAST(struct mlist *, emalloc(sizeof(*ml)))) == NULL) in add_mlist()
415 struct mlist *ml; in apprentice_1()
446 if (add_mlist(ms->mlist[i], map, i) == -1) { in apprentice_1()
456 apprentice_list(ms->mlist[i], BINTEST); in apprentice_1()
458 apprentice_list(ms->mlist[i], TEXTTEST); in apprentice_1()
471 mlist_free(ms->mlist[i]); in file_ms_free()
508 ms->mlist[i] = NULL; in file_ms_alloc()
544 private struct mlist *
547 struct mlist *mlist; in mlist_alloc() local
548 if ((mlist = CAST(struct mlist *, ecalloc(1, sizeof(*mlist)))) == NULL) { in mlist_alloc()
551 mlist->next = mlist->prev = mlist; in mlist_alloc()
552 return mlist; in mlist_alloc()
556 mlist_free(struct mlist *mlist) in mlist_free() argument
558 struct mlist *ml, *next; in mlist_free()
560 if (mlist == NULL) in mlist_free()
563 ml = mlist->next; in mlist_free()
564 for (ml = mlist->next; (next = ml->next) != NULL; ml = next) { in mlist_free()
568 if (ml == mlist) in mlist_free()
581 if (ms->mlist[0] != NULL) in file_apprentice()
596 mlist_free(ms->mlist[i]); in file_apprentice()
597 if ((ms->mlist[i] = mlist_alloc()) == NULL) { in file_apprentice()
598 file_oomem(ms, sizeof(*ms->mlist[i])); in file_apprentice()
611 mlist_free(ms->mlist[i]); in file_apprentice()
612 if ((ms->mlist[i] = mlist_alloc()) == NULL) { in file_apprentice()
613 file_oomem(ms, sizeof(*ms->mlist[i])); in file_apprentice()
615 mlist_free(ms->mlist[i]); in file_apprentice()
616 ms->mlist[i] = NULL; in file_apprentice()
639 mlist_free(ms->mlist[i]); in file_apprentice()
640 ms->mlist[i] = NULL; in file_apprentice()
654 mlist_free(ms->mlist[i]); in file_apprentice()
655 ms->mlist[i] = NULL; in file_apprentice()
895 apprentice_list(struct mlist *mlist, int mode) in apprentice_list() argument
898 struct mlist *ml; in apprentice_list()
899 for (ml = mlist->next; ml != mlist; ml = ml->next) { in apprentice_list()
3336 file_magicfind(struct magic_set *ms, const char *name, struct mlist *v)
3339 struct mlist *mlist, *ml; local
3341 mlist = ms->mlist[1];
3343 for (ml = mlist->next; ml != mlist; ml = ml->next) {