X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=odr%2Fodr_mem.c;h=15721526e4ada9e599b733831983ff9dc0c00d53;hb=68f9c30763ddbba9f25b6e893078ead2583c6f21;hp=f0792d0f3fb49598bd4bb5790b40fd8212e1df8a;hpb=20183db4fcbb8161529ee557ead6789ae2097ae0;p=yaz-moved-to-github.git diff --git a/odr/odr_mem.c b/odr/odr_mem.c index f0792d0..1572152 100644 --- a/odr/odr_mem.c +++ b/odr/odr_mem.c @@ -1,10 +1,19 @@ /* - * Copyright (c) 1995, Index Data + * Copyright (c) 1995-1998, Index Data * See the file LICENSE for details. * Sebastian Hammer, Adam Dickmeiss * * $Log: odr_mem.c,v $ - * Revision 1.12 1995-11-08 17:41:33 quinn + * Revision 1.15 1999-03-31 11:18:25 adam + * Implemented odr_strdup. Added Reference ID to backend server API. + * + * Revision 1.14 1998/07/20 12:38:15 adam + * More LOG_DEBUG-diagnostics. + * + * Revision 1.13 1998/02/11 11:53:34 adam + * Changed code so that it compiles as C++. + * + * Revision 1.12 1995/11/08 17:41:33 quinn * Smallish. * * Revision 1.11 1995/11/01 13:54:43 quinn @@ -68,6 +77,11 @@ void *odr_malloc(ODR o, int size) return nmem_malloc(o ? o->mem : 0, size); } +char *odr_strdup(ODR o, const char *str) +{ + return nmem_strdup(o->mem, str); +} + int odr_total(ODR o) { return o->mem ? nmem_total(o->mem) : 0; @@ -88,9 +102,9 @@ int odr_grow_block(odr_ecblock *b, int min_bytes) togrow = b->size; if (togrow < min_bytes) togrow = min_bytes; - if (b->size && !(b->buf =xrealloc(b->buf, b->size += togrow))) + if (b->size && !(b->buf =(unsigned char *)xrealloc(b->buf, b->size += togrow))) abort(); - else if (!b->size && !(b->buf = xmalloc(b->size = togrow))) + else if (!b->size && !(b->buf = (unsigned char *)xmalloc(b->size = togrow))) abort(); #ifdef ODR_DEBUG fprintf(stderr, "New size for encode_buffer: %d\n", b->size);