|
| iMatix home page | << | < | > | >> |
SFLVersion 2.11 |
#include "sfldir.h"
Bool
close_dir (
DIRST *dir)
Close the directory stream, and free any allocated memory. You should call this function when you are done reading a directory, or you will get memory leaks. Returns TRUE if okay, FALSE if there was an error.
{
Bool
rc;
ASSERT (dir != NULL);
mem_free (dir-> dir_name); /* Free dynamically-allocated name */
#if (defined (__UNIX__) || defined (__VMS_XOPEN) || defined (__OS2__))
ASSERT (dir-> _dir_handle);
rc = (closedir (dir-> _dir_handle) == 0);
#elif (defined (WIN32))
rc = FindClose (dir-> _dir_handle);
#elif (defined (_MSC_VER))
rc = TRUE; /* No function to close a dir */
#elif (defined (__TURBOC__) || defined (__DJGPP__))
rc = TRUE; /* No function to close a dir */
#else
rc = FALSE; /* Directory access not supported */
#endif
return (rc);
}
| | << | < | > | >> |
|