Move the main function to main.c

Move the main function to main.c in the git root to allow for
alternative main functions to be linked in its place. Specifically this
will be used to link the test runner main to run tests.
This commit is contained in:
Nikos Tsipinakis 2016-11-19 12:15:39 +02:00
parent 32fb32f96f
commit e0a8b233c2
4 changed files with 13 additions and 4 deletions

View File

@ -33,9 +33,9 @@ config.h: config.def.h
@echo creating $@ from $<
@cp $< $@
dunst: ${OBJ}
dunst: ${OBJ} main.o
@echo "${CC} ${CFLAGS} -o $@ ${OBJ} ${LDFLAGS}"
@${CC} ${CFLAGS} -o $@ ${OBJ} ${LDFLAGS}
@${CC} ${CFLAGS} -o $@ ${OBJ} main.o ${LDFLAGS}
dunstify:
@${CC} ${CFLAGS} -o $@ dunstify.c -std=c99 $(shell pkg-config --libs --cflags glib-2.0 libnotify)
@ -45,7 +45,7 @@ debug: ${OBJ}
@${CC} ${CFLAGS} -O0 -o dunst ${OBJ} ${LDFLAGS}
clean-dunst:
rm -f dunst ${OBJ}
rm -f dunst ${OBJ} main.o
rm -f org.knopwob.dunst.service
clean-dunstify:

7
main.c Normal file
View File

@ -0,0 +1,7 @@
#include "src/dunst.h"
int main(int argc, char *argv[])
{
return dunst_main(argc, argv);
}
/* vim: set tabstop=8 shiftwidth=8 expandtab textwidth=0: */

View File

@ -313,7 +313,7 @@ static void teardown(void)
x_free();
}
int main(int argc, char *argv[])
int dunst_main(int argc, char *argv[])
{
history = g_queue_new();

View File

@ -35,6 +35,8 @@ extern const char *color_strings[3][3];
gboolean run(void *data);
void wake_up(void);
int dunst_main(int argc, char *argv[]);
void check_timeouts(void);
void history_pop(void);
void history_push(notification *n);