ftp.nice.ch/pub/next/database/plz/xplz.3.4.s.tar.gz#/xplz-3.4/plzfile.h

This is plzfile.h in view mode; [Download] [Up]

/* $Id: plzfile.h,v 3.0 1993/06/07 22:43:33 klute Exp klute $ */

/* 
 * Copyright 1993 Rainer Klute <klute@irb.informatik.uni-dortmund.de>
 *
 * Permission to use, copy, modify, distribute, and sell this software and
 * its documentation for any purpose is hereby granted without fee, provided
 * that the above copyright notice appear in all copies and that both that
 * copyright notice and this permission notice appear in supporting
 * documentation. The author makes no representations about the suitability
 * of this software for any purpose. It is provided "as is" without express
 * or implied warranty.
 *
 */

#include "utils.h"


#if !defined (PLZFILE_H)
#define PLZFILE_H

typedef struct Range
{
    long first;
    long last;
}
Range;



#define ZIPBUFS 2

typedef struct PlzFile
{
    FILE *f;
    int recordLength;
    long size;
    long entries;

    int rsize, bsize, rnum, bnum;
    int nindex;
    long *index;
    int  *keypos, *keylen;
    char **keys;
    char *obuf[ZIPBUFS];
    int bufstat[ZIPBUFS];
    int nextbuf;
    int zip;
}
PlzFile;



#define SearchFirst 0
#define SearchLast  1
#define SearchAny   2

extern long BinarySearch (FILE *f, int recordLength, long min, long max, 
			  int keyPos, int keyLength, char *searchKey, 
			  long *unequalMin, long *unequalMax, int searchWhat,
			  int refKeyPos, Boolean RecordRead (char *),
			  PlzFile *plzFile);
extern Range *BinarySearchAll (FILE *f, int recordLength, long min, long max,
			       int keyPos, int keyLength, char *searchKey,
			       int refKeyPos, Boolean RecordRead (char *),
			       PlzFile *plzFile);
extern void OpenPlzFile (PlzFile *plzFile, char *plzFileName);

extern void fgetr (void *r, int rec, PlzFile *plzFile);

#define putlong(l,f) \
{ \
    putc (l, f); \
    putc (l >> 8, f); \
    putc (l >> 16, f); \
    putc (l >> 24, f); \
}

#define getlong(l,f) \
{ \
    l = getc (f) & 0xff; \
    l |= (getc (f) & 0xff) << 8; \
    l |= (getc (f) & 0xff) << 16; \
    l |= (getc (f) & 0xff) << 24; \
}
#endif




These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.