summaryrefslogtreecommitdiffstats
path: root/Include/modsupport.h
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1995-01-09 17:47:20 (GMT)
committerGuido van Rossum <guido@python.org>1995-01-09 17:47:20 (GMT)
commit970a0a20b881962a950946cbc43e1941827a1e87 (patch)
tree2e312405bf094ae08231a8da943f18ecc0683243 /Include/modsupport.h
parent6da5bfad0f8d22361c8d7b45c1fd26789dd0635c (diff)
downloadcpython-970a0a20b881962a950946cbc43e1941827a1e87.zip
cpython-970a0a20b881962a950946cbc43e1941827a1e87.tar.gz
cpython-970a0a20b881962a950946cbc43e1941827a1e87.tar.bz2
api version checking
Diffstat (limited to 'Include/modsupport.h')
-rw-r--r--Include/modsupport.h19
1 files changed, 16 insertions, 3 deletions
diff --git a/Include/modsupport.h b/Include/modsupport.h
index fb196df..f81248c 100644
--- a/Include/modsupport.h
+++ b/Include/modsupport.h
@@ -51,9 +51,22 @@ extern object *mkvalue();
extern int vgetargs PROTO((object *, char *, va_list));
extern object *vmkvalue PROTO((char *, va_list));
-extern object *initmodule PROTO((char *, struct methodlist *));
-extern object *initmodule3 PROTO((char *, struct methodlist *,
- char *, object *));
+#define PYTHON_API_VERSION 1001
+/* The API version is maintained (independently from the Python version)
+ so we can detect mismatches between the interpreter and dynamically
+ loaded modules.
+
+ Please add a line or two to the top of this log for each API
+ version change:
+
+ 9-Jan-1995 GvR Initial version (incompatible with older API)
+*/
+
+extern object *initmodule4 PROTO((char *, struct methodlist *,
+ char *, object *, int));
+#define initmodule(name, methods) \
+ initmodule4(name, methods, (char *)NULL, (object *)NULL, \
+ PYTHON_API_VERSION)
/* The following are obsolete -- use getargs directly! */
#define getnoarg(v) getargs(v, "")