Lines Matching refs:struct
75 - struct magic_set *ms;
101 struct type_tbl_s {
112 get_type(const struct type_tbl_s *tbl, const char *l, const char **t)
115 struct mlist *ml;
118 - if ((ml = CAST(struct mlist *, malloc(sizeof(*ml)))) == NULL)
119 + if ((ml = CAST(struct mlist *, emalloc(sizeof(*ml)))) == NULL)
124 apprentice_1(struct magic_set *ms, const char *fn, int action)
126 struct magic_map *map;
128 struct mlist *ml;
198 protected struct magic_set *
200 struct magic_set *ms;
203 - if ((ms = CAST(struct magic_set *, calloc((size_t)1,
204 + if ((ms = CAST(struct magic_set *, ecalloc((size_t)1,
205 sizeof(struct magic_set)))) == NULL)
212 - if ((ms->c.li = CAST(struct level_info *, malloc(len))) == NULL)
213 + if ((ms->c.li = CAST(struct level_info *, emalloc(len))) == NULL)
261 private struct mlist *
264 struct mlist *mlist;
265 - if ((mlist = CAST(struct mlist *, calloc(1, sizeof(*mlist)))) == NULL) {
266 + if ((mlist = CAST(struct mlist *, ecalloc(1, sizeof(*mlist)))) == NULL) {
284 -buffer_apprentice(struct magic_set *ms, struct magic **bufs,
288 - struct mlist *ml;
289 - struct magic_map *map;
332 file_apprentice(struct magic_set *ms, const char *fn, int action)
384 if ((mp = CAST(struct magic_entry *,
391 load_1(struct magic_set *ms, int action, const char *fn, int *errs,
392 struct magic_entry_set *mset)
400 struct magic_entry me;
439 - if ((*ma = CAST(struct magic *, malloc(slen))) == NULL) {
440 + if ((*ma = CAST(struct magic *, emalloc(slen))) == NULL) {
454 private struct magic_map *
460 - struct stat st;
463 struct magic_map *map;
464 struct magic_entry_set mset[MAGIC_SETS];
466 - struct dirent *d;
475 - if ((map = CAST(struct magic_map *, calloc(1, sizeof(*map)))) == NULL)
476 + if ((map = CAST(struct magic_map *, ecalloc(1, sizeof(*map)))) == NULL)
547 struct magic *nm;
549 - if ((nm = CAST(struct magic *, realloc(me->mp,
550 + if ((nm = CAST(struct magic *, erealloc(me->mp,
558 - if ((m = CAST(struct magic *, malloc(len))) == NULL) {
559 + if ((m = CAST(struct magic *, emalloc(len))) == NULL) {
605 parse_extra(struct magic_set *ms, struct magic_entry *me, const char *line,
612 struct magic *m = &me->mp[0];
615 - CAST(off_t, offsetof(struct magic, mimetype)),
616 + CAST(zend_off_t, offsetof(struct magic, mimetype)),
647 private struct magic_map *
648 apprentice_map(struct magic_set *ms, const char *fn)
651 - struct stat st;
656 struct magic_map *map;
662 - if ((map = CAST(struct magic_map *, calloc(1, sizeof(*map)))) == NULL) {
665 + if ((map = CAST(struct magic_map *, ecalloc(1, sizeof(*map)))) == NULL) {
772 + nentries = (uint32_t)(st.sb.st_size / sizeof(struct magic));
773 + entries = (uint32_t)(st.sb.st_size / sizeof(struct magic));
774 + if ((zend_off_t)(entries * sizeof(struct magic)) != st.sb.st_size) {
777 + sizeof(struct magic));
781 + map->magic[0] = CAST(struct magic *, map->p) + 1;
838 struct magic m;
1077 - struct timespec ts;
1078 + struct timeval ts;
1086 - struct timespec ts;
1087 + struct timeval ts;
1135 -struct timespec;
1136 -int cdf_timestamp_to_timespec(struct timespec *, cdf_timestamp_t);
1137 -int cdf_timespec_to_timestamp(cdf_timestamp_t *, const struct timespec *);
1138 +struct timeval;
1139 +int cdf_timestamp_to_timespec(struct timeval *, cdf_timestamp_t);
1140 +int cdf_timespec_to_timestamp(cdf_timestamp_t *, const struct timeval *);
1151 -cdf_timestamp_to_timespec(struct timespec *ts, cdf_timestamp_t t)
1152 +cdf_timestamp_to_timespec(struct timeval *ts, cdf_timestamp_t t)
1154 struct tm tm;
1172 -cdf_timespec_to_timestamp(cdf_timestamp_t *t, const struct timespec *ts)
1173 +cdf_timespec_to_timestamp(cdf_timestamp_t *t, const struct timeval *ts)
1190 - struct timespec ts;
1191 + struct timeval ts;
1227 private const struct {
1237 private size_t uncompressbuf(struct magic_set *, int, size_t,
1463 /* Do this here and now, because struct stat gets re-defined on solaris */
1499 -struct stat;
1503 protected struct magic_set *file_ms_alloc(int);
1504 protected void file_ms_free(struct magic_set *);
1505 -protected int file_buffer(struct magic_set *, int, const char *, const void *,
1506 +protected int file_buffer(struct magic_set *, php_stream *, const char *, const void *,
1508 -protected int file_fsmagic(struct magic_set *, const char *, struct stat *);
1509 +protected int file_fsmagic(struct magic_set *, const char *, zend_stat_t *, php_stream *);
1510 protected int file_pipe2file(struct magic_set *, int, const void *, size_t);
1511 -protected int file_vprintf(struct magic_set *, const char *, va_list)
1513 protected size_t file_printedlen(const struct magic_set *);
1514 protected int file_replace(struct magic_set *, const char *, const char *);
1515 -protected int file_printf(struct magic_set *, const char *, ...)
1517 +protected int file_printf(struct magic_set *, const char *, ...);
1518 protected int file_reset(struct magic_set *);
1519 -protected int file_tryelf(struct magic_set *, int, const unsigned char *,
1521 protected int file_trycdf(struct magic_set *, int, const unsigned char *,
1525 protected int file_zmagic(struct magic_set *, int, const char *,
1529 protected int file_magicfind(struct magic_set *, const char *, struct mlist *);
1530 protected uint64_t file_signextend(struct magic_set *, struct magic *,
1532 +protected void file_delmagic(struct magic *, int type, size_t entries);
1533 protected void file_badread(struct magic_set *);
1534 protected void file_badseek(struct magic_set *);
1535 protected void file_oomem(struct magic_set *, size_t);
1536 -protected void file_error(struct magic_set *, int, const char *, ...)
1538 -protected void file_magerror(struct magic_set *, const char *, ...)
1540 -protected void file_magwarn(struct magic_set *, const char *, ...)
1542 -protected void file_mdump(struct magic *);
1543 +protected void file_error(struct magic_set *, int, const char *, ...);
1544 +protected void file_magerror(struct magic_set *, const char *, ...);
1545 +protected void file_magwarn(struct magic_set *, const char *, ...);
1548 protected const char *file_getbuffer(struct magic_set *);
1560 -typedef struct {
1575 -protected void file_regerror(file_regex_t *, int, struct magic_set *);
1577 typedef struct {
1581 protected file_pushbuf_t *file_push_buffer(struct magic_set *);
1582 protected char *file_pop_buffer(struct magic_set *, file_pushbuf_t *);
1616 char *asctime_r(const struct tm *, char *);
1619 -struct tm *gmtime_r(const time_t *, struct tm *);
1622 -struct tm *localtime_r(const time_t *, struct tm *);
1655 -bad_link(struct magic_set *ms, int err, char *buf)
1689 handle_mime(struct magic_set *ms, int mime, const char *str)
1695 -file_fsmagic(struct magic_set *ms, const char *fn, struct stat *sb)
1696 +file_fsmagic(struct magic_set *ms, const char *fn, zend_stat_t *sb, php_stream *stream)
1703 - struct stat tstatbuf;
1758 + memcpy(sb, &ssb.sb, sizeof(struct stat));
2027 -file_vprintf(struct magic_set *ms, const char *fmt, va_list ap)
2060 file_printf(struct magic_set *ms, const char *fmt, ...)
2092 file_error_core(struct magic_set *ms, int error, const char *f, va_list va,
2133 -file_buffer(struct magic_set *ms, int fd, const char *inname __attribute__ ((__unused__)),
2135 +file_buffer(struct magic_set *ms, php_stream *stream, const char *inname, const void *buf,
2192 file_reset(struct magic_set *ms)
2209 file_getbuffer(struct magic_set *ms)
2232 ms->c.li = CAST(struct level_info *, (ms->c.li == NULL) ?
2242 file_replace(struct magic_set *ms, const char *pat, const char *rep)
2326 -file_regerror(file_regex_t *rx, int rc, struct magic_set *ms)
2438 private void close_and_restore(const struct magic_set *, const char *, int,
2439 - const struct stat *);
2441 private int unreadable_info(struct magic_set *, mode_t, const char *);
2445 -private const char *file_or_fd(struct magic_set *, const char *, int);
2447 +private const char *file_or_stream(struct magic_set *, const char *, php_stream *);
2464 struct stat st;
2512 public struct magic_set *
2523 -magic_load_buffers(struct magic_set *ms, void **bufs, size_t *sizes,
2528 - return buffer_apprentice(ms, (struct magic **)bufs, sizes, nbufs);
2533 magic_compile(struct magic_set *ms, const char *magicfile)
2540 -magic_check(struct magic_set *ms, const char *magicfile)
2548 magic_list(struct magic_set *ms, const char *magicfile)
2552 close_and_restore(const struct magic_set *ms, const char *name, int fd,
2553 - const struct stat *sb)
2588 +magic_stream(struct magic_set *ms, php_stream *stream)
2596 -file_or_fd(struct magic_set *ms, const char *inname, int fd)
2597 +file_or_stream(struct magic_set *ms, const char *inname, php_stream *stream)
2601 - struct stat sb;
2774 magic_error(struct magic_set *ms)
2891 -file_mdump(struct magic *m)
3058 file_magwarn(struct magic_set *ms, const char *f, ...)
3089 - struct tm *tm, tmz;
3091 + struct tm *tm = NULL;
3094 - struct timespec ts;
3096 + struct timeval ts;
3115 + struct tm *tm1;
3168 static const struct cv {
3224 - struct timespec ts;
3225 + struct timeval ts;
3281 private int match(struct magic_set *, struct magic *, uint32_t,
3307 struct magic *m = &magic[magindex];
3317 check_fmt(struct magic_set *ms, struct magic *m)
3367 mprint(struct magic_set *ms, struct magic *m)
3543 magiccheck(struct magic_set *ms, struct magic *m)