diff options
-rw-r--r-- | src/externs.h | 1 | ||||
-rw-r--r-- | src/init2.cc | 6 | ||||
-rw-r--r-- | src/main-gcu.c | 30 | ||||
-rw-r--r-- | src/main-gtk2.c | 30 | ||||
-rw-r--r-- | src/main-win.c | 24 | ||||
-rw-r--r-- | src/main-x11.c | 33 | ||||
-rw-r--r-- | src/main-xaw.c | 30 | ||||
-rw-r--r-- | src/util.cc | 7 | ||||
-rw-r--r-- | src/z-term.c | 3 | ||||
-rw-r--r-- | src/z-term.h | 4 |
10 files changed, 0 insertions, 168 deletions
diff --git a/src/externs.h b/src/externs.h index 854854ea..42b13912 100644 --- a/src/externs.h +++ b/src/externs.h @@ -1927,7 +1927,6 @@ extern void enter_quest(void); extern void select_bounties(void); /* util.c */ -extern void scansubdir(cptr dir); extern s32b rescale(s32b x, s32b max, s32b new_max); extern bool_ input_box(cptr text, int y, int x, char *buf, int max); extern void draw_box(int y, int x, int h, int w); diff --git a/src/init2.cc b/src/init2.cc index a32a57f4..c8da918d 100644 --- a/src/init2.cc +++ b/src/init2.cc @@ -1639,12 +1639,6 @@ static void init_basic() /* Extended trigger macros */ cli_info = make_array<cli_comm>(CLI_MAX); - - /* Wipe the directory list */ - for (i = 0; i < 255; i++) - { - scansubdir_result[i] = NULL; - } } diff --git a/src/main-gcu.c b/src/main-gcu.c index 4e259a65..1562f15c 100644 --- a/src/main-gcu.c +++ b/src/main-gcu.c @@ -760,36 +760,6 @@ static errr Term_xtra_gcu(int n, int v) return ret; } - /* Subdirectory scan */ - case TERM_XTRA_SCANSUBDIR: - { - DIR *directory; - struct dirent *entry; - - scansubdir_max = 0; - - directory = opendir(scansubdir_dir); - if (!directory) - return 1; - - while ((entry = readdir(directory))) - { - char file[PATH_MAX + NAME_MAX + 2]; - struct stat filedata; - - file[PATH_MAX + NAME_MAX] = 0; - strncpy(file, scansubdir_dir, PATH_MAX); - strncat(file, "/", 2); - strncat(file, entry->d_name, NAME_MAX); - if (!stat(file, &filedata) && S_ISDIR((filedata.st_mode))) - { - string_free(scansubdir_result[scansubdir_max]); - scansubdir_result[scansubdir_max] = string_make(entry->d_name); - ++scansubdir_max; - } - } - } - /* React to events */ case TERM_XTRA_REACT: Term_xtra_gcu_react(); diff --git a/src/main-gtk2.c b/src/main-gtk2.c index 102a8b7b..07b86430 100644 --- a/src/main-gtk2.c +++ b/src/main-gtk2.c @@ -2730,36 +2730,6 @@ static errr Term_xtra_gtk(int n, int v) return ret; } - /* Subdirectory scan */ - case TERM_XTRA_SCANSUBDIR: - { - DIR *directory; - struct dirent *entry; - - scansubdir_max = 0; - - directory = opendir(scansubdir_dir); - if (!directory) return (1); - - while ((entry = readdir(directory)) != NULL) - { - char file[PATH_MAX + NAME_MAX + 2]; - struct stat filedata; - - file[PATH_MAX + NAME_MAX] = 0; - strncpy(file, scansubdir_dir, PATH_MAX); - strncat(file, "/", 2); - strncat(file, entry->d_name, NAME_MAX); - if ((stat(file, &filedata) == 0) && S_ISDIR(filedata.st_mode)) - { - string_free(scansubdir_result[scansubdir_max]); - scansubdir_result[scansubdir_max] = - string_make(entry->d_name); - ++scansubdir_max; - } - } - } - /* Rename main window */ case TERM_XTRA_RENAME_MAIN_WIN: gtk_window_set_title(GTK_WINDOW(data[0].window), angband_term_name[0]); return (0); diff --git a/src/main-win.c b/src/main-win.c index 2d740034..91d6b0f3 100644 --- a/src/main-win.c +++ b/src/main-win.c @@ -1824,30 +1824,6 @@ static errr Term_xtra_win(int n, int v) return 0; } - /* - * Scans for subdirectories in a directory "scansubdir_dir" - * and place teh result in "scansubdir_result/scansubdir_max" - */ - case TERM_XTRA_SCANSUBDIR: - { - BOOL ok; - HANDLE h; - WIN32_FIND_DATA fd; - for (h = FindFirstFile(format("%s\\*", scansubdir_dir), &fd), ok = 1; - h != INVALID_HANDLE_VALUE && ok; - ok = FindNextFile(h, &fd)) - { - if ((fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) && (strcmp(fd.cFileName, ".")) && (strcmp(fd.cFileName, ".."))) - { - string_free(scansubdir_result[scansubdir_max]); - scansubdir_result[scansubdir_max] = string_make(fd.cFileName); - scansubdir_max++; - } - } - - return 0; - } - /* Rename main window */ case TERM_XTRA_RENAME_MAIN_WIN: SetWindowText(get_main_hwnd(), angband_term_name[0]); return (0); diff --git a/src/main-x11.c b/src/main-x11.c index 9a106bd6..bccb4d85 100644 --- a/src/main-x11.c +++ b/src/main-x11.c @@ -2121,39 +2121,6 @@ static errr Term_xtra_x11(int n, int v) return ret; } - /* Subdirectory scan */ - case TERM_XTRA_SCANSUBDIR: - { - DIR *directory; - struct dirent *entry; - - scansubdir_max = 0; - - directory = opendir(scansubdir_dir); - if (!directory) - return 1; - - while ((entry = readdir(directory))) - { - char file[PATH_MAX + NAME_MAX + 2]; - struct stat filedata; - - file[PATH_MAX + NAME_MAX] = 0; - strncpy(file, scansubdir_dir, PATH_MAX); - strncat(file, "/", 2); - strncat(file, entry->d_name, NAME_MAX); - if (!stat(file, &filedata) && S_ISDIR((filedata.st_mode))) - { - string_free(scansubdir_result[scansubdir_max]); - scansubdir_result[scansubdir_max] = string_make(entry->d_name); - ++scansubdir_max; - } - } - - closedir(directory); - return 0; - } - /* React to changes */ case TERM_XTRA_REACT: return (Term_xtra_x11_react()); diff --git a/src/main-xaw.c b/src/main-xaw.c index 8de36a95..d7d3f345 100644 --- a/src/main-xaw.c +++ b/src/main-xaw.c @@ -1452,36 +1452,6 @@ static errr Term_xtra_xaw(int n, int v) return ret; } - /* Subdirectory scan */ - case TERM_XTRA_SCANSUBDIR: - { - DIR *directory; - struct dirent *entry; - - scansubdir_max = 0; - - directory = opendir(scansubdir_dir); - if (!directory) - return 1; - - while (entry = readdir(directory)) - { - char file[PATH_MAX + NAME_MAX + 2]; - struct stat filedata; - - file[PATH_MAX + NAME_MAX] = 0; - strncpy(file, scansubdir_dir, PATH_MAX); - strncat(file, "/", 2); - strncat(file, entry->d_name, NAME_MAX); - if (!stat(file, &filedata) && S_ISDIR((filedata.st_mode))) - { - string_free(scansubdir_result[scansubdir_max]); - scansubdir_result[scansubdir_max] = string_make(entry->d_name); - ++scansubdir_max; - } - } - } - case TERM_XTRA_REACT: return (Term_xtra_xaw_react()); } diff --git a/src/util.cc b/src/util.cc index 8be52b68..e5f43ab6 100644 --- a/src/util.cc +++ b/src/util.cc @@ -3901,13 +3901,6 @@ s32b rescale(s32b x, s32b max, s32b new_max) return (x * new_max) / max; } -/* Nicer wrapper around TERM_XTRA_SCANSUBDIR */ -void scansubdir(cptr dir) -{ - strnfmt(scansubdir_dir, 1024, "%s", dir); - Term_xtra(TERM_XTRA_SCANSUBDIR, 0); -} - /* * Timers */ diff --git a/src/z-term.c b/src/z-term.c index c8d30941..dfd80051 100644 --- a/src/z-term.c +++ b/src/z-term.c @@ -432,9 +432,6 @@ errr Term_user(int n) * And *hacky* get a return code */ long Term_xtra_long; -char scansubdir_dir[1024]; -int scansubdir_max = 0; -cptr scansubdir_result[255]; errr Term_xtra(int n, int v) { /* Verify the hook */ diff --git a/src/z-term.h b/src/z-term.h index 2e27173f..fd1955fa 100644 --- a/src/z-term.h +++ b/src/z-term.h @@ -271,7 +271,6 @@ struct term #define TERM_XTRA_LEVEL 12 /* Change the "soft" level (optional) */ #define TERM_XTRA_DELAY 13 /* Delay some milliseconds (optional) */ #define TERM_XTRA_GET_DELAY 14 /* Get the cuyrrent time in milliseconds (optional) */ -#define TERM_XTRA_SCANSUBDIR 15 /* Scan for subdir in a dir */ #define TERM_XTRA_RENAME_MAIN_WIN 16 /* Rename the main game window */ @@ -284,9 +283,6 @@ extern term *Term; extern errr Term_user(int n); extern errr Term_xtra(int n, int v); extern long Term_xtra_long; -extern char scansubdir_dir[1024]; -extern int scansubdir_max; -extern cptr scansubdir_result[255]; extern void Term_queue_char(int x, int y, byte a, char c, byte ta, char tc, byte ea, char ec); extern void Term_queue_line(int x, int y, int n, byte *a, char *c, byte *ta, char *tc, byte *ea, char *ec); |