returns the total number of strings in all the string table files returns 0 on error
| 440 | // returns the total number of strings in all the string table files |
| 441 | // returns 0 on error |
| 442 | int GetTotalStringCount(void) { |
| 443 | int scount = 0; |
| 444 | int findex = 0; |
| 445 | CFILE *file; |
| 446 | char tempbuffer[MAX_LINE_LENGTH + 1]; |
| 447 | ASSERT(Localization_language != -1); |
| 448 | |
| 449 | while (String_table_list[findex]) { |
| 450 | // open the file up |
| 451 | char fname[_MAX_PATH]; |
| 452 | FixFilenameCase(String_table_list[findex], fname); |
| 453 | file = cfopen(fname, "rt"); |
| 454 | if (!file) |
| 455 | return 0; |
| 456 | |
| 457 | while (!cfeof(file)) { |
| 458 | cf_ReadString(tempbuffer, MAX_LINE_LENGTH + 1, file); |
| 459 | if (_parse_line_information(tempbuffer) == Localization_language) |
| 460 | scount++; |
| 461 | } |
| 462 | |
| 463 | cfclose(file); |
| 464 | findex++; |
| 465 | } |
| 466 | return scount; |
| 467 | } |
| 468 | |
| 469 | // Loads a string table file, returns number of strings read if everything went ok,else 0 |
| 470 | int LoadStringFile(const char *filename, int starting_offset) { |
no test coverage detected