Lines Matching refs:p
114 struct product *p; in names_product() local
116 p = products[hashnum((vendorid << 16) | productid)]; in names_product()
117 for (; p; p = p->next) in names_product()
118 if (p->vendorid == vendorid && p->productid == productid) in names_product()
119 return p->name; in names_product()
148 struct protocol *p; in names_protocol() local
150 p = protocols[hashnum((classid << 16) | (subclassid << 8) in names_protocol()
152 for (; p; p = p->next) in names_protocol()
153 if (p->classid == classid && p->subclassid == subclassid && in names_protocol()
154 p->protocolid == protocolid) in names_protocol()
155 return p->name; in names_protocol()
169 struct pool *p; in my_malloc() local
171 p = calloc(1, sizeof(struct pool)); in my_malloc()
172 if (!p) in my_malloc()
175 p->mem = calloc(1, size); in my_malloc()
176 if (!p->mem) { in my_malloc()
177 free(p); in my_malloc()
181 p->next = pool_head; in my_malloc()
182 pool_head = p; in my_malloc()
184 return p->mem; in my_malloc()
228 struct product *p; in new_product() local
231 p = products[h]; in new_product()
232 for (; p; p = p->next) in new_product()
233 if (p->vendorid == vendorid && p->productid == productid) in new_product()
235 p = my_malloc(sizeof(struct product) + strlen(name)); in new_product()
236 if (!p) in new_product()
238 strcpy(p->name, name); in new_product()
239 p->vendorid = vendorid; in new_product()
240 p->productid = productid; in new_product()
241 p->next = products[h]; in new_product()
242 products[h] = p; in new_product()
288 struct protocol *p; in new_protocol() local
292 p = protocols[h]; in new_protocol()
293 for (; p; p = p->next) in new_protocol()
294 if (p->classid == classid && p->subclassid == subclassid in new_protocol()
295 && p->protocolid == protocolid) in new_protocol()
297 p = my_malloc(sizeof(struct protocol) + strlen(name)); in new_protocol()
298 if (!p) in new_protocol()
300 strcpy(p->name, name); in new_protocol()
301 p->classid = classid; in new_protocol()
302 p->subclassid = subclassid; in new_protocol()
303 p->protocolid = protocolid; in new_protocol()
304 p->next = protocols[h]; in new_protocol()
305 protocols[h] = p; in new_protocol()