Annotation of 42BSD/lib/libc/net/getnetbyname.c, revision 1.1.1.1

1.1       root        1: /*     getnetbyname.c  4.2     82/10/05        */
                      2: 
                      3: #include <netdb.h>
                      4: 
                      5: struct netent *
                      6: getnetbyname(name)
                      7:        register char *name;
                      8: {
                      9:        register struct netent *p;
                     10:        register char **cp;
                     11: 
                     12:        setnetent(0);
                     13:        while (p = getnetent()) {
                     14:                if (strcmp(p->n_name, name) == 0)
                     15:                        break;
                     16:                for (cp = p->n_aliases; *cp != 0; cp++)
                     17:                        if (strcmp(*cp, name) == 0)
                     18:                                goto found;
                     19:        }
                     20: found:
                     21:        endnetent();
                     22:        return (p);
                     23: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.