htcacheclean.c revision 806b50b4d37ade77f1c767a1593fac5a2d7786c8
c79e39ad568d9af854765f64049534044ef6c034nd/* Licensed to the Apache Software Foundation (ASF) under one or more
2d0611ffc9f91c5fc2ddccb93f9a3d17791ae650takashi * contributor license agreements. See the NOTICE file distributed with
c79e39ad568d9af854765f64049534044ef6c034nd * this work for additional information regarding copyright ownership.
d3e250aab242db84d14060985b5db675a731d548nd * The ASF licenses this file to You under the Apache License, Version 2.0
c79e39ad568d9af854765f64049534044ef6c034nd * (the "License"); you may not use this file except in compliance with
c79e39ad568d9af854765f64049534044ef6c034nd * the License. You may obtain a copy of the License at
c79e39ad568d9af854765f64049534044ef6c034nd * Unless required by applicable law or agreed to in writing, software
b475917ddf898282aa51ce31b3275c2c4783ce98coar * distributed under the License is distributed on an "AS IS" BASIS,
4b575a6b6704b516f22d65a3ad35696d7b9ba372rpluem * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4b575a6b6704b516f22d65a3ad35696d7b9ba372rpluem * See the License for the specific language governing permissions and
c79e39ad568d9af854765f64049534044ef6c034nd * limitations under the License.
* htcacheclean.c: simple program for cleaning of
#include "apr.h"
#include "apr_lib.h"
#include "apr_strings.h"
#include "apr_file_io.h"
#include "apr_file_info.h"
#include "apr_pools.h"
#include "apr_hash.h"
#include "apr_thread_proc.h"
#include "apr_signal.h"
#include "apr_getopt.h"
#include "apr_ring.h"
#include "apr_date.h"
#include "apr_buckets.h"
#include "../modules/cache/mod_disk_cache.h"
#include <unistd.h>
#include <stdlib.h>
typedef struct _direntry {
} DIRENTRY;
typedef struct _entry {
} ENTRY;
#ifdef DEBUG
#ifdef DEBUG
static int called = 0;
if (!called) {
return APR_ENOMEM;
if (!verbose) {
if (unsolicited) {
char *nextpath;
apr_pool_t *p;
if (dryrun) {
apr_pool_destroy(p);
if (benice) {
delcount = 0;
char *nextpath;
apr_pool_t *p;
if (dryrun) {
apr_pool_destroy(p);
if (benice) {
delcount = 0;
apr_pool_t *p;
apr_hash_t *h;
apr_hash_index_t *i;
DIRENTRY *d, *t, *n;
ENTRY *e;
h = apr_hash_make(p);
skip = 0;
if (interrupted) {
if (!base++) {
if (!ext) {
if (interrupted) {
void *hvalue;
d = hvalue;
switch(d->type) {
case HEADERDATA:
case HEADER:
case DATA:
case TEMP:
if (interrupted) {
apr_pool_destroy(p);
if (benice) {
if (interrupted) {
sum = 0;
entries = 0;
entries++;
entries--;
if (!interrupted) {
if (interrupted) {
entries--;
if (!interrupted) {
if (interrupted) {
oldest = e;
entries--;
if (!interrupted) {
static void usage(void)
apr_getopt_t *o;
char opt;
const char *arg;
interrupted = 0;
repeat = 0;
isdaemon = 0;
dryrun = 0;
limit_found = 0;
max = 0;
verbose = 0;
realclean = 0;
benice = 0;
deldirs = 0;
intelligent = 0;
if (argc) {
usage();
switch (opt) {
if (intelligent) {
usage();
if (dryrun) {
usage();
if (benice) {
usage();
if (deldirs) {
usage();
if (verbose) {
usage();
if (realclean) {
usage();
if (isdaemon) {
usage();
if (limit_found) {
usage();
char *end;
usage();
if (proxypath) {
usage();
usage();
usage();
usage();
usage();
usage();
usage();
#ifndef DEBUG
if (isdaemon) {
delcount = 0;
unsolicited = 0;
dowork = 0;
switch (intelligent) {
if (isdaemon) {
delay = 0;