option(LWS_WITH_ACCESS_LOG "Support generating Apache-compatible access logs" OFF)
option(LWS_WITH_SERVER_STATUS "Support json + jscript server monitoring" OFF)
option(LWS_WITH_LEJP "With the Lightweight JSON Parser" OFF)
+option(LWS_WITH_LEJP_CONF "With LEJP configuration parser as used by lwsws" OFF)
if (LWS_WITH_LWSWS)
message(STATUS "LWS_WITH_LWSWS --> Enabling LWS_WITH_PLUGINS and LWS_WITH_LIBUV")
set(LWS_WITH_ACCESS_LOG 1)
set(LWS_WITH_SERVER_STATUS 1)
set(LWS_WITH_LEJP 1)
+ set(LWS_WITH_LEJP_CONF 1)
endif()
if (LWS_WITH_PLUGINS AND NOT LWS_WITH_LIBUV)
list(APPEND HDR_PUBLIC
lib/lejp.h)
endif()
+if (LWS_WITH_LEJP_CONF)
+ list(APPEND SOURCES
+ "lib/lejp-conf.c"
+ )
+endif()
# Add helper files for Windows.
if (WIN32)
if (LWS_WITH_LWSWS)
list(APPEND LWSWS_SRCS
"lwsws/main.c"
- "lwsws/conf.c"
)
if (WIN32)
PROPERTY COMPILE_DEFINITIONS
INSTALL_DATADIR="${CMAKE_INSTALL_PREFIX}/share"
)
-
-
endif (LWS_WITH_LWSWS)
if (UNIX)
message(" LWS_WITH_ACCESS_LOG = ${LWS_WITH_ACCESS_LOG}")
message(" LWS_WITH_SERVER_STATUS = ${LWS_WITH_SERVER_STATUS}")
message(" LWS_WITH_LEJP = ${LWS_WITH_LEJP}")
-message(" LWS_WITH_GENERIC_SESSIONS = ${LWS_WITH_GENERIC_SESSIONS}")
+message(" LWS_WITH_LEJP_CONF = ${LWS_WITH_LEJP_CONF}")
message("---------------------------------------------------------------------")
# These will be available to parent projects including libwebsockets using add_subdirectory()
* MA 02110-1301 USA
*/
-#include "lwsws.h"
+#include "private-libwebsockets.h"
+#include "lejp.h"
+
+#ifndef _WIN32
+/* this is needed for Travis CI */
+#include <dirent.h>
+#endif
static const char * const paths_global[] = {
"global.uid",
lws_http_client_read(struct lws *wsi, char **buf, int *len);
/*
+ * lejp conf parsers
+ */
+LWS_VISIBLE LWS_EXTERN int
+lwsws_get_config_globals(struct lws_context_creation_info *info, const char *d,
+ char **config_strings, int *len);
+
+LWS_VISIBLE LWS_EXTERN int
+lwsws_get_config_vhosts(struct lws_context *context,
+ struct lws_context_creation_info *info, const char *d,
+ char **config_strings, int *len);
+
+/*
* Wsi-associated File Operations access helpers
*
* Use these helper functions if you want to access a file from the perspective
+++ /dev/null
-#if defined(_WIN32) && defined(EXTERNAL_POLL)
-#define WINVER 0x0600
-#define _WIN32_WINNT 0x0600
-#define poll(fdArray, fds, timeout) WSAPoll((LPWSAPOLLFD)(fdArray), (ULONG)(fds), (INT)(timeout))
-#endif
-
-#include "lws_config.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <getopt.h>
-#include <signal.h>
-#include <string.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <assert.h>
-#ifndef _WIN32
-#include <dirent.h>
-#endif
-
-#include "../lib/libwebsockets.h"
-#include "lejp.h"
-
-#ifdef _WIN32
-#include <io.h>
-#include "gettimeofday.h"
-#else
-#include <syslog.h>
-#include <sys/time.h>
-#include <unistd.h>
-#endif
-
-
-#ifndef __func__
-#define __func__ __FUNCTION__
-#endif
-
-extern int
-lwsws_get_config_globals(struct lws_context_creation_info *info, const char *d,
- char **config_strings, int *len);
-
-extern int
-lwsws_get_config_vhosts(struct lws_context *context,
- struct lws_context_creation_info *info, const char *d,
- char **config_strings, int *len);
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301 USA
*/
+#include "lws_config.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <getopt.h>
+#include <signal.h>
+#include <string.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <assert.h>
+#ifndef _WIN32
+#include <dirent.h>
+#include <syslog.h>
+#include <sys/time.h>
+#include <unistd.h>
+#else
+#include <io.h>
+#include "gettimeofday.h"
+#endif
-#include "lwsws.h"
+#include "../lib/libwebsockets.h"
static struct lws_context *context;