|
GnuCash 2.4.99
|
00001 /********************************************************************\ 00002 * guid.h -- globally unique ID User API * 00003 * Copyright (C) 2000 Dave Peticolas <peticola@cs.ucdavis.edu> * 00004 * * 00005 * This program is free software; you can redistribute it and/or * 00006 * modify it under the terms of the GNU General Public License as * 00007 * published by the Free Software Foundation; either version 2 of * 00008 * the License, or (at your option) any later version. * 00009 * * 00010 * This program is distributed in the hope that it will be useful, * 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00013 * GNU General Public License for more details. * 00014 * * 00015 * You should have received a copy of the GNU General Public License* 00016 * along with this program; if not, contact: * 00017 * * 00018 * Free Software Foundation Voice: +1-617-542-5942 * 00019 * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 * 00020 * Boston, MA 02110-1301, USA gnu@gnu.org * 00021 * * 00022 \********************************************************************/ 00023 00024 #ifndef GUID_H 00025 #define GUID_H 00026 00027 #include <stddef.h> 00028 #include <glib-object.h> 00029 00053 #define GUID_DATA_SIZE 16 00054 typedef union GNC_INTERNAL_GUID 00055 { 00056 guchar data[GUID_DATA_SIZE]; 00057 00058 gint __align_me; /* this just ensures that GUIDs are 32-bit 00059 * aligned on systems that need them to be. */ 00060 } GncGUID; 00061 00062 00063 #define GNC_TYPE_GUID (gnc_guid_get_type()) 00064 #define GNC_VALUE_HOLDS_GUID(value) G_VALUE_HOLDS(value, GNC_TYPE_GUID) 00065 00066 GType gnc_guid_get_type (void); 00067 G_CONST_RETURN GncGUID* gnc_value_get_guid (const GValue *value); 00068 00071 #define GUID_ENCODING_LENGTH 32 00072 00073 00082 void guid_init(void); 00083 00087 void guid_shutdown (void); 00088 00103 void guid_new(GncGUID *guid); 00104 00111 GncGUID guid_new_return(void); 00112 00115 const GncGUID * guid_null (void); 00116 00118 GncGUID * guid_malloc (void); 00119 00120 /* Return a guid set to all zero's */ 00121 void guid_free (GncGUID *guid); 00122 00123 GncGUID *guid_copy (const GncGUID *guid); 00124 00140 const gchar * guid_to_string (const GncGUID * guid); 00141 00155 gchar * guid_to_string_buff (const GncGUID * guid, /*@ out @*/ gchar *buff); 00156 00157 00163 gboolean string_to_guid(const gchar * string, /*@ out @*/ GncGUID * guid); 00164 00165 00168 gboolean guid_equal(const GncGUID *guid_1, const GncGUID *guid_2); 00169 gint guid_compare(const GncGUID *g1, const GncGUID *g2); 00170 00172 guint guid_hash_to_guint(gconstpointer ptr); 00173 00175 gint guid_g_hash_table_equal (gconstpointer guid_a, gconstpointer guid_b); 00176 00179 GHashTable *guid_hash_table_new(void); 00180 00181 /* @} */ 00182 /* @} */ 00183 #endif
1.7.4