diff options
Diffstat (limited to 'src/magic.c')
-rw-r--r-- | src/magic.c | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/src/magic.c b/src/magic.c index 916eea23..80555da3 100644 --- a/src/magic.c +++ b/src/magic.c @@ -33,7 +33,7 @@ #include "file.h" #ifndef lint -FILE_RCSID("@(#)$File: magic.c,v 1.119 2022/09/24 20:30:13 christos Exp $") +FILE_RCSID("@(#)$File: magic.c,v 1.120 2022/12/26 17:31:14 christos Exp $") #endif /* lint */ #include "magic.h" @@ -69,12 +69,12 @@ FILE_RCSID("@(#)$File: magic.c,v 1.119 2022/09/24 20:30:13 christos Exp $") #endif #endif -private void close_and_restore(const struct magic_set *, const char *, int, +file_private void close_and_restore(const struct magic_set *, const char *, int, const struct stat *); -private int unreadable_info(struct magic_set *, mode_t, const char *); -private const char* get_default_magic(void); +file_private int unreadable_info(struct magic_set *, mode_t, const char *); +file_private const char* get_default_magic(void); #ifndef COMPILE_ONLY -private const char *file_or_fd(struct magic_set *, const char *, int); +file_private const char *file_or_fd(struct magic_set *, const char *, int); #endif #ifndef STDIN_FILENO @@ -171,7 +171,7 @@ DllMain(HINSTANCE hinstDLL, DWORD fdwReason, #endif #endif -private const char * +file_private const char * get_default_magic(void) { static const char hmagic[] = "/.magic/magic.mgc"; @@ -250,7 +250,7 @@ out: #endif } -public const char * +file_public const char * magic_getpath(const char *magicfile, int action) { if (magicfile != NULL) @@ -263,13 +263,13 @@ magic_getpath(const char *magicfile, int action) return action == FILE_LOAD ? get_default_magic() : MAGIC; } -public struct magic_set * +file_public struct magic_set * magic_open(int flags) { return file_ms_alloc(flags); } -private int +file_private int unreadable_info(struct magic_set *ms, mode_t md, const char *file) { if (file) { @@ -302,7 +302,7 @@ unreadable_info(struct magic_set *ms, mode_t md, const char *file) return 0; } -public void +file_public void magic_close(struct magic_set *ms) { if (ms == NULL) @@ -313,7 +313,7 @@ magic_close(struct magic_set *ms) /* * load a magic file */ -public int +file_public int magic_load(struct magic_set *ms, const char *magicfile) { if (ms == NULL) @@ -325,7 +325,7 @@ magic_load(struct magic_set *ms, const char *magicfile) /* * Install a set of compiled magic buffers. */ -public int +file_public int magic_load_buffers(struct magic_set *ms, void **bufs, size_t *sizes, size_t nbufs) { @@ -336,7 +336,7 @@ magic_load_buffers(struct magic_set *ms, void **bufs, size_t *sizes, } #endif -public int +file_public int magic_compile(struct magic_set *ms, const char *magicfile) { if (ms == NULL) @@ -344,7 +344,7 @@ magic_compile(struct magic_set *ms, const char *magicfile) return file_apprentice(ms, magicfile, FILE_COMPILE); } -public int +file_public int magic_check(struct magic_set *ms, const char *magicfile) { if (ms == NULL) @@ -352,7 +352,7 @@ magic_check(struct magic_set *ms, const char *magicfile) return file_apprentice(ms, magicfile, FILE_CHECK); } -public int +file_public int magic_list(struct magic_set *ms, const char *magicfile) { if (ms == NULL) @@ -360,7 +360,7 @@ magic_list(struct magic_set *ms, const char *magicfile) return file_apprentice(ms, magicfile, FILE_LIST); } -private void +file_private void close_and_restore(const struct magic_set *ms, const char *name, int fd, const struct stat *sb) { @@ -398,7 +398,7 @@ close_and_restore(const struct magic_set *ms, const char *name, int fd, /* * find type of descriptor */ -public const char * +file_public const char * magic_descriptor(struct magic_set *ms, int fd) { if (ms == NULL) @@ -409,7 +409,7 @@ magic_descriptor(struct magic_set *ms, int fd) /* * find type of named file */ -public const char * +file_public const char * magic_file(struct magic_set *ms, const char *inname) { if (ms == NULL) @@ -417,7 +417,7 @@ magic_file(struct magic_set *ms, const char *inname) return file_or_fd(ms, inname, STDIN_FILENO); } -private const char * +file_private const char * file_or_fd(struct magic_set *ms, const char *inname, int fd) { int rv = -1; @@ -545,7 +545,7 @@ out: } -public const char * +file_public const char * magic_buffer(struct magic_set *ms, const void *buf, size_t nb) { if (ms == NULL) @@ -563,7 +563,7 @@ magic_buffer(struct magic_set *ms, const void *buf, size_t nb) } #endif -public const char * +file_public const char * magic_error(struct magic_set *ms) { if (ms == NULL) @@ -571,7 +571,7 @@ magic_error(struct magic_set *ms) return (ms->event_flags & EVENT_HAD_ERR) ? ms->o.buf : NULL; } -public int +file_public int magic_errno(struct magic_set *ms) { if (ms == NULL) @@ -579,7 +579,7 @@ magic_errno(struct magic_set *ms) return (ms->event_flags & EVENT_HAD_ERR) ? ms->error : 0; } -public int +file_public int magic_getflags(struct magic_set *ms) { if (ms == NULL) @@ -588,7 +588,7 @@ magic_getflags(struct magic_set *ms) return ms->flags; } -public int +file_public int magic_setflags(struct magic_set *ms, int flags) { if (ms == NULL) @@ -601,13 +601,13 @@ magic_setflags(struct magic_set *ms, int flags) return 0; } -public int +file_public int magic_version(void) { return MAGIC_VERSION; } -public int +file_public int magic_setparam(struct magic_set *ms, int param, const void *val) { if (ms == NULL) @@ -643,7 +643,7 @@ magic_setparam(struct magic_set *ms, int param, const void *val) } } -public int +file_public int magic_getparam(struct magic_set *ms, int param, void *val) { if (ms == NULL) |