diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2007-10-05 23:54:12 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 15:07:51 -0500 |
commit | e511090a4339221dfd1fa597964af7455f96ec28 (patch) | |
tree | 642564ee8fc2222bea72eecf632cac09afd34be0 /source4/lib/replace/replace.h | |
parent | f0bc19ae47d7f06d111713b0dbb00f387621e675 (diff) | |
download | samba-e511090a4339221dfd1fa597964af7455f96ec28.tar.gz samba-e511090a4339221dfd1fa597964af7455f96ec28.tar.bz2 samba-e511090a4339221dfd1fa597964af7455f96ec28.zip |
r25543: Merge libreplace support for inet_pton, inet_ntop, getaddrinfo, getnameinfo
(and friends) from SAMBA_3_2, with some minor tweaks:
- avoid including network headers in replace.h unless absolutely required
- autoconf tests for getaddrinfo() in lib/replace
The heimdal-specific code also no longer looks for these functions anymore.
(This used to be commit b6d3fd84a5d7d814035e60d6fa22f19bed9f77da)
Diffstat (limited to 'source4/lib/replace/replace.h')
-rw-r--r-- | source4/lib/replace/replace.h | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/source4/lib/replace/replace.h b/source4/lib/replace/replace.h index af05516e8c..26e39ac603 100644 --- a/source4/lib/replace/replace.h +++ b/source4/lib/replace/replace.h @@ -1,15 +1,16 @@ -/* +/* Unix SMB/CIFS implementation. macros to go along with the lib/replace/ portability layer code Copyright (C) Andrew Tridgell 2005 Copyright (C) Jelmer Vernooij 2006 + Copyright (C) Jeremy Allison 2007. ** NOTE! The following LGPL license applies to the replace ** library. This does NOT imply that all of Samba is released ** under the LGPL - + This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either @@ -71,7 +72,6 @@ #include <stddef.h> #endif - #ifndef HAVE_STRERROR extern char *sys_errlist[]; #define strerror(i) sys_errlist[i] @@ -139,7 +139,7 @@ int setenv(const char *name, const char *value, int overwrite); #ifndef HAVE_UNSETENV #define unsetenv rep_unsetenv -int rep_unsetenv(const char *name); +int rep_unsetenv(const char *name); #endif #ifndef HAVE_SETEUID @@ -163,7 +163,7 @@ char *rep_strcasestr(const char *haystack, const char *needle); #endif #ifndef HAVE_STRTOK_R -#define strtok_r rep_strtok_r +#define strtok_r rep_strtok_r char *rep_strtok_r(char *s, const char *delim, char **save_ptr); #endif @@ -330,6 +330,17 @@ ssize_t rep_pread(int __fd, void *__buf, size_t __nbytes, off_t __offset); ssize_t rep_pwrite(int __fd, const void *__buf, size_t __nbytes, off_t __offset); #endif +#ifndef HAVE_INET_PTON +int rep_inet_pton(int af, const char *src, void *dst); +#define inet_pton rep_inet_pton +#endif + +#ifndef HAVE_INET_NTOP +#include "system/network.h" +const char *rep_inet_ntop(int af, const void *src, char *dst, socklen_t size); +#define inet_ntop rep_inet_ntop +#endif + #ifdef HAVE_LIMITS_H #include <limits.h> #endif |