ThingWorx C SDK
Main Page
Classes
Files
File List
File Members
src
porting
twLinux.h
Go to the documentation of this file.
1
/***************************************
2
* Copyright (C) 2015 ThingWorx Inc. *
3
***************************************/
4
10
#ifndef TW_LINUX_H
11
#define TW_LINUX_H
12
13
#include <sys/types.h>
14
#include <sys/socket.h>
15
#include <netdb.h>
16
#include <dirent.h>
17
#include <stdio.h>
18
29
#define TW_TLS_INCLUDE "twAxTls.h"
30
34
#ifndef TW_LEAN_AND_MEAN
35
38
#define TW_LOGGER_BUF_SIZE 4096
39
#define TW_LOG(level, fmt, ...) twLog(level, fmt, ##__VA_ARGS__)
40
#define TW_LOG_HEX(msg, preamble, length) twLogHexString(msg, preamble, length)
41
#define TW_LOG_MSG(msg, preamble) twLogMessage(msg, preamble)
42
46
#ifndef ENABLE_HTTP_PROXY_SUPPORT
47
#define ENABLE_HTTP_PROXY_SUPPORT
48
#endif
49
#ifndef USE_NTLM_PROXY
50
#define USE_NTLM_PROXY
51
#endif
52
53
#else
/* LEAN AND MEAN */
54
60
#define TW_LOGGER_BUF_SIZE 1
61
#define TW_LOG(level, fmt, ...)
62
#define TW_LOG_HEX(msg, preamble, length)
63
#define TW_LOG_MSG(msg, preamble)
64
65
#undef OFFLINE_MSG_STORE
66
#define OFFLINE_MSG_STORE 0
67
#undef ENABLE_HTTP_PROXY_SUPPORT
68
#undef USE_NTLM_PROXY
69
#undef ENABLE_FILE_XFER
70
#undef ENABLE_TUNNELING
71
#endif
72
76
typedef
uint64_t
DATETIME
;
77
81
#define TW_MUTEX pthread_mutex_t *
82
86
#define IPV4 AF_INET
87
#define IPV6 AF_INET6
88
#define TW_SOCKET_TYPE int
89
#define TW_ADDR_INFO struct addrinfo
90
#ifndef TW_HINTS
91
#define TW_HINTS PF_UNSPEC
92
#endif
93
97
#define TICKS_PER_MSEC 1
98
102
#define TW_MALLOC(a) malloc(a)
103
#define TW_CALLOC(a, b) calloc(a,b)
104
#define TW_REALLOC(a, b) realloc(a, b)
105
#define TW_FREE(a) free(a)
106
110
#define TW_FOPEN(a,b) fopen(a,b)
111
#define TW_FCLOSE(a) fclose(a)
112
#define TW_FREAD(a,b,c,d) fread(a,b,c,d)
113
#define TW_FWRITE(a,b,c,d) fwrite(a,b,c,d)
114
#define TW_FSEEK(a,b,c) fseeko(a,b,c)
115
#define TW_FERROR(a) ferror(a)
116
#define TW_FTELL(a) ftell(a)
117
118
#define TW_FILE_HANDLE FILE*
119
#define TW_FILE_DELIM '/'
120
#define TW_FILE_DELIM_STR "/"
121
#define TW_FILE_CASE_SENSITVE TRUE
122
#define TW_DIR DIR *
123
#define ERROR_NO_MORE_FILES 0
124
128
#define TW_THREAD_ID pthread_t
129
133
#define INLINE
134
#ifndef OS_IOS
135
136
char
getch();
137
138
#endif
139
140
#if defined (__APPLE__) && (__MACH__)
141
#include <sys/syslimits.h>
142
#endif
143
144
#endif
DATETIME
uint64_t DATETIME
Date/time type definition.
Definition:
twLinux.h:76
Generated on Sat Sep 12 2015 00:38:47 for ThingWorx C SDK by
1.8.9.1