Updated WIN32 code specific sections. Changed header.
[idzebra-moved-to-github.git] / isam / isutil.c
1 /*
2  * Copyright (C) 1994-1999, Index Data
3  * All rights reserved.
4  * Sebastian Hammer, Adam Dickmeiss
5  *
6  * $Log: isutil.c,v $
7  * Revision 1.4  1999-02-02 14:51:17  adam
8  * Updated WIN32 code specific sections. Changed header.
9  *
10  * Revision 1.3  1996/10/29 13:56:55  adam
11  * Include of zebrautl.h instead of alexutil.h.
12  *
13  * Revision 1.2  1995/09/04 12:33:46  adam
14  * Various cleanup. YAZ util used instead.
15  *
16  * Revision 1.1  1994/09/12  08:02:13  quinn
17  * Not functional yet
18  *
19  */
20
21 /*
22  * Small utilities needed by the isam system. Some or all of these
23  * may move to util/ along the way.
24  */
25
26 #include <stdio.h>
27 #include <string.h>
28 #include <stdarg.h>
29
30 #include <isam.h>
31 #include "isutil.h"
32
33 char *strconcat(const char *s1, ...)
34 {
35     va_list ap;
36     static char buf[512];
37     char *p;
38
39     va_start(ap, s1);
40     strcpy(buf, s1);
41     while ((p = va_arg(ap, char *)))
42         strcat(buf, p);
43     va_end(ap);
44     
45     return buf;
46 }
47
48 int is_default_cmp(const void *k1, const void *k2)
49 {
50     int b1, b2;
51
52     memcpy(&b1, k1, sizeof(b1));
53     memcpy(&b2, k2, sizeof(b2));
54     return b1 - b2;
55 }