Libmagicxx v5.1.1
A C++ wrapper library over the Magic Number Recognition Library.
|
#include <sys/types.h>
Go to the source code of this file.
Macros | |
#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 0x0000800 /* Return the Apple creator/type */ |
#define | MAGIC_EXTENSION |
#define | MAGIC_COMPRESS_TRANSP |
#define | MAGIC_NO_COMPRESS_FORK |
#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_CSV 0x0080000 /* Don't check for CSV files */ |
#define | MAGIC_NO_CHECK_TOKENS 0x0100000 /* Don't check tokens */ |
#define | MAGIC_NO_CHECK_ENCODING 0x0200000 /* Don't check text encodings */ |
#define | MAGIC_NO_CHECK_JSON 0x0400000 /* Don't check for JSON files */ |
#define | MAGIC_NO_CHECK_SIMH 0x0800000 /* Don't check for SIMH tape files */ |
#define | MAGIC_NO_CHECK_BUILTIN |
#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_csv\0\b\24no_check_tokens\0\b\25no_check_encoding\0\b\26no_check_json\0\b\27no_check_simh\0\b\30extension\0\b\31transp_compression\0\" |
#define | MAGIC_NO_CHECK_ASCII MAGIC_NO_CHECK_TEXT |
#define | MAGIC_NO_CHECK_FORTRAN 0x000000 /* Don't check ascii/fortran */ |
#define | MAGIC_NO_CHECK_TROFF 0x000000 /* Don't check ascii/troff */ |
#define | MAGIC_VERSION 545 /* This implementation */ |
#define | MAGIC_PARAM_INDIR_MAX 0 |
#define | MAGIC_PARAM_NAME_MAX 1 |
#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 |
#define | MAGIC_PARAM_ENCODING_MAX 7 |
#define | MAGIC_PARAM_ELF_SHSIZE_MAX 8 |
Typedefs | |
typedef struct magic_set * | magic_t |
Functions | |
magic_t | magic_open (int) |
void | magic_close (magic_t) |
const char * | magic_getpath (const char *, int) |
const char * | magic_file (magic_t, const char *) |
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) |
int | magic_load (magic_t, const char *) |
int | magic_load_buffers (magic_t, void **, size_t *, size_t) |
int | magic_compile (magic_t, const char *) |
int | magic_check (magic_t, const char *) |
int | magic_list (magic_t, const char *) |
int | magic_errno (magic_t) |
int | magic_setparam (magic_t, int, const void *) |
int | magic_getparam (magic_t, int, void *) |
#define MAGIC_APPLE 0x0000800 /* Return the Apple creator/type */ |
#define MAGIC_CHECK 0x0000040 /* Print warnings to stderr */ |
#define MAGIC_COMPRESS 0x0000004 /* Check inside compressed files */ |
#define MAGIC_COMPRESS_TRANSP |
#define MAGIC_CONTINUE 0x0000020 /* Return all matches */ |
#define MAGIC_DEBUG 0x0000001 /* Turn on debugging */ |
#define MAGIC_DEVICES 0x0000008 /* Look at the contents of devices */ |
#define MAGIC_ERROR 0x0000200 /* Handle ENOENT etc as real errors */ |
#define MAGIC_EXTENSION |
#define MAGIC_MIME (MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING) |
#define MAGIC_MIME_ENCODING 0x0000400 /* Return the MIME encoding */ |
#define MAGIC_MIME_TYPE 0x0000010 /* Return the MIME type */ |
#define MAGIC_NO_CHECK_APPTYPE 0x0008000 /* Don't check application type */ |
#define MAGIC_NO_CHECK_ASCII MAGIC_NO_CHECK_TEXT |
#define MAGIC_NO_CHECK_BUILTIN |
#define MAGIC_NO_CHECK_CDF 0x0040000 /* Don't check for cdf files */ |
#define MAGIC_NO_CHECK_COMPRESS 0x0001000 /* Don't check for compressed files */ |
#define MAGIC_NO_CHECK_CSV 0x0080000 /* Don't check for CSV files */ |
#define MAGIC_NO_CHECK_ELF 0x0010000 /* Don't check for elf details */ |
#define MAGIC_NO_CHECK_ENCODING 0x0200000 /* Don't check text encodings */ |
#define MAGIC_NO_CHECK_FORTRAN 0x000000 /* Don't check ascii/fortran */ |
#define MAGIC_NO_CHECK_JSON 0x0400000 /* Don't check for JSON files */ |
#define MAGIC_NO_CHECK_SIMH 0x0800000 /* Don't check for SIMH tape files */ |
#define MAGIC_NO_CHECK_SOFT 0x0004000 /* Don't check magic entries */ |
#define MAGIC_NO_CHECK_TAR 0x0002000 /* Don't check for tar files */ |
#define MAGIC_NO_CHECK_TEXT 0x0020000 /* Don't check for text files */ |
#define MAGIC_NO_CHECK_TOKENS 0x0100000 /* Don't check tokens */ |
#define MAGIC_NO_CHECK_TROFF 0x000000 /* Don't check ascii/troff */ |
#define MAGIC_NO_COMPRESS_FORK |
#define MAGIC_NODESC (MAGIC_EXTENSION|MAGIC_MIME|MAGIC_APPLE) |
#define MAGIC_NONE 0x0000000 /* No flags */ |
#define MAGIC_PARAM_BYTES_MAX 6 |
#define MAGIC_PARAM_ELF_NOTES_MAX 4 |
#define MAGIC_PARAM_ELF_PHNUM_MAX 2 |
#define MAGIC_PARAM_ELF_SHNUM_MAX 3 |
#define MAGIC_PARAM_ELF_SHSIZE_MAX 8 |
#define MAGIC_PARAM_ENCODING_MAX 7 |
#define MAGIC_PARAM_INDIR_MAX 0 |
#define MAGIC_PARAM_NAME_MAX 1 |
#define MAGIC_PARAM_REGEX_MAX 5 |
#define MAGIC_PRESERVE_ATIME 0x0000080 /* Restore access time on exit */ |
#define MAGIC_RAW 0x0000100 /* Don't convert unprintable chars */ |
#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_csv\0\b\24no_check_tokens\0\b\25no_check_encoding\0\b\26no_check_json\0\b\27no_check_simh\0\b\30extension\0\b\31transp_compression\0\" |
#define MAGIC_SYMLINK 0x0000002 /* Follow symlinks */ |
#define MAGIC_VERSION 545 /* This implementation */ |
typedef struct magic_set* magic_t |
const char * magic_buffer | ( | magic_t | , |
const void * | , | ||
size_t | ) |
int magic_check | ( | magic_t | , |
const char * | ) |
void magic_close | ( | magic_t | ) |
int magic_compile | ( | magic_t | , |
const char * | ) |
const char * magic_descriptor | ( | magic_t | , |
int | ) |
int magic_errno | ( | magic_t | ) |
const char * magic_error | ( | magic_t | ) |
const char * magic_file | ( | magic_t | , |
const char * | ) |
int magic_getflags | ( | magic_t | ) |
int magic_getparam | ( | magic_t | , |
int | , | ||
void * | ) |
const char * magic_getpath | ( | const char * | , |
int | ) |
int magic_list | ( | magic_t | , |
const char * | ) |
int magic_load | ( | magic_t | , |
const char * | ) |
int magic_load_buffers | ( | magic_t | , |
void ** | , | ||
size_t * | , | ||
size_t | ) |
magic_t magic_open | ( | int | ) |
int magic_setflags | ( | magic_t | , |
int | ) |
int magic_setparam | ( | magic_t | , |
int | , | ||
const void * | ) |
int magic_version | ( | void | ) |