C/C++ User's Journal Synesis Software STLSoft - ... Robust, Lightweight, Cross-platform, Template Software ... ATLSTL - where the Standard Template Library meets the Active Template Library COMSTL - where the Standard Template Library meets the Component Object Model InetSTL - where the Standard Template Library meets the Internet UNIXSTL - Template Software for the UNIX Operating System WinSTL - where the Standard Template Library meets the Win32 API

Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

/API/include/recls_platform_types.h

Go to the documentation of this file.
00001 /* 
00002  * File:        recls_platform_types.h
00003  *
00004  * Purpose:     Platform discrimination for the recls API.
00005  *
00006  * Created:     18th August 2003
00007  * Updated:     31st May 2004
00008  *
00009  * License:     (Licensed under the Synesis Software Standard Source License)
00010  *
00011  *              Copyright (C) 2002-2004, Synesis Software Pty Ltd.
00012  *
00013  *              All rights reserved.
00014  *
00015  *              www:        http://www.synesis.com.au/software
00016  *                          http://www.recls.org/
00017  *
00018  *              email:      submissions@recls.org  for submissions
00019  *                          admin@recls.org        for other enquiries
00020  *
00021  *              Redistribution and use in source and binary forms, with or
00022  *              without modification, are permitted provided that the following
00023  *              conditions are met:
00024  *
00025  *              (i) Redistributions of source code must retain the above
00026  *              copyright notice and contact information, this list of
00027  *              conditions and the following disclaimer.
00028  *
00029  *              (ii) Any derived versions of this software (howsoever modified)
00030  *              remain the sole property of Synesis Software.
00031  *
00032  *              (iii) Any derived versions of this software (howsoever modified)
00033  *              remain subject to all these conditions.
00034  *
00035  *              (iv) Neither the name of Synesis Software nor the names of any
00036  *              subdivisions, employees or agents of Synesis Software, nor the
00037  *              names of any other contributors to this software may be used to
00038  *              endorse or promote products derived from this software without
00039  *              specific prior written permission.
00040  *
00041  *              This source code is provided by Synesis Software "as is" and any
00042  *              warranties, whether expressed or implied, including, but not
00043  *              limited to, the implied warranties of merchantability and
00044  *              fitness for a particular purpose are disclaimed. In no event
00045  *              shall the Synesis Software be liable for any direct, indirect,
00046  *              incidental, special, exemplary, or consequential damages
00047  *              (including, but not limited to, procurement of substitute goods
00048  *              or services; loss of use, data, or profits; or business
00049  *              interruption) however caused and on any theory of liability,
00050  *              whether in contract, strict liability, or tort (including
00051  *              negligence or otherwise) arising in any way out of the use of
00052  *              this software, even if advised of the possibility of such
00053  *              damage.
00054  *
00055  * 
00056 
00057 
00058 #ifndef RECLS_INCL_H_RECLS_PLATFORM_TYPES
00059 #define RECLS_INCL_H_RECLS_PLATFORM_TYPES
00060 
00061 /* File version */
00062 #ifndef RECLS_DOCUMENTATION_SKIP_SECTION
00063 # define RECLS_VER_H_RECLS_PLATFORM_TYPES_MAJOR     1
00064 # define RECLS_VER_H_RECLS_PLATFORM_TYPES_MINOR     5
00065 # define RECLS_VER_H_RECLS_PLATFORM_TYPES_REVISION  1
00066 # define RECLS_VER_H_RECLS_PLATFORM_TYPES_EDIT      12
00067 #endif /* !RECLS_DOCUMENTATION_SKIP_SECTION */
00068 
00071 /* 
00072  * Includes
00073  */
00074 
00075 #ifndef RECLS_INCL_H_RECLS_PLATFORM
00076 # error recls_platform_types.h must not be included directly. You should include recls.h
00077 #endif /* !RECLS_INCL_H_RECLS_PLATFORM */
00078 
00079 #if defined(RECLS_PLATFORM_IS_WIN32)
00080 //# include <windows.h>
00081 #elif defined(RECLS_PLATFORM_IS_UNIX)
00082 # include <time.h>
00083 # include <sys/types.h>
00084 #else
00085 # error Platform not (yet) recognised
00086 #endif /* platform */
00087 
00088 /* 
00089  * Namespace
00090  */
00091 
00092 #if !defined(RECLS_NO_NAMESPACE)
00093 namespace recls
00094 {
00095 #endif /* !RECLS_NO_NAMESPACE */
00096 
00097 /* 
00098  * Platform-dependent types
00099  */
00100 
00104 #if defined(RECLS_PLATFORM_IS_WIN32)
00105 
00106  typedef FILETIME                   recls_time_t;
00107  typedef ULARGE_INTEGER             recls_filesize_t;
00108 
00109 #elif defined(RECLS_PLATFORM_IS_UNIX)
00110 
00111  typedef time_t                     recls_time_t;
00112  typedef off_t                      recls_filesize_t;
00113 
00114 #else
00115 
00116 # error Platform not (yet) recognised
00117 
00118  typedef platform-dependent-type    recls_time_t;
00119  typedef platform-dependent-type    recls_filesize_t;
00120 
00121 #endif /* platform */
00122 
00123 /* 
00124  * Typedefs
00125  */
00126 
00127 #if defined(_UNICODE) && \
00128     !defined(UNICODE)
00129 # define UNICODE
00130 #endif /* _UNICODE && !UNICODE */
00131 
00132 #if defined(UNICODE) && \
00133     !defined(_UNICODE)
00134 # define _UNICODE
00135 #endif /* UNICODE && !_UNICODE */
00136 
00137 #ifdef RECLS_CHAR_TYPE_IS_CHAR
00138 # undef RECLS_CHAR_TYPE_IS_CHAR
00139 #endif /* RECLS_CHAR_TYPE_IS_CHAR */
00140 
00141 #ifdef RECLS_CHAR_TYPE_IS_WCHAR
00142 # undef RECLS_CHAR_TYPE_IS_WCHAR
00143 #endif /* RECLS_CHAR_TYPE_IS_WCHAR */
00144 
00146 #if defined(UNICODE) && \
00147     !defined(RECLS_NO_UNICODE)
00148 typedef recls_char_w_t              recls_char_t;
00149 # define RECLS_CHAR_TYPE_IS_WCHAR
00150 # define RECLS_LITERAL(x)           L ## x
00151 #else /* ? UNICODE && !RECLS_NO_UNICODE */
00152 typedef recls_char_a_t              recls_char_t;
00153 # define RECLS_CHAR_TYPE_IS_CHAR
00154 # define RECLS_LITERAL(x)           x
00155 #endif /* UNICODE && !RECLS_NO_UNICODE */
00156 
00157 
00159 struct recls_strptrs_t
00160 {
00162     recls_char_t const  *begin;
00164     recls_char_t const  *end;
00165 };
00166 
00168 struct recls_strptrsptrs_t
00169 {
00171     struct recls_strptrs_t const    *begin;
00173     struct recls_strptrs_t const    *end;
00174 };
00175 
00180 struct recls_fileinfo_t
00181 {
00185     recls_uint32_t              attributes;
00193     struct recls_strptrs_t      path;
00194 #if defined(RECLS_PLATFORM_IS_WIN32)
00195 
00200     struct recls_strptrs_t      shortFile;
00202     recls_char_t                drive;
00203 #endif /* RECLS_PLATFORM_IS_WIN32 */
00204 
00208     struct recls_strptrs_t      directory;
00213     struct recls_strptrs_t      fileName;
00218     struct recls_strptrs_t      fileExt;
00223     struct recls_strptrsptrs_t  directoryParts;
00227 #if defined(RECLS_PLATFORM_IS_WIN32)
00228 
00232     recls_time_t                creationTime;
00233 #endif /* RECLS_PLATFORM_IS_WIN32 */
00234 
00235     recls_time_t                modificationTime;
00237     recls_time_t                lastAccessTime;
00238 #if defined(RECLS_PLATFORM_IS_UNIX)
00239 
00243     recls_time_t                lastStatusChangeTime;
00244 #endif /* RECLS_PLATFORM_IS_UNIX */
00245 
00249     recls_filesize_t            size;
00251 /* data */
00255     recls_byte_t                data[1];
00256     /*
00257      *
00258      * - full path
00259      * - directory parts
00260      *
00261      */
00262 };
00263 
00264 /* 
00265  * Namespace
00266  */
00267 
00268 #if !defined(RECLS_NO_NAMESPACE)
00269 } /* namespace recls */
00270 #endif /* !RECLS_NO_NAMESPACE */
00271 
00272 /* 
00273 
00274 #endif /* !RECLS_INCL_H_RECLS_PLATFORM_TYPES */
00275 
00276 /* 

recls Library documentation © Synesis Software Pty Ltd, 2001-2004