2024-09-14 04:21:05 +00:00
|
|
|
#ifndef MIQT_BINDING_H
|
|
|
|
#define MIQT_BINDING_H
|
2024-09-12 06:47:31 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// miqt_exec_callback calls a Go function pointer for a connect() slot.
|
|
|
|
// The function is defined in Go.
|
|
|
|
void miqt_exec_callback(void* cb, int argc, void* argv);
|
|
|
|
|
2024-09-12 06:48:06 +00:00
|
|
|
struct miqt_string {
|
|
|
|
size_t len;
|
2024-09-14 04:21:05 +00:00
|
|
|
char data; // Data continues after this element, all in the same allocation
|
|
|
|
};
|
2024-09-12 06:48:06 +00:00
|
|
|
|
|
|
|
struct miqt_array {
|
|
|
|
size_t len;
|
2024-09-14 04:21:05 +00:00
|
|
|
void* data; // Separate, second allocation
|
|
|
|
};
|
2024-09-12 06:48:06 +00:00
|
|
|
|
|
|
|
// miqt_strdup allocates a miqt_string and copies C data into it.
|
|
|
|
// The function is defined in C++.
|
|
|
|
struct miqt_string* miqt_strdup(const char* src, size_t len);
|
|
|
|
|
2024-09-12 06:47:31 +00:00
|
|
|
#ifdef __cplusplus
|
2024-09-14 04:21:05 +00:00
|
|
|
}
|
2024-09-12 06:47:31 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|