import html
entities5 = html.entities.html5
entities = sorted([(k[:-1], entities5[k].encode('utf-8')) for k in entities5.keys() if k[-1] == ';'])
print("""/* Autogenerated by tools/make_headers_inc.py */
struct cmark_entity_node {
unsigned char *entity;
unsigned char bytes[8];
};
#define CMARK_ENTITY_MIN_LENGTH 2
#define CMARK_ENTITY_MAX_LENGTH 32""")
print("#define CMARK_NUM_ENTITIES " + str(len(entities)));
print("\nstatic const struct cmark_entity_node cmark_entities[] = {");
for (ent, bs) in entities:
print('{(unsigned char*)"' + ent + '", {' + ', '.join(map(str, bs)) + ', 0}},')
print("};")