Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

Latest commit

 

History

History

ev

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
  • infos =
  • infos/author = Thomas Wahringer [email protected]
  • infos/licence = BSD
  • infos/status = experimental maintained
  • infos/provides = io
  • infos/description =

I/O binding for libev

For the purpose of I/O bindings please read the bindings readme.

Installation

See installation. The package is called io-ev-elektra.

Requirements

  • libev (4.x; tested with 4.22)

Usage

Use the elektraIoEvNew function to get a new I/O binding instance. Make sure to build your application with elektra-io-ev, elektra-io and ev or simply use pkg-config --cflags --libs elektra-io-ev.

ElektraIoInterface _ elektraIoEvNew (struct ev_loop _ loop)

Create and initialize a new I/O binding.

Parameters

  • loop: Loop to use for I/O operations

Returns

Populated I/O interface

Example

#include <elektra/kdb.h>
#include <elektra/kdbio.h>
#include <elektra/kdbio/ev.h>

#include <ev.h>

void main (void)
{
	KDB * repo;
	// ... open KDB

	// Create libuv event loop
	struct ev_loop * loop = EV_DEFAULT;

	// Initialize I/O binding tied to event loop
	ElektraIoInterface * binding = elektraIoEvNew (loop);

	// Set I/O binding
	elektraIoSetBinding (kdb, binding);

	// Start the event loop
	ev_run (loop, 0);

	// Cleanup before exit
	elektraIoBindingCleanup (binding);
	ev_loop_destroy (EV_DEFAULT);
}