Split libuev.c into smaller files to help linker

Split libuev.c into one file per watcher type, mostly to give a better
overview and ease of maintenance, but also to help the linker.

Unfortunately this steals a few bytes when linking a full blown app, but
for apps that, e.g., only need I/O watchers and no timers the resulting
binary will be smaller.  This applies to static binaries that are more
common in embedded systems.

$ size libuev.a libuev.so.1
   text	   data	    bss	    dec	    hex	filename
    999	      0	      0	    999	    3e7	main.o (ex libuev.a)
     90	      0	      0	     90	     5a	io.o (ex libuev.a)
    490	      0	      0	    490	    1ea	timer.o (ex libuev.a)
   4380	    696	      8	   5084	   13dc	libuev.so.1

Also, move uev.h back to top from include/libuev/uev.h since a separate
namespace is not needed after the removal of the OpenBSD queue.h copy.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson committed 2013-07-23 00:54:52 +02:00
1 parent 069294f28a
commit 9b5be13e62
7 files changed
+241 -128

No files matched your search

+1 -1
View File
@@ -27,7 +27,7 @@
#include <stdio.h>
#include <unistd.h> /* intptr_t */
#include "libuev/uev.h"
#include "uev.h"
static int in, out;
static int period = 0;