-
Notifications
You must be signed in to change notification settings - Fork 64
/
gdk_rust.h
54 lines (44 loc) · 1.32 KB
/
gdk_rust.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#ifndef GDK_GDK_RUST_H
#define GDK_GDK_RUST_H
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
/** A notification handler */
typedef void (*GDKRUST_notification_handler)(void *self_context, char *details);
/**
* Create a new session.
*
* :param session: Destination for the resulting session.
*| Returned session should be freed using `GDKRUST_destroy_session`.
*/
int GDKRUST_create_session(void* session, const char* network);
int GDKRUST_call_session(void* session, const char *method, const char *input, char** output);
/**
* A collection of stateless functions
*
* :param method: The function name.
* :param input: The json input to pass to the function.
* :param output: The json output, should be freed using `GDKRUST_destroy_string`.
*/
int GDKRUST_call(const char *method, const char *input, char** output);
/**
* Set a handler to be called when notifications arrive.
*/
int GDKRUST_set_notification_handler(void* session, GDKRUST_notification_handler handler, void *self_context);
/**
* Free a string returned by the api.
*
* :param str: The string to free.
*/
void GDKRUST_destroy_string(char* str);
/**
* Free a session created by the api.
*
* :param session: The session to free.
*/
void GDKRUST_destroy_session(void* session);
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* GDK_GDK_RUST_H */