1 /* $Id$ */ 2 /* Copyright (c) 2012-2014 Pierre Pronchery <khorben@defora.org> */ 3 /* This file is part of DeforaOS Desktop Browser */ 4 /* Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions are 6 * met: 7 * 8 * 1. Redistributions of source code must retain the above copyright notice, 9 * this list of conditions and the following disclaimer. 10 * 11 * 2. Redistributions in binary form must reproduce the above copyright notice, 12 * this list of conditions and the following disclaimer in the documentation 13 * and/or other materials provided with the distribution. 14 * 15 * 3. Neither the name of the authors nor the names of the contributors may be 16 * used to endorse or promote products derived from this software without 17 * specific prior written permission. 18 * 19 * THIS SOFTWARE IS PROVIDED BY ITS AUTHORS AND CONTRIBUTORS "AS IS" AND ANY 20 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 21 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 22 * DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR ANY 23 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 24 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 25 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 26 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 28 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ 29 30 31 32 #ifndef DESKTOP_BROWSER_VFS_H 33 # define DESKTOP_BROWSER_VFS_H 34 35 # include <sys/stat.h> 36 # include <dirent.h> 37 # include <gtk/gtk.h> 38 # include <Desktop/mime.h> 39 40 41 /* public */ 42 /* functions */ 43 /* accessors */ 44 int browser_vfs_is_mountpoint(struct stat * lst, dev_t parent); 45 46 /* useful */ 47 /* DIR */ 48 DIR * browser_vfs_opendir(char const * filename, struct stat * st); 49 int browser_vfs_closedir(DIR * dir); 50 struct dirent * browser_vfs_readdir(DIR * dir); 51 52 /* Mime */ 53 GdkPixbuf * browser_vfs_mime_icon(Mime * mime, char const * filename, 54 char const * type, struct stat * lst, struct stat * st, 55 int size); 56 char const * browser_vfs_mime_type(Mime * mime, char const * filename, 57 mode_t mode); 58 59 /* stat */ 60 int browser_vfs_lstat(char const * filename, struct stat * st); 61 int browser_vfs_stat(char const * filename, struct stat * st); 62 63 #endif /* !DESKTOP_BROWSER_VFS_H */ 64