From: Sebastian B. <sb...@us...> - 2014-01-19 18:50:53
|
Update of /cvsroot/simplemail/simplemail In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv24914 Modified Files: index_external.c Log Message: Added a new function to create an index with some options. Index: index_external.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/index_external.c,v retrieving revision 1.43 retrieving revision 1.44 diff -u -d -r1.43 -r1.44 --- index_external.c 19 Jan 2014 18:50:32 -0000 1.43 +++ index_external.c 19 Jan 2014 18:50:51 -0000 1.44 @@ -719,7 +719,7 @@ free(idx); } -static struct index *index_external_create(const char *filename) +static struct index *index_external_create_with_opts(const char *filename, int block_size) { struct index_external *idx; char buf[380]; @@ -729,7 +729,7 @@ memset(idx,0,sizeof(*idx)); list_init(&idx->document_list); - idx->block_size = 16384; + idx->block_size = block_size; idx->max_elements_per_node = (idx->block_size - sizeof(struct bnode_header)) / sizeof(struct bnode_element); if (!(idx->tmp = bnode_create(idx))) @@ -759,6 +759,11 @@ return NULL; } +static struct index *index_external_create(const char *filename) +{ + return index_external_create_with_opts(filename, 16384); +} + /** * Appends the given string to the string file. The string will be zero-byte terminated. * |