Synesis Software

unixem/internal/util.h File Reference


Detailed Description

Internal utility header for the UNIXem API.

#include <unixem/unixem.h>

Go to the source code of this file.

Defines

#define NUM_ELEMENTS(ar)   (sizeof(ar) / sizeof(0[ar]))
 Evaluates the size of an array.
#define UNIXEM_STGCLS_IMP
 Storage class specifier, defined as appropriate to the given compiler.

Functions

void * unixem_internal_Windows_HANDLE_from_file_handle (int fd)
 Converts a standard file handle to a Windows HANDLE.
int unixem_internal_errno_from_Win32 (unsigned long)
 Converts a Windows error code to an errno.
char unixem_internal_get_current_drive (void)
 Gets the drive letter of the current working directory.
long unixem_internal_FILETIMEToUNIXTime (void const *ft, long *microseconds)
 Converts a Windows FILETIME value to a UNIX time value.


Define Documentation

#define NUM_ELEMENTS ( ar   )     (sizeof(ar) / sizeof(0[ar]))

Evaluates the size of an array.

Parameters:
ar The array.
Warning:
This produces unintended behaviour if used with a pointer, and undefined behaviour if used, in C++, with a user-defined type that defines a subscript operator. See Chapter 14 of Imperfect C++ (http://www.imperfectcplusplus.com/)

Referenced by unixem_glob(), unixem_internal_errno_from_Win32(), and unixem_internal_get_current_drive().

#define UNIXEM_STGCLS_IMP

Storage class specifier, defined as appropriate to the given compiler.


Function Documentation

int unixem_internal_errno_from_Win32 ( unsigned  long  ) 

long unixem_internal_FILETIMEToUNIXTime ( void const *  ft,
long *  microseconds 
)

Converts a Windows FILETIME value to a UNIX time value.

Referenced by unixem_gettimeofday().

char unixem_internal_get_current_drive ( void   ) 

Gets the drive letter of the current working directory.

Return values:
Either an uppercase letter, or '\0' on failure;

References NUM_ELEMENTS, unixem_internal_errno_from_Win32(), and unixem_internal_get_current_drive().

Referenced by unixem_internal_get_current_drive(), and unixem_link().

void* unixem_internal_Windows_HANDLE_from_file_handle ( int  fd  ) 


UNIX Emulation for Win32 Libraries documentation © Synesis Software Pty Ltd, 2002-2010