summaryrefslogtreecommitdiff
path: root/Modules
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1995-01-10 20:56:29 +0000
committerGuido van Rossum <guido@python.org>1995-01-10 20:56:29 +0000
commita597dde3f1959127c33296a77f76331b59449c01 (patch)
tree1b41173d59525e5c16ea772aaa60dc0c123dc409 /Modules
parent6c1874fc2bd0e0d2e30de78fe1f1fe8bcf8a20be (diff)
downloadcpython-git-a597dde3f1959127c33296a77f76331b59449c01.tar.gz
cosmetic changes so these modules will work with the strict new naming scheme
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_cursesmodule.c2
-rw-r--r--Modules/_tkinter.c8
-rw-r--r--Modules/mpzmodule.c3
-rw-r--r--Modules/rotormodule.c10
-rw-r--r--Modules/signalmodule.c13
-rw-r--r--Modules/socketmodule.c10
-rw-r--r--Modules/syslogmodule.c5
-rw-r--r--Modules/threadmodule.c2
8 files changed, 23 insertions, 30 deletions
diff --git a/Modules/_cursesmodule.c b/Modules/_cursesmodule.c
index fe9787e50a..d13bcd149e 100644
--- a/Modules/_cursesmodule.c
+++ b/Modules/_cursesmodule.c
@@ -953,7 +953,7 @@ PyCursesWindow_GetAttr(self, name)
PyCursesWindowObject *self;
char *name;
{
- return findmethod(PyCursesWindow_Methods, (PyObject *)self, name);
+ return Py_FindMethod(PyCursesWindow_Methods, (PyObject *)self, name);
}
/* --------------- PAD routines ---------------- */
diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c
index 96a1c938d3..9675da5d05 100644
--- a/Modules/_tkinter.c
+++ b/Modules/_tkinter.c
@@ -744,7 +744,7 @@ Tkapp_DeleteCommand (self, args)
/** File Handler **/
-void
+static void
FileHandler (clientData, mask)
ClientData clientData; /* Is: (func, file) */
int mask;
@@ -770,7 +770,7 @@ GetFileNo (file)
PyObject *file; /* Either an int >= 0 or an object with a
.fileno() method that returns an int >= 0 */
{
- object *meth, *args, *res;
+ PyObject *meth, *args, *res;
int id;
if (PyInt_Check(file)) {
id = PyInt_AsLong(file);
@@ -933,7 +933,7 @@ Tktt_GetAttr (self, name)
static PyTypeObject Tktt_Type =
{
- OB_HEAD_INIT (&PyType_Type)
+ PyObject_HEAD_INIT (&PyType_Type)
0, /*ob_size */
"tktimertoken", /*tp_name */
sizeof (TkttObject), /*tp_basicsize */
@@ -1122,7 +1122,7 @@ Tkapp_GetAttr (self, name)
static PyTypeObject Tkapp_Type =
{
- OB_HEAD_INIT (&PyType_Type)
+ PyObject_HEAD_INIT (&PyType_Type)
0, /*ob_size */
"tkapp", /*tp_name */
sizeof (TkappObject), /*tp_basicsize */
diff --git a/Modules/mpzmodule.c b/Modules/mpzmodule.c
index 48079147a9..ce31a4bc47 100644
--- a/Modules/mpzmodule.c
+++ b/Modules/mpzmodule.c
@@ -34,8 +34,7 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
/* MPZ objects */
#include "allobjects.h"
-#include "modsupport.h" /* For getargs() etc. */
-#include "rename1.h"
+
#include <assert.h>
#include <sys/types.h> /* For size_t */
diff --git a/Modules/rotormodule.c b/Modules/rotormodule.c
index cb70612a33..60d9257179 100644
--- a/Modules/rotormodule.c
+++ b/Modules/rotormodule.c
@@ -57,8 +57,8 @@ NOTE: you MUST use the SAME key in rotor.newrotor()
#include "Python.h"
-#include <stdio.h>
#include <math.h>
+
#define TRUE 1
#define FALSE 0
@@ -217,7 +217,7 @@ PyRotor_New(num_rotors, key)
goto fail;
return xp;
fail:
- DECREF(xp);
+ Py_DECREF(xp);
return (PyRotorObject *)PyErr_NoMemory();
}
@@ -736,7 +736,7 @@ PyRotor_SetKey(self, args)
return Py_None;
}
-static struct methodlist PyRotor_Methods[] = {
+static struct PyMethodDef PyRotor_Methods[] = {
{"encrypt", (PyCFunction)PyRotor_Encrypt},
{"encryptmore", (PyCFunction)PyRotor_EncryptMore},
{"decrypt", (PyCFunction)PyRotor_Decrypt},
@@ -756,7 +756,7 @@ PyRotor_GetAttr(s, name)
}
static PyTypeObject PyRotor_Type = {
- PyObject_HEAD_INIT(&Typetype)
+ PyObject_HEAD_INIT(&PyType_Type)
0, /*ob_size*/
"rotor", /*tp_name*/
sizeof(PyRotorObject), /*tp_size*/
@@ -793,7 +793,7 @@ PyRotor_Rotor(self, args)
return (PyObject * )r;
}
-static struct methodlist PyRotor_Rotor_Methods[] = {
+static struct PyMethodDef PyRotor_Rotor_Methods[] = {
{"newrotor", (PyCFunction)PyRotor_Rotor},
{NULL, NULL} /* Sentinel */
};
diff --git a/Modules/signalmodule.c b/Modules/signalmodule.c
index 4b81889879..97d895bc36 100644
--- a/Modules/signalmodule.c
+++ b/Modules/signalmodule.c
@@ -28,7 +28,6 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include "intrcheck.h"
#include <signal.h>
-#include <errno.h>
#ifndef SIG_ERR
#define SIG_ERR ((RETSIGTYPE (*)())-1)
@@ -130,16 +129,16 @@ PySignal_Alarm(self, args)
return PyInt_FromLong(alarm(t));
}
-static object *
+static PyObject *
PySignal_Pause(self, args)
PyObject *self; /* Not used */
PyObject *args;
{
if (!PyArg_NoArgs(args))
return NULL;
- BGN_SAVE
+ Py_BEGIN_ALLOW_THREADS
pause();
- END_SAVE
+ Py_END_ALLOW_THREADS
Py_INCREF(Py_None);
return Py_None;
}
@@ -418,7 +417,7 @@ sigcheck()
if (get_thread_ident() != main_thread)
return 0;
#endif
- f = getframe();
+ f = PyEval_GetFrame();
if (f == (PyObject *)NULL)
f = Py_None;
for (i = 1; i < NSIG; i++) {
@@ -446,13 +445,13 @@ sigcheck()
/* Replacement for intrcheck.c functionality */
void
-initintr()
+PyOS_InitInterrupts ()
{
initsignal();
}
int
-intrcheck()
+PyOS_InterruptOccurred ()
{
if (PySignal_SignalHandlerArray[SIGINT].tripped) {
#ifdef WITH_THREAD
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c
index 9525dbaf1e..194ec5e192 100644
--- a/Modules/socketmodule.c
+++ b/Modules/socketmodule.c
@@ -580,7 +580,7 @@ BUILD_FUNC_DEF_2(PySocketSock_getsockopt,PySocketSockObject *,s, PyObject *,args
if (buf == NULL)
return NULL;
res = getsockopt(s->sock_fd, level, optname,
- (ANY *)getstringvalue(buf), &buflen);
+ (ANY *)PyString_AsString(buf), &buflen);
if (res < 0) {
Py_DECREF(buf);
return PySocket_Err();
@@ -732,7 +732,7 @@ BUILD_FUNC_DEF_2(PySocketSock_listen,PySocketSockObject *,s, PyObject *,args)
static PyObject *
BUILD_FUNC_DEF_2(PySocketSock_makefile,PySocketSockObject *,s, PyObject *,args)
{
- extern int fclose PROTO((FILE *));
+ extern int fclose Py_PROTO((FILE *));
char *mode;
int fd;
FILE *fp;
@@ -762,7 +762,7 @@ BUILD_FUNC_DEF_2(PySocketSock_recv,PySocketSockObject *,s, PyObject *,args)
if (buf == NULL)
return NULL;
Py_BEGIN_ALLOW_THREADS
- n = recv(s->sock_fd, getstringvalue(buf), len, flags);
+ n = recv(s->sock_fd, PyString_AsString(buf), len, flags);
Py_END_ALLOW_THREADS
if (n < 0)
return PySocket_Err();
@@ -937,12 +937,12 @@ BUILD_FUNC_DEF_1(PySocketSock_repr,PySocketSockObject *,s)
PyObject *addro;
struct sockaddr *addr;
char buf[512];
- object *t, *comma, *v;
+ PyObject *t, *comma, *v;
int i, len;
sprintf(buf,
"<socket object, fd=%d, family=%d, type=%d, protocol=%d>",
s->sock_fd, s->sock_family, s->sock_type, s->sock_proto);
- t = newstringobject(buf);
+ t = PyString_FromString(buf);
return t;
}
diff --git a/Modules/syslogmodule.c b/Modules/syslogmodule.c
index eea33aabb7..aca674686c 100644
--- a/Modules/syslogmodule.c
+++ b/Modules/syslogmodule.c
@@ -24,13 +24,10 @@ WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
/* syslog module */
-#include "allobjects.h"
-#include "modsupport.h"
+#include "Python.h"
#include <syslog.h>
-#include "rename1.h"
-
static PyObject *
syslog_openlog(self, args)
PyObject * self;
diff --git a/Modules/threadmodule.c b/Modules/threadmodule.c
index f2b8d2ffb7..9cb4cbaa8a 100644
--- a/Modules/threadmodule.c
+++ b/Modules/threadmodule.c
@@ -26,8 +26,6 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
/* Interface to Sjoerd's portable C thread library */
#include "allobjects.h"
-#include "modsupport.h"
-#include "ceval.h"
#ifndef WITH_THREAD
Error! The rest of Python is not compiled with thread support.