-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.
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.
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
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
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.
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.
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
==================
./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
======================
-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
+
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
-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])
AC_SUBST(release_info)
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
+VMAJ=v_maj
+AC_SUBST(VMAJ)
### Needed information
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
-Revision 49550
-Last Changed Rev 49545
+Revision 51480
+Last Changed Rev 51383
10
dir
-49550
+51480
https://svn.enlightenment.org/svn/e/trunk/efreet/debian/patches
https://svn.enlightenment.org/svn/e
-2010-06-07T03:18:00.000000Z
+2010-09-07T23:59:08.000000Z
2cc70c66d5c7a6eeb899e4e8d3b30a96
2009-04-19T16:22:00.135825Z
40226
# 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
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
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
+/*
+ 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%;
}
+
+ <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 ©$year Enlightenment</td>
+ <td class="generated">Docs generated $datetime</td>
+ </tr></table>
</div>
- <hr />
- <p class="tiny">Copyright © Enlightenment.org</p>
- <p class="tiny">$projectname Documentation Generated: $datetime</p>
- </body>
+
+
+</body>
</html>
-<!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 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 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">
--- /dev/null
+/*
+ * 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%;
+}
+
@pkgconfig_requires_private@: @requirement_efreet@
Version: @VERSION@
Libs: -L${libdir} -lefreet_mime
-Cflags: -I${includedir}/efreet
+Cflags: -I${includedir}/efreet-@VMAJ@
@pkgconfig_requires_private@: @requirement_efreet@
Version: @VERSION@
Libs: -L${libdir} -lefreet_trash
-Cflags: -I${includedir}/efreet
+Cflags: -I${includedir}/efreet-@VMAJ@
@pkgconfig_requires_private@: @requirement_efreet@
Version: @VERSION@
Libs: -L${libdir} -lefreet
-Cflags: -I${includedir}/efreet
+Cflags: -I${includedir}/efreet-@VMAJ@
-/* vim: set sw=4 ts=4 sts=4 et: */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#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"
struct stat st;
int changed = 0;
int i;
+ struct flock fl;
for (i = 1; i < argc; i++)
{
/* 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)
{
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);
-/* vim: set sw=4 ts=4 sts=4 et: */
#ifndef EFREET_H
#define EFREET_H
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
{
-/* vim: set sw=4 ts=4 sts=4 et: */
#ifndef EFREET_MIME_H
#define EFREET_MIME_H
-/* vim: set sw=4 ts=4 sts=4 et: */
#ifndef EFREET_TRASH_H
#define EFREET_TRASH_H
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 = \
-/* vim: set sw=4 ts=4 sts=4 et: */
-
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
-/* vim: set sw=4 ts=4 sts=4 et: */
-
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
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);
-/* vim: set sw=4 ts=4 sts=4 et: */
#ifndef EFREET_BASE_H
#define EFREET_BASE_H
/**
-/* vim: set sw=4 ts=4 sts=4 et: */
-
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#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>
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);
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);
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;
+ }
}
/**
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");
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
efreet_desktop_string_list_join(Eina_List *list)
{
Eina_List *l;
- const char *tmp;
+ const char *elem;
char *string;
size_t size, pos, len;
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;
int ok;
ini = efreet_ini_new(desktop->orig_path);
+ if (!ini) return 0;
if (!ini->data)
{
efreet_ini_free(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);
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);
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;
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);
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;
}
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 &&
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
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;
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;
}
}
-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
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:
-/* vim: set sw=4 ts=4 sts=4 et: */
#ifndef EFREET_DESKTOP_H
#define EFREET_DESKTOP_H
-/* vim: set sw=4 ts=4 sts=4 et: */
-
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
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);
}
Efreet_Desktop_Command_File *file = eina_list_data_get(l);
exec = malloc(size);
+ if (!exec) goto error;
p = command->desktop->exec;
len = 0;
{
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? */
{
exec = efreet_desktop_command_append_single(exec, &size,
&len, file, *p);
+ if (!exec) goto error;
file_added = 1;
}
break;
{
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':
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. */
while ((l = eina_list_next(l)) != NULL);
return execs;
+error:
+ IF_FREE(exec);
+ EINA_LIST_FREE(execs, exec)
+ free(exec);
+ return NULL;
}
static void
{
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, '\''))
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;
}
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;
if (!str) return dest;
dest = efreet_desktop_command_append_quoted(dest, size, len, str);
+ if (!dest) return NULL;
return dest;
}
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;
}
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);
INF(" file: %s", f->file);
#endif
return f;
+error:
+ IF_FREE(f);
+ return NULL;
}
/**
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);
}
}
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;
}
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);
{
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;
-/* vim: set sw=4 ts=4 sts=4 et: */
-
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
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
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;
IF_FREE_HASH(efreet_icon_cache);
- if (fake_null)
- {
- efreet_icon_theme_free(fake_null);
- fake_null = NULL;
- }
-
ecore_shutdown();
}
* @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;
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;
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;
/* 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)
{
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)
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;
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
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
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))
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);
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;
}
}
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;
}
}
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;
}
}
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;
}
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 */
const char *tmp;
ini = efreet_ini_new(file);
+ if (!ini) return;
if (!ini->data)
{
efreet_ini_free(ini);
if (!p) break;
point = NEW(Efreet_Icon_Point, 1);
+ if (!point) goto error;
*p = '\0';
point->x = atoi(s);
}
}
+error:
efreet_ini_free(ini);
}
Efreet_Icon_Theme *theme;
theme = NEW(Efreet_Icon_Theme, 1);
+ if (!theme) return NULL;
return theme;
}
/* 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;
}
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);
}
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);
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
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);
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);
}
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)
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);
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)
{
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;
}
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);
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);
}
-/* vim: set sw=4 ts=4 sts=4 et: */
#ifndef EFREET_ICON_H
#define EFREET_ICON_H
-/* vim: set sw=4 ts=4 sts=4 et: */
-
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
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
if (sep < line_length)
{
- const char *key, *value;
+ char *key, *value;
int key_end, value_start, value_end;
/* trim whitespace from end of key */
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));
if (country) maxlen += strlen(country);
if (modifier) maxlen += strlen(modifier);
- buf = malloc(maxlen * sizeof(char));
+ buf = alloca(maxlen);
if (lang && modifier && country)
{
if (!found)
val = efreet_ini_string_get(ini, key);
- FREE(buf);
-
return val;
}
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);
return;
efreet_ini_string_set(ini, buf, value);
- FREE(buf);
}
/**
char *buf, *dest;
const char *p;
- if (!str) return NULL;
if (!strchr(str, '\\')) return eina_stringshare_add(str);
buf = alloca(strlen(str) + 1);
-/* vim: set sw=4 ts=4 sts=4 et: */
#ifndef EFREET_INI_H
#define EFREET_INI_H
-/* vim: set sw=4 ts=4 sts=4 et: */
-
/* TODO: Check where strcmp can be changed with == because of stringshare */
#ifdef HAVE_CONFIG_H
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,
struct
{
- char *key;
+ const char *key;
int (*cb)(Efreet_Menu_Internal *parent, Efreet_Xml *xml);
} menu_cbs[] = {
{"Menu", efreet_menu_handle_sub_menu},
struct
{
- char *key;
+ const char *key;
int (*cb)(Efreet_Menu_Filter_Op *op, Efreet_Xml *xml);
} filter_cbs[] = {
{"Filename", efreet_menu_handle_filename},
struct
{
- char *key;
+ const char *key;
int (*cb)(Efreet_Menu_Internal *parent, Efreet_Xml *xml);
} move_cbs[] = {
{"Old", efreet_menu_handle_old},
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},
/* split appart the filename and the path */
internal = efreet_menu_internal_new();
+ if (!internal) return NULL;
/* Set default values */
internal->show_empty = 0;
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)
else if (entry->type == EFREET_MENU_ENTRY_HEADER)
INF("%s|---%s", new_indent, entry->name);
}
-
- FREE(new_indent);
}
}
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;
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))
{
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);
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;
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 */
/* 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;
/* 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;
Efreet_Menu_Filter *filter;
filter = NEW(Efreet_Menu_Filter, 1);
+ if (!filter) return NULL;
filter->op = efreet_menu_filter_op_new();
if (!filter->op)
{
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;
*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);
efreet_menu_internal_free(origin);
}
}
+error:
IF_FREE_LIST(internal->moves, efreet_menu_move_free);
}
-/* vim: set sw=4 ts=4 sts=4 et: */
#ifndef EFREET_MENU_H
#define EFREET_MENU_H
-/* vim: set sw=4 ts=4 sts=4 et: */
-
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
{
const char *type = NULL;
+ if (!file)
+ return NULL;
+
if ((type = efreet_mime_special_check(file)))
return type;
char *ext, *mime;
/* Check in the extension hash for the type */
+ if (!file) return NULL;
+
ext = strchr(file, '.');
if (ext)
{
#ifndef _WIN32
if (S_ISLNK(s.st_mode))
- return _mime_inode_symlink;
+ return _mime_inode_symlink;
#endif
if (S_ISFIFO(s.st_mode))
case '=':
ptr++;
+ tshort = 0;
memcpy(&tshort, ptr, sizeof(short));
entry->value_len = ntohs(tshort);
ptr += 2;
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++)
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);
}
-/* vim: set sw=4 ts=4 sts=4 et: */
#ifndef EFREET_PRIVATE_H
#define EFREET_PRIVATE_H
-/* vim: set sw=4 ts=4 sts=4 et: */
-
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
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;
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 */
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;
-/* vim: set sw=4 ts=4 sts=4 et: */
-
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
-/* vim: set sw=4 ts=4 sts=4 et: */
#ifndef EFREET_URI_H
#define EFREET_URI_H
-/* vim: set sw=4 ts=4 sts=4 et: */
-
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
-/* vim: set sw=4 ts=4 sts=4 et: */
#ifndef EFREET_UTILS_H
#define EFREET_UTILS_H
-/* vim: set sw=4 ts=4 sts=4 et: */
-
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
error = 0;
xml = efreet_xml_parse(&data, &size);
- if (error) goto efreet_error;
+ if (!xml || error) goto efreet_error;
munmap(data, size);
close(fd);
}
*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));
-/* vim: set sw=4 ts=4 sts=4 et: */
#ifndef EFREET_XML_H
#define EFREET_XML_H
-/* vim: set sw=4 ts=4 sts=4 et: */
#include "Efreet.h"
#include <stdio.h>
#include <Ecore.h>
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)
-/* vim: set sw=4 ts=4 sts=4 et: */
#include "Efreet.h"
#include "config.h"
#include <stdio.h>
-/* vim: set sw=4 ts=4 sts=4 et: */
#include "Efreet.h"
#include "Efreet_Mime.h"
#include "config.h"
-/* vim: set sw=4 ts=4 sts=4 et: */
#include "Efreet.h"
#include "efreet_private.h"
#include <stdio.h>
-/* vim: set sw=4 ts=4 sts=4 et: */
#include "Efreet.h"
#include "Efreet_Mime.h"
#include <Ecore.h>