staticvoid
help(constchar *progname)
{
printf(_("%s is the PostgreSQL embedded SQL preprocessor for C programs.\n\n"),
progname);
printf(_("Usage:\n" " %s [OPTION]... FILE...\n\n"),
progname);
printf(_("Options:\n"));
printf(_(" -c automatically generate C code from embedded SQL code;\n" " this affects EXEC SQL TYPE\n"));
printf(_(" -C MODE set compatibility mode; MODE can be one of\n" " \"INFORMIX\", \"INFORMIX_SE\", \"ORACLE\"\n")); #ifdef YYDEBUG
printf(_(" -d generate parser debug output\n")); #endif
printf(_(" -D SYMBOL define SYMBOL\n"));
printf(_(" -h parse a header file, this option includes option \"-c\"\n"));
printf(_(" -i parse system include files as well\n"));
printf(_(" -I DIRECTORY search DIRECTORY for include files\n"));
printf(_(" -o OUTFILE write result to OUTFILE\n"));
printf(_(" -r OPTION specify run-time behavior; OPTION can be:\n" " \"no_indicator\", \"prepare\", \"questionmarks\"\n"));
printf(_(" --regression run in regression testing mode\n"));
printf(_(" -t turn on autocommit of transactions\n"));
printf(_(" -V, --version output version information, then exit\n"));
printf(_(" -?, --help show this help, then exit\n"));
printf(_("\nIf no output file is specified, the name is formed by adding .c to the\n" "input file name, after stripping off .pgc if present.\n"));
printf(_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
printf(_("%s home page: <%s>\n"), PACKAGE_NAME, PACKAGE_URL);
}
if (verbose)
{
fprintf(stderr,
_("%s, the PostgreSQL embedded C preprocessor, version %s\n"),
progname, PG_VERSION);
fprintf(stderr, _("EXEC SQL INCLUDE ... search starts here:\n")); for (ip = include_paths; ip != NULL; ip = ip->next)
fprintf(stderr, " %s\n", ip->path);
fprintf(stderr, _("end of search list\n")); return0;
}
if (optind >= argc) /* no files specified */
{
fprintf(stderr, _("%s: no input files specified\n"), progname);
fprintf(stderr, _("Try \"%s --help\" for more information.\n"), argv[0]); return ILLEGAL_OPTION;
} else
{ /* after the options there must not be anything but filenames */ for (fnr = optind; fnr < argc; fnr++)
{ char *ptr2ext;
/* If argv[fnr] is "-" we have to read from stdin */ if (strcmp(argv[fnr], "-") == 0)
{
input_filename = mm_alloc(strlen("stdin") + 1);
strcpy(input_filename, "stdin");
base_yyin = stdin;
} else
{
input_filename = mm_alloc(strlen(argv[fnr]) + 5);
strcpy(input_filename, argv[fnr]);
/* take care of relative paths */
ptr2ext = last_dir_separator(input_filename);
ptr2ext = (ptr2ext ? strrchr(ptr2ext, '.') : strrchr(input_filename, '.'));
/* no extension? */ if (ptr2ext == NULL)
{
ptr2ext = input_filename + strlen(input_filename);
/* finally the actual connection */
connection = NULL;
/* initialize lex */
lex_init();
/* we need several includes */ /* but not if we are in header mode */ if (regression_mode)
fprintf(base_yyout, "/* Processed by ecpg (regression mode) */\n"); else
fprintf(base_yyout, "/* Processed by ecpg (%s) */\n", PG_VERSION);
if (header_mode == false)
{
fprintf(base_yyout, "/* These include files are added by the preprocessor */\n#include <ecpglib.h>\n#include <ecpgerrno.h>\n#include <sqlca.h>\n");
/* add some compatibility headers */ if (INFORMIX_MODE)
fprintf(base_yyout, "/* Needed for informix compatibility */\n#include <ecpg_informix.h>\n");
fprintf(base_yyout, "/* End of automatic include section */\n");
}
if (regression_mode)
fprintf(base_yyout, "#define ECPGdebug(X,Y) ECPGdebug((X)+100,(Y))\n");
output_line_number();
/* and parse the source */
base_yyparse();
/* *Checkwhetherallcursorswereindeedopened.Itdoesnot *reallymakesensetodeclareacursorbutnotopenit.
*/ for (ptr = cur; ptr != NULL; ptr = ptr->next) if (!(ptr->opened))
mmerror(PARSE_ERROR, ET_WARNING, "cursor \"%s\" has been declared but not opened", ptr->name);
if (base_yyin != NULL && base_yyin != stdin)
fclose(base_yyin); if (out_option == 0 && base_yyout != stdout)
fclose(base_yyout);
/* *Iftherewasanerror,deletetheoutputfile.
*/ if (ret_value != 0)
{ if (strcmp(output_filename, "-") != 0 && unlink(output_filename) != 0)
fprintf(stderr, _("could not remove output file \"%s\"\n"), output_filename);
}
}
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.