c_attchk - Parses and validates an attribute array

SYNTAX

#include <ctype.h>
#include "las.h"
#include "gof.h"
FUNCTION c_attchk (hdr, inatt, outatt, index, search)

     struct HEADER	*hdr;
     char		inatt[][ATTIN];
     char		outatt[][ATTVAL];
     int 		index[MAXATT];
     int		*search;

PARAMETERS

hdr (input, struct HEADER, length (*))

The graphics overlay file (GOF) header information.

inatt (input, character, length (MAXATT, ATTIN))

The input attributes in the form of "NAME:VALUE". Any of the MAXATT attributes that do not have a specified value must be assigned an empty string.

outatt (output, character, length (MAXATT, ATTVAL))

The parsed attribute values. These will occur in the order specified by search.

index (output, integer, length (MAXATT))

The indices of attributes in outatt indicating their position within the GOF header record. This information will only be supplied when search is TRUE.

search (input, integer)

Flag indicating the order of the output attribute value array. If search is TRUE, then the attribute values will be placed in sequential order (the same order they were input) in the attribute array. The location relative to were it appeared in the GOF header record for each corresponding attribute value will be placed in index. If search is FALSE, the attribute values will be placed in the attribute array in the same order as the attribute names appear in the GOF header record.

DESCRIPTION

The c_attchk() routine is used to parse an array of attributes for a valid attribute NAME and VALUE. The location of the attribute NAME in the GOF header record determines where the VALUE will be placed in the output attribute array when the search flag is FALSE (i.e. VALUE is placed in the same location as the attribute NAME in the GOF header record). When the search flag is TRUE, attribute values will be placed, in the same order that they were entered, in the output attribute array and the location of each of those attributes in the GOF header record are placed in a separate index array. The input attribute text is also checked for valid syntax and the attribute value is checked for valid data type.

RETURN VALUE

c_attchk() returns

     E_SUCC (0)  --> successful completion
     E_FAIL (-1) --> operation failed

SPECIAL CONSIDERATIONS

c_attchk() is C callable only.