Re: [E-devel] E SVN: discomfitor trunk/eina/src/lib

2011-04-14 Thread Vincent Torri


On Thu, 14 Apr 2011, Enlightenment SVN wrote:

> Log:
> unrevert. this is not a mistake.

explain me why it can segfault, then

Vincent

>
>
> Author:   discomfitor
> Date: 2011-04-14 00:42:04 -0700 (Thu, 14 Apr 2011)
> New Revision: 58654
> Trac: http://trac.enlightenment.org/e/changeset/58654
>
> Modified:
>  trunk/eina/src/lib/eina_list.c
>
> Modified: trunk/eina/src/lib/eina_list.c
> ===
> --- trunk/eina/src/lib/eina_list.c2011-04-14 07:40:45 UTC (rev 58653)
> +++ trunk/eina/src/lib/eina_list.c2011-04-14 07:42:04 UTC (rev 58654)
> @@ -894,7 +894,7 @@
>EINA_SAFETY_ON_NULL_RETURN_VAL(to, EINA_FALSE);
>EINA_SAFETY_ON_NULL_RETURN_VAL(from, EINA_FALSE);
>
> -   EINA_MAGIC_CHECK_LIST(*to, EINA_FALSE);
> +   if (*to) EINA_MAGIC_CHECK_LIST(*to, EINA_FALSE);
>EINA_MAGIC_CHECK_LIST(*from, EINA_FALSE);
>EINA_MAGIC_CHECK_LIST(data, EINA_FALSE);
>
>
>
> --
> Benefiting from Server Virtualization: Beyond Initial Workload
> Consolidation -- Increasing the use of server virtualization is a top
> priority.Virtualization can reduce costs, simplify management, and improve
> application availability and disaster protection. Learn more about boosting
> the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
> ___
> enlightenment-svn mailing list
> enlightenment-...@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/enlightenment-svn
>
>

--
Benefiting from Server Virtualization: Beyond Initial Workload 
Consolidation -- Increasing the use of server virtualization is a top
priority.Virtualization can reduce costs, simplify management, and improve 
application availability and disaster protection. Learn more about boosting 
the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] E SVN: discomfitor trunk/eina/src/lib

2011-04-14 Thread Vincent Torri


On Thu, 14 Apr 2011, Vincent Torri wrote:

>
>
> On Thu, 14 Apr 2011, Enlightenment SVN wrote:
>
>> Log:
>> unrevert. this is not a mistake.

with your commit, the code below fails silently, without it, you have the 
error:


CRI<4620>: eina_list.c:880 eina_list_move() *** Eina Magic Check Failed 
!!!
 Input handle pointer is NULL !
*** NAUGHTY PROGRAMMER!!!
*** SPANK SPANK SPANK!!!
*** Now go fix your code. Tut tut tut!


which is exactly what should happend.

so explain me why you still want to check *to

Vincent

#include 
#include 

int main()
{
   Eina_List *l = NULL;
   Eina_List *ll = NULL;
   int i = 4;
   Eina_Bool res;

   eina_init();

   l = eina_list_append(l, &i);
   res = eina_list_move(&ll, &l, &i);
   printf("res : %d\n", res);
   eina_shutdown();

   return 0;
}


>
> explain me why it can segfault, then
>
> Vincent
>
>> 
>> 
>> Author:   discomfitor
>> Date: 2011-04-14 00:42:04 -0700 (Thu, 14 Apr 2011)
>> New Revision: 58654
>> Trac: http://trac.enlightenment.org/e/changeset/58654
>> 
>> Modified:
>>  trunk/eina/src/lib/eina_list.c
>> 
>> Modified: trunk/eina/src/lib/eina_list.c
>> ===
>> --- trunk/eina/src/lib/eina_list.c   2011-04-14 07:40:45 UTC (rev 58653)
>> +++ trunk/eina/src/lib/eina_list.c   2011-04-14 07:42:04 UTC (rev 58654)
>> @@ -894,7 +894,7 @@
>>EINA_SAFETY_ON_NULL_RETURN_VAL(to, EINA_FALSE);
>>EINA_SAFETY_ON_NULL_RETURN_VAL(from, EINA_FALSE);
>> 
>> -   EINA_MAGIC_CHECK_LIST(*to, EINA_FALSE);
>> +   if (*to) EINA_MAGIC_CHECK_LIST(*to, EINA_FALSE);
>>EINA_MAGIC_CHECK_LIST(*from, EINA_FALSE);
>>EINA_MAGIC_CHECK_LIST(data, EINA_FALSE);
>> 
>> 
>>
>> 
>> --
>> Benefiting from Server Virtualization: Beyond Initial Workload
>> Consolidation -- Increasing the use of server virtualization is a top
>> priority.Virtualization can reduce costs, simplify management, and improve
>> application availability and disaster protection. Learn more about boosting
>> the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
>> ___
>> enlightenment-svn mailing list
>> enlightenment-...@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/enlightenment-svn
>> 
>> 
>

--
Benefiting from Server Virtualization: Beyond Initial Workload 
Consolidation -- Increasing the use of server virtualization is a top
priority.Virtualization can reduce costs, simplify management, and improve 
application availability and disaster protection. Learn more about boosting 
the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] E SVN: discomfitor trunk/eina/src/lib

2011-04-14 Thread Cedric BAIL
On Thu, Apr 14, 2011 at 10:18 AM, Vincent Torri  wrote:
> On Thu, 14 Apr 2011, Enlightenment SVN wrote:
>> Log:
>> unrevert. this is not a mistake.
>
> explain me why it can segfault, then

I think Vincent is right. I don't see how moving a list to an unvalid
position could be considered good behaviour in the calling code. Seems
to me like a way to hide bug. Please explain.
-- 
Cedric BAIL

--
Benefiting from Server Virtualization: Beyond Initial Workload 
Consolidation -- Increasing the use of server virtualization is a top
priority.Virtualization can reduce costs, simplify management, and improve 
application availability and disaster protection. Learn more about boosting 
the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] E SVN: raster IN trunk/elementary: data/images src/bin src/lib

2011-04-14 Thread Daniel Juyung Seo
Wow!
This is awesome!

Good to know that one need to "svn up" evas to test this.
And run
$ elementary_test "Window Inline".

Thanks.
Daniel Juyung Seo (SeoZ)

On Thu, Apr 14, 2011 at 7:48 PM, Enlightenment SVN <
no-re...@enlightenment.org> wrote:

> Log:
> mm new widget options/modes for win... u can put a window..
>  INLINED in another window. :) it's an image object. have fun!
>
>
>
> Author:   raster
> Date: 2011-04-14 03:48:43 -0700 (Thu, 14 Apr 2011)
> New Revision: 58657
> Trac: http://trac.enlightenment.org/e/changeset/58657
>
> Added:
>  trunk/elementary/data/images/pt.png
> trunk/elementary/src/bin/test_win_inline.c
> Modified:
>  trunk/elementary/data/images/Makefile.am
> trunk/elementary/src/bin/Makefile.am trunk/elementary/src/bin/test.c
> trunk/elementary/src/lib/Elementary.h.intrunk/elementary/src/lib/elm_cnp_helper.c
> trunk/elementary/src/lib/elm_conform.c trunk/elementary/src/lib/elm_entry.c
> trunk/elementary/src/lib/elm_win.c
>
> Modified: trunk/elementary/data/images/Makefile.am
> ===
> --- trunk/elementary/data/images/Makefile.am2011-04-14 10:47:40 UTC
> (rev 58656)
> +++ trunk/elementary/data/images/Makefile.am2011-04-14 10:48:43 UTC
> (rev 58657)
> @@ -42,6 +42,7 @@
>  bubble.png \
>  bubble_sh.png \
>  mystrale.jpg \
> -mystrale_2.jpg
> +mystrale_2.jpg \
> +pt.png
>
>  EXTRA_DIST = $(files_DATA)
>
>
> Property changes on: trunk/elementary/data/images/pt.png
> ___
> Added: svn:mime-type
>   + application/octet-stream
>
> Modified: trunk/elementary/src/bin/Makefile.am
> ===
> --- trunk/elementary/src/bin/Makefile.am2011-04-14 10:47:40 UTC
> (rev 58656)
> +++ trunk/elementary/src/bin/Makefile.am2011-04-14 10:48:43 UTC
> (rev 58657)
> @@ -95,7 +95,8 @@
>  test_ctxpopup.c \
>  test_bubble.c \
>  test_segment_control.c \
> -test_store.c
> +test_store.c \
> +test_win_inline.c
>
>  elementary_test_LDADD = $(top_builddir)/src/lib/libelementary.la \
>@ELEMENTARY_EWEATHER_LIBS@ \
>
> Modified: trunk/elementary/src/bin/test.c
> ===
> --- trunk/elementary/src/bin/test.c 2011-04-14 10:47:40 UTC (rev 58656)
> +++ trunk/elementary/src/bin/test.c 2011-04-14 10:48:43 UTC (rev 58657)
> @@ -122,6 +122,7 @@
>  void test_bubble(void *data, Evas_Object *obj, void *event_info);
>  void test_segment_control(void *data, Evas_Object *obj, void *event_info);
>  void test_store(void *data, Evas_Object *obj, void *event_info);
> +void test_win_inline(void *data, Evas_Object *obj, void *event_info);
>
>  struct elm_test
>  {
> @@ -376,6 +377,7 @@
>ADD_TEST("Bubble", test_bubble);
>ADD_TEST("Segment Control", test_segment_control);
>ADD_TEST("Store", test_store);
> +   ADD_TEST("Window Inline", test_win_inline);
>  #undef ADD_TEST
>
>if (autorun)
>
> Modified: trunk/elementary/src/lib/Elementary.h.in
> ===
> --- trunk/elementary/src/lib/Elementary.h.in2011-04-14 10:47:40 UTC
> (rev 58656)
> +++ trunk/elementary/src/lib/Elementary.h.in2011-04-14 10:48:43 UTC
> (rev 58657)
> @@ -468,7 +468,11 @@
> ELM_WIN_TOOLTIP,
> ELM_WIN_NOTIFICATION,
> ELM_WIN_COMBO,
> -ELM_WIN_DND
> +ELM_WIN_DND,
> +
> +ELM_WIN_INLINED, // YYY: not implemented yet
> +ELM_WIN_INLINED_IMAGE,
> +ELM_WIN_MEMORY // YYY: not implemented yet
>  } Elm_Win_Type;
>
>typedef enum _Elm_Win_Keyboard_Mode
> @@ -544,6 +548,7 @@
>EAPI int  elm_win_quickpanel_zone_get(const Evas_Object *obj)
> EINA_ARG_NONNULL(1);
>EAPI void elm_win_prop_focus_skip_set(Evas_Object *obj,
> Eina_Bool skip); EINA_ARG_NONNULL(1);
>EAPI void elm_win_illume_command_send(Evas_Object *obj,
> Elm_Illume_Command command, void *params); EINA_ARG_NONNULL(1);
> +   EAPI Evas_Object *elm_win_inlined_image_object_get(Evas_Object *obj);
>EAPI void elm_win_focus_highlight_enabled_set(Evas_Object *obj,
> Eina_Bool enabled) EINA_ARG_NONNULL(1);
>EAPI Eina_Boolelm_win_focus_highlight_enabled_get(const Evas_Object
> *obj) EINA_ARG_NONNULL(1);
>EAPI void elm_win_focus_highlight_style_set(Evas_Object *obj,
> const char *style) EINA_ARG_NONNULL(1);
>
> Modified: trunk/elementary/src/lib/elm_cnp_helper.c
> ===
> --- trunk/elementary/src/lib/elm_cnp_helper.c   2011-04-14 10:47:40 UTC
> (rev 58656)
> +++ trunk/elementary/src/lib/elm_cnp_helper.c   2011-04-14 10:48:43 UTC
> (rev 58657)
> @@ -410,8 +410,11 @@
>  elm_selection_set(Elm_Sel_Type selection, Evas_Object *widget,
> Elm_Sel_Format format, const char *selbuf)
>  {
>  #ifdef HAVE_ELEMENTARY_X
> +   Evas_Object *top = elm_widget_top_get(widget);
> +

Re: [E-devel] E SVN: cedric IN trunk: e e_dbus ecore edje eet eeze efreet eina eio elementary emotion ethumb evas

2011-04-14 Thread Daniel Juyung Seo
Fixed! Thanks!

*Daniel gives cedric HEAVY SPANK!
Btw, it was a very quick fix.

Thanks.
Daniel Juyung Seo (SeoZ)

On Thu, Apr 14, 2011 at 11:51 PM, Enlightenment SVN <
no-re...@enlightenment.org> wrote:

> Log:
> autogen: unobrk things.
>
>
> Author:   cedric
> Date: 2011-04-14 07:51:36 -0700 (Thu, 14 Apr 2011)
> New Revision: 58668
> Trac: http://trac.enlightenment.org/e/changeset/58668
>
> Modified:
>  trunk/e/autogen.sh trunk/e_dbus/autogen.sh trunk/ecore/autogen.sh
> trunk/edje/autogen.sh trunk/eet/autogen.sh trunk/eeze/autogen.sh
> trunk/efreet/autogen.sh trunk/eina/autogen.sh trunk/eio/autogen.sh
> trunk/elementary/autogen.sh trunk/emotion/autogen.sh trunk/ethumb/autogen.sh
> trunk/evas/autogen.sh
>
> Modified: trunk/e/autogen.sh
> ===
> --- trunk/e/autogen.sh  2011-04-14 14:03:46 UTC (rev 58667)
> +++ trunk/e/autogen.sh  2011-04-14 14:51:36 UTC (rev 58668)
> @@ -1,5 +1,8 @@
>  #!/bin/sh
>
> +touch README
> +touch ABOUT-NLS
> +
>  echo "Running aclocal..." ; aclocal $ACLOCAL_FLAGS -I m4 || exit 1
>  echo "Running autoheader..." ; autoheader || exit 1
>  echo "Running autoconf..." ; autoconf || exit 1
>
> Modified: trunk/e_dbus/autogen.sh
> ===
> --- trunk/e_dbus/autogen.sh 2011-04-14 14:03:46 UTC (rev 58667)
> +++ trunk/e_dbus/autogen.sh 2011-04-14 14:51:36 UTC (rev 58668)
> @@ -1,5 +1,8 @@
>  #!/bin/sh
>
> +touch README
> +touch ABOUT-NLS
> +
>  echo "Running aclocal..." ; aclocal $ACLOCAL_FLAGS -I m4 || exit 1
>  echo "Running autoheader..." ; autoheader || exit 1
>  echo "Running autoconf..." ; autoconf || exit 1
>
> Modified: trunk/ecore/autogen.sh
> ===
> --- trunk/ecore/autogen.sh  2011-04-14 14:03:46 UTC (rev 58667)
> +++ trunk/ecore/autogen.sh  2011-04-14 14:51:36 UTC (rev 58668)
> @@ -1,5 +1,8 @@
>  #!/bin/sh
>
> +touch README
> +touch ABOUT-NLS
> +
>  echo "Running aclocal..." ; aclocal $ACLOCAL_FLAGS -I m4 || exit 1
>  echo "Running autoheader..." ; autoheader || exit 1
>  echo "Running autoconf..." ; autoconf || exit 1
>
> Modified: trunk/edje/autogen.sh
> ===
> --- trunk/edje/autogen.sh   2011-04-14 14:03:46 UTC (rev 58667)
> +++ trunk/edje/autogen.sh   2011-04-14 14:51:36 UTC (rev 58668)
> @@ -1,5 +1,8 @@
>  #!/bin/sh
>
> +touch README
> +touch ABOUT-NLS
> +
>  echo "Running aclocal..." ; aclocal $ACLOCAL_FLAGS -I m4 || exit 1
>  echo "Running autoheader..." ; autoheader || exit 1
>  echo "Running autoconf..." ; autoconf || exit 1
>
> Modified: trunk/eet/autogen.sh
> ===
> --- trunk/eet/autogen.sh2011-04-14 14:03:46 UTC (rev 58667)
> +++ trunk/eet/autogen.sh2011-04-14 14:51:36 UTC (rev 58668)
> @@ -1,5 +1,8 @@
>  #!/bin/sh
>
> +touch README
> +touch ABOUT-NLS
> +
>  echo "Running aclocal..." ; aclocal $ACLOCAL_FLAGS -I m4 || exit 1
>  echo "Running autoheader..." ; autoheader || exit 1
>  echo "Running autoconf..." ; autoconf || exit 1
>
> Modified: trunk/eeze/autogen.sh
> ===
> --- trunk/eeze/autogen.sh   2011-04-14 14:03:46 UTC (rev 58667)
> +++ trunk/eeze/autogen.sh   2011-04-14 14:51:36 UTC (rev 58668)
> @@ -1,5 +1,8 @@
>  #!/bin/sh
>
> +touch README
> +touch ABOUT-NLS
> +
>  echo "Running aclocal..." ; aclocal $ACLOCAL_FLAGS -I m4 || exit 1
>  echo "Running autoheader..." ; autoheader || exit 1
>  echo "Running autoconf..." ; autoconf || exit 1
>
> Modified: trunk/efreet/autogen.sh
> ===
> --- trunk/efreet/autogen.sh 2011-04-14 14:03:46 UTC (rev 58667)
> +++ trunk/efreet/autogen.sh 2011-04-14 14:51:36 UTC (rev 58668)
> @@ -1,5 +1,8 @@
>  #!/bin/sh
>
> +touch README
> +touch ABOUT-NLS
> +
>  echo "Running aclocal..." ; aclocal $ACLOCAL_FLAGS -I m4 || exit 1
>  echo "Running autoheader..." ; autoheader || exit 1
>  echo "Running autoconf..." ; autoconf || exit 1
>
> Modified: trunk/eina/autogen.sh
> ===
> --- trunk/eina/autogen.sh   2011-04-14 14:03:46 UTC (rev 58667)
> +++ trunk/eina/autogen.sh   2011-04-14 14:51:36 UTC (rev 58668)
> @@ -1,5 +1,8 @@
>  #!/bin/sh
>
> +touch README
> +touch ABOUT-NLS
> +
>  echo "Running aclocal..." ; aclocal $ACLOCAL_FLAGS -I m4 || exit 1
>  echo "Running autoheader..." ; autoheader || exit 1
>  echo "Running autoconf..." ; autoconf || exit 1
>
> Modified: trunk/eio/autogen.sh
> ===
> --- trunk/eio/autogen.sh2011-04-14 14:03:46 UTC (rev 58667)
> +++ trunk/eio/autogen.sh2011-04-14 14:51:36 UTC (rev 58668)
> @@ -1,5 +1,8 @@
>  #!/bin/sh
>
> +touch README
> +touch ABOUT-NLS
> +
>  echo "Ru

Re: [E-devel] E SVN: cedric IN trunk/eina: . src/include src/lib

2011-04-14 Thread Vincent Torri


eina_file_size_get() returns an unsigned_long, but on Win64, it's of size 
32 bits. Can't you return a uint_64_t ?

Vincent

On Wed, 13 Apr 2011, Enlightenment SVN wrote:

> Log:
> eina: add Eina_File API.
>
>  NOTE: the purpose of this API is to replace mmap user in the
>  EFL, share cache and more code across them. The potential user
>  are eet, evas, efreet, eio and enlil. More patch are needed for
>  them to use this infra. Help welcome :-)
>
>  NOTE2: this API also need more test and is waiting for some
>  more pthread infra before being thread safe. But at the end
>  it will be thread safe if eina thread safety is requested.
>
>
> Author:   cedric
> Date: 2011-04-13 09:15:30 -0700 (Wed, 13 Apr 2011)
> New Revision: 58637
> Trac: http://trac.enlightenment.org/e/changeset/58637
>
> Modified:
>  trunk/eina/ChangeLog trunk/eina/src/include/eina_file.h 
> trunk/eina/src/lib/eina_file.c trunk/eina/src/lib/eina_main.c
>
> Modified: trunk/eina/ChangeLog
> ===
> --- trunk/eina/ChangeLog  2011-04-13 13:29:54 UTC (rev 58636)
> +++ trunk/eina/ChangeLog  2011-04-13 16:15:30 UTC (rev 58637)
> @@ -47,3 +47,8 @@
>   * Add eina_inlist_sort.
>   * Add eina_mempool_repack.
>   * Add Eina_Object API.
> +
> +2011-05-13  Cedric Bail & Vincent Torri
> +
> + * Add Eina_File API.
> +
>
> Modified: trunk/eina/src/include/eina_file.h
> ===
> --- trunk/eina/src/include/eina_file.h2011-04-13 13:29:54 UTC (rev 
> 58636)
> +++ trunk/eina/src/include/eina_file.h2011-04-13 16:15:30 UTC (rev 
> 58637)
> @@ -81,6 +81,15 @@
>   EINA_FILE_WHT  /**< Whiteout file type (unused on Windows). */
> } Eina_File_Type;
>
> +typedef struct _Eina_File Eina_File;
> +
> +typedef enum {
> +  EINA_FILE_RANDOM, /**< Advise random memory access to the mapped 
> memory. */
> +  EINA_FILE_SEQUENTIAL, /**< Advise sequential memory access to the mapped 
> memory. */
> +  EINA_FILE_WILLNEED,   /**< Advise need for all the mapped memory. */
> +  EINA_FILE_POPULATE/**< Request all the mapped memory. */
> +} Eina_File_Populate;
> +
> /* Why do this? Well PATH_MAX may vary from when eina itself is compiled
>  * to when the app using eina is compiled. exposing the path buffer below
>  * cant safely and portably vary based on how/when you compile. it should
> @@ -239,6 +248,82 @@
> EAPI Eina_Iterator *eina_file_direct_ls(const char *dir) 
> EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
>
> /**
> + * @brief Get a read-only handler to a file.
> + *
> + * @param name Filename to open
> + * @param shared Requested a shm
> + *
> + * The file are only open in read only mode. Name should be an absolute path 
> to
> + * prevent cache mistake. A handler could be shared among multiple instance 
> and
> + * will be correctly refcounted. File are automatically closed on exec.
> + */
> +EAPI Eina_File *eina_file_open(const char *name, Eina_Bool shared) 
> EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
> +
> +/**
> + * @brief Unref file handler.
> + *
> + * @param file File handler to unref.
> + *
> + * This doesn't close the file, it will remain open until it leave the cache.
> + */
> +EAPI void eina_file_close(Eina_File *file);
> +
> +/**
> + * @brief Get file size at open time.
> + *
> + * @param file The file handler to request the size from.
> + * @return The length of the file.
> + */
> +EAPI unsigned long int eina_file_size_get(Eina_File *file);
> +
> +/**
> + * @brief Get the last modification time of an open file.
> + *
> + * @param file The file handler to request the modification time from.
> + * @return The last modification time.
> + */
> +EAPI time_t eina_file_mtime_get(Eina_File *file);
> +
> +/**
> + * @brief Get the filename of an open file.
> + *
> + * @param file The file handler to request the name from.
> + * @return Stringshared filename of the file.
> + */
> +EAPI const char *eina_file_filename_get(Eina_File *file);
> +
> +/**
> + * @brief Map all the file to a buffer.
> + *
> + * @param file The file handler to map in memory
> + * @param rule The rule to apply to the mapped memory
> + * @return A pointer to a buffer that map all the file content. @c NULL if 
> it fail.
> + */
> +EAPI void *eina_file_map_all(Eina_File *file, Eina_File_Populate rule);
> +
> +/**
> + * @brief Map a part of the file.
> + *
> + * @param file The file handler to map in memory
> + * @param rule The rule to apply to the mapped memory
> + * @param offset The offset inside the file
> + * @param length The length of the memory to map
> + * @return A valid pointer to the system memory with @p length valid byte in 
> it. And @c NULL if not inside the file or anything else goes wrong.
> + *
> + * This does handle refcounting so it will share map that target the same 
> memory area.
> + */
> +EAPI void *eina_file_map_new(Eina_File *file, Eina_File_Populate rule,
> + 

Re: [E-devel] E SVN: cedric IN trunk/eina: . src/include src/lib

2011-04-14 Thread Vincent Torri


On Thu, 14 Apr 2011, Vincent Torri wrote:

>
>
> eina_file_size_get() returns an unsigned_long, but on Win64, it's of size
> 32 bits. Can't you return a uint_64_t ?

or size_t ?

>
> Vincent
>
> On Wed, 13 Apr 2011, Enlightenment SVN wrote:
>
>> Log:
>> eina: add Eina_File API.
>>
>>  NOTE: the purpose of this API is to replace mmap user in the
>>  EFL, share cache and more code across them. The potential user
>>  are eet, evas, efreet, eio and enlil. More patch are needed for
>>  them to use this infra. Help welcome :-)
>>
>>  NOTE2: this API also need more test and is waiting for some
>>  more pthread infra before being thread safe. But at the end
>>  it will be thread safe if eina thread safety is requested.
>>
>>
>> Author:   cedric
>> Date: 2011-04-13 09:15:30 -0700 (Wed, 13 Apr 2011)
>> New Revision: 58637
>> Trac: http://trac.enlightenment.org/e/changeset/58637
>>
>> Modified:
>>  trunk/eina/ChangeLog trunk/eina/src/include/eina_file.h 
>> trunk/eina/src/lib/eina_file.c trunk/eina/src/lib/eina_main.c
>>
>> Modified: trunk/eina/ChangeLog
>> ===
>> --- trunk/eina/ChangeLog 2011-04-13 13:29:54 UTC (rev 58636)
>> +++ trunk/eina/ChangeLog 2011-04-13 16:15:30 UTC (rev 58637)
>> @@ -47,3 +47,8 @@
>>  * Add eina_inlist_sort.
>>  * Add eina_mempool_repack.
>>  * Add Eina_Object API.
>> +
>> +2011-05-13  Cedric Bail & Vincent Torri
>> +
>> +* Add Eina_File API.
>> +
>>
>> Modified: trunk/eina/src/include/eina_file.h
>> ===
>> --- trunk/eina/src/include/eina_file.h   2011-04-13 13:29:54 UTC (rev 
>> 58636)
>> +++ trunk/eina/src/include/eina_file.h   2011-04-13 16:15:30 UTC (rev 
>> 58637)
>> @@ -81,6 +81,15 @@
>>   EINA_FILE_WHT  /**< Whiteout file type (unused on Windows). */
>> } Eina_File_Type;
>>
>> +typedef struct _Eina_File Eina_File;
>> +
>> +typedef enum {
>> +  EINA_FILE_RANDOM, /**< Advise random memory access to the mapped 
>> memory. */
>> +  EINA_FILE_SEQUENTIAL, /**< Advise sequential memory access to the mapped 
>> memory. */
>> +  EINA_FILE_WILLNEED,   /**< Advise need for all the mapped memory. */
>> +  EINA_FILE_POPULATE/**< Request all the mapped memory. */
>> +} Eina_File_Populate;
>> +
>> /* Why do this? Well PATH_MAX may vary from when eina itself is compiled
>>  * to when the app using eina is compiled. exposing the path buffer below
>>  * cant safely and portably vary based on how/when you compile. it should
>> @@ -239,6 +248,82 @@
>> EAPI Eina_Iterator *eina_file_direct_ls(const char *dir) 
>> EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
>>
>> /**
>> + * @brief Get a read-only handler to a file.
>> + *
>> + * @param name Filename to open
>> + * @param shared Requested a shm
>> + *
>> + * The file are only open in read only mode. Name should be an absolute 
>> path to
>> + * prevent cache mistake. A handler could be shared among multiple instance 
>> and
>> + * will be correctly refcounted. File are automatically closed on exec.
>> + */
>> +EAPI Eina_File *eina_file_open(const char *name, Eina_Bool shared) 
>> EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
>> +
>> +/**
>> + * @brief Unref file handler.
>> + *
>> + * @param file File handler to unref.
>> + *
>> + * This doesn't close the file, it will remain open until it leave the 
>> cache.
>> + */
>> +EAPI void eina_file_close(Eina_File *file);
>> +
>> +/**
>> + * @brief Get file size at open time.
>> + *
>> + * @param file The file handler to request the size from.
>> + * @return The length of the file.
>> + */
>> +EAPI unsigned long int eina_file_size_get(Eina_File *file);
>> +
>> +/**
>> + * @brief Get the last modification time of an open file.
>> + *
>> + * @param file The file handler to request the modification time from.
>> + * @return The last modification time.
>> + */
>> +EAPI time_t eina_file_mtime_get(Eina_File *file);
>> +
>> +/**
>> + * @brief Get the filename of an open file.
>> + *
>> + * @param file The file handler to request the name from.
>> + * @return Stringshared filename of the file.
>> + */
>> +EAPI const char *eina_file_filename_get(Eina_File *file);
>> +
>> +/**
>> + * @brief Map all the file to a buffer.
>> + *
>> + * @param file The file handler to map in memory
>> + * @param rule The rule to apply to the mapped memory
>> + * @return A pointer to a buffer that map all the file content. @c NULL if 
>> it fail.
>> + */
>> +EAPI void *eina_file_map_all(Eina_File *file, Eina_File_Populate rule);
>> +
>> +/**
>> + * @brief Map a part of the file.
>> + *
>> + * @param file The file handler to map in memory
>> + * @param rule The rule to apply to the mapped memory
>> + * @param offset The offset inside the file
>> + * @param length The length of the memory to map
>> + * @return A valid pointer to the system memory with @p length valid byte 
>> in it. And @c NULL if not inside the file or anything els

Re: [E-devel] E SVN: discomfitor trunk/eina/src/lib

2011-04-14 Thread Mike Blumenkrantz
On Thu, 14 Apr 2011 10:40:13 +0200 (CEST)
Vincent Torri  wrote:

> 
> 
> On Thu, 14 Apr 2011, Vincent Torri wrote:
> 
> >
> >
> > On Thu, 14 Apr 2011, Enlightenment SVN wrote:
> >
> >> Log:
> >> unrevert. this is not a mistake.
> 
> with your commit, the code below fails silently, without it, you have the 
> error:
> 
> 
> CRI<4620>: eina_list.c:880 eina_list_move() *** Eina Magic Check Failed 
> !!!
>  Input handle pointer is NULL !
> *** NAUGHTY PROGRAMMER!!!
> *** SPANK SPANK SPANK!!!
> *** Now go fix your code. Tut tut tut!
> 
> 
> which is exactly what should happend.
> 
> so explain me why you still want to check *to
> 
> Vincent
> 
> #include 
> #include 
> 
> int main()
> {
>Eina_List *l = NULL;
>Eina_List *ll = NULL;
>int i = 4;
>Eina_Bool res;
> 
>eina_init();
> 
>l = eina_list_append(l, &i);
>res = eina_list_move(&ll, &l, &i);
>printf("res : %d\n", res);
>eina_shutdown();
> 
>return 0;
> }
> 
> 
> >
> > explain me why it can segfault, then
> >
> > Vincent
> >
> >> 
> >> 
> >> Author:   discomfitor
> >> Date: 2011-04-14 00:42:04 -0700 (Thu, 14 Apr 2011)
> >> New Revision: 58654
> >> Trac: http://trac.enlightenment.org/e/changeset/58654
> >> 
> >> Modified:
> >>  trunk/eina/src/lib/eina_list.c
> >> 
> >> Modified: trunk/eina/src/lib/eina_list.c
> >> ===
> >> --- trunk/eina/src/lib/eina_list.c 2011-04-14 07:40:45 UTC (rev
> >> 58653) +++ trunk/eina/src/lib/eina_list.c  2011-04-14 07:42:04 UTC
> >> (rev 58654) @@ -894,7 +894,7 @@
> >>EINA_SAFETY_ON_NULL_RETURN_VAL(to, EINA_FALSE);
> >>EINA_SAFETY_ON_NULL_RETURN_VAL(from, EINA_FALSE);
> >> 
> >> -   EINA_MAGIC_CHECK_LIST(*to, EINA_FALSE);
> >> +   if (*to) EINA_MAGIC_CHECK_LIST(*to, EINA_FALSE);
> >>EINA_MAGIC_CHECK_LIST(*from, EINA_FALSE);
> >>EINA_MAGIC_CHECK_LIST(data, EINA_FALSE);
> >> 
> >> 
> >>
> >> 
Here is a better test program:


#include 
#include 

int main()
{
   Eina_List *l = NULL;
   Eina_List *ll = NULL;
   char *s = strdup("test");
   Eina_Bool res;

   eina_init();

   l = eina_list_append(l, s);
   printf("l: %s\nll: %s\n", l ? (char*)l->data : "NULL", ll ? (char*)ll->data 
: "NULL");
   printf("Moving from l to ll\n");
   res = eina_list_move(&ll, &l, s);
   printf("l: %s\nll: %s\n", l ? (char*)l->data : "NULL", ll ? (char*)ll->data 
: "NULL");
   eina_shutdown();

   return 0;
}

Try it with my check, then without. I wrote the function, and this is the way 
it's supposed to work.
-- 
Mike Blumenkrantz
Zentific: NULL pointer dereferences now 50% off!

--
Benefiting from Server Virtualization: Beyond Initial Workload 
Consolidation -- Increasing the use of server virtualization is a top
priority.Virtualization can reduce costs, simplify management, and improve 
application availability and disaster protection. Learn more about boosting 
the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] E SVN: discomfitor trunk/eina/src/lib

2011-04-14 Thread Vincent Torri


On Thu, 14 Apr 2011, Mike Blumenkrantz wrote:

> On Thu, 14 Apr 2011 10:40:13 +0200 (CEST)
> Vincent Torri  wrote:
>
>>
>>
>> On Thu, 14 Apr 2011, Vincent Torri wrote:
>>
>>>
>>>
>>> On Thu, 14 Apr 2011, Enlightenment SVN wrote:
>>>
 Log:
 unrevert. this is not a mistake.
>>
>> with your commit, the code below fails silently, without it, you have the
>> error:
>>
>>
>> CRI<4620>: eina_list.c:880 eina_list_move() *** Eina Magic Check Failed
>> !!!
>>  Input handle pointer is NULL !
>> *** NAUGHTY PROGRAMMER!!!
>> *** SPANK SPANK SPANK!!!
>> *** Now go fix your code. Tut tut tut!
>>
>>
>> which is exactly what should happend.
>>
>> so explain me why you still want to check *to
>>
>> Vincent
>>
>> #include 
>> #include 
>>
>> int main()
>> {
>>Eina_List *l = NULL;
>>Eina_List *ll = NULL;
>>int i = 4;
>>Eina_Bool res;
>>
>>eina_init();
>>
>>l = eina_list_append(l, &i);
>>res = eina_list_move(&ll, &l, &i);
>>printf("res : %d\n", res);
>>eina_shutdown();
>>
>>return 0;
>> }
>>
>>
>>>
>>> explain me why it can segfault, then
>>>
>>> Vincent
>>>


 Author:   discomfitor
 Date: 2011-04-14 00:42:04 -0700 (Thu, 14 Apr 2011)
 New Revision: 58654
 Trac: http://trac.enlightenment.org/e/changeset/58654

 Modified:
  trunk/eina/src/lib/eina_list.c

 Modified: trunk/eina/src/lib/eina_list.c
 ===
 --- trunk/eina/src/lib/eina_list.c 2011-04-14 07:40:45 UTC (rev
 58653) +++ trunk/eina/src/lib/eina_list.c  2011-04-14 07:42:04 UTC
 (rev 58654) @@ -894,7 +894,7 @@
EINA_SAFETY_ON_NULL_RETURN_VAL(to, EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(from, EINA_FALSE);

 -   EINA_MAGIC_CHECK_LIST(*to, EINA_FALSE);
 +   if (*to) EINA_MAGIC_CHECK_LIST(*to, EINA_FALSE);
EINA_MAGIC_CHECK_LIST(*from, EINA_FALSE);
EINA_MAGIC_CHECK_LIST(data, EINA_FALSE);




> Here is a better test program:
>
>
> #include 
> #include 
>
> int main()
> {
>   Eina_List *l = NULL;
>   Eina_List *ll = NULL;
>   char *s = strdup("test");
>   Eina_Bool res;
>
>   eina_init();
>
>   l = eina_list_append(l, s);
>   printf("l: %s\nll: %s\n", l ? (char*)l->data : "NULL", ll ? (char*)ll->data 
> : "NULL");
>   printf("Moving from l to ll\n");
>   res = eina_list_move(&ll, &l, s);
>   printf("l: %s\nll: %s\n", l ? (char*)l->data : "NULL", ll ? (char*)ll->data 
> : "NULL");
>   eina_shutdown();
>
>   return 0;
> }
>
> Try it with my check, then without. I wrote the function, and this is the way 
> it's supposed to work.

so, basically, if 'to' is NULL, it's created (as eina_list_append is used 
to append data to 'to'). Ok.

Now, you did the commit for eina_list_move_list(), why didn't you do it 
for eina_list_move() ?

Vincent

--
Benefiting from Server Virtualization: Beyond Initial Workload 
Consolidation -- Increasing the use of server virtualization is a top
priority.Virtualization can reduce costs, simplify management, and improve 
application availability and disaster protection. Learn more about boosting 
the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] E SVN: discomfitor trunk/eina/src/lib

2011-04-14 Thread Mike Blumenkrantz
On Thu, 14 Apr 2011 19:53:00 +0200 (CEST)
Vincent Torri  wrote:

> 
> 
> On Thu, 14 Apr 2011, Mike Blumenkrantz wrote:
> 
> > On Thu, 14 Apr 2011 10:40:13 +0200 (CEST)
> > Vincent Torri  wrote:
> >
> >>
> >>
> >> On Thu, 14 Apr 2011, Vincent Torri wrote:
> >>
> >>>
> >>>
> >>> On Thu, 14 Apr 2011, Enlightenment SVN wrote:
> >>>
>  Log:
>  unrevert. this is not a mistake.
> >>
> >> with your commit, the code below fails silently, without it, you have the
> >> error:
> >>
> >>
> >> CRI<4620>: eina_list.c:880 eina_list_move() *** Eina Magic Check Failed
> >> !!!
> >>  Input handle pointer is NULL !
> >> *** NAUGHTY PROGRAMMER!!!
> >> *** SPANK SPANK SPANK!!!
> >> *** Now go fix your code. Tut tut tut!
> >>
> >>
> >> which is exactly what should happend.
> >>
> >> so explain me why you still want to check *to
> >>
> >> Vincent
> >>
> >> #include 
> >> #include 
> >>
> >> int main()
> >> {
> >>Eina_List *l = NULL;
> >>Eina_List *ll = NULL;
> >>int i = 4;
> >>Eina_Bool res;
> >>
> >>eina_init();
> >>
> >>l = eina_list_append(l, &i);
> >>res = eina_list_move(&ll, &l, &i);
> >>printf("res : %d\n", res);
> >>eina_shutdown();
> >>
> >>return 0;
> >> }
> >>
> >>
> >>>
> >>> explain me why it can segfault, then
> >>>
> >>> Vincent
> >>>
> 
> 
>  Author:   discomfitor
>  Date: 2011-04-14 00:42:04 -0700 (Thu, 14 Apr 2011)
>  New Revision: 58654
>  Trac: http://trac.enlightenment.org/e/changeset/58654
> 
>  Modified:
>   trunk/eina/src/lib/eina_list.c
> 
>  Modified: trunk/eina/src/lib/eina_list.c
>  ===
>  --- trunk/eina/src/lib/eina_list.c   2011-04-14 07:40:45 UTC (rev
>  58653) +++ trunk/eina/src/lib/eina_list.c2011-04-14 07:42:04 UTC
>  (rev 58654) @@ -894,7 +894,7 @@
> EINA_SAFETY_ON_NULL_RETURN_VAL(to, EINA_FALSE);
> EINA_SAFETY_ON_NULL_RETURN_VAL(from, EINA_FALSE);
> 
>  -   EINA_MAGIC_CHECK_LIST(*to, EINA_FALSE);
>  +   if (*to) EINA_MAGIC_CHECK_LIST(*to, EINA_FALSE);
> EINA_MAGIC_CHECK_LIST(*from, EINA_FALSE);
> EINA_MAGIC_CHECK_LIST(data, EINA_FALSE);
> 
> 
> 
> 
> > Here is a better test program:
> >
> >
> > #include 
> > #include 
> >
> > int main()
> > {
> >   Eina_List *l = NULL;
> >   Eina_List *ll = NULL;
> >   char *s = strdup("test");
> >   Eina_Bool res;
> >
> >   eina_init();
> >
> >   l = eina_list_append(l, s);
> >   printf("l: %s\nll: %s\n", l ? (char*)l->data : "NULL", ll ?
> > (char*)ll->data : "NULL"); printf("Moving from l to ll\n");
> >   res = eina_list_move(&ll, &l, s);
> >   printf("l: %s\nll: %s\n", l ? (char*)l->data : "NULL", ll ?
> > (char*)ll->data : "NULL"); eina_shutdown();
> >
> >   return 0;
> > }
> >
> > Try it with my check, then without. I wrote the function, and this is the
> > way it's supposed to work.
> 
> so, basically, if 'to' is NULL, it's created (as eina_list_append is used 
> to append data to 'to'). Ok.
> 
> Now, you did the commit for eina_list_move_list(), why didn't you do it 
> for eina_list_move() ?
> 
> Vincent
probably because it was getting late and I was tired :/

-- 
Mike Blumenkrantz
Zentific: NULL pointer dereferences now 50% off!

--
Benefiting from Server Virtualization: Beyond Initial Workload 
Consolidation -- Increasing the use of server virtualization is a top
priority.Virtualization can reduce costs, simplify management, and improve 
application availability and disaster protection. Learn more about boosting 
the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] E SVN: discomfitor IN trunk/eina: . src/tests

2011-04-14 Thread Mike Blumenkrantz
On Wed, 13 Apr 2011 13:15:50 +0200
Cedric BAIL  wrote:

> On Wed, Apr 13, 2011 at 2:47 AM, Carsten Haitzler 
> wrote:
> > On Tue, 12 Apr 2011 19:16:43 -0400 Mike Blumenkrantz 
> > said:
> >> On Tue, 12 Apr 2011 16:12:52 -0700
> >> "Enlightenment SVN"  wrote:
> >> > Log:
> >> > add bench for google's cityhash function (64bit,
> >> > http://code.google.com/p/cityhash/) convenient graph of output can be
> >> > found at http://www.enlightenment.org/~discomfitor/hash_bench.png
> >> >
> >> > Author:       discomfitor
> >> > Date:         2011-04-12 16:12:52 -0700 (Tue, 12 Apr 2011)
> >> > New Revision: 58610
> >> > Trac:         http://trac.enlightenment.org/e/changeset/58610
> >> >
> >> All libraries compiled with the same cflags/cxxflags/ldflags/etc, glib
> >> 2.28.5, latest svn eina. It appears that cityhash is identical to
> >> superfast, and currently none of eina's tested algorithms scale as well as
> >> ecore's hash or glib's hash.
> >
> > while i'm at it... eina_bench_hash.c ... is a REALLY POOR hash test. not
> > only does it have different results every time you run it
> > (srand(time(NULL)) guys?) different behavior per run.. it can differ per
> > machine you run it on just based on the libc thats there and nothing else.
> > also it uses horribly SHORT keys. (less than 10 chars) and its benchmarking
> > HEAVILY favors adds not lookups as per loop run it FILLS a hash with N
> > items (from 10 up to 10,000) then it looks up a random set of 200. that
> > doesn't smell even remotely like real life usage. (where hashes tend to be
> > long-lived, filled over time or filled in one blob then with LOTs and LOTs
> > and LOTS of lookups. either way. the lookups will dominate, not the adds.
> >
> > i feel like fixing this so we have at least something approximating real
> > life behavior. chances are something like city hash only really shows
> > itself once our keys get much longer AND we have more lookups.
> >
> > fyi ghash wins here. any results from this will be very much dependent on
> > the system you run it on - the architecture, memory bus, l1/l2(or l3) cache
> > sizes, compiler, optimizations flags... but even accounting for that... the
> > benchmark itself doesnt drive the hash in a realistic way. there are even
> > zero deletes in the bench. just a solid block of adds, then a fixed 200
> > lookups. we can debate what real life usage looks like and then fix
> > it... :) strlog is a dump from e17 running of its stringshare usage as an
> > example of one set of real life usage with stringshare (which is really a
> > hash with just keys + refcount per key).
> 
> I completly agree with you on this, and in fact most test case for
> eina benchmark are not real use case. In fact, I planned some time ago
> to dump a trace of eina usage by e17 or some elementary apps directly
> and use that as a source of benchmark. But I got lazy, and never did
> it (only stringshare as something like that, but the resulting file is
> hardly usable by a C compiler). Maybe it would be doable with some
> hack and Gustavo's liblogger. If someone as some time to spend on
> improving eina benchmark :-)
This seems to be a somewhat comprehensive test suite for hash functions that
may be interesting for people to look at: http://code.google.com/p/smhasher/

-- 
Mike Blumenkrantz
Zentific: NULL pointer dereferences now 50% off!

--
Benefiting from Server Virtualization: Beyond Initial Workload 
Consolidation -- Increasing the use of server virtualization is a top
priority.Virtualization can reduce costs, simplify management, and improve 
application availability and disaster protection. Learn more about boosting 
the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel