2 * Copyright (C) 1994-1995, Index Data I/S
4 * Sebastian Hammer, Adam Dickmeiss
7 * Revision 1.3 1995-09-07 13:58:36 adam
8 * New parameter: result-set file descriptor (RSFD) to support multiple
9 * positions within the same result-set.
10 * Boolean operators: and, or, not implemented.
11 * Result-set references.
13 * Revision 1.2 1995/09/06 16:11:17 adam
14 * Option: only one word key per file.
16 * Revision 1.1 1995/09/04 09:10:36 adam
17 * More work on index add/del/update.
18 * Merge sort implemented.
19 * Initial work on z39 server.
30 int key_compare (const void *p1, const void *p2)
33 memcpy (&i1, p1, sizeof(i1));
34 memcpy (&i2, p2, sizeof(i2));
35 if (i1.sysno != i2.sysno)
37 if (i1.sysno > i2.sysno)
42 if (i1.seqno != i2.seqno)
44 if (i1.seqno > i2.seqno)
50 if (i1.field != i2.field)
52 if (i1.field > i2.field)
61 int key_compare_x (const struct it_key *i1, const struct it_key *i2)
63 if ( i1->sysno != i2->sysno)
64 return i1->sysno - i2->sysno;
66 if ( i1->seqno != i2->seqno)
67 return i1->seqno - i2->seqno;
68 return i1->field - i2->field;
70 return i1->seqno - i2->seqno;