/* monitor.c generated by valac 0.56.18-dirty, the Vala compiler
 * generated from monitor.vala, do not modify */

/* monitor.vala
 *
 * Copyright (C) 2017 Red Hat, Inc.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * Authors: Petr Štětka <pstetka@redhat.com>
 */

#include <glib-object.h>
#include <glib.h>
#include <string.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
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

#define USAGE_TYPE_MONITOR (usage_monitor_get_type ())
#define USAGE_MONITOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), USAGE_TYPE_MONITOR, UsageMonitor))
#define USAGE_IS_MONITOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), USAGE_TYPE_MONITOR))
#define USAGE_MONITOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), USAGE_TYPE_MONITOR, UsageMonitorIface))

typedef struct _UsageMonitor UsageMonitor;
typedef struct _UsageMonitorIface UsageMonitorIface;

#define USAGE_TYPE_PROCESS (usage_process_get_type ())
#define USAGE_PROCESS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), USAGE_TYPE_PROCESS, UsageProcess))
#define USAGE_PROCESS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), USAGE_TYPE_PROCESS, UsageProcessClass))
#define USAGE_IS_PROCESS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), USAGE_TYPE_PROCESS))
#define USAGE_IS_PROCESS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), USAGE_TYPE_PROCESS))
#define USAGE_PROCESS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), USAGE_TYPE_PROCESS, UsageProcessClass))

typedef struct _UsageProcess UsageProcess;
typedef struct _UsageProcessClass UsageProcessClass;

struct _UsageMonitorIface {
	GTypeInterface parent_iface;
	void (*update) (UsageMonitor* self);
	void (*update_process) (UsageMonitor* self, UsageProcess** process);
};

VALA_EXTERN GType usage_process_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (UsageProcess, g_object_unref)
VALA_EXTERN GType usage_monitor_get_type (void) G_GNUC_CONST ;
VALA_EXTERN void usage_monitor_update (UsageMonitor* self);
VALA_EXTERN void usage_monitor_update_process (UsageMonitor* self,
                                   UsageProcess** process);
static GType usage_monitor_get_type_once (void);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

void
usage_monitor_update (UsageMonitor* self)
{
	UsageMonitorIface* _iface_;
	g_return_if_fail (self != NULL);
	_iface_ = USAGE_MONITOR_GET_INTERFACE (self);
	if (_iface_->update) {
		_iface_->update (self);
	}
}

void
usage_monitor_update_process (UsageMonitor* self,
                              UsageProcess** process)
{
	UsageMonitorIface* _iface_;
	g_return_if_fail (self != NULL);
	_iface_ = USAGE_MONITOR_GET_INTERFACE (self);
	if (_iface_->update_process) {
		_iface_->update_process (self, process);
	}
}

static void
usage_monitor_default_init (UsageMonitorIface * iface,
                            gpointer iface_data)
{
}

static GType
usage_monitor_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (UsageMonitorIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) usage_monitor_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	GType usage_monitor_type_id;
	usage_monitor_type_id = g_type_register_static (G_TYPE_INTERFACE, "UsageMonitor", &g_define_type_info, 0);
	return usage_monitor_type_id;
}

GType
usage_monitor_get_type (void)
{
	static volatile gsize usage_monitor_type_id__once = 0;
	if (g_once_init_enter (&usage_monitor_type_id__once)) {
		GType usage_monitor_type_id;
		usage_monitor_type_id = usage_monitor_get_type_once ();
		g_once_init_leave (&usage_monitor_type_id__once, usage_monitor_type_id);
	}
	return usage_monitor_type_id__once;
}

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;
}

