]> granicus.if.org Git - postgresql/blobdiff - src/backend/tsearch/wparser.c
Update copyright for 2016
[postgresql] / src / backend / tsearch / wparser.c
index 7a16d39fbe9b0a2fda0278f220b28bd3a76b9d97..a3da8cf4d6b8ffefd58cc7e0240f9924d7090f25 100644 (file)
@@ -3,32 +3,23 @@
  * wparser.c
  *             Standard interface to word parser
  *
- * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
  *
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/backend/tsearch/wparser.c,v 1.8 2008/01/15 18:22:47 tgl Exp $
+ *       src/backend/tsearch/wparser.c
  *
  *-------------------------------------------------------------------------
  */
 #include "postgres.h"
 
 #include "funcapi.h"
-#include "access/genam.h"
-#include "access/heapam.h"
-#include "access/skey.h"
-#include "catalog/indexing.h"
 #include "catalog/namespace.h"
-#include "catalog/pg_ts_parser.h"
 #include "catalog/pg_type.h"
 #include "commands/defrem.h"
 #include "tsearch/ts_cache.h"
-#include "tsearch/ts_public.h"
 #include "tsearch/ts_utils.h"
 #include "utils/builtins.h"
-#include "utils/fmgroids.h"
-#include "utils/rel.h"
-#include "utils/syscache.h"
 
 
 /******sql-level interface******/
@@ -55,7 +46,7 @@ tt_setup_firstcall(FuncCallContext *funcctx, Oid prsid)
 
        st = (TSTokenTypeStorage *) palloc(sizeof(TSTokenTypeStorage));
        st->cur = 0;
-       /* OidFunctionCall0 is absent */
+       /* lextype takes one dummy argument */
        st->list = (LexDescr *) DatumGetPointer(OidFunctionCall1(prs->lextypeOid,
                                                                                                                         (Datum) 0));
        funcctx->user_fctx = (void *) st;
@@ -135,7 +126,7 @@ ts_token_type_byname(PG_FUNCTION_ARGS)
                Oid                     prsId;
 
                funcctx = SRF_FIRSTCALL_INIT();
-               prsId = TSParserGetPrsid(textToQualifiedNameList(prsname), false);
+               prsId = get_ts_parser_oid(textToQualifiedNameList(prsname), false);
                tt_setup_firstcall(funcctx, prsId);
        }
 
@@ -283,7 +274,7 @@ ts_parse_byname(PG_FUNCTION_ARGS)
                Oid                     prsId;
 
                funcctx = SRF_FIRSTCALL_INIT();
-               prsId = TSParserGetPrsid(textToQualifiedNameList(prsname), false);
+               prsId = get_ts_parser_oid(textToQualifiedNameList(prsname), false);
                prs_setup_firstcall(funcctx, prsId, txt);
        }
 
@@ -310,9 +301,9 @@ ts_headline_byid_opt(PG_FUNCTION_ARGS)
        prsobj = lookup_ts_parser_cache(cfg->prsId);
 
        if (!OidIsValid(prsobj->headlineOid))
-               ereport(ERROR, 
+               ereport(ERROR,
                                (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
-                                errmsg("text search parser does not support headline creation")));
+                  errmsg("text search parser does not support headline creation")));
 
        memset(&prs, 0, sizeof(HeadlineParsedText));
        prs.lenwords = 32;