projects
/
idzebra-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix documentation of of chr's equivalent directive ZEB-672
[idzebra-moved-to-github.git]
/
dict
/
insert.c
diff --git
a/dict/insert.c
b/dict/insert.c
index
f6c5df8
..
506fe17
100644
(file)
--- a/
dict/insert.c
+++ b/
dict/insert.c
@@
-1,5
+1,5
@@
/* This file is part of the Zebra server.
/* This file is part of the Zebra server.
- Copyright (C) 1994-2011 Index Data
+ Copyright (C) Index Data
Zebra is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Zebra is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
@@
-19,6
+19,9
@@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@
-96,7
+99,7
@@
static int split_page(Dict dict, Dict_ptr ptr, void *p)
best_indxp = indxp;
}
}
best_indxp = indxp;
}
}
- else
+ else
{ /* new char prefix. restore */
prev_char = dc;
no_current = 1;
{ /* new char prefix. restore */
prev_char = dc;
no_current = 1;
@@
-142,7
+145,7
@@
static int split_page(Dict dict, Dict_ptr ptr, void *p)
}
static void clean_page(Dict dict, Dict_ptr ptr, void *p, Dict_char *out,
}
static void clean_page(Dict dict, Dict_ptr ptr, void *p, Dict_char *out,
- Dict_ptr subptr, char *userinfo)
+ Dict_ptr subptr, char *userinfo)
{
char *np = (char *) xmalloc(dict->head.page_size);
int i, slen, no = 0;
{
char *np = (char *) xmalloc(dict->head.page_size);
int i, slen, no = 0;
@@
-177,8
+180,8
@@
static void clean_page(Dict dict, Dict_ptr ptr, void *p, Dict_char *out,
info2 += *userinfo + 1;
}
else
info2 += *userinfo + 1;
}
else
- *info2++ = 0;
- subptr = 0;
+ *info2++ = 0;
+ subptr = 0;
++no;
continue;
}
++no;
continue;
}
@@
-208,7
+211,7
@@
static void clean_page(Dict dict, Dict_ptr ptr, void *p, Dict_char *out,
++no;
}
#if 1
++no;
}
#if 1
- memcpy((char*)p+DICT_infoffset,
+ memcpy((char*)p+DICT_infoffset,
(char*)np+DICT_infoffset,
info2 - ((char*)np+DICT_infoffset));
memcpy((char*)p + ((char*)indxp2 - (char*)np),
(char*)np+DICT_infoffset,
info2 - ((char*)np+DICT_infoffset));
memcpy((char*)p + ((char*)indxp2 - (char*)np),
@@
-240,7
+243,7
@@
static int dict_ins(Dict dict, const Dict_char *str,
void *p;
dict_bf_readp(dict->dbf, ptr, &p);
void *p;
dict_bf_readp(dict->dbf, ptr, &p);
-
+
assert(p);
assert(ptr);
assert(p);
assert(ptr);
@@
-338,7
+341,7
@@
static int dict_ins(Dict dict, const Dict_char *str,
return dict_ins(dict, str-1, ptr,
userlen, userinfo);
}
return dict_ins(dict, str-1, ptr,
userlen, userinfo);
}
- if (split_page(dict, ptr, p))
+ if (split_page(dict, ptr, p))
{
yaz_log(YLOG_FATAL, "Unable to split page %d\n", ptr);
assert(0);
{
yaz_log(YLOG_FATAL, "Unable to split page %d\n", ptr);
assert(0);