31FILE_RCSID(
"@(#)$File: magic.c,v 1.121 2023/02/09 17:45:19 christos Exp $")
46#if defined(HAVE_UTIMES)
48#elif defined(HAVE_UTIME)
49# if defined(HAVE_SYS_UTIME_H)
50# include <sys/utime.h>
51# elif defined(HAVE_UTIME_H)
63#define PIPE_BUF pathconf(".", _PC_PIPE_BUF)
202 int no_in_stream = 0;
211#define SLOP (1 + sizeof(union VALUETYPE))
227 if (inname && !stream) {
263 if (no_in_stream && stream) {
293 return "Magic database is not open";
319#if !defined(HAVE_UTIME) && !defined(HAVE_UTIMES)
file_protected struct magic_set * file_ms_alloc(int flags)
file_protected void file_ms_free(struct magic_set *ms)
file_protected int file_apprentice(struct magic_set *ms, const char *fn, int action)
file(string $filename, int $flags=0, $context=null)
strrchr(string $haystack, string $needle, bool $before_needle=false)
memset(ptr, 0, type->size)
zend_ffi_ctype_name_buf buf
file_protected int file_printf(struct magic_set *, const char *,...) __attribute__((__format__(__printf__
file_protected const char * file_getbuffer(struct magic_set *)
file_protected int file_protected int file_reset(struct magic_set *, int)
file_protected int file_fsmagic(struct magic_set *, const char *, zend_stat_t *)
file_protected int file_buffer(struct magic_set *, php_stream *, zend_stat_t *, const char *, const void *, size_t)
file_protected void file_error(struct magic_set *, int, const char *,...) __attribute__((__format__(__printf__
file_public int magic_version(void)
file_public int magic_load(struct magic_set *ms, const char *magicfile)
file_public const char * magic_stream(struct magic_set *ms, php_stream *stream)
file_public int magic_setflags(struct magic_set *ms, int flags)
file_private int unreadable_info(struct magic_set *, mode_t, const char *)
file_public int magic_getflags(struct magic_set *ms)
file_public int magic_errno(struct magic_set *ms)
file_public int magic_check(struct magic_set *ms, const char *magicfile)
file_public int magic_list(struct magic_set *ms, const char *magicfile)
file_private const char * file_or_stream(struct magic_set *, const char *, php_stream *)
file_public const char * magic_error(struct magic_set *ms)
file_public const char * magic_buffer(struct magic_set *ms, const void *buf, size_t nb)
file_public const char * magic_descriptor(struct magic_set *ms, int fd)
file_public const char * magic_file(struct magic_set *ms, const char *inname)
file_public int magic_compile(struct magic_set *ms, const char *magicfile)
file_public int magic_setparam(struct magic_set *ms, int param, const void *val)
file_public int magic_getparam(struct magic_set *ms, int param, void *val)
file_public void magic_close(struct magic_set *ms)
file_public struct magic_set * magic_open(int flags)
#define MAGIC_PARAM_INDIR_MAX
#define MAGIC_PARAM_ELF_NOTES_MAX
#define MAGIC_PARAM_BYTES_MAX
#define MAGIC_PRESERVE_ATIME
#define MAGIC_PARAM_NAME_MAX
#define MAGIC_PARAM_ELF_SHNUM_MAX
#define MAGIC_PARAM_ENCODING_MAX
#define MAGIC_PARAM_ELF_SHSIZE_MAX
#define MAGIC_PARAM_REGEX_MAX
#define MAGIC_PARAM_ELF_PHNUM_MAX
struct _php_stream php_stream
#define php_stream_read(stream, buf, count)
#define php_stream_close(stream)
#define php_stream_open_wrapper(path, mode, options, opened)
#define php_stream_stat(stream, ssb)
struct _php_stream_statbuf php_stream_statbuf
ZEND_API void(ZEND_FASTCALL *zend_touch_vm_stack_data)(void *vm_stack_data)