+WORD fgetword(FILE *stream)
+{
+ WORD aword;
+ fread(&aword, sizeof(WORD), 1, stream);
+ return aword;
+}
+
+void fungetword(FILE *stream)
+{
+ fseek(stream, -sizeof(WORD), SEEK_CUR);
+}
+
+WORD zero_data_cnt(FILE *stream)
+{
+ WORD cnt = 0, word = 0;
+ while(!feof(stream) && word == 0) {
+ word = fgetword(stream);
+ cnt++;
+ }
+ if(!feof(stream)) {
+ fungetword(stream);
+ }
+ return cnt;
+}
+