libonion
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Typedefs | Functions
static.c File Reference
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <regex.h>
#include <onion/handler.h>
#include <onion/response.h>
#include <onion/low.h>
#include "static.h"

Data Structures

struct  onion_handler_static_data_t

Typedefs

typedef struct
onion_handler_static_data_t 
onion_handler_static_data

Functions

int onion_handler_static_handler (onion_handler_static_data *d, onion_request *request, onion_response *res)
 Performs the real request: set the code and write data.
void onion_handler_static_delete (onion_handler_static_data *d)
 Removes internal data for this handler.
onion_handleronion_handler_static (const char *text, int code)
 Creates a static handler that just writes some static data.

Typedef Documentation

Function Documentation

onion_handler* onion_handler_static ( const char *  text,
int  code 
)

Creates a static handler that just writes some static data.

Creates an static handler. Returns some content from memory, like an error html.

Path is a regex for the url, as arrived here.

References onion_handler_static_data_t::code, onion_handler_static_data_t::data, onion_handler_t::onion_handler_new(), onion_handler_static_delete(), onion_handler_static_handler(), onion_low_malloc(), and onion_low_strdup().

void onion_handler_static_delete ( onion_handler_static_data d)

Removes internal data for this handler.

References onion_handler_static_data_t::data, and onion_low_free().

Referenced by onion_handler_static().

int onion_handler_static_handler ( onion_handler_static_data d,
onion_request request,
onion_response res 
)