Permalink
Browse files

io: update documentation & disable swig_ruby for now

  • Loading branch information...
waht committed Jan 4, 2018
1 parent 2aa328f commit 143d8cef8cf41ee5add13855c7527cd99fe359af
View
@@ -37,7 +37,8 @@ set (ADDED_DIRECTORIES "" CACHE STRING ${PLUGINS_DOC} FORCE)
set (BINDINGS_DOC "Which bindings should be added? ALL for all available, DEFAULT for minimal set, see doc/COMPILE.md.")
set(BINDINGS "MAINTAINED;-EXPERIMENTAL;-DEPRECATED" CACHE STRING ${BINDINGS_DOC})
# TODO include swig_ruby when issue #1770 is resolved (also in scripts/configure-*)
set(BINDINGS "MAINTAINED;-EXPERIMENTAL;-DEPRECATED;-swig_ruby" CACHE STRING ${BINDINGS_DOC})
set (INFO_BINDINGS_DOC "only for informational purposes. Modify BINDINGS to change the list.")
set (ADDED_BINDINGS_DOC "List of bindings already added, ${INFO_BINDINGS_DOC}")
@@ -39,7 +39,7 @@ feeds back configuration changes from within the application.
When a configuration key is changed Elektra can generate change notifications
that allow applications to process those changes.
Developers can choose whether and how they want to receive and handle those
notifications but not whether notifications are sent.
notifications but not whether notifications are sent or which transport is used.
How notifications are sent is specified in the *notification configuration* by
the system operator.
@@ -66,7 +66,7 @@ For programs without time constraints (e.g. CLI programs) this may not be
important, but for GUIs or network services this will have negative impact.
Since many different I/O management libraries exist (e.g. libuv, glib or libev)
the transport plugins use the I/O-interface for their I/O tasks.
the transport plugins use the I/O interface for their I/O operations.
Each I/O management library needs its own I/O binding.
Developers can also create their own I/O binding for the I/O management library
of their choice.
@@ -135,26 +135,20 @@ KDB * repo;
// ... initialization of KDB and I/O binding
Key * someKey = keyNew ("/sw/myorg/myprogram/#1/current/somekey", KEY_END);
int someKeyValue;
Key * key = keyNew ("/sw/myorg/myprogram/#1/current/value", KEY_END);
int keyValue;
elektraNotificationRegisterInt (repo, &someKeyValue, someKey);
elektraNotificationRegisterInt (repo, &keyValue, key);
// repeatedly print variable
while (1) {
KeySet * ks = ksNew (10, KS_END);
kdbGet (repo, ks, someKey);
Key * k = ksLookupByName (ks, "/sw/myorg/myprogram/#1/current/somekey", 0);
if (k != 0)
{
printf ("value is %s\n", keyString (k));
}
printf ("value is %d\n", keyValue);
sleep(2);
}
```
The variable `someKeyValue` will be automatically updated if the key in the
The variable `keyValue` will be automatically updated if the key in the
program above is changed by another program (e.g. by using the `kdb` CLI
command).
@@ -179,9 +173,9 @@ changed key needs further processing.
#define ANSI_COLOR_RED "\x1b[31m"
#define ANSI_COLOR_GREEN "\x1b[32m"
void setTerminalColor (Key * someKey)
void setTerminalColor (Key * color)
{
char* value = keyString (someKey);
char* value = keyString (color);
if (strcmp (value, "red") == 0)
{
@@ -199,18 +193,18 @@ int main ()
// ... initialization of KDB and I/O binding
Key * someKey = keyNew ("/sw/myorg/myprogram/#1/current/somekey", KEY_END);
Key * color = keyNew ("/sw/myorg/myprogram/#1/current/color", KEY_END);
// Retrieve key from kdb
KeySet * ks = ksNew (10, KS_END);
kdbGet (repo, ks, someKey);
Key * key = ksLookupByName (ks, "/sw/myorg/myprogram/#1/current/somekey", 0);
kdbGet (repo, ks, color);
Key * key = ksLookupByName (ks, "/sw/myorg/myprogram/#1/current/color", 0);
// Initialization
setTerminalColor (key);
// Re-Initialize on key changes
elektraNotificationRegisterCallback(repo, &setTerminalColor, someKey);
elektraNotificationRegisterCallback(repo, &setTerminalColor, color);
// ... start loop, etc.
}
@@ -12,7 +12,7 @@ cd $BUILD
cmake -DSWIG_EXECUTABLE=/usr/bin/swig3.0 \
-DPLUGINS="ALL" \
-DTOOLS="ALL" \
-DBINDINGS="ALL" \
-DBINDINGS="ALL;-swig_ruby" \
-DENABLE_DEBUG="ON" \
-DENABLE_LOGGER="ON" \
$*
@@ -12,7 +12,7 @@ cd $BUILD
cmake -DSWIG_EXECUTABLE=/usr/bin/swig3.0 \
-DPLUGINS="ALL" \
-DTOOLS="ALL" \
-DBINDINGS="ALL" \
-DBINDINGS="ALL;-swig_ruby" \
-DENABLE_DEBUG="OFF" \
-DENABLE_LOGGER="ON" \
$*
@@ -13,7 +13,7 @@ cmake -DSWIG_EXECUTABLE=/usr/bin/swig3.0 \
-DENABLE_OPTIMIZATIONS="ON" \
-DPLUGINS="ALL" \
-DTOOLS="ALL" \
-DBINDINGS="ALL" \
-DBINDINGS="ALL;-swig_ruby" \
-DENABLE_DEBUG="ON" \
-DENABLE_LOGGER="ON" \
-DBUILD_DOCUMENTATION="OFF" \
View
@@ -16,7 +16,7 @@ cmake -DSWIG_EXECUTABLE=/usr/bin/swig3.0 \
-DKDB_DB_SYSTEM="~/.config/kdb/system" \
-DKDB_DB_SPEC="~/.config/kdb/spec" \
-DTOOLS="ALL" \
-DBINDINGS="ALL" \
-DBINDINGS="ALL;-swig_ruby" \
$*
#-DKDB_DB_SPEC="~/.config/kdb/spec" \ # see ##691
View
@@ -10,5 +10,5 @@ cmake -DSWIG_EXECUTABLE=/usr/bin/swig3.0 \
-DKDB_DEFAULT_STORAGE="ini" \
-DPLUGINS="ALL" \
-DTOOLS="ALL" \
-DBINDINGS="ALL" \
-DBINDINGS="ALL;-swig_ruby" \
$*
@@ -60,6 +60,7 @@
* For brevity only file descriptor operation variants are listed here.
* Variants for timer and idle operations are called `elektraIoTimer*` and
* `elektraIoIdle*`.
* All `elektraIo*` utility functions are provided by the `elektra-io` library.
*
* File desciptor watch operations have the following additional properties:
* - fd (elektraIoFdGetFd();set by elektraIoNewFdOperation()) file descriptor
@@ -170,6 +171,13 @@
* At least you need to free the pointer returned from
* elektraIoNewBinding() in your I/O binding's entry point.
*
* @par Linking
*
* Make sure to link against the `elektra-io` library for the `elektraIo*`
* utility functions that create bindings or operations and allow access to
* their fields.
* This library is available via `pkg-config`.
*
* @par Testing
*
* Elektra provides a test suite for I/O bindings in order to make sure that
@@ -13,7 +13,7 @@
## Usage
Use the `elektraIoUvNew` function to get a new binding.
Use the `elektraIoUvNew` function to get a new I/O binding instance.
Make sure to build your application with `elektra-io-uv`, `elektra-io` and `uv` or
simply use `pkg-config --cflags --libs elektra-io-uv`.

0 comments on commit 143d8ce

Please sign in to comment.