diff options
Diffstat (limited to 'src/include/utils/pg_lzcompress.h')
-rw-r--r-- | src/include/utils/pg_lzcompress.h | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/src/include/utils/pg_lzcompress.h b/src/include/utils/pg_lzcompress.h index dba52fa5888..481fd24fab8 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.1 1999/11/17 21:21:51 wieck Exp $ + * $Header: /cvsroot/pgsql/src/include/utils/pg_lzcompress.h,v 1.2 1999/11/17 22:18:46 wieck Exp $ * * Definitions for the builtin LZ compressor * ---------- @@ -37,9 +37,36 @@ typedef struct PGLZ_Header { */ #define PGLZ_MAX_OUTPUT(_dlen) ((_dlen) + (((_dlen) | 0x07) >> 3) \ + sizeof(PGLZ_Header)) + +/* ---------- + * PGLZ_RAW_SIZE - + * + * Macro to determine the uncompressed data size contained + * in the entry. + * ---------- + */ #define PGLZ_RAW_SIZE(_lzdata) (_lzdata->rawsize) + +/* ---------- + * PGLZ_IS_COMPRESSED - + * + * Macro to determine if the data itself is stored as raw + * uncompressed data. + * ---------- + */ #define PGLZ_IS_COMPRESSED(_lzdata) (_lzdata->varsize != \ - _lzdata->rawsize + sizeof(PGLZ_Header)) + _lzdata->rawsize + \ + sizeof(PGLZ_Header)) + +/* ---------- + * PGLZ_RAW_DATA - + * + * Macro to get access to the plain compressed or uncompressed + * data. Useful if PGLZ_IS_COMPRESSED returns false. + * ---------- + */ +#define PGLZ_RAW_DATA(_lzdata) (((char *)(_lzdata)) + \ + sizeof(PGLZ_Header)) /* ---------- * PGLZ_Strategy - |