PostGIS  2.1.10dev-r@@SVN_REVISION@@
DBFFieldType SHPAPI_CALL DBFGetFieldInfo ( DBFHandle  psDBF,
int  iField,
char *  pszFieldName,
int *  pnWidth,
int *  pnDecimals 
)

Definition at line 1218 of file dbfopen.c.

Referenced by DBFGetFieldIndex(), and ShpLoaderOpenShape().

1221 {
1222  if( iField < 0 || iField >= psDBF->nFields )
1223  return( FTInvalid );
1224 
1225  if( pnWidth != NULL )
1226  *pnWidth = psDBF->panFieldSize[iField];
1227 
1228  if( pnDecimals != NULL )
1229  *pnDecimals = psDBF->panFieldDecimals[iField];
1230 
1231  if( pszFieldName != NULL )
1232  {
1233  int i;
1234 
1235  strncpy( pszFieldName, (char *) psDBF->pszHeader+iField*32, 11 );
1236  pszFieldName[11] = '\0';
1237  for( i = 10; i > 0 && pszFieldName[i] == ' '; i-- )
1238  pszFieldName[i] = '\0';
1239  }
1240 
1241  if ( psDBF->pachFieldType[iField] == 'L' )
1242  return( FTLogical);
1243 
1244  else if ( psDBF->pachFieldType[iField] == 'D' )
1245  return ( FTDate );
1246 
1247  else if( psDBF->pachFieldType[iField] == 'N'
1248  || psDBF->pachFieldType[iField] == 'F' )
1249  {
1250  if( psDBF->panFieldDecimals[iField] > 0
1251  || psDBF->panFieldSize[iField] > 10 )
1252  return( FTDouble );
1253  else
1254  return( FTInteger );
1255  }
1256  else
1257  {
1258  return( FTString );
1259  }
1260 }

Here is the caller graph for this function: