2 * Copyright (C) 1994-1995, Index Data I/S
4 * Sebastian Hammer, Adam Dickmeiss
7 * Revision 1.2 1995-09-06 16:11:17 adam
8 * Option: only one word key per file.
10 * Revision 1.1 1995/09/04 09:10:36 adam
11 * More work on index add/del/update.
12 * Merge sort implemented.
13 * Initial work on z39 server.
24 int key_compare (const void *p1, const void *p2)
27 memcpy (&i1, p1, sizeof(i1));
28 memcpy (&i2, p2, sizeof(i2));
29 if ( i1.sysno != i2.sysno)
30 return i1.sysno - i2.sysno;
32 if ( i1.seqno != i2.seqno)
33 return i1.seqno - i2.seqno;
34 return i1.field - i2.field;
36 return i1.seqno - i2.seqno;
40 int key_compare_x (const struct it_key *i1, const struct it_key *i2)
42 if ( i1->sysno != i2->sysno)
43 return i1->sysno - i2->sysno;
45 if ( i1->seqno != i2->seqno)
46 return i1->seqno - i2->seqno;
47 return i1->field - i2->field;
49 return i1->seqno - i2->seqno;