Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions curl.ml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* Copyright (c) 2009, ygrek, <ygrek@autistici.org>
*)

open! Sexplib0.Sexp_conv
type t

type curlCode =
Expand Down Expand Up @@ -90,6 +91,7 @@ type curlCode =
| CURLE_SSH
| CURLE_SSL_SHUTDOWN_FAILED
| CURLE_AGAIN
[@@deriving sexp_of]

exception CurlException of (curlCode * int * string)

Expand Down Expand Up @@ -181,6 +183,7 @@ type curlDebugType =
| DEBUGTYPE_SSL_DATA_IN
| DEBUGTYPE_SSL_DATA_OUT
| DEBUGTYPE_END
[@@deriving sexp_of]

type curlAuth =
| CURLAUTH_BASIC
Expand Down Expand Up @@ -622,6 +625,7 @@ type version_info = {
iconv_ver_num : int;
libssh_version : string;
}
[@@deriving sexp_of]

external version_info : unit -> version_info = "caml_curl_version_info"

Expand Down Expand Up @@ -1606,9 +1610,11 @@ module Multi = struct

(* see curlm_sock_cb *)
type poll = POLL_NONE | POLL_IN | POLL_OUT | POLL_INOUT | POLL_REMOVE
[@@deriving sexp_of]

(* see caml_curl_multi_socket_action *)
type fd_status = EV_AUTO | EV_IN | EV_OUT | EV_INOUT
[@@deriving sexp_of]

external set_socket_function : mt -> (Unix.file_descr -> poll -> unit) -> unit = "caml_curl_multi_socketfunction"
external set_timer_function : mt -> (int -> unit) -> unit = "caml_curl_multi_timerfunction"
Expand Down
5 changes: 5 additions & 0 deletions curl.mli
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ type curlCode =
| CURLE_SSH
| CURLE_SSL_SHUTDOWN_FAILED
| CURLE_AGAIN
[@@deriving sexp_of]

exception CurlException of (curlCode * int * string)

Expand Down Expand Up @@ -189,6 +190,7 @@ type curlDebugType =
| DEBUGTYPE_SSL_DATA_IN
| DEBUGTYPE_SSL_DATA_OUT
| DEBUGTYPE_END
[@@deriving sexp_of]

type curlAuth =
| CURLAUTH_BASIC
Expand Down Expand Up @@ -607,6 +609,7 @@ type version_info = {
iconv_ver_num : int;
libssh_version : string;
}
[@@deriving sexp_of]

type pauseOption = PAUSE_SEND | PAUSE_RECV | PAUSE_ALL

Expand Down Expand Up @@ -1233,13 +1236,15 @@ module Multi : sig
| POLL_OUT (** available for writing *)
| POLL_INOUT (** both *)
| POLL_REMOVE (** socket not needed anymore *)
[@@deriving sexp_of]

(** socket status *)
type fd_status =
| EV_AUTO (** determine socket status automatically (with extra system call) *)
| EV_IN (** socket has incoming data *)
| EV_OUT (** socket is available for writing *)
| EV_INOUT (** both *)
[@@deriving sexp_of]

(** set the function to receive notifications on what socket events
are currently interesting for libcurl on the specified socket handle *)
Expand Down
2 changes: 2 additions & 0 deletions curl.opam
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ depends: [
"base-bigarray"
"base-unix"
"conf-libcurl"
"sexplib0"
"ppx_sexp_conv"
"odoc" {with-doc}
]
conflicts: [
Expand Down
5 changes: 3 additions & 2 deletions dune
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
(flags -DHAVE_CONFIG_H :standard (:include cflags.sexp))
(names curl-helper))
(c_library_flags :standard (:include clibs.sexp))
(libraries bigarray unix)
(modules curl))
(libraries bigarray unix sexplib0)
(modules curl)
(preprocess (pps ppx_sexp_conv)))

(library
(name curl_lwt)
Expand Down
4 changes: 3 additions & 1 deletion dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@
(dune-configurator (>= "3.18.1"))
base-bigarray
base-unix
conf-libcurl)
conf-libcurl
sexplib0
ppx_sexp_conv)
(conflicts
(ocurl (<> "transition")))
(tags (org:ygrek clib:curl)))
Expand Down