From 7ad6bb42fc93312fe6bd705bb7b1d180f3b54a91 Mon Sep 17 00:00:00 2001 From: dm Date: Mon, 22 Dec 2008 23:18:41 +0000 Subject: [PATCH] Evil Win32 VS8 projects modified SVN revision: 38281 --- legacy/evil/win32/common/dirent.c | 301 -------------------------- legacy/evil/win32/common/dirent.h | 200 ----------------- legacy/evil/win32/vs8/libdlfcn.vcproj | 4 +- legacy/evil/win32/vs8/libevil.vcproj | 124 ++++++++--- 4 files changed, 92 insertions(+), 537 deletions(-) delete mode 100644 legacy/evil/win32/common/dirent.c delete mode 100644 legacy/evil/win32/common/dirent.h diff --git a/legacy/evil/win32/common/dirent.c b/legacy/evil/win32/common/dirent.c deleted file mode 100644 index 5de23bf8ae..0000000000 --- a/legacy/evil/win32/common/dirent.c +++ /dev/null @@ -1,301 +0,0 @@ -/* ///////////////////////////////////////////////////////////////////////////// - * File: dirent.c - * - * Purpose: Definition of the opendir() API functions for the Win32 platform. - * - * Created: 19th October 2002 - * Updated: 16th February 2008 - * - * Home: http://synesis.com.au/software/ - * - * Copyright (c) 2002-2008, Matthew Wilson and Synesis Software - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - Neither the names of Matthew Wilson and Synesis Software nor the names of - * any contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * ////////////////////////////////////////////////////////////////////////// */ - - -#ifndef UNIXEM_DOCUMENTATION_SKIP_SECTION -# define _SYNSOFT_VER_C_DIRENT_MAJOR 2 -# define _SYNSOFT_VER_C_DIRENT_MINOR 2 -# define _SYNSOFT_VER_C_DIRENT_REVISION 5 -# define _SYNSOFT_VER_C_DIRENT_EDIT 33 -#endif /* !UNIXEM_DOCUMENTATION_SKIP_SECTION */ - -/* ///////////////////////////////////////////////////////////////////////////// - * Includes - */ - -#include "dirent.h" - -//#include - -#include -#include -#include - -/* ///////////////////////////////////////////////////////////////////////////// - * Compiler differences - */ - -#if defined(__BORLANDC__) -# define UNIXEM_opendir_PROVIDED_BY_COMPILER -#elif defined(__DMC__) -# define UNIXEM_opendir_PROVIDED_BY_COMPILER -#elif defined(__GNUC__) -# define UNIXEM_opendir_PROVIDED_BY_COMPILER -#elif defined(__INTEL_COMPILER) -#elif defined(_MSC_VER) -#elif defined(__MWERKS__) -#elif defined(__WATCOMC__) -#else -# error Compiler not discriminated -#endif /* compiler */ - - -#if defined(UNIXEM_opendir_PROVIDED_BY_COMPILER) && \ - !defined(UNIXEM_FORCE_ANY_COMPILER) -# error The opendir() API is provided by this compiler, so should not be built here -#endif /* !UNIXEM_opendir_PROVIDED_BY_COMPILER */ - -/* ///////////////////////////////////////////////////////////////////////////// - * Constants and definitions - */ - -#ifndef FILE_ATTRIBUTE_ERROR -# define FILE_ATTRIBUTE_ERROR (0xFFFFFFFF) -#endif /* FILE_ATTRIBUTE_ERROR */ - -/* ///////////////////////////////////////////////////////////////////////////// - * Typedefs - */ - -struct dirent_dir -{ - char directory[_MAX_DIR + 1]; /* . */ - WIN32_FIND_DATAA find_data; /* The Win32 FindFile data. */ - HANDLE hFind; /* The Win32 FindFile handle. */ - struct dirent dirent; /* The handle's entry. */ -}; - -struct wdirent_dir -{ - wchar_t directory[_MAX_DIR + 1]; /* . */ - WIN32_FIND_DATAW find_data; /* The Win32 FindFile data. */ - HANDLE hFind; /* The Win32 FindFile handle. */ - struct wdirent dirent; /* The handle's entry. */ -}; - -/* ///////////////////////////////////////////////////////////////////////////// - * Helper functions - */ - -static HANDLE unixem__dirent__findfile_directory(char const *name, LPWIN32_FIND_DATAA data) -{ - char search_spec[_MAX_PATH +1]; - - /* Simply add the *.*, ensuring the path separator is - * included. - */ - (void)lstrcpyA(search_spec, name); - if( '\\' != search_spec[lstrlenA(search_spec) - 1] && - '/' != search_spec[lstrlenA(search_spec) - 1]) - { - (void)lstrcatA(search_spec, "\\*.*"); - } - else - { - (void)lstrcatA(search_spec, "*.*"); - } - - return FindFirstFileA(search_spec, data); -} - -#if 0 -static HANDLE unixem__dirent__wfindfile_directory(wchar_t const *name, LPWIN32_FIND_DATAW data) -{ - wchar_t search_spec[_MAX_PATH +1]; - - /* Simply add the *.*, ensuring the path separator is - * included. - */ - lstrcpyW(search_spec, name); - if( L'\\' != search_spec[lstrlenW(search_spec) - 1] && - L'/' != search_spec[lstrlenW(search_spec) - 1]) - { - lstrcatW(search_spec, L"\\*.*"); - } - else - { - lstrcatW(search_spec, L"*.*"); - } - - return FindFirstFileW(search_spec, data); -} -#endif /* 0 */ - -/* ///////////////////////////////////////////////////////////////////////////// - * API functions - */ - -DIR *opendir(char const *name) -{ - DIR *result = NULL; - DWORD dwAttr; - - /* Must be a valid name */ - if( !name || - !*name || - (dwAttr = GetFileAttributesA(name)) == 0xFFFFFFFF) - { - errno = ENOENT; - } - /* Must be a directory */ - else if(!(dwAttr & FILE_ATTRIBUTE_DIRECTORY)) - { - errno = ENOTDIR; - } - else - { - result = (DIR*)malloc(sizeof(DIR)); - - if(result == NULL) - { - errno = ENOMEM; - } - else - { - result->hFind = unixem__dirent__findfile_directory(name, &result->find_data); - - if(result->hFind == INVALID_HANDLE_VALUE) - { - free(result); - - result = NULL; - } - else - { - /* Save the directory, in case of rewind. */ - (void)lstrcpyA(result->directory, name); - (void)lstrcpyA(result->dirent.d_name, result->find_data.cFileName); - result->dirent.d_mode = (int)result->find_data.dwFileAttributes; - } - } - } - -#if 0 - if(NULL != dir) - { - struct dirent *readdir(DIR *dir) - - } -#endif /* 0 */ - - - - return result; -} - -int closedir(DIR *dir) -{ - int ret; - - if(dir == NULL) - { - errno = EBADF; - - ret = -1; - } - else - { - /* Close the search handle, if not already done. */ - if(dir->hFind != INVALID_HANDLE_VALUE) - { - (void)FindClose(dir->hFind); - } - - free(dir); - - ret = 0; - } - - return ret; -} - -void rewinddir(DIR *dir) -{ - /* Close the search handle, if not already done. */ - if(dir->hFind != INVALID_HANDLE_VALUE) - { - (void)FindClose(dir->hFind); - } - - dir->hFind = unixem__dirent__findfile_directory(dir->directory, &dir->find_data); - - if(dir->hFind != INVALID_HANDLE_VALUE) - { - (void)lstrcpyA(dir->dirent.d_name, dir->find_data.cFileName); - } -} - -struct dirent *readdir(DIR *dir) -{ - /* The last find exhausted the matches, so return NULL. */ - if(dir->hFind == INVALID_HANDLE_VALUE) - { - if(FILE_ATTRIBUTE_ERROR == dir->find_data.dwFileAttributes) - { - errno = EBADF; - } - else - { - dir->find_data.dwFileAttributes = FILE_ATTRIBUTE_ERROR; - } - - return NULL; - } - else - { - /* Copy the result of the last successful match to - * dirent. - */ - (void)lstrcpyA(dir->dirent.d_name, dir->find_data.cFileName); - - /* Attempt the next match. */ - if(!FindNextFileA(dir->hFind, &dir->find_data)) - { - /* Exhausted all matches, so close and null the - * handle. - */ - (void)FindClose(dir->hFind); - dir->hFind = INVALID_HANDLE_VALUE; - } - - return &dir->dirent; - } -} - -/* ////////////////////////////////////////////////////////////////////////// */ diff --git a/legacy/evil/win32/common/dirent.h b/legacy/evil/win32/common/dirent.h deleted file mode 100644 index 9729e23c1d..0000000000 --- a/legacy/evil/win32/common/dirent.h +++ /dev/null @@ -1,200 +0,0 @@ -/* ///////////////////////////////////////////////////////////////////////////// - * File: dirent.h - * - * Purpose: Declaration of the opendir() API functions and types for the - * Win32 platform. - * - * Created: 19th October 2002 - * Updated: 22nd April 2008 - * - * Home: http://synesis.com.au/software/ - * - * Copyright (c) 2002-2008, Matthew Wilson and Synesis Software - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - Neither the names of Matthew Wilson and Synesis Software nor the names of - * any contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * ////////////////////////////////////////////////////////////////////////// */ - -#ifdef EVIL_COMMON_API -# undef EVIL_COMMON_API -#endif /* EVIL_COMMON_API */ - -# ifdef EFL_EVIL_BUILD -# ifdef DLL_EXPORT -# define EVIL_COMMON_API __declspec(dllexport) -# else -# define EVIL_COMMON_API -# endif /* ! DLL_EXPORT */ -# else -# define EVIL_COMMON_API __declspec(dllimport) -# endif /* ! EFL_EVIL_BUILD */ - - -/** \file dirent.h - * - * Contains the declarations for the opendir()/readdir() API. - */ - -#ifndef SYNSOFT_UNIXEM_INCL_H_DIRENT -#define SYNSOFT_UNIXEM_INCL_H_DIRENT - -#ifndef UNIXEM_DOCUMENTATION_SKIP_SECTION -# define SYNSOFT_UNIXEM_VER_H_DIRENT_MAJOR 3 -# define SYNSOFT_UNIXEM_VER_H_DIRENT_MINOR 3 -# define SYNSOFT_UNIXEM_VER_H_DIRENT_REVISION 1 -# define SYNSOFT_UNIXEM_VER_H_DIRENT_EDIT 30 -#endif /* !UNIXEM_DOCUMENTATION_SKIP_SECTION */ - -/* ////////////////////////////////////////////////////////////////////////// */ - -/** \weakgroup unixem Synesis Software UNIX Emulation for Win32 - * \brief The UNIX emulation library - */ - -/** \weakgroup unixem_dirent opendir()/readdir() API - * \ingroup UNIXem unixem - * \brief This API provides facilities for enumerating the contents of directories - * @{ - */ - -/* ////////////////////////////////////////////////////////////////////////// */ - -#ifndef _WIN32 -# error This file is only currently defined for compilation on Win32 systems -#endif /* _WIN32 */ - -/* ///////////////////////////////////////////////////////////////////////////// - * Includes - */ - -#include - -/* ///////////////////////////////////////////////////////////////////////////// - * Constants and definitions - */ - -#ifndef NAME_MAX -# define NAME_MAX (260) /*!< \brief The maximum number of characters (including null terminator) in a directory entry name */ -#endif /* !NAME_MAX */ - -/* ///////////////////////////////////////////////////////////////////////////// - * Typedefs - */ - -typedef struct dirent_dir DIR; /*!< \brief Handle type for ANSI directory enumeration. \note dirent_dir is defined internally */ -typedef struct wdirent_dir wDIR; /*!< \brief Handle type for Unicode directory enumeration. \note dirent_dir is defined internally */ - -/** \brief Results structure for readdir() - */ -struct dirent -{ - char d_name[NAME_MAX + 1]; /*!< file name (null-terminated) */ - int d_mode; -}; - -/** \brief Results structure for wreaddir() - */ -struct wdirent -{ - wchar_t d_name[NAME_MAX + 1]; /*!< file name (null-terminated) */ - int d_mode; -}; - -/* ///////////////////////////////////////////////////////////////////////////// - * API functions - */ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -/** \brief Returns a pointer to the next directory entry. - * - * This function opens the directory named by filename, and returns a - * directory to be used to in subsequent operations. NULL is returned - * if name cannot be accessed, or if resources cannot be acquired to - * process the request. - * - * \param name The name of the directory to search - * \return The directory handle from which the entries are read or NULL - */ -EVIL_COMMON_API DIR* opendir(char const* name); -/** \brief Identical semantics to opendir(), but for Unicode searches. - */ -EVIL_COMMON_API wDIR* wopendir(wchar_t const* name); - -/** \brief Closes a directory handle - * - * This function closes a directory handle that was opened with opendir() - * and releases any resources associated with that directory handle. - * - * \param dir The directory handle from which the entries are read - * \return 0 on success, or -1 to indicate error. - */ -EVIL_COMMON_API int closedir(DIR* dir); -/** \brief Identical semantics to closedir(), but for Unicode searches. - */ -EVIL_COMMON_API int wclosedir(wDIR* dir); - -/** \brief Resets a directory search position - * - * This function resets the position of the named directory handle to - * the beginning of the directory. - * - * \param dir The directory handle whose position should be reset - */ -EVIL_COMMON_API void rewinddir(DIR* dir); -/** \brief Identical semantics to rewinddir(), but for Unicode searches. - */ -EVIL_COMMON_API void wrewinddir(wDIR* dir); - -/** \brief Returns a pointer to the next directory entry. - * - * This function returns a pointer to the next directory entry, or NULL upon - * reaching the end of the directory or detecting an invalid seekdir() operation - * - * \param dir The directory handle from which the entries are read - * \return A dirent structure or NULL - */ -EVIL_COMMON_API struct dirent* readdir(DIR* dir); -/** \brief Identical semantics to readdir(), but for Unicode searches. - */ -EVIL_COMMON_API struct wdirent* wreaddir(wDIR* dir); - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -/* ////////////////////////////////////////////////////////////////////////// */ - -/** @} // end of group unixem_dirent */ - -/* ////////////////////////////////////////////////////////////////////////// */ - -#endif /* SYNSOFT_UNIXEM_INCL_H_DIRENT */ - -/* ////////////////////////////////////////////////////////////////////////// */ diff --git a/legacy/evil/win32/vs8/libdlfcn.vcproj b/legacy/evil/win32/vs8/libdlfcn.vcproj index d6ce43bc46..f9a6d9755f 100644 --- a/legacy/evil/win32/vs8/libdlfcn.vcproj +++ b/legacy/evil/win32/vs8/libdlfcn.vcproj @@ -41,7 +41,7 @@ Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="$(INCLUDE)" - PreprocessorDefinitions="WIN32;_DEBUG;_LIB;EFL_EVIL_DLFCN_BUILD;DLL_EXPORT;_POSIX_" + PreprocessorDefinitions="WIN32;_DEBUG;_LIB;EFL_EVIL_DLFCN_BUILD;DLL_EXPORT;_POSIX_;__UNUSED__=" MinimalRebuild="true" BasicRuntimeChecks="3" RuntimeLibrary="3" @@ -117,7 +117,7 @@ + + + + + + + + + + @@ -208,10 +228,22 @@ RelativePath="..\..\src\lib\evil_pwd.c" > + + + + + + @@ -220,32 +252,80 @@ RelativePath="..\..\src\lib\evil_util.c" > + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + - - - - - - - - - - - -