--- trunk/pgest.sql	2005/05/20 19:44:09	5
+++ trunk/pgest.sql	2006/08/07 11:14:52	61
@@ -1,22 +1,18 @@
-drop type __pgest cascade;
 
-CREATE TYPE __pgest AS (
---	id integer,
-	id text,
-	uri text,
-	title text,
---	size integer
-	size text
-);
+-- select * from pgest('/index/path', 'query', '@title ISTRINC foo', '@title STRA', limit, offset, ARRAY['@id','@title','@size']) as (id text, title text, size text);
+CREATE OR REPLACE FUNCTION pgest(text, text, text, text, int, int, text[])
+	RETURNS setof record
+	AS 'pgest','pgest_attr'
+	LANGUAGE 'C' IMMUTABLE CALLED ON NULL INPUT;
 
--- Search est-e index as table
--- select * from pgest('/index/path/','query', '@uri ISTREW .txt' limit, offset);
-CREATE OR REPLACE FUNCTION pgest(text, text, text, int, int)
-	RETURNS SETOF __pgest
-	AS 'pgest', 'pgest'
-	LANGUAGE C IMMUTABLE STRICT;
+-- select * from pgest('http://localhost:1978/node/trivia', 'admin', 'admin', depth, 'query', '@title ISTRINC foo', '@title STRA', limit, offset, ARRAY['@id','@title','@size']) as (id text, title text, size text);
+CREATE OR REPLACE FUNCTION pgest(text, text, text, int, text, text, text, int, int, text[])
+	RETURNS setof record
+	AS 'pgest','pgest_node'
+	LANGUAGE 'C' IMMUTABLE CALLED ON NULL INPUT;
+
+-- trigger for insert/update or delete
+CREATE OR REPLACE FUNCTION pgest_trigger() RETURNS TRIGGER
+        AS 'pgest', 'pgest_trigger'
+	LANGUAGE 'C' STRICT;
 
-CREATE OR REPLACE FUNCTION pgest2(text[])
-RETURNS setof record
-AS 'pgest','pgest2'
-LANGUAGE 'C' IMMUTABLE STRICT;
