MCPcopy Create free account
hub / github.com/Warzone2100/warzone2100 / wz_command_interface_output_str

Function wz_command_interface_output_str

src/stdinreader.cpp:1527–1552  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1525}
1526
1527void wz_command_interface_output_str(const char *str)
1528{
1529 if (wz_command_interface() == WZ_Command_Interface::None)
1530 {
1531 return;
1532 }
1533
1534 size_t bufferLen = strlen(str);
1535 if (bufferLen == 0)
1536 {
1537 return;
1538 }
1539
1540 if (wz_command_interface() == WZ_Command_Interface::StdIn_Interface)
1541 {
1542 fwrite(str, sizeof(char), bufferLen, stderr);
1543 fflush(stderr);
1544 }
1545 else
1546 {
1547 latestWriteBuffer.insert(latestWriteBuffer.end(), str, str + bufferLen);
1548 cmdInterfaceOutputQueue->enqueue(std::move(latestWriteBuffer));
1549 latestWriteBuffer = std::vector<char>();
1550 latestWriteBuffer.reserve(maxReserveMessageBufferSize);
1551 }
1552}
1553
1554void wz_command_interface_output(const char *str, ...)
1555{

Callers 3

outputLineMethod · 0.85

Calls 5

wz_command_interfaceFunction · 0.85
enqueueMethod · 0.80
insertMethod · 0.45
endMethod · 0.45
reserveMethod · 0.45

Tested by

no test coverage detected