44 #define SZOF(a) (sizeof(a) / sizeof(a[0]))
48 static const char optyp[] = { FILE_OPS };
52 (void)
eprintf(
"%.*s %u",
m->cont_level & 7,
">>>>>>>>",
m->offset);
54 if (
m->flag & INDIR) {
58 if (
m->in_op & FILE_OPINVERSE)
59 (void)fputc(
'~', stderr);
61 ((
m->in_op & FILE_OPS_MASK) <
SZOF(optyp)) ? optyp[
m->in_op & FILE_OPS_MASK] :
'?',
67 if (
m->mask_op & FILE_OPINVERSE)
68 (void)fputc(
'~', stderr);
70 if (MAGIC_IS_STRING(
m->type)) {
72 (void)fputc(
'/', stderr);
73 if (
m->str_flags & STRING_COMPACT_BLANK)
74 (void)fputc(CHAR_COMPACT_BLANK, stderr);
75 if (
m->str_flags & STRING_COMPACT_OPTIONAL_BLANK)
76 (void)fputc(CHAR_COMPACT_OPTIONAL_BLANK,
78 if (
m->str_flags & STRING_IGNORE_LOWERCASE)
79 (void)fputc(CHAR_IGNORE_LOWERCASE, stderr);
80 if (
m->str_flags & STRING_IGNORE_UPPERCASE)
81 (void)fputc(CHAR_IGNORE_UPPERCASE, stderr);
82 if (
m->str_flags & REGEX_OFFSET_START)
83 (void)fputc(CHAR_REGEX_OFFSET_START, stderr);
88 if ((
m->mask_op & FILE_OPS_MASK) <
SZOF(optyp))
89 (
void)fputc(optyp[
m->mask_op & FILE_OPS_MASK], stderr);
91 (
void)fputc(
'?', stderr);
118 case FILE_BESTRING16:
119 case FILE_LESTRING16:
163 (void)fputs(
"*bad*", stderr);
167 (void)
eprintf(
",\"%s\"]\n",
m->desc);
176 (void)fflush(stdout);
179 (void)
eprintf(
"%s, %lu: ", ms->file,
180 (
unsigned long)ms->line);
183 (void)vfprintf(stderr,
f, va);
185 (void)fputc(
'\n', stderr);
191 struct tm timestruct;
196 #ifndef HAVE_DAYLIGHT
197 static int daylight = 0;
206 return "*Invalid time*";
207 daylight = tm1->tm_isdst;
215 return "*Invalid time*";
219 pp[strcspn(pp,
"\n")] =
'\0';
static const size_t file_nnames
void file_showstr(FILE *fp, const char *s, size_t len)
static const char * magic_file_names[FILE_NAMES_SIZE]
static static fork const void static count static fd const char const char static newpath char char char static envp time
void file_mdump(struct rz_magic *m)
void file_magwarn(struct rz_magic_set *ms, const char *f,...)
const char * file_fmttime(ut32 v, int local, char *pp)
RZ_API struct tm * rz_localtime_r(RZ_NONNULL const time_t *time, RZ_NONNULL struct tm *res)
RZ_API struct tm * rz_gmtime_r(RZ_NONNULL const time_t *time, RZ_NONNULL struct tm *res)
RZ_API char * rz_asctime_r(RZ_NONNULL const struct tm *tm, RZ_NONNULL char *buf)
RZ_API char * rz_ctime_r(RZ_NONNULL const time_t *timer, RZ_NONNULL char *buf)
#define ASCTIME_BUF_MINLEN
ut64(WINAPI *w32_GetEnabledXStateFeatures)()