doc
csync_macros.h
Go to the documentation of this file.
1 
2 /*
3  * libcsync -- a library to sync a directory with another
4  *
5  * Copyright (c) 2006 by Andreas Schneider <mail@cynapses.org>
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program 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
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software Foundation,
19  * 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 errno values to report bugs properly */
32 #define CSYNC_CUSTOM_ERRNO_BASE 10000
33 
34 #define ERRNO_GENERAL_ERROR CSYNC_CUSTOM_ERRNO_BASE+2
35 #define ERRNO_LOOKUP_ERROR CSYNC_CUSTOM_ERRNO_BASE+3
36 #define ERRNO_USER_UNKNOWN_ON_SERVER CSYNC_CUSTOM_ERRNO_BASE+4
37 #define ERRNO_PROXY_AUTH CSYNC_CUSTOM_ERRNO_BASE+5
38 #define ERRNO_CONNECT CSYNC_CUSTOM_ERRNO_BASE+6
39 #define ERRNO_TIMEOUT CSYNC_CUSTOM_ERRNO_BASE+7
40 #define ERRNO_PRECONDITION CSYNC_CUSTOM_ERRNO_BASE+8
41 #define ERRNO_RETRY CSYNC_CUSTOM_ERRNO_BASE+9
42 #define ERRNO_REDIRECT CSYNC_CUSTOM_ERRNO_BASE+10
43 #define ERRNO_WRONG_CONTENT CSYNC_CUSTOM_ERRNO_BASE+11
44 #define ERRNO_TIMEDELTA CSYNC_CUSTOM_ERRNO_BASE+12
45 #define ERRNO_ERROR_STRING CSYNC_CUSTOM_ERRNO_BASE+13
46 #define ERRNO_SERVICE_UNAVAILABLE CSYNC_CUSTOM_ERRNO_BASE+14
47 #define ERRNO_QUOTA_EXCEEDED CSYNC_CUSTOM_ERRNO_BASE+15
48 #define ERRNO_USER_ABORT CSYNC_CUSTOM_ERRNO_BASE+16
49 
50 #endif /* _CSYNC_MACROS_H */
51 /* vim: set ft=c.doxygen ts=8 sw=2 et cindent: */