Lines Matching refs:pvt

102 struct pvt {  struct
153 struct pvt *pvt; in irs_lcl_ho() local
157 if (!(pvt = memget(sizeof *pvt))) { in irs_lcl_ho()
161 memset(pvt, 0, sizeof *pvt); in irs_lcl_ho()
163 memput(pvt, sizeof *pvt); in irs_lcl_ho()
168 ho->private = pvt; in irs_lcl_ho()
186 struct pvt *pvt = (struct pvt *)this->private; in ho_close() local
189 if (pvt->fp) in ho_close()
190 (void) fclose(pvt->fp); in ho_close()
191 if (pvt->res && pvt->free_res) in ho_close()
192 (*pvt->free_res)(pvt->res); in ho_close()
193 memput(pvt, sizeof *pvt); in ho_close()
199 struct pvt *pvt = (struct pvt *)this->private; in ho_byname() local
205 if (pvt->res->options & RES_USE_INET6) { in ho_byname()
215 struct pvt *pvt = (struct pvt *)this->private; in ho_byname2() local
241 RES_SET_H_ERRNO(pvt->res, HOST_NOT_FOUND); in ho_byname2()
244 RES_SET_H_ERRNO(pvt->res, NETDB_SUCCESS); in ho_byname2()
250 struct pvt *pvt = (struct pvt *)this->private; in ho_byaddr() local
276 RES_SET_H_ERRNO(pvt->res, NETDB_INTERNAL); in ho_byaddr()
281 RES_SET_H_ERRNO(pvt->res, NETDB_INTERNAL); in ho_byaddr()
312 RES_SET_H_ERRNO(pvt->res, HOST_NOT_FOUND); in ho_byaddr()
315 RES_SET_H_ERRNO(pvt->res, NETDB_SUCCESS); in ho_byaddr()
321 struct pvt *pvt = (struct pvt *)this->private; in ho_next() local
329 if (!pvt->fp) in ho_next()
331 if (!pvt->fp) { in ho_next()
332 RES_SET_H_ERRNO(pvt->res, NETDB_INTERNAL); in ho_next()
335 bufp = pvt->hostbuf; in ho_next()
336 bufsiz = sizeof pvt->hostbuf; in ho_next()
339 if (!(p = fgets(bufp + offset, bufsiz - offset, pvt->fp))) { in ho_next()
340 RES_SET_H_ERRNO(pvt->res, HOST_NOT_FOUND); in ho_next()
345 if (!strchr(p, '\n') && !feof(pvt->fp)) { in ho_next()
360 while ((c = getc(pvt->fp)) != EOF) in ho_next()
364 ungetc(c, pvt->fp); in ho_next()
379 if (inet_pton(AF_INET6, p, pvt->host_addr) > 0) { in ho_next()
382 } else if (inet_aton(p, (struct in_addr *)pvt->host_addr) > 0) { in ho_next()
383 if (pvt->res->options & RES_USE_INET6) { in ho_next()
384 map_v4v6_address((char*)pvt->host_addr, in ho_next()
385 (char*)pvt->host_addr); in ho_next()
395 pvt->h_addr_ptrs[0] = (char *)pvt->host_addr; in ho_next()
396 pvt->h_addr_ptrs[1] = NULL; in ho_next()
397 pvt->host.h_addr_list = pvt->h_addr_ptrs; in ho_next()
398 pvt->host.h_length = len; in ho_next()
399 pvt->host.h_addrtype = af; in ho_next()
402 pvt->host.h_name = cp; in ho_next()
403 q = pvt->host.h_aliases = pvt->host_aliases; in ho_next()
411 if (q < &pvt->host_aliases[MAXALIASES - 1]) in ho_next()
419 RES_SET_H_ERRNO(pvt->res, NETDB_SUCCESS); in ho_next()
420 return (&pvt->host); in ho_next()
425 struct pvt *pvt = (struct pvt *)this->private; in ho_rewind() local
427 if (pvt->fp) { in ho_rewind()
428 if (fseek(pvt->fp, 0L, SEEK_SET) == 0) in ho_rewind()
430 (void)fclose(pvt->fp); in ho_rewind()
432 if (!(pvt->fp = fopen(_PATH_HOSTS, "r"))) in ho_rewind()
434 if (fcntl(fileno(pvt->fp), F_SETFD, 1) < 0) { in ho_rewind()
435 (void)fclose(pvt->fp); in ho_rewind()
436 pvt->fp = NULL; in ho_rewind()
442 struct pvt *pvt = (struct pvt *)this->private; in ho_minimize() local
444 if (pvt->fp != NULL) { in ho_minimize()
445 (void)fclose(pvt->fp); in ho_minimize()
446 pvt->fp = NULL; in ho_minimize()
448 if (pvt->res) in ho_minimize()
449 res_nclose(pvt->res); in ho_minimize()
454 struct pvt *pvt = (struct pvt *)this->private; in ho_res_get() local
456 if (!pvt->res) { in ho_res_get()
467 return (pvt->res); in ho_res_get()
473 struct pvt *pvt = (struct pvt *)this->private; in ho_res_set() local
475 if (pvt->res && pvt->free_res) { in ho_res_set()
476 res_nclose(pvt->res); in ho_res_set()
477 (*pvt->free_res)(pvt->res); in ho_res_set()
480 pvt->res = res; in ho_res_set()
481 pvt->free_res = free_res; in ho_res_set()
496 struct pvt *pvt = (struct pvt *)this->private; in ho_addrinfo() local
519 RES_SET_H_ERRNO(pvt->res, NO_RECOVERY); /*%< ??? */ in ho_addrinfo()
533 RES_SET_H_ERRNO(pvt->res, NO_RECOVERY); in ho_addrinfo()
546 RES_SET_H_ERRNO(pvt->res, HOST_NOT_FOUND); in ho_addrinfo()
564 struct pvt *pvt = (struct pvt *)this->private; in init() local
566 if (!pvt->res && !ho_res_get(this)) in init()
568 if (((pvt->res->options & RES_INIT) == 0U) && in init()
569 res_ninit(pvt->res) == -1) in init()