| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
#include <config.h> |
| 11 |
|
| 12 |
#include <stdio.h> |
| 13 |
#include <string.h> |
| 14 |
#include <stdlib.h> |
| 15 |
#include <unistd.h> |
| 16 |
#include "liblouis.h" |
| 17 |
|
| 18 |
static int errorCount = 0; |
| 19 |
|
| 20 |
static void |
| 21 |
log_and_count_errors(logLevels level, const char *message) |
| 22 |
{ |
| 23 |
switch(level) |
| 24 |
{ |
| 25 |
case LOU_LOG_ERROR: |
| 26 |
errorCount++; |
| 27 |
printf("\n ERROR >> %s\n", message); |
| 28 |
break; |
| 29 |
default: |
| 30 |
printf("%s\n", message); |
| 31 |
} |
| 32 |
} |
| 33 |
|
| 34 |
int |
| 35 |
main(int argc, char **argv) |
| 36 |
{ |
| 37 |
lou_registerLogCallback(log_and_count_errors); |
| 38 |
lou_setLogLevel(LOU_LOG_DEBUG); |
| 39 |
char table_path[2048]; |
| 40 |
const char *abs_top_srcdir = getenv ("LOUIS_TABLEPATH"); |
| 41 |
sprintf (table_path, "%s/tables", abs_top_srcdir); |
| 42 |
setenv ("LOUIS_TABLEPATH", table_path, 1); |
| 43 |
errorCount = 0; |
| 44 |
lou_findTable("bo:gus"); |
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
return errorCount; |
| 49 |
} |