|
sprintf (sbuf, "%s%s", PROCESS_DEFINITION_REPOSITORY, "index.xml");
file = fopen (sbuf, "r");
if (!file) {
printf ("Unable to open directory file %s\n", sbuf);
return (1);
}
directory = xml_read (file);
fclose (file);
if (!directory) {
printf ("Corrupt directory file.\n");
return (1);
}
if (argc > 2) {
format = argv[2];
} else {
format = "edit?item=%s";
}
item = xml_firstelem (directory);
while (item) {
if (!strcmp (item->name, "item")) {
mark = (char *) xml_attrval (item, "title");
if (!*mark) mark = (char *) xml_attrval (item, "id");
printf ("<li><strong><a href=\"");
printf (format, xml_attrval (item, "id"));
printf ("\">%s</a></strong><br>\n", mark);
xml_writecontent (stdout, item);
printf ("<br>\n");
}
item = xml_nextelem (item);
}
|