Lines Matching refs:me
99 struct magic_entry *me; member
1227 addentry(struct magic_set *ms, struct magic_entry *me, in addentry() argument
1230 size_t i = me->mp->type == FILE_NAME ? 1 : 0; in addentry()
1231 if (mset[i].me == NULL || mset[i].count == mset[i].max) { in addentry()
1236 erealloc(mset[i].me, sizeof(*mp) * incr))) == in addentry()
1243 mset[i].me = mp; in addentry()
1247 mset[i].me[mset[i].count++] = *me; in addentry()
1248 memset(me, 0, sizeof(*me)); in addentry()
1263 struct magic_entry me; in load_1() local
1279 memset(&me, 0, sizeof(me)); in load_1()
1308 if (me.mp == NULL) { in load_1()
1315 if ((*bang[i].fun)(ms, &me, in load_1()
1326 switch (parse(ms, &me, line, lineno, action)) { in load_1()
1330 (void)addentry(ms, &me, mset); in load_1()
1338 if (me.mp) in load_1()
1339 (void)addentry(ms, &me, mset); in load_1()
1356 set_text_binary(struct magic_set *ms, struct magic_entry *me, uint32_t nme, in set_text_binary() argument
1366 set_test_type(me[starttest].mp, me[i].mp); in set_text_binary()
1370 me[i].mp->mimetype, in set_text_binary()
1371 me[i].mp->mimetype[0] == '\0' ? "" : "; ", in set_text_binary()
1372 me[i].mp->desc[0] ? me[i].mp->desc : "(no description)", in set_text_binary()
1373 me[i].mp->flag & BINTEST ? binary : text); in set_text_binary()
1374 if (me[i].mp->flag & BINTEST) { in set_text_binary()
1375 char *p = strstr(me[i].mp->desc, text); in set_text_binary()
1376 if (p && (p == me[i].mp->desc || in set_text_binary()
1378 (p + len - me[i].mp->desc == MAXstring in set_text_binary()
1384 } while (++i < nme && me[i].mp->cont_level != 0); in set_text_binary()
1389 set_last_default(struct magic_set *ms, struct magic_entry *me, uint32_t nme) in set_last_default() argument
1393 if (me[i].mp->cont_level == 0 && in set_last_default()
1394 me[i].mp->type == FILE_DEFAULT) { in set_last_default()
1396 if (me[i].mp->cont_level == 0) in set_last_default()
1400 ms->line = me[i].mp->lineno; in set_last_default()
1410 coalesce_entries(struct magic_set *ms, struct magic_entry *me, uint32_t nme, in coalesce_entries() argument
1417 mentrycount += me[i].cont_count; in coalesce_entries()
1433 (void)memcpy(*ma + mentrycount, me[i].mp, in coalesce_entries()
1434 me[i].cont_count * sizeof(**ma)); in coalesce_entries()
1435 mentrycount += me[i].cont_count; in coalesce_entries()
1442 magic_entry_free(struct magic_entry *me, uint32_t nme) in magic_entry_free() argument
1445 if (me == NULL) in magic_entry_free()
1448 efree(me[i].mp); in magic_entry_free()
1449 efree(me); in magic_entry_free()
1535 if (mset[j].me[i].mp->cont_level != 0) { in apprentice_load()
1539 i = set_text_binary(ms, mset[j].me, mset[j].count, i); in apprentice_load()
1541 if (mset[j].me) in apprentice_load()
1542 qsort(mset[j].me, mset[j].count, sizeof(*mset[j].me), in apprentice_load()
1549 set_last_default(ms, mset[j].me, mset[j].count); in apprentice_load()
1555 if (coalesce_entries(ms, mset[j].me, mset[j].count, in apprentice_load()
1564 magic_entry_free(mset[j].me, mset[j].count); in apprentice_load()
1963 parse(struct magic_set *ms, struct magic_entry *me, const char *line, in parse() argument
1993 if (me->mp == NULL) { in parse()
1997 if (me->cont_count == 0) { in parse()
2001 m = &me->mp[me->cont_count - 1]; in parse()
2007 if (me->cont_count == me->max_count) { in parse()
2009 size_t cnt = me->max_count + ALLOC_CHUNK; in parse()
2010 if ((nm = CAST(struct magic *, erealloc(me->mp, in parse()
2015 me->mp = nm; in parse()
2016 me->max_count = CAST(uint32_t, cnt); in parse()
2018 m = &me->mp[me->cont_count++]; in parse()
2023 if (me->mp != NULL) in parse()
2029 me->mp = m; in parse()
2030 me->max_count = ALLOC_CHUNK; in parse()
2034 me->cont_count = 1; in parse()
2380 parse_strength(struct magic_set *ms, struct magic_entry *me, const char *line, in parse_strength() argument
2386 struct magic *m = &me->mp[0]; in parse_strength()
2442 parse_extra(struct magic_set *ms, struct magic_entry *me, const char *line, in parse_extra() argument
2447 struct magic *m = &me->mp[me->cont_count == 0 ? 0 : me->cont_count - 1]; in parse_extra()
2494 parse_apple(struct magic_set *ms, struct magic_entry *me, const char *line, in parse_apple() argument
2497 return parse_extra(ms, me, line, len, in parse_apple()
2499 sizeof(me->mp[0].apple), "APPLE", "!+-./?", 0); in parse_apple()
2506 parse_ext(struct magic_set *ms, struct magic_entry *me, const char *line, in parse_ext() argument
2509 return parse_extra(ms, me, line, len, in parse_ext()
2511 sizeof(me->mp[0].ext), "EXTENSION", ",!+-/@?_$&", 0); /* & for b&w */ in parse_ext()
2519 parse_mime(struct magic_set *ms, struct magic_entry *me, const char *line, in parse_mime() argument
2522 return parse_extra(ms, me, line, len, in parse_mime()
2524 sizeof(me->mp[0].mimetype), "MIME", "+-/.$?:{}", 1); in parse_mime()