aboutsummaryrefslogtreecommitdiffstats
path: root/util/alevt/export.h
diff options
context:
space:
mode:
authorMark Purcell <msp@debian.org>2010-02-25 21:13:46 +1100
committeretobi <git@e-tobi.net>2013-09-03 09:48:46 +0200
commit665818f1969f893f05edf5b70eb1804c89b2829e (patch)
tree34ba68cee03c52d769a5a51b456b7e9d63cd091a /util/alevt/export.h
parent109c7947d6a11a2a54eff1b19615ed80ea2f0602 (diff)
parent9fe4d4ea9c054e539ab679ed2e9c076c35beb69d (diff)
downloadlinux-dvb-apps-debian/1.1.1+rev1355-1.tar.gz
Imported Debian patch 1.1.1+rev1355-1debian/1.1.1+rev1355-1
Diffstat (limited to '')
-rw-r--r--util/alevt/export.h66
1 files changed, 66 insertions, 0 deletions
diff --git a/util/alevt/export.h b/util/alevt/export.h
new file mode 100644
index 0000000..a08875c
--- /dev/null
+++ b/util/alevt/export.h
@@ -0,0 +1,66 @@
+#ifndef EXPORT_H
+#define EXPORT_H
+
+#include "vt.h"
+#include "misc.h"
+
+
+struct fmt_char
+{
+ u8 ch, fg, bg, attr;
+};
+
+#define EA_DOUBLE 1 // double height char
+#define EA_HDOUBLE 2 // single height char in double height line
+#define EA_BLINK 4 // blink
+#define EA_CONCEALED 8 // concealed
+#define EA_GRAPHIC 16 // graphic symbol
+#define EA_SEPARATED 32 // use separated graphic symbol
+
+#define E_DEF_FG 7
+#define E_DEF_BG 0
+#define E_DEF_ATTR 0
+
+
+struct fmt_page
+{
+ struct vt_page *vtp;
+ u32 dbl, hid;
+ struct fmt_char data[H][W];
+};
+
+
+struct export
+{
+ struct export_module *mod; // module type
+ char *fmt_str; // saved option string (splitted)
+ // global options
+ int reveal; // reveal hidden chars
+ // local data for module's use. initialized to 0.
+ struct { int dummy; } data[0];
+};
+
+
+struct export_module
+{
+ char *fmt_name; // the format type name (ASCII/HTML/PNG/...)
+ char *extension; // the default file name extension
+ char **options; // module options
+ int local_size;
+ int (*open)(struct export *fmt);
+ void (*close)(struct export *fmt);
+ int (*option)(struct export *fmt, int opt, char *arg);
+ int (*output)(struct export *fmt, char *name, struct fmt_page *pg);
+};
+
+
+extern struct export_module *modules[]; // list of modules (for help msgs)
+void export_error(char *str, ...); // set error
+char *export_errstr(void); // return last error
+char *export_mkname(struct export *e, char *fmt, struct vt_page *vtp, char *usr);
+
+
+struct export *export_open(char *fmt);
+void export_close(struct export *e);
+int export(struct export *e, struct vt_page *vtp, char *user_str);
+#endif