Dear All,

Hi~
Here is the patch added on the elementary. :-]

Sincerely,
Shinwoo Kim.

2011/6/22 Hyoyoung Chang <hyoyoung.ch...@samsung.com>

> As I know strcasestr is not standard function.
> It's a glibc extension.
>
> CONFORMING TO
>       The  strstr() function conforms to C89 and C99.  The strcasestr()
> func‐
>       tion is a nonstandard extension.
> -- man page of strcasestr
>
> Is it only used in elementary? If then how about add to check routine in
> configure and add in elm_util.c?
> Or is it widely used in e project, it can be added in other module.
>
> PS. I google about strcasestr. It's contained in LSB 3.1
>
>
> http://refspecs.freestandards.org/LSB_3.1.1/LSB-Core-generic/LSB-Core-generi
> c/baselib-strcasestr.html
>
>
> > -----Original Message-----
> > From: cnook [mailto:kimci...@gmail.com]
> > Sent: Wednesday, June 22, 2011 5:56 PM
> > To: Daniel Juyung Seo
> > Cc: enlightenment-devel@lists.sourceforge.net
> > Subject: Re: [E-devel] [Patch][Evil] evil_string has strcasestr
> >
> > Dear Mr. Daniel,
> >
> > Thanks your response :-]
> > Initially, I had added this to the elm_entry in downstream(?), but a
> > reviewer does not prefer it in the elm_entry.
> > Then how about add this somewhere in Elementary?
> > um... btw... why I added this to Evil module is.. there is no strcasestr
> > on
> > MinGW Env. only.
> >
> >
> > Sincerely,
> > Shinwoo Kim.
> >
> >
> > 2011/6/22 Daniel Juyung Seo <seojuyu...@gmail.com>
> >
> > > Well..
> > > Dear Shinwoo Kim,
> > > According to vtorri's comment, you can merge this patch and another
> > > patch that uses this feature.
> > >
> > > Thanks.
> > >
> > > Daniel Juyung Seo (SeoZ)
> > >
> > > On Wed, Jun 22, 2011 at 4:53 PM, Vincent Torri <vto...@univ-evry.fr>
> > > wrote:
> > > >
> > > >
> > > > On Wed, 22 Jun 2011, cnook wrote:
> > > >
> > > >> Thanks for your response.
> > > >> There is a possibility in newly made elementary widget.
> > > >> So far, no one have used strcasestr in upstream.
> > > >
> > > > i won't add functions if they are not needed. Evil is minimalist and
> > must
> > > > remain like that. If strcasestr is needed, it will be added.
> > > >
> > > > Vincent
> > > >
> > > >>
> > > >> Sincerely,
> > > >> Shinwoo Kim.
> > > >>
> > > >> 2011/6/22 Vincent Torri <vto...@univ-evry.fr>
> > > >>
> > > >>>
> > > >>> Hey
> > > >>>
> > > >>>
> > > >>>  There is no strcasestr() on MinGW Env.
> > > >>>> So this patch comes.. Please review the attached one.
> > > >>>>
> > > >>>
> > > >>> where is strcasestr used ?
> > > >>>
> > > >>> Vincent
> > > >>>
> > > >>
> > > >
> > > >
> > >
> ------------------------------------------------------------------------
> > ------
> > > > Simplify data backup and recovery for your virtual environment with
> > > vRanger.
> > > > Installation's a snap, and flexible recovery options mean your data
> is
> > > safe,
> > > > secure and there when you need it. Data protection magic?
> > > > Nope - It's vRanger. Get your free trial download today.
> > > > http://p.sf.net/sfu/quest-sfdev2dev
> > > > _______________________________________________
> > > > enlightenment-devel mailing list
> > > > enlightenment-devel@lists.sourceforge.net
> > > > https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
> > > >
> > >
> >
> --------------------------------------------------------------------------
> > ----
> > Simplify data backup and recovery for your virtual environment with
> > vRanger.
> > Installation's a snap, and flexible recovery options mean your data is
> > safe,
> > secure and there when you need it. Data protection magic?
> > Nope - It's vRanger. Get your free trial download today.
> > http://p.sf.net/sfu/quest-sfdev2dev
> > _______________________________________________
> > enlightenment-devel mailing list
> > enlightenment-devel@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
>
>
Index: src/lib/elm_priv.h
===================================================================
--- src/lib/elm_priv.h	(revision 60744)
+++ src/lib/elm_priv.h	(working copy)
@@ -214,6 +214,7 @@
 
 char               *_elm_util_mkup_to_text(const char *mkup);
 char               *_elm_util_text_to_mkup(const char *text);
+char               *_elm_util_strcasestr(char *h, char *n);
 
 extern char        *_elm_appname;
 extern Elm_Config  *_elm_config;
Index: src/lib/elm_util.c
===================================================================
--- src/lib/elm_util.c	(revision 60744)
+++ src/lib/elm_util.c	(working copy)
@@ -196,3 +196,28 @@
      }
    return str;
 }
+
+char *
+_elm_util_strcasestr(char *h, char *n)
+{
+   char *a, *e;
+   a = h;
+   e = n;
+
+   if (!h || !*h || !n || !*n) return 0;
+   while (*a && *e)
+     {
+        if(toupper((unsigned char) *a) != toupper((unsigned char) *e))
+          {
+             ++h;
+             a = h;
+             e = n;
+          }
+        else
+          {
+             ++a;
+             ++e;
+          }
+     }
+   return *e ? 0 : h;
+}
Index: configure.ac
===================================================================
--- configure.ac	(revision 60744)
+++ configure.ac	(working copy)
@@ -175,6 +175,7 @@
       have_socket="yes"
       ;;
 esac
+AC_CHECK_FUNCS(strcasestr, AC_DEFINE(HAVE_STRCASESTR))
 AM_CONDITIONAL([BUILD_RUN], [test "x$have_socket" = "xyes"])
 
 have_fork="no"
------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to