Merge from vendor branch SENDMAIL:
[dragonfly.git] / contrib / bind-9.2.4rc7 / lib / dns / include / dns / callbacks.h
1 /*
2  * Copyright (C) 2004  Internet Systems Consortium, Inc. ("ISC")
3  * Copyright (C) 1999-2002  Internet Software Consortium.
4  *
5  * Permission to use, copy, modify, and distribute this software for any
6  * purpose with or without fee is hereby granted, provided that the above
7  * copyright notice and this permission notice appear in all copies.
8  *
9  * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
10  * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
11  * AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
12  * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
13  * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
14  * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
15  * PERFORMANCE OF THIS SOFTWARE.
16  */
17
18 /* $Id: callbacks.h,v 1.15.2.3 2004/03/09 06:11:14 marka Exp $ */
19
20 #ifndef DNS_CALLBACKS_H
21 #define DNS_CALLBACKS_H 1
22
23 /***
24  ***    Imports
25  ***/
26
27 #include <isc/lang.h>
28
29 #include <dns/types.h>
30
31 ISC_LANG_BEGINDECLS
32
33 /***
34  ***    Types
35  ***/
36
37 struct dns_rdatacallbacks {
38         /*
39          * dns_load_master calls this when it has rdatasets to commit.
40          */
41         dns_addrdatasetfunc_t add;
42         /*
43          * dns_load_master / dns_rdata_fromtext call this to issue a error.
44          */
45         void    (*error)(struct dns_rdatacallbacks *, const char *, ...);
46         /*
47          * dns_load_master / dns_rdata_fromtext call this to issue a warning.
48          */
49         void    (*warn)(struct dns_rdatacallbacks *, const char *, ...);
50         /*
51          * Private data handles for use by the above callback functions.
52          */
53         void    *add_private;
54         void    *error_private;
55         void    *warn_private;
56 };
57
58 /***
59  ***    Initialization
60  ***/
61
62 void
63 dns_rdatacallbacks_init(dns_rdatacallbacks_t *callbacks);
64 /*
65  * Initialize 'callbacks'.
66  *      'error' and 'warn' are set to default callbacks that print the
67  *      error message through the DNS library log context.
68  *
69  *      All other elements are initialized to NULL.
70  *
71  * Requires:
72  *      'callbacks' is a valid dns_rdatacallbacks_t,
73  */
74
75 void
76 dns_rdatacallbacks_init_stdio(dns_rdatacallbacks_t *callbacks);
77 /*
78  * Like dns_rdatacallbacks_init, but logs to stdio.
79  */
80
81 ISC_LANG_ENDDECLS
82
83 #endif /* DNS_CALLBACKS_H */