X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fodr_mem.c;h=c994c236a1864b4569c1768ee78967853da8a9f4;hb=b479a755bb3329922d9d3fb496ba828716a7e40e;hp=2e7e2866fa5183d568c56dbe47bb09f04f0671ee;hpb=b7c6d3740131ba03800c5c2cc935dc2626d12bb3;p=yaz-moved-to-github.git diff --git a/src/odr_mem.c b/src/odr_mem.c index 2e7e286..c994c23 100644 --- a/src/odr_mem.c +++ b/src/odr_mem.c @@ -1,8 +1,8 @@ /* - * Copyright (C) 1995-2005, Index Data ApS + * Copyright (C) 1995-2007, Index Data ApS * See the file LICENSE for details. * - * $Id: odr_mem.c,v 1.6 2005-08-11 14:21:55 adam Exp $ + * $Id: odr_mem.c,v 1.8 2007-01-03 08:42:15 adam Exp $ */ /** * \file odr_mem.c @@ -60,6 +60,16 @@ int odr_total(ODR o) return o->mem ? nmem_total(o->mem) : 0; } +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); + memcpy(p->buf, buf, sz); + p->size = sz; + p->len = sz; + return p; +} + /* ---------- memory management for data encoding ----------*/