aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2020-10-16 03:49:52 +0200
committerdec05eba <dec05eba@protonmail.com>2020-10-16 03:49:52 +0200
commit66a97007eb36a112f31e923c20e434ba8b39c4ba (patch)
tree026d4dd8dafe0d807e5480d538fa17a981b64508 /include
parentc23ceac642ea95081a239c7af9f882082addb8c1 (diff)
Matrix: use rapidjson instead of jsoncpp to decrease memory usage from 58mb to 24mb
Diffstat (limited to 'include')
-rw-r--r--include/Program.h4
-rw-r--r--include/Storage.hpp5
2 files changed, 7 insertions, 2 deletions
diff --git a/include/Program.h b/include/Program.h
index cd45b30..3cbf09e 100644
--- a/include/Program.h
+++ b/include/Program.h
@@ -2,7 +2,6 @@
#define QUICKMEDIA_PROGRAM_H
#include <sys/types.h>
-#include <stdbool.h>
#ifdef __cplusplus
extern "C" {
@@ -26,7 +25,8 @@ int exec_program(const char **args, ProgramOutputCallback output_callback, void
// Return the exit status, or a negative value if waiting failed
int wait_program(pid_t process_id);
-bool wait_program_non_blocking(pid_t process_id, int *status);
+/* Returns 1 if the program quit and exited properly (non-0 exit codes also count as exiting properly) */
+int wait_program_non_blocking(pid_t process_id, int *status);
/*
@args need to have at least 2 arguments. The first which is the program name
diff --git a/include/Storage.hpp b/include/Storage.hpp
index 8a1bbfa..10cbbb2 100644
--- a/include/Storage.hpp
+++ b/include/Storage.hpp
@@ -4,6 +4,10 @@
#include <functional>
#include <filesystem>
#include <json/value.h>
+#ifdef Bool
+#undef Bool
+#endif
+#include <rapidjson/document.h>
namespace QuickMedia {
// Return false to stop the iterator
@@ -29,6 +33,7 @@ namespace QuickMedia {
bool read_file_as_json(const Path &filepath, Json::Value &result);
bool save_json_to_file_atomic(const Path &path, const Json::Value &json);
+ bool save_json_to_file_atomic(const Path &path, const rapidjson::Value &json);
bool is_program_executable_by_name(const char *name);
} \ No newline at end of file