forked from enlightenment/efl
* src/lib/evil_stdio.c:
Fix returned value of evil_fread_native() * doc/Doxyfile: * doc/head.html: * src/lib/Evil.h: * src/lib/dirent.h: * src/lib/dlfcn/dlfcn.h: * src/lib/evil_fcntl.h: * src/lib/evil_inet.h: * src/lib/evil_libgen.h: * src/lib/evil_stdio.h: * src/lib/evil_string.h: * src/lib/pwd.h: Update documentation SVN revision: 65105
This commit is contained in:
parent
b9ad691a14
commit
2b2b317b30
|
@ -1,3 +1,21 @@
|
|||
2011-11-12 Vincent Torri <doursse at users dot sf dot net>
|
||||
|
||||
* src/lib/evil_stdio.c:
|
||||
Fix returned value of evil_fread_native()
|
||||
|
||||
* doc/Doxyfile:
|
||||
* doc/head.html:
|
||||
* src/lib/Evil.h:
|
||||
* src/lib/dirent.h:
|
||||
* src/lib/dlfcn/dlfcn.h:
|
||||
* src/lib/evil_fcntl.h:
|
||||
* src/lib/evil_inet.h:
|
||||
* src/lib/evil_libgen.h:
|
||||
* src/lib/evil_stdio.h:
|
||||
* src/lib/evil_string.h:
|
||||
* src/lib/pwd.h:
|
||||
Update documentation
|
||||
|
||||
2011-11-02 Vincent Torri <doursse at users dot sf dot net>
|
||||
|
||||
* src/lib/evil_util.c:
|
||||
|
|
|
@ -493,7 +493,7 @@ WARN_LOGFILE =
|
|||
# directories like "/usr/src/myproject". Separate the files or directories
|
||||
# with spaces.
|
||||
|
||||
INPUT = ../src/lib ../src/lib/dlfcn
|
||||
INPUT = ../src/lib/ ../src/lib/dlfcn/
|
||||
|
||||
# This tag can be used to specify the character encoding of the source files that
|
||||
# doxygen parses. Internally doxygen uses the UTF-8 encoding, which is also the default
|
||||
|
@ -509,7 +509,7 @@ INPUT_ENCODING = UTF-8
|
|||
# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx
|
||||
# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90
|
||||
|
||||
FILE_PATTERNS =
|
||||
FILE_PATTERNS = *.h
|
||||
|
||||
# The RECURSIVE tag can be used to turn specify whether or not subdirectories
|
||||
# should be searched for input files as well. Possible values are YES and NO.
|
||||
|
@ -521,7 +521,7 @@ RECURSIVE = NO
|
|||
# excluded from the INPUT source files. This way you can easily exclude a
|
||||
# subdirectory from a directory tree whose root is specified with the INPUT tag.
|
||||
|
||||
EXCLUDE =
|
||||
EXCLUDE = ../src/lib/evil_fnmatch_private.h
|
||||
|
||||
# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
|
||||
# directories that are symbolic links (a Unix filesystem feature) are excluded
|
||||
|
@ -542,7 +542,7 @@ EXCLUDE_PATTERNS =
|
|||
# The symbol name can be a fully qualified name, a word, or if the wildcard * is used,
|
||||
# a substring. Examples: ANamespace, AClass, AClass::ANamespace, ANamespace::*Test
|
||||
|
||||
EXCLUDE_SYMBOLS =
|
||||
EXCLUDE_SYMBOLS = _WIN32 WIN32_LEAN_AND_MEAN PATH_MAX
|
||||
|
||||
# The EXAMPLE_PATH tag can be used to specify one or more files or
|
||||
# directories that contain example code fragments that are included (see
|
||||
|
|
|
@ -47,7 +47,12 @@
|
|||
<div class="submenu">
|
||||
<ul class="current">
|
||||
<li><a href="group___dlfcn.html">Dlfcn</a></li>
|
||||
<li><a href="group___evil___pwd___group.html">Pwd</a></li>
|
||||
<li><a href="group___evil___inet___group.html">Inet</a></li>
|
||||
<li><a href="group___evil___libgen___group.html">Libgen</a></li>
|
||||
<li><a href="group___evil___dirent___group.html">Dirent</a></li>
|
||||
<li><a href="group___evil___unistd___group.html">Unistd</a></li>
|
||||
<li><a href="group___evil___time___group.html">Time</a></li>
|
||||
<li><a href="group___evil___string___group.html">String</a></li>
|
||||
<li><a href="group___evil___stdio___group.html">Stdio</a></li>
|
||||
<li><a href="group___evil___stdlib___group.html">Stdlib</a></li>
|
||||
|
|
|
@ -22,19 +22,37 @@
|
|||
* @mainpage Evil
|
||||
* @image html e_big.png
|
||||
* @author Vincent Torri
|
||||
* @date 2008
|
||||
* @date 2011
|
||||
*
|
||||
* @section intro_sec Introduction
|
||||
*
|
||||
* The Evil library is an evil library that ports some evil Unix
|
||||
* functions to the Windows (XP or Mobile) platform. The evilness is
|
||||
* so huge that the most of the functions are not POSIX or BSD
|
||||
* compliant.
|
||||
* 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.
|
||||
*
|
||||
* These functions are intended to be used in the Enlightenment
|
||||
* Fundations Libraries only and can be compiled only on Windows.
|
||||
* Fundations Libraries only and can be compiled only on Windows,
|
||||
* 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.
|
||||
*
|
||||
* @section evil_sec Evil API Documentation
|
||||
* @section acknowledgments_sec Acknowledgments
|
||||
*
|
||||
* 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).
|
||||
*
|
||||
* @section license_sec license
|
||||
*
|
||||
* The Evil library is distributes under a modified BSD license. See
|
||||
* the files COPYING and COPYING-PLAIN in the top level directory for
|
||||
* the full license text.
|
||||
*
|
||||
* Take a look at the satanic documentation of the @ref Evil.
|
||||
*
|
||||
|
@ -51,6 +69,10 @@
|
|||
* the Unix versions.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @cond LOCAL
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
@ -175,4 +197,8 @@ typedef unsigned long gid_t;
|
|||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @endcond
|
||||
*/
|
||||
|
||||
#endif /* __EVIL_H__ */
|
||||
|
|
|
@ -18,20 +18,48 @@
|
|||
#endif /* _WIN32 */
|
||||
|
||||
|
||||
/**
|
||||
* @file dirent.h
|
||||
* @brief The file that provides functions ported from Unix in dirent.h.
|
||||
* @defgroup Evil_Dirent_Group Dirent.h functions
|
||||
*
|
||||
* This header provides functions ported from Unix in dirent.h.
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
|
||||
#ifdef UNICODE
|
||||
# include <wchar.h>
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @def DT_UNKNOWN
|
||||
* Specifies that the file type is unknown.
|
||||
*/
|
||||
#define DT_UNKNOWN 0
|
||||
|
||||
/**
|
||||
* @def DT_DIR
|
||||
* Specifies that the file type is a directory.
|
||||
*/
|
||||
#define DT_DIR 4
|
||||
|
||||
typedef struct DIR DIR;
|
||||
/**
|
||||
* @typedef DIR
|
||||
* @brief A structure that describes a directory stream.
|
||||
*/
|
||||
typedef struct dirent DIR;
|
||||
|
||||
/**
|
||||
* @struct dirent
|
||||
* @brief A structure that describes a directory stream.
|
||||
*/
|
||||
struct dirent
|
||||
{
|
||||
char d_name[260 + 1];
|
||||
int d_mode;
|
||||
unsigned char d_type;
|
||||
char d_name[260 + 1]; /**< The filename. */
|
||||
int d_mode; /**< The mode */
|
||||
unsigned char d_type; /**< The type */
|
||||
};
|
||||
|
||||
|
||||
|
@ -40,10 +68,62 @@ extern "C" {
|
|||
#endif /* __cplusplus */
|
||||
|
||||
|
||||
/**
|
||||
* @brief Open the given directory.
|
||||
*
|
||||
* @param name The directory to open.
|
||||
* @return A pointer to the directory stream.
|
||||
*
|
||||
* This function opens the directory @p name and return the directory
|
||||
* stream. On error or if @p dir is NULL, -1 is returned, and errno is
|
||||
* set appropriately (on Windows XP only). On success, 0 is returned.
|
||||
*
|
||||
* @see closedir()
|
||||
* @see readdir()
|
||||
*
|
||||
* Conformity: None.
|
||||
*
|
||||
* Supported OS: Windows XP, CE.
|
||||
*/
|
||||
EAPI DIR *opendir(char const *name);
|
||||
|
||||
/**
|
||||
* @brief Close the given directory.
|
||||
*
|
||||
* @param dir The directory stream to close.
|
||||
* @return A pointer to the directory stream.
|
||||
*
|
||||
* This function closes the stream directory @p dir. On error or is
|
||||
* @p path is NULL or an empty string, NULL is returned, and errno is set
|
||||
* appropriately (on Windows XP only).
|
||||
*
|
||||
* @see opendir()
|
||||
* @see readdir()
|
||||
*
|
||||
* Conformity: None.
|
||||
*
|
||||
* Supported OS: Windows XP, CE.
|
||||
*/
|
||||
EAPI int closedir(DIR *dir);
|
||||
|
||||
/**
|
||||
* @brief Read the given directory.
|
||||
*
|
||||
* @param dir The directory stream to read.
|
||||
* @return A pointer to a dirent structure, @c NULL oterhwise.
|
||||
*
|
||||
* This function returns a pointer to a dirent structure representing
|
||||
* the next directory entry in the directory stream pointed to by
|
||||
* @p dir. It returns NULL on reaching the end of the directory stream
|
||||
* or if an error occurred and errno is set appropriately (on Windows XP only).
|
||||
*
|
||||
* @see opendir()
|
||||
* @see readdir()
|
||||
*
|
||||
* Conformity: None.
|
||||
*
|
||||
* Supported OS: Windows XP, CE.
|
||||
*/
|
||||
EAPI struct dirent *readdir(DIR *dir);
|
||||
|
||||
|
||||
|
@ -52,4 +132,10 @@ EAPI struct dirent *readdir(DIR *dir);
|
|||
#endif /* __cplusplus */
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
|
||||
#endif /* __EVIL_DIRENT_H__ */
|
||||
|
|
|
@ -46,30 +46,33 @@ extern "C" {
|
|||
|
||||
/**
|
||||
* @def RTLD_LAZY
|
||||
* Lazy function call binding
|
||||
* Lazy function call binding.
|
||||
*/
|
||||
# define RTLD_LAZY 0x00001 /* lazy function call binding */
|
||||
|
||||
/**
|
||||
* @def RTLD_NOW
|
||||
* Immediate function call binding
|
||||
* Immediate function call binding.
|
||||
*/
|
||||
# define RTLD_NOW 0x00002 /* immediate function call binding */
|
||||
|
||||
/**
|
||||
* @def RTLD_GLOBAL
|
||||
* Symbols in this dlopen'ed obj are visible to other dlopen'ed objs
|
||||
* Symbols in this dlopen'ed obj are visible to other dlopen'ed objs.
|
||||
*/
|
||||
# define RTLD_GLOBAL 0x00100 /* symbols in this dlopen'ed obj are visible
|
||||
to other dlopen'ed objs */
|
||||
|
||||
/**
|
||||
* @def RTLD_NODELETE
|
||||
* Symbols are not deleted when closed.
|
||||
*/
|
||||
#define RTLD_NODELETE 0x01000 /* do not delete object when closed. */
|
||||
|
||||
/**
|
||||
* @def RTLD_DEFAULT
|
||||
* Symbols are searched in all the DLL opened by the current process
|
||||
* Symbols are searched in all the DLL opened by the current process.
|
||||
*/
|
||||
|
||||
# define RTLD_LAZY 0x00001 /* lazy function call binding */
|
||||
# define RTLD_NOW 0x00002 /* immediate function call binding */
|
||||
# define RTLD_GLOBAL 0x00100 /* symbols in this dlopen'ed obj are visible
|
||||
to other dlopen'ed objs */
|
||||
#define RTLD_NODELETE 0x01000 /* do not delete object when closed. */
|
||||
|
||||
#define RTLD_DEFAULT ((void*)1) /* search the symbol on all the DLL of the current process */
|
||||
|
||||
/**
|
||||
|
|
|
@ -66,7 +66,7 @@
|
|||
|
||||
/**
|
||||
* @struct flock
|
||||
* @brief A structure that control the lock of a file descriptor.
|
||||
* @brief A structure that controls the lock of a file descriptor.
|
||||
*/
|
||||
struct flock
|
||||
{
|
||||
|
|
|
@ -23,17 +23,120 @@
|
|||
* @brief The file that provides functions ported from Unix in arpa/inet.h.
|
||||
* @defgroup Evil_Inet_Group Inet.h functions
|
||||
*
|
||||
* This header provides functions ported from Unix in stdio.h.
|
||||
* This header provides functions ported from Unix in arpa/inet.h.
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Convert IPv4 and IPv6 addresses from text to binary form.
|
||||
*
|
||||
* @param af The address family.
|
||||
* @param src The address to convert.
|
||||
* @param dst The converted address structure.
|
||||
* @return 1 on success, 0 or -1 otherwise.
|
||||
*
|
||||
* This function converts IPv4 and IPv6 addresses from @p src to the
|
||||
* binary form @p dst. The following address families to pass to @p af
|
||||
* are currently supported:
|
||||
*
|
||||
* <ul>
|
||||
* <li>i AF_INET: @p src points to a character string containing an IPv4
|
||||
* network address in dotted-decimal format, "ddd.ddd.ddd.ddd", where
|
||||
* ddd is a decimal number of up to three digits in the range 0 to
|
||||
* 255. The address is converted to a struct in_addr and copied to
|
||||
* dst, which must be sizeof(struct in_addr) (4) bytes (32 bits) long.
|
||||
* <li> AF_INET6: @p src points to a character string containing an
|
||||
* IPv6 network address. The address is converted to a struct in6_addr
|
||||
* and copied to dst, which must be sizeof(struct in6_addr) (16) bytes
|
||||
* (128 bits) long. The allowed formats for IPv6 addresses follow
|
||||
* these rules:
|
||||
* <ol>
|
||||
* <li>The preferred format is x:x:x:x:x:x:x:x. This form consists of
|
||||
* eight hexadecimal numbers, each of which expresses a 16-bit value
|
||||
* (i.e., each x can be up to 4 hex digits).
|
||||
* <li>A series of contiguous zero values in the preferred format can
|
||||
* be abbreviated to ::. Only one instance of :: can occur in an
|
||||
* address. For example, the loopback address 0:0:0:0:0:0:0:1 can be
|
||||
* abbreviated as ::1. The wildcard address, consisting of all zeros,
|
||||
* can be written as ::.
|
||||
* <li>An alternate format is useful for expressing IPv4-mapped IPv6
|
||||
* addresses. This form is written as x:x:x:x:x:x:d.d.d.d, where the
|
||||
* six leading xs are hexadecimal values that define the six
|
||||
* most-significant 16-bit pieces of the address (i.e., 96 bits), and
|
||||
* the ds express a value in dotted-decimal notation that defines the
|
||||
* least significant 32 bits of the address. An example of such an
|
||||
* address is :: FFFF:204.152.189.116.
|
||||
* </ul>
|
||||
* </ul>
|
||||
* On success this function returns 1 (network address was successfully
|
||||
* converted). 0 is returned if @p src does not contain a character
|
||||
* string representing a valid network address in the specified
|
||||
* address family. If af does not contain a valid address family, -1
|
||||
* is returned and errno is set to EAFNOSUPPORT.
|
||||
*
|
||||
* @see evil_inet_ntop()
|
||||
* @see inet_ntop()
|
||||
*
|
||||
* Conformity: POSIX.1-2001.
|
||||
*
|
||||
* Supported OS: Windows XP, CE.
|
||||
*
|
||||
*/
|
||||
EAPI int evil_inet_pton(int af, const char *src, void *dst);
|
||||
|
||||
/**
|
||||
* @def inet_pton(x,y,z)
|
||||
*
|
||||
* Wrapper around evil_inet_pton().
|
||||
*/
|
||||
#define inet_pton(x,y,z) evil_inet_pton(x,y,z)
|
||||
|
||||
/**
|
||||
* @brief Convert IPv4 and IPv6 addresses from binary to text form.
|
||||
*
|
||||
* @param af The address family.
|
||||
* @param src The address structure to convert.
|
||||
* @param dst A buffer containing the converted string.
|
||||
* @param size The size of the buffer.
|
||||
* @return 1 on success, 0 otherwise.
|
||||
*
|
||||
* This function converts the network address structure @p src in the
|
||||
* @p af address family into a character string. The resulting string
|
||||
* is copied to the buffer pointed to by @p dst, which must be a
|
||||
* non-NULL pointer. The caller specifies the number of bytes
|
||||
* available in this buffer in the argument @p size. The following
|
||||
* address families to pass to @p af are currently supported:
|
||||
*
|
||||
* @li AF_INET: @p src points to a struct in_addr (in network byte
|
||||
* order) which is converted to an IPv4 network address in the
|
||||
* dotted-decimal format, "ddd.ddd.ddd.ddd". The buffer @p dst must be
|
||||
* at least INET_ADDRSTRLEN bytes long.
|
||||
* @li AF_INET6: @p src points to a struct in6_addr (in network byte
|
||||
* order) which is converted to a representation of this address in
|
||||
* the most appropriate IPv6 network address format for this
|
||||
* address. The buffer @p dst must be at least INET6_ADDRSTRLEN bytes
|
||||
* long.
|
||||
*
|
||||
* On success, this function returns a non-NULL pointer to @p dst. NULL is
|
||||
* returned if there was an error, with errno set to indicate the
|
||||
* error.
|
||||
*
|
||||
* @see evil_inet_pton()
|
||||
* @see inet_pton()
|
||||
*
|
||||
* Conformity: POSIX.1-2001.
|
||||
*
|
||||
* Supported OS: Windows XP, CE.
|
||||
*
|
||||
*/
|
||||
EAPI const char *evil_inet_ntop(int af, const char *src, void *dst, size_t size);
|
||||
|
||||
/**
|
||||
* @def inet_ntop(x,y,z,s)
|
||||
*
|
||||
* Wrapper around evil_inet_ntop().
|
||||
*/
|
||||
#define inet_ntop(x,y,z,s) evil_inet_ntop(x,y,z,s)
|
||||
|
||||
|
||||
|
|
|
@ -12,12 +12,71 @@
|
|||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Parse the base name component of a path.
|
||||
*
|
||||
* @param path The path to parse.
|
||||
* @return The component following the final '/'.
|
||||
*
|
||||
* This function parses @p path and returns its component following
|
||||
* the final '\'. Trailing '\' are not taken into account. On Windows
|
||||
* XP, @p path must beginning by a drive letter followed by ':/' or
|
||||
* ':\', otherwise "C:\" is returned. All characters '/' are replaced by '\'. On
|
||||
* error (memory allocation failure), "C:\" is returned, otherwise the
|
||||
* component following the final '\' is returned as a statically
|
||||
* allocated memory. Hence the returns value must not be freed.
|
||||
*
|
||||
* Concatenating the string returned by dirname(), a "\", and the
|
||||
* string returned by basename() yields a complete pathname.
|
||||
*
|
||||
* @see evil_dirname()
|
||||
* @see dirname()
|
||||
*
|
||||
* Conformity: Non applicable.
|
||||
*
|
||||
* Supported OS: Windows XP.
|
||||
*/
|
||||
EAPI char *evil_basename(char *path);
|
||||
|
||||
/**
|
||||
* @def basename(p)
|
||||
*
|
||||
* Wrapper around evil_basename().
|
||||
*/
|
||||
#define basename(p) evil_basename(p)
|
||||
|
||||
/**
|
||||
* @brief Parse the dir name component of a path.
|
||||
*
|
||||
* @param path The path to parse.
|
||||
* @return The component up to, but not including, the final '/'.
|
||||
*
|
||||
* This function parses @p path and returns its component up to, but
|
||||
* not including, the final '/'. Trailing '\' are not taken into
|
||||
* account. On Windows XP, @p path must beginning by a drive letter
|
||||
* followed by ':/' or ':\', otherwise "C:\" is returned. All
|
||||
* characters '/' are replaced by '\'. On error (memory allocation
|
||||
* failure), "C:\" is returned, otherwise, the component up to, but
|
||||
* not including, the final '/' is returned as a statically allocated
|
||||
* memory. Hence the returns value must not be freed.
|
||||
*
|
||||
* Concatenating the string returned by dirname(), a "\", and the
|
||||
* string returned by basename() yields a complete pathname.
|
||||
*
|
||||
* @see evil_basename()
|
||||
* @see basename()
|
||||
*
|
||||
* Conformity: Non applicable.
|
||||
*
|
||||
* Supported OS: Windows XP.
|
||||
*/
|
||||
EAPI char *evil_dirname(char *path);
|
||||
|
||||
/**
|
||||
* @def dirname(p)
|
||||
*
|
||||
* Wrapper around evil_dirname().
|
||||
*/
|
||||
#define dirname(p) evil_dirname(p)
|
||||
|
||||
|
||||
|
|
|
@ -198,7 +198,7 @@ size_t evil_fread_native(void* buffer, size_t size, size_t count, FILE* stream)
|
|||
return 0;
|
||||
}
|
||||
|
||||
return (bytes_read != size * count) ? 0 : 1;
|
||||
return (bytes_read != size * count) ? 0 : bytes_read;
|
||||
}
|
||||
|
||||
int evil_fclose_native(FILE *stream)
|
||||
|
|
|
@ -20,8 +20,24 @@
|
|||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Print the given string to stderr.
|
||||
*
|
||||
* @param s The string to print.
|
||||
*
|
||||
* This function just printf the string @p s to stderr.
|
||||
*
|
||||
* Conformity: None.
|
||||
*
|
||||
* Supported OS: Windows CE.
|
||||
*/
|
||||
EAPI void evil_perror (const char *s);
|
||||
|
||||
/**
|
||||
* @def perror(s)
|
||||
*
|
||||
* Wrapper around evil_perror().
|
||||
*/
|
||||
# define perror(s) evil_perror(s)
|
||||
|
||||
/*
|
||||
|
@ -29,16 +45,78 @@ EAPI void evil_perror (const char *s);
|
|||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Emulate the fopen() function on Windows CE.
|
||||
*
|
||||
* @param path The file to open.
|
||||
* @param mode The mode.
|
||||
* @return A FILE pointer on success, @c NULL otherwise.
|
||||
*
|
||||
* This function emulates the fopen() function on Windows CE using the
|
||||
* Windows libc. The main problem is that the filesytem on Windows CE
|
||||
* is like on Sys V : the top level directory is beginning by '/' or
|
||||
* '\' and the full path must be calculated.. This function takes care
|
||||
* of this feature, and replace all the '/' by '/'. Otherwise, it
|
||||
* calls the Windows CE fopen() function once the filename has been
|
||||
* correctly set. If @p path is @c NULL or empty, this function
|
||||
* returns @c NULL. On success, this function returns a FILE stream,
|
||||
* @c NULL otherwise.
|
||||
*
|
||||
* Conformity: None.
|
||||
*
|
||||
* Supported OS: Windows CE.
|
||||
*/
|
||||
EAPI FILE *evil_fopen(const char *path, const char *mode);
|
||||
|
||||
/**
|
||||
* @def fopen(path, mode)
|
||||
*
|
||||
* Wrapper around evil_fopen().
|
||||
*/
|
||||
# define fopen(path, mode) evil_fopen(path, mode)
|
||||
|
||||
/**
|
||||
* @brief Emulate the rewind() function on Windows CE.
|
||||
*
|
||||
* @param stream The FILE stream.
|
||||
*
|
||||
* This function emulates the rewind() function on Windows CE by just
|
||||
* calling fseek().
|
||||
*
|
||||
* Conformity: None.
|
||||
*
|
||||
* Supported OS: Windows CE.
|
||||
*/
|
||||
EAPI void evil_rewind(FILE *stream);
|
||||
|
||||
/**
|
||||
* @def rewind(f)
|
||||
*
|
||||
* Wrapper around evil_rewind().
|
||||
*/
|
||||
# define rewind(f) evil_rewind(f)
|
||||
|
||||
/**
|
||||
* @brief Emulate the remove() function on Windows CE.
|
||||
*
|
||||
* @param path The path to remove.
|
||||
* @return 0 on success, -1 otherwise.
|
||||
*
|
||||
* This function emulates the remove() function on Windows CE. If
|
||||
* @p path is an empty directory, it removes it. If @p path is a file,
|
||||
* it deletes it. On success, 0 is returns, -1 otherwise.
|
||||
*
|
||||
* Conformity: None.
|
||||
*
|
||||
* Supported OS: Windows CE.
|
||||
*/
|
||||
EAPI int evil_remove(const char *path);
|
||||
|
||||
/**
|
||||
* @def remove(p)
|
||||
*
|
||||
* Wrapper around evil_remove().
|
||||
*/
|
||||
# define remove(p) evil_remove(p)
|
||||
|
||||
#endif /* _WIN32_WCE */
|
||||
|
@ -46,10 +124,65 @@ EAPI int evil_remove(const char *path);
|
|||
|
||||
#ifdef _WIN32_WCE
|
||||
|
||||
/**
|
||||
* @brief Emulate the fopen() function on Windows CE using Windows API.
|
||||
*
|
||||
* @param path The file to open.
|
||||
* @param mode The mode.
|
||||
* @return A FILE pointer on success, @c NULL otherwise.
|
||||
*
|
||||
* This function emulates the fopen() function on Windows CE using the
|
||||
* Windows API and not the libc. It is similar to evil_fopen().
|
||||
*
|
||||
* @see evil_fopen()
|
||||
* @see evil_fread_native()
|
||||
* @see evil_fclose_native()
|
||||
*
|
||||
* Conformity: None.
|
||||
*
|
||||
* Supported OS: Windows CE.
|
||||
*/
|
||||
EAPI FILE *evil_fopen_native(const char *path, const char *mode);
|
||||
|
||||
/**
|
||||
* @brief Read the given stream on Windows CE using Windows API.
|
||||
*
|
||||
* @param buffer The buffer to store the data.
|
||||
* @param size The size of each element of data to read.
|
||||
* @param count The number of elements of data to read.
|
||||
* @param stream The stream to read.
|
||||
* @return The size read on success, 0 otherwise.
|
||||
*
|
||||
* This function read @p stream using the Windows API. It reads
|
||||
* @p size elements of data, each @ size bytes long. The data is
|
||||
* stored in the buffer @p buffer. On success, the size read is
|
||||
* returned, 0 otherwise.
|
||||
*
|
||||
* @see evil_fopen_native()
|
||||
* @see evil_fclose_native()
|
||||
*
|
||||
* Conformity: None.
|
||||
*
|
||||
* Supported OS: Windows CE.
|
||||
*/
|
||||
EAPI size_t evil_fread_native(void* buffer, size_t size, size_t count, FILE* stream);
|
||||
|
||||
/**
|
||||
* @brief Close the given stream on Windows CE using Windows API.
|
||||
*
|
||||
* @param stream The stream to close.
|
||||
* @return 0 on success, -1 otherwise.
|
||||
*
|
||||
* This function closes @p stream using the Windows API. On success, 0
|
||||
* is returned, -1 otherwise.
|
||||
*
|
||||
* @see evil_fopen_native()
|
||||
* @see evil_fread_native()
|
||||
*
|
||||
* Conformity: None.
|
||||
*
|
||||
* Supported OS: Windows CE.
|
||||
*/
|
||||
EAPI int evil_fclose_native(FILE *stream);
|
||||
|
||||
#endif /* _WIN32_WCE */
|
||||
|
|
|
@ -87,7 +87,7 @@ EAPI int strcoll (const char *s1, const char *s2);
|
|||
#endif /* _WIN32_WCE */
|
||||
|
||||
/**
|
||||
* @brief get the last substring occurence.
|
||||
* @brief Get the last substring occurence.
|
||||
*
|
||||
* @param str The string to search from.
|
||||
* @param substr The substring to search.
|
||||
|
@ -105,6 +105,22 @@ EAPI char *strrstr (const char *str, const char *substr);
|
|||
|
||||
#ifdef _MSC_VER
|
||||
|
||||
/**
|
||||
* @brief Compare two string, ignoring case.
|
||||
*
|
||||
* @param s1 The first string to compare.
|
||||
* @param s2 The first string to compare.
|
||||
* @return
|
||||
*
|
||||
* This function compares the two strings @p s1 and @p s2, ignoring
|
||||
* the case of the characters. It returns an integer less than, equal
|
||||
* to, or greater than zero if s1 is found, respectively, to be less
|
||||
* than, to match, or be greater than s2.
|
||||
*
|
||||
* Conformity: Non applicable.
|
||||
*
|
||||
* Supported OS: Windows XP (vc++ only)
|
||||
*/
|
||||
EAPI int strcasecmp(const char *s1, const char *s2);
|
||||
|
||||
#endif /* _MSC_VER */
|
||||
|
|
|
@ -2,6 +2,17 @@
|
|||
#define __EVIL_PWD_H__
|
||||
|
||||
|
||||
/**
|
||||
* @file pwd.h
|
||||
* @brief The file that provides functions ported from Unix in pwd.h.
|
||||
* @defgroup Evil_Pwd_Group Pwd.h functions
|
||||
*
|
||||
* This header provides functions ported from Unix in dirent.h.
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
|
||||
#include <time.h>
|
||||
|
||||
#include <Evil.h>
|
||||
|
@ -12,20 +23,37 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* @struct passwd
|
||||
* @brief A structure that describes a password.
|
||||
*/
|
||||
struct passwd {
|
||||
char *pw_name; /* user name */
|
||||
char *pw_passwd; /* encrypted password */
|
||||
uid_t pw_uid; /* user uid */
|
||||
gid_t pw_gid; /* user gid */
|
||||
time_t pw_change; /* password change time */
|
||||
char *pw_class; /* user access class */
|
||||
char *pw_gecos; /* Honeywell login info */
|
||||
char *pw_dir; /* home directory */
|
||||
char *pw_shell; /* default shell */
|
||||
time_t pw_expire; /* account expiration */
|
||||
int pw_fields; /* internal: fields filled in */
|
||||
char *pw_name; /**< user name */
|
||||
char *pw_passwd; /**< encrypted password (always @c NULL) */
|
||||
uid_t pw_uid; /**< user uid */
|
||||
gid_t pw_gid; /**< user gid (always O) */
|
||||
time_t pw_change; /**< password change time (always 0) */
|
||||
char *pw_class; /**< user access class (always @c NULL) */
|
||||
char *pw_gecos; /**< Honeywell login info */
|
||||
char *pw_dir; /**< home directory */
|
||||
char *pw_shell; /**< default shell */
|
||||
time_t pw_expire; /**< account expiration (always O) */
|
||||
int pw_fields; /**< internal: fields filled in (always O) */
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Return a passwd structure.
|
||||
*
|
||||
* @param uid The User ID
|
||||
* @return A stacally allocated passwd structure.
|
||||
*
|
||||
* This function fills a static buffer @ref passwd with @p uid and the
|
||||
* user name.
|
||||
*
|
||||
* Conformity: None.
|
||||
*
|
||||
* Supported OS: Windows XP, CE.
|
||||
*/
|
||||
EAPI struct passwd *getpwuid (uid_t uid);
|
||||
|
||||
|
||||
|
@ -34,4 +62,10 @@ EAPI struct passwd * getpwuid (uid_t uid);
|
|||
#endif
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
|
||||
#endif /* __EVIL_PWD_H__ */
|
||||
|
|
Loading…
Reference in New Issue