(file) Return to browser.cgi CVS log (file) (dir) Up to [app-findlib-browser] / browser.cgi

Diff for /browser.cgi between version 1 and 6

version 1, Sun Jan 4 19:43:45 2004 UTC version 6, Fri Oct 22 11:05:52 2004 UTC
Line 18 
Line 18 
   
 (* ---------------------------------------------------------------------- *)  (* ---------------------------------------------------------------------- *)
   
 let args = lazy begin Cgi.parse_args() end;;  let cgi = new Netcgi.std_activation
               ~operating_type:Netcgi.buffered_transactional_optype ();;
   
 let param n = List.assoc n (Lazy.force args);;  let param n = (cgi # argument n) # value;;
   
   let print s = cgi # output # output_string s;;
   
   let cancel() = cgi # output # rollback_work();;
   
   let commit() = cgi # output # commit_work();;
   
 (* ---------------------------------------------------------------------- *)  (* ---------------------------------------------------------------------- *)
   
Line 78 
Line 85 
   
 (* ---------------------------------------------------------------------- *)  (* ---------------------------------------------------------------------- *)
   
 let outbuf = Buffer.create 50000;;  let escape_html =
     Netencoding.Html.encode ~in_enc:`Enc_iso88591 ()
 let print s = Buffer.add_string outbuf s;;  
   
 let cancel() = Buffer.clear outbuf;;  
   
 let commit() = Buffer.output_buffer stdout outbuf;;  
   
 (* ---------------------------------------------------------------------- *)  
   
 let escape_html s =  
   Str.global_substitute  
     (Str.regexp "<\\|>\\|&\\|\"")  
     (fun s ->  
       match Str.matched_string s with  
         "<" -> "&lt;"  
       | ">" -> "&gt;"  
       | "&" -> "&amp;"  
       | "\"" -> "&quot;"  
       | _ -> assert false)  
     s  
 ;;  ;;
   
   
Line 213 
Line 201 
   
   let pkg_url p =    let pkg_url p =
     "<a href=\"browser.cgi?" ^      "<a href=\"browser.cgi?" ^
     "pkg=" ^ Cgi.encode p ^      "pkg=" ^ Netencoding.Url.encode p ^
     "\">" ^      "\">" ^
     escape_html p ^      escape_html p ^
     "</a>"      "</a>"
Line 221 
Line 209 
   
   let mod_url p m =    let mod_url p m =
     "<a href=\"browser.cgi?" ^      "<a href=\"browser.cgi?" ^
     "pkg=" ^ Cgi.encode p ^      "pkg=" ^ Netencoding.Url.encode p ^
     "&mod=" ^ Cgi.encode m ^      "&mod=" ^ Netencoding.Url.encode m ^
     "\">" ^      "\">" ^
     escape_html m ^      escape_html m ^
     "</a>"      "</a>"
Line 230 
Line 218 
   
   let mod_url_hl p m hl =    let mod_url_hl p m hl =
     "<a href=\"browser.cgi?" ^      "<a href=\"browser.cgi?" ^
     "pkg=" ^ Cgi.encode p ^      "pkg=" ^ Netencoding.Url.encode p ^
     "&mod=" ^ Cgi.encode m ^      "&mod=" ^ Netencoding.Url.encode m ^
     "&hlight=" ^ Cgi.encode hl ^      "&hlight=" ^ Netencoding.Url.encode hl ^
     "\">" ^      "\">" ^
     escape_html m ^      escape_html m ^
     "</a>"      "</a>"
Line 240 
Line 228 
   
   (*** headline ***)    (*** headline ***)
   
   print "content-type: text/html\n\n";    cgi # set_header();
   print "<html><head><title>Objective Caml Packages</title></head>\n";    print "<html><head><title>Objective Caml Packages</title></head>\n";
   print "<body bgcolor=white>\n";    print "<body bgcolor=white>\n";
   print "<h1>Objective Caml Packages</h1>\n";    print "<h1>Objective Caml Packages</h1>\n";
Line 466 
Line 454 
   action()    action()
 with  with
   e ->    e ->
     print "content-type: text/html\n\n";      cgi # set_header();
     print "<html><body><h1>Software error</h1>\n";      print "<html><body><h1>Software error</h1>\n";
     print (Printexc.to_string e);      print (Printexc.to_string e);
     print "</body></html>\n";      print "</body></html>\n";


Legend:
Removed from v.1  
changed lines
  Added in v.6

SVN admin
Powered by
ViewCVS 1.0-dev