summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>2014-03-31 10:26:38 +0300
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>2014-03-31 10:26:38 +0300
commit0cfa34c25a7c8e7017cac346d954016fad0dfc16 (patch)
tree9b4158fef3a00431864290a38a964b329b144f6e /src/include
parent7317d8d961f210c3a6b20972cd605bcd9bffb06e (diff)
downloadpostgresql-0cfa34c25a7c8e7017cac346d954016fad0dfc16.tar.gz
Rename GinLogicValue to GinTernaryValue.
It's more descriptive. Also, get rid of the enum, and use #defines instead, per Greg Stark's suggestion.
Diffstat (limited to 'src/include')
-rw-r--r--src/include/access/gin.h26
-rw-r--r--src/include/access/gin_private.h2
2 files changed, 15 insertions, 13 deletions
diff --git a/src/include/access/gin.h b/src/include/access/gin.h
index 34f4405bf6..f1894274fb 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;
diff --git a/src/include/access/gin_private.h b/src/include/access/gin_private.h
index a7beed1f25..d11811acb5 100644
--- a/src/include/access/gin_private.h
+++ b/src/include/access/gin_private.h
@@ -763,7 +763,7 @@ typedef struct GinScanKeyData
/* array of check flags, reported to consistentFn */
bool *entryRes;
bool (*boolConsistentFn) (GinScanKey key);
- GinLogicValue (*triConsistentFn) (GinScanKey key);
+ GinTernaryValue (*triConsistentFn) (GinScanKey key);
FmgrInfo *consistentFmgrInfo;
FmgrInfo *triConsistentFmgrInfo;
Oid collation;