Lines Matching refs:struct

84  struct magic_entry {
85 - struct magic *mp;
86 + struct magic *mp;
91 private size_t apprentice_magic_strength(const struct magic *);
93 private void apprentice_list(struct mlist *, int );
94 -private struct magic_map *apprentice_load(struct magic_set *,
95 +private struct magic_map *apprentice_load(struct magic_set *,
97 private struct mlist *mlist_alloc(void);
98 private void mlist_free(struct mlist *);
111 - struct magic_set *ms;
137 struct type_tbl_s {
140 struct mlist *ml;
143 - if ((ml = CAST(struct mlist *, malloc(sizeof(*ml)))) == NULL)
144 + if ((ml = CAST(struct mlist *, emalloc(sizeof(*ml)))) == NULL)
149 apprentice_1(struct magic_set *ms, const char *fn, int action)
151 struct magic_map *map;
153 struct mlist *ml;
165 if (map == (struct magic_map *)-1)
209 protected struct magic_set *
211 struct magic_set *ms;
214 - if ((ms = CAST(struct magic_set *, calloc((size_t)1,
215 + if ((ms = CAST(struct magic_set *, ecalloc((size_t)1,
216 sizeof(struct magic_set)))) == NULL)
223 - if ((ms->c.li = CAST(struct level_info *, malloc(len))) == NULL)
224 + if ((ms->c.li = CAST(struct level_info *, emalloc(len))) == NULL)
238 apprentice_unmap(struct magic_map *map)
281 private struct mlist *
284 struct mlist *mlist;
285 - if ((mlist = CAST(struct mlist *, calloc(1, sizeof(*mlist)))) == NULL) {
286 + if ((mlist = CAST(struct mlist *, ecalloc(1, sizeof(*mlist)))) == NULL) {
293 apprentice_unmap(CAST(struct magic_map *, ml->map));
304 -buffer_apprentice(struct magic_set *ms, struct magic **bufs,
308 - struct mlist *ml;
309 - struct magic_map *map;
351 file_apprentice(struct magic_set *ms, const char *fn, int action)
434 if ((mp = CAST(struct magic_entry *,
441 load_1(struct magic_set *ms, int action, const char *fn, int *errs,
442 struct magic_entry_set *mset)
450 struct magic_entry me;
498 - if ((*ma = CAST(struct magic *, malloc(slen))) == NULL) {
499 + if ((*ma = CAST(struct magic *, emalloc(slen))) == NULL) {
513 private struct magic_map *
519 - struct stat st;
522 struct magic_map *map;
523 struct magic_entry_set mset[MAGIC_SETS];
525 - struct dirent *d;
534 - if ((map = CAST(struct magic_map *, calloc(1, sizeof(*map)))) == NULL)
535 + if ((map = CAST(struct magic_map *, ecalloc(1, sizeof(*map)))) == NULL)
617 struct magic *nm;
619 - if ((nm = CAST(struct magic *, realloc(me->mp,
620 + if ((nm = CAST(struct magic *, erealloc(me->mp,
628 - if ((m = CAST(struct magic *, malloc(len))) == NULL) {
629 + if ((m = CAST(struct magic *, emalloc(len))) == NULL) {
738 parse_extra(struct magic_set *ms, struct magic_entry *me, const char *line,
754 struct magic *m = &me->mp[0];
757 - CAST(off_t, offsetof(struct magic, mimetype)),
758 + CAST(zend_off_t, offsetof(struct magic, mimetype)),
907 struct magic_map *map;
909 - if ((map = CAST(struct magic_map *, calloc(1, sizeof(*map)))) == NULL) {
910 + if ((map = CAST(struct magic_map *, ecalloc(1, sizeof(*map)))) == NULL) {
915 private struct magic_map *
916 apprentice_map(struct magic_set *ms, const char *fn)
919 - struct stat st;
924 struct magic_map *map;
925 - struct magic_map *rv = NULL;
933 - if ((map = CAST(struct magic_map *, calloc(1, sizeof(*map)))) == NULL) {
934 + if ((map = CAST(struct magic_map *, ecalloc(1, sizeof(*map)))) == NULL) {
1008 - rv = (struct magic_map *)-1;
1045 + nentries = (uint32_t)(st.sb.st_size / sizeof(struct magic));
1046 + entries = (uint32_t)(st.sb.st_size / sizeof(struct magic));
1047 + if ((zend_off_t)(entries * sizeof(struct magic)) != st.sb.st_size) {
1050 + sizeof(struct magic));
1054 + map->magic[0] = CAST(struct magic *, map->p) + 1;
1115 struct magic m;
1243 file_pstring_length_size(const struct magic *m)
1328 buffer_init(struct buffer *b, int fd, const void *data, size_t len)
1338 buffer_fini(struct buffer *b)
1601 - struct timespec ts;
1602 + struct timeval ts;
1619 - struct timespec ts;
1620 + struct timeval ts;
1668 typedef struct {
1708 struct tm tm;
1851 -file_zmagic(struct magic_set *ms, const struct buffer *b, const char *name)
1852 +file_zmagic(struct magic_set *ms, int fd, const char *name,
2223 /* Do this here and now, because struct stat gets re-defined on solaris */
2248 struct buffer {
2250 - struct stat st;
2272 -struct stat;
2276 protected struct magic_set *file_ms_alloc(int);
2277 protected void file_ms_free(struct magic_set *);
2278 -protected int file_buffer(struct magic_set *, int, const char *, const void *,
2279 +protected int file_buffer(struct magic_set *, php_stream *, const char *, const void *,
2281 -protected int file_fsmagic(struct magic_set *, const char *, struct stat *);
2282 +protected int file_fsmagic(struct magic_set *, const char *, zend_stat_t *, php_stream *);
2283 protected int file_pipe2file(struct magic_set *, int, const void *, size_t);
2284 -protected int file_vprintf(struct magic_set *, const char *, va_list)
2286 protected size_t file_printedlen(const struct magic_set *);
2287 protected int file_replace(struct magic_set *, const char *, const char *);
2288 -protected int file_printf(struct magic_set *, const char *, ...)
2290 +protected int file_printf(struct magic_set *, const char *, ...);
2291 protected int file_reset(struct magic_set *, int);
2292 protected int file_tryelf(struct magic_set *, const struct buffer *);
2293 protected int file_trycdf(struct magic_set *, const struct buffer *);
2296 protected int file_zmagic(struct magic_set *, const struct buffer *,
2300 protected void file_badread(struct magic_set *);
2301 protected void file_badseek(struct magic_set *);
2302 protected void file_oomem(struct magic_set *, size_t);
2303 -protected void file_error(struct magic_set *, int, const char *, ...)
2305 -protected void file_magerror(struct magic_set *, const char *, ...)
2307 -protected void file_magwarn(struct magic_set *, const char *, ...)
2309 -protected void file_mdump(struct magic *);
2310 +protected void file_error(struct magic_set *, int, const char *, ...);
2311 +protected void file_magerror(struct magic_set *, const char *, ...);
2312 +protected void file_magwarn(struct magic_set *, const char *, ...);
2315 protected const char *file_getbuffer(struct magic_set *);
2317 protected void buffer_fini(struct buffer *);
2318 protected int buffer_fill(const struct buffer *);
2327 -typedef struct {
2344 -protected void file_regerror(file_regex_t *, int, struct magic_set *);
2348 typedef struct {
2351 protected file_pushbuf_t *file_push_buffer(struct magic_set *);
2352 protected char *file_pop_buffer(struct magic_set *, file_pushbuf_t *);
2389 char *asctime_r(const struct tm *, char *);
2392 -struct tm *gmtime_r(const time_t *, struct tm *);
2395 -struct tm *localtime_r(const time_t *, struct tm *);
2473 -bad_link(struct magic_set *ms, int err, char *buf)
2497 handle_mime(struct magic_set *ms, int mime, const char *str)
2502 -file_fsmagic(struct magic_set *ms, const char *fn, struct stat *sb)
2503 +file_fsmagic(struct magic_set *ms, const char *fn, zend_stat_t *sb, php_stream *stream)
2511 - struct stat tstatbuf;
2574 + memcpy(sb, &ssb.sb, sizeof(struct stat));
2836 -file_vprintf(struct magic_set *ms, const char *fmt, va_list ap)
2868 file_printf(struct magic_set *ms, const char *fmt, ...)
2900 file_error_core(struct magic_set *ms, int error, const char *f, va_list va,
2943 checkdone(struct magic_set *ms, int *rv)
2948 -file_buffer(struct magic_set *ms, int fd, const char *inname __attribute__ ((__unused__)),
2950 +file_buffer(struct magic_set *ms, php_stream *stream, const char *inname, const void *buf,
2958 struct buffer b;
3022 file_reset(struct magic_set *ms, int checkloaded)
3049 ms->c.li = CAST(struct level_info *, (ms->c.li == NULL) ?
3059 file_replace(struct magic_set *ms, const char *pat, const char *rep)
3148 -file_regerror(file_regex_t *rx, int rc, struct magic_set *ms)
3237 private void close_and_restore(const struct magic_set *, const char *, int,
3238 - const struct stat *);
3240 private int unreadable_info(struct magic_set *, mode_t, const char *);
3244 -private const char *file_or_fd(struct magic_set *, const char *, int);
3246 +private const char *file_or_stream(struct magic_set *, const char *, php_stream *);
3348 - struct stat st;
3428 public struct magic_set *
3440 -magic_load_buffers(struct magic_set *ms, void **bufs, size_t *sizes,
3445 - return buffer_apprentice(ms, (struct magic **)bufs, sizes, nbufs);
3450 magic_compile(struct magic_set *ms, const char *magicfile)
3455 close_and_restore(const struct magic_set *ms, const char *name, int fd,
3456 - const struct stat *sb)
3487 +magic_stream(struct magic_set *ms, php_stream *stream)
3495 -file_or_fd(struct magic_set *ms, const char *inname, int fd)
3496 +file_or_stream(struct magic_set *ms, const char *inname, php_stream *stream)
3500 - struct stat sb;
3665 magic_error(struct magic_set *ms)
3716 file_magwarn(struct magic_set *ms, const char *f, ...)
3920 private int match(struct magic_set *, struct magic *, uint32_t,
3921 const struct buffer *, size_t, int, int, int, uint16_t *,
3947 struct magic *m = &magic[magindex];
3957 check_fmt(struct magic_set *ms, const char *fmt)
4009 varexpand(char *buf, size_t len, const struct buffer *b, const char *str)
4134 magiccheck(struct magic_set *ms, struct magic *m)