/** * context.c * * Copyright (C) 2003 - 2006 Bojan Smojver, Rexursive * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 2.1 of the License, or (at * your option) any later version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License * for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see . * */ #include "private.h" /* various get/set functions */ apr_pool_t *rxv_spin_ctx_pool(rxv_spin_ctx_t *ctx){ return ctx?ctx->pool:NULL; } apr_pool_t *rxv_spin_ctx_tpool(rxv_spin_ctx_t *ctx){ return (ctx && ctx->priv)?ctx->priv->pool:NULL; } rxv_spin_data_t *rxv_spin_ctx_data(rxv_spin_ctx_t *ctx){ return ctx?ctx->data:NULL; } request_rec *rxv_spin_ctx_r(rxv_spin_ctx_t *ctx){ return ctx?ctx->r:NULL; } apreq_handle_t *rxv_spin_ctx_req(rxv_spin_ctx_t *ctx){ return ctx?ctx->req:NULL; } void *rxv_spin_ctx_xget(rxv_spin_ctx_t *ctx){ return ctx?ctx->extra:NULL; } void *rxv_spin_ctx_xset(rxv_spin_ctx_t *ctx,void *extra){ return ctx?ctx->extra=extra:NULL; } /* context get/set functions */ rxv_spin_data_t *rxv_spin_ctx_get(rxv_spin_ctx_t *ctx,const char *key){ if(ctx && key) return apr_hash_get(ctx->data->cols,key,APR_HASH_KEY_STRING); return NULL; } rxv_spin_data_t *rxv_spin_ctx_set(rxv_spin_ctx_t *ctx, const char *key,rxv_spin_data_t *value){ if(ctx && key){ apr_hash_set(ctx->data->cols,key,APR_HASH_KEY_STRING,value); return value; } return NULL; }