<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Minor API inconsistencies</title>
		<link>http://www.allegro.cc/forums/view/615183</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Fri, 13 Mar 2015 06:20:57 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>1) I have noticed some functions that are meant to query a boolean property are named <tt>al_is_*</tt> while some are called <tt>al_get_*</tt>.<br />I&#39;ve checked whether those following the <tt>al_get_*</tt> pattern have corresponding <tt>al_set_*</tt> functions (as it might be nicer to have <tt>al_get_*</tt>/<tt>al_set_*</tt> than <tt>al_is_*</tt>/<tt>al_set_*</tt>), but that wasn&#39;t alyways the case.</p><p>The ones that are called <tt>al_get_...</tt> without corresponding <tt>al_set_...</tt> colleagues are:
</p><ul><li><p><tt>al_get_timer_started</tt></p></li><li><p><tt>al_get_joystick_active</tt></p></li><li><p><tt>al_get_haptic_active</tt></p></li><li><p><tt>al_get_sample_instance_attached</tt></p></li><li><p><tt>al_get_mixer_attached</tt></p></li><li><p><tt>al_get_audio_stream_attached</tt></p></li></ul><p>
The ones with corresponding setters are:
</p><ul><li><p><tt>al_get_thread_should_stop</tt></p></li><li><p><tt>al_get_voice_playing</tt></p></li><li><p><tt>al_get_sample_instance_playing</tt></p></li><li><p><tt>al_get_mixer_playing</tt></p></li><li><p><tt>al_get_audio_stream_playing</tt></p></li></ul><p>

2)<br />Another very minor API inconsistency concerns the &quot;platform specific functions&quot;:<br />All of them seem to follow an (unusual) <tt>al_-platform-_verb_...</tt>-pattern (e. g. <tt>al_osx_get_window</tt>), but one exception:<br /><tt>al_get_win_window_handle</tt>.<br />Note that the D3D/OpenGL functions, too, follow the <tt>al_-verb-_opengl_*</tt> and <tt>al_-verb-_d3d_*</tt> patterns respectively. </p><p>Thus, the only function names that don&#39;t follow the <tt>al_verb_...</tt>-pattern are:
</p><ul><li><p>&quot;platform specific functions&quot; - except <tt>al_get_win_window_handle</tt></p></li><li><p><tt>al_ustr_*, al_utf8_*, al_utf16_*, al_ref_*, al_cstr</tt></p></li><li><p><tt>al_color_*</tt></p></li><li><p>file I/O, memory management and fixed point maths are different beasts anyway <img src="http://www.allegro.cc/forums/smileys/wink.gif" alt=";)" /></p></li></ul><p>

I thought I&#39;d post it here for comments.</p><p>By the way: The prototype for <tt>al_do_multiline_text</tt> is mysteriously absent from the <a href="http://alleg.sourceforge.net/a5docs/refman/font.html#al_do_multiline_text">docs page</a>. How do I resurrect it?<br />Edit: Nevermind, the culprit was a space in addons/font/text.c:544.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Polybios)</author>
		<pubDate>Tue, 10 Mar 2015 21:35:58 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Thanks for going through those! Some of those are indeed poorly named, and could stand for a revision. I think we&#39;ll be able to start deprecating some of the worst names in the next stable release. I&#39;ve added this thread to my TODO list.</p><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/615183/1011283#target">Polybios</a> said:</div><div class="quote"><p> Edit: Nevermind, the culprit was a space in addons/font/text.c:544. </p></div></div><p>This is now fixed.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (SiegeLord)</author>
		<pubDate>Wed, 11 Mar 2015 08:07:27 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>
Talking of inconsistencies...<br />why is </p><p>al_fgets(file,buffer,size)</p><p>different to </p><p>fgets(buffer,size,file) </p><p>??
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Yodhe23)</author>
		<pubDate>Thu, 12 Mar 2015 22:02:05 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Because we didn&#39;t want to clone the original libc api. Its more important for allegro&#39;s api to be consistent with itself than with similar external APIs. Allegro tends to go with the object it is operating on as the first parameter.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Thu, 12 Mar 2015 22:13:44 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/615183/1011329#target">Thomas Fjellstrom</a> said:</div><div class="quote"><p>
Because we didn&#39;t want to clone the original libc api.
</p></div></div><p>
While that&#39;s true, it&#39;s slightly confusing we copy the function name, but not the argument ordering.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Chris Katko)</author>
		<pubDate>Fri, 13 Mar 2015 01:53:20 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Maybe a macro would be useful:
</p><div class="source-code snippet"><div class="inner"><pre><span class="p">#define al_fgets_t(b,s,f) al_fgets(f,b,s)</span>
</pre></div></div><p>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (jmasterx)</author>
		<pubDate>Fri, 13 Mar 2015 06:20:57 +0000</pubDate>
	</item>
</rss>
