aboutsummaryrefslogtreecommitdiffstats
path: root/src/crt.h
diff options
context:
space:
mode:
authorjames <>2008-02-03 23:31:25 +0000
committerjames <>2008-02-03 23:31:25 +0000
commit148184f54c08d931007fc31cfd26ac88cc86e493 (patch)
tree4fcbc6fc7b58aca6bad6365c8526337e327e5a20 /src/crt.h
parent4163308ecae26c76d22e4cc80d8bae729b06b94f (diff)
downloadsympathy-148184f54c08d931007fc31cfd26ac88cc86e493.tar.gz
sympathy-148184f54c08d931007fc31cfd26ac88cc86e493.tar.bz2
sympathy-148184f54c08d931007fc31cfd26ac88cc86e493.zip
*** empty log message ***
Diffstat (limited to 'src/crt.h')
-rw-r--r--src/crt.h58
1 files changed, 58 insertions, 0 deletions
diff --git a/src/crt.h b/src/crt.h
new file mode 100644
index 0000000..a46affa
--- /dev/null
+++ b/src/crt.h
@@ -0,0 +1,58 @@
+/*
+ * crt.h:
+ *
+ * Copyright (c) 2008 James McKenzie <james@fishsoup.dhs.org>,
+ * All rights reserved.
+ *
+ */
+
+/*
+ * $Id$
+ */
+
+/*
+ * $Log$
+ * Revision 1.1 2008/02/03 23:31:25 james
+ * *** empty log message ***
+ *
+ */
+
+#ifndef __CRT_H__
+#define __CRT_H__
+
+#define CRT_ROWS 25
+#define CRT_COLS 80
+
+#define CRT_CELS (CRT_ROWS*CRT_COLS)
+#define CRT_ADDR(r,c) (((r)*CRT_ROWS)+(c))
+#define CRT_ADDR_POS(p) ((((p)->y)*CRT_ROWS)+((p)->x))
+
+#define CRT_ATTR_NORMAL 0x0
+#define CRT_ATTR_UNDERLINE 0x1
+#define CRT_ATTR_REVERSE 0x2
+#define CRT_ATTR_BLINK 0x4
+#define CRT_ATTR_BOLD 0x8
+
+typedef struct {
+ uint8_t chr;
+ uint8_t attr;
+} CRT_CA;
+
+typedef struct {
+ int x;
+ int y;
+} CRT_Pos;
+
+
+typedef struct {
+ CRT_CA screen[CRT_CELS];
+ CRT_Pos pos;
+ int hide_cursor;
+} CRT;
+
+
+static inline crt_ca_cmp(CRT_CA a,CRT_CA b) {
+ return memcmp(&a,&b,sizeof(a));
+}
+
+#endif /* __CRT_H__ */