diff options
Diffstat (limited to 'otherlibs')
-rw-r--r-- | otherlibs/labltk/browser/editor.ml | 30 | ||||
-rw-r--r-- | otherlibs/labltk/browser/jg_menu.ml | 24 | ||||
-rw-r--r-- | otherlibs/labltk/browser/main.ml | 7 | ||||
-rw-r--r-- | otherlibs/labltk/browser/searchpos.ml | 2 | ||||
-rw-r--r-- | otherlibs/labltk/browser/shell.ml | 6 | ||||
-rw-r--r-- | otherlibs/labltk/browser/viewer.ml | 25 | ||||
-rw-r--r-- | otherlibs/labltk/examples_camltk/fileopen.ml | 4 | ||||
-rw-r--r-- | otherlibs/labltk/tkanim/tkanim.ml | 18 | ||||
-rw-r--r-- | otherlibs/str/str.ml | 4 | ||||
-rw-r--r-- | otherlibs/systhreads/win32.c | 21 | ||||
-rw-r--r-- | otherlibs/threads/Tests/testio.ml | 9 | ||||
-rw-r--r-- | otherlibs/unix/unix.mli | 76 |
12 files changed, 109 insertions, 117 deletions
diff --git a/otherlibs/labltk/browser/editor.ml b/otherlibs/labltk/browser/editor.ml index 1e6e3c0ee2..617cdfa855 100644 --- a/otherlibs/labltk/browser/editor.ml +++ b/otherlibs/labltk/browser/editor.ml @@ -287,8 +287,8 @@ class editor ~top ~menus = object (self) val compiler_menu = new Jg_menu.c "Compiler" ~parent:menus val module_menu = new Jg_menu.c "Modules" ~parent:menus val window_menu = new Jg_menu.c "Windows" ~parent:menus - val label = - Checkbutton.create menus ~state:`Disabled + initializer + Menu.add_checkbutton menus ~state:`Disabled ~onvalue:"modified" ~offvalue:"unchanged" val mutable current_dir = Unix.getcwd () val mutable error_messages = [] @@ -314,14 +314,18 @@ class editor ~top ~menus = object (self) ~command:(fun () -> self#set_edit txt) end + method set_file_name txt = + Menu.configure_checkbutton menus `Last + ~label:(Filename.basename txt.name) + ~variable:txt.modified + method set_edit txt = if windows <> [] then Pack.forget [(List.hd windows).frame]; windows <- txt :: exclude txt windows; self#reset_window_menu; current_tw <- txt.tw; - Checkbutton.configure label ~text:(Filename.basename txt.name) - ~variable:txt.modified; + self#set_file_name txt; Textvariable.set vwindow txt.number; Text.yview txt.tw ~scroll:(`Page 0); pack [txt.frame] ~fill:`Both ~expand:true ~side:`Bottom @@ -381,7 +385,7 @@ class editor ~top ~menus = object (self) pack [sb] ~fill:`Y ~side:`Right; pack [tw] ~fill:`Both ~expand:true ~side:`Left; self#set_edit txt; - Checkbutton.deselect label; + Textvariable.set txt.modified "unchanged"; Lexical.init_tags txt.tw method clear_errors () = @@ -429,9 +433,8 @@ class editor ~top ~menus = object (self) let text = Text.get txt.tw ~start:tstart ~stop:(tposend 1) in output_string file text; close_out file; - Checkbutton.configure label ~text:(Filename.basename name); - Checkbutton.deselect label; - txt.name <- name + txt.name <- name; + self#set_file_name txt with Sys_error _ -> Jg_message.info ~master:top ~title:"Error" @@ -453,7 +456,7 @@ class editor ~top ~menus = object (self) | `No -> () | `Cancel -> raise Exit end; - Checkbutton.deselect label; + Textvariable.set txt.modified "unchanged"; (Text.index current_tw ~index:(`Mark"insert", []), []) with Not_found -> self#new_window name; tstart in @@ -629,13 +632,6 @@ class editor ~top ~menus = object (self) ~command:Viewer.search_symbol; module_menu#add_command "Close all" ~command:Viewer.close_all_views; - - (* pack everything *) - pack (List.map ~f:(fun m -> coe m#button) - [file_menu; edit_menu; compiler_menu; module_menu; window_menu] - @ [coe label]) - ~side:`Left ~ipadx:5 ~anchor:`W; - pack [menus] ~before:(List.hd windows).frame ~side:`Top ~fill:`X end (* The main function starts here ! *) @@ -658,7 +654,7 @@ let editor ?file ?(pos=0) ?(reuse=false) () = false then () else let top = Jg_toplevel.titled "OCamlBrowser Editor" in - let menus = Frame.create top ~name:"menubar" in + let menus = Jg_menu.menubar top in let ed = new editor ~top ~menus in already_open := !already_open @ [ed]; if file <> None then ed#reopen ~file ~pos diff --git a/otherlibs/labltk/browser/jg_menu.ml b/otherlibs/labltk/browser/jg_menu.ml index 62712f36db..b399d10d87 100644 --- a/otherlibs/labltk/browser/jg_menu.ml +++ b/otherlibs/labltk/browser/jg_menu.ml @@ -16,15 +16,12 @@ open Tk -class c ~parent ?underline:(n=0) text = object (self) - val pair = - let button = - Menubutton.create parent ~text ~underline:n in - let menu = Menu.create button in - Menubutton.configure button ~menu; - button, menu - method button = fst pair - method menu = snd pair +class c ~parent ?(underline=0) label = object (self) + val menu = + let menu = Menu.create parent in + Menu.add_cascade parent ~menu ~label ~underline; + menu + method menu = menu method virtual add_command : ?underline:int -> ?accelerator:string -> ?activebackground:color -> @@ -33,10 +30,15 @@ class c ~parent ?underline:(n=0) text = object (self) ?font:string -> ?foreground:color -> ?image:image -> ?state:state -> string -> unit - method add_command ?underline:(n=0) ?accelerator ?activebackground + method add_command ?(underline=0) ?accelerator ?activebackground ?activeforeground ?background ?bitmap ?command ?font ?foreground ?image ?state label = - Menu.add_command (self#menu) ~label ~underline:n ?accelerator + Menu.add_command menu ~label ~underline ?accelerator ?activebackground ?activeforeground ?background ?bitmap ?command ?font ?foreground ?image ?state end + +let menubar tl = + let menu = Menu.create tl ~name:"menubar" ~typ:`Menubar in + Toplevel.configure tl ~menu; + menu diff --git a/otherlibs/labltk/browser/main.ml b/otherlibs/labltk/browser/main.ml index 2bc122fe92..8866f8d0e6 100644 --- a/otherlibs/labltk/browser/main.ml +++ b/otherlibs/labltk/browser/main.ml @@ -67,7 +67,7 @@ let _ = let path = ref [] in let st = ref true in - let spec = + (*let spec = [ "-I", Arg.String (fun s -> path := s :: !path), "<dir> Add <dir> to the list of include directories"; "-labels", Arg.Clear Clflags.classic, " <obsolete>"; @@ -100,7 +100,7 @@ let _ = if not (check ~spec Sys.argv) then fatal_error (usage ~spec errmsg); Arg.parse spec (fun name -> raise(Arg.Bad("don't know what to do with " ^ name))) - errmsg; + errmsg;*) Config.load_path := Sys.getcwd () :: List.rev_map ~f:(Misc.expand_directory Config.standard_library) !path @@ -135,5 +135,6 @@ let _ = try if is_win32 then mainLoop () else Printexc.print mainLoop () - with Protocol.TkError _ -> () + with Protocol.TkError _ -> + if not is_win32 then flush stderr done diff --git a/otherlibs/labltk/browser/searchpos.ml b/otherlibs/labltk/browser/searchpos.ml index 1464a44437..1f07888a01 100644 --- a/otherlibs/labltk/browser/searchpos.ml +++ b/otherlibs/labltk/browser/searchpos.ml @@ -816,7 +816,7 @@ and search_pos_expr ~pos exp = search_pos_expr exp ~pos | Texp_object (cls, _, _) -> search_pos_class_structure ~pos cls - | Texp_generic _ | Texp_typedecl _ | Texp_rtype _ -> (* FIXME *) assert false + | Texp_generic _ | Texp_typedecl _ | Texp_rtype _ | Texp_regexp _ -> (* FIXME *) assert false end; add_found_str (`Exp(`Expr, exp.exp_type)) ~env:exp.exp_env ~loc:exp.exp_loc end diff --git a/otherlibs/labltk/browser/shell.ml b/otherlibs/labltk/browser/shell.ml index 18e1f34945..ec0a61868c 100644 --- a/otherlibs/labltk/browser/shell.ml +++ b/otherlibs/labltk/browser/shell.ml @@ -279,13 +279,11 @@ let f ~prog ~title = if res = "" then may_exec (Filename.concat dir prog) else res) in if progpath = "" then program_not_found prog else let tl = Jg_toplevel.titled title in - let menus = Frame.create tl ~name:"menubar" in + let menus = Menu.create tl ~name:"menubar" ~typ:`Menubar in + Toplevel.configure tl ~menu:menus; let file_menu = new Jg_menu.c "File" ~parent:menus and history_menu = new Jg_menu.c "History" ~parent:menus and signal_menu = new Jg_menu.c "Signal" ~parent:menus in - pack [menus] ~side:`Top ~fill:`X; - pack [file_menu#button; history_menu#button; signal_menu#button] - ~side:`Left ~ipadx:5 ~anchor:`W; let frame, tw, sb = Jg_text.create_with_scrollbar tl in Text.configure tw ~background:`White; pack [sb] ~fill:`Y ~side:`Right; diff --git a/otherlibs/labltk/browser/viewer.ml b/otherlibs/labltk/browser/viewer.ml index 17c3ba584a..41353d8c19 100644 --- a/otherlibs/labltk/browser/viewer.ml +++ b/otherlibs/labltk/browser/viewer.ml @@ -316,19 +316,19 @@ let show_help () = (* Launch the classical viewer *) let f ?(dir=Unix.getcwd()) ?on () = - let tl = match on with + let (top, tl) = match on with None -> let tl = Jg_toplevel.titled "Module viewer" in - ignore (Jg_bind.escape_destroy tl); coe tl + ignore (Jg_bind.escape_destroy tl); (tl, coe tl) | Some top -> Wm.title_set top "OCamlBrowser"; Wm.iconname_set top "OCamlBrowser"; let tl = Frame.create top in bind tl ~events:[`Destroy] ~action:(fun _ -> exit 0); pack [tl] ~expand:true ~fill:`Both; - coe tl + (top, coe tl) in - let menus = Frame.create tl ~name:"menubar" in + let menus = Jg_menu.menubar top in let filemenu = new Jg_menu.c "File" ~parent:menus and modmenu = new Jg_menu.c "Modules" ~parent:menus in let fmbox, mbox, msb = Jg_box.create_with_scrollbar tl in @@ -366,8 +366,6 @@ let f ?(dir=Unix.getcwd()) ?on () = ~command:(fun () -> reset_modules mbox; Env.reset_cache ()); modmenu#add_command "Search symbol..." ~command:search_symbol; - pack [filemenu#button; modmenu#button] ~side:`Left ~ipadx:5 ~anchor:`W; - pack [menus] ~side:`Top ~fill:`X; pack [close; search] ~fill:`X ~side:`Right ~expand:true; pack [coe buttons; coe ew] ~fill:`X ~side:`Bottom; pack [msb] ~side:`Right ~fill:`Y; @@ -378,19 +376,20 @@ let f ?(dir=Unix.getcwd()) ?on () = (* Smalltalk-like version *) class st_viewer ?(dir=Unix.getcwd()) ?on () = - let tl = match on with + let (top, tl) = match on with None -> let tl = Jg_toplevel.titled "Module viewer" in - ignore (Jg_bind.escape_destroy tl); coe tl + ignore (Jg_bind.escape_destroy tl); (tl, coe tl) | Some top -> Wm.title_set top "OCamlBrowser"; Wm.iconname_set top "OCamlBrowser"; let tl = Frame.create top in bind tl ~events:[`Destroy] ~action:(fun _ -> exit 0); - pack [tl] ~expand:true ~fill:`Both; - coe tl + pack [tl] ~side:`Bottom ~expand:true ~fill:`Both; + (top, coe tl) in - let menus = Frame.create tl ~name:"menubar" in + let menus = Menu.create top ~name:"menubar" ~typ:`Menubar in + let () = Toplevel.configure top ~menu:menus in let filemenu = new Jg_menu.c "File" ~parent:menus and modmenu = new Jg_menu.c "Modules" ~parent:menus and viewmenu = new Jg_menu.c "View" ~parent:menus @@ -490,10 +489,6 @@ object (self) (* Help menu *) helpmenu#add_command "Manual..." ~command:show_help; - pack [filemenu#button; viewmenu#button; modmenu#button] - ~side:`Left ~ipadx:5 ~anchor:`W; - pack [helpmenu#button] ~side:`Right ~anchor:`E ~ipadx:5; - pack [menus] ~fill:`X; pack [search_frame] ~fill:`X; pack [boxes_frame] ~fill:`Both ~expand:true; pack [buttons] ~fill:`X ~side:`Bottom; diff --git a/otherlibs/labltk/examples_camltk/fileopen.ml b/otherlibs/labltk/examples_camltk/fileopen.ml index b7bd163f37..927c24851e 100644 --- a/otherlibs/labltk/examples_camltk/fileopen.ml +++ b/otherlibs/labltk/examples_camltk/fileopen.ml @@ -25,7 +25,7 @@ let b = Button.create cvs [Text "Save"; Command - (function _ -> + (function _ -> let s = getSaveFile [Title "SAVE FILE TEST"; @@ -33,7 +33,7 @@ let b = FileTypes [ { typename= "just test"; extensions= [".foo"; ".test"]; mactypes= ["FOOO"; "BARR"] } ]; - InitialDir "/tmp"; + InitialDir Filename.temp_dir_name; InitialFile "hogehoge" ] in Label.configure t [Text s])];; diff --git a/otherlibs/labltk/tkanim/tkanim.ml b/otherlibs/labltk/tkanim/tkanim.ml index cc859e1cfd..d4d693f670 100644 --- a/otherlibs/labltk/tkanim/tkanim.ml +++ b/otherlibs/labltk/tkanim/tkanim.ml @@ -65,7 +65,7 @@ let cTKtoCAMLanimatedGif s = (* check Tkanim package is in the interpreter *) let available () = - let packages = + let packages = splitlist (Protocol.tkEval [| TkToken "package"; TkToken "names" |]) in @@ -96,22 +96,22 @@ let image_existence_check img = (* But just do some operation. And sometimes it causes Seg-fault. *) (* So, before using Imagephoto.copy, I should check the source image *) (* really exists. *) - try ignore (Imagephoto.height img) with + try ignore (Imagephoto.height img) with TkError s -> prerr_endline ("tkanim: " ^ s); raise (TkError s) let imagephoto_copy dst src opts = image_existence_check src; Imagephoto.copy dst src opts -let animate_gen w i anim = +let animate_gen w i anim = let length = List.length anim.frames in let frames = Array.of_list anim.frames in let current = ref 0 in let loop = ref anim.loop in let f = frames.(!current) in - imagephoto_copy i f.imagephoto - [ImgTo (f.left, f.top, f.left + f.frameWidth, - f.top + f.frameHeight)]; + imagephoto_copy i f.imagephoto + [ImgTo (f.left, f.top, f.left + f.frameWidth, + f.top + f.frameHeight)]; let visible = ref true in let animated = ref false in let timer = ref None in @@ -208,9 +208,9 @@ let animate_canvas_item canvas tag anim = animate_gen canvas i anim let gifdata s = - let tmp_dir = ref "/tmp" in + let tmp_dir = ref Filename.temp_dir_name in let mktemp = - let cnter = ref 0 + let cnter = ref 0 and pid = Unix.getpid() in (function prefx -> incr cnter; @@ -227,4 +227,4 @@ let gifdata s = anim with e -> begin Unix.unlink fname; raise e end - + diff --git a/otherlibs/str/str.ml b/otherlibs/str/str.ml index f443c503ff..31b6232841 100644 --- a/otherlibs/str/str.ml +++ b/otherlibs/str/str.ml @@ -227,7 +227,9 @@ let compile fold_case re = (* Add a new instruction *) let emit_instr opc arg = if !progpos >= Array.length !prog then begin - let nprog = Array.make (2 * Array.length !prog) 0 in + let newlen = ref (Array.length !prog) in + while !progpos >= !newlen do newlen := !newlen * 2 done; + let nprog = Array.make !newlen 0 in Array.blit !prog 0 nprog 0 (Array.length !prog); prog := nprog end; diff --git a/otherlibs/systhreads/win32.c b/otherlibs/systhreads/win32.c index 67901875d0..7ef5f49cea 100644 --- a/otherlibs/systhreads/win32.c +++ b/otherlibs/systhreads/win32.c @@ -252,7 +252,7 @@ static void caml_io_mutex_unlock_exn(void) /* The "tick" thread fakes a signal at regular intervals. */ -static void caml_thread_tick(void * arg) +static DWORD WINAPI caml_thread_tick(void * arg) { while(1) { Sleep(Thread_timeout); @@ -277,7 +277,7 @@ CAMLprim value caml_thread_initialize(value unit) value vthread = Val_unit; value descr; HANDLE tick_thread; - uintnat tick_id; + DWORD th_id; /* Protect against repeated initialization (PR#1325) */ if (curr_thread != NULL) return Val_unit; @@ -324,8 +324,8 @@ CAMLprim value caml_thread_initialize(value unit) caml_channel_mutex_unlock = caml_io_mutex_unlock; caml_channel_mutex_unlock_exn = caml_io_mutex_unlock_exn; /* Fork the tick thread */ - tick_thread = (HANDLE) _beginthread(caml_thread_tick, 0, NULL); - if (tick_thread == (HANDLE)(-1)) caml_wthread_error("Thread.init"); + tick_thread = CreateThread(NULL, 0, caml_thread_tick, NULL, 0, &th_id); + if (tick_thread == NULL) caml_wthread_error("Thread.init"); CloseHandle(tick_thread); End_roots(); return Val_unit; @@ -333,7 +333,7 @@ CAMLprim value caml_thread_initialize(value unit) /* Create a thread */ -static void caml_thread_start(void * arg) +static DWORD WINAPI caml_thread_start(void * arg) { caml_thread_t th = (caml_thread_t) arg; value clos; @@ -360,6 +360,7 @@ static void caml_thread_start(void * arg) /* Free the thread descriptor */ stat_free(th); /* The thread now stops running */ + return 0; } CAMLprim value caml_thread_new(value clos) @@ -367,7 +368,7 @@ CAMLprim value caml_thread_new(value clos) caml_thread_t th; value vthread = Val_unit; value descr; - uintnat th_id; + DWORD th_id; Begin_roots2 (clos, vthread) /* Create a finalized value to hold thread handle */ @@ -406,14 +407,9 @@ CAMLprim value caml_thread_new(value clos) curr_thread->next->prev = th; curr_thread->next = th; /* Fork the new thread */ -#if 0 th->wthread = - CreateThread(NULL,0, (LPTHREAD_START_ROUTINE) caml_thread_start, - (void *) th, 0, &th_id); + CreateThread(NULL, 0, caml_thread_start, (void *) th, 0, &th_id); if (th->wthread == NULL) { -#endif - th->wthread = (HANDLE) _beginthread(caml_thread_start, 0, (void *) th); - if (th->wthread == (HANDLE)(-1)) { /* Fork failed, remove thread info block from list of threads */ th->next->prev = curr_thread; curr_thread->next = th->next; @@ -473,6 +469,7 @@ CAMLprim value caml_thread_yield(value unit) CAMLprim value caml_thread_join(value th) { HANDLE h; + Begin_root(th) /* prevent deallocation of handle */ h = Threadhandle(th)->handle; enter_blocking_section(); diff --git a/otherlibs/threads/Tests/testio.ml b/otherlibs/threads/Tests/testio.ml index 3ed08a88f4..95064a64e8 100644 --- a/otherlibs/threads/Tests/testio.ml +++ b/otherlibs/threads/Tests/testio.ml @@ -87,7 +87,7 @@ let test_trunc_line ofile = let main() = let ifile = Sys.argv.(1) in - let ofile = "/tmp/testio" in + let ofile = Filename.temp_file "testio" "" in test "256-byte chunks, 256-byte chunks" (copy_file 256) (copy_file 256) ifile ofile; test "4096-byte chunks, 4096-byte chunks" @@ -108,11 +108,12 @@ let main() = (copy_random 8192) (copy_random 8192) ifile ofile; test "line per line, short lines" copy_line copy_line "/etc/hosts" ofile; - make_lines "/tmp/lines"; + let linesfile = Filename.temp_file "lines" "" in + make_lines linesfile; test "line per line, short and long lines" - copy_line copy_line "/tmp/lines" ofile; + copy_line copy_line linesfile ofile; test_trunc_line ofile; - Sys.remove "/tmp/lines"; + Sys.remove linesfiles; Sys.remove ofile; exit 0 diff --git a/otherlibs/unix/unix.mli b/otherlibs/unix/unix.mli index ead724eb93..eeb5411de3 100644 --- a/otherlibs/unix/unix.mli +++ b/otherlibs/unix/unix.mli @@ -90,7 +90,7 @@ type error = | EOVERFLOW (** File size or position not representable *) | EUNKNOWNERR of int (** Unknown error *) -(** The type of error codes. +(** The type of error codes. Errors defined in the POSIX standard and additional errors from UNIX98 and BSD. All other errors are mapped to EUNKNOWNERR. @@ -118,7 +118,7 @@ val handle_unix_error : ('a -> 'b) -> 'a -> 'b val environment : unit -> string array (** Return the process environment, as an array of strings with the format ``variable=value''. *) - + val getenv : string -> string (** Return the value associated to a variable in the process environment. Raise [Not_found] if the variable is unbound. @@ -135,8 +135,8 @@ val putenv : string -> string -> unit type process_status = - WEXITED of int - (** The process terminated normally by [exit]; + WEXITED of int + (** The process terminated normally by [exit]; the argument is the return code. *) | WSIGNALED of int (** The process was killed by a signal; @@ -155,9 +155,9 @@ type wait_flag = val execv : string -> string array -> 'a (** [execv prog args] execute the program in file [prog], with - the arguments [args], and the current process environment. - These [execv*] functions never return: on success, the current - program is replaced by the new one; + the arguments [args], and the current process environment. + These [execv*] functions never return: on success, the current + program is replaced by the new one; on failure, a {!Unix.Unix_error} exception is raised. *) val execve : string -> string array -> string array -> 'a @@ -240,7 +240,7 @@ type open_flag = type file_perm = int -(** The type of file access rights, e.g. [0o640] is read and write for user, +(** The type of file access rights, e.g. [0o640] is read and write for user, read for group, none for others *) val openfile : string -> open_flag list -> file_perm -> file_descr @@ -310,7 +310,7 @@ val ftruncate : file_descr -> int -> unit to the given size. *) -(** {6 File statistics} *) +(** {6 File status} *) type file_kind = @@ -334,7 +334,7 @@ type stats = st_size : int; (** Size in bytes *) st_atime : float; (** Last access time *) st_mtime : float; (** Last modification time *) - st_ctime : float; (** Last status change time *) + st_ctime : float; (** Last status change time *) } (** The informations returned by the {!Unix.stat} calls. *) @@ -369,7 +369,7 @@ module LargeFile : st_size : int64; (** Size in bytes *) st_atime : float; (** Last access time *) st_mtime : float; (** Last modification time *) - st_ctime : float; (** Last status change time *) + st_ctime : float; (** Last status change time *) } val stat : string -> stats val lstat : string -> stats @@ -569,23 +569,23 @@ val open_process_full : and standard error of the command. *) val close_process_in : in_channel -> process_status -(** Close channels opened by {!Unix.open_process_in}, +(** Close channels opened by {!Unix.open_process_in}, wait for the associated command to terminate, and return its termination status. *) val close_process_out : out_channel -> process_status -(** Close channels opened by {!Unix.open_process_out}, +(** Close channels opened by {!Unix.open_process_out}, wait for the associated command to terminate, and return its termination status. *) val close_process : in_channel * out_channel -> process_status -(** Close channels opened by {!Unix.open_process}, +(** Close channels opened by {!Unix.open_process}, wait for the associated command to terminate, and return its termination status. *) val close_process_full : in_channel * out_channel * in_channel -> process_status -(** Close channels opened by {!Unix.open_process_full}, +(** Close channels opened by {!Unix.open_process_full}, wait for the associated command to terminate, and return its termination status. *) @@ -659,14 +659,14 @@ val lockf : file_descr -> lock_command -> int -> unit (** {6 Signals} Note: installation of signal handlers is performed via - the functions {!Sys.signal} and {!Sys.set_signal}. + the functions {!Sys.signal} and {!Sys.set_signal}. *) val kill : int -> int -> unit (** [kill pid sig] sends signal number [sig] to the process with id [pid]. *) -type sigprocmask_command = +type sigprocmask_command = SIG_SETMASK | SIG_BLOCK | SIG_UNBLOCK @@ -700,7 +700,7 @@ type process_times = { tms_utime : float; (** User time for the process *) tms_stime : float; (** System time for the process *) tms_cutime : float; (** User time for the children processes *) - tms_cstime : float; (** System time for the children processes *) + tms_cstime : float; (** System time for the children processes *) } (** The execution times (CPU times) of a process. *) @@ -713,7 +713,7 @@ type tm = tm_year : int; (** Year - 1900 *) tm_wday : int; (** Day of week (Sunday is 0) *) tm_yday : int; (** Day of year 0..365 *) - tm_isdst : bool; (** Daylight time savings in effect *) + tm_isdst : bool; (** Daylight time savings in effect *) } (** The type representing wallclock time and calendar date. *) @@ -758,7 +758,7 @@ val utimes : string -> float -> float -> unit 00:00:00 GMT, Jan. 1, 1970. *) type interval_timer = - ITIMER_REAL + ITIMER_REAL (** decrements in real time, and sends the signal [SIGALRM] when expired.*) | ITIMER_VIRTUAL (** decrements in process virtual time, and sends [SIGVTALRM] when expired. *) @@ -770,7 +770,7 @@ type interval_timer = type interval_timer_status = { it_interval : float; (** Period *) - it_value : float; (** Current value of the timer *) + it_value : float; (** Current value of the timer *) } (** The type describing the status of an interval timer *) @@ -821,7 +821,7 @@ type passwd_entry = pw_gid : int; pw_gecos : string; pw_dir : string; - pw_shell : string + pw_shell : string } (** Structure of entries in the [passwd] database. *) @@ -829,7 +829,7 @@ type group_entry = { gr_name : string; gr_passwd : string; gr_gid : int; - gr_mem : string array + gr_mem : string array } (** Structure of entries in the [groups] database. *) @@ -958,11 +958,11 @@ val getsockname : file_descr -> sockaddr val getpeername : file_descr -> sockaddr (** Return the address of the host connected to the given socket. *) -type msg_flag = +type msg_flag = MSG_OOB | MSG_DONTROUTE | MSG_PEEK -(** The flags for {!Unix.recv}, {!Unix.recvfrom}, +(** The flags for {!Unix.recv}, {!Unix.recvfrom}, {!Unix.send} and {!Unix.sendto}. *) val recv : file_descr -> string -> int -> int -> msg_flag list -> int @@ -1014,7 +1014,7 @@ type socket_optint_option = (** The socket options that can be consulted with {!Unix.getsockopt_optint} and modified with {!Unix.setsockopt_optint}. These options have a value of type [int option], with [None] meaning ``disabled''. *) - + type socket_float_option = SO_RCVTIMEO (** Timeout for input operations *) | SO_SNDTIMEO (** Timeout for output operations *) @@ -1084,14 +1084,14 @@ type host_entry = { h_name : string; h_aliases : string array; h_addrtype : socket_domain; - h_addr_list : inet_addr array + h_addr_list : inet_addr array } (** Structure of entries in the [hosts] database. *) type protocol_entry = - { p_name : string; - p_aliases : string array; - p_proto : int + { p_name : string; + p_aliases : string array; + p_proto : int } (** Structure of entries in the [protocols] database. *) @@ -1099,7 +1099,7 @@ type service_entry = { s_name : string; s_aliases : string array; s_port : int; - s_proto : string + s_proto : string } (** Structure of entries in the [services] database. *) @@ -1143,7 +1143,7 @@ type getaddrinfo_option = AI_FAMILY of socket_domain (** Impose the given socket domain *) | AI_SOCKTYPE of socket_type (** Impose the given socket type *) | AI_PROTOCOL of int (** Impose the given protocol *) - | AI_NUMERICHOST (** Do not call name resolver, + | AI_NUMERICHOST (** Do not call name resolver, expect numeric IP address *) | AI_CANONNAME (** Fill the [ai_canonname] field of the result *) @@ -1151,7 +1151,7 @@ type getaddrinfo_option = for use with {!Unix.bind} *) (** Options to {!Unix.getaddrinfo}. *) -val getaddrinfo: +val getaddrinfo: string -> string -> getaddrinfo_option list -> addr_info list (** [getaddrinfo host service opts] returns a list of {!Unix.addr_info} records describing socket parameters and addresses suitable for @@ -1200,7 +1200,7 @@ val getnameinfo : sockaddr -> getnameinfo_option list -> name_info complete description. *) type terminal_io = - { + { (* input modes *) mutable c_ignbrk : bool; (** Ignore the break condition. *) mutable c_brkint : bool; (** Signal interrupt on break condition. *) @@ -1245,14 +1245,14 @@ type terminal_io = before the read request is satisfied. *) mutable c_vtime : int; (** Maximum read wait (in 0.1s units). *) mutable c_vstart : char; (** Start character (usually ctrl-Q). *) - mutable c_vstop : char; (** Stop character (usually ctrl-S). *) + mutable c_vstop : char; (** Stop character (usually ctrl-S). *) } val tcgetattr : file_descr -> terminal_io (** Return the status of the terminal referred to by the given file descriptor. *) -type setattr_when = +type setattr_when = TCSANOW | TCSADRAIN | TCSAFLUSH @@ -1276,7 +1276,7 @@ val tcdrain : file_descr -> unit (** Waits until all output written on the given file descriptor has been transmitted. *) -type flush_queue = +type flush_queue = TCIFLUSH | TCOFLUSH | TCIOFLUSH @@ -1288,7 +1288,7 @@ val tcflush : file_descr -> flush_queue -> unit [TCOFLUSH] flushes data written but not transmitted, and [TCIOFLUSH] flushes both. *) -type flow_action = +type flow_action = TCOOFF | TCOON | TCIOFF |