This file is indexed.

/usr/include/mmdb/mmdb_file.h is in libmmdb-dev 1.23.2.1-0ubuntu1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
//  =================================================================
//
//   CCP4 Coordinate Library: support of coordinate-related
//   functionality in protein crystallography applications.
//
//   Copyright (C) Eugene Krissinel 2000-2008.
//
//    This library is free software: you can redistribute it and/or
//    modify it under the terms of the GNU Lesser General Public
//    License version 3, modified in accordance with the provisions
//    of the license to address the requirements of UK law.
//
//    You should have received a copy of the modified GNU Lesser
//    General Public License along with this library. If not, copies
//    may be downloaded from http://www.ccp4.ac.uk/ccp4license.php
//
//    This program is distributed in the hope that it will be useful,
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//    GNU Lesser General Public License for more details.
//
//  =================================================================
//
//    24.03.09   <--  Date of Last Modification.
//                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//  -----------------------------------------------------------------
//
//  **** Module  :  MMDB_File <interface>
//       ~~~~~~~~~
//       Project :  MacroMolecular Data Base (MMDB)
//       ~~~~~~~~~
//  **** Classes :  CMMDBFile
//       ~~~~~~~~~
//
//  (C) E. Krissinel 2000-2009
//
//  =================================================================
//

#ifndef __MMDB_File__
#define __MMDB_File__


#ifndef __File__
#include "file_.h"
#endif

#ifndef  __mmdb_uddata__
#include "mmdb_uddata.h"
#endif

#ifndef  __MMDB_Defs__
#include "mmdb_defs.h"
#endif

#ifndef  __MMDB_Title__
#include "mmdb_title.h"
#endif

#ifndef  __MMDB_Cryst__
#include "mmdb_cryst.h"
#endif

#ifndef  __MMDB_Chain__
#include "mmdb_chain.h"
#endif

#ifndef  __MMDB_Model__
#include "mmdb_model.h"
#endif


// =======================  CMMDBFile  ===========================


// special effect flags

#define MMDBF_AutoSerials             0x00000001
#define MMDBF_NoCoordRead             0x00000002
#define MMDBF_SimRWBROOK              0x00000004
#define MMDBF_PrintCIFWarnings        0x00000008
#define MMDBF_EnforceSpaces           0x00000010
#define MMDBF_IgnoreDuplSeqNum        0x00000020
#define MMDBF_IgnoreSegID             0x00000040
#define MMDBF_IgnoreElement           0x00000080
#define MMDBF_IgnoreCharge            0x00000100
#define MMDBF_IgnoreNonCoorPDBErrors  0x00000200
#define MMDBF_IgnoreUnmatch           0x00000400
#define MMDBF_IgnoreBlankLines        0x00000800
#define MMDBF_IgnoreHash              0x00001000
#define MMDBF_IgnoreRemarks           0x00002000
#define MMDBF_AllowDuplChainID        0x00004000
#define MMDBF_FixSpaceGroup           0x00008000
#define MMDBF_EnforceAtomNames        0x00010000
#define MMDBF_EnforceUniqueChainID    0x00020000

// MMDBF_EnforceUniqueChainID   will make MMDB to rename chains on
//         reading a file such as to maintain chains uniquesness. This
//         is supposed to work only with 1-letter chain IDs and only
//         if chain names are interchanged in the file. For example,
//         if file contains a sequence of chains named
//
//              A,B, A,B, A,B, A,B, A,B
//
//         and this flag is set on, the resulting chain names in
//         MMDB will be:
//
//              A,B, A0,B0, A1,B1, A2,B2, A3,B3
//

// file types:
#define MMDB_FILE_Undefined     -1
#define MMDB_FILE_PDB            0
#define MMDB_FILE_CIF            1
#define MMDB_FILE_Binary         2

// cleanup flags:
#define PDBCLEAN_ATNAME         0x00000001
#define PDBCLEAN_TER            0x00000002
#define PDBCLEAN_CHAIN          0x00000004
#define PDBCLEAN_CHAIN_STRONG   0x00000008
#define PDBCLEAN_ALTCODE        0x00000010
#define PDBCLEAN_ALTCODE_STRONG 0x00000020
#define PDBCLEAN_SERIAL         0x00000040
#define PDBCLEAN_SEQNUM         0x00000080
#define PDBCLEAN_CHAIN_ORDER    0x00000100
#define PDBCLEAN_CHAIN_ORDER_IX 0x00000200
#define PDBCLEAN_SOLVENT        0x00000400
#define PDBCLEAN_INDEX          0x00000800
#define PDBCLEAN_ELEMENT        0x00001000
#define PDBCLEAN_ELEMENT_STRONG 0x00002000


// crystallographic info inquery
#define  CRRDY_NotPrecise       0x00000001
#define  CRRDY_isTranslation    0x00000002
#define  CRRDY_NoOrthCode       0x00000004

#define  CRRDY_Complete            0
#define  CRRDY_NoTransfMatrices   -1
#define  CRRDY_Unchecked          -2
#define  CRRDY_Ambiguous          -3
#define  CRRDY_NoCell             -4
#define  CRRDY_NoSpaceGroup       -5


DefineClass(CMMDBFile)
DefineStreamFunctions(CMMDBFile)

class CMMDBFile : public CUDData  {

  friend class CModel;
  friend class CChain;
  friend class CResidue;
  friend class CAtom;
  friend class CChannel;

  public :

    CMMDBFile ();
    CMMDBFile ( RPCStream Object );
    ~CMMDBFile();

    void  FreeFileMemory();


    //  ---------------  Reading/Writing external files  ---------

    void  SetFlag        ( word Flag );
    void  RemoveFlag     ( word Flag );

    int   ReadPDBASCII   ( cpstr PDBFileName,
                           byte gzipMode=GZM_CHECK );
    int   ReadPDBASCII1  ( cpstr PDBLFName,
                           byte gzipMode=GZM_CHECK );
    int   ReadPDBASCII   ( RCFile f );

    int   ReadCIFASCII   ( cpstr CIFFileName,
                           byte gzipMode=GZM_CHECK );
    int   ReadCIFASCII1  ( cpstr CIFLFName,
                           byte gzipMode=GZM_CHECK );
    int   ReadFromCIF    ( PCMMCIFData CIFD, Boolean fixSpaceGroup );

    // adds info from PDB file
    int   AddPDBASCII1   ( cpstr PDBLFName,
                           byte gzipMode=GZM_CHECK );
    int   AddPDBASCII    ( cpstr PDBFileName,
                           byte gzipMode=GZM_CHECK );

    // auto format recognition
    int   ReadCoorFile   ( cpstr LFName,
                           byte gzipMode=GZM_CHECK );
    int   ReadCoorFile1  ( cpstr CFName,
                           byte gzipMode=GZM_CHECK );

    int   WritePDBASCII  ( cpstr PDBFileName,
                           byte gzipMode=GZM_CHECK );
    int   WritePDBASCII1 ( cpstr PDBLFName,
                           byte gzipMode=GZM_CHECK );
    void  WritePDBASCII  ( RCFile f );

    int   WriteCIFASCII  ( cpstr CIFFileName,
                           byte gzipMode=GZM_CHECK );
    int   WriteCIFASCII1 ( cpstr CIFLFName,
                           byte gzipMode=GZM_CHECK );

    int   ReadMMDBF      ( cpstr MMDBFileName,
                           byte gzipMode=GZM_CHECK );
    int   ReadMMDBF1     ( cpstr MMDBLFName,
                           byte gzipMode=GZM_CHECK );
    int   WriteMMDBF     ( cpstr MMDBFileName,
                           byte gzipMode=GZM_CHECK );
    int   WriteMMDBF1    ( cpstr MMDBLFName,
                           byte gzipMode=GZM_CHECK );

    void  GetInputBuffer ( pstr Line, int & count );

    //  PutPDBString adds a PDB-keyworded string
    // to the existing structure. Note that the string
    // is namely added meaning that it will be the
    // last REMARK, last JRNL, last ATOM etc. string
    // -- always the last one in its group.
    int   PutPDBString   ( cpstr PDBString );



    //  PDBCleanup(..) cleans coordinate part to comply with PDB
    // standards and MMDB "expectations":
    //
    //  PDBCLEAN_ATNAME  pads atom names with spaces to form
    //                   4-symbol names
    //  PDBCLEAN_TER     inserts TER cards in the end of each chain
    //  PDBCLEAN_CHAIN   generates 1-character chain ids instead of
    //                   those many-character
    //  PDBCLEAN_CHAIN_STRONG generates 1-character chain ids starting
    //                   from 'A' on for all ids, including the
    //                   single-character ones
    //  PDBCLEAN_ALTCODE generates 1-character alternative codes
    //                   instead of many-character ones
    //  PDBCLEAN_ALTCODE_STRONG generates 1-character alternative codes
    //                   from 'A' on for all codes, including the
    //                   single-character ones
    //  PDBCLEAN_SERIAL  puts serial numbers in due order
    //  PDBCLEAN_SEQNUM  renumbers all residues so that they go
    //                   incrementally-by-one without insertion codes
    //  PDBCLEAN_CHAIN_ORDER puts chains in order of atom's serial
    //                   numbers
    //  PDBCLEAN_CHAIN_ORDER_IX puts chains in order of atom's
    //                   indices internal to MMDB
    //  PDBCLEAN_SOLVENT moves solvent chains at the end of each model
    //
    //  Return codes (as bits):
    //  0                Ok
    //  PDBCLEAN_CHAIN   too many chains for assigning them
    //                   1-letter codes
    //  PDBCLEAN_ATNAME  element names were not available
    //  PDBCLEAN_ALTCODE too many alternative codes encountered.
    //
    word  PDBCleanup ( word CleanKey );

    //     Makes all atoms in chain 'chainID', in all models, as
    //  'Het' atoms if Make is set True, and makes them 'ordinary'
    //  atoms otherwise. 'Ter' is automatically removed when
    //  converting to 'Het' atoms, and is automatically added
    //  when converting to 'ordinary' atoms. This may cause
    //  disorder in serial numbers -- just call
    //  PDBClean(PDBCLEAN_SERIAL) when necessary to fix this.
    void  MakeHetAtoms ( cpstr chainID, Boolean Make );

    //  ---------------  Working with atoms by serial numbers  ---

    PPCAtom GetAtomArray  ()  { return Atom;   }
    int GetAtomArrayLength()  { return AtmLen; } // strictly not for
                                             // use in applications!!
    PCAtom  GetAtomI ( int index );   // returns Atom[index-1]

    //   PutAtom(..) puts atom with the specified properties
    // into the structure. The current model is used; if no model
    // is set (crModel==NULL), one is created. Coordinates and
    // other parameters of the atom need to be set separately.
    //   The place, at which the atom is put, is determined by
    // index. If index is positive, then it points onto (index-1)th
    // element of the Atom array (the index counts 1,2,... and
    // generally coincides with the atom's serial number). If
    // there is already an atom at this position in the system,
    // the new atom will REPLACE it. The corresponding residues
    // are automatically updated.
    //   If index is null (=0), the new atom will be put on
    // the top of the structure, i.e. it will be put into
    // (index=nAtoms+1)-th position.
    //   If index is negative, then the new atom is INSERTED
    // BEFORE the atom in the (-index)th position. For saving
    // the computational efforts, this WILL NOT cause the
    // recalculation of all atoms' serial numbers according
    // to their actual positions. It will be needed, however,
    // for putting the things in order at a certain point,
    // especially before writing an output ASCII file. NOTE
    // that this ordering is never done automatically.
    //   In a correct PDB file the serial number (serNum) is always
    // equal to its position (index). However here we allow them
    // to be different for easing the management of relations,
    // particularly the connectivity.
    //
    //   Limitation: if PutAtom implies creating new
    // chains/residues, these are always created on the top
    // of existing chains/residues.
    int   PutAtom ( int            index,
                    int            serNum,
                    const AtomName atomName,
                    const ResName  resName,
                    const ChainID  chainID,
                    int            seqNum,
                    const InsCode  insCode,
                    const AltLoc   altLoc,
                    const SegID    segID,
                    const Element  element );

    int   PutAtom (
               int      index,    // same meaning as above
               PCAtom   A,        // pointer to completed atom class
               int      serNum=0  // 0 means that the serial number
                                  // will be set equal to index.
                                  // Otherwise the serial number
                                  // is set to the specified
                                  // value
                  );


    //    RemoveAtom(..) removes atom at the specified index
    // in the Atom array. This index is always accessible
    // as Atom[index]->index. If this leaves a residue empty,
    // the residue is removed. If this leaves an empty chain,
    // the chain is removed as well; the same happens to the
    // model.
    void  RemoveAtom ( int index );

    int   FinishStructEdit();

    void  TrimModelTable();

    //  ----------------  Deleting models  -----------------------

    int  DeleteAllModels  ();
    Boolean GetNewChainID ( int modelNo, ChainID chID, int length=1 );

    //  ---------------  Enquiring -------------------------------

    int   CrystReady();
    //    Returns flags:
    // CRRDY_Complete       if crystallographic information is complete
    // CRRDY_NotPrecise     if cryst. inf-n is not precise
    // CRRDY_isTranslation  if cryst. inf-n contains translation
    // CRRDY_NoOrthCode      no orthogonalization code
    //    Fatal:
    // CRRDY_NoTransfMatrices  if transform. matrices were not
    //                         calculated
    // CRRDY_Unchecked         if cryst. inf-n was not checked
    // CRRDY_Ambiguous         if cryst. inf-n is ambiguous
    // CRRDY_NoCell            if cryst. inf-n is unusable
    // CRRDY_NoSpaceGroup      if space group is not set


    Boolean isCrystInfo   ();  // cell parameters and space group
    Boolean isCellInfo    ();  // cell param-s a,b,c, alpha,beta,gamma
    Boolean isSpaceGroup  ();  // space group on CRYST1 card
    Boolean isTransfMatrix();  // orthogonalizing/fractionalizing
                               // matrices
    Boolean isScaleMatrix ();  // SCALEx PDB records
    Boolean isNCSMatrix   ();  // MTRIXx PDB records
    int     GetNumberOfNCSMatrices();
    int     GetNumberOfNCSMates   ();  // Returns the number of
                                       // NCS mates not given in
                                       // the file (iGiven==0)
    Boolean GetNCSMatrix  ( int NCSMatrixNo, // 0..N-1
                            mat44 & ncs_m, int & iGiven );

    int GetNumberOfSymOps ();  // number of symmetry operations
    pstr GetSymOp ( int Nop ); // XYZ symmetry operation name


    //  -------------  User-Defined Data  ------------------------

    int RegisterUDInteger ( int udr_type, cpstr UDDataID );
    int RegisterUDReal    ( int udr_type, cpstr UDDataID );
    int RegisterUDString  ( int udr_type, cpstr UDDataID );
    int GetUDDHandle      ( int udr_type, cpstr UDDataID );

    //  ----------------------------------------------------------

    void  SetSyminfoLib ( cpstr syminfo_lib );
    pstr  GetSyminfoLib ();
    int   SetSpaceGroup ( cpstr spGroup );
    pstr  GetSpaceGroup ();
    pstr  GetSpaceGroupFix();

    void  GetAtomStatistics ( RSAtomStat AS );

    void  SetIgnoreSCALEi ( Boolean ignoreScalei );

    //  SetCell(..) is for changing cell parameters
    void  SetCell ( realtype cell_a,
                    realtype cell_b,
                    realtype cell_c,
                    realtype cell_alpha,
                    realtype cell_beta,
                    realtype cell_gamma,
                    int      OrthCode=0 );

    //  PutCell(..) is for setting cell parameters
    void  PutCell ( realtype cell_a,
                    realtype cell_b,
                    realtype cell_c,
                    realtype cell_alpha,
                    realtype cell_beta,
                    realtype cell_gamma,
                    int      OrthCode=0 );

    int   GetCell ( realtype & cell_a,
                    realtype & cell_b,
                    realtype & cell_c,
                    realtype & cell_alpha,
                    realtype & cell_beta,
                    realtype & cell_gamma,
                    realtype & vol,
                    int      & OrthCode );

    int  GetRCell ( realtype & cell_as,
                    realtype & cell_bs,
                    realtype & cell_cs,
                    realtype & cell_alphas,
                    realtype & cell_betas,
                    realtype & cell_gammas,
                    realtype & vols,
                    int      & OrthCode );

    void GetROMatrix ( mat44 & RO );

    //  GetTMatrix(..) calculates and returns the coordinate
    //  transformation matrix, which converts orthogonal coordinates
    //  according to the symmetry operation number Nop and places
    //  them into unit cell shifted by cellshift_a a's, cellshift_b
    //  b's and cellshift_c c's.
    //
    //  Return 0 means everything's fine,
    //         1 there's no symmetry operation Nop defined
    //         2 fractionalizing/orthogonalizing matrices were not
    //           calculated
    //         3 cell parameters were not set up.
    int GetTMatrix ( mat44 & TMatrix, int Nop,
                     int cellshift_a, int cellshift_b,
                     int cellshift_c );

    //  GetUCTMatrix(..) calculates and returns the coordinate
    //  transformation matrix, which converts orthogonal coordinates
    //  according to the symmetry operation number Nop. Translation
    //  part of the matrix is being chosen such that point (x,y,z)
    //  has least distance to the center of primary (333) unit cell,
    //  and then it is shifted by cellshift_a a's, cellshift_b b's and
    //  cellshift_c c's.
    //
    //  Return 0 means everything's fine,
    //         1 there's no symmetry operation Nop defined
    //         2 fractionalizing/orthogonalizing matrices were not
    //           calculated
    //         3 cell parameters were not set up.
    int GetUCTMatrix ( mat44 & TMatrix, int Nop,
                       realtype x, realtype y, realtype z,
                       int cellshift_a, int cellshift_b,
                       int cellshift_c );

    //  GetFractMatrix(..) calculates and returns the coordinate
    //  transformation matrix, which converts fractional coordinates
    //  according to the symmetry operation number Nop and places them
    //  into unit cell shifted by cellshift_a a's, cellshift_b b's
    //  and cellshift_c c's.
    //
    //  Return 0 means everything's fine,
    //         1 there's no symmetry operation Nop defined
    //         2 fractionalizing/orthogonalizing matrices were not
    //           calculated
    //         3 cell parameters were not set up.
    int GetFractMatrix ( mat44 & TMatrix, int Nop,
                         int cellshift_a, int cellshift_b,
                         int cellshift_c );


    //  GetSymOpMatrix(..) returns the transformation matrix for
    //  Nop-th symmetry operator in the space group
    //
    //  Return 0 means everything's fine,
    //         1 there's no symmetry operation Nop defined
    //         2 fractionalizing/orthogonalizing matrices were not
    //           calculated
    //         3 cell parameters were not set up.
    //
    int GetSymOpMatrix ( mat44 & TMatrix, int Nop );


    int   AddNCSMatrix    ( mat33 & ncs_m, vect3 & ncs_v, int iGiven );
    int   GenerateNCSMates(); // 1: no NCS matrices, 0: Ok

    pstr  GetEntryID ();
    void  SetEntryID ( const IDCode idCode );

    int   GetNofExpDataRecs();
    pstr  GetExpDataRec ( int recNo );  // 0.. on

    int   GetFileType() { return FType; }

    void  Copy ( PCMMDBFile MMDBFile );

    void  SetShortBinary();  // leaves only coordinates in binary files

    // -------  user-defined data handlers
    int   PutUDData ( int UDDhandle, int      iudd );
    int   PutUDData ( int UDDhandle, realtype rudd );
    int   PutUDData ( int UDDhandle, cpstr    sudd );

    int   GetUDData ( int UDDhandle, int      & iudd );
    int   GetUDData ( int UDDhandle, realtype & rudd );
    int   GetUDData ( int UDDhandle, pstr sudd, int maxLen );
    int   GetUDData ( int UDDhandle, pstr     & sudd );

    // GetStructureTitle() returns the contents of TITLE record
    // unfolded into single line. If Title is missing, returns
    // contents of COMPND(:MOLECULE). If COMPND is missing, returns
    // HEADER. If Header is missing, returns PDB code. If no PDB
    // code is there, returns "Not available".
    pstr  GetStructureTitle ( pstr & L );

  protected :

    word       Flags;    // special effect flags
    int        FType;    // type of last file operation:
                         //    -1 : none
                         //     0 : PDB
                         //     1 : CIF
                         //     2 : BIN
                         // encoded as MMDB_FILE_XXXXX above

    CMMDBTitle  Title;   // title section
    CMMDBCryst  Cryst;   // crystallographic information section
    CUDRegister UDRegister; // register of user-defined data

    int        nModels;  // number of models
    PPCModel   Model;    // array of models [0..nModels-1]

    int        nAtoms;   // number of atoms
    int        AtmLen;   // length of Atom array
    PPCAtom    Atom;     // array of atoms ordered by serial numbers

    CAtomPath  DefPath;  // default coordinate path

    CClassContainer SA;  // string container for unrecognized strings
                         // which are between the title and the
                         // crystallographic sections
    CClassContainer Footnote;  // string container for footnotes
    CClassContainer SB;  // string container for unrecognized strings
                         // which are between the crystallographic and
                         // the coordinate sections
    CClassContainer SC;  // string container for unrecognized strings
                         // following the coordinate section

    //  input buffer
    int         lcount;  // input line counter
    char        S[500];  // read buffer
    PCMMCIFData CIF;     // CIF file manager

    PCModel     crModel; // current model, used at reading a PDB file
    PCChain     crChain; // current chain, used at reading a PDB file
    PCResidue   crRes;   // current residue, used at reading a PDB file

    Boolean     Exclude;            // used internally
    Boolean     ignoreRemarks;      // used temporarily
    Boolean     allowDuplChID;      // used temporarily
    Boolean     enforceUniqueChID;  // used temporarily

    void  InitMMDBFile    ();
    void  FreeCoordMemory ();
    void  ReadPDBLine     ( RCFile f, pstr L, int maxlen );
    int   ReadPDBAtom     ( cpstr L );
    int   ReadCIFAtom     ( PCMMCIFData CIFD   );
    int   CheckAtomPlace  ( int  index, cpstr L );
    int   CheckAtomPlace  ( int  index, PCMMCIFLoop Loop );
    int   SwitchModel     ( cpstr L );
    int   SwitchModel     ( int nM );
    int   AllocateAtom    ( int           index,
                            const ChainID chainID,
                            const ResName resName,
                            int           seqNum,
                            const InsCode insCode,
                            Boolean       Replace );
    void  ExpandAtomArray ( int inc );
    void  AddAtomArray    ( int inc );

    void  ApplyNCSTransform ( int NCSMatrixNo );

    virtual void ResetManager();

    //  ---------------  Stream I/O  -----------------------------
    void  write ( RCFile f );
    void  read  ( RCFile f );

    // don't use _ExcludeModel in your applications!
    int   _ExcludeModel ( int serNum );

    int   CheckInAtom   ( int index, PCAtom A );
    int   CheckInAtoms  ( int index, PPCAtom A, int natms );

    virtual PCMask GetSelMask ( int selHnd );

  private :
    int modelCnt;  // used only at reading files

};



//  isMMDBBIN will return
//    -1   if file FName does not exist
//     0   if file FName is likely a MMDB BIN (binary) file
//     1   if file FName is not a MMDB BIN (binary) file
//     2   if file FName is likely a MMDB BIN (binary) file,
//         but of a wrong edition (i.e. produced by a lower
//         version of MMDB).
extern int isMMDBBIN ( cpstr FName, byte gzipMode=GZM_CHECK );

//  isPDB will return
//    -1   if file FName does not exist
//     0   if file FName is likely a PDB file
//     1   if file FName is not a PDB file
extern int isPDB ( cpstr FName, byte gzipMode=GZM_CHECK,
                   Boolean IgnoreBlankLines=False );

#endif