ThingWorx C SDK
twWindows.h File Reference

Wrappers for Windows-specific functionality using AxTLS. More...

#include "winsock2.h"
#include "windows.h"
#include "conio.h"
#include "stdio.h"

Go to the source code of this file.

Macros

TLS Library
#define TW_TLS_INCLUDE   "twAxTls.h"
 Define which pluggable TLS library is used. More...
 
Logging
#define TW_LOGGER_BUF_SIZE   4096
 The maximum size of the log buffer.
 
#define TW_LOG(level, fmt, ...)   twLog(level, fmt, ##__VA_ARGS__)
 
#define TW_LOG_HEX(msg, preamble, length)   twLogHexString(msg, preamble, length)
 
#define TW_LOG_MSG(msg, preamble)   twLogMessage(msg, preamble)
 
Sockets
#define IPV4   AF_INET
 
#define IPV6   AF_INET6
 
#define TW_SOCKET_TYPE   int
 
#define TW_ADDR_INFO   struct addrinfo
 
Tasks
#define TICKS_PER_MSEC   1
 
Memory
#define TW_MALLOC(a)   malloc(a)
 
#define TW_CALLOC(a, b)   calloc(a,b)
 
#define TW_REALLOC(a, b)   realloc(a, b)
 
#define TW_FREE(a)   free(a)
 
Threads
#define TW_THREAD_ID   HANDLE
 
Misc
#define INLINE   __forceinline
 Use __forceinline (VC++ specific).
 
#define snprintf   _snprintf
 

Proxies

#define ENABLE_HTTP_PROXY_SUPPORT
 
#define USE_NTLM_PROXY
 
#define TW_MUTEX   LPHANDLE
 For Windows builds TW_MUTEX is a LPHANDLE.
 
typedef DWORD64 DATETIME
 Date/time definition.
 

File Transfer

#define TW_FILE_HANDLE   FILE*
 
#define TW_FILE_DELIM   '\\'
 
#define TW_FILE_DELIM_STR   "\\"
 
#define TW_FILE_CASE_SENSITVE   FALSE
 
#define TW_DIR   HANDLE
 
#define TW_FOPEN(a, b)   win_fopen(a,b)
 
#define TW_FCLOSE(a)   fclose(a)
 
#define TW_FREAD(a, b, c, d)   fread(a,b,c,d)
 
#define TW_FWRITE(a, b, c, d)   fwrite(a,b,c,d)
 
#define TW_FSEEK(a, b, c)   _fseeki64(a,b,c)
 
#define TW_FTELL(a)   _ftelli64(a)
 
#define TW_FERROR(a)   ferror(a)
 
TW_FILE_HANDLE win_fopen (const char *name, const char *mode)
 

Detailed Description

Wrappers for Windows-specific functionality using AxTLS.

Macro Definition Documentation

#define TW_TLS_INCLUDE   "twAxTls.h"

Define which pluggable TLS library is used.

Note
The NO_TLS option turns off encryption altogether which may be useful for debugging but is also not recommended for production environments as it may introduce serious security risks.