/*
- * "$Id: testhi.c 4869 2005-12-06 02:43:40Z mike $"
+ * "$Id: testhi.c 5143 2006-02-21 19:13:01Z mike $"
*
* Help index test program for the Common UNIX Printing System (CUPS).
*
* Local functions...
*/
-static void list_nodes(const char *title, int num_nodes, help_node_t **nodes);
+static void list_nodes(const char *title, cups_array_t *nodes);
/*
hi = helpLoadIndex("testhi.index", ".");
- list_nodes("nodes", hi->num_nodes, hi->nodes);
- list_nodes("sorted", hi->num_nodes, hi->sorted);
+ list_nodes("nodes", hi->nodes);
+ list_nodes("sorted", hi->sorted);
/*
* Do any searches...
if (search)
{
- list_nodes(argv[1], search->num_nodes, search->sorted);
+ list_nodes(argv[1], search->sorted);
helpDeleteIndex(search);
}
else
*/
static void
-list_nodes(const char *title, /* I - Title string */
- int num_nodes, /* I - Number of nodes */
- help_node_t **nodes) /* I - Nodes */
+list_nodes(const char *title, /* I - Title string */
+ cups_array_t *nodes) /* I - Nodes */
{
- int i; /* Looping var */
+ int i; /* Looping var */
+ help_node_t *node; /* Current node */
- printf("%s (%d nodes):\n", title, num_nodes);
- for (i = 0; i < num_nodes; i ++)
- if (nodes[i]->anchor)
- printf(" %d: %s#%s \"%s\"\n", i, nodes[i]->filename, nodes[i]->anchor,
- nodes[i]->text);
+ printf("%s (%d nodes):\n", title, cupsArrayCount(nodes));
+ for (i = 1, node = (help_node_t *)cupsArrayFirst(nodes);
+ node;
+ i ++, node = (help_node_t *)cupsArrayNext(nodes))
+ if (node->anchor)
+ printf(" %d: %s#%s \"%s\"\n", i, node->filename, node->anchor,
+ node->text);
else
- printf(" %d: %s \"%s\"\n", i, nodes[i]->filename, nodes[i]->text);
+ printf(" %d: %s \"%s\"\n", i, node->filename, node->text);
}
/*
- * End of "$Id: testhi.c 4869 2005-12-06 02:43:40Z mike $".
+ * End of "$Id: testhi.c 5143 2006-02-21 19:13:01Z mike $".
*/