summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/ReferenceManual.pdfbin906461 -> 921141 bytes
-rw-r--r--doc/ReferenceManual/UtilReference.tex301
-rw-r--r--src/include/util_Table.h19
-rw-r--r--src/util/Table.c240
4 files changed, 506 insertions, 54 deletions
diff --git a/doc/ReferenceManual.pdf b/doc/ReferenceManual.pdf
index 8db26884..eb86ac82 100644
--- a/doc/ReferenceManual.pdf
+++ b/doc/ReferenceManual.pdf
Binary files differ
diff --git a/doc/ReferenceManual/UtilReference.tex b/doc/ReferenceManual/UtilReference.tex
index 40b011e4..23314125 100644
--- a/doc/ReferenceManual/UtilReference.tex
+++ b/doc/ReferenceManual/UtilReference.tex
@@ -340,6 +340,26 @@ specified array, whose data type is generic
Sets the value associated with a specified key in a table, to be
a copy of a specified C-style null-terminated character string
+\item[\code{Util\_TablePrint}]
+ [\pageref{Util-TablePrint}]
+Print out a table and its data structures, using a verbose internal
+format meant for debugging
+
+\item[\code{Util\_TablePrintAll}]
+ [\pageref{Util-TablePrintAll}]
+Print out all tables and their data structures, using a verbose
+internal format meant for debugging
+
+\item[\code{Util\_TablePrintAllIterators}]
+ [\pageref{Util-TablePrintAllIterators}]
+Print out all table iterators and their data structures, using a
+verbose internal format meant for debugging
+
+\item[\code{Util\_TablePrintPretty}]
+ [\pageref{Util-TablePrintPretty}]
+Print out a table, using a human-readable format similar to the one
+accepted by Util\_TableCreateFromString
+
\end{Lentry}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -4763,6 +4783,287 @@ Util_TableSetCharArray(handle, N_ARRAY, array, "Einstein");
\end{ExampleSection}
\end{FunctionDescription}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\begin{FunctionDescription}{Util\_TablePrint}
+\label{Util-TablePrint}
+Print out a table and its data structures, using a verbose internal
+format meant for debugging
+
+\begin{SynopsisSection}
+\begin{Synopsis}{C}
+\begin{verbatim}
+#include <stdio.h>
+#include "util_ErrorCodes.h"
+#include "util_Table.h"
+int status = Util_TablePrint(FILE *stream,
+ int handle);
+\end{verbatim}
+\end{Synopsis}
+\end{SynopsisSection}
+
+\begin{ResultSection}
+\begin{Result}{\rm 0}
+ok
+\end{Result}
+\end{ResultSection}
+
+\begin{ParameterSection}
+\begin{Parameter}{stream ($\ne 0$)}
+output stream, e.g.\ \code{stdout}
+\end{Parameter}
+\begin{Parameter}{handle ($\ge 0$)}
+handle to the table
+\end{Parameter}
+\end{ParameterSection}
+
+\begin{Discussion}
+\code{stream} may be any output stream, e.g.\ \code{stdout} or
+\code{stderr}, or a file that has been opened for writing.
+\end{Discussion}
+
+\begin{SeeAlsoSection}
+\begin{SeeAlso2}{Util\_TablePrintAll()}{Util-TablePrintAll}
+Print out all tables and their data structures, using a verbose
+internal format meant for debugging
+\end{SeeAlso2}
+\begin{SeeAlso2}{Util\_TablePrintAllIterators()}{Util-TablePrintAllIterators}
+Print out all table iterators and their data structures, using a
+verbose internal format meant for debugging
+\end{SeeAlso2}
+\begin{SeeAlso2}{Util\_TablePrintPretty()}{Util-TablePrintPretty}
+Print out a table, using a human-readable format similar to the one
+accepted by Util\_TableCreateFromString
+\end{SeeAlso2}
+\end{SeeAlsoSection}
+
+%\begin{ErrorSection}
+%\end{ErrorSection}
+
+\begin{ExampleSection}
+\begin{Example}{C}
+\begin{verbatim}
+#include <stdio.h>
+#include "util_ErrorCodes.h"
+#include "util_Table.h"
+
+int handle = Util_TableCreateFromString("ipar=1 dpar=2.0 spar='three'");
+Util_TablePrint(stdout, handle);
+\end{verbatim}
+\end{Example}
+\end{ExampleSection}
+\end{FunctionDescription}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\begin{FunctionDescription}{Util\_TablePrintAll}
+\label{Util-TablePrintAll}
+Print out all tables and their data structures, using a verbose
+internal format meant for debugging
+
+\begin{SynopsisSection}
+\begin{Synopsis}{C}
+\begin{verbatim}
+#include <stdio.h>
+#include "util_ErrorCodes.h"
+#include "util_Table.h"
+int status = Util_TablePrintAll(FILE *stream);
+\end{verbatim}
+\end{Synopsis}
+\end{SynopsisSection}
+
+\begin{ResultSection}
+\begin{Result}{\rm 0}
+ok
+\end{Result}
+\end{ResultSection}
+
+\begin{ParameterSection}
+\begin{Parameter}{stream ($\ne 0$)}
+output stream, e.g.\ \code{stdout}
+\end{Parameter}
+\end{ParameterSection}
+
+\begin{Discussion}
+\code{stream} may be any output stream, e.g.\ \code{stdout} or
+\code{stderr}, or a file that has been opened for writing.
+\end{Discussion}
+
+\begin{SeeAlsoSection}
+\begin{SeeAlso2}{Util\_TablePrint()}{Util-TablePrint}
+Print out a table and its data structures, using a verbose internal
+format meant for debugging
+\end{SeeAlso2}
+\begin{SeeAlso2}{Util\_TablePrintAllIterators()}{Util-TablePrintAllIterators}
+Print out all table iterators and their data structures, using a
+verbose internal format meant for debugging
+\end{SeeAlso2}
+\begin{SeeAlso2}{Util\_TablePrintPretty()}{Util-TablePrintPretty}
+Print out a table, using a human-readable format similar to the one
+accepted by Util\_TableCreateFromString
+\end{SeeAlso2}
+\end{SeeAlsoSection}
+
+%\begin{ErrorSection}
+%\end{ErrorSection}
+
+\begin{ExampleSection}
+\begin{Example}{C}
+\begin{verbatim}
+#include <stdio.h>
+#include "util_ErrorCodes.h"
+#include "util_Table.h"
+
+int handle = Util_TableCreateFromString("ipar=1 dpar=2.0 spar='three'");
+Util_TablePrintAll(stdout);
+\end{verbatim}
+\end{Example}
+\end{ExampleSection}
+\end{FunctionDescription}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\begin{FunctionDescription}{Util\_TablePrintAllIterators}
+\label{Util-TablePrintAllIterators}
+Print out all table iterators and their data structures, using a
+verbose internal format meant for debugging
+
+\begin{SynopsisSection}
+\begin{Synopsis}{C}
+\begin{verbatim}
+#include <stdio.h>
+#include "util_ErrorCodes.h"
+#include "util_Table.h"
+int status = Util_TablePrintAllIterators(FILE *stream);
+\end{verbatim}
+\end{Synopsis}
+\end{SynopsisSection}
+
+\begin{ResultSection}
+\begin{Result}{\rm 0}
+ok
+\end{Result}
+\end{ResultSection}
+
+\begin{ParameterSection}
+\begin{Parameter}{stream ($\ne 0$)}
+output stream, e.g.\ \code{stdout}
+\end{Parameter}
+\end{ParameterSection}
+
+\begin{Discussion}
+\code{stream} may be any output stream, e.g.\ \code{stdout} or
+\code{stderr}, or a file that has been opened for writing.
+\end{Discussion}
+
+\begin{SeeAlsoSection}
+\begin{SeeAlso2}{Util\_TablePrint()}{Util-TablePrint}
+Print out a table and its data structures, using a verbose internal
+format meant for debugging
+\end{SeeAlso2}
+\begin{SeeAlso2}{Util\_TablePrintAll()}{Util-TablePrintAll}
+Print out all tables and their data structures, using a verbose
+internal format meant for debugging
+\end{SeeAlso2}
+\begin{SeeAlso2}{Util\_TablePrintPretty()}{Util-TablePrintPretty}
+Print out a table, using a human-readable format similar to the one
+accepted by Util\_TableCreateFromString
+\end{SeeAlso2}
+\end{SeeAlsoSection}
+
+%\begin{ErrorSection}
+%\end{ErrorSection}
+
+\begin{ExampleSection}
+\begin{Example}{C}
+\begin{verbatim}
+#include <stdio.h>
+#include "util_ErrorCodes.h"
+#include "util_Table.h"
+
+int handle = Util_TableCreateFromString("ipar=1 dpar=2.0 spar='three'");
+Util_TablePrintAllIterators(stdout);
+\end{verbatim}
+\end{Example}
+\end{ExampleSection}
+\end{FunctionDescription}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\begin{FunctionDescription}{Util\_TablePrintPretty}
+\label{Util-TablePrintPretty}
+Print out a table, using a human-readable format similar to the one
+accepted by Util\_TableCreateFromString
+
+\begin{SynopsisSection}
+\begin{Synopsis}{C}
+\begin{verbatim}
+#include <stdio.h>
+#include "util_ErrorCodes.h"
+#include "util_Table.h"
+int status = Util_TablePrintPretty(FILE *stream,
+ int handle);
+\end{verbatim}
+\end{Synopsis}
+\end{SynopsisSection}
+
+\begin{ResultSection}
+\begin{Result}{\rm 0}
+ok
+\end{Result}
+\end{ResultSection}
+
+\begin{ParameterSection}
+\begin{Parameter}{stream ($\ne 0$)}
+output stream, e.g.\ \code{stdout}
+\end{Parameter}
+\begin{Parameter}{handle ($\ge 0$)}
+handle to the table
+\end{Parameter}
+\end{ParameterSection}
+
+\begin{Discussion}
+\code{stream} may be any output stream, e.g.\ \code{stdout} or
+\code{stderr}, or a file that has been opened for writing.
+\end{Discussion}
+
+\begin{SeeAlsoSection}
+\begin{SeeAlso2}{Util\_TableCreateFromString()}{Util-TableCreateFromString}
+Create a new table (with the case-insensitive flag set) and set values
+in it based on a string argument (interpreted with ``parameter-file''
+semantics)
+\end{SeeAlso2}
+\begin{SeeAlso2}{Util\_TablePrint()}{Util-TablePrint}
+Print out a table and its data structures, using a verbose internal
+format meant for debugging
+\end{SeeAlso2}
+\begin{SeeAlso2}{Util\_TablePrintAll()}{Util-TablePrintAll}
+Print out all tables and their data structures, using a verbose
+internal format meant for debugging
+\end{SeeAlso2}
+\begin{SeeAlso2}{Util\_TablePrintAllIterators()}{Util-TablePrintAllIterators}
+Print out all table iterators and their data structures, using a
+verbose internal format meant for debugging
+\end{SeeAlso2}
+\end{SeeAlsoSection}
+
+%\begin{ErrorSection}
+%\end{ErrorSection}
+
+\begin{ExampleSection}
+\begin{Example}{C}
+\begin{verbatim}
+#include <stdio.h>
+#include "util_ErrorCodes.h"
+#include "util_Table.h"
+
+int handle = Util_TableCreateFromString("ipar=1 dpar=2.0 spar='three'");
+Util_TablePrintPretty(stdout, handle);
+\end{verbatim}
+\end{Example}
+\end{ExampleSection}
+\end{FunctionDescription}
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
diff --git a/src/include/util_Table.h b/src/include/util_Table.h
index 45e3cadc..abd83965 100644
--- a/src/include/util_Table.h
+++ b/src/include/util_Table.h
@@ -14,6 +14,10 @@
@version $Header$
@@*/
+#ifndef _UTIL_TABLE_H_
+#define _UTIL_TABLE_H_ 1 /* define to 1 is Cactus standard */
+ /* n.b. usual standard is empty defn! */
+
/*
* Having this file (a "util_*" low-level file) include a "cctk_*" high-level
* file is an ugly hack, but we need the CCTK_{INT,REAL,COMPLEX}_* types
@@ -21,10 +25,6 @@
*/
#include "cctk_Types.h"
-#ifndef _UTIL_TABLE_H_
-#define _UTIL_TABLE_H_ 1 /* define to 1 is Cactus standard */
- /* n.b. usual standard is empty defn! */
-
#ifdef __cplusplus
extern "C"
{
@@ -128,6 +128,8 @@ extern "C"
#ifdef CCODE
+#include <stdio.h>
+
/* create/destroy */
int Util_TableCreate(int flags);
int Util_TableClone(int handle);
@@ -509,6 +511,15 @@ int Util_TableItResetToStart(int ihandle);
int Util_TableItSetToNull(int ihandle);
int Util_TableItSetToKey(int ihandle, const char *key);
+/******************************************************************************/
+/***** Table Output API *******************************************************/
+/******************************************************************************/
+
+int Util_TablePrintAll(FILE *stream);
+int Util_TablePrint(FILE *stream, int handle);
+int Util_TablePrintPretty(FILE *stream, int handle);
+int Util_TablePrintAllIterators(FILE *stream);
+
#endif /* CCODE */
/******************************************************************************/
diff --git a/src/util/Table.c b/src/util/Table.c
index 599d4574..1c9a3db8 100644
--- a/src/util/Table.c
+++ b/src/util/Table.c
@@ -57,6 +57,11 @@
* Util_TableItResetToStart
* Util_TableItSetToNull
* Util_TableItSetToKey
+ * Table and Iterator Dump Routines
+ * Util_TablePrintAll
+ * Util_TablePrint
+ * Util_TablePrintPretty
+ * Util_TablePrintAllIterators
* Internal Support Functions
* internal_set
* internal_get
@@ -69,14 +74,9 @@
* get_iterator_ptr
* grow_pointer_array
* convert_string_to_number
-#ifdef UTIL_TABLE_TEST
- * Table and Iterator Dump Routines
- * print_all_tables
- * print_table
- * print_all_iterators
-#endif
*/
+#include <ctype.h>
#include <math.h>
#include <limits.h>
#include <stdio.h>
@@ -385,15 +385,6 @@ static
static
void convert_string_to_number(const char *string, struct scalar_value *scalar);
-#ifdef UTIL_TABLE_TEST
-/*
- * Print out the table and iterator data structures.
- */
-static void print_all_tables(void);
-static void print_table(int handle);
-static void print_all_iterators(void);
-#endif
-
/******************************************************************************/
/***** Main Table API *********************************************************/
/******************************************************************************/
@@ -5518,133 +5509,282 @@ static
/***** Table and Iterator Dump Routines ***************************************/
/******************************************************************************/
-#ifdef UTIL_TABLE_TEST
/*
* This function prints out all the tables and their data structures.
*/
-static
-void print_all_tables(void)
+int Util_TablePrintAll(FILE *stream)
{
int handle;
- printf("N_tables=%d N_thp_array=%d\n", N_tables, N_thp_array);
+ fprintf(stream, "N_tables=%d N_thp_array=%d\n", N_tables, N_thp_array);
for (handle = 0 ; handle < N_thp_array ; ++handle)
{
- print_table(handle);
+ Util_TablePrint(stream, handle);
}
+
+ return 0;
}
-#endif /* UTIL_TABLE_TEST */
/******************************************************************************/
-#ifdef UTIL_TABLE_TEST
/*
- * This function prints out a table.
+ * This function prints out a table, giving all internal information.
*/
-static
- void print_table(int handle)
+int Util_TablePrint(FILE *stream, int handle)
{
- printf("thp_array[%d]: ", handle);
+ fprintf(stream, "thp_array[%d]: ", handle);
{
const struct table_header *const thp = get_table_header_ptr(handle);
if (thp == NULL)
{
- printf("NULL\n");
+ fprintf(stream, "NULL\n");
}
else
{
- printf("flags=0x%x handle=%d\n", thp->flags, thp->handle);
+ fprintf(stream, "flags=0x%x handle=%d\n", thp->flags, thp->handle);
{
const struct table_entry *tep = thp->head;
for ( ; tep != NULL ; tep = tep->next)
{
- printf(" [tep=%p]\n", (const void *) tep);
- printf("\tkey=\"%s\"\n", tep->key);
- printf("\ttype_code=%d N_elements=%d\n", tep->type_code, tep->N_elements);
+ fprintf(stream, " [tep=%p]\n", (const void *) tep);
+ fprintf(stream, "\tkey=\"%s\"\n", tep->key);
+ fprintf(stream, "\ttype_code=%d N_elements=%d\n", tep->type_code, tep->N_elements);
{
int i;
switch (tep->type_code)
{
case CCTK_VARIABLE_BYTE:
- printf("\t[byte]");
+ fprintf(stream, "\t[byte]");
{
const CCTK_BYTE* const value_ptr_byte = (const CCTK_BYTE*) tep->value;
for (i = 0 ; i < tep->N_elements ; ++i)
{
- printf("\t%d", (int) value_ptr_byte[i]);
+ fprintf(stream, "\t%d", (int) value_ptr_byte[i]);
}
}
break;
case CCTK_VARIABLE_INT:
- printf("\t[int]");
+ fprintf(stream, "\t[int]");
{
const CCTK_INT* const value_ptr_int = (const CCTK_INT*) tep->value;
for (i = 0 ; i < tep->N_elements ; ++i)
{
- printf("\t%d", (int) value_ptr_int[i]);
+ fprintf(stream, "\t%d", (int) value_ptr_int[i]);
}
}
break;
case CCTK_VARIABLE_REAL:
- printf("\t[real]");
+ fprintf(stream, "\t[real]");
{
const CCTK_REAL* const value_ptr_real = (const CCTK_REAL*) tep->value;
for (i = 0 ; i < tep->N_elements ; ++i)
{
- printf("\t%g", (double) value_ptr_real[i]);
+ fprintf(stream, "\t%g", (double) value_ptr_real[i]);
}
}
break;
case CCTK_VARIABLE_COMPLEX:
- printf("\t[complex]");
+ fprintf(stream, "\t[complex]");
{
const CCTK_COMPLEX* const value_ptr_complex
= (const CCTK_COMPLEX *) tep->value;
for (i = 0 ; i < tep->N_elements ; ++i)
{
- printf("\t(%g,%g)",
+ fprintf(stream, "\t(%g,%g)",
(double) value_ptr_complex[i].Re,
(double) value_ptr_complex[i].Im);
}
}
break;
+ case CCTK_VARIABLE_CHAR:
+ fprintf(stream, "\t[char]");
+ {
+ const CCTK_CHAR* const value_ptr_char = (const CCTK_CHAR*) tep->value;
+ fprintf(stream, "\t\"");
+ for (i = 0 ; i < tep->N_elements ; ++i)
+ {
+ CCTK_CHAR const c = value_ptr_char[i];
+ if (c == '"')
+ fprintf(stream, "\\\"");
+ else if (isprint(c))
+ fprintf(stream, "%c", (int) c);
+ else
+ fprintf(stream, "\\x%02x", (int) c);
+ }
+ fprintf(stream, "\"");
+ }
+ break;
default:
- printf("\t[sorry, don't know how to print this type!]");
+ fprintf(stream, "\t[sorry, don't know how to print this type!]");
break;
}
- printf("\n");
+ fprintf(stream, "\n");
}
}
}
}
}
+
+ return 0;
+}
+
+/******************************************************************************/
+
+/*
+ * This function prints out a table into a nice format.
+ */
+int Util_TablePrintPretty(FILE *stream, int handle)
+{
+ const struct table_header *const thp = get_table_header_ptr(handle);
+ if (! thp)
+ {
+ fprintf(stream, "NULL\n");
+ return 0;
+ }
+
+ for (const struct table_entry *tep = thp->head; tep; tep = tep->next)
+ {
+ if (tep != thp->head)
+ {
+ fprintf(stream, " ");
+ }
+ fprintf(stream, "%s=", tep->key);
+ switch (tep->type_code)
+ {
+ case CCTK_VARIABLE_BYTE:
+ {
+ const CCTK_BYTE* const value_ptr_byte = (const CCTK_BYTE*)tep->value;
+ if (tep->N_elements != 1)
+ {
+ fprintf(stream, "{");
+ }
+ for (int i = 0; i < tep->N_elements; ++i)
+ {
+ if (i != 0)
+ {
+ fprintf(stream, " ");
+ }
+ fprintf(stream, "0x%02x", (int)value_ptr_byte[i]);
+ }
+ if (tep->N_elements != 1)
+ {
+ fprintf(stream, "}");
+ }
+ }
+ break;
+ case CCTK_VARIABLE_INT:
+ {
+ const CCTK_INT* const value_ptr_int = (const CCTK_INT*)tep->value;
+ if (tep->N_elements != 1)
+ {
+ fprintf(stream, "{");
+ }
+ for (int i = 0; i < tep->N_elements; ++i)
+ {
+ if (i != 0)
+ {
+ fprintf(stream, " ");
+ }
+ fprintf(stream, "%d", (int)value_ptr_int[i]);
+ }
+ if (tep->N_elements != 1)
+ {
+ fprintf(stream, "}");
+ }
+ }
+ break;
+ case CCTK_VARIABLE_REAL:
+ {
+ const CCTK_REAL* const value_ptr_real = (const CCTK_REAL*)tep->value;
+ if (tep->N_elements != 1)
+ {
+ fprintf(stream, "{");
+ }
+ for (int i = 0; i < tep->N_elements; ++i)
+ {
+ if (i != 0)
+ {
+ fprintf(stream, " ");
+ }
+ fprintf(stream, "%#.17g", (double)value_ptr_real[i]);
+ }
+ if (tep->N_elements != 1)
+ {
+ fprintf(stream, "}");
+ }
+ }
+ break;
+ case CCTK_VARIABLE_COMPLEX:
+ {
+ const CCTK_COMPLEX* const value_ptr_complex =
+ (const CCTK_COMPLEX *)tep->value;
+ if (tep->N_elements != 1)
+ {
+ fprintf(stream, "{");
+ }
+ for (int i = 0; i < tep->N_elements; ++i)
+ {
+ if (i != 0)
+ {
+ fprintf(stream, " ");
+ }
+ fprintf(stream, "(%#.17g,%#.17g)",
+ (double)value_ptr_complex[i].Re,
+ (double)value_ptr_complex[i].Im);
+ }
+ if (tep->N_elements != 1)
+ {
+ fprintf(stream, "}");
+ }
+ }
+ break;
+ case CCTK_VARIABLE_CHAR:
+ {
+ const CCTK_CHAR* const value_ptr_char = (const CCTK_CHAR*)tep->value;
+ fprintf(stream, "\"");
+ for (int i = 0; i < tep->N_elements; ++i)
+ {
+ CCTK_CHAR const c = value_ptr_char[i];
+ if (c == '"')
+ fprintf(stream, "\\\"");
+ else if (isprint(c))
+ fprintf(stream, "%c", (int)c);
+ else
+ fprintf(stream, "\\x%02x", (int)(unsigned char)c);
+ }
+ fprintf(stream, "\"");
+ }
+ break;
+ default:
+ fprintf(stream, "[unsupported type]");
+ }
+ }
+ return 0;
}
-#endif /* UTIL_TABLE_TEST */
/******************************************************************************/
-#ifdef UTIL_TABLE_TEST
/*
* This function prints out all the iterators and their data structures.
*/
-static
- void print_all_iterators(void)
+int Util_TablePrintAllIterators(FILE *stream)
{
int ihandle;
- printf("N_iterators=%d N_ip_array=%d\n", N_iterators, N_ip_array);
+ fprintf(stream, "N_iterators=%d N_ip_array=%d\n", N_iterators, N_ip_array);
for (ihandle = 0 ; ihandle < N_ip_array ; ++ihandle)
{
const struct iterator *const ip = get_iterator_ptr(ihandle);
- printf("ip_array[%d]: ", ihandle);
+ fprintf(stream, "ip_array[%d]: ", ihandle);
if (ip == NULL)
{
- printf("NULL\n");
+ fprintf(stream, "NULL\n");
}
else
{
- printf("thp=%p tep=%p\n", (const void *) ip->thp, (const void *) ip->tep);
+ fprintf(stream, "thp=%p tep=%p\n", (const void *) ip->thp, (const void *) ip->tep);
}
}
+
+ return 0;
}
-#endif /* UTIL_TABLE_TEST */