diff options
Diffstat (limited to 'contrib/seg')
| -rw-r--r-- | contrib/seg/seg.c | 10 | ||||
| -rw-r--r-- | contrib/seg/segdata.h | 12 | ||||
| -rw-r--r-- | contrib/seg/segparse.y | 8 | ||||
| -rw-r--r-- | contrib/seg/segscan.l | 10 |
4 files changed, 14 insertions, 26 deletions
diff --git a/contrib/seg/seg.c b/contrib/seg/seg.c index 0807e238f1..8e2d5343ae 100644 --- a/contrib/seg/seg.c +++ b/contrib/seg/seg.c @@ -23,15 +23,6 @@ PG_MODULE_MAGIC; -extern int seg_yyparse(SEG *result); -extern void seg_yyerror(SEG *result, const char *message); -extern void seg_scanner_init(const char *str); -extern void seg_scanner_finish(void); - -/* -extern int seg_yydebug; -*/ - /* * Auxiliary data structure for picksplit method. */ @@ -103,7 +94,6 @@ bool seg_different(SEG *a, SEG *b); ** Auxiliary funxtions */ static int restore(char *s, float val, int n); -int significant_digits(char *s); /***************************************************************************** diff --git a/contrib/seg/segdata.h b/contrib/seg/segdata.h index 90be6e27aa..cac68ee2b2 100644 --- a/contrib/seg/segdata.h +++ b/contrib/seg/segdata.h @@ -10,3 +10,15 @@ typedef struct SEG char l_ext; char u_ext; } SEG; + +/* in seg.c */ +extern int significant_digits(char *str); + +/* in segscan.l */ +extern int seg_yylex(void); +extern void seg_yyerror(SEG *result, const char *message) pg_attribute_noreturn(); +extern void seg_scanner_init(const char *str); +extern void seg_scanner_finish(void); + +/* in segparse.y */ +extern int seg_yyparse(SEG *result); diff --git a/contrib/seg/segparse.y b/contrib/seg/segparse.y index 3fad9910bd..045ff91f3e 100644 --- a/contrib/seg/segparse.y +++ b/contrib/seg/segparse.y @@ -7,6 +7,7 @@ #include "fmgr.h" #include "utils/builtins.h" + #include "segdata.h" /* @@ -20,13 +21,6 @@ #define YYMALLOC palloc #define YYFREE pfree -extern int seg_yylex(void); - -extern int significant_digits(char *str); /* defined in seg.c */ - -extern int seg_yyparse(SEG *result); -extern void seg_yyerror(SEG *result, const char *message); - static float seg_atof(char *value); static char strbuf[25] = { diff --git a/contrib/seg/segscan.l b/contrib/seg/segscan.l index 5fe4a2c453..6db24fdd1f 100644 --- a/contrib/seg/segscan.l +++ b/contrib/seg/segscan.l @@ -3,8 +3,6 @@ * A scanner for EMP-style numeric ranges */ -#include "postgres.h" - /* No reason to constrain amount of data slurped */ #define YY_READ_BUF_SIZE 16777216 @@ -22,12 +20,6 @@ fprintf_to_ereport(const char *fmt, const char *msg) static YY_BUFFER_STATE scanbufhandle; static char *scanbuf; static int scanbuflen; - -/* flex 2.5.4 doesn't bother with a decl for this */ -int seg_yylex(void); - -void seg_scanner_init(const char *str); -void seg_scanner_finish(void); %} %option 8bit @@ -59,7 +51,7 @@ float ({integer}|{real})([eE]{integer})? %% -void pg_attribute_noreturn +void yyerror(SEG *result, const char *message) { if (*yytext == YY_END_OF_BUFFER_CHAR) |
