diff Modules/socketmodule.c @ 42622:4d2aa4bfb2d6

Remove RISCOS support
author Skip Montanaro <skip@pobox.com>
date Thu, 16 Aug 2007 14:35:24 +0000
parents 980308fbda29
children a5e984eda45a
line wrap: on
line diff
--- a/Modules/socketmodule.c	Thu Aug 16 08:08:41 2007 +0000
+++ b/Modules/socketmodule.c	Thu Aug 16 14:35:24 2007 +0000
@@ -251,15 +251,7 @@
 #   include <arpa/inet.h>
 # endif
 
-# ifndef RISCOS
 #  include <fcntl.h>
-# else
-#  include <sys/ioctl.h>
-#  include <socklib.h>
-#  define NO_DUP
-int h_errno; /* not used */
-#  define INET_ADDRSTRLEN 16
-# endif
 
 #else
 
@@ -417,11 +409,6 @@
 static PyObject *socket_gaierror;
 static PyObject *socket_timeout;
 
-#ifdef RISCOS
-/* Global variable which is !=0 if Python is running in a RISC OS taskwindow */
-static int taskwindow;
-#endif
-
 /* A forward reference to the socket type object.
    The sock_type variable contains pointers to various functions,
    some of which call new_sockobject(), which uses sock_type, so
@@ -582,18 +569,6 @@
 	}
 #endif
 
-#if defined(RISCOS)
-	if (_inet_error.errnum != NULL) {
-		PyObject *v;
-		v = Py_BuildValue("(is)", errno, _inet_err());
-		if (v != NULL) {
-			PyErr_SetObject(socket_error, v);
-			Py_DECREF(v);
-		}
-		return NULL;
-	}
-#endif
-
 	return PyErr_SetFromErrno(socket_error);
 }
 
@@ -670,11 +645,9 @@
 static int
 internal_setblocking(PySocketSockObject *s, int block)
 {
-#ifndef RISCOS
 #ifndef MS_WINDOWS
 	int delay_flag;
 #endif
-#endif
 
 	Py_BEGIN_ALLOW_THREADS
 #ifdef __BEOS__
@@ -682,7 +655,6 @@
 	setsockopt(s->sock_fd, SOL_SOCKET, SO_NONBLOCK,
 		   (void *)(&block), sizeof(int));
 #else
-#ifndef RISCOS
 #ifndef MS_WINDOWS
 #if defined(PYOS_OS2) && !defined(PYCC_GCC)
 	block = !block;
@@ -702,10 +674,6 @@
 	block = !block;
 	ioctlsocket(s->sock_fd, FIONBIO, (u_long*)&block);
 #endif /* MS_WINDOWS */
-#else /* RISCOS */
-	block = !block;
-	socketioctl(s->sock_fd, FIONBIO, (u_long*)&block);
-#endif /* RISCOS */
 #endif /* __BEOS__ */
 	Py_END_ALLOW_THREADS
 
@@ -778,9 +746,6 @@
 init_sockobject(PySocketSockObject *s,
 		SOCKET_T fd, int family, int type, int proto)
 {
-#ifdef RISCOS
-	int block = 1;
-#endif
 	s->sock_fd = fd;
 	s->sock_family = family;
 	s->sock_type = type;
@@ -792,10 +757,6 @@
 	if (defaulttimeout >= 0.0)
 		internal_setblocking(s, 0);
 
-#ifdef RISCOS
-	if (taskwindow)
-		socketioctl(s->sock_fd, 0x80046679, (u_long*)&block);
-#endif
 }
 
 
@@ -1700,30 +1661,6 @@
 operations. A timeout of None indicates that timeouts on socket \n\
 operations are disabled.");
 
-#ifdef RISCOS
-/* s.sleeptaskw(1 | 0) method */
-
-static PyObject *
-sock_sleeptaskw(PySocketSockObject *s,PyObject *arg)
-{
-	int block;
-	block = PyInt_AsLong(arg);
-	if (block == -1 && PyErr_Occurred())
-		return NULL;
-	Py_BEGIN_ALLOW_THREADS
-	socketioctl(s->sock_fd, 0x80046679, (u_long*)&block);
-	Py_END_ALLOW_THREADS
-
-	Py_INCREF(Py_None);
-	return Py_None;
-}
-PyDoc_STRVAR(sleeptaskw_doc,
-"sleeptaskw(flag)\n\
-\n\
-Allow sleeps in taskwindows.");
-#endif
-
-
 /* s.setsockopt() method.
    With an integer third argument, sets an integer option.
    With a string third argument, sets an option from a buffer;
@@ -2749,10 +2686,6 @@
 			  setsockopt_doc},
 	{"shutdown",	  (PyCFunction)sock_shutdown, METH_O,
 			  shutdown_doc},
-#ifdef RISCOS
-	{"sleeptaskw",	  (PyCFunction)sock_sleeptaskw, METH_O,
-	 		  sleeptaskw_doc},
-#endif
 	{NULL,			NULL}		/* sentinel */
 };
 
@@ -2963,11 +2896,7 @@
 
 	if (h == NULL) {
 		/* Let's get real error message to return */
-#ifndef RISCOS
 		set_herror(h_errno);
-#else
-		PyErr_SetString(socket_error, "host not found");
-#endif
 		return NULL;
 	}
 
@@ -4016,24 +3945,6 @@
 };
 
 
-#ifdef RISCOS
-#define OS_INIT_DEFINED
-
-static int
-os_init(void)
-{
-	_kernel_swi_regs r;
-
-	r.r[0] = 0;
-	_kernel_swi(0x43380, &r, &r);
-	taskwindow = r.r[0];
-
-	return 1;
-}
-
-#endif /* RISCOS */
-
-
 #ifdef MS_WINDOWS
 #define OS_INIT_DEFINED