diff --git a/.gitignore b/.gitignore index 2c28bd2..1289344 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ src/test/resources/write-test.txt /.metals .vscode metals.sbt +/.scala-build diff --git a/project/build.properties b/project/build.properties index b19d4e1..0aa5c39 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version = 1.9.7 +sbt.version = 1.9.8 diff --git a/project/plugins.sbt b/project/plugins.sbt index 14e7142..e9d3c30 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,3 +1,3 @@ -addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.16") +addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.17") addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.2.1") addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.10.0") diff --git a/src/main/resources/scala-native/helpers.c b/src/main/resources/scala-native/helpers.c index 5dee150..f7817dc 100644 --- a/src/main/resources/scala-native/helpers.c +++ b/src/main/resources/scala-native/helpers.c @@ -80,47 +80,114 @@ void scala_uv_init_sockaddr_in6(const char *address, int port, unsigned int flow addr->sin6_scope_id = htonl(scope_id); } -int scala_uv_value_o_rdonly() +// File open constants + +int scala_uv_value_o_append() { - return O_RDONLY; + return UV_FS_O_APPEND; } -int scala_uv_value_o_wronly() +int scala_uv_value_o_creat() { - return O_WRONLY; + return UV_FS_O_CREAT; } -int scala_uv_value_o_rdwr() +int scala_uv_value_o_direct() { - return O_RDWR; + return UV_FS_O_DIRECT; } -int scala_uv_value_o_creat() +int scala_uv_value_o_directory() { - return O_CREAT; + return UV_FS_O_DIRECTORY; +} + +int scala_uv_value_o_dsync() +{ + return UV_FS_O_DSYNC; } int scala_uv_value_o_excl() { - return O_EXCL; + return UV_FS_O_EXCL; } -int scala_uv_value_o_trunc() +int scala_uv_value_o_exlock() { - return O_TRUNC; + return UV_FS_O_EXLOCK; } -int scala_uv_value_o_append() +int scala_uv_value_o_filemap() { - return O_APPEND; + return UV_FS_O_FILEMAP; } -int scala_uv_value_o_dsync() +int scala_uv_value_o_noatime() +{ + return UV_FS_O_NOATIME; +} + +int scala_uv_value_o_noctty() +{ + return UV_FS_O_NOCTTY; +} + +int scala_uv_value_o_nofollow() +{ + return UV_FS_O_NOFOLLOW; +} + +int scala_uv_value_o_nonblock() +{ + return UV_FS_O_NONBLOCK; +} + +int scala_uv_value_o_random() +{ + return UV_FS_O_RANDOM; +} + +int scala_uv_value_o_rdonly() +{ + return UV_FS_O_RDONLY; +} + +int scala_uv_value_o_rdwr() { - return O_DSYNC; + return UV_FS_O_RDWR; +} + +int scala_uv_value_o_sequential() +{ + return UV_FS_O_SEQUENTIAL; +} + +int scala_uv_value_o_short_lived() +{ + return UV_FS_O_SHORT_LIVED; +} + +int scala_uv_value_o_symlink() +{ + return UV_FS_O_SYMLINK; } int scala_uv_value_o_sync() { - return O_SYNC; + return UV_FS_O_SYNC; +} + +int scala_uv_value_o_temporary() +{ + return UV_FS_O_TEMPORARY; +} + +int scala_uv_value_o_trunc() +{ + return UV_FS_O_TRUNC; +} + +int scala_uv_value_o_wronly() +{ + return UV_FS_O_WRONLY; } diff --git a/src/main/resources/scala-native/platform_specific.c b/src/main/resources/scala-native/platform_specific.c deleted file mode 100644 index f5bd292..0000000 --- a/src/main/resources/scala-native/platform_specific.c +++ /dev/null @@ -1,7 +0,0 @@ - - -#ifdef _WIN32 - -#else - -#endif \ No newline at end of file diff --git a/src/main/scala/scalauv/UvConstants.scala b/src/main/scala/scalauv/UvConstants.scala index 5b4bccf..d36146e 100644 --- a/src/main/scala/scalauv/UvConstants.scala +++ b/src/main/scala/scalauv/UvConstants.scala @@ -13,17 +13,28 @@ object RunMode { } object FileOpenFlags { - val O_RDONLY = helpers.scala_uv_value_o_rdonly() - val O_WRONLY = helpers.scala_uv_value_o_wronly() - val O_RDWR = helpers.scala_uv_value_o_rdwr() - - val O_CREAT = helpers.scala_uv_value_o_creat() - val O_EXCL = helpers.scala_uv_value_o_excl() - val O_TRUNC = helpers.scala_uv_value_o_trunc() - val O_APPEND = helpers.scala_uv_value_o_append() + val O_CREAT = helpers.scala_uv_value_o_creat() + val O_DIRECT = helpers.scala_uv_value_o_direct() + val O_DIRECTORY = helpers.scala_uv_value_o_directory() val O_DSYNC = helpers.scala_uv_value_o_dsync() + val O_EXCL = helpers.scala_uv_value_o_excl() + val O_EXLOCK = helpers.scala_uv_value_o_exlock() + val O_FILEMAP = helpers.scala_uv_value_o_filemap() + val O_NOATIME = helpers.scala_uv_value_o_noatime() + val O_NOCTTY = helpers.scala_uv_value_o_noctty() + val O_NOFOLLOW = helpers.scala_uv_value_o_nofollow() + val O_NONBLOCK = helpers.scala_uv_value_o_nonblock() + val O_RANDOM = helpers.scala_uv_value_o_random() + val O_RDONLY = helpers.scala_uv_value_o_rdonly() + val O_RDWR = helpers.scala_uv_value_o_rdwr() + val O_SEQUENTIAL = helpers.scala_uv_value_o_sequential() + val O_SHORT_LIVED = helpers.scala_uv_value_o_short_lived() + val O_SYMLINK = helpers.scala_uv_value_o_symlink() val O_SYNC = helpers.scala_uv_value_o_sync() + val O_TEMPORARY = helpers.scala_uv_value_o_temporary() + val O_TRUNC = helpers.scala_uv_value_o_trunc() + val O_WRONLY = helpers.scala_uv_value_o_wronly() } object CreateMode { diff --git a/src/main/scala/scalauv/helpers.scala b/src/main/scala/scalauv/helpers.scala index f52ca4f..aa2eb1c 100644 --- a/src/main/scala/scalauv/helpers.scala +++ b/src/main/scala/scalauv/helpers.scala @@ -48,21 +48,48 @@ private[scalauv] object helpers { ): Unit = extern - def scala_uv_value_o_rdonly(): CInt = extern + def scala_uv_value_o_append(): CInt = extern - def scala_uv_value_o_wronly(): CInt = extern + def scala_uv_value_o_creat(): CInt = extern - def scala_uv_value_o_rdwr(): CInt = extern + def scala_uv_value_o_direct(): CInt = extern - def scala_uv_value_o_creat(): CInt = extern + def scala_uv_value_o_directory(): CInt = extern + + def scala_uv_value_o_dsync(): CInt = extern def scala_uv_value_o_excl(): CInt = extern - def scala_uv_value_o_trunc(): CInt = extern + def scala_uv_value_o_exlock(): CInt = extern - def scala_uv_value_o_append(): CInt = extern + def scala_uv_value_o_filemap(): CInt = extern - def scala_uv_value_o_dsync(): CInt = extern + def scala_uv_value_o_noatime(): CInt = extern + + def scala_uv_value_o_noctty(): CInt = extern + + def scala_uv_value_o_nofollow(): CInt = extern + + def scala_uv_value_o_nonblock(): CInt = extern + + def scala_uv_value_o_random(): CInt = extern + + def scala_uv_value_o_rdonly(): CInt = extern + + def scala_uv_value_o_rdwr(): CInt = extern + + def scala_uv_value_o_sequential(): CInt = extern + + def scala_uv_value_o_short_lived(): CInt = extern + + def scala_uv_value_o_symlink(): CInt = extern def scala_uv_value_o_sync(): CInt = extern + + def scala_uv_value_o_temporary(): CInt = extern + + def scala_uv_value_o_trunc(): CInt = extern + + def scala_uv_value_o_wronly(): CInt = extern + }