raster pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=a6ade14c5e65ab729b1013388ec1aea4be22afc7

commit a6ade14c5e65ab729b1013388ec1aea4be22afc7
Author: Vincent Torri <[email protected]>
Date:   Sun Jul 28 09:27:27 2019 +0100

    Evil: remove pwd code in Evil and fix compilation failures after the removal
    
    Summary: remove pwd code in Evil
    
    Test Plan: compilation
    
    Reviewers: zmike, cedric, raster
    
    Subscribers: #reviewers, #committers
    
    Tags: #efl
    
    Differential Revision: https://phab.enlightenment.org/D9420
---
 src/benchmarks/elementary/focus_widget_tree.c |  4 ++
 src/bin/elementary/test.c                     |  5 ++
 src/bin/elementary/test_combobox.c            |  5 ++
 src/bin/elementary/test_fileselector.c        |  4 ++
 src/bin/elementary/test_fileselector_button.c |  4 ++
 src/bin/elementary/test_fileselector_entry.c  |  4 ++
 src/bin/elementary/test_genlist.c             |  5 ++
 src/bin/elementary/test_label.c               |  5 ++
 src/bin/elementary/test_panel.c               |  5 ++
 src/lib/ecore_con/ecore_con_local.c           |  6 +-
 src/lib/efreet/efreet_base.c                  |  3 +-
 src/lib/eina/eina_vpath.c                     |  6 +-
 src/lib/eina/eina_vpath_xdg.c                 |  4 +-
 src/lib/elementary/Efl_Ui.h                   |  4 +-
 src/lib/elementary/Elementary.h               |  4 +-
 src/lib/elementary/efl_datetime_manager.c     |  4 ++
 src/lib/elementary/efl_ui_clock.c             |  4 ++
 src/lib/elementary/elm_config.c               |  1 -
 src/lib/elementary/elm_main.c                 |  1 +
 src/lib/elementary/elm_prefs.c                |  4 ++
 src/lib/elementary/elm_util.c                 |  4 ++
 src/lib/ethumb/ethumb.c                       |  4 +-
 src/lib/evil/Evil.h                           |  6 --
 src/lib/evil/evil_pwd.c                       | 69 ---------------------
 src/lib/evil/meson.build                      |  2 -
 src/lib/evil/pwd.h                            | 89 ---------------------------
 src/tests/eina/eina_test_vpath.c              |  4 +-
 src/tests/elementary/spec/efl_test_format.c   |  4 ++
 28 files changed, 89 insertions(+), 175 deletions(-)

diff --git a/src/benchmarks/elementary/focus_widget_tree.c 
b/src/benchmarks/elementary/focus_widget_tree.c
index 5f05df3445..d5e1531bb5 100644
--- a/src/benchmarks/elementary/focus_widget_tree.c
+++ b/src/benchmarks/elementary/focus_widget_tree.c
@@ -2,6 +2,10 @@
 # include "elementary_config.h"
 #endif
 
+#ifdef _WIN32
+# include <evil_private.h> /* setenv */
+#endif
+
 #include <Elementary.h>
 #include <Ecore_Input_Evas.h>
 #include "elm_widget.h"
diff --git a/src/bin/elementary/test.c b/src/bin/elementary/test.c
index 79d56af40e..4a77460058 100644
--- a/src/bin/elementary/test.c
+++ b/src/bin/elementary/test.c
@@ -3,6 +3,11 @@
 #endif
 
 #include <string.h>
+
+#ifdef _WIN32
+# include <evil_private.h> /* strcasestr */
+#endif
+
 #include <Efl_Ui.h>
 #include <Elementary.h>
 #include "test.h"
diff --git a/src/bin/elementary/test_combobox.c 
b/src/bin/elementary/test_combobox.c
index c71cf2f1e0..ee68a3bdaf 100644
--- a/src/bin/elementary/test_combobox.c
+++ b/src/bin/elementary/test_combobox.c
@@ -2,6 +2,11 @@
 #ifdef HAVE_CONFIG_H
 # include "elementary_config.h"
 #endif
+
+#ifdef _WIN32
+# include <evil_private.h> /* strcasestr */
+#endif
+
 #include <Elementary.h>
 
 static void
diff --git a/src/bin/elementary/test_fileselector.c 
b/src/bin/elementary/test_fileselector.c
index 1c23066097..880162e9d2 100644
--- a/src/bin/elementary/test_fileselector.c
+++ b/src/bin/elementary/test_fileselector.c
@@ -2,6 +2,10 @@
 # include "elementary_config.h"
 #endif
 
+#ifdef _WIN32
+# include <evil_private.h> /* mkdir stelocale */
+#endif
+
 #include <Elementary.h>
 #ifndef ENABLE_NLS
 # ifndef setlocale
diff --git a/src/bin/elementary/test_fileselector_button.c 
b/src/bin/elementary/test_fileselector_button.c
index b04e9d38ef..2ee1a3338c 100644
--- a/src/bin/elementary/test_fileselector_button.c
+++ b/src/bin/elementary/test_fileselector_button.c
@@ -3,6 +3,10 @@
 # include "elementary_config.h"
 #endif
 
+#ifdef _WIN32
+# include <evil_private.h> /* mkdir */
+#endif
+
 #include <Elementary.h>
 
 struct _api_data
diff --git a/src/bin/elementary/test_fileselector_entry.c 
b/src/bin/elementary/test_fileselector_entry.c
index 3bfd438204..17d6ddee4b 100644
--- a/src/bin/elementary/test_fileselector_entry.c
+++ b/src/bin/elementary/test_fileselector_entry.c
@@ -3,6 +3,10 @@
 # include "elementary_config.h"
 #endif
 
+#ifdef _WIN32
+# include <evil_private.h> /* mkdir */
+#endif
+
 #include <Elementary.h>
 
 struct _api_data
diff --git a/src/bin/elementary/test_genlist.c 
b/src/bin/elementary/test_genlist.c
index b4168fd830..c3f4d95943 100644
--- a/src/bin/elementary/test_genlist.c
+++ b/src/bin/elementary/test_genlist.c
@@ -3,6 +3,11 @@
 #ifdef HAVE_CONFIG_H
 #include "elementary_config.h"
 #endif
+
+#ifdef _WIN32
+# include <evil_private.h> /* strcasestr */
+#endif
+
 #include <Elementary.h>
 
 #include "test_explode.h"
diff --git a/src/bin/elementary/test_label.c b/src/bin/elementary/test_label.c
index 2b11ff5b2a..c00ae7986e 100644
--- a/src/bin/elementary/test_label.c
+++ b/src/bin/elementary/test_label.c
@@ -1,6 +1,11 @@
 #ifdef HAVE_CONFIG_H
 # include "elementary_config.h"
 #endif
+
+#ifdef _WIN32
+# include <evil_private.h> /* strcasestr */
+#endif
+
 #include <Elementary.h>
 
 enum _slide_style
diff --git a/src/bin/elementary/test_panel.c b/src/bin/elementary/test_panel.c
index 371e6d5541..a6318d1c29 100644
--- a/src/bin/elementary/test_panel.c
+++ b/src/bin/elementary/test_panel.c
@@ -1,6 +1,11 @@
 #ifdef HAVE_CONFIG_H
 # include "elementary_config.h"
 #endif
+
+#ifdef _WIN32
+# include <evil_private.h> /* mkdir */
+#endif
+
 #include <Elementary.h>
 
 #define LIST_ITEM_MAX 20
diff --git a/src/lib/ecore_con/ecore_con_local.c 
b/src/lib/ecore_con/ecore_con_local.c
index 5fed0b711e..fae182e133 100644
--- a/src/lib/ecore_con/ecore_con_local.c
+++ b/src/lib/ecore_con/ecore_con_local.c
@@ -10,7 +10,11 @@
 #include <fcntl.h>
 #include <sys/types.h>
 #include <sys/stat.h>
-#include <pwd.h>
+#ifdef _WIN32
+# include <evil_private.h> /* mkdir */
+#else
+# include <pwd.h>
+#endif
 #include <libgen.h>
 
 #ifdef HAVE_SYSTEMD
diff --git a/src/lib/efreet/efreet_base.c b/src/lib/efreet/efreet_base.c
index e7bc54f118..6497e8d955 100644
--- a/src/lib/efreet/efreet_base.c
+++ b/src/lib/efreet/efreet_base.c
@@ -8,10 +8,11 @@
 #include <unistd.h>
 #include <ctype.h>
 #include <sys/types.h>
-#include <pwd.h>
 
 #ifdef _WIN32
 # include <winsock2.h>
+#else
+# include <pwd.h>
 #endif
 
 #include <Ecore_File.h>
diff --git a/src/lib/eina/eina_vpath.c b/src/lib/eina/eina_vpath.c
index c06ee5abe8..78ae6a250d 100644
--- a/src/lib/eina/eina_vpath.c
+++ b/src/lib/eina/eina_vpath.c
@@ -3,7 +3,11 @@
 #endif
 
 #include <sys/types.h>
-#include <pwd.h>
+#ifdef _WIN32
+# include <evil_private.h> /* mkdir */
+#else
+# include <pwd.h>
+#endif
 
 #include <Eina.h>
 
diff --git a/src/lib/eina/eina_vpath_xdg.c b/src/lib/eina/eina_vpath_xdg.c
index 0db6e7836d..43ca85e1d9 100644
--- a/src/lib/eina/eina_vpath_xdg.c
+++ b/src/lib/eina/eina_vpath_xdg.c
@@ -3,7 +3,9 @@
 #endif
 
 #include <sys/types.h>
-#include <pwd.h>
+#ifndef _WIN32
+# include <pwd.h>
+#endif
 
 #include <Eina.h>
 
diff --git a/src/lib/elementary/Efl_Ui.h b/src/lib/elementary/Efl_Ui.h
index 93d3a0a1fa..e390b89efe 100644
--- a/src/lib/elementary/Efl_Ui.h
+++ b/src/lib/elementary/Efl_Ui.h
@@ -21,7 +21,9 @@
 #ifdef ELM_DIRENT_H
 #include <dirent.h>
 #endif
-#include <pwd.h>
+#ifndef _WIN32
+# include <pwd.h>
+#endif
 #include <errno.h>
 
 #ifdef ELM_UNIX
diff --git a/src/lib/elementary/Elementary.h b/src/lib/elementary/Elementary.h
index 6faf7f7ac5..bdc128a2b8 100644
--- a/src/lib/elementary/Elementary.h
+++ b/src/lib/elementary/Elementary.h
@@ -27,7 +27,9 @@
 #ifdef ELM_DIRENT_H
 #include <dirent.h>
 #endif
-#include <pwd.h>
+#ifndef _WIN32
+# include <pwd.h>
+#endif
 #include <errno.h>
 
 #ifdef ELM_UNIX
diff --git a/src/lib/elementary/efl_datetime_manager.c 
b/src/lib/elementary/efl_datetime_manager.c
index 8739be8251..24daa34217 100644
--- a/src/lib/elementary/efl_datetime_manager.c
+++ b/src/lib/elementary/efl_datetime_manager.c
@@ -5,6 +5,10 @@
 # include <langinfo.h>
 #endif
 
+#ifdef _WIN32
+# include <evil_private.h> /* nl_langinfo */
+#endif
+
 #include <Elementary.h>
 #include "elm_priv.h"
 
diff --git a/src/lib/elementary/efl_ui_clock.c 
b/src/lib/elementary/efl_ui_clock.c
index e580d3cf06..5a86dcdc26 100644
--- a/src/lib/elementary/efl_ui_clock.c
+++ b/src/lib/elementary/efl_ui_clock.c
@@ -2,6 +2,10 @@
 # include "elementary_config.h"
 #endif
 
+#ifdef _WIN32
+# include <evil_private.h> /* nl_langinfo */
+#endif
+
 #define EFL_ACCESS_OBJECT_PROTECTED
 #define EFL_UI_L10N_PROTECTED
 
diff --git a/src/lib/elementary/elm_config.c b/src/lib/elementary/elm_config.c
index 6093ca73cd..72bc9f8004 100644
--- a/src/lib/elementary/elm_config.c
+++ b/src/lib/elementary/elm_config.c
@@ -4,7 +4,6 @@
 
 #include <Elementary.h>
 #include "elm_priv.h"
-#include <pwd.h>
 
 #include "efl_config_global.eo.h"
 
diff --git a/src/lib/elementary/elm_main.c b/src/lib/elementary/elm_main.c
index ca03e4bab6..77d7ab2aac 100644
--- a/src/lib/elementary/elm_main.c
+++ b/src/lib/elementary/elm_main.c
@@ -12,6 +12,7 @@
 
 #ifdef _WIN32
 # include <direct.h> /* getcwd */
+# include <evil_private.h> /* dlopen,dlclose,etc */
 #endif
 
 #include <Emotion.h>
diff --git a/src/lib/elementary/elm_prefs.c b/src/lib/elementary/elm_prefs.c
index a320563661..32e684edc2 100644
--- a/src/lib/elementary/elm_prefs.c
+++ b/src/lib/elementary/elm_prefs.c
@@ -2,6 +2,10 @@
 # include "elementary_config.h"
 #endif
 
+#ifdef _WIN32
+# include <evil_private.h> /* strsep evil_path_absolute */
+#endif
+
 #define EFL_ACCESS_OBJECT_PROTECTED
 
 #include <Elementary.h>
diff --git a/src/lib/elementary/elm_util.c b/src/lib/elementary/elm_util.c
index 476205c936..101afe9bb3 100644
--- a/src/lib/elementary/elm_util.c
+++ b/src/lib/elementary/elm_util.c
@@ -2,6 +2,10 @@
 # include "elementary_config.h"
 #endif
 
+#ifdef _WIN32
+# include <evil_private.h> /* nl_langinfo */
+#endif
+
 #include <Elementary.h>
 
 #include "elm_priv.h"
diff --git a/src/lib/ethumb/ethumb.c b/src/lib/ethumb/ethumb.c
index bbfe3a01c5..cf22911921 100644
--- a/src/lib/ethumb/ethumb.c
+++ b/src/lib/ethumb/ethumb.c
@@ -41,7 +41,9 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <ctype.h>
-#include <pwd.h>
+#ifndef _WIN32
+# include <pwd.h>
+#endif
 
 #ifdef HAVE_XATTR
 # include <sys/xattr.h>
diff --git a/src/lib/evil/Evil.h b/src/lib/evil/Evil.h
index 7383fe7398..147e45a27b 100644
--- a/src/lib/evil/Evil.h
+++ b/src/lib/evil/Evil.h
@@ -75,11 +75,8 @@
  * @li @ref Evil_Dlfcn
  * @li @ref Evil_Langinfo_Group
  * @li @ref Evil_Locale_Group
- * @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
@@ -94,9 +91,6 @@ extern "C" {
 #endif
 
 
-typedef unsigned long  uid_t;
-typedef unsigned long  gid_t;
-
 #ifdef _MSC_VER
 # ifdef _WIN64
 typedef __int64 pid_t;
diff --git a/src/lib/evil/evil_pwd.c b/src/lib/evil/evil_pwd.c
deleted file mode 100644
index c45f9281a4..0000000000
--- a/src/lib/evil/evil_pwd.c
+++ /dev/null
@@ -1,69 +0,0 @@
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif /* HAVE_CONFIG_H */
-
-#include <stdlib.h>
-#include <stdio.h>
-
-#define _POSIX
-#include <io.h>
-#include <lmcons.h>
-
-#include "evil_private.h"
-#include "pwd.h"
-
-
-static struct passwd pw = { NULL, NULL, 0, 0, 0, NULL, NULL, NULL, NULL, 0, 0 
};
-
-struct passwd *
-getpwnam(const char *n)
-{
-   static char user_name[UNLEN + 1];
-   static char user_gecos[UNLEN + 4];
-   TCHAR       name[UNLEN + 1];
-   DWORD       length;
-   BOOLEAN     res;
-#ifdef UNICODE
-   char       *a_name;
-# endif /* UNICODE */
-
-   if (!n)
-     return NULL;
-
-   length = UNLEN + 1;
-   res = GetUserName(name, &length);
-   if (!res)
-     return NULL;
-
-#ifdef UNICODE
-   a_name = evil_wchar_to_char(name);
-   if (a_name)
-     {
-        int l;
-
-        l = strlen(a_name);
-        if (l >= PATH_MAX)
-          l = PATH_MAX;
-        memcpy(user_name, a_name, l);
-        user_name[l] = '\0';
-        free(a_name);
-     }
-   else
-     return NULL;
-#else
-   memcpy(user_name, name, strlen(name) + 1);
-#endif /* UNICODE */
-
-   if (strcmp(n, user_name) != 0)
-     return NULL;
-
-   pw.pw_name = user_name;
-   snprintf(user_gecos, sizeof(user_gecos), "%s,,,", user_name);
-   pw.pw_gecos = user_gecos;
-   pw.pw_dir = getenv("USERPROFILE");
-   pw.pw_shell = getenv("SHELL");
-   if (!pw.pw_shell)
-     pw.pw_shell = "cmd.exe";
-
-   return &pw;
-}
diff --git a/src/lib/evil/meson.build b/src/lib/evil/meson.build
index 8ed266c77e..85978d8e9c 100644
--- a/src/lib/evil/meson.build
+++ b/src/lib/evil/meson.build
@@ -16,7 +16,6 @@ if target_machine.system() == 'windows'
   'evil_unistd.h',
   'evil_util.h',
   'dirent.h',
-  'pwd.h',
   ]
   evil_header_sys_src = [join_paths('sys','mman.h')]
 
@@ -27,7 +26,6 @@ if target_machine.system() == 'windows'
   'evil_locale.c',
   'evil_main.c',
   'evil_mman.c',
-  'evil_pwd.c',
   'evil_stdio.c',
   'evil_stdlib.c',
   'evil_string.c',
diff --git a/src/lib/evil/pwd.h b/src/lib/evil/pwd.h
deleted file mode 100644
index 104acd9600..0000000000
--- a/src/lib/evil/pwd.h
+++ /dev/null
@@ -1,89 +0,0 @@
-#ifndef __EVIL_PWD_H__
-#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
- * @ingroup Evil
- *
- * This header provides functions ported from Unix in pwd.h.
- *
- * @{
- */
-
-
-#include <time.h>
-
-#include <Evil.h>
-
-#ifdef EAPI
-# undef EAPI
-#endif
-
-#ifdef _WIN32
-# ifdef EFL_BUILD
-#  ifdef DLL_EXPORT
-#   define EAPI __declspec(dllexport)
-#  else
-#   define EAPI
-#  endif
-# else
-#  define EAPI __declspec(dllimport)
-# endif
-#endif
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/**
- * @struct passwd
- * @brief A structure that describes a password.
- */
-struct passwd {
-   char    *pw_name;       /**< user name */
-   char    *pw_passwd;     /**< encrypted password (always @c NULL) */
-   uid_t    pw_uid;        /**< user uid (always 0) */
-   gid_t    pw_gid;        /**< user gid (always 0) */
-   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 0) */
-   int      pw_fields;     /**< internal: fields filled in (always 0) */
-};
-
-/**
- * @brief Return a passwd structure.
- *
- * @param n The name of the user.
- * @return A stacally allocated passwd structure.
- *
- * This function fills a static buffer @ref passwd with the user name @p n.
- *
- * Conformity: None.
- *
- * Supported OS: Windows XP.
- */
-EAPI struct passwd *getpwnam(const char *n);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#undef EAPI
-#define EAPI
-
-
-/**
- * @}
- */
-
-
-#endif /* __EVIL_PWD_H__ */
diff --git a/src/tests/eina/eina_test_vpath.c b/src/tests/eina/eina_test_vpath.c
index 7a38712acc..1282cc4f2f 100644
--- a/src/tests/eina/eina_test_vpath.c
+++ b/src/tests/eina/eina_test_vpath.c
@@ -5,7 +5,9 @@
 #include <Eina.h>
 #include <check.h>
 #include "eina_suite.h"
-#include <pwd.h>
+#ifndef _WIN32
+# include <pwd.h>
+#endif
 
 EFL_START_TEST(eina_test_vpath_valid)
 {
diff --git a/src/tests/elementary/spec/efl_test_format.c 
b/src/tests/elementary/spec/efl_test_format.c
index cd2e698051..c3fa7d42f5 100644
--- a/src/tests/elementary/spec/efl_test_format.c
+++ b/src/tests/elementary/spec/efl_test_format.c
@@ -2,6 +2,10 @@
 # include "elementary_config.h"
 #endif
 
+#ifdef _WIN32
+# include <evil_private.h> /* setlocale strptime */
+#endif
+
 #define EFL_UI_FORMAT_PROTECTED /* To access internal methods */
 
 #include <Efl_Ui.h>

-- 


Reply via email to