Bioplib
Protein Structure C Library
|
Tests for matching atom names with wild cards. More...
#include <ctype.h>
#include <stdio.h>
#include <string.h>
#include "macros.h"
#include "SysDefs.h"
#include "pdb.h"
Go to the source code of this file.
Functions | |
BOOL | blAtomNameMatch (char *atnam, char *spec, BOOL *ErrorWarn) |
BOOL | blAtomNameRawMatch (char *atnam, char *spec, BOOL *ErrorWarn) |
Tests for matching atom names with wild cards.
This code is NOT IN THE PUBLIC DOMAIN, but it may be copied according to the conditions laid out in the accompanying file COPYING.DOC.
The code may be modified as required, but any modifications must be documented so that the person responsible can be identified.
The code may not be sold commercially or included as part of a commercial product except as described in the file COPYING.DOC.
Definition in file AtomNameMatch.c.
[in] | *atnam | The atom name to test |
[in] | *spec | The atom specification |
[in,out] | *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. |
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
Definition at line 139 of file AtomNameMatch.c.
[in] | *atnam | The atom name to check |
[in] | *spec | The atom specification |
[in,out] | *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. |
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()
Definition at line 250 of file AtomNameMatch.c.