summaryrefslogtreecommitdiff
path: root/src/file.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/file.h')
-rw-r--r--src/file.h156
1 files changed, 78 insertions, 78 deletions
diff --git a/src/file.h b/src/file.h
index 8281426f..1e1f1e7a 100644
--- a/src/file.h
+++ b/src/file.h
@@ -27,7 +27,7 @@
*/
/*
* file.h - definitions for file(1) program
- * @(#)$File: file.h,v 1.240 2022/10/02 12:53:28 christos Exp $
+ * @(#)$File: file.h,v 1.241 2022/12/26 17:31:14 christos Exp $
*/
#ifndef __file_h__
@@ -105,17 +105,17 @@
#define PATHSEP ':'
#endif
-#define private static
+#define file_private static
#if HAVE_VISIBILITY && !defined(WIN32)
-#define public __attribute__ ((__visibility__("default")))
-#ifndef protected
-#define protected __attribute__ ((__visibility__("hidden")))
+#define file_public __attribute__ ((__visibility__("default")))
+#ifndef file_protected
+#define file_protected __attribute__ ((__visibility__("hidden")))
#endif
#else
-#define public
-#ifndef protected
-#define protected
+#define file_public
+#ifndef file_protected
+#define file_protected
#endif
#endif
@@ -507,99 +507,99 @@ typedef unsigned long file_unichar_t;
struct stat;
#define FILE_T_LOCAL 1
#define FILE_T_WINDOWS 2
-protected const char *file_fmtdatetime(char *, size_t, uint64_t, int);
-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(char *, size_t, const unsigned char *,
+file_protected const char *file_fmtdatetime(char *, size_t, uint64_t, int);
+file_protected const char *file_fmtdate(char *, size_t, uint16_t);
+file_protected const char *file_fmttime(char *, size_t, uint16_t);
+file_protected const char *file_fmtvarint(char *, size_t, const unsigned char *,
int);
-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);
-protected int file_buffer(struct magic_set *, int, struct stat *, const char *,
+file_protected const char *file_fmtnum(char *, size_t, const char *, int);
+file_protected struct magic_set *file_ms_alloc(int);
+file_protected void file_ms_free(struct magic_set *);
+file_protected int file_default(struct magic_set *, size_t);
+file_protected int file_buffer(struct magic_set *, int, struct stat *, const char *,
const void *, size_t);
-protected int file_fsmagic(struct magic_set *, const char *, struct stat *);
-protected int file_pipe2file(struct magic_set *, int, const void *, size_t);
-protected int file_vprintf(struct magic_set *, const char *, va_list)
+file_protected int file_fsmagic(struct magic_set *, const char *, struct stat *);
+file_protected int file_pipe2file(struct magic_set *, int, const void *, size_t);
+file_protected int file_vprintf(struct magic_set *, const char *, va_list)
__attribute__((__format__(__printf__, 2, 0)));
-protected int file_separator(struct magic_set *);
-protected char *file_copystr(char *, size_t, size_t, const char *);
-protected int file_checkfmt(char *, size_t, const char *);
-protected size_t file_printedlen(const struct magic_set *);
-protected int file_print_guid(char *, size_t, const uint64_t *);
-protected int file_parse_guid(const char *, uint64_t *);
-protected int file_replace(struct magic_set *, const char *, const char *);
-protected int file_printf(struct magic_set *, const char *, ...)
+file_protected int file_separator(struct magic_set *);
+file_protected char *file_copystr(char *, size_t, size_t, const char *);
+file_protected int file_checkfmt(char *, size_t, const char *);
+file_protected size_t file_printedlen(const struct magic_set *);
+file_protected int file_print_guid(char *, size_t, const uint64_t *);
+file_protected int file_parse_guid(const char *, uint64_t *);
+file_protected int file_replace(struct magic_set *, const char *, const char *);
+file_protected int file_printf(struct magic_set *, const char *, ...)
__attribute__((__format__(__printf__, 2, 3)));
-protected int file_reset(struct magic_set *, int);
-protected int file_tryelf(struct magic_set *, const struct buffer *);
-protected int file_trycdf(struct magic_set *, const struct buffer *);
+file_protected int file_reset(struct magic_set *, int);
+file_protected int file_tryelf(struct magic_set *, const struct buffer *);
+file_protected int file_trycdf(struct magic_set *, const struct buffer *);
#if HAVE_FORK
-protected int file_zmagic(struct magic_set *, const struct buffer *,
+file_protected int file_zmagic(struct magic_set *, const struct buffer *,
const char *);
#endif
-protected int file_ascmagic(struct magic_set *, const struct buffer *,
+file_protected int file_ascmagic(struct magic_set *, const struct buffer *,
int);
-protected int file_ascmagic_with_encoding(struct magic_set *,
+file_protected int file_ascmagic_with_encoding(struct magic_set *,
const struct buffer *, file_unichar_t *, size_t, const char *, const char *, int);
-protected int file_encoding(struct magic_set *, const struct buffer *,
+file_protected int file_encoding(struct magic_set *, const struct buffer *,
file_unichar_t **, size_t *, const char **, const char **, const char **);
-protected int file_is_json(struct magic_set *, const struct buffer *);
-protected int file_is_csv(struct magic_set *, const struct buffer *, int);
-protected int file_is_tar(struct magic_set *, const struct buffer *);
-protected int file_softmagic(struct magic_set *, const struct buffer *,
+file_protected int file_is_json(struct magic_set *, const struct buffer *);
+file_protected int file_is_csv(struct magic_set *, const struct buffer *, int);
+file_protected int file_is_tar(struct magic_set *, const struct buffer *);
+file_protected int file_softmagic(struct magic_set *, const struct buffer *,
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 **,
+file_protected int file_apprentice(struct magic_set *, const char *, int);
+file_protected int buffer_apprentice(struct magic_set *, struct magic **,
size_t *, size_t);
-protected int file_magicfind(struct magic_set *, const char *, struct mlist *);
-protected uint64_t file_signextend(struct magic_set *, struct magic *,
+file_protected int file_magicfind(struct magic_set *, const char *, struct mlist *);
+file_protected uint64_t file_signextend(struct magic_set *, struct magic *,
uint64_t);
-protected uintmax_t file_varint2uintmax_t(const unsigned char *, int, size_t *);
+file_protected uintmax_t file_varint2uintmax_t(const unsigned char *, int, size_t *);
-protected void file_badread(struct magic_set *);
-protected void file_badseek(struct magic_set *);
-protected void file_oomem(struct magic_set *, size_t);
-protected void file_error(struct magic_set *, int, const char *, ...)
+file_protected void file_badread(struct magic_set *);
+file_protected void file_badseek(struct magic_set *);
+file_protected void file_oomem(struct magic_set *, size_t);
+file_protected void file_error(struct magic_set *, int, const char *, ...)
__attribute__((__format__(__printf__, 3, 4)));
-protected void file_magerror(struct magic_set *, const char *, ...)
+file_protected void file_magerror(struct magic_set *, const char *, ...)
__attribute__((__format__(__printf__, 2, 3)));
-protected void file_magwarn(struct magic_set *, const char *, ...)
+file_protected void file_magwarn(struct magic_set *, const char *, ...)
__attribute__((__format__(__printf__, 2, 3)));
-protected void file_mdump(struct magic *);
-protected void file_showstr(FILE *, const char *, size_t);
-protected size_t file_mbswidth(struct magic_set *, const char *);
-protected const char *file_getbuffer(struct magic_set *);
-protected ssize_t sread(int, void *, size_t, int);
-protected int file_check_mem(struct magic_set *, unsigned int);
-protected int file_looks_utf8(const unsigned char *, size_t, file_unichar_t *,
+file_protected void file_mdump(struct magic *);
+file_protected void file_showstr(FILE *, const char *, size_t);
+file_protected size_t file_mbswidth(struct magic_set *, const char *);
+file_protected const char *file_getbuffer(struct magic_set *);
+file_protected ssize_t sread(int, void *, size_t, int);
+file_protected int file_check_mem(struct magic_set *, unsigned int);
+file_protected int file_looks_utf8(const unsigned char *, size_t, file_unichar_t *,
size_t *);
-protected size_t file_pstring_length_size(struct magic_set *,
+file_protected size_t file_pstring_length_size(struct magic_set *,
const struct magic *);
-protected size_t file_pstring_get_length(struct magic_set *,
+file_protected size_t file_pstring_get_length(struct magic_set *,
const struct magic *, const char *);
-protected char * file_printable(struct magic_set *, char *, size_t,
+file_protected char * file_printable(struct magic_set *, char *, size_t,
const char *, size_t);
#ifdef __EMX__
-protected int file_os2_apptype(struct magic_set *, const char *, const void *,
+file_protected int file_os2_apptype(struct magic_set *, const char *, const void *,
size_t);
#endif /* __EMX__ */
-protected int file_pipe_closexec(int *);
-protected int file_clear_closexec(int);
-protected char *file_strtrim(char *);
+file_protected int file_pipe_closexec(int *);
+file_protected int file_clear_closexec(int);
+file_protected char *file_strtrim(char *);
-protected void buffer_init(struct buffer *, int, const struct stat *,
+file_protected void buffer_init(struct buffer *, int, const struct stat *,
const void *, size_t);
-protected void buffer_fini(struct buffer *);
-protected int buffer_fill(const struct buffer *);
+file_protected void buffer_fini(struct buffer *);
+file_protected int buffer_fill(const struct buffer *);
-protected int file_regcomp(struct magic_set *, file_regex_t *, const char *,
+file_protected int file_regcomp(struct magic_set *, file_regex_t *, const char *,
int);
-protected int file_regexec(struct magic_set *, file_regex_t *, const char *,
+file_protected int file_regexec(struct magic_set *, file_regex_t *, const char *,
size_t, regmatch_t *, int);
-protected void file_regfree(file_regex_t *);
+file_protected void file_regfree(file_regex_t *);
typedef struct {
char *buf;
@@ -607,8 +607,8 @@ typedef struct {
uint32_t offset;
} file_pushbuf_t;
-protected file_pushbuf_t *file_push_buffer(struct magic_set *);
-protected char *file_pop_buffer(struct magic_set *, file_pushbuf_t *);
+file_protected file_pushbuf_t *file_push_buffer(struct magic_set *);
+file_protected char *file_pop_buffer(struct magic_set *, file_pushbuf_t *);
#ifndef COMPILE_ONLY
extern const char *file_names[];
@@ -670,15 +670,15 @@ int enable_sandbox_basic(void);
int enable_sandbox_full(void);
#endif
-protected const char *file_getprogname(void);
-protected void file_setprogname(const char *);
-protected void file_err(int, const char *, ...)
+file_protected const char *file_getprogname(void);
+file_protected void file_setprogname(const char *);
+file_protected void file_err(int, const char *, ...)
__attribute__((__format__(__printf__, 2, 3), __noreturn__));
-protected void file_errx(int, const char *, ...)
+file_protected void file_errx(int, const char *, ...)
__attribute__((__format__(__printf__, 2, 3), __noreturn__));
-protected void file_warn(const char *, ...)
+file_protected void file_warn(const char *, ...)
__attribute__((__format__(__printf__, 1, 2)));
-protected void file_warnx(const char *, ...)
+file_protected void file_warnx(const char *, ...)
__attribute__((__format__(__printf__, 1, 2)));
#if defined(HAVE_MMAP) && defined(HAVE_SYS_MMAN_H) && !defined(QUICK)