int
main (int argc, char** argv)
{
xml_g_set_prgname(argv[0]);
if (argc < 2)
{
g_printerr ("> %s filename... [options]\n"
"\t the program reads all C source text, annotates them\n"
"\t internally, and prints some report xml document to \n"
"\t stdout - along a wordset/exports/documentation DTD\n"
"\t options: -hidden -empty\n"
"\t EXTRA:\n"
"\t -w words create docbook for words manpages\n",
g_get_prgname());
return 1;
} |
___ gchar *filename = 0;
const gchar *styleflag = ""; const gchar* wordsxml = 0;
___ xml_GNode* node = 0; GError* error = 0;
int i; xml_GNode* tree = xml_g_node_new_data (":");
for (i=1; i < argc ; i++)
{
if (!strcmp (argv[i], "-w"))
{ i++; if (i < argc) wordsxml = argv[i]; continue; } |
if (argv[i][0] == '-')
{ styleflag = argv[i]; continue; } |
filename = argv[i];
node = xml_tree_node_from_file (node, filename, &error);
if (error)
xml_g_show_error (&error, "after parsing file:\n\t'%s'", filename);
if (! node) continue;
node = xml_pdoc_c_read (node);
if (!strstr (styleflag, "-nodocs"))
node = xml_pdoc_c_docs (node);
if (!strstr (styleflag, "-noblocks"))
node = xml_pdoc_c_blocks (node);
if (!strstr (styleflag, "-noblocc"))
node = xml_pdoc_c_blocc (node);
if (strstr (styleflag, "-usecdef"))
node = xml_pdoc_item_cdef (node);
if (!strstr (styleflag, "-noitem"))
node = xml_pdoc_item_bloc (node);
if (!strstr (styleflag, "-nowordset"))
node = xml_pdoc_pfe_wordset (node);
if (!strstr (styleflag, "-nofcode"))
node = xml_pdoc_pfe_grabfcode (node);
if (!strstr (styleflag, "-noforth"))
node = xml_pdoc_pfe_forthdocs (node);
if (!strstr (styleflag, "-noexports"))
node = xml_pdoc_pfe_wordsets_exports (node);
if (!strstr (styleflag, "-nonames"))
node = xml_pdoc_pfe_export_attributes (node);
xml_node_rename (node, "item_file");
xml_g_node_append (tree, node);
} |
if (strstr (styleflag, "-internal"))
{
xml_tree_dump_to_xml_file (
tree, 0, 1|xml_tree_dump_to_xml_flags (styleflag));
} | else{
xml_GNode* docs = xml_pdoc_pfe_make_wordset_tree (tree);
xml_tree_dump_to_xml_file (
docs, 0, 1|xml_tree_dump_to_xml_flags (styleflag));
if (wordsxml)
{
xml_GNode* words = xml_pdoc_pfe_wordsets_2_words_reference (
docs, "Manual Pages");
xml_tree_dump_to_xml_file (
words, wordsxml, 1|xml_tree_dump_to_xml_flags (styleflag));
} |
} |
return 0;
____;____;
} |
|