info about shared memory, calls, events and log files.

This commit is contained in:
2026-03-27 00:15:23 +01:00
parent 8357960a6b
commit 8349b65a83
17 changed files with 205 additions and 78 deletions

View File

@@ -2,6 +2,7 @@
#define UTILS_H
#include <string>
#include "rktwebview_types.h"
inline std::string basedir(const std::string &path)
{
@@ -56,4 +57,24 @@ const char *logIndicator(int l);
#define INFO2(msg, a, b) MKL2(LOG_INFO, msg, a, b)
#define DEBUG2(msg, a, b) MKL2(LOG_DEBUG, msg, a, b)
inline void do_free_data(rkt_data_t *d)
{
if (d == nullptr) { return; }
if (d->kind == version) {
free(d);
} else if (d->kind == metrics) {
free(d->data.metrics.log_file);
free(d);
} else if (d->kind == event) {
free(d->data.event.event);
free(d);
} else if (d->kind == js_result) {
free(d->data.js_result.value);
free(d);
} else {
ERROR1("UNEXPECTED: data kind %d cannot be freed\n", d->kind);
}
}
#endif // UTILS_H