summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/mfluadir/otfcc/lib/table/otl/subtables/chaining/common.h
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/texk/web2c/mfluadir/otfcc/lib/table/otl/subtables/chaining/common.h')
-rw-r--r--Build/source/texk/web2c/mfluadir/otfcc/lib/table/otl/subtables/chaining/common.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/Build/source/texk/web2c/mfluadir/otfcc/lib/table/otl/subtables/chaining/common.h b/Build/source/texk/web2c/mfluadir/otfcc/lib/table/otl/subtables/chaining/common.h
new file mode 100644
index 00000000000..db8cf92898e
--- /dev/null
+++ b/Build/source/texk/web2c/mfluadir/otfcc/lib/table/otl/subtables/chaining/common.h
@@ -0,0 +1,33 @@
+#include "../chaining.h"
+
+static INLINE void closeRule(otl_ChainingRule *rule) {
+ if (rule && rule->match && rule->matchCount) {
+ for (tableid_t k = 0; k < rule->matchCount; k++) {
+ Coverage.free(rule->match[k]);
+ }
+ FREE(rule->match);
+ }
+ if (rule && rule->apply) {
+ for (tableid_t j = 0; j < rule->applyCount; j++) {
+ Handle.dispose(&rule->apply[j].lookup);
+ }
+ FREE(rule->apply);
+ }
+}
+static INLINE void deleteRule(otl_ChainingRule *rule) {
+ if (!rule) return;
+ closeRule(rule);
+ FREE(rule);
+}
+static INLINE void reverseBacktracks(otl_ChainingRule *rule) {
+ if (rule->inputBegins > 0) {
+ tableid_t start = 0;
+ tableid_t end = rule->inputBegins - 1;
+ while (end > start) {
+ otl_Coverage *tmp = rule->match[start];
+ rule->match[start] = rule->match[end];
+ rule->match[end] = tmp;
+ end--, start++;
+ }
+ }
+}