X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=src%2Fnmemsdup.c;h=3c1c4e17ffd8bb898a49e025b507809fe608c15b;hp=d30dbaff032ca858e713043aa951f3957c29881f;hb=ed51c750eb5540c5a3a34ef3beb0c043a6e65f7c;hpb=379504a233e3e2cc85bca1e7b6d864f1395aec7c diff --git a/src/nmemsdup.c b/src/nmemsdup.c index d30dbaf..3c1c4e1 100644 --- a/src/nmemsdup.c +++ b/src/nmemsdup.c @@ -1,5 +1,5 @@ /* This file is part of the YAZ toolkit. - * Copyright (C) 1995-2009 Index Data + * Copyright (C) 1995-2011 Index Data * See the file LICENSE for details. */ @@ -38,9 +38,16 @@ char *nmem_strdupn (NMEM mem, const char *src, size_t n) return dst; } -int *nmem_intdup(NMEM mem, int v) +nmem_int_t *nmem_intdup(NMEM mem, nmem_int_t v) { - int *dst = (int*) nmem_malloc (mem, sizeof(int)); + nmem_int_t *dst = (nmem_int_t*) nmem_malloc (mem, sizeof(*dst)); + *dst = v; + return dst; +} + +nmem_bool_t *nmem_booldup(NMEM mem, nmem_bool_t v) +{ + nmem_bool_t *dst = (nmem_bool_t*) nmem_malloc (mem, sizeof(*dst)); *dst = v; return dst; }