File: findTable.c

package info (click to toggle)
liblouis 3.0.0-3%2Bdeb9u4
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 68,336 kB
  • sloc: ansic: 26,525; sh: 5,113; makefile: 739; perl: 69; python: 42
file content (24 lines) | stat: -rw-r--r-- 613 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include <config.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include "liblouis.h"
#include "louis.h"

int
main(int argc, char **argv)
{
  int success = 0;
  char * match;
  const char * tables[] = {"tablesWithMetadata/foo","tablesWithMetadata/bar",NULL};
  lou_setLogLevel(LOG_DEBUG);
  lou_indexTables(tables);
  match = lou_findTable("id:foo");
  success |= (!match || (strstr(match, "tablesWithMetadata/foo") == NULL));
  match = lou_findTable("language:en");
  success |= (!match || (strstr(match, "tablesWithMetadata/bar") == NULL));

  lou_free();
  return success;
}