doc
|
00001 /* 00002 * Copyright (c) 2012 by Dominik Schmidt <dev@dominik-schmidt.de> 00003 * 00004 * This program is free software; you can redistribute it and/or 00005 * modify it under the terms of the GNU General Public License 00006 * as published by the Free Software Foundation; either version 2 00007 * of the License, or (at your option) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU General Public License 00015 * along with this program; if not, write to the Free Software Foundation, 00016 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00017 */ 00018 00019 #ifndef _C_PRIVATE_H 00020 #define _C_PRIVATE_H 00021 00022 #include "config.h" 00023 00024 /* cross platform defines */ 00025 #include "config.h" 00026 #include <sys/types.h> 00027 #include <sys/stat.h> 00028 00029 #ifdef _WIN32 00030 #include <windef.h> 00031 #include <winbase.h> 00032 #endif 00033 00034 00035 #ifdef _WIN32 00036 #define EDQUOT 0 00037 #define ENODATA 0 00038 #define S_IRGRP 0 00039 #define S_IROTH 0 00040 #define S_IXGRP 0 00041 #define S_IXOTH 0 00042 #define O_NOFOLLOW 0 00043 #define O_NOATIME 0 00044 #define O_NOCTTY 0 00045 00046 #define uid_t int 00047 #define gid_t int 00048 #define nlink_t int 00049 #define getuid() 0 00050 #define geteuid() 0 00051 #endif 00052 00053 #ifdef _WIN32 00054 typedef struct _stat csync_stat_t; 00055 #else 00056 typedef struct stat csync_stat_t; 00057 #endif 00058 00059 #ifndef HAVE_STRERROR_R 00060 #define strerror_r(errnum, buf, buflen) snprintf(buf, buflen, "%s", strerror(errnum)) 00061 #endif 00062 00063 #ifndef HAVE_LSTAT 00064 #define lstat _stat 00065 #endif 00066 #ifdef _WIN32 00067 #define fstat _fstat 00068 #endif 00069 00070 #ifndef O_NOATIME 00071 #define O_NOATIME 0 00072 #endif 00073 00074 /* tchar definitions for clean win32 filenames */ 00075 #define _UNICODE 00076 00077 #if defined _WIN32 && defined _UNICODE 00078 typedef wchar_t _TCHAR; 00079 #define _tcslen wcslen 00080 #define _topen _wopen 00081 #define _tdirent _wdirent 00082 #define _TDIR _WDIR 00083 #define _topendir _wopendir 00084 #define _tclosedir _wclosedir 00085 #define _treaddir _wreaddir 00086 #define _trewinddir _wrewinddir 00087 #define _ttelldir _wtelldir 00088 #define _tseekdir _wseekdir 00089 #define _tcreat _wcreat 00090 #define _tstat _wstat 00091 #define _tunlink _wunlink 00092 #define _tmkdir _wmkdir 00093 #define _trmdir _wrmdir 00094 #define _tchmod _wchmod 00095 #define _trewinddir _wrewinddir 00096 #else 00097 typedef char _TCHAR; 00098 #define _tdirent dirent 00099 #define _tcslen strlen 00100 #define _topen open 00101 #define _TDIR DIR 00102 #define _topendir opendir 00103 #define _tclosedir closedir 00104 #define _treaddir readdir 00105 #define _trewinddir rewinddir 00106 #define _ttelldir telldir 00107 #define _tseekdir seekdir 00108 #define _tcreat creat 00109 #define _tstat lstat 00110 #define _tunlink unlink 00111 #define _tmkdir mkdir 00112 #define _trmdir rmdir 00113 #define _tchmod chmod 00114 #define _trewinddir rewinddir 00115 #endif 00116 00117 #endif //_C_PRIVATE_H 00118 00119 /* vim: set ft=c.doxygen ts=8 sw=2 et cindent: */