libsaria: Remove old readdir() function

It's not used anymore...
This commit is contained in:
Bryan Schumaker 2011-12-30 19:15:03 -05:00
parent ab0e459298
commit a44ecbb795
2 changed files with 0 additions and 41 deletions

View File

@ -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 &);

View File

@ -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 */