From 6a0e36d49a9886b988f63373a96b0bcaa94fd190 Mon Sep 17 00:00:00 2001 From: Luke Palmer Date: Mon, 6 Oct 2025 12:59:07 -0400 Subject: [PATCH 1/3] add sexp_of --- curl.ml | 6 ++++++ curl.mli | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/curl.ml b/curl.ml index 5d2db27..229a23e 100644 --- a/curl.ml +++ b/curl.ml @@ -5,6 +5,7 @@ * Copyright (c) 2009, ygrek, *) +open Sexplib.Conv type t type curlCode = @@ -90,6 +91,7 @@ type curlCode = | CURLE_SSH | CURLE_SSL_SHUTDOWN_FAILED | CURLE_AGAIN +[@@deriving sexp_of] exception CurlException of (curlCode * int * string) @@ -181,6 +183,7 @@ type curlDebugType = | DEBUGTYPE_SSL_DATA_IN | DEBUGTYPE_SSL_DATA_OUT | DEBUGTYPE_END +[@@deriving sexp_of] type curlAuth = | CURLAUTH_BASIC @@ -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" @@ -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" diff --git a/curl.mli b/curl.mli index 296c550..571fe40 100644 --- a/curl.mli +++ b/curl.mli @@ -94,6 +94,7 @@ type curlCode = | CURLE_SSH | CURLE_SSL_SHUTDOWN_FAILED | CURLE_AGAIN +[@@deriving sexp_of] exception CurlException of (curlCode * int * string) @@ -189,6 +190,7 @@ type curlDebugType = | DEBUGTYPE_SSL_DATA_IN | DEBUGTYPE_SSL_DATA_OUT | DEBUGTYPE_END +[@@deriving sexp_of] type curlAuth = | CURLAUTH_BASIC @@ -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 @@ -1233,6 +1236,7 @@ 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 = @@ -1240,6 +1244,7 @@ module Multi : sig | 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 *) From 1486d3b293a52cc636e283a7ee69e471224778c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonin=20D=C3=A9cimo?= Date: Mon, 6 Oct 2025 19:41:25 +0200 Subject: [PATCH 2/3] Depend on sepxlib0 --- curl.ml | 2 +- curl.opam | 1 + dune | 2 +- dune-project | 3 ++- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/curl.ml b/curl.ml index 229a23e..85d4be1 100644 --- a/curl.ml +++ b/curl.ml @@ -5,7 +5,7 @@ * Copyright (c) 2009, ygrek, *) -open Sexplib.Conv +open Sexplib0.Sexp_conv type t type curlCode = diff --git a/curl.opam b/curl.opam index 1845439..43f0ddb 100644 --- a/curl.opam +++ b/curl.opam @@ -17,6 +17,7 @@ depends: [ "base-bigarray" "base-unix" "conf-libcurl" + "sexplib0" "odoc" {with-doc} ] conflicts: [ diff --git a/dune b/dune index d48b1d4..dc3e6c8 100644 --- a/dune +++ b/dune @@ -8,7 +8,7 @@ (flags -DHAVE_CONFIG_H :standard (:include cflags.sexp)) (names curl-helper)) (c_library_flags :standard (:include clibs.sexp)) - (libraries bigarray unix) + (libraries bigarray unix sexplib0) (modules curl)) (library diff --git a/dune-project b/dune-project index 069e361..6f47109 100644 --- a/dune-project +++ b/dune-project @@ -26,7 +26,8 @@ (dune-configurator (>= "3.18.1")) base-bigarray base-unix - conf-libcurl) + conf-libcurl + sexplib0) (conflicts (ocurl (<> "transition"))) (tags (org:ygrek clib:curl))) From 8867eeaf8cb33222b730bab02b9f5ed3fc19b6cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonin=20D=C3=A9cimo?= Date: Mon, 6 Oct 2025 21:16:13 +0200 Subject: [PATCH 3/3] Depend on ppx_sexp_conv --- curl.ml | 2 +- curl.opam | 1 + dune | 3 ++- dune-project | 3 ++- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/curl.ml b/curl.ml index 85d4be1..c2a2403 100644 --- a/curl.ml +++ b/curl.ml @@ -5,7 +5,7 @@ * Copyright (c) 2009, ygrek, *) -open Sexplib0.Sexp_conv +open! Sexplib0.Sexp_conv type t type curlCode = diff --git a/curl.opam b/curl.opam index 43f0ddb..5c93cee 100644 --- a/curl.opam +++ b/curl.opam @@ -18,6 +18,7 @@ depends: [ "base-unix" "conf-libcurl" "sexplib0" + "ppx_sexp_conv" "odoc" {with-doc} ] conflicts: [ diff --git a/dune b/dune index dc3e6c8..2151412 100644 --- a/dune +++ b/dune @@ -9,7 +9,8 @@ (names curl-helper)) (c_library_flags :standard (:include clibs.sexp)) (libraries bigarray unix sexplib0) - (modules curl)) + (modules curl) + (preprocess (pps ppx_sexp_conv))) (library (name curl_lwt) diff --git a/dune-project b/dune-project index 6f47109..35f4493 100644 --- a/dune-project +++ b/dune-project @@ -27,7 +27,8 @@ base-bigarray base-unix conf-libcurl - sexplib0) + sexplib0 + ppx_sexp_conv) (conflicts (ocurl (<> "transition"))) (tags (org:ygrek clib:curl)))