16int matchpattern(
const char *in,
const char *pattern,
int caseinsensitive)
33 if (*in == 0 || strchr(separators, *in))
39 if(wildcard_least_one)
41 if (*in == 0 || strchr(separators, *in))
48 if (strchr(separators, *in))
63 if (c1 >=
'A' && c1 <=
'Z')
66 if (c2 >=
'A' && c2 <=
'Z')
84 memset(list, 0,
sizeof(*list));
118 textlen =
strlen(text) + 1;
126 return strcasecmp(*(
const char **)
a, *(
const char **)
b);
161 if (strcmp(
name,
".") && strcmp(
name,
".."))
172 char pattern[BUFSIZE] = {0};
173 wchar patternw[BUFSIZE] = {0};
174 char filename[BUFSIZE] = {0};
177 WIN32_FIND_DATAW n_file;
179 dp_strlcpy(pattern, basepath,
sizeof(pattern));
182 fromwtf8(pattern,
strlen(pattern), patternw, BUFSIZE);
184 hFile = FindFirstFileW(patternw, &n_file);
185 if(hFile == INVALID_HANDLE_VALUE)
188 filenamew = n_file.cFileName;
190 while(filenamew[lenw] != 0) ++lenw;
191 towtf8(filenamew, lenw, filename, BUFSIZE);
193 }
while (FindNextFileW(hFile, &n_file) != 0);
203 dpsnprintf(fullpath,
sizeof(fullpath),
"%s%s", basepath, path);
207 if (basepath[0] !=
'/')
211 dpsnprintf(listpath,
sizeof(listpath),
"%sls.txt", fullpath);
218 char *q = strchr(p,
'\n');
229 dir = opendir(fullpath);
233 while ((ent = readdir(
dir)))
int dpsnprintf(char *buffer, size_t buffersize, const char *format,...)
Returns the number of printed characters, excluding the final '\0' or returns -1 if the buffer isn't ...
#define dp_strlcat(dst, src, dsize)
#define dp_strlcpy(dst, src, dsize)
void stringlistfreecontents(stringlist_t *list)
void stringlistinit(stringlist_t *list)
void stringlistsort(stringlist_t *list, qbool uniq)
int matchpattern(const char *in, const char *pattern, int caseinsensitive)
void stringlistappend(stringlist_t *list, const char *text)
static int stringlistsort_cmp(const void *a, const void *b)
static void adddirentry(stringlist_t *list, const char *path, const char *name)
void listdirectory(stringlist_t *list, const char *basepath, const char *path)
int matchpattern_with_separator(const char *in, const char *pattern, int caseinsensitive, const char *separators, qbool wildcard_least_one)
unsigned char * FS_SysLoadFile(const char *path, mempool_t *pool, qbool quiet, fs_offset_t *filesizepointer)
GLenum GLuint GLenum GLsizei const GLchar * buf
#define MAX_OSPATH
max length of a filesystem pathname
int maxstrings
maxstrings changes as needed, causing reallocation of strings[] array