aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2008-07-16 19:16:41 +0000
committerYang Tse <yangsita@gmail.com>2008-07-16 19:16:41 +0000
commita9dc900515a28dcf55b2901a8609072430087693 (patch)
tree2f8501d314b4c297ccdf997a6ad15716cba7ce1f /lib
parent3a705696af63b57278ad0f54890cfa6770ec66eb (diff)
Configure process now checks availability of recvfrom() socket function and
finds out its return type and the types of its arguments. Added definitions for non-configure systems config files, and introduced macro sreadfrom which will be used on udp sockets as a recvfrom() wrapper.
Diffstat (limited to 'lib')
-rw-r--r--lib/Makefile.netware15
-rw-r--r--lib/config-amigaos.h11
-rw-r--r--lib/config-mac.h9
-rw-r--r--lib/config-os400.h24
-rw-r--r--lib/config-riscos.h24
-rw-r--r--lib/config-symbian.h11
-rw-r--r--lib/config-tpf.h24
-rw-r--r--lib/config-win32.h24
-rw-r--r--lib/config-win32ce.h24
-rw-r--r--lib/config.dos12
-rw-r--r--lib/setup_once.h33
11 files changed, 207 insertions, 4 deletions
diff --git a/lib/Makefile.netware b/lib/Makefile.netware
index 16f294a85..9d71b6d8e 100644
--- a/lib/Makefile.netware
+++ b/lib/Makefile.netware
@@ -382,6 +382,13 @@ ifeq ($(LIBARCH),CLIB)
@echo $(DL)#define RECV_TYPE_ARG3 int$(DL) >> $@
@echo $(DL)#define RECV_TYPE_ARG4 int$(DL) >> $@
@echo $(DL)#define RECV_TYPE_RETV int$(DL) >> $@
+ @echo $(DL)#define RECVFROM_TYPE_ARG1 int$(DL) >> $@
+ @echo $(DL)#define RECVFROM_TYPE_ARG2 char *$(DL) >> $@
+ @echo $(DL)#define RECVFROM_TYPE_ARG3 int$(DL) >> $@
+ @echo $(DL)#define RECVFROM_TYPE_ARG4 int$(DL) >> $@
+ @echo $(DL)#define RECVFROM_TYPE_ARG5 struct sockaddr *$(DL) >> $@
+ @echo $(DL)#define RECVFROM_TYPE_ARG6 int *$(DL) >> $@
+ @echo $(DL)#define RECVFROM_TYPE_RETV int$(DL) >> $@
@echo $(DL)#define SEND_QUAL_ARG2$(DL) >> $@
@echo $(DL)#define SEND_TYPE_ARG1 int$(DL) >> $@
@echo $(DL)#define SEND_TYPE_ARG2 char *$(DL) >> $@
@@ -414,6 +421,13 @@ else
@echo $(DL)#define RECV_TYPE_ARG3 size_t$(DL) >> $@
@echo $(DL)#define RECV_TYPE_ARG4 int$(DL) >> $@
@echo $(DL)#define RECV_TYPE_RETV ssize_t$(DL) >> $@
+ @echo $(DL)#define RECVFROM_TYPE_ARG1 int$(DL) >> $@
+ @echo $(DL)#define RECVFROM_TYPE_ARG2 void *$(DL) >> $@
+ @echo $(DL)#define RECVFROM_TYPE_ARG3 size_t$(DL) >> $@
+ @echo $(DL)#define RECVFROM_TYPE_ARG4 int$(DL) >> $@
+ @echo $(DL)#define RECVFROM_TYPE_ARG5 struct sockaddr *$(DL) >> $@
+ @echo $(DL)#define RECVFROM_TYPE_ARG6 int *$(DL) >> $@
+ @echo $(DL)#define RECVFROM_TYPE_RETV ssize_t$(DL) >> $@
@echo $(DL)#define SEND_QUAL_ARG2$(DL) >> $@
@echo $(DL)#define SEND_TYPE_ARG1 int$(DL) >> $@
@echo $(DL)#define SEND_TYPE_ARG2 void *$(DL) >> $@
@@ -441,6 +455,7 @@ endif
@echo $(DL)#define HAVE_MALLOC_H 1$(DL) >> $@
@echo $(DL)#define HAVE_NETINET_IN_H 1$(DL) >> $@
@echo $(DL)#define HAVE_RECV 1$(DL) >> $@
+ @echo $(DL)#define HAVE_RECVFROM 1$(DL) >> $@
@echo $(DL)#define HAVE_SELECT 1$(DL) >> $@
@echo $(DL)#define HAVE_SEND 1$(DL) >> $@
@echo $(DL)#define HAVE_SETJMP_H 1$(DL) >> $@
diff --git a/lib/config-amigaos.h b/lib/config-amigaos.h
index 1859b2f6b..553a910aa 100644
--- a/lib/config-amigaos.h
+++ b/lib/config-amigaos.h
@@ -7,7 +7,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2007, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -131,6 +131,15 @@
#define RECV_TYPE_ARG4 long
#define RECV_TYPE_RETV long
+#define HAVE_RECVFROM 1
+#define RECVFROM_TYPE_ARG1 long
+#define RECVFROM_TYPE_ARG2 char *
+#define RECVFROM_TYPE_ARG3 long
+#define RECVFROM_TYPE_ARG4 long
+#define RECVFROM_TYPE_ARG5 struct sockaddr *
+#define RECVFROM_TYPE_ARG6 long *
+#define RECVFROM_TYPE_RETV long
+
#define HAVE_SEND 1
#define SEND_TYPE_ARG1 int
#define SEND_QUAL_ARG2 const
diff --git a/lib/config-mac.h b/lib/config-mac.h
index 0af258620..9769f9dfe 100644
--- a/lib/config-mac.h
+++ b/lib/config-mac.h
@@ -63,6 +63,15 @@
#define RECV_TYPE_ARG4 int
#define RECV_TYPE_RETV ssize_t
+#define HAVE_RECVFROM 1
+#define RECVFROM_TYPE_ARG1 int
+#define RECVFROM_TYPE_ARG2 void *
+#define RECVFROM_TYPE_ARG3 size_t
+#define RECVFROM_TYPE_ARG4 int
+#define RECVFROM_TYPE_ARG5 struct sockaddr *
+#define RECVFROM_TYPE_ARG6 int *
+#define RECVFROM_TYPE_RETV ssize_t
+
#define HAVE_SEND 1
#define SEND_TYPE_ARG1 int
#define SEND_QUAL_ARG2 const
diff --git a/lib/config-os400.h b/lib/config-os400.h
index edc01e679..20785665c 100644
--- a/lib/config-os400.h
+++ b/lib/config-os400.h
@@ -456,6 +456,30 @@
/* Define to the function return type for recv. */
#define RECV_TYPE_RETV int
+/* Define if you have the recvfrom function. */
+#define HAVE_RECVFROM
+
+/* Define to the type of arg 1 for recvfrom. */
+#define RECVFROM_TYPE_ARG1 int
+
+/* Define to the type of arg 2 for recvfrom. */
+#define RECVFROM_TYPE_ARG2 char *
+
+/* Define to the type of arg 3 for recvfrom. */
+#define RECVFROM_TYPE_ARG3 int
+
+/* Define to the type of arg 4 for recvfrom. */
+#define RECVFROM_TYPE_ARG4 int
+
+/* Define to the type of arg 5 for recvfrom. */
+#define RECVFROM_TYPE_ARG5 struct sockaddr *
+
+/* Define to the type of arg 6 for recvfrom. */
+#define RECVFROM_TYPE_ARG6 int *
+
+/* Define to the function return type for recvfrom. */
+#define RECVFROM_TYPE_RETV int
+
/* Define if you have the send function. */
#define HAVE_SEND
diff --git a/lib/config-riscos.h b/lib/config-riscos.h
index e1160e625..722e8734f 100644
--- a/lib/config-riscos.h
+++ b/lib/config-riscos.h
@@ -430,6 +430,30 @@
/* Define to the function return type for recv. */
#define RECV_TYPE_RETV ssize_t
+/* Define 1 if you have the recvfrom function. */
+#define HAVE_RECVFROM 1
+
+/* Define to the type of arg 1 for recvfrom. */
+#define RECVFROM_TYPE_ARG1 int
+
+/* Define to the type of arg 2 for recvfrom. */
+#define RECVFROM_TYPE_ARG2 void *
+
+/* Define to the type of arg 3 for recvfrom. */
+#define RECVFROM_TYPE_ARG3 size_t
+
+/* Define to the type of arg 4 for recvfrom. */
+#define RECVFROM_TYPE_ARG4 int
+
+/* Define to the type of arg 5 for recvfrom. */
+#define RECVFROM_TYPE_ARG5 struct sockaddr *
+
+/* Define to the type of arg 6 for recvfrom. */
+#define RECVFROM_TYPE_ARG6 int *
+
+/* Define to the function return type for recvfrom. */
+#define RECVFROM_TYPE_RETV ssize_t
+
/* Define if you have the send function. */
#define HAVE_SEND 1
diff --git a/lib/config-symbian.h b/lib/config-symbian.h
index e656ade91..2297b9f73 100644
--- a/lib/config-symbian.h
+++ b/lib/config-symbian.h
@@ -415,6 +415,9 @@
/* Define to 1 if you have the recv function. */
#define HAVE_RECV 1
+/* Define to 1 if you have the recvfrom function. */
+#define HAVE_RECVFROM 1
+
/* Define to 1 if you have the <rsa.h> header file. */
/* #undef HAVE_RSA_H */
@@ -680,6 +683,14 @@
#define RECV_TYPE_ARG4 int
#define RECV_TYPE_RETV ssize_t
+#define RECVFROM_TYPE_ARG1 int
+#define RECVFROM_TYPE_ARG2 void*
+#define RECVFROM_TYPE_ARG3 size_t
+#define RECVFROM_TYPE_ARG4 int
+#define RECVFROM_TYPE_ARG5 struct sockaddr *
+#define RECVFROM_TYPE_ARG6 size_t *
+#define RECVFROM_TYPE_RETV ssize_t
+
#define SEND_TYPE_ARG1 int
#define SEND_QUAL_ARG2 const
#define SEND_TYPE_ARG2 void*
diff --git a/lib/config-tpf.h b/lib/config-tpf.h
index ee86bab41..1d114b9ce 100644
--- a/lib/config-tpf.h
+++ b/lib/config-tpf.h
@@ -702,6 +702,30 @@
/* Define to the function return type for recv. */
#define RECV_TYPE_RETV int
+/* Define to 1 if you have the recvfrom function. */
+#define HAVE_RECVFROM 1
+
+/* Define to the type of arg 1 for recvfrom. */
+#define RECVFROM_TYPE_ARG1 int
+
+/* Define to the type of arg 2 for recvfrom. */
+#define RECVFROM_TYPE_ARG2 char *
+
+/* Define to the type of arg 3 for recvfrom. */
+#define RECVFROM_TYPE_ARG3 int
+
+/* Define to the type of arg 4 for recvfrom. */
+#define RECVFROM_TYPE_ARG4 int
+
+/* Define to the type of arg 5 for recvfrom. */
+#define RECVFROM_TYPE_ARG5 struct sockaddr *
+
+/* Define to the type of arg 6 for recvfrom. */
+#define RECVFROM_TYPE_ARG6 int *
+
+/* Define to the function return type for recvfrom. */
+#define RECVFROM_TYPE_RETV int
+
/* Define to 1 if you have the send function. */
#define HAVE_SEND 1
diff --git a/lib/config-win32.h b/lib/config-win32.h
index 031eda54a..d51047526 100644
--- a/lib/config-win32.h
+++ b/lib/config-win32.h
@@ -248,6 +248,30 @@
/* Define to the function return type for recv. */
#define RECV_TYPE_RETV int
+/* Define if you have the recvfrom function. */
+#define HAVE_RECVFROM 1
+
+/* Define to the type of arg 1 for recvfrom. */
+#define RECVFROM_TYPE_ARG1 SOCKET
+
+/* Define to the type of arg 2 for recvfrom. */
+#define RECVFROM_TYPE_ARG2 char *
+
+/* Define to the type of arg 3 for recvfrom. */
+#define RECVFROM_TYPE_ARG3 int
+
+/* Define to the type of arg 4 for recvfrom. */
+#define RECVFROM_TYPE_ARG4 int
+
+/* Define to the type of arg 5 for recvfrom. */
+#define RECVFROM_TYPE_ARG5 struct sockaddr *
+
+/* Define to the type of arg 6 for recvfrom. */
+#define RECVFROM_TYPE_ARG6 int *
+
+/* Define to the function return type for recvfrom. */
+#define RECVFROM_TYPE_RETV int
+
/* Define if you have the send function. */
#define HAVE_SEND 1
diff --git a/lib/config-win32ce.h b/lib/config-win32ce.h
index 0126cca78..c9b9bea38 100644
--- a/lib/config-win32ce.h
+++ b/lib/config-win32ce.h
@@ -234,6 +234,30 @@
/* Define to the function return type for recv. */
#define RECV_TYPE_RETV int
+/* Define if you have the recvfrom function. */
+#define HAVE_RECVFROM 1
+
+/* Define to the type of arg 1 for recvfrom. */
+#define RECVFROM_TYPE_ARG1 SOCKET
+
+/* Define to the type of arg 2 for recvfrom. */
+#define RECVFROM_TYPE_ARG2 char *
+
+/* Define to the type of arg 3 for recvfrom. */
+#define RECVFROM_TYPE_ARG3 int
+
+/* Define to the type of arg 4 for recvfrom. */
+#define RECVFROM_TYPE_ARG4 int
+
+/* Define to the type of arg 5 for recvfrom. */
+#define RECVFROM_TYPE_ARG5 struct sockaddr *
+
+/* Define to the type of arg 6 for recvfrom. */
+#define RECVFROM_TYPE_ARG6 int *
+
+/* Define to the function return type for recvfrom. */
+#define RECVFROM_TYPE_RETV int
+
/* Define if you have the send function. */
#define HAVE_SEND 1
diff --git a/lib/config.dos b/lib/config.dos
index 0e4998336..46b4a385d 100644
--- a/lib/config.dos
+++ b/lib/config.dos
@@ -35,6 +35,7 @@
#define HAVE_NET_IF_H 1
#define HAVE_PROCESS_H 1
#define HAVE_RECV 1
+#define HAVE_RECVFROM 1
#define HAVE_SELECT 1
#define HAVE_SEND 1
#define HAVE_SETJMP_H 1
@@ -63,8 +64,8 @@
#define STDC_HEADERS 1
#define TIME_WITH_SYS_TIME 1
-/* Qualifiers for send() and recv().
- */
+/* Qualifiers for send(), recv() and recv(). */
+
#define SEND_TYPE_ARG1 int
#define SEND_QUAL_ARG2 const
#define SEND_TYPE_ARG2 void *
@@ -78,6 +79,13 @@
#define RECV_TYPE_ARG4 int
#define RECV_TYPE_RETV int
+#define RECVFROM_TYPE_ARG1 int
+#define RECVFROM_TYPE_ARG2 void *
+#define RECVFROM_TYPE_ARG3 int
+#define RECVFROM_TYPE_ARG4 int
+#define RECVFROM_TYPE_ARG5 struct sockaddr *
+#define RECVFROM_TYPE_ARG6 int *
+#define RECVFROM_TYPE_RETV int
#define BSD
diff --git a/lib/setup_once.h b/lib/setup_once.h
index b0355e289..77b253588 100644
--- a/lib/setup_once.h
+++ b/lib/setup_once.h
@@ -7,7 +7,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2007, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -198,6 +198,37 @@ struct timeval {
#endif /* HAVE_SEND */
+#if defined(HAVE_RECVFROM)
+/*
+ * Currently recvfrom is only used on udp sockets.
+ */
+#if !defined(RECVFROM_TYPE_ARG1) || \
+ !defined(RECVFROM_TYPE_ARG2) || \
+ !defined(RECVFROM_TYPE_ARG3) || \
+ !defined(RECVFROM_TYPE_ARG4) || \
+ !defined(RECVFROM_TYPE_ARG5) || \
+ !defined(RECVFROM_TYPE_ARG6) || \
+ !defined(RECVFROM_TYPE_RETV)
+ /* */
+ Error Missing_definition_of_return_and_arguments_types_of_recvfrom
+ /* */
+#else
+#define sreadfrom(s,b,bl,f,fl) (ssize_t)recvfrom((RECVFROM_TYPE_ARG1)(s), \
+ (RECVFROM_TYPE_ARG2)(b), \
+ (RECVFROM_TYPE_ARG3)(bl), \
+ (RECVFROM_TYPE_ARG4)(0), \
+ (RECVFROM_TYPE_ARG5)(f), \
+ (RECVFROM_TYPE_ARG6)(fl))
+#endif
+#else /* HAVE_RECVFROM */
+#ifndef sreadfrom
+ /* */
+ Error Missing_definition_of_macro_sreadfrom
+ /* */
+#endif
+#endif /* HAVE_RECVFROM */
+
+
/*
* Uppercase macro versions of ANSI/ISO is*() functions/macros which
* avoid negative number inputs with argument byte codes > 127.