PostGIS  3.4.0dev-r@@SVN_REVISION@@

◆ DBFIsValueNULL()

static int DBFIsValueNULL ( char  chType,
const char *  pszValue 
)
static

Definition at line 1168 of file dbfopen.c.

1169 {
1170  int i;
1171 
1172  if( pszValue == SHPLIB_NULLPTR )
1173  return TRUE;
1174 
1175  switch(chType)
1176  {
1177  case 'N':
1178  case 'F':
1179  /*
1180  ** We accept all asterisks or all blanks as NULL
1181  ** though according to the spec I think it should be all
1182  ** asterisks.
1183  */
1184  if( pszValue[0] == '*' )
1185  return TRUE;
1186 
1187  for( i = 0; pszValue[i] != '\0'; i++ )
1188  {
1189  if( pszValue[i] != ' ' )
1190  return FALSE;
1191  }
1192  return TRUE;
1193 
1194  case 'D':
1195  /* NULL date fields have value "00000000" */
1196  return strncmp(pszValue,"00000000",8) == 0;
1197 
1198  case 'L':
1199  /* NULL boolean fields have value "?" */
1200  return pszValue[0] == '?';
1201 
1202  default:
1203  /* empty string fields are considered NULL */
1204  return strlen(pszValue) == 0;
1205  }
1206 }
#define TRUE
Definition: dbfopen.c:73
#define FALSE
Definition: dbfopen.c:72
#define SHPLIB_NULLPTR
Definition: dbfopen.c:99

References FALSE, SHPLIB_NULLPTR, and TRUE.

Referenced by DBFAlterFieldDefn(), and DBFIsAttributeNULL().

Here is the caller graph for this function: