Add support for using a callback for writing debug messages

This commit is contained in:
Cameron Gutman
2014-10-31 22:27:18 -07:00
parent 7fb3ef3f79
commit 058ad2df23
7 changed files with 24 additions and 22 deletions

View File

@@ -4,7 +4,9 @@
static int stage = STAGE_NONE;
static CONNECTION_LISTENER_CALLBACKS listenerCallbacks;
static CONNECTION_LISTENER_CALLBACKS originalCallbacks;
static PLATFORM_CALLBACKS platformCallbacks;
// This is used for debug prints so it's not declared static
PLATFORM_CALLBACKS platformCallbacks;
static int alreadyTerminated;
@@ -161,13 +163,13 @@ int LiStartConnection(IP_ADDRESS host, PSTREAM_CONFIGURATION streamConfig, PCONN
Limelog("Initializing platform...");
listenerCallbacks.stageStarting(STAGE_PLATFORM_INIT);
err = initializePlatformSockets(&platformCallbacks);
err = initializePlatformSockets();
if (err != 0) {
Limelog("failed: %d\n", err);
listenerCallbacks.stageFailed(STAGE_PLATFORM_INIT, err);
goto Cleanup;
}
err = initializePlatformThreads(&platformCallbacks);
err = initializePlatformThreads();
if (err != 0) {
Limelog("failed: %d\n", err);
listenerCallbacks.stageFailed(STAGE_PLATFORM_INIT, err);