Lines Matching refs:struct
61 - struct magic_set *ms;
87 struct type_tbl_s {
98 get_type(const struct type_tbl_s *tbl, const char *l, const char **t)
102 struct mlist *ml;
104 - if ((ml = CAST(struct mlist *, malloc(sizeof(*ml)))) == NULL)
105 + if ((ml = CAST(struct mlist *, emalloc(sizeof(*ml)))) == NULL)
155 protected struct magic_set *
157 struct magic_set *ms;
160 - if ((ms = CAST(struct magic_set *, calloc((size_t)1,
161 + if ((ms = CAST(struct magic_set *, ecalloc((size_t)1,
162 sizeof(struct magic_set)))) == NULL)
169 - if ((ms->c.li = CAST(struct level_info *, malloc(len))) == NULL)
170 + if ((ms->c.li = CAST(struct level_info *, emalloc(len))) == NULL)
211 private struct mlist *
214 struct mlist *mlist;
215 - if ((mlist = CAST(struct mlist *, calloc(1, sizeof(*mlist)))) == NULL) {
216 + if ((mlist = CAST(struct mlist *, ecalloc(1, sizeof(*mlist)))) == NULL) {
221 struct mlist *next = ml->next;
284 if ((mp = CAST(struct magic_entry *,
291 load_1(struct magic_set *ms, int action, const char *fn, int *errs,
292 struct magic_entry_set *mset)
300 struct magic_entry me;
339 - if ((*ma = CAST(struct magic *, malloc(slen))) == NULL) {
340 + if ((*ma = CAST(struct magic *, emalloc(slen))) == NULL) {
354 private struct magic_map *
361 struct stat st;
362 struct magic_map *map;
363 struct magic_entry_set mset[MAGIC_SETS];
365 - struct dirent *d;
375 - if ((map = CAST(struct magic_map *, calloc(1, sizeof(*map)))) == NULL)
376 + if ((map = CAST(struct magic_map *, ecalloc(1, sizeof(*map)))) == NULL)
467 struct magic *nm;
469 - if ((nm = CAST(struct magic *, realloc(me->mp,
470 + if ((nm = CAST(struct magic *, erealloc(me->mp,
478 - if ((m = CAST(struct magic *, malloc(len))) == NULL) {
479 + if ((m = CAST(struct magic *, emalloc(len))) == NULL) {
534 private struct magic_map *
535 apprentice_map(struct magic_set *ms, const char *fn)
538 - struct stat st;
543 struct magic_map *map;
549 - if ((map = CAST(struct magic_map *, calloc(1, sizeof(*map)))) == NULL) {
553 + if ((map = CAST(struct magic_map *, ecalloc(1, sizeof(*map)))) == NULL) {
642 - entries = (uint32_t)(st.st_size / sizeof(struct magic));
643 - if ((off_t)(entries * sizeof(struct magic)) != st.st_size) {
646 - sizeof(struct magic));
658 + nentries = (uint32_t)(st.sb.st_size / sizeof(struct magic));
659 + entries = (uint32_t)(st.sb.st_size / sizeof(struct magic));
660 + if ((off_t)(entries * sizeof(struct magic)) != st.sb.st_size) {
663 + sizeof(struct magic));
667 map->magic[0] = CAST(struct magic *, map->p) + 1;
740 + if (php_stream_seek(stream,(off_t)sizeof(struct magic), SEEK_SET) != sizeof(struct magic)) {
1026 - struct timespec ts;
1027 + struct timeval ts;
1035 - struct timespec ts;
1036 + struct timeval ts;
1071 typedef struct {
1086 -struct timespec;
1087 -int cdf_timestamp_to_timespec(struct timespec *, cdf_timestamp_t);
1088 -int cdf_timespec_to_timestamp(cdf_timestamp_t *, const struct timespec *);
1089 +struct timeval;
1090 +int cdf_timestamp_to_timespec(struct timeval *, cdf_timestamp_t);
1091 +int cdf_timespec_to_timestamp(cdf_timestamp_t *, const struct timeval *);
1112 -cdf_timestamp_to_timespec(struct timespec *ts, cdf_timestamp_t t)
1113 +cdf_timestamp_to_timespec(struct timeval *ts, cdf_timestamp_t t)
1115 struct tm tm;
1142 -cdf_timespec_to_timestamp(cdf_timestamp_t *t, const struct timespec *ts)
1143 +cdf_timespec_to_timestamp(cdf_timestamp_t *t, const struct timeval *ts)
1160 - struct timespec ts;
1161 + struct timeval ts;
1193 private const struct {
1203 private size_t uncompressbuf(struct magic_set *, int, size_t,
1365 /* Do this here and now, because struct stat gets re-defined on solaris */
1401 protected struct magic_set *file_ms_alloc(int);
1402 protected void file_ms_free(struct magic_set *);
1403 -protected int file_buffer(struct magic_set *, int, const char *, const void *,
1404 +protected int file_buffer(struct magic_set *, php_stream *, const char *, const void *,
1406 -protected int file_fsmagic(struct magic_set *, const char *, struct stat *);
1407 +protected int file_fsmagic(struct magic_set *, const char *, struct stat *, php_stream *);
1408 protected int file_pipe2file(struct magic_set *, int, const void *, size_t);
1409 -protected int file_vprintf(struct magic_set *, const char *, va_list)
1411 -protected size_t file_printedlen(const struct magic_set *);
1412 protected int file_replace(struct magic_set *, const char *, const char *);
1413 -protected int file_printf(struct magic_set *, const char *, ...)
1415 +protected int file_printf(struct magic_set *, const char *, ...);
1416 protected int file_reset(struct magic_set *);
1417 -protected int file_tryelf(struct magic_set *, int, const unsigned char *,
1419 protected int file_trycdf(struct magic_set *, int, const unsigned char *,
1423 protected int file_zmagic(struct magic_set *, int, const char *,
1427 protected int file_magicfind(struct magic_set *, const char *, struct mlist *);
1428 protected uint64_t file_signextend(struct magic_set *, struct magic *,
1430 +protected void file_delmagic(struct magic *, int type, size_t entries);
1431 protected void file_badread(struct magic_set *);
1432 protected void file_badseek(struct magic_set *);
1433 protected void file_oomem(struct magic_set *, size_t);
1434 -protected void file_error(struct magic_set *, int, const char *, ...)
1436 -protected void file_magerror(struct magic_set *, const char *, ...)
1438 -protected void file_magwarn(struct magic_set *, const char *, ...)
1440 -protected void file_mdump(struct magic *);
1441 +protected void file_error(struct magic_set *, int, const char *, ...);
1442 +protected void file_magerror(struct magic_set *, const char *, ...);
1443 +protected void file_magwarn(struct magic_set *, const char *, ...);
1446 protected const char *file_getbuffer(struct magic_set *);
1449 protected size_t file_pstring_length_size(const struct magic *);
1450 protected size_t file_pstring_get_length(const struct magic *, const char *);
1451 +protected size_t file_printedlen(const struct magic_set *ms);
1453 protected int file_os2_apptype(struct magic_set *, const char *, const void *,
1510 -bad_link(struct magic_set *ms, int err, char *buf)
1544 handle_mime(struct magic_set *ms, int mime, const char *str)
1550 -file_fsmagic(struct magic_set *ms, const char *fn, struct stat *sb)
1551 +file_fsmagic(struct magic_set *ms, const char *fn, struct stat *sb, php_stream *stream)
1558 - struct stat tstatbuf;
1596 + memcpy(sb, &ssb.sb, sizeof(struct stat));
1858 -file_vprintf(struct magic_set *ms, const char *fmt, va_list ap)
1891 file_printf(struct magic_set *ms, const char *fmt, ...)
1923 file_error_core(struct magic_set *ms, int error, const char *f, va_list va,
1963 -file_buffer(struct magic_set *ms, int fd, const char *inname __attribute__ ((unused)),
1965 +file_buffer(struct magic_set *ms, php_stream *stream, const char *inname, const void *buf,
2042 file_reset(struct magic_set *ms)
2059 file_getbuffer(struct magic_set *ms)
2086 ms->c.li = CAST(struct level_info *, (ms->c.li == NULL) ?
2099 file_replace(struct magic_set *ms, const char *pat, const char *rep)
2220 private void close_and_restore(const struct magic_set *, const char *, int,
2221 const struct stat *);
2222 private int unreadable_info(struct magic_set *, mode_t, const char *);
2226 -private const char *file_or_fd(struct magic_set *, const char *, int);
2228 +private const char *file_or_stream(struct magic_set *, const char *, php_stream *);
2245 struct stat st;
2298 public struct magic_set *
2305 -magic_check(struct magic_set *ms, const char *magicfile)
2313 magic_list(struct magic_set *ms, const char *magicfile)
2315 close_and_restore(const struct magic_set *ms, const char *name, int fd,
2316 const struct stat *sb)
2350 +magic_stream(struct magic_set *ms, php_stream *stream)
2358 -file_or_fd(struct magic_set *ms, const char *inname, int fd)
2359 +file_or_stream(struct magic_set *ms, const char *inname, php_stream *stream)
2363 struct stat sb;
2505 magic_error(struct magic_set *ms)
2568 -file_mdump(struct magic *m)
2734 file_magwarn(struct magic_set *ms, const char *f, ...)
2763 struct tm *tm;
2766 - struct timespec ts;
2767 + struct timeval ts;
2799 +static const struct cv {
2829 +cdf_clsid_to_mime(const uint64_t clsid[2], const struct cv *cv)
2840 cdf_app_to_mime(const char *vbuf, const struct nv *nv)
2845 cdf_file_property_info(struct magic_set *ms, const cdf_property_info_t *info,
2851 - struct timespec ts;
2852 + struct timeval ts;
2907 cdf_file_summary_info(struct magic_set *ms, const cdf_header_t *h,
3004 private int match(struct magic_set *, struct magic *, uint32_t,
3007 private int32_t moffset(struct magic_set *, struct magic *);
3009 private int mcopy(struct magic_set *, union VALUETYPE *, int, int,
3011 + const unsigned char *, uint32_t, size_t, struct magic *);
3012 private int mconvert(struct magic_set *, struct magic *, int);
3013 private int print_sep(struct magic_set *, int);
3014 private int handle_annotation(struct magic_set *, struct magic *);
3016 private void cvt_32(union VALUETYPE *, const struct magic *);
3017 private void cvt_64(union VALUETYPE *, const struct magic *);
3026 struct magic *m = &magic[magindex];
3047 check_fmt(struct magic_set *ms, struct magic *m)
3098 mprint(struct magic_set *ms, struct magic *m)
3165 mcopy(struct magic_set *ms, union VALUETYPE *p, int type, int indir,
3167 + const unsigned char *s, uint32_t offset, size_t nbytes, struct magic *m)
3322 magiccheck(struct magic_set *ms, struct magic *m)