diff options
author | Richard Wilson <rjw@netsurf-browser.org> | 2004-11-07 19:19:11 +0000 |
---|---|---|
committer | Richard Wilson <rjw@netsurf-browser.org> | 2004-11-07 19:19:11 +0000 |
commit | 5e41fb8a121c441a8765a1962a892e93906cde83 (patch) | |
tree | 0fd0a6aa6adbd7275b7a2fd9216d1e063a968ad0 /utils/utils.c | |
download | nstheme-5e41fb8a121c441a8765a1962a892e93906cde83.tar.gz nstheme-5e41fb8a121c441a8765a1962a892e93906cde83.tar.bz2 |
[project @ 2004-11-07 19:19:11 by rjw]
Initial import.
svn path=/import/nstheme/; revision=2436
Diffstat (limited to 'utils/utils.c')
-rw-r--r-- | utils/utils.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/utils/utils.c b/utils/utils.c new file mode 100644 index 0000000..4e7d80f --- /dev/null +++ b/utils/utils.c @@ -0,0 +1,30 @@ +/* + * This file is part of NetSurf, http://netsurf.sourceforge.net/ + * Licensed under the GNU General Public License, + * http://www.opensource.org/licenses/gpl-license + * Copyright 2004 James Bursa <bursa@users.sourceforge.net> + * Copyright 2003 Phil Mellor <monkeyson@users.sourceforge.net> + * Copyright 2003 John M Bell <jmb202@ecs.soton.ac.uk> + * Copyright 2004 John Tytgat <John.Tytgat@aaug.net> + */ + +#include <stdlib.h> +#include <stdio.h> +#include <string.h> +#include <sys/stat.h> +#include <sys/types.h> +#include "nstheme/utils/utils.h" + +/** + * Check if a directory exists. + */ + +bool is_dir(const char *path) +{ + struct stat s; + + if (stat(path, &s)) + return false; + + return S_ISDIR(s.st_mode) ? true : false; +} |