Commit | Line | Data |
---|---|---|
5f522de8 C |
1 | /* servbyname.c - getisoserventbyname */ |
2 | ||
3 | #ifndef lint | |
4 | static char *rcsid = "$Header: /f/osi/compat/RCS/servbyname.c,v 7.1 91/02/22 09:15:48 mrose Interim $"; | |
5 | #endif | |
6 | ||
7 | /* | |
8 | * $Header: /f/osi/compat/RCS/servbyname.c,v 7.1 91/02/22 09:15:48 mrose Interim $ | |
9 | * | |
10 | * | |
11 | * $Log: servbyname.c,v $ | |
12 | * Revision 7.1 91/02/22 09:15:48 mrose | |
13 | * Interim 6.8 | |
14 | * | |
15 | * Revision 7.0 89/11/23 21:23:26 mrose | |
16 | * Release 6.0 | |
17 | * | |
18 | */ | |
19 | ||
20 | /* | |
21 | * NOTICE | |
22 | * | |
23 | * Acquisition, use, and distribution of this module and related | |
24 | * materials are subject to the restrictions of a license agreement. | |
25 | * Consult the Preface in the User's Manual for the full terms of | |
26 | * this agreement. | |
27 | * | |
28 | */ | |
29 | ||
30 | ||
31 | /* LINTLIBRARY */ | |
32 | ||
33 | #include <stdio.h> | |
34 | #include "general.h" | |
35 | #include "manifest.h" | |
36 | #include "isoservent.h" | |
37 | #include "tailor.h" | |
38 | ||
39 | /* \f */ | |
40 | ||
41 | struct isoservent *getisoserventbyname (entity, provider) | |
42 | char *entity, | |
43 | *provider; | |
44 | { | |
45 | register struct isoservent *is; | |
46 | ||
47 | isodetailor (NULLCP, 0); | |
48 | DLOG (addr_log, LLOG_TRACE, | |
49 | ("getisoserventbyname \"%s\" \"%s\"", entity, provider)); | |
50 | ||
51 | (void) setisoservent (0); | |
52 | while (is = getisoservent ()) | |
53 | if (strcmp (entity, is -> is_entity) == 0 | |
54 | && strcmp (provider, is -> is_provider) == 0) | |
55 | break; | |
56 | (void) endisoservent (); | |
57 | ||
58 | if (is) { | |
59 | #ifdef DEBUG | |
60 | if (addr_log -> ll_events & LLOG_DEBUG) | |
61 | _printsrv (is); | |
62 | #endif | |
63 | } | |
64 | else | |
65 | SLOG (addr_log, LLOG_EXCEPTIONS, NULLCP, | |
66 | ("lookup of local service %s/%s failed", provider, entity)); | |
67 | ||
68 | return is; | |
69 | } |