From 21814d1e48113eb5fdc9c88d7b05851a9eeea1f3 Mon Sep 17 00:00:00 2001 From: Alex Baines Date: Tue, 5 Feb 2019 20:45:59 +0000 Subject: [PATCH] add publication_date and output to hmml metadata --- hmmlib/hmmlib.h | 5 ++++- hmmlib/hmmlib.l | 20 +++++++++++++++----- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/hmmlib/hmmlib.h b/hmmlib/hmmlib.h index 8c89cc5..00ceacd 100644 --- a/hmmlib/hmmlib.h +++ b/hmmlib/hmmlib.h @@ -30,6 +30,9 @@ typedef struct { char* custom[HMML_CUSTOM_ATTR_COUNT]; + long publication_date; + char* output; + } HMML_VideoMetaData; typedef struct { @@ -71,7 +74,7 @@ typedef struct { char* time; char* text; char* author; - + HMML_Reference* references; size_t reference_count; diff --git a/hmmlib/hmmlib.l b/hmmlib/hmmlib.l index 5b9423e..8f26088 100644 --- a/hmmlib/hmmlib.l +++ b/hmmlib/hmmlib.l @@ -5,7 +5,7 @@ #include "stb_sb.h" #include "hmmlib.h" - const struct HMML_Version hmml_version = { 0, 3, 0 }; + const struct HMML_Version hmml_version = { 0, 4, 0 }; typedef struct { int line; @@ -58,10 +58,10 @@ yyextra->first = false;\ } while(0) -#define UNQUOTE(_attr) ({ \ +#define UNQUOTE_LEN(_attr, _len) ({ \ typeof(_attr) attr = (_attr); \ - size_t len = strlen(attr); \ - for(char* c = attr; *c; ++c){\ + typeof(_len) len = (_len); \ + for(char* c = attr; c < attr+len; ++c){\ if(*c == '\\'){ \ CHECKESCAPE(c[1]); \ memmove(c, c+1, len-(c-attr)); \ @@ -71,6 +71,8 @@ attr; \ }) +#define UNQUOTE(_attr) UNQUOTE_LEN(_attr, strlen(attr)) + %} %option reentrant @@ -91,6 +93,7 @@ RB \] %s VIDEO %s V_ATTR %s V2_ATTR +%s V3_ATTR %s ANNOTATION %s TEXT_START %s TEXT @@ -140,6 +143,8 @@ RB \]