Lines Matching refs:p

117 	void *p;  member
276 const struct type_tbl_s *p; in get_type() local
278 for (p = tbl; p->len; p++) { in get_type()
279 if (strncmp(l, p->name, p->len) == 0) { in get_type()
281 *t = l + p->len; in get_type()
285 return p->type; in get_type()
386 const struct type_tbl_s *p; in init_file_tables() local
392 for (p = type_tbl; p->len; p++) { in init_file_tables()
393 assert(p->type < FILE_NAMES_SIZE); in init_file_tables()
394 file_names[p->type] = p->name; in init_file_tables()
395 file_formats[p->type] = p->format; in init_file_tables()
397 assert(p - type_tbl == FILE_NAMES_SIZE); in init_file_tables()
550 if (map->p != php_magic_database) { in apprentice_unmap()
551 if (map->p == NULL) { in apprentice_unmap()
559 efree(map->p); in apprentice_unmap()
615 char *p, *mfn; in file_apprentice() local
662 p = strchr(fn, PATHSEP); in file_apprentice()
663 if (p) in file_apprentice()
664 *p++ = '\0'; in file_apprentice()
669 fn = p; in file_apprentice()
721 const char *p; in nonmagic() local
724 for (p = str; *p; p++) in nonmagic()
725 switch (*p) { in nonmagic()
727 if (!*++p) in nonmagic()
728 p--; in nonmagic()
739 while (*p && *p != ']') in nonmagic()
740 p++; in nonmagic()
741 p--; in nonmagic()
744 while (*p && *p != '}') in nonmagic()
745 p++; in nonmagic()
746 if (!*p) in nonmagic()
747 p--; in nonmagic()
1249 char *p = strstr(me[i].mp->desc, text); in set_text_binary() local
1250 if (p && (p == me[i].mp->desc || in set_text_binary()
1251 isspace(CAST(unsigned char, p[-1]))) && in set_text_binary()
1252 (p + len - me[i].mp->desc == MAXstring in set_text_binary()
1253 || (p[len] == '\0' || in set_text_binary()
1254 isspace(CAST(unsigned char, p[len]))))) in set_text_binary()
1619 const struct cond_tbl_s *p; in get_cond() local
1621 for (p = cond_tbl; p->len; p++) { in get_cond()
1622 if (strncmp(l, p->name, p->len) == 0 && in get_cond()
1623 isspace(CAST(unsigned char, l[p->len]))) { in get_cond()
1625 *t = l + p->len; in get_cond()
1629 return p->cond; in get_cond()
2637 getvalue(struct magic_set *ms, struct magic *m, const char **p, int action) in getvalue() argument
2652 *p = getstr(ms, m, *p, action == FILE_COMPILE); in getvalue()
2653 if (*p == NULL) { in getvalue()
2687 m->value.f = strtof(*p, &ep); in getvalue()
2689 m->value.f = (float)strtod(*p, &ep); in getvalue()
2692 *p = ep; in getvalue()
2698 m->value.d = strtod(*p, &ep); in getvalue()
2700 *p = ep; in getvalue()
2703 if (file_parse_guid(*p, m->value.guid) == -1) in getvalue()
2705 *p += FILE_GUID_SIZE - 1; in getvalue()
2709 ull = CAST(uint64_t, strtoull(*p, &ep, 0)); in getvalue()
2711 if (*p == ep) { in getvalue()
2712 file_magwarn(ms, "Unparsable number `%s'", *p); in getvalue()
2723 for (q = *p; isspace(CAST(unsigned char, *q)); q++) in getvalue()
2750 *p = ep; in getvalue()
2751 eatsize(p); in getvalue()
2767 char *p = m->value.s; in getstr() local
2769 char *origp = p; in getstr()
2770 char *pmax = p + plen - 1; in getstr()
2777 if (p >= pmax) { in getstr()
2837 *p++ = CAST(char, c); in getstr()
2841 *p++ = '\a'; in getstr()
2845 *p++ = '\b'; in getstr()
2849 *p++ = '\f'; in getstr()
2853 *p++ = '\n'; in getstr()
2857 *p++ = '\r'; in getstr()
2861 *p++ = '\t'; in getstr()
2865 *p++ = '\v'; in getstr()
2889 *p++ = CAST(char, val); in getstr()
2905 *p++ = CAST(char, val); in getstr()
2909 *p++ = CAST(char, c); in getstr()
2913 *p = '\0'; in getstr()
2914 m->vallen = CAST(unsigned char, (p - origp)); in getstr()
3005 eatsize(const char **p) in eatsize() argument
3007 const char *l = *p; in eatsize()
3024 *p = l; in eatsize()
3051 map->p = (void *)&php_magic_database; in apprentice_map()
3089 map->p = CAST(void *, emalloc(map->len)); in apprentice_map()
3091 if (php_stream_read(stream, map->p, (size_t)st.sb.st_size) != (size_t)st.sb.st_size) { in apprentice_map()
3100 ptr = (uint32_t *)(void *)map->p; in apprentice_map()
3124 map->p = emalloc(sizeof(php_magic_database)); in apprentice_map()
3125 map->p = memcpy(map->p, php_magic_database, sizeof(php_magic_database)); in apprentice_map()
3138 map->magic[0] = CAST(struct magic *, map->p) + 1; in apprentice_map()
3238 const char *p, *q; local
3242 if ((p = strrchr(fn, '/')) != NULL)
3243 fn = ++p;
3249 for (p = ext + sizeof(ext) - 1; p >= ext && q >= fn; p--, q--)
3250 if (*p != *q)
3254 if (p >= ext)