From d4c7564e0371b74c621b0d6e0b592b0c1f57d6d1 Mon Sep 17 00:00:00 2001 From: nekobit Date: Wed, 1 Jun 2022 06:08:00 +0000 Subject: [PATCH] Templates rewritten FossilOrigin-Name: 829485569f9ea39c9f417e7c4eb1a104665da0bb0257ba6fc8dd4b711a031d98 --- Makefile | 10 +- src/account.c | 14 +-- src/attachments.c | 28 +++--- src/base_page.c | 26 +++-- src/base_page.h | 3 +- src/emoji.c | 68 ++++++------- src/emoji_reaction.c | 24 +++-- src/error.c | 26 ++--- src/graphsnbars.c | 25 ++--- src/hashtag.c | 18 ++-- src/lists.c | 28 +++--- src/login.c | 25 ++--- src/navigation.c | 23 ++--- src/notifications.c | 97 +++++++++--------- src/page_config.c | 67 ++++++------- src/reply.c | 14 +-- src/scrobble.c | 35 +++---- src/search.c | 28 +++--- src/status.c | 127 +++++++++++++----------- src/status.h | 4 +- src/string_helpers.c | 2 +- src/string_helpers.h | 3 +- src/template/main.c | 26 +++-- src/test.c | 23 +++-- src/timeline.c | 26 +++-- src/type_string.c | 12 +-- static/about.ctmpl | 1 + static/account.ctmpl | 12 +-- static/account.tmpl | 4 +- static/account_follow_btn.ctmpl | 8 +- static/account_info.ctmpl | 8 +- static/account_sidebar.ctmpl | 8 +- static/account_stub.ctmpl | 9 +- static/attachment_audio.ctmpl | 8 +- static/attachment_gifv.ctmpl | 8 +- static/attachment_image.ctmpl | 8 +- static/attachment_link.ctmpl | 8 +- static/attachment_video.ctmpl | 8 +- static/attachments.ctmpl | 8 +- static/bar.ctmpl | 8 +- static/bar_graph.ctmpl | 8 +- static/bookmarks_page.ctmpl | 8 +- static/config_appearance.ctmpl | 1 + static/config_general.ctmpl | 8 +- static/config_sidebar.ctmpl | 9 +- static/config_sidebar.tmpl | 6 +- static/directs_page.ctmpl | 8 +- static/emoji.ctmpl | 8 +- static/emoji_picker.ctmpl | 14 +-- static/emoji_picker.tmpl | 20 ++-- static/emoji_reaction.ctmpl | 8 +- static/emoji_reactions.ctmpl | 8 +- static/error.ctmpl | 8 +- static/error_404.ctmpl | 8 +- static/favourites_page.ctmpl | 8 +- static/follow_svg.ctmpl | 1 + static/hashtag.ctmpl | 9 +- static/hashtag.tmpl | 2 +- static/hashtag_page.ctmpl | 11 +- static/hashtag_page.tmpl | 1 - static/in_reply_to.ctmpl | 8 +- static/index.ctmpl | 8 +- static/instance.ctmpl | 1 + static/interaction_buttons.ctmpl | 8 +- static/license.ctmpl | 1 + static/like_svg.ctmpl | 1 + static/likeboost.ctmpl | 8 +- static/list.ctmpl | 8 +- static/lists.ctmpl | 8 +- static/login.ctmpl | 8 +- static/menu_item.ctmpl | 8 +- static/navigation.ctmpl | 8 +- static/notification.ctmpl | 11 +- static/notification.tmpl | 3 +- static/notification_action.ctmpl | 12 +-- static/notification_action.tmpl | 3 +- static/notification_compact.ctmpl | 15 +-- static/notification_compact.tmpl | 5 +- static/notifications.ctmpl | 8 +- static/notifications_embed.ctmpl | 8 +- static/notifications_page.ctmpl | 8 +- static/post.ctmpl | 8 +- static/quick_login.ctmpl | 8 +- static/reactions_btn.ctmpl | 8 +- static/repeat_svg.ctmpl | 1 + static/scrobble.ctmpl | 8 +- static/search.ctmpl | 8 +- static/status.ctmpl | 8 +- static/status_interaction_profile.ctmpl | 8 +- static/status_interactions.ctmpl | 8 +- static/status_interactions_label.ctmpl | 8 +- static/test.ctmpl | 8 +- 92 files changed, 546 insertions(+), 725 deletions(-) diff --git a/Makefile b/Makefile index 97cd6fa..823a0ee 100644 --- a/Makefile +++ b/Makefile @@ -10,6 +10,8 @@ HEADERS = $(wildcard src/*.h) PAGES_DIR = static PAGES = $(wildcard $(PAGES_DIR)/*.tmpl) PAGES_CMP = $(patsubst %.tmpl,%.ctmpl,$(PAGES)) +PAGES_C = $(patsubst %.tmpl, %.c,$(PAGES)) +PAGES_C_OBJ = $(patsubst %.c,%.o,$(PAGES_C)) DIST = dist/ PREFIX ?= /usr/local TARGET = treebird @@ -19,8 +21,8 @@ MASTODONT_URL = https://fossil.nekobit.net/mastodont-c all: $(MASTODONT_DIR) dep_build $(TARGET) apache: all apache_start -$(TARGET): filec template $(PAGES_CMP) $(OBJ) $(HEADERS) - $(CC) -o $(TARGET) $(OBJ) $(LDFLAGS) +$(TARGET): filec template $(PAGES_CMP) $(PAGES_C) $(PAGES_C_OBJ) $(OBJ) $(HEADERS) + $(CC) -o $(TARGET) $(OBJ) $(PAGES_C_OBJ) $(LDFLAGS) template: src/template/main.o $(CC) $(LDFLAGS) -o template $< @@ -32,8 +34,10 @@ emojitoc: scripts/emoji-to.o $(CC) -o emojitoc $< $(LDFLAGS) ./emojitoc meta/emoji.json > src/emoji_codes.h +# Redirect stdout and stderr into separate contents as a hack +# Let bash do the work :) $(PAGES_DIR)/%.ctmpl: $(PAGES_DIR)/%.tmpl - ./template $< $(notdir $*) > $@ + ./template $< $(notdir $*) 2> $(PAGES_DIR)/$(notdir $*).c 1> $@ $(MASTODONT_DIR): cd ..; fossil clone $(MASTODONT_URL) || true diff --git a/src/account.c b/src/account.c index 28ad24f..afc3983 100644 --- a/src/account.c +++ b/src/account.c @@ -286,12 +286,12 @@ size_t construct_account_page(char** result, struct account_page* page, char* co .statuses_count = page->statuses_count, .tab_following_text = L10N[page->locale][L10N_TAB_FOLLOWING], .following_count = page->following_count, - .tab_followers_count = L10N[page->locale][L10N_TAB_FOLLOWERS], + .tab_followers_text = L10N[page->locale][L10N_TAB_FOLLOWERS], .followers_count = page->followers_count, - .follow_button = follow_btn, + .follow_btn = follow_btn, .avatar = page->profile_image, .info = info_html, - .tab_status_focused = MAKE_FOCUSED_IF(page->tab, ACCT_TAB_STATUSES), + .tab_statuses_focused = MAKE_FOCUSED_IF(page->tab, ACCT_TAB_STATUSES), .tab_statuses_text = L10N[page->locale][L10N_TAB_STATUSES], .tab_scrobbles_focused = MAKE_FOCUSED_IF(page->tab, ACCT_TAB_SCROBBLES), .tab_scrobbles_text = L10N[page->locale][L10N_TAB_SCROBBLES], @@ -511,11 +511,11 @@ void content_account_bookmarks(struct session* ssn, mastodont_t* api, char** dat NULL); } - struct bookmarks_page_template data = { + struct bookmarks_page_template tdata = { .statuses = status_format, .navigation = navigation_box }; - output = tmpl_gen_bookmarks_page(&data, NULL); + output = tmpl_gen_bookmarks_page(&tdata, NULL); struct base_page b = { .category = BASE_CAT_BOOKMARKS, @@ -574,11 +574,11 @@ void content_account_favourites(struct session* ssn, mastodont_t* api, char** da NULL); } - struct favourites_page_template data = { + struct favourites_page_template tdata = { .statuses = status_format, .navigation = navigation_box }; - output = tmpl_gen_favourites_page(&data, NULL); + output = tmpl_gen_favourites_page(&tdata, NULL); struct base_page b = { .category = BASE_CAT_FAVOURITES, diff --git a/src/attachments.c b/src/attachments.c index dd2983f..1ab9d67 100644 --- a/src/attachments.c +++ b/src/attachments.c @@ -23,12 +23,12 @@ #include "string_helpers.h" // Pages -#include "../static/attachments.chtml" -#include "../static/attachment_image.chtml" -#include "../static/attachment_gifv.chtml" -#include "../static/attachment_video.chtml" -#include "../static/attachment_link.chtml" -#include "../static/attachment_audio.chtml" +#include "../static/attachments.ctmpl" +#include "../static/attachment_image.ctmpl" +#include "../static/attachment_gifv.ctmpl" +#include "../static/attachment_video.ctmpl" +#include "../static/attachment_link.ctmpl" +#include "../static/attachment_audio.ctmpl" struct attachments_args { @@ -124,6 +124,8 @@ char* construct_attachment(struct session* ssn, struct mstdnt_attachment* att, int* str_size) { + // Due to how similar the attachment templates are, we're just going to use their data files + // and not generate any templates, saves some LOC! char* att_html; size_t s; const char* attachment_str; @@ -133,19 +135,19 @@ char* construct_attachment(struct session* ssn, switch (att->type) { case MSTDNT_ATTACHMENT_IMAGE: - attachment_str = data_attachment_image_html; break; + attachment_str = data_attachment_image; break; case MSTDNT_ATTACHMENT_GIFV: - attachment_str = data_attachment_gifv_html; break; + attachment_str = data_attachment_gifv; break; case MSTDNT_ATTACHMENT_VIDEO: - attachment_str = data_attachment_video_html; break; + attachment_str = data_attachment_video; break; case MSTDNT_ATTACHMENT_AUDIO: - attachment_str = data_attachment_audio_html; break; + attachment_str = data_attachment_audio; break; case MSTDNT_ATTACHMENT_UNKNOWN: // Fall through default: - attachment_str = data_attachment_link_html; break; + attachment_str = data_attachment_link; break; } else - attachment_str = data_attachment_link_html; + attachment_str = data_attachment_link; // Images/visible content displays sensitive placeholder after if ((att->type == MSTDNT_ATTACHMENT_IMAGE || @@ -184,7 +186,7 @@ char* construct_attachments(struct session* ssn, char* elements = construct_func_strings(construct_attachments_voidwrap, &args, atts_len, &elements_size); char* att_view; - size_t s = easprintf(&att_view, data_attachments_html, elements); + size_t s = easprintf(&att_view, data_attachments, elements); if (str_size) *str_size = s; // Cleanup free(elements); diff --git a/src/base_page.c b/src/base_page.c index 43a942c..43b9e3d 100644 --- a/src/base_page.c +++ b/src/base_page.c @@ -31,7 +31,7 @@ // Files #include "../static/index.ctmpl" -#include "../static/quick_login.chtml" +#include "../static/quick_login.ctmpl" #define BODY_STYLE "style=\"background:url('%s');\"" @@ -95,11 +95,13 @@ void render_base_page(struct base_page* page, struct session* ssn, mastodont_t* } else { // Construct small login page - easprintf(&main_sidebar_str, data_quick_login_html, - config_url_prefix, - L10N[L10N_EN_US][L10N_USERNAME], - L10N[L10N_EN_US][L10N_PASSWORD], - L10N[L10N_EN_US][L10N_LOGIN_BTN]); + struct quick_login_template tdata = { + .prefix = config_url_prefix, + .username = L10N[locale][L10N_USERNAME], + .password = L10N[locale][L10N_PASSWORD], + .login = L10N[locale][L10N_LOGIN_BTN], + }; + main_sidebar_str = tmpl_gen_quick_login(&tdata, NULL); } // Combine into sidebar @@ -146,7 +148,7 @@ void render_base_page(struct base_page* page, struct session* ssn, mastodont_t* .sidebar_rightbar = sidebar_str }; - unsigned len; + size_t len; char* data = tmpl_gen_index(&index, &len); if (!data) @@ -155,7 +157,7 @@ void render_base_page(struct base_page* page, struct session* ssn, mastodont_t* goto cleanup; } - render_html(data, len); + render_html("text/html", data, len); // Cleanup /* cleanup_all: */ @@ -168,9 +170,11 @@ cleanup: free(instance_str); } -void render_html(char* data, size_t data_len) +void render_html(char* content_type, char* data, size_t data_len) { - fputs("Content-type: text/html\r\n", stdout); - printf("Content-Length: %d\r\n\r\n", data_len + 1); + printf("Content-type: %s\r\n" + "Content-Length: %d\r\n\r\n", + content_type ? content_type : "text/html", + data_len + 1); puts(data); } diff --git a/src/base_page.h b/src/base_page.h index 5ba1525..540ace5 100644 --- a/src/base_page.h +++ b/src/base_page.h @@ -50,9 +50,10 @@ void render_base_page(struct base_page* page, struct session* ssn, mastodont_t* /** * Outputs HTML in format for CGI. This can only be called once! * + * @param content_type The Content-Type to display, if NULL, assume "text/html" * @param data HTML content * @param data_len Length of data. */ -void render_html(char* data, size_t data_len); +void render_html(char* content_type, char* data, size_t data_len); #endif // BASE_PAGE_H diff --git a/src/emoji.c b/src/emoji.c index 36fbb87..5398092 100644 --- a/src/emoji.c +++ b/src/emoji.c @@ -24,8 +24,8 @@ #include "string_helpers.h" // Pages -#include "../static/emoji.chtml" -#include "../static/emoji_picker.chtml" +#include "../static/emoji.ctmpl" +#include "../static/emoji_picker.ctmpl" char* emojify(char* content, struct mstdnt_emoji* emos, size_t emos_len) { @@ -67,16 +67,14 @@ struct construct_emoji_picker_args char* construct_emoji(struct emoji_info* emoji, char* status_id, int* size) { - char* emoji_html; - if (!emoji) return NULL; - size_t s = easprintf(&emoji_html, data_emoji_html, - status_id, emoji->codes, emoji->codes); - - if (size) *size = s; - return emoji_html; + struct emoji_template data = { + .status_id = status_id, + .emoji = emoji->codes + }; + return tmpl_gen_emoji(&data, size); } static char* construct_emoji_voidwrap(void* passed, size_t index, int* res) @@ -97,32 +95,32 @@ char* construct_emoji_picker(char* status_id, unsigned index, size_t* size) char* emojis; emojis = construct_func_strings(construct_emoji_voidwrap, &args, EMOJI_FACTOR_NUM, NULL); - - size_t s = easprintf(&emoji_picker_html, data_emoji_picker_html, - ACTIVE_CONDITION(index >= 0 && index < EMOJO_CAT_ANIMALS), - EMOJO_CAT_ANIMALS, - ACTIVE_CONDITION(index >= EMOJO_CAT_ANIMALS && index < EMOJO_CAT_FOOD), - EMOJO_CAT_FOOD, - ACTIVE_CONDITION(index >= EMOJO_CAT_FOOD && index < EMOJO_CAT_TRAVEL), - EMOJO_CAT_TRAVEL, - ACTIVE_CONDITION(index >= EMOJO_CAT_TRAVEL && index < EMOJO_CAT_ACTIVITIES), - EMOJO_CAT_ACTIVITIES, - ACTIVE_CONDITION(index >= EMOJO_CAT_ACTIVITIES && index < EMOJO_CAT_OBJECTS), - EMOJO_CAT_OBJECTS, - ACTIVE_CONDITION(index >= EMOJO_CAT_OBJECTS && index < EMOJO_CAT_SYMBOLS), - EMOJO_CAT_SYMBOLS, - ACTIVE_CONDITION(index >= EMOJO_CAT_SYMBOLS && index < EMOJO_CAT_FLAGS), - EMOJO_CAT_FLAGS, - ACTIVE_CONDITION(index >= EMOJO_CAT_FLAGS && index < emojos_size), - emojis ? emojis : "", - // Index movements - status_id, - index > 0 ? index - EMOJI_FACTOR_NUM : 0, - 0 > index - EMOJI_FACTOR_NUM ? "disabled" : "", - status_id, - index + EMOJI_FACTOR_NUM); - free(emojis); - if (size) *size = s; + struct emoji_picker_template data = { + .cat_smileys = ACTIVE_CONDITION(index >= 0 && index < EMOJO_CAT_ANIMALS), + .animals = EMOJO_CAT_ANIMALS, + .cat_animals = ACTIVE_CONDITION(index >= EMOJO_CAT_ANIMALS && index < EMOJO_CAT_FOOD), + .food = EMOJO_CAT_FOOD, + .cat_food = ACTIVE_CONDITION(index >= EMOJO_CAT_FOOD && index < EMOJO_CAT_TRAVEL), + .travel = EMOJO_CAT_TRAVEL, + .cat_travel = ACTIVE_CONDITION(index >= EMOJO_CAT_TRAVEL && index < EMOJO_CAT_ACTIVITIES), + .activities = EMOJO_CAT_ACTIVITIES, + .cat_activities = ACTIVE_CONDITION(index >= EMOJO_CAT_ACTIVITIES && index < EMOJO_CAT_OBJECTS), + .objects = EMOJO_CAT_OBJECTS, + .cat_objects = ACTIVE_CONDITION(index >= EMOJO_CAT_OBJECTS && index < EMOJO_CAT_SYMBOLS), + .symbols = EMOJO_CAT_SYMBOLS, + .cat_symbols = ACTIVE_CONDITION(index >= EMOJO_CAT_SYMBOLS && index < EMOJO_CAT_FLAGS), + .flags = EMOJO_CAT_FLAGS, + .cat_flags = ACTIVE_CONDITION(index >= EMOJO_CAT_FLAGS && index < emojos_size), + .emojis = emojis, + // Index movements + .status_id = status_id, + .index_previous = index > 0 ? index - EMOJI_FACTOR_NUM : 0, + .previous_enabled = 0 > index - EMOJI_FACTOR_NUM ? "disabled" : "", + .index_next = index + EMOJI_FACTOR_NUM + }; + + emoji_picker_html = tmpl_gen_emoji_picker(&data, size); + free(emojis); return emoji_picker_html; } diff --git a/src/emoji_reaction.c b/src/emoji_reaction.c index 2b6f99d..29ee317 100644 --- a/src/emoji_reaction.c +++ b/src/emoji_reaction.c @@ -23,8 +23,8 @@ #include "easprintf.h" // Templates -#include "../static/emoji_reaction.chtml" -#include "../static/emoji_reactions.chtml" +#include "../static/emoji_reaction.ctmpl" +#include "../static/emoji_reactions.ctmpl" struct construct_emoji_reactions_args { @@ -34,12 +34,14 @@ struct construct_emoji_reactions_args char* construct_emoji_reaction(char* id, struct mstdnt_emoji_reaction* emo, int* str_size) { - char* emo_html; - - size_t s = easprintf(&emo_html, data_emoji_reaction_html, - config_url_prefix, id, emo->name, emo->me ? "active" : "", emo->name, emo->count); - if (str_size) *str_size = s; - return emo_html; + struct emoji_reaction_template data = { + .prefix = config_url_prefix, + .status_id = id, + .emoji = emo->name, + .emoji_active = emo->me ? "active" : NULL, + .emoji_count = emo->count + }; + return tmpl_gen_emoji_reaction(&data, str_size); } static char* construct_emoji_reactions_voidwrap(void* passed, size_t index, int* res) @@ -58,8 +60,10 @@ char* construct_emoji_reactions(char* id, struct mstdnt_emoji_reaction* emos, si char* elements = construct_func_strings(construct_emoji_reactions_voidwrap, &args, emos_len, &elements_size); char* emos_view; - size_t s = easprintf(&emos_view, data_emoji_reactions_html, elements); - if (str_size) *str_size = s; + struct emoji_reactions_template data = { + .emojis = elements + }; + emos_view = tmpl_gen_emoji_reactions(&data, str_size); // Cleanup free(elements); return emos_view; diff --git a/src/error.c b/src/error.c index fb3dccd..f46a8ec 100644 --- a/src/error.c +++ b/src/error.c @@ -22,12 +22,11 @@ #include "l10n.h" // Pages -#include "../static/error_404.chtml" -#include "../static/error.chtml" +#include "../static/error_404.ctmpl" +#include "../static/error.ctmpl" char* construct_error(const char* error, enum error_type type, unsigned pad, size_t* size) { - char* error_html; char* class; switch (type) @@ -39,20 +38,23 @@ char* construct_error(const char* error, enum error_type type, unsigned pad, siz case E_NOTICE: class = "notice"; break; } - size_t s = easprintf(&error_html, data_error_html, - class, - pad ? "error-pad" : "", - error ? error : "An error occured"); - if (size) *size = s; - return error_html; + + struct error_template data = { + .err_type = class, + .is_padded = pad ? "error-pad" : NULL, + .error = error ? error : "An error occured", + }; + + return tmpl_gen_error(&data, size); } void content_not_found(struct session* ssn, mastodont_t* api, char* path) { char* page; - easprintf(&page, - data_error_404_html, - L10N[L10N_EN_US][L10N_PAGE_NOT_FOUND]); + struct error_404_template data = { + .error = L10N[L10N_EN_US][L10N_PAGE_NOT_FOUND] + }; + page = tmpl_gen_error_404(&data, NULL); struct base_page b = { .locale = L10N_EN_US, diff --git a/src/graphsnbars.c b/src/graphsnbars.c index f95bed3..a2ae966 100644 --- a/src/graphsnbars.c +++ b/src/graphsnbars.c @@ -23,8 +23,8 @@ #include "string_helpers.h" // Pages -#include "../static/bar.chtml" -#include "../static/bar_graph.chtml" +#include "../static/bar.ctmpl" +#include "../static/bar_graph.ctmpl" struct hashtags_graph_args { @@ -37,23 +37,18 @@ struct hashtags_graph_args char* construct_bar_graph_container(char* bars, size_t* size) { - char* bar_graph_html; - - size_t s = easprintf(&bar_graph_html, data_bar_graph_html, bars); - - if (size) *size = s; - return bar_graph_html; + struct bar_graph_template data = { + .graph = bars, + }; + return tmpl_gen_bar_graph(&data, size); } char* construct_bar(float value, int* size) { - char* bar_html; - - size_t s = easprintf(&bar_html, data_bar_html, - value*100); - - if (size) *size = s; - return bar_html; + struct bar_template data = { + .value = value * 100 + }; + return tmpl_gen_bar(&data, size); } static char* construct_hashgraph_voidwrap(void* passed, size_t index, int* res) diff --git a/src/hashtag.c b/src/hashtag.c index 75d977d..6d6e1c5 100644 --- a/src/hashtag.c +++ b/src/hashtag.c @@ -23,8 +23,8 @@ #include "../config.h" // Pages -#include "../static/hashtag.chtml" -#include "../static/hashtag_page.chtml" +#include "../static/hashtag.ctmpl" +#include "../static/hashtag_page.ctmpl" #define TAG_SIZE_INITIAL 12 @@ -40,23 +40,23 @@ static unsigned hashtag_history_daily_uses(size_t max, struct mstdnt_history* hi char* construct_hashtag(struct mstdnt_tag* hashtag, int* size) { - char* hashtag_html; - // Lol! unsigned hash_size = TAG_SIZE_INITIAL + CLAMP(hashtag_history_daily_uses(7, hashtag->history, hashtag->history_len)*2, 0, 42); - size_t s = easprintf(&hashtag_html, data_hashtag_html, - config_url_prefix, hashtag->name, hash_size, hashtag->name); - - if (size) *size = s; - return hashtag_html; + struct hashtag_template data = { + .prefix = config_url_prefix, + .tag = hashtag->name, + .tag_size = hash_size, + }; + return tmpl_gen_hashtag(&data, size); } static char* construct_hashtag_voidwrap(void* passed, size_t index, int* res) { return construct_hashtag((struct mstdnt_tag*)passed + index, res); } + char* construct_hashtags(struct mstdnt_tag* hashtags, size_t size, size_t* ret_size) { if (!(hashtags && size)) return NULL; diff --git a/src/lists.c b/src/lists.c index 6c57447..b8e45cb 100644 --- a/src/lists.c +++ b/src/lists.c @@ -27,19 +27,18 @@ #include "string_helpers.h" // Files -#include "../static/account.chtml" -#include "../static/list.chtml" -#include "../static/lists.chtml" +#include "../static/account.ctmpl" +#include "../static/list.ctmpl" +#include "../static/lists.ctmpl" char* construct_list(struct mstdnt_list* list, int* size) { - char* list_html; - size_t s = easprintf(&list_html, data_list_html, - config_url_prefix, - list->id, - list->title); - if (size) *size = s; - return list_html; + struct list_template data = { + .list = list->title, + .prefix = config_url_prefix, + .list_id = list->id + }; + return tmpl_gen_list(&data, size); } static char* construct_list_voidwrap(void* passed, size_t index, int* res) @@ -54,10 +53,11 @@ char* construct_lists(struct mstdnt_list* lists, size_t size, size_t* ret_size) char* construct_lists_view(char* lists_string, int* size) { - char* list_string; - size_t s = easprintf(&list_string, data_lists_html, lists_string, config_url_prefix); - if (size) *size = s; - return list_string; + struct lists_template data = { + .lists = lists_string, + .prefix = config_url_prefix + }; + return tmpl_gen_lists(&data, size); } void content_lists(struct session* ssn, mastodont_t* api, char** data) diff --git a/src/login.c b/src/login.c index a9081ef..d13fd13 100644 --- a/src/login.c +++ b/src/login.c @@ -29,7 +29,7 @@ #include "http.h" // Files -#include "../static/login.chtml" +#include "../static/login.ctmpl" #define LOGIN_SCOPE "read+write+follow+push" @@ -192,17 +192,18 @@ void content_login(struct session* ssn, mastodont_t* api, char** data) } // Concat - easprintf(&page, data_login_html, - L10N[L10N_EN_US][L10N_LOGIN], - error ? error : "", - config_url_prefix, - L10N[L10N_EN_US][L10N_USERNAME], - L10N[L10N_EN_US][L10N_PASSWORD], - L10N[L10N_EN_US][L10N_LOGIN_BTN], - "Or", - config_url_prefix, - "Instance url", - "Authorize"); + struct login_template tdata = { + .login_header = L10N[L10N_EN_US][L10N_LOGIN], + .error = error, + .prefix = config_url_prefix, + .username = L10N[L10N_EN_US][L10N_USERNAME], + .password = L10N[L10N_EN_US][L10N_PASSWORD], + .login_submit = L10N[L10N_EN_US][L10N_LOGIN_BTN], + .instance_text = "Or", + .instance_url = "Instance url", + .instance_submit = "Authorize" + }; + page = tmpl_gen_login(&tdata, NULL); struct base_page b = { .category = BASE_CAT_NONE, diff --git a/src/navigation.c b/src/navigation.c index b518c35..fe45f2b 100644 --- a/src/navigation.c +++ b/src/navigation.c @@ -21,7 +21,7 @@ #include "easprintf.h" // Pages -#include "../static/navigation.chtml" +#include "../static/navigation.ctmpl" #define SUBMIT_HTML "" @@ -30,19 +30,14 @@ char* construct_navigation_box(char* start_id, char* next_id, size_t* size) { - char* nav_html; - int is_start = start_id && prev_id ? strcmp(start_id, prev_id) == 0 : 0; - size_t s = easprintf(&nav_html, data_navigation_html, - start_id, - prev_id, - // Disable button if at start - is_start ? "btn-disabled" : "", - is_start ? "" : SUBMIT_HTML, - // If user pressed next, reserve start state - start_id, - next_id); - if (size) *size = s; - return nav_html; + struct navigation_template tdata = { + .start_id = start_id, + .min_id = prev_id, + .prev_active = is_start ? "btn-disabled" : NULL, + .prev_submit = is_start ? "" : SUBMIT_HTML, + .max_id = next_id + }; + return tmpl_gen_navigation(&tdata, size); } diff --git a/src/notifications.c b/src/notifications.c index d621cae..5e98907 100644 --- a/src/notifications.c +++ b/src/notifications.c @@ -29,14 +29,14 @@ #include "../config.h" // Pages -#include "../static/notifications_page.chtml" -#include "../static/notifications.chtml" -#include "../static/notification_action.chtml" -#include "../static/notification.chtml" -#include "../static/notification_compact.chtml" -#include "../static/like_svg.chtml" -#include "../static/repeat_svg.chtml" -#include "../static/notifications_embed.chtml" +#include "../static/notifications_page.ctmpl" +#include "../static/notifications.ctmpl" +#include "../static/notification_action.ctmpl" +#include "../static/notification.ctmpl" +#include "../static/notification_compact.ctmpl" +#include "../static/like_svg.ctmpl" +#include "../static/repeat_svg.ctmpl" +#include "../static/notifications_embed.ctmpl" struct notification_args { @@ -68,21 +68,15 @@ char* construct_notification(struct session* ssn, char* construct_notification_action(struct mstdnt_notification* notif, int* size) { - char* notif_html; - int s; - - s = easprintf(¬if_html, data_notification_action_html, - notif->account->avatar, - notif->account->acct, - notif->account->display_name, - notification_type_compact_str(notif->type), - notification_type_svg(notif->type), - config_url_prefix, - notif->account->acct, - notif->account->acct); - - if (size) *size = s; - return notif_html; + struct notification_action_template tdata = { + .avatar = notif->account->avatar, + .acct = notif->account->acct, + .display_name = notif->account->display_name, + .prefix = config_url_prefix, + .action = notification_type_compact_str(notif->type), + .notif_svg = notification_type_svg(notif->type) + }; + return tmpl_gen_notification_action(&tdata, size); } char* construct_notification_compact(struct session* ssn, @@ -108,22 +102,20 @@ char* construct_notification_compact(struct session* ssn, notif->status->emojis_len); } - size_t s = easprintf(¬if_html, data_notification_compact_html, - notif->account->avatar, - /* If there is an icon, the text doesn't shift up relative to the SVG, this is a hack on the CSS side */ - strlen(type_svg) == 0 ? "" : "-with-icon", - notif->account->acct, - notif->account->display_name, - type_str, - type_svg, - /* Might show follower address */ - notif->type == MSTDNT_NOTIFICATION_FOLLOW ? - notif->account->acct : - status_format ? status_format : "", - /* end */ - notif_stats ? notif_stats : ""); + struct notification_compact_template tdata = { + .avatar = notif->account->avatar, + .has_icon = strlen(type_svg) == 0 ? "" : "-with-icon", + .acct = notif->account->acct, + .display_name = notif->account->display_name, + .action = type_str, + .notif_svg = type_svg, + /* Might show follower address */ + .content = (notif->type == MSTDNT_NOTIFICATION_FOLLOW ? + notif->account->acct : status_format), + .stats = notif_stats + }; - if (size) *size = s; + notif_html = tmpl_gen_notification_compact(&tdata, size); if (status_format && status_format != notif->status->content) free(status_format); @@ -212,10 +204,13 @@ void content_notifications(struct session* ssn, mastodont_t* api, char** data) notif_html = construct_error(storage.error, E_NOTICE, 1, NULL); } - - easprintf(&page, data_notifications_page_html, - notif_html ? notif_html : "", - navigation_box ? navigation_box : ""); + + struct notifications_page_template tdata = { + .notifications = notif_html, + .navigation = navigation_box + }; + + page = tmpl_gen_notifications_page(&tdata, NULL); struct base_page b = { .category = BASE_CAT_NOTIFICATIONS, @@ -269,14 +264,18 @@ void content_notifications_compact(struct session* ssn, mastodont_t* api, char** notif_html = construct_error(storage.error, E_NOTICE, 1, NULL); } - - size_t len = easprintf(&page, data_notifications_embed_html, - ssn->config.theme, - ssn->config.themeclr ? "-dark" : "", - navigation_box ? navigation_box : "", - notif_html ? notif_html : ""); - render_html(page, len); + size_t len; + struct notifications_embed_template tdata = { + .theme = ssn->config.theme, + .theme_var = ssn->config.themeclr ? "-dark" : NULL, + .notifications = notif_html, + .navigation_box = navigation_box + }; + + page = tmpl_gen_notifications_embed(&tdata, &len); + + render_html(NULL, page, len); if (notif_html) free(notif_html); if (navigation_box) free(navigation_box); diff --git a/src/page_config.c b/src/page_config.c index 073d2d8..07da342 100644 --- a/src/page_config.c +++ b/src/page_config.c @@ -31,9 +31,9 @@ #include "l10n.h" // Pages -#include "../static/config_general.chtml" -#include "../static/config_appearance.chtml" -#include "../static/config_sidebar.chtml" +#include "../static/config_general.ctmpl" +#include "../static/config_appearance.ctmpl" +#include "../static/config_sidebar.ctmpl" #define bool_checked(key) (ssn->config.key ? "checked" : "") @@ -46,43 +46,40 @@ enum config_category static char* construct_config_sidebar(enum config_category cat, size_t* size) { - char* sidebar_html; - size_t s = easprintf(&sidebar_html, data_config_sidebar_html, - CAT_TEXT(cat, CONFIG_CAT_GENERAL), - config_url_prefix, - L10N[L10N_EN_US][L10N_GENERAL], - CAT_TEXT(cat, CONFIG_CAT_APPEARANCE), - config_url_prefix, - L10N[L10N_EN_US][L10N_APPEARANCE], - CAT_TEXT(cat, CONFIG_CAT_ACCOUNT), - config_url_prefix, - L10N[L10N_EN_US][L10N_ACCOUNT]); - if (size) *size = s; - return sidebar_html; + struct config_sidebar_template tdata = { + .prefix = config_url_prefix, + .general_active = CAT_TEXT(cat, CONFIG_CAT_GENERAL), + .general = L10N[L10N_EN_US][L10N_GENERAL], + .appearance_active = CAT_TEXT(cat, CONFIG_CAT_APPEARANCE), + .appearance = L10N[L10N_EN_US][L10N_APPEARANCE], + .account_active = CAT_TEXT(cat, CONFIG_CAT_ACCOUNT), + .account = L10N[L10N_EN_US][L10N_ACCOUNT], + }; + + return tmpl_gen_config_sidebar(&tdata, size); } void content_config_general(struct session* ssn, mastodont_t* api, char** data) { char* sidebar_html = construct_config_sidebar(CONFIG_CAT_GENERAL, NULL); - - char* general_page; - easprintf(&general_page, data_config_general_html, - bool_checked(js), - bool_checked(jsactions), - bool_checked(jsreply), - bool_checked(jslive), - bool_checked(stat_attachments), - bool_checked(stat_greentexts), - bool_checked(stat_dope), - bool_checked(stat_oneclicksoftware), - bool_checked(stat_emojo_likes), - bool_checked(stat_hide_muted), - bool_checked(instance_show_shoutbox), - bool_checked(instance_panel), - bool_checked(notif_embed)); + struct config_general_template tdata = { + .js_on = bool_checked(js), + .jsactions_on = bool_checked(jsactions), + .jsreply_on = bool_checked(jsreply), + .jslive_on = bool_checked(jslive), + .status_attachments_on = bool_checked(stat_attachments), + .status_greentexts_on = bool_checked(stat_greentexts), + .status_dopameme_on = bool_checked(stat_dope), + .status_oneclicksoftware_on = bool_checked(stat_oneclicksoftware), + .status_emojo_likes_on = bool_checked(stat_emojo_likes), + .status_hide_muted_on = bool_checked(stat_hide_muted), + .instance_show_shoutbox_on = bool_checked(instance_show_shoutbox), + .instance_panel_on = bool_checked(instance_panel), + .notifications_embed_on = bool_checked(notif_embed) + }; - load_config(ssn, api); + char* general_page = tmpl_gen_config_general(&tdata, NULL); struct base_page b = { .category = BASE_CAT_CONFIG, @@ -102,12 +99,10 @@ void content_config_appearance(struct session* ssn, mastodont_t* api, char** dat { char* sidebar_html = construct_config_sidebar(CONFIG_CAT_APPEARANCE, NULL); - load_config(ssn, api); - struct base_page b = { .category = BASE_CAT_CONFIG, .locale = L10N_EN_US, - .content = data_config_appearance_html, + .content = data_config_appearance, .sidebar_left = sidebar_html }; diff --git a/src/reply.c b/src/reply.c index 7d67b9e..d098876 100644 --- a/src/reply.c +++ b/src/reply.c @@ -24,7 +24,7 @@ #include "../config.h" // Pages -#include "../static/post.chtml" +#include "../static/post.ctmpl" #define ID_REPLY_SIZE 256 #define ID_RESPONSE "" @@ -40,12 +40,12 @@ char* construct_post_box(char* reply_id, snprintf(id_reply, ID_REPLY_SIZE, ID_RESPONSE, reply_id); // Construct box - size_t s = easprintf(&reply_html, data_post_html, - config_url_prefix, - reply_id ? id_reply : "", - default_content); - if (size) *size = s; - return reply_html; + struct post_template tdata = { + .prefix = config_url_prefix, + .reply_input = reply_id ? id_reply : NULL, + .content = default_content + }; + return tmpl_gen_post(&tdata, size); } /* Some comments: diff --git a/src/scrobble.c b/src/scrobble.c index c7dc554..6f09bea 100644 --- a/src/scrobble.c +++ b/src/scrobble.c @@ -20,29 +20,26 @@ #include "easprintf.h" #include "string_helpers.h" -#include "../static/scrobble.chtml" +#include "../static/scrobble.ctmpl" char* construct_scrobble(struct mstdnt_scrobble* scrobble, int* size) { - char* scrobble_html; - size_t s; + struct scrobble_template tdata = { + .scrobble_id = scrobble->id, + .avatar = scrobble->account.avatar, + .username = scrobble->account.display_name, + .activity = "is listening to...", + .title_key = "Title", + .title = scrobble->title, + .artist_key = "Artist", + .artist = scrobble->artist, + .album_key = "Album", + .album = scrobble->album, + .length_key = "Duration", + .length = scrobble->length + }; - s = easprintf(&scrobble_html, data_scrobble_html, - scrobble->id, - scrobble->account.avatar, - scrobble->account.display_name, - "is listening to...", - "Title", - scrobble->title, - "Artist", - scrobble->artist, - "Album", - scrobble->album, - "Duration", - scrobble->length); - - if (size) *size = s; - return scrobble_html; + return tmpl_gen_scrobble(&tdata, size); } static char* construct_scrobble_voidwrap(void* passed, size_t index, int* res) diff --git a/src/search.c b/src/search.c index 076c561..a70f4cc 100644 --- a/src/search.c +++ b/src/search.c @@ -29,25 +29,23 @@ #include "graphsnbars.h" // Pages -#include "../static/search.chtml" +#include "../static/search.ctmpl" void search_page(struct session* ssn, mastodont_t* api, enum search_tab tab, char* content) { char* out_data; - easprintf(&out_data, data_search_html, - config_url_prefix, - keystr(ssn->query.query), - MAKE_FOCUSED_IF(tab, SEARCH_STATUSES), - "Statuses", - config_url_prefix, - keystr(ssn->query.query), - MAKE_FOCUSED_IF(tab, SEARCH_ACCOUNTS), - "Accounts", - config_url_prefix, - keystr(ssn->query.query), - MAKE_FOCUSED_IF(tab, SEARCH_HASHTAGS), - "Hashtags", - content); + struct search_template tdata = { + .prefix = config_url_prefix, + .query = keystr(ssn->query.query), + .accounts_active = MAKE_FOCUSED_IF(tab, SEARCH_ACCOUNTS), + .accounts = "Accounts", + .hashtags_active = MAKE_FOCUSED_IF(tab, SEARCH_HASHTAGS), + .hashtags = "Hashtags", + .statuses_active = MAKE_FOCUSED_IF(tab, SEARCH_STATUSES), + .statuses = "Statuses", + .results = content + }; + out_data = tmpl_gen_search(&tdata, NULL); struct base_page b = { .category = BASE_CAT_NONE, diff --git a/src/status.c b/src/status.c index dbb2dec..63c49b6 100644 --- a/src/status.c +++ b/src/status.c @@ -37,15 +37,15 @@ // Pages #include "../static/status.ctmpl" -#include "../static/notification.chtml" -#include "../static/in_reply_to.chtml" -#include "../static/status_interactions_label.chtml" -#include "../static/status_interactions.chtml" -#include "../static/status_interaction_profile.chtml" -#include "../static/likeboost.chtml" -#include "../static/reactions_btn.chtml" +#include "../static/notification.ctmpl" +#include "../static/in_reply_to.ctmpl" +#include "../static/status_interactions_label.ctmpl" +#include "../static/status_interactions.ctmpl" +#include "../static/status_interaction_profile.ctmpl" +#include "../static/likeboost.ctmpl" +#include "../static/reactions_btn.ctmpl" #include "../static/interaction_buttons.ctmpl" -#include "../static/menu_item.chtml" +#include "../static/menu_item.ctmpl" #define ACCOUNT_INTERACTIONS_LIMIT 11 #define NUM_STR "%u" @@ -170,12 +170,11 @@ int try_interact_status(struct session* ssn, mastodont_t* api, char* id) char* construct_status_interactions_label(char* header, int val, size_t* size) { - char* html; - size_t s; - s = easprintf(&html, data_status_interactions_label_html, - header, val); - if (size) *size = s; - return html; + struct status_interactions_label_template tdata = { + .header = header, + .value = val, + }; + return tmpl_gen_status_interactions_label(&tdata, size); } char* construct_interaction_buttons(struct session* ssn, @@ -201,11 +200,12 @@ char* construct_interaction_buttons(struct session* ssn, emoji_picker_html = construct_emoji_picker(status->id, keyint(ssn->post.emojoindex), NULL); } - easprintf(&reactions_btn_html, data_reactions_btn_html, - config_url_prefix, - status->id, - status->id, - emoji_picker_html ? emoji_picker_html : ""); + struct reactions_btn_template tdata = { + .prefix = config_url_prefix, + .status_id = status->id, + .emoji_picker = emoji_picker_html + }; + reactions_btn_html = tmpl_gen_reactions_btn(&tdata, NULL); if (show_nums) { @@ -217,10 +217,11 @@ char* construct_interaction_buttons(struct session* ssn, easprintf(&favourites_count, NUM_STR, status->favourites_count); } - easprintf(&likeboost_html, data_likeboost_html, - config_url_prefix, - status->id); - + struct likeboost_template lbdata = { + .prefix = config_url_prefix, + .status_id = status->id, + }; + time_str = reltime_to_str(status->created_at); struct interaction_buttons_template data = { @@ -239,8 +240,8 @@ char* construct_interaction_buttons(struct session* ssn, ssn->config.stat_oneclicksoftware && (flags & STATUS_NO_LIKEBOOST) != STATUS_NO_LIKEBOOST ? likeboost_html : ""), .reactions_btn = reactions_btn_html, - .rel_tilm = time_str - } + .rel_time = time_str + }; interaction_html = tmpl_gen_interaction_buttons(&data, size); @@ -273,19 +274,19 @@ char* construct_status_interactions(int fav_count, reblog_accounts_len, fav_accounts_len, NULL); - size_t s; - s = easprintf(&html, data_status_interactions_html, - reblogs_label ? reblogs_label : "", - favourites_label ? favourites_label : "", - profiles ? profiles : ""); - if (size) *size = s; + struct status_interactions_template tdata = { + .favourites_count = favourites_label, + .reblogs_count = reblogs_label, + .users = profiles + }; + html = tmpl_gen_status_interactions(&tdata, size); if (reblogs_label) free(reblogs_label); if (favourites_label) free(favourites_label); if (profiles) free(profiles); return html; } -char* construct_status_interaction_profile(struct interact_profile_args* args, size_t index, int* size) +char* construct_status_interaction_profile(struct interact_profile_args* args, size_t index, size_t* size) { size_t s = 0; // Might change @@ -312,14 +313,19 @@ char* construct_status_interaction_profile(struct interact_profile_args* args, s // Usually means no reblogs if check_type is NULL if (check_type) - s = easprintf(&profile_html, data_status_interaction_profile_html, - check_type[index].acct, check_type[index].avatar); + { + struct status_interaction_profile_template tdata = { + .acct = check_type[index].acct, + .avatar = check_type[index].avatar + }; + profile_html = tmpl_gen_status_interaction_profile(&tdata, &s); + } if (size) *size = s; return profile_html; } -static char* construct_status_interaction_profiles_voidwrap(void* passed, size_t index, int* res) +static char* construct_status_interaction_profiles_voidwrap(void* passed, size_t index, size_t* res) { struct interact_profile_args* args = passed; return construct_status_interaction_profile(args, index, res); @@ -368,18 +374,14 @@ char* construct_in_reply_to(struct mstdnt_status* status, struct mstdnt_account* account, size_t* size) { - char* irt_html; - size_t s; - - s = easprintf(&irt_html, data_in_reply_to_html, - config_url_prefix, - status->in_reply_to_id, - L10N[L10N_EN_US][L10N_IN_REPLY_TO], - account ? account->acct : status->in_reply_to_id); - - if (size) *size = s; + struct in_reply_to_template tdata = { + .prefix = config_url_prefix, + .in_reply_to_text = L10N[L10N_EN_US][L10N_IN_REPLY_TO], + .acct = account ? account->acct : status->in_reply_to_id, + .status_id = status->in_reply_to_id + }; - return irt_html; + return tmpl_gen_in_reply_to(&tdata, size); } #define REGEX_GREENTEXT "((?:^|
|\\s)>.*?)(?:
|$)" @@ -464,7 +466,7 @@ char* greentextify(char* content) char* construct_status(struct session* ssn, mastodont_t* api, struct mstdnt_status* local_status, - int* size, + size_t* size, struct mstdnt_notification* local_notif, struct construct_statuses_args* args, uint8_t flags) @@ -558,21 +560,30 @@ char* construct_status(struct session* ssn, // Delete status menu item, logged in only if (ssn->logged_in && strcmp(status->account.acct, ssn->acct.acct) == 0) - easprintf(&delete_status, data_menu_item_html, - config_url_prefix, status->id, "delete", "Delete status"); + { + struct menu_item_template mdata = { + .prefix = config_url_prefix, + .status_id = status->id, + .itype = "delete", + .text = "Delete status" + }; + delete_status = tmpl_gen_menu_item(&mdata, NULL); + } if (status->media_attachments_len) attachments = construct_attachments(ssn, status->sensitive, status->media_attachments, status->media_attachments_len, NULL); if (status->pleroma.emoji_reactions_len) emoji_reactions = construct_emoji_reactions(status->id, status->pleroma.emoji_reactions, status->pleroma.emoji_reactions_len, NULL); if (notif && notif->type != MSTDNT_NOTIFICATION_MENTION) - easprintf(¬if_info, data_notification_html, - notif->account->avatar, - notif->account->display_name, - // Use compact type string, which looks better - // for self-boosts - local_status->reblog ? notification_type_compact_str(notif->type) : notification_type_str(notif->type), - notification_type_svg(notif->type)); + { + struct notification_template tdata = { + .avatar = notif->account->avatar, + .username = notif->account->display_name, + .action = (local_status->reblog ? notification_type_compact_str(notif->type) : notification_type_str(notif->type)), + .action_item = notification_type_svg(notif->type), + }; + notif_info = tmpl_gen_notification(&tdata, NULL); + } if (status->in_reply_to_id && status->in_reply_to_account_id) in_reply_to_str = get_in_reply_to(api, status, NULL); @@ -592,7 +603,7 @@ char* construct_status(struct session* ssn, .unpin = status->pinned ? "un" : "", .unpin_btn = status->pinned ? "Unpin" : "Pin", .unbookmark = status->bookmarked ? "un" : "", - .unbookmark_btn = status->bookmarked ? "Remove Bookmark" : "Bookmark" + .unbookmark_btn = status->bookmarked ? "Remove Bookmark" : "Bookmark", .delete_status = delete_status, .in_reply_to_str = in_reply_to_str, .status_content = parse_content, @@ -619,7 +630,7 @@ char* construct_status(struct session* ssn, return stat_html; } -static char* construct_status_voidwrap(void* passed, size_t index, int* res) +static char* construct_status_voidwrap(void* passed, size_t index, size_t* res) { struct status_args* args = passed; return construct_status(args->ssn, args->api, args->status + index, res, NULL, args->args, 0); diff --git a/src/status.h b/src/status.h index def4168..2401c33 100644 --- a/src/status.h +++ b/src/status.h @@ -55,7 +55,7 @@ char* construct_post_box(char* reply_id, char* construct_status(struct session* ssn, mastodont_t* api, struct mstdnt_status* status, - int* size, + size_t* size, struct mstdnt_notification* notif, struct construct_statuses_args* args, uint8_t flags); @@ -88,7 +88,7 @@ char* construct_status_interaction_profiles(struct mstdnt_account* reblogs, size_t reblogs_len, size_t favourites_len, size_t* ret_size); -char* construct_status_interaction_profile(struct interact_profile_args* args, size_t index, int* size); +char* construct_status_interaction_profile(struct interact_profile_args* args, size_t index, size_t* size); char* construct_status_interactions_label(char* header, int val, size_t* size); char* reformat_status(struct session* ssn, char* content, diff --git a/src/string_helpers.c b/src/string_helpers.c index 0640d93..5819627 100644 --- a/src/string_helpers.c +++ b/src/string_helpers.c @@ -22,7 +22,7 @@ #include "string_helpers.h" #include "easprintf.h" -char* construct_func_strings(char* (*func)(void*, size_t, int*), +char* construct_func_strings(char* (*func)(void*, size_t, size_t*), void* strings, size_t strings_len, size_t* ret_size) diff --git a/src/string_helpers.h b/src/string_helpers.h index d5b8f92..89b3654 100644 --- a/src/string_helpers.h +++ b/src/string_helpers.h @@ -26,7 +26,6 @@ #define ACTIVE_CONDITION(cond) ((cond) ? "active" : "") #define CAT_TEXT(cat, cfg_cat) (((cat) == (cfg_cat)) ? "active" : "") - /** * Constructs a string based on a function * @@ -38,7 +37,7 @@ * results * @return The result, this MUST be free'd when finished and checked for NULL. */ -char* construct_func_strings(char* (*func)(void*, size_t, int*), +char* construct_func_strings(char* (*func)(void*, size_t, size_t*), void* strings, size_t strings_len, size_t* ret_size); diff --git a/src/template/main.c b/src/template/main.c index 9a1f61b..97219bc 100644 --- a/src/template/main.c +++ b/src/template/main.c @@ -159,6 +159,7 @@ void print_template(char* var, char* buf) printf("#ifndef __%s\n" "#define __%s\n" + "#include \n" "static const char data_%s[] = {", var, var, var); while (1) @@ -224,27 +225,34 @@ void print_template(char* var, char* buf) { printf("%s %s;\n", tkn_typetostr(tokens[i].type), tokens[i].token); if (tokens[i].type == TMPL_STRLEN) - printf("unsigned %s_len;\n", tokens[i].token); + printf("size_t %s_len;\n", tokens[i].token); tokens[i].used = 1; } } // Generate function - printf("};\n" - "char* tmpl_gen_%s(struct %s_template* data, unsigned* size){\n" - "char* ret;\n" - "unsigned s = easprintf(&ret, data_%s, ", var, var, var); + printf("};\n"); + printf("char* tmpl_gen_%s(struct %s_template* data, size_t* size);", var, var); + + // Pipe the contents of the real function code into stderr, then we can redirect it + // We could also just write the file directly but this works better with the Makefile + // and I am lazy + fprintf(stderr, "#include \"%s.ctmpl\"\n" + "#include \"../src/easprintf.h\"\n" + "char* tmpl_gen_%s(struct %s_template* data, size_t* size){\n" + "char* ret;\n" + "size_t s = easprintf(&ret, data_%s, ", var, var, var, var); for (size_t i = 0; i < tokens_len; ++i) { - printf("data->%s", tokens[i].token); + fprintf(stderr, "data->%s", tokens[i].token); // No (null) strings, make them empty if (tokens[i].type == TMPL_STR || tokens[i].type == TMPL_STRLEN) - printf("?data->%s:\"\"", tokens[i].token); - fputs(i < tokens_len-1 ? ", " : "", stdout); + fprintf(stderr, "?data->%s:\"\"", tokens[i].token); + fputs(i < tokens_len-1 ? ", " : "", stderr); } fputs(");\n" "if (size) *size = s;\n" - "return ret;\n}", stdout); + "return ret;\n}", stderr); } // Done! diff --git a/src/test.c b/src/test.c index 07a8310..9fe163e 100644 --- a/src/test.c +++ b/src/test.c @@ -24,7 +24,7 @@ #include "easprintf.h" // Pages -#include "../static/test.chtml" +#include "../static/test.ctmpl" #define ENV_NOT_FOUND "ENV Not Found" @@ -56,16 +56,17 @@ void content_test(struct session* ssn, mastodont_t* api, char** data) }; char* page; - easprintf(&page, - data_test_html, - ENV_TBL_GET(ENV_HTTP_COOKIE), - ENV_TBL_GET(ENV_PATH_INFO), - ENV_TBL_GET(ENV_QUERY_STRING), - ENV_TBL_GET(ENV_REQUEST_METHOD), - ENV_TBL_GET(ENV_SCRIPT_NAME), - ENV_TBL_GET(ENV_HTTP_REFERER), - ENV_TBL_GET(ENV_HTTP_USER_AGENT), - ENV_TBL_GET(ENV_CONTENT_LENGTH)); + struct test_template tdata = { + .HTTP_COOKIE = ENV_TBL_GET(ENV_HTTP_COOKIE), + .PATH_INFO = ENV_TBL_GET(ENV_PATH_INFO), + .QUERY_STRING = ENV_TBL_GET(ENV_QUERY_STRING), + .REQUEST_METHOD = ENV_TBL_GET(ENV_REQUEST_METHOD), + .SCRIPT_NAME = ENV_TBL_GET(ENV_SCRIPT_NAME), + .HTTP_REFERER = ENV_TBL_GET(ENV_HTTP_REFERER), + .HTTP_USER_AGENT = ENV_TBL_GET(ENV_HTTP_USER_AGENT), + .CONTENT_LENGTH = ENV_TBL_GET(ENV_CONTENT_LENGTH) + }; + page = tmpl_gen_test(&tdata, NULL); struct base_page b = { .category = BASE_CAT_NONE, diff --git a/src/timeline.c b/src/timeline.c index deb4819..ac12b13 100644 --- a/src/timeline.c +++ b/src/timeline.c @@ -29,9 +29,9 @@ #include "error.h" #include "string_helpers.h" -#include "../static/navigation.chtml" -#include "../static/directs_page.chtml" -#include "../static/hashtag_page.chtml" +#include "../static/navigation.ctmpl" +#include "../static/directs_page.ctmpl" +#include "../static/hashtag_page.ctmpl" /* TODO Clean these up and make a meta function, i'm just lazy */ @@ -146,8 +146,11 @@ void tl_direct(struct session* ssn, mastodont_t* api) easprintf(&page, "%s%s", STR_NULL_EMPTY(status_format), STR_NULL_EMPTY(navigation_box)); - - easprintf(&output, data_directs_page_html, page); + + struct directs_page_template tdata = { + .direct_content = page, + }; + output = tmpl_gen_directs_page(&tdata, NULL); struct base_page b = { .category = BASE_CAT_DIRECT, @@ -213,6 +216,7 @@ void tl_public(struct session* ssn, mastodont_t* api, int local, enum base_categ statuses[status_count-1].id, NULL); } + easprintf(&output, "%s%s%s", post_box, STR_NULL_EMPTY(status_format), @@ -335,10 +339,14 @@ void tl_tag(struct session* ssn, mastodont_t* api, char* tag_id) statuses[status_count-1].id, NULL); } - easprintf(&output, data_hashtag_page_html, - tag_id, - STR_NULL_EMPTY(status_format), - STR_NULL_EMPTY(navigation_box)); + + struct hashtag_page_template tdata = { + .tag = tag_id, + .statuses = status_format, + .navigation = navigation_box + }; + + output = tmpl_gen_hashtag_page(&tdata, NULL); struct base_page b = { .category = BASE_CAT_NONE, diff --git a/src/type_string.c b/src/type_string.c index 7354bdc..24d20f7 100644 --- a/src/type_string.c +++ b/src/type_string.c @@ -19,9 +19,9 @@ #include "type_string.h" // Icons -#include "../static/like_svg.chtml" -#include "../static/repeat_svg.chtml" -#include "../static/follow_svg.chtml" +#include "../static/like_svg.ctmpl" +#include "../static/repeat_svg.ctmpl" +#include "../static/follow_svg.ctmpl" const char* notification_type_str(mstdnt_notification_t type) { @@ -56,10 +56,10 @@ const char* notification_type_svg(mstdnt_notification_t type) { switch (type) { - case MSTDNT_NOTIFICATION_FOLLOW: return data_follow_svg_html; + case MSTDNT_NOTIFICATION_FOLLOW: return data_follow_svg; case MSTDNT_NOTIFICATION_FOLLOW_REQUEST: return ""; - case MSTDNT_NOTIFICATION_REBLOG: return data_repeat_svg_html; - case MSTDNT_NOTIFICATION_FAVOURITE: return data_like_svg_html; + case MSTDNT_NOTIFICATION_REBLOG: return data_repeat_svg; + case MSTDNT_NOTIFICATION_FAVOURITE: return data_like_svg; case MSTDNT_NOTIFICATION_POLL: return ""; case MSTDNT_NOTIFICATION_EMOJI_REACT: return ""; default: return ""; diff --git a/static/about.ctmpl b/static/about.ctmpl index 7839488..378c10c 100644 --- a/static/about.ctmpl +++ b/static/about.ctmpl @@ -1,5 +1,6 @@ #ifndef __about #define __about +#include static const char data_about[] = {0X3C,0X64,0X69,0X76,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X73,0X69,0X6D,0X70,0X6C,0X65,0X2D,0X70,0X61,0X67,0X65,0X22,0X3E,0XA,0X20,0X20,0X3C,0X64,0X69,0X76,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X61,0X62,0X6F,0X75,0X74,0X2D,0X68,0X65,0X61,0X64,0X65,0X72,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X68,0X31,0X3E,0X3C,0X69,0X6D,0X67,0X20,0X69,0X64,0X3D,0X22,0X61,0X62,0X6F,0X75,0X74,0X2D,0X69,0X63,0X6F,0X6E,0X22,0X20,0X73,0X72,0X63,0X3D,0X22,0X2F,0X74,0X72,0X65,0X65,0X62,0X69,0X72,0X64,0X5F,0X6C,0X6F,0X67,0X6F,0X2E,0X70,0X6E,0X67,0X22,0X3E,0X20,0X3C,0X73,0X70,0X61,0X6E,0X3E,0X54,0X72,0X65,0X65,0X62,0X69,0X72,0X64,0X3C,0X2F,0X73,0X70,0X61,0X6E,0X3E,0X3C,0X2F,0X68,0X31,0X3E,0XA,0X20,0X20,0X3C,0X2F,0X64,0X69,0X76,0X3E,0XA,0X20,0X20,0X3C,0X64,0X69,0X76,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X61,0X62,0X6F,0X75,0X74,0X2D,0X63,0X6F,0X6E,0X74,0X65,0X6E,0X74,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X70,0X3E,0X54,0X72,0X65,0X65,0X62,0X69,0X72,0X64,0X20,0X69,0X73,0X20,0X61,0X20,0X50,0X6C,0X65,0X72,0X6F,0X6D,0X61,0X20,0X66,0X72,0X6F,0X6E,0X74,0X65,0X6E,0X64,0X20,0X74,0X68,0X61,0X74,0X20,0X74,0X72,0X69,0X65,0X73,0X20,0X74,0X6F,0X20,0X62,0X65,0X20,0X6C,0X69,0X67,0X68,0X74,0X77,0X65,0X69,0X67,0X68,0X74,0X2C,0X20,0X65,0X66,0X66,0X69,0X63,0X69,0X65,0X6E,0X74,0X2C,0X20,0X61,0X6E,0X64,0X20,0X74,0X72,0X75,0X65,0X20,0X74,0X6F,0X20,0X74,0X68,0X65,0X20,0X77,0X65,0X62,0X2E,0X20,0X49,0X74,0X27,0X73,0X20,0X77,0X72,0X69,0X74,0X74,0X65,0X6E,0X20,0X69,0X6E,0X20,0X43,0X20,0X66,0X6F,0X72,0X20,0X6E,0X6F,0X20,0X70,0X61,0X72,0X74,0X69,0X63,0X75,0X6C,0X61,0X72,0X20,0X72,0X65,0X61,0X73,0X6F,0X6E,0X2C,0X20,0X62,0X75,0X74,0X20,0X69,0X74,0X20,0X68,0X61,0X73,0X20,0X61,0X6E,0X20,0X6F,0X70,0X65,0X6E,0X20,0X62,0X61,0X73,0X65,0X20,0X66,0X6F,0X72,0X20,0X63,0X6F,0X6E,0X74,0X72,0X69,0X62,0X75,0X74,0X69,0X6F,0X6E,0X73,0X2E,0X20,0X49,0X74,0X20,0X69,0X73,0X20,0X76,0X65,0X72,0X79,0X20,0X74,0X69,0X67,0X68,0X74,0X20,0X74,0X6F,0X20,0X74,0X68,0X65,0X20,0X70,0X68,0X69,0X6C,0X6F,0X73,0X6F,0X70,0X68,0X79,0X20,0X6F,0X66,0X20,0X68,0X6F,0X77,0X20,0X74,0X68,0X65,0X20,0X69,0X6E,0X74,0X65,0X72,0X6E,0X65,0X74,0X20,0X68,0X61,0X73,0X20,0X61,0X6C,0X77,0X61,0X79,0X73,0X20,0X77,0X6F,0X72,0X6B,0X65,0X64,0X2C,0X20,0X77,0X68,0X69,0X6C,0X65,0X20,0X73,0X74,0X69,0X6C,0X6C,0X20,0X62,0X65,0X69,0X6E,0X67,0X20,0X73,0X69,0X6D,0X70,0X6C,0X65,0X20,0X65,0X6E,0X6F,0X75,0X67,0X68,0X20,0X74,0X68,0X61,0X74,0X20,0X61,0X6E,0X79,0X6F,0X6E,0X65,0X20,0X63,0X61,0X6E,0X20,0X75,0X73,0X65,0X20,0X69,0X74,0X2E,0X3C,0X2F,0X70,0X3E,0XA,0XA,0X20,0X20,0X20,0X20,0X3C,0X70,0X3E,0X54,0X72,0X65,0X65,0X62,0X69,0X72,0X64,0X20,0X77,0X61,0X73,0X20,0X63,0X72,0X65,0X61,0X74,0X65,0X64,0X20,0X69,0X6E,0X20,0X72,0X65,0X73,0X70,0X6F,0X6E,0X73,0X65,0X20,0X74,0X6F,0X20,0X50,0X6C,0X65,0X72,0X6F,0X6D,0X61,0X46,0X45,0X20,0X62,0X65,0X69,0X6E,0X67,0X20,0X73,0X6C,0X6F,0X77,0X20,0X61,0X6E,0X64,0X20,0X62,0X65,0X69,0X6E,0X67,0X20,0X62,0X75,0X67,0X67,0X79,0X2E,0X20,0X54,0X72,0X65,0X65,0X62,0X69,0X72,0X64,0X20,0X72,0X65,0X73,0X65,0X6D,0X62,0X6C,0X65,0X73,0X20,0X47,0X4E,0X55,0X20,0X53,0X6F,0X63,0X69,0X61,0X6C,0X20,0X69,0X6E,0X20,0X61,0X70,0X70,0X65,0X61,0X72,0X61,0X6E,0X63,0X65,0X20,0X62,0X79,0X20,0X64,0X65,0X66,0X61,0X75,0X6C,0X74,0X2C,0X20,0X62,0X75,0X74,0X20,0X6B,0X65,0X65,0X70,0X73,0X20,0X74,0X68,0X65,0X20,0X66,0X61,0X6D,0X69,0X6C,0X69,0X61,0X72,0X69,0X74,0X79,0X20,0X74,0X68,0X61,0X74,0X20,0X6D,0X61,0X6E,0X79,0X20,0X61,0X72,0X65,0X20,0X75,0X73,0X65,0X64,0X20,0X74,0X6F,0X20,0X6F,0X66,0X20,0X50,0X6C,0X65,0X72,0X6F,0X6D,0X61,0X46,0X45,0X2E,0X3C,0X2F,0X70,0X3E,0XA,0XA,0X20,0X20,0X20,0X20,0X3C,0X70,0X3E,0X54,0X72,0X65,0X65,0X62,0X69,0X72,0X64,0X20,0X77,0X61,0X73,0X20,0X63,0X72,0X65,0X61,0X74,0X65,0X64,0X20,0X62,0X79,0X20,0X3C,0X61,0X20,0X68,0X72,0X65,0X66,0X3D,0X22,0X2F,0X40,0X6E,0X65,0X6B,0X6F,0X62,0X69,0X74,0X40,0X72,0X64,0X72,0X61,0X6D,0X61,0X2E,0X63,0X63,0X22,0X3E,0X4E,0X65,0X6B,0X6F,0X62,0X69,0X74,0X3C,0X2F,0X61,0X3E,0X2C,0X20,0X77,0X68,0X6F,0X20,0X63,0X72,0X65,0X61,0X74,0X65,0X64,0X20,0X3C,0X61,0X20,0X68,0X72,0X65,0X66,0X3D,0X22,0X68,0X74,0X74,0X70,0X73,0X3A,0X2F,0X2F,0X66,0X6F,0X73,0X73,0X69,0X6C,0X2E,0X6E,0X65,0X6B,0X6F,0X62,0X69,0X74,0X2E,0X6E,0X65,0X74,0X2F,0X6D,0X61,0X73,0X74,0X6F,0X64,0X6F,0X6E,0X74,0X2D,0X63,0X2F,0X68,0X6F,0X6D,0X65,0X22,0X3E,0X6D,0X61,0X73,0X74,0X6F,0X64,0X6F,0X6E,0X74,0X2D,0X63,0X3C,0X2F,0X61,0X3E,0X2C,0X20,0X61,0X20,0X6C,0X69,0X62,0X72,0X61,0X72,0X79,0X20,0X74,0X68,0X61,0X74,0X20,0X63,0X61,0X6E,0X20,0X63,0X6F,0X6D,0X6D,0X75,0X6E,0X69,0X63,0X61,0X74,0X65,0X20,0X77,0X69,0X74,0X68,0X20,0X52,0X65,0X76,0X6F,0X6C,0X76,0X65,0X72,0X27,0X73,0X2C,0X20,0X50,0X6C,0X65,0X72,0X6F,0X6D,0X61,0X27,0X73,0X2C,0X20,0X61,0X6E,0X64,0X20,0X4D,0X61,0X73,0X74,0X6F,0X64,0X6F,0X6E,0X27,0X73,0X20,0X52,0X45,0X53,0X54,0X20,0X41,0X50,0X49,0X73,0X2E,0X3C,0X2F,0X70,0X3E,0XA,0XA,0X20,0X20,0X20,0X20,0X3C,0X68,0X33,0X3E,0X4F,0X74,0X68,0X65,0X72,0X20,0X63,0X6F,0X6E,0X74,0X72,0X69,0X62,0X75,0X74,0X6F,0X72,0X73,0X3C,0X2F,0X68,0X33,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X75,0X6C,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X6C,0X69,0X3E,0X3C,0X61,0X20,0X68,0X72,0X65,0X66,0X3D,0X22,0X2F,0X40,0X67,0X72,0X75,0X6D,0X62,0X75,0X6C,0X6F,0X6E,0X40,0X66,0X72,0X65,0X65,0X63,0X75,0X6D,0X65,0X78,0X74,0X72,0X65,0X6D,0X69,0X73,0X74,0X2E,0X63,0X6F,0X6D,0X22,0X20,0X61,0X6C,0X74,0X3D,0X22,0X48,0X65,0X6C,0X70,0X65,0X64,0X20,0X77,0X69,0X74,0X68,0X20,0X74,0X68,0X65,0X20,0X6F,0X72,0X69,0X67,0X69,0X6E,0X61,0X6C,0X20,0X64,0X61,0X72,0X6B,0X20,0X74,0X68,0X65,0X6D,0X65,0X2C,0X20,0X61,0X6E,0X64,0X20,0X63,0X72,0X65,0X61,0X74,0X65,0X64,0X20,0X74,0X68,0X65,0X20,0X6F,0X72,0X69,0X67,0X69,0X6E,0X61,0X6C,0X20,0X74,0X72,0X65,0X65,0X62,0X69,0X72,0X64,0X2E,0X64,0X65,0X76,0X20,0X77,0X65,0X62,0X73,0X69,0X74,0X65,0X22,0X3E,0X47,0X72,0X75,0X6D,0X62,0X75,0X6C,0X6F,0X6E,0X3C,0X2F,0X61,0X3E,0X3C,0X2F,0X6C,0X69,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X6C,0X69,0X3E,0X3C,0X61,0X20,0X68,0X72,0X65,0X66,0X3D,0X22,0X2F,0X40,0X63,0X6F,0X79,0X6F,0X74,0X65,0X40,0X70,0X6C,0X2E,0X6C,0X61,0X69,0X6E,0X2E,0X73,0X68,0X22,0X20,0X61,0X6C,0X74,0X3D,0X22,0X43,0X72,0X65,0X61,0X74,0X65,0X64,0X20,0X53,0X6F,0X6C,0X61,0X72,0X69,0X7A,0X65,0X64,0X20,0X74,0X68,0X65,0X6D,0X65,0X73,0X20,0X66,0X6F,0X72,0X20,0X54,0X72,0X65,0X65,0X62,0X69,0X72,0X64,0X22,0X3E,0X43,0X6F,0X79,0X6F,0X74,0X65,0X3C,0X2F,0X61,0X3E,0X3C,0X2F,0X6C,0X69,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X6C,0X69,0X3E,0X3C,0X61,0X20,0X68,0X72,0X65,0X66,0X3D,0X22,0X2F,0X40,0X6B,0X68,0X61,0X6E,0X40,0X73,0X6C,0X65,0X65,0X70,0X79,0X2E,0X63,0X61,0X66,0X65,0X22,0X20,0X61,0X6C,0X74,0X3D,0X22,0X53,0X74,0X61,0X72,0X74,0X65,0X64,0X20,0X69,0X64,0X65,0X61,0X20,0X6F,0X66,0X20,0X74,0X72,0X65,0X65,0X62,0X69,0X72,0X64,0X22,0X3E,0X4B,0X68,0X61,0X6E,0X3C,0X2F,0X61,0X3E,0X3C,0X2F,0X6C,0X69,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X6C,0X69,0X3E,0X3C,0X61,0X20,0X68,0X72,0X65,0X66,0X3D,0X22,0X2F,0X40,0X73,0X61,0X6D,0X40,0X66,0X72,0X6F,0X74,0X68,0X2E,0X7A,0X6F,0X6E,0X65,0X22,0X20,0X61,0X6C,0X74,0X3D,0X22,0X54,0X65,0X73,0X74,0X69,0X6E,0X67,0X20,0X77,0X69,0X74,0X68,0X20,0X4E,0X67,0X69,0X6E,0X78,0X20,0X61,0X6E,0X64,0X20,0X64,0X6F,0X63,0X75,0X6D,0X65,0X6E,0X74,0X61,0X74,0X69,0X6F,0X6E,0X22,0X3E,0X53,0X61,0X6D,0X54,0X68,0X65,0X72,0X61,0X70,0X79,0X3C,0X2F,0X61,0X3E,0X3C,0X2F,0X6C,0X69,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X2F,0X75,0X6C,0X3E,0XA,0XA,0X20,0X20,0X20,0X20,0X3C,0X70,0X3E,0X54,0X72,0X65,0X65,0X62,0X69,0X72,0X64,0X20,0X69,0X73,0X20,0X6C,0X69,0X63,0X65,0X6E,0X73,0X65,0X64,0X20,0X69,0X6E,0X20,0X41,0X47,0X50,0X4C,0X76,0X33,0X2C,0X20,0X61,0X6E,0X64,0X20,0X6D,0X61,0X73,0X74,0X6F,0X64,0X6F,0X6E,0X74,0X2D,0X63,0X20,0X69,0X73,0X20,0X4C,0X47,0X50,0X4C,0X76,0X33,0X20,0X6C,0X69,0X63,0X65,0X6E,0X73,0X65,0X64,0X2E,0X20,0X4F,0X74,0X68,0X65,0X72,0X20,0X6C,0X69,0X63,0X65,0X6E,0X73,0X65,0X73,0X20,0X61,0X70,0X70,0X6C,0X79,0X20,0X74,0X6F,0X20,0X6C,0X69,0X62,0X72,0X61,0X72,0X69,0X65,0X73,0X20,0X61,0X73,0X20,0X77,0X65,0X6C,0X6C,0X2E,0X20,0X3C,0X61,0X20,0X68,0X72,0X65,0X66,0X3D,0X22,0X2F,0X61,0X62,0X6F,0X75,0X74,0X2F,0X6C,0X69,0X63,0X65,0X6E,0X73,0X65,0X22,0X3E,0X56,0X69,0X65,0X77,0X20,0X74,0X68,0X65,0X20,0X41,0X47,0X50,0X4C,0X76,0X33,0X20,0X6C,0X69,0X63,0X65,0X6E,0X73,0X65,0X20,0X68,0X65,0X72,0X65,0X2E,0X3C,0X2F,0X61,0X3E,0X3C,0X2F,0X70,0X3E,0XA,0XA,0X20,0X20,0X20,0X20,0X3C,0X61,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X62,0X74,0X6E,0X20,0X62,0X74,0X6E,0X2D,0X73,0X69,0X6E,0X67,0X6C,0X65,0X22,0X20,0X68,0X72,0X65,0X66,0X3D,0X22,0X68,0X74,0X74,0X70,0X73,0X3A,0X2F,0X2F,0X66,0X6F,0X73,0X73,0X69,0X6C,0X2E,0X6E,0X65,0X6B,0X6F,0X62,0X69,0X74,0X2E,0X6E,0X65,0X74,0X2F,0X74,0X72,0X65,0X65,0X62,0X69,0X72,0X64,0X2F,0X68,0X6F,0X6D,0X65,0X22,0X3E,0X56,0X69,0X65,0X77,0X20,0X74,0X68,0X65,0X20,0X46,0X6F,0X73,0X73,0X69,0X6C,0X20,0X52,0X65,0X70,0X6F,0X73,0X69,0X74,0X6F,0X72,0X79,0X3C,0X2F,0X61,0X3E,0X20,0X3C,0X61,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X62,0X74,0X6E,0X20,0X62,0X74,0X6E,0X2D,0X73,0X69,0X6E,0X67,0X6C,0X65,0X22,0X20,0X68,0X72,0X65,0X66,0X3D,0X22,0X2F,0X61,0X62,0X6F,0X75,0X74,0X2F,0X6C,0X69,0X63,0X65,0X6E,0X73,0X65,0X22,0X3E,0X56,0X69,0X65,0X77,0X20,0X74,0X68,0X65,0X20,0X4C,0X69,0X63,0X65,0X6E,0X73,0X65,0X3C,0X2F,0X61,0X3E,0XA,0X20,0X20,0X3C,0X2F,0X64,0X69,0X76,0X3E,0XA,0X3C,0X2F,0X64,0X69,0X76,0X3E,0}; #endif diff --git a/static/account.ctmpl b/static/account.ctmpl index daf5186..bb16195 100644 --- a/static/account.ctmpl +++ b/static/account.ctmpl @@ -1,5 +1,6 @@ #ifndef __account #define __account +#include static const char data_account[] = {0X25,0X73,0XA,0X3C,0X64,0X69,0X76,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X61,0X63,0X63,0X6F,0X75,0X6E,0X74,0X22,0X3E,0XA,0X20,0X20,0X3C,0X64,0X69,0X76,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X61,0X63,0X63,0X74,0X2D,0X62,0X61,0X6E,0X6E,0X65,0X72,0X22,0X20,0X73,0X74,0X79,0X6C,0X65,0X3D,0X22,0X62,0X61,0X63,0X6B,0X67,0X72,0X6F,0X75,0X6E,0X64,0X2D,0X69,0X6D,0X61,0X67,0X65,0X3A,0X75,0X72,0X6C,0X28,0X27,0X25,0X73,0X27,0X29,0X3B,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X25,0X73,0XA,0X20,0X20,0X20,0X20,0X3C,0X64,0X69,0X76,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X61,0X63,0X63,0X74,0X2D,0X69,0X6E,0X66,0X6F,0X2D,0X64,0X61,0X74,0X61,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X73,0X70,0X61,0X6E,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X61,0X63,0X63,0X74,0X2D,0X64,0X69,0X73,0X70,0X6C,0X61,0X79,0X6E,0X61,0X6D,0X65,0X22,0X3E,0X25,0X73,0X3C,0X2F,0X73,0X70,0X61,0X6E,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X73,0X70,0X61,0X6E,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X61,0X63,0X63,0X74,0X2D,0X75,0X73,0X65,0X72,0X6E,0X61,0X6D,0X65,0X22,0X3E,0X25,0X73,0X3C,0X2F,0X73,0X70,0X61,0X6E,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X2F,0X64,0X69,0X76,0X3E,0XA,0XA,0X20,0X20,0X20,0X20,0X3C,0X73,0X70,0X61,0X6E,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X6D,0X65,0X6E,0X75,0X2D,0X63,0X6F,0X6E,0X74,0X61,0X69,0X6E,0X65,0X72,0X20,0X75,0X73,0X65,0X72,0X2D,0X6F,0X70,0X74,0X69,0X6F,0X6E,0X73,0X2D,0X62,0X74,0X6E,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X4D,0X65,0X6E,0X75,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X64,0X69,0X76,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X6D,0X65,0X6E,0X75,0X20,0X6D,0X65,0X6E,0X75,0X2D,0X6F,0X70,0X74,0X69,0X6F,0X6E,0X73,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X75,0X6C,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X6C,0X69,0X3E,0X3C,0X61,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X6E,0X6F,0X6C,0X69,0X6E,0X6B,0X22,0X20,0X68,0X72,0X65,0X66,0X3D,0X22,0X25,0X73,0X2F,0X75,0X73,0X65,0X72,0X2F,0X25,0X73,0X2F,0X61,0X63,0X74,0X69,0X6F,0X6E,0X2F,0X25,0X73,0X73,0X75,0X62,0X73,0X63,0X72,0X69,0X62,0X65,0X22,0X3E,0X3C,0X69,0X6E,0X70,0X75,0X74,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X62,0X74,0X6E,0X2D,0X6D,0X65,0X6E,0X75,0X22,0X20,0X74,0X79,0X70,0X65,0X3D,0X22,0X62,0X75,0X74,0X74,0X6F,0X6E,0X22,0X20,0X76,0X61,0X6C,0X75,0X65,0X3D,0X22,0X25,0X73,0X22,0X3E,0X3C,0X2F,0X61,0X3E,0X3C,0X2F,0X6C,0X69,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X6C,0X69,0X3E,0X3C,0X61,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X6E,0X6F,0X6C,0X69,0X6E,0X6B,0X22,0X20,0X68,0X72,0X65,0X66,0X3D,0X22,0X25,0X73,0X2F,0X75,0X73,0X65,0X72,0X2F,0X25,0X73,0X2F,0X61,0X63,0X74,0X69,0X6F,0X6E,0X2F,0X25,0X73,0X62,0X6C,0X6F,0X63,0X6B,0X22,0X3E,0X3C,0X69,0X6E,0X70,0X75,0X74,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X62,0X74,0X6E,0X2D,0X6D,0X65,0X6E,0X75,0X22,0X20,0X74,0X79,0X70,0X65,0X3D,0X22,0X62,0X75,0X74,0X74,0X6F,0X6E,0X22,0X20,0X76,0X61,0X6C,0X75,0X65,0X3D,0X22,0X25,0X73,0X22,0X3E,0X3C,0X2F,0X61,0X3E,0X3C,0X2F,0X6C,0X69,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X6C,0X69,0X3E,0X3C,0X61,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X6E,0X6F,0X6C,0X69,0X6E,0X6B,0X22,0X20,0X68,0X72,0X65,0X66,0X3D,0X22,0X25,0X73,0X2F,0X75,0X73,0X65,0X72,0X2F,0X25,0X73,0X2F,0X61,0X63,0X74,0X69,0X6F,0X6E,0X2F,0X25,0X73,0X6D,0X75,0X74,0X65,0X22,0X3E,0X3C,0X69,0X6E,0X70,0X75,0X74,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X62,0X74,0X6E,0X2D,0X6D,0X65,0X6E,0X75,0X22,0X20,0X74,0X79,0X70,0X65,0X3D,0X22,0X62,0X75,0X74,0X74,0X6F,0X6E,0X22,0X20,0X76,0X61,0X6C,0X75,0X65,0X3D,0X22,0X25,0X73,0X22,0X3E,0X3C,0X2F,0X61,0X3E,0X3C,0X2F,0X6C,0X69,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X2F,0X75,0X6C,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X2F,0X64,0X69,0X76,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X2F,0X73,0X70,0X61,0X6E,0X3E,0XA,0X20,0X20,0X3C,0X2F,0X64,0X69,0X76,0X3E,0XA,0X20,0X20,0XA,0X20,0X20,0X3C,0X64,0X69,0X76,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X61,0X63,0X63,0X74,0X2D,0X68,0X65,0X61,0X64,0X65,0X72,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X61,0X20,0X68,0X72,0X65,0X66,0X3D,0X22,0X23,0X22,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X68,0X65,0X61,0X64,0X65,0X72,0X2D,0X62,0X74,0X6E,0X20,0X62,0X74,0X6E,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X73,0X70,0X61,0X6E,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X62,0X74,0X6E,0X2D,0X68,0X65,0X61,0X64,0X65,0X72,0X22,0X3E,0X25,0X73,0X3C,0X2F,0X73,0X70,0X61,0X6E,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X73,0X70,0X61,0X6E,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X62,0X74,0X6E,0X2D,0X63,0X6F,0X6E,0X74,0X65,0X6E,0X74,0X22,0X3E,0X25,0X64,0X3C,0X2F,0X73,0X70,0X61,0X6E,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X2F,0X61,0X3E,0XA,0X20,0X20,0X20,0X20,0XA,0X20,0X20,0X20,0X20,0X3C,0X61,0X20,0X68,0X72,0X65,0X66,0X3D,0X22,0X23,0X22,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X68,0X65,0X61,0X64,0X65,0X72,0X2D,0X62,0X74,0X6E,0X20,0X62,0X74,0X6E,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X73,0X70,0X61,0X6E,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X62,0X74,0X6E,0X2D,0X68,0X65,0X61,0X64,0X65,0X72,0X22,0X3E,0X25,0X73,0X3C,0X2F,0X73,0X70,0X61,0X6E,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X73,0X70,0X61,0X6E,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X62,0X74,0X6E,0X2D,0X63,0X6F,0X6E,0X74,0X65,0X6E,0X74,0X22,0X3E,0X25,0X64,0X3C,0X2F,0X73,0X70,0X61,0X6E,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X2F,0X61,0X3E,0XA,0XA,0X20,0X20,0X20,0X20,0X3C,0X61,0X20,0X68,0X72,0X65,0X66,0X3D,0X22,0X23,0X22,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X68,0X65,0X61,0X64,0X65,0X72,0X2D,0X62,0X74,0X6E,0X20,0X62,0X74,0X6E,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X73,0X70,0X61,0X6E,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X62,0X74,0X6E,0X2D,0X68,0X65,0X61,0X64,0X65,0X72,0X22,0X3E,0X25,0X73,0X3C,0X2F,0X73,0X70,0X61,0X6E,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X73,0X70,0X61,0X6E,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X62,0X74,0X6E,0X2D,0X63,0X6F,0X6E,0X74,0X65,0X6E,0X74,0X22,0X3E,0X25,0X64,0X3C,0X2F,0X73,0X70,0X61,0X6E,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X2F,0X61,0X3E,0XA,0X20,0X20,0X20,0X20,0XA,0X20,0X20,0X20,0X20,0X25,0X73,0XA,0X20,0X20,0X3C,0X2F,0X64,0X69,0X76,0X3E,0XA,0X20,0X20,0X3C,0X69,0X6D,0X67,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X61,0X63,0X63,0X74,0X2D,0X70,0X66,0X70,0X22,0X20,0X73,0X72,0X63,0X3D,0X22,0X25,0X73,0X22,0X3E,0XA,0X3C,0X2F,0X64,0X69,0X76,0X3E,0XA,0XA,0X25,0X73,0XA,0XA,0X3C,0X74,0X61,0X62,0X6C,0X65,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X74,0X61,0X62,0X73,0X20,0X75,0X69,0X2D,0X74,0X61,0X62,0X6C,0X65,0X22,0X3E,0XA,0X20,0X20,0X3C,0X74,0X72,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X61,0X20,0X68,0X72,0X65,0X66,0X3D,0X22,0X25,0X73,0X2F,0X40,0X25,0X73,0X2F,0X73,0X74,0X61,0X74,0X75,0X73,0X65,0X73,0X22,0X3E,0X3C,0X69,0X6E,0X70,0X75,0X74,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X74,0X61,0X62,0X2D,0X62,0X74,0X6E,0X20,0X62,0X74,0X6E,0X20,0X25,0X73,0X22,0X20,0X74,0X79,0X70,0X65,0X3D,0X22,0X62,0X75,0X74,0X74,0X6F,0X6E,0X22,0X20,0X76,0X61,0X6C,0X75,0X65,0X3D,0X22,0X25,0X73,0X22,0X3E,0X3C,0X2F,0X61,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X2F,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X61,0X20,0X68,0X72,0X65,0X66,0X3D,0X22,0X25,0X73,0X2F,0X40,0X25,0X73,0X2F,0X73,0X63,0X72,0X6F,0X62,0X62,0X6C,0X65,0X73,0X22,0X3E,0X3C,0X69,0X6E,0X70,0X75,0X74,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X74,0X61,0X62,0X2D,0X62,0X74,0X6E,0X20,0X62,0X74,0X6E,0X20,0X25,0X73,0X22,0X20,0X74,0X79,0X70,0X65,0X3D,0X22,0X62,0X75,0X74,0X74,0X6F,0X6E,0X22,0X20,0X76,0X61,0X6C,0X75,0X65,0X3D,0X22,0X25,0X73,0X22,0X3E,0X3C,0X2F,0X61,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X2F,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X61,0X20,0X68,0X72,0X65,0X66,0X3D,0X22,0X25,0X73,0X2F,0X40,0X25,0X73,0X2F,0X6D,0X65,0X64,0X69,0X61,0X22,0X3E,0X3C,0X69,0X6E,0X70,0X75,0X74,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X74,0X61,0X62,0X2D,0X62,0X74,0X6E,0X20,0X62,0X74,0X6E,0X20,0X25,0X73,0X22,0X20,0X74,0X79,0X70,0X65,0X3D,0X22,0X62,0X75,0X74,0X74,0X6F,0X6E,0X22,0X20,0X76,0X61,0X6C,0X75,0X65,0X3D,0X22,0X25,0X73,0X22,0X3E,0X3C,0X2F,0X61,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X2F,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X61,0X20,0X68,0X72,0X65,0X66,0X3D,0X22,0X25,0X73,0X2F,0X40,0X25,0X73,0X2F,0X70,0X69,0X6E,0X6E,0X65,0X64,0X22,0X3E,0X3C,0X69,0X6E,0X70,0X75,0X74,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X74,0X61,0X62,0X2D,0X62,0X74,0X6E,0X20,0X62,0X74,0X6E,0X20,0X25,0X73,0X22,0X20,0X74,0X79,0X70,0X65,0X3D,0X22,0X62,0X75,0X74,0X74,0X6F,0X6E,0X22,0X20,0X76,0X61,0X6C,0X75,0X65,0X3D,0X22,0X25,0X73,0X22,0X3E,0X3C,0X2F,0X61,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X2F,0X74,0X64,0X3E,0XA,0X20,0X20,0X3C,0X2F,0X74,0X72,0X3E,0XA,0X3C,0X2F,0X74,0X61,0X62,0X6C,0X65,0X3E,0XA,0XA,0X3C,0X64,0X69,0X76,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X61,0X63,0X63,0X6F,0X75,0X6E,0X74,0X2D,0X63,0X6F,0X6E,0X74,0X65,0X6E,0X74,0X22,0X3E,0XA,0X20,0X20,0X25,0X73,0XA,0X3C,0X2F,0X64,0X69,0X76,0X3E,0}; struct account_template {const char* is_blocked; const char* header; @@ -16,9 +17,9 @@ const char* unmute; const char* mute_text; const char* tab_statuses_text; int statuses_count; -const char* tab_following_count; +const char* tab_following_text; int following_count; -const char* tab_followers_count; +const char* tab_followers_text; int followers_count; const char* follow_btn; const char* avatar; @@ -32,10 +33,5 @@ const char* tab_pinned_focused; const char* tab_pinned_text; const char* acct_content; }; -char* tmpl_gen_account(struct account_template* data, unsigned* size){ -char* ret; -unsigned s = easprintf(&ret, data_account, data->is_blocked?data->is_blocked:"", data->header?data->header:"", data->follows_you?data->follows_you:"", data->display_name?data->display_name:"", data->acct?data->acct:"", data->prefix?data->prefix:"", data->userid?data->userid:"", data->unsubscribe?data->unsubscribe:"", data->subscribe_text?data->subscribe_text:"", data->prefix?data->prefix:"", data->userid?data->userid:"", data->unblock?data->unblock:"", data->block_text?data->block_text:"", data->prefix?data->prefix:"", data->userid?data->userid:"", data->unmute?data->unmute:"", data->mute_text?data->mute_text:"", data->tab_statuses_text?data->tab_statuses_text:"", data->statuses_count, data->tab_following_count?data->tab_following_count:"", data->following_count, data->tab_followers_count?data->tab_followers_count:"", data->followers_count, data->follow_btn?data->follow_btn:"", data->avatar?data->avatar:"", data->info?data->info:"", data->prefix?data->prefix:"", data->acct?data->acct:"", data->tab_statuses_focused?data->tab_statuses_focused:"", data->tab_statuses_text?data->tab_statuses_text:"", data->prefix?data->prefix:"", data->acct?data->acct:"", data->tab_scrobbles_focused?data->tab_scrobbles_focused:"", data->tab_scrobbles_text?data->tab_scrobbles_text:"", data->prefix?data->prefix:"", data->acct?data->acct:"", data->tab_media_focused?data->tab_media_focused:"", data->tab_media_text?data->tab_media_text:"", data->prefix?data->prefix:"", data->acct?data->acct:"", data->tab_pinned_focused?data->tab_pinned_focused:"", data->tab_pinned_text?data->tab_pinned_text:"", data->acct_content?data->acct_content:""); -if (size) *size = s; -return ret; -} +char* tmpl_gen_account(struct account_template* data, size_t* size); #endif diff --git a/static/account.tmpl b/static/account.tmpl index 5812efa..c280aba 100644 --- a/static/account.tmpl +++ b/static/account.tmpl @@ -26,12 +26,12 @@ - {{%s:tab_following_count}} + {{%s:tab_following_text}} {{%d:following_count}} - {{%s:tab_followers_count}} + {{%s:tab_followers_text}} {{%d:followers_count}} diff --git a/static/account_follow_btn.ctmpl b/static/account_follow_btn.ctmpl index 50e8744..4b9cf62 100644 --- a/static/account_follow_btn.ctmpl +++ b/static/account_follow_btn.ctmpl @@ -1,5 +1,6 @@ #ifndef __account_follow_btn #define __account_follow_btn +#include static const char data_account_follow_btn[] = {0X3C,0X61,0X20,0X68,0X72,0X65,0X66,0X3D,0X22,0X25,0X73,0X2F,0X75,0X73,0X65,0X72,0X2F,0X25,0X73,0X2F,0X61,0X63,0X74,0X69,0X6F,0X6E,0X2F,0X25,0X73,0X66,0X6F,0X6C,0X6C,0X6F,0X77,0X22,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X66,0X6F,0X6C,0X6C,0X6F,0X77,0X2D,0X62,0X74,0X6E,0X20,0X62,0X74,0X6E,0X20,0X25,0X73,0X22,0X3E,0XA,0X20,0X20,0X25,0X73,0XA,0X3C,0X2F,0X61,0X3E,0}; struct account_follow_btn_template {const char* prefix; const char* userid; @@ -7,10 +8,5 @@ const char* unfollow; const char* active; const char* follow_text; }; -char* tmpl_gen_account_follow_btn(struct account_follow_btn_template* data, unsigned* size){ -char* ret; -unsigned s = easprintf(&ret, data_account_follow_btn, data->prefix?data->prefix:"", data->userid?data->userid:"", data->unfollow?data->unfollow:"", data->active?data->active:"", data->follow_text?data->follow_text:""); -if (size) *size = s; -return ret; -} +char* tmpl_gen_account_follow_btn(struct account_follow_btn_template* data, size_t* size); #endif diff --git a/static/account_info.ctmpl b/static/account_info.ctmpl index 990185d..a358dea 100644 --- a/static/account_info.ctmpl +++ b/static/account_info.ctmpl @@ -1,12 +1,8 @@ #ifndef __account_info #define __account_info +#include static const char data_account_info[] = {0X3C,0X64,0X69,0X76,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X61,0X63,0X63,0X6F,0X75,0X6E,0X74,0X2D,0X69,0X6E,0X66,0X6F,0X22,0X3E,0XA,0X20,0X20,0X3C,0X64,0X69,0X76,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X61,0X63,0X63,0X6F,0X75,0X6E,0X74,0X2D,0X6E,0X6F,0X74,0X65,0X22,0X3E,0X25,0X73,0X3C,0X2F,0X64,0X69,0X76,0X3E,0XA,0X3C,0X2F,0X64,0X69,0X76,0X3E,0}; struct account_info_template {const char* acct_note; }; -char* tmpl_gen_account_info(struct account_info_template* data, unsigned* size){ -char* ret; -unsigned s = easprintf(&ret, data_account_info, data->acct_note?data->acct_note:""); -if (size) *size = s; -return ret; -} +char* tmpl_gen_account_info(struct account_info_template* data, size_t* size); #endif diff --git a/static/account_sidebar.ctmpl b/static/account_sidebar.ctmpl index 1c9a8d2..c9cac46 100644 --- a/static/account_sidebar.ctmpl +++ b/static/account_sidebar.ctmpl @@ -1,5 +1,6 @@ #ifndef __account_sidebar #define __account_sidebar +#include static const char data_account_sidebar[] = {0X3C,0X64,0X69,0X76,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X61,0X63,0X63,0X6F,0X75,0X6E,0X74,0X2D,0X73,0X69,0X64,0X65,0X62,0X61,0X72,0X22,0X3E,0XA,0X20,0X20,0X3C,0X64,0X69,0X76,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X61,0X63,0X63,0X74,0X2D,0X69,0X6E,0X66,0X6F,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X69,0X6D,0X67,0X20,0X73,0X72,0X63,0X3D,0X22,0X25,0X73,0X22,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X61,0X63,0X63,0X74,0X2D,0X70,0X66,0X70,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X73,0X70,0X61,0X6E,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X75,0X73,0X65,0X72,0X6E,0X61,0X6D,0X65,0X22,0X3E,0X25,0X73,0X3C,0X2F,0X73,0X70,0X61,0X6E,0X3E,0XA,0X20,0X20,0X3C,0X2F,0X64,0X69,0X76,0X3E,0XA,0X20,0X20,0X3C,0X74,0X61,0X62,0X6C,0X65,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X61,0X63,0X63,0X74,0X2D,0X73,0X74,0X61,0X74,0X73,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X74,0X72,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X74,0X64,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X68,0X65,0X61,0X64,0X65,0X72,0X2D,0X62,0X74,0X6E,0X20,0X62,0X74,0X6E,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X73,0X70,0X61,0X6E,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X62,0X74,0X6E,0X2D,0X68,0X65,0X61,0X64,0X65,0X72,0X22,0X3E,0X25,0X73,0X3C,0X2F,0X73,0X70,0X61,0X6E,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X73,0X70,0X61,0X6E,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X62,0X74,0X6E,0X2D,0X63,0X6F,0X6E,0X74,0X65,0X6E,0X74,0X22,0X3E,0X25,0X64,0X3C,0X2F,0X73,0X70,0X61,0X6E,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X2F,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X74,0X64,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X68,0X65,0X61,0X64,0X65,0X72,0X2D,0X62,0X74,0X6E,0X20,0X62,0X74,0X6E,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X73,0X70,0X61,0X6E,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X62,0X74,0X6E,0X2D,0X68,0X65,0X61,0X64,0X65,0X72,0X22,0X3E,0X25,0X73,0X3C,0X2F,0X73,0X70,0X61,0X6E,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X73,0X70,0X61,0X6E,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X62,0X74,0X6E,0X2D,0X63,0X6F,0X6E,0X74,0X65,0X6E,0X74,0X22,0X3E,0X25,0X64,0X3C,0X2F,0X73,0X70,0X61,0X6E,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X2F,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X74,0X64,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X68,0X65,0X61,0X64,0X65,0X72,0X2D,0X62,0X74,0X6E,0X20,0X62,0X74,0X6E,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X73,0X70,0X61,0X6E,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X62,0X74,0X6E,0X2D,0X68,0X65,0X61,0X64,0X65,0X72,0X22,0X3E,0X25,0X73,0X3C,0X2F,0X73,0X70,0X61,0X6E,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X73,0X70,0X61,0X6E,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X62,0X74,0X6E,0X2D,0X63,0X6F,0X6E,0X74,0X65,0X6E,0X74,0X22,0X3E,0X25,0X64,0X3C,0X2F,0X73,0X70,0X61,0X6E,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X2F,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X2F,0X74,0X72,0X3E,0XA,0X20,0X20,0X3C,0X2F,0X74,0X61,0X62,0X6C,0X65,0X3E,0XA,0X3C,0X2F,0X64,0X69,0X76,0X3E,0XA,0}; struct account_sidebar_template {const char* avatar; const char* username; @@ -10,10 +11,5 @@ int following_count; const char* followers_text; int followers_count; }; -char* tmpl_gen_account_sidebar(struct account_sidebar_template* data, unsigned* size){ -char* ret; -unsigned s = easprintf(&ret, data_account_sidebar, data->avatar?data->avatar:"", data->username?data->username:"", data->statuses_text?data->statuses_text:"", data->statuses_count, data->following_text?data->following_text:"", data->following_count, data->followers_text?data->followers_text:"", data->followers_count); -if (size) *size = s; -return ret; -} +char* tmpl_gen_account_sidebar(struct account_sidebar_template* data, size_t* size); #endif diff --git a/static/account_stub.ctmpl b/static/account_stub.ctmpl index ef01647..fd7556c 100644 --- a/static/account_stub.ctmpl +++ b/static/account_stub.ctmpl @@ -1,16 +1,11 @@ #ifndef __account_stub #define __account_stub +#include static const char data_account_stub[] = {0X3C,0X74,0X61,0X62,0X6C,0X65,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X61,0X63,0X63,0X6F,0X75,0X6E,0X74,0X2D,0X73,0X74,0X75,0X62,0X22,0X3E,0XA,0X20,0X20,0X3C,0X74,0X72,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X74,0X64,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X70,0X66,0X70,0X2D,0X74,0X64,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X61,0X20,0X68,0X72,0X65,0X66,0X3D,0X22,0X25,0X73,0X2F,0X40,0X25,0X73,0X22,0X3E,0X3C,0X69,0X6D,0X67,0X20,0X73,0X72,0X63,0X3D,0X22,0X25,0X73,0X22,0X3E,0X3C,0X2F,0X61,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X2F,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X74,0X64,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X61,0X63,0X63,0X6F,0X75,0X6E,0X74,0X2D,0X73,0X74,0X75,0X62,0X2D,0X69,0X6E,0X66,0X6F,0X2D,0X77,0X72,0X61,0X70,0X70,0X65,0X72,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X64,0X69,0X76,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X61,0X63,0X63,0X6F,0X75,0X6E,0X74,0X2D,0X73,0X74,0X75,0X62,0X2D,0X69,0X6E,0X66,0X6F,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X61,0X20,0X68,0X72,0X65,0X66,0X3D,0X22,0X25,0X73,0X2F,0X40,0X25,0X73,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X64,0X69,0X76,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X61,0X63,0X63,0X6F,0X75,0X6E,0X74,0X2D,0X73,0X74,0X75,0X62,0X2D,0X74,0X6F,0X70,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X73,0X70,0X61,0X6E,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X75,0X73,0X65,0X72,0X6E,0X61,0X6D,0X65,0X22,0X3E,0X25,0X73,0X3C,0X2F,0X73,0X70,0X61,0X6E,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X2F,0X64,0X69,0X76,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X64,0X69,0X76,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X61,0X63,0X63,0X6F,0X75,0X6E,0X74,0X2D,0X73,0X74,0X75,0X62,0X2D,0X62,0X6F,0X74,0X74,0X6F,0X6D,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X73,0X70,0X61,0X6E,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X69,0X6E,0X73,0X74,0X61,0X6E,0X63,0X65,0X2D,0X69,0X6E,0X66,0X6F,0X22,0X3E,0X40,0X25,0X73,0X3C,0X2F,0X73,0X70,0X61,0X6E,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X2F,0X64,0X69,0X76,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X2F,0X61,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X2F,0X64,0X69,0X76,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X2F,0X74,0X64,0X3E,0XA,0X20,0X20,0X3C,0X2F,0X74,0X72,0X3E,0XA,0X3C,0X2F,0X74,0X61,0X62,0X6C,0X65,0X3E,0}; struct account_stub_template {const char* prefix; const char* acct; const char* avatar; const char* display_name; -const char* full_acct; }; -char* tmpl_gen_account_stub(struct account_stub_template* data, unsigned* size){ -char* ret; -unsigned s = easprintf(&ret, data_account_stub, data->prefix?data->prefix:"", data->acct?data->acct:"", data->avatar?data->avatar:"", data->prefix?data->prefix:"", data->acct?data->acct:"", data->display_name?data->display_name:"", data->full_acct?data->full_acct:""); -if (size) *size = s; -return ret; -} +char* tmpl_gen_account_stub(struct account_stub_template* data, size_t* size); #endif diff --git a/static/attachment_audio.ctmpl b/static/attachment_audio.ctmpl index c6a3a7c..16e59b3 100644 --- a/static/attachment_audio.ctmpl +++ b/static/attachment_audio.ctmpl @@ -1,13 +1,9 @@ #ifndef __attachment_audio #define __attachment_audio +#include static const char data_attachment_audio[] = {0X3C,0X64,0X69,0X76,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X61,0X74,0X74,0X61,0X63,0X68,0X6D,0X65,0X6E,0X74,0X2D,0X63,0X6F,0X6E,0X74,0X61,0X69,0X6E,0X65,0X72,0X20,0X61,0X74,0X74,0X61,0X63,0X68,0X6D,0X65,0X6E,0X74,0X2D,0X61,0X75,0X64,0X69,0X6F,0X22,0X3E,0XA,0X20,0X20,0X3C,0X21,0X2D,0X2D,0X20,0X48,0X65,0X72,0X65,0X20,0X65,0X76,0X65,0X6E,0X20,0X69,0X66,0X20,0X6E,0X6F,0X74,0X20,0X73,0X65,0X6E,0X73,0X69,0X74,0X69,0X76,0X65,0X20,0X2D,0X2D,0X3E,0XA,0X20,0X20,0X3C,0X64,0X69,0X76,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X73,0X65,0X6E,0X73,0X69,0X74,0X69,0X76,0X65,0X2D,0X70,0X6C,0X61,0X63,0X65,0X68,0X6F,0X6C,0X64,0X65,0X72,0X20,0X25,0X73,0X22,0X3E,0X3C,0X2F,0X64,0X69,0X76,0X3E,0XA,0X20,0X20,0X3C,0X61,0X75,0X64,0X69,0X6F,0X20,0X77,0X69,0X64,0X74,0X68,0X3D,0X22,0X32,0X35,0X36,0X22,0X20,0X63,0X6F,0X6E,0X74,0X72,0X6F,0X6C,0X73,0X20,0X70,0X72,0X65,0X6C,0X6F,0X61,0X64,0X3D,0X22,0X6D,0X65,0X74,0X61,0X64,0X61,0X74,0X61,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X73,0X6F,0X75,0X72,0X63,0X65,0X20,0X73,0X72,0X63,0X3D,0X22,0X25,0X73,0X22,0X3E,0XA,0X20,0X20,0X3C,0X2F,0X76,0X69,0X64,0X65,0X6F,0X3E,0XA,0X3C,0X2F,0X64,0X69,0X76,0X3E,0}; struct attachment_audio_template {const char* sensitive; const char* src; }; -char* tmpl_gen_attachment_audio(struct attachment_audio_template* data, unsigned* size){ -char* ret; -unsigned s = easprintf(&ret, data_attachment_audio, data->sensitive?data->sensitive:"", data->src?data->src:""); -if (size) *size = s; -return ret; -} +char* tmpl_gen_attachment_audio(struct attachment_audio_template* data, size_t* size); #endif diff --git a/static/attachment_gifv.ctmpl b/static/attachment_gifv.ctmpl index 32413c7..ab1135a 100644 --- a/static/attachment_gifv.ctmpl +++ b/static/attachment_gifv.ctmpl @@ -1,13 +1,9 @@ #ifndef __attachment_gifv #define __attachment_gifv +#include static const char data_attachment_gifv[] = {0X3C,0X64,0X69,0X76,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X61,0X74,0X74,0X61,0X63,0X68,0X6D,0X65,0X6E,0X74,0X2D,0X63,0X6F,0X6E,0X74,0X61,0X69,0X6E,0X65,0X72,0X20,0X61,0X74,0X74,0X61,0X63,0X68,0X6D,0X65,0X6E,0X74,0X2D,0X67,0X69,0X66,0X76,0X22,0X3E,0XA,0X20,0X20,0X3C,0X76,0X69,0X64,0X65,0X6F,0X20,0X77,0X69,0X64,0X74,0X68,0X3D,0X22,0X32,0X35,0X36,0X22,0X20,0X61,0X75,0X74,0X6F,0X70,0X6C,0X61,0X79,0X20,0X6D,0X75,0X74,0X65,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X73,0X6F,0X75,0X72,0X63,0X65,0X20,0X73,0X72,0X63,0X3D,0X22,0X25,0X73,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X5B,0X20,0X47,0X49,0X46,0X56,0X20,0X5D,0XA,0X20,0X20,0X3C,0X2F,0X76,0X69,0X64,0X65,0X6F,0X3E,0XA,0X20,0X20,0X25,0X73,0XA,0X3C,0X2F,0X64,0X69,0X76,0X3E,0}; struct attachment_gifv_template {const char* src; const char* sensitive; }; -char* tmpl_gen_attachment_gifv(struct attachment_gifv_template* data, unsigned* size){ -char* ret; -unsigned s = easprintf(&ret, data_attachment_gifv, data->src?data->src:"", data->sensitive?data->sensitive:""); -if (size) *size = s; -return ret; -} +char* tmpl_gen_attachment_gifv(struct attachment_gifv_template* data, size_t* size); #endif diff --git a/static/attachment_image.ctmpl b/static/attachment_image.ctmpl index f639ff5..d3d9dee 100644 --- a/static/attachment_image.ctmpl +++ b/static/attachment_image.ctmpl @@ -1,13 +1,9 @@ #ifndef __attachment_image #define __attachment_image +#include static const char data_attachment_image[] = {0X3C,0X64,0X69,0X76,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X61,0X74,0X74,0X61,0X63,0X68,0X6D,0X65,0X6E,0X74,0X2D,0X63,0X6F,0X6E,0X74,0X61,0X69,0X6E,0X65,0X72,0X20,0X61,0X74,0X74,0X61,0X63,0X68,0X6D,0X65,0X6E,0X74,0X2D,0X69,0X6D,0X67,0X22,0X3E,0XA,0X20,0X20,0X3C,0X69,0X6D,0X67,0X20,0X77,0X69,0X64,0X74,0X68,0X3D,0X22,0X32,0X35,0X36,0X22,0X20,0X73,0X72,0X63,0X3D,0X22,0X25,0X73,0X22,0X3E,0XA,0X20,0X20,0X25,0X73,0XA,0X3C,0X2F,0X64,0X69,0X76,0X3E,0}; struct attachment_image_template {const char* src; const char* sensitive; }; -char* tmpl_gen_attachment_image(struct attachment_image_template* data, unsigned* size){ -char* ret; -unsigned s = easprintf(&ret, data_attachment_image, data->src?data->src:"", data->sensitive?data->sensitive:""); -if (size) *size = s; -return ret; -} +char* tmpl_gen_attachment_image(struct attachment_image_template* data, size_t* size); #endif diff --git a/static/attachment_link.ctmpl b/static/attachment_link.ctmpl index bd785e9..b8fd786 100644 --- a/static/attachment_link.ctmpl +++ b/static/attachment_link.ctmpl @@ -1,13 +1,9 @@ #ifndef __attachment_link #define __attachment_link +#include static const char data_attachment_link[] = {0X3C,0X64,0X69,0X76,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X61,0X74,0X74,0X61,0X63,0X68,0X6D,0X65,0X6E,0X74,0X2D,0X63,0X6F,0X6E,0X74,0X61,0X69,0X6E,0X65,0X72,0X20,0X61,0X74,0X74,0X61,0X63,0X68,0X6D,0X65,0X6E,0X74,0X2D,0X6C,0X69,0X6E,0X6B,0X20,0X25,0X73,0X22,0X3E,0XA,0X20,0X20,0X3C,0X61,0X20,0X68,0X72,0X65,0X66,0X3D,0X22,0X25,0X73,0X22,0X3E,0X41,0X74,0X74,0X61,0X63,0X68,0X6D,0X65,0X6E,0X74,0X3C,0X2F,0X61,0X3E,0XA,0X3C,0X2F,0X64,0X69,0X76,0X3E,0}; struct attachment_link_template {const char* sensitive; const char* url; }; -char* tmpl_gen_attachment_link(struct attachment_link_template* data, unsigned* size){ -char* ret; -unsigned s = easprintf(&ret, data_attachment_link, data->sensitive?data->sensitive:"", data->url?data->url:""); -if (size) *size = s; -return ret; -} +char* tmpl_gen_attachment_link(struct attachment_link_template* data, size_t* size); #endif diff --git a/static/attachment_video.ctmpl b/static/attachment_video.ctmpl index 4d7d487..7210a1c 100644 --- a/static/attachment_video.ctmpl +++ b/static/attachment_video.ctmpl @@ -1,13 +1,9 @@ #ifndef __attachment_video #define __attachment_video +#include static const char data_attachment_video[] = {0X3C,0X64,0X69,0X76,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X61,0X74,0X74,0X61,0X63,0X68,0X6D,0X65,0X6E,0X74,0X2D,0X63,0X6F,0X6E,0X74,0X61,0X69,0X6E,0X65,0X72,0X20,0X61,0X74,0X74,0X61,0X63,0X68,0X6D,0X65,0X6E,0X74,0X2D,0X76,0X69,0X64,0X65,0X6F,0X22,0X3E,0XA,0X20,0X20,0X3C,0X76,0X69,0X64,0X65,0X6F,0X20,0X77,0X69,0X64,0X74,0X68,0X3D,0X22,0X32,0X35,0X36,0X22,0X20,0X63,0X6F,0X6E,0X74,0X72,0X6F,0X6C,0X73,0X20,0X70,0X72,0X65,0X6C,0X6F,0X61,0X64,0X3D,0X22,0X6D,0X65,0X74,0X61,0X64,0X61,0X74,0X61,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X73,0X6F,0X75,0X72,0X63,0X65,0X20,0X73,0X72,0X63,0X3D,0X22,0X25,0X73,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X5B,0X20,0X56,0X49,0X44,0X45,0X4F,0X20,0X5D,0XA,0X20,0X20,0X3C,0X2F,0X76,0X69,0X64,0X65,0X6F,0X3E,0XA,0X20,0X20,0X25,0X73,0XA,0X3C,0X2F,0X64,0X69,0X76,0X3E,0}; struct attachment_video_template {const char* src; const char* sensitive; }; -char* tmpl_gen_attachment_video(struct attachment_video_template* data, unsigned* size){ -char* ret; -unsigned s = easprintf(&ret, data_attachment_video, data->src?data->src:"", data->sensitive?data->sensitive:""); -if (size) *size = s; -return ret; -} +char* tmpl_gen_attachment_video(struct attachment_video_template* data, size_t* size); #endif diff --git a/static/attachments.ctmpl b/static/attachments.ctmpl index 3079a7c..8011c6a 100644 --- a/static/attachments.ctmpl +++ b/static/attachments.ctmpl @@ -1,12 +1,8 @@ #ifndef __attachments #define __attachments +#include static const char data_attachments[] = {0X3C,0X64,0X69,0X76,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X61,0X74,0X74,0X61,0X63,0X68,0X6D,0X65,0X6E,0X74,0X73,0X22,0X3E,0XA,0X20,0X20,0X25,0X73,0XA,0X3C,0X2F,0X64,0X69,0X76,0X3E,0}; struct attachments_template {const char* attachments; }; -char* tmpl_gen_attachments(struct attachments_template* data, unsigned* size){ -char* ret; -unsigned s = easprintf(&ret, data_attachments, data->attachments?data->attachments:""); -if (size) *size = s; -return ret; -} +char* tmpl_gen_attachments(struct attachments_template* data, size_t* size); #endif diff --git a/static/bar.ctmpl b/static/bar.ctmpl index dcd5e3b..5f2ba3c 100644 --- a/static/bar.ctmpl +++ b/static/bar.ctmpl @@ -1,12 +1,8 @@ #ifndef __bar #define __bar +#include static const char data_bar[] = {0X3C,0X64,0X69,0X76,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X62,0X61,0X72,0X22,0X3E,0XA,0X20,0X20,0X3C,0X64,0X69,0X76,0X20,0X73,0X74,0X79,0X6C,0X65,0X3D,0X22,0X6D,0X61,0X78,0X2D,0X68,0X65,0X69,0X67,0X68,0X74,0X3A,0X20,0X25,0X66,0X25,0X25,0X3B,0X22,0X3E,0X3C,0X2F,0X64,0X69,0X76,0X3E,0XA,0X3C,0X2F,0X64,0X69,0X76,0X3E,0}; struct bar_template {float value; }; -char* tmpl_gen_bar(struct bar_template* data, unsigned* size){ -char* ret; -unsigned s = easprintf(&ret, data_bar, data->value); -if (size) *size = s; -return ret; -} +char* tmpl_gen_bar(struct bar_template* data, size_t* size); #endif diff --git a/static/bar_graph.ctmpl b/static/bar_graph.ctmpl index b9ac1a4..51b8804 100644 --- a/static/bar_graph.ctmpl +++ b/static/bar_graph.ctmpl @@ -1,12 +1,8 @@ #ifndef __bar_graph #define __bar_graph +#include static const char data_bar_graph[] = {0X3C,0X64,0X69,0X76,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X62,0X61,0X72,0X2D,0X67,0X72,0X61,0X70,0X68,0X22,0X3E,0XA,0X20,0X20,0X25,0X73,0XA,0X3C,0X2F,0X64,0X69,0X76,0X3E,0}; struct bar_graph_template {const char* graph; }; -char* tmpl_gen_bar_graph(struct bar_graph_template* data, unsigned* size){ -char* ret; -unsigned s = easprintf(&ret, data_bar_graph, data->graph?data->graph:""); -if (size) *size = s; -return ret; -} +char* tmpl_gen_bar_graph(struct bar_graph_template* data, size_t* size); #endif diff --git a/static/bookmarks_page.ctmpl b/static/bookmarks_page.ctmpl index ecdd572..11a8ade 100644 --- a/static/bookmarks_page.ctmpl +++ b/static/bookmarks_page.ctmpl @@ -1,13 +1,9 @@ #ifndef __bookmarks_page #define __bookmarks_page +#include static const char data_bookmarks_page[] = {0X3C,0X64,0X69,0X76,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X73,0X69,0X6D,0X70,0X6C,0X65,0X2D,0X70,0X61,0X67,0X65,0X22,0X3E,0XA,0X20,0X20,0X3C,0X68,0X31,0X3E,0X42,0X6F,0X6F,0X6B,0X6D,0X61,0X72,0X6B,0X73,0X3C,0X2F,0X68,0X31,0X3E,0XA,0X3C,0X2F,0X64,0X69,0X76,0X3E,0XA,0X3C,0X64,0X69,0X76,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X62,0X6F,0X6F,0X6B,0X6D,0X61,0X72,0X6B,0X73,0X2D,0X63,0X6F,0X6E,0X74,0X61,0X69,0X6E,0X65,0X72,0X22,0X3E,0XA,0X20,0X20,0X25,0X73,0XA,0X3C,0X2F,0X64,0X69,0X76,0X3E,0XA,0X25,0X73,0}; struct bookmarks_page_template {const char* statuses; const char* navigation; }; -char* tmpl_gen_bookmarks_page(struct bookmarks_page_template* data, unsigned* size){ -char* ret; -unsigned s = easprintf(&ret, data_bookmarks_page, data->statuses?data->statuses:"", data->navigation?data->navigation:""); -if (size) *size = s; -return ret; -} +char* tmpl_gen_bookmarks_page(struct bookmarks_page_template* data, size_t* size); #endif diff --git a/static/config_appearance.ctmpl b/static/config_appearance.ctmpl index 0d0eccd..004d3f4 100644 --- a/static/config_appearance.ctmpl +++ b/static/config_appearance.ctmpl @@ -1,5 +1,6 @@ #ifndef __config_appearance #define __config_appearance +#include static const char data_config_appearance[] = {0X3C,0X64,0X69,0X76,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X73,0X69,0X6D,0X70,0X6C,0X65,0X2D,0X70,0X61,0X67,0X65,0X22,0X3E,0XA,0X20,0X20,0X3C,0X66,0X6F,0X72,0X6D,0X20,0X61,0X63,0X74,0X69,0X6F,0X6E,0X3D,0X22,0X61,0X70,0X70,0X65,0X61,0X72,0X61,0X6E,0X63,0X65,0X22,0X20,0X6D,0X65,0X74,0X68,0X6F,0X64,0X3D,0X22,0X70,0X6F,0X73,0X74,0X22,0X20,0X65,0X6E,0X63,0X74,0X79,0X70,0X65,0X3D,0X22,0X6D,0X75,0X6C,0X74,0X69,0X70,0X61,0X72,0X74,0X2F,0X66,0X6F,0X72,0X6D,0X2D,0X64,0X61,0X74,0X61,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X21,0X2D,0X2D,0X20,0X4C,0X65,0X74,0X73,0X20,0X73,0X65,0X72,0X76,0X65,0X72,0X20,0X6B,0X6E,0X6F,0X77,0X20,0X77,0X65,0X20,0X73,0X65,0X6E,0X74,0X20,0X69,0X74,0X20,0X2D,0X2D,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X69,0X6E,0X70,0X75,0X74,0X20,0X74,0X79,0X70,0X65,0X3D,0X22,0X68,0X69,0X64,0X64,0X65,0X6E,0X22,0X20,0X6E,0X61,0X6D,0X65,0X3D,0X22,0X73,0X65,0X74,0X22,0X20,0X76,0X61,0X6C,0X75,0X65,0X3D,0X22,0X31,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X68,0X31,0X3E,0X41,0X70,0X70,0X65,0X61,0X72,0X61,0X6E,0X63,0X65,0X3C,0X2F,0X68,0X31,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X69,0X6E,0X70,0X75,0X74,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X62,0X74,0X6E,0X20,0X62,0X74,0X6E,0X2D,0X73,0X69,0X6E,0X67,0X6C,0X65,0X22,0X20,0X74,0X79,0X70,0X65,0X3D,0X22,0X73,0X75,0X62,0X6D,0X69,0X74,0X22,0X20,0X76,0X61,0X6C,0X75,0X65,0X3D,0X22,0X53,0X61,0X76,0X65,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X68,0X33,0X3E,0X54,0X68,0X65,0X6D,0X65,0X20,0X76,0X61,0X72,0X69,0X61,0X6E,0X74,0X3C,0X2F,0X68,0X33,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X75,0X6C,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X6C,0X69,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X6C,0X61,0X62,0X65,0X6C,0X20,0X66,0X6F,0X72,0X3D,0X22,0X63,0X66,0X67,0X74,0X68,0X65,0X6D,0X65,0X76,0X61,0X72,0X22,0X3E,0X54,0X68,0X65,0X6D,0X65,0X20,0X76,0X61,0X72,0X69,0X61,0X6E,0X74,0X3C,0X2F,0X6C,0X61,0X62,0X65,0X6C,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X73,0X65,0X6C,0X65,0X63,0X74,0X20,0X6E,0X61,0X6D,0X65,0X3D,0X22,0X74,0X68,0X65,0X6D,0X65,0X22,0X20,0X69,0X64,0X3D,0X22,0X63,0X66,0X67,0X74,0X68,0X65,0X6D,0X65,0X76,0X61,0X72,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X6F,0X70,0X74,0X69,0X6F,0X6E,0X20,0X76,0X61,0X6C,0X75,0X65,0X3D,0X22,0X74,0X72,0X65,0X65,0X62,0X69,0X72,0X64,0X32,0X30,0X22,0X20,0X74,0X69,0X74,0X6C,0X65,0X3D,0X22,0X43,0X72,0X65,0X61,0X74,0X65,0X64,0X20,0X62,0X79,0X20,0X6E,0X65,0X6B,0X6F,0X62,0X69,0X74,0X20,0X28,0X40,0X6E,0X65,0X6B,0X6F,0X40,0X72,0X64,0X72,0X61,0X6D,0X61,0X2E,0X63,0X63,0X29,0X20,0X7C,0X20,0X44,0X61,0X72,0X6B,0X20,0X76,0X61,0X72,0X69,0X61,0X6E,0X74,0X20,0X63,0X72,0X65,0X61,0X74,0X65,0X64,0X20,0X62,0X79,0X20,0X47,0X72,0X75,0X6D,0X62,0X75,0X6C,0X6F,0X6E,0X20,0X28,0X40,0X67,0X72,0X75,0X6D,0X62,0X75,0X6C,0X6F,0X6E,0X40,0X66,0X72,0X65,0X65,0X63,0X75,0X6D,0X65,0X78,0X74,0X72,0X65,0X6D,0X69,0X73,0X74,0X2E,0X63,0X6F,0X6D,0X29,0X22,0X3E,0X74,0X72,0X65,0X65,0X62,0X69,0X72,0X64,0X20,0X32,0X2E,0X30,0X20,0X2D,0X20,0X44,0X65,0X66,0X61,0X75,0X6C,0X74,0X2C,0X20,0X73,0X69,0X6D,0X70,0X6C,0X65,0X20,0X74,0X68,0X65,0X6D,0X65,0X3C,0X2F,0X6F,0X70,0X74,0X69,0X6F,0X6E,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X6F,0X70,0X74,0X69,0X6F,0X6E,0X20,0X76,0X61,0X6C,0X75,0X65,0X3D,0X22,0X73,0X6F,0X6C,0X61,0X72,0X69,0X7A,0X65,0X64,0X22,0X20,0X74,0X69,0X74,0X6C,0X65,0X3D,0X22,0X43,0X72,0X65,0X61,0X74,0X65,0X64,0X20,0X62,0X79,0X20,0X63,0X6F,0X79,0X6F,0X74,0X65,0X20,0X28,0X40,0X63,0X6F,0X79,0X6F,0X74,0X65,0X40,0X70,0X6C,0X2E,0X6C,0X61,0X69,0X6E,0X2E,0X73,0X68,0X29,0X22,0X3E,0X53,0X6F,0X6C,0X61,0X72,0X69,0X7A,0X65,0X64,0X20,0X2D,0X20,0X53,0X6F,0X6C,0X61,0X72,0X69,0X7A,0X65,0X64,0X20,0X63,0X6F,0X6C,0X6F,0X72,0X73,0X20,0X66,0X6F,0X72,0X20,0X70,0X6C,0X65,0X61,0X73,0X61,0X6E,0X74,0X20,0X76,0X69,0X65,0X77,0X69,0X6E,0X67,0X3C,0X2F,0X6F,0X70,0X74,0X69,0X6F,0X6E,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X2F,0X73,0X65,0X6C,0X65,0X63,0X74,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X2F,0X6C,0X69,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X2F,0X75,0X6C,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X68,0X33,0X3E,0X43,0X6F,0X6C,0X6F,0X72,0X20,0X53,0X63,0X68,0X65,0X6D,0X65,0X3C,0X2F,0X68,0X33,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X75,0X6C,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X6C,0X69,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X69,0X6E,0X70,0X75,0X74,0X20,0X74,0X79,0X70,0X65,0X3D,0X22,0X72,0X61,0X64,0X69,0X6F,0X22,0X20,0X69,0X64,0X3D,0X22,0X63,0X66,0X67,0X6C,0X69,0X67,0X68,0X74,0X22,0X20,0X6E,0X61,0X6D,0X65,0X3D,0X22,0X74,0X68,0X65,0X6D,0X65,0X63,0X6C,0X72,0X22,0X20,0X76,0X61,0X6C,0X75,0X65,0X3D,0X22,0X30,0X22,0X20,0X63,0X68,0X65,0X63,0X6B,0X65,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X6C,0X61,0X62,0X65,0X6C,0X20,0X66,0X6F,0X72,0X3D,0X22,0X63,0X66,0X67,0X6C,0X69,0X67,0X68,0X74,0X22,0X3E,0X4C,0X69,0X67,0X68,0X74,0X3C,0X2F,0X6C,0X61,0X62,0X65,0X6C,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X2F,0X6C,0X69,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X6C,0X69,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X69,0X6E,0X70,0X75,0X74,0X20,0X74,0X79,0X70,0X65,0X3D,0X22,0X72,0X61,0X64,0X69,0X6F,0X22,0X20,0X69,0X64,0X3D,0X22,0X63,0X66,0X67,0X64,0X61,0X72,0X6B,0X22,0X20,0X6E,0X61,0X6D,0X65,0X3D,0X22,0X74,0X68,0X65,0X6D,0X65,0X63,0X6C,0X72,0X22,0X20,0X76,0X61,0X6C,0X75,0X65,0X3D,0X22,0X31,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X6C,0X61,0X62,0X65,0X6C,0X20,0X66,0X6F,0X72,0X3D,0X22,0X63,0X66,0X67,0X64,0X61,0X72,0X6B,0X22,0X3E,0X44,0X61,0X72,0X6B,0X3C,0X2F,0X6C,0X61,0X62,0X65,0X6C,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X2F,0X6C,0X69,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X2F,0X75,0X6C,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X68,0X33,0X3E,0X42,0X61,0X63,0X6B,0X67,0X72,0X6F,0X75,0X6E,0X64,0X3C,0X2F,0X68,0X33,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X75,0X6C,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X6C,0X69,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X69,0X6E,0X70,0X75,0X74,0X20,0X74,0X79,0X70,0X65,0X3D,0X22,0X66,0X69,0X6C,0X65,0X22,0X20,0X6E,0X61,0X6D,0X65,0X3D,0X22,0X66,0X69,0X6C,0X65,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X2F,0X6C,0X69,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X2F,0X75,0X6C,0X3E,0XA,0X20,0X20,0X20,0X20,0XA,0X20,0X20,0X20,0X20,0X3C,0X69,0X6E,0X70,0X75,0X74,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X62,0X74,0X6E,0X20,0X62,0X74,0X6E,0X2D,0X73,0X69,0X6E,0X67,0X6C,0X65,0X22,0X20,0X74,0X79,0X70,0X65,0X3D,0X22,0X73,0X75,0X62,0X6D,0X69,0X74,0X22,0X20,0X76,0X61,0X6C,0X75,0X65,0X3D,0X22,0X53,0X61,0X76,0X65,0X22,0X3E,0XA,0X20,0X20,0X3C,0X2F,0X66,0X6F,0X72,0X6D,0X3E,0XA,0X3C,0X2F,0X64,0X69,0X76,0X3E,0}; #endif diff --git a/static/config_general.ctmpl b/static/config_general.ctmpl index 221fa5e..83a241a 100644 --- a/static/config_general.ctmpl +++ b/static/config_general.ctmpl @@ -1,5 +1,6 @@ #ifndef __config_general #define __config_general +#include static const char data_config_general[] = {0X3C,0X64,0X69,0X76,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X73,0X69,0X6D,0X70,0X6C,0X65,0X2D,0X70,0X61,0X67,0X65,0X22,0X3E,0XA,0X20,0X20,0X3C,0X66,0X6F,0X72,0X6D,0X20,0X61,0X63,0X74,0X69,0X6F,0X6E,0X3D,0X22,0X67,0X65,0X6E,0X65,0X72,0X61,0X6C,0X22,0X20,0X6D,0X65,0X74,0X68,0X6F,0X64,0X3D,0X22,0X70,0X6F,0X73,0X74,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X21,0X2D,0X2D,0X20,0X4C,0X65,0X74,0X73,0X20,0X73,0X65,0X72,0X76,0X65,0X72,0X20,0X6B,0X6E,0X6F,0X77,0X20,0X77,0X65,0X20,0X73,0X65,0X6E,0X74,0X20,0X69,0X74,0X20,0X2D,0X2D,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X69,0X6E,0X70,0X75,0X74,0X20,0X74,0X79,0X70,0X65,0X3D,0X22,0X68,0X69,0X64,0X64,0X65,0X6E,0X22,0X20,0X6E,0X61,0X6D,0X65,0X3D,0X22,0X73,0X65,0X74,0X22,0X20,0X76,0X61,0X6C,0X75,0X65,0X3D,0X22,0X31,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X68,0X31,0X3E,0X47,0X65,0X6E,0X65,0X72,0X61,0X6C,0X3C,0X2F,0X68,0X31,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X69,0X6E,0X70,0X75,0X74,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X62,0X74,0X6E,0X20,0X62,0X74,0X6E,0X2D,0X73,0X69,0X6E,0X67,0X6C,0X65,0X22,0X20,0X74,0X79,0X70,0X65,0X3D,0X22,0X73,0X75,0X62,0X6D,0X69,0X74,0X22,0X20,0X76,0X61,0X6C,0X75,0X65,0X3D,0X22,0X53,0X61,0X76,0X65,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X68,0X33,0X3E,0X4A,0X61,0X76,0X61,0X53,0X63,0X72,0X69,0X70,0X74,0X3C,0X2F,0X68,0X33,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X75,0X6C,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X6C,0X69,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X69,0X6E,0X70,0X75,0X74,0X20,0X74,0X79,0X70,0X65,0X3D,0X22,0X63,0X68,0X65,0X63,0X6B,0X62,0X6F,0X78,0X22,0X20,0X69,0X64,0X3D,0X22,0X63,0X66,0X67,0X6A,0X73,0X22,0X20,0X6E,0X61,0X6D,0X65,0X3D,0X22,0X6A,0X73,0X22,0X20,0X76,0X61,0X6C,0X75,0X65,0X3D,0X22,0X31,0X22,0X20,0X25,0X73,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X6C,0X61,0X62,0X65,0X6C,0X20,0X66,0X6F,0X72,0X3D,0X22,0X63,0X66,0X67,0X6A,0X73,0X22,0X3E,0X45,0X6E,0X61,0X62,0X6C,0X65,0X20,0X4A,0X61,0X76,0X61,0X53,0X63,0X72,0X69,0X70,0X74,0X20,0X2D,0X20,0X49,0X66,0X20,0X64,0X69,0X73,0X61,0X62,0X6C,0X65,0X64,0X2C,0X20,0X6F,0X76,0X65,0X72,0X72,0X69,0X64,0X65,0X73,0X20,0X6F,0X70,0X74,0X69,0X6F,0X6E,0X73,0X20,0X62,0X65,0X6C,0X6F,0X77,0X3C,0X2F,0X6C,0X61,0X62,0X65,0X6C,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X2F,0X6C,0X69,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X21,0X2D,0X2D,0X20,0X3C,0X6C,0X69,0X3E,0X20,0X2D,0X2D,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X21,0X2D,0X2D,0X20,0X20,0X20,0X3C,0X69,0X6E,0X70,0X75,0X74,0X20,0X74,0X79,0X70,0X65,0X3D,0X22,0X63,0X68,0X65,0X63,0X6B,0X62,0X6F,0X78,0X22,0X20,0X69,0X64,0X3D,0X22,0X63,0X66,0X67,0X6A,0X73,0X61,0X63,0X74,0X69,0X6F,0X6E,0X73,0X22,0X20,0X6E,0X61,0X6D,0X65,0X3D,0X22,0X6A,0X73,0X61,0X63,0X74,0X69,0X6F,0X6E,0X73,0X22,0X20,0X76,0X61,0X6C,0X75,0X65,0X3D,0X22,0X31,0X22,0X20,0X25,0X73,0X3E,0X20,0X2D,0X2D,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X21,0X2D,0X2D,0X20,0X20,0X20,0X3C,0X6C,0X61,0X62,0X65,0X6C,0X20,0X66,0X6F,0X72,0X3D,0X22,0X63,0X66,0X67,0X6A,0X73,0X61,0X63,0X74,0X69,0X6F,0X6E,0X73,0X22,0X3E,0X51,0X75,0X69,0X63,0X6B,0X20,0X61,0X63,0X74,0X69,0X6F,0X6E,0X73,0X20,0X2D,0X20,0X4C,0X69,0X6B,0X65,0X73,0X2C,0X20,0X42,0X6F,0X6F,0X73,0X74,0X73,0X2C,0X20,0X65,0X74,0X63,0X20,0X64,0X6F,0X6E,0X65,0X20,0X69,0X6E,0X20,0X62,0X61,0X63,0X6B,0X67,0X72,0X6F,0X75,0X6E,0X64,0X3C,0X2F,0X6C,0X61,0X62,0X65,0X6C,0X3E,0X20,0X2D,0X2D,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X21,0X2D,0X2D,0X20,0X3C,0X2F,0X6C,0X69,0X3E,0X20,0X2D,0X2D,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X21,0X2D,0X2D,0X20,0X3C,0X6C,0X69,0X3E,0X20,0X2D,0X2D,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X21,0X2D,0X2D,0X20,0X20,0X20,0X3C,0X69,0X6E,0X70,0X75,0X74,0X20,0X74,0X79,0X70,0X65,0X3D,0X22,0X63,0X68,0X65,0X63,0X6B,0X62,0X6F,0X78,0X22,0X20,0X69,0X64,0X3D,0X22,0X63,0X66,0X67,0X6A,0X73,0X72,0X65,0X70,0X6C,0X79,0X22,0X20,0X6E,0X61,0X6D,0X65,0X3D,0X22,0X6A,0X73,0X72,0X65,0X70,0X6C,0X79,0X22,0X20,0X76,0X61,0X6C,0X75,0X65,0X3D,0X22,0X31,0X22,0X20,0X25,0X73,0X3E,0X20,0X2D,0X2D,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X21,0X2D,0X2D,0X20,0X20,0X20,0X3C,0X6C,0X61,0X62,0X65,0X6C,0X20,0X66,0X6F,0X72,0X3D,0X22,0X63,0X66,0X67,0X6A,0X73,0X72,0X65,0X70,0X6C,0X79,0X22,0X3E,0X51,0X75,0X69,0X63,0X6B,0X20,0X72,0X65,0X70,0X6C,0X79,0X20,0X2D,0X20,0X52,0X65,0X70,0X6C,0X69,0X65,0X73,0X20,0X64,0X6F,0X6E,0X27,0X74,0X20,0X72,0X65,0X71,0X75,0X69,0X72,0X65,0X20,0X72,0X65,0X64,0X69,0X72,0X65,0X63,0X74,0X73,0X3C,0X2F,0X6C,0X61,0X62,0X65,0X6C,0X3E,0X20,0X2D,0X2D,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X21,0X2D,0X2D,0X20,0X3C,0X2F,0X6C,0X69,0X3E,0X20,0X2D,0X2D,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X21,0X2D,0X2D,0X20,0X3C,0X6C,0X69,0X3E,0X20,0X2D,0X2D,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X21,0X2D,0X2D,0X20,0X20,0X20,0X3C,0X69,0X6E,0X70,0X75,0X74,0X20,0X74,0X79,0X70,0X65,0X3D,0X22,0X63,0X68,0X65,0X63,0X6B,0X62,0X6F,0X78,0X22,0X20,0X69,0X64,0X3D,0X22,0X63,0X66,0X67,0X6A,0X73,0X6C,0X69,0X76,0X65,0X22,0X20,0X6E,0X61,0X6D,0X65,0X3D,0X22,0X6A,0X73,0X6C,0X69,0X76,0X65,0X22,0X20,0X76,0X61,0X6C,0X75,0X65,0X3D,0X22,0X31,0X22,0X20,0X25,0X73,0X3E,0X20,0X2D,0X2D,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X21,0X2D,0X2D,0X20,0X20,0X20,0X3C,0X6C,0X61,0X62,0X65,0X6C,0X20,0X66,0X6F,0X72,0X3D,0X22,0X63,0X66,0X67,0X6A,0X73,0X6C,0X69,0X76,0X65,0X22,0X3E,0X4C,0X69,0X76,0X65,0X20,0X75,0X70,0X64,0X61,0X74,0X65,0X20,0X2D,0X20,0X53,0X74,0X61,0X74,0X75,0X73,0X65,0X73,0X2C,0X20,0X63,0X68,0X61,0X74,0X73,0X2C,0X20,0X61,0X6E,0X64,0X20,0X72,0X65,0X61,0X63,0X74,0X69,0X6F,0X6E,0X73,0X20,0X66,0X65,0X74,0X63,0X68,0X20,0X6F,0X6E,0X20,0X74,0X68,0X65,0X20,0X66,0X6C,0X79,0X3C,0X2F,0X6C,0X61,0X62,0X65,0X6C,0X3E,0X20,0X2D,0X2D,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X21,0X2D,0X2D,0X20,0X3C,0X2F,0X6C,0X69,0X3E,0X20,0X2D,0X2D,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X2F,0X75,0X6C,0X3E,0XA,0XA,0X20,0X20,0X20,0X20,0X3C,0X68,0X33,0X3E,0X53,0X74,0X61,0X74,0X75,0X73,0X65,0X73,0X3C,0X2F,0X68,0X33,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X75,0X6C,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X6C,0X69,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X69,0X6E,0X70,0X75,0X74,0X20,0X74,0X79,0X70,0X65,0X3D,0X22,0X63,0X68,0X65,0X63,0X6B,0X62,0X6F,0X78,0X22,0X20,0X69,0X64,0X3D,0X22,0X63,0X66,0X67,0X73,0X74,0X61,0X74,0X61,0X74,0X74,0X61,0X63,0X68,0X6D,0X65,0X6E,0X74,0X73,0X22,0X20,0X6E,0X61,0X6D,0X65,0X3D,0X22,0X73,0X74,0X61,0X74,0X61,0X74,0X74,0X61,0X63,0X68,0X6D,0X65,0X6E,0X74,0X73,0X22,0X20,0X76,0X61,0X6C,0X75,0X65,0X3D,0X22,0X31,0X22,0X20,0X25,0X73,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X6C,0X61,0X62,0X65,0X6C,0X20,0X66,0X6F,0X72,0X3D,0X22,0X63,0X66,0X67,0X73,0X74,0X61,0X74,0X61,0X74,0X74,0X61,0X63,0X68,0X6D,0X65,0X6E,0X74,0X73,0X22,0X3E,0X53,0X68,0X6F,0X77,0X20,0X61,0X74,0X74,0X61,0X63,0X68,0X6D,0X65,0X6E,0X74,0X73,0X20,0X2D,0X20,0X49,0X66,0X20,0X64,0X69,0X73,0X61,0X62,0X6C,0X65,0X64,0X2C,0X20,0X61,0X74,0X74,0X61,0X63,0X68,0X6D,0X65,0X6E,0X74,0X73,0X20,0X61,0X72,0X65,0X20,0X6C,0X69,0X6E,0X6B,0X73,0X20,0X69,0X6E,0X73,0X74,0X65,0X61,0X64,0X3C,0X2F,0X6C,0X61,0X62,0X65,0X6C,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X2F,0X6C,0X69,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X6C,0X69,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X69,0X6E,0X70,0X75,0X74,0X20,0X74,0X79,0X70,0X65,0X3D,0X22,0X63,0X68,0X65,0X63,0X6B,0X62,0X6F,0X78,0X22,0X20,0X69,0X64,0X3D,0X22,0X63,0X66,0X67,0X73,0X74,0X61,0X74,0X67,0X72,0X65,0X65,0X6E,0X74,0X65,0X78,0X74,0X73,0X22,0X20,0X6E,0X61,0X6D,0X65,0X3D,0X22,0X73,0X74,0X61,0X74,0X67,0X72,0X65,0X65,0X6E,0X74,0X65,0X78,0X74,0X73,0X22,0X20,0X76,0X61,0X6C,0X75,0X65,0X3D,0X22,0X31,0X22,0X20,0X25,0X73,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X6C,0X61,0X62,0X65,0X6C,0X20,0X66,0X6F,0X72,0X3D,0X22,0X63,0X66,0X67,0X73,0X74,0X61,0X74,0X67,0X72,0X65,0X65,0X6E,0X74,0X65,0X78,0X74,0X73,0X22,0X3E,0X53,0X68,0X6F,0X77,0X20,0X67,0X72,0X65,0X65,0X6E,0X74,0X65,0X78,0X74,0X73,0X3C,0X2F,0X6C,0X61,0X62,0X65,0X6C,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X2F,0X6C,0X69,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X6C,0X69,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X69,0X6E,0X70,0X75,0X74,0X20,0X74,0X79,0X70,0X65,0X3D,0X22,0X63,0X68,0X65,0X63,0X6B,0X62,0X6F,0X78,0X22,0X20,0X69,0X64,0X3D,0X22,0X63,0X66,0X67,0X73,0X74,0X61,0X74,0X64,0X6F,0X70,0X65,0X22,0X20,0X6E,0X61,0X6D,0X65,0X3D,0X22,0X73,0X74,0X61,0X74,0X64,0X6F,0X70,0X65,0X22,0X20,0X76,0X61,0X6C,0X75,0X65,0X3D,0X22,0X31,0X22,0X20,0X25,0X73,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X6C,0X61,0X62,0X65,0X6C,0X20,0X66,0X6F,0X72,0X3D,0X22,0X63,0X66,0X67,0X73,0X74,0X61,0X74,0X64,0X6F,0X70,0X65,0X22,0X3E,0X53,0X68,0X6F,0X77,0X20,0X64,0X6F,0X70,0X61,0X6D,0X65,0X6D,0X65,0X20,0X6E,0X75,0X6D,0X62,0X65,0X72,0X73,0X20,0X2D,0X20,0X4C,0X69,0X6B,0X65,0X73,0X2C,0X20,0X63,0X6F,0X6D,0X6D,0X65,0X6E,0X74,0X73,0X2C,0X20,0X61,0X6E,0X64,0X20,0X62,0X6F,0X6F,0X73,0X74,0X20,0X63,0X6F,0X75,0X6E,0X74,0X73,0X3C,0X2F,0X6C,0X61,0X62,0X65,0X6C,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X2F,0X6C,0X69,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X6C,0X69,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X69,0X6E,0X70,0X75,0X74,0X20,0X74,0X79,0X70,0X65,0X3D,0X22,0X63,0X68,0X65,0X63,0X6B,0X62,0X6F,0X78,0X22,0X20,0X69,0X64,0X3D,0X22,0X63,0X66,0X67,0X73,0X74,0X61,0X74,0X6F,0X6E,0X65,0X63,0X6C,0X69,0X63,0X6B,0X73,0X6F,0X66,0X74,0X77,0X61,0X72,0X65,0X22,0X20,0X6E,0X61,0X6D,0X65,0X3D,0X22,0X73,0X74,0X61,0X74,0X6F,0X6E,0X65,0X63,0X6C,0X69,0X63,0X6B,0X73,0X6F,0X66,0X74,0X77,0X61,0X72,0X65,0X22,0X20,0X76,0X61,0X6C,0X75,0X65,0X3D,0X22,0X31,0X22,0X20,0X25,0X73,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X6C,0X61,0X62,0X65,0X6C,0X20,0X66,0X6F,0X72,0X3D,0X22,0X63,0X66,0X67,0X73,0X74,0X61,0X74,0X6F,0X6E,0X65,0X63,0X6C,0X69,0X63,0X6B,0X73,0X6F,0X66,0X74,0X77,0X61,0X72,0X65,0X22,0X3E,0X53,0X68,0X6F,0X77,0X20,0X4C,0X69,0X6B,0X65,0X2D,0X42,0X6F,0X6F,0X73,0X74,0X20,0X62,0X75,0X74,0X74,0X6F,0X6E,0X20,0X2D,0X20,0X53,0X68,0X6F,0X77,0X20,0X61,0X20,0X62,0X75,0X74,0X74,0X6F,0X6E,0X20,0X69,0X6E,0X20,0X74,0X68,0X65,0X20,0X73,0X74,0X61,0X74,0X75,0X73,0X20,0X77,0X68,0X69,0X63,0X68,0X20,0X6C,0X69,0X6B,0X65,0X73,0X20,0X61,0X6E,0X64,0X20,0X62,0X6F,0X6F,0X73,0X74,0X73,0X20,0X61,0X20,0X70,0X6F,0X73,0X74,0X3C,0X2F,0X6C,0X61,0X62,0X65,0X6C,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X2F,0X6C,0X69,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X21,0X2D,0X2D,0X20,0X3C,0X6C,0X69,0X3E,0X20,0X2D,0X2D,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X21,0X2D,0X2D,0X20,0X20,0X20,0X3C,0X69,0X6E,0X70,0X75,0X74,0X20,0X74,0X79,0X70,0X65,0X3D,0X22,0X63,0X68,0X65,0X63,0X6B,0X62,0X6F,0X78,0X22,0X20,0X69,0X64,0X3D,0X22,0X63,0X66,0X67,0X73,0X74,0X61,0X74,0X65,0X6D,0X6F,0X6A,0X6F,0X6C,0X69,0X6B,0X65,0X73,0X22,0X20,0X6E,0X61,0X6D,0X65,0X3D,0X22,0X73,0X74,0X61,0X74,0X65,0X6D,0X6F,0X6A,0X6F,0X6C,0X69,0X6B,0X65,0X73,0X22,0X20,0X76,0X61,0X6C,0X75,0X65,0X3D,0X22,0X31,0X22,0X20,0X25,0X73,0X3E,0X20,0X2D,0X2D,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X21,0X2D,0X2D,0X20,0X20,0X20,0X3C,0X6C,0X61,0X62,0X65,0X6C,0X20,0X66,0X6F,0X72,0X3D,0X22,0X63,0X66,0X67,0X73,0X74,0X61,0X74,0X65,0X6D,0X6F,0X6A,0X6F,0X6C,0X69,0X6B,0X65,0X73,0X22,0X3E,0X43,0X6F,0X6E,0X76,0X65,0X72,0X74,0X20,0X45,0X6D,0X6F,0X6A,0X69,0X20,0X72,0X65,0X61,0X63,0X74,0X73,0X20,0X74,0X6F,0X20,0X6C,0X69,0X6B,0X65,0X73,0X20,0X2D,0X20,0X41,0X6C,0X73,0X6F,0X20,0X64,0X69,0X73,0X61,0X62,0X6C,0X65,0X73,0X20,0X74,0X68,0X65,0X20,0X65,0X6D,0X6F,0X6A,0X69,0X20,0X72,0X65,0X61,0X63,0X74,0X69,0X6F,0X6E,0X20,0X62,0X75,0X74,0X74,0X6F,0X6E,0X3C,0X2F,0X6C,0X61,0X62,0X65,0X6C,0X3E,0X20,0X2D,0X2D,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X21,0X2D,0X2D,0X20,0X3C,0X2F,0X6C,0X69,0X3E,0X20,0X2D,0X2D,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X21,0X2D,0X2D,0X20,0X3C,0X6C,0X69,0X3E,0X20,0X2D,0X2D,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X21,0X2D,0X2D,0X20,0X20,0X20,0X3C,0X69,0X6E,0X70,0X75,0X74,0X20,0X74,0X79,0X70,0X65,0X3D,0X22,0X63,0X68,0X65,0X63,0X6B,0X62,0X6F,0X78,0X22,0X20,0X69,0X64,0X3D,0X22,0X63,0X66,0X67,0X73,0X74,0X61,0X74,0X68,0X69,0X64,0X65,0X6D,0X75,0X74,0X65,0X64,0X22,0X20,0X6E,0X61,0X6D,0X65,0X3D,0X22,0X73,0X74,0X61,0X74,0X68,0X69,0X64,0X65,0X6D,0X75,0X74,0X65,0X64,0X22,0X20,0X76,0X61,0X6C,0X75,0X65,0X3D,0X22,0X31,0X22,0X20,0X25,0X73,0X3E,0X20,0X2D,0X2D,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X21,0X2D,0X2D,0X20,0X20,0X20,0X3C,0X6C,0X61,0X62,0X65,0X6C,0X20,0X66,0X6F,0X72,0X3D,0X22,0X63,0X66,0X67,0X73,0X74,0X61,0X74,0X68,0X69,0X64,0X65,0X6D,0X75,0X74,0X65,0X64,0X22,0X3E,0X48,0X69,0X64,0X65,0X20,0X73,0X74,0X61,0X74,0X75,0X73,0X65,0X73,0X20,0X66,0X72,0X6F,0X6D,0X20,0X6D,0X75,0X74,0X65,0X64,0X20,0X75,0X73,0X65,0X72,0X73,0X20,0X61,0X6E,0X64,0X20,0X74,0X68,0X72,0X65,0X61,0X64,0X73,0X20,0X2D,0X20,0X49,0X66,0X20,0X64,0X69,0X73,0X61,0X62,0X6C,0X65,0X64,0X2C,0X20,0X73,0X74,0X61,0X74,0X75,0X73,0X65,0X73,0X20,0X77,0X69,0X6C,0X6C,0X20,0X61,0X70,0X70,0X65,0X61,0X72,0X20,0X63,0X6F,0X6C,0X6C,0X61,0X70,0X73,0X65,0X64,0X3C,0X2F,0X6C,0X61,0X62,0X65,0X6C,0X3E,0X20,0X2D,0X2D,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X21,0X2D,0X2D,0X20,0X3C,0X2F,0X6C,0X69,0X3E,0X20,0X2D,0X2D,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X2F,0X75,0X6C,0X3E,0XA,0XA,0X20,0X20,0X20,0X20,0X3C,0X68,0X33,0X3E,0X49,0X6E,0X73,0X74,0X61,0X6E,0X63,0X65,0X3C,0X2F,0X68,0X33,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X75,0X6C,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X21,0X2D,0X2D,0X20,0X3C,0X6C,0X69,0X3E,0X20,0X2D,0X2D,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X21,0X2D,0X2D,0X20,0X20,0X20,0X3C,0X69,0X6E,0X70,0X75,0X74,0X20,0X74,0X79,0X70,0X65,0X3D,0X22,0X63,0X68,0X65,0X63,0X6B,0X62,0X6F,0X78,0X22,0X20,0X69,0X64,0X3D,0X22,0X63,0X66,0X67,0X69,0X6E,0X73,0X74,0X61,0X6E,0X63,0X65,0X73,0X68,0X6F,0X77,0X73,0X68,0X6F,0X75,0X74,0X62,0X6F,0X78,0X22,0X20,0X6E,0X61,0X6D,0X65,0X3D,0X22,0X69,0X6E,0X73,0X74,0X61,0X6E,0X63,0X65,0X73,0X68,0X6F,0X77,0X73,0X68,0X6F,0X75,0X74,0X62,0X6F,0X78,0X22,0X20,0X76,0X61,0X6C,0X75,0X65,0X3D,0X22,0X31,0X22,0X20,0X25,0X73,0X3E,0X20,0X2D,0X2D,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X21,0X2D,0X2D,0X20,0X20,0X20,0X3C,0X6C,0X61,0X62,0X65,0X6C,0X20,0X66,0X6F,0X72,0X3D,0X22,0X63,0X66,0X67,0X69,0X6E,0X73,0X74,0X61,0X6E,0X63,0X65,0X73,0X68,0X6F,0X77,0X73,0X68,0X6F,0X75,0X74,0X62,0X6F,0X78,0X22,0X3E,0X53,0X68,0X6F,0X77,0X20,0X69,0X6E,0X73,0X74,0X61,0X6E,0X63,0X65,0X20,0X73,0X68,0X6F,0X75,0X74,0X62,0X6F,0X78,0X20,0X28,0X4A,0X53,0X20,0X72,0X65,0X71,0X75,0X69,0X72,0X65,0X64,0X29,0X3C,0X2F,0X6C,0X61,0X62,0X65,0X6C,0X3E,0X20,0X2D,0X2D,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X21,0X2D,0X2D,0X20,0X3C,0X2F,0X6C,0X69,0X3E,0X20,0X2D,0X2D,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X6C,0X69,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X69,0X6E,0X70,0X75,0X74,0X20,0X74,0X79,0X70,0X65,0X3D,0X22,0X63,0X68,0X65,0X63,0X6B,0X62,0X6F,0X78,0X22,0X20,0X69,0X64,0X3D,0X22,0X63,0X66,0X67,0X69,0X6E,0X73,0X74,0X61,0X6E,0X63,0X65,0X70,0X61,0X6E,0X65,0X6C,0X22,0X20,0X6E,0X61,0X6D,0X65,0X3D,0X22,0X69,0X6E,0X73,0X74,0X61,0X6E,0X63,0X65,0X70,0X61,0X6E,0X65,0X6C,0X22,0X20,0X76,0X61,0X6C,0X75,0X65,0X3D,0X22,0X31,0X22,0X20,0X25,0X73,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X6C,0X61,0X62,0X65,0X6C,0X20,0X66,0X6F,0X72,0X3D,0X22,0X63,0X66,0X67,0X69,0X6E,0X73,0X74,0X61,0X6E,0X63,0X65,0X70,0X61,0X6E,0X65,0X6C,0X22,0X3E,0X53,0X68,0X6F,0X77,0X20,0X69,0X6E,0X73,0X74,0X61,0X6E,0X63,0X65,0X20,0X70,0X61,0X6E,0X65,0X6C,0X20,0X2D,0X20,0X3C,0X65,0X6D,0X3E,0X41,0X64,0X6D,0X69,0X6E,0X73,0X20,0X73,0X68,0X6F,0X75,0X6C,0X64,0X20,0X3C,0X73,0X74,0X72,0X6F,0X6E,0X67,0X3E,0X6E,0X6F,0X74,0X3C,0X2F,0X73,0X74,0X72,0X6F,0X6E,0X67,0X3E,0X20,0X75,0X73,0X65,0X20,0X74,0X68,0X65,0X20,0X69,0X6E,0X73,0X74,0X61,0X6E,0X63,0X65,0X20,0X70,0X61,0X6E,0X65,0X6C,0X20,0X66,0X6F,0X72,0X20,0X6D,0X61,0X6A,0X6F,0X72,0X20,0X61,0X6E,0X6E,0X6F,0X75,0X6E,0X63,0X65,0X6D,0X65,0X6E,0X74,0X73,0X3C,0X2F,0X65,0X6D,0X3E,0X3C,0X2F,0X6C,0X61,0X62,0X65,0X6C,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X2F,0X6C,0X69,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X2F,0X75,0X6C,0X3E,0XA,0XA,0X20,0X20,0X20,0X20,0X3C,0X68,0X33,0X3E,0X4E,0X6F,0X74,0X69,0X66,0X69,0X63,0X61,0X74,0X69,0X6F,0X6E,0X73,0X3C,0X2F,0X68,0X33,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X75,0X6C,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X6C,0X69,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X69,0X6E,0X70,0X75,0X74,0X20,0X74,0X79,0X70,0X65,0X3D,0X22,0X63,0X68,0X65,0X63,0X6B,0X62,0X6F,0X78,0X22,0X20,0X69,0X64,0X3D,0X22,0X63,0X66,0X67,0X6E,0X6F,0X74,0X69,0X66,0X65,0X6D,0X62,0X65,0X64,0X22,0X20,0X6E,0X61,0X6D,0X65,0X3D,0X22,0X6E,0X6F,0X74,0X69,0X66,0X65,0X6D,0X62,0X65,0X64,0X22,0X20,0X76,0X61,0X6C,0X75,0X65,0X3D,0X22,0X31,0X22,0X20,0X25,0X73,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X6C,0X61,0X62,0X65,0X6C,0X20,0X66,0X6F,0X72,0X3D,0X22,0X63,0X66,0X67,0X6E,0X6F,0X74,0X69,0X66,0X65,0X6D,0X62,0X65,0X64,0X22,0X3E,0X44,0X69,0X73,0X70,0X6C,0X61,0X79,0X20,0X6E,0X6F,0X74,0X69,0X66,0X69,0X63,0X61,0X74,0X69,0X6F,0X6E,0X73,0X20,0X69,0X6E,0X20,0X69,0X46,0X72,0X61,0X6D,0X65,0X20,0X2D,0X20,0X69,0X46,0X72,0X61,0X6D,0X65,0X73,0X20,0X73,0X65,0X70,0X61,0X72,0X61,0X74,0X65,0X20,0X6C,0X6F,0X61,0X64,0X69,0X6E,0X67,0X20,0X66,0X72,0X6F,0X6D,0X20,0X74,0X68,0X65,0X20,0X6D,0X61,0X69,0X6E,0X20,0X70,0X61,0X67,0X65,0X3C,0X2F,0X6C,0X61,0X62,0X65,0X6C,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X2F,0X6C,0X69,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X2F,0X75,0X6C,0X3E,0XA,0XA,0X20,0X20,0X20,0X20,0X3C,0X69,0X6E,0X70,0X75,0X74,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X62,0X74,0X6E,0X20,0X62,0X74,0X6E,0X2D,0X73,0X69,0X6E,0X67,0X6C,0X65,0X22,0X20,0X74,0X79,0X70,0X65,0X3D,0X22,0X73,0X75,0X62,0X6D,0X69,0X74,0X22,0X20,0X76,0X61,0X6C,0X75,0X65,0X3D,0X22,0X53,0X61,0X76,0X65,0X22,0X3E,0XA,0X20,0X20,0X3C,0X2F,0X66,0X6F,0X72,0X6D,0X3E,0XA,0X3C,0X2F,0X64,0X69,0X76,0X3E,0}; struct config_general_template {const char* js_on; const char* jsactions_on; @@ -15,10 +16,5 @@ const char* instance_show_shoutbox_on; const char* instance_panel_on; const char* notifications_embed_on; }; -char* tmpl_gen_config_general(struct config_general_template* data, unsigned* size){ -char* ret; -unsigned s = easprintf(&ret, data_config_general, data->js_on?data->js_on:"", data->jsactions_on?data->jsactions_on:"", data->jsreply_on?data->jsreply_on:"", data->jslive_on?data->jslive_on:"", data->status_attachments_on?data->status_attachments_on:"", data->status_greentexts_on?data->status_greentexts_on:"", data->status_dopameme_on?data->status_dopameme_on:"", data->status_oneclicksoftware_on?data->status_oneclicksoftware_on:"", data->status_emojo_likes_on?data->status_emojo_likes_on:"", data->status_hide_muted_on?data->status_hide_muted_on:"", data->instance_show_shoutbox_on?data->instance_show_shoutbox_on:"", data->instance_panel_on?data->instance_panel_on:"", data->notifications_embed_on?data->notifications_embed_on:""); -if (size) *size = s; -return ret; -} +char* tmpl_gen_config_general(struct config_general_template* data, size_t* size); #endif diff --git a/static/config_sidebar.ctmpl b/static/config_sidebar.ctmpl index 305b8cb..ace28d5 100644 --- a/static/config_sidebar.ctmpl +++ b/static/config_sidebar.ctmpl @@ -1,17 +1,14 @@ #ifndef __config_sidebar #define __config_sidebar +#include static const char data_config_sidebar[] = {0X3C,0X75,0X6C,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X73,0X69,0X64,0X65,0X62,0X61,0X72,0X2D,0X63,0X6F,0X6E,0X66,0X69,0X67,0X22,0X3E,0XA,0X20,0X20,0X3C,0X6C,0X69,0X3E,0X3C,0X61,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X73,0X69,0X64,0X65,0X62,0X61,0X72,0X62,0X74,0X6E,0X2D,0X73,0X75,0X62,0X20,0X25,0X73,0X22,0X20,0X68,0X72,0X65,0X66,0X3D,0X22,0X25,0X73,0X2F,0X63,0X6F,0X6E,0X66,0X69,0X67,0X2F,0X67,0X65,0X6E,0X65,0X72,0X61,0X6C,0X22,0X3E,0X25,0X73,0X3C,0X2F,0X61,0X3E,0X3C,0X2F,0X6C,0X69,0X3E,0XA,0X20,0X20,0X3C,0X6C,0X69,0X3E,0X3C,0X61,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X73,0X69,0X64,0X65,0X62,0X61,0X72,0X62,0X74,0X6E,0X2D,0X73,0X75,0X62,0X20,0X25,0X73,0X22,0X20,0X68,0X72,0X65,0X66,0X3D,0X22,0X25,0X73,0X2F,0X63,0X6F,0X6E,0X66,0X69,0X67,0X2F,0X61,0X70,0X70,0X65,0X61,0X72,0X61,0X6E,0X63,0X65,0X22,0X3E,0X25,0X73,0X3C,0X2F,0X61,0X3E,0X3C,0X2F,0X6C,0X69,0X3E,0XA,0X20,0X20,0X3C,0X6C,0X69,0X3E,0X3C,0X61,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X73,0X69,0X64,0X65,0X62,0X61,0X72,0X62,0X74,0X6E,0X2D,0X73,0X75,0X62,0X20,0X25,0X73,0X22,0X20,0X68,0X72,0X65,0X66,0X3D,0X22,0X25,0X73,0X2F,0X63,0X6F,0X6E,0X66,0X69,0X67,0X2F,0X61,0X63,0X63,0X6F,0X75,0X6E,0X74,0X22,0X3E,0X25,0X73,0X3C,0X2F,0X61,0X3E,0X3C,0X2F,0X6C,0X69,0X3E,0XA,0X3C,0X2F,0X75,0X6C,0X3E,0}; struct config_sidebar_template {const char* general_active; +const char* prefix; const char* general; const char* appearance_active; const char* appearance; const char* account_active; const char* account; }; -char* tmpl_gen_config_sidebar(struct config_sidebar_template* data, unsigned* size){ -char* ret; -unsigned s = easprintf(&ret, data_config_sidebar, data->general_active?data->general_active:"", data->general?data->general:"", data->appearance_active?data->appearance_active:"", data->appearance?data->appearance:"", data->account_active?data->account_active:"", data->account?data->account:""); -if (size) *size = s; -return ret; -} +char* tmpl_gen_config_sidebar(struct config_sidebar_template* data, size_t* size); #endif diff --git a/static/config_sidebar.tmpl b/static/config_sidebar.tmpl index 51e3646..8cdae5b 100644 --- a/static/config_sidebar.tmpl +++ b/static/config_sidebar.tmpl @@ -1,5 +1,5 @@ diff --git a/static/directs_page.ctmpl b/static/directs_page.ctmpl index b11eeaf..3158bc8 100644 --- a/static/directs_page.ctmpl +++ b/static/directs_page.ctmpl @@ -1,12 +1,8 @@ #ifndef __directs_page #define __directs_page +#include static const char data_directs_page[] = {0X3C,0X64,0X69,0X76,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X73,0X69,0X6D,0X70,0X6C,0X65,0X2D,0X70,0X61,0X67,0X65,0X22,0X3E,0XA,0X20,0X20,0X3C,0X68,0X31,0X3E,0X44,0X69,0X72,0X65,0X63,0X74,0X20,0X4D,0X65,0X73,0X73,0X61,0X67,0X65,0X73,0X3C,0X2F,0X68,0X31,0X3E,0XA,0X3C,0X2F,0X64,0X69,0X76,0X3E,0XA,0X3C,0X64,0X69,0X76,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X64,0X69,0X72,0X65,0X63,0X74,0X2D,0X63,0X6F,0X6E,0X74,0X61,0X69,0X6E,0X65,0X72,0X22,0X3E,0XA,0X20,0X20,0X25,0X73,0XA,0X3C,0X2F,0X64,0X69,0X76,0X3E,0}; struct directs_page_template {const char* direct_content; }; -char* tmpl_gen_directs_page(struct directs_page_template* data, unsigned* size){ -char* ret; -unsigned s = easprintf(&ret, data_directs_page, data->direct_content?data->direct_content:""); -if (size) *size = s; -return ret; -} +char* tmpl_gen_directs_page(struct directs_page_template* data, size_t* size); #endif diff --git a/static/emoji.ctmpl b/static/emoji.ctmpl index 5375431..6c4cd3d 100644 --- a/static/emoji.ctmpl +++ b/static/emoji.ctmpl @@ -1,13 +1,9 @@ #ifndef __emoji #define __emoji +#include static const char data_emoji[] = {0X3C,0X61,0X20,0X68,0X72,0X65,0X66,0X3D,0X22,0X2F,0X73,0X74,0X61,0X74,0X75,0X73,0X2F,0X25,0X73,0X2F,0X72,0X65,0X61,0X63,0X74,0X2F,0X25,0X73,0X22,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X65,0X6D,0X6F,0X6A,0X69,0X22,0X3E,0X25,0X73,0X3C,0X2F,0X61,0X3E,0}; struct emoji_template {const char* status_id; const char* emoji; }; -char* tmpl_gen_emoji(struct emoji_template* data, unsigned* size){ -char* ret; -unsigned s = easprintf(&ret, data_emoji, data->status_id?data->status_id:"", data->emoji?data->emoji:"", data->emoji?data->emoji:""); -if (size) *size = s; -return ret; -} +char* tmpl_gen_emoji(struct emoji_template* data, size_t* size); #endif diff --git a/static/emoji_picker.ctmpl b/static/emoji_picker.ctmpl index 0b3ebbd..4fe5dba 100644 --- a/static/emoji_picker.ctmpl +++ b/static/emoji_picker.ctmpl @@ -1,7 +1,9 @@ #ifndef __emoji_picker #define __emoji_picker -static const char data_emoji_picker[] = {0X3C,0X64,0X69,0X76,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X65,0X6D,0X6F,0X6A,0X69,0X2D,0X70,0X69,0X63,0X6B,0X65,0X72,0X22,0X3E,0XA,0X20,0X20,0X3C,0X74,0X61,0X62,0X6C,0X65,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X74,0X61,0X62,0X73,0X20,0X75,0X69,0X2D,0X74,0X61,0X62,0X6C,0X65,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X74,0X72,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X66,0X6F,0X72,0X6D,0X20,0X61,0X63,0X74,0X69,0X6F,0X6E,0X3D,0X22,0X23,0X69,0X64,0X22,0X20,0X6D,0X65,0X74,0X68,0X6F,0X64,0X3D,0X22,0X70,0X6F,0X73,0X74,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X69,0X6E,0X70,0X75,0X74,0X20,0X74,0X79,0X70,0X65,0X3D,0X22,0X68,0X69,0X64,0X64,0X65,0X6E,0X22,0X20,0X6E,0X61,0X6D,0X65,0X3D,0X22,0X65,0X6D,0X6F,0X6A,0X6F,0X69,0X6E,0X64,0X65,0X78,0X22,0X20,0X76,0X61,0X6C,0X75,0X65,0X3D,0X22,0X30,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X69,0X6E,0X70,0X75,0X74,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X74,0X61,0X62,0X2D,0X62,0X74,0X6E,0X20,0X62,0X74,0X6E,0X20,0X62,0X74,0X6E,0X2D,0X61,0X6C,0X74,0X20,0X25,0X73,0X22,0X20,0X74,0X79,0X70,0X65,0X3D,0X22,0X73,0X75,0X62,0X6D,0X69,0X74,0X22,0X20,0X76,0X61,0X6C,0X75,0X65,0X3D,0X22,0XF0,0X9F,0X98,0X83,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X2F,0X66,0X6F,0X72,0X6D,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X2F,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X66,0X6F,0X72,0X6D,0X20,0X61,0X63,0X74,0X69,0X6F,0X6E,0X3D,0X22,0X23,0X69,0X64,0X22,0X20,0X6D,0X65,0X74,0X68,0X6F,0X64,0X3D,0X22,0X70,0X6F,0X73,0X74,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X69,0X6E,0X70,0X75,0X74,0X20,0X74,0X79,0X70,0X65,0X3D,0X22,0X68,0X69,0X64,0X64,0X65,0X6E,0X22,0X20,0X6E,0X61,0X6D,0X65,0X3D,0X22,0X65,0X6D,0X6F,0X6A,0X6F,0X69,0X6E,0X64,0X65,0X78,0X22,0X20,0X76,0X61,0X6C,0X75,0X65,0X3D,0X22,0X25,0X64,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X69,0X6E,0X70,0X75,0X74,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X74,0X61,0X62,0X2D,0X62,0X74,0X6E,0X20,0X62,0X74,0X6E,0X20,0X62,0X74,0X6E,0X2D,0X61,0X6C,0X74,0X20,0X25,0X73,0X22,0X20,0X74,0X79,0X70,0X65,0X3D,0X22,0X73,0X75,0X62,0X6D,0X69,0X74,0X22,0X20,0X76,0X61,0X6C,0X75,0X65,0X3D,0X22,0XF0,0X9F,0X90,0XBB,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X2F,0X66,0X6F,0X72,0X6D,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X2F,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X66,0X6F,0X72,0X6D,0X20,0X61,0X63,0X74,0X69,0X6F,0X6E,0X3D,0X22,0X23,0X69,0X64,0X22,0X20,0X6D,0X65,0X74,0X68,0X6F,0X64,0X3D,0X22,0X70,0X6F,0X73,0X74,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X69,0X6E,0X70,0X75,0X74,0X20,0X74,0X79,0X70,0X65,0X3D,0X22,0X68,0X69,0X64,0X64,0X65,0X6E,0X22,0X20,0X6E,0X61,0X6D,0X65,0X3D,0X22,0X65,0X6D,0X6F,0X6A,0X6F,0X69,0X6E,0X64,0X65,0X78,0X22,0X20,0X76,0X61,0X6C,0X75,0X65,0X3D,0X22,0X25,0X64,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X69,0X6E,0X70,0X75,0X74,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X74,0X61,0X62,0X2D,0X62,0X74,0X6E,0X20,0X62,0X74,0X6E,0X20,0X62,0X74,0X6E,0X2D,0X61,0X6C,0X74,0X20,0X25,0X73,0X22,0X20,0X74,0X79,0X70,0X65,0X3D,0X22,0X73,0X75,0X62,0X6D,0X69,0X74,0X22,0X20,0X76,0X61,0X6C,0X75,0X65,0X3D,0X22,0XF0,0X9F,0X8D,0X94,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X2F,0X66,0X6F,0X72,0X6D,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X2F,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X66,0X6F,0X72,0X6D,0X20,0X61,0X63,0X74,0X69,0X6F,0X6E,0X3D,0X22,0X23,0X69,0X64,0X22,0X20,0X6D,0X65,0X74,0X68,0X6F,0X64,0X3D,0X22,0X70,0X6F,0X73,0X74,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X69,0X6E,0X70,0X75,0X74,0X20,0X74,0X79,0X70,0X65,0X3D,0X22,0X68,0X69,0X64,0X64,0X65,0X6E,0X22,0X20,0X6E,0X61,0X6D,0X65,0X3D,0X22,0X65,0X6D,0X6F,0X6A,0X6F,0X69,0X6E,0X64,0X65,0X78,0X22,0X20,0X76,0X61,0X6C,0X75,0X65,0X3D,0X22,0X25,0X64,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X69,0X6E,0X70,0X75,0X74,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X74,0X61,0X62,0X2D,0X62,0X74,0X6E,0X20,0X62,0X74,0X6E,0X20,0X62,0X74,0X6E,0X2D,0X61,0X6C,0X74,0X20,0X25,0X73,0X22,0X20,0X74,0X79,0X70,0X65,0X3D,0X22,0X73,0X75,0X62,0X6D,0X69,0X74,0X22,0X20,0X76,0X61,0X6C,0X75,0X65,0X3D,0X22,0XF0,0X9F,0X9A,0X80,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X2F,0X66,0X6F,0X72,0X6D,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X2F,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X66,0X6F,0X72,0X6D,0X20,0X61,0X63,0X74,0X69,0X6F,0X6E,0X3D,0X22,0X23,0X69,0X64,0X22,0X20,0X6D,0X65,0X74,0X68,0X6F,0X64,0X3D,0X22,0X70,0X6F,0X73,0X74,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X69,0X6E,0X70,0X75,0X74,0X20,0X74,0X79,0X70,0X65,0X3D,0X22,0X68,0X69,0X64,0X64,0X65,0X6E,0X22,0X20,0X6E,0X61,0X6D,0X65,0X3D,0X22,0X65,0X6D,0X6F,0X6A,0X6F,0X69,0X6E,0X64,0X65,0X78,0X22,0X20,0X76,0X61,0X6C,0X75,0X65,0X3D,0X22,0X25,0X64,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X69,0X6E,0X70,0X75,0X74,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X74,0X61,0X62,0X2D,0X62,0X74,0X6E,0X20,0X62,0X74,0X6E,0X20,0X62,0X74,0X6E,0X2D,0X61,0X6C,0X74,0X20,0X25,0X73,0X22,0X20,0X74,0X79,0X70,0X65,0X3D,0X22,0X73,0X75,0X62,0X6D,0X69,0X74,0X22,0X20,0X76,0X61,0X6C,0X75,0X65,0X3D,0X22,0XE2,0X9A,0XBD,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X2F,0X66,0X6F,0X72,0X6D,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X2F,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X66,0X6F,0X72,0X6D,0X20,0X61,0X63,0X74,0X69,0X6F,0X6E,0X3D,0X22,0X23,0X69,0X64,0X22,0X20,0X6D,0X65,0X74,0X68,0X6F,0X64,0X3D,0X22,0X70,0X6F,0X73,0X74,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X69,0X6E,0X70,0X75,0X74,0X20,0X74,0X79,0X70,0X65,0X3D,0X22,0X68,0X69,0X64,0X64,0X65,0X6E,0X22,0X20,0X6E,0X61,0X6D,0X65,0X3D,0X22,0X65,0X6D,0X6F,0X6A,0X6F,0X69,0X6E,0X64,0X65,0X78,0X22,0X20,0X76,0X61,0X6C,0X75,0X65,0X3D,0X22,0X25,0X64,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X69,0X6E,0X70,0X75,0X74,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X74,0X61,0X62,0X2D,0X62,0X74,0X6E,0X20,0X62,0X74,0X6E,0X20,0X62,0X74,0X6E,0X2D,0X61,0X6C,0X74,0X20,0X25,0X73,0X22,0X20,0X74,0X79,0X70,0X65,0X3D,0X22,0X73,0X75,0X62,0X6D,0X69,0X74,0X22,0X20,0X76,0X61,0X6C,0X75,0X65,0X3D,0X22,0XF0,0X9F,0X94,0XA7,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X2F,0X66,0X6F,0X72,0X6D,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X2F,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X66,0X6F,0X72,0X6D,0X20,0X61,0X63,0X74,0X69,0X6F,0X6E,0X3D,0X22,0X23,0X69,0X64,0X22,0X20,0X6D,0X65,0X74,0X68,0X6F,0X64,0X3D,0X22,0X70,0X6F,0X73,0X74,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X69,0X6E,0X70,0X75,0X74,0X20,0X74,0X79,0X70,0X65,0X3D,0X22,0X68,0X69,0X64,0X64,0X65,0X6E,0X22,0X20,0X6E,0X61,0X6D,0X65,0X3D,0X22,0X65,0X6D,0X6F,0X6A,0X6F,0X69,0X6E,0X64,0X65,0X78,0X22,0X20,0X76,0X61,0X6C,0X75,0X65,0X3D,0X22,0X25,0X64,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X69,0X6E,0X70,0X75,0X74,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X74,0X61,0X62,0X2D,0X62,0X74,0X6E,0X20,0X62,0X74,0X6E,0X20,0X62,0X74,0X6E,0X2D,0X61,0X6C,0X74,0X20,0X25,0X73,0X22,0X20,0X74,0X79,0X70,0X65,0X3D,0X22,0X73,0X75,0X62,0X6D,0X69,0X74,0X22,0X20,0X76,0X61,0X6C,0X75,0X65,0X3D,0X22,0XF0,0X9F,0X94,0XA2,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X2F,0X66,0X6F,0X72,0X6D,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X2F,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X66,0X6F,0X72,0X6D,0X20,0X61,0X63,0X74,0X69,0X6F,0X6E,0X3D,0X22,0X23,0X69,0X64,0X22,0X20,0X6D,0X65,0X74,0X68,0X6F,0X64,0X3D,0X22,0X70,0X6F,0X73,0X74,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X69,0X6E,0X70,0X75,0X74,0X20,0X74,0X79,0X70,0X65,0X3D,0X22,0X68,0X69,0X64,0X64,0X65,0X6E,0X22,0X20,0X6E,0X61,0X6D,0X65,0X3D,0X22,0X65,0X6D,0X6F,0X6A,0X6F,0X69,0X6E,0X64,0X65,0X78,0X22,0X20,0X76,0X61,0X6C,0X75,0X65,0X3D,0X22,0X25,0X64,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X69,0X6E,0X70,0X75,0X74,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X74,0X61,0X62,0X2D,0X62,0X74,0X6E,0X20,0X62,0X74,0X6E,0X20,0X62,0X74,0X6E,0X2D,0X61,0X6C,0X74,0X20,0X25,0X73,0X22,0X20,0X74,0X79,0X70,0X65,0X3D,0X22,0X73,0X75,0X62,0X6D,0X69,0X74,0X22,0X20,0X76,0X61,0X6C,0X75,0X65,0X3D,0X22,0XF0,0X9F,0X8E,0X8C,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X2F,0X66,0X6F,0X72,0X6D,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X2F,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X2F,0X74,0X72,0X3E,0XA,0X20,0X20,0X3C,0X2F,0X74,0X61,0X62,0X6C,0X65,0X3E,0XA,0XA,0X20,0X20,0XA,0X20,0X20,0X3C,0X64,0X69,0X76,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X65,0X6D,0X6F,0X6A,0X69,0X2D,0X70,0X69,0X63,0X6B,0X65,0X72,0X2D,0X65,0X6D,0X6F,0X6A,0X6F,0X73,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X25,0X73,0XA,0X20,0X20,0X3C,0X2F,0X64,0X69,0X76,0X3E,0XA,0X20,0X20,0XA,0X20,0X20,0X3C,0X74,0X61,0X62,0X6C,0X65,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X6E,0X61,0X76,0X69,0X67,0X61,0X74,0X69,0X6F,0X6E,0X20,0X75,0X69,0X2D,0X74,0X61,0X62,0X6C,0X65,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X74,0X72,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X74,0X64,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X6E,0X61,0X76,0X2D,0X70,0X72,0X65,0X76,0X20,0X62,0X74,0X6E,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X66,0X6F,0X72,0X6D,0X20,0X61,0X63,0X74,0X69,0X6F,0X6E,0X3D,0X22,0X23,0X69,0X64,0X2D,0X25,0X73,0X22,0X20,0X6D,0X65,0X74,0X68,0X6F,0X64,0X3D,0X22,0X70,0X6F,0X73,0X74,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X6C,0X61,0X62,0X65,0X6C,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X70,0X6F,0X69,0X6E,0X74,0X65,0X72,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X69,0X6E,0X70,0X75,0X74,0X20,0X74,0X79,0X70,0X65,0X3D,0X22,0X68,0X69,0X64,0X64,0X65,0X6E,0X22,0X20,0X6E,0X61,0X6D,0X65,0X3D,0X22,0X65,0X6D,0X6F,0X6A,0X6F,0X69,0X6E,0X64,0X65,0X78,0X22,0X20,0X76,0X61,0X6C,0X75,0X65,0X3D,0X22,0X25,0X75,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X73,0X70,0X61,0X6E,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X6E,0X61,0X76,0X2D,0X62,0X74,0X6E,0X20,0X25,0X73,0X22,0X3E,0X50,0X72,0X65,0X76,0X69,0X6F,0X75,0X73,0X3C,0X2F,0X73,0X70,0X61,0X6E,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X69,0X6E,0X70,0X75,0X74,0X20,0X74,0X79,0X70,0X65,0X3D,0X22,0X73,0X75,0X62,0X6D,0X69,0X74,0X22,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X68,0X69,0X64,0X64,0X65,0X6E,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X2F,0X6C,0X61,0X62,0X65,0X6C,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X2F,0X66,0X6F,0X72,0X6D,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X2F,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X74,0X64,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X6E,0X61,0X76,0X2D,0X6E,0X65,0X78,0X74,0X20,0X62,0X74,0X6E,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X66,0X6F,0X72,0X6D,0X20,0X61,0X63,0X74,0X69,0X6F,0X6E,0X3D,0X22,0X23,0X69,0X64,0X2D,0X25,0X73,0X22,0X20,0X6D,0X65,0X74,0X68,0X6F,0X64,0X3D,0X22,0X70,0X6F,0X73,0X74,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X6C,0X61,0X62,0X65,0X6C,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X70,0X6F,0X69,0X6E,0X74,0X65,0X72,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X69,0X6E,0X70,0X75,0X74,0X20,0X74,0X79,0X70,0X65,0X3D,0X22,0X68,0X69,0X64,0X64,0X65,0X6E,0X22,0X20,0X6E,0X61,0X6D,0X65,0X3D,0X22,0X65,0X6D,0X6F,0X6A,0X6F,0X69,0X6E,0X64,0X65,0X78,0X22,0X20,0X76,0X61,0X6C,0X75,0X65,0X3D,0X22,0X25,0X75,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X73,0X70,0X61,0X6E,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X6E,0X61,0X76,0X2D,0X62,0X74,0X6E,0X22,0X3E,0X4E,0X65,0X78,0X74,0X3C,0X2F,0X73,0X70,0X61,0X6E,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X69,0X6E,0X70,0X75,0X74,0X20,0X74,0X79,0X70,0X65,0X3D,0X22,0X73,0X75,0X62,0X6D,0X69,0X74,0X22,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X68,0X69,0X64,0X64,0X65,0X6E,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X2F,0X6C,0X61,0X62,0X65,0X6C,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X2F,0X66,0X6F,0X72,0X6D,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X2F,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X2F,0X74,0X72,0X3E,0XA,0X20,0X20,0X3C,0X2F,0X74,0X61,0X62,0X6C,0X65,0X3E,0XA,0X3C,0X2F,0X64,0X69,0X76,0X3E,0}; -struct emoji_picker_template {const char* cat_smileys; +#include +static const char data_emoji_picker[] = {0X3C,0X64,0X69,0X76,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X65,0X6D,0X6F,0X6A,0X69,0X2D,0X70,0X69,0X63,0X6B,0X65,0X72,0X22,0X3E,0XA,0X20,0X20,0X3C,0X74,0X61,0X62,0X6C,0X65,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X74,0X61,0X62,0X73,0X20,0X75,0X69,0X2D,0X74,0X61,0X62,0X6C,0X65,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X74,0X72,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X66,0X6F,0X72,0X6D,0X20,0X61,0X63,0X74,0X69,0X6F,0X6E,0X3D,0X22,0X23,0X25,0X73,0X22,0X20,0X6D,0X65,0X74,0X68,0X6F,0X64,0X3D,0X22,0X70,0X6F,0X73,0X74,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X69,0X6E,0X70,0X75,0X74,0X20,0X74,0X79,0X70,0X65,0X3D,0X22,0X68,0X69,0X64,0X64,0X65,0X6E,0X22,0X20,0X6E,0X61,0X6D,0X65,0X3D,0X22,0X65,0X6D,0X6F,0X6A,0X6F,0X69,0X6E,0X64,0X65,0X78,0X22,0X20,0X76,0X61,0X6C,0X75,0X65,0X3D,0X22,0X30,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X69,0X6E,0X70,0X75,0X74,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X74,0X61,0X62,0X2D,0X62,0X74,0X6E,0X20,0X62,0X74,0X6E,0X20,0X62,0X74,0X6E,0X2D,0X61,0X6C,0X74,0X20,0X25,0X73,0X22,0X20,0X74,0X79,0X70,0X65,0X3D,0X22,0X73,0X75,0X62,0X6D,0X69,0X74,0X22,0X20,0X76,0X61,0X6C,0X75,0X65,0X3D,0X22,0XF0,0X9F,0X98,0X83,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X2F,0X66,0X6F,0X72,0X6D,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X2F,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X66,0X6F,0X72,0X6D,0X20,0X61,0X63,0X74,0X69,0X6F,0X6E,0X3D,0X22,0X23,0X25,0X73,0X22,0X20,0X6D,0X65,0X74,0X68,0X6F,0X64,0X3D,0X22,0X70,0X6F,0X73,0X74,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X69,0X6E,0X70,0X75,0X74,0X20,0X74,0X79,0X70,0X65,0X3D,0X22,0X68,0X69,0X64,0X64,0X65,0X6E,0X22,0X20,0X6E,0X61,0X6D,0X65,0X3D,0X22,0X65,0X6D,0X6F,0X6A,0X6F,0X69,0X6E,0X64,0X65,0X78,0X22,0X20,0X76,0X61,0X6C,0X75,0X65,0X3D,0X22,0X25,0X64,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X69,0X6E,0X70,0X75,0X74,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X74,0X61,0X62,0X2D,0X62,0X74,0X6E,0X20,0X62,0X74,0X6E,0X20,0X62,0X74,0X6E,0X2D,0X61,0X6C,0X74,0X20,0X25,0X73,0X22,0X20,0X74,0X79,0X70,0X65,0X3D,0X22,0X73,0X75,0X62,0X6D,0X69,0X74,0X22,0X20,0X76,0X61,0X6C,0X75,0X65,0X3D,0X22,0XF0,0X9F,0X90,0XBB,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X2F,0X66,0X6F,0X72,0X6D,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X2F,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X66,0X6F,0X72,0X6D,0X20,0X61,0X63,0X74,0X69,0X6F,0X6E,0X3D,0X22,0X23,0X25,0X73,0X22,0X20,0X6D,0X65,0X74,0X68,0X6F,0X64,0X3D,0X22,0X70,0X6F,0X73,0X74,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X69,0X6E,0X70,0X75,0X74,0X20,0X74,0X79,0X70,0X65,0X3D,0X22,0X68,0X69,0X64,0X64,0X65,0X6E,0X22,0X20,0X6E,0X61,0X6D,0X65,0X3D,0X22,0X65,0X6D,0X6F,0X6A,0X6F,0X69,0X6E,0X64,0X65,0X78,0X22,0X20,0X76,0X61,0X6C,0X75,0X65,0X3D,0X22,0X25,0X64,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X69,0X6E,0X70,0X75,0X74,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X74,0X61,0X62,0X2D,0X62,0X74,0X6E,0X20,0X62,0X74,0X6E,0X20,0X62,0X74,0X6E,0X2D,0X61,0X6C,0X74,0X20,0X25,0X73,0X22,0X20,0X74,0X79,0X70,0X65,0X3D,0X22,0X73,0X75,0X62,0X6D,0X69,0X74,0X22,0X20,0X76,0X61,0X6C,0X75,0X65,0X3D,0X22,0XF0,0X9F,0X8D,0X94,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X2F,0X66,0X6F,0X72,0X6D,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X2F,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X66,0X6F,0X72,0X6D,0X20,0X61,0X63,0X74,0X69,0X6F,0X6E,0X3D,0X22,0X23,0X25,0X73,0X22,0X20,0X6D,0X65,0X74,0X68,0X6F,0X64,0X3D,0X22,0X70,0X6F,0X73,0X74,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X69,0X6E,0X70,0X75,0X74,0X20,0X74,0X79,0X70,0X65,0X3D,0X22,0X68,0X69,0X64,0X64,0X65,0X6E,0X22,0X20,0X6E,0X61,0X6D,0X65,0X3D,0X22,0X65,0X6D,0X6F,0X6A,0X6F,0X69,0X6E,0X64,0X65,0X78,0X22,0X20,0X76,0X61,0X6C,0X75,0X65,0X3D,0X22,0X25,0X64,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X69,0X6E,0X70,0X75,0X74,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X74,0X61,0X62,0X2D,0X62,0X74,0X6E,0X20,0X62,0X74,0X6E,0X20,0X62,0X74,0X6E,0X2D,0X61,0X6C,0X74,0X20,0X25,0X73,0X22,0X20,0X74,0X79,0X70,0X65,0X3D,0X22,0X73,0X75,0X62,0X6D,0X69,0X74,0X22,0X20,0X76,0X61,0X6C,0X75,0X65,0X3D,0X22,0XF0,0X9F,0X9A,0X80,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X2F,0X66,0X6F,0X72,0X6D,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X2F,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X66,0X6F,0X72,0X6D,0X20,0X61,0X63,0X74,0X69,0X6F,0X6E,0X3D,0X22,0X23,0X25,0X73,0X22,0X20,0X6D,0X65,0X74,0X68,0X6F,0X64,0X3D,0X22,0X70,0X6F,0X73,0X74,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X69,0X6E,0X70,0X75,0X74,0X20,0X74,0X79,0X70,0X65,0X3D,0X22,0X68,0X69,0X64,0X64,0X65,0X6E,0X22,0X20,0X6E,0X61,0X6D,0X65,0X3D,0X22,0X65,0X6D,0X6F,0X6A,0X6F,0X69,0X6E,0X64,0X65,0X78,0X22,0X20,0X76,0X61,0X6C,0X75,0X65,0X3D,0X22,0X25,0X64,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X69,0X6E,0X70,0X75,0X74,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X74,0X61,0X62,0X2D,0X62,0X74,0X6E,0X20,0X62,0X74,0X6E,0X20,0X62,0X74,0X6E,0X2D,0X61,0X6C,0X74,0X20,0X25,0X73,0X22,0X20,0X74,0X79,0X70,0X65,0X3D,0X22,0X73,0X75,0X62,0X6D,0X69,0X74,0X22,0X20,0X76,0X61,0X6C,0X75,0X65,0X3D,0X22,0XE2,0X9A,0XBD,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X2F,0X66,0X6F,0X72,0X6D,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X2F,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X66,0X6F,0X72,0X6D,0X20,0X61,0X63,0X74,0X69,0X6F,0X6E,0X3D,0X22,0X23,0X25,0X73,0X22,0X20,0X6D,0X65,0X74,0X68,0X6F,0X64,0X3D,0X22,0X70,0X6F,0X73,0X74,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X69,0X6E,0X70,0X75,0X74,0X20,0X74,0X79,0X70,0X65,0X3D,0X22,0X68,0X69,0X64,0X64,0X65,0X6E,0X22,0X20,0X6E,0X61,0X6D,0X65,0X3D,0X22,0X65,0X6D,0X6F,0X6A,0X6F,0X69,0X6E,0X64,0X65,0X78,0X22,0X20,0X76,0X61,0X6C,0X75,0X65,0X3D,0X22,0X25,0X64,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X69,0X6E,0X70,0X75,0X74,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X74,0X61,0X62,0X2D,0X62,0X74,0X6E,0X20,0X62,0X74,0X6E,0X20,0X62,0X74,0X6E,0X2D,0X61,0X6C,0X74,0X20,0X25,0X73,0X22,0X20,0X74,0X79,0X70,0X65,0X3D,0X22,0X73,0X75,0X62,0X6D,0X69,0X74,0X22,0X20,0X76,0X61,0X6C,0X75,0X65,0X3D,0X22,0XF0,0X9F,0X94,0XA7,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X2F,0X66,0X6F,0X72,0X6D,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X2F,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X66,0X6F,0X72,0X6D,0X20,0X61,0X63,0X74,0X69,0X6F,0X6E,0X3D,0X22,0X23,0X25,0X73,0X22,0X20,0X6D,0X65,0X74,0X68,0X6F,0X64,0X3D,0X22,0X70,0X6F,0X73,0X74,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X69,0X6E,0X70,0X75,0X74,0X20,0X74,0X79,0X70,0X65,0X3D,0X22,0X68,0X69,0X64,0X64,0X65,0X6E,0X22,0X20,0X6E,0X61,0X6D,0X65,0X3D,0X22,0X65,0X6D,0X6F,0X6A,0X6F,0X69,0X6E,0X64,0X65,0X78,0X22,0X20,0X76,0X61,0X6C,0X75,0X65,0X3D,0X22,0X25,0X64,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X69,0X6E,0X70,0X75,0X74,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X74,0X61,0X62,0X2D,0X62,0X74,0X6E,0X20,0X62,0X74,0X6E,0X20,0X62,0X74,0X6E,0X2D,0X61,0X6C,0X74,0X20,0X25,0X73,0X22,0X20,0X74,0X79,0X70,0X65,0X3D,0X22,0X73,0X75,0X62,0X6D,0X69,0X74,0X22,0X20,0X76,0X61,0X6C,0X75,0X65,0X3D,0X22,0XF0,0X9F,0X94,0XA2,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X2F,0X66,0X6F,0X72,0X6D,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X2F,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X66,0X6F,0X72,0X6D,0X20,0X61,0X63,0X74,0X69,0X6F,0X6E,0X3D,0X22,0X23,0X25,0X73,0X22,0X20,0X6D,0X65,0X74,0X68,0X6F,0X64,0X3D,0X22,0X70,0X6F,0X73,0X74,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X69,0X6E,0X70,0X75,0X74,0X20,0X74,0X79,0X70,0X65,0X3D,0X22,0X68,0X69,0X64,0X64,0X65,0X6E,0X22,0X20,0X6E,0X61,0X6D,0X65,0X3D,0X22,0X65,0X6D,0X6F,0X6A,0X6F,0X69,0X6E,0X64,0X65,0X78,0X22,0X20,0X76,0X61,0X6C,0X75,0X65,0X3D,0X22,0X25,0X64,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X69,0X6E,0X70,0X75,0X74,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X74,0X61,0X62,0X2D,0X62,0X74,0X6E,0X20,0X62,0X74,0X6E,0X20,0X62,0X74,0X6E,0X2D,0X61,0X6C,0X74,0X20,0X25,0X73,0X22,0X20,0X74,0X79,0X70,0X65,0X3D,0X22,0X73,0X75,0X62,0X6D,0X69,0X74,0X22,0X20,0X76,0X61,0X6C,0X75,0X65,0X3D,0X22,0XF0,0X9F,0X8E,0X8C,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X2F,0X66,0X6F,0X72,0X6D,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X2F,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X2F,0X74,0X72,0X3E,0XA,0X20,0X20,0X3C,0X2F,0X74,0X61,0X62,0X6C,0X65,0X3E,0XA,0XA,0X20,0X20,0XA,0X20,0X20,0X3C,0X64,0X69,0X76,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X65,0X6D,0X6F,0X6A,0X69,0X2D,0X70,0X69,0X63,0X6B,0X65,0X72,0X2D,0X65,0X6D,0X6F,0X6A,0X6F,0X73,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X25,0X73,0XA,0X20,0X20,0X3C,0X2F,0X64,0X69,0X76,0X3E,0XA,0X20,0X20,0XA,0X20,0X20,0X3C,0X74,0X61,0X62,0X6C,0X65,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X6E,0X61,0X76,0X69,0X67,0X61,0X74,0X69,0X6F,0X6E,0X20,0X75,0X69,0X2D,0X74,0X61,0X62,0X6C,0X65,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X74,0X72,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X74,0X64,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X6E,0X61,0X76,0X2D,0X70,0X72,0X65,0X76,0X20,0X62,0X74,0X6E,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X66,0X6F,0X72,0X6D,0X20,0X61,0X63,0X74,0X69,0X6F,0X6E,0X3D,0X22,0X23,0X25,0X73,0X22,0X20,0X6D,0X65,0X74,0X68,0X6F,0X64,0X3D,0X22,0X70,0X6F,0X73,0X74,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X6C,0X61,0X62,0X65,0X6C,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X70,0X6F,0X69,0X6E,0X74,0X65,0X72,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X69,0X6E,0X70,0X75,0X74,0X20,0X74,0X79,0X70,0X65,0X3D,0X22,0X68,0X69,0X64,0X64,0X65,0X6E,0X22,0X20,0X6E,0X61,0X6D,0X65,0X3D,0X22,0X65,0X6D,0X6F,0X6A,0X6F,0X69,0X6E,0X64,0X65,0X78,0X22,0X20,0X76,0X61,0X6C,0X75,0X65,0X3D,0X22,0X25,0X75,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X73,0X70,0X61,0X6E,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X6E,0X61,0X76,0X2D,0X62,0X74,0X6E,0X20,0X25,0X73,0X22,0X3E,0X50,0X72,0X65,0X76,0X69,0X6F,0X75,0X73,0X3C,0X2F,0X73,0X70,0X61,0X6E,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X69,0X6E,0X70,0X75,0X74,0X20,0X74,0X79,0X70,0X65,0X3D,0X22,0X73,0X75,0X62,0X6D,0X69,0X74,0X22,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X68,0X69,0X64,0X64,0X65,0X6E,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X2F,0X6C,0X61,0X62,0X65,0X6C,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X2F,0X66,0X6F,0X72,0X6D,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X2F,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X74,0X64,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X6E,0X61,0X76,0X2D,0X6E,0X65,0X78,0X74,0X20,0X62,0X74,0X6E,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X66,0X6F,0X72,0X6D,0X20,0X61,0X63,0X74,0X69,0X6F,0X6E,0X3D,0X22,0X23,0X25,0X73,0X22,0X20,0X6D,0X65,0X74,0X68,0X6F,0X64,0X3D,0X22,0X70,0X6F,0X73,0X74,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X6C,0X61,0X62,0X65,0X6C,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X70,0X6F,0X69,0X6E,0X74,0X65,0X72,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X69,0X6E,0X70,0X75,0X74,0X20,0X74,0X79,0X70,0X65,0X3D,0X22,0X68,0X69,0X64,0X64,0X65,0X6E,0X22,0X20,0X6E,0X61,0X6D,0X65,0X3D,0X22,0X65,0X6D,0X6F,0X6A,0X6F,0X69,0X6E,0X64,0X65,0X78,0X22,0X20,0X76,0X61,0X6C,0X75,0X65,0X3D,0X22,0X25,0X75,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X73,0X70,0X61,0X6E,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X6E,0X61,0X76,0X2D,0X62,0X74,0X6E,0X22,0X3E,0X4E,0X65,0X78,0X74,0X3C,0X2F,0X73,0X70,0X61,0X6E,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X69,0X6E,0X70,0X75,0X74,0X20,0X74,0X79,0X70,0X65,0X3D,0X22,0X73,0X75,0X62,0X6D,0X69,0X74,0X22,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X68,0X69,0X64,0X64,0X65,0X6E,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X2F,0X6C,0X61,0X62,0X65,0X6C,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X2F,0X66,0X6F,0X72,0X6D,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X2F,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X2F,0X74,0X72,0X3E,0XA,0X20,0X20,0X3C,0X2F,0X74,0X61,0X62,0X6C,0X65,0X3E,0XA,0X3C,0X2F,0X64,0X69,0X76,0X3E,0}; +struct emoji_picker_template {const char* status_id; +const char* cat_smileys; int animals; const char* cat_animals; int food; @@ -17,15 +19,9 @@ const char* cat_symbols; int flags; const char* cat_flags; const char* emojis; -const char* status_id; unsigned index_previous; const char* previous_enabled; unsigned index_next; }; -char* tmpl_gen_emoji_picker(struct emoji_picker_template* data, unsigned* size){ -char* ret; -unsigned s = easprintf(&ret, data_emoji_picker, data->cat_smileys?data->cat_smileys:"", data->animals, data->cat_animals?data->cat_animals:"", data->food, data->cat_food?data->cat_food:"", data->travel, data->cat_travel?data->cat_travel:"", data->activities, data->cat_activities?data->cat_activities:"", data->objects, data->cat_objects?data->cat_objects:"", data->symbols, data->cat_symbols?data->cat_symbols:"", data->flags, data->cat_flags?data->cat_flags:"", data->emojis?data->emojis:"", data->status_id?data->status_id:"", data->index_previous, data->previous_enabled?data->previous_enabled:"", data->status_id?data->status_id:"", data->index_next); -if (size) *size = s; -return ret; -} +char* tmpl_gen_emoji_picker(struct emoji_picker_template* data, size_t* size); #endif diff --git a/static/emoji_picker.tmpl b/static/emoji_picker.tmpl index ff295f8..d5fbaeb 100644 --- a/static/emoji_picker.tmpl +++ b/static/emoji_picker.tmpl @@ -2,49 +2,49 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -60,7 +60,7 @@