File: inet_pton.c

package info (click to toggle)
jabberd2 2.7.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 4,016 kB
  • sloc: ansic: 37,099; sh: 1,108; perl: 656; xml: 561; makefile: 511; python: 238; ruby: 145; sql: 55
file content (32 lines) | stat: -rw-r--r-- 612 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif

#if !defined(HAVE_INET_PTON) && defined(_WIN32)
#ifdef JABBERD2_EXPORTS
# define JABBERD2_API  __declspec(dllexport)
#else /* JABBERD2_EXPORTS */
# define JABBERD2_API  __declspec(dllimport)
#endif /* JABBERD2_EXPORTS */

#include "ac-stdint.h"

#include "ip6_misc.h"

#include <errno.h>

#ifndef EAFNOSUPPORT
#define	EAFNOSUPPORT	97	/* not present in errno.h provided with VC */
#endif

JABBERD2_API int
inet_pton(int af, const char *src, void *dst)
{
    if (af != AF_INET) {
	errno = EAFNOSUPPORT;
	return -1;
    }
    return inet_aton (src, dst);
}

#endif