X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fhttp_getter%2Fhttp_getter_misc.mli;h=0551161b9ebe6038e79b222f12380c7b08187603;hb=ab06d9617b863a42a49f9a407694a9605f500b98;hp=aba2a9a01a596d22968177c1a6d817be8b035b97;hpb=32bc9336091a84376f93b06325c08dab58124a0d;p=helm.git diff --git a/helm/http_getter/http_getter_misc.mli b/helm/http_getter/http_getter_misc.mli index aba2a9a01..0551161b9 100644 --- a/helm/http_getter/http_getter_misc.mli +++ b/helm/http_getter/http_getter_misc.mli @@ -1,5 +1,7 @@ (* - * Copyright (C) 2003, HELM Team. + * Copyright (C) 2003: + * Stefano Zacchiroli + * for the HELM Team http://helm.cs.unibo.it/ * * This file is part of HELM, an Hypertextual, Electronic * Library of Mathematics, developed at the Computer Science @@ -21,9 +23,13 @@ * MA 02111-1307, USA. * * For details, see the HELM World-Wide-Web page, - * http://cs.unibo.it/helm/. + * 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 @@ -35,13 +41,20 @@ val iter_file : (string -> unit) -> string -> unit val hashtbl_sorted_fold : ('a -> 'b -> 'c -> 'c) -> ('a, 'b) Hashtbl.t -> 'c -> 'c + (** cp frontend *) +val cp: string -> string -> unit (** wget frontend, if output is given it is the destination file, otherwise - standard wget rules are used *) + 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 @@ -53,6 +66,20 @@ val mkdir: ?parents: bool -> string -> unit val string_of_proc_status : Unix.process_status -> string (** raw HTTP downloader, return Some the contents of downloaded resource or - None if an error occured while downlaoding *) + 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 + + (** add a line to a file (specified by name) _after_ a given line (defaults to + last line). *) +val add_line: fname:string -> ?position:int -> string -> unit + (** remove a line, if any, from a file specified by line number (0 based, i.e. + first line of file is line 0) *) +val remove_line: fname:string -> int -> unit + + (** true on blanks-only and #-commented lines, false otherwise *) +val is_blank_line: string -> bool