miqt/qt/binding.cpp

12 lines
283 B
C++
Raw Normal View History

2024-09-12 06:48:06 +00:00
#include <string.h>
#include <stdlib.h>
#include "binding.h"
struct miqt_string* miqt_strdup(const char* src, size_t len) {
struct miqt_string* ret = (struct miqt_string*)( malloc(len + sizeof(size_t)) );
ret->len = len;
memcpy(&ret->data, src, len);
2024-09-12 06:48:06 +00:00
return ret;
}