summaryrefslogtreecommitdiffstats
path: root/Modules/cstubs
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1991-08-16 08:59:21 (GMT)
committerGuido van Rossum <guido@python.org>1991-08-16 08:59:21 (GMT)
commitb316515289fbfb5e69ce1e5b22f0bdd50eceb5a9 (patch)
treeec77c9f169638cb8e75c2ab5ed05400810e1ad9f /Modules/cstubs
parent3fecef73d923b1c59d20f06fd9371cc8dc182771 (diff)
downloadcpython-b316515289fbfb5e69ce1e5b22f0bdd50eceb5a9.zip
cpython-b316515289fbfb5e69ce1e5b22f0bdd50eceb5a9.tar.gz
cpython-b316515289fbfb5e69ce1e5b22f0bdd50eceb5a9.tar.bz2
Changed some interfaces after error reports from Liberte.
Added altgetmatrix (better but incompatible).
Diffstat (limited to 'Modules/cstubs')
-rw-r--r--Modules/cstubs54
1 files changed, 51 insertions, 3 deletions
diff --git a/Modules/cstubs b/Modules/cstubs
index 88a77bc..af41213 100644
--- a/Modules/cstubs
+++ b/Modules/cstubs
@@ -1,6 +1,6 @@
/*
Input used to generate the Python module "glmodule.c".
-The stub generator is a Python script called "cgen".
+The stub generator is a Python script called "cgen.py".
Each definition must be contained on one line:
@@ -493,6 +493,8 @@ static object *gl_endselect(self, args) object *self, *args; {
/* XXX The generator botches this one. Here's a quick hack to fix it. */
+/* XXX The generator botches this one. Here's a quick hack to fix it. */
+
% getmatrix float r[16]
static object *
@@ -519,6 +521,46 @@ gl_getmatrix(self, args)
return v;
}
+/* Here's an alternate version that returns a 4x4 matrix instead of
+ a vector. Unfortunately it is incompatible with loadmatrix and
+ multmatrix... */
+
+% altgetmatrix float r[4][4]
+
+static object *
+gl_altgetmatrix(self, args)
+ object *self;
+ object *args;
+{
+ float arg1 [ 4 ] [ 4 ] ;
+ object *v, *w;
+ int i, j;
+ getmatrix( arg1 );
+ v = newlistobject(4);
+ if (v == NULL) {
+ return NULL;
+ }
+ for (i = 0; i < 4; i++) {
+ w = newlistobject(4);
+ if (w == NULL) {
+ DECREF(v);
+ return NULL;
+ }
+ setlistitem(v, i, w);
+ }
+ for (i = 0; i < 4; i++) {
+ for (j = 0; j < 4; j++) {
+ w = mknewfloatobject(arg1[i][j]);
+ if (w == NULL) {
+ DECREF(v);
+ return NULL;
+ }
+ setlistitem(getlistitem(v, i), j, w);
+ }
+ }
+ return v;
+}
+
/* End of manually written stubs */
%%
@@ -680,9 +722,13 @@ void rpmv2 float s float s
void xfpt2 float s float s
#
void loadmatrix float s[16]
+# Really [4][4]
void multmatrix float s[16]
-void crv float s[16]
+# Really [4][4]
+void crv float s[12]
+# Really [4][3]
void rcrv float s[16]
+# Really [4][4]
#
# Methods that have strings.
#
@@ -712,8 +758,10 @@ void polfs long s short s[3*arg1]
void polys long s short s[3*arg1]
void poly2s long s short s[2*arg1]
#
-void defcursor short s short s[16]
+void defcursor short s short s[128]
+# Is this useful?
void writepixels short s short s[arg1]
+# Should be unsigned short...
void defbasis long s float s[16]
void gewrite short s short s[arg1]
#