GRASS 8 Programmer's Manual 8.6.0dev(2026)-f6f2c534ea
Loading...
Searching...
No Matches
shpopen.c File Reference
#include "shapefil_private.h"
#include <assert.h>
#include <errno.h>
#include <limits.h>
#include <math.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Include dependency graph for shpopen.c:

Go to the source code of this file.

Macros

#define FALSE   0
 
#define TRUE   1
 
#define ByteCopy(a, b, c)   memcpy(b, a, c)
 
#define MIN(a, b)   ((a < b) ? a : b)
 
#define MAX(a, b)   ((a > b) ? a : b)
 
#define SHP_RESTORE_SHX_HINT_MESSAGE    " Use SHPRestoreSHX() to restore or create it."
 

Functions

void SHPWriteHeader (SHPHandle psSHP)
 
SHPHandle SHPOpen (const char *pszLayer, const char *pszAccess)
 
SHPHandle SHPOpenLL (const char *pszLayer, const char *pszAccess, const SAHooks *psHooks)
 
SHPHandle SHPOpenLLEx (const char *pszLayer, const char *pszAccess, const SAHooks *psHooks, int bRestoreSHX)
 
int SHPRestoreSHX (const char *pszLayer, const char *pszAccess, const SAHooks *psHooks)
 
void SHPClose (SHPHandle psSHP)
 
void SHPSetFastModeReadObject (SHPHandle hSHP, int bFastMode)
 
void SHPGetInfo (const SHPHandle psSHP, int *pnEntities, int *pnShapeType, double *padfMinBound, double *padfMaxBound)
 
SHPHandle SHPCreate (const char *pszLayer, int nShapeType)
 
SHPHandle SHPCreateLL (const char *pszLayer, int nShapeType, const SAHooks *psHooks)
 
void SHPComputeExtents (SHPObject *psObject)
 
SHPObjectSHPCreateObject (int nSHPType, int nShapeId, int nParts, const int *panPartStart, const int *panPartType, int nVertices, const double *padfX, const double *padfY, const double *padfZ, const double *padfM)
 
SHPObjectSHPCreateSimpleObject (int nSHPType, int nVertices, const double *padfX, const double *padfY, const double *padfZ)
 
int SHPWriteObject (SHPHandle psSHP, int nShapeId, const SHPObject *psObject)
 
SHPObjectSHPReadObject (const SHPHandle psSHP, int hEntity)
 
const charSHPTypeName (int nSHPType)
 
const charSHPPartTypeName (int nPartType)
 
void SHPDestroyObject (SHPObject *psShape)
 
int SHPRewindObject (const SHPHandle hSHP, SHPObject *psObject)
 

Macro Definition Documentation

◆ ByteCopy

#define ByteCopy (   a,
  b,
 
)    memcpy(b, a, c)

Definition at line 31 of file shpopen.c.

◆ FALSE

#define FALSE   0

Definition at line 27 of file shpopen.c.

◆ MAX

#define MAX (   a,
  b 
)    ((a > b) ? a : b)

Definition at line 34 of file shpopen.c.

◆ MIN

#define MIN (   a,
  b 
)    ((a < b) ? a : b)

Definition at line 33 of file shpopen.c.

◆ SHP_RESTORE_SHX_HINT_MESSAGE

#define SHP_RESTORE_SHX_HINT_MESSAGE    " Use SHPRestoreSHX() to restore or create it."

Definition at line 51 of file shpopen.c.

◆ TRUE

#define TRUE   1

Definition at line 28 of file shpopen.c.

Function Documentation

◆ SHPClose()

void SHPClose ( SHPHandle  psSHP)

Definition at line 851 of file shpopen.c.

References free(), SHPLIB_NULLPTR, and SHPWriteHeader().

Referenced by SHPOpenLL().

◆ SHPComputeExtents()

void SHPComputeExtents ( SHPObject psObject)

Definition at line 1147 of file shpopen.c.

References MAX, and MIN.

Referenced by SHPCreateObject().

◆ SHPCreate()

SHPHandle SHPCreate ( const char pszLayer,
int  nShapeType 
)

Definition at line 944 of file shpopen.c.

References SASetupDefaultHooks(), and SHPCreateLL().

◆ SHPCreateLL()

SHPHandle SHPCreateLL ( const char pszLayer,
int  nShapeType,
const SAHooks psHooks 
)

Definition at line 960 of file shpopen.c.

References ByteCopy, FALSE, free(), malloc(), SHP_SWAP32, SHPLIB_NULLPTR, and STATIC_CAST.

Referenced by SHPCreate().

◆ SHPCreateObject()

SHPObject * SHPCreateObject ( int  nSHPType,
int  nShapeId,
int  nParts,
const int panPartStart,
const int panPartType,
int  nVertices,
const double padfX,
const double padfY,
const double padfZ,
const double padfM 
)

◆ SHPCreateSimpleObject()

SHPObject * SHPCreateSimpleObject ( int  nSHPType,
int  nVertices,
const double padfX,
const double padfY,
const double padfZ 
)

Definition at line 1309 of file shpopen.c.

References SHPCreateObject(), and SHPLIB_NULLPTR.

◆ SHPDestroyObject()

void SHPDestroyObject ( SHPObject psShape)

Definition at line 2725 of file shpopen.c.

References FALSE, free(), and SHPLIB_NULLPTR.

Referenced by SHPReadObject().

◆ SHPGetInfo()

void SHPGetInfo ( const SHPHandle  psSHP,
int pnEntities,
int pnShapeType,
double padfMinBound,
double padfMaxBound 
)

Definition at line 916 of file shpopen.c.

References SHPLIB_NULLPTR.

◆ SHPOpen()

SHPHandle SHPOpen ( const char pszLayer,
const char pszAccess 
)

Definition at line 219 of file shpopen.c.

References SASetupDefaultHooks(), and SHPOpenLL().

◆ SHPOpenLL()

SHPHandle SHPOpenLL ( const char pszLayer,
const char pszAccess,
const SAHooks psHooks 
)

◆ SHPOpenLLEx()

SHPHandle SHPOpenLLEx ( const char pszLayer,
const char pszAccess,
const SAHooks psHooks,
int  bRestoreSHX 
)

Definition at line 602 of file shpopen.c.

References SHPLIB_NULLPTR, SHPOpenLL(), and SHPRestoreSHX().

◆ SHPPartTypeName()

const char * SHPPartTypeName ( int  nPartType)

◆ SHPReadObject()

◆ SHPRestoreSHX()

◆ SHPRewindObject()

int SHPRewindObject ( const SHPHandle  hSHP,
SHPObject psObject 
)

Definition at line 2856 of file shpopen.c.

References FALSE, SHPT_POLYGON, SHPT_POLYGONM, SHPT_POLYGONZ, and TRUE.

◆ SHPSetFastModeReadObject()

void SHPSetFastModeReadObject ( SHPHandle  hSHP,
int  bFastMode 
)

◆ SHPTypeName()

◆ SHPWriteHeader()

void SHPWriteHeader ( SHPHandle  psSHP)

Definition at line 62 of file shpopen.c.

References ByteCopy, free(), malloc(), SHP_SWAP32, SHP_SWAP64, SHPLIB_NULLPTR, and STATIC_CAST.

Referenced by SHPClose().

◆ SHPWriteObject()