~ubuntu-branches/ubuntu/hardy/postgresql-8.4/hardy-backports

« back to all changes in this revision

Viewing changes to src/include/tsearch/dicts/regis.h

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2009-03-20 12:00:13 UTC
  • Revision ID: james.westby@ubuntu.com-20090320120013-hogj7egc5mjncc5g
Tags: upstream-8.4~0cvs20090328
ImportĀ upstreamĀ versionĀ 8.4~0cvs20090328

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*-------------------------------------------------------------------------
 
2
 *
 
3
 * regis.h
 
4
 *
 
5
 * Declarations for for fast regex subset, used by ISpell
 
6
 *
 
7
 * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
 
8
 *
 
9
 * $PostgreSQL$
 
10
 *
 
11
 *-------------------------------------------------------------------------
 
12
 */
 
13
 
 
14
#ifndef __REGIS_H__
 
15
#define __REGIS_H__
 
16
 
 
17
typedef struct RegisNode
 
18
{
 
19
        uint32
 
20
                                type:2,
 
21
                                len:16,
 
22
                                unused:14;
 
23
        struct RegisNode *next;
 
24
        unsigned char data[1];
 
25
} RegisNode;
 
26
 
 
27
#define  RNHDRSZ        (offsetof(RegisNode,data))
 
28
 
 
29
#define RSF_ONEOF       1
 
30
#define RSF_NONEOF      2
 
31
 
 
32
typedef struct Regis
 
33
{
 
34
        RegisNode  *node;
 
35
        uint32
 
36
                                issuffix:1,
 
37
                                nchar:16,
 
38
                                unused:15;
 
39
} Regis;
 
40
 
 
41
bool            RS_isRegis(const char *str);
 
42
 
 
43
void            RS_compile(Regis *r, bool issuffix, const char *str);
 
44
void            RS_free(Regis *r);
 
45
 
 
46
/*returns true if matches */
 
47
bool            RS_execute(Regis *r, char *str);
 
48
 
 
49
#endif