/* Context of the CLI interface */
typedef struct _TBX_CLI_TOOLS_CLI_CONTEXT
{
TBX_CLI_TOOLS_INIT_PARAMS Params;
/* Display buffer and log file */
TBX_BOOL fPrintAllowed;
TBX_BOOL fFirstRunDone;
PTBX_CLI_TOOLS_DISPLAY_BUFFER pDisplayBuf;
PTBX_CLI_TOOLS_DISPLAY_BUFFER pPrevDisplayBuf;
PTBX_UINT8 pafEscapeChars;
#ifdef TBX_CLI_TOOLS_USE_LOG_FILE
FILE* pLogFile;
TBX_CHAR szCurrentLogFileTime[ 64 ];
TBX_CHAR szCurrentLogFilePath[ 512 ];
TBX_UINT32 un32CurrentLogFileSize;
TBX_UINT32 un32CurrentLogFileSegment;
#endif
/* Buffer to gather user input */
TBX_CLI_TOOLS_CMD_PRIVATE CmdInput;
/* Timestamps and other flags used for display */
TBX_UINT32 un32LastRefreshTimestamp;
TBX_BOOL fRefreshRequired;
TBX_BOOL fKeyPressedRefreshRequired;
TBX_BOOL fClsRequired;
TBX_BOOL fImmediateValidation;
TBX_BOOL fNoWrap;
TBX_UINT32 un32ScrollPositionMax; /* Current maximum scroll position */
TBX_UINT32 un32ScrollPosition;
TBX_UINT32 un32ScrollPositionHor; /* Horizontal scroll position */
TBX_UINT32 un32ScrollSpeed;
TBX_UINT32 un32ScrollSpeedTimestamp;
TBX_UINT32 un32ScrollSpeedAccelerateTimestamp;
TBX_UINT32 un32NbLogLinesDisplayed;
TBX_UINT32 un32SelectedLineToBlink;
TBX_UINT32 un32CheckpointCounter;
TBX_UINT32 un32RefreshCounter;
TBX_UINT32 un32BlinkCounter;
TBX_UINT32 un32BlinkTimestamp;
/* Circular buffer log */
TBX_BOOL fCircularLogFull;
TBX_UINT32 un32CircularLogNextLineIndex;
TBX_UINT32 un32CircularLogCurrentNbLines;
TBX_UINT32 un32LastLogDisplayNbLines;
PTBX_CLI_TOOLS_DISPLAY_LINE_PRIVATE paCircularLog;
PTBX_UINT8 pafCircularLogCheckpoints;
PTBX_CHAR pszTmpLine;
#ifdef TBX_CLI_TOOLS_USE_LOG_FILE
/* Disk write buffer */
PTBX_CHAR pszDiskWriteBuffer;
TBX_UINT32 un32DiskWriteBufferCurLen;
TBX_UINT32 un32DiskWriteBufferTimestamp;
#endif
/* Fifo of 'forced' keys */
TBX_INT aForcedKeysFifo[ TBX_CLI_TOOLS_MAX_FORCED_KEYS ];
TBX_UINT32 un32ForcedKeysFifoPopIndex;
TBX_UINT32 un32ForcedKeysFifoCount;
/* Status of the usage of hostlib */
TBX_BOOL fUseHostlib;
TBX_BOOL fHostlibInUse;
/* Hostlib message to send remote screen updates */
TBX_BOOL fGenerateRemoteScreen;
TBX_MSG_HANDLE hEvtRemoteScreen;
PTBX_CLI_TOOLS_EVT_NOTIF_CLI_TOOLS_SCREEN_UPDATE pEvtRemoteScreen;
TBX_UINT32 un32EvtRemoteScreenMaxStrlen;
TBX_UINT32 un32RemoteCurrentWidth;
TBX_UINT32 un32RemoteCurrentHeight;
TBX_UINT32 un32RemoteClsTimestamp;
TBX_UINT32 un32RemotePollTimestamp;
TBX_UINT32 un32LastRemoteRefreshSendTimestamp;
TBX_HOST_INFO RemoteControllingHostInfo;
TBX_BOOL fActuallyRemoteControlled;
TBX_BOOL fRemoteRefreshRequested;
/* Used when remote controlling other host */
TBX_FILTER_HANDLE hRemoteScreenFilter;
/* Array of detected remote hosts */
TBX_CLI_TOOLS_REMOTE_HOST_CTX aRemoteScreenHosts[ TBX_CLI_TOOLS_MAX_REMOTE_SCREEN_HOSTS ];
TBX_UINT32 un32RemoteScreenCurrentIdx;
TBX_UINT32 un32LastEscapePressedTimestamp;
TBX_CHAR szRemoteScreenHostName [TBX_API_NAME_MAX_LEN];
TBX_CHAR szRemoteScreenApplicationName [TBX_API_NAME_MAX_LEN];
/* Threads and semaphores */
TBX_CLI_TOOLS_THREAD_CONTEXT CliThreadContext;
TBX_MUTEX Mutex;
TBX_UINT32 un32StartTimestamp;
TBX_UINT32 un32CurrentTimestamp;
} TBX_CLI_TOOLS_CLI_CONTEXT, *PTBX_CLI_TOOLS_CLI_CONTEXT;this