Skip to content

Latest commit

 

History

History
40 lines (25 loc) · 993 Bytes

README.md

File metadata and controls

40 lines (25 loc) · 993 Bytes

Scala Native Access

How to use?

Add resolvers

You can add github resolver by add this line to build.sbt:

resolvers += "Jian Zhou Release" at "https://raw.githubusercontent.com/janzhou/mvn-repo/release"

Add library

Add the library by using the following line:

libraryDependencies += "org.janzhou" %% "native" % "version"

Replace the version number with a proper tag name in the repository

Libc library

Libc library is The GNU C Library which defines the ``system calls'' and other basic facilities. You can use the libc interface in scala:

import org.janzhou.native._
val fd = libc.run.open("filename", libc.O_RDWR)
val mem = libc.run().malloc(8)
libc.run.ioctl(fd, COMMAND, mem)
libc.run().free(mem)
libc.run().close(fd)

Dependency

Contribute