| Guido van Rossum | 85a5fbb | 1990-10-14 12:07:46 +0000 | [diff] [blame] | 1 | /* | 
 | 2 | Input used to generate the Python module "glmodule.c". | 
| Guido van Rossum | b316515 | 1991-08-16 08:59:21 +0000 | [diff] [blame] | 3 | The stub generator is a Python script called "cgen.py". | 
| Guido van Rossum | 85a5fbb | 1990-10-14 12:07:46 +0000 | [diff] [blame] | 4 |  | 
 | 5 | Each definition must be contained on one line: | 
 | 6 |  | 
 | 7 | <returntype> <name> <type> <arg> <type> <arg> | 
 | 8 |  | 
 | 9 | <returntype> can be: void, short, long (XXX maybe others?) | 
 | 10 |  | 
 | 11 | <type> can be: char, string, short, float, long, or double | 
 | 12 | 	string indicates a null terminated string; | 
 | 13 | 	if <type> is char and <arg> begins with a *, the * is stripped | 
 | 14 | 	and <type> is changed into string | 
 | 15 |  | 
 | 16 | <arg> has the form <mode> or <mode>[<subscript>] | 
 | 17 | 	where <mode> can be | 
 | 18 | 		s: arg is sent | 
 | 19 | 		r: arg is received		(arg is a pointer) | 
 | 20 | 	and <subscript> can be (N and I are numbers): | 
 | 21 | 		N | 
 | 22 | 		argI | 
 | 23 | 		retval | 
 | 24 | 		N*argI | 
 | 25 | 		N*retval | 
 | 26 | */ | 
 | 27 |  | 
| Guido van Rossum | 85a5fbb | 1990-10-14 12:07:46 +0000 | [diff] [blame] | 28 | #include <gl.h> | 
 | 29 | #include <device.h> | 
| Guido van Rossum | 3f5da24 | 1990-12-20 15:06:42 +0000 | [diff] [blame] | 30 |  | 
 | 31 | #include "allobjects.h" | 
| Guido van Rossum | 85a5fbb | 1990-10-14 12:07:46 +0000 | [diff] [blame] | 32 | #include "import.h" | 
| Guido van Rossum | 85a5fbb | 1990-10-14 12:07:46 +0000 | [diff] [blame] | 33 | #include "modsupport.h" | 
 | 34 | #include "cgensupport.h" | 
| Guido van Rossum | 85a5fbb | 1990-10-14 12:07:46 +0000 | [diff] [blame] | 35 |  | 
 | 36 | /* | 
 | 37 | Some stubs are too complicated for the stub generator. | 
 | 38 | We can include manually written versions of them here. | 
 | 39 | A line starting with '%' gives the name of the function so the stub | 
 | 40 | generator can include it in the table of functions. | 
 | 41 | */ | 
 | 42 |  | 
 | 43 | /* | 
 | 44 | varray -- an array of v.. calls. | 
 | 45 | The argument is an array (maybe list or tuple) of points. | 
 | 46 | Each point must be a tuple or list of coordinates (x, y, z). | 
 | 47 | The points may be 2- or 3-dimensional but must all have the | 
 | 48 | same dimension.  Float and int values may be mixed however. | 
 | 49 | The points are always converted to 3D double precision points | 
 | 50 | by assuming z=0.0 if necessary (as indicated in the man page), | 
 | 51 | and for each point v3d() is called. | 
 | 52 | */ | 
 | 53 |  | 
 | 54 | % varray | 
 | 55 |  | 
 | 56 | static object * | 
 | 57 | gl_varray(self, args) | 
 | 58 | 	object *self; | 
 | 59 | 	object *args; | 
 | 60 | { | 
 | 61 | 	object *v, *w; | 
 | 62 | 	int i, n, width; | 
 | 63 | 	double vec[3]; | 
 | 64 | 	object * (*getitem) FPROTO((object *, int)); | 
 | 65 | 	 | 
 | 66 | 	if (!getiobjectarg(args, 1, 0, &v)) | 
 | 67 | 		return NULL; | 
 | 68 | 	 | 
 | 69 | 	if (is_listobject(v)) { | 
 | 70 | 		n = getlistsize(v); | 
 | 71 | 		getitem = getlistitem; | 
 | 72 | 	} | 
 | 73 | 	else if (is_tupleobject(v)) { | 
 | 74 | 		n = gettuplesize(v); | 
 | 75 | 		getitem = gettupleitem; | 
 | 76 | 	} | 
 | 77 | 	else { | 
 | 78 | 		err_badarg(); | 
 | 79 | 		return NULL; | 
 | 80 | 	} | 
 | 81 | 	 | 
 | 82 | 	if (n == 0) { | 
 | 83 | 		INCREF(None); | 
 | 84 | 		return None; | 
 | 85 | 	} | 
 | 86 | 	if (n > 0) | 
 | 87 | 		w = (*getitem)(v, 0); | 
 | 88 | 	 | 
 | 89 | 	width = 0; | 
 | 90 | 	if (w == NULL) { | 
 | 91 | 	} | 
 | 92 | 	else if (is_listobject(w)) { | 
 | 93 | 		width = getlistsize(w); | 
 | 94 | 	} | 
 | 95 | 	else if (is_tupleobject(w)) { | 
 | 96 | 		width = gettuplesize(w); | 
 | 97 | 	} | 
 | 98 | 	 | 
 | 99 | 	switch (width) { | 
 | 100 | 	case 2: | 
 | 101 | 		vec[2] = 0.0; | 
 | 102 | 		/* Fall through */ | 
 | 103 | 	case 3: | 
 | 104 | 		break; | 
 | 105 | 	default: | 
 | 106 | 		err_badarg(); | 
 | 107 | 		return NULL; | 
 | 108 | 	} | 
 | 109 | 	 | 
 | 110 | 	for (i = 0; i < n; i++) { | 
 | 111 | 		w = (*getitem)(v, i); | 
 | 112 | 		if (!getidoublearray(w, 1, 0, width, vec)) | 
 | 113 | 			return NULL; | 
 | 114 | 		v3d(vec); | 
 | 115 | 	} | 
 | 116 | 	 | 
 | 117 | 	INCREF(None); | 
 | 118 | 	return None; | 
 | 119 | } | 
 | 120 |  | 
 | 121 | /* | 
 | 122 | vnarray, nvarray -- an array of n3f and v3f calls. | 
 | 123 | The argument is an array (list or tuple) of pairs of points and normals. | 
 | 124 | Each pair is a tuple (NOT a list) of a point and a normal for that point. | 
 | 125 | Each point or normal must be a tuple (NOT a list) of coordinates (x, y, z). | 
 | 126 | Three coordinates must be given.  Float and int values may be mixed. | 
 | 127 | For each pair, n3f() is called for the normal, and then v3f() is called | 
 | 128 | for the vector. | 
 | 129 |  | 
 | 130 | vnarray and nvarray differ only in the order of the vector and normal in | 
 | 131 | the pair: vnarray expects (v, n) while nvarray expects (n, v). | 
 | 132 | */ | 
 | 133 |  | 
 | 134 | static object *gen_nvarray(); /* Forward */ | 
 | 135 |  | 
 | 136 | % nvarray | 
 | 137 |  | 
 | 138 | static object * | 
 | 139 | gl_nvarray(self, args) | 
 | 140 | 	object *self; | 
 | 141 | 	object *args; | 
 | 142 | { | 
 | 143 | 	return gen_nvarray(args, 0); | 
 | 144 | } | 
 | 145 |  | 
 | 146 | % vnarray | 
 | 147 |  | 
 | 148 | static object * | 
 | 149 | gl_vnarray(self, args) | 
 | 150 | 	object *self; | 
 | 151 | 	object *args; | 
 | 152 | { | 
 | 153 | 	return gen_nvarray(args, 1); | 
 | 154 | } | 
 | 155 |  | 
 | 156 | /* Generic, internal version of {nv,nv}array: inorm indicates the | 
 | 157 |    argument order, 0: normal first, 1: vector first. */ | 
 | 158 |  | 
 | 159 | static object * | 
 | 160 | gen_nvarray(args, inorm) | 
 | 161 | 	object *args; | 
 | 162 | 	int inorm; | 
 | 163 | { | 
 | 164 | 	object *v, *w, *wnorm, *wvec; | 
 | 165 | 	int i, n; | 
 | 166 | 	float norm[3], vec[3]; | 
 | 167 | 	object * (*getitem) FPROTO((object *, int)); | 
 | 168 | 	 | 
 | 169 | 	if (!getiobjectarg(args, 1, 0, &v)) | 
 | 170 | 		return NULL; | 
 | 171 | 	 | 
 | 172 | 	if (is_listobject(v)) { | 
 | 173 | 		n = getlistsize(v); | 
 | 174 | 		getitem = getlistitem; | 
 | 175 | 	} | 
 | 176 | 	else if (is_tupleobject(v)) { | 
 | 177 | 		n = gettuplesize(v); | 
 | 178 | 		getitem = gettupleitem; | 
 | 179 | 	} | 
 | 180 | 	else { | 
 | 181 | 		err_badarg(); | 
 | 182 | 		return NULL; | 
 | 183 | 	} | 
 | 184 | 	 | 
 | 185 | 	for (i = 0; i < n; i++) { | 
 | 186 | 		w = (*getitem)(v, i); | 
 | 187 | 		if (!is_tupleobject(w) || gettuplesize(w) != 2) { | 
 | 188 | 			err_badarg(); | 
 | 189 | 			return NULL; | 
 | 190 | 		} | 
 | 191 | 		wnorm = gettupleitem(w, inorm); | 
 | 192 | 		wvec = gettupleitem(w, 1 - inorm); | 
 | 193 | 		if (!getifloatarray(wnorm, 1, 0, 3, norm) || | 
 | 194 | 			!getifloatarray(wvec, 1, 0, 3, vec)) | 
 | 195 | 			return NULL; | 
 | 196 | 		n3f(norm); | 
 | 197 | 		v3f(vec); | 
 | 198 | 	} | 
 | 199 | 	 | 
 | 200 | 	INCREF(None); | 
 | 201 | 	return None; | 
 | 202 | } | 
 | 203 |  | 
 | 204 | /* nurbssurface(s_knots[], t_knots[], ctl[][], s_order, t_order, type). | 
 | 205 |    The dimensions of ctl[] are computed as follows: | 
 | 206 |    [len(s_knots) - s_order], [len(t_knots) - t_order] | 
 | 207 | */ | 
 | 208 |  | 
 | 209 | % nurbssurface | 
 | 210 |  | 
 | 211 | static object * | 
 | 212 | gl_nurbssurface(self, args) | 
 | 213 | 	object *self; | 
 | 214 | 	object *args; | 
 | 215 | { | 
 | 216 | 	long arg1 ; | 
 | 217 | 	double * arg2 ; | 
 | 218 | 	long arg3 ; | 
 | 219 | 	double * arg4 ; | 
 | 220 | 	double *arg5 ; | 
 | 221 | 	long arg6 ; | 
 | 222 | 	long arg7 ; | 
 | 223 | 	long arg8 ; | 
 | 224 | 	long ncoords; | 
 | 225 | 	long s_byte_stride, t_byte_stride; | 
 | 226 | 	long s_nctl, t_nctl; | 
 | 227 | 	long s, t; | 
 | 228 | 	object *v, *w, *pt; | 
 | 229 | 	double *pnext; | 
 | 230 | 	if (!getilongarraysize(args, 6, 0, &arg1)) | 
 | 231 | 		return NULL; | 
 | 232 | 	if ((arg2 = NEW(double, arg1 )) == NULL) { | 
 | 233 | 		return err_nomem(); | 
 | 234 | 	} | 
 | 235 | 	if (!getidoublearray(args, 6, 0, arg1 , arg2)) | 
 | 236 | 		return NULL; | 
 | 237 | 	if (!getilongarraysize(args, 6, 1, &arg3)) | 
 | 238 | 		return NULL; | 
 | 239 | 	if ((arg4 = NEW(double, arg3 )) == NULL) { | 
 | 240 | 		return err_nomem(); | 
 | 241 | 	} | 
 | 242 | 	if (!getidoublearray(args, 6, 1, arg3 , arg4)) | 
 | 243 | 		return NULL; | 
 | 244 | 	if (!getilongarg(args, 6, 3, &arg6)) | 
 | 245 | 		return NULL; | 
 | 246 | 	if (!getilongarg(args, 6, 4, &arg7)) | 
 | 247 | 		return NULL; | 
 | 248 | 	if (!getilongarg(args, 6, 5, &arg8)) | 
 | 249 | 		return NULL; | 
 | 250 | 	if (arg8 == N_XYZ) | 
 | 251 | 		ncoords = 3; | 
 | 252 | 	else if (arg8 == N_XYZW) | 
 | 253 | 		ncoords = 4; | 
 | 254 | 	else { | 
 | 255 | 		err_badarg(); | 
 | 256 | 		return NULL; | 
 | 257 | 	} | 
 | 258 | 	s_nctl = arg1 - arg6; | 
 | 259 | 	t_nctl = arg3 - arg7; | 
 | 260 | 	if (!getiobjectarg(args, 6, 2, &v)) | 
 | 261 | 		return NULL; | 
 | 262 | 	if (!is_listobject(v) || getlistsize(v) != s_nctl) { | 
 | 263 | 		err_badarg(); | 
 | 264 | 		return NULL; | 
 | 265 | 	} | 
 | 266 | 	if ((arg5 = NEW(double, s_nctl*t_nctl*ncoords )) == NULL) { | 
 | 267 | 		return err_nomem(); | 
 | 268 | 	} | 
 | 269 | 	pnext = arg5; | 
 | 270 | 	for (s = 0; s < s_nctl; s++) { | 
 | 271 | 		w = getlistitem(v, s); | 
 | 272 | 		if (w == NULL || !is_listobject(w) || | 
 | 273 | 					getlistsize(w) != t_nctl) { | 
 | 274 | 			err_badarg(); | 
 | 275 | 			return NULL; | 
 | 276 | 		} | 
 | 277 | 		for (t = 0; t < t_nctl; t++) { | 
 | 278 | 			pt = getlistitem(w, t); | 
 | 279 | 			if (!getidoublearray(pt, 1, 0, ncoords, pnext)) | 
 | 280 | 				return NULL; | 
 | 281 | 			pnext += ncoords; | 
 | 282 | 		} | 
 | 283 | 	} | 
 | 284 | 	s_byte_stride = sizeof(double) * ncoords; | 
 | 285 | 	t_byte_stride = s_byte_stride * s_nctl; | 
 | 286 | 	nurbssurface( arg1 , arg2 , arg3 , arg4 , | 
 | 287 | 		s_byte_stride , t_byte_stride , arg5 , arg6 , arg7 , arg8 ); | 
 | 288 | 	DEL(arg2); | 
 | 289 | 	DEL(arg4); | 
 | 290 | 	DEL(arg5); | 
 | 291 | 	INCREF(None); | 
 | 292 | 	return None; | 
 | 293 | } | 
 | 294 |  | 
 | 295 | /* nurbscurve(knots, ctlpoints, order, type). | 
 | 296 |    The length of ctlpoints is len(knots)-order. */ | 
 | 297 |  | 
 | 298 | %nurbscurve | 
 | 299 |  | 
 | 300 | static object * | 
 | 301 | gl_nurbscurve(self, args) | 
 | 302 | 	object *self; | 
 | 303 | 	object *args; | 
 | 304 | { | 
 | 305 | 	long arg1 ; | 
 | 306 | 	double * arg2 ; | 
 | 307 | 	long arg3 ; | 
 | 308 | 	double * arg4 ; | 
 | 309 | 	long arg5 ; | 
 | 310 | 	long arg6 ; | 
 | 311 | 	int ncoords, npoints; | 
 | 312 | 	int i; | 
 | 313 | 	object *v; | 
 | 314 | 	double *pnext; | 
 | 315 | 	if (!getilongarraysize(args, 4, 0, &arg1)) | 
 | 316 | 		return NULL; | 
 | 317 | 	if ((arg2 = NEW(double, arg1 )) == NULL) { | 
 | 318 | 		return err_nomem(); | 
 | 319 | 	} | 
 | 320 | 	if (!getidoublearray(args, 4, 0, arg1 , arg2)) | 
 | 321 | 		return NULL; | 
 | 322 | 	if (!getilongarg(args, 4, 2, &arg5)) | 
 | 323 | 		return NULL; | 
 | 324 | 	if (!getilongarg(args, 4, 3, &arg6)) | 
 | 325 | 		return NULL; | 
 | 326 | 	if (arg6 == N_ST) | 
 | 327 | 		ncoords = 2; | 
 | 328 | 	else if (arg6 == N_STW) | 
 | 329 | 		ncoords = 3; | 
 | 330 | 	else { | 
 | 331 | 		err_badarg(); | 
 | 332 | 		return NULL; | 
 | 333 | 	} | 
 | 334 | 	npoints = arg1 - arg5; | 
 | 335 | 	if (!getiobjectarg(args, 4, 1, &v)) | 
 | 336 | 		return NULL; | 
 | 337 | 	if (!is_listobject(v) || getlistsize(v) != npoints) { | 
 | 338 | 		err_badarg(); | 
 | 339 | 		return NULL; | 
 | 340 | 	} | 
 | 341 | 	if ((arg4 = NEW(double, npoints*ncoords )) == NULL) { | 
 | 342 | 		return err_nomem(); | 
 | 343 | 	} | 
 | 344 | 	pnext = arg4; | 
 | 345 | 	for (i = 0; i < npoints; i++) { | 
 | 346 | 		if (!getidoublearray(getlistitem(v, i), 1, 0, ncoords, pnext)) | 
 | 347 | 			return NULL; | 
 | 348 | 		pnext += ncoords; | 
 | 349 | 	} | 
 | 350 | 	arg3 = (sizeof(double)) * ncoords; | 
 | 351 | 	nurbscurve( arg1 , arg2 , arg3 , arg4 , arg5 , arg6 ); | 
 | 352 | 	DEL(arg2); | 
 | 353 | 	DEL(arg4); | 
 | 354 | 	INCREF(None); | 
 | 355 | 	return None; | 
 | 356 | } | 
 | 357 |  | 
 | 358 | /* pwlcurve(points, type). | 
 | 359 |    Points is a list of points. Type must be N_ST. */ | 
 | 360 |  | 
 | 361 | %pwlcurve | 
 | 362 |  | 
 | 363 | static object * | 
 | 364 | gl_pwlcurve(self, args) | 
 | 365 | 	object *self; | 
 | 366 | 	object *args; | 
 | 367 | { | 
 | 368 | 	object *v; | 
 | 369 | 	long type; | 
 | 370 | 	double *data, *pnext; | 
 | 371 | 	long npoints, ncoords; | 
 | 372 | 	int i; | 
 | 373 | 	if (!getiobjectarg(args, 2, 0, &v)) | 
 | 374 | 		return NULL; | 
 | 375 | 	if (!getilongarg(args, 2, 1, &type)) | 
 | 376 | 		return NULL; | 
 | 377 | 	if (!is_listobject(v)) { | 
 | 378 | 		err_badarg(); | 
 | 379 | 		return NULL; | 
 | 380 | 	} | 
 | 381 | 	npoints = getlistsize(v); | 
 | 382 | 	if (type == N_ST) | 
 | 383 | 		ncoords = 2; | 
 | 384 | 	else { | 
 | 385 | 		err_badarg(); | 
 | 386 | 		return NULL; | 
 | 387 | 	} | 
 | 388 | 	if ((data = NEW(double, npoints*ncoords)) == NULL) { | 
 | 389 | 		return err_nomem(); | 
 | 390 | 	} | 
 | 391 | 	pnext = data; | 
 | 392 | 	for (i = 0; i < npoints; i++) { | 
 | 393 | 		if (!getidoublearray(getlistitem(v, i), 1, 0, ncoords, pnext)) | 
 | 394 | 			return NULL; | 
 | 395 | 		pnext += ncoords; | 
 | 396 | 	} | 
 | 397 | 	pwlcurve(npoints, data, sizeof(double)*ncoords, type); | 
 | 398 | 	DEL(data); | 
 | 399 | 	INCREF(None); | 
 | 400 | 	return None; | 
 | 401 | } | 
 | 402 |  | 
 | 403 |  | 
 | 404 | /* Picking and Selecting */ | 
 | 405 |  | 
 | 406 | static short *pickbuffer = NULL; | 
 | 407 | static long pickbuffersize; | 
 | 408 |  | 
 | 409 | static object * | 
 | 410 | pick_select(args, func) | 
 | 411 | 	object *args; | 
 | 412 | 	void (*func)(); | 
 | 413 | { | 
 | 414 | 	if (!getilongarg(args, 1, 0, &pickbuffersize)) | 
 | 415 | 		return NULL; | 
 | 416 | 	if (pickbuffer != NULL) { | 
 | 417 | 		err_setstr(RuntimeError, | 
 | 418 | 			"pick/gselect: already picking/selecting"); | 
 | 419 | 		return NULL; | 
 | 420 | 	} | 
 | 421 | 	if ((pickbuffer = NEW(short, pickbuffersize)) == NULL) { | 
 | 422 | 		return err_nomem(); | 
 | 423 | 	} | 
 | 424 | 	(*func)(pickbuffer, pickbuffersize); | 
 | 425 | 	INCREF(None); | 
 | 426 | 	return None; | 
 | 427 | } | 
 | 428 |  | 
 | 429 | static object * | 
 | 430 | endpick_select(args, func) | 
 | 431 | 	object *args; | 
 | 432 | 	long (*func)(); | 
 | 433 | { | 
 | 434 | 	object *v, *w; | 
 | 435 | 	int i, nhits, n; | 
 | 436 | 	if (!getnoarg(args)) | 
 | 437 | 		return NULL; | 
 | 438 | 	if (pickbuffer == NULL) { | 
 | 439 | 		err_setstr(RuntimeError, | 
 | 440 | 			"endpick/endselect: not in pick/select mode"); | 
 | 441 | 		return NULL; | 
 | 442 | 	} | 
 | 443 | 	nhits = (*func)(pickbuffer); | 
 | 444 | 	if (nhits < 0) { | 
 | 445 | 		nhits = -nhits; /* How to report buffer overflow otherwise? */ | 
 | 446 | 	} | 
 | 447 | 	/* Scan the buffer to see how many integers */ | 
 | 448 | 	n = 0; | 
 | 449 | 	for (; nhits > 0; nhits--) { | 
 | 450 | 		n += 1 + pickbuffer[n]; | 
 | 451 | 	} | 
 | 452 | 	v = newlistobject(n); | 
 | 453 | 	if (v == NULL) | 
 | 454 | 		return NULL; | 
 | 455 | 	/* XXX Could do it nicer and interpret the data structure here, | 
 | 456 | 	   returning a list of lists. But this can be done in Python... */ | 
 | 457 | 	for (i = 0; i < n; i++) { | 
 | 458 | 		w = newintobject((long)pickbuffer[i]); | 
 | 459 | 		if (w == NULL) { | 
 | 460 | 			DECREF(v); | 
 | 461 | 			return NULL; | 
 | 462 | 		} | 
 | 463 | 		setlistitem(v, i, w); | 
 | 464 | 	} | 
 | 465 | 	DEL(pickbuffer); | 
 | 466 | 	pickbuffer = NULL; | 
 | 467 | 	return v; | 
 | 468 | } | 
 | 469 |  | 
 | 470 | extern void pick(), gselect(); | 
 | 471 | extern long endpick(), endselect(); | 
 | 472 |  | 
 | 473 | %pick | 
 | 474 | static object *gl_pick(self, args) object *self, *args; { | 
 | 475 | 	return pick_select(args, pick); | 
 | 476 | } | 
 | 477 |  | 
 | 478 | %endpick | 
 | 479 | static object *gl_endpick(self, args) object *self, *args; { | 
 | 480 | 	return endpick_select(args, endpick); | 
 | 481 | } | 
 | 482 |  | 
 | 483 | %gselect | 
 | 484 | static object *gl_gselect(self, args) object *self, *args; { | 
 | 485 | 	return pick_select(args, gselect); | 
 | 486 | } | 
 | 487 |  | 
 | 488 | %endselect | 
 | 489 | static object *gl_endselect(self, args) object *self, *args; { | 
 | 490 | 	return endpick_select(args, endselect); | 
 | 491 | } | 
 | 492 |  | 
 | 493 |  | 
 | 494 | /* XXX The generator botches this one.  Here's a quick hack to fix it. */ | 
 | 495 |  | 
| Guido van Rossum | b316515 | 1991-08-16 08:59:21 +0000 | [diff] [blame] | 496 | /* XXX The generator botches this one.  Here's a quick hack to fix it. */ | 
 | 497 |  | 
| Guido van Rossum | 85a5fbb | 1990-10-14 12:07:46 +0000 | [diff] [blame] | 498 | % getmatrix float r[16] | 
 | 499 |  | 
 | 500 | static object * | 
 | 501 | gl_getmatrix(self, args) | 
 | 502 | 	object *self; | 
 | 503 | 	object *args; | 
 | 504 | { | 
 | 505 | 	float arg1 [ 16 ] ; | 
 | 506 | 	object *v, *w; | 
 | 507 | 	int i; | 
 | 508 | 	getmatrix( arg1 ); | 
 | 509 | 	v = newlistobject(16); | 
 | 510 | 	if (v == NULL) { | 
 | 511 | 		return err_nomem(); | 
 | 512 | 	} | 
 | 513 | 	for (i = 0; i < 16; i++) { | 
 | 514 | 		w = mknewfloatobject(arg1[i]); | 
 | 515 | 		if (w == NULL) { | 
 | 516 | 			DECREF(v); | 
 | 517 | 			return NULL; | 
 | 518 | 		} | 
 | 519 | 		setlistitem(v, i, w); | 
 | 520 | 	} | 
 | 521 | 	return v; | 
 | 522 | } | 
 | 523 |  | 
| Guido van Rossum | b316515 | 1991-08-16 08:59:21 +0000 | [diff] [blame] | 524 | /* Here's an alternate version that returns a 4x4 matrix instead of | 
 | 525 |    a vector.  Unfortunately it is incompatible with loadmatrix and | 
 | 526 |    multmatrix... */ | 
 | 527 |  | 
 | 528 | % altgetmatrix float r[4][4] | 
 | 529 |  | 
 | 530 | static object * | 
 | 531 | gl_altgetmatrix(self, args) | 
 | 532 | 	object *self; | 
 | 533 | 	object *args; | 
 | 534 | { | 
 | 535 | 	float arg1 [ 4 ] [ 4 ] ; | 
 | 536 | 	object *v, *w; | 
 | 537 | 	int i, j; | 
 | 538 | 	getmatrix( arg1 ); | 
 | 539 | 	v = newlistobject(4); | 
 | 540 | 	if (v == NULL) { | 
 | 541 | 		return NULL; | 
 | 542 | 	} | 
 | 543 | 	for (i = 0; i < 4; i++) { | 
 | 544 | 		w = newlistobject(4); | 
 | 545 | 		if (w == NULL) { | 
 | 546 | 			DECREF(v); | 
 | 547 | 			return NULL; | 
 | 548 | 		} | 
 | 549 | 		setlistitem(v, i, w); | 
 | 550 | 	} | 
 | 551 | 	for (i = 0; i < 4; i++) { | 
 | 552 | 		for (j = 0; j < 4; j++) { | 
 | 553 | 			w = mknewfloatobject(arg1[i][j]); | 
 | 554 | 			if (w == NULL) { | 
 | 555 | 				DECREF(v); | 
 | 556 | 				return NULL; | 
 | 557 | 			} | 
 | 558 | 			setlistitem(getlistitem(v, i), j, w); | 
 | 559 | 		} | 
 | 560 | 	} | 
 | 561 | 	return v; | 
 | 562 | } | 
 | 563 |  | 
| Guido van Rossum | 85a5fbb | 1990-10-14 12:07:46 +0000 | [diff] [blame] | 564 | /* End of manually written stubs */ | 
 | 565 |  | 
 | 566 | %% | 
 | 567 |  | 
 | 568 | long 	getshade | 
 | 569 | void 	devport 	short s long s | 
 | 570 | void 	rdr2i 		long s long s | 
 | 571 | void	rectfs 		short s short s short s short s | 
 | 572 | void 	rects 		short s short s short s short s | 
 | 573 | void 	rmv2i 		long s long s | 
 | 574 | void	noport | 
 | 575 | void	popviewport | 
 | 576 | void	clear | 
 | 577 | void	clearhitcode | 
 | 578 | void	closeobj | 
 | 579 | void	cursoff | 
 | 580 | void	curson | 
 | 581 | void	doublebuffer | 
 | 582 | void 	finish | 
 | 583 | void	gconfig | 
 | 584 | void	ginit | 
 | 585 | void	greset | 
 | 586 | void	multimap | 
 | 587 | void	onemap | 
 | 588 | void	popattributes | 
 | 589 | void	popmatrix | 
 | 590 | void	pushattributes | 
 | 591 | void	pushmatrix | 
 | 592 | void	pushviewport | 
 | 593 | void	qreset | 
 | 594 | void	RGBmode | 
 | 595 | void	singlebuffer | 
 | 596 | void	swapbuffers | 
 | 597 | void	gsync | 
 | 598 | void	tpon | 
 | 599 | void	tpoff | 
 | 600 | void	clkon | 
 | 601 | void	clkoff | 
 | 602 | void	ringbell | 
 | 603 | #void	callfunc | 
 | 604 | void	gbegin | 
 | 605 | void	textinit | 
 | 606 | void	initnames | 
 | 607 | void	pclos | 
 | 608 | void	popname | 
 | 609 | void	spclos | 
 | 610 | void	zclear | 
 | 611 | void	screenspace | 
 | 612 | void	reshapeviewport | 
 | 613 | void	winpush | 
 | 614 | void	winpop | 
 | 615 | void	foreground | 
 | 616 | void	endfullscrn | 
 | 617 | void	endpupmode | 
 | 618 | void	fullscrn | 
 | 619 | void	pupmode | 
 | 620 | void	winconstraints | 
 | 621 | void	pagecolor 	short s | 
 | 622 | void	textcolor 	short s | 
 | 623 | void 	color 	  	short s | 
 | 624 | void	curveit		short s | 
 | 625 | void	font		short s | 
 | 626 | void 	linewidth	short s | 
 | 627 | void    setlinestyle	short s | 
 | 628 | void	setmap		short s | 
 | 629 | void	swapinterval	short s | 
 | 630 | void	writemask	short s | 
 | 631 | void	textwritemask	short s | 
 | 632 | void	qdevice		short s | 
 | 633 | void	unqdevice	short s | 
 | 634 | void	curvebasis	short s | 
 | 635 | void	curveprecision	short s | 
 | 636 | void	loadname	short s | 
 | 637 | void	passthrough	short s | 
 | 638 | void	pushname	short s | 
 | 639 | void	setmonitor	short s | 
 | 640 | void	setshade	short s | 
 | 641 | void	setpattern	short s | 
 | 642 | void	pagewritemask	short s | 
 | 643 | # | 
 | 644 | void	callobj		long s | 
 | 645 | void	delobj		long s | 
 | 646 | void 	editobj		long s | 
 | 647 | void	makeobj		long s | 
 | 648 | void	maketag		long s | 
 | 649 | void	chunksize	long s | 
 | 650 | void	compactify	long s | 
 | 651 | void	deltag		long s | 
 | 652 | void	lsrepeat	long s | 
 | 653 | void	objinsert	long s | 
 | 654 | void 	objreplace	long s | 
 | 655 | void	winclose	long s | 
 | 656 | void	blanktime	long s | 
 | 657 | void 	freepup		long s | 
 | 658 | # This is not in the library!? | 
 | 659 | ###void	pupcolor	long s | 
 | 660 | # | 
 | 661 | void	backbuffer	long s | 
 | 662 | void 	frontbuffer	long s | 
 | 663 | void	lsbackup	long s | 
 | 664 | void	resetls		long s | 
 | 665 | void	lampon		long s | 
 | 666 | void	lampoff		long s | 
 | 667 | void	setbell		long s | 
 | 668 | void	blankscreen	long s | 
 | 669 | void 	depthcue	long s | 
 | 670 | void	zbuffer		long s | 
 | 671 | void	backface	long s | 
 | 672 | # | 
 | 673 | void 	cmov2i		long s long s | 
 | 674 | void 	draw2i		long s long s | 
 | 675 | void	move2i		long s long s | 
 | 676 | void	pnt2i		long s long s | 
 | 677 | void 	patchbasis	long s long s | 
 | 678 | void 	patchprecision	long s long s | 
 | 679 | void	pdr2i		long s long s | 
 | 680 | void	pmv2i		long s long s | 
 | 681 | void	rpdr2i		long s long s | 
 | 682 | void	rpmv2i		long s long s | 
 | 683 | void	xfpt2i		long s long s | 
 | 684 | void	objdelete	long s long s | 
 | 685 | void	patchcurves	long s long s | 
 | 686 | void	minsize		long s long s | 
 | 687 | void 	maxsize		long s long s | 
 | 688 | void	keepaspect	long s long s | 
 | 689 | void	prefsize	long s long s | 
 | 690 | void	stepunit	long s long s | 
 | 691 | void 	fudge		long s long s | 
 | 692 | void 	winmove		long s long s | 
 | 693 | # | 
 | 694 | void 	attachcursor	short s short s | 
 | 695 | void 	deflinestyle	short s short s | 
 | 696 | void 	noise		short s short s | 
 | 697 | void 	picksize	short s short s | 
 | 698 | void 	qenter		short s short s | 
 | 699 | void 	setdepth	short s short s | 
 | 700 | void 	cmov2s		short s short s | 
 | 701 | void 	draw2s		short s	short s | 
 | 702 | void 	move2s		short s short s | 
 | 703 | void 	pdr2s		short s short s | 
 | 704 | void 	pmv2s		short s short s | 
 | 705 | void 	pnt2s		short s short s | 
 | 706 | void 	rdr2s		short s short s | 
 | 707 | void 	rmv2s		short s short s | 
 | 708 | void 	rpdr2s		short s short s | 
 | 709 | void 	rpmv2s		short s short s | 
 | 710 | void 	xfpt2s		short s short s | 
 | 711 | # | 
 | 712 | void cmov2		float s float s | 
 | 713 | void draw2		float s float s | 
 | 714 | void move2		float s float s | 
 | 715 | void pnt2		float s float s | 
 | 716 | void pdr2		float s float s | 
 | 717 | void pmv2		float s float s | 
 | 718 | void rdr2		float s float s | 
 | 719 | void rmv2		float s float s | 
 | 720 | void rpdr2		float s float s | 
 | 721 | void rpmv2		float s float s | 
 | 722 | void xfpt2		float s float s | 
 | 723 | # | 
 | 724 | void loadmatrix		float s[16] | 
| Guido van Rossum | b316515 | 1991-08-16 08:59:21 +0000 | [diff] [blame] | 725 | # Really [4][4] | 
| Guido van Rossum | 85a5fbb | 1990-10-14 12:07:46 +0000 | [diff] [blame] | 726 | void multmatrix		float s[16] | 
| Guido van Rossum | b316515 | 1991-08-16 08:59:21 +0000 | [diff] [blame] | 727 | # Really [4][4] | 
 | 728 | void crv			float s[12] | 
 | 729 | # Really [4][3] | 
| Guido van Rossum | 85a5fbb | 1990-10-14 12:07:46 +0000 | [diff] [blame] | 730 | void rcrv			float s[16] | 
| Guido van Rossum | b316515 | 1991-08-16 08:59:21 +0000 | [diff] [blame] | 731 | # Really [4][4] | 
| Guido van Rossum | 85a5fbb | 1990-10-14 12:07:46 +0000 | [diff] [blame] | 732 | # | 
 | 733 | # Methods that have strings.   | 
 | 734 | # | 
 | 735 | void addtopup		long s char *s long s | 
 | 736 | void charstr		char *s | 
 | 737 | void getport	 	char *s | 
 | 738 | long strwidth		char *s | 
 | 739 | long winopen		char *s | 
 | 740 | void wintitle		char *s | 
 | 741 | # | 
 | 742 | # Methods that have 1 long (# of elements) and an array  | 
 | 743 | # | 
 | 744 | void polf		long s float s[3*arg1] | 
 | 745 | void polf2		long s float s[2*arg1] | 
 | 746 | void poly		long s float s[3*arg1] | 
 | 747 | void poly2		long s float s[2*arg1] | 
 | 748 | void crvn		long s float s[3*arg1] | 
 | 749 | void rcrvn		long s float s[4*arg1] | 
 | 750 | # | 
 | 751 | void polf2i		long s long s[2*arg1] | 
 | 752 | void polfi		long s long s[3*arg1] | 
 | 753 | void poly2i		long s long s[2*arg1] | 
 | 754 | void polyi		long s long s[3*arg1] | 
 | 755 | # | 
 | 756 | void polf2s		long s short s[2*arg1] | 
 | 757 | void polfs		long s short s[3*arg1] | 
 | 758 | void polys		long s short s[3*arg1] | 
 | 759 | void poly2s		long s short s[2*arg1] | 
 | 760 | # | 
| Guido van Rossum | b316515 | 1991-08-16 08:59:21 +0000 | [diff] [blame] | 761 | void defcursor		short s short s[128] | 
 | 762 | # Is this useful? | 
| Guido van Rossum | 85a5fbb | 1990-10-14 12:07:46 +0000 | [diff] [blame] | 763 | void writepixels	short s short s[arg1] | 
| Guido van Rossum | b316515 | 1991-08-16 08:59:21 +0000 | [diff] [blame] | 764 | # Should be unsigned short... | 
| Guido van Rossum | 85a5fbb | 1990-10-14 12:07:46 +0000 | [diff] [blame] | 765 | void defbasis		long s float s[16] | 
 | 766 | void gewrite		short s short s[arg1] | 
 | 767 | # | 
 | 768 | void rotate		short s char s | 
 | 769 | # This is not in the library!? | 
 | 770 | ###void setbutton		short s char s | 
 | 771 | void rot		float s char s | 
 | 772 | # | 
 | 773 | void circfi		long s long s long s | 
 | 774 | void circi		long s long s long s | 
 | 775 | void cmovi		long s long s long s | 
 | 776 | void drawi		long s long s long s | 
 | 777 | void movei		long s long s long s | 
 | 778 | void pnti 		long s long s long s | 
 | 779 | void newtag		long s long s long s | 
 | 780 | void pdri  		long s long s long s | 
 | 781 | void pmvi  		long s long s long s | 
 | 782 | void rdri  		long s long s long s | 
 | 783 | void rmvi  		long s long s long s | 
 | 784 | void rpdri 		long s long s long s | 
 | 785 | void rpmvi 		long s long s long s | 
 | 786 | void xfpti 		long s long s long s | 
 | 787 | # | 
 | 788 | void circ		float s float s float s | 
 | 789 | void circf		float s float s float s | 
 | 790 | void cmov		float s float s float s | 
 | 791 | void draw		float s float s float s | 
 | 792 | void move		float s float s float s | 
 | 793 | void pnt		float s float s float s | 
 | 794 | void scale		float s float s float s | 
 | 795 | void translate		float s float s float s | 
 | 796 | void pdr		float s float s float s | 
 | 797 | void pmv		float s float s float s | 
 | 798 | void rdr		float s float s float s | 
 | 799 | void rmv		float s float s float s | 
 | 800 | void rpdr		float s float s float s | 
 | 801 | void rpmv		float s float s float s | 
 | 802 | void xfpt		float s float s float s | 
 | 803 | # | 
 | 804 | void RGBcolor		short s short s short s | 
 | 805 | void RGBwritemask	short s short s short s | 
 | 806 | void setcursor		short s short s short s | 
 | 807 | void tie		short s short s short s | 
 | 808 | void circfs		short s short s short s | 
 | 809 | void circs		short s short s short s | 
 | 810 | void cmovs		short s short s short s | 
 | 811 | void draws		short s short s short s | 
 | 812 | void moves		short s short s short s | 
 | 813 | void pdrs		short s short s short s | 
 | 814 | void pmvs		short s short s short s | 
 | 815 | void pnts		short s short s short s | 
 | 816 | void rdrs		short s short s short s | 
 | 817 | void rmvs		short s short s short s | 
 | 818 | void rpdrs		short s short s short s | 
 | 819 | void rpmvs		short s short s short s | 
 | 820 | void xfpts		short s short s short s | 
 | 821 | void curorigin		short s short s short s | 
 | 822 | void cyclemap		short s short s short s | 
 | 823 | # | 
 | 824 | void patch		float s[16] float s[16] float s[16] | 
 | 825 | void splf		long s float s[3*arg1] short s[arg1] | 
 | 826 | void splf2		long s float s[2*arg1] short s[arg1] | 
 | 827 | void splfi		long s long s[3*arg1] short s[arg1] | 
 | 828 | void splf2i		long s long s[2*arg1] short s[arg1] | 
 | 829 | void splfs		long s short s[3*arg1] short s[arg1] | 
 | 830 | void splf2s		long s short s[2*arg1] short s[arg1] | 
 | 831 | void defpattern		short s short s short s[arg2*arg2/16] | 
 | 832 | # | 
 | 833 | void rpatch		float s[16] float s[16] float s[16] float s[16] | 
 | 834 | # | 
 | 835 | # routines that send 4 floats | 
 | 836 | # | 
 | 837 | void ortho2		float s float s float s float s | 
 | 838 | void rect		float s float s float s float s | 
 | 839 | void rectf		float s float s float s float s | 
 | 840 | void xfpt4		float s float s float s float s | 
 | 841 | # | 
 | 842 | void textport		short s short s short s short s | 
 | 843 | void mapcolor		short s short s short s short s | 
 | 844 | void scrmask		short s short s short s short s | 
 | 845 | void setvaluator	short s short s short s short s | 
 | 846 | void viewport		short s short s short s short s | 
 | 847 | void shaderange		short s short s short s short s | 
 | 848 | void xfpt4s		short s short s short s short s | 
 | 849 | void rectfi		long s long s long s long s | 
 | 850 | void recti		long s long s long s long s | 
 | 851 | void xfpt4i		long s long s long s long s | 
 | 852 | void prefposition	long s long s long s long s | 
 | 853 | # | 
 | 854 | void arc		float s float s float s short s short s | 
 | 855 | void arcf		float s float s float s short s short s | 
 | 856 | void arcfi		long s long s long s short s short s | 
 | 857 | void arci		long s long s long s short s short s | 
 | 858 | # | 
 | 859 | void bbox2		short s short s float s float s float s float s | 
 | 860 | void bbox2i		short s short s long s long s long s long s | 
 | 861 | void bbox2s		short s short s short s short s short s short s | 
 | 862 | void blink		short s short s short s short s short s | 
 | 863 | void ortho		float s float s float s float s float s float s | 
 | 864 | void window		float s float s float s float s float s float s | 
 | 865 | void lookat		float s float s float s float s float s float s short s | 
 | 866 | # | 
 | 867 | void perspective	short s float s float s float s | 
 | 868 | void polarview		float s short s short s short s | 
 | 869 | # XXX getichararray not supported | 
 | 870 | #void writeRGB		short s char s[arg1] char s[arg1] char s[arg1] | 
 | 871 | # | 
 | 872 | void arcfs		short s short s short s short s short s | 
 | 873 | void arcs		short s short s short s short s short s | 
 | 874 | void rectcopy		short s short s short s short s short s short s | 
 | 875 | void RGBcursor		short s short s short s short s short s short s short s | 
 | 876 | # | 
 | 877 | long getbutton		short s | 
 | 878 | long getcmmode | 
 | 879 | long getlsbackup | 
 | 880 | long getresetls | 
 | 881 | long getdcm | 
 | 882 | long getzbuffer | 
 | 883 | long ismex | 
 | 884 | long isobj		long s | 
 | 885 | long isqueued		short s | 
 | 886 | long istag		long s | 
 | 887 | # | 
 | 888 | long genobj | 
 | 889 | long gentag | 
 | 890 | long getbuffer | 
 | 891 | long getcolor | 
 | 892 | long getdisplaymode | 
 | 893 | long getfont | 
 | 894 | long getheight | 
 | 895 | long gethitcode | 
 | 896 | long getlstyle | 
 | 897 | long getlwidth | 
 | 898 | long getmap | 
 | 899 | long getplanes | 
 | 900 | long getwritemask | 
 | 901 | long qtest | 
 | 902 | long getlsrepeat | 
 | 903 | long getmonitor | 
 | 904 | long getopenobj | 
 | 905 | long getpattern | 
 | 906 | long winget | 
 | 907 | long winattach | 
 | 908 | long getothermonitor | 
 | 909 | long newpup | 
 | 910 | # | 
 | 911 | long getvaluator	short s | 
 | 912 | void winset		long s | 
 | 913 | long dopup		long s | 
 | 914 | void getdepth		short r short r | 
 | 915 | void getcpos		short r short r | 
 | 916 | void getsize		long r long r | 
 | 917 | void getorigin		long r long r | 
 | 918 | void getviewport	short r short r short r short r | 
 | 919 | void gettp		short r short r short r short r | 
 | 920 | void getgpos		float r float r float r float r | 
 | 921 | void winposition	long s long s long s long s | 
 | 922 | void gRGBcolor		short r short r short r | 
 | 923 | void gRGBmask		short r short r short r | 
 | 924 | void getscrmask	short r short r short r short r | 
 | 925 | void gRGBcursor	short r short r short r short r short r short r short r short r long * | 
 | 926 | void getmcolor		short s short r short r short r | 
 | 927 | void mapw		long s short s short s float r float r float r float r float r float r | 
 | 928 | void mapw2		long s short s short s float r float r | 
 | 929 | void defrasterfont	short s short s short s Fontchar s[arg3] short s short s[4*arg5] | 
 | 930 | long qread		short r | 
 | 931 | void getcursor		short r short r short r long r | 
 | 932 | # | 
 | 933 | #   For these we receive arrays of stuff | 
 | 934 | # | 
 | 935 | void getdev 		long s short s[arg1] short r[arg1] | 
 | 936 | #XXX not generated correctly yet | 
 | 937 | #void getmatrix		float r[16] | 
 | 938 | long readpixels		short s short r[retval] | 
 | 939 | long readRGB		short s char r[retval] char r[retval] char r[retval] | 
 | 940 | long blkqread		short s short r[arg1] | 
 | 941 | # | 
 | 942 | #   New 4D routines | 
 | 943 | # | 
 | 944 | void cmode | 
 | 945 | void concave		long s | 
 | 946 | void curstype		long s | 
 | 947 | void drawmode		long s | 
 | 948 | void gammaramp		short s[256] short s[256] short s[256] | 
 | 949 | long getbackface | 
 | 950 | long getdescender | 
 | 951 | long getdrawmode | 
 | 952 | long getmmode | 
 | 953 | long getsm | 
 | 954 | long getvideo		long s | 
 | 955 | void imakebackground | 
 | 956 | void lmbind		short s short s | 
 | 957 | void lmdef		long s long s long s float s[arg3] | 
 | 958 | void mmode		long s | 
 | 959 | void normal		float s[3] | 
 | 960 | void overlay		long s | 
 | 961 | void RGBrange		short s short s short s short s short s short s short s short s | 
 | 962 | void setvideo 		long s long s | 
 | 963 | void shademodel		long s | 
 | 964 | void underlay		long s | 
 | 965 | # | 
 | 966 | # New Personal Iris/GT Routines | 
 | 967 | # | 
 | 968 | void bgnclosedline | 
 | 969 | void bgnline | 
 | 970 | void bgnpoint | 
 | 971 | void bgnpolygon | 
 | 972 | void bgnsurface | 
 | 973 | void bgntmesh | 
 | 974 | void bgntrim | 
 | 975 | void endclosedline | 
 | 976 | void endline | 
 | 977 | void endpoint | 
 | 978 | void endpolygon | 
 | 979 | void endsurface | 
 | 980 | void endtmesh | 
 | 981 | void endtrim | 
 | 982 | void blendfunction	long s long s | 
 | 983 | void c3f		float s[3] | 
 | 984 | void c3i		long  s[3] | 
 | 985 | void c3s		short s[3] | 
 | 986 | void c4f		float s[4] | 
 | 987 | void c4i		long  s[4] | 
 | 988 | void c4s		short s[4] | 
 | 989 | void colorf		float s | 
 | 990 | void cpack		long s | 
 | 991 | void czclear		long s long s | 
 | 992 | void dglclose		long s | 
 | 993 | long dglopen		char *s long s | 
 | 994 | long getgdesc		long s | 
 | 995 | void getnurbsproperty	long s float r | 
 | 996 | void glcompat		long s long s | 
 | 997 | void iconsize 		long s long s | 
 | 998 | void icontitle		char *s | 
 | 999 | void lRGBrange		short s short s short s short s short s short s long s long s | 
 | 1000 | void linesmooth		long s | 
 | 1001 | void lmcolor		long s | 
 | 1002 | void logicop		long s | 
 | 1003 | long lrectread	 	short s short s short s short s long r[retval] | 
 | 1004 | void lrectwrite		short s short s short s short s long s[(arg2-arg1+1)*(arg4-arg3+1)] | 
 | 1005 | long rectread	 	short s short s short s short s short r[retval] | 
 | 1006 | void rectwrite		short s short s short s short s short s[(arg2-arg1+1)*(arg4-arg3+1)] | 
 | 1007 | void lsetdepth		long s long s | 
 | 1008 | void lshaderange	short s short s long s long s | 
 | 1009 | void n3f		float s[3] | 
 | 1010 | void noborder | 
 | 1011 | void pntsmooth		long s | 
 | 1012 | void readsource		long s | 
 | 1013 | void rectzoom		float s float s | 
 | 1014 | void sbox		float s float s float s float s | 
 | 1015 | void sboxi		long s long s long s long s | 
 | 1016 | void sboxs		short s short s short s short s | 
 | 1017 | void sboxf		float s float s float s float s | 
 | 1018 | void sboxfi		long s long s long s long s | 
 | 1019 | void sboxfs		short s short s short s short s | 
 | 1020 | void setnurbsproperty	long s float s | 
 | 1021 | void setpup 		long s long s long s | 
 | 1022 | void smoothline		long s | 
 | 1023 | void subpixel		long s | 
 | 1024 | void swaptmesh | 
 | 1025 | long swinopen		long s | 
 | 1026 | void v2f		float s[2] | 
 | 1027 | void v2i		long  s[2] | 
 | 1028 | void v2s		short s[2] | 
 | 1029 | void v3f		float s[3] | 
 | 1030 | void v3i		long  s[3] | 
 | 1031 | void v3s		short s[3] | 
 | 1032 | void v4f		float s[4] | 
 | 1033 | void v4i		long  s[4] | 
 | 1034 | void v4s		short s[4] | 
 | 1035 | void videocmd		long s | 
 | 1036 | long windepth		long s | 
 | 1037 | void wmpack		long s | 
 | 1038 | void zdraw		long s | 
 | 1039 | void zfunction		long s | 
 | 1040 | void zsource		long s | 
 | 1041 | void zwritemask		long s | 
 | 1042 | # | 
 | 1043 | #   uses doubles | 
 | 1044 | # | 
 | 1045 | void v2d		double s[2] | 
 | 1046 | void v3d		double s[3] | 
 | 1047 | void v4d		double s[4] |