aboutsummaryrefslogtreecommitdiff
path: root/src/IO/iowatch.cc
diff options
context:
space:
mode:
authorjcid <devnull@localhost>2007-10-07 00:36:34 +0200
committerjcid <devnull@localhost>2007-10-07 00:36:34 +0200
commit93715c46a99c96d6c866968312691ec9ab0f6a03 (patch)
tree573f19ec6aa740844f53a7c0eb7114f04096bf64 /src/IO/iowatch.cc
Initial revision
Diffstat (limited to 'src/IO/iowatch.cc')
-rw-r--r--src/IO/iowatch.cc35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/IO/iowatch.cc b/src/IO/iowatch.cc
new file mode 100644
index 00000000..2c1465ba
--- /dev/null
+++ b/src/IO/iowatch.cc
@@ -0,0 +1,35 @@
+/*
+ * File: iowatch.cc
+ *
+ * Copyright (C) 2005 Jorge Arellano Cid <jcid@dillo.org>
+ *
+ * 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.
+ */
+
+// Simple ADT for watching file descriptor activity
+
+#include <fltk/run.h>
+#include "iowatch.hh"
+
+using namespace fltk;
+
+
+//
+// Hook a Callback for a certain activities in a FD
+//
+void a_IOwatch_add_fd(int fd, int when, FileHandler Callback, void *usr_data=0)
+{
+ add_fd(fd, when, Callback, usr_data);
+}
+
+//
+// Remove a Callback for a given FD (or just remove some events)
+//
+void a_IOwatch_remove_fd(int fd, int when)
+{
+ remove_fd(fd, when);
+}
+