16 #if _MSC_VER == 1400 //VC8
17 #if _SECURE_SCL != 0 || _HAS_ITERATOR_DEBUGGING != 0
18 #error Compiler Flags do not match! Do not use _SECURE_SCL or _HAS_ITERATOR_DEBUGGING
19 #endif // _SECURE_SCL != 0 || _HAS_ITERATOR_DEBUGGING != 0
20 #endif //_MSC_VER == 1400
25 #ifndef VLCONFIG_INCLUDED_H_
52 #include <sys/types.h>
58 #if DT_FD_ZERO_USES_MEMSET
62 #if DT_HAVE_BZERO_PROTO_IN_MEMORY_H
64 #elif DT_HAVE_BZERO_PROTO_IN_CC_LIBC_H
66 #elif DT_HAVE_BZERO_PROTO_IN_BSTRING_H
71 void bzero(
char* b,
int length );
85 #ifdef DtUSE_UTILITIES_NAMESPACE
86 namespace DtUSE_UTILITIES_NAMESPACE
98 #define DtDELETE_VOID(x, cast) \
101 cast* toDelete = reinterpret_cast<cast*>(x); \
108 #define DtISON(a, x) (a & x)
109 #define DtISOFF(a, x) (!DtISON(a, x))
110 #define DtTURNON(a, x) (a |= x)
111 #define DtTURNOFF(a, x) (a &= ~x)
115 #define DtNUMBER(foo) (sizeof(foo)/sizeof(foo[0]))
116 #define DtOFFSET(type, field) ((size_t)&((type *)NULL)->field)
117 #define DtSIZEOF(type, field) sizeof(((type *)NULL)->field)
126 return (
int)ceil( (
float)num / (
float)mult ) * mult;
135 #define DtATOI(s) ((int)(strtoul(s, 0, 0)))
137 #define DtATOI(s) (int)strtol(s, 0, 0)
179 if ( fd >= 0 ) closesocket( fd );
186 if ( fd >= 0 ) close( fd );
205 return DtSelect( maxfd+1, &read, NULL, NULL, timeout );
209 FD_SET( (
unsigned int)fd, &read0 );
210 maxfd =
DtMax( maxfd, fd );
214 FD_CLR( (
unsigned int)fd, &read0 );
219 return ( (
int)( FD_ISSET( (
unsigned int)fd, &read ) ) );
284 if (alignment > 1 && value != (value&alignMask))
300 return reinterpret_cast<void*
>(
alignValue(value, alignment));
305 return reinterpret_cast<void*
>(
alignValue(value, alignment));
316 padding = (~value)+1;
317 padding &= (alignment-1);
335 #if DT_NO_CASECOMPARE
336 DT_DLL_VLUTIL int strcasecmp(
const char* strA,
const char* strB );
362 #define DT_VXWORKS_APP(name) \
363 int main(int argc, char** argv); \
364 int name(char* cmdLine) \
366 return realMain(DtArgc(cmdLine), DtArgv(cmdLine)); \
372 unsigned char * ptr,
unsigned int bytes );
375 #ifdef DtUSE_UTILITIES_NAMESPACE
DtString DtToLower(const char *)
This function returns a new lowercase DtString.
Definition: vlStringUtil.h:180
DtU32 DtIpv4Addr
Definition: vlUtil.h:245
fd_set read
Definition: vlUtil.h:225
int select(DtTime timeout)
Definition: vlUtil.h:202
int DtIsInList(const int *lst, int num)
Returns -1 if num is not in lst.
This file contains the declaration of DtClock and DtTime.
T DtMax(T x, T y)
Returns what ever is greater, x or y of type T.
Definition: vlUtil.h:143
DtMachineSize alignedPtrPadding(const void *ptr, DtMachineSize alignment)
Return the # padding bytes necessary to align the given pointer to the given byte alignment (in bytes...
Definition: vlUtil.h:324
int maxfd
Definition: vlUtil.h:223
void addRead(int fd)
Definition: vlUtil.h:207
const DtIpv4Addr loopbackAddr
Definition: vlUtil.h:251
DtIpv4Addr DtStringToInetAddr(const char *str)
Converts to internet dot notation to ulong in host order.
void printHexToStream(std::ostream &stream, unsigned int numberOfColumns, unsigned char *ptr, unsigned int bytes)
Prints Hex to a stream based on an address and the bytes.
int DtArgc(char *cmdLine)
Convert a command line (single string with args separated by spaces) to argv, argc format...
const char * DtInetAddrString(DtIpv4Addr addr)
Converts ulong to internet dot notation (returns internal static buffer).
int DtSelect(int n, fd_set *i, fd_set *o, fd_set *e, DtTime t)
const void * alignPtr(const void *ptr, DtMachineSize alignment)
Adjust the given pointer to the given byte alignment (in bytes)
Definition: vlUtil.h:297
char * DtStrdup(const char *str)
Strdup wrapper.
DtMachineSize alignValue(DtMachineSize value, DtMachineSize alignment)
Adjust the given value to the nearest multiple of the given alignment Efficient means to determine by...
Definition: vlUtil.h:279
int canRead(int fd)
Definition: vlUtil.h:217
DtIpv4Addr DtHexStringToInetAddr(const char *str)
Converts to internet dot notation to ulong in host order.
char * DtDeg2DmsString(double val, char *buff, int prec)
DtString DtToUpper(const char *)
This function returns a new uppercase DtString.
Definition: vlStringUtil.h:194
int DtGetPid()
Returns the process ID for the running process.
void delRead(int fd)
Definition: vlUtil.h:212
int DtResizeString(char *&buf, int &oldLn, int newLn)
For VXWORKS.
char ** DtArgv(char *cmdLine, int *argc=NULL)
DtMachineSize alignedPadding(DtMachineSize value, DtMachineSize alignment)
Return the adjustment necessary to align the given value to the given alignment Efficient means to de...
Definition: vlUtil.h:310
DtSelectParam()
Definition: vlUtil.h:196
const DtIpv4Addr DtInetAddrAny
Definition: vlUtil.h:248
const char * DtOperatingSystem()
Returns the platform we're running on.
unsigned long DtU32
A 32 bit unsigned integer value.
Definition: vlMachineTypes.h:153
DtReal DtTime
A definition of DtTime.
Definition: vlTime.h:19
void DtClose(int &fd)
Definition: vlUtil.h:184
Instances of DtString are used to represent strings.
Definition: vlString.h:29
fd_set read0
Definition: vlUtil.h:224
const char * DtCompiler()
Returns the compiler.
int DtROUND_TO_MULT(int num, int mult)
Rounds num up to a multiple of mult.
Definition: vlUtil.h:124
int DtGetPPid()
Returns the process ID for the parent of the running process.
DtU32 DtMachineSize
A type that represents the addressing size.
Definition: vlMachineTypes.h:197
#define DT_DLL_VLUTIL
Definition: vlMachineTypes.h:109
T DtMin(T x, T y)
Returns the which ever is lesser, x or y of type T.
Definition: vlUtil.h:151
void bzero(char *b, int length)
Need bzero.