mod_plainmem.c revision fcc0e499013bdb7b48eea3aaa1a00d690e318cda
/* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* Memory handler for a plain memory divided in slot.
* This one uses plain memory.
*/
#include "mod_slotmem.h"
/* global pool and list of slotmem we are handling */
static apr_status_t slotmem_do(ap_slotmem_t *mem, ap_slotmem_callback_fn_t *func, void *data, apr_pool_t *pool)
{
int i;
void *ptr;
if (!mem)
return APR_ENOSHMAVAIL;
}
return APR_SUCCESS;
}
static apr_status_t slotmem_create(ap_slotmem_t **new, const char *name, apr_size_t item_size, int item_num, apr_pool_t *pool)
{
const char *fname;
if (name) {
if (name[0] == ':')
else
/* first try to attach to existing slotmem */
if (next) {
for (;;) {
/* we already have it */
return APR_SUCCESS;
}
break;
}
}
}
else
fname = "anonymous";
/* create the memory using the gpool */
return APR_ENOSHMAVAIL;
/* For the chained slotmem stuff */
if (globallistmem == NULL)
globallistmem = res;
else
return APR_SUCCESS;
}
static apr_status_t slotmem_attach(ap_slotmem_t **new, const char *name, apr_size_t *item_size, int *item_num, apr_pool_t *pool)
{
const char *fname;
if (name) {
if (name[0] == ':')
else
}
else
return APR_ENOSHMAVAIL;
/* first try to attach to existing slotmem */
if (next) {
for (;;) {
/* we already have it */
return APR_SUCCESS;
}
break;
}
}
return APR_ENOSHMAVAIL;
}
{
void *ptr;
if (!score)
return APR_ENOSHMAVAIL;
return APR_ENOSHMAVAIL;
if (!ptr)
return APR_ENOSHMAVAIL;
return APR_SUCCESS;
}
static const ap_slotmem_storage_method storage = {
};
{
gpool = p;
return OK;
}
static void ap_plainmem_register_hook(apr_pool_t *p)
{
/* XXX: static const char * const prePos[] = { "mod_slotmem.c", NULL }; */
}
NULL, /* create per-directory config structure */
NULL, /* merge per-directory config structures */
NULL, /* create per-server config structure */
NULL, /* merge per-server config structures */
NULL, /* command apr_table_t */
ap_plainmem_register_hook /* register hooks */
};