summaryrefslogtreecommitdiffstats
path: root/src/ck-log-event.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/ck-log-event.h')
-rw-r--r--src/ck-log-event.h131
1 files changed, 131 insertions, 0 deletions
diff --git a/src/ck-log-event.h b/src/ck-log-event.h
new file mode 100644
index 0000000..f5defed
--- /dev/null
+++ b/src/ck-log-event.h
@@ -0,0 +1,131 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
+ *
+ * Copyright (C) 2007 William Jon McCann <mccann@jhu.edu>
+ *
+ * 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 2 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ */
+
+#ifndef __CK_LOG_EVENT_H
+#define __CK_LOG_EVENT_H
+
+#include <glib.h>
+
+G_BEGIN_DECLS
+
+typedef enum
+{
+ CK_LOG_EVENT_START = 0,
+ CK_LOG_EVENT_STOP,
+ CK_LOG_EVENT_SYSTEM_SHUTDOWN,
+ CK_LOG_EVENT_SYSTEM_RUNLEVEL_CHANGED,
+ CK_LOG_EVENT_SEAT_ADDED,
+ CK_LOG_EVENT_SEAT_REMOVED,
+ CK_LOG_EVENT_SEAT_SESSION_ADDED,
+ CK_LOG_EVENT_SEAT_SESSION_REMOVED,
+ CK_LOG_EVENT_SEAT_DEVICE_ADDED,
+ CK_LOG_EVENT_SEAT_DEVICE_REMOVED,
+ CK_LOG_EVENT_SEAT_ACTIVE_SESSION_CHANGED,
+} CkLogEventType;
+
+typedef struct
+{
+ char *seat_id;
+ int seat_kind;
+} CkLogSeatAddedEvent;
+
+typedef struct
+{
+ char *seat_id;
+ int seat_kind;
+} CkLogSeatRemovedEvent;
+
+typedef struct
+{
+ char *seat_id;
+ char *session_id;
+ char *session_type;
+ char *session_x11_display;
+ char *session_x11_display_device;
+ char *session_display_device;
+ char *session_remote_host_name;
+ gboolean session_is_local;
+ guint session_unix_user;
+ char *session_creation_time;
+} CkLogSeatSessionAddedEvent;
+
+typedef struct
+{
+ char *seat_id;
+ char *session_id;
+ char *session_type;
+ char *session_x11_display;
+ char *session_x11_display_device;
+ char *session_display_device;
+ char *session_remote_host_name;
+ gboolean session_is_local;
+ guint session_unix_user;
+ char *session_creation_time;
+} CkLogSeatSessionRemovedEvent;
+
+typedef struct
+{
+ char *seat_id;
+ char *session_id;
+} CkLogSeatActiveSessionChangedEvent;
+
+typedef struct
+{
+ char *seat_id;
+ char *device_type;
+ char *device_id;
+} CkLogSeatDeviceAddedEvent;
+
+typedef struct
+{
+ char *seat_id;
+ char *device_type;
+ char *device_id;
+} CkLogSeatDeviceRemovedEvent;
+
+typedef struct
+{
+ union {
+ CkLogSeatAddedEvent seat_added;
+ CkLogSeatRemovedEvent seat_removed;
+ CkLogSeatSessionAddedEvent seat_session_added;
+ CkLogSeatSessionRemovedEvent seat_session_removed;
+ CkLogSeatActiveSessionChangedEvent seat_active_session_changed;
+ CkLogSeatDeviceAddedEvent seat_device_added;
+ CkLogSeatDeviceRemovedEvent seat_device_removed;
+ } event;
+
+ GTimeVal timestamp;
+ CkLogEventType type;
+} CkLogEvent;
+
+CkLogEvent * ck_log_event_copy (CkLogEvent *event);
+void ck_log_event_free (CkLogEvent *event);
+
+CkLogEvent * ck_log_event_new_from_string (const GString *str);
+gboolean ck_log_event_fill_from_string (CkLogEvent *event,
+ const GString *str);
+
+void ck_log_event_to_string (CkLogEvent *event,
+ GString *str);
+
+G_END_DECLS
+
+#endif /* __CK_LOG_EVENT_H */