doc
csync_macros.h
Go to the documentation of this file.
1 /*
2  * cynapses libc functions
3  *
4  * Copyright (c) 2008-2013 by Andreas Schneider <asn@cryptomilk.org>
5  * Copyright (c) 2012-2013 by Klaas Freitag <freitag@owncloud.com>
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  */
21 
22 #ifndef _CSYNC_MACROS_H
23 #define _CSYNC_MACROS_H
24 
25 #include <stdlib.h>
26 #include <string.h>
27 
28 /* How many elements there are in a static array */
29 #define ARRAY_SIZE(a) (sizeof(a)/sizeof(a[0]))
30 
31 /* Some special custom errno values to report bugs properly. The BASE value
32  * should always be larger than the highest system errno. */
33 #define CSYNC_CUSTOM_ERRNO_BASE 10000
34 
35 #define ERRNO_GENERAL_ERROR CSYNC_CUSTOM_ERRNO_BASE+2
36 #define ERRNO_LOOKUP_ERROR CSYNC_CUSTOM_ERRNO_BASE+3
37 #define ERRNO_USER_UNKNOWN_ON_SERVER CSYNC_CUSTOM_ERRNO_BASE+4
38 #define ERRNO_PROXY_AUTH CSYNC_CUSTOM_ERRNO_BASE+5
39 #define ERRNO_CONNECT CSYNC_CUSTOM_ERRNO_BASE+6
40 #define ERRNO_TIMEOUT CSYNC_CUSTOM_ERRNO_BASE+7
41 #define ERRNO_PRECONDITION CSYNC_CUSTOM_ERRNO_BASE+8
42 #define ERRNO_RETRY CSYNC_CUSTOM_ERRNO_BASE+9
43 #define ERRNO_REDIRECT CSYNC_CUSTOM_ERRNO_BASE+10
44 #define ERRNO_WRONG_CONTENT CSYNC_CUSTOM_ERRNO_BASE+11
45 #define ERRNO_TIMEDELTA CSYNC_CUSTOM_ERRNO_BASE+12
46 #define ERRNO_ERROR_STRING CSYNC_CUSTOM_ERRNO_BASE+13
47 #define ERRNO_SERVICE_UNAVAILABLE CSYNC_CUSTOM_ERRNO_BASE+14
48 #define ERRNO_QUOTA_EXCEEDED CSYNC_CUSTOM_ERRNO_BASE+15
49 
50 #endif /* _CSYNC_MACROS_H */
51 /* vim: set ft=c.doxygen ts=8 sw=2 et cindent: */