summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Marc Horowitz <marc@mit.edu>1989-11-13 19:55:48 +0000
committerGravatar Marc Horowitz <marc@mit.edu>1989-11-13 19:55:48 +0000
commit0746b026f03939800e25e1f5d00810a165afe72d (patch)
tree9845c7d2d5cdcce2efd62b53ebbbf7dda38cedf8
parent05bb0c93268b1cc3d18dcbb2757412197983f0a3 (diff)
Initial revision
-rw-r--r--zwgc/xerror.c47
-rw-r--r--zwgc/xerror.h29
-rw-r--r--zwgc/xrevstack.h32
3 files changed, 108 insertions, 0 deletions
diff --git a/zwgc/xerror.c b/zwgc/xerror.c
new file mode 100644
index 0000000..974d2c8
--- /dev/null
+++ b/zwgc/xerror.c
@@ -0,0 +1,47 @@
+/* This file is part of the Project Athena Zephyr Notification System.
+ * It is one of the source files comprising zwgc, the Zephyr WindowGram
+ * client.
+ *
+ * Created by: Marc Horowitz <marc@athena.mit.edu>
+ *
+ * $Source$
+ * $Author$
+ *
+ * Copyright (c) 1989 by the Massachusetts Institute of Technology.
+ * For copying and distribution information, see the file
+ * "mit-copyright.h".
+ */
+
+#if (!defined(lint) && !defined(SABER))
+static char rcsid_xerror_c[] = "$Id$";
+#endif
+
+#include <zephyr/mit-copyright.h>
+
+#include <X11/Xlib.h>
+#include <stdio.h>
+#include "mux.h"
+
+int xerror_happened;
+
+/*ARGSUSED*/
+static int xerrortrap(dpy,xerrev)
+ Display *dpy;
+ XErrorEvent *xerrev;
+{
+ xerror_happened = 1;
+}
+
+void begin_xerror_trap(dpy)
+ Display *dpy;
+{
+ xerror_happened = 0;
+ XSetErrorHandler(xerrortrap);
+}
+
+void end_xerror_trap(dpy)
+ Display *dpy;
+{
+ XSync(dpy,False);
+ XSetErrorHandler(NULL);
+}
diff --git a/zwgc/xerror.h b/zwgc/xerror.h
new file mode 100644
index 0000000..0e17936
--- /dev/null
+++ b/zwgc/xerror.h
@@ -0,0 +1,29 @@
+/* This file is part of the Project Athena Zephyr Notification System.
+ * It is one of the source files comprising zwgc, the Zephyr WindowGram
+ * client.
+ *
+ * Created by: Marc Horowitz <marc@athena.mit.edu>
+ *
+ * $Source$
+ * $Author$
+ *
+ * Copyright (c) 1989 by the Massachusetts Institute of Technology.
+ * For copying and distribution information, see the file
+ * "mit-copyright.h".
+ */
+
+#ifndef _XERROR_H_
+#define _XERROR_H_
+
+#if (!defined(lint) && !defined(SABER))
+static char rcsid_xerror_h[] = "$Id$";
+#endif
+
+#include <zephyr/mit-copyright.h>
+
+extern int xerror_happened;
+
+void begin_xerror_trap();
+void end_xerror_trap();
+
+#endif
diff --git a/zwgc/xrevstack.h b/zwgc/xrevstack.h
new file mode 100644
index 0000000..24eaf77
--- /dev/null
+++ b/zwgc/xrevstack.h
@@ -0,0 +1,32 @@
+/* This file is part of the Project Athena Zephyr Notification System.
+ * It is one of the source files comprising zwgc, the Zephyr WindowGram
+ * client.
+ *
+ * Created by: Marc Horowitz <marc@athena.mit.edu>
+ *
+ * $Source$
+ * $Author$
+ *
+ * Copyright (c) 1989 by the Massachusetts Institute of Technology.
+ * For copying and distribution information, see the file
+ * "mit-copyright.h".
+ */
+
+#ifndef _XREVSTACK_H_
+#define _XREVSTACK_H_
+
+#if (!defined(lint) && !defined(SABER))
+static char rcsid_xrevstack_h[] = "$Id$";
+#endif
+
+#include <zephyr/mit-copyright.h>
+
+extern x_gram *bottom_gram; /* for testing against NULL */
+extern int reverse_stack; /* is reverse stack on? */
+
+void add_to_bottom(/* x_gram */);
+void delete_from_list(/* x_gram */);
+void pull_to_top(/* x_gram */);
+void push_to_bottom(/* x_gram */);
+
+#endif /* _XREVSTACK_H_ */