Data Structures | Defines | Typedefs | Functions | Variables

mkdfa.c File Reference

A brief file description. More...

#include <assert.h>
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Include dependency graph for mkdfa.c:

Go to the source code of this file.

Data Structures

struct  _info_t
struct  _state_t
struct  _transition_t

Defines

#define SIZEOF(t)   (sizeof (t) / (sizeof ((t)[0])))

Typedefs

typedef struct _info_t info_t
typedef struct _state_t state_t
typedef struct _transition_t transition_t

Functions

state_tmkstate ()
transition_tmktransition ()
void prstate (state_t *state)
void add_states (state_t *state, info_t *info, int pos)
void prtable (const char *type, const char *name, int *table, int size)
int mkmap (state_t *state)
void mkaccept (state_t *state, const char *defvalue)
void mkprefix (state_t *state, char *prefix, int length)
int checkbase (state_t *state, int base)
void mktranstables (state_t *state)
void mktables (state_t *state, const char *defvalue, int useprefix)
const char * rundfa (const char *buf, int length)
void mkdfa (info_t *infos, int ninfos, int useprefix, int debug)
int main (int argc, char *argv[])

Variables

info_t fields []
info_t schemes []
info_t methods []
info_t statuses []
info_t days []
info_t months []
info_t connections []
info_t cache_controls []
state_tstart = NULL
int state_count = 0
int * map = NULL
int * basetbl = NULL
int * nexttbl = NULL
int * checktbl = NULL
const char ** accepttbl = NULL
char ** prefixtbl = NULL

Detailed Description

A brief file description.

License

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

http://www.apache.org/licenses/LICENSE-2.0

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.

Definition in file mkdfa.c.


Define Documentation

#define SIZEOF (   t  )     (sizeof (t) / (sizeof ((t)[0])))

Definition at line 30 of file mkdfa.c.

Referenced by hdrtoken_hash_init(), hdrtoken_init(), http_init(), main(), and mime_init().


Typedef Documentation

typedef struct _info_t info_t

Definition at line 33 of file mkdfa.c.

typedef struct _state_t state_t

Definition at line 34 of file mkdfa.c.

typedef struct _transition_t transition_t

Definition at line 35 of file mkdfa.c.


Function Documentation

void add_states ( state_t state,
info_t info,
int  pos 
)
int checkbase ( state_t state,
int  base 
)

Definition at line 438 of file mkdfa.c.

References checktbl, map, _transition_t::next, _state_t::transitions, and _transition_t::value.

Referenced by mktranstables().

int main ( int  argc,
char *  argv[] 
)

Definition at line 638 of file mkdfa.c.

References mkdfa(), and SIZEOF.

void mkaccept ( state_t state,
const char *  defvalue 
)
void mkdfa ( info_t infos,
int  ninfos,
int  useprefix,
int  debug 
)

Definition at line 583 of file mkdfa.c.

References add_states(), mkstate(), mktables(), and prstate().

Referenced by main().

int mkmap ( state_t state  ) 

Definition at line 381 of file mkdfa.c.

References map, _transition_t::next, _transition_t::state, _state_t::transitions, and _transition_t::value.

Referenced by mktables().

void mkprefix ( state_t state,
char *  prefix,
int  length 
)
state_t* mkstate (  ) 

Definition at line 268 of file mkdfa.c.

References _state_t::num, state_count, _state_t::transitions, and _state_t::value.

Referenced by add_states(), and mkdfa().

void mktables ( state_t state,
const char *  defvalue,
int  useprefix 
)

Definition at line 486 of file mkdfa.c.

References accepttbl, basetbl, checktbl, map, mkaccept(), mkmap(), mkprefix(), mktranstables(), nexttbl, prefixtbl, prtable(), and state_count.

Referenced by mkdfa().

transition_t* mktransition (  ) 

Definition at line 281 of file mkdfa.c.

References _transition_t::next, _transition_t::state, and _transition_t::value.

Referenced by add_states().

void mktranstables ( state_t state  ) 
void prstate ( state_t state  ) 
void prtable ( const char *  type,
const char *  name,
int *  table,
int  size 
)

Definition at line 358 of file mkdfa.c.

Referenced by mktables().

const char* rundfa ( const char *  buf,
int  length 
)

Definition at line 561 of file mkdfa.c.

References accepttbl, basetbl, checktbl, map, and nexttbl.


Variable Documentation

const char** accepttbl = NULL

Definition at line 263 of file mkdfa.c.

Referenced by mkaccept(), mktables(), and rundfa().

int* basetbl = NULL

Definition at line 260 of file mkdfa.c.

Referenced by mktables(), mktranstables(), and rundfa().

Initial value:
 {
  {"max-age", "HTTP_CACHE_DIRECTIVE_MAX_AGE", -1},
  {"max-stale", "HTTP_CACHE_DIRECTIVE_MAX_STALE", -1},
  {"min-fresh", "HTTP_CACHE_DIRECTIVE_MIN_FRESH", -1},
  {"must-revalidate", "HTTP_CACHE_DIRECTIVE_MUST_REVALIDATE", -1},
  {"no-cache", "HTTP_CACHE_DIRECTIVE_NO_CACHE", -1},
  {"no-store", "HTTP_CACHE_DIRECTIVE_NO_STORE", -1},
  {"no-transform", "HTTP_CACHE_DIRECTIVE_NO_TRANSFORM", -1},
  {"only-if-cached", "HTTP_CACHE_DIRECTIVE_ONLY_IF_CACHED", -1},
  {"private", "HTTP_CACHE_DIRECTIVE_PRIVATE", -1},
  {"proxy-revalidate", "HTTP_CACHE_DIRECTIVE_PROXY_REVALIDATE", -1},
  {"public", "HTTP_CACHE_DIRECTIVE_PUBLIC", -1},
  {"s-maxage", "HTTP_CACHE_DIRECTIVE_S_MAX_AGE", -1},
  {NULL, "HTTP_CACHE_DIRECTIVE_CACHE_EXTENSION", -1},
}

Definition at line 239 of file mkdfa.c.

int* checktbl = NULL

Definition at line 262 of file mkdfa.c.

Referenced by checkbase(), mktables(), mktranstables(), and rundfa().

Initial value:
 {
  {"CLOSE", "HTTP_CONNECTION_CLOSE", -1},
  {"KEEP-ALIVE", "HTTP_CONNECTION_KEEP_ALIVE", -1},
  {NULL, "HTTP_CONNECTION_NONE", -1},
}

Definition at line 233 of file mkdfa.c.

Referenced by check_net_throttle(), HttpSM::do_http_server_open(), and ShowNet::showSingleThread().

Initial value:
 {
  {"Fri", "FRIDAY", -1},
  {"Friday", "FRIDAY", -1},
  {"Mon", "MONDAY", -1},
  {"Monday", "MONDAY", -1},
  {"Sat", "SATURDAY", -1},
  {"Saturday", "SATURDAY", -1},
  {"Sun", "SUNDAY", -1},
  {"Sunday", "SUNDAY", -1},
  {"Thu", "THURSDAY", -1},
  {"Thursday", "THURSDAY", -1},
  {"Tue", "TUESDAY", -1},
  {"Tuesday", "TUESDAY", -1},
  {"Wed", "WEDNESDAY", -1},
  {"Wednesday", "WEDNESDAY", -1},
  {NULL, "UNKNOWN_DAY", -1},
}

Definition at line 199 of file mkdfa.c.

Referenced by convert_tm(), mime_days_since_epoch_to_mdy_slowcase(), and mime_parse_date().

Definition at line 59 of file mkdfa.c.

Referenced by resolve_logfield_string().

int* map = NULL
Initial value:
 {
  {"CONNECT", "HTTP_METHOD_CONNECT", -1},
  {"DELETE", "HTTP_METHOD_DELETE", -1},
  {"GET", "HTTP_METHOD_GET", -1},
  {"HEAD", "HTTP_METHOD_HEAD", -1},
  {"HTTP/", "HTTP_METHOD_HTTP", -1},
  {"OPTIONS", "HTTP_METHOD_OPTIONS", -1},
  {"POST", "HTTP_METHOD_POST", -1},
  {"PURGE", "HTTP_METHOD_PURGE", -1},
  {"PUT", "HTTP_METHOD_PUT", -1},
  {"TRACE", "HTTP_METHOD_TRACE", -1},
  {NULL, "HTTP_METHOD_NONE", 0},
}

Definition at line 144 of file mkdfa.c.

Referenced by HttpTransactHeaders::insert_supported_methods_in_response().

Initial value:
 {
  {"Apr", "APRIL", -1},
  {"Aug", "AUGUST", -1},
  {"Dec", "DECEMBER", -1},
  {"Feb", "FEBRUARY", -1},
  {"Jan", "JANUARY", -1},
  {"Jul", "JULY", -1},
  {"Jun", "JUNE", -1},
  {"Mar", "MARCH", -1},
  {"May", "MAY", -1},
  {"Nov", "NOVEMBER", -1},
  {"Oct", "OCTOBER", -1},
  {"Sep", "SEPTEMBER", -1},
  {NULL, "UNKNOWN_MONTH", -1},
}

Definition at line 217 of file mkdfa.c.

Referenced by mime_days_since_epoch_to_mdy_slowcase(), and AppVersionInfo::setup().

int* nexttbl = NULL

Definition at line 261 of file mkdfa.c.

Referenced by mktables(), mktranstables(), and rundfa().

char** prefixtbl = NULL

Definition at line 264 of file mkdfa.c.

Referenced by mkprefix(), and mktables().

Initial value:
 {
  {"file", "URL_SCHEME_FILE", 0},
  {"ftp", "URL_SCHEME_FTP", 0},
  {"gopher", "URL_SCHEME_GOPHER", 0},
  {"http", "URL_SCHEME_HTTP", 0},
  {"https", "URL_SCHEME_HTTPS", 0},
  {"mailto", "URL_SCHEME_MAILTO", 0},
  {"news", "URL_SCHEME_NEWS", 0},
  {"nntp", "URL_SCHEME_NNTP", 0},
  {"prospero", "URL_SCHEME_PROSPERO", 0},
  {"telnet", "URL_SCHEME_TELNET", 0},
  {"wais", "URL_SCHEME_WAIS", 0},
  {NULL, "URL_SCHEME_NONE", 0},
}

Definition at line 129 of file mkdfa.c.

state_t* start = NULL
int state_count = 0

Definition at line 257 of file mkdfa.c.

Referenced by mkstate(), mktables(), and mktranstables().

Definition at line 158 of file mkdfa.c.