1 /* This file is part of the YAZ toolkit.
2 * Copyright (C) 1995-2010 Index Data
3 * See the file LICENSE for details.
7 \brief File globbing (ala POSIX glob)
13 #include <sys/types.h>
18 #include <yaz/wrbuf.h>
19 #include <yaz/tpath.h>
23 struct res_entry *next;
27 struct res_entry *entries;
30 typedef struct glob_res *yaz_glob_res_t;
32 static void glob_r(const char *pattern, yaz_glob_res_t res, size_t off)
35 while (pattern[i] && !strchr("/\\", pattern[i]))
39 int yaz_file_glob(const char *pattern, yaz_glob_res_t *res)
41 *res = xmalloc(sizeof(**res));
43 glob_r(pattern, *res, 0);
50 * c-file-style: "Stroustrup"
51 * indent-tabs-mode: nil
53 * vim: shiftwidth=4 tabstop=8 expandtab