From 7bd84e78376e5f5b87349d00766b024964bb84b3 Mon Sep 17 00:00:00 2001 From: Robert Gustafsson Date: Thu, 28 Sep 2017 15:09:48 +0200 Subject: Add new main file --- broccoli/Makefile | 11 +++++++---- broccoli/broevent.c | 13 +------------ broccoli/includes/broevent.h | 5 +++++ broccoli/midbropasad.c | 12 ++++++++++++ 4 files changed, 25 insertions(+), 16 deletions(-) create mode 100644 broccoli/includes/broevent.h create mode 100644 broccoli/midbropasad.c diff --git a/broccoli/Makefile b/broccoli/Makefile index d895274..3fafbea 100644 --- a/broccoli/Makefile +++ b/broccoli/Makefile @@ -2,10 +2,13 @@ CC=gcc CFLAGS = -c -Wall -I/usr/local/include -I/usr/local/include -DBROCCOLI LDFLAGS = -L/usr/local/lib -lbroccoli -all: broevent +all: midbropasad -broevent: broevent.o fifoqueue.o - $(CC) broevent.o fifoqueue.o -o broevent $(LDFLAGS) +midbropasad: midbropasad.o broevent.o fifoqueue.o + $(CC) midbropasad.o broevent.o fifoqueue.o -o midbropasad $(LDFLAGS) + +midbropasad.o: midbropasad.c + $(CC) $(CFLAGS) midbropasad.c broevent.o: broevent.c $(CC) $(CFLAGS) broevent.c @@ -13,4 +16,4 @@ broevent.o: broevent.c fifoqueue.o: fifoqueue.c $(CC) -c -Wall fifoqueue.c clean: - rm *.o broevent + rm *.o midbropasad diff --git a/broccoli/broevent.c b/broccoli/broevent.c index a2b7a28..94d06b8 100644 --- a/broccoli/broevent.c +++ b/broccoli/broevent.c @@ -1,7 +1,5 @@ -#ifdef BROCCOLI -#include -#endif #include "includes/fifoqueue.h" +#include "includes/broevent.h" char *host_default = "127.0.0.1"; char *port_default = "47760"; @@ -60,12 +58,3 @@ bro_event_listener() bro_conn_delete(bc); } - - int -main(int argc, char **argv) -{ - Fifo_q * q = init_queue(5); - - free(q); - return 0; -} diff --git a/broccoli/includes/broevent.h b/broccoli/includes/broevent.h new file mode 100644 index 0000000..4021737 --- /dev/null +++ b/broccoli/includes/broevent.h @@ -0,0 +1,5 @@ +#ifdef BROCCOLI +#include +#endif + +void bro_event_listener(); diff --git a/broccoli/midbropasad.c b/broccoli/midbropasad.c new file mode 100644 index 0000000..5c0c413 --- /dev/null +++ b/broccoli/midbropasad.c @@ -0,0 +1,12 @@ +#include "includes/fifoqueue.h" +#include "includes/broevent.h" + + int +main(int argc, char **argv) +{ + Fifo_q * q = init_queue(5); + bro_event_listener(); + + free(q); + return 0; +} -- cgit v1.2.3