forked from hey-red/Mime
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMagicOpenFlags.cs
149 lines (121 loc) · 4.18 KB
/
MagicOpenFlags.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
using System;
namespace HeyRed.Mime
{
[Flags]
public enum MagicOpenFlags
{
// From LIBMAGIC(3) man.
/// <summary>
/// No special handling.
/// </summary>
MAGIC_NONE = 0x000000,
/// <summary>
/// Print debugging messages to stderr.
/// </summary>
MAGIC_DEBUG = 0x000001,
/// <summary>
/// If the file queried is a symlink, follow it.
/// </summary>
MAGIC_SYMLINK = 0x000002,
/// <summary>
/// If the file is compressed, unpack it and look at the contents.
/// </summary>
MAGIC_COMPRESS = 0x000004,
/// <summary>
/// If the file is a block or character special device, then
/// open the device and try to look in its contents.
/// </summary>
MAGIC_DEVICES = 0x000008,
/// <summary>
/// Return a MIME type string, instead of a textual description.
/// </summary>
MAGIC_MIME_TYPE = 0x000010,
/// <summary>
/// Return all matches, not just the first.
/// </summary>
MAGIC_CONTINUE = 0x000020,
/// <summary>
/// Check the magic database for consistency and print warnings to stderr.
/// </summary>
MAGIC_CHECK = 0x000040,
/// <summary>
/// On systems that support utime(3) or utimes(2), attempt to
/// preserve the access time of files analysed.
/// </summary>
MAGIC_PRESERVE_ATIME = 0x000080,
/// <summary>
/// Don't translate unprintable characters to a \ooo octal representation.
/// </summary>
MAGIC_RAW = 0x000100,
/// <summary>
/// Treat operating system errors while trying to open files
/// and follow symlinks as real errors, instead of printing
/// them in the magic buffer.
/// </summary>
MAGIC_ERROR = 0x000200,
/// <summary>
/// Return a MIME encoding, instead of a textual description.
/// </summary>
MAGIC_MIME_ENCODING = 0x000400,
/// <summary>
/// A shorthand for MAGIC_MIME_TYPE | MAGIC_MIME_ENCODING.
/// </summary>
MAGIC_MIME = (MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING),
/// <summary>
/// Return the Apple creator and type.
/// </summary>
MAGIC_APPLE = 0x000800,
/// <summary>
/// Return a slash-separated list of extensions for this file type.
/// </summary>
MAGIC_EXTENSION = 0x1000000,
/// <summary>
/// Don't report on compression, only report about the uncompressed data.
/// </summary>
MAGIC_COMPRESS_TRANSP = 0x200000,
/// <summary>
/// A shorthand for (MAGIC_EXTENSION|MAGIC_MIME|MAGIC_APPLE)
/// </summary>
MAGIC_NODESC = (MAGIC_EXTENSION|MAGIC_MIME|MAGIC_APPLE),
/// <summary>
/// Don't look inside compressed files.
/// </summary>
MAGIC_NO_CHECK_COMPRESS = 0x001000,
/// <summary>
/// Don't examine tar files.
/// </summary>
MAGIC_NO_CHECK_TAR = 0x002000,
/// <summary>
/// Don't consult magic files.
/// </summary>
MAGIC_NO_CHECK_SOFT = 0x004000,
/// <summary>
/// Don't check for EMX application type (only on EMX).
/// </summary>
MAGIC_NO_CHECK_APPTYPE = 0x008000,
/// <summary>
/// Don't print ELF details.
/// </summary>
MAGIC_NO_CHECK_ELF = 0x010000,
/// <summary>
/// Don't check for various types of text files.
/// </summary>
MAGIC_NO_CHECK_TEXT = 0x020000,
/// <summary>
/// Don't get extra information on MS Composite Document Files.
/// </summary>
MAGIC_NO_CHECK_CDF = 0x040000,
/// <summary>
/// Don't look for known tokens inside ascii files.
/// </summary>
MAGIC_NO_CHECK_TOKENS = 0x100000,
/// <summary>
/// Don't check text encodings.
/// </summary>
MAGIC_NO_CHECK_ENCODING = 0x200000,
/// <summary>
/// Don't check for JSON files
/// </summary>
MAGIC_NO_CHECK_JSON = 0x400000,
}
}