summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDanny Baumann <dannybaumann@web.de>2007-04-05 20:50:26 +0200
committerDanny Baumann <dannybaumann@web.de>2007-04-05 20:50:26 +0200
commitbfef1da6d9fb421303671c06de76533638080ab4 (patch)
treef3a02e89d1c9fb0075c36e68f2da77d42be610b1 /src
parent9e6dc30702292151048385f859cb53f76e7cbc11 (diff)
downloadbcop-bfef1da6d9fb421303671c06de76533638080ab4.tar.gz
bcop-bfef1da6d9fb421303671c06de76533638080ab4.tar.bz2
bcop: fixed schema creation if option --schema is passed
Diffstat (limited to 'src')
-rw-r--r--src/schema_generator.c4
-rw-r--r--src/xml_parser.c21
2 files changed, 25 insertions, 0 deletions
diff --git a/src/schema_generator.c b/src/schema_generator.c
index ecddfc5..9209a7d 100644
--- a/src/schema_generator.c
+++ b/src/schema_generator.c
@@ -426,6 +426,8 @@ void gconfWriteSchema(int is_general)
int genSchema(char *sch)
{
int rv=0;
+
+ printf("Creating \"%s\"...", sch);
schemaFile = fopen(sch,"w");
if (!schemaFile)
{
@@ -442,5 +444,7 @@ int genSchema(char *sch)
rv=2; // unknown mode
}
fclose(schemaFile);
+
+ printf("done.\n");
return rv;
}
diff --git a/src/xml_parser.c b/src/xml_parser.c
index 30ba393..d8b2b3d 100644
--- a/src/xml_parser.c
+++ b/src/xml_parser.c
@@ -941,14 +941,35 @@ int main(int argc, char **argv)
case OPT_SOURCE:
if (optarg)
src = optarg;
+
+ if (data.mode != GenNone)
+ {
+ fprintf(stderr,"%s: can only generate output for one code/schema target\n",programName);
+ return 1;
+ }
+ data.mode = CodeCompiz;
break;
case OPT_HEADER:
if (optarg)
hdr = optarg;
+
+ if (data.mode != GenNone)
+ {
+ fprintf(stderr,"%s: can only generate output for one code/schema target\n",programName);
+ return 1;
+ }
+ data.mode = CodeCompiz;
break;
case OPT_SCHEMA:
if (optarg)
sch = optarg;
+
+ if (data.mode != GenNone)
+ {
+ fprintf(stderr,"%s: can only generate output for one code/schema target\n",programName);
+ return 1;
+ }
+ data.mode = SchemaGConf;
break;
case 0: /* Returned when auto-set stuff is in effect */
break;