#include #include #include "tsindexer.h" int into_the_ether(char *buf, int n, int m, void *file) { } int main(int argc, char **argv) { sTsIndexer *indexer; #define BUFSIZE 2 * 1024 * 1024 char buf[BUFSIZE]; FILE *f; unsigned short pid; int index; f = fopen(argv[1], "r"); if (!f) {perror("fopen"); return -1;} pid = strtoul(argv[2], NULL, 0); index = atoi(argv[3]); indexer = tsindex_allocate((INDEX_WRITE_CB)into_the_ether, NULL, pid, -1); while (!feof(f)) { int n = fread(buf, 1, BUFSIZE, f); if (index) tsindex_feed( indexer, buf, n); printf("."); fflush(stdout); } printf("\n"); tsindex_free( indexer ); return 0; }