libonion
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
exportlocal.h File Reference
#include <onion/types.h>

Functions

onion_handleronion_handler_export_local_new (const char *localpath)
 Creates an export local handler. When path matches, it returns a file from localpath (final localpath + path). No dir listing.
void onion_handler_export_local_set_header (onion_handler *dir, void(*renderer)(onion_response *res, const char *dirname))
 Calls to render a header after the "Listing of directory...".
void onion_handler_export_local_set_footer (onion_handler *dir, void(*renderer)(onion_response *res, const char *dirname))
 Calls to render a footers before end.

Function Documentation

onion_handler* onion_handler_export_local_new ( const char *  localpath)

Creates an export local handler. When path matches, it returns a file from localpath (final localpath + path). No dir listing.

Creates an export local handler. When path matches, it returns a file from localpath (final localpath + path). No dir listing.

Exports the given localpath and any file inside this localpath is returned.

It performs security checks, so that the returned data is saftly known to be inside that localpath. Normal permissions apply.

References onion_handler_export_local_data_t::is_file, onion_handler_export_local_data_t::localpath, ONION_ERROR, onion_handler_export_local_delete(), onion_handler_export_local_footer_default(), onion_handler_export_local_handler(), onion_handler_export_local_header_default(), onion_handler_t::onion_handler_new(), onion_low_free(), onion_low_malloc(), onion_handler_export_local_data_t::renderer_footer, and onion_handler_export_local_data_t::renderer_header.

void onion_handler_export_local_set_footer ( onion_handler handler,
void(*)(onion_response *res, const char *dirname)  renderer 
)
void onion_handler_export_local_set_header ( onion_handler handler,
void(*)(onion_response *res, const char *dirname)  renderer 
)

Calls to render a header after the "Listing of directory...".

References onion_handler_t::onion_handler_get_private_data(), and onion_handler_export_local_data_t::renderer_header.