Apache HTTPD
Classes | Macros | Enumerations | Functions | Variables
mod_speling.c File Reference
#include "apr.h"
#include "apr_file_io.h"
#include "apr_strings.h"
#include "apr_lib.h"
#include "apr_want.h"
#include "httpd.h"
#include "http_core.h"
#include "http_config.h"
#include "http_request.h"
#include "http_log.h"

Go to the source code of this file.

Classes

struct  spconfig
 
struct  misspelled_file
 

Macros

#define APR_WANT_STRFUNC
 

Enumerations

enum  sp_reason {
  SP_IDENTICAL = 0 , SP_MISCAPITALIZED = 1 , SP_TRANSPOSITION = 2 , SP_MISSINGCHAR = 3 ,
  SP_EXTRACHAR = 4 , SP_SIMPLETYPO = 5 , SP_VERYDIFFERENT = 6
}
 

Functions

static void * mkconfig (apr_pool_t *p)
 
static void * create_mconfig_for_server (apr_pool_t *p, server_rec *s)
 
static void * create_mconfig_for_directory (apr_pool_t *p, char *dir)
 
static sp_reason spdist (const char *s, const char *t)
 
static int sort_by_quality (const void *left, const void *rite)
 
static int check_speling (request_rec *r)
 
static void register_hooks (apr_pool_t *p)
 

Variables

static const command_rec speling_cmds []
 
static const charsp_reason_str []
 
static int *const aplog_module_index = &( speling_module.module_index)
 

Macro Definition Documentation

◆ APR_WANT_STRFUNC

#define APR_WANT_STRFUNC

Definition at line 22 of file mod_speling.c.

Enumeration Type Documentation

◆ sp_reason

Enumerator
SP_IDENTICAL 
SP_MISCAPITALIZED 
SP_TRANSPOSITION 
SP_MISSINGCHAR 
SP_EXTRACHAR 
SP_SIMPLETYPO 
SP_VERYDIFFERENT 

Definition at line 118 of file mod_speling.c.

Function Documentation

◆ check_speling()

static int check_speling ( request_rec r)
static

< Module declines to handle

RFC 2616: HTTP

< Module declines to handle

< Module declines to handle

< Module declines to handle

< Module declines to handle

< Module declines to handle

< Module declines to handle

< Module declines to handle

< an atomic unix apr_dir_read()

< Module has handled this stage.

< Module declines to handle

< Module has handled this stage.

Definition at line 197 of file mod_speling.c.

◆ create_mconfig_for_directory()

static void * create_mconfig_for_directory ( apr_pool_t p,
char dir 
)
static

Definition at line 95 of file mod_speling.c.

◆ create_mconfig_for_server()

static void * create_mconfig_for_server ( apr_pool_t p,
server_rec s 
)
static

Definition at line 87 of file mod_speling.c.

◆ mkconfig()

static void * mkconfig ( apr_pool_t p)
static

Definition at line 73 of file mod_speling.c.

◆ register_hooks()

static void register_hooks ( apr_pool_t p)
static

Definition at line 514 of file mod_speling.c.

◆ sort_by_quality()

static int sort_by_quality ( const void *  left,
const void *  rite 
)
static

Definition at line 191 of file mod_speling.c.

◆ spdist()

static sp_reason spdist ( const char s,
const char t 
)
static

Definition at line 163 of file mod_speling.c.

Variable Documentation

◆ aplog_module_index

int* const aplog_module_index = &( speling_module.module_index)
static

Definition at line 519 of file mod_speling.c.

◆ sp_reason_str

const char* sp_reason_str[]
static
Initial value:
=
{
"identical",
"miscapitalized",
"transposed characters",
"character missing",
"extra character",
"mistyped character",
"common basename",
}

Definition at line 128 of file mod_speling.c.

◆ speling_cmds

const command_rec speling_cmds[]
static
Initial value:
=
{
{ "CheckSpelling" , ap_set_flag_slot , (void*)((long) (((char *) (&((( spconfig * )NULL)-> enabled ))) - ((char *) NULL))) , 2 , FLAG, "whether or not to fix miscapitalized/misspelled requests" },
{ "CheckCaseOnly" , ap_set_flag_slot , (void*)((long) (((char *) (&((( spconfig * )NULL)-> check_case_only ))) - ((char *) NULL))) , 2 , FLAG, "whether or not to fix only miscapitalized requests" },
{ "CheckBasenameMatch" , ap_set_flag_slot , (void*)((long) (((char *) (&((( spconfig * )NULL)-> check_basename_match ))) - ((char *) NULL))) , 2 , FLAG, "whether or not to fix files with the same base name" },
{ NULL }
}
const char * ap_set_flag_slot(cmd_parms *cmd, void *struct_ptr, int arg)
Definition config.c:1512
@ FLAG
Definition http_config.h:59
int enabled
return NULL
Definition mod_so.c:359

Definition at line 104 of file mod_speling.c.