<commit_before>#include "kms-media-handler-manager.h"

static void
kms_media_handler_manager_base_init (gpointer g_class) {
	static gboolean is_initialized = FALSE;

	if (!is_initialized) {
		/* add properties and signals to the interface here */

		is_initialized = TRUE;
	}
}

GType
kms_media_handler_manager_get_type(void) {
	static GType iface_type = 0;
	if (iface_type == 0) {
		static const GTypeInfo info = {
			sizeof (KmsMediaHandlerManagerInterface),
			kms_media_handler_manager_base_init,   /* base_init */
			NULL,   /* base_finalize */
		};

		iface_type = g_type_register_static(G_TYPE_INTERFACE,
						"KmsMediaHandlerManager",
						&info, 0);
	}

	return iface_type;
}

void
kms_media_handler_manager_get_factory(KmsMediaHandlerManager *self) {
	g_return_if_fail(KMS_IS_MEDIA_HANDLER_MANAGER (self));

	KMS_MEDIA_HANDLER_MANAGER_GET_INTERFACE(self)->get_factory(self);
}<commit_msg>Check if the interface method is not null before using it<commit_after>#include "kms-media-handler-manager.h"

static void
kms_media_handler_manager_base_init (gpointer g_class) {
	static gboolean is_initialized = FALSE;

	if (!is_initialized) {
		/* add properties and signals to the interface here */

		is_initialized = TRUE;
	}
}

GType
kms_media_handler_manager_get_type(void) {
	static GType iface_type = 0;
	if (iface_type == 0) {
		static const GTypeInfo info = {
			sizeof (KmsMediaHandlerManagerInterface),
			kms_media_handler_manager_base_init,   /* base_init */
			NULL,   /* base_finalize */
		};

		iface_type = g_type_register_static(G_TYPE_INTERFACE,
						"KmsMediaHandlerManager",
						&info, 0);
	}

	return iface_type;
}

KmsMediaHandlerFactory*
kms_media_handler_manager_get_factory(KmsMediaHandlerManager *self) {
	KmsMediaHandlerManagerInterface *iface;

	g_return_if_fail(KMS_IS_MEDIA_HANDLER_MANAGER (self));

	iface = KMS_MEDIA_HANDLER_MANAGER_GET_INTERFACE(self);

	if (iface->get_factory != NULL)
		KMS_MEDIA_HANDLER_MANAGER_GET_INTERFACE(self)->get_factory(self);
	else {
		gchar *msg = g_strdup_printf(
				"%s does not provide and implementation of "
				"get_factory method", G_INTERFACE_NAME(iface));
		g_warn_message(G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
		g_free(msg);
	}
}
{'fraction_non_alphanumeric': 0.09266756635177688, 'fraction_numerical': 0.002699055330634278, 'mean_word_length': 5.3724928366762175, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7368334', 'n_tokens_mistral': 871, 'n_tokens_neox': 816, 'n_words': 147}