c_private.h

Go to the documentation of this file.
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 #include <wchar.h>
00033 #endif
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 stat64 csync_stat_t;
00055 #define _FILE_OFFSET_BITS 64
00056 #else
00057 typedef struct stat csync_stat_t;
00058 #endif
00059 
00060 #ifndef HAVE_STRERROR_R
00061 #define strerror_r(errnum, buf, buflen) snprintf(buf, buflen, "%s", strerror(errnum))
00062 #endif
00063 
00064 #ifndef HAVE_LSTAT
00065 #define lstat _stat
00066 #endif
00067 #ifdef _WIN32
00068 #define fstat  _fstat64
00069 #endif
00070 
00071 #ifndef O_NOATIME
00072 #define O_NOATIME 0
00073 #endif
00074 
00075 /* tchar definitions for clean win32 filenames */
00076 #define _UNICODE
00077 
00078 #if defined _WIN32 && defined _UNICODE 
00079 typedef  wchar_t    _TCHAR;
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      _wstat64
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 _topen      open
00100 #define _TDIR       DIR
00101 #define _topendir   opendir
00102 #define _tclosedir  closedir
00103 #define _treaddir   readdir
00104 #define _trewinddir rewinddir
00105 #define _ttelldir   telldir
00106 #define _tseekdir   seekdir
00107 #define _tcreat     creat
00108 #define _tstat      lstat
00109 #define _tunlink    unlink
00110 #define _tmkdir     mkdir
00111 #define _trmdir     rmdir
00112 #define _tchmod     chmod
00113 #define _trewinddir rewinddir
00114 #endif
00115 
00116 #ifdef WITH_ICONV
00117 /** @internal */
00118 int c_setup_iconv(const char* to);
00119 /** @internal */
00120 int c_close_iconv(void);
00121 #endif
00122 
00123 #endif //_C_PRIVATE_H
00124 
00125 /* vim: set ft=c.doxygen ts=8 sw=2 et cindent: */

Generated on Mon Aug 18 13:53:10 2014 for doc by  doxygen 1.5.6