~ubuntu-branches/ubuntu/hardy/gnome-commander/hardy

« back to all changes in this revision

Viewing changes to src/handle.c

  • Committer: Bazaar Package Importer
  • Author(s): Michael Vogt
  • Date: 2006-06-13 15:39:48 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20060613153948-gvrt3mb2ddk5u62o
Tags: 1.2.0-3
added --disable-scrollkeeper on build

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
    GNOME Commander - A GNOME based file manager 
 
2
    GNOME Commander - A GNOME based file manager
3
3
    Copyright (C) 2001-2006 Marcus Bjurman
4
4
 
5
5
    This program is free software; you can redistribute it and/or modify
15
15
    You should have received a copy of the GNU General Public License
16
16
    along with this program; if not, write to the Free Software
17
17
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18
 
*/ 
 
18
*/
19
19
 
20
20
#include <glib.h>
21
21
#include "handle.h"
23
23
 
24
24
Handle  *handle_new (gpointer ref)
25
25
{
26
 
        Handle *h = g_new (Handle, 1);
27
 
 
28
 
        h->ref_count = 1;
29
 
        h->ref = ref;
30
 
 
31
 
        return h;
 
26
    Handle *h = g_new (Handle, 1);
 
27
 
 
28
    h->ref_count = 1;
 
29
    h->ref = ref;
 
30
 
 
31
    return h;
32
32
}
33
33
 
34
34
 
35
35
void handle_free (Handle *h)
36
36
{
37
 
        g_return_if_fail (h);
38
 
        g_return_if_fail (h->ref_count > 0);
39
 
        
40
 
        g_free (h);
 
37
    g_return_if_fail (h);
 
38
    g_return_if_fail (h->ref_count > 0);
 
39
 
 
40
    g_free (h);
41
41
}
42
42
 
43
43
 
44
44
void handle_ref (Handle *h)
45
45
{
46
 
        g_return_if_fail (h);
47
 
        
48
 
        h->ref_count++;
 
46
    g_return_if_fail (h);
 
47
 
 
48
    h->ref_count++;
49
49
}
50
50
 
51
51
 
52
52
void handle_unref (Handle *h)
53
53
{
54
 
        g_return_if_fail (h);
55
 
        g_return_if_fail (h->ref_count > 0);
56
 
        
57
 
        h->ref_count--;
 
54
    g_return_if_fail (h);
 
55
    g_return_if_fail (h->ref_count > 0);
 
56
 
 
57
    h->ref_count--;
58
58
}
59
59
 
60
60
 
61
61
gpointer handle_get_ref (Handle *h)
62
62
{
63
 
        g_return_val_if_fail (h, NULL);
64
 
        
65
 
        return h->ref;
 
63
    g_return_val_if_fail (h, NULL);
 
64
 
 
65
    return h->ref;
66
66
}
67
67
 
68
68