+ metrics_info_init (&ctx->metrics_info);
+ ctx->metrics = metrics_create ();
+
+ return ctx;
+}
+
+static void
+context_destroy (context_t *ctx)
+{
+ metrics_info_fini (&ctx->metrics_info);
+}
+
+void
+context_enter (fips_api_t api, void *system_context_id)
+{
+ /* Do nothing if the application is setting the same context
+ * as is already current. */
+ if (current_context && current_context->system_id == system_context_id)
+ return;
+
+ if (current_context)
+ context_destroy (current_context);
+
+ current_context = context_create (api, system_context_id);