]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/DEVEL/ocaml-http/http_misc.mli
- added explode_sockaddr, inverse function of build_sockaddr
[helm.git] / helm / DEVEL / ocaml-http / http_misc.mli
index 5a74fe4ff36c6bacc94fbcaaa1e79e630084b0da..6e5fdfcf6425daf10beedcbc60b0269fe4184077 100644 (file)
@@ -19,6 +19,9 @@
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *)
 
+(** Helpers and other not better classified functions which should not be
+visible to the final user *)
+
   (** @return the current date compliant to RFC 1123, which updates RFC 822
   zone info are retrieved from UTC *)
 val date_822: unit -> string
@@ -39,3 +42,24 @@ val strip_heading_slash: string -> string
   (** given a dir handle @return a list of entries contained *)
 val ls: Unix.dir_handle -> string list
 
+  (** explode a string in a char list *)
+val string_explode: string -> char list
+  (** implode a char list in a string *)
+val string_implode: char list -> string
+
+  (** given an HTTP response code return the corresponding reason phrase *)
+val reason_phrase_of_code: int -> string
+
+  (** build a Unix.sockaddr inet address from a string representation of an IP
+  address and a port number *)
+val build_sockaddr: string * int -> Unix.sockaddr
+  (** explode an _inet_ Unix.sockaddr address in a string representation of an
+  IP address and a port number *)
+val explode_sockaddr: Unix.sockaddr -> string * int
+
+  (** given an out_channel build on top of a socket, return peername related to
+  that socket *)
+val peername_of_out_channel: out_channel -> Unix.sockaddr
+  (** as above but works on in_channels *)
+val peername_of_in_channel: in_channel -> Unix.sockaddr
+