All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Typedefs | Functions
opack.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 "opack.h"

Data Structures

struct  onion_handler_opack_data_t


typedef struct


int onion_handler_opack_handler (onion_handler_opack_data *d, onion_request *request, onion_response *res)
void onion_handler_opack_delete (onion_handler_opack_data *data)
onion_handleronion_handler_opack (const char *path, onion_opack_renderer render, unsigned int length)
 Creates an opack handler that calls the onion_opack_renderer with length data.

Typedef Documentation

Function Documentation

onion_handler* onion_handler_opack ( const char *  path,
onion_opack_renderer  render,
unsigned int  length 

Creates an opack handler that calls the onion_opack_renderer with length data.

Creates a opak handler.

If on the inside level nobody answers, it just returns NULL, so ->next can answer.

pathPath of the current data, for example /. It is a normal string; no regular expressions are allowed.
renderFunction to call to render the response.
lengthLenght of the data, or 0 if unknown. Needed to keep alive.

References onion_handler_opack_data_t::length, onion_handler_t::onion_handler_new(), onion_handler_opack_delete(), onion_handler_opack_handler(), onion_low_malloc(), onion_low_strdup(), onion_handler_opack_data_t::path, and onion_handler_opack_data_t::render.

void onion_handler_opack_delete ( onion_handler_opack_data data)
int onion_handler_opack_handler ( onion_handler_opack_data d,
onion_request request,
onion_response res