About half way through switching cocanwiki to using the new PG interface.
[cocanwiki.git] / scripts / lib / cocanwiki_pages.mli
index 92c6809..b7082c9 100644 (file)
@@ -1,7 +1,7 @@
 (* COCANWIKI - a wiki written in Objective CAML.
  * Written by Richard W.M. Jones <rich@merjis.com>.
  * Copyright (C) 2004 Merjis Ltd.
- * $Id: cocanwiki_pages.mli,v 1.1 2004/10/21 11:42:05 rich Exp $
+ * $Id: cocanwiki_pages.mli,v 1.2 2006/03/27 16:43:44 rich Exp $
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -25,17 +25,17 @@ open Cocanwiki
 type pt = Page of string | Title of string
 
 type model = {
-  id : int;                            (* Original page ID (0 = none). *)
+  id : int32;                          (* Original page ID (0 = none). *)
   pt : pt;                             (* Page of title (only used if id=0) *)
   description : string;                        (* Description. *)
-  redirect : string;                   (* Redirect to ("" = none). *)
-  contents : (string * string * string) list;
+  redirect : string option;            (* Redirect to. *)
+  contents_ : (string option * string option * string) list;
                                        (* (sectionname, divname, content)
                                         * for each section. *)
 }
 
 exception SaveURLError
-exception SaveConflict of int * int * string * string
+exception SaveConflict of int32 * int32 * string * string
 
 val new_page : pt -> model
   (** Create a new, blank page. *)
@@ -45,7 +45,7 @@ val new_page_with_title : string -> model
     * a title and begins an introductory paragraph for the user.
     *)
 
-val load_page : Dbi.connection -> int -> url:string -> ?version:int -> unit -> model
+val load_page : PGOCaml.pa_pg_data PGOCaml.t -> int32 -> url:string -> ?version:int32 -> unit -> model
   (** Load a page from the database.  A non-current version can be
     * specified with the optional [?version] parameter, otherwise the
     * latest version is loaded.
@@ -53,7 +53,7 @@ val load_page : Dbi.connection -> int -> url:string -> ?version:int -> unit -> m
     * @raise Not_found If the page cannot be found.
     *)
 
-val save_page : Dbi.connection -> int -> ?user:user_t -> ?r:Apache.Request.t -> model -> string * int
+val save_page : PGOCaml.pa_pg_data PGOCaml.t -> int32 -> ?user:user_t -> ?r:Apache.Request.t -> model -> string * int32
   (** Save a page.  If the page is new, this creates a new page in the
     * database.  If the page is old, then the page is edited.
     *