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;
285 if ((mp = CAST(struct magic_entry *,
292 load_1(struct magic_set *ms, int action, const char *fn, int *errs,
293 struct magic_entry **mentry, uint32_t *mentrycount)
301 struct magic_entry me;
352 - if ((*ma = CAST(struct magic *, malloc(slen))) == NULL) {
353 + if ((*ma = CAST(struct magic *, emalloc(slen))) == NULL) {
367 private struct magic_map *
368 apprentice_load(struct magic_set *ms, const char *fn, int action)
372 struct magic_entry *mentry[MAGIC_SETS] = { NULL };
378 struct stat st;
379 struct magic_map *map;
381 - struct dirent *d;
389 - if ((map = CAST(struct magic_map *, calloc(1, sizeof(*map)))) == NULL) {
390 + if ((map = CAST(struct magic_map *, ecalloc(1, sizeof(*map)))) == NULL) {
493 struct magic *nm;
495 - if ((nm = CAST(struct magic *, realloc(me->mp,
496 + if ((nm = CAST(struct magic *, erealloc(me->mp,
504 - if ((m = CAST(struct magic *, malloc(len))) == NULL) {
505 + if ((m = CAST(struct magic *, emalloc(len))) == NULL) {
560 private struct magic_map *
561 apprentice_map(struct magic_set *ms, const char *fn)
564 - struct stat st;
569 struct magic_map *map;
575 - if ((map = CAST(struct magic_map *, calloc(1, sizeof(*map)))) == NULL) {
579 + if ((map = CAST(struct magic_map *, ecalloc(1, sizeof(*map)))) == NULL) {
672 - entries = (uint32_t)(st.st_size / sizeof(struct magic));
673 - if ((off_t)(entries * sizeof(struct magic)) != st.st_size) {
676 - sizeof(struct magic));
688 + nentries = (uint32_t)(st.sb.st_size / sizeof(struct magic));
689 + entries = (uint32_t)(st.sb.st_size / sizeof(struct magic));
690 + if ((off_t)(entries * sizeof(struct magic)) != st.sb.st_size) {
693 + sizeof(struct magic));
697 map->magic[0] = CAST(struct magic *, map->p) + 1;
774 + if (php_stream_seek(stream,(off_t)sizeof(struct magic), SEEK_SET) != sizeof(struct magic)) {
1045 - struct timespec ts;
1046 + struct timeval ts;
1054 - struct timespec ts;
1055 + struct timeval ts;
1090 typedef struct {
1105 -struct timespec;
1106 -int cdf_timestamp_to_timespec(struct timespec *, cdf_timestamp_t);
1107 -int cdf_timespec_to_timestamp(cdf_timestamp_t *, const struct timespec *);
1108 +struct timeval;
1109 +int cdf_timestamp_to_timespec(struct timeval *, cdf_timestamp_t);
1110 +int cdf_timespec_to_timestamp(cdf_timestamp_t *, const struct timeval *);
1121 -cdf_timestamp_to_timespec(struct timespec *ts, cdf_timestamp_t t)
1122 +cdf_timestamp_to_timespec(struct timeval *ts, cdf_timestamp_t t)
1124 struct tm tm;
1151 -cdf_timespec_to_timestamp(cdf_timestamp_t *t, const struct timespec *ts)
1152 +cdf_timespec_to_timestamp(cdf_timestamp_t *t, const struct timeval *ts)
1169 - struct timespec ts;
1170 + struct timeval ts;
1202 private const struct {
1212 private size_t uncompressbuf(struct magic_set *, int, size_t,
1374 /* Do this here and now, because struct stat gets re-defined on solaris */
1419 struct mlist {
1420 struct magic *magic; /* array of magic entries */
1424 struct mlist *next, *prev;
1428 protected struct magic_set *file_ms_alloc(int);
1429 protected void file_ms_free(struct magic_set *);
1430 -protected int file_buffer(struct magic_set *, int, const char *, const void *,
1431 +protected int file_buffer(struct magic_set *, php_stream *, const char *, const void *,
1433 -protected int file_fsmagic(struct magic_set *, const char *, struct stat *);
1434 +protected int file_fsmagic(struct magic_set *, const char *, struct stat *, php_stream *);
1435 protected int file_pipe2file(struct magic_set *, int, const void *, size_t);
1436 -protected int file_vprintf(struct magic_set *, const char *, va_list);
1437 -protected size_t file_printedlen(const struct magic_set *);
1438 protected int file_replace(struct magic_set *, const char *, const char *);
1439 -protected int file_printf(struct magic_set *, const char *, ...)
1441 +protected int file_printf(struct magic_set *, const char *, ...);
1442 protected int file_reset(struct magic_set *);
1443 -protected int file_tryelf(struct magic_set *, int, const unsigned char *,
1445 protected int file_trycdf(struct magic_set *, int, const unsigned char *,
1449 protected int file_zmagic(struct magic_set *, int, const char *,
1454 protected int file_is_tar(struct magic_set *, const unsigned char *, size_t);
1455 protected int file_softmagic(struct magic_set *, const unsigned char *, size_t,
1458 protected int file_apprentice(struct magic_set *, const char *, int);
1459 protected int file_magicfind(struct magic_set *, const char *, struct mlist *);
1460 protected uint64_t file_signextend(struct magic_set *, struct magic *,
1462 +protected void file_delmagic(struct magic *, int type, size_t entries);
1463 protected void file_badread(struct magic_set *);
1464 protected void file_badseek(struct magic_set *);
1465 protected void file_oomem(struct magic_set *, size_t);
1466 -protected void file_error(struct magic_set *, int, const char *, ...)
1468 -protected void file_magerror(struct magic_set *, const char *, ...)
1470 -protected void file_magwarn(struct magic_set *, const char *, ...)
1472 -protected void file_mdump(struct magic *);
1473 +protected void file_error(struct magic_set *, int, const char *, ...);
1474 +protected void file_magerror(struct magic_set *, const char *, ...);
1475 +protected void file_magwarn(struct magic_set *, const char *, ...);
1478 protected const char *file_getbuffer(struct magic_set *);
1481 protected size_t file_pstring_length_size(const struct magic *);
1482 protected size_t file_pstring_get_length(const struct magic *, const char *);
1483 +protected size_t file_printedlen(const struct magic_set *ms);
1485 protected int file_os2_apptype(struct magic_set *, const char *, const void *,
1527 -char *asctime_r(const struct tm *, char *);
1556 -bad_link(struct magic_set *ms, int err, char *buf)
1590 handle_mime(struct magic_set *ms, int mime, const char *str)
1596 -file_fsmagic(struct magic_set *ms, const char *fn, struct stat *sb)
1597 +file_fsmagic(struct magic_set *ms, const char *fn, struct stat *sb, php_stream *stream)
1604 - struct stat tstatbuf;
1642 + memcpy(sb, &ssb.sb, sizeof(struct stat));
1940 -file_vprintf(struct magic_set *ms, const char *fmt, va_list ap)
1941 +file_printf(struct magic_set *ms, const char *fmt, ...)
1979 -file_printf(struct magic_set *ms, const char *fmt, ...)
1992 file_error_core(struct magic_set *ms, int error, const char *f, va_list va,
2032 -file_buffer(struct magic_set *ms, int fd, const char *inname __attribute__ ((unused)),
2034 +file_buffer(struct magic_set *ms, php_stream *stream, const char *inname, const void *buf,
2088 file_reset(struct magic_set *ms)
2105 file_getbuffer(struct magic_set *ms)
2132 ms->c.li = CAST(struct level_info *, (ms->c.li == NULL) ?
2147 file_replace(struct magic_set *ms, const char *pat, const char *rep)
2261 private void close_and_restore(const struct magic_set *, const char *, int,
2262 const struct stat *);
2263 private int unreadable_info(struct magic_set *, mode_t, const char *);
2267 -private const char *file_or_fd(struct magic_set *, const char *, int);
2269 +private const char *file_or_stream(struct magic_set *, const char *, php_stream *);
2286 struct stat st;
2339 public struct magic_set *
2342 magic_load(struct magic_set *ms, const char *magicfile)
2355 -magic_check(struct magic_set *ms, const char *magicfile)
2363 magic_list(struct magic_set *ms, const char *magicfile)
2365 close_and_restore(const struct magic_set *ms, const char *name, int fd,
2366 const struct stat *sb)
2400 +magic_stream(struct magic_set *ms, php_stream *stream)
2408 -file_or_fd(struct magic_set *ms, const char *inname, int fd)
2409 +file_or_stream(struct magic_set *ms, const char *inname, php_stream *stream)
2413 struct stat sb;
2551 magic_error(struct magic_set *ms)
2602 -file_mdump(struct magic *m)
2768 file_magwarn(struct magic_set *ms, const char *f, ...)
2797 struct tm *tm;
2800 - struct timespec ts;
2801 + struct timeval ts;
2824 - struct timespec ts;
2825 + struct timeval ts;
2894 private int match(struct magic_set *, struct magic *, uint32_t,
2897 private int32_t moffset(struct magic_set *, struct magic *);
2899 private int mcopy(struct magic_set *, union VALUETYPE *, int, int,
2901 + const unsigned char *, uint32_t, size_t, struct magic *);
2902 private int mconvert(struct magic_set *, struct magic *, int);
2903 private int print_sep(struct magic_set *, int);
2904 private int handle_annotation(struct magic_set *, struct magic *);
2906 private void cvt_32(union VALUETYPE *, const struct magic *);
2907 private void cvt_64(union VALUETYPE *, const struct magic *);
2917 file_softmagic(struct magic_set *ms, const unsigned char *buf, size_t nbytes,
2921 struct mlist *ml;
2931 struct magic *m = &magic[magindex];
2952 check_fmt(struct magic_set *ms, struct magic *m)
3003 mprint(struct magic_set *ms, struct magic *m)
3070 mcopy(struct magic_set *ms, union VALUETYPE *p, int type, int indir,
3072 + const unsigned char *s, uint32_t offset, size_t nbytes, struct magic *m)
3365 magiccheck(struct magic_set *ms, struct magic *m)