GsVerifyAuxiliaryRecord - geostan_1 - 2024.01

GeoStan Geocoding Suite Reference for Windows, Linux, and z/OS

Product type
Software
Portfolio
Locate
Product family
GeoStan Geocoding Suite
Product
GeoStan Geocoding Suite > GeoStan
Version
2024.01
Language
English
Product name
GeoStan
Title
GeoStan Geocoding Suite Reference for Windows, Linux, and z/OS
Copyright
2024
First publish date
1994
Last updated
2024-07-29
Published on
2024-07-29T23:01:18.924000

Validates an auxiliary file record.

Syntax

GsFunStat GsVerifyAuxiliaryRecord (GsId gs, const char *pRecord)

Arguments

GsIdgs   ID returned by GsInitWithProps for the current instance of GeoStan. Input.

const char*pRecord   Pointer to a string buffer containing one auxiliary file record. Input.

Return Values

GS_SUCCESS    The record is valid and GeoStan will load the record. This includes comment records; records whose first character is a semicolon.

GS_WARNING   The record contains a non-fatal error and GeoStan will load the record. Because this record has a problem, an input address may not be able to match to the record in its current state, or the output data from a match to the record may not be valid.

GS_ERROR    The record contains a fatal error and GeoStan will NOT load the file.

Prerequisites

GsInitWithProps()

Example

char buffer[800];
char msg1[GS_MAX_STR_LEN], msg2[GS_MAX_STR_LEN];
FILE * fp;
GsId gs;
GsFunStat rc;
int    recno = 0;
                 
/* open the GAX file */
fp = fopen( GAXfilename, "r" );
if ( fp )
{
/* get the first record from the file */
 fgets( buffer, sizeof(buffer), fp );
/* while not EOF, process each record */
 while( !feof(fp) )
  {
  recno++;
/* verify the record */
  rc = GsVerifyAuxiliaryRecord( gs, buffer );
  if ( rc != GS_SUCCESS )
   {
/* the record is not perfect, so get more information */
   while ( GsErrorHas(gs) )
    {
    GsErrorGetEx( gs, msg1, msg2 );
    printf( "%s %d: %s %s\n", rc == GS_ERROR ? "FATAL ERROR" : "WARNING", recno, msg1, msg2 );
    }
   printf("\n");
   }
/* get the next record from the file */
  fgets( buffer, sizeof(buffer), fp );
  }
}