/** * 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 General Public Licence as published by the Free * Software Foundation; either version 2 of the Licence, 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 General Public Licence for * more details. * * You should have received a copy of the GNU General Public Licence along * with this program; if not, write to the Free Software Foundation, Inc., 59 * Temple Place, Suite 330, Boston, MA 02111-1307 USA * * In addition, as two special exceptions, Bojan Smojver, Rexursive, gives * permission to: * * 1. Link, both statically and dynamically, the code of this program with * Apache HTTP Server, Apache Portable Runtime and Apache Portable Runtime * Utility Library from Apache Software Foundation (or with modified versions * of the above, that use the same licence - Apache Software Licence 1.1, 2.0 * or any later version), and distribute linked combinations including the * program and the above software from Apache Software Foundation. You must * obey the GNU General Public Licence in all respects for all of the code * used other than Apache HTTP Server, Apache Portable Runtime and Apache * Portable Runtime Utility Library. * * 2. Dynamically link any shared library with this program at run-time, * through the interface of SpinApplication or LoadModule run-time * configuration directives of Apache HTTP Server, as provided by this program * or Apache HTTP Server itself, regardless of licensing terms of those shared * libraries. You must obey the GNU General Public Licence in all respects for * all of the code used other than that of those shared libraries. * * If you modify this file, you may extend these exceptions to your version of * the file, but you are not obligated to do so. If you do not wish to do so, * delete one or both of these exception statements from your version. * */ #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; }