Remove guid_init and guid_shutdown

They no longer do anything, and it's not probable that they ever will.
This commit is contained in:
lmat
2014-07-25 17:38:33 -04:00
parent 30fac05e35
commit f40a93c6e1
7 changed files with 9 additions and 57 deletions

View File

@@ -103,7 +103,6 @@ main_helper (void *closure, int argc, char **argv)
kvp_exclude_type (KVP_TYPE_DOUBLE); kvp_exclude_type (KVP_TYPE_DOUBLE);
/* Initialize to a known RNG position */ /* Initialize to a known RNG position */
guid_init();
srand(1); srand(1);
run_tests (); run_tests ();

View File

@@ -378,22 +378,6 @@ entity is not changed in any way.
GUIDs are created by the GUID generator. The API for this generator is GUIDs are created by the GUID generator. The API for this generator is
low-level and should not be used by user-code. low-level and should not be used by user-code.
@deftypefun void guid_init (void)
Initialize the GUID generator with a variety of random sources including
common system files and /dev/random.
@end deftypefun
@deftypefun void guid_init_with_salt (const void * @var{salt}, size_t @var{salt_len})
Initialize the GUID generator with guid_init() and with the given
sequence of arbitrary binary data.
@end deftypefun
@deftypefun void guid_init_only_salt (const void * @var{salt}, size_t @var{salt_len})
Initialize the GUID generator using only the given sequence of arbitrary
binary data. This provides a way to reliably obtain a given sequence of
GUIDs.
@end deftypefun
@deftypefun void guid_replace (GUID * @var{guid}) @deftypefun void guid_replace (GUID * @var{guid})
Create a new GUID and store it in @var{guid}. This is a low-level function! Create a new GUID and store it in @var{guid}. This is a low-level function!
GnuCash code should use @code{xaccGUIDNew}. GnuCash code should use @code{xaccGUIDNew}.

View File

@@ -124,19 +124,6 @@ guid_null(void)
return nullguid; return nullguid;
} }
/* Function implementations ****************************************/
void
guid_init(void)
{
/*Boost takes care of this*/
}
void
guid_shutdown (void)
{
}
/*Takes an allocated guid pointer and constructs it in place*/ /*Takes an allocated guid pointer and constructs it in place*/
void void
guid_replace(GncGUID *guid) guid_replace(GncGUID *guid)

View File

@@ -71,22 +71,6 @@ const GncGUID* gnc_value_get_guid (const GValue *value);
* not including the null terminator. */ * not including the null terminator. */
#define GUID_ENCODING_LENGTH 32 #define GUID_ENCODING_LENGTH 32
/** Initialize the id generator with a variety of random
* sources.
*
* @note Only one of guid_init(), guid_init_with_salt() and
* guid_init_only_salt() should be called. Calling any
* initialization function a second time will reset the generator and
* erase the effect of the first call.
*/
void guid_init(void);
/** Release the memory chunk associated with gui storage. Use this
* only when shutting down the program, as it invalidates *all*
* GUIDs at once. */
void guid_shutdown (void);
/** Generate a new guid. /** Generate a new guid.
* *
* @param guid A pointer to an allocated guid data structure. The * @param guid A pointer to an allocated guid data structure. The
@@ -94,11 +78,9 @@ void guid_shutdown (void);
*/ */
void guid_replace (GncGUID *guid); void guid_replace (GncGUID *guid);
/** Generate a new id. If no initialization function has been called, /** Generate a new id.
* guid_init() will be called before the id is created.
* *
* @return guid A data structure containing a newly allocated GncGUID. * @return guid A data structure containing a copy of a newly constructed GncGUID.
* Caller is responsible for calling guid_free().
*/ */
GncGUID guid_new_return (void); GncGUID guid_new_return (void);
@@ -121,6 +103,10 @@ GncGUID * guid_new (void);
/*Free the guid pointed to. Do not use this guid any more.*/ /*Free the guid pointed to. Do not use this guid any more.*/
void guid_free (GncGUID *guid); void guid_free (GncGUID *guid);
/**
* Returns a newly allocated GncGUID that matches the passed-in GUID.
* The returned pointer must be freed using guid_free.
*/
GncGUID *guid_copy (const GncGUID *guid); GncGUID *guid_copy (const GncGUID *guid);
/** The guid_to_string() routine returns a null-terminated string /** The guid_to_string() routine returns a null-terminated string

View File

@@ -263,7 +263,6 @@ qof_init (void)
#endif #endif
qof_log_init(); qof_log_init();
qof_string_cache_init(); qof_string_cache_init();
guid_init ();
qof_object_initialize (); qof_object_initialize ();
qof_query_init (); qof_query_init ();
qof_book_register (); qof_book_register ();
@@ -274,7 +273,6 @@ qof_close(void)
{ {
qof_query_shutdown (); qof_query_shutdown ();
qof_object_shutdown (); qof_object_shutdown ();
guid_shutdown ();
qof_finalize_backend_libraries(); qof_finalize_backend_libraries();
qof_string_cache_destroy (); qof_string_cache_destroy ();
qof_log_shutdown(); qof_log_shutdown();

View File

@@ -154,15 +154,15 @@ extern "C"
/** \brief Initialise the Query Object Framework /** \brief Initialise the Query Object Framework
Use in place of separate init functions (like guid_init() Use in place of separate init functions (like qof_query_init(),
and qof_query_init() etc.) to protect against future changes. etc.) to protect against future changes.
*/ */
void qof_init (void); void qof_init (void);
/** \brief Safely close down the Query Object Framework /** \brief Safely close down the Query Object Framework
Use in place of separate close / shutdown functions Use in place of separate close / shutdown functions
(like guid_shutdown(), qof_query_shutdown() etc.) to protect (like qof_query_shutdown(), etc.) to protect
against future changes. against future changes.
*/ */
void qof_close (void); void qof_close (void);

View File

@@ -150,12 +150,10 @@ static void test_gnc_guid_roundtrip (void) {
void test_suite_gnc_guid (void) void test_suite_gnc_guid (void)
{ {
guid_init ();
GNC_TEST_ADD_FUNC (suitename, "gnc create guid", test_create_gnc_guid); GNC_TEST_ADD_FUNC (suitename, "gnc create guid", test_create_gnc_guid);
GNC_TEST_ADD_FUNC (suitename, "gnc copy guid", test_gnc_guid_copy); GNC_TEST_ADD_FUNC (suitename, "gnc copy guid", test_gnc_guid_copy);
GNC_TEST_ADD_FUNC (suitename, "gnc guid to string", test_gnc_guid_to_string); GNC_TEST_ADD_FUNC (suitename, "gnc guid to string", test_gnc_guid_to_string);
GNC_TEST_ADD_FUNC (suitename, "gnc guid equal", test_gnc_guid_equals); GNC_TEST_ADD_FUNC (suitename, "gnc guid equal", test_gnc_guid_equals);
GNC_TEST_ADD_FUNC (suitename, "gnc guid string roundtrip", test_gnc_guid_roundtrip); GNC_TEST_ADD_FUNC (suitename, "gnc guid string roundtrip", test_gnc_guid_roundtrip);
guid_shutdown ();
} }