![]() |
|||||
|
00001 /* ///////////////////////////////////////////////////////////////////////// 00002 * File: unixem/dirent.h 00003 * 00004 * Purpose: Declaration of the opendir() API functions and types for the 00005 * Win32 platform. 00006 * 00007 * Created: 19th October 2002 00008 * Updated: 13th August 2010 00009 * 00010 * Home: http://synesis.com.au/software/ 00011 * 00012 * Copyright (c) 2002-2010, Matthew Wilson and Synesis Software 00013 * All rights reserved. 00014 * 00015 * Redistribution and use in source and binary forms, with or without 00016 * modification, are permitted provided that the following conditions are 00017 * met: 00018 * 00019 * - Redistributions of source code must retain the above copyright notice, 00020 * this list of conditions and the following disclaimer. 00021 * - Redistributions in binary form must reproduce the above copyright 00022 * notice, this list of conditions and the following disclaimer in the 00023 * documentation and/or other materials provided with the distribution. 00024 * - Neither the name(s) of Matthew Wilson and Synesis Software nor the 00025 * names of any contributors may be used to endorse or promote products 00026 * derived from this software without specific prior written permission. 00027 * 00028 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 00029 * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 00030 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 00031 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 00032 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 00033 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 00034 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 00035 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 00036 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 00037 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 00038 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00039 * 00040 * ////////////////////////////////////////////////////////////////////// */ 00041 00042 00048 #ifndef SYNSOFT_UNIXEM_INCL_UNIXEM_H_DIRENT 00049 #define SYNSOFT_UNIXEM_INCL_UNIXEM_H_DIRENT 00050 00051 #ifndef UNIXEM_DOCUMENTATION_SKIP_SECTION 00052 # define SYNSOFT_UNIXEM_VER_UNIXEM_H_DIRENT_MAJOR 4 00053 # define SYNSOFT_UNIXEM_VER_UNIXEM_H_DIRENT_MINOR 0 00054 # define SYNSOFT_UNIXEM_VER_UNIXEM_H_DIRENT_REVISION 1 00055 # define SYNSOFT_UNIXEM_VER_UNIXEM_H_DIRENT_EDIT 33 00056 #endif /* !UNIXEM_DOCUMENTATION_SKIP_SECTION */ 00057 00058 /* ////////////////////////////////////////////////////////////////////// */ 00059 00070 /* ////////////////////////////////////////////////////////////////////// */ 00071 00072 #ifndef _WIN32 00073 # error This file is only currently defined for compilation on Win32 systems 00074 #endif /* _WIN32 */ 00075 00076 /* ///////////////////////////////////////////////////////////////////////// 00077 * Includes 00078 */ 00079 00080 #include <unixem/unixem.h> 00081 #include <stddef.h> 00082 00083 /* ///////////////////////////////////////////////////////////////////////// 00084 * Constants and definitions 00085 */ 00086 00087 #ifndef NAME_MAX 00088 # define NAME_MAX (260) 00089 #endif /* !NAME_MAX */ 00090 00091 /* ///////////////////////////////////////////////////////////////////////// 00092 * Typedefs 00093 */ 00094 00095 typedef struct dirent_dir unixem_DIR; 00096 typedef struct wdirent_dir unixem_wDIR; 00100 struct unixem_dirent 00101 { 00102 char d_name[NAME_MAX + 1]; 00103 int d_mode; 00104 }; 00105 00108 struct unixem_wdirent 00109 { 00110 wchar_t d_name[NAME_MAX + 1]; 00111 int d_mode; 00112 }; 00113 00114 /* ///////////////////////////////////////////////////////////////////////// 00115 * API functions 00116 */ 00117 00118 #ifdef __cplusplus 00119 extern "C" { 00120 #endif /* __cplusplus */ 00121 00132 unixem_DIR* unixem_opendir(char const* name); 00135 unixem_wDIR* unixem_wopendir(wchar_t const* name); 00136 00145 int unixem_closedir(unixem_DIR* dir); 00148 int unixem_wclosedir(unixem_wDIR* dir); 00149 00157 void unixem_rewinddir(unixem_DIR* dir); 00160 void unixem_wrewinddir(unixem_wDIR* dir); 00161 00170 struct unixem_dirent* unixem_readdir(unixem_DIR* dir); 00173 struct unixem_wdirent* unixem_wreaddir(unixem_wDIR* dir); 00174 00175 00176 #ifdef __cplusplus 00177 } 00178 #endif /* __cplusplus */ 00179 00180 /* ////////////////////////////////////////////////////////////////////// */ 00181 00184 /* ////////////////////////////////////////////////////////////////////// */ 00185 00186 #endif /* SYNSOFT_UNIXEM_INCL_UNIXEM_H_DIRENT */ 00187 00188 /* ///////////////////////////// end of file //////////////////////////// */
|
UNIX Emulation for Win32 Libraries documentation © Synesis Software Pty Ltd, 2002-2010 |