Permalink
Browse files

git-svn-id: svn://cherokee-project.com/cherokee/trunk@384 5dc97367-97…

…f1-0310-9951-d761b3857238
  • Loading branch information...
1 parent 1c17f18 commit ee8023f218e58f866eeb54bd5434b7baa6920f8e @alobbs alobbs committed Sep 1, 2006
Showing with 267 additions and 673 deletions.
  1. +0 −2 cherokee/Makefile.am
  2. +17 −17 cherokee/access.c
  3. +2 −2 cherokee/access.h
  4. +3 −3 cherokee/admin_client.c
  5. +1 −1 cherokee/admin_client.h
  6. +2 −2 cherokee/admin_server.c
  7. +0 −1 cherokee/cherokee.h
  8. +6 −6 cherokee/cherokee_show.c
  9. +1 −5 cherokee/config_entry.h
  10. +7 −8 cherokee/config_node.c
  11. +3 −3 cherokee/config_node.h
  12. +1 −1 cherokee/connection-protected.h
  13. +5 −5 cherokee/connection_info.c
  14. +3 −3 cherokee/connection_info.h
  15. +13 −13 cherokee/ext_source.c
  16. +4 −5 cherokee/ext_source.h
  17. +2 −3 cherokee/exts_table.c
  18. +5 −5 cherokee/fcgi_dispatcher.c
  19. +1 −1 cherokee/fcgi_dispatcher.h
  20. +0 −1 cherokee/handler_cgi.c
  21. +5 −7 cherokee/handler_cgi_base.c
  22. +1 −1 cherokee/handler_cgi_base.h
  23. +1 −2 cherokee/handler_common.c
  24. +14 −15 cherokee/handler_dirlist.c
  25. +5 −5 cherokee/handler_dirlist.h
  26. +4 −4 cherokee/handler_error_redir.c
  27. +1 −1 cherokee/handler_error_redir.h
  28. +1 −1 cherokee/handler_fastcgi.c
  29. +2 −2 cherokee/handler_fastcgi.h
  30. +2 −2 cherokee/handler_fcgi.c
  31. +1 −1 cherokee/handler_fcgi.h
  32. +1 −1 cherokee/handler_file.c
  33. +1 −1 cherokee/handler_phpcgi.c
  34. +1 −1 cherokee/handler_proxy.c
  35. +5 −6 cherokee/handler_redir.c
  36. +1 −1 cherokee/handler_redir.h
  37. +2 −2 cherokee/handler_scgi.c
  38. +2 −2 cherokee/handler_scgi.h
  39. +1 −1 cherokee/handler_server_info.c
  40. +0 −1 cherokee/icons.c
  41. +4 −4 cherokee/iocache.c
  42. +39 −39 cherokee/list.c
  43. +18 −15 cherokee/list.h
  44. +0 −2 cherokee/main_admin.c
  45. +6 −6 cherokee/matching_list.c
  46. +3 −3 cherokee/matching_list.h
  47. +2 −2 cherokee/mime-protected.h
  48. +4 −4 cherokee/mime.c
  49. +1 −1 cherokee/mime_entry.c
  50. +5 −5 cherokee/reqs_list.c
  51. +1 −1 cherokee/reqs_list.h
  52. +1 −1 cherokee/reqs_list_entry.h
  53. +1 −1 cherokee/request.c
  54. +1 −1 cherokee/request.h
  55. +2 −2 cherokee/server-protected.h
  56. +17 −18 cherokee/server.c
  57. +25 −26 cherokee/thread.c
  58. +4 −4 cherokee/thread.h
  59. +0 −317 cherokee/typed_table.c
  60. +0 −70 cherokee/typed_table.h
  61. +1 −1 cherokee/validator.c
  62. +1 −1 cherokee/validator_ldap.c
  63. +2 −3 cherokee/virtual_server.c
  64. +2 −2 cherokee/virtual_server.h
View
2 cherokee/Makefile.am
@@ -714,8 +714,6 @@ regex.h \
regex.c \
resolv_cache.h \
resolv_cache.c \
-typed_table.h \
-typed_table.c \
post.h \
post.c
View
34 cherokee/access.c
@@ -64,10 +64,10 @@ typedef union {
} ip_t;
typedef struct {
- list_t node;
+ cherokee_list_t node;
- ip_type_t type;
- ip_t ip;
+ ip_type_t type;
+ ip_t ip;
} ip_item_t;
typedef struct {
@@ -87,7 +87,7 @@ new_ip (void)
ip_item_t *n = (ip_item_t *) malloc (sizeof(ip_item_t));
if (n == NULL) return NULL;
- INIT_LIST_HEAD((list_t*)n);
+ INIT_LIST_HEAD (LIST(n));
memset (&n->ip, 0, sizeof(ip_t));
return n;
@@ -109,7 +109,7 @@ new_subnet (void)
memset (&n->base.ip, 0, sizeof(ip_t));
memset (&n->mask, 0, sizeof(ip_t));
- INIT_LIST_HEAD((list_t*)n);
+ INIT_LIST_HEAD (LIST(n));
return n;
}
@@ -154,18 +154,18 @@ print_ip (ip_type_t type, ip_t *ip)
ret_t
cherokee_access_free (cherokee_access_t *entry)
{
- list_t *i, *tmp;
+ cherokee_list_t *i, *tmp;
/* Free the IP list items
*/
- list_for_each_safe (i, tmp, (list_t*)&entry->list_ips) {
+ list_for_each_safe (i, tmp, LIST(&entry->list_ips)) {
list_del (i);
free (i);
}
/* Free the Subnet list items
*/
- list_for_each_safe (i, tmp, (list_t*)&entry->list_subnets) {
+ list_for_each_safe (i, tmp, LIST(&entry->list_subnets)) {
list_del (i);
free (i);
}
@@ -317,7 +317,7 @@ cherokee_access_add_ip (cherokee_access_t *entry, char *ip)
return ret;
}
- list_add ((list_t *)n, &entry->list_ips);
+ list_add (LIST(n), &entry->list_ips);
return ret;
}
@@ -362,7 +362,7 @@ cherokee_access_add_subnet (cherokee_access_t *entry, char *subnet)
n = new_subnet();
if (n == NULL) return ret_error;
- list_add ((list_t *)n, &entry->list_subnets);
+ list_add (LIST(n), &entry->list_subnets);
/* Parse the IP
*/
@@ -447,17 +447,17 @@ cherokee_access_add (cherokee_access_t *entry, char *ip_or_subnet)
ret_t
cherokee_access_print_debug (cherokee_access_t *entry)
{
- list_t *i;
+ cherokee_list_t *i;
printf ("IPs: ");
- list_for_each (i, (list_t*)&entry->list_ips) {
+ list_for_each (i, LIST(&entry->list_ips)) {
print_ip (IP_NODE(i)->type, &IP_NODE(i)->ip);
printf(" ");
}
printf("\n");
printf ("Subnets: ");
- list_for_each (i, (list_t*)&entry->list_subnets) {
+ list_for_each (i, LIST(&entry->list_subnets)) {
print_ip (IP_NODE(i)->type, &IP_NODE(i)->ip);
printf("/");
print_ip (IP_NODE(i)->type, &SUBNET_NODE(i)->mask);
@@ -472,12 +472,12 @@ cherokee_access_print_debug (cherokee_access_t *entry)
ret_t
cherokee_access_ip_match (cherokee_access_t *entry, cherokee_socket_t *sock)
{
- int re;
- list_t *i;
+ int re;
+ cherokee_list_t *i;
/* Check in the IP list
*/
- list_for_each (i, (list_t*)&entry->list_ips) {
+ list_for_each (i, LIST(&entry->list_ips)) {
#ifdef HAVE_IPV6
/* This is a special case:
@@ -529,7 +529,7 @@ cherokee_access_ip_match (cherokee_access_t *entry, cherokee_socket_t *sock)
/* Check in the Subnets list
*/
- list_for_each (i, (list_t*)&entry->list_subnets) {
+ list_for_each (i, LIST(&entry->list_subnets)) {
int j;
ip_t masqued_remote, masqued_list;
View
4 cherokee/access.h
@@ -30,8 +30,8 @@
#include "socket.h"
typedef struct {
- list_t list_ips;
- list_t list_subnets;
+ cherokee_list_t list_ips;
+ cherokee_list_t list_subnets;
} cherokee_access_t;
ret_t cherokee_access_new (cherokee_access_t **entry);
View
6 cherokee/admin_client.c
@@ -376,7 +376,7 @@ ask_get_connections (cherokee_admin_client_t *admin, void *arg)
}
static ret_t
-parse_reply_get_connections (char *reply, list_t *conns_list)
+parse_reply_get_connections (char *reply, cherokee_list_t *conns_list)
{
char *begin;
char *end;
@@ -438,15 +438,15 @@ parse_reply_get_connections (char *reply, list_t *conns_list)
SHOULDNT_HAPPEN;
}
- list_add ((list_t *)conn_info, conns_list);
+ list_add (LIST(conn_info), conns_list);
cherokee_buffer_clean (&info_str);
}
return ret_ok;
}
ret_t
-cherokee_admin_client_ask_connections (cherokee_admin_client_t *admin, list_t *conns_list)
+cherokee_admin_client_ask_connections (cherokee_admin_client_t *admin, cherokee_list_t *conns_list)
{
ret_t ret;
View
2 cherokee/admin_client.h
@@ -101,7 +101,7 @@ ret_t cherokee_admin_client_ask_port_tls (cherokee_admin_client_t *admin, cui
ret_t cherokee_admin_client_ask_rx (cherokee_admin_client_t *admin, cherokee_buffer_t *rx);
ret_t cherokee_admin_client_ask_tx (cherokee_admin_client_t *admin, cherokee_buffer_t *tx);
-ret_t cherokee_admin_client_ask_connections (cherokee_admin_client_t *admin, list_t *conns);
+ret_t cherokee_admin_client_ask_connections (cherokee_admin_client_t *admin, cherokee_list_t *conns);
ret_t cherokee_admin_client_del_connection (cherokee_admin_client_t *admin, char *id);
ret_t cherokee_admin_client_ask_thread_num (cherokee_admin_client_t *admin, cherokee_buffer_t *num);
ret_t cherokee_admin_client_set_backup_mode (cherokee_admin_client_t *admin, cherokee_boolean_t active);
View
4 cherokee/admin_server.c
@@ -147,8 +147,8 @@ ret_t
cherokee_admin_server_reply_get_connections (cherokee_handler_admin_t *ahdl, cherokee_buffer_t *question, cherokee_buffer_t *reply)
{
ret_t ret;
- list_t *i, *tmp;
- list_t connections = LIST_HEAD_INIT(connections);
+ cherokee_list_t *i, *tmp;
+ cherokee_list_t connections = LIST_HEAD_INIT(connections);
cherokee_server_t *server = HANDLER_SRV(ahdl);
/* Get the connection info list
View
1 cherokee/cherokee.h
@@ -42,7 +42,6 @@
#include <cherokee/url.h>
#include <cherokee/header.h>
#include <cherokee/resolv_cache.h>
-#include <cherokee/typed_table.h>
/* Server library
*/
View
12 cherokee/cherokee_show.c
@@ -41,16 +41,16 @@
int
main (int argc, char *argv[])
{
- ret_t ret;
- cuint_t fds_num;
+ ret_t ret;
+ cuint_t fds_num;
cherokee_fdpoll_t *fdpoll;
cherokee_admin_client_t *client;
cherokee_buffer_t url;
- list_t *i, *tmp;
+ cherokee_list_t *i, *tmp;
- cuint_t port;
- cherokee_buffer_t buf;
- list_t conns = LIST_HEAD_INIT(conns);
+ cuint_t port;
+ cherokee_buffer_t buf;
+ cherokee_list_t conns = LIST_HEAD_INIT(conns);
if (argc <= 1) {
PRINT_ERROR ("%s url request\n", argv[0]);
View
6 cherokee/config_entry.h
@@ -30,7 +30,6 @@
#include "table.h"
#include "handler.h"
#include "http.h"
-#include "typed_table.h"
#include "validator.h"
#define CHEROKEE_CONFIG_PRIORITY_NONE 0
@@ -73,10 +72,7 @@ ret_t cherokee_config_entry_free (cherokee_config_entry_t *entry);
ret_t cherokee_config_entry_init (cherokee_config_entry_t *entry);
ret_t cherokee_config_entry_mrproper (cherokee_config_entry_t *entry);
-ret_t cherokee_config_entry_set_handler_prop (cherokee_config_entry_t *entry, char *prop_name, cherokee_typed_table_types_t type, void *value, cherokee_table_free_item_t free_func);
-ret_t cherokee_config_entry_set_validator_prop (cherokee_config_entry_t *entry, char *prop_name, cherokee_typed_table_types_t type, void *value, cherokee_table_free_item_t free_func);
-ret_t cherokee_config_entry_set_handler (cherokee_config_entry_t *entry, cherokee_module_info_t *modinfo);
-
+ret_t cherokee_config_entry_set_handler (cherokee_config_entry_t *entry, cherokee_module_info_t *modinfo);
ret_t cherokee_config_entry_complete (cherokee_config_entry_t *entry, cherokee_config_entry_t *parent, cherokee_boolean_t same_type);
ret_t cherokee_config_entry_inherit (cherokee_config_entry_t *entry);
View
15 cherokee/config_node.c
@@ -30,7 +30,6 @@
#include "config_node.h"
#include "util.h"
-#include "list_ext.h"
#define ENTRIES "config"
@@ -62,7 +61,7 @@ cherokee_config_node_new (cherokee_config_node_t **conf)
ret_t
cherokee_config_node_mrproper (cherokee_config_node_t *conf)
{
- list_t *i, *j;
+ cherokee_list_t *i, *j;
cherokee_buffer_mrproper (&conf->key);
cherokee_buffer_mrproper (&conf->val);
@@ -87,7 +86,7 @@ cherokee_config_node_free (cherokee_config_node_t *conf)
static cherokee_config_node_t *
search_child (cherokee_config_node_t *current, cherokee_buffer_t *child)
{
- list_t *i;
+ cherokee_list_t *i;
cherokee_config_node_t *entry;
list_for_each (i, &current->child) {
@@ -112,7 +111,7 @@ add_new_child (cherokee_config_node_t *entry, cherokee_buffer_t *key)
cherokee_buffer_add_buffer (&n->key, key);
- list_add_tail ((list_t *)n, &entry->child);
+ list_add_tail (LIST(n), &entry->child);
return n;
}
@@ -292,8 +291,8 @@ cherokee_config_node_get_buf (cherokee_config_node_t *conf, cherokee_buffer_t *k
ret_t
cherokee_config_node_while (cherokee_config_node_t *conf, cherokee_config_node_while_func_t func, void *data)
{
- ret_t ret;
- list_t *i;
+ ret_t ret;
+ cherokee_list_t *i;
cherokee_config_node_foreach (i, conf) {
ret = func (CONFIG_NODE(i), data);
@@ -499,12 +498,12 @@ cherokee_config_node_read_list (cherokee_config_node_t *conf,
static ret_t
convert_to_list_step (char *entry, void *data)
{
- return cherokee_list_add_tail_content ((list_t *)data, strdup(entry));
+ return cherokee_list_add_tail_content (LIST(data), strdup(entry));
}
ret_t
-cherokee_config_node_convert_list (cherokee_config_node_t *conf, const char *key, list_t *list)
+cherokee_config_node_convert_list (cherokee_config_node_t *conf, const char *key, cherokee_list_t *list)
{
return cherokee_config_node_read_list (conf, key, convert_to_list_step, list);
}
View
6 cherokee/config_node.h
@@ -36,8 +36,8 @@
CHEROKEE_BEGIN_DECLS
typedef struct {
- list_t entry;
- list_t child;
+ cherokee_list_t entry;
+ cherokee_list_t child;
cherokee_buffer_t key;
cherokee_buffer_t val;
@@ -76,7 +76,7 @@ ret_t cherokee_config_node_read_int (cherokee_config_node_t *conf, const char
ret_t cherokee_config_node_read_list (cherokee_config_node_t *conf, const char *key,
cherokee_config_node_list_func_t func, void *param);
-ret_t cherokee_config_node_convert_list (cherokee_config_node_t *conf, const char *key, list_t *list);
+ret_t cherokee_config_node_convert_list (cherokee_config_node_t *conf, const char *key, cherokee_list_t *list);
CHEROKEE_END_DECLS
View
2 cherokee/connection-protected.h
@@ -82,7 +82,7 @@ typedef enum {
struct cherokee_connection {
- list_t list_entry;
+ cherokee_list_t list_entry;
/* References
*/
View
10 cherokee/connection_info.c
@@ -221,9 +221,9 @@ cherokee_connection_info_fill_up (cherokee_connection_info_t *info, cherokee_con
ret_t
-cherokee_connection_info_list_thread (list_t *list, void *_thread, cherokee_handler_t *self_handler)
+cherokee_connection_info_list_thread (cherokee_list_t *list, void *_thread, cherokee_handler_t *self_handler)
{
- list_t *i;
+ cherokee_list_t *i;
cherokee_boolean_t locked = false;
cherokee_thread_t *thread = THREAD(_thread);
@@ -251,7 +251,7 @@ cherokee_connection_info_list_thread (list_t *list, void *_thread, cherokee_hand
CHEROKEE_NEW(n,connection_info);
cherokee_connection_info_fill_up (n, CONN(i));
- list_add ((list_t *)n, list);
+ list_add (LIST(n), list);
}
if (list_empty(list))
@@ -267,9 +267,9 @@ cherokee_connection_info_list_thread (list_t *list, void *_thread, cherokee_hand
ret_t
-cherokee_connection_info_list_server (list_t *list, cherokee_server_t *server, cherokee_handler_t *self)
+cherokee_connection_info_list_server (cherokee_list_t *list, cherokee_server_t *server, cherokee_handler_t *self)
{
- list_t *i;
+ cherokee_list_t *i;
cherokee_connection_info_list_thread (list, server->main_thread, self);
View
6 cherokee/connection_info.h
@@ -40,7 +40,7 @@
CHEROKEE_BEGIN_DECLS
typedef struct {
- list_t list_entry;
+ cherokee_list_t list_entry;
cherokee_buffer_t id; /* ID */
cherokee_buffer_t phase; /* Current task */
cherokee_buffer_t request; /* Request string */
@@ -61,8 +61,8 @@ ret_t cherokee_connection_info_free (cherokee_connection_info_t *info);
ret_t cherokee_connection_info_fill_up (cherokee_connection_info_t *info, cherokee_connection_t *conn);
-ret_t cherokee_connection_info_list_thread (list_t *infos_list, void *thread, cherokee_handler_t *self);
-ret_t cherokee_connection_info_list_server (list_t *infos_list, cherokee_server_t *server, cherokee_handler_t *self);
+ret_t cherokee_connection_info_list_thread (cherokee_list_t *infos_list, void *thread, cherokee_handler_t *self);
+ret_t cherokee_connection_info_list_server (cherokee_list_t *infos_list, cherokee_server_t *server, cherokee_handler_t *self);
CHEROKEE_END_DECLS
View
26 cherokee/ext_source.c
@@ -36,7 +36,7 @@
static void
init_server (cherokee_ext_source_t *n)
{
- INIT_LIST_HEAD((list_t *)n);
+ INIT_LIST_HEAD (LIST(n));
cherokee_buffer_init (&n->interpreter);
cherokee_buffer_init (&n->host);
@@ -95,7 +95,7 @@ cherokee_ext_source_new (cherokee_ext_source_t **server)
CHEROKEE_NEW_STRUCT (n, ext_source);
init_server (n);
- n->free_func = (cherokee_typed_free_func_t) server_free;
+// n->free_func = (cherokee_typed_free_func_t) server_free;
*server = n;
return ret_ok;
@@ -108,7 +108,7 @@ cherokee_ext_source_head_new (cherokee_ext_source_head_t **server)
CHEROKEE_NEW_STRUCT (n, ext_source_head);
init_server (EXT_SOURCE(n));
- EXT_SOURCE(n)->free_func = (cherokee_typed_free_func_t) server_head_free;
+// EXT_SOURCE(n)->free_func = (cherokee_typed_free_func_t) server_head_free;
n->current_server = EXT_SOURCE(n);
CHEROKEE_MUTEX_INIT (&n->current_server_lock, NULL);
@@ -121,10 +121,10 @@ cherokee_ext_source_head_new (cherokee_ext_source_head_t **server)
ret_t
cherokee_ext_source_free (cherokee_ext_source_t *server)
{
- if (server->free_func == NULL)
+// if (server->free_func == NULL)
return ret_error;
- server->free_func(server);
+// server->free_func(server);
return ret_ok;
}
@@ -197,7 +197,7 @@ cherokee_ext_source_connect (cherokee_ext_source_t *src, cherokee_socket_t *sock
ret_t
-cherokee_ext_source_get_next (cherokee_ext_source_head_t *head_config, list_t *server_list, cherokee_ext_source_t **next)
+cherokee_ext_source_get_next (cherokee_ext_source_head_t *head_config, cherokee_list_t *server_list, cherokee_ext_source_t **next)
{
cherokee_ext_source_t *current_config;
@@ -206,14 +206,14 @@ cherokee_ext_source_get_next (cherokee_ext_source_head_t *head_config, list_t *s
/* Set the next server
*/
current_config = head_config->current_server;
- head_config->current_server = EXT_SOURCE(((list_t *)current_config)->next);
+ head_config->current_server = EXT_SOURCE(LIST(current_config)->next);
/* This is a special case: if the next is the base of the list, we have to
* skip the entry and point to the next one
*/
- if ((list_t*)head_config->current_server == server_list) {
+ if (LIST(head_config->current_server) == server_list) {
current_config = head_config->current_server;
- head_config->current_server = EXT_SOURCE(((list_t *)current_config)->next);
+// head_config->current_server = EXT_SOURCE((LIST(current_config)->next);
}
*next = head_config->current_server;
@@ -353,14 +353,14 @@ split_address_or_path (char *str, cherokee_buffer_t *hostname, cint_t *port_num,
ret_t
-cherokee_ext_source_configure (cherokee_config_node_t *conf, list_t *ext_list)
+cherokee_ext_source_configure (cherokee_config_node_t *conf, cherokee_list_t *ext_list)
{
ret_t ret;
cherokee_config_node_t *child;
cherokee_config_node_t *child2;
cherokee_config_node_t *child3;
- list_t *i, *j, *k;
- list_t nlist = LIST_HEAD_INIT(nlist);
+ cherokee_list_t *i, *j, *k;
+ cherokee_list_t nlist = LIST_HEAD_INIT(nlist);
cherokee_ext_source_t *server_entry = NULL;
cherokee_ext_source_head_t *head = NULL;
@@ -383,7 +383,7 @@ cherokee_ext_source_configure (cherokee_config_node_t *conf, list_t *ext_list)
/* Add the entry to the list
*/
- list_add_tail ((list_t *)server_entry, ext_list);
+ list_add_tail (LIST(server_entry), ext_list);
/* Parse properties
*/
View
9 cherokee/ext_source.h
@@ -27,15 +27,14 @@
#include "list.h"
#include "buffer.h"
-#include "typed_table.h"
#include "socket.h"
#include "config_node.h"
CHEROKEE_BEGIN_DECLS
typedef struct {
- list_t entry;
+ cherokee_list_t entry;
cherokee_buffer_t interpreter;
@@ -47,7 +46,7 @@ typedef struct {
char **custom_env;
cuint_t custom_env_len;
- cherokee_typed_free_func_t free_func;
+// cherokee_typed_free_func_t free_func;
} cherokee_ext_source_t;
@@ -79,11 +78,11 @@ ret_t cherokee_ext_source_spawn_srv (cherokee_ext_source_t *server);
/* External source head
*/
ret_t cherokee_ext_source_head_new (cherokee_ext_source_head_t **serverf);
-ret_t cherokee_ext_source_get_next (cherokee_ext_source_head_t *serverf, list_t *server_list, cherokee_ext_source_t **next);
+ret_t cherokee_ext_source_get_next (cherokee_ext_source_head_t *serverf, cherokee_list_t *server_list, cherokee_ext_source_t **next);
/* Configure
*/
-ret_t cherokee_ext_source_configure (cherokee_config_node_t *conf, list_t *ext_list);
+ret_t cherokee_ext_source_configure (cherokee_config_node_t *conf, cherokee_list_t *ext_list);
CHEROKEE_END_DECLS
View
5 cherokee/exts_table.c
@@ -23,15 +23,14 @@
*/
#include "exts_table.h"
-#include "list_ext.h"
#include "table.h"
#define ENTRIES "exts"
struct cherokee_exts_table {
cherokee_table_t table;
- list_t list;
+ cherokee_list_t list;
};
ret_t
@@ -84,7 +83,7 @@ cherokee_exts_table_get (cherokee_exts_table_t *et, cherokee_buffer_t *requested
ret_t
cherokee_exts_table_add (cherokee_exts_table_t *et, char *ext, cherokee_config_entry_t *plugin_entry)
{
- list_t *i;
+ cherokee_list_t *i;
cherokee_boolean_t found = false;
/* Each plugin entry has to be added to the list only once
View
10 cherokee/fcgi_dispatcher.c
@@ -67,8 +67,8 @@ cherokee_fcgi_dispatcher_new (cherokee_fcgi_dispatcher_t **fcgi,
ret_t
cherokee_fcgi_dispatcher_free (cherokee_fcgi_dispatcher_t *fcgi)
{
- cuint_t i;
- list_t *l, *tmp;
+ cuint_t i;
+ cherokee_list_t *l, *tmp;
CHEROKEE_MUTEX_DESTROY(&fcgi->lock);
@@ -79,7 +79,7 @@ cherokee_fcgi_dispatcher_free (cherokee_fcgi_dispatcher_t *fcgi)
list_for_each_safe (l, tmp, &fcgi->queue) {
cherokee_connection_t *conn = HANDLER_CONN(l);
- list_del ((list_t *)conn);
+ list_del (LIST(conn));
cherokee_thread_inject_active_connection (HANDLER_THREAD(l), conn);
}
@@ -174,7 +174,7 @@ cherokee_fcgi_dispatcher_dispatch (cherokee_fcgi_dispatcher_t *fcgi,
ret_t
cherokee_fcgi_dispatcher_end_notif (cherokee_fcgi_dispatcher_t *fcgi)
{
- list_t *i;
+ cherokee_list_t *i;
if (list_empty (&fcgi->queue))
return ret_ok;
@@ -189,6 +189,6 @@ cherokee_fcgi_dispatcher_end_notif (cherokee_fcgi_dispatcher_t *fcgi)
ret_t
cherokee_fcgi_dispatcher_queue_conn (cherokee_fcgi_dispatcher_t *fcgi, cherokee_connection_t *conn)
{
- list_add_tail ((list_t *)conn, &fcgi->queue);
+ list_add_tail (LIST(conn), &fcgi->queue);
return ret_ok;
}
View
2 cherokee/fcgi_dispatcher.h
@@ -36,7 +36,7 @@ typedef struct {
cherokee_fcgi_manager_t *manager;
cuint_t manager_num;
- list_t queue;
+ cherokee_list_t queue;
cherokee_thread_t *thread;
#ifdef HAVE_PTHREAD
View
1 cherokee/handler_cgi.c
@@ -54,7 +54,6 @@
#include "server-protected.h"
#include "header.h"
#include "header-protected.h"
-#include "list_ext.h"
#include "post.h"
View
12 cherokee/handler_cgi_base.c
@@ -25,9 +25,7 @@
#include "common-internal.h"
#include "handler_cgi_base.h"
-#include "typed_table.h"
#include "socket.h"
-#include "list_ext.h"
#include "util.h"
#include "connection-protected.h"
@@ -93,7 +91,7 @@ cherokee_handler_cgi_base_init (cherokee_handler_cgi_base_t *cgi,
typedef struct {
- list_t entry;
+ cherokee_list_t entry;
cherokee_buffer_t env;
cherokee_buffer_t val;
} env_item_t;
@@ -127,7 +125,7 @@ env_item_free (void *p)
ret_t
cherokee_handler_cgi_base_props_free (cherokee_handler_cgi_base_props_t *props)
{
- list_t *i, *tmp;
+ cherokee_list_t *i, *tmp;
cherokee_buffer_mrproper (&props->script_alias);
@@ -142,7 +140,7 @@ ret_t
cherokee_handler_cgi_base_configure (cherokee_config_node_t *conf, cherokee_server_t *srv, cherokee_handler_props_t **_props)
{
ret_t ret;
- list_t *i, *j;
+ cherokee_list_t *i, *j;
cherokee_handler_cgi_base_props_t *props;
/* Sanity check: This class is pure virtual, it shouldn't allocate memory here.
@@ -181,7 +179,7 @@ cherokee_handler_cgi_base_configure (cherokee_config_node_t *conf, cherokee_serv
env = env_item_new (&subconf2->key, &subconf2->val);
if (env == NULL) return ret_error;
- list_add_tail ((list_t *)env, &props->system_env);
+ list_add_tail (LIST(env), &props->system_env);
}
} else if (equal_buf_str (&subconf->key, "error_handler")) {
props->is_error_handler = atoi(subconf->val.buf);
@@ -416,7 +414,7 @@ ret_t
cherokee_handler_cgi_base_build_envp (cherokee_handler_cgi_base_t *cgi, cherokee_connection_t *conn)
{
ret_t ret;
- list_t *i;
+ cherokee_list_t *i;
cherokee_buffer_t *name;
cuint_t len = 0;
char *p = "";
View
2 cherokee/handler_cgi_base.h
@@ -50,7 +50,7 @@ typedef enum {
typedef struct {
cherokee_handler_props_t base;
- list_t system_env;
+ cherokee_list_t system_env;
cuint_t change_user;
cherokee_buffer_t script_alias;
cherokee_boolean_t check_file;
View
3 cherokee/handler_common.c
@@ -44,7 +44,6 @@
#include "server-protected.h"
#include "module.h"
#include "connection.h"
-#include "list_ext.h"
#define ENTRIES "handler,common"
@@ -230,7 +229,7 @@ cherokee_handler_common_new (cherokee_handler_t **hdl, void *cnt, cherokee_handl
/* Is it a directory
*/
if (S_ISDIR(info->st_mode)) {
- list_t *i;
+ cherokee_list_t *i;
cherokee_iocache_mmap_release (iocache, file);
View
29 cherokee/handler_dirlist.c
@@ -48,13 +48,12 @@
#include "module_loader.h"
#include "icons.h"
#include "common.h"
-#include "list_ext.h"
#define DEFAULT_NAME_LEN 40
struct file_entry {
- list_t list_entry;
+ cherokee_list_t list_entry;
struct stat stat;
cuint_t name_len;
struct dirent info; /* It *must* be the last entry */
@@ -163,7 +162,7 @@ ret_t
cherokee_handler_dirlist_configure (cherokee_config_node_t *conf, cherokee_server_t *srv, cherokee_handler_props_t **_props)
{
ret_t ret;
- list_t *i;
+ cherokee_list_t *i;
cherokee_handler_dirlist_props_t *props;
char *theme = NULL;
cherokee_buffer_t theme_path = CHEROKEE_BUF_INIT;
@@ -236,7 +235,7 @@ cherokee_handler_dirlist_configure (cherokee_config_node_t *conf, cherokee_serve
static cherokee_boolean_t
is_header_file (cherokee_handler_dirlist_t *dhdl, char *filename)
{
- list_t *i;
+ cherokee_list_t *i;
list_for_each (i, &HDL_DIRLIST_PROP(dhdl)->notice_files)
{
@@ -403,7 +402,7 @@ cherokee_handler_dirlist_new (cherokee_handler_t **hdl, void *cnt, cherokee_han
ret_t
cherokee_handler_dirlist_free (cherokee_handler_dirlist_t *dhdl)
{
- list_t *i, *tmp;
+ cherokee_list_t *i, *tmp;
cherokee_buffer_mrproper (&dhdl->header);
cherokee_buffer_mrproper (&dhdl->public_dir);
@@ -450,7 +449,7 @@ check_request_finish_with_slash (cherokee_handler_dirlist_t *dhdl)
}
static int
-cmp_name_down (list_t *a, list_t *b)
+cmp_name_down (cherokee_list_t *a, cherokee_list_t *b)
{
file_entry_t *f1 = (file_entry_t *)a;
file_entry_t *f2 = (file_entry_t *)b;
@@ -460,7 +459,7 @@ cmp_name_down (list_t *a, list_t *b)
static int
-cmp_size_down (list_t *a, list_t *b)
+cmp_size_down (cherokee_list_t *a, cherokee_list_t *b)
{
int diff;
file_entry_t *f1 = (file_entry_t *)a;
@@ -473,7 +472,7 @@ cmp_size_down (list_t *a, list_t *b)
}
static int
-cmp_date_down (list_t *a, list_t *b)
+cmp_date_down (cherokee_list_t *a, cherokee_list_t *b)
{
int diff;
file_entry_t *f1 = (file_entry_t *)a;
@@ -486,25 +485,25 @@ cmp_date_down (list_t *a, list_t *b)
}
static int
-cmp_name_up (list_t *a, list_t *b)
+cmp_name_up (cherokee_list_t *a, cherokee_list_t *b)
{
return -cmp_name_down(a,b);
}
static int
-cmp_size_up (list_t *a, list_t *b)
+cmp_size_up (cherokee_list_t *a, cherokee_list_t *b)
{
return -cmp_size_down(a,b);
}
static int
-cmp_date_up (list_t *a, list_t *b)
+cmp_date_up (cherokee_list_t *a, cherokee_list_t *b)
{
return -cmp_date_down(a,b);
}
static void
-list_sort_by_type (list_t *list, cherokee_dirlist_sort_t sort)
+list_sort_by_type (cherokee_list_t *list, cherokee_dirlist_sort_t sort)
{
switch (sort) {
case Name_Down:
@@ -559,9 +558,9 @@ build_file_list (cherokee_handler_dirlist_t *dhdl)
continue;
if (S_ISDIR(item->stat.st_mode)) {
- list_add ((list_t *)item, &dhdl->dirs);
+ list_add (LIST(item), &dhdl->dirs);
} else {
- list_add ((list_t *)item, &dhdl->files);
+ list_add (LIST(item), &dhdl->files);
}
}
@@ -619,7 +618,7 @@ static ret_t
read_notice_file (cherokee_handler_dirlist_t *dhdl)
{
ret_t ret;
- list_t *i;
+ cherokee_list_t *i;
cherokee_connection_t *conn = HANDLER_CONN(dhdl);
list_for_each (i, &HDL_DIRLIST_PROP(dhdl)->notice_files) {
View
10 cherokee/handler_dirlist.h
@@ -55,7 +55,7 @@ typedef enum {
typedef struct {
cherokee_handler_props_t props;
- list_t notice_files;
+ cherokee_list_t notice_files;
/* Visible properties
*/
@@ -78,8 +78,8 @@ typedef struct {
/* File list
*/
- list_t dirs;
- list_t files;
+ cherokee_list_t dirs;
+ cherokee_list_t files;
/* State
*/
@@ -89,8 +89,8 @@ typedef struct {
/* State
*/
cuint_t longest_filename;
- list_t *dir_ptr;
- list_t *file_ptr;
+ cherokee_list_t *dir_ptr;
+ cherokee_list_t *file_ptr;
cherokee_buffer_t header;
cherokee_boolean_t serve_css;
View
8 cherokee/handler_error_redir.c
@@ -33,7 +33,7 @@
typedef struct {
- list_t entry;
+ cherokee_list_t entry;
cuint_t error;
cherokee_buffer_t url;
} error_entry_t;
@@ -42,7 +42,7 @@ typedef struct {
static ret_t
props_free (cherokee_handler_error_redir_props_t *props)
{
- list_t *i, *j;
+ cherokee_list_t *i, *j;
list_for_each_safe (i, j, &props->errors) {
error_entry_t *entry = (error_entry_t *)i;
@@ -57,7 +57,7 @@ props_free (cherokee_handler_error_redir_props_t *props)
ret_t
cherokee_handler_error_redir_configure (cherokee_config_node_t *conf, cherokee_server_t *srv, cherokee_handler_props_t **_props)
{
- list_t *i;
+ cherokee_list_t *i;
cherokee_handler_error_redir_props_t *props;
if (*_props == NULL) {
@@ -103,7 +103,7 @@ cherokee_handler_error_redir_configure (cherokee_config_node_t *conf, cherokee_s
ret_t
cherokee_handler_error_redir_new (cherokee_handler_t **hdl, cherokee_connection_t *conn, cherokee_handler_props_t *props)
{
- list_t *i;
+ cherokee_list_t *i;
list_for_each (i, &PROP_ERREDIR(props)->errors) {
error_entry_t *entry = (error_entry_t *)i;
View
2 cherokee/handler_error_redir.h
@@ -38,7 +38,7 @@ typedef struct {
typedef struct {
cherokee_handler_props_t base;
- list_t errors;
+ cherokee_list_t errors;
} cherokee_handler_error_redir_props_t;
#define ERREDIR_HANDLER(x) ((cherokee_handler_error_redir_t *)(x))
View
2 cherokee/handler_fastcgi.c
@@ -50,7 +50,7 @@ static ret_t
cherokee_handler_fastcgi_configure (cherokee_config_node_t *conf, cherokee_server_t *srv, cherokee_handler_props_t **_props)
{
ret_t ret;
- list_t *i, *j;
+ cherokee_list_t *i, *j;
cherokee_handler_fastcgi_props_t *props;
/* Instance a new property object
View
4 cherokee/handler_fastcgi.h
@@ -57,8 +57,8 @@ typedef enum {
typedef struct {
cherokee_handler_cgi_base_t base;
- list_t server_list;
- list_t fastcgi_env_ref;
+ cherokee_list_t server_list;
+ cherokee_list_t fastcgi_env_ref;
cuint_t nsockets;
cuint_t nkeepalive;
View
4 cherokee/handler_fcgi.c
@@ -197,7 +197,7 @@ read_from_fcgi (cherokee_handler_cgi_base_t *cgi, cherokee_buffer_t *buffer)
static ret_t
props_free (cherokee_handler_fcgi_props_t *props)
{
- list_t *i, *tmp;
+ cherokee_list_t *i, *tmp;
list_for_each_safe (i, tmp, &props->server_list) {
cherokee_ext_source_free (EXT_SOURCE(i));
@@ -211,7 +211,7 @@ static ret_t
cherokee_handler_fcgi_configure (cherokee_config_node_t *conf, cherokee_server_t *srv, cherokee_handler_props_t **_props)
{
ret_t ret;
- list_t *i;
+ cherokee_list_t *i;
cherokee_handler_fcgi_props_t *props;
/* Instance a new property object
View
2 cherokee/handler_fcgi.h
@@ -44,7 +44,7 @@ typedef enum {
typedef struct {
cherokee_handler_cgi_base_t base;
- list_t server_list;
+ cherokee_list_t server_list;
} cherokee_handler_fcgi_props_t;
typedef struct {
View
2 cherokee/handler_file.c
@@ -54,7 +54,7 @@ cherokee_handler_file_props_free (cherokee_handler_file_props_t *props)
ret_t
cherokee_handler_file_configure (cherokee_config_node_t *conf, cherokee_server_t *srv, cherokee_handler_props_t **_props)
{
- list_t *i;
+ cherokee_list_t *i;
cherokee_handler_file_props_t *props;
if (*_props == NULL) {
View
2 cherokee/handler_phpcgi.c
@@ -215,7 +215,7 @@ props_free (cherokee_handler_phpcgi_props_t *props)
static ret_t
cherokee_handler_phpcgi_configure (cherokee_config_node_t *conf, cherokee_server_t *srv, cherokee_handler_props_t **_props)
{
- list_t *i;
+ cherokee_list_t *i;
cherokee_handler_phpcgi_props_t *props;
if (*_props == NULL) {
View
2 cherokee/handler_proxy.c
@@ -75,7 +75,7 @@ load_balancer (cherokee_server_t *srv, cherokee_buffer_t *name, cherokee_config_
ret_t
cherokee_handler_proxy_configure (cherokee_config_node_t *conf, cherokee_server_t *srv, cherokee_handler_props_t **_props)
{
- list_t *i;
+ cherokee_list_t *i;
cherokee_handler_proxy_props_t *props;
if (*_props == NULL) {
View
11 cherokee/handler_redir.c
@@ -32,15 +32,14 @@
#include "pcre/pcre.h"
#include "regex.h"
#include "util.h"
-#include "list_ext.h"
#define ENTRIES "handler,redir"
#ifndef CHEROKEE_EMBEDDED
struct cre_list {
- list_t item;
+ cherokee_list_t item;
pcre *re;
char hidden;
cherokee_buffer_t subs;
@@ -91,7 +90,7 @@ substitute_groups (cherokee_buffer_t *url, const char *subject,
static ret_t
match_and_substitute (cherokee_handler_redir_t *n)
{
- list_t *i;
+ cherokee_list_t *i;
ret_t ret;
cherokee_connection_t *conn = HANDLER_CONN(n);
@@ -336,7 +335,7 @@ configure_rewrite (cherokee_config_node_t *conf, cherokee_server_t *srv, cheroke
/* Add the list
*/
- list_add_tail ((list_t *)n, &props->regex_list);
+ list_add_tail (LIST(n), &props->regex_list);
return ret_ok;
}
@@ -353,7 +352,7 @@ cre_entry_free (struct cre_list *n)
static ret_t
props_free (cherokee_handler_redir_props_t *props)
{
- list_t *i, *tmp;
+ cherokee_list_t *i, *tmp;
cherokee_buffer_mrproper (&props->url);
@@ -369,7 +368,7 @@ static ret_t
cherokee_handler_redir_configure (cherokee_config_node_t *conf, cherokee_server_t *srv, cherokee_handler_props_t **_props)
{
ret_t ret;
- list_t *i, *j;
+ cherokee_list_t *i, *j;
cherokee_handler_redir_props_t *props;
if (*_props == NULL) {
View
2 cherokee/handler_redir.h
@@ -36,7 +36,7 @@
typedef struct {
cherokee_handler_props_t base;
cherokee_buffer_t url;
- list_t regex_list;
+ cherokee_list_t regex_list;
} cherokee_handler_redir_props_t;
typedef struct {
View
4 cherokee/handler_scgi.c
@@ -40,7 +40,7 @@
static ret_t
props_free (cherokee_handler_scgi_props_t *props)
{
- list_t *i, *tmp;
+ cherokee_list_t *i, *tmp;
list_for_each_safe (i, tmp, &props->server_list) {
cherokee_ext_source_free (EXT_SOURCE(i));
@@ -55,7 +55,7 @@ static ret_t
cherokee_handler_scgi_configure (cherokee_config_node_t *conf, cherokee_server_t *srv, cherokee_handler_props_t **_props)
{
ret_t ret;
- list_t *i;
+ cherokee_list_t *i;
cherokee_handler_scgi_props_t *props;
/* Instance a new property object
View
4 cherokee/handler_scgi.h
@@ -36,8 +36,8 @@
typedef struct {
cherokee_handler_cgi_base_t base;
- list_t scgi_env_ref;
- list_t server_list;
+ cherokee_list_t scgi_env_ref;
+ cherokee_list_t server_list;
} cherokee_handler_scgi_props_t;
View
2 cherokee/handler_server_info.c
@@ -107,7 +107,7 @@ props_free (cherokee_handler_server_info_props_t *props)
ret_t
cherokee_handler_server_info_configure (cherokee_config_node_t *conf, cherokee_server_t *srv, cherokee_handler_props_t **_props)
{
- list_t *i;
+ cherokee_list_t *i;
cherokee_handler_server_info_props_t *props;
if (*_props == NULL) {
View
1 cherokee/icons.c
@@ -25,7 +25,6 @@
#include "common-internal.h"
#include "icons.h"
-#include "list_ext.h"
#include "match.h"
#include "util.h"
View
8 cherokee/iocache.c
@@ -88,12 +88,12 @@ struct cherokee_iocache {
typedef struct {
cherokee_iocache_t *iocache;
float average;
- list_t to_delete;
+ cherokee_list_t to_delete;
} clean_up_params_t;
typedef struct {
- list_t list;
+ cherokee_list_t list;
cherokee_iocache_entry_t *file;
const char *filename;
} to_delete_entry_t;
@@ -181,7 +181,7 @@ iocache_clean_up_each (const char *key, void *value, void *param)
delobj->file = file;
delobj->filename = key;
- list_add ((list_t *)delobj, &params->to_delete);
+ list_add (LIST(delobj), &params->to_delete);
}
return true;
@@ -318,7 +318,7 @@ cherokee_iocache_clean_up (cherokee_iocache_t *iocache, cuint_t num)
{
float average;
clean_up_params_t params;
- list_t *i, *tmp;
+ cherokee_list_t *i, *tmp;
if (iocache->files_num < CACHE_SIZE)
return ret_ok;
View
78 cherokee/list.c
@@ -29,9 +29,9 @@
void
-cherokee_list_sort (list_t *head, int (*cmp)(list_t *a, list_t *b))
+cherokee_list_sort (cherokee_list_t *head, int (*cmp)(cherokee_list_t *a, cherokee_list_t *b))
{
- list_t *p, *q, *e, *list, *tail, *oldhead;
+ cherokee_list_t *p, *q, *e, *list, *tail, *oldhead;
int insize, nmerges, psize, qsize, i;
list = head->next;
@@ -108,58 +108,58 @@ cherokee_list_sort (list_t *head, int (*cmp)(list_t *a, list_t *b))
ret_t
-cherokee_list_add_content (list_t *head, void *item)
+cherokee_list_add_content (cherokee_list_t *head, void *item)
{
- CHEROKEE_NEW_STRUCT(n,list_item);
-
- /* Init
- */
- INIT_LIST_HEAD((list_t*)n);
- n->info = item;
-
- /* Add to list
- */
- list_add ((list_t *)n, head);
-
- return ret_ok;
+ CHEROKEE_NEW_STRUCT(n,list_item);
+
+ /* Init
+ */
+ INIT_LIST_HEAD((cherokee_list_t*)n);
+ n->info = item;
+
+ /* Add to list
+ */
+ list_add ((cherokee_list_t *)n, head);
+
+ return ret_ok;
}
ret_t
-cherokee_list_add_tail_content (list_t *head, void *item)
+cherokee_list_add_tail_content (cherokee_list_t *head, void *item)
{
- CHEROKEE_NEW_STRUCT(n,list_item);
-
- /* Init
- */
- INIT_LIST_HEAD((list_t*)n);
- n->info = item;
-
- /* Add to list
- */
- list_add_tail ((list_t *)n, head);
-
- return ret_ok;
+ CHEROKEE_NEW_STRUCT(n,list_item);
+
+ /* Init
+ */
+ INIT_LIST_HEAD((cherokee_list_t*)n);
+ n->info = item;
+
+ /* Add to list
+ */
+ list_add_tail ((cherokee_list_t *)n, head);
+
+ return ret_ok;
}
ret_t
-cherokee_list_content_free (list_t *head, cherokee_list_free_func free_func)
+cherokee_list_content_free (cherokee_list_t *head, cherokee_list_free_func free_func)
{
- list_t *i, *tmp;
-
- list_for_each_safe (i, tmp, head) {
- cherokee_list_content_free_item (i, free_func);
- }
+ cherokee_list_t *i, *tmp;
- INIT_LIST_HEAD(head);
-
- return ret_ok;
+ list_for_each_safe (i, tmp, head) {
+ cherokee_list_content_free_item (i, free_func);
+ }
+
+ INIT_LIST_HEAD(head);
+
+ return ret_ok;
}
ret_t
-cherokee_list_content_free_item (list_t *head, cherokee_list_free_func free_func)
+cherokee_list_content_free_item (cherokee_list_t *head, cherokee_list_free_func free_func)
{
list_del (head);
@@ -173,7 +173,7 @@ cherokee_list_content_free_item (list_t *head, cherokee_list_free_func free_func
ret_t
-cherokee_list_content_free_item_simple (list_t *head)
+cherokee_list_content_free_item_simple (cherokee_list_t *head)
{
list_del (head);
View
33 cherokee/list.h
@@ -38,9 +38,12 @@ struct list_entry {
struct list_entry *next;
struct list_entry *prev;
};
-typedef struct list_entry list_t;
-#define LIST(l) ((list_t *)(l))
+typedef struct list_entry cherokee_list_t;
+typedef struct list_entry cherokee_list_entry_t;
+
+
+#define LIST(l) ((cherokee_list_t *)(l))
#define INIT_LIST_HEAD(ptr) do { \
(ptr)->next = (ptr); \
@@ -60,13 +63,13 @@ typedef struct list_entry list_t;
static inline int
-list_empty (list_t *list)
+list_empty (cherokee_list_t *list)
{
return (list->next == list);
}
static inline void
-list_add (list_t *new_entry, list_t *head)
+list_add (cherokee_list_t *new_entry, cherokee_list_t *head)
{
new_entry->next = head->next;
new_entry->prev = head;
@@ -75,7 +78,7 @@ list_add (list_t *new_entry, list_t *head)
}
static inline void
-list_add_tail (list_t *new_entry, list_t *head)
+list_add_tail (cherokee_list_t *new_entry, cherokee_list_t *head)
{
new_entry->next = head;
new_entry->prev = head->prev;
@@ -84,14 +87,14 @@ list_add_tail (list_t *new_entry, list_t *head)
}
static inline void
-list_del (list_t *entry)
+list_del (cherokee_list_t *entry)
{
entry->next->prev = entry->prev;
entry->prev->next = entry->next;
}
static inline void
-list_reparent (list_t *list, list_t *new_entry)
+list_reparent (cherokee_list_t *list, cherokee_list_t *new_entry)
{
if (list_empty(list))
return;
@@ -102,7 +105,7 @@ list_reparent (list_t *list, list_t *new_entry)
new_entry->next->prev = new_entry;
}
-void cherokee_list_sort (list_t *head, int (*cmp)(list_t *a, list_t *b));
+void cherokee_list_sort (cherokee_list_t *head, int (*cmp)(cherokee_list_t *a, cherokee_list_t *b));
/* Methods for non list elements
@@ -111,19 +114,19 @@ void cherokee_list_sort (list_t *head, int (*cmp)(list_t *a, list_t *b));
typedef void (*cherokee_list_free_func) (void *);
typedef struct {
- list_t list;
- void *info;
+ cherokee_list_entry_t list;
+ void *info;
} cherokee_list_item_t;
#define LIST_ITEM(i) ((cherokee_list_item_t *)(i))
#define LIST_ITEM_INFO(i) (LIST_ITEM(i)->info)
-ret_t cherokee_list_add_content (list_t *head, void *item);
-ret_t cherokee_list_add_tail_content (list_t *head, void *item);
+ret_t cherokee_list_add_content (cherokee_list_t *head, void *item);
+ret_t cherokee_list_add_tail_content (cherokee_list_t *head, void *item);
-ret_t cherokee_list_content_free (list_t *head, cherokee_list_free_func free_func);
-ret_t cherokee_list_content_free_item (list_t *head, cherokee_list_free_func free_func);
-ret_t cherokee_list_content_free_item_simple (list_t *head);
+ret_t cherokee_list_content_free (cherokee_list_t *head, cherokee_list_free_func free_func);
+ret_t cherokee_list_content_free_item (cherokee_list_t *head, cherokee_list_free_func free_func);
+ret_t cherokee_list_content_free_item_simple (cherokee_list_t *head);
CHEROKEE_END_DECLS
View
2 cherokee/main_admin.c
@@ -27,8 +27,6 @@
#include "virtual_server.h"
#include "server-protected.h"
#include "config_entry.h"
-#include "list_ext.h"
-#include "typed_table.h"
#define DEFAULT_PORT 9090
#define DEFAULT_DOCUMENTROOT CHEROKEE_DATADIR "/admin/"
View
12 cherokee/matching_list.c
@@ -43,9 +43,9 @@ cherokee_matching_list_new (cherokee_matching_list_t **mlist)
static void
-free_list (list_t *list)
+free_list (cherokee_list_t *list)
{
- list_t *i, *tmp;
+ cherokee_list_t *i, *tmp;
list_for_each_safe (i, tmp, list) {
if (MLIST_ENTRY(i)->string) {
@@ -69,14 +69,14 @@ cherokee_matching_list_free (cherokee_matching_list_t *mlist)
static ret_t
-add_to_list (list_t *list, const char *item)
+add_to_list (cherokee_list_t *list, const char *item)
{
CHEROKEE_NEW_STRUCT (n, matching_list_entry);
INIT_LIST_HEAD(&n->list);
n->string = strdup(item);
- list_add ((list_t *)n, list);
+ list_add (LIST(n), list);
return ret_ok;
}
@@ -104,9 +104,9 @@ cherokee_matching_list_set_type (cherokee_matching_list_t *mlist, cherokee_match
static int
-in_list (list_t *list, char *match)
+in_list (cherokee_list_t *list, char *match)
{
- list_t *i;
+ cherokee_list_t *i;
list_for_each (i, list) {
if (!strcmp (MLIST_ENTRY(i)->string, match)) {
View
6 cherokee/matching_list.h
@@ -38,14 +38,14 @@ typedef enum {
typedef struct {
- list_t list;
+ cherokee_list_t list;
char *string;
} cherokee_matching_list_entry_t;
typedef struct {
- list_t list_allow;
- list_t list_deny;
+ cherokee_list_t list_allow;
+ cherokee_list_t list_deny;
cherokee_matching_t type;
} cherokee_matching_list_t;
View
4 cherokee/mime-protected.h
@@ -30,8 +30,8 @@
struct cherokee_mime {
cherokee_table_t mime_table;
- list_t mime_list;
- list_t name_list;
+ cherokee_list_t mime_list;
+ cherokee_list_t name_list;
};
#define MIME_TABLE(m) (&((cherokee_mime_t *)(m))->mime_table)
View
8 cherokee/mime.c
@@ -49,7 +49,7 @@ cherokee_mime_new (cherokee_mime_t **mime)
ret_t
cherokee_mime_free (cherokee_mime_t *mime)
{
- list_t *i, *tmp;
+ cherokee_list_t *i, *tmp;
cherokee_table_mrproper (&mime->mime_table);
@@ -79,8 +79,8 @@ cherokee_mime_get_by_suffix (cherokee_mime_t *mime, char *suffix, cherokee_mime_
ret_t
cherokee_mime_get_by_type (cherokee_mime_t *mime, char *type, cherokee_mime_entry_t **entry)
{
- ret_t ret;
- list_t *i;
+ ret_t ret;
+ cherokee_list_t *i;
list_for_each (i, &mime->mime_list) {
cherokee_buffer_t *itype;
@@ -101,7 +101,7 @@ cherokee_mime_get_by_type (cherokee_mime_t *mime, char *type, cherokee_mime_entr
ret_t
cherokee_mime_add_entry (cherokee_mime_t *mime, cherokee_mime_entry_t *entry)
{
- list_add ((list_t *)entry, &mime->mime_list);
+ list_add (LIST(entry), &mime->mime_list);
return ret_ok;
}
View
2 cherokee/mime_entry.c
@@ -26,7 +26,7 @@
#include "mime_entry.h"
struct cherokee_mime_entry {
- list_t base;
+ cherokee_list_t base;
cuint_t maxage;
cherokee_boolean_t maxage_set;
View
10 cherokee/reqs_list.c
@@ -44,7 +44,7 @@ cherokee_reqs_list_init (cherokee_reqs_list_t *rl)
ret_t
cherokee_reqs_list_mrproper (cherokee_reqs_list_t *rl)
{
- list_t *i, *tmp;
+ cherokee_list_t *i, *tmp;
cherokee_reqs_list_entry_t *entry;
list_for_each_safe (i, tmp, rl) {
@@ -62,9 +62,9 @@ cherokee_reqs_list_get (cherokee_reqs_list_t *rl,
cherokee_config_entry_t *plugin_entry,
cherokee_connection_t *conn)
{
- ret_t ret;
- list_t *i;
- list_t *reqs = (list_t *)rl;
+ ret_t ret;
+ cherokee_list_t *i;
+ cherokee_list_t *reqs = LIST(rl);
/* Sanity check
*/
@@ -131,7 +131,7 @@ cherokee_reqs_list_add (cherokee_reqs_list_t *rl,
/* Add the new connection
*/
- list_add_tail (&plugin_entry->list_node, (list_t *)rl);
+ list_add_tail (&plugin_entry->list_node, LIST(rl));
/* Compile the expression
*/
View
2 cherokee/reqs_list.h
@@ -33,7 +33,7 @@
#include "config_entry.h"
-typedef list_t cherokee_reqs_list_t;
+typedef cherokee_list_t cherokee_reqs_list_t;
#define REQLIST(x) ((cherokee_req_list_t *)(x))
ret_t cherokee_reqs_list_init (cherokee_reqs_list_t *rl);
View
2 cherokee/reqs_list_entry.h
@@ -34,7 +34,7 @@
typedef struct {
cherokee_config_entry_t base_entry;
cherokee_buffer_t request;
- list_t list_node;
+ cherokee_list_t list_node;
int ovector[OVECTOR_LEN];
int ovecsize;
View
2 cherokee/request.c
@@ -32,7 +32,7 @@ cherokee_request_header_init (cherokee_request_header_t *request)
/* Init the node list information
*/
- INIT_LIST_HEAD((list_t *)&request->list_entry);
+ INIT_LIST_HEAD (LIST(&request->list_entry));
/* Set default values
*/
View
2 cherokee/request.h
@@ -33,7 +33,7 @@
#include "http.h"
typedef struct {
- list_t list_entry;
+ cherokee_list_t list_entry;
cherokee_url_t url;
uint16_t pipeline;
View
4 cherokee/server-protected.h
@@ -77,15 +77,15 @@ struct cherokee_server {
/* Virtual servers
*/
- list_t vservers;
+ cherokee_list_t vservers;
cherokee_table_t vservers_ref;
cherokee_virtual_server_t *vserver_default;
/* Threads
*/
cherokee_thread_t *main_thread;
int thread_num;
- list_t thread_list;
+ cherokee_list_t thread_list;
int thread_policy;
/* Modules
View
35 cherokee/server.c
@@ -77,7 +77,6 @@
#include "connection.h"
#include "ncpus.h"
#include "mime.h"
-#include "list_ext.h"
#include "util.h"
#include "fdpoll.h"
#include "fdpoll-protected.h"
@@ -263,7 +262,7 @@ cherokee_server_new (cherokee_server_t **srv)
static void
close_all_connections (cherokee_server_t *srv)
{
- list_t *i;
+ cherokee_list_t *i;
cherokee_thread_close_all_connections (srv->main_thread);
@@ -276,7 +275,7 @@ close_all_connections (cherokee_server_t *srv)
static void
free_virtual_servers (cherokee_server_t *srv)
{
- list_t *i, *j;
+ cherokee_list_t *i, *j;
list_for_each_safe (i, j, &srv->vservers) {
cherokee_virtual_server_free (VSERVER(i));
@@ -299,7 +298,7 @@ destroy_thread (cherokee_thread_t *thread)
static ret_t
destroy_all_threads (cherokee_server_t *srv)
{
- list_t *i, *tmp;
+ cherokee_list_t *i, *tmp;
/* Set the exit flag, and try to ensure the threads are not
* locked on a semaphore
@@ -795,7 +794,7 @@ initialize_server_threads (cherokee_server_t *srv)
thread->thread_pref = (i % 2)? thread_normal_tls : thread_tls_normal;
- list_add ((list_t *)thread, &srv->thread_list);
+ list_add (LIST(thread), &srv->thread_list);
}
#endif
@@ -1140,8 +1139,8 @@ update_bogo_now (cherokee_server_t *srv)
ret_t
cherokee_server_unlock_threads (cherokee_server_t *srv)
{
- ret_t ret;
- list_t *i;
+ ret_t ret;
+ cherokee_list_t *i;
/* Update bogo_now before launch the threads
*/
@@ -1296,7 +1295,7 @@ add_vserver (cherokee_config_node_t *node, void *data)
ret = cherokee_table_add (&srv->vservers_ref, node->key.buf, vsrv);
if (ret != ret_ok) return ret;
- list_add ((list_t *)vsrv, &srv->vservers);
+ list_add (LIST(vsrv), &srv->vservers);
param[0] = srv;
param[1] = vsrv;
@@ -1581,8 +1580,8 @@ cherokee_server_daemonize (cherokee_server_t *srv)
ret_t
cherokee_server_get_active_conns (cherokee_server_t *srv, int *num)
{
- int active = 0;
- list_t *thread;
+ int active = 0;
+ cherokee_list_t *thread;
/* Active connections number
*/
@@ -1603,8 +1602,8 @@ cherokee_server_get_active_conns (cherokee_server_t *srv, int *num)
ret_t
cherokee_server_get_reusable_conns (cherokee_server_t *srv, int *num)
{
- int reusable = 0;
- list_t *thread, *i;
+ int reusable = 0;
+ cherokee_list_t *thread, *i;
/* Reusable connections
*/
@@ -1627,7 +1626,7 @@ cherokee_server_get_reusable_conns (cherokee_server_t *srv, int *num)
ret_t
cherokee_server_get_total_traffic (cherokee_server_t *srv, size_t *rx, size_t *tx)
{
- list_t *i;
+ cherokee_list_t *i;
*rx = srv->vserver_default->data.rx;
*tx = srv->vserver_default->data.tx;
@@ -1684,8 +1683,8 @@ cherokee_server_handle_panic (cherokee_server_t *srv)
ret_t
cherokee_server_del_connection (cherokee_server_t *srv, char *id_str)
{
- list_t *t, *c;
- culong_t id;
+ culong_t id;
+ cherokee_list_t *t, *c;
id = strtol (id_str, NULL, 10);
@@ -1707,8 +1706,8 @@ cherokee_server_del_connection (cherokee_server_t *srv, char *id_str)
ret_t
cherokee_server_set_backup_mode (cherokee_server_t *srv, cherokee_boolean_t active)
{
- ret_t ret;
- list_t *i;
+ ret_t ret;
+ cherokee_list_t *i;
ret = cherokee_logger_set_backup_mode (srv->vserver_default->logger, active);
if (unlikely (ret != ret_ok)) return ret;