1 /* 2 * gnome-keyring 3 * 4 * Copyright (C) 2010 Stefan Walter 5 * 6 * This program is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU Lesser General Public License as 8 * published by the Free Software Foundation; either version 2.1 of 9 * the License, or (at your option) any later version. 10 * 11 * This program is distributed in the hope that it will be useful, but 12 * WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 * Lesser General Public License for more details. 15 * 16 * You should have received a copy of the GNU Lesser General Public 17 * License along with this program; if not, see <http://www.gnu.org/licenses/>. 18 */ 19 20 #ifndef __GCR_COMPARABLE_H__ 21 #define __GCR_COMPARABLE_H__ 22 23 #include <glib-object.h> 24 25 G_BEGIN_DECLS 26 27 #define GCR_TYPE_COMPARABLE (gcr_comparable_get_type()) 28 #define GCR_COMPARABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GCR_TYPE_COMPARABLE, GcrComparable)) 29 #define GCR_IS_COMPARABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GCR_TYPE_COMPARABLE)) 30 #define GCR_COMPARABLE_GET_INTERFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE ((inst), GCR_TYPE_COMPARABLE, GcrComparableIface)) 31 32 typedef struct _GcrComparable GcrComparable; 33 typedef struct _GcrComparableIface GcrComparableIface; 34 35 struct _GcrComparableIface { 36 GTypeInterface parent; 37 gint (*compare) (GcrComparable *self, GcrComparable *other); 38 }; 39 40 GType gcr_comparable_get_type (void); 41 42 gint gcr_comparable_compare (GcrComparable *self, 43 GcrComparable *other); 44 45 gint gcr_comparable_memcmp (gconstpointer mem1, 46 gsize size1, 47 gconstpointer mem2, 48 gsize size2); 49 50 G_END_DECLS 51 52 #endif /* __GCR_COMPARABLE_H__ */ 53