Lines Matching refs:me
112 struct magic_entry *me; member
1103 addentry(struct magic_set *ms, struct magic_entry *me, in addentry() argument
1106 size_t i = me->mp->type == FILE_NAME ? 1 : 0; in addentry()
1112 erealloc(mset[i].me, sizeof(*mp) * mset[i].max))) == in addentry()
1119 mset[i].me = mp; in addentry()
1121 mset[i].me[mset[i].count++] = *me; in addentry()
1122 memset(me, 0, sizeof(*me)); in addentry()
1137 struct magic_entry me; in load_1() local
1153 memset(&me, 0, sizeof(me)); in load_1()
1182 if (me.mp == NULL) { in load_1()
1189 if ((*bang[i].fun)(ms, &me, in load_1()
1200 switch (parse(ms, &me, line, lineno, action)) { in load_1()
1204 (void)addentry(ms, &me, mset); in load_1()
1212 if (me.mp) in load_1()
1213 (void)addentry(ms, &me, mset); in load_1()
1230 set_text_binary(struct magic_set *ms, struct magic_entry *me, uint32_t nme, in set_text_binary() argument
1240 set_test_type(me[starttest].mp, me[i].mp); in set_text_binary()
1244 me[i].mp->mimetype, in set_text_binary()
1245 me[i].mp->mimetype[0] == '\0' ? "" : "; ", in set_text_binary()
1246 me[i].mp->desc[0] ? me[i].mp->desc : "(no description)", in set_text_binary()
1247 me[i].mp->flag & BINTEST ? binary : text); in set_text_binary()
1248 if (me[i].mp->flag & BINTEST) { in set_text_binary()
1249 char *p = strstr(me[i].mp->desc, text); in set_text_binary()
1250 if (p && (p == me[i].mp->desc || in set_text_binary()
1252 (p + len - me[i].mp->desc == MAXstring in set_text_binary()
1258 } while (++i < nme && me[i].mp->cont_level != 0); in set_text_binary()
1263 set_last_default(struct magic_set *ms, struct magic_entry *me, uint32_t nme) in set_last_default() argument
1267 if (me[i].mp->cont_level == 0 && in set_last_default()
1268 me[i].mp->type == FILE_DEFAULT) { in set_last_default()
1270 if (me[i].mp->cont_level == 0) in set_last_default()
1274 ms->line = me[i].mp->lineno; in set_last_default()
1284 coalesce_entries(struct magic_set *ms, struct magic_entry *me, uint32_t nme, in coalesce_entries() argument
1291 mentrycount += me[i].cont_count; in coalesce_entries()
1301 (void)memcpy(*ma + mentrycount, me[i].mp, in coalesce_entries()
1302 me[i].cont_count * sizeof(**ma)); in coalesce_entries()
1303 mentrycount += me[i].cont_count; in coalesce_entries()
1310 magic_entry_free(struct magic_entry *me, uint32_t nme) in magic_entry_free() argument
1313 if (me == NULL) in magic_entry_free()
1316 efree(me[i].mp); in magic_entry_free()
1317 efree(me); in magic_entry_free()
1403 if (mset[j].me[i].mp->cont_level != 0) { in apprentice_load()
1407 i = set_text_binary(ms, mset[j].me, mset[j].count, i); in apprentice_load()
1409 if (mset[j].me) in apprentice_load()
1410 qsort(mset[j].me, mset[j].count, sizeof(*mset[j].me), in apprentice_load()
1417 set_last_default(ms, mset[j].me, mset[j].count); in apprentice_load()
1420 if (coalesce_entries(ms, mset[j].me, mset[j].count, in apprentice_load()
1429 magic_entry_free(mset[j].me, mset[j].count); in apprentice_load()
1816 parse(struct magic_set *ms, struct magic_entry *me, const char *line, in parse() argument
1846 if (me->mp == NULL) { in parse()
1850 if (me->cont_count == 0) { in parse()
1854 m = &me->mp[me->cont_count - 1]; in parse()
1860 if (me->cont_count == me->max_count) { in parse()
1862 size_t cnt = me->max_count + ALLOC_CHUNK; in parse()
1863 if ((nm = CAST(struct magic *, erealloc(me->mp, in parse()
1868 me->mp = nm; in parse()
1869 me->max_count = CAST(uint32_t, cnt); in parse()
1871 m = &me->mp[me->cont_count++]; in parse()
1876 if (me->mp != NULL) in parse()
1882 me->mp = m; in parse()
1883 me->max_count = ALLOC_CHUNK; in parse()
1887 me->cont_count = 1; in parse()
2222 parse_strength(struct magic_set *ms, struct magic_entry *me, const char *line, in parse_strength() argument
2228 struct magic *m = &me->mp[0]; in parse_strength()
2284 parse_extra(struct magic_set *ms, struct magic_entry *me, const char *line, in parse_extra() argument
2289 struct magic *m = &me->mp[me->cont_count == 0 ? 0 : me->cont_count - 1]; in parse_extra()
2336 parse_apple(struct magic_set *ms, struct magic_entry *me, const char *line, in parse_apple() argument
2339 struct magic *m = &me->mp[0]; in parse_apple()
2341 return parse_extra(ms, me, line, len, in parse_apple()
2350 parse_ext(struct magic_set *ms, struct magic_entry *me, const char *line, in parse_ext() argument
2353 struct magic *m = &me->mp[0]; in parse_ext()
2355 return parse_extra(ms, me, line, len, in parse_ext()
2365 parse_mime(struct magic_set *ms, struct magic_entry *me, const char *line, in parse_mime() argument
2368 struct magic *m = &me->mp[0]; in parse_mime()
2370 return parse_extra(ms, me, line, len, in parse_mime()