| 4 | 
  | 
} | 
| 5 | 
  | 
 | 
| 6 | 
  | 
PDBReader::~PDBReader(void) { | 
| 7 | 
< | 
  gzclose(PDBfile); | 
| 7 | 
> | 
  fclose(PDBfile); | 
| 8 | 
  | 
} | 
| 9 | 
  | 
 | 
| 10 | 
  | 
 | 
| 11 | 
< | 
void PDBReader::setPDBfile(const char *fname) { | 
| 12 | 
< | 
  PDBfile = gzopen(fname, "r"); | 
| 13 | 
< | 
  if (PDBfile == Z_NULL) {  | 
| 11 | 
> | 
void PDBReader::setPDBfileName(const char *fname) { | 
| 12 | 
> | 
  PDBfile = fopen(fname, "r"); | 
| 13 | 
> | 
  if (PDBfile == NULL) {  | 
| 14 | 
  | 
    printf("Could not open PDB file %s\n", fname); | 
| 15 | 
  | 
    exit(-1); | 
| 16 | 
< | 
  } | 
| 16 | 
> | 
  } else  | 
| 17 | 
> | 
    setPDBfile(PDBfile); | 
| 18 | 
  | 
} | 
| 19 | 
  | 
 | 
| 20 | 
+ | 
void PDBReader::setPDBfile(FILE* myFile) { | 
| 21 | 
+ | 
  PDBfile = myFile; | 
| 22 | 
+ | 
} | 
| 23 | 
+ | 
 | 
| 24 | 
  | 
vector<VDWAtom*> PDBReader::getAtomList() { | 
| 25 | 
  | 
 | 
| 26 | 
  | 
  char numstr[9]; | 
| 36 | 
  | 
  ta = getTotAtoms(); | 
| 37 | 
  | 
  theAtoms.reserve(ta); | 
| 38 | 
  | 
 | 
| 39 | 
< | 
  gzrewind(PDBfile); | 
| 39 | 
> | 
  rewind(PDBfile); | 
| 40 | 
  | 
 | 
| 41 | 
< | 
  while (!gzeof(PDBfile)) { | 
| 42 | 
< | 
    gzgets(PDBfile, buf, 150); | 
| 41 | 
> | 
  while (!feof(PDBfile)) { | 
| 42 | 
> | 
    fgets( buf, 150, PDBfile); | 
| 43 | 
  | 
    if (!strcmp(buf, "END") ||  | 
| 44 | 
  | 
        !strncmp(buf, "END ", 4) ||  | 
| 45 | 
  | 
        !strncmp(buf, "TER ", 4) ||  | 
| 89 | 
  | 
unsigned int PDBReader::getTotAtoms(void) { | 
| 90 | 
  | 
  char buf[150]; | 
| 91 | 
  | 
  unsigned int ta = 0; | 
| 92 | 
< | 
  gzrewind(PDBfile); | 
| 93 | 
< | 
  while (!gzeof(PDBfile)) { | 
| 94 | 
< | 
    gzgets(PDBfile,buf,150); | 
| 92 | 
> | 
  rewind(PDBfile); | 
| 93 | 
> | 
  while (!feof(PDBfile)) { | 
| 94 | 
> | 
    fgets(buf,150,PDBfile); | 
| 95 | 
  | 
    if (!strcmp(buf, "END") || | 
| 96 | 
  | 
        !strncmp(buf, "END ", 4) || | 
| 97 | 
  | 
        !strncmp(buf, "TER ", 4) || |