Loading...
Searching...
No Matches
shapefil_private.h File Reference
`#include "shapefil.h"`
`#include <stdint.h>`
`#include <stdlib.h>`
Include dependency graph for shapefil_private.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Macros

#define | STATIC_CAST(type, x)
#define | REINTERPRET_CAST(type, x)
#define | CONST_CAST(type, x)
#define | SHPLIB_NULLPTR NULL
#define | _SHP_SWAP32(x)
#define | _SHP_SWAP64(x)
#define | SHP_SWAP32(p)
#define | SHP_SWAP64(p)
#define | SHP_SWAPDOUBLE(x)
#define | SHP_SWAPDOUBLE_CPY(dst, src)

## Macro Definition Documentation

## _SHP_SWAP32

#define _SHP_SWAP32 | ( |  | x | ) |

Value:
STATIC_CAST(uint32_t, \
((STATIC_CAST(uint32_t, x) & 0x000000ffU) << 24) | \
((STATIC_CAST(uint32_t, x) & 0x0000ff00U) << 8) | \
((STATIC_CAST(uint32_t, x) & 0x00ff0000U) >> 8) | \
((STATIC_CAST(uint32_t, x) & 0xff000000U) >> 24))
STATIC_CAST
#define STATIC_CAST(type, x)
Definition shapefil_private.h:25
x
#define x

Definition at line 75 of file shapefil_private.h.

## _SHP_SWAP64

#define _SHP_SWAP64 | ( |  | x | ) |

Value:
((STATIC_CAST(uint64_t, _SHP_SWAP32(STATIC_CAST(uint32_t, x))) << 32) | \
(STATIC_CAST(uint64_t, _SHP_SWAP32(STATIC_CAST( \
uint32_t, STATIC_CAST(uint64_t, x) >> 32)))))
_SHP_SWAP32
#define _SHP_SWAP32(x)
Definition shapefil_private.h:75

Definition at line 81 of file shapefil_private.h.

## CONST_CAST

#define CONST_CAST | ( |  | type,
|  |  | x )

Value:
((type)(x))

Definition at line 27 of file shapefil_private.h.

Referenced by DBFCreateLL(), DBFWriteLogicalAttribute(), and DBFWriteStringAttribute().

## REINTERPRET_CAST

#define REINTERPRET_CAST | ( |  | type,
|  |  | x )

Value:
((type)(x))

Definition at line 26 of file shapefil_private.h.

Referenced by DBFOpenLL(), DBFWriteAttributeDirectly(), and DBFWriteTuple().

## SHP_SWAP32

#define SHP_SWAP32 | ( |  | p | ) |

Value:
*REINTERPRET_CAST(uint32_t *, p) = \
_SHP_SWAP32(*REINTERPRET_CAST(uint32_t *, p))
REINTERPRET_CAST
#define REINTERPRET_CAST(type, x)
Definition shapefil_private.h:26

Definition at line 89 of file shapefil_private.h.

Referenced by SHPCreateLL(), SHPOpenLL(), SHPReadObject(), SHPRestoreSHX(), SHPWriteHeader(), and SHPWriteObject().

## SHP_SWAP64

#define SHP_SWAP64 | ( |  | p | ) |

Value:
*REINTERPRET_CAST(uint64_t *, p) = \
_SHP_SWAP64(*REINTERPRET_CAST(uint64_t *, p))

Definition at line 93 of file shapefil_private.h.

Referenced by SHPOpenLL(), SHPWriteHeader(), and SHPWriteObject().

## SHP_SWAPDOUBLE

#define SHP_SWAPDOUBLE | ( |  | x | ) |

Value:
do { \
uint64_t _n64; \
void *_lx = x; \
memcpy(&_n64, _lx, 8); \
_n64 = _SHP_SWAP64(_n64); \
memcpy(_lx, &_n64, 8); \
} while (0)
_SHP_SWAP64
#define _SHP_SWAP64(x)
Definition shapefil_private.h:81

Definition at line 97 of file shapefil_private.h.

## SHP_SWAPDOUBLE_CPY

#define SHP_SWAPDOUBLE_CPY | ( |  | dst,
|  |  | src )

Value:
do { \
uint64_t _n64; \
const void *_ls = src; \
void *_ld = dst; \
memcpy(&_n64, _ls, 8); \
_n64 = _SHP_SWAP64(_n64); \
memcpy(_ld, &_n64, 8); \
} while (0)

Definition at line 106 of file shapefil_private.h.

## SHPLIB_NULLPTR

#define SHPLIB_NULLPTR NULL

Definition at line 28 of file shapefil_private.h.

Referenced by DBFAddNativeFieldType(), DBFCloneEmpty(), DBFClose(), DBFCreateLL(), DBFGetCodePage(), DBFGetFieldIndex(), DBFGetFieldInfo(), DBFIsAttributeNULL(), DBFOpenLL(), DBFReadDateAttribute(), DBFReadDoubleAttribute(), DBFReadIntegerAttribute(), DBFReadTuple(), DBFReorderFields(), DBFWriteDateAttribute(), DBFWriteNULLAttribute(), SASetupDefaultHooks(), SHPClose(), SHPCreateLL(), SHPCreateObject(), SHPCreateSimpleObject(), SHPDestroyObject(), SHPGetInfo(), SHPOpenLL(), SHPOpenLLEx(), SHPReadObject(), SHPRestoreSHX(), SHPSetFastModeReadObject(), SHPWriteHeader(), and SHPWriteObject().

## STATIC_CAST

#define STATIC_CAST | ( |  | type,
|  |  | x )

Value:
((type)(x))

Definition at line 25 of file shapefil_private.h.

Referenced by DBFAddNativeFieldType(), DBFAlterFieldDefn(), DBFCloneEmpty(), DBFCreateLL(), DBFDeleteField(), DBFGetFieldInfo(), DBFOpenLL(), DBFReadDateAttribute(), DBFReadDoubleAttribute(), DBFReadIntegerAttribute(), DBFReadLogicalAttribute(), DBFReadStringAttribute(), DBFReadTuple(), DBFReorderFields(), DBFUpdateHeader(), DBFWriteAttributeDirectly(), DBFWriteDoubleAttribute(), DBFWriteIntegerAttribute(), DBFWriteLogicalAttribute(), DBFWriteStringAttribute(), SHPCreateLL(), SHPCreateObject(), SHPOpenLL(), SHPReadObject(), SHPRestoreSHX(), SHPSetFastModeReadObject(), SHPWriteHeader(), and SHPWriteObject().