diff options
author | Tom Lane | 2003-09-14 01:52:25 +0000 |
---|---|---|
committer | Tom Lane | 2003-09-14 01:52:25 +0000 |
commit | 03e47392e0c383ea75a1aac9294c4e0f4eb4d20f (patch) | |
tree | 0723a85e046a0c1d43df1b8b433a5ffea905fd4e /contrib/cube/buffer.c | |
parent | b38c04335a3d09265ef1ccc26cc924b4edc5c9ca (diff) |
Make contrib/cube work with flex 2.5.31. Fix it up to have a real
btree operator class, too, since in PG 7.4 you can't GROUP without one.
Diffstat (limited to 'contrib/cube/buffer.c')
-rw-r--r-- | contrib/cube/buffer.c | 85 |
1 files changed, 0 insertions, 85 deletions
diff --git a/contrib/cube/buffer.c b/contrib/cube/buffer.c deleted file mode 100644 index 3a1b7288128..00000000000 --- a/contrib/cube/buffer.c +++ /dev/null @@ -1,85 +0,0 @@ -/* This module defines the parse buffer and routines for setting/reading it */ - -#include "postgres.h" - -static char *PARSE_BUFFER; -static char *PARSE_BUFFER_PTR; -static unsigned int PARSE_BUFFER_SIZE; -static unsigned int SCANNER_POS; - -void set_parse_buffer(char *s); -void reset_parse_buffer(void); -int read_parse_buffer(void); -char *parse_buffer(void); -char *parse_buffer_ptr(void); -unsigned int parse_buffer_curr_char(void); -unsigned int parse_buffer_size(void); -unsigned int parse_buffer_pos(void); - -extern void cube_flush_scanner_buffer(void); /* defined in cubescan.l */ - -void -set_parse_buffer(char *s) -{ - PARSE_BUFFER = s; - PARSE_BUFFER_SIZE = strlen(s); - if (PARSE_BUFFER_SIZE == 0) - ereport(ERROR, - (errcode(ERRCODE_ZERO_LENGTH_CHARACTER_STRING), - errmsg("can't parse an empty string"))); - - PARSE_BUFFER_PTR = PARSE_BUFFER; - SCANNER_POS = 0; -} - -void -reset_parse_buffer(void) -{ - PARSE_BUFFER_PTR = PARSE_BUFFER; - SCANNER_POS = 0; - cube_flush_scanner_buffer(); -} - -int -read_parse_buffer(void) -{ - int c; - - /* - * c = *PARSE_BUFFER_PTR++; SCANNER_POS++; - */ - c = PARSE_BUFFER[SCANNER_POS]; - if (SCANNER_POS < PARSE_BUFFER_SIZE) - SCANNER_POS++; - return c; -} - -char * -parse_buffer(void) -{ - return PARSE_BUFFER; -} - -unsigned int -parse_buffer_curr_char(void) -{ - return PARSE_BUFFER[SCANNER_POS]; -} - -char * -parse_buffer_ptr(void) -{ - return PARSE_BUFFER_PTR; -} - -unsigned int -parse_buffer_pos(void) -{ - return SCANNER_POS; -} - -unsigned int -parse_buffer_size(void) -{ - return PARSE_BUFFER_SIZE; -} |