Include internal.h instead of otferror.h.
[m17n/libotf.git] / src / otfdrive.c
index 72d2434..aca83bc 100644 (file)
@@ -27,7 +27,7 @@ write to the Free Software Foundation, Inc., 59 Temple Place, Suite
 #include <config.h>
 
 #include "otf.h"
-#include "otferror.h"
+#include "internal.h"
 
 extern int debug_flag;
 
@@ -121,6 +121,27 @@ gstring_subst (OTF *otf, OTF_GlyphString *gstring, int from, int to, int flag,
   return 0;
 }
 
+static int
+prepare_drive_log (OTF_DriveLog *log, int size)
+{
+  if (size > log->allocated)
+    {
+      OTF_Tag *tags;
+      int allocated = log->allocated;
+
+      while (size > allocated)
+       allocated <<= 1;
+      tags = realloc (log->tags, sizeof (OTF_Tag) * log->allocated);
+      if (! tags)
+       return -1;
+      log->allocated = allocated;
+      log->tags = tags;
+    }
+  log->size = 0;
+  return 0;
+}
+
+
 \f
 static int
 get_coverage_index (OTF_Coverage *coverage, OTF_GlyphID id)
@@ -1779,7 +1800,7 @@ OTF_drive_gsub (OTF *otf, OTF_GlyphString *gstring,
   return OTF_drive_gsub_internal (otf, gstring, script, language, features, 0);
 }
 
-int
+static int
 OTF_drive_gpos_internal (OTF *otf, OTF_GlyphString *gstring,
                         const char *script, const char *language,
                         const char *features,
@@ -2045,3 +2066,12 @@ OTF_iterate_gsub_feature (OTF *otf, OTF_Feature_Callback callback,
        return -1;
   return 0;
 }
+
+OTF_Tag *
+OTF_get_drive_log (OTF *otf)
+{
+  OTF_DriveLog *log = get_drive_log (otf);
+
+  return (log ? log->tags : NULL);
+}
+