summaryrefslogtreecommitdiff
path: root/libguile
diff options
context:
space:
mode:
Diffstat (limited to 'libguile')
-rw-r--r--libguile/deprecated.c65
-rw-r--r--libguile/deprecated.h9
-rw-r--r--libguile/socket.c46
-rw-r--r--libguile/socket.h6
4 files changed, 74 insertions, 52 deletions
diff --git a/libguile/deprecated.c b/libguile/deprecated.c
index dee9ac3a4..7ff7b73ba 100644
--- a/libguile/deprecated.c
+++ b/libguile/deprecated.c
@@ -2,7 +2,7 @@
deprecate something, move it here when that is feasible.
*/
-/* Copyright (C) 2003, 2004, 2006, 2008, 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2004, 2006, 2008, 2009, 2010, 2011, 2012, 2013, 2014 Free Software Foundation, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
@@ -2952,6 +2952,69 @@ SCM_DEFINE (scm_gc_live_object_stats, "gc-live-object-stats", 0, 0, 0,
+SCM_DEFINE (scm_htons, "htons", 1, 0, 0,
+ (SCM value),
+ "Convert a 16 bit quantity from host to network byte ordering.\n"
+ "@var{value} is packed into 2 bytes, which are then converted\n"
+ "and returned as a new integer.")
+#define FUNC_NAME s_scm_htons
+{
+ scm_c_issue_deprecation_warning
+ ("htons is deprecated. Use bytevector-u16-set! and bytevector-u16-ref "
+ "with big endianness.");
+
+ return scm_from_ushort (htons (scm_to_ushort (value)));
+}
+#undef FUNC_NAME
+
+SCM_DEFINE (scm_ntohs, "ntohs", 1, 0, 0,
+ (SCM value),
+ "Convert a 16 bit quantity from network to host byte ordering.\n"
+ "@var{value} is packed into 2 bytes, which are then converted\n"
+ "and returned as a new integer.")
+#define FUNC_NAME s_scm_ntohs
+{
+ scm_c_issue_deprecation_warning
+ ("ntohs is deprecated. Use bytevector-u16-set! and bytevector-u16-ref "
+ "with big endianness.");
+
+ return scm_from_ushort (ntohs (scm_to_ushort (value)));
+}
+#undef FUNC_NAME
+
+SCM_DEFINE (scm_htonl, "htonl", 1, 0, 0,
+ (SCM value),
+ "Convert a 32 bit quantity from host to network byte ordering.\n"
+ "@var{value} is packed into 4 bytes, which are then converted\n"
+ "and returned as a new integer.")
+#define FUNC_NAME s_scm_htonl
+{
+ scm_c_issue_deprecation_warning
+ ("htonl is deprecated. Use bytevector-u32-set! and bytevector-u32-ref "
+ "with big endianness.");
+
+ return scm_from_ulong (htonl (scm_to_uint32 (value)));
+}
+#undef FUNC_NAME
+
+SCM_DEFINE (scm_ntohl, "ntohl", 1, 0, 0,
+ (SCM value),
+ "Convert a 32 bit quantity from network to host byte ordering.\n"
+ "@var{value} is packed into 4 bytes, which are then converted\n"
+ "and returned as a new integer.")
+#define FUNC_NAME s_scm_ntohl
+{
+ scm_c_issue_deprecation_warning
+ ("ntohl is deprecated. Use bytevector-u32-set! and bytevector-u32-ref "
+ "with big endianness.");
+
+ return scm_from_ulong (ntohl (scm_to_uint32 (value)));
+}
+#undef FUNC_NAME
+
+
+
+
void
scm_i_init_deprecated ()
{
diff --git a/libguile/deprecated.h b/libguile/deprecated.h
index cfbea6bbb..5f95f2711 100644
--- a/libguile/deprecated.h
+++ b/libguile/deprecated.h
@@ -5,7 +5,7 @@
#ifndef SCM_DEPRECATED_H
#define SCM_DEPRECATED_H
-/* Copyright (C) 2003,2004, 2005, 2006, 2007, 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc.
+/* Copyright (C) 2003,2004, 2005, 2006, 2007, 2009, 2010, 2011, 2012, 2013, 2014 Free Software Foundation, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
@@ -865,6 +865,13 @@ SCM_DEPRECATED SCM scm_gc_live_object_stats (void);
+SCM_DEPRECATED SCM scm_htons (SCM in);
+SCM_DEPRECATED SCM scm_ntohs (SCM in);
+SCM_DEPRECATED SCM scm_htonl (SCM in);
+SCM_DEPRECATED SCM scm_ntohl (SCM in);
+
+
+
void scm_i_init_deprecated (void);
#endif
diff --git a/libguile/socket.c b/libguile/socket.c
index a0fb1a9f0..09f4831cd 100644
--- a/libguile/socket.c
+++ b/libguile/socket.c
@@ -1,5 +1,5 @@
/* Copyright (C) 1996, 1997, 1998, 2000, 2001, 2002, 2003, 2004, 2005,
- * 2006, 2007, 2009, 2011, 2012, 2013 Free Software Foundation, Inc.
+ * 2006, 2007, 2009, 2011, 2012, 2013, 2014 Free Software Foundation, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
@@ -92,50 +92,6 @@ typedef union
-SCM_DEFINE (scm_htons, "htons", 1, 0, 0,
- (SCM value),
- "Convert a 16 bit quantity from host to network byte ordering.\n"
- "@var{value} is packed into 2 bytes, which are then converted\n"
- "and returned as a new integer.")
-#define FUNC_NAME s_scm_htons
-{
- return scm_from_ushort (htons (scm_to_ushort (value)));
-}
-#undef FUNC_NAME
-
-SCM_DEFINE (scm_ntohs, "ntohs", 1, 0, 0,
- (SCM value),
- "Convert a 16 bit quantity from network to host byte ordering.\n"
- "@var{value} is packed into 2 bytes, which are then converted\n"
- "and returned as a new integer.")
-#define FUNC_NAME s_scm_ntohs
-{
- return scm_from_ushort (ntohs (scm_to_ushort (value)));
-}
-#undef FUNC_NAME
-
-SCM_DEFINE (scm_htonl, "htonl", 1, 0, 0,
- (SCM value),
- "Convert a 32 bit quantity from host to network byte ordering.\n"
- "@var{value} is packed into 4 bytes, which are then converted\n"
- "and returned as a new integer.")
-#define FUNC_NAME s_scm_htonl
-{
- return scm_from_ulong (htonl (scm_to_uint32 (value)));
-}
-#undef FUNC_NAME
-
-SCM_DEFINE (scm_ntohl, "ntohl", 1, 0, 0,
- (SCM value),
- "Convert a 32 bit quantity from network to host byte ordering.\n"
- "@var{value} is packed into 4 bytes, which are then converted\n"
- "and returned as a new integer.")
-#define FUNC_NAME s_scm_ntohl
-{
- return scm_from_ulong (ntohl (scm_to_uint32 (value)));
-}
-#undef FUNC_NAME
-
#ifdef HAVE_INET_NETOF
SCM_DEFINE (scm_inet_netof, "inet-netof", 1, 0, 0,
(SCM address),
diff --git a/libguile/socket.h b/libguile/socket.h
index fcddd780d..a211867c6 100644
--- a/libguile/socket.h
+++ b/libguile/socket.h
@@ -3,7 +3,7 @@
#ifndef SCM_SOCKET_H
#define SCM_SOCKET_H
-/* Copyright (C) 1995,1996,1997,2000,2001, 2004, 2005, 2006, 2008 Free Software Foundation, Inc.
+/* Copyright (C) 1995,1996,1997,2000,2001, 2004, 2005, 2006, 2008, 2014 Free Software Foundation, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
@@ -27,10 +27,6 @@
-SCM_API SCM scm_htons (SCM in);
-SCM_API SCM scm_ntohs (SCM in);
-SCM_API SCM scm_htonl (SCM in);
-SCM_API SCM scm_ntohl (SCM in);
SCM_API SCM scm_inet_aton (SCM address);
SCM_API SCM scm_inet_ntoa (SCM inetid);
SCM_API SCM scm_inet_netof (SCM address);