summaryrefslogtreecommitdiff
path: root/cgi-bin/testhi.c
diff options
context:
space:
mode:
authorjlovell <jlovell@a1ca3aef-8c08-0410-bb20-df032aa958be>2006-02-22 16:59:36 +0000
committerjlovell <jlovell@a1ca3aef-8c08-0410-bb20-df032aa958be>2006-02-22 16:59:36 +0000
commitecdc06282a65bd04f801c877d2ceb83106d737e1 (patch)
treecd00fed2f725d8c7b193bb566974e4d4da30740f /cgi-bin/testhi.c
parentbd7854cb4d663bb0e561eaf5b01bbd47baa71d22 (diff)
downloadcups-ecdc06282a65bd04f801c877d2ceb83106d737e1.tar.gz
Load cups into easysw/current.
git-svn-id: svn+ssh://src.apple.com/svn/cups/easysw/current@63 a1ca3aef-8c08-0410-bb20-df032aa958be
Diffstat (limited to 'cgi-bin/testhi.c')
-rw-r--r--cgi-bin/testhi.c34
1 files changed, 18 insertions, 16 deletions
diff --git a/cgi-bin/testhi.c b/cgi-bin/testhi.c
index 99d0bd29f..dad5d70b7 100644
--- a/cgi-bin/testhi.c
+++ b/cgi-bin/testhi.c
@@ -1,5 +1,5 @@
/*
- * "$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).
*
@@ -38,7 +38,7 @@
* 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);
/*
@@ -59,8 +59,8 @@ main(int argc, /* I - Number of command-line arguments */
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...
@@ -72,7 +72,7 @@ main(int argc, /* I - Number of command-line arguments */
if (search)
{
- list_nodes(argv[1], search->num_nodes, search->sorted);
+ list_nodes(argv[1], search->sorted);
helpDeleteIndex(search);
}
else
@@ -94,23 +94,25 @@ main(int argc, /* I - Number of command-line arguments */
*/
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 $".
*/