home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / kde_file.h < prev    next >
Encoding:
C/C++ Source or Header  |  2005-10-10  |  3.6 KB  |  126 lines

  1. /*
  2.    This file is part of the KDE libraries
  3.    Copyright (C) 2001 Waldo Bastian <bastian@kde.org>
  4.    Copyright (C) 2004 Jaroslaw Staniek <js@iidea.pl>
  5.  
  6.    This library is free software; you can redistribute it and/or
  7.    modify it under the terms of the GNU Library General Public
  8.    License version 2 as published by the Free Software Foundation.
  9.  
  10.    This library is distributed in the hope that it will be useful,
  11.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  13.    Library General Public License for more details.
  14.  
  15.    You should have received a copy of the GNU Library General Public License
  16.    along with this library; see the file COPYING.LIB.  If not, write to
  17.    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  18.    Boston, MA 02110-1301, USA.
  19. */
  20.  
  21. #ifndef _KDE_FILE_H_
  22. #define _KDE_FILE_H_
  23.  
  24. /**
  25.  * \file kde_file.h
  26.  * \brief This file provides portable defines for file support.
  27.  *
  28.  * Use the KDE_xxx defines instead of the normal C
  29.  * functions and structures.
  30.  * \since 3.3
  31.  */
  32.  
  33. #include <unistd.h>
  34. #ifdef _WIN32
  35. #include <kde_file_win.h>
  36. #endif
  37.  
  38. #if (defined _LFS64_LARGEFILE) && (defined _LARGEFILE64_SOURCE)
  39. /*
  40.  * This section provides portable defines for large file support.
  41.  * To use this you must compile your code with _LARGEFILE64_SOURCE 
  42.  * defined and use the KDE_xxx defines instead of the normal
  43.  * C functions and structures.
  44.  *
  45.  * Please note that not every platform supports 64 bit file structures,
  46.  * in that case the normal 32 bit functions will be used.
  47.  *
  48.  * @see http://www.suse.de/~aj/linux_lfs.html 
  49.  * @see http://ftp.sas.com/standards/large.file/xopen/x_open.05Mar96.html
  50.  *
  51.  * KDE makes use of the "Transitional Extensions" since we can not ensure
  52.  * that all modules and libraries used by KDE will be compiled with
  53.  * 64-bit support. 
  54.  * (A.3.2.3 Mixed API and Compile Environments within a Single Process)
  55.  */
  56. #define KDE_stat        ::stat64
  57. #define KDE_lstat        ::lstat64
  58. #define KDE_fstat        ::fstat64
  59. #define KDE_open        ::open64
  60. #define KDE_lseek        ::lseek64
  61. #define KDE_fseek        ::fseek64
  62. #define KDE_ftell        ::ftell64
  63. #define KDE_fgetpos        ::fgetpos64
  64. #define KDE_fsetpos        ::fsetpos64
  65. #define KDE_readdir        ::readdir64
  66. #define KDE_sendfile    ::sendfile64
  67. #define KDE_struct_stat     struct stat64
  68. #define KDE_struct_dirent    struct dirent64
  69. #define KDE_rename        ::rename
  70. #define KDE_mkdir        ::mkdir
  71. /* TODO: define for win32 */
  72.  
  73. #else /* !_LFS64_LARGEFILE */
  74.  
  75. /*
  76.  * This section defines portable defines for standard file support.
  77.  */
  78. #ifdef _WIN32
  79. #define KDE_stat        kdewin32_stat
  80. #define KDE_lstat        kdewin32_lstat
  81. #define KDE_open        kdewin32_open
  82. #define KDE_rename        kdewin32_rename
  83. #define KDE_mkdir        kdewin32_mkdir
  84. #else /* unix */
  85. #define KDE_stat        ::stat
  86. #define KDE_lstat        ::lstat
  87. #define KDE_open        ::open
  88. #define KDE_rename        ::rename
  89. #define KDE_mkdir        ::mkdir
  90. #endif
  91.  
  92. #define KDE_fstat        ::fstat
  93. #define KDE_lseek        ::lseek
  94. #define KDE_fseek        ::fseek
  95. #define KDE_ftell        ::ftell
  96. #define KDE_fgetpos        ::fgetpos
  97. #define KDE_fsetpos        ::fsetpos
  98. #define KDE_readdir        ::readdir
  99. #define KDE_sendfile    ::sendfile
  100. #define KDE_struct_stat     struct stat
  101. #define KDE_struct_dirent    struct dirent
  102. #endif
  103.  
  104.  
  105. #ifdef _LFS64_STDIO
  106. #define KDE_fopen        ::fopen64
  107. #define KDE_freopen    ::freopen64
  108. /* TODO: define for win32 */
  109. #else
  110. #ifdef _WIN32
  111. #define KDE_fopen        kdewin32_fopen
  112. #define KDE_freopen    kdewin32_freopen
  113. #else /* unix */
  114. #define KDE_fopen        ::fopen
  115. #endif
  116. #endif
  117.  
  118. /* functions without 64-bit version but wrapped for compatibility reasons */
  119. #ifdef _WIN32
  120. #define KDE_fdopen    kdewin32_fdopen
  121. #else /* unix */
  122. #define KDE_fdopen    ::fdopen
  123. #endif
  124.  
  125. #endif /* _KDE_FILE_H_ */
  126.