/normxcorr/trunk

To get this branch, use:
bzr branch http://suren.me/webbzr/normxcorr/trunk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include <stdio.h>
#include <stdarg.h>

#include "dict_hw.h"

static void reportErrorDefault(const char *msg, ...) {
    char res[1024];
    
    va_list ap;
    
    va_start(ap, msg);
    vsnprintf(res, 1024, msg, ap);
    va_end(ap);
    
    printf("%s\n", res);
}

static void reportMessageDefault(const char *msg, ...) {
    char res[1024];

    va_list ap;
    
    va_start(ap, msg);
    vsnprintf(res, 1024, msg, ap);
    va_end(ap);
    
    printf("%s\n", res);
}

void (*reportError)(const char *msg, ...) = reportErrorDefault;
void (*reportMessage)(const char *msg, ...) = reportMessageDefault;

int reportSet(DICTLogger error_reporter, DICTLogger message_writer) {
    reportError = error_reporter;
    reportMessage = message_writer;

    return 0;
}