![]() |
|||||
|
00001 /* ///////////////////////////////////////////////////////////////////////// 00002 * File: unixem/internal/util.h 00003 * 00004 * Purpose: Internal utility header for the UNIXem API. 00005 * 00006 * Created: 2nd September 2005 00007 * Updated: 13th August 2010 00008 * 00009 * Home: http://synesis.com.au/software/ 00010 * 00011 * Copyright (c) 1994-2010, Matthew Wilson and Synesis Software 00012 * All rights reserved. 00013 * 00014 * Redistribution and use in source and binary forms, with or without 00015 * modification, are permitted provided that the following conditions are 00016 * met: 00017 * 00018 * - Redistributions of source code must retain the above copyright notice, 00019 * this list of conditions and the following disclaimer. 00020 * - Redistributions in binary form must reproduce the above copyright 00021 * notice, this list of conditions and the following disclaimer in the 00022 * documentation and/or other materials provided with the distribution. 00023 * - Neither the name(s) of Matthew Wilson and Synesis Software nor the 00024 * names of any contributors may be used to endorse or promote products 00025 * derived from this software without specific prior written permission. 00026 * 00027 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 00028 * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 00029 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 00030 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 00031 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 00032 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 00033 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 00034 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 00035 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 00036 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 00037 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00038 * 00039 * ////////////////////////////////////////////////////////////////////// */ 00040 00041 00045 #ifndef UNIXEM_INCL_UNIXEM_INTERNAL_H_UTIL 00046 #define UNIXEM_INCL_UNIXEM_INTERNAL_H_UTIL 00047 00048 /* ///////////////////////////////////////////////////////////////////////// 00049 * Version 00050 */ 00051 00052 #ifndef UNIXEM_DOCUMENTATION_SKIP_SECTION 00053 # define UNIXEM_VER_UNIXEM_INTERNAL_H_UTIL_MAJOR 1 00054 # define UNIXEM_VER_UNIXEM_INTERNAL_H_UTIL_MINOR 3 00055 # define UNIXEM_VER_UNIXEM_INTERNAL_H_UTIL_REVISION 1 00056 # define UNIXEM_VER_UNIXEM_INTERNAL_H_UTIL_EDIT 10 00057 #endif /* !UNIXEM_DOCUMENTATION_SKIP_SECTION */ 00058 00059 /* ///////////////////////////////////////////////////////////////////////// 00060 * Includes 00061 */ 00062 00063 #include <unixem/unixem.h> 00064 00065 /* ///////////////////////////////////////////////////////////////////////// 00066 * Macros 00067 */ 00068 00081 #ifndef NUM_ELEMENTS 00082 # ifdef __DMC__ 00083 # define NUM_ELEMENTS(ar) (sizeof(ar) / sizeof(ar[0])) 00084 # else /* ? compiler */ 00085 # define NUM_ELEMENTS(ar) (sizeof(ar) / sizeof(0[ar])) 00086 # endif /* compiler */ 00087 #endif /* !NUM_ELEMENTS */ 00088 00089 /* ///////////////////////////////////////////////////////////////////////// 00090 * Linkage specifications 00091 */ 00092 00098 #if defined(__BORLANDC__) 00099 # define UNIXEM_STGCLS_IMP __declspec(dllimport) 00100 #elif defined(__DMC__) || \ 00101 defined(__INTEL_COMPILER) || \ 00102 defined(__MWERKS__) || \ 00103 defined(_MSC_VER) 00104 # if defined(_MT) 00105 # define UNIXEM_STGCLS_IMP __declspec(dllimport) 00106 # else /* ? _MT */ 00107 # define UNIXEM_STGCLS_IMP 00108 # endif /* _MT */ 00109 #else 00110 # define UNIXEM_STGCLS_IMP 00111 #endif /* compiler */ 00112 00113 /* ///////////////////////////////////////////////////////////////////////// 00114 * Function declarations 00115 */ 00116 00117 #ifdef __cplusplus 00118 extern "C" 00119 { 00120 #endif /* __cplusplus */ 00121 00124 void* unixem_internal_Windows_HANDLE_from_file_handle(int fd); 00125 00128 int unixem_internal_errno_from_Win32(unsigned long); 00129 00134 char unixem_internal_get_current_drive(void); 00135 00138 long unixem_internal_FILETIMEToUNIXTime( 00139 void const* ft 00140 , long* microseconds 00141 ); 00142 00143 00144 #ifdef __cplusplus 00145 } /* extern "C" */ 00146 #endif /* __cplusplus */ 00147 00148 /* ////////////////////////////////////////////////////////////////////// */ 00149 00150 #endif /* UNIXEM_INCL_UNIXEM_INTERNAL_H_UTIL */ 00151 00152 /* ///////////////////////////// end of file //////////////////////////// */
|
UNIX Emulation for Win32 Libraries documentation © Synesis Software Pty Ltd, 2002-2010 |