/**
- * (Re)Initialise given Sampler with random min-wise independent function.
+ * Create a sampler element and initialise it.
*
* In this implementation this means choosing an auth_key for later use in
* a hmac at random.
}
+/**
+ * Destroy a sampler element.
+ *
+ * @param sampler_elem the element to destroy
+ */
+void
+RPS_sampler_elem_destroy (struct RPS_SamplerElement *sampler_elem)
+{
+ #ifdef TO_FILE
+ if (NULL != sampler_elem->file_name)
+ {
+ GNUNET_free (sampler_elem->file_name);
+ }
+ #endif /* TO_FILE */
+ GNUNET_free (sampler_elem);
+}
+
+
/**
* Input an PeerID into the given sampler element.
*
s_elem->num_peers++;
+ #ifdef TO_FILE
to_file (s_elem->file_name,
"Got id %s",
GNUNET_i2s_full (other));
+ #endif /* TO_FILE */
if (0 == GNUNET_CRYPTO_cmp_peer_identity (other, &(s_elem->peer_id)))
{
}
s_elem->is_empty = NOT_EMPTY;
+ #ifdef TO_FILE
to_file (s_elem->file_name,
"Now holding %s",
GNUNET_i2s_full (&s_elem->peer_id));
+ #endif /* TO_FILE */
}
/**