forked from enlightenment/efl
parent
2deea5a083
commit
45598b89bb
|
@ -11,7 +11,6 @@ libecore_la_SOURCES = \
|
|||
e_ev_x.c e_ev_x.h \
|
||||
e_events.c e_events.h \
|
||||
e_mem.h \
|
||||
e_str.c e_str.h \
|
||||
e_util.c e_util.h \
|
||||
e_x.c e_x.h
|
||||
|
||||
|
|
|
@ -217,7 +217,11 @@ e_ev_dnd_drop_request_free(void *event)
|
|||
|
||||
e = (Ev_Dnd_Drop_Request *) event;
|
||||
if (e->files)
|
||||
e_string_free_list(e->files, e->num_files);
|
||||
{
|
||||
int i;
|
||||
for (i=0; i< e->num_files; i++)
|
||||
FREE(e->files[i]);
|
||||
}
|
||||
FREE(event);
|
||||
}
|
||||
|
||||
|
@ -277,7 +281,7 @@ e_ev_x_handle_key_press(XEvent * xevent)
|
|||
if (val > 0)
|
||||
{
|
||||
buf[val] = 0;
|
||||
e->compose = e_string_dup(buf);
|
||||
e->compose = strdup(buf);
|
||||
}
|
||||
else
|
||||
e->compose = NULL;
|
||||
|
@ -315,7 +319,7 @@ e_ev_x_handle_key_release(XEvent * xevent)
|
|||
if (val > 0)
|
||||
{
|
||||
buf[val] = 0;
|
||||
e->compose = e_string_dup(buf);
|
||||
e->compose = strdup(buf);
|
||||
}
|
||||
else
|
||||
e->compose = NULL;
|
||||
|
@ -809,7 +813,7 @@ e_ev_x_handle_selection_notify(XEvent * xevent)
|
|||
}
|
||||
else
|
||||
e->files = NEW_PTR(e->num_files);
|
||||
e->files[e->num_files - 1] = e_string_dup(buf);
|
||||
e->files[e->num_files - 1] = strdup(buf);
|
||||
buf[0] = 0;
|
||||
i = 0;
|
||||
is++;
|
||||
|
@ -1013,17 +1017,17 @@ char *
|
|||
e_key_press_translate_into_typeable(Ev_Key_Down * e)
|
||||
{
|
||||
/* exceptions */
|
||||
if ((e_string_cmp(e->key, "Delete")) ||
|
||||
(e_string_cmp(e->key, "BackSpace")) ||
|
||||
(e_string_cmp(e->key, "Tab")) ||
|
||||
(e_string_cmp(e->key, "Escape")) ||
|
||||
(e_string_cmp(e->key, "Return")) ||
|
||||
(e_string_cmp(e->key, "KP_Enter")) ||
|
||||
(e_string_cmp(e->key, "Enter")) ||
|
||||
(e_string_cmp(e->key, "KP_Divide")) ||
|
||||
(e_string_cmp(e->key, "KP_Multiply")) ||
|
||||
(e_string_cmp(e->key, "KP_Subtract")) ||
|
||||
(e_string_cmp(e->key, "KP_Add")) || (e_string_cmp(e->key, "Enter")))
|
||||
if ((!strcmp(e->key, "Delete")) ||
|
||||
(!strcmp(e->key, "BackSpace")) ||
|
||||
(!strcmp(e->key, "Tab")) ||
|
||||
(!strcmp(e->key, "Escape")) ||
|
||||
(!strcmp(e->key, "Return")) ||
|
||||
(!strcmp(e->key, "KP_Enter")) ||
|
||||
(!strcmp(e->key, "Enter")) ||
|
||||
(!strcmp(e->key, "KP_Divide")) ||
|
||||
(!strcmp(e->key, "KP_Multiply")) ||
|
||||
(!strcmp(e->key, "KP_Subtract")) ||
|
||||
(!strcmp(e->key, "KP_Add")) || (!strcmp(e->key, "Enter")))
|
||||
return NULL;
|
||||
return e->compose;
|
||||
}
|
||||
|
|
|
@ -314,7 +314,7 @@ e_add_event_timer(char *name, double in, void (*func) (int val, void *data),
|
|||
timer->val = val;
|
||||
timer->just_added = 1;
|
||||
timer->in = in;
|
||||
timer->name = e_string_dup(name);
|
||||
timer->name = strdup(name);
|
||||
if (!timers)
|
||||
timers = timer;
|
||||
else
|
||||
|
@ -360,7 +360,7 @@ e_del_event_timer(char *name)
|
|||
while (ptr)
|
||||
{
|
||||
timer = ptr;
|
||||
if (e_string_cmp(timer->name, name))
|
||||
if (strcmp(timer->name, name))
|
||||
{
|
||||
void *data;
|
||||
|
||||
|
|
|
@ -1,151 +0,0 @@
|
|||
#include "e_str.h"
|
||||
#include "e_mem.h"
|
||||
|
||||
/* string manipulation conveience calls */
|
||||
|
||||
void
|
||||
e_string_free_list(char **slist, int num)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < num; i++)
|
||||
FREE(slist[i]);
|
||||
FREE(slist);
|
||||
}
|
||||
|
||||
char *
|
||||
e_string_dup(char *str)
|
||||
{
|
||||
if (!str)
|
||||
return NULL;
|
||||
return strdup(str);
|
||||
}
|
||||
|
||||
int
|
||||
e_string_cmp(char *s1, char *s2)
|
||||
{
|
||||
if ((!s1) || (!s2))
|
||||
return 0;
|
||||
if (!strcmp(s1, s2))
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
e_string_case_cmp(char *s1, char *s2)
|
||||
{
|
||||
if ((!s1) || (!s2))
|
||||
return 0;
|
||||
if (!strcasecmp(s1, s2))
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
e_string_length(char *str)
|
||||
{
|
||||
return strlen(str);
|
||||
}
|
||||
|
||||
void
|
||||
e_string_clear(char *str)
|
||||
{
|
||||
str[0] = 0;
|
||||
}
|
||||
|
||||
void
|
||||
e_string_cat(char *str, char *cat)
|
||||
{
|
||||
strcat(str, cat);
|
||||
}
|
||||
|
||||
void
|
||||
e_string_cat_n(char *str, char *cat, int start, int len)
|
||||
{
|
||||
strncat(str, &(cat[start]), len);
|
||||
}
|
||||
|
||||
char *
|
||||
e_string_escape(char *str)
|
||||
{
|
||||
char buf[8192];
|
||||
int i, j, len;
|
||||
|
||||
e_string_clear(buf);
|
||||
len = e_string_length(str);
|
||||
for (i = 0, j = 0; i < len; i++)
|
||||
{
|
||||
switch (str[i])
|
||||
{
|
||||
case ' ':
|
||||
case '"':
|
||||
case '\'':
|
||||
case '\\':
|
||||
case '(':
|
||||
case ')':
|
||||
case '[':
|
||||
case ']':
|
||||
case '$':
|
||||
case '`':
|
||||
case '~':
|
||||
case '!':
|
||||
case '#':
|
||||
case '&':
|
||||
case '*':
|
||||
case '?':
|
||||
case '|':
|
||||
case ';':
|
||||
case '<':
|
||||
case '>':
|
||||
buf[j++] = '\\';
|
||||
buf[j++] = str[i];
|
||||
break;
|
||||
default:
|
||||
buf[j++] = str[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
buf[j] = 0;
|
||||
return e_string_dup(buf);
|
||||
}
|
||||
|
||||
char *
|
||||
e_string_build(char *format, char **rep_list, int rep_num)
|
||||
{
|
||||
char buf[16384], *s;
|
||||
int i;
|
||||
|
||||
e_string_clear(buf);
|
||||
s = format;
|
||||
i = 0;
|
||||
while (*s)
|
||||
{
|
||||
if (s[0] == '%')
|
||||
{
|
||||
if (s[1] == '%')
|
||||
e_string_cat(buf, "%");
|
||||
else
|
||||
{
|
||||
int j;
|
||||
|
||||
for (j = 0; j < rep_num; j += 2)
|
||||
{
|
||||
if (s[1] == rep_list[j][0])
|
||||
{
|
||||
char *ss;
|
||||
|
||||
ss = e_string_escape(rep_list[j + 1]);
|
||||
e_string_cat(buf, ss);
|
||||
FREE(ss);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
s++;
|
||||
}
|
||||
else
|
||||
strncat(buf, s, 1);
|
||||
s++;
|
||||
}
|
||||
return e_string_dup(buf);
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
#ifndef E_STR_H
|
||||
#define E_STR_H 1
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
void e_string_free_list(char **slist, int num);
|
||||
char *e_string_dup(char *str);
|
||||
int e_string_cmp(char *s1, char *s2);
|
||||
int e_string_case_cmp(char *s1, char *s2);
|
||||
int e_string_length(char *str);
|
||||
void e_string_clear(char *str);
|
||||
void e_string_cat(char *str, char *cat);
|
||||
void e_string_cat_n(char *str, char *cat, int start, int len);
|
||||
char *e_string_escape(char *str);
|
||||
char *e_string_build(char *format, char **rep_list, int rep_num);
|
||||
|
||||
#endif
|
|
@ -625,7 +625,7 @@ e_key_get_keysym_from_keycode(KeyCode keycode)
|
|||
char *
|
||||
e_key_get_string_from_keycode(KeyCode keycode)
|
||||
{
|
||||
return e_string_dup(XKeysymToString(e_key_get_keysym_from_keycode(keycode)));
|
||||
return strdup(XKeysymToString(e_key_get_keysym_from_keycode(keycode)));
|
||||
}
|
||||
|
||||
void
|
||||
|
|
Loading…
Reference in New Issue