1 /* GIO - GLib Input, Output and Streaming Library
3 * Copyright (C) 2006-2007 Red Hat, Inc.
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.
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.
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.
20 * Author: Alexander Larsson <alexl@redhat.com>
31 * @short_description: Error helper functions
34 * Contains helper functions for reporting errors to the user.
40 * Gets the GIO Error Quark.
42 * Return value: a #GQuark.
45 g_io_error_quark (void)
47 return g_quark_from_static_string ("g-io-error-quark");
51 * g_io_error_from_errno:
52 * @err_no: Error number as defined in errno.h.
54 * Converts errno.h error codes into GIO error codes.
56 * Returns: #GIOErrorEnum value for the given errno.h error number.
59 g_io_error_from_errno (gint err_no
)
65 return G_IO_ERROR_EXISTS
;
71 return G_IO_ERROR_IS_DIRECTORY
;
77 return G_IO_ERROR_PERMISSION_DENIED
;
83 return G_IO_ERROR_FILENAME_TOO_LONG
;
89 return G_IO_ERROR_NOT_FOUND
;
95 return G_IO_ERROR_NOT_DIRECTORY
;
101 return G_IO_ERROR_READ_ONLY
;
107 return G_IO_ERROR_TOO_MANY_LINKS
;
113 return G_IO_ERROR_NO_SPACE
;
119 return G_IO_ERROR_NO_SPACE
;
125 return G_IO_ERROR_INVALID_ARGUMENT
;
131 return G_IO_ERROR_PERMISSION_DENIED
;
137 return G_IO_ERROR_CANCELLED
;
143 return G_IO_ERROR_NOT_EMPTY
;
149 return G_IO_ERROR_NOT_SUPPORTED
;
155 return G_IO_ERROR_TIMED_OUT
;
161 return G_IO_ERROR_BUSY
;
167 return G_IO_ERROR_WOULD_BLOCK
;
172 return G_IO_ERROR_FAILED
;
177 #define __G_IO_ERROR_C__
178 #include "gioaliasdef.c"