Lines Matching refs:mlist

134 private void apprentice_list(struct mlist *, int );
137 private struct mlist *mlist_alloc(void);
138 private void mlist_free(struct mlist *);
409 add_mlist(struct mlist *mlp, struct magic_map *map, size_t idx) in add_mlist()
411 struct mlist *ml; in add_mlist()
414 if ((ml = CAST(struct mlist *, malloc(sizeof(*ml)))) == NULL) in add_mlist()
436 struct mlist *ml; in apprentice_1()
465 if (add_mlist(ms->mlist[i], map, i) == -1) { in apprentice_1()
475 apprentice_list(ms->mlist[i], BINTEST); in apprentice_1()
477 apprentice_list(ms->mlist[i], TEXTTEST); in apprentice_1()
483 mlist_free(ms->mlist[i]); in apprentice_1()
484 ms->mlist[i] = NULL; in apprentice_1()
499 mlist_free(ms->mlist[i]); in file_ms_free()
530 ms->mlist[i] = NULL; in file_ms_alloc()
568 private struct mlist *
571 struct mlist *mlist; in mlist_alloc() local
572 if ((mlist = CAST(struct mlist *, calloc(1, sizeof(*mlist)))) == NULL) { in mlist_alloc()
575 mlist->next = mlist->prev = mlist; in mlist_alloc()
576 return mlist; in mlist_alloc()
580 mlist_free(struct mlist *mlist) in mlist_free() argument
582 struct mlist *ml, *next; in mlist_free()
584 if (mlist == NULL) in mlist_free()
587 ml = mlist->next; in mlist_free()
588 for (ml = mlist->next; (next = ml->next) != NULL; ml = next) { in mlist_free()
592 if (ml == mlist) in mlist_free()
604 struct mlist *ml; in buffer_apprentice()
610 if (ms->mlist[0] != NULL) in buffer_apprentice()
616 mlist_free(ms->mlist[i]); in buffer_apprentice()
617 if ((ms->mlist[i] = mlist_alloc()) == NULL) { in buffer_apprentice()
618 file_oomem(ms, sizeof(*ms->mlist[i])); in buffer_apprentice()
629 if (add_mlist(ms->mlist[j], map, j) == -1) { in buffer_apprentice()
639 mlist_free(ms->mlist[i]); in buffer_apprentice()
640 ms->mlist[i] = NULL; in buffer_apprentice()
654 if (ms->mlist[0] != NULL) in file_apprentice()
668 mlist_free(ms->mlist[i]); in file_apprentice()
669 if ((ms->mlist[i] = mlist_alloc()) == NULL) { in file_apprentice()
670 file_oomem(ms, sizeof(*ms->mlist[i])); in file_apprentice()
672 mlist_free(ms->mlist[i]); in file_apprentice()
673 ms->mlist[i] = NULL; in file_apprentice()
696 mlist_free(ms->mlist[i]); in file_apprentice()
697 ms->mlist[i] = NULL; in file_apprentice()
711 mlist_free(ms->mlist[i]); in file_apprentice()
712 ms->mlist[i] = NULL; in file_apprentice()
948 apprentice_list(struct mlist *mlist, int mode) in apprentice_list() argument
951 struct mlist *ml; in apprentice_list()
952 for (ml = mlist->next; ml != mlist; ml = ml->next) { in apprentice_list()
3225 file_magicfind(struct magic_set *ms, const char *name, struct mlist *v) in file_magicfind()
3228 struct mlist *mlist, *ml; in file_magicfind() local
3230 mlist = ms->mlist[1]; in file_magicfind()
3232 for (ml = mlist->next; ml != mlist; ml = ml->next) { in file_magicfind()