diff include/animone/strategies.h @ 31:668f4f31ddda

strategist: outward APIs are now in C
author Paper <paper@tflc.us>
date Mon, 10 Feb 2025 00:07:21 -0500
parents 27b988a1048c
children
line wrap: on
line diff
--- a/include/animone/strategies.h	Sun Feb 09 23:18:57 2025 -0500
+++ b/include/animone/strategies.h	Mon Feb 10 00:07:21 2025 -0500
@@ -2,12 +2,37 @@
 #define ANIMONE_ANIMONE_STRATEGIES_H_
 
 #include "animone.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int animone_internal_ApplyStrategies(animone::Result *results, size_t results_size);
+
+#ifdef __cplusplus
+}
+
+#include <cstdlib>
 #include <vector>
 
 namespace animone::internal {
 
-bool ApplyStrategies(std::vector<Result>& results);
+inline bool ApplyStrategies(std::vector<Result>& results)
+{
+	Result *results_c;
+	size_t results_size_c;
+
+	int x = ::animone_internal_ApplyStrategies(results_c, results_size_c);
+
+	results.assign(results_c, results_c + results_size_c);
+
+	std::free(results_c);
+
+	return x;
+}
 
 }
 
+#endif // defined(__cplusplus)
+
 #endif // ANIMONE_ANIMONE_STRATEGIES_H_
\ No newline at end of file