GRASS GIS 8 Programmer's Manual  8.5.0dev(2024)-af55fa7eae
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)   ((type)(x))
 
#define REINTERPRET_CAST(type, x)   ((type)(x))
 
#define CONST_CAST(type, x)   ((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))
#define STATIC_CAST(type, 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) | \
uint32_t, STATIC_CAST(uint64_t, x) >> 32)))))
#define _SHP_SWAP32(x)

Definition at line 81 of file shapefil_private.h.

◆ CONST_CAST

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

Definition at line 27 of file shapefil_private.h.

◆ REINTERPRET_CAST

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

Definition at line 26 of file shapefil_private.h.

◆ SHP_SWAP32

#define SHP_SWAP32 (   p)
Value:
*REINTERPRET_CAST(uint32_t *, p) = \
_SHP_SWAP32(*REINTERPRET_CAST(uint32_t *, p))
#define REINTERPRET_CAST(type, x)

Definition at line 89 of file shapefil_private.h.

◆ 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.

◆ 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)
#define _SHP_SWAP64(x)

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.

◆ STATIC_CAST

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

Definition at line 25 of file shapefil_private.h.