rclone/librclone
Nick Craig-Wood f38c262471 librclone: change interface for C code and add Mobile interface #4891
This changes the interface for the C code to return a struct on the
stack that is defined in the code rather than one which is defined by
the cgo compiler. This is more future proof and inline with the
gomobile interface.

This also adds a gomobile interface RcloneMobileRPC which uses generic
go types conforming to the gobind restrictions.

It also fixes up initialisation errors.
2021-04-28 16:55:08 +01:00
..
ctest librclone: change interface for C code and add Mobile interface #4891 2021-04-28 16:55:08 +01:00
librclone.go librclone: change interface for C code and add Mobile interface #4891 2021-04-28 16:55:08 +01:00
README.md librclone: exports, errors, docs and examples #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.

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