Lines Matching refs:magic

18  * mod_mime_magic: MIME type lookup via file magic numbers
62 * - struct magic has been converted from an array to a single-ended linked
128 struct magic {
129 struct magic *next; /* link to next entry */
130 int lineno; /* line number from magic file */
140 long offset; /* offset to magic number */
201 char magic[8];
209 /* The magic field is filled with this if uname and gname are valid. */
221 static int getvalue(server_rec *, struct magic *, char **);
228 struct magic *, apr_size_t);
229 static int mcheck(request_rec *, union VALUETYPE *, struct magic *);
230 static void mprint(request_rec *, union VALUETYPE *, struct magic *);
243 * tokens in /etc/magic must appear at fixed offsets into the file. Don't
456 const char *magicfile; /* where magic be found */
457 struct magic *magic; /* head of magic config list */
458 struct magic *last;
488 new->magic = NULL;
808 "data in magic file",
891 * try tests in /etc/magic (or surrogate magic file)
911 * apprentice - load configuration from the magic file r
923 struct magic *m, *prevm;
931 MODNAME ": Invalid magic file path %s", conf->magicfile);
937 MODNAME ": can't read magic file %s", fname);
941 /* set up the magic list (empty) */
942 conf->magic = conf->last = NULL;
990 conf->magic ? "set" : "NULL",
991 (conf->magic && conf->magic->next) ? "set" : "NULL",
1002 for (m = conf->magic; m; m = m->next) {
1027 static unsigned long signextend(server_rec *s, struct magic *m, unsigned long v)
1062 * parse one line from magic file, put into magic[index++] if valid
1066 struct magic *m;
1071 /* allocate magic structure entry */
1072 m = (struct magic *) apr_pcalloc(p, sizeof(struct magic));
1076 if (!conf->magic || !conf->last) {
1077 conf->magic = conf->last = m;
1084 /* set values in magic structure */
1287 * Read a numeric value from a pointer, into the value union of a magic
1288 * pointer, according to the magic type. Update the string pointer to point
1291 static int getvalue(server_rec *s, struct magic *m, char **p)
1492 * softmagic - lookup one file in database (already read from /etc/magic by
1540 struct magic *m;
1547 conf->magic ? "set" : "NULL",
1548 (conf->magic && conf->magic->next) ? "set" : "NULL",
1553 for (m = conf->magic; m; m = m->next) {
1570 for (m = conf->magic; m; m = m->next) {
1580 struct magic *m_cont;
1692 static void mprint(request_rec *r, union VALUETYPE *p, struct magic *m)
1745 static int mconvert(request_rec *r, union VALUETYPE *p, struct magic *m)
1786 struct magic *m, apr_size_t nbytes)
1823 static int mcheck(request_rec *r, union VALUETYPE *p, struct magic *m)
2048 char *magic;
2091 if (memcmp(buf, compr[i].magic, compr[i].maglen) == 0)
2253 if (0 == strcmp(header->header.magic, TMAGIC))
2366 struct magic *m, *prevm;
2384 for (m = conf->magic; m; m = m->next) {
2427 if (!conf || !conf->magic) {