diff options
author | ume <ume@FreeBSD.org> | 2005-04-18 18:34:58 +0000 |
---|---|---|
committer | ume <ume@FreeBSD.org> | 2005-04-18 18:34:58 +0000 |
commit | 6dfe72cfb93de2ed0bca56214d34e7154c93b420 (patch) | |
tree | b89eaecde9b9614d66bffed3ea0d73cbba4ca69b | |
parent | aaaa8a951fc89614d37e2b1cb6ec5d3ce0628d9c (diff) | |
download | FreeBSD-src-6dfe72cfb93de2ed0bca56214d34e7154c93b420.zip FreeBSD-src-6dfe72cfb93de2ed0bca56214d34e7154c93b420.tar.gz |
rename the NIS related fields to have yp_ prefix.
Suggested by: delphij
-rw-r--r-- | lib/libc/net/getservbyname.c | 8 | ||||
-rw-r--r-- | lib/libc/net/getservbyport.c | 8 | ||||
-rw-r--r-- | lib/libc/net/getservent.c | 48 | ||||
-rw-r--r-- | lib/libc/net/netdb_private.h | 12 |
4 files changed, 38 insertions, 38 deletions
diff --git a/lib/libc/net/getservbyname.c b/lib/libc/net/getservbyname.c index bdbfc01..efc3c26 100644 --- a/lib/libc/net/getservbyname.c +++ b/lib/libc/net/getservbyname.c @@ -49,8 +49,8 @@ getservbyname_r(const char *name, const char *proto, struct servent *se, int error; #ifdef YP - sed->getservbyname_yp = (char *)name; - sed->getservbyproto_yp = (char *)proto; + sed->yp_name = (char *)name; + sed->yp_proto = (char *)proto; #endif setservent_r(sed->stayopen, sed); @@ -69,8 +69,8 @@ gotname: endservent_r(sed); #ifdef YP - sed->getservbyname_yp = NULL; - sed->getservbyproto_yp = NULL; + sed->yp_name = NULL; + sed->yp_proto = NULL; #endif return (error); diff --git a/lib/libc/net/getservbyport.c b/lib/libc/net/getservbyport.c index c70af6d..33524a2 100644 --- a/lib/libc/net/getservbyport.c +++ b/lib/libc/net/getservbyport.c @@ -48,8 +48,8 @@ getservbyport_r(int port, const char *proto, struct servent *se, int error; #ifdef YP - sed->getservbyport_yp = port; - sed->getservbyproto_yp = (char *)proto; + sed->yp_port = port; + sed->yp_proto = (char *)proto; #endif setservent_r(sed->stayopen, sed); @@ -63,8 +63,8 @@ getservbyport_r(int port, const char *proto, struct servent *se, endservent_r(sed); #ifdef YP - sed->getservbyport_yp = 0; - sed->getservbyproto_yp = NULL; + sed->yp_port = 0; + sed->yp_proto = NULL; #endif return (error); diff --git a/lib/libc/net/getservent.c b/lib/libc/net/getservent.c index 2224add..b4f603d 100644 --- a/lib/libc/net/getservent.c +++ b/lib/libc/net/getservent.c @@ -67,8 +67,8 @@ servent_data_clear(struct servent_data *sed) sed->fp = NULL; } #ifdef YP - free(sed->key); - sed->key = NULL; + free(sed->yp_key); + sed->yp_key = NULL; #endif } @@ -119,11 +119,11 @@ _getservbyport_yp(struct servent_data *sed) char buf[YPMAXRECORD + 2]; int rv; - snprintf(buf, sizeof(buf), "%d/%s", - ntohs(sed->getservbyport_yp), sed->getservbyproto_yp); + snprintf(buf, sizeof(buf), "%d/%s", ntohs(sed->yp_port), + sed->yp_proto); - sed->getservbyport_yp = 0; - sed->getservbyproto_yp = NULL; + sed->yp_port = 0; + sed->yp_proto = NULL; if (!sed->yp_domain) { if (yp_get_default_domain(&sed->yp_domain)) @@ -168,11 +168,10 @@ _getservbyname_yp(struct servent_data *sed) return (0); } - snprintf(buf, sizeof(buf), "%s/%s", sed->getservbyname_yp, - sed->getservbyproto_yp); + snprintf(buf, sizeof(buf), "%s/%s", sed->yp_name, sed->yp_proto); - sed->getservbyname_yp = 0; - sed->getservbyproto_yp = NULL; + sed->yp_name = 0; + sed->yp_proto = NULL; if (yp_match(sed->yp_domain, "services.byname", buf, strlen(buf), &result, &resultlen)) { @@ -198,22 +197,23 @@ _getservent_yp(struct servent_data *sed) return (0); } - if (!sed->stepping_yp) { - free(sed->key); - rv = yp_first(sed->yp_domain, "services.byname", &sed->key, - &sed->keylen, &result, &resultlen); + if (!sed->yp_stepping) { + free(sed->yp_key); + rv = yp_first(sed->yp_domain, "services.byname", &sed->yp_key, + &sed->yp_keylen, &result, &resultlen); if (rv) { - sed->stepping_yp = 0; + sed->yp_stepping = 0; return(0); } - sed->stepping_yp = 1; + sed->yp_stepping = 1; } else { - lastkey = sed->key; - rv = yp_next(sed->yp_domain, "services.byname", sed->key, - sed->keylen, &sed->key, &sed->keylen, &result, &resultlen); + lastkey = sed->yp_key; + rv = yp_next(sed->yp_domain, "services.byname", sed->yp_key, + sed->yp_keylen, &sed->yp_key, &sed->yp_keylen, &result, + &resultlen); free(lastkey); if (rv) { - sed->stepping_yp = 0; + sed->yp_stepping = 0; return (0); } } @@ -243,7 +243,7 @@ endservent_r(struct servent_data *sed) servent_data_clear(sed); sed->stayopen = 0; #ifdef YP - sed->stepping_yp = 0; + sed->yp_stepping = 0; sed->yp_domain = NULL; #endif } @@ -256,7 +256,7 @@ getservent_r(struct servent *se, struct servent_data *sed) long l; #ifdef YP - if (sed->stepping_yp && _getservent_yp(sed)) { + if (sed->yp_stepping && _getservent_yp(sed)) { p = sed->line; goto unpack; } @@ -269,11 +269,11 @@ again: return (-1); #ifdef YP if (*p == '+' && _yp_check(NULL)) { - if (sed->getservbyname_yp != NULL) { + if (sed->yp_name != NULL) { if (!_getservbyname_yp(sed)) goto tryagain; } - else if (sed->getservbyport_yp != 0) { + else if (sed->yp_port != 0) { if (!_getservbyport_yp(sed)) goto tryagain; } diff --git a/lib/libc/net/netdb_private.h b/lib/libc/net/netdb_private.h index 3ee70fb..a7cd4c9 100644 --- a/lib/libc/net/netdb_private.h +++ b/lib/libc/net/netdb_private.h @@ -38,13 +38,13 @@ struct servent_data { int stayopen; char line[BUFSIZ + 1]; #ifdef YP - int stepping_yp; - char *getservbyname_yp; - char *getservbyproto_yp; - int getservbyport_yp; + int yp_stepping; + char *yp_name; + char *yp_proto; + int yp_port; char *yp_domain; - char *key; - int keylen; + char *yp_key; + int yp_keylen; #endif }; |