Lines Matching refs:magic
92 struct magic *mp;
106 struct magic *magic[MAGIC_SETS]; member
115 private int getvalue(struct magic_set *ms, struct magic *, const char **, int);
117 private const char *getstr(struct magic_set *, struct magic *, const char *,
123 private size_t apprentice_magic_strength(const struct magic *);
130 private void byteswap(struct magic *, uint32_t);
131 private void bs1(struct magic *);
141 private int check_format(struct magic_set *, struct magic *);
148 private size_t magicsize = sizeof(struct magic);
378 ml->magic = map->magic[idx]; in add_mlist()
400 (unsigned long)sizeof(*map->magic[0]), in apprentice_1()
505 if (map->magic[j]) { in apprentice_unmap()
506 efree(map->magic[j]); in apprentice_unmap()
648 apprentice_magic_strength(const struct magic *m) in apprentice_magic_strength()
818 struct magic *m = &ml->magic[magindex]; in apprentice_list()
822 ml->magic[magindex + 1].cont_level != 0) in apprentice_list()
832 ml->magic[magindex + 1].cont_level != 0 && in apprentice_list()
833 *ml->magic[magindex].desc == '\0' && in apprentice_list()
834 *ml->magic[magindex].mimetype == '\0') in apprentice_list()
839 ml->magic[magindex].desc, in apprentice_list()
840 ml->magic[magindex].mimetype); in apprentice_list()
846 set_test_type(struct magic *mstart, struct magic *m) in set_test_type()
1106 struct magic **ma, uint32_t *nma) in coalesce_entries()
1115 if ((*ma = CAST(struct magic *, emalloc(slen))) == NULL) { in coalesce_entries()
1239 &map->magic[j], &map->nmagic[j]) == -1) { in apprentice_load()
1251 if (map->magic[j]) in apprentice_load()
1252 efree(map->magic[j]); in apprentice_load()
1264 file_signextend(struct magic_set *ms, struct magic *m, uint64_t v) in file_signextend()
1338 string_modifier_check(struct magic_set *ms, struct magic *m) in string_modifier_check()
1502 struct magic *m; in parse()
1540 struct magic *nm; in parse()
1542 if ((nm = CAST(struct magic *, erealloc(me->mp, in parse()
1557 if ((m = CAST(struct magic *, emalloc(len))) == NULL) { in parse()
1969 struct magic *m = &me->mp[0]; in parse_strength()
2027 struct magic *m = &me->mp[me->cont_count == 0 ? 0 : me->cont_count - 1]; in parse_apple()
2062 struct magic *m = &me->mp[me->cont_count == 0 ? 0 : me->cont_count - 1]; in parse_mime()
2221 check_format(struct magic_set *ms, struct magic *m) in check_format()
2276 getvalue(struct magic_set *ms, struct magic *m, const char **p, int action) in getvalue()
2336 getstr(struct magic_set *ms, struct magic *m, const char *s, int warn) in getstr()
2697 nentries = (uint32_t)(st.sb.st_size / sizeof(struct magic)); in apprentice_map()
2698 entries = (uint32_t)(st.sb.st_size / sizeof(struct magic)); in apprentice_map()
2699 if ((off_t)(entries * sizeof(struct magic)) != st.sb.st_size) { in apprentice_map()
2702 sizeof(struct magic)); in apprentice_map()
2706 map->magic[0] = CAST(struct magic *, map->p) + 1; in apprentice_map()
2714 map->magic[i + 1] = map->magic[i] + map->nmagic[i]; in apprentice_map()
2725 byteswap(map->magic[i], map->nmagic[i]); in apprentice_map()
2754 static const size_t m = sizeof(**map->magic); in apprentice_compile()
2789 if (php_stream_seek(stream,(off_t)sizeof(struct magic), SEEK_SET) != sizeof(struct magic)) { in apprentice_compile()
2796 if (php_stream_write(stream, (const char *)map->magic[i], len) != (ssize_t)len) { in apprentice_compile()
2866 byteswap(struct magic *magic, uint32_t nmagic) argument
2870 bs1(&magic[i]);
2938 bs1(struct magic *m)
2955 file_pstring_length_size(const struct magic *m)
2972 file_pstring_get_length(const struct magic *m, const char *s)
3011 struct magic *ma = ml->magic;
3017 v->magic = &ma[i];