e_devicemgr: use strcmp in e_utils 37/321637/1
authorSooChan Lim <sc1.lim@samsung.com>
Tue, 25 Mar 2025 07:24:50 +0000 (16:24 +0900)
committerTizen Window System <tizen.windowsystem@gmail.com>
Wed, 26 Mar 2025 03:43:55 +0000 (12:43 +0900)
instead of e_devicemgr_strcmp

Change-Id: If5ce1c04750c4368393616ff88f137c6984815fd

src/bin/inputmgr/e_devicemgr_input.c
src/bin/inputmgr/e_devicemgr_inputgen.c
src/bin/inputmgr/e_devicemgr_intern.h

index 0b564537a76c9590e7842b3e3448a9cf84da35ac..0b8da8e84349c6ad070308f2817fb8009f49630e 100644 (file)
 #include "e_input_log.h"
 #include "e_client_intern.h"
 #include "e_seat_intern.h"
+#include "e_utils_intern.h"
 
 #include <tizen-extension-server-protocol.h>
 
-Eina_Bool
-e_devicemgr_strcmp(const char *dst, const char *src)
-{
-   int dst_len, src_len, str_len;
-
-   dst_len = strlen(dst);
-   src_len = strlen(src);
-
-   if (src_len > dst_len) str_len = src_len;
-   else str_len = dst_len;
-
-   if (!strncmp(dst, src, str_len))
-     return EINA_TRUE;
-   else
-     return EINA_FALSE;
-}
-
 static int
 _e_devicemgr_input_pointer_warp(int x, int y)
 {
@@ -383,7 +367,7 @@ _e_devicemgr_input_device_update(Ecore_Device *dev)
      {
         if (data->clas == ecore_device_class_get(dev) && data->identifier)
           {
-             if (e_devicemgr_strcmp(dev_identifier, data->identifier))
+             if (!e_util_strcmp(dev_identifier, data->identifier))
                {
                   data->subclas = ecore_device_subclass_get(dev);
 
index 51d1132b7440b8a7c696d731b3447fb4ba0a7249..b7d5a567e479669f21279e7dad216a0b77f2f16b 100644 (file)
@@ -874,7 +874,7 @@ _e_devicemgr_inputgen_hw_device_check(E_Devicemgr_Inputgen_Device_Data *device)
    EINA_LIST_FOREACH(e_devicemgr->device_list, l, dev)
      {
         if ((dev->clas == clas) &&
-            (e_devicemgr_strcmp(dev->name, device->name)))
+            (!e_util_strcmp(dev->name, device->name)))
           {
              E_FREE(device->identifier);
              if (dev->identifier) device->identifier = strdup(dev->identifier);
@@ -1036,7 +1036,7 @@ e_devicemgr_inputgen_device_ready_send(E_Devicemgr_Input_Device *dev)
 
    EINA_LIST_FOREACH(e_devicemgr->inputgen.resource_list, l, rdata)
      {
-        if (e_devicemgr_strcmp(rdata->name, dev->name) == EINA_FALSE) continue;
+        if (!e_util_strcmp(rdata->name, dev->name) == EINA_FALSE) continue;
         if (rdata->sync_timer)
           {
              e_devicemgr_wl_generator_with_sync_send_event(rdata->resource, ret);
@@ -1168,7 +1168,7 @@ e_devicemgr_inputgen_generate_key(struct wl_client *client, struct wl_resource *
           {
              EINA_LIST_FOREACH_SAFE(ddata->key.pressed, l, l_next, name_data)
                {
-                  if (e_devicemgr_strcmp(name_data, keyname))
+                  if (!e_util_strcmp(name_data, keyname))
                     {
                        ddata->key.pressed = eina_list_remove_list(ddata->key.pressed, l);
                        eina_stringshare_del(name_data);
@@ -1398,7 +1398,7 @@ e_devicemgr_inputgen_get_device_info(E_Devicemgr_Input_Device *dev)
 
    EINA_LIST_FOREACH(*dev_list, l, ddata)
      {
-        if (e_devicemgr_strcmp(ddata->name, dev->name))
+        if (!e_util_strcmp(ddata->name, dev->name))
           {
              E_FREE(ddata->identifier);
              if (dev->identifier) ddata->identifier = strdup(dev->identifier);
index 5dd9960bf3c80348213c426f4f8b4ca48721cf3b..83b6cb6548d69affd41cc756d185bad3cc8e7627 100644 (file)
@@ -22,6 +22,4 @@
 EINTERN int e_devicemgr_init(void);
 EINTERN int e_devicemgr_shutdown(void);
 
-EINTERN Eina_Bool e_devicemgr_strcmp(const char *dst, const char *src);
-
 #endif