guid.h

Go to the documentation of this file.
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 
00052 #define GUID_DATA_SIZE  16
00053 typedef union _GUID
00054 {
00055     guchar data[GUID_DATA_SIZE];
00056 
00057     gint __align_me;            /* this just ensures that GUIDs are 32-bit
00058                                  * aligned on systems that need them to be. */
00059 } GUID;
00060 
00061 
00064 #define GUID_ENCODING_LENGTH 32
00065 
00066 
00075 void guid_init (void);
00076 
00090 void guid_init_with_salt (const void *salt, size_t salt_len);
00091 
00106 void guid_init_only_salt (const void *salt, size_t salt_len);
00107 
00111 void guid_shutdown (void);
00112 
00127 void guid_new (GUID * guid);
00128 
00135 GUID guid_new_return (void);
00136 
00139 const GUID *guid_null (void);
00140 
00142 GUID *guid_malloc (void);
00143 
00144 /* Return a guid set to all zero's */
00145 void guid_free (GUID * guid);
00146 
00162 const gchar *guid_to_string (const GUID * guid);
00163 
00177 gchar *guid_to_string_buff (const GUID * guid, gchar * buff);
00178 
00179 
00185 gboolean string_to_guid (const gchar * string, GUID * guid);
00186 
00187 
00190 gboolean guid_equal (const GUID * guid_1, const GUID * guid_2);
00191 gint guid_compare (const GUID * g1, const GUID * g2);
00192 
00194 guint guid_hash_to_guint (gconstpointer ptr);
00195 
00196 GHashTable *guid_hash_table_new (void);
00197 
00198 /* @} */
00199 /* @} */
00200 #endif

Generated on Thu Jan 31 22:50:25 2008 for QOF by  doxygen 1.5.4