Deleted Added
full compact
getrpcent.c (11666) getrpcent.c (16283)
1/*
2 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
3 * unrestricted use provided that this legend is included on all tape
4 * media and as a part of the software program in whole or part. Users
5 * may copy or modify Sun RPC without charge, but are not authorized
6 * to license or distribute it to anyone else except as part of a product or
7 * program developed by the user or with the express written consent of
8 * Sun Microsystems, Inc.

--- 16 unchanged lines hidden (view full) ---

25 *
26 * Sun Microsystems, Inc.
27 * 2550 Garcia Avenue
28 * Mountain View, California 94043
29 */
30
31#if defined(LIBC_SCCS) && !defined(lint)
32/*static char *sccsid = "from: @(#)getrpcent.c 1.14 91/03/11 Copyr 1984 Sun Micro";*/
1/*
2 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
3 * unrestricted use provided that this legend is included on all tape
4 * media and as a part of the software program in whole or part. Users
5 * may copy or modify Sun RPC without charge, but are not authorized
6 * to license or distribute it to anyone else except as part of a product or
7 * program developed by the user or with the express written consent of
8 * Sun Microsystems, Inc.

--- 16 unchanged lines hidden (view full) ---

25 *
26 * Sun Microsystems, Inc.
27 * 2550 Garcia Avenue
28 * Mountain View, California 94043
29 */
30
31#if defined(LIBC_SCCS) && !defined(lint)
32/*static char *sccsid = "from: @(#)getrpcent.c 1.14 91/03/11 Copyr 1984 Sun Micro";*/
33static char *rcsid = "$Id: getrpcent.c,v 1.2 1995/05/30 05:41:21 rgrimes Exp $";
33static char *rcsid = "$Id: getrpcent.c,v 1.3 1995/10/22 14:51:24 phk Exp $";
34#endif
35
36/*
37 * Copyright (c) 1984 by Sun Microsystems, Inc.
38 */
39
40#include <stdio.h>
41#include <stdlib.h>

--- 19 unchanged lines hidden (view full) ---

61 char *domain;
62 char *current;
63 int currentlen;
64#endif
65} *rpcdata;
66
67#ifdef YP
68static int __yp_nomap = 0;
34#endif
35
36/*
37 * Copyright (c) 1984 by Sun Microsystems, Inc.
38 */
39
40#include <stdio.h>
41#include <stdlib.h>

--- 19 unchanged lines hidden (view full) ---

61 char *domain;
62 char *current;
63 int currentlen;
64#endif
65} *rpcdata;
66
67#ifdef YP
68static int __yp_nomap = 0;
69extern int _yp_check(char **);
69#endif /* YP */
70
71static struct rpcent *interpret();
72struct hostent *gethostent();
73char *inet_ntoa();
74
75static char RPCDB[] = "/etc/rpc";
76

--- 41 unchanged lines hidden (view full) ---

118 d->current[d->currentlen] = '\0';
119 p = interpret(d->current, d->currentlen);
120 (void) free(d->current);
121 return p;
122 }
123no_yp:
124#endif /* YP */
125 setrpcent(0);
70#endif /* YP */
71
72static struct rpcent *interpret();
73struct hostent *gethostent();
74char *inet_ntoa();
75
76static char RPCDB[] = "/etc/rpc";
77

--- 41 unchanged lines hidden (view full) ---

119 d->current[d->currentlen] = '\0';
120 p = interpret(d->current, d->currentlen);
121 (void) free(d->current);
122 return p;
123 }
124no_yp:
125#endif /* YP */
126 setrpcent(0);
126 while (p = getrpcent()) {
127 while ((p = getrpcent())) {
127 if (p->r_number == number)
128 break;
129 }
130 endrpcent();
131 return (p);
132}
133
134struct rpcent *
135getrpcbyname(name)
136 char *name;
137{
138 struct rpcent *rpc;
139 char **rp;
140
141 setrpcent(0);
128 if (p->r_number == number)
129 break;
130 }
131 endrpcent();
132 return (p);
133}
134
135struct rpcent *
136getrpcbyname(name)
137 char *name;
138{
139 struct rpcent *rpc;
140 char **rp;
141
142 setrpcent(0);
142 while (rpc = getrpcent()) {
143 while ((rpc = getrpcent())) {
143 if (strcmp(rpc->r_name, name) == 0)
144 return (rpc);
145 for (rp = rpc->r_aliases; *rp != NULL; rp++) {
146 if (strcmp(*rp, name) == 0)
147 return (rpc);
148 }
149 }
150 endrpcent();

--- 149 unchanged lines hidden ---
144 if (strcmp(rpc->r_name, name) == 0)
145 return (rpc);
146 for (rp = rpc->r_aliases; *rp != NULL; rp++) {
147 if (strcmp(*rp, name) == 0)
148 return (rpc);
149 }
150 }
151 endrpcent();

--- 149 unchanged lines hidden ---