Hi Gustavo,

I have a doubt here. I already implemented the use
of Eina_Value_Struct_Desc in our Emodel_Eio example. In prop_list I'm
returning, via EMODEL_EVENT_PROPERTIES_CHANGE, Eina_Value which must be
handled by the caller as Eina_Value_Struct, (it is a list of properties)
but it doesn't seem correct and I am thinking to make the API to return a
NULL-terminated array of strings instead.

What do you think?

[]s


On Wed, Jul 2, 2014 at 7:35 PM, Gustavo Sverzut Barbieri <barbi...@gmail.com
> wrote:

> On Tue, Jul 1, 2014 at 7:08 PM, Carlos Carvalho
> <ccarva...@expertisesolutions.com.br> wrote:
> > Hi gustavo,
> >
> > I'd like to talk a little bit about some points Larry told we are fixing
> OK.
>
> Great, will take some time to review the new code tomorrow. Some
> comments about your questions:
>
> > #10, now we have a loaded event, shouldn't we have 'unloaded' event as
> well
> > in Emodel?
>
> I guess so, unloaded event wouldn't hurt.
>
>
> > #11, I already started switching from simple eina array to
> > Eina_Value_Struct_Desc
> > in emodel_eio, however I don't know for sure if I got it. It may be
> leaner
> > to use Eina_Value_Struct_Desc but we don't have many items in that array
> of
> > properties it isn't much complex to deal with.
> > Anyways I am following the eina_value_02.c already but I'd like to know
> if
> > there are more implications about using Eina_Value_Struct_Desc instead of
> > eina_array because it is basically used only internally in emodel_eio.
>
> that's why, it shouldn't be harder and would consume less bytes per
> instance as the structure for each instance is smaller and the
> description is shared (as it's constant and equal to all instances).
>
> > #13.2. is now using eina_str_join. Agreed it is safer than using strncpy
> > and alike by hand although I had to read eina_str_join() implementation
> > (and it is nice to read code of course :)) to fully understand that the
> > parameter 'size' must be strlen(a)+strlen(b)+2, the '2' here is including
> > the separator character plus '\0' byte, if we miss that the result will
> be
> > truncated by NULL terminator.
> >
> > 'size' cannot simply be strlen(a)+strlen(b) and perhaps it should be
> > documented both in eina_str_join and eina_str_join_len.  What do you
> think?
> >
> > See:
> >
> > ---snip---
> >    char *str1 = "AAAA";
> >    char *str2 = "BBBB";
> >    size_t siz = strlen(str1)+strlen(str2);
> >    char *buf = calloc(1, siz);
> >    eina_str_join(buf, siz, '#', str1, str2);
> >    fprintf(stdout, "buf: %s\n", buf);
> >    free(buf);
> > ---snip---
> >
> > result is truncated:
> > ---snip---
> > buf: AAAA#BB
> > ---snip---
>
> great catch, add that to docs :-)
>
> (I often use a static buffer like "char buf[PATH_MAX]" and then use
> the result size to allocate + memcpy if needed, often it's not as it's
> a local usage, that's why I missed that in the docs)
>
>
>
> --
> Gustavo Sverzut Barbieri
> --------------------------------------
> Mobile: +55 (19) 99225-2202
> Contact: http://www.gustavobarbieri.com.br/contact
>
>
> ------------------------------------------------------------------------------
> Open source business process management suite built on Java and Eclipse
> Turn processes into business applications with Bonita BPM Community Edition
> Quickly connect people, data, and systems into organized workflows
> Winner of BOSSIE, CODIE, OW2 and Gartner awards
> http://p.sf.net/sfu/Bonitasoft
> _______________________________________________
> enlightenment-devel mailing list
> enlightenment-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
>



-- 
--
Expertise Solutions
------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to