home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.ncftp.com
/
ftp.ncftp.com.zip
/
ftp.ncftp.com
/
ncftp
/
older_versions
/
ncftp-3.2.2-src.tar.bz2
/
ncftp-3.2.2-src.tar
/
ncftp-3.2.2
/
Strn
/
DStrInternal.h
< prev
next >
Wrap
C/C++ Source or Header
|
2001-11-16
|
750b
|
36 lines
/* DStrInternal.h */
#ifndef _DStrInternal_h_
#define _DStrInternal_h_ 1
#ifdef __cplusplus
extern "C"
{
#endif /* __cplusplus */
typedef struct DStr {
char *s;
size_t len;
size_t allocSize;
} DStr, *DStrPtr;
#ifdef __cplusplus
}
#endif /* __cplusplus */
/* These checks should catch most cases where an
* uninitialized or trashed DStr structure has
* been passed in. As a consequence, it limits
* our strings to a maximum length of 16777215.
*
* The assumptions are that malloc never
* returns an unaligned pointer, and that our
* allocation sizes are always multiples of 16
* bytes.
*/
#define IS_DSTR_CORRUPT(dst) \
((((long) dst->s & 1) != 0) || ((dst->allocSize & 0xFF00000F) != 0) || ((dst->len & 0xFF000000) != 0))
#endif