version 1.1 | | version 1.2 |
---|
| | |
//end addition -MM | | //end addition -MM |
| | |
#if defined(__DJGPP__) || defined(__LINUX__) | | #if defined(__DJGPP__) || defined(__LINUX__) |
#include <glob.h> | | |
| | |
int d_glob(const char *pattern, d_glob_t *g) | | //nothing to do, but we don't want to fall into the #error below. |
{ | | |
glob_t a; | | |
int r; | | |
| | |
Assert(g!=NULL); | | |
| | |
a.gl_offs=0; | | |
| | |
r=glob(pattern,0,NULL,&a); | | |
g->gl_pathc=a.gl_pathc; | | |
g->gl_pathv=a.gl_pathv; | | |
return r; | | |
} | | |
| | |
void d_globfree(d_glob_t *g) | | |
{ | | |
#ifndef __LINUX__ // Linux doesn't believe in freeing glob structures... :-) | | |
glob_t a; | | |
| | |
Assert (g!=NULL); | | |
| | |
a.gl_offs=0; | | |
a.gl_pathc=g->gl_pathc; | | |
a.gl_pathv=g->gl_pathv; | | |
| | |
globfree(&a); | | |
#endif | | |
} | | |
| | |
#elif defined(__WINDOWS__) | | #elif defined(__WINDOWS__) |
| | |