#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#define SUBCORPMAGIC 36193928 |
magic number of the subcropus file format
int file_length | ( | FILE * | fd | ) |
Gets the size of the file.
fd | File handle. |
int main | ( | int | argc, | |
char ** | argv | |||
) |
Main function for cwb-decode-nqrfile.
argc | Number of command-line arguments. | |
argv | Command-line arguments. |
References print_header, and show_subcorpus_info().
int show_subcorpus_info | ( | FILE * | fd | ) |
Reads a subcorpus file and prints information about it to STDOUT.
"Subcorpus file" here means (a) it begins with the subcorpus magic number; (b)then there is a "registry" area terminated by one or more zero bytes; (c) then there may be the size of the subcorpus; (d) then there are a whole load of start-end range integer pairs, to the end of the file.
The registry is printed iff print_header. The start-end pairs are printed on tab-delimited lines, one line per pair.
fd | File pointer. |
References file_length(), print_header, range, registry, and SUBCORPMAGIC.
Referenced by main().
int print_header = 1 |
Boolean: controls whether a "registry" header in the subcorpus file gets printed or not.
Referenced by main(), and show_subcorpus_info().