github.com/jurelou/go-magic@v0.0.0-20230518182705-f2995a311800/constants.go (about) 1 package magic 2 3 /* 4 #include "functions.h" 5 */ 6 import "C" 7 8 const ( 9 // Controls how many levels of recursion will be followed for 10 // indirect magic entries. 11 PARAM_INDIR_MAX int = C.MAGIC_PARAM_INDIR_MAX 12 13 // Controls the maximum number of calls for name or use magic. 14 PARAM_NAME_MAX int = C.MAGIC_PARAM_NAME_MAX 15 16 // Controls how many ELF program sections will be processed. 17 PARAM_ELF_PHNUM_MAX int = C.MAGIC_PARAM_ELF_PHNUM_MAX 18 19 // Controls how many ELF sections will be processed. 20 PARAM_ELF_SHNUM_MAX int = C.MAGIC_PARAM_ELF_SHNUM_MAX 21 22 // Controls how many ELF notes will be processed. 23 PARAM_ELF_NOTES_MAX int = C.MAGIC_PARAM_ELF_NOTES_MAX 24 25 // Controls the length limit for regular expression searches. 26 PARAM_REGEX_MAX int = C.MAGIC_PARAM_REGEX_MAX 27 28 // Controls the maximum number of bytes to read from a file. 29 PARAM_BYTES_MAX int = C.MAGIC_PARAM_BYTES_MAX 30 31 // No special handling and/or flags specified. Default behavior. 32 NONE int = C.MAGIC_NONE 33 34 // Print debugging messages to standard error output. 35 DEBUG int = C.MAGIC_DEBUG 36 37 // If the file queried is a symbolic link, follow it. 38 SYMLINK int = C.MAGIC_SYMLINK 39 40 // If the file is compressed, unpack it and look at the contents. 41 COMPRESS int = C.MAGIC_COMPRESS 42 43 // If the file is a block or character special device, then open 44 // the device and try to look at the contents. 45 DEVICES int = C.MAGIC_DEVICES 46 47 // Return a MIME type string, instead of a textual description. 48 MIME_TYPE int = C.MAGIC_MIME_TYPE 49 50 // Return all matches, not just the first. 51 CONTINUE int = C.MAGIC_CONTINUE 52 53 // Check the Magic database for consistency and print warnings to 54 // standard error output. 55 CHECK int = C.MAGIC_CHECK 56 57 // Attempt to preserve access time (atime, utime or utimes) of the 58 // file queried on systems that support such system calls. 59 PRESERVE_ATIME int = C.MAGIC_PRESERVE_ATIME 60 61 // Do not convert unprintable characters to an octal representation. 62 RAW int = C.MAGIC_RAW 63 64 // Treat operating system errors while trying to open files and follow 65 // symbolic links as first class errors, instead of storing them in the 66 // Magic library error buffer for retrieval later. 67 ERROR int = C.MAGIC_ERROR 68 69 // Return a MIME encoding, instead of a textual description. 70 MIME_ENCODING int = C.MAGIC_MIME_ENCODING 71 72 // A shorthand for using MIME_TYPE and MIME_ENCODING flags together. 73 MIME int = C.MAGIC_MIME 74 75 // Return the Apple creator and type. 76 APPLE int = C.MAGIC_APPLE 77 78 // Do not look for, or inside compressed files. 79 NO_CHECK_COMPRESS int = C.MAGIC_NO_CHECK_COMPRESS 80 81 // Do not look for, or inside tar archive files. 82 NO_CHECK_TAR int = C.MAGIC_NO_CHECK_TAR 83 84 // Do not consult Magic files. 85 NO_CHECK_SOFT int = C.MAGIC_NO_CHECK_SOFT 86 87 // Check for EMX application type (only supported on EMX). 88 NO_CHECK_APPTYPE int = C.MAGIC_NO_CHECK_APPTYPE 89 90 // Do not check for ELF files (do not examine ELF file details). 91 NO_CHECK_ELF int = C.MAGIC_NO_CHECK_ELF 92 93 // Do not check for various types of text files. 94 NO_CHECK_TEXT int = C.MAGIC_NO_CHECK_TEXT 95 96 // Do not check for CDF files. 97 NO_CHECK_CDF int = C.MAGIC_NO_CHECK_CDF 98 99 // Do not check for CDF files. 100 NO_CHECK_CSV int = C.MAGIC_NO_CHECK_CSV 101 102 // Do not look for known tokens inside ASCII files. 103 NO_CHECK_TOKENS int = C.MAGIC_NO_CHECK_TOKENS 104 105 // Return a MIME encoding, instead of a textual description. 106 NO_CHECK_ENCODING int = C.MAGIC_NO_CHECK_ENCODING 107 108 // Do not check for JSON files. 109 NO_CHECK_JSON int = C.MAGIC_NO_CHECK_JSON 110 111 // Do not use built-in tests; only consult the Magic files. 112 NO_CHECK_BUILTIN int = C.MAGIC_NO_CHECK_BUILTIN 113 114 // Do not check for various types of text files, same as NO_CHECK_TEXT. 115 NO_CHECK_ASCII int = C.MAGIC_NO_CHECK_TEXT 116 117 // Do not look for Fortran sequences inside ASCII files. 118 NO_CHECK_FORTRAN int = C.MAGIC_NO_CHECK_FORTRAN 119 120 // Do not look for troff sequences inside ASCII files. 121 NO_CHECK_TROFF int = C.MAGIC_NO_CHECK_TROFF 122 123 // Return a slash-separated list of extensions for this file type. 124 EXTENSION int = C.MAGIC_EXTENSION 125 126 // Do not report on compression, only report about the uncompressed data. 127 COMPRESS_TRANSP int = C.MAGIC_COMPRESS_TRANSP 128 )