Lines Matching refs:me
97 struct magic_entry *me; member
1299 addentry(struct magic_set *ms, struct magic_entry *me, in addentry() argument
1302 size_t i = me->mp->type == FILE_NAME ? 1 : 0; in addentry()
1303 if (mset[i].me == NULL || mset[i].count == mset[i].max) { in addentry()
1308 realloc(mset[i].me, sizeof(*mp) * incr))) == in addentry()
1315 mset[i].me = mp; in addentry()
1319 mset[i].me[mset[i].count++] = *me; in addentry()
1320 memset(me, 0, sizeof(*me)); in addentry()
1334 struct magic_entry me; in load_1() local
1345 memset(&me, 0, sizeof(me)); in load_1()
1377 if (me.mp == NULL) { in load_1()
1384 if ((*bang[i].fun)(ms, &me, in load_1()
1395 switch (parse(ms, &me, fn, line, lineno, action)) { in load_1()
1399 (void)addentry(ms, &me, mset); in load_1()
1407 if (me.mp) in load_1()
1408 (void)addentry(ms, &me, mset); in load_1()
1425 set_text_binary(struct magic_set *ms, struct magic_entry *me, uint32_t nme, in set_text_binary() argument
1435 set_test_type(me[starttest].mp, me[i].mp); in set_text_binary()
1439 me[i].mp->mimetype, in set_text_binary()
1440 me[i].mp->mimetype[0] == '\0' ? "" : "; ", in set_text_binary()
1441 me[i].mp->desc[0] ? me[i].mp->desc : "(no description)", in set_text_binary()
1442 me[i].mp->flag & BINTEST ? binary : text); in set_text_binary()
1443 if (me[i].mp->flag & BINTEST) { in set_text_binary()
1444 char *p = strstr(me[i].mp->desc, text); in set_text_binary()
1445 if (p && (p == me[i].mp->desc || in set_text_binary()
1447 (p + len - me[i].mp->desc == MAXstring in set_text_binary()
1453 } while (++i < nme && me[i].mp->cont_level != 0); in set_text_binary()
1458 set_last_default(struct magic_set *ms, struct magic_entry *me, uint32_t nme) in set_last_default() argument
1462 if (me[i].mp->cont_level == 0 && in set_last_default()
1463 me[i].mp->type == FILE_DEFAULT) { in set_last_default()
1465 if (me[i].mp->cont_level == 0) in set_last_default()
1469 ms->line = me[i].mp->lineno; in set_last_default()
1479 coalesce_entries(struct magic_set *ms, struct magic_entry *me, uint32_t nme, in coalesce_entries() argument
1486 mentrycount += me[i].cont_count; in coalesce_entries()
1502 (void)memcpy(*ma + mentrycount, me[i].mp, in coalesce_entries()
1503 me[i].cont_count * sizeof(**ma)); in coalesce_entries()
1504 mentrycount += me[i].cont_count; in coalesce_entries()
1511 magic_entry_free(struct magic_entry *me, uint32_t nme) in magic_entry_free() argument
1514 if (me == NULL) in magic_entry_free()
1517 free(me[i].mp); in magic_entry_free()
1518 free(me); in magic_entry_free()
1605 if (mset[j].me[i].mp->cont_level != 0) { in apprentice_load()
1609 i = set_text_binary(ms, mset[j].me, mset[j].count, i); in apprentice_load()
1611 if (mset[j].me) in apprentice_load()
1612 qsort(mset[j].me, mset[j].count, sizeof(*mset[0].me), in apprentice_load()
1619 set_last_default(ms, mset[j].me, mset[j].count); in apprentice_load()
1625 if (coalesce_entries(ms, mset[j].me, mset[j].count, in apprentice_load()
1635 magic_entry_free(mset[j].me, mset[j].count); in apprentice_load()
2034 parse(struct magic_set *ms, struct magic_entry *me, const char *file, in parse() argument
2064 if (me->mp == NULL) { in parse()
2068 if (me->cont_count == 0) { in parse()
2072 m = &me->mp[me->cont_count - 1]; in parse()
2078 if (me->cont_count == me->max_count) { in parse()
2080 size_t cnt = me->max_count + ALLOC_CHUNK; in parse()
2081 if ((nm = CAST(struct magic *, realloc(me->mp, in parse()
2086 me->mp = nm; in parse()
2087 me->max_count = CAST(uint32_t, cnt); in parse()
2089 m = &me->mp[me->cont_count++]; in parse()
2094 if (me->mp != NULL) in parse()
2100 me->mp = m; in parse()
2101 me->max_count = ALLOC_CHUNK; in parse()
2105 me->cont_count = 1; in parse()
2455 parse_strength(struct magic_set *ms, struct magic_entry *me, const char *line, in parse_strength() argument
2462 struct magic *m = &me->mp[0]; in parse_strength()
2521 parse_extra(struct magic_set *ms, struct magic_entry *me, const char *line, in parse_extra() argument
2527 struct magic *m = &me->mp[me->cont_count == 0 ? 0 : me->cont_count - 1]; in parse_extra()
2574 parse_apple(struct magic_set *ms, struct magic_entry *me, const char *line, in parse_apple() argument
2577 return parse_extra(ms, me, line, len, in parse_apple()
2579 sizeof(me->mp[me->cont_count - 1].apple), "APPLE", "!+-./?", 0); in parse_apple()
2586 parse_ext(struct magic_set *ms, struct magic_entry *me, const char *line, in parse_ext() argument
2589 return parse_extra(ms, me, line, len, in parse_ext()
2591 sizeof(me->mp[me->cont_count - 1].ext), "EXTENSION", ",!+-/@?_$&~", in parse_ext()
2602 parse_mime(struct magic_set *ms, struct magic_entry *me, const char *line, in parse_mime() argument
2605 return parse_extra(ms, me, line, len, in parse_mime()
2607 sizeof(me->mp[me->cont_count - 1].mimetype), "MIME", "+-/.$?:{};=", in parse_mime()