4 /* do we really need all these?? */
7 static const unsigned char protos[] = {
31 void endprotoent(void)
36 void setprotoent(int stayopen)
41 struct protoent *getprotoent(void)
43 static struct protoent p;
44 static const char *aliases;
45 if (idx >= sizeof protos) return NULL;
46 p.p_proto = protos[idx];
47 p.p_name = (char *)&protos[idx+1];
48 p.p_aliases = (char **)&aliases;
49 idx += strlen(p.p_name) + 2;
53 struct protoent *getprotobyname(const char *name)
58 while (p && strcmp(name, p->p_name));
62 struct protoent *getprotobynumber(int num)
67 while (p && p->p_proto != num);