[Libwebsockets] [PATCH 04/11] libev: rename to lib/event-libev.c

Alejandro Mery amery at geeks.cl
Tue Dec 16 00:36:25 CET 2014


Signed-off-by: Alejandro Mery <amery at geeks.cl>
---
 CMakeLists.txt    |  2 +-
 lib/event-libev.c | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 lib/libev.c       | 70 -------------------------------------------------------
 3 files changed, 71 insertions(+), 71 deletions(-)
 create mode 100644 lib/event-libev.c
 delete mode 100644 lib/libev.c

diff --git a/CMakeLists.txt b/CMakeLists.txt
index d890ef5..75a29cd 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -335,7 +335,7 @@ endif()
 
 if (LWS_WITH_LIBEV)
 	list(APPEND SOURCES
-		lib/libev.c
+		lib/event-libev.c
 		)
 endif(LWS_WITH_LIBEV)
 
diff --git a/lib/event-libev.c b/lib/event-libev.c
new file mode 100644
index 0000000..8fcc3d7
--- /dev/null
+++ b/lib/event-libev.c
@@ -0,0 +1,70 @@
+/*
+ * libwebsockets - small server side websockets and web server implementation
+ *
+ * Copyright (C) 2010-2014 Andy Green <andy at warmcat.com>
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation:
+ *  version 2.1 of the License.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ *  MA  02110-1301  USA
+ */
+
+#include "private-libwebsockets.h"
+
+static int
+libev_init(struct lws_context_creation_info *info,
+	   struct libwebsocket_context *context)
+{
+	struct _lws_libev_event_info *evi = &info->e.ev;
+	struct _lws_libev_event_context *evc = &context->e.ev;
+	int backend;
+	const char * backend_name;
+
+	if (!evi->loop)
+		evi->loop = ev_default_loop(0);
+
+	evc->loop = evi->loop;
+	backend = ev_backend(evc->loop);
+
+	switch (backend) {
+	case EVBACKEND_SELECT:
+		backend_name = "select";
+		break;
+	case EVBACKEND_POLL:
+		backend_name = "poll";
+		break;
+	case EVBACKEND_EPOLL:
+		backend_name = "epoll";
+		break;
+	case EVBACKEND_KQUEUE:
+		backend_name = "kqueue";
+		break;
+	case EVBACKEND_DEVPOLL:
+		backend_name = "/dev/poll";
+		break;
+	case EVBACKEND_PORT:
+		backend_name = "Solaris 10 \"port\"";
+		break;
+	default:
+		backend_name = "Unknown libev backend";
+		break;
+	};
+
+	lwsl_notice(" libev backend: %s\n", backend_name);
+
+	return 0;
+}
+
+struct lws_event_ops lws_libev_event_ops = {
+	.init = libev_init,
+};
diff --git a/lib/libev.c b/lib/libev.c
deleted file mode 100644
index 8fcc3d7..0000000
--- a/lib/libev.c
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * libwebsockets - small server side websockets and web server implementation
- *
- * Copyright (C) 2010-2014 Andy Green <andy at warmcat.com>
- *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation:
- *  version 2.1 of the License.
- *
- *  This library is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- *  MA  02110-1301  USA
- */
-
-#include "private-libwebsockets.h"
-
-static int
-libev_init(struct lws_context_creation_info *info,
-	   struct libwebsocket_context *context)
-{
-	struct _lws_libev_event_info *evi = &info->e.ev;
-	struct _lws_libev_event_context *evc = &context->e.ev;
-	int backend;
-	const char * backend_name;
-
-	if (!evi->loop)
-		evi->loop = ev_default_loop(0);
-
-	evc->loop = evi->loop;
-	backend = ev_backend(evc->loop);
-
-	switch (backend) {
-	case EVBACKEND_SELECT:
-		backend_name = "select";
-		break;
-	case EVBACKEND_POLL:
-		backend_name = "poll";
-		break;
-	case EVBACKEND_EPOLL:
-		backend_name = "epoll";
-		break;
-	case EVBACKEND_KQUEUE:
-		backend_name = "kqueue";
-		break;
-	case EVBACKEND_DEVPOLL:
-		backend_name = "/dev/poll";
-		break;
-	case EVBACKEND_PORT:
-		backend_name = "Solaris 10 \"port\"";
-		break;
-	default:
-		backend_name = "Unknown libev backend";
-		break;
-	};
-
-	lwsl_notice(" libev backend: %s\n", backend_name);
-
-	return 0;
-}
-
-struct lws_event_ops lws_libev_event_ops = {
-	.init = libev_init,
-};
-- 
2.2.0




More information about the Libwebsockets mailing list