#ifdef WIN32
#include <windows.h>
#else
#include <unistd.h>
#endif
static void Exithandler(int sig);
#ifdef WIN32
BOOL WINAPI ConsoleHandler(DWORD CEvent)
{
Exithandler(CEvent);
return TRUE;
}
#endif
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
static void Exithandler(int sig)
{
exit(0);
}
void PrintLastErrorMessage()
{
char* last_error_message = NULL;
{
last_error_message = "Failed to allocate memory error.";
}
printf("last error message: %s \n", last_error_message);
}
{
{
PrintLastErrorMessage();
exit(status);
}
}
int main(int argc, char *argv[])
{
#ifdef WIN32
SetConsoleCtrlHandler((PHANDLER_ROUTINE)ConsoleHandler, TRUE);
#else
signal(SIGTERM, Exithandler);
signal(SIGKILL, Exithandler);
signal(SIGQUIT, Exithandler);
signal(SIGINT, Exithandler);
#endif
#ifdef WIN32
#else
CheckErrorCode(
pst_tracker_init4(&ctracker,
"",
"config.cfg",
"models.db", argv[1]));
#endif
printf("Shared memory server initialized. Start the PST Client application to create a connection.\n");
#ifdef WIN32
Sleep(60000);
#else
sleep(60);
#endif
return 0;
}
EPstErrorStatus pst_tracker_init(PstTracker *ctracker)
This function initializes the tracker object.
EPstErrorStatus pst_alloc_and_get_last_error_message(char **cstring)
This function returns the last error message that was recorded by the system.
EPstErrorStatus pst_tracker_init4(PstTracker *ctracker, const char path[], const char config_file[], const char db_file[], const char grabber_name[])
This function initializes the tracker object.
void pst_tracker_destroy(PstTracker *ctracker)
void pst_sdk_shutdown()
Shutdown the tracking system, stopping tracking.
void pst_sdk_disable_shared_memory()
Disable shared memory communication layer.
void pst_free(void *data)
Free data allocated by the PST SDK.
EPstErrorStatus pst_tracker_start(PstTracker *ctracker)
Start tracking.
EPstErrorStatus pst_sdk_enable_shared_memory()
Enable shared memory communication layer.
EPstErrorStatus
Tracker error messages enum class.
Definition pstsdk_c.h:44
@ PST_ERROR_STATUS_OK
Definition pstsdk_c.h:45
Main PST SDK struct for tracker communication.
Definition pstsdk_c.h:264