diff options
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/catalog/pg_amop.h | 12 | ||||
-rw-r--r-- | src/include/catalog/pg_amproc.h | 3 | ||||
-rw-r--r-- | src/include/catalog/pg_opclass.h | 4 | ||||
-rw-r--r-- | src/include/catalog/pg_operator.h | 10 | ||||
-rw-r--r-- | src/include/catalog/pg_proc.h | 16 | ||||
-rw-r--r-- | src/include/utils/builtins.h | 9 | ||||
-rw-r--r-- | src/include/utils/pg_lzcompress.h | 79 |
7 files changed, 126 insertions, 7 deletions
diff --git a/src/include/catalog/pg_amop.h b/src/include/catalog/pg_amop.h index 0cbaac53225..ef499d7afdc 100644 --- a/src/include/catalog/pg_amop.h +++ b/src/include/catalog/pg_amop.h @@ -7,7 +7,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: pg_amop.h,v 1.24 1999/09/29 21:13:30 wieck Exp $ + * $Id: pg_amop.h,v 1.25 1999/11/25 01:28:05 wieck Exp $ * * NOTES * the genbki.sh script reads this file and generates .bki @@ -349,6 +349,16 @@ DATA(insert OID = 0 ( 403 1768 1757 4 btreesel btreenpage )); DATA(insert OID = 0 ( 403 1768 1756 5 btreesel btreenpage )); /* + * nbtree lztext + */ + +DATA(insert OID = 0 ( 403 1663 1659 1 btreesel btreenpage )); +DATA(insert OID = 0 ( 403 1663 1660 2 btreesel btreenpage )); +DATA(insert OID = 0 ( 403 1663 1657 3 btreesel btreenpage )); +DATA(insert OID = 0 ( 403 1663 1662 4 btreesel btreenpage )); +DATA(insert OID = 0 ( 403 1663 1661 5 btreesel btreenpage )); + +/* * hash table _ops */ diff --git a/src/include/catalog/pg_amproc.h b/src/include/catalog/pg_amproc.h index 45d1b28587a..8adee475b0c 100644 --- a/src/include/catalog/pg_amproc.h +++ b/src/include/catalog/pg_amproc.h @@ -9,7 +9,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: pg_amproc.h,v 1.15 1999/09/29 21:13:30 wieck Exp $ + * $Id: pg_amproc.h,v 1.16 1999/11/25 01:28:05 wieck Exp $ * * NOTES * the genbki.sh script reads this file and generates .bki @@ -97,6 +97,7 @@ DATA(insert OID = 0 (403 1313 1315 1)); DATA(insert OID = 0 (403 810 836 1)); DATA(insert OID = 0 (403 935 926 1)); DATA(insert OID = 0 (403 1768 1769 1)); +DATA(insert OID = 0 (403 1663 1636 1)); /* hash */ diff --git a/src/include/catalog/pg_opclass.h b/src/include/catalog/pg_opclass.h index 8b670e3e076..0284d083352 100644 --- a/src/include/catalog/pg_opclass.h +++ b/src/include/catalog/pg_opclass.h @@ -7,7 +7,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: pg_opclass.h,v 1.22 1999/11/23 04:47:39 momjian Exp $ + * $Id: pg_opclass.h,v 1.23 1999/11/25 01:28:05 wieck Exp $ * * NOTES * the genbki.sh script reads this file and generates .bki @@ -117,5 +117,7 @@ DATA(insert OID = 652 ( cidr_ops 650 )); DESCR(""); DATA(insert OID = 1768 ( numeric_ops 1700 )); DESCR(""); +DATA(insert OID = 1663 ( lztext_ops 1625 )); +DESCR(""); #endif /* PG_OPCLASS_H */ diff --git a/src/include/catalog/pg_operator.h b/src/include/catalog/pg_operator.h index 00d19560b93..b572b0b01a3 100644 --- a/src/include/catalog/pg_operator.h +++ b/src/include/catalog/pg_operator.h @@ -7,7 +7,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: pg_operator.h,v 1.61 1999/11/22 17:56:37 momjian Exp $ + * $Id: pg_operator.h,v 1.62 1999/11/25 01:28:05 wieck Exp $ * * NOTES * the genbki.sh script reads this file and generates .bki @@ -687,6 +687,14 @@ DATA(insert OID = 1761 ( "/" PGUID 0 b t f 1700 1700 1700 0 0 0 0 numeric DATA(insert OID = 1762 ( "%" PGUID 0 b t f 1700 1700 1700 0 0 0 0 numeric_mod - - )); DATA(insert OID = 1763 ( "@" PGUID 0 l t f 0 1700 1700 0 0 0 0 numeric_abs - - )); +/* LZTEXT type */ +DATA(insert OID = 1657 ( "=" PGUID 0 b t f 1625 1625 16 1657 1658 1659 1659 lztext_eq eqsel eqjoinsel )); +DATA(insert OID = 1658 ( "<>" PGUID 0 b t f 1625 1625 16 1658 1657 0 0 lztext_ne neqsel neqjoinsel )); +DATA(insert OID = 1659 ( "<" PGUID 0 b t f 1625 1625 16 1661 1662 0 0 lztext_lt intltsel intltjoinsel )); +DATA(insert OID = 1660 ( "<=" PGUID 0 b t f 1625 1625 16 1662 1661 0 0 lztext_le intltsel intltjoinsel )); +DATA(insert OID = 1661 ( ">" PGUID 0 b t f 1625 1625 16 1659 1660 0 0 lztext_gt intgtsel intgtjoinsel )); +DATA(insert OID = 1662 ( ">=" PGUID 0 b t f 1625 1625 16 1660 1659 0 0 lztext_ge intgtsel intgtjoinsel )); + /* diff --git a/src/include/catalog/pg_proc.h b/src/include/catalog/pg_proc.h index bb2a5b6dd7f..2cf19d5788c 100644 --- a/src/include/catalog/pg_proc.h +++ b/src/include/catalog/pg_proc.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: pg_proc.h,v 1.106 1999/11/17 21:21:50 wieck Exp $ + * $Id: pg_proc.h,v 1.107 1999/11/25 01:28:05 wieck Exp $ * * NOTES * The script catalog/genbki.sh reads this file and generates .bki @@ -2359,6 +2359,20 @@ DATA(insert OID = 1634 ( lztextoctetlen PGUID 11 f t t 1 f 23 "1625" 100 0 DESCR("octet length"); DATA(insert OID = 1635 ( octet_length PGUID 11 f t t 1 f 23 "1625" 100 0 1 0 lztextoctetlen - )); DESCR("octet length"); +DATA(insert OID = 1636 ( lztext_cmp PGUID 11 f t t 2 f 23 "1625 1625" 100 0 1 0 lztext_cmp - )); +DESCR("compare lztext vs. lztext"); +DATA(insert OID = 1637 ( lztext_eq PGUID 11 f t t 2 f 16 "1625 1625" 100 0 1 0 lztext_eq - )); +DESCR("equal"); +DATA(insert OID = 1638 ( lztext_ne PGUID 11 f t t 2 f 16 "1625 1625" 100 0 1 0 lztext_ne - )); +DESCR("not equal"); +DATA(insert OID = 1639 ( lztext_gt PGUID 11 f t t 2 f 16 "1625 1625" 100 0 1 0 lztext_gt - )); +DESCR("greater-than"); +DATA(insert OID = 1654 ( lztext_ge PGUID 11 f t t 2 f 16 "1625 1625" 100 0 1 0 lztext_ge - )); +DESCR("greater-than-or-equal"); +DATA(insert OID = 1655 ( lztext_lt PGUID 11 f t t 2 f 16 "1625 1625" 100 0 1 0 lztext_lt - )); +DESCR("lower-than"); +DATA(insert OID = 1656 ( lztext_le PGUID 11 f t t 2 f 16 "1625 1625" 100 0 1 0 lztext_le - )); +DESCR("lower-than-or-equal"); /* diff --git a/src/include/utils/builtins.h b/src/include/utils/builtins.h index 1bf3273ca13..0b24dbab3fe 100644 --- a/src/include/utils/builtins.h +++ b/src/include/utils/builtins.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: builtins.h,v 1.90 1999/11/17 21:21:51 wieck Exp $ + * $Id: builtins.h,v 1.91 1999/11/25 01:28:07 wieck Exp $ * * NOTES * This should normally only be included by fmgr.h. @@ -635,5 +635,12 @@ text *lztext_text(lztext *lz); lztext *text_lztext(text *txt); int32 lztextlen(lztext *lz); int32 lztextoctetlen(lztext *lz); +int32 lztext_cmp(lztext *lz1, lztext *lz2); +bool lztext_eq(lztext *lz1, lztext *lz2); +bool lztext_ne(lztext *lz1, lztext *lz2); +bool lztext_gt(lztext *lz1, lztext *lz2); +bool lztext_ge(lztext *lz1, lztext *lz2); +bool lztext_lt(lztext *lz1, lztext *lz2); +bool lztext_le(lztext *lz1, lztext *lz2); #endif /* BUILTINS_H */ diff --git a/src/include/utils/pg_lzcompress.h b/src/include/utils/pg_lzcompress.h index 481fd24fab8..9e3d3f32945 100644 --- a/src/include/utils/pg_lzcompress.h +++ b/src/include/utils/pg_lzcompress.h @@ -1,7 +1,7 @@ /* ---------- * pg_lzcompress.h - * - * $Header: /cvsroot/pgsql/src/include/utils/pg_lzcompress.h,v 1.2 1999/11/17 22:18:46 wieck Exp $ + * $Header: /cvsroot/pgsql/src/include/utils/pg_lzcompress.h,v 1.3 1999/11/25 01:28:07 wieck Exp $ * * Definitions for the builtin LZ compressor * ---------- @@ -111,6 +111,26 @@ typedef struct PGLZ_Strategy { /* ---------- + * PGLZ_DecompState - + * + * Decompression state variable for byte-per-byte decompression + * using pglz_decomp_getchar() macro. + * ---------- + */ +typedef struct PGLZ_DecompState { + unsigned char *temp_buf; + unsigned char *cp_in; + unsigned char *cp_end; + unsigned char *cp_out; + unsigned char *cp_copy; + int (*next_char)(struct PGLZ_DecompState *dstate); + int tocopy; + int ctrl_count; + unsigned char ctrl; +} PGLZ_DecompState; + + +/* ---------- * The standard strategies * * PGLZ_strategy_default Starts compression only if input is @@ -140,6 +160,55 @@ extern PGLZ_Strategy *PGLZ_strategy_never; /* ---------- + * pglz_decomp_getchar - + * + * Get next character (or EOF) from decompressor. + * The status variable must be initialized before and deinitialized + * after compression with the next two macros below. + * ---------- + */ +#define pglz_decomp_getchar(_ds) \ + ((*((_ds)->next_char))((_ds))) + + +/* ---------- + * pglz_decomp_init - + * + * Initialize a decomp state from a compressed input. + * ---------- + */ +#define pglz_decomp_init(_ds,_lz) { \ + (_ds)->cp_in = ((unsigned char *)(_lz)) \ + + sizeof(PGLZ_Header); \ + (_ds)->cp_end = (_ds)->cp_in + (_lz)->varsize \ + - sizeof(PGLZ_Header); \ + if (PGLZ_IS_COMPRESSED((_lz))) { \ + (_ds)->temp_buf = (unsigned char *) \ + palloc(PGLZ_RAW_SIZE((_lz))); \ + (_ds)->cp_out = (_ds)->temp_buf; \ + (_ds)->next_char = pglz_get_next_decomp_char_from_lzdata; \ + (_ds)->tocopy = 0; \ + (_ds)->ctrl_count = 0; \ + } else { \ + (_ds)->temp_buf = NULL; \ + (_ds)->next_char = pglz_get_next_decomp_char_from_plain; \ + } \ + } + + +/* ---------- + * pglz_decomp_end - + * + * Deallocate resources after decompression. + * ---------- + */ +#define pglz_decomp_end(_ds) { \ + if ((_ds)->temp_buf != NULL) \ + pfree((void *)((_ds)->temp_buf)); \ + } + + +/* ---------- * Global function declarations * ---------- */ @@ -148,5 +217,13 @@ int pglz_compress (char *source, int32 slen, PGLZ_Header *dest, int pglz_decompress (PGLZ_Header *source, char *dest); +/* ---------- + * Functions used by pglz_decomp_getchar(). + * Internal use only. + * ---------- + */ +extern int pglz_get_next_decomp_char_from_lzdata(PGLZ_DecompState *dstate); +extern int pglz_get_next_decomp_char_from_plain(PGLZ_DecompState *dstate); + #endif /* _PG_LZCOMPRESS_H_ */ |