[m-rev.] diff: use IO tabling in OpenGL binding

Julien Fischer juliensf at cs.mu.OZ.AU
Thu Aug 4 19:34:20 AEST 2005


Estimated hours taken: 0.5
Branches: main

Table IO primitives in the OpenGL binding.

extras/graphics/mercury_opengl/mglu.m:
extras/graphics/mercury_opengl/mogl.m:
	Add 'tabled_for_io' attributes to the IO primitives
	in this modules.

	Add 'will_not_throw_exception' attributes to a couple
	of procedures where it is applicable.

Julien.

Index: mglu.m
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/graphics/mercury_opengl/mglu.m,v
retrieving revision 1.8
diff -u -r1.8 mglu.m
--- mglu.m	29 Jun 2005 05:21:43 -0000	1.8
+++ mglu.m	4 Aug 2005 09:22:53 -0000
@@ -112,7 +112,7 @@
 :- pragma foreign_proc("C",
 	look_at(Ex::in, Ey::in, Ez::in, Cx::in, Cy::in, Cz::in, Ux::in, Uy::in,
 		Uz::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	gluLookAt((GLdouble) Ex, (GLdouble) Ey, (GLdouble) Ez,
 		(GLdouble) Cx, (GLdouble) Cy, (GLdouble) Cz,
@@ -122,7 +122,7 @@

 :- pragma foreign_proc("C",
 	perspective(Fovy::in, Asp::in, N::in, F::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	gluPerspective((GLdouble) Fovy, (GLdouble) Asp,
 		(GLdouble) N, (GLdouble) F);
@@ -132,7 +132,7 @@

 :- pragma foreign_proc("C",
 	ortho_2d(Left::in, Right::in, Bottom::in, Top::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	gluOrtho2D((GLdouble) Left, (GLdouble) Right, (GLdouble) Bottom,
 		(GLdouble) Top);
@@ -207,7 +207,7 @@

 :- pragma foreign_proc("C",
 	new_quadric(Q::out, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	Q = gluNewQuadric();
 	gluQuadricCallback(Q, GLU_ERROR, (void *)MGLU_quadric_error_callback);
@@ -229,7 +229,7 @@

 :- pragma foreign_proc("C",
 	delete_quadric(Q::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	gluDeleteQuadric(Q);
 	IO = IO0;
@@ -241,7 +241,7 @@
 :- pred quadric_draw_style2(quadric::in, int::in, io::di, io::uo) is det.
 :- pragma foreign_proc("C",
 	quadric_draw_style2(Q::in, S::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	gluQuadricDrawStyle(Q, quadric_draw_style_flags[S]);
 	IO = IO0;
@@ -253,7 +253,7 @@
 :- pred quadric_orientation2(quadric::in, int::in, io::di, io::uo) is det.
 :- pragma foreign_proc("C",
 	quadric_orientation2(Q::in, O::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	gluQuadricOrientation(Q, quadric_orientation_flags[O]);
 	IO = IO0;
@@ -265,7 +265,7 @@
 :- pred quadric_normals2(quadric::in, int::in, io::di, io::uo) is det.
 :- pragma foreign_proc("C",
 	quadric_normals2(Q::in, N::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	gluQuadricNormals(Q, quadric_normals_flags[N]);
 	IO = IO0;
@@ -277,7 +277,7 @@
 :- pred quadric_texture2(quadric::in, int::in, io::di, io::uo) is det.
 :- pragma foreign_proc("C",
 	quadric_texture2(Q::in, B::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	gluQuadricTexture(Q, B);
 	IO = IO0;
@@ -285,7 +285,7 @@

 :- pragma foreign_proc("C",
 	cylinder(Q::in, BR::in, TR::in, H::in, SL::in, ST::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	gluCylinder(Q, BR, TR, H, SL, ST);
 	IO = IO0;
@@ -293,7 +293,7 @@

 :- pragma foreign_proc("C",
 	sphere(Q::in, R::in, SL::in, ST::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	gluSphere(Q, R, SL, ST);
 	IO = IO0;
@@ -301,7 +301,7 @@

 :- pragma foreign_proc("C",
 	disk(Q::in, IR::in, OR::in, S::in, L::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	gluDisk(Q, IR, OR, S, L);
 	IO = IO0;
@@ -310,7 +310,7 @@
 :- pragma foreign_proc("C",
 	partial_disk(Q::in, IR::in, OR::in, S::in, L::in, STA::in, SWA::in,
 		IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	gluPartialDisk(Q, IR, OR, S, L, STA, SWA);
 	IO = IO0;
Index: mogl.m
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/graphics/mercury_opengl/mogl.m,v
retrieving revision 1.17
diff -u -r1.17 mogl.m
--- mogl.m	29 Jun 2005 05:21:43 -0000	1.17
+++ mogl.m	4 Aug 2005 09:25:41 -0000
@@ -1188,7 +1188,7 @@
 :- pred get_error_2(int::out, io::di, io::uo) is det.
 :- pragma foreign_proc("C",
 	get_error_2(Err::out, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "{
 	GLenum err;
 	MR_Integer i;
@@ -1248,7 +1248,7 @@
 :- pred begin_2(int::in, io::di, io::uo) is det.
 :- pragma foreign_proc("C",
 	begin_2(Mode::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	glBegin(block_mode_flags[Mode]);
 	IO = IO0;
@@ -1256,7 +1256,7 @@

 :- pragma foreign_proc("C",
 	end(IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	glEnd();
 	IO = IO0;
@@ -1270,7 +1270,7 @@
 :- pred edge_flag_2(int::in, io::di, io::uo) is det.
 :- pragma foreign_proc("C",
 	edge_flag_2(F::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	glEdgeFlag((GLboolean) F);
 	IO = IO0;
@@ -1283,7 +1283,7 @@

 :- pragma foreign_proc("C",
 	vertex2(X::in, Y::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	if (sizeof(MR_Float) == sizeof(GLfloat)) {
 		glVertex2f((GLfloat) X, (GLfloat) Y);
@@ -1295,7 +1295,7 @@

 :- pragma foreign_proc("C",
 	vertex3(X::in, Y::in, Z::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	if (sizeof(MR_Float) == sizeof(GLfloat)) {
 		glVertex3f((GLfloat) X, (GLfloat) Y, (GLfloat) Z);
@@ -1307,7 +1307,7 @@

 :- pragma foreign_proc("C",
 	vertex4(X::in, Y::in, Z::in, W::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	if (sizeof(MR_Float) == sizeof(GLfloat)) {
 		glVertex4f((GLfloat) X, (GLfloat) Y, (GLfloat) Z, (GLfloat) W);
@@ -1320,7 +1320,7 @@

 :- pragma foreign_proc("C",
 	rect(X1::in, Y1::in, X2::in, Y2::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	if (sizeof(MR_Float) == sizeof(GLfloat)) {
 		glRectf((GLfloat) X1, (GLfloat) Y1, (GLfloat) X2, (GLfloat) Y2);
@@ -1335,7 +1335,7 @@

 :- pragma foreign_proc("C",
 	tex_coord1(X::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	if (sizeof(MR_Float) == sizeof(GLfloat)) {
 		glTexCoord1f((GLfloat) X);
@@ -1347,7 +1347,7 @@

 :- pragma foreign_proc("C",
 	tex_coord2(X::in, Y::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	if (sizeof(MR_Float) == sizeof(GLfloat)) {
 		glTexCoord2f((GLfloat) X, (GLfloat) Y);
@@ -1359,7 +1359,7 @@

 :- pragma foreign_proc("C",
 	tex_coord3(X::in, Y::in, Z::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	if (sizeof(MR_Float) == sizeof(GLfloat)) {
 		glTexCoord3f((GLfloat) X, (GLfloat) Y, (GLfloat) Z);
@@ -1371,7 +1371,7 @@

 :- pragma foreign_proc("C",
 	tex_coord4(X::in, Y::in, Z::in, W::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	if (sizeof(MR_Float) == sizeof(GLfloat)) {
 		glTexCoord4f((GLfloat) X, (GLfloat) Y, (GLfloat) Z,
@@ -1387,7 +1387,7 @@

 :- pragma foreign_proc("C",
 	normal3(X::in, Y::in, Z::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	if (sizeof(MR_Float) == sizeof(GLfloat)) {
 		glNormal3f((GLfloat) X, (GLfloat) Y, (GLfloat) Z);
@@ -1401,7 +1401,7 @@

 :- pragma foreign_proc("C",
 	color3(R::in, G::in, B::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	if (sizeof(MR_Float) == sizeof(GLfloat)) {
 		glColor3f((GLfloat) R, (GLfloat) G, (GLfloat) B);
@@ -1413,7 +1413,7 @@

 :- pragma foreign_proc("C",
 	color4(R::in, G::in, B::in, A::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	if (sizeof(MR_Float) == sizeof(GLfloat)) {
 		glColor4f((GLfloat) R, (GLfloat) G, (GLfloat) B, (GLfloat) A);
@@ -1426,7 +1426,7 @@

 :- pragma foreign_proc("C",
 	index(I::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	if (sizeof(MR_Float) == sizeof(GLfloat)) {
 		glIndexf((GLfloat) I);
@@ -1443,7 +1443,7 @@

 :- pragma foreign_proc("C",
 	depth_range(Near::in, Far::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	glDepthRange((GLclampd) Near, (GLclampd) Far);
 	IO = IO0;
@@ -1451,7 +1451,7 @@

 :- pragma foreign_proc("C",
 	viewport(X::in, Y::in, Wdth::in, Hght::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	glViewport((GLint) X, (GLint) Y, (GLsizei) Wdth, (GLsizei) Hght);
 	IO = IO0;
@@ -1503,7 +1503,7 @@
 :- pred get_matrix_mode_2(int::out, io::di, io::uo) is det.
 :- pragma foreign_proc("C",
 	get_matrix_mode_2(Matrix::out, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io,  promise_pure],
 "{
 	GLint v;

@@ -1533,7 +1533,7 @@
 		A5::in, A6::in, A7::in, A8::in,
 		A9::in, A10::in, A11::in, A12::in,
 		A13::in, A14::in, A15::in, A16::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	if (sizeof(MR_Float) == sizeof(GLfloat)) {
 		GLfloat	a[16];
@@ -1584,7 +1584,7 @@
 		A5::in, A6::in, A7::in, A8::in,
 		A9::in, A10::in, A11::in, A12::in,
 		A13::in, A14::in, A15::in, A16::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	if (sizeof(MR_Float) == sizeof(GLfloat)) {
 		GLfloat	a[16];
@@ -1616,7 +1616,7 @@

 :- pragma foreign_proc("C",
 	load_identity(IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	glLoadIdentity();
 	IO = IO0;
@@ -1624,7 +1624,7 @@

 :- pragma foreign_proc("C",
 	rotate(Theta::in, X::in, Y::in, Z::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	if (sizeof(MR_Float) == sizeof(GLfloat)) {
 		glRotatef((GLfloat) Theta,
@@ -1638,7 +1638,7 @@

 :- pragma foreign_proc("C",
 	translate(X::in, Y::in, Z::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	if (sizeof(MR_Float) == sizeof(GLfloat)) {
 		glTranslatef((GLfloat) X, (GLfloat) Y, (GLfloat) Z);
@@ -1650,7 +1650,7 @@

 :- pragma foreign_proc("C",
 	scale(X::in, Y::in, Z::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	if (sizeof(MR_Float) == sizeof(GLfloat)) {
 		glScalef((GLfloat) X, (GLfloat) Y, (GLfloat) Z);
@@ -1662,7 +1662,7 @@

 :- pragma foreign_proc("C",
 	frustum(L::in, R::in, B::in, T::in, N::in, F::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	glFrustum((GLdouble) L, (GLdouble) R, (GLdouble) B,
 		(GLdouble) T, (GLdouble) N, (GLdouble) F);
@@ -1671,7 +1671,7 @@

 :- pragma foreign_proc("C",
 	ortho(L::in, R::in, B::in, T::in, N::in, F::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	glOrtho((GLdouble) L, (GLdouble) R, (GLdouble) B,
 		(GLdouble) T, (GLdouble) N, (GLdouble) F);
@@ -1680,7 +1680,7 @@

 :- pragma foreign_proc("C",
 	push_matrix(IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	glPushMatrix();
 	IO = IO0;
@@ -1688,7 +1688,7 @@

 :- pragma foreign_proc("C",
 	pop_matrix(IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	glPopMatrix();
 	IO = IO0;
@@ -1706,7 +1706,7 @@
 	io::di, io::uo) is det.
 :- pragma foreign_proc("C",
 	clip_plane_2(I::in, X::in, Y::in, Z::in, W::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "{
 	GLdouble p[4];

@@ -1725,7 +1725,7 @@

 :- pragma foreign_proc("C",
 	raster_pos2(X::in, Y::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	if (sizeof(MR_Float) == sizeof(GLfloat)) {
 		glRasterPos2f((GLfloat) X, (GLfloat) Y);
@@ -1737,7 +1737,7 @@

 :- pragma foreign_proc("C",
 	raster_pos3(X::in, Y::in, Z::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	if (sizeof(MR_Float) == sizeof(GLfloat)) {
 		glRasterPos3f((GLfloat) X, (GLfloat) Y, (GLfloat) Z);
@@ -1749,7 +1749,7 @@

 :- pragma foreign_proc("C",
 	raster_pos4(X::in, Y::in, Z::in, W::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	if (sizeof(MR_Float) == sizeof(GLfloat)) {
 		glRasterPos4f((GLfloat) X, (GLfloat) Y, (GLfloat) Z,
@@ -1846,7 +1846,7 @@
 :- pred front_face2(int::in, io::di, io::uo) is det.
 :- pragma foreign_proc("C",
 	front_face2(F::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	glFrontFace(face_direction_flags[F]);
 	IO = IO0;
@@ -1871,7 +1871,7 @@
 	float::in, io::di, io::uo) is det.
 :- pragma foreign_proc("C",
 	material_ambient(F::in, R::in, G::in, B::in, A::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "{
 	GLfloat	params[4];

@@ -1887,7 +1887,7 @@
 	io::di, io::uo) is det.
 :- pragma foreign_proc("C",
 	material_diffuse(F::in, R::in, G::in, B::in, A::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "{
 	GLfloat	params[4];

@@ -1904,7 +1904,7 @@
 :- pragma foreign_proc("C",
 	material_ambient_and_diffuse(F::in, R::in, G::in, B::in, A::in, IO0::di,
 		IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "{
 	GLfloat	params[4];

@@ -1920,7 +1920,7 @@
 	io::di, io::uo) is det.
 :- pragma foreign_proc("C",
 	material_specular(F::in, R::in, G::in, B::in, A::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "{
 	GLfloat	params[4];

@@ -1936,7 +1936,7 @@
 	io::di, io::uo) is det.
 :- pragma foreign_proc("C",
 	material_emission(F::in, R::in, G::in, B::in, A::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "{
 	GLfloat	params[4];

@@ -1951,7 +1951,7 @@
 :- pred material_shininess(int::in, float::in, io::di, io::uo) is det.
 :- pragma foreign_proc("C",
 	material_shininess(F::in, S::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "{
 	glMaterialf(face_side_flags[F], GL_SHININESS, (GLfloat) S);
 	IO = IO0;
@@ -1961,7 +1961,7 @@
 	io::di, io::uo) is det.
 :- pragma foreign_proc("C",
 	material_color_indexes(F::in, R::in, G::in, B::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "{
 	GLfloat	params[3];

@@ -1997,7 +1997,7 @@
 	io::di, io::uo) is det.
 :- pragma foreign_proc("C",
 	light_ambient(F::in, R::in, G::in, B::in, A::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "{
 	GLfloat	params[4];

@@ -2013,7 +2013,7 @@
 	io::di, io::uo) is det.
 :- pragma foreign_proc("C",
 	light_diffuse(F::in, R::in, G::in, B::in, A::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "{
 	GLfloat	params[4];

@@ -2029,7 +2029,7 @@
 	io::di, io::uo) is det.
 :- pragma foreign_proc("C",
 	light_specular(F::in, R::in, G::in, B::in, A::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "{
 	GLfloat	params[4];

@@ -2045,7 +2045,7 @@
 	io::di, io::uo) is det.
 :- pragma foreign_proc("C",
 	light_position(F::in, X::in, Y::in, Z::in, W::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "{
 	GLfloat	params[4];

@@ -2061,7 +2061,7 @@
 	io::uo) is det.
 :- pragma foreign_proc("C",
 	light_spot_direction(F::in, I::in, J::in, K::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "{
 	GLfloat	params[3];

@@ -2075,7 +2075,7 @@
 :- pred light_spot_exponent(int::in, float::in, io::di, io::uo) is det.
 :- pragma foreign_proc("C",
 	light_spot_exponent(F::in, E::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "{
 	glLightf(F + GL_LIGHT0, GL_SPOT_EXPONENT, (GLfloat) E);
 	IO = IO0;
@@ -2084,7 +2084,7 @@
 :- pred light_spot_cutoff(int::in, float::in, io::di, io::uo) is det.
 :- pragma foreign_proc("C",
 	light_spot_cutoff(F::in, E::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "{
 	glLightf(F + GL_LIGHT0, GL_SPOT_CUTOFF, (GLfloat) E);
 	IO = IO0;
@@ -2093,7 +2093,7 @@
 :- pred light_constant_attenuation(int::in, float::in, io::di, io::uo) is det.
 :- pragma foreign_proc("C",
 	light_constant_attenuation(F::in, E::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "{
 	glLightf(F + GL_LIGHT0, GL_CONSTANT_ATTENUATION, (GLfloat) E);
 	IO = IO0;
@@ -2102,7 +2102,7 @@
 :- pred light_linear_attenuation(int::in, float::in, io::di, io::uo) is det.
 :- pragma foreign_proc("C",
 	light_linear_attenuation(F::in, E::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "{
 	glLightf(F + GL_LIGHT0, GL_LINEAR_ATTENUATION, (GLfloat) E);
 	IO = IO0;
@@ -2112,7 +2112,7 @@
 	is det.
 :- pragma foreign_proc("C",
 	light_quadratic_attenuation(F::in, E::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "{
 	glLightf(F + GL_LIGHT0, GL_QUADRATIC_ATTENUATION, (GLfloat) E);
 	IO = IO0;
@@ -2134,7 +2134,7 @@
 	io::uo) is det.
 :- pragma foreign_proc("C",
 	light_model_ambient(R::in, G::in, B::in, A::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "{
 	GLfloat params[4];

@@ -2149,7 +2149,7 @@
 :- pred light_model_local_viewer(int::in, io::di, io::uo) is det.
 :- pragma foreign_proc("C",
 	light_model_local_viewer(F::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "{
 	glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, (GLint) F);
 	IO = IO0;
@@ -2158,7 +2158,7 @@
 :- pred light_model_two_side(int::in, io::di, io::uo) is det.
 :- pragma foreign_proc("C",
 	light_model_two_side(F::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "{
 	glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, (GLint) F);
 	IO = IO0;
@@ -2171,7 +2171,7 @@
 :- pred color_material2(int::in, int::in, io::di, io::uo) is det.
 :- pragma foreign_proc("C",
 	color_material2(Face::in, Mode::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	glColorMaterial(face_side_flags[Face], color_material_mode_flags[Mode]);
 	IO = IO0;
@@ -2184,7 +2184,7 @@
 :- pred shade_model_2(int::in, io::di, io::uo) is det.
 :- pragma foreign_proc("C",
 	shade_model_2(Model::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	glShadeModel(shade_model_flags[Model]);
 	IO = IO0;
@@ -2201,7 +2201,7 @@
 :- pred get_shade_model_2(int::out, io::di, io::uo) is det.
 :- pragma foreign_proc("C",
 	get_shade_model_2(Value::out, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "{
 	GLint v;

@@ -2217,7 +2217,7 @@

 :- pragma foreign_proc("C",
 	point_size(Size::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	glPointSize((GLfloat) Size);
 	IO = IO0;
@@ -2230,7 +2230,7 @@

 :- pragma foreign_proc("C",
 	line_width(Size::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	glLineWidth((GLfloat) Size);
 	IO = IO0;
@@ -2238,7 +2238,7 @@

 :- pragma foreign_proc("C",
 	line_stipple(Fac::in, Pat::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	glLineStipple((GLint) Fac, (GLushort) Pat);
 	IO = IO0;
@@ -2273,7 +2273,7 @@
 :- pred cull_face2(int::in, io::di, io::uo) is det.
 :- pragma foreign_proc("C",
 	cull_face2(F::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	glCullFace(face_side_flags[F]);
 	IO = IO0;
@@ -2291,7 +2291,7 @@
 :- pred polygon_mode2(int::in, int::in, io::di, io::uo) is det.
 :- pragma foreign_proc("C",
 	polygon_mode2(Face::in, Mode::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	glPolygonMode(face_side_flags[Face], polygon_mode_flags[Mode]);
 	IO = IO0;
@@ -2299,7 +2299,7 @@

 :- pragma foreign_proc("C",
 	polygon_offset(Fac::in, Units::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	glPolygonOffset((GLfloat) Fac, (GLfloat) Units);
 	IO = IO0;
@@ -2362,7 +2362,7 @@
 :- pred pixel_store_2(int::in, int::in, io::di, io::uo) is det.
 :- pragma foreign_proc("C",
 	pixel_store_2(PName::in, Param::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	glPixelStorei(pixel_store_parameter_flags[PName], (GLint) Param);
 	IO = IO0;
@@ -2370,7 +2370,7 @@

 :- pragma foreign_proc("C",
 	pixel_zoom(X::in, Y::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io,  promise_pure],
 "
 	glPixelZoom((GLfloat) X, (GLfloat) Y);
 	IO = IO0;
@@ -2430,7 +2430,7 @@
 :- pred pixel_transferi(int::in, int::in, io::di, io::uo) is det.
 :- pragma foreign_proc("C",
 	pixel_transferi(Pname::in, Param::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	glPixelTransferi(pixel_transfer_mode_flags[Pname], Param);
 	IO = IO0;
@@ -2439,7 +2439,7 @@
 :- pred pixel_transferf(int::in, float::in, io::di, io::uo) is det.
 :- pragma foreign_proc("C",
 	pixel_transferf(Pname::in, Param::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	glPixelTransferf(pixel_transfer_mode_flags[Pname], (GLfloat) Param);
 	IO = IO0;
@@ -2454,7 +2454,7 @@
 :- pragma foreign_proc("C",
 	copy_pixels_2(X::in, Y::in, W::in, H::in, WhatFlag::in,
 		IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	glCopyPixels((GLint) X, (GLint) Y, (GLsizei) W, (GLsizei) H,
 		copy_type_flags[WhatFlag]);
@@ -2494,7 +2494,7 @@
 :- pred read_buffer_2(int::in, int::in, io::di, io::uo) is det.
 :- pragma foreign_proc("C",
 	read_buffer_2(BufferFlag::in, Offset::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	glReadBuffer(buffer_flags[BufferFlag] + Offset);
 	IO = IO0;
@@ -2737,7 +2737,7 @@
 :- pred tex_parameter_wrap(int::in, int::in, int::in, io::di, io::uo) is det.
 :- pragma foreign_proc("C",
 	tex_parameter_wrap(Target::in, Pname::in, Param::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	glTexParameteri(texture_target_flags[Target],
 		texture_parameter_flags[Pname], wrap_mode_flags[Param]);
@@ -2747,7 +2747,7 @@
 :- pred tex_parameter_filter(int::in, int::in, int::in, io::di, io::uo) is det.
 :- pragma foreign_proc("C",
 	tex_parameter_filter(Target::in, Pname::in, Param::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	glTexParameteri(texture_target_flags[Target],
 		texture_parameter_flags[Pname], filter_method_flags[Param]);
@@ -2759,7 +2759,7 @@
 :- pragma foreign_proc("C",
 	tex_parameter_border_color(Target::in, Red::in, Blue::in, Green::in,
 		Alpha::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "{

 	GLfloat border_color[4] = {
@@ -2777,7 +2777,7 @@
 :- pred tex_parameter_priority(int::in, float::in, io::di, io::uo) is det.
 :- pragma foreign_proc("C",
 	tex_parameter_priority(Target::in, Priority::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	glTexParameterf(texture_target_flags[Target], GL_TEXTURE_PRIORITY,
 		(GLfloat) Priority);
@@ -2791,7 +2791,7 @@
 :- pred bind_texture_2(int::in, int::in, io::di, io::uo) is det.
 :- pragma foreign_proc("C",
 	bind_texture_2(Target::in, TexName::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	glBindTexture(texture_target_flags[Target], (GLuint) TexName);
 	IO = IO0;
@@ -2806,7 +2806,8 @@
 	io::uo) is det.
 :- pragma foreign_proc("C",
 	delete_textures_2(Textures::in, NumTextures::in, IO0::di, IO::uo),
-	[may_call_mercury, promise_pure, terminates],
+	[may_call_mercury, promise_pure, tabled_for_io, terminates,
+		will_not_throw_exception],
 "
 {
 	GLuint *textures;
@@ -2829,7 +2830,8 @@

 :- pragma foreign_proc("C",
 	gen_textures(Num::in, Textures::out, IO0::di, IO::uo),
-	[may_call_mercury, promise_pure, terminates],
+	[may_call_mercury, promise_pure, tabled_for_io, terminates,
+		will_not_throw_exception],
 "
 {
 	GLuint *new_textures;
@@ -2853,7 +2855,7 @@

 :- pragma foreign_proc("C",
 	is_texture(Name::in, IsTexture::out, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	if (glIsTexture(Name)) {
 		IsTexture = MR_YES;
@@ -2891,7 +2893,7 @@
 :- pred tex_env_mode(int::in, io::di, io::uo) is det.
 :- pragma foreign_proc("C",
 	tex_env_mode(Param::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE,
 		texture_function_flags[Param]);
@@ -2902,7 +2904,7 @@
 	io::uo) is det.
 :- pragma foreign_proc("C",
 	tex_env_color(Red::in, Green::in, Blue::in, Alpha::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 {
 	GLfloat env_color[] = {
@@ -2965,7 +2967,7 @@
 :- pred tex_geni(int::in, int::in, io::di, io::uo) is det.
 :- pragma foreign_proc("C",
 	tex_geni(Coord::in, Param::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	glTexGeni(texture_coord_flags[Coord], GL_TEXTURE_GEN_MODE,
 		texture_gen_function_flags[Param]);
@@ -2977,7 +2979,7 @@
 :- pragma foreign_proc("C",
 	tex_genf_object_plane(Coord::in, X::in, Y::in, Z::in, W::in, IO0::di,
 		IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	if (sizeof(MR_Float) == sizeof(GLfloat)) {
 		GLfloat coefficients[] = {
@@ -3008,7 +3010,7 @@
 :- pragma foreign_proc("C",
 	tex_genf_eye_plane(Coord::in, X::in, Y::in, Z::in, W::in, IO0::di,
 		IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	if (sizeof(MR_Float) == sizeof(GLfloat)) {
 		GLfloat coefficients[] = {
@@ -3076,7 +3078,7 @@
 :- pred fog_mode(int::in, io::di, io::uo) is det.
 :- pragma foreign_proc("C",
 	fog_mode(M::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	glFogi(GL_FOG_MODE, (GLint) fog_mode_flags[M]);
 	IO = IO0;
@@ -3085,7 +3087,7 @@
 :- pred fog_density(float::in, io::di, io::uo) is det.
 :- pragma foreign_proc("C",
 	fog_density(P::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	glFogf(GL_FOG_DENSITY, (GLfloat) P);
 	IO = IO0;
@@ -3094,7 +3096,7 @@
 :- pred fog_start(float::in, io::di, io::uo) is det.
 :- pragma foreign_proc("C",
 	fog_start(P::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	glFogf(GL_FOG_START, (GLfloat) P);
 	IO = IO0;
@@ -3103,7 +3105,7 @@
 :- pred fog_end(float::in, io::di, io::uo) is det.
 :- pragma foreign_proc("C",
 	fog_end(P::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	glFogf(GL_FOG_END, (GLfloat) P);
 	IO = IO0;
@@ -3112,7 +3114,7 @@
 :- pred fog_index(float::in, io::di, io::uo) is det.
 :- pragma foreign_proc("C",
 	fog_index(I::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	glFogf(GL_FOG_INDEX, (GLfloat) I);
 	IO = IO0;
@@ -3122,7 +3124,7 @@
 	io::uo) is det.
 :- pragma foreign_proc("C",
 	fog_color(R::in, G::in, B::in, A::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "{
 	GLfloat fog_color[] = {R, G, B, A};

@@ -3141,7 +3143,7 @@
 :- pred get_fog_mode_2(int::out, io::di, io::uo) is det.
 :- pragma foreign_proc("C",
 	get_fog_mode_2(Mode::out, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	glGetIntegerv(GL_FOG_MODE, &Mode);
 	IO = IO0;
@@ -3154,7 +3156,7 @@

 :- pragma foreign_proc("C",
 	scissor(X::in, Y::in, Width::in, Height::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	glScissor((GLint)X, (GLint)Y, (GLsizei)Width, (GLsizei)Height);
 	IO = IO0;
@@ -3194,7 +3196,7 @@
 :- pred alpha_func_2(int::in, float::in, io::di, io::uo) is det.
 :- pragma foreign_proc("C",
 	alpha_func_2(TestFunc::in, Ref::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	glAlphaFunc(comparison_mode_flags[TestFunc], (GLclampf)Ref);
 	IO = IO0;
@@ -3207,7 +3209,7 @@
 :- pred stencil_func_2(int::in, float::in, int::in, io::di, io::uo) is det.
 :- pragma foreign_proc("C",
 	stencil_func_2(TestFunc::in, Ref::in, Mask::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	glStencilFunc(comparison_mode_flags[TestFunc], (GLint)Ref,
 		(GLuint)Mask);
@@ -3245,7 +3247,7 @@
 :- pred stencil_op_2(int::in, int::in, int::in, io::di, io::uo) is det.
 :- pragma foreign_proc("C",
 	stencil_op_2(Fail::in, ZFail::in, ZPass::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	glStencilOp(stencil_op_mode_flags[Fail], stencil_op_mode_flags[ZFail],
 		stencil_op_mode_flags[ZPass]);
@@ -3258,7 +3260,7 @@
 :- pred depth_func_2(int::in, io::di, io::uo) is det.
 :- pragma foreign_proc("C",
 	depth_func_2(Func::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	glDepthFunc(comparison_mode_flags[Func]);
 	IO = IO0;
@@ -3328,7 +3330,7 @@
 :- pred blend_func_2(int::in, int::in, io::di, io::uo) is det.
 :- pragma foreign_proc("C",
 	blend_func_2(Src::in, Dst::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	glBlendFunc(blend_src_flags[Src], blend_dst_flags[Dst]);
 	IO = IO0;
@@ -3384,7 +3386,7 @@
 :- pred logic_op_2(int::in, io::di, io::uo) is det.
 :- pragma foreign_proc("C",
 	logic_op_2(Op::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	glLogicOp(logic_op_flags[Op]);
 	IO = IO0;
@@ -3436,7 +3438,7 @@
 :- pred draw_buffer_2(int::in, int::in, io::di, io::uo) is det.
 :- pragma foreign_proc("C",
 	draw_buffer_2(BufferFlag::in, Offset::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	glDrawBuffer(buffer_flags[BufferFlag] + Offset);
 	IO = IO0;
@@ -3444,7 +3446,7 @@

 :- pragma foreign_proc("C",
 	index_mask(I::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	glIndexMask((GLuint) I);
 	IO = IO0;
@@ -3458,7 +3460,7 @@
 	is det.
 :- pragma foreign_proc("C",
 	color_mask_2(A::in, B::in, C::in, D::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	glColorMask((GLboolean) A, (GLboolean) B, (GLboolean) C, (GLboolean) D);
 	IO = IO0;
@@ -3470,7 +3472,7 @@
 :- pred depth_mask_2(int::in, io::di, io::uo) is det.
 :- pragma foreign_proc("C",
 	depth_mask_2(M::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	glDepthMask((GLboolean) M);
 	IO = IO0;
@@ -3478,7 +3480,7 @@

 :- pragma foreign_proc("C",
 	stencil_mask(M::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	glStencilMask((GLuint) M);
 	IO = IO0;
@@ -3503,7 +3505,7 @@

 :- pragma foreign_proc("C",
 	lookup_buffer_bit(F::in) = (B::out),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "{
 	static GLbitfield a[] = {
 		GL_COLOR_BUFFER_BIT,
@@ -3519,7 +3521,7 @@

 :- pragma foreign_proc("C",
 	clear2(Mask::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	glClear(Mask);
 	IO = IO0;
@@ -3527,7 +3529,7 @@

 :- pragma foreign_proc("C",
 	clear_color(R::in, G::in, B::in, A::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	glClearColor((GLclampf) R, (GLclampf) G, (GLclampf) B, (GLclampf) A);
 	IO = IO0;
@@ -3535,7 +3537,7 @@

 :- pragma foreign_proc("C",
 	clear_index(I::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	glClearIndex((GLfloat) I);
 	IO = IO0;
@@ -3543,7 +3545,7 @@

 :- pragma foreign_proc("C",
 	clear_depth(I::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	glClearDepth((GLfloat) I);
 	IO = IO0;
@@ -3551,7 +3553,7 @@

 :- pragma foreign_proc("C",
 	clear_stencil(I::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	glClearStencil((GLint) I);
 	IO = IO0;
@@ -3559,7 +3561,7 @@

 :- pragma foreign_proc("C",
 	clear_accum(R::in, G::in, B::in, A::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	glClearAccum((GLfloat) R, (GLfloat) G, (GLfloat) B, (GLfloat) A);
 	IO = IO0;
@@ -3593,7 +3595,7 @@
 :- pred accum2(int::in, float::in, io::di, io::uo) is det.
 :- pragma foreign_proc("C",
 	accum2(Op::in, Param::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	glAccum(accum_op_flags[Op], Param);
 	IO = IO0;
@@ -3641,7 +3643,7 @@
 :- pragma foreign_proc("C",
 	map1_2(CtrlFlagIndex::in, U1::in, U2::in, Stride::in, Order::in,
 		Points::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	if (sizeof(MR_Float) == sizeof(GLfloat)) {
 		glMap1f(control_flag_flags[CtrlFlagIndex], U1, U2,
@@ -3733,7 +3735,7 @@
 :- func pack_ctrl_pts1_1d(int, list(float)) = ctrl_points.
 :- pragma foreign_proc("C",
 	pack_ctrl_pts1_1d(Order::in, Verticies::in) = (Points::out),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	int i = 0;

@@ -3750,7 +3752,8 @@
 :- func pack_ctrl_pts2_1d(int, list({float, float})) = ctrl_points.
 :- pragma foreign_proc("C",
 	pack_ctrl_pts2_1d(Order::in, Verticies::in) = (Points::out),
-	[may_call_mercury, promise_pure, terminates],
+	[may_call_mercury, tabled_for_io, promise_pure, terminates,
+		will_not_throw_exception],
 "
 	MR_Float x, y;
 	int i = 0;
@@ -3772,7 +3775,8 @@
 :- func pack_ctrl_pts3_1d(int, list({float, float, float})) = ctrl_points.
 :- pragma foreign_proc("C",
 	pack_ctrl_pts3_1d(Order::in, Verticies::in) = (Points::out),
-	[may_call_mercury, promise_pure, terminates],
+	[may_call_mercury, tabled_for_io, promise_pure, terminates,
+		will_not_throw_exception],
 "
 	MR_Float x, y, z;
 	int i = 0;
@@ -3797,7 +3801,8 @@
 	= ctrl_points.
 :- pragma foreign_proc("C",
 	pack_ctrl_pts4_1d(Order::in, Verticies::in) = (Points::out),
-	[may_call_mercury, promise_pure, terminates],
+	[may_call_mercury, tabled_for_io, promise_pure, terminates,
+		will_not_throw_exception],

 "
 	MR_Float x, y, z, w;
@@ -3852,7 +3857,7 @@

 :- pragma foreign_proc("C",
 	eval_coord1(U::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	if (sizeof(MR_Float) == sizeof(GLfloat)) {
 		glEvalCoord1f((GLfloat) U);
@@ -3864,7 +3869,7 @@

 :- pragma foreign_proc("C",
 	eval_coord2(U::in, V::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	if (sizeof(MR_Float) == sizeof(GLfloat)) {
 		glEvalCoord2f((GLfloat) U, (GLfloat) V);
@@ -3898,7 +3903,7 @@
 :- pred eval_mesh1_2(int::in, int::in, int::in, io::di, io::uo) is det.
 :- pragma foreign_proc("C",
 	eval_mesh1_2(MeshFlag::in, P1::in, P2::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	glEvalMesh1(mesh_mode_flags[MeshFlag], (GLint) P1, (GLint) P2);
 	IO = IO0;
@@ -3912,7 +3917,7 @@
 :- pragma foreign_proc("C",
 	eval_mesh2_2(MeshFlag::in, P1::in, P2::in, Q1::in, Q2::in,
 		IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	glEvalMesh2(mesh_mode_flags[MeshFlag], P1, P2, Q1, Q2);
 	IO = IO0;
@@ -3920,7 +3925,7 @@

 :- pragma foreign_proc("C",
 	map_grid1(N::in, U1::in, U2::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	if (sizeof(MR_Float) == sizeof(GLfloat)) {
 		glMapGrid1f(N, U1, U2);
@@ -3932,7 +3937,7 @@

 :- pragma foreign_proc("C",
 	eval_point1(I::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	glEvalPoint1((GLint) I);
 	IO = IO0;
@@ -3941,7 +3946,7 @@
 :- pragma foreign_proc("C",
 	map_grid2(Nu::in, U1::in, U2::in, Nv::in, V1::in, V2::in,
 		IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	if (sizeof(MR_Float) == sizeof(GLfloat)) {
 		glMapGrid2f(Nu, U1, U2, Nv, V1, V2);
@@ -3953,7 +3958,7 @@

 :- pragma foreign_proc("C",
 	eval_point2(I::in, J::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	glEvalPoint2((GLint) I, (GLint) J);
 	IO = IO0;
@@ -3966,7 +3971,7 @@

 :- pragma foreign_proc("C",
 	pass_through(Token::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	glPassThrough((GLfloat) Token);
 	IO = IO0;
@@ -3979,7 +3984,7 @@

 :- pragma foreign_proc("C",
 	init_names(IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	glInitNames();
 	IO = IO0;
@@ -3987,7 +3992,7 @@

 :- pragma foreign_proc("C",
 	pop_name(IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	glPopName();
 	IO = IO0;
@@ -3995,7 +4000,7 @@

 :- pragma foreign_proc("C",
 	push_name(Name::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	glPushName((GLuint)Name);
 	IO = IO0;
@@ -4003,7 +4008,7 @@

 :- pragma foreign_proc("C",
 	load_name(Name::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	glLoadName((GLuint)Name);
 	IO = IO0;
@@ -4033,7 +4038,7 @@
 :- pred render_mode_2(int::in, int::out, io::di, io::uo) is det.
 :- pragma foreign_proc("C",
 	render_mode_2(Mode::in, Output::out, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	Output = (MR_Integer) glRenderMode(render_mode_flags[Mode]);
 	IO = IO0;
@@ -4066,7 +4071,7 @@
 :- pred new_list2(int::in, int::in, io::di, io::uo) is det.
 :- pragma foreign_proc("C",
 	new_list2(N::in, M::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	glNewList((GLuint) N, display_list_mode_flags[M]);
 	IO = IO0;
@@ -4074,7 +4079,7 @@

 :- pragma foreign_proc("C",
 	end_list(IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	glEndList();
 	IO = IO0;
@@ -4082,7 +4087,7 @@

 :- pragma foreign_proc("C",
 	call_list(N::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	glCallList((GLuint) N);
 	IO = IO0;
@@ -4090,7 +4095,7 @@

 :- pragma foreign_proc("C",
 	gen_lists(N::in, M::out, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	M = (MR_Integer) glGenLists((GLsizei) N);
 	IO = IO0;
@@ -4098,7 +4103,7 @@

 :- pragma foreign_proc("C",
 	delete_lists(N::in, M::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	glDeleteLists((GLuint) N, (GLsizei) M);
 	IO = IO0;
@@ -4106,7 +4111,7 @@

 :- pragma foreign_proc("C",
 	is_list(L::in, R::out, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	if (glIsList((GLuint) L)) {
 		R = MR_YES;
@@ -4118,7 +4123,7 @@

 :- pragma foreign_proc("C",
 	list_base(Base::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	glListBase((GLuint) Base);
 	IO = IO0;
@@ -4137,7 +4142,7 @@

 :- pragma foreign_proc("C",
 	finish(IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	glFinish();
 	IO = IO0;
@@ -4255,7 +4260,7 @@
 :- pred enable_2(int::in, int::in, io::di, io::uo) is det.
 :- pragma foreign_proc("C",
 	enable_2(FlagVal::in, Offset::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	glEnable(control_flag_flags[FlagVal] + Offset);
 	IO = IO0;
@@ -4268,7 +4273,7 @@
 :- pred disable_2(int::in, int::in, io::di, io::uo) is det.
 :- pragma foreign_proc("C",
 	disable_2(FlagVal::in, Offset::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	glDisable(control_flag_flags[FlagVal] + Offset);
 	IO = IO0;
@@ -4281,7 +4286,7 @@
 :- pred is_enabled_2(int::in, int::in, bool::out, io::di, io::uo) is det.
 :- pragma foreign_proc("C",
 	is_enabled_2(FlagVal::in, Offset::in, R::out, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	if (glIsEnabled(control_flag_flags[FlagVal] + Offset)) {
 		R = MR_YES;
@@ -4346,7 +4351,7 @@
 :- pred set_hint(int::in, int::in, io::di, io::uo) is det.
 :- pragma foreign_proc("C",
 	set_hint(Target::in, Mode::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	glHint(hint_target_flags[Target], hint_mode_flags[Mode]);
 	IO = IO0;
@@ -4364,7 +4369,7 @@
 :- pred get_hint_2(int::in, int::out, io::di, io::uo) is det.
 :- pragma foreign_proc("C",
 	get_hint_2(Target::in, Mode::out, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	glGetIntegerv(hint_target_flags[Target], &Mode);
 	IO = IO0;
@@ -4383,7 +4388,7 @@
 :- pragma foreign_proc("C",
 	get_clip_plane_2(I::in, X::out, Y::out, Z::out, W::out, IO0::di,
 		IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io,  promise_pure],
 "
 	GLdouble equation[4];

@@ -4447,7 +4452,7 @@
 :- pred get_boolean_2(int::in, bool::out, io::di, io::uo) is det.
 :- pragma foreign_proc("C",
 	get_boolean_2(Param::in, Value::out, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	GLboolean value;

@@ -4484,7 +4489,7 @@
 :- pragma foreign_proc("C",
 	get_boolean_2(Param::in, V0::out, V1::out, V2::out, V3::out, IO0::di,
 		IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	GLboolean values[4];

@@ -4650,7 +4655,7 @@
 :- pred get_integer_2(int::in, int::out, io::di, io::uo) is det.
 :- pragma foreign_proc("C",
 	get_integer_2(Param::in, Value::out, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	GLint value;

@@ -4731,7 +4736,7 @@
 :- pred get_float_2(int::in, float::out, io::di, io::uo) is det.
 :- pragma foreign_proc("C",
 	get_float_2(Param::in, V::out, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	GLfloat value;

@@ -4760,7 +4765,7 @@
 :- pred get_integer_2(int::in, int::out, int::out, io::di, io::uo) is det.
 :- pragma foreign_proc("C",
 	get_integer_2(Param::in, V0::out, V1::out, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	GLint values[2];

@@ -4796,7 +4801,7 @@
 :- pred get_float_2(int::in, float::out, float::out, io::di, io::uo) is det.
 :- pragma foreign_proc("C",
 	get_float_2(Param::in, V0::out, V1::out, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	GLfloat values[2];

@@ -4827,7 +4832,7 @@
 	io::uo) is det.
 :- pragma foreign_proc("C",
 	get_float_2(Param::in, V0::out, V1::out, V2::out, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	GLfloat value[3];

@@ -4873,7 +4878,7 @@
 :- pragma foreign_proc("C",
 	get_float_2(Param::in, V0::out, V1::out, V2::out, V3::out, IO0::di,
 		IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	GLfloat values[4];

@@ -4912,7 +4917,8 @@
 :- pred get_string_2(int::in, maybe(string)::out, io::di, io::uo) is det.
 :- pragma foreign_proc("C",
 	get_string_2(StrFlag::in, Result::out, IO0::di, IO::uo),
-	[may_call_mercury, promise_pure, terminates],
+	[may_call_mercury, tabled_for_io, promise_pure, terminates,
+		will_not_throw_exception],
 "
 	const GLubyte *c_str;
 	MR_String mer_str;
@@ -4994,7 +5000,7 @@

 :- pragma foreign_proc("C",
 	push_attrib(IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	glPushAttrib(GL_ALL_ATTRIB_BITS);
 	IO = IO0;
@@ -5014,7 +5020,7 @@
 :- func lookup_server_attrib_group_bit(int) = int.
 :- pragma foreign_proc("C",
 	lookup_server_attrib_group_bit(Flag::in) = (Mask::out),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	Mask = server_attrib_group_flags[Flag];
 ").
@@ -5022,7 +5028,7 @@
 :- pred push_attrib_2(int::in, io::di, io::uo) is det.
 :- pragma foreign_proc("C",
 	push_attrib_2(Mask::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	glPushAttrib((GLbitfield) Mask);
 	IO = IO0;
@@ -5030,7 +5036,7 @@

 :- pragma foreign_proc("C",
 	pop_attrib(IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	glPopAttrib();
 	IO = IO0;
@@ -5059,7 +5065,7 @@

 :- pragma foreign_proc("C",
 	push_client_attrib(IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	/*
  	** XXX Apple's OpenGL implementation is broken.
@@ -5088,7 +5094,7 @@
 :- func lookup_client_attrib_group_bit(int) = int.
 :- pragma foreign_proc("C",
 	lookup_client_attrib_group_bit(Flag::in) = (Mask::out),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	Mask = client_attrib_group_flags[Flag];
 ").
@@ -5096,7 +5102,7 @@
 :- pred push_client_attrib_2(int::in, io::di, io::uo) is det.
 :- pragma foreign_proc("C",
 	push_client_attrib_2(Mask::in, IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	glPushClientAttrib((GLbitfield) Mask);
 	IO = IO0;
@@ -5104,7 +5110,7 @@

 :- pragma foreign_proc("C",
 	pop_client_attrib(IO0::di, IO::uo),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, tabled_for_io, promise_pure],
 "
 	glPopClientAttrib();
 	IO = IO0;

--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list