~vcs-imports/mammoth-replicator/trunk

« back to all changes in this revision

Viewing changes to contrib/tsearch2/ts_stat.h

  • Committer: alvherre
  • Date: 2005-12-16 21:24:52 UTC
  • Revision ID: svn-v4:db760fc0-0f08-0410-9d63-cc6633f64896:trunk:1
Initial import of the REL8_0_3 sources from the Pgsql CVS repository.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef __TXTIDX_STAT_H__
 
2
#define __TXTIDX_STAT_H__
 
3
 
 
4
#include "postgres.h"
 
5
 
 
6
#include "access/gist.h"
 
7
#include "access/itup.h"
 
8
#include "utils/builtins.h"
 
9
#include "storage/bufpage.h"
 
10
 
 
11
typedef struct
 
12
{
 
13
        uint32          len;
 
14
        uint32          pos;
 
15
        uint32          ndoc;
 
16
        uint32          nentry;
 
17
}       StatEntry;
 
18
 
 
19
typedef struct
 
20
{
 
21
        int4            len;
 
22
        int4            size;
 
23
        int4            weight;
 
24
        char            data[1];
 
25
}       tsstat;
 
26
 
 
27
#define STATHDRSIZE (sizeof(int4)*4)
 
28
#define CALCSTATSIZE(x, lenstr) ( x * sizeof(StatEntry) + STATHDRSIZE + lenstr )
 
29
#define STATPTR(x)      ( (StatEntry*) ( (char*)x + STATHDRSIZE ) )
 
30
#define STATSTRPTR(x)   ( (char*)x + STATHDRSIZE + ( sizeof(StatEntry) * ((tsvector*)x)->size ) )
 
31
#define STATSTRSIZE(x)  ( ((tsvector*)x)->len - STATHDRSIZE - ( sizeof(StatEntry) * ((tsvector*)x)->size ) )
 
32
 
 
33
#endif