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_Windows_HANDLE_from_file_handle (int fd)
 Converts a standard file handle to a Windows HANDLE.
int errno_from_Win32 (unsigned long)
 Converts a Windows error code to an errno.
char get_current_drive (void)
 Gets the drive letter of the current working directory.
long 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 errno_from_Win32(), get_current_drive(), and glob().

#define UNIXEM_STGCLS_IMP

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


Function Documentation

int errno_from_Win32 ( unsigned  long  ) 

Converts a Windows error code to an errno.

References errno_from_Win32(), and NUM_ELEMENTS.

Referenced by chdir(), errno_from_Win32(), get_current_drive(), getcwd(), getrusage(), link(), mkdir(), readv(), realpath(), rmdir(), unlink(), and writev().

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

Converts a Windows FILETIME value to a UNIX time value.

Referenced by gettimeofday().

char get_current_drive ( void   ) 

Gets the drive letter of the current working directory.

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

References errno_from_Win32(), get_current_drive(), and NUM_ELEMENTS.

Referenced by get_current_drive(), and link().

void* unixem_Windows_HANDLE_from_file_handle ( int  fd  ) 

Converts a standard file handle to a Windows HANDLE.

References unixem_Windows_HANDLE_from_file_handle().

Referenced by mmap(), readv(), unixem_Windows_HANDLE_from_file_handle(), and writev().


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