aboutsummaryrefslogtreecommitdiff
path: root/libs/steam_appinfo_ffi/include
diff options
context:
space:
mode:
Diffstat (limited to 'libs/steam_appinfo_ffi/include')
-rw-r--r--libs/steam_appinfo_ffi/include/steam_appinfo_ffi.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/libs/steam_appinfo_ffi/include/steam_appinfo_ffi.h b/libs/steam_appinfo_ffi/include/steam_appinfo_ffi.h
new file mode 100644
index 0000000..be53999
--- /dev/null
+++ b/libs/steam_appinfo_ffi/include/steam_appinfo_ffi.h
@@ -0,0 +1,24 @@
+#ifndef MO2_STEAM_APPINFO_FFI_H
+#define MO2_STEAM_APPINFO_FFI_H
+
+#include <stdint.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/// Callback invoked once per app in appinfo.vdf. Strings are valid for the
+/// duration of the call only — copy if you want to keep them.
+typedef void (*SteamAppInfoCallback)(void* user, uint32_t appid,
+ const char* type, const char* name);
+
+/// Parse Steam's appinfo.vdf at `path` and invoke `cb` for every app.
+/// Returns 0 on success, negative on error.
+int32_t steam_appinfo_parse(const char* path, void* user,
+ SteamAppInfoCallback cb);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // MO2_STEAM_APPINFO_FFI_H