libsaria: Remove old readdir() function
It's not used anymore...
This commit is contained in:
parent
ab0e459298
commit
a44ecbb795
|
@ -15,7 +15,6 @@ struct file
|
|||
sid_t d_sid;
|
||||
};
|
||||
|
||||
void readdir(string, list<file> &, list<file> &);
|
||||
string get_saria_dir();
|
||||
void make_saria_dir();
|
||||
bool get_inode(string, sid_t &);
|
||||
|
|
|
@ -12,46 +12,6 @@ using namespace std;
|
|||
#define __USE_BSD
|
||||
#endif
|
||||
|
||||
static void sort_entry(struct dirent *dirp, list<file> &files, list<file> &dirs)
|
||||
{
|
||||
struct file entry;
|
||||
|
||||
if (dirp == NULL)
|
||||
return;
|
||||
|
||||
entry.name = dirp->d_name;
|
||||
entry.d_sid = dirp->d_ino;
|
||||
if (entry.name == "." || entry.name == "..")
|
||||
return;
|
||||
|
||||
switch(dirp->d_type) {
|
||||
case DT_DIR:
|
||||
dirs.push_back(entry);
|
||||
break;
|
||||
case DT_REG:
|
||||
files.push_back(entry);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void readdir(string dir, list<file> &files, list<file> &dirs)
|
||||
{
|
||||
DIR *dp;
|
||||
struct dirent *dirp;
|
||||
|
||||
dp = opendir(dir.c_str());
|
||||
if (dp == NULL)
|
||||
return;
|
||||
|
||||
do {
|
||||
dirp = readdir(dp);
|
||||
sort_entry(dirp, files, dirs);
|
||||
} while (dirp != NULL);
|
||||
|
||||
closedir(dp);
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
static string SARIA_DIR = "/saria-debug";
|
||||
#else /* DEBUG */
|
||||
|
|
Loading…
Reference in New Issue