text stringlengths 12 786k |
|---|
let add_build_dir s = if s = " " : || not ( in_an_eliom_inc_dir s ) then s else match ! build_dir with " " -> s | d -> d ^ " " / ^ s |
let add_build_dirs line = String . concat " " ( List . map add_build_dir ( split ' ' line ) ) |
let server_type_file_dependencies line = match split ' ' : line with | [ file ; deps ] -> if Filename . check_suffix file " . cmo " then Printf . sprintf " % s : % s " ( get_type_file file ) ( add_build_dirs deps ) else " " | _ -> failwith " add_deps_of_type_mli " |
let rec on_each_line f ch = let rec aux lines = let line = input_line ch in let max_ix = String . length line - 1 in if String . length line > 0 && line . [ max_ix ] = ' ' \\ then let line ' = String . sub line 0 max_ix in aux ( line ' :: lines ) else String . concat " " ( ... |
let eliom_synonyms = [ " - ml - synonym " ; " . eliom " ; " - mli - synonym " ; " . eliomi " ] |
let compile_intf file = create_filter ! compiler ( preprocess_opt ~ ocaml : true ! ppopt @ eliom_synonyms @ ! args @ map_include ! eliom_inc_dirs @ [ " - intf " ; file ] ) ( on_each_line add_build_dirs ) |
let compile_impl file = create_filter ! compiler ( preprocess_opt ~ ocaml : true ! ppopt @ eliom_synonyms @ ! args @ map_include ! eliom_inc_dirs @ [ " - impl " ; file ] ) ( on_each_line add_build_dirs ) |
let server_pp_opt impl_intf = let l = [ " - notype " ] @ ! ppopt in match ! pp_mode with ` Ppx -> l | _ -> l @ [ impl_intf_opt impl_intf ] |
let client_pp_opt impl_intf = let l = [ " - notype " ] @ ! ppopt in match ! pp_mode with ` Ppx -> l | _ -> l @ [ impl_intf_opt impl_intf ] |
let type_pp_opt impl_intf = match ! pp_mode with ` Ppx -> ! ppopt | _ -> ! ppopt @ [ impl_intf_opt impl_intf ] |
let compile_server_eliom ~ impl_intf file = if ! do_dump then ( let camlp4 , ppopt = get_pp_dump [ ] ( ( " - printer " :: " o " :: server_pp_opt impl_intf ) @ [ file ] ) in ignore ( create_process camlp4 ppopt ) ; exit 0 ) ; create_filter ! compiler ( eliom_synonyms @ ... |
let compile_type_eliom ~ impl_intf file = if ! do_dump then ( let camlp4 , ppopt = get_pp_dump [ ] ( ( " - printer " :: " o " :: type_pp_opt impl_intf ) @ [ file ] ) in ignore ( create_process camlp4 ppopt ) ; exit 0 ) ; create_filter ! compiler ( eliom_synonyms @ ! a... |
let compile_client_eliom ~ impl_intf file = if ! do_dump then ( let camlp4 , ppopt = get_pp_dump [ ] ( ( " - printer " :: " o " :: client_pp_opt impl_intf ) @ [ file ] ) in ignore ( create_process camlp4 ppopt ) ; exit 0 ) ; create_filter ! compiler ( eliom_synonyms @ ... |
let compile_eliom ~ impl_intf file = let basename = chop_extension_if_any file in ( match ! kind with | ` Server -> compile_server_eliom ~ impl_intf file ; if impl_intf = ` Impl then compile_type_eliom ~ impl_intf file | ` Client -> compile_client_eliom ~ impl_intf file | _ -> assert false ) ... |
let sort ( ) = let ppopt = match ! kind with | ` Server | ` ServerOpt -> server_pp_opt ` Impl | ` Client -> client_pp_opt ` Impl in wait ( create_process ! compiler ( ( " - sort " :: eliom_synonyms ) @ get_common_ppx ~ kind :! kind ( ) @ preprocess_opt ~ kind :! kind ppopt... |
let process_option ( ) = let i = ref 2 and ppx = ref false in while ! i < Array . length Sys . argv do match Sys . argv . ( ! i ) with | " - verbose " -> verbose := true ; incr i | " - no - autoload " -> autoload_predef := false ; incr i | " - sort " -> mode := ` So... |
let process_kind ( ) = if Array . length Sys . argv < 2 then usage ( ) ; match Sys . argv . ( 1 ) with | " - server " -> build_dir := default_server_dir ; ` Server | " - client " -> build_dir := default_client_dir ; ` Client | _ -> usage ( ) |
let main ( ) = compiler := ocamldep ; kind := process_kind ( ) ; process_option ( ) |
let _ = main ( ) |
let usage ( ) = Printf . eprintf " Usage : % s - server < options > < files >\ n " ( Filename . basename Sys . argv . ( 0 ) ) ; Printf . eprintf " Usage : % s - client < options > < files >\ n " ( Filename . basename Sys . argv . ( 0 ) ) ; Printf . epri... |
let inode_of_dir d = ( Unix . stat d ) . Unix . st_ino |
let acc_file = ref None |
let get_default_args ( ) = let new_ = Filename . temp_file " eliomdoc " " dump " in let args = match ! acc_file with | None -> [ " - dump " ; new_ ] | Some old -> [ " - load " ; old ; " - dump " ; new_ ] in acc_file := Some new_ ; args |
let eliom_inc_dirs = ref [ ] |
let eliom_inc_inodes = ref [ ] |
let in_an_eliom_inc_dir s = List . exists ( fun d_inode -> inode_of_dir ( Filename . dirname s ) = d_inode ) ! eliom_inc_inodes |
let compile_intf file = wait ( create_process ! compiler ( preprocess_opt ! ppopt @ ! args @ get_default_args ( ) @ get_common_include ( ) @ map_include ! eliom_inc_dirs @ [ " - intf " ; file ] ) ) |
let compile_impl file = wait ( create_process ! compiler ( preprocess_opt ! ppopt @ ! args @ get_default_args ( ) @ get_common_include ( ) @ map_include ! eliom_inc_dirs @ [ " - impl " ; file ] ) ) |
let server_pp_opt impl_intf = match ! pp_mode with | ` Camlp4 -> ( " - printer " :: " o " :: ! ppopt ) @ [ impl_intf_opt impl_intf ] | ` Ppx -> ! ppopt |
let client_pp_opt impl_intf = match ! pp_mode with | ` Camlp4 -> ( " - printer " :: " o " :: ! ppopt ) @ [ impl_intf_opt impl_intf ] | ` Ppx -> ! ppopt |
let generate_temp_file file = let tmp_dir = Filename . get_temp_dir_name ( ) in let temp_file = tmp_dir ^ Filename . dir_sep ^ Filename . basename file in ( temp_file , Unix . openfile temp_file [ Unix . O_TRUNC ; Unix . O_CREAT ; Unix . O_WRONLY ] 0o640 ) |
let compile_server_eliom ~ impl_intf file = let file ' , out = generate_temp_file file in wait ( create_process ~ out " eliompp " [ " - server " ; file ] ) ; wait ( create_process ! compiler ( preprocess_opt ~ kind ` : Server ( server_pp_opt impl_intf ) @ ! args @ get_defaul... |
let compile_client_eliom ~ impl_intf file = let file ' , out = generate_temp_file file in wait ( create_process ~ out " eliompp " [ " - client " ; file ] ) ; wait ( create_process ! compiler ( preprocess_opt ~ kind ` : Client ( client_pp_opt impl_intf ) @ ! args @ get_defaul... |
let compile_eliom ~ impl_intf file = match ! kind with | ` Server -> compile_server_eliom ~ impl_intf file | ` Client -> compile_client_eliom ~ impl_intf file | _ -> assert false |
let generate_doc ( ) = match ! acc_file with | None -> ( ) | Some file -> wait ( create_process ! compiler ( " - load " :: file :: ! args ) ) |
let process_option ( ) = let i = ref 2 and ppx = ref false in while ! i < Array . length Sys . argv do match Sys . argv . ( ! i ) with | " - verbose " -> verbose := true ; incr i | " - no - autoload " -> autoload_predef := false ; incr i | " - eliom - inc " -> if ! i... |
let process_kind ( ) = if Array . length Sys . argv < 2 then usage ( ) ; match Sys . argv . ( 1 ) with | " - server " -> ` Server | " - client " -> ` Client | _ -> usage ( ) |
let main ( ) = compiler := ocamldoc ; kind := process_kind ( ) ; process_option ( ) |
let _ = main ( ) |
let default_max_persistent_data_sessions_per_group = ref 50 |
let default_max_service_sessions_per_group = ref 50 |
let default_max_service_sessions_per_subnet = ref 1000000 |
let default_max_volatile_data_sessions_per_group = ref 50 |
let default_max_volatile_data_sessions_per_subnet = ref 1000000 |
let default_max_persistent_data_tab_sessions_per_group = ref 50 |
let default_max_service_tab_sessions_per_group = ref 50 |
let default_max_volatile_data_tab_sessions_per_group = ref 50 |
let default_secure_cookies = ref false |
let default_application_script = ref ( false , false ) |
let default_cache_global_data = ref None |
let default_html_content_type = ref None |
let default_ignored_get_params = ref [ ] |
let default_ignored_post_params = ref [ ] |
let default_omitpersistentstorage = ref None |
let default_max_anonymous_services_per_subnet = ref 500000 |
let default_max_anonymous_services_per_session = ref 1000 |
let default_max_volatile_groups_per_site = ref 1000000 |
module S = Hashtbl . Make ( struct type t = Ocsigen_extensions . virtual_hosts * Eliom_lib . Url . path let equal ( ( vh1 , u1 ) : t ) ( ( vh2 , u2 ) : t ) = Ocsigen_extensions . equal_virtual_hosts vh1 vh2 && u1 = u2 let hash ( ( vh , u ) : t ) = Hashtbl . hash ( ... |
let create_sitedata site_dir config_info = let dlist_table = Eliom_common . create_dlist_ip_table 100 and group_of_groups = Ocsigen_cache . Dlist . create ! default_max_volatile_groups_per_site in let sitedata = { Eliom_common . servtimeout = None , None , [ ] ; datatimeout = None , None ,... |
let create_sitedata = let t = S . create 5 in fun host site_dir config_info -> let key = host , site_dir in try S . find t key with Not_found -> let sitedata = create_sitedata site_dir config_info in S . add t key sitedata ; sitedata |
let parse_eliom_option ( set_volatile_timeout , set_data_timeout , set_service_timeout , set_persistent_timeout , set_max_service_sessions_per_group , set_max_service_sessions_per_subnet , set_max_data_sessions_per_group , set_max_data_sessions_per_subnet , set_max_persistent_sessions_per_group , se... |
let parse_eliom_options f l = let rec aux rest = function | [ ] -> rest | e :: l -> ( try parse_eliom_option f e ; aux rest l with Error_in_config_file _ -> aux ( e :: rest ) l ) in List . rev ( aux [ ] l ) |
let rec parse_global_config = function | [ ] -> ( ) | Xml . Element ( " sessiongcfrequency " , [ ( " value " , s ) ] , _ ) :: ll -> ( try let t = float_of_string s in Eliommod_gc . set_servicesessiongcfrequency ( Some t ) ; Eliommod_gc . set_datasessiongcfrequency... |
let exception_during_eliommodule_loading = ref false |
let end_init ( ) = if ! exception_during_eliommodule_loading then ( ) else try Eliom_common . verify_all_registered ( Eliom_common . get_current_sitedata ( ) ) ; Eliom_common . end_current_sitedata ( ) with Eliom_common . Eliom_site_information_not_available _ -> ( ) |
let handle_init_exn = function | Eliom_common . Eliom_error_while_loading_site s -> s | Eliom_common . Eliom_duplicate_registration s -> " Eliom : Duplicate registration of service " " \ ^ s ^ " " . \ Please correct the module . " | Eliom_common . Eliom_there_are_unregistered_services (... |
let site_init_ref = ref [ ] |
let register_site_init e = site_init_ref := e :: ! site_init_ref |
let config = ref [ ] |
let config_in_tag = ref " " |
type module_to_load = Files of string list | Name of string |
let site_init firstmodule = if ! firstmodule then ( Eliom_common . begin_load_eliom_module ( ) ; Eliom_syntax . set_global true ; List . iter ( fun f -> f ( ) ) ! site_init_ref ; Eliom_syntax . set_global false ; firstmodule := false ; Eliom_common . end_load_eliom_module ( ) ... |
let load_eliom_module _sitedata cmo_or_name parent_tag content = let preload ( ) = config := content ; config_in_tag := parent_tag ; Eliom_common . begin_load_eliom_module ( ) in let postload ( ) = Eliom_common . end_load_eliom_module ( ) ; config := [ ] in try match cmo_or_name wit... |
let gen_nothing ( ) _ = Lwt . return Ocsigen_extensions . Ext_do_nothing |
let default_module_action _ = failwith " default_module_action " |
let parse_config _ hostpattern conf_info site_dir = let sitedata = create_sitedata hostpattern site_dir conf_info in Eliom_common . absolute_change_sitedata sitedata ; let firsteliomtag = ref true in let firstmodule = ref true in let eliommodulewarningdisplayed = ref false in let rec parse_default_links_xhr a... |
let ( ) = Ocsigen_extensions . register ~ name " : eliom " ~ fun_site : parse_config ~ end_init ~ exn_handler : handle_init_exn ~ init_fun : parse_global_config ( ) |
let make_new_session_id ( ) = Ocsigen_lib . make_cryptographic_safe_string ( ) ^ " H " |
type cookie = { full_state_name : Eliom_common . full_state_name ; expiry : date option ; timeout : Eliom_common . timeout ; session_group : Eliom_common . perssessgrp option } |
module Persistent_cookies = struct module Ocsipersist = Eliom_common . Ocsipersist . Functorial let persistent_cookie_table_version = " _v5 " module Cookies = Ocsipersist . Table ( struct let name = " eliom_persist_cookies " ^ persistent_cookie_table_version end ) ( Ocsipersist . Column . ... |
let get_cookie_info now sitedata service_cookies data_cookies persistent_cookies secure_cookies : ' a Eliom_common . cookie_info * ' b list = let f_serv service_cookies = Eliom_common . Full_state_name_table . fold ( fun name value ( oktable , failedlist ) -> try let hvalue = Eliom_common . Ha... |
let new_service_cookie_table ( ) : Eliom_common . tables Eliom_common . Service_cookie . table = Eliom_common . SessionCookies . create 100 |
let new_data_cookie_table ( ) : Eliom_common . Data_cookie . table = Eliom_common . SessionCookies . create 100 |
let compute_session_cookies_to_send sitedata ( ( service_cookie_info , data_cookie_info , pers_cookies_info ) , secure_ci ) ( endlist : Ocsigen_cookie_map . t ) = let getservvexp ( old , newi ) = return ( let newinfo = match ! newi with | Eliom_common . SCNo_data | Eliom_common . ... |
let compute_new_ri_cookies ' now ripath ricookies cookies_set_by_page = Ocsigen_cookie_map . Map_path . fold ( fun cpath t cookies -> if Url . is_prefix_skip_end_slash ( Url . remove_slash_at_beginning cpath ) ( Url . remove_slash_at_beginning ripath ) then Ocsigen_cookie_map . Map_inner . f... |
let compute_new_ri_cookies ( now : float ) ( ripath : string list ) ( ricookies : string Ocsigen_cookie_map . Map_inner . t ) ( ( ci , secure_ci ) : Eliom_common . tables Eliom_common . cookie_info ) ( cookies_set_by_page : Ocsigen_cookie_map . t ) : string Ocsigen_cookie_map .... |
let compute_cookie_info sitedata secure_o secure_ci cookie_info = let secure = Eliom_common . get_secure ~ secure_o ~ sitedata ( ) in if secure then let _ , c , _ = secure_ci in c , true else cookie_info , false |
let close_data_state ~ scope ~ secure_o ? sp ( ) = let sp = Eliom_common . sp_of_option sp in try let cookie_level = Eliom_common . cookie_level_of_user_scope scope in let ( _ , cookie_info , _ ) , secure_ci = Eliom_common . get_cookie_info sp cookie_level in let sitedata = Eliom_request_i... |
let fullsessgrp ~ cookie_level ~ sp set_session_group = Eliommod_sessiongroups . make_full_group_name ~ cookie_level sp . Eliom_common . sp_request . Ocsigen_extensions . request_info sp . Eliom_common . sp_sitedata . Eliom_common . site_dir_string ( Eliom_common . get_mask4 sp . Eliom_commo... |
let rec find_or_create_data_cookie ? set_session_group ( ~ cookie_scope : Eliom_common . cookie_scope ) ~ secure_o ? sp ( ) = let cookie_level = Eliom_common . cookie_level_of_user_scope cookie_scope in let sp = Eliom_common . sp_of_option sp in let new_data_cookie sitedata full_st_name table = l... |
let find_or_create_data_cookie = ( find_or_create_data_cookie : ? set_session_group : string -> cookie_scope : Eliom_common . cookie_scope -> secure_o : bool option -> ? sp : Eliom_common . server_params -> unit -> Eliom_common . one_data_cookie_info :> ? set_session_group : string -> cookie_sc... |
let find_data_cookie_only ~ cookie_scope ~ secure_o ? sp ( ) = let sp = Eliom_common . sp_of_option sp in let cookie_level = Eliom_common . cookie_level_of_user_scope cookie_scope in let ( _ , cookie_info , _ ) , secure_ci = Eliom_common . get_cookie_info sp cookie_level in let sitedata = ... |
let counttableelements = ref [ ] |
let create_volatile_table , create_volatile_table_during_session = let aux ~ scope ~ secure sitedata = let t = Eliom_common . SessionCookies . create 100 in let old_remove_session_data = sitedata . Eliom_common . remove_session_data in sitedata . Eliom_common . remove_session_data <- ( fun cooki... |
let section = Lwt_log . Section . make " eliom : dom " |
let iter_nodeList nodeList f = for i = 0 to nodeList . ## length - 1 do f ( Js . Unsafe . get nodeList i ) done |
let iter_attrList ( attrList : Dom . attr Dom . namedNodeMap Js . t ) ( f : Dom . attr Js . t -> unit ) = for i = 0 to attrList . ## length - 1 do let v = Js . Unsafe . get attrList i in Js . Opt . iter v f done object method compareDocumentPosition : unit Js . optdef Js . pro... |
let test_querySelectorAll ( ) = Js . Optdef . test ( Js . Unsafe . coerce Dom_html . document : dom_tester Js . t ) . ## querySelectorAll |
let test_compareDocumentPosition ( ) = Js . Optdef . test ( Js . Unsafe . coerce Dom_html . document : dom_tester Js . t ) . ## compareDocumentPosition |
let test_classList ( ) = Js . Optdef . test ( Js . Unsafe . coerce Dom_html . document . ## documentElement : dom_tester Js . t ) . ## classList |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.