miqt/qt/binding.h

27 lines
495 B
C
Raw Normal View History

#ifndef MIQT_BINDING_H
#define MIQT_BINDING_H
2024-09-12 06:47:31 +00:00
#ifdef __cplusplus
extern "C" {
#endif
2024-09-12 06:48:06 +00:00
struct miqt_string {
size_t len;
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;
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-12 06:47:31 +00:00
#endif
#endif