2017-02-27 21:42:14 +00:00
|
|
|
#ifndef HMML_H_
|
|
|
|
#define HMML_H_
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <stddef.h>
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
// Data structures
|
|
|
|
|
2018-02-21 20:05:03 +00:00
|
|
|
#define HMML_CUSTOM_ATTR_COUNT 16
|
|
|
|
|
2017-02-27 21:42:14 +00:00
|
|
|
typedef struct {
|
|
|
|
char* member;
|
2017-06-19 16:04:48 +00:00
|
|
|
char* stream_platform;
|
|
|
|
char* stream_username;
|
2017-02-27 21:42:14 +00:00
|
|
|
char* project;
|
|
|
|
char* title;
|
2017-06-19 16:04:48 +00:00
|
|
|
char* vod_platform;
|
2017-02-27 21:42:14 +00:00
|
|
|
char* id;
|
2017-06-20 19:54:26 +00:00
|
|
|
|
|
|
|
char** co_hosts;
|
|
|
|
size_t co_host_count;
|
|
|
|
|
|
|
|
char** guests;
|
|
|
|
size_t guest_count;
|
|
|
|
|
|
|
|
char** annotators;
|
|
|
|
size_t annotator_count;
|
2017-12-31 15:10:40 +00:00
|
|
|
|
|
|
|
char* template;
|
|
|
|
char* medium;
|
|
|
|
|
2018-02-21 20:05:03 +00:00
|
|
|
char* custom[HMML_CUSTOM_ATTR_COUNT];
|
|
|
|
|
2017-02-27 21:42:14 +00:00
|
|
|
} HMML_VideoMetaData;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
char* site;
|
|
|
|
char* page;
|
|
|
|
char* url;
|
|
|
|
char* title;
|
|
|
|
char* article;
|
|
|
|
char* author;
|
|
|
|
char* editor;
|
|
|
|
char* publisher;
|
|
|
|
char* isbn;
|
2017-02-27 22:53:05 +00:00
|
|
|
int offset;
|
2017-02-27 21:42:14 +00:00
|
|
|
} HMML_Reference;
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
HMML_CATEGORY,
|
|
|
|
HMML_MEMBER,
|
|
|
|
HMML_PROJECT,
|
|
|
|
|
|
|
|
HMML_MARKER_COUNT,
|
|
|
|
} HMML_MarkerType;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
HMML_MarkerType type;
|
2017-03-18 17:29:10 +00:00
|
|
|
char* marker;
|
|
|
|
char* parameter;
|
2017-06-19 16:04:48 +00:00
|
|
|
char* episode;
|
2017-02-27 22:53:05 +00:00
|
|
|
int offset;
|
2017-02-27 21:42:14 +00:00
|
|
|
} HMML_Marker;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
int id;
|
|
|
|
char* author;
|
|
|
|
} HMML_Quote;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
int line;
|
|
|
|
char* time;
|
|
|
|
char* text;
|
|
|
|
char* author;
|
|
|
|
|
|
|
|
HMML_Reference* references;
|
|
|
|
size_t reference_count;
|
|
|
|
|
|
|
|
HMML_Marker* markers;
|
|
|
|
size_t marker_count;
|
|
|
|
|
|
|
|
HMML_Quote quote;
|
|
|
|
bool is_quote;
|
|
|
|
} HMML_Annotation;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
int line;
|
|
|
|
char* message;
|
|
|
|
} HMML_Error;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
bool well_formed;
|
|
|
|
HMML_VideoMetaData metadata;
|
|
|
|
HMML_Annotation* annotations;
|
|
|
|
size_t annotation_count;
|
|
|
|
HMML_Error error;
|
|
|
|
} HMML_Output;
|
|
|
|
|
|
|
|
// Functions
|
|
|
|
|
|
|
|
HMML_Output hmml_parse_file (FILE* file);
|
|
|
|
void hmml_dump (HMML_Output* output);
|
|
|
|
void hmml_free (HMML_Output* output);
|
|
|
|
|
2017-11-06 21:07:40 +00:00
|
|
|
// Version
|
|
|
|
|
|
|
|
extern const struct HMML_Version {
|
|
|
|
int Major, Minor, Patch;
|
|
|
|
} hmml_version;
|
|
|
|
|
2017-02-27 21:42:14 +00:00
|
|
|
#endif
|