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

Definition at line 1699 of file dbfopen.c.

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

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

Here is the call graph for this function: