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 
00068 #ifndef O_NOATIME
00069 #define O_NOATIME 0
00070 #endif
00071 
00072 #if !defined(HAVE_ASPRINTF) && defined(HAVE___MINGW_ASPRINTF)
00073 #define asprintf __mingw_asprintf
00074 #endif
00075 
00076 /* tchar definitions for clean win32 filenames */
00077 #define _UNICODE
00078 
00079 #if defined _WIN32 && defined _UNICODE
00080 typedef  wchar_t    _TCHAR;
00081 #define _topen      _wopen
00082 #define _tdirent    _wdirent
00083 #define _TDIR       _WDIR
00084 #define _topendir   _wopendir
00085 #define _tclosedir  _wclosedir
00086 #define _treaddir   _wreaddir
00087 #define _trewinddir _wrewinddir
00088 #define _ttelldir   _wtelldir
00089 #define _tseekdir   _wseekdir
00090 #define _tcreat     _wcreat
00091 #define _tstat      _wstat64
00092 #define _tfstat     _fstat64
00093 #define _tunlink    _wunlink
00094 #define _tmkdir     _wmkdir
00095 #define _trmdir     _wrmdir
00096 #define _tchmod     _wchmod
00097 #define _trewinddir _wrewinddir
00098 #else 
00099 typedef char        _TCHAR;
00100 #define _tdirent    dirent
00101 #define _topen      open
00102 #define _TDIR       DIR
00103 #define _topendir   opendir
00104 #define _tclosedir  closedir
00105 #define _treaddir   readdir
00106 #define _trewinddir rewinddir
00107 #define _ttelldir   telldir
00108 #define _tseekdir   seekdir
00109 #define _tcreat     creat
00110 #define _tstat      lstat
00111 #define _tfstat     fstat
00112 #define _tunlink    unlink
00113 #define _tmkdir     mkdir
00114 #define _trmdir     rmdir
00115 #define _tchmod     chmod
00116 #define _trewinddir rewinddir
00117 #endif
00118 
00119 #ifdef WITH_ICONV
00120 /** @internal */
00121 int c_setup_iconv(const char* to);
00122 /** @internal */
00123 int c_close_iconv(void);
00124 #endif
00125 
00126 #endif //_C_PRIVATE_H
00127 
00128 /* vim: set ft=c.doxygen ts=8 sw=2 et cindent: */

Generated on Mon Aug 18 13:56:52 2014 for doc by  doxygen 1.5.6