2024-09-14 04:21:05 +00:00
|
|
|
#ifndef MIQT_BINDING_H
|
|
|
|
#define MIQT_BINDING_H
|
2024-09-12 06:47:31 +00:00
|
|
|
|
2024-10-16 05:05:07 +00:00
|
|
|
#include <string.h>
|
|
|
|
#include <stdlib.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;
|
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
|
|
|
|
|
|
|
struct miqt_string* miqt_strdup(const char* src, size_t len);
|
|
|
|
|
2024-10-16 05:05:07 +00:00
|
|
|
typedef const char const_char;
|
|
|
|
|
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
|