Rev 6251 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 6251 | Rev 7278 | ||
---|---|---|---|
1 | BDVK file_info_count; |
1 | BDVK file_info_count; |
2 | int file_count_copy; |
2 | int file_count_copy; |
3 | 3 | ||
4 | void DirFileCount(dword way) |
4 | void DirFileCount(dword way) |
5 | { |
5 | { |
6 | dword dirbuf, fcount, i, filename; |
6 | dword dirbuf, fcount, i, filename; |
7 | dword cur_file; |
7 | dword cur_file; |
8 | if (dir_exists(way)) |
8 | if (dir_exists(way)) |
9 | { |
9 | { |
10 | cur_file = malloc(4096); |
10 | cur_file = malloc(4096); |
11 | // In the process of recursive descent, memory must be allocated dynamically, because the static memory -> was a bug !!! But unfortunately pass away to sacrifice speed. |
11 | // In the process of recursive descent, memory must be allocated |
- | 12 | // dynamically, because the static variable cause a fault!!! |
|
- | 13 | // But unfortunately pass away to sacrifice speed. |
|
12 | GetDir(#dirbuf, #fcount, way, DIRS_ONLYREAL); |
14 | GetDir(#dirbuf, #fcount, way, DIRS_ONLYREAL); |
13 | filename = dirbuf+72; |
15 | filename = dirbuf+72; |
14 | for (i=0; i |
16 | for (i=0; i |
15 | { |
17 | { |
16 | filename += 304; |
18 | filename += 304; |
17 | sprintf(cur_file,"%s/%s",way,filename); |
19 | sprintf(cur_file,"%s/%s",way,filename); |
18 | 20 | ||
19 | if (TestBit(ESDWORD[filename-40], 4) ) |
21 | if (TestBit(ESDWORD[filename-40], 4) ) |
20 | { |
22 | { |
21 | file_count_copy++; |
23 | file_count_copy++; |
22 | DirFileCount(cur_file); |
24 | DirFileCount(cur_file); |
23 | } |
25 | } |
24 | else |
26 | else |
25 | { |
27 | { |
26 | file_count_copy++; |
28 | file_count_copy++; |
27 | } |
29 | } |
28 | } |
30 | } |
29 | free(cur_file); |
31 | free(cur_file); |
30 | } |
32 | } |
31 | } |
33 | } |