LIBDATOVKA(3)

πŸ’… LIBDATOVKA(3) β€” Manual for Libdatovka: libdatovka, ISDS client library, bestie πŸ’–


🌸 NAME 🌸

libdatovka β€” ISDS client library, periodt. πŸ’…

✨ SYNOPSIS ✨

okay so here's the whole little vibe in C, bestie:

#include <libdatovka/isds.h>
#include <stdio.h>

isds_error err;
struct isds_ctx *ctx;

err = isds_init();
ctx = isds_ctx_create();

err = isds_login(ctx, NULL, "username", "password", NULL, NULL);
if (err) {
    printf("isds_login() failed: %s: %s\n",
        isds_strerror(err), isds_long_message(ctx));
} else {
    printf("Logged in.\n");
}

err = isds_ctx_free(&ctx);
err = isds_cleanup();

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so this is a client library for accessing SOAP services of ISDS (InformačnΓ­ systΓ©m datovΓ½ch schrΓ‘nek / Data Box Information System) as defined in Czech ISDS Act (300/2008 Coll.)[1] and implied documents. Current implementation details are described in ProvoznΓ­ Ε™Γ‘d that can be downloaded from Dokumenty ke staΕΎenΓ­ section of ISDS Information Portal[2]. no cap, that's the lore. πŸ“œβœ¨

The library provides a C language interface with synchronous non-reentrant blocking calls. Network communication progress reporting and operation logging and library debugging are implemented by calling back application-provided functions. Network operations can be cancelled from network reporting call-back. it's giving very callback-coded, and we respect it. 🫢

πŸ› οΈ LIBRARY INITIALIZATION AND DEINITIALIZATION πŸ› οΈ

A libdatovka application must include the libdatovka/isds.h header file. The application must call isds_init function to initialize the library before calling any other library functions. After last libdatovka call, isds_cleanup function should be called to clean up some global resources and to deinitialize dependent libraries. basically: init first, cleanup last, slay in between. πŸ’–

πŸŽ€ CONTEXTS πŸŽ€

Most of the functions operate on an established connection to the ISDS server. This is called a context and it's represented by a pointer to an opaque isds_ctx structure. The structure maintains state about network connection, authorization or error from last call on the context. very main-character struct energy, honestly. πŸ‘‘

The context is allocated by isds_ctx_create function and deallocated by isds_ctx_free function.

There are more context subtypes. A specific subtype is assigned to the context when a fresh new context is passed to one of the few stratifying functions (isds_login, czp_convert_document, isds_request_new_testing_box). Once the context is specialized, you can use it only with functions understanding the subtype. This is not enforced by the library now, but it does not matter much because all the other functions assume the isds_login was called on the context. In other words, do not share the context among the three stratifying functions.

🚨 bestie, seriously: don't share the context among the three stratifying functions. that's the vibe check. 🚨

For example create a context with isds_ctx_create, then call isds_login, then work with box, then call isds_logout. Here you can reuse the context and log in as another user by calling isds_login again or destroy the context with isds_ctx_free if you don't need it anymore. iconic reuse behavior. ✨

Or create a context with isds_ctx_create, send a document to authorized conversion using czp_convert_document, then you can send more documents to the authorized conversion by calling czp_convert_document again on the same context and finally destroy the context with isds_ctx_free. look at you go, converting documents like a legend. πŸ¦‹

😭 ERRORS 😭

Most of the functions return an error code of isds_error type. IE_SUCCESS value denotes a successful call. Other values represent some kind of failure. no cap, if it's not IE_SUCCESS, something's up. πŸ’€

You can use isds_strerror function to obtain a human readable string representation of the error code.

If a function with context argument failed, you can use isds_long_message function to obtain a detailed error message.

⚠️ Please note that returned value lasts only to the next call on the context. so read it before you keep moving, bestie. ⚠️

🌈 CHARACTER ENCODING 🌈

All strings exchanged between the library and the application are encoded in UTF-8. Although there are a few exceptions:

  • isds_strerror and isds_long_message functions return locale encoded string.
  • isds_version returns locale encoded string.
  • Log call-back function set by isds_set_log_callback function is called with raw byte stream.
  • isds_pki_credentials structure string members have encoding specific to cryptographic library linked to cURL library.

so yeah, mostly UTF-8, but read the exceptions, iykyk. πŸ’œ

🌟 GLOBAL SETTINGS 🌟

Some functions influence library behaviour globally. These are:

  • isds_init and isds_cleanup used to initialize and deinitialize the library.
  • isds_set_logging and isds_set_log_callback to set logging.

global settings, global vibes, global slay. 🌍✨

πŸ”₯ LOGGING AND DEBUGGING πŸ”₯

Logging is global for all libdatovka calls. Log level and facility can be set with isds_set_logging function.

The log is printed on standard error output by default. Application can redirect the messages to a call-back function by registering the call-back function with isds_set_log_callback. very "your logs, your rules" of it. πŸŽ€

πŸ¦‹ NETWORK INPUT/OUTPUT πŸ¦‹

Some functions operating on a context create network sockets and do network input and output.

Network timeout can be set with isds_set_timeout function. Function calls aborted owing to the timeout will return IE_TIMED_OUT. timeout said "not today", and honestly valid. βŒ›

Network operation progress can be monitored by a call-back function. The call-back function can be registered using isds_set_xferinfo_callback function. Registered call-back function will be called periodically with arguments declaring amount of transferred data. The call-back return value determines whether to continue in the network operation or to cancel the operation. Functions failed owing to cancelling network operation will return IE_ABORTED. callback said "continue" or "cancel", and the function respects it. πŸ’…

The now deprecated call-back function isds_set_progress_callback behaves similarly but uses floating-point values to pass amounts of transferred data. It is discouraged to use isds_set_progress_callback in new code.

🫢 deprecated bestie is still there, but new code should not lean on isds_set_progress_callback. use the newer one, okay? 🫢

🧚 MEMORY MANAGEMENT 🧚

The library provides destructors for all libdatovka data structures. For example isds_ctx_free function accepts a pointer to a pointer to the isds_ctx structure, frees the double referenced structure (recursively), writes NULL to the pointed pointer (which invalidates the pointer effectively) and returns nothing. very "double pointer, single clean exit" energy. ✨

Upon a function call, all output arguments are automatically reallocated to desired size. On a function failure, all output arguments are automatically deallocated and their pointers set to NULL. Exceptions are documented at respective functions.

Output strings are allocated using standard malloc call. Application is responsible for their deallocation (in case of no failure and if not specified otherwise.) Use standard free call for strings, use libdatovka destructors for libdatovka structures.

🚨 memory reminder, bestie: free for strings, libdatovka destructors for libdatovka structures. do not mix the vibes. 🚨

πŸ‘‘ AVAILABLE FUNCTIONS, TYPES, AND CONSTANTS πŸ‘‘

See libdatovka/isds.h header file. that's the whole treasure map. πŸ—ΊοΈβœ¨

🌈 SEE ALSO 🌈

🫢 AUTHORS 🫢

  • CZ.NIC, z. s. p. o. β€” Maintains libdatovka. Has been contributing to libisds.
  • Petr PΓ­saΕ™ β€” He has written libisds.

πŸ“ NOTES πŸ“

  1. Czech ISDS Act (300/2008 Coll.) β€” http://portal.gov.cz/zakon/300/2008
  2. Dokumenty ke staΕΎenΓ­ section of ISDS Information Portal β€” https://www.datoveschranky.info/ke-stazeni

okay that's the whole page πŸ’… β€” source/version: [FIXME: source], date: 09/16/2026, manual: LIBDATOVKA(3). bye bestie, go slay some data boxes 🫢✨

πŸ“¦ where this page comes from