Lines Matching refs:p

98 	void *p;  member
248 const struct type_tbl_s *p; in get_type() local
250 for (p = tbl; p->len; p++) { in get_type()
251 if (strncmp(l, p->name, p->len) == 0) { in get_type()
253 *t = l + p->len; in get_type()
257 return p->type; in get_type()
349 const struct type_tbl_s *p; in init_file_tables() local
355 for (p = type_tbl; p->len; p++) { in init_file_tables()
356 assert(p->type < FILE_NAMES_SIZE); in init_file_tables()
357 file_names[p->type] = p->name; in init_file_tables()
358 file_formats[p->type] = p->format; in init_file_tables()
360 assert(p - type_tbl == FILE_NAMES_SIZE); in init_file_tables()
495 if (map->p != php_magic_database) { in apprentice_unmap()
496 if (map->p == NULL) { in apprentice_unmap()
504 efree(map->p); in apprentice_unmap()
543 char *p, *mfn; in file_apprentice() local
589 p = strchr(fn, PATHSEP); in file_apprentice()
590 if (p) in file_apprentice()
591 *p++ = '\0'; in file_apprentice()
596 fn = p; in file_apprentice()
1059 char *p = strstr(me[i].mp->desc, text); in set_text_binary() local
1060 if (p && (p == me[i].mp->desc || in set_text_binary()
1061 isspace((unsigned char)p[-1])) && in set_text_binary()
1062 (p + len - me[i].mp->desc == MAXstring in set_text_binary()
1063 || (p[len] == '\0' || in set_text_binary()
1064 isspace((unsigned char)p[len])))) in set_text_binary()
1431 const struct cond_tbl_s *p; in get_cond() local
1433 for (p = cond_tbl; p->len; p++) { in get_cond()
1434 if (strncmp(l, p->name, p->len) == 0 && in get_cond()
1435 isspace((unsigned char)l[p->len])) { in get_cond()
1437 *t = l + p->len; in get_cond()
1441 return p->cond; in get_cond()
2268 getvalue(struct magic_set *ms, struct magic *m, const char **p, int action) in getvalue() argument
2279 *p = getstr(ms, m, *p, action == FILE_COMPILE); in getvalue()
2280 if (*p == NULL) { in getvalue()
2293 m->value.f = strtof(*p, &ep); in getvalue()
2295 m->value.f = (float)strtod(*p, &ep); in getvalue()
2297 *p = ep; in getvalue()
2305 m->value.d = strtod(*p, &ep); in getvalue()
2306 *p = ep; in getvalue()
2313 (uint64_t)strtoull(*p, &ep, 0)); in getvalue()
2314 *p = ep; in getvalue()
2315 eatsize(p); in getvalue()
2331 char *p = m->value.s; in getstr() local
2333 char *origp = p; in getstr()
2334 char *pmax = p + plen - 1; in getstr()
2341 if (p >= pmax) { in getstr()
2400 *p++ = (char) c; in getstr()
2404 *p++ = '\a'; in getstr()
2408 *p++ = '\b'; in getstr()
2412 *p++ = '\f'; in getstr()
2416 *p++ = '\n'; in getstr()
2420 *p++ = '\r'; in getstr()
2424 *p++ = '\t'; in getstr()
2428 *p++ = '\v'; in getstr()
2452 *p++ = (char)val; in getstr()
2468 *p++ = (char)val; in getstr()
2472 *p++ = (char)c; in getstr()
2475 *p = '\0'; in getstr()
2476 m->vallen = CAST(unsigned char, (p - origp)); in getstr()
2563 eatsize(const char **p) in eatsize() argument
2565 const char *l = *p; in eatsize()
2582 *p = l; in eatsize()
2611 map->p = (void *)&php_magic_database; in apprentice_map()
2650 if ((map->p = CAST(void *, emalloc(map->len))) == NULL) { in apprentice_map()
2654 if (php_stream_read(stream, map->p, (size_t)st.sb.st_size) != (size_t)st.sb.st_size) { in apprentice_map()
2665 ptr = (uint32_t *)(void *)map->p; in apprentice_map()
2689 map->p = emalloc(sizeof(php_magic_database)); in apprentice_map()
2690 map->p = memcpy(map->p, php_magic_database, sizeof(php_magic_database)); in apprentice_map()
2703 map->magic[0] = CAST(struct magic *, map->p) + 1; in apprentice_map()
2820 const char *p, *q; local
2825 if ((p = strrchr(fn, '/')) != NULL)
2826 fn = ++p;
2832 for (p = ext + sizeof(ext) - 1; p >= ext && q >= fn; p--, q--)
2833 if (*p != *q)
2837 if (p >= ext)
2858 if (strstr(p, ".mime") != NULL)