X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fhttp_getter%2Fhttp_getter_misc.mli;h=b328742be76370b1ca804a3c06510999406327d6;hb=d3c72d6856cd185e5b3e9f2e8b928b78c7031ed1;hp=469ce81595672be49440f4785483673946d71b3c;hpb=5d7d6bd5090f3f82279bef0b93b4b361a5b1d751;p=helm.git diff --git a/helm/http_getter/http_getter_misc.mli b/helm/http_getter/http_getter_misc.mli index 469ce8159..b328742be 100644 --- a/helm/http_getter/http_getter_misc.mli +++ b/helm/http_getter/http_getter_misc.mli @@ -1,5 +1,5 @@ (* - * Copyright (C) 2003: + * Copyright (C) 2003-2004: * Stefano Zacchiroli * for the HELM Team http://helm.cs.unibo.it/ * @@ -26,9 +26,13 @@ * http://helm.cs.unibo.it/ *) + (** 'mkdir' failed, arguments are: name of the directory to be created and + failure reason *) +exception Mkdir_failure of string * string + (** "fold_left" like function on file lines, trailing newline is not passed to the given function *) -val fold_file : ('a -> string -> 'a) -> 'a -> string -> 'a +val fold_file : (string -> 'a -> 'a) -> 'a -> string -> 'a (* "iter" like function on file lines, trailing newline is not passed to the given function *) val iter_file : (string -> unit) -> string -> unit @@ -36,6 +40,8 @@ val iter_file : (string -> unit) -> string -> unit (** like Hashtbl.fold but keys are processed ordered *) val hashtbl_sorted_fold : ('a -> 'b -> 'c -> 'c) -> ('a, 'b) Hashtbl.t -> 'c -> 'c + (** like Hashtbl.iter but keys are processed ordered *) +val hashtbl_sorted_iter : ('a -> 'b -> unit) -> ('a, 'b) Hashtbl.t -> unit (** cp frontend *) val cp: string -> string -> unit @@ -43,10 +49,14 @@ val cp: string -> string -> unit standard wget rules are used. Additionally this function support also the "file://" scheme for file system addressing *) val wget: ?output: string -> string -> unit - (** gzip frontend, if keep = true original file will be kept *) -val gzip: ?keep: bool -> string -> unit - (** gunzip frontend, if keep = true original file will be kept *) -val gunzip: ?keep: bool -> string -> unit + (** gzip frontend. If keep = true original file will be kept, default is + false. output is the file on which gzipped data will be saved, default is + given file with an added ".gz" suffix *) +val gzip: ?keep: bool -> ?output: string -> string -> unit + (** gunzip frontend. If keep = true original file will be kept, default is + false. output is the file on which gunzipped data will be saved, default is + given file name without trailing ".gz" *) +val gunzip: ?keep: bool -> ?output: string -> string -> unit (** tempfile frontend, return the name of created file. A special purpose suffix is used (actually "_http_getter" *) val tempfile: unit -> string @@ -61,4 +71,10 @@ val string_of_proc_status : Unix.process_status -> string None if an error occured while downloading. This function support also "file://" scheme for filesystem resources *) val http_get: string -> string option + (** 'iter' like method that iter over string slices (unspecified length) of a + remote resources fetched via HTTP GET requests *) +val http_get_iter_buf: callback:(string -> unit) -> string -> unit + + (** true on blanks-only and #-commented lines, false otherwise *) +val is_blank_line: string -> bool