Lines Matching full:magic
36 FILE_RCSID("@(#)$File: magic.c,v 1.123 2023/12/29 18:04:48 christos Exp $")
39 #include "magic.h"
125 "%s/share/misc/magic.mgc",
126 "%s/magic.mgc",
149 "%s/../share/misc/magic.mgc", dllpath);
177 static const char hmagic[] = "/.magic/magic.mgc";
189 return MAGIC;
191 if (asprintf(&hmagicpath, "%s/.magic.mgc", home) < 0)
192 return MAGIC;
195 if (asprintf(&hmagicpath, "%s/.magic", home) < 0)
196 return MAGIC;
202 return MAGIC;
208 if (asprintf(&default_magic, "%s:%s", hmagicpath, MAGIC) < 0)
215 return MAGIC;
224 /* Before anything else, try to get a magic file from user HOME */
228 /* First, try to get a magic file from user-application data */
232 /* Second, try to get a magic file from the user profile data */
237 /* Third, try to get a magic file from Common Files */
241 /* Fourth, try to get magic file relative to exe location */
244 /* Fifth, try to get magic file relative to dll location */
247 /* Avoid MAGIC constant - it likely points to a file within MSys tree */
259 magicfile = getenv("MAGIC");
263 return action == FILE_LOAD ? get_default_magic() : MAGIC;
314 * load a magic file
326 * Install a set of compiled magic buffers.
334 return buffer_apprentice(ms, RCAST(struct magic **, bufs),
570 return "Magic database is not open";