ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/SHAPES/PDBReader.cpp
(Generate patch)

Comparing trunk/SHAPES/PDBReader.cpp (file contents):
Revision 1240 by gezelter, Fri Jun 4 16:11:27 2004 UTC vs.
Revision 1360 by gezelter, Tue Jul 20 20:02:15 2004 UTC

# Line 4 | Line 4 | PDBReader::~PDBReader(void) {
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];
# Line 31 | Line 36 | vector<VDWAtom*> PDBReader::getAtomList() {
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) ||
# Line 84 | Line 89 | unsigned int PDBReader::getTotAtoms(void) {
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) ||

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines