Microsoft Windows portability layer. More...

Modules

 Dirent.h functions
 This header provides functions ported from Unix in dirent.h.
 
 Functions that manage dynamic-link libraries.
 This header provides functions to load and unload dynamic-link libaries, to get the address of a symbol, and to get diagnostic information.
 
 Main
 This header provides functions to initialize and shut down the Evil library.
 
 Stdio.h functions
 This header provides functions ported from Unix in stdio.h.
 
 Stdlib.h functions.
 This header provides functions ported from Unix in stdlib.h.
 
 String.h functions.
 This header provides functions ported from Unix in string.h.
 
 Time.h functions
 This header provides functions ported from Unix in time.h.
 
 Unistd.h functions
 This header provides functions ported from Unix in unistd.h.
 
 Pwd.h functions
 This header provides functions ported from Unix in dirent.h.
 
 Functions that manage memory mappping.
 This header provides the meomry map functions mmap and munmap.
 

Functions

int fcntl (int fd, int cmd,...)
 Provide control over file descriptors. More...
 
wchar_t * evil_char_to_wchar (const char *text)
 Convert a string from char * to wchar_t *. More...
 
char * evil_wchar_to_char (const wchar_t *text)
 Convert a string from wchar_t * to char *. More...
 
char * evil_utf16_to_utf8 (const wchar_t *text)
 Convert a string from UTF-16 to UTF-8. More...
 
const char * evil_tmpdir_get (void)
 Return a dir to store temporary files. More...
 
const char * evil_homedir_get (void)
 Return a dir to store personal files. More...
 
int evil_path_is_absolute (const char *path)
 check if the given path is absolute. More...
 

Detailed Description

Microsoft Windows portability layer.

Function Documentation

◆ fcntl()

int fcntl ( int  fd,
int  cmd,
  ... 
)

Provide control over file descriptors.

Parameters
fdThe file descriptor.
cmdThe type of control.
Returns
0 on success, -1 otherwise.

Performs one of various miscellaneous operations on fd. The operation in question is determined by cmd:

  • F_SETFD: Set the close-on-exec flag to the value specified by the argument after command (only the least significant bit is used).
  • F_SETLK and F_SETLKW: used to manage discretionary file locks. The third argument must be a pointer to a struct flock (that may be overwritten by this call).

This function returns 0 on success, -1 otherwise.

Conformity: None.

Supported OS: Windows Vista, Windows XP or Windows 2000 Professional.

References flock::l_len, flock::l_start, flock::l_type, and flock::l_whence.

Referenced by eina_mmap_safety_enabled_set(), and evas_async_events_process().

◆ evil_char_to_wchar()

wchar_t* evil_char_to_wchar ( const char *  text)

Convert a string from char * to wchar_t *.

Parameters
textThe string to convert.
Returns
The converted string.

Convert a string from char * to wchar_t * and return it. If the allocation or conversion fails, NULL is returned. On success, the returned value must be freed when it is not used anymore.

Conformity: Non applicable.

Supported OS: Windows 95, Windows 98, Windows Me, Windows NT, Windows 2000, Windows XP.

Referenced by dlopen(), dlsym(), ffs(), mkstemp(), opendir(), readlink(), setenv(), and symlink().

◆ evil_wchar_to_char()

char* evil_wchar_to_char ( const wchar_t *  text)

Convert a string from wchar_t * to char *.

Parameters
textThe string to convert.
Returns
The converted string.

Convert a string from wchar_t * to char * and return it. If the allocation or conversion fails, NULL is returned. On success, the returned value must be freed when it is not used anymore.

Conformity: Non applicable.

Supported OS: Windows 95, Windows 98, Windows Me, Windows NT, Windows 2000, Windows XP.

Referenced by evil_utf16_to_utf8(), readdir(), and readlink().

◆ evil_utf16_to_utf8()

char* evil_utf16_to_utf8 ( const wchar_t *  text)

Convert a string from UTF-16 to UTF-8.

Parameters
textThe string to convert in UTF-16.
Returns
The converted string in UTF-8.

Convert a string from UTF-16 to UTF-8 and return it. If the allocation or conversion fails, NULL is returned. On success, the returned value must be freed when it is not used anymore.

Conformity: Non applicable.

Supported OS: Windows 95, Windows 98, Windows Me, Windows NT, Windows 2000, Windows XP.

References evil_wchar_to_char().

◆ evil_tmpdir_get()

const char* evil_tmpdir_get ( void  )

Return a dir to store temporary files.

Returns
The directory to store temporary files.

Return a directory to store temporary files. The function gets the value of the following environment variables, and in that order:

  • TMP
  • TEMP
  • USERPROFILE
  • WINDIR and returns its value if it exists. If none exists, the function returns "C:\".

Conformity: Non applicable.

Supported OS: Windows 95, Windows 98, Windows Me, Windows NT, Windows 2000, Windows XP.

◆ evil_homedir_get()

const char* evil_homedir_get ( void  )

Return a dir to store personal files.

Returns
The directory to store personal files.

Return a directory to store personal files. The function gets the value of the following environment variables, and in that order:

  • HOME
  • USERPROFILE
  • WINDIR and returns its value if it exists. If none exists, the function returns "C:\".

Conformity: Non applicable.

Supported OS: Windows 95, Windows 98, Windows Me, Windows NT, Windows 2000, Windows XP.

◆ evil_path_is_absolute()

int evil_path_is_absolute ( const char *  path)

check if the given path is absolute.

Parameters
pathThe path to check.
Returns
1 if the given path is absolute, 0 otherwise.

Check if the path path is absolute or not. An absolute path must begin with a letter (upper or lower case), followed by by the char ':', followed by the char '/' or '\'. If path is absolute this function returns 1, otherwise it returns 0. If path is NULL, it returns 0.

Conformity: Non applicable.

Supported OS: Windows 95, Windows 98, Windows Me, Windows NT, Windows 2000, Windows XP, Windows CE.

Since
1.7