diff options
author | Renato Botelho <renato@netgate.com> | 2016-05-03 08:53:59 -0300 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2016-05-03 08:53:59 -0300 |
commit | 501575fb1206644a3ea8c2cd64a81084745445cc (patch) | |
tree | e07e5ad3f3ff6f6cf2841dd2d2eb0dcb0e54521a /contrib/file/src/file.h | |
parent | 91f599cbc0d103dd112a2472b589573724b8d70a (diff) | |
parent | 04acf11bf47629b82fc88ce0e6d6dc642b1e641b (diff) | |
download | FreeBSD-src-501575fb1206644a3ea8c2cd64a81084745445cc.zip FreeBSD-src-501575fb1206644a3ea8c2cd64a81084745445cc.tar.gz |
Merge remote-tracking branch 'origin/stable/10' into devel
Diffstat (limited to 'contrib/file/src/file.h')
-rw-r--r-- | contrib/file/src/file.h | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/contrib/file/src/file.h b/contrib/file/src/file.h index b0f0cc1..f22fcd9 100644 --- a/contrib/file/src/file.h +++ b/contrib/file/src/file.h @@ -27,7 +27,7 @@ */ /* * file.h - definitions for file(1) program - * @(#)$File: file.h,v 1.172 2015/09/11 17:24:09 christos Exp $ + * @(#)$File: file.h,v 1.178 2016/03/31 17:51:12 christos Exp $ */ #ifndef __file_h__ @@ -127,8 +127,8 @@ #define MAX(a,b) (((a) > (b)) ? (a) : (b)) #endif -#ifndef HOWMANY -# define HOWMANY (1024 * 1024) /* how much of the file to look at */ +#ifndef FILE_BYTES_MAX +# define FILE_BYTES_MAX (1024 * 1024) /* how much of the file to look at */ #endif #define MAXMAGIS 8192 /* max entries in any one magic file or directory */ @@ -227,7 +227,8 @@ struct magic { #define FILE_NAME 45 #define FILE_USE 46 #define FILE_CLEAR 47 -#define FILE_NAMES_SIZE 48 /* size of array to contain all names */ +#define FILE_DER 48 +#define FILE_NAMES_SIZE 49 /* size of array to contain all names */ #define IS_STRING(t) \ ((t) == FILE_STRING || \ @@ -365,9 +366,11 @@ struct mlist { #ifdef __cplusplus #define CAST(T, b) static_cast<T>(b) #define RCAST(T, b) reinterpret_cast<T>(b) +#define CCAST(T, b) const_cast<T>(b) #else -#define CAST(T, b) (T)(b) -#define RCAST(T, b) (T)(b) +#define CAST(T, b) ((T)(b)) +#define RCAST(T, b) ((T)(b)) +#define CCAST(T, b) ((T)(uintptr_t)(b)) #endif struct level_info { @@ -416,7 +419,8 @@ struct magic_set { uint16_t elf_phnum_max; uint16_t elf_notes_max; uint16_t regex_max; -#define FILE_INDIR_MAX 15 + size_t bytes_max; /* number of bytes to read from file */ +#define FILE_INDIR_MAX 50 #define FILE_NAME_MAX 30 #define FILE_ELF_SHNUM_MAX 32768 #define FILE_ELF_PHNUM_MAX 2048 @@ -461,7 +465,7 @@ protected int file_encoding(struct magic_set *, const unsigned char *, size_t, unichar **, size_t *, const char **, const char **, const char **); protected int file_is_tar(struct magic_set *, const unsigned char *, size_t); protected int file_softmagic(struct magic_set *, const unsigned char *, size_t, - uint16_t, uint16_t *, int, int); + uint16_t *, uint16_t *, int, int); protected int file_apprentice(struct magic_set *, const char *, int); protected int buffer_apprentice(struct magic_set *, struct magic **, size_t *, size_t); @@ -506,6 +510,8 @@ typedef struct { #define USE_C_LOCALE locale_t old_lc_ctype; locale_t c_lc_ctype; +#else + char *old_lc_ctype; #endif int rc; regex_t rx; @@ -550,6 +556,9 @@ int vasprintf(char **, const char *, va_list); #ifndef HAVE_ASPRINTF int asprintf(char **, const char *, ...); #endif +#ifndef HAVE_DPRINTF +int dprintf(int, const char *, ...); +#endif #ifndef HAVE_STRLCPY size_t strlcpy(char *, const char *, size_t); |