+directory remove
[captive.git] / src / libcaptive / include / captive / client-directory.h
1 /* $Id$
2  * Include file with client-application 'directory' access to libcaptive
3  * Copyright (C) 2002 Jan Kratochvil <project-captive@jankratochvil.net>
4  * 
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; exactly version 2 of June 1991 is required
8  * 
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  * 
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17  */
18
19
20 #ifndef _CAPTIVE_CLIENT_DIRECTORY_H
21 #define _CAPTIVE_CLIENT_DIRECTORY_H 1
22
23
24 #include <glib/gmacros.h>
25 #include <glib-object.h>
26 #include "reactos/ntos/types.h" /* for HANDLE */
27 #include "reactos/ddk/zwtypes.h"        /* for FILE_ID_BOTH_DIR_INFORMATION */
28 #include <libgnomevfs/gnome-vfs-file-info.h>    /* for GnomeVFSFileInfo */
29
30
31 G_BEGIN_DECLS
32
33 #define CAPTIVE_DIRECTORY_TYPE_OBJECT            (captive_directory_object_get_type())
34 #define CAPTIVE_DIRECTORY_OBJECT(object)         (G_TYPE_CHECK_INSTANCE_CAST((object),CAPTIVE_DIRECTORY_TYPE_OBJECT,CaptiveDirectoryObject))
35 #define CAPTIVE_DIRECTORY_OBJECT_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass),CAPTIVE_DIRECTORY_TYPE_OBJECT,CaptiveDirectoryObjectClass))
36 #define CAPTIVE_DIRECTORY_IS_OBJECT(object)      (G_TYPE_CHECK_INSTANCE_TYPE((object),CAPTIVE_DIRECTORY_TYPE_OBJECT))
37 #define CAPTIVE_DIRECTORY_IS_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),CAPTIVE_DIRECTORY_TYPE_OBJECT))
38 #define CAPTIVE_DIRECTORY_OBJECT_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS((obj),CAPTIVE_DIRECTORY_TYPE_OBJECT,CaptiveDirectoryObjectClass))
39 typedef struct _CaptiveDirectoryObject      CaptiveDirectoryObject;
40 typedef struct _CaptiveDirectoryObjectClass CaptiveDirectoryObjectClass;
41 struct _CaptiveDirectoryObject {
42         GObject parent_instance;
43
44         /*< private >*/
45         HANDLE dir_Handle;
46         gboolean read_first;
47         /* 'QueryDirectory_buf' for NtQueryDirectoryFile() must be persistent
48          * to keep the state if !read_first
49          */
50         char QueryDirectory_buf[sizeof(FILE_ID_BOTH_DIR_INFORMATION)
51                         +0x1000 /* max 'FileName' length, 255 should be enough */ * sizeof(WCHAR /* *FILE_ID_BOTH_DIR_INFORMATION.FileName */ )];
52         };
53 struct _CaptiveDirectoryObjectClass {
54         GObjectClass parent_class;
55         };
56
57 GType captive_directory_object_get_type(void);
58
59 GnomeVFSResult captive_directory_new_open(CaptiveDirectoryObject **captive_directory_object_return,const gchar *pathname);
60 GnomeVFSResult captive_directory_new_make(CaptiveDirectoryObject **captive_directory_object_return,const gchar *pathname,guint perm);
61 GnomeVFSResult captive_directory_read(CaptiveDirectoryObject *captive_directory_object,GnomeVFSFileInfo *file_info);
62 GnomeVFSResult captive_directory_remove(CaptiveDirectoryObject *captive_directory_object);
63
64
65 G_END_DECLS
66
67
68 #endif /* _CAPTIVE_CLIENT_DIRECTORY_H */