CREATE OR REPLACE FUNCTION getWeight(text, text)
RETURNS double precision
AS 'BINGO_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;

CREATE OR REPLACE FUNCTION getWeight(bytea, text)
RETURNS double precision
AS 'BINGO_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;

CREATE OR REPLACE FUNCTION getMass(text)
RETURNS double precision
AS 'BINGO_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;

CREATE OR REPLACE FUNCTION getMass(bytea)
RETURNS double precision
AS 'BINGO_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;

CREATE OR REPLACE FUNCTION smiles(text)
RETURNS text
AS 'BINGO_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;

CREATE OR REPLACE FUNCTION smiles(bytea)
RETURNS text
AS 'BINGO_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;

CREATE OR REPLACE FUNCTION cansmiles(text)
RETURNS text
AS 'BINGO_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;

CREATE OR REPLACE FUNCTION cansmiles(bytea)
RETURNS text
AS 'BINGO_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;

CREATE OR REPLACE FUNCTION molfile(text)
RETURNS text
AS 'BINGO_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;

CREATE OR REPLACE FUNCTION molfile(bytea)
RETURNS text
AS 'BINGO_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;

CREATE OR REPLACE FUNCTION cml(text)
RETURNS text
AS 'BINGO_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;

CREATE OR REPLACE FUNCTION cml(bytea)
RETURNS text
AS 'BINGO_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;

CREATE OR REPLACE FUNCTION checkMolecule(text)
RETURNS text
AS 'BINGO_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;

CREATE OR REPLACE FUNCTION checkMolecule(bytea)
RETURNS text
AS 'BINGO_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;

CREATE OR REPLACE FUNCTION gross(text)
RETURNS text
AS 'BINGO_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;

CREATE OR REPLACE FUNCTION gross(bytea)
RETURNS text
AS 'BINGO_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;

CREATE OR REPLACE FUNCTION fingerprint(text, text)
RETURNS bytea
AS 'BINGO_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;

CREATE OR REPLACE FUNCTION fingerprint(bytea, text)
RETURNS bytea
AS 'BINGO_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;

CREATE OR REPLACE FUNCTION compactmolecule(text, boolean)
RETURNS bytea
AS 'BINGO_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;

CREATE OR REPLACE FUNCTION compactmolecule(bytea, boolean)
RETURNS bytea
AS 'BINGO_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;

CREATE OR REPLACE FUNCTION inchi(text, text)
RETURNS text
AS 'BINGO_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;

CREATE OR REPLACE FUNCTION inchi(bytea, text)
RETURNS text
AS 'BINGO_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;

CREATE OR REPLACE FUNCTION inchikey(text)
RETURNS text
AS 'BINGO_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;

CREATE OR REPLACE FUNCTION _sub_internal(text, text, text)
RETURNS boolean
AS 'BINGO_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;

CREATE OR REPLACE FUNCTION _sub_internal(text, bytea, text)
RETURNS boolean
AS 'BINGO_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;

CREATE OR REPLACE FUNCTION _smarts_internal(text, text, text)
RETURNS boolean
AS 'BINGO_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;

CREATE OR REPLACE FUNCTION _smarts_internal(text, bytea, text)
RETURNS boolean
AS 'BINGO_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;

CREATE OR REPLACE FUNCTION _exact_internal(text, text, text)
RETURNS boolean
AS 'BINGO_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;

CREATE OR REPLACE FUNCTION _exact_internal(text, bytea, text)
RETURNS boolean
AS 'BINGO_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;

CREATE OR REPLACE FUNCTION _gross_internal(text, text, text)
RETURNS boolean
AS 'BINGO_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;

CREATE OR REPLACE FUNCTION _gross_internal(text, text, bytea)
RETURNS boolean
AS 'BINGO_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;

--******************* MASS *******************

CREATE TYPE mass;

CREATE OR REPLACE FUNCTION _mass_in(cstring)
    RETURNS mass
    AS 'BINGO_PATHNAME'
    LANGUAGE C IMMUTABLE STRICT;

CREATE OR REPLACE FUNCTION _mass_out(mass)
    RETURNS cstring
    AS 'BINGO_PATHNAME'
    LANGUAGE C IMMUTABLE STRICT;

CREATE TYPE mass (
   internallength = variable, 
   input = _mass_in,
   output = _mass_out
);

CREATE OR REPLACE FUNCTION _match_mass_great(text, mass)
RETURNS boolean
AS 'BINGO_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;

CREATE OR REPLACE FUNCTION _match_mass_great(bytea, mass)
RETURNS boolean
AS 'BINGO_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;

CREATE OR REPLACE FUNCTION _match_mass_less(text, mass)
RETURNS boolean
AS 'BINGO_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;

CREATE OR REPLACE FUNCTION _match_mass_less(bytea, mass)
RETURNS boolean
AS 'BINGO_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;

--******************* SIMILARITY *******************

CREATE OR REPLACE FUNCTION getSimilarity(text, text, text)
RETURNS real
AS 'BINGO_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;

CREATE OR REPLACE FUNCTION getSimilarity(bytea, text, text)
RETURNS real
AS 'BINGO_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;

CREATE TYPE sim AS (min_bound real, max_bound real, query_mol text, query_options text);

CREATE OR REPLACE FUNCTION _sim_internal(real, real, text, text, text)
RETURNS boolean
AS 'BINGO_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;

CREATE OR REPLACE FUNCTION _sim_internal(real, real, text, bytea, text)
RETURNS boolean
AS 'BINGO_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;

--******************* STANDARDIZE *******************

CREATE OR REPLACE FUNCTION standardize(text, text)
RETURNS text
AS 'BINGO_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;

CREATE OR REPLACE FUNCTION standardize(bytea, text)
RETURNS text
AS 'BINGO_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
