Bug 470455 - test_database_sync_embed_visits.js leaks, r=sdwilsh
[wine-gecko.git] / nsprpub / lib / libc / include / plresolv.h
blob8e8926c6c168978cab7b0bc9b5401c17aaa2fa5f
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
13 * License.
15 * The Original Code is the Netscape Portable Runtime (NSPR).
17 * The Initial Developer of the Original Code is
18 * Netscape Communications Corporation.
19 * Portions created by the Initial Developer are Copyright (C) 1998-2000
20 * the Initial Developer. All Rights Reserved.
22 * Contributor(s):
24 * Alternatively, the contents of this file may be used under the terms of
25 * either the GNU General Public License Version 2 or later (the "GPL"), or
26 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27 * in which case the provisions of the GPL or the LGPL are applicable instead
28 * of those above. If you wish to allow use of your version of this file only
29 * under the terms of either the GPL or the LGPL, and not to allow others to
30 * use your version of this file under the terms of the MPL, indicate your
31 * decision by deleting the provisions above and replace them with the notice
32 * and other provisions required by the GPL or the LGPL. If you do not delete
33 * the provisions above, a recipient may use your version of this file under
34 * the terms of any one of the MPL, the GPL or the LGPL.
36 * ***** END LICENSE BLOCK ***** */
39 * plresolv.h - asynchronous name resolution using DNS
42 #ifndef _PLRESOLV_H_
43 #define _PLRESOLV_H_
46 ** THIS IS WORK IN PROGRESS. DO NOT ATTEMPT TO USE ANY PORTION OF THIS
47 ** API UNTIL THIS MESSAGE NO LONGER EXISTS. IF YOU DO, THEN YOU SURRENDER
48 ** THE RIGHT TO COMPLAIN ABOUT ANY CONTENT.
51 #if defined(XP_UNIX)
53 #include <prtypes.h>
54 #include <prnetdb.h>
56 NSPR_BEGIN_EXTERN_C
58 #define PL_RESOLVE_MAXHOSTENTBUF 1024
59 #define PL_RESOLVE_DEFAULT_TIMEOUT 0
61 /* Error return codes */
62 #define PL_RESOLVE_OK 0
63 #define PL_RESOLVE_EWINIT 1 /* Failed to initialize window */
64 #define PL_RESOLVE_EMAKE 2 /* Failed to create request */
65 #define PL_RESOLVE_ELAUNCH 3 /* Error launching Async request */
66 #define PL_RESOLVE_ETIMEDOUT 4 /* Request timed-out */
67 #define PL_RESOLVE_EINVAL 5 /* Invalid argument */
68 #define PL_RESOLVE_EOVERFLOW 6 /* Buffer Overflow */
69 #define PL_RESOLVE_EUNKNOWN 7 /* berserk error */
71 /* ----------- Function Prototypes ----------------*/
73 PR_EXTERN(PRStatus) PL_ResolveName(
74 const char *name, unsigned char *buf,
75 PRIntn bufsize, PRIntervalTime timeout,
76 PRHostEnt *hostentry, PRIntervalTime *ttl);
78 PR_EXTERN(PRStatus) PL_ResolveAddr(
79 const PRNetAddr *address, unsigned char *buf,
80 PRIntn bufsize, PRIntervalTime timeout,
81 PRHostEnt *hostentry, PRIntervalTime *ttl);
83 typedef struct PLResolveStats {
84 int re_errors;
85 int re_nu_look;
86 int re_na_look;
87 int re_replies;
88 int re_requests;
89 int re_resends;
90 int re_sent;
91 int re_timeouts;
92 } PLResolveStats;
94 typedef struct PLResoveInfo {
95 PRBool enabled;
96 PRUint32 numNameLookups;
97 PRUint32 numAddrLookups;
98 PRUint32 numLookupsInProgress;
99 PLResolveStats stats;
100 } PLResoveInfo;
102 PR_EXTERN(void) PL_ResolveInfo(PLResoveInfo *info);
104 NSPR_END_EXTERN_C
106 #endif /* defined(XP_UNIX) */
108 #endif /* _PLRESOLV_H_ */