package eliom
Advanced client/server Web and mobile framework
Install
Dune Dependency
Authors
Maintainers
Sources
10.4.1.tar.gz
md5=218bcb5cd275cc05be06574c5fa357fa
sha512=edbf8b084ec1b7439d4715199c22eb925a77a2dcfbe76bb5bbc4b9d076b70be1b0de74f9eab9dfb7854df28d65eb31a4c17380528d4a461d9c2a4222abe804cc
doc/src/eliom.server/eliom_lib.ml.html
Source file eliom_lib.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
# 1 "src/lib/eliom_lib.server.ml" (* Please put in this file ONLY extensions of the standard OCaml library. And remove all the Eliom/Ocsigen specific stuff. *) include Ocsigen_lib include ( Eliom_lib_base : module type of Eliom_lib_base with type 'a Int64_map.t = 'a Eliom_lib_base.Int64_map.t with type 'a String_map.t = 'a Eliom_lib_base.String_map.t with type 'a Int_map.t = 'a Eliom_lib_base.Int_map.t) let debug f = Printf.ksprintf (fun s -> Printf.eprintf "%s\n%!" s) f let to_json ?typ v = match typ with | Some typ -> Deriving_Json.to_string typ v | None -> assert false (* implemented only client side *) let of_json ?typ s = match typ with | Some typ -> Deriving_Json.from_string typ s | None -> assert false (* implemented only client side *) module Lwt_log = struct include Lwt_log let eliom = Section.make "eliom" end type file_info = Ocsigen_extensions.file_info let b = Buffer.create (16 * 1024) let string_escape s = let l = String.length s in Buffer.clear b; let conv = "0123456789abcdef" in for i = 0 to l - 1 do let c = s.[i] in match c with | '\000' when i = l - 1 || s.[i + 1] < '0' || s.[i + 1] > '9' -> Buffer.add_string b "\\0" | '\b' -> Buffer.add_string b "\\b" | '\t' -> Buffer.add_string b "\\t" | '\n' -> Buffer.add_string b "\\n" (*| '\011' -> (* IE<9 doesn't like vertical tab \v *) Buffer.add_string b "\\v"*) | '\012' -> Buffer.add_string b "\\f" | '\r' -> Buffer.add_string b "\\r" | '\'' -> Buffer.add_string b "\\'" | '\\' -> Buffer.add_string b "\\\\" | '\000' .. '\031' | '\127' .. '\255' | '&' | '<' | '>' -> let c = Char.code c in Buffer.add_string b "\\x"; Buffer.add_char b conv.[c lsr 4]; Buffer.add_char b conv.[c land 0xf] | _ -> Buffer.add_char b c done; Buffer.contents b let jsmarshal v = string_escape (Marshal.to_string v []) let make_cryptographic_safe_string ?len () = match len with | None -> Ocsigen_lib.make_cryptographic_safe_string () | Some l -> String.sub (Ocsigen_lib.make_cryptographic_safe_string ()) 0 l
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>