X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fodr_mem.c;h=028d06dad2e8cf5d78d9a4b234d6fb96fe9a4b32;hb=c6b8edd2312a4606cc014738266059a20e3b6e61;hp=efbda890e60dac81c6127367e591c1f6c27bdd6e;hpb=7a4064cd15f6c6b34c1180e1bc51f0d0e90da320;p=yaz-moved-to-github.git diff --git a/src/odr_mem.c b/src/odr_mem.c index efbda89..028d06d 100644 --- a/src/odr_mem.c +++ b/src/odr_mem.c @@ -1,8 +1,6 @@ -/* - * Copyright (C) 1995-2007, Index Data ApS +/* This file is part of the YAZ toolkit. + * Copyright (C) 1995-2009 Index Data * See the file LICENSE for details. - * - * $Id: odr_mem.c,v 1.10 2007-04-12 13:52:57 adam Exp $ */ /** * \file odr_mem.c @@ -39,16 +37,26 @@ char *odr_strdup(ODR o, const char *str) return nmem_strdup(o->mem, str); } +char *odr_strdup_null(ODR o, const char *str) +{ + return nmem_strdup_null(o->mem, str); +} + char *odr_strdupn(ODR o, const char *str, size_t n) { return nmem_strdupn(o->mem, str, n); } -int *odr_intdup(ODR o, int v) +Odr_int *odr_intdup(ODR o, Odr_int v) { return nmem_intdup(o->mem, v); } +Odr_bool *odr_booldup(ODR o, Odr_bool v) +{ + return nmem_booldup(o->mem, v); +} + int odr_total(ODR o) { return nmem_total(o->mem); @@ -57,7 +65,7 @@ int odr_total(ODR o) Odr_oct *odr_create_Odr_oct(ODR o, const unsigned char *buf, int sz) { Odr_oct *p = (Odr_oct *) odr_malloc(o, sizeof(Odr_oct)); - p->buf = odr_malloc(o, sz); + p->buf = (unsigned char *) odr_malloc(o, sz); memcpy(p->buf, buf, sz); p->size = sz; p->len = sz; @@ -119,6 +127,7 @@ int odr_seek(ODR o, int whence, int offset) /* * Local variables: * c-basic-offset: 4 + * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab