Bioplib
Protein Structure C Library
 All Data Structures Files Functions Variables Typedefs Macros Pages
Functions
AtomNameMatch.c File Reference

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)
 

Detailed Description

Tests for matching atom names with wild cards.

Version
V1.8
Date
07.07.14
Author
Dr. Andrew C. R. Martin
Institute of Structural & Molecular Biology, University College London, Gower Street, London. WC1E 6BT.
andre.nosp@m.w@bi.nosp@m.oinf..nosp@m.org..nosp@m.uk andre.nosp@m.w.ma.nosp@m.rtin@.nosp@m.ucl..nosp@m.ac.uk

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.

Description:

Usage:

Revision History:

Definition in file AtomNameMatch.c.

Function Documentation

BOOL blAtomNameMatch ( char *  atnam,
char *  spec,
BOOL ErrorWarn 
)
Parameters
[in]*atnamThe atom name to test
[in]*specThe atom specification
[in,out]*ErrorWarnOn 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

  • 23.07.96 Original By: ACRM
  • 07.07.14 Use bl prefix for functions By: CTP

Definition at line 139 of file AtomNameMatch.c.

BOOL blAtomNameRawMatch ( char *  atnam,
char *  spec,
BOOL ErrorWarn 
)
Parameters
[in]*atnamThe atom name to check
[in]*specThe atom specification
[in,out]*ErrorWarnOn 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()

  • 15.02.01 Original By: ACRM
  • 07.07.14 Use bl prefix for functions By: CTP

Definition at line 250 of file AtomNameMatch.c.