From e7609efa1858251aac075508928668cd74ffe5c4 Mon Sep 17 00:00:00 2001
From: David MacMahon <davidm@astro.berkeley.edu>
Date: Wed, 13 Jan 2010 00:49:30 -0800
Subject: [PATCH 2/4] Clarified some comments and added a typedef

Added a typedef for a pointer to an f2eval-like function.  This will
simplify parameter declarations for functions that accept pointers to
such functions.

Clarified (hopefully) the comments of the f2eval* functions.
---
 include/plplot.h |   38 +++++++++++++++++++++++++++++++-------
 1 files changed, 31 insertions(+), 7 deletions(-)

diff --git a/include/plplot.h b/include/plplot.h
index 5400e42..00af80d 100644
--- a/include/plplot.h
+++ b/include/plplot.h
@@ -191,9 +191,11 @@ typedef PLUINT   PLUNICODE;
 typedef PLINT    PLBOOL;
 
 /* For passing user data, as with X's XtPointer */
-
 typedef void*    PLPointer;
 
+/* For passing function pointers to access 2D data */
+typedef PLFLT (* PLF2EVAL)(PLINT, PLINT, PLPointer);
+
 /*--------------------------------------------------------------------------*\
  * Complex data types and other good stuff
  \*--------------------------------------------------------------------------*/
@@ -1839,20 +1841,42 @@ pltr2f( PLFLT x, PLFLT y, PLFLT *tx, PLFLT *ty, void *pltr_data );
 
 /* Function evaluators */
 
-/* Does a lookup from a 2d function array.  Array is of type (PLFLT **), */
-/* and is column dominant (normal C ordering). */
+/*
+ * Does a lookup from a 2d function array.  plf2eval_data is treated as type
+ * (PLfGrid2 *) and data for (ix,iy) is returned from...
+ *
+ * plf2eval_data->f[ix][iy];
+ */
 
 PLDLLIMPEXP PLFLT
 plf2eval2( PLINT ix, PLINT iy, PLPointer plf2eval_data );
 
-/* Does a lookup from a 2d function array.  Array is of type (PLFLT *), */
-/* and is column dominant (normal C ordering). */
+/*
+ * Does a lookup from a 2d function array.  plf2eval_data is treated as type
+ * (PLfGrid *) and data for (ix,iy) is returned from...
+ *
+ * plf2eval_data->f[ix * plf2eval_data->ny + iy];
+ *
+ * This is commonly called "row-major order", but in the context of plotting,
+ * it might be easier to think of it as "X-major order".  In this ordering,
+ * values for a single X index are stored in consecutive memory locations.
+ * This is also known as C ordering.
+ */
 
 PLDLLIMPEXP PLFLT
 plf2eval( PLINT ix, PLINT iy, PLPointer plf2eval_data );
 
-/* Does a lookup from a 2d function array.  Array is of type (PLFLT *), */
-/* and is row dominant (Fortran ordering). */
+/*
+ * Does a lookup from a 2d function array.  plf2eval_data is treated as type
+ * (PLfGrid *) and data for (ix,iy) is returned from...
+ *
+ * plf2eval_data->f[ix + iy * plf2eval_data->nx];
+ *
+ * This is commonly called "column-major order", but in the context of
+ * plotting, it might be easier to think of it as "Y-major order".  In this
+ * ordering, values for a single Y index are stored in consecutive memory
+ * locations.  This is also known as FORTRAN ordering.
+ */
 
 PLDLLIMPEXP PLFLT
 plf2evalr( PLINT ix, PLINT iy, PLPointer plf2eval_data );
-- 
1.6.6

