D-Bus: dbus-errors.h Source File

D-Bus 1.12.4

dbus-errors.h
1 /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
2 /* dbus-errors.h Error reporting
3 *
4 * Copyright (C) 2002 Red Hat Inc.
5 * Copyright (C) 2003 CodeFactory AB
6 *
7 * Licensed under the Academic Free License version 2.1
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22 *
23 */
24 #if !defined (DBUS_INSIDE_DBUS_H) && !defined (DBUS_COMPILATION)
25 #error "Only <dbus/dbus.h> can be included directly, this file may disappear or change contents."
26 #endif
27
28 #ifndef DBUS_ERROR_H
29 #define DBUS_ERROR_H
30
31 #include <dbus/dbus-macros.h>
32 #include <dbus/dbus-types.h>
33 #include <dbus/dbus-protocol.h>
34
35 DBUS_BEGIN_DECLS
36
43 typedef struct DBusError DBusError;
44
48 struct DBusError
49 {
50 const char *name;
51 const char *message;
53 unsigned int dummy1 : 1;
54 unsigned int dummy2 : 1;
55 unsigned int dummy3 : 1;
56 unsigned int dummy4 : 1;
57 unsigned int dummy5 : 1;
59 void *padding1;
60 };
61
62 #define DBUS_ERROR_INIT { NULL, NULL, TRUE, 0, 0, 0, 0, NULL }
63
64 DBUS_EXPORT
65 void dbus_error_init (DBusError *error);
66 DBUS_EXPORT
67 void dbus_error_free (DBusError *error);
68 DBUS_EXPORT
69 void dbus_set_error (DBusError *error,
70 const char *name,
71 const char *message,
72 ...) _DBUS_GNUC_PRINTF (3, 4);
73 DBUS_EXPORT
74 void dbus_set_error_const (DBusError *error,
75 const char *name,
76 const char *message);
77 DBUS_EXPORT
78 void dbus_move_error (DBusError *src,
79 DBusError *dest);
80 DBUS_EXPORT
81 dbus_bool_t dbus_error_has_name (const DBusError *error,
82 const char *name);
83 DBUS_EXPORT
84 dbus_bool_t dbus_error_is_set (const DBusError *error);
85
88 DBUS_END_DECLS
89
90 #endif /* DBUS_ERROR_H */
dbus_error_has_name
dbus_bool_t dbus_error_has_name(const DBusError *error, const char *name)
Checks whether the error is set and has the given name.
Definition: dbus-errors.c:302
DBusError::message
const char * message
public error message field
Definition: dbus-errors.h:51
DBUS_BEGIN_DECLS
#define DBUS_BEGIN_DECLS
Macro used prior to declaring functions in the D-Bus header files.
dbus_error_free
void dbus_error_free(DBusError *error)
Frees an error that&#39;s been set (or just initialized), then reinitializes the error as in dbus_error_i...
Definition: dbus-errors.c:211
DBusError::dummy1
unsigned int dummy1
placeholder
Definition: dbus-errors.h:53
dbus_bool_t
dbus_uint32_t dbus_bool_t
A boolean, valid values are TRUE and FALSE.
Definition: dbus-types.h:35
DBusError
Object representing an exception.
Definition: dbus-errors.h:48
dbus_set_error
void dbus_set_error(DBusError *error, const char *name, const char *format,...)
Assigns an error name and message to a DBusError.
Definition: dbus-errors.c:354
DBusError::dummy2
unsigned int dummy2
placeholder
Definition: dbus-errors.h:54
DBusError::dummy5
unsigned int dummy5
placeholder
Definition: dbus-errors.h:57
dbus_move_error
void dbus_move_error(DBusError *src, DBusError *dest)
Moves an error src into dest, freeing src and overwriting dest.
Definition: dbus-errors.c:279
DBusError::name
const char * name
public error name field
Definition: dbus-errors.h:50
DBusError::dummy3
unsigned int dummy3
placeholder
Definition: dbus-errors.h:55
dbus_error_init
void dbus_error_init(DBusError *error)
Initializes a DBusError structure.
Definition: dbus-errors.c:188
DBusError::dummy4
unsigned int dummy4
placeholder
Definition: dbus-errors.h:56
dbus_set_error_const
void dbus_set_error_const(DBusError *error, const char *name, const char *message)
Assigns an error name and message to a DBusError.
Definition: dbus-errors.c:243
DBusError::padding1
void * padding1
placeholder
Definition: dbus-errors.h:59
dbus_error_is_set
dbus_bool_t dbus_error_is_set(const DBusError *error)
Checks whether an error occurred (the error is set).
Definition: dbus-errors.c:329
DBUS_END_DECLS
#define DBUS_END_DECLS
Macro used after declaring functions in the D-Bus header files.