summaryrefslogtreecommitdiff
path: root/src/include/access/gin.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/access/gin.h')
-rw-r--r--src/include/access/gin.h26
1 files changed, 14 insertions, 12 deletions
diff --git a/src/include/access/gin.h b/src/include/access/gin.h
index 34f4405bf69..f1894274fb3 100644
--- a/src/include/access/gin.h
+++ b/src/include/access/gin.h
@@ -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
- * matches */
-};
+/*
+ * 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;
-typedef char GinLogicValue;
+#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 */
-#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;