summaryrefslogtreecommitdiff
path: root/src/magic.h.in
diff options
context:
space:
mode:
Diffstat (limited to 'src/magic.h.in')
-rw-r--r--src/magic.h.in83
1 files changed, 60 insertions, 23 deletions
diff --git a/src/magic.h.in b/src/magic.h.in
index 0d4c5ce..1134bdc 100644
--- a/src/magic.h.in
+++ b/src/magic.h.in
@@ -29,30 +29,35 @@
#include <sys/types.h>
-#define MAGIC_NONE 0x000000 /* No flags */
-#define MAGIC_DEBUG 0x000001 /* Turn on debugging */
-#define MAGIC_SYMLINK 0x000002 /* Follow symlinks */
-#define MAGIC_COMPRESS 0x000004 /* Check inside compressed files */
-#define MAGIC_DEVICES 0x000008 /* Look at the contents of devices */
-#define MAGIC_MIME_TYPE 0x000010 /* Return the MIME type */
-#define MAGIC_CONTINUE 0x000020 /* Return all matches */
-#define MAGIC_CHECK 0x000040 /* Print warnings to stderr */
-#define MAGIC_PRESERVE_ATIME 0x000080 /* Restore access time on exit */
-#define MAGIC_RAW 0x000100 /* Don't translate unprintable chars */
-#define MAGIC_ERROR 0x000200 /* Handle ENOENT etc as real errors */
-#define MAGIC_MIME_ENCODING 0x000400 /* Return the MIME encoding */
+#define MAGIC_NONE 0x0000000 /* No flags */
+#define MAGIC_DEBUG 0x0000001 /* Turn on debugging */
+#define MAGIC_SYMLINK 0x0000002 /* Follow symlinks */
+#define MAGIC_COMPRESS 0x0000004 /* Check inside compressed files */
+#define MAGIC_DEVICES 0x0000008 /* Look at the contents of devices */
+#define MAGIC_MIME_TYPE 0x0000010 /* Return the MIME type */
+#define MAGIC_CONTINUE 0x0000020 /* Return all matches */
+#define MAGIC_CHECK 0x0000040 /* Print warnings to stderr */
+#define MAGIC_PRESERVE_ATIME 0x0000080 /* Restore access time on exit */
+#define MAGIC_RAW 0x0000100 /* Don't convert unprintable chars */
+#define MAGIC_ERROR 0x0000200 /* Handle ENOENT etc as real errors */
+#define MAGIC_MIME_ENCODING 0x0000400 /* Return the MIME encoding */
#define MAGIC_MIME (MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
-#define MAGIC_APPLE 0x000800 /* Return the Apple creator and type */
-
-#define MAGIC_NO_CHECK_COMPRESS 0x001000 /* Don't check for compressed files */
-#define MAGIC_NO_CHECK_TAR 0x002000 /* Don't check for tar files */
-#define MAGIC_NO_CHECK_SOFT 0x004000 /* Don't check magic entries */
-#define MAGIC_NO_CHECK_APPTYPE 0x008000 /* Don't check application type */
-#define MAGIC_NO_CHECK_ELF 0x010000 /* Don't check for elf details */
-#define MAGIC_NO_CHECK_TEXT 0x020000 /* Don't check for text files */
-#define MAGIC_NO_CHECK_CDF 0x040000 /* Don't check for cdf files */
-#define MAGIC_NO_CHECK_TOKENS 0x100000 /* Don't check tokens */
-#define MAGIC_NO_CHECK_ENCODING 0x200000 /* Don't check text encodings */
+#define MAGIC_APPLE 0x0000800 /* Return the Apple creator/type */
+#define MAGIC_EXTENSION 0x1000000 /* Return a /-separated list of
+ * extensions */
+#define MAGIC_COMPRESS_TRANSP 0x2000000 /* Check inside compressed files
+ * but not report compression */
+#define MAGIC_NODESC (MAGIC_EXTENSION|MAGIC_MIME|MAGIC_APPLE)
+
+#define MAGIC_NO_CHECK_COMPRESS 0x0001000 /* Don't check for compressed files */
+#define MAGIC_NO_CHECK_TAR 0x0002000 /* Don't check for tar files */
+#define MAGIC_NO_CHECK_SOFT 0x0004000 /* Don't check magic entries */
+#define MAGIC_NO_CHECK_APPTYPE 0x0008000 /* Don't check application type */
+#define MAGIC_NO_CHECK_ELF 0x0010000 /* Don't check for elf details */
+#define MAGIC_NO_CHECK_TEXT 0x0020000 /* Don't check for text files */
+#define MAGIC_NO_CHECK_CDF 0x0040000 /* Don't check for cdf files */
+#define MAGIC_NO_CHECK_TOKENS 0x0100000 /* Don't check tokens */
+#define MAGIC_NO_CHECK_ENCODING 0x0200000 /* Don't check text encodings */
/* No built-in tests; only consult the magic file */
#define MAGIC_NO_CHECK_BUILTIN ( \
@@ -68,6 +73,35 @@
0 \
)
+#define MAGIC_SNPRINTB "\177\020\
+b\0debug\0\
+b\1symlink\0\
+b\2compress\0\
+b\3devices\0\
+b\4mime_type\0\
+b\5continue\0\
+b\6check\0\
+b\7preserve_atime\0\
+b\10raw\0\
+b\11error\0\
+b\12mime_encoding\0\
+b\13apple\0\
+b\14no_check_compress\0\
+b\15no_check_tar\0\
+b\16no_check_soft\0\
+b\17no_check_sapptype\0\
+b\20no_check_elf\0\
+b\21no_check_text\0\
+b\22no_check_cdf\0\
+b\23no_check_reserved0\0\
+b\24no_check_tokens\0\
+b\25no_check_encoding\0\
+b\26no_check_reserved1\0\
+b\27no_check_reserved2\0\
+b\30extension\0\
+b\31transp_compression\0\
+"
+
/* Defined for backwards compatibility (renamed) */
#define MAGIC_NO_CHECK_ASCII MAGIC_NO_CHECK_TEXT
@@ -92,6 +126,7 @@ const char *magic_descriptor(magic_t, int);
const char *magic_buffer(magic_t, const void *, size_t);
const char *magic_error(magic_t);
+int magic_getflags(magic_t);
int magic_setflags(magic_t, int);
int magic_version(void);
@@ -108,6 +143,8 @@ int magic_errno(magic_t);
#define MAGIC_PARAM_ELF_PHNUM_MAX 2
#define MAGIC_PARAM_ELF_SHNUM_MAX 3
#define MAGIC_PARAM_ELF_NOTES_MAX 4
+#define MAGIC_PARAM_REGEX_MAX 5
+#define MAGIC_PARAM_BYTES_MAX 6
int magic_setparam(magic_t, int, const void *);
int magic_getparam(magic_t, int, void *);