123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 |
- /** Autogenerated by otemplate v. 0.2.0 */
- #include <libintl.h>
- #include <string.h>
- #include <onion/onion.h>
- #include <onion/dict.h>
- typedef struct dict_res_t{
- onion_dict *dict;
- onion_response *res;
- }dict_res;
- void base_html_blocks_init(onion_dict *context);
- void base_html(onion_dict *context, onion_response *res);
- void base_html__block_content(onion_dict *context, onion_response *res);
- onion_connection_status base_html_handler_page(onion_dict *context, onion_request *req, onion_response *res){
- base_html(context, res);
- return OCS_PROCESSED;
- }
- onion_handler *base_html_handler(onion_dict *context){
- return onion_handler_new((onion_handler_handler)base_html_handler_page, context, (onion_handler_private_data_free)onion_dict_free);
- }
- onion_connection_status base_html_template(onion_dict *context, onion_request *req, onion_response *res){
- if (context) onion_dict_add(context, "LANG", onion_request_get_language_code(req), OD_FREE_VALUE);
- base_html(context, res);
- if (context) onion_dict_free(context);
- return OCS_PROCESSED;
- }
- #line 1 "base.html"
- #line 1
- void base_html_blocks_init(onion_dict *context){
- #line 1
- if (!onion_dict_get(context, "__block_content__"))
- onion_dict_add(context, "__block_content__", base_html__block_content, 0);
- #line 1
- }
- #line 1
- void base_html(onion_dict *context, onion_response *res){
- #line 1
- #line 1
- int has_context=(context!=NULL);
- #line 1
- if (!has_context)
- #line 1
- context=onion_dict_new();
- #line 1
-
- #line 1
- base_html_blocks_init(context);
- onion_response_write(res, "<!DOCTYPE html>\n"
- "<html>\n"
- " <head>\n"
- " <title>", 43);
- #line 4
- {
- #line 4
- const char *tmp;
- #line 4
- tmp=onion_dict_get(context, "title");
- #line 4
- if (tmp)
- #line 4
- onion_response_write_html_safe(res, tmp);
- #line 4
- }
- onion_response_write(res, "</title>\n"
- " </head>\n"
- " <body>\n"
- "", 28);
- #line 7
- {
- #line 7
- void (*f)(onion_dict *context, onion_response *res);
- #line 7
- f=(void*)onion_dict_get(context, "__block_content__");
- #line 7
- if (f)
- #line 7
- f(context, res);
- #line 7
- }
- onion_response_write(res, " \n"
- " </body>\n"
- "</html>\n"
- "", 21);
- #line 10
- if (!has_context)
- #line 10
- onion_dict_free(context);
- #line 1
- }
- #line 1
- void base_html__block_content(onion_dict *context, onion_response *res){
- #line 1
- onion_response_write(res, "No content", 10);
- #line 1
- }
|