svn update: 51383 (latest:51480)
authorJeahwan Kim <jae.hwan.kim@samsung.com>
Tue, 7 Sep 2010 23:59:16 +0000 (08:59 +0900)
committerJeahwan Kim <jae.hwan.kim@samsung.com>
Tue, 7 Sep 2010 23:59:16 +0000 (08:59 +0900)
55 files changed:
COPYING
INSTALL
README
configure.ac
debian/SVN_REV
debian/_original/patches/.svn/entries
doc/Doxyfile.in
doc/Makefile.am
doc/e.css
doc/foot.html
doc/head.html
doc/images/e.png [new file with mode: 0644]
doc/images/edoxy.css [new file with mode: 0644]
doc/images/foot_bg.png [new file with mode: 0644]
doc/images/head_bg.png [new file with mode: 0644]
doc/images/menu_bg.png [new file with mode: 0644]
doc/images/menu_bg_current.png [new file with mode: 0644]
doc/images/menu_bg_hover.png [new file with mode: 0644]
doc/images/menu_bg_last.png [new file with mode: 0644]
doc/images/menu_bg_unsel.png [new file with mode: 0644]
efreet-mime.pc.in
efreet-trash.pc.in
efreet.pc.in
src/bin/efreet_desktop_cache_create.c
src/lib/Efreet.h
src/lib/Efreet_Mime.h
src/lib/Efreet_Trash.h
src/lib/Makefile.am
src/lib/efreet.c
src/lib/efreet_base.c
src/lib/efreet_base.h
src/lib/efreet_desktop.c
src/lib/efreet_desktop.h
src/lib/efreet_desktop_command.c
src/lib/efreet_icon.c
src/lib/efreet_icon.h
src/lib/efreet_ini.c
src/lib/efreet_ini.h
src/lib/efreet_menu.c
src/lib/efreet_menu.h
src/lib/efreet_mime.c
src/lib/efreet_private.h
src/lib/efreet_trash.c
src/lib/efreet_uri.c
src/lib/efreet_uri.h
src/lib/efreet_utils.c
src/lib/efreet_utils.h
src/lib/efreet_xml.c
src/lib/efreet_xml.h
src/tests/ef_cache.c
src/tests/ef_icon_theme.c
src/tests/ef_menu.c
src/tests/ef_mime.c
src/tests/ef_utils.c
src/tests/main.c

diff --git a/COPYING b/COPYING
index 376a24a..2a66933 100644 (file)
--- a/COPYING
+++ b/COPYING
@@ -1,20 +1,25 @@
-Copyright (C) 2006 dan sinclair and various contributors (see AUTHORS)
+Copyright notice for Efreet:
 
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to
-deal in the Software without restriction, including without limitation the
-rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-sell copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-  
-The above copyright notice and this permission notice shall be included in
-all copies of the Software, its documentation and marketing & publicity 
-materials, and acknowledgment shall be given in the documentation, materials
-and software packages that this Software was used.
-   
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+Copyright (C) 2006-2010 Dan Sinclair and various contributors (see AUTHORS)
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+   1. Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+   2. Redistributions in binary form must reproduce the above copyright 
+      notice, this list of conditions and the following disclaimer in the
+      documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 
+INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
+OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/INSTALL b/INSTALL
index 5458714..23e5f25 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -1,8 +1,8 @@
 Installation Instructions
 *************************
 
-Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
-2006 Free Software Foundation, Inc.
+Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 Free
+Software Foundation, Inc.
 
 This file is free documentation; the Free Software Foundation gives
 unlimited permission to copy, distribute and modify it.
@@ -10,10 +10,7 @@ unlimited permission to copy, distribute and modify it.
 Basic Installation
 ==================
 
-Briefly, the shell commands `./configure; make; make install' should
-configure, build, and install this package.  The following
-more-detailed instructions are generic; see the `README' file for
-instructions specific to this package.
+These are generic installation instructions.
 
    The `configure' shell script attempts to guess correct values for
 various system-dependent variables used during compilation.  It uses
@@ -26,9 +23,9 @@ debugging `configure').
 
    It can also use an optional file (typically called `config.cache'
 and enabled with `--cache-file=config.cache' or simply `-C') that saves
-the results of its tests to speed up reconfiguring.  Caching is
+the results of its tests to speed up reconfiguring.  (Caching is
 disabled by default to prevent problems with accidental use of stale
-cache files.
+cache files.)
 
    If you need to do unusual things to compile the package, please try
 to figure out how `configure' could check whether to do them, and mail
@@ -38,17 +35,20 @@ some point `config.cache' contains results you don't want to keep, you
 may remove or edit it.
 
    The file `configure.ac' (or `configure.in') is used to create
-`configure' by a program called `autoconf'.  You need `configure.ac' if
-you want to change it or regenerate `configure' using a newer version
-of `autoconf'.
+`configure' by a program called `autoconf'.  You only need
+`configure.ac' if you want to change it or regenerate `configure' using
+a newer version of `autoconf'.
 
 The simplest way to compile this package is:
 
   1. `cd' to the directory containing the package's source code and type
-     `./configure' to configure the package for your system.
+     `./configure' to configure the package for your system.  If you're
+     using `csh' on an old version of System V, you might need to type
+     `sh ./configure' instead to prevent `csh' from trying to execute
+     `configure' itself.
 
-     Running `configure' might take a while.  While running, it prints
-     some messages telling which features it is checking for.
+     Running `configure' takes awhile.  While running, it prints some
+     messages telling which features it is checking for.
 
   2. Type `make' to compile the package.
 
@@ -78,7 +78,7 @@ details on some of the pertinent environment variables.
 by setting variables in the command line or in the environment.  Here
 is an example:
 
-     ./configure CC=c99 CFLAGS=-g LIBS=-lposix
+     ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
 
    *Note Defining Variables::, for more details.
 
@@ -87,15 +87,17 @@ Compiling For Multiple Architectures
 
 You can compile the package for more than one kind of computer at the
 same time, by placing the object files for each architecture in their
-own directory.  To do this, you can use GNU `make'.  `cd' to the
+own directory.  To do this, you must use a version of `make' that
+supports the `VPATH' variable, such as GNU `make'.  `cd' to the
 directory where you want the object files and executables to go and run
 the `configure' script.  `configure' automatically checks for the
 source code in the directory that `configure' is in and in `..'.
 
-   With a non-GNU `make', it is safer to compile the package for one
-architecture at a time in the source code directory.  After you have
-installed the package for one architecture, use `make distclean' before
-reconfiguring for another architecture.
+   If you have to use a `make' that does not support the `VPATH'
+variable, you have to compile the package for one architecture at a
+time in the source code directory.  After you have installed the
+package for one architecture, use `make distclean' before reconfiguring
+for another architecture.
 
 Installation Names
 ==================
@@ -188,12 +190,12 @@ them in the `configure' command line, using `VAR=value'.  For example:
      ./configure CC=/usr/local2/bin/gcc
 
 causes the specified `gcc' to be used as the C compiler (unless it is
-overridden in the site shell script).
+overridden in the site shell script).  Here is a another example:
 
-Unfortunately, this technique does not work for `CONFIG_SHELL' due to
-an Autoconf bug.  Until the bug is fixed you can use this workaround:
+     /bin/bash ./configure CONFIG_SHELL=/bin/bash
 
-     CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
+Here the `CONFIG_SHELL=/bin/bash' operand causes subsequent
+configuration-related scripts to be executed by `/bin/bash'.
 
 `configure' Invocation
 ======================
diff --git a/README b/README
index b60f4d1..9521c4a 100644 (file)
--- a/README
+++ b/README
@@ -1,16 +1,38 @@
-Efreet
-------
+Efreet 1.0.0 ALPHA
 
+******************************************************************************
+
+ FOR ANY ISSUES PLEASE EMAIL:
+ enlightenment-devel@lists.sourceforge.net
+  
+******************************************************************************
+  
 Requirements:
 -------------
 
 Must:
-  libc ecore ecore-file
+  libc
+  eina (at least 1.0.0
+  ecore (at least 1.0.0)
+  ecore-file (at least 1.0.0)
+  eet (at least 1.4.0)
+
+An implementation of several specifications from freedesktop.org intended for
+use in Enlightenment DR17 (e17) and other applications using the Enlightenment
+Foundation Libraries (EFL). Currently, the following specifications are
+included:
+  * Base Directory
+  * Desktop Entry
+  * Icon Theme
+  * Menu
+  * Trash
+  * Mime
 
-An implementation of several specifications from freedesktop.org intended for use in Enlightenment DR17 (e17) and other applications using the Enlightenment Foundation Libraries (EFL). Currently, the following specifications are included:
-  o Base Directory
-  o Desktop Entry
-  o Icon Theme
-  o Menu
+------------------------------------------------------------------------------
+COMPILING AND INSTALLING:
 
-Efreet depends only on Ecore.
+  ./configure
+  make
+(as root unless you are installing in your users directories):
+  make install
+      
index 832ae30..936f4a9 100644 (file)
@@ -1,25 +1,24 @@
 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
-m4_define([v_maj], [0])
-m4_define([v_min], [5])
+m4_define([v_maj], [1])
+m4_define([v_min], [0])
 m4_define([v_mic], [0])
-m4_define([v_rev], m4_esyscmd([(svnversion . | grep -v exported || echo 0) | awk -F : '{printf("%s\n", $1);}' | tr -d ' :MSP\n']))
+m4_define([v_rev], m4_esyscmd([(svnversion "${SVN_REPO_PATH:-.}" | grep -v export || echo 0) | awk -F : '{printf("%s\n", $1);}' | tr -d ' :MSP\n']))
 m4_if(v_rev, [0], [m4_define([v_rev], m4_esyscmd([git log 2> /dev/null | (grep -m1 git-svn-id || echo 0) | sed -e 's/.*@\([0-9]*\).*/\1/' | tr -d '\n']))])
 ##--   When released, remove the dnl on the below line
-dnl m4_undefine([v_rev])
+m4_undefine([v_rev])
 ##--   When doing snapshots - change soname. remove dnl on below line
-m4_define([relname], [ver-pre-svn-06])
-m4_define([v_rel], [-release relname])
+dnl m4_define([relname], [ver-pre-svn-07])
+dnl m4_define([v_rel], [-release relname])
 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
-m4_ifdef([v_rev], [m4_define([v_ver], [v_maj.v_min.v_mic.v_rev])],
-[m4_define([v_ver], [v_maj.v_min.v_mic])])
+m4_ifdef([v_rev], [m4_define([v_ver], [v_maj.v_min.v_mic.v_rev])], [m4_define([v_ver], [v_maj.v_min.v_mic])])
 m4_define([lt_rev], m4_eval(v_maj + v_min))
 m4_define([lt_cur], v_mic)
 m4_define([lt_age], v_min)
 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
 
-AC_INIT([efreet], [v_ver], [enlightenment-devel@lists.sourceforge.net])
+AC_INIT([efreet], [v_ver-alpha], [enlightenment-devel@lists.sourceforge.net])
 AC_PREREQ([2.52])
 AC_CONFIG_SRCDIR([configure.ac])
 AC_CONFIG_MACRO_DIR([m4])
@@ -49,6 +48,8 @@ AC_SUBST(version_info)
 AC_SUBST(release_info)
 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
+VMAJ=v_maj
+AC_SUBST(VMAJ)
 
 ### Needed information
 
@@ -136,10 +137,10 @@ AC_SUBST(EFL_EFREET_BUILD)
 AC_SUBST(EFL_EFREET_MIME_BUILD)
 AC_SUBST(EFL_EFREET_TRASH_BUILD)
 
-PKG_CHECK_MODULES(EFREET, [eina-0 eet ecore >= 0.9.9 ecore-file >= 0.9.9])
-PKG_CHECK_MODULES(EINA, [eina-0])
+PKG_CHECK_MODULES(EFREET, [eina >= 1.0.0 eet >= 1.4.0 ecore >= 1.0.0 ecore-file >= 1.0.0])
+PKG_CHECK_MODULES(EINA, [eina >= 1.0.0])
 
-requirement_efreet="ecore-file ecore eet eina-0 ${requirement_efreet}"
+requirement_efreet="ecore-file >= 1.0.0 ecore >= 1.0.0 eet >= 1.4.0 eina >= 1.0.0 ${requirement_efreet}"
 
 ### Checks for header files
 
index fb045e0..1d24dc9 100644 (file)
@@ -1,2 +1,2 @@
-Revision 49550
-Last Changed Rev 49545
+Revision 51480
+Last Changed Rev 51383
index 64e2043..f366d8b 100644 (file)
@@ -1,7 +1,7 @@
 10
 
 dir
-49550
+51480
 https://svn.enlightenment.org/svn/e/trunk/efreet/debian/patches
 https://svn.enlightenment.org/svn/e
 
@@ -32,7 +32,7 @@ file
 
 
 
-2010-06-07T03:18:00.000000Z
+2010-09-07T23:59:08.000000Z
 2cc70c66d5c7a6eeb899e4e8d3b30a96
 2009-04-19T16:22:00.135825Z
 40226
index 6129752..1c1bc06 100644 (file)
@@ -115,7 +115,7 @@ FULL_PATH_NAMES        = YES
 # If left blank the directory from which doxygen is run is used as the 
 # path to strip.
 
-STRIP_FROM_PATH        = src/
+STRIP_FROM_PATH        = ../src/
 
 # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of 
 # the path mentioned in the documentation of a class, which tells 
index 921f9ac..584a751 100644 (file)
@@ -11,7 +11,7 @@ doc-clean:
 
 doc: all doc-clean
        $(efl_doxygen)
-       cp img/* html/
+       cp images/* html/
        rm -rf $(PACKAGE_DOCNAME).tar*
        mkdir -p $(PACKAGE_DOCNAME)/doc
        cp -R html/ latex/ $(PACKAGE_DOCNAME)/doc
@@ -29,4 +29,4 @@ doc:
 
 endif
 
-EXTRA_DIST = Doxyfile.in $(wildcard img/*.*) e.css head.html foot.html
+EXTRA_DIST = Doxyfile.in $(wildcard images/*.*) e.css head.html foot.html
index 604ee7f..8697a3a 100644 (file)
--- a/doc/e.css
+++ b/doc/e.css
+/*
+    Author:
+        Andres Blanc <andresblanc@gmail.com>
+       DaveMDS Andreoli <dave@gurumeditation.it>
+
+    Supported Browsers:
+        ie7, opera9, konqueror4 and firefox3
+
+        Please use a different file for ie6, ie5, etc. hacks.
+*/
+
+
+/* Necessary to place the footer at the bottom of the page */
+html, body {
+       height: 100%;
+       margin: 0px;
+       padding: 0px;
+}
+
+#container {
+       min-height: 100%;
+       height: auto !important;
+       height: 100%;
+       margin: 0 auto -53px;
+}
+
+#footer, #push {
+       height: 53px;
+}
+
+
+* html #container {
+       height: 100%;
+}
+
+/* Prevent floating elements overflowing containers */
+.clear {
+       clear: both;
+       width: 0px;
+       height: 0px;
+}
+
+/* Flexible & centered layout from 750 to 960 pixels */
+.layout {
+       max-width: 960px;
+       min-width: 760px;
+       margin-left: auto;
+       margin-right: auto;
+}
+
 body {
-    background: url("b.png");
-    background-repeat: repeat-x;
-    background-position: top left;
-    background-color: #f4f4f4;
-    text-align: center;
-    font-family: sans-serif;
-    padding: 0;
-    margin: 0;
-}
-
-div.main {
-    margin: 1em auto;
-    vertical-align: top;
-    font-family: "Bitstream Vera", "Vera", "Trebuchet MS", Trebuchet, Tahoma, sans-serif;
-    color: #444444;
-    font-size: 0.8em;
-    text-align: justify;
-    width: 80%;
-}
-
-td.t { background-image:url("t.gif"); }
-td.t[class] { background-image:url("t.png"); }
-td.tl { background-image:url("tl.gif"); }
-td.tl[class] { background-image:url("tl.png"); }
-
-td.nav, td.lnav,  td.rnav {
-   align: middle;
-   text-align: center;
-   vertical-align: middle;
-   width: 100px;
-   height: 25px;
-   font-family: "Bitstream Vera", "Vera", "Trebuchet MS", Trebuchet, Tahoma, sans-serif;
-   color: #000000;
-   font-size: 9px;
-   font-weight: bold;
-   white-space: no-wrap;
-}  
-
-td.lnav[class] { background-image:url("n.png"); }
-td.lnav[class] { background-image:url("n.png"); }
-td.rnav { background-image:url("n.gif"); }
-td.rnav[class] { background-image:url("n.png"); }
-
-hr {
-    width: 200px;
-    height: 1px;
-    background: #dddddd;
-    border: 0;
-}
-
-p { color: #444444 ;}
-p.tiny, small {
-    color: #888888;
-    font-size: 0.5em;
-}
-
-h1 { 
-    text-align: center;
-    font-size: 1.3em; 
-}
-
-h2 { font-size: 1.1em; }
-h3 { font-size: 0.9em; }
-
-span.keyword { color: #008000; }
-span.keywordtype { color: #604020; }
-span.keywordflow { color: #e08000; }
-span.comment { color: #800000; }
-span.preprocessor { color: #806020; }
-span.stringliteral { color: #002080; }
-span.charliteral { color: #008080; }
-
-a:link {
-    color: #445566;
-    text-decoration: underline;
-}  
-   
-a:visited {
-    color: #667788;
-    text-decoration: underline;
-}  
-
-a:active {                
-    color: #88cccc;
-    text-decoration: none;
-}
-
-a:hover {
-    color: #112266;
-    text-decoration: underline;
-}  
-
-a.nav {
-    text-decoration: none;
-    display: block;
-}
-a.nav:link, a.nav:visited { color: #888888; }
-a.nav:active { color: #000000; }
-a.nav:hover { color: #444444; }
-a.code:link, a.code:visited { text-decoration: none; }
-
-div.fragment {
-    font-size: 1em;
-    border: 1px dotted #cccccc;
-    background-color: #ffffff;
-    text-align: left;
-    vertical-align: middle;
-    padding: 2px;
-    margin-left: 25px;
-    margin-right: 25px;
-    overflow: auto;
-}
-
-td.indexkey {
-    font-weight: bold;
-    padding-left: 10px;
-    padding-right: 0;
-    padding-top: 2px;
-    padding-bottom: 0px;
-    margin: 0;
-    margin-top: 2px;
-    margin-bottom: 2px;
-    border: 1px dotted #cccccc;
-    border-right: 0px dotted #cccccc;
-}
-
-td.indexvalue {
-    font-style: italic;
-    padding-right: 10px;
-    padding-left: 0;
-    padding-top: 2px;
-    padding-bottom: 2px;
-    margin: 0;
-    margin-top: 2px;
-    margin-bottom: 2px;
-    border: 1px dotted #cccccc;
-    border-left: 0px dotted #cccccc;
-}
-
-.mdescRight { font-style: italic; }
-.memitem {
-    padding-left: 2px;
-    padding-right: 2px;
-    border: 1px dotted #cccccc;
-    background-color: #ffffff;
-}
-.memname {
-    white-space: nowrap;
-    font-weight: bold;
-}
-.paramname { font-weight: normal; }
-
-div.ah {
-    border: thin solid #888888;
-    font-weight: bold;
-    margin-bottom: 3px;
-    margin-top: 3px;
+       /*font-family: Lucida Grande, Helvetica, sans-serif;*/
+       font-family: "Bitstream Vera","Vera","Trebuchet MS",Trebuchet,Tahoma,sans-serif
+}
+
+/* Prevent design overflowing the viewport in small resolutions */
+#container {
+       padding-right: 17px;
+       padding-left: 17px;
+       background-image: url(head_bg.png);
+       background-repeat: repeat-x;
+}
+
+#header {
+       width: 100%;
+       height: 102px;
+}
+
+#header h1 {
+       width: 63px;
+       height: 63px;
+       background-image: url(e.png);
+       background-repeat: no-repeat;
+       position: absolute;
+       margin: 0px;
+}
+
+#header h1 span {
+       display: none;
+}
+
+#header h2 {
+       display: none;
+}
+
+/* .menu-container is used to set properties common to .menu and .submenu */
+#header .menu-container {
+}
+
+#header .menu-container ul {
+       list-style-type: none;
+       list-style-position: inside;
+       margin: 0;
+}
+
+#header .menu-container li {
+       display: block;
+       float: right;
+}
+
+#header .menu {
+       height: 63px;
+       display: block;
+       background-image: url(menu_bg.png);
+       background-repeat: repeat-x;
+}
+
+#header .menu ul {
+       height: 100%;
+       display: block;
+       background-image: url(menu_bg_last.png);
+       background-repeat: no-repeat;
+       background-position: top right;
+       padding-right: 17px;
+}
+
+#header .menu li {
+       height: 100%;
+       text-align: center;
+       background-image: url(menu_bg_unsel.png);
+       background-repeat: no-repeat;
+}
+
+#header .menu a {
+       height: 100%;
+       display: block;
+       color: #cdcdcd;
+       text-decoration: none;
+       font-size: 10pt;
+       line-height: 59px;
+       text-align: center;
+       padding: 0px 15px 0px 15px;
+}
+
+#header .menu li:hover {
+       background-image: url(menu_bg_hover.png);
+       background-repeat: no-repeat;
+}
+
+#header .menu li:hover a {
+       color: #FFFFFF;
+}
+
+#header .menu li.current {
+       background-image: url(menu_bg_current.png);
+       background-repeat: no-repeat;
+}
+
+#header .menu li.current a {
+       color: #646464;
+}
+
+
+/* Hide all the submenus but the current */
+#header .submenu ul {
+       display: none;
+}
+
+#header .submenu .current {
+       display: block;
+}
+
+#header .submenu {
+       font: bold 10px verdana,'Bitstream Vera Sans',helvetica,arial,sans-serif;
+       margin-top: 10px;
+}
+
+#header .submenu a {
+       color: #888888;
+       text-decoration: none;
+       font-size: 0.9em;
+       line-height: 15px;
+       padding:0px 5px 0px 5px;
+}
+
+#header .submenu a:hover {
+       color: #444444;
+}
+
+#header .submenu li {
+       border-left: 1px solid #DDDDDD;
+}
+
+#header .submenu li:last-child {
+       border-left: 0;
+}
+
+#header .doxytitle {
+       position: absolute;
+       font-size: 1.8em;
+       font-weight: bold;
+       color: #444444;
+       line-height: 35px;
+}
+
+#header small {
+       font-size: 0.4em;
+}
+
+#footer {
+       background-image: url(foot_bg.png);
+       width: 100%;
+}
+
+#footer table {
+       width: 100%;
+       text-align: center;
+       white-space: nowrap;
+       padding: 5px 30px 5px 30px;
+       font-size: 0.8em;
+       font-family: "Bitstream Vera","Vera","Trebuchet MS",Trebuchet,Tahoma,sans-serif;
+       color: #888888;
+}
+
+#footer td.copyright {
+       width: 100%;
 }
 
index 0d3303d..78ef911 100644 (file)
@@ -1,6 +1,19 @@
+ <div id="push"></div>
+ </div> <!-- #content -->
+  </div> <!-- .layout -->
+ </div> <!-- #container -->
+  <div id="footer">
+    <table><tr>
+      <td class="poweredby"><img src="doxygen.png"></td>
+      <td class="copyright">Copyright &copy;$year Enlightenment</td>
+      <td class="generated">Docs generated $datetime</td>
+    </tr></table>
   </div>
-  <hr />
-  <p class="tiny">Copyright &copy; Enlightenment.org</p>
-  <p class="tiny">$projectname Documentation Generated: $datetime</p>
- </body>
+
+
+</body>
 </html>
index f613e16..5fa253e 100644 (file)
@@ -1,45 +1,67 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
-            "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
 <html>
- <head>
-  <title>$title</title>
-  <link href="e.css" rel="stylesheet" type="text/css" />
- </head>
+<head>
+    <title>$title</title>
+    <meta http-equiv="content-type" content="text/html;charset=UTF-8">
+    <meta name="author" content="Andres Blanc" >
+    
+    <link rel="icon" href="images/favicon.png" type="image/x-icon">
+    <link rel="shortcut icon" href="images/favicon.png" type="image/x-icon">
+    <link rel="icon" href="images/favicon.png" type="image/ico">
+    <link rel="shortcut icon" href="images/favicon.png" type="image/ico">
+
+    <link rel="stylesheet" type="text/css" media="screen" href="e.css">
+    <link rel="stylesheet" type="text/css" media="screen" href="edoxy.css">
+</head>
 
 <body>
- <table width="100%" border="0" cellpadding="0" cellspacing="0">
-  <tr>
-   <td class="t" width="50%" valign="top" align="left">
-    <table width="100px" height="100px" border="0" cellpadding="0" cellspacing="0">
-     <tr><td class="lnav"><a class="nav" href="http://web.enlightenment.org/p.php?p=index">Home</a></td></tr>
-     <tr><td class="lnav"><a class="nav" href="http://web.enlightenment.org/p.php?p=news">News</a></td></tr>
-     <tr><td class="lnav"><a class="nav" href="http://web.enlightenment.org/p.php?p=about">About</a></td></tr>
-     <tr><td class="rnav"><a class="nav" href="http://web.enlightenment.org/p.php?p=download">Download</a></td></tr>
-    </table>
-   </td>
-   <td class="tl" width="612" height="250" valign="bottom" align="center">
-    <img src="_.gif" width="612" height="1"/>
-    <table border="0" cellpadding="0" cellspacing="4px">
-     <tr>
-      <td class='nav'><a class='nav' href="index.html">Main&nbsp;Page</a></td>
-      <td class='nav'><a class='nav' href="files.html">Files</a></td>
-      <td class='nav'><a class='nav' href="modules.html">Modules</a></td>
-      <td class="nav"><a class="nav" href="annotated.html">Data&nbsp;Structures</a></td>
-      <td class="nav"><a class="nav" href="classes.html">Index</a></td>
-     </tr>
-    </table>
-    <hr />
-   </td>
-   <td class="t" width="50%" valign="top" align="right">
-    <table width="100px" height="100px" border="0" cellpadding="0" cellspacing="0">
-     <tr><td class="rnav"><a class="nav" href="http://web.enlightenment.org/p.php?p=support">Support</a></td></tr>
-     <tr><td class="lnav"><a class="nav" href="http://web.enlightenment.org/p.php?p=contribute">Contribute</a></td></tr>
-     <tr><td class="lnav"><a class="nav" href="http://web.enlightenment.org/p.php?p=contact">Contact</a></td></tr>
-     <tr><td class="lnav"><a class="nav" href="http://trac.enlightenment.org/e">Tracker</a></td></tr>
-    </table>
-   </td>
-  </tr>
- </table>
-
- <div class="main">
+
+<div id="container">
+
+<div id="header">
+<div class="layout">
+    
+    <h1><span>Enlightenment</span></h1>
+    <h2><span>Beauty at your fingertips</span></h2>
+
+    <div class="menu-container">
+        <div class="menu">
+            <ul>
+               <li class="current"><a href="http://web.enlightenment.org/p.php?p=docs">Docs</a></li>
+                <li><a href="http://trac.enlightenment.org/e">Tracker</a></li>
+                <li><a href="http://www.enlightenment.org/p.php?p=contact">Contact</a></li>
+                <li><a href="http://www.enlightenment.org/p.php?p=contribute">Contribute</a></li>
+                <li><a href="http://www.enlightenment.org/p.php?p=support">Support</a></li>
+                <li><a href="http://www.enlightenment.org/p.php?p=download">Download</a></li>
+                <li><a href="http://www.enlightenment.org/p.php?p=about">About</a></li>
+                <li><a href="http://www.enlightenment.org/p.php?p=news">News</a></li>
+                <li><a href="http://www.enlightenment.org/">Home</a></li>
+            </ul>
+        </div>
+    </div>
+
+    <div class="doxytitle">
+        $projectname Documentation <small>at $date</small>
+    </div>
+
+    <div class="menu-container">
+        <div class="submenu">
+            <ul class="current">
+                <li><a href="group__Efreet__Uri.html">URI</a></li>
+                <li><a href="group__Efreet__Trash.html">Trash</a></li>
+                <li><a href="group__Efreet__Mime.html">Mime Types</a></li>
+                <li><a href="group__Efreet__Menu.html">Menu</a></li>
+                <li><a href="group__Efreet__Icon.html">Icon</a></li>
+                <li><a href="group__Efreet__Desktop.html">Desktop</a></li>
+                <li><a href="group__Efreet__Base.html">Base</a></li>
+               <li class="current"><a  href="index.html">Main Page</a></li>
+            </ul>
+        </div>
+    </div>
+
+
+    <div class="clear"></div>
+</div>
+</div>
+
+<div id="content">
+<div class="layout">
diff --git a/doc/images/e.png b/doc/images/e.png
new file mode 100644 (file)
index 0000000..b3884a5
Binary files /dev/null and b/doc/images/e.png differ
diff --git a/doc/images/edoxy.css b/doc/images/edoxy.css
new file mode 100644 (file)
index 0000000..3caf7a9
--- /dev/null
@@ -0,0 +1,483 @@
+/*
+ * This file contain a custom doxygen style to match e.org graphics
+ */
+
+
+
+/* BODY,H1,H2,H3,H4,H5,H6,P,CENTER,TD,TH,UL,DL,DIV {
+       font-family: Geneva, Arial, Helvetica, sans-serif;
+}*/ 
+BODY, TD {
+       font-size: 12px;
+}
+H1 {
+       text-align: center;
+       font-size: 160%;
+}
+H2 {
+       font-size: 120%;
+}
+H3 {
+       font-size: 100%;
+}
+CAPTION { 
+       font-weight: bold 
+}
+DIV.qindex {
+       width: 100%;
+       background-color: #e8eef2;
+       border: 1px solid #84b0c7;
+       text-align: center;
+       margin: 2px;
+       padding: 2px;
+       line-height: 140%;
+}
+DIV.navpath {
+       width: 100%;
+       background-color: #e8eef2;
+       border: 1px solid #84b0c7;
+       text-align: center;
+       margin: 2px;
+       padding: 2px;
+       line-height: 140%;
+}
+DIV.navtab {
+       background-color: #e8eef2;
+       border: 1px solid #84b0c7;
+       text-align: center;
+       margin: 2px;
+       margin-right: 15px;
+       padding: 2px;
+}
+TD.navtab {
+       font-size: 70%;
+}
+A.qindex {
+       text-decoration: none;
+       font-weight: bold;
+       color: #1A419D;
+}
+A.qindex:visited {
+       text-decoration: none;
+       font-weight: bold;
+       color: #1A419D
+}
+A.qindex:hover {
+       text-decoration: none;
+       background-color: #ddddff;
+}
+A.qindexHL {
+       text-decoration: none;
+       font-weight: bold;
+       background-color: #6666cc;
+       color: #ffffff;
+       border: 1px double #9295C2;
+}
+A.qindexHL:hover {
+       text-decoration: none;
+       background-color: #6666cc;
+       color: #ffffff;
+}
+A.qindexHL:visited { 
+       text-decoration: none; 
+       background-color: #6666cc; 
+       color: #ffffff 
+}
+A.el { 
+       text-decoration: none; 
+       font-weight: bold 
+}
+A.elRef { 
+       font-weight: bold 
+}
+A.code:link { 
+       text-decoration: none; 
+       font-weight: normal; 
+       color: #0000FF
+}
+A.code:visited { 
+       text-decoration: none; 
+       font-weight: normal; 
+       color: #0000FF
+}
+A.codeRef:link { 
+       font-weight: normal; 
+       color: #0000FF
+}
+A.codeRef:visited { 
+       font-weight: normal; 
+       color: #0000FF
+}
+A:hover, A:visited:hover { 
+       text-decoration: none;  
+       /* background-color: #f2f2ff; */
+       color: #000055;
+}
+A.anchor {
+       color: #000;
+}
+DL.el { 
+       margin-left: -1cm 
+}
+.fragment {
+       font-family: monospace, fixed;
+       font-size: 95%;
+}
+PRE.fragment {
+       border: 1px solid #CCCCCC;
+       background-color: #f5f5f5;
+       margin-top: 4px;
+       margin-bottom: 4px;
+       margin-left: 2px;
+       margin-right: 8px;
+       padding-left: 6px;
+       padding-right: 6px;
+       padding-top: 4px;
+       padding-bottom: 4px;
+}
+DIV.ah { 
+       background-color: black; 
+       font-weight: bold; 
+       color: #ffffff; 
+       margin-bottom: 3px; 
+       margin-top: 3px 
+}
+
+DIV.groupHeader {
+       margin-left: 16px;
+       margin-top: 12px;
+       margin-bottom: 6px;
+       font-weight: bold;
+}
+DIV.groupText { 
+       margin-left: 16px; 
+       font-style: italic; 
+       font-size: 90% 
+}
+/*BODY {
+       background: white;
+       color: black;
+       margin-right: 20px;
+       margin-left: 20px;
+}*/
+TD.indexkey {
+       background-color: #e8eef2;
+       font-weight: bold;
+       padding-right  : 10px;
+       padding-top    : 2px;
+       padding-left   : 10px;
+       padding-bottom : 2px;
+       margin-left    : 0px;
+       margin-right   : 0px;
+       margin-top     : 2px;
+       margin-bottom  : 2px;
+       border: 1px solid #CCCCCC;
+}
+TD.indexvalue {
+       background-color: #e8eef2;
+       font-style: italic;
+       padding-right  : 10px;
+       padding-top    : 2px;
+       padding-left   : 10px;
+       padding-bottom : 2px;
+       margin-left    : 0px;
+       margin-right   : 0px;
+       margin-top     : 2px;
+       margin-bottom  : 2px;
+       border: 1px solid #CCCCCC;
+}
+TR.memlist {
+       background-color: #f0f0f0; 
+}
+P.formulaDsp { 
+       text-align: center; 
+}
+IMG.formulaDsp {
+}
+IMG.formulaInl { 
+       vertical-align: middle; 
+}
+SPAN.keyword       { color: #008000 }
+SPAN.keywordtype   { color: #604020 }
+SPAN.keywordflow   { color: #e08000 }
+SPAN.comment       { color: #800000 }
+SPAN.preprocessor  { color: #806020 }
+SPAN.stringliteral { color: #002080 }
+SPAN.charliteral   { color: #008080 }
+SPAN.vhdldigit     { color: #ff00ff }
+SPAN.vhdlchar      { color: #000000 }
+SPAN.vhdlkeyword   { color: #700070 }
+SPAN.vhdllogic     { color: #ff0000 }
+
+.mdescLeft {
+       padding: 0px 8px 4px 8px;
+       font-size: 80%;
+       font-style: italic;
+       background-color: #FAFAFA;
+       border-top: 1px none #E0E0E0;
+       border-right: 1px none #E0E0E0;
+       border-bottom: 1px none #E0E0E0;
+       border-left: 1px none #E0E0E0;
+       margin: 0px;
+}
+.mdescRight {
+        padding: 0px 8px 4px 8px;
+       font-size: 80%;
+       font-style: italic;
+       background-color: #FAFAFA;
+       border-top: 1px none #E0E0E0;
+       border-right: 1px none #E0E0E0;
+       border-bottom: 1px none #E0E0E0;
+       border-left: 1px none #E0E0E0;
+       margin: 0px;
+}
+.memItemLeft {
+       padding: 1px 0px 0px 8px;
+       margin: 4px;
+       border-top-width: 1px;
+       border-right-width: 1px;
+       border-bottom-width: 1px;
+       border-left-width: 1px;
+       border-top-color: #E0E0E0;
+       border-right-color: #E0E0E0;
+       border-bottom-color: #E0E0E0;
+       border-left-color: #E0E0E0;
+       border-top-style: solid;
+       border-right-style: none;
+       border-bottom-style: none;
+       border-left-style: none;
+       background-color: #FAFAFA;
+       font-size: 80%;
+}
+.memItemRight {
+       padding: 1px 8px 0px 8px;
+       margin: 4px;
+       border-top-width: 1px;
+       border-right-width: 1px;
+       border-bottom-width: 1px;
+       border-left-width: 1px;
+       border-top-color: #E0E0E0;
+       border-right-color: #E0E0E0;
+       border-bottom-color: #E0E0E0;
+       border-left-color: #E0E0E0;
+       border-top-style: solid;
+       border-right-style: none;
+       border-bottom-style: none;
+       border-left-style: none;
+       background-color: #FAFAFA;
+       font-size: 80%;
+}
+.memTemplItemLeft {
+       padding: 1px 0px 0px 8px;
+       margin: 4px;
+       border-top-width: 1px;
+       border-right-width: 1px;
+       border-bottom-width: 1px;
+       border-left-width: 1px;
+       border-top-color: #E0E0E0;
+       border-right-color: #E0E0E0;
+       border-bottom-color: #E0E0E0;
+       border-left-color: #E0E0E0;
+       border-top-style: none;
+       border-right-style: none;
+       border-bottom-style: none;
+       border-left-style: none;
+       background-color: #FAFAFA;
+       font-size: 80%;
+}
+.memTemplItemRight {
+       padding: 1px 8px 0px 8px;
+       margin: 4px;
+       border-top-width: 1px;
+       border-right-width: 1px;
+       border-bottom-width: 1px;
+       border-left-width: 1px;
+       border-top-color: #E0E0E0;
+       border-right-color: #E0E0E0;
+       border-bottom-color: #E0E0E0;
+       border-left-color: #E0E0E0;
+       border-top-style: none;
+       border-right-style: none;
+       border-bottom-style: none;
+       border-left-style: none;
+       background-color: #FAFAFA;
+       font-size: 80%;
+}
+.memTemplParams {
+       padding: 1px 0px 0px 8px;
+       margin: 4px;
+       border-top-width: 1px;
+       border-right-width: 1px;
+       border-bottom-width: 1px;
+       border-left-width: 1px;
+       border-top-color: #E0E0E0;
+       border-right-color: #E0E0E0;
+       border-bottom-color: #E0E0E0;
+       border-left-color: #E0E0E0;
+       border-top-style: solid;
+       border-right-style: none;
+       border-bottom-style: none;
+       border-left-style: none;
+       color: #606060;
+       background-color: #FAFAFA;
+       font-size: 80%;
+}
+.search { 
+       color: #003399;
+       font-weight: bold;
+}
+FORM.search {
+       margin-bottom: 0px;
+       margin-top: 0px;
+}
+INPUT.search { 
+       font-size: 75%;
+       color: #000080;
+       font-weight: normal;
+       background-color: #e8eef2;
+}
+TD.tiny { 
+       font-size: 75%;
+}
+a {
+       color: #1A41A8;
+}
+a:visited {
+       color: #2A3798;
+}
+.dirtab { 
+       padding: 4px;
+       border-collapse: collapse;
+       border: 1px solid #84b0c7;
+}
+TH.dirtab { 
+       background: #e8eef2;
+       font-weight: bold;
+}
+HR { 
+       height: 1px;
+       border: none;
+       border-top: 1px solid black;
+}
+
+/* Style for detailed member documentation */
+.memtemplate {
+       font-size: 80%;
+       color: #606060;
+       font-weight: normal;
+       margin-left: 3px;
+} 
+.memnav { 
+       background-color: #e8eef2;
+       border: 1px solid #84b0c7;
+       text-align: center;
+       margin: 2px;
+       margin-right: 15px;
+       padding: 2px;
+}
+.memitem {
+       padding: 4px;
+       background-color: #eef3f5;
+       border-width: 1px;
+       border-style: solid;
+       border-color: #dedeee;
+       -moz-border-radius: 8px 8px 8px 8px;
+}
+.memname {
+       white-space: nowrap;
+       font-weight: bold;
+}
+.memdoc{
+       padding-left: 10px;
+}
+.memproto {
+       background-color: #d5e1e8;
+       width: 100%;
+       border-width: 1px;
+       border-style: solid;
+       border-color: #84b0c7;
+       font-weight: bold;
+       -moz-border-radius: 8px 8px 8px 8px;
+}
+.paramkey {
+       text-align: right;
+}
+.paramtype {
+       white-space: nowrap;
+}
+.paramname {
+       color: #602020;
+       font-style: italic;
+       white-space: nowrap;
+}
+/* End Styling for detailed member documentation */
+
+/* for the tree view */
+.ftvtree {
+       font-family: sans-serif;
+       margin:0.5em;
+}
+/* these are for tree view when used as main index */
+.directory { 
+       font-size: 9pt; 
+       font-weight: bold; 
+}
+.directory h3 { 
+       margin: 0px; 
+       margin-top: 1em; 
+       font-size: 11pt; 
+}
+
+/* The following two styles can be used to replace the root node title */
+/* with an image of your choice.  Simply uncomment the next two styles, */
+/* specify the name of your image and be sure to set 'height' to the */
+/* proper pixel height of your image. */
+
+/* .directory h3.swap { */
+/*     height: 61px; */
+/*     background-repeat: no-repeat; */
+/*     background-image: url("yourimage.gif"); */
+/* } */
+/* .directory h3.swap span { */
+/*     display: none; */
+/* } */
+
+.directory > h3 { 
+       margin-top: 0; 
+}
+.directory p { 
+       margin: 0px; 
+       white-space: nowrap; 
+}
+.directory div { 
+       display: none; 
+       margin: 0px; 
+}
+.directory img { 
+       vertical-align: -30%; 
+}
+/* these are for tree view when not used as main index */
+.directory-alt { 
+       font-size: 100%; 
+       font-weight: bold; 
+}
+.directory-alt h3 { 
+       margin: 0px; 
+       margin-top: 1em; 
+       font-size: 11pt; 
+}
+.directory-alt > h3 { 
+       margin-top: 0; 
+}
+.directory-alt p { 
+       margin: 0px; 
+       white-space: nowrap; 
+}
+.directory-alt div { 
+       display: none; 
+       margin: 0px; 
+}
+.directory-alt img { 
+       vertical-align: -30%; 
+}
+
diff --git a/doc/images/foot_bg.png b/doc/images/foot_bg.png
new file mode 100644 (file)
index 0000000..b24f3a4
Binary files /dev/null and b/doc/images/foot_bg.png differ
diff --git a/doc/images/head_bg.png b/doc/images/head_bg.png
new file mode 100644 (file)
index 0000000..081dc13
Binary files /dev/null and b/doc/images/head_bg.png differ
diff --git a/doc/images/menu_bg.png b/doc/images/menu_bg.png
new file mode 100644 (file)
index 0000000..e978743
Binary files /dev/null and b/doc/images/menu_bg.png differ
diff --git a/doc/images/menu_bg_current.png b/doc/images/menu_bg_current.png
new file mode 100644 (file)
index 0000000..de97c92
Binary files /dev/null and b/doc/images/menu_bg_current.png differ
diff --git a/doc/images/menu_bg_hover.png b/doc/images/menu_bg_hover.png
new file mode 100644 (file)
index 0000000..3fd851d
Binary files /dev/null and b/doc/images/menu_bg_hover.png differ
diff --git a/doc/images/menu_bg_last.png b/doc/images/menu_bg_last.png
new file mode 100644 (file)
index 0000000..88c116c
Binary files /dev/null and b/doc/images/menu_bg_last.png differ
diff --git a/doc/images/menu_bg_unsel.png b/doc/images/menu_bg_unsel.png
new file mode 100644 (file)
index 0000000..50e5fd8
Binary files /dev/null and b/doc/images/menu_bg_unsel.png differ
index cf37682..d651017 100644 (file)
@@ -8,4 +8,4 @@ Description: Freedesktop Shared Mime Info standard implementation for the EFL
 @pkgconfig_requires_private@: @requirement_efreet@
 Version: @VERSION@
 Libs: -L${libdir} -lefreet_mime
-Cflags: -I${includedir}/efreet
+Cflags: -I${includedir}/efreet-@VMAJ@
index ef58201..5a4ccf8 100644 (file)
@@ -8,4 +8,4 @@ Description: Freedesktop Shared Trash implementation for the EFL
 @pkgconfig_requires_private@: @requirement_efreet@
 Version: @VERSION@
 Libs: -L${libdir} -lefreet_trash
-Cflags: -I${includedir}/efreet
+Cflags: -I${includedir}/efreet-@VMAJ@
index e547ee4..2f4db8e 100644 (file)
@@ -8,4 +8,4 @@ Description: Freedesktop standards implementation for the EFL
 @pkgconfig_requires_private@: @requirement_efreet@
 Version: @VERSION@
 Libs: -L${libdir} -lefreet
-Cflags: -I${includedir}/efreet
+Cflags: -I${includedir}/efreet-@VMAJ@
index 2c9f18d..44cd196 100644 (file)
@@ -1,4 +1,3 @@
-/* vim: set sw=4 ts=4 sts=4 et: */
 #ifdef HAVE_CONFIG_H
 # include <config.h>
 #endif
@@ -7,13 +6,13 @@
 #include <dirent.h>
 #include <sys/types.h>
 #include <sys/stat.h>
-#include <sys/file.h>
 #include <sys/mman.h>
 #include <fcntl.h>
 #include <unistd.h>
 #include <errno.h>
 
 #include <Eina.h>
+#include <Ecore.h>
 #include <Ecore_File.h>
 
 #include "Efreet.h"
@@ -212,6 +211,7 @@ main(int argc, char **argv)
     struct stat st;
     int changed = 0;
     int i;
+    struct flock fl;
 
     for (i = 1; i < argc; i++)
     {
@@ -239,9 +239,12 @@ main(int argc, char **argv)
 
     /* lock process, so that we only run one copy of this program */
     snprintf(file, sizeof(file), "%s/.efreet/desktop_data.lock", efreet_home_dir_get());
-    fd = open(file, O_CREAT | O_RDONLY, S_IRUSR | S_IWUSR);
+    fd = open(file, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR);
     if (fd < 0) goto efreet_error;
-    if (flock(fd, LOCK_EX | LOCK_NB) < 0)
+    memset(&fl, 0, sizeof(struct flock));
+    fl.l_type = F_WRLCK;
+    fl.l_whence = SEEK_SET;
+    if (fcntl(fd, F_SETLK, &fl) < 0)
     {
         if (verbose)
         {
@@ -335,8 +338,13 @@ main(int argc, char **argv)
         EINA_LIST_FREE(user_dirs, dir)
         {
             unsigned int size = strlen(dir) + 1;
-            write(dirsfd, &size, sizeof(int));
-            write(dirsfd, dir, size);
+            size_t count;
+
+            count = write(dirsfd, &size, sizeof(int));
+            count += write(dirsfd, dir, size);
+
+            if (count != sizeof (int) + size)
+                printf("Didn't write all data on dirsfd");
 
             if (!cache_scan(dir, NULL, priority, 0, &changed)) goto error;
             eina_stringshare_del(dir);
index 74b09cc..06be563 100644 (file)
@@ -1,4 +1,3 @@
-/* vim: set sw=4 ts=4 sts=4 et: */
 #ifndef EFREET_H
 #define EFREET_H
 
@@ -59,8 +58,8 @@
 extern "C" {
 #endif
 
-#define EFREET_VERSION_MAJOR 0
-#define EFREET_VERSION_MINOR 5
+#define EFREET_VERSION_MAJOR 1
+#define EFREET_VERSION_MINOR 0
    
    typedef struct _Efreet_Version
      {
index 610159f..3bab016 100644 (file)
@@ -1,4 +1,3 @@
-/* vim: set sw=4 ts=4 sts=4 et: */
 #ifndef EFREET_MIME_H
 #define EFREET_MIME_H
 
index a488e63..746acdc 100644 (file)
@@ -1,4 +1,3 @@
-/* vim: set sw=4 ts=4 sts=4 et: */
 #ifndef EFREET_TRASH_H
 #define EFREET_TRASH_H
 
index b1fc4f9..0b8228e 100644 (file)
@@ -25,9 +25,11 @@ efreet_menu.c \
 efreet_utils.c \
 efreet_uri.c
 
+includes_HEADERS = $(EFREETHEADERS) Efreet_Mime.h Efreet_Trash.h
+includesdir = $(includedir)/efreet-@VMAJ@
 
-installed_headersdir = $(includedir)/efreet
-dist_installed_headers_DATA = $(EFREETHEADERS) Efreet_Mime.h Efreet_Trash.h
+# Not sure if this was for 'make dist', so left it in but commented - dh
+dist_installed_headers_DATA = $(EFREETHEADERS) Efreet_Mime.h Efreet_Trash.h
 
 libefreet_la_SOURCES = $(EFREETSOURCES)
 libefreet_la_CPPFLAGS =  \
index 3a3ecb2..b5d01e3 100644 (file)
@@ -1,5 +1,3 @@
-/* vim: set sw=4 ts=4 sts=4 et: */
-
 #ifdef HAVE_CONFIG_H
 # include <config.h>
 #endif
index 133e3ba..69a8e19 100644 (file)
@@ -1,5 +1,3 @@
-/* vim: set sw=4 ts=4 sts=4 et: */
-
 #ifdef HAVE_CONFIG_H
 # include <config.h>
 #endif
@@ -207,7 +205,8 @@ efreet_dir_get(const char *key, const char *fallback)
 
         user = efreet_home_dir_get();
         len = strlen(user) + strlen(fallback) + 1;
-        dir = malloc(sizeof(char) * len);
+        dir = malloc(len);
+        if (!dir) return NULL;
         snprintf(dir, len, "%s%s", user, fallback);
 
         t = eina_stringshare_add(dir);
index 4b19347..fd36c5a 100644 (file)
@@ -1,4 +1,3 @@
-/* vim: set sw=4 ts=4 sts=4 et: */
 #ifndef EFREET_BASE_H
 #define EFREET_BASE_H
 /**
index 1c081cb..cafe1f1 100644 (file)
@@ -1,5 +1,3 @@
-/* vim: set sw=4 ts=4 sts=4 et: */
-
 #ifdef HAVE_CONFIG_H
 # include <config.h>
 #endif
@@ -10,7 +8,6 @@
 #include <limits.h>
 #include <libgen.h>
 #include <sys/types.h>
-#include <sys/file.h>
 #include <sys/stat.h>
 #include <sys/mman.h>
 #include <fcntl.h>
@@ -139,7 +136,7 @@ static void efreet_desktop_cache_update_free(void *data, void *ev);
 
 static void efreet_desktop_update_cache(void);
 static void efreet_desktop_update_cache_job(void *data);
-static int efreet_desktop_exe_cb(void *data, int type, void *event);
+static Eina_Bool efreet_desktop_exe_cb(void *data, int type, void *event);
 
 static void efreet_desktop_changes_listen(void);
 static void efreet_desktop_changes_listen_recursive(const char *path);
@@ -234,13 +231,8 @@ efreet_desktop_shutdown(void)
     if (efreet_desktop_exe_handler) ecore_event_handler_del(efreet_desktop_exe_handler);
     IF_RELEASE(desktop_environment);
     IF_FREE_HASH(efreet_desktop_cache);
-    while (efreet_desktop_types)
-    {
-        info = eina_list_data_get(efreet_desktop_types);
+    EINA_LIST_FREE(efreet_desktop_types, info)
         efreet_desktop_type_info_free(info);
-        efreet_desktop_types = eina_list_remove_list(efreet_desktop_types,
-                                                     efreet_desktop_types);
-    }
     EINA_LIST_FREE(efreet_desktop_dirs, dir)
         eina_stringshare_del(dir);
     if (cache_monitor) ecore_file_monitor_del(cache_monitor);
@@ -251,8 +243,11 @@ efreet_desktop_shutdown(void)
     eina_log_domain_unregister(_efreet_desktop_log_dom);
     IF_RELEASE(cache_file);
     IF_RELEASE(cache_dirs);
-    if (efreet_desktop_job) ecore_job_del(efreet_desktop_job);
-    efreet_desktop_job = NULL;
+    if (efreet_desktop_job)
+      {
+         ecore_job_del(efreet_desktop_job);
+         efreet_desktop_job = NULL;
+      }
 }
 
 /**
@@ -430,6 +425,7 @@ efreet_desktop_save(Efreet_Desktop *desktop)
     int ok = 1;
 
     ini = efreet_ini_new(NULL);
+    if (!ini) return 0;
     efreet_ini_section_add(ini, "Desktop Entry");
     efreet_ini_section_set(ini, "Desktop Entry");
 
@@ -449,14 +445,20 @@ efreet_desktop_save(Efreet_Desktop *desktop)
         if (desktop->only_show_in)
         {
             val = efreet_desktop_string_list_join(desktop->only_show_in);
-            efreet_ini_string_set(ini, "OnlyShowIn", val);
-            FREE(val);
+            if (val)
+            {
+                efreet_ini_string_set(ini, "OnlyShowIn", val);
+                FREE(val);
+            }
         }
         if (desktop->not_show_in)
         {
             val = efreet_desktop_string_list_join(desktop->not_show_in);
-            efreet_ini_string_set(ini, "NotShowIn", val);
-            FREE(val);
+            if (val)
+            {
+                efreet_ini_string_set(ini, "NotShowIn", val);
+                FREE(val);
+            }
         }
         efreet_desktop_generic_fields_save(desktop, ini);
         /* When we save the file, it should be updated to the
@@ -807,7 +809,7 @@ EAPI char *
 efreet_desktop_string_list_join(Eina_List *list)
 {
     Eina_List *l;
-    const char *tmp;
+    const char *elem;
     char *string;
     size_t size, pos, len;
 
@@ -815,18 +817,26 @@ efreet_desktop_string_list_join(Eina_List *list)
 
     size = 1024;
     string = malloc(size);
+    if (!string) return NULL;
     pos = 0;
 
-    EINA_LIST_FOREACH(list, l, tmp)
+    EINA_LIST_FOREACH(list, l, elem)
     {
-        len = strlen(tmp);
+        len = strlen(elem);
         /* +1 for ';' */
         if ((len + pos + 1) >= size)
         {
+            char *tmp;
             size = len + pos + 1024;
-            string = realloc(string, size);
+            tmp = realloc(string, size);
+            if (!tmp)
+            {
+                free(string);
+                return NULL;
+            }
+            string = tmp;
         }
-        strcpy(string + pos, tmp);
+        strcpy(string + pos, elem);
         pos += len;
         strcpy(string + pos, ";");
         pos += 1;
@@ -911,6 +921,7 @@ efreet_desktop_read(Efreet_Desktop *desktop)
     int ok;
 
     ini = efreet_ini_new(desktop->orig_path);
+    if (!ini) return 0;
     if (!ini->data)
     {
         efreet_ini_free(ini);
@@ -1056,15 +1067,21 @@ efreet_desktop_application_fields_save(Efreet_Desktop *desktop, Efreet_Ini *ini)
     if (desktop->categories)
     {
         val = efreet_desktop_string_list_join(desktop->categories);
-        efreet_ini_string_set(ini, "Categories", val);
-        FREE(val);
+        if (val)
+        {
+            efreet_ini_string_set(ini, "Categories", val);
+            FREE(val);
+        }
     }
 
     if (desktop->mime_types)
     {
         val = efreet_desktop_string_list_join(desktop->mime_types);
-        efreet_ini_string_set(ini, "MimeType", val);
-        FREE(val);
+        if (val)
+        {
+           efreet_ini_string_set(ini, "MimeType", val);
+           FREE(val);
+        }
     }
 
     efreet_ini_boolean_set(ini, "Terminal", desktop->terminal);
@@ -1274,7 +1291,7 @@ efreet_desktop_edd_init(void)
     Eet_Data_Descriptor *edd;
 
     Eet_Data_Descriptor_Class eddc;
-    if (!eet_eina_file_data_descriptor_class_set(&eddc, "cache", sizeof(Efreet_Desktop))) return NULL;
+    if (!eet_eina_file_data_descriptor_class_set(&eddc, sizeof (eddc), "cache", sizeof(Efreet_Desktop))) return NULL;
     edd = eet_data_descriptor_file_new(&eddc);
     if (!edd) return NULL;
     EET_DATA_DESCRIPTOR_ADD_BASIC(edd, Efreet_Desktop, "type", type, EET_T_INT);
@@ -1320,14 +1337,18 @@ efreet_desktop_write_cache_dirs_file(void)
     char *map = MAP_FAILED;
     char *dir;
     struct stat st;
+    struct flock fl;
 
     if (!efreet_desktop_dirs) return 1;
 
     snprintf(file, sizeof(file), "%s/.efreet/desktop_data.lock", efreet_home_dir_get());
-    fd = open(file, O_CREAT | O_RDONLY, S_IRUSR | S_IWUSR);
+    fd = open(file, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR);
     if (fd < 0) return 0;
     /* TODO: Retry update cache later */
-    if (flock(fd, LOCK_EX | LOCK_NB) < 0) goto error;
+    memset(&fl, 0, sizeof(struct flock));
+    fl.l_type = F_WRLCK;
+    fl.l_whence = SEEK_SET;
+    if (fcntl(fd, F_SETLK, &fl) < 0) goto error;
 
     cachefd = open(efreet_desktop_cache_dirs(), O_CREAT | O_APPEND | O_RDWR, S_IRUSR | S_IWUSR);
     if (cachefd < 0) goto error;
@@ -1359,8 +1380,13 @@ efreet_desktop_write_cache_dirs_file(void)
     EINA_LIST_FREE(efreet_desktop_dirs, dir)
     {
         unsigned int size = strlen(dir) + 1;
-        write(cachefd, &size, sizeof(int));
-        write(cachefd, dir, size);
+        size_t count;
+
+        count = write(cachefd, &size, sizeof(int));
+        count += write(cachefd, dir, size);
+
+        if (count != sizeof(int) + size)
+            DBG("Didn't write all data on cachefd");
 
         efreet_desktop_changes_monitor_add(dir);
         eina_stringshare_del(dir);
@@ -1372,7 +1398,6 @@ error:
     if (map != MAP_FAILED) munmap(map, st.st_size);
     if (fd > 0) close(fd);
     if (cachefd > 0) close(cachefd);
-    efreet_desktop_job = NULL;
     return 0;
 }
 
@@ -1381,8 +1406,8 @@ efreet_desktop_cache_update_cb(void *data __UNUSED__, Ecore_File_Monitor *em __U
                                Ecore_File_Event event, const char *path)
 {
     Eet_File *tmp;
-    Efreet_Event_Cache_Update *ev;
-    Efreet_Old_Cache *d;
+    Efreet_Event_Cache_Update *ev = NULL;
+    Efreet_Old_Cache *d = NULL;
 
     if (strcmp(path, efreet_desktop_cache_file())) return;
     if (event != ECORE_FILE_EVENT_CREATED_FILE &&
@@ -1406,7 +1431,9 @@ efreet_desktop_cache_update_cb(void *data __UNUSED__, Ecore_File_Monitor *em __U
     ecore_event_add(EFREET_EVENT_DESKTOP_CACHE_UPDATE, ev, efreet_desktop_cache_update_free, d);
     return;
 error:
-    if (tmp) eet_close(tmp);
+    IF_FREE(ev);
+    IF_FREE(d);
+    eet_close(tmp);
 }
 
 static void
@@ -1472,7 +1499,10 @@ static void
 efreet_desktop_update_cache_job(void *data __UNUSED__)
 {
     char file[PATH_MAX];
+    struct flock fl;
 
+    efreet_desktop_job = NULL;
+   
     /* TODO: Retry update cache later */
     if (efreet_desktop_exe_lock > 0) return;
 
@@ -1480,9 +1510,12 @@ efreet_desktop_update_cache_job(void *data __UNUSED__)
 
     snprintf(file, sizeof(file), "%s/.efreet/desktop_exec.lock", efreet_home_dir_get());
 
-    efreet_desktop_exe_lock = open(file, O_CREAT | O_RDONLY, S_IRUSR | S_IWUSR);
+    efreet_desktop_exe_lock = open(file, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR);
     if (efreet_desktop_exe_lock < 0) return;
-    if (flock(efreet_desktop_exe_lock, LOCK_EX | LOCK_NB) < 0) goto error;
+    memset(&fl, 0, sizeof(struct flock));
+    fl.l_type = F_WRLCK;
+    fl.l_whence = SEEK_SET;
+    if (fcntl(efreet_desktop_exe_lock, F_SETLK, &fl) < 0) goto error;
     efreet_desktop_exe = ecore_exe_run(PACKAGE_LIB_DIR "/efreet/efreet_desktop_cache_create", NULL);
     if (!efreet_desktop_exe) goto error;
 
@@ -1496,19 +1529,19 @@ error:
     }
 }
 
-static int
+static Eina_Bool
 efreet_desktop_exe_cb(void *data __UNUSED__, int type __UNUSED__, void *event)
 {
     Ecore_Exe_Event_Del *ev;
 
     ev = event;
-    if (ev->exe != efreet_desktop_exe) return 1;
+    if (ev->exe != efreet_desktop_exe) return ECORE_CALLBACK_RENEW;
     if (efreet_desktop_exe_lock > 0)
     {
         close(efreet_desktop_exe_lock);
         efreet_desktop_exe_lock = -1;
     }
-    return 1;
+    return ECORE_CALLBACK_RENEW;
 }
 
 static void
@@ -1595,8 +1628,6 @@ static void
 efreet_desktop_changes_cb(void *data __UNUSED__, Ecore_File_Monitor *em __UNUSED__,
                                  Ecore_File_Event event, const char *path)
 {
-    Ecore_File_Monitor *fm;
-
     switch (event)
     {
         case ECORE_FILE_EVENT_NONE:
index 7564221..84cd94f 100644 (file)
@@ -1,4 +1,3 @@
-/* vim: set sw=4 ts=4 sts=4 et: */
 #ifndef EFREET_DESKTOP_H
 #define EFREET_DESKTOP_H
 
index d71f78f..9a563c5 100644 (file)
@@ -1,5 +1,3 @@
-/* vim: set sw=4 ts=4 sts=4 et: */
-
 #ifdef HAVE_CONFIG_H
 # include <config.h>
 #endif
@@ -248,8 +246,11 @@ efreet_desktop_command_progress_get(Efreet_Desktop *desktop, Eina_List *files,
         Eina_List *execs;
 
         execs = efreet_desktop_command_build(command);
-        ret = efreet_desktop_command_execs_process(command, execs);
-        eina_list_free(execs);
+        if (execs)
+        {
+            ret = efreet_desktop_command_execs_process(command, execs);
+            eina_list_free(execs);
+        }
         efreet_desktop_command_free(command);
     }
 
@@ -369,6 +370,7 @@ efreet_desktop_command_build(Efreet_Desktop_Command *command)
         Efreet_Desktop_Command_File *file = eina_list_data_get(l);
 
         exec = malloc(size);
+        if (!exec) goto error;
         p = command->desktop->exec;
         len = 0;
 
@@ -376,8 +378,12 @@ efreet_desktop_command_build(Efreet_Desktop_Command *command)
         {
             if (len >= size - 1)
             {
+                char *tmp;
+
                 size = len + 1024;
-                exec = realloc(exec, size);
+                tmp = realloc(exec, size);
+                if (!tmp) goto error;
+                exec = tmp;
             }
 
             /* XXX handle fields inside quotes? */
@@ -394,6 +400,7 @@ efreet_desktop_command_build(Efreet_Desktop_Command *command)
                         {
                             exec = efreet_desktop_command_append_single(exec, &size,
                                     &len, file, *p);
+                            if (!exec) goto error;
                             file_added = 1;
                         }
                         break;
@@ -405,20 +412,24 @@ efreet_desktop_command_build(Efreet_Desktop_Command *command)
                         {
                             exec = efreet_desktop_command_append_multiple(exec, &size,
                                     &len, command, *p);
+                            if (!exec) goto error;
                             file_added = 1;
                         }
                         break;
                     case 'i':
                         exec = efreet_desktop_command_append_icon(exec, &size, &len,
                                 command->desktop);
+                        if (!exec) goto error;
                         break;
                     case 'c':
                         exec = efreet_desktop_command_append_quoted(exec, &size, &len,
                                 command->desktop->name);
+                        if (!exec) goto error;
                         break;
                     case 'k':
                         exec = efreet_desktop_command_append_quoted(exec, &size, &len,
                                 command->desktop->orig_path);
+                        if (!exec) goto error;
                         break;
                     case 'v':
                     case 'm':
@@ -456,18 +467,23 @@ efreet_desktop_command_build(Efreet_Desktop_Command *command)
                 command->desktop->orig_path, command->desktop->exec);
             if (len >= size - 1)
             {
+                char *tmp;
                 size = len + 1024;
-                exec = realloc(exec, size);
+                tmp = realloc(exec, size);
+                if (!tmp) goto error;
+                exec = tmp;
             }
             exec[len++] = ' ';
             exec = efreet_desktop_command_append_multiple(exec, &size,
                     &len, command, 'F');
+            if (!exec) goto error;
             file_added = 1;
         }
 #endif
         exec[len++] = '\0';
 
         execs = eina_list_append(execs, exec);
+        exec = NULL;
 
         /* If no file was added, then the Exec field doesn't contain any file
          * fields (fFuUdDnN). We only want to run the app once in this case. */
@@ -476,6 +492,11 @@ efreet_desktop_command_build(Efreet_Desktop_Command *command)
     while ((l = eina_list_next(l)) != NULL);
 
     return execs;
+error:
+    IF_FREE(exec);
+    EINA_LIST_FREE(execs, exec)
+        free(exec);
+    return NULL;
 }
 
 static void
@@ -500,6 +521,7 @@ efreet_desktop_command_append_quoted(char *dest, int *size, int *len, char *src)
 {
     if (!src) return dest;
     dest = efreet_string_append(dest, size, len, "'");
+    if (!dest) return NULL;
 
     /* single quotes in src need to be escaped */
     if (strchr(src, '\''))
@@ -509,16 +531,24 @@ efreet_desktop_command_append_quoted(char *dest, int *size, int *len, char *src)
         while (*p)
         {
             if (*p == '\'')
+            {
                 dest = efreet_string_append(dest, size, len, "\'\\\'");
+                if (!dest) return NULL;
+            }
 
             dest = efreet_string_append_char(dest, size, len, *p);
+            if (!dest) return NULL;
             p++;
         }
     }
     else
+    {
         dest = efreet_string_append(dest, size, len, src);
+        if (!dest) return NULL;
+    }
 
     dest = efreet_string_append(dest, size, len, "'");
+    if (!dest) return NULL;
 
     return dest;
 }
@@ -539,10 +569,14 @@ efreet_desktop_command_append_multiple(char *dest, int *size, int *len,
         if (first)
             first = 0;
         else
+        {
             dest = efreet_string_append_char(dest, size, len, ' ');
+            if (!dest) return NULL;
+        }
 
         dest = efreet_desktop_command_append_single(dest, size, len,
                                                     file, tolower(type));
+        if (!dest) return NULL;
     }
 
     return dest;
@@ -577,6 +611,7 @@ efreet_desktop_command_append_single(char *dest, int *size, int *len,
     if (!str) return dest;
 
     dest = efreet_desktop_command_append_quoted(dest, size, len, str);
+    if (!dest) return NULL;
 
     return dest;
 }
@@ -588,7 +623,9 @@ efreet_desktop_command_append_icon(char *dest, int *size, int *len,
     if (!desktop->icon || !desktop->icon[0]) return dest;
 
     dest = efreet_string_append(dest, size, len, "--icon ");
+    if (!dest) return NULL;
     dest = efreet_desktop_command_append_quoted(dest, size, len, desktop->icon);
+    if (!dest) return NULL;
 
     return dest;
 }
@@ -653,6 +690,7 @@ efreet_desktop_command_file_process(Efreet_Desktop_Command *command, const char
     else
     {
         char *absol = efreet_desktop_command_path_absolute(file);
+        if (!absol) goto error;
         /* process local uri/path */
         if (command->flags & EFREET_DESKTOP_EXEC_FLAG_FULLPATH)
             f->fullpath = strdup(absol);
@@ -673,6 +711,9 @@ efreet_desktop_command_file_process(Efreet_Desktop_Command *command, const char
     INF("  file: %s", f->file);
 #endif
     return f;
+error:
+    IF_FREE(f);
+    return NULL;
 }
 
 /**
@@ -760,9 +801,12 @@ efreet_desktop_cb_download_complete(void *data, const char *file __UNUSED__,
         Eina_List *execs;
 
         execs = efreet_desktop_command_build(f->command);
-        /* TODO: Need to handle the return value from efreet_desktop_command_execs_process */
-        efreet_desktop_command_execs_process(f->command, execs);
-        eina_list_free(execs);
+        if (execs)
+        {
+            /* TODO: Need to handle the return value from efreet_desktop_command_execs_process */
+            efreet_desktop_command_execs_process(f->command, execs);
+            eina_list_free(execs);
+        }
         efreet_desktop_command_free(f->command);
     }
 }
@@ -809,7 +853,9 @@ efreet_desktop_command_path_absolute(const char *path)
         len = strlen(buf);
 
         if (buf[len-1] != '/') buf = efreet_string_append(buf, &size, &len, "/");
+        if (!buf) return NULL;
         buf = efreet_string_append(buf, &size, &len, path);
+        if (!buf) return NULL;
 
         return buf;
     }
@@ -831,11 +877,18 @@ efreet_string_append(char *dest, int *size, int *len, const char *src)
 
     while (l > *size - *len)
     {
+        char *tmp;
         /* we successfully appended this much */
         off += *size - *len - 1;
         *len = *size - 1;
         *size += 1024;
-        dest = realloc(dest, *size);
+        tmp = realloc(dest, *size);
+        if (!tmp)
+        {
+            free(dest);
+            return NULL;
+        }
+        dest = tmp;
         *(dest + *len) = '\0';
 
         l = eina_strlcpy(dest + *len, src + off, *size - *len);
@@ -850,8 +903,15 @@ efreet_string_append_char(char *dest, int *size, int *len, char c)
 {
     if (*len >= *size - 1)
     {
+        char *tmp;
         *size += 1024;
-        dest = realloc(dest, *size);
+        tmp = realloc(dest, *size);
+        if (!tmp)
+        {
+            free(dest);
+            return NULL;
+        }
+        dest = tmp;
     }
 
     dest[(*len)++] = c;
index 2be1ff6..7157f34 100644 (file)
@@ -1,5 +1,3 @@
-/* vim: set sw=4 ts=4 sts=4 et: */
-
 #ifdef HAVE_CONFIG_H
 # include <config.h>
 #endif
@@ -86,25 +84,10 @@ static void efreet_icon_theme_cache_check(Efreet_Icon_Theme *theme);
 static int efreet_icon_theme_cache_check_dir(Efreet_Icon_Theme *theme,
                                                         const char *dir);
 
-static int efreet_icon_cache_find(Efreet_Icon_Cache *value, const char *key);
-#if 0
-static void efreet_icon_cache_flush(Efreet_Icon_Theme *theme, Eina_List *list);
-#endif
 static void efreet_icon_cache_free(Efreet_Icon_Cache *value);
 static char *efreet_icon_cache_check(Efreet_Icon_Theme *theme, const char *icon, unsigned int size);
 static void efreet_icon_cache_add(Efreet_Icon_Theme *theme, const char *icon, unsigned int size, const char *value);
 
-static Efreet_Icon_Theme *fake_null = NULL;
-
-static void
-_efreet_icon_cache_list_destroy(Eina_List *list)
-{
-    Efreet_Icon_Cache *cache;
-
-    EINA_LIST_FREE(list, cache)
-        efreet_icon_cache_free(cache);
-}
-
 /**
  * @internal
  * @return Returns 1 on success or 0 on failure
@@ -130,7 +113,7 @@ efreet_icon_init(void)
         efreet_icon_themes = eina_hash_string_superfast_new(EINA_FREE_CB(efreet_icon_theme_free));
 
         efreet_extra_icon_dirs = NULL;
-        efreet_icon_cache = eina_hash_pointer_new(EINA_FREE_CB(_efreet_icon_cache_list_destroy));
+        efreet_icon_cache = eina_hash_string_superfast_new(EINA_FREE_CB(efreet_icon_cache_free));
     }
 
     return 1;
@@ -153,12 +136,6 @@ efreet_icon_shutdown(void)
 
     IF_FREE_HASH(efreet_icon_cache);
 
-    if (fake_null)
-    {
-        efreet_icon_theme_free(fake_null);
-        fake_null = NULL;
-    }
-
     ecore_shutdown();
 }
 
@@ -166,7 +143,7 @@ efreet_icon_shutdown(void)
  * @return Returns the user icon directory
  * @brief Returns the user icon directory
  */
-const char *
+static const char *
 efreet_icon_deprecated_user_dir_get(void)
 {
     const char *user;
@@ -176,7 +153,8 @@ efreet_icon_deprecated_user_dir_get(void)
 
     user = efreet_home_dir_get();
     len = strlen(user) + strlen("/.icons") + 1;
-    efreet_icon_deprecated_user_dir = malloc(sizeof(char) * len);
+    efreet_icon_deprecated_user_dir = malloc(len);
+    if (!efreet_icon_deprecated_user_dir) return NULL;
     snprintf(efreet_icon_deprecated_user_dir, len, "%s/.icons", user);
 
     return efreet_icon_deprecated_user_dir;
@@ -192,7 +170,8 @@ efreet_icon_user_dir_get(void)
 
     user = efreet_data_home_get();
     len = strlen(user) + strlen("/icons") + 1;
-    efreet_icon_user_dir = malloc(sizeof(char) * len);
+    efreet_icon_user_dir = malloc(len);
+    if (!efreet_icon_user_dir) return NULL;
     snprintf(efreet_icon_user_dir, len, "%s/icons", user);
 
     return efreet_icon_user_dir;
@@ -259,7 +238,7 @@ efreet_icon_theme_list_get(void)
 
     /* create the list for the user */
     it = eina_hash_iterator_key_new(efreet_icon_themes);
-    eina_iterator_foreach(it, EINA_EACH(_hash_keys), &theme_list);
+    eina_iterator_foreach(it, EINA_EACH_CB(_hash_keys), &theme_list);
     eina_iterator_free(it);
 
     EINA_LIST_FREE(theme_list, dir)
@@ -289,7 +268,7 @@ efreet_icon_theme_find(const char *theme_name)
 {
     Efreet_Icon_Theme *theme;
 
-    if (!theme_name) return fake_null;
+    if (!theme_name) return NULL;
 
     theme = eina_hash_find(efreet_icon_themes, theme_name);
     if (!theme)
@@ -348,23 +327,15 @@ static Efreet_Icon_Theme *
 efreet_icon_find_theme_check(const char *theme_name)
 {
     Efreet_Icon_Theme *theme = NULL;
-    if (theme_name) theme = efreet_icon_theme_find(theme_name);
+    if (!theme_name) return NULL;
+    theme = efreet_icon_theme_find(theme_name);
     if (!theme)
     {
-        if ((fake_null) && (!theme_name)) return fake_null;
         theme = efreet_icon_theme_new();
+        if (!theme) return NULL;
         theme->fake = 1;
-        if (theme_name)
-        {
-            theme->name.internal = eina_stringshare_add(theme_name);
-            eina_hash_del(efreet_icon_themes, (void *)theme->name.internal, NULL);
-            eina_hash_add(efreet_icon_themes, (void *)theme->name.internal, theme);
-        }
-        else
-        {
-            theme->name.internal = NULL;
-            fake_null = theme;
-        }
+        theme->name.internal = eina_stringshare_add(theme_name);
+        eina_hash_add(efreet_icon_themes, (void *)theme->name.internal, theme);
     }
 
     return theme;
@@ -380,22 +351,26 @@ efreet_icon_find_theme_check(const char *theme_name)
 EAPI char *
 efreet_icon_path_find(const char *theme_name, const char *icon, unsigned int size)
 {
-    char *value;
+    char *value = NULL;
     Efreet_Icon_Theme *theme;
 
     theme = efreet_icon_find_theme_check(theme_name);
 
-#ifdef SLOPPY_SPEC
+    if (theme)
     {
-        char *tmp;
+#ifdef SLOPPY_SPEC
+        {
+            char *tmp;
 
-        tmp = efreet_icon_remove_extension(icon);
-        value = efreet_icon_find_helper(theme, tmp, size);
-        FREE(tmp);
-    }
+            tmp = efreet_icon_remove_extension(icon);
+            if (!tmp) return NULL;
+            value = efreet_icon_find_helper(theme, tmp, size);
+            FREE(tmp);
+        }
 #else
-    value = efreet_icon_find_helper(theme, icon, size);
+        value = efreet_icon_find_helper(theme, icon, size);
 #endif
+    }
 
     /* we didn't find the icon in the theme or in the inherited directories
      * then just look for a non theme icon
@@ -429,20 +404,27 @@ efreet_icon_list_find(const char *theme_name, Eina_List *icons,
 
     theme = efreet_icon_find_theme_check(theme_name);
 
-#ifdef SLOPPY_SPEC
+    if (theme)
     {
-        Eina_List *tmps = NULL;
+#ifdef SLOPPY_SPEC
+        {
+            Eina_List *tmps = NULL;
 
-        EINA_LIST_FOREACH(icons, l, icon)
-            tmps = eina_list_append(tmps, efreet_icon_remove_extension(icon));
+            EINA_LIST_FOREACH(icons, l, icon)
+            {
+                data = efreet_icon_remove_extension(icon);
+                if (!data) return NULL;
+                tmps = eina_list_append(tmps, data);
+            }
 
-        value = efreet_icon_list_find_helper(theme, tmps, size);
-        EINA_LIST_FREE(tmps, data)
-            free(data);
-    }
+            value = efreet_icon_list_find_helper(theme, tmps, size);
+            EINA_LIST_FREE(tmps, data)
+                free(data);
+        }
 #else
-    value = efreet_icon_list_find_helper(theme, icons, size);
+        value = efreet_icon_list_find_helper(theme, icons, size);
 #endif
+    }
 
     /* we didn't find the icons in the theme or in the inherited directories
      * then just look for a non theme icon
@@ -549,14 +531,16 @@ efreet_icon_find_helper(Efreet_Icon_Theme *theme,
 
     efreet_icon_theme_cache_check(theme);
 
-    /* go no further if this theme is fake */
-    if (theme->fake || !theme->valid) return NULL;
 
     /* limit recursion in finding themes and inherited themes to 256 levels */
     if (recurse > 256) return NULL;
     recurse++;
 
-    value = efreet_icon_lookup_icon(theme, icon, size);
+    /* go no further if this theme is fake */
+    if (theme->fake || !theme->valid)
+        value = NULL;
+    else
+        value = efreet_icon_lookup_icon(theme, icon, size);
 
     /* we didin't find the image check the inherited themes */
     if (!value || (value == NON_EXISTING))
@@ -815,7 +799,7 @@ efreet_icon_fallback_icon(const char *icon_name)
     char *icon;
 
     if (!icon_name) return NULL;
-    icon = efreet_icon_cache_check(efreet_icon_find_theme_check(NULL), icon_name, 0);
+    icon = efreet_icon_cache_check(NULL, icon_name, 0);
     if (icon) return icon;
 
     icon = efreet_icon_fallback_dir_scan(efreet_icon_deprecated_user_dir_get(), icon_name);
@@ -832,7 +816,7 @@ efreet_icon_fallback_icon(const char *icon_name)
             icon = efreet_icon_fallback_dir_scan(dir, icon_name);
             if (icon)
             {
-                efreet_icon_cache_add(efreet_icon_find_theme_check(NULL), icon_name, 0, icon);
+                efreet_icon_cache_add(NULL, icon_name, 0, icon);
                 return icon;
             }
         }
@@ -845,7 +829,7 @@ efreet_icon_fallback_icon(const char *icon_name)
             icon = efreet_icon_fallback_dir_scan(path, icon_name);
             if (icon)
             {
-                efreet_icon_cache_add(efreet_icon_find_theme_check(NULL), icon_name, 0, icon);
+                efreet_icon_cache_add(NULL, icon_name, 0, icon);
                 return icon;
             }
         }
@@ -856,7 +840,18 @@ efreet_icon_fallback_icon(const char *icon_name)
             icon = efreet_icon_fallback_dir_scan(path, icon_name);
             if (icon)
             {
-                efreet_icon_cache_add(efreet_icon_find_theme_check(NULL), icon_name, 0, icon);
+                efreet_icon_cache_add(NULL, icon_name, 0, icon);
+                return icon;
+            }
+        }
+
+        EINA_LIST_FOREACH(xdg_dirs, l, dir)
+        {
+            snprintf(path, PATH_MAX, "%s/pixmaps", dir);
+            icon = efreet_icon_fallback_dir_scan(path, icon_name);
+            if (icon)
+            {
+                efreet_icon_cache_add(NULL, icon_name, 0, icon);
                 return icon;
             }
         }
@@ -864,7 +859,7 @@ efreet_icon_fallback_icon(const char *icon_name)
         icon = efreet_icon_fallback_dir_scan("/usr/share/pixmaps", icon_name);
     }
 
-    efreet_icon_cache_add(efreet_icon_find_theme_check(NULL), icon_name, 0, icon);
+    efreet_icon_cache_add(NULL, icon_name, 0, icon);
     return icon;
 }
 
@@ -963,6 +958,7 @@ efreet_icon_new(const char *path)
     char *p;
 
     icon = NEW(Efreet_Icon, 1);
+    if (!icon) return NULL;
     icon->path = eina_stringshare_add(path);
 
     /* load the .icon file if it's available */
@@ -1028,6 +1024,7 @@ efreet_icon_populate(Efreet_Icon *icon, const char *file)
     const char *tmp;
 
     ini = efreet_ini_new(file);
+    if (!ini) return;
     if (!ini->data)
     {
         efreet_ini_free(ini);
@@ -1094,6 +1091,7 @@ efreet_icon_populate(Efreet_Icon *icon, const char *file)
             if (!p) break;
 
             point = NEW(Efreet_Icon_Point, 1);
+            if (!point) goto error;
 
             *p = '\0';
             point->x = atoi(s);
@@ -1111,6 +1109,7 @@ efreet_icon_populate(Efreet_Icon *icon, const char *file)
         }
     }
 
+error:
     efreet_ini_free(ini);
 }
 
@@ -1125,6 +1124,7 @@ efreet_icon_theme_new(void)
     Efreet_Icon_Theme *theme;
 
     theme = NEW(Efreet_Icon_Theme, 1);
+    if (!theme) return NULL;
 
     return theme;
 }
@@ -1223,7 +1223,23 @@ efreet_icon_theme_cache_check_dir(Efreet_Icon_Theme *theme, const char *dir)
     /* have we modified this directory since our last cache check? */
     if (stat(dir, &buf) || (buf.st_mtime > theme->last_cache_check))
     {
-        eina_hash_del(efreet_icon_cache, theme, NULL);
+        char key[4096];
+        char *elem;
+        Eina_Iterator *it;
+        Eina_List *keys = NULL;
+        size_t len;
+
+        snprintf(key, sizeof(key), "%s::", theme->name.internal);
+        len = strlen(key);
+
+        it = eina_hash_iterator_key_new(efreet_icon_cache);
+        EINA_ITERATOR_FOREACH(it, elem)
+            if (!strncmp(elem, key, len))
+                keys = eina_list_append(keys, elem);
+        eina_iterator_free(it);
+
+        EINA_LIST_FREE(keys, elem)
+            eina_hash_del_by_key(efreet_icon_cache, elem);
         return 0;
     }
 
@@ -1260,6 +1276,12 @@ efreet_icon_theme_dir_scan_all(const char *theme_name)
         efreet_icon_theme_dir_scan(path, theme_name);
     }
 
+    EINA_LIST_FOREACH(xdg_dirs, l, dir)
+    {
+        snprintf(path, sizeof(path), "%s/pixmaps", dir);
+        efreet_icon_theme_dir_scan(path, theme_name);
+    }
+
     efreet_icon_theme_dir_scan("/usr/share/pixmaps", theme_name);
 }
 
@@ -1305,6 +1327,7 @@ efreet_icon_theme_dir_scan(const char *search_dir, const char *theme_name)
         if (!theme)
         {
             theme = efreet_icon_theme_new();
+            if (!theme) goto error;
             theme->name.internal = key;
             eina_hash_add(efreet_icon_themes,
                           (void *)theme->name.internal, theme);
@@ -1326,6 +1349,7 @@ efreet_icon_theme_dir_scan(const char *search_dir, const char *theme_name)
         if (ecore_file_exists(path))
             efreet_icon_theme_index_read(theme, path);
     }
+error:
     closedir(dirs);
 
     /* if we were given a theme name we want to make sure that that given
@@ -1350,12 +1374,15 @@ efreet_icon_theme_dir_scan(const char *search_dir, const char *theme_name)
 static void
 efreet_icon_theme_index_read(Efreet_Icon_Theme *theme, const char *path)
 {
+    /* TODO: return error value */
     Efreet_Ini *ini;
+    Efreet_Icon_Theme_Directory *dir;
     const char *tmp;
 
     if (!theme || !path) return;
 
     ini = efreet_ini_new(path);
+    if (!ini) return;
     if (!ini->data)
     {
         efreet_ini_free(ini);
@@ -1420,13 +1447,15 @@ efreet_icon_theme_index_read(Efreet_Icon_Theme *theme, const char *path)
 
             if (p) *p = '\0';
 
-            theme->directories = eina_list_append(theme->directories,
-                            efreet_icon_theme_directory_new(ini, s));
+            dir = efreet_icon_theme_directory_new(ini, s);
+            if (!dir) goto error;
+            theme->directories = eina_list_append(theme->directories, dir);
 
             if (p) s = ++p;
         }
     }
 
+error:
     efreet_ini_free(ini);
 }
 
@@ -1448,7 +1477,7 @@ efreet_icon_theme_dir_validity_check(void)
 
     keys = NULL;
     it = eina_hash_iterator_key_new(efreet_icon_themes);
-    eina_iterator_foreach(it, EINA_EACH(_hash_keys), &keys);
+    eina_iterator_foreach(it, EINA_EACH_CB(_hash_keys), &keys);
     eina_iterator_free(it);
 
     EINA_LIST_FREE(keys, name)
@@ -1480,6 +1509,7 @@ efreet_icon_theme_directory_new(Efreet_Ini *ini, const char *name)
     if (!ini) return NULL;
 
     dir = NEW(Efreet_Icon_Theme_Directory, 1);
+    if (!dir) return NULL;
     dir->name = eina_stringshare_add(name);
 
     efreet_ini_section_set(ini, name);
@@ -1551,36 +1581,6 @@ efreet_icon_theme_directory_free(Efreet_Icon_Theme_Directory *dir)
     FREE(dir);
 }
 
-static int
-efreet_icon_cache_find(Efreet_Icon_Cache *value, const char *key)
-{
-    if (!value || !key) return -1;
-    return strcmp(value->key, key);
-}
-
-#if 0
-static void
-efreet_icon_cache_flush(Efreet_Icon_Theme *theme, Eina_List *list)
-{
-    /* TODO:
-     * * Dynamic cache size
-     * * Maybe add references to cache, so that we sort on how often a value is used
-     */
-    while (eina_list_count(list) > 100)
-    {
-        Efreet_Icon_Cache *cache;
-        Eina_List *last;
-
-        last = eina_list_last(list);
-        cache = eina_list_data_get(last);
-        efreet_icon_cache_free(cache);
-        list = eina_list_remove_list(list, last);
-    }
-
-    eina_hash_modify(efreet_icon_cache, theme, list);
-}
-#endif
-
 static void
 efreet_icon_cache_free(Efreet_Icon_Cache *value)
 {
@@ -1594,34 +1594,23 @@ efreet_icon_cache_free(Efreet_Icon_Cache *value)
 static char *
 efreet_icon_cache_check(Efreet_Icon_Theme *theme, const char *icon, unsigned int size)
 {
-    Eina_List *list;
     Efreet_Icon_Cache *cache;
     char key[4096];
     struct stat st;
 
-    list = eina_hash_find(efreet_icon_cache, theme);
-    if (!list) return NULL;
+    if (theme)
+        snprintf(key, sizeof(key), "%s::%s::%d", theme->name.internal, icon, size);
+    else
+        snprintf(key, sizeof(key), "(null)::%s::%d", icon, size);
 
-    snprintf(key, sizeof(key), "%s %d", icon, size);
-    cache = eina_list_search_unsorted(list, EINA_COMPARE_CB(efreet_icon_cache_find), key);
+    cache = eina_hash_find(efreet_icon_cache, key);
     if (cache)
     {
         if (!cache->path)
-        {
-            list = eina_list_promote_list(list, eina_list_data_find_list(list, cache));
-            eina_hash_modify(efreet_icon_cache, theme, list);
             return NON_EXISTING;
-        }
         else if (!stat(cache->path, &st) && st.st_mtime == cache->lasttime)
-        {
-            list = eina_list_promote_list(list, eina_list_data_find_list(list, cache));
-            eina_hash_modify(efreet_icon_cache, theme, list);
             return strdup(cache->path);
-        }
-        efreet_icon_cache_free(cache);
-        list = eina_list_remove(list, cache);
-        if (list != NULL) eina_hash_modify(efreet_icon_cache, theme, list);
-        else eina_hash_del(efreet_icon_cache, theme, NULL);
+        eina_hash_del_by_key(efreet_icon_cache, key);
     }
     return NULL;
 }
@@ -1629,16 +1618,17 @@ efreet_icon_cache_check(Efreet_Icon_Theme *theme, const char *icon, unsigned int
 static void
 efreet_icon_cache_add(Efreet_Icon_Theme *theme, const char *icon, unsigned int size, const char *value)
 {
-    Eina_List *list, *l;
     Efreet_Icon_Cache *cache;
     char key[4096];
     struct stat st;
 
-    list = eina_hash_find(efreet_icon_cache, theme);
-
-    snprintf(key, sizeof(key), "%s %d", icon, size);
     cache = NEW(Efreet_Icon_Cache, 1);
-    cache->key = eina_stringshare_add(key);
+    if (!cache) return;
+    if (theme)
+        snprintf(key, sizeof(key), "%s::%s::%d", theme->name.internal, icon, size);
+    else
+        snprintf(key, sizeof(key), "(null)::%s::%d", icon, size);
+
     if ((value) && !stat(value, &st))
     {
         cache->path = eina_stringshare_add(value);
@@ -1647,11 +1637,5 @@ efreet_icon_cache_add(Efreet_Icon_Theme *theme, const char *icon, unsigned int s
     else
         cache->lasttime = ecore_time_get();
 
-    l = list;
-    list = eina_list_prepend(list, cache);
-
-    if (!l) eina_hash_add(efreet_icon_cache, theme, list);
-    else eina_hash_modify(efreet_icon_cache, theme, list);
-
-    //efreet_icon_cache_flush(theme, list);
+    eina_hash_set(efreet_icon_cache, key, cache);
 }
index 66cd03f..e6f86f1 100644 (file)
@@ -1,4 +1,3 @@
-/* vim: set sw=4 ts=4 sts=4 et: */
 #ifndef EFREET_ICON_H
 #define EFREET_ICON_H
 
index 5d9c2be..ecb9bd4 100644 (file)
@@ -1,5 +1,3 @@
-/* vim: set sw=4 ts=4 sts=4 et: */
-
 #ifdef HAVE_CONFIG_H
 # include <config.h>
 #endif
@@ -24,7 +22,7 @@
 static int _efreet_ini_log_dom = -1;
 
 static Eina_Hash *efreet_ini_parse(const char *file);
-static const char *efreet_ini_unescape(const char *str);
+static const char *efreet_ini_unescape(const char *str) EINA_ARG_NONNULL(1);
 static Eina_Bool
 efreet_ini_section_save(const Eina_Hash *hash, const void *key, void *data, void *fdata);
 static Eina_Bool
@@ -197,7 +195,7 @@ efreet_ini_parse(const char *file)
 
         if (sep < line_length)
         {
-            const char *key, *value;
+            char *key, *value;
             int key_end, value_start, value_end;
 
             /* trim whitespace from end of key */
@@ -234,16 +232,16 @@ efreet_ini_parse(const char *file)
                 goto next_line;
             }
 
-            key = alloca((key_end + 1) * sizeof(unsigned char));
-            value = alloca((value_end - value_start + 1) * sizeof(unsigned char));
+            key = alloca(key_end + 1);
+            value = alloca(value_end - value_start + 1);
             if (!key || !value) goto next_line;
 
-            memcpy((char*)key, line_start, key_end);
-            ((char*)key)[key_end] = '\0';
+            memcpy(key, line_start, key_end);
+            key[key_end] = '\0';
 
-            memcpy((char*)value, line_start + value_start,
+            memcpy(value, line_start + value_start,
                     value_end - value_start);
-            ((char*)value)[value_end - value_start] = '\0';
+            value[value_end - value_start] = '\0';
 
             eina_hash_del_by_key(section, key);
             eina_hash_add(section, key, efreet_ini_unescape(value));
@@ -522,7 +520,7 @@ efreet_ini_localestring_get(Efreet_Ini *ini, const char *key)
     if (country) maxlen += strlen(country);
     if (modifier) maxlen += strlen(modifier);
 
-    buf = malloc(maxlen * sizeof(char));
+    buf = alloca(maxlen);
 
     if (lang && modifier && country)
     {
@@ -555,8 +553,6 @@ efreet_ini_localestring_get(Efreet_Ini *ini, const char *key)
     if (!found)
         val = efreet_ini_string_get(ini, key);
 
-    FREE(buf);
-
     return val;
 }
 
@@ -585,7 +581,7 @@ efreet_ini_localestring_set(Efreet_Ini *ini, const char *key, const char *value)
     if (country) maxlen += strlen(country);
     if (modifier) maxlen += strlen(modifier);
 
-    buf = malloc(maxlen * sizeof(char));
+    buf = alloca(maxlen);
 
     if (lang && modifier && country)
         snprintf(buf, maxlen, "%s[%s_%s@%s]", key, lang, country, modifier);
@@ -599,7 +595,6 @@ efreet_ini_localestring_set(Efreet_Ini *ini, const char *key, const char *value)
         return;
 
     efreet_ini_string_set(ini, buf, value);
-    FREE(buf);
 }
 
 /**
@@ -627,7 +622,6 @@ efreet_ini_unescape(const char *str)
     char *buf, *dest;
     const char *p;
 
-    if (!str) return NULL;
     if (!strchr(str, '\\')) return eina_stringshare_add(str);
     buf = alloca(strlen(str) + 1);
 
index 17be511..4bc2be6 100644 (file)
@@ -1,4 +1,3 @@
-/* vim: set sw=4 ts=4 sts=4 et: */
 #ifndef EFREET_INI_H
 #define EFREET_INI_H
 
index a80a12b..e9c1566 100644 (file)
@@ -1,5 +1,3 @@
-/* vim: set sw=4 ts=4 sts=4 et: */
-
 /* TODO: Check where strcmp can be changed with == because of stringshare */
 
 #ifdef HAVE_CONFIG_H
@@ -274,11 +272,11 @@ static Efreet_Desktop *efreet_menu_directory_get(Efreet_Menu_Internal *internal,
                                                     const char *path);
 static void efreet_menu_process_filters(Efreet_Menu_Internal *internal,
                                             unsigned int only_unallocated);
-static Eina_List * efreet_menu_process_app_pool(Eina_List *pool,
-                                                Eina_List *applications,
-                                                Eina_Hash *matches,
-                                                Efreet_Menu_Filter *filter,
-                                                unsigned int only_unallocated);
+static Eina_List *efreet_menu_process_app_pool(Eina_List *pool,
+                                               Eina_List *applications,
+                                               Eina_Hash *matches,
+                                               Efreet_Menu_Filter *filter,
+                                               unsigned int only_unallocated);
 static int efreet_menu_filter_matches(Efreet_Menu_Filter_Op *op,
                                         Efreet_Menu_Desktop *md);
 static int efreet_menu_filter_or_matches(Efreet_Menu_Filter_Op *op,
@@ -400,7 +398,7 @@ efreet_menu_init(void)
 
     struct
     {
-        char *key;
+        const char *key;
         int (*cb)(Efreet_Menu_Internal *parent, Efreet_Xml *xml);
     } menu_cbs[] = {
         {"Menu", efreet_menu_handle_sub_menu},
@@ -429,7 +427,7 @@ efreet_menu_init(void)
 
     struct
     {
-        char *key;
+        const char *key;
         int (*cb)(Efreet_Menu_Filter_Op *op, Efreet_Xml *xml);
     } filter_cbs[] = {
         {"Filename", efreet_menu_handle_filename},
@@ -443,7 +441,7 @@ efreet_menu_init(void)
 
     struct
     {
-        char *key;
+        const char *key;
         int (*cb)(Efreet_Menu_Internal *parent, Efreet_Xml *xml);
     } move_cbs[] = {
         {"Old", efreet_menu_handle_old},
@@ -453,7 +451,7 @@ efreet_menu_init(void)
 
     struct
     {
-        char *key;
+        const char *key;
         int (*cb)(Efreet_Menu_Internal *parent, Efreet_Xml *xml, int def);
     } layout_cbs[] = {
         {"Menuname", efreet_menu_handle_layout_menuname},
@@ -702,6 +700,7 @@ efreet_menu_parse(const char *path)
 
     /* split appart the filename and the path */
     internal = efreet_menu_internal_new();
+    if (!internal) return NULL;
 
     /* Set default values */
     internal->show_empty = 0;
@@ -953,7 +952,7 @@ efreet_menu_dump(Efreet_Menu *menu, const char *indent)
         size_t len;
 
         len = strlen(indent) + 3;
-        new_indent = malloc(sizeof(char *) * len);
+        new_indent = alloca(len);
         snprintf(new_indent, len, "%s  ", indent);
 
         EINA_LIST_FOREACH(menu->entries, l, entry)
@@ -967,8 +966,6 @@ efreet_menu_dump(Efreet_Menu *menu, const char *indent)
             else if (entry->type == EFREET_MENU_ENTRY_HEADER)
                 INF("%s|---%s", new_indent, entry->name);
         }
-
-        FREE(new_indent);
     }
 }
 
@@ -1014,6 +1011,7 @@ efreet_menu_internal_new(void)
     Efreet_Menu_Internal *internal;
 
     internal = NEW(Efreet_Menu_Internal, 1);
+    if (!internal) return NULL;
     internal->show_empty = -1;
     internal->in_line = -1;
     internal->inline_limit = -1;
@@ -1125,6 +1123,7 @@ efreet_menu_handle_sub_menu(Efreet_Menu_Internal *parent, Efreet_Xml *xml)
     efreet_menu_create_sub_menu_list(parent);
 
     internal = efreet_menu_internal_new();
+    if (!internal) return 0;
     internal->file.path = eina_stringshare_add(parent->file.path);
     if (!efreet_menu_handle_menu(internal, xml))
     {
@@ -1685,6 +1684,7 @@ efreet_menu_merge(Efreet_Menu_Internal *parent, Efreet_Xml *xml, const char *pat
     FREE(rp);
 
     internal = efreet_menu_internal_new();
+    if (!internal) return 0;
     efreet_menu_path_set(internal, path);
     efreet_menu_handle_menu(internal, merge_xml);
     efreet_menu_concatenate(parent, internal);
@@ -1848,8 +1848,11 @@ efreet_menu_handle_legacy_dir(Efreet_Menu_Internal *parent, Efreet_Xml *xml)
 
     legacy = efreet_menu_handle_legacy_dir_helper(NULL, parent, xml->text,
                                 efreet_xml_attribute_get(xml, "prefix"));
-    efreet_menu_concatenate(parent, legacy);
-    efreet_menu_internal_free(legacy);
+    if (legacy)
+    {
+        efreet_menu_concatenate(parent, legacy);
+        efreet_menu_internal_free(legacy);
+    }
 
     return 1;
 
@@ -1883,13 +1886,15 @@ efreet_menu_handle_legacy_dir_helper(Efreet_Menu_Internal *root,
     path = efreet_menu_path_get(parent, legacy_dir);
 
     /* nothing to do if the legacy path doesn't exist */
-    if (!ecore_file_exists(path))
+    if (!path || !ecore_file_exists(path))
     {
         eina_stringshare_del(path);
         return NULL;
     }
 
     legacy_internal = efreet_menu_internal_new();
+    if (!legacy_internal)
+        return NULL;
     legacy_internal->name.internal = eina_stringshare_add(ecore_file_file_get(path));
 
     /* add the legacy dir as an app dir */
@@ -1919,6 +1924,11 @@ efreet_menu_handle_legacy_dir_helper(Efreet_Menu_Internal *root,
     /* setup a filter for all the conforming .desktop files in the legacy
      * dir */
     filter = efreet_menu_filter_new();
+    if (!filter)
+    {
+        efreet_menu_internal_free(legacy_internal);
+        return NULL;
+    }
     filter->type = EFREET_MENU_FILTER_INCLUDE;
 
     filter->op->type = EFREET_MENU_FILTER_OP_OR;
@@ -2381,6 +2391,7 @@ efreet_menu_handle_filter(Efreet_Menu_Internal *parent, Efreet_Xml *xml,
 
     /* filters have a default or relationship */
     filter = efreet_menu_filter_new();
+    if (!filter) return 0;
     filter->type = type;
     filter->op->type = EFREET_MENU_FILTER_OP_OR;
 
@@ -2438,6 +2449,7 @@ efreet_menu_filter_new(void)
     Efreet_Menu_Filter *filter;
 
     filter = NEW(Efreet_Menu_Filter, 1);
+    if (!filter) return NULL;
     filter->op = efreet_menu_filter_op_new();
     if (!filter->op)
     {
@@ -2797,8 +2809,6 @@ efreet_menu_process_app_pool(Eina_List *pool, Eina_List *applications,
     Efreet_Menu_Desktop *md;
     Eina_List *l;
 
-    if (!pool) return NULL;
-
     EINA_LIST_FOREACH(pool, l, md)
     {
         if (eina_hash_find(matches, md->id)) continue;
@@ -3123,6 +3133,7 @@ efreet_menu_resolve_moves(Efreet_Menu_Internal *internal)
                 *path = '\0';
 
                 ancestor = efreet_menu_internal_new();
+                if (!ancestor) goto error;
                 ancestor->name.internal = eina_stringshare_add(tmp);
 
                 efreet_menu_create_sub_menu_list(parent);
@@ -3145,6 +3156,7 @@ efreet_menu_resolve_moves(Efreet_Menu_Internal *internal)
             efreet_menu_internal_free(origin);
         }
     }
+error:
     IF_FREE_LIST(internal->moves, efreet_menu_move_free);
 }
 
index 8a86c30..0376813 100644 (file)
@@ -1,4 +1,3 @@
-/* vim: set sw=4 ts=4 sts=4 et: */
 #ifndef EFREET_MENU_H
 #define EFREET_MENU_H
 
index 76eacb1..0ba2add 100644 (file)
@@ -1,5 +1,3 @@
-/* vim: set sw=4 ts=4 sts=4 et: */
-
 #ifdef HAVE_CONFIG_H
 # include <config.h>
 #endif
@@ -303,6 +301,9 @@ efreet_mime_type_get(const char *file)
 {
     const char *type = NULL;
 
+    if (!file)
+      return NULL;
+
     if ((type = efreet_mime_special_check(file)))
         return type;
 
@@ -451,6 +452,8 @@ efreet_mime_globs_type_get(const char *file)
     char *ext, *mime;
 
     /* Check in the extension hash for the type */
+    if (!file) return NULL;
+
     ext = strchr(file, '.');
     if (ext)
     {
@@ -738,7 +741,7 @@ efreet_mime_special_check(const char *file)
 
 #ifndef _WIN32
         if (S_ISLNK(s.st_mode))
-           return _mime_inode_symlink;
+        return _mime_inode_symlink;
 #endif
 
         if (S_ISFIFO(s.st_mode))
@@ -1149,6 +1152,7 @@ efreet_mime_shared_mimeinfo_magic_parse(char *data, int size)
                 case '=':
                     ptr++;
 
+                    tshort = 0;
                     memcpy(&tshort, ptr, sizeof(short));
                     entry->value_len = ntohs(tshort);
                     ptr += 2;
@@ -1299,7 +1303,7 @@ efreet_mime_magic_check_priority(const char *file,
             else if ((level > e->indent) && match)
             {
                 fclose(f);
-                if (last_mime) return last_mime;
+                return last_mime;
             }
 
             for (offset = e->offset; offset < e->offset + e->range_len; offset++)
@@ -1372,15 +1376,9 @@ static void
 efreet_mime_magic_free(void *data)
 {
     Efreet_Mime_Magic *m = data;
-    Efreet_Mime_Magic_Entry *entry = NULL;
 
     IF_RELEASE(m->mime);
-    while (m->entries)
-    {
-        entry = eina_list_data_get(m->entries);
-        efreet_mime_magic_entry_free(entry);
-        m->entries = eina_list_remove_list(m->entries, m->entries);
-    }
+    IF_FREE_LIST(m->entries, efreet_mime_magic_entry_free);
     IF_FREE(m);
 }
 
index c8845a1..21969b3 100644 (file)
@@ -1,4 +1,3 @@
-/* vim: set sw=4 ts=4 sts=4 et: */
 #ifndef EFREET_PRIVATE_H
 #define EFREET_PRIVATE_H
 
index 6e5b7d4..2dbde69 100644 (file)
@@ -1,5 +1,3 @@
-/* vim: set sw=4 ts=4 sts=4 et: */
-
 #ifdef HAVE_CONFIG_H
 # include <config.h>
 #endif
@@ -84,84 +82,84 @@ efreet_trash_dir_get(const char *file)
 
     if (file)
     {
-       if (stat(efreet_data_home_get(), &s_dest) != 0)
-           return NULL;
+        if (stat(efreet_data_home_get(), &s_dest) != 0)
+            return NULL;
 
-       if (stat(file, &s_src) != 0)
-           return NULL;
+        if (stat(file, &s_src) != 0)
+            return NULL;
     }
 
     if (!file || s_src.st_dev == s_dest.st_dev)
     {
-       if (efreet_trash_dir && ecore_file_exists(efreet_trash_dir))
-       {
-           eina_stringshare_ref(efreet_trash_dir);
-           return efreet_trash_dir;
-       }
-
-       snprintf(buf, sizeof(buf), "%s/Trash", efreet_data_home_get());
-       if (!ecore_file_exists(buf) && !ecore_file_mkpath(buf))
-           return NULL;
-
-       IF_RELEASE(efreet_trash_dir);
-       efreet_trash_dir = eina_stringshare_add(buf);
-       trash_dir = eina_stringshare_ref(efreet_trash_dir);
+        if (efreet_trash_dir && ecore_file_exists(efreet_trash_dir))
+        {
+            eina_stringshare_ref(efreet_trash_dir);
+            return efreet_trash_dir;
+        }
+
+        snprintf(buf, sizeof(buf), "%s/Trash", efreet_data_home_get());
+        if (!ecore_file_exists(buf) && !ecore_file_mkpath(buf))
+            return NULL;
+
+        IF_RELEASE(efreet_trash_dir);
+        efreet_trash_dir = eina_stringshare_add(buf);
+        trash_dir = eina_stringshare_ref(efreet_trash_dir);
     }
     else
     {
-       char *dir;
-       char path[PATH_MAX];
-
-       strncpy(buf, file, PATH_MAX);
-       buf[PATH_MAX - 1] = 0;
-       path[0] = 0;
-
-       while (strlen(buf) > 1)
-       {
-           strncpy(path, buf, PATH_MAX);
-           dir = dirname(buf);
-
-           if (stat(dir, &s_dest) == 0)
-           {
-               if (s_src.st_dev == s_dest.st_dev){
-
-                   strncpy(buf, dir, PATH_MAX);
-                   continue;
-               }
-               else
-               {
-                   /* other device */
-                   break;
-               }
-           }
-           path[0] = 0;
-           break;
-       }
-
-       if (path[0])
-       {
-           snprintf(buf, sizeof(buf), "%s/.Trash-%d", path, getuid());
-           if (!ecore_file_exists(buf) && !ecore_file_mkpath(buf))
-               return NULL;
-
-           trash_dir = eina_stringshare_add(buf);
-       }
+        char *dir;
+        char path[PATH_MAX];
+
+        strncpy(buf, file, PATH_MAX);
+        buf[PATH_MAX - 1] = 0;
+        path[0] = 0;
+
+        while (strlen(buf) > 1)
+        {
+            strncpy(path, buf, PATH_MAX);
+            dir = dirname(buf);
+
+            if (stat(dir, &s_dest) == 0)
+            {
+                if (s_src.st_dev == s_dest.st_dev){
+
+                    strncpy(buf, dir, PATH_MAX);
+                    continue;
+                }
+                else
+                {
+                    /* other device */
+                    break;
+                }
+            }
+            path[0] = 0;
+            break;
+        }
+
+        if (path[0])
+        {
+            snprintf(buf, sizeof(buf), "%s/.Trash-%d", path, getuid());
+            if (!ecore_file_exists(buf) && !ecore_file_mkpath(buf))
+                return NULL;
+
+            trash_dir = eina_stringshare_add(buf);
+        }
     }
     if (trash_dir)
     {
-       snprintf(buf, sizeof(buf), "%s/files", trash_dir);
-       if (!ecore_file_exists(buf) && !ecore_file_mkpath(buf))
-       {
-           eina_stringshare_del(trash_dir);
-           return NULL;
-       }
-
-       snprintf(buf, sizeof(buf), "%s/info", trash_dir);
-       if (!ecore_file_exists(buf) && !ecore_file_mkpath(buf))
-       {
-           eina_stringshare_del(trash_dir);
-           return NULL;
-       }
+        snprintf(buf, sizeof(buf), "%s/files", trash_dir);
+        if (!ecore_file_exists(buf) && !ecore_file_mkpath(buf))
+        {
+            eina_stringshare_del(trash_dir);
+            return NULL;
+        }
+
+        snprintf(buf, sizeof(buf), "%s/info", trash_dir);
+        if (!ecore_file_exists(buf) && !ecore_file_mkpath(buf))
+        {
+            eina_stringshare_del(trash_dir);
+            return NULL;
+        }
     }
 
     return trash_dir;
@@ -197,42 +195,42 @@ efreet_trash_delete_uri(Efreet_Uri *uri, int force_delete)
     trash_dir = efreet_trash_dir_get(uri->path);
     if (!trash_dir)
     {
-       ERR("EFREET TRASH ERROR: No trash directory.");
-       return 0;
+        ERR("EFREET TRASH ERROR: No trash directory.");
+        return 0;
     }
     snprintf(dest, sizeof(dest), "%s/files/%s", trash_dir, fname);
 
     /* search for a free filename */
     while (ecore_file_exists(dest) && (i < 100))
-       snprintf(dest, sizeof(dest), "%s/files/%s$%d",
-                   trash_dir, fname, i++);
+        snprintf(dest, sizeof(dest), "%s/files/%s$%d",
+                    trash_dir, fname, i++);
 
     fname = ecore_file_file_get(dest);
 
     /* move file to trash dir */
     if (rename(uri->path, dest))
     {
-       if (errno == EXDEV)
-       {
-           if (!force_delete)
-           {
-               eina_stringshare_del(trash_dir);
-               return -1;
-           }
-
-           if (!ecore_file_recursive_rm(uri->path))
-           {
-               ERR("EFREET TRASH ERROR: Can't delete file.");
-               eina_stringshare_del(trash_dir);
-               return 0;
-           }
-       }
-       else
-       {
-           ERR("EFREET TRASH ERROR: Can't move file to trash.");
-           eina_stringshare_del(trash_dir);
-           return 0;
-       }
+        if (errno == EXDEV)
+        {
+            if (!force_delete)
+            {
+                eina_stringshare_del(trash_dir);
+                return -1;
+            }
+
+            if (!ecore_file_recursive_rm(uri->path))
+            {
+                ERR("EFREET TRASH ERROR: Can't delete file.");
+                eina_stringshare_del(trash_dir);
+                return 0;
+            }
+        }
+        else
+        {
+            ERR("EFREET TRASH ERROR: Can't move file to trash.");
+            eina_stringshare_del(trash_dir);
+            return 0;
+        }
     }
 
     /* create info file */
@@ -240,24 +238,24 @@ efreet_trash_delete_uri(Efreet_Uri *uri, int force_delete)
 
     if ((f = fopen(dest, "w")))
     {
-       fputs("[Trash Info]\n", f); //TODO is '\n' right?? (or \r\c??)
-
-       fputs("Path=", f);
-       escaped = efreet_uri_encode(uri);
-       fputs(escaped + 7, f); // +7 == don't write 'file://'
-       IF_RELEASE(escaped);
-
-       time(&now);
-       strftime(times, sizeof(times), "%Y-%m-%dT%H:%M:%S", localtime(&now));
-       fputs("\nDeletionDate=", f);
-       fputs(times, f);
-       fputs("\n", f);
-       fclose(f);
+        fputs("[Trash Info]\n", f); //TODO is '\n' right?? (or \r\c??)
+
+        fputs("Path=", f);
+        escaped = efreet_uri_encode(uri);
+        fputs(escaped + 7, f); // +7 == don't write 'file://'
+        IF_RELEASE(escaped);
+
+        time(&now);
+        strftime(times, sizeof(times), "%Y-%m-%dT%H:%M:%S", localtime(&now));
+        fputs("\nDeletionDate=", f);
+        fputs(times, f);
+        fputs("\n", f);
+        fclose(f);
     }
     else
     {
-       ERR("EFREET TRASH ERROR: Can't create trash info file.");
-       return 0;
+        ERR("EFREET TRASH ERROR: Can't create trash info file.");
+        return 0;
     }
 
     return 1;
index 9b5b324..39e657c 100644 (file)
@@ -1,5 +1,3 @@
-/* vim: set sw=4 ts=4 sts=4 et: */
-
 #ifdef HAVE_CONFIG_H
 # include <config.h>
 #endif
index 7f5d14a..97e3a6a 100644 (file)
@@ -1,4 +1,3 @@
-/* vim: set sw=4 ts=4 sts=4 et: */
 #ifndef EFREET_URI_H
 #define EFREET_URI_H
 
index 0f27457..85503a8 100644 (file)
@@ -1,5 +1,3 @@
-/* vim: set sw=4 ts=4 sts=4 et: */
-
 #ifdef HAVE_CONFIG_H
 # include <config.h>
 #endif
index cd9e595..bac7222 100644 (file)
@@ -1,4 +1,3 @@
-/* vim: set sw=4 ts=4 sts=4 et: */
 #ifndef EFREET_UTILS_H
 #define EFREET_UTILS_H
 
index 226c9ef..745548b 100644 (file)
@@ -1,5 +1,3 @@
-/* vim: set sw=4 ts=4 sts=4 et: */
-
 #ifdef HAVE_CONFIG_H
 # include <config.h>
 #endif
@@ -108,7 +106,7 @@ efreet_xml_new(const char *file)
 
     error = 0;
     xml = efreet_xml_parse(&data, &size);
-    if (error) goto efreet_error;
+    if (!xml || error) goto efreet_error;
 
     munmap(data, size);
     close(fd);
@@ -458,6 +456,7 @@ efreet_xml_attributes_parse(char **data, int *size,
     }
 
     *attributes = NEW(Efreet_Xml_Attribute *, count + 1);
+    if (!*attributes) goto efreet_error;
     for (i = 0; i < count; i++)
     {
         (*attributes)[i] = malloc(sizeof(Efreet_Xml_Attribute));
index 08f7d4f..77473cc 100644 (file)
@@ -1,4 +1,3 @@
-/* vim: set sw=4 ts=4 sts=4 et: */
 #ifndef EFREET_XML_H
 #define EFREET_XML_H
 
index 7dcb6bb..01a073a 100644 (file)
@@ -1,4 +1,3 @@
-/* vim: set sw=4 ts=4 sts=4 et: */
 #include "Efreet.h"
 #include <stdio.h>
 #include <Ecore.h>
index 6f2a1a0..3b5c701 100644 (file)
@@ -116,7 +116,7 @@ ef_cb_efreet_icon_theme_list(void)
 
     themes = NULL;
     it = eina_hash_iterator_key_new(dirs);
-    eina_iterator_foreach(it, EINA_EACH(_hash_keys), &themes);
+    eina_iterator_foreach(it, EINA_EACH_CB(_hash_keys), &themes);
     eina_iterator_free(it);
 
     if (eina_list_count(themes) > 0)
index e15a93d..4adbd94 100644 (file)
@@ -1,4 +1,3 @@
-/* vim: set sw=4 ts=4 sts=4 et: */
 #include "Efreet.h"
 #include "config.h"
 #include <stdio.h>
index 7cf1e02..9c49eed 100644 (file)
@@ -1,4 +1,3 @@
-/* vim: set sw=4 ts=4 sts=4 et: */
 #include "Efreet.h"
 #include "Efreet_Mime.h"
 #include "config.h"
index 7fc69ff..67e10ca 100644 (file)
@@ -1,4 +1,3 @@
-/* vim: set sw=4 ts=4 sts=4 et: */
 #include "Efreet.h"
 #include "efreet_private.h"
 #include <stdio.h>
index 5d1ddec..3298e6b 100644 (file)
@@ -1,4 +1,3 @@
-/* vim: set sw=4 ts=4 sts=4 et: */
 #include "Efreet.h"
 #include "Efreet_Mime.h"
 #include <Ecore.h>