Commit d1d61a8b authored by Alexander Korotkov's avatar Alexander Korotkov

Improve the signature of internal multirange functions

There is a set of *_internal() functions exposed in
include/utils/multirangetypes.h.  This commit improves the signatures of these
functions in two ways.
 * Add const qualifies where applicable.
 * Replace multirange typecache argument with range typecache argument.
   Multirange typecache was used solely to find the range typecache.  At the
   same time, range typecache is easier for the caller to find.
parent 4d7684cc
This diff is collapsed.
...@@ -14,8 +14,8 @@ ...@@ -14,8 +14,8 @@
#ifndef MULTIRANGETYPES_H #ifndef MULTIRANGETYPES_H
#define MULTIRANGETYPES_H #define MULTIRANGETYPES_H
#include "utils/rangetypes.h"
#include "utils/typcache.h" #include "utils/typcache.h"
#include "utils/expandeddatum.h"
/* /*
...@@ -56,33 +56,48 @@ typedef struct ...@@ -56,33 +56,48 @@ typedef struct
*/ */
/* internal versions of the above */ /* internal versions of the above */
extern bool multirange_eq_internal(TypeCacheEntry *typcache, MultirangeType *mr1, extern bool multirange_eq_internal(TypeCacheEntry *rangetyp,
MultirangeType *mr2); const MultirangeType *mr1,
extern bool multirange_ne_internal(TypeCacheEntry *typcache, MultirangeType *mr1, const MultirangeType *mr2);
MultirangeType *mr2); extern bool multirange_ne_internal(TypeCacheEntry *rangetyp,
extern bool multirange_contains_elem_internal(TypeCacheEntry *typcache, MultirangeType *mr, const MultirangeType *mr1,
const MultirangeType *mr2);
extern bool multirange_contains_elem_internal(TypeCacheEntry *rangetyp,
const MultirangeType *mr,
Datum elem); Datum elem);
extern bool multirange_contains_range_internal(TypeCacheEntry *typcache, MultirangeType *mr, extern bool multirange_contains_range_internal(TypeCacheEntry *rangetyp,
RangeType *r); const MultirangeType *mr,
extern bool range_contains_multirange_internal(TypeCacheEntry *typcache, RangeType *r, const RangeType *r);
MultirangeType *mr); extern bool range_contains_multirange_internal(TypeCacheEntry *rangetyp,
extern bool multirange_contains_multirange_internal(TypeCacheEntry *typcache, const RangeType *r,
MultirangeType *mr1, const MultirangeType *mr);
MultirangeType *mr2); extern bool multirange_contains_multirange_internal(TypeCacheEntry *rangetyp,
extern bool range_overlaps_multirange_internal(TypeCacheEntry *typcache, RangeType *r, const MultirangeType *mr1,
MultirangeType *mr); const MultirangeType *mr2);
extern bool multirange_overlaps_multirange_internal(TypeCacheEntry *typcache, extern bool range_overlaps_multirange_internal(TypeCacheEntry *rangetyp,
MultirangeType *mr1, const RangeType *r,
MultirangeType *mr2); const MultirangeType *mr);
extern bool range_before_multirange_internal(TypeCacheEntry *typcache, RangeType *r, extern bool multirange_overlaps_multirange_internal(TypeCacheEntry *rangetyp,
MultirangeType *mr); const MultirangeType *mr1,
extern bool range_after_multirange_internal(TypeCacheEntry *typcache, RangeType *r, const MultirangeType *mr2);
MultirangeType *mr); extern bool range_overleft_multirange_internal(TypeCacheEntry *rangetyp,
extern bool range_adjacent_multirange_internal(TypeCacheEntry *typcache, RangeType *r, const RangeType *r,
MultirangeType *mr); const MultirangeType *mr);
extern bool multirange_before_multirange_internal(TypeCacheEntry *typcache, extern bool range_overright_multirange_internal(TypeCacheEntry *rangetyp,
MultirangeType *mr1, const RangeType *r,
MultirangeType *mr2); const MultirangeType *mr);
extern bool range_before_multirange_internal(TypeCacheEntry *rangetyp,
const RangeType *r,
const MultirangeType *mr);
extern bool range_after_multirange_internal(TypeCacheEntry *rangetyp,
const RangeType *r,
const MultirangeType *mr);
extern bool range_adjacent_multirange_internal(TypeCacheEntry *rangetyp,
const RangeType *r,
const MultirangeType *mr);
extern bool multirange_before_multirange_internal(TypeCacheEntry *rangetyp,
const MultirangeType *mr1,
const MultirangeType *mr2);
extern MultirangeType *multirange_minus_internal(Oid mltrngtypoid, extern MultirangeType *multirange_minus_internal(Oid mltrngtypoid,
TypeCacheEntry *rangetyp, TypeCacheEntry *rangetyp,
int32 range_count1, int32 range_count1,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment