summaryrefslogtreecommitdiffstats
path: root/libass
diff options
context:
space:
mode:
authorOleg Oshmyan <chortos@inbox.lv>2020-07-06 02:24:59 +0300
committerOleg Oshmyan <chortos@inbox.lv>2020-07-14 20:14:44 +0300
commitc1aff3a86e00e99e750057a956f27564120934cb (patch)
tree56e1a5b01e4098d6b933de887a656d50aa108ae3 /libass
parent3103740d40c47d53484c3aeee2dbb6d43b967e91 (diff)
downloadlibass-c1aff3a86e00e99e750057a956f27564120934cb.tar.bz2
libass-c1aff3a86e00e99e750057a956f27564120934cb.tar.xz
Extract struct parser_priv into separate header file
Diffstat (limited to 'libass')
-rw-r--r--libass/ass.c41
-rw-r--r--libass/ass_priv.h64
2 files changed, 65 insertions, 40 deletions
diff --git a/libass/ass.c b/libass/ass.c
index b5ebad6..13cfea5 100644
--- a/libass/ass.c
+++ b/libass/ass.c
@@ -35,50 +35,11 @@
#include "ass.h"
#include "ass_utils.h"
#include "ass_library.h"
+#include "ass_priv.h"
#include "ass_string.h"
#define ass_atof(STR) (ass_strtod((STR),NULL))
-typedef enum {
- PST_UNKNOWN = 0,
- PST_INFO,
- PST_STYLES,
- PST_EVENTS,
- PST_FONTS
-} ParserState;
-
-typedef enum {
- SINFO_LANGUAGE = 1 << 0,
- SINFO_PLAYRESX = 1 << 1,
- SINFO_PLAYRESY = 1 << 2,
- SINFO_TIMER = 1 << 3,
- SINFO_WRAPSTYLE = 1 << 4,
- SINFO_SCALEDBORDER = 1 << 5,
- SINFO_COLOURMATRIX = 1 << 6,
- SINFO_KERNING = 1 << 7,
- // for legacy detection
- GENBY_FFMPEG = 1 << 8
- // max 32 enumerators
-} ScriptInfo;
-
-struct parser_priv {
- ParserState state;
- char *fontname;
- char *fontdata;
- int fontdata_size;
- int fontdata_used;
-
- // contains bitmap of ReadOrder IDs of all read events
- uint32_t *read_order_bitmap;
- int read_order_elems; // size in uint32_t units of read_order_bitmap
- int check_readorder;
-
- int enable_extensions;
-
- // tracks [Script Info] headers set by the script
- uint32_t header_flags;
-};
-
static const char *const ass_style_format =
"Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, "
"OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, "
diff --git a/libass/ass_priv.h b/libass/ass_priv.h
new file mode 100644
index 0000000..3ee2b45
--- /dev/null
+++ b/libass/ass_priv.h
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2006 Evgeniy Stepanov <eugeni.stepanov@gmail.com>
+ *
+ * This file is part of libass.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifndef LIBASS_PRIV_H
+#define LIBASS_PRIV_H
+
+#include <stdint.h>
+
+typedef enum {
+ PST_UNKNOWN = 0,
+ PST_INFO,
+ PST_STYLES,
+ PST_EVENTS,
+ PST_FONTS
+} ParserState;
+
+typedef enum {
+ SINFO_LANGUAGE = 1 << 0,
+ SINFO_PLAYRESX = 1 << 1,
+ SINFO_PLAYRESY = 1 << 2,
+ SINFO_TIMER = 1 << 3,
+ SINFO_WRAPSTYLE = 1 << 4,
+ SINFO_SCALEDBORDER = 1 << 5,
+ SINFO_COLOURMATRIX = 1 << 6,
+ SINFO_KERNING = 1 << 7,
+ // for legacy detection
+ GENBY_FFMPEG = 1 << 8
+ // max 32 enumerators
+} ScriptInfo;
+
+struct parser_priv {
+ ParserState state;
+ char *fontname;
+ char *fontdata;
+ int fontdata_size;
+ int fontdata_used;
+
+ // contains bitmap of ReadOrder IDs of all read events
+ uint32_t *read_order_bitmap;
+ int read_order_elems; // size in uint32_t units of read_order_bitmap
+ int check_readorder;
+
+ int enable_extensions;
+
+ // tracks [Script Info] headers set by the script
+ uint32_t header_flags;
+};
+
+#endif /* LIBASS_PRIV_H */