NetSurf
dirent.h
Go to the documentation of this file.
1/*
2 * Copyright 2016 Vincent Sanders <vince@netsurf-browser.org>
3 *
4 * This file is part of NetSurf, http://www.netsurf-browser.org/
5 *
6 * NetSurf is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * NetSurf is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19/**
20 * \file
21 * directory traversal and entry
22 *
23 * This allows the obtaining of standard directory entry routines
24 * functions in a uniform way despite any oddities in headers and
25 * supported API between OS.
26 *
27 * \note This functionality was previously provided as a side effect of the
28 * utils config header include.
29 */
30
31#ifndef NETSURF_UTILS_DIRENT_H
32#define NETSURF_UTILS_DIRENT_H
33
34#include "utils/config.h"
35
36#include <dirent.h>
37
38#ifndef HAVE_SCANDIR
39
40int alphasort(const struct dirent **d1, const struct dirent **d2);
41int scandir(const char *dir, struct dirent ***namelist,
42 int (*sel)(const struct dirent *),
43 int (*compar)(const struct dirent **, const struct dirent **));
44#endif
45
46#endif
directory traversal and entry
int alphasort(const struct dirent **d1, const struct dirent **d2)
Definition: os3support.c:184
int scandir(const char *dir, struct dirent ***namelist, int(*sel)(const struct dirent *), int(*compar)(const struct dirent **, const struct dirent **))
Definition: os3support.c:190
static int compar(const void *va, const void *vb)
Quick sort comparison.