Rename _TCHAR type to mbchar_t.

Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Klaas Freitag 2013-01-28 08:59:36 +01:00 committed by Andreas Schneider
parent ce080d5ee1
commit 1d703ee6c4
5 changed files with 21 additions and 21 deletions

View file

@ -815,8 +815,8 @@ static csync_vio_method_handle_t *owncloud_open(const char *durl,
#ifdef _WIN32
int gtp = 0;
char tmpname[13];
_TCHAR winTmp[PATH_MAX];
const _TCHAR *winUrlMB = NULL;
mbchar_t winTmp[PATH_MAX];
const mbchar_t *winUrlMB = NULL;
const char *winTmpUtf8 = NULL;
csync_stat_t sb;
#endif
@ -1026,7 +1026,7 @@ static int owncloud_close(csync_vio_method_handle_t *fhandle) {
int rc;
int ret = 0;
size_t len = 0;
const _TCHAR *tmpFileName = 0;
const mbchar_t *tmpFileName = 0;
writeCtx = (struct transfer_context*) fhandle;
@ -1139,7 +1139,7 @@ static ssize_t owncloud_read(csync_vio_method_handle_t *fhandle, void *buf, size
struct transfer_context *writeCtx;
size_t len = 0;
csync_stat_t st;
const _TCHAR *tmpFileName;
const mbchar_t *tmpFileName;
writeCtx = (struct transfer_context*) fhandle;
@ -1154,7 +1154,7 @@ static ssize_t owncloud_read(csync_vio_method_handle_t *fhandle, void *buf, size
#ifdef _WIN32
_fmode = _O_BINARY;
#endif
const mbchar_t *tmpFileName = c_multibyte(writeCtx->tmpFileName);
tmpFileName = c_multibyte(writeCtx->tmpFileName);
if (( writeCtx->fd = _topen( tmpFileName, O_RDONLY )) < 0) {
c_free_multibyte(tmpFileName);
DEBUG_WEBDAV(("Could not open local file %s", writeCtx->tmpFileName ));

View file

@ -35,8 +35,8 @@
int c_mkdirs(const char *path, mode_t mode) {
int tmp;
csync_stat_t sb;
const _TCHAR *wpath = c_multibyte(path);
const _TCHAR *swpath = NULL;
const mbchar_t *wpath = c_multibyte(path);
const mbchar_t *swpath = NULL;
if (path == NULL) {
errno = EINVAL;
@ -92,8 +92,8 @@ int c_rmdirs(const char *path) {
struct _tdirent *dp;
csync_stat_t sb;
char *fname = NULL;
const _TCHAR *wfname = NULL;
const _TCHAR *wpath = c_multibyte(path);
const mbchar_t *wfname = NULL;
const mbchar_t *wpath = c_multibyte(path);
char *rd_name = NULL;
if ((d = _topendir(wpath)) != NULL) {
@ -167,7 +167,7 @@ int c_rmdirs(const char *path) {
int c_isdir(const char *path) {
csync_stat_t sb;
const _TCHAR *wpath = c_multibyte(path);
const mbchar_t *wpath = c_multibyte(path);
if (_tstat (wpath, &sb) == 0 && S_ISDIR(sb.st_mode)) {
return 1;

View file

@ -39,7 +39,7 @@
/* check if path is a file */
int c_isfile(const char *path) {
csync_stat_t sb;
const _TCHAR *wpath = c_multibyte(path);
const mbchar_t *wpath = c_multibyte(path);
int re = _tstat(wpath, &sb);
c_free_multibyte(wpath);

View file

@ -49,7 +49,7 @@ int csync_vio_init(CSYNC *ctx, const char *module, const char *args) {
char *err = NULL;
csync_vio_method_t *m = NULL;
csync_vio_method_init_fn init_fn;
const _TCHAR *mpath = NULL;
const mbchar_t *mpath = NULL;
if (asprintf(&path, "%s/csync_%s.%s", PLUGINDIR, module, MODULE_EXTENSION) < 0) {

View file

@ -47,7 +47,7 @@ typedef struct fhandle_s {
csync_vio_method_handle_t *csync_vio_local_open(const char *durl, int flags, mode_t mode) {
fhandle_t *handle = NULL;
int fd = -1;
const _TCHAR *url = c_multibyte(durl);
const mbchar_t *url = c_multibyte(durl);
if ((fd = _topen(url, flags, mode)) < 0) {
return NULL;
@ -69,7 +69,7 @@ csync_vio_method_handle_t *csync_vio_local_open(const char *durl, int flags, mod
csync_vio_method_handle_t *csync_vio_local_creat(const char *durl, mode_t mode) {
fhandle_t *handle = NULL;
int fd = -1;
const _TCHAR *url = c_multibyte(durl);
const mbchar_t *url = c_multibyte(durl);
if(( fd = _tcreat( url, mode)) < 0) {
return NULL;
@ -159,7 +159,7 @@ typedef struct dhandle_s {
csync_vio_method_handle_t *csync_vio_local_opendir(const char *name) {
dhandle_t *handle = NULL;
const _TCHAR *dirname = c_multibyte(name);
const mbchar_t *dirname = c_multibyte(name);
handle = c_malloc(sizeof(dhandle_t));
if (handle == NULL) {
return NULL;
@ -264,7 +264,7 @@ int csync_vio_local_mkdir(const char *uri, mode_t mode) {
}
int csync_vio_local_rmdir(const char *uri) {
const _TCHAR *dirname = c_multibyte(uri);
const mbchar_t *dirname = c_multibyte(uri);
int re = -1;
re = _trmdir(dirname);
@ -275,7 +275,7 @@ int csync_vio_local_rmdir(const char *uri) {
int csync_vio_local_stat(const char *uri, csync_vio_file_stat_t *buf) {
csync_stat_t sb;
const _TCHAR *wuri = c_multibyte( uri );
const mbchar_t *wuri = c_multibyte( uri );
if( _tstat(wuri, &sb) < 0) {
c_free_multibyte(wuri);
return -1;
@ -374,8 +374,8 @@ int csync_vio_local_stat(const char *uri, csync_vio_file_stat_t *buf) {
int csync_vio_local_rename(const char *olduri, const char *newuri) {
#ifdef _WIN32
const _TCHAR *nuri = c_multibyte(newuri);
const _TCHAR *ouri = c_multibyte(olduri);
const mbchar_t *nuri = c_multibyte(newuri);
const mbchar_t *ouri = c_multibyte(olduri);
if(ouri && nuri) {
if (MoveFileExW(ouri, nuri, MOVEFILE_COPY_ALLOWED + MOVEFILE_REPLACE_EXISTING + MOVEFILE_WRITE_THROUGH )) {
@ -395,14 +395,14 @@ int csync_vio_local_rename(const char *olduri, const char *newuri) {
}
int csync_vio_local_unlink(const char *uri) {
const _TCHAR *nuri = c_multibyte(uri);
const mbchar_t *nuri = c_multibyte(uri);
int re = _tunlink( nuri );
c_free_multibyte(nuri);
return re;
}
int csync_vio_local_chmod(const char *uri, mode_t mode) {
const _TCHAR *nuri = c_multibyte(uri);
const mbchar_t *nuri = c_multibyte(uri);
int re = -1;
re = _tchmod(nuri, mode);