diff options
| author | oy <Tom_Adams@web.de> | 2010-09-24 13:38:03 +0200 |
|---|---|---|
| committer | oy <Tom_Adams@web.de> | 2010-09-24 13:38:03 +0200 |
| commit | 7e0b37e06c71dc96d68f3352ecd2c799caaaf8ec (patch) | |
| tree | b76100af28ae1fecb480ff02ae42f24507e92d06 /src/base | |
| parent | 1cbf731fc0c3cbc5a1d2be6f1af51cb93d9739e2 (diff) | |
| download | zcatch-7e0b37e06c71dc96d68f3352ecd2c799caaaf8ec.tar.gz zcatch-7e0b37e06c71dc96d68f3352ecd2c799caaaf8ec.zip | |
fixed that it checks the current dir for demos too
Diffstat (limited to 'src/base')
| -rw-r--r-- | src/base/system.c | 6 | ||||
| -rw-r--r-- | src/base/system.h | 5 |
2 files changed, 6 insertions, 5 deletions
diff --git a/src/base/system.c b/src/base/system.c index 5312a705..9788e625 100644 --- a/src/base/system.c +++ b/src/base/system.c @@ -863,7 +863,7 @@ int net_init() return 0; } -int fs_listdir(const char *dir, FS_LISTDIR_CALLBACK cb, void *user) +int fs_listdir(const char *dir, FS_LISTDIR_CALLBACK cb, int type, void *user) { #if defined(CONF_FAMILY_WINDOWS) WIN32_FIND_DATA finddata; @@ -880,7 +880,7 @@ int fs_listdir(const char *dir, FS_LISTDIR_CALLBACK cb, void *user) do { if(finddata.cFileName[0] != '.') - cb(finddata.cFileName, 0, user); + cb(finddata.cFileName, 0, type, user); } while (FindNextFileA(handle, &finddata)); FindClose(handle); @@ -893,7 +893,7 @@ int fs_listdir(const char *dir, FS_LISTDIR_CALLBACK cb, void *user) return 0; while((entry = readdir(d)) != NULL) - cb(entry->d_name, 0, user); + cb(entry->d_name, 0, type, user); /* close the directory and return */ closedir(d); diff --git a/src/base/system.h b/src/base/system.h index a5b549bc..2ef7a9f3 100644 --- a/src/base/system.h +++ b/src/base/system.h @@ -888,13 +888,14 @@ void str_hex(char *dst, int dst_size, const void *data, int data_size); Parameters: dir - Directory to list cb - Callback function to call for each entry + type - Type of the directory user - Pointer to give to the callback Returns: Always returns 0. */ -typedef void (*FS_LISTDIR_CALLBACK)(const char *name, int is_dir, void *user); -int fs_listdir(const char *dir, FS_LISTDIR_CALLBACK cb, void *user); +typedef void (*FS_LISTDIR_CALLBACK)(const char *name, int is_dir, int dir_type, void *user); +int fs_listdir(const char *dir, FS_LISTDIR_CALLBACK cb, int type, void *user); /* Function: fs_makedir |