MCPcopy Create free account
hub / github.com/defold/defold / AppendStatusLine

Function AppendStatusLine

engine/hid/src/test/test_app_hid.cpp:185–207  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

183}
184
185static void AppendStatusLine(char* buffer, uint32_t buffer_size, uint32_t* offset, const char* format, ...)
186{
187 if (*offset >= buffer_size)
188 return;
189
190 va_list args;
191 va_start(args, format);
192 int written = vsnprintf(buffer + *offset, buffer_size - *offset, format, args);
193 va_end(args);
194
195 if (written < 0)
196 return;
197
198 uint32_t written_count = (uint32_t)written;
199 if (written_count >= (buffer_size - *offset))
200 {
201 *offset = buffer_size - 1;
202 buffer[buffer_size - 1] = '\0';
203 return;
204 }
205
206 *offset += written_count;
207}
208
209static void AppendKeyboardStatus(char* buffer, uint32_t buffer_size, uint32_t* offset, int keyboard_index, dmHID::KeyboardPacket* packet)
210{

Callers 3

AppendKeyboardStatusFunction · 0.85
AppendGamepadStatusFunction · 0.85
EngineUpdateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected