aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/ecpg/preproc/ecpg.header
diff options
context:
space:
mode:
Diffstat (limited to 'src/interfaces/ecpg/preproc/ecpg.header')
-rw-r--r--src/interfaces/ecpg/preproc/ecpg.header129
1 files changed, 0 insertions, 129 deletions
diff --git a/src/interfaces/ecpg/preproc/ecpg.header b/src/interfaces/ecpg/preproc/ecpg.header
index 8df6248c976..929ffa97aa0 100644
--- a/src/interfaces/ecpg/preproc/ecpg.header
+++ b/src/interfaces/ecpg/preproc/ecpg.header
@@ -60,137 +60,8 @@ struct variable no_indicator = {"no_indicator", &ecpg_no_indicator, 0, NULL};
static struct ECPGtype ecpg_query = {ECPGt_char_variable, NULL, NULL, NULL, {NULL}, 0};
-static void vmmerror(int error_code, enum errortype type, const char *error, va_list ap) pg_attribute_printf(3, 0);
-
static bool check_declared_list(const char *name);
-/*
- * Handle parsing errors and warnings
- */
-static void
-vmmerror(int error_code, enum errortype type, const char *error, va_list ap)
-{
- /* localize the error message string */
- error = _(error);
-
- fprintf(stderr, "%s:%d: ", input_filename, base_yylineno);
-
- switch (type)
- {
- case ET_WARNING:
- fprintf(stderr, _("WARNING: "));
- break;
- case ET_ERROR:
- fprintf(stderr, _("ERROR: "));
- break;
- }
-
- vfprintf(stderr, error, ap);
-
- fprintf(stderr, "\n");
-
- switch (type)
- {
- case ET_WARNING:
- break;
- case ET_ERROR:
- ret_value = error_code;
- break;
- }
-}
-
-void
-mmerror(int error_code, enum errortype type, const char *error,...)
-{
- va_list ap;
-
- va_start(ap, error);
- vmmerror(error_code, type, error, ap);
- va_end(ap);
-}
-
-void
-mmfatal(int error_code, const char *error,...)
-{
- va_list ap;
-
- va_start(ap, error);
- vmmerror(error_code, ET_ERROR, error, ap);
- va_end(ap);
-
- if (base_yyin)
- fclose(base_yyin);
- if (base_yyout)
- fclose(base_yyout);
-
- if (strcmp(output_filename, "-") != 0 && unlink(output_filename) != 0)
- fprintf(stderr, _("could not remove output file \"%s\"\n"), output_filename);
- exit(error_code);
-}
-
-/*
- * string concatenation
- */
-
-static char *
-cat2_str(char *str1, char *str2)
-{
- char *res_str = (char *) mm_alloc(strlen(str1) + strlen(str2) + 2);
-
- strcpy(res_str, str1);
- if (strlen(str1) != 0 && strlen(str2) != 0)
- strcat(res_str, " ");
- strcat(res_str, str2);
- free(str1);
- free(str2);
- return res_str;
-}
-
-static char *
-cat_str(int count,...)
-{
- va_list args;
- int i;
- char *res_str;
-
- va_start(args, count);
-
- res_str = va_arg(args, char *);
-
- /* now add all other strings */
- for (i = 1; i < count; i++)
- res_str = cat2_str(res_str, va_arg(args, char *));
-
- va_end(args);
-
- return res_str;
-}
-
-static char *
-make2_str(char *str1, char *str2)
-{
- char *res_str = (char *) mm_alloc(strlen(str1) + strlen(str2) + 1);
-
- strcpy(res_str, str1);
- strcat(res_str, str2);
- free(str1);
- free(str2);
- return res_str;
-}
-
-static char *
-make3_str(char *str1, char *str2, char *str3)
-{
- char *res_str = (char *) mm_alloc(strlen(str1) + strlen(str2) + strlen(str3) + 1);
-
- strcpy(res_str, str1);
- strcat(res_str, str2);
- strcat(res_str, str3);
- free(str1);
- free(str2);
- free(str3);
- return res_str;
-}
/*
* "Location tracking" support. We commandeer Bison's location tracking