1
mirror of https://github.com/rclone/rclone synced 2024-12-25 17:03:45 +01:00
rclone/librclone
2021-04-28 16:55:08 +01:00
..
ctest librclone: add tests for build and execute them in the actions #4891 2021-04-28 16:55:08 +01:00
gomobile librclone: factor into gomobile and internal implementation #4891 2021-04-28 16:55:08 +01:00
librclone librclone: catch panics at the language change boundary #4891 2021-04-28 16:55:08 +01:00
python librclone: add basic Python bindings with tests #4891 2021-04-28 16:55:08 +01:00
librclone.go librclone: factor into gomobile and internal implementation #4891 2021-04-28 16:55:08 +01:00
README.md librclone: add basic Python bindings with tests #4891 2021-04-28 16:55:08 +01:00

librclone

This directory contains code to build rclone as a C library and the shims for accessing rclone from C and other languages.

Note for the moment, the interfaces defined here are experimental and may change in the future. Eventually they will stabilse and this notice will be removed.

C

The shims are a thin wrapper over the rclone RPC.

Build a shared library like this:

go build --buildmode=c-shared -o librclone.so github.com/rclone/rclone/librclone

Build a static library like this:

go build --buildmode=c-archive -o librclone.a github.com/rclone/rclone/librclone

Both the above commands will also generate librclone.h which should be #included in C programs wishing to use the library.

The library will depend on libdl and libpthread.

Documentation

For documentation see the Go documentation for:

C Example

There is an example program ctest.c with Makefile in the ctest subdirectory

gomobile

The gomobile subdirectory contains the equivalent of the C binding but suitable for using with gomobile using something like this.

gomobile bind -v -target=android github.com/rclone/rclone/librclone/gomobile

python

The python subdirectory contains a simple python wrapper for the C API using rclone linked as a shared library.

This needs expanding and submitting to pypi...