3434#define TS_EXEC_PHRASE_NO_POS TS_EXEC_PHRASE_AS_AND
3535#endif
3636
37- #ifndef TSTernaryValue
3837typedef enum
3938{
4039 TS_NO , /* definitely no match */
4140 TS_YES , /* definitely does match */
4241 TS_MAYBE /* can't verify match for lack of pos data */
43- } TSTernaryValue ;
44- typedef TSTernaryValue (* TSExecuteCallbackTernary ) (void * arg , QueryOperand * val , ExecPhraseData * data );
45- #endif
42+ } RumTernaryValue ;
43+ typedef RumTernaryValue (* RumExecuteCallbackTernary ) (void * arg , QueryOperand * val , ExecPhraseData * data );
44+
4645
4746PG_FUNCTION_INFO_V1 (rum_extract_tsvector );
4847PG_FUNCTION_INFO_V1 (rum_extract_tsvector_hash );
@@ -70,19 +69,19 @@ static Datum build_tsvector_hash_entry(TSVector vector, WordEntry *we);
7069static Datum build_tsquery_entry (TSQuery query , QueryOperand * operand );
7170static Datum build_tsquery_hash_entry (TSQuery query , QueryOperand * operand );
7271
73- static TSTernaryValue
72+ static RumTernaryValue
7473rum_phrase_output (ExecPhraseData * data , ExecPhraseData * Ldata , ExecPhraseData * Rdata ,
7574 int emit ,
7675 int Loffset ,
7776 int Roffset ,
7877 int max_npos );
79- static TSTernaryValue
78+ static RumTernaryValue
8079rum_phrase_execute (QueryItem * curitem , void * arg , uint32 flags ,
81- TSExecuteCallbackTernary chkcond ,
80+ RumExecuteCallbackTernary chkcond ,
8281 ExecPhraseData * data );
83- static TSTernaryValue
82+ static RumTernaryValue
8483rum_TS_execute (QueryItem * curitem , void * arg , uint32 flags ,
85- TSExecuteCallbackTernary chkcond );
84+ RumExecuteCallbackTernary chkcond );
8685
8786typedef Datum (* TSVectorEntryBuilder )(TSVector vector , WordEntry * we );
8887typedef Datum (* TSQueryEntryBuilder )(TSQuery query , QueryOperand * operand );
@@ -229,7 +228,7 @@ rum_tsquery_pre_consistent(PG_FUNCTION_ARGS)
229228}
230229
231230
232- static TSTernaryValue
231+ static RumTernaryValue
233232checkcondition_rum (void * checkval , QueryOperand * val , ExecPhraseData * data )
234233{
235234 RumChkVal * gcv = (RumChkVal * ) checkval ;
@@ -302,13 +301,13 @@ checkcondition_rum(void *checkval, QueryOperand *val, ExecPhraseData *data)
302301 * "!word:A" can mean both: "word:BCВ" or "!word"
303302 */
304303 else if (val -> weight == 0 )
305- /* Query without weigths */
304+ /* Query without weights */
306305 return TS_YES ;
307306 else
308307 {
309308 char KeyWeightsMask = 0 ;
310309
311- /* Fill KeyWeightMask contains with weigths from all positions */
310+ /* Fill KeyWeightMask contains with weights from all positions */
312311 for (i = 0 ; i < npos ; i ++ )
313312 {
314313 ptrt = decompress_pos (ptrt , & post );
@@ -339,7 +338,7 @@ checkcondition_rum(void *checkval, QueryOperand *val, ExecPhraseData *data)
339338 * negative positions, which won't fit into WordEntryPos.
340339 *
341340 * The result is boolean (TS_YES or TS_NO), but for the caller's convenience
342- * we return it as TSTernaryValue .
341+ * we return it as RumTernaryValue .
343342 *
344343 * Returns TS_YES if any positions were emitted to *data; or if data is NULL,
345344 * returns TS_YES if any positions would have been emitted.
@@ -348,7 +347,7 @@ checkcondition_rum(void *checkval, QueryOperand *val, ExecPhraseData *data)
348347#define TSPO_R_ONLY 0x02 /* emit positions appearing only in R */
349348#define TSPO_BOTH 0x04 /* emit positions appearing in both L&R */
350349
351- static TSTernaryValue
350+ static RumTernaryValue
352351rum_phrase_output (ExecPhraseData * data ,
353352 ExecPhraseData * Ldata ,
354353 ExecPhraseData * Rdata ,
@@ -481,22 +480,22 @@ rum_phrase_output(ExecPhraseData *data,
481480 * the starts. (This unintuitive rule is needed to avoid possibly generating
482481 * negative positions, which wouldn't fit into the WordEntryPos arrays.)
483482 *
484- * If the TSExecuteCallback function reports that an operand is present
483+ * If the RumExecuteCallback function reports that an operand is present
485484 * but fails to provide position(s) for it, we will return TS_MAYBE when
486485 * it is possible but not certain that the query is matched.
487486 *
488487 * When the function returns TS_NO or TS_MAYBE, it must return npos = 0,
489488 * negate = false (which is the state initialized by the caller); but the
490489 * "width" output in such cases is undefined.
491490 */
492- static TSTernaryValue
491+ static RumTernaryValue
493492rum_phrase_execute (QueryItem * curitem , void * arg , uint32 flags ,
494- TSExecuteCallbackTernary chkcond ,
493+ RumExecuteCallbackTernary chkcond ,
495494 ExecPhraseData * data )
496495{
497496 ExecPhraseData Ldata ,
498497 Rdata ;
499- TSTernaryValue lmatch ,
498+ RumTernaryValue lmatch ,
500499 rmatch ;
501500 int Loffset ,
502501 Roffset ,
@@ -737,12 +736,11 @@ rum_phrase_execute(QueryItem *curitem, void *arg, uint32 flags,
737736 * chkcond: callback function to check whether a primitive value is present
738737 */
739738
740- static TSTernaryValue
739+ static RumTernaryValue
741740rum_TS_execute (QueryItem * curitem , void * arg , uint32 flags ,
742- TSExecuteCallbackTernary chkcond )
741+ RumExecuteCallbackTernary chkcond )
743742{
744- TSTernaryValue lmatch ;
745-
743+ RumTernaryValue lmatch ;
746744 /* since this function recurses, it could be driven to stack overflow */
747745 check_stack_depth ();
748746
@@ -847,7 +845,7 @@ rum_tsquery_consistent(PG_FUNCTION_ARGS)
847845 Datum * addInfo = (Datum * ) PG_GETARG_POINTER (8 );
848846 bool * addInfoIsNull = (bool * ) PG_GETARG_POINTER (9 );
849847
850- TSTernaryValue res = TS_NO ;
848+ RumTernaryValue res = TS_NO ;
851849
852850 /*
853851 * The query doesn't require recheck by default
@@ -892,7 +890,7 @@ rum_tsquery_timestamp_consistent(PG_FUNCTION_ARGS)
892890 bool * recheck = (bool * ) PG_GETARG_POINTER (5 );
893891 Datum * addInfo = (Datum * ) PG_GETARG_POINTER (8 );
894892 bool * addInfoIsNull = (bool * ) PG_GETARG_POINTER (9 );
895- TSTernaryValue res = TS_NO ;
893+ RumTernaryValue res = TS_NO ;
896894
897895 /*
898896 * The query requires recheck only if it involves weights
0 commit comments