2001-01-25 10:37:55 +01:00
|
|
|
/* vi: set ts=2:
|
|
|
|
*
|
2001-04-14 13:39:14 +02:00
|
|
|
*
|
2003-07-29 11:48:03 +02:00
|
|
|
* Eressea PB(E)M host Copyright (C) 1998-2003
|
2001-01-25 10:37:55 +01:00
|
|
|
* Christian Schlittchen (corwin@amber.kn-bremen.de)
|
|
|
|
* Katja Zedel (katze@felidae.kn-bremen.de)
|
|
|
|
* Henning Peters (faroul@beyond.kn-bremen.de)
|
2007-09-02 20:11:17 +02:00
|
|
|
* Enno Rehling (enno@eressea.de)
|
2001-01-25 10:37:55 +01:00
|
|
|
* Ingo Wilken (Ingo.Wilken@informatik.uni-oldenburg.de)
|
|
|
|
*
|
|
|
|
* This program may not be used, modified or distributed without
|
|
|
|
* prior permission by the authors of Eressea.
|
|
|
|
*/
|
|
|
|
|
2004-08-07 09:42:22 +02:00
|
|
|
#ifdef _MSC_VER
|
2001-01-25 10:37:55 +01:00
|
|
|
#include <config.h>
|
|
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include "windir.h"
|
|
|
|
|
|
|
|
DIR *
|
|
|
|
opendir(const char *name)
|
|
|
|
{
|
|
|
|
static DIR direct;
|
|
|
|
|
|
|
|
direct.first = 1;
|
|
|
|
_searchenv(name, "ERESSEA_PATH", direct.name);
|
|
|
|
if (*direct.name != '\0')
|
|
|
|
return &direct;
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
struct dirent *
|
|
|
|
readdir(DIR * thedir)
|
|
|
|
{
|
|
|
|
static struct _finddata_t ft;
|
|
|
|
static struct dirent de;
|
|
|
|
char where[_MAX_PATH];
|
|
|
|
|
|
|
|
strcat(strcpy(where, thedir->name), "/*");
|
|
|
|
if (thedir->first) {
|
|
|
|
thedir->first = 0;
|
|
|
|
de.hnd = _findfirst(where, &ft);
|
|
|
|
} else {
|
|
|
|
if (_findnext(de.hnd, &ft) != 0)
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
_splitpath(ft.name, de.d_drive, de.d_dir, de.d_name, de.d_ext);
|
|
|
|
return &de;
|
|
|
|
}
|
|
|
|
#endif
|