OSDN Git Service

next.
[hmh/wiki.git] / lib.ml
diff --git a/lib.ml b/lib.ml
index 0ef5a15..143ec11 100644 (file)
--- a/lib.ml
+++ b/lib.ml
        )
 )
 
+(defun wiki-page-backup-list (page vdate)
+       (sql "select Date from BackupIndex where PID=:pid and Page=:page order by Date desc"
+               :bind (list ':pid PID ':page page)
+               :@answer (list vdate))
+)
+
+(defun wiki-page-date (page date)
+       (let (title text)
+               (if (emptyp date)
+                               (sql "select b.Title,b.WikiText from WikiIndex a,Wiki b using(WID) where a.PID=:pid and a.Page=:page"
+                                       :bind (list ':pid PID ':page page)
+                                       :answer '(title text))
+                       (sql "select b.Title,b.WikiText from BackupIndex a,Wiki b using(WID) where a.PID=:pid and a.Page=:page and Date=:date"
+                               :bind (list ':pid PID ':page page ':date date)
+                               :answer '(title text))
+               )
+               (list title text)
+       )
+)
+
 (defun wiki-save (page title text)
        (let (iid wid date uid nwid)
                (sql "begin")
                        )
        )
 )
+
+(defun wiki-search (key vpage vtitle vsp)
+       ($estcmd 'wiki-index
+               (search key
+                       :attribute "Page" vpage
+                       :attribute "@title" vtitle
+                       :snippet vsp
+                       :cond (concat "Proj STREQ " PID))
+       )
+       (doarray (list vtitle)
+               (if (emptyp (getvar vtitle))
+                               (setvar vtitle "<タイトル未設定>")
+               )
+       )
+)
+
+(defun wiki-diff (page otime ntime vo1 vo2 vn1 vn2)
+       (let (to tn)
+               ($sqlite3 'database
+                       (sql
+               )
+       )
+)