1 /***********************************************************************
3 * This software is part of the ast package *
4 * Copyright (c) 1985-2010 AT&T Intellectual Property *
5 * and is licensed under the *
6 * Common Public License, Version 1.0 *
7 * by AT&T Intellectual Property *
9 * A copy of the License is available at *
10 * http://www.opensource.org/licenses/cpl1.0.txt *
11 * (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
13 * Information and Software Systems Research *
17 * Glenn Fowler <gsf@research.att.com> *
18 * David Korn <dgk@research.att.com> *
19 * Phong Vo <kpv@research.att.com> *
21 ***********************************************************************/
24 * fast find private interface
38 #define FF_old 1 /* old format - 7 bit bigram */
39 #define FF_gnu 2 /* gnu 8 bit no bigram */
40 #define FF_dir 3 /* FF_gnu, dirs have trailing / */
41 #define FF_typ 4 /* FF_dir with types */
43 #define FF_gnu_magic "LOCATE02"
44 #define FF_dir_magic "FIND-DIR-02"
45 #define FF_typ_magic "FIND-DIR-TYPE-03"
52 #define FF_SET_TYPE(p,i) ((p)->decode.bigram1[((i)>>3)&((1<<CHAR_BIT)-1)]|=(1<<((i)&07)))
53 #define FF_OK_TYPE(p,i) (!(p)->types||((p)->decode.bigram1[((i)>>3)&((1<<CHAR_BIT)-1)]&(1<<((i)&07))))
67 char bigram1
[(1<<(CHAR_BIT
-1))];
68 char bigram2
[(1<<(CHAR_BIT
-1))];
81 unsigned char bigram
[2*FF_MAX
];
82 unsigned short code
[FF_MAX
][FF_MAX
];
83 unsigned short hits
[USHRT_MAX
+1];
104 #define _FIND_PRIVATE_ \
110 Findverify_f verifyf; \
118 #define decode code.code_decode
119 #define encode code.code_encode