libonion
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
shortcuts.h File Reference
#include <time.h>
#include "types.h"

Functions

onion_connection_status onion_shortcut_response (const char *response, int code, onion_request *req, onion_response *res)
 Shortcut for fast responses, like errors.
onion_connection_status onion_shortcut_response_extra_headers (const char *response, int code, onion_request *req, onion_response *res,...)
 Shortcut for fast responses, like errors, with extra headers.
onion_connection_status onion_shortcut_redirect (const char *newurl, onion_request *req, onion_response *res)
 Shortcut for fast redirect. It tells the browser to look somewhere else.
onion_connection_status onion_shortcut_internal_redirect (const char *newurl, onion_request *req, onion_response *res)
 Shortcut for fast internal redirect. It returns what the server would return with the new address.
onion_connection_status onion_shortcut_response_file (const char *filename, onion_request *req, onion_response *res)
 Shortcut for response a static file on disk.
onion_connection_status onion_shortcut_response_json (onion_dict *d, onion_request *req, onion_response *res)
 Shortcut for response json data. Dict is freed before return.
void onion_shortcut_date_string (time_t t, char *dest)
 Shortcut to return the date in "RFC 822 / section 5, 4 digit years" date format.
void onion_shortcut_date_string_iso (time_t t, char *dest)
 Shortcut to return the date in ISO format.
void onion_shortcut_etag (struct stat *, char etag[32])
 Shortcut to return the date in time_t from a user given date TODO.
int onion_shortcut_rename (const char *orig, const char *dest)
 Moves a file to another location.

Function Documentation

onion_connection_status onion_shortcut_internal_redirect ( const char *  newurl,
onion_request req,
onion_response res 
)