/* compatibility-process-guard.c generated by valac 0.56.19, the Vala compiler
 * generated from compatibility-process-guard.vala, do not modify */

#include "protonplus_core.h"
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <gee.h>
#include <glib-object.h>
#include <gio/gio.h>
#include <glib/gstdio.h>

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif

enum  {
	PROTON_PLUS_SERVICES_COMPATIBILITY_PROCESS_RECORD_0_PROPERTY,
	PROTON_PLUS_SERVICES_COMPATIBILITY_PROCESS_RECORD_EXECUTABLE_PATH_PROPERTY,
	PROTON_PLUS_SERVICES_COMPATIBILITY_PROCESS_RECORD_ARGV_PROPERTY,
	PROTON_PLUS_SERVICES_COMPATIBILITY_PROCESS_RECORD_NUM_PROPERTIES
};
static GParamSpec* proton_plus_services_compatibility_process_record_properties[PROTON_PLUS_SERVICES_COMPATIBILITY_PROCESS_RECORD_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define PROTON_PLUS_SERVICES_TYPE_HOST_COMPATIBILITY_PROCESS_QUERY_BACKEND (proton_plus_services_host_compatibility_process_query_backend_get_type ())
#define PROTON_PLUS_SERVICES_HOST_COMPATIBILITY_PROCESS_QUERY_BACKEND(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PROTON_PLUS_SERVICES_TYPE_HOST_COMPATIBILITY_PROCESS_QUERY_BACKEND, ProtonPlusServicesHostCompatibilityProcessQueryBackend))
#define PROTON_PLUS_SERVICES_HOST_COMPATIBILITY_PROCESS_QUERY_BACKEND_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PROTON_PLUS_SERVICES_TYPE_HOST_COMPATIBILITY_PROCESS_QUERY_BACKEND, ProtonPlusServicesHostCompatibilityProcessQueryBackendClass))
#define PROTON_PLUS_SERVICES_IS_HOST_COMPATIBILITY_PROCESS_QUERY_BACKEND(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PROTON_PLUS_SERVICES_TYPE_HOST_COMPATIBILITY_PROCESS_QUERY_BACKEND))
#define PROTON_PLUS_SERVICES_IS_HOST_COMPATIBILITY_PROCESS_QUERY_BACKEND_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PROTON_PLUS_SERVICES_TYPE_HOST_COMPATIBILITY_PROCESS_QUERY_BACKEND))
#define PROTON_PLUS_SERVICES_HOST_COMPATIBILITY_PROCESS_QUERY_BACKEND_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PROTON_PLUS_SERVICES_TYPE_HOST_COMPATIBILITY_PROCESS_QUERY_BACKEND, ProtonPlusServicesHostCompatibilityProcessQueryBackendClass))

typedef struct _ProtonPlusServicesHostCompatibilityProcessQueryBackend ProtonPlusServicesHostCompatibilityProcessQueryBackend;
typedef struct _ProtonPlusServicesHostCompatibilityProcessQueryBackendClass ProtonPlusServicesHostCompatibilityProcessQueryBackendClass;
typedef struct _ProtonPlusServicesHostCompatibilityProcessQueryBackendPrivate ProtonPlusServicesHostCompatibilityProcessQueryBackendPrivate;
enum  {
	PROTON_PLUS_SERVICES_HOST_COMPATIBILITY_PROCESS_QUERY_BACKEND_0_PROPERTY,
	PROTON_PLUS_SERVICES_HOST_COMPATIBILITY_PROCESS_QUERY_BACKEND_NUM_PROPERTIES
};
static GParamSpec* proton_plus_services_host_compatibility_process_query_backend_properties[PROTON_PLUS_SERVICES_HOST_COMPATIBILITY_PROCESS_QUERY_BACKEND_NUM_PROPERTIES];
#define _g_regex_unref0(var) ((var == NULL) ? NULL : (var = (g_regex_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
enum  {
	PROTON_PLUS_SERVICES_COMPATIBILITY_PROCESS_GUARD_0_PROPERTY,
	PROTON_PLUS_SERVICES_COMPATIBILITY_PROCESS_GUARD_NUM_PROPERTIES
};
static GParamSpec* proton_plus_services_compatibility_process_guard_properties[PROTON_PLUS_SERVICES_COMPATIBILITY_PROCESS_GUARD_NUM_PROPERTIES];

struct _ProtonPlusServicesCompatibilityProcessRecordPrivate {
	gchar* _executable_path;
	GeeList* _argv;
};

struct _ProtonPlusServicesHostCompatibilityProcessQueryBackend {
	GObject parent_instance;
	ProtonPlusServicesHostCompatibilityProcessQueryBackendPrivate * priv;
};

struct _ProtonPlusServicesHostCompatibilityProcessQueryBackendClass {
	GObjectClass parent_class;
};

struct _ProtonPlusServicesCompatibilityProcessGuardPrivate {
	ProtonPlusServicesCompatibilityProcessQueryBackend* backend;
};

static gint ProtonPlusServicesCompatibilityProcessRecord_private_offset;
static gpointer proton_plus_services_compatibility_process_record_parent_class = NULL;
static gpointer proton_plus_services_host_compatibility_process_query_backend_parent_class = NULL;
static ProtonPlusServicesCompatibilityProcessQueryBackendIface * proton_plus_services_host_compatibility_process_query_backend_proton_plus_services_compatibility_process_query_backend_parent_iface = NULL;
static gint ProtonPlusServicesCompatibilityProcessGuard_private_offset;
static gpointer proton_plus_services_compatibility_process_guard_parent_class = NULL;

static void proton_plus_services_compatibility_process_record_set_executable_path (ProtonPlusServicesCompatibilityProcessRecord* self,
                                                                            const gchar* value);
static void proton_plus_services_compatibility_process_record_set_argv (ProtonPlusServicesCompatibilityProcessRecord* self,
                                                                 GeeList* value);
static void proton_plus_services_compatibility_process_record_finalize (GObject * obj);
static GType proton_plus_services_compatibility_process_record_get_type_once (void);
static void _vala_proton_plus_services_compatibility_process_record_get_property (GObject * object,
                                                                           guint property_id,
                                                                           GValue * value,
                                                                           GParamSpec * pspec);
static void _vala_proton_plus_services_compatibility_process_record_set_property (GObject * object,
                                                                           guint property_id,
                                                                           const GValue * value,
                                                                           GParamSpec * pspec);
static GType proton_plus_services_compatibility_process_query_backend_get_type_once (void);
VALA_EXTERN GType proton_plus_services_host_compatibility_process_query_backend_get_type (void) G_GNUC_CONST ;
static GeeList* proton_plus_services_host_compatibility_process_query_backend_real_query_processes (ProtonPlusServicesCompatibilityProcessQueryBackend* base);
VALA_EXTERN ProtonPlusServicesHostCompatibilityProcessQueryBackend* proton_plus_services_host_compatibility_process_query_backend_new (void);
VALA_EXTERN ProtonPlusServicesHostCompatibilityProcessQueryBackend* proton_plus_services_host_compatibility_process_query_backend_construct (GType object_type);
static GType proton_plus_services_host_compatibility_process_query_backend_get_type_once (void);
static gboolean proton_plus_services_compatibility_process_guard_is_compatibility_token (ProtonPlusServicesCompatibilityProcessGuard* self,
                                                                                  const gchar* value);
static void proton_plus_services_compatibility_process_guard_finalize (GObject * obj);
static GType proton_plus_services_compatibility_process_guard_get_type_once (void);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);
static gssize _vala_array_length (gpointer array);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
proton_plus_services_compatibility_process_record_get_instance_private (ProtonPlusServicesCompatibilityProcessRecord* self)
{
	return G_STRUCT_MEMBER_P (self, ProtonPlusServicesCompatibilityProcessRecord_private_offset);
}

static gpointer
_g_object_ref0 (gpointer self)
{
	return self ? g_object_ref (self) : NULL;
}

ProtonPlusServicesCompatibilityProcessRecord*
proton_plus_services_compatibility_process_record_construct (GType object_type,
                                                             const gchar* executable_path,
                                                             GeeList* argv)
{
	ProtonPlusServicesCompatibilityProcessRecord * self = NULL;
	GeeList* _tmp0_ = NULL;
	GeeList* _tmp1_;
	g_return_val_if_fail (executable_path != NULL, NULL);
	self = (ProtonPlusServicesCompatibilityProcessRecord*) g_object_new (object_type, NULL);
	proton_plus_services_compatibility_process_record_set_executable_path (self, executable_path);
	_tmp1_ = _g_object_ref0 (argv);
	_tmp0_ = _tmp1_;
	if (_tmp0_ == NULL) {
		GeeArrayList* _tmp2_;
		_tmp2_ = gee_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, NULL, NULL, NULL);
		_g_object_unref0 (_tmp0_);
		_tmp0_ = (GeeList*) _tmp2_;
	}
	proton_plus_services_compatibility_process_record_set_argv (self, _tmp0_);
	_g_object_unref0 (_tmp0_);
	return self;
}

ProtonPlusServicesCompatibilityProcessRecord*
proton_plus_services_compatibility_process_record_new (const gchar* executable_path,
                                                       GeeList* argv)
{
	return proton_plus_services_compatibility_process_record_construct (PROTON_PLUS_SERVICES_TYPE_COMPATIBILITY_PROCESS_RECORD, executable_path, argv);
}

const gchar*
proton_plus_services_compatibility_process_record_get_executable_path (ProtonPlusServicesCompatibilityProcessRecord* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_executable_path;
	result = _tmp0_;
	return result;
}

static void
proton_plus_services_compatibility_process_record_set_executable_path (ProtonPlusServicesCompatibilityProcessRecord* self,
                                                                       const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_services_compatibility_process_record_get_executable_path (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_executable_path);
		self->priv->_executable_path = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_services_compatibility_process_record_properties[PROTON_PLUS_SERVICES_COMPATIBILITY_PROCESS_RECORD_EXECUTABLE_PATH_PROPERTY]);
	}
}

GeeList*
proton_plus_services_compatibility_process_record_get_argv (ProtonPlusServicesCompatibilityProcessRecord* self)
{
	GeeList* result;
	GeeList* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_argv;
	result = _tmp0_;
	return result;
}

static void
proton_plus_services_compatibility_process_record_set_argv (ProtonPlusServicesCompatibilityProcessRecord* self,
                                                            GeeList* value)
{
	GeeList* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_services_compatibility_process_record_get_argv (self);
	if (old_value != value) {
		GeeList* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_argv);
		self->priv->_argv = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_services_compatibility_process_record_properties[PROTON_PLUS_SERVICES_COMPATIBILITY_PROCESS_RECORD_ARGV_PROPERTY]);
	}
}

static void
proton_plus_services_compatibility_process_record_class_init (ProtonPlusServicesCompatibilityProcessRecordClass * klass,
                                                              gpointer klass_data)
{
	proton_plus_services_compatibility_process_record_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ProtonPlusServicesCompatibilityProcessRecord_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_proton_plus_services_compatibility_process_record_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_proton_plus_services_compatibility_process_record_set_property;
	G_OBJECT_CLASS (klass)->finalize = proton_plus_services_compatibility_process_record_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_SERVICES_COMPATIBILITY_PROCESS_RECORD_EXECUTABLE_PATH_PROPERTY, proton_plus_services_compatibility_process_record_properties[PROTON_PLUS_SERVICES_COMPATIBILITY_PROCESS_RECORD_EXECUTABLE_PATH_PROPERTY] = g_param_spec_string ("executable-path", "executable-path", "executable-path", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_SERVICES_COMPATIBILITY_PROCESS_RECORD_ARGV_PROPERTY, proton_plus_services_compatibility_process_record_properties[PROTON_PLUS_SERVICES_COMPATIBILITY_PROCESS_RECORD_ARGV_PROPERTY] = g_param_spec_object ("argv", "argv", "argv", GEE_TYPE_LIST, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
proton_plus_services_compatibility_process_record_instance_init (ProtonPlusServicesCompatibilityProcessRecord * self,
                                                                 gpointer klass)
{
	self->priv = proton_plus_services_compatibility_process_record_get_instance_private (self);
}

static void
proton_plus_services_compatibility_process_record_finalize (GObject * obj)
{
	ProtonPlusServicesCompatibilityProcessRecord * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PROTON_PLUS_SERVICES_TYPE_COMPATIBILITY_PROCESS_RECORD, ProtonPlusServicesCompatibilityProcessRecord);
	_g_free0 (self->priv->_executable_path);
	_g_object_unref0 (self->priv->_argv);
	G_OBJECT_CLASS (proton_plus_services_compatibility_process_record_parent_class)->finalize (obj);
}

static GType
proton_plus_services_compatibility_process_record_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ProtonPlusServicesCompatibilityProcessRecordClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) proton_plus_services_compatibility_process_record_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ProtonPlusServicesCompatibilityProcessRecord), 0, (GInstanceInitFunc) proton_plus_services_compatibility_process_record_instance_init, NULL };
	GType proton_plus_services_compatibility_process_record_type_id;
	proton_plus_services_compatibility_process_record_type_id = g_type_register_static (G_TYPE_OBJECT, "ProtonPlusServicesCompatibilityProcessRecord", &g_define_type_info, 0);
	ProtonPlusServicesCompatibilityProcessRecord_private_offset = g_type_add_instance_private (proton_plus_services_compatibility_process_record_type_id, sizeof (ProtonPlusServicesCompatibilityProcessRecordPrivate));
	return proton_plus_services_compatibility_process_record_type_id;
}

GType
proton_plus_services_compatibility_process_record_get_type (void)
{
	static volatile gsize proton_plus_services_compatibility_process_record_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_services_compatibility_process_record_type_id__once)) {
		GType proton_plus_services_compatibility_process_record_type_id;
		proton_plus_services_compatibility_process_record_type_id = proton_plus_services_compatibility_process_record_get_type_once ();
		g_once_init_leave (&proton_plus_services_compatibility_process_record_type_id__once, proton_plus_services_compatibility_process_record_type_id);
	}
	return proton_plus_services_compatibility_process_record_type_id__once;
}

static void
_vala_proton_plus_services_compatibility_process_record_get_property (GObject * object,
                                                                      guint property_id,
                                                                      GValue * value,
                                                                      GParamSpec * pspec)
{
	ProtonPlusServicesCompatibilityProcessRecord * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PROTON_PLUS_SERVICES_TYPE_COMPATIBILITY_PROCESS_RECORD, ProtonPlusServicesCompatibilityProcessRecord);
	switch (property_id) {
		case PROTON_PLUS_SERVICES_COMPATIBILITY_PROCESS_RECORD_EXECUTABLE_PATH_PROPERTY:
		g_value_set_string (value, proton_plus_services_compatibility_process_record_get_executable_path (self));
		break;
		case PROTON_PLUS_SERVICES_COMPATIBILITY_PROCESS_RECORD_ARGV_PROPERTY:
		g_value_set_object (value, proton_plus_services_compatibility_process_record_get_argv (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_proton_plus_services_compatibility_process_record_set_property (GObject * object,
                                                                      guint property_id,
                                                                      const GValue * value,
                                                                      GParamSpec * pspec)
{
	ProtonPlusServicesCompatibilityProcessRecord * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PROTON_PLUS_SERVICES_TYPE_COMPATIBILITY_PROCESS_RECORD, ProtonPlusServicesCompatibilityProcessRecord);
	switch (property_id) {
		case PROTON_PLUS_SERVICES_COMPATIBILITY_PROCESS_RECORD_EXECUTABLE_PATH_PROPERTY:
		proton_plus_services_compatibility_process_record_set_executable_path (self, g_value_get_string (value));
		break;
		case PROTON_PLUS_SERVICES_COMPATIBILITY_PROCESS_RECORD_ARGV_PROPERTY:
		proton_plus_services_compatibility_process_record_set_argv (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

GeeList*
proton_plus_services_compatibility_process_query_backend_query_processes (ProtonPlusServicesCompatibilityProcessQueryBackend* self)
{
	ProtonPlusServicesCompatibilityProcessQueryBackendIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = PROTON_PLUS_SERVICES_COMPATIBILITY_PROCESS_QUERY_BACKEND_GET_INTERFACE (self);
	if (_iface_->query_processes) {
		return _iface_->query_processes (self);
	}
	return NULL;
}

static void
proton_plus_services_compatibility_process_query_backend_default_init (ProtonPlusServicesCompatibilityProcessQueryBackendIface * iface,
                                                                       gpointer iface_data)
{
}

static GType
proton_plus_services_compatibility_process_query_backend_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ProtonPlusServicesCompatibilityProcessQueryBackendIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) proton_plus_services_compatibility_process_query_backend_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	GType proton_plus_services_compatibility_process_query_backend_type_id;
	proton_plus_services_compatibility_process_query_backend_type_id = g_type_register_static (G_TYPE_INTERFACE, "ProtonPlusServicesCompatibilityProcessQueryBackend", &g_define_type_info, 0);
	g_type_interface_add_prerequisite (proton_plus_services_compatibility_process_query_backend_type_id, G_TYPE_OBJECT);
	return proton_plus_services_compatibility_process_query_backend_type_id;
}

GType
proton_plus_services_compatibility_process_query_backend_get_type (void)
{
	static volatile gsize proton_plus_services_compatibility_process_query_backend_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_services_compatibility_process_query_backend_type_id__once)) {
		GType proton_plus_services_compatibility_process_query_backend_type_id;
		proton_plus_services_compatibility_process_query_backend_type_id = proton_plus_services_compatibility_process_query_backend_get_type_once ();
		g_once_init_leave (&proton_plus_services_compatibility_process_query_backend_type_id__once, proton_plus_services_compatibility_process_query_backend_type_id);
	}
	return proton_plus_services_compatibility_process_query_backend_type_id__once;
}

static gunichar
string_get_char (const gchar* self,
                 glong index)
{
	gunichar result;
	g_return_val_if_fail (self != NULL, 0U);
	result = g_utf8_get_char (((gchar*) self) + index);
	return result;
}

static gchar*
string_replace (const gchar* self,
                const gchar* old,
                const gchar* replacement)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	GError* _inner_error0_ = NULL;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (old != NULL, NULL);
	g_return_val_if_fail (replacement != NULL, NULL);
	if ((*((gchar*) self)) == '\0') {
		_tmp1_ = TRUE;
	} else {
		_tmp1_ = (*((gchar*) old)) == '\0';
	}
	if (_tmp1_) {
		_tmp0_ = TRUE;
	} else {
		_tmp0_ = g_strcmp0 (old, replacement) == 0;
	}
	if (_tmp0_) {
		gchar* _tmp2_;
		_tmp2_ = g_strdup (self);
		result = _tmp2_;
		return result;
	}
	{
		GRegex* regex = NULL;
		gchar* _tmp3_;
		gchar* _tmp4_;
		GRegex* _tmp5_;
		GRegex* _tmp6_;
		gchar* _tmp7_ = NULL;
		GRegex* _tmp8_;
		gchar* _tmp9_;
		gchar* _tmp10_;
		_tmp3_ = g_regex_escape_string (old, -1);
		_tmp4_ = _tmp3_;
		_tmp5_ = g_regex_new (_tmp4_, 0, 0, &_inner_error0_);
		_tmp6_ = _tmp5_;
		_g_free0 (_tmp4_);
		regex = _tmp6_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			if (_inner_error0_->domain == G_REGEX_ERROR) {
				goto __catch0_g_regex_error;
			}
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
		_tmp8_ = regex;
		_tmp9_ = g_regex_replace_literal (_tmp8_, self, (gssize) -1, 0, replacement, 0, &_inner_error0_);
		_tmp7_ = _tmp9_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_regex_unref0 (regex);
			if (_inner_error0_->domain == G_REGEX_ERROR) {
				goto __catch0_g_regex_error;
			}
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
		_tmp10_ = _tmp7_;
		_tmp7_ = NULL;
		result = _tmp10_;
		_g_free0 (_tmp7_);
		_g_regex_unref0 (regex);
		return result;
	}
	goto __finally0;
	__catch0_g_regex_error:
	{
		g_clear_error (&_inner_error0_);
		g_assert_not_reached ();
	}
	__finally0:
	g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
	g_clear_error (&_inner_error0_);
	return NULL;
}

static GeeList*
proton_plus_services_host_compatibility_process_query_backend_real_query_processes (ProtonPlusServicesCompatibilityProcessQueryBackend* base)
{
	ProtonPlusServicesHostCompatibilityProcessQueryBackend * self;
	GeeArrayList* _result_ = NULL;
	GeeArrayList* _tmp0_;
	GError* _inner_error0_ = NULL;
	GeeList* result;
	self = (ProtonPlusServicesHostCompatibilityProcessQueryBackend*) base;
	_tmp0_ = gee_array_list_new (PROTON_PLUS_SERVICES_TYPE_COMPATIBILITY_PROCESS_RECORD, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	_result_ = _tmp0_;
	{
		GFileEnumerator* directory = NULL;
		GFile* _tmp1_;
		GFile* _tmp2_;
		GFileEnumerator* _tmp3_;
		GFileEnumerator* _tmp4_;
		GFileInfo* info = NULL;
		_tmp1_ = g_file_new_for_path ("/proc");
		_tmp2_ = _tmp1_;
		_tmp3_ = g_file_enumerate_children (_tmp2_, "standard::name", G_FILE_QUERY_INFO_NONE, NULL, &_inner_error0_);
		_tmp4_ = _tmp3_;
		_g_object_unref0 (_tmp2_);
		directory = _tmp4_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		while (TRUE) {
			GFileInfo* _tmp5_ = NULL;
			GFileEnumerator* _tmp6_;
			GFileInfo* _tmp7_;
			GFileInfo* _tmp8_;
			GFileInfo* _tmp9_;
			gchar* name = NULL;
			GFileInfo* _tmp10_;
			const gchar* _tmp11_;
			gchar* _tmp12_;
			gboolean _tmp13_ = FALSE;
			const gchar* _tmp14_;
			gint _tmp15_;
			gint _tmp16_;
			gchar* root = NULL;
			const gchar* _tmp18_;
			gchar* _tmp19_;
			gchar* executable = NULL;
			gchar* command_line = NULL;
			GeeArrayList* argv = NULL;
			GeeArrayList* _tmp31_;
			const gchar* _tmp32_;
			gchar* _tmp33_;
			gchar* _tmp34_;
			gchar** _tmp35_;
			gchar** _tmp36_;
			gchar** _tmp37_;
			gint _tmp37__length1;
			GeeArrayList* _tmp42_;
			const gchar* _tmp43_;
			GeeArrayList* _tmp44_;
			ProtonPlusServicesCompatibilityProcessRecord* _tmp45_;
			ProtonPlusServicesCompatibilityProcessRecord* _tmp46_;
			_tmp6_ = directory;
			_tmp7_ = g_file_enumerator_next_file (_tmp6_, NULL, &_inner_error0_);
			_tmp5_ = _tmp7_;
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				_g_object_unref0 (info);
				_g_object_unref0 (directory);
				goto __catch0_g_error;
			}
			_tmp8_ = _tmp5_;
			_tmp5_ = NULL;
			_g_object_unref0 (info);
			info = _tmp8_;
			_tmp9_ = info;
			if (!(_tmp9_ != NULL)) {
				_g_object_unref0 (_tmp5_);
				break;
			}
			_tmp10_ = info;
			_tmp11_ = g_file_info_get_name (_tmp10_);
			_tmp12_ = g_strdup (_tmp11_);
			name = _tmp12_;
			_tmp14_ = name;
			_tmp15_ = strlen (_tmp14_);
			_tmp16_ = _tmp15_;
			if (_tmp16_ == 0) {
				_tmp13_ = TRUE;
			} else {
				const gchar* _tmp17_;
				_tmp17_ = name;
				_tmp13_ = !g_unichar_isdigit (string_get_char (_tmp17_, (glong) 0));
			}
			if (_tmp13_) {
				_g_free0 (name);
				_g_object_unref0 (_tmp5_);
				continue;
			}
			_tmp18_ = name;
			_tmp19_ = g_strdup_printf ("/proc/%s", _tmp18_);
			root = _tmp19_;
			{
				gchar* _tmp20_ = NULL;
				const gchar* _tmp21_;
				gchar* _tmp22_;
				gchar* _tmp23_;
				gchar* _tmp24_;
				gchar* _tmp25_;
				gchar* _tmp26_;
				const gchar* _tmp27_;
				gchar* _tmp28_;
				gchar* _tmp29_;
				gchar* _tmp30_ = NULL;
				_tmp21_ = root;
				_tmp22_ = g_build_filename (_tmp21_, "exe", NULL);
				_tmp23_ = _tmp22_;
				_tmp24_ = g_file_read_link (_tmp23_, &_inner_error0_);
				_tmp25_ = _tmp24_;
				_g_free0 (_tmp23_);
				_tmp20_ = _tmp25_;
				if (G_UNLIKELY (_inner_error0_ != NULL)) {
					if (_inner_error0_->domain == G_FILE_ERROR) {
						goto __catch1_g_file_error;
					}
					_g_free0 (command_line);
					_g_free0 (executable);
					_g_free0 (root);
					_g_free0 (name);
					_g_object_unref0 (_tmp5_);
					_g_object_unref0 (info);
					_g_object_unref0 (directory);
					_g_object_unref0 (_result_);
					g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
					g_clear_error (&_inner_error0_);
					return NULL;
				}
				_tmp26_ = _tmp20_;
				_tmp20_ = NULL;
				_g_free0 (executable);
				executable = _tmp26_;
				_tmp27_ = root;
				_tmp28_ = g_build_filename (_tmp27_, "cmdline", NULL);
				_tmp29_ = _tmp28_;
				g_file_get_contents (_tmp29_, &_tmp30_, NULL, &_inner_error0_);
				_g_free0 (command_line);
				command_line = _tmp30_;
				_g_free0 (_tmp29_);
				if (G_UNLIKELY (_inner_error0_ != NULL)) {
					_g_free0 (_tmp20_);
					if (_inner_error0_->domain == G_FILE_ERROR) {
						goto __catch1_g_file_error;
					}
					_g_free0 (command_line);
					_g_free0 (executable);
					_g_free0 (root);
					_g_free0 (name);
					_g_object_unref0 (_tmp5_);
					_g_object_unref0 (info);
					_g_object_unref0 (directory);
					_g_object_unref0 (_result_);
					g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
					g_clear_error (&_inner_error0_);
					return NULL;
				}
				_g_free0 (_tmp20_);
			}
			goto __finally1;
			__catch1_g_file_error:
			{
				g_clear_error (&_inner_error0_);
				_g_free0 (command_line);
				_g_free0 (executable);
				_g_free0 (root);
				_g_free0 (name);
				_g_object_unref0 (_tmp5_);
				continue;
			}
			__finally1:
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				_g_free0 (command_line);
				_g_free0 (executable);
				_g_free0 (root);
				_g_free0 (name);
				_g_object_unref0 (_tmp5_);
				_g_object_unref0 (info);
				_g_object_unref0 (directory);
				goto __catch0_g_error;
			}
			_tmp31_ = gee_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, NULL, NULL, NULL);
			argv = _tmp31_;
			_tmp32_ = command_line;
			_tmp33_ = string_replace (_tmp32_, "\0", " ");
			_tmp34_ = _tmp33_;
			_tmp36_ = _tmp35_ = g_strsplit (_tmp34_, " ", 0);
			_tmp37_ = _tmp36_;
			_tmp37__length1 = _vala_array_length (_tmp35_);
			_g_free0 (_tmp34_);
			{
				gchar** value_collection = NULL;
				gint value_collection_length1 = 0;
				gint _value_collection_size_ = 0;
				gint value_it = 0;
				value_collection = _tmp37_;
				value_collection_length1 = _tmp37__length1;
				for (value_it = 0; value_it < value_collection_length1; value_it = value_it + 1) {
					gchar* _tmp38_;
					gchar* value = NULL;
					_tmp38_ = g_strdup (value_collection[value_it]);
					value = _tmp38_;
					{
						const gchar* _tmp39_;
						_tmp39_ = value;
						if (g_strcmp0 (_tmp39_, "") != 0) {
							GeeArrayList* _tmp40_;
							const gchar* _tmp41_;
							_tmp40_ = argv;
							_tmp41_ = value;
							gee_abstract_collection_add ((GeeAbstractCollection*) _tmp40_, _tmp41_);
						}
						_g_free0 (value);
					}
				}
				value_collection = (_vala_array_free (value_collection, value_collection_length1, (GDestroyNotify) g_free), NULL);
			}
			_tmp42_ = _result_;
			_tmp43_ = executable;
			_tmp44_ = argv;
			_tmp45_ = proton_plus_services_compatibility_process_record_new (_tmp43_, (GeeList*) _tmp44_);
			_tmp46_ = _tmp45_;
			gee_abstract_collection_add ((GeeAbstractCollection*) _tmp42_, _tmp46_);
			_g_object_unref0 (_tmp46_);
			_g_object_unref0 (argv);
			_g_free0 (command_line);
			_g_free0 (executable);
			_g_free0 (root);
			_g_free0 (name);
			_g_object_unref0 (_tmp5_);
		}
		_g_object_unref0 (info);
		_g_object_unref0 (directory);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp47_;
		const gchar* _tmp48_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp47_ = e;
		_tmp48_ = _tmp47_->message;
		g_warning ("compatibility-process-guard.vala:49: Unable to inspect compatibility p" \
"rocesses: %s", _tmp48_);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_object_unref0 (_result_);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return NULL;
	}
	result = (GeeList*) _result_;
	return result;
}

ProtonPlusServicesHostCompatibilityProcessQueryBackend*
proton_plus_services_host_compatibility_process_query_backend_construct (GType object_type)
{
	ProtonPlusServicesHostCompatibilityProcessQueryBackend * self = NULL;
	self = (ProtonPlusServicesHostCompatibilityProcessQueryBackend*) g_object_new (object_type, NULL);
	return self;
}

ProtonPlusServicesHostCompatibilityProcessQueryBackend*
proton_plus_services_host_compatibility_process_query_backend_new (void)
{
	return proton_plus_services_host_compatibility_process_query_backend_construct (PROTON_PLUS_SERVICES_TYPE_HOST_COMPATIBILITY_PROCESS_QUERY_BACKEND);
}

static void
proton_plus_services_host_compatibility_process_query_backend_class_init (ProtonPlusServicesHostCompatibilityProcessQueryBackendClass * klass,
                                                                          gpointer klass_data)
{
	proton_plus_services_host_compatibility_process_query_backend_parent_class = g_type_class_peek_parent (klass);
}

static void
proton_plus_services_host_compatibility_process_query_backend_proton_plus_services_compatibility_process_query_backend_interface_init (ProtonPlusServicesCompatibilityProcessQueryBackendIface * iface,
                                                                                                                                       gpointer iface_data)
{
	proton_plus_services_host_compatibility_process_query_backend_proton_plus_services_compatibility_process_query_backend_parent_iface = g_type_interface_peek_parent (iface);
	iface->query_processes = (GeeList* (*) (ProtonPlusServicesCompatibilityProcessQueryBackend*)) proton_plus_services_host_compatibility_process_query_backend_real_query_processes;
}

static void
proton_plus_services_host_compatibility_process_query_backend_instance_init (ProtonPlusServicesHostCompatibilityProcessQueryBackend * self,
                                                                             gpointer klass)
{
}

static GType
proton_plus_services_host_compatibility_process_query_backend_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ProtonPlusServicesHostCompatibilityProcessQueryBackendClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) proton_plus_services_host_compatibility_process_query_backend_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ProtonPlusServicesHostCompatibilityProcessQueryBackend), 0, (GInstanceInitFunc) proton_plus_services_host_compatibility_process_query_backend_instance_init, NULL };
	static const GInterfaceInfo proton_plus_services_compatibility_process_query_backend_info = { (GInterfaceInitFunc) proton_plus_services_host_compatibility_process_query_backend_proton_plus_services_compatibility_process_query_backend_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType proton_plus_services_host_compatibility_process_query_backend_type_id;
	proton_plus_services_host_compatibility_process_query_backend_type_id = g_type_register_static (G_TYPE_OBJECT, "ProtonPlusServicesHostCompatibilityProcessQueryBackend", &g_define_type_info, 0);
	g_type_add_interface_static (proton_plus_services_host_compatibility_process_query_backend_type_id, PROTON_PLUS_SERVICES_TYPE_COMPATIBILITY_PROCESS_QUERY_BACKEND, &proton_plus_services_compatibility_process_query_backend_info);
	return proton_plus_services_host_compatibility_process_query_backend_type_id;
}

GType
proton_plus_services_host_compatibility_process_query_backend_get_type (void)
{
	static volatile gsize proton_plus_services_host_compatibility_process_query_backend_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_services_host_compatibility_process_query_backend_type_id__once)) {
		GType proton_plus_services_host_compatibility_process_query_backend_type_id;
		proton_plus_services_host_compatibility_process_query_backend_type_id = proton_plus_services_host_compatibility_process_query_backend_get_type_once ();
		g_once_init_leave (&proton_plus_services_host_compatibility_process_query_backend_type_id__once, proton_plus_services_host_compatibility_process_query_backend_type_id);
	}
	return proton_plus_services_host_compatibility_process_query_backend_type_id__once;
}

static inline gpointer
proton_plus_services_compatibility_process_guard_get_instance_private (ProtonPlusServicesCompatibilityProcessGuard* self)
{
	return G_STRUCT_MEMBER_P (self, ProtonPlusServicesCompatibilityProcessGuard_private_offset);
}

ProtonPlusServicesCompatibilityProcessGuard*
proton_plus_services_compatibility_process_guard_construct (GType object_type,
                                                            ProtonPlusServicesCompatibilityProcessQueryBackend* backend)
{
	ProtonPlusServicesCompatibilityProcessGuard * self = NULL;
	ProtonPlusServicesCompatibilityProcessQueryBackend* _tmp0_ = NULL;
	ProtonPlusServicesCompatibilityProcessQueryBackend* _tmp1_;
	ProtonPlusServicesCompatibilityProcessQueryBackend* _tmp3_;
	self = (ProtonPlusServicesCompatibilityProcessGuard*) g_object_new (object_type, NULL);
	_tmp1_ = _g_object_ref0 (backend);
	_tmp0_ = _tmp1_;
	if (_tmp0_ == NULL) {
		ProtonPlusServicesHostCompatibilityProcessQueryBackend* _tmp2_;
		_tmp2_ = proton_plus_services_host_compatibility_process_query_backend_new ();
		_g_object_unref0 (_tmp0_);
		_tmp0_ = (ProtonPlusServicesCompatibilityProcessQueryBackend*) _tmp2_;
	}
	_tmp3_ = _tmp0_;
	_tmp0_ = NULL;
	_g_object_unref0 (self->priv->backend);
	self->priv->backend = _tmp3_;
	_g_object_unref0 (_tmp0_);
	return self;
}

ProtonPlusServicesCompatibilityProcessGuard*
proton_plus_services_compatibility_process_guard_new (ProtonPlusServicesCompatibilityProcessQueryBackend* backend)
{
	return proton_plus_services_compatibility_process_guard_construct (PROTON_PLUS_SERVICES_TYPE_COMPATIBILITY_PROCESS_GUARD, backend);
}

ProtonPlusReturnCode
proton_plus_services_compatibility_process_guard_check (ProtonPlusServicesCompatibilityProcessGuard* self)
{
	ProtonPlusReturnCode _tmp0_ = 0;
	ProtonPlusReturnCode result;
	g_return_val_if_fail (self != NULL, 0);
	if (proton_plus_services_compatibility_process_guard_has_active_processes (self)) {
		_tmp0_ = PROTON_PLUS_RETURN_CODE_RUNNERS_IN_USE;
	} else {
		_tmp0_ = PROTON_PLUS_RETURN_CODE_RUNNER_INSTALLED;
	}
	result = _tmp0_;
	return result;
}

gboolean
proton_plus_services_compatibility_process_guard_has_active_processes (ProtonPlusServicesCompatibilityProcessGuard* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	{
		GeeList* _process_list = NULL;
		ProtonPlusServicesCompatibilityProcessQueryBackend* _tmp0_;
		GeeList* _tmp1_;
		gint _process_size = 0;
		GeeList* _tmp2_;
		gint _tmp3_;
		gint _tmp4_;
		gint _process_index = 0;
		_tmp0_ = self->priv->backend;
		_tmp1_ = proton_plus_services_compatibility_process_query_backend_query_processes (_tmp0_);
		_process_list = _tmp1_;
		_tmp2_ = _process_list;
		_tmp3_ = gee_collection_get_size ((GeeCollection*) _tmp2_);
		_tmp4_ = _tmp3_;
		_process_size = _tmp4_;
		_process_index = -1;
		while (TRUE) {
			gint _tmp5_;
			gint _tmp6_;
			ProtonPlusServicesCompatibilityProcessRecord* process = NULL;
			GeeList* _tmp7_;
			gpointer _tmp8_;
			ProtonPlusServicesCompatibilityProcessRecord* _tmp9_;
			const gchar* _tmp10_;
			const gchar* _tmp11_;
			_process_index = _process_index + 1;
			_tmp5_ = _process_index;
			_tmp6_ = _process_size;
			if (!(_tmp5_ < _tmp6_)) {
				break;
			}
			_tmp7_ = _process_list;
			_tmp8_ = gee_list_get (_tmp7_, _process_index);
			process = (ProtonPlusServicesCompatibilityProcessRecord*) _tmp8_;
			_tmp9_ = process;
			_tmp10_ = proton_plus_services_compatibility_process_record_get_executable_path (_tmp9_);
			_tmp11_ = _tmp10_;
			if (proton_plus_services_compatibility_process_guard_is_compatibility_token (self, _tmp11_)) {
				result = TRUE;
				_g_object_unref0 (process);
				_g_object_unref0 (_process_list);
				return result;
			}
			{
				GeeList* _argument_list = NULL;
				ProtonPlusServicesCompatibilityProcessRecord* _tmp12_;
				GeeList* _tmp13_;
				GeeList* _tmp14_;
				gint _argument_size = 0;
				GeeList* _tmp15_;
				gint _tmp16_;
				gint _tmp17_;
				gint _argument_index = 0;
				_tmp12_ = process;
				_tmp13_ = proton_plus_services_compatibility_process_record_get_argv (_tmp12_);
				_tmp14_ = _tmp13_;
				_argument_list = _tmp14_;
				_tmp15_ = _argument_list;
				_tmp16_ = gee_collection_get_size ((GeeCollection*) _tmp15_);
				_tmp17_ = _tmp16_;
				_argument_size = _tmp17_;
				_argument_index = -1;
				while (TRUE) {
					gint _tmp18_;
					gint _tmp19_;
					gchar* argument = NULL;
					GeeList* _tmp20_;
					gpointer _tmp21_;
					const gchar* _tmp22_;
					_argument_index = _argument_index + 1;
					_tmp18_ = _argument_index;
					_tmp19_ = _argument_size;
					if (!(_tmp18_ < _tmp19_)) {
						break;
					}
					_tmp20_ = _argument_list;
					_tmp21_ = gee_list_get (_tmp20_, _argument_index);
					argument = (gchar*) _tmp21_;
					_tmp22_ = argument;
					if (proton_plus_services_compatibility_process_guard_is_compatibility_token (self, _tmp22_)) {
						result = TRUE;
						_g_free0 (argument);
						_g_object_unref0 (process);
						_g_object_unref0 (_process_list);
						return result;
					}
					_g_free0 (argument);
				}
			}
			_g_object_unref0 (process);
		}
		_g_object_unref0 (_process_list);
	}
	result = FALSE;
	return result;
}

static gboolean
proton_plus_services_compatibility_process_guard_is_compatibility_token (ProtonPlusServicesCompatibilityProcessGuard* self,
                                                                         const gchar* value)
{
	gchar* basename = NULL;
	gchar* _tmp0_;
	gboolean _tmp6_ = FALSE;
	GError* _inner_error0_ = NULL;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (value != NULL, FALSE);
	_tmp0_ = g_path_get_basename (value);
	basename = _tmp0_;
	{
		GRegex* _tmp1_ = NULL;
		GRegex* _tmp2_;
		_tmp2_ = g_regex_new ("^(?:proton(?:[-_][^/[:space:]]*)?|umu(?:[-_][^/[:space:]]*)?|wine(?:64" \
")?(?:[-_][^/[:space:]]*)?|[^/[:space:]]+\\.exe)$", 0, 0, &_inner_error0_);
		_tmp1_ = _tmp2_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			gboolean _tmp3_ = FALSE;
			if (_inner_error0_->domain == G_REGEX_ERROR) {
				goto __catch0_g_regex_error;
			}
			_g_free0 (basename);
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return _tmp3_;
		}
		result = g_regex_match (_tmp1_, basename, 0, NULL);
		_g_regex_unref0 (_tmp1_);
		_g_free0 (basename);
		return result;
	}
	goto __finally0;
	__catch0_g_regex_error:
	{
		GError* e = NULL;
		GError* _tmp4_;
		const gchar* _tmp5_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp4_ = e;
		_tmp5_ = _tmp4_->message;
		g_warning ("compatibility-process-guard.vala:87: %s", _tmp5_);
		result = FALSE;
		_g_error_free0 (e);
		_g_free0 (basename);
		return result;
	}
	__finally0:
	_g_free0 (basename);
	g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
	g_clear_error (&_inner_error0_);
	return _tmp6_;
}

static void
proton_plus_services_compatibility_process_guard_class_init (ProtonPlusServicesCompatibilityProcessGuardClass * klass,
                                                             gpointer klass_data)
{
	proton_plus_services_compatibility_process_guard_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ProtonPlusServicesCompatibilityProcessGuard_private_offset);
	G_OBJECT_CLASS (klass)->finalize = proton_plus_services_compatibility_process_guard_finalize;
}

static void
proton_plus_services_compatibility_process_guard_instance_init (ProtonPlusServicesCompatibilityProcessGuard * self,
                                                                gpointer klass)
{
	self->priv = proton_plus_services_compatibility_process_guard_get_instance_private (self);
}

static void
proton_plus_services_compatibility_process_guard_finalize (GObject * obj)
{
	ProtonPlusServicesCompatibilityProcessGuard * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PROTON_PLUS_SERVICES_TYPE_COMPATIBILITY_PROCESS_GUARD, ProtonPlusServicesCompatibilityProcessGuard);
	_g_object_unref0 (self->priv->backend);
	G_OBJECT_CLASS (proton_plus_services_compatibility_process_guard_parent_class)->finalize (obj);
}

static GType
proton_plus_services_compatibility_process_guard_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ProtonPlusServicesCompatibilityProcessGuardClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) proton_plus_services_compatibility_process_guard_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ProtonPlusServicesCompatibilityProcessGuard), 0, (GInstanceInitFunc) proton_plus_services_compatibility_process_guard_instance_init, NULL };
	GType proton_plus_services_compatibility_process_guard_type_id;
	proton_plus_services_compatibility_process_guard_type_id = g_type_register_static (G_TYPE_OBJECT, "ProtonPlusServicesCompatibilityProcessGuard", &g_define_type_info, 0);
	ProtonPlusServicesCompatibilityProcessGuard_private_offset = g_type_add_instance_private (proton_plus_services_compatibility_process_guard_type_id, sizeof (ProtonPlusServicesCompatibilityProcessGuardPrivate));
	return proton_plus_services_compatibility_process_guard_type_id;
}

GType
proton_plus_services_compatibility_process_guard_get_type (void)
{
	static volatile gsize proton_plus_services_compatibility_process_guard_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_services_compatibility_process_guard_type_id__once)) {
		GType proton_plus_services_compatibility_process_guard_type_id;
		proton_plus_services_compatibility_process_guard_type_id = proton_plus_services_compatibility_process_guard_get_type_once ();
		g_once_init_leave (&proton_plus_services_compatibility_process_guard_type_id__once, proton_plus_services_compatibility_process_guard_type_id);
	}
	return proton_plus_services_compatibility_process_guard_type_id__once;
}

static void
_vala_array_destroy (gpointer array,
                     gssize array_length,
                     GDestroyNotify destroy_func)
{
	if ((array != NULL) && (destroy_func != NULL)) {
		gssize i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}

static void
_vala_array_free (gpointer array,
                  gssize array_length,
                  GDestroyNotify destroy_func)
{
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}

static gssize
_vala_array_length (gpointer array)
{
	gssize length;
	length = 0;
	if (array) {
		while (((gpointer*) array)[length]) {
			length++;
		}
	}
	return length;
}

static inline gpointer
_vala_memdup2 (gconstpointer mem,
               gsize byte_size)
{
	gpointer new_mem;
	if (mem && byte_size != 0) {
		new_mem = g_malloc (byte_size);
		memcpy (new_mem, mem, byte_size);
	} else {
		new_mem = NULL;
	}
	return new_mem;
}

