| 80 | } |
| 81 | |
| 82 | int vtkMultiBlockPLOT3DReaderInternals::CheckByteCount(FILE* fp) |
| 83 | { |
| 84 | clearerr(fp); // clear error and EOF flags |
| 85 | fseek(fp, 0, SEEK_SET); // move to beginning |
| 86 | // Read the first integer, then skip by that many bytes, then |
| 87 | // read the value again. If the two match, it is likely that |
| 88 | // the file has byte counts. |
| 89 | int count; |
| 90 | if (!this->ReadInts(fp, 1, &count)) |
| 91 | { |
| 92 | return 0; |
| 93 | } |
| 94 | if (fseek(fp, count, SEEK_CUR) != 0) |
| 95 | { |
| 96 | return 0; |
| 97 | } |
| 98 | int count2; |
| 99 | if (!this->ReadInts(fp, 1, &count2)) |
| 100 | { |
| 101 | return 0; |
| 102 | } |
| 103 | if (count == count2) |
| 104 | { |
| 105 | this->Settings.HasByteCount = 1; |
| 106 | } |
| 107 | else |
| 108 | { |
| 109 | this->Settings.HasByteCount = 0; |
| 110 | } |
| 111 | return 1; |
| 112 | } |
| 113 | |
| 114 | int vtkMultiBlockPLOT3DReaderInternals::CheckMultiGrid(FILE* fp) |
| 115 | { |
no test coverage detected