Templates rewritten

FossilOrigin-Name: 829485569f9ea39c9f417e7c4eb1a104665da0bb0257ba6fc8dd4b711a031d98
This commit is contained in:
nekobit 2022-06-01 06:08:00 +00:00
parent 382bbe4a13
commit d4c7564e03
92 changed files with 546 additions and 725 deletions

View File

@ -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

View File

@ -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,

View File

@ -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);

View File

@ -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);
}

View File

@ -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

View File

@ -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;
}

View File

@ -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;

View File

@ -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,

View File

@ -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)

View File

@ -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;

View File

@ -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)

View File

@ -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,

View File

@ -21,7 +21,7 @@
#include "easprintf.h"
// Pages
#include "../static/navigation.chtml"
#include "../static/navigation.ctmpl"
#define SUBMIT_HTML "<input type=\"submit\" class=\"hidden\">"
@ -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);
}

View File

@ -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(&notif_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(&notif_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);

View File

@ -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
};

View File

@ -24,7 +24,7 @@
#include "../config.h"
// Pages
#include "../static/post.chtml"
#include "../static/post.ctmpl"
#define ID_REPLY_SIZE 256
#define ID_RESPONSE "<input type=\"hidden\" name=\"replyid\" value=\"%s\">"
@ -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:

View File

@ -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)

View File

@ -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,

View File

@ -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 "((?:^|<br/?>|\\s)&gt;.*?)(?:<br/?>|$)"
@ -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(&notif_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);

View File

@ -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,

View File

@ -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)

View File

@ -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);

View File

@ -159,6 +159,7 @@ void print_template(char* var, char* buf)
printf("#ifndef __%s\n"
"#define __%s\n"
"#include <stddef.h>\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!

View File

@ -24,7 +24,7 @@
#include "easprintf.h"
// Pages
#include "../static/test.chtml"
#include "../static/test.ctmpl"
#define ENV_NOT_FOUND "<span style=\"color:red;\">ENV Not Found</span>"
@ -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,

View File

@ -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,

View File

@ -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 "";

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -26,12 +26,12 @@
</a>
<a href="#" class="header-btn btn">
<span class="btn-header">{{%s:tab_following_count}}</span>
<span class="btn-header">{{%s:tab_following_text}}</span>
<span class="btn-content">{{%d:following_count}}</span>
</a>
<a href="#" class="header-btn btn">
<span class="btn-header">{{%s:tab_followers_count}}</span>
<span class="btn-header">{{%s:tab_followers_text}}</span>
<span class="btn-content">{{%d:followers_count}}</span>
</a>

View File

@ -1,5 +1,6 @@
#ifndef __account_follow_btn
#define __account_follow_btn
#include <stddef.h>
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

View File

@ -1,12 +1,8 @@
#ifndef __account_info
#define __account_info
#include <stddef.h>
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

View File

@ -1,5 +1,6 @@
#ifndef __account_sidebar
#define __account_sidebar
#include <stddef.h>
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

View File

@ -1,16 +1,11 @@
#ifndef __account_stub
#define __account_stub
#include <stddef.h>
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

View File

@ -1,13 +1,9 @@
#ifndef __attachment_audio
#define __attachment_audio
#include <stddef.h>
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

View File

@ -1,13 +1,9 @@
#ifndef __attachment_gifv
#define __attachment_gifv
#include <stddef.h>
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

View File

@ -1,13 +1,9 @@
#ifndef __attachment_image
#define __attachment_image
#include <stddef.h>
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

View File

@ -1,13 +1,9 @@
#ifndef __attachment_link
#define __attachment_link
#include <stddef.h>
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

View File

@ -1,13 +1,9 @@
#ifndef __attachment_video
#define __attachment_video
#include <stddef.h>
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

View File

@ -1,12 +1,8 @@
#ifndef __attachments
#define __attachments
#include <stddef.h>
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

View File

@ -1,12 +1,8 @@
#ifndef __bar
#define __bar
#include <stddef.h>
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

View File

@ -1,12 +1,8 @@
#ifndef __bar_graph
#define __bar_graph
#include <stddef.h>
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

View File

@ -1,13 +1,9 @@
#ifndef __bookmarks_page
#define __bookmarks_page
#include <stddef.h>
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

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,17 +1,14 @@
#ifndef __config_sidebar
#define __config_sidebar
#include <stddef.h>
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

View File

@ -1,5 +1,5 @@
<ul class="sidebar-config">
<li><a class="sidebarbtn-sub {{%s:general_active}}" href="%s/config/general">{{%s:general}}</a></li>
<li><a class="sidebarbtn-sub {{%s:appearance_active}}" href="%s/config/appearance">{{%s:appearance}}</a></li>
<li><a class="sidebarbtn-sub {{%s:account_active}}" href="%s/config/account">{{%s:account}}</a></li>
<li><a class="sidebarbtn-sub {{%s:general_active}}" href="{{%s:prefix}}/config/general">{{%s:general}}</a></li>
<li><a class="sidebarbtn-sub {{%s:appearance_active}}" href="{{%s:prefix}}/config/appearance">{{%s:appearance}}</a></li>
<li><a class="sidebarbtn-sub {{%s:account_active}}" href="{{%s:prefix}}/config/account">{{%s:account}}</a></li>
</ul>

View File

@ -1,12 +1,8 @@
#ifndef __directs_page
#define __directs_page
#include <stddef.h>
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

View File

@ -1,13 +1,9 @@
#ifndef __emoji
#define __emoji
#include <stddef.h>
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

File diff suppressed because one or more lines are too long

View File

@ -2,49 +2,49 @@
<table class="tabs ui-table">
<tr>
<td>
<form action="#id" method="post">
<form action="#{{%s:status_id}}" method="post">
<input type="hidden" name="emojoindex" value="0">
<input class="tab-btn btn btn-alt {{%s:cat_smileys}}" type="submit" value="😃">
</form>
</td>
<td>
<form action="#id" method="post">
<form action="#{{%s:status_id}}" method="post">
<input type="hidden" name="emojoindex" value="{{%d:animals}}">
<input class="tab-btn btn btn-alt {{%s:cat_animals}}" type="submit" value="🐻">
</form>
</td>
<td>
<form action="#id" method="post">
<form action="#{{%s:status_id}}" method="post">
<input type="hidden" name="emojoindex" value="{{%d:food}}">
<input class="tab-btn btn btn-alt {{%s:cat_food}}" type="submit" value="🍔">
</form>
</td>
<td>
<form action="#id" method="post">
<form action="#{{%s:status_id}}" method="post">
<input type="hidden" name="emojoindex" value="{{%d:travel}}">
<input class="tab-btn btn btn-alt {{%s:cat_travel}}" type="submit" value="🚀">
</form>
</td>
<td>
<form action="#id" method="post">
<form action="#{{%s:status_id}}" method="post">
<input type="hidden" name="emojoindex" value="{{%d:activities}}">
<input class="tab-btn btn btn-alt {{%s:cat_activities}}" type="submit" value="⚽">
</form>
</td>
<td>
<form action="#id" method="post">
<form action="#{{%s:status_id}}" method="post">
<input type="hidden" name="emojoindex" value="{{%d:objects}}">
<input class="tab-btn btn btn-alt {{%s:cat_objects}}" type="submit" value="🔧">
</form>
</td>
<td>
<form action="#id" method="post">
<form action="#{{%s:status_id}}" method="post">
<input type="hidden" name="emojoindex" value="{{%d:symbols}}">
<input class="tab-btn btn btn-alt {{%s:cat_symbols}}" type="submit" value="🔢">
</form>
</td>
<td>
<form action="#id" method="post">
<form action="#{{%s:status_id}}" method="post">
<input type="hidden" name="emojoindex" value="{{%d:flags}}">
<input class="tab-btn btn btn-alt {{%s:cat_flags}}" type="submit" value="🎌">
</form>
@ -60,7 +60,7 @@
<table class="navigation ui-table">
<tr>
<td class="nav-prev btn">
<form action="#id-{{%s:status_id}}" method="post">
<form action="#{{%s:status_id}}" method="post">
<label class="pointer">
<input type="hidden" name="emojoindex" value="{{%u:index_previous}}">
<span class="nav-btn {{%s:previous_enabled}}">Previous</span>
@ -69,7 +69,7 @@
</form>
</td>
<td class="nav-next btn">
<form action="#id-{{%s:status_id}}" method="post">
<form action="#{{%s:status_id}}" method="post">
<label class="pointer">
<input type="hidden" name="emojoindex" value="{{%u:index_next}}">
<span class="nav-btn">Next</span>

View File

@ -1,5 +1,6 @@
#ifndef __emoji_reaction
#define __emoji_reaction
#include <stddef.h>
static const char data_emoji_reaction[] = {0X3C,0X61,0X20,0X68,0X72,0X65,0X66,0X3D,0X22,0X25,0X73,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,0X2D,0X72,0X65,0X61,0X63,0X74,0X2D,0X62,0X6F,0X78,0X20,0X62,0X74,0X6E,0X20,0X62,0X74,0X6E,0X2D,0X61,0X6C,0X74,0X20,0X25,0X73,0X22,0X3E,0X3C,0X73,0X70,0X61,0X6E,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X65,0X6D,0X6F,0X6A,0X69,0X22,0X3E,0X25,0X73,0X3C,0X2F,0X73,0X70,0X61,0X6E,0X3E,0X20,0X3C,0X73,0X70,0X61,0X6E,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X65,0X6D,0X6F,0X6A,0X69,0X2D,0X6E,0X75,0X6D,0X22,0X3E,0X25,0X75,0X3C,0X73,0X70,0X61,0X6E,0X3E,0X3C,0X2F,0X61,0X3E,0};
struct emoji_reaction_template {const char* prefix;
const char* status_id;
@ -7,10 +8,5 @@ const char* emoji;
const char* emoji_active;
unsigned emoji_count;
};
char* tmpl_gen_emoji_reaction(struct emoji_reaction_template* data, unsigned* size){
char* ret;
unsigned s = easprintf(&ret, data_emoji_reaction, data->prefix?data->prefix:"", data->status_id?data->status_id:"", data->emoji?data->emoji:"", data->emoji_active?data->emoji_active:"", data->emoji?data->emoji:"", data->emoji_count);
if (size) *size = s;
return ret;
}
char* tmpl_gen_emoji_reaction(struct emoji_reaction_template* data, size_t* size);
#endif

View File

@ -1,12 +1,8 @@
#ifndef __emoji_reactions
#define __emoji_reactions
#include <stddef.h>
static const char data_emoji_reactions[] = {0X3C,0X75,0X6C,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X65,0X6D,0X6F,0X6A,0X69,0X2D,0X72,0X65,0X61,0X63,0X74,0X69,0X6F,0X6E,0X73,0X22,0X3E,0XA,0X20,0X20,0X25,0X73,0XA,0X3C,0X2F,0X75,0X6C,0X3E,0};
struct emoji_reactions_template {const char* emojis;
};
char* tmpl_gen_emoji_reactions(struct emoji_reactions_template* data, unsigned* size){
char* ret;
unsigned s = easprintf(&ret, data_emoji_reactions, data->emojis?data->emojis:"");
if (size) *size = s;
return ret;
}
char* tmpl_gen_emoji_reactions(struct emoji_reactions_template* data, size_t* size);
#endif

View File

@ -1,14 +1,10 @@
#ifndef __error
#define __error
#include <stddef.h>
static const char data_error[] = {0X3C,0X73,0X70,0X61,0X6E,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X65,0X2D,0X25,0X73,0X20,0X25,0X73,0X22,0X3E,0X25,0X73,0X3C,0X2F,0X73,0X70,0X61,0X6E,0X3E,0};
struct error_template {const char* err_type;
const char* is_padded;
const char* error;
};
char* tmpl_gen_error(struct error_template* data, unsigned* size){
char* ret;
unsigned s = easprintf(&ret, data_error, data->err_type?data->err_type:"", data->is_padded?data->is_padded:"", data->error?data->error:"");
if (size) *size = s;
return ret;
}
char* tmpl_gen_error(struct error_template* data, size_t* size);
#endif

View File

@ -1,12 +1,8 @@
#ifndef __error_404
#define __error_404
#include <stddef.h>
static const char data_error_404[] = {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,0X34,0X30,0X34,0X3C,0X2F,0X68,0X31,0X3E,0XA,0X20,0X20,0X3C,0X70,0X3E,0X25,0X73,0X3C,0X2F,0X70,0X3E,0XA,0X3C,0X2F,0X64,0X69,0X76,0X3E,0};
struct error_404_template {const char* error;
};
char* tmpl_gen_error_404(struct error_404_template* data, unsigned* size){
char* ret;
unsigned s = easprintf(&ret, data_error_404, data->error?data->error:"");
if (size) *size = s;
return ret;
}
char* tmpl_gen_error_404(struct error_404_template* data, size_t* size);
#endif

View File

@ -1,13 +1,9 @@
#ifndef __favourites_page
#define __favourites_page
#include <stddef.h>
static const char data_favourites_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,0X46,0X61,0X76,0X6F,0X72,0X69,0X74,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,0X66,0X61,0X76,0X6F,0X75,0X72,0X69,0X74,0X65,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 favourites_page_template {const char* statuses;
const char* navigation;
};
char* tmpl_gen_favourites_page(struct favourites_page_template* data, unsigned* size){
char* ret;
unsigned s = easprintf(&ret, data_favourites_page, data->statuses?data->statuses:"", data->navigation?data->navigation:"");
if (size) *size = s;
return ret;
}
char* tmpl_gen_favourites_page(struct favourites_page_template* data, size_t* size);
#endif

View File

@ -1,5 +1,6 @@
#ifndef __follow_svg
#define __follow_svg
#include <stddef.h>
static const char data_follow_svg[] = {0X3C,0X73,0X76,0X67,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X66,0X6F,0X6C,0X6C,0X6F,0X77,0X22,0X20,0X78,0X6D,0X6C,0X6E,0X73,0X3D,0X22,0X68,0X74,0X74,0X70,0X3A,0X2F,0X2F,0X77,0X77,0X77,0X2E,0X77,0X33,0X2E,0X6F,0X72,0X67,0X2F,0X32,0X30,0X30,0X30,0X2F,0X73,0X76,0X67,0X22,0X20,0X77,0X69,0X64,0X74,0X68,0X3D,0X22,0X32,0X30,0X22,0X20,0X68,0X65,0X69,0X67,0X68,0X74,0X3D,0X22,0X32,0X30,0X22,0X20,0X76,0X69,0X65,0X77,0X42,0X6F,0X78,0X3D,0X22,0X30,0X20,0X30,0X20,0X32,0X34,0X20,0X32,0X34,0X22,0X20,0X66,0X69,0X6C,0X6C,0X3D,0X22,0X6E,0X6F,0X6E,0X65,0X22,0X20,0X73,0X74,0X72,0X6F,0X6B,0X65,0X3D,0X22,0X23,0X30,0X30,0X30,0X30,0X30,0X30,0X22,0X20,0X73,0X74,0X72,0X6F,0X6B,0X65,0X2D,0X77,0X69,0X64,0X74,0X68,0X3D,0X22,0X32,0X22,0X20,0X73,0X74,0X72,0X6F,0X6B,0X65,0X2D,0X6C,0X69,0X6E,0X65,0X63,0X61,0X70,0X3D,0X22,0X72,0X6F,0X75,0X6E,0X64,0X22,0X20,0X73,0X74,0X72,0X6F,0X6B,0X65,0X2D,0X6C,0X69,0X6E,0X65,0X6A,0X6F,0X69,0X6E,0X3D,0X22,0X72,0X6F,0X75,0X6E,0X64,0X22,0X3E,0X3C,0X70,0X61,0X74,0X68,0X20,0X64,0X3D,0X22,0X4D,0X31,0X36,0X20,0X32,0X31,0X76,0X2D,0X32,0X61,0X34,0X20,0X34,0X20,0X30,0X20,0X30,0X20,0X30,0X2D,0X34,0X2D,0X34,0X48,0X35,0X61,0X34,0X20,0X34,0X20,0X30,0X20,0X30,0X20,0X30,0X2D,0X34,0X20,0X34,0X76,0X32,0X22,0X3E,0X3C,0X2F,0X70,0X61,0X74,0X68,0X3E,0X3C,0X63,0X69,0X72,0X63,0X6C,0X65,0X20,0X63,0X78,0X3D,0X22,0X38,0X2E,0X35,0X22,0X20,0X63,0X79,0X3D,0X22,0X37,0X22,0X20,0X72,0X3D,0X22,0X34,0X22,0X3E,0X3C,0X2F,0X63,0X69,0X72,0X63,0X6C,0X65,0X3E,0X3C,0X6C,0X69,0X6E,0X65,0X20,0X78,0X31,0X3D,0X22,0X32,0X30,0X22,0X20,0X79,0X31,0X3D,0X22,0X38,0X22,0X20,0X78,0X32,0X3D,0X22,0X32,0X30,0X22,0X20,0X79,0X32,0X3D,0X22,0X31,0X34,0X22,0X3E,0X3C,0X2F,0X6C,0X69,0X6E,0X65,0X3E,0X3C,0X6C,0X69,0X6E,0X65,0X20,0X78,0X31,0X3D,0X22,0X32,0X33,0X22,0X20,0X79,0X31,0X3D,0X22,0X31,0X31,0X22,0X20,0X78,0X32,0X3D,0X22,0X31,0X37,0X22,0X20,0X79,0X32,0X3D,0X22,0X31,0X31,0X22,0X3E,0X3C,0X2F,0X6C,0X69,0X6E,0X65,0X3E,0X3C,0X2F,0X73,0X76,0X67,0X3E,0};
#endif

View File

@ -1,13 +1,10 @@
#ifndef __hashtag
#define __hashtag
#include <stddef.h>
static const char data_hashtag[] = {0X3C,0X61,0X20,0X68,0X72,0X65,0X66,0X3D,0X22,0X25,0X73,0X2F,0X74,0X61,0X67,0X2F,0X25,0X73,0X22,0X20,0X73,0X74,0X79,0X6C,0X65,0X3D,0X22,0X66,0X6F,0X6E,0X74,0X2D,0X73,0X69,0X7A,0X65,0X3A,0X20,0X25,0X75,0X70,0X78,0X3B,0X22,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X68,0X61,0X73,0X68,0X74,0X61,0X67,0X2D,0X69,0X74,0X65,0X6D,0X22,0X3E,0X23,0X25,0X73,0X3C,0X2F,0X61,0X3E,0};
struct hashtag_template {const char* prefix;
const char* tag;
unsigned tag_size;
};
char* tmpl_gen_hashtag(struct hashtag_template* data, unsigned* size){
char* ret;
unsigned s = easprintf(&ret, data_hashtag, data->prefix?data->prefix:"", data->tag?data->tag:"", data->tag?data->tag:"");
if (size) *size = s;
return ret;
}
char* tmpl_gen_hashtag(struct hashtag_template* data, size_t* size);
#endif

View File

@ -1 +1 @@
<a href="{{%s:prefix}}/tag/{{%s:tag}}" style="font-size: %upx;" class="hashtag-item">#{{%s:tag}}</a>
<a href="{{%s:prefix}}/tag/{{%s:tag}}" style="font-size: {{%u:tag_size}}px;" class="hashtag-item">#{{%s:tag}}</a>

View File

@ -1,15 +1,10 @@
#ifndef __hashtag_page
#define __hashtag_page
static const char data_hashtag_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,0X48,0X61,0X73,0X68,0X74,0X61,0X67,0X20,0X2D,0X20,0X23,0X25,0X73,0X3C,0X2F,0X68,0X31,0X3E,0XA,0X3C,0X2F,0X64,0X69,0X76,0X3E,0XA,0X25,0X73,0XA,0X3C,0X64,0X69,0X76,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X68,0X61,0X73,0X68,0X74,0X61,0X67,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};
#include <stddef.h>
static const char data_hashtag_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,0X48,0X61,0X73,0X68,0X74,0X61,0X67,0X20,0X2D,0X20,0X23,0X25,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,0X68,0X61,0X73,0X68,0X74,0X61,0X67,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 hashtag_page_template {const char* tag;
const char* tag_statistics;
const char* statuses;
const char* navigation;
};
char* tmpl_gen_hashtag_page(struct hashtag_page_template* data, unsigned* size){
char* ret;
unsigned s = easprintf(&ret, data_hashtag_page, data->tag?data->tag:"", data->tag_statistics?data->tag_statistics:"", data->statuses?data->statuses:"", data->navigation?data->navigation:"");
if (size) *size = s;
return ret;
}
char* tmpl_gen_hashtag_page(struct hashtag_page_template* data, size_t* size);
#endif

View File

@ -1,7 +1,6 @@
<div class="simple-page">
<h1>Hashtag - #{{%s:tag}}</h1>
</div>
{{%s:tag_statistics}}
<div class="hashtags-container">
{{%s:statuses}}
</div>

View File

@ -1,15 +1,11 @@
#ifndef __in_reply_to
#define __in_reply_to
#include <stddef.h>
static const char data_in_reply_to[] = {0X3C,0X73,0X70,0X61,0X6E,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X69,0X6E,0X2D,0X72,0X65,0X70,0X6C,0X79,0X2D,0X74,0X6F,0X22,0X3E,0XA,0X20,0X20,0X3C,0X73,0X76,0X67,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X69,0X6E,0X2D,0X72,0X65,0X70,0X6C,0X79,0X2D,0X74,0X6F,0X2D,0X69,0X63,0X6F,0X6E,0X22,0X20,0X78,0X6D,0X6C,0X6E,0X73,0X3D,0X22,0X68,0X74,0X74,0X70,0X3A,0X2F,0X2F,0X77,0X77,0X77,0X2E,0X77,0X33,0X2E,0X6F,0X72,0X67,0X2F,0X32,0X30,0X30,0X30,0X2F,0X73,0X76,0X67,0X22,0X20,0X77,0X69,0X64,0X74,0X68,0X3D,0X22,0X32,0X30,0X22,0X20,0X68,0X65,0X69,0X67,0X68,0X74,0X3D,0X22,0X32,0X30,0X22,0X20,0X76,0X69,0X65,0X77,0X42,0X6F,0X78,0X3D,0X22,0X30,0X20,0X30,0X20,0X32,0X34,0X20,0X32,0X34,0X22,0X20,0X66,0X69,0X6C,0X6C,0X3D,0X22,0X6E,0X6F,0X6E,0X65,0X22,0X20,0X73,0X74,0X72,0X6F,0X6B,0X65,0X3D,0X22,0X23,0X30,0X30,0X30,0X30,0X30,0X30,0X22,0X20,0X73,0X74,0X72,0X6F,0X6B,0X65,0X2D,0X77,0X69,0X64,0X74,0X68,0X3D,0X22,0X32,0X22,0X20,0X73,0X74,0X72,0X6F,0X6B,0X65,0X2D,0X6C,0X69,0X6E,0X65,0X63,0X61,0X70,0X3D,0X22,0X72,0X6F,0X75,0X6E,0X64,0X22,0X20,0X73,0X74,0X72,0X6F,0X6B,0X65,0X2D,0X6C,0X69,0X6E,0X65,0X6A,0X6F,0X69,0X6E,0X3D,0X22,0X72,0X6F,0X75,0X6E,0X64,0X22,0X3E,0X3C,0X70,0X61,0X74,0X68,0X20,0X64,0X3D,0X22,0X4D,0X31,0X34,0X20,0X39,0X6C,0X36,0X20,0X36,0X2D,0X36,0X20,0X36,0X22,0X2F,0X3E,0X3C,0X70,0X61,0X74,0X68,0X20,0X64,0X3D,0X22,0X4D,0X34,0X20,0X34,0X76,0X37,0X61,0X34,0X20,0X34,0X20,0X30,0X20,0X30,0X20,0X30,0X20,0X34,0X20,0X34,0X68,0X31,0X31,0X22,0X2F,0X3E,0X3C,0X2F,0X73,0X76,0X67,0X3E,0X20,0X3C,0X61,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X69,0X6E,0X2D,0X72,0X65,0X70,0X6C,0X79,0X2D,0X74,0X6F,0X2D,0X69,0X64,0X22,0X20,0X68,0X72,0X65,0X66,0X3D,0X22,0X25,0X73,0X2F,0X73,0X74,0X61,0X74,0X75,0X73,0X2F,0X25,0X73,0X23,0X25,0X73,0X22,0X3E,0X20,0X3C,0X73,0X70,0X61,0X6E,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X69,0X6E,0X2D,0X72,0X65,0X70,0X6C,0X79,0X2D,0X74,0X6F,0X2D,0X74,0X65,0X78,0X74,0X22,0X3E,0X25,0X73,0X3C,0X2F,0X73,0X70,0X61,0X6E,0X3E,0X20,0X3C,0X73,0X70,0X61,0X6E,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X61,0X63,0X63,0X74,0X22,0X3E,0X25,0X73,0X3C,0X2F,0X73,0X70,0X61,0X6E,0X3E,0X3C,0X2F,0X61,0X3E,0XA,0X3C,0X2F,0X73,0X70,0X61,0X6E,0X3E,0};
struct in_reply_to_template {const char* prefix;
const char* status_id;
const char* in_reply_to_text;
const char* acct;
};
char* tmpl_gen_in_reply_to(struct in_reply_to_template* data, unsigned* size){
char* ret;
unsigned s = easprintf(&ret, data_in_reply_to, data->prefix?data->prefix:"", data->status_id?data->status_id:"", data->status_id?data->status_id:"", data->in_reply_to_text?data->in_reply_to_text:"", data->acct?data->acct:"");
if (size) *size = s;
return ret;
}
char* tmpl_gen_in_reply_to(struct in_reply_to_template* data, size_t* size);
#endif

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,6 @@
#ifndef __instance
#define __instance
#include <stddef.h>
static const char data_instance[] = {0X49,0X6E,0X73,0X74,0X61,0X6E,0X63,0X65,0X20,0X69,0X6E,0X66,0X6F,0X72,0X6D,0X61,0X74,0X69,0X6F,0X6E,0};
#endif

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,6 @@
#ifndef __like_svg
#define __like_svg
#include <stddef.h>
static const char data_like_svg[] = {0X3C,0X73,0X76,0X67,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X6C,0X69,0X6B,0X65,0X22,0X20,0X78,0X6D,0X6C,0X6E,0X73,0X3D,0X22,0X68,0X74,0X74,0X70,0X3A,0X2F,0X2F,0X77,0X77,0X77,0X2E,0X77,0X33,0X2E,0X6F,0X72,0X67,0X2F,0X32,0X30,0X30,0X30,0X2F,0X73,0X76,0X67,0X22,0X20,0X77,0X69,0X64,0X74,0X68,0X3D,0X22,0X32,0X30,0X22,0X20,0X68,0X65,0X69,0X67,0X68,0X74,0X3D,0X22,0X32,0X30,0X22,0X20,0X76,0X69,0X65,0X77,0X42,0X6F,0X78,0X3D,0X22,0X30,0X20,0X30,0X20,0X32,0X34,0X20,0X32,0X34,0X22,0X20,0X66,0X69,0X6C,0X6C,0X3D,0X22,0X6E,0X6F,0X6E,0X65,0X22,0X20,0X73,0X74,0X72,0X6F,0X6B,0X65,0X3D,0X22,0X23,0X30,0X30,0X30,0X30,0X30,0X30,0X22,0X20,0X73,0X74,0X72,0X6F,0X6B,0X65,0X2D,0X77,0X69,0X64,0X74,0X68,0X3D,0X22,0X32,0X22,0X20,0X73,0X74,0X72,0X6F,0X6B,0X65,0X2D,0X6C,0X69,0X6E,0X65,0X63,0X61,0X70,0X3D,0X22,0X72,0X6F,0X75,0X6E,0X64,0X22,0X20,0X73,0X74,0X72,0X6F,0X6B,0X65,0X2D,0X6C,0X69,0X6E,0X65,0X6A,0X6F,0X69,0X6E,0X3D,0X22,0X72,0X6F,0X75,0X6E,0X64,0X22,0X3E,0X3C,0X70,0X6F,0X6C,0X79,0X67,0X6F,0X6E,0X20,0X70,0X6F,0X69,0X6E,0X74,0X73,0X3D,0X22,0X31,0X32,0X20,0X32,0X20,0X31,0X35,0X2E,0X30,0X39,0X20,0X38,0X2E,0X32,0X36,0X20,0X32,0X32,0X20,0X39,0X2E,0X32,0X37,0X20,0X31,0X37,0X20,0X31,0X34,0X2E,0X31,0X34,0X20,0X31,0X38,0X2E,0X31,0X38,0X20,0X32,0X31,0X2E,0X30,0X32,0X20,0X31,0X32,0X20,0X31,0X37,0X2E,0X37,0X37,0X20,0X35,0X2E,0X38,0X32,0X20,0X32,0X31,0X2E,0X30,0X32,0X20,0X37,0X20,0X31,0X34,0X2E,0X31,0X34,0X20,0X32,0X20,0X39,0X2E,0X32,0X37,0X20,0X38,0X2E,0X39,0X31,0X20,0X38,0X2E,0X32,0X36,0X20,0X31,0X32,0X20,0X32,0X22,0X3E,0X3C,0X2F,0X70,0X6F,0X6C,0X79,0X67,0X6F,0X6E,0X3E,0X3C,0X2F,0X73,0X76,0X67,0X3E,0};
#endif

View File

@ -1,13 +1,9 @@
#ifndef __likeboost
#define __likeboost
#include <stddef.h>
static const char data_likeboost[] = {0X3C,0X74,0X64,0X3E,0XA,0X20,0X20,0X3C,0X66,0X6F,0X72,0X6D,0X20,0X61,0X63,0X74,0X69,0X6F,0X6E,0X3D,0X22,0X25,0X73,0X2F,0X73,0X74,0X61,0X74,0X75,0X73,0X2F,0X25,0X73,0X2F,0X69,0X6E,0X74,0X65,0X72,0X61,0X63,0X74,0X22,0X20,0X6D,0X65,0X74,0X68,0X6F,0X64,0X3D,0X22,0X70,0X6F,0X73,0X74,0X22,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,0X69,0X74,0X79,0X70,0X65,0X22,0X20,0X76,0X61,0X6C,0X75,0X65,0X3D,0X22,0X6C,0X69,0X6B,0X65,0X62,0X6F,0X6F,0X73,0X74,0X22,0X3E,0XA,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,0X20,0X73,0X74,0X61,0X74,0X62,0X74,0X6E,0X20,0X6C,0X69,0X6B,0X65,0X62,0X6F,0X6F,0X73,0X74,0X2D,0X62,0X74,0X6E,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X73,0X76,0X67,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X6F,0X6E,0X65,0X2D,0X63,0X6C,0X69,0X63,0X6B,0X2D,0X73,0X6F,0X66,0X74,0X77,0X61,0X72,0X65,0X22,0X20,0X77,0X69,0X64,0X74,0X68,0X3D,0X22,0X32,0X30,0X22,0X20,0X68,0X65,0X69,0X67,0X68,0X74,0X3D,0X22,0X32,0X30,0X22,0X20,0X66,0X69,0X6C,0X6C,0X3D,0X22,0X6E,0X6F,0X6E,0X65,0X22,0X20,0X73,0X74,0X72,0X6F,0X6B,0X65,0X3D,0X22,0X23,0X30,0X30,0X30,0X30,0X30,0X30,0X22,0X20,0X73,0X74,0X72,0X6F,0X6B,0X65,0X2D,0X6C,0X69,0X6E,0X65,0X63,0X61,0X70,0X3D,0X22,0X72,0X6F,0X75,0X6E,0X64,0X22,0X20,0X73,0X74,0X72,0X6F,0X6B,0X65,0X2D,0X6C,0X69,0X6E,0X65,0X6A,0X6F,0X69,0X6E,0X3D,0X22,0X72,0X6F,0X75,0X6E,0X64,0X22,0X20,0X73,0X74,0X72,0X6F,0X6B,0X65,0X2D,0X77,0X69,0X64,0X74,0X68,0X3D,0X22,0X32,0X22,0X20,0X76,0X65,0X72,0X73,0X69,0X6F,0X6E,0X3D,0X22,0X31,0X2E,0X31,0X22,0X20,0X76,0X69,0X65,0X77,0X42,0X6F,0X78,0X3D,0X22,0X30,0X20,0X30,0X20,0X32,0X34,0X20,0X32,0X34,0X22,0X20,0X78,0X6D,0X6C,0X6E,0X73,0X3D,0X22,0X68,0X74,0X74,0X70,0X3A,0X2F,0X2F,0X77,0X77,0X77,0X2E,0X77,0X33,0X2E,0X6F,0X72,0X67,0X2F,0X32,0X30,0X30,0X30,0X2F,0X73,0X76,0X67,0X22,0X3E,0X3C,0X67,0X3E,0X3C,0X67,0X20,0X73,0X74,0X72,0X6F,0X6B,0X65,0X2D,0X77,0X69,0X64,0X74,0X68,0X3D,0X22,0X31,0X2E,0X39,0X38,0X22,0X3E,0X3C,0X70,0X61,0X74,0X68,0X20,0X64,0X3D,0X22,0X6D,0X31,0X39,0X2E,0X31,0X35,0X20,0X38,0X2E,0X35,0X30,0X36,0X31,0X20,0X32,0X2E,0X37,0X35,0X39,0X38,0X20,0X32,0X2E,0X37,0X35,0X39,0X38,0X2D,0X32,0X2E,0X37,0X35,0X39,0X38,0X20,0X32,0X2E,0X37,0X35,0X39,0X38,0X22,0X2F,0X3E,0X3C,0X70,0X61,0X74,0X68,0X20,0X64,0X3D,0X22,0X6D,0X31,0X34,0X2E,0X37,0X35,0X36,0X20,0X31,0X31,0X2E,0X33,0X32,0X35,0X73,0X32,0X2E,0X35,0X34,0X38,0X34,0X2D,0X30,0X2E,0X30,0X35,0X30,0X33,0X32,0X20,0X36,0X2E,0X33,0X32,0X35,0X38,0X20,0X30,0X2E,0X30,0X31,0X30,0X32,0X36,0X6D,0X2D,0X31,0X35,0X2E,0X36,0X33,0X39,0X20,0X31,0X30,0X2E,0X38,0X30,0X37,0X2D,0X32,0X2E,0X37,0X35,0X39,0X38,0X2D,0X32,0X2E,0X37,0X35,0X39,0X38,0X20,0X32,0X2E,0X37,0X35,0X39,0X38,0X2D,0X32,0X2E,0X37,0X35,0X39,0X38,0X22,0X2F,0X3E,0X3C,0X70,0X61,0X74,0X68,0X20,0X64,0X3D,0X22,0X6D,0X32,0X32,0X2E,0X34,0X20,0X31,0X35,0X2E,0X33,0X32,0X37,0X76,0X31,0X2E,0X32,0X32,0X35,0X39,0X63,0X30,0X20,0X31,0X2E,0X31,0X35,0X36,0X2D,0X31,0X2E,0X32,0X33,0X35,0X36,0X20,0X32,0X2E,0X37,0X35,0X39,0X38,0X2D,0X32,0X2E,0X37,0X35,0X39,0X38,0X20,0X32,0X2E,0X37,0X35,0X39,0X38,0X68,0X2D,0X31,0X36,0X2E,0X36,0X36,0X34,0X22,0X2F,0X3E,0X3C,0X2F,0X67,0X3E,0X3C,0X70,0X6F,0X6C,0X79,0X67,0X6F,0X6E,0X20,0X74,0X72,0X61,0X6E,0X73,0X66,0X6F,0X72,0X6D,0X3D,0X22,0X6D,0X61,0X74,0X72,0X69,0X78,0X28,0X2E,0X36,0X30,0X37,0X33,0X36,0X20,0X30,0X20,0X30,0X20,0X2E,0X36,0X30,0X37,0X33,0X36,0X20,0X2E,0X36,0X30,0X31,0X30,0X36,0X20,0X2E,0X36,0X33,0X35,0X37,0X37,0X29,0X22,0X20,0X70,0X6F,0X69,0X6E,0X74,0X73,0X3D,0X22,0X31,0X38,0X2E,0X31,0X38,0X20,0X32,0X31,0X2E,0X30,0X32,0X20,0X31,0X32,0X20,0X31,0X37,0X2E,0X37,0X37,0X20,0X35,0X2E,0X38,0X32,0X20,0X32,0X31,0X2E,0X30,0X32,0X20,0X37,0X20,0X31,0X34,0X2E,0X31,0X34,0X20,0X32,0X20,0X39,0X2E,0X32,0X37,0X20,0X38,0X2E,0X39,0X31,0X20,0X38,0X2E,0X32,0X36,0X20,0X31,0X32,0X20,0X32,0X20,0X31,0X35,0X2E,0X30,0X39,0X20,0X38,0X2E,0X32,0X36,0X20,0X32,0X32,0X20,0X39,0X2E,0X32,0X37,0X20,0X31,0X37,0X20,0X31,0X34,0X2E,0X31,0X34,0X22,0X20,0X73,0X74,0X72,0X6F,0X6B,0X65,0X2D,0X77,0X69,0X64,0X74,0X68,0X3D,0X22,0X32,0X2E,0X39,0X36,0X35,0X36,0X22,0X2F,0X3E,0X3C,0X2F,0X67,0X3E,0X3C,0X2F,0X73,0X76,0X67,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X69,0X6E,0X70,0X75,0X74,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X68,0X69,0X64,0X64,0X65,0X6E,0X22,0X20,0X74,0X79,0X70,0X65,0X3D,0X22,0X73,0X75,0X62,0X6D,0X69,0X74,0X22,0X20,0X76,0X61,0X6C,0X75,0X65,0X3D,0X22,0X4C,0X2B,0X52,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X2F,0X6C,0X61,0X62,0X65,0X6C,0X3E,0XA,0X20,0X20,0X3C,0X2F,0X66,0X6F,0X72,0X6D,0X3E,0XA,0X3C,0X2F,0X74,0X64,0X3E,0};
struct likeboost_template {const char* prefix;
const char* status_id;
};
char* tmpl_gen_likeboost(struct likeboost_template* data, unsigned* size){
char* ret;
unsigned s = easprintf(&ret, data_likeboost, data->prefix?data->prefix:"", data->status_id?data->status_id:"");
if (size) *size = s;
return ret;
}
char* tmpl_gen_likeboost(struct likeboost_template* data, size_t* size);
#endif

View File

@ -1,14 +1,10 @@
#ifndef __list
#define __list
#include <stddef.h>
static const char data_list[] = {0X20,0X20,0X3C,0X6C,0X69,0X3E,0X3C,0X61,0X20,0X68,0X72,0X65,0X66,0X3D,0X22,0X25,0X73,0X2F,0X6C,0X69,0X73,0X74,0X73,0X2F,0X66,0X6F,0X72,0X2F,0X25,0X73,0X22,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X62,0X74,0X6E,0X20,0X73,0X70,0X6C,0X69,0X74,0X22,0X3E,0X25,0X73,0X3C,0X2F,0X61,0X3E,0X3C,0X2F,0X6C,0X69,0X3E,0};
struct list_template {const char* prefix;
const char* list_id;
const char* list;
};
char* tmpl_gen_list(struct list_template* data, unsigned* size){
char* ret;
unsigned s = easprintf(&ret, data_list, data->prefix?data->prefix:"", data->list_id?data->list_id:"", data->list?data->list:"");
if (size) *size = s;
return ret;
}
char* tmpl_gen_list(struct list_template* data, size_t* size);
#endif

View File

@ -1,13 +1,9 @@
#ifndef __lists
#define __lists
#include <stddef.h>
static const char data_lists[] = {0X3C,0X64,0X69,0X76,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X6C,0X69,0X73,0X74,0X73,0X2D,0X76,0X69,0X65,0X77,0X22,0X3E,0XA,0X20,0X20,0X3C,0X68,0X31,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X6C,0X69,0X73,0X74,0X73,0X2D,0X76,0X69,0X65,0X77,0X2D,0X68,0X65,0X61,0X64,0X65,0X72,0X22,0X3E,0X4C,0X69,0X73,0X74,0X73,0X3C,0X2F,0X68,0X31,0X3E,0XA,0XA,0X20,0X20,0X3C,0X64,0X69,0X76,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X6C,0X69,0X73,0X74,0X73,0X2D,0X76,0X69,0X65,0X77,0X2D,0X63,0X6F,0X6E,0X74,0X61,0X69,0X6E,0X65,0X72,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X75,0X6C,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X6C,0X61,0X72,0X67,0X65,0X2D,0X6C,0X69,0X73,0X74,0X20,0X63,0X65,0X6E,0X74,0X65,0X72,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X25,0X73,0XA,0X20,0X20,0X20,0X20,0X3C,0X2F,0X75,0X6C,0X3E,0XA,0XA,0X20,0X20,0X20,0X20,0X3C,0X75,0X6C,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X6C,0X61,0X72,0X67,0X65,0X2D,0X6C,0X69,0X73,0X74,0X20,0X63,0X65,0X6E,0X74,0X65,0X72,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X6C,0X69,0X3E,0X3C,0X61,0X20,0X68,0X72,0X65,0X66,0X3D,0X22,0X25,0X73,0X2F,0X6C,0X69,0X73,0X74,0X73,0X2F,0X63,0X72,0X65,0X61,0X74,0X65,0X22,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X62,0X74,0X6E,0X20,0X73,0X70,0X6C,0X69,0X74,0X20,0X63,0X65,0X6E,0X74,0X65,0X72,0X2D,0X74,0X65,0X78,0X74,0X20,0X62,0X6F,0X6C,0X64,0X2D,0X74,0X65,0X78,0X74,0X22,0X3E,0X43,0X72,0X65,0X61,0X74,0X65,0X20,0X6E,0X65,0X77,0X20,0X6C,0X69,0X73,0X74,0X3C,0X2F,0X61,0X3E,0X3C,0X2F,0X6C,0X69,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X2F,0X75,0X6C,0X3E,0XA,0X20,0X20,0X3C,0X2F,0X64,0X69,0X76,0X3E,0XA,0X3C,0X2F,0X64,0X69,0X76,0X3E,0};
struct lists_template {const char* lists;
const char* prefix;
};
char* tmpl_gen_lists(struct lists_template* data, unsigned* size){
char* ret;
unsigned s = easprintf(&ret, data_lists, data->lists?data->lists:"", data->prefix?data->prefix:"");
if (size) *size = s;
return ret;
}
char* tmpl_gen_lists(struct lists_template* data, size_t* size);
#endif

View File

@ -1,5 +1,6 @@
#ifndef __login
#define __login
#include <stddef.h>
static const char data_login[] = {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,0X25,0X73,0X3C,0X2F,0X68,0X31,0X3E,0XA,0X20,0X20,0XA,0X20,0X20,0X25,0X73,0XA,0XA,0X20,0X20,0X3C,0X66,0X6F,0X72,0X6D,0X20,0X61,0X63,0X74,0X69,0X6F,0X6E,0X3D,0X22,0X25,0X73,0X2F,0X6C,0X6F,0X67,0X69,0X6E,0X22,0X20,0X6D,0X65,0X74,0X68,0X6F,0X64,0X3D,0X22,0X70,0X6F,0X73,0X74,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X64,0X69,0X76,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X66,0X6F,0X72,0X6D,0X2D,0X67,0X72,0X6F,0X75,0X70,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X6C,0X61,0X62,0X65,0X6C,0X20,0X66,0X6F,0X72,0X3D,0X22,0X6C,0X6F,0X67,0X69,0X6E,0X2D,0X75,0X73,0X65,0X72,0X6E,0X61,0X6D,0X65,0X22,0X3E,0X25,0X73,0X3A,0X20,0X3C,0X2F,0X6C,0X61,0X62,0X65,0X6C,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X69,0X6E,0X70,0X75,0X74,0X20,0X74,0X79,0X70,0X65,0X3D,0X22,0X74,0X65,0X78,0X74,0X22,0X20,0X69,0X64,0X3D,0X22,0X6C,0X6F,0X67,0X69,0X6E,0X2D,0X75,0X73,0X65,0X72,0X6E,0X61,0X6D,0X65,0X22,0X20,0X6E,0X61,0X6D,0X65,0X3D,0X22,0X75,0X73,0X65,0X72,0X6E,0X61,0X6D,0X65,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X2F,0X64,0X69,0X76,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X64,0X69,0X76,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X66,0X6F,0X72,0X6D,0X2D,0X67,0X72,0X6F,0X75,0X70,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X6C,0X61,0X62,0X65,0X6C,0X20,0X66,0X6F,0X72,0X3D,0X22,0X6C,0X6F,0X67,0X69,0X6E,0X2D,0X70,0X61,0X73,0X73,0X77,0X6F,0X72,0X64,0X22,0X3E,0X25,0X73,0X3A,0X20,0X3C,0X2F,0X6C,0X61,0X62,0X65,0X6C,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X69,0X6E,0X70,0X75,0X74,0X20,0X74,0X79,0X70,0X65,0X3D,0X22,0X70,0X61,0X73,0X73,0X77,0X6F,0X72,0X64,0X22,0X20,0X69,0X64,0X3D,0X22,0X6C,0X6F,0X67,0X69,0X6E,0X2D,0X70,0X61,0X73,0X73,0X77,0X6F,0X72,0X64,0X22,0X20,0X6E,0X61,0X6D,0X65,0X3D,0X22,0X70,0X61,0X73,0X73,0X77,0X6F,0X72,0X64,0X22,0X3E,0X3C,0X62,0X72,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X2F,0X64,0X69,0X76,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X64,0X69,0X76,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X66,0X6F,0X72,0X6D,0X2D,0X67,0X72,0X6F,0X75,0X70,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X69,0X6E,0X70,0X75,0X74,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X62,0X74,0X6E,0X22,0X20,0X74,0X79,0X70,0X65,0X3D,0X22,0X73,0X75,0X62,0X6D,0X69,0X74,0X22,0X20,0X76,0X61,0X6C,0X75,0X65,0X3D,0X22,0X25,0X73,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X2F,0X64,0X69,0X76,0X3E,0XA,0X20,0X20,0X3C,0X2F,0X66,0X6F,0X72,0X6D,0X3E,0XA,0XA,0X20,0X20,0X3C,0X68,0X36,0X3E,0X25,0X73,0X3C,0X2F,0X68,0X36,0X3E,0XA,0XA,0X20,0X20,0X3C,0X66,0X6F,0X72,0X6D,0X20,0X61,0X63,0X74,0X69,0X6F,0X6E,0X3D,0X22,0X25,0X73,0X2F,0X6C,0X6F,0X67,0X69,0X6E,0X2F,0X6F,0X61,0X75,0X74,0X68,0X22,0X20,0X6D,0X65,0X74,0X68,0X6F,0X64,0X3D,0X22,0X70,0X6F,0X73,0X74,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X64,0X69,0X76,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X66,0X6F,0X72,0X6D,0X2D,0X67,0X72,0X6F,0X75,0X70,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X6C,0X61,0X62,0X65,0X6C,0X20,0X66,0X6F,0X72,0X3D,0X22,0X69,0X6E,0X73,0X74,0X61,0X6E,0X63,0X65,0X2D,0X75,0X72,0X6C,0X22,0X3E,0X25,0X73,0X3A,0X20,0X3C,0X2F,0X6C,0X61,0X62,0X65,0X6C,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X69,0X6E,0X70,0X75,0X74,0X20,0X74,0X79,0X70,0X65,0X3D,0X22,0X75,0X72,0X6C,0X22,0X20,0X69,0X64,0X3D,0X22,0X69,0X6E,0X73,0X74,0X61,0X6E,0X63,0X65,0X2D,0X75,0X72,0X6C,0X22,0X20,0X6E,0X61,0X6D,0X65,0X3D,0X22,0X69,0X6E,0X73,0X74,0X61,0X6E,0X63,0X65,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X69,0X6E,0X70,0X75,0X74,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X62,0X74,0X6E,0X22,0X20,0X74,0X79,0X70,0X65,0X3D,0X22,0X73,0X75,0X62,0X6D,0X69,0X74,0X22,0X20,0X76,0X61,0X6C,0X75,0X65,0X3D,0X22,0X25,0X73,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X2F,0X64,0X69,0X76,0X3E,0XA,0X20,0X20,0X3C,0X2F,0X66,0X6F,0X72,0X6D,0X3E,0XA,0X3C,0X2F,0X64,0X69,0X76,0X3E,0};
struct login_template {const char* login_header;
const char* error;
@ -11,10 +12,5 @@ const char* instance_text;
const char* instance_url;
const char* instance_submit;
};
char* tmpl_gen_login(struct login_template* data, unsigned* size){
char* ret;
unsigned s = easprintf(&ret, data_login, data->login_header?data->login_header:"", data->error?data->error:"", data->prefix?data->prefix:"", data->username?data->username:"", data->password?data->password:"", data->login_submit?data->login_submit:"", data->instance_text?data->instance_text:"", data->prefix?data->prefix:"", data->instance_url?data->instance_url:"", data->instance_submit?data->instance_submit:"");
if (size) *size = s;
return ret;
}
char* tmpl_gen_login(struct login_template* data, size_t* size);
#endif

View File

@ -1,15 +1,11 @@
#ifndef __menu_item
#define __menu_item
#include <stddef.h>
static const char data_menu_item[] = {0X3C,0X6C,0X69,0X3E,0XA,0X20,0X20,0X3C,0X66,0X6F,0X72,0X6D,0X20,0X61,0X63,0X74,0X69,0X6F,0X6E,0X3D,0X22,0X25,0X73,0X2F,0X73,0X74,0X61,0X74,0X75,0X73,0X2F,0X25,0X73,0X2F,0X69,0X6E,0X74,0X65,0X72,0X61,0X63,0X74,0X22,0X20,0X6D,0X65,0X74,0X68,0X6F,0X64,0X3D,0X22,0X70,0X6F,0X73,0X74,0X22,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,0X69,0X74,0X79,0X70,0X65,0X22,0X20,0X76,0X61,0X6C,0X75,0X65,0X3D,0X22,0X25,0X73,0X22,0X3E,0XA,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,0X62,0X74,0X6E,0X2D,0X6D,0X65,0X6E,0X75,0X22,0X20,0X76,0X61,0X6C,0X75,0X65,0X3D,0X22,0X25,0X73,0X22,0X3E,0XA,0X20,0X20,0X3C,0X2F,0X66,0X6F,0X72,0X6D,0X3E,0XA,0X3C,0X2F,0X6C,0X69,0X3E,0};
struct menu_item_template {const char* prefix;
const char* status_id;
const char* itype;
const char* text;
};
char* tmpl_gen_menu_item(struct menu_item_template* data, unsigned* size){
char* ret;
unsigned s = easprintf(&ret, data_menu_item, data->prefix?data->prefix:"", data->status_id?data->status_id:"", data->itype?data->itype:"", data->text?data->text:"");
if (size) *size = s;
return ret;
}
char* tmpl_gen_menu_item(struct menu_item_template* data, size_t* size);
#endif

View File

@ -1,5 +1,6 @@
#ifndef __navigation
#define __navigation
#include <stddef.h>
static const char data_navigation[] = {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,0X3C,0X74,0X72,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X74,0X64,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X6E,0X61,0X76,0X2D,0X75,0X70,0X20,0X62,0X74,0X6E,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X66,0X6F,0X72,0X6D,0X20,0X61,0X63,0X74,0X69,0X6F,0X6E,0X3D,0X22,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,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,0X3C,0X73,0X70,0X61,0X6E,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X6E,0X61,0X76,0X2D,0X62,0X74,0X6E,0X22,0X3E,0X55,0X70,0X3C,0X2F,0X73,0X70,0X61,0X6E,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,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,0X3C,0X2F,0X6C,0X61,0X62,0X65,0X6C,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X2F,0X66,0X6F,0X72,0X6D,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,0X6E,0X61,0X76,0X2D,0X70,0X72,0X65,0X76,0X20,0X62,0X74,0X6E,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X66,0X6F,0X72,0X6D,0X20,0X61,0X63,0X74,0X69,0X6F,0X6E,0X3D,0X22,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,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,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,0X74,0X61,0X72,0X74,0X5F,0X69,0X64,0X22,0X20,0X76,0X61,0X6C,0X75,0X65,0X3D,0X22,0X25,0X73,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,0X6D,0X69,0X6E,0X5F,0X69,0X64,0X22,0X20,0X76,0X61,0X6C,0X75,0X65,0X3D,0X22,0X25,0X73,0X22,0X3E,0XA,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,0X25,0X73,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X2F,0X6C,0X61,0X62,0X65,0X6C,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X2F,0X66,0X6F,0X72,0X6D,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,0X6E,0X61,0X76,0X2D,0X6E,0X65,0X78,0X74,0X20,0X62,0X74,0X6E,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X66,0X6F,0X72,0X6D,0X20,0X61,0X63,0X74,0X69,0X6F,0X6E,0X3D,0X22,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,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,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,0X74,0X61,0X72,0X74,0X5F,0X69,0X64,0X22,0X20,0X76,0X61,0X6C,0X75,0X65,0X3D,0X22,0X25,0X73,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,0X6D,0X61,0X78,0X5F,0X69,0X64,0X22,0X20,0X76,0X61,0X6C,0X75,0X65,0X3D,0X22,0X25,0X73,0X22,0X3E,0XA,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,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,0X3C,0X2F,0X6C,0X61,0X62,0X65,0X6C,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X2F,0X66,0X6F,0X72,0X6D,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 navigation_template {const char* start_id;
const char* min_id;
@ -7,10 +8,5 @@ const char* prev_active;
const char* prev_submit;
const char* max_id;
};
char* tmpl_gen_navigation(struct navigation_template* data, unsigned* size){
char* ret;
unsigned s = easprintf(&ret, data_navigation, data->start_id?data->start_id:"", data->min_id?data->min_id:"", data->prev_active?data->prev_active:"", data->prev_submit?data->prev_submit:"", data->start_id?data->start_id:"", data->max_id?data->max_id:"");
if (size) *size = s;
return ret;
}
char* tmpl_gen_navigation(struct navigation_template* data, size_t* size);
#endif

View File

@ -1,16 +1,11 @@
#ifndef __notification
#define __notification
static const char data_notification[] = {0X3C,0X64,0X69,0X76,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X6E,0X6F,0X74,0X69,0X66,0X69,0X63,0X61,0X74,0X69,0X6F,0X6E,0X2D,0X69,0X6E,0X66,0X6F,0X22,0X3E,0XA,0X20,0X20,0X3C,0X69,0X6D,0X67,0X20,0X73,0X72,0X63,0X3D,0X22,0X25,0X73,0X22,0X3E,0XA,0X20,0X20,0X3C,0X64,0X69,0X76,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X6E,0X6F,0X74,0X69,0X66,0X69,0X63,0X61,0X74,0X69,0X6F,0X6E,0X2D,0X75,0X73,0X65,0X72,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X73,0X70,0X61,0X6E,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X6E,0X6F,0X74,0X69,0X66,0X69,0X63,0X61,0X74,0X69,0X6F,0X6E,0X2D,0X74,0X65,0X78,0X74,0X2D,0X67,0X72,0X6F,0X75,0X70,0X2D,0X77,0X69,0X74,0X68,0X2D,0X69,0X63,0X6F,0X6E,0X22,0X3E,0XA,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,0X3C,0X73,0X70,0X61,0X6E,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X61,0X63,0X74,0X69,0X6F,0X6E,0X22,0X3E,0X25,0X73,0X3C,0X2F,0X73,0X70,0X61,0X6E,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X25,0X73,0X20,0X3C,0X21,0X2D,0X2D,0X20,0X49,0X66,0X20,0X61,0X6E,0X79,0X20,0X2D,0X2D,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X2F,0X73,0X70,0X61,0X6E,0X3E,0XA,0X20,0X20,0X20,0X20,0X25,0X73,0XA,0X20,0X20,0X3C,0X2F,0X64,0X69,0X76,0X3E,0XA,0X3C,0X2F,0X64,0X69,0X76,0X3E,0};
#include <stddef.h>
static const char data_notification[] = {0X3C,0X64,0X69,0X76,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X6E,0X6F,0X74,0X69,0X66,0X69,0X63,0X61,0X74,0X69,0X6F,0X6E,0X2D,0X69,0X6E,0X66,0X6F,0X22,0X3E,0XA,0X20,0X20,0X3C,0X69,0X6D,0X67,0X20,0X73,0X72,0X63,0X3D,0X22,0X25,0X73,0X22,0X3E,0XA,0X20,0X20,0X3C,0X64,0X69,0X76,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X6E,0X6F,0X74,0X69,0X66,0X69,0X63,0X61,0X74,0X69,0X6F,0X6E,0X2D,0X75,0X73,0X65,0X72,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X73,0X70,0X61,0X6E,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X6E,0X6F,0X74,0X69,0X66,0X69,0X63,0X61,0X74,0X69,0X6F,0X6E,0X2D,0X74,0X65,0X78,0X74,0X2D,0X67,0X72,0X6F,0X75,0X70,0X2D,0X77,0X69,0X74,0X68,0X2D,0X69,0X63,0X6F,0X6E,0X22,0X3E,0XA,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,0X3C,0X73,0X70,0X61,0X6E,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X61,0X63,0X74,0X69,0X6F,0X6E,0X22,0X3E,0X25,0X73,0X3C,0X2F,0X73,0X70,0X61,0X6E,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X2F,0X73,0X70,0X61,0X6E,0X3E,0XA,0X20,0X20,0X20,0X20,0X25,0X73,0X20,0X3C,0X21,0X2D,0X2D,0X20,0X49,0X66,0X20,0X61,0X6E,0X79,0X20,0X2D,0X2D,0X3E,0XA,0X20,0X20,0X3C,0X2F,0X64,0X69,0X76,0X3E,0XA,0X3C,0X2F,0X64,0X69,0X76,0X3E,0};
struct notification_template {const char* avatar;
const char* username;
const char* action;
const char* action_item;
const char* content;
};
char* tmpl_gen_notification(struct notification_template* data, unsigned* size){
char* ret;
unsigned s = easprintf(&ret, data_notification, data->avatar?data->avatar:"", data->username?data->username:"", data->action?data->action:"", data->action_item?data->action_item:"", data->content?data->content:"");
if (size) *size = s;
return ret;
}
char* tmpl_gen_notification(struct notification_template* data, size_t* size);
#endif

View File

@ -4,8 +4,7 @@
<span class="notification-text-group-with-icon">
<span class="username">{{%s:username}}</span>
<span class="action">{{%s:action}}</span>
{{%s:action_item}} <!-- If any -->
</span>
{{%s:content}}
{{%s:action_item}} <!-- If any -->
</div>
</div>

View File

@ -1,17 +1,13 @@
#ifndef __notification_action
#define __notification_action
static const char data_notification_action[] = {0X3C,0X74,0X61,0X62,0X6C,0X65,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X6E,0X6F,0X74,0X69,0X66,0X69,0X63,0X61,0X74,0X69,0X6F,0X6E,0X20,0X6E,0X6F,0X74,0X69,0X66,0X69,0X63,0X61,0X74,0X69,0X6F,0X6E,0X2D,0X72,0X65,0X67,0X75,0X6C,0X61,0X72,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,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X70,0X66,0X70,0X2D,0X74,0X64,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X69,0X6D,0X67,0X20,0X73,0X72,0X63,0X3D,0X22,0X25,0X73,0X22,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,0X6E,0X6F,0X74,0X69,0X66,0X69,0X63,0X61,0X74,0X69,0X6F,0X6E,0X2D,0X74,0X61,0X62,0X6C,0X65,0X2D,0X62,0X69,0X74,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X74,0X61,0X62,0X6C,0X65,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X75,0X69,0X2D,0X74,0X61,0X62,0X6C,0X65,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X74,0X72,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X64,0X69,0X76,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X6E,0X6F,0X74,0X69,0X66,0X69,0X63,0X61,0X74,0X69,0X6F,0X6E,0X2D,0X69,0X6E,0X66,0X6F,0X2D,0X66,0X6F,0X72,0X6D,0X61,0X74,0X22,0X3E,0XA,0X20,0X20,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,0X6F,0X74,0X69,0X66,0X69,0X63,0X61,0X74,0X69,0X6F,0X6E,0X2D,0X74,0X65,0X78,0X74,0X2D,0X67,0X72,0X6F,0X75,0X70,0X2D,0X77,0X69,0X74,0X68,0X2D,0X69,0X63,0X6F,0X6E,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X73,0X70,0X61,0X6E,0X20,0X74,0X69,0X74,0X6C,0X65,0X3D,0X22,0X25,0X73,0X22,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,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X73,0X70,0X61,0X6E,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X61,0X63,0X74,0X69,0X6F,0X6E,0X22,0X3E,0X25,0X73,0X3C,0X2F,0X73,0X70,0X61,0X6E,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X2F,0X73,0X70,0X61,0X6E,0X3E,0X20,0X25,0X73,0XA,0X20,0X20,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,0X20,0X20,0X3C,0X73,0X70,0X61,0X6E,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X6E,0X6F,0X74,0X69,0X66,0X69,0X63,0X61,0X74,0X69,0X6F,0X6E,0X2D,0X63,0X6F,0X6E,0X74,0X65,0X6E,0X74,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,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,0X40,0X25,0X73,0X3C,0X2F,0X61,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X2F,0X73,0X70,0X61,0X6E,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X2F,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X2F,0X74,0X72,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X2F,0X74,0X61,0X62,0X6C,0X65,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};
#include <stddef.h>
static const char data_notification_action[] = {0X3C,0X74,0X61,0X62,0X6C,0X65,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X6E,0X6F,0X74,0X69,0X66,0X69,0X63,0X61,0X74,0X69,0X6F,0X6E,0X20,0X6E,0X6F,0X74,0X69,0X66,0X69,0X63,0X61,0X74,0X69,0X6F,0X6E,0X2D,0X72,0X65,0X67,0X75,0X6C,0X61,0X72,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,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X70,0X66,0X70,0X2D,0X74,0X64,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X69,0X6D,0X67,0X20,0X73,0X72,0X63,0X3D,0X22,0X25,0X73,0X22,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,0X6E,0X6F,0X74,0X69,0X66,0X69,0X63,0X61,0X74,0X69,0X6F,0X6E,0X2D,0X74,0X61,0X62,0X6C,0X65,0X2D,0X62,0X69,0X74,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X74,0X61,0X62,0X6C,0X65,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X75,0X69,0X2D,0X74,0X61,0X62,0X6C,0X65,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X74,0X72,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X64,0X69,0X76,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X6E,0X6F,0X74,0X69,0X66,0X69,0X63,0X61,0X74,0X69,0X6F,0X6E,0X2D,0X69,0X6E,0X66,0X6F,0X2D,0X66,0X6F,0X72,0X6D,0X61,0X74,0X22,0X3E,0XA,0X20,0X20,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,0X6F,0X74,0X69,0X66,0X69,0X63,0X61,0X74,0X69,0X6F,0X6E,0X2D,0X74,0X65,0X78,0X74,0X2D,0X67,0X72,0X6F,0X75,0X70,0X2D,0X77,0X69,0X74,0X68,0X2D,0X69,0X63,0X6F,0X6E,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X73,0X70,0X61,0X6E,0X20,0X74,0X69,0X74,0X6C,0X65,0X3D,0X22,0X25,0X73,0X22,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,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X73,0X70,0X61,0X6E,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X61,0X63,0X74,0X69,0X6F,0X6E,0X22,0X3E,0X25,0X73,0X3C,0X2F,0X73,0X70,0X61,0X6E,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X2F,0X73,0X70,0X61,0X6E,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X25,0X73,0XA,0X20,0X20,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,0X20,0X20,0X3C,0X73,0X70,0X61,0X6E,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X6E,0X6F,0X74,0X69,0X66,0X69,0X63,0X61,0X74,0X69,0X6F,0X6E,0X2D,0X63,0X6F,0X6E,0X74,0X65,0X6E,0X74,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,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,0X40,0X25,0X73,0X3C,0X2F,0X61,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X2F,0X73,0X70,0X61,0X6E,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X2F,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X2F,0X74,0X72,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X2F,0X74,0X61,0X62,0X6C,0X65,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 notification_action_template {const char* avatar;
const char* acct;
const char* display_name;
const char* action;
const char* idk;
const char* notif_svg;
const char* prefix;
};
char* tmpl_gen_notification_action(struct notification_action_template* data, unsigned* size){
char* ret;
unsigned s = easprintf(&ret, data_notification_action, data->avatar?data->avatar:"", data->acct?data->acct:"", data->display_name?data->display_name:"", data->action?data->action:"", data->idk?data->idk:"", data->prefix?data->prefix:"", data->acct?data->acct:"", data->acct?data->acct:"");
if (size) *size = s;
return ret;
}
char* tmpl_gen_notification_action(struct notification_action_template* data, size_t* size);
#endif

View File

@ -11,7 +11,8 @@
<span class="notification-text-group-with-icon">
<span title="{{%s:acct}}" class="username">{{%s:display_name}}</span>
<span class="action">{{%s:action}}</span>
</span> {{%s:idk}}
</span>
{{%s:notif_svg}}
</div>
<span class="notification-content">
<a href="{{%s:prefix}}/@{{%s:acct}}">@{{%s:acct}}</a>

View File

@ -1,20 +1,15 @@
#ifndef __notification_compact
#define __notification_compact
static const char data_notification_compact[] = {0X3C,0X74,0X61,0X62,0X6C,0X65,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X6E,0X6F,0X74,0X69,0X66,0X69,0X63,0X61,0X74,0X69,0X6F,0X6E,0X2D,0X63,0X6F,0X6D,0X70,0X61,0X63,0X74,0X20,0X6E,0X6F,0X74,0X69,0X66,0X69,0X63,0X61,0X74,0X69,0X6F,0X6E,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,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X70,0X66,0X70,0X2D,0X63,0X6F,0X6D,0X70,0X61,0X63,0X74,0X2D,0X74,0X64,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X69,0X6D,0X67,0X20,0X73,0X72,0X63,0X3D,0X22,0X25,0X73,0X22,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,0X64,0X69,0X76,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X6E,0X6F,0X74,0X69,0X66,0X69,0X63,0X61,0X74,0X69,0X6F,0X6E,0X2D,0X69,0X6E,0X66,0X6F,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X73,0X70,0X61,0X6E,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X6E,0X6F,0X74,0X69,0X66,0X69,0X63,0X61,0X74,0X69,0X6F,0X6E,0X2D,0X74,0X65,0X78,0X74,0X2D,0X67,0X72,0X6F,0X75,0X70,0X25,0X73,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X73,0X70,0X61,0X6E,0X20,0X74,0X69,0X74,0X6C,0X65,0X3D,0X22,0X25,0X73,0X22,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,0X73,0X70,0X61,0X6E,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X61,0X63,0X74,0X69,0X6F,0X6E,0X22,0X3E,0X25,0X73,0X3C,0X2F,0X73,0X70,0X61,0X6E,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X25,0X73,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X2F,0X73,0X70,0X61,0X6E,0X3E,0X20,0X25,0X73,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X2F,0X64,0X69,0X76,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X64,0X69,0X76,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X6E,0X6F,0X74,0X69,0X66,0X69,0X63,0X61,0X74,0X69,0X6F,0X6E,0X2D,0X63,0X6F,0X6E,0X74,0X65,0X6E,0X74,0X22,0X3E,0X25,0X73,0X3C,0X2F,0X64,0X69,0X76,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X64,0X69,0X76,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X6E,0X6F,0X74,0X69,0X66,0X69,0X63,0X61,0X74,0X69,0X6F,0X6E,0X2D,0X73,0X74,0X61,0X74,0X73,0X22,0X3E,0X25,0X73,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};
#include <stddef.h>
static const char data_notification_compact[] = {0X3C,0X74,0X61,0X62,0X6C,0X65,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X6E,0X6F,0X74,0X69,0X66,0X69,0X63,0X61,0X74,0X69,0X6F,0X6E,0X2D,0X63,0X6F,0X6D,0X70,0X61,0X63,0X74,0X20,0X6E,0X6F,0X74,0X69,0X66,0X69,0X63,0X61,0X74,0X69,0X6F,0X6E,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,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X70,0X66,0X70,0X2D,0X63,0X6F,0X6D,0X70,0X61,0X63,0X74,0X2D,0X74,0X64,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X69,0X6D,0X67,0X20,0X73,0X72,0X63,0X3D,0X22,0X25,0X73,0X22,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,0X64,0X69,0X76,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X6E,0X6F,0X74,0X69,0X66,0X69,0X63,0X61,0X74,0X69,0X6F,0X6E,0X2D,0X69,0X6E,0X66,0X6F,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X73,0X70,0X61,0X6E,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X6E,0X6F,0X74,0X69,0X66,0X69,0X63,0X61,0X74,0X69,0X6F,0X6E,0X2D,0X74,0X65,0X78,0X74,0X2D,0X67,0X72,0X6F,0X75,0X70,0X25,0X73,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X73,0X70,0X61,0X6E,0X20,0X74,0X69,0X74,0X6C,0X65,0X3D,0X22,0X25,0X73,0X22,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,0X73,0X70,0X61,0X6E,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X61,0X63,0X74,0X69,0X6F,0X6E,0X22,0X3E,0X25,0X73,0X3C,0X2F,0X73,0X70,0X61,0X6E,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X2F,0X73,0X70,0X61,0X6E,0X3E,0X20,0X25,0X73,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X2F,0X64,0X69,0X76,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X64,0X69,0X76,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X6E,0X6F,0X74,0X69,0X66,0X69,0X63,0X61,0X74,0X69,0X6F,0X6E,0X2D,0X63,0X6F,0X6E,0X74,0X65,0X6E,0X74,0X22,0X3E,0X25,0X73,0X3C,0X2F,0X64,0X69,0X76,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X64,0X69,0X76,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X6E,0X6F,0X74,0X69,0X66,0X69,0X63,0X61,0X74,0X69,0X6F,0X6E,0X2D,0X73,0X74,0X61,0X74,0X73,0X22,0X3E,0X25,0X73,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 notification_compact_template {const char* avatar;
const char* idk;
const char* has_icon;
const char* acct;
const char* display_name;
const char* action;
const char* action_item;
const char* idk2;
const char* notif_svg;
const char* content;
const char* stats;
};
char* tmpl_gen_notification_compact(struct notification_compact_template* data, unsigned* size){
char* ret;
unsigned s = easprintf(&ret, data_notification_compact, data->avatar?data->avatar:"", data->idk?data->idk:"", data->acct?data->acct:"", data->display_name?data->display_name:"", data->action?data->action:"", data->action_item?data->action_item:"", data->idk2?data->idk2:"", data->content?data->content:"", data->stats?data->stats:"");
if (size) *size = s;
return ret;
}
char* tmpl_gen_notification_compact(struct notification_compact_template* data, size_t* size);
#endif

View File

@ -5,11 +5,10 @@
</td>
<td>
<div class="notification-info">
<span class="notification-text-group{{%s:idk}}">
<span class="notification-text-group{{%s:has_icon}}">
<span title="{{%s:acct}}" class="username">{{%s:display_name}}</span>
<span class="action">{{%s:action}}</span>
{{%s:action_item}}
</span> {{%s:idk2}}
</span> {{%s:notif_svg}}
</div>
<div class="notification-content">{{%s:content}}</div>
<div class="notification-stats">{{%s:stats}}</div>

View File

@ -1,12 +1,8 @@
#ifndef __notifications
#define __notifications
#include <stddef.h>
static const char data_notifications[] = {0X3C,0X64,0X69,0X76,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X6E,0X6F,0X74,0X69,0X66,0X69,0X63,0X61,0X74,0X69,0X6F,0X6E,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,0};
struct notifications_template {const char* notifications;
};
char* tmpl_gen_notifications(struct notifications_template* data, unsigned* size){
char* ret;
unsigned s = easprintf(&ret, data_notifications, data->notifications?data->notifications:"");
if (size) *size = s;
return ret;
}
char* tmpl_gen_notifications(struct notifications_template* data, size_t* size);
#endif

View File

@ -1,15 +1,11 @@
#ifndef __notifications_embed
#define __notifications_embed
#include <stddef.h>
static const char data_notifications_embed[] = {0X3C,0X21,0X44,0X4F,0X43,0X54,0X59,0X50,0X45,0X20,0X68,0X74,0X6D,0X6C,0X3E,0XA,0X3C,0X68,0X74,0X6D,0X6C,0X3E,0XA,0X20,0X20,0X3C,0X68,0X65,0X61,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X6D,0X65,0X74,0X61,0X20,0X63,0X68,0X61,0X72,0X73,0X65,0X74,0X3D,0X22,0X75,0X74,0X66,0X2D,0X38,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X74,0X69,0X74,0X6C,0X65,0X3E,0X4E,0X6F,0X74,0X69,0X66,0X69,0X63,0X61,0X74,0X69,0X6F,0X6E,0X73,0X20,0X65,0X6D,0X62,0X65,0X64,0X3C,0X2F,0X74,0X69,0X74,0X6C,0X65,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X6C,0X69,0X6E,0X6B,0X20,0X72,0X65,0X6C,0X3D,0X22,0X73,0X74,0X79,0X6C,0X65,0X73,0X68,0X65,0X65,0X74,0X22,0X20,0X74,0X79,0X70,0X65,0X3D,0X22,0X74,0X65,0X78,0X74,0X2F,0X63,0X73,0X73,0X22,0X20,0X68,0X72,0X65,0X66,0X3D,0X22,0X2F,0X25,0X73,0X25,0X73,0X2E,0X63,0X73,0X73,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X73,0X74,0X79,0X6C,0X65,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X68,0X74,0X6D,0X6C,0X2C,0X20,0X62,0X6F,0X64,0X79,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X7B,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X62,0X61,0X63,0X6B,0X67,0X72,0X6F,0X75,0X6E,0X64,0X2D,0X63,0X6F,0X6C,0X6F,0X72,0X3A,0X20,0X75,0X6E,0X73,0X65,0X74,0X3B,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X73,0X63,0X72,0X6F,0X6C,0X6C,0X62,0X61,0X72,0X2D,0X63,0X6F,0X6C,0X6F,0X72,0X3A,0X20,0X23,0X38,0X30,0X38,0X30,0X38,0X30,0X20,0X23,0X65,0X61,0X65,0X63,0X66,0X30,0X3B,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X73,0X63,0X72,0X6F,0X6C,0X6C,0X62,0X61,0X72,0X2D,0X77,0X69,0X64,0X74,0X68,0X3A,0X20,0X74,0X68,0X69,0X6E,0X3B,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X7D,0XA,0X20,0X20,0X20,0X20,0X3C,0X2F,0X73,0X74,0X79,0X6C,0X65,0X3E,0XA,0X20,0X20,0X3C,0X2F,0X68,0X65,0X61,0X64,0X3E,0XA,0X20,0X20,0X3C,0X62,0X6F,0X64,0X79,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X64,0X69,0X76,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X73,0X69,0X64,0X65,0X62,0X61,0X72,0X2D,0X65,0X6D,0X62,0X65,0X64,0X2D,0X63,0X6F,0X6E,0X74,0X61,0X69,0X6E,0X65,0X72,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X25,0X73,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X64,0X69,0X76,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X73,0X69,0X64,0X65,0X62,0X61,0X72,0X2D,0X65,0X6D,0X62,0X65,0X64,0X2D,0X6E,0X6F,0X74,0X69,0X66,0X73,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X25,0X73,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X2F,0X64,0X69,0X76,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X2F,0X64,0X69,0X76,0X3E,0XA,0X20,0X20,0X3C,0X2F,0X62,0X6F,0X64,0X79,0X3E,0XA,0X3C,0X2F,0X68,0X74,0X6D,0X6C,0X3E,0};
struct notifications_embed_template {const char* theme;
const char* theme_var;
const char* navigation_box;
const char* notifications;
};
char* tmpl_gen_notifications_embed(struct notifications_embed_template* data, unsigned* size){
char* ret;
unsigned s = easprintf(&ret, data_notifications_embed, data->theme?data->theme:"", data->theme_var?data->theme_var:"", data->navigation_box?data->navigation_box:"", data->notifications?data->notifications:"");
if (size) *size = s;
return ret;
}
char* tmpl_gen_notifications_embed(struct notifications_embed_template* data, size_t* size);
#endif

View File

@ -1,13 +1,9 @@
#ifndef __notifications_page
#define __notifications_page
#include <stddef.h>
static const char data_notifications_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,0X4E,0X6F,0X74,0X69,0X66,0X69,0X63,0X61,0X74,0X69,0X6F,0X6E,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,0X6E,0X6F,0X74,0X69,0X66,0X69,0X63,0X61,0X74,0X69,0X6F,0X6E,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 notifications_page_template {const char* notifications;
const char* navigation;
};
char* tmpl_gen_notifications_page(struct notifications_page_template* data, unsigned* size){
char* ret;
unsigned s = easprintf(&ret, data_notifications_page, data->notifications?data->notifications:"", data->navigation?data->navigation:"");
if (size) *size = s;
return ret;
}
char* tmpl_gen_notifications_page(struct notifications_page_template* data, size_t* size);
#endif

View File

@ -1,14 +1,10 @@
#ifndef __post
#define __post
#include <stddef.h>
static const char data_post[] = {0X3C,0X66,0X6F,0X72,0X6D,0X20,0X61,0X63,0X74,0X69,0X6F,0X6E,0X3D,0X22,0X25,0X73,0X2F,0X73,0X74,0X61,0X74,0X75,0X73,0X2F,0X63,0X72,0X65,0X61,0X74,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,0X25,0X73,0XA,0X20,0X20,0X3C,0X64,0X69,0X76,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X73,0X74,0X61,0X74,0X75,0X73,0X62,0X6F,0X78,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X74,0X65,0X78,0X74,0X61,0X72,0X65,0X61,0X20,0X6E,0X61,0X6D,0X65,0X3D,0X22,0X63,0X6F,0X6E,0X74,0X65,0X6E,0X74,0X22,0X20,0X70,0X6C,0X61,0X63,0X65,0X68,0X6F,0X6C,0X64,0X65,0X72,0X3D,0X22,0X4A,0X75,0X73,0X74,0X20,0X6C,0X61,0X6E,0X64,0X65,0X64,0X20,0X69,0X6E,0X20,0X4E,0X2E,0X59,0X2E,0X22,0X20,0X72,0X6F,0X77,0X73,0X3D,0X22,0X35,0X22,0X20,0X74,0X61,0X62,0X69,0X6E,0X64,0X65,0X78,0X3D,0X22,0X31,0X22,0X3E,0X25,0X73,0X3C,0X2F,0X74,0X65,0X78,0X74,0X61,0X72,0X65,0X61,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X64,0X69,0X76,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X73,0X74,0X61,0X74,0X75,0X73,0X66,0X6F,0X6F,0X74,0X65,0X72,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X64,0X69,0X76,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X73,0X74,0X61,0X74,0X75,0X73,0X66,0X6F,0X6F,0X74,0X65,0X72,0X2D,0X6C,0X65,0X66,0X74,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X73,0X65,0X6C,0X65,0X63,0X74,0X20,0X74,0X61,0X62,0X69,0X6E,0X64,0X65,0X78,0X3D,0X22,0X33,0X22,0X20,0X6E,0X61,0X6D,0X65,0X3D,0X22,0X76,0X69,0X73,0X69,0X62,0X69,0X6C,0X69,0X74,0X79,0X22,0X20,0X69,0X64,0X3D,0X22,0X76,0X69,0X73,0X69,0X62,0X69,0X6C,0X69,0X74,0X79,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,0X70,0X75,0X62,0X6C,0X69,0X63,0X22,0X3E,0X50,0X75,0X62,0X6C,0X69,0X63,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,0X75,0X6E,0X6C,0X69,0X73,0X74,0X65,0X64,0X22,0X3E,0X55,0X6E,0X6C,0X69,0X73,0X74,0X65,0X64,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,0X70,0X72,0X69,0X76,0X61,0X74,0X65,0X22,0X3E,0X50,0X72,0X69,0X76,0X61,0X74,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,0X64,0X69,0X72,0X65,0X63,0X74,0X22,0X3E,0X44,0X69,0X72,0X65,0X63,0X74,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,0X6C,0X6F,0X63,0X61,0X6C,0X22,0X3E,0X4C,0X6F,0X63,0X61,0X6C,0X3C,0X2F,0X6F,0X70,0X74,0X69,0X6F,0X6E,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X21,0X2D,0X2D,0X20,0X54,0X4F,0X44,0X4F,0X20,0X67,0X65,0X6E,0X65,0X72,0X61,0X74,0X65,0X20,0X6C,0X69,0X73,0X74,0X73,0X20,0X2D,0X2D,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,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,0X20,0X74,0X61,0X62,0X69,0X6E,0X64,0X65,0X78,0X3D,0X22,0X34,0X22,0X20,0X6D,0X75,0X6C,0X74,0X69,0X70,0X6C,0X65,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X2F,0X64,0X69,0X76,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X64,0X69,0X76,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X73,0X74,0X61,0X74,0X75,0X73,0X66,0X6F,0X6F,0X74,0X65,0X72,0X2D,0X72,0X69,0X67,0X68,0X74,0X22,0X3E,0XA,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,0X76,0X61,0X6C,0X75,0X65,0X3D,0X22,0X50,0X6F,0X73,0X74,0X22,0X20,0X74,0X61,0X62,0X69,0X6E,0X64,0X65,0X78,0X3D,0X22,0X32,0X22,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X62,0X74,0X6E,0X20,0X70,0X6F,0X73,0X74,0X2D,0X62,0X74,0X6E,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X2F,0X64,0X69,0X76,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X2F,0X64,0X69,0X76,0X3E,0XA,0X20,0X20,0X3C,0X2F,0X64,0X69,0X76,0X3E,0XA,0X3C,0X2F,0X66,0X6F,0X72,0X6D,0X3E,0};
struct post_template {const char* prefix;
const char* reply_input;
const char* content;
};
char* tmpl_gen_post(struct post_template* data, unsigned* size){
char* ret;
unsigned s = easprintf(&ret, data_post, data->prefix?data->prefix:"", data->reply_input?data->reply_input:"", data->content?data->content:"");
if (size) *size = s;
return ret;
}
char* tmpl_gen_post(struct post_template* data, size_t* size);
#endif

View File

@ -1,15 +1,11 @@
#ifndef __quick_login
#define __quick_login
#include <stddef.h>
static const char data_quick_login[] = {0X3C,0X64,0X69,0X76,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X73,0X69,0X64,0X65,0X62,0X61,0X72,0X2D,0X6C,0X6F,0X67,0X69,0X6E,0X22,0X3E,0XA,0X20,0X20,0X3C,0X66,0X6F,0X72,0X6D,0X20,0X61,0X63,0X74,0X69,0X6F,0X6E,0X3D,0X22,0X25,0X73,0X2F,0X6C,0X6F,0X67,0X69,0X6E,0X22,0X20,0X6D,0X65,0X74,0X68,0X6F,0X64,0X3D,0X22,0X70,0X6F,0X73,0X74,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X64,0X69,0X76,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X66,0X6F,0X72,0X6D,0X2D,0X67,0X72,0X6F,0X75,0X70,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X6C,0X61,0X62,0X65,0X6C,0X20,0X66,0X6F,0X72,0X3D,0X22,0X6C,0X6F,0X67,0X69,0X6E,0X2D,0X75,0X73,0X65,0X72,0X6E,0X61,0X6D,0X65,0X22,0X3E,0X25,0X73,0X3A,0X20,0X3C,0X2F,0X6C,0X61,0X62,0X65,0X6C,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X69,0X6E,0X70,0X75,0X74,0X20,0X74,0X79,0X70,0X65,0X3D,0X22,0X74,0X65,0X78,0X74,0X22,0X20,0X69,0X64,0X3D,0X22,0X6C,0X6F,0X67,0X69,0X6E,0X2D,0X75,0X73,0X65,0X72,0X6E,0X61,0X6D,0X65,0X22,0X20,0X6E,0X61,0X6D,0X65,0X3D,0X22,0X75,0X73,0X65,0X72,0X6E,0X61,0X6D,0X65,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X2F,0X64,0X69,0X76,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X64,0X69,0X76,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X66,0X6F,0X72,0X6D,0X2D,0X67,0X72,0X6F,0X75,0X70,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X6C,0X61,0X62,0X65,0X6C,0X20,0X66,0X6F,0X72,0X3D,0X22,0X6C,0X6F,0X67,0X69,0X6E,0X2D,0X70,0X61,0X73,0X73,0X77,0X6F,0X72,0X64,0X22,0X3E,0X25,0X73,0X3A,0X20,0X3C,0X2F,0X6C,0X61,0X62,0X65,0X6C,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X69,0X6E,0X70,0X75,0X74,0X20,0X74,0X79,0X70,0X65,0X3D,0X22,0X70,0X61,0X73,0X73,0X77,0X6F,0X72,0X64,0X22,0X20,0X69,0X64,0X3D,0X22,0X6C,0X6F,0X67,0X69,0X6E,0X2D,0X70,0X61,0X73,0X73,0X77,0X6F,0X72,0X64,0X22,0X20,0X6E,0X61,0X6D,0X65,0X3D,0X22,0X70,0X61,0X73,0X73,0X77,0X6F,0X72,0X64,0X22,0X3E,0X3C,0X62,0X72,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X2F,0X64,0X69,0X76,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X64,0X69,0X76,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X66,0X6F,0X72,0X6D,0X2D,0X67,0X72,0X6F,0X75,0X70,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X69,0X6E,0X70,0X75,0X74,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X62,0X74,0X6E,0X22,0X20,0X74,0X79,0X70,0X65,0X3D,0X22,0X73,0X75,0X62,0X6D,0X69,0X74,0X22,0X20,0X76,0X61,0X6C,0X75,0X65,0X3D,0X22,0X25,0X73,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X2F,0X64,0X69,0X76,0X3E,0XA,0X20,0X20,0X3C,0X2F,0X66,0X6F,0X72,0X6D,0X3E,0XA,0X3C,0X2F,0X64,0X69,0X76,0X3E,0};
struct quick_login_template {const char* prefix;
const char* username;
const char* password;
const char* login;
};
char* tmpl_gen_quick_login(struct quick_login_template* data, unsigned* size){
char* ret;
unsigned s = easprintf(&ret, data_quick_login, data->prefix?data->prefix:"", data->username?data->username:"", data->password?data->password:"", data->login?data->login:"");
if (size) *size = s;
return ret;
}
char* tmpl_gen_quick_login(struct quick_login_template* data, size_t* size);
#endif

View File

@ -1,14 +1,10 @@
#ifndef __reactions_btn
#define __reactions_btn
#include <stddef.h>
static const char data_reactions_btn[] = {0X3C,0X74,0X64,0X3E,0XA,0X20,0X20,0X3C,0X61,0X20,0X74,0X61,0X72,0X67,0X65,0X74,0X3D,0X22,0X5F,0X70,0X61,0X72,0X65,0X6E,0X74,0X22,0X20,0X68,0X72,0X65,0X66,0X3D,0X22,0X25,0X73,0X2F,0X73,0X74,0X61,0X74,0X75,0X73,0X2F,0X25,0X73,0X2F,0X72,0X65,0X61,0X63,0X74,0X23,0X69,0X64,0X2D,0X25,0X73,0X22,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X70,0X6F,0X69,0X6E,0X74,0X65,0X72,0X20,0X73,0X74,0X61,0X74,0X62,0X74,0X6E,0X20,0X72,0X65,0X61,0X63,0X74,0X2D,0X62,0X74,0X6E,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X73,0X76,0X67,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X65,0X6D,0X6F,0X6A,0X69,0X2D,0X62,0X74,0X6E,0X22,0X20,0X78,0X6D,0X6C,0X6E,0X73,0X3D,0X22,0X68,0X74,0X74,0X70,0X3A,0X2F,0X2F,0X77,0X77,0X77,0X2E,0X77,0X33,0X2E,0X6F,0X72,0X67,0X2F,0X32,0X30,0X30,0X30,0X2F,0X73,0X76,0X67,0X22,0X20,0X77,0X69,0X64,0X74,0X68,0X3D,0X22,0X32,0X30,0X22,0X20,0X68,0X65,0X69,0X67,0X68,0X74,0X3D,0X22,0X32,0X30,0X22,0X20,0X76,0X69,0X65,0X77,0X42,0X6F,0X78,0X3D,0X22,0X30,0X20,0X30,0X20,0X32,0X34,0X20,0X32,0X34,0X22,0X20,0X66,0X69,0X6C,0X6C,0X3D,0X22,0X6E,0X6F,0X6E,0X65,0X22,0X20,0X73,0X74,0X72,0X6F,0X6B,0X65,0X3D,0X22,0X23,0X30,0X30,0X30,0X30,0X30,0X30,0X22,0X20,0X73,0X74,0X72,0X6F,0X6B,0X65,0X2D,0X77,0X69,0X64,0X74,0X68,0X3D,0X22,0X32,0X22,0X20,0X73,0X74,0X72,0X6F,0X6B,0X65,0X2D,0X6C,0X69,0X6E,0X65,0X63,0X61,0X70,0X3D,0X22,0X72,0X6F,0X75,0X6E,0X64,0X22,0X20,0X73,0X74,0X72,0X6F,0X6B,0X65,0X2D,0X6C,0X69,0X6E,0X65,0X6A,0X6F,0X69,0X6E,0X3D,0X22,0X72,0X6F,0X75,0X6E,0X64,0X22,0X3E,0X3C,0X63,0X69,0X72,0X63,0X6C,0X65,0X20,0X63,0X78,0X3D,0X22,0X31,0X32,0X22,0X20,0X63,0X79,0X3D,0X22,0X31,0X32,0X22,0X20,0X72,0X3D,0X22,0X31,0X30,0X22,0X3E,0X3C,0X2F,0X63,0X69,0X72,0X63,0X6C,0X65,0X3E,0X3C,0X6C,0X69,0X6E,0X65,0X20,0X78,0X31,0X3D,0X22,0X38,0X22,0X20,0X79,0X31,0X3D,0X22,0X31,0X32,0X22,0X20,0X78,0X32,0X3D,0X22,0X31,0X36,0X22,0X20,0X79,0X32,0X3D,0X22,0X31,0X32,0X22,0X3E,0X3C,0X2F,0X6C,0X69,0X6E,0X65,0X3E,0X3C,0X2F,0X73,0X76,0X67,0X3E,0XA,0X20,0X20,0X20,0X20,0X25,0X73,0XA,0X20,0X20,0X3C,0X2F,0X66,0X6F,0X72,0X6D,0X3E,0XA,0X3C,0X2F,0X74,0X64,0X3E,0};
struct reactions_btn_template {const char* prefix;
const char* status_id;
const char* emoji_picker;
};
char* tmpl_gen_reactions_btn(struct reactions_btn_template* data, unsigned* size){
char* ret;
unsigned s = easprintf(&ret, data_reactions_btn, data->prefix?data->prefix:"", data->status_id?data->status_id:"", data->status_id?data->status_id:"", data->emoji_picker?data->emoji_picker:"");
if (size) *size = s;
return ret;
}
char* tmpl_gen_reactions_btn(struct reactions_btn_template* data, size_t* size);
#endif

View File

@ -1,5 +1,6 @@
#ifndef __repeat_svg
#define __repeat_svg
#include <stddef.h>
static const char data_repeat_svg[] = {0X3C,0X73,0X76,0X67,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X72,0X65,0X70,0X65,0X61,0X74,0X22,0X20,0X78,0X6D,0X6C,0X6E,0X73,0X3D,0X22,0X68,0X74,0X74,0X70,0X3A,0X2F,0X2F,0X77,0X77,0X77,0X2E,0X77,0X33,0X2E,0X6F,0X72,0X67,0X2F,0X32,0X30,0X30,0X30,0X2F,0X73,0X76,0X67,0X22,0X20,0X77,0X69,0X64,0X74,0X68,0X3D,0X22,0X32,0X30,0X22,0X20,0X68,0X65,0X69,0X67,0X68,0X74,0X3D,0X22,0X32,0X30,0X22,0X20,0X76,0X69,0X65,0X77,0X42,0X6F,0X78,0X3D,0X22,0X30,0X20,0X30,0X20,0X32,0X34,0X20,0X32,0X34,0X22,0X20,0X66,0X69,0X6C,0X6C,0X3D,0X22,0X6E,0X6F,0X6E,0X65,0X22,0X20,0X73,0X74,0X72,0X6F,0X6B,0X65,0X3D,0X22,0X23,0X30,0X30,0X30,0X30,0X30,0X30,0X22,0X20,0X73,0X74,0X72,0X6F,0X6B,0X65,0X2D,0X77,0X69,0X64,0X74,0X68,0X3D,0X22,0X32,0X22,0X20,0X73,0X74,0X72,0X6F,0X6B,0X65,0X2D,0X6C,0X69,0X6E,0X65,0X63,0X61,0X70,0X3D,0X22,0X72,0X6F,0X75,0X6E,0X64,0X22,0X20,0X73,0X74,0X72,0X6F,0X6B,0X65,0X2D,0X6C,0X69,0X6E,0X65,0X6A,0X6F,0X69,0X6E,0X3D,0X22,0X72,0X6F,0X75,0X6E,0X64,0X22,0X3E,0X3C,0X70,0X61,0X74,0X68,0X20,0X64,0X3D,0X22,0X4D,0X31,0X37,0X20,0X32,0X2E,0X31,0X6C,0X34,0X20,0X34,0X2D,0X34,0X20,0X34,0X22,0X2F,0X3E,0X3C,0X70,0X61,0X74,0X68,0X20,0X64,0X3D,0X22,0X4D,0X33,0X20,0X31,0X32,0X2E,0X32,0X76,0X2D,0X32,0X61,0X34,0X20,0X34,0X20,0X30,0X20,0X30,0X20,0X31,0X20,0X34,0X2D,0X34,0X68,0X31,0X32,0X2E,0X38,0X4D,0X37,0X20,0X32,0X31,0X2E,0X39,0X6C,0X2D,0X34,0X2D,0X34,0X20,0X34,0X2D,0X34,0X22,0X2F,0X3E,0X3C,0X70,0X61,0X74,0X68,0X20,0X64,0X3D,0X22,0X4D,0X32,0X31,0X20,0X31,0X31,0X2E,0X38,0X76,0X32,0X61,0X34,0X20,0X34,0X20,0X30,0X20,0X30,0X20,0X31,0X2D,0X34,0X20,0X34,0X48,0X34,0X2E,0X32,0X22,0X2F,0X3E,0X3C,0X2F,0X73,0X76,0X67,0X3E,0};
#endif

View File

@ -1,5 +1,6 @@
#ifndef __scrobble
#define __scrobble
#include <stddef.h>
static const char data_scrobble[] = {0X3C,0X64,0X69,0X76,0X20,0X69,0X64,0X3D,0X22,0X73,0X63,0X72,0X6F,0X62,0X62,0X6C,0X65,0X2D,0X25,0X73,0X22,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X73,0X63,0X72,0X6F,0X62,0X62,0X6C,0X65,0X20,0X75,0X69,0X2D,0X74,0X61,0X62,0X6C,0X65,0X22,0X3E,0XA,0X20,0X20,0X3C,0X74,0X61,0X62,0X6C,0X65,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X73,0X63,0X72,0X6F,0X62,0X62,0X6C,0X69,0X73,0X74,0X2D,0X69,0X6E,0X66,0X6F,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X74,0X64,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X70,0X66,0X70,0X2D,0X63,0X6F,0X6D,0X70,0X61,0X63,0X74,0X2D,0X74,0X64,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X69,0X6D,0X67,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X70,0X66,0X70,0X2D,0X69,0X6D,0X67,0X2D,0X73,0X63,0X72,0X6F,0X62,0X62,0X6C,0X65,0X22,0X20,0X73,0X72,0X63,0X3D,0X22,0X25,0X73,0X22,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,0X73,0X63,0X72,0X6F,0X62,0X62,0X6C,0X69,0X73,0X74,0X2D,0X69,0X6E,0X66,0X6F,0X2D,0X74,0X65,0X78,0X74,0X22,0X3E,0XA,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,0X20,0X3C,0X73,0X70,0X61,0X6E,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X73,0X63,0X72,0X6F,0X62,0X62,0X6C,0X69,0X73,0X74,0X2D,0X61,0X63,0X74,0X69,0X76,0X69,0X74,0X79,0X22,0X3E,0X25,0X73,0X3C,0X2F,0X73,0X70,0X61,0X6E,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X2F,0X74,0X64,0X3E,0X20,0X20,0X20,0X20,0X20,0X20,0XA,0X20,0X20,0X3C,0X2F,0X74,0X61,0X62,0X6C,0X65,0X3E,0XA,0X20,0X20,0X3C,0X74,0X61,0X62,0X6C,0X65,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X73,0X63,0X72,0X6F,0X62,0X62,0X6C,0X65,0X73,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X74,0X72,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X73,0X63,0X72,0X6F,0X62,0X62,0X6C,0X65,0X2D,0X74,0X69,0X74,0X6C,0X65,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X74,0X64,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X73,0X63,0X72,0X6F,0X62,0X62,0X6C,0X65,0X2D,0X6B,0X65,0X79,0X22,0X3E,0X25,0X73,0X3C,0X2F,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X74,0X64,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X73,0X63,0X72,0X6F,0X62,0X62,0X6C,0X65,0X2D,0X76,0X61,0X6C,0X75,0X65,0X22,0X3E,0X25,0X73,0X3C,0X2F,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X2F,0X74,0X72,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X74,0X72,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X73,0X63,0X72,0X6F,0X62,0X62,0X6C,0X65,0X2D,0X61,0X72,0X74,0X69,0X73,0X74,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X74,0X64,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X73,0X63,0X72,0X6F,0X62,0X62,0X6C,0X65,0X2D,0X6B,0X65,0X79,0X22,0X3E,0X25,0X73,0X3C,0X2F,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X74,0X64,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X73,0X63,0X72,0X6F,0X62,0X62,0X6C,0X65,0X2D,0X76,0X61,0X6C,0X75,0X65,0X22,0X3E,0X25,0X73,0X3C,0X2F,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X2F,0X74,0X72,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X74,0X72,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X73,0X63,0X72,0X6F,0X62,0X62,0X6C,0X65,0X2D,0X61,0X6C,0X62,0X75,0X6D,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X74,0X64,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X73,0X63,0X72,0X6F,0X62,0X62,0X6C,0X65,0X2D,0X6B,0X65,0X79,0X22,0X3E,0X25,0X73,0X3C,0X2F,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X74,0X64,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X73,0X63,0X72,0X6F,0X62,0X62,0X6C,0X65,0X2D,0X76,0X61,0X6C,0X75,0X65,0X22,0X3E,0X25,0X73,0X3C,0X2F,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X2F,0X74,0X72,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X74,0X72,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X73,0X63,0X72,0X6F,0X62,0X62,0X6C,0X65,0X2D,0X6C,0X65,0X6E,0X67,0X74,0X68,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X74,0X64,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X73,0X63,0X72,0X6F,0X62,0X62,0X6C,0X65,0X2D,0X6B,0X65,0X79,0X22,0X3E,0X25,0X73,0X3C,0X2F,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X74,0X64,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X73,0X63,0X72,0X6F,0X62,0X62,0X6C,0X65,0X2D,0X76,0X61,0X6C,0X75,0X65,0X22,0X3E,0X25,0X64,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 scrobble_template {const char* scrobble_id;
const char* avatar;
@ -14,10 +15,5 @@ const char* album;
const char* length_key;
int length;
};
char* tmpl_gen_scrobble(struct scrobble_template* data, unsigned* size){
char* ret;
unsigned s = easprintf(&ret, data_scrobble, data->scrobble_id?data->scrobble_id:"", data->avatar?data->avatar:"", data->username?data->username:"", data->activity?data->activity:"", data->title_key?data->title_key:"", data->title?data->title:"", data->artist_key?data->artist_key:"", data->artist?data->artist:"", data->album_key?data->album_key:"", data->album?data->album:"", data->length_key?data->length_key:"", data->length);
if (size) *size = s;
return ret;
}
char* tmpl_gen_scrobble(struct scrobble_template* data, size_t* size);
#endif

View File

@ -1,5 +1,6 @@
#ifndef __search
#define __search
#include <stddef.h>
static const char data_search[] = {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,0X73,0X65,0X61,0X72,0X63,0X68,0X2F,0X73,0X74,0X61,0X74,0X75,0X73,0X65,0X73,0X3F,0X71,0X3D,0X25,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,0X73,0X65,0X61,0X72,0X63,0X68,0X2F,0X61,0X63,0X63,0X6F,0X75,0X6E,0X74,0X73,0X3F,0X71,0X3D,0X25,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,0X73,0X65,0X61,0X72,0X63,0X68,0X2F,0X68,0X61,0X73,0X68,0X74,0X61,0X67,0X73,0X3F,0X71,0X3D,0X25,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,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,0X73,0X65,0X61,0X72,0X63,0X68,0X2D,0X72,0X65,0X73,0X75,0X6C,0X74,0X73,0X22,0X3E,0XA,0X20,0X20,0X25,0X73,0XA,0X3C,0X2F,0X64,0X69,0X76,0X3E,0};
struct search_template {const char* prefix;
const char* query;
@ -11,10 +12,5 @@ const char* hashtags_active;
const char* hashtags;
const char* results;
};
char* tmpl_gen_search(struct search_template* data, unsigned* size){
char* ret;
unsigned s = easprintf(&ret, data_search, data->prefix?data->prefix:"", data->query?data->query:"", data->statuses_active?data->statuses_active:"", data->statuses?data->statuses:"", data->prefix?data->prefix:"", data->query?data->query:"", data->accounts_active?data->accounts_active:"", data->accounts?data->accounts:"", data->prefix?data->prefix:"", data->query?data->query:"", data->hashtags_active?data->hashtags_active:"", data->hashtags?data->hashtags:"", data->results?data->results:"");
if (size) *size = s;
return ret;
}
char* tmpl_gen_search(struct search_template* data, size_t* size);
#endif

File diff suppressed because one or more lines are too long

View File

@ -1,13 +1,9 @@
#ifndef __status_interaction_profile
#define __status_interaction_profile
#include <stddef.h>
static const char data_status_interaction_profile[] = {0X3C,0X69,0X6D,0X67,0X20,0X74,0X69,0X74,0X6C,0X65,0X3D,0X22,0X25,0X73,0X22,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X70,0X66,0X70,0X2D,0X69,0X6E,0X74,0X65,0X72,0X61,0X63,0X74,0X69,0X6F,0X6E,0X22,0X20,0X73,0X72,0X63,0X3D,0X22,0X25,0X73,0X22,0X3E,0};
struct status_interaction_profile_template {const char* acct;
const char* avatar;
};
char* tmpl_gen_status_interaction_profile(struct status_interaction_profile_template* data, unsigned* size){
char* ret;
unsigned s = easprintf(&ret, data_status_interaction_profile, data->acct?data->acct:"", data->avatar?data->avatar:"");
if (size) *size = s;
return ret;
}
char* tmpl_gen_status_interaction_profile(struct status_interaction_profile_template* data, size_t* size);
#endif

View File

@ -1,14 +1,10 @@
#ifndef __status_interactions
#define __status_interactions
#include <stddef.h>
static const char data_status_interactions[] = {0X3C,0X64,0X69,0X76,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X73,0X74,0X61,0X74,0X75,0X73,0X2D,0X69,0X6E,0X74,0X65,0X72,0X61,0X63,0X74,0X69,0X6F,0X6E,0X73,0X22,0X3E,0XA,0X20,0X20,0X3C,0X64,0X69,0X76,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X73,0X74,0X61,0X74,0X75,0X73,0X2D,0X69,0X6E,0X74,0X65,0X72,0X61,0X63,0X74,0X69,0X6F,0X6E,0X73,0X2D,0X6C,0X61,0X62,0X65,0X6C,0X73,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X21,0X2D,0X2D,0X20,0X46,0X61,0X76,0X6F,0X75,0X72,0X69,0X74,0X65,0X73,0X20,0X63,0X6F,0X75,0X6E,0X74,0X20,0X2D,0X2D,0X3E,0XA,0X20,0X20,0X20,0X20,0X25,0X73,0XA,0X20,0X20,0X20,0X20,0X3C,0X21,0X2D,0X2D,0X20,0X52,0X65,0X62,0X6C,0X6F,0X67,0X20,0X63,0X6F,0X75,0X6E,0X74,0X20,0X2D,0X2D,0X3E,0XA,0X20,0X20,0X20,0X20,0X25,0X73,0XA,0X20,0X20,0X3C,0X2F,0X64,0X69,0X76,0X3E,0XA,0X20,0X20,0X3C,0X64,0X69,0X76,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X73,0X74,0X61,0X74,0X75,0X73,0X2D,0X69,0X6E,0X74,0X65,0X72,0X61,0X63,0X74,0X69,0X6F,0X6E,0X73,0X2D,0X70,0X66,0X70,0X73,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X25,0X73,0XA,0X20,0X20,0X3C,0X2F,0X64,0X69,0X76,0X3E,0XA,0X3C,0X2F,0X64,0X69,0X76,0X3E,0};
struct status_interactions_template {const char* favourites_count;
const char* reblogs_count;
const char* users;
};
char* tmpl_gen_status_interactions(struct status_interactions_template* data, unsigned* size){
char* ret;
unsigned s = easprintf(&ret, data_status_interactions, data->favourites_count?data->favourites_count:"", data->reblogs_count?data->reblogs_count:"", data->users?data->users:"");
if (size) *size = s;
return ret;
}
char* tmpl_gen_status_interactions(struct status_interactions_template* data, size_t* size);
#endif

View File

@ -1,13 +1,9 @@
#ifndef __status_interactions_label
#define __status_interactions_label
#include <stddef.h>
static const char data_status_interactions_label[] = {0X3C,0X64,0X69,0X76,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,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,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,0X3C,0X2F,0X64,0X69,0X76,0X3E,0};
struct status_interactions_label_template {const char* header;
int value;
};
char* tmpl_gen_status_interactions_label(struct status_interactions_label_template* data, unsigned* size){
char* ret;
unsigned s = easprintf(&ret, data_status_interactions_label, data->header?data->header:"", data->value);
if (size) *size = s;
return ret;
}
char* tmpl_gen_status_interactions_label(struct status_interactions_label_template* data, size_t* size);
#endif

View File

@ -1,5 +1,6 @@
#ifndef __test
#define __test
#include <stddef.h>
static const char data_test[] = {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,0X54,0X65,0X73,0X74,0X20,0X70,0X61,0X67,0X65,0X3C,0X2F,0X68,0X31,0X3E,0XA,0X20,0X20,0X3C,0X70,0X3E,0X54,0X65,0X73,0X74,0X20,0X79,0X6F,0X75,0X72,0X20,0X6E,0X67,0X69,0X6E,0X78,0X2F,0X61,0X70,0X61,0X63,0X68,0X65,0X20,0X61,0X6E,0X64,0X20,0X62,0X72,0X6F,0X77,0X73,0X65,0X72,0X20,0X68,0X65,0X72,0X65,0X3C,0X2F,0X70,0X3E,0XA,0X20,0X20,0X3C,0X66,0X6F,0X72,0X6D,0X20,0X61,0X63,0X74,0X69,0X6F,0X6E,0X3D,0X22,0X74,0X65,0X73,0X74,0X22,0X20,0X6D,0X65,0X74,0X68,0X6F,0X64,0X3D,0X22,0X67,0X65,0X74,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X69,0X6E,0X70,0X75,0X74,0X20,0X6E,0X61,0X6D,0X65,0X3D,0X22,0X76,0X61,0X6C,0X75,0X65,0X22,0X20,0X74,0X79,0X70,0X65,0X3D,0X22,0X74,0X65,0X78,0X74,0X22,0X3E,0XA,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,0X76,0X61,0X6C,0X75,0X65,0X3D,0X22,0X47,0X45,0X54,0X22,0X3E,0XA,0X20,0X20,0X3C,0X2F,0X66,0X6F,0X72,0X6D,0X3E,0XA,0XA,0X20,0X20,0X3C,0X66,0X6F,0X72,0X6D,0X20,0X61,0X63,0X74,0X69,0X6F,0X6E,0X3D,0X22,0X74,0X65,0X73,0X74,0X22,0X20,0X6D,0X65,0X74,0X68,0X6F,0X64,0X3D,0X22,0X70,0X6F,0X73,0X74,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X69,0X6E,0X70,0X75,0X74,0X20,0X6E,0X61,0X6D,0X65,0X3D,0X22,0X76,0X61,0X6C,0X75,0X65,0X22,0X20,0X74,0X79,0X70,0X65,0X3D,0X22,0X74,0X65,0X78,0X74,0X22,0X3E,0XA,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,0X76,0X61,0X6C,0X75,0X65,0X3D,0X22,0X50,0X4F,0X53,0X54,0X22,0X3E,0XA,0X20,0X20,0X3C,0X2F,0X66,0X6F,0X72,0X6D,0X3E,0XA,0X20,0X20,0XA,0X20,0X20,0X3C,0X74,0X61,0X62,0X6C,0X65,0X20,0X69,0X64,0X3D,0X22,0X65,0X6E,0X76,0X2D,0X74,0X61,0X62,0X6C,0X65,0X22,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X70,0X72,0X65,0X73,0X65,0X6E,0X74,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X74,0X72,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X74,0X68,0X3E,0X3C,0X62,0X3E,0X45,0X4E,0X56,0X3C,0X2F,0X62,0X3E,0X3C,0X2F,0X74,0X68,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X74,0X68,0X3E,0X3C,0X62,0X3E,0X56,0X61,0X6C,0X75,0X65,0X3C,0X2F,0X62,0X3E,0X3C,0X2F,0X74,0X68,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X2F,0X74,0X72,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X74,0X72,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X74,0X64,0X3E,0X48,0X54,0X54,0X50,0X5F,0X43,0X4F,0X4F,0X4B,0X49,0X45,0X3C,0X2F,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X74,0X64,0X3E,0X25,0X73,0X3C,0X2F,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X2F,0X74,0X72,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X74,0X72,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X74,0X64,0X3E,0X50,0X41,0X54,0X48,0X5F,0X49,0X4E,0X46,0X4F,0X3C,0X2F,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X74,0X64,0X3E,0X25,0X73,0X3C,0X2F,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X2F,0X74,0X72,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X74,0X72,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X74,0X64,0X3E,0X51,0X55,0X45,0X52,0X59,0X5F,0X53,0X54,0X52,0X49,0X4E,0X47,0X3C,0X2F,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X74,0X64,0X3E,0X25,0X73,0X3C,0X2F,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X2F,0X74,0X72,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X74,0X72,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X74,0X64,0X3E,0X52,0X45,0X51,0X55,0X45,0X53,0X54,0X5F,0X4D,0X45,0X54,0X48,0X4F,0X44,0X3C,0X2F,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X74,0X64,0X3E,0X25,0X73,0X3C,0X2F,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X2F,0X74,0X72,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X74,0X72,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X74,0X64,0X3E,0X53,0X43,0X52,0X49,0X50,0X54,0X5F,0X4E,0X41,0X4D,0X45,0X3C,0X2F,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X74,0X64,0X3E,0X25,0X73,0X3C,0X2F,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X2F,0X74,0X72,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X74,0X72,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X74,0X64,0X3E,0X48,0X54,0X54,0X50,0X5F,0X52,0X45,0X46,0X45,0X52,0X45,0X52,0X3C,0X2F,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X74,0X64,0X3E,0X25,0X73,0X3C,0X2F,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X2F,0X74,0X72,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X74,0X72,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X74,0X64,0X3E,0X48,0X54,0X54,0X50,0X5F,0X55,0X53,0X45,0X52,0X5F,0X41,0X47,0X45,0X4E,0X54,0X3C,0X2F,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X74,0X64,0X3E,0X25,0X73,0X3C,0X2F,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X2F,0X74,0X72,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X74,0X72,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X74,0X64,0X3E,0X43,0X4F,0X4E,0X54,0X45,0X4E,0X54,0X5F,0X4C,0X45,0X4E,0X47,0X54,0X48,0X3C,0X2F,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X74,0X64,0X3E,0X25,0X73,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 test_template {const char* HTTP_COOKIE;
const char* PATH_INFO;
@ -10,10 +11,5 @@ const char* HTTP_REFERER;
const char* HTTP_USER_AGENT;
const char* CONTENT_LENGTH;
};
char* tmpl_gen_test(struct test_template* data, unsigned* size){
char* ret;
unsigned s = easprintf(&ret, data_test, data->HTTP_COOKIE?data->HTTP_COOKIE:"", data->PATH_INFO?data->PATH_INFO:"", data->QUERY_STRING?data->QUERY_STRING:"", data->REQUEST_METHOD?data->REQUEST_METHOD:"", data->SCRIPT_NAME?data->SCRIPT_NAME:"", data->HTTP_REFERER?data->HTTP_REFERER:"", data->HTTP_USER_AGENT?data->HTTP_USER_AGENT:"", data->CONTENT_LENGTH?data->CONTENT_LENGTH:"");
if (size) *size = s;
return ret;
}
char* tmpl_gen_test(struct test_template* data, size_t* size);
#endif