AtomNameMatch.c



BOOL AtomNameMatch(char *atnam, char *spec, BOOL *ErrorWarn)

Inputs

char *atnam The atom name to test
char *spec The atom specification

Input/Output

BOOL *ErrorWarn On input, if TRUE, this routine will indicate errors. On output, indicates whether there was an error. Note that you must be careful to supply an lvalue here, you can't just use TRUE or FALSE since it's modified on return. NULL is allowed if you don't care about errors.

Description

Tests whether an atom name matches an atom name specification. ? or % is used to match a single character * is used to match any trailing characters; it may not be used for leading characters or in the middle of a specification (e.g. *B*, C*2 are both illegal). Wildcards may be escaped with a backslash.

For example: C* matches all carbon atoms, O5\* matches an atom called O5* ?B* matches all beta atoms

Created: 23.07.96 Last Modified: 23.07.96


BOOL AtomNameRawMatch(char *atnam, char *spec, BOOL *ErrorWarn)

Inputs

char *atnam The atom name to check
char *spec The atom specification

Input/Output

BOOL *ErrorWarn On input, if TRUE, this routine will indicate errors. On output, indicates whether there was an error. Note that you must be careful to supply an lvalue here, you can't just use TRUE or FALSE since it's modified on return. NULL is allowed if you don't care about errors.

Description

Tests whether an atom name matches an atom name specification.

This version should be given the raw atom name rather than the massaged one. i.e. " CA " is C-alpha, "CA " is Calcium

Normally it checks against the second character onwards unless the spec starts with a < in which case it checks from the beginning of the string

Written as a wrapper to AtomNameMatch()

Created: 15.02.01 Last Modified: 15.02.01