Move include files into a separate directory and cleanup include order

personal/stbuehler/wip
Stefan Bühler 14 years ago
parent 358b9f95f1
commit 3dceeb5916

@ -2,7 +2,7 @@
#define _LIGHTTPD_ACTIONS_H_
#ifndef _LIGHTTPD_BASE_H_
#error Please include "base.h" instead of this file
#error Please include <lighttpd/base.h> instead of this file
#endif
/* action type */

@ -1,7 +1,7 @@
#ifndef _LIGHTTPD_ACTIONS_LUA_H_
#define _LIGHTTPD_ACTIONS_LUA_H_
#include "base.h"
#include <lighttpd/base.h>
#include <lua.h>
action* lua_get_action(lua_State *L, int ndx);

@ -0,0 +1,52 @@
#ifndef _LIGHTTPD_BASE_H_
#define _LIGHTTPD_BASE_H_
#include <lighttpd/settings.h>
/* Next try to fix strict-alias warning */
#undef ev_init
#define ev_init(ev,cb_) do { \
ev_watcher *ew = (ev_watcher *)(void *)ev; \
(ew)->active = \
(ew)->pending = \
(ew)->priority = 0; \
ev_set_cb ((ev), cb_); \
} while (0)
#undef ev_timer_set
#define ev_timer_set(ev,after_,repeat_) do { \
ev_watcher_time *ew = (ev_watcher_time *)(ev); \
ew->at = (after_); \
(ev)->repeat = (repeat_); \
} while (0)
#include <lighttpd/typedefs.h>
#include <lighttpd/utils.h>
#include <lighttpd/module.h>
#include <lighttpd/chunk.h>
#include <lighttpd/chunk_parser.h>
#include <lighttpd/server.h>
#include <lighttpd/worker.h>
#include <lighttpd/condition.h>
#include <lighttpd/options.h>
#include <lighttpd/value.h>
#include <lighttpd/actions.h>
#include <lighttpd/plugin.h>
#include <lighttpd/http_headers.h>
#include <lighttpd/http_request_parser.h>
#include <lighttpd/request.h>
#include <lighttpd/response.h>
#include <lighttpd/virtualrequest.h>
#include <lighttpd/log.h>
#include <lighttpd/connection.h>
#include <lighttpd/network.h>
#include <lighttpd/collect.h>
#include <lighttpd/utils.h>
#define SERVER_VERSION ((guint) 0x01FF0000)
#endif

@ -2,7 +2,7 @@
#define _LIGHTTPD_CHUNK_H_
#ifndef _LIGHTTPD_BASE_H_
#error Please include "base.h" instead of this file
#error Please include <lighttpd/base.h> instead of this file
#endif
/* Open a file only once, so it shouldn't get lost;

@ -2,7 +2,7 @@
#define _LIGHTTPD_CHUNK_PARSER_H_
#ifndef _LIGHTTPD_BASE_H_
#error Please include "base.h" instead of this file
#error Please include <lighttpd/base.h> instead of this file
#endif
struct chunk_parser_ctx {

@ -2,7 +2,7 @@
#define _LIGHTTPD_COLLECT_H_
#ifndef _LIGHTTPD_BASE_H_
#error Please include "base.h" instead of this file
#error Please include <lighttpd/base.h> instead of this file
#endif
/* executes a function in each worker context */

@ -2,7 +2,7 @@
#define _LIGHTTPD_CONDITION_H_
#ifndef _LIGHTTPD_BASE_H_
#error Please include "base.h" instead of this file
#error Please include <lighttpd/base.h> instead of this file
#endif
/**
@ -94,7 +94,7 @@ struct condition_rvalue {
} ipv6;
};
#include "base.h"
#include <lighttpd/base.h>
struct condition {
int refcount;

@ -1,7 +1,7 @@
#ifndef _LIGHTTPD_CONDITION_LUA_H_
#define _LIGHTTPD_CONDITION_LUA_H_
#include "base.h"
#include <lighttpd/base.h>
#include <lua.h>
condition* lua_get_condition(lua_State *L, int ndx);

@ -1,7 +1,7 @@
#ifndef _LIGHTTPD_CONFIG_LUA_H_
#define _LIGHTTPD_CONFIG_LUA_H_
#include "base.h"
#include <lighttpd/base.h>
LI_API gboolean config_lua_load(server *srv, const gchar *filename);

@ -1,7 +1,7 @@
#ifndef _LIGHTTPD_CONFIGPARSER_H_
#define _LIGHTTPD_CONFIGPARSER_H_
#include "base.h"
#include <lighttpd/base.h>
struct config_parser_context_t;
typedef struct config_parser_context_t config_parser_context_t;

@ -2,7 +2,7 @@
#define _LIGHTTPD_CONNECTION_H_
#ifndef _LIGHTTPD_BASE_H_
#error Please include "base.h" instead of this file
#error Please include <lighttpd/base.h> instead of this file
#endif
typedef enum {

@ -1,7 +1,7 @@
#ifndef _LIGHTTPD_FILTER_CHUNKED_H_
#define _LIGHTTPD_FILTER_CHUNKED_H_
#include "base.h"
#include <lighttpd/base.h>
LI_API handler_t filter_chunked_encode(connection *con, chunkqueue *out, chunkqueue *in);
LI_API handler_t filter_chunked_decode(connection *con, chunkqueue *out, chunkqueue *in);

@ -2,7 +2,7 @@
#define _LIGHTTPD_HTTP_HEADERS_H_
#ifndef _LIGHTTPD_BASE_H_
#error Please include "base.h" instead of this file
#error Please include <lighttpd/base.h> instead of this file
#endif
#define HEADER_VALUE(h) \

@ -2,7 +2,7 @@
#define _LIGHTTPD_HTTP_REQUEST_PARSER_H_
#ifndef _LIGHTTPD_BASE_H_
#error Please include "base.h" instead of this file
#error Please include <lighttpd/base.h> instead of this file
#endif
struct http_request_ctx;

@ -2,10 +2,10 @@
#define _LIGHTTPD_LOG_H_
#ifndef _LIGHTTPD_BASE_H_
#error Please include "base.h" instead of this file
#error Please include <lighttpd/base.h> instead of this file
#endif
/* #include "valgrind/valgrind.h" */
/* #include <lighttpd/valgrind/valgrind.h> */
#define REMOVE_PATH_FROM_FILE 1
#if REMOVE_PATH_FROM_FILE

@ -1,7 +1,7 @@
#ifndef _LIGHTTPD_MODULE_H_
#define _LIGHTTPD_MODULE_H_
#include "settings.h"
#include <lighttpd/settings.h>
#define MODULE_VERSION ((guint) 0x00000001)
#define MODULE_VERSION_CHECK(mods) do { \

@ -2,7 +2,7 @@
#define _LIGHTTPD_NETWORK_H_
#ifndef _LIGHTTPD_BASE_H_
#error Please include "base.h" instead of this file
#error Please include <lighttpd/base.h> instead of this file
#endif
typedef enum {

@ -2,7 +2,7 @@
#define _LIGHTTPD_OPTIONS_H_
#ifndef _LIGHTTPD_BASE_H_
#error Please include "base.h" instead of this file
#error Please include <lighttpd/base.h> instead of this file
#endif
union option_value {

@ -2,7 +2,7 @@
#define _LIGHTTPD_PLUGIN_H_
#ifndef _LIGHTTPD_BASE_H_
#error Please include "base.h" instead of this file
#error Please include <lighttpd/base.h> instead of this file
#endif
#define INIT_FUNC(x) \

@ -1,7 +1,7 @@
#ifndef _LIGHTTPD_PLUGIN_CORE_H_
#define _LIGHTTPD_PLUGIN_CORE_H_
#include "base.h"
#include <lighttpd/base.h>
enum core_options_t {
CORE_OPTION_DEBUG_REQUEST_HANDLING = 0,

@ -2,7 +2,7 @@
#define _LIGHTTPD_REQUEST_H_
#ifndef _LIGHTTPD_BASE_H_
#error Please include "base.h" instead of this file
#error Please include <lighttpd/base.h> instead of this file
#endif
struct request_uri {

@ -2,7 +2,7 @@
#define _LIGHTTPD_RESPONSE_H_
#ifndef _LIGHTTPD_BASE_H_
#error Please include "base.h" instead of this file
#error Please include <lighttpd/base.h> instead of this file
#endif
struct response {

@ -2,7 +2,7 @@
#define _LIGHTTPD_SETTINGS_H_
#ifdef HAVE_CONFIG_H
#include "config.h"
#include <lighttpd/config.h>
#endif
#if defined HAVE_LIBSSL && defined HAVE_OPENSSL_SSL_H
@ -193,10 +193,10 @@
# define INLINE static
#endif
#include "sys-files.h"
#include "sys-mmap.h"
#include "sys-process.h"
#include "sys-socket.h"
#include "sys-strings.h"
#include <lighttpd/sys-files.h>
#include <lighttpd/sys-mmap.h>
#include <lighttpd/sys-process.h>
#include <lighttpd/sys-socket.h>
#include <lighttpd/sys-strings.h>
#endif

@ -6,7 +6,7 @@
#define DIR_SEPERATOR_WIN '\\'
#define DIR_SEPERATOR_WIN_STR "\\"
#include "settings.h"
#include <lighttpd/settings.h>
#ifdef _WIN32
#include <windows.h>

@ -1,7 +1,7 @@
#ifndef WIN32_MMAP_H
#define WIN32_MMAP_H
#include "settings.h"
#include <lighttpd/settings.h>
#ifdef _WIN32

@ -2,7 +2,7 @@
#define SYS_SOCKET_H
#ifdef HAVE_CONFIG_H
#include "config.h"
#include <lighttpd/config.h>
#endif
#ifdef _WIN32

@ -1,7 +1,7 @@
#ifndef _LIGHTTPD_URL_PARSER_H_
#define _LIGHTTPD_URL_PARSER_H_
#include "base.h"
#include <lighttpd/base.h>
LI_API gboolean parse_raw_url(request_uri *uri);
LI_API gboolean parse_hostname(request_uri *uri);

@ -2,7 +2,7 @@
#define _LIGHTTPD_UTILS_H_
#ifndef _LIGHTTPD_BASE_H_
#error Please include "base.h" instead of this file
#error Please include <lighttpd/base.h> instead of this file
#endif
typedef enum {

@ -2,7 +2,7 @@
#define _LIGHTTPD_VALUE_H_
#ifndef _LIGHTTPD_BASE_H_
#error Please include "base.h" instead of this file
#error Please include <lighttpd/base.h> instead of this file
#endif
struct value {

@ -1,7 +1,7 @@
#ifndef _LIGHTTPD_OPTIONS_LUA_H_
#define _LIGHTTPD_OPTIONS_LUA_H_
#include "base.h"
#include <lighttpd/base.h>
#include <lua.h>
/* converts the top of the stack into an value

@ -2,7 +2,7 @@
#define _LIGHTTPD_VIRTUALREQUEST_H_
#ifndef _LIGHTTPD_BASE_H_
#error Please include "base.h" instead of this file
#error Please include <lighttpd/base.h> instead of this file
#endif
typedef enum {

@ -2,7 +2,7 @@
#define _LIGHTTPD_WORKER_H_
#ifndef _LIGHTTPD_BASE_H_
#error Please include "base.h" instead of this file
#error Please include <lighttpd/base.h> instead of this file
#endif
struct statistics_t;

@ -131,9 +131,6 @@ MACRO(XCONFIG _package _include_DIR _link_DIR _link_FLAGS _cflags)
ENDIF(${_package}CONFIG_EXECUTABLE)
ENDMACRO(XCONFIG _package _include_DIR _link_DIR _link_FLAGS _cflags)
##INCLUDE_DIRECTORIES(${GTHREAD_INCDIR})
ADD_DEFINITIONS(${GTHREAD_CFLAGS})
IF(WITH_XATTR)
CHECK_INCLUDE_FILES(attr/attributes.h HAVE_ATTR_ATTRIBUTES_H)
ENDIF(WITH_XATTR)
@ -219,7 +216,6 @@ ENDIF(WITH_PCRE)
# glib/gthread
pkg_check_modules(GTHREAD REQUIRED gthread-2.0)
pkg_check_modules(GMODULE REQUIRED gmodule-2.0)
#INCLUDE_DIRECTORIES(${GTHREAD_INCLUDE_DIRS})
IF(WITH_LUA)
pkg_search_module(LUA REQUIRED lua lua5.1)
@ -259,11 +255,11 @@ ADD_DEFINITIONS(
ENDIF(NOT WIN32)
## Write out config.h
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_BINARY_DIR}/include/lighttpd/config.h)
ADD_DEFINITIONS(-DHAVE_CONFIG_H)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/include ${CMAKE_BINARY_DIR}/include)
SET(COMMON_SRC
actions.c

@ -1,5 +1,5 @@
#include "base.h"
#include <lighttpd/base.h>
struct action_stack_element;
typedef struct action_stack_element action_stack_element;

@ -1,5 +1,5 @@
#include "actions_lua.h"
#include <lighttpd/actions_lua.h>
#include <lualib.h>
#include <lauxlib.h>

@ -1,3 +1,3 @@
#include "base.h"
#include <lighttpd/base.h>

@ -1,53 +0,0 @@
#ifndef _LIGHTTPD_BASE_H_
#define _LIGHTTPD_BASE_H_
#include "settings.h"
/* Next try to fix strict-alias warning */
#undef ev_init
#define ev_init(ev,cb_) do { \
ev_watcher *ew = (ev_watcher *)(void *)ev; \
(ew)->active = \
(ew)->pending = \
(ew)->priority = 0; \
ev_set_cb ((ev), cb_); \
} while (0)
#undef ev_timer_set
#define ev_timer_set(ev,after_,repeat_) do { \
ev_watcher_time *ew = (ev_watcher_time *)(ev); \
ew->at = (after_); \
(ev)->repeat = (repeat_); \
} while (0)
#include "typedefs.h"
#include "utils.h"
#include "module.h"
#include "chunk.h"
#include "chunk_parser.h"
#include "server.h"
#include "worker.h"
#include "condition.h"
#include "options.h"
#include "value.h"
#include "actions.h"
#include "plugin.h"
#include "http_headers.h"
#include "http_request_parser.h"
#include "request.h"
#include "response.h"
#include "virtualrequest.h"
#include "log.h"
#include "connection.h"
#include "network.h"
#include "collect.h"
#include "utils.h"
#define SERVER_VERSION ((guint) 0x01FF0000)
#endif

@ -1,5 +1,5 @@
#include "base.h"
#include <lighttpd/base.h>
#include <sys/stat.h>
#include <fcntl.h>

@ -1,5 +1,5 @@
#include "base.h"
#include <lighttpd/base.h>
void chunk_parser_init(chunk_parser_ctx *ctx, chunkqueue *cq) {
ctx->cq = cq;

@ -1,5 +1,5 @@
#include "base.h"
#include <lighttpd/base.h>
struct collect_job;
typedef struct collect_job collect_job;

@ -1,4 +1,4 @@
#include "base.h"
#include <lighttpd/base.h>
static gboolean condition_parse_ip(condition_rvalue *val, const char *txt) {
if (parse_ipv4(txt, &val->ipv4.addr, NULL)) {

@ -1,6 +1,6 @@
#include "condition_lua.h"
#include "value_lua.h"
#include <lighttpd/condition_lua.h>
#include <lighttpd/value_lua.h>
#include <lualib.h>
#include <lauxlib.h>

@ -1,5 +1,5 @@
#include "base.h"
#include <lighttpd/base.h>
%%{
machine ipv4_parser;

@ -1,8 +1,8 @@
#include "config_lua.h"
#include "condition_lua.h"
#include "value_lua.h"
#include "actions_lua.h"
#include <lighttpd/config_lua.h>
#include <lighttpd/condition_lua.h>
#include <lighttpd/value_lua.h>
#include <lighttpd/actions_lua.h>
#include <lualib.h>
#include <lauxlib.h>

@ -1,6 +1,5 @@
#include "base.h"
#include "condition.h"
#include "config_parser.h"
#include <lighttpd/base.h>
#include <lighttpd/config_parser.h>
#if 0
#define _printf(fmt, ...) g_print(fmt, __VA_ARGS__)

@ -1,6 +1,6 @@
#include "base.h"
#include "plugin_core.h"
#include <lighttpd/base.h>
#include <lighttpd/plugin_core.h>
/* only call it from the worker context the con belongs to */
void worker_con_put(connection *con); /* worker.c */

@ -1,5 +1,5 @@
#include "filter_chunked.h"
#include <lighttpd/filter_chunked.h>
/* len != 0 */
static void http_chunk_append_len(chunkqueue *cq, size_t len) {

@ -1,5 +1,5 @@
#include "base.h"
#include <lighttpd/base.h>
static void _http_header_free(gpointer p) {
http_header *h = (http_header*) p;

@ -1,6 +1,6 @@
#include "base.h"
#include "http_request_parser.h"
#include <lighttpd/base.h>
#include <lighttpd/http_request_parser.h>
/** Machine **/

@ -1,10 +1,10 @@
#include "base.h"
#include "config_parser.h"
#include "profiler.h"
#include <lighttpd/base.h>
#include <lighttpd/config_parser.h>
#include <lighttpd/profiler.h>
#ifdef HAVE_LUA_H
#include "config_lua.h"
#include <lighttpd/config_lua.h>
#endif
void plugin_core_init(server *srv, plugin *p);

@ -1,6 +1,6 @@
#include "base.h"
#include "plugin_core.h"
#include <lighttpd/base.h>
#include <lighttpd/plugin_core.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdarg.h>

@ -1,5 +1,5 @@
#include "module.h"
#include <lighttpd/module.h>
modules *modules_init(gpointer main, const gchar *module_dir) {
modules *m = g_slice_new(modules);

@ -25,7 +25,7 @@
* }
*/
#include "base.h"
#include <lighttpd/base.h>
/* globals */
struct fortune_data;

@ -1,5 +1,5 @@
#include "base.h"
#include <lighttpd/base.h>
/** repeats write after EINTR */
ssize_t net_write(int fd, void *buf, ssize_t nbyte) {

@ -1,6 +1,6 @@
#include "base.h"
#include "plugin_core.h"
#include <lighttpd/base.h>
#include <lighttpd/plugin_core.h>
/* first chunk must be a FILE_CHUNK ! */
network_status_t network_backend_sendfile(vrequest *vr, int fd, chunkqueue *cq, goffset *write_max) {

@ -1,5 +1,5 @@
#include "base.h"
#include <lighttpd/base.h>
network_status_t network_backend_write(vrequest *vr, int fd, chunkqueue *cq, goffset *write_max) {
const ssize_t blocksize = 16*1024; /* 16k */

@ -1,5 +1,5 @@
#include "base.h"
#include <lighttpd/base.h>
#include <sys/uio.h>

@ -1,5 +1,5 @@
#include "base.h"
#include <lighttpd/base.h>
/* Extract ovalue from ovalue, ovalue set to none */
option_value value_extract(value *val) {

@ -1,5 +1,5 @@
#include "base.h"
#include <lighttpd/base.h>
static gboolean plugin_load_default_option(server *srv, server_option *sopt);
static void plugin_free_default_options(server *srv, plugin *p);

@ -1,7 +1,7 @@
#include "base.h"
#include "plugin_core.h"
#include "profiler.h"
#include <lighttpd/base.h>
#include <lighttpd/plugin_core.h>
#include <lighttpd/profiler.h>
#include <sys/stat.h>
#include <fcntl.h>

@ -6,8 +6,8 @@
*/
#include "base.h"
#include "profiler.h"
#include <lighttpd/base.h>
#include <lighttpd/profiler.h>
#define PROFILER_HASHTABLE_SIZE 1024

@ -1,6 +1,6 @@
#include "base.h"
#include "url_parser.h"
#include <lighttpd/base.h>
#include <lighttpd/url_parser.h>
void request_init(request *req) {
req->http_method = HTTP_METHOD_UNSET;

@ -1,6 +1,6 @@
#include "base.h"
#include "plugin_core.h"
#include <lighttpd/base.h>
#include <lighttpd/plugin_core.h>
void response_init(response *resp) {
resp->headers = http_headers_new();

@ -1,6 +1,6 @@
#include "base.h"
#include "plugin_core.h"
#include <lighttpd/base.h>
#include <lighttpd/plugin_core.h>
static void server_value_free(gpointer _so) {
g_slice_free(server_option, _so);

@ -1,4 +1,4 @@
#include "sys-files.h"
#include <lighttpd/sys-files.h>
#ifdef _WIN32
DIR *opendir(const char *dn) {

@ -1,5 +1,5 @@
#include "base.h"
#include "sys-socket.h"
#include <lighttpd/base.h>
#include <lighttpd/sys-socket.h>
#ifndef HAVE_INET_ATON
/* win32 has inet_addr instead if inet_aton */

@ -1,9 +1,9 @@
#include <stdio.h>
#include "base.h"
#include <lighttpd/base.h>
#include "config_parser.h"
#include <lighttpd/config_parser.h>
int request_test() {
chunkqueue *cq;

@ -1,5 +1,5 @@
#include "base.h"
#include <lighttpd/base.h>
#include <stdlib.h>

@ -1,7 +1,7 @@
#include "base.h"
#include "plugin_core.h"
#include <lighttpd/base.h>
#include <lighttpd/plugin_core.h>
#include <stdio.h>
#include <stdlib.h>

@ -1,4 +1,4 @@
#include "base.h"
#include <lighttpd/base.h>
value* value_new_bool(gboolean val) {
value *v = g_slice_new0(value);

@ -1,7 +1,7 @@
#include "value_lua.h"
#include "condition_lua.h"
#include "actions_lua.h"
#include <lighttpd/value_lua.h>
#include <lighttpd/condition_lua.h>
#include <lighttpd/actions_lua.h>
/* replace a negative stack index with a positive one,
* so that you don't need to care about push/pop

@ -1,6 +1,6 @@
#include "base.h"
#include "plugin_core.h"
#include <lighttpd/base.h>
#include <lighttpd/plugin_core.h>
static filter* filter_new() {
filter *f = g_slice_new0(filter);

@ -1,7 +1,7 @@
#include <sched.h>
#include "base.h"
#include <lighttpd/base.h>
static connection* worker_con_get(worker *wrk);
void worker_con_put(connection *con);

Loading…
Cancel
Save