+2008-05-12 Jeffrey Stedfast <fejj@novell.com>
+
+ * glib/gchecksum.c (g_checksum_reset): New function to reset the
+ state of a GChecksum.
+ (g_checksum_new): Call g_checksum_reset() instead of duplicating
+ code.
+
2008-05-17 Matthias Clasen <mclasen@redhat.com>
Bug 528667 – Typos in testing module documentation
* glib/gi18n.c: #include <locale.h> to fix the build.
+>>>>>>> .r6902
2008-05-12 Yair Hershkovitz <yairhr@gmail.com>
* glib/gi18n.c (g_i18n_init): Coding convention fix. Space between
checksum = g_slice_new0 (GChecksum);
checksum->type = checksum_type;
- switch (checksum_type)
+ g_checksum_reset (checksum);
+
+ return checksum;
+}
+
+/**
+ * g_checksum_reset:
+ * @checksum: the #GChecksum to reset
+ *
+ * Resets the state of the @checksum back to it's initial state.
+ **/
+void
+g_checksum_reset (GChecksum *checksum)
+{
+ g_free (checksum->digest_str);
+ checksum->digest_str = NULL;
+
+ switch (checksum->type)
{
case G_CHECKSUM_MD5:
md5_sum_init (&(checksum->sum.md5));
g_assert_not_reached ();
break;
}
-
- return checksum;
}
/**
gssize g_checksum_type_get_length (GChecksumType checksum_type);
GChecksum * g_checksum_new (GChecksumType checksum_type);
+void g_checksum_reset (GChecksum *checksum);
GChecksum * g_checksum_copy (const GChecksum *checksum);
void g_checksum_free (GChecksum *checksum);
void g_checksum_update (GChecksum *checksum,