2003-01-26 Havoc Pennington <hp@pobox.com>
[platform/upstream/dbus.git] / dbus / dbus-errors.h
1 /* -*- mode: C; c-file-style: "gnu" -*- */
2 /* dbus-errors.h Error reporting
3  *
4  * Copyright (C) 2002  Red Hat Inc.
5  *
6  * Licensed under the Academic Free License version 1.2
7  * 
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  * 
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
21  *
22  */
23 #if !defined (DBUS_INSIDE_DBUS_H) && !defined (DBUS_COMPILATION)
24 #error "Only <dbus/dbus.h> can be included directly, this file may disappear or change contents."
25 #endif
26
27 #ifndef DBUS_ERROR_H
28 #define DBUS_ERROR_H
29
30 #include <dbus/dbus-macros.h>
31
32 DBUS_BEGIN_DECLS;
33
34 typedef enum
35 {
36   DBUS_RESULT_SUCCESS,         /**< Operation was successful. */
37   DBUS_RESULT_FAILED,          /**< Operation failed for unspecified reason. */
38   DBUS_RESULT_NO_MEMORY,       /**< Operation failed for lack of memory. */
39   DBUS_RESULT_IO_ERROR,        /**< Operation failed because of an IO error,
40                                 *   typically the other end closed the
41                                 *   connection.
42                                 */
43   DBUS_RESULT_BAD_ADDRESS,     /**< Address was bad, could not be parsed. */
44   DBUS_RESULT_NOT_SUPPORTED,   /**< Feature is not supported. */
45   DBUS_RESULT_LIMITS_EXCEEDED, /**< Some kernel resource limit exceeded. */
46   DBUS_RESULT_ACCESS_DENIED,   /**< Some sort of permissions/security problem. */
47   DBUS_RESULT_AUTH_FAILED,     /**< Could not authenticate. */
48   DBUS_RESULT_NO_SERVER,       /**< No one listening on the other end. */
49   DBUS_RESULT_TIMEOUT,         /**< Timed out trying to connect. */
50   DBUS_RESULT_NO_NETWORK,      /**< Can't find the network */
51   DBUS_RESULT_ADDRESS_IN_USE,  /**< Someone's already using the address */
52   DBUS_RESULT_DISCONNECTED,    /**< No more connection. */
53   DBUS_RESULT_INVALID_FIELDS,  /**< One or more invalid fields encountered. */
54   DBUS_RESULT_NO_REPLY,        /**< Did not get a reply message. */
55   DBUS_RESULT_FILE_NOT_FOUND   /**< File doesn't exist */
56 } DBusResultCode;
57
58 void        dbus_set_result       (DBusResultCode *code_address,
59                                    DBusResultCode  code);
60 const char* dbus_result_to_string (DBusResultCode  code);
61
62
63 DBUS_END_DECLS;
64
65 #endif /* DBUS_ERROR_H */