summaryrefslogtreecommitdiffstats
path: root/win/kde_file_win.h
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commitce4a32fe52ef09d8f5ff1dd22c001110902b60a2 (patch)
tree5ac38a06f3dde268dc7927dc155896926aaf7012 /win/kde_file_win.h
downloadtdelibs-ce4a32fe52ef09d8f5ff1dd22c001110902b60a2.tar.gz
tdelibs-ce4a32fe52ef09d8f5ff1dd22c001110902b60a2.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'win/kde_file_win.h')
-rw-r--r--win/kde_file_win.h84
1 files changed, 84 insertions, 0 deletions
diff --git a/win/kde_file_win.h b/win/kde_file_win.h
new file mode 100644
index 000000000..ada37eec8
--- /dev/null
+++ b/win/kde_file_win.h
@@ -0,0 +1,84 @@
+/*
+ This file is part of the KDE libraries
+ Copyright (C) 2004 Jaroslaw Staniek <js@iidea.pl>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef KDE_FILE_WIN_H
+#define KDE_FILE_WIN_H
+
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <io.h>
+#include <fcntl.h>
+#include <ctype.h>
+
+#include <kdecore/kdelibs_export.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ Works like ::stat() but also:
+ 1) if @path is like "C:", '\' is appended
+ 2) else, '/' or '\' trailing characters are removed from @file_name
+ */
+KDEWIN32_EXPORT int kdewin32_stat(const char *file_name, struct stat *buf);
+
+/**
+ Identical to kdewin32_stat()
+ */
+KDEWIN32_EXPORT int kdewin32_lstat(const char *file_name, struct stat *buf);
+
+/**
+ Works like ::open() but also:
+ - if @flags have not specified O_TEXT flag, O_BINARY flag is appended
+ (because on win32 O_TEXT mode is the default, not O_BINARY like on unix)
+ */
+KDEWIN32_EXPORT int kdewin32_open(const char *path, int flags, ... /*mode_t mode*/);
+
+/*KDEWIN32_EXPORT int kdewin32_open(const char *path, int flags);*/
+
+/**
+ Works like ::fopen() but also:
+ - if @mode have specified neither "t" (text flag) or "b" (binary flag),
+ "b" (binary) flag is appended (or inserted before '+' character)
+ (because on win32 text mode is the default, not binary like on unix)
+ */
+KDEWIN32_EXPORT FILE *kdewin32_fopen(const char *path, const char *mode);
+
+KDEWIN32_EXPORT FILE *kdewin32_fdopen(int fd, const char *mode);
+
+KDEWIN32_EXPORT FILE *kdewin32_freopen(const char *path, const char *mode, FILE *stream);
+
+/**
+ Before calling ::rename(), tries to remove() it, is needed,
+ because win32 semantics doesn't allow files overwriting using ::rename().
+*/
+KDEWIN32_EXPORT int kdewin32_rename(const char *src, const char *dest);
+
+/**
+ A wrapped for ::mkdir() used by KDE_mkdir().
+*/
+KDEWIN32_EXPORT int kdewin32_mkdir(const char *path, mode_t mode);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif //KDE_FILE_WIN_H