Header And Logo

PostgreSQL
| The world's most advanced open source database.

regis.h

Go to the documentation of this file.
00001 /*-------------------------------------------------------------------------
00002  *
00003  * regis.h
00004  *
00005  * Declarations for fast regex subset, used by ISpell
00006  *
00007  * Portions Copyright (c) 1996-2013, PostgreSQL Global Development Group
00008  *
00009  * src/include/tsearch/dicts/regis.h
00010  *
00011  *-------------------------------------------------------------------------
00012  */
00013 
00014 #ifndef __REGIS_H__
00015 #define __REGIS_H__
00016 
00017 typedef struct RegisNode
00018 {
00019     uint32
00020                 type:2,
00021                 len:16,
00022                 unused:14;
00023     struct RegisNode *next;
00024     unsigned char data[1];
00025 } RegisNode;
00026 
00027 #define  RNHDRSZ    (offsetof(RegisNode,data))
00028 
00029 #define RSF_ONEOF   1
00030 #define RSF_NONEOF  2
00031 
00032 typedef struct Regis
00033 {
00034     RegisNode  *node;
00035     uint32
00036                 issuffix:1,
00037                 nchar:16,
00038                 unused:15;
00039 } Regis;
00040 
00041 bool        RS_isRegis(const char *str);
00042 
00043 void        RS_compile(Regis *r, bool issuffix, const char *str);
00044 void        RS_free(Regis *r);
00045 
00046 /*returns true if matches */
00047 bool        RS_execute(Regis *r, char *str);
00048 
00049 #endif