Debian Codegraph @

man/hesiod_getmailhost.3

raw
1 .\" $Id: hesiod_getmailhost.3,v 1.1 1996-12-08 21:38:11 ghudson Exp $
2 .\"
3 .\" Copyright 1996 by the Massachusetts Institute of Technology.
4 .\"
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
7 .\" are met:
8 .\"
9 .\" * Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
11 .\"
12 .\" * Redistributions in binary form must reproduce the above copyright
13 .\" notice, this list of conditions and the following disclaimer in
14 .\" the documentation and/or other materials provided with the
15 .\" distribution.
16 .\"
17 .\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18 .\" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19 .\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
20 .\" FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
21 .\" COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
22 .\" INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23 .\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24 .\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
26 .\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
28 .\" OF THE POSSIBILITY OF SUCH DAMAGE.
29 .\"
30 .TH HESIOD 3 "30 November 1996"
31 .SH NAME
32 hesiod_getmailhost, hesiod_free_postoffice \- Hesiod functions for retrieving user to postoffice mappings
33 .SH SYNOPSIS
34 .nf
35 .B #include <hesiod.h>
36 .PP
37 .B struct hesiod_postoffice *hesiod_getmailhost(void *\fIcontext\fP,
38 .B const char *\fIuser\fP)
39 .B void hesiod_free_postoffice(void *\fIcontext\fP,
40 .B struct hesiod_postoffice *\fIpo\fP)
41 .PP
42 .B cc file.c -lhesiod
43 .fi
44 .SH DESCRIPTION
45 This family of functions allows you to retrieve user to postoffice
46 mappings using Hesiod. To perform lookups, you need an initialized
47 Hesiod context; see hesiod(3) for details. Information is returned in
48 a
49 .I hesiod_postoffice
50 structure, which has the following fields:
51 .IP hesiod_po_type
52 The type of postoffice box, typically ``POP''.
53 .IP hesiod_po_host
54 The hostname where the postoffice box resides.
55 .IP hesiod_po_name
56 The account name on the given postoffice server.
57 .PP
58 It is the caller's responsibility to call
59 .I hesiod_free_postoffice
60 with the returned postoffice entry to free the resources used by the
61 postoffice entry.
62 .PP
63 Hesiod queries for postoffice information are made using the ``pobox''
64 Hesiod type, using the username as the Hesiod name. The corresponding
65 entries should be space-separated lists of strings giving the type of
66 postoffice box, the hostname, and the account name.
67 .SH RETURN VALUES
68 On failure,
69 .I hesiod_getservbyname
70 returns NULL and sets the global variable
71 .I errno
72 to indicate the error.
73 .SH ERRORS
74 .I hesiod_getmailhost
75 may fail for any of the reasons the routine
76 .I hesiod_resolve
77 may fail.
78 .SH SEE ALSO
79 hesiod(3)