Lines Matching defs:pe

116 free_protoent(struct protoent *pe)
120 assert(pe != NULL);
122 free(pe->p_name);
124 for (cp = pe->p_aliases; *cp; ++cp)
126 free(pe->p_aliases);
170 sdump_protoent(struct protoent *pe, char *buffer, size_t buflen)
176 pe->p_name, pe->p_proto);
182 if (pe->p_aliases != NULL) {
183 if (*(pe->p_aliases) != '\0') {
184 for (cp = pe->p_aliases; *cp; ++cp) {
201 protoent_read_snapshot_func(struct protoent *pe, char *line)
213 memset(pe, 0, sizeof(struct protoent));
217 pe->p_name = strdup(s);
218 assert(pe->p_name != NULL);
222 pe->p_proto = (int)strtol(s, &ts, 10);
224 free(pe->p_name);
253 free(pe->p_name);
254 memset(pe, 0, sizeof(struct protoent));
259 pe->p_aliases = sl->sl_str;
280 struct protoent *pe;
283 while ((pe = getprotoent()) != NULL) {
284 if (protoent_test_correctness(pe, NULL) == 0)
285 TEST_DATA_APPEND(protoent, td, pe);
295 protoent_test_correctness(struct protoent *pe, void *mdata)
299 dump_protoent(pe);
302 if (pe == NULL)
305 if (pe->p_name == NULL)
308 if (pe->p_proto < 0)
311 if (pe->p_aliases == NULL)
329 * to make sure that pe really exists and correct */
331 protoent_check_ambiguity(struct protoent_test_data *td, struct protoent *pe)
334 return (TEST_DATA_FIND(protoent, td, pe, compare_protoent,
342 struct protoent *pe;
349 pe = getprotobyname(pe_model->p_name);
350 if (protoent_test_correctness(pe, NULL) != 0)
353 if ((compare_protoent(pe, pe_model, NULL) != 0) &&
354 (protoent_check_ambiguity((struct protoent_test_data *)mdata, pe)
359 pe = getprotobyname(*alias);
361 if (protoent_test_correctness(pe, NULL) != 0)
364 if ((compare_protoent(pe, pe_model, NULL) != 0) &&
366 (struct protoent_test_data *)mdata, pe) != 0))
384 struct protoent *pe;
391 pe = getprotobynumber(pe_model->p_proto);
392 if ((protoent_test_correctness(pe, NULL) != 0) ||
393 ((compare_protoent(pe, pe_model, NULL) != 0) &&
394 (protoent_check_ambiguity((struct protoent_test_data *)mdata, pe)
407 protoent_test_getprotoent(struct protoent *pe, void *mdata)
411 return (protoent_test_correctness(pe, NULL));