Lines Matching refs:p

105 	void *p;  member
320 const struct type_tbl_s *p; in get_type() local
322 for (p = tbl; p->len; p++) { in get_type()
323 if (strncmp(l, p->name, p->len) == 0) { in get_type()
325 *t = l + p->len; in get_type()
329 return p->type; in get_type()
430 const struct type_tbl_s *p; in init_file_tables() local
436 for (p = type_tbl; p->len; p++) { in init_file_tables()
437 assert(p->type < FILE_NAMES_SIZE); in init_file_tables()
438 file_names[p->type] = p->name; in init_file_tables()
439 file_formats[p->type] = p->format; in init_file_tables()
441 assert(p - type_tbl == FILE_NAMES_SIZE); in init_file_tables()
601 if (map->p != php_magic_database) { in apprentice_unmap()
602 if (map->p == NULL) { in apprentice_unmap()
610 efree(map->p); in apprentice_unmap()
666 char *p, *mfn; in file_apprentice() local
713 p = CCAST(char *, strchr(fn, PATHSEP)); in file_apprentice()
714 if (p) in file_apprentice()
715 *p++ = '\0'; in file_apprentice()
720 fn = p; in file_apprentice()
772 const char *p; in nonmagic() local
775 for (p = str; *p; p++) in nonmagic()
776 switch (*p) { in nonmagic()
778 if (!*++p) in nonmagic()
779 p--; in nonmagic()
790 while (*p && *p != ']') in nonmagic()
791 p++; in nonmagic()
792 p--; in nonmagic()
795 while (*p && *p != '}') in nonmagic()
796 p++; in nonmagic()
797 if (!*p) in nonmagic()
798 p--; in nonmagic()
1375 char *p = strstr(me[i].mp->desc, text); in set_text_binary() local
1376 if (p && (p == me[i].mp->desc || in set_text_binary()
1377 isspace(CAST(unsigned char, p[-1]))) && in set_text_binary()
1378 (p + len - me[i].mp->desc == MAXstring in set_text_binary()
1379 || (p[len] == '\0' || in set_text_binary()
1380 isspace(CAST(unsigned char, p[len]))))) in set_text_binary()
1760 const struct cond_tbl_s *p; in get_cond() local
1762 for (p = cond_tbl; p->len; p++) { in get_cond()
1763 if (strncmp(l, p->name, p->len) == 0 && in get_cond()
1764 isspace(CAST(unsigned char, l[p->len]))) { in get_cond()
1766 *t = l + p->len; in get_cond()
1770 return p->cond; in get_cond()
2777 getvalue(struct magic_set *ms, struct magic *m, const char **p, int action) in getvalue() argument
2793 *p = getstr(ms, m, *p, action == FILE_COMPILE); in getvalue()
2794 if (*p == NULL) { in getvalue()
2828 m->value.f = strtof(*p, &ep); in getvalue()
2830 m->value.f = (float)strtod(*p, &ep); in getvalue()
2833 *p = ep; in getvalue()
2839 m->value.d = strtod(*p, &ep); in getvalue()
2841 *p = ep; in getvalue()
2844 if (file_parse_guid(*p, m->value.guid) == -1) in getvalue()
2846 *p += FILE_GUID_SIZE - 1; in getvalue()
2850 ull = CAST(uint64_t, strtoull(*p, &ep, 0)); in getvalue()
2852 if (*p == ep) { in getvalue()
2853 file_magwarn(ms, "Unparsable number `%s'", *p); in getvalue()
2864 for (q = *p; isspace(CAST(unsigned char, *q)); q++) in getvalue()
2892 *p = ep; in getvalue()
2893 eatsize(p); in getvalue()
2909 char *p = m->value.s; in getstr() local
2911 char *origp = p; in getstr()
2912 char *pmax = p + plen - 1; in getstr()
2920 if (p >= pmax) { in getstr()
2931 *p++ = CAST(char, c); in getstr()
2996 *p++ = CAST(char, c); in getstr()
3000 *p++ = '\a'; in getstr()
3004 *p++ = '\b'; in getstr()
3008 *p++ = '\f'; in getstr()
3012 *p++ = '\n'; in getstr()
3016 *p++ = '\r'; in getstr()
3020 *p++ = '\t'; in getstr()
3024 *p++ = '\v'; in getstr()
3048 *p++ = CAST(char, val); in getstr()
3064 *p++ = CAST(char, val); in getstr()
3070 *p = '\0'; in getstr()
3071 m->vallen = CAST(unsigned char, (p - origp)); in getstr()
3162 eatsize(const char **p) in eatsize() argument
3164 const char *l = *p; in eatsize()
3181 *p = l; in eatsize()
3208 map->p = (void *)&php_magic_database; in apprentice_map()
3246 map->p = CAST(void *, emalloc(map->len)); in apprentice_map()
3248 if (php_stream_read(stream, map->p, (size_t)st.sb.st_size) != (size_t)st.sb.st_size) { in apprentice_map()
3257 ptr = (uint32_t *)(void *)map->p; in apprentice_map()
3281 map->p = emalloc(sizeof(php_magic_database)); in apprentice_map()
3282 map->p = memcpy(map->p, php_magic_database, sizeof(php_magic_database)); in apprentice_map()
3295 map->magic[0] = CAST(struct magic *, map->p) + 1; in apprentice_map()
3395 const char *p, *q; local
3399 if ((p = strrchr(fn, '/')) != NULL)
3400 fn = ++p;
3406 for (p = ext + sizeof(ext) - 1; p >= ext && q >= fn; p--, q--)
3407 if (*p != *q)
3411 if (p >= ext)