C/C++ User's Journal Synesis Software STLSoft - ... Robust, Lightweight, Cross-platform, Template Software ... UNIXSTL - Template Software for the UNIX Operating System WinSTL - where the Standard Template Library meets the Win32 API

Main Page   Modules   Alphabetical List   Compound List   File List   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:     23rd September 2003
00008  *
00009  * License:     (Licensed under the Synesis Software Standard Source License)
00010  *
00011  *              Copyright (C) 2002-2003, 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     0
00065 # define RECLS_VER_H_RECLS_PLATFORM_TYPES_REVISION  4
00066 # define RECLS_VER_H_RECLS_PLATFORM_TYPES_EDIT      4
00067 #endif /* !RECLS_DOCUMENTATION_SKIP_SECTION */
00068 
00071 /* 
00072  * Namespace
00073  */
00074 
00075 #if !defined(RECLS_NO_NAMESPACE)
00076 namespace recls
00077 {
00078 #endif /* !RECLS_NO_NAMESPACE */
00079 
00080 /* 
00081  * Platform-dependent types
00082  */
00083 
00087 #if defined(RECLS_PLATFORM_IS_WIN32)
00088 
00089  typedef FILETIME                   recls_time_t;
00090  typedef ULARGE_INTEGER             recls_filesize_t;
00091 
00092 #elif defined(RECLS_PLATFORM_IS_UNIX)
00093 
00094  typedef time_t                     recls_time_t;
00095  typedef off_t                      recls_filesize_t;
00096 
00097 #else
00098 
00099  typedef platform-dependent-type    recls_time_t;
00100  typedef platform-dependent-type    recls_filesize_t;
00101 
00102 # error Platform not (yet) recognised
00103 
00104 #endif /* platform */
00105 
00106 /* 
00107  * Typedefs
00108  */
00109 
00111 struct recls_strptrs_t
00112 {
00114     char const  *begin;
00116     char const  *end;
00117 };
00118 
00120 struct recls_strptrsptrs_t
00121 {
00123     struct recls_strptrs_t const    *begin;
00125     struct recls_strptrs_t const    *end;
00126 };
00127 
00132 struct recls_fileinfo_t
00133 {
00137     recls_uint32_t              attributes;
00142     struct recls_strptrs_t      path;
00143 #if defined(RECLS_PLATFORM_IS_WIN32)
00144 
00148     struct recls_strptrs_t      shortFile;
00150     char                        drive;
00151 #endif /* RECLS_PLATFORM_IS_WIN32 */
00152 
00153     struct recls_strptrs_t      directory;
00155     struct recls_strptrs_t      fileName;
00157     struct recls_strptrs_t      fileExt;
00159     struct recls_strptrsptrs_t  directoryParts;
00163 #if defined(RECLS_PLATFORM_IS_WIN32)
00164 
00168     recls_time_t                creationTime;
00169 #endif /* RECLS_PLATFORM_IS_WIN32 */
00170 
00171     recls_time_t                modificationTime;
00173     recls_time_t                lastAccessTime;
00174 #if defined(RECLS_PLATFORM_IS_UNIX)
00175 
00179     recls_time_t                lastStatusChangeTime;
00180 #endif /* RECLS_PLATFORM_IS_UNIX */
00181 
00185     recls_filesize_t            size;
00187 /* data */
00189     recls_byte_t                data[1];
00190     /*
00191      *
00192      * - full path
00193      * - directory parts
00194      *
00195      */
00196 };
00197 
00198 /* 
00199  * Namespace
00200  */
00201 
00202 #if !defined(RECLS_NO_NAMESPACE)
00203 } /* namespace recls */
00204 #endif /* !RECLS_NO_NAMESPACE */
00205 
00206 /* 
00207 
00208 #endif /* !RECLS_INCL_H_RECLS_PLATFORM_TYPES */
00209 
00210 /* 

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