| 41 | } |
| 42 | |
| 43 | static int SendToOpenKneeboard(lua_State* state) { |
| 44 | OPENKNEEBOARD_TraceLoggingScopedActivity(activity, "SendToOpenKneeboard"); |
| 45 | int argc = lua_gettop(state); |
| 46 | if (argc != 2) { |
| 47 | dprint("Invalid argument count\n"); |
| 48 | push_arg_error(state); |
| 49 | activity.StopWithResult("InvalidArgs"); |
| 50 | return 1; |
| 51 | } |
| 52 | |
| 53 | if (!(lua_isstring(state, 1) && lua_isstring(state, 2))) { |
| 54 | dprint("Non-string args\n"); |
| 55 | push_arg_error(state); |
| 56 | activity.StopWithResult("NonStringArgs"); |
| 57 | return 1; |
| 58 | } |
| 59 | |
| 60 | const OpenKneeboard::APIEvent event { |
| 61 | lua_tostring(state, 1), |
| 62 | lua_tostring(state, 2), |
| 63 | }; |
| 64 | event.Send(); |
| 65 | |
| 66 | return 0; |
| 67 | } |
| 68 | |
| 69 | extern "C" int __declspec(dllexport) |
| 70 | #if UINTPTR_MAX == UINT64_MAX |
nothing calls this directly
no test coverage detected