lmp
static TAILQ_HEAD(lmp_list, lmp) lmp_head = TAILQ_HEAD_INITIALIZER(lmp_head);
TAILQ_ENTRY(lmp) lmp_link;
struct lmp *lmp;
lmp = TAILQ_FIRST(&lmp_head);
TAILQ_REMOVE(&lmp_head, lmp, lmp_link);
free(lmp->p);
lm_free(&lmp->lml);
free(lmp);
struct lmp *lmp;
TAILQ_FOREACH(lmp, &lmp_head, lmp_link) {
if ((lmp->type == T_EXACT && strcmp(n, lmp->p) == 0) ||
(lmp->type == T_DIRECTORY && strncmp(n, lmp->p,
strlen(lmp->p)) == 0) ||
(lmp->type == T_BASENAME && strcmp(quickbasename(n),
lmp->p) == 0))
return (&lmp->lml);
struct lmp *lmp;
lmp = xmalloc(sizeof(struct lmp));
lmp->p = n;
lmp->type = T_DIRECTORY;
lmp->type = T_BASENAME;
lmp->type = T_EXACT;
TAILQ_INIT(&lmp->lml);
TAILQ_INSERT_HEAD(&lmp_head, lmp, lmp_link);
return (&lmp->lml);