/* 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
key_logdump_txt(logmask, p, "");
}
-int key_compare_it (const void *p1, const void *p2)
-{
- int i, l = ((struct it_key *) p1)->len;
- if (((struct it_key *) p2)->len > l)
- l = ((struct it_key *) p2)->len;
- assert (l <= IT_KEY_LEVEL_MAX && l > 0);
- for (i = 0; i < l; i++)
- {
- if (((struct it_key *) p1)->mem[i] != ((struct it_key *) p2)->mem[i])
- {
- if (((struct it_key *) p1)->mem[i] > ((struct it_key *) p2)->mem[i])
- return l-i;
- else
- return i-l;
- }
- }
- return 0;
-}
-
char *key_print_it (const void *p, char *buf)
{
strcpy(buf, "");
size_t l;
char *cp1 = *(char **) p1;
char *cp2 = *(char **) p2;
-
+
if ((r = strcmp (cp1, cp2)))
return r;
l = strlen(cp1)+1;
3, 2, 9, 12
3, 2, 10, 2
4, 1
-
+
if diff is 0, then there is more ...
if diff is non-zero, then _may_ be more
*/