Stdout output-driver with test
This commit is contained in:
parent
131a8b9501
commit
3ec6498e83
3 changed files with 101 additions and 1 deletions
|
|
@ -3,7 +3,7 @@ CC=gcc
|
|||
CFLAGS=-g -D__DEBUG__
|
||||
LDFLAGS=-L/usr/lib64/mysql -lmysqlclient
|
||||
|
||||
all : raw_inotify strbuf path rbtree inotify tree indexer mysql queue
|
||||
all : raw_inotify strbuf path rbtree inotify tree indexer mysql stdout queue
|
||||
|
||||
raw_inotify :
|
||||
$(CC) -linotifytools t_raw_inotify.c -o test_raw_inotify
|
||||
|
|
@ -71,6 +71,13 @@ mysql :
|
|||
../src/ini/dictionary.c \
|
||||
t_mysql.c -o test_mysql
|
||||
|
||||
stdout :
|
||||
$(CC) $(CFLAGS) $(LDFLAGS) \
|
||||
../src/output/stdout.c \
|
||||
../src/ini/iniparser.c \
|
||||
../src/ini/dictionary.c \
|
||||
t_stdout.c -o test_stdout
|
||||
|
||||
queue :
|
||||
$(CC) $(CFLAGS) ../src/notify/queue.c t_queue.c -o test_queue
|
||||
|
||||
|
|
|
|||
33
test/t_stdout.c
Normal file
33
test/t_stdout.c
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "../src/output/output.h"
|
||||
#include "../src/notify/event.h"
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
|
||||
int r;
|
||||
notify_event ev;
|
||||
|
||||
ev.path = "/home/kalle/bilder";
|
||||
ev.filename = "kalle.jpg";
|
||||
ev.type = NOTIFY_CREATE;
|
||||
|
||||
output_init(NULL);
|
||||
|
||||
r = output_process(&ev);
|
||||
|
||||
ev.type = NOTIFY_DELETE;
|
||||
|
||||
r = output_process(&ev);
|
||||
|
||||
if (r != 0)
|
||||
printf("Error: %s\n", output_error(r));
|
||||
|
||||
output_exit();
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in a new issue