PostGIS 3.7.0dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ DBFIsValueNULL()

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

Definition at line 1177 of file dbfopen.c.

1178{
1179 int i;
1180
1181 if( pszValue == SHPLIB_NULLPTR )
1182 return TRUE;
1183
1184 switch(chType)
1185 {
1186 case 'N':
1187 case 'F':
1188 /*
1189 ** We accept all asterisks or all blanks as NULL
1190 ** though according to the spec I think it should be all
1191 ** asterisks.
1192 */
1193 if( pszValue[0] == '*' )
1194 return TRUE;
1195
1196 for( i = 0; pszValue[i] != '\0'; i++ )
1197 {
1198 if( pszValue[i] != ' ' )
1199 return FALSE;
1200 }
1201 return TRUE;
1202
1203 case 'D':
1204 /* NULL date fields have value "00000000" */
1205 return strncmp(pszValue,"00000000",8) == 0;
1206
1207 case 'L':
1208 /* NULL boolean fields have value "?" */
1209 return pszValue[0] == '?';
1210
1211 default:
1212 /* empty string fields are considered NULL */
1213 return strlen(pszValue) == 0;
1214 }
1215}
#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: