GnuCash  2.6.99
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
guid.h
Go to the documentation of this file.
1 /********************************************************************\
2  * guid.h -- globally unique ID User API *
3  * Copyright (C) 2000 Dave Peticolas <[email protected]> *
4  * 2014 Aaron Laws <[email protected]> *
5  * *
6  * This program is free software; you can redistribute it and/or *
7  * modify it under the terms of the GNU General Public License as *
8  * published by the Free Software Foundation; either version 2 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, *
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14  * GNU General Public License for more details. *
15  * *
16  * You should have received a copy of the GNU General Public License*
17  * along with this program; if not, contact: *
18  * *
19  * Free Software Foundation Voice: +1-617-542-5942 *
20  * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
21  * Boston, MA 02110-1301, USA [email protected] *
22  * *
23 \********************************************************************/
24 
25 #ifndef GUID_H
26 #define GUID_H
27 
28 #ifdef __cplusplus
29 extern "C"
30 {
31 #endif
32 
33 #include <stddef.h>
34 #include <glib-object.h>
35 
59 #define GUID_DATA_SIZE 16
60 
61 #define GNC_TYPE_GUID (gnc_guid_get_type())
62 #define GNC_VALUE_HOLDS_GUID(value) G_VALUE_HOLDS(value, GNC_TYPE_GUID)
63 
65 typedef struct _gncGuid {
66  unsigned char reserved[GUID_DATA_SIZE];
67 } GncGUID;
68 
69 GType gnc_guid_get_type (void);
70 const GncGUID* gnc_value_get_guid (const GValue *value);
71 
74 #define GUID_ENCODING_LENGTH 32
75 
81 void guid_replace (GncGUID *guid);
82 
88 
92 const GncGUID * guid_null (void);
93 
99 GncGUID * guid_malloc (void);
100 
105 GncGUID * guid_new (void);
106 
107 /*Free the guid pointed to. Do not use this guid any more.*/
108 void guid_free (GncGUID *guid);
109 
114 GncGUID *guid_copy (const GncGUID *guid);
115 
128 gchar * guid_to_string (const GncGUID * guid);
129 
144 gchar * guid_to_string_buff (const GncGUID * guid, /*@ out @*/ gchar *buff);
145 
146 
156 gboolean string_to_guid(const gchar * string, /*@ out @*/ GncGUID * guid);
157 
158 
161 gboolean guid_equal(const GncGUID *guid_1, const GncGUID *guid_2);
162 gint guid_compare(const GncGUID *g1, const GncGUID *g2);
163 
165 guint guid_hash_to_guint(gconstpointer ptr);
166 
168 gint guid_g_hash_table_equal (gconstpointer guid_a, gconstpointer guid_b);
169 
172 GHashTable *guid_hash_table_new(void);
173 
174 /* @} */
175 /* @} */
176 #ifdef __cplusplus
177 }
178 #endif
179 
180 #endif
void guid_replace(GncGUID *guid)
struct _gncGuid GncGUID
GncGUID guid_new_return(void)
GncGUID * guid_copy(const GncGUID *guid)
gboolean string_to_guid(const gchar *string, GncGUID *guid)
GncGUID * guid_new(void)
GHashTable * guid_hash_table_new(void)
gchar * guid_to_string_buff(const GncGUID *guid, gchar *buff)
guint guid_hash_to_guint(gconstpointer ptr)
Definition: guid.h:65
GncGUID * guid_malloc(void)
gboolean guid_equal(const GncGUID *guid_1, const GncGUID *guid_2)
gchar * guid_to_string(const GncGUID *guid)
const GncGUID * guid_null(void)
gint guid_g_hash_table_equal(gconstpointer guid_a, gconstpointer guid_b)