Archived
1
0
Fork 0

client/stdout.c: ported the code from output to client. deleting the old files.

This commit is contained in:
Henrik Hautakoski 2010-10-02 19:57:25 +02:00
parent f44ada20b3
commit 0174b8d6dc
11 changed files with 100 additions and 642 deletions

View file

@ -3,7 +3,7 @@ CC=gcc
CFLAGS=-g -D__DEBUG__
LDFLAGS=-L/usr/lib64/mysql -lmysqlclient
all : raw_inotify strbuf path rbtree inotify fscrawl mysql stdout queue
all : raw_inotify strbuf path rbtree inotify fscrawl queue
raw_inotify :
$(CC) -linotifytools t_raw_inotify.c -o test_raw_inotify
@ -54,22 +54,6 @@ fscrawl :
../src/common/strbuf.c \
t_fscrawl.c -o test_fscrawl
mysql :
$(CC) -D DB_DEBUG $(CFLAGS) $(LDFLAGS) \
../src/output/mysql.c \
../src/common/die.c \
../src/common/xalloc.c \
../src/ini/iniparser.c \
../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

View file

@ -1,9 +0,0 @@
[general]
test = mytest ;
[mysql]
host = localhost ;
username = user ;
password = pw ;
database = development ;
table = filesystem ;

View file

@ -1,46 +0,0 @@
#include <stdio.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "../src/output/output.h"
#include "../src/ini/iniparser.h"
#include "../src/notify/event.h"
int main(int argc, char *argv[]) {
printf("Run!\n");
printf("Here 1\n");
dictionary *config = iniparser_load("config.ini");
printf("Here 2\n");
notify_event ev;
printf("Here 3\n");
ev.path = "/home/kalle/bilder";
ev.filename = "kalle.jpg";
ev.type = NOTIFY_CREATE;
printf("Here 4\n");
output_init(config);
printf("Here 5\n");
int r = output_process(&ev);
printf("Here 6\n");
if (r != 0) {
printf("Error:\n");
printf(output_error(r));
}
printf("Here 7\n");
output_exit();
printf("Here 8\n");
return 0;
}

View file

@ -1,33 +0,0 @@
#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;
}