Navigation Menu

Skip to content

Commit

Permalink
Remove "s" from "contains"
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Jan 22, 2015
1 parent 02d4451 commit 3ea7eaf
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
12 changes: 6 additions & 6 deletions pgroonga--0.2.0.sql
Expand Up @@ -2,28 +2,28 @@ SET search_path = public;

CREATE SCHEMA pgroonga;

CREATE FUNCTION pgroonga.contains(text, text)
CREATE FUNCTION pgroonga.contain(text, text)
RETURNS bool
AS 'MODULE_PATHNAME', 'pgroonga_contains_text'
AS 'MODULE_PATHNAME', 'pgroonga_contain_text'
LANGUAGE C
IMMUTABLE
STRICT;

CREATE FUNCTION pgroonga.contains(bpchar, bpchar)
CREATE FUNCTION pgroonga.contain(bpchar, bpchar)
RETURNS bool
AS 'MODULE_PATHNAME', 'pgroonga_contains_bpchar'
AS 'MODULE_PATHNAME', 'pgroonga_contain_bpchar'
LANGUAGE C
IMMUTABLE
STRICT;

CREATE OPERATOR %% (
PROCEDURE = pgroonga.contains,
PROCEDURE = pgroonga.contain,
LEFTARG = text,
RIGHTARG = text
);

CREATE OPERATOR %% (
PROCEDURE = pgroonga.contains,
PROCEDURE = pgroonga.contain,
LEFTARG = bpchar,
RIGHTARG = bpchar
);
Expand Down
24 changes: 12 additions & 12 deletions pgroonga.c
Expand Up @@ -40,8 +40,8 @@ typedef struct GrnScanOpaqueData

typedef GrnScanOpaqueData *GrnScanOpaque;

PG_FUNCTION_INFO_V1(pgroonga_contains_text);
PG_FUNCTION_INFO_V1(pgroonga_contains_bpchar);
PG_FUNCTION_INFO_V1(pgroonga_contain_text);
PG_FUNCTION_INFO_V1(pgroonga_contain_bpchar);

PG_FUNCTION_INFO_V1(pgroonga_insert);
PG_FUNCTION_INFO_V1(pgroonga_beginscan);
Expand Down Expand Up @@ -434,8 +434,8 @@ GrnUnlock(Relation index, LOCKMODE mode)
}

static grn_bool
pgroonga_contains_raw(const char *text, unsigned int text_size,
const char *key, unsigned int key_size)
pgroonga_contain_raw(const char *text, unsigned int text_size,
const char *key, unsigned int key_size)
{
grn_bool contained = GRN_FALSE;
grn_obj buffer;
Expand Down Expand Up @@ -471,33 +471,33 @@ pgroonga_contains_raw(const char *text, unsigned int text_size,
}

/**
* pgroonga.contains(doc text, key text) : bool
* pgroonga.contain(doc text, key text) : bool
*/
Datum
pgroonga_contains_text(PG_FUNCTION_ARGS)
pgroonga_contain_text(PG_FUNCTION_ARGS)
{
text *doc = PG_GETARG_TEXT_PP(0);
text *key = PG_GETARG_TEXT_PP(1);
grn_bool contained;

contained = pgroonga_contains_raw(VARDATA_ANY(doc), VARSIZE_ANY_EXHDR(doc),
VARDATA_ANY(key), VARSIZE_ANY_EXHDR(key));
contained = pgroonga_contain_raw(VARDATA_ANY(doc), VARSIZE_ANY_EXHDR(doc),
VARDATA_ANY(key), VARSIZE_ANY_EXHDR(key));
PG_RETURN_BOOL(contained);
}

/**
* pgroonga.contains(doc bpchar, key bpchar) : bool
* pgroonga.contain(doc bpchar, key bpchar) : bool
*/
Datum
pgroonga_contains_bpchar(PG_FUNCTION_ARGS)
pgroonga_contain_bpchar(PG_FUNCTION_ARGS)
{
BpChar *doc = PG_GETARG_BPCHAR_PP(0);
BpChar *key = PG_GETARG_BPCHAR_PP(1);
grn_bool contained;

contained =
pgroonga_contains_raw(VARDATA_ANY(doc), pgroonga_bpchar_size(doc),
VARDATA_ANY(key), pgroonga_bpchar_size(key));
pgroonga_contain_raw(VARDATA_ANY(doc), pgroonga_bpchar_size(doc),
VARDATA_ANY(key), pgroonga_bpchar_size(key));
PG_RETURN_BOOL(contained);
}

Expand Down
4 changes: 2 additions & 2 deletions pgroonga.h
Expand Up @@ -36,8 +36,8 @@
/* in pgroonga.c */
extern void PGDLLEXPORT _PG_init(void);

extern Datum PGDLLEXPORT pgroonga_contains_text(PG_FUNCTION_ARGS);
extern Datum PGDLLEXPORT pgroonga_contains_bpchar(PG_FUNCTION_ARGS);
extern Datum PGDLLEXPORT pgroonga_contain_text(PG_FUNCTION_ARGS);
extern Datum PGDLLEXPORT pgroonga_contain_bpchar(PG_FUNCTION_ARGS);
extern Datum PGDLLEXPORT pgroonga_match(PG_FUNCTION_ARGS);

extern Datum PGDLLEXPORT pgroonga_insert(PG_FUNCTION_ARGS);
Expand Down

0 comments on commit 3ea7eaf

Please sign in to comment.