void Skip_s(str, i)

- skip blanks String str; int *i;

void do_check(str, i, first_ok, tail_ok)

- check value String str; int *i; IntFunction first_ok; IntFunction tail_ok;

void check_list(str, check_string, nm_tokens, error_nr)

- check value list String str; IntFunction check_string; int *nm_tokens; int error_nr;

The value for an attribute must be of the same type as the declared value for the attribute. For example the NAME-attributes must have values starting with a name start character and followed by a name character. If the attribute has a different value an error has occurred and an error message is given.

do_check() checks if str is conform the requirements for the attribute value. Most of the attribute values have a different requirement for the first character then for the rest of the value. first_ok refers to a procedure which checks the first character of str, tail_ok checks the remaining characters. For example: for a NAME-attribute, first_ok is the procedure is_name_start_character() and tail_ok is the procedure is_name_character().

check_list() checks if all the values in the list str satisfy the attribute specification. check_string contains the procedure to check a single value. nm_tokens indicates the number of values in the value list. The type of error, for instance ``there is a non-name character encountered'', is specified in error_nr.

The values in the value list are separated by blanks. The blanks are tabs, spaces, record-start and record-end. To check all the values in the list the blanks must be skipped, this is done by Skip_s().

void check_name(s, i, list)

- check if value is a name String s; int *i; Bool list;

void check_number(s, i, list)

- check if value is a number String s; int *i; Bool list;

void check_enumerate(s, i, list, range)

- check if value is in enumerates range String s; int *i; Bool list; String *range;

void check_notation(s, i, list, range)

- check if value is a notation String s; int *i; Bool list; String *range;

void check_name_token(s, i, list)

- check if value is a name token String s; int *i; Bool list;

void check_number_token(s, i, list)

- check if value is a number token String s; int *i; Bool list;

void check_cdata(s, i, list)

- check if value is a cdata String s; int *i; Bool list;

void check_name_list(str, nm_tokens)

- check if values are names String str; int *nm_tokens;

void check_number_list(str, nm_tokens)

- check if values are numbers String str; int *nm_tokens;

void check_name_token_list(str, nm_tokens)

- check if values are name tokens String str; int *nm_tokens;

void check_number_token_list(str, nm_tokens)

- check if values are number tokens String str; int *nm_tokens;

void check_attr(att_name, value, declared_value, range, nm_tokens)

- check value of attribute String att_name; String value; int declared_value; String *range; int *nm_tokens;

All these procedures check if the value of an attribute is conform the specification of its declared value. For declared value ENUMERATE and NOTATION, this means the value must be in their range.

int norm_val_length(str, decl_val)

- calculate normalized attribute value length String str; int decl_val;

The normalized length of an attribute value is needed to determine the ATTSPLEN quantity (page 27, section 7.9.4.5). The normalized length is the NORMSEP quantity plus:

- for an idref, name name token, number and number token list the sum of the number of characters for each token in the list, plus the NORMSEP quantity for each token in the list. This also holds when there is only one token in the list. - for all the others, the number of characters in the value plus the NORMSEP quantity for each reference to a CDATA or SDATA entity.

void att_change_s(string)

- change characters in an attribute value String string;

The RS and Ee character may not be part of an attribute value literal. The SEPCHAR and RE character must be changed to a SPACE character. All other characters are stay the same.

void debug_attchk(b)

- used only for debugging Bool b;

The function sets a debug flag to the value of `b'. If the value of `b' is TRUE, all debug information listed in this file is printed, if the value is FALSE, no debug information is printed.

att_chk.c att_chk.h