diff options
author | Vincent Torri <vincent.torri@gmail.com> | 2011-11-12 22:31:16 +0000 |
---|---|---|
committer | Vincent Torri <vincent.torri@gmail.com> | 2011-11-12 22:31:16 +0000 |
commit | 2b2b317b3054528a6735433a0bc387605db6d037 (patch) | |
tree | 99f4a96bfc9e7dd618ffb96a3ca65fb10262ec9f /legacy/evil | |
parent | b9ad691a14e5a04c722642dc8db1eb584c36b0ce (diff) |
* 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
Diffstat (limited to 'legacy/evil')
-rw-r--r-- | legacy/evil/ChangeLog | 18 | ||||
-rw-r--r-- | legacy/evil/doc/Doxyfile | 8 | ||||
-rw-r--r-- | legacy/evil/doc/head.html | 9 | ||||
-rw-r--r-- | legacy/evil/src/lib/Evil.h | 38 | ||||
-rw-r--r-- | legacy/evil/src/lib/dirent.h | 94 | ||||
-rw-r--r-- | legacy/evil/src/lib/dlfcn/dlfcn.h | 23 | ||||
-rw-r--r-- | legacy/evil/src/lib/evil_fcntl.h | 2 | ||||
-rw-r--r-- | legacy/evil/src/lib/evil_inet.h | 105 | ||||
-rw-r--r-- | legacy/evil/src/lib/evil_libgen.h | 59 | ||||
-rw-r--r-- | legacy/evil/src/lib/evil_stdio.c | 2 | ||||
-rw-r--r-- | legacy/evil/src/lib/evil_stdio.h | 133 | ||||
-rw-r--r-- | legacy/evil/src/lib/evil_string.h | 18 | ||||
-rw-r--r-- | legacy/evil/src/lib/pwd.h | 58 |
13 files changed, 525 insertions, 42 deletions
diff --git a/legacy/evil/ChangeLog b/legacy/evil/ChangeLog index 07c2a8cc4a..3acedcdd24 100644 --- a/legacy/evil/ChangeLog +++ b/legacy/evil/ChangeLog | |||
@@ -1,3 +1,21 @@ | |||
1 | 2011-11-12 Vincent Torri <doursse at users dot sf dot net> | ||
2 | |||
3 | * src/lib/evil_stdio.c: | ||
4 | Fix returned value of evil_fread_native() | ||
5 | |||
6 | * doc/Doxyfile: | ||
7 | * doc/head.html: | ||
8 | * src/lib/Evil.h: | ||
9 | * src/lib/dirent.h: | ||
10 | * src/lib/dlfcn/dlfcn.h: | ||
11 | * src/lib/evil_fcntl.h: | ||
12 | * src/lib/evil_inet.h: | ||
13 | * src/lib/evil_libgen.h: | ||
14 | * src/lib/evil_stdio.h: | ||
15 | * src/lib/evil_string.h: | ||
16 | * src/lib/pwd.h: | ||
17 | Update documentation | ||
18 | |||
1 | 2011-11-02 Vincent Torri <doursse at users dot sf dot net> | 19 | 2011-11-02 Vincent Torri <doursse at users dot sf dot net> |
2 | 20 | ||
3 | * src/lib/evil_util.c: | 21 | * src/lib/evil_util.c: |
diff --git a/legacy/evil/doc/Doxyfile b/legacy/evil/doc/Doxyfile index c6c7b05e1f..3f800f84e0 100644 --- a/legacy/evil/doc/Doxyfile +++ b/legacy/evil/doc/Doxyfile | |||
@@ -493,7 +493,7 @@ WARN_LOGFILE = | |||
493 | # directories like "/usr/src/myproject". Separate the files or directories | 493 | # directories like "/usr/src/myproject". Separate the files or directories |
494 | # with spaces. | 494 | # with spaces. |
495 | 495 | ||
496 | INPUT = ../src/lib ../src/lib/dlfcn | 496 | INPUT = ../src/lib/ ../src/lib/dlfcn/ |
497 | 497 | ||
498 | # This tag can be used to specify the character encoding of the source files that | 498 | # This tag can be used to specify the character encoding of the source files that |
499 | # doxygen parses. Internally doxygen uses the UTF-8 encoding, which is also the default | 499 | # doxygen parses. Internally doxygen uses the UTF-8 encoding, which is also the default |
@@ -509,7 +509,7 @@ INPUT_ENCODING = UTF-8 | |||
509 | # *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx | 509 | # *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx |
510 | # *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90 | 510 | # *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90 |
511 | 511 | ||
512 | FILE_PATTERNS = | 512 | FILE_PATTERNS = *.h |
513 | 513 | ||
514 | # The RECURSIVE tag can be used to turn specify whether or not subdirectories | 514 | # The RECURSIVE tag can be used to turn specify whether or not subdirectories |
515 | # should be searched for input files as well. Possible values are YES and NO. | 515 | # should be searched for input files as well. Possible values are YES and NO. |
@@ -521,7 +521,7 @@ RECURSIVE = NO | |||
521 | # excluded from the INPUT source files. This way you can easily exclude a | 521 | # excluded from the INPUT source files. This way you can easily exclude a |
522 | # subdirectory from a directory tree whose root is specified with the INPUT tag. | 522 | # subdirectory from a directory tree whose root is specified with the INPUT tag. |
523 | 523 | ||
524 | EXCLUDE = | 524 | EXCLUDE = ../src/lib/evil_fnmatch_private.h |
525 | 525 | ||
526 | # The EXCLUDE_SYMLINKS tag can be used select whether or not files or | 526 | # The EXCLUDE_SYMLINKS tag can be used select whether or not files or |
527 | # directories that are symbolic links (a Unix filesystem feature) are excluded | 527 | # directories that are symbolic links (a Unix filesystem feature) are excluded |
@@ -542,7 +542,7 @@ EXCLUDE_PATTERNS = | |||
542 | # The symbol name can be a fully qualified name, a word, or if the wildcard * is used, | 542 | # The symbol name can be a fully qualified name, a word, or if the wildcard * is used, |
543 | # a substring. Examples: ANamespace, AClass, AClass::ANamespace, ANamespace::*Test | 543 | # a substring. Examples: ANamespace, AClass, AClass::ANamespace, ANamespace::*Test |
544 | 544 | ||
545 | EXCLUDE_SYMBOLS = | 545 | EXCLUDE_SYMBOLS = _WIN32 WIN32_LEAN_AND_MEAN PATH_MAX |
546 | 546 | ||
547 | # The EXAMPLE_PATH tag can be used to specify one or more files or | 547 | # The EXAMPLE_PATH tag can be used to specify one or more files or |
548 | # directories that contain example code fragments that are included (see | 548 | # directories that contain example code fragments that are included (see |
diff --git a/legacy/evil/doc/head.html b/legacy/evil/doc/head.html index 8a225a013d..cd72203687 100644 --- a/legacy/evil/doc/head.html +++ b/legacy/evil/doc/head.html | |||
@@ -3,7 +3,7 @@ | |||
3 | <title>$title</title> | 3 | <title>$title</title> |
4 | <meta http-equiv="content-type" content="text/html;charset=UTF-8"> | 4 | <meta http-equiv="content-type" content="text/html;charset=UTF-8"> |
5 | <meta name="author" content="Andres Blanc" > | 5 | <meta name="author" content="Andres Blanc" > |
6 | 6 | ||
7 | <link rel="icon" href="img/favicon.png" type="image/x-icon"> | 7 | <link rel="icon" href="img/favicon.png" type="image/x-icon"> |
8 | <link rel="shortcut icon" href="img/favicon.png" type="image/x-icon"> | 8 | <link rel="shortcut icon" href="img/favicon.png" type="image/x-icon"> |
9 | <link rel="icon" href="img/favicon.png" type="image/ico"> | 9 | <link rel="icon" href="img/favicon.png" type="image/ico"> |
@@ -19,7 +19,7 @@ | |||
19 | 19 | ||
20 | <div id="header"> | 20 | <div id="header"> |
21 | <div class="layout"> | 21 | <div class="layout"> |
22 | 22 | ||
23 | <h1><span>Enlightenment</span></h1> | 23 | <h1><span>Enlightenment</span></h1> |
24 | <h2><span>Beauty at your fingertips</span></h2> | 24 | <h2><span>Beauty at your fingertips</span></h2> |
25 | 25 | ||
@@ -47,7 +47,12 @@ | |||
47 | <div class="submenu"> | 47 | <div class="submenu"> |
48 | <ul class="current"> | 48 | <ul class="current"> |
49 | <li><a href="group___dlfcn.html">Dlfcn</a></li> | 49 | <li><a href="group___dlfcn.html">Dlfcn</a></li> |
50 | <li><a href="group___evil___pwd___group.html">Pwd</a></li> | ||
51 | <li><a href="group___evil___inet___group.html">Inet</a></li> | ||
52 | <li><a href="group___evil___libgen___group.html">Libgen</a></li> | ||
53 | <li><a href="group___evil___dirent___group.html">Dirent</a></li> | ||
50 | <li><a href="group___evil___unistd___group.html">Unistd</a></li> | 54 | <li><a href="group___evil___unistd___group.html">Unistd</a></li> |
55 | <li><a href="group___evil___time___group.html">Time</a></li> | ||
51 | <li><a href="group___evil___string___group.html">String</a></li> | 56 | <li><a href="group___evil___string___group.html">String</a></li> |
52 | <li><a href="group___evil___stdio___group.html">Stdio</a></li> | 57 | <li><a href="group___evil___stdio___group.html">Stdio</a></li> |
53 | <li><a href="group___evil___stdlib___group.html">Stdlib</a></li> | 58 | <li><a href="group___evil___stdlib___group.html">Stdlib</a></li> |
diff --git a/legacy/evil/src/lib/Evil.h b/legacy/evil/src/lib/Evil.h index b157052441..ceb8d90270 100644 --- a/legacy/evil/src/lib/Evil.h +++ b/legacy/evil/src/lib/Evil.h | |||
@@ -22,19 +22,37 @@ | |||
22 | * @mainpage Evil | 22 | * @mainpage Evil |
23 | * @image html e_big.png | 23 | * @image html e_big.png |
24 | * @author Vincent Torri | 24 | * @author Vincent Torri |
25 | * @date 2008 | 25 | * @date 2011 |
26 | * | 26 | * |
27 | * @section intro_sec Introduction | 27 | * @section intro_sec Introduction |
28 | * | 28 | * |
29 | * The Evil library is an evil library that ports some evil Unix | 29 | * The Evil library is an evil library that ports some evil Unix |
30 | * functions to the Windows (XP or Mobile) platform. The evilness is | 30 | * functions to the Windows (XP or above, or Mobile) platform. The |
31 | * so huge that the most of the functions are not POSIX or BSD | 31 | * evilness is so huge that the most of the functions are not POSIX or |
32 | * compliant. | 32 | * BSD compliant. |
33 | * | 33 | * |
34 | * These functions are intended to be used in the Enlightenment | 34 | * These functions are intended to be used in the Enlightenment |
35 | * Fundations Libraries only and can be compiled only on Windows. | 35 | * Fundations Libraries only and can be compiled only on Windows, |
36 | * using MSYS/MinGW on Windows, and cross-compilation on Unix. This | ||
37 | * library is minimal in the sense that only the functions needed to | ||
38 | * compile the EFL are available. The purpose of this library is NOT | ||
39 | * to have a full POSIX emulation et it is NOT a replacement of | ||
40 | * cygwin. To compare the size of the DLL themselves, Evil is around | ||
41 | * 33 KB and cygwin DLL is around 800 KB. | ||
36 | * | 42 | * |
37 | * @section evil_sec Evil API Documentation | 43 | * @section acknowledgments_sec Acknowledgments |
44 | * | ||
45 | * This library has receive some from people interested in the EFL or | ||
46 | * not. Among them, evil thanks to Lars Munch, Raoul Hecky, Nicolas | ||
47 | * Aguirre, Tor Lillqvist, Lance Fetters, Vincent Richomme, Paul | ||
48 | * Vixie, Daniel Stenberg, who helped the author of the library in | ||
49 | * different fields (code and tests). | ||
50 | * | ||
51 | * @section license_sec license | ||
52 | * | ||
53 | * The Evil library is distributes under a modified BSD license. See | ||
54 | * the files COPYING and COPYING-PLAIN in the top level directory for | ||
55 | * the full license text. | ||
38 | * | 56 | * |
39 | * Take a look at the satanic documentation of the @ref Evil. | 57 | * Take a look at the satanic documentation of the @ref Evil. |
40 | * | 58 | * |
@@ -51,6 +69,10 @@ | |||
51 | * the Unix versions. | 69 | * the Unix versions. |
52 | */ | 70 | */ |
53 | 71 | ||
72 | /** | ||
73 | * @cond LOCAL | ||
74 | */ | ||
75 | |||
54 | #ifdef __cplusplus | 76 | #ifdef __cplusplus |
55 | extern "C" { | 77 | extern "C" { |
56 | #endif | 78 | #endif |
@@ -175,4 +197,8 @@ typedef unsigned long gid_t; | |||
175 | } | 197 | } |
176 | #endif | 198 | #endif |
177 | 199 | ||
200 | /** | ||
201 | * @endcond | ||
202 | */ | ||
203 | |||
178 | #endif /* __EVIL_H__ */ | 204 | #endif /* __EVIL_H__ */ |
diff --git a/legacy/evil/src/lib/dirent.h b/legacy/evil/src/lib/dirent.h index ac6d4faeb5..ee2710ce34 100644 --- a/legacy/evil/src/lib/dirent.h +++ b/legacy/evil/src/lib/dirent.h | |||
@@ -18,20 +18,48 @@ | |||
18 | #endif /* _WIN32 */ | 18 | #endif /* _WIN32 */ |
19 | 19 | ||
20 | 20 | ||
21 | /** | ||
22 | * @file dirent.h | ||
23 | * @brief The file that provides functions ported from Unix in dirent.h. | ||
24 | * @defgroup Evil_Dirent_Group Dirent.h functions | ||
25 | * | ||
26 | * This header provides functions ported from Unix in dirent.h. | ||
27 | * | ||
28 | * @{ | ||
29 | */ | ||
30 | |||
31 | |||
21 | #ifdef UNICODE | 32 | #ifdef UNICODE |
22 | # include <wchar.h> | 33 | # include <wchar.h> |
23 | #endif | 34 | #endif |
24 | 35 | ||
36 | /** | ||
37 | * @def DT_UNKNOWN | ||
38 | * Specifies that the file type is unknown. | ||
39 | */ | ||
25 | #define DT_UNKNOWN 0 | 40 | #define DT_UNKNOWN 0 |
41 | |||
42 | /** | ||
43 | * @def DT_DIR | ||
44 | * Specifies that the file type is a directory. | ||
45 | */ | ||
26 | #define DT_DIR 4 | 46 | #define DT_DIR 4 |
27 | 47 | ||
28 | typedef struct DIR DIR; | 48 | /** |
49 | * @typedef DIR | ||
50 | * @brief A structure that describes a directory stream. | ||
51 | */ | ||
52 | typedef struct dirent DIR; | ||
29 | 53 | ||
54 | /** | ||
55 | * @struct dirent | ||
56 | * @brief A structure that describes a directory stream. | ||
57 | */ | ||
30 | struct dirent | 58 | struct dirent |
31 | { | 59 | { |
32 | char d_name[260 + 1]; | 60 | char d_name[260 + 1]; /**< The filename. */ |
33 | int d_mode; | 61 | int d_mode; /**< The mode */ |
34 | unsigned char d_type; | 62 | unsigned char d_type; /**< The type */ |
35 | }; | 63 | }; |
36 | 64 | ||
37 | 65 | ||
@@ -40,10 +68,62 @@ extern "C" { | |||
40 | #endif /* __cplusplus */ | 68 | #endif /* __cplusplus */ |
41 | 69 | ||
42 | 70 | ||
71 | /** | ||
72 | * @brief Open the given directory. | ||
73 | * | ||
74 | * @param name The directory to open. | ||
75 | * @return A pointer to the directory stream. | ||
76 | * | ||
77 | * This function opens the directory @p name and return the directory | ||
78 | * stream. On error or if @p dir is NULL, -1 is returned, and errno is | ||
79 | * set appropriately (on Windows XP only). On success, 0 is returned. | ||
80 | * | ||
81 | * @see closedir() | ||
82 | * @see readdir() | ||
83 | * | ||
84 | * Conformity: None. | ||
85 | * | ||
86 | * Supported OS: Windows XP, CE. | ||
87 | */ | ||
43 | EAPI DIR *opendir(char const *name); | 88 | EAPI DIR *opendir(char const *name); |
44 | 89 | ||
90 | /** | ||
91 | * @brief Close the given directory. | ||
92 | * | ||
93 | * @param dir The directory stream to close. | ||
94 | * @return A pointer to the directory stream. | ||
95 | * | ||
96 | * This function closes the stream directory @p dir. On error or is | ||
97 | * @p path is NULL or an empty string, NULL is returned, and errno is set | ||
98 | * appropriately (on Windows XP only). | ||
99 | * | ||
100 | * @see opendir() | ||
101 | * @see readdir() | ||
102 | * | ||
103 | * Conformity: None. | ||
104 | * | ||
105 | * Supported OS: Windows XP, CE. | ||
106 | */ | ||
45 | EAPI int closedir(DIR *dir); | 107 | EAPI int closedir(DIR *dir); |
46 | 108 | ||
109 | /** | ||
110 | * @brief Read the given directory. | ||
111 | * | ||
112 | * @param dir The directory stream to read. | ||
113 | * @return A pointer to a dirent structure, @c NULL oterhwise. | ||
114 | * | ||
115 | * This function returns a pointer to a dirent structure representing | ||
116 | * the next directory entry in the directory stream pointed to by | ||
117 | * @p dir. It returns NULL on reaching the end of the directory stream | ||
118 | * or if an error occurred and errno is set appropriately (on Windows XP only). | ||
119 | * | ||
120 | * @see opendir() | ||
121 | * @see readdir() | ||
122 | * | ||
123 | * Conformity: None. | ||
124 | * | ||
125 | * Supported OS: Windows XP, CE. | ||
126 | */ | ||
47 | EAPI struct dirent *readdir(DIR *dir); | 127 | EAPI struct dirent *readdir(DIR *dir); |
48 | 128 | ||
49 | 129 | ||
@@ -52,4 +132,10 @@ EAPI struct dirent *readdir(DIR *dir); | |||
52 | #endif /* __cplusplus */ | 132 | #endif /* __cplusplus */ |
53 | 133 | ||
54 | 134 | ||
135 | |||
136 | /** | ||
137 | * @} | ||
138 | */ | ||
139 | |||
140 | |||
55 | #endif /* __EVIL_DIRENT_H__ */ | 141 | #endif /* __EVIL_DIRENT_H__ */ |
diff --git a/legacy/evil/src/lib/dlfcn/dlfcn.h b/legacy/evil/src/lib/dlfcn/dlfcn.h index 655dade6ad..1035548aea 100644 --- a/legacy/evil/src/lib/dlfcn/dlfcn.h +++ b/legacy/evil/src/lib/dlfcn/dlfcn.h | |||
@@ -46,30 +46,33 @@ extern "C" { | |||
46 | 46 | ||
47 | /** | 47 | /** |
48 | * @def RTLD_LAZY | 48 | * @def RTLD_LAZY |
49 | * Lazy function call binding | 49 | * Lazy function call binding. |
50 | */ | 50 | */ |
51 | # define RTLD_LAZY 0x00001 /* lazy function call binding */ | ||
51 | 52 | ||
52 | /** | 53 | /** |
53 | * @def RTLD_NOW | 54 | * @def RTLD_NOW |
54 | * Immediate function call binding | 55 | * Immediate function call binding. |
55 | */ | 56 | */ |
57 | # define RTLD_NOW 0x00002 /* immediate function call binding */ | ||
56 | 58 | ||
57 | /** | 59 | /** |
58 | * @def RTLD_GLOBAL | 60 | * @def RTLD_GLOBAL |
59 | * Symbols in this dlopen'ed obj are visible to other dlopen'ed objs | 61 | * Symbols in this dlopen'ed obj are visible to other dlopen'ed objs. |
60 | */ | 62 | */ |
63 | # define RTLD_GLOBAL 0x00100 /* symbols in this dlopen'ed obj are visible | ||
64 | to other dlopen'ed objs */ | ||
61 | 65 | ||
62 | /** | 66 | /** |
63 | * @def RTLD_DEFAULT | 67 | * @def RTLD_NODELETE |
64 | * Symbols are searched in all the DLL opened by the current process | 68 | * Symbols are not deleted when closed. |
65 | */ | 69 | */ |
66 | |||
67 | # define RTLD_LAZY 0x00001 /* lazy function call binding */ | ||
68 | # define RTLD_NOW 0x00002 /* immediate function call binding */ | ||
69 | # define RTLD_GLOBAL 0x00100 /* symbols in this dlopen'ed obj are visible | ||
70 | to other dlopen'ed objs */ | ||
71 | #define RTLD_NODELETE 0x01000 /* do not delete object when closed. */ | 70 | #define RTLD_NODELETE 0x01000 /* do not delete object when closed. */ |
72 | 71 | ||
72 | /** | ||
73 | * @def RTLD_DEFAULT | ||
74 | * Symbols are searched in all the DLL opened by the current process. | ||
75 | */ | ||
73 | #define RTLD_DEFAULT ((void*)1) /* search the symbol on all the DLL of the current process */ | 76 | #define RTLD_DEFAULT ((void*)1) /* search the symbol on all the DLL of the current process */ |
74 | 77 | ||
75 | /** | 78 | /** |
diff --git a/legacy/evil/src/lib/evil_fcntl.h b/legacy/evil/src/lib/evil_fcntl.h index dbe9a0c206..194341b369 100644 --- a/legacy/evil/src/lib/evil_fcntl.h +++ b/legacy/evil/src/lib/evil_fcntl.h | |||
@@ -66,7 +66,7 @@ | |||
66 | 66 | ||
67 | /** | 67 | /** |
68 | * @struct flock | 68 | * @struct flock |
69 | * @brief A structure that control the lock of a file descriptor. | 69 | * @brief A structure that controls the lock of a file descriptor. |
70 | */ | 70 | */ |
71 | struct flock | 71 | struct flock |
72 | { | 72 | { |
diff --git a/legacy/evil/src/lib/evil_inet.h b/legacy/evil/src/lib/evil_inet.h index e80a884c11..b81b8ff715 100644 --- a/legacy/evil/src/lib/evil_inet.h +++ b/legacy/evil/src/lib/evil_inet.h | |||
@@ -23,17 +23,120 @@ | |||
23 | * @brief The file that provides functions ported from Unix in arpa/inet.h. | 23 | * @brief The file that provides functions ported from Unix in arpa/inet.h. |
24 | * @defgroup Evil_Inet_Group Inet.h functions | 24 | * @defgroup Evil_Inet_Group Inet.h functions |
25 | * | 25 | * |
26 | * This header provides functions ported from Unix in stdio.h. | 26 | * This header provides functions ported from Unix in arpa/inet.h. |
27 | * | 27 | * |
28 | * @{ | 28 | * @{ |
29 | */ | 29 | */ |
30 | 30 | ||
31 | /** | ||
32 | * @brief Convert IPv4 and IPv6 addresses from text to binary form. | ||
33 | * | ||
34 | * @param af The address family. | ||
35 | * @param src The address to convert. | ||
36 | * @param dst The converted address structure. | ||
37 | * @return 1 on success, 0 or -1 otherwise. | ||
38 | * | ||
39 | * This function converts IPv4 and IPv6 addresses from @p src to the | ||
40 | * binary form @p dst. The following address families to pass to @p af | ||
41 | * are currently supported: | ||
42 | * | ||
43 | * <ul> | ||
44 | * <li>i AF_INET: @p src points to a character string containing an IPv4 | ||
45 | * network address in dotted-decimal format, "ddd.ddd.ddd.ddd", where | ||
46 | * ddd is a decimal number of up to three digits in the range 0 to | ||
47 | * 255. The address is converted to a struct in_addr and copied to | ||
48 | * dst, which must be sizeof(struct in_addr) (4) bytes (32 bits) long. | ||
49 | * <li> AF_INET6: @p src points to a character string containing an | ||
50 | * IPv6 network address. The address is converted to a struct in6_addr | ||
51 | * and copied to dst, which must be sizeof(struct in6_addr) (16) bytes | ||
52 | * (128 bits) long. The allowed formats for IPv6 addresses follow | ||
53 | * these rules: | ||
54 | * <ol> | ||
55 | * <li>The preferred format is x:x:x:x:x:x:x:x. This form consists of | ||
56 | * eight hexadecimal numbers, each of which expresses a 16-bit value | ||
57 | * (i.e., each x can be up to 4 hex digits). | ||
58 | * <li>A series of contiguous zero values in the preferred format can | ||
59 | * be abbreviated to ::. Only one instance of :: can occur in an | ||
60 | * address. For example, the loopback address 0:0:0:0:0:0:0:1 can be | ||
61 | * abbreviated as ::1. The wildcard address, consisting of all zeros, | ||
62 | * can be written as ::. | ||
63 | * <li>An alternate format is useful for expressing IPv4-mapped IPv6 | ||
64 | * addresses. This form is written as x:x:x:x:x:x:d.d.d.d, where the | ||
65 | * six leading xs are hexadecimal values that define the six | ||
66 | * most-significant 16-bit pieces of the address (i.e., 96 bits), and | ||
67 | * the ds express a value in dotted-decimal notation that defines the | ||
68 | * least significant 32 bits of the address. An example of such an | ||
69 | * address is :: FFFF:204.152.189.116. | ||
70 | * </ul> | ||
71 | * </ul> | ||
72 | * On success this function returns 1 (network address was successfully | ||
73 | * converted). 0 is returned if @p src does not contain a character | ||
74 | * string representing a valid network address in the specified | ||
75 | * address family. If af does not contain a valid address family, -1 | ||
76 | * is returned and errno is set to EAFNOSUPPORT. | ||
77 | * | ||
78 | * @see evil_inet_ntop() | ||
79 | * @see inet_ntop() | ||
80 | * | ||
81 | * Conformity: POSIX.1-2001. | ||
82 | * | ||
83 | * Supported OS: Windows XP, CE. | ||
84 | * | ||
85 | */ | ||
31 | EAPI int evil_inet_pton(int af, const char *src, void *dst); | 86 | EAPI int evil_inet_pton(int af, const char *src, void *dst); |
32 | 87 | ||
88 | /** | ||
89 | * @def inet_pton(x,y,z) | ||
90 | * | ||
91 | * Wrapper around evil_inet_pton(). | ||
92 | */ | ||
33 | #define inet_pton(x,y,z) evil_inet_pton(x,y,z) | 93 | #define inet_pton(x,y,z) evil_inet_pton(x,y,z) |
34 | 94 | ||
95 | /** | ||
96 | * @brief Convert IPv4 and IPv6 addresses from binary to text form. | ||
97 | * | ||
98 | * @param af The address family. | ||
99 | * @param src The address structure to convert. | ||
100 | * @param dst A buffer containing the converted string. | ||
101 | * @param size The size of the buffer. | ||
102 | * @return 1 on success, 0 otherwise. | ||
103 | * | ||
104 | * This function converts the network address structure @p src in the | ||
105 | * @p af address family into a character string. The resulting string | ||
106 | * is copied to the buffer pointed to by @p dst, which must be a | ||
107 | * non-NULL pointer. The caller specifies the number of bytes | ||
108 | * available in this buffer in the argument @p size. The following | ||
109 | * address families to pass to @p af are currently supported: | ||
110 | * | ||
111 | * @li AF_INET: @p src points to a struct in_addr (in network byte | ||
112 | * order) which is converted to an IPv4 network address in the | ||
113 | * dotted-decimal format, "ddd.ddd.ddd.ddd". The buffer @p dst must be | ||
114 | * at least INET_ADDRSTRLEN bytes long. | ||
115 | * @li AF_INET6: @p src points to a struct in6_addr (in network byte | ||
116 | * order) which is converted to a representation of this address in | ||
117 | * the most appropriate IPv6 network address format for this | ||
118 | * address. The buffer @p dst must be at least INET6_ADDRSTRLEN bytes | ||
119 | * long. | ||
120 | * | ||
121 | * On success, this function returns a non-NULL pointer to @p dst. NULL is | ||
122 | * returned if there was an error, with errno set to indicate the | ||
123 | * error. | ||
124 | * | ||
125 | * @see evil_inet_pton() | ||
126 | * @see inet_pton() | ||
127 | * | ||
128 | * Conformity: POSIX.1-2001. | ||
129 | * | ||
130 | * Supported OS: Windows XP, CE. | ||
131 | * | ||
132 | */ | ||
35 | EAPI const char *evil_inet_ntop(int af, const char *src, void *dst, size_t size); | 133 | EAPI const char *evil_inet_ntop(int af, const char *src, void *dst, size_t size); |
36 | 134 | ||
135 | /** | ||
136 | * @def inet_ntop(x,y,z,s) | ||
137 | * | ||
138 | * Wrapper around evil_inet_ntop(). | ||
139 | */ | ||
37 | #define inet_ntop(x,y,z,s) evil_inet_ntop(x,y,z,s) | 140 | #define inet_ntop(x,y,z,s) evil_inet_ntop(x,y,z,s) |
38 | 141 | ||
39 | 142 | ||
diff --git a/legacy/evil/src/lib/evil_libgen.h b/legacy/evil/src/lib/evil_libgen.h index 48a3d82693..4ca977ce86 100644 --- a/legacy/evil/src/lib/evil_libgen.h +++ b/legacy/evil/src/lib/evil_libgen.h | |||
@@ -12,12 +12,71 @@ | |||
12 | * @{ | 12 | * @{ |
13 | */ | 13 | */ |
14 | 14 | ||
15 | /** | ||
16 | * @brief Parse the base name component of a path. | ||
17 | * | ||
18 | * @param path The path to parse. | ||
19 | * @return The component following the final '/'. | ||
20 | * | ||
21 | * This function parses @p path and returns its component following | ||
22 | * the final '\'. Trailing '\' are not taken into account. On Windows | ||
23 | * XP, @p path must beginning by a drive letter followed by ':/' or | ||
24 | * ':\', otherwise "C:\" is returned. All characters '/' are replaced by '\'. On | ||
25 | * error (memory allocation failure), "C:\" is returned, otherwise the | ||
26 | * component following the final '\' is returned as a statically | ||
27 | * allocated memory. Hence the returns value must not be freed. | ||
28 | * | ||
29 | * Concatenating the string returned by dirname(), a "\", and the | ||
30 | * string returned by basename() yields a complete pathname. | ||
31 | * | ||
32 | * @see evil_dirname() | ||
33 | * @see dirname() | ||
34 | * | ||
35 | * Conformity: Non applicable. | ||
36 | * | ||
37 | * Supported OS: Windows XP. | ||
38 | */ | ||
15 | EAPI char *evil_basename(char *path); | 39 | EAPI char *evil_basename(char *path); |
16 | 40 | ||
41 | /** | ||
42 | * @def basename(p) | ||
43 | * | ||
44 | * Wrapper around evil_basename(). | ||
45 | */ | ||
17 | #define basename(p) evil_basename(p) | 46 | #define basename(p) evil_basename(p) |
18 | 47 | ||
48 | /** | ||
49 | * @brief Parse the dir name component of a path. | ||
50 | * | ||
51 | * @param path The path to parse. | ||
52 | * @return The component up to, but not including, the final '/'. | ||
53 | * | ||
54 | * This function parses @p path and returns its component up to, but | ||
55 | * not including, the final '/'. Trailing '\' are not taken into | ||
56 | * account. On Windows XP, @p path must beginning by a drive letter | ||
57 | * followed by ':/' or ':\', otherwise "C:\" is returned. All | ||
58 | * characters '/' are replaced by '\'. On error (memory allocation | ||
59 | * failure), "C:\" is returned, otherwise, the component up to, but | ||
60 | * not including, the final '/' is returned as a statically allocated | ||
61 | * memory. Hence the returns value must not be freed. | ||
62 | * | ||
63 | * Concatenating the string returned by dirname(), a "\", and the | ||
64 | * string returned by basename() yields a complete pathname. | ||
65 | * | ||
66 | * @see evil_basename() | ||
67 | * @see basename() | ||
68 | * | ||
69 | * Conformity: Non applicable. | ||
70 | * | ||
71 | * Supported OS: Windows XP. | ||
72 | */ | ||
19 | EAPI char *evil_dirname(char *path); | 73 | EAPI char *evil_dirname(char *path); |
20 | 74 | ||
75 | /** | ||
76 | * @def dirname(p) | ||
77 | * | ||
78 | * Wrapper around evil_dirname(). | ||
79 | */ | ||
21 | #define dirname(p) evil_dirname(p) | 80 | #define dirname(p) evil_dirname(p) |
22 | 81 | ||
23 | 82 | ||
diff --git a/legacy/evil/src/lib/evil_stdio.c b/legacy/evil/src/lib/evil_stdio.c index d0e4202721..95a5a3b25b 100644 --- a/legacy/evil/src/lib/evil_stdio.c +++ b/legacy/evil/src/lib/evil_stdio.c | |||
@@ -198,7 +198,7 @@ size_t evil_fread_native(void* buffer, size_t size, size_t count, FILE* stream) | |||
198 | return 0; | 198 | return 0; |
199 | } | 199 | } |
200 | 200 | ||
201 | return (bytes_read != size * count) ? 0 : 1; | 201 | return (bytes_read != size * count) ? 0 : bytes_read; |
202 | } | 202 | } |
203 | 203 | ||
204 | int evil_fclose_native(FILE *stream) | 204 | int evil_fclose_native(FILE *stream) |
diff --git a/legacy/evil/src/lib/evil_stdio.h b/legacy/evil/src/lib/evil_stdio.h index fa6846fed1..0d7bf022c6 100644 --- a/legacy/evil/src/lib/evil_stdio.h +++ b/legacy/evil/src/lib/evil_stdio.h | |||
@@ -20,8 +20,24 @@ | |||
20 | * | 20 | * |
21 | */ | 21 | */ |
22 | 22 | ||
23 | /** | ||
24 | * @brief Print the given string to stderr. | ||
25 | * | ||
26 | * @param s The string to print. | ||
27 | * | ||
28 | * This function just printf the string @p s to stderr. | ||
29 | * | ||
30 | * Conformity: None. | ||
31 | * | ||
32 | * Supported OS: Windows CE. | ||
33 | */ | ||
23 | EAPI void evil_perror (const char *s); | 34 | EAPI void evil_perror (const char *s); |
24 | 35 | ||
36 | /** | ||
37 | * @def perror(s) | ||
38 | * | ||
39 | * Wrapper around evil_perror(). | ||
40 | */ | ||
25 | # define perror(s) evil_perror(s) | 41 | # define perror(s) evil_perror(s) |
26 | 42 | ||
27 | /* | 43 | /* |
@@ -29,16 +45,78 @@ EAPI void evil_perror (const char *s); | |||
29 | * | 45 | * |
30 | */ | 46 | */ |
31 | 47 | ||
48 | /** | ||
49 | * @brief Emulate the fopen() function on Windows CE. | ||
50 | * | ||
51 | * @param path The file to open. | ||
52 | * @param mode The mode. | ||
53 | * @return A FILE pointer on success, @c NULL otherwise. | ||
54 | * | ||
55 | * This function emulates the fopen() function on Windows CE using the | ||
56 | * Windows libc. The main problem is that the filesytem on Windows CE | ||
57 | * is like on Sys V : the top level directory is beginning by '/' or | ||
58 | * '\' and the full path must be calculated.. This function takes care | ||
59 | * of this feature, and replace all the '/' by '/'. Otherwise, it | ||
60 | * calls the Windows CE fopen() function once the filename has been | ||
61 | * correctly set. If @p path is @c NULL or empty, this function | ||
62 | * returns @c NULL. On success, this function returns a FILE stream, | ||
63 | * @c NULL otherwise. | ||
64 | * | ||
65 | * Conformity: None. | ||
66 | * | ||
67 | * Supported OS: Windows CE. | ||
68 | */ | ||
32 | EAPI FILE *evil_fopen(const char *path, const char *mode); | 69 | EAPI FILE *evil_fopen(const char *path, const char *mode); |
33 | 70 | ||
71 | /** | ||
72 | * @def fopen(path, mode) | ||
73 | * | ||
74 | * Wrapper around evil_fopen(). | ||
75 | */ | ||
34 | # define fopen(path, mode) evil_fopen(path, mode) | 76 | # define fopen(path, mode) evil_fopen(path, mode) |
35 | 77 | ||
78 | /** | ||
79 | * @brief Emulate the rewind() function on Windows CE. | ||
80 | * | ||
81 | * @param stream The FILE stream. | ||
82 | * | ||
83 | * This function emulates the rewind() function on Windows CE by just | ||
84 | * calling fseek(). | ||
85 | * | ||
86 | * Conformity: None. | ||
87 | * | ||
88 | * Supported OS: Windows CE. | ||
89 | */ | ||
36 | EAPI void evil_rewind(FILE *stream); | 90 | EAPI void evil_rewind(FILE *stream); |
37 | 91 | ||
92 | /** | ||
93 | * @def rewind(f) | ||
94 | * | ||
95 | * Wrapper around evil_rewind(). | ||
96 | */ | ||
38 | # define rewind(f) evil_rewind(f) | 97 | # define rewind(f) evil_rewind(f) |
39 | 98 | ||
99 | /** | ||
100 | * @brief Emulate the remove() function on Windows CE. | ||
101 | * | ||
102 | * @param path The path to remove. | ||
103 | * @return 0 on success, -1 otherwise. | ||
104 | * | ||
105 | * This function emulates the remove() function on Windows CE. If | ||
106 | * @p path is an empty directory, it removes it. If @p path is a file, | ||
107 | * it deletes it. On success, 0 is returns, -1 otherwise. | ||
108 | * | ||
109 | * Conformity: None. | ||
110 | * | ||
111 | * Supported OS: Windows CE. | ||
112 | */ | ||
40 | EAPI int evil_remove(const char *path); | 113 | EAPI int evil_remove(const char *path); |
41 | 114 | ||
115 | /** | ||
116 | * @def remove(p) | ||
117 | * | ||
118 | * Wrapper around evil_remove(). | ||
119 | */ | ||
42 | # define remove(p) evil_remove(p) | 120 | # define remove(p) evil_remove(p) |
43 | 121 | ||
44 | #endif /* _WIN32_WCE */ | 122 | #endif /* _WIN32_WCE */ |
@@ -46,10 +124,65 @@ EAPI int evil_remove(const char *path); | |||
46 | 124 | ||
47 | #ifdef _WIN32_WCE | 125 | #ifdef _WIN32_WCE |
48 | 126 | ||
127 | /** | ||
128 | * @brief Emulate the fopen() function on Windows CE using Windows API. | ||
129 | * | ||
130 | * @param path The file to open. | ||
131 | * @param mode The mode. | ||
132 | * @return A FILE pointer on success, @c NULL otherwise. | ||
133 | * | ||
134 | * This function emulates the fopen() function on Windows CE using the | ||
135 | * Windows API and not the libc. It is similar to evil_fopen(). | ||
136 | * | ||
137 | * @see evil_fopen() | ||
138 | * @see evil_fread_native() | ||
139 | * @see evil_fclose_native() | ||
140 | * | ||
141 | * Conformity: None. | ||
142 | * | ||
143 | * Supported OS: Windows CE. | ||
144 | */ | ||
49 | EAPI FILE *evil_fopen_native(const char *path, const char *mode); | 145 | EAPI FILE *evil_fopen_native(const char *path, const char *mode); |
50 | 146 | ||
147 | /** | ||
148 | * @brief Read the given stream on Windows CE using Windows API. | ||
149 | * | ||
150 | * @param buffer The buffer to store the data. | ||
151 | * @param size The size of each element of data to read. | ||
152 | * @param count The number of elements of data to read. | ||
153 | * @param stream The stream to read. | ||
154 | * @return The size read on success, 0 otherwise. | ||
155 | * | ||
156 | * This function read @p stream using the Windows API. It reads | ||
157 | * @p size elements of data, each @ size bytes long. The data is | ||
158 | * stored in the buffer @p buffer. On success, the size read is | ||
159 | * returned, 0 otherwise. | ||
160 | * | ||
161 | * @see evil_fopen_native() | ||
162 | * @see evil_fclose_native() | ||
163 | * | ||
164 | * Conformity: None. | ||
165 | * | ||
166 | * Supported OS: Windows CE. | ||
167 | */ | ||
51 | EAPI size_t evil_fread_native(void* buffer, size_t size, size_t count, FILE* stream); | 168 | EAPI size_t evil_fread_native(void* buffer, size_t size, size_t count, FILE* stream); |
52 | 169 | ||
170 | /** | ||
171 | * @brief Close the given stream on Windows CE using Windows API. | ||
172 | * | ||
173 | * @param stream The stream to close. | ||
174 | * @return 0 on success, -1 otherwise. | ||
175 | * | ||
176 | * This function closes @p stream using the Windows API. On success, 0 | ||
177 | * is returned, -1 otherwise. | ||
178 | * | ||
179 | * @see evil_fopen_native() | ||
180 | * @see evil_fread_native() | ||
181 | * | ||
182 | * Conformity: None. | ||
183 | * | ||
184 | * Supported OS: Windows CE. | ||
185 | */ | ||
53 | EAPI int evil_fclose_native(FILE *stream); | 186 | EAPI int evil_fclose_native(FILE *stream); |
54 | 187 | ||
55 | #endif /* _WIN32_WCE */ | 188 | #endif /* _WIN32_WCE */ |
diff --git a/legacy/evil/src/lib/evil_string.h b/legacy/evil/src/lib/evil_string.h index eaa71d61d6..cce9636c3c 100644 --- a/legacy/evil/src/lib/evil_string.h +++ b/legacy/evil/src/lib/evil_string.h | |||
@@ -87,7 +87,7 @@ EAPI int strcoll (const char *s1, const char *s2); | |||
87 | #endif /* _WIN32_WCE */ | 87 | #endif /* _WIN32_WCE */ |
88 | 88 | ||
89 | /** | 89 | /** |
90 | * @brief get the last substring occurence. | 90 | * @brief Get the last substring occurence. |
91 | * | 91 | * |
92 | * @param str The string to search from. | 92 | * @param str The string to search from. |
93 | * @param substr The substring to search. | 93 | * @param substr The substring to search. |
@@ -105,6 +105,22 @@ EAPI char *strrstr (const char *str, const char *substr); | |||
105 | 105 | ||
106 | #ifdef _MSC_VER | 106 | #ifdef _MSC_VER |
107 | 107 | ||
108 | /** | ||
109 | * @brief Compare two string, ignoring case. | ||
110 | * | ||
111 | * @param s1 The first string to compare. | ||
112 | * @param s2 The first string to compare. | ||
113 | * @return | ||
114 | * | ||
115 | * This function compares the two strings @p s1 and @p s2, ignoring | ||
116 | * the case of the characters. It returns an integer less than, equal | ||
117 | * to, or greater than zero if s1 is found, respectively, to be less | ||
118 | * than, to match, or be greater than s2. | ||
119 | * | ||
120 | * Conformity: Non applicable. | ||
121 | * | ||
122 | * Supported OS: Windows XP (vc++ only) | ||
123 | */ | ||
108 | EAPI int strcasecmp(const char *s1, const char *s2); | 124 | EAPI int strcasecmp(const char *s1, const char *s2); |
109 | 125 | ||
110 | #endif /* _MSC_VER */ | 126 | #endif /* _MSC_VER */ |
diff --git a/legacy/evil/src/lib/pwd.h b/legacy/evil/src/lib/pwd.h index 6c77b5fd89..e7907cacbd 100644 --- a/legacy/evil/src/lib/pwd.h +++ b/legacy/evil/src/lib/pwd.h | |||
@@ -2,6 +2,17 @@ | |||
2 | #define __EVIL_PWD_H__ | 2 | #define __EVIL_PWD_H__ |
3 | 3 | ||
4 | 4 | ||
5 | /** | ||
6 | * @file pwd.h | ||
7 | * @brief The file that provides functions ported from Unix in pwd.h. | ||
8 | * @defgroup Evil_Pwd_Group Pwd.h functions | ||
9 | * | ||
10 | * This header provides functions ported from Unix in dirent.h. | ||
11 | * | ||
12 | * @{ | ||
13 | */ | ||
14 | |||
15 | |||
5 | #include <time.h> | 16 | #include <time.h> |
6 | 17 | ||
7 | #include <Evil.h> | 18 | #include <Evil.h> |
@@ -12,21 +23,38 @@ extern "C" { | |||
12 | #endif | 23 | #endif |
13 | 24 | ||
14 | 25 | ||
26 | /** | ||
27 | * @struct passwd | ||
28 | * @brief A structure that describes a password. | ||
29 | */ | ||
15 | struct passwd { | 30 | struct passwd { |
16 | char *pw_name; /* user name */ | 31 | char *pw_name; /**< user name */ |
17 | char *pw_passwd; /* encrypted password */ | 32 | char *pw_passwd; /**< encrypted password (always @c NULL) */ |
18 | uid_t pw_uid; /* user uid */ | 33 | uid_t pw_uid; /**< user uid */ |
19 | gid_t pw_gid; /* user gid */ | 34 | gid_t pw_gid; /**< user gid (always O) */ |
20 | time_t pw_change; /* password change time */ | 35 | time_t pw_change; /**< password change time (always 0) */ |
21 | char *pw_class; /* user access class */ | 36 | char *pw_class; /**< user access class (always @c NULL) */ |
22 | char *pw_gecos; /* Honeywell login info */ | 37 | char *pw_gecos; /**< Honeywell login info */ |
23 | char *pw_dir; /* home directory */ | 38 | char *pw_dir; /**< home directory */ |
24 | char *pw_shell; /* default shell */ | 39 | char *pw_shell; /**< default shell */ |
25 | time_t pw_expire; /* account expiration */ | 40 | time_t pw_expire; /**< account expiration (always O) */ |
26 | int pw_fields; /* internal: fields filled in */ | 41 | int pw_fields; /**< internal: fields filled in (always O) */ |
27 | }; | 42 | }; |
28 | 43 | ||
29 | EAPI struct passwd * getpwuid (uid_t uid); | 44 | /** |
45 | * @brief Return a passwd structure. | ||
46 | * | ||
47 | * @param uid The User ID | ||
48 | * @return A stacally allocated passwd structure. | ||
49 | * | ||
50 | * This function fills a static buffer @ref passwd with @p uid and the | ||
51 | * user name. | ||
52 | * | ||
53 | * Conformity: None. | ||
54 | * | ||
55 | * Supported OS: Windows XP, CE. | ||
56 | */ | ||
57 | EAPI struct passwd *getpwuid (uid_t uid); | ||
30 | 58 | ||
31 | 59 | ||
32 | #ifdef __cplusplus | 60 | #ifdef __cplusplus |
@@ -34,4 +62,10 @@ EAPI struct passwd * getpwuid (uid_t uid); | |||
34 | #endif | 62 | #endif |
35 | 63 | ||
36 | 64 | ||
65 | |||
66 | /** | ||
67 | * @} | ||
68 | */ | ||
69 | |||
70 | |||
37 | #endif /* __EVIL_PWD_H__ */ | 71 | #endif /* __EVIL_PWD_H__ */ |