mirror of
https://github.com/postgres/postgres.git
synced 2025-11-29 23:43:17 +03:00
Re-run pgindent with updated list of typedefs. (Updated README should
avoid this problem in the future.)
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/utils/adt/regexp.c,v 1.76 2007/11/15 21:14:39 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/utils/adt/regexp.c,v 1.77 2007/11/15 22:25:16 momjian Exp $
|
||||
*
|
||||
* Alistair Crooks added the code for the regex caching
|
||||
* agc - cached the regular expressions used - there's a good chance
|
||||
@@ -48,7 +48,7 @@ typedef struct pg_re_flags
|
||||
{
|
||||
int cflags; /* compile flags for Spencer's regex code */
|
||||
bool glob; /* do it globally (for each occurrence) */
|
||||
} pg_re_flags;
|
||||
} pg_re_flags;
|
||||
|
||||
/* cross-call state for regexp_matches(), also regexp_split() */
|
||||
typedef struct regexp_matches_ctx
|
||||
@@ -63,7 +63,7 @@ typedef struct regexp_matches_ctx
|
||||
/* workspace for build_regexp_matches_result() */
|
||||
Datum *elems; /* has npatterns elements */
|
||||
bool *nulls; /* has npatterns elements */
|
||||
} regexp_matches_ctx;
|
||||
} regexp_matches_ctx;
|
||||
|
||||
/*
|
||||
* We cache precompiled regular expressions using a "self organizing list"
|
||||
@@ -113,9 +113,9 @@ static regexp_matches_ctx *setup_regexp_matches(text *orig_str, text *pattern,
|
||||
bool force_glob,
|
||||
bool use_subpatterns,
|
||||
bool ignore_degenerate);
|
||||
static void cleanup_regexp_matches(regexp_matches_ctx * matchctx);
|
||||
static ArrayType *build_regexp_matches_result(regexp_matches_ctx * matchctx);
|
||||
static Datum build_regexp_split_result(regexp_matches_ctx * splitctx);
|
||||
static void cleanup_regexp_matches(regexp_matches_ctx *matchctx);
|
||||
static ArrayType *build_regexp_matches_result(regexp_matches_ctx *matchctx);
|
||||
static Datum build_regexp_split_result(regexp_matches_ctx *splitctx);
|
||||
|
||||
|
||||
/*
|
||||
@@ -345,7 +345,7 @@ RE_compile_and_execute(text *text_re, char *dat, int dat_len,
|
||||
* don't want some have to reject them after the fact.
|
||||
*/
|
||||
static void
|
||||
parse_re_flags(pg_re_flags * flags, text *opts)
|
||||
parse_re_flags(pg_re_flags *flags, text *opts)
|
||||
{
|
||||
/* regex_flavor is always folded into the compile flags */
|
||||
flags->cflags = regex_flavor;
|
||||
@@ -981,7 +981,7 @@ setup_regexp_matches(text *orig_str, text *pattern, text *flags,
|
||||
* cleanup_regexp_matches - release memory of a regexp_matches_ctx
|
||||
*/
|
||||
static void
|
||||
cleanup_regexp_matches(regexp_matches_ctx * matchctx)
|
||||
cleanup_regexp_matches(regexp_matches_ctx *matchctx)
|
||||
{
|
||||
pfree(matchctx->orig_str);
|
||||
pfree(matchctx->match_locs);
|
||||
@@ -996,7 +996,7 @@ cleanup_regexp_matches(regexp_matches_ctx * matchctx)
|
||||
* build_regexp_matches_result - build output array for current match
|
||||
*/
|
||||
static ArrayType *
|
||||
build_regexp_matches_result(regexp_matches_ctx * matchctx)
|
||||
build_regexp_matches_result(regexp_matches_ctx *matchctx)
|
||||
{
|
||||
Datum *elems = matchctx->elems;
|
||||
bool *nulls = matchctx->nulls;
|
||||
@@ -1136,7 +1136,7 @@ regexp_split_to_array_no_flags(PG_FUNCTION_ARGS)
|
||||
* or the string after the last match when next_match == nmatches.
|
||||
*/
|
||||
static Datum
|
||||
build_regexp_split_result(regexp_matches_ctx * splitctx)
|
||||
build_regexp_split_result(regexp_matches_ctx *splitctx)
|
||||
{
|
||||
int startpos;
|
||||
int endpos;
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
*
|
||||
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/backend/utils/adt/ri_triggers.c,v 1.98 2007/11/15 21:14:39 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/utils/adt/ri_triggers.c,v 1.99 2007/11/15 22:25:16 momjian Exp $
|
||||
*
|
||||
* ----------
|
||||
*/
|
||||
@@ -108,7 +108,7 @@ typedef struct RI_ConstraintInfo
|
||||
* PK) */
|
||||
Oid ff_eq_oprs[RI_MAX_NUMKEYS]; /* equality operators (FK =
|
||||
* FK) */
|
||||
} RI_ConstraintInfo;
|
||||
} RI_ConstraintInfo;
|
||||
|
||||
|
||||
/* ----------
|
||||
@@ -150,7 +150,7 @@ typedef struct RI_CompareKey
|
||||
{
|
||||
Oid eq_opr; /* the equality operator to apply */
|
||||
Oid typeid; /* the data type to apply it to */
|
||||
} RI_CompareKey;
|
||||
} RI_CompareKey;
|
||||
|
||||
|
||||
/* ----------
|
||||
@@ -163,7 +163,7 @@ typedef struct RI_CompareHashEntry
|
||||
bool valid; /* successfully initialized? */
|
||||
FmgrInfo eq_opr_finfo; /* call info for equality fn */
|
||||
FmgrInfo cast_func_finfo; /* in case we must coerce input */
|
||||
} RI_CompareHashEntry;
|
||||
} RI_CompareHashEntry;
|
||||
|
||||
|
||||
/* ----------
|
||||
@@ -188,23 +188,23 @@ static void ri_GenerateQual(StringInfo buf,
|
||||
static int ri_NullCheck(Relation rel, HeapTuple tup,
|
||||
RI_QueryKey *key, int pairidx);
|
||||
static void ri_BuildQueryKeyFull(RI_QueryKey *key,
|
||||
const RI_ConstraintInfo * riinfo,
|
||||
const RI_ConstraintInfo *riinfo,
|
||||
int32 constr_queryno);
|
||||
static void ri_BuildQueryKeyPkCheck(RI_QueryKey *key,
|
||||
const RI_ConstraintInfo * riinfo,
|
||||
const RI_ConstraintInfo *riinfo,
|
||||
int32 constr_queryno);
|
||||
static bool ri_KeysEqual(Relation rel, HeapTuple oldtup, HeapTuple newtup,
|
||||
const RI_ConstraintInfo * riinfo, bool rel_is_pk);
|
||||
const RI_ConstraintInfo *riinfo, bool rel_is_pk);
|
||||
static bool ri_AllKeysUnequal(Relation rel, HeapTuple oldtup, HeapTuple newtup,
|
||||
const RI_ConstraintInfo * riinfo, bool rel_is_pk);
|
||||
const RI_ConstraintInfo *riinfo, bool rel_is_pk);
|
||||
static bool ri_OneKeyEqual(Relation rel, int column,
|
||||
HeapTuple oldtup, HeapTuple newtup,
|
||||
const RI_ConstraintInfo * riinfo, bool rel_is_pk);
|
||||
const RI_ConstraintInfo *riinfo, bool rel_is_pk);
|
||||
static bool ri_AttributesEqual(Oid eq_opr, Oid typeid,
|
||||
Datum oldvalue, Datum newvalue);
|
||||
static bool ri_Check_Pk_Match(Relation pk_rel, Relation fk_rel,
|
||||
HeapTuple old_row,
|
||||
const RI_ConstraintInfo * riinfo);
|
||||
const RI_ConstraintInfo *riinfo);
|
||||
|
||||
static void ri_InitHashTables(void);
|
||||
static SPIPlanPtr ri_FetchPreparedPlan(RI_QueryKey *key);
|
||||
@@ -213,7 +213,7 @@ static RI_CompareHashEntry *ri_HashCompareOp(Oid eq_opr, Oid typeid);
|
||||
|
||||
static void ri_CheckTrigger(FunctionCallInfo fcinfo, const char *funcname,
|
||||
int tgkind);
|
||||
static void ri_FetchConstraintInfo(RI_ConstraintInfo * riinfo,
|
||||
static void ri_FetchConstraintInfo(RI_ConstraintInfo *riinfo,
|
||||
Trigger *trigger, Relation trig_rel, bool rel_is_pk);
|
||||
static SPIPlanPtr ri_PlanCheck(const char *querystr, int nargs, Oid *argtypes,
|
||||
RI_QueryKey *qkey, Relation fk_rel, Relation pk_rel,
|
||||
@@ -541,7 +541,7 @@ RI_FKey_check_upd(PG_FUNCTION_ARGS)
|
||||
static bool
|
||||
ri_Check_Pk_Match(Relation pk_rel, Relation fk_rel,
|
||||
HeapTuple old_row,
|
||||
const RI_ConstraintInfo * riinfo)
|
||||
const RI_ConstraintInfo *riinfo)
|
||||
{
|
||||
SPIPlanPtr qplan;
|
||||
RI_QueryKey qkey;
|
||||
@@ -2945,7 +2945,7 @@ ri_GenerateQual(StringInfo buf,
|
||||
* ----------
|
||||
*/
|
||||
static void
|
||||
ri_BuildQueryKeyFull(RI_QueryKey *key, const RI_ConstraintInfo * riinfo,
|
||||
ri_BuildQueryKeyFull(RI_QueryKey *key, const RI_ConstraintInfo *riinfo,
|
||||
int32 constr_queryno)
|
||||
{
|
||||
int i;
|
||||
@@ -3022,7 +3022,7 @@ ri_CheckTrigger(FunctionCallInfo fcinfo, const char *funcname, int tgkind)
|
||||
* Fetch the pg_constraint entry for the FK constraint, and fill *riinfo
|
||||
*/
|
||||
static void
|
||||
ri_FetchConstraintInfo(RI_ConstraintInfo * riinfo,
|
||||
ri_FetchConstraintInfo(RI_ConstraintInfo *riinfo,
|
||||
Trigger *trigger, Relation trig_rel, bool rel_is_pk)
|
||||
{
|
||||
Oid constraintOid = trigger->tgconstraint;
|
||||
@@ -3486,7 +3486,7 @@ ri_ReportViolation(RI_QueryKey *qkey, const char *constrname,
|
||||
* ----------
|
||||
*/
|
||||
static void
|
||||
ri_BuildQueryKeyPkCheck(RI_QueryKey *key, const RI_ConstraintInfo * riinfo,
|
||||
ri_BuildQueryKeyPkCheck(RI_QueryKey *key, const RI_ConstraintInfo *riinfo,
|
||||
int32 constr_queryno)
|
||||
{
|
||||
int i;
|
||||
@@ -3636,7 +3636,7 @@ ri_HashPreparedPlan(RI_QueryKey *key, SPIPlanPtr plan)
|
||||
*/
|
||||
static bool
|
||||
ri_KeysEqual(Relation rel, HeapTuple oldtup, HeapTuple newtup,
|
||||
const RI_ConstraintInfo * riinfo, bool rel_is_pk)
|
||||
const RI_ConstraintInfo *riinfo, bool rel_is_pk)
|
||||
{
|
||||
TupleDesc tupdesc = RelationGetDescr(rel);
|
||||
const int16 *attnums;
|
||||
@@ -3694,7 +3694,7 @@ ri_KeysEqual(Relation rel, HeapTuple oldtup, HeapTuple newtup,
|
||||
*/
|
||||
static bool
|
||||
ri_AllKeysUnequal(Relation rel, HeapTuple oldtup, HeapTuple newtup,
|
||||
const RI_ConstraintInfo * riinfo, bool rel_is_pk)
|
||||
const RI_ConstraintInfo *riinfo, bool rel_is_pk)
|
||||
{
|
||||
TupleDesc tupdesc = RelationGetDescr(rel);
|
||||
const int16 *attnums;
|
||||
@@ -3756,7 +3756,7 @@ ri_AllKeysUnequal(Relation rel, HeapTuple oldtup, HeapTuple newtup,
|
||||
*/
|
||||
static bool
|
||||
ri_OneKeyEqual(Relation rel, int column, HeapTuple oldtup, HeapTuple newtup,
|
||||
const RI_ConstraintInfo * riinfo, bool rel_is_pk)
|
||||
const RI_ConstraintInfo *riinfo, bool rel_is_pk)
|
||||
{
|
||||
TupleDesc tupdesc = RelationGetDescr(rel);
|
||||
const int16 *attnums;
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/utils/adt/selfuncs.c,v 1.240 2007/11/15 21:14:39 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/utils/adt/selfuncs.c,v 1.241 2007/11/15 22:25:16 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -3160,8 +3160,7 @@ convert_string_datum(Datum value, Oid typid)
|
||||
/*
|
||||
*
|
||||
* http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx
|
||||
* ?FeedbackID=99694
|
||||
*/
|
||||
* ?FeedbackID=99694 */
|
||||
{
|
||||
char x[1];
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/utils/adt/tsginidx.c,v 1.6 2007/11/15 21:14:39 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/utils/adt/tsginidx.c,v 1.7 2007/11/15 22:25:16 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -113,10 +113,10 @@ typedef struct
|
||||
{
|
||||
QueryItem *frst;
|
||||
bool *mapped_check;
|
||||
} GinChkVal;
|
||||
} GinChkVal;
|
||||
|
||||
static bool
|
||||
checkcondition_gin(void *checkval, QueryOperand * val)
|
||||
checkcondition_gin(void *checkval, QueryOperand *val)
|
||||
{
|
||||
GinChkVal *gcv = (GinChkVal *) checkval;
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/utils/adt/tsquery.c,v 1.9 2007/11/15 21:14:39 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/utils/adt/tsquery.c,v 1.10 2007/11/15 22:25:16 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -106,7 +106,7 @@ typedef enum
|
||||
PT_OPR = 3,
|
||||
PT_OPEN = 4,
|
||||
PT_CLOSE = 5,
|
||||
} ts_tokentype;
|
||||
} ts_tokentype;
|
||||
|
||||
/*
|
||||
* get token from query string
|
||||
@@ -390,7 +390,7 @@ makepol(TSQueryParserState state,
|
||||
}
|
||||
|
||||
static void
|
||||
findoprnd_recurse(QueryItem * ptr, uint32 *pos, int nnodes)
|
||||
findoprnd_recurse(QueryItem *ptr, uint32 *pos, int nnodes)
|
||||
{
|
||||
/* since this function recurses, it could be driven to stack overflow. */
|
||||
check_stack_depth();
|
||||
@@ -435,7 +435,7 @@ findoprnd_recurse(QueryItem * ptr, uint32 *pos, int nnodes)
|
||||
* QueryItems must be in polish (prefix) notation.
|
||||
*/
|
||||
static void
|
||||
findoprnd(QueryItem * ptr, int size)
|
||||
findoprnd(QueryItem *ptr, int size)
|
||||
{
|
||||
uint32 pos;
|
||||
|
||||
@@ -576,7 +576,7 @@ typedef struct
|
||||
char *cur;
|
||||
char *op;
|
||||
int buflen;
|
||||
} INFIX;
|
||||
} INFIX;
|
||||
|
||||
/* Makes sure inf->buf is large enough for adding 'addsize' bytes */
|
||||
#define RESIZEBUF(inf, addsize) \
|
||||
@@ -593,7 +593,7 @@ while( ( (inf)->cur - (inf)->buf ) + (addsize) + 1 >= (inf)->buflen ) \
|
||||
* infix (human-readable) view
|
||||
*/
|
||||
static void
|
||||
infix(INFIX * in, bool first)
|
||||
infix(INFIX *in, bool first)
|
||||
{
|
||||
/* since this function recurses, it could be driven to stack overflow. */
|
||||
check_stack_depth();
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/utils/adt/tsquery_cleanup.c,v 1.6 2007/11/15 21:14:39 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/utils/adt/tsquery_cleanup.c,v 1.7 2007/11/15 22:25:16 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -24,13 +24,13 @@ typedef struct NODE
|
||||
struct NODE *left;
|
||||
struct NODE *right;
|
||||
QueryItem *valnode;
|
||||
} NODE;
|
||||
} NODE;
|
||||
|
||||
/*
|
||||
* make query tree from plain view of query
|
||||
*/
|
||||
static NODE *
|
||||
maketree(QueryItem * in)
|
||||
maketree(QueryItem *in)
|
||||
{
|
||||
NODE *node = (NODE *) palloc(sizeof(NODE));
|
||||
|
||||
@@ -53,10 +53,10 @@ typedef struct
|
||||
QueryItem *ptr;
|
||||
int len; /* allocated size of ptr */
|
||||
int cur; /* number of elements in ptr */
|
||||
} PLAINTREE;
|
||||
} PLAINTREE;
|
||||
|
||||
static void
|
||||
plainnode(PLAINTREE * state, NODE * node)
|
||||
plainnode(PLAINTREE *state, NODE *node)
|
||||
{
|
||||
/* since this function recurses, it could be driven to stack overflow. */
|
||||
check_stack_depth();
|
||||
@@ -91,7 +91,7 @@ plainnode(PLAINTREE * state, NODE * node)
|
||||
* make plain view of tree from a NODE-tree representation
|
||||
*/
|
||||
static QueryItem *
|
||||
plaintree(NODE * root, int *len)
|
||||
plaintree(NODE *root, int *len)
|
||||
{
|
||||
PLAINTREE pl;
|
||||
|
||||
@@ -109,7 +109,7 @@ plaintree(NODE * root, int *len)
|
||||
}
|
||||
|
||||
static void
|
||||
freetree(NODE * node)
|
||||
freetree(NODE *node)
|
||||
{
|
||||
/* since this function recurses, it could be driven to stack overflow. */
|
||||
check_stack_depth();
|
||||
@@ -130,7 +130,7 @@ freetree(NODE * node)
|
||||
* Operator ! always return TRUE
|
||||
*/
|
||||
static NODE *
|
||||
clean_NOT_intree(NODE * node)
|
||||
clean_NOT_intree(NODE *node)
|
||||
{
|
||||
/* since this function recurses, it could be driven to stack overflow. */
|
||||
check_stack_depth();
|
||||
@@ -183,7 +183,7 @@ clean_NOT_intree(NODE * node)
|
||||
}
|
||||
|
||||
QueryItem *
|
||||
clean_NOT(QueryItem * ptr, int *len)
|
||||
clean_NOT(QueryItem *ptr, int *len)
|
||||
{
|
||||
NODE *root = maketree(ptr);
|
||||
|
||||
@@ -214,7 +214,7 @@ clean_NOT(QueryItem * ptr, int *len)
|
||||
* text (stopword)
|
||||
*/
|
||||
static NODE *
|
||||
clean_fakeval_intree(NODE * node, char *result)
|
||||
clean_fakeval_intree(NODE *node, char *result)
|
||||
{
|
||||
char lresult = V_UNKNOWN,
|
||||
rresult = V_UNKNOWN;
|
||||
@@ -272,7 +272,7 @@ clean_fakeval_intree(NODE * node, char *result)
|
||||
}
|
||||
|
||||
QueryItem *
|
||||
clean_fakeval(QueryItem * ptr, int *len)
|
||||
clean_fakeval(QueryItem *ptr, int *len)
|
||||
{
|
||||
NODE *root = maketree(ptr);
|
||||
char result = V_UNKNOWN;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/utils/adt/tsquery_gist.c,v 1.2 2007/11/15 21:14:39 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/utils/adt/tsquery_gist.c,v 1.3 2007/11/15 22:25:16 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -142,7 +142,7 @@ typedef struct
|
||||
{
|
||||
OffsetNumber pos;
|
||||
int4 cost;
|
||||
} SPLITCOST;
|
||||
} SPLITCOST;
|
||||
|
||||
static int
|
||||
comparecost(const void *a, const void *b)
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/utils/adt/tsquery_rewrite.c,v 1.9 2007/11/15 21:14:39 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/utils/adt/tsquery_rewrite.c,v 1.10 2007/11/15 22:25:16 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -43,7 +43,7 @@ addone(int *counters, int last, int total)
|
||||
* by returning either node or a copy of subs.
|
||||
*/
|
||||
static QTNode *
|
||||
findeq(QTNode * node, QTNode * ex, QTNode * subs, bool *isfind)
|
||||
findeq(QTNode *node, QTNode *ex, QTNode *subs, bool *isfind)
|
||||
{
|
||||
|
||||
if ((node->sign & ex->sign) != ex->sign ||
|
||||
@@ -174,7 +174,7 @@ findeq(QTNode * node, QTNode * ex, QTNode * subs, bool *isfind)
|
||||
}
|
||||
|
||||
static QTNode *
|
||||
dofindsubquery(QTNode * root, QTNode * ex, QTNode * subs, bool *isfind)
|
||||
dofindsubquery(QTNode *root, QTNode *ex, QTNode *subs, bool *isfind)
|
||||
{
|
||||
/* since this function recurses, it could be driven to stack overflow. */
|
||||
check_stack_depth();
|
||||
@@ -193,7 +193,7 @@ dofindsubquery(QTNode * root, QTNode * ex, QTNode * subs, bool *isfind)
|
||||
}
|
||||
|
||||
static QTNode *
|
||||
dropvoidsubtree(QTNode * root)
|
||||
dropvoidsubtree(QTNode *root)
|
||||
{
|
||||
|
||||
if (!root)
|
||||
@@ -233,7 +233,7 @@ dropvoidsubtree(QTNode * root)
|
||||
}
|
||||
|
||||
QTNode *
|
||||
findsubquery(QTNode * root, QTNode * ex, QTNode * subs, bool *isfind)
|
||||
findsubquery(QTNode *root, QTNode *ex, QTNode *subs, bool *isfind)
|
||||
{
|
||||
bool DidFind = false;
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/utils/adt/tsquery_util.c,v 1.6 2007/11/15 21:14:39 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/utils/adt/tsquery_util.c,v 1.7 2007/11/15 22:25:16 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -19,7 +19,7 @@
|
||||
#include "miscadmin.h"
|
||||
|
||||
QTNode *
|
||||
QT2QTN(QueryItem * in, char *operand)
|
||||
QT2QTN(QueryItem *in, char *operand)
|
||||
{
|
||||
QTNode *node = (QTNode *) palloc0(sizeof(QTNode));
|
||||
|
||||
@@ -52,7 +52,7 @@ QT2QTN(QueryItem * in, char *operand)
|
||||
}
|
||||
|
||||
void
|
||||
QTNFree(QTNode * in)
|
||||
QTNFree(QTNode *in)
|
||||
{
|
||||
if (!in)
|
||||
return;
|
||||
@@ -84,7 +84,7 @@ QTNFree(QTNode * in)
|
||||
}
|
||||
|
||||
int
|
||||
QTNodeCompare(QTNode * an, QTNode * bn)
|
||||
QTNodeCompare(QTNode *an, QTNode *bn)
|
||||
{
|
||||
/* since this function recurses, it could be driven to stack overflow. */
|
||||
check_stack_depth();
|
||||
@@ -139,7 +139,7 @@ cmpQTN(const void *a, const void *b)
|
||||
}
|
||||
|
||||
void
|
||||
QTNSort(QTNode * in)
|
||||
QTNSort(QTNode *in)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -156,7 +156,7 @@ QTNSort(QTNode * in)
|
||||
}
|
||||
|
||||
bool
|
||||
QTNEq(QTNode * a, QTNode * b)
|
||||
QTNEq(QTNode *a, QTNode *b)
|
||||
{
|
||||
uint32 sign = a->sign & b->sign;
|
||||
|
||||
@@ -174,7 +174,7 @@ QTNEq(QTNode * a, QTNode * b)
|
||||
* b c
|
||||
*/
|
||||
void
|
||||
QTNTernary(QTNode * in)
|
||||
QTNTernary(QTNode *in)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -217,7 +217,7 @@ QTNTernary(QTNode * in)
|
||||
* (Opposite of QTNTernary)
|
||||
*/
|
||||
void
|
||||
QTNBinary(QTNode * in)
|
||||
QTNBinary(QTNode *in)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -261,7 +261,7 @@ QTNBinary(QTNode * in)
|
||||
* terminators.
|
||||
*/
|
||||
static void
|
||||
cntsize(QTNode * in, int *sumlen, int *nnode)
|
||||
cntsize(QTNode *in, int *sumlen, int *nnode)
|
||||
{
|
||||
/* since this function recurses, it could be driven to stack overflow. */
|
||||
check_stack_depth();
|
||||
@@ -285,10 +285,10 @@ typedef struct
|
||||
QueryItem *curitem;
|
||||
char *operand;
|
||||
char *curoperand;
|
||||
} QTN2QTState;
|
||||
} QTN2QTState;
|
||||
|
||||
static void
|
||||
fillQT(QTN2QTState * state, QTNode * in)
|
||||
fillQT(QTN2QTState *state, QTNode *in)
|
||||
{
|
||||
/* since this function recurses, it could be driven to stack overflow. */
|
||||
check_stack_depth();
|
||||
@@ -325,7 +325,7 @@ fillQT(QTN2QTState * state, QTNode * in)
|
||||
}
|
||||
|
||||
TSQuery
|
||||
QTN2QT(QTNode * in)
|
||||
QTN2QT(QTNode *in)
|
||||
{
|
||||
TSQuery out;
|
||||
int len;
|
||||
@@ -348,7 +348,7 @@ QTN2QT(QTNode * in)
|
||||
}
|
||||
|
||||
QTNode *
|
||||
QTNCopy(QTNode * in)
|
||||
QTNCopy(QTNode *in)
|
||||
{
|
||||
QTNode *out;
|
||||
|
||||
@@ -383,7 +383,7 @@ QTNCopy(QTNode * in)
|
||||
}
|
||||
|
||||
void
|
||||
QTNClearFlags(QTNode * in, uint32 flags)
|
||||
QTNClearFlags(QTNode *in, uint32 flags)
|
||||
{
|
||||
/* since this function recurses, it could be driven to stack overflow. */
|
||||
check_stack_depth();
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/utils/adt/tsrank.c,v 1.10 2007/11/15 21:14:39 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/utils/adt/tsrank.c,v 1.11 2007/11/15 22:25:16 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -72,7 +72,7 @@ cnt_length(TSVector t)
|
||||
}
|
||||
|
||||
static int
|
||||
WordECompareQueryItem(char *eval, char *qval, WordEntry * ptr, QueryOperand * item)
|
||||
WordECompareQueryItem(char *eval, char *qval, WordEntry *ptr, QueryOperand *item)
|
||||
{
|
||||
if (ptr->len == item->length)
|
||||
return strncmp(
|
||||
@@ -88,7 +88,7 @@ WordECompareQueryItem(char *eval, char *qval, WordEntry * ptr, QueryOperand * it
|
||||
* is the TSQuery containing 'item'. Returns NULL if not found.
|
||||
*/
|
||||
static WordEntry *
|
||||
find_wordentry(TSVector t, TSQuery q, QueryOperand * item)
|
||||
find_wordentry(TSVector t, TSQuery q, QueryOperand *item)
|
||||
{
|
||||
WordEntry *StopLow = ARRPTR(t);
|
||||
WordEntry *StopHigh = (WordEntry *) STRPTR(t);
|
||||
@@ -469,7 +469,7 @@ typedef struct
|
||||
int16 nitem;
|
||||
uint8 wclass;
|
||||
int32 pos;
|
||||
} DocRepresentation;
|
||||
} DocRepresentation;
|
||||
|
||||
static int
|
||||
compareDocR(const void *va, const void *vb)
|
||||
@@ -486,13 +486,13 @@ typedef struct
|
||||
{
|
||||
TSQuery query;
|
||||
bool *operandexist;
|
||||
} QueryRepresentation;
|
||||
} QueryRepresentation;
|
||||
|
||||
#define QR_GET_OPERAND_EXISTS(q, v) ( (q)->operandexist[ ((QueryItem*)(v)) - GETQUERY((q)->query) ] )
|
||||
#define QR_SET_OPERAND_EXISTS(q, v) QR_GET_OPERAND_EXISTS(q,v) = true
|
||||
|
||||
static bool
|
||||
checkcondition_QueryOperand(void *checkval, QueryOperand * val)
|
||||
checkcondition_QueryOperand(void *checkval, QueryOperand *val)
|
||||
{
|
||||
QueryRepresentation *qr = (QueryRepresentation *) checkval;
|
||||
|
||||
@@ -506,11 +506,11 @@ typedef struct
|
||||
int q;
|
||||
DocRepresentation *begin;
|
||||
DocRepresentation *end;
|
||||
} Extention;
|
||||
} Extention;
|
||||
|
||||
|
||||
static bool
|
||||
Cover(DocRepresentation * doc, int len, QueryRepresentation * qr, Extention * ext)
|
||||
Cover(DocRepresentation *doc, int len, QueryRepresentation *qr, Extention *ext)
|
||||
{
|
||||
DocRepresentation *ptr;
|
||||
int lastpos = ext->pos;
|
||||
@@ -591,7 +591,7 @@ Cover(DocRepresentation * doc, int len, QueryRepresentation * qr, Extention * ex
|
||||
}
|
||||
|
||||
static DocRepresentation *
|
||||
get_docrep(TSVector txt, QueryRepresentation * qr, int *doclen)
|
||||
get_docrep(TSVector txt, QueryRepresentation *qr, int *doclen)
|
||||
{
|
||||
QueryItem *item = GETQUERY(qr->query);
|
||||
WordEntry *entry;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/utils/adt/tsvector.c,v 1.7 2007/11/15 21:14:39 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/utils/adt/tsvector.c,v 1.8 2007/11/15 22:25:16 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -25,7 +25,7 @@ typedef struct
|
||||
WordEntry entry; /* must be first! */
|
||||
WordEntryPos *pos;
|
||||
int poslen; /* number of elements in pos */
|
||||
} WordEntryIN;
|
||||
} WordEntryIN;
|
||||
|
||||
|
||||
/* Compare two WordEntryPos values for qsort */
|
||||
@@ -47,7 +47,7 @@ comparePos(const void *a, const void *b)
|
||||
* Returns new length.
|
||||
*/
|
||||
static int
|
||||
uniquePos(WordEntryPos * a, int l)
|
||||
uniquePos(WordEntryPos *a, int l)
|
||||
{
|
||||
WordEntryPos *ptr,
|
||||
*res;
|
||||
@@ -100,7 +100,7 @@ compareentry(const void *va, const void *vb, void *arg)
|
||||
* *outbuflen receives the amount of space needed for strings and positions.
|
||||
*/
|
||||
static int
|
||||
uniqueentry(WordEntryIN * a, int l, char *buf, int *outbuflen)
|
||||
uniqueentry(WordEntryIN *a, int l, char *buf, int *outbuflen)
|
||||
{
|
||||
int buflen;
|
||||
WordEntryIN *ptr,
|
||||
@@ -171,7 +171,7 @@ uniqueentry(WordEntryIN * a, int l, char *buf, int *outbuflen)
|
||||
}
|
||||
|
||||
static int
|
||||
WordEntryCMP(WordEntry * a, WordEntry * b, char *buf)
|
||||
WordEntryCMP(WordEntry *a, WordEntry *b, char *buf)
|
||||
{
|
||||
return compareentry(a, b, buf);
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/utils/adt/tsvector_parser.c,v 1.3 2007/11/15 21:14:39 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/utils/adt/tsvector_parser.c,v 1.4 2007/11/15 22:25:16 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -157,7 +157,7 @@ prssyntaxerror(TSVectorParseState state)
|
||||
bool
|
||||
gettoken_tsvector(TSVectorParseState state,
|
||||
char **strval, int *lenval,
|
||||
WordEntryPos ** pos_ptr, int *poslen,
|
||||
WordEntryPos **pos_ptr, int *poslen,
|
||||
char **endptr)
|
||||
{
|
||||
int oldstate = 0;
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* Author: Jan Wieck, Afilias USA INC.
|
||||
* 64-bit txids: Marko Kreen, Skype Technologies
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/backend/utils/adt/txid.c,v 1.2 2007/11/15 21:14:39 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/utils/adt/txid.c,v 1.3 2007/11/15 22:25:16 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -65,7 +65,7 @@ typedef struct
|
||||
txid xmin;
|
||||
txid xmax;
|
||||
txid xip[1]; /* in-progress txids, xmin <= xip[i] < xmax */
|
||||
} TxidSnapshot;
|
||||
} TxidSnapshot;
|
||||
|
||||
#define TXID_SNAPSHOT_SIZE(nxip) \
|
||||
(offsetof(TxidSnapshot, xip) + sizeof(txid) * (nxip))
|
||||
@@ -77,14 +77,14 @@ typedef struct
|
||||
{
|
||||
TransactionId last_xid;
|
||||
uint32 epoch;
|
||||
} TxidEpoch;
|
||||
} TxidEpoch;
|
||||
|
||||
|
||||
/*
|
||||
* Fetch epoch data from xact.c.
|
||||
*/
|
||||
static void
|
||||
load_xid_epoch(TxidEpoch * state)
|
||||
load_xid_epoch(TxidEpoch *state)
|
||||
{
|
||||
GetNextXidAndEpoch(&state->last_xid, &state->epoch);
|
||||
}
|
||||
@@ -93,7 +93,7 @@ load_xid_epoch(TxidEpoch * state)
|
||||
* do a TransactionId -> txid conversion for an XID near the given epoch
|
||||
*/
|
||||
static txid
|
||||
convert_xid(TransactionId xid, const TxidEpoch * state)
|
||||
convert_xid(TransactionId xid, const TxidEpoch *state)
|
||||
{
|
||||
#ifndef INT64_IS_BUSTED
|
||||
uint64 epoch;
|
||||
@@ -141,7 +141,7 @@ cmp_txid(const void *aa, const void *bb)
|
||||
* will not be used.
|
||||
*/
|
||||
static void
|
||||
sort_snapshot(TxidSnapshot * snap)
|
||||
sort_snapshot(TxidSnapshot *snap)
|
||||
{
|
||||
if (snap->nxip > 1)
|
||||
qsort(snap->xip, snap->nxip, sizeof(txid), cmp_txid);
|
||||
@@ -151,7 +151,7 @@ sort_snapshot(TxidSnapshot * snap)
|
||||
* check txid visibility.
|
||||
*/
|
||||
static bool
|
||||
is_visible_txid(txid value, const TxidSnapshot * snap)
|
||||
is_visible_txid(txid value, const TxidSnapshot *snap)
|
||||
{
|
||||
if (value < snap->xmin)
|
||||
return true;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* Copyright (c) 2007, PostgreSQL Global Development Group
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/utils/adt/uuid.c,v 1.5 2007/11/15 21:14:39 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/utils/adt/uuid.c,v 1.6 2007/11/15 22:25:16 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -27,8 +27,8 @@ struct pg_uuid_t
|
||||
unsigned char data[UUID_LEN];
|
||||
};
|
||||
|
||||
static void string_to_uuid(const char *source, pg_uuid_t * uuid);
|
||||
static int uuid_internal_cmp(const pg_uuid_t * arg1, const pg_uuid_t * arg2);
|
||||
static void string_to_uuid(const char *source, pg_uuid_t *uuid);
|
||||
static int uuid_internal_cmp(const pg_uuid_t *arg1, const pg_uuid_t *arg2);
|
||||
|
||||
Datum
|
||||
uuid_in(PG_FUNCTION_ARGS)
|
||||
@@ -80,7 +80,7 @@ uuid_out(PG_FUNCTION_ARGS)
|
||||
* two formats into the latter format before further processing.
|
||||
*/
|
||||
static void
|
||||
string_to_uuid(const char *source, pg_uuid_t * uuid)
|
||||
string_to_uuid(const char *source, pg_uuid_t *uuid)
|
||||
{
|
||||
char hex_buf[32]; /* not NUL terminated */
|
||||
int i;
|
||||
@@ -161,7 +161,7 @@ uuid_send(PG_FUNCTION_ARGS)
|
||||
|
||||
/* internal uuid compare function */
|
||||
static int
|
||||
uuid_internal_cmp(const pg_uuid_t * arg1, const pg_uuid_t * arg2)
|
||||
uuid_internal_cmp(const pg_uuid_t *arg1, const pg_uuid_t *arg2)
|
||||
{
|
||||
return memcmp(arg1->data, arg2->data, UUID_LEN);
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/utils/adt/varlena.c,v 1.160 2007/11/15 21:14:39 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/utils/adt/varlena.c,v 1.161 2007/11/15 22:25:16 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -40,7 +40,7 @@ typedef struct
|
||||
pg_wchar *wstr2; /* note: these are palloc'd */
|
||||
int len1; /* string lengths in logical characters */
|
||||
int len2;
|
||||
} TextPositionState;
|
||||
} TextPositionState;
|
||||
|
||||
#define DatumGetUnknownP(X) ((unknown *) PG_DETOAST_DATUM(X))
|
||||
#define DatumGetUnknownPCopy(X) ((unknown *) PG_DETOAST_DATUM_COPY(X))
|
||||
@@ -60,9 +60,9 @@ typedef struct
|
||||
static int text_cmp(text *arg1, text *arg2);
|
||||
static int32 text_length(Datum str);
|
||||
static int text_position(text *t1, text *t2);
|
||||
static void text_position_setup(text *t1, text *t2, TextPositionState * state);
|
||||
static int text_position_next(int start_pos, TextPositionState * state);
|
||||
static void text_position_cleanup(TextPositionState * state);
|
||||
static void text_position_setup(text *t1, text *t2, TextPositionState *state);
|
||||
static int text_position_next(int start_pos, TextPositionState *state);
|
||||
static void text_position_cleanup(TextPositionState *state);
|
||||
static text *text_substring(Datum str,
|
||||
int32 start,
|
||||
int32 length,
|
||||
@@ -807,7 +807,7 @@ text_position(text *t1, text *t2)
|
||||
*/
|
||||
|
||||
static void
|
||||
text_position_setup(text *t1, text *t2, TextPositionState * state)
|
||||
text_position_setup(text *t1, text *t2, TextPositionState *state)
|
||||
{
|
||||
int len1 = VARSIZE_ANY_EXHDR(t1);
|
||||
int len2 = VARSIZE_ANY_EXHDR(t2);
|
||||
@@ -841,7 +841,7 @@ text_position_setup(text *t1, text *t2, TextPositionState * state)
|
||||
}
|
||||
|
||||
static int
|
||||
text_position_next(int start_pos, TextPositionState * state)
|
||||
text_position_next(int start_pos, TextPositionState *state)
|
||||
{
|
||||
int pos = 0,
|
||||
p,
|
||||
@@ -899,7 +899,7 @@ text_position_next(int start_pos, TextPositionState * state)
|
||||
}
|
||||
|
||||
static void
|
||||
text_position_cleanup(TextPositionState * state)
|
||||
text_position_cleanup(TextPositionState *state)
|
||||
{
|
||||
if (state->use_wchar)
|
||||
{
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/backend/utils/adt/xml.c,v 1.57 2007/11/15 21:14:39 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/utils/adt/xml.c,v 1.58 2007/11/15 22:25:16 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -186,7 +186,7 @@ xml_in(PG_FUNCTION_ARGS)
|
||||
|
||||
|
||||
static char *
|
||||
xml_out_internal(xmltype * x, pg_enc target_encoding)
|
||||
xml_out_internal(xmltype *x, pg_enc target_encoding)
|
||||
{
|
||||
char *str;
|
||||
size_t len;
|
||||
@@ -540,7 +540,7 @@ xmltotext(PG_FUNCTION_ARGS)
|
||||
|
||||
|
||||
text *
|
||||
xmltotext_with_xmloption(xmltype * data, XmlOptionType xmloption_arg)
|
||||
xmltotext_with_xmloption(xmltype *data, XmlOptionType xmloption_arg)
|
||||
{
|
||||
if (xmloption_arg == XMLOPTION_DOCUMENT && !xml_is_document(data))
|
||||
ereport(ERROR,
|
||||
@@ -553,7 +553,7 @@ xmltotext_with_xmloption(xmltype * data, XmlOptionType xmloption_arg)
|
||||
|
||||
|
||||
xmltype *
|
||||
xmlelement(XmlExprState * xmlExpr, ExprContext *econtext)
|
||||
xmlelement(XmlExprState *xmlExpr, ExprContext *econtext)
|
||||
{
|
||||
#ifdef USE_LIBXML
|
||||
XmlExpr *xexpr = (XmlExpr *) xmlExpr->xprstate.expr;
|
||||
@@ -721,7 +721,7 @@ xmlpi(char *target, text *arg, bool arg_is_null, bool *result_is_null)
|
||||
|
||||
|
||||
xmltype *
|
||||
xmlroot(xmltype * data, text *version, int standalone)
|
||||
xmlroot(xmltype *data, text *version, int standalone)
|
||||
{
|
||||
#ifdef USE_LIBXML
|
||||
char *str;
|
||||
@@ -871,7 +871,7 @@ xmlvalidate(PG_FUNCTION_ARGS)
|
||||
|
||||
|
||||
bool
|
||||
xml_is_document(xmltype * arg)
|
||||
xml_is_document(xmltype *arg)
|
||||
{
|
||||
#ifdef USE_LIBXML
|
||||
bool result;
|
||||
|
||||
Reference in New Issue
Block a user