2 * libopensync - A synchronization framework
3 * Copyright (C) 2004-2005 Armin Bauer <armin.bauer@opensync.org>
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.1 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 Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 #ifndef OPENSYNC_ERROR_H_
22 #define OPENSYNC_ERROR_H_
28 /*! @ingroup OSyncErrorAPI
29 * @brief Defines the possible error types
33 OSYNC_ERROR_GENERIC
= 1,
34 OSYNC_ERROR_IO_ERROR
= 2,
35 OSYNC_ERROR_NOT_SUPPORTED
= 3,
36 OSYNC_ERROR_TIMEOUT
= 4,
37 OSYNC_ERROR_DISCONNECTED
= 5,
38 OSYNC_ERROR_FILE_NOT_FOUND
= 6,
39 OSYNC_ERROR_EXISTS
= 7,
40 OSYNC_ERROR_CONVERT
= 8,
41 OSYNC_ERROR_MISCONFIGURATION
= 9,
42 OSYNC_ERROR_INITIALIZATION
= 10,
43 OSYNC_ERROR_PARAMETER
= 11,
44 OSYNC_ERROR_EXPECTED
= 12,
45 OSYNC_ERROR_NO_CONNECTION
= 13,
46 OSYNC_ERROR_TEMPORARY
= 14,
47 OSYNC_ERROR_LOCKED
= 15,
48 OSYNC_ERROR_PLUGIN_NOT_FOUND
= 16
51 OSYNC_EXPORT OSyncError
**osync_error_ref(OSyncError
**error
);
52 OSYNC_EXPORT
void osync_error_unref(OSyncError
**error
);
53 OSYNC_EXPORT osync_bool
osync_error_is_set (OSyncError
**error
);
54 OSYNC_EXPORT
void osync_error_set(OSyncError
**error
, OSyncErrorType type
, const char *format
, ...);
55 OSYNC_EXPORT
const char *osync_error_get_name(OSyncError
**error
);
56 OSYNC_EXPORT
void osync_error_set_from_error(OSyncError
**target
, OSyncError
**source
);
57 OSYNC_EXPORT
const char *osync_error_print(OSyncError
**error
);
58 OSYNC_EXPORT
char *osync_error_print_stack(OSyncError
**error
);
59 OSYNC_EXPORT
void osync_error_stack(OSyncError
**parent
, OSyncError
**child
);
60 OSYNC_EXPORT OSyncError
*osync_error_get_child(OSyncError
**parent
);
61 OSYNC_EXPORT OSyncErrorType
osync_error_get_type(OSyncError
**error
);
62 OSYNC_EXPORT
void osync_error_set_type(OSyncError
**error
, OSyncErrorType type
);
63 OSYNC_EXPORT
void osync_error_set_vargs(OSyncError
**error
, OSyncErrorType type
, const char *format
, va_list args
);
67 #endif //OPENSYNC_ERROR_H_