int
main (int argc, char** argv)
{
xml_g_set_prgname(argv[0]);
if (argc < 2)
{
g_printerr ("> %s filename pos string [options]\n"
"\t the program reads an xml text to its internal format\n"
"\t and inserts some text at the given pos.\n",
g_get_prgname());
return 1;
} |
___ gchar *filename = 0;
const gchar *pos = 0, *str = 0, *styleflag = "";
{ int i ; for (i=1; i < argc ; i++) {
if (argv[i][0] == '-') { styleflag = argv[i]; continue; } |
if (! filename) { filename = argv[i]; continue; } |
if (! pos ) { pos = argv[i]; continue; } |
if (! str ) { str = argv[i]; continue; } |
g_warning ("extra argument on commandline, ignored: %s", argv[i]);
} | } |
___ xml_GNode* node; GError* error = 0;
node = xml_g_markup_parse_file (0, argv[1], &error);
if (error)
xml_g_show_error (&error, "after parsing file: '%s': %s", filename);
xml_node_text_insert (node, atoi(pos), str);
xml_tree_node_to_xml_file (node, 0);
return 0;
____;____;
} |
|