2008-03-01 23:03:37 -08:00
|
|
|
#ifndef __EVIL_H__
|
|
|
|
#define __EVIL_H__
|
2008-02-27 13:01:30 -08:00
|
|
|
|
2012-12-28 10:42:35 -08:00
|
|
|
/**
|
|
|
|
* @file Evil.h
|
|
|
|
* @brief The file that provides miscellaneous functions ported from Unix.
|
|
|
|
*/
|
|
|
|
|
2008-02-27 13:01:30 -08:00
|
|
|
/**
|
2012-12-18 08:12:56 -08:00
|
|
|
* @page evil_main Evil
|
2008-02-29 14:42:14 -08:00
|
|
|
* @author Vincent Torri
|
2012-12-28 15:26:05 -08:00
|
|
|
* @date 2008 (created)
|
2008-02-27 13:01:30 -08:00
|
|
|
*
|
2012-12-28 15:26:05 -08:00
|
|
|
* @section toc Table of Contents
|
|
|
|
*
|
|
|
|
* @li @ref evil_main_intro
|
|
|
|
* @li @ref evil_main_ack
|
|
|
|
* @li @ref evil_main_compiling
|
|
|
|
* @li @ref evil_main_next_steps
|
|
|
|
*
|
|
|
|
* @section evil_main_intro Introduction
|
2008-02-27 13:01:30 -08:00
|
|
|
*
|
|
|
|
* The Evil library is an evil library that ports some evil Unix
|
2011-11-12 14:31:16 -08:00
|
|
|
* functions to the Windows (XP or above, or Mobile) platform. The
|
|
|
|
* evilness is so huge that the most of the functions are not POSIX or
|
|
|
|
* BSD compliant.
|
2008-02-27 13:01:30 -08:00
|
|
|
*
|
|
|
|
* These functions are intended to be used in the Enlightenment
|
2011-12-29 23:06:40 -08:00
|
|
|
* Foundation Libraries only and can be compiled only on Windows,
|
2011-11-12 14:31:16 -08:00
|
|
|
* using MSYS/MinGW on Windows, and cross-compilation on Unix. This
|
|
|
|
* library is minimal in the sense that only the functions needed to
|
|
|
|
* compile the EFL are available. The purpose of this library is NOT
|
|
|
|
* to have a full POSIX emulation et it is NOT a replacement of
|
|
|
|
* cygwin. To compare the size of the DLL themselves, Evil is around
|
|
|
|
* 33 KB and cygwin DLL is around 800 KB.
|
2008-02-27 13:01:30 -08:00
|
|
|
*
|
2012-12-28 15:26:05 -08:00
|
|
|
* @section evil_main_ack Acknowledgments
|
2011-11-12 14:31:16 -08:00
|
|
|
*
|
|
|
|
* This library has receive some from people interested in the EFL or
|
|
|
|
* not. Among them, evil thanks to Lars Munch, Raoul Hecky, Nicolas
|
|
|
|
* Aguirre, Tor Lillqvist, Lance Fetters, Vincent Richomme, Paul
|
|
|
|
* Vixie, Daniel Stenberg, who helped the author of the library in
|
|
|
|
* different fields (code and tests).
|
|
|
|
*
|
2012-12-28 15:26:05 -08:00
|
|
|
* @section evil_main_compiling How to compile
|
|
|
|
*
|
|
|
|
* Evil is a library your application links to. The procedure for
|
|
|
|
* this is very simple. You simply have to compile your application
|
|
|
|
* with the appropriate compiler flags that the @p pkg-config script
|
|
|
|
* outputs. For example:
|
|
|
|
*
|
|
|
|
* Compiling C or C++ files into object files:
|
|
|
|
*
|
|
|
|
* @verbatim
|
|
|
|
gcc -c -o main.o main.c `pkg-config --cflags evil`
|
|
|
|
@endverbatim
|
|
|
|
*
|
|
|
|
* Linking object files into a binary executable:
|
|
|
|
*
|
|
|
|
* @verbatim
|
|
|
|
gcc -o my_application main.o `pkg-config --libs evil`
|
|
|
|
@endverbatim
|
|
|
|
*
|
|
|
|
* See @ref pkgconfig
|
|
|
|
*
|
|
|
|
* @section evil_main_next_steps Next Steps
|
2011-11-12 14:31:16 -08:00
|
|
|
*
|
2012-12-28 15:26:05 -08:00
|
|
|
* After you understood what Evil is and installed it in your system
|
|
|
|
* you should proceed understanding the programming interface.
|
2008-02-27 13:01:30 -08:00
|
|
|
*
|
2012-12-28 15:26:05 -08:00
|
|
|
* Recommended reading:
|
2010-11-06 00:10:12 -07:00
|
|
|
*
|
2012-12-28 15:26:05 -08:00
|
|
|
* @li @ref Evil_Mman
|
|
|
|
* @li @ref Evil_Unistd_Group
|
|
|
|
* @li @ref Evil_Dlfcn
|
2015-11-27 09:43:54 -08:00
|
|
|
* @li @ref Evil_Langinfo_Group
|
|
|
|
* @li @ref Evil_Locale_Group
|
2012-12-28 15:26:05 -08:00
|
|
|
* @li @ref Evil_Pwd_Group
|
|
|
|
* @li @ref Evil_Stdio_Group
|
|
|
|
* @li @ref Evil_Main_Group
|
|
|
|
* @li @ref Evil_Inet_Group
|
|
|
|
* @li @ref Evil_Dirent_Group
|
|
|
|
* @li @ref Evil_String_Group
|
|
|
|
* @li @ref Evil_Stdlib_Group
|
|
|
|
* @li @ref Evil_Time_Group
|
2008-02-27 13:01:30 -08:00
|
|
|
*/
|
|
|
|
|
2011-11-12 14:31:16 -08:00
|
|
|
/**
|
|
|
|
* @cond LOCAL
|
|
|
|
*/
|
|
|
|
|
2008-06-11 14:34:09 -07:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2011-03-03 13:12:45 -08:00
|
|
|
#ifndef WIN32_LEAN_AND_MEAN
|
|
|
|
# define WIN32_LEAN_AND_MEAN
|
|
|
|
#endif
|
2008-06-11 14:34:09 -07:00
|
|
|
#include <windows.h>
|
|
|
|
#undef WIN32_LEAN_AND_MEAN
|
|
|
|
|
2015-12-07 20:53:23 -08:00
|
|
|
#include <sys/stat.h> /* for mkdir in evil_macro_wrapper */
|
2008-02-27 13:01:30 -08:00
|
|
|
|
2008-09-14 00:07:39 -07:00
|
|
|
|
2008-06-29 05:09:48 -07:00
|
|
|
typedef unsigned long uid_t;
|
|
|
|
typedef unsigned long gid_t;
|
|
|
|
|
2008-06-11 14:34:09 -07:00
|
|
|
|
2012-02-17 12:48:11 -08:00
|
|
|
#include "evil_macro.h"
|
2015-12-28 05:22:29 -08:00
|
|
|
#include "evil_dlfcn.h"
|
2008-09-14 23:56:14 -07:00
|
|
|
#include "evil_fcntl.h"
|
|
|
|
#include "evil_langinfo.h"
|
2015-11-27 09:43:54 -08:00
|
|
|
#include "evil_locale.h"
|
2008-11-21 14:57:45 -08:00
|
|
|
#include "evil_main.h"
|
2008-09-14 23:56:14 -07:00
|
|
|
#include "evil_stdlib.h"
|
2008-10-11 07:35:26 -07:00
|
|
|
#include "evil_stdio.h"
|
|
|
|
#include "evil_string.h"
|
2010-09-14 14:24:25 -07:00
|
|
|
#include "evil_time.h"
|
2008-09-14 23:56:14 -07:00
|
|
|
#include "evil_unistd.h"
|
|
|
|
#include "evil_util.h"
|
2012-02-17 12:48:11 -08:00
|
|
|
|
2015-10-26 00:07:57 -07:00
|
|
|
#ifndef S_ISDIR
|
2009-12-19 03:52:48 -08:00
|
|
|
# define S_ISDIR(m) (((m) & _S_IFMT) == _S_IFDIR)
|
2015-10-26 00:07:57 -07:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef S_ISREG
|
2009-12-19 03:52:48 -08:00
|
|
|
# define S_ISREG(m) (((m) & _S_IFMT) == _S_IFREG)
|
2015-10-26 00:07:57 -07:00
|
|
|
#endif
|
2009-12-19 03:52:48 -08:00
|
|
|
|
2015-11-11 06:04:37 -08:00
|
|
|
#define S_ISLNK(m) 0
|
2012-03-30 02:04:26 -07:00
|
|
|
|
2015-10-26 00:07:57 -07:00
|
|
|
#define S_IRUSR _S_IRUSR
|
|
|
|
#ifndef S_IRGRP
|
2009-12-19 03:52:48 -08:00
|
|
|
# define S_IRGRP S_IRUSR
|
2015-10-26 00:07:57 -07:00
|
|
|
#endif
|
|
|
|
#ifndef S_IROTH
|
2009-12-19 03:52:48 -08:00
|
|
|
# define S_IROTH S_IRUSR
|
2015-10-26 00:07:57 -07:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#define S_IWUSR _S_IWUSR
|
|
|
|
#ifndef S_IWGRP
|
2009-12-19 03:52:48 -08:00
|
|
|
# define S_IWGRP S_IWUSR
|
2015-10-26 00:07:57 -07:00
|
|
|
#endif
|
|
|
|
#ifndef S_IWOTH
|
2009-12-19 03:52:48 -08:00
|
|
|
# define S_IWOTH S_IWUSR
|
2015-10-26 00:07:57 -07:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#define S_IXUSR _S_IXUSR
|
|
|
|
#ifndef S_IXGRP
|
2009-12-19 03:52:48 -08:00
|
|
|
# define S_IXGRP S_IXUSR
|
2015-10-26 00:07:57 -07:00
|
|
|
#endif
|
|
|
|
#ifndef S_IXOTH
|
2009-12-19 03:52:48 -08:00
|
|
|
# define S_IXOTH S_IXUSR
|
2015-10-26 00:07:57 -07:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#define _S_IRWXU (_S_IREAD | _S_IWRITE | _S_IEXEC)
|
|
|
|
#ifndef S_IRWXG
|
|
|
|
# define S_IRWXG _S_IRWXU
|
|
|
|
#endif
|
|
|
|
#ifndef S_IRWXO
|
|
|
|
# define S_IRWXO _S_IRWXU
|
|
|
|
#endif
|
2009-12-19 03:52:48 -08:00
|
|
|
|
2015-11-11 06:04:37 -08:00
|
|
|
#define _S_IXUSR _S_IEXEC
|
|
|
|
#define _S_IWUSR _S_IWRITE
|
|
|
|
#define _S_IRUSR _S_IREAD
|
2009-12-19 03:52:48 -08:00
|
|
|
|
2014-06-20 01:52:34 -07:00
|
|
|
#define sigsetjmp(Env, Save) setjmp(Env)
|
2008-06-10 00:16:53 -07:00
|
|
|
|
2015-12-07 20:53:23 -08:00
|
|
|
#include "evil_macro_wrapper.h"
|
|
|
|
#include "evil_macro_pop.h"
|
2015-04-28 07:52:57 -07:00
|
|
|
|
2008-02-27 13:01:30 -08:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2011-11-12 14:31:16 -08:00
|
|
|
/**
|
|
|
|
* @endcond
|
|
|
|
*/
|
|
|
|
|
2008-03-01 23:03:37 -08:00
|
|
|
#endif /* __EVIL_H__ */
|