Stats function that ioftpd has, relies on several APIs. Stats function is something as simple as:
if (! FindFirstUser(Search, &UserFile, &Buffer))
{
do
{
// binary search like algorith that inserts user into array (something i call, quick insert)
// remove last item from array, if size == max_size
} while (! FindNextUser(&UserFile, &Buffer));
}
for (i=0;i<arraysize;i++)
{
MessageFile_ShowCached(Cache, UserFileArray[i], DT_USERFILE);
}
=> To make sense of it, you would need ~10k lines of sources.
|