utils: mv strchrnul() to utils.h from termptyesc.c

terminology-1.7
Boris Faure 3 years ago
parent 2bffe3c078
commit e6d3a848ef
Signed by: borisfaure
GPG Key ID: EAA9CD729F522998
  1. 17
      src/bin/termptyesc.c
  2. 18
      src/bin/utils.h

@ -3540,23 +3540,6 @@ _eina_unicode_to_hex(Eina_Unicode u)
return -1;
}
#if !defined(HAVE_STRCHRNUL)
char *
strchrnul(const char *s, int c)
{
const char *p = s;
while (*p)
{
if (*p == c)
return (char *)p;
++p;
}
return (char *) (p);
}
#endif
static int
_xterm_parse_color(Termpty *ty, Eina_Unicode **ptr,
unsigned char *r, unsigned char *g, unsigned char *b,

@ -17,6 +17,24 @@ Eina_Bool utils_need_scale_wizard(void);
#define casestartswith(str, constref) \
(!strncasecmp(str, constref, sizeof(constref) - 1))
#if !defined(HAVE_STRCHRNUL)
static inline char *
strchrnul(const char *s, int c)
{
const char *p = s;
while (*p)
{
if (*p == c)
return (char *)p;
++p;
}
return (char *) (p);
}
#endif
#if (ELM_VERSION_MAJOR == 1) && (ELM_VERSION_MINOR < 20)
# if __GNUC__ >= 7
# define EINA_FALLTHROUGH __attribute__ ((fallthrough));

Loading…
Cancel
Save