Lines Matching refs:struct
51 private int parse_strength(struct magic_set *, struct magic_entry *, const char *);
52 private int parse_apple(struct magic_set *, struct magic_entry *, const char *);
56 private size_t magicsize = sizeof(struct magic);
60 private struct {
75 - struct magic_set *ms;
101 static const struct type_tbl_s {
141 - if ((ml = CAST(struct mlist *, malloc(sizeof(*ml)))) == NULL) {
190 struct mlist *mlist;
215 - if ((mlist = CAST(struct mlist *, malloc(sizeof(*mlist)))) == NULL) {
253 - const struct magic_entry *ma = CAST(const struct magic_entry *, a);
254 - const struct magic_entry *mb = CAST(const struct magic_entry *, b);
255 + const struct magic_entry *ma = a;
256 + const struct magic_entry *mb = b;
261 load_1(struct magic_set *ms, int action, const char *fn, int *errs,
262 struct magic_entry **marray, uint32_t *marraycount)
314 apprentice_load(struct magic_set *ms, struct magic **magicp, uint32_t *nmagicp,
319 struct magic_entry *marray;
325 struct stat st;
327 - struct dirent *d;
336 - if ((marray = CAST(struct magic_entry *, calloc(maxmagic,
410 - if ((*magicp = CAST(struct magic *, malloc(slen))) == NULL) {
445 struct magic *nm;
447 - if ((nm = CAST(struct magic *, realloc(me->mp,
457 struct magic_entry *mp;
460 - if ((mp = CAST(struct magic_entry *,
475 - if ((m = CAST(struct magic *, malloc(len))) == NULL) {
533 apprentice_map(struct magic_set *ms, struct magic **magicp, uint32_t *nmagicp,
537 - struct stat st;
614 - *magicp = CAST(struct magic *, mm);
638 - *nmagicp = (uint32_t)(st.st_size / sizeof(struct magic));
652 + *nmagicp = (sizeof(php_magic_database) / sizeof(struct magic));
654 + *nmagicp = (uint32_t)(st.sb.st_size / sizeof(struct magic));
700 apprentice_compile(struct magic_set *ms, struct magic **magicp,
735 - if (lseek(fd, (off_t)sizeof(struct magic), SEEK_SET)
736 - != sizeof(struct magic)) {
737 + if (php_stream_seek(stream,(off_t)sizeof(struct magic), SEEK_SET) != sizeof(struct magic)) {
742 - if (write(fd, *magicp, (sizeof(struct magic) * *nmagicp))
743 - != (ssize_t)(sizeof(struct magic) * *nmagicp)) {
744 …php_stream_write(stream, (char *)*magicp, (sizeof(struct magic) * *nmagicp) != (ssize_t)(sizeof(st…
864 - struct timespec ts;
865 + struct timeval ts;
873 - struct timespec ts;
874 + struct timeval ts;
904 typedef struct {
919 -struct timespec;
920 -int cdf_timestamp_to_timespec(struct timespec *, cdf_timestamp_t);
921 -int cdf_timespec_to_timestamp(cdf_timestamp_t *, const struct timespec *);
922 +struct timeval;
923 +int cdf_timestamp_to_timespec(struct timeval *, cdf_timestamp_t);
924 +int cdf_timespec_to_timestamp(cdf_timestamp_t *, const struct timeval *);
935 -cdf_timestamp_to_timespec(struct timespec *ts, cdf_timestamp_t t)
936 +cdf_timestamp_to_timespec(struct timeval *ts, cdf_timestamp_t t)
938 struct tm tm;
964 -cdf_timespec_to_timestamp(cdf_timestamp_t *t, const struct timespec *ts)
965 +cdf_timespec_to_timestamp(cdf_timestamp_t *t, const struct timeval *ts)
982 - struct timespec ts;
983 + struct timeval ts;
1015 private const struct {
1025 private size_t uncompressbuf(struct magic_set *, int, size_t,
1073 struct timeval tout = {0, 100 * 1000};
1186 /* Do this here and now, because struct stat gets re-defined on solaris */
1231 struct stat;
1233 -protected int file_buffer(struct magic_set *, int, const char *, const void *,
1234 +protected int file_buffer(struct magic_set *, php_stream *, const char *, const void *,
1236 -protected int file_fsmagic(struct magic_set *, const char *, struct stat *);
1237 +protected int file_fsmagic(struct magic_set *ms, const char *fn, struct stat *sb, php_stream *stre…
1238 protected int file_pipe2file(struct magic_set *, int, const void *, size_t);
1239 -protected int file_vprintf(struct magic_set *, const char *, va_list);
1240 -protected size_t file_printedlen(const struct magic_set *);
1241 protected int file_replace(struct magic_set *, const char *, const char *);
1242 -protected int file_printf(struct magic_set *, const char *, ...)
1244 +protected int file_printf(struct magic_set *, const char *, ...);
1245 protected int file_reset(struct magic_set *);
1246 protected int file_tryelf(struct magic_set *, int, const unsigned char *,
1248 protected int file_trycdf(struct magic_set *, int, const unsigned char *,
1252 protected int file_zmagic(struct magic_set *, int, const char *,
1256 protected void file_badread(struct magic_set *);
1257 protected void file_badseek(struct magic_set *);
1258 protected void file_oomem(struct magic_set *, size_t);
1259 -protected void file_error(struct magic_set *, int, const char *, ...)
1261 -protected void file_magerror(struct magic_set *, const char *, ...)
1263 -protected void file_magwarn(struct magic_set *, const char *, ...)
1265 -protected void file_mdump(struct magic *);
1266 +protected void file_error(struct magic_set *, int, const char *, ...);
1267 +protected void file_magerror(struct magic_set *, const char *, ...);
1268 +protected void file_magwarn(struct magic_set *, const char *, ...);
1271 protected const char *file_getbuffer(struct magic_set *);
1274 protected size_t file_pstring_length_size(const struct magic *);
1275 protected size_t file_pstring_get_length(const struct magic *, const char *);
1276 +protected size_t file_printedlen(const struct magic_set *ms);
1278 protected int file_os2_apptype(struct magic_set *, const char *, const void *,
1334 -bad_link(struct magic_set *ms, int err, char *buf)
1368 handle_mime(struct magic_set *ms, int mime, const char *str)
1374 -file_fsmagic(struct magic_set *ms, const char *fn, struct stat *sb)
1375 +file_fsmagic(struct magic_set *ms, const char *fn, struct stat *sb, php_stream *stream)
1382 - struct stat tstatbuf;
1418 + memcpy(sb, &ssb.sb, sizeof(struct stat));
1676 -file_vprintf(struct magic_set *ms, const char *fmt, va_list ap)
1677 +file_printf(struct magic_set *ms, const char *fmt, ...)
1715 -file_printf(struct magic_set *ms, const char *fmt, ...)
1728 file_error_core(struct magic_set *ms, int error, const char *f, va_list va,
1768 -file_buffer(struct magic_set *ms, int fd, const char *inname __attribute__ ((unused)),
1770 +file_buffer(struct magic_set *ms, php_stream *stream, const char *inname, const void *buf,
1828 file_reset(struct magic_set *ms)
1863 - ms->c.li = CAST(struct level_info *, (ms->c.li == NULL) ?
1881 file_replace(struct magic_set *ms, const char *pat, const char *rep)
1999 private void free_mlist(struct mlist *);
2000 private void close_and_restore(const struct magic_set *, const char *, int,
2001 const struct stat *);
2002 private int unreadable_info(struct magic_set *, mode_t, const char *);
2005 -private const char *file_or_fd(struct magic_set *, const char *, int);
2007 +private const char *file_or_stream(struct magic_set *, const char *, php_stream *);
2024 struct stat st;
2050 public struct magic_set *
2053 struct magic_set *ms;
2056 - if ((ms = CAST(struct magic_set *, calloc((size_t)1,
2057 - sizeof(struct magic_set)))) == NULL)
2059 + ms = ecalloc((size_t)1, sizeof(struct magic_set));
2069 - if ((ms->c.li = CAST(struct level_info *, malloc(len))) == NULL)
2087 struct mlist *next = ml->next;
2088 struct magic *mg = ml->magic;
2101 magic_close(struct magic_set *ms)
2129 -magic_check(struct magic_set *ms, const char *magicfile)
2131 - struct mlist *ml = file_apprentice(ms, magicfile, FILE_CHECK);
2137 magic_list(struct magic_set *ms, const char *magicfile)
2139 close_and_restore(const struct magic_set *ms, const char *name, int fd,
2140 const struct stat *sb)
2158 magic_descriptor(struct magic_set *ms, int fd)
2167 magic_file(struct magic_set *ms, const char *inname)
2174 +magic_stream(struct magic_set *ms, php_stream *stream)
2180 -file_or_fd(struct magic_set *ms, const char *inname, int fd)
2181 +file_or_stream(struct magic_set *ms, const char *inname, php_stream *stream)
2185 struct stat sb;
2323 magic_error(struct magic_set *ms)
2362 -file_mdump(struct magic *m)
2513 file_magwarn(struct magic_set *ms, const char *f, ...)
2557 - struct timespec ts;
2558 + struct timeval ts;
2591 private int doshn(struct magic_set *, int, int, int, off_t, int, size_t,
2593 -private size_t donote(struct magic_set *, void *, size_t, size_t, int,
2594 +private size_t donote(struct magic_set *, unsigned char *, size_t, size_t, int,
2630 -donote(struct magic_set *ms, void *vbuf, size_t offset, size_t size,
2631 +donote(struct magic_set *ms, unsigned char *nbuf, size_t offset, size_t size,
2756 private int match(struct magic_set *, struct magic *, uint32_t,
2760 struct magic *m = &magic[magindex];
2812 check_fmt(struct magic_set *ms, struct magic *m)
2863 mprint(struct magic_set *ms, struct magic *m)
2973 magiccheck(struct magic_set *ms, struct magic *m)