~ubuntu-branches/ubuntu/feisty/libgnome/feisty

« back to all changes in this revision

Viewing changes to doc/reference/html/libgnome-gnome-score.html

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Holbach
  • Date: 2005-09-07 18:03:53 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050907180353-hf71fcfx1nb0omez
Tags: 2.12.0.1-0ubuntu1
* New upstream realease:
  - Bug fixes
    - Fix schemas install problem with vi translation (Rodney)
  - Updated translations
    - Vietnamese
* debian/patches/fix-vi.po.patch:
  - dropped, done upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>gnome-score</title><meta name="generator" content="DocBook XSL Stylesheets V1.65.1"><link rel="home" href="index.html" title="GNOME Library Reference Manual"><link rel="up" href="ch01s03.html" title="Displaying help and external info"><link rel="previous" href="libgnome-gnome-url.html" title="gnome-url"><link rel="next" href="ch01s04.html" title="Miscellaneous"><meta name="generator" content="GTK-Doc V1.2 (XML mode)"><style type="text/css">
2
 
        .synopsis, .classsynopsis {
3
 
            background: #eeeeee;
4
 
            border: solid 1px #aaaaaa;
5
 
            padding: 0.5em;
6
 
        }
7
 
        .programlisting {
8
 
            background: #eeeeff;
9
 
            border: solid 1px #aaaaff;
10
 
            padding: 0.5em;
11
 
        }
12
 
        .variablelist {
13
 
            padding: 4px;
14
 
            margin-left: 3em;
15
 
        }
16
 
        .navigation {
17
 
            background: #ffeeee;
18
 
            border: solid 1px #ffaaaa;
19
 
            margin-top: 0.5em;
20
 
            margin-bottom: 0.5em;
21
 
        }
22
 
        .navigation a {
23
 
            color: #770000;
24
 
        }
25
 
        .navigation a:visited {
26
 
            color: #550000;
27
 
        }
28
 
        .navigation .title {
29
 
            font-size: 200%;
30
 
        }
31
 
      </style></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table class="navigation" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle"><td><a accesskey="p" href="libgnome-gnome-url.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td><td><a accesskey="u" href="ch01s03.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td><td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td><th width="100%" align="center">GNOME Library Reference Manual</th><td><a accesskey="n" href="ch01s04.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td></tr></table><div class="refentry" lang="en"><a name="libgnome-gnome-score"></a><div class="titlepage"><div></div><div></div></div><div class="refnamediv"><h2><span class="refentrytitle">gnome-score</span></h2><p>gnome-score &#8212; Tracking best scores for games</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis">
 
1
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>gnome-score</title><meta name="generator" content="DocBook XSL Stylesheets V1.68.1"><link rel="start" href="index.html" title="GNOME Library Reference Manual"><link rel="up" href="ch01s03.html" title="Displaying help and external info"><link rel="prev" href="libgnome-gnome-url.html" title="gnome-url"><link rel="next" href="ch01s04.html" title="Miscellaneous"><meta name="generator" content="GTK-Doc V1.3 (XML mode)"><link rel="stylesheet" href="style.css" type="text/css"><link rel="chapter" href="libgnome.html" title="GNOME Library (libgnome)"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table class="navigation" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle"><td><a accesskey="p" href="libgnome-gnome-url.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td><td><a accesskey="u" href="ch01s03.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td><td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td><th width="100%" align="center">GNOME Library Reference Manual</th><td><a accesskey="n" href="ch01s04.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td></tr></table><div class="refentry" lang="en"><a name="libgnome-gnome-score"></a><div class="titlepage"></div><div class="refnamediv"><table width="100%"><tr><td valign="top"><h2><span class="refentrytitle">gnome-score</span></h2><p>gnome-score &#8212; Tracking best scores for games</p></td><td valign="top" align="right"></td></tr></table></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis">
32
2
 
33
3
#include &lt;libgnome/libgnome.h&gt;
34
4
 
42
12
                                             gchar ***names,
43
13
                                             gfloat **scores,
44
14
                                             time_t **scoretimes);
45
 
</pre></div><div class="refsect1" lang="en"><a name="id2723752"></a><h2>Description</h2><p>
 
15
</pre></div><div class="refsect1" lang="en"><a name="id2556664"></a><h2>Description</h2><p>
46
16
The routines in this module provide a simple way to keep track of users' scores
47
17
in a game.
48
18
</p><p>
49
19
In order to acommodate file ownership permissions, the game application should
50
 
be installed setgid <i class="wordasword">games</i> and the scoretable should
51
 
only be writable by the <i class="wordasword">games</i> group. The program
52
 
should call <a href="libgnome-gnome-score.html#gnome-score-init"><tt class="function">gnome_score_init()</tt></a> as soon as possible inside the <tt class="function">main()</tt> routine.
 
20
be installed setgid <em class="wordasword">games</em> and the scoretable should
 
21
only be writable by the <em class="wordasword">games</em> group. The program
 
22
should call <a href="libgnome-gnome-score.html#gnome-score-init"><code class="function">gnome_score_init()</code></a> as soon as possible inside the <code class="function">main()</code> routine.
53
23
This will open a pair of pipes to a child process which can read and write the
54
24
score table and then will drop the group privileges of the main program back to
55
25
the user's normal group id.
56
 
</p></div><div class="refsect1" lang="en"><a name="id2723803"></a><h2>Details</h2><div class="refsect2" lang="en"><a name="id2723808"></a><h3><a name="gnome-score-init"></a>gnome_score_init ()</h3><a class="indexterm" name="id2723819"></a><pre class="programlisting">gint        gnome_score_init                (const gchar *gamename);</pre><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p><tt class="literal">gnome_score_init</tt> is deprecated and should not be used in newly-written code.</p></div><p>
 
26
</p></div><div class="refsect1" lang="en"><a name="id2556715"></a><h2>Details</h2><div class="refsect2" lang="en"><a name="id2556720"></a><h3><a name="gnome-score-init"></a>gnome_score_init ()</h3><a class="indexterm" name="id2556731"></a><pre class="programlisting">gint        gnome_score_init                (const gchar *gamename);</pre><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p><code class="literal">gnome_score_init</code> is deprecated and should not be used in newly-written code.</p></div><p>
57
27
GNOME games should call this routine as the first statement
58
 
in <tt class="function">main()</tt> if they have been installed setgid to the "games" group. It
 
28
in <code class="function">main()</code> if they have been installed setgid to the "games" group. It
59
29
performs the intialization required to later record information in the
60
30
scores table and then drops the groups privileges.</p><p>
61
31
 
62
 
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>gamename</tt></i>�:</span></td><td> Identifies the game name.
63
 
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> <tt class="literal">0</tt> on success, returns <tt class="literal">-1</tt> on failure.
64
 
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2723915"></a><h3><a name="gnome-score-log"></a>gnome_score_log ()</h3><a class="indexterm" name="id2723926"></a><pre class="programlisting">gint        gnome_score_log                 (gfloat score,
 
32
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><em class="parameter"><code>gamename</code></em>�:</span></td><td> Identifies the game name.
 
33
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>�:</span></td><td> <code class="literal">0</code> on success, returns <code class="literal">-1</code> on failure.
 
34
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2556829"></a><h3><a name="gnome-score-log"></a>gnome_score_log ()</h3><a class="indexterm" name="id2556840"></a><pre class="programlisting">gint        gnome_score_log                 (gfloat score,
65
35
                                             const gchar *level,
66
 
                                             gboolean higher_to_lower_score_order);</pre><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p><tt class="literal">gnome_score_log</tt> is deprecated and should not be used in newly-written code.</p></div><p>
 
36
                                             gboolean higher_to_lower_score_order);</pre><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p><code class="literal">gnome_score_log</code> is deprecated and should not be used in newly-written code.</p></div><p>
67
37
Logs a score entry for the user. You should call this every time a game
68
38
ends.  This function takes care of working out whether the user's score made
69
39
it into the ten best scores and, if so, records it in the table.</p><p>
70
40
 
71
 
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>score</tt></i>�:</span></td><td> The score achieved by the user in this game
72
 
</td></tr><tr><td><span class="term"><i class="parameter"><tt>level</tt></i>�:</span></td><td> The level on which the score was obtained
73
 
</td></tr><tr><td><span class="term"><i class="parameter"><tt>higher_to_lower_score_order</tt></i>�:</span></td><td> Set to <tt class="literal">TRUE</tt> if high scores are better than
 
41
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><em class="parameter"><code>score</code></em>�:</span></td><td> The score achieved by the user in this game
 
42
</td></tr><tr><td><span class="term"><em class="parameter"><code>level</code></em>�:</span></td><td> The level on which the score was obtained
 
43
</td></tr><tr><td><span class="term"><em class="parameter"><code>higher_to_lower_score_order</code></em>�:</span></td><td> Set to <code class="literal">TRUE</code> if high scores are better than
74
44
low scores.
75
 
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> <tt class="literal">0</tt> on failure or the status from the gnome-score helper
 
45
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>�:</span></td><td> <code class="literal">0</code> on failure or the status from the gnome-score helper
76
46
program.
77
 
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2724057"></a><h3><a name="gnome-score-get-notable"></a>gnome_score_get_notable ()</h3><a class="indexterm" name="id2724068"></a><pre class="programlisting">gint        gnome_score_get_notable         (const gchar *gamename,
 
47
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2556973"></a><h3><a name="gnome-score-get-notable"></a>gnome_score_get_notable ()</h3><a class="indexterm" name="id2556984"></a><pre class="programlisting">gint        gnome_score_get_notable         (const gchar *gamename,
78
48
                                             const gchar *level,
79
49
                                             gchar ***names,
80
50
                                             gfloat **scores,
81
 
                                             time_t **scoretimes);</pre><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p><tt class="literal">gnome_score_get_notable</tt> is deprecated and should not be used in newly-written code.</p></div><p>
82
 
Fetches the most notable players on <i class="parameter"><tt>gamename</tt></i> at level <i class="parameter"><tt>level</tt></i>.</p><p>
 
51
                                             time_t **scoretimes);</pre><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p><code class="literal">gnome_score_get_notable</code> is deprecated and should not be used in newly-written code.</p></div><p>
 
52
Fetches the most notable players on <em class="parameter"><code>gamename</code></em> at level <em class="parameter"><code>level</code></em>.</p><p>
83
53
 
84
 
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>gamename</tt></i>�:</span></td><td>   The name of the game we want to fetch information from.
85
 
</td></tr><tr><td><span class="term"><i class="parameter"><tt>level</tt></i>�:</span></td><td>      The level for which we want to pull information.
86
 
</td></tr><tr><td><span class="term"><i class="parameter"><tt>names</tt></i>�:</span></td><td>      An array of strings is returned at the address pointed here
87
 
</td></tr><tr><td><span class="term"><i class="parameter"><tt>scores</tt></i>�:</span></td><td>     An array of gfloats is returned at the address pointed here
88
 
</td></tr><tr><td><span class="term"><i class="parameter"><tt>scoretimes</tt></i>�:</span></td><td> An array of time_t is returned at the address pointed here
89
 
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> The number of scores returned.  The <i class="parameter"><tt>names</tt></i>, <i class="parameter"><tt>scores</tt></i> and <i class="parameter"><tt>scoretime</tt></i>
90
 
pointers point to regions that were allocated with <tt class="function">g_malloc()</tt> with the
 
54
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><em class="parameter"><code>gamename</code></em>�:</span></td><td>   The name of the game we want to fetch information from.
 
55
</td></tr><tr><td><span class="term"><em class="parameter"><code>level</code></em>�:</span></td><td>      The level for which we want to pull information.
 
56
</td></tr><tr><td><span class="term"><em class="parameter"><code>names</code></em>�:</span></td><td>      An array of strings is returned at the address pointed here
 
57
</td></tr><tr><td><span class="term"><em class="parameter"><code>scores</code></em>�:</span></td><td>     An array of gfloats is returned at the address pointed here
 
58
</td></tr><tr><td><span class="term"><em class="parameter"><code>scoretimes</code></em>�:</span></td><td> An array of time_t is returned at the address pointed here
 
59
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>�:</span></td><td> The number of scores returned.  The <em class="parameter"><code>names</code></em>, <em class="parameter"><code>scores</code></em> and <em class="parameter"><code>scoretime</code></em>
 
60
pointers point to regions that were allocated with <code class="function">g_malloc()</code> with the
91
61
contents.
92
62
</td></tr></tbody></table></div></div></div></div><table class="navigation" width="100%" summary="Navigation footer" cellpadding="2" cellspacing="0"><tr valign="middle"><td align="left"><a accesskey="p" href="libgnome-gnome-url.html"><b>&lt;&lt;�gnome-url</b></a></td><td align="right"><a accesskey="n" href="ch01s04.html"><b>Miscellaneous�&gt;&gt;</b></a></td></tr></table></body></html>