<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>pfritz</title>
	<atom:link href="http://pfritz.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://pfritz.wordpress.com</link>
	<description>stumbling into the age of enlightenment</description>
	<lastBuildDate>Mon, 04 Jan 2010 01:00:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='pfritz.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>pfritz</title>
		<link>http://pfritz.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://pfritz.wordpress.com/osd.xml" title="pfritz" />
	<atom:link rel='hub' href='http://pfritz.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Color your diffs</title>
		<link>http://pfritz.wordpress.com/2010/01/04/color-your-diffs/</link>
		<comments>http://pfritz.wordpress.com/2010/01/04/color-your-diffs/#comments</comments>
		<pubDate>Mon, 04 Jan 2010 01:00:01 +0000</pubDate>
		<dc:creator>pfritz</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://pfritz.wordpress.com/?p=53</guid>
		<description><![CDATA[I&#8217;m using the command &#8220;svn diff&#8221; very often to control my already done changes for the subversion repo I&#8217;m working on. To be exactly I&#8217;m using &#8220;svn diff &#124; colordiff&#8221; because it simplifies reading those diffs enormous. Since colordiff is a simple wrapper around the good old diff, I was wondering if it is possible [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pfritz.wordpress.com&#038;blog=4391246&#038;post=53&#038;subd=pfritz&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>I&#8217;m using the command &#8220;svn diff&#8221; very often to control my already done changes for the subversion repo I&#8217;m working on. To be exactly I&#8217;m using &#8220;svn diff | colordiff&#8221; because it simplifies reading those diffs enormous. Since <em>colordiff</em> is a simple wrapper around the good old <em>diff</em>, I was wondering if it is possible to change the diff command used by subversion to something else. And yes it is! After some googling I found out the solution to define an alias to use colordiff, but an alias is not what I want. There must be a neater solution. Looking into the config file<em> &#8216;.subversion/config&#8217;</em> I uncomment and changed the line starting with <em>diff-cmd</em><em> </em>to <em>&#8216;diff-cmd = colordiff&#8217;</em> and now the output of <em>&#8216;svn diff&#8217;</em> is colored. Isn&#8217;t that nice? What I haven&#8217;t found out yet, however, is how you can change it back to normal <em>diff</em> if you want to prepare a normal patch without colors. I&#8217;ll report it to you if I find it out.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pfritz.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pfritz.wordpress.com/53/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pfritz.wordpress.com&#038;blog=4391246&#038;post=53&#038;subd=pfritz&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://pfritz.wordpress.com/2010/01/04/color-your-diffs/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7dccef66cbefb08528ef041c21e18c90?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">pfritz</media:title>
		</media:content>
	</item>
		<item>
		<title>The new state system for the themers</title>
		<link>http://pfritz.wordpress.com/2009/08/09/the-new-state-system-for-the-themers/</link>
		<comments>http://pfritz.wordpress.com/2009/08/09/the-new-state-system-for-the-themers/#comments</comments>
		<pubDate>Sun, 09 Aug 2009 20:47:40 +0000</pubDate>
		<dc:creator>pfritz</dc:creator>
				<category><![CDATA[edje]]></category>
		<category><![CDATA[ewl]]></category>

		<guid isPermaLink="false">http://pfritz.wordpress.com/?p=48</guid>
		<description><![CDATA[I&#8217;ve already written an article about the new state system of ewl for programmers. This article will concentrate on the stuff that is interesting for the themers. In fact the new event system gives the themers more possibilities to design their theme. This was one of the motivations to do this changes. To keep this [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pfritz.wordpress.com&#038;blog=4391246&#038;post=48&#038;subd=pfritz&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve already written an article about the new state system of ewl for<br />
programmers. This article will concentrate on the stuff that is interesting for<br />
the themers. In fact the new event system gives the themers more possibilities<br />
to design their theme. This was one of the motivations to do this changes.<br />
To keep this article simple and general I will not comment the actual changes,<br />
but I&#8217;ll talk about how the event system works now.</p>
<h2>Some words about the lifetime of an edje object</h2>
<p>Unlike to other widgets lib based on edje, ewl has not a permanent edje object<br />
per widget. If a widget gets off-screen or is hidden it will not have an edje<br />
object. This state is called obscured in ewl. This means that any change to a<br />
obscured widget cannot be repeated to the edje object, because there is no<br />
edje object. So we will differ in ewl and in this article two different types<br />
of state changes. The first type is an active change, i.e. there already exists<br />
a edje object and a state changes. The second type is for a widget that is<br />
revealed (= the widget is not longer obscured), it already has some states set,<br />
maybe long before.</p>
<h2>A little example</h2>
<p>This all may sound complicated for you. Let&#8217;s take a look on a real-life<br />
example to illustrate the difference. We have a list of check buttons in a<br />
scroll pane. Now we click on an un-checked and visible check box. The check box<br />
will toggle to the checked state. As a themer you maybe want to have an<br />
animation here, like the check is bouncing or fades-in. Now we scroll this<br />
check button off-screen, hence it is no longer visible. Ewl will now destroy the<br />
edje object, in fact it will not destroy it but reuse it for other widgets. The<br />
important point is that the widget doesn&#8217;t have this theme object any longer<br />
associated to itself and thus we lost all state informations for the theme<br />
object. If we now move the check button back to the screen, ewl will create a<br />
new theme object for it, so we need to inform it that the widget is already<br />
checked, but this time we do not want the animation, because the state of the<br />
widget has not been changed. It is only the state of the edje object that<br />
changes. So we need another signal name for it.</p>
<p>And here comes the new state system, formerly it was not possible in ewl<br />
to distinguish between such different edje theme state changes. Now it is!</p>
<h2>The new signal names</h2>
<p>Puh, that was much text, sorry I&#8217;m bad in summarizing stuff. Besides that we<br />
differ between getting a state and having a state. We uniformed the signal<br />
names. Here is a table of them:</p>
<pre>adding state        removing state       has state

"mouse,in"          "mouse,out"          "hovered"
"mouse,down"        "mouse,up"           "pressed"
"focus,in"          "focus,out"          "focused"
"disable"           "enable"             "disabled"
"highlight,on"      "highlight,off"      "highlighted"
"selection,on"      "selection,off"      "selected"
"state,on"          "state,off"          "on"
"odd,on"            "odd,off"            "odd"
"dnd,in"            "dnd,out"            "dnd"</pre>
<p>One special case is &#8220;mouse,down&#8221; and &#8220;mouse,up&#8221; you also get a &#8220;mouse,down,x&#8221;<br />
and &#8220;mouse,up,x&#8221; where x is the button number pressed. But this states are<br />
custom states and aren&#8217;t inherit to the internal child widgets. You&#8217;ll learn<br />
more about internal child widgets in the next section.</p>
<h2>Even more things are now possible</h2>
<p>Many ewl widgets are a composition of different widgets, for instance let&#8217;s<br />
talk about a button. A button is a container that holds a label and maybe<br />
an icon, if present. This label is an internal widget, because it is not added<br />
by the app writer, but an inherent part of the widget. Those internal widgets<br />
now inherit the states of the parent widget. To differentiate between state<br />
changes of the parent and of the widget itself the source is a different.</p>
<p>It used to be &#8220;EWL&#8221;, now it is &#8220;ewl/this&#8221; if the change is done to the widget<br />
itself, if the state of the parent is changed the source is &#8220;ewl/parent&#8221;. There<br />
is even a third source I&#8217;ll explain later.</p>
<p>Let&#8217;s go back to our button example, if the mouse enters the button you maybe<br />
want to change the background (the outer shape) of the button, that isn&#8217;t nor<br />
was it a problem. But what happen if you turn the light background into a dark<br />
one? Now the font of the label is most probably not visible. In contrast it<br />
needs to be changed from dark to light.</p>
<p>Now the label theme object will also receive a signal if the background state<br />
changes, so that you can adjust the font color. Very often you don&#8217;t care if the<br />
state changes happens to the widget or it close parent. It should always behave<br />
the same. Therefor there is a third source &#8220;ewl/both&#8221;, it is send if one of the<br />
widgets (the actual widget for theme and the (maybe indirect) parent) is getting<br />
the state, or if none of them is having it no longer.</p>
<h2>Custom states</h2>
<p>Because the list of states given above is not always sufficient for every<br />
widget, there are also custom states. Custom states are more like pure edje<br />
signals, they are not repeated to the child widgets of a container, and they<br />
do not necessarily differ between getting and having a state. But the usage of<br />
custom states in ewl is rare. Custom states will always have &#8220;ewl/this&#8221; as<br />
source.</p>
<p>I hoped this explained the new features of the new state system. If you still<br />
have questions about it, do not hesitate to ask them.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pfritz.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pfritz.wordpress.com/48/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pfritz.wordpress.com&#038;blog=4391246&#038;post=48&#038;subd=pfritz&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://pfritz.wordpress.com/2009/08/09/the-new-state-system-for-the-themers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7dccef66cbefb08528ef041c21e18c90?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">pfritz</media:title>
		</media:content>
	</item>
		<item>
		<title>Kissed by a nymph</title>
		<link>http://pfritz.wordpress.com/2009/08/05/kissed-by-a-nymph/</link>
		<comments>http://pfritz.wordpress.com/2009/08/05/kissed-by-a-nymph/#comments</comments>
		<pubDate>Wed, 05 Aug 2009 19:31:49 +0000</pubDate>
		<dc:creator>pfritz</dc:creator>
				<category><![CDATA[ewl]]></category>

		<guid isPermaLink="false">http://pfritz.wordpress.com/?p=44</guid>
		<description><![CDATA[Most apps and libs in the e-land are migrating or are already migrated to eina. And you probably know that Nathan and me are not big fans of eina. Here a some points we dislike: the API the licence (unlike almost all efl libs it is not BSD-like) the scope (eina handles many things that [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pfritz.wordpress.com&#038;blog=4391246&#038;post=44&#038;subd=pfritz&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Most apps and libs in the e-land are migrating or are already migrated to eina.<br />
And you probably know that Nathan and me are not big fans of eina. Here a<br />
some points we dislike:</p>
<ul>
<li>the API</li>
<li>the licence (unlike almost all efl libs it is not BSD-like)</li>
<li>the scope (eina handles many things that do not belong into a data type lib)</li>
</ul>
<p>I&#8217;m not going to go into details here. The decisions are already done. We<br />
will not use eina for EWL. As you see it&#8217;s not only one point, but a bunch of<br />
several issues that we dislike. At the moment EWL is using the ecore data types,<br />
but I guess they will be removed from ecore soon. So we have basically two<br />
choices:</p>
<ol>
<li>We can revive EWD, i.e. make a stand-alone lib out of the ecore data types</li>
<li>We can switch to another data type library</li>
</ol>
<p>Since there are some problems with the ecore data types, in particular the<br />
missing iterator implementations and we also missed some other sugar, we took<br />
the second way. After checking several <em>adt libs</em>, we chose to write our own one, because none has all the feature we want.</p>
<p>For sure this step was not ill-considered, we already discussed years ago about<br />
the future about the ecore data types, but now we are taking the chance to<br />
switch to a similar but not API compatible design. The lib is called<br />
<strong>cmaid</strong>.</p>
<h2>Cmaid</h2>
<p>The basic design ideas of cmaid is a mixture of ecore, libast and some new bits.</p>
<p>From <strong>libast</strong> it has the interface design. I.e. you program against an interface<br />
and only on creation of the data type, you choose what implementation you<br />
actually take. This makes it easy to switch from one implementation to another.<br />
It also brings an inheritance stair, so <em>ecore_hash_count()</em> and<br />
<em>ecore_list_count()</em> becomes <em>cmaid_container_count()</em>.</p>
<p>From <strong>ecore</strong> it has the API and also the hash implementation, most of the<br />
function names are very similar to the one of ecore, except those for<br />
iterating. Not directly from <em>ecore</em> but from an idea of Nathan for improving<br />
<em>ecore_hash</em> is <em>Cmaid_Value</em>. It&#8217;s describing the data to be stored in the<br />
container. This can reduce the allocation time because it can in-line the data<br />
into the data node, of course, only if you desire it.</p>
<p>Really <strong>new</strong> is the iterator concept. Unlike to many other <em>adt libs</em> there is<br />
no rule like: <em>Do not touch the container while you are iterating</em>. If you<br />
remove some item the container will correct your (other) iterators to point to<br />
the right and valid position. This works because the container has a list of<br />
all attached iterators. It might sound heavy, but those few checks that are<br />
done, are not a really slow down, compared to the luxury they bring. Of course<br />
if you artificially add thousands of iterators it becomes heavy, but that&#8217;s not<br />
the life as it is.</p>
<p>If you are now curious about <strong>cmaid</strong> you can find it<br />
<a href="http://code.google.com/p/cmaid/">here</a> and<br />
<a href="http://mowem.de/tmp/cmaid/html/">here the documentation</a>. BTW <em>cmaid</em> is still<br />
not finished, and the port of ewl to it will take some time.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pfritz.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pfritz.wordpress.com/44/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pfritz.wordpress.com&#038;blog=4391246&#038;post=44&#038;subd=pfritz&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://pfritz.wordpress.com/2009/08/05/kissed-by-a-nymph/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7dccef66cbefb08528ef041c21e18c90?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">pfritz</media:title>
		</media:content>
	</item>
		<item>
		<title>The new state system of EWL</title>
		<link>http://pfritz.wordpress.com/2009/07/01/the-new-state-system-of-ewl/</link>
		<comments>http://pfritz.wordpress.com/2009/07/01/the-new-state-system-of-ewl/#comments</comments>
		<pubDate>Wed, 01 Jul 2009 22:04:10 +0000</pubDate>
		<dc:creator>pfritz</dc:creator>
				<category><![CDATA[ewl]]></category>

		<guid isPermaLink="false">http://pfritz.wordpress.com/?p=34</guid>
		<description><![CDATA[Maybe you have already seen it, I started some weeks ago a branch for ewl in svn. Since the changes aren&#8217;t self explaining, I want to describe here how the new system works and also why it works that way. The old system Let&#8217;s start with some history about the old, but still current main [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pfritz.wordpress.com&#038;blog=4391246&#038;post=34&#038;subd=pfritz&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Maybe you have already seen it, I started some weeks ago a branch for <em>ewl</em> in svn. Since the changes aren&#8217;t self explaining, I want to describe here how the new system works and also why it works that way.</p>
<hr />
<h2><a name="_the_old_system"></a>The old system</h2>
<p>Let&#8217;s start with some history about the old, but still current main trunk system. There are two different kinds of states:</p>
<ul>
<li> One are for internal usage only. They are part of the Ewl_Flag enumeration and  are set with macros like <em>ewl_widget_state_add()</em>. They are to keep track if a widget is pressed, has focus, etc. </li>
<li> The second kind is to keep the widget decoration informed about some evens. It is a tight wrapper around <em>edje_object_signal_emit()</em>. With <em>&#8220;tight&#8221;</em> I mean that it doesn&#8217;t provide any extra functionality besides that it can save one (and only <em>one</em>!) set state, so that the state will be applied if the widget is obscured and revealed again (this happens if the widget gets offscreen, or hidden for some time). </li>
</ul>
<hr />
<h2><a name="_losing_states"></a>Losing states</h2>
<p>This design has some flaws, because it ignores the fact that most <em>ewl widgets</em> are a composition of several widgets. For instance the label in a button need to know when the parent button container changes its appearance, in other words when it changes its state. On the first sight the solution seems to be obvious. Simply pass the state changes to the internal children.</p>
<p>But what happens if the label goes offscreen, but not the button? Or what happens if we create the label later than the button changed it theme? The label will not know about the state changes of the button. That means we need to keep track of all state changes so we can apply it to the children, when they are created or recreated. This list approach has also problems, for example if you apply <em>&#8220;mouse,in&#8221;</em>, you need to remove it from the list before you apply later <em>&#8220;mouse,out&#8221;</em>.</p>
<hr />
<h2><a name="_having_a_state_is_different_to_getting_a_state"></a>Having a state is different to getting a state</h2>
<p>Another problem that exists with the current system is that we do not differ between retrieving a state and having a state. For example a themer might want to add a fancy animation when a checkbutton is checked, but on the other hand he maybe do not want an animation when the check is already applied, when the widget is new created or it is on-screen again. This issue is not inherent in the current system, and could probably also be solved in it. But it is something I had also in mind when I was going to switch to the new system.</p>
<hr />
<h2><a name="_the_solution"></a>The solution</h2>
<p>I hope you understand now some of the issues that led me to change the current system. The first step is to remove the tight wrapping of <em>edje_object_signal_emit()</em>. I doubt it is possible to find a way that is not memory wasting and slow, but managed all the states in plain strings.</p>
<p>Like we already did it for the internal state management, states are now labeled by an enumeration. Every state in this enum reserves its own bit, so you can easily combine them with ORing. This atomatically solves the list problem. If the mouse enters the widget you simply add the <em>EWL_STATE_MOUSE_IN</em> bit and if the mouse later leaves you remove the state again.</p>
<p>Since old internal state keeping and the new state system works very similar, I simply merged them to one system, with the main difference that <em>ewl_widget_state_add()</em> will now inform the theme (actually the engine), that the state changed. If the widget isn&#8217;t already realized, the theme gets another information on realization, namely that the widget <em>has</em> this state. This solves the second problem.</p>
<p>The widget does not only save the directly applied states, but also the states that it inherits from the parent widget. Those are easily queried on realization and are kept up-to-date, if the state changes on the parent widget.</p>
<p>But the state enumeration is not enough. In some rare, but important cases, we still need custom states, that only makes sense for the given widget and are not general enough to be put into the enum. For those cases there is still a function that works as a tight wrapper around <em>edje_object_signal_emit()</em>. It is called <em>ewl_widget_custom_state_set()</em> and works like the old <em>ewl_widget_state_set()</em>, i.e. it does not inform the internal children about the change.</p>
<p>I hope I&#8217;ll write a second part of this blog discussing the changes from the view of a themer.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pfritz.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pfritz.wordpress.com/34/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pfritz.wordpress.com&#038;blog=4391246&#038;post=34&#038;subd=pfritz&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://pfritz.wordpress.com/2009/07/01/the-new-state-system-of-ewl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7dccef66cbefb08528ef041c21e18c90?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">pfritz</media:title>
		</media:content>
	</item>
		<item>
		<title>Setting up autofoo for gettext</title>
		<link>http://pfritz.wordpress.com/2009/04/26/setting-up-autofoo-for-gettext/</link>
		<comments>http://pfritz.wordpress.com/2009/04/26/setting-up-autofoo-for-gettext/#comments</comments>
		<pubDate>Sun, 26 Apr 2009 22:44:37 +0000</pubDate>
		<dc:creator>pfritz</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[gettext]]></category>

		<guid isPermaLink="false">http://pfritz.wordpress.com/?p=30</guid>
		<description><![CDATA[Using gettext in your application or library is very easy and straight forward. The hard part is to setup autoconfig and automake to use gettext. Not because itis very difficult, but because there is not a good tutorial, at least I haven&#8217;t found one. The only resource is the gettext manual which is over 100 [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pfritz.wordpress.com&#038;blog=4391246&#038;post=30&#038;subd=pfritz&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Using <a href="http://en.wikipedia.org/wiki/Gettext">gettext</a> in your application or library is very easy and straight forward. The hard part is to setup <a href="http://en.wikipedia.org/wiki/Autoconf">autoconfig</a> and <a href="http://en.wikipedia.org/wiki/Automake">automake</a> to use gettext. Not because itis very difficult, but because there is not a good tutorial, at least I haven&#8217;t found one. The only resource is the gettext manual which is over 100 pages large and covers too many legacy cases to be simple. And the other resource is to look into existing project and take their setup as a base, either easy and you&#8217;ll find out that there are many ways of doing it, most of them are dated.</p>
<p>Since I added gettext support to <a href="http://wiki.enlightenment.org/index.php/EWL">EWL</a>, I thought I can tell you the single steps, making your life easier, one you want to add i18n support to your application or library. I assume that you already have a autoconfig setup for your software.</p>
<hr />
<h2>First step: Setup the c code</h2>
<p>Libraries need  a different treatment here, because they cannot rely on global settings, else they would overwrite the catalog of the application that is using the library. Nevertheless the steps are very similar. I start here with the steps for the application.</p>
<p>Create a header file called <em>intl.h</em> or &#8211; if you prefer &#8211; <em>mynamespace_intl.h</em> it&#8217;s containing this code:</p>
<table border="0" bgcolor="#e8e8e8" width="100%" cellpadding="10">
<tr>
<td>
<pre>
<pre><tt><b><font color="#000080">#ifndef</font></b> INTL_H
<b><font color="#000080">#define</font></b> INTL_H

<b><font color="#000080">#include</font></b> <font color="#FF0000">&lt;string.h&gt;</font>

<b><font color="#000080">#ifdef</font></b> ENABLE_NLS
<b><font color="#000080"># include</font></b> <font color="#FF0000">&lt;libintl.h&gt;</font>
<b><font color="#000080"># include</font></b> <font color="#FF0000">&lt;locale.h&gt;</font>
<b><font color="#000080">#else</font></b>
<b><font color="#000080"># define</font></b> <b><font color="#000000">gettext</font></b><font color="#990000">(</font>str<font color="#990000">)</font> <font color="#990000">((</font><font color="#009900">char</font><font color="#990000">*)</font> <font color="#990000">(</font>str<font color="#990000">))</font>
<b><font color="#000080">#endif</font></b>

<b><font color="#000080">#define</font></b> <b><font color="#000000">_</font></b><font color="#990000">(</font>str<font color="#990000">)</font> <b><font color="#000000">gettext</font></b><font color="#990000">(</font>str<font color="#990000">)</font>
<b><font color="#000080">#define</font></b> <b><font color="#000000">gettext_noop</font></b><font color="#990000">(</font>str<font color="#990000">)</font> str
<b><font color="#000080">#define</font></b> <b><font color="#000000">N_</font></b><font color="#990000">(</font>str<font color="#990000">)</font> <b><font color="#000000">gettext_noop</font></b><font color="#990000">(</font>str<font color="#990000">)</font>
<b><font color="#000080">#define</font></b> <b><font color="#000000">S_</font></b><font color="#990000">(</font>str<font color="#990000">)</font> <b><font color="#000000">sgettext</font></b><font color="#990000">(</font>str<font color="#990000">)</font>

<b><font color="#0000FF">static</font></b> <b><font color="#0000FF">inline</font></b> <font color="#009900">char</font> <font color="#990000">*</font>
<b><font color="#000000">sgettext</font></b><font color="#990000">(</font><b><font color="#0000FF">const</font></b> <font color="#009900">char</font> <font color="#990000">*</font>msgid<font color="#990000">)</font>
<font color="#FF0000">{</font>
        <font color="#009900">char</font> <font color="#990000">*</font>msgval <font color="#990000">=</font> <b><font color="#000000">gettext</font></b><font color="#990000">(</font>msgid<font color="#990000">);</font>
        <b><font color="#0000FF">if</font></b> <font color="#990000">(</font>msgval <font color="#990000">==</font> msgid<font color="#990000">)</font>
                msgval <font color="#990000">=</font> <b><font color="#000000">strrchr</font></b><font color="#990000">(</font>msgid<font color="#990000">,</font> <font color="#FF0000">'|'</font><font color="#990000">)</font> <font color="#990000">+</font> <font color="#993399">1</font><font color="#990000">;</font>
        <b><font color="#0000FF">return</font></b> msgval<font color="#990000">;</font>
<font color="#FF0000">}</font>

<b><font color="#000080">#endif</font></b>
</tt></pre>
</td>
</tr>
</table>
<p>This defines some useful macros, namely <em><em>()</em>, <em>N</em>()</em> and <em>S_()</em>. Take a look into the gettext handbook to see how they work.</p>
<p>For libraries use this header:</p>
<table border="0" bgcolor="#e8e8e8" width="100%" cellpadding="10">
<tr>
<td>
<pre>
<pre><tt><b><font color="#000080">#ifndef</font></b> INTL_H
<b><font color="#000080">#define</font></b> INTL_H

<b><font color="#000080">#include</font></b> <font color="#FF0000">&lt;string.h&gt;</font>

<b><font color="#000080">#ifdef</font></b> ENABLE_NLS
<b><font color="#000080"># include</font></b> <font color="#FF0000">&lt;libintl.h&gt;</font>
<b><font color="#000080"># include</font></b> <font color="#FF0000">&lt;locale.h&gt;</font>
<b><font color="#000080">#else</font></b>
<b><font color="#000080"># define</font></b> <b><font color="#000000">dgettext</font></b><font color="#990000">(</font>domain<font color="#990000">,</font> str<font color="#990000">)</font> <font color="#990000">((</font><font color="#009900">char</font><font color="#990000">*)</font> <font color="#990000">(</font>str<font color="#990000">))</font>
<b><font color="#000080">#endif</font></b>

<b><font color="#000080">#define</font></b> <b><font color="#000000">D_</font></b><font color="#990000">(</font>str<font color="#990000">)</font> <b><font color="#000000">dgettext</font></b><font color="#990000">(</font>PACKAGE<font color="#990000">,</font> str<font color="#990000">)</font>
<b><font color="#000080">#define</font></b> <b><font color="#000000">gettext_noop</font></b><font color="#990000">(</font>str<font color="#990000">)</font> str
<b><font color="#000080">#define</font></b> <b><font color="#000000">N_</font></b><font color="#990000">(</font>str<font color="#990000">)</font> <b><font color="#000000">gettext_noop</font></b><font color="#990000">(</font>str<font color="#990000">)</font>
<b><font color="#000080">#define</font></b> <b><font color="#000000">SD_</font></b><font color="#990000">(</font>str<font color="#990000">)</font> <b><font color="#000000">sdgettext</font></b><font color="#990000">(</font>PACKAGE<font color="#990000">,</font> str<font color="#990000">)</font>

<b><font color="#0000FF">static</font></b> <b><font color="#0000FF">inline</font></b> <font color="#009900">char</font> <font color="#990000">*</font>
<b><font color="#000000">sdgettext</font></b><font color="#990000">(</font><b><font color="#0000FF">const</font></b> <font color="#009900">char</font> <font color="#990000">*</font>domain<font color="#990000">,</font> <b><font color="#0000FF">const</font></b> <font color="#009900">char</font> <font color="#990000">*</font>msgid<font color="#990000">)</font>
<font color="#FF0000">{</font>
        <font color="#009900">char</font> <font color="#990000">*</font>msgval <font color="#990000">=</font> <b><font color="#000000">dgettext</font></b><font color="#990000">(</font>domain<font color="#990000">,</font> msgid<font color="#990000">);</font>
        <b><font color="#0000FF">if</font></b> <font color="#990000">(</font>msgval <font color="#990000">==</font> msgid<font color="#990000">)</font>
                msgval <font color="#990000">=</font> <b><font color="#000000">strrchr</font></b><font color="#990000">(</font>msgid<font color="#990000">,</font> <font color="#FF0000">'|'</font><font color="#990000">)</font> <font color="#990000">+</font> <font color="#993399">1</font><font color="#990000">;</font>
        <b><font color="#0000FF">return</font></b> msgval<font color="#990000">;</font>
<font color="#FF0000">}</font>

<b><font color="#000080">#endif</font></b>

</tt></pre>
</td>
</tr>
</table>
<p>Add this new header file to the (not installed) list of source files in your <em>Makefile.am</em>. You also need to add the following option to the <em>AM_CPPFLAGS</em></p>
<table border="0" bgcolor="#e8e8e8" width="100%" cellpadding="10">
<tr>
<td>
<pre>-DPACKAGE_LOCALE_DIR=\"$(localedir)\"</pre>
</td>
</tr>
</table>
<p>We need this definition later.</p>
<p>To initialize the correct language and loading the language catalog we need to add some code, for apps add this code near the beginning of your <em>main()</em> function:</p>
<table border="0" bgcolor="#e8e8e8" width="100%" cellpadding="10">
<tr>
<td>
<pre>
<pre><tt>    <i><font color="#9A1900">/* Initialize NLS */</font></i>
<b><font color="#000080">#ifdef</font></b> ENABLE_NLS
    <b><font color="#000000">setlocale</font></b><font color="#990000">(</font>LC_MESSAGES<font color="#990000">,</font> <font color="#FF0000">""</font><font color="#990000">);</font>
    <b><font color="#000000">bindtextdomain</font></b><font color="#990000">(</font>PACKAGE<font color="#990000">,</font> PACKAGE_LOCALE_DIR<font color="#990000">);</font>
    <b><font color="#000000">bind_textdomain_codeset</font></b><font color="#990000">(</font>PACKAGE<font color="#990000">,</font> <font color="#FF0000">"UTF-8"</font><font color="#990000">);</font> <i><font color="#9A1900">/* add this only if you want to</font></i>
<i><font color="#9A1900">                                                  deal with UTF-8 strings</font></i>
<i><font color="#9A1900">                                                  exclusivly. If you are using</font></i>
<i><font color="#9A1900">                                                  evas, you most probably</font></i>
<i><font color="#9A1900">                                                  want. */</font></i>
    <b><font color="#000000">textdomain</font></b><font color="#990000">(</font>PACKAGE<font color="#990000">);</font>
<b><font color="#000080">#endif</font></b>
</tt></pre>
</td>
</tr>
</table>
<p>For libraries add this:</p>
<table border="0" bgcolor="#e8e8e8" width="100%" cellpadding="10">
<tr>
<td>
<pre>
<pre><tt>    <i><font color="#9A1900">/* Initialize NLS */</font></i>
<b><font color="#000080">#ifdef</font></b> ENABLE_NLS
    <b><font color="#000000">bindtextdomain</font></b><font color="#990000">(</font>PACKAGE<font color="#990000">,</font> PACKAGE_LOCALE_DIR<font color="#990000">);</font>
    <b><font color="#000000">bind_textdomain_codeset</font></b><font color="#990000">(</font>PACKAGE<font color="#990000">,</font> <font color="#FF0000">"UTF-8"</font><font color="#990000">);</font> <i><font color="#9A1900">/* add this only if you want to</font></i>
<i><font color="#9A1900">                                                  deal with UTF-8 strings</font></i>
<i><font color="#9A1900">                                                  exclusivly. If you are using</font></i>
<i><font color="#9A1900">                                                  evas, you most probably</font></i>
<i><font color="#9A1900">                                                  want. */</font></i>
<b><font color="#000080">#endif</font></b>
</tt></pre>
</td>
</tr>
</table>
<p>As you can see it is up to the library user to set the locale. Don't forget to add the <em>intl.h</em> header file.</p>
<p>The only missing thing for the c-files is to mark translatable strings, with the defined macros. I will not explain here how to use them.</p>
<hr />
<h2>Second step: Setup autoconfig and automake</h2>
<p>First add the following line in your <em>autogen.sh</em> or <em>bootstrap.sh</em> file, if you are using autoreconf you can jump to the next topic.</p>
<table border="0" bgcolor="#e8e8e8" width="100%" cellpadding="10">
<tr>
<td>
<pre>echo "Running autopoint..." ; autopoint -f || :</pre>
</td>
</tr>
</table>
<p>Before the line where <em>aclocal</em> is called.</p>
<p>Now execute <em>autopoint -f</em> in your package base dir. It will create the <em>po/</em>-directory and copy some files you will need later.</p>
<p>Add the following lines some where in your <em>configure.ac</em> file:</p>
<table border="0" bgcolor="#e8e8e8" width="100%" cellpadding="10">
<tr>
<td>
<pre>AM_GNU_GETTEXT([external])
AM_GNU_GETTEXT_VERSION([0.15])</pre>
</td>
</tr>
</table>
<p>And add <em>po/Makefile.in</em> (don't forget the <em>.in</em>, this is not a typo!) into the <em>AC_OUTPUT</em> list. And add the po dir at the end of the subbdir list in the <em>Makefile.am</em>.</p>
<p>Now create the <em>po/Makevars</em> file, you will find there already a template for it. Simply copy it and adjust it for your needs. You may want to add the <em>S_</em> or the <em>D_</em> and <em>SD_</em> macros to the xgettext options.</p>
<p>Create a new file called <em>POTFILES.in</em>. There you put every source file that contains a translatable string. The path should be relative to your base directory.</p>
<p>Well, if you are an English-speaker you are done know. Your project should now be translatable. If your not an English-speaker you can test your work and start a translation for your mother tongue.</p>
<hr />
<h2>Step three: The first translation</h2>
<p>Run now <em>./autogen.sh</em>, <em>./bootstrap.sh</em> or <em>autoreconf</em> and the <em>./configure</em> and <em>make</em>. After that you will find a pot file in the <em>po/</em> directory. Use it to create a translation for your project and save the po file in the <em>po/</em> dir.</p>
<p>Therefor that your translation will be converted into a binary form and later be installed add this file to a newly created <em>LINGUAS</em> file. There are all available translations listed. For example:</p>
<table border="0" bgcolor="#e8e8e8" width="100%" cellpadding="10">
<tr>
<td>
<pre># Set of available languages.
de it cz</pre>
</td>
</tr>
</table>
<p>Call now <em>make maintainer-clean</em> and the next time you are going to build your project, your translation will be installed and used.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pfritz.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pfritz.wordpress.com/30/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pfritz.wordpress.com&#038;blog=4391246&#038;post=30&#038;subd=pfritz&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://pfritz.wordpress.com/2009/04/26/setting-up-autofoo-for-gettext/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7dccef66cbefb08528ef041c21e18c90?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">pfritz</media:title>
		</media:content>
	</item>
		<item>
		<title>Mythbusting</title>
		<link>http://pfritz.wordpress.com/2009/02/25/mythbusting/</link>
		<comments>http://pfritz.wordpress.com/2009/02/25/mythbusting/#comments</comments>
		<pubDate>Wed, 25 Feb 2009 17:51:22 +0000</pubDate>
		<dc:creator>pfritz</dc:creator>
				<category><![CDATA[ecore]]></category>
		<category><![CDATA[eina]]></category>

		<guid isPermaLink="false">http://pfritz.wordpress.com/?p=16</guid>
		<description><![CDATA[Today I was talking with Vincent about the memory usage of the Ecore and Eina datatypes. And he stated that Eina&#8217;s datatypes are using less memory then the counter-parts of Ecore. That wasn&#8217;t the first time that I heard about that myth, and I don&#8217;t know how it ever came off, if it was because [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pfritz.wordpress.com&#038;blog=4391246&#038;post=16&#038;subd=pfritz&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Today I was talking with Vincent about the memory usage of the <em>Ecore</em> and <em>Eina</em> datatypes. And he stated that <em>Eina&#8217;s</em> datatypes are using less memory then the counter-parts of <em>Ecore</em>. That wasn&#8217;t the first time that I heard about that myth, and I don&#8217;t know how it ever came off, if it was because of ignorance or if it is just a lie to promote <em>Eina</em> as the best stuff ever. In dubio pro reo! So let me show you that it is simply not true.</p>
<p>For the lists the calculation is pretty simple. The container base of <em>Ecore_List</em> and <em>Ecore_DList</em> has 4 pointers and 2 integers. That are on a 32-bit architecture, 24 bytes. The nodes of <em>Ecore_List</em> has 2 pointers the double linked version has 3. On 32-bit that are 8 and 12 bytes. The countainer base of <em>Eina_List</em> takes one integer and one pointer the nodes are taking 4 pointers. That are on 32-bit systems that are 8 and 16 bytes. If you now want to calculate the memory usage you get the formulas for <em>Ecore_List</em> 32 + 8n, for <em>Ecore_DList</em> 32 + 12n, for <em>Eina_List</em> 8 + 16n. And there is the special case that <em>Eina_List</em> is using 0 bytes if the list is empty. Indeed, <em>Eina_List</em> is using less memory then <em>Ecore_Dlist</em>, but only for lists that are shorter then 4 nodes! For large lists where the container base size is negliable it is using 33% more space.</p>
<p>For hashes the calculations are a bit more difficult. <em>Ecore</em> doesn&#8217;t use a static bucket size and <em>Eina</em> has a nested tree structure for collisions protection. If I understood it right, it has a tree for every hash value, those nodes are called heads, and every head has a tree for futher collisions. Since the formulars are here  more complexe, I don&#8217;t want to discuss them in detail. I put them into a little c app, to actually calculate them. Since the memory usage of <em>Eina_Hash</em> differs depending of the quality of the hash function, I&#8217;ve calculated the best case (no collisions) and the worst case (only one hash value for every key). The real world case is some where between those two values. For bit fields I used the size of an integer, which should be at least on 32-bit architectures correct. You can find the source code here: <a href="http://mowem.de/ecore/hash.c" rel="nofollow">http://mowem.de/ecore/hash.c</a></p>
<p>The results can be found here: <a href="http://mowem.de/ecore/plot1000.png" rel="nofollow">http://mowem.de/ecore/plot1000.png</a> <a href="http://mowem.de/ecore/plot10000.png" rel="nofollow">http://mowem.de/ecore/plot10000.png</a></p>
<p>The red line is for <em>Ecore</em>, the blue for the worst case of <em>Eina</em> and the green line is for the best case scenario. Note: with best/worst case senario I&#8217;m talking about hash collisions and not about memory usage! So what we see is that <em>Eina_Hash</em> eats between <strong>100%</strong> and <strong>275%</strong> more memory then <em>Ecore_Hash</em>.</p>
<p>I know that there is a trade-off between memory usage and performance, but please stop pretending that <em>Eina</em> datatypes are using less memory then the <em>Ecore</em> counterparts. It&#8217;s simply not true.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pfritz.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pfritz.wordpress.com/16/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pfritz.wordpress.com&#038;blog=4391246&#038;post=16&#038;subd=pfritz&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://pfritz.wordpress.com/2009/02/25/mythbusting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7dccef66cbefb08528ef041c21e18c90?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">pfritz</media:title>
		</media:content>
	</item>
		<item>
		<title>The Lists and their quirks</title>
		<link>http://pfritz.wordpress.com/2008/11/29/the-lists-and-their-quirks/</link>
		<comments>http://pfritz.wordpress.com/2008/11/29/the-lists-and-their-quirks/#comments</comments>
		<pubDate>Sat, 29 Nov 2008 18:24:31 +0000</pubDate>
		<dc:creator>pfritz</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://pfritz.wordpress.com/?p=11</guid>
		<description><![CDATA[When I started to write this article I planed to write about the API of the two major list implementations and their weak points. But since this article is already long enough, I only focusing on evas_list. Don&#8217;t worry, an article about ecore_list will follow. Both API are widely used so you should assume that [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pfritz.wordpress.com&#038;blog=4391246&#038;post=11&#038;subd=pfritz&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>When I started to write this article I planed to write about the API of the two major list implementations and their weak points. But since this article is already long enough, I only focusing on <em>evas_list</em>. Don&#8217;t worry, an article about <em>ecore_list</em> will follow.</p>
<p>Both API are widely used so you should assume that they are proved to be suited for daily use. And that is right in most of the cases where I have seen them to be used. But they have some weak points, which I want to show you here. Creating a list is in both cases very simple, where it gets hairy is removing items from the list. <em>Evas_List</em> (now  <em>Eina_List</em>) doesn&#8217;t have a real destroy function, so you have to figure out the best way to free a complete list.</p>
<p>But this is an relative easy job and you&#8217;ll find thousands of examples in the efl. The real tricky point is if you do selective destruction, i.e. you remove a list item under some conditions.</p>
<p>Let&#8217;s say we have a list of filenames and want to remove the files that doesn&#8217;t have the extension <em>&#8220;.jpg&#8221;</em>. This shouldn&#8217;t be a hard job you think, shouldn&#8217;t it? Well it could be easier.</p>
<p>Let&#8217;s start with Eina_List. I mimic here the unaware new user, of course I know already how to do it right. We start with the normal approach. Iterate over all items and remove the items we don&#8217;t like.</p>
<table border="0" bgcolor="#e8e8e8" width="100%" cellpadding="10">
<tr>
<td>
<pre>
<pre><tt><b><font color="#000080">#include</font></b> <font color="#FF0000">&lt;Eina.h&gt;</font>
<b><font color="#000080">#include</font></b> <font color="#FF0000">&lt;Ecore_Str.h&gt;</font>
<b><font color="#000080">#include</font></b> <font color="#FF0000">&lt;string.h&gt;</font>
<b><font color="#000080">#include</font></b> <font color="#FF0000">&lt;stdio.h&gt;</font>

<font color="#009900">int</font>
<b><font color="#000000">main</font></b><font color="#990000">(</font><font color="#009900">void</font><font color="#990000">)</font>
<font color="#FF0000">{</font>
        Eina_List <font color="#990000">*</font>list <font color="#990000">=</font> NULL<font color="#990000">;</font>
        Eina_List <font color="#990000">*</font>l<font color="#990000">;</font>
        <b><font color="#0000FF">const</font></b> <font color="#009900">char</font> <font color="#990000">*</font>file<font color="#990000">;</font>

        <b><font color="#000000">eina_init</font></b><font color="#990000">();</font>

        list <font color="#990000">=</font> <b><font color="#000000">eina_list_append</font></b><font color="#990000">(</font>list<font color="#990000">,</font> <font color="#FF0000">"dsc01.jpg"</font><font color="#990000">);</font>
        list <font color="#990000">=</font> <b><font color="#000000">eina_list_append</font></b><font color="#990000">(</font>list<font color="#990000">,</font> <font color="#FF0000">"blah"</font><font color="#990000">);</font>
        list <font color="#990000">=</font> <b><font color="#000000">eina_list_append</font></b><font color="#990000">(</font>list<font color="#990000">,</font> <font color="#FF0000">"dsc02.jpg"</font><font color="#990000">);</font>
        list <font color="#990000">=</font> <b><font color="#000000">eina_list_append</font></b><font color="#990000">(</font>list<font color="#990000">,</font> <font color="#FF0000">"dsc03.jpg"</font><font color="#990000">);</font>
        list <font color="#990000">=</font> <b><font color="#000000">eina_list_append</font></b><font color="#990000">(</font>list<font color="#990000">,</font> <font color="#FF0000">"dsc04.jpg"</font><font color="#990000">);</font>
        list <font color="#990000">=</font> <b><font color="#000000">eina_list_append</font></b><font color="#990000">(</font>list<font color="#990000">,</font> <font color="#FF0000">"dsc05.jpg"</font><font color="#990000">);</font>
        list <font color="#990000">=</font> <b><font color="#000000">eina_list_append</font></b><font color="#990000">(</font>list<font color="#990000">,</font> <font color="#FF0000">"foooo"</font><font color="#990000">);</font>
        list <font color="#990000">=</font> <b><font color="#000000">eina_list_append</font></b><font color="#990000">(</font>list<font color="#990000">,</font> <font color="#FF0000">"dsc07.jpg"</font><font color="#990000">);</font>
        list <font color="#990000">=</font> <b><font color="#000000">eina_list_append</font></b><font color="#990000">(</font>list<font color="#990000">,</font> <font color="#FF0000">"dsc08.jpg"</font><font color="#990000">);</font>
        list <font color="#990000">=</font> <b><font color="#000000">eina_list_append</font></b><font color="#990000">(</font>list<font color="#990000">,</font> <font color="#FF0000">"dada"</font><font color="#990000">);</font>
        list <font color="#990000">=</font> <b><font color="#000000">eina_list_append</font></b><font color="#990000">(</font>list<font color="#990000">,</font> <font color="#FF0000">"dsc10.jpg"</font><font color="#990000">);</font>

        <b><font color="#000000">EINA_LIST_FOREACH</font></b><font color="#990000">(</font>list<font color="#990000">,</font> l<font color="#990000">,</font> file<font color="#990000">)</font>
        <font color="#FF0000">{</font>
                <b><font color="#0000FF">if</font></b> <font color="#990000">(!</font><b><font color="#000000">ecore_str_has_extension</font></b><font color="#990000">(</font>file<font color="#990000">,</font> <font color="#FF0000">".jpg"</font><font color="#990000">))</font>
                        list <font color="#990000">=</font> <b><font color="#000000">eina_list_remove</font></b><font color="#990000">(</font>list<font color="#990000">,</font> file<font color="#990000">);</font>
        <font color="#FF0000">}</font>

        <i><font color="#9A1900">/* and now print the rest */</font></i>
        <b><font color="#0000FF">while</font></b> <font color="#990000">(</font>list<font color="#990000">)</font>
        <font color="#FF0000">{</font>
                file <font color="#990000">=</font> <b><font color="#000000">eina_list_data_get</font></b><font color="#990000">(</font>list<font color="#990000">);</font>

                <b><font color="#000000">printf</font></b><font color="#990000">(</font><font color="#FF0000">"%s</font><font color="#CC33CC">\n</font><font color="#FF0000">"</font><font color="#990000">,</font> file<font color="#990000">);</font>
                list <font color="#990000">=</font> <b><font color="#000000">eina_list_remove</font></b><font color="#990000">(</font>list<font color="#990000">,</font> file<font color="#990000">);</font>
        <font color="#FF0000">}</font>

        <b><font color="#000000">eina_shutdown</font></b><font color="#990000">();</font>
        <b><font color="#0000FF">return</font></b> <font color="#993399">0</font><font color="#990000">;</font>
<font color="#FF0000">}</font>
</tt></pre>
</td>
</tr>
</table>
<p>This doesn't look that bad on the first look and if you test it does indeed work. But it is wrong! Let me first explain why it is wrong, I'll explain you later why it does work nevertheless. Let's take a look on what the <em>EINA_LIST_FOREACH</em>-macro does. Here is the same loop but the macro expanded:</p>
<table border="0" bgcolor="#e8e8e8" width="100%" cellpadding="10">
<tr>
<td>
<pre>
<pre><tt>        <b><font color="#0000FF">for</font></b> <font color="#990000">(</font>l <font color="#990000">=</font> list<font color="#990000">,</font> file <font color="#990000">=</font> <b><font color="#000000">eina_list_data_get</font></b><font color="#990000">(</font>l<font color="#990000">);</font> l<font color="#990000">;</font> l <font color="#990000">=</font> <b><font color="#000000">eina_list_next</font></b><font color="#990000">(</font>l<font color="#990000">),</font>
                        file <font color="#990000">=</font> <b><font color="#000000">eina_list_data_get</font></b><font color="#990000">(</font>l<font color="#990000">))</font>
        <font color="#FF0000">{</font>
                <b><font color="#0000FF">if</font></b> <font color="#990000">(!</font><b><font color="#000000">ecore_str_has_extension</font></b><font color="#990000">(</font>file<font color="#990000">,</font> <font color="#FF0000">".jpg"</font><font color="#990000">))</font>
                        list <font color="#990000">=</font> <b><font color="#000000">eina_list_remove</font></b><font color="#990000">(</font>list<font color="#990000">,</font> file<font color="#990000">);</font>
        <font color="#FF0000">}</font>
</tt></pre>
</td>
</tr>
</table>
<p><em>eina_list_remove()</em> will, remove the node where <em>l</em> is pointing to and frees the node. So with the following <em>l = eina_list_next(l)</em> we are accessing an already freed node. But why doesn't it crash? Or why doesn't valgrind show any error? Because <em>eina</em> uses an memory pool, to reduce the <em>free()s</em> and <em>malloc()s</em>, so the given node isn't in fact freed. Ok, but if eina is working like that, why shouldn't we take it as a hidden feature, since it does the job as we need it?</p>
<p>Imagine we want now not only remove the non-jpg-files, but want to put them in a second list:</p>
<table border="0" bgcolor="#e8e8e8" width="100%" cellpadding="10">
<tr>
<td>
<pre>
<pre><tt><b><font color="#000080">#include</font></b> <font color="#FF0000">&lt;Eina.h&gt;</font>
<b><font color="#000080">#include</font></b> <font color="#FF0000">&lt;Ecore_Str.h&gt;</font>
<b><font color="#000080">#include</font></b> <font color="#FF0000">&lt;string.h&gt;</font>
<b><font color="#000080">#include</font></b> <font color="#FF0000">&lt;stdio.h&gt;</font>

<font color="#009900">int</font>
<b><font color="#000000">main</font></b><font color="#990000">(</font><font color="#009900">void</font><font color="#990000">)</font>
<font color="#FF0000">{</font>
        Eina_List <font color="#990000">*</font>list <font color="#990000">=</font> NULL<font color="#990000">;</font>
        Eina_List <font color="#990000">*</font>list2 <font color="#990000">=</font> NULL<font color="#990000">;</font>
        Eina_List <font color="#990000">*</font>l<font color="#990000">;</font>
        <b><font color="#0000FF">const</font></b> <font color="#009900">char</font> <font color="#990000">*</font>file<font color="#990000">;</font>

        <b><font color="#000000">eina_init</font></b><font color="#990000">();</font>

        list <font color="#990000">=</font> <b><font color="#000000">eina_list_append</font></b><font color="#990000">(</font>list<font color="#990000">,</font> <font color="#FF0000">"dsc01.jpg"</font><font color="#990000">);</font>
        list <font color="#990000">=</font> <b><font color="#000000">eina_list_append</font></b><font color="#990000">(</font>list<font color="#990000">,</font> <font color="#FF0000">"blah"</font><font color="#990000">);</font>
        list <font color="#990000">=</font> <b><font color="#000000">eina_list_append</font></b><font color="#990000">(</font>list<font color="#990000">,</font> <font color="#FF0000">"dsc02.jpg"</font><font color="#990000">);</font>
        list <font color="#990000">=</font> <b><font color="#000000">eina_list_append</font></b><font color="#990000">(</font>list<font color="#990000">,</font> <font color="#FF0000">"dsc03.jpg"</font><font color="#990000">);</font>
        list <font color="#990000">=</font> <b><font color="#000000">eina_list_append</font></b><font color="#990000">(</font>list<font color="#990000">,</font> <font color="#FF0000">"dsc04.jpg"</font><font color="#990000">);</font>
        list <font color="#990000">=</font> <b><font color="#000000">eina_list_append</font></b><font color="#990000">(</font>list<font color="#990000">,</font> <font color="#FF0000">"dsc05.jpg"</font><font color="#990000">);</font>
        list <font color="#990000">=</font> <b><font color="#000000">eina_list_append</font></b><font color="#990000">(</font>list<font color="#990000">,</font> <font color="#FF0000">"foooo"</font><font color="#990000">);</font>
        list <font color="#990000">=</font> <b><font color="#000000">eina_list_append</font></b><font color="#990000">(</font>list<font color="#990000">,</font> <font color="#FF0000">"dsc07.jpg"</font><font color="#990000">);</font>
        list <font color="#990000">=</font> <b><font color="#000000">eina_list_append</font></b><font color="#990000">(</font>list<font color="#990000">,</font> <font color="#FF0000">"dsc08.jpg"</font><font color="#990000">);</font>
        list <font color="#990000">=</font> <b><font color="#000000">eina_list_append</font></b><font color="#990000">(</font>list<font color="#990000">,</font> <font color="#FF0000">"dada"</font><font color="#990000">);</font>
        list <font color="#990000">=</font> <b><font color="#000000">eina_list_append</font></b><font color="#990000">(</font>list<font color="#990000">,</font> <font color="#FF0000">"dsc10.jpg"</font><font color="#990000">);</font>

        <b><font color="#0000FF">for</font></b> <font color="#990000">(</font>l <font color="#990000">=</font> list<font color="#990000">,</font> file <font color="#990000">=</font> <b><font color="#000000">eina_list_data_get</font></b><font color="#990000">(</font>l<font color="#990000">);</font> l<font color="#990000">;</font> l <font color="#990000">=</font> <b><font color="#000000">eina_list_next</font></b><font color="#990000">(</font>l<font color="#990000">),</font>
                        file <font color="#990000">=</font> <b><font color="#000000">eina_list_data_get</font></b><font color="#990000">(</font>l<font color="#990000">))</font>
        <font color="#FF0000">{</font>
                <b><font color="#0000FF">if</font></b> <font color="#990000">(!</font><b><font color="#000000">ecore_str_has_extension</font></b><font color="#990000">(</font>file<font color="#990000">,</font> <font color="#FF0000">".jpg"</font><font color="#990000">))</font>
                <font color="#FF0000">{</font>
                        list <font color="#990000">=</font> <b><font color="#000000">eina_list_remove</font></b><font color="#990000">(</font>list<font color="#990000">,</font> file<font color="#990000">);</font>
                        list2 <font color="#990000">=</font> <b><font color="#000000">eina_list_append</font></b><font color="#990000">(</font>list2<font color="#990000">,</font> file<font color="#990000">);</font>
                <font color="#FF0000">}</font>
        <font color="#FF0000">}</font>

        <i><font color="#9A1900">/* and now print the rest */</font></i>
        <b><font color="#000000">printf</font></b><font color="#990000">(</font><font color="#FF0000">"first list:</font><font color="#CC33CC">\n</font><font color="#FF0000">"</font><font color="#990000">);</font>
        <b><font color="#0000FF">while</font></b> <font color="#990000">(</font>list<font color="#990000">)</font>
        <font color="#FF0000">{</font>
                <b><font color="#0000FF">const</font></b> <font color="#009900">char</font> <font color="#990000">*</font>file <font color="#990000">=</font> <b><font color="#000000">eina_list_data_get</font></b><font color="#990000">(</font>list<font color="#990000">);</font>

                <b><font color="#000000">printf</font></b><font color="#990000">(</font><font color="#FF0000">"</font><font color="#CC33CC">\t</font><font color="#FF0000">%s</font><font color="#CC33CC">\n</font><font color="#FF0000">"</font><font color="#990000">,</font> file<font color="#990000">);</font>
                list <font color="#990000">=</font> <b><font color="#000000">eina_list_remove</font></b><font color="#990000">(</font>list<font color="#990000">,</font> file<font color="#990000">);</font>
        <font color="#FF0000">}</font>

        <i><font color="#9A1900">/* and now print the rest */</font></i>
        <b><font color="#000000">printf</font></b><font color="#990000">(</font><font color="#FF0000">"second list:</font><font color="#CC33CC">\n</font><font color="#FF0000">"</font><font color="#990000">);</font>
        <b><font color="#0000FF">while</font></b> <font color="#990000">(</font>list2<font color="#990000">)</font>
        <font color="#FF0000">{</font>
                <b><font color="#0000FF">const</font></b> <font color="#009900">char</font> <font color="#990000">*</font>file <font color="#990000">=</font> <b><font color="#000000">eina_list_data_get</font></b><font color="#990000">(</font>list2<font color="#990000">);</font>

                <b><font color="#000000">printf</font></b><font color="#990000">(</font><font color="#FF0000">"</font><font color="#CC33CC">\t</font><font color="#FF0000">%s</font><font color="#CC33CC">\n</font><font color="#FF0000">"</font><font color="#990000">,</font> file<font color="#990000">);</font>
                list2 <font color="#990000">=</font> <b><font color="#000000">eina_list_remove</font></b><font color="#990000">(</font>list2<font color="#990000">,</font> file<font color="#990000">);</font>
        <font color="#FF0000">}</font>

        <b><font color="#000000">eina_shutdown</font></b><font color="#990000">();</font>
        <b><font color="#0000FF">return</font></b> <font color="#993399">0</font><font color="#990000">;</font>
<font color="#FF0000">}</font>
</tt></pre>
</td>
</tr>
</table>
<p>And suddenly it doesn't work anymore. The reason is pretty simple the removed node is put into the memory pool, but then before we iterate to the next node it is appended to the second list. So in fact we are looping after the first remove over the second list.</p>
<p>So how can we do it right? We need to go to the next node before we are removing the node, i.e. we need to keep a reference of the node that is to be removed and do the next step:</p>
<table border="0" bgcolor="#e8e8e8" width="100%" cellpadding="10">
<tr>
<td>
<pre>
<pre><tt>        <b><font color="#0000FF">for</font></b> <font color="#990000">(</font>l <font color="#990000">=</font> list<font color="#990000">;</font> l<font color="#990000"> <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </font>
        <font color="#FF0000">{</font>
                Eina_List <font color="#990000">*</font>tmp <font color="#990000">=</font> l<font color="#990000">;</font>

                l <font color="#990000">=</font> <b><font color="#000000">eina_list_next</font></b><font color="#990000">(</font>l<font color="#990000">);</font>
                file <font color="#990000">=</font> <b><font color="#000000">eina_list_data_get</font></b><font color="#990000">(</font>tmp<font color="#990000">);</font>
                <b><font color="#0000FF">if</font></b> <font color="#990000">(!</font><b><font color="#000000">ecore_str_has_extension</font></b><font color="#990000">(</font>file<font color="#990000">,</font> <font color="#FF0000">".jpg"</font><font color="#990000">))</font>
                <font color="#FF0000">{</font>
                        list <font color="#990000">=</font> <b><font color="#000000">eina_list_remove</font></b><font color="#990000">(</font>list<font color="#990000">,</font> file<font color="#990000">);</font>
                        list2 <font color="#990000">=</font> <b><font color="#000000">eina_list_append</font></b><font color="#990000">(</font>list2<font color="#990000">,</font> file<font color="#990000">);</font>
                <font color="#FF0000">}</font>
        <font color="#FF0000">}</font>
</tt></pre>
</td>
</tr>
</table>
<p>Nice that works! So are we finally done? Not quite. We are using <em>eina_list_remove()</em>. Although there is nothing wrong with this function, you should avoid to use it, because it does a linear search to find the node to remove, i.e. the complexity is O(n). Better use <em>eina_list_remove_list()</em>. Unlike the name suggests, it doesn't remove a list, but it removes a list node, actually exactly what we want.</p>
<table border="0" bgcolor="#e8e8e8" width="100%" cellpadding="10">
<tr>
<td>
<pre>
<pre><tt>        <b><font color="#0000FF">for</font></b> <font color="#990000">(</font>l <font color="#990000">=</font> list<font color="#990000">;</font> l<font color="#990000"> <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </font>
        <font color="#FF0000">{</font>
                Eina_List <font color="#990000">*</font>tmp <font color="#990000">=</font> l<font color="#990000">;</font>

                l <font color="#990000">=</font> <b><font color="#000000">eina_list_next</font></b><font color="#990000">(</font>l<font color="#990000">);</font>
                file <font color="#990000">=</font> <b><font color="#000000">eina_list_data_get</font></b><font color="#990000">(</font>tmp<font color="#990000">);</font>
                <b><font color="#0000FF">if</font></b> <font color="#990000">(!</font><b><font color="#000000">ecore_str_has_extension</font></b><font color="#990000">(</font>file<font color="#990000">,</font> <font color="#FF0000">".jpg"</font><font color="#990000">))</font>
                <font color="#FF0000">{</font>
                        list <font color="#990000">=</font> <b><font color="#000000">eina_list_remove_list</font></b><font color="#990000">(</font>list<font color="#990000">,</font> tmp<font color="#990000">);</font>
                        list2 <font color="#990000">=</font> <b><font color="#000000">eina_list_append</font></b><font color="#990000">(</font>list2<font color="#990000">,</font> file<font color="#990000">);</font>
                <font color="#FF0000">}</font>
        <font color="#FF0000">}</font>
</tt></pre>
</td>
</tr>
</table>
<p>Puh, that was harden then expected, but it was doable, and we even kept it to be an O(n) algorithim. The actually bad thing was that our first shot worked by accident. So keep your eyes open, if you have ever to do a selective remove with eina_list.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pfritz.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pfritz.wordpress.com/11/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pfritz.wordpress.com&#038;blog=4391246&#038;post=11&#038;subd=pfritz&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://pfritz.wordpress.com/2008/11/29/the-lists-and-their-quirks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7dccef66cbefb08528ef041c21e18c90?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">pfritz</media:title>
		</media:content>
	</item>
		<item>
		<title>What are the rules?</title>
		<link>http://pfritz.wordpress.com/2008/08/14/what-are-the-rules/</link>
		<comments>http://pfritz.wordpress.com/2008/08/14/what-are-the-rules/#comments</comments>
		<pubDate>Thu, 14 Aug 2008 10:10:45 +0000</pubDate>
		<dc:creator>pfritz</dc:creator>
				<category><![CDATA[elitaire]]></category>

		<guid isPermaLink="false">http://pfritz.wordpress.com/?p=7</guid>
		<description><![CDATA[After I put elitaire into CVS, and hence gave it a wider publicity, one of the first question was: &#8220;What are the rules of the game XY?&#8221; Most people know the rules of klondike, but some other games like Baker&#8217;s Dozen are unbeknown. So I had the plan to write a little help viewer for [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pfritz.wordpress.com&#038;blog=4391246&#038;post=7&#038;subd=pfritz&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>After I put elitaire into CVS, and hence gave it a wider publicity, one of the first question was: &#8220;What are the rules of the game XY?&#8221; Most people know the rules of klondike, but some other games like Baker&#8217;s Dozen are unbeknown. So I had the plan to write a little help viewer for it for more than year.</p>
<p>And last weekend I&#8217;ve started to write one. First I was unsure what syntax I should use for the file format. For the writers html would be the easiest one, because almost every one has at least a little knowledge about html. So why didn&#8217;t I choose html?</p>
<ol>
<li>The help viewer is using ewl_text, so it suffers under the same limitations like Evas_Textblock does. Things like embedding images, tables and nice enumerations are not possible. I could only support a subset of html. Hence the author lost the advantage of knowing html, because he has to learn what he can use of the html syntax and what not.</li>
<li>Html is tough to parse. If you have to deal with missing end brackets or misconstructions like this &lt;em&gt;&lt;a href=&#8221;&#8230;&#8221;&gt; bla &lt;/em&gt;&lt;/a&gt;.</li>
<li>I don&#8217;t like html <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
</ol>
<p>Of course I could simply open the help page within a browser, but they are IMHO still too slow. I don&#8217;t want to wait some seconds untill I can see the help page.</p>
<p>How does the format look like? I have chosen a syntax that is inspired by tex, but much easier too parse. It has actually only one construction.</p>
<blockquote><p>{\tag[parameter] text}</p></blockquote>
<p>The parameter is optional, that means in most cases it looks like this:</p>
<blockquote><p>{\tag text}</p></blockquote>
<p>But also the text is optional, if you want for example a new line what is in html &lt;br&gt;, you have simply a new paragraph with no indentation.</p>
<blockquote><p>{\noip}</p></blockquote>
<p>The tags are very similar to the one of html:</p>
<blockquote><p>{\h[x] text} is a header where x is a number between 1 and 6, default is 1. X determines the size of the header.</p>
<p>{\p text} is a paragraph with text.</p>
<p>{\a[url] } is a link</p>
<p>{\em text} italic text</p>
<p>{\st text} bold text</p>
<p>{\pre text} is a preformated text, it will not remove whitespace and the output is in monospace font</p></blockquote>
<p>I still need to do some cleanups in the code and I haven&#8217;t integrated it in the elitaire code. But parsing and showing the text works already, even links <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> . And I need to write the documentation <img src='http://s0.wp.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> . Hopefully, I find a native-speaking volunteer, who helps me to eliminate my spelling and grammar mistakes.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/pfritz.wordpress.com/7/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/pfritz.wordpress.com/7/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pfritz.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pfritz.wordpress.com/7/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pfritz.wordpress.com&#038;blog=4391246&#038;post=7&#038;subd=pfritz&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://pfritz.wordpress.com/2008/08/14/what-are-the-rules/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7dccef66cbefb08528ef041c21e18c90?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">pfritz</media:title>
		</media:content>
	</item>
		<item>
		<title>Theme Specification</title>
		<link>http://pfritz.wordpress.com/2008/08/02/theme-specification/</link>
		<comments>http://pfritz.wordpress.com/2008/08/02/theme-specification/#comments</comments>
		<pubDate>Sat, 02 Aug 2008 12:27:39 +0000</pubDate>
		<dc:creator>pfritz</dc:creator>
				<category><![CDATA[edje]]></category>
		<category><![CDATA[elitaire]]></category>

		<guid isPermaLink="false">http://pfritz.wordpress.com/?p=3</guid>
		<description><![CDATA[Last weak I have finally written the theme specs for elitaire. I really didn&#8217;t thought that it&#8217;d take that much time to do that. But now it is ready and in cvs. I also namespaced the group parts, so new themes can now be shared on exchange. Hopefully it will lead people to write their [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pfritz.wordpress.com&#038;blog=4391246&#038;post=3&#038;subd=pfritz&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Last weak I have finally written the theme specs for elitaire. I really didn&#8217;t thought that it&#8217;d take that much time to do that. But now it is ready and in cvs. I also namespaced the group parts, so new themes can now be shared on <a href="http://exchange.enlightenment.org">exchange</a>. Hopefully it will lead people to write their own themes.</p>
<p>Here are some tips for those writing an edje based application. So you can learn from my mistakes.</p>
<ol>
<li>Use a name space for your theme groups. It used to unimportant, but now with exchange it is needed.</li>
<li>Write a theme specification before or while your writing the c code for it. It is a hard to write it after your application is finished, because you need then to grep for all the relevant part names, groups, signals, etc. Writing the spec before you start to code serves you to get a consistent naming.</li>
<li>Don&#8217;t write the theme specification with your own theme in mind. People can and want to arrange things different then you.</li>
</ol>
<p>Of course I know that when you start to write an application you want something that works first, before you start worrying about things like theme specifications. But don&#8217;t forget to write it as soon as possible.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/pfritz.wordpress.com/3/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/pfritz.wordpress.com/3/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pfritz.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pfritz.wordpress.com/3/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pfritz.wordpress.com&#038;blog=4391246&#038;post=3&#038;subd=pfritz&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://pfritz.wordpress.com/2008/08/02/theme-specification/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7dccef66cbefb08528ef041c21e18c90?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">pfritz</media:title>
		</media:content>
	</item>
	</channel>
</rss>
