- FILE *out;
- if (!(out = fopen(filename,"w")))
- {
- fprintf(stderr, "error in openinf file %s\n", filename);
- exit(-1);
- }
- else
- {
- fprintf(out,"<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n\n");
- fprintf(out,"<rdf:RDF xml:lang=\"en\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" xmlns:h=\"http://www.cs.unibo.it/helm/schemas/mattone.rdf#\">\n");
- fprintf(out,"\t<h:Object rdf:about=\"");
- fprintf(out,"%s",file_uri);
- fprintf(out,"\">\n");
- print_all(out);
- fprintf(out,"\t</h:Object>\n");
- fprintf(out,"</rdf:RDF>\n");
- fclose(out);
- }
+ struct stat buf;
+
+ char *pghost,
+ *pgport,
+ *pgoptions,
+ *pgtty;
+ char *dbName;
+
+ /* FILE *debug; */
+
+ PGresult *res;
+
+ if (argc != 3)
+ {
+ fprintf(stderr, "Usage: meta_ind <object_uri> <inductive_type_file>\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
+ * defaults by looking up environment variables or, failing that,
+ * using hardwired constants
+ */
+
+ /* make a connection to the database */
+ conn = PQconnectdb("user=helm dbname=mowgli");
+
+ /*
+ * check to see that the backend connection was successfully made
+ */
+ if (PQstatus(conn) == CONNECTION_BAD)
+ {
+ fprintf(stderr, "Connection to database '%s' failed.\n", dbName);
+ fprintf(stderr, "%s", PQerrorMessage(conn));
+ exit_nicely(conn);
+ }
+
+ /* debug = fopen("/tmp/trace.out","w"); */
+ /* PQtrace(conn, debug); */
+
+ source_uri = malloc((sizeof('a')*2000));
+ source_uri_prefix=argv[1];
+ /* fprintf(stderr,"qua"); */
+ yyin = fopen(argv[2], "r");
+ yylex();
+
+ return 0;