Lines Matching refs:magic

92 	struct magic *mp;	
100 struct magic *magic[MAGIC_SETS]; member
109 private int getvalue(struct magic_set *ms, struct magic *, const char **, int);
111 private const char *getstr(struct magic_set *, struct magic *, const char *,
117 private size_t apprentice_magic_strength(const struct magic *);
124 private void byteswap(struct magic *, uint32_t);
125 private void bs1(struct magic *);
135 private int check_format(struct magic_set *, struct magic *);
143 private size_t magicsize = sizeof(struct magic);
372 ml->magic = map->magic[idx]; in add_mlist()
394 (unsigned long)sizeof(*map->magic[0]), in apprentice_1()
499 if (map->magic[j]) { in apprentice_unmap()
500 efree(map->magic[j]); in apprentice_unmap()
633 apprentice_magic_strength(const struct magic *m) in apprentice_magic_strength()
803 struct magic *m = &ml->magic[magindex]; in apprentice_list()
807 ml->magic[magindex + 1].cont_level != 0) in apprentice_list()
817 ml->magic[magindex + 1].cont_level != 0 && in apprentice_list()
818 *ml->magic[magindex].desc == '\0' && in apprentice_list()
819 *ml->magic[magindex].mimetype == '\0') in apprentice_list()
824 ml->magic[magindex].desc, in apprentice_list()
825 ml->magic[magindex].mimetype); in apprentice_list()
831 set_test_type(struct magic *mstart, struct magic *m) in set_test_type()
1095 struct magic **ma, uint32_t *nma) in coalesce_entries()
1104 if ((*ma = CAST(struct magic *, emalloc(slen))) == NULL) { in coalesce_entries()
1237 &map->magic[j], &map->nmagic[j]) == -1) { in apprentice_load()
1249 if (map->magic[j]) in apprentice_load()
1250 efree(map->magic[j]); in apprentice_load()
1262 file_signextend(struct magic_set *ms, struct magic *m, uint64_t v) in file_signextend()
1335 string_modifier_check(struct magic_set *ms, struct magic *m) in string_modifier_check()
1499 struct magic *m; in parse()
1537 struct magic *nm; in parse()
1539 if ((nm = CAST(struct magic *, erealloc(me->mp, in parse()
1554 if ((m = CAST(struct magic *, emalloc(len))) == NULL) { in parse()
1966 struct magic *m = &me->mp[0]; in parse_strength()
2019 struct magic *m = &me->mp[me->cont_count == 0 ? 0 : me->cont_count - 1]; in parse_apple()
2054 struct magic *m = &me->mp[me->cont_count == 0 ? 0 : me->cont_count - 1]; in parse_mime()
2213 check_format(struct magic_set *ms, struct magic *m) in check_format()
2268 getvalue(struct magic_set *ms, struct magic *m, const char **p, int action) in getvalue()
2328 getstr(struct magic_set *ms, struct magic *m, const char *s, int warn) in getstr()
2693 nentries = (uint32_t)(st.sb.st_size / sizeof(struct magic)); in apprentice_map()
2694 entries = (uint32_t)(st.sb.st_size / sizeof(struct magic)); in apprentice_map()
2695 if ((off_t)(entries * sizeof(struct magic)) != st.sb.st_size) { in apprentice_map()
2698 sizeof(struct magic)); in apprentice_map()
2702 map->magic[0] = CAST(struct magic *, map->p) + 1; in apprentice_map()
2710 map->magic[i + 1] = map->magic[i] + map->nmagic[i]; in apprentice_map()
2721 byteswap(map->magic[i], map->nmagic[i]); in apprentice_map()
2750 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];