13781343738de4abddf56982325a77bd70a98cd26Alexander Larsson/* GIO - GLib Input, Output and Streaming Library 2f2a2d6c9ac2d98b565005d446fde01aac47f7d88Michael Natterer * 33781343738de4abddf56982325a77bd70a98cd26Alexander Larsson * Copyright (C) 2006-2007 Red Hat, Inc. 43781343738de4abddf56982325a77bd70a98cd26Alexander Larsson * 53781343738de4abddf56982325a77bd70a98cd26Alexander Larsson * This library is free software; you can redistribute it and/or 63781343738de4abddf56982325a77bd70a98cd26Alexander Larsson * modify it under the terms of the GNU Lesser General Public 73781343738de4abddf56982325a77bd70a98cd26Alexander Larsson * License as published by the Free Software Foundation; either 83781343738de4abddf56982325a77bd70a98cd26Alexander Larsson * version 2 of the License, or (at your option) any later version. 93781343738de4abddf56982325a77bd70a98cd26Alexander Larsson * 103781343738de4abddf56982325a77bd70a98cd26Alexander Larsson * This library is distributed in the hope that it will be useful, 113781343738de4abddf56982325a77bd70a98cd26Alexander Larsson * but WITHOUT ANY WARRANTY; without even the implied warranty of 123781343738de4abddf56982325a77bd70a98cd26Alexander Larsson * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 133781343738de4abddf56982325a77bd70a98cd26Alexander Larsson * Lesser General Public License for more details. 143781343738de4abddf56982325a77bd70a98cd26Alexander Larsson * 153781343738de4abddf56982325a77bd70a98cd26Alexander Larsson * You should have received a copy of the GNU Lesser General 163781343738de4abddf56982325a77bd70a98cd26Alexander Larsson * Public License along with this library; if not, write to the 173781343738de4abddf56982325a77bd70a98cd26Alexander Larsson * Free Software Foundation, Inc., 59 Temple Place, Suite 330, 183781343738de4abddf56982325a77bd70a98cd26Alexander Larsson * Boston, MA 02111-1307, USA. 193781343738de4abddf56982325a77bd70a98cd26Alexander Larsson * 203781343738de4abddf56982325a77bd70a98cd26Alexander Larsson * Author: Alexander Larsson <alexl@redhat.com> 213781343738de4abddf56982325a77bd70a98cd26Alexander Larsson */ 223781343738de4abddf56982325a77bd70a98cd26Alexander Larsson 233781343738de4abddf56982325a77bd70a98cd26Alexander Larsson#ifndef __G_LOCAL_FILE_INFO_H__ 243781343738de4abddf56982325a77bd70a98cd26Alexander Larsson#define __G_LOCAL_FILE_INFO_H__ 253781343738de4abddf56982325a77bd70a98cd26Alexander Larsson 263781343738de4abddf56982325a77bd70a98cd26Alexander Larsson#include <gio/gfileinfo.h> 273781343738de4abddf56982325a77bd70a98cd26Alexander Larsson#include <gio/gfile.h> 283781343738de4abddf56982325a77bd70a98cd26Alexander Larsson#include <sys/stat.h> 296356a9dd984a0ac64f5247e79c747b432f69567aAlexander Larsson#ifdef HAVE_SYS_TYPES_H 306356a9dd984a0ac64f5247e79c747b432f69567aAlexander Larsson#include <sys/types.h> 316356a9dd984a0ac64f5247e79c747b432f69567aAlexander Larsson#endif 323781343738de4abddf56982325a77bd70a98cd26Alexander Larsson 333781343738de4abddf56982325a77bd70a98cd26Alexander LarssonG_BEGIN_DECLS 343781343738de4abddf56982325a77bd70a98cd26Alexander Larsson 35f2a2d6c9ac2d98b565005d446fde01aac47f7d88Michael Natterertypedef struct 36f2a2d6c9ac2d98b565005d446fde01aac47f7d88Michael Natterer{ 373781343738de4abddf56982325a77bd70a98cd26Alexander Larsson gboolean writable; 383781343738de4abddf56982325a77bd70a98cd26Alexander Larsson gboolean is_sticky; 39c5a10d2650e11b9a700b605640a41275a4ee1a5dAlexander Larsson gboolean has_trash_dir; 40f2a2d6c9ac2d98b565005d446fde01aac47f7d88Michael Natterer int owner; 41f2a2d6c9ac2d98b565005d446fde01aac47f7d88Michael Natterer dev_t device; 423781343738de4abddf56982325a77bd70a98cd26Alexander Larsson} GLocalParentFileInfo; 433781343738de4abddf56982325a77bd70a98cd26Alexander Larsson 441c6676396db5806f2714eefe7581e06853ce95b1Tor Lillqvist#ifdef G_OS_WIN32 451c6676396db5806f2714eefe7581e06853ce95b1Tor Lillqvist/* We want 64-bit file size support */ 461c6676396db5806f2714eefe7581e06853ce95b1Tor Lillqvist#define GLocalFileStat struct _stati64 471c6676396db5806f2714eefe7581e06853ce95b1Tor Lillqvist#else 481c6676396db5806f2714eefe7581e06853ce95b1Tor Lillqvist#define GLocalFileStat struct stat 491c6676396db5806f2714eefe7581e06853ce95b1Tor Lillqvist#endif 501c6676396db5806f2714eefe7581e06853ce95b1Tor Lillqvist 51f2a2d6c9ac2d98b565005d446fde01aac47f7d88Michael Natterergboolean _g_local_file_has_trash_dir (const char *dirname, 52f2a2d6c9ac2d98b565005d446fde01aac47f7d88Michael Natterer dev_t dir_dev); 53f2a2d6c9ac2d98b565005d446fde01aac47f7d88Michael Natterervoid _g_local_file_info_get_parent_info (const char *dir, 54f2a2d6c9ac2d98b565005d446fde01aac47f7d88Michael Natterer GFileAttributeMatcher *attribute_matcher, 55f2a2d6c9ac2d98b565005d446fde01aac47f7d88Michael Natterer GLocalParentFileInfo *parent_info); 56f2a2d6c9ac2d98b565005d446fde01aac47f7d88Michael NattererGFileInfo *_g_local_file_info_get (const char *basename, 57f2a2d6c9ac2d98b565005d446fde01aac47f7d88Michael Natterer const char *path, 58f2a2d6c9ac2d98b565005d446fde01aac47f7d88Michael Natterer GFileAttributeMatcher *attribute_matcher, 59f2a2d6c9ac2d98b565005d446fde01aac47f7d88Michael Natterer GFileQueryInfoFlags flags, 60f2a2d6c9ac2d98b565005d446fde01aac47f7d88Michael Natterer GLocalParentFileInfo *parent_info, 61f2a2d6c9ac2d98b565005d446fde01aac47f7d88Michael Natterer GError **error); 62f2a2d6c9ac2d98b565005d446fde01aac47f7d88Michael NattererGFileInfo *_g_local_file_info_get_from_fd (int fd, 63f891d4e04e702b83b1099edb2ce2e0ae01bd4160Alexander Larsson const char *attributes, 64f2a2d6c9ac2d98b565005d446fde01aac47f7d88Michael Natterer GError **error); 65f2a2d6c9ac2d98b565005d446fde01aac47f7d88Michael Nattererchar * _g_local_file_info_create_etag (GLocalFileStat *statbuf); 66f2a2d6c9ac2d98b565005d446fde01aac47f7d88Michael Natterergboolean _g_local_file_info_set_attribute (char *filename, 67f2a2d6c9ac2d98b565005d446fde01aac47f7d88Michael Natterer const char *attribute, 68f2a2d6c9ac2d98b565005d446fde01aac47f7d88Michael Natterer GFileAttributeType type, 69f2a2d6c9ac2d98b565005d446fde01aac47f7d88Michael Natterer gpointer value_p, 70f2a2d6c9ac2d98b565005d446fde01aac47f7d88Michael Natterer GFileQueryInfoFlags flags, 71f2a2d6c9ac2d98b565005d446fde01aac47f7d88Michael Natterer GCancellable *cancellable, 72f2a2d6c9ac2d98b565005d446fde01aac47f7d88Michael Natterer GError **error); 73f2a2d6c9ac2d98b565005d446fde01aac47f7d88Michael Natterergboolean _g_local_file_info_set_attributes (char *filename, 74f2a2d6c9ac2d98b565005d446fde01aac47f7d88Michael Natterer GFileInfo *info, 75f2a2d6c9ac2d98b565005d446fde01aac47f7d88Michael Natterer GFileQueryInfoFlags flags, 76f2a2d6c9ac2d98b565005d446fde01aac47f7d88Michael Natterer GCancellable *cancellable, 77f2a2d6c9ac2d98b565005d446fde01aac47f7d88Michael Natterer GError **error); 783781343738de4abddf56982325a77bd70a98cd26Alexander Larsson 793781343738de4abddf56982325a77bd70a98cd26Alexander LarssonG_END_DECLS 803781343738de4abddf56982325a77bd70a98cd26Alexander Larsson 813781343738de4abddf56982325a77bd70a98cd26Alexander Larsson#endif /* __G_FILE_LOCAL_FILE_INFO_H__ */ 823781343738de4abddf56982325a77bd70a98cd26Alexander Larsson 833781343738de4abddf56982325a77bd70a98cd26Alexander Larsson 84