aboutsummaryrefslogtreecommitdiffstats
path: root/common.h
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2021-08-17 17:44:35 +0200
committerMattias Andrée <maandree@kth.se>2021-08-17 17:44:35 +0200
commit6b8fc61b772b394d7a205531b492101c519dc47d (patch)
tree85d441e2de4d57e9432a5d0173aa48c214ebb39c /common.h
parentm (diff)
downloadlibskrift-6b8fc61b772b394d7a205531b492101c519dc47d.tar.gz
libskrift-6b8fc61b772b394d7a205531b492101c519dc47d.tar.bz2
libskrift-6b8fc61b772b394d7a205531b492101c519dc47d.tar.xz
Add support for gzip compression and prepare for PSF support
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'common.h')
-rw-r--r--common.h25
1 files changed, 19 insertions, 6 deletions
diff --git a/common.h b/common.h
index d8c4a56..e643477 100644
--- a/common.h
+++ b/common.h
@@ -2,11 +2,14 @@
#include <sys/mman.h>
#include <sys/stat.h>
+#include <sys/wait.h>
#include <alloca.h>
#include <endian.h>
#include <errno.h>
#include <fcntl.h>
#include <math.h>
+#include <poll.h>
+#include <signal.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
@@ -17,17 +20,25 @@
#define MIN(A, B) ((A) < (B) ? (A) : (B))
#define MAX(A, B) ((A) > (B) ? (A) : (B))
-#define LEN(ARR) (sizeof(ARR) / sizeof(*(ARR)))
+#define ELEMSOF(ARR) (sizeof(ARR) / sizeof(*(ARR)))
#define FLEXSTRUCTSIZE(STRUCT, FLEXARRAY, FLEXARRAY_LENGTH)\
(offsetof(STRUCT, FLEXARRAY) + (FLEXARRAY_LENGTH) * sizeof(*((STRUCT *)NULL)->FLEXARRAY))
+enum font_type {
+ FONT_TYPE_SCHRIFT /* using libschrift backend */
+};
+
struct libskrift_font {
- SFT_Font *font;
- void *memory_free;
- void *memory_unmap;
- size_t memory_size;
- size_t refcount;
+ enum font_type font_type;
+ union {
+ void *any;
+ SFT_Font *schrift;
+ } font;
+ void *memory_free;
+ void *memory_unmap;
+ size_t memory_size;
+ size_t refcount;
};
struct libskrift_context {
@@ -55,3 +66,5 @@ struct format_settings {
};
extern const struct format_settings libskrift_format_settings[LIBSKRIFT_RGBA_LONG_DOUBLE + 1];
+
+int libskrift_open_font___(LIBSKRIFT_FONT **fontp, const void *mem_static, void *mem_free, void *mem_unmap, size_t size);