diff options
author | Christos Zoulas <christos@zoulas.com> | 2022-09-10 13:19:26 +0000 |
---|---|---|
committer | Christos Zoulas <christos@zoulas.com> | 2022-09-10 13:19:26 +0000 |
commit | 06242a792dc64b261316bcc6c4303851cec9f520 (patch) | |
tree | cb6532722b126b5112ab7a81f9a21bc01edf904e /src/file.h | |
parent | a6b91ee706147e40b4782cd5bc13f394776a7045 (diff) | |
download | file-git-06242a792dc64b261316bcc6c4303851cec9f520.tar.gz |
Add octal indirect magic (Michal Gorny)
Diffstat (limited to 'src/file.h')
-rw-r--r-- | src/file.h | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -27,7 +27,7 @@ */ /* * file.h - definitions for file(1) program - * @(#)$File: file.h,v 1.235 2022/07/04 19:44:35 christos Exp $ + * @(#)$File: file.h,v 1.236 2022/09/10 13:19:26 christos Exp $ */ #ifndef __file_h__ @@ -161,7 +161,7 @@ #define MAXstring 128 /* max len of "string" types */ #define MAGICNO 0xF11E041C -#define VERSIONNO 17 +#define VERSIONNO 18 #define FILE_MAGICSIZE 376 #define FILE_GUID_SIZE sizeof("XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX") @@ -278,7 +278,8 @@ struct magic { #define FILE_MSDOSTIME 56 #define FILE_LEMSDOSTIME 57 #define FILE_BEMSDOSTIME 58 -#define FILE_NAMES_SIZE 59 /* size of array to contain all names */ +#define FILE_OCTAL 59 +#define FILE_NAMES_SIZE 60 /* size of array to contain all names */ #define IS_STRING(t) \ ((t) == FILE_STRING || \ @@ -289,7 +290,8 @@ struct magic { (t) == FILE_SEARCH || \ (t) == FILE_INDIRECT || \ (t) == FILE_NAME || \ - (t) == FILE_USE) + (t) == FILE_USE || \ + (t) == FILE_OCTAL) #define FILE_FMT_NONE 0 #define FILE_FMT_NUM 1 /* "cduxXi" */ @@ -510,6 +512,7 @@ protected const char *file_fmtdate(char *, size_t, uint16_t); protected const char *file_fmttime(char *, size_t, uint16_t); protected const char *file_fmtvarint(const unsigned char *, int, char *, size_t); +protected const char *file_fmtnum(char *, size_t, const char *, int); protected struct magic_set *file_ms_alloc(int); protected void file_ms_free(struct magic_set *); protected int file_default(struct magic_set *, size_t); |