deps/obs-scripting: Add scripting support

Allows Lua/Python scripting support.
This commit is contained in:
jp9000
2018-01-04 11:37:42 -08:00
parent fd9e5d45a3
commit 9eabfdbf1e
25 changed files with 6559 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
#include <unordered_map>
#include <string>
#include "cstrcache.h"
using namespace std;
struct const_string_table {
unordered_map<string, string> strings;
};
static struct const_string_table table;
const char *cstrcache_get(const char *str)
{
if (!str || !*str)
return "";
auto &strings = table.strings;
auto pair = strings.find(str);
if (pair == strings.end()) {
strings[str] = str;
pair = strings.find(str);
}
return pair->second.c_str();
}