Subversion Repositories SvarDOS

Rev

Rev 1373 | Rev 1375 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1373 Rev 1374
Line 188... Line 188...
188
  if ((FREAD(fd, &hdr, 6) != 6) || (hdr.sig != 0x1a4c7653L) || (hdr.string_count != svarlang_string_count)) {
188
  if ((FREAD(fd, &hdr, 6) != 6) || (hdr.sig != 0x1a4c7653L) || (hdr.string_count != svarlang_string_count)) {
189
    FCLOSE(fd);
189
    FCLOSE(fd);
190
    return(-2);
190
    return(-2);
191
  }
191
  }
192
 
192
 
-
 
193
  for (;;) {
193
  /* read next lang id and string table size in file */
194
    /* read next lang id and string table size in file */
194
  while (FREAD(fd, buff16, 4) == 4) {
195
    if (FREAD(fd, buff16, 4) != 4) {
-
 
196
      FCLOSE(fd);
-
 
197
      return(-3);
-
 
198
    }
195
 
199
 
196
    /* is it the lang I am looking for? */
200
    /* is it the lang I am looking for? */
197
    if (buff16[0] != langid) { /* skip to next lang */
201
    if (buff16[0] == langid) break;
198
      FSEEK(fd, svarlang_string_count * 4);
-
 
199
      FSEEK(fd, buff16[1]);
-
 
200
      continue;
-
 
201
    }
-
 
202
 
202
 
203
    /* found - but do I have enough memory space? */
203
    /* skip to next lang */
204
    if (buff16[1] >= svarlang_memsz) {
204
    FSEEK(fd, svarlang_string_count * 4);
205
      FCLOSE(fd);
-
 
206
      return(-4);
205
    FSEEK(fd, buff16[1]);
207
    }
206
  }
208
 
207
 
209
    /* load dictionary & strings */
208
  /* found - but do I have enough memory space? */
210
    if ((FREAD(fd, svarlang_dict, svarlang_string_count * 4) != svarlang_string_count * 4) ||
-
 
211
       (FREAD(fd, svarlang_mem, buff16[1]) != buff16[1])) {
209
  if (buff16[1] >= svarlang_memsz) {
212
      FCLOSE(fd);
210
    FCLOSE(fd);
213
      return(-7);
211
    return(-4);
214
    }
212
  }
-
 
213
 
-
 
214
  /* load dictionary & strings */
-
 
215
  if ((FREAD(fd, svarlang_dict, svarlang_string_count * 4) != svarlang_string_count * 4) ||
-
 
216
     (FREAD(fd, svarlang_mem, buff16[1]) != buff16[1])) {
215
    FCLOSE(fd);
217
    FCLOSE(fd);
216
    return(0);
218
    return(-5);
217
  }
219
  }
218
 
220
 
219
  FCLOSE(fd);
221
  FCLOSE(fd);
220
  return(-5);
222
  return(0);
221
}
223
}