{
Eina_Content *content;
- if (!strncmp(type, "text", strlen("text")))
+ if (eina_str_has_prefix(type,"text"))
{
//last char in the mem must be \0
if (((char*)data.mem)[data.len - 1] != '\0')
if (sd->list)
{
- if (!strncmp(elm_object_style_get(obj), "default", strlen("default")))
+ if (eina_str_has_prefix(elm_object_style_get(obj),"default"))
elm_object_style_set(sd->list, "ctxpopup");
else
elm_object_style_set(sd->list, elm_object_style_get(obj));
if (!sd->list)
{
sd->list = elm_list_add(obj);
- if (!strncmp(elm_object_style_get(obj), "default", strlen("default")))
+ if (eina_str_has_prefix(elm_object_style_get(obj),"default"))
elm_object_style_set(sd->list, "ctxpopup");
else elm_object_style_set(sd->list, elm_object_style_get(obj));
elm_list_mode_set(sd->list, ELM_LIST_EXPAND);
Eina_Rw_Slice slice;
data = ecore_cocoa_clipboard_get(&size, mime_type);
- if (!strncmp(mime_type, "text", strlen("text")))
+ if (eina_str_has_prefix(mime_type,"text"))
{
//ensure that we always have a \0 at the end, there is no assertion that \0 is included here.
slice.len = size + 1;
//Now deliver the content
Eina_Slice slice;
- if (!strncmp(ready->mimetype, "text", strlen("text")))
+ if (eina_str_has_prefix(ready->mimetype,"text"))
{
//ensure that we always have a \0 at the end, there is no assertion that \0 is included here.
slice.len = ready->len + 1;
Eina_Content *result = NULL;
Eina_Stringshare *mime_type = _decrypt_type(edata->selection_data[selection].requested_type);
- if (!strncmp(mime_type, "text", strlen("text")))
+ if (eina_str_has_prefix(mime_type,"text"))
{
//ensure that we always have a \0 at the end, there is no assertion that \0 is included here.
void *null_terminated = eina_memdup(x11_data->data, x11_data->length, EINA_TRUE);
result = _create_deliveriy_content(x11_data->length + 1, null_terminated, mime_type);
free(null_terminated);
}
- else if (!strncmp(mime_type, "image", strlen("image")))
+ else if (eina_str_has_prefix(mime_type,"image"))
{
Eina_Content *tmp_container = eina_content_new((Eina_Slice){.len = x11_data->length, .mem = x11_data->data}, mime_type);
const char *file = eina_content_as_file(tmp_container);
content = eina_value_to_content(&value);
printf("Got Content of selection %d with type %s\n", buffer, eina_content_type_get(content));
- if (!strncmp(eina_content_type_get(content), "text", strlen("text")))
+ if (eina_str_has_prefix(eina_content_type_get(content),"text"))
{
printf("Content: %s\n", (char*)eina_content_data_get(content).mem);
}