Added odr_intdup. Ztest server returns TaskPackage for ItemUpdate.
[yaz-moved-to-github.git] / util / nmemsdup.c
1 /*
2  * Copyright (c) 1997-2001, Index Data.
3  * See the file LICENSE for details.
4  *
5  * $Log: nmemsdup.c,v $
6  * Revision 1.5  2001-03-25 21:55:13  adam
7  * Added odr_intdup. Ztest server returns TaskPackage for ItemUpdate.
8  *
9  * Revision 1.4  2000/02/29 13:44:55  adam
10  * Check for config.h (currently not generated).
11  *
12  * Revision 1.3  1999/11/30 13:47:12  adam
13  * Improved installation. Moved header files to include/yaz.
14  *
15  * Revision 1.2  1998/02/11 11:53:36  adam
16  * Changed code so that it compiles as C++.
17  *
18  * Revision 1.1  1997/09/17 12:10:42  adam
19  * YAZ version 1.4.
20  *
21  */
22 #if HAVE_CONFIG_H
23 #include <config.h>
24 #endif
25
26 #include <string.h>
27 #include <yaz/nmem.h>
28
29 char *nmem_strdup (NMEM mem, const char *src)
30 {
31     char *dst = (char *)nmem_malloc (mem, strlen(src)+1);
32     strcpy (dst, src);
33     return dst;
34 }
35
36 int *nmem_intdup(NMEM mem, int v)
37 {
38     int *dst = (int*) nmem_malloc (mem, sizeof(int));
39     *dst = v;
40     return dst;
41 }