Lines Matching refs:p
96 struct product *p; in names_product() local
98 p = products[hashnum((vendorid << 16) | productid)]; in names_product()
99 for (; p; p = p->next) in names_product()
100 if (p->vendorid == vendorid && p->productid == productid) in names_product()
101 return p->name; in names_product()
130 struct protocol *p; in names_protocol() local
132 p = protocols[hashnum((classid << 16) | (subclassid << 8) in names_protocol()
134 for (; p; p = p->next) in names_protocol()
135 if (p->classid == classid && p->subclassid == subclassid && in names_protocol()
136 p->protocolid == protocolid) in names_protocol()
137 return p->name; in names_protocol()
151 struct pool *p; in my_malloc() local
153 p = calloc(1, sizeof(struct pool)); in my_malloc()
154 if (!p) in my_malloc()
157 p->mem = calloc(1, size); in my_malloc()
158 if (!p->mem) { in my_malloc()
159 free(p); in my_malloc()
163 p->next = pool_head; in my_malloc()
164 pool_head = p; in my_malloc()
166 return p->mem; in my_malloc()
210 struct product *p; in new_product() local
213 p = products[h]; in new_product()
214 for (; p; p = p->next) in new_product()
215 if (p->vendorid == vendorid && p->productid == productid) in new_product()
217 p = my_malloc(sizeof(struct product) + strlen(name)); in new_product()
218 if (!p) in new_product()
220 strcpy(p->name, name); in new_product()
221 p->vendorid = vendorid; in new_product()
222 p->productid = productid; in new_product()
223 p->next = products[h]; in new_product()
224 products[h] = p; in new_product()
270 struct protocol *p; in new_protocol() local
274 p = protocols[h]; in new_protocol()
275 for (; p; p = p->next) in new_protocol()
276 if (p->classid == classid && p->subclassid == subclassid in new_protocol()
277 && p->protocolid == protocolid) in new_protocol()
279 p = my_malloc(sizeof(struct protocol) + strlen(name)); in new_protocol()
280 if (!p) in new_protocol()
282 strcpy(p->name, name); in new_protocol()
283 p->classid = classid; in new_protocol()
284 p->subclassid = subclassid; in new_protocol()
285 p->protocolid = protocolid; in new_protocol()
286 p->next = protocols[h]; in new_protocol()
287 protocols[h] = p; in new_protocol()