Add new error codes for when compilation fails and make compilation error
[platform/upstream/glib.git] / gio / gioerror.h
1 /* GIO - GLib Input, Output and Streaming Library
2  * 
3  * Copyright (C) 2006-2007 Red Hat, Inc.
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library 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 GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General
16  * Public License along with this library; if not, write to the
17  * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
18  * Boston, MA 02111-1307, USA.
19  *
20  * Author: Alexander Larsson <alexl@redhat.com>
21  */
22
23 #ifndef __G_IO_ERROR_H__
24 #define __G_IO_ERROR_H__
25
26 #include <glib/gerror.h>
27
28 G_BEGIN_DECLS
29
30 GQuark          g_io_error_quark      (void);
31
32 /**
33  * G_IO_ERROR:
34  * 
35  * Error domain for GIO. Errors in this domain will be from the #GIOErrorEnum enumeration.
36  * See #GError for more information on error domains.
37  **/
38 #define G_IO_ERROR g_io_error_quark()
39
40 /* This enumeration conflicts with GIOError in giochannel.h. However,
41  * that is only used as a return value in some deprecated functions.
42  * So, we reuse the same prefix for the enumeration values, but call
43  * the actual enumeration (which is rarely used) GIOErrorEnum.
44  */
45
46 /**
47  * GIOErrorEnum:
48  * @G_IO_ERROR_FAILED: Generic error condition for when any operation fails.
49  * @G_IO_ERROR_NOT_FOUND: File not found error.
50  * @G_IO_ERROR_EXISTS: File already exists error.
51  * @G_IO_ERROR_IS_DIRECTORY: File is a directory error.
52  * @G_IO_ERROR_NOT_DIRECTORY: File is not a directory.
53  * @G_IO_ERROR_NOT_EMPTY: File is a directory that isn't empty.
54  * @G_IO_ERROR_NOT_REGULAR_FILE: File is not a regular file.
55  * @G_IO_ERROR_NOT_SYMBOLIC_LINK: File is not a symbolic link.
56  * @G_IO_ERROR_NOT_MOUNTABLE_FILE: File cannot be mounted.
57  * @G_IO_ERROR_FILENAME_TOO_LONG: Filename is too many characters.
58  * @G_IO_ERROR_INVALID_FILENAME: Filename is invalid or contains invalid characters.
59  * @G_IO_ERROR_TOO_MANY_LINKS: File contains too many symbolic links.
60  * @G_IO_ERROR_NO_SPACE: No space left on drive.
61  * @G_IO_ERROR_INVALID_ARGUMENT: Invalid argument.
62  * @G_IO_ERROR_PERMISSION_DENIED: Permission denied.
63  * @G_IO_ERROR_NOT_SUPPORTED: Operation not supported for the current backend.
64  * @G_IO_ERROR_NOT_MOUNTED: File isn't mounted.
65  * @G_IO_ERROR_ALREADY_MOUNTED: File is already mounted.
66  * @G_IO_ERROR_CLOSED: File was closed.
67  * @G_IO_ERROR_CANCELLED: Operation was cancelled. See #GCancellable.
68  * @G_IO_ERROR_PENDING: Operations are still pending.
69  * @G_IO_ERROR_READ_ONLY: File is read only.
70  * @G_IO_ERROR_CANT_CREATE_BACKUP: Backup couldn't be created.
71  * @G_IO_ERROR_WRONG_ETAG: File's Entity Tag was incorrect.
72  * @G_IO_ERROR_TIMED_OUT: Operation timed out.
73  * @G_IO_ERROR_WOULD_RECURSE: Operation would be recursive.
74  * @G_IO_ERROR_BUSY: File is busy.
75  * @G_IO_ERROR_WOULD_BLOCK: Operation would block.
76  * @G_IO_ERROR_HOST_NOT_FOUND: Host couldn't be found (remote operations).
77  * @G_IO_ERROR_WOULD_MERGE: Operation would merge files.
78  *
79  * Error codes returned by GIO functions.
80  * 
81  **/
82 typedef enum
83 {
84   G_IO_ERROR_FAILED,
85   G_IO_ERROR_NOT_FOUND,
86   G_IO_ERROR_EXISTS,
87   G_IO_ERROR_IS_DIRECTORY,
88   G_IO_ERROR_NOT_DIRECTORY,
89   G_IO_ERROR_NOT_EMPTY,
90   G_IO_ERROR_NOT_REGULAR_FILE,
91   G_IO_ERROR_NOT_SYMBOLIC_LINK,
92   G_IO_ERROR_NOT_MOUNTABLE_FILE,
93   G_IO_ERROR_FILENAME_TOO_LONG,
94   G_IO_ERROR_INVALID_FILENAME,
95   G_IO_ERROR_TOO_MANY_LINKS,
96   G_IO_ERROR_NO_SPACE,
97   G_IO_ERROR_INVALID_ARGUMENT,
98   G_IO_ERROR_PERMISSION_DENIED,
99   G_IO_ERROR_NOT_SUPPORTED,
100   G_IO_ERROR_NOT_MOUNTED,
101   G_IO_ERROR_ALREADY_MOUNTED,
102   G_IO_ERROR_CLOSED,
103   G_IO_ERROR_CANCELLED,
104   G_IO_ERROR_PENDING,
105   G_IO_ERROR_READ_ONLY,
106   G_IO_ERROR_CANT_CREATE_BACKUP,
107   G_IO_ERROR_WRONG_ETAG,
108   G_IO_ERROR_TIMED_OUT,
109   G_IO_ERROR_WOULD_RECURSE,
110   G_IO_ERROR_BUSY,
111   G_IO_ERROR_WOULD_BLOCK,
112   G_IO_ERROR_HOST_NOT_FOUND,
113   G_IO_ERROR_WOULD_MERGE
114 } GIOErrorEnum;
115
116 GIOErrorEnum g_io_error_from_errno (gint err_no);
117
118 G_END_DECLS
119
120 #endif /* __G_IO_ERROR_H__ */