telepathygabble/inc/handle-set.h
changeset 10 59927b2d3b75
parent 0 d0f3a028347a
equal deleted inserted replaced
0:d0f3a028347a 10:59927b2d3b75
     1 /*
       
     2  * handle-set.h - a set which refs a handle when inserted
       
     3  *
       
     4  * Copyright (C) 2005,2006 Collabora Ltd.
       
     5  * 
       
     6  *
       
     7  * This library is free software; you can redistribute it and/or
       
     8  * modify it under the terms of the GNU Lesser General Public License
       
     9  * as published by the Free Software Foundation; either version 2.1 of
       
    10  * the License, or (at your option) any later version.
       
    11  *
       
    12  * This library is distributed in the hope that it will be useful, but
       
    13  * WITHOUT ANY WARRANTY; without even the implied warranty of
       
    14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
       
    15  * Lesser General Public License for more details.
       
    16  *
       
    17  * You should have received a copy of the GNU Lesser General Public
       
    18  * License along with this library; if not, write to the Free Software
       
    19  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
       
    20  * 02110-1301 USA
       
    21  *
       
    22  */
       
    23 
       
    24 #ifndef __HANDLE_SET_H__
       
    25 #define __HANDLE_SET_H__
       
    26 
       
    27 #include "gintset.h"
       
    28 
       
    29 G_BEGIN_DECLS
       
    30 
       
    31 typedef struct _GabbleHandleSet GabbleHandleSet;
       
    32 typedef void (*GabbleHandleFunc)(GabbleHandleSet *set, GabbleHandle handle, gpointer userdata);
       
    33 
       
    34 GabbleHandleSet * handle_set_new (GabbleHandleRepo *, TpHandleType type);
       
    35 void handle_set_destroy (GabbleHandleSet *);
       
    36 
       
    37 GIntSet *handle_set_peek (GabbleHandleSet *set);
       
    38 
       
    39 void handle_set_add (GabbleHandleSet *set, GabbleHandle handle);
       
    40 gboolean handle_set_remove (GabbleHandleSet *set, GabbleHandle handle);
       
    41 gboolean handle_set_is_member (GabbleHandleSet *set, GabbleHandle handle);
       
    42 
       
    43 void handle_set_foreach (GabbleHandleSet *set, GabbleHandleFunc func, gpointer userdata);
       
    44 
       
    45 int handle_set_size (GabbleHandleSet *set);
       
    46 GArray *handle_set_to_array (GabbleHandleSet *set);
       
    47 
       
    48 GIntSet *handle_set_update (GabbleHandleSet *set, const GIntSet *add);
       
    49 GIntSet *handle_set_difference_update (GabbleHandleSet *set, const GIntSet *remove);
       
    50 
       
    51 G_END_DECLS
       
    52 
       
    53 #endif /*__HANDLE_SET_H__*/