Facility for custom event handler
diff --git a/proc.c b/proc.c
index fae6595..87b5a89 100644
--- a/proc.c
+++ b/proc.c
@@ -215,3 +215,20 @@
tmp = tmp->next;
}
}
+
+void
+install_event_handler(Process * proc, Event_Handler * handler)
+{
+ assert(proc->event_handler == NULL);
+ proc->event_handler = handler;
+}
+
+void
+destroy_event_handler(Process * proc)
+{
+ Event_Handler * handler = proc->event_handler;
+ assert(handler != NULL);
+ handler->destroy(handler);
+ free(handler);
+ proc->event_handler = NULL;
+}