aboutsummaryrefslogtreecommitdiffstats
path: root/util/alevt/export.h
diff options
context:
space:
mode:
authoretobi <git@e-tobi.net>2013-09-03 09:48:45 +0200
committeretobi <git@e-tobi.net>2013-09-03 09:48:45 +0200
commit9fe4d4ea9c054e539ab679ed2e9c076c35beb69d (patch)
treeaffff927f15c8ae6c77890cc9564855efe2e51db /util/alevt/export.h
parent9a5228e0f2b898367b7943d294be58caf6ce8bb3 (diff)
downloadlinux-dvb-apps-f2eab897879af84e80fd837bb71b6fa6f87a7508.tar.gz
Imported Upstream version 1.1.1+rev1355upstream/1.1.1+rev1355
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