From e5a4044d9e9125483d062cac5501251a2b098015 Mon Sep 17 00:00:00 2001 From: Lachlan O'Dea Date: Fri, 19 Jan 2024 20:56:30 +1100 Subject: [PATCH] Try to fix build. --- README.md | 14 +++++--------- src/main/scala/scalauv/errors.scala | 10 ++++++---- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 0d08283..f46f3d1 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,10 @@ # Scala Native bindings for libuv +> Handcrafted, artisanal Scala Native bindings for libuv. + **scala-uv** is a Scala Native library that provides Scala bindings for [libuv](https://libuv.org), which is a multi-platform asynchronous IO library written in C. libuv was originally developed for Node.js, but it's also used by other software projects. -Only Scala 3 is supported at this time. +Only Scala 3 is supported. ## Getting it @@ -12,7 +14,7 @@ libraryDependencies += "io.github.quelgar" %%% "scala-uv" % "0.0.1" ## Current status -Very early days, only some of the APIs are bound. What works so far: +Very early days, most of the APIs have bindings, but not all. Many are not tested at all. What I've tried so far: * Error handling * Event loop @@ -20,7 +22,7 @@ Very early days, only some of the APIs are bound. What works so far: * Read and write files * TCP client and server -But the API is still in flux. +But many details of the API are still in flux. ## Examples @@ -99,12 +101,6 @@ uv_write(writeReq, stream, buf, 1.toUInt, onWrite).onFail { While the `Zone` memory allocation API from Scala Native is very nice, it's not useful when the memory is freed in a different callback, as there won't be a shared lexical scope. So `mallocCString` converts a Scala string to a C string, allocating the memory the old-fashioned way. -### Other UvUtils methods - -* allocate memory for requests -* allocate memory for handles -* allocate, use and free file system requests - --- Copyright 2024 Lachlan O'Dea diff --git a/src/main/scala/scalauv/errors.scala b/src/main/scala/scalauv/errors.scala index 8d824d8..a9b4fd6 100644 --- a/src/main/scala/scalauv/errors.scala +++ b/src/main/scala/scalauv/errors.scala @@ -90,8 +90,10 @@ object ErrorCodes { val EFTYPE: ErrorCode = uv_scala_errorcode_EFTYPE() val EILSEQ: ErrorCode = uv_scala_errorcode_EILSEQ() val ESOCKTNOSUPPORT: ErrorCode = uv_scala_errorcode_ESOCKTNOSUPPORT() - val ENODATA: ErrorCode = uv_scala_errorcode_ENODATA() - val EUNATCH: ErrorCode = uv_scala_errorcode_EUNATCH() + + // these require libuv >= 1.46 but Ubuntu 22 LTS only has 1.43 + // val ENODATA: ErrorCode = uv_scala_errorcode_ENODATA() + // val EUNATCH: ErrorCode = uv_scala_errorcode_EUNATCH() } @@ -180,7 +182,7 @@ private[scalauv] object errors { def uv_scala_errorcode_EFTYPE(): ErrorCode = extern def uv_scala_errorcode_EILSEQ(): ErrorCode = extern def uv_scala_errorcode_ESOCKTNOSUPPORT(): ErrorCode = extern - def uv_scala_errorcode_ENODATA(): ErrorCode = extern - def uv_scala_errorcode_EUNATCH(): ErrorCode = extern + // def uv_scala_errorcode_ENODATA(): ErrorCode = extern + // def uv_scala_errorcode_EUNATCH(): ErrorCode = extern }