cwb-decode-nqrfile.c File Reference

#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>

Defines

Functions

Variables


Define Documentation

#define SUBCORPMAGIC   36193928

magic number of the subcropus file format


Function Documentation

int file_length ( FILE *  fd  ) 

Gets the size of the file.

Parameters:
fd File handle.
Returns:
The size of the file, from stat().
int main ( int  argc,
char **  argv 
)

Main function for cwb-decode-nqrfile.

Parameters:
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.

Parameters:
fd File pointer.
Returns:
Boolean: true for all OK, false for problem.

References file_length(), print_header, range, registry, and SUBCORPMAGIC.

Referenced by main().


Variable Documentation

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().


Generated on Sun Feb 28 18:08:04 2010 for CWB by  doxygen 1.6.1