/************************************************************************** * * mgpp_invf_dump.cpp -- Program to dump uot an inverted fil * Copyright (C) 1994 Neil Sharman * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * **************************************************************************/ #define _XOPEN_SOURCE 1 // This was added for Solaris, but it makes things worse on Solaris for me... // #define _XOPEN_SOURCE_EXTENDED 1 // need this to avoid bizarre compiler problems under VC++ 6.0 #if defined (__WIN32__) && !defined (GSDL_USE_IOS_H) # include #endif /* getopt is in posix.2, so cygwin should have it in unistd, but doesn't */ #if defined (__WIN32__) || defined (__CYGWIN__) # include "getopt_old.h" #else # include #endif #include "sysfuncs.h" #include "messages.h" #include "bitio_m_stdio.h" #include "bitio_gen.h" #include "netorder.h" /* [RPAP - Jan 97: Endian Ordering] */ #include "mg_files.h" #include "locallib.h" #include "words.h" #include "invf.h" #include "WordData.h" static void PrintInvfWord (FILE *invfFile, invf_dict_header &idh, invf_file_header &ifh, word_dict_el &wordEl, mg_u_long wordStart, bool printFrags) { cout << wordEl.frag_occur << " \"" << wordEl.el << "\"\n"; if (printFrags) { // seek to the appropriate place in the inverted file fseek (invfFile, wordStart, SEEK_SET); stdio_bitio_buffer buffer(invfFile); mg_u_long B = BIO_Bblock_Init (idh.num_frags, wordEl.frag_occur); mg_u_long fragNum = 0; mg_u_long i; for (i=0; i\"\n"; if (printFrags) { // seek to the appropriate place in the inverted file fseek (invfFile, tagStart, SEEK_SET); stdio_bitio_buffer buffer(invfFile); mg_u_long pTag = tagEl.frag_occur*2; mg_u_long B = BIO_Bblock_Init (idh.num_frags+pTag, pTag); mg_u_long fragNum = 0; mg_u_long i; for (i=0; i