$("#ray_5891").html("\n
1<\/a>
2<\/a>
3<\/a>
4<\/a>
5<\/a>
6<\/a>
7<\/a>
8<\/a>
9<\/a>
10<\/a><\/strong>
11<\/a>
12<\/a>
13<\/a>
14<\/a>
15<\/a>
16<\/a>
17<\/a>
18<\/a>
19<\/a>
20<\/a><\/strong>
21<\/a>
22<\/a>
23<\/a>
24<\/a>
25<\/a>
26<\/a>
27<\/a>
28<\/a>
29<\/a>
30<\/a><\/strong>
31<\/a>
32<\/a>
33<\/a>
34<\/a>
35<\/a>
36<\/a>
37<\/a>
38<\/a>
39<\/a>
40<\/a><\/strong>
41<\/a>
42<\/a>
43<\/a>
44<\/a>
45<\/a>
46<\/a>
47<\/a>
48<\/a>
49<\/a>
50<\/a><\/strong>
51<\/a>
52<\/a>
53<\/a>
54<\/a>
55<\/a>
56<\/a>
57<\/a>
58<\/a>
59<\/a>
60<\/a><\/strong>
61<\/a>
62<\/a>
63<\/a>
64<\/a>
65<\/a>
66<\/a>
67<\/a>
68<\/a>
69<\/a>
70<\/a><\/strong><\/pre><\/td>\n  
#include "index.h"
#include "similarity.h"
#include "helper.h"
#include "array.h"
#include "priorityqueue.h"
#include <\/span><string.h><\/span>
<\/span>#include <\/span><limits.h><\/span>
<\/span>#include <\/span><ctype.h><\/span>

<\/span>#define GET_LOCK(lock, name, store, err_msg) do {\\
    lock = store-<\/span>><\/span>open_lock(store, name);\\
    if (!lock-<\/span>><\/span>obtain(lock)) {\\
        RAISE(LOCK_ERROR, err_msg);\\
    }\\
} while(0)

#define RELEASE_LOCK(lock, store) do {\\
    lock-<\/span>><\/span>release(lock);\\
    store-<\/span>><\/span>close_lock(lock);\\
} while (0)

const Config default_config = {
    0x100000,       /* chunk size is 1Mb */
    0x1000000,      /* Max memory used for buffer is 16 Mb */
    INDEX_INTERVAL, /* index interval */
    SKIP_INTERVAL,  /* skip interval */
    10,             /* default merge factor */
    10000,          /* max_buffered_docs */
    INT_MAX,        /* max_merge_docs */
    10000,          /* maximum field length (number of terms) */
    true            /* use compound file by default */
};

static void ste_reset(TermEnum *te);
static char *ste_next(TermEnum *te);

#define FORMAT 0
#define SEGMENTS_GEN_FILE_NAME "segments"
#define MAX_EXT_LEN 10

/* *** Must be three characters *** */
const char *INDEX_EXTENSIONS[] = {
    "frq", "prx", "fdx", "fdt", "tfx", "tix", "tis", "del", "gen", "cfs"
};

/* *** Must be three characters *** */
const char *COMPOUND_EXTENSIONS[] = {
    "frq", "prx", "fdx", "fdt", "tfx", "tix", "tis"
};


static const char BASE36_DIGITMAP[] = "0123456789abcdefghijklmnopqrstuvwxyz";

static char *u64_to_str36(char *buf, int buf_size, f_u64 u)
{
    int i = buf_size - 1;
    buf[i] = \'\\0\';
    for (i--; i <\/span>><\/span>= 0; i--) {
        buf[i] = BASE36_DIGITMAP[u % 36];
        u /= 36;
        if (0 == u) {
            break;
        }
    }
    if (0 <\/span><<\/span> <\/span>u) {
        RAISE(EXCEPTION, "Max length of segment filename has been reached. "
              "Perhaps it\'s time to re-index.\\n");
    }
    return buf + i;
}<\/span><\/pre><\/td>\n<\/tr><\/table>\n\n");