--
-- CREATE_FUNCTION_1
--
CREATE FUNCTION widget_in(cstring)
   RETURNS widget
   AS '@libdir@/regress@DLSUFFIX@'
   LANGUAGE C STRICT NOT FENCED;

CREATE FUNCTION widget_out(widget)
   RETURNS cstring
   AS '@libdir@/regress@DLSUFFIX@'
   LANGUAGE C STRICT NOT FENCED;

CREATE FUNCTION int44in(cstring)
   RETURNS city_budget
   AS '@libdir@/regress@DLSUFFIX@'
   LANGUAGE C STRICT NOT FENCED;

CREATE FUNCTION int44out(city_budget)
   RETURNS cstring
   AS '@libdir@/regress@DLSUFFIX@'
   LANGUAGE C STRICT NOT FENCED;

CREATE FUNCTION check_primary_key ()
	RETURNS trigger
	AS '@libdir@/refint@DLSUFFIX@'
	LANGUAGE C NOT FENCED;

CREATE FUNCTION check_foreign_key ()
	RETURNS trigger
	AS '@libdir@/refint@DLSUFFIX@'
	LANGUAGE C NOT FENCED;

CREATE FUNCTION autoinc ()
	RETURNS trigger
	AS '@libdir@/autoinc@DLSUFFIX@'
	LANGUAGE C NOT FENCED;

CREATE FUNCTION funny_dup17 ()
        RETURNS trigger
        AS '@libdir@/regress@DLSUFFIX@'
        LANGUAGE C NOT FENCED;

CREATE FUNCTION ttdummy ()
        RETURNS trigger
        AS '@libdir@/regress@DLSUFFIX@'
        LANGUAGE C NOT FENCED;

CREATE FUNCTION set_ttdummy (int4)
        RETURNS int4
        AS '@libdir@/regress@DLSUFFIX@'
        LANGUAGE C STRICT NOT FENCED;

CREATE FUNCTION test_atomic_ops()
	RETURNS bool
	AS '@libdir@/regress@DLSUFFIX@'
	LANGUAGE C STRICT NOT FENCED;

-- Things that shouldn't work:

CREATE FUNCTION test1 (int) RETURNS int LANGUAGE SQL
    AS 'SELECT ''not an integer'';';

CREATE FUNCTION test1 (int) RETURNS int LANGUAGE SQL
    AS 'not even SQL';

CREATE FUNCTION test1 (int) RETURNS int LANGUAGE SQL
    AS 'SELECT 1, 2, 3;';

CREATE FUNCTION test1 (int) RETURNS int LANGUAGE SQL
    AS 'SELECT $2;';

CREATE FUNCTION test1 (int) RETURNS int LANGUAGE SQL
    AS 'a', 'b';

CREATE FUNCTION test1 (int) RETURNS int LANGUAGE C
    AS 'nosuchfile';

CREATE FUNCTION test1 (int) RETURNS int LANGUAGE C
    AS '@libdir@/regress@DLSUFFIX@', 'nosuchsymbol' NOT FENCED;

CREATE FUNCTION test1 (int) RETURNS int LANGUAGE internal
    AS 'nosuch';
