Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tarantool/tarantool-c
A new C client for Tarantool 1.6+
https://github.com/tarantool/tarantool-c
Last synced: 27 days ago
JSON representation
A new C client for Tarantool 1.6+
- Host: GitHub
- URL: https://github.com/tarantool/tarantool-c
- Owner: tarantool
- License: other
- Created: 2013-09-23T12:36:40.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2024-03-14T15:41:38.000Z (9 months ago)
- Last Synced: 2024-08-03T22:07:01.152Z (4 months ago)
- Language: C
- Homepage: http://tarantool.org/
- Size: 7.58 MB
- Stars: 26
- Watchers: 42
- Forks: 18
- Open Issues: 47
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
- Authors: AUTHORS
Awesome Lists containing this project
- awesome-tarantool - C connector
README
-------------------------------------------------------------------------------
Tarantool C client libraries
-------------------------------------------------------------------------------.. image:: https://github.com/tarantool/tarantool-c/actions/workflows/fast_testing.yml/badge.svg
:target: https://github.com/tarantool/tarantool-c/actions/workflows/fast_testing.yml?query=branch%3Amaster
:alt: Linux testing.. image:: https://github.com/tarantool/tarantool-c/actions/workflows/osx_testing.yml/badge.svg
:target: https://github.com/tarantool/tarantool-c/actions/workflows/osx_testing.yml?query=branch%3Amaster
:alt: OS X testing.. image:: https://github.com/tarantool/tarantool-c/actions/workflows/packaging.yml/badge.svg
:target: https://github.com/tarantool/tarantool-c/actions/workflows/packaging.yml?query=branch%3Amaster
:alt: Packaging===========================================================
About
===========================================================**Tarantool-c** is a client library written in C for Tarantool.
The current version is 1.0Tarantool-c depends on `msgpuck `_.
For documentation, please, visit `github pages `_.
It consinsts of:
* tnt - tarantool IProto/networking library
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Compilation/Installation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~This project using CMake for generating Makefiles:
.. code-block:: console
$ cmake .
$ make
#### For testing against installed tarantool
$ make test
#### For building documentation using Doxygen
$ make doc
#### For installing into system (headers+libraries)
$ make installOr you can install it using yum/apt into your favorite linux distribution
from `tarantool`'s repository===========================================================
Examples
===========================================================Start tarantool at port 3301 using this command:
.. code-block:: lua
box.cfg{ listen = '3301' }
After you've installed tarantool-c build and execute this code:
.. code-block:: c
#include
#include#include
#include
#includeint main() {
const char * uri = "localhost:3301";
struct tnt_stream * tnt = tnt_net(NULL); // Allocating stream
tnt_set(tnt, TNT_OPT_URI, uri); // Setting URI
tnt_set(tnt, TNT_OPT_SEND_BUF, 0); // Disable buffering for send
tnt_set(tnt, TNT_OPT_RECV_BUF, 0); // Disable buffering for recv
tnt_connect(tnt); // Initialize stream and connect to Tarantool
tnt_ping(tnt); // Send ping request
struct tnt_reply * reply = tnt_reply_init(NULL); // Initialize reply
tnt->read_reply(tnt, reply); // Read reply from server
tnt_reply_free(reply); // Free reply
tnt_close(tnt); tnt_stream_free(tnt); // Close connection and free stream object
}For more examples, please, visit ``test/cli/tarantool_tcp.c`` or ``test/tarantool_unix.c`` files.
For RPM/DEB packages - use instructions from http://tarantool.org/download.html to add repositories.