X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fmetadata%2Fcreate_V7_mowgli%2FMETADATA%2Fmeta_lex.l;h=18ea05cc9941127c6f4b8712bcdd34d35a9b5f84;hb=1ee87baa9bc6f43ec3034843c54673dc785e3da9;hp=2f8c4b039f06204e2b77fb5831e52e84bd5038a3;hpb=cdb45d73b98f6abaf670229b48a8442e1db902fc;p=helm.git diff --git a/helm/metadata/create_V7_mowgli/METADATA/meta_lex.l b/helm/metadata/create_V7_mowgli/METADATA/meta_lex.l index 2f8c4b039..18ea05cc9 100644 --- a/helm/metadata/create_V7_mowgli/METADATA/meta_lex.l +++ b/helm/metadata/create_V7_mowgli/METADATA/meta_lex.l @@ -283,6 +283,12 @@ main(int argc, char *argv[]) PGconn *conn; PGresult *res; + if (argc != 4) + { + fprintf(stderr, "Usage: meta \n"); + exit(1); + } + /* * begin, by setting the parameters for a backend connection if the * parameters are null, then the system will try to use reasonable @@ -291,7 +297,7 @@ main(int argc, char *argv[]) */ /* make a connection to the database */ - conn = PQconnectdb("user=helm dbname=mowgli"); + conn = PQconnectdb("user=helm dbname=mowgli_test"); /* * check to see that the backend connection was successfully made @@ -310,16 +316,16 @@ main(int argc, char *argv[]) init_symbol_table(); // We process the body - if (!stat("tmp/body.xml",&buf)) + if (!stat(argv[2],&buf)) { - yyin = fopen("tmp/body.xml", "r"); + yyin = fopen(argv[2], "r"); position = INBODY; yylex(); fclose(yyin); } // We process the type - yyin = fopen("tmp/type.xml", "r"); + yyin = fopen(argv[3], "r"); position = INTYPE; first_child = HERE; no_open_source = 0; @@ -328,6 +334,8 @@ main(int argc, char *argv[]) yylex(); fclose(yyin); print_all(argv[1],conn); + + return 0; }