Optimize directory organization structure
Signed-off-by: Jianhui Zhao <jianhuizhao329@gmail.com>
This commit is contained in:
1 parent
9cc3836868
commit
32f478f370
16 files changed
+49
-27
No files matched your search
+19
-8
@@ -3,16 +3,14 @@ set(UHTTP_VERSION_MAJOR 0)
|
||||
set(UHTTP_VERSION_MINOR 1)
|
||||
set(UHTTP_VERSION_PATCH 0)
|
||||
|
||||
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
# Check the third party Libraries
|
||||
find_package(Libev REQUIRED)
|
||||
find_package(OpenSSL)
|
||||
find_package(CyaSSL)
|
||||
|
||||
include_directories(${LIBEV_INCLUDE_DIRS} ${HTTPPARSER_INCLUDE_DIRS})
|
||||
set(EXTRA_LIBS ${LIBEV_LIBRARIES} ${HTTPPARSER_LIBRARIES})
|
||||
set(SOURCE_FILES uhttp.c uhttp_log.c uhttp_buf.c uhttp_ssl.c http_parser.c)
|
||||
include_directories(${LIBEV_INCLUDE_DIRS})
|
||||
set(EXTRA_LIBS ${LIBEV_LIBRARIES})
|
||||
set(SOURCE_FILES uhttp.c log.c buf.c ssl.c http_parser.c)
|
||||
|
||||
set(UHTTP_DEBUG_CONFIG 0)
|
||||
option(UHTTP_DEBUG "Turn on debug" OFF)
|
||||
@@ -78,11 +76,24 @@ set_target_properties(uhttp PROPERTIES VERSION ${UHTTP_VERSION_MAJOR}.${UHTTP_VE
|
||||
target_link_libraries(uhttp ${EXTRA_LIBS})
|
||||
|
||||
# configure a header file to pass some of the CMake settings to the source code
|
||||
configure_file(uhttp_config.h.in ${CMAKE_CURRENT_BINARY_DIR}/uhttp_config.h)
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/include/uhttp/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/include/uhttp/config.h)
|
||||
|
||||
install(
|
||||
FILES uhttp.h ${CMAKE_CURRENT_BINARY_DIR}/uhttp_config.h uhttp_log.h uhttp_buf.h
|
||||
DESTINATION include/uhttp
|
||||
FILES
|
||||
${CMAKE_CURRENT_BINARY_DIR}/include/uhttp/config.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/include/uhttp/uhttp.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/include/uhttp/log.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/include/uhttp/buf.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/include/uhttp/http_parser.h
|
||||
DESTINATION
|
||||
include/uhttp
|
||||
)
|
||||
|
||||
install(
|
||||
FILES
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/include/uhttp.h
|
||||
DESTINATION
|
||||
include
|
||||
)
|
||||
|
||||
install(
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
#include "uhttp_buf.h"
|
||||
#include "uhttp_log.h"
|
||||
#include "uhttp/buf.h"
|
||||
#include "uhttp/log.h"
|
||||
|
||||
int uh_buf_init(struct uh_buf *buf, size_t initial_size)
|
||||
{
|
||||
@@ -1,9 +1,9 @@
|
||||
#ifndef _UHTTP_INTERNAL_H
|
||||
#define _UHTTP_INTERNAL_H
|
||||
|
||||
#include "http_parser.h"
|
||||
#include "uhttp/http_parser.h"
|
||||
#include "list.h"
|
||||
#include "uhttp.h"
|
||||
#include "uhttp/uhttp.h"
|
||||
|
||||
#define UH_BUFFER_SIZE 2048
|
||||
#define UH_CONNECTION_TIMEOUT 30
|
||||
File renamed without changes.
Executable
+6
@@ -0,0 +1,6 @@
|
||||
#ifndef _UHTTP_BASE_H
|
||||
#define _UHTTP_BASE_H
|
||||
|
||||
#include "uhttp/uhttp.h"
|
||||
|
||||
#endif
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -6,7 +6,7 @@
|
||||
#include <stdarg.h>
|
||||
#include <errno.h>
|
||||
#include <syslog.h>
|
||||
#include "uhttp_config.h"
|
||||
#include "uhttp/config.h"
|
||||
|
||||
#define __FILENAME__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef _UHTTP_SSL_H
|
||||
#define _UHTTP_SSL_H
|
||||
|
||||
#include "uhttp_internal.h"
|
||||
#include "internal.h"
|
||||
|
||||
#if (UHTTP_USE_OPENSSL)
|
||||
#include <openssl/ssl.h>
|
||||
@@ -2,9 +2,9 @@
|
||||
#define _UHTTP_H
|
||||
|
||||
#include <ev.h>
|
||||
#include "uhttp_config.h"
|
||||
#include "uhttp_log.h"
|
||||
#include "uhttp_buf.h"
|
||||
#include "uhttp/config.h"
|
||||
#include "uhttp/log.h"
|
||||
#include "uhttp/buf.h"
|
||||
|
||||
/* HTTP Status Codes */
|
||||
#define UH_STATUS_MAP(XX) \
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "uhttp_log.h"
|
||||
#include "uhttp/log.h"
|
||||
|
||||
void __uh_log(const char *filename, int line, int priority, const char *format, ...)
|
||||
{
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "uhttp_ssl.h"
|
||||
#include "uhttp/ssl.h"
|
||||
#include <unistd.h>
|
||||
#include <sys/socket.h>
|
||||
|
||||
+3
-3
@@ -5,9 +5,9 @@
|
||||
#include <assert.h>
|
||||
#include <arpa/inet.h>
|
||||
|
||||
#include "uhttp.h"
|
||||
#include "uhttp_internal.h"
|
||||
#include "uhttp_ssl.h"
|
||||
#include "uhttp/uhttp.h"
|
||||
#include "internal.h"
|
||||
#include "uhttp/ssl.h"
|
||||
|
||||
const char *uh_version()
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user