X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=odr%2Fodr.c;h=cc94ef82936cb9b5c94233db52463537f91797c0;hb=d5841c7c5616c3259c78e90cbf8e5e96ebd3ab31;hp=d007f1b0d9221189a1fe506b2d0484e6fccf0cfb;hpb=72592d242326dea9e05cae90d50348a2da0c0948;p=yaz-moved-to-github.git diff --git a/odr/odr.c b/odr/odr.c index d007f1b..cc94ef8 100644 --- a/odr/odr.c +++ b/odr/odr.c @@ -4,7 +4,16 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: odr.c,v $ - * Revision 1.15 1995-08-15 12:00:22 quinn + * Revision 1.18 1995-09-29 17:12:22 quinn + * Smallish + * + * Revision 1.17 1995/09/29 17:01:50 quinn + * More Windows work + * + * Revision 1.16 1995/09/27 15:02:57 quinn + * Modified function heads & prototypes. + * + * Revision 1.15 1995/08/15 12:00:22 quinn * Updated External * * Revision 1.14 1995/06/19 12:38:46 quinn @@ -76,6 +85,11 @@ char *odr_errlist[] = "Length of constructed type different from sum of members" }; +char *odr_errmsg(int n) +{ + return odr_errlist[n]; +} + void odr_perror(ODR o, char *message) { fprintf(stderr, "%s: %s\n", message, odr_errlist[o->error]); @@ -96,7 +110,7 @@ ODR odr_createmem(int direction) struct odr *r; if (!(r = malloc(sizeof(*r)))) - return 0; + return 0; r->direction = direction; r->print = stderr; r->buf = 0; @@ -129,9 +143,9 @@ void odr_destroy(ODR o) { odr_release_mem(o->mem); if (o->ecb.buf && o->ecb.can_grow) - free(o->ecb.buf); + free(o->ecb.buf); if (o->print != stderr) - fclose(o->print); + fclose(o->print); free(o); } @@ -150,6 +164,6 @@ char *odr_getbuf(ODR o, int *len, int *size) { *len = o->ecb.top; if (size) - *size = o->ecb.size; + *size = o->ecb.size; return (char*) o->ecb.buf; }