4 /* do we really need all these?? */
7 static const unsigned char protos[] = {
46 void endprotoent(void)
51 void setprotoent(int stayopen)
56 struct protoent *getprotoent(void)
58 static struct protoent p;
59 static const char *aliases;
60 if (idx >= sizeof protos) return NULL;
61 p.p_proto = protos[idx];
62 p.p_name = (char *)&protos[idx+1];
63 p.p_aliases = (char **)&aliases;
64 idx += strlen(p.p_name) + 2;
68 struct protoent *getprotobyname(const char *name)
73 while (p && strcmp(name, p->p_name));
77 struct protoent *getprotobynumber(int num)
82 while (p && p->p_proto != num);