Ejemplo n.º 1
0
static FileList
wildcardFileList(const char *wildcard)
{
    const char *basename;
    FileList fl = FileList_new(16);
    WildcardIterator it = WildcardIterator_for(wildcard);
    if (it == NULL)
	return NULL;
    while ((basename = WildcardIterator_next(it)) != NULL)
	if (isJarFileName(basename))
	    FileList_add(fl, wildcardConcat(wildcard, basename));
    WildcardIterator_close(it);
    return fl;
}
Ejemplo n.º 2
0
static FileList
FileList_split(const char *path, char sep)
{
    const char *p, *q;
    int len = (int)JLI_StrLen(path);
    int count;
    FileList fl;
    for (count = 1, p = path; p < path + len; p++)
        count += (*p == sep);
    fl = FileList_new(count);
    for (p = path;;) {
        for (q = p; q <= path + len; q++) {
            if (*q == sep || *q == '\0') {
                FileList_addSubstring(fl, p, q - p);
                if (*q == '\0')
                    return fl;
                p = q + 1;
            }
        }
    }
}