--
-- FUNCTION DEFINITIONS
--
CREATE FUNCTION hobbies(person)
   RETURNS setof hobbies_r 
   AS 'select * from hobbies_r where person = $1.name'
   LANGUAGE 'sql';


CREATE FUNCTION hobby_construct(text, text)
   RETURNS hobbies_r
   AS 'select $1 as name, $2 as hobby'
   LANGUAGE 'sql';


CREATE FUNCTION equipment(hobbies_r)
   RETURNS setof equipment_r
   AS 'select * from equipment_r where hobby = $1.name'
   LANGUAGE 'sql';


CREATE FUNCTION user_relns()
   RETURNS setof name
   AS 'select relname 
       from pg_class 
       where relname !~ ''pg_.*'' and
             relkind <> ''i'' '
   LANGUAGE 'sql';

CREATE FUNCTION pt_in_widget(point, widget)
   RETURNS int4
   AS '_OBJWD_/regress_DLSUFFIX_'
   LANGUAGE 'c';

CREATE FUNCTION overpaid(emp)
   RETURNS bool
   AS '_OBJWD_/regress_DLSUFFIX_'
   LANGUAGE 'c';

CREATE FUNCTION boxarea(box)
   RETURNS int4
   AS '_OBJWD_/regress_DLSUFFIX_'
   LANGUAGE 'c';

CREATE FUNCTION interpt_pp(path, path)
   RETURNS point
   AS '_OBJWD_/regress_DLSUFFIX_'
   LANGUAGE 'c';

CREATE FUNCTION reverse_c16(char16)
   RETURNS char16
   AS '_OBJWD_/regress_DLSUFFIX_'
   LANGUAGE 'c';

--
-- FUNCTION DYNAMIC LOADING
--
LOAD '_OBJWD_/regress_DLSUFFIX_';

