1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-24 09:27:52 +03:00

Rename GinLogicValue to GinTernaryValue.

It's more descriptive. Also, get rid of the enum, and use #defines instead,
per Greg Stark's suggestion.
This commit is contained in:
Heikki Linnakangas
2014-03-31 10:26:38 +03:00
parent 7317d8d961
commit 0cfa34c25a
7 changed files with 56 additions and 52 deletions

View File

@@ -47,20 +47,22 @@ typedef struct GinStatsData
int32 ginVersion;
} GinStatsData;
/* ginlogic.c */
enum GinLogicValueEnum
{
GIN_FALSE = 0, /* item is not present / does not match */
GIN_TRUE = 1, /* item is present / matches */
GIN_MAYBE = 2 /* don't know if item is present / don't know if
/*
* A ternary value used by tri-consistent functions.
*
* For convenience, this is compatible with booleans. A boolean can be
* safely cast to a GinTernaryValue.
*/
typedef char GinTernaryValue;
#define GIN_FALSE 0 /* item is not present / does not match */
#define GIN_TRUE 1 /* item is present / matches */
#define GIN_MAYBE 2 /* don't know if item is present / don't know if
* matches */
};
typedef char GinLogicValue;
#define DatumGetGinLogicValue(X) ((GinLogicValue)(X))
#define GinLogicValueGetDatum(X) ((Datum)(X))
#define PG_RETURN_GIN_LOGIC_VALUE(x) return GinLogicValueGetDatum(x)
#define DatumGetGinTernaryValue(X) ((GinTernaryValue)(X))
#define GinTernaryValueGetDatum(X) ((Datum)(X))
#define PG_RETURN_GIN_TERNARY_VALUE(x) return GinTernaryValueGetDatum(x)
/* GUC parameter */
extern PGDLLIMPORT int GinFuzzySearchLimit;