PostGIS  2.1.10dev-r@@SVN_REVISION@@
int SHPAPI_CALL DBFGetFieldIndex ( DBFHandle  psDBF,
const char *  pszFieldName 
)

Definition at line 1700 of file dbfopen.c.

References DBFGetFieldCount(), DBFGetFieldInfo(), and str_to_upper().

1702 {
1703  char name[12], name1[12], name2[12];
1704  int i;
1705 
1706  strncpy(name1, pszFieldName,11);
1707  name1[11] = '\0';
1708  str_to_upper(name1);
1709 
1710  for( i = 0; i < DBFGetFieldCount(psDBF); i++ )
1711  {
1712  DBFGetFieldInfo( psDBF, i, name, NULL, NULL );
1713  strncpy(name2,name,11);
1714  str_to_upper(name2);
1715 
1716  if(!strncmp(name1,name2,10))
1717  return(i);
1718  }
1719  return(-1);
1720 }
DBFFieldType SHPAPI_CALL DBFGetFieldInfo(DBFHandle psDBF, int iField, char *pszFieldName, int *pnWidth, int *pnDecimals)
Definition: dbfopen.c:1218
int SHPAPI_CALL DBFGetFieldCount(DBFHandle psDBF)
Definition: dbfopen.c:1192
static void str_to_upper(char *string)
Definition: dbfopen.c:1679

Here is the call graph for this function: