YoushouldhavereceivedacopyoftheGNUGeneralPublicLicense alongwiththisprogram;ifnot,writetotheFreeSoftware
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */
int main(int argc, char *argv[])
{ char* struct_name= argv[1]; char* infile_name= argv[2]; char* outfile_name= argv[3]; int rc; int query_length; int error= 0; char *err_ptr;
if (argc != 4)
die("Usage: comp_sql <struct_name> <sql_filename> <c_filename>");
/* Open input and output file */ if (!(in= fopen(infile_name, "r")))
die("Failed to open SQL file '%s'", infile_name); if (!(out= fopen(outfile_name, "w")))
die("Failed to open output file '%s'", outfile_name);
fprintf(out, "/*\n");
fprintf(out, " Do not edit this file, it is automatically generated from:\n");
fprintf(out, " <%s>\n", infile_name);
fprintf(out, "*/\n");
fprintf(out, "#include <stdlib.h>\n"); /* NULL */
fprintf(out, "const char* %s[]={\n", struct_name);
for ( ; ; )
{
rc= read_bootstrap_query(query, &query_length,
(fgets_input_t) in, fgets_fn, 1, &error);
if (rc == READ_BOOTSTRAP_EOF) break;
if (rc != READ_BOOTSTRAP_SUCCESS)
{ /* Get the most recent query text for reference. */
err_ptr= query + (query_length <= MAX_BOOTSTRAP_ERROR_LEN ? 0 : (query_length - MAX_BOOTSTRAP_ERROR_LEN)); switch (rc)
{ case READ_BOOTSTRAP_ERROR:
die("Failed to read the bootstrap input file. Return code (%d).\n" "Last query: '%s'\n", error, err_ptr); break;
case READ_BOOTSTRAP_QUERY_SIZE:
die("Failed to read the boostrap input file. Query size exceeded %d bytes.\n" "Last query: '%s'.\n", MAX_BOOTSTRAP_LINE_SIZE, err_ptr); break;
default:
die("Failed to read the boostrap input file. Unknown error.\n"); break;
}
}
print_query(out, query);
}
fprintf(out, "NULL\n};\n");
fclose(in);
fclose(out);
exit(0);
}
Messung V0.5 in Prozent
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.11Bemerkung:
(vorverarbeitet am 2026-10-08)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.