mirror of
https://github.com/postgres/postgres.git
synced 2025-09-02 04:21:28 +03:00
Re-run pgindent with updated list of typedefs. (Updated README should
avoid this problem in the future.)
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/tsearch/dict_ispell.c,v 1.4 2007/11/15 21:14:38 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/tsearch/dict_ispell.c,v 1.5 2007/11/15 22:25:16 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -26,7 +26,7 @@ typedef struct
|
||||
{
|
||||
StopList stoplist;
|
||||
IspellDict obj;
|
||||
} DictISpell;
|
||||
} DictISpell;
|
||||
|
||||
Datum
|
||||
dispell_init(PG_FUNCTION_ARGS)
|
||||
|
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/tsearch/dict_simple.c,v 1.5 2007/11/15 21:14:38 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/tsearch/dict_simple.c,v 1.6 2007/11/15 22:25:16 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -24,7 +24,7 @@ typedef struct
|
||||
{
|
||||
StopList stoplist;
|
||||
bool accept;
|
||||
} DictSimple;
|
||||
} DictSimple;
|
||||
|
||||
|
||||
Datum
|
||||
|
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/tsearch/dict_synonym.c,v 1.5 2007/11/15 21:14:38 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/tsearch/dict_synonym.c,v 1.6 2007/11/15 22:25:16 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -24,13 +24,13 @@ typedef struct
|
||||
{
|
||||
char *in;
|
||||
char *out;
|
||||
} Syn;
|
||||
} Syn;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int len; /* length of syn array */
|
||||
Syn *syn;
|
||||
} DictSyn;
|
||||
} DictSyn;
|
||||
|
||||
/*
|
||||
* Finds the next whitespace-delimited word within the 'in' string.
|
||||
|
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/tsearch/dict_thesaurus.c,v 1.7 2007/11/15 21:14:38 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/tsearch/dict_thesaurus.c,v 1.8 2007/11/15 22:25:16 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -35,20 +35,20 @@ typedef struct LexemeInfo
|
||||
uint16 tnvariant; /* total num lexemes in one variant */
|
||||
struct LexemeInfo *nextentry;
|
||||
struct LexemeInfo *nextvariant;
|
||||
} LexemeInfo;
|
||||
} LexemeInfo;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char *lexeme;
|
||||
LexemeInfo *entries;
|
||||
} TheLexeme;
|
||||
} TheLexeme;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint16 lastlexeme; /* number lexemes to substitute */
|
||||
uint16 reslen;
|
||||
TSLexeme *res; /* prepared substituted result */
|
||||
} TheSubstitute;
|
||||
} TheSubstitute;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
@@ -66,11 +66,11 @@ typedef struct
|
||||
*/
|
||||
TheSubstitute *subst;
|
||||
int nsubst;
|
||||
} DictThesaurus;
|
||||
} DictThesaurus;
|
||||
|
||||
|
||||
static void
|
||||
newLexeme(DictThesaurus * d, char *b, char *e, uint16 idsubst, uint16 posinsubst)
|
||||
newLexeme(DictThesaurus *d, char *b, char *e, uint16 idsubst, uint16 posinsubst)
|
||||
{
|
||||
TheLexeme *ptr;
|
||||
|
||||
@@ -104,7 +104,7 @@ newLexeme(DictThesaurus * d, char *b, char *e, uint16 idsubst, uint16 posinsubst
|
||||
}
|
||||
|
||||
static void
|
||||
addWrd(DictThesaurus * d, char *b, char *e, uint16 idsubst, uint16 nwrd, uint16 posinsubst, bool useasis)
|
||||
addWrd(DictThesaurus *d, char *b, char *e, uint16 idsubst, uint16 nwrd, uint16 posinsubst, bool useasis)
|
||||
{
|
||||
static int nres = 0;
|
||||
static int ntres = 0;
|
||||
@@ -167,7 +167,7 @@ addWrd(DictThesaurus * d, char *b, char *e, uint16 idsubst, uint16 nwrd, uint16
|
||||
#define TR_INSUBS 4
|
||||
|
||||
static void
|
||||
thesaurusRead(char *filename, DictThesaurus * d)
|
||||
thesaurusRead(char *filename, DictThesaurus *d)
|
||||
{
|
||||
FILE *fh;
|
||||
int lineno = 0;
|
||||
@@ -311,7 +311,7 @@ thesaurusRead(char *filename, DictThesaurus * d)
|
||||
}
|
||||
|
||||
static TheLexeme *
|
||||
addCompiledLexeme(TheLexeme * newwrds, int *nnw, int *tnm, TSLexeme * lexeme, LexemeInfo * src, uint16 tnvariant)
|
||||
addCompiledLexeme(TheLexeme *newwrds, int *nnw, int *tnm, TSLexeme *lexeme, LexemeInfo *src, uint16 tnvariant)
|
||||
{
|
||||
|
||||
if (*nnw >= *tnm)
|
||||
@@ -343,7 +343,7 @@ addCompiledLexeme(TheLexeme * newwrds, int *nnw, int *tnm, TSLexeme * lexeme, Le
|
||||
}
|
||||
|
||||
static int
|
||||
cmpLexemeInfo(LexemeInfo * a, LexemeInfo * b)
|
||||
cmpLexemeInfo(LexemeInfo *a, LexemeInfo *b)
|
||||
{
|
||||
if (a == NULL || b == NULL)
|
||||
return 0;
|
||||
@@ -365,7 +365,7 @@ cmpLexemeInfo(LexemeInfo * a, LexemeInfo * b)
|
||||
}
|
||||
|
||||
static int
|
||||
cmpLexeme(TheLexeme * a, TheLexeme * b)
|
||||
cmpLexeme(TheLexeme *a, TheLexeme *b)
|
||||
{
|
||||
if (a->lexeme == NULL)
|
||||
{
|
||||
@@ -400,7 +400,7 @@ cmpTheLexeme(const void *a, const void *b)
|
||||
}
|
||||
|
||||
static void
|
||||
compileTheLexeme(DictThesaurus * d)
|
||||
compileTheLexeme(DictThesaurus *d)
|
||||
{
|
||||
int i,
|
||||
nnw = 0,
|
||||
@@ -503,7 +503,7 @@ compileTheLexeme(DictThesaurus * d)
|
||||
}
|
||||
|
||||
static void
|
||||
compileTheSubstitute(DictThesaurus * d)
|
||||
compileTheSubstitute(DictThesaurus *d)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -651,7 +651,7 @@ thesaurus_init(PG_FUNCTION_ARGS)
|
||||
}
|
||||
|
||||
static LexemeInfo *
|
||||
findTheLexeme(DictThesaurus * d, char *lexeme)
|
||||
findTheLexeme(DictThesaurus *d, char *lexeme)
|
||||
{
|
||||
TheLexeme key,
|
||||
*res;
|
||||
@@ -670,7 +670,7 @@ findTheLexeme(DictThesaurus * d, char *lexeme)
|
||||
}
|
||||
|
||||
static bool
|
||||
matchIdSubst(LexemeInfo * stored, uint16 idsubst)
|
||||
matchIdSubst(LexemeInfo *stored, uint16 idsubst)
|
||||
{
|
||||
bool res = true;
|
||||
|
||||
@@ -690,7 +690,7 @@ matchIdSubst(LexemeInfo * stored, uint16 idsubst)
|
||||
}
|
||||
|
||||
static LexemeInfo *
|
||||
findVariant(LexemeInfo * in, LexemeInfo * stored, uint16 curpos, LexemeInfo ** newin, int newn)
|
||||
findVariant(LexemeInfo *in, LexemeInfo *stored, uint16 curpos, LexemeInfo **newin, int newn)
|
||||
{
|
||||
for (;;)
|
||||
{
|
||||
@@ -749,7 +749,7 @@ findVariant(LexemeInfo * in, LexemeInfo * stored, uint16 curpos, LexemeInfo ** n
|
||||
}
|
||||
|
||||
static TSLexeme *
|
||||
copyTSLexeme(TheSubstitute * ts)
|
||||
copyTSLexeme(TheSubstitute *ts)
|
||||
{
|
||||
TSLexeme *res;
|
||||
uint16 i;
|
||||
@@ -767,7 +767,7 @@ copyTSLexeme(TheSubstitute * ts)
|
||||
}
|
||||
|
||||
static TSLexeme *
|
||||
checkMatch(DictThesaurus * d, LexemeInfo * info, uint16 curpos, bool *moreres)
|
||||
checkMatch(DictThesaurus *d, LexemeInfo *info, uint16 curpos, bool *moreres)
|
||||
{
|
||||
*moreres = false;
|
||||
while (info)
|
||||
|
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/tsearch/regis.c,v 1.1 2007/08/21 01:11:18 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/tsearch/regis.c,v 1.2 2007/11/15 22:25:16 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -39,7 +39,7 @@ RS_isRegis(const char *str)
|
||||
#define RS_IN_WAIT 4
|
||||
|
||||
static RegisNode *
|
||||
newRegisNode(RegisNode * prev, int len)
|
||||
newRegisNode(RegisNode *prev, int len)
|
||||
{
|
||||
RegisNode *ptr;
|
||||
|
||||
@@ -50,7 +50,7 @@ newRegisNode(RegisNode * prev, int len)
|
||||
}
|
||||
|
||||
void
|
||||
RS_compile(Regis * r, bool issuffix, char *str)
|
||||
RS_compile(Regis *r, bool issuffix, char *str)
|
||||
{
|
||||
int len = strlen(str);
|
||||
int state = RS_IN_WAIT;
|
||||
@@ -137,7 +137,7 @@ RS_compile(Regis * r, bool issuffix, char *str)
|
||||
}
|
||||
|
||||
void
|
||||
RS_free(Regis * r)
|
||||
RS_free(Regis *r)
|
||||
{
|
||||
RegisNode *ptr = r->node,
|
||||
*tmp;
|
||||
@@ -189,7 +189,7 @@ mb_strchr(char *str, char *c)
|
||||
|
||||
|
||||
bool
|
||||
RS_execute(Regis * r, char *str)
|
||||
RS_execute(Regis *r, char *str)
|
||||
{
|
||||
RegisNode *ptr = r->node;
|
||||
char *c = str;
|
||||
|
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/tsearch/spell.c,v 1.6 2007/11/15 21:14:38 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/tsearch/spell.c,v 1.7 2007/11/15 22:25:16 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -165,7 +165,7 @@ cmpaffix(const void *s1, const void *s2)
|
||||
}
|
||||
|
||||
static void
|
||||
NIAddSpell(IspellDict * Conf, const char *word, const char *flag)
|
||||
NIAddSpell(IspellDict *Conf, const char *word, const char *flag)
|
||||
{
|
||||
if (Conf->nspell >= Conf->mspell)
|
||||
{
|
||||
@@ -192,7 +192,7 @@ NIAddSpell(IspellDict * Conf, const char *word, const char *flag)
|
||||
* Note caller must already have applied get_tsearch_config_filename
|
||||
*/
|
||||
void
|
||||
NIImportDictionary(IspellDict * Conf, const char *filename)
|
||||
NIImportDictionary(IspellDict *Conf, const char *filename)
|
||||
{
|
||||
FILE *dict;
|
||||
char *line;
|
||||
@@ -255,7 +255,7 @@ NIImportDictionary(IspellDict * Conf, const char *filename)
|
||||
|
||||
|
||||
static int
|
||||
FindWord(IspellDict * Conf, const char *word, int affixflag, int flag)
|
||||
FindWord(IspellDict *Conf, const char *word, int affixflag, int flag)
|
||||
{
|
||||
SPNode *node = Conf->Dictionary;
|
||||
SPNodeData *StopLow,
|
||||
@@ -303,7 +303,7 @@ FindWord(IspellDict * Conf, const char *word, int affixflag, int flag)
|
||||
}
|
||||
|
||||
static void
|
||||
NIAddAffix(IspellDict * Conf, int flag, char flagflags, const char *mask, const char *find, const char *repl, int type)
|
||||
NIAddAffix(IspellDict *Conf, int flag, char flagflags, const char *mask, const char *find, const char *repl, int type)
|
||||
{
|
||||
AFFIX *Affix;
|
||||
|
||||
@@ -512,7 +512,7 @@ parse_affentry(char *str, char *mask, char *find, char *repl,
|
||||
}
|
||||
|
||||
static void
|
||||
addFlagValue(IspellDict * Conf, char *s, uint32 val,
|
||||
addFlagValue(IspellDict *Conf, char *s, uint32 val,
|
||||
const char *filename, int lineno)
|
||||
{
|
||||
while (*s && t_isspace(s))
|
||||
@@ -535,7 +535,7 @@ addFlagValue(IspellDict * Conf, char *s, uint32 val,
|
||||
}
|
||||
|
||||
static void
|
||||
NIImportOOAffixes(IspellDict * Conf, const char *filename)
|
||||
NIImportOOAffixes(IspellDict *Conf, const char *filename)
|
||||
{
|
||||
char type[BUFSIZ],
|
||||
*ptype = NULL;
|
||||
@@ -702,7 +702,7 @@ nextline:
|
||||
* Note caller must already have applied get_tsearch_config_filename
|
||||
*/
|
||||
void
|
||||
NIImportAffixes(IspellDict * Conf, const char *filename)
|
||||
NIImportAffixes(IspellDict *Conf, const char *filename)
|
||||
{
|
||||
char *pstr = NULL;
|
||||
char mask[BUFSIZ];
|
||||
@@ -842,7 +842,7 @@ nextline:
|
||||
}
|
||||
|
||||
static int
|
||||
MergeAffix(IspellDict * Conf, int a1, int a2)
|
||||
MergeAffix(IspellDict *Conf, int a1, int a2)
|
||||
{
|
||||
char **ptr;
|
||||
|
||||
@@ -865,7 +865,7 @@ MergeAffix(IspellDict * Conf, int a1, int a2)
|
||||
}
|
||||
|
||||
static uint32
|
||||
makeCompoundFlags(IspellDict * Conf, int affix)
|
||||
makeCompoundFlags(IspellDict *Conf, int affix)
|
||||
{
|
||||
uint32 flag = 0;
|
||||
char *str = Conf->AffixData[affix];
|
||||
@@ -880,7 +880,7 @@ makeCompoundFlags(IspellDict * Conf, int affix)
|
||||
}
|
||||
|
||||
static SPNode *
|
||||
mkSPNode(IspellDict * Conf, int low, int high, int level)
|
||||
mkSPNode(IspellDict *Conf, int low, int high, int level)
|
||||
{
|
||||
int i;
|
||||
int nchar = 0;
|
||||
@@ -960,7 +960,7 @@ mkSPNode(IspellDict * Conf, int low, int high, int level)
|
||||
* and affixes.
|
||||
*/
|
||||
void
|
||||
NISortDictionary(IspellDict * Conf)
|
||||
NISortDictionary(IspellDict *Conf)
|
||||
{
|
||||
int i;
|
||||
int naffix = 0;
|
||||
@@ -1011,7 +1011,7 @@ NISortDictionary(IspellDict * Conf)
|
||||
}
|
||||
|
||||
static AffixNode *
|
||||
mkANode(IspellDict * Conf, int low, int high, int level, int type)
|
||||
mkANode(IspellDict *Conf, int low, int high, int level, int type)
|
||||
{
|
||||
int i;
|
||||
int nchar = 0;
|
||||
@@ -1082,7 +1082,7 @@ mkANode(IspellDict * Conf, int low, int high, int level, int type)
|
||||
}
|
||||
|
||||
static void
|
||||
mkVoidAffix(IspellDict * Conf, bool issuffix, int startsuffix)
|
||||
mkVoidAffix(IspellDict *Conf, bool issuffix, int startsuffix)
|
||||
{
|
||||
int i,
|
||||
cnt = 0;
|
||||
@@ -1125,7 +1125,7 @@ mkVoidAffix(IspellDict * Conf, bool issuffix, int startsuffix)
|
||||
}
|
||||
|
||||
static bool
|
||||
isAffixInUse(IspellDict * Conf, char flag)
|
||||
isAffixInUse(IspellDict *Conf, char flag)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -1137,7 +1137,7 @@ isAffixInUse(IspellDict * Conf, char flag)
|
||||
}
|
||||
|
||||
void
|
||||
NISortAffixes(IspellDict * Conf)
|
||||
NISortAffixes(IspellDict *Conf)
|
||||
{
|
||||
AFFIX *Affix;
|
||||
size_t i;
|
||||
@@ -1187,12 +1187,12 @@ NISortAffixes(IspellDict * Conf)
|
||||
}
|
||||
|
||||
static AffixNodeData *
|
||||
FindAffixes(AffixNode * node, const char *word, int wrdlen, int *level, int type)
|
||||
FindAffixes(AffixNode *node, const char *word, int wrdlen, int *level, int type)
|
||||
{
|
||||
AffixNodeData *StopLow,
|
||||
*StopHigh,
|
||||
*StopMiddle;
|
||||
uint8 symbol;
|
||||
uint8 symbol;
|
||||
|
||||
if (node->isvoid)
|
||||
{ /* search void affixes */
|
||||
@@ -1209,6 +1209,7 @@ FindAffixes(AffixNode * node, const char *word, int wrdlen, int *level, int type
|
||||
{
|
||||
StopMiddle = StopLow + ((StopHigh - StopLow) >> 1);
|
||||
symbol = GETWCHAR(word, wrdlen, *level, type);
|
||||
|
||||
if (StopMiddle->val == symbol)
|
||||
{
|
||||
(*level)++;
|
||||
@@ -1229,7 +1230,7 @@ FindAffixes(AffixNode * node, const char *word, int wrdlen, int *level, int type
|
||||
}
|
||||
|
||||
static char *
|
||||
CheckAffix(const char *word, size_t len, AFFIX * Affix, int flagflags, char *newword, int *baselen)
|
||||
CheckAffix(const char *word, size_t len, AFFIX *Affix, int flagflags, char *newword, int *baselen)
|
||||
{
|
||||
/*
|
||||
* Check compound allow flags
|
||||
@@ -1335,7 +1336,7 @@ addToResult(char **forms, char **cur, char *word)
|
||||
}
|
||||
|
||||
static char **
|
||||
NormalizeSubWord(IspellDict * Conf, char *word, int flag)
|
||||
NormalizeSubWord(IspellDict *Conf, char *word, int flag)
|
||||
{
|
||||
AffixNodeData *suffix = NULL,
|
||||
*prefix = NULL;
|
||||
@@ -1449,10 +1450,10 @@ typedef struct SplitVar
|
||||
int nstem;
|
||||
char **stem;
|
||||
struct SplitVar *next;
|
||||
} SplitVar;
|
||||
} SplitVar;
|
||||
|
||||
static int
|
||||
CheckCompoundAffixes(CMPDAffix ** ptr, char *word, int len, bool CheckInPlace)
|
||||
CheckCompoundAffixes(CMPDAffix **ptr, char *word, int len, bool CheckInPlace)
|
||||
{
|
||||
bool issuffix;
|
||||
|
||||
@@ -1490,7 +1491,7 @@ CheckCompoundAffixes(CMPDAffix ** ptr, char *word, int len, bool CheckInPlace)
|
||||
}
|
||||
|
||||
static SplitVar *
|
||||
CopyVar(SplitVar * s, int makedup)
|
||||
CopyVar(SplitVar *s, int makedup)
|
||||
{
|
||||
SplitVar *v = (SplitVar *) palloc(sizeof(SplitVar));
|
||||
|
||||
@@ -1511,7 +1512,7 @@ CopyVar(SplitVar * s, int makedup)
|
||||
|
||||
|
||||
static SplitVar *
|
||||
SplitToVariants(IspellDict * Conf, SPNode * snode, SplitVar * orig, char *word, int wordlen, int startpos, int minpos)
|
||||
SplitToVariants(IspellDict *Conf, SPNode *snode, SplitVar *orig, char *word, int wordlen, int startpos, int minpos)
|
||||
{
|
||||
SplitVar *var = NULL;
|
||||
SPNodeData *StopLow,
|
||||
@@ -1660,7 +1661,7 @@ SplitToVariants(IspellDict * Conf, SPNode * snode, SplitVar * orig, char *word,
|
||||
}
|
||||
|
||||
TSLexeme *
|
||||
NINormalizeWord(IspellDict * Conf, char *word)
|
||||
NINormalizeWord(IspellDict *Conf, char *word)
|
||||
{
|
||||
char **res;
|
||||
TSLexeme *lcur = NULL,
|
||||
|
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/tsearch/to_tsany.c,v 1.6 2007/11/15 21:14:38 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/tsearch/to_tsany.c,v 1.7 2007/11/15 22:25:16 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -52,7 +52,7 @@ compareWORD(const void *a, const void *b)
|
||||
}
|
||||
|
||||
static int
|
||||
uniqueWORD(ParsedWord * a, int4 l)
|
||||
uniqueWORD(ParsedWord *a, int4 l)
|
||||
{
|
||||
ParsedWord *ptr,
|
||||
*res;
|
||||
@@ -138,7 +138,7 @@ uniqueWORD(ParsedWord * a, int4 l)
|
||||
* make value of tsvector, given parsed text
|
||||
*/
|
||||
TSVector
|
||||
make_tsvector(ParsedText * prs)
|
||||
make_tsvector(ParsedText *prs)
|
||||
{
|
||||
int i,
|
||||
j,
|
||||
|
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/tsearch/ts_parse.c,v 1.4 2007/11/15 21:14:38 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/tsearch/ts_parse.c,v 1.5 2007/11/15 22:25:16 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -31,13 +31,13 @@ typedef struct ParsedLex
|
||||
int lenlemm;
|
||||
bool resfollow;
|
||||
struct ParsedLex *next;
|
||||
} ParsedLex;
|
||||
} ParsedLex;
|
||||
|
||||
typedef struct ListParsedLex
|
||||
{
|
||||
ParsedLex *head;
|
||||
ParsedLex *tail;
|
||||
} ListParsedLex;
|
||||
} ListParsedLex;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
@@ -56,10 +56,10 @@ typedef struct
|
||||
|
||||
ParsedLex *lastRes;
|
||||
TSLexeme *tmpRes;
|
||||
} LexizeData;
|
||||
} LexizeData;
|
||||
|
||||
static void
|
||||
LexizeInit(LexizeData * ld, TSConfigCacheEntry * cfg)
|
||||
LexizeInit(LexizeData *ld, TSConfigCacheEntry *cfg)
|
||||
{
|
||||
ld->cfg = cfg;
|
||||
ld->curDictId = InvalidOid;
|
||||
@@ -71,7 +71,7 @@ LexizeInit(LexizeData * ld, TSConfigCacheEntry * cfg)
|
||||
}
|
||||
|
||||
static void
|
||||
LPLAddTail(ListParsedLex * list, ParsedLex * newpl)
|
||||
LPLAddTail(ListParsedLex *list, ParsedLex *newpl)
|
||||
{
|
||||
if (list->tail)
|
||||
{
|
||||
@@ -84,7 +84,7 @@ LPLAddTail(ListParsedLex * list, ParsedLex * newpl)
|
||||
}
|
||||
|
||||
static ParsedLex *
|
||||
LPLRemoveHead(ListParsedLex * list)
|
||||
LPLRemoveHead(ListParsedLex *list)
|
||||
{
|
||||
ParsedLex *res = list->head;
|
||||
|
||||
@@ -98,7 +98,7 @@ LPLRemoveHead(ListParsedLex * list)
|
||||
}
|
||||
|
||||
static void
|
||||
LexizeAddLemm(LexizeData * ld, int type, char *lemm, int lenlemm)
|
||||
LexizeAddLemm(LexizeData *ld, int type, char *lemm, int lenlemm)
|
||||
{
|
||||
ParsedLex *newpl = (ParsedLex *) palloc(sizeof(ParsedLex));
|
||||
|
||||
@@ -111,7 +111,7 @@ LexizeAddLemm(LexizeData * ld, int type, char *lemm, int lenlemm)
|
||||
}
|
||||
|
||||
static void
|
||||
RemoveHead(LexizeData * ld)
|
||||
RemoveHead(LexizeData *ld)
|
||||
{
|
||||
LPLAddTail(&ld->waste, LPLRemoveHead(&ld->towork));
|
||||
|
||||
@@ -119,7 +119,7 @@ RemoveHead(LexizeData * ld)
|
||||
}
|
||||
|
||||
static void
|
||||
setCorrLex(LexizeData * ld, ParsedLex ** correspondLexem)
|
||||
setCorrLex(LexizeData *ld, ParsedLex **correspondLexem)
|
||||
{
|
||||
if (correspondLexem)
|
||||
{
|
||||
@@ -141,7 +141,7 @@ setCorrLex(LexizeData * ld, ParsedLex ** correspondLexem)
|
||||
}
|
||||
|
||||
static void
|
||||
moveToWaste(LexizeData * ld, ParsedLex * stop)
|
||||
moveToWaste(LexizeData *ld, ParsedLex *stop)
|
||||
{
|
||||
bool go = true;
|
||||
|
||||
@@ -157,7 +157,7 @@ moveToWaste(LexizeData * ld, ParsedLex * stop)
|
||||
}
|
||||
|
||||
static void
|
||||
setNewTmpRes(LexizeData * ld, ParsedLex * lex, TSLexeme * res)
|
||||
setNewTmpRes(LexizeData *ld, ParsedLex *lex, TSLexeme *res)
|
||||
{
|
||||
if (ld->tmpRes)
|
||||
{
|
||||
@@ -172,7 +172,7 @@ setNewTmpRes(LexizeData * ld, ParsedLex * lex, TSLexeme * res)
|
||||
}
|
||||
|
||||
static TSLexeme *
|
||||
LexizeExec(LexizeData * ld, ParsedLex ** correspondLexem)
|
||||
LexizeExec(LexizeData *ld, ParsedLex **correspondLexem)
|
||||
{
|
||||
int i;
|
||||
ListDictionary *map;
|
||||
@@ -349,7 +349,7 @@ LexizeExec(LexizeData * ld, ParsedLex ** correspondLexem)
|
||||
* prs will be filled in.
|
||||
*/
|
||||
void
|
||||
parsetext(Oid cfgId, ParsedText * prs, char *buf, int buflen)
|
||||
parsetext(Oid cfgId, ParsedText *prs, char *buf, int buflen)
|
||||
{
|
||||
int type,
|
||||
lenlemm;
|
||||
@@ -429,7 +429,7 @@ parsetext(Oid cfgId, ParsedText * prs, char *buf, int buflen)
|
||||
* Headline framework
|
||||
*/
|
||||
static void
|
||||
hladdword(HeadlineParsedText * prs, char *buf, int buflen, int type)
|
||||
hladdword(HeadlineParsedText *prs, char *buf, int buflen, int type)
|
||||
{
|
||||
while (prs->curwords >= prs->lenwords)
|
||||
{
|
||||
@@ -445,7 +445,7 @@ hladdword(HeadlineParsedText * prs, char *buf, int buflen, int type)
|
||||
}
|
||||
|
||||
static void
|
||||
hlfinditem(HeadlineParsedText * prs, TSQuery query, char *buf, int buflen)
|
||||
hlfinditem(HeadlineParsedText *prs, TSQuery query, char *buf, int buflen)
|
||||
{
|
||||
int i;
|
||||
QueryItem *item = GETQUERY(query);
|
||||
@@ -479,7 +479,7 @@ hlfinditem(HeadlineParsedText * prs, TSQuery query, char *buf, int buflen)
|
||||
}
|
||||
|
||||
static void
|
||||
addHLParsedLex(HeadlineParsedText * prs, TSQuery query, ParsedLex * lexs, TSLexeme * norms)
|
||||
addHLParsedLex(HeadlineParsedText *prs, TSQuery query, ParsedLex *lexs, TSLexeme *norms)
|
||||
{
|
||||
ParsedLex *tmplexs;
|
||||
TSLexeme *ptr;
|
||||
@@ -515,7 +515,7 @@ addHLParsedLex(HeadlineParsedText * prs, TSQuery query, ParsedLex * lexs, TSLexe
|
||||
}
|
||||
|
||||
void
|
||||
hlparsetext(Oid cfgId, HeadlineParsedText * prs, TSQuery query, char *buf, int buflen)
|
||||
hlparsetext(Oid cfgId, HeadlineParsedText *prs, TSQuery query, char *buf, int buflen)
|
||||
{
|
||||
int type,
|
||||
lenlemm;
|
||||
@@ -575,7 +575,7 @@ hlparsetext(Oid cfgId, HeadlineParsedText * prs, TSQuery query, char *buf, int b
|
||||
}
|
||||
|
||||
text *
|
||||
generateHeadline(HeadlineParsedText * prs)
|
||||
generateHeadline(HeadlineParsedText *prs)
|
||||
{
|
||||
text *out;
|
||||
int len = 128;
|
||||
|
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/tsearch/ts_utils.c,v 1.6 2007/11/15 21:14:38 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/tsearch/ts_utils.c,v 1.7 2007/11/15 22:25:16 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -74,7 +74,7 @@ comparestr(const void *a, const void *b)
|
||||
* or palloc a new version.
|
||||
*/
|
||||
void
|
||||
readstoplist(const char *fname, StopList * s, char *(*wordop) (const char *))
|
||||
readstoplist(const char *fname, StopList *s, char *(*wordop) (const char *))
|
||||
{
|
||||
char **stop = NULL;
|
||||
|
||||
@@ -147,7 +147,7 @@ readstoplist(const char *fname, StopList * s, char *(*wordop) (const char *))
|
||||
}
|
||||
|
||||
bool
|
||||
searchstoplist(StopList * s, char *key)
|
||||
searchstoplist(StopList *s, char *key)
|
||||
{
|
||||
return (s->stop && s->len > 0 &&
|
||||
bsearch(&key, s->stop, s->len,
|
||||
|
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/tsearch/wparser.c,v 1.4 2007/11/15 21:14:38 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/tsearch/wparser.c,v 1.5 2007/11/15 22:25:16 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -37,7 +37,7 @@ typedef struct
|
||||
{
|
||||
int cur;
|
||||
LexDescr *list;
|
||||
} TSTokenTypeStorage;
|
||||
} TSTokenTypeStorage;
|
||||
|
||||
static void
|
||||
tt_setup_firstcall(FuncCallContext *funcctx, Oid prsid)
|
||||
@@ -150,14 +150,14 @@ typedef struct
|
||||
{
|
||||
int type;
|
||||
char *lexeme;
|
||||
} LexemeEntry;
|
||||
} LexemeEntry;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int cur;
|
||||
int len;
|
||||
LexemeEntry *list;
|
||||
} PrsStorage;
|
||||
} PrsStorage;
|
||||
|
||||
|
||||
static void
|
||||
|
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/tsearch/wparser_def.c,v 1.9 2007/11/15 21:14:38 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/tsearch/wparser_def.c,v 1.10 2007/11/15 22:25:16 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -189,7 +189,7 @@ typedef enum
|
||||
TPS_InHyphenNumWordPart,
|
||||
TPS_InHyphenUnsignedInt,
|
||||
TPS_Null /* last state (fake value) */
|
||||
} TParserState;
|
||||
} TParserState;
|
||||
|
||||
/* forward declaration */
|
||||
struct TParser;
|
||||
@@ -207,7 +207,7 @@ typedef struct
|
||||
TParserState tostate;
|
||||
int type;
|
||||
TParserSpecial special;
|
||||
} TParserStateActionItem;
|
||||
} TParserStateActionItem;
|
||||
|
||||
/* Flag bits in TParserStateActionItem.flags */
|
||||
#define A_NEXT 0x0000
|
||||
@@ -229,7 +229,7 @@ typedef struct TParserPosition
|
||||
TParserState state;
|
||||
struct TParserPosition *prev;
|
||||
const TParserStateActionItem *pushedAtAction;
|
||||
} TParserPosition;
|
||||
} TParserPosition;
|
||||
|
||||
typedef struct TParser
|
||||
{
|
||||
@@ -256,15 +256,15 @@ typedef struct TParser
|
||||
int lenbytetoken;
|
||||
int lenchartoken;
|
||||
int type;
|
||||
} TParser;
|
||||
} TParser;
|
||||
|
||||
|
||||
/* forward decls here */
|
||||
static bool TParserGet(TParser * prs);
|
||||
static bool TParserGet(TParser *prs);
|
||||
|
||||
|
||||
static TParserPosition *
|
||||
newTParserPosition(TParserPosition * prev)
|
||||
newTParserPosition(TParserPosition *prev)
|
||||
{
|
||||
TParserPosition *res = (TParserPosition *) palloc(sizeof(TParserPosition));
|
||||
|
||||
@@ -316,7 +316,7 @@ TParserInit(char *str, int len)
|
||||
}
|
||||
|
||||
static void
|
||||
TParserClose(TParser * prs)
|
||||
TParserClose(TParser *prs)
|
||||
{
|
||||
while (prs->state)
|
||||
{
|
||||
@@ -365,7 +365,7 @@ p_isnot##type(TParser *prs) { \
|
||||
}
|
||||
|
||||
static int
|
||||
p_isalnum(TParser * prs)
|
||||
p_isalnum(TParser *prs)
|
||||
{
|
||||
Assert(prs->state);
|
||||
|
||||
@@ -391,13 +391,13 @@ p_isalnum(TParser * prs)
|
||||
return isalnum(*(unsigned char *) (prs->str + prs->state->posbyte));
|
||||
}
|
||||
static int
|
||||
p_isnotalnum(TParser * prs)
|
||||
p_isnotalnum(TParser *prs)
|
||||
{
|
||||
return !p_isalnum(prs);
|
||||
}
|
||||
|
||||
static int
|
||||
p_isalpha(TParser * prs)
|
||||
p_isalpha(TParser *prs)
|
||||
{
|
||||
Assert(prs->state);
|
||||
|
||||
@@ -424,7 +424,7 @@ p_isalpha(TParser * prs)
|
||||
}
|
||||
|
||||
static int
|
||||
p_isnotalpha(TParser * prs)
|
||||
p_isnotalpha(TParser *prs)
|
||||
{
|
||||
return !p_isalpha(prs);
|
||||
}
|
||||
@@ -432,7 +432,7 @@ p_isnotalpha(TParser * prs)
|
||||
/* p_iseq should be used only for ascii symbols */
|
||||
|
||||
static int
|
||||
p_iseq(TParser * prs, char c)
|
||||
p_iseq(TParser *prs, char c)
|
||||
{
|
||||
Assert(prs->state);
|
||||
return ((prs->state->charlen == 1 && *(prs->str + prs->state->posbyte) == c)) ? 1 : 0;
|
||||
@@ -453,7 +453,7 @@ p_isnot##type(TParser *prs) { \
|
||||
|
||||
|
||||
static int
|
||||
p_iseq(TParser * prs, char c)
|
||||
p_iseq(TParser *prs, char c)
|
||||
{
|
||||
Assert(prs->state);
|
||||
return (*(prs->str + prs->state->posbyte) == c) ? 1 : 0;
|
||||
@@ -472,32 +472,32 @@ p_iswhat(upper)
|
||||
p_iswhat(xdigit)
|
||||
|
||||
static int
|
||||
p_isEOF(TParser * prs)
|
||||
p_isEOF(TParser *prs)
|
||||
{
|
||||
Assert(prs->state);
|
||||
return (prs->state->posbyte == prs->lenstr || prs->state->charlen == 0) ? 1 : 0;
|
||||
}
|
||||
|
||||
static int
|
||||
p_iseqC(TParser * prs)
|
||||
p_iseqC(TParser *prs)
|
||||
{
|
||||
return p_iseq(prs, prs->c);
|
||||
}
|
||||
|
||||
static int
|
||||
p_isneC(TParser * prs)
|
||||
p_isneC(TParser *prs)
|
||||
{
|
||||
return !p_iseq(prs, prs->c);
|
||||
}
|
||||
|
||||
static int
|
||||
p_isascii(TParser * prs)
|
||||
p_isascii(TParser *prs)
|
||||
{
|
||||
return (prs->state->charlen == 1 && isascii((unsigned char) *(prs->str + prs->state->posbyte))) ? 1 : 0;
|
||||
}
|
||||
|
||||
static int
|
||||
p_isasclet(TParser * prs)
|
||||
p_isasclet(TParser *prs)
|
||||
{
|
||||
return (p_isascii(prs) && p_isalpha(prs)) ? 1 : 0;
|
||||
}
|
||||
@@ -533,7 +533,7 @@ _make_compiler_happy(void)
|
||||
|
||||
|
||||
static void
|
||||
SpecialTags(TParser * prs)
|
||||
SpecialTags(TParser *prs)
|
||||
{
|
||||
switch (prs->state->lenchartoken)
|
||||
{
|
||||
@@ -557,7 +557,7 @@ SpecialTags(TParser * prs)
|
||||
}
|
||||
|
||||
static void
|
||||
SpecialFURL(TParser * prs)
|
||||
SpecialFURL(TParser *prs)
|
||||
{
|
||||
prs->wanthost = true;
|
||||
prs->state->posbyte -= prs->state->lenbytetoken;
|
||||
@@ -565,14 +565,14 @@ SpecialFURL(TParser * prs)
|
||||
}
|
||||
|
||||
static void
|
||||
SpecialHyphen(TParser * prs)
|
||||
SpecialHyphen(TParser *prs)
|
||||
{
|
||||
prs->state->posbyte -= prs->state->lenbytetoken;
|
||||
prs->state->poschar -= prs->state->lenchartoken;
|
||||
}
|
||||
|
||||
static void
|
||||
SpecialVerVersion(TParser * prs)
|
||||
SpecialVerVersion(TParser *prs)
|
||||
{
|
||||
prs->state->posbyte -= prs->state->lenbytetoken;
|
||||
prs->state->poschar -= prs->state->lenchartoken;
|
||||
@@ -581,7 +581,7 @@ SpecialVerVersion(TParser * prs)
|
||||
}
|
||||
|
||||
static int
|
||||
p_isstophost(TParser * prs)
|
||||
p_isstophost(TParser *prs)
|
||||
{
|
||||
if (prs->wanthost)
|
||||
{
|
||||
@@ -592,13 +592,13 @@ p_isstophost(TParser * prs)
|
||||
}
|
||||
|
||||
static int
|
||||
p_isignore(TParser * prs)
|
||||
p_isignore(TParser *prs)
|
||||
{
|
||||
return (prs->ignore) ? 1 : 0;
|
||||
}
|
||||
|
||||
static int
|
||||
p_ishost(TParser * prs)
|
||||
p_ishost(TParser *prs)
|
||||
{
|
||||
TParser *tmpprs = TParserInit(prs->str + prs->state->posbyte, prs->lenstr - prs->state->posbyte);
|
||||
int res = 0;
|
||||
@@ -618,7 +618,7 @@ p_ishost(TParser * prs)
|
||||
}
|
||||
|
||||
static int
|
||||
p_isURLPath(TParser * prs)
|
||||
p_isURLPath(TParser *prs)
|
||||
{
|
||||
TParser *tmpprs = TParserInit(prs->str + prs->state->posbyte, prs->lenstr - prs->state->posbyte);
|
||||
int res = 0;
|
||||
@@ -1244,7 +1244,7 @@ typedef struct
|
||||
#ifdef WPARSER_TRACE
|
||||
const char *state_name; /* only for debug printout */
|
||||
#endif
|
||||
} TParserStateAction;
|
||||
} TParserStateAction;
|
||||
|
||||
#ifdef WPARSER_TRACE
|
||||
#define TPARSERSTATEACTION(state) \
|
||||
@@ -1338,7 +1338,7 @@ static const TParserStateAction Actions[] = {
|
||||
|
||||
|
||||
static bool
|
||||
TParserGet(TParser * prs)
|
||||
TParserGet(TParser *prs)
|
||||
{
|
||||
const TParserStateActionItem *item = NULL;
|
||||
|
||||
@@ -1566,10 +1566,10 @@ typedef struct
|
||||
{
|
||||
HeadlineWordEntry *words;
|
||||
int len;
|
||||
} hlCheck;
|
||||
} hlCheck;
|
||||
|
||||
static bool
|
||||
checkcondition_HL(void *checkval, QueryOperand * val)
|
||||
checkcondition_HL(void *checkval, QueryOperand *val)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -1583,7 +1583,7 @@ checkcondition_HL(void *checkval, QueryOperand * val)
|
||||
|
||||
|
||||
static bool
|
||||
hlCover(HeadlineParsedText * prs, TSQuery query, int *p, int *q)
|
||||
hlCover(HeadlineParsedText *prs, TSQuery query, int *p, int *q)
|
||||
{
|
||||
int i,
|
||||
j;
|
||||
|
Reference in New Issue
Block a user