/***************************************
- $Header: /home/amb/routino/src/RCS/tagmodifier.c,v 1.5 2010/05/30 18:18:54 amb Exp $
+ $Header: /home/amb/routino/src/RCS/tagmodifier.c,v 1.7 2010/09/05 18:26:01 amb Exp $
Test application for OSM XML file parser / tagging rule testing.
#include <ctype.h>
#include <errno.h>
-#include "functions.h"
+#include "files.h"
#include "xmlparse.h"
#include "tagging.h"
/* Check the specified command line options */
- if(tagging && ExistsFile(tagging))
- ;
- else if(!tagging && ExistsFile("tagging.xml"))
- tagging="tagging.xml";
-
- if(tagging && ParseXMLTaggingRules(tagging))
+ if(tagging)
{
- fprintf(stderr,"Error: Cannot read the tagging rules in the file '%s'.\n",tagging);
- return(1);
+ if(!ExistsFile(tagging))
+ {
+ fprintf(stderr,"Error: The '--tagging' option specifies a file that does not exist.\n");
+ return(1);
+ }
+ }
+ else
+ {
+ if(ExistsFile("tagging.xml"))
+ tagging="tagging.xml";
+ else
+ {
+ fprintf(stderr,"Error: The '--tagging' option was not used and the default 'tagging.xml' does not exist.\n");
+ return(1);
+ }
}
- if(!tagging)
+ if(ParseXMLTaggingRules(tagging))
{
- fprintf(stderr,"Error: Cannot run without reading some tagging rules.\n");
+ fprintf(stderr,"Error: Cannot read the tagging rules in the file '%s'.\n",tagging);
return(1);
}
+ /* Open the input file */
+
if(filename)
{
file=fopen(filename,"rb");