~glhrmfrts/hcs-sdk-c

HCS SDK in C
fix hcs_exam_set_async
Merge branch 'master' of ssh://git.sr.ht/~glhrmfrts/hcs-sdk-c
async version of hcs_exam_timeline_set

clone

read-only
https://git.sr.ht/~glhrmfrts/hcs-sdk-c
read/write
git@git.sr.ht:~glhrmfrts/hcs-sdk-c

You can also use your local clone with git send-email.

#hcs-sdk-c

HCS SDK in gnu99 C

#Building

First, fetch submodules:

$ git submodule init && git submodule update --init --recursive && git submodule update --recursive

Then create build dir and run cmake:

$ mkdir build && cd build && cmake ..

The project will build a shared library by default, if a static library is desired, add -DBUILD_STATIC=ON to cmake command.

If you want to build the tests, add -DBUILD_TESTS=ON to cmake command.

To build the library run the makefile:

$ make

#How to use

hcs_client_t hcs;
hcs_error_t err;

// Initialize the client and configure the host, port and operator name
hcs_init(&hcs, "HOST", "PORT", "OPERATOR_NAME");

// Actually connects to the server
err = hcs_connect(&hcs);
if (err) {
    fprintf(stderr, "Connect error: %s\n", hcs_error_to_string(err));
    return 1;
}

// Waits for the first announce to be able to make further calls
err = hcs_wait_announce(&hcs);
if (err) {
    fprintf(stderr, "Announce error: %s\n", hcs_error_to_string(err));
    return 1;
}

// We are free to make API calls now...

err = hcs_user_auth(&hcs, "USERNAME", "TOTP");
if (err) {
    fprintf(stderr, "Auth error: %s\n", hcs_error_to_string(err));
    return 1;
}

raid_writer_t w;
raid_writer_init(&w, &hcs->raid);
raid_write_int(&w, 42);
err = hcs_user_set(&hcs, "INT_PROPERTY", &w);
if (err) {}

// When not needed anymore, clean everything up
raid_writer_destroy(&w);
hcs_destroy(&hcs);

#API Reference

HCS API reference: http://nemethg.xyz/docs/hcs-sdk-c/hcs_8h.html

RAID API reference: http://nemethg.xyz/docs/raid-c/raid_8h.html

You can see all the backend API actions here: https://gopher.commons.host/gopher://umgeher.org/1/utos/man

#License

ISC