Blob Blame History Raw
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>GDataComparable: GData Reference Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="index.html" title="GData Reference Manual">
<link rel="up" href="ch02.html" title="Core API">
<link rel="prev" href="GDataUploadStream.html" title="GDataUploadStream">
<link rel="next" href="ch03.html" title="Access Control List API">
<meta name="generator" content="GTK-Doc V1.26.1 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts">
<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
                  <a href="#GDataComparable.description" class="shortcut">Description</a></span><span id="nav_hierarchy">  <span class="dim">|</span> 
                  <a href="#GDataComparable.object-hierarchy" class="shortcut">Object Hierarchy</a></span><span id="nav_implementations">  <span class="dim">|</span> 
                  <a href="#GDataComparable.implementations" class="shortcut">Known Implementations</a></span>
</td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="ch02.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="GDataUploadStream.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="ch03.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="GDataComparable"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="GDataComparable.top_of_page"></a>GDataComparable</span></h2>
<p>GDataComparable — GData comparable interface</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="GDataComparable.stability-level"></a><h2>Stability Level</h2>
<acronym title="The intention of a Stable interface is to enable arbitrary third parties to
develop applications to these interfaces, release them, and have confidence that
they will run on all minor releases of the product (after the one in which the
interface was introduced, and within the same major release). Even at a major
release, incompatible changes are expected to be rare, and to have strong
justifications.
"><span class="acronym">Stable</span></acronym>, unless otherwise indicated
</div>
<div class="refsect1">
<a name="GDataComparable.functions"></a><h2>Functions</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="functions_return">
<col class="functions_name">
</colgroup>
<tbody><tr>
<td class="function_type">
<a href="../glib/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a>
</td>
<td class="function_name">
<a class="link" href="GDataComparable.html#gdata-comparable-compare" title="gdata_comparable_compare ()">gdata_comparable_compare</a> <span class="c_punctuation">()</span>
</td>
</tr></tbody>
</table></div>
</div>
<div class="refsect1">
<a name="GDataComparable.other"></a><h2>Types and Values</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="name">
<col class="description">
</colgroup>
<tbody>
<tr>
<td class="datatype_keyword"> </td>
<td class="function_name"><a class="link" href="GDataComparable.html#GDataComparable-struct" title="GDataComparable">GDataComparable</a></td>
</tr>
<tr>
<td class="datatype_keyword"> </td>
<td class="function_name"><a class="link" href="GDataComparable.html#GDataComparableIface" title="GDataComparableIface">GDataComparableIface</a></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="GDataComparable.object-hierarchy"></a><h2>Object Hierarchy</h2>
<pre class="screen">    <a href="/opt/gnome/install/share/gtk-doc/html/gobject/GTypeModule.html">GInterface</a>
    <span class="lineart">╰──</span> GDataComparable
</pre>
</div>
<div class="refsect1">
<a name="GDataComparable.implementations"></a><h2>Known Implementations</h2>
<p>
GDataComparable is implemented by
 <a class="link" href="GDataAuthor.html" title="GDataAuthor">GDataAuthor</a>,  <a class="link" href="GDataCategory.html" title="GDataCategory">GDataCategory</a>,  <a class="link" href="GDataGContactCalendar.html" title="GDataGContactCalendar">GDataGContactCalendar</a>,  <a class="link" href="GDataGContactExternalID.html" title="GDataGContactExternalID">GDataGContactExternalID</a>,  <a class="link" href="GDataGContactLanguage.html" title="GDataGContactLanguage">GDataGContactLanguage</a>,  <a class="link" href="GDataGContactWebsite.html" title="GDataGContactWebsite">GDataGContactWebsite</a>,  <a class="link" href="GDataGDEmailAddress.html" title="GDataGDEmailAddress">GDataGDEmailAddress</a>,  <a class="link" href="GDataGDIMAddress.html" title="GDataGDIMAddress">GDataGDIMAddress</a>,  <a class="link" href="GDataGDName.html" title="GDataGDName">GDataGDName</a>,  <a class="link" href="GDataGDOrganization.html" title="GDataGDOrganization">GDataGDOrganization</a>,  <a class="link" href="GDataGDPhoneNumber.html" title="GDataGDPhoneNumber">GDataGDPhoneNumber</a>,  <a class="link" href="GDataGDPostalAddress.html" title="GDataGDPostalAddress">GDataGDPostalAddress</a>,  <a class="link" href="GDataGDReminder.html" title="GDataGDReminder">GDataGDReminder</a>,  <a class="link" href="GDataGDWhen.html" title="GDataGDWhen">GDataGDWhen</a>,  <a class="link" href="GDataGDWhere.html" title="GDataGDWhere">GDataGDWhere</a>,  <a class="link" href="GDataGDWho.html" title="GDataGDWho">GDataGDWho</a>,  <a class="link" href="GDataGenerator.html" title="GDataGenerator">GDataGenerator</a>,  <a class="link" href="GDataLink.html" title="GDataLink">GDataLink</a> and  <a class="link" href="GDataYouTubeCategory.html" title="GDataYouTubeCategory">GDataYouTubeCategory</a>.</p>
</div>
<div class="refsect1">
<a name="GDataComparable.includes"></a><h2>Includes</h2>
<pre class="synopsis">#include &lt;gdata/gdata-comparable.h&gt;
</pre>
</div>
<div class="refsect1">
<a name="GDataComparable.description"></a><h2>Description</h2>
<p><a class="link" href="GDataComparable.html" title="GDataComparable"><span class="type">GDataComparable</span></a> is an interface which can be implemented by any object which needs to be compared to another object of the same type or of a
derived type.</p>
<p>When implementing the interface, classes must implement the <code class="function">compare_with</code> function, and the implementation must be</p>
<a class="ulink" href="http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html#index-g_t_0040code_007bpure_007d-function-attribute-2413" target="_top">pure
</a>.

</div>
<div class="refsect1">
<a name="GDataComparable.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="gdata-comparable-compare"></a><h3>gdata_comparable_compare ()</h3>
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a>
gdata_comparable_compare (<em class="parameter"><code><a class="link" href="GDataComparable.html" title="GDataComparable"><span class="type">GDataComparable</span></a> *self</code></em>,
                          <em class="parameter"><code><a class="link" href="GDataComparable.html" title="GDataComparable"><span class="type">GDataComparable</span></a> *other</code></em>);</pre>
<p>Compares the two objects, returning <code class="code">-1</code> if <em class="parameter"><code>self</code></em>
 is "less than" <em class="parameter"><code>other</code></em>
 by some metric, <code class="code">0</code>
if they're equal, or <code class="code">1</code> if <em class="parameter"><code>self</code></em>
 is "greater than" <em class="parameter"><code>other</code></em>
.</p>
<p><a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> values are handled gracefully, with <code class="code">0</code> returned if both <em class="parameter"><code>self</code></em>
 and <em class="parameter"><code>other</code></em>
 are <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>,</p>
<code class="code">-1</code> if <em class="parameter"><code>self</code></em> is <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> and <code class="code">1</code> if <em class="parameter"><code>other</code></em> is <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.
<p>The <em class="parameter"><code>other</code></em>
 object must be of the same type as <em class="parameter"><code>self</code></em>
, or of a type derived from <em class="parameter"><code>self</code></em>
's type.</p>
<div class="refsect3">
<a name="gdata-comparable-compare.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>self</p></td>
<td class="parameter_description"><p>a <a class="link" href="GDataComparable.html" title="GDataComparable"><span class="type">GDataComparable</span></a>, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>other</p></td>
<td class="parameter_description"><p>another <a class="link" href="GDataComparable.html" title="GDataComparable"><span class="type">GDataComparable</span></a> of the same type, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gdata-comparable-compare.returns"></a><h4>Returns</h4>
<p> <a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> on success, <a href="../glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> otherwise</p>
</div>
<p class="since">Since: <a class="link" href="ix09.html#api-index-0.7.0">0.7.0</a></p>
</div>
</div>
<div class="refsect1">
<a name="GDataComparable.other_details"></a><h2>Types and Values</h2>
<div class="refsect2">
<a name="GDataComparable-struct"></a><h3>GDataComparable</h3>
<pre class="programlisting">typedef struct _GDataComparable GDataComparable;</pre>
<p>All the fields in the <a class="link" href="GDataComparable.html" title="GDataComparable"><span class="type">GDataComparable</span></a> structure are private and should never be accessed directly.</p>
<p class="since">Since: <a class="link" href="ix09.html#api-index-0.7.0">0.7.0</a></p>
</div>
<hr>
<div class="refsect2">
<a name="GDataComparableIface"></a><h3>GDataComparableIface</h3>
<pre class="programlisting">typedef struct {
	GTypeInterface parent;

	gint (*compare_with) (GDataComparable *self, GDataComparable *other);
} GDataComparableIface;
</pre>
<p>The class structure for the <a class="link" href="GDataComparable.html" title="GDataComparable"><span class="type">GDataComparable</span></a> interface.</p>
<div class="refsect3">
<a name="GDataComparableIface.members"></a><h4>Members</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="300px" class="struct_members_name">
<col class="struct_members_description">
<col width="200px" class="struct_members_annotations">
</colgroup>
<tbody>
<tr>
<td class="struct_member_name"><p><a href="../gobject/gobject-Type-Information.html#GTypeInterface"><span class="type">GTypeInterface</span></a> <em class="structfield"><code><a name="GDataComparableIface.parent"></a>parent</code></em>;</p></td>
<td class="struct_member_description"><p>the parent type</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><em class="structfield"><code><a name="GDataComparableIface.compare-with"></a>compare_with</code></em> ()</p></td>
<td class="struct_member_description"><p>compares the object with an <em class="parameter"><code>other</code></em>
object of the same type, returning <code class="code">-1</code> if the object is "less than"
the other object, <code class="code">0</code> if they're equal, or <code class="code">1</code> if the object is "greater than" the other. The
function can assume that neither <em class="parameter"><code>self</code></em>
or <em class="parameter"><code>other</code></em>
will be <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, and that both have correct types. The function must be pure.</p></td>
<td class="struct_member_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<p class="since">Since: <a class="link" href="ix09.html#api-index-0.7.0">0.7.0</a></p>
</div>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.26.1</div>
</body>
</html>