Refactoring by Heikki Linnakangas <heikki@enterprisedb.com> with
authorTeodor Sigaev <teodor@sigaev.ru>
Fri, 7 Sep 2007 15:09:56 +0000 (15:09 +0000)
committerTeodor Sigaev <teodor@sigaev.ru>
Fri, 7 Sep 2007 15:09:56 +0000 (15:09 +0000)
commit8d99ddcaccf35aa065952f1edf9309d532560e53
treef41408858a59e1b303d0439232314bcb056de97f
parent68573e49c5d42a4bce5729f8c67135478c480b72
Refactoring by Heikki Linnakangas <heikki@enterprisedb.com> with
small editorization by me

- Brake the QueryItem struct into QueryOperator and QueryOperand.
  Type was really the only common field between them. QueryItem still
  exists, and is used in the TSQuery struct as before, but it's now a
  union of the two. Many other changes fell from that, like separation
  of pushval_asis function into pushValue, pushOperator and pushStop.

- Moved some structs that were for internal use only from header files
  to the right .c-files.

- Moved tsvector parser to a new tsvector_parser.c file. Parser code was
  about half of the size of tsvector.c, it's also used from tsquery.c, and
  it has some data structures of its own, so it seems better to separate
  it. Cleaned up the API so that TSVectorParserState is not accessed from
  outside tsvector_parser.c.

- Separated enumerations (#defines, really) used for QueryItem.type
  field and as return codes from gettoken_query. It was just accidental
  code sharing.

- Removed ParseQueryNode struct used internally by makepol and friends.
  push*-functions now construct QueryItems directly.

- Changed int4 variables to just ints for variables like "i" or "array
  size", where the storage-size was not significant.
18 files changed:
src/backend/tsearch/to_tsany.c
src/backend/tsearch/ts_parse.c
src/backend/tsearch/wparser_def.c
src/backend/utils/adt/Makefile
src/backend/utils/adt/tsginidx.c
src/backend/utils/adt/tsgistidx.c
src/backend/utils/adt/tsquery.c
src/backend/utils/adt/tsquery_cleanup.c
src/backend/utils/adt/tsquery_op.c
src/backend/utils/adt/tsquery_rewrite.c
src/backend/utils/adt/tsquery_util.c
src/backend/utils/adt/tsrank.c
src/backend/utils/adt/tsvector.c
src/backend/utils/adt/tsvector_op.c
src/backend/utils/adt/tsvector_parser.c [new file with mode: 0644]
src/include/tsearch/ts_public.h
src/include/tsearch/ts_type.h
src/include/tsearch/ts_utils.h